@nutui/nutui-react 2.3.11 → 2.3.12
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/CHANGELOG.md +18 -0
- package/dist/esm/ActionSheet.js +30 -86
- package/dist/esm/Address.js +80 -184
- package/dist/esm/Animate.js +21 -49
- package/dist/esm/AnimatingNumbers.js +47 -136
- package/dist/esm/Audio.js +88 -159
- package/dist/esm/Avatar.js +44 -91
- package/dist/esm/AvatarCropper.js +149 -268
- package/dist/esm/AvatarGroup.js +13 -44
- package/dist/esm/BackTop.js +34 -75
- package/dist/esm/Badge.js +0 -3
- package/dist/esm/Barrage.js +49 -83
- package/dist/esm/Button.js +0 -4
- package/dist/esm/Calendar.js +27 -119
- package/dist/esm/CalendarCard.js +180 -291
- package/dist/esm/CalendarItem.js +253 -314
- package/dist/esm/Card.js +38 -72
- package/dist/esm/Cascader.js +0 -17
- package/dist/esm/Cell.js +27 -62
- package/dist/esm/CellGroup.js +16 -45
- package/dist/esm/Checkbox.js +0 -6
- package/dist/esm/CheckboxGroup.js +49 -88
- package/dist/esm/CircleProgress.js +42 -93
- package/dist/esm/Col.js +17 -48
- package/dist/esm/Collapse.js +18 -49
- package/dist/esm/CollapseItem.js +0 -3
- package/dist/esm/ConfigProvider.js +3 -4
- package/dist/esm/CountDown.js +62 -101
- package/dist/esm/DatePicker.js +87 -127
- package/dist/esm/Dialog.js +117 -203
- package/dist/esm/Divider.js +16 -36
- package/dist/esm/Drag.js +32 -76
- package/dist/esm/Elevator.js +94 -133
- package/dist/esm/Ellipsis.js +71 -92
- package/dist/esm/Empty.js +31 -71
- package/dist/esm/FixedNav.js +32 -81
- package/dist/esm/Form.js +28 -61
- package/dist/esm/FormItem.js +0 -3
- package/dist/esm/Grid.js +27 -52
- package/dist/esm/GridItem.js +0 -4
- package/dist/esm/Image.js +47 -102
- package/dist/esm/ImagePreview.js +82 -135
- package/dist/esm/Indicator.js +0 -2
- package/dist/esm/InfiniteLoading.js +77 -159
- package/dist/esm/Input.js +57 -125
- package/dist/esm/InputNumber.js +66 -96
- package/dist/esm/Layout.js +4 -28
- package/dist/esm/Loading.js +13 -40
- package/dist/esm/Menu.js +51 -114
- package/dist/esm/MenuItem.js +0 -13
- package/dist/esm/NavBar.js +46 -85
- package/dist/esm/NoticeBar.js +153 -226
- package/dist/esm/Notify.js +87 -195
- package/dist/esm/NumberKeyboard.js +84 -150
- package/dist/esm/Overlay.js +0 -8
- package/dist/esm/Pagination.js +58 -97
- package/dist/esm/Picker.js +215 -283
- package/dist/esm/Popover.js +111 -160
- package/dist/esm/Popup.js +0 -12
- package/dist/esm/Price.js +23 -60
- package/dist/esm/Progress.js +47 -77
- package/dist/esm/PullToRefresh.js +94 -202
- package/dist/esm/Radio.js +0 -6
- package/dist/esm/RadioGroup.js +23 -56
- package/dist/esm/Range.js +113 -177
- package/dist/esm/Rate.js +48 -95
- package/dist/esm/Row.js +19 -43
- package/dist/esm/SafeArea.js +0 -2
- package/dist/esm/SearchBar.js +52 -119
- package/dist/esm/ShortPassword.js +58 -106
- package/dist/esm/SideNavBar.js +34 -59
- package/dist/esm/SideNavBarItem.js +7 -36
- package/dist/esm/Signature.js +49 -84
- package/dist/esm/Skeleton.js +31 -68
- package/dist/esm/Space.js +7 -34
- package/dist/esm/Step.js +35 -64
- package/dist/esm/Steps.js +16 -40
- package/dist/esm/Sticky.js +64 -109
- package/dist/esm/SubSideNavBar.js +42 -71
- package/dist/esm/Swipe.js +79 -143
- package/dist/esm/Swiper.js +136 -183
- package/dist/esm/SwiperItem.js +13 -38
- package/dist/esm/Switch.js +20 -53
- package/dist/esm/TabPane.js +6 -30
- package/dist/esm/Tabbar.js +29 -60
- package/dist/esm/TabbarItem.js +0 -4
- package/dist/esm/Table.js +92 -141
- package/dist/esm/Tabs.js +0 -7
- package/dist/esm/Tag.js +30 -74
- package/dist/esm/TextArea.js +37 -82
- package/dist/esm/TimeDetail.js +20 -58
- package/dist/esm/TimeSelect.js +57 -95
- package/dist/esm/Toast.js +110 -219
- package/dist/esm/Tour.js +88 -132
- package/dist/esm/TrendArrow.js +32 -74
- package/dist/esm/Uploader.js +226 -346
- package/dist/esm/UserContext.js +1 -1
- package/dist/esm/Video.js +34 -67
- package/dist/esm/VirtualList.js +127 -160
- package/dist/esm/WaterMark.js +24 -68
- package/dist/esm/badge2.js +23 -53
- package/dist/esm/button2.js +30 -63
- package/dist/esm/can-use-dom.js +1 -1
- package/dist/esm/cascader2.js +308 -538
- package/dist/esm/checkbox2.js +59 -96
- package/dist/esm/collapseitem2.js +48 -86
- package/dist/esm/configprovider2.js +43 -1003
- package/dist/esm/context.js +1 -1
- package/dist/esm/context2.js +1 -1
- package/dist/esm/context3.js +1 -1
- package/dist/esm/context4.js +1 -1
- package/dist/esm/context5.js +8 -8
- package/dist/esm/date.js +88 -66
- package/dist/esm/formitem2.js +236 -1526
- package/dist/esm/get-scroll-parent.js +8 -10
- package/dist/esm/griditem2.js +34 -52
- package/dist/esm/index.js +5 -12
- package/dist/esm/indicator2.js +13 -42
- package/dist/esm/menuitem2.js +81 -124
- package/dist/esm/overlay2.js +39 -78
- package/dist/esm/pad-zero.js +3 -4
- package/dist/esm/popup2.js +79 -124
- package/dist/esm/px-check.js +2 -2
- package/dist/esm/radio2.js +48 -79
- package/dist/esm/raf.js +5 -3
- package/dist/esm/render.js +17 -54
- package/dist/esm/safearea2.js +3 -5
- package/dist/esm/supports-passive.js +3 -3
- package/dist/esm/tabbaritem2.js +42 -58
- package/dist/esm/tabs2.js +82 -120
- package/dist/esm/tslib.es6.js +47 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo1.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo2.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo3.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo4.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo5.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo6.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo7.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo8.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo9.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo1.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo10.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo2.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo3.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo4.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo5.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo6.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo7.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo8.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo9.d.ts +3 -0
- package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/index.d.ts +2 -2
- package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/inputnumber/inputnumber.taro.d.ts +2 -0
- package/dist/esm/typings.js +1 -1
- package/dist/esm/use-click-away.js +9 -13
- package/dist/esm/use-client-rect.js +4 -4
- package/dist/esm/use-props-value.js +10 -15
- package/dist/esm/use-refs.js +5 -7
- package/dist/esm/use-touch.js +16 -20
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/tr-TR.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +465 -485
- package/dist/nutui.react.umd.js +462 -482
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +4 -0
- package/dist/types/index.d.ts +98 -98
- package/dist/types/packages/actionsheet/actionsheet.d.ts +1 -1
- package/dist/types/packages/actionsheet/actionsheet.taro.d.ts +1 -1
- package/dist/types/packages/address/address.d.ts +1 -1
- package/dist/types/packages/address/address.taro.d.ts +1 -1
- package/dist/types/packages/address/customRender.d.ts +1 -1
- package/dist/types/packages/address/customRender.taro.d.ts +1 -1
- package/dist/types/packages/avatar/avatar.d.ts +1 -1
- package/dist/types/packages/avatar/avatar.taro.d.ts +1 -1
- package/dist/types/packages/button/demos/h5/demo1.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo2.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo3.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo4.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo5.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo6.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo7.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo8.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo9.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo1.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo10.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo2.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo3.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo4.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo5.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo6.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo7.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo8.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo9.d.ts +3 -0
- package/dist/types/packages/calendaritem/calendaritem.d.ts +1 -1
- package/dist/types/packages/calendaritem/calendaritem.taro.d.ts +1 -1
- package/dist/types/packages/cascader/cascader.d.ts +1 -1
- package/dist/types/packages/cascader/cascader.taro.d.ts +1 -1
- package/dist/types/packages/cell/cell.d.ts +1 -1
- package/dist/types/packages/cell/cell.taro.d.ts +1 -1
- package/dist/types/packages/checkbox/checkbox.d.ts +2 -2
- package/dist/types/packages/checkbox/checkbox.taro.d.ts +2 -2
- package/dist/types/packages/checkboxgroup/checkboxgroup.d.ts +2 -2
- package/dist/types/packages/checkboxgroup/checkboxgroup.taro.d.ts +2 -2
- package/dist/types/packages/configprovider/configprovider.d.ts +1 -0
- package/dist/types/packages/configprovider/configprovider.taro.d.ts +1 -0
- package/dist/types/packages/configprovider/index.d.ts +2 -2
- package/dist/types/packages/configprovider/index.taro.d.ts +2 -2
- package/dist/types/packages/datepicker/datepicker.d.ts +1 -1
- package/dist/types/packages/datepicker/datepicker.taro.d.ts +1 -1
- package/dist/types/packages/dialog/dialogwrap.d.ts +1 -1
- package/dist/types/packages/empty/empty.d.ts +16 -4
- package/dist/types/packages/fixednav/fixednav.d.ts +1 -1
- package/dist/types/packages/fixednav/fixednav.taro.d.ts +1 -1
- package/dist/types/packages/form/form.d.ts +1 -1
- package/dist/types/packages/form/form.taro.d.ts +1 -1
- package/dist/types/packages/form/index.d.ts +1 -1
- package/dist/types/packages/form/index.taro.d.ts +1 -1
- package/dist/types/packages/inputnumber/inputnumber.taro.d.ts +2 -0
- package/dist/types/packages/menu/menu.d.ts +1 -1
- package/dist/types/packages/menu/menu.taro.d.ts +1 -1
- package/dist/types/packages/numberkeyboard/numberkeyboard.d.ts +1 -1
- package/dist/types/packages/numberkeyboard/numberkeyboard.taro.d.ts +1 -1
- package/dist/types/packages/nutui.react.d.ts +98 -98
- package/dist/types/packages/nutui.react.taro.d.ts +98 -98
- package/dist/types/packages/nutui.taro.react.build.d.ts +98 -98
- package/dist/types/packages/picker/picker.d.ts +1 -1
- package/dist/types/packages/picker/picker.taro.d.ts +1 -1
- package/dist/types/packages/popover/popover.d.ts +1 -1
- package/dist/types/packages/popover/popover.taro.d.ts +1 -1
- package/dist/types/packages/popup/popup.d.ts +1 -1
- package/dist/types/packages/popup/popup.taro.d.ts +1 -1
- package/dist/types/packages/radio/radio.d.ts +2 -2
- package/dist/types/packages/radio/radio.taro.d.ts +2 -2
- package/dist/types/packages/rate/rate.d.ts +1 -1
- package/dist/types/packages/shortpassword/shortpassword.d.ts +1 -1
- package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +1 -1
- package/dist/types/packages/swiper/index.d.ts +1 -1
- package/dist/types/packages/swiper/index.taro.d.ts +1 -1
- package/dist/types/packages/tabs/tabs.d.ts +1 -1
- package/dist/types/packages/tabs/tabs.taro.d.ts +1 -1
- package/dist/types/packages/timedetail/timedetail.d.ts +1 -1
- package/dist/types/packages/timedetail/timedetail.taro.d.ts +1 -1
- package/dist/types/packages/tour/tour.d.ts +1 -1
- package/dist/types/packages/tour/tour.taro.d.ts +1 -1
- package/package.json +5 -1
package/dist/esm/Tag.js
CHANGED
|
@@ -1,54 +1,28 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
function ownKeys(e, r) {
|
|
4
|
-
var t = Object.keys(e);
|
|
5
|
-
if (Object.getOwnPropertySymbols) {
|
|
6
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
7
|
-
r && (o = o.filter(function(r2) {
|
|
8
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
9
|
-
})), t.push.apply(t, o);
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
}
|
|
13
|
-
function _objectSpread(e) {
|
|
14
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
15
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
16
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
17
|
-
_defineProperty(e, r2, t[r2]);
|
|
18
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
19
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return e;
|
|
23
|
-
}
|
|
24
1
|
import React__default, { useState } from "react";
|
|
25
2
|
import { Close } from "@nutui/icons-react";
|
|
26
3
|
import classNames from "classnames";
|
|
27
4
|
import { C as ComponentDefaults } from "./typings.js";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
plain
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var classes = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classPrefix, true), "".concat(classPrefix, "-").concat(type), type), "".concat(classPrefix, "-plain"), plain), "".concat(classPrefix, "-round"), round), "".concat(classPrefix, "-mark"), mark), "".concat(classPrefix, "-close"), closeable), "".concat(className), className));
|
|
47
|
-
var handleClick = function handleClick2(e) {
|
|
48
|
-
onClick2 && onClick2(e);
|
|
5
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { type: "default", background: "", color: "", plain: false, round: false, mark: false, closeable: false, closeIcon: null, onClose: (e) => {
|
|
6
|
+
}, onClick: (e) => {
|
|
7
|
+
} });
|
|
8
|
+
const Tag = (props) => {
|
|
9
|
+
const { className, style, background, plain, type, round, children, mark, closeable, closeIcon, color, onClick, onClose } = Object.assign(Object.assign({}, defaultProps), props);
|
|
10
|
+
const [visible, setVisible] = useState(true);
|
|
11
|
+
const classPrefix = "nut-tag";
|
|
12
|
+
const classes = classNames({
|
|
13
|
+
[classPrefix]: true,
|
|
14
|
+
[`${classPrefix}-${type}`]: type,
|
|
15
|
+
[`${classPrefix}-plain`]: plain,
|
|
16
|
+
[`${classPrefix}-round`]: round,
|
|
17
|
+
[`${classPrefix}-mark`]: mark,
|
|
18
|
+
[`${classPrefix}-close`]: closeable,
|
|
19
|
+
[`${className}`]: className
|
|
20
|
+
});
|
|
21
|
+
const handleClick = (e) => {
|
|
22
|
+
onClick && onClick(e);
|
|
49
23
|
};
|
|
50
|
-
|
|
51
|
-
|
|
24
|
+
const getStyle = () => {
|
|
25
|
+
const style2 = {};
|
|
52
26
|
if (color) {
|
|
53
27
|
style2.color = color;
|
|
54
28
|
} else if (background && plain) {
|
|
@@ -61,36 +35,18 @@ var Tag = function Tag2(props) {
|
|
|
61
35
|
}
|
|
62
36
|
return style2;
|
|
63
37
|
};
|
|
64
|
-
return React__default.createElement(React__default.Fragment, null, closeable ? visible && React__default.createElement(
|
|
65
|
-
|
|
66
|
-
style:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
}, children && React__default.createElement("span", {
|
|
71
|
-
className: "".concat(classPrefix, "-text")
|
|
72
|
-
}, children), React__default.isValidElement(closeIcon) ? React__default.createElement("i", {
|
|
73
|
-
className: "".concat(classPrefix, "-custom-icon"),
|
|
74
|
-
onClick: function onClick3(e) {
|
|
38
|
+
return React__default.createElement(React__default.Fragment, null, closeable ? visible && React__default.createElement(
|
|
39
|
+
"div",
|
|
40
|
+
{ className: classes, style: Object.assign(Object.assign({}, style), getStyle()), onClick: (e) => handleClick(e) },
|
|
41
|
+
children && React__default.createElement("span", { className: `${classPrefix}-text` }, children),
|
|
42
|
+
React__default.isValidElement(closeIcon) ? React__default.createElement("i", { className: `${classPrefix}-custom-icon`, onClick: (e) => {
|
|
75
43
|
setVisible(false);
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
}, closeIcon) : React__default.createElement(Close, {
|
|
79
|
-
width: 8,
|
|
80
|
-
height: 8,
|
|
81
|
-
onClick: function onClick3(e) {
|
|
44
|
+
onClose && onClose(e);
|
|
45
|
+
} }, closeIcon) : React__default.createElement(Close, { width: 8, height: 8, onClick: (e) => {
|
|
82
46
|
setVisible(false);
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
})) : React__default.createElement("
|
|
86
|
-
className: classes,
|
|
87
|
-
style: _objectSpread(_objectSpread({}, style), getStyle()),
|
|
88
|
-
onClick: function onClick3(e) {
|
|
89
|
-
return handleClick(e);
|
|
90
|
-
}
|
|
91
|
-
}, children && React__default.createElement("span", {
|
|
92
|
-
className: "".concat(classPrefix, "-text")
|
|
93
|
-
}, children)));
|
|
47
|
+
onClose && onClose(e);
|
|
48
|
+
} })
|
|
49
|
+
) : React__default.createElement("div", { className: classes, style: Object.assign(Object.assign({}, style), getStyle()), onClick: (e) => handleClick(e) }, children && React__default.createElement("span", { className: `${classPrefix}-text` }, children)));
|
|
94
50
|
};
|
|
95
51
|
Tag.defaultProps = defaultProps;
|
|
96
52
|
Tag.displayName = "NutTag";
|
package/dist/esm/TextArea.js
CHANGED
|
@@ -1,125 +1,80 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var _excluded = ["className", "value", "defaultValue", "showCount", "maxLength", "rows", "placeholder", "readOnly", "disabled", "autoSize", "style", "onChange", "onBlur", "onFocus"];
|
|
5
|
-
function ownKeys(e, r) {
|
|
6
|
-
var t = Object.keys(e);
|
|
7
|
-
if (Object.getOwnPropertySymbols) {
|
|
8
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
9
|
-
r && (o = o.filter(function(r2) {
|
|
10
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
11
|
-
})), t.push.apply(t, o);
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
}
|
|
15
|
-
function _objectSpread(e) {
|
|
16
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
17
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
18
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
19
|
-
_defineProperty(e, r2, t[r2]);
|
|
20
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
21
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return e;
|
|
25
|
-
}
|
|
1
|
+
import { _ as __rest } from "./tslib.es6.js";
|
|
26
2
|
import React__default, { useRef, useEffect } from "react";
|
|
27
3
|
import classNames from "classnames";
|
|
28
4
|
import { useConfig } from "./ConfigProvider.js";
|
|
29
5
|
import { C as ComponentDefaults } from "./typings.js";
|
|
30
6
|
import { u as usePropsValue } from "./use-props-value.js";
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
rows
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
autoSize: false
|
|
40
|
-
});
|
|
41
|
-
var TextArea = function TextArea2(props) {
|
|
42
|
-
var _useConfig = useConfig(), locale = _useConfig.locale;
|
|
43
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), className = _defaultProps$props.className, value = _defaultProps$props.value, defaultValue = _defaultProps$props.defaultValue, showCount = _defaultProps$props.showCount, maxLength = _defaultProps$props.maxLength, rows = _defaultProps$props.rows, placeholder = _defaultProps$props.placeholder, readOnly = _defaultProps$props.readOnly, disabled = _defaultProps$props.disabled, autoSize = _defaultProps$props.autoSize, style = _defaultProps$props.style, onChange = _defaultProps$props.onChange, onBlur = _defaultProps$props.onBlur, onFocus = _defaultProps$props.onFocus, rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
44
|
-
var classPrefix = "nut-textarea";
|
|
45
|
-
var textareaRef = useRef(null);
|
|
46
|
-
var compositionRef = useRef(false);
|
|
47
|
-
var format = function format2(value2) {
|
|
7
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { defaultValue: "", showCount: false, rows: 2, maxLength: 140, placeholder: "", readOnly: false, disabled: false, autoSize: false });
|
|
8
|
+
const TextArea = (props) => {
|
|
9
|
+
const { locale } = useConfig();
|
|
10
|
+
const _a = Object.assign(Object.assign({}, defaultProps), props), { className, value, defaultValue, showCount, maxLength, rows, placeholder, readOnly, disabled, autoSize, style, onChange, onBlur, onFocus } = _a, rest = __rest(_a, ["className", "value", "defaultValue", "showCount", "maxLength", "rows", "placeholder", "readOnly", "disabled", "autoSize", "style", "onChange", "onBlur", "onFocus"]);
|
|
11
|
+
const classPrefix = "nut-textarea";
|
|
12
|
+
const textareaRef = useRef(null);
|
|
13
|
+
const compositionRef = useRef(false);
|
|
14
|
+
const format = (value2) => {
|
|
48
15
|
if (maxLength !== -1 && value2.length > maxLength) {
|
|
49
16
|
return value2.substring(0, maxLength);
|
|
50
17
|
}
|
|
51
18
|
return value2;
|
|
52
19
|
};
|
|
53
|
-
|
|
20
|
+
const [inputValue, setInputValue] = usePropsValue({
|
|
54
21
|
value,
|
|
55
22
|
defaultValue,
|
|
56
23
|
finalValue: format(defaultValue),
|
|
57
24
|
onChange
|
|
58
|
-
})
|
|
59
|
-
useEffect(
|
|
25
|
+
});
|
|
26
|
+
useEffect(() => {
|
|
60
27
|
if (autoSize) {
|
|
61
28
|
setContentHeight();
|
|
62
29
|
}
|
|
63
30
|
}, [autoSize, defaultValue, inputValue]);
|
|
64
|
-
|
|
65
|
-
|
|
31
|
+
const setContentHeight = () => {
|
|
32
|
+
const textarea = textareaRef.current;
|
|
66
33
|
if (textarea) {
|
|
67
34
|
textarea.style.height = "auto";
|
|
68
|
-
|
|
35
|
+
const height = textarea === null || textarea === void 0 ? void 0 : textarea.scrollHeight;
|
|
69
36
|
if (height) {
|
|
70
|
-
textarea.style.height =
|
|
37
|
+
textarea.style.height = `${height}px`;
|
|
71
38
|
}
|
|
72
39
|
}
|
|
73
40
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
41
|
+
const handleChange = (event) => {
|
|
42
|
+
const text = event.target;
|
|
43
|
+
const value2 = compositionRef.current ? text.value : format(text.value);
|
|
77
44
|
setInputValue(value2);
|
|
78
45
|
};
|
|
79
|
-
|
|
46
|
+
const handleFocus = (event) => {
|
|
80
47
|
if (disabled)
|
|
81
48
|
return;
|
|
82
49
|
if (readOnly)
|
|
83
50
|
return;
|
|
84
51
|
onFocus && onFocus(event);
|
|
85
52
|
};
|
|
86
|
-
|
|
53
|
+
const handleBlur = (event) => {
|
|
87
54
|
if (disabled)
|
|
88
55
|
return;
|
|
89
56
|
if (readOnly)
|
|
90
57
|
return;
|
|
91
58
|
onBlur && onBlur(event);
|
|
92
59
|
};
|
|
93
|
-
return React__default.createElement(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
style,
|
|
99
|
-
disabled,
|
|
100
|
-
readOnly,
|
|
101
|
-
value: inputValue,
|
|
102
|
-
onChange: function onChange2(e) {
|
|
103
|
-
return handleChange(e);
|
|
104
|
-
},
|
|
105
|
-
onBlur: function onBlur2(e) {
|
|
106
|
-
return handleBlur(e);
|
|
107
|
-
},
|
|
108
|
-
onFocus: function onFocus2(e) {
|
|
109
|
-
return handleFocus(e);
|
|
110
|
-
},
|
|
111
|
-
onCompositionEnd: function onCompositionEnd() {
|
|
60
|
+
return React__default.createElement(
|
|
61
|
+
"div",
|
|
62
|
+
{ className: classNames(classPrefix, {
|
|
63
|
+
[`${classPrefix}-disabled`]: disabled
|
|
64
|
+
}, className) },
|
|
65
|
+
React__default.createElement("textarea", Object.assign({ ref: textareaRef, className: `${classPrefix}-textarea`, style, disabled, readOnly, value: inputValue, onChange: (e) => handleChange(e), onBlur: (e) => handleBlur(e), onFocus: (e) => handleFocus(e), onCompositionEnd: () => {
|
|
112
66
|
compositionRef.current = false;
|
|
113
|
-
},
|
|
114
|
-
onCompositionStart: function onCompositionStart() {
|
|
67
|
+
}, onCompositionStart: () => {
|
|
115
68
|
compositionRef.current = true;
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
69
|
+
}, rows, maxLength: maxLength === -1 ? void 0 : maxLength, placeholder: placeholder || locale.placeholder }, rest)),
|
|
70
|
+
showCount && React__default.createElement(
|
|
71
|
+
"div",
|
|
72
|
+
{ className: `${classPrefix}-limit` },
|
|
73
|
+
inputValue.length,
|
|
74
|
+
"/",
|
|
75
|
+
maxLength < 0 ? 0 : maxLength
|
|
76
|
+
)
|
|
77
|
+
);
|
|
123
78
|
};
|
|
124
79
|
TextArea.defaultProps = defaultProps;
|
|
125
80
|
TextArea.displayName = "NutTextArea";
|
package/dist/esm/TimeDetail.js
CHANGED
|
@@ -1,73 +1,35 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) {
|
|
3
|
-
var t = Object.keys(e);
|
|
4
|
-
if (Object.getOwnPropertySymbols) {
|
|
5
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
6
|
-
r && (o = o.filter(function(r2) {
|
|
7
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
8
|
-
})), t.push.apply(t, o);
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
}
|
|
12
|
-
function _objectSpread(e) {
|
|
13
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
14
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
15
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
16
|
-
_defineProperty(e, r2, t[r2]);
|
|
17
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
18
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return e;
|
|
22
|
-
}
|
|
23
1
|
import React__default, { useMemo, useCallback } from "react";
|
|
24
2
|
import classNames from "classnames";
|
|
25
3
|
import { C as ComponentDefaults } from "./typings.js";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), options = _defaultProps$props.options, optionKey = _defaultProps$props.optionKey, className = _defaultProps$props.className, activeDate = _defaultProps$props.activeDate, activeTime = _defaultProps$props.activeTime, onSelect2 = _defaultProps$props.onSelect;
|
|
40
|
-
var classPrefix = "nut-timedetail";
|
|
41
|
-
var timeList = useMemo(function() {
|
|
42
|
-
return (options === null || options === void 0 ? void 0 : options.find(function(item) {
|
|
43
|
-
return item[optionKey.valueKey] === activeDate;
|
|
44
|
-
})) || _defineProperty({}, optionKey.childrenKey, []);
|
|
4
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { activeDate: "", activeTime: [], options: [], optionKey: {
|
|
5
|
+
valueKey: "value",
|
|
6
|
+
textKey: "text",
|
|
7
|
+
childrenKey: "children"
|
|
8
|
+
}, onSelect: () => {
|
|
9
|
+
} });
|
|
10
|
+
const TimeDetail = (props) => {
|
|
11
|
+
const { options, optionKey, className, activeDate, activeTime, onSelect } = Object.assign(Object.assign({}, defaultProps), props);
|
|
12
|
+
const classPrefix = "nut-timedetail";
|
|
13
|
+
const timeList = useMemo(() => {
|
|
14
|
+
return (options === null || options === void 0 ? void 0 : options.find((item) => item[optionKey.valueKey] === activeDate)) || {
|
|
15
|
+
[optionKey.childrenKey]: []
|
|
16
|
+
};
|
|
45
17
|
}, [options, optionKey, activeDate]);
|
|
46
|
-
|
|
47
|
-
|
|
18
|
+
const isActive = useCallback((timeKey) => {
|
|
19
|
+
const date = activeTime.find((item) => {
|
|
48
20
|
return item[optionKey.valueKey] === activeDate;
|
|
49
21
|
});
|
|
50
|
-
if (date
|
|
51
|
-
|
|
22
|
+
if (date === null || date === void 0 ? void 0 : date[optionKey.childrenKey]) {
|
|
23
|
+
const time = date === null || date === void 0 ? void 0 : date[optionKey.childrenKey].find((time2) => {
|
|
52
24
|
return time2[optionKey.valueKey] === timeKey;
|
|
53
25
|
});
|
|
54
26
|
return time;
|
|
55
27
|
}
|
|
56
28
|
return false;
|
|
57
29
|
}, [activeTime, optionKey, activeDate]);
|
|
58
|
-
return React__default.createElement("div", {
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
return React__default.createElement("span", {
|
|
62
|
-
className: classNames("".concat(classPrefix, "-item"), {
|
|
63
|
-
active: isActive(item[optionKey.valueKey])
|
|
64
|
-
}),
|
|
65
|
-
key: item[optionKey.valueKey],
|
|
66
|
-
onClick: function onClick() {
|
|
67
|
-
return onSelect2(item);
|
|
68
|
-
}
|
|
69
|
-
}, item[optionKey.textKey]);
|
|
70
|
-
}));
|
|
30
|
+
return React__default.createElement("div", { className: classNames(classPrefix, className) }, timeList[optionKey.childrenKey].map((item) => React__default.createElement("span", { className: classNames(`${classPrefix}-item`, {
|
|
31
|
+
active: isActive(item[optionKey.valueKey])
|
|
32
|
+
}), key: item[optionKey.valueKey], onClick: () => onSelect(item) }, item[optionKey.textKey])));
|
|
71
33
|
};
|
|
72
34
|
TimeDetail.defaultProps = defaultProps;
|
|
73
35
|
TimeDetail.displayName = "NutTimeDetail";
|
package/dist/esm/TimeSelect.js
CHANGED
|
@@ -1,72 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
var _excluded = ["visible", "className", "style", "title", "defaultValue", "options", "optionKey", "multiple", "onSelect", "onDateChange", "onTimeChange"];
|
|
6
|
-
function ownKeys(e, r) {
|
|
7
|
-
var t = Object.keys(e);
|
|
8
|
-
if (Object.getOwnPropertySymbols) {
|
|
9
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
10
|
-
r && (o = o.filter(function(r2) {
|
|
11
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
12
|
-
})), t.push.apply(t, o);
|
|
13
|
-
}
|
|
14
|
-
return t;
|
|
15
|
-
}
|
|
16
|
-
function _objectSpread(e) {
|
|
17
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
18
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
19
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
20
|
-
_defineProperty(e, r2, t[r2]);
|
|
21
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
22
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return e;
|
|
26
|
-
}
|
|
1
|
+
import { _ as __rest } from "./tslib.es6.js";
|
|
27
2
|
import React__default, { useState } from "react";
|
|
28
3
|
import classNames from "classnames";
|
|
29
4
|
import Popup from "./Popup.js";
|
|
30
5
|
import TimeDetail from "./TimeDetail.js";
|
|
31
6
|
import { C as ComponentDefaults } from "./typings.js";
|
|
32
7
|
import { useConfig } from "./ConfigProvider.js";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
44
|
-
var TimeSelect = function TimeSelect2(props) {
|
|
45
|
-
var _useConfig = useConfig(), locale = _useConfig.locale;
|
|
46
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), visible = _defaultProps$props.visible, className = _defaultProps$props.className, style = _defaultProps$props.style, title = _defaultProps$props.title, defaultValue = _defaultProps$props.defaultValue, options = _defaultProps$props.options, optionKey = _defaultProps$props.optionKey, multiple = _defaultProps$props.multiple, onSelect = _defaultProps$props.onSelect, onDateChange = _defaultProps$props.onDateChange, onTimeChange = _defaultProps$props.onTimeChange, rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
47
|
-
var _useState = useState(function() {
|
|
48
|
-
if (defaultValue !== null && defaultValue !== void 0 && defaultValue.length) {
|
|
8
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { visible: false, multiple: false, defaultValue: [], options: [], optionKey: {
|
|
9
|
+
valueKey: "value",
|
|
10
|
+
textKey: "text",
|
|
11
|
+
childrenKey: "children"
|
|
12
|
+
} });
|
|
13
|
+
const TimeSelect = (props) => {
|
|
14
|
+
const { locale } = useConfig();
|
|
15
|
+
const _a = Object.assign(Object.assign({}, defaultProps), props), { visible, className, style, title, defaultValue, options, optionKey, multiple, onSelect, onDateChange, onTimeChange } = _a, rest = __rest(_a, ["visible", "className", "style", "title", "defaultValue", "options", "optionKey", "multiple", "onSelect", "onDateChange", "onTimeChange"]);
|
|
16
|
+
const [activeDate, setActiveDate] = useState(() => {
|
|
17
|
+
if (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) {
|
|
49
18
|
return defaultValue[0][optionKey.valueKey];
|
|
50
19
|
}
|
|
51
|
-
if (options
|
|
20
|
+
if (options === null || options === void 0 ? void 0 : options.length) {
|
|
52
21
|
return options[0][optionKey.valueKey];
|
|
53
22
|
}
|
|
54
23
|
return "";
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var classPrefix = "nut-timeselect";
|
|
60
|
-
var closeFun = function closeFun2() {
|
|
24
|
+
});
|
|
25
|
+
const [activeTime, setActiveTime] = useState(() => defaultValue || []);
|
|
26
|
+
const classPrefix = "nut-timeselect";
|
|
27
|
+
const closeFun = () => {
|
|
61
28
|
onSelect && onSelect(activeTime);
|
|
62
29
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
30
|
+
const handleSelectTime = (selectTime) => {
|
|
31
|
+
let newActiveTime = [...activeTime];
|
|
32
|
+
const date = newActiveTime.find((item) => {
|
|
66
33
|
return item[optionKey.valueKey] === activeDate;
|
|
67
34
|
});
|
|
68
35
|
if (date) {
|
|
69
|
-
|
|
36
|
+
const timeIndex = date[optionKey.childrenKey].findIndex((time) => {
|
|
70
37
|
return time[optionKey.valueKey] === selectTime[optionKey.valueKey];
|
|
71
38
|
});
|
|
72
39
|
if (timeIndex > -1) {
|
|
@@ -76,60 +43,55 @@ var TimeSelect = function TimeSelect2(props) {
|
|
|
76
43
|
newActiveTime = [];
|
|
77
44
|
}
|
|
78
45
|
} else if (multiple) {
|
|
79
|
-
date[optionKey.childrenKey].push(
|
|
46
|
+
date[optionKey.childrenKey].push(Object.assign({}, selectTime));
|
|
80
47
|
} else {
|
|
81
|
-
newActiveTime = [
|
|
48
|
+
newActiveTime = [
|
|
49
|
+
{
|
|
50
|
+
[optionKey.valueKey]: activeDate,
|
|
51
|
+
[optionKey.childrenKey]: [Object.assign({}, selectTime)]
|
|
52
|
+
}
|
|
53
|
+
];
|
|
82
54
|
}
|
|
83
55
|
} else if (multiple) {
|
|
84
|
-
newActiveTime.push(
|
|
56
|
+
newActiveTime.push({
|
|
57
|
+
[optionKey.valueKey]: activeDate,
|
|
58
|
+
[optionKey.childrenKey]: [Object.assign({}, selectTime)]
|
|
59
|
+
});
|
|
85
60
|
} else {
|
|
86
|
-
newActiveTime = [
|
|
61
|
+
newActiveTime = [
|
|
62
|
+
{
|
|
63
|
+
[optionKey.valueKey]: activeDate,
|
|
64
|
+
[optionKey.childrenKey]: [Object.assign({}, selectTime)]
|
|
65
|
+
}
|
|
66
|
+
];
|
|
87
67
|
}
|
|
88
|
-
newActiveTime = newActiveTime.filter(
|
|
89
|
-
var
|
|
90
|
-
return ((
|
|
68
|
+
newActiveTime = newActiveTime.filter((item) => {
|
|
69
|
+
var _a2;
|
|
70
|
+
return ((_a2 = item[optionKey.childrenKey]) === null || _a2 === void 0 ? void 0 : _a2.length) > 0;
|
|
91
71
|
});
|
|
92
72
|
setActiveTime(newActiveTime);
|
|
93
73
|
onTimeChange && onTimeChange(selectTime, newActiveTime);
|
|
94
74
|
};
|
|
95
|
-
|
|
75
|
+
const handleChange = (date) => {
|
|
96
76
|
setActiveDate(date[optionKey.valueKey]);
|
|
97
77
|
onDateChange && onDateChange(date, activeTime);
|
|
98
78
|
};
|
|
99
|
-
return React__default.createElement(
|
|
100
|
-
|
|
101
|
-
round: true,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
className: "".concat(classPrefix, "-content-left")
|
|
116
|
-
}, options.map(function(item) {
|
|
117
|
-
return React__default.createElement("div", {
|
|
118
|
-
key: item[optionKey.valueKey],
|
|
119
|
-
className: classNames("nut-timepannel", {
|
|
120
|
-
active: item[optionKey.valueKey] === activeDate
|
|
121
|
-
}),
|
|
122
|
-
onClick: function onClick() {
|
|
123
|
-
return handleChange(item);
|
|
124
|
-
}
|
|
125
|
-
}, item[optionKey.textKey]);
|
|
126
|
-
})), React__default.createElement(TimeDetail, {
|
|
127
|
-
options,
|
|
128
|
-
optionKey,
|
|
129
|
-
activeDate,
|
|
130
|
-
activeTime,
|
|
131
|
-
onSelect: handleSelectTime
|
|
132
|
-
}))));
|
|
79
|
+
return React__default.createElement(
|
|
80
|
+
Popup,
|
|
81
|
+
Object.assign({ closeable: true, round: true, visible, position: "bottom", title: title || locale.timeselect.pickupTime, style: Object.assign({ width: "100%", height: "20%" }, style), onClose: closeFun }, rest),
|
|
82
|
+
React__default.createElement(
|
|
83
|
+
"div",
|
|
84
|
+
{ className: classNames(classPrefix, className) },
|
|
85
|
+
React__default.createElement(
|
|
86
|
+
"div",
|
|
87
|
+
{ className: `${classPrefix}-content` },
|
|
88
|
+
React__default.createElement("div", { className: `${classPrefix}-content-left` }, options.map((item) => React__default.createElement("div", { key: item[optionKey.valueKey], className: classNames("nut-timepannel", {
|
|
89
|
+
active: item[optionKey.valueKey] === activeDate
|
|
90
|
+
}), onClick: () => handleChange(item) }, item[optionKey.textKey]))),
|
|
91
|
+
React__default.createElement(TimeDetail, { options, optionKey, activeDate, activeTime, onSelect: handleSelectTime })
|
|
92
|
+
)
|
|
93
|
+
)
|
|
94
|
+
);
|
|
133
95
|
};
|
|
134
96
|
TimeSelect.defaultProps = defaultProps;
|
|
135
97
|
TimeSelect.displayName = "NutTimeSelect";
|