@nutui/nutui-react-taro 2.0.22 → 2.0.23
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.es.js
CHANGED
|
@@ -5,12 +5,12 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
/*!
|
|
8
|
-
* @nutui/nutui-react-taro v2.0.
|
|
8
|
+
* @nutui/nutui-react-taro v2.0.23 Fri Nov 03 2023 19:33:54 GMT+0800 (中国标准时间)
|
|
9
9
|
* (c) 2023 @jdf2e.
|
|
10
10
|
* Released under the MIT License.
|
|
11
11
|
*/
|
|
12
12
|
import * as React from "react";
|
|
13
|
-
import React__default, { useCallback, createContext, useContext, useState,
|
|
13
|
+
import React__default, { useCallback, createContext, useContext, useState, useRef, useEffect, useMemo as useMemo$1, isValidElement, forwardRef, useImperativeHandle, Component, Children } from "react";
|
|
14
14
|
import Taro, { getEnv, createSelectorQuery, usePageScroll, getSystemInfoSync, pageScrollTo, nextTick, ENV_TYPE, canvasToTempFilePath, uploadFile, chooseMedia, chooseImage, Events, getCurrentInstance, useReady, createInnerAudioContext, getSystemInfo, createOffscreenCanvas } from "@tarojs/taro";
|
|
15
15
|
import { Image as Image$2, View, ScrollView, PickerView, PickerViewColumn, Input as Input$1, Textarea, Swiper as Swiper$1, SwiperItem as SwiperItem$1, Video as Video$1 } from "@tarojs/components";
|
|
16
16
|
import ReactDOM, { createPortal } from "react-dom";
|
|
@@ -1913,7 +1913,7 @@ const ComponentDefaults = {
|
|
|
1913
1913
|
style: {}
|
|
1914
1914
|
};
|
|
1915
1915
|
const prefixCls$1 = "nut-button";
|
|
1916
|
-
const defaultProps$
|
|
1916
|
+
const defaultProps$1v = {
|
|
1917
1917
|
...ComponentDefaults,
|
|
1918
1918
|
color: "",
|
|
1919
1919
|
type: "default",
|
|
@@ -1945,7 +1945,7 @@ const Button = React__default.forwardRef(
|
|
|
1945
1945
|
style,
|
|
1946
1946
|
...rest
|
|
1947
1947
|
} = {
|
|
1948
|
-
...defaultProps$
|
|
1948
|
+
...defaultProps$1v,
|
|
1949
1949
|
...props
|
|
1950
1950
|
};
|
|
1951
1951
|
const getStyle = useCallback(() => {
|
|
@@ -2004,7 +2004,7 @@ const Button = React__default.forwardRef(
|
|
|
2004
2004
|
);
|
|
2005
2005
|
Button.displayName = "NutButton";
|
|
2006
2006
|
const CellGroupContext = createContext(null);
|
|
2007
|
-
const defaultProps$
|
|
2007
|
+
const defaultProps$1u = {
|
|
2008
2008
|
...ComponentDefaults,
|
|
2009
2009
|
title: "",
|
|
2010
2010
|
description: "",
|
|
@@ -2013,7 +2013,7 @@ const defaultProps$1t = {
|
|
|
2013
2013
|
const classPrefix$p = "nut-cell-group";
|
|
2014
2014
|
const CellGroup = (props) => {
|
|
2015
2015
|
const { children, className, style, title, description, divider, ...rest } = {
|
|
2016
|
-
...defaultProps$
|
|
2016
|
+
...defaultProps$1u,
|
|
2017
2017
|
...props
|
|
2018
2018
|
};
|
|
2019
2019
|
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix$p, className), ...rest }, title ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$p}__title` }, title) : null, description ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$p}__description` }, description) : null, /* @__PURE__ */ React__default.createElement(
|
|
@@ -2024,9 +2024,9 @@ const CellGroup = (props) => {
|
|
|
2024
2024
|
/* @__PURE__ */ React__default.createElement(CellGroupContext.Provider, { value: { divider } }, children)
|
|
2025
2025
|
));
|
|
2026
2026
|
};
|
|
2027
|
-
CellGroup.defaultProps = defaultProps$
|
|
2027
|
+
CellGroup.defaultProps = defaultProps$1u;
|
|
2028
2028
|
CellGroup.displayName = "NutCellGroup";
|
|
2029
|
-
const defaultProps$
|
|
2029
|
+
const defaultProps$1t = {
|
|
2030
2030
|
...ComponentDefaults,
|
|
2031
2031
|
title: null,
|
|
2032
2032
|
description: null,
|
|
@@ -2051,7 +2051,7 @@ const Cell = (props) => {
|
|
|
2051
2051
|
style,
|
|
2052
2052
|
...rest
|
|
2053
2053
|
} = {
|
|
2054
|
-
...defaultProps$
|
|
2054
|
+
...defaultProps$1t,
|
|
2055
2055
|
...props
|
|
2056
2056
|
};
|
|
2057
2057
|
const handleClick = (event) => {
|
|
@@ -2084,7 +2084,7 @@ const Cell = (props) => {
|
|
|
2084
2084
|
(ctx == null ? void 0 : ctx.divider) ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$o}__divider` }) : null
|
|
2085
2085
|
);
|
|
2086
2086
|
};
|
|
2087
|
-
Cell.defaultProps = defaultProps$
|
|
2087
|
+
Cell.defaultProps = defaultProps$1t;
|
|
2088
2088
|
Cell.displayName = "NutCell";
|
|
2089
2089
|
Cell.Group = CellGroup;
|
|
2090
2090
|
var INFINITY = 1 / 0;
|
|
@@ -3225,7 +3225,7 @@ ConfigProvider.displayName = "NutConfigProvider";
|
|
|
3225
3225
|
const pxCheck = (value) => {
|
|
3226
3226
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
3227
3227
|
};
|
|
3228
|
-
const defaultProps$
|
|
3228
|
+
const defaultProps$1s = {
|
|
3229
3229
|
src: "",
|
|
3230
3230
|
error: true,
|
|
3231
3231
|
loading: true
|
|
@@ -3244,7 +3244,7 @@ const Image$1 = (props) => {
|
|
|
3244
3244
|
onLoad,
|
|
3245
3245
|
onError,
|
|
3246
3246
|
...rest
|
|
3247
|
-
} = { ...defaultProps$
|
|
3247
|
+
} = { ...defaultProps$1s, ...props };
|
|
3248
3248
|
const [innerLoading, setInnerLoading] = useState(true);
|
|
3249
3249
|
const [isError, setIsError] = useState(false);
|
|
3250
3250
|
const handleLoad = (e) => {
|
|
@@ -3304,7 +3304,7 @@ const Image$1 = (props) => {
|
|
|
3304
3304
|
}
|
|
3305
3305
|
), renderLoading(), renderErrorImg());
|
|
3306
3306
|
};
|
|
3307
|
-
Image$1.defaultProps = defaultProps$
|
|
3307
|
+
Image$1.defaultProps = defaultProps$1s;
|
|
3308
3308
|
Image$1.displayName = "NutImage";
|
|
3309
3309
|
function _extends$1() {
|
|
3310
3310
|
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
|
|
@@ -5047,6 +5047,178 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$1({},
|
|
|
5047
5047
|
onExited: propTypesExports.func
|
|
5048
5048
|
}) : {};
|
|
5049
5049
|
const CSSTransition$1 = CSSTransition;
|
|
5050
|
+
const MIN_DISTANCE = 10;
|
|
5051
|
+
function getDirection(x, y2) {
|
|
5052
|
+
if (x > y2 && x > MIN_DISTANCE) {
|
|
5053
|
+
return "horizontal";
|
|
5054
|
+
}
|
|
5055
|
+
if (y2 > x && y2 > MIN_DISTANCE) {
|
|
5056
|
+
return "vertical";
|
|
5057
|
+
}
|
|
5058
|
+
return "";
|
|
5059
|
+
}
|
|
5060
|
+
function useTouch() {
|
|
5061
|
+
const startX = useRef(0);
|
|
5062
|
+
const startY = useRef(0);
|
|
5063
|
+
const deltaX = useRef(0);
|
|
5064
|
+
const deltaY = useRef(0);
|
|
5065
|
+
const offsetX = useRef(0);
|
|
5066
|
+
const offsetY = useRef(0);
|
|
5067
|
+
const direction = useRef("");
|
|
5068
|
+
const isVertical = () => direction.current === "vertical";
|
|
5069
|
+
const isHorizontal = () => direction.current === "horizontal";
|
|
5070
|
+
const reset = () => {
|
|
5071
|
+
deltaX.current = 0;
|
|
5072
|
+
deltaY.current = 0;
|
|
5073
|
+
offsetX.current = 0;
|
|
5074
|
+
offsetY.current = 0;
|
|
5075
|
+
direction.current = "";
|
|
5076
|
+
};
|
|
5077
|
+
const start = (event) => {
|
|
5078
|
+
reset();
|
|
5079
|
+
startX.current = event.touches[0].clientX;
|
|
5080
|
+
startY.current = event.touches[0].clientY;
|
|
5081
|
+
};
|
|
5082
|
+
const move = (event) => {
|
|
5083
|
+
const touch = event.touches[0];
|
|
5084
|
+
deltaX.current = touch.clientX < 0 ? 0 : touch.clientX - startX.current;
|
|
5085
|
+
deltaY.current = touch.clientY - startY.current;
|
|
5086
|
+
offsetX.current = Math.abs(deltaX.current);
|
|
5087
|
+
offsetY.current = Math.abs(deltaY.current);
|
|
5088
|
+
if (!direction.current) {
|
|
5089
|
+
direction.current = getDirection(offsetX.current, offsetY.current);
|
|
5090
|
+
}
|
|
5091
|
+
};
|
|
5092
|
+
return {
|
|
5093
|
+
move,
|
|
5094
|
+
start,
|
|
5095
|
+
reset,
|
|
5096
|
+
startX,
|
|
5097
|
+
startY,
|
|
5098
|
+
deltaX,
|
|
5099
|
+
deltaY,
|
|
5100
|
+
offsetX,
|
|
5101
|
+
offsetY,
|
|
5102
|
+
direction,
|
|
5103
|
+
isVertical,
|
|
5104
|
+
isHorizontal
|
|
5105
|
+
};
|
|
5106
|
+
}
|
|
5107
|
+
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
5108
|
+
const defaultRoot = canUseDom ? window : void 0;
|
|
5109
|
+
const overflowStylePatterns = ["scroll", "auto", "overlay"];
|
|
5110
|
+
function isElement(node) {
|
|
5111
|
+
const ELEMENT_NODE_TYPE = 1;
|
|
5112
|
+
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
5113
|
+
}
|
|
5114
|
+
function getScrollParent(el, root2 = defaultRoot) {
|
|
5115
|
+
let node = el;
|
|
5116
|
+
while (node && node !== root2 && isElement(node)) {
|
|
5117
|
+
if (node === document.body) {
|
|
5118
|
+
return root2;
|
|
5119
|
+
}
|
|
5120
|
+
const { overflowY } = window.getComputedStyle(node);
|
|
5121
|
+
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
5122
|
+
return node;
|
|
5123
|
+
}
|
|
5124
|
+
node = node.parentNode;
|
|
5125
|
+
}
|
|
5126
|
+
return root2;
|
|
5127
|
+
}
|
|
5128
|
+
let passiveSupported = false;
|
|
5129
|
+
if (canUseDom) {
|
|
5130
|
+
try {
|
|
5131
|
+
const opts = Object.defineProperty({}, "passive", {
|
|
5132
|
+
get() {
|
|
5133
|
+
passiveSupported = true;
|
|
5134
|
+
}
|
|
5135
|
+
});
|
|
5136
|
+
window.addEventListener("test-passive-supported", null, opts);
|
|
5137
|
+
} catch (e) {
|
|
5138
|
+
console.log(e);
|
|
5139
|
+
}
|
|
5140
|
+
}
|
|
5141
|
+
let totalLockCount = 0;
|
|
5142
|
+
const BODY_LOCK_CLASS = "nut-overflow-hidden";
|
|
5143
|
+
function getScrollableElement(el) {
|
|
5144
|
+
let current = el == null ? void 0 : el.parentElement;
|
|
5145
|
+
while (current) {
|
|
5146
|
+
if (current.clientHeight < current.scrollHeight) {
|
|
5147
|
+
return current;
|
|
5148
|
+
}
|
|
5149
|
+
current = current.parentElement;
|
|
5150
|
+
}
|
|
5151
|
+
return null;
|
|
5152
|
+
}
|
|
5153
|
+
function useLockScroll(rootRef, shouldLock) {
|
|
5154
|
+
const touch = useTouch();
|
|
5155
|
+
const onTouchMove = (event) => {
|
|
5156
|
+
touch.move(event);
|
|
5157
|
+
const direction = touch.deltaY.current > 0 ? "10" : "01";
|
|
5158
|
+
const el = getScrollParent(
|
|
5159
|
+
event.target,
|
|
5160
|
+
rootRef.current
|
|
5161
|
+
);
|
|
5162
|
+
if (!el)
|
|
5163
|
+
return;
|
|
5164
|
+
if (shouldLock === "strict") {
|
|
5165
|
+
const scrollableParent = getScrollableElement(event.target);
|
|
5166
|
+
if (scrollableParent === document.body || scrollableParent === document.documentElement) {
|
|
5167
|
+
event.preventDefault();
|
|
5168
|
+
return;
|
|
5169
|
+
}
|
|
5170
|
+
}
|
|
5171
|
+
const { scrollHeight, offsetHeight, scrollTop } = el;
|
|
5172
|
+
let status = "11";
|
|
5173
|
+
if (scrollTop === 0) {
|
|
5174
|
+
status = offsetHeight >= scrollHeight ? "00" : "01";
|
|
5175
|
+
} else if (scrollTop + offsetHeight >= scrollHeight) {
|
|
5176
|
+
status = "10";
|
|
5177
|
+
}
|
|
5178
|
+
if (status !== "11" && touch.isVertical() && !(parseInt(status, 2) & parseInt(direction, 2))) {
|
|
5179
|
+
if (event.cancelable) {
|
|
5180
|
+
event.preventDefault();
|
|
5181
|
+
}
|
|
5182
|
+
}
|
|
5183
|
+
};
|
|
5184
|
+
const lock = () => {
|
|
5185
|
+
document.addEventListener("touchstart", touch.start);
|
|
5186
|
+
document.addEventListener(
|
|
5187
|
+
"touchmove",
|
|
5188
|
+
onTouchMove,
|
|
5189
|
+
passiveSupported ? { passive: false } : false
|
|
5190
|
+
);
|
|
5191
|
+
if (!totalLockCount) {
|
|
5192
|
+
document.body.classList.add(BODY_LOCK_CLASS);
|
|
5193
|
+
}
|
|
5194
|
+
totalLockCount++;
|
|
5195
|
+
};
|
|
5196
|
+
const unlock = () => {
|
|
5197
|
+
if (totalLockCount) {
|
|
5198
|
+
document.removeEventListener("touchstart", touch.start);
|
|
5199
|
+
document.removeEventListener("touchmove", onTouchMove);
|
|
5200
|
+
totalLockCount--;
|
|
5201
|
+
if (!totalLockCount) {
|
|
5202
|
+
document.body.classList.remove(BODY_LOCK_CLASS);
|
|
5203
|
+
}
|
|
5204
|
+
}
|
|
5205
|
+
};
|
|
5206
|
+
useEffect(() => {
|
|
5207
|
+
if (shouldLock) {
|
|
5208
|
+
lock();
|
|
5209
|
+
return () => {
|
|
5210
|
+
unlock();
|
|
5211
|
+
};
|
|
5212
|
+
}
|
|
5213
|
+
}, [shouldLock]);
|
|
5214
|
+
}
|
|
5215
|
+
const useLockScrollTaro = (shouldLock) => {
|
|
5216
|
+
const refObject = useRef(null);
|
|
5217
|
+
if (getEnv() === "WEB") {
|
|
5218
|
+
useLockScroll(refObject, shouldLock);
|
|
5219
|
+
}
|
|
5220
|
+
return refObject;
|
|
5221
|
+
};
|
|
5050
5222
|
const defaultOverlayProps = {
|
|
5051
5223
|
...ComponentDefaults,
|
|
5052
5224
|
zIndex: 1e3,
|
|
@@ -5077,30 +5249,18 @@ const Overlay = (props) => {
|
|
|
5077
5249
|
};
|
|
5078
5250
|
const [innerVisible, setInnerVisible] = useState(visible);
|
|
5079
5251
|
const classPrefix2 = `nut-overlay`;
|
|
5252
|
+
const nodeRef = useLockScrollTaro(!!props.lockScroll && innerVisible);
|
|
5080
5253
|
useEffect(() => {
|
|
5081
5254
|
if (visible) {
|
|
5082
5255
|
setInnerVisible(true);
|
|
5083
5256
|
} else {
|
|
5084
5257
|
setInnerVisible(false);
|
|
5085
5258
|
}
|
|
5086
|
-
lock();
|
|
5087
5259
|
}, [visible]);
|
|
5088
|
-
useEffect(() => {
|
|
5089
|
-
return () => {
|
|
5090
|
-
document.body.classList.remove("nut-overflow-hidden");
|
|
5091
|
-
};
|
|
5092
|
-
}, []);
|
|
5093
5260
|
const classes = classNames(className, classPrefix2);
|
|
5094
5261
|
const styles = {
|
|
5095
5262
|
...style
|
|
5096
5263
|
};
|
|
5097
|
-
const lock = () => {
|
|
5098
|
-
if (lockScroll && visible) {
|
|
5099
|
-
document.body.classList.add("nut-overflow-hidden");
|
|
5100
|
-
} else {
|
|
5101
|
-
document.body.classList.remove("nut-overflow-hidden");
|
|
5102
|
-
}
|
|
5103
|
-
};
|
|
5104
5264
|
const handleClick = (e) => {
|
|
5105
5265
|
if (closeOnOverlayClick) {
|
|
5106
5266
|
onClick && onClick(e);
|
|
@@ -5115,6 +5275,7 @@ const Overlay = (props) => {
|
|
|
5115
5275
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
5116
5276
|
CSSTransition$1,
|
|
5117
5277
|
{
|
|
5278
|
+
nodeRef,
|
|
5118
5279
|
classNames: `${classPrefix2}-slide`,
|
|
5119
5280
|
unmountOnExit: true,
|
|
5120
5281
|
timeout: duration,
|
|
@@ -5125,6 +5286,7 @@ const Overlay = (props) => {
|
|
|
5125
5286
|
/* @__PURE__ */ React__default.createElement(
|
|
5126
5287
|
View,
|
|
5127
5288
|
{
|
|
5289
|
+
ref: nodeRef,
|
|
5128
5290
|
className: classes,
|
|
5129
5291
|
style: styles,
|
|
5130
5292
|
...rest,
|
|
@@ -5138,7 +5300,7 @@ const Overlay = (props) => {
|
|
|
5138
5300
|
Overlay.defaultProps = defaultOverlayProps;
|
|
5139
5301
|
Overlay.displayName = "NutOverlay";
|
|
5140
5302
|
const DataContext$1 = createContext({});
|
|
5141
|
-
const defaultProps$
|
|
5303
|
+
const defaultProps$1r = {
|
|
5142
5304
|
...ComponentDefaults,
|
|
5143
5305
|
span: "24",
|
|
5144
5306
|
offset: "0",
|
|
@@ -5146,7 +5308,7 @@ const defaultProps$1q = {
|
|
|
5146
5308
|
};
|
|
5147
5309
|
const Col = (props) => {
|
|
5148
5310
|
const { className, style, span, offset, children, onClick } = {
|
|
5149
|
-
...defaultProps$
|
|
5311
|
+
...defaultProps$1r,
|
|
5150
5312
|
...props
|
|
5151
5313
|
};
|
|
5152
5314
|
const [colName, setColName] = useState("");
|
|
@@ -5178,9 +5340,9 @@ const Col = (props) => {
|
|
|
5178
5340
|
children
|
|
5179
5341
|
);
|
|
5180
5342
|
};
|
|
5181
|
-
Col.defaultProps = defaultProps$
|
|
5343
|
+
Col.defaultProps = defaultProps$1r;
|
|
5182
5344
|
Col.displayName = "NutCol";
|
|
5183
|
-
const defaultProps$
|
|
5345
|
+
const defaultProps$1q = {
|
|
5184
5346
|
...ComponentDefaults,
|
|
5185
5347
|
contentPosition: "center",
|
|
5186
5348
|
direction: "horizontal"
|
|
@@ -5188,7 +5350,7 @@ const defaultProps$1p = {
|
|
|
5188
5350
|
const classPrefix$m = `nut-divider`;
|
|
5189
5351
|
const Divider = (props) => {
|
|
5190
5352
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
5191
|
-
...defaultProps$
|
|
5353
|
+
...defaultProps$1q,
|
|
5192
5354
|
...props
|
|
5193
5355
|
};
|
|
5194
5356
|
const classes = direction === "horizontal" ? classNames({
|
|
@@ -5203,14 +5365,14 @@ const Divider = (props) => {
|
|
|
5203
5365
|
});
|
|
5204
5366
|
return /* @__PURE__ */ React__default.createElement("div", { className: `${classes} ${className || ""}`, style, ...rest }, children);
|
|
5205
5367
|
};
|
|
5206
|
-
Divider.defaultProps = defaultProps$
|
|
5368
|
+
Divider.defaultProps = defaultProps$1q;
|
|
5207
5369
|
Divider.displayName = "NutDivider";
|
|
5208
5370
|
const gridContext = {
|
|
5209
5371
|
onClick: (item, index) => {
|
|
5210
5372
|
}
|
|
5211
5373
|
};
|
|
5212
5374
|
const GridContext = React__default.createContext(gridContext);
|
|
5213
|
-
const defaultProps$
|
|
5375
|
+
const defaultProps$1p = {
|
|
5214
5376
|
text: "",
|
|
5215
5377
|
columns: 4,
|
|
5216
5378
|
gap: 0,
|
|
@@ -5236,7 +5398,7 @@ const GridItem = (props) => {
|
|
|
5236
5398
|
onClick,
|
|
5237
5399
|
...rest
|
|
5238
5400
|
} = {
|
|
5239
|
-
...defaultProps$
|
|
5401
|
+
...defaultProps$1p,
|
|
5240
5402
|
...props
|
|
5241
5403
|
};
|
|
5242
5404
|
const classPrefix2 = "nut-grid-item";
|
|
@@ -5294,9 +5456,9 @@ const GridItem = (props) => {
|
|
|
5294
5456
|
/* @__PURE__ */ React__default.createElement("div", { className: contentClass() }, children && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children), text && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__text` }, text))
|
|
5295
5457
|
);
|
|
5296
5458
|
};
|
|
5297
|
-
GridItem.defaultProps = defaultProps$
|
|
5459
|
+
GridItem.defaultProps = defaultProps$1p;
|
|
5298
5460
|
GridItem.displayName = "NutGridItem";
|
|
5299
|
-
const defaultProps$
|
|
5461
|
+
const defaultProps$1o = {
|
|
5300
5462
|
columns: 4,
|
|
5301
5463
|
gap: 0,
|
|
5302
5464
|
center: true,
|
|
@@ -5317,7 +5479,7 @@ const Grid = (props) => {
|
|
|
5317
5479
|
className,
|
|
5318
5480
|
onClick,
|
|
5319
5481
|
...rest
|
|
5320
|
-
} = { ...defaultProps$
|
|
5482
|
+
} = { ...defaultProps$1o, ...props };
|
|
5321
5483
|
const childrenDom = React__default.Children.toArray(children);
|
|
5322
5484
|
const classPrefix2 = "nut-grid";
|
|
5323
5485
|
const rootClass = () => {
|
|
@@ -5347,18 +5509,18 @@ const Grid = (props) => {
|
|
|
5347
5509
|
});
|
|
5348
5510
|
})));
|
|
5349
5511
|
};
|
|
5350
|
-
Grid.defaultProps = defaultProps$
|
|
5512
|
+
Grid.defaultProps = defaultProps$1o;
|
|
5351
5513
|
Grid.displayName = "NutGrid";
|
|
5352
5514
|
Grid.Item = GridItem;
|
|
5353
|
-
const defaultProps$
|
|
5515
|
+
const defaultProps$1n = {};
|
|
5354
5516
|
const Layout = (props) => {
|
|
5355
|
-
({ ...defaultProps$
|
|
5517
|
+
({ ...defaultProps$1n, ...props });
|
|
5356
5518
|
return /* @__PURE__ */ React__default.createElement("div", { className: "nut-layout" }, "Layout");
|
|
5357
5519
|
};
|
|
5358
|
-
Layout.defaultProps = defaultProps$
|
|
5520
|
+
Layout.defaultProps = defaultProps$1n;
|
|
5359
5521
|
Layout.displayName = "NutLayout";
|
|
5360
5522
|
const classPrefix$l = "nut-row";
|
|
5361
|
-
const defaultProps$
|
|
5523
|
+
const defaultProps$1m = {
|
|
5362
5524
|
...ComponentDefaults,
|
|
5363
5525
|
type: "",
|
|
5364
5526
|
justify: "start",
|
|
@@ -5378,7 +5540,7 @@ const Row = (props) => {
|
|
|
5378
5540
|
gutter,
|
|
5379
5541
|
onClick
|
|
5380
5542
|
} = {
|
|
5381
|
-
...defaultProps$
|
|
5543
|
+
...defaultProps$1m,
|
|
5382
5544
|
...props
|
|
5383
5545
|
};
|
|
5384
5546
|
const getClass = (prefix, type22) => {
|
|
@@ -5410,15 +5572,15 @@ const Row = (props) => {
|
|
|
5410
5572
|
children
|
|
5411
5573
|
));
|
|
5412
5574
|
};
|
|
5413
|
-
Row.defaultProps = defaultProps$
|
|
5575
|
+
Row.defaultProps = defaultProps$1m;
|
|
5414
5576
|
Row.displayName = "NutRow";
|
|
5415
5577
|
const prefixCls = "nut-space";
|
|
5416
|
-
const defaultProps$
|
|
5578
|
+
const defaultProps$1l = {
|
|
5417
5579
|
direction: "horizontal"
|
|
5418
5580
|
};
|
|
5419
5581
|
const Space = (props) => {
|
|
5420
5582
|
const { className, style, children, wrap, align, direction, justify } = {
|
|
5421
|
-
...defaultProps$
|
|
5583
|
+
...defaultProps$1l,
|
|
5422
5584
|
...props
|
|
5423
5585
|
};
|
|
5424
5586
|
const cls = classNames(
|
|
@@ -5433,7 +5595,7 @@ const Space = (props) => {
|
|
|
5433
5595
|
return child !== null && child !== void 0 && /* @__PURE__ */ React__default.createElement("div", { className: `${prefixCls}-item` }, child);
|
|
5434
5596
|
}));
|
|
5435
5597
|
};
|
|
5436
|
-
Space.defaultProps = defaultProps$
|
|
5598
|
+
Space.defaultProps = defaultProps$1l;
|
|
5437
5599
|
Space.displayName = "NutSpace";
|
|
5438
5600
|
function useWatch(dep, callback, config2 = { immediate: false }) {
|
|
5439
5601
|
const { immediate } = config2;
|
|
@@ -5511,28 +5673,7 @@ const getRectByTaro = async (element) => {
|
|
|
5511
5673
|
}
|
|
5512
5674
|
return Promise.resolve(makeRect(0, 0));
|
|
5513
5675
|
};
|
|
5514
|
-
const
|
|
5515
|
-
const defaultRoot = canUseDom ? window : void 0;
|
|
5516
|
-
const overflowStylePatterns = ["scroll", "auto", "overlay"];
|
|
5517
|
-
function isElement(node) {
|
|
5518
|
-
const ELEMENT_NODE_TYPE = 1;
|
|
5519
|
-
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
5520
|
-
}
|
|
5521
|
-
function getScrollParent(el, root2 = defaultRoot) {
|
|
5522
|
-
let node = el;
|
|
5523
|
-
while (node && node !== root2 && isElement(node)) {
|
|
5524
|
-
if (node === document.body) {
|
|
5525
|
-
return root2;
|
|
5526
|
-
}
|
|
5527
|
-
const { overflowY } = window.getComputedStyle(node);
|
|
5528
|
-
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
5529
|
-
return node;
|
|
5530
|
-
}
|
|
5531
|
-
node = node.parentNode;
|
|
5532
|
-
}
|
|
5533
|
-
return root2;
|
|
5534
|
-
}
|
|
5535
|
-
const defaultProps$1j = {
|
|
5676
|
+
const defaultProps$1k = {
|
|
5536
5677
|
...ComponentDefaults,
|
|
5537
5678
|
position: "top",
|
|
5538
5679
|
zIndex: 900
|
|
@@ -5549,7 +5690,7 @@ const Sticky = (props) => {
|
|
|
5549
5690
|
className,
|
|
5550
5691
|
onChange,
|
|
5551
5692
|
...rest
|
|
5552
|
-
} = { ...defaultProps$
|
|
5693
|
+
} = { ...defaultProps$1k, ...props };
|
|
5553
5694
|
const stickyRef = useRef(null);
|
|
5554
5695
|
const rootRef = useRef(null);
|
|
5555
5696
|
const [rootRect, setRootRect] = useState({});
|
|
@@ -5655,9 +5796,9 @@ const Sticky = (props) => {
|
|
|
5655
5796
|
)
|
|
5656
5797
|
);
|
|
5657
5798
|
};
|
|
5658
|
-
Sticky.defaultProps = defaultProps$
|
|
5799
|
+
Sticky.defaultProps = defaultProps$1k;
|
|
5659
5800
|
Sticky.displayName = "NutSticky";
|
|
5660
|
-
const defaultProps$
|
|
5801
|
+
const defaultProps$1j = {
|
|
5661
5802
|
...ComponentDefaults,
|
|
5662
5803
|
threshold: 200,
|
|
5663
5804
|
zIndex: 900,
|
|
@@ -5665,7 +5806,7 @@ const defaultProps$1i = {
|
|
|
5665
5806
|
};
|
|
5666
5807
|
const BackTop = (props) => {
|
|
5667
5808
|
const { children, threshold, zIndex, className, duration, style, onClick } = {
|
|
5668
|
-
...defaultProps$
|
|
5809
|
+
...defaultProps$1j,
|
|
5669
5810
|
...props
|
|
5670
5811
|
};
|
|
5671
5812
|
const classPrefix2 = "nut-backtop";
|
|
@@ -5703,10 +5844,10 @@ const BackTop = (props) => {
|
|
|
5703
5844
|
children || /* @__PURE__ */ React__default.createElement(a$2, { width: 19, height: 19, className: "nut-backtop-main" })
|
|
5704
5845
|
);
|
|
5705
5846
|
};
|
|
5706
|
-
BackTop.defaultProps = defaultProps$
|
|
5847
|
+
BackTop.defaultProps = defaultProps$1j;
|
|
5707
5848
|
BackTop.displayName = "NutBackTop";
|
|
5708
5849
|
const elevatorContext = createContext({});
|
|
5709
|
-
const defaultProps$
|
|
5850
|
+
const defaultProps$1i = {
|
|
5710
5851
|
...ComponentDefaults,
|
|
5711
5852
|
height: "200px",
|
|
5712
5853
|
floorKey: "title",
|
|
@@ -5733,7 +5874,7 @@ const Elevator = (props) => {
|
|
|
5733
5874
|
children,
|
|
5734
5875
|
...rest
|
|
5735
5876
|
} = {
|
|
5736
|
-
...defaultProps$
|
|
5877
|
+
...defaultProps$1i,
|
|
5737
5878
|
...props
|
|
5738
5879
|
};
|
|
5739
5880
|
const classPrefix2 = "nut-elevator";
|
|
@@ -5945,10 +6086,10 @@ const Elevator = (props) => {
|
|
|
5945
6086
|
})
|
|
5946
6087
|
))) : null, sticky && scrollY > 0 ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__list__fixed` }, /* @__PURE__ */ React__default.createElement("span", { className: `${classPrefix2}__list__fixed__title` }, list[currentIndex][floorKey])) : null);
|
|
5947
6088
|
};
|
|
5948
|
-
Elevator.defaultProps = defaultProps$
|
|
6089
|
+
Elevator.defaultProps = defaultProps$1i;
|
|
5949
6090
|
Elevator.displayName = "NutElevator";
|
|
5950
6091
|
Elevator.Context = elevatorContext;
|
|
5951
|
-
const defaultProps$
|
|
6092
|
+
const defaultProps$1h = {
|
|
5952
6093
|
...ComponentDefaults,
|
|
5953
6094
|
activeText: "",
|
|
5954
6095
|
inactiveText: "",
|
|
@@ -5976,7 +6117,7 @@ const FixedNav = (props) => {
|
|
|
5976
6117
|
content,
|
|
5977
6118
|
...rest
|
|
5978
6119
|
} = {
|
|
5979
|
-
...defaultProps$
|
|
6120
|
+
...defaultProps$1h,
|
|
5980
6121
|
...props
|
|
5981
6122
|
};
|
|
5982
6123
|
const classPrefix2 = "nut-fixednav";
|
|
@@ -6028,9 +6169,9 @@ const FixedNav = (props) => {
|
|
|
6028
6169
|
/* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__btn`, onClick: () => onUpdateValue() }, content || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(a$j, { color: "#fff" }), /* @__PURE__ */ React__default.createElement("div", { className: "text" }, visible ? activeText || locale.fixednav.activeText : inactiveText || locale.fixednav.inactiveText)))
|
|
6029
6170
|
);
|
|
6030
6171
|
};
|
|
6031
|
-
FixedNav.defaultProps = defaultProps$
|
|
6172
|
+
FixedNav.defaultProps = defaultProps$1h;
|
|
6032
6173
|
FixedNav.displayName = "NutFixedNav";
|
|
6033
|
-
const defaultProps$
|
|
6174
|
+
const defaultProps$1g = {
|
|
6034
6175
|
...ComponentDefaults,
|
|
6035
6176
|
left: "",
|
|
6036
6177
|
right: "",
|
|
@@ -6042,8 +6183,8 @@ const defaultProps$1f = {
|
|
|
6042
6183
|
};
|
|
6043
6184
|
const NavBar = (props) => {
|
|
6044
6185
|
const {
|
|
6045
|
-
right,
|
|
6046
|
-
left,
|
|
6186
|
+
right: right2,
|
|
6187
|
+
left: left2,
|
|
6047
6188
|
className,
|
|
6048
6189
|
style,
|
|
6049
6190
|
back,
|
|
@@ -6053,7 +6194,7 @@ const NavBar = (props) => {
|
|
|
6053
6194
|
zIndex,
|
|
6054
6195
|
onBackClick
|
|
6055
6196
|
} = {
|
|
6056
|
-
...defaultProps$
|
|
6197
|
+
...defaultProps$1g,
|
|
6057
6198
|
...props
|
|
6058
6199
|
};
|
|
6059
6200
|
const classPrefix2 = "nut-navbar";
|
|
@@ -6072,13 +6213,13 @@ const NavBar = (props) => {
|
|
|
6072
6213
|
onClick: (e) => onBackClick(e)
|
|
6073
6214
|
},
|
|
6074
6215
|
back
|
|
6075
|
-
),
|
|
6216
|
+
), left2);
|
|
6076
6217
|
};
|
|
6077
6218
|
const renderContent = () => {
|
|
6078
6219
|
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__title` }, children);
|
|
6079
6220
|
};
|
|
6080
6221
|
const renderRight = () => {
|
|
6081
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__right` },
|
|
6222
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__right` }, right2);
|
|
6082
6223
|
};
|
|
6083
6224
|
const renderWrapper = () => {
|
|
6084
6225
|
return /* @__PURE__ */ React__default.createElement("div", { className: cls, style: styles() }, renderLeft(), renderContent(), renderRight());
|
|
@@ -6090,9 +6231,9 @@ const NavBar = (props) => {
|
|
|
6090
6231
|
const cls = classNames(classPrefix2, classes, className);
|
|
6091
6232
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, fixed && placeholder ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}--placeholder` }, renderWrapper()) : renderWrapper());
|
|
6092
6233
|
};
|
|
6093
|
-
NavBar.defaultProps = defaultProps$
|
|
6234
|
+
NavBar.defaultProps = defaultProps$1g;
|
|
6094
6235
|
NavBar.displayName = "NutNavBar";
|
|
6095
|
-
const defaultProps$
|
|
6236
|
+
const defaultProps$1f = {
|
|
6096
6237
|
...ComponentDefaults,
|
|
6097
6238
|
position: "center",
|
|
6098
6239
|
transition: "",
|
|
@@ -6113,7 +6254,7 @@ const defaultProps$1e = {
|
|
|
6113
6254
|
onCloseIconClick: (e) => true,
|
|
6114
6255
|
...defaultOverlayProps
|
|
6115
6256
|
};
|
|
6116
|
-
|
|
6257
|
+
const _zIndex = 1100;
|
|
6117
6258
|
const Popup = (props) => {
|
|
6118
6259
|
const {
|
|
6119
6260
|
children,
|
|
@@ -6128,7 +6269,7 @@ const Popup = (props) => {
|
|
|
6128
6269
|
closeable,
|
|
6129
6270
|
closeIconPosition,
|
|
6130
6271
|
closeIcon,
|
|
6131
|
-
left,
|
|
6272
|
+
left: left2,
|
|
6132
6273
|
title,
|
|
6133
6274
|
style,
|
|
6134
6275
|
transition,
|
|
@@ -6144,11 +6285,13 @@ const Popup = (props) => {
|
|
|
6144
6285
|
afterShow,
|
|
6145
6286
|
afterClose,
|
|
6146
6287
|
onClick
|
|
6147
|
-
} = { ...defaultProps$
|
|
6148
|
-
|
|
6288
|
+
} = { ...defaultProps$1f, ...props };
|
|
6289
|
+
let innerIndex = zIndex || _zIndex;
|
|
6290
|
+
const [index, setIndex] = useState(innerIndex);
|
|
6149
6291
|
const [innerVisible, setInnerVisible] = useState(visible);
|
|
6150
6292
|
const [showChildren, setShowChildren] = useState(true);
|
|
6151
6293
|
const [transitionName, setTransitionName] = useState("");
|
|
6294
|
+
const refObject = useLockScrollTaro(innerVisible && lockScroll);
|
|
6152
6295
|
const classPrefix2 = "nut-popup";
|
|
6153
6296
|
const baseStyle = {
|
|
6154
6297
|
zIndex: index
|
|
@@ -6174,9 +6317,7 @@ const Popup = (props) => {
|
|
|
6174
6317
|
const open2 = () => {
|
|
6175
6318
|
if (!innerVisible) {
|
|
6176
6319
|
setInnerVisible(true);
|
|
6177
|
-
|
|
6178
|
-
setIndex(++_zIndex);
|
|
6179
|
-
}
|
|
6320
|
+
setIndex(++innerIndex);
|
|
6180
6321
|
}
|
|
6181
6322
|
if (destroyOnClose) {
|
|
6182
6323
|
setShowChildren(true);
|
|
@@ -6232,7 +6373,7 @@ const Popup = (props) => {
|
|
|
6232
6373
|
return null;
|
|
6233
6374
|
};
|
|
6234
6375
|
const renderTitle = () => {
|
|
6235
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, position === "bottom" && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null,
|
|
6376
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, position === "bottom" && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, left2 && /* @__PURE__ */ React__default.createElement(View, { className: `${classPrefix2}-left-icon` }, left2), title && /* @__PURE__ */ React__default.createElement(View, { className: `${classPrefix2}-title` }, title)));
|
|
6236
6377
|
};
|
|
6237
6378
|
const renderPop = () => {
|
|
6238
6379
|
return /* @__PURE__ */ React__default.createElement(
|
|
@@ -6248,9 +6389,11 @@ const Popup = (props) => {
|
|
|
6248
6389
|
/* @__PURE__ */ React__default.createElement(
|
|
6249
6390
|
View,
|
|
6250
6391
|
{
|
|
6392
|
+
ref: refObject,
|
|
6251
6393
|
style: popStyles,
|
|
6252
6394
|
className: popClassName,
|
|
6253
|
-
onClick: onHandleClick
|
|
6395
|
+
onClick: onHandleClick,
|
|
6396
|
+
catchMove: lockScroll
|
|
6254
6397
|
},
|
|
6255
6398
|
renderTitle(),
|
|
6256
6399
|
renderIcon(),
|
|
@@ -6281,10 +6424,10 @@ const Popup = (props) => {
|
|
|
6281
6424
|
}, [position, transition]);
|
|
6282
6425
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderToContainer(portal, renderNode()));
|
|
6283
6426
|
};
|
|
6284
|
-
Popup.defaultProps = defaultProps$
|
|
6427
|
+
Popup.defaultProps = defaultProps$1f;
|
|
6285
6428
|
Popup.displayName = "NutPopup";
|
|
6286
6429
|
const OffsetContext = createContext(20);
|
|
6287
|
-
const defaultProps$
|
|
6430
|
+
const defaultProps$1e = {
|
|
6288
6431
|
...ComponentDefaults,
|
|
6289
6432
|
position: "left",
|
|
6290
6433
|
width: "80%"
|
|
@@ -6301,7 +6444,7 @@ const SideNavBar = (props) => {
|
|
|
6301
6444
|
onClose,
|
|
6302
6445
|
...rest
|
|
6303
6446
|
} = {
|
|
6304
|
-
...defaultProps$
|
|
6447
|
+
...defaultProps$1e,
|
|
6305
6448
|
...props
|
|
6306
6449
|
};
|
|
6307
6450
|
const indent = props.indent ? Number(props.indent) : 20;
|
|
@@ -6341,7 +6484,7 @@ const SideNavBar = (props) => {
|
|
|
6341
6484
|
)))
|
|
6342
6485
|
);
|
|
6343
6486
|
};
|
|
6344
|
-
SideNavBar.defaultProps = defaultProps$
|
|
6487
|
+
SideNavBar.defaultProps = defaultProps$1e;
|
|
6345
6488
|
SideNavBar.displayName = "NutSideNavBar";
|
|
6346
6489
|
const SideNavBarItem = (props) => {
|
|
6347
6490
|
const classPrefix2 = "nut-subsidenavbar";
|
|
@@ -6360,13 +6503,13 @@ const SideNavBarItem = (props) => {
|
|
|
6360
6503
|
title
|
|
6361
6504
|
);
|
|
6362
6505
|
};
|
|
6363
|
-
const defaultProps$
|
|
6506
|
+
const defaultProps$1d = {
|
|
6364
6507
|
open: true
|
|
6365
6508
|
};
|
|
6366
6509
|
const SubSideNavBar = (props) => {
|
|
6367
6510
|
const classPrefix2 = "nut-subsidenavbar";
|
|
6368
6511
|
const { title, value, children, onClick, open: open2, ...rest } = {
|
|
6369
|
-
...defaultProps$
|
|
6512
|
+
...defaultProps$1d,
|
|
6370
6513
|
...props
|
|
6371
6514
|
};
|
|
6372
6515
|
const [subShow, setSubShow] = useState(open2);
|
|
@@ -6376,8 +6519,8 @@ const SubSideNavBar = (props) => {
|
|
|
6376
6519
|
(nodeList, level = 1) => {
|
|
6377
6520
|
const titleClass = nodeList[0].className;
|
|
6378
6521
|
if (titleClass.includes(`${classPrefix2}__title`)) {
|
|
6379
|
-
const
|
|
6380
|
-
nodeList[0].style.paddingLeft = `${
|
|
6522
|
+
const left2 = offset * (level + 1);
|
|
6523
|
+
nodeList[0].style.paddingLeft = `${left2}px`;
|
|
6381
6524
|
}
|
|
6382
6525
|
const childNodes = nodeList[1] && nodeList[1].children && Array.from(nodeList[1].children).filter(
|
|
6383
6526
|
(item) => item.nodeType !== 3 && item.nodeType !== 8
|
|
@@ -6385,8 +6528,8 @@ const SubSideNavBar = (props) => {
|
|
|
6385
6528
|
childNodes.forEach((item) => {
|
|
6386
6529
|
const itemClass = item.className;
|
|
6387
6530
|
if (itemClass.includes(`${classPrefix2}__item`)) {
|
|
6388
|
-
const
|
|
6389
|
-
item.style.paddingLeft = `${
|
|
6531
|
+
const left2 = offset * (level + 2);
|
|
6532
|
+
item.style.paddingLeft = `${left2}px`;
|
|
6390
6533
|
}
|
|
6391
6534
|
if (itemClass.includes(`${classPrefix2}__list`)) {
|
|
6392
6535
|
let level2 = item.getAttribute("level") ? Number(item.getAttribute("level")) : 1;
|
|
@@ -6444,7 +6587,7 @@ function usePropsValue({
|
|
|
6444
6587
|
);
|
|
6445
6588
|
return [stateRef.current, setState];
|
|
6446
6589
|
}
|
|
6447
|
-
const defaultProps$
|
|
6590
|
+
const defaultProps$1c = {
|
|
6448
6591
|
...ComponentDefaults,
|
|
6449
6592
|
value: "",
|
|
6450
6593
|
dot: false,
|
|
@@ -6454,8 +6597,8 @@ const defaultProps$1b = {
|
|
|
6454
6597
|
color: ""
|
|
6455
6598
|
};
|
|
6456
6599
|
const Badge = (props) => {
|
|
6457
|
-
const { className, style, value, max, children, dot, top, right, color } = {
|
|
6458
|
-
...defaultProps$
|
|
6600
|
+
const { className, style, value, max, children, dot, top, right: right2, color } = {
|
|
6601
|
+
...defaultProps$1c,
|
|
6459
6602
|
...props
|
|
6460
6603
|
};
|
|
6461
6604
|
const classPrefix2 = "nut-badge";
|
|
@@ -6476,15 +6619,15 @@ const Badge = (props) => {
|
|
|
6476
6619
|
const getStyle = () => {
|
|
6477
6620
|
const style2 = {};
|
|
6478
6621
|
style2.top = `${Number(top) || parseFloat(String(top)) || 0}px`;
|
|
6479
|
-
style2.right = `${Number(
|
|
6622
|
+
style2.right = `${Number(right2) || parseFloat(String(right2)) || 0}px`;
|
|
6480
6623
|
style2.background = color;
|
|
6481
6624
|
return style2;
|
|
6482
6625
|
};
|
|
6483
6626
|
return /* @__PURE__ */ React__default.createElement("div", { className: classes, style }, typeof value === "object" && value && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__icon` }, value), /* @__PURE__ */ React__default.createElement("div", null, children), /* @__PURE__ */ React__default.createElement("div", { className: contentClasses, style: getStyle() }, content()));
|
|
6484
6627
|
};
|
|
6485
|
-
Badge.defaultProps = defaultProps$
|
|
6628
|
+
Badge.defaultProps = defaultProps$1c;
|
|
6486
6629
|
Badge.displayName = "NutBadge";
|
|
6487
|
-
const defaultProps$
|
|
6630
|
+
const defaultProps$1b = {
|
|
6488
6631
|
...ComponentDefaults,
|
|
6489
6632
|
title: "",
|
|
6490
6633
|
icon: null,
|
|
@@ -6510,11 +6653,11 @@ const TabbarItem = (props) => {
|
|
|
6510
6653
|
dot,
|
|
6511
6654
|
max,
|
|
6512
6655
|
top,
|
|
6513
|
-
right,
|
|
6656
|
+
right: right2,
|
|
6514
6657
|
handleClick,
|
|
6515
6658
|
...rest
|
|
6516
6659
|
} = {
|
|
6517
|
-
...defaultProps$
|
|
6660
|
+
...defaultProps$1b,
|
|
6518
6661
|
...props
|
|
6519
6662
|
};
|
|
6520
6663
|
const classPrefix2 = "nut-tabbar-item";
|
|
@@ -6530,7 +6673,7 @@ const TabbarItem = (props) => {
|
|
|
6530
6673
|
dot,
|
|
6531
6674
|
max,
|
|
6532
6675
|
top,
|
|
6533
|
-
right,
|
|
6676
|
+
right: right2,
|
|
6534
6677
|
color: activeColor
|
|
6535
6678
|
};
|
|
6536
6679
|
return /* @__PURE__ */ React__default.createElement(
|
|
@@ -6547,7 +6690,7 @@ const TabbarItem = (props) => {
|
|
|
6547
6690
|
icon ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Badge, { ...badgeProps }, /* @__PURE__ */ React__default.createElement("div", { className: boxPrefix }, icon)), /* @__PURE__ */ React__default.createElement("div", { className: titleClass }, title)) : /* @__PURE__ */ React__default.createElement(Badge, { ...badgeProps }, /* @__PURE__ */ React__default.createElement("div", { className: titleClass }, title))
|
|
6548
6691
|
);
|
|
6549
6692
|
};
|
|
6550
|
-
const defaultProps$
|
|
6693
|
+
const defaultProps$1a = {
|
|
6551
6694
|
...ComponentDefaults,
|
|
6552
6695
|
defaultValue: 0,
|
|
6553
6696
|
fixed: false,
|
|
@@ -6570,7 +6713,7 @@ const Tabbar = (props) => {
|
|
|
6570
6713
|
style,
|
|
6571
6714
|
onSwitch
|
|
6572
6715
|
} = {
|
|
6573
|
-
...defaultProps$
|
|
6716
|
+
...defaultProps$1a,
|
|
6574
6717
|
...props
|
|
6575
6718
|
};
|
|
6576
6719
|
const classPrefix2 = "nut-tabbar";
|
|
@@ -6605,17 +6748,17 @@ const Tabbar = (props) => {
|
|
|
6605
6748
|
(fixed || safeArea) && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__safe-area` })
|
|
6606
6749
|
);
|
|
6607
6750
|
};
|
|
6608
|
-
Tabbar.defaultProps = defaultProps$
|
|
6751
|
+
Tabbar.defaultProps = defaultProps$1a;
|
|
6609
6752
|
Tabbar.displayName = "NutTabbar";
|
|
6610
6753
|
Tabbar.Item = TabbarItem;
|
|
6611
|
-
const defaultProps$
|
|
6754
|
+
const defaultProps$19 = {
|
|
6612
6755
|
title: "",
|
|
6613
6756
|
value: "",
|
|
6614
6757
|
disabled: false
|
|
6615
6758
|
};
|
|
6616
6759
|
const TabPane = (props) => {
|
|
6617
6760
|
const { children, autoHeightClassName, className, disabled } = {
|
|
6618
|
-
...defaultProps$
|
|
6761
|
+
...defaultProps$19,
|
|
6619
6762
|
...props
|
|
6620
6763
|
};
|
|
6621
6764
|
const classPrefix2 = "nut-tabpane";
|
|
@@ -6641,7 +6784,7 @@ function requestAniFrame() {
|
|
|
6641
6784
|
};
|
|
6642
6785
|
}
|
|
6643
6786
|
const requestAniFrame$1 = requestAniFrame();
|
|
6644
|
-
const defaultProps$
|
|
6787
|
+
const defaultProps$18 = {
|
|
6645
6788
|
...ComponentDefaults,
|
|
6646
6789
|
tabStyle: {},
|
|
6647
6790
|
name: "",
|
|
@@ -6669,7 +6812,7 @@ const Tabs = (props) => {
|
|
|
6669
6812
|
autoHeight,
|
|
6670
6813
|
...rest
|
|
6671
6814
|
} = {
|
|
6672
|
-
...defaultProps$
|
|
6815
|
+
...defaultProps$18,
|
|
6673
6816
|
...props
|
|
6674
6817
|
};
|
|
6675
6818
|
const [value, setValue] = usePropsValue({
|
|
@@ -6782,11 +6925,11 @@ const Tabs = (props) => {
|
|
|
6782
6925
|
to = top - (navRectRef.current.height - titleRect.height) / 2;
|
|
6783
6926
|
} else {
|
|
6784
6927
|
const DEFAULT_PADDING = 20;
|
|
6785
|
-
const
|
|
6928
|
+
const left2 = titleRects.slice(0, value).reduce(
|
|
6786
6929
|
(prev, curr) => prev + curr.width,
|
|
6787
6930
|
DEFAULT_PADDING
|
|
6788
6931
|
);
|
|
6789
|
-
to =
|
|
6932
|
+
to = left2 - (navRectRef.current.width - titleRect.width) / 2;
|
|
6790
6933
|
}
|
|
6791
6934
|
nextTick(() => {
|
|
6792
6935
|
scrollWithAnimation.current = true;
|
|
@@ -6886,10 +7029,10 @@ const Tabs = (props) => {
|
|
|
6886
7029
|
return React__default.cloneElement(child, childProps);
|
|
6887
7030
|
}))));
|
|
6888
7031
|
};
|
|
6889
|
-
Tabs.defaultProps = defaultProps$
|
|
7032
|
+
Tabs.defaultProps = defaultProps$18;
|
|
6890
7033
|
Tabs.displayName = "NutTabs";
|
|
6891
7034
|
Tabs.TabPane = TabPane;
|
|
6892
|
-
const defaultProps$
|
|
7035
|
+
const defaultProps$17 = {
|
|
6893
7036
|
type: "custom",
|
|
6894
7037
|
existList: [],
|
|
6895
7038
|
defaultIcon: null,
|
|
@@ -6908,7 +7051,7 @@ const ExistRender = (props) => {
|
|
|
6908
7051
|
onSelect,
|
|
6909
7052
|
onSwitch,
|
|
6910
7053
|
...rest
|
|
6911
|
-
} = { ...defaultProps$
|
|
7054
|
+
} = { ...defaultProps$17, ...props };
|
|
6912
7055
|
const classPrefix2 = "nut-address";
|
|
6913
7056
|
const selectedExist = (item) => {
|
|
6914
7057
|
existList.forEach((list, index) => {
|
|
@@ -7070,7 +7213,7 @@ class Tree {
|
|
|
7070
7213
|
}
|
|
7071
7214
|
}
|
|
7072
7215
|
const Tree$1 = Tree;
|
|
7073
|
-
const defaultProps$
|
|
7216
|
+
const defaultProps$16 = {
|
|
7074
7217
|
...ComponentDefaults,
|
|
7075
7218
|
activeColor: "",
|
|
7076
7219
|
activeIcon: "checklist",
|
|
@@ -7114,7 +7257,7 @@ const InternalCascader = (props, ref) => {
|
|
|
7114
7257
|
onClose,
|
|
7115
7258
|
onChange,
|
|
7116
7259
|
onPathChange
|
|
7117
|
-
} = { ...defaultProps$
|
|
7260
|
+
} = { ...defaultProps$16, ...props };
|
|
7118
7261
|
const [tabvalue, setTabvalue] = useState("c1");
|
|
7119
7262
|
const [optionsData, setOptionsData] = useState([]);
|
|
7120
7263
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.onLoad);
|
|
@@ -7411,9 +7554,9 @@ const InternalCascader = (props, ref) => {
|
|
|
7411
7554
|
) : renderTabs());
|
|
7412
7555
|
};
|
|
7413
7556
|
const Cascader = React__default.forwardRef(InternalCascader);
|
|
7414
|
-
Cascader.defaultProps = defaultProps$
|
|
7557
|
+
Cascader.defaultProps = defaultProps$16;
|
|
7415
7558
|
Cascader.displayName = "NutCascader";
|
|
7416
|
-
const defaultProps$
|
|
7559
|
+
const defaultProps$15 = {
|
|
7417
7560
|
...ComponentDefaults,
|
|
7418
7561
|
visible: false,
|
|
7419
7562
|
type: "custom",
|
|
@@ -7430,7 +7573,7 @@ const CustomRender = (props) => {
|
|
|
7430
7573
|
height,
|
|
7431
7574
|
options,
|
|
7432
7575
|
title,
|
|
7433
|
-
left,
|
|
7576
|
+
left: left2,
|
|
7434
7577
|
value,
|
|
7435
7578
|
defaultValue,
|
|
7436
7579
|
optionKey,
|
|
@@ -7440,7 +7583,7 @@ const CustomRender = (props) => {
|
|
|
7440
7583
|
onPathChange,
|
|
7441
7584
|
...rest
|
|
7442
7585
|
} = {
|
|
7443
|
-
...defaultProps$
|
|
7586
|
+
...defaultProps$15,
|
|
7444
7587
|
...props
|
|
7445
7588
|
};
|
|
7446
7589
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, type4 === "custom" && /* @__PURE__ */ React__default.createElement(
|
|
@@ -7450,7 +7593,7 @@ const CustomRender = (props) => {
|
|
|
7450
7593
|
value,
|
|
7451
7594
|
defaultValue,
|
|
7452
7595
|
title,
|
|
7453
|
-
left,
|
|
7596
|
+
left: left2,
|
|
7454
7597
|
options,
|
|
7455
7598
|
format: format2,
|
|
7456
7599
|
optionKey,
|
|
@@ -7465,7 +7608,7 @@ const CustomRender = (props) => {
|
|
|
7465
7608
|
}
|
|
7466
7609
|
));
|
|
7467
7610
|
};
|
|
7468
|
-
const defaultProps$
|
|
7611
|
+
const defaultProps$14 = {
|
|
7469
7612
|
...ComponentDefaults,
|
|
7470
7613
|
defaultValue: [],
|
|
7471
7614
|
type: "custom",
|
|
@@ -7507,7 +7650,7 @@ const InternalAddress = (props, ref) => {
|
|
|
7507
7650
|
onSwitch,
|
|
7508
7651
|
...rest
|
|
7509
7652
|
} = {
|
|
7510
|
-
...defaultProps$
|
|
7653
|
+
...defaultProps$14,
|
|
7511
7654
|
...props
|
|
7512
7655
|
};
|
|
7513
7656
|
const classPrefix2 = "nut-address";
|
|
@@ -7598,7 +7741,7 @@ const InternalAddress = (props, ref) => {
|
|
|
7598
7741
|
));
|
|
7599
7742
|
};
|
|
7600
7743
|
const Address = forwardRef(InternalAddress);
|
|
7601
|
-
Address.defaultProps = defaultProps$
|
|
7744
|
+
Address.defaultProps = defaultProps$14;
|
|
7602
7745
|
Address.displayName = "NutAddress";
|
|
7603
7746
|
const Utils = {
|
|
7604
7747
|
/**
|
|
@@ -7848,7 +7991,7 @@ const isEnd = (day, days) => {
|
|
|
7848
7991
|
const isStartAndEnd = (days) => {
|
|
7849
7992
|
return days.length >= 2 && Utils.isEqual(days[0], days[1]);
|
|
7850
7993
|
};
|
|
7851
|
-
const defaultProps$
|
|
7994
|
+
const defaultProps$13 = {
|
|
7852
7995
|
...ComponentDefaults,
|
|
7853
7996
|
type: "single",
|
|
7854
7997
|
autoBackfill: false,
|
|
@@ -7908,7 +8051,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
7908
8051
|
onUpdate,
|
|
7909
8052
|
onDayClick,
|
|
7910
8053
|
onPageChange
|
|
7911
|
-
} = { ...defaultProps$
|
|
8054
|
+
} = { ...defaultProps$13, ...props };
|
|
7912
8055
|
const weekdays = locale.calendaritem.weekdays;
|
|
7913
8056
|
const weeks = [
|
|
7914
8057
|
...weekdays.slice(firstDayOfWeek, 7),
|
|
@@ -8249,6 +8392,8 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
8249
8392
|
const scrollTop2 = e.detail.scrollTop;
|
|
8250
8393
|
Taro.getEnv() === "WEB" && setScrollTop(scrollTop2);
|
|
8251
8394
|
let current = Math.floor(scrollTop2 / avgHeight);
|
|
8395
|
+
if (!monthsData[current + 1])
|
|
8396
|
+
return;
|
|
8252
8397
|
const nextTop = monthsData[current + 1].scrollTop;
|
|
8253
8398
|
const nextHeight = monthsData[current + 1].cssHeight;
|
|
8254
8399
|
if (current === 0) {
|
|
@@ -8453,9 +8598,9 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
8453
8598
|
};
|
|
8454
8599
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: classes, style }, renderHeader(), renderContent(), popup && !autoBackfill ? renderFooter() : ""));
|
|
8455
8600
|
});
|
|
8456
|
-
CalendarItem.defaultProps = defaultProps$
|
|
8601
|
+
CalendarItem.defaultProps = defaultProps$13;
|
|
8457
8602
|
CalendarItem.displayName = "NutCalendarItem";
|
|
8458
|
-
const defaultProps$
|
|
8603
|
+
const defaultProps$12 = {
|
|
8459
8604
|
...ComponentDefaults,
|
|
8460
8605
|
type: "single",
|
|
8461
8606
|
autoBackfill: false,
|
|
@@ -8518,7 +8663,7 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
8518
8663
|
onConfirm,
|
|
8519
8664
|
onDayClick,
|
|
8520
8665
|
onPageChange
|
|
8521
|
-
} = { ...defaultProps$
|
|
8666
|
+
} = { ...defaultProps$12, ...props };
|
|
8522
8667
|
const calendarRef = useRef(null);
|
|
8523
8668
|
const close2 = () => {
|
|
8524
8669
|
onClose && onClose();
|
|
@@ -8592,8 +8737,387 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
8592
8737
|
renderItem()
|
|
8593
8738
|
) : renderItem());
|
|
8594
8739
|
});
|
|
8595
|
-
Calendar.defaultProps = defaultProps$
|
|
8740
|
+
Calendar.defaultProps = defaultProps$12;
|
|
8596
8741
|
Calendar.displayName = "NutCalendar";
|
|
8742
|
+
const left = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNNi42MDUgOS40OWEuNzcxLjc3MSAwIDAgMSAwLS45OGwzLjYtNC4zNzJhLjc3MS43NzEgMCAwIDEgMS4xOS45ODFMOC4yIDlsMy4xOTcgMy44ODFhLjc3MS43NzEgMCAxIDEtMS4xOTEuOThsLTMuNi00LjM3eiIvPjwvc3ZnPg==";
|
|
8743
|
+
const right = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNMTEuMzk2IDkuNDlhLjc3MS43NzEgMCAwIDAgMC0uOThsLTMuNi00LjM3MmEuNzcxLjc3MSAwIDAgMC0xLjE5MS45ODFMOS44IDlsLTMuMTk2IDMuODgxYS43NzEuNzcxIDAgMCAwIDEuMTkuOThsMy42LTQuMzd6Ii8+PC9zdmc+";
|
|
8744
|
+
const doubleLeft = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNMTMuODUzIDQuMDI2YS43NzEuNzcxIDAgMCAxIC4xMiAxLjA4NUwxMC44NjQgOWwzLjExIDMuODg5YS43NzEuNzcxIDAgMSAxLTEuMjA0Ljk2M2wtMy40OTgtNC4zN2EuNzcxLjc3MSAwIDAgMSAwLS45NjRsMy40OTctNC4zNzFhLjc3MS43NzEgMCAwIDEgMS4wODQtLjEyem0tNS4yNDUgMGEuNzcxLjc3MSAwIDAgMSAuMTIgMS4wODVMNS42MTcgOWwzLjExMSAzLjg4OWEuNzcxLjc3MSAwIDAgMS0xLjIwNS45NjNsLTMuNDk3LTQuMzdhLjc3MS43NzEgMCAwIDEgMC0uOTY0bDMuNDk3LTQuMzcxYS43NzEuNzcxIDAgMCAxIDEuMDg1LS4xMnoiLz48L3N2Zz4=";
|
|
8745
|
+
const doubleRight = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNNC4xNDcgMTMuOTc0YS43NzEuNzcxIDAgMCAxLS4xMi0xLjA4NUw3LjEzNiA5IDQuMDI4IDUuMTFhLjc3MS43NzEgMCAxIDEgMS4yMDQtLjk2M2wzLjQ5NyA0LjM3MWEuNzcxLjc3MSAwIDAgMSAwIC45NjRsLTMuNDk3IDQuMzcxYS43NzEuNzcxIDAgMCAxLTEuMDg0LjEyem01LjI0NSAwYS43NzEuNzcxIDAgMCAxLS4xMi0xLjA4NUwxMi4zODMgOSA5LjI3MiA1LjExYS43NzEuNzcxIDAgMSAxIDEuMjA1LS45NjNsMy40OTcgNC4zNzFhLjc3MS43NzEgMCAwIDEgMCAuOTY0bC0zLjQ5NyA0LjM3MWEuNzcxLjc3MSAwIDAgMS0xLjA4NS4xMnoiLz48L3N2Zz4=";
|
|
8746
|
+
const Icon = ({ url: url2 }) => {
|
|
8747
|
+
const style = {
|
|
8748
|
+
background: `url('${url2}') no-repeat center`,
|
|
8749
|
+
backgroundSize: "100% 100%",
|
|
8750
|
+
width: "18px",
|
|
8751
|
+
height: "18px"
|
|
8752
|
+
};
|
|
8753
|
+
return /* @__PURE__ */ React__default.createElement(View, { style });
|
|
8754
|
+
};
|
|
8755
|
+
const Left = () => /* @__PURE__ */ React__default.createElement(Icon, { url: left });
|
|
8756
|
+
const Right = () => /* @__PURE__ */ React__default.createElement(Icon, { url: right });
|
|
8757
|
+
const DoubleLeft = () => /* @__PURE__ */ React__default.createElement(Icon, { url: doubleLeft });
|
|
8758
|
+
const DoubleRight = () => /* @__PURE__ */ React__default.createElement(Icon, { url: doubleRight });
|
|
8759
|
+
const convertDateToDay = (date4) => {
|
|
8760
|
+
return date4 ? {
|
|
8761
|
+
year: date4.getFullYear(),
|
|
8762
|
+
month: date4.getMonth() + 1,
|
|
8763
|
+
date: date4.getDate()
|
|
8764
|
+
} : null;
|
|
8765
|
+
};
|
|
8766
|
+
const convertDayToDate = (day) => {
|
|
8767
|
+
return day ? new Date(day.year, day.month - 1, day.date) : null;
|
|
8768
|
+
};
|
|
8769
|
+
const getPrevMonthDays = (year, month, firstDayOfWeek) => {
|
|
8770
|
+
let prevMonth = month - 1;
|
|
8771
|
+
let prevYear = year;
|
|
8772
|
+
if (prevMonth <= 0) {
|
|
8773
|
+
prevMonth = 12;
|
|
8774
|
+
prevYear -= 1;
|
|
8775
|
+
}
|
|
8776
|
+
let days = Utils.getMonthPreDay(year, month);
|
|
8777
|
+
days -= firstDayOfWeek;
|
|
8778
|
+
if (days >= 7) {
|
|
8779
|
+
days -= 7;
|
|
8780
|
+
}
|
|
8781
|
+
const preDates = Utils.getMonthDays(`${prevYear}`, `${prevMonth}`);
|
|
8782
|
+
const months = Array.from(Array(preDates), (_, k) => {
|
|
8783
|
+
return {
|
|
8784
|
+
type: "prev",
|
|
8785
|
+
year: prevYear,
|
|
8786
|
+
month: prevMonth,
|
|
8787
|
+
date: k + 1
|
|
8788
|
+
};
|
|
8789
|
+
});
|
|
8790
|
+
return months.slice(preDates - days);
|
|
8791
|
+
};
|
|
8792
|
+
const getCurrentMonthDays = (year, month) => {
|
|
8793
|
+
const days = Utils.getMonthDays(`${year}`, `${month}`);
|
|
8794
|
+
return Array.from(Array(days), (_, k) => {
|
|
8795
|
+
return {
|
|
8796
|
+
type: "current",
|
|
8797
|
+
year,
|
|
8798
|
+
month,
|
|
8799
|
+
date: k + 1
|
|
8800
|
+
};
|
|
8801
|
+
});
|
|
8802
|
+
};
|
|
8803
|
+
const getCurrentWeekDays = (day, firstDayOfWeek) => {
|
|
8804
|
+
const current = new Date(day.year, day.month - 1, day.date);
|
|
8805
|
+
const count = (current.getDay() + 7 - firstDayOfWeek) % 7;
|
|
8806
|
+
return [
|
|
8807
|
+
convertDateToDay(
|
|
8808
|
+
new Date(current.getTime() - 24 * 60 * 60 * 1e3 * count)
|
|
8809
|
+
),
|
|
8810
|
+
convertDateToDay(
|
|
8811
|
+
new Date(current.getTime() + 24 * 60 * 60 * 1e3 * (6 - count))
|
|
8812
|
+
)
|
|
8813
|
+
];
|
|
8814
|
+
};
|
|
8815
|
+
const defaultProps$11 = {
|
|
8816
|
+
...ComponentDefaults,
|
|
8817
|
+
type: "single",
|
|
8818
|
+
firstDayOfWeek: 0
|
|
8819
|
+
};
|
|
8820
|
+
const CalendarCard = React__default.forwardRef((props, ref) => {
|
|
8821
|
+
const { locale } = useConfig$1();
|
|
8822
|
+
const {
|
|
8823
|
+
style,
|
|
8824
|
+
type: type4,
|
|
8825
|
+
value,
|
|
8826
|
+
defaultValue,
|
|
8827
|
+
firstDayOfWeek,
|
|
8828
|
+
startDate,
|
|
8829
|
+
endDate,
|
|
8830
|
+
disableDay,
|
|
8831
|
+
renderDay,
|
|
8832
|
+
renderDayTop,
|
|
8833
|
+
renderDayBottom,
|
|
8834
|
+
onDayClick,
|
|
8835
|
+
onPageChange,
|
|
8836
|
+
onChange
|
|
8837
|
+
} = { ...defaultProps$11, ...props };
|
|
8838
|
+
const [month, setMonth] = useState(() => {
|
|
8839
|
+
let date4 = new Date(Date.now());
|
|
8840
|
+
const val = value || defaultValue;
|
|
8841
|
+
if (Array.isArray(val)) {
|
|
8842
|
+
if (val.length) {
|
|
8843
|
+
date4 = val[0];
|
|
8844
|
+
}
|
|
8845
|
+
} else if (val) {
|
|
8846
|
+
date4 = val;
|
|
8847
|
+
}
|
|
8848
|
+
return {
|
|
8849
|
+
year: date4.getFullYear(),
|
|
8850
|
+
month: date4.getMonth() + 1
|
|
8851
|
+
};
|
|
8852
|
+
});
|
|
8853
|
+
const [days, setDays] = useState([]);
|
|
8854
|
+
const valueToRange = (val) => {
|
|
8855
|
+
if (Array.isArray(val)) {
|
|
8856
|
+
return val.map((date4) => {
|
|
8857
|
+
return convertDateToDay(date4);
|
|
8858
|
+
});
|
|
8859
|
+
}
|
|
8860
|
+
return val ? [convertDateToDay(val)] : [];
|
|
8861
|
+
};
|
|
8862
|
+
const rangeTovalue = (range3) => {
|
|
8863
|
+
if (Array.isArray(range3)) {
|
|
8864
|
+
return range3.map((day) => {
|
|
8865
|
+
return convertDayToDate(day);
|
|
8866
|
+
});
|
|
8867
|
+
}
|
|
8868
|
+
return range3 ? [convertDayToDate(range3)] : [];
|
|
8869
|
+
};
|
|
8870
|
+
const [innerValue, setInnerValue] = useState(() => {
|
|
8871
|
+
const val = value || defaultValue ? valueToRange(value || defaultValue) : [];
|
|
8872
|
+
return val;
|
|
8873
|
+
});
|
|
8874
|
+
useEffect(() => {
|
|
8875
|
+
const val = value || defaultValue ? valueToRange(value || defaultValue) : [];
|
|
8876
|
+
setInnerValue(val);
|
|
8877
|
+
}, [value]);
|
|
8878
|
+
const change = (v) => {
|
|
8879
|
+
setInnerValue(v);
|
|
8880
|
+
if (type4 === "single") {
|
|
8881
|
+
const date4 = convertDayToDate(v[0]);
|
|
8882
|
+
onChange == null ? void 0 : onChange(date4);
|
|
8883
|
+
} else if (type4 === "multiple" || type4 === "range" || type4 === "week") {
|
|
8884
|
+
const val = rangeTovalue(v);
|
|
8885
|
+
onChange == null ? void 0 : onChange(val);
|
|
8886
|
+
}
|
|
8887
|
+
};
|
|
8888
|
+
const getDays = (month2) => {
|
|
8889
|
+
const y2 = month2.year;
|
|
8890
|
+
const m = month2.month;
|
|
8891
|
+
const days2 = [
|
|
8892
|
+
...getPrevMonthDays(y2, m, firstDayOfWeek),
|
|
8893
|
+
...getCurrentMonthDays(y2, m)
|
|
8894
|
+
];
|
|
8895
|
+
const size = days2.length;
|
|
8896
|
+
const yearOfNextMonth = month2.month === 12 ? month2.year + 1 : month2.year;
|
|
8897
|
+
const monthOfNextMonth = month2.month === 12 ? 1 : month2.month + 1;
|
|
8898
|
+
for (let i = 1; i <= 42 - size; i++) {
|
|
8899
|
+
days2.push({
|
|
8900
|
+
type: "next",
|
|
8901
|
+
year: yearOfNextMonth,
|
|
8902
|
+
month: monthOfNextMonth,
|
|
8903
|
+
date: i
|
|
8904
|
+
});
|
|
8905
|
+
}
|
|
8906
|
+
return days2;
|
|
8907
|
+
};
|
|
8908
|
+
useEffect(() => {
|
|
8909
|
+
const newDays = getDays(month);
|
|
8910
|
+
setDays(newDays);
|
|
8911
|
+
onPageChange == null ? void 0 : onPageChange(month);
|
|
8912
|
+
}, [month]);
|
|
8913
|
+
const isSameDay = (day1, day2) => {
|
|
8914
|
+
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);
|
|
8915
|
+
};
|
|
8916
|
+
const compareDay = (day1, day2) => {
|
|
8917
|
+
if (day1 && day2) {
|
|
8918
|
+
if (day1.year === day2.year) {
|
|
8919
|
+
if (day1.month === day2.month) {
|
|
8920
|
+
return day1.date - day2.date;
|
|
8921
|
+
}
|
|
8922
|
+
return day1.month - day2.month;
|
|
8923
|
+
}
|
|
8924
|
+
return day1.year - day2.year;
|
|
8925
|
+
}
|
|
8926
|
+
};
|
|
8927
|
+
const isDisable = (day) => {
|
|
8928
|
+
if (disableDay && disableDay(day)) {
|
|
8929
|
+
return true;
|
|
8930
|
+
}
|
|
8931
|
+
if (startDate && Number(compareDay(day, convertDateToDay(startDate))) < 0) {
|
|
8932
|
+
return true;
|
|
8933
|
+
}
|
|
8934
|
+
if (endDate && Number(compareDay(day, convertDateToDay(endDate))) > 0) {
|
|
8935
|
+
return true;
|
|
8936
|
+
}
|
|
8937
|
+
return false;
|
|
8938
|
+
};
|
|
8939
|
+
const isActive = (day) => {
|
|
8940
|
+
if (type4 === "single" || type4 === "multiple") {
|
|
8941
|
+
for (const val of innerValue) {
|
|
8942
|
+
if (isSameDay(day, val)) {
|
|
8943
|
+
return true;
|
|
8944
|
+
}
|
|
8945
|
+
}
|
|
8946
|
+
} else if (type4 === "range" && innerValue.length === 1 && isSameDay(innerValue[0], day)) {
|
|
8947
|
+
return true;
|
|
8948
|
+
}
|
|
8949
|
+
return false;
|
|
8950
|
+
};
|
|
8951
|
+
const isStart2 = (day) => {
|
|
8952
|
+
return (type4 === "range" || type4 === "week") && innerValue.length === 2 && isSameDay(day, innerValue[0]);
|
|
8953
|
+
};
|
|
8954
|
+
const isEnd2 = (day) => {
|
|
8955
|
+
return (type4 === "range" || type4 === "week") && innerValue.length === 2 && isSameDay(day, innerValue[1]);
|
|
8956
|
+
};
|
|
8957
|
+
const isMid = (day) => {
|
|
8958
|
+
if (type4 === "range" || type4 === "week") {
|
|
8959
|
+
if (innerValue.length === 2) {
|
|
8960
|
+
const c1 = compareDay(innerValue[0], day);
|
|
8961
|
+
const c2 = compareDay(day, innerValue[1]);
|
|
8962
|
+
if (c1 && c1 < 0 && c2 && c2 < 0) {
|
|
8963
|
+
return true;
|
|
8964
|
+
}
|
|
8965
|
+
}
|
|
8966
|
+
}
|
|
8967
|
+
return false;
|
|
8968
|
+
};
|
|
8969
|
+
const isWeekend = (day) => {
|
|
8970
|
+
const d = new Date(day.year, day.month - 1, day.date).getDay();
|
|
8971
|
+
return d === 0 || d === 6;
|
|
8972
|
+
};
|
|
8973
|
+
const getClasses = (day) => {
|
|
8974
|
+
if (isDisable(day)) {
|
|
8975
|
+
return ["disabled"];
|
|
8976
|
+
}
|
|
8977
|
+
const res = [];
|
|
8978
|
+
if (day.type === "current") {
|
|
8979
|
+
if (isActive(day)) {
|
|
8980
|
+
res.push("active");
|
|
8981
|
+
}
|
|
8982
|
+
if (isStart2(day)) {
|
|
8983
|
+
res.push("start");
|
|
8984
|
+
}
|
|
8985
|
+
if (isEnd2(day)) {
|
|
8986
|
+
res.push("end");
|
|
8987
|
+
}
|
|
8988
|
+
if (isMid(day)) {
|
|
8989
|
+
res.push("mid");
|
|
8990
|
+
}
|
|
8991
|
+
if (isWeekend(day)) {
|
|
8992
|
+
res.push("weekend");
|
|
8993
|
+
}
|
|
8994
|
+
}
|
|
8995
|
+
return res;
|
|
8996
|
+
};
|
|
8997
|
+
const jumpTo = (year, month2) => {
|
|
8998
|
+
setMonth({ year, month: month2 });
|
|
8999
|
+
};
|
|
9000
|
+
const jump = (step = 1) => {
|
|
9001
|
+
const current = month.year * 12 + month.month;
|
|
9002
|
+
let newMonth = (current + step) % 12;
|
|
9003
|
+
if (newMonth === 0) {
|
|
9004
|
+
newMonth = 12;
|
|
9005
|
+
}
|
|
9006
|
+
const newYear = Math.floor((current + step - newMonth) / 12);
|
|
9007
|
+
setMonth({
|
|
9008
|
+
year: newYear,
|
|
9009
|
+
month: newMonth
|
|
9010
|
+
});
|
|
9011
|
+
};
|
|
9012
|
+
React__default.useImperativeHandle(ref, () => {
|
|
9013
|
+
return {
|
|
9014
|
+
jump,
|
|
9015
|
+
jumpTo
|
|
9016
|
+
};
|
|
9017
|
+
});
|
|
9018
|
+
const handleDayClick = (day) => {
|
|
9019
|
+
if (day.type === "prev" || day.type === "next" || isDisable(day)) {
|
|
9020
|
+
return;
|
|
9021
|
+
}
|
|
9022
|
+
onDayClick == null ? void 0 : onDayClick(day);
|
|
9023
|
+
switch (type4) {
|
|
9024
|
+
case "single": {
|
|
9025
|
+
if (innerValue[0] && isSameDay(innerValue[0], day)) {
|
|
9026
|
+
change([]);
|
|
9027
|
+
} else {
|
|
9028
|
+
change([day]);
|
|
9029
|
+
}
|
|
9030
|
+
break;
|
|
9031
|
+
}
|
|
9032
|
+
case "multiple": {
|
|
9033
|
+
const t = innerValue.find((i) => isSameDay(i, day));
|
|
9034
|
+
if (t) {
|
|
9035
|
+
change(innerValue.filter((i) => i !== t));
|
|
9036
|
+
} else {
|
|
9037
|
+
change([...innerValue, day]);
|
|
9038
|
+
}
|
|
9039
|
+
break;
|
|
9040
|
+
}
|
|
9041
|
+
case "range": {
|
|
9042
|
+
const len = innerValue.length;
|
|
9043
|
+
if (len === 0 || len === 2) {
|
|
9044
|
+
change([day]);
|
|
9045
|
+
} else if (len === 1) {
|
|
9046
|
+
const t = compareDay(innerValue[0], day);
|
|
9047
|
+
if (t === 0 || t === null || t === void 0) {
|
|
9048
|
+
change([]);
|
|
9049
|
+
} else if (t < 0) {
|
|
9050
|
+
change([innerValue[0], day]);
|
|
9051
|
+
} else {
|
|
9052
|
+
change([day, innerValue[0]]);
|
|
9053
|
+
}
|
|
9054
|
+
} else {
|
|
9055
|
+
console.warn("[NutUI] Calendar range error");
|
|
9056
|
+
}
|
|
9057
|
+
break;
|
|
9058
|
+
}
|
|
9059
|
+
case "week": {
|
|
9060
|
+
if (innerValue.length === 2 || innerValue.length === 0) {
|
|
9061
|
+
const [left2, right2] = getCurrentWeekDays(day, firstDayOfWeek);
|
|
9062
|
+
change([left2, right2]);
|
|
9063
|
+
} else {
|
|
9064
|
+
console.warn("[NutUI] Calendar week error");
|
|
9065
|
+
}
|
|
9066
|
+
break;
|
|
9067
|
+
}
|
|
9068
|
+
default: {
|
|
9069
|
+
console.warn("[NutUI] Calendar type error");
|
|
9070
|
+
}
|
|
9071
|
+
}
|
|
9072
|
+
};
|
|
9073
|
+
const monthTitle = locale.calendaritem.monthTitle;
|
|
9074
|
+
const renderHeader = () => {
|
|
9075
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard-header" }, /* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard-header-left" }, /* @__PURE__ */ React__default.createElement("div", { className: "double-left", onClick: () => jump(-12) }, /* @__PURE__ */ React__default.createElement(DoubleLeft, null)), /* @__PURE__ */ React__default.createElement("div", { className: "left", onClick: () => jump(-1) }, /* @__PURE__ */ React__default.createElement(Left, null))), /* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard-header-title" }, monthTitle(month.year, month.month)), /* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard-header-right" }, /* @__PURE__ */ React__default.createElement("div", { className: "right", onClick: () => jump(1) }, /* @__PURE__ */ React__default.createElement(Right, null)), /* @__PURE__ */ React__default.createElement("div", { className: "double-right", onClick: () => jump(12) }, /* @__PURE__ */ React__default.createElement(DoubleRight, null))));
|
|
9076
|
+
};
|
|
9077
|
+
const [weekHeader] = useState(() => {
|
|
9078
|
+
const weekdays = locale.calendaritem.weekdays.map((day, index) => {
|
|
9079
|
+
return {
|
|
9080
|
+
name: day,
|
|
9081
|
+
key: index
|
|
9082
|
+
};
|
|
9083
|
+
});
|
|
9084
|
+
return [
|
|
9085
|
+
...weekdays.slice(firstDayOfWeek, 7),
|
|
9086
|
+
...weekdays.slice(0, firstDayOfWeek)
|
|
9087
|
+
];
|
|
9088
|
+
});
|
|
9089
|
+
const renderContent = () => {
|
|
9090
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard-content" }, /* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard-days" }, weekHeader.map((day) => {
|
|
9091
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
9092
|
+
"div",
|
|
9093
|
+
{
|
|
9094
|
+
className: classNames("nut-calendarcard-day", "header", {
|
|
9095
|
+
weekend: day.key === 0 || day.key === 6
|
|
9096
|
+
}),
|
|
9097
|
+
key: day.key
|
|
9098
|
+
},
|
|
9099
|
+
day.name
|
|
9100
|
+
);
|
|
9101
|
+
})), /* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard-days" }, days.map((day) => /* @__PURE__ */ React__default.createElement(
|
|
9102
|
+
"div",
|
|
9103
|
+
{
|
|
9104
|
+
className: classNames(
|
|
9105
|
+
"nut-calendarcard-day",
|
|
9106
|
+
day.type,
|
|
9107
|
+
getClasses(day)
|
|
9108
|
+
),
|
|
9109
|
+
key: `${day.year}-${day.month}-${day.date}`,
|
|
9110
|
+
onClick: () => handleDayClick(day)
|
|
9111
|
+
},
|
|
9112
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard-day-top" }, renderDayTop ? renderDayTop(day) : ""),
|
|
9113
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard-day-inner" }, renderDay ? renderDay(day) : day.date),
|
|
9114
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard-day-bottom" }, renderDayBottom ? renderDayBottom(day) : "")
|
|
9115
|
+
))));
|
|
9116
|
+
};
|
|
9117
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "nut-calendarcard", style }, renderHeader(), renderContent()));
|
|
9118
|
+
});
|
|
9119
|
+
CalendarCard.defaultProps = defaultProps$11;
|
|
9120
|
+
CalendarCard.displayName = "NutCalendarCard";
|
|
8597
9121
|
const CheckboxGroupContext = createContext(null);
|
|
8598
9122
|
const Context$1 = CheckboxGroupContext;
|
|
8599
9123
|
const defaultProps$10 = {
|
|
@@ -8817,84 +9341,6 @@ const Checkbox = (props) => {
|
|
|
8817
9341
|
Checkbox.defaultProps = defaultProps$$;
|
|
8818
9342
|
Checkbox.displayName = "NutCheckBox";
|
|
8819
9343
|
Checkbox.Group = CheckboxGroup;
|
|
8820
|
-
const MIN_DISTANCE = 10;
|
|
8821
|
-
function getDirection(x, y2) {
|
|
8822
|
-
if (x > y2 && x > MIN_DISTANCE) {
|
|
8823
|
-
return "horizontal";
|
|
8824
|
-
}
|
|
8825
|
-
if (y2 > x && y2 > MIN_DISTANCE) {
|
|
8826
|
-
return "vertical";
|
|
8827
|
-
}
|
|
8828
|
-
return "";
|
|
8829
|
-
}
|
|
8830
|
-
function useTouch() {
|
|
8831
|
-
const [startX, SetStartX] = useState(0);
|
|
8832
|
-
const [startY, SetStartY] = useState(0);
|
|
8833
|
-
const [moveX, SetMoveX] = useState(0);
|
|
8834
|
-
const [moveY, SetMoveY] = useState(0);
|
|
8835
|
-
const [deltaX, SetDeltaX] = useState(0);
|
|
8836
|
-
const [deltaY, SetDeltaY] = useState(0);
|
|
8837
|
-
const [offsetX, SetOffsetX] = useState(0);
|
|
8838
|
-
const [offsetY, SetOffsetY] = useState(0);
|
|
8839
|
-
const [direction, SetDirection] = useState("");
|
|
8840
|
-
const isVertical = () => direction === "vertical";
|
|
8841
|
-
const isHorizontal = () => direction === "horizontal";
|
|
8842
|
-
const reset = () => {
|
|
8843
|
-
SetDeltaX(0);
|
|
8844
|
-
SetDeltaY(0);
|
|
8845
|
-
SetOffsetX(0);
|
|
8846
|
-
SetOffsetY(0);
|
|
8847
|
-
SetDirection("");
|
|
8848
|
-
};
|
|
8849
|
-
const start = (event) => {
|
|
8850
|
-
reset();
|
|
8851
|
-
SetStartX(event.touches[0].clientX);
|
|
8852
|
-
SetStartY(event.touches[0].clientY);
|
|
8853
|
-
};
|
|
8854
|
-
const move = (event) => {
|
|
8855
|
-
const touch = event.touches[0];
|
|
8856
|
-
const dX = touch.clientX - startX;
|
|
8857
|
-
const dY = touch.clientY - startY;
|
|
8858
|
-
SetDeltaX(dX);
|
|
8859
|
-
SetDeltaY(dY);
|
|
8860
|
-
SetMoveX(touch.clientX);
|
|
8861
|
-
SetMoveY(touch.clientY);
|
|
8862
|
-
SetOffsetX(Math.abs(dX));
|
|
8863
|
-
SetOffsetY(Math.abs(dY));
|
|
8864
|
-
if (!direction) {
|
|
8865
|
-
SetDirection(getDirection(offsetX, offsetY));
|
|
8866
|
-
}
|
|
8867
|
-
};
|
|
8868
|
-
return {
|
|
8869
|
-
move,
|
|
8870
|
-
start,
|
|
8871
|
-
reset,
|
|
8872
|
-
startX,
|
|
8873
|
-
startY,
|
|
8874
|
-
moveX,
|
|
8875
|
-
moveY,
|
|
8876
|
-
deltaX,
|
|
8877
|
-
deltaY,
|
|
8878
|
-
offsetX,
|
|
8879
|
-
offsetY,
|
|
8880
|
-
direction,
|
|
8881
|
-
isVertical,
|
|
8882
|
-
isHorizontal
|
|
8883
|
-
};
|
|
8884
|
-
}
|
|
8885
|
-
let passiveSupported = false;
|
|
8886
|
-
if (canUseDom) {
|
|
8887
|
-
try {
|
|
8888
|
-
const opts = Object.defineProperty({}, "passive", {
|
|
8889
|
-
get() {
|
|
8890
|
-
passiveSupported = true;
|
|
8891
|
-
}
|
|
8892
|
-
});
|
|
8893
|
-
window.addEventListener("test-passive-supported", null, opts);
|
|
8894
|
-
} catch (e) {
|
|
8895
|
-
console.log(e);
|
|
8896
|
-
}
|
|
8897
|
-
}
|
|
8898
9344
|
const InternalPickerPanel = (props, ref) => {
|
|
8899
9345
|
const {
|
|
8900
9346
|
keyIndex = 0,
|
|
@@ -8918,7 +9364,7 @@ const InternalPickerPanel = (props, ref) => {
|
|
|
8918
9364
|
let timer;
|
|
8919
9365
|
const listRef = useRef(null);
|
|
8920
9366
|
const rollerRef = useRef(null);
|
|
8921
|
-
const
|
|
9367
|
+
const pickerPanelRef = useRef(null);
|
|
8922
9368
|
const [startTime, setStartTime] = useState(0);
|
|
8923
9369
|
const [startY, setStartY] = useState(0);
|
|
8924
9370
|
const transformY = useRef(0);
|
|
@@ -8964,11 +9410,11 @@ const InternalPickerPanel = (props, ref) => {
|
|
|
8964
9410
|
}
|
|
8965
9411
|
};
|
|
8966
9412
|
const setChooseValue = (move) => {
|
|
8967
|
-
chooseItem
|
|
9413
|
+
chooseItem == null ? void 0 : chooseItem(options == null ? void 0 : options[Math.round(-move / lineSpacing.current)], keyIndex);
|
|
8968
9414
|
};
|
|
8969
9415
|
const touchStart = (event) => {
|
|
8970
9416
|
touch.start(event);
|
|
8971
|
-
setStartY(touch.deltaY);
|
|
9417
|
+
setStartY(touch.deltaY.current);
|
|
8972
9418
|
setStartTime(Date.now());
|
|
8973
9419
|
transformY.current = scrollDistance;
|
|
8974
9420
|
};
|
|
@@ -8978,13 +9424,13 @@ const InternalPickerPanel = (props, ref) => {
|
|
|
8978
9424
|
moving.current = true;
|
|
8979
9425
|
preventDefault2(event, true);
|
|
8980
9426
|
}
|
|
8981
|
-
const move = touch.deltaY - startY;
|
|
9427
|
+
const move = touch.deltaY.current - startY;
|
|
8982
9428
|
setMove(move);
|
|
8983
9429
|
};
|
|
8984
9430
|
const touchEnd = () => {
|
|
8985
9431
|
if (!moving.current)
|
|
8986
9432
|
return;
|
|
8987
|
-
const move = touch.deltaY - startY;
|
|
9433
|
+
const move = touch.deltaY.current - startY;
|
|
8988
9434
|
const moveTime = Date.now() - startTime;
|
|
8989
9435
|
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
8990
9436
|
const distance = momentum(move, moveTime);
|
|
@@ -9031,9 +9477,7 @@ const InternalPickerPanel = (props, ref) => {
|
|
|
9031
9477
|
setChooseValue(scrollDistance);
|
|
9032
9478
|
};
|
|
9033
9479
|
const preventDefault2 = (event, isStopPropagation) => {
|
|
9034
|
-
|
|
9035
|
-
event.preventDefault();
|
|
9036
|
-
}
|
|
9480
|
+
event.preventDefault();
|
|
9037
9481
|
if (isStopPropagation) {
|
|
9038
9482
|
event.stopPropagation();
|
|
9039
9483
|
}
|
|
@@ -9074,56 +9518,56 @@ const InternalPickerPanel = (props, ref) => {
|
|
|
9074
9518
|
stopMomentum,
|
|
9075
9519
|
moving: moving.current
|
|
9076
9520
|
}));
|
|
9077
|
-
|
|
9521
|
+
useEffect(() => {
|
|
9522
|
+
const eventOptions = passiveSupported ? { passive: false, once: true } : false;
|
|
9523
|
+
const element = pickerPanelRef.current;
|
|
9524
|
+
element.addEventListener("touchstart", touchStart, eventOptions);
|
|
9525
|
+
element.addEventListener("touchmove", touchMove, eventOptions);
|
|
9526
|
+
element.addEventListener("touchend", touchEnd, eventOptions);
|
|
9527
|
+
return () => {
|
|
9528
|
+
element.removeEventListener("touchstart", touchStart, eventOptions);
|
|
9529
|
+
element.removeEventListener("touchmove", touchMove, eventOptions);
|
|
9530
|
+
element.removeEventListener("touchend", touchEnd, eventOptions);
|
|
9531
|
+
};
|
|
9532
|
+
});
|
|
9533
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "nut-picker-list", ref: pickerPanelRef }, /* @__PURE__ */ React__default.createElement(
|
|
9078
9534
|
"div",
|
|
9079
9535
|
{
|
|
9080
|
-
className: "nut-picker-
|
|
9081
|
-
ref:
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
onTouchEnd: touchEnd
|
|
9536
|
+
className: "nut-picker-roller",
|
|
9537
|
+
ref: rollerRef,
|
|
9538
|
+
style: threeDimensional ? touchRollerStyle() : touchTileStyle(),
|
|
9539
|
+
onTransitionEnd: stopMomentum
|
|
9085
9540
|
},
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
9096
|
-
"div",
|
|
9097
|
-
{
|
|
9098
|
-
className: `nut-picker-roller-item ${isHidden(index + 1) && "nut-picker-roller-item-hidden"}`,
|
|
9099
|
-
style: {
|
|
9100
|
-
transform: `rotate3d(1, 0, 0, ${-rotation * (index + 1)}deg) translate3d(0px, 0px, 104px)`,
|
|
9101
|
-
height: `${lineSpacing.current}px`,
|
|
9102
|
-
lineHeight: `${lineSpacing.current}px`
|
|
9103
|
-
},
|
|
9104
|
-
key: item.value ? item.value : index
|
|
9105
|
-
},
|
|
9106
|
-
/* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.text ? item.text : item)
|
|
9107
|
-
);
|
|
9108
|
-
}),
|
|
9109
|
-
!threeDimensional && options.map((item, index) => {
|
|
9110
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
9111
|
-
"div",
|
|
9112
|
-
{
|
|
9113
|
-
className: "nut-picker-roller-item-title",
|
|
9114
|
-
key: item.value ? item.value : index,
|
|
9115
|
-
style: {
|
|
9116
|
-
height: `${lineSpacing.current}px`,
|
|
9117
|
-
lineHeight: `${lineSpacing.current}px`
|
|
9118
|
-
}
|
|
9541
|
+
threeDimensional && options.map((item, index) => {
|
|
9542
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
9543
|
+
"div",
|
|
9544
|
+
{
|
|
9545
|
+
className: `nut-picker-roller-item ${isHidden(index + 1) && "nut-picker-roller-item-hidden"}`,
|
|
9546
|
+
style: {
|
|
9547
|
+
transform: `rotate3d(1, 0, 0, ${-rotation * (index + 1)}deg) translate3d(0px, 0px, 104px)`,
|
|
9548
|
+
height: `${lineSpacing.current}px`,
|
|
9549
|
+
lineHeight: `${lineSpacing.current}px`
|
|
9119
9550
|
},
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9551
|
+
key: item.value ? item.value : index
|
|
9552
|
+
},
|
|
9553
|
+
/* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.text ? item.text : item)
|
|
9554
|
+
);
|
|
9555
|
+
}),
|
|
9556
|
+
!threeDimensional && options.map((item, index) => {
|
|
9557
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
9558
|
+
"div",
|
|
9559
|
+
{
|
|
9560
|
+
className: "nut-picker-roller-item-title",
|
|
9561
|
+
key: item.value ? item.value : index,
|
|
9562
|
+
style: {
|
|
9563
|
+
height: `${lineSpacing.current}px`,
|
|
9564
|
+
lineHeight: `${lineSpacing.current}px`
|
|
9565
|
+
}
|
|
9566
|
+
},
|
|
9567
|
+
/* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.text ? item.text : item)
|
|
9568
|
+
);
|
|
9569
|
+
})
|
|
9570
|
+
), /* @__PURE__ */ React__default.createElement("div", { className: "nut-picker-mask" }), /* @__PURE__ */ React__default.createElement("div", { className: "nut-picker-indicator", ref: listRef }));
|
|
9127
9571
|
};
|
|
9128
9572
|
const PickerPanel = React__default.forwardRef(InternalPickerPanel);
|
|
9129
9573
|
const PickerPanel$1 = PickerPanel;
|
|
@@ -9158,6 +9602,7 @@ const InternalPicker = (props, ref) => {
|
|
|
9158
9602
|
visible,
|
|
9159
9603
|
title,
|
|
9160
9604
|
options = [],
|
|
9605
|
+
popupProps = {},
|
|
9161
9606
|
defaultValue = [],
|
|
9162
9607
|
className,
|
|
9163
9608
|
style,
|
|
@@ -9414,6 +9859,7 @@ const InternalPicker = (props, ref) => {
|
|
|
9414
9859
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, typeof children === "function" && children(selectedValue), /* @__PURE__ */ React__default.createElement(
|
|
9415
9860
|
Popup,
|
|
9416
9861
|
{
|
|
9862
|
+
...popupProps,
|
|
9417
9863
|
visible: innerVisible,
|
|
9418
9864
|
position: "bottom",
|
|
9419
9865
|
afterClose: () => {
|
|
@@ -9486,6 +9932,7 @@ const DatePicker = (props) => {
|
|
|
9486
9932
|
visible,
|
|
9487
9933
|
title,
|
|
9488
9934
|
defaultValue,
|
|
9935
|
+
pickerProps = {},
|
|
9489
9936
|
formatter,
|
|
9490
9937
|
onClose,
|
|
9491
9938
|
onConfirm,
|
|
@@ -9766,6 +10213,7 @@ const DatePicker = (props) => {
|
|
|
9766
10213
|
options.length && /* @__PURE__ */ React__default.createElement(
|
|
9767
10214
|
Picker$1,
|
|
9768
10215
|
{
|
|
10216
|
+
...pickerProps,
|
|
9769
10217
|
title,
|
|
9770
10218
|
visible,
|
|
9771
10219
|
options,
|
|
@@ -12589,12 +13037,12 @@ const Range = (props) => {
|
|
|
12589
13037
|
const value2 = min + delta / total * scope();
|
|
12590
13038
|
setEaxctValue(current);
|
|
12591
13039
|
if (isRange(current)) {
|
|
12592
|
-
const [
|
|
12593
|
-
const middle = (
|
|
13040
|
+
const [left2, right2] = current;
|
|
13041
|
+
const middle = (left2 + right2) / 2;
|
|
12594
13042
|
if (value2 <= middle) {
|
|
12595
|
-
updateValue([value2,
|
|
13043
|
+
updateValue([value2, right2], true);
|
|
12596
13044
|
} else {
|
|
12597
|
-
updateValue([
|
|
13045
|
+
updateValue([left2, value2], true);
|
|
12598
13046
|
}
|
|
12599
13047
|
} else {
|
|
12600
13048
|
updateValue(value2, true);
|
|
@@ -12623,11 +13071,11 @@ const Range = (props) => {
|
|
|
12623
13071
|
touch.move(event);
|
|
12624
13072
|
setDragStatus("draging");
|
|
12625
13073
|
const rect = await getRectByTaro(root2.current);
|
|
12626
|
-
let delta = touch.deltaX;
|
|
13074
|
+
let delta = touch.deltaX.current;
|
|
12627
13075
|
let total = rect.width;
|
|
12628
13076
|
let diff = delta / total * scope();
|
|
12629
13077
|
if (vertical) {
|
|
12630
|
-
delta = touch.deltaY;
|
|
13078
|
+
delta = touch.deltaY.current;
|
|
12631
13079
|
total = rect.height;
|
|
12632
13080
|
diff = delta / total * scope();
|
|
12633
13081
|
}
|
|
@@ -12850,8 +13298,8 @@ const SearchBar = (props) => {
|
|
|
12850
13298
|
clearable,
|
|
12851
13299
|
readOnly,
|
|
12852
13300
|
autoFocus,
|
|
12853
|
-
right,
|
|
12854
|
-
left,
|
|
13301
|
+
right: right2,
|
|
13302
|
+
left: left2,
|
|
12855
13303
|
leftIn,
|
|
12856
13304
|
rightIn,
|
|
12857
13305
|
onChange,
|
|
@@ -12869,10 +13317,11 @@ const SearchBar = (props) => {
|
|
|
12869
13317
|
searchSelf && searchSelf.focus();
|
|
12870
13318
|
};
|
|
12871
13319
|
const change = (event) => {
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
|
|
12875
|
-
|
|
13320
|
+
if (value === event.target.value)
|
|
13321
|
+
return;
|
|
13322
|
+
onChange && (onChange == null ? void 0 : onChange(event.target.value, event));
|
|
13323
|
+
setValue(event.target.value);
|
|
13324
|
+
event.target.value === "" && forceFocus();
|
|
12876
13325
|
};
|
|
12877
13326
|
const focus = (event) => {
|
|
12878
13327
|
const { value: value2 } = event.target;
|
|
@@ -12885,7 +13334,7 @@ const SearchBar = (props) => {
|
|
|
12885
13334
|
onBlur && (onBlur == null ? void 0 : onBlur(value2, event));
|
|
12886
13335
|
};
|
|
12887
13336
|
useEffect(() => {
|
|
12888
|
-
setValue(props.value);
|
|
13337
|
+
setValue(props.value || "");
|
|
12889
13338
|
}, [props.value]);
|
|
12890
13339
|
useEffect(() => {
|
|
12891
13340
|
autoFocus && forceFocus();
|
|
@@ -12919,9 +13368,9 @@ const SearchBar = (props) => {
|
|
|
12919
13368
|
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__leftin ${classPrefix2}__icon` }, leftIn);
|
|
12920
13369
|
};
|
|
12921
13370
|
const renderLeft = () => {
|
|
12922
|
-
if (!
|
|
13371
|
+
if (!left2)
|
|
12923
13372
|
return null;
|
|
12924
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__left` },
|
|
13373
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__left` }, left2);
|
|
12925
13374
|
};
|
|
12926
13375
|
const renderRightIn = () => {
|
|
12927
13376
|
if (!rightIn)
|
|
@@ -12929,9 +13378,9 @@ const SearchBar = (props) => {
|
|
|
12929
13378
|
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__rightin ${classPrefix2}__icon` }, rightIn);
|
|
12930
13379
|
};
|
|
12931
13380
|
const renderRight = () => {
|
|
12932
|
-
if (!
|
|
13381
|
+
if (!right2)
|
|
12933
13382
|
return null;
|
|
12934
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__right` },
|
|
13383
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__right` }, right2);
|
|
12935
13384
|
};
|
|
12936
13385
|
const handleClear = () => {
|
|
12937
13386
|
return /* @__PURE__ */ React__default.createElement(
|
|
@@ -12948,8 +13397,8 @@ const SearchBar = (props) => {
|
|
|
12948
13397
|
return;
|
|
12949
13398
|
}
|
|
12950
13399
|
setValue("");
|
|
12951
|
-
onClear && onClear(event);
|
|
12952
13400
|
forceFocus();
|
|
13401
|
+
onClear && onClear(event);
|
|
12953
13402
|
};
|
|
12954
13403
|
const onKeypress = (e) => {
|
|
12955
13404
|
if (e.key === "Enter" || e.keyCode === 13) {
|
|
@@ -14281,6 +14730,7 @@ const BaseDialog = (props) => {
|
|
|
14281
14730
|
}
|
|
14282
14731
|
}
|
|
14283
14732
|
);
|
|
14733
|
+
const refObject = useLockScrollTaro(!!(visible && lockScroll));
|
|
14284
14734
|
const renderFooter = () => {
|
|
14285
14735
|
if (footer === null)
|
|
14286
14736
|
return "";
|
|
@@ -14333,6 +14783,7 @@ const BaseDialog = (props) => {
|
|
|
14333
14783
|
View,
|
|
14334
14784
|
{
|
|
14335
14785
|
style: { display: visible ? "block" : "none" },
|
|
14786
|
+
ref: refObject,
|
|
14336
14787
|
catchMove: lockScroll
|
|
14337
14788
|
},
|
|
14338
14789
|
/* @__PURE__ */ React__default.createElement(React__default.Fragment, null, overlay ? /* @__PURE__ */ React__default.createElement(
|
|
@@ -14411,14 +14862,14 @@ const Drag = (props) => {
|
|
|
14411
14862
|
const getInfo = () => {
|
|
14412
14863
|
const el = myDrag.current;
|
|
14413
14864
|
if (el) {
|
|
14414
|
-
const { top, left, bottom, right } = boundary;
|
|
14865
|
+
const { top, left: left2, bottom, right: right2 } = boundary;
|
|
14415
14866
|
const { screenWidth, windowHeight } = getSystemInfoSync();
|
|
14416
14867
|
createSelectorQuery().select(`.${className}`).boundingClientRect((rec) => {
|
|
14417
14868
|
setBoundaryState({
|
|
14418
14869
|
top: -rec.top + top,
|
|
14419
|
-
left: -rec.left +
|
|
14870
|
+
left: -rec.left + left2,
|
|
14420
14871
|
bottom: windowHeight - rec.height - rec.top - bottom,
|
|
14421
|
-
right: screenWidth - rec.width - rec.left -
|
|
14872
|
+
right: screenWidth - rec.width - rec.left - right2
|
|
14422
14873
|
});
|
|
14423
14874
|
middleLine.current = screenWidth - rec.width - rec.left - (screenWidth - rec.width) / 2;
|
|
14424
14875
|
}).exec();
|
|
@@ -14812,9 +15263,7 @@ const NoticeBar = (props) => {
|
|
|
14812
15263
|
scrollList.current = [].concat(childs);
|
|
14813
15264
|
} else {
|
|
14814
15265
|
scrollList.current = [].concat(list);
|
|
14815
|
-
|
|
14816
|
-
startRollEasy();
|
|
14817
|
-
}, Number(duration));
|
|
15266
|
+
startRollEasy();
|
|
14818
15267
|
}
|
|
14819
15268
|
} else {
|
|
14820
15269
|
initScrollWrap();
|
|
@@ -14943,11 +15392,9 @@ const NoticeBar = (props) => {
|
|
|
14943
15392
|
}, [ready]);
|
|
14944
15393
|
useEffect(() => {
|
|
14945
15394
|
if (isVertical && children) {
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
autoplay();
|
|
14950
|
-
}, 300);
|
|
15395
|
+
init();
|
|
15396
|
+
stopAutoPlay();
|
|
15397
|
+
autoplay();
|
|
14951
15398
|
}
|
|
14952
15399
|
}, [children, container == null ? void 0 : container.current]);
|
|
14953
15400
|
const stopAutoPlay = () => {
|
|
@@ -15000,6 +15447,9 @@ const NoticeBar = (props) => {
|
|
|
15000
15447
|
};
|
|
15001
15448
|
const getStyle = (moveOffset = offset) => {
|
|
15002
15449
|
const target = innerRef.current;
|
|
15450
|
+
if (!target) {
|
|
15451
|
+
return;
|
|
15452
|
+
}
|
|
15003
15453
|
let _offset = 0;
|
|
15004
15454
|
const val = ((rect == null ? void 0 : rect.height) || 0) - height;
|
|
15005
15455
|
_offset = moveOffset + Number(active === childCount - 1 && val / 2);
|
|
@@ -15345,7 +15795,7 @@ const Popover = (props) => {
|
|
|
15345
15795
|
}
|
|
15346
15796
|
const contentWidth = elWidth;
|
|
15347
15797
|
const contentHeight = elHeight;
|
|
15348
|
-
const { width, height, left, top, right } = rootPosition;
|
|
15798
|
+
const { width, height, left: left2, top, right: right2 } = rootPosition;
|
|
15349
15799
|
const direction = location.split("-")[0];
|
|
15350
15800
|
const skew = location.split("-")[1];
|
|
15351
15801
|
let cross = 0;
|
|
@@ -15359,18 +15809,18 @@ const Popover = (props) => {
|
|
|
15359
15809
|
const h = direction === "bottom" ? height + cross : -(contentHeight + cross);
|
|
15360
15810
|
styles.top = `${top + h}px`;
|
|
15361
15811
|
if (!skew) {
|
|
15362
|
-
styles.left = `${-(contentWidth - width) / 2 +
|
|
15812
|
+
styles.left = `${-(contentWidth - width) / 2 + left2 + parallel}px`;
|
|
15363
15813
|
}
|
|
15364
15814
|
if (skew === "start") {
|
|
15365
|
-
styles.left = `${
|
|
15815
|
+
styles.left = `${left2 + parallel}px`;
|
|
15366
15816
|
}
|
|
15367
15817
|
if (skew === "end") {
|
|
15368
|
-
styles.left = `${
|
|
15818
|
+
styles.left = `${right2 + parallel}px`;
|
|
15369
15819
|
}
|
|
15370
15820
|
}
|
|
15371
15821
|
if (["left", "right"].includes(direction)) {
|
|
15372
15822
|
const contentW = direction === "left" ? -(contentWidth + cross) : width + cross;
|
|
15373
|
-
styles.left = `${
|
|
15823
|
+
styles.left = `${left2 + contentW}px`;
|
|
15374
15824
|
if (!skew) {
|
|
15375
15825
|
styles.top = `${top - contentHeight / 2 + height / 2 - 4 + parallel}px`;
|
|
15376
15826
|
}
|
|
@@ -15568,7 +16018,13 @@ const PullToRefresh = (p) => {
|
|
|
15568
16018
|
pullingRef.current = true;
|
|
15569
16019
|
setHeight(
|
|
15570
16020
|
Math.max(
|
|
15571
|
-
rubberbandIfOutOfBounds(
|
|
16021
|
+
rubberbandIfOutOfBounds(
|
|
16022
|
+
touch.deltaY.current,
|
|
16023
|
+
0,
|
|
16024
|
+
0,
|
|
16025
|
+
headHeight * 5,
|
|
16026
|
+
0.5
|
|
16027
|
+
),
|
|
15572
16028
|
0
|
|
15573
16029
|
)
|
|
15574
16030
|
);
|
|
@@ -15882,6 +16338,7 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
15882
16338
|
const leftWidth = actionWidth.left;
|
|
15883
16339
|
const rightWidth = actionWidth.right;
|
|
15884
16340
|
const onTouchStart = async (event) => {
|
|
16341
|
+
var _a;
|
|
15885
16342
|
if (leftWrapper.current) {
|
|
15886
16343
|
const leftRect = await getRectByTaro(leftWrapper.current);
|
|
15887
16344
|
setActionWidth((v) => ({ ...v, left: leftRect.width }));
|
|
@@ -15893,24 +16350,26 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
15893
16350
|
if (!props.disabled) {
|
|
15894
16351
|
startOffset.current = state.offset;
|
|
15895
16352
|
touch.start(event);
|
|
15896
|
-
props.onTouchStart
|
|
16353
|
+
(_a = props.onTouchStart) == null ? void 0 : _a.call(props, event);
|
|
15897
16354
|
}
|
|
15898
16355
|
};
|
|
15899
16356
|
const onTouchMove = (event) => {
|
|
16357
|
+
var _a;
|
|
15900
16358
|
if (props.disabled) {
|
|
15901
16359
|
return;
|
|
15902
16360
|
}
|
|
15903
16361
|
touch.move(event);
|
|
16362
|
+
(_a = props.onTouchMove) == null ? void 0 : _a.call(props, event);
|
|
15904
16363
|
if (touch.isHorizontal()) {
|
|
15905
16364
|
lockClick.current = true;
|
|
15906
16365
|
props.onTouchMove && props.onTouchMove(event);
|
|
15907
16366
|
const newState = { ...state, dragging: true };
|
|
15908
|
-
const isEdge = !opened || touch.deltaX * startOffset.current < 0;
|
|
16367
|
+
const isEdge = !opened || touch.deltaX.current * startOffset.current < 0;
|
|
15909
16368
|
if (isEdge) {
|
|
15910
16369
|
preventDefault(event, true);
|
|
15911
16370
|
}
|
|
15912
16371
|
newState.offset = rangeCalculation(
|
|
15913
|
-
touch.deltaX + startOffset.current,
|
|
16372
|
+
touch.deltaX.current + startOffset.current,
|
|
15914
16373
|
-rightWidth || 0,
|
|
15915
16374
|
leftWidth || 0
|
|
15916
16375
|
);
|
|
@@ -15918,13 +16377,14 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
15918
16377
|
}
|
|
15919
16378
|
};
|
|
15920
16379
|
const onTouchEnd = (event) => {
|
|
16380
|
+
var _a;
|
|
15921
16381
|
if (state.dragging) {
|
|
15922
16382
|
setState((v) => ({ ...v, dragging: false }));
|
|
15923
16383
|
toggle(state.offset > 0 ? "left" : "right");
|
|
15924
16384
|
setTimeout(() => {
|
|
15925
16385
|
lockClick.current = false;
|
|
15926
16386
|
}, 0);
|
|
15927
|
-
props.onTouchEnd
|
|
16387
|
+
(_a = props.onTouchEnd) == null ? void 0 : _a.call(props, event);
|
|
15928
16388
|
}
|
|
15929
16389
|
};
|
|
15930
16390
|
const toggle = (side) => {
|
|
@@ -15977,11 +16437,12 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
15977
16437
|
return null;
|
|
15978
16438
|
};
|
|
15979
16439
|
const handleOperate = (event, position) => {
|
|
16440
|
+
var _a;
|
|
15980
16441
|
event.stopPropagation();
|
|
15981
16442
|
if (props.beforeClose) {
|
|
15982
16443
|
props.beforeClose(position);
|
|
15983
16444
|
} else {
|
|
15984
|
-
props.onActionClick
|
|
16445
|
+
(_a = props.onActionClick) == null ? void 0 : _a.call(props, event, position);
|
|
15985
16446
|
}
|
|
15986
16447
|
};
|
|
15987
16448
|
useImperativeHandle(instanceRef, () => ({
|
|
@@ -17287,13 +17748,13 @@ const Ellipsis = (props) => {
|
|
|
17287
17748
|
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) || ""}`;
|
|
17288
17749
|
setContentCopy(newContent);
|
|
17289
17750
|
};
|
|
17290
|
-
const tailorContent = (
|
|
17751
|
+
const tailorContent = (left2, right2, type4 = "") => {
|
|
17291
17752
|
const threeDotWidth = symbolTextWidth;
|
|
17292
17753
|
const direc = direction === "middle" && type4 ? type4 : direction;
|
|
17293
17754
|
setExceeded(true);
|
|
17294
17755
|
let widthPart = -1;
|
|
17295
|
-
const start =
|
|
17296
|
-
const end =
|
|
17756
|
+
const start = left2;
|
|
17757
|
+
const end = right2;
|
|
17297
17758
|
let cutoff = 0;
|
|
17298
17759
|
let marking = 0;
|
|
17299
17760
|
if (direc === "end") {
|
|
@@ -18492,8 +18953,8 @@ const Tour = (props) => {
|
|
|
18492
18953
|
});
|
|
18493
18954
|
};
|
|
18494
18955
|
const maskStyle = () => {
|
|
18495
|
-
const { width, height, left, top } = maskRect;
|
|
18496
|
-
const center = [
|
|
18956
|
+
const { width, height, left: left2, top } = maskRect;
|
|
18957
|
+
const center = [left2 + width / 2, top + height / 2];
|
|
18497
18958
|
const w2 = Number(maskWidth || width);
|
|
18498
18959
|
const h = Number(maskHeight || height);
|
|
18499
18960
|
const styles = {
|
|
@@ -19213,7 +19674,7 @@ const TrendArrow = (props) => {
|
|
|
19213
19674
|
digits,
|
|
19214
19675
|
symbol,
|
|
19215
19676
|
zero,
|
|
19216
|
-
left,
|
|
19677
|
+
left: left2,
|
|
19217
19678
|
sync,
|
|
19218
19679
|
color,
|
|
19219
19680
|
riseColor,
|
|
@@ -19259,8 +19720,8 @@ const TrendArrow = (props) => {
|
|
|
19259
19720
|
};
|
|
19260
19721
|
return iconProps;
|
|
19261
19722
|
})();
|
|
19262
|
-
const renderContent = (
|
|
19263
|
-
const classNameSuffix = !
|
|
19723
|
+
const renderContent = (left22) => {
|
|
19724
|
+
const classNameSuffix = !left22 ? "icon-after" : "icon-before";
|
|
19264
19725
|
return /* @__PURE__ */ React__default.createElement(
|
|
19265
19726
|
"span",
|
|
19266
19727
|
{
|
|
@@ -19270,7 +19731,7 @@ const TrendArrow = (props) => {
|
|
|
19270
19731
|
calcRate
|
|
19271
19732
|
);
|
|
19272
19733
|
};
|
|
19273
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, !
|
|
19734
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, !left2 && renderContent(!left2), Number(value) !== 0 && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, rateTrend.current ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, riseIcon || /* @__PURE__ */ React__default.createElement(a, { color: calcIconProps.color })) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, dropIcon || /* @__PURE__ */ React__default.createElement(a$1, { color: calcIconProps.color }))), left2 && renderContent(!left2));
|
|
19274
19735
|
};
|
|
19275
19736
|
TrendArrow.defaultProps = defaultProps$1;
|
|
19276
19737
|
TrendArrow.displayName = "NutTrendArrow";
|
|
@@ -19418,6 +19879,7 @@ export {
|
|
|
19418
19879
|
Barrage,
|
|
19419
19880
|
Button,
|
|
19420
19881
|
Calendar,
|
|
19882
|
+
CalendarCard,
|
|
19421
19883
|
CalendarItem,
|
|
19422
19884
|
Card,
|
|
19423
19885
|
Cascader,
|