From 71268c5babaecb383fdce87d68fb98f7d37ed4ac Mon Sep 17 00:00:00 2001 From: Due07 <81630137+Due07@users.noreply.github.com> Date: Tue, 13 Sep 2022 14:40:27 +0800 Subject: [PATCH 01/23] Utils: update date-util.js (#22099) Co-authored-by: xulongtai --- src/utils/date-util.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/utils/date-util.js b/src/utils/date-util.js index 1828adfc2..9e8a2f4af 100644 --- a/src/utils/date-util.js +++ b/src/utils/date-util.js @@ -48,19 +48,9 @@ export const parseDate = function(string, format) { }; export const getDayCountOfMonth = function(year, month) { - if (month === 3 || month === 5 || month === 8 || month === 10) { - return 30; - } + if (isNaN(+month)) return 31; - if (month === 1) { - if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) { - return 29; - } else { - return 28; - } - } - - return 31; + return new Date(year, +month + 1, 0).getDate(); }; export const getDayCountOfYear = function(year) { From d33c4e0c028d5c23ccbe5c5706c8427ebd3aa0c3 Mon Sep 17 00:00:00 2001 From: TC <1348505061@qq.com> Date: Tue, 13 Sep 2022 14:49:52 +0800 Subject: [PATCH 02/23] DatePicker: add months And years type (#21918) --- examples/docs/en-US/date-picker.md | 24 +++++++++++-- examples/docs/es/date-picker.md | 24 +++++++++++-- examples/docs/zh-CN/date-picker.md | 24 +++++++++++-- .../date-picker/src/basic/month-table.vue | 15 ++++++++ packages/date-picker/src/basic/year-table.vue | 14 ++++++-- packages/date-picker/src/panel/date.vue | 24 +++++++++---- packages/date-picker/src/picker.vue | 36 ++++++++++++++++--- 7 files changed, 142 insertions(+), 19 deletions(-) diff --git a/examples/docs/en-US/date-picker.md b/examples/docs/en-US/date-picker.md index 0b43664fe..54c3da8cb 100644 --- a/examples/docs/en-US/date-picker.md +++ b/examples/docs/en-US/date-picker.md @@ -112,6 +112,24 @@ You can choose week, month, year or multiple dates by extending the standard dat +
+
+ months + + +
+
+ years + + +
+
+ +``` +::: + + +### 倒计时 +:::warning +Suspend is tentative, it ** just pauses the countdown, not the time, because value points to a future time node ** + +If you need to add time to the original, please note that the overall time (the amount of time added and the original time) must be a ** future ** time node, otherwise it is still the end of the countdown +::: +:::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 | - | - | +| decimalSeparator | Setting the decimal point | string | - | . | +| formatter | Custom numerical presentation| v-slot \|({value}) => VNode | - | - | +| groupSeparator | 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 | - | - | +| valueStyle | 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 | + + +### Statistic.Countdown Attributes + +| Attribute | Description | Type | Options | Default | +|------------- |---------------- |---------------- |---------------------- |-------- | +| timeIndices | 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) | +| finish | Launched after the 'countdown' is complete | (value: boolean) | + +### Statistic Methods +| 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 new file mode 100644 index 000000000..ed46adb26 --- /dev/null +++ b/examples/docs/es/statistic.md @@ -0,0 +1,218 @@ +## 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 ** + +If you need to add time to the original, please note that the overall time (the amount of time added and the original time) must be a ** future ** time node, otherwise it is still the end of the countdown +::: +:::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 | - | - | +| decimalSeparator | Setting the decimal point | string | - | . | +| formatter | Custom numerical presentation| v-slot \|({value}) => VNode | - | - | +| groupSeparator | 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 | - | - | +| valueStyle | 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 | + + +### Statistic.Countdown Attributes + +| Attribute | Description | Type | Options | Default | +|------------- |---------------- |---------------- |---------------------- |-------- | +| timeIndices | 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) | +| finish | Launched after the 'countdown' is complete | (value: boolean) | + +### Statistic Methods +| 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 new file mode 100644 index 000000000..2d762eb98 --- /dev/null +++ b/examples/docs/fr-FR/statistic.md @@ -0,0 +1 @@ +## Statistic diff --git a/examples/docs/zh-CN/statistic.md b/examples/docs/zh-CN/statistic.md new file mode 100644 index 000000000..8ea864f6d --- /dev/null +++ b/examples/docs/zh-CN/statistic.md @@ -0,0 +1,216 @@ +## Statistic 统计数值 + +用于突出某个或某组数字时,如显示数值,如金额,排名等。 + +倒计时模式 + + +### 基础用法 + 组件提供千分位的展示,不过可以通过rate来设置相应万分位等 +:::demo +```html + + + + +``` +::: + + +### 倒计时 +:::warning +suspend 暂定,它**只是暂停倒计时,并非暂停了时间,因为value指向的是未来的时间节点**。 + +如果需要在原基础上添加时间,请注意:整体的时间(添加的时间量和原定时间)必须是**未来**的时间节点,否则依旧是倒计时结束 +::: +:::demo 通过 `value` 提供未来的时间,将开启倒计时功能 +```html + + + + +``` +::: + + + + +### Statistic Attributes + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|------------- |---------------- |---------------- |---------------------- |-------- | +| value | 数值内容 | string \| number | - | - | +| decimalSeparator | 设置小数点 | string | - | . | +| formatter | 自定义数值展示| v-slot \|({value}) => VNode | - | - | +| groupSeparator | 设置千分位标识符 | string | - | , | +| precision | 数值精度 | number | - | 0 | +| prefix | 设置数值的前缀 | string \| v-slot | - | - | +| suffix |设置数值的后缀 | string \| v-slot | - | - | +| title | 数值的标题 | string \| v-slot | - | - | +| valueStyle | 设置数值的样式 | style | - | - | +| rate | 设置倍率 | number | - | 1000 | + + +### Statistic Slots +| name | 说明 | +|------|--------| +| prefix | 数值的前缀 | +| suffix | 数值的后缀 | +| formatter | 数值内容 | +| title | 数值的标题 | + + +### Statistic.Countdown Attributes + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|------------- |---------------- |---------------- |---------------------- |-------- | +| timeIndices | 是否开启倒计时功能 | boolean | true\|false | false | +| value | 必填值,输入绑定值 | string | — | — | +| format | 格式化倒计时展示 | string | — | 'HH:mm:ss' | +### Statistic.Countdown Events +| 事件名称 | 说明 | 回调参数 | +|---------|--------|---------| +| change | 在`倒计时`的功能中开启 | (value: Date) | +| finish | 在`倒计时` 完成后启动 | (value: boolean) | + +### Statistic Methods +| 方法名 | 说明 | 参数 |回调参数| +| ---- | ---- | ---- |---- | +| suspend | 暂停倒计时|(value:boolean) |(value: Date) | + + diff --git a/examples/nav.config.json b/examples/nav.config.json index 3377ac933..f648024cd 100644 --- a/examples/nav.config.json +++ b/examples/nav.config.json @@ -192,6 +192,10 @@ { "path": "/result", "title": "Result 结果" + }, + { + "path": "/statistic", + "title": "Statistic 统计数值" } ] }, @@ -621,6 +625,10 @@ { "path": "/drawer", "title": "Drawer" + }, + { + "path": "/statistic", + "title": "Statistic" } ] } @@ -935,6 +943,10 @@ { "path": "/drawer", "title": "Drawer" + }, + { + "path": "/statistic", + "title": "Statistic" } ] } @@ -1249,6 +1261,10 @@ { "path": "/drawer", "title": "Drawer" + }, + { + "path": "/statistic", + "title": "Statistic" } ] } diff --git a/packages/statistic/index.js b/packages/statistic/index.js new file mode 100644 index 000000000..0223bf87e --- /dev/null +++ b/packages/statistic/index.js @@ -0,0 +1,8 @@ +import Statistic from './src/main'; + +/* istanbul ignore next */ +Statistic.install = function(Vue) { + Vue.component(Statistic.name, Statistic); +}; + +export default Statistic; diff --git a/packages/statistic/src/main.vue b/packages/statistic/src/main.vue new file mode 100644 index 000000000..92e7585f0 --- /dev/null +++ b/packages/statistic/src/main.vue @@ -0,0 +1,204 @@ + + + diff --git a/packages/theme-chalk/src/index.scss b/packages/theme-chalk/src/index.scss index 0d81c5311..a965f9efa 100644 --- a/packages/theme-chalk/src/index.scss +++ b/packages/theme-chalk/src/index.scss @@ -77,6 +77,7 @@ @import "./cascader-panel.scss"; @import "./avatar.scss"; @import "./drawer.scss"; +@import "./statistic.scss"; @import "./popconfirm.scss"; @import "./skeleton.scss"; @import "./skeleton-item.scss"; @@ -84,3 +85,4 @@ @import "./descriptions.scss"; @import "./descriptions-item.scss"; @import "./result.scss"; + diff --git a/packages/theme-chalk/src/statistic.scss b/packages/theme-chalk/src/statistic.scss new file mode 100644 index 000000000..d38432cc8 --- /dev/null +++ b/packages/theme-chalk/src/statistic.scss @@ -0,0 +1,36 @@ +@import "mixins/mixins"; +@import "common/var"; + +@include b(statistic) { + width: 100%; + box-sizing: border-box; + margin: 0; + padding: 0; + color: $--color-black; + font-size: 14px; + font-variant: tabular-nums; + line-height: 1.5715; + list-style: none; + font-feature-settings: "tnum"; + text-align: center; + .head { + margin-bottom: 4px; + color: #00000073; + font-size: 14px; + + } + + .con{ + display: flex; + justify-content :center; + align-items: center ; + .number{ + font-size: 20px; + padding: 0 4px; + } + span{ display: inline-block; + margin: 0; + line-height: 100%; + } + } +} \ No newline at end of file diff --git a/src/index.js b/src/index.js index 30340feb0..7ee3ad638 100644 --- a/src/index.js +++ b/src/index.js @@ -81,6 +81,9 @@ import PageHeader from '../packages/page-header/index.js'; import CascaderPanel from '../packages/cascader-panel/index.js'; import Avatar from '../packages/avatar/index.js'; import Drawer from '../packages/drawer/index.js'; + +import Statistic from '../packages/statistic/index.js'; + import Popconfirm from '../packages/popconfirm/index.js'; import Skeleton from '../packages/skeleton/index.js'; import SkeletonItem from '../packages/skeleton-item/index.js'; @@ -88,6 +91,7 @@ import Empty from '../packages/empty/index.js'; import Descriptions from '../packages/descriptions/index.js'; import DescriptionsItem from '../packages/descriptions-item/index.js'; import Result from '../packages/result/index.js'; + import locale from 'element-ui/src/locale'; import CollapseTransition from 'element-ui/src/transitions/collapse-transition'; @@ -168,6 +172,7 @@ const components = [ CascaderPanel, Avatar, Drawer, + Statistic, Popconfirm, Skeleton, SkeletonItem, @@ -296,6 +301,9 @@ export default { CascaderPanel, Avatar, Drawer, + + Statistic, + Popconfirm, Skeleton, SkeletonItem, @@ -303,4 +311,5 @@ export default { Descriptions, DescriptionsItem, Result + }; diff --git a/test/unit/specs/statistic.spec.js b/test/unit/specs/statistic.spec.js new file mode 100644 index 000000000..25b07921c --- /dev/null +++ b/test/unit/specs/statistic.spec.js @@ -0,0 +1,15 @@ +import { createTest, destroyVM } from '../util'; +import Statistic from 'packages/statistic'; + +describe('Statistic', () => { + let vm; + afterEach(() => { + destroyVM(vm); + }); + + it('create', () => { + vm = createTest(Statistic, true); + expect(vm.$el).to.exist; + }); +}); + diff --git a/types/element-ui.d.ts b/types/element-ui.d.ts index 9657a652a..1521ae69e 100644 --- a/types/element-ui.d.ts +++ b/types/element-ui.d.ts @@ -1,378 +1,727 @@ -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 { ElPopconfirm } from './popconfirm' -import { ElSkeleton } from './skeleton' -import { ElSkeletonItem } from './skeleton-item' -import { ElCascaderPanel } from './cascader-panel' -import { ElEmpty } from './empty' -import { ElSpinner } from './spinner' -import { ElDescriptions } from './descriptions' -import { ElDescriptionsItem } from './descriptions-item' -import { ElResult } from './result' - -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 {} - -/** Popconfirm Component */ -export class Popconfirm extends ElPopconfirm {} - -/** Skeleton Component */ -export class Skeleton extends ElSkeleton {} - -/** Skeleton Item Component */ -export class SkeletonItem extends ElSkeletonItem {} - -/** CascaderPanel Component */ -export class CascaderPanel extends ElCascaderPanel {} - -/** Empty Component */ -export class Empty extends ElEmpty {} - -/** Spinner Component */ -export class Spinner extends ElSpinner {} - -/** Description Component */ -export class Descriptions extends ElDescriptions {} - -/** Description Item Component */ -export class DescriptionsItem extends ElDescriptionsItem {} - -/** Result Component */ -export class Result extends ElResult {} \ No newline at end of file + +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' + +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 { ElPopconfirm } from './popconfirm' +import { ElSkeleton } from './skeleton' +import { ElSkeletonItem } from './skeleton-item' +import { ElCascaderPanel } from './cascader-panel' +import { ElEmpty } from './empty' +import { ElSpinner } from './spinner' +import { ElDescriptions } from './descriptions' +import { ElDescriptionsItem } from './descriptions-item' +import { ElResult } from './result' + +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 {} + +/** Popconfirm Component */ +export class Popconfirm extends ElPopconfirm {} + +/** Skeleton Component */ +export class Skeleton extends ElSkeleton {} + +/** Skeleton Item Component */ +export class SkeletonItem extends ElSkeletonItem {} + +/** CascaderPanel Component */ +export class CascaderPanel extends ElCascaderPanel {} + +/** Empty Component */ +export class Empty extends ElEmpty {} + +/** Spinner Component */ +export class Spinner extends ElSpinner {} + +/** Description Component */ +export class Descriptions extends ElDescriptions {} + +/** Description Item Component */ +export class DescriptionsItem extends ElDescriptionsItem {} + +/** Result Component */ +export class Result extends ElResult {} diff --git a/types/statistic.d.ts b/types/statistic.d.ts new file mode 100644 index 000000000..9f9b1fbc7 --- /dev/null +++ b/types/statistic.d.ts @@ -0,0 +1,27 @@ +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 + /** 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 +} From f1c8a261e56acd81b8f591a79fe4f8882c6178cd Mon Sep 17 00:00:00 2001 From: liangmiao <45762508+lm312@users.noreply.github.com> Date: Mon, 14 Nov 2022 16:18:46 +0800 Subject: [PATCH 12/23] Progress: add color prop (#22089) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * el-select添加selected选中颜色配置 * fix: issues #22065, el-progress添加底色,文字颜色的属性 --- packages/progress/src/progress.vue | 16 ++++++++++++---- packages/select/src/option.vue | 23 +++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/packages/progress/src/progress.vue b/packages/progress/src/progress.vue index 182f310a8..d19976e59 100644 --- a/packages/progress/src/progress.vue +++ b/packages/progress/src/progress.vue @@ -15,9 +15,9 @@ aria-valuemax="100" >
-
+
-
{{content}}
+
{{content}}
@@ -26,7 +26,7 @@ @@ -43,7 +43,7 @@
@@ -93,6 +93,14 @@ type: [String, Array, Function], default: '' }, + defineBackColor: { + type: [String, Array, Function], + default: '#ebeef5' + }, + textColor: { + type: [String, Array, Function], + default: '#606266' + }, format: Function }, computed: { diff --git a/packages/select/src/option.vue b/packages/select/src/option.vue index a343b5b94..36ad58e61 100644 --- a/packages/select/src/option.vue +++ b/packages/select/src/option.vue @@ -37,6 +37,10 @@ disabled: { type: Boolean, default: false + }, + selectedColor: { + type: String, + default: '#409EFF' } }, @@ -131,6 +135,24 @@ selectOptionClick() { if (this.disabled !== true && this.groupDisabled !== true) { this.dispatch('ElSelect', 'handleOptionClick', [this, true]); + if (this.selectedColor !== '#409EFF') { + // 如果不是默认的颜色 + if (this.$el.className === 'el-select-dropdown__item selected hover' || + this.$el.className === 'el-select-dropdown__item hover' + ) { + let siblingsNode = this.$parent.$children; + siblingsNode.forEach(item=>{ + if (item.$el.className === 'el-select-dropdown__item' || + item.$el.className === 'el-select-dropdown__item selected') { + item.$el.style.color = '#606266'; + } + }); + this.$el.style.color = this.selectedColor; + } else { + this.$el.style.color = '#606266'; + } + + } } }, @@ -150,6 +172,7 @@ this.$on('queryChange', this.queryChange); this.$on('handleGroupDisabled', this.handleGroupDisabled); + }, beforeDestroy() { From d34196d816538bc998fcc2607eb204fdeba92a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D1=8F=CF=85z=CE=B1=CE=B9=CE=B7=CE=B9?= Date: Mon, 14 Nov 2022 16:24:52 +0800 Subject: [PATCH 13/23] i18n: Fix Malaysian translation (#22185) --- src/locale/lang/ms.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/locale/lang/ms.js b/src/locale/lang/ms.js index 30cc40fca..cdf4331db 100644 --- a/src/locale/lang/ms.js +++ b/src/locale/lang/ms.js @@ -14,7 +14,7 @@ export default { selectTime: 'Pilih Masa', startDate: 'Tarikh Mula', startTime: 'Masa Mula', - endDate: 'Tarik Tamat', + endDate: 'Tarikh Tamat', endTime: 'Masa Tamat', prevYear: 'Tahun Lepas', nextYear: 'Tahun Depan', @@ -33,7 +33,6 @@ export default { month10: 'Oktober', month11: 'November', month12: 'Disember', - // week: '周次', weeks: { sun: 'Ahad', mon: 'Isnin', @@ -68,7 +67,7 @@ export default { noMatch: 'Tiada maklumat yang sepadan', loading: 'Sedang dimuat turun', placeholder: 'Sila pilih', - noData: 'Tiada maklumat buat sementara' + noData: 'Tiada maklumat' }, pagination: { goto: 'Seterusnya', @@ -80,23 +79,23 @@ export default { title: 'Tip', confirm: 'Sah', cancel: 'Batal', - error: 'Data yang diisikan tidak sah!' + error: 'Data yang diisi tidak sah!' }, upload: { deleteTip: 'Tekan "Padam" untuk memadam', delete: 'Padam', - preview: 'Semak gambar', + preview: 'Pratonton gambar', continue: 'Meneruskan muat naik' }, table: { - emptyText: 'Tiada maklumat buat sementara', + emptyText: 'Tiada maklumat', confirmFilter: 'Tapis', resetFilter: 'Set Semula', clearFilter: 'Semua', sumText: 'Jumlah' }, tree: { - emptyText: 'Tiada maklumat buat sementara' + emptyText: 'Tiada maklumat' }, transfer: { noMatch: 'Tiada maklumat yang sepadan', @@ -117,7 +116,7 @@ export default { cancelButtonText: 'Batal' }, empty: { - description: 'Tiada maklumat buat sementara' + description: 'Tiada maklumat' } } }; From ddbf9df05d4c94e98cf94af57499569511fd33fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Tue, 15 Nov 2022 11:37:18 +0800 Subject: [PATCH 14/23] chore: update docs and fix bugs --- components.json | 2 +- examples/docs/en-US/progress.md | 4 +- examples/docs/en-US/statistic.md | 20 ++- examples/docs/es/progress.md | 4 +- examples/docs/es/statistic.md | 20 ++- examples/docs/fr-FR/progress.md | 4 +- examples/docs/fr-FR/statistic.md | 217 +++++++++++++++++++++++++++- examples/docs/zh-CN/progress.md | 4 +- examples/docs/zh-CN/statistic.md | 18 +-- packages/select/src/option.vue | 23 --- packages/theme-chalk/src/index.scss | 1 - src/index.js | 6 - 12 files changed, 256 insertions(+), 67 deletions(-) diff --git a/components.json b/components.json index 27f0b1039..76515c414 100644 --- a/components.json +++ b/components.json @@ -80,7 +80,7 @@ "cascader-panel": "./packages/cascader-panel/index.js", "avatar": "./packages/avatar/index.js", "drawer": "./packages/drawer/index.js", - "statistic": "./packages/statistic/index.js" + "statistic": "./packages/statistic/index.js", "popconfirm": "./packages/popconfirm/index.js", "skeleton": "./packages/skeleton/index.js", "skeleton-item": "./packages/skeleton-item/index.js", diff --git a/examples/docs/en-US/progress.md b/examples/docs/en-US/progress.md index bba04431d..b396ba095 100644 --- a/examples/docs/en-US/progress.md +++ b/examples/docs/en-US/progress.md @@ -171,4 +171,6 @@ You also can specify `type` attribute to `dashboard` to use dashboard progress b | width | the canvas width of circle progress bar | number | — | 126 | | show-text | whether to show percentage | boolean | — | true | | stroke-linecap | circle/dashboard type shape at the end path | string | butt/round/square | round | -| format | custom text format | function(percentage) | — | — | \ No newline at end of file +| format | custom text format | function(percentage) | — | — | +| define-back-color | background color of progress bar (hex format) | string | — | — | +| text-color | text color of progress bar (hex format) | string | — | — | \ No newline at end of file diff --git a/examples/docs/en-US/statistic.md b/examples/docs/en-US/statistic.md index ed46adb26..d4072a124 100644 --- a/examples/docs/en-US/statistic.md +++ b/examples/docs/en-US/statistic.md @@ -2,8 +2,6 @@ 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 @@ -16,7 +14,7 @@ The component provides a thousandth place display, but you can use rate to set t
- +
@@ -31,7 +29,7 @@ The component provides a thousandth place display, but you can use rate to set t
- + @@ -94,14 +92,14 @@ If you need to add time to the original, please note that the overall time (the
- +
- + @@ -122,7 +120,7 @@ If you need to add time to the original, please note that the overall time (the
万事成蹉跎
- + @@ -177,14 +175,14 @@ export default { | Attribute | Description | Type | Accepted Values | Default | |------------- |---------------- |---------------- |---------------------- |-------- | | value | Numerical content | string \| number | - | - | -| decimalSeparator | Setting the decimal point | string | - | . | +| decimal-separator | Setting the decimal point | string | - | . | | formatter | Custom numerical presentation| v-slot \|({value}) => VNode | - | - | -| groupSeparator | Sets the thousandth identifier | string | - | , | +| 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 | - | - | -| valueStyle | Styles numeric values | style | - | - | +| value-style | Styles numeric values | style | - | - | | rate | Set the ratio | number | - | 1000 | @@ -201,7 +199,7 @@ export default { | Attribute | Description | Type | Options | Default | |------------- |---------------- |---------------- |---------------------- |-------- | -| timeIndices | Whether to enable the countdown function | boolean | true\|false | false | +| 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 diff --git a/examples/docs/es/progress.md b/examples/docs/es/progress.md index 8ecc119c6..4191ead02 100644 --- a/examples/docs/es/progress.md +++ b/examples/docs/es/progress.md @@ -169,4 +169,6 @@ Puede utilizar el atributo `color` para establecer el color de la barra de progr | width | ancho del canvas que contiene la barra de progreso circula | number | — | 126 | | show-text | mostrar porcentaje | boolean | — | true | | stroke-linecap | circle/dashboard tipo de diseño al final del camino | string | butt/round/square | round | -| format | personalizar el formato de texto estableciendo format | function(percentage) | — | — | \ No newline at end of file +| format | personalizar el formato de texto estableciendo format | function(percentage) | — | — | +| define-back-color | background color of progress bar (hex format) | string | — | — | +| text-color | text color of progress bar (hex format) | string | — | — | \ No newline at end of file diff --git a/examples/docs/es/statistic.md b/examples/docs/es/statistic.md index ed46adb26..ed8405daf 100644 --- a/examples/docs/es/statistic.md +++ b/examples/docs/es/statistic.md @@ -2,8 +2,6 @@ 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 @@ -16,7 +14,7 @@ The component provides a thousandth place display, but you can use rate to set t
- +
@@ -31,7 +29,7 @@ The component provides a thousandth place display, but you can use rate to set t
- + @@ -94,14 +92,14 @@ If you need to add time to the original, please note that the overall time (the
- +
- + @@ -122,7 +120,7 @@ If you need to add time to the original, please note that the overall time (the
万事成蹉跎
- + @@ -177,14 +175,14 @@ export default { | Attribute | Description | Type | Accepted Values | Default | |------------- |---------------- |---------------- |---------------------- |-------- | | value | Numerical content | string \| number | - | - | -| decimalSeparator | Setting the decimal point | string | - | . | +| decimal-separator | Setting the decimal point | string | - | . | | formatter | Custom numerical presentation| v-slot \|({value}) => VNode | - | - | -| groupSeparator | Sets the thousandth identifier | string | - | , | +| 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 | - | - | -| valueStyle | Styles numeric values | style | - | - | +| value-style | Styles numeric values | style | - | - | | rate | Set the ratio | number | - | 1000 | @@ -201,7 +199,7 @@ export default { | Attribute | Description | Type | Options | Default | |------------- |---------------- |---------------- |---------------------- |-------- | -| timeIndices | Whether to enable the countdown function | boolean | true\|false | false | +| 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 diff --git a/examples/docs/fr-FR/progress.md b/examples/docs/fr-FR/progress.md index 347eb44d9..36e792f2d 100644 --- a/examples/docs/fr-FR/progress.md +++ b/examples/docs/fr-FR/progress.md @@ -172,4 +172,6 @@ Vous pouvez également spécifier l'attribut `type` de `dashboard` pour utiliser | width | La largeur du canvas dans le cas d'une barre circulaire. | number | — | 126 | | show-text | Si le pourcentage doit être affiché. | boolean | — | true | | stroke-linecap | circle/dashboard type shape at the end path | string | butt/round/square | round | -| format | Vous pouvez personnaliser le format du texte en définissant le format | function(percentage) | — | — | \ No newline at end of file +| format | Vous pouvez personnaliser le format du texte en définissant le format | function(percentage) | — | — | +| define-back-color | background color of progress bar (hex format) | string | — | — | +| text-color | text color of progress bar (hex format) | string | — | — | \ No newline at end of file diff --git a/examples/docs/fr-FR/statistic.md b/examples/docs/fr-FR/statistic.md index 2d762eb98..d4072a124 100644 --- a/examples/docs/fr-FR/statistic.md +++ b/examples/docs/fr-FR/statistic.md @@ -1 +1,216 @@ -## 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 ** + +If you need to add time to the original, please note that the overall time (the amount of time added and the original time) must be a ** future ** time node, otherwise it is still the end of the countdown +::: +:::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 | + + +### Statistic Slots +| Name | Description | +|------|--------| +| prefix | Numeric prefix | +| suffix | Suffixes for numeric values | +| formatter | Numerical content | +| title | Numeric titles | + + +### 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' | +### Statistic.Countdown Events +| 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) | + + diff --git a/examples/docs/zh-CN/progress.md b/examples/docs/zh-CN/progress.md index c3e916d13..74b542f20 100644 --- a/examples/docs/zh-CN/progress.md +++ b/examples/docs/zh-CN/progress.md @@ -175,4 +175,6 @@ Progress 组件可通过 `type` 属性来指定使用环形进度条,在环形 | width | 环形进度条画布宽度(只在 type 为 circle 或 dashboard 时可用) | number | | 126 | | show-text | 是否显示进度条文字内容 | boolean | — | true | | stroke-linecap | circle/dashboard 类型路径两端的形状 | string | butt/round/square | round | -| format | 指定进度条文字内容 | function(percentage) | — | — | \ No newline at end of file +| format | 指定进度条文字内容 | function(percentage) | — | — | +| define-back-color | 指定进度条底色(支持 hex 格式) | string | — | — | +| text-color | 指定进度条字体颜色(支持 hex 格式) | string | — | — | diff --git a/examples/docs/zh-CN/statistic.md b/examples/docs/zh-CN/statistic.md index 8ea864f6d..62402f986 100644 --- a/examples/docs/zh-CN/statistic.md +++ b/examples/docs/zh-CN/statistic.md @@ -14,7 +14,7 @@
- +
@@ -29,7 +29,7 @@
- + @@ -92,14 +92,14 @@ suspend 暂定,它**只是暂停倒计时,并非暂停了时间,因为valu
- +
- + @@ -120,7 +120,7 @@ suspend 暂定,它**只是暂停倒计时,并非暂停了时间,因为valu
万事成蹉跎
- + @@ -175,14 +175,14 @@ export default { | 参数 | 说明 | 类型 | 可选值 | 默认值 | |------------- |---------------- |---------------- |---------------------- |-------- | | value | 数值内容 | string \| number | - | - | -| decimalSeparator | 设置小数点 | string | - | . | +| decimal-separator | 设置小数点 | string | - | . | | formatter | 自定义数值展示| v-slot \|({value}) => VNode | - | - | -| groupSeparator | 设置千分位标识符 | string | - | , | +| group-separator | 设置千分位标识符 | string | - | , | | precision | 数值精度 | number | - | 0 | | prefix | 设置数值的前缀 | string \| v-slot | - | - | | suffix |设置数值的后缀 | string \| v-slot | - | - | | title | 数值的标题 | string \| v-slot | - | - | -| valueStyle | 设置数值的样式 | style | - | - | +| value-style | 设置数值的样式 | style | - | - | | rate | 设置倍率 | number | - | 1000 | @@ -199,7 +199,7 @@ export default { | 参数 | 说明 | 类型 | 可选值 | 默认值 | |------------- |---------------- |---------------- |---------------------- |-------- | -| timeIndices | 是否开启倒计时功能 | boolean | true\|false | false | +| time-indices | 是否开启倒计时功能 | boolean | true\|false | false | | value | 必填值,输入绑定值 | string | — | — | | format | 格式化倒计时展示 | string | — | 'HH:mm:ss' | ### Statistic.Countdown Events diff --git a/packages/select/src/option.vue b/packages/select/src/option.vue index 36ad58e61..a343b5b94 100644 --- a/packages/select/src/option.vue +++ b/packages/select/src/option.vue @@ -37,10 +37,6 @@ disabled: { type: Boolean, default: false - }, - selectedColor: { - type: String, - default: '#409EFF' } }, @@ -135,24 +131,6 @@ selectOptionClick() { if (this.disabled !== true && this.groupDisabled !== true) { this.dispatch('ElSelect', 'handleOptionClick', [this, true]); - if (this.selectedColor !== '#409EFF') { - // 如果不是默认的颜色 - if (this.$el.className === 'el-select-dropdown__item selected hover' || - this.$el.className === 'el-select-dropdown__item hover' - ) { - let siblingsNode = this.$parent.$children; - siblingsNode.forEach(item=>{ - if (item.$el.className === 'el-select-dropdown__item' || - item.$el.className === 'el-select-dropdown__item selected') { - item.$el.style.color = '#606266'; - } - }); - this.$el.style.color = this.selectedColor; - } else { - this.$el.style.color = '#606266'; - } - - } } }, @@ -172,7 +150,6 @@ this.$on('queryChange', this.queryChange); this.$on('handleGroupDisabled', this.handleGroupDisabled); - }, beforeDestroy() { diff --git a/packages/theme-chalk/src/index.scss b/packages/theme-chalk/src/index.scss index a965f9efa..00183c6fd 100644 --- a/packages/theme-chalk/src/index.scss +++ b/packages/theme-chalk/src/index.scss @@ -85,4 +85,3 @@ @import "./descriptions.scss"; @import "./descriptions-item.scss"; @import "./result.scss"; - diff --git a/src/index.js b/src/index.js index 7ee3ad638..4a1903922 100644 --- a/src/index.js +++ b/src/index.js @@ -81,9 +81,7 @@ import PageHeader from '../packages/page-header/index.js'; import CascaderPanel from '../packages/cascader-panel/index.js'; import Avatar from '../packages/avatar/index.js'; import Drawer from '../packages/drawer/index.js'; - import Statistic from '../packages/statistic/index.js'; - import Popconfirm from '../packages/popconfirm/index.js'; import Skeleton from '../packages/skeleton/index.js'; import SkeletonItem from '../packages/skeleton-item/index.js'; @@ -91,7 +89,6 @@ import Empty from '../packages/empty/index.js'; import Descriptions from '../packages/descriptions/index.js'; import DescriptionsItem from '../packages/descriptions-item/index.js'; import Result from '../packages/result/index.js'; - import locale from 'element-ui/src/locale'; import CollapseTransition from 'element-ui/src/transitions/collapse-transition'; @@ -301,9 +298,7 @@ export default { CascaderPanel, Avatar, Drawer, - Statistic, - Popconfirm, Skeleton, SkeletonItem, @@ -311,5 +306,4 @@ export default { Descriptions, DescriptionsItem, Result - }; From 28d6e030ebec6d7f5eafd865212f3a63b1489a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Tue, 15 Nov 2022 14:52:19 +0800 Subject: [PATCH 15/23] chore: add changelog --- CHANGELOG.en-US.md | 19 +++++++++++++++++++ CHANGELOG.es.md | 19 +++++++++++++++++++ CHANGELOG.fr-FR.md | 19 +++++++++++++++++++ CHANGELOG.zh-CN.md | 19 +++++++++++++++++++ README.md | 2 +- 5 files changed, 77 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 4f1e053d0..cb7baf15a 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -1,5 +1,24 @@ ## Changelog +### 2.15.11 + +*2022-11-15* + +#### Bug fixes +- Docs + - Fix Radio docs (#22178 by @bchen1029) + - Fix Progress docs +#### Optimization +- I18n + - Update translation of Malaysian (#22185 by @z4q) + - Update translation of Norwegian (#22145 by @Barsnes) +- Progress + - Add defineBackColor and textColor prop (#22089 by @lm312) +- Statistics + - Add new component Statistics (#22159 by @webvs2) +- Other + - Add Web Types to improve code assistance in WebStorm IDE and other JetBrains IDEs (#22135 by @piotrtomiak) + ### 2.15.10 *2022-09-13* diff --git a/CHANGELOG.es.md b/CHANGELOG.es.md index 95c2fc3c5..cac747040 100644 --- a/CHANGELOG.es.md +++ b/CHANGELOG.es.md @@ -1,5 +1,24 @@ ## Changelog +### 2.15.11 + +*2022-11-15* + +#### Bug fixes +- Docs + - Fix Radio docs (#22178 by @bchen1029) + - Fix Progress docs +#### Optimization +- I18n + - Update translation of Malaysian (#22185 by @z4q) + - Update translation of Norwegian (#22145 by @Barsnes) +- Progress + - Add defineBackColor and textColor prop (#22089 by @lm312) +- Statistics + - Add new component Statistics (#22159 by @webvs2) +- Other + - Add Web Types to improve code assistance in WebStorm IDE and other JetBrains IDEs (#22135 by @piotrtomiak) + ### 2.15.10 *2022-09-13* diff --git a/CHANGELOG.fr-FR.md b/CHANGELOG.fr-FR.md index 62354f7dd..d64c9f8a1 100644 --- a/CHANGELOG.fr-FR.md +++ b/CHANGELOG.fr-FR.md @@ -1,5 +1,24 @@ ## Changelog +### 2.15.11 + +*2022-11-15* + +#### Bug fixes +- Docs + - Fix Radio docs (#22178 by @bchen1029) + - Fix Progress docs +#### Optimization +- I18n + - Update translation of Malaysian (#22185 by @z4q) + - Update translation of Norwegian (#22145 by @Barsnes) +- Progress + - Add defineBackColor and textColor prop (#22089 by @lm312) +- Statistics + - Add new component Statistics (#22159 by @webvs2) +- Other + - Add Web Types to improve code assistance in WebStorm IDE and other JetBrains IDEs (#22135 by @piotrtomiak) + ### 2.15.10 *2022-09-13* diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index f8b0d4ae1..7a4b165cf 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -1,5 +1,24 @@ ## 更新日志 +### 2.15.11 + +*2022-11-15* + +#### Bug 修复 +- Docs + - 修复 Radio 文案 (#22178 by @bchen1029) + - 修复 Progress 文案 +#### 优化 +- I18n + - 更新 马来西亚语 翻译 (#22185 by @z4q) + - 更新 挪威语 翻译 (#22145 by @Barsnes) +- Progress + - 新增 defineBackColor 和 textColor 属性 (#22089 by @lm312) +- Statistics + - 新增组件 Statistics (#22159 by @webvs2) +- Other + - 改进WebStorm IDE和其他JetBrains IDE中的代码帮助 (#22135 by @piotrtomiak) + ### 2.15.10 *2022-09-13* diff --git a/README.md b/README.md index 059b6ce7d..ad61d8c5e 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Element will stay with Vue 2.x -For Vue 3.0, we recommend using [Element Plus](https://github.com/element-plus/element-plus) from the same team (Element Plus is a community develop project) +For Vue 3.0, we recommend using [Element Plus](https://github.com/element-plus/element-plus)(Element Plus is a community develop project) ## Links - Homepage and documentation From 7cfd274e491d02218fdae70d85a798ac19affca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Tue, 15 Nov 2022 15:06:55 +0800 Subject: [PATCH 16/23] Docs: code optimization --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index ad61d8c5e..7abad78f3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@

- 1212

From b308372ddb3898cdd5f5cd85a82d272f1f747285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Tue, 15 Nov 2022 20:05:23 +0800 Subject: [PATCH 17/23] [build] 2.15.11 --- 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 55cbc60e5..05ff50edd 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.10":"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.11":"2.15"} \ No newline at end of file diff --git a/packages/theme-chalk/package.json b/packages/theme-chalk/package.json index fd1a7642e..ae10a8f19 100644 --- a/packages/theme-chalk/package.json +++ b/packages/theme-chalk/package.json @@ -1,6 +1,6 @@ { "name": "element-theme-chalk", - "version": "2.15.10", + "version": "2.15.11", "description": "Element component chalk theme.", "main": "lib/index.css", "style": "lib/index.css", diff --git a/src/index.js b/src/index.js index 4a1903922..b3f8c3657 100644 --- a/src/index.js +++ b/src/index.js @@ -212,7 +212,7 @@ if (typeof window !== 'undefined' && window.Vue) { } export default { - version: '2.15.10', + version: '2.15.11', locale: locale.use, i18n: locale.i18n, install, From 1e969ef72a467a86eedb537aa9858aa0e3437a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Tue, 15 Nov 2022 20:05:25 +0800 Subject: [PATCH 18/23] [release] 2.15.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6f94a5d1b..7690d532b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "element-ui", - "version": "2.15.10", + "version": "2.15.11", "description": "A Component Library for Vue.js.", "main": "lib/element-ui.common.js", "files": [ From e33c040aa8207960f518f698f8a7fe9c6b5a0175 Mon Sep 17 00:00:00 2001 From: yang <30883395+webvs2@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:07:36 +0800 Subject: [PATCH 19/23] =?UTF-8?q?Statistic=EF=BC=9AFixed=20the=20thousandt?= =?UTF-8?q?h=20bit=20bug=20(#22252)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * statistic:Fixed the thousandth bit bug statistic:Fixed the thousandth bit bug * Modifying Spaces Modifying Spaces --- packages/statistic/src/main.vue | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/statistic/src/main.vue b/packages/statistic/src/main.vue index 92e7585f0..220865cab 100644 --- a/packages/statistic/src/main.vue +++ b/packages/statistic/src/main.vue @@ -102,7 +102,6 @@ export default { }, methods: { branch() { - // console.log('timeIndices', this.timeIndices); if (this.timeIndices) { clearInterval(this.timeTask); this.countDown(); @@ -110,12 +109,13 @@ export default { this.dispose(); } }, - - magnification(num, mulriple = 1000, groupSeparator = ',') { // magnification factor - if (_.isNumber(num)) return false; - let result = String(_.divide(num, mulriple)) - .split('.') - .join(groupSeparator || ','); + magnification(num, _mulriple = 1000, _groupSeparator = ',') { // magnification factor + const level = String(_mulriple).length - 1; + const reg = new RegExp(`\\d{1,${level}}(?=(\\d{${level}})+$)`, 'g'); + const result = String(num) + .replace(reg, '$&,') + .split(',') + .join(_groupSeparator); return result; }, dispose() { @@ -192,7 +192,6 @@ export default { return (result); }; this.timeTask = setInterval(function() { - // console.log(diffTiem); if (disappearTime(diffTiem)) clearInterval(than.timeTask); diffTiem = diffTiem < REFRESH_INTERVAL ? 0 : diffTiem - REFRESH_INTERVAL; than.disposeValue = formatTimeStr(format, diffTiem); From 5e62e88133df6b775a05a2f0a0d9065d130e90f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Wed, 16 Nov 2022 00:21:22 +0800 Subject: [PATCH 20/23] chore: add changelog --- CHANGELOG.en-US.md | 10 ++++++++++ CHANGELOG.es.md | 10 ++++++++++ CHANGELOG.fr-FR.md | 10 ++++++++++ CHANGELOG.zh-CN.md | 10 ++++++++++ 4 files changed, 40 insertions(+) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index cb7baf15a..449dcbf85 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -1,5 +1,15 @@ ## Changelog +### 2.15.12 + +*2022-11-16* + +#### Bug fixes +- Statistic: + - Fixed the thousandth bit bug (#22252 by @webvs2) +- Other + - Fix 2.15.11 element-theme-chalk publish fail bug + ### 2.15.11 *2022-11-15* diff --git a/CHANGELOG.es.md b/CHANGELOG.es.md index cac747040..5bfd57b70 100644 --- a/CHANGELOG.es.md +++ b/CHANGELOG.es.md @@ -1,5 +1,15 @@ ## Changelog +### 2.15.12 + +*2022-11-16* + +#### Bug fixes +- Statistic: + - Fixed the thousandth bit bug (#22252 by @webvs2) +- Other + - Fix 2.15.11 element-theme-chalk publish fail bug + ### 2.15.11 *2022-11-15* diff --git a/CHANGELOG.fr-FR.md b/CHANGELOG.fr-FR.md index d64c9f8a1..0a9f29d94 100644 --- a/CHANGELOG.fr-FR.md +++ b/CHANGELOG.fr-FR.md @@ -1,5 +1,15 @@ ## Changelog +### 2.15.12 + +*2022-11-16* + +#### Bug fixes +- Statistic: + - Fixed the thousandth bit bug (#22252 by @webvs2) +- Other + - Fix 2.15.11 element-theme-chalk publish fail bug + ### 2.15.11 *2022-11-15* diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 7a4b165cf..5c75e2364 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -1,5 +1,15 @@ ## 更新日志 +### 2.15.12 + +*2022-11-16* + +#### Bug 修复 +- Statistics + - 修改 千分位 问题 (#22252 by @webvs2) +- 其他 + - 修复 2.15.11版本element-theme-chalk未成功发布 问题 + ### 2.15.11 *2022-11-15* From d1c68959245ce016df416bfb332245568a0484b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Wed, 16 Nov 2022 01:30:35 +0800 Subject: [PATCH 21/23] [build] 2.15.12 --- 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 05ff50edd..fc2abfae8 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.11":"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.12":"2.15"} \ No newline at end of file diff --git a/packages/theme-chalk/package.json b/packages/theme-chalk/package.json index ae10a8f19..7797ba453 100644 --- a/packages/theme-chalk/package.json +++ b/packages/theme-chalk/package.json @@ -1,6 +1,6 @@ { "name": "element-theme-chalk", - "version": "2.15.11", + "version": "2.15.12", "description": "Element component chalk theme.", "main": "lib/index.css", "style": "lib/index.css", diff --git a/src/index.js b/src/index.js index b3f8c3657..55b2922e6 100644 --- a/src/index.js +++ b/src/index.js @@ -212,7 +212,7 @@ if (typeof window !== 'undefined' && window.Vue) { } export default { - version: '2.15.11', + version: '2.15.12', locale: locale.use, i18n: locale.i18n, install, From 425235b1fefb3b2298bb9f2526240891abf32dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Wed, 16 Nov 2022 01:32:00 +0800 Subject: [PATCH 22/23] [release] 2.15.12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7690d532b..3b26605e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "element-ui", - "version": "2.15.11", + "version": "2.15.12", "description": "A Component Library for Vue.js.", "main": "lib/element-ui.common.js", "files": [ From fa18776b4b40088e9144d8ea529be73c283bdcd5 Mon Sep 17 00:00:00 2001 From: yang <30883395+webvs2@users.noreply.github.com> Date: Fri, 18 Nov 2022 11:03:15 +0800 Subject: [PATCH 23/23] =?UTF-8?q?statistic=EF=BC=9AUpdated=20countdown=20f?= =?UTF-8?q?eature=20to=20localize=20lodash=20=20=20Closes=20=20#22260=20?= =?UTF-8?q?=20Closes#22258=20(#22263)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * statistic:Fixed the thousandth bit bug statistic:Fixed the thousandth bit bug * Modifying Spaces Modifying Spaces * statistic:Updated countdown feature to localize lodash * Add lodash localization filtering * statistic:Under the default font, the problem caused by the non-equal width font, causing the countdown to jitter, will be replaced with a concise font --- .eslintignore | 1 + build/config.js | 2 +- packages/statistic/src/main.vue | 137 +- packages/theme-chalk/src/statistic.scss | 1 + src/utils/lodash.js | 18075 ++++++++++++++++++++++ 5 files changed, 18150 insertions(+), 66 deletions(-) create mode 100644 src/utils/lodash.js diff --git a/.eslintignore b/.eslintignore index aa9517397..a446c8da8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,6 @@ src/utils/popper.js src/utils/date.js +src/utils/lodash.js examples/play *.sh node_modules diff --git a/build/config.js b/build/config.js index eaaa990af..493673099 100644 --- a/build/config.js +++ b/build/config.js @@ -46,4 +46,4 @@ exports.vue = { amd: 'vue' }; -exports.jsexclude = /node_modules|utils\/popper\.js|utils\/date\.js/; +exports.jsexclude = /node_modules|utils\/popper\.js|utils\/date\.js|utils\/lodash\.js/; diff --git a/packages/statistic/src/main.vue b/packages/statistic/src/main.vue index 220865cab..1d7a6130c 100644 --- a/packages/statistic/src/main.vue +++ b/packages/statistic/src/main.vue @@ -1,4 +1,4 @@ -