antd-mobile 5.0.0-rc.21 → 5.0.0-rc.25
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.
- package/2x/README.md +7 -6
- package/2x/cjs/components/avatar/avatar.d.ts +1 -1
- package/2x/cjs/components/badge/badge.css +18 -10
- package/2x/cjs/components/badge/badge.d.ts +1 -0
- package/2x/cjs/components/badge/badge.js +4 -5
- package/2x/cjs/components/button/button.css +1 -1
- package/2x/cjs/components/calendar/calendar.js +4 -0
- package/2x/cjs/components/capsule-tabs/capsule-tabs.css +1 -1
- package/2x/cjs/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/2x/cjs/components/checkbox/check-icon.js +4 -13
- package/2x/cjs/components/checkbox/checkbox.css +11 -30
- package/2x/cjs/components/checkbox/checkbox.js +4 -6
- package/2x/cjs/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/2x/cjs/components/checkbox/indeterminate-icon.js +24 -0
- package/2x/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/2x/cjs/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/2x/cjs/components/error-block/error-block.d.ts +1 -1
- package/2x/cjs/components/floating-bubble/floating-bubble.css +1 -0
- package/2x/cjs/components/floating-panel/floating-panel.d.ts +2 -0
- package/2x/cjs/components/floating-panel/floating-panel.js +5 -0
- package/2x/cjs/components/form/form-item.css +3 -2
- package/2x/cjs/components/form/form-item.d.ts +2 -2
- package/2x/cjs/components/form/form-item.js +9 -5
- package/2x/cjs/components/form/form.css +7 -3
- package/2x/cjs/components/form/form.d.ts +5 -4
- package/2x/cjs/components/form/index.css +10 -5
- package/2x/cjs/components/form/index.d.ts +5 -4
- package/2x/cjs/components/image-viewer/image-viewer.d.ts +8 -2
- package/2x/cjs/components/image-viewer/image-viewer.js +8 -5
- package/2x/cjs/components/image-viewer/index.d.ts +6 -2
- package/2x/cjs/components/image-viewer/slides.d.ts +7 -3
- package/2x/cjs/components/image-viewer/slides.js +18 -11
- package/2x/cjs/components/input/input.css +28 -25
- package/2x/cjs/components/input/input.d.ts +4 -4
- package/2x/cjs/components/input/input.js +10 -4
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.css +4 -1
- package/2x/cjs/components/list/list.css +2 -6
- package/2x/cjs/components/list/list.d.ts +1 -1
- package/2x/cjs/components/modal/modal.css +25 -20
- package/2x/cjs/components/modal/modal.js +8 -12
- package/2x/cjs/components/nav-bar/nav-bar.css +3 -3
- package/2x/cjs/components/notice-bar/notice-bar.d.ts +1 -1
- package/2x/cjs/components/passcode-input/passcode-input.d.ts +2 -2
- package/2x/cjs/components/picker/picker.css +10 -2
- package/2x/cjs/components/picker/picker.d.ts +1 -1
- package/2x/cjs/components/picker-view/picker-view.css +4 -2
- package/2x/cjs/components/picker-view/picker-view.d.ts +1 -1
- package/2x/cjs/components/picker-view/wheel.js +1 -1
- package/2x/cjs/components/popover/arrow.d.ts +3 -0
- package/2x/cjs/components/popover/arrow.js +26 -0
- package/2x/cjs/components/popover/index.d.ts +7 -15
- package/2x/cjs/components/popover/index.js +4 -2
- package/2x/cjs/components/popover/popover-menu.css +63 -0
- package/2x/cjs/components/popover/popover-menu.d.ts +20 -0
- package/{cjs/components/popover/pop-menu.js → 2x/cjs/components/popover/popover-menu.js} +23 -26
- package/2x/cjs/components/popover/popover.css +90 -318
- package/2x/cjs/components/popover/popover.d.ts +9 -8
- package/2x/cjs/components/popover/popover.js +11 -17
- package/2x/cjs/components/radio/radio.css +9 -12
- package/2x/cjs/components/radio/radio.js +1 -3
- package/2x/cjs/components/result/result.css +2 -5
- package/2x/cjs/components/search-bar/search-bar.css +14 -9
- package/2x/cjs/components/selector/selector.css +4 -0
- package/2x/cjs/components/spin-loading/spin-loading.css +1 -19
- package/2x/cjs/components/spin-loading/spin-loading.d.ts +1 -1
- package/2x/cjs/components/spin-loading/spin-loading.js +33 -5
- package/2x/cjs/components/stepper/stepper.css +4 -7
- package/2x/cjs/components/stepper/stepper.js +0 -1
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +2 -2
- package/2x/cjs/components/swipe-action/swipe-action.js +1 -1
- package/2x/cjs/components/swiper/swiper.js +14 -19
- package/2x/cjs/components/switch/switch.css +8 -3
- package/2x/cjs/components/tabs/tabs.css +1 -1
- package/2x/cjs/components/tag/tag.css +3 -3
- package/2x/cjs/components/text-area/text-area.css +9 -9
- package/2x/cjs/components/text-area/text-area.d.ts +2 -2
- package/2x/cjs/components/text-area/text-area.js +41 -32
- package/2x/cjs/components/virtual-input/virtual-input.d.ts +1 -1
- package/2x/cjs/utils/get-scroll-parent.js +1 -1
- package/2x/es/components/avatar/avatar.d.ts +1 -1
- package/2x/es/components/badge/badge.css +18 -10
- package/2x/es/components/badge/badge.d.ts +1 -0
- package/2x/es/components/badge/badge.js +4 -5
- package/2x/es/components/button/button.css +1 -1
- package/2x/es/components/calendar/calendar.js +2 -0
- package/2x/es/components/capsule-tabs/capsule-tabs.css +1 -1
- package/2x/es/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/2x/es/components/checkbox/check-icon.js +4 -13
- package/2x/es/components/checkbox/checkbox.css +11 -30
- package/2x/es/components/checkbox/checkbox.js +3 -6
- package/2x/es/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/2x/es/components/checkbox/indeterminate-icon.js +10 -0
- package/2x/es/components/date-picker/date-picker.d.ts +1 -1
- package/2x/es/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/2x/es/components/error-block/error-block.d.ts +1 -1
- package/2x/es/components/floating-bubble/floating-bubble.css +1 -0
- package/2x/es/components/floating-panel/floating-panel.d.ts +2 -0
- package/2x/es/components/floating-panel/floating-panel.js +5 -0
- package/2x/es/components/form/form-item.css +3 -2
- package/2x/es/components/form/form-item.d.ts +2 -2
- package/2x/es/components/form/form-item.js +9 -5
- package/2x/es/components/form/form.css +7 -3
- package/2x/es/components/form/form.d.ts +5 -4
- package/2x/es/components/form/index.css +10 -5
- package/2x/es/components/form/index.d.ts +5 -4
- package/2x/es/components/image-viewer/image-viewer.d.ts +8 -2
- package/2x/es/components/image-viewer/image-viewer.js +4 -3
- package/2x/es/components/image-viewer/index.d.ts +6 -2
- package/2x/es/components/image-viewer/slides.d.ts +7 -3
- package/2x/es/components/image-viewer/slides.js +19 -10
- package/2x/es/components/input/input.css +28 -25
- package/2x/es/components/input/input.d.ts +4 -4
- package/2x/es/components/input/input.js +7 -4
- package/2x/es/components/jumbo-tabs/jumbo-tabs.css +4 -1
- package/2x/es/components/list/list.css +2 -6
- package/2x/es/components/list/list.d.ts +1 -1
- package/2x/es/components/modal/modal.css +25 -20
- package/2x/es/components/modal/modal.js +8 -12
- package/2x/es/components/nav-bar/nav-bar.css +3 -3
- package/2x/es/components/notice-bar/notice-bar.d.ts +1 -1
- package/2x/es/components/passcode-input/passcode-input.d.ts +2 -2
- package/2x/es/components/picker/picker.css +10 -2
- package/2x/es/components/picker/picker.d.ts +1 -1
- package/2x/es/components/picker-view/picker-view.css +4 -2
- package/2x/es/components/picker-view/picker-view.d.ts +1 -1
- package/2x/es/components/picker-view/wheel.js +1 -1
- package/2x/es/components/popover/arrow.d.ts +3 -0
- package/2x/es/components/popover/arrow.js +12 -0
- package/2x/es/components/popover/index.d.ts +7 -15
- package/2x/es/components/popover/index.js +3 -2
- package/2x/es/components/popover/popover-menu.css +63 -0
- package/2x/es/components/popover/popover-menu.d.ts +20 -0
- package/2x/es/components/popover/popover-menu.js +52 -0
- package/2x/es/components/popover/popover.css +90 -318
- package/2x/es/components/popover/popover.d.ts +9 -8
- package/2x/es/components/popover/popover.js +10 -17
- package/2x/es/components/radio/radio.css +9 -12
- package/2x/es/components/radio/radio.js +1 -3
- package/2x/es/components/result/result.css +2 -5
- package/2x/es/components/search-bar/search-bar.css +14 -9
- package/2x/es/components/selector/selector.css +4 -0
- package/2x/es/components/spin-loading/spin-loading.css +1 -19
- package/2x/es/components/spin-loading/spin-loading.d.ts +1 -1
- package/2x/es/components/spin-loading/spin-loading.js +32 -5
- package/2x/es/components/stepper/stepper.css +4 -7
- package/2x/es/components/stepper/stepper.js +0 -1
- package/2x/es/components/swipe-action/swipe-action.d.ts +2 -2
- package/2x/es/components/swipe-action/swipe-action.js +1 -1
- package/2x/es/components/swiper/swiper.js +13 -19
- package/2x/es/components/switch/switch.css +8 -3
- package/2x/es/components/tabs/tabs.css +1 -1
- package/2x/es/components/tag/tag.css +3 -3
- package/2x/es/components/text-area/text-area.css +9 -9
- package/2x/es/components/text-area/text-area.d.ts +2 -2
- package/2x/es/components/text-area/text-area.js +41 -31
- package/2x/es/components/virtual-input/virtual-input.d.ts +1 -1
- package/2x/es/utils/get-scroll-parent.js +1 -1
- package/2x/package.json +2 -2
- package/README.md +7 -6
- package/cjs/components/avatar/avatar.d.ts +1 -1
- package/cjs/components/badge/badge.css +16 -10
- package/cjs/components/badge/badge.d.ts +1 -0
- package/cjs/components/badge/badge.js +4 -5
- package/cjs/components/button/button.css +1 -1
- package/cjs/components/calendar/calendar.js +4 -0
- package/cjs/components/capsule-tabs/capsule-tabs.css +1 -1
- package/cjs/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/cjs/components/checkbox/check-icon.js +4 -13
- package/cjs/components/checkbox/checkbox.css +11 -27
- package/cjs/components/checkbox/checkbox.js +4 -6
- package/cjs/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/cjs/components/checkbox/indeterminate-icon.js +24 -0
- package/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/cjs/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/cjs/components/error-block/error-block.d.ts +1 -1
- package/cjs/components/floating-bubble/floating-bubble.css +1 -0
- package/cjs/components/floating-panel/floating-panel.d.ts +2 -0
- package/cjs/components/floating-panel/floating-panel.js +5 -0
- package/cjs/components/form/form-item.css +3 -2
- package/cjs/components/form/form-item.d.ts +2 -2
- package/cjs/components/form/form-item.js +9 -5
- package/cjs/components/form/form.css +6 -3
- package/cjs/components/form/form.d.ts +5 -4
- package/cjs/components/form/index.css +9 -5
- package/cjs/components/form/index.d.ts +5 -4
- package/cjs/components/image-viewer/image-viewer.d.ts +8 -2
- package/cjs/components/image-viewer/image-viewer.js +8 -5
- package/cjs/components/image-viewer/index.d.ts +6 -2
- package/cjs/components/image-viewer/slides.d.ts +7 -3
- package/cjs/components/image-viewer/slides.js +18 -11
- package/cjs/components/input/input.css +26 -24
- package/cjs/components/input/input.d.ts +4 -4
- package/cjs/components/input/input.js +10 -4
- package/cjs/components/jumbo-tabs/jumbo-tabs.css +4 -1
- package/cjs/components/list/list.css +2 -5
- package/cjs/components/list/list.d.ts +1 -1
- package/cjs/components/modal/modal.css +23 -19
- package/cjs/components/modal/modal.js +8 -12
- package/cjs/components/nav-bar/nav-bar.css +3 -3
- package/cjs/components/notice-bar/notice-bar.d.ts +1 -1
- package/cjs/components/passcode-input/passcode-input.d.ts +2 -2
- package/cjs/components/picker/picker.css +9 -2
- package/cjs/components/picker/picker.d.ts +1 -1
- package/cjs/components/picker-view/picker-view.css +4 -2
- package/cjs/components/picker-view/picker-view.d.ts +1 -1
- package/cjs/components/picker-view/wheel.js +1 -1
- package/cjs/components/popover/arrow.d.ts +3 -0
- package/cjs/components/popover/arrow.js +26 -0
- package/cjs/components/popover/index.d.ts +7 -15
- package/cjs/components/popover/index.js +4 -2
- package/cjs/components/popover/popover-menu.css +52 -0
- package/cjs/components/popover/popover-menu.d.ts +20 -0
- package/{2x/cjs/components/popover/pop-menu.js → cjs/components/popover/popover-menu.js} +23 -26
- package/cjs/components/popover/popover.css +83 -276
- package/cjs/components/popover/popover.d.ts +9 -8
- package/cjs/components/popover/popover.js +11 -17
- package/cjs/components/radio/radio.css +9 -12
- package/cjs/components/radio/radio.js +1 -3
- package/cjs/components/result/result.css +2 -5
- package/cjs/components/search-bar/search-bar.css +13 -9
- package/cjs/components/selector/selector.css +3 -0
- package/cjs/components/spin-loading/spin-loading.css +1 -17
- package/cjs/components/spin-loading/spin-loading.d.ts +1 -1
- package/cjs/components/spin-loading/spin-loading.js +33 -5
- package/cjs/components/stepper/stepper.css +4 -6
- package/cjs/components/stepper/stepper.js +0 -1
- package/cjs/components/swipe-action/swipe-action.d.ts +2 -2
- package/cjs/components/swipe-action/swipe-action.js +1 -1
- package/cjs/components/swiper/swiper.js +14 -19
- package/cjs/components/switch/switch.css +8 -3
- package/cjs/components/tabs/tabs.css +1 -1
- package/cjs/components/tag/tag.css +3 -3
- package/cjs/components/text-area/text-area.css +9 -9
- package/cjs/components/text-area/text-area.d.ts +2 -2
- package/cjs/components/text-area/text-area.js +41 -32
- package/cjs/components/virtual-input/virtual-input.d.ts +1 -1
- package/cjs/utils/get-scroll-parent.js +1 -1
- package/es/components/avatar/avatar.d.ts +1 -1
- package/es/components/badge/badge.css +16 -10
- package/es/components/badge/badge.d.ts +1 -0
- package/es/components/badge/badge.js +4 -5
- package/es/components/button/button.css +1 -1
- package/es/components/calendar/calendar.js +2 -0
- package/es/components/capsule-tabs/capsule-tabs.css +1 -1
- package/es/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/es/components/checkbox/check-icon.js +4 -13
- package/es/components/checkbox/checkbox.css +11 -27
- package/es/components/checkbox/checkbox.js +3 -6
- package/es/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/es/components/checkbox/indeterminate-icon.js +10 -0
- package/es/components/date-picker/date-picker.d.ts +1 -1
- package/es/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/es/components/error-block/error-block.d.ts +1 -1
- package/es/components/floating-bubble/floating-bubble.css +1 -0
- package/es/components/floating-panel/floating-panel.d.ts +2 -0
- package/es/components/floating-panel/floating-panel.js +5 -0
- package/es/components/form/form-item.css +3 -2
- package/es/components/form/form-item.d.ts +2 -2
- package/es/components/form/form-item.js +9 -5
- package/es/components/form/form.css +6 -3
- package/es/components/form/form.d.ts +5 -4
- package/es/components/form/index.css +9 -5
- package/es/components/form/index.d.ts +5 -4
- package/es/components/image-viewer/image-viewer.d.ts +8 -2
- package/es/components/image-viewer/image-viewer.js +4 -3
- package/es/components/image-viewer/index.d.ts +6 -2
- package/es/components/image-viewer/slides.d.ts +7 -3
- package/es/components/image-viewer/slides.js +19 -10
- package/es/components/input/input.css +26 -24
- package/es/components/input/input.d.ts +4 -4
- package/es/components/input/input.js +7 -4
- package/es/components/jumbo-tabs/jumbo-tabs.css +4 -1
- package/es/components/list/list.css +2 -5
- package/es/components/list/list.d.ts +1 -1
- package/es/components/modal/modal.css +23 -19
- package/es/components/modal/modal.js +8 -12
- package/es/components/nav-bar/nav-bar.css +3 -3
- package/es/components/notice-bar/notice-bar.d.ts +1 -1
- package/es/components/passcode-input/passcode-input.d.ts +2 -2
- package/es/components/picker/picker.css +9 -2
- package/es/components/picker/picker.d.ts +1 -1
- package/es/components/picker-view/picker-view.css +4 -2
- package/es/components/picker-view/picker-view.d.ts +1 -1
- package/es/components/picker-view/wheel.js +1 -1
- package/es/components/popover/arrow.d.ts +3 -0
- package/es/components/popover/arrow.js +12 -0
- package/es/components/popover/index.d.ts +7 -15
- package/es/components/popover/index.js +3 -2
- package/es/components/popover/popover-menu.css +52 -0
- package/es/components/popover/popover-menu.d.ts +20 -0
- package/es/components/popover/popover-menu.js +52 -0
- package/es/components/popover/popover.css +83 -276
- package/es/components/popover/popover.d.ts +9 -8
- package/es/components/popover/popover.js +10 -17
- package/es/components/radio/radio.css +9 -12
- package/es/components/radio/radio.js +1 -3
- package/es/components/result/result.css +2 -5
- package/es/components/search-bar/search-bar.css +13 -9
- package/es/components/selector/selector.css +3 -0
- package/es/components/spin-loading/spin-loading.css +1 -17
- package/es/components/spin-loading/spin-loading.d.ts +1 -1
- package/es/components/spin-loading/spin-loading.js +32 -5
- package/es/components/stepper/stepper.css +4 -6
- package/es/components/stepper/stepper.js +0 -1
- package/es/components/swipe-action/swipe-action.d.ts +2 -2
- package/es/components/swipe-action/swipe-action.js +1 -1
- package/es/components/swiper/swiper.js +13 -19
- package/es/components/switch/switch.css +8 -3
- package/es/components/tabs/tabs.css +1 -1
- package/es/components/tag/tag.css +3 -3
- package/es/components/text-area/text-area.css +9 -9
- package/es/components/text-area/text-area.d.ts +2 -2
- package/es/components/text-area/text-area.js +41 -31
- package/es/components/virtual-input/virtual-input.d.ts +1 -1
- package/es/utils/get-scroll-parent.js +1 -1
- package/package.json +2 -2
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/popover/animation.css +0 -111
- package/2x/cjs/components/popover/pop-menu.d.ts +0 -28
- package/2x/es/components/popover/animation.css +0 -111
- package/2x/es/components/popover/pop-menu.d.ts +0 -28
- package/2x/es/components/popover/pop-menu.js +0 -54
- package/cjs/components/popover/animation.css +0 -96
- package/cjs/components/popover/pop-menu.d.ts +0 -28
- package/es/components/popover/animation.css +0 -96
- package/es/components/popover/pop-menu.d.ts +0 -28
- package/es/components/popover/pop-menu.js +0 -54
|
@@ -5,18 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TextArea = void 0;
|
|
7
7
|
|
|
8
|
-
var _tslib = require("tslib");
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
9
|
|
|
12
|
-
var
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
13
11
|
|
|
14
12
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
15
13
|
|
|
16
14
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
17
15
|
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
17
|
|
|
22
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -31,16 +27,10 @@ const defaultProps = {
|
|
|
31
27
|
const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
32
28
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
33
29
|
const {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onChange: outerOnChange,
|
|
39
|
-
rows: rows,
|
|
40
|
-
autoSize: autoSize,
|
|
41
|
-
showCount
|
|
42
|
-
} = props,
|
|
43
|
-
textAreaProps = (0, _tslib.__rest)(props, ["className", "style", "defaultValue", "value", "onChange", "rows", "autoSize", "showCount"]);
|
|
30
|
+
autoSize,
|
|
31
|
+
showCount,
|
|
32
|
+
maxLength
|
|
33
|
+
} = props;
|
|
44
34
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
45
35
|
const nativeTextAreaRef = (0, _react.useRef)(null);
|
|
46
36
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
@@ -80,40 +70,59 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
80
70
|
|
|
81
71
|
textArea.style.height = `${height}px`;
|
|
82
72
|
}, [value, autoSize]);
|
|
73
|
+
const compositingRef = (0, _react.useRef)(false);
|
|
83
74
|
let count;
|
|
75
|
+
const valueLength = [...value].length;
|
|
84
76
|
|
|
85
77
|
if (typeof showCount === 'function') {
|
|
86
|
-
count = showCount(
|
|
78
|
+
count = showCount(valueLength, maxLength);
|
|
87
79
|
} else if (showCount) {
|
|
88
80
|
count = _react.default.createElement("div", {
|
|
89
81
|
className: `${classPrefix}-count`
|
|
90
|
-
},
|
|
82
|
+
}, maxLength === undefined ? valueLength : valueLength + '/' + maxLength);
|
|
91
83
|
}
|
|
92
84
|
|
|
93
|
-
return _react.default.createElement("div", {
|
|
94
|
-
className:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
className: classPrefix,
|
|
100
|
-
rows: rows,
|
|
85
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
86
|
+
className: classPrefix
|
|
87
|
+
}, _react.default.createElement("textarea", {
|
|
88
|
+
ref: nativeTextAreaRef,
|
|
89
|
+
className: `${classPrefix}-element`,
|
|
90
|
+
rows: props.rows,
|
|
101
91
|
value: value,
|
|
92
|
+
placeholder: props.placeholder,
|
|
102
93
|
onChange: e => {
|
|
103
|
-
|
|
94
|
+
let v = e.target.value;
|
|
95
|
+
|
|
96
|
+
if (maxLength && !compositingRef.current) {
|
|
97
|
+
v = [...v].slice(0, maxLength).join('');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
setValue(v);
|
|
104
101
|
},
|
|
105
|
-
|
|
102
|
+
id: props.id,
|
|
103
|
+
onCompositionStart: e => {
|
|
106
104
|
var _a;
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
compositingRef.current = true;
|
|
107
|
+
(_a = props.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
109
108
|
},
|
|
110
|
-
|
|
109
|
+
onCompositionEnd: e => {
|
|
111
110
|
var _a;
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
compositingRef.current = false;
|
|
113
|
+
|
|
114
|
+
if (maxLength) {
|
|
115
|
+
setValue([...value].slice(0, maxLength).join(''));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
114
119
|
},
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
autoComplete: props.autoComplete,
|
|
121
|
+
disabled: props.disabled,
|
|
122
|
+
readOnly: props.readOnly,
|
|
123
|
+
onFocus: props.onFocus,
|
|
124
|
+
onBlur: props.onBlur
|
|
125
|
+
}), count));
|
|
117
126
|
});
|
|
118
127
|
exports.TextArea = TextArea;
|
|
119
128
|
TextArea.defaultProps = defaultProps;
|
|
@@ -21,4 +21,4 @@ export declare const VirtualInput: React.ForwardRefExoticComponent<{
|
|
|
21
21
|
keyboard?: React.ReactElement<NumberKeyboardProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
|
|
22
22
|
clearable?: boolean | undefined;
|
|
23
23
|
onClear?: (() => void) | undefined;
|
|
24
|
-
} & Pick<InputProps, "value" | "disabled" | "onChange" | "placeholder"> & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--
|
|
24
|
+
} & Pick<InputProps, "value" | "disabled" | "onChange" | "placeholder"> & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--caret-width" | "--caret-color"> & React.RefAttributes<VirtualInputRef>>;
|
|
@@ -7,7 +7,7 @@ exports.getScrollParent = getScrollParent;
|
|
|
7
7
|
|
|
8
8
|
var _canUseDom = require("./can-use-dom");
|
|
9
9
|
|
|
10
|
-
const overflowScrollReg = /scroll|auto/i;
|
|
10
|
+
const overflowScrollReg = /scroll|auto|overlay/i;
|
|
11
11
|
const defaultRoot = _canUseDom.canUseDom ? window : undefined;
|
|
12
12
|
|
|
13
13
|
function isElement(node) {
|
|
@@ -5,5 +5,5 @@ export declare type AvatarProps = {
|
|
|
5
5
|
src: string;
|
|
6
6
|
fallback?: ReactNode;
|
|
7
7
|
fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
8
|
-
} & Pick<ImageProps, 'alt' | 'lazy' | 'onClick' | 'onError'> & NativeProps<'--size'>;
|
|
8
|
+
} & Pick<ImageProps, 'alt' | 'lazy' | 'onClick' | 'onError'> & NativeProps<'--size' | '--border-radius'>;
|
|
9
9
|
export declare const Avatar: FC<AvatarProps>;
|
|
@@ -3,23 +3,26 @@
|
|
|
3
3
|
position: relative;
|
|
4
4
|
}
|
|
5
5
|
.adm-badge {
|
|
6
|
-
display: inline-
|
|
7
|
-
color: #fff;
|
|
8
|
-
font-weight: normal;
|
|
9
|
-
text-align: center;
|
|
6
|
+
display: inline-flex;
|
|
10
7
|
vertical-align: middle;
|
|
11
|
-
box-sizing:
|
|
12
|
-
min-width: 16px;
|
|
8
|
+
box-sizing: content-box;
|
|
13
9
|
border-radius: 100px;
|
|
14
|
-
padding: 0 4px;
|
|
15
|
-
font-size: 9px;
|
|
16
|
-
line-height: 1.2;
|
|
17
|
-
white-space: nowrap;
|
|
18
10
|
background-color: var(--color);
|
|
19
11
|
--right: 0;
|
|
20
12
|
--top: 0;
|
|
21
13
|
--color: var(--adm-badge-color, #ff411c);
|
|
22
14
|
}
|
|
15
|
+
.adm-badge-content {
|
|
16
|
+
color: #fff;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
min-width: 8px;
|
|
19
|
+
padding: 1px 4px;
|
|
20
|
+
font-size: 9px;
|
|
21
|
+
line-height: 12px;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
font-weight: normal;
|
|
24
|
+
text-align: center;
|
|
25
|
+
}
|
|
23
26
|
.adm-badge-fixed {
|
|
24
27
|
position: absolute;
|
|
25
28
|
right: var(--right);
|
|
@@ -32,3 +35,6 @@
|
|
|
32
35
|
height: 10px;
|
|
33
36
|
border-radius: 5px;
|
|
34
37
|
}
|
|
38
|
+
.adm-badge-bordered {
|
|
39
|
+
border: solid 1px var(--adm-color-white);
|
|
40
|
+
}
|
|
@@ -10,16 +10,15 @@ export const Badge = props => {
|
|
|
10
10
|
children
|
|
11
11
|
} = props;
|
|
12
12
|
const isDot = content === dot;
|
|
13
|
-
const badgeCls = classNames(classPrefix, {
|
|
14
|
-
[`${classPrefix}-fixed`]: !!children,
|
|
15
|
-
[`${classPrefix}-dot`]: isDot
|
|
16
|
-
});
|
|
13
|
+
const badgeCls = classNames(classPrefix, !!children && `${classPrefix}-fixed`, isDot && `${classPrefix}-dot`, props.bordered && `${classPrefix}-bordered`);
|
|
17
14
|
const element = content ? withNativeProps(props, React.createElement("div", {
|
|
18
15
|
className: badgeCls,
|
|
19
16
|
style: {
|
|
20
17
|
'--color': color
|
|
21
18
|
}
|
|
22
|
-
}, !isDot &&
|
|
19
|
+
}, !isDot && React.createElement("div", {
|
|
20
|
+
className: `${classPrefix}-content`
|
|
21
|
+
}, content))) : null;
|
|
23
22
|
return children ? React.createElement("div", {
|
|
24
23
|
className: `${classPrefix}-wrap`
|
|
25
24
|
}, children, element) : element;
|
|
@@ -6,6 +6,8 @@ import { mergeProps } from '../../utils/with-default-props';
|
|
|
6
6
|
import { ArrowLeft } from './arrow-left';
|
|
7
7
|
import { ArrowLeftDouble } from './arrow-left-double';
|
|
8
8
|
import { useConfig } from '../config-provider';
|
|
9
|
+
import isoWeek from 'dayjs/plugin/isoWeek';
|
|
10
|
+
dayjs.extend(isoWeek);
|
|
9
11
|
const classPrefix = 'adm-calendar';
|
|
10
12
|
const defaultProps = {
|
|
11
13
|
weekStartsOn: 'Sunday'
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { NativeProps } from '../../utils/native-props';
|
|
3
2
|
import type { PickerViewProps } from '../picker-view';
|
|
4
3
|
import type { CascadePickerOption } from '../cascade-picker';
|
|
5
4
|
export declare type CascadePickerViewProps = Omit<PickerViewProps, 'columns'> & {
|
|
6
5
|
options: CascadePickerOption[];
|
|
7
|
-
}
|
|
6
|
+
};
|
|
8
7
|
export declare const CascadePickerView: FC<CascadePickerViewProps>;
|
|
@@ -2,18 +2,9 @@ import React, { memo } from 'react';
|
|
|
2
2
|
import { withNativeProps } from '../../utils/native-props';
|
|
3
3
|
export const CheckIcon = memo(props => {
|
|
4
4
|
return withNativeProps(props, React.createElement("svg", {
|
|
5
|
-
viewBox: '0 0
|
|
6
|
-
}, React.createElement("g", {
|
|
7
|
-
stroke: 'none',
|
|
8
|
-
strokeWidth: '1',
|
|
9
|
-
fill: 'none',
|
|
10
|
-
fillRule: 'evenodd'
|
|
11
|
-
}, React.createElement("g", {
|
|
12
|
-
transform: 'translate(-35.000000, -40.000000)',
|
|
13
|
-
fill: 'currentColor'
|
|
14
|
-
}, React.createElement("g", {
|
|
15
|
-
transform: 'translate(24.000000, 26.000000)'
|
|
5
|
+
viewBox: '0 0 40 40'
|
|
16
6
|
}, React.createElement("path", {
|
|
17
|
-
d: '
|
|
18
|
-
|
|
7
|
+
d: 'M31.5541766,15 L28.0892433,15 L28.0892434,15 C27.971052,15 27.8576674,15.044522 27.7740471,15.1239792 L18.2724722,24.1625319 L13.2248725,19.3630279 L13.2248725,19.3630279 C13.1417074,19.2834412 13.0287551,19.2384807 12.9107898,19.2380079 L9.44474455,19.2380079 L9.44474454,19.2380079 C9.19869815,19.2384085 8.99957935,19.4284738 9,19.66253 C9,19.7747587 9.04719253,19.8823283 9.13066188,19.9616418 L17.0907466,27.5338228 C17.4170809,27.8442545 17.8447695,28 18.2713393,28 L18.2980697,28 C18.7168464,27.993643 19.133396,27.8378975 19.4530492,27.5338228 L31.8693384,15.7236361 L31.8693384,15.7236361 C32.0434167,15.5582251 32.0435739,15.2898919 31.8696892,15.1242941 C31.7860402,15.0446329 31.6725052,15 31.5541421,15 L31.5541766,15 Z',
|
|
8
|
+
fill: 'currentColor'
|
|
9
|
+
})));
|
|
19
10
|
});
|
|
@@ -13,19 +13,17 @@
|
|
|
13
13
|
}
|
|
14
14
|
.adm-checkbox .adm-checkbox-icon {
|
|
15
15
|
flex: none;
|
|
16
|
-
border: 1px solid
|
|
16
|
+
border: 1px solid var(--adm-color-light);
|
|
17
17
|
border-radius: var(--icon-size);
|
|
18
18
|
box-sizing: border-box;
|
|
19
|
-
display: flex;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
align-items: center;
|
|
22
19
|
width: var(--icon-size);
|
|
23
20
|
height: var(--icon-size);
|
|
24
|
-
color:
|
|
21
|
+
color: var(--adm-color-white);
|
|
25
22
|
}
|
|
26
|
-
.adm-checkbox .adm-checkbox-icon
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
.adm-checkbox .adm-checkbox-icon > svg {
|
|
24
|
+
display: block;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
29
27
|
}
|
|
30
28
|
.adm-checkbox.adm-checkbox-block {
|
|
31
29
|
display: flex;
|
|
@@ -38,34 +36,20 @@
|
|
|
38
36
|
cursor: not-allowed;
|
|
39
37
|
}
|
|
40
38
|
.adm-checkbox.adm-checkbox-disabled .adm-checkbox-content {
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
.adm-checkbox.adm-checkbox-disabled.adm-checkbox-indeterminate .adm-checkbox-icon {
|
|
44
|
-
color: #ccc;
|
|
45
|
-
border-color: #ccc;
|
|
46
|
-
background-color: #ebedf0;
|
|
39
|
+
opacity: 0.4;
|
|
47
40
|
}
|
|
48
|
-
.adm-checkbox.adm-checkbox-disabled.adm-checkbox-
|
|
49
|
-
color: #
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
border-color: #ccc;
|
|
53
|
-
background-color: #ebedf0;
|
|
41
|
+
.adm-checkbox.adm-checkbox-disabled .adm-checkbox-icon.adm-checkbox-icon {
|
|
42
|
+
color: #b7b7b7;
|
|
43
|
+
border-color: var(--adm-color-light);
|
|
44
|
+
background-color: #f5f5f5;
|
|
54
45
|
}
|
|
55
46
|
.adm-checkbox .adm-checkbox-custom-icon {
|
|
56
47
|
font-size: var(--icon-size);
|
|
57
48
|
}
|
|
58
49
|
.adm-checkbox.adm-checkbox-indeterminate .adm-checkbox-icon {
|
|
59
|
-
border-color: var(--adm-color-primary);
|
|
60
50
|
background-color: #ffffff;
|
|
61
51
|
color: var(--adm-color-primary);
|
|
62
52
|
}
|
|
63
|
-
.adm-checkbox.adm-checkbox-indeterminate .adm-checkbox-indeterminate-checked {
|
|
64
|
-
width: 60%;
|
|
65
|
-
height: 60%;
|
|
66
|
-
border-radius: 100%;
|
|
67
|
-
background-color: currentColor;
|
|
68
|
-
}
|
|
69
53
|
.adm-checkbox-content {
|
|
70
54
|
flex: 0 1 auto;
|
|
71
55
|
font-size: var(--font-size);
|
|
@@ -6,6 +6,7 @@ import { usePropsValue } from '../../utils/use-props-value';
|
|
|
6
6
|
import { mergeProps } from '../../utils/with-default-props';
|
|
7
7
|
import { devWarning } from '../../utils/dev-log';
|
|
8
8
|
import { CheckIcon } from './check-icon';
|
|
9
|
+
import { IndeterminateIcon } from './indeterminate-icon';
|
|
9
10
|
const classPrefix = `adm-checkbox`;
|
|
10
11
|
const defaultProps = {
|
|
11
12
|
defaultChecked: false,
|
|
@@ -63,16 +64,12 @@ export const Checkbox = p => {
|
|
|
63
64
|
|
|
64
65
|
return React.createElement("div", {
|
|
65
66
|
className: `${classPrefix}-icon`
|
|
66
|
-
}, props.indeterminate ? React.createElement(
|
|
67
|
-
className: `${classPrefix}-indeterminate-checked`
|
|
68
|
-
}) : checked && React.createElement(CheckIcon, {
|
|
69
|
-
className: `${classPrefix}-icon-checked`
|
|
70
|
-
}));
|
|
67
|
+
}, props.indeterminate ? React.createElement(IndeterminateIcon, null) : checked && React.createElement(CheckIcon, null));
|
|
71
68
|
};
|
|
72
69
|
|
|
73
70
|
return withNativeProps(props, React.createElement("label", {
|
|
74
71
|
className: classNames(classPrefix, {
|
|
75
|
-
[`${classPrefix}-checked`]: checked,
|
|
72
|
+
[`${classPrefix}-checked`]: checked && !props.indeterminate,
|
|
76
73
|
[`${classPrefix}-indeterminate`]: props.indeterminate,
|
|
77
74
|
[`${classPrefix}-disabled`]: disabled,
|
|
78
75
|
[`${classPrefix}-block`]: props.block
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
3
|
+
export const IndeterminateIcon = memo(props => {
|
|
4
|
+
return withNativeProps(props, React.createElement("svg", {
|
|
5
|
+
viewBox: '0 0 40 40'
|
|
6
|
+
}, React.createElement("path", {
|
|
7
|
+
d: 'M20,9 C26.0752953,9 31,13.9247047 31,20 C31,26.0752953 26.0752953,31 20,31 C13.9247047,31 9,26.0752953 9,20 C9,13.9247047 13.9247047,9 20,9 Z',
|
|
8
|
+
fill: 'currentColor'
|
|
9
|
+
})));
|
|
10
|
+
});
|
|
@@ -2,7 +2,7 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
import type { PickerProps } from '../picker';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import type { Precision, DatePickerFilter } from './date-picker-utils';
|
|
5
|
-
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation'> & {
|
|
5
|
+
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation' | 'style'> & {
|
|
6
6
|
value?: Date | null;
|
|
7
7
|
defaultValue?: Date | null;
|
|
8
8
|
onSelect?: (value: Date) => void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
+
import type { PickerViewProps } from '../picker-view';
|
|
2
3
|
import { NativeProps } from '../../utils/native-props';
|
|
3
4
|
import type { Precision, DatePickerFilter } from '../date-picker/date-picker-utils';
|
|
4
|
-
export declare type DatePickerViewProps = {
|
|
5
|
+
export declare type DatePickerViewProps = Pick<PickerViewProps, 'style'> & {
|
|
5
6
|
value?: Date;
|
|
6
7
|
defaultValue?: Date;
|
|
7
8
|
onChange?: (value: Date) => void;
|
|
@@ -10,5 +11,5 @@ export declare type DatePickerViewProps = {
|
|
|
10
11
|
precision?: Precision;
|
|
11
12
|
renderLabel?: (type: Precision, data: number) => ReactNode;
|
|
12
13
|
filter?: DatePickerFilter;
|
|
13
|
-
} & NativeProps
|
|
14
|
+
} & NativeProps;
|
|
14
15
|
export declare const DatePickerView: FC<DatePickerViewProps>;
|
|
@@ -6,5 +6,5 @@ export declare type ErrorBlockProps = {
|
|
|
6
6
|
image?: string | ReactElement;
|
|
7
7
|
description?: ReactNode;
|
|
8
8
|
fullPage?: boolean;
|
|
9
|
-
} & NativeProps<'--image-height' | '--image-height-full-page'>;
|
|
9
|
+
} & NativeProps<'--image-height' | '--image-height-full-page' | '--image-width' | '--image-width-full-page'>;
|
|
10
10
|
export declare const ErrorBlock: FC<ErrorBlockProps>;
|
|
@@ -3,6 +3,7 @@ import { NativeProps } from '../../utils/native-props';
|
|
|
3
3
|
export declare type FloatingPanelProps = {
|
|
4
4
|
anchors: number[];
|
|
5
5
|
children: ReactNode;
|
|
6
|
+
onHeightChange?: (height: number, animating: boolean) => void;
|
|
6
7
|
} & NativeProps<'--border-radius' | '--z-index'>;
|
|
7
8
|
export declare type FloatingPanelRef = {
|
|
8
9
|
setHeight: (height: number, options?: {
|
|
@@ -12,4 +13,5 @@ export declare type FloatingPanelRef = {
|
|
|
12
13
|
export declare const FloatingPanel: React.ForwardRefExoticComponent<{
|
|
13
14
|
anchors: number[];
|
|
14
15
|
children: ReactNode;
|
|
16
|
+
onHeightChange?: ((height: number, animating: boolean) => void) | undefined;
|
|
15
17
|
} & NativeProps<"--z-index" | "--border-radius"> & React.RefAttributes<FloatingPanelRef>>;
|
|
@@ -27,6 +27,11 @@ export const FloatingPanel = forwardRef((props, ref) => {
|
|
|
27
27
|
y: bounds.bottom,
|
|
28
28
|
config: {
|
|
29
29
|
tension: 300
|
|
30
|
+
},
|
|
31
|
+
onChange: result => {
|
|
32
|
+
var _a;
|
|
33
|
+
|
|
34
|
+
(_a = props.onHeightChange) === null || _a === void 0 ? void 0 : _a.call(props, result.value.y, y.isAnimating);
|
|
30
35
|
}
|
|
31
36
|
}));
|
|
32
37
|
useDrag(state => {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
.adm-form-item-label-required {
|
|
12
12
|
position: absolute;
|
|
13
13
|
left: -0.6em;
|
|
14
|
-
top: 0
|
|
14
|
+
top: 0;
|
|
15
|
+
font-family: SimSun, sans-serif;
|
|
15
16
|
color: var(--adm-color-danger);
|
|
16
17
|
user-select: none;
|
|
17
18
|
}
|
|
@@ -22,8 +23,8 @@
|
|
|
22
23
|
display: none;
|
|
23
24
|
}
|
|
24
25
|
.adm-form-vertical .adm-form-item-label {
|
|
25
|
-
margin-bottom: 4px;
|
|
26
26
|
font-size: 15px;
|
|
27
|
+
margin-bottom: 4px;
|
|
27
28
|
}
|
|
28
29
|
.adm-form-vertical .adm-form-item-footer {
|
|
29
30
|
margin-top: 4px;
|
|
@@ -7,7 +7,7 @@ import type { FormLayout } from './index';
|
|
|
7
7
|
declare type RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;
|
|
8
8
|
declare type ChildrenType<Values = any> = RenderChildren<Values> | React.ReactNode;
|
|
9
9
|
declare type RcFieldProps = Omit<FieldProps, 'children'>;
|
|
10
|
-
export declare type FormItemProps = RcFieldProps
|
|
10
|
+
export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate'> & Pick<ListItemProps, 'style' | 'onClick' | 'extra' | 'arrow'> & {
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
help?: React.ReactNode;
|
|
13
13
|
hasFeedback?: boolean;
|
|
@@ -17,6 +17,6 @@ export declare type FormItemProps = RcFieldProps & NativeProps & Pick<ListItemPr
|
|
|
17
17
|
hidden?: boolean;
|
|
18
18
|
layout?: FormLayout;
|
|
19
19
|
children: ChildrenType;
|
|
20
|
-
};
|
|
20
|
+
} & NativeProps;
|
|
21
21
|
export declare const FormItem: FC<FormItemProps>;
|
|
22
22
|
export {};
|
|
@@ -25,7 +25,8 @@ const FormItemLayout = props => {
|
|
|
25
25
|
children,
|
|
26
26
|
htmlFor,
|
|
27
27
|
hidden,
|
|
28
|
-
errors
|
|
28
|
+
errors,
|
|
29
|
+
arrow
|
|
29
30
|
} = props;
|
|
30
31
|
const context = useContext(FormContext);
|
|
31
32
|
const hasFeedback = props.hasFeedback !== undefined ? props.hasFeedback : context.hasFeedback;
|
|
@@ -52,7 +53,8 @@ const FormItemLayout = props => {
|
|
|
52
53
|
[`${classPrefix}-hidden`]: hidden
|
|
53
54
|
}),
|
|
54
55
|
disabled: disabled,
|
|
55
|
-
onClick: props.onClick
|
|
56
|
+
onClick: props.onClick,
|
|
57
|
+
arrow: arrow
|
|
56
58
|
}, children);
|
|
57
59
|
};
|
|
58
60
|
|
|
@@ -80,9 +82,10 @@ export const FormItem = props => {
|
|
|
80
82
|
validateTrigger,
|
|
81
83
|
onClick,
|
|
82
84
|
shouldUpdate,
|
|
83
|
-
dependencies
|
|
85
|
+
dependencies,
|
|
86
|
+
arrow
|
|
84
87
|
} = props,
|
|
85
|
-
fieldProps = __rest(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies"]);
|
|
88
|
+
fieldProps = __rest(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "arrow"]);
|
|
86
89
|
|
|
87
90
|
const {
|
|
88
91
|
validateTrigger: contextValidateTrigger
|
|
@@ -138,7 +141,8 @@ export const FormItem = props => {
|
|
|
138
141
|
errors: errors,
|
|
139
142
|
onClick: onClick,
|
|
140
143
|
hidden: hidden,
|
|
141
|
-
layout: layout
|
|
144
|
+
layout: layout,
|
|
145
|
+
arrow: arrow
|
|
142
146
|
}, React.createElement(NoStyleItemContext.Provider, {
|
|
143
147
|
value: onSubMetaChange
|
|
144
148
|
}, baseChildren));
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
.adm-form .adm-list.adm-list {
|
|
2
|
-
--padding-left:
|
|
3
|
-
--padding-right:
|
|
2
|
+
--padding-left: 16px;
|
|
3
|
+
--padding-right: 12px;
|
|
4
4
|
}
|
|
5
5
|
.adm-form-horizontal .adm-list.adm-list {
|
|
6
6
|
--prefix-width: 6em;
|
|
7
7
|
--align-items: stretch;
|
|
8
8
|
}
|
|
9
|
+
.adm-form-horizontal .adm-list.adm-list .adm-list-item-content-extra {
|
|
10
|
+
align-self: center;
|
|
11
|
+
}
|
|
9
12
|
.adm-form .adm-form-footer {
|
|
10
|
-
padding: 12px;
|
|
13
|
+
padding: 20px 12px;
|
|
11
14
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
import { ListProps } from '../list';
|
|
4
|
-
import type { FormProps as RcFormProps, FormInstance } from 'rc-field-form';
|
|
4
|
+
import type { FormProps as RcFormProps, FormInstance as RCFormInstance } from 'rc-field-form';
|
|
5
5
|
import { FormContextType } from './context';
|
|
6
6
|
import type { FormLayout } from '.';
|
|
7
|
-
export declare type
|
|
7
|
+
export declare type FormInstance = Pick<RCFormInstance, 'getFieldValue' | 'getFieldsValue' | 'getFieldError' | 'getFieldsError' | 'isFieldTouched' | 'isFieldsTouched' | 'resetFields' | 'setFields' | 'setFieldsValue' | 'submit' | 'validateFields'>;
|
|
8
|
+
export declare type FormProps = Pick<RcFormProps, 'form' | 'initialValues' | 'name' | 'preserve' | 'validateMessages' | 'validateTrigger' | 'onFieldsChange' | 'onFinish' | 'onFinishFailed' | 'onValuesChange' | 'children'> & NativeProps & Partial<FormContextType> & {
|
|
8
9
|
footer?: ReactNode;
|
|
9
10
|
layout?: FormLayout;
|
|
10
11
|
mode?: ListProps['mode'];
|
|
11
12
|
};
|
|
12
|
-
export declare const Form: React.ForwardRefExoticComponent<RcFormProps<any> & NativeProps<never> & Partial<FormContextType> & {
|
|
13
|
+
export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & NativeProps<never> & Partial<FormContextType> & {
|
|
13
14
|
footer?: ReactNode;
|
|
14
15
|
layout?: "horizontal" | "vertical" | undefined;
|
|
15
16
|
mode?: ListProps['mode'];
|
|
16
|
-
} & React.RefAttributes<
|
|
17
|
+
} & React.RefAttributes<Pick<RCFormInstance<any>, "submit" | "getFieldValue" | "getFieldsValue" | "getFieldError" | "getFieldsError" | "isFieldTouched" | "isFieldsTouched" | "resetFields" | "setFields" | "setFieldsValue" | "validateFields">>>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
.adm-form .adm-list.adm-list {
|
|
2
|
-
--padding-left:
|
|
3
|
-
--padding-right:
|
|
2
|
+
--padding-left: 16px;
|
|
3
|
+
--padding-right: 12px;
|
|
4
4
|
}
|
|
5
5
|
.adm-form-horizontal .adm-list.adm-list {
|
|
6
6
|
--prefix-width: 6em;
|
|
7
7
|
--align-items: stretch;
|
|
8
8
|
}
|
|
9
|
+
.adm-form-horizontal .adm-list.adm-list .adm-list-item-content-extra {
|
|
10
|
+
align-self: center;
|
|
11
|
+
}
|
|
9
12
|
.adm-form .adm-form-footer {
|
|
10
|
-
padding: 12px;
|
|
13
|
+
padding: 20px 12px;
|
|
11
14
|
}
|
|
12
15
|
.adm-form-item + .adm-form-item {
|
|
13
16
|
border-top: none;
|
|
@@ -22,7 +25,8 @@
|
|
|
22
25
|
.adm-form-item-label-required {
|
|
23
26
|
position: absolute;
|
|
24
27
|
left: -0.6em;
|
|
25
|
-
top: 0
|
|
28
|
+
top: 0;
|
|
29
|
+
font-family: SimSun, sans-serif;
|
|
26
30
|
color: var(--adm-color-danger);
|
|
27
31
|
user-select: none;
|
|
28
32
|
}
|
|
@@ -33,8 +37,8 @@
|
|
|
33
37
|
display: none;
|
|
34
38
|
}
|
|
35
39
|
.adm-form-vertical .adm-form-item-label {
|
|
36
|
-
margin-bottom: 4px;
|
|
37
40
|
font-size: 15px;
|
|
41
|
+
margin-bottom: 4px;
|
|
38
42
|
}
|
|
39
43
|
.adm-form-vertical .adm-form-item-footer {
|
|
40
44
|
margin-top: 4px;
|