antd-mobile 5.31.0 → 5.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/2x/bundle/antd-mobile.cjs.development.js +283 -254
  2. package/2x/bundle/antd-mobile.cjs.js +9 -9
  3. package/2x/bundle/antd-mobile.es.development.js +284 -255
  4. package/2x/bundle/antd-mobile.es.js +4494 -4468
  5. package/2x/bundle/antd-mobile.umd.development.js +283 -254
  6. package/2x/bundle/antd-mobile.umd.js +9 -9
  7. package/2x/bundle/style.css +3 -0
  8. package/2x/cjs/components/calendar/convert.js +1 -6
  9. package/2x/cjs/components/capsule-tabs/capsule-tabs.js +2 -4
  10. package/2x/cjs/components/cascader/cascader.d.ts +2 -0
  11. package/2x/cjs/components/cascader/index.d.ts +1 -0
  12. package/2x/cjs/components/checkbox/checkbox.d.ts +2 -0
  13. package/2x/cjs/components/checkbox/checkbox.js +1 -0
  14. package/2x/cjs/components/checkbox/index.d.ts +1 -0
  15. package/2x/cjs/components/collapse/collapse.js +1 -1
  16. package/2x/cjs/components/date-picker/date-picker-date-utils.js +24 -36
  17. package/2x/cjs/components/date-picker/date-picker-week-utils.js +12 -18
  18. package/2x/cjs/components/date-picker-view/date-picker-view.d.ts +7 -5
  19. package/2x/cjs/components/date-picker-view/date-picker-view.js +8 -2
  20. package/2x/cjs/components/dropdown/dropdown.js +1 -1
  21. package/2x/cjs/components/footer/footer.js +17 -21
  22. package/2x/cjs/components/form/form-subscribe.js +1 -1
  23. package/2x/cjs/components/image-uploader/image-uploader.js +1 -3
  24. package/2x/cjs/components/input/input.js +5 -1
  25. package/2x/cjs/components/jumbo-tabs/jumbo-tabs.js +1 -1
  26. package/2x/cjs/components/modal/modal.js +11 -13
  27. package/2x/cjs/components/notice-bar/notice-bar.css +2 -0
  28. package/2x/cjs/components/popover/popover.js +5 -7
  29. package/2x/cjs/components/popup/popup.js +3 -3
  30. package/2x/cjs/components/radio/radio.d.ts +1 -0
  31. package/2x/cjs/components/radio/radio.js +1 -0
  32. package/2x/cjs/components/rate/star.d.ts +1 -1
  33. package/2x/cjs/components/result/result.js +2 -2
  34. package/2x/cjs/components/safe-area/safe-area.d.ts +1 -1
  35. package/2x/cjs/components/safe-area/safe-area.js +1 -1
  36. package/2x/cjs/components/side-bar/side-bar.d.ts +1 -2
  37. package/2x/cjs/components/side-bar/side-bar.js +4 -2
  38. package/2x/cjs/components/skeleton/skeleton.d.ts +1 -1
  39. package/2x/cjs/components/stepper/stepper.js +1 -5
  40. package/2x/cjs/components/swiper/swiper.js +1 -1
  41. package/2x/cjs/components/tab-bar/tab-bar.d.ts +1 -2
  42. package/2x/cjs/components/tab-bar/tab-bar.js +4 -2
  43. package/2x/cjs/components/tabs/tabs.js +1 -1
  44. package/2x/cjs/components/text-area/text-area.css +1 -0
  45. package/2x/cjs/components/tree-select/multiple.js +2 -6
  46. package/2x/cjs/components/virtual-input/virtual-input.js +1 -1
  47. package/2x/cjs/locales/ru-RU.d.ts +134 -0
  48. package/2x/cjs/locales/ru-RU.js +144 -0
  49. package/2x/es/components/calendar/convert.js +1 -6
  50. package/2x/es/components/capsule-tabs/capsule-tabs.js +3 -5
  51. package/2x/es/components/cascader/cascader.d.ts +2 -0
  52. package/2x/es/components/cascader/index.d.ts +1 -0
  53. package/2x/es/components/checkbox/checkbox.d.ts +2 -0
  54. package/2x/es/components/checkbox/checkbox.js +1 -0
  55. package/2x/es/components/checkbox/index.d.ts +1 -0
  56. package/2x/es/components/collapse/collapse.js +2 -2
  57. package/2x/es/components/date-picker/date-picker-date-utils.js +24 -36
  58. package/2x/es/components/date-picker/date-picker-week-utils.js +12 -18
  59. package/2x/es/components/date-picker-view/date-picker-view.d.ts +7 -5
  60. package/2x/es/components/date-picker-view/date-picker-view.js +8 -2
  61. package/2x/es/components/dropdown/dropdown.js +2 -2
  62. package/2x/es/components/footer/footer.js +17 -21
  63. package/2x/es/components/form/form-subscribe.js +1 -1
  64. package/2x/es/components/image-uploader/image-uploader.js +1 -3
  65. package/2x/es/components/input/input.js +5 -1
  66. package/2x/es/components/jumbo-tabs/jumbo-tabs.js +2 -2
  67. package/2x/es/components/modal/modal.js +11 -13
  68. package/2x/es/components/notice-bar/notice-bar.css +2 -0
  69. package/2x/es/components/popover/popover.js +5 -7
  70. package/2x/es/components/popup/popup.js +3 -3
  71. package/2x/es/components/radio/radio.d.ts +1 -0
  72. package/2x/es/components/radio/radio.js +1 -0
  73. package/2x/es/components/rate/star.d.ts +1 -1
  74. package/2x/es/components/result/result.js +2 -2
  75. package/2x/es/components/safe-area/safe-area.d.ts +1 -1
  76. package/2x/es/components/safe-area/safe-area.js +1 -1
  77. package/2x/es/components/side-bar/side-bar.d.ts +1 -2
  78. package/2x/es/components/side-bar/side-bar.js +2 -2
  79. package/2x/es/components/skeleton/skeleton.d.ts +1 -1
  80. package/2x/es/components/stepper/stepper.js +1 -5
  81. package/2x/es/components/swiper/swiper.js +1 -1
  82. package/2x/es/components/tab-bar/tab-bar.d.ts +1 -2
  83. package/2x/es/components/tab-bar/tab-bar.js +2 -2
  84. package/2x/es/components/tabs/tabs.js +2 -2
  85. package/2x/es/components/text-area/text-area.css +1 -0
  86. package/2x/es/components/tree-select/multiple.js +2 -6
  87. package/2x/es/components/virtual-input/virtual-input.js +1 -1
  88. package/2x/es/locales/ru-RU.d.ts +134 -0
  89. package/2x/es/locales/ru-RU.js +137 -0
  90. package/2x/package.json +2 -2
  91. package/bundle/antd-mobile.cjs.development.js +283 -254
  92. package/bundle/antd-mobile.cjs.js +9 -9
  93. package/bundle/antd-mobile.compatible.umd.js +1 -1
  94. package/bundle/antd-mobile.es.development.js +284 -255
  95. package/bundle/antd-mobile.es.js +4494 -4468
  96. package/bundle/antd-mobile.umd.development.js +283 -254
  97. package/bundle/antd-mobile.umd.js +9 -9
  98. package/bundle/style.css +1 -1
  99. package/cjs/components/calendar/convert.js +1 -6
  100. package/cjs/components/capsule-tabs/capsule-tabs.js +2 -4
  101. package/cjs/components/cascader/cascader.d.ts +2 -0
  102. package/cjs/components/cascader/index.d.ts +1 -0
  103. package/cjs/components/checkbox/checkbox.d.ts +2 -0
  104. package/cjs/components/checkbox/checkbox.js +1 -0
  105. package/cjs/components/checkbox/index.d.ts +1 -0
  106. package/cjs/components/collapse/collapse.js +1 -1
  107. package/cjs/components/date-picker/date-picker-date-utils.js +24 -36
  108. package/cjs/components/date-picker/date-picker-week-utils.js +12 -18
  109. package/cjs/components/date-picker-view/date-picker-view.d.ts +7 -5
  110. package/cjs/components/date-picker-view/date-picker-view.js +8 -2
  111. package/cjs/components/dropdown/dropdown.js +1 -1
  112. package/cjs/components/footer/footer.js +17 -21
  113. package/cjs/components/form/form-subscribe.js +1 -1
  114. package/cjs/components/image-uploader/image-uploader.js +1 -3
  115. package/cjs/components/input/input.js +5 -1
  116. package/cjs/components/jumbo-tabs/jumbo-tabs.js +1 -1
  117. package/cjs/components/modal/modal.js +11 -13
  118. package/cjs/components/notice-bar/notice-bar.css +2 -0
  119. package/cjs/components/popover/popover.js +5 -7
  120. package/cjs/components/popup/popup.js +3 -3
  121. package/cjs/components/radio/radio.d.ts +1 -0
  122. package/cjs/components/radio/radio.js +1 -0
  123. package/cjs/components/rate/star.d.ts +1 -1
  124. package/cjs/components/result/result.js +2 -2
  125. package/cjs/components/safe-area/safe-area.d.ts +1 -1
  126. package/cjs/components/safe-area/safe-area.js +1 -1
  127. package/cjs/components/side-bar/side-bar.d.ts +1 -2
  128. package/cjs/components/side-bar/side-bar.js +4 -2
  129. package/cjs/components/skeleton/skeleton.d.ts +1 -1
  130. package/cjs/components/stepper/stepper.js +1 -5
  131. package/cjs/components/swiper/swiper.js +1 -1
  132. package/cjs/components/tab-bar/tab-bar.d.ts +1 -2
  133. package/cjs/components/tab-bar/tab-bar.js +4 -2
  134. package/cjs/components/tabs/tabs.js +1 -1
  135. package/cjs/components/text-area/text-area.css +1 -0
  136. package/cjs/components/tree-select/multiple.js +2 -6
  137. package/cjs/components/virtual-input/virtual-input.js +1 -1
  138. package/cjs/locales/ru-RU.d.ts +134 -0
  139. package/cjs/locales/ru-RU.js +144 -0
  140. package/es/components/calendar/convert.js +1 -6
  141. package/es/components/capsule-tabs/capsule-tabs.js +3 -5
  142. package/es/components/cascader/cascader.d.ts +2 -0
  143. package/es/components/cascader/index.d.ts +1 -0
  144. package/es/components/checkbox/checkbox.d.ts +2 -0
  145. package/es/components/checkbox/checkbox.js +1 -0
  146. package/es/components/checkbox/index.d.ts +1 -0
  147. package/es/components/collapse/collapse.js +2 -2
  148. package/es/components/date-picker/date-picker-date-utils.js +24 -36
  149. package/es/components/date-picker/date-picker-week-utils.js +12 -18
  150. package/es/components/date-picker-view/date-picker-view.d.ts +7 -5
  151. package/es/components/date-picker-view/date-picker-view.js +8 -2
  152. package/es/components/dropdown/dropdown.js +2 -2
  153. package/es/components/footer/footer.js +17 -21
  154. package/es/components/form/form-subscribe.js +1 -1
  155. package/es/components/image-uploader/image-uploader.js +1 -3
  156. package/es/components/input/input.js +5 -1
  157. package/es/components/jumbo-tabs/jumbo-tabs.js +2 -2
  158. package/es/components/modal/modal.js +11 -13
  159. package/es/components/notice-bar/notice-bar.css +2 -0
  160. package/es/components/popover/popover.js +5 -7
  161. package/es/components/popup/popup.js +3 -3
  162. package/es/components/radio/radio.d.ts +1 -0
  163. package/es/components/radio/radio.js +1 -0
  164. package/es/components/rate/star.d.ts +1 -1
  165. package/es/components/result/result.js +2 -2
  166. package/es/components/safe-area/safe-area.d.ts +1 -1
  167. package/es/components/safe-area/safe-area.js +1 -1
  168. package/es/components/side-bar/side-bar.d.ts +1 -2
  169. package/es/components/side-bar/side-bar.js +2 -2
  170. package/es/components/skeleton/skeleton.d.ts +1 -1
  171. package/es/components/stepper/stepper.js +1 -5
  172. package/es/components/swiper/swiper.js +1 -1
  173. package/es/components/tab-bar/tab-bar.d.ts +1 -2
  174. package/es/components/tab-bar/tab-bar.js +2 -2
  175. package/es/components/tabs/tabs.js +2 -2
  176. package/es/components/text-area/text-area.css +1 -0
  177. package/es/components/tree-select/multiple.js +2 -6
  178. package/es/components/virtual-input/virtual-input.js +1 -1
  179. package/es/locales/ru-RU.d.ts +134 -0
  180. package/es/locales/ru-RU.js +137 -0
  181. package/package.json +2 -2
  182. package/umd/antd-mobile.js +1 -1
@@ -5,6 +5,7 @@ import { mergeProps } from '../../utils/with-default-props';
5
5
  import { usePropsValue } from '../../utils/use-props-value';
6
6
  import { generateDatePickerColumns, convertDateToStringArray, convertStringArrayToDate } from '../date-picker/date-picker-utils';
7
7
  import useRenderLabel from './useRenderLabel';
8
+ import { TILL_NOW } from '../date-picker/util';
8
9
  const thisYear = new Date().getFullYear();
9
10
  const defaultProps = {
10
11
  min: new Date(new Date().setFullYear(thisYear - 10)),
@@ -22,7 +23,12 @@ export const DatePickerView = p => {
22
23
  defaultValue: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : null
23
24
  });
24
25
  const mergedRenderLabel = useRenderLabel(renderLabel);
25
- const pickerValue = useMemo(() => convertDateToStringArray(value, props.precision), [value, props.precision]);
26
+ const pickerValue = useMemo(() => {
27
+ if (value === null || value === void 0 ? void 0 : value.tillNow) {
28
+ return [TILL_NOW, null, null];
29
+ }
30
+ return convertDateToStringArray(value, props.precision);
31
+ }, [value, props.precision]);
26
32
  const onChange = useCallback(val => {
27
33
  var _a;
28
34
  const date = convertStringArrayToDate(val, props.precision);
@@ -32,7 +38,7 @@ export const DatePickerView = p => {
32
38
  }
33
39
  }, [props.onChange, props.precision]);
34
40
  return withNativeProps(props, React.createElement(PickerView, {
35
- columns: selected => generateDatePickerColumns(selected, props.min, props.max, props.precision, mergedRenderLabel, props.filter),
41
+ columns: selected => generateDatePickerColumns(selected, props.min, props.max, props.precision, mergedRenderLabel, props.filter, props.tillNow),
36
42
  loading: props.loading,
37
43
  loadingContent: props.loadingContent,
38
44
  value: pickerValue,
@@ -1,6 +1,6 @@
1
1
  import { useClickAway } from 'ahooks';
2
2
  import classNames from 'classnames';
3
- import React, { cloneElement, useEffect, useRef, useState, forwardRef, useImperativeHandle } from 'react';
3
+ import React, { cloneElement, useEffect, useRef, useState, forwardRef, useImperativeHandle, isValidElement } from 'react';
4
4
  import Popup from '../popup';
5
5
  import { ItemChildrenWrap } from './item';
6
6
  import { withNativeProps } from '../../utils/native-props';
@@ -49,7 +49,7 @@ const Dropdown = forwardRef((p, ref) => {
49
49
  let popupForceRender = false;
50
50
  const items = [];
51
51
  const navs = React.Children.map(props.children, child => {
52
- if (React.isValidElement(child)) {
52
+ if (isValidElement(child)) {
53
53
  const childProps = Object.assign(Object.assign({}, child.props), {
54
54
  onClick: () => {
55
55
  changeActive(child.key);
@@ -35,29 +35,25 @@ export const Footer = p => {
35
35
  className: classNames(classPrefix)
36
36
  }, label && React.createElement("div", {
37
37
  className: `${classPrefix}-label`
38
- }, React.createElement(Divider, null, label)), links && links.length > 0 && React.createElement("div", {
38
+ }, React.createElement(Divider, null, label)), !!(links === null || links === void 0 ? void 0 : links.length) && React.createElement("div", {
39
39
  className: `${classPrefix}-links`
40
- }, links.map((link, index) => {
41
- return React.createElement(React.Fragment, {
42
- key: index
43
- }, React.createElement("a", {
44
- href: link.href,
45
- rel: 'noopener noreferrer',
46
- onClick: event => clickLinkItem(link, index, event)
47
- }, link.text), index !== links.length - 1 && React.createElement(Divider, {
48
- direction: 'vertical'
49
- }));
50
- })), content && React.createElement("div", {
40
+ }, links.map((link, index) => React.createElement(React.Fragment, {
41
+ key: index
42
+ }, React.createElement("a", {
43
+ href: link.href,
44
+ rel: 'noopener noreferrer',
45
+ onClick: event => clickLinkItem(link, index, event)
46
+ }, link.text), index !== links.length - 1 && React.createElement(Divider, {
47
+ direction: 'vertical'
48
+ })))), content && React.createElement("div", {
51
49
  className: `${classPrefix}-content`
52
50
  }, content), chips && chips.length > 0 && React.createElement("div", {
53
51
  className: `${classPrefix}-chips`
54
- }, chips.map((chip, index) => {
55
- return React.createElement("div", {
56
- key: index,
57
- onClick: () => clickChipItem(chip, index),
58
- className: classNames(`${classPrefix}-chip`, {
59
- [`${classPrefix}-chip-link`]: chip.type === 'link'
60
- })
61
- }, chip.text);
62
- }))));
52
+ }, chips.map((chip, index) => React.createElement("div", {
53
+ key: index,
54
+ onClick: () => clickChipItem(chip, index),
55
+ className: classNames(`${classPrefix}-chip`, {
56
+ [`${classPrefix}-chip-link`]: chip.type === 'link'
57
+ })
58
+ }, chip.text)))));
63
59
  };
@@ -7,7 +7,7 @@ export const FormSubscribe = props => {
7
7
  const form = useContext(FieldContext);
8
8
  const value = form.getFieldsValue(props.to);
9
9
  // Memo to avoid useless render
10
- const childNode = React.useMemo(() => props.children(value, form), [JSON.stringify(value)]);
10
+ const childNode = React.useMemo(() => props.children(value, form), [JSON.stringify(value), props.children]);
11
11
  return React.createElement(React.Fragment, null, childNode, props.to.map(namePath => React.createElement(Watcher, {
12
12
  key: namePath.toString(),
13
13
  form: form,
@@ -95,9 +95,7 @@ export const ImageUploader = p => {
95
95
  let files = [].slice.call(rawFiles);
96
96
  e.target.value = ''; // HACK: fix the same file doesn't trigger onChange
97
97
  if (props.beforeUpload) {
98
- const postFiles = files.map(file => {
99
- return processFile(file, files);
100
- });
98
+ const postFiles = files.map(file => processFile(file, files));
101
99
  yield Promise.all(postFiles).then(filesList => {
102
100
  files = filesList.filter(Boolean);
103
101
  });
@@ -57,7 +57,11 @@ export const Input = forwardRef((p, ref) => {
57
57
  function checkValue() {
58
58
  let nextValue = value;
59
59
  if (props.type === 'number') {
60
- nextValue = nextValue && bound(parseFloat(nextValue), props.min, props.max).toString();
60
+ const boundValue = nextValue && bound(parseFloat(nextValue), props.min, props.max).toString();
61
+ // fix the display issue of numbers starting with 0
62
+ if (Number(nextValue) !== Number(boundValue)) {
63
+ nextValue = boundValue;
64
+ }
61
65
  }
62
66
  if (nextValue !== value) {
63
67
  setValue(nextValue);
@@ -1,4 +1,4 @@
1
- import React, { useRef } from 'react';
1
+ import React, { isValidElement, useRef } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { animated } from '@react-spring/web';
4
4
  import { withNativeProps } from '../../utils/native-props';
@@ -20,7 +20,7 @@ export const JumboTabs = props => {
20
20
  let firstActiveKey = null;
21
21
  const panes = [];
22
22
  traverseReactNode(props.children, (child, index) => {
23
- if (!React.isValidElement(child)) return;
23
+ if (!isValidElement(child)) return;
24
24
  const key = child.key;
25
25
  if (typeof key !== 'string') return;
26
26
  if (index === 0) {
@@ -31,19 +31,17 @@ export const Modal = p => {
31
31
  direction: 'vertical',
32
32
  block: true,
33
33
  className: classNames(cls('footer'), props.actions.length === 0 && cls('footer-empty'))
34
- }, props.actions.map((action, index) => {
35
- return React.createElement(ModalActionButton, {
36
- key: action.key,
37
- action: action,
38
- onAction: () => __awaiter(void 0, void 0, void 0, function* () {
39
- var _a, _b, _c;
40
- yield Promise.all([(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action), (_b = props.onAction) === null || _b === void 0 ? void 0 : _b.call(props, action, index)]);
41
- if (props.closeOnAction) {
42
- (_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
43
- }
44
- })
45
- });
46
- })));
34
+ }, props.actions.map((action, index) => React.createElement(ModalActionButton, {
35
+ key: action.key,
36
+ action: action,
37
+ onAction: () => __awaiter(void 0, void 0, void 0, function* () {
38
+ var _a, _b, _c;
39
+ yield Promise.all([(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action), (_b = props.onAction) === null || _b === void 0 ? void 0 : _b.call(props, action, index)]);
40
+ if (props.closeOnAction) {
41
+ (_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
42
+ }
43
+ })
44
+ }))));
47
45
  return React.createElement(CenterPopup, {
48
46
  className: classNames(cls(), props.className),
49
47
  style: props.style,
@@ -67,6 +67,8 @@
67
67
  }
68
68
 
69
69
  .adm-notice-bar .adm-notice-bar-right {
70
+ display: flex;
71
+ align-items: center;
70
72
  flex-shrink: 0;
71
73
  margin-left: 24px;
72
74
  }
@@ -31,13 +31,11 @@ export const Popover = forwardRef((p, ref) => {
31
31
  defaultValue: props.defaultVisible,
32
32
  onChange: props.onVisibleChange
33
33
  });
34
- useImperativeHandle(ref, () => {
35
- return {
36
- show: () => setVisible(true),
37
- hide: () => setVisible(false),
38
- visible
39
- };
40
- }, [visible]);
34
+ useImperativeHandle(ref, () => ({
35
+ show: () => setVisible(true),
36
+ hide: () => setVisible(false),
37
+ visible
38
+ }), [visible]);
41
39
  const targetRef = useRef(null);
42
40
  const floatingRef = useRef(null);
43
41
  const arrowRef = useRef(null);
@@ -21,18 +21,18 @@ const defaultProps = Object.assign(Object.assign({}, defaultPopupBaseProps), {
21
21
  });
22
22
  export const Popup = p => {
23
23
  const props = mergeProps(defaultProps, p);
24
+ const bodyCls = classNames(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`);
24
25
  const {
25
26
  locale
26
27
  } = useConfig();
27
- const bodyCls = classNames(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`);
28
28
  const [active, setActive] = useState(props.visible);
29
+ const ref = useRef(null);
30
+ useLockScroll(ref, props.disableBodyScroll && active ? 'strict' : false);
29
31
  useIsomorphicLayoutEffect(() => {
30
32
  if (props.visible) {
31
33
  setActive(true);
32
34
  }
33
35
  }, [props.visible]);
34
- const ref = useRef(null);
35
- useLockScroll(ref, props.disableBodyScroll && active ? 'strict' : false);
36
36
  const unmountedRef = useUnmountedRef();
37
37
  const {
38
38
  percent
@@ -11,5 +11,6 @@ export declare type RadioProps = {
11
11
  id?: string;
12
12
  icon?: (checked: boolean) => React.ReactNode;
13
13
  children?: React.ReactNode;
14
+ onClick?: (event: React.MouseEvent<HTMLLabelElement, MouseEvent>) => void;
14
15
  } & NativeProps<'--icon-size' | '--font-size' | '--gap'>;
15
16
  export declare const Radio: FC<RadioProps>;
@@ -56,6 +56,7 @@ export const Radio = p => {
56
56
  }, checked && React.createElement(CheckIcon, null));
57
57
  };
58
58
  return withNativeProps(props, React.createElement("label", {
59
+ onClick: props.onClick,
59
60
  className: classNames(classPrefix, {
60
61
  [`${classPrefix}-checked`]: checked,
61
62
  [`${classPrefix}-disabled`]: disabled,
@@ -1,2 +1,2 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  export declare const Star: FC;
@@ -30,7 +30,7 @@ export const Result = p => {
30
30
  className: `${classPrefix}-icon`
31
31
  }, resultIcon), React.createElement("div", {
32
32
  className: `${classPrefix}-title`
33
- }, title), description ? React.createElement("div", {
33
+ }, title), !!description && React.createElement("div", {
34
34
  className: `${classPrefix}-description`
35
- }, description) : null));
35
+ }, description)));
36
36
  };
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  export declare type SafeAreaProps = {
4
4
  position: 'top' | 'bottom';
@@ -1,5 +1,5 @@
1
- import { withNativeProps } from '../../utils/native-props';
2
1
  import React from 'react';
2
+ import { withNativeProps } from '../../utils/native-props';
3
3
  import classNames from 'classnames';
4
4
  const classPrefix = 'adm-safe-area';
5
5
  export const SafeArea = props => {
@@ -1,5 +1,4 @@
1
- import { FC, ReactNode } from 'react';
2
- import React from 'react';
1
+ import React, { FC, ReactNode } from 'react';
3
2
  import { BadgeProps } from '../badge';
4
3
  import { NativeProps } from '../../utils/native-props';
5
4
  export declare type SideBarItemProps = {
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { isValidElement } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import Badge from '../badge';
4
4
  import { withNativeProps } from '../../utils/native-props';
@@ -15,7 +15,7 @@ export const SideBar = props => {
15
15
  let firstActiveKey = null;
16
16
  const items = [];
17
17
  traverseReactNode(props.children, (child, index) => {
18
- if (!React.isValidElement(child)) return;
18
+ if (!isValidElement(child)) return;
19
19
  const key = child.key;
20
20
  if (typeof key !== 'string') return;
21
21
  if (index === 0) {
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  export declare type SkeletonProps = {
4
4
  animated?: boolean;
@@ -64,11 +64,7 @@ export function InnerStepper(p, ref) {
64
64
  };
65
65
  const formatValue = value => {
66
66
  if (value === null) return '';
67
- if (formatter) {
68
- return formatter(value);
69
- } else {
70
- return fixedValue(value);
71
- }
67
+ return formatter ? formatter(value) : fixedValue(value);
72
68
  };
73
69
  // ======================== Value & InputValue ========================
74
70
  const [mergedValue, setMergedValue] = useMergedState(defaultValue, {
@@ -172,10 +172,10 @@ export const Swiper = forwardRef(staged((p, ref) => {
172
172
  var _a;
173
173
  const roundedIndex = Math.round(index);
174
174
  const targetIndex = loop ? modulus(roundedIndex, count) : bound(roundedIndex, 0, count - 1);
175
- setCurrent(targetIndex);
176
175
  if (targetIndex !== getCurrent()) {
177
176
  (_a = props.onIndexChange) === null || _a === void 0 ? void 0 : _a.call(props, targetIndex);
178
177
  }
178
+ setCurrent(targetIndex);
179
179
  api.start({
180
180
  position: (loop ? roundedIndex : boundIndex(roundedIndex)) * 100,
181
181
  immediate
@@ -1,5 +1,4 @@
1
- import { FC, ReactNode } from 'react';
2
- import React from 'react';
1
+ import React, { FC, ReactNode } from 'react';
3
2
  import { NativeProps } from '../../utils/native-props';
4
3
  import { BadgeProps } from '../badge';
5
4
  export declare type TabBarItemProps = {
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { isValidElement } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { withNativeProps } from '../../utils/native-props';
4
4
  import { mergeProps } from '../../utils/with-default-props';
@@ -20,7 +20,7 @@ export const TabBar = p => {
20
20
  let firstActiveKey = null;
21
21
  const items = [];
22
22
  traverseReactNode(props.children, (child, index) => {
23
- if (!React.isValidElement(child)) return;
23
+ if (!isValidElement(child)) return;
24
24
  const key = child.key;
25
25
  if (typeof key !== 'string') return;
26
26
  if (index === 0) {
@@ -1,4 +1,4 @@
1
- import React, { useRef } from 'react';
1
+ import React, { isValidElement, useRef } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { useSpring, animated } from '@react-spring/web';
4
4
  import { withNativeProps } from '../../utils/native-props';
@@ -28,7 +28,7 @@ export const Tabs = p => {
28
28
  let firstActiveKey = null;
29
29
  const panes = [];
30
30
  traverseReactNode(props.children, (child, index) => {
31
- if (!React.isValidElement(child)) return;
31
+ if (!isValidElement(child)) return;
32
32
  const key = child.key;
33
33
  if (typeof key !== 'string') return;
34
34
  if (index === 0) {
@@ -5,6 +5,7 @@
5
5
  --disabled-color: var(--adm-color-weak);
6
6
  --text-align: left;
7
7
  --count-text-align: right;
8
+ position: relative;
8
9
  width: 100%;
9
10
  max-width: 100%;
10
11
  max-height: 100%;
@@ -224,13 +224,9 @@ export const Multiple = p => {
224
224
  }
225
225
  const isLeaf = deep === index + 1;
226
226
  if (isLeaf) {
227
- return React.createElement(React.Fragment, null, renderSelectAllLeafItem(columnOptions, index), columnOptions.map(option => {
228
- return renderLeafItem(option);
229
- }));
227
+ return React.createElement(React.Fragment, null, renderSelectAllLeafItem(columnOptions, index), columnOptions.map(option => renderLeafItem(option)));
230
228
  }
231
- return React.createElement(React.Fragment, null, renderSelectAllItem(columnOptions, index), columnOptions.map(option => {
232
- return renderItem(option);
233
- }));
229
+ return React.createElement(React.Fragment, null, renderSelectAllItem(columnOptions, index), columnOptions.map(option => renderItem(option)));
234
230
  };
235
231
  const renderColumns = () => {
236
232
  var _a;
@@ -106,7 +106,7 @@ export const VirtualInput = forwardRef((p, ref) => {
106
106
  },
107
107
  role: 'button',
108
108
  "aria-label": locale.Input.clear
109
- }, React.createElement(CloseCircleFill, null)), !value && React.createElement("div", {
109
+ }, React.createElement(CloseCircleFill, null)), [undefined, null, ''].includes(value) && React.createElement("div", {
110
110
  className: `${classPrefix}-placeholder`
111
111
  }, props.placeholder), keyboardElement));
112
112
  });
@@ -0,0 +1,134 @@
1
+ declare const ruRU: {
2
+ locale: string;
3
+ common: {
4
+ confirm: string;
5
+ cancel: string;
6
+ loading: string;
7
+ close: string;
8
+ };
9
+ Calendar: {
10
+ markItems: string[];
11
+ renderYearAndMonth: (year: number, month: number) => string;
12
+ };
13
+ Cascader: {
14
+ placeholder: string;
15
+ };
16
+ Dialog: {
17
+ ok: string;
18
+ };
19
+ DatePicker: {
20
+ tillNow: string;
21
+ };
22
+ ErrorBlock: {
23
+ default: {
24
+ title: string;
25
+ description: string;
26
+ };
27
+ busy: {
28
+ title: string;
29
+ description: string;
30
+ };
31
+ disconnected: {
32
+ title: string;
33
+ description: string;
34
+ };
35
+ empty: {
36
+ title: string;
37
+ description: string;
38
+ };
39
+ };
40
+ Form: {
41
+ required: string;
42
+ optional: string;
43
+ defaultValidateMessages: {
44
+ default: string;
45
+ required: string;
46
+ enum: string;
47
+ whitespace: string;
48
+ date: {
49
+ format: string;
50
+ parse: string;
51
+ invalid: string;
52
+ };
53
+ types: {
54
+ string: string;
55
+ method: string;
56
+ array: string;
57
+ object: string;
58
+ number: string;
59
+ date: string;
60
+ boolean: string;
61
+ integer: string;
62
+ float: string;
63
+ regexp: string;
64
+ email: string;
65
+ url: string;
66
+ hex: string;
67
+ };
68
+ string: {
69
+ len: string;
70
+ min: string;
71
+ max: string;
72
+ range: string;
73
+ };
74
+ number: {
75
+ len: string;
76
+ min: string;
77
+ max: string;
78
+ range: string;
79
+ };
80
+ array: {
81
+ len: string;
82
+ min: string;
83
+ max: string;
84
+ range: string;
85
+ };
86
+ pattern: {
87
+ mismatch: string;
88
+ };
89
+ };
90
+ };
91
+ ImageUploader: {
92
+ uploading: string;
93
+ upload: string;
94
+ };
95
+ InfiniteScroll: {
96
+ noMore: string;
97
+ failedToLoad: string;
98
+ retry: string;
99
+ };
100
+ Input: {
101
+ clear: string;
102
+ };
103
+ Mask: {
104
+ name: string;
105
+ };
106
+ Modal: {
107
+ ok: string;
108
+ };
109
+ PasscodeInput: {
110
+ name: string;
111
+ };
112
+ PullToRefresh: {
113
+ pulling: string;
114
+ canRelease: string;
115
+ complete: string;
116
+ };
117
+ SearchBar: {
118
+ name: string;
119
+ };
120
+ Slider: {
121
+ name: string;
122
+ };
123
+ Stepper: {
124
+ decrease: string;
125
+ increase: string;
126
+ };
127
+ Switch: {
128
+ name: string;
129
+ };
130
+ Selector: {
131
+ name: string;
132
+ };
133
+ };
134
+ export default ruRU;