@nutui/nutui-react-taro 2.0.22 → 2.0.23-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/ActionSheet.js +6 -3
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Address.js +7 -5
- package/dist/esm/Audio.js +3 -3
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Calendar.js +7 -4
- package/dist/esm/CalendarCard/style/css.js +1 -0
- package/dist/esm/CalendarCard/style/index.js +2 -0
- package/dist/esm/CalendarCard/style/style.css +1 -0
- package/dist/esm/CalendarCard.js +11 -0
- package/dist/esm/CalendarItem.js +2 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/Cascader.js +6 -4
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/DatePicker.js +6 -6
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Dialog.js +4 -2
- package/dist/esm/FixedNav/style/style.css +1 -1
- package/dist/esm/FixedNav.js +5 -2
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/ImagePreview.js +5 -3
- package/dist/esm/Menu/style/style.css +1 -1
- package/dist/esm/Menu.js +5 -3
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/MenuItem.js +4 -2
- package/dist/esm/NoticeBar/style/style.css +1 -1
- package/dist/esm/NoticeBar.js +1 -1
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/NumberKeyboard.js +6 -3
- package/dist/esm/Overlay/style/style.css +1 -1
- package/dist/esm/Overlay.js +4 -1
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Picker.js +5 -5
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popover.js +5 -3
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/Popup.js +5 -2
- package/dist/esm/PullToRefresh.js +2 -2
- package/dist/esm/Range.js +2 -2
- package/dist/esm/SearchBar.js +1 -1
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/ShortPassword.js +6 -3
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/SideNavBar.js +6 -3
- package/dist/esm/Sticky.js +2 -2
- package/dist/esm/Swipe.js +2 -2
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/TimeSelect.js +6 -3
- package/dist/esm/Toast.js +5 -3
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/Tour.js +6 -4
- package/dist/esm/{actionsheet.taro-4ce9962a.js → actionsheet.taro-c3556cf1.js} +1 -1
- package/dist/esm/{address.taro-4295c3b3.js → address.taro-315e935e.js} +2 -2
- package/dist/esm/{audio.taro-abacd130.js → audio.taro-c98ee643.js} +1 -1
- package/dist/esm/{calendar.taro-802f92e1.js → calendar.taro-7c342305.js} +3 -2
- package/dist/esm/calendarcard.taro-cef184a2.js +400 -0
- package/dist/esm/{calendaritem.taro-f1995224.js → calendaritem.taro-da659861.js} +4 -218
- package/dist/esm/{cascader.taro-9070043a.js → cascader.taro-fe8472ca.js} +1 -1
- package/dist/esm/date-04589b69.js +222 -0
- package/dist/esm/{datepicker.taro-59c99fd7.js → datepicker.taro-5d8f0e45.js} +3 -3
- package/dist/esm/{dialog.taro-eb61fb7a.js → dialog.taro-2e0e7c57.js} +3 -2
- package/dist/esm/{fixednav.taro-0d998d65.js → fixednav.taro-bd96e277.js} +1 -1
- package/dist/esm/get-scroll-parent-3d880563.js +25 -0
- package/dist/esm/{imagepreview.taro-8bbafaa4.js → imagepreview.taro-44db4eba.js} +1 -1
- package/dist/esm/{menu.taro-cad143e1.js → menu.taro-f3e49415.js} +1 -1
- package/dist/esm/{menuitem.taro-60e01217.js → menuitem.taro-0045e4a8.js} +1 -1
- package/dist/esm/{noticebar.taro-bc771bc9.js → noticebar.taro-11fe07b1.js} +7 -8
- package/dist/esm/{numberkeyboard.taro-ec8f8435.js → numberkeyboard.taro-7d5a8c83.js} +1 -1
- package/dist/esm/nutui-react.es.js +46 -43
- package/dist/esm/overlay.taro-ad4b4c8a.js +153 -0
- package/dist/esm/{picker.taro-11d54577.js → picker.taro-4cbe43f7.js} +24 -27
- package/dist/esm/{popover.taro-539d15e4.js → popover.taro-076ba3ac.js} +1 -1
- package/dist/esm/{popup.taro-3273aa87.js → popup.taro-6f68b86f.js} +7 -7
- package/dist/esm/{pulltorefresh.taro-f3ab76c2.js → pulltorefresh.taro-57993124.js} +2 -2
- package/dist/esm/{range.taro-021442f5.js → range.taro-5254c32d.js} +3 -3
- package/dist/esm/{searchbar.taro-7daf43fc.js → searchbar.taro-9729e815.js} +7 -6
- package/dist/esm/{shortpassword.taro-b01da5b3.js → shortpassword.taro-e29734ce.js} +1 -1
- package/dist/esm/{sidenavbar.taro-97230c40.js → sidenavbar.taro-f1b1b6f0.js} +1 -1
- package/dist/esm/{sticky.taro-2b9a5231.js → sticky.taro-bee7a130.js} +1 -21
- package/dist/esm/{swipe.taro-3d5c4b51.js → swipe.taro-20be8e8c.js} +11 -6
- package/dist/esm/{timeselect.taro-892ca807.js → timeselect.taro-58a9729d.js} +1 -1
- package/dist/esm/{toast.taro-3bdf6d67.js → toast.taro-d63f6e12.js} +1 -1
- package/dist/esm/{tour.taro-b38e06a5.js → tour.taro-2c596c1e.js} +1 -1
- package/dist/esm/types/src/packages/calendarcard/__tests__/calendarcard.spec.d.ts +1 -0
- package/dist/esm/types/src/packages/calendarcard/calendarcard.d.ts +24 -0
- package/dist/esm/types/src/packages/calendarcard/calendarcard.taro.d.ts +24 -0
- package/dist/esm/types/src/packages/calendarcard/demo.d.ts +3 -0
- package/dist/esm/types/src/packages/calendarcard/demo.taro.d.ts +3 -0
- package/dist/esm/types/src/packages/calendarcard/icon.d.ts +5 -0
- package/dist/esm/types/src/packages/calendarcard/icon.taro.d.ts +5 -0
- package/dist/esm/types/src/packages/calendarcard/index.d.ts +3 -0
- package/dist/esm/types/src/packages/calendarcard/index.taro.d.ts +3 -0
- package/dist/esm/types/src/packages/calendarcard/types.d.ts +11 -0
- package/dist/esm/types/src/packages/calendarcard/utils.d.ts +19 -0
- package/dist/esm/types/src/packages/datepicker/datepicker.d.ts +2 -1
- package/dist/esm/types/src/packages/datepicker/datepicker.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/nutui.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/nutui.react.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.react.scss.d.ts +1 -0
- package/dist/esm/types/src/packages/nutui.react.taro.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.react.taro.scss.d.ts +1 -0
- package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/picker/picker.d.ts +2 -0
- package/dist/esm/types/src/packages/picker/picker.taro.d.ts +2 -0
- package/dist/esm/types/src/utils/use-lock-scoll-taro.d.ts +2 -0
- package/dist/esm/types/src/utils/use-lock-scroll.d.ts +2 -0
- package/dist/esm/types/src/utils/use-touch.d.ts +8 -9
- package/dist/esm/use-touch-38cf73ae.js +61 -0
- 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 +787 -325
- package/dist/nutui.react.umd.js +786 -324
- package/dist/packages/calendarcard/calendarcard.scss +104 -0
- package/dist/packages/noticebar/noticebar.scss +1 -0
- package/dist/packages/overlay/overlay.scss +5 -0
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/packages/calendarcard/calendarcard.taro.d.ts +76 -0
- package/dist/types/packages/calendarcard/icon.taro.d.ts +5 -0
- package/dist/types/packages/calendarcard/index.taro.d.ts +3 -0
- package/dist/types/packages/calendarcard/types.d.ts +11 -0
- package/dist/types/packages/calendarcard/utils.d.ts +19 -0
- package/dist/types/packages/datepicker/datepicker.taro.d.ts +6 -1
- package/dist/types/packages/picker/picker.taro.d.ts +6 -0
- package/dist/types/utils/use-lock-scoll-taro.d.ts +1 -0
- package/dist/types/utils/use-lock-scroll.d.ts +2 -0
- package/dist/types/utils/use-touch.d.ts +8 -9
- package/package.json +1 -1
- package/dist/esm/can-use-dom-0e539bd3.js +0 -4
- package/dist/esm/overlay.taro-626840fc.js +0 -73
- package/dist/esm/types/src/packages/dialog/dialogwrap.taro.d.ts +0 -14
- package/dist/esm/use-touch-ff43512c.js +0 -69
- package/dist/types/packages/overlay/index.d.ts +0 -3
- package/dist/types/packages/overlay/overlay.d.ts +0 -14
- package/dist/types/packages/picker/index.d.ts +0 -4
- package/dist/types/packages/picker/picker.d.ts +0 -23
- package/dist/types/packages/picker/pickerpanel.d.ts +0 -15
- package/dist/types/packages/popup/index.d.ts +0 -3
- package/dist/types/packages/popup/popup.d.ts +0 -24
package/dist/nutui.react.umd.js
CHANGED
|
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8
8
|
return value;
|
|
9
9
|
};
|
|
10
10
|
/*!
|
|
11
|
-
* @nutui/nutui-react-taro v2.0.
|
|
11
|
+
* @nutui/nutui-react-taro v2.0.23 Fri Nov 03 2023 19:33:54 GMT+0800 (中国标准时间)
|
|
12
12
|
* (c) 2023 @jdf2e.
|
|
13
13
|
* Released under the MIT License.
|
|
14
14
|
*/
|
|
@@ -1929,7 +1929,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1929
1929
|
style: {}
|
|
1930
1930
|
};
|
|
1931
1931
|
const prefixCls$1 = "nut-button";
|
|
1932
|
-
const defaultProps$
|
|
1932
|
+
const defaultProps$1v = {
|
|
1933
1933
|
...ComponentDefaults,
|
|
1934
1934
|
color: "",
|
|
1935
1935
|
type: "default",
|
|
@@ -1961,7 +1961,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1961
1961
|
style,
|
|
1962
1962
|
...rest
|
|
1963
1963
|
} = {
|
|
1964
|
-
...defaultProps$
|
|
1964
|
+
...defaultProps$1v,
|
|
1965
1965
|
...props
|
|
1966
1966
|
};
|
|
1967
1967
|
const getStyle = React.useCallback(() => {
|
|
@@ -2020,7 +2020,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2020
2020
|
);
|
|
2021
2021
|
Button.displayName = "NutButton";
|
|
2022
2022
|
const CellGroupContext = React.createContext(null);
|
|
2023
|
-
const defaultProps$
|
|
2023
|
+
const defaultProps$1u = {
|
|
2024
2024
|
...ComponentDefaults,
|
|
2025
2025
|
title: "",
|
|
2026
2026
|
description: "",
|
|
@@ -2029,7 +2029,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2029
2029
|
const classPrefix$p = "nut-cell-group";
|
|
2030
2030
|
const CellGroup = (props) => {
|
|
2031
2031
|
const { children, className, style, title, description, divider, ...rest } = {
|
|
2032
|
-
...defaultProps$
|
|
2032
|
+
...defaultProps$1u,
|
|
2033
2033
|
...props
|
|
2034
2034
|
};
|
|
2035
2035
|
return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix$p, className), ...rest }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$p}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$p}__description` }, description) : null, /* @__PURE__ */ React.createElement(
|
|
@@ -2040,9 +2040,9 @@ var __publicField = (obj, key, value) => {
|
|
|
2040
2040
|
/* @__PURE__ */ React.createElement(CellGroupContext.Provider, { value: { divider } }, children)
|
|
2041
2041
|
));
|
|
2042
2042
|
};
|
|
2043
|
-
CellGroup.defaultProps = defaultProps$
|
|
2043
|
+
CellGroup.defaultProps = defaultProps$1u;
|
|
2044
2044
|
CellGroup.displayName = "NutCellGroup";
|
|
2045
|
-
const defaultProps$
|
|
2045
|
+
const defaultProps$1t = {
|
|
2046
2046
|
...ComponentDefaults,
|
|
2047
2047
|
title: null,
|
|
2048
2048
|
description: null,
|
|
@@ -2067,7 +2067,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2067
2067
|
style,
|
|
2068
2068
|
...rest
|
|
2069
2069
|
} = {
|
|
2070
|
-
...defaultProps$
|
|
2070
|
+
...defaultProps$1t,
|
|
2071
2071
|
...props
|
|
2072
2072
|
};
|
|
2073
2073
|
const handleClick = (event) => {
|
|
@@ -2100,7 +2100,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2100
2100
|
(ctx == null ? void 0 : ctx.divider) ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$o}__divider` }) : null
|
|
2101
2101
|
);
|
|
2102
2102
|
};
|
|
2103
|
-
Cell.defaultProps = defaultProps$
|
|
2103
|
+
Cell.defaultProps = defaultProps$1t;
|
|
2104
2104
|
Cell.displayName = "NutCell";
|
|
2105
2105
|
Cell.Group = CellGroup;
|
|
2106
2106
|
var INFINITY = 1 / 0;
|
|
@@ -3241,7 +3241,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3241
3241
|
const pxCheck = (value) => {
|
|
3242
3242
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
3243
3243
|
};
|
|
3244
|
-
const defaultProps$
|
|
3244
|
+
const defaultProps$1s = {
|
|
3245
3245
|
src: "",
|
|
3246
3246
|
error: true,
|
|
3247
3247
|
loading: true
|
|
@@ -3260,7 +3260,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3260
3260
|
onLoad,
|
|
3261
3261
|
onError,
|
|
3262
3262
|
...rest
|
|
3263
|
-
} = { ...defaultProps$
|
|
3263
|
+
} = { ...defaultProps$1s, ...props };
|
|
3264
3264
|
const [innerLoading, setInnerLoading] = React.useState(true);
|
|
3265
3265
|
const [isError, setIsError] = React.useState(false);
|
|
3266
3266
|
const handleLoad = (e) => {
|
|
@@ -3320,7 +3320,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3320
3320
|
}
|
|
3321
3321
|
), renderLoading(), renderErrorImg());
|
|
3322
3322
|
};
|
|
3323
|
-
Image$1.defaultProps = defaultProps$
|
|
3323
|
+
Image$1.defaultProps = defaultProps$1s;
|
|
3324
3324
|
Image$1.displayName = "NutImage";
|
|
3325
3325
|
function _extends$1() {
|
|
3326
3326
|
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
|
|
@@ -5063,6 +5063,178 @@ var __publicField = (obj, key, value) => {
|
|
|
5063
5063
|
onExited: propTypesExports.func
|
|
5064
5064
|
}) : {};
|
|
5065
5065
|
const CSSTransition$1 = CSSTransition;
|
|
5066
|
+
const MIN_DISTANCE = 10;
|
|
5067
|
+
function getDirection(x, y2) {
|
|
5068
|
+
if (x > y2 && x > MIN_DISTANCE) {
|
|
5069
|
+
return "horizontal";
|
|
5070
|
+
}
|
|
5071
|
+
if (y2 > x && y2 > MIN_DISTANCE) {
|
|
5072
|
+
return "vertical";
|
|
5073
|
+
}
|
|
5074
|
+
return "";
|
|
5075
|
+
}
|
|
5076
|
+
function useTouch() {
|
|
5077
|
+
const startX = React.useRef(0);
|
|
5078
|
+
const startY = React.useRef(0);
|
|
5079
|
+
const deltaX = React.useRef(0);
|
|
5080
|
+
const deltaY = React.useRef(0);
|
|
5081
|
+
const offsetX = React.useRef(0);
|
|
5082
|
+
const offsetY = React.useRef(0);
|
|
5083
|
+
const direction = React.useRef("");
|
|
5084
|
+
const isVertical = () => direction.current === "vertical";
|
|
5085
|
+
const isHorizontal = () => direction.current === "horizontal";
|
|
5086
|
+
const reset = () => {
|
|
5087
|
+
deltaX.current = 0;
|
|
5088
|
+
deltaY.current = 0;
|
|
5089
|
+
offsetX.current = 0;
|
|
5090
|
+
offsetY.current = 0;
|
|
5091
|
+
direction.current = "";
|
|
5092
|
+
};
|
|
5093
|
+
const start = (event) => {
|
|
5094
|
+
reset();
|
|
5095
|
+
startX.current = event.touches[0].clientX;
|
|
5096
|
+
startY.current = event.touches[0].clientY;
|
|
5097
|
+
};
|
|
5098
|
+
const move = (event) => {
|
|
5099
|
+
const touch = event.touches[0];
|
|
5100
|
+
deltaX.current = touch.clientX < 0 ? 0 : touch.clientX - startX.current;
|
|
5101
|
+
deltaY.current = touch.clientY - startY.current;
|
|
5102
|
+
offsetX.current = Math.abs(deltaX.current);
|
|
5103
|
+
offsetY.current = Math.abs(deltaY.current);
|
|
5104
|
+
if (!direction.current) {
|
|
5105
|
+
direction.current = getDirection(offsetX.current, offsetY.current);
|
|
5106
|
+
}
|
|
5107
|
+
};
|
|
5108
|
+
return {
|
|
5109
|
+
move,
|
|
5110
|
+
start,
|
|
5111
|
+
reset,
|
|
5112
|
+
startX,
|
|
5113
|
+
startY,
|
|
5114
|
+
deltaX,
|
|
5115
|
+
deltaY,
|
|
5116
|
+
offsetX,
|
|
5117
|
+
offsetY,
|
|
5118
|
+
direction,
|
|
5119
|
+
isVertical,
|
|
5120
|
+
isHorizontal
|
|
5121
|
+
};
|
|
5122
|
+
}
|
|
5123
|
+
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
5124
|
+
const defaultRoot = canUseDom ? window : void 0;
|
|
5125
|
+
const overflowStylePatterns = ["scroll", "auto", "overlay"];
|
|
5126
|
+
function isElement(node) {
|
|
5127
|
+
const ELEMENT_NODE_TYPE = 1;
|
|
5128
|
+
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
5129
|
+
}
|
|
5130
|
+
function getScrollParent(el, root2 = defaultRoot) {
|
|
5131
|
+
let node = el;
|
|
5132
|
+
while (node && node !== root2 && isElement(node)) {
|
|
5133
|
+
if (node === document.body) {
|
|
5134
|
+
return root2;
|
|
5135
|
+
}
|
|
5136
|
+
const { overflowY } = window.getComputedStyle(node);
|
|
5137
|
+
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
5138
|
+
return node;
|
|
5139
|
+
}
|
|
5140
|
+
node = node.parentNode;
|
|
5141
|
+
}
|
|
5142
|
+
return root2;
|
|
5143
|
+
}
|
|
5144
|
+
let passiveSupported = false;
|
|
5145
|
+
if (canUseDom) {
|
|
5146
|
+
try {
|
|
5147
|
+
const opts = Object.defineProperty({}, "passive", {
|
|
5148
|
+
get() {
|
|
5149
|
+
passiveSupported = true;
|
|
5150
|
+
}
|
|
5151
|
+
});
|
|
5152
|
+
window.addEventListener("test-passive-supported", null, opts);
|
|
5153
|
+
} catch (e) {
|
|
5154
|
+
console.log(e);
|
|
5155
|
+
}
|
|
5156
|
+
}
|
|
5157
|
+
let totalLockCount = 0;
|
|
5158
|
+
const BODY_LOCK_CLASS = "nut-overflow-hidden";
|
|
5159
|
+
function getScrollableElement(el) {
|
|
5160
|
+
let current = el == null ? void 0 : el.parentElement;
|
|
5161
|
+
while (current) {
|
|
5162
|
+
if (current.clientHeight < current.scrollHeight) {
|
|
5163
|
+
return current;
|
|
5164
|
+
}
|
|
5165
|
+
current = current.parentElement;
|
|
5166
|
+
}
|
|
5167
|
+
return null;
|
|
5168
|
+
}
|
|
5169
|
+
function useLockScroll(rootRef, shouldLock) {
|
|
5170
|
+
const touch = useTouch();
|
|
5171
|
+
const onTouchMove = (event) => {
|
|
5172
|
+
touch.move(event);
|
|
5173
|
+
const direction = touch.deltaY.current > 0 ? "10" : "01";
|
|
5174
|
+
const el = getScrollParent(
|
|
5175
|
+
event.target,
|
|
5176
|
+
rootRef.current
|
|
5177
|
+
);
|
|
5178
|
+
if (!el)
|
|
5179
|
+
return;
|
|
5180
|
+
if (shouldLock === "strict") {
|
|
5181
|
+
const scrollableParent = getScrollableElement(event.target);
|
|
5182
|
+
if (scrollableParent === document.body || scrollableParent === document.documentElement) {
|
|
5183
|
+
event.preventDefault();
|
|
5184
|
+
return;
|
|
5185
|
+
}
|
|
5186
|
+
}
|
|
5187
|
+
const { scrollHeight, offsetHeight, scrollTop } = el;
|
|
5188
|
+
let status = "11";
|
|
5189
|
+
if (scrollTop === 0) {
|
|
5190
|
+
status = offsetHeight >= scrollHeight ? "00" : "01";
|
|
5191
|
+
} else if (scrollTop + offsetHeight >= scrollHeight) {
|
|
5192
|
+
status = "10";
|
|
5193
|
+
}
|
|
5194
|
+
if (status !== "11" && touch.isVertical() && !(parseInt(status, 2) & parseInt(direction, 2))) {
|
|
5195
|
+
if (event.cancelable) {
|
|
5196
|
+
event.preventDefault();
|
|
5197
|
+
}
|
|
5198
|
+
}
|
|
5199
|
+
};
|
|
5200
|
+
const lock = () => {
|
|
5201
|
+
document.addEventListener("touchstart", touch.start);
|
|
5202
|
+
document.addEventListener(
|
|
5203
|
+
"touchmove",
|
|
5204
|
+
onTouchMove,
|
|
5205
|
+
passiveSupported ? { passive: false } : false
|
|
5206
|
+
);
|
|
5207
|
+
if (!totalLockCount) {
|
|
5208
|
+
document.body.classList.add(BODY_LOCK_CLASS);
|
|
5209
|
+
}
|
|
5210
|
+
totalLockCount++;
|
|
5211
|
+
};
|
|
5212
|
+
const unlock = () => {
|
|
5213
|
+
if (totalLockCount) {
|
|
5214
|
+
document.removeEventListener("touchstart", touch.start);
|
|
5215
|
+
document.removeEventListener("touchmove", onTouchMove);
|
|
5216
|
+
totalLockCount--;
|
|
5217
|
+
if (!totalLockCount) {
|
|
5218
|
+
document.body.classList.remove(BODY_LOCK_CLASS);
|
|
5219
|
+
}
|
|
5220
|
+
}
|
|
5221
|
+
};
|
|
5222
|
+
React.useEffect(() => {
|
|
5223
|
+
if (shouldLock) {
|
|
5224
|
+
lock();
|
|
5225
|
+
return () => {
|
|
5226
|
+
unlock();
|
|
5227
|
+
};
|
|
5228
|
+
}
|
|
5229
|
+
}, [shouldLock]);
|
|
5230
|
+
}
|
|
5231
|
+
const useLockScrollTaro = (shouldLock) => {
|
|
5232
|
+
const refObject = React.useRef(null);
|
|
5233
|
+
if (Taro.getEnv() === "WEB") {
|
|
5234
|
+
useLockScroll(refObject, shouldLock);
|
|
5235
|
+
}
|
|
5236
|
+
return refObject;
|
|
5237
|
+
};
|
|
5066
5238
|
const defaultOverlayProps = {
|
|
5067
5239
|
...ComponentDefaults,
|
|
5068
5240
|
zIndex: 1e3,
|
|
@@ -5093,30 +5265,18 @@ var __publicField = (obj, key, value) => {
|
|
|
5093
5265
|
};
|
|
5094
5266
|
const [innerVisible, setInnerVisible] = React.useState(visible);
|
|
5095
5267
|
const classPrefix2 = `nut-overlay`;
|
|
5268
|
+
const nodeRef = useLockScrollTaro(!!props.lockScroll && innerVisible);
|
|
5096
5269
|
React.useEffect(() => {
|
|
5097
5270
|
if (visible) {
|
|
5098
5271
|
setInnerVisible(true);
|
|
5099
5272
|
} else {
|
|
5100
5273
|
setInnerVisible(false);
|
|
5101
5274
|
}
|
|
5102
|
-
lock();
|
|
5103
5275
|
}, [visible]);
|
|
5104
|
-
React.useEffect(() => {
|
|
5105
|
-
return () => {
|
|
5106
|
-
document.body.classList.remove("nut-overflow-hidden");
|
|
5107
|
-
};
|
|
5108
|
-
}, []);
|
|
5109
5276
|
const classes = classNames(className, classPrefix2);
|
|
5110
5277
|
const styles = {
|
|
5111
5278
|
...style
|
|
5112
5279
|
};
|
|
5113
|
-
const lock = () => {
|
|
5114
|
-
if (lockScroll && visible) {
|
|
5115
|
-
document.body.classList.add("nut-overflow-hidden");
|
|
5116
|
-
} else {
|
|
5117
|
-
document.body.classList.remove("nut-overflow-hidden");
|
|
5118
|
-
}
|
|
5119
|
-
};
|
|
5120
5280
|
const handleClick = (e) => {
|
|
5121
5281
|
if (closeOnOverlayClick) {
|
|
5122
5282
|
onClick && onClick(e);
|
|
@@ -5131,6 +5291,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5131
5291
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
5132
5292
|
CSSTransition$1,
|
|
5133
5293
|
{
|
|
5294
|
+
nodeRef,
|
|
5134
5295
|
classNames: `${classPrefix2}-slide`,
|
|
5135
5296
|
unmountOnExit: true,
|
|
5136
5297
|
timeout: duration,
|
|
@@ -5141,6 +5302,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5141
5302
|
/* @__PURE__ */ React.createElement(
|
|
5142
5303
|
components.View,
|
|
5143
5304
|
{
|
|
5305
|
+
ref: nodeRef,
|
|
5144
5306
|
className: classes,
|
|
5145
5307
|
style: styles,
|
|
5146
5308
|
...rest,
|
|
@@ -5154,7 +5316,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5154
5316
|
Overlay.defaultProps = defaultOverlayProps;
|
|
5155
5317
|
Overlay.displayName = "NutOverlay";
|
|
5156
5318
|
const DataContext$1 = React.createContext({});
|
|
5157
|
-
const defaultProps$
|
|
5319
|
+
const defaultProps$1r = {
|
|
5158
5320
|
...ComponentDefaults,
|
|
5159
5321
|
span: "24",
|
|
5160
5322
|
offset: "0",
|
|
@@ -5162,7 +5324,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5162
5324
|
};
|
|
5163
5325
|
const Col = (props) => {
|
|
5164
5326
|
const { className, style, span, offset, children, onClick } = {
|
|
5165
|
-
...defaultProps$
|
|
5327
|
+
...defaultProps$1r,
|
|
5166
5328
|
...props
|
|
5167
5329
|
};
|
|
5168
5330
|
const [colName, setColName] = React.useState("");
|
|
@@ -5194,9 +5356,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5194
5356
|
children
|
|
5195
5357
|
);
|
|
5196
5358
|
};
|
|
5197
|
-
Col.defaultProps = defaultProps$
|
|
5359
|
+
Col.defaultProps = defaultProps$1r;
|
|
5198
5360
|
Col.displayName = "NutCol";
|
|
5199
|
-
const defaultProps$
|
|
5361
|
+
const defaultProps$1q = {
|
|
5200
5362
|
...ComponentDefaults,
|
|
5201
5363
|
contentPosition: "center",
|
|
5202
5364
|
direction: "horizontal"
|
|
@@ -5204,7 +5366,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5204
5366
|
const classPrefix$m = `nut-divider`;
|
|
5205
5367
|
const Divider = (props) => {
|
|
5206
5368
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
5207
|
-
...defaultProps$
|
|
5369
|
+
...defaultProps$1q,
|
|
5208
5370
|
...props
|
|
5209
5371
|
};
|
|
5210
5372
|
const classes = direction === "horizontal" ? classNames({
|
|
@@ -5219,14 +5381,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5219
5381
|
});
|
|
5220
5382
|
return /* @__PURE__ */ React.createElement("div", { className: `${classes} ${className || ""}`, style, ...rest }, children);
|
|
5221
5383
|
};
|
|
5222
|
-
Divider.defaultProps = defaultProps$
|
|
5384
|
+
Divider.defaultProps = defaultProps$1q;
|
|
5223
5385
|
Divider.displayName = "NutDivider";
|
|
5224
5386
|
const gridContext = {
|
|
5225
5387
|
onClick: (item, index) => {
|
|
5226
5388
|
}
|
|
5227
5389
|
};
|
|
5228
5390
|
const GridContext = React.createContext(gridContext);
|
|
5229
|
-
const defaultProps$
|
|
5391
|
+
const defaultProps$1p = {
|
|
5230
5392
|
text: "",
|
|
5231
5393
|
columns: 4,
|
|
5232
5394
|
gap: 0,
|
|
@@ -5252,7 +5414,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5252
5414
|
onClick,
|
|
5253
5415
|
...rest
|
|
5254
5416
|
} = {
|
|
5255
|
-
...defaultProps$
|
|
5417
|
+
...defaultProps$1p,
|
|
5256
5418
|
...props
|
|
5257
5419
|
};
|
|
5258
5420
|
const classPrefix2 = "nut-grid-item";
|
|
@@ -5310,9 +5472,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5310
5472
|
/* @__PURE__ */ React.createElement("div", { className: contentClass() }, children && /* @__PURE__ */ React.createElement(React.Fragment, null, children), text && /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__text` }, text))
|
|
5311
5473
|
);
|
|
5312
5474
|
};
|
|
5313
|
-
GridItem.defaultProps = defaultProps$
|
|
5475
|
+
GridItem.defaultProps = defaultProps$1p;
|
|
5314
5476
|
GridItem.displayName = "NutGridItem";
|
|
5315
|
-
const defaultProps$
|
|
5477
|
+
const defaultProps$1o = {
|
|
5316
5478
|
columns: 4,
|
|
5317
5479
|
gap: 0,
|
|
5318
5480
|
center: true,
|
|
@@ -5333,7 +5495,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5333
5495
|
className,
|
|
5334
5496
|
onClick,
|
|
5335
5497
|
...rest
|
|
5336
|
-
} = { ...defaultProps$
|
|
5498
|
+
} = { ...defaultProps$1o, ...props };
|
|
5337
5499
|
const childrenDom = React.Children.toArray(children);
|
|
5338
5500
|
const classPrefix2 = "nut-grid";
|
|
5339
5501
|
const rootClass = () => {
|
|
@@ -5363,18 +5525,18 @@ var __publicField = (obj, key, value) => {
|
|
|
5363
5525
|
});
|
|
5364
5526
|
})));
|
|
5365
5527
|
};
|
|
5366
|
-
Grid.defaultProps = defaultProps$
|
|
5528
|
+
Grid.defaultProps = defaultProps$1o;
|
|
5367
5529
|
Grid.displayName = "NutGrid";
|
|
5368
5530
|
Grid.Item = GridItem;
|
|
5369
|
-
const defaultProps$
|
|
5531
|
+
const defaultProps$1n = {};
|
|
5370
5532
|
const Layout = (props) => {
|
|
5371
|
-
({ ...defaultProps$
|
|
5533
|
+
({ ...defaultProps$1n, ...props });
|
|
5372
5534
|
return /* @__PURE__ */ React.createElement("div", { className: "nut-layout" }, "Layout");
|
|
5373
5535
|
};
|
|
5374
|
-
Layout.defaultProps = defaultProps$
|
|
5536
|
+
Layout.defaultProps = defaultProps$1n;
|
|
5375
5537
|
Layout.displayName = "NutLayout";
|
|
5376
5538
|
const classPrefix$l = "nut-row";
|
|
5377
|
-
const defaultProps$
|
|
5539
|
+
const defaultProps$1m = {
|
|
5378
5540
|
...ComponentDefaults,
|
|
5379
5541
|
type: "",
|
|
5380
5542
|
justify: "start",
|
|
@@ -5394,7 +5556,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5394
5556
|
gutter,
|
|
5395
5557
|
onClick
|
|
5396
5558
|
} = {
|
|
5397
|
-
...defaultProps$
|
|
5559
|
+
...defaultProps$1m,
|
|
5398
5560
|
...props
|
|
5399
5561
|
};
|
|
5400
5562
|
const getClass = (prefix, type22) => {
|
|
@@ -5426,15 +5588,15 @@ var __publicField = (obj, key, value) => {
|
|
|
5426
5588
|
children
|
|
5427
5589
|
));
|
|
5428
5590
|
};
|
|
5429
|
-
Row.defaultProps = defaultProps$
|
|
5591
|
+
Row.defaultProps = defaultProps$1m;
|
|
5430
5592
|
Row.displayName = "NutRow";
|
|
5431
5593
|
const prefixCls = "nut-space";
|
|
5432
|
-
const defaultProps$
|
|
5594
|
+
const defaultProps$1l = {
|
|
5433
5595
|
direction: "horizontal"
|
|
5434
5596
|
};
|
|
5435
5597
|
const Space = (props) => {
|
|
5436
5598
|
const { className, style, children, wrap, align, direction, justify } = {
|
|
5437
|
-
...defaultProps$
|
|
5599
|
+
...defaultProps$1l,
|
|
5438
5600
|
...props
|
|
5439
5601
|
};
|
|
5440
5602
|
const cls = classNames(
|
|
@@ -5449,7 +5611,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5449
5611
|
return child !== null && child !== void 0 && /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-item` }, child);
|
|
5450
5612
|
}));
|
|
5451
5613
|
};
|
|
5452
|
-
Space.defaultProps = defaultProps$
|
|
5614
|
+
Space.defaultProps = defaultProps$1l;
|
|
5453
5615
|
Space.displayName = "NutSpace";
|
|
5454
5616
|
function useWatch(dep, callback, config2 = { immediate: false }) {
|
|
5455
5617
|
const { immediate } = config2;
|
|
@@ -5527,28 +5689,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5527
5689
|
}
|
|
5528
5690
|
return Promise.resolve(makeRect(0, 0));
|
|
5529
5691
|
};
|
|
5530
|
-
const
|
|
5531
|
-
const defaultRoot = canUseDom ? window : void 0;
|
|
5532
|
-
const overflowStylePatterns = ["scroll", "auto", "overlay"];
|
|
5533
|
-
function isElement(node) {
|
|
5534
|
-
const ELEMENT_NODE_TYPE = 1;
|
|
5535
|
-
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
5536
|
-
}
|
|
5537
|
-
function getScrollParent(el, root2 = defaultRoot) {
|
|
5538
|
-
let node = el;
|
|
5539
|
-
while (node && node !== root2 && isElement(node)) {
|
|
5540
|
-
if (node === document.body) {
|
|
5541
|
-
return root2;
|
|
5542
|
-
}
|
|
5543
|
-
const { overflowY } = window.getComputedStyle(node);
|
|
5544
|
-
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
5545
|
-
return node;
|
|
5546
|
-
}
|
|
5547
|
-
node = node.parentNode;
|
|
5548
|
-
}
|
|
5549
|
-
return root2;
|
|
5550
|
-
}
|
|
5551
|
-
const defaultProps$1j = {
|
|
5692
|
+
const defaultProps$1k = {
|
|
5552
5693
|
...ComponentDefaults,
|
|
5553
5694
|
position: "top",
|
|
5554
5695
|
zIndex: 900
|
|
@@ -5565,7 +5706,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5565
5706
|
className,
|
|
5566
5707
|
onChange,
|
|
5567
5708
|
...rest
|
|
5568
|
-
} = { ...defaultProps$
|
|
5709
|
+
} = { ...defaultProps$1k, ...props };
|
|
5569
5710
|
const stickyRef = React.useRef(null);
|
|
5570
5711
|
const rootRef = React.useRef(null);
|
|
5571
5712
|
const [rootRect, setRootRect] = React.useState({});
|
|
@@ -5671,9 +5812,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5671
5812
|
)
|
|
5672
5813
|
);
|
|
5673
5814
|
};
|
|
5674
|
-
Sticky.defaultProps = defaultProps$
|
|
5815
|
+
Sticky.defaultProps = defaultProps$1k;
|
|
5675
5816
|
Sticky.displayName = "NutSticky";
|
|
5676
|
-
const defaultProps$
|
|
5817
|
+
const defaultProps$1j = {
|
|
5677
5818
|
...ComponentDefaults,
|
|
5678
5819
|
threshold: 200,
|
|
5679
5820
|
zIndex: 900,
|
|
@@ -5681,7 +5822,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5681
5822
|
};
|
|
5682
5823
|
const BackTop = (props) => {
|
|
5683
5824
|
const { children, threshold, zIndex, className, duration, style, onClick } = {
|
|
5684
|
-
...defaultProps$
|
|
5825
|
+
...defaultProps$1j,
|
|
5685
5826
|
...props
|
|
5686
5827
|
};
|
|
5687
5828
|
const classPrefix2 = "nut-backtop";
|
|
@@ -5719,10 +5860,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5719
5860
|
children || /* @__PURE__ */ React.createElement(a$2, { width: 19, height: 19, className: "nut-backtop-main" })
|
|
5720
5861
|
);
|
|
5721
5862
|
};
|
|
5722
|
-
BackTop.defaultProps = defaultProps$
|
|
5863
|
+
BackTop.defaultProps = defaultProps$1j;
|
|
5723
5864
|
BackTop.displayName = "NutBackTop";
|
|
5724
5865
|
const elevatorContext = React.createContext({});
|
|
5725
|
-
const defaultProps$
|
|
5866
|
+
const defaultProps$1i = {
|
|
5726
5867
|
...ComponentDefaults,
|
|
5727
5868
|
height: "200px",
|
|
5728
5869
|
floorKey: "title",
|
|
@@ -5749,7 +5890,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5749
5890
|
children,
|
|
5750
5891
|
...rest
|
|
5751
5892
|
} = {
|
|
5752
|
-
...defaultProps$
|
|
5893
|
+
...defaultProps$1i,
|
|
5753
5894
|
...props
|
|
5754
5895
|
};
|
|
5755
5896
|
const classPrefix2 = "nut-elevator";
|
|
@@ -5961,10 +6102,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5961
6102
|
})
|
|
5962
6103
|
))) : null, sticky && scrollY > 0 ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__list__fixed` }, /* @__PURE__ */ React.createElement("span", { className: `${classPrefix2}__list__fixed__title` }, list[currentIndex][floorKey])) : null);
|
|
5963
6104
|
};
|
|
5964
|
-
Elevator.defaultProps = defaultProps$
|
|
6105
|
+
Elevator.defaultProps = defaultProps$1i;
|
|
5965
6106
|
Elevator.displayName = "NutElevator";
|
|
5966
6107
|
Elevator.Context = elevatorContext;
|
|
5967
|
-
const defaultProps$
|
|
6108
|
+
const defaultProps$1h = {
|
|
5968
6109
|
...ComponentDefaults,
|
|
5969
6110
|
activeText: "",
|
|
5970
6111
|
inactiveText: "",
|
|
@@ -5992,7 +6133,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5992
6133
|
content,
|
|
5993
6134
|
...rest
|
|
5994
6135
|
} = {
|
|
5995
|
-
...defaultProps$
|
|
6136
|
+
...defaultProps$1h,
|
|
5996
6137
|
...props
|
|
5997
6138
|
};
|
|
5998
6139
|
const classPrefix2 = "nut-fixednav";
|
|
@@ -6044,9 +6185,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6044
6185
|
/* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__btn`, onClick: () => onUpdateValue() }, content || /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(a$j, { color: "#fff" }), /* @__PURE__ */ React.createElement("div", { className: "text" }, visible ? activeText || locale.fixednav.activeText : inactiveText || locale.fixednav.inactiveText)))
|
|
6045
6186
|
);
|
|
6046
6187
|
};
|
|
6047
|
-
FixedNav.defaultProps = defaultProps$
|
|
6188
|
+
FixedNav.defaultProps = defaultProps$1h;
|
|
6048
6189
|
FixedNav.displayName = "NutFixedNav";
|
|
6049
|
-
const defaultProps$
|
|
6190
|
+
const defaultProps$1g = {
|
|
6050
6191
|
...ComponentDefaults,
|
|
6051
6192
|
left: "",
|
|
6052
6193
|
right: "",
|
|
@@ -6058,8 +6199,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6058
6199
|
};
|
|
6059
6200
|
const NavBar = (props) => {
|
|
6060
6201
|
const {
|
|
6061
|
-
right,
|
|
6062
|
-
left,
|
|
6202
|
+
right: right2,
|
|
6203
|
+
left: left2,
|
|
6063
6204
|
className,
|
|
6064
6205
|
style,
|
|
6065
6206
|
back,
|
|
@@ -6069,7 +6210,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6069
6210
|
zIndex,
|
|
6070
6211
|
onBackClick
|
|
6071
6212
|
} = {
|
|
6072
|
-
...defaultProps$
|
|
6213
|
+
...defaultProps$1g,
|
|
6073
6214
|
...props
|
|
6074
6215
|
};
|
|
6075
6216
|
const classPrefix2 = "nut-navbar";
|
|
@@ -6088,13 +6229,13 @@ var __publicField = (obj, key, value) => {
|
|
|
6088
6229
|
onClick: (e) => onBackClick(e)
|
|
6089
6230
|
},
|
|
6090
6231
|
back
|
|
6091
|
-
),
|
|
6232
|
+
), left2);
|
|
6092
6233
|
};
|
|
6093
6234
|
const renderContent = () => {
|
|
6094
6235
|
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__title` }, children);
|
|
6095
6236
|
};
|
|
6096
6237
|
const renderRight = () => {
|
|
6097
|
-
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__right` },
|
|
6238
|
+
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__right` }, right2);
|
|
6098
6239
|
};
|
|
6099
6240
|
const renderWrapper = () => {
|
|
6100
6241
|
return /* @__PURE__ */ React.createElement("div", { className: cls, style: styles() }, renderLeft(), renderContent(), renderRight());
|
|
@@ -6106,9 +6247,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6106
6247
|
const cls = classNames(classPrefix2, classes, className);
|
|
6107
6248
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, fixed && placeholder ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}--placeholder` }, renderWrapper()) : renderWrapper());
|
|
6108
6249
|
};
|
|
6109
|
-
NavBar.defaultProps = defaultProps$
|
|
6250
|
+
NavBar.defaultProps = defaultProps$1g;
|
|
6110
6251
|
NavBar.displayName = "NutNavBar";
|
|
6111
|
-
const defaultProps$
|
|
6252
|
+
const defaultProps$1f = {
|
|
6112
6253
|
...ComponentDefaults,
|
|
6113
6254
|
position: "center",
|
|
6114
6255
|
transition: "",
|
|
@@ -6129,7 +6270,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6129
6270
|
onCloseIconClick: (e) => true,
|
|
6130
6271
|
...defaultOverlayProps
|
|
6131
6272
|
};
|
|
6132
|
-
|
|
6273
|
+
const _zIndex = 1100;
|
|
6133
6274
|
const Popup = (props) => {
|
|
6134
6275
|
const {
|
|
6135
6276
|
children,
|
|
@@ -6144,7 +6285,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6144
6285
|
closeable,
|
|
6145
6286
|
closeIconPosition,
|
|
6146
6287
|
closeIcon,
|
|
6147
|
-
left,
|
|
6288
|
+
left: left2,
|
|
6148
6289
|
title,
|
|
6149
6290
|
style,
|
|
6150
6291
|
transition,
|
|
@@ -6160,11 +6301,13 @@ var __publicField = (obj, key, value) => {
|
|
|
6160
6301
|
afterShow,
|
|
6161
6302
|
afterClose,
|
|
6162
6303
|
onClick
|
|
6163
|
-
} = { ...defaultProps$
|
|
6164
|
-
|
|
6304
|
+
} = { ...defaultProps$1f, ...props };
|
|
6305
|
+
let innerIndex = zIndex || _zIndex;
|
|
6306
|
+
const [index, setIndex] = React.useState(innerIndex);
|
|
6165
6307
|
const [innerVisible, setInnerVisible] = React.useState(visible);
|
|
6166
6308
|
const [showChildren, setShowChildren] = React.useState(true);
|
|
6167
6309
|
const [transitionName, setTransitionName] = React.useState("");
|
|
6310
|
+
const refObject = useLockScrollTaro(innerVisible && lockScroll);
|
|
6168
6311
|
const classPrefix2 = "nut-popup";
|
|
6169
6312
|
const baseStyle = {
|
|
6170
6313
|
zIndex: index
|
|
@@ -6190,9 +6333,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6190
6333
|
const open2 = () => {
|
|
6191
6334
|
if (!innerVisible) {
|
|
6192
6335
|
setInnerVisible(true);
|
|
6193
|
-
|
|
6194
|
-
setIndex(++_zIndex);
|
|
6195
|
-
}
|
|
6336
|
+
setIndex(++innerIndex);
|
|
6196
6337
|
}
|
|
6197
6338
|
if (destroyOnClose) {
|
|
6198
6339
|
setShowChildren(true);
|
|
@@ -6248,7 +6389,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6248
6389
|
return null;
|
|
6249
6390
|
};
|
|
6250
6391
|
const renderTitle = () => {
|
|
6251
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, position === "bottom" && /* @__PURE__ */ React.createElement(React.Fragment, null,
|
|
6392
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, position === "bottom" && /* @__PURE__ */ React.createElement(React.Fragment, null, left2 && /* @__PURE__ */ React.createElement(components.View, { className: `${classPrefix2}-left-icon` }, left2), title && /* @__PURE__ */ React.createElement(components.View, { className: `${classPrefix2}-title` }, title)));
|
|
6252
6393
|
};
|
|
6253
6394
|
const renderPop = () => {
|
|
6254
6395
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -6264,9 +6405,11 @@ var __publicField = (obj, key, value) => {
|
|
|
6264
6405
|
/* @__PURE__ */ React.createElement(
|
|
6265
6406
|
components.View,
|
|
6266
6407
|
{
|
|
6408
|
+
ref: refObject,
|
|
6267
6409
|
style: popStyles,
|
|
6268
6410
|
className: popClassName,
|
|
6269
|
-
onClick: onHandleClick
|
|
6411
|
+
onClick: onHandleClick,
|
|
6412
|
+
catchMove: lockScroll
|
|
6270
6413
|
},
|
|
6271
6414
|
renderTitle(),
|
|
6272
6415
|
renderIcon(),
|
|
@@ -6297,10 +6440,10 @@ var __publicField = (obj, key, value) => {
|
|
|
6297
6440
|
}, [position, transition]);
|
|
6298
6441
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, renderToContainer(portal, renderNode()));
|
|
6299
6442
|
};
|
|
6300
|
-
Popup.defaultProps = defaultProps$
|
|
6443
|
+
Popup.defaultProps = defaultProps$1f;
|
|
6301
6444
|
Popup.displayName = "NutPopup";
|
|
6302
6445
|
const OffsetContext = React.createContext(20);
|
|
6303
|
-
const defaultProps$
|
|
6446
|
+
const defaultProps$1e = {
|
|
6304
6447
|
...ComponentDefaults,
|
|
6305
6448
|
position: "left",
|
|
6306
6449
|
width: "80%"
|
|
@@ -6317,7 +6460,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6317
6460
|
onClose,
|
|
6318
6461
|
...rest
|
|
6319
6462
|
} = {
|
|
6320
|
-
...defaultProps$
|
|
6463
|
+
...defaultProps$1e,
|
|
6321
6464
|
...props
|
|
6322
6465
|
};
|
|
6323
6466
|
const indent = props.indent ? Number(props.indent) : 20;
|
|
@@ -6357,7 +6500,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6357
6500
|
)))
|
|
6358
6501
|
);
|
|
6359
6502
|
};
|
|
6360
|
-
SideNavBar.defaultProps = defaultProps$
|
|
6503
|
+
SideNavBar.defaultProps = defaultProps$1e;
|
|
6361
6504
|
SideNavBar.displayName = "NutSideNavBar";
|
|
6362
6505
|
const SideNavBarItem = (props) => {
|
|
6363
6506
|
const classPrefix2 = "nut-subsidenavbar";
|
|
@@ -6376,13 +6519,13 @@ var __publicField = (obj, key, value) => {
|
|
|
6376
6519
|
title
|
|
6377
6520
|
);
|
|
6378
6521
|
};
|
|
6379
|
-
const defaultProps$
|
|
6522
|
+
const defaultProps$1d = {
|
|
6380
6523
|
open: true
|
|
6381
6524
|
};
|
|
6382
6525
|
const SubSideNavBar = (props) => {
|
|
6383
6526
|
const classPrefix2 = "nut-subsidenavbar";
|
|
6384
6527
|
const { title, value, children, onClick, open: open2, ...rest } = {
|
|
6385
|
-
...defaultProps$
|
|
6528
|
+
...defaultProps$1d,
|
|
6386
6529
|
...props
|
|
6387
6530
|
};
|
|
6388
6531
|
const [subShow, setSubShow] = React.useState(open2);
|
|
@@ -6392,8 +6535,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6392
6535
|
(nodeList, level = 1) => {
|
|
6393
6536
|
const titleClass = nodeList[0].className;
|
|
6394
6537
|
if (titleClass.includes(`${classPrefix2}__title`)) {
|
|
6395
|
-
const
|
|
6396
|
-
nodeList[0].style.paddingLeft = `${
|
|
6538
|
+
const left2 = offset * (level + 1);
|
|
6539
|
+
nodeList[0].style.paddingLeft = `${left2}px`;
|
|
6397
6540
|
}
|
|
6398
6541
|
const childNodes = nodeList[1] && nodeList[1].children && Array.from(nodeList[1].children).filter(
|
|
6399
6542
|
(item) => item.nodeType !== 3 && item.nodeType !== 8
|
|
@@ -6401,8 +6544,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6401
6544
|
childNodes.forEach((item) => {
|
|
6402
6545
|
const itemClass = item.className;
|
|
6403
6546
|
if (itemClass.includes(`${classPrefix2}__item`)) {
|
|
6404
|
-
const
|
|
6405
|
-
item.style.paddingLeft = `${
|
|
6547
|
+
const left2 = offset * (level + 2);
|
|
6548
|
+
item.style.paddingLeft = `${left2}px`;
|
|
6406
6549
|
}
|
|
6407
6550
|
if (itemClass.includes(`${classPrefix2}__list`)) {
|
|
6408
6551
|
let level2 = item.getAttribute("level") ? Number(item.getAttribute("level")) : 1;
|
|
@@ -6460,7 +6603,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6460
6603
|
);
|
|
6461
6604
|
return [stateRef.current, setState];
|
|
6462
6605
|
}
|
|
6463
|
-
const defaultProps$
|
|
6606
|
+
const defaultProps$1c = {
|
|
6464
6607
|
...ComponentDefaults,
|
|
6465
6608
|
value: "",
|
|
6466
6609
|
dot: false,
|
|
@@ -6470,8 +6613,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6470
6613
|
color: ""
|
|
6471
6614
|
};
|
|
6472
6615
|
const Badge = (props) => {
|
|
6473
|
-
const { className, style, value, max, children, dot, top, right, color } = {
|
|
6474
|
-
...defaultProps$
|
|
6616
|
+
const { className, style, value, max, children, dot, top, right: right2, color } = {
|
|
6617
|
+
...defaultProps$1c,
|
|
6475
6618
|
...props
|
|
6476
6619
|
};
|
|
6477
6620
|
const classPrefix2 = "nut-badge";
|
|
@@ -6492,15 +6635,15 @@ var __publicField = (obj, key, value) => {
|
|
|
6492
6635
|
const getStyle = () => {
|
|
6493
6636
|
const style2 = {};
|
|
6494
6637
|
style2.top = `${Number(top) || parseFloat(String(top)) || 0}px`;
|
|
6495
|
-
style2.right = `${Number(
|
|
6638
|
+
style2.right = `${Number(right2) || parseFloat(String(right2)) || 0}px`;
|
|
6496
6639
|
style2.background = color;
|
|
6497
6640
|
return style2;
|
|
6498
6641
|
};
|
|
6499
6642
|
return /* @__PURE__ */ React.createElement("div", { className: classes, style }, typeof value === "object" && value && /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__icon` }, value), /* @__PURE__ */ React.createElement("div", null, children), /* @__PURE__ */ React.createElement("div", { className: contentClasses, style: getStyle() }, content()));
|
|
6500
6643
|
};
|
|
6501
|
-
Badge.defaultProps = defaultProps$
|
|
6644
|
+
Badge.defaultProps = defaultProps$1c;
|
|
6502
6645
|
Badge.displayName = "NutBadge";
|
|
6503
|
-
const defaultProps$
|
|
6646
|
+
const defaultProps$1b = {
|
|
6504
6647
|
...ComponentDefaults,
|
|
6505
6648
|
title: "",
|
|
6506
6649
|
icon: null,
|
|
@@ -6526,11 +6669,11 @@ var __publicField = (obj, key, value) => {
|
|
|
6526
6669
|
dot,
|
|
6527
6670
|
max,
|
|
6528
6671
|
top,
|
|
6529
|
-
right,
|
|
6672
|
+
right: right2,
|
|
6530
6673
|
handleClick,
|
|
6531
6674
|
...rest
|
|
6532
6675
|
} = {
|
|
6533
|
-
...defaultProps$
|
|
6676
|
+
...defaultProps$1b,
|
|
6534
6677
|
...props
|
|
6535
6678
|
};
|
|
6536
6679
|
const classPrefix2 = "nut-tabbar-item";
|
|
@@ -6546,7 +6689,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6546
6689
|
dot,
|
|
6547
6690
|
max,
|
|
6548
6691
|
top,
|
|
6549
|
-
right,
|
|
6692
|
+
right: right2,
|
|
6550
6693
|
color: activeColor
|
|
6551
6694
|
};
|
|
6552
6695
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -6563,7 +6706,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6563
6706
|
icon ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Badge, { ...badgeProps }, /* @__PURE__ */ React.createElement("div", { className: boxPrefix }, icon)), /* @__PURE__ */ React.createElement("div", { className: titleClass }, title)) : /* @__PURE__ */ React.createElement(Badge, { ...badgeProps }, /* @__PURE__ */ React.createElement("div", { className: titleClass }, title))
|
|
6564
6707
|
);
|
|
6565
6708
|
};
|
|
6566
|
-
const defaultProps$
|
|
6709
|
+
const defaultProps$1a = {
|
|
6567
6710
|
...ComponentDefaults,
|
|
6568
6711
|
defaultValue: 0,
|
|
6569
6712
|
fixed: false,
|
|
@@ -6586,7 +6729,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6586
6729
|
style,
|
|
6587
6730
|
onSwitch
|
|
6588
6731
|
} = {
|
|
6589
|
-
...defaultProps$
|
|
6732
|
+
...defaultProps$1a,
|
|
6590
6733
|
...props
|
|
6591
6734
|
};
|
|
6592
6735
|
const classPrefix2 = "nut-tabbar";
|
|
@@ -6621,17 +6764,17 @@ var __publicField = (obj, key, value) => {
|
|
|
6621
6764
|
(fixed || safeArea) && /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__safe-area` })
|
|
6622
6765
|
);
|
|
6623
6766
|
};
|
|
6624
|
-
Tabbar.defaultProps = defaultProps$
|
|
6767
|
+
Tabbar.defaultProps = defaultProps$1a;
|
|
6625
6768
|
Tabbar.displayName = "NutTabbar";
|
|
6626
6769
|
Tabbar.Item = TabbarItem;
|
|
6627
|
-
const defaultProps$
|
|
6770
|
+
const defaultProps$19 = {
|
|
6628
6771
|
title: "",
|
|
6629
6772
|
value: "",
|
|
6630
6773
|
disabled: false
|
|
6631
6774
|
};
|
|
6632
6775
|
const TabPane = (props) => {
|
|
6633
6776
|
const { children, autoHeightClassName, className, disabled } = {
|
|
6634
|
-
...defaultProps$
|
|
6777
|
+
...defaultProps$19,
|
|
6635
6778
|
...props
|
|
6636
6779
|
};
|
|
6637
6780
|
const classPrefix2 = "nut-tabpane";
|
|
@@ -6657,7 +6800,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6657
6800
|
};
|
|
6658
6801
|
}
|
|
6659
6802
|
const requestAniFrame$1 = requestAniFrame();
|
|
6660
|
-
const defaultProps$
|
|
6803
|
+
const defaultProps$18 = {
|
|
6661
6804
|
...ComponentDefaults,
|
|
6662
6805
|
tabStyle: {},
|
|
6663
6806
|
name: "",
|
|
@@ -6685,7 +6828,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6685
6828
|
autoHeight,
|
|
6686
6829
|
...rest
|
|
6687
6830
|
} = {
|
|
6688
|
-
...defaultProps$
|
|
6831
|
+
...defaultProps$18,
|
|
6689
6832
|
...props
|
|
6690
6833
|
};
|
|
6691
6834
|
const [value, setValue] = usePropsValue({
|
|
@@ -6798,11 +6941,11 @@ var __publicField = (obj, key, value) => {
|
|
|
6798
6941
|
to = top - (navRectRef.current.height - titleRect.height) / 2;
|
|
6799
6942
|
} else {
|
|
6800
6943
|
const DEFAULT_PADDING = 20;
|
|
6801
|
-
const
|
|
6944
|
+
const left2 = titleRects.slice(0, value).reduce(
|
|
6802
6945
|
(prev, curr) => prev + curr.width,
|
|
6803
6946
|
DEFAULT_PADDING
|
|
6804
6947
|
);
|
|
6805
|
-
to =
|
|
6948
|
+
to = left2 - (navRectRef.current.width - titleRect.width) / 2;
|
|
6806
6949
|
}
|
|
6807
6950
|
Taro.nextTick(() => {
|
|
6808
6951
|
scrollWithAnimation.current = true;
|
|
@@ -6902,10 +7045,10 @@ var __publicField = (obj, key, value) => {
|
|
|
6902
7045
|
return React.cloneElement(child, childProps);
|
|
6903
7046
|
}))));
|
|
6904
7047
|
};
|
|
6905
|
-
Tabs.defaultProps = defaultProps$
|
|
7048
|
+
Tabs.defaultProps = defaultProps$18;
|
|
6906
7049
|
Tabs.displayName = "NutTabs";
|
|
6907
7050
|
Tabs.TabPane = TabPane;
|
|
6908
|
-
const defaultProps$
|
|
7051
|
+
const defaultProps$17 = {
|
|
6909
7052
|
type: "custom",
|
|
6910
7053
|
existList: [],
|
|
6911
7054
|
defaultIcon: null,
|
|
@@ -6924,7 +7067,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6924
7067
|
onSelect,
|
|
6925
7068
|
onSwitch,
|
|
6926
7069
|
...rest
|
|
6927
|
-
} = { ...defaultProps$
|
|
7070
|
+
} = { ...defaultProps$17, ...props };
|
|
6928
7071
|
const classPrefix2 = "nut-address";
|
|
6929
7072
|
const selectedExist = (item) => {
|
|
6930
7073
|
existList.forEach((list, index) => {
|
|
@@ -7086,7 +7229,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7086
7229
|
}
|
|
7087
7230
|
}
|
|
7088
7231
|
const Tree$1 = Tree;
|
|
7089
|
-
const defaultProps$
|
|
7232
|
+
const defaultProps$16 = {
|
|
7090
7233
|
...ComponentDefaults,
|
|
7091
7234
|
activeColor: "",
|
|
7092
7235
|
activeIcon: "checklist",
|
|
@@ -7130,7 +7273,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7130
7273
|
onClose,
|
|
7131
7274
|
onChange,
|
|
7132
7275
|
onPathChange
|
|
7133
|
-
} = { ...defaultProps$
|
|
7276
|
+
} = { ...defaultProps$16, ...props };
|
|
7134
7277
|
const [tabvalue, setTabvalue] = React.useState("c1");
|
|
7135
7278
|
const [optionsData, setOptionsData] = React.useState([]);
|
|
7136
7279
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.onLoad);
|
|
@@ -7427,9 +7570,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7427
7570
|
) : renderTabs());
|
|
7428
7571
|
};
|
|
7429
7572
|
const Cascader = React.forwardRef(InternalCascader);
|
|
7430
|
-
Cascader.defaultProps = defaultProps$
|
|
7573
|
+
Cascader.defaultProps = defaultProps$16;
|
|
7431
7574
|
Cascader.displayName = "NutCascader";
|
|
7432
|
-
const defaultProps$
|
|
7575
|
+
const defaultProps$15 = {
|
|
7433
7576
|
...ComponentDefaults,
|
|
7434
7577
|
visible: false,
|
|
7435
7578
|
type: "custom",
|
|
@@ -7446,7 +7589,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7446
7589
|
height,
|
|
7447
7590
|
options,
|
|
7448
7591
|
title,
|
|
7449
|
-
left,
|
|
7592
|
+
left: left2,
|
|
7450
7593
|
value,
|
|
7451
7594
|
defaultValue,
|
|
7452
7595
|
optionKey,
|
|
@@ -7456,7 +7599,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7456
7599
|
onPathChange,
|
|
7457
7600
|
...rest
|
|
7458
7601
|
} = {
|
|
7459
|
-
...defaultProps$
|
|
7602
|
+
...defaultProps$15,
|
|
7460
7603
|
...props
|
|
7461
7604
|
};
|
|
7462
7605
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, type2 === "custom" && /* @__PURE__ */ React.createElement(
|
|
@@ -7466,7 +7609,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7466
7609
|
value,
|
|
7467
7610
|
defaultValue,
|
|
7468
7611
|
title,
|
|
7469
|
-
left,
|
|
7612
|
+
left: left2,
|
|
7470
7613
|
options,
|
|
7471
7614
|
format: format2,
|
|
7472
7615
|
optionKey,
|
|
@@ -7481,7 +7624,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7481
7624
|
}
|
|
7482
7625
|
));
|
|
7483
7626
|
};
|
|
7484
|
-
const defaultProps$
|
|
7627
|
+
const defaultProps$14 = {
|
|
7485
7628
|
...ComponentDefaults,
|
|
7486
7629
|
defaultValue: [],
|
|
7487
7630
|
type: "custom",
|
|
@@ -7523,7 +7666,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7523
7666
|
onSwitch,
|
|
7524
7667
|
...rest
|
|
7525
7668
|
} = {
|
|
7526
|
-
...defaultProps$
|
|
7669
|
+
...defaultProps$14,
|
|
7527
7670
|
...props
|
|
7528
7671
|
};
|
|
7529
7672
|
const classPrefix2 = "nut-address";
|
|
@@ -7614,7 +7757,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7614
7757
|
));
|
|
7615
7758
|
};
|
|
7616
7759
|
const Address = React.forwardRef(InternalAddress);
|
|
7617
|
-
Address.defaultProps = defaultProps$
|
|
7760
|
+
Address.defaultProps = defaultProps$14;
|
|
7618
7761
|
Address.displayName = "NutAddress";
|
|
7619
7762
|
const Utils = {
|
|
7620
7763
|
/**
|
|
@@ -7864,7 +8007,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7864
8007
|
const isStartAndEnd = (days) => {
|
|
7865
8008
|
return days.length >= 2 && Utils.isEqual(days[0], days[1]);
|
|
7866
8009
|
};
|
|
7867
|
-
const defaultProps$
|
|
8010
|
+
const defaultProps$13 = {
|
|
7868
8011
|
...ComponentDefaults,
|
|
7869
8012
|
type: "single",
|
|
7870
8013
|
autoBackfill: false,
|
|
@@ -7924,7 +8067,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7924
8067
|
onUpdate,
|
|
7925
8068
|
onDayClick,
|
|
7926
8069
|
onPageChange
|
|
7927
|
-
} = { ...defaultProps$
|
|
8070
|
+
} = { ...defaultProps$13, ...props };
|
|
7928
8071
|
const weekdays = locale.calendaritem.weekdays;
|
|
7929
8072
|
const weeks = [
|
|
7930
8073
|
...weekdays.slice(firstDayOfWeek, 7),
|
|
@@ -8265,6 +8408,8 @@ var __publicField = (obj, key, value) => {
|
|
|
8265
8408
|
const scrollTop2 = e.detail.scrollTop;
|
|
8266
8409
|
Taro.getEnv() === "WEB" && setScrollTop(scrollTop2);
|
|
8267
8410
|
let current = Math.floor(scrollTop2 / avgHeight);
|
|
8411
|
+
if (!monthsData[current + 1])
|
|
8412
|
+
return;
|
|
8268
8413
|
const nextTop = monthsData[current + 1].scrollTop;
|
|
8269
8414
|
const nextHeight = monthsData[current + 1].cssHeight;
|
|
8270
8415
|
if (current === 0) {
|
|
@@ -8469,9 +8614,9 @@ var __publicField = (obj, key, value) => {
|
|
|
8469
8614
|
};
|
|
8470
8615
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: classes, style }, renderHeader(), renderContent(), popup && !autoBackfill ? renderFooter() : ""));
|
|
8471
8616
|
});
|
|
8472
|
-
CalendarItem.defaultProps = defaultProps$
|
|
8617
|
+
CalendarItem.defaultProps = defaultProps$13;
|
|
8473
8618
|
CalendarItem.displayName = "NutCalendarItem";
|
|
8474
|
-
const defaultProps$
|
|
8619
|
+
const defaultProps$12 = {
|
|
8475
8620
|
...ComponentDefaults,
|
|
8476
8621
|
type: "single",
|
|
8477
8622
|
autoBackfill: false,
|
|
@@ -8534,7 +8679,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8534
8679
|
onConfirm,
|
|
8535
8680
|
onDayClick,
|
|
8536
8681
|
onPageChange
|
|
8537
|
-
} = { ...defaultProps$
|
|
8682
|
+
} = { ...defaultProps$12, ...props };
|
|
8538
8683
|
const calendarRef = React.useRef(null);
|
|
8539
8684
|
const close2 = () => {
|
|
8540
8685
|
onClose && onClose();
|
|
@@ -8608,8 +8753,387 @@ var __publicField = (obj, key, value) => {
|
|
|
8608
8753
|
renderItem()
|
|
8609
8754
|
) : renderItem());
|
|
8610
8755
|
});
|
|
8611
|
-
Calendar.defaultProps = defaultProps$
|
|
8756
|
+
Calendar.defaultProps = defaultProps$12;
|
|
8612
8757
|
Calendar.displayName = "NutCalendar";
|
|
8758
|
+
const left = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNNi42MDUgOS40OWEuNzcxLjc3MSAwIDAgMSAwLS45OGwzLjYtNC4zNzJhLjc3MS43NzEgMCAwIDEgMS4xOS45ODFMOC4yIDlsMy4xOTcgMy44ODFhLjc3MS43NzEgMCAxIDEtMS4xOTEuOThsLTMuNi00LjM3eiIvPjwvc3ZnPg==";
|
|
8759
|
+
const right = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNMTEuMzk2IDkuNDlhLjc3MS43NzEgMCAwIDAgMC0uOThsLTMuNi00LjM3MmEuNzcxLjc3MSAwIDAgMC0xLjE5MS45ODFMOS44IDlsLTMuMTk2IDMuODgxYS43NzEuNzcxIDAgMCAwIDEuMTkuOThsMy42LTQuMzd6Ii8+PC9zdmc+";
|
|
8760
|
+
const doubleLeft = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNMTMuODUzIDQuMDI2YS43NzEuNzcxIDAgMCAxIC4xMiAxLjA4NUwxMC44NjQgOWwzLjExIDMuODg5YS43NzEuNzcxIDAgMSAxLTEuMjA0Ljk2M2wtMy40OTgtNC4zN2EuNzcxLjc3MSAwIDAgMSAwLS45NjRsMy40OTctNC4zNzFhLjc3MS43NzEgMCAwIDEgMS4wODQtLjEyem0tNS4yNDUgMGEuNzcxLjc3MSAwIDAgMSAuMTIgMS4wODVMNS42MTcgOWwzLjExMSAzLjg4OWEuNzcxLjc3MSAwIDAgMS0xLjIwNS45NjNsLTMuNDk3LTQuMzdhLjc3MS43NzEgMCAwIDEgMC0uOTY0bDMuNDk3LTQuMzcxYS43NzEuNzcxIDAgMCAxIDEuMDg1LS4xMnoiLz48L3N2Zz4=";
|
|
8761
|
+
const doubleRight = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNNC4xNDcgMTMuOTc0YS43NzEuNzcxIDAgMCAxLS4xMi0xLjA4NUw3LjEzNiA5IDQuMDI4IDUuMTFhLjc3MS43NzEgMCAxIDEgMS4yMDQtLjk2M2wzLjQ5NyA0LjM3MWEuNzcxLjc3MSAwIDAgMSAwIC45NjRsLTMuNDk3IDQuMzcxYS43NzEuNzcxIDAgMCAxLTEuMDg0LjEyem01LjI0NSAwYS43NzEuNzcxIDAgMCAxLS4xMi0xLjA4NUwxMi4zODMgOSA5LjI3MiA1LjExYS43NzEuNzcxIDAgMSAxIDEuMjA1LS45NjNsMy40OTcgNC4zNzFhLjc3MS43NzEgMCAwIDEgMCAuOTY0bC0zLjQ5NyA0LjM3MWEuNzcxLjc3MSAwIDAgMS0xLjA4NS4xMnoiLz48L3N2Zz4=";
|
|
8762
|
+
const Icon = ({ url }) => {
|
|
8763
|
+
const style = {
|
|
8764
|
+
background: `url('${url}') no-repeat center`,
|
|
8765
|
+
backgroundSize: "100% 100%",
|
|
8766
|
+
width: "18px",
|
|
8767
|
+
height: "18px"
|
|
8768
|
+
};
|
|
8769
|
+
return /* @__PURE__ */ React.createElement(components.View, { style });
|
|
8770
|
+
};
|
|
8771
|
+
const Left = () => /* @__PURE__ */ React.createElement(Icon, { url: left });
|
|
8772
|
+
const Right = () => /* @__PURE__ */ React.createElement(Icon, { url: right });
|
|
8773
|
+
const DoubleLeft = () => /* @__PURE__ */ React.createElement(Icon, { url: doubleLeft });
|
|
8774
|
+
const DoubleRight = () => /* @__PURE__ */ React.createElement(Icon, { url: doubleRight });
|
|
8775
|
+
const convertDateToDay = (date2) => {
|
|
8776
|
+
return date2 ? {
|
|
8777
|
+
year: date2.getFullYear(),
|
|
8778
|
+
month: date2.getMonth() + 1,
|
|
8779
|
+
date: date2.getDate()
|
|
8780
|
+
} : null;
|
|
8781
|
+
};
|
|
8782
|
+
const convertDayToDate = (day) => {
|
|
8783
|
+
return day ? new Date(day.year, day.month - 1, day.date) : null;
|
|
8784
|
+
};
|
|
8785
|
+
const getPrevMonthDays = (year, month, firstDayOfWeek) => {
|
|
8786
|
+
let prevMonth = month - 1;
|
|
8787
|
+
let prevYear = year;
|
|
8788
|
+
if (prevMonth <= 0) {
|
|
8789
|
+
prevMonth = 12;
|
|
8790
|
+
prevYear -= 1;
|
|
8791
|
+
}
|
|
8792
|
+
let days = Utils.getMonthPreDay(year, month);
|
|
8793
|
+
days -= firstDayOfWeek;
|
|
8794
|
+
if (days >= 7) {
|
|
8795
|
+
days -= 7;
|
|
8796
|
+
}
|
|
8797
|
+
const preDates = Utils.getMonthDays(`${prevYear}`, `${prevMonth}`);
|
|
8798
|
+
const months = Array.from(Array(preDates), (_, k) => {
|
|
8799
|
+
return {
|
|
8800
|
+
type: "prev",
|
|
8801
|
+
year: prevYear,
|
|
8802
|
+
month: prevMonth,
|
|
8803
|
+
date: k + 1
|
|
8804
|
+
};
|
|
8805
|
+
});
|
|
8806
|
+
return months.slice(preDates - days);
|
|
8807
|
+
};
|
|
8808
|
+
const getCurrentMonthDays = (year, month) => {
|
|
8809
|
+
const days = Utils.getMonthDays(`${year}`, `${month}`);
|
|
8810
|
+
return Array.from(Array(days), (_, k) => {
|
|
8811
|
+
return {
|
|
8812
|
+
type: "current",
|
|
8813
|
+
year,
|
|
8814
|
+
month,
|
|
8815
|
+
date: k + 1
|
|
8816
|
+
};
|
|
8817
|
+
});
|
|
8818
|
+
};
|
|
8819
|
+
const getCurrentWeekDays = (day, firstDayOfWeek) => {
|
|
8820
|
+
const current = new Date(day.year, day.month - 1, day.date);
|
|
8821
|
+
const count = (current.getDay() + 7 - firstDayOfWeek) % 7;
|
|
8822
|
+
return [
|
|
8823
|
+
convertDateToDay(
|
|
8824
|
+
new Date(current.getTime() - 24 * 60 * 60 * 1e3 * count)
|
|
8825
|
+
),
|
|
8826
|
+
convertDateToDay(
|
|
8827
|
+
new Date(current.getTime() + 24 * 60 * 60 * 1e3 * (6 - count))
|
|
8828
|
+
)
|
|
8829
|
+
];
|
|
8830
|
+
};
|
|
8831
|
+
const defaultProps$11 = {
|
|
8832
|
+
...ComponentDefaults,
|
|
8833
|
+
type: "single",
|
|
8834
|
+
firstDayOfWeek: 0
|
|
8835
|
+
};
|
|
8836
|
+
const CalendarCard = React.forwardRef((props, ref) => {
|
|
8837
|
+
const { locale } = useConfig$1();
|
|
8838
|
+
const {
|
|
8839
|
+
style,
|
|
8840
|
+
type: type2,
|
|
8841
|
+
value,
|
|
8842
|
+
defaultValue,
|
|
8843
|
+
firstDayOfWeek,
|
|
8844
|
+
startDate,
|
|
8845
|
+
endDate,
|
|
8846
|
+
disableDay,
|
|
8847
|
+
renderDay,
|
|
8848
|
+
renderDayTop,
|
|
8849
|
+
renderDayBottom,
|
|
8850
|
+
onDayClick,
|
|
8851
|
+
onPageChange,
|
|
8852
|
+
onChange
|
|
8853
|
+
} = { ...defaultProps$11, ...props };
|
|
8854
|
+
const [month, setMonth] = React.useState(() => {
|
|
8855
|
+
let date2 = new Date(Date.now());
|
|
8856
|
+
const val = value || defaultValue;
|
|
8857
|
+
if (Array.isArray(val)) {
|
|
8858
|
+
if (val.length) {
|
|
8859
|
+
date2 = val[0];
|
|
8860
|
+
}
|
|
8861
|
+
} else if (val) {
|
|
8862
|
+
date2 = val;
|
|
8863
|
+
}
|
|
8864
|
+
return {
|
|
8865
|
+
year: date2.getFullYear(),
|
|
8866
|
+
month: date2.getMonth() + 1
|
|
8867
|
+
};
|
|
8868
|
+
});
|
|
8869
|
+
const [days, setDays] = React.useState([]);
|
|
8870
|
+
const valueToRange = (val) => {
|
|
8871
|
+
if (Array.isArray(val)) {
|
|
8872
|
+
return val.map((date2) => {
|
|
8873
|
+
return convertDateToDay(date2);
|
|
8874
|
+
});
|
|
8875
|
+
}
|
|
8876
|
+
return val ? [convertDateToDay(val)] : [];
|
|
8877
|
+
};
|
|
8878
|
+
const rangeTovalue = (range2) => {
|
|
8879
|
+
if (Array.isArray(range2)) {
|
|
8880
|
+
return range2.map((day) => {
|
|
8881
|
+
return convertDayToDate(day);
|
|
8882
|
+
});
|
|
8883
|
+
}
|
|
8884
|
+
return range2 ? [convertDayToDate(range2)] : [];
|
|
8885
|
+
};
|
|
8886
|
+
const [innerValue, setInnerValue] = React.useState(() => {
|
|
8887
|
+
const val = value || defaultValue ? valueToRange(value || defaultValue) : [];
|
|
8888
|
+
return val;
|
|
8889
|
+
});
|
|
8890
|
+
React.useEffect(() => {
|
|
8891
|
+
const val = value || defaultValue ? valueToRange(value || defaultValue) : [];
|
|
8892
|
+
setInnerValue(val);
|
|
8893
|
+
}, [value]);
|
|
8894
|
+
const change = (v) => {
|
|
8895
|
+
setInnerValue(v);
|
|
8896
|
+
if (type2 === "single") {
|
|
8897
|
+
const date2 = convertDayToDate(v[0]);
|
|
8898
|
+
onChange == null ? void 0 : onChange(date2);
|
|
8899
|
+
} else if (type2 === "multiple" || type2 === "range" || type2 === "week") {
|
|
8900
|
+
const val = rangeTovalue(v);
|
|
8901
|
+
onChange == null ? void 0 : onChange(val);
|
|
8902
|
+
}
|
|
8903
|
+
};
|
|
8904
|
+
const getDays = (month2) => {
|
|
8905
|
+
const y2 = month2.year;
|
|
8906
|
+
const m = month2.month;
|
|
8907
|
+
const days2 = [
|
|
8908
|
+
...getPrevMonthDays(y2, m, firstDayOfWeek),
|
|
8909
|
+
...getCurrentMonthDays(y2, m)
|
|
8910
|
+
];
|
|
8911
|
+
const size = days2.length;
|
|
8912
|
+
const yearOfNextMonth = month2.month === 12 ? month2.year + 1 : month2.year;
|
|
8913
|
+
const monthOfNextMonth = month2.month === 12 ? 1 : month2.month + 1;
|
|
8914
|
+
for (let i = 1; i <= 42 - size; i++) {
|
|
8915
|
+
days2.push({
|
|
8916
|
+
type: "next",
|
|
8917
|
+
year: yearOfNextMonth,
|
|
8918
|
+
month: monthOfNextMonth,
|
|
8919
|
+
date: i
|
|
8920
|
+
});
|
|
8921
|
+
}
|
|
8922
|
+
return days2;
|
|
8923
|
+
};
|
|
8924
|
+
React.useEffect(() => {
|
|
8925
|
+
const newDays = getDays(month);
|
|
8926
|
+
setDays(newDays);
|
|
8927
|
+
onPageChange == null ? void 0 : onPageChange(month);
|
|
8928
|
+
}, [month]);
|
|
8929
|
+
const isSameDay = (day1, day2) => {
|
|
8930
|
+
return (day1 == null ? void 0 : day1.year) === (day2 == null ? void 0 : day2.year) && (day1 == null ? void 0 : day1.month) === (day2 == null ? void 0 : day2.month) && (day1 == null ? void 0 : day1.date) === (day2 == null ? void 0 : day2.date);
|
|
8931
|
+
};
|
|
8932
|
+
const compareDay = (day1, day2) => {
|
|
8933
|
+
if (day1 && day2) {
|
|
8934
|
+
if (day1.year === day2.year) {
|
|
8935
|
+
if (day1.month === day2.month) {
|
|
8936
|
+
return day1.date - day2.date;
|
|
8937
|
+
}
|
|
8938
|
+
return day1.month - day2.month;
|
|
8939
|
+
}
|
|
8940
|
+
return day1.year - day2.year;
|
|
8941
|
+
}
|
|
8942
|
+
};
|
|
8943
|
+
const isDisable = (day) => {
|
|
8944
|
+
if (disableDay && disableDay(day)) {
|
|
8945
|
+
return true;
|
|
8946
|
+
}
|
|
8947
|
+
if (startDate && Number(compareDay(day, convertDateToDay(startDate))) < 0) {
|
|
8948
|
+
return true;
|
|
8949
|
+
}
|
|
8950
|
+
if (endDate && Number(compareDay(day, convertDateToDay(endDate))) > 0) {
|
|
8951
|
+
return true;
|
|
8952
|
+
}
|
|
8953
|
+
return false;
|
|
8954
|
+
};
|
|
8955
|
+
const isActive = (day) => {
|
|
8956
|
+
if (type2 === "single" || type2 === "multiple") {
|
|
8957
|
+
for (const val of innerValue) {
|
|
8958
|
+
if (isSameDay(day, val)) {
|
|
8959
|
+
return true;
|
|
8960
|
+
}
|
|
8961
|
+
}
|
|
8962
|
+
} else if (type2 === "range" && innerValue.length === 1 && isSameDay(innerValue[0], day)) {
|
|
8963
|
+
return true;
|
|
8964
|
+
}
|
|
8965
|
+
return false;
|
|
8966
|
+
};
|
|
8967
|
+
const isStart2 = (day) => {
|
|
8968
|
+
return (type2 === "range" || type2 === "week") && innerValue.length === 2 && isSameDay(day, innerValue[0]);
|
|
8969
|
+
};
|
|
8970
|
+
const isEnd2 = (day) => {
|
|
8971
|
+
return (type2 === "range" || type2 === "week") && innerValue.length === 2 && isSameDay(day, innerValue[1]);
|
|
8972
|
+
};
|
|
8973
|
+
const isMid = (day) => {
|
|
8974
|
+
if (type2 === "range" || type2 === "week") {
|
|
8975
|
+
if (innerValue.length === 2) {
|
|
8976
|
+
const c1 = compareDay(innerValue[0], day);
|
|
8977
|
+
const c2 = compareDay(day, innerValue[1]);
|
|
8978
|
+
if (c1 && c1 < 0 && c2 && c2 < 0) {
|
|
8979
|
+
return true;
|
|
8980
|
+
}
|
|
8981
|
+
}
|
|
8982
|
+
}
|
|
8983
|
+
return false;
|
|
8984
|
+
};
|
|
8985
|
+
const isWeekend = (day) => {
|
|
8986
|
+
const d = new Date(day.year, day.month - 1, day.date).getDay();
|
|
8987
|
+
return d === 0 || d === 6;
|
|
8988
|
+
};
|
|
8989
|
+
const getClasses = (day) => {
|
|
8990
|
+
if (isDisable(day)) {
|
|
8991
|
+
return ["disabled"];
|
|
8992
|
+
}
|
|
8993
|
+
const res = [];
|
|
8994
|
+
if (day.type === "current") {
|
|
8995
|
+
if (isActive(day)) {
|
|
8996
|
+
res.push("active");
|
|
8997
|
+
}
|
|
8998
|
+
if (isStart2(day)) {
|
|
8999
|
+
res.push("start");
|
|
9000
|
+
}
|
|
9001
|
+
if (isEnd2(day)) {
|
|
9002
|
+
res.push("end");
|
|
9003
|
+
}
|
|
9004
|
+
if (isMid(day)) {
|
|
9005
|
+
res.push("mid");
|
|
9006
|
+
}
|
|
9007
|
+
if (isWeekend(day)) {
|
|
9008
|
+
res.push("weekend");
|
|
9009
|
+
}
|
|
9010
|
+
}
|
|
9011
|
+
return res;
|
|
9012
|
+
};
|
|
9013
|
+
const jumpTo = (year, month2) => {
|
|
9014
|
+
setMonth({ year, month: month2 });
|
|
9015
|
+
};
|
|
9016
|
+
const jump = (step = 1) => {
|
|
9017
|
+
const current = month.year * 12 + month.month;
|
|
9018
|
+
let newMonth = (current + step) % 12;
|
|
9019
|
+
if (newMonth === 0) {
|
|
9020
|
+
newMonth = 12;
|
|
9021
|
+
}
|
|
9022
|
+
const newYear = Math.floor((current + step - newMonth) / 12);
|
|
9023
|
+
setMonth({
|
|
9024
|
+
year: newYear,
|
|
9025
|
+
month: newMonth
|
|
9026
|
+
});
|
|
9027
|
+
};
|
|
9028
|
+
React.useImperativeHandle(ref, () => {
|
|
9029
|
+
return {
|
|
9030
|
+
jump,
|
|
9031
|
+
jumpTo
|
|
9032
|
+
};
|
|
9033
|
+
});
|
|
9034
|
+
const handleDayClick = (day) => {
|
|
9035
|
+
if (day.type === "prev" || day.type === "next" || isDisable(day)) {
|
|
9036
|
+
return;
|
|
9037
|
+
}
|
|
9038
|
+
onDayClick == null ? void 0 : onDayClick(day);
|
|
9039
|
+
switch (type2) {
|
|
9040
|
+
case "single": {
|
|
9041
|
+
if (innerValue[0] && isSameDay(innerValue[0], day)) {
|
|
9042
|
+
change([]);
|
|
9043
|
+
} else {
|
|
9044
|
+
change([day]);
|
|
9045
|
+
}
|
|
9046
|
+
break;
|
|
9047
|
+
}
|
|
9048
|
+
case "multiple": {
|
|
9049
|
+
const t = innerValue.find((i) => isSameDay(i, day));
|
|
9050
|
+
if (t) {
|
|
9051
|
+
change(innerValue.filter((i) => i !== t));
|
|
9052
|
+
} else {
|
|
9053
|
+
change([...innerValue, day]);
|
|
9054
|
+
}
|
|
9055
|
+
break;
|
|
9056
|
+
}
|
|
9057
|
+
case "range": {
|
|
9058
|
+
const len = innerValue.length;
|
|
9059
|
+
if (len === 0 || len === 2) {
|
|
9060
|
+
change([day]);
|
|
9061
|
+
} else if (len === 1) {
|
|
9062
|
+
const t = compareDay(innerValue[0], day);
|
|
9063
|
+
if (t === 0 || t === null || t === void 0) {
|
|
9064
|
+
change([]);
|
|
9065
|
+
} else if (t < 0) {
|
|
9066
|
+
change([innerValue[0], day]);
|
|
9067
|
+
} else {
|
|
9068
|
+
change([day, innerValue[0]]);
|
|
9069
|
+
}
|
|
9070
|
+
} else {
|
|
9071
|
+
console.warn("[NutUI] Calendar range error");
|
|
9072
|
+
}
|
|
9073
|
+
break;
|
|
9074
|
+
}
|
|
9075
|
+
case "week": {
|
|
9076
|
+
if (innerValue.length === 2 || innerValue.length === 0) {
|
|
9077
|
+
const [left2, right2] = getCurrentWeekDays(day, firstDayOfWeek);
|
|
9078
|
+
change([left2, right2]);
|
|
9079
|
+
} else {
|
|
9080
|
+
console.warn("[NutUI] Calendar week error");
|
|
9081
|
+
}
|
|
9082
|
+
break;
|
|
9083
|
+
}
|
|
9084
|
+
default: {
|
|
9085
|
+
console.warn("[NutUI] Calendar type error");
|
|
9086
|
+
}
|
|
9087
|
+
}
|
|
9088
|
+
};
|
|
9089
|
+
const monthTitle = locale.calendaritem.monthTitle;
|
|
9090
|
+
const renderHeader = () => {
|
|
9091
|
+
return /* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard-header" }, /* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard-header-left" }, /* @__PURE__ */ React.createElement("div", { className: "double-left", onClick: () => jump(-12) }, /* @__PURE__ */ React.createElement(DoubleLeft, null)), /* @__PURE__ */ React.createElement("div", { className: "left", onClick: () => jump(-1) }, /* @__PURE__ */ React.createElement(Left, null))), /* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard-header-title" }, monthTitle(month.year, month.month)), /* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard-header-right" }, /* @__PURE__ */ React.createElement("div", { className: "right", onClick: () => jump(1) }, /* @__PURE__ */ React.createElement(Right, null)), /* @__PURE__ */ React.createElement("div", { className: "double-right", onClick: () => jump(12) }, /* @__PURE__ */ React.createElement(DoubleRight, null))));
|
|
9092
|
+
};
|
|
9093
|
+
const [weekHeader] = React.useState(() => {
|
|
9094
|
+
const weekdays = locale.calendaritem.weekdays.map((day, index) => {
|
|
9095
|
+
return {
|
|
9096
|
+
name: day,
|
|
9097
|
+
key: index
|
|
9098
|
+
};
|
|
9099
|
+
});
|
|
9100
|
+
return [
|
|
9101
|
+
...weekdays.slice(firstDayOfWeek, 7),
|
|
9102
|
+
...weekdays.slice(0, firstDayOfWeek)
|
|
9103
|
+
];
|
|
9104
|
+
});
|
|
9105
|
+
const renderContent = () => {
|
|
9106
|
+
return /* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard-content" }, /* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard-days" }, weekHeader.map((day) => {
|
|
9107
|
+
return /* @__PURE__ */ React.createElement(
|
|
9108
|
+
"div",
|
|
9109
|
+
{
|
|
9110
|
+
className: classNames("nut-calendarcard-day", "header", {
|
|
9111
|
+
weekend: day.key === 0 || day.key === 6
|
|
9112
|
+
}),
|
|
9113
|
+
key: day.key
|
|
9114
|
+
},
|
|
9115
|
+
day.name
|
|
9116
|
+
);
|
|
9117
|
+
})), /* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard-days" }, days.map((day) => /* @__PURE__ */ React.createElement(
|
|
9118
|
+
"div",
|
|
9119
|
+
{
|
|
9120
|
+
className: classNames(
|
|
9121
|
+
"nut-calendarcard-day",
|
|
9122
|
+
day.type,
|
|
9123
|
+
getClasses(day)
|
|
9124
|
+
),
|
|
9125
|
+
key: `${day.year}-${day.month}-${day.date}`,
|
|
9126
|
+
onClick: () => handleDayClick(day)
|
|
9127
|
+
},
|
|
9128
|
+
/* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard-day-top" }, renderDayTop ? renderDayTop(day) : ""),
|
|
9129
|
+
/* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard-day-inner" }, renderDay ? renderDay(day) : day.date),
|
|
9130
|
+
/* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard-day-bottom" }, renderDayBottom ? renderDayBottom(day) : "")
|
|
9131
|
+
))));
|
|
9132
|
+
};
|
|
9133
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "nut-calendarcard", style }, renderHeader(), renderContent()));
|
|
9134
|
+
});
|
|
9135
|
+
CalendarCard.defaultProps = defaultProps$11;
|
|
9136
|
+
CalendarCard.displayName = "NutCalendarCard";
|
|
8613
9137
|
const CheckboxGroupContext = React.createContext(null);
|
|
8614
9138
|
const Context$1 = CheckboxGroupContext;
|
|
8615
9139
|
const defaultProps$10 = {
|
|
@@ -8833,84 +9357,6 @@ var __publicField = (obj, key, value) => {
|
|
|
8833
9357
|
Checkbox.defaultProps = defaultProps$$;
|
|
8834
9358
|
Checkbox.displayName = "NutCheckBox";
|
|
8835
9359
|
Checkbox.Group = CheckboxGroup;
|
|
8836
|
-
const MIN_DISTANCE = 10;
|
|
8837
|
-
function getDirection(x, y2) {
|
|
8838
|
-
if (x > y2 && x > MIN_DISTANCE) {
|
|
8839
|
-
return "horizontal";
|
|
8840
|
-
}
|
|
8841
|
-
if (y2 > x && y2 > MIN_DISTANCE) {
|
|
8842
|
-
return "vertical";
|
|
8843
|
-
}
|
|
8844
|
-
return "";
|
|
8845
|
-
}
|
|
8846
|
-
function useTouch() {
|
|
8847
|
-
const [startX, SetStartX] = React.useState(0);
|
|
8848
|
-
const [startY, SetStartY] = React.useState(0);
|
|
8849
|
-
const [moveX, SetMoveX] = React.useState(0);
|
|
8850
|
-
const [moveY, SetMoveY] = React.useState(0);
|
|
8851
|
-
const [deltaX, SetDeltaX] = React.useState(0);
|
|
8852
|
-
const [deltaY, SetDeltaY] = React.useState(0);
|
|
8853
|
-
const [offsetX, SetOffsetX] = React.useState(0);
|
|
8854
|
-
const [offsetY, SetOffsetY] = React.useState(0);
|
|
8855
|
-
const [direction, SetDirection] = React.useState("");
|
|
8856
|
-
const isVertical = () => direction === "vertical";
|
|
8857
|
-
const isHorizontal = () => direction === "horizontal";
|
|
8858
|
-
const reset = () => {
|
|
8859
|
-
SetDeltaX(0);
|
|
8860
|
-
SetDeltaY(0);
|
|
8861
|
-
SetOffsetX(0);
|
|
8862
|
-
SetOffsetY(0);
|
|
8863
|
-
SetDirection("");
|
|
8864
|
-
};
|
|
8865
|
-
const start = (event) => {
|
|
8866
|
-
reset();
|
|
8867
|
-
SetStartX(event.touches[0].clientX);
|
|
8868
|
-
SetStartY(event.touches[0].clientY);
|
|
8869
|
-
};
|
|
8870
|
-
const move = (event) => {
|
|
8871
|
-
const touch = event.touches[0];
|
|
8872
|
-
const dX = touch.clientX - startX;
|
|
8873
|
-
const dY = touch.clientY - startY;
|
|
8874
|
-
SetDeltaX(dX);
|
|
8875
|
-
SetDeltaY(dY);
|
|
8876
|
-
SetMoveX(touch.clientX);
|
|
8877
|
-
SetMoveY(touch.clientY);
|
|
8878
|
-
SetOffsetX(Math.abs(dX));
|
|
8879
|
-
SetOffsetY(Math.abs(dY));
|
|
8880
|
-
if (!direction) {
|
|
8881
|
-
SetDirection(getDirection(offsetX, offsetY));
|
|
8882
|
-
}
|
|
8883
|
-
};
|
|
8884
|
-
return {
|
|
8885
|
-
move,
|
|
8886
|
-
start,
|
|
8887
|
-
reset,
|
|
8888
|
-
startX,
|
|
8889
|
-
startY,
|
|
8890
|
-
moveX,
|
|
8891
|
-
moveY,
|
|
8892
|
-
deltaX,
|
|
8893
|
-
deltaY,
|
|
8894
|
-
offsetX,
|
|
8895
|
-
offsetY,
|
|
8896
|
-
direction,
|
|
8897
|
-
isVertical,
|
|
8898
|
-
isHorizontal
|
|
8899
|
-
};
|
|
8900
|
-
}
|
|
8901
|
-
let passiveSupported = false;
|
|
8902
|
-
if (canUseDom) {
|
|
8903
|
-
try {
|
|
8904
|
-
const opts = Object.defineProperty({}, "passive", {
|
|
8905
|
-
get() {
|
|
8906
|
-
passiveSupported = true;
|
|
8907
|
-
}
|
|
8908
|
-
});
|
|
8909
|
-
window.addEventListener("test-passive-supported", null, opts);
|
|
8910
|
-
} catch (e) {
|
|
8911
|
-
console.log(e);
|
|
8912
|
-
}
|
|
8913
|
-
}
|
|
8914
9360
|
const InternalPickerPanel = (props, ref) => {
|
|
8915
9361
|
const {
|
|
8916
9362
|
keyIndex = 0,
|
|
@@ -8934,7 +9380,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8934
9380
|
let timer;
|
|
8935
9381
|
const listRef = React.useRef(null);
|
|
8936
9382
|
const rollerRef = React.useRef(null);
|
|
8937
|
-
const
|
|
9383
|
+
const pickerPanelRef = React.useRef(null);
|
|
8938
9384
|
const [startTime, setStartTime] = React.useState(0);
|
|
8939
9385
|
const [startY, setStartY] = React.useState(0);
|
|
8940
9386
|
const transformY = React.useRef(0);
|
|
@@ -8980,11 +9426,11 @@ var __publicField = (obj, key, value) => {
|
|
|
8980
9426
|
}
|
|
8981
9427
|
};
|
|
8982
9428
|
const setChooseValue = (move) => {
|
|
8983
|
-
chooseItem
|
|
9429
|
+
chooseItem == null ? void 0 : chooseItem(options == null ? void 0 : options[Math.round(-move / lineSpacing.current)], keyIndex);
|
|
8984
9430
|
};
|
|
8985
9431
|
const touchStart = (event) => {
|
|
8986
9432
|
touch.start(event);
|
|
8987
|
-
setStartY(touch.deltaY);
|
|
9433
|
+
setStartY(touch.deltaY.current);
|
|
8988
9434
|
setStartTime(Date.now());
|
|
8989
9435
|
transformY.current = scrollDistance;
|
|
8990
9436
|
};
|
|
@@ -8994,13 +9440,13 @@ var __publicField = (obj, key, value) => {
|
|
|
8994
9440
|
moving.current = true;
|
|
8995
9441
|
preventDefault2(event, true);
|
|
8996
9442
|
}
|
|
8997
|
-
const move = touch.deltaY - startY;
|
|
9443
|
+
const move = touch.deltaY.current - startY;
|
|
8998
9444
|
setMove(move);
|
|
8999
9445
|
};
|
|
9000
9446
|
const touchEnd = () => {
|
|
9001
9447
|
if (!moving.current)
|
|
9002
9448
|
return;
|
|
9003
|
-
const move = touch.deltaY - startY;
|
|
9449
|
+
const move = touch.deltaY.current - startY;
|
|
9004
9450
|
const moveTime = Date.now() - startTime;
|
|
9005
9451
|
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
9006
9452
|
const distance = momentum(move, moveTime);
|
|
@@ -9047,9 +9493,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9047
9493
|
setChooseValue(scrollDistance);
|
|
9048
9494
|
};
|
|
9049
9495
|
const preventDefault2 = (event, isStopPropagation) => {
|
|
9050
|
-
|
|
9051
|
-
event.preventDefault();
|
|
9052
|
-
}
|
|
9496
|
+
event.preventDefault();
|
|
9053
9497
|
if (isStopPropagation) {
|
|
9054
9498
|
event.stopPropagation();
|
|
9055
9499
|
}
|
|
@@ -9090,56 +9534,56 @@ var __publicField = (obj, key, value) => {
|
|
|
9090
9534
|
stopMomentum,
|
|
9091
9535
|
moving: moving.current
|
|
9092
9536
|
}));
|
|
9093
|
-
|
|
9537
|
+
React.useEffect(() => {
|
|
9538
|
+
const eventOptions = passiveSupported ? { passive: false, once: true } : false;
|
|
9539
|
+
const element = pickerPanelRef.current;
|
|
9540
|
+
element.addEventListener("touchstart", touchStart, eventOptions);
|
|
9541
|
+
element.addEventListener("touchmove", touchMove, eventOptions);
|
|
9542
|
+
element.addEventListener("touchend", touchEnd, eventOptions);
|
|
9543
|
+
return () => {
|
|
9544
|
+
element.removeEventListener("touchstart", touchStart, eventOptions);
|
|
9545
|
+
element.removeEventListener("touchmove", touchMove, eventOptions);
|
|
9546
|
+
element.removeEventListener("touchend", touchEnd, eventOptions);
|
|
9547
|
+
};
|
|
9548
|
+
});
|
|
9549
|
+
return /* @__PURE__ */ React.createElement("div", { className: "nut-picker-list", ref: pickerPanelRef }, /* @__PURE__ */ React.createElement(
|
|
9094
9550
|
"div",
|
|
9095
9551
|
{
|
|
9096
|
-
className: "nut-picker-
|
|
9097
|
-
ref:
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
onTouchEnd: touchEnd
|
|
9552
|
+
className: "nut-picker-roller",
|
|
9553
|
+
ref: rollerRef,
|
|
9554
|
+
style: threeDimensional ? touchRollerStyle() : touchTileStyle(),
|
|
9555
|
+
onTransitionEnd: stopMomentum
|
|
9101
9556
|
},
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
return /* @__PURE__ */ React.createElement(
|
|
9112
|
-
"div",
|
|
9113
|
-
{
|
|
9114
|
-
className: `nut-picker-roller-item ${isHidden(index + 1) && "nut-picker-roller-item-hidden"}`,
|
|
9115
|
-
style: {
|
|
9116
|
-
transform: `rotate3d(1, 0, 0, ${-rotation * (index + 1)}deg) translate3d(0px, 0px, 104px)`,
|
|
9117
|
-
height: `${lineSpacing.current}px`,
|
|
9118
|
-
lineHeight: `${lineSpacing.current}px`
|
|
9119
|
-
},
|
|
9120
|
-
key: item.value ? item.value : index
|
|
9121
|
-
},
|
|
9122
|
-
/* @__PURE__ */ React.createElement(React.Fragment, null, item.text ? item.text : item)
|
|
9123
|
-
);
|
|
9124
|
-
}),
|
|
9125
|
-
!threeDimensional && options.map((item, index) => {
|
|
9126
|
-
return /* @__PURE__ */ React.createElement(
|
|
9127
|
-
"div",
|
|
9128
|
-
{
|
|
9129
|
-
className: "nut-picker-roller-item-title",
|
|
9130
|
-
key: item.value ? item.value : index,
|
|
9131
|
-
style: {
|
|
9132
|
-
height: `${lineSpacing.current}px`,
|
|
9133
|
-
lineHeight: `${lineSpacing.current}px`
|
|
9134
|
-
}
|
|
9557
|
+
threeDimensional && options.map((item, index) => {
|
|
9558
|
+
return /* @__PURE__ */ React.createElement(
|
|
9559
|
+
"div",
|
|
9560
|
+
{
|
|
9561
|
+
className: `nut-picker-roller-item ${isHidden(index + 1) && "nut-picker-roller-item-hidden"}`,
|
|
9562
|
+
style: {
|
|
9563
|
+
transform: `rotate3d(1, 0, 0, ${-rotation * (index + 1)}deg) translate3d(0px, 0px, 104px)`,
|
|
9564
|
+
height: `${lineSpacing.current}px`,
|
|
9565
|
+
lineHeight: `${lineSpacing.current}px`
|
|
9135
9566
|
},
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9567
|
+
key: item.value ? item.value : index
|
|
9568
|
+
},
|
|
9569
|
+
/* @__PURE__ */ React.createElement(React.Fragment, null, item.text ? item.text : item)
|
|
9570
|
+
);
|
|
9571
|
+
}),
|
|
9572
|
+
!threeDimensional && options.map((item, index) => {
|
|
9573
|
+
return /* @__PURE__ */ React.createElement(
|
|
9574
|
+
"div",
|
|
9575
|
+
{
|
|
9576
|
+
className: "nut-picker-roller-item-title",
|
|
9577
|
+
key: item.value ? item.value : index,
|
|
9578
|
+
style: {
|
|
9579
|
+
height: `${lineSpacing.current}px`,
|
|
9580
|
+
lineHeight: `${lineSpacing.current}px`
|
|
9581
|
+
}
|
|
9582
|
+
},
|
|
9583
|
+
/* @__PURE__ */ React.createElement(React.Fragment, null, item.text ? item.text : item)
|
|
9584
|
+
);
|
|
9585
|
+
})
|
|
9586
|
+
), /* @__PURE__ */ React.createElement("div", { className: "nut-picker-mask" }), /* @__PURE__ */ React.createElement("div", { className: "nut-picker-indicator", ref: listRef }));
|
|
9143
9587
|
};
|
|
9144
9588
|
const PickerPanel = React.forwardRef(InternalPickerPanel);
|
|
9145
9589
|
const PickerPanel$1 = PickerPanel;
|
|
@@ -9174,6 +9618,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9174
9618
|
visible,
|
|
9175
9619
|
title,
|
|
9176
9620
|
options = [],
|
|
9621
|
+
popupProps = {},
|
|
9177
9622
|
defaultValue = [],
|
|
9178
9623
|
className,
|
|
9179
9624
|
style,
|
|
@@ -9430,6 +9875,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9430
9875
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, typeof children === "function" && children(selectedValue), /* @__PURE__ */ React.createElement(
|
|
9431
9876
|
Popup,
|
|
9432
9877
|
{
|
|
9878
|
+
...popupProps,
|
|
9433
9879
|
visible: innerVisible,
|
|
9434
9880
|
position: "bottom",
|
|
9435
9881
|
afterClose: () => {
|
|
@@ -9502,6 +9948,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9502
9948
|
visible,
|
|
9503
9949
|
title,
|
|
9504
9950
|
defaultValue,
|
|
9951
|
+
pickerProps = {},
|
|
9505
9952
|
formatter,
|
|
9506
9953
|
onClose,
|
|
9507
9954
|
onConfirm,
|
|
@@ -9782,6 +10229,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9782
10229
|
options.length && /* @__PURE__ */ React.createElement(
|
|
9783
10230
|
Picker$1,
|
|
9784
10231
|
{
|
|
10232
|
+
...pickerProps,
|
|
9785
10233
|
title,
|
|
9786
10234
|
visible,
|
|
9787
10235
|
options,
|
|
@@ -12605,12 +13053,12 @@ var __publicField = (obj, key, value) => {
|
|
|
12605
13053
|
const value2 = min + delta / total * scope();
|
|
12606
13054
|
setEaxctValue(current);
|
|
12607
13055
|
if (isRange(current)) {
|
|
12608
|
-
const [
|
|
12609
|
-
const middle = (
|
|
13056
|
+
const [left2, right2] = current;
|
|
13057
|
+
const middle = (left2 + right2) / 2;
|
|
12610
13058
|
if (value2 <= middle) {
|
|
12611
|
-
updateValue([value2,
|
|
13059
|
+
updateValue([value2, right2], true);
|
|
12612
13060
|
} else {
|
|
12613
|
-
updateValue([
|
|
13061
|
+
updateValue([left2, value2], true);
|
|
12614
13062
|
}
|
|
12615
13063
|
} else {
|
|
12616
13064
|
updateValue(value2, true);
|
|
@@ -12639,11 +13087,11 @@ var __publicField = (obj, key, value) => {
|
|
|
12639
13087
|
touch.move(event);
|
|
12640
13088
|
setDragStatus("draging");
|
|
12641
13089
|
const rect = await getRectByTaro(root2.current);
|
|
12642
|
-
let delta = touch.deltaX;
|
|
13090
|
+
let delta = touch.deltaX.current;
|
|
12643
13091
|
let total = rect.width;
|
|
12644
13092
|
let diff = delta / total * scope();
|
|
12645
13093
|
if (vertical) {
|
|
12646
|
-
delta = touch.deltaY;
|
|
13094
|
+
delta = touch.deltaY.current;
|
|
12647
13095
|
total = rect.height;
|
|
12648
13096
|
diff = delta / total * scope();
|
|
12649
13097
|
}
|
|
@@ -12866,8 +13314,8 @@ var __publicField = (obj, key, value) => {
|
|
|
12866
13314
|
clearable,
|
|
12867
13315
|
readOnly,
|
|
12868
13316
|
autoFocus,
|
|
12869
|
-
right,
|
|
12870
|
-
left,
|
|
13317
|
+
right: right2,
|
|
13318
|
+
left: left2,
|
|
12871
13319
|
leftIn,
|
|
12872
13320
|
rightIn,
|
|
12873
13321
|
onChange,
|
|
@@ -12885,10 +13333,11 @@ var __publicField = (obj, key, value) => {
|
|
|
12885
13333
|
searchSelf && searchSelf.focus();
|
|
12886
13334
|
};
|
|
12887
13335
|
const change = (event) => {
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
13336
|
+
if (value === event.target.value)
|
|
13337
|
+
return;
|
|
13338
|
+
onChange && (onChange == null ? void 0 : onChange(event.target.value, event));
|
|
13339
|
+
setValue(event.target.value);
|
|
13340
|
+
event.target.value === "" && forceFocus();
|
|
12892
13341
|
};
|
|
12893
13342
|
const focus = (event) => {
|
|
12894
13343
|
const { value: value2 } = event.target;
|
|
@@ -12901,7 +13350,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12901
13350
|
onBlur && (onBlur == null ? void 0 : onBlur(value2, event));
|
|
12902
13351
|
};
|
|
12903
13352
|
React.useEffect(() => {
|
|
12904
|
-
setValue(props.value);
|
|
13353
|
+
setValue(props.value || "");
|
|
12905
13354
|
}, [props.value]);
|
|
12906
13355
|
React.useEffect(() => {
|
|
12907
13356
|
autoFocus && forceFocus();
|
|
@@ -12935,9 +13384,9 @@ var __publicField = (obj, key, value) => {
|
|
|
12935
13384
|
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__leftin ${classPrefix2}__icon` }, leftIn);
|
|
12936
13385
|
};
|
|
12937
13386
|
const renderLeft = () => {
|
|
12938
|
-
if (!
|
|
13387
|
+
if (!left2)
|
|
12939
13388
|
return null;
|
|
12940
|
-
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__left` },
|
|
13389
|
+
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__left` }, left2);
|
|
12941
13390
|
};
|
|
12942
13391
|
const renderRightIn = () => {
|
|
12943
13392
|
if (!rightIn)
|
|
@@ -12945,9 +13394,9 @@ var __publicField = (obj, key, value) => {
|
|
|
12945
13394
|
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__rightin ${classPrefix2}__icon` }, rightIn);
|
|
12946
13395
|
};
|
|
12947
13396
|
const renderRight = () => {
|
|
12948
|
-
if (!
|
|
13397
|
+
if (!right2)
|
|
12949
13398
|
return null;
|
|
12950
|
-
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__right` },
|
|
13399
|
+
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__right` }, right2);
|
|
12951
13400
|
};
|
|
12952
13401
|
const handleClear = () => {
|
|
12953
13402
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -12964,8 +13413,8 @@ var __publicField = (obj, key, value) => {
|
|
|
12964
13413
|
return;
|
|
12965
13414
|
}
|
|
12966
13415
|
setValue("");
|
|
12967
|
-
onClear && onClear(event);
|
|
12968
13416
|
forceFocus();
|
|
13417
|
+
onClear && onClear(event);
|
|
12969
13418
|
};
|
|
12970
13419
|
const onKeypress = (e) => {
|
|
12971
13420
|
if (e.key === "Enter" || e.keyCode === 13) {
|
|
@@ -14297,6 +14746,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14297
14746
|
}
|
|
14298
14747
|
}
|
|
14299
14748
|
);
|
|
14749
|
+
const refObject = useLockScrollTaro(!!(visible && lockScroll));
|
|
14300
14750
|
const renderFooter = () => {
|
|
14301
14751
|
if (footer === null)
|
|
14302
14752
|
return "";
|
|
@@ -14349,6 +14799,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14349
14799
|
components.View,
|
|
14350
14800
|
{
|
|
14351
14801
|
style: { display: visible ? "block" : "none" },
|
|
14802
|
+
ref: refObject,
|
|
14352
14803
|
catchMove: lockScroll
|
|
14353
14804
|
},
|
|
14354
14805
|
/* @__PURE__ */ React.createElement(React.Fragment, null, overlay ? /* @__PURE__ */ React.createElement(
|
|
@@ -14427,14 +14878,14 @@ var __publicField = (obj, key, value) => {
|
|
|
14427
14878
|
const getInfo = () => {
|
|
14428
14879
|
const el = myDrag.current;
|
|
14429
14880
|
if (el) {
|
|
14430
|
-
const { top, left, bottom, right } = boundary;
|
|
14881
|
+
const { top, left: left2, bottom, right: right2 } = boundary;
|
|
14431
14882
|
const { screenWidth, windowHeight } = Taro.getSystemInfoSync();
|
|
14432
14883
|
Taro.createSelectorQuery().select(`.${className}`).boundingClientRect((rec) => {
|
|
14433
14884
|
setBoundaryState({
|
|
14434
14885
|
top: -rec.top + top,
|
|
14435
|
-
left: -rec.left +
|
|
14886
|
+
left: -rec.left + left2,
|
|
14436
14887
|
bottom: windowHeight - rec.height - rec.top - bottom,
|
|
14437
|
-
right: screenWidth - rec.width - rec.left -
|
|
14888
|
+
right: screenWidth - rec.width - rec.left - right2
|
|
14438
14889
|
});
|
|
14439
14890
|
middleLine.current = screenWidth - rec.width - rec.left - (screenWidth - rec.width) / 2;
|
|
14440
14891
|
}).exec();
|
|
@@ -14828,9 +15279,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14828
15279
|
scrollList.current = [].concat(childs);
|
|
14829
15280
|
} else {
|
|
14830
15281
|
scrollList.current = [].concat(list);
|
|
14831
|
-
|
|
14832
|
-
startRollEasy();
|
|
14833
|
-
}, Number(duration));
|
|
15282
|
+
startRollEasy();
|
|
14834
15283
|
}
|
|
14835
15284
|
} else {
|
|
14836
15285
|
initScrollWrap();
|
|
@@ -14959,11 +15408,9 @@ var __publicField = (obj, key, value) => {
|
|
|
14959
15408
|
}, [ready]);
|
|
14960
15409
|
React.useEffect(() => {
|
|
14961
15410
|
if (isVertical && children) {
|
|
14962
|
-
|
|
14963
|
-
|
|
14964
|
-
|
|
14965
|
-
autoplay();
|
|
14966
|
-
}, 300);
|
|
15411
|
+
init();
|
|
15412
|
+
stopAutoPlay();
|
|
15413
|
+
autoplay();
|
|
14967
15414
|
}
|
|
14968
15415
|
}, [children, container == null ? void 0 : container.current]);
|
|
14969
15416
|
const stopAutoPlay = () => {
|
|
@@ -15016,6 +15463,9 @@ var __publicField = (obj, key, value) => {
|
|
|
15016
15463
|
};
|
|
15017
15464
|
const getStyle = (moveOffset = offset) => {
|
|
15018
15465
|
const target = innerRef.current;
|
|
15466
|
+
if (!target) {
|
|
15467
|
+
return;
|
|
15468
|
+
}
|
|
15019
15469
|
let _offset = 0;
|
|
15020
15470
|
const val = ((rect == null ? void 0 : rect.height) || 0) - height;
|
|
15021
15471
|
_offset = moveOffset + Number(active === childCount - 1 && val / 2);
|
|
@@ -15361,7 +15811,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15361
15811
|
}
|
|
15362
15812
|
const contentWidth = elWidth;
|
|
15363
15813
|
const contentHeight = elHeight;
|
|
15364
|
-
const { width, height, left, top, right } = rootPosition;
|
|
15814
|
+
const { width, height, left: left2, top, right: right2 } = rootPosition;
|
|
15365
15815
|
const direction = location.split("-")[0];
|
|
15366
15816
|
const skew = location.split("-")[1];
|
|
15367
15817
|
let cross = 0;
|
|
@@ -15375,18 +15825,18 @@ var __publicField = (obj, key, value) => {
|
|
|
15375
15825
|
const h = direction === "bottom" ? height + cross : -(contentHeight + cross);
|
|
15376
15826
|
styles.top = `${top + h}px`;
|
|
15377
15827
|
if (!skew) {
|
|
15378
|
-
styles.left = `${-(contentWidth - width) / 2 +
|
|
15828
|
+
styles.left = `${-(contentWidth - width) / 2 + left2 + parallel}px`;
|
|
15379
15829
|
}
|
|
15380
15830
|
if (skew === "start") {
|
|
15381
|
-
styles.left = `${
|
|
15831
|
+
styles.left = `${left2 + parallel}px`;
|
|
15382
15832
|
}
|
|
15383
15833
|
if (skew === "end") {
|
|
15384
|
-
styles.left = `${
|
|
15834
|
+
styles.left = `${right2 + parallel}px`;
|
|
15385
15835
|
}
|
|
15386
15836
|
}
|
|
15387
15837
|
if (["left", "right"].includes(direction)) {
|
|
15388
15838
|
const contentW = direction === "left" ? -(contentWidth + cross) : width + cross;
|
|
15389
|
-
styles.left = `${
|
|
15839
|
+
styles.left = `${left2 + contentW}px`;
|
|
15390
15840
|
if (!skew) {
|
|
15391
15841
|
styles.top = `${top - contentHeight / 2 + height / 2 - 4 + parallel}px`;
|
|
15392
15842
|
}
|
|
@@ -15584,7 +16034,13 @@ var __publicField = (obj, key, value) => {
|
|
|
15584
16034
|
pullingRef.current = true;
|
|
15585
16035
|
setHeight(
|
|
15586
16036
|
Math.max(
|
|
15587
|
-
rubberbandIfOutOfBounds(
|
|
16037
|
+
rubberbandIfOutOfBounds(
|
|
16038
|
+
touch.deltaY.current,
|
|
16039
|
+
0,
|
|
16040
|
+
0,
|
|
16041
|
+
headHeight * 5,
|
|
16042
|
+
0.5
|
|
16043
|
+
),
|
|
15588
16044
|
0
|
|
15589
16045
|
)
|
|
15590
16046
|
);
|
|
@@ -15898,6 +16354,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15898
16354
|
const leftWidth = actionWidth.left;
|
|
15899
16355
|
const rightWidth = actionWidth.right;
|
|
15900
16356
|
const onTouchStart = async (event) => {
|
|
16357
|
+
var _a;
|
|
15901
16358
|
if (leftWrapper.current) {
|
|
15902
16359
|
const leftRect = await getRectByTaro(leftWrapper.current);
|
|
15903
16360
|
setActionWidth((v) => ({ ...v, left: leftRect.width }));
|
|
@@ -15909,24 +16366,26 @@ var __publicField = (obj, key, value) => {
|
|
|
15909
16366
|
if (!props.disabled) {
|
|
15910
16367
|
startOffset.current = state.offset;
|
|
15911
16368
|
touch.start(event);
|
|
15912
|
-
props.onTouchStart
|
|
16369
|
+
(_a = props.onTouchStart) == null ? void 0 : _a.call(props, event);
|
|
15913
16370
|
}
|
|
15914
16371
|
};
|
|
15915
16372
|
const onTouchMove = (event) => {
|
|
16373
|
+
var _a;
|
|
15916
16374
|
if (props.disabled) {
|
|
15917
16375
|
return;
|
|
15918
16376
|
}
|
|
15919
16377
|
touch.move(event);
|
|
16378
|
+
(_a = props.onTouchMove) == null ? void 0 : _a.call(props, event);
|
|
15920
16379
|
if (touch.isHorizontal()) {
|
|
15921
16380
|
lockClick.current = true;
|
|
15922
16381
|
props.onTouchMove && props.onTouchMove(event);
|
|
15923
16382
|
const newState = { ...state, dragging: true };
|
|
15924
|
-
const isEdge = !opened || touch.deltaX * startOffset.current < 0;
|
|
16383
|
+
const isEdge = !opened || touch.deltaX.current * startOffset.current < 0;
|
|
15925
16384
|
if (isEdge) {
|
|
15926
16385
|
preventDefault(event, true);
|
|
15927
16386
|
}
|
|
15928
16387
|
newState.offset = rangeCalculation(
|
|
15929
|
-
touch.deltaX + startOffset.current,
|
|
16388
|
+
touch.deltaX.current + startOffset.current,
|
|
15930
16389
|
-rightWidth || 0,
|
|
15931
16390
|
leftWidth || 0
|
|
15932
16391
|
);
|
|
@@ -15934,13 +16393,14 @@ var __publicField = (obj, key, value) => {
|
|
|
15934
16393
|
}
|
|
15935
16394
|
};
|
|
15936
16395
|
const onTouchEnd = (event) => {
|
|
16396
|
+
var _a;
|
|
15937
16397
|
if (state.dragging) {
|
|
15938
16398
|
setState((v) => ({ ...v, dragging: false }));
|
|
15939
16399
|
toggle(state.offset > 0 ? "left" : "right");
|
|
15940
16400
|
setTimeout(() => {
|
|
15941
16401
|
lockClick.current = false;
|
|
15942
16402
|
}, 0);
|
|
15943
|
-
props.onTouchEnd
|
|
16403
|
+
(_a = props.onTouchEnd) == null ? void 0 : _a.call(props, event);
|
|
15944
16404
|
}
|
|
15945
16405
|
};
|
|
15946
16406
|
const toggle = (side) => {
|
|
@@ -15993,11 +16453,12 @@ var __publicField = (obj, key, value) => {
|
|
|
15993
16453
|
return null;
|
|
15994
16454
|
};
|
|
15995
16455
|
const handleOperate = (event, position) => {
|
|
16456
|
+
var _a;
|
|
15996
16457
|
event.stopPropagation();
|
|
15997
16458
|
if (props.beforeClose) {
|
|
15998
16459
|
props.beforeClose(position);
|
|
15999
16460
|
} else {
|
|
16000
|
-
props.onActionClick
|
|
16461
|
+
(_a = props.onActionClick) == null ? void 0 : _a.call(props, event, position);
|
|
16001
16462
|
}
|
|
16002
16463
|
};
|
|
16003
16464
|
React.useImperativeHandle(instanceRef, () => ({
|
|
@@ -17303,13 +17764,13 @@ var __publicField = (obj, key, value) => {
|
|
|
17303
17764
|
const newContent = `${((_a2 = ellipsis.current) == null ? void 0 : _a2.leading) || ""}${((_b2 = ellipsis.current) == null ? void 0 : _b2.leading) ? symbol : ""}${expandText || ""}${((_c2 = ellipsis.current) == null ? void 0 : _c2.tailing) ? symbol : ""}${((_d2 = ellipsis.current) == null ? void 0 : _d2.tailing) || ""}`;
|
|
17304
17765
|
setContentCopy(newContent);
|
|
17305
17766
|
};
|
|
17306
|
-
const tailorContent = (
|
|
17767
|
+
const tailorContent = (left2, right2, type2 = "") => {
|
|
17307
17768
|
const threeDotWidth = symbolTextWidth;
|
|
17308
17769
|
const direc = direction === "middle" && type2 ? type2 : direction;
|
|
17309
17770
|
setExceeded(true);
|
|
17310
17771
|
let widthPart = -1;
|
|
17311
|
-
const start =
|
|
17312
|
-
const end =
|
|
17772
|
+
const start = left2;
|
|
17773
|
+
const end = right2;
|
|
17313
17774
|
let cutoff = 0;
|
|
17314
17775
|
let marking = 0;
|
|
17315
17776
|
if (direc === "end") {
|
|
@@ -18508,8 +18969,8 @@ var __publicField = (obj, key, value) => {
|
|
|
18508
18969
|
});
|
|
18509
18970
|
};
|
|
18510
18971
|
const maskStyle = () => {
|
|
18511
|
-
const { width, height, left, top } = maskRect;
|
|
18512
|
-
const center = [
|
|
18972
|
+
const { width, height, left: left2, top } = maskRect;
|
|
18973
|
+
const center = [left2 + width / 2, top + height / 2];
|
|
18513
18974
|
const w2 = Number(maskWidth || width);
|
|
18514
18975
|
const h = Number(maskHeight || height);
|
|
18515
18976
|
const styles = {
|
|
@@ -19229,7 +19690,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19229
19690
|
digits,
|
|
19230
19691
|
symbol,
|
|
19231
19692
|
zero,
|
|
19232
|
-
left,
|
|
19693
|
+
left: left2,
|
|
19233
19694
|
sync,
|
|
19234
19695
|
color,
|
|
19235
19696
|
riseColor,
|
|
@@ -19275,8 +19736,8 @@ var __publicField = (obj, key, value) => {
|
|
|
19275
19736
|
};
|
|
19276
19737
|
return iconProps;
|
|
19277
19738
|
})();
|
|
19278
|
-
const renderContent = (
|
|
19279
|
-
const classNameSuffix = !
|
|
19739
|
+
const renderContent = (left22) => {
|
|
19740
|
+
const classNameSuffix = !left22 ? "icon-after" : "icon-before";
|
|
19280
19741
|
return /* @__PURE__ */ React.createElement(
|
|
19281
19742
|
"span",
|
|
19282
19743
|
{
|
|
@@ -19286,7 +19747,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19286
19747
|
calcRate
|
|
19287
19748
|
);
|
|
19288
19749
|
};
|
|
19289
|
-
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, !
|
|
19750
|
+
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, !left2 && renderContent(!left2), Number(value) !== 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, rateTrend.current ? /* @__PURE__ */ React.createElement(React.Fragment, null, riseIcon || /* @__PURE__ */ React.createElement(a, { color: calcIconProps.color })) : /* @__PURE__ */ React.createElement(React.Fragment, null, dropIcon || /* @__PURE__ */ React.createElement(a$1, { color: calcIconProps.color }))), left2 && renderContent(!left2));
|
|
19290
19751
|
};
|
|
19291
19752
|
TrendArrow.defaultProps = defaultProps$1;
|
|
19292
19753
|
TrendArrow.displayName = "NutTrendArrow";
|
|
@@ -19433,6 +19894,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19433
19894
|
exports2.Barrage = Barrage;
|
|
19434
19895
|
exports2.Button = Button;
|
|
19435
19896
|
exports2.Calendar = Calendar;
|
|
19897
|
+
exports2.CalendarCard = CalendarCard;
|
|
19436
19898
|
exports2.CalendarItem = CalendarItem;
|
|
19437
19899
|
exports2.Card = Card;
|
|
19438
19900
|
exports2.Cascader = Cascader;
|