From e3974850fad158364c2caefb3dc17aa99056d9d9 Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Tue, 14 Jun 2022 14:00:33 +0800 Subject: [PATCH 01/13] fix: Radio.Group focus and blur should work (#36041) --- components/radio/__tests__/group.test.js | 14 ++- components/radio/group.tsx | 154 +++++++++++------------ components/radio/interface.tsx | 2 + 3 files changed, 91 insertions(+), 79 deletions(-) diff --git a/components/radio/__tests__/group.test.js b/components/radio/__tests__/group.test.js index cf62cccc24..dcb4203537 100644 --- a/components/radio/__tests__/group.test.js +++ b/components/radio/__tests__/group.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { mount, render } from 'enzyme'; -import { render as testLibRender } from '@testing-library/react'; +import { fireEvent, render as testLibRender } from '@testing-library/react'; import Radio from '..'; describe('Radio Group', () => { @@ -224,4 +224,16 @@ describe('Radio Group', () => { }); }); }); + + it('onBlur & onFocus should work', () => { + const handleBlur = jest.fn(); + const handleFocus = jest.fn(); + const { container } = testLibRender( + , + ); + fireEvent.focus(container.firstChild); + expect(handleFocus).toHaveBeenCalledTimes(1); + fireEvent.blur(container.firstChild); + expect(handleBlur).toHaveBeenCalledTimes(1); + }); }); diff --git a/components/radio/group.tsx b/components/radio/group.tsx index 76dead66dc..60ea4703c8 100644 --- a/components/radio/group.tsx +++ b/components/radio/group.tsx @@ -28,93 +28,91 @@ const RadioGroup = React.forwardRef((props, ref } }; - const renderGroup = () => { - const { - prefixCls: customizePrefixCls, - className = '', - options, - buttonStyle = 'outline' as RadioGroupButtonStyle, - disabled, - children, - size: customizeSize, - style, - id, - onMouseEnter, - onMouseLeave, - } = props; - const prefixCls = getPrefixCls('radio', customizePrefixCls); - const groupPrefixCls = `${prefixCls}-group`; - let childrenToRender = children; - // 如果存在 options, 优先使用 - if (options && options.length > 0) { - childrenToRender = options.map(option => { - if (typeof option === 'string' || typeof option === 'number') { - // 此处类型自动推导为 string - return ( - - {option} - - ); - } - // 此处类型自动推导为 { label: string value: string } + const { + prefixCls: customizePrefixCls, + className = '', + options, + buttonStyle = 'outline' as RadioGroupButtonStyle, + disabled, + children, + size: customizeSize, + style, + id, + onMouseEnter, + onMouseLeave, + onFocus, + onBlur, + } = props; + const prefixCls = getPrefixCls('radio', customizePrefixCls); + const groupPrefixCls = `${prefixCls}-group`; + let childrenToRender = children; + // 如果存在 options, 优先使用 + if (options && options.length > 0) { + childrenToRender = options.map(option => { + if (typeof option === 'string' || typeof option === 'number') { + // 此处类型自动推导为 string return ( - {option.label} + {option} ); - }); - } + } + // 此处类型自动推导为 { label: string value: string } + return ( + + {option.label} + + ); + }); + } - const mergedSize = customizeSize || size; - const classString = classNames( - groupPrefixCls, - `${groupPrefixCls}-${buttonStyle}`, - { - [`${groupPrefixCls}-${mergedSize}`]: mergedSize, - [`${groupPrefixCls}-rtl`]: direction === 'rtl', - }, - className, - ); - return ( -
+ {childrenToRender} -
- ); - }; - - return ( - - {renderGroup()} - + + ); }); diff --git a/components/radio/interface.tsx b/components/radio/interface.tsx index 89143e148f..e38d232829 100644 --- a/components/radio/interface.tsx +++ b/components/radio/interface.tsx @@ -20,6 +20,8 @@ export interface RadioGroupProps extends AbstractCheckboxGroupProps { id?: string; optionType?: RadioGroupOptionType; buttonStyle?: RadioGroupButtonStyle; + onFocus?: React.FocusEventHandler; + onBlur?: React.FocusEventHandler; } export interface RadioGroupContextProps { From 34dfb808ad6ed85a0b7d426d4e531487a39d2385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 15 Jun 2022 17:30:10 +0800 Subject: [PATCH 02/13] feat: Form support `setFieldValue` (#36058) --- components/form/index.en-US.md | 3 ++- components/form/index.zh-CN.md | 3 ++- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index ec0110ea83..50919c7689 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -245,7 +245,8 @@ Provide linkage between forms. If a sub form with `name` prop update, it will au | resetFields | Reset fields to `initialValues` | (fields?: [NamePath](#NamePath)\[]) => void | | | scrollToField | Scroll to field position | (name: [NamePath](#NamePath), options: \[[ScrollOptions](https://github.com/stipsan/scroll-into-view-if-needed/tree/ece40bd9143f48caf4b99503425ecb16b0ad8249#options)]) => void | | | setFields | Set fields status | (fields: [FieldData](#FieldData)\[]) => void | | -| setFieldsValue | Set fields value(Will directly pass to form store. If you do not want to modify passed object, please clone first) | (values) => void | | +| setFieldValue | Set fields value(Will directly pass to form store. If you do not want to modify passed object, please clone first) | (name: [NamePath](#NamePath), value: any) => void | 4.22.0 | +| setFieldsValue | Set fields value(Will directly pass to form store. If you do not want to modify passed object, please clone first). Use `setFieldValue` instead if you want to only config single value in Form.List | (values) => void | | | submit | Submit the form. It's same as click `submit` button | () => void | | | validateFields | Validate fields | (nameList?: [NamePath](#NamePath)\[]) => Promise | | diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index d4f94df523..3b82689f7b 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -244,7 +244,8 @@ Form.List 渲染表单相关操作函数。 | resetFields | 重置一组字段到 `initialValues` | (fields?: [NamePath](#NamePath)\[]) => void | | | scrollToField | 滚动到对应字段位置 | (name: [NamePath](#NamePath), options: [ScrollOptions](https://github.com/stipsan/scroll-into-view-if-needed/tree/ece40bd9143f48caf4b99503425ecb16b0ad8249#options)) => void | | | setFields | 设置一组字段状态 | (fields: [FieldData](#FieldData)\[]) => void | | -| setFieldsValue | 设置表单的值(该值将直接传入 form store 中。如果你不希望传入对象被修改,请克隆后传入) | (values) => void | | +| setFieldValue | 设置表单的值(该值将直接传入 form store 中。如果你不希望传入对象被修改,请克隆后传入) | (name: [NamePath](#NamePath), value: any) => void | 4.22.0 | +| setFieldsValue | 设置表单的值(该值将直接传入 form store 中。如果你不希望传入对象被修改,请克隆后传入)。如果你只想修改 Form.List 中单项值,请通过 `setFieldValue` 进行指定 | (values) => void | | | submit | 提交表单,与点击 `submit` 按钮效果相同 | () => void | | | validateFields | 触发表单验证 | (nameList?: [NamePath](#NamePath)\[]) => Promise | | diff --git a/package.json b/package.json index 2d4aa42010..f5037198a2 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "rc-dialog": "~8.9.0", "rc-drawer": "~4.4.2", "rc-dropdown": "~4.0.0", - "rc-field-form": "~1.26.1", + "rc-field-form": "~1.27.0", "rc-image": "~5.7.0", "rc-input": "~0.0.1-alpha.5", "rc-input-number": "~7.3.0", From d692a88ed723a3bf038e0971e9913c6a62c2e0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=B7=83=E0=B6=BA=E0=B7=94=E0=B6=BB=E0=B7=92=20=7C=20Sayu?= =?UTF-8?q?ri?= <85907926+sayuri-gi@users.noreply.github.com> Date: Wed, 22 Jun 2022 18:38:21 +0700 Subject: [PATCH 03/13] feat: add si_LK locale (#36149) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * දින තේරුම සකස් කිරීම * චීන ප්‍රලේඛනය යාවත්කාල කිරීම * ඉංග්‍රීසි ප්‍රලේඛනය යාවත්කාල කිරීම * තවත් දත්ත ඇතුල් කිරීම * දින දසුනට භාෂාව යෙදීම * ප්‍රධාන දේශීයකරණ සංරචකය යෙදීම * සැපයුම්කරු සඳහා ගොනුව යෙදීම * කාලය තේරීමට අදාළ සංරචකය යෙදීම * යෝජනාව ඇතුළු කෙරිණි Co-authored-by: Amumu * නව ඇසුරුමට වෙනස් කළා * ගොනුව යාවත්කාල කෙරිණි Co-authored-by: Amumu --- components/calendar/locale/si_LK.tsx | 3 + components/date-picker/locale/si_LK.tsx | 28 ++++ .../locale-provider/__tests__/index.test.js | 2 + components/locale-provider/si_LK.tsx | 3 + components/locale/si_LK.tsx | 136 ++++++++++++++++++ components/time-picker/locale/si_LK.tsx | 8 ++ docs/react/i18n.en-US.md | 1 + docs/react/i18n.zh-CN.md | 1 + package.json | 4 +- 9 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 components/calendar/locale/si_LK.tsx create mode 100644 components/date-picker/locale/si_LK.tsx create mode 100644 components/locale-provider/si_LK.tsx create mode 100644 components/locale/si_LK.tsx create mode 100644 components/time-picker/locale/si_LK.tsx diff --git a/components/calendar/locale/si_LK.tsx b/components/calendar/locale/si_LK.tsx new file mode 100644 index 0000000000..15c7d248cc --- /dev/null +++ b/components/calendar/locale/si_LK.tsx @@ -0,0 +1,3 @@ +import siLK from '../../date-picker/locale/si_LK'; + +export default siLK; diff --git a/components/date-picker/locale/si_LK.tsx b/components/date-picker/locale/si_LK.tsx new file mode 100644 index 0000000000..7408ebc55a --- /dev/null +++ b/components/date-picker/locale/si_LK.tsx @@ -0,0 +1,28 @@ +import CalendarLocale from 'rc-picker/lib/locale/si_LK'; +import TimePickerLocale from '../../time-picker/locale/si_LK'; +import type { PickerLocale } from '../generatePicker'; + +// Merge into a locale object +const locale: PickerLocale = { + lang: { + placeholder: 'දිනය තෝරන්න', + yearPlaceholder: 'අවුරුද්ද තෝරන්න', + quarterPlaceholder: 'කාර්තුව තෝරන්න', + monthPlaceholder: 'මාසය තෝරන්න', + weekPlaceholder: 'සතිය තෝරන්න', + rangePlaceholder: ['ආරම්භක දිනය', 'නිමවන දිනය'], + rangeYearPlaceholder: ['ආර්ම්භක අවුරුද්ද', 'නිමවන අවුරුද්ද'], + rangeQuarterPlaceholder: ['ආරම්භක කාර්තුව', 'නිමවන කාර්තුව'], + rangeMonthPlaceholder: ['ආරම්භක මාසය', 'නිමවන මාසය'], + rangeWeekPlaceholder: ['ආරම්භක සතිය', 'නිමවන සතිය'], + ...CalendarLocale, + }, + timePickerLocale: { + ...TimePickerLocale, + }, +}; + +// All settings at: +// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json + +export default locale; diff --git a/components/locale-provider/__tests__/index.test.js b/components/locale-provider/__tests__/index.test.js index b87470b2ab..23f426d255 100644 --- a/components/locale-provider/__tests__/index.test.js +++ b/components/locale-provider/__tests__/index.test.js @@ -68,6 +68,7 @@ import ptBR from '../pt_BR'; import ptPT from '../pt_PT'; import roRO from '../ro_RO'; import ruRU from '../ru_RU'; +import siLK from '../si_LK'; import skSK from '../sk_SK'; import slSI from '../sl_SI'; import srRS from '../sr_RS'; @@ -134,6 +135,7 @@ const locales = [ ptPT, roRO, ruRU, + siLK, skSK, slSI, srRS, diff --git a/components/locale-provider/si_LK.tsx b/components/locale-provider/si_LK.tsx new file mode 100644 index 0000000000..aa719688da --- /dev/null +++ b/components/locale-provider/si_LK.tsx @@ -0,0 +1,3 @@ +import locale from '../locale/si_LK'; + +export default locale; diff --git a/components/locale/si_LK.tsx b/components/locale/si_LK.tsx new file mode 100644 index 0000000000..e051b409c7 --- /dev/null +++ b/components/locale/si_LK.tsx @@ -0,0 +1,136 @@ +/* eslint-disable no-template-curly-in-string */ +import Pagination from 'rc-pagination/lib/locale/si_LK'; +import DatePicker from '../date-picker/locale/si_LK'; +import TimePicker from '../time-picker/locale/si_LK'; +import Calendar from '../calendar/locale/si_LK'; +import type { Locale } from '../locale-provider'; + +const typeTemplate = '${label} වලංගු ${type} ක් නොවේ'; + +const localeValues: Locale = { + locale: 'si', + Pagination, + DatePicker, + TimePicker, + Calendar, + global: { + placeholder: 'කරුණාකර තෝරන්න', + }, + Table: { + filterTitle: 'පෙරහන්', + filterConfirm: 'හරි', + filterReset: 'යළි සකසන්න', + filterEmptyText: 'පෙරහන් නැත', + filterCheckall: 'සියළු අථක තෝරන්න', + filterSearchPlaceholder: 'පෙරහන් තුළ සොයන්න', + emptyText: 'දත්ත නැත', + selectAll: 'වත්මන් පිටුව තෝරන්න', + selectInvert: 'වත්මන් පිටුව යටියනය', + selectNone: 'සියළු දත්ත ඉවතලන්න', + selectionAll: 'සියළු දත්ත තෝරන්න', + sortTitle: 'පෙළගැසීම', + expand: 'පේළිය දිගහරින්න', + collapse: 'පේළිය හකුළන්න', + triggerDesc: 'අවරෝහණව පෙළගැසීමට ඔබන්න', + triggerAsc: 'ආරෝහණව පෙළගැසීමට ඔබන්න', + cancelSort: 'පෙළගැසීම අවලංගු කිරීමට ඔබන්න', + }, + Modal: { + okText: 'හරි', + cancelText: 'අවලංගු කරන්න', + justOkText: 'හරි', + }, + Popconfirm: { + okText: 'හරි', + cancelText: 'අවලංගු කරන්න', + }, + Transfer: { + titles: ['', ''], + searchPlaceholder: 'මෙතැන සොයන්න', + itemUnit: 'අථකය', + itemsUnit: 'අථක', + remove: 'ඉවත් කරන්න', + selectCurrent: 'වත්මන් පිටුව තෝරන්න', + removeCurrent: 'වත්මන් පිටුව ඉවත් කරන්න', + selectAll: 'සියළු දත්ත තෝරන්න', + removeAll: 'සියළු දත්ත ඉවතලන්න', + selectInvert: 'වත්මන් පිටුව යටියනය', + }, + Upload: { + uploading: 'උඩුගත වෙමින්...', + removeFile: 'ගොනුව ඉවතලන්න', + uploadError: 'උඩුගත වීමේ දෝෂයකි', + previewFile: 'ගොනුවේ පෙරදසුන', + downloadFile: 'ගොනුව බාගන්න', + }, + Empty: { + description: 'දත්ත නැත', + }, + Icon: { + icon: 'නිරූපකය', + }, + Text: { + edit: 'සංස්කරණය', + copy: 'පිටපත්', + copied: 'පිටපත් විය', + expand: 'විහිදුවන්න', + }, + PageHeader: { + back: 'ආපසු', + }, + Form: { + optional: '(විකල්පයකි)', + defaultValidateMessages: { + default: '${label} සඳහා ක්‍ෂේත්‍රය වලංගුකරණයේ දෝෂයකි', + required: '${label} ඇතුල් කරන්න', + enum: '[${enum}] වලින් එකක් ${label} විය යුතුය', + whitespace: '${label} හිස් අකුරක් නොවිය යුතුය', + date: { + format: '${label} දිනයේ ආකෘතිය වැරදිය', + parse: '${label} දිනයකට පරිවර්තනය කළ නොහැකිය', + invalid: '${label} වලංගු නොවන දිනයකි', + }, + types: { + string: typeTemplate, + method: typeTemplate, + array: typeTemplate, + object: typeTemplate, + number: typeTemplate, + date: typeTemplate, + boolean: typeTemplate, + integer: typeTemplate, + float: typeTemplate, + regexp: typeTemplate, + email: typeTemplate, + url: typeTemplate, + hex: typeTemplate, + }, + string: { + len: '${label} අකුරු ${len}ක් විය යුතුය', + min: '${label} අවමය අකුරු ${min}ක් විය යුතුය', + max: '${label} අකුරු ${max}ක් දක්වා විය යුතුය', + range: '${label} අකුරු ${min}-${max}ක් අතර විය යුතුය', + }, + number: { + len: '${label} නිසැකව ${len} සමාන විය යුතුය', + min: '${label} අවමය ${min} විය යුතුය', + max: '${label} උපරිමය ${max} විය යුතුය', + range: '${label} නිසැකව ${min}-${max} අතර විය යුතුය', + }, + array: { + len: '${len} ${label} විය යුතුය', + min: 'අවම වශයෙන් ${min} ${label}', + max: 'උපරිම වශයෙන් ${max} ${label}', + range: '${label} ගණන ${min}-${max} අතර විය යුතුය', + }, + pattern: { + mismatch: '${pattern} රටාවට ${label} නොගැළපේ', + }, + }, + }, + Image: { + preview: 'පෙරදසුන', + }, +}; + +export default localeValues; diff --git a/components/time-picker/locale/si_LK.tsx b/components/time-picker/locale/si_LK.tsx new file mode 100644 index 0000000000..f0737dbcf1 --- /dev/null +++ b/components/time-picker/locale/si_LK.tsx @@ -0,0 +1,8 @@ +import type { TimePickerLocale } from '../index'; + +const locale: TimePickerLocale = { + placeholder: 'වේලාව තෝරන්න', + rangePlaceholder: ['ආරම්භක වේලාව', 'නිමවන වේලාව'], +}; + +export default locale; diff --git a/docs/react/i18n.en-US.md b/docs/react/i18n.en-US.md index 6b4b07e9ce..724cda5983 100644 --- a/docs/react/i18n.en-US.md +++ b/docs/react/i18n.en-US.md @@ -81,6 +81,7 @@ The following languages are currently supported: | Portuguese | pt_PT | | Romanian | ro_RO | | Russian | ru_RU | +| Sinhalese / Sinhala | si_LK | | Slovak | sk_SK | | Serbian | sr_RS | | Slovenian | sl_SI | diff --git a/docs/react/i18n.zh-CN.md b/docs/react/i18n.zh-CN.md index ac32d741b4..78ccfb3cb7 100644 --- a/docs/react/i18n.zh-CN.md +++ b/docs/react/i18n.zh-CN.md @@ -78,6 +78,7 @@ return ( | 葡萄牙语 | pt_PT | | 罗马尼亚语 | ro_RO | | 俄罗斯语 | ru_RU | +| 僧伽罗语 | si_LK | | 斯洛伐克语 | sk_SK | | 塞尔维亚语 | sr_RS | | 斯洛文尼亚语 | sl_SI | diff --git a/package.json b/package.json index f5037198a2..f8af6bec8b 100644 --- a/package.json +++ b/package.json @@ -137,8 +137,8 @@ "rc-menu": "~9.6.0", "rc-motion": "^2.5.1", "rc-notification": "~4.6.0", - "rc-pagination": "~3.1.16", - "rc-picker": "~2.6.8", + "rc-pagination": "~3.1.17", + "rc-picker": "~2.6.10", "rc-progress": "~3.3.2", "rc-rate": "~2.9.0", "rc-resize-observer": "^1.2.0", From ebc7527de30e79ad9ed6a23529f2efa5df86dea4 Mon Sep 17 00:00:00 2001 From: Amumu Date: Wed, 22 Jun 2022 20:05:11 +0800 Subject: [PATCH 04/13] fix: fix snapshot after si_LK locale is merged (#36181) --- .../__snapshots__/index.test.js.snap | 5087 +++++++++++++++++ 1 file changed, 5087 insertions(+) diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap index 0e4be32ee6..68304b7a66 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap @@ -266390,6 +266390,5093 @@ exports[`Locale Provider should display the text as ru 1`] = ` `; +exports[`Locale Provider should display the text as si 1`] = ` +
+ + +
+
+ + + + + + +
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ඉ + + ස + + අ + + බ + + බ්‍ර + + සි + + සෙ +
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+
+ +
+
+
+
+
+
+ + + + + + +
+
+
+
+
+
+
+
+
    +
  • +
    + 00 +
    +
  • +
  • +
    + 01 +
    +
  • +
  • +
    + 02 +
    +
  • +
  • +
    + 03 +
    +
  • +
  • +
    + 04 +
    +
  • +
  • +
    + 05 +
    +
  • +
  • +
    + 06 +
    +
  • +
  • +
    + 07 +
    +
  • +
  • +
    + 08 +
    +
  • +
  • +
    + 09 +
    +
  • +
  • +
    + 10 +
    +
  • +
  • +
    + 11 +
    +
  • +
  • +
    + 12 +
    +
  • +
  • +
    + 13 +
    +
  • +
  • +
    + 14 +
    +
  • +
  • +
    + 15 +
    +
  • +
  • +
    + 16 +
    +
  • +
  • +
    + 17 +
    +
  • +
  • +
    + 18 +
    +
  • +
  • +
    + 19 +
    +
  • +
  • +
    + 20 +
    +
  • +
  • +
    + 21 +
    +
  • +
  • +
    + 22 +
    +
  • +
  • +
    + 23 +
    +
  • +
+
    +
  • +
    + 00 +
    +
  • +
  • +
    + 01 +
    +
  • +
  • +
    + 02 +
    +
  • +
  • +
    + 03 +
    +
  • +
  • +
    + 04 +
    +
  • +
  • +
    + 05 +
    +
  • +
  • +
    + 06 +
    +
  • +
  • +
    + 07 +
    +
  • +
  • +
    + 08 +
    +
  • +
  • +
    + 09 +
    +
  • +
  • +
    + 10 +
    +
  • +
  • +
    + 11 +
    +
  • +
  • +
    + 12 +
    +
  • +
  • +
    + 13 +
    +
  • +
  • +
    + 14 +
    +
  • +
  • +
    + 15 +
    +
  • +
  • +
    + 16 +
    +
  • +
  • +
    + 17 +
    +
  • +
  • +
    + 18 +
    +
  • +
  • +
    + 19 +
    +
  • +
  • +
    + 20 +
    +
  • +
  • +
    + 21 +
    +
  • +
  • +
    + 22 +
    +
  • +
  • +
    + 23 +
    +
  • +
  • +
    + 24 +
    +
  • +
  • +
    + 25 +
    +
  • +
  • +
    + 26 +
    +
  • +
  • +
    + 27 +
    +
  • +
  • +
    + 28 +
    +
  • +
  • +
    + 29 +
    +
  • +
  • +
    + 30 +
    +
  • +
  • +
    + 31 +
    +
  • +
  • +
    + 32 +
    +
  • +
  • +
    + 33 +
    +
  • +
  • +
    + 34 +
    +
  • +
  • +
    + 35 +
    +
  • +
  • +
    + 36 +
    +
  • +
  • +
    + 37 +
    +
  • +
  • +
    + 38 +
    +
  • +
  • +
    + 39 +
    +
  • +
  • +
    + 40 +
    +
  • +
  • +
    + 41 +
    +
  • +
  • +
    + 42 +
    +
  • +
  • +
    + 43 +
    +
  • +
  • +
    + 44 +
    +
  • +
  • +
    + 45 +
    +
  • +
  • +
    + 46 +
    +
  • +
  • +
    + 47 +
    +
  • +
  • +
    + 48 +
    +
  • +
  • +
    + 49 +
    +
  • +
  • +
    + 50 +
    +
  • +
  • +
    + 51 +
    +
  • +
  • +
    + 52 +
    +
  • +
  • +
    + 53 +
    +
  • +
  • +
    + 54 +
    +
  • +
  • +
    + 55 +
    +
  • +
  • +
    + 56 +
    +
  • +
  • +
    + 57 +
    +
  • +
  • +
    + 58 +
    +
  • +
  • +
    + 59 +
    +
  • +
+
    +
  • +
    + 00 +
    +
  • +
  • +
    + 01 +
    +
  • +
  • +
    + 02 +
    +
  • +
  • +
    + 03 +
    +
  • +
  • +
    + 04 +
    +
  • +
  • +
    + 05 +
    +
  • +
  • +
    + 06 +
    +
  • +
  • +
    + 07 +
    +
  • +
  • +
    + 08 +
    +
  • +
  • +
    + 09 +
    +
  • +
  • +
    + 10 +
    +
  • +
  • +
    + 11 +
    +
  • +
  • +
    + 12 +
    +
  • +
  • +
    + 13 +
    +
  • +
  • +
    + 14 +
    +
  • +
  • +
    + 15 +
    +
  • +
  • +
    + 16 +
    +
  • +
  • +
    + 17 +
    +
  • +
  • +
    + 18 +
    +
  • +
  • +
    + 19 +
    +
  • +
  • +
    + 20 +
    +
  • +
  • +
    + 21 +
    +
  • +
  • +
    + 22 +
    +
  • +
  • +
    + 23 +
    +
  • +
  • +
    + 24 +
    +
  • +
  • +
    + 25 +
    +
  • +
  • +
    + 26 +
    +
  • +
  • +
    + 27 +
    +
  • +
  • +
    + 28 +
    +
  • +
  • +
    + 29 +
    +
  • +
  • +
    + 30 +
    +
  • +
  • +
    + 31 +
    +
  • +
  • +
    + 32 +
    +
  • +
  • +
    + 33 +
    +
  • +
  • +
    + 34 +
    +
  • +
  • +
    + 35 +
    +
  • +
  • +
    + 36 +
    +
  • +
  • +
    + 37 +
    +
  • +
  • +
    + 38 +
    +
  • +
  • +
    + 39 +
    +
  • +
  • +
    + 40 +
    +
  • +
  • +
    + 41 +
    +
  • +
  • +
    + 42 +
    +
  • +
  • +
    + 43 +
    +
  • +
  • +
    + 44 +
    +
  • +
  • +
    + 45 +
    +
  • +
  • +
    + 46 +
    +
  • +
  • +
    + 47 +
    +
  • +
  • +
    + 48 +
    +
  • +
  • +
    + 49 +
    +
  • +
  • +
    + 50 +
    +
  • +
  • +
    + 51 +
    +
  • +
  • +
    + 52 +
    +
  • +
  • +
    + 53 +
    +
  • +
  • +
    + 54 +
    +
  • +
  • +
    + 55 +
    +
  • +
  • +
    + 56 +
    +
  • +
  • +
    + 57 +
    +
  • +
  • +
    + 58 +
    +
  • +
  • +
    + 59 +
    +
  • +
+
+
+ +
+
+
+
+
+
+ +
+
+ + + + + +
+
+ +
+
+ + + + + +
+
+
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ඉ + + ස + + අ + + බ + + බ්‍ර + + සි + + සෙ +
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ඉ + + ස + + අ + + බ + + බ්‍ර + + සි + + සෙ +
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+
+
+
+
+
+
+
+ + Click to confirm + +
+
+
+
+ +
+ +
+
+
+
+
+
+ + + + + + 0 අථකය + + +
+ +
+
+ + +
+
+
+ + + + + + 0 අථකය + + +
+ +
+
+
+
+
+
+ + + + + 2017 + +
+ +
+
+
+ + + + + සැප් + +
+ +
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ඉ + + ස + + අ + + බ + + බ්‍ර + + සි + + සෙ +
+
+
+ 27 +
+
+
+
+
+
+ 28 +
+
+
+
+
+
+ 29 +
+
+
+
+
+
+ 30 +
+
+
+
+
+
+ 31 +
+
+
+
+
+
+ 01 +
+
+
+
+
+
+ 02 +
+
+
+
+
+
+ 03 +
+
+
+
+
+
+ 04 +
+
+
+
+
+
+ 05 +
+
+
+
+
+
+ 06 +
+
+
+
+
+
+ 07 +
+
+
+
+
+
+ 08 +
+
+
+
+
+
+ 09 +
+
+
+
+
+
+ 10 +
+
+
+
+
+
+ 11 +
+
+
+
+
+
+ 12 +
+
+
+
+
+
+ 13 +
+
+
+
+
+
+ 14 +
+
+
+
+
+
+ 15 +
+
+
+
+
+
+ 16 +
+
+
+
+
+
+ 17 +
+
+
+
+
+
+ 18 +
+
+
+
+
+
+ 19 +
+
+
+
+
+
+ 20 +
+
+
+
+
+
+ 21 +
+
+
+
+
+
+ 22 +
+
+
+
+
+
+ 23 +
+
+
+
+
+
+ 24 +
+
+
+
+
+
+ 25 +
+
+
+
+
+
+ 26 +
+
+
+
+
+
+ 27 +
+
+
+
+
+
+ 28 +
+
+
+
+
+
+ 29 +
+
+
+
+
+
+ 30 +
+
+
+
+
+
+ 01 +
+
+
+
+
+
+ 02 +
+
+
+
+
+
+ 03 +
+
+
+
+
+
+ 04 +
+
+
+
+
+
+ 05 +
+
+
+
+
+
+ 06 +
+
+
+
+
+
+ 07 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + +
+
+ + Name + + + + + + +
+
+ Age +
+
+
+ + + + + + + + + +
+
+ දත්ත නැත +
+
+
+
+
+
+
+
+
+
+
+
+ +
+`; + exports[`Locale Provider should display the text as sk 1`] = `
    Date: Fri, 24 Jun 2022 12:30:47 +0800 Subject: [PATCH 05/13] style: Skeleton.Button square shape style (#36123) * refactor: Skeleton.Button square shape style the Button's square shape style is same as Avator's that its width is equal to height, and the old square shape become the default shape that its width is double size to height. * fix: `ButtonShapeType` type annotation --- components/skeleton/Element.tsx | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 23 +++++++++++++++++-- .../__tests__/__snapshots__/demo.test.js.snap | 23 +++++++++++++++++-- components/skeleton/demo/element.md | 5 ++-- components/skeleton/index.en-US.md | 2 +- components/skeleton/index.zh-CN.md | 12 +++++----- components/skeleton/style/index.less | 5 ++++ 7 files changed, 58 insertions(+), 14 deletions(-) diff --git a/components/skeleton/Element.tsx b/components/skeleton/Element.tsx index ad943f8068..f6eb18fa46 100644 --- a/components/skeleton/Element.tsx +++ b/components/skeleton/Element.tsx @@ -6,7 +6,7 @@ export interface SkeletonElementProps { className?: string; style?: React.CSSProperties; size?: 'large' | 'small' | 'default' | number; - shape?: 'circle' | 'square' | 'round'; + shape?: 'circle' | 'square' | 'round' | 'default'; active?: boolean; } diff --git a/components/skeleton/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/skeleton/__tests__/__snapshots__/demo-extend.test.ts.snap index b7e147f75e..c1297afda8 100644 --- a/components/skeleton/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/skeleton/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -114,7 +114,7 @@ Array [ class="ant-skeleton ant-skeleton-element" >
@@ -148,7 +148,7 @@ Array [ class="ant-skeleton ant-skeleton-element" >
,
, @@ -387,6 +387,25 @@ Array [ > + + + + Default + + +
@@ -148,7 +148,7 @@ Array [ class="ant-skeleton ant-skeleton-element" >
,
, @@ -387,6 +387,25 @@ Array [ > + + + + Default + + +