@nutui/nutui-react 2.0.0-beta.1 → 2.0.0-beta.3
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 +22 -0
- package/dist/esm/ActionSheet.js +2 -2
- package/dist/esm/Avatar.js +2 -0
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Calendar.js +8 -6
- package/dist/esm/CalendarItem.js +288 -291
- package/dist/esm/Cell/style/index.js +1 -1
- package/dist/esm/Cell/style/style.css +1 -1
- package/dist/esm/Cell.js +2 -0
- package/dist/esm/CellGroup.js +47 -4
- package/dist/esm/ConfigProvider.js +6 -483
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Elevator.js +4 -4
- package/dist/esm/Form.js +1 -2
- package/dist/esm/Menu.js +6 -1
- package/dist/esm/MenuItem.js +8 -153
- package/dist/esm/NavBar.js +2 -2
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/NumberKeyboard.js +2 -2
- package/dist/esm/Popover.js +6 -7
- package/dist/esm/SearchBar.js +2 -2
- package/dist/esm/ShortPassword.js +4 -4
- package/dist/esm/Swiper.js +4 -1
- package/dist/esm/TrendArrow.js +11 -11
- package/dist/esm/Uploader.js +4 -4
- package/dist/esm/VirtualList.js +3 -8
- package/dist/esm/cascader2.js +2 -2
- package/dist/esm/configprovider2.js +486 -0
- package/dist/esm/date.js +103 -2
- package/dist/esm/menuitem2.js +156 -0
- package/dist/esm/nutui-react.es.js +30 -30
- package/dist/esm/popup2.js +5 -5
- package/dist/esm/types/src/packages/avatar/avatar.d.ts +4 -1
- package/dist/esm/types/src/packages/avatar/avatar.taro.d.ts +4 -1
- package/dist/esm/types/src/packages/calendar/calendar.d.ts +4 -6
- package/dist/esm/types/src/packages/calendar/calendar.taro.d.ts +4 -6
- package/dist/esm/types/src/packages/calendar/type.d.ts +13 -0
- package/dist/esm/types/src/packages/calendar/utils.d.ts +8 -0
- package/dist/esm/types/src/packages/calendaritem/calendaritem.d.ts +25 -27
- package/dist/esm/types/src/packages/calendaritem/calendaritem.taro.d.ts +26 -28
- package/dist/esm/types/src/packages/cell/cell.d.ts +4 -1
- package/dist/esm/types/src/packages/cell/cell.taro.d.ts +4 -1
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
- package/dist/esm/types/src/packages/elevator/elevator.d.ts +2 -2
- package/dist/esm/types/src/packages/elevator/elevator.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/menu/menu.d.ts +4 -1
- package/dist/esm/types/src/packages/menu/menu.taro.d.ts +4 -1
- package/dist/esm/types/src/packages/navbar/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/navbar/demo.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/navbar/navbar.d.ts +1 -1
- package/dist/esm/types/src/packages/navbar/navbar.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/noticebar/noticebar.d.ts +1 -1
- package/dist/esm/types/src/packages/noticebar/noticebar.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/nutui.react.build.d.ts +3 -3
- package/dist/esm/types/src/packages/nutui.react.d.ts +5 -5
- package/dist/esm/types/src/packages/nutui.react.scss.d.ts +2 -2
- package/dist/esm/types/src/packages/nutui.react.taro.d.ts +5 -5
- package/dist/esm/types/src/packages/nutui.react.taro.scss.d.ts +2 -2
- package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +3 -3
- package/dist/esm/types/src/packages/popover/popover.d.ts +2 -2
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/popup/popup.d.ts +2 -2
- package/dist/esm/types/src/packages/popup/popup.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/searchbar/searchbar.d.ts +1 -1
- package/dist/esm/types/src/packages/searchbar/searchbar.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/swiper/index.d.ts +8 -2
- package/dist/esm/types/src/packages/swiper/index.taro.d.ts +8 -2
- package/dist/esm/types/src/packages/trendarrow/trendarrow.d.ts +3 -3
- package/dist/esm/types/src/packages/trendarrow/trendarrow.taro.d.ts +3 -3
- package/dist/esm/types/src/packages/uploader/uploader.d.ts +1 -1
- package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/virtuallist/virtuallist.d.ts +2 -2
- package/dist/esm/types/src/packages/virtuallist/virtuallist.taro.d.ts +2 -2
- package/dist/esm/types/src/utils/date.d.ts +19 -3
- 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 +1104 -1011
- package/dist/nutui.react.umd.js +1104 -1011
- package/dist/packages/calendar/calendar.scss +4 -0
- package/dist/packages/cell/cell.scss +2 -0
- package/dist/packages/dialog/dialog.scss +1 -1
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +2 -2
- package/dist/styles/variables-jmapp.scss +2 -2
- package/dist/styles/variables.scss +2 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/packages/avatar/avatar.d.ts +4 -1
- package/dist/types/packages/calendar/calendar.d.ts +8 -6
- package/dist/types/packages/calendar/type.d.ts +13 -0
- package/dist/types/packages/calendar/utils.d.ts +8 -0
- package/dist/types/packages/calendaritem/calendaritem.d.ts +25 -27
- package/dist/types/packages/cell/cell.d.ts +4 -1
- package/dist/types/packages/configprovider/types.d.ts +1 -1
- package/dist/types/packages/elevator/elevator.d.ts +2 -2
- package/dist/types/packages/menu/menu.d.ts +4 -1
- package/dist/types/packages/navbar/navbar.d.ts +1 -1
- package/dist/types/packages/noticebar/noticebar.d.ts +1 -1
- package/dist/types/packages/popover/popover.d.ts +2 -2
- package/dist/types/packages/popup/popup.d.ts +2 -2
- package/dist/types/packages/searchbar/searchbar.d.ts +1 -1
- package/dist/types/packages/swiper/index.d.ts +8 -2
- package/dist/types/packages/trendarrow/trendarrow.d.ts +3 -3
- package/dist/types/packages/uploader/uploader.d.ts +1 -1
- package/dist/types/packages/virtuallist/utils.d.ts +1 -1
- package/dist/types/packages/virtuallist/virtuallist.d.ts +2 -2
- package/dist/types/utils/date.d.ts +19 -3
- package/package.json +1 -1
- package/dist/esm/cellgroup2.js +0 -50
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
function ownKeys(object, enumerableOnly) {
|
|
4
|
+
var keys = Object.keys(object);
|
|
5
|
+
if (Object.getOwnPropertySymbols) {
|
|
6
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
7
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
8
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
9
|
+
})), keys.push.apply(keys, symbols);
|
|
10
|
+
}
|
|
11
|
+
return keys;
|
|
12
|
+
}
|
|
13
|
+
function _objectSpread(target) {
|
|
14
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
16
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
17
|
+
_defineProperty(target, key, source[key]);
|
|
18
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
19
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return target;
|
|
23
|
+
}
|
|
24
|
+
import React__default, { forwardRef, useState, useEffect, useImperativeHandle, useRef } from "react";
|
|
25
|
+
import classNames from "classnames";
|
|
26
|
+
import { CSSTransition } from "react-transition-group";
|
|
27
|
+
import { Check } from "@nutui/icons-react";
|
|
28
|
+
import { O as Overlay } from "./overlay2.js";
|
|
29
|
+
import { u as useClickAway } from "./use-click-away.js";
|
|
30
|
+
import { C as ComponentDefaults } from "./typings.js";
|
|
31
|
+
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
32
|
+
columns: 1,
|
|
33
|
+
direction: "down",
|
|
34
|
+
icon: null,
|
|
35
|
+
activeTitleClass: "",
|
|
36
|
+
inactiveTitleClass: "",
|
|
37
|
+
onChange: function onChange(value) {
|
|
38
|
+
return void 0;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var MenuItem = forwardRef(function(props, ref) {
|
|
42
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), className = _defaultProps$props.className, style = _defaultProps$props.style, options = _defaultProps$props.options, value = _defaultProps$props.value, columns = _defaultProps$props.columns, title = _defaultProps$props.title, icon = _defaultProps$props.icon, direction = _defaultProps$props.direction, onChange2 = _defaultProps$props.onChange, activeTitleClass = _defaultProps$props.activeTitleClass, inactiveTitleClass = _defaultProps$props.inactiveTitleClass, closeOnClickAway = _defaultProps$props.closeOnClickAway, children = _defaultProps$props.children, activeColor = _defaultProps$props.activeColor, show = _defaultProps$props.show, parent = _defaultProps$props.parent, index = _defaultProps$props.index;
|
|
43
|
+
var _useState = useState(show), _useState2 = _slicedToArray(_useState, 2), _showPopup = _useState2[0], setShowPopup = _useState2[1];
|
|
44
|
+
var _useState3 = useState(value), _useState4 = _slicedToArray(_useState3, 2), _value = _useState4[0], setValue = _useState4[1];
|
|
45
|
+
useEffect(function() {
|
|
46
|
+
setShowPopup(show);
|
|
47
|
+
}, [show]);
|
|
48
|
+
useImperativeHandle(ref, function() {
|
|
49
|
+
return {
|
|
50
|
+
toggle: parent.toggleMenuItem
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
var getIconCName = function getIconCName2(optionVal, value2) {
|
|
54
|
+
var _classNames;
|
|
55
|
+
return classNames((_classNames = {}, _defineProperty(_classNames, activeTitleClass, optionVal === value2), _defineProperty(_classNames, inactiveTitleClass, optionVal !== value2), _classNames));
|
|
56
|
+
};
|
|
57
|
+
var setTitle = function setTitle2(text) {
|
|
58
|
+
if (!title) {
|
|
59
|
+
parent.updateTitle(text, index);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var handleClick = function handleClick2(item) {
|
|
63
|
+
parent.toggleMenuItem(index);
|
|
64
|
+
setTitle(item.text);
|
|
65
|
+
setValue(item.value);
|
|
66
|
+
onChange2 && onChange2(item);
|
|
67
|
+
};
|
|
68
|
+
var isShow = function isShow2() {
|
|
69
|
+
if (_showPopup)
|
|
70
|
+
return {};
|
|
71
|
+
return {
|
|
72
|
+
display: "none"
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
var getPosition = function getPosition2() {
|
|
76
|
+
return direction === "down" ? {
|
|
77
|
+
position: "absolute",
|
|
78
|
+
height: "".concat(window.innerHeight, "px")
|
|
79
|
+
} : {
|
|
80
|
+
position: "absolute",
|
|
81
|
+
bottom: "100%",
|
|
82
|
+
top: "auto",
|
|
83
|
+
height: "".concat(window.innerHeight, "px")
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
var micRef = useRef(null);
|
|
87
|
+
var targetSet = [micRef.current];
|
|
88
|
+
useClickAway(
|
|
89
|
+
function() {
|
|
90
|
+
parent.hideMenuItem(index);
|
|
91
|
+
},
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
targetSet,
|
|
95
|
+
"click",
|
|
96
|
+
false,
|
|
97
|
+
_showPopup,
|
|
98
|
+
closeOnClickAway
|
|
99
|
+
);
|
|
100
|
+
return React__default.createElement("div", {
|
|
101
|
+
className: "nut-menu-item-container",
|
|
102
|
+
ref: micRef,
|
|
103
|
+
style: {
|
|
104
|
+
position: "absolute",
|
|
105
|
+
left: 0,
|
|
106
|
+
right: 0
|
|
107
|
+
}
|
|
108
|
+
}, React__default.createElement(Overlay, {
|
|
109
|
+
className: "nut-menu__overlay",
|
|
110
|
+
style: getPosition(),
|
|
111
|
+
lockScroll: parent.lockScroll,
|
|
112
|
+
visible: _showPopup,
|
|
113
|
+
closeOnOverlayClick: parent.closeOnOverlayClick,
|
|
114
|
+
onClick: function onClick() {
|
|
115
|
+
parent.closeOnOverlayClick && parent.toggleMenuItem(index);
|
|
116
|
+
}
|
|
117
|
+
}), React__default.createElement("div", {
|
|
118
|
+
className: classNames(className, {
|
|
119
|
+
"nut-menu-item__wrap": direction === "down",
|
|
120
|
+
"nut-menu-item__wrap-up": direction !== "down"
|
|
121
|
+
}),
|
|
122
|
+
style: _objectSpread(_objectSpread({}, style), isShow())
|
|
123
|
+
}, React__default.createElement(CSSTransition, {
|
|
124
|
+
"in": _showPopup,
|
|
125
|
+
timeout: 100,
|
|
126
|
+
classNames: direction === "down" ? "menu-item" : "menu-item-up"
|
|
127
|
+
}, React__default.createElement("div", {
|
|
128
|
+
className: "nut-menu-item__content"
|
|
129
|
+
}, options === null || options === void 0 ? void 0 : options.map(function(item) {
|
|
130
|
+
return React__default.createElement("div", {
|
|
131
|
+
className: "nut-menu-item__option ".concat(classNames({
|
|
132
|
+
active: item.value === _value
|
|
133
|
+
})),
|
|
134
|
+
key: item.text,
|
|
135
|
+
style: {
|
|
136
|
+
flexBasis: "".concat(100 / columns, "%")
|
|
137
|
+
},
|
|
138
|
+
onClick: function onClick() {
|
|
139
|
+
handleClick(item);
|
|
140
|
+
}
|
|
141
|
+
}, item.value === _value ? React__default.createElement("i", null, icon || React__default.createElement(Check, {
|
|
142
|
+
color: activeColor,
|
|
143
|
+
className: getIconCName(item.value, value)
|
|
144
|
+
})) : null, React__default.createElement("div", {
|
|
145
|
+
className: getIconCName(item.value, value),
|
|
146
|
+
style: {
|
|
147
|
+
color: "".concat(item.value === _value ? activeColor : "")
|
|
148
|
+
}
|
|
149
|
+
}, item.text));
|
|
150
|
+
}), children))));
|
|
151
|
+
});
|
|
152
|
+
MenuItem.defaultProps = defaultProps;
|
|
153
|
+
MenuItem.displayName = "NutMenuItem";
|
|
154
|
+
export {
|
|
155
|
+
MenuItem as M
|
|
156
|
+
};
|
|
@@ -56,10 +56,10 @@ import { default as default56 } from "./InfiniteLoading.js";
|
|
|
56
56
|
import { default as default57 } from "./NoticeBar.js";
|
|
57
57
|
import { default as default58 } from "./Notify.js";
|
|
58
58
|
import { default as default59 } from "./Popover.js";
|
|
59
|
-
import { default as default60 } from "./
|
|
60
|
-
import { default as default61 } from "./
|
|
61
|
-
import { default as default62 } from "./
|
|
62
|
-
import { default as default63 } from "./
|
|
59
|
+
import { default as default60 } from "./Popup.js";
|
|
60
|
+
import { default as default61 } from "./PullToRefresh.js";
|
|
61
|
+
import { default as default62 } from "./Skeleton.js";
|
|
62
|
+
import { default as default63 } from "./Swipe.js";
|
|
63
63
|
import { default as default64 } from "./Toast.js";
|
|
64
64
|
import { default as default65 } from "./Animate.js";
|
|
65
65
|
import { default as default66 } from "./AnimatingNumbers.js";
|
|
@@ -73,17 +73,17 @@ import { default as default73 } from "./CountDown.js";
|
|
|
73
73
|
import { default as default74 } from "./Ellipsis.js";
|
|
74
74
|
import { default as default75 } from "./ImagePreview.js";
|
|
75
75
|
import { default as default76 } from "./Indicator.js";
|
|
76
|
-
import { default as default77 } from "./
|
|
77
|
-
import { default as default78 } from "./
|
|
78
|
-
import { default as default79 } from "./
|
|
79
|
-
import { default as default80 } from "./
|
|
80
|
-
import { default as default81 } from "./
|
|
81
|
-
import { default as default82 } from "./
|
|
82
|
-
import { default as default83 } from "./
|
|
83
|
-
import { default as default84 } from "./
|
|
84
|
-
import { default as default85 } from "./
|
|
85
|
-
import { default as default86 } from "./
|
|
86
|
-
import { default as default87 } from "./
|
|
76
|
+
import { default as default77 } from "./Pagination.js";
|
|
77
|
+
import { default as default78 } from "./Price.js";
|
|
78
|
+
import { default as default79 } from "./Progress.js";
|
|
79
|
+
import { default as default80 } from "./Step.js";
|
|
80
|
+
import { default as default81 } from "./Steps.js";
|
|
81
|
+
import { default as default82 } from "./Swiper.js";
|
|
82
|
+
import { default as default83 } from "./SwiperItem.js";
|
|
83
|
+
import { default as default84 } from "./Table.js";
|
|
84
|
+
import { default as default85 } from "./Tag.js";
|
|
85
|
+
import { default as default86 } from "./Video.js";
|
|
86
|
+
import { default as default87 } from "./VirtualList.js";
|
|
87
87
|
import { default as default88 } from "./Barrage.js";
|
|
88
88
|
import { default as default89 } from "./Card.js";
|
|
89
89
|
import { default as default90 } from "./TimeDetail.js";
|
|
@@ -142,13 +142,13 @@ export {
|
|
|
142
142
|
default58 as Notify,
|
|
143
143
|
default39 as NumberKeyboard,
|
|
144
144
|
default7 as Overlay,
|
|
145
|
-
|
|
145
|
+
default77 as Pagination,
|
|
146
146
|
default40 as Picker,
|
|
147
147
|
default59 as Popover,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
default60 as Popup,
|
|
149
|
+
default78 as Price,
|
|
150
|
+
default79 as Progress,
|
|
151
|
+
default61 as PullToRefresh,
|
|
152
152
|
default41 as Radio,
|
|
153
153
|
default42 as RadioGroup,
|
|
154
154
|
default43 as Range,
|
|
@@ -159,28 +159,28 @@ export {
|
|
|
159
159
|
default19 as SideNavBar,
|
|
160
160
|
default20 as SideNavBarItem,
|
|
161
161
|
default47 as Signature,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
default62 as Skeleton,
|
|
163
|
+
default80 as Step,
|
|
164
|
+
default81 as Steps,
|
|
165
165
|
default14 as Sticky,
|
|
166
166
|
default21 as SubSideNavBar,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
default63 as Swipe,
|
|
168
|
+
default82 as Swiper,
|
|
169
|
+
default83 as SwiperItem,
|
|
170
170
|
default48 as Switch,
|
|
171
171
|
default24 as TabPane,
|
|
172
172
|
default22 as Tabbar,
|
|
173
173
|
default23 as TabbarItem,
|
|
174
|
-
|
|
174
|
+
default84 as Table,
|
|
175
175
|
default25 as Tabs,
|
|
176
|
-
|
|
176
|
+
default85 as Tag,
|
|
177
177
|
default49 as TextArea,
|
|
178
178
|
default90 as TimeDetail,
|
|
179
179
|
default91 as TimeSelect,
|
|
180
180
|
default64 as Toast,
|
|
181
181
|
default92 as TrendArrow,
|
|
182
182
|
default50 as Uploader,
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
default86 as Video,
|
|
184
|
+
default87 as VirtualList,
|
|
185
185
|
default93 as WaterMark
|
|
186
186
|
};
|
package/dist/esm/popup2.js
CHANGED
|
@@ -45,17 +45,17 @@ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
|
45
45
|
},
|
|
46
46
|
onClose: function onClose() {
|
|
47
47
|
},
|
|
48
|
-
|
|
48
|
+
onOverlayClick: function onOverlayClick(e) {
|
|
49
49
|
return true;
|
|
50
50
|
},
|
|
51
|
-
|
|
51
|
+
onCloseIconClick: function onCloseIconClick(e) {
|
|
52
52
|
return true;
|
|
53
53
|
}
|
|
54
54
|
}, defaultOverlayProps);
|
|
55
55
|
var _zIndex = 1e3;
|
|
56
56
|
var Popup = function Popup2(props) {
|
|
57
57
|
var _classNames, _classNames2;
|
|
58
|
-
var children = props.children, visible = props.visible, overlay = props.overlay, closeOnOverlayClick = props.closeOnOverlayClick, overlayStyle = props.overlayStyle, overlayClassName = props.overlayClassName, zIndex = props.zIndex, lockScroll = props.lockScroll, duration = props.duration, closeable = props.closeable, closeIconPosition = props.closeIconPosition, closeIcon = props.closeIcon, left = props.left, title = props.title, style = props.style, transition = props.transition, round = props.round, position = props.position, className = props.className, destroyOnClose = props.destroyOnClose, portal = props.portal, onOpen2 = props.onOpen, onClose2 = props.onClose,
|
|
58
|
+
var children = props.children, visible = props.visible, overlay = props.overlay, closeOnOverlayClick = props.closeOnOverlayClick, overlayStyle = props.overlayStyle, overlayClassName = props.overlayClassName, zIndex = props.zIndex, lockScroll = props.lockScroll, duration = props.duration, closeable = props.closeable, closeIconPosition = props.closeIconPosition, closeIcon = props.closeIcon, left = props.left, title = props.title, style = props.style, transition = props.transition, round = props.round, position = props.position, className = props.className, destroyOnClose = props.destroyOnClose, portal = props.portal, onOpen2 = props.onOpen, onClose2 = props.onClose, onOverlayClick2 = props.onOverlayClick, onCloseIconClick2 = props.onCloseIconClick, afterShow = props.afterShow, afterClose = props.afterClose, onClick = props.onClick;
|
|
59
59
|
var _useState = useState(zIndex || _zIndex), _useState2 = _slicedToArray(_useState, 2), index = _useState2[0], setIndex = _useState2[1];
|
|
60
60
|
var _useState3 = useState(visible), _useState4 = _slicedToArray(_useState3, 2), innerVisible = _useState4[0], setInnerVisible = _useState4[1];
|
|
61
61
|
var _useState5 = useState(true), _useState6 = _slicedToArray(_useState5, 2), showChildren = _useState6[0], setShowChildren = _useState6[1];
|
|
@@ -95,7 +95,7 @@ var Popup = function Popup2(props) {
|
|
|
95
95
|
var onHandleClickOverlay = function onHandleClickOverlay2(e) {
|
|
96
96
|
e.stopPropagation();
|
|
97
97
|
if (closeOnOverlayClick) {
|
|
98
|
-
var closed =
|
|
98
|
+
var closed = onOverlayClick2 && onOverlayClick2(e);
|
|
99
99
|
closed && close();
|
|
100
100
|
}
|
|
101
101
|
};
|
|
@@ -103,7 +103,7 @@ var Popup = function Popup2(props) {
|
|
|
103
103
|
onClick && onClick(e);
|
|
104
104
|
};
|
|
105
105
|
var onHandleClickCloseIcon = function onHandleClickCloseIcon2(e) {
|
|
106
|
-
var closed =
|
|
106
|
+
var closed = onCloseIconClick2 && onCloseIconClick2(e);
|
|
107
107
|
closed && close();
|
|
108
108
|
};
|
|
109
109
|
var onHandleOpened = function onHandleOpened2(e) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
2
|
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
import AvatarGroup from '@/packages/avatargroup';
|
|
3
4
|
export interface AvatarProps extends BasicComponent {
|
|
4
5
|
size: string;
|
|
5
6
|
icon: React.ReactNode;
|
|
@@ -13,4 +14,6 @@ export interface AvatarProps extends BasicComponent {
|
|
|
13
14
|
onError: () => void;
|
|
14
15
|
}
|
|
15
16
|
export type AvatarShape = 'round' | 'square';
|
|
16
|
-
export declare const Avatar: FunctionComponent<Partial<AvatarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'
|
|
17
|
+
export declare const Avatar: FunctionComponent<Partial<AvatarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>> & {
|
|
18
|
+
Group: typeof AvatarGroup;
|
|
19
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
2
|
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
import AvatarGroup from '@/packages/avatargroup/index.taro';
|
|
3
4
|
export interface AvatarProps extends BasicComponent {
|
|
4
5
|
size: string;
|
|
5
6
|
icon: React.ReactNode;
|
|
@@ -13,4 +14,6 @@ export interface AvatarProps extends BasicComponent {
|
|
|
13
14
|
onError: () => void;
|
|
14
15
|
}
|
|
15
16
|
export type AvatarShape = 'round' | 'square';
|
|
16
|
-
export declare const Avatar: FunctionComponent<Partial<AvatarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'
|
|
17
|
+
export declare const Avatar: FunctionComponent<Partial<AvatarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>> & {
|
|
18
|
+
Group: typeof AvatarGroup;
|
|
19
|
+
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Day, SelectedType } from './type';
|
|
2
3
|
type CalendarRef = {
|
|
3
4
|
scrollToDate: (date: string) => void;
|
|
4
5
|
};
|
|
5
|
-
interface Day {
|
|
6
|
-
day: string | number;
|
|
7
|
-
type: string;
|
|
8
|
-
}
|
|
9
6
|
export interface CalendarProps {
|
|
10
|
-
type?:
|
|
7
|
+
type?: SelectedType;
|
|
11
8
|
autoBackfill?: boolean;
|
|
12
9
|
popup?: boolean;
|
|
13
10
|
visible?: boolean;
|
|
@@ -22,13 +19,14 @@ export interface CalendarProps {
|
|
|
22
19
|
showTitle?: boolean;
|
|
23
20
|
showSubTitle?: boolean;
|
|
24
21
|
scrollAnimation?: boolean;
|
|
22
|
+
firstDayOfWeek: number;
|
|
25
23
|
renderHeaderButtons?: () => string | JSX.Element;
|
|
26
24
|
renderDay?: (date: Day) => string | JSX.Element;
|
|
27
25
|
renderDayTop?: (date: Day) => string | JSX.Element;
|
|
28
26
|
renderDayBottom?: (date: Day) => string | JSX.Element;
|
|
29
27
|
onClose?: () => void;
|
|
30
28
|
onConfirm?: (param: string) => void;
|
|
31
|
-
|
|
29
|
+
onDayClick?: (data: string) => void;
|
|
32
30
|
onPageChange?: (param: string) => void;
|
|
33
31
|
}
|
|
34
32
|
export declare const Calendar: React.ForwardRefExoticComponent<Partial<CalendarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, ""> & React.RefAttributes<CalendarRef>>;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Day, SelectedType } from './type';
|
|
2
3
|
type CalendarRef = {
|
|
3
4
|
scrollToDate: (date: string) => void;
|
|
4
5
|
};
|
|
5
|
-
interface Day {
|
|
6
|
-
day: string | number;
|
|
7
|
-
type: string;
|
|
8
|
-
}
|
|
9
6
|
export interface CalendarProps {
|
|
10
|
-
type?:
|
|
7
|
+
type?: SelectedType;
|
|
11
8
|
autoBackfill?: boolean;
|
|
12
9
|
popup?: boolean;
|
|
13
10
|
visible?: boolean;
|
|
@@ -22,13 +19,14 @@ export interface CalendarProps {
|
|
|
22
19
|
showTitle?: boolean;
|
|
23
20
|
showSubTitle?: boolean;
|
|
24
21
|
scrollAnimation?: boolean;
|
|
22
|
+
firstDayOfWeek: number;
|
|
25
23
|
renderHeaderButtons?: () => string | JSX.Element;
|
|
26
24
|
renderDay?: (date: Day) => string | JSX.Element;
|
|
27
25
|
renderDayTop?: (date: Day) => string | JSX.Element;
|
|
28
26
|
renderDayBottom?: (date: Day) => string | JSX.Element;
|
|
29
27
|
onClose?: () => void;
|
|
30
28
|
onConfirm?: (param: string) => void;
|
|
31
|
-
|
|
29
|
+
onDayClick?: (data: string) => void;
|
|
32
30
|
onPageChange?: (param: string) => void;
|
|
33
31
|
}
|
|
34
32
|
export declare const Calendar: React.ForwardRefExoticComponent<Partial<CalendarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, ""> & React.RefAttributes<CalendarRef>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Day {
|
|
2
|
+
day: string | number;
|
|
3
|
+
type: string;
|
|
4
|
+
}
|
|
5
|
+
export interface MonthInfo {
|
|
6
|
+
curData: string[] | string;
|
|
7
|
+
title: string;
|
|
8
|
+
monthData: Day[];
|
|
9
|
+
cssHeight?: number;
|
|
10
|
+
scrollTop?: number;
|
|
11
|
+
}
|
|
12
|
+
export type InputDate = string | string[];
|
|
13
|
+
export type SelectedType = 'single' | 'range' | 'multiple' | 'week';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Day, MonthInfo } from './type';
|
|
2
|
+
export declare const splitDate: (date: string) => string[];
|
|
3
|
+
export declare const isMultiple: (day: string, days: string[]) => boolean;
|
|
4
|
+
export declare const isCurrDay: (month: MonthInfo, day: string | number) => boolean;
|
|
5
|
+
export declare const getCurrDate: (day: Day, month: MonthInfo) => string;
|
|
6
|
+
export declare const isStart: (day: string, days: string[]) => boolean;
|
|
7
|
+
export declare const isEnd: (day: string, days: string[]) => boolean;
|
|
8
|
+
export declare const isStartAndEnd: (days: string[]) => boolean;
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { PopupProps } from '@/packages/popup/index';
|
|
3
|
+
import { Day, InputDate, SelectedType } from '../calendar/type';
|
|
2
4
|
type CalendarRef = {
|
|
3
5
|
scrollToDate: (date: string) => void;
|
|
4
6
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export interface CalendarItemProps {
|
|
11
|
-
type?: string;
|
|
12
|
-
autoBackfill?: boolean;
|
|
13
|
-
popup?: boolean;
|
|
14
|
-
title?: string;
|
|
7
|
+
export interface CalendarItemProps extends PopupProps {
|
|
8
|
+
type: SelectedType;
|
|
9
|
+
autoBackfill: boolean;
|
|
10
|
+
popup: boolean;
|
|
11
|
+
title: string;
|
|
15
12
|
value?: InputDate;
|
|
16
13
|
defaultValue?: InputDate;
|
|
17
|
-
startDate
|
|
18
|
-
endDate
|
|
19
|
-
showToday
|
|
20
|
-
startText
|
|
21
|
-
endText
|
|
22
|
-
confirmText
|
|
23
|
-
showTitle
|
|
24
|
-
showSubTitle
|
|
25
|
-
scrollAnimation
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
startDate: InputDate;
|
|
15
|
+
endDate: InputDate;
|
|
16
|
+
showToday: boolean;
|
|
17
|
+
startText: ReactNode;
|
|
18
|
+
endText: ReactNode;
|
|
19
|
+
confirmText: ReactNode;
|
|
20
|
+
showTitle: boolean;
|
|
21
|
+
showSubTitle: boolean;
|
|
22
|
+
scrollAnimation: boolean;
|
|
23
|
+
firstDayOfWeek: number;
|
|
24
|
+
renderHeaderButtons: () => string | JSX.Element;
|
|
25
|
+
renderDay: (date: Day) => string | JSX.Element;
|
|
26
|
+
renderDayTop: (date: Day) => string | JSX.Element;
|
|
27
|
+
renderDayBottom: (date: Day) => string | JSX.Element;
|
|
28
|
+
onConfirm: (data: string) => void;
|
|
29
|
+
onUpdate: () => void;
|
|
30
|
+
onDayClick: (data: string) => void;
|
|
31
|
+
onPageChange: (data: any) => void;
|
|
34
32
|
}
|
|
35
33
|
export declare const CalendarItem: React.ForwardRefExoticComponent<Partial<CalendarItemProps> & Omit<React.HTMLAttributes<HTMLDivElement>, ""> & React.RefAttributes<CalendarRef>>;
|
|
36
34
|
export {};
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { PopupProps } from '@/packages/popup/index.taro';
|
|
3
|
+
import { Day, InputDate, SelectedType } from '../calendar/type';
|
|
2
4
|
type CalendarRef = {
|
|
3
5
|
scrollToDate: (date: string) => void;
|
|
4
6
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export interface CalendarItemProps {
|
|
11
|
-
type?: string;
|
|
12
|
-
autoBackfill?: boolean;
|
|
13
|
-
popup?: boolean;
|
|
14
|
-
title?: string;
|
|
7
|
+
export interface CalendarItemProps extends PopupProps {
|
|
8
|
+
type: SelectedType;
|
|
9
|
+
autoBackfill: boolean;
|
|
10
|
+
popup: boolean;
|
|
11
|
+
title: string;
|
|
15
12
|
value?: InputDate;
|
|
16
13
|
defaultValue?: InputDate;
|
|
17
|
-
startDate
|
|
18
|
-
endDate
|
|
19
|
-
showToday
|
|
20
|
-
startText
|
|
21
|
-
endText
|
|
22
|
-
confirmText
|
|
23
|
-
showTitle
|
|
24
|
-
showSubTitle
|
|
25
|
-
scrollAnimation
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
startDate: InputDate;
|
|
15
|
+
endDate: InputDate;
|
|
16
|
+
showToday: boolean;
|
|
17
|
+
startText: ReactNode;
|
|
18
|
+
endText: ReactNode;
|
|
19
|
+
confirmText: ReactNode;
|
|
20
|
+
showTitle: boolean;
|
|
21
|
+
showSubTitle: boolean;
|
|
22
|
+
scrollAnimation: boolean;
|
|
23
|
+
firstDayOfWeek: number;
|
|
24
|
+
renderHeaderButtons: () => string | JSX.Element;
|
|
25
|
+
renderDay: (date: Day) => string | JSX.Element;
|
|
26
|
+
renderDayTop: (date: Day) => string | JSX.Element;
|
|
27
|
+
renderDayBottom: (date: Day) => string | JSX.Element;
|
|
28
|
+
onConfirm: (data: string) => void;
|
|
29
|
+
onUpdate: () => void;
|
|
30
|
+
onDayClick: (data: string) => void;
|
|
31
|
+
onPageChange: (data: any) => void;
|
|
34
32
|
}
|
|
35
|
-
export declare const CalendarItem: React.ForwardRefExoticComponent<Partial<CalendarItemProps> & Omit<React.HTMLAttributes<HTMLDivElement>, ""> & React.RefAttributes<CalendarRef>>;
|
|
33
|
+
export declare const CalendarItem: React.ForwardRefExoticComponent<Partial<CalendarItemProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onClick"> & React.RefAttributes<CalendarRef>>;
|
|
36
34
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FunctionComponent, ReactNode } from 'react';
|
|
2
2
|
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
import CellGroup from '@/packages/cellgroup';
|
|
3
4
|
export interface CellProps extends BasicComponent {
|
|
4
5
|
title: ReactNode;
|
|
5
6
|
description: ReactNode;
|
|
@@ -8,4 +9,6 @@ export interface CellProps extends BasicComponent {
|
|
|
8
9
|
align: string;
|
|
9
10
|
onClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
10
11
|
}
|
|
11
|
-
export declare const Cell: FunctionComponent<Partial<CellProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'
|
|
12
|
+
export declare const Cell: FunctionComponent<Partial<CellProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>> & {
|
|
13
|
+
Group: typeof CellGroup;
|
|
14
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FunctionComponent, ReactNode } from 'react';
|
|
2
2
|
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
import { CellGroup } from '@/packages/cellgroup/cellgroup.taro';
|
|
3
4
|
export interface CellProps extends BasicComponent {
|
|
4
5
|
title: ReactNode;
|
|
5
6
|
description: ReactNode;
|
|
@@ -8,4 +9,6 @@ export interface CellProps extends BasicComponent {
|
|
|
8
9
|
align: string;
|
|
9
10
|
onClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
10
11
|
}
|
|
11
|
-
export declare const Cell: FunctionComponent<Partial<CellProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'
|
|
12
|
+
export declare const Cell: FunctionComponent<Partial<CellProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>> & {
|
|
13
|
+
Group: typeof CellGroup;
|
|
14
|
+
};
|