@nutui/nutui-react-taro 1.4.4 → 1.4.5
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 +15 -0
- package/dist/esm/Address.js +5 -5
- package/dist/esm/Audio.js +5 -5
- package/dist/esm/AvatarContext-7153ad2b.js +3 -1
- package/dist/esm/AvatarGroup.js +4 -4
- package/dist/esm/Calendar.js +5 -5
- package/dist/esm/CalendarItem.js +4 -4
- package/dist/esm/Card.js +4 -3
- package/dist/esm/Cell.js +2 -2
- package/dist/esm/ConfigProvider.js +3 -3
- package/dist/esm/CountDown.js +4 -4
- package/dist/esm/DatePicker.js +5 -5
- package/dist/esm/Dialog.js +4 -4
- package/dist/esm/Ellipsis.js +4 -4
- package/dist/esm/Empty.js +4 -4
- package/dist/esm/FixedNav.js +4 -4
- package/dist/esm/Form.js +4 -4
- package/dist/esm/FormItem.js +3 -3
- package/dist/esm/Grid.js +4 -4
- package/dist/esm/GridItem.js +4 -4
- package/dist/esm/Image.js +4 -4
- package/dist/esm/Infiniteloading.js +4 -4
- package/dist/esm/Input.js +4 -4
- package/dist/esm/MenuItem.js +4 -4
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/NumberKeyboard.js +4 -4
- package/dist/esm/Pagination.js +4 -4
- package/dist/esm/Picker.js +4 -4
- package/dist/esm/PullToRefresh.js +4 -4
- package/dist/esm/Range.js +4 -4
- package/dist/esm/SearchBar.js +4 -4
- package/dist/esm/ShortPassword.js +4 -4
- package/dist/esm/SideNavBar.js +4 -4
- package/dist/esm/Signature.js +4 -4
- package/dist/esm/Sticky.js +4 -4
- package/dist/esm/Table.js +4 -4
- package/dist/esm/Tag.js +3 -2
- package/dist/esm/TextArea.js +4 -4
- package/dist/esm/TimeDetail.js +4 -4
- package/dist/esm/TimePannel.js +4 -4
- package/dist/esm/TimeSelect.js +6 -6
- package/dist/esm/Uploader.js +4 -4
- package/dist/esm/UserContext-68f62e66.js +3 -1
- package/dist/esm/UserContext-b4181162.js +3 -1
- package/dist/esm/UserContext-be8097d2.js +3 -1
- package/dist/esm/VirtualList.js +6 -4
- package/dist/esm/WaterMark.js +4 -4
- package/dist/esm/actionsheet.taro-a58d3d12.js +45 -83
- package/dist/esm/address.taro-79cc7c96.js +461 -0
- package/dist/esm/animate.taro-b0e83dd5.js +32 -46
- package/dist/esm/animatingnumbers.taro-6f40a2e9.js +93 -134
- package/dist/esm/audio.taro-4fadc583.js +161 -0
- package/dist/esm/avatar.taro-85ced995.js +93 -119
- package/dist/esm/avatargroup-1d900174.js +34 -0
- package/dist/esm/backtop.taro-99107c30.js +39 -62
- package/dist/esm/badge.taro-fe9171ec.js +40 -58
- package/dist/esm/barrage.taro-0e157b5e.js +61 -91
- package/dist/esm/bem-893ad28d.js +3 -6
- package/dist/esm/button.taro-4ce133b9.js +87 -98
- package/dist/esm/calendar.taro-4ed72058.js +38 -0
- package/dist/esm/calendaritem.taro-1ebe428d.js +571 -0
- package/dist/esm/card.taro-39055e82.js +32 -0
- package/dist/esm/cascader.taro-d8cb1c3e.js +397 -636
- package/dist/esm/cell.taro-9a04a92e.js +64 -0
- package/dist/esm/cellgroup.taro-e094471c.js +18 -27
- package/dist/esm/checkbox.taro-0bda9796.js +160 -232
- package/dist/esm/circleprogress.taro-47db537c.js +99 -120
- package/dist/esm/col.taro-b61c7cba.js +33 -50
- package/dist/esm/collapse.taro-af58206c.js +73 -86
- package/dist/esm/collapseitem-ce1849d2.js +75 -139
- package/dist/esm/configprovider-5eea4f5d.js +19 -0
- package/dist/esm/configprovider.taro-26882dd2.js +42 -0
- package/dist/esm/countdown.taro-9e40de9c.js +225 -0
- package/dist/esm/datepicker.taro-7220e495.js +270 -0
- package/dist/esm/dialog.taro-1c03960e.js +123 -0
- package/dist/esm/divider.taro-5236fe6a.js +27 -27
- package/dist/esm/drag.taro-82b6b27a.js +99 -138
- package/dist/esm/elevator.taro-d7d65470.js +185 -259
- package/dist/esm/ellipsis.taro-49b6db0c.js +232 -0
- package/dist/esm/empty.taro-7bd813f9.js +62 -0
- package/dist/esm/fixednav.taro-5ad15202.js +53 -0
- package/dist/esm/form.taro-71d32671.js +179 -0
- package/dist/esm/formitem.taro-3089489b.js +89 -0
- package/dist/esm/grid.taro-e6decfce.js +58 -0
- package/dist/esm/grid.taro.context-39636af9.js +4 -2
- package/dist/esm/griditem.taro-4cade72e.js +90 -0
- package/dist/esm/icon-8dc4de10.js +43 -51
- package/dist/esm/icon.taro-1d0d4fb7.js +43 -51
- package/dist/esm/image.taro-e6dc5867.js +64 -0
- package/dist/esm/imagepreview.taro-3400ea03.js +158 -205
- package/dist/esm/index.taro-a36f96fb.js +149 -210
- package/dist/esm/indicator.taro-183ea169.js +29 -43
- package/dist/esm/infiniteloading.taro-6c2a2e95.js +142 -0
- package/dist/esm/input.taro-fd566407.js +243 -0
- package/dist/esm/inputnumber.taro-dc39b853.js +129 -177
- package/dist/esm/layout.taro-358f014f.js +6 -9
- package/dist/esm/menu.taro-4abed328.js +89 -132
- package/dist/esm/menuitem.taro-6e8b27c3.js +130 -0
- package/dist/esm/navbar.taro-c931c078.js +69 -105
- package/dist/esm/noticebar.taro-69ea7673.js +450 -0
- package/dist/esm/notify.taro-308e5892.js +66 -97
- package/dist/esm/numberkeyboard.taro-194519e4.js +158 -0
- package/dist/esm/nutui-react.es.js +44 -44
- package/dist/esm/offsetContext-bfb02c25.js +3 -1
- package/dist/esm/overlay.taro-98367bc1.js +59 -74
- package/dist/esm/pagination.taro-bb490de9.js +124 -0
- package/dist/esm/picker.taro-2a8ded7c.js +420 -0
- package/dist/esm/popover.taro-46d813e8.js +132 -222
- package/dist/esm/popup.taro-cb777e09.js +125 -178
- package/dist/esm/price.taro-8801462e.js +75 -86
- package/dist/esm/progress.taro-623bc807.js +84 -118
- package/dist/esm/pulltorefresh.taro-cab7b51c.js +221 -0
- package/dist/esm/range.taro-5d6ff217.js +332 -0
- package/dist/esm/rate.taro-10197384.js +64 -111
- package/dist/esm/row.taro-37a895de.js +38 -42
- package/dist/esm/searchbar.taro-839dd622.js +148 -0
- package/dist/esm/shortpassword.taro-182d46f7.js +111 -0
- package/dist/esm/sidenavbar.taro-006cf38b.js +35 -0
- package/dist/esm/sidenavbaritem.taro-fee11d26.js +9 -22
- package/dist/esm/signature.taro-33632585.js +143 -0
- package/dist/esm/skeleton.taro-853ce460.js +51 -88
- package/dist/esm/step.taro-1c94e067.js +49 -78
- package/dist/esm/steps.taro-acf205a0.js +21 -30
- package/dist/esm/sticky.taro-d0553f48.js +13 -0
- package/dist/esm/subsidenavbar.taro-f46b4c73.js +58 -75
- package/dist/esm/swipe.taro-83bc248f.js +164 -254
- package/dist/esm/swiper.taro-852f6615.js +424 -505
- package/dist/esm/swiperitem-86a3578a.js +20 -28
- package/dist/esm/switch.taro-bae2dca0.js +43 -64
- package/dist/esm/tabbar.taro-86cece39.js +47 -57
- package/dist/esm/tabbaritem.taro-8dfb8055.js +51 -79
- package/dist/esm/table.taro-cb4dd2c3.js +92 -0
- package/dist/esm/tabpane.taro-91cd6cf4.js +17 -22
- package/dist/esm/tabs.taro-e71875fa.js +121 -165
- package/dist/esm/tag.taro-00fe554d.js +89 -0
- package/dist/esm/textarea.taro-42600f8c.js +74 -0
- package/dist/esm/timedetail.taro-c5f564fd.js +44 -0
- package/dist/esm/timepannel.taro-29f9dd86.js +22 -0
- package/dist/esm/timeselect.taro-3ecce65d.js +133 -0
- package/dist/esm/toast.taro-0804b6b4.js +99 -137
- package/dist/esm/trendarrow.taro-5a7153e4.js +63 -90
- package/dist/esm/types/src/packages/cell/cell.taro.d.ts +0 -1
- package/dist/esm/types/src/packages/noticebar/noticebar.d.ts +5 -4
- package/dist/esm/types/src/packages/noticebar/noticebar.taro.d.ts +5 -4
- package/dist/esm/types/src/packages/uploader/uploader.d.ts +1 -1
- package/dist/esm/types/src/packages/virtuallist/virtuallist.taro.d.ts +13 -2
- package/dist/esm/typings-1c5f2628.js +7 -6
- package/dist/esm/uploader.taro-f80d76d9.js +392 -0
- package/dist/esm/useClientRect-bf69d7b3.js +5 -25
- package/dist/esm/useTouch-a2ea68c6.js +63 -93
- package/dist/esm/video-8a3518c5.js +59 -83
- package/dist/esm/virtuallist.taro-e3345ced.js +215 -0
- package/dist/esm/watermark.taro-cd9db98a.js +114 -0
- package/dist/esm/zh-CN-dfc384d0.js +128 -133
- 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/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 +634 -5664
- package/dist/nutui.react.umd.js +634 -5664
- package/dist/packages/noticebar/noticebar.scss +17 -0
- package/dist/packages/radio/radio.scss +3 -1
- package/dist/packages/row/row.scss +2 -0
- package/dist/packages/searchbar/searchbar.scss +1 -1
- package/dist/packages/tag/tag.scss +13 -5
- package/dist/packages/virtuallist/virtuallist.scss +24 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/temp.scss +2340 -0
- package/dist/styles/theme-dark.scss +7 -0
- package/dist/styles/theme-default.scss +11 -0
- package/dist/styles/variables.scss +1945 -710
- package/dist/types/index.d.ts +16 -23
- package/package.json +9 -4
- package/dist/esm/address.taro-1e2aea24.js +0 -615
- package/dist/esm/audio.taro-fddcdfc0.js +0 -228
- package/dist/esm/avatargroup-f7f600ff.js +0 -42
- package/dist/esm/calendar.taro-72974415.js +0 -83
- package/dist/esm/calendaritem.taro-84e889eb.js +0 -580
- package/dist/esm/card.taro-a530dfb3.js +0 -61
- package/dist/esm/cell.taro-cf50c4f2.js +0 -109
- package/dist/esm/configprovider-c7d60e20.js +0 -18
- package/dist/esm/configprovider.taro-8bdb3a28.js +0 -50
- package/dist/esm/countdown.taro-d7dc8681.js +0 -246
- package/dist/esm/datepicker.taro-7199f521.js +0 -304
- package/dist/esm/dialog.taro-f54cfbf0.js +0 -187
- package/dist/esm/ellipsis.taro-c0de6ff4.js +0 -309
- package/dist/esm/empty.taro-dbc66496.js +0 -81
- package/dist/esm/fixednav.taro-9e759320.js +0 -97
- package/dist/esm/form.taro-880014b1.js +0 -181
- package/dist/esm/formitem.taro-3695f4a7.js +0 -136
- package/dist/esm/grid.taro-c2cc12d6.js +0 -81
- package/dist/esm/griditem.taro-892153cd.js +0 -122
- package/dist/esm/image.taro-c30973d5.js +0 -105
- package/dist/esm/infiniteloading.taro-b5ddf3cc.js +0 -188
- package/dist/esm/input.taro-104130c1.js +0 -361
- package/dist/esm/menuitem.taro-216e9f7d.js +0 -193
- package/dist/esm/noticebar.taro-94002898.js +0 -368
- package/dist/esm/numberkeyboard.taro-5e8f0ddf.js +0 -245
- package/dist/esm/pagination.taro-9925ffab.js +0 -169
- package/dist/esm/picker.taro-3b5cc054.js +0 -540
- package/dist/esm/pulltorefresh.taro-f26a20dd.js +0 -302
- package/dist/esm/range.taro-c41e9b90.js +0 -469
- package/dist/esm/searchbar.taro-01ed4ea4.js +0 -236
- package/dist/esm/shortpassword.taro-3a3bf412.js +0 -190
- package/dist/esm/sidenavbar.taro-06026f31.js +0 -66
- package/dist/esm/signature.taro-17648cac.js +0 -192
- package/dist/esm/sticky.taro-36013e97.js +0 -16
- package/dist/esm/table.taro-adda6622.js +0 -139
- package/dist/esm/tag.taro-bd900990.js +0 -104
- package/dist/esm/textarea.taro-83d5fe73.js +0 -102
- package/dist/esm/timedetail.taro-105f5380.js +0 -68
- package/dist/esm/timepannel.taro-c66c63dd.js +0 -30
- package/dist/esm/timeselect.taro-fc7ec6ee.js +0 -172
- package/dist/esm/uploader.taro-a1edf38f.js +0 -529
- package/dist/esm/virtuallist.taro-4add61c3.js +0 -315
- package/dist/esm/watermark.taro-323d1cf3.js +0 -132
|
@@ -1,88 +1,59 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
var _excluded = ["children", "title", "content", "activeIndex", "icon", "iconColor", "size", "className", "renderContent", "iconClassPrefix", "iconFontClassName"];
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
1
|
import React__default, { useContext } from 'react';
|
|
7
2
|
import classNames from 'classnames';
|
|
8
3
|
import { D as DataContext } from './UserContext-68f62e66.js';
|
|
9
4
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
5
|
import { I as Icon } from './icon.taro-1d0d4fb7.js';
|
|
11
6
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
title =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onClick: handleClickStep
|
|
61
|
-
}), React__default.createElement("div", {
|
|
62
|
-
className: "nut-step-head"
|
|
63
|
-
}, React__default.createElement("div", {
|
|
64
|
-
className: "nut-step-line"
|
|
65
|
-
}), React__default.createElement("div", {
|
|
66
|
-
className: renderIconClass()
|
|
67
|
-
}, icon ? React__default.createElement(Icon, {
|
|
68
|
-
classPrefix: iconClassPrefix,
|
|
69
|
-
fontClassName: iconFontClassName,
|
|
70
|
-
className: "nut-step-icon-inner",
|
|
71
|
-
color: iconColor,
|
|
72
|
-
name: icon,
|
|
73
|
-
size: size
|
|
74
|
-
}) : !dot && React__default.createElement("span", {
|
|
75
|
-
className: "nut-step-inner"
|
|
76
|
-
}, activeIndex))), React__default.createElement("div", {
|
|
77
|
-
className: "nut-step-main"
|
|
78
|
-
}, React__default.createElement("span", {
|
|
79
|
-
className: "nut-step-title"
|
|
80
|
-
}, title), content && React__default.createElement("span", {
|
|
81
|
-
className: "nut-step-content"
|
|
82
|
-
}, content), renderContent && React__default.createElement("span", {
|
|
83
|
-
className: "nut-step-content"
|
|
84
|
-
}, renderContent())));
|
|
7
|
+
|
|
8
|
+
const defaultProps = {
|
|
9
|
+
...ComponentDefaults,
|
|
10
|
+
title: '',
|
|
11
|
+
content: '',
|
|
12
|
+
activeIndex: 0,
|
|
13
|
+
icon: '',
|
|
14
|
+
iconColor: '',
|
|
15
|
+
size: '12px',
|
|
16
|
+
};
|
|
17
|
+
const Step = (props) => {
|
|
18
|
+
const { children, title, content, activeIndex, icon, iconColor, size, className, renderContent, iconClassPrefix, iconFontClassName, ...restProps } = {
|
|
19
|
+
...defaultProps,
|
|
20
|
+
...props,
|
|
21
|
+
};
|
|
22
|
+
const parent = useContext(DataContext);
|
|
23
|
+
const dot = parent.propSteps.progressDot;
|
|
24
|
+
const getCurrentStatus = () => {
|
|
25
|
+
const index = activeIndex;
|
|
26
|
+
if (index < +parent.propSteps.current)
|
|
27
|
+
return 'finish';
|
|
28
|
+
return index === +parent.propSteps.current ? 'process' : 'wait';
|
|
29
|
+
};
|
|
30
|
+
const handleClickStep = () => {
|
|
31
|
+
parent.propSteps?.onClickStep && parent.propSteps?.onClickStep(activeIndex);
|
|
32
|
+
parent.propSteps?.clickStep && parent.propSteps?.clickStep(activeIndex);
|
|
33
|
+
};
|
|
34
|
+
const b = cn('step');
|
|
35
|
+
const classes = classNames({
|
|
36
|
+
[`${b('')}-${getCurrentStatus()}`]: true,
|
|
37
|
+
}, className, b(''));
|
|
38
|
+
const renderIconClass = () => {
|
|
39
|
+
if (!dot && icon) {
|
|
40
|
+
return 'nut-step-icon is-icon';
|
|
41
|
+
}
|
|
42
|
+
if (!dot && !icon) {
|
|
43
|
+
return 'nut-step-icon is-text';
|
|
44
|
+
}
|
|
45
|
+
return 'nut-step-icon';
|
|
46
|
+
};
|
|
47
|
+
return (React__default.createElement("div", { className: classes, ...restProps, onClick: handleClickStep },
|
|
48
|
+
React__default.createElement("div", { className: "nut-step-head" },
|
|
49
|
+
React__default.createElement("div", { className: "nut-step-line" }),
|
|
50
|
+
React__default.createElement("div", { className: renderIconClass() }, icon ? (React__default.createElement(Icon, { classPrefix: iconClassPrefix, fontClassName: iconFontClassName, className: "nut-step-icon-inner", color: iconColor, name: icon, size: size })) : (!dot && React__default.createElement("span", { className: "nut-step-inner" }, activeIndex)))),
|
|
51
|
+
React__default.createElement("div", { className: "nut-step-main" },
|
|
52
|
+
React__default.createElement("span", { className: "nut-step-title" }, title),
|
|
53
|
+
content && React__default.createElement("span", { className: "nut-step-content" }, content),
|
|
54
|
+
renderContent && (React__default.createElement("span", { className: "nut-step-content" }, renderContent())))));
|
|
85
55
|
};
|
|
86
56
|
Step.defaultProps = defaultProps;
|
|
87
57
|
Step.displayName = 'NutStep';
|
|
58
|
+
|
|
88
59
|
export { Step as S };
|
|
@@ -1,39 +1,30 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
var _excluded = ["children", "current", "direction", "className", "progressDot", "clickStep", "onClickStep"];
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
1
|
import React__default from 'react';
|
|
7
2
|
import classNames from 'classnames';
|
|
8
3
|
import { D as DataContext } from './UserContext-68f62e66.js';
|
|
9
4
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
|
|
6
|
+
const defaultProps = {
|
|
7
|
+
current: 0,
|
|
8
|
+
direction: 'horizontal',
|
|
9
|
+
progressDot: false,
|
|
14
10
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var classes = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(b(''), "-").concat(direction), true), _defineProperty(_classNames, "".concat(b(''), "-dot"), !!props.progressDot), _classNames), className, b(''));
|
|
31
|
-
return React__default.createElement(DataContext.Provider, {
|
|
32
|
-
value: parentSteps
|
|
33
|
-
}, React__default.createElement('div', _objectSpread({
|
|
34
|
-
className: classes
|
|
35
|
-
}, restProps), children));
|
|
11
|
+
const Steps = (props) => {
|
|
12
|
+
const propSteps = { ...defaultProps, ...props };
|
|
13
|
+
const { children, current, direction, className, progressDot, clickStep, onClickStep, ...restProps } = propSteps;
|
|
14
|
+
const parentSteps = {
|
|
15
|
+
propSteps,
|
|
16
|
+
};
|
|
17
|
+
const b = cn('steps');
|
|
18
|
+
const classes = classNames({
|
|
19
|
+
[`${b('')}-${direction}`]: true,
|
|
20
|
+
[`${b('')}-dot`]: !!props.progressDot,
|
|
21
|
+
}, className, b(''));
|
|
22
|
+
return (React__default.createElement(DataContext.Provider, { value: parentSteps }, React__default.createElement('div', {
|
|
23
|
+
className: classes,
|
|
24
|
+
...restProps,
|
|
25
|
+
}, children)));
|
|
36
26
|
};
|
|
37
27
|
Steps.defaultProps = defaultProps;
|
|
38
28
|
Steps.displayName = 'NutSteps';
|
|
29
|
+
|
|
39
30
|
export { Steps as S };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { u as useConfig } from './configprovider-5eea4f5d.js';
|
|
3
|
+
|
|
4
|
+
const defaultProps = {};
|
|
5
|
+
const Sticky = (props) => {
|
|
6
|
+
useConfig();
|
|
7
|
+
({ ...defaultProps, ...props });
|
|
8
|
+
return React__default.createElement("div", { className: "nut-sticky" }, "Sticky");
|
|
9
|
+
};
|
|
10
|
+
Sticky.defaultProps = defaultProps;
|
|
11
|
+
Sticky.displayName = 'NutSticky';
|
|
12
|
+
|
|
13
|
+
export { Sticky as S };
|
|
@@ -1,80 +1,63 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["title", "ikey", "children", "onClick", "open"];
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
1
|
import React__default, { useState, useContext, useRef, useCallback, useEffect } from 'react';
|
|
8
2
|
import { O as OffsetContext } from './offsetContext-bfb02c25.js';
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
|
|
4
|
+
const defaultProps = {
|
|
5
|
+
open: true,
|
|
11
6
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var divClass = subShow ? 'nut-subsidenavbar__list nutShow' : 'nut-subsidenavbar__list nutHide';
|
|
67
|
-
var iconClass = subShow ? 'arrow-icon arrow-down' : 'arrow-icon arrow-up';
|
|
68
|
-
return React__default.createElement("div", _objectSpread({
|
|
69
|
-
className: divClass,
|
|
70
|
-
ref: listRef,
|
|
71
|
-
onClick: clickFn
|
|
72
|
-
}, rest), React__default.createElement("div", {
|
|
73
|
-
className: "nut-subsidenavbar__title border-bt"
|
|
74
|
-
}, title, " ", React__default.createElement("i", {
|
|
75
|
-
className: iconClass
|
|
76
|
-
})), React__default.createElement("div", {
|
|
77
|
-
className: "nut-subsidenavbar__content"
|
|
78
|
-
}, children));
|
|
7
|
+
const SubSideNavBar = (props) => {
|
|
8
|
+
const { title, ikey, children, onClick, open, ...rest } = {
|
|
9
|
+
...defaultProps,
|
|
10
|
+
...props,
|
|
11
|
+
};
|
|
12
|
+
const [subShow, setSubShow] = useState(open);
|
|
13
|
+
const offset = useContext(OffsetContext);
|
|
14
|
+
const listRef = useRef(null);
|
|
15
|
+
const setListLevel = useCallback((nodeList, level = 1) => {
|
|
16
|
+
const titleClass = nodeList[0].className;
|
|
17
|
+
if (titleClass.includes('nut-subsidenavbar__title')) {
|
|
18
|
+
const left = offset * (level + 1);
|
|
19
|
+
nodeList[0].style.paddingLeft = `${left}px`;
|
|
20
|
+
}
|
|
21
|
+
const childNodes = nodeList[1] &&
|
|
22
|
+
nodeList[1].children &&
|
|
23
|
+
Array.from(nodeList[1].children).filter((item) => item.nodeType !== 3 && item.nodeType !== 8);
|
|
24
|
+
childNodes.forEach((item) => {
|
|
25
|
+
const itemClass = item.className;
|
|
26
|
+
if (itemClass.includes('nut-subsidenavbar__item')) {
|
|
27
|
+
const left = offset * (level + 2);
|
|
28
|
+
item.style.paddingLeft = `${left}px`;
|
|
29
|
+
}
|
|
30
|
+
if (itemClass.includes('nut-subsidenavbar__list')) {
|
|
31
|
+
let level = item.getAttribute('level')
|
|
32
|
+
? Number(item.getAttribute('level'))
|
|
33
|
+
: 1;
|
|
34
|
+
level += 1;
|
|
35
|
+
item.setAttribute('level', level.toString());
|
|
36
|
+
item.children && setListLevel(item.children, level);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}, [offset]);
|
|
40
|
+
const clickFn = (e) => {
|
|
41
|
+
e.stopPropagation();
|
|
42
|
+
setSubShow(!subShow);
|
|
43
|
+
const isShow = !subShow;
|
|
44
|
+
onClick && onClick({ title, ikey, isShow });
|
|
45
|
+
};
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const childNodes = listRef.current?.children;
|
|
48
|
+
listRef.current?.setAttribute('level', '1');
|
|
49
|
+
childNodes && setListLevel(childNodes);
|
|
50
|
+
}, [setListLevel]);
|
|
51
|
+
const divClass = subShow
|
|
52
|
+
? 'nut-subsidenavbar__list nutShow'
|
|
53
|
+
: 'nut-subsidenavbar__list nutHide';
|
|
54
|
+
const iconClass = subShow ? 'arrow-icon arrow-down' : 'arrow-icon arrow-up';
|
|
55
|
+
return (React__default.createElement("div", { className: divClass, ref: listRef, onClick: clickFn, ...rest },
|
|
56
|
+
React__default.createElement("div", { className: "nut-subsidenavbar__title border-bt" },
|
|
57
|
+
title,
|
|
58
|
+
" ",
|
|
59
|
+
React__default.createElement("i", { className: iconClass })),
|
|
60
|
+
React__default.createElement("div", { className: "nut-subsidenavbar__content" }, children)));
|
|
79
61
|
};
|
|
62
|
+
|
|
80
63
|
export { SubSideNavBar as S };
|