@nutui/nutui-react 1.3.3 → 1.3.4
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 +21 -0
- package/README.md +3 -2
- package/dist/esm/Address.js +7 -5
- package/dist/esm/Audio.js +7 -5
- package/dist/esm/Avatar.js +5 -3
- package/dist/esm/BackTop.js +5 -3
- package/dist/esm/Badge.js +5 -3
- package/dist/esm/Barrage.js +1 -1
- package/dist/esm/Button.js +7 -5
- package/dist/esm/Cascader.js +1 -1
- package/dist/esm/Cell.js +7 -5
- package/dist/esm/Checkbox.js +2 -2
- package/dist/esm/Collapse.js +2 -1
- package/dist/esm/CollapseItem.js +13 -9
- package/dist/esm/FixedNav.js +5 -3
- package/dist/esm/GridItem.js +5 -3
- package/dist/esm/Infiniteloading.js +13 -11
- package/dist/esm/Input.js +9 -7
- package/dist/esm/InputNumber.js +7 -5
- package/dist/esm/Menu.js +5 -3
- package/dist/esm/MenuItem.js +5 -5
- package/dist/esm/NavBar.js +7 -5
- package/dist/esm/NoticeBar.js +9 -7
- package/dist/esm/Notify.js +1 -1
- package/dist/esm/Popover.js +5 -3
- package/dist/esm/Popup.js +5 -3
- package/dist/esm/Progress.js +5 -3
- package/dist/esm/PullToRefresh.js +1 -30
- package/dist/esm/Radio.js +5 -3
- package/dist/esm/Rate.js +10 -8
- package/dist/esm/SearchBar.js +5 -3
- package/dist/esm/ShortPassword.js +5 -3
- package/dist/esm/Step.js +5 -3
- package/dist/esm/Sticky/style/index.js +2 -0
- package/dist/esm/Sticky.js +209 -0
- package/dist/esm/TabbarItem.js +5 -3
- package/dist/esm/Table.js +5 -3
- package/dist/esm/Tabs.js +2 -2
- package/dist/esm/Tag.js +5 -3
- package/dist/esm/Toast.js +1 -1
- package/dist/esm/Uploader.js +121 -44
- package/dist/esm/get-scroll-parent-3dcd3f53.js +32 -0
- package/dist/esm/nutui-react.es.js +1 -0
- package/dist/esm/render-18227751.js +43 -0
- package/dist/esm/{tabs-41234c2c.js → tabs-0896a61b.js} +5 -3
- package/dist/esm/types/src/packages/button/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/collapseitem/collapseitem.d.ts +1 -0
- package/dist/esm/types/src/packages/drag/drag.d.ts +1 -1
- package/dist/esm/types/src/packages/fixednav/fixednav.d.ts +1 -1
- package/dist/esm/types/src/packages/griditem/griditem.d.ts +1 -1
- package/dist/esm/types/src/packages/infiniteloading/infiniteloading.d.ts +3 -3
- package/dist/esm/types/src/packages/input/input.d.ts +1 -1
- package/dist/esm/types/src/packages/menuitem/menuitem.d.ts +1 -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.taro.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/popover/popover.d.ts +1 -1
- package/dist/esm/types/src/packages/progress/progress.d.ts +1 -1
- package/dist/esm/types/src/packages/radio/radio.d.ts +1 -1
- package/dist/esm/types/src/packages/sticky/__test__/sticky.spec.d.ts +1 -0
- package/dist/esm/types/src/packages/sticky/demo.d.ts +3 -0
- package/dist/esm/types/src/packages/sticky/index.d.ts +2 -0
- package/dist/esm/types/src/packages/sticky/index.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/sticky/sticky.d.ts +13 -0
- package/dist/esm/types/src/packages/tabs/tabs.d.ts +1 -1
- package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/uploader/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/uploader/upload.d.ts +4 -0
- package/dist/esm/types/src/packages/uploader/uploader.d.ts +16 -12
- package/dist/esm/types/src/utils/date.d.ts +1 -1
- package/dist/esm/types/src/utils/useWatch.d.ts +6 -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/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +1002 -616
- package/dist/nutui.react.umd.js +1002 -615
- package/dist/packages/barrage/barrage.scss +7 -2
- package/dist/packages/circleprogress/circleprogress.scss +3 -0
- package/dist/packages/sticky/sticky.scss +0 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/types/index.d.ts +37 -24
- package/dist/types/nutui.react.build.ts +3 -1
- package/package.json +10 -5
- package/dist/esm/render-4a3856cb.js +0 -32
package/dist/nutui.react.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.3.
|
|
2
|
+
* @nutui/nutui-react v1.3.4-beta.0 Wed Sep 21 2022 14:27:51 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -172,6 +172,8 @@
|
|
|
172
172
|
onClick,
|
|
173
173
|
className,
|
|
174
174
|
style,
|
|
175
|
+
iconClassPrefix,
|
|
176
|
+
iconFontClassName,
|
|
175
177
|
...rest
|
|
176
178
|
} = {
|
|
177
179
|
...defaultProps$1k,
|
|
@@ -242,12 +244,12 @@
|
|
|
242
244
|
className: "nut-button__warp",
|
|
243
245
|
style: getStyle()
|
|
244
246
|
}, loading && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
245
|
-
classPrefix:
|
|
246
|
-
fontClassName:
|
|
247
|
+
classPrefix: iconClassPrefix,
|
|
248
|
+
fontClassName: iconFontClassName,
|
|
247
249
|
name: "loading"
|
|
248
250
|
}), !loading && icon ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
249
|
-
classPrefix:
|
|
250
|
-
fontClassName:
|
|
251
|
+
classPrefix: iconClassPrefix,
|
|
252
|
+
fontClassName: iconFontClassName,
|
|
251
253
|
name: icon
|
|
252
254
|
}) : "", children));
|
|
253
255
|
};
|
|
@@ -1508,6 +1510,8 @@
|
|
|
1508
1510
|
className,
|
|
1509
1511
|
iconSlot,
|
|
1510
1512
|
linkSlot,
|
|
1513
|
+
iconClassPrefix,
|
|
1514
|
+
iconFontClassName,
|
|
1511
1515
|
...rest
|
|
1512
1516
|
} = {
|
|
1513
1517
|
...defaultProps$1j,
|
|
@@ -1541,8 +1545,8 @@
|
|
|
1541
1545
|
}, children || /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, icon || iconSlot ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
1542
1546
|
className: b2("icon")
|
|
1543
1547
|
}, iconSlot || (icon ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
1544
|
-
classPrefix:
|
|
1545
|
-
fontClassName:
|
|
1548
|
+
classPrefix: iconClassPrefix,
|
|
1549
|
+
fontClassName: iconFontClassName,
|
|
1546
1550
|
name: icon,
|
|
1547
1551
|
className: "icon"
|
|
1548
1552
|
}) : null)) : null, title || subTitle ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -1557,8 +1561,8 @@
|
|
|
1557
1561
|
}),
|
|
1558
1562
|
style: styles
|
|
1559
1563
|
}, desc) : null, !linkSlot && (isLink || to2) ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
1560
|
-
classPrefix:
|
|
1561
|
-
fontClassName:
|
|
1564
|
+
classPrefix: iconClassPrefix,
|
|
1565
|
+
fontClassName: iconFontClassName,
|
|
1562
1566
|
name: "right",
|
|
1563
1567
|
className: b2("link")
|
|
1564
1568
|
}) : linkSlot));
|
|
@@ -1592,9 +1596,9 @@
|
|
|
1592
1596
|
CellGroup.displayName = "NutCellGroup";
|
|
1593
1597
|
var classnames = { exports: {} };
|
|
1594
1598
|
/*!
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1599
|
+
Copyright (c) 2018 Jed Watson.
|
|
1600
|
+
Licensed under the MIT License (MIT), see
|
|
1601
|
+
http://jedwatson.github.io/classnames
|
|
1598
1602
|
*/
|
|
1599
1603
|
(function(module2) {
|
|
1600
1604
|
(function() {
|
|
@@ -1616,14 +1620,14 @@
|
|
|
1616
1620
|
}
|
|
1617
1621
|
}
|
|
1618
1622
|
} else if (argType === "object") {
|
|
1619
|
-
if (arg.toString
|
|
1620
|
-
for (var key in arg) {
|
|
1621
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1622
|
-
classes.push(key);
|
|
1623
|
-
}
|
|
1624
|
-
}
|
|
1625
|
-
} else {
|
|
1623
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
1626
1624
|
classes.push(arg.toString());
|
|
1625
|
+
continue;
|
|
1626
|
+
}
|
|
1627
|
+
for (var key in arg) {
|
|
1628
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1629
|
+
classes.push(key);
|
|
1630
|
+
}
|
|
1627
1631
|
}
|
|
1628
1632
|
}
|
|
1629
1633
|
}
|
|
@@ -2199,7 +2203,9 @@
|
|
|
2199
2203
|
onClickCloseIcon,
|
|
2200
2204
|
onOpened,
|
|
2201
2205
|
onClosed,
|
|
2202
|
-
onClick
|
|
2206
|
+
onClick,
|
|
2207
|
+
iconClassPrefix,
|
|
2208
|
+
iconFontClassName
|
|
2203
2209
|
} = props;
|
|
2204
2210
|
const [index2, setIndex] = React.useState(zIndex || _zIndex);
|
|
2205
2211
|
const [innerVisible, setInnerVisible] = React.useState(visible);
|
|
@@ -2298,8 +2304,8 @@
|
|
|
2298
2304
|
className: closeClasses,
|
|
2299
2305
|
onClick: onHandleClickCloseIcon
|
|
2300
2306
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
2301
|
-
classPrefix:
|
|
2302
|
-
fontClassName:
|
|
2307
|
+
classPrefix: iconClassPrefix,
|
|
2308
|
+
fontClassName: iconFontClassName,
|
|
2303
2309
|
name: closeIcon,
|
|
2304
2310
|
size: "12px"
|
|
2305
2311
|
})) : ""));
|
|
@@ -2711,8 +2717,13 @@
|
|
|
2711
2717
|
center,
|
|
2712
2718
|
reverse,
|
|
2713
2719
|
direction,
|
|
2720
|
+
iconClassPrefix,
|
|
2721
|
+
iconFontClassName,
|
|
2714
2722
|
...rest
|
|
2715
|
-
} = {
|
|
2723
|
+
} = {
|
|
2724
|
+
...defaultProps$1a,
|
|
2725
|
+
...props
|
|
2726
|
+
};
|
|
2716
2727
|
const b2 = cn("grid-item");
|
|
2717
2728
|
const pxCheck2 = (value) => {
|
|
2718
2729
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
@@ -2745,8 +2756,8 @@
|
|
|
2745
2756
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2746
2757
|
className: contentClass()
|
|
2747
2758
|
}, icon && isIconName() ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
2748
|
-
classPrefix:
|
|
2749
|
-
fontClassName:
|
|
2759
|
+
classPrefix: iconClassPrefix,
|
|
2760
|
+
fontClassName: iconFontClassName,
|
|
2750
2761
|
name: icon,
|
|
2751
2762
|
size: iconSize || parentIconSize,
|
|
2752
2763
|
color: iconColor || parentIconColor
|
|
@@ -2756,6 +2767,218 @@
|
|
|
2756
2767
|
};
|
|
2757
2768
|
GridItem.defaultProps = defaultProps$1a;
|
|
2758
2769
|
GridItem.displayName = "NutGridItem";
|
|
2770
|
+
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
2771
|
+
const defaultRoot = canUseDom ? window : void 0;
|
|
2772
|
+
const overflowStylePatterns = ["scroll", "auto", "overlay"];
|
|
2773
|
+
function isElement(node) {
|
|
2774
|
+
const ELEMENT_NODE_TYPE = 1;
|
|
2775
|
+
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
2776
|
+
}
|
|
2777
|
+
function getScrollParent(el, root = defaultRoot) {
|
|
2778
|
+
let node = el;
|
|
2779
|
+
while (node && node !== root && isElement(node)) {
|
|
2780
|
+
if (node === document.body) {
|
|
2781
|
+
return root;
|
|
2782
|
+
}
|
|
2783
|
+
const { overflowY } = window.getComputedStyle(node);
|
|
2784
|
+
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
2785
|
+
return node;
|
|
2786
|
+
}
|
|
2787
|
+
node = node.parentNode;
|
|
2788
|
+
}
|
|
2789
|
+
return root;
|
|
2790
|
+
}
|
|
2791
|
+
function isWindow(val) {
|
|
2792
|
+
return val === window;
|
|
2793
|
+
}
|
|
2794
|
+
const getRect = (elementRef) => {
|
|
2795
|
+
const element = elementRef;
|
|
2796
|
+
if (isWindow(element)) {
|
|
2797
|
+
const width = element.innerWidth;
|
|
2798
|
+
const height = element.innerHeight;
|
|
2799
|
+
return {
|
|
2800
|
+
top: 0,
|
|
2801
|
+
left: 0,
|
|
2802
|
+
right: width,
|
|
2803
|
+
bottom: height,
|
|
2804
|
+
width,
|
|
2805
|
+
height
|
|
2806
|
+
};
|
|
2807
|
+
}
|
|
2808
|
+
if (element && element.getBoundingClientRect) {
|
|
2809
|
+
return element.getBoundingClientRect();
|
|
2810
|
+
}
|
|
2811
|
+
return {
|
|
2812
|
+
top: 0,
|
|
2813
|
+
left: 0,
|
|
2814
|
+
right: 0,
|
|
2815
|
+
bottom: 0,
|
|
2816
|
+
width: 0,
|
|
2817
|
+
height: 0
|
|
2818
|
+
};
|
|
2819
|
+
};
|
|
2820
|
+
function useWatch(dep, callback, config2 = { immediate: false }) {
|
|
2821
|
+
const { immediate } = config2;
|
|
2822
|
+
const prev = React.useRef();
|
|
2823
|
+
const inited = React.useRef(false);
|
|
2824
|
+
const stop2 = React.useRef(false);
|
|
2825
|
+
React.useEffect(() => {
|
|
2826
|
+
const execute = () => callback(prev.current);
|
|
2827
|
+
if (!stop2.current) {
|
|
2828
|
+
if (!inited.current) {
|
|
2829
|
+
inited.current = true;
|
|
2830
|
+
if (immediate) {
|
|
2831
|
+
execute();
|
|
2832
|
+
}
|
|
2833
|
+
} else {
|
|
2834
|
+
execute();
|
|
2835
|
+
}
|
|
2836
|
+
prev.current = dep;
|
|
2837
|
+
}
|
|
2838
|
+
}, [dep]);
|
|
2839
|
+
return () => {
|
|
2840
|
+
stop2.current = true;
|
|
2841
|
+
};
|
|
2842
|
+
}
|
|
2843
|
+
const Sticky = (props) => {
|
|
2844
|
+
const {
|
|
2845
|
+
position = "top",
|
|
2846
|
+
top = 0,
|
|
2847
|
+
bottom = 0,
|
|
2848
|
+
zIndex = 2e3,
|
|
2849
|
+
children,
|
|
2850
|
+
container,
|
|
2851
|
+
className,
|
|
2852
|
+
onChange,
|
|
2853
|
+
...rest
|
|
2854
|
+
} = props;
|
|
2855
|
+
const stickyRef = React.useRef(null);
|
|
2856
|
+
const rootRef = React.useRef(null);
|
|
2857
|
+
const offset = position === "top" ? top : bottom;
|
|
2858
|
+
const [isFixed, setIsFixed] = React.useState(false);
|
|
2859
|
+
const [stickyStyle, setStickyStyle] = React.useState({
|
|
2860
|
+
[position]: `${offset}px`,
|
|
2861
|
+
zIndex
|
|
2862
|
+
});
|
|
2863
|
+
const [rootStyle, setRootStyle] = React.useState({});
|
|
2864
|
+
const getElement = React.useCallback(() => {
|
|
2865
|
+
return getScrollParent(rootRef.current);
|
|
2866
|
+
}, []);
|
|
2867
|
+
React.useEffect(() => {
|
|
2868
|
+
if (position === "top")
|
|
2869
|
+
return;
|
|
2870
|
+
const containerEle = container == null ? void 0 : container.current;
|
|
2871
|
+
if (!rootRef.current && !containerEle)
|
|
2872
|
+
return;
|
|
2873
|
+
const rootRect = getRect(rootRef.current);
|
|
2874
|
+
const containerRect = getRect(containerEle);
|
|
2875
|
+
const clientHeight = document.documentElement.clientHeight;
|
|
2876
|
+
const stCurrent = stickyRef.current;
|
|
2877
|
+
const stickyRect = getRect(stCurrent);
|
|
2878
|
+
let fixed = clientHeight - bottom < rootRect.bottom;
|
|
2879
|
+
if (containerEle) {
|
|
2880
|
+
fixed = containerRect.bottom > clientHeight - bottom - stickyRect.height && clientHeight - bottom - stickyRect.height > containerRect.top;
|
|
2881
|
+
}
|
|
2882
|
+
const defaultPostVal = fixed ? "fixed" : "inherit";
|
|
2883
|
+
setStickyStyle((prev) => {
|
|
2884
|
+
return {
|
|
2885
|
+
...prev,
|
|
2886
|
+
position: defaultPostVal
|
|
2887
|
+
};
|
|
2888
|
+
});
|
|
2889
|
+
setIsFixed(fixed);
|
|
2890
|
+
}, [position, container, bottom]);
|
|
2891
|
+
const handleScroll = React.useCallback(() => {
|
|
2892
|
+
const containerEle = container == null ? void 0 : container.current;
|
|
2893
|
+
if (!rootRef.current && !containerEle)
|
|
2894
|
+
return;
|
|
2895
|
+
const rootRect = getRect(rootRef.current);
|
|
2896
|
+
const stCurrent = stickyRef.current;
|
|
2897
|
+
const stickyRect = getRect(stCurrent);
|
|
2898
|
+
const containerRect = getRect(containerEle);
|
|
2899
|
+
if (rootRect.height) {
|
|
2900
|
+
setRootStyle((prev) => {
|
|
2901
|
+
return {
|
|
2902
|
+
...prev,
|
|
2903
|
+
height: rootRect.height
|
|
2904
|
+
};
|
|
2905
|
+
});
|
|
2906
|
+
}
|
|
2907
|
+
if (position === "top") {
|
|
2908
|
+
if (containerEle) {
|
|
2909
|
+
const fixed = top > rootRect.top && containerRect.bottom > 0;
|
|
2910
|
+
const positionVal = fixed ? "fixed" : "inherit";
|
|
2911
|
+
const diff = containerRect.bottom - top - stickyRect.height;
|
|
2912
|
+
const transform = diff < 0 ? diff : 0;
|
|
2913
|
+
setStickyStyle((prev) => {
|
|
2914
|
+
return {
|
|
2915
|
+
...prev,
|
|
2916
|
+
position: positionVal,
|
|
2917
|
+
transform: `translate3d(0, ${transform}px, 0)`
|
|
2918
|
+
};
|
|
2919
|
+
});
|
|
2920
|
+
setIsFixed(fixed);
|
|
2921
|
+
} else {
|
|
2922
|
+
const fixed = top > rootRect.top;
|
|
2923
|
+
const positionVal = fixed ? "fixed" : "inherit";
|
|
2924
|
+
setStickyStyle((prev) => {
|
|
2925
|
+
return {
|
|
2926
|
+
...prev,
|
|
2927
|
+
position: positionVal
|
|
2928
|
+
};
|
|
2929
|
+
});
|
|
2930
|
+
setIsFixed(fixed);
|
|
2931
|
+
}
|
|
2932
|
+
} else {
|
|
2933
|
+
const clientHeight = document.documentElement.clientHeight;
|
|
2934
|
+
if (containerEle) {
|
|
2935
|
+
const fixed = containerRect.bottom > 0 && clientHeight - bottom - stickyRect.height > containerRect.top;
|
|
2936
|
+
const positionVal = fixed ? "fixed" : "inherit";
|
|
2937
|
+
const diff = containerRect.bottom - (clientHeight - bottom);
|
|
2938
|
+
const transform = diff < 0 ? diff : 0;
|
|
2939
|
+
setStickyStyle((prev) => {
|
|
2940
|
+
return {
|
|
2941
|
+
...prev,
|
|
2942
|
+
position: positionVal,
|
|
2943
|
+
transform: `translate3d(0, ${transform}px, 0)`
|
|
2944
|
+
};
|
|
2945
|
+
});
|
|
2946
|
+
setIsFixed(fixed);
|
|
2947
|
+
} else {
|
|
2948
|
+
const fixed = clientHeight - bottom < rootRect.bottom;
|
|
2949
|
+
const positionVal = fixed ? "fixed" : "inherit";
|
|
2950
|
+
setStickyStyle((prev) => {
|
|
2951
|
+
return {
|
|
2952
|
+
...prev,
|
|
2953
|
+
position: positionVal
|
|
2954
|
+
};
|
|
2955
|
+
});
|
|
2956
|
+
setIsFixed(fixed);
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
}, [position, bottom, container, top]);
|
|
2960
|
+
useWatch(isFixed, () => {
|
|
2961
|
+
onChange && onChange(isFixed);
|
|
2962
|
+
});
|
|
2963
|
+
React.useEffect(() => {
|
|
2964
|
+
const el = getElement();
|
|
2965
|
+
el.addEventListener("scroll", handleScroll, false);
|
|
2966
|
+
return () => {
|
|
2967
|
+
el.removeEventListener("tap", handleScroll);
|
|
2968
|
+
};
|
|
2969
|
+
}, [getElement, handleScroll]);
|
|
2970
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2971
|
+
ref: rootRef,
|
|
2972
|
+
style: rootStyle,
|
|
2973
|
+
className: `nut-sticky ${className}`,
|
|
2974
|
+
...rest
|
|
2975
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2976
|
+
className: "nut-sticky-box",
|
|
2977
|
+
ref: stickyRef,
|
|
2978
|
+
style: stickyStyle
|
|
2979
|
+
}, children));
|
|
2980
|
+
};
|
|
2981
|
+
Sticky.displayName = "NutSticky";
|
|
2759
2982
|
const defaultProps$19 = {
|
|
2760
2983
|
...ComponentDefaults,
|
|
2761
2984
|
title: "",
|
|
@@ -2788,7 +3011,9 @@
|
|
|
2788
3011
|
onClickTitle,
|
|
2789
3012
|
onClickIcon,
|
|
2790
3013
|
onClickBack,
|
|
2791
|
-
onClickRight
|
|
3014
|
+
onClickRight,
|
|
3015
|
+
iconClassPrefix,
|
|
3016
|
+
iconFontClassName
|
|
2792
3017
|
} = {
|
|
2793
3018
|
...defaultProps$19,
|
|
2794
3019
|
...props
|
|
@@ -2813,8 +3038,8 @@
|
|
|
2813
3038
|
className: `${b2("left")}`,
|
|
2814
3039
|
onClick: (e2) => onClickBack(e2)
|
|
2815
3040
|
}, leftShow && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
2816
|
-
classPrefix:
|
|
2817
|
-
fontClassName:
|
|
3041
|
+
classPrefix: iconClassPrefix,
|
|
3042
|
+
fontClassName: iconFontClassName,
|
|
2818
3043
|
name: "left",
|
|
2819
3044
|
color: "#979797"
|
|
2820
3045
|
}), leftText && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -2830,8 +3055,8 @@
|
|
|
2830
3055
|
}, title), titIcon && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2831
3056
|
onClick: (e2) => onClickIcon(e2)
|
|
2832
3057
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
2833
|
-
classPrefix:
|
|
2834
|
-
fontClassName:
|
|
3058
|
+
classPrefix: iconClassPrefix,
|
|
3059
|
+
fontClassName: iconFontClassName,
|
|
2835
3060
|
name: titIcon
|
|
2836
3061
|
})), slot.content);
|
|
2837
3062
|
};
|
|
@@ -2887,8 +3112,13 @@
|
|
|
2887
3112
|
type,
|
|
2888
3113
|
slotList,
|
|
2889
3114
|
slotBtn,
|
|
3115
|
+
iconClassPrefix,
|
|
3116
|
+
iconFontClassName,
|
|
2890
3117
|
...rest
|
|
2891
|
-
} = {
|
|
3118
|
+
} = {
|
|
3119
|
+
...defaultProps$18,
|
|
3120
|
+
...props
|
|
3121
|
+
};
|
|
2892
3122
|
const b2 = cn("fixednav");
|
|
2893
3123
|
const classes = classNames(
|
|
2894
3124
|
{
|
|
@@ -2933,8 +3163,8 @@
|
|
|
2933
3163
|
className: "nut-fixednav__btn",
|
|
2934
3164
|
onClick: () => onUpdateValue()
|
|
2935
3165
|
}, slotBtn || /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
2936
|
-
classPrefix:
|
|
2937
|
-
fontClassName:
|
|
3166
|
+
classPrefix: iconClassPrefix,
|
|
3167
|
+
fontClassName: iconFontClassName,
|
|
2938
3168
|
name: "left",
|
|
2939
3169
|
color: "#fff"
|
|
2940
3170
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -3036,7 +3266,9 @@
|
|
|
3036
3266
|
activeColor,
|
|
3037
3267
|
unactiveColor,
|
|
3038
3268
|
index: index2,
|
|
3039
|
-
handleClick: handleClick2
|
|
3269
|
+
handleClick: handleClick2,
|
|
3270
|
+
iconClassPrefix,
|
|
3271
|
+
iconFontClassName
|
|
3040
3272
|
} = {
|
|
3041
3273
|
...defaultProps$16,
|
|
3042
3274
|
...props
|
|
@@ -3070,8 +3302,8 @@
|
|
|
3070
3302
|
}, "99+")) : /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3071
3303
|
className: `${bIcon("dot")}`
|
|
3072
3304
|
}), icon && /* @__PURE__ */ React__default["default"].createElement("div", null, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
3073
|
-
classPrefix:
|
|
3074
|
-
fontClassName:
|
|
3305
|
+
classPrefix: iconClassPrefix,
|
|
3306
|
+
fontClassName: iconFontClassName,
|
|
3075
3307
|
size,
|
|
3076
3308
|
name: icon
|
|
3077
3309
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -3183,10 +3415,14 @@
|
|
|
3183
3415
|
return "";
|
|
3184
3416
|
return string[0].toUpperCase() + string.slice(1);
|
|
3185
3417
|
}
|
|
3418
|
+
const actionsWithoutCaptureSupported = ["enter", "leave"];
|
|
3419
|
+
function hasCapture(capture = false, actionKey) {
|
|
3420
|
+
return capture && !actionsWithoutCaptureSupported.includes(actionKey);
|
|
3421
|
+
}
|
|
3186
3422
|
function toHandlerProp(device, action = "", capture = false) {
|
|
3187
3423
|
const deviceProps = EVENT_TYPE_MAP[device];
|
|
3188
3424
|
const actionKey = deviceProps ? deviceProps[action] || action : action;
|
|
3189
|
-
return "on" + capitalize(device) + capitalize(actionKey) + (capture ? "Capture" : "");
|
|
3425
|
+
return "on" + capitalize(device) + capitalize(actionKey) + (hasCapture(capture, actionKey) ? "Capture" : "");
|
|
3190
3426
|
}
|
|
3191
3427
|
const pointerCaptureEvents = ["gotpointercapture", "lostpointercapture"];
|
|
3192
3428
|
function parseProp(prop) {
|
|
@@ -3212,6 +3448,13 @@
|
|
|
3212
3448
|
function isTouch(event) {
|
|
3213
3449
|
return "touches" in event;
|
|
3214
3450
|
}
|
|
3451
|
+
function getPointerType(event) {
|
|
3452
|
+
if (isTouch(event))
|
|
3453
|
+
return "touch";
|
|
3454
|
+
if ("pointerType" in event)
|
|
3455
|
+
return event.pointerType;
|
|
3456
|
+
return "mouse";
|
|
3457
|
+
}
|
|
3215
3458
|
function getCurrentTargetTouchList(event) {
|
|
3216
3459
|
return Array.from(event.touches).filter((e2) => {
|
|
3217
3460
|
var _event$currentTarget, _event$currentTarget$;
|
|
@@ -3441,6 +3684,8 @@
|
|
|
3441
3684
|
const _absoluteDelta = state._delta.map(Math.abs);
|
|
3442
3685
|
V.addTo(state._distance, _absoluteDelta);
|
|
3443
3686
|
}
|
|
3687
|
+
if (this.axisIntent)
|
|
3688
|
+
this.axisIntent(event);
|
|
3444
3689
|
const [_m0, _m1] = state._movement;
|
|
3445
3690
|
const [t0, t1] = config2.threshold;
|
|
3446
3691
|
const {
|
|
@@ -3470,8 +3715,8 @@
|
|
|
3470
3715
|
movement[0] = _step[0] !== false ? _m0 - _step[0] : 0;
|
|
3471
3716
|
movement[1] = _step[1] !== false ? _m1 - _step[1] : 0;
|
|
3472
3717
|
}
|
|
3473
|
-
if (this.
|
|
3474
|
-
this.
|
|
3718
|
+
if (this.restrictToAxis && !state._blocked)
|
|
3719
|
+
this.restrictToAxis(movement);
|
|
3475
3720
|
const previousOffset = state.offset;
|
|
3476
3721
|
const gestureIsActive = state._active && !state._blocked || state.active;
|
|
3477
3722
|
if (gestureIsActive) {
|
|
@@ -3528,23 +3773,16 @@
|
|
|
3528
3773
|
this.timeoutStore.clean();
|
|
3529
3774
|
}
|
|
3530
3775
|
}
|
|
3531
|
-
function selectAxis([dx, dy]) {
|
|
3532
|
-
const
|
|
3533
|
-
|
|
3776
|
+
function selectAxis([dx, dy], threshold) {
|
|
3777
|
+
const absDx = Math.abs(dx);
|
|
3778
|
+
const absDy = Math.abs(dy);
|
|
3779
|
+
if (absDx > absDy && absDx > threshold) {
|
|
3534
3780
|
return "x";
|
|
3535
|
-
|
|
3781
|
+
}
|
|
3782
|
+
if (absDy > absDx && absDy > threshold) {
|
|
3536
3783
|
return "y";
|
|
3537
|
-
return void 0;
|
|
3538
|
-
}
|
|
3539
|
-
function restrictVectorToAxis(v2, axis) {
|
|
3540
|
-
switch (axis) {
|
|
3541
|
-
case "x":
|
|
3542
|
-
v2[1] = 0;
|
|
3543
|
-
break;
|
|
3544
|
-
case "y":
|
|
3545
|
-
v2[0] = 0;
|
|
3546
|
-
break;
|
|
3547
3784
|
}
|
|
3785
|
+
return void 0;
|
|
3548
3786
|
}
|
|
3549
3787
|
class CoordinatesEngine extends Engine {
|
|
3550
3788
|
constructor(...args) {
|
|
@@ -3565,13 +3803,25 @@
|
|
|
3565
3803
|
computeMovement() {
|
|
3566
3804
|
this.state.movement = V.sub(this.state.offset, this.state.lastOffset);
|
|
3567
3805
|
}
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
if (
|
|
3572
|
-
|
|
3806
|
+
axisIntent(event) {
|
|
3807
|
+
const state = this.state;
|
|
3808
|
+
const config2 = this.config;
|
|
3809
|
+
if (!state.axis && event) {
|
|
3810
|
+
const threshold = typeof config2.axisThreshold === "object" ? config2.axisThreshold[getPointerType(event)] : config2.axisThreshold;
|
|
3811
|
+
state.axis = selectAxis(state._movement, threshold);
|
|
3812
|
+
}
|
|
3813
|
+
state._blocked = (config2.lockDirection || !!config2.axis) && !state.axis || !!config2.axis && config2.axis !== state.axis;
|
|
3814
|
+
}
|
|
3815
|
+
restrictToAxis(v2) {
|
|
3573
3816
|
if (this.config.axis || this.config.lockDirection) {
|
|
3574
|
-
|
|
3817
|
+
switch (this.state.axis) {
|
|
3818
|
+
case "x":
|
|
3819
|
+
v2[1] = 0;
|
|
3820
|
+
break;
|
|
3821
|
+
case "y":
|
|
3822
|
+
v2[0] = 0;
|
|
3823
|
+
break;
|
|
3824
|
+
}
|
|
3575
3825
|
}
|
|
3576
3826
|
}
|
|
3577
3827
|
}
|
|
@@ -3581,6 +3831,9 @@
|
|
|
3581
3831
|
enabled(value = true) {
|
|
3582
3832
|
return value;
|
|
3583
3833
|
},
|
|
3834
|
+
eventOptions(value, _k, config2) {
|
|
3835
|
+
return _objectSpread2(_objectSpread2({}, config2.shared.eventOptions), value);
|
|
3836
|
+
},
|
|
3584
3837
|
preventDefault(value = false) {
|
|
3585
3838
|
return value;
|
|
3586
3839
|
},
|
|
@@ -3612,6 +3865,7 @@
|
|
|
3612
3865
|
return V.toVector(value, 0);
|
|
3613
3866
|
}
|
|
3614
3867
|
};
|
|
3868
|
+
const DEFAULT_AXIS_THRESHOLD = 0;
|
|
3615
3869
|
const coordinatesConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
|
|
3616
3870
|
axis(_v, _k, {
|
|
3617
3871
|
axis
|
|
@@ -3620,6 +3874,9 @@
|
|
|
3620
3874
|
if (!this.lockDirection)
|
|
3621
3875
|
return axis;
|
|
3622
3876
|
},
|
|
3877
|
+
axisThreshold(value = DEFAULT_AXIS_THRESHOLD) {
|
|
3878
|
+
return value;
|
|
3879
|
+
},
|
|
3623
3880
|
bounds(value = {}) {
|
|
3624
3881
|
if (typeof value === "function") {
|
|
3625
3882
|
return (state) => coordinatesConfigResolver.bounds(value(state));
|
|
@@ -3703,11 +3960,11 @@
|
|
|
3703
3960
|
const state = this.state;
|
|
3704
3961
|
if (event.buttons != null && (Array.isArray(config2.pointerButtons) ? !config2.pointerButtons.includes(event.buttons) : config2.pointerButtons !== -1 && config2.pointerButtons !== event.buttons))
|
|
3705
3962
|
return;
|
|
3706
|
-
this.ctrl.setEventIds(event);
|
|
3963
|
+
const ctrlIds = this.ctrl.setEventIds(event);
|
|
3707
3964
|
if (config2.pointerCapture) {
|
|
3708
3965
|
event.target.setPointerCapture(event.pointerId);
|
|
3709
3966
|
}
|
|
3710
|
-
if (state._pointerActive)
|
|
3967
|
+
if (ctrlIds && ctrlIds.size > 1 && state._pointerActive)
|
|
3711
3968
|
return;
|
|
3712
3969
|
this.start(event);
|
|
3713
3970
|
this.setupPointer(event);
|
|
@@ -3715,10 +3972,15 @@
|
|
|
3715
3972
|
state._pointerActive = true;
|
|
3716
3973
|
this.computeValues(pointerValues(event));
|
|
3717
3974
|
this.computeInitial();
|
|
3718
|
-
if (config2.
|
|
3975
|
+
if (config2.preventScrollAxis && getPointerType(event) !== "mouse") {
|
|
3976
|
+
state._active = false;
|
|
3719
3977
|
this.setupScrollPrevention(event);
|
|
3720
3978
|
} else if (config2.delay > 0) {
|
|
3721
3979
|
this.setupDelayTrigger(event);
|
|
3980
|
+
if (config2.triggerAllEvents) {
|
|
3981
|
+
this.compute(event);
|
|
3982
|
+
this.emit();
|
|
3983
|
+
}
|
|
3722
3984
|
} else {
|
|
3723
3985
|
this.startPointerDrag(event);
|
|
3724
3986
|
}
|
|
@@ -3750,13 +4012,13 @@
|
|
|
3750
4012
|
}
|
|
3751
4013
|
V.addTo(state._movement, state._delta);
|
|
3752
4014
|
this.compute(event);
|
|
3753
|
-
if (state._delayed) {
|
|
4015
|
+
if (state._delayed && state.intentional) {
|
|
3754
4016
|
this.timeoutStore.remove("dragDelay");
|
|
3755
4017
|
state.active = false;
|
|
3756
4018
|
this.startPointerDrag(event);
|
|
3757
4019
|
return;
|
|
3758
4020
|
}
|
|
3759
|
-
if (config2.
|
|
4021
|
+
if (config2.preventScrollAxis && !state._preventScroll) {
|
|
3760
4022
|
if (state.axis) {
|
|
3761
4023
|
if (state.axis === config2.preventScrollAxis || config2.preventScrollAxis === "xy") {
|
|
3762
4024
|
state._active = false;
|
|
@@ -3784,7 +4046,7 @@
|
|
|
3784
4046
|
}
|
|
3785
4047
|
const state = this.state;
|
|
3786
4048
|
const config2 = this.config;
|
|
3787
|
-
if (!state._pointerActive)
|
|
4049
|
+
if (!state._active || !state._pointerActive)
|
|
3788
4050
|
return;
|
|
3789
4051
|
const id = pointerId(event);
|
|
3790
4052
|
if (state._pointerId !== void 0 && id !== state._pointerId)
|
|
@@ -3813,14 +4075,14 @@
|
|
|
3813
4075
|
this.emit();
|
|
3814
4076
|
}
|
|
3815
4077
|
pointerClick(event) {
|
|
3816
|
-
if (!this.state.tap) {
|
|
4078
|
+
if (!this.state.tap && event.detail > 0) {
|
|
3817
4079
|
event.preventDefault();
|
|
3818
4080
|
event.stopPropagation();
|
|
3819
4081
|
}
|
|
3820
4082
|
}
|
|
3821
4083
|
setupPointer(event) {
|
|
3822
4084
|
const config2 = this.config;
|
|
3823
|
-
|
|
4085
|
+
const device = config2.device;
|
|
3824
4086
|
if (config2.pointerLock) {
|
|
3825
4087
|
event.currentTarget.requestPointerLock();
|
|
3826
4088
|
}
|
|
@@ -3841,29 +4103,29 @@
|
|
|
3841
4103
|
}
|
|
3842
4104
|
}
|
|
3843
4105
|
setupScrollPrevention(event) {
|
|
4106
|
+
this.state._preventScroll = false;
|
|
3844
4107
|
persistEvent(event);
|
|
3845
|
-
this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
|
|
3846
|
-
passive: false
|
|
3847
|
-
});
|
|
3848
|
-
this.eventStore.add(this.sharedConfig.window, "touch", "end", this.clean.bind(this), {
|
|
3849
|
-
passive: false
|
|
3850
|
-
});
|
|
3851
|
-
this.eventStore.add(this.sharedConfig.window, "touch", "cancel", this.clean.bind(this), {
|
|
4108
|
+
const remove = this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
|
|
3852
4109
|
passive: false
|
|
3853
4110
|
});
|
|
3854
|
-
this.
|
|
4111
|
+
this.eventStore.add(this.sharedConfig.window, "touch", "end", remove);
|
|
4112
|
+
this.eventStore.add(this.sharedConfig.window, "touch", "cancel", remove);
|
|
4113
|
+
this.timeoutStore.add("startPointerDrag", this.startPointerDrag.bind(this), this.config.preventScrollDelay, event);
|
|
3855
4114
|
}
|
|
3856
4115
|
setupDelayTrigger(event) {
|
|
3857
4116
|
this.state._delayed = true;
|
|
3858
|
-
this.timeoutStore.add("dragDelay",
|
|
4117
|
+
this.timeoutStore.add("dragDelay", () => {
|
|
4118
|
+
this.state._step = [0, 0];
|
|
4119
|
+
this.startPointerDrag(event);
|
|
4120
|
+
}, this.config.delay);
|
|
3859
4121
|
}
|
|
3860
4122
|
keyDown(event) {
|
|
3861
4123
|
const deltaFn = KEYS_DELTA_MAP[event.key];
|
|
3862
4124
|
if (deltaFn) {
|
|
3863
4125
|
const state = this.state;
|
|
3864
4126
|
const factor = event.shiftKey ? 10 : event.altKey ? 0.1 : 1;
|
|
3865
|
-
state._delta = deltaFn(factor);
|
|
3866
4127
|
this.start(event);
|
|
4128
|
+
state._delta = deltaFn(factor);
|
|
3867
4129
|
state._keyboardActive = true;
|
|
3868
4130
|
V.addTo(state._movement, state._delta);
|
|
3869
4131
|
this.compute(event);
|
|
@@ -3887,8 +4149,10 @@
|
|
|
3887
4149
|
bindFunction(device, "cancel", this.pointerUp.bind(this));
|
|
3888
4150
|
bindFunction("lostPointerCapture", "", this.pointerUp.bind(this));
|
|
3889
4151
|
}
|
|
3890
|
-
|
|
3891
|
-
|
|
4152
|
+
if (this.config.keys) {
|
|
4153
|
+
bindFunction("key", "down", this.keyDown.bind(this));
|
|
4154
|
+
bindFunction("key", "up", this.keyUp.bind(this));
|
|
4155
|
+
}
|
|
3892
4156
|
if (this.config.filterTaps) {
|
|
3893
4157
|
bindFunction("click", "", this.pointerClick.bind(this), {
|
|
3894
4158
|
capture: true,
|
|
@@ -3933,6 +4197,11 @@
|
|
|
3933
4197
|
const DEFAULT_SWIPE_VELOCITY = 0.5;
|
|
3934
4198
|
const DEFAULT_SWIPE_DISTANCE = 50;
|
|
3935
4199
|
const DEFAULT_SWIPE_DURATION = 250;
|
|
4200
|
+
const DEFAULT_DRAG_AXIS_THRESHOLD = {
|
|
4201
|
+
mouse: 0,
|
|
4202
|
+
touch: 0,
|
|
4203
|
+
pen: 8
|
|
4204
|
+
};
|
|
3936
4205
|
const dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {
|
|
3937
4206
|
device(_v, _k, {
|
|
3938
4207
|
pointer: {
|
|
@@ -3952,15 +4221,13 @@
|
|
|
3952
4221
|
return "touch";
|
|
3953
4222
|
return "mouse";
|
|
3954
4223
|
},
|
|
3955
|
-
|
|
3956
|
-
|
|
4224
|
+
preventScrollAxis(value, _k, {
|
|
4225
|
+
preventScroll
|
|
3957
4226
|
}) {
|
|
3958
|
-
this.
|
|
3959
|
-
if (!SUPPORT.touchscreen)
|
|
3960
|
-
return
|
|
3961
|
-
|
|
3962
|
-
return value;
|
|
3963
|
-
return value ? DEFAULT_PREVENT_SCROLL_DELAY : false;
|
|
4227
|
+
this.preventScrollDelay = typeof preventScroll === "number" ? preventScroll : preventScroll || preventScroll === void 0 && value ? DEFAULT_PREVENT_SCROLL_DELAY : void 0;
|
|
4228
|
+
if (!SUPPORT.touchscreen || preventScroll === false)
|
|
4229
|
+
return void 0;
|
|
4230
|
+
return value ? value : preventScroll !== void 0 ? "y" : void 0;
|
|
3964
4231
|
},
|
|
3965
4232
|
pointerCapture(_v, _k, {
|
|
3966
4233
|
pointer: {
|
|
@@ -3971,6 +4238,9 @@
|
|
|
3971
4238
|
this.pointerButtons = buttons;
|
|
3972
4239
|
return !this.pointerLock && this.device === "pointer" && capture;
|
|
3973
4240
|
},
|
|
4241
|
+
keys(value = true) {
|
|
4242
|
+
return value;
|
|
4243
|
+
},
|
|
3974
4244
|
threshold(value, _k, {
|
|
3975
4245
|
filterTaps = false,
|
|
3976
4246
|
tapsThreshold = 3,
|
|
@@ -4001,10 +4271,15 @@
|
|
|
4001
4271
|
default:
|
|
4002
4272
|
return value;
|
|
4003
4273
|
}
|
|
4274
|
+
},
|
|
4275
|
+
axisThreshold(value) {
|
|
4276
|
+
if (!value)
|
|
4277
|
+
return DEFAULT_DRAG_AXIS_THRESHOLD;
|
|
4278
|
+
return _objectSpread2(_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value);
|
|
4004
4279
|
}
|
|
4005
4280
|
});
|
|
4006
4281
|
const SCALE_ANGLE_RATIO_INTENT_DEG = 30;
|
|
4007
|
-
const PINCH_WHEEL_RATIO =
|
|
4282
|
+
const PINCH_WHEEL_RATIO = 100;
|
|
4008
4283
|
class PinchEngine extends Engine {
|
|
4009
4284
|
constructor(...args) {
|
|
4010
4285
|
super(...args);
|
|
@@ -4043,19 +4318,22 @@
|
|
|
4043
4318
|
} = this.state;
|
|
4044
4319
|
this.state.movement = [offset[0] / lastOffset[0], offset[1] - lastOffset[1]];
|
|
4045
4320
|
}
|
|
4046
|
-
|
|
4321
|
+
axisIntent() {
|
|
4047
4322
|
const state = this.state;
|
|
4323
|
+
const [_m0, _m1] = state._movement;
|
|
4048
4324
|
if (!state.axis) {
|
|
4049
|
-
const axisMovementDifference = Math.abs(
|
|
4325
|
+
const axisMovementDifference = Math.abs(_m0) * SCALE_ANGLE_RATIO_INTENT_DEG - Math.abs(_m1);
|
|
4050
4326
|
if (axisMovementDifference < 0)
|
|
4051
4327
|
state.axis = "angle";
|
|
4052
4328
|
else if (axisMovementDifference > 0)
|
|
4053
4329
|
state.axis = "scale";
|
|
4054
4330
|
}
|
|
4331
|
+
}
|
|
4332
|
+
restrictToAxis(v2) {
|
|
4055
4333
|
if (this.config.lockDirection) {
|
|
4056
|
-
if (state.axis === "scale")
|
|
4334
|
+
if (this.state.axis === "scale")
|
|
4057
4335
|
v2[1] = 0;
|
|
4058
|
-
else if (state.axis === "angle")
|
|
4336
|
+
else if (this.state.axis === "angle")
|
|
4059
4337
|
v2[0] = 0;
|
|
4060
4338
|
}
|
|
4061
4339
|
}
|
|
@@ -4206,7 +4484,8 @@
|
|
|
4206
4484
|
this.emit();
|
|
4207
4485
|
}
|
|
4208
4486
|
wheel(event) {
|
|
4209
|
-
|
|
4487
|
+
const modifierKey = this.config.modifierKey;
|
|
4488
|
+
if (modifierKey && !event[modifierKey])
|
|
4210
4489
|
return;
|
|
4211
4490
|
if (!this.state._active)
|
|
4212
4491
|
this.wheelStart(event);
|
|
@@ -4246,11 +4525,10 @@
|
|
|
4246
4525
|
bindFunction(device, "change", this[device + "Move"].bind(this));
|
|
4247
4526
|
bindFunction(device, "end", this[device + "End"].bind(this));
|
|
4248
4527
|
bindFunction(device, "cancel", this[device + "End"].bind(this));
|
|
4249
|
-
} else {
|
|
4250
|
-
bindFunction("wheel", "", this.wheel.bind(this), {
|
|
4251
|
-
passive: false
|
|
4252
|
-
});
|
|
4253
4528
|
}
|
|
4529
|
+
bindFunction("wheel", "", this.wheel.bind(this), {
|
|
4530
|
+
passive: false
|
|
4531
|
+
});
|
|
4254
4532
|
}
|
|
4255
4533
|
}
|
|
4256
4534
|
const pinchConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
|
|
@@ -4298,6 +4576,11 @@
|
|
|
4298
4576
|
this.lockDirection = config2.axis === "lock";
|
|
4299
4577
|
const threshold = V.toVector(value, this.lockDirection ? [0.1, 3] : 0);
|
|
4300
4578
|
return threshold;
|
|
4579
|
+
},
|
|
4580
|
+
modifierKey(value) {
|
|
4581
|
+
if (value === void 0)
|
|
4582
|
+
return "ctrlKey";
|
|
4583
|
+
return value;
|
|
4301
4584
|
}
|
|
4302
4585
|
});
|
|
4303
4586
|
class MoveEngine extends CoordinatesEngine {
|
|
@@ -4605,19 +4888,27 @@
|
|
|
4605
4888
|
return _config;
|
|
4606
4889
|
}
|
|
4607
4890
|
class EventStore {
|
|
4608
|
-
constructor(ctrl) {
|
|
4609
|
-
_defineProperty(this, "_listeners",
|
|
4891
|
+
constructor(ctrl, gestureKey) {
|
|
4892
|
+
_defineProperty(this, "_listeners", /* @__PURE__ */ new Set());
|
|
4610
4893
|
this._ctrl = ctrl;
|
|
4894
|
+
this._gestureKey = gestureKey;
|
|
4611
4895
|
}
|
|
4612
4896
|
add(element, device, action, handler, options2) {
|
|
4897
|
+
const listeners = this._listeners;
|
|
4613
4898
|
const type = toDomEventType(device, action);
|
|
4614
|
-
const
|
|
4899
|
+
const _options = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {};
|
|
4900
|
+
const eventOptions = _objectSpread2(_objectSpread2({}, _options), options2);
|
|
4615
4901
|
element.addEventListener(type, handler, eventOptions);
|
|
4616
|
-
|
|
4902
|
+
const remove = () => {
|
|
4903
|
+
element.removeEventListener(type, handler, eventOptions);
|
|
4904
|
+
listeners.delete(remove);
|
|
4905
|
+
};
|
|
4906
|
+
listeners.add(remove);
|
|
4907
|
+
return remove;
|
|
4617
4908
|
}
|
|
4618
4909
|
clean() {
|
|
4619
4910
|
this._listeners.forEach((remove) => remove());
|
|
4620
|
-
this._listeners
|
|
4911
|
+
this._listeners.clear();
|
|
4621
4912
|
}
|
|
4622
4913
|
}
|
|
4623
4914
|
class TimeoutStore {
|
|
@@ -4661,11 +4952,13 @@
|
|
|
4661
4952
|
setEventIds(event) {
|
|
4662
4953
|
if (isTouch(event)) {
|
|
4663
4954
|
this.touchIds = new Set(touchIds(event));
|
|
4955
|
+
return this.touchIds;
|
|
4664
4956
|
} else if ("pointerId" in event) {
|
|
4665
4957
|
if (event.type === "pointerup" || event.type === "pointercancel")
|
|
4666
4958
|
this.pointerIds.delete(event.pointerId);
|
|
4667
4959
|
else if (event.type === "pointerdown")
|
|
4668
4960
|
this.pointerIds.add(event.pointerId);
|
|
4961
|
+
return this.pointerIds;
|
|
4669
4962
|
}
|
|
4670
4963
|
}
|
|
4671
4964
|
applyHandlers(handlers, nativeHandlers) {
|
|
@@ -4689,7 +4982,6 @@
|
|
|
4689
4982
|
}
|
|
4690
4983
|
bind(...args) {
|
|
4691
4984
|
const sharedConfig = this.config.shared;
|
|
4692
|
-
const eventOptions = sharedConfig.eventOptions;
|
|
4693
4985
|
const props = {};
|
|
4694
4986
|
let target;
|
|
4695
4987
|
if (sharedConfig.target) {
|
|
@@ -4697,16 +4989,18 @@
|
|
|
4697
4989
|
if (!target)
|
|
4698
4990
|
return;
|
|
4699
4991
|
}
|
|
4700
|
-
const bindFunction = bindToProps(props, eventOptions, !!target);
|
|
4701
4992
|
if (sharedConfig.enabled) {
|
|
4702
4993
|
for (const gestureKey of this.gestures) {
|
|
4703
|
-
|
|
4994
|
+
const gestureConfig = this.config[gestureKey];
|
|
4995
|
+
const bindFunction = bindToProps(props, gestureConfig.eventOptions, !!target);
|
|
4996
|
+
if (gestureConfig.enabled) {
|
|
4704
4997
|
const Engine2 = EngineMap.get(gestureKey);
|
|
4705
4998
|
new Engine2(this, args, gestureKey).bind(bindFunction);
|
|
4706
4999
|
}
|
|
4707
5000
|
}
|
|
5001
|
+
const nativeBindFunction = bindToProps(props, sharedConfig.eventOptions, !!target);
|
|
4708
5002
|
for (const eventKey in this.nativeHandlers) {
|
|
4709
|
-
|
|
5003
|
+
nativeBindFunction(eventKey, "", (event) => this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({}, this.state.shared), {}, {
|
|
4710
5004
|
event,
|
|
4711
5005
|
args
|
|
4712
5006
|
})), void 0, true);
|
|
@@ -4732,7 +5026,7 @@
|
|
|
4732
5026
|
}
|
|
4733
5027
|
function setupGesture(ctrl, gestureKey) {
|
|
4734
5028
|
ctrl.gestures.add(gestureKey);
|
|
4735
|
-
ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl);
|
|
5029
|
+
ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl, gestureKey);
|
|
4736
5030
|
ctrl.gestureTimeoutStores[gestureKey] = new TimeoutStore();
|
|
4737
5031
|
}
|
|
4738
5032
|
function resolveGestures(ctrl, internalHandlers) {
|
|
@@ -4823,26 +5117,26 @@
|
|
|
4823
5117
|
}
|
|
4824
5118
|
return void 0;
|
|
4825
5119
|
}
|
|
4826
|
-
function useDrag(handler, config2
|
|
5120
|
+
function useDrag(handler, config2) {
|
|
4827
5121
|
registerAction(dragAction);
|
|
4828
5122
|
return useRecognizers({
|
|
4829
5123
|
drag: handler
|
|
4830
|
-
}, config2, "drag");
|
|
5124
|
+
}, config2 || {}, "drag");
|
|
4831
5125
|
}
|
|
4832
5126
|
function createUseGesture(actions) {
|
|
4833
5127
|
actions.forEach(registerAction);
|
|
4834
|
-
return function useGesture2(_handlers, _config
|
|
5128
|
+
return function useGesture2(_handlers, _config) {
|
|
4835
5129
|
const {
|
|
4836
5130
|
handlers,
|
|
4837
5131
|
nativeHandlers,
|
|
4838
5132
|
config: config2
|
|
4839
|
-
} = parseMergedHandlers(_handlers, _config);
|
|
5133
|
+
} = parseMergedHandlers(_handlers, _config || {});
|
|
4840
5134
|
return useRecognizers(handlers, config2, void 0, nativeHandlers);
|
|
4841
5135
|
};
|
|
4842
5136
|
}
|
|
4843
|
-
function useGesture(handlers, config2
|
|
5137
|
+
function useGesture(handlers, config2) {
|
|
4844
5138
|
const hook = createUseGesture([dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction]);
|
|
4845
|
-
return hook(handlers, config2);
|
|
5139
|
+
return hook(handlers, config2 || {});
|
|
4846
5140
|
}
|
|
4847
5141
|
let updateQueue = makeQueue();
|
|
4848
5142
|
const raf = (fn) => schedule(fn, updateQueue);
|
|
@@ -5485,7 +5779,7 @@
|
|
|
5485
5779
|
return i - 1;
|
|
5486
5780
|
}
|
|
5487
5781
|
function _extends$2() {
|
|
5488
|
-
_extends$2 = Object.assign
|
|
5782
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function(target) {
|
|
5489
5783
|
for (var i = 1; i < arguments.length; i++) {
|
|
5490
5784
|
var source = arguments[i];
|
|
5491
5785
|
for (var key in source) {
|
|
@@ -5898,7 +6192,7 @@
|
|
|
5898
6192
|
return parentNode ? parentNode.constructor : is.arr(value) ? AnimatedArray : isAnimatedString(value) ? AnimatedString : AnimatedValue;
|
|
5899
6193
|
}
|
|
5900
6194
|
function _extends$1() {
|
|
5901
|
-
_extends$1 = Object.assign
|
|
6195
|
+
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
|
|
5902
6196
|
for (var i = 1; i < arguments.length; i++) {
|
|
5903
6197
|
var source = arguments[i];
|
|
5904
6198
|
for (var key in source) {
|
|
@@ -6017,7 +6311,7 @@
|
|
|
6017
6311
|
};
|
|
6018
6312
|
const getDisplayName = (arg) => is.str(arg) ? arg : arg && is.str(arg.displayName) ? arg.displayName : is.fun(arg) && arg.name || null;
|
|
6019
6313
|
function _extends() {
|
|
6020
|
-
_extends = Object.assign
|
|
6314
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
6021
6315
|
for (var i = 1; i < arguments.length; i++) {
|
|
6022
6316
|
var source = arguments[i];
|
|
6023
6317
|
for (var key in source) {
|
|
@@ -6650,6 +6944,7 @@
|
|
|
6650
6944
|
const from = anim.fromValues[i];
|
|
6651
6945
|
const v0 = node2.v0 != null ? node2.v0 : node2.v0 = is.arr(config2.velocity) ? config2.velocity[i] : config2.velocity;
|
|
6652
6946
|
let velocity;
|
|
6947
|
+
const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3));
|
|
6653
6948
|
if (!is.und(config2.duration)) {
|
|
6654
6949
|
let p2 = 1;
|
|
6655
6950
|
if (config2.duration > 0) {
|
|
@@ -6671,11 +6966,10 @@
|
|
|
6671
6966
|
const decay = config2.decay === true ? 0.998 : config2.decay;
|
|
6672
6967
|
const e2 = Math.exp(-(1 - decay) * elapsed);
|
|
6673
6968
|
position = from + v0 / (1 - decay) * (1 - e2);
|
|
6674
|
-
finished = Math.abs(node2.lastPosition - position)
|
|
6969
|
+
finished = Math.abs(node2.lastPosition - position) <= precision;
|
|
6675
6970
|
velocity = v0 * e2;
|
|
6676
6971
|
} else {
|
|
6677
6972
|
velocity = node2.lastVelocity == null ? v0 : node2.lastVelocity;
|
|
6678
|
-
const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3));
|
|
6679
6973
|
const restVelocity = config2.restVelocity || precision / 10;
|
|
6680
6974
|
const bounceFactor = config2.clamp ? 0 : config2.bounce;
|
|
6681
6975
|
const canBounce = !is.und(bounceFactor);
|
|
@@ -8409,8 +8703,13 @@
|
|
|
8409
8703
|
onChange,
|
|
8410
8704
|
className,
|
|
8411
8705
|
autoHeight,
|
|
8706
|
+
iconClassPrefix,
|
|
8707
|
+
iconFontClassName,
|
|
8412
8708
|
...rest
|
|
8413
|
-
} = {
|
|
8709
|
+
} = {
|
|
8710
|
+
...defaultProps$13,
|
|
8711
|
+
...props
|
|
8712
|
+
};
|
|
8414
8713
|
const [currentItem, setCurrentItem] = React.useState({ index: 0 });
|
|
8415
8714
|
const titles = React.useRef([]);
|
|
8416
8715
|
React.useEffect(() => {
|
|
@@ -8491,8 +8790,8 @@
|
|
|
8491
8790
|
className: `${b2("")}__titles-item__smile`,
|
|
8492
8791
|
style: tabsActiveStyle
|
|
8493
8792
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
8494
|
-
classPrefix:
|
|
8495
|
-
fontClassName:
|
|
8793
|
+
classPrefix: iconClassPrefix,
|
|
8794
|
+
fontClassName: iconFontClassName,
|
|
8496
8795
|
color,
|
|
8497
8796
|
name: "joy-smile"
|
|
8498
8797
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -8762,6 +9061,8 @@
|
|
|
8762
9061
|
closeOnClickOverlay,
|
|
8763
9062
|
children,
|
|
8764
9063
|
activeColor,
|
|
9064
|
+
iconClassPrefix,
|
|
9065
|
+
iconFontClassName,
|
|
8765
9066
|
...rest
|
|
8766
9067
|
} = {
|
|
8767
9068
|
...defaultProps$_,
|
|
@@ -8861,8 +9162,8 @@
|
|
|
8861
9162
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8862
9163
|
className: "nut-menu__title-text"
|
|
8863
9164
|
}, finallyTitle()), /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
8864
|
-
classPrefix:
|
|
8865
|
-
fontClassName:
|
|
9165
|
+
classPrefix: iconClassPrefix,
|
|
9166
|
+
fontClassName: iconFontClassName,
|
|
8866
9167
|
className: "nut-menu__title-icon",
|
|
8867
9168
|
size: "10",
|
|
8868
9169
|
name: titleIcon || (direction === "up" ? "arrow-up" : "down-arrow")
|
|
@@ -8894,14 +9195,14 @@
|
|
|
8894
9195
|
value,
|
|
8895
9196
|
columns,
|
|
8896
9197
|
title,
|
|
8897
|
-
iconClassPrefix,
|
|
8898
|
-
fontClassName,
|
|
8899
9198
|
optionsIcon,
|
|
8900
9199
|
direction,
|
|
8901
9200
|
onChange,
|
|
8902
9201
|
activeTitleClass,
|
|
8903
9202
|
inactiveTitleClass,
|
|
8904
|
-
children
|
|
9203
|
+
children,
|
|
9204
|
+
iconClassPrefix,
|
|
9205
|
+
iconFontClassName
|
|
8905
9206
|
} = {
|
|
8906
9207
|
...defaultProps$Z,
|
|
8907
9208
|
...props
|
|
@@ -9010,8 +9311,8 @@
|
|
|
9010
9311
|
handleClick2(item);
|
|
9011
9312
|
}
|
|
9012
9313
|
}, item.value === _value ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
9013
|
-
classPrefix:
|
|
9014
|
-
fontClassName:
|
|
9314
|
+
classPrefix: iconClassPrefix,
|
|
9315
|
+
fontClassName: iconFontClassName,
|
|
9015
9316
|
className: getIconCName(item.value, value),
|
|
9016
9317
|
name: optionsIcon,
|
|
9017
9318
|
color: activeColor
|
|
@@ -9090,40 +9391,15 @@
|
|
|
9090
9391
|
isHorizontal
|
|
9091
9392
|
};
|
|
9092
9393
|
}
|
|
9093
|
-
function isWindow(val) {
|
|
9094
|
-
return val === window;
|
|
9095
|
-
}
|
|
9096
|
-
const getRect = (elementRef) => {
|
|
9097
|
-
const element = elementRef;
|
|
9098
|
-
if (isWindow(element)) {
|
|
9099
|
-
const width = element.innerWidth;
|
|
9100
|
-
const height = element.innerHeight;
|
|
9101
|
-
return {
|
|
9102
|
-
top: 0,
|
|
9103
|
-
left: 0,
|
|
9104
|
-
right: width,
|
|
9105
|
-
bottom: height,
|
|
9106
|
-
width,
|
|
9107
|
-
height
|
|
9108
|
-
};
|
|
9109
|
-
}
|
|
9110
|
-
if (element && element.getBoundingClientRect) {
|
|
9111
|
-
return element.getBoundingClientRect();
|
|
9112
|
-
}
|
|
9113
|
-
return {
|
|
9114
|
-
top: 0,
|
|
9115
|
-
left: 0,
|
|
9116
|
-
right: 0,
|
|
9117
|
-
bottom: 0,
|
|
9118
|
-
width: 0,
|
|
9119
|
-
height: 0
|
|
9120
|
-
};
|
|
9121
|
-
};
|
|
9122
9394
|
let createRoot;
|
|
9395
|
+
const { version } = ReactDOM__namespace;
|
|
9396
|
+
const reactDOMClone = {
|
|
9397
|
+
...ReactDOM__namespace
|
|
9398
|
+
};
|
|
9123
9399
|
try {
|
|
9124
|
-
const mainVersion = Number((
|
|
9125
|
-
if (mainVersion >= 18
|
|
9126
|
-
createRoot =
|
|
9400
|
+
const mainVersion = Number((version || "").split(".")[0]);
|
|
9401
|
+
if (mainVersion >= 18) {
|
|
9402
|
+
createRoot = reactDOMClone.createRoot;
|
|
9127
9403
|
}
|
|
9128
9404
|
} catch (e2) {
|
|
9129
9405
|
console.log(e2);
|
|
@@ -9132,8 +9408,10 @@
|
|
|
9132
9408
|
ReactDOM__namespace.render(node, container);
|
|
9133
9409
|
}
|
|
9134
9410
|
function concurrentRender(node, container) {
|
|
9135
|
-
|
|
9136
|
-
|
|
9411
|
+
if (createRoot) {
|
|
9412
|
+
const root = createRoot(container);
|
|
9413
|
+
root.render(node);
|
|
9414
|
+
}
|
|
9137
9415
|
}
|
|
9138
9416
|
function render(node, container) {
|
|
9139
9417
|
if (createRoot) {
|
|
@@ -10660,7 +10938,10 @@
|
|
|
10660
10938
|
}
|
|
10661
10939
|
};
|
|
10662
10940
|
const Checkbox = (props) => {
|
|
10663
|
-
const { children } = {
|
|
10941
|
+
const { children } = {
|
|
10942
|
+
...defaultProps$U,
|
|
10943
|
+
...props
|
|
10944
|
+
};
|
|
10664
10945
|
const b2 = cn("checkbox");
|
|
10665
10946
|
const {
|
|
10666
10947
|
iconName,
|
|
@@ -10701,8 +10982,8 @@
|
|
|
10701
10982
|
};
|
|
10702
10983
|
const renderIcon = () => {
|
|
10703
10984
|
return /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
10704
|
-
classPrefix:
|
|
10705
|
-
fontClassName:
|
|
10985
|
+
classPrefix: iconClassPrefix,
|
|
10986
|
+
fontClassName: iconFontClassName,
|
|
10706
10987
|
name: getIconName(),
|
|
10707
10988
|
size: iconSize,
|
|
10708
10989
|
className: color()
|
|
@@ -10977,7 +11258,7 @@
|
|
|
10977
11258
|
const [refs, setRefs] = useRefs();
|
|
10978
11259
|
const [columnsList, setColumnsList] = React.useState([]);
|
|
10979
11260
|
const b2 = cn("picker");
|
|
10980
|
-
|
|
11261
|
+
const isConfirmEvent = React.useRef(false);
|
|
10981
11262
|
React.useEffect(() => {
|
|
10982
11263
|
if (defaultValueData && defaultValueData.length !== 0 && defaultValueData.toString() !== chooseValueData.toString()) {
|
|
10983
11264
|
const data = [...defaultValueData];
|
|
@@ -11501,6 +11782,8 @@
|
|
|
11501
11782
|
overlimit,
|
|
11502
11783
|
blur,
|
|
11503
11784
|
focus,
|
|
11785
|
+
iconClassPrefix,
|
|
11786
|
+
iconFontClassName,
|
|
11504
11787
|
...restProps
|
|
11505
11788
|
} = {
|
|
11506
11789
|
...defaultProps$S,
|
|
@@ -11606,8 +11889,8 @@
|
|
|
11606
11889
|
style: styles,
|
|
11607
11890
|
...restProps
|
|
11608
11891
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11609
|
-
classPrefix:
|
|
11610
|
-
fontClassName:
|
|
11892
|
+
classPrefix: iconClassPrefix,
|
|
11893
|
+
fontClassName: iconFontClassName,
|
|
11611
11894
|
className: iconMinusClasses,
|
|
11612
11895
|
size: buttonSize,
|
|
11613
11896
|
name: "minus",
|
|
@@ -11624,8 +11907,8 @@
|
|
|
11624
11907
|
onBlur: burValue,
|
|
11625
11908
|
onFocus: focusValue
|
|
11626
11909
|
}), /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11627
|
-
classPrefix:
|
|
11628
|
-
fontClassName:
|
|
11910
|
+
classPrefix: iconClassPrefix,
|
|
11911
|
+
fontClassName: iconFontClassName,
|
|
11629
11912
|
className: iconAddClasses,
|
|
11630
11913
|
size: buttonSize,
|
|
11631
11914
|
name: "plus",
|
|
@@ -11741,8 +12024,13 @@
|
|
|
11741
12024
|
clickLeftIcon,
|
|
11742
12025
|
clickRightIcon,
|
|
11743
12026
|
click,
|
|
12027
|
+
iconClassPrefix,
|
|
12028
|
+
iconFontClassName,
|
|
11744
12029
|
...rest
|
|
11745
|
-
} = {
|
|
12030
|
+
} = {
|
|
12031
|
+
...defaultProps$R,
|
|
12032
|
+
...props
|
|
12033
|
+
};
|
|
11746
12034
|
locale.placeholder = placeholder || locale.placeholder;
|
|
11747
12035
|
const [inputValue, SetInputValue] = React.useState("");
|
|
11748
12036
|
const [active, SetActive] = React.useState(false);
|
|
@@ -11870,8 +12158,8 @@
|
|
|
11870
12158
|
onClickLeftIcon(e2);
|
|
11871
12159
|
}
|
|
11872
12160
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11873
|
-
classPrefix:
|
|
11874
|
-
fontClassName:
|
|
12161
|
+
classPrefix: iconClassPrefix,
|
|
12162
|
+
fontClassName: iconFontClassName,
|
|
11875
12163
|
name: leftIcon,
|
|
11876
12164
|
size: leftIconSize
|
|
11877
12165
|
})) : null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -11929,8 +12217,8 @@
|
|
|
11929
12217
|
onInput(e2);
|
|
11930
12218
|
}
|
|
11931
12219
|
}), clearable && !readonly && active && inputValue.length > 0 ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11932
|
-
classPrefix:
|
|
11933
|
-
fontClassName:
|
|
12220
|
+
classPrefix: iconClassPrefix,
|
|
12221
|
+
fontClassName: iconFontClassName,
|
|
11934
12222
|
className: "nut-input-clear",
|
|
11935
12223
|
name: clearIcon,
|
|
11936
12224
|
size: clearSize,
|
|
@@ -11943,8 +12231,8 @@
|
|
|
11943
12231
|
onClickRightIcon(e2);
|
|
11944
12232
|
}
|
|
11945
12233
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11946
|
-
classPrefix:
|
|
11947
|
-
fontClassName:
|
|
12234
|
+
classPrefix: iconClassPrefix,
|
|
12235
|
+
fontClassName: iconFontClassName,
|
|
11948
12236
|
name: rightIcon,
|
|
11949
12237
|
size: rightIconSize
|
|
11950
12238
|
})) : null, slotButton ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -12031,7 +12319,10 @@
|
|
|
12031
12319
|
}
|
|
12032
12320
|
};
|
|
12033
12321
|
const Radio = (props) => {
|
|
12034
|
-
const { children } = {
|
|
12322
|
+
const { children } = {
|
|
12323
|
+
...defaultProps$P,
|
|
12324
|
+
...props
|
|
12325
|
+
};
|
|
12035
12326
|
const {
|
|
12036
12327
|
className,
|
|
12037
12328
|
disabled,
|
|
@@ -12043,6 +12334,8 @@
|
|
|
12043
12334
|
iconActiveName,
|
|
12044
12335
|
iconSize,
|
|
12045
12336
|
onChange,
|
|
12337
|
+
iconClassPrefix,
|
|
12338
|
+
iconFontClassName,
|
|
12046
12339
|
...rest
|
|
12047
12340
|
} = props;
|
|
12048
12341
|
const componentName = "nut-radio";
|
|
@@ -12077,8 +12370,8 @@
|
|
|
12077
12370
|
const renderIcon = () => {
|
|
12078
12371
|
const { iconName: iconName2, iconSize: iconSize2, iconActiveName: iconActiveName2 } = props;
|
|
12079
12372
|
return /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12080
|
-
classPrefix:
|
|
12081
|
-
fontClassName:
|
|
12373
|
+
classPrefix: iconClassPrefix,
|
|
12374
|
+
fontClassName: iconFontClassName,
|
|
12082
12375
|
name: checkedStatement ? iconActiveName2 : iconName2,
|
|
12083
12376
|
size: iconSize2,
|
|
12084
12377
|
className: color()
|
|
@@ -12139,8 +12432,13 @@
|
|
|
12139
12432
|
readonly,
|
|
12140
12433
|
allowHalf,
|
|
12141
12434
|
spacing,
|
|
12142
|
-
onChange
|
|
12143
|
-
|
|
12435
|
+
onChange,
|
|
12436
|
+
iconClassPrefix,
|
|
12437
|
+
iconFontClassName
|
|
12438
|
+
} = {
|
|
12439
|
+
...defaultProps$O,
|
|
12440
|
+
...props
|
|
12441
|
+
};
|
|
12144
12442
|
const b2 = cn("rate");
|
|
12145
12443
|
const bi = cn("rate-item");
|
|
12146
12444
|
const [countArray, setCountArray] = React.useState([1, 2, 3, 4, 5]);
|
|
@@ -12187,22 +12485,22 @@
|
|
|
12187
12485
|
onClick: (event) => onClick(event, n2),
|
|
12188
12486
|
style: { marginRight: pxCheck2(spacing) }
|
|
12189
12487
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12190
|
-
classPrefix:
|
|
12191
|
-
fontClassName:
|
|
12488
|
+
classPrefix: iconClassPrefix,
|
|
12489
|
+
fontClassName: iconFontClassName,
|
|
12192
12490
|
size: iconSize,
|
|
12193
12491
|
className: `${bi("icon")} ${disabled || n2 > score ? bi("icon--disabled") : ""}`,
|
|
12194
12492
|
name: n2 <= score ? checkedIcon : uncheckedIcon,
|
|
12195
12493
|
color: n2 <= score ? activeColor : voidColor
|
|
12196
12494
|
}), allowHalf && score > n2 - 1 && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12197
|
-
classPrefix:
|
|
12198
|
-
fontClassName:
|
|
12495
|
+
classPrefix: iconClassPrefix,
|
|
12496
|
+
fontClassName: iconFontClassName,
|
|
12199
12497
|
className: `${bi("icon")} ${bi("icon--half")}`,
|
|
12200
12498
|
color: n2 <= score ? activeColor : voidColor,
|
|
12201
12499
|
size: iconSize,
|
|
12202
12500
|
name: checkedIcon
|
|
12203
12501
|
}), allowHalf && score < n2 - 1 && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12204
|
-
classPrefix:
|
|
12205
|
-
fontClassName:
|
|
12502
|
+
classPrefix: iconClassPrefix,
|
|
12503
|
+
fontClassName: iconFontClassName,
|
|
12206
12504
|
className: `${bi("icon")} ${bi("icon--disabled")} ${bi(
|
|
12207
12505
|
"icon--half"
|
|
12208
12506
|
)}`,
|
|
@@ -12259,6 +12557,8 @@
|
|
|
12259
12557
|
onCancel,
|
|
12260
12558
|
onClose,
|
|
12261
12559
|
onComplete,
|
|
12560
|
+
iconClassPrefix,
|
|
12561
|
+
iconFontClassName,
|
|
12262
12562
|
...reset
|
|
12263
12563
|
} = props;
|
|
12264
12564
|
const b2 = cn("shortpassword");
|
|
@@ -12363,8 +12663,8 @@
|
|
|
12363
12663
|
}, errorMsg2), tips || locale.shortpassword.tips ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12364
12664
|
className: b2("message__forget")
|
|
12365
12665
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12366
|
-
classPrefix:
|
|
12367
|
-
fontClassName:
|
|
12666
|
+
classPrefix: iconClassPrefix,
|
|
12667
|
+
fontClassName: iconFontClassName,
|
|
12368
12668
|
className: "icon",
|
|
12369
12669
|
size: "11px",
|
|
12370
12670
|
name: "tips"
|
|
@@ -12511,25 +12811,218 @@
|
|
|
12511
12811
|
};
|
|
12512
12812
|
TextArea.defaultProps = defaultProps$M;
|
|
12513
12813
|
TextArea.displayName = "NutTextArea";
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12518
|
-
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
|
|
12522
|
-
|
|
12523
|
-
|
|
12524
|
-
}
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
|
|
12528
|
-
|
|
12529
|
-
|
|
12530
|
-
|
|
12531
|
-
|
|
12532
|
-
|
|
12814
|
+
const defaultProps$L = {
|
|
12815
|
+
name: "",
|
|
12816
|
+
size: "",
|
|
12817
|
+
classPrefix: "nut-icon",
|
|
12818
|
+
fontClassName: "nutui-iconfont",
|
|
12819
|
+
color: "",
|
|
12820
|
+
tag: "i",
|
|
12821
|
+
onClick: (e2) => {
|
|
12822
|
+
},
|
|
12823
|
+
className: ""
|
|
12824
|
+
};
|
|
12825
|
+
function pxCheck(value) {
|
|
12826
|
+
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
12827
|
+
}
|
|
12828
|
+
function Icon(props) {
|
|
12829
|
+
const {
|
|
12830
|
+
name,
|
|
12831
|
+
size,
|
|
12832
|
+
classPrefix,
|
|
12833
|
+
color,
|
|
12834
|
+
tag,
|
|
12835
|
+
children,
|
|
12836
|
+
className,
|
|
12837
|
+
fontClassName,
|
|
12838
|
+
style,
|
|
12839
|
+
onClick,
|
|
12840
|
+
...rest
|
|
12841
|
+
} = {
|
|
12842
|
+
...defaultProps$L,
|
|
12843
|
+
...props
|
|
12844
|
+
};
|
|
12845
|
+
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
12846
|
+
const type = isImage ? "img" : tag;
|
|
12847
|
+
const b2 = cn("icon");
|
|
12848
|
+
const handleClick2 = (e2) => {
|
|
12849
|
+
if (onClick) {
|
|
12850
|
+
onClick(e2);
|
|
12851
|
+
}
|
|
12852
|
+
};
|
|
12853
|
+
const hasSrc = () => {
|
|
12854
|
+
if (isImage)
|
|
12855
|
+
return { src: name };
|
|
12856
|
+
return {};
|
|
12857
|
+
};
|
|
12858
|
+
return React__default["default"].createElement(
|
|
12859
|
+
type,
|
|
12860
|
+
{
|
|
12861
|
+
className: isImage ? `${b2("img")} ${className || ""} ` : `${fontClassName} ${b2(null)} ${classPrefix}-${name} ${className || ""}`,
|
|
12862
|
+
style: {
|
|
12863
|
+
color,
|
|
12864
|
+
fontSize: pxCheck(size),
|
|
12865
|
+
width: pxCheck(size),
|
|
12866
|
+
height: pxCheck(size),
|
|
12867
|
+
...style
|
|
12868
|
+
},
|
|
12869
|
+
...rest,
|
|
12870
|
+
onClick: handleClick2,
|
|
12871
|
+
...hasSrc()
|
|
12872
|
+
},
|
|
12873
|
+
children
|
|
12874
|
+
);
|
|
12875
|
+
}
|
|
12876
|
+
Icon.defaultProps = defaultProps$L;
|
|
12877
|
+
Icon.displayName = "NutIcon";
|
|
12878
|
+
const defaultProps$K = {
|
|
12879
|
+
...ComponentDefaults,
|
|
12880
|
+
className: "",
|
|
12881
|
+
style: {},
|
|
12882
|
+
isShowPercentage: true,
|
|
12883
|
+
percentage: 0,
|
|
12884
|
+
fillColor: "#f3f3f3",
|
|
12885
|
+
strokeColor: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
12886
|
+
strokeWidth: "",
|
|
12887
|
+
textColor: "",
|
|
12888
|
+
textWidth: "",
|
|
12889
|
+
showText: true,
|
|
12890
|
+
textInside: false,
|
|
12891
|
+
textBackground: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
12892
|
+
textType: "text",
|
|
12893
|
+
status: false,
|
|
12894
|
+
iconName: "checked",
|
|
12895
|
+
iconColor: "#439422",
|
|
12896
|
+
iconSize: "16px",
|
|
12897
|
+
rounded: true,
|
|
12898
|
+
children: void 0
|
|
12899
|
+
};
|
|
12900
|
+
const Progress = (props) => {
|
|
12901
|
+
const {
|
|
12902
|
+
className,
|
|
12903
|
+
style,
|
|
12904
|
+
isShowPercentage,
|
|
12905
|
+
percentage,
|
|
12906
|
+
fillColor,
|
|
12907
|
+
strokeColor,
|
|
12908
|
+
strokeWidth,
|
|
12909
|
+
size,
|
|
12910
|
+
textColor,
|
|
12911
|
+
textWidth,
|
|
12912
|
+
showText,
|
|
12913
|
+
textInside,
|
|
12914
|
+
textBackground,
|
|
12915
|
+
textType,
|
|
12916
|
+
status,
|
|
12917
|
+
iconName,
|
|
12918
|
+
iconColor,
|
|
12919
|
+
iconSize,
|
|
12920
|
+
rounded,
|
|
12921
|
+
children,
|
|
12922
|
+
iconClassPrefix,
|
|
12923
|
+
iconFontClassName,
|
|
12924
|
+
...rest
|
|
12925
|
+
} = {
|
|
12926
|
+
...defaultProps$K,
|
|
12927
|
+
...props
|
|
12928
|
+
};
|
|
12929
|
+
const b2 = cn("progress");
|
|
12930
|
+
const classes = classNames(b2(""));
|
|
12931
|
+
const classesOuter = classNames({
|
|
12932
|
+
[`${b2("")}-outer`]: true,
|
|
12933
|
+
[`${b2("")}-${size || "base"}`]: true
|
|
12934
|
+
});
|
|
12935
|
+
const classesInner = classNames({
|
|
12936
|
+
[`${b2("")}-inner`]: true,
|
|
12937
|
+
[`${b2("")}-active`]: status
|
|
12938
|
+
});
|
|
12939
|
+
const classesText = classNames({
|
|
12940
|
+
[`${b2("")}-text`]: true
|
|
12941
|
+
});
|
|
12942
|
+
const classesInsideText = classNames({
|
|
12943
|
+
[`${b2("")}-text`]: true,
|
|
12944
|
+
[`${b2("")}-insidetext`]: true
|
|
12945
|
+
});
|
|
12946
|
+
const classesTextInner = classNames({
|
|
12947
|
+
[`${b2("")}-text__inner`]: true
|
|
12948
|
+
});
|
|
12949
|
+
const stylesOuter = {
|
|
12950
|
+
height: `${strokeWidth}px`,
|
|
12951
|
+
borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
|
|
12952
|
+
background: `${fillColor}`
|
|
12953
|
+
};
|
|
12954
|
+
const stylesInner = {
|
|
12955
|
+
width: `${percentage}%`,
|
|
12956
|
+
borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
|
|
12957
|
+
background: `${strokeColor}`
|
|
12958
|
+
};
|
|
12959
|
+
const stylesInsideText = {
|
|
12960
|
+
width: `${textWidth}px`,
|
|
12961
|
+
left: `${percentage}%`,
|
|
12962
|
+
background: textBackground || strokeColor
|
|
12963
|
+
};
|
|
12964
|
+
const stylesInsideIcon = {
|
|
12965
|
+
width: `${textWidth}px`,
|
|
12966
|
+
left: `${percentage}%`
|
|
12967
|
+
};
|
|
12968
|
+
const stylesText = {
|
|
12969
|
+
width: `${textWidth}px`
|
|
12970
|
+
};
|
|
12971
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12972
|
+
className: `${classes} ${className}`,
|
|
12973
|
+
style,
|
|
12974
|
+
...rest
|
|
12975
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12976
|
+
className: classesOuter,
|
|
12977
|
+
style: stylesOuter
|
|
12978
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12979
|
+
className: classesInner,
|
|
12980
|
+
style: stylesInner
|
|
12981
|
+
}, showText && textInside && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12982
|
+
className: classesInsideText,
|
|
12983
|
+
style: stylesInsideIcon
|
|
12984
|
+
}, children) : /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12985
|
+
className: classesInsideText,
|
|
12986
|
+
style: stylesInsideText
|
|
12987
|
+
}, /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
12988
|
+
className: classesTextInner,
|
|
12989
|
+
style: { color: textColor || "#fff" }
|
|
12990
|
+
}, percentage, isShowPercentage ? "%" : ""))))), showText && !textInside && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12991
|
+
className: classesText,
|
|
12992
|
+
style: stylesText
|
|
12993
|
+
}, textType === "text" && /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
12994
|
+
className: classesTextInner,
|
|
12995
|
+
style: { color: textColor || "#333" }
|
|
12996
|
+
}, percentage, isShowPercentage ? "%" : ""), textType === "icon" && /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
12997
|
+
classPrefix: iconClassPrefix,
|
|
12998
|
+
fontClassName: iconFontClassName,
|
|
12999
|
+
size: iconSize,
|
|
13000
|
+
name: iconName,
|
|
13001
|
+
color: iconColor
|
|
13002
|
+
})));
|
|
13003
|
+
};
|
|
13004
|
+
Progress.defaultProps = defaultProps$K;
|
|
13005
|
+
Progress.displayName = "NutProgress";
|
|
13006
|
+
class UploadOptions {
|
|
13007
|
+
constructor() {
|
|
13008
|
+
this.url = "";
|
|
13009
|
+
this.name = "file";
|
|
13010
|
+
this.fileType = "image";
|
|
13011
|
+
this.method = "post";
|
|
13012
|
+
this.xhrState = 200;
|
|
13013
|
+
this.timeout = 30 * 1e3;
|
|
13014
|
+
this.headers = {};
|
|
13015
|
+
this.withCredentials = false;
|
|
13016
|
+
}
|
|
13017
|
+
}
|
|
13018
|
+
class Upload {
|
|
13019
|
+
constructor(options2) {
|
|
13020
|
+
this.options = options2;
|
|
13021
|
+
}
|
|
13022
|
+
upload() {
|
|
13023
|
+
var _a;
|
|
13024
|
+
const { options: options2 } = this;
|
|
13025
|
+
const xhr = new XMLHttpRequest();
|
|
12533
13026
|
xhr.timeout = options2.timeout;
|
|
12534
13027
|
if (xhr.upload) {
|
|
12535
13028
|
xhr.upload.addEventListener(
|
|
@@ -12556,13 +13049,57 @@
|
|
|
12556
13049
|
xhr.setRequestHeader(key, value);
|
|
12557
13050
|
}
|
|
12558
13051
|
(_a = options2.onStart) == null ? void 0 : _a.call(options2, options2);
|
|
12559
|
-
|
|
13052
|
+
if (options2.beforeXhrUpload) {
|
|
13053
|
+
options2.beforeXhrUpload(xhr, options2);
|
|
13054
|
+
} else {
|
|
13055
|
+
xhr.send(options2.formData);
|
|
13056
|
+
}
|
|
12560
13057
|
} else {
|
|
12561
13058
|
console.warn("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 XMLHttpRequest");
|
|
12562
13059
|
}
|
|
12563
13060
|
}
|
|
13061
|
+
uploadTaro(uploadFile, env) {
|
|
13062
|
+
var _a;
|
|
13063
|
+
const options2 = this.options;
|
|
13064
|
+
if (env === "WEB") {
|
|
13065
|
+
this.upload();
|
|
13066
|
+
} else if (options2.beforeXhrUpload) {
|
|
13067
|
+
options2.beforeXhrUpload(uploadFile, options2);
|
|
13068
|
+
} else {
|
|
13069
|
+
const uploadTask = uploadFile({
|
|
13070
|
+
url: options2.url,
|
|
13071
|
+
filePath: options2.taroFilePath,
|
|
13072
|
+
fileType: options2.fileType,
|
|
13073
|
+
header: {
|
|
13074
|
+
"Content-Type": "multipart/form-data",
|
|
13075
|
+
...options2.headers
|
|
13076
|
+
},
|
|
13077
|
+
formData: options2.formData,
|
|
13078
|
+
name: options2.name,
|
|
13079
|
+
success(response) {
|
|
13080
|
+
var _a2, _b;
|
|
13081
|
+
if (options2.xhrState == response.statusCode) {
|
|
13082
|
+
(_a2 = options2.onSuccess) == null ? void 0 : _a2.call(options2, response, options2);
|
|
13083
|
+
} else {
|
|
13084
|
+
(_b = options2.onFailure) == null ? void 0 : _b.call(options2, response, options2);
|
|
13085
|
+
}
|
|
13086
|
+
},
|
|
13087
|
+
fail(e2) {
|
|
13088
|
+
var _a2;
|
|
13089
|
+
(_a2 = options2.onFailure) == null ? void 0 : _a2.call(options2, e2, options2);
|
|
13090
|
+
}
|
|
13091
|
+
});
|
|
13092
|
+
(_a = options2.onStart) == null ? void 0 : _a.call(options2, options2);
|
|
13093
|
+
uploadTask.progress(
|
|
13094
|
+
(res) => {
|
|
13095
|
+
var _a2;
|
|
13096
|
+
(_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, res, options2);
|
|
13097
|
+
}
|
|
13098
|
+
);
|
|
13099
|
+
}
|
|
13100
|
+
}
|
|
12564
13101
|
}
|
|
12565
|
-
const defaultProps$
|
|
13102
|
+
const defaultProps$J = {
|
|
12566
13103
|
...ComponentDefaults,
|
|
12567
13104
|
url: "",
|
|
12568
13105
|
maximum: 1,
|
|
@@ -12582,11 +13119,11 @@
|
|
|
12582
13119
|
xhrState: 200,
|
|
12583
13120
|
timeout: 1e3 * 30,
|
|
12584
13121
|
withCredentials: false,
|
|
12585
|
-
clearInput:
|
|
13122
|
+
clearInput: true,
|
|
12586
13123
|
isPreview: true,
|
|
12587
13124
|
isDeletable: true,
|
|
12588
13125
|
capture: false,
|
|
12589
|
-
|
|
13126
|
+
onBeforeDelete: (file, files) => {
|
|
12590
13127
|
return true;
|
|
12591
13128
|
}
|
|
12592
13129
|
};
|
|
@@ -12595,6 +13132,7 @@
|
|
|
12595
13132
|
this.status = "ready";
|
|
12596
13133
|
this.message = "\u51C6\u5907\u4E2D..";
|
|
12597
13134
|
this.uid = new Date().getTime().toString();
|
|
13135
|
+
this.percentage = 0;
|
|
12598
13136
|
this.formData = new FormData();
|
|
12599
13137
|
}
|
|
12600
13138
|
}
|
|
@@ -12626,23 +13164,25 @@
|
|
|
12626
13164
|
className,
|
|
12627
13165
|
autoUpload,
|
|
12628
13166
|
clearInput,
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
13167
|
+
iconClassPrefix,
|
|
13168
|
+
iconFontClassName,
|
|
13169
|
+
onStart,
|
|
13170
|
+
onRemove,
|
|
13171
|
+
onChange,
|
|
13172
|
+
onFileItemClick,
|
|
13173
|
+
onProgress,
|
|
13174
|
+
onSuccess,
|
|
13175
|
+
onUpdate,
|
|
13176
|
+
onFailure,
|
|
13177
|
+
onOversize,
|
|
13178
|
+
onBeforeUpload,
|
|
13179
|
+
onBeforeXhrUpload,
|
|
13180
|
+
onBeforeDelete,
|
|
12640
13181
|
...restProps
|
|
12641
|
-
} = { ...defaultProps$
|
|
13182
|
+
} = { ...defaultProps$J, ...props };
|
|
12642
13183
|
const [fileList, setFileList] = React.useState([]);
|
|
12643
13184
|
const [uploadQueue, setUploadQueue] = React.useState([]);
|
|
12644
13185
|
React.useEffect(() => {
|
|
12645
|
-
console.log("defaultFileList", defaultFileList);
|
|
12646
13186
|
if (defaultFileList) {
|
|
12647
13187
|
setFileList(defaultFileList);
|
|
12648
13188
|
}
|
|
@@ -12679,6 +13219,11 @@
|
|
|
12679
13219
|
uploadOption.xhrState = xhrState;
|
|
12680
13220
|
uploadOption.headers = headers;
|
|
12681
13221
|
uploadOption.withCredentials = withCredentials;
|
|
13222
|
+
uploadOption.beforeXhrUpload = onBeforeXhrUpload;
|
|
13223
|
+
try {
|
|
13224
|
+
uploadOption.sourceFile = fileItem.formData.get(name);
|
|
13225
|
+
} catch (error) {
|
|
13226
|
+
}
|
|
12682
13227
|
uploadOption.onStart = (option) => {
|
|
12683
13228
|
clearUploadQueue(index2);
|
|
12684
13229
|
setFileList((fileList2) => {
|
|
@@ -12691,7 +13236,7 @@
|
|
|
12691
13236
|
});
|
|
12692
13237
|
return [...fileList2];
|
|
12693
13238
|
});
|
|
12694
|
-
|
|
13239
|
+
onStart && onStart(option);
|
|
12695
13240
|
};
|
|
12696
13241
|
uploadOption.onProgress = (e2, option) => {
|
|
12697
13242
|
setFileList((fileList2) => {
|
|
@@ -12699,16 +13244,17 @@
|
|
|
12699
13244
|
if (item.uid === fileItem.uid) {
|
|
12700
13245
|
item.status = "uploading";
|
|
12701
13246
|
item.message = locale.uploader.uploading;
|
|
13247
|
+
item.percentage = (e2.loaded / e2.total * 100).toFixed(0);
|
|
13248
|
+
onProgress && onProgress({ e: e2, option, percentage: item.percentage });
|
|
12702
13249
|
}
|
|
12703
13250
|
return item;
|
|
12704
13251
|
});
|
|
12705
13252
|
return [...fileList2];
|
|
12706
13253
|
});
|
|
12707
|
-
progress && progress({ e: e2, option });
|
|
12708
13254
|
};
|
|
12709
13255
|
uploadOption.onSuccess = (responseText, option) => {
|
|
12710
13256
|
setFileList((fileList2) => {
|
|
12711
|
-
|
|
13257
|
+
onUpdate && onUpdate(fileList2);
|
|
12712
13258
|
fileList2.map((item) => {
|
|
12713
13259
|
if (item.uid === fileItem.uid) {
|
|
12714
13260
|
item.status = "success";
|
|
@@ -12718,7 +13264,7 @@
|
|
|
12718
13264
|
});
|
|
12719
13265
|
return [...fileList2];
|
|
12720
13266
|
});
|
|
12721
|
-
|
|
13267
|
+
onSuccess && onSuccess({
|
|
12722
13268
|
responseText,
|
|
12723
13269
|
option
|
|
12724
13270
|
});
|
|
@@ -12734,7 +13280,7 @@
|
|
|
12734
13280
|
});
|
|
12735
13281
|
return [...fileList2];
|
|
12736
13282
|
});
|
|
12737
|
-
|
|
13283
|
+
onFailure && onFailure({
|
|
12738
13284
|
responseText,
|
|
12739
13285
|
option
|
|
12740
13286
|
});
|
|
@@ -12788,7 +13334,7 @@
|
|
|
12788
13334
|
return true;
|
|
12789
13335
|
});
|
|
12790
13336
|
if (oversizes.length) {
|
|
12791
|
-
|
|
13337
|
+
onOversize && onOversize(files);
|
|
12792
13338
|
}
|
|
12793
13339
|
if (filterFile.length > maximum2) {
|
|
12794
13340
|
filterFile.splice(maximum2, filterFile.length - maximum2);
|
|
@@ -12801,9 +13347,9 @@
|
|
|
12801
13347
|
};
|
|
12802
13348
|
const onDelete = (file, index2) => {
|
|
12803
13349
|
clearUploadQueue(index2);
|
|
12804
|
-
if (
|
|
13350
|
+
if (onBeforeDelete && onBeforeDelete(file, fileList)) {
|
|
12805
13351
|
fileList.splice(index2, 1);
|
|
12806
|
-
|
|
13352
|
+
onRemove && onRemove(file, fileList);
|
|
12807
13353
|
setFileList([...fileList]);
|
|
12808
13354
|
} else {
|
|
12809
13355
|
console.log(locale.uploader.deleteWord);
|
|
@@ -12815,8 +13361,8 @@
|
|
|
12815
13361
|
}
|
|
12816
13362
|
const $el = event.target;
|
|
12817
13363
|
const { files } = $el;
|
|
12818
|
-
if (
|
|
12819
|
-
|
|
13364
|
+
if (onBeforeUpload) {
|
|
13365
|
+
onBeforeUpload(new Array().slice.call(files)).then(
|
|
12820
13366
|
(f2) => {
|
|
12821
13367
|
const _files = filterFiles(new Array().slice.call(f2));
|
|
12822
13368
|
readFile(_files);
|
|
@@ -12826,13 +13372,13 @@
|
|
|
12826
13372
|
const _files = filterFiles(new Array().slice.call(files));
|
|
12827
13373
|
readFile(_files);
|
|
12828
13374
|
}
|
|
12829
|
-
|
|
13375
|
+
onChange && onChange({ fileList, event });
|
|
12830
13376
|
if (clearInput) {
|
|
12831
13377
|
clearInputValue($el);
|
|
12832
13378
|
}
|
|
12833
13379
|
};
|
|
12834
13380
|
const handleItemClick = (file) => {
|
|
12835
|
-
|
|
13381
|
+
onFileItemClick && onFileItemClick(file);
|
|
12836
13382
|
};
|
|
12837
13383
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12838
13384
|
className: classes,
|
|
@@ -12869,15 +13415,15 @@
|
|
|
12869
13415
|
}, item.message)) : item.status !== "success" && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12870
13416
|
className: "nut-uploader__preview__progress"
|
|
12871
13417
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12872
|
-
classPrefix:
|
|
12873
|
-
fontClassName:
|
|
13418
|
+
classPrefix: iconClassPrefix,
|
|
13419
|
+
fontClassName: iconFontClassName,
|
|
12874
13420
|
color: "#fff",
|
|
12875
13421
|
name: `${item.status === "error" ? "failure" : "loading"}`
|
|
12876
13422
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12877
13423
|
className: "nut-uploader__preview__progress__msg"
|
|
12878
13424
|
}, item.message)), isDeletable && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12879
|
-
classPrefix:
|
|
12880
|
-
fontClassName:
|
|
13425
|
+
classPrefix: iconClassPrefix,
|
|
13426
|
+
fontClassName: iconFontClassName,
|
|
12881
13427
|
color: "rgba(0,0,0,0.6)",
|
|
12882
13428
|
className: "close",
|
|
12883
13429
|
name: "failure",
|
|
@@ -12898,8 +13444,8 @@
|
|
|
12898
13444
|
onClick: () => handleItemClick(item),
|
|
12899
13445
|
className: "nut-uploader__preview-img__file__name"
|
|
12900
13446
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12901
|
-
classPrefix:
|
|
12902
|
-
fontClassName:
|
|
13447
|
+
classPrefix: iconClassPrefix,
|
|
13448
|
+
fontClassName: iconFontClassName,
|
|
12903
13449
|
color: "#808080",
|
|
12904
13450
|
name: "link"
|
|
12905
13451
|
}), "\xA0", item.name))), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -12910,22 +13456,27 @@
|
|
|
12910
13456
|
className: `nut-uploader__preview-img__file__name ${item.status}`,
|
|
12911
13457
|
onClick: () => handleItemClick(item)
|
|
12912
13458
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12913
|
-
classPrefix:
|
|
12914
|
-
fontClassName:
|
|
13459
|
+
classPrefix: iconClassPrefix,
|
|
13460
|
+
fontClassName: iconFontClassName,
|
|
12915
13461
|
name: "link"
|
|
12916
13462
|
}), "\xA0", item.name), /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12917
|
-
classPrefix:
|
|
12918
|
-
fontClassName:
|
|
13463
|
+
classPrefix: iconClassPrefix,
|
|
13464
|
+
fontClassName: iconFontClassName,
|
|
12919
13465
|
color: "#808080",
|
|
12920
13466
|
className: "nut-uploader__preview-img__file__del",
|
|
12921
13467
|
name: "del",
|
|
12922
13468
|
onClick: () => onDelete(item, index2)
|
|
13469
|
+
}), item.status === "uploading" && /* @__PURE__ */ React__default["default"].createElement(Progress, {
|
|
13470
|
+
size: "small",
|
|
13471
|
+
percentage: item.percentage,
|
|
13472
|
+
strokeColor: "linear-gradient(270deg, rgba(18,126,255,1) 0%,rgba(32,147,255,1) 32.815625%,rgba(13,242,204,1) 100%)",
|
|
13473
|
+
showText: false
|
|
12923
13474
|
})));
|
|
12924
13475
|
}), maximum > fileList.length && listType === "picture" && !children && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12925
13476
|
className: `nut-uploader__upload ${listType}`
|
|
12926
13477
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12927
|
-
classPrefix:
|
|
12928
|
-
fontClassName:
|
|
13478
|
+
classPrefix: iconClassPrefix,
|
|
13479
|
+
fontClassName: iconFontClassName,
|
|
12929
13480
|
size: uploadIconSize,
|
|
12930
13481
|
color: "#808080",
|
|
12931
13482
|
name: uploadIcon
|
|
@@ -12949,9 +13500,9 @@
|
|
|
12949
13500
|
})));
|
|
12950
13501
|
};
|
|
12951
13502
|
const Uploader = React__default["default"].forwardRef(InternalUploader);
|
|
12952
|
-
Uploader.defaultProps = defaultProps$
|
|
13503
|
+
Uploader.defaultProps = defaultProps$J;
|
|
12953
13504
|
Uploader.displayName = "NutUploader";
|
|
12954
|
-
const defaultProps$
|
|
13505
|
+
const defaultProps$I = {
|
|
12955
13506
|
data: {
|
|
12956
13507
|
text: "",
|
|
12957
13508
|
value: "",
|
|
@@ -12966,7 +13517,7 @@
|
|
|
12966
13517
|
};
|
|
12967
13518
|
const InternalCascaderItem = (props) => {
|
|
12968
13519
|
const { data, checked, chooseItem } = {
|
|
12969
|
-
...defaultProps$
|
|
13520
|
+
...defaultProps$I,
|
|
12970
13521
|
...props
|
|
12971
13522
|
};
|
|
12972
13523
|
const b2 = cn("cascader-item");
|
|
@@ -13002,7 +13553,7 @@
|
|
|
13002
13553
|
}));
|
|
13003
13554
|
};
|
|
13004
13555
|
const CascaderItem = React__default["default"].forwardRef(InternalCascaderItem);
|
|
13005
|
-
CascaderItem.defaultProps = defaultProps$
|
|
13556
|
+
CascaderItem.defaultProps = defaultProps$I;
|
|
13006
13557
|
CascaderItem.displayName = "NutCascaderItem";
|
|
13007
13558
|
const formatTree = (tree, parent, config2) => tree.map((node) => {
|
|
13008
13559
|
const {
|
|
@@ -13136,7 +13687,7 @@
|
|
|
13136
13687
|
return pathNodes;
|
|
13137
13688
|
}
|
|
13138
13689
|
}
|
|
13139
|
-
const defaultProps$
|
|
13690
|
+
const defaultProps$H = {
|
|
13140
13691
|
className: "",
|
|
13141
13692
|
style: {},
|
|
13142
13693
|
visible: false,
|
|
@@ -13181,7 +13732,7 @@
|
|
|
13181
13732
|
onClose,
|
|
13182
13733
|
onChange,
|
|
13183
13734
|
onPathChange
|
|
13184
|
-
} = { ...defaultProps$
|
|
13735
|
+
} = { ...defaultProps$H, ...props };
|
|
13185
13736
|
const [tabvalue, setTabvalue] = React.useState("c1");
|
|
13186
13737
|
const [optiosData, setOptiosData] = React.useState([]);
|
|
13187
13738
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
|
|
@@ -13437,9 +13988,9 @@
|
|
|
13437
13988
|
})))));
|
|
13438
13989
|
};
|
|
13439
13990
|
const Cascader = React__default["default"].forwardRef(InternalCascader);
|
|
13440
|
-
Cascader.defaultProps = defaultProps$
|
|
13991
|
+
Cascader.defaultProps = defaultProps$H;
|
|
13441
13992
|
Cascader.displayName = "NutCascader";
|
|
13442
|
-
const defaultProps$
|
|
13993
|
+
const defaultProps$G = {
|
|
13443
13994
|
...ComponentDefaults,
|
|
13444
13995
|
placeholder: "",
|
|
13445
13996
|
shape: "square",
|
|
@@ -13485,9 +14036,11 @@
|
|
|
13485
14036
|
onClickLeftinIcon,
|
|
13486
14037
|
onClickLeftoutIcon,
|
|
13487
14038
|
onClickRightinIcon,
|
|
13488
|
-
onClickRightoutIcon
|
|
14039
|
+
onClickRightoutIcon,
|
|
14040
|
+
iconClassPrefix,
|
|
14041
|
+
iconFontClassName
|
|
13489
14042
|
} = {
|
|
13490
|
-
...defaultProps$
|
|
14043
|
+
...defaultProps$G,
|
|
13491
14044
|
...props
|
|
13492
14045
|
};
|
|
13493
14046
|
const alignClass = `${align}`;
|
|
@@ -13585,8 +14138,8 @@
|
|
|
13585
14138
|
className: `${searchbarBem("clear")} ${rightinIcon ? "pos-right" : ""}`,
|
|
13586
14139
|
onClick: (e2) => clearaVal(e2)
|
|
13587
14140
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
13588
|
-
classPrefix:
|
|
13589
|
-
fontClassName:
|
|
14141
|
+
classPrefix: iconClassPrefix,
|
|
14142
|
+
fontClassName: iconFontClassName,
|
|
13590
14143
|
name: "circle-close",
|
|
13591
14144
|
size: "12",
|
|
13592
14145
|
color: "#555"
|
|
@@ -13626,9 +14179,9 @@
|
|
|
13626
14179
|
className: `${searchbarBem("content")}`
|
|
13627
14180
|
}, renderLeftinIcon(), renderField(), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
|
|
13628
14181
|
};
|
|
13629
|
-
SearchBar.defaultProps = defaultProps$
|
|
14182
|
+
SearchBar.defaultProps = defaultProps$G;
|
|
13630
14183
|
SearchBar.displayName = "NutSearchBar";
|
|
13631
|
-
const defaultProps$
|
|
14184
|
+
const defaultProps$F = {
|
|
13632
14185
|
confirmText: "",
|
|
13633
14186
|
title: "",
|
|
13634
14187
|
visible: false,
|
|
@@ -13826,9 +14379,9 @@
|
|
|
13826
14379
|
})
|
|
13827
14380
|
}, confirmText || locale.done))) : null))));
|
|
13828
14381
|
};
|
|
13829
|
-
NumberKeyboard.defaultProps = defaultProps$
|
|
14382
|
+
NumberKeyboard.defaultProps = defaultProps$F;
|
|
13830
14383
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
13831
|
-
const defaultProps$
|
|
14384
|
+
const defaultProps$E = {
|
|
13832
14385
|
cancelTxt: "",
|
|
13833
14386
|
optionTag: "name",
|
|
13834
14387
|
optionSubTag: "subname",
|
|
@@ -13862,7 +14415,7 @@
|
|
|
13862
14415
|
className,
|
|
13863
14416
|
style,
|
|
13864
14417
|
...rest
|
|
13865
|
-
} = { ...defaultProps$
|
|
14418
|
+
} = { ...defaultProps$E, ...props };
|
|
13866
14419
|
const b2 = cn("actionsheet");
|
|
13867
14420
|
const isHighlight = (item) => {
|
|
13868
14421
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
|
|
@@ -13906,9 +14459,9 @@
|
|
|
13906
14459
|
onClick: () => cancelActionSheet()
|
|
13907
14460
|
}, cancelTxt)));
|
|
13908
14461
|
};
|
|
13909
|
-
ActionSheet.defaultProps = defaultProps$
|
|
14462
|
+
ActionSheet.defaultProps = defaultProps$E;
|
|
13910
14463
|
ActionSheet.displayName = "NutActionSheet";
|
|
13911
|
-
const defaultProps$
|
|
14464
|
+
const defaultProps$D = {
|
|
13912
14465
|
...ComponentDefaults,
|
|
13913
14466
|
bottom: 20,
|
|
13914
14467
|
right: 10,
|
|
@@ -13930,9 +14483,11 @@
|
|
|
13930
14483
|
className,
|
|
13931
14484
|
duration,
|
|
13932
14485
|
style,
|
|
13933
|
-
onClick
|
|
14486
|
+
onClick,
|
|
14487
|
+
iconClassPrefix,
|
|
14488
|
+
iconFontClassName
|
|
13934
14489
|
} = {
|
|
13935
|
-
...defaultProps$
|
|
14490
|
+
...defaultProps$D,
|
|
13936
14491
|
...props
|
|
13937
14492
|
};
|
|
13938
14493
|
const [backTop, SetBackTop] = React.useState(false);
|
|
@@ -14016,16 +14571,16 @@
|
|
|
14016
14571
|
goTop(e2);
|
|
14017
14572
|
}
|
|
14018
14573
|
}, children || /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
14019
|
-
classPrefix:
|
|
14020
|
-
fontClassName:
|
|
14574
|
+
classPrefix: iconClassPrefix,
|
|
14575
|
+
fontClassName: iconFontClassName,
|
|
14021
14576
|
size: "19px",
|
|
14022
14577
|
className: "nut-backtop-main",
|
|
14023
14578
|
name: "top"
|
|
14024
14579
|
}));
|
|
14025
14580
|
};
|
|
14026
|
-
BackTop.defaultProps = defaultProps$
|
|
14581
|
+
BackTop.defaultProps = defaultProps$D;
|
|
14027
14582
|
BackTop.displayName = "NutBackTop";
|
|
14028
|
-
const defaultProps$
|
|
14583
|
+
const defaultProps$C = {
|
|
14029
14584
|
attract: false,
|
|
14030
14585
|
direction: void 0,
|
|
14031
14586
|
boundary: {
|
|
@@ -14038,7 +14593,7 @@
|
|
|
14038
14593
|
};
|
|
14039
14594
|
const Drag = (props) => {
|
|
14040
14595
|
const { attract, direction, boundary, children, className, style, ...reset } = {
|
|
14041
|
-
...defaultProps$
|
|
14596
|
+
...defaultProps$C,
|
|
14042
14597
|
...props
|
|
14043
14598
|
};
|
|
14044
14599
|
const b2 = cn("drag");
|
|
@@ -14100,7 +14655,7 @@
|
|
|
14100
14655
|
...bind()
|
|
14101
14656
|
}, children));
|
|
14102
14657
|
};
|
|
14103
|
-
Drag.defaultProps = defaultProps$
|
|
14658
|
+
Drag.defaultProps = defaultProps$C;
|
|
14104
14659
|
Drag.displayName = "NutDrag";
|
|
14105
14660
|
const Content = (props) => {
|
|
14106
14661
|
const {
|
|
@@ -14295,7 +14850,7 @@
|
|
|
14295
14850
|
update: update2
|
|
14296
14851
|
};
|
|
14297
14852
|
}
|
|
14298
|
-
const defaultProps$
|
|
14853
|
+
const defaultProps$B = {
|
|
14299
14854
|
okText: "\u786E\u8BA4",
|
|
14300
14855
|
cancelText: "\u53D6\u6D88",
|
|
14301
14856
|
mask: true,
|
|
@@ -14386,9 +14941,9 @@
|
|
|
14386
14941
|
});
|
|
14387
14942
|
};
|
|
14388
14943
|
});
|
|
14389
|
-
Dialog.defaultProps = defaultProps$
|
|
14944
|
+
Dialog.defaultProps = defaultProps$B;
|
|
14390
14945
|
Dialog.displayName = "NutDialog";
|
|
14391
|
-
const defaultProps$
|
|
14946
|
+
const defaultProps$A = {
|
|
14392
14947
|
...ComponentDefaults,
|
|
14393
14948
|
hasMore: true,
|
|
14394
14949
|
threshold: 200,
|
|
@@ -14418,12 +14973,14 @@
|
|
|
14418
14973
|
loadTxt,
|
|
14419
14974
|
loadMoreTxt,
|
|
14420
14975
|
className,
|
|
14421
|
-
|
|
14422
|
-
|
|
14423
|
-
|
|
14976
|
+
onRefresh,
|
|
14977
|
+
onLoadMore,
|
|
14978
|
+
onScrollChange,
|
|
14979
|
+
iconClassPrefix,
|
|
14980
|
+
iconFontClassName,
|
|
14424
14981
|
...restProps
|
|
14425
14982
|
} = {
|
|
14426
|
-
...defaultProps$
|
|
14983
|
+
...defaultProps$A,
|
|
14427
14984
|
...props
|
|
14428
14985
|
};
|
|
14429
14986
|
const [isInfiniting, setIsInfiniting] = React.useState(false);
|
|
@@ -14471,7 +15028,7 @@
|
|
|
14471
15028
|
return false;
|
|
14472
15029
|
}
|
|
14473
15030
|
setIsInfiniting(true);
|
|
14474
|
-
|
|
15031
|
+
onLoadMore && onLoadMore(infiniteDone);
|
|
14475
15032
|
return true;
|
|
14476
15033
|
});
|
|
14477
15034
|
};
|
|
@@ -14512,7 +15069,7 @@
|
|
|
14512
15069
|
distance.current = 0;
|
|
14513
15070
|
refreshTop.current.style.height = `${distance.current}px`;
|
|
14514
15071
|
} else {
|
|
14515
|
-
|
|
15072
|
+
onRefresh && onRefresh(refreshDone);
|
|
14516
15073
|
}
|
|
14517
15074
|
};
|
|
14518
15075
|
const requestAniFrame2 = () => {
|
|
@@ -14547,7 +15104,7 @@
|
|
|
14547
15104
|
direction = "down";
|
|
14548
15105
|
}
|
|
14549
15106
|
beforeScrollTop.current = resScrollTop;
|
|
14550
|
-
|
|
15107
|
+
onScrollChange && onScrollChange(resScrollTop);
|
|
14551
15108
|
return offsetDistance <= threshold && direction === "down";
|
|
14552
15109
|
};
|
|
14553
15110
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -14564,8 +15121,8 @@
|
|
|
14564
15121
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14565
15122
|
className: "top-box"
|
|
14566
15123
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
14567
|
-
classPrefix:
|
|
14568
|
-
fontClassName:
|
|
15124
|
+
classPrefix: iconClassPrefix,
|
|
15125
|
+
fontClassName: iconFontClassName,
|
|
14569
15126
|
className: "top-img",
|
|
14570
15127
|
name: pullIcon
|
|
14571
15128
|
}), /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
@@ -14577,8 +15134,8 @@
|
|
|
14577
15134
|
}, isInfiniting ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14578
15135
|
className: "bottom-box"
|
|
14579
15136
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
14580
|
-
classPrefix:
|
|
14581
|
-
fontClassName:
|
|
15137
|
+
classPrefix: iconClassPrefix,
|
|
15138
|
+
fontClassName: iconFontClassName,
|
|
14582
15139
|
className: "bottom-img",
|
|
14583
15140
|
name: loadIcon
|
|
14584
15141
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -14587,7 +15144,7 @@
|
|
|
14587
15144
|
className: "tips"
|
|
14588
15145
|
}, loadMoreTxt || locale.infiniteloading.loadMoreText)));
|
|
14589
15146
|
};
|
|
14590
|
-
Infiniteloading.defaultProps = defaultProps$
|
|
15147
|
+
Infiniteloading.defaultProps = defaultProps$A;
|
|
14591
15148
|
Infiniteloading.displayName = "NutInfiniteloading";
|
|
14592
15149
|
class Notification extends React__namespace.PureComponent {
|
|
14593
15150
|
constructor(props) {
|
|
@@ -14762,7 +15319,7 @@
|
|
|
14762
15319
|
}
|
|
14763
15320
|
}
|
|
14764
15321
|
};
|
|
14765
|
-
const defaultProps$
|
|
15322
|
+
const defaultProps$z = {
|
|
14766
15323
|
isAsync: false,
|
|
14767
15324
|
checked: false,
|
|
14768
15325
|
disable: false,
|
|
@@ -14785,7 +15342,7 @@
|
|
|
14785
15342
|
className,
|
|
14786
15343
|
style
|
|
14787
15344
|
} = {
|
|
14788
|
-
...defaultProps$
|
|
15345
|
+
...defaultProps$z,
|
|
14789
15346
|
...props
|
|
14790
15347
|
};
|
|
14791
15348
|
const [value, setValue] = React.useState(false);
|
|
@@ -14825,7 +15382,7 @@
|
|
|
14825
15382
|
className: `${b2("label")} close`
|
|
14826
15383
|
}, inactiveText))));
|
|
14827
15384
|
};
|
|
14828
|
-
Switch.defaultProps = defaultProps$
|
|
15385
|
+
Switch.defaultProps = defaultProps$z;
|
|
14829
15386
|
Switch.displayName = "NutSwitch";
|
|
14830
15387
|
function preventDefault(event, isStopPropagation) {
|
|
14831
15388
|
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
@@ -14835,7 +15392,7 @@
|
|
|
14835
15392
|
event.stopPropagation();
|
|
14836
15393
|
}
|
|
14837
15394
|
}
|
|
14838
|
-
const defaultProps$
|
|
15395
|
+
const defaultProps$y = {
|
|
14839
15396
|
name: "",
|
|
14840
15397
|
leftWidth: 0,
|
|
14841
15398
|
rightWidth: 0
|
|
@@ -14843,7 +15400,7 @@
|
|
|
14843
15400
|
const Swipe = React.forwardRef((props, instanceRef) => {
|
|
14844
15401
|
const swipeBem = cn("swipe");
|
|
14845
15402
|
const touch = useTouch();
|
|
14846
|
-
const { children, className, style } = { ...defaultProps$
|
|
15403
|
+
const { children, className, style } = { ...defaultProps$y, ...props };
|
|
14847
15404
|
const root = React.useRef();
|
|
14848
15405
|
const opened = React.useRef(false);
|
|
14849
15406
|
const lockClick = React.useRef(false);
|
|
@@ -15009,29 +15566,8 @@
|
|
|
15009
15566
|
style: wrapperStyle
|
|
15010
15567
|
}, renderActionContent("left", leftRef), children, renderActionContent("right", rightRef)));
|
|
15011
15568
|
});
|
|
15012
|
-
Swipe.defaultProps = defaultProps$
|
|
15569
|
+
Swipe.defaultProps = defaultProps$y;
|
|
15013
15570
|
Swipe.displayName = "NutSwipe";
|
|
15014
|
-
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
15015
|
-
const defaultRoot = canUseDom ? window : void 0;
|
|
15016
|
-
const overflowStylePatterns = ["scroll", "auto", "overlay"];
|
|
15017
|
-
function isElement(node) {
|
|
15018
|
-
const ELEMENT_NODE_TYPE = 1;
|
|
15019
|
-
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
15020
|
-
}
|
|
15021
|
-
function getScrollParent(el, root = defaultRoot) {
|
|
15022
|
-
let node = el;
|
|
15023
|
-
while (node && node !== root && isElement(node)) {
|
|
15024
|
-
if (node === document.body) {
|
|
15025
|
-
return root;
|
|
15026
|
-
}
|
|
15027
|
-
const { overflowY } = window.getComputedStyle(node);
|
|
15028
|
-
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
15029
|
-
return node;
|
|
15030
|
-
}
|
|
15031
|
-
node = node.parentNode;
|
|
15032
|
-
}
|
|
15033
|
-
return root;
|
|
15034
|
-
}
|
|
15035
15571
|
function bound(position, min, max) {
|
|
15036
15572
|
let ret = position;
|
|
15037
15573
|
if (min !== void 0) {
|
|
@@ -15068,7 +15604,7 @@
|
|
|
15068
15604
|
console.log(e2);
|
|
15069
15605
|
}
|
|
15070
15606
|
}
|
|
15071
|
-
const defaultProps$
|
|
15607
|
+
const defaultProps$x = {
|
|
15072
15608
|
className: "",
|
|
15073
15609
|
style: {},
|
|
15074
15610
|
pullingText: "",
|
|
@@ -15085,7 +15621,7 @@
|
|
|
15085
15621
|
const PullToRefresh = (p2) => {
|
|
15086
15622
|
const { locale } = useConfig();
|
|
15087
15623
|
const props = {
|
|
15088
|
-
...defaultProps$
|
|
15624
|
+
...defaultProps$x,
|
|
15089
15625
|
...p2,
|
|
15090
15626
|
...{
|
|
15091
15627
|
pullingText: p2.pullingText || locale.pullToRefresh.pullingText,
|
|
@@ -15224,10 +15760,10 @@
|
|
|
15224
15760
|
className: "nut-pulltorefresh-content"
|
|
15225
15761
|
}, props.children));
|
|
15226
15762
|
};
|
|
15227
|
-
PullToRefresh.defaultProps = defaultProps$
|
|
15763
|
+
PullToRefresh.defaultProps = defaultProps$x;
|
|
15228
15764
|
PullToRefresh.displayName = "NutPullToRefresh";
|
|
15229
15765
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
15230
|
-
const defaultProps$
|
|
15766
|
+
const defaultProps$w = {
|
|
15231
15767
|
strokeWidth: 5,
|
|
15232
15768
|
radius: 50,
|
|
15233
15769
|
strokeLinecap: "round",
|
|
@@ -15250,7 +15786,7 @@
|
|
|
15250
15786
|
strokeLinecap,
|
|
15251
15787
|
...restProps
|
|
15252
15788
|
} = {
|
|
15253
|
-
...defaultProps$
|
|
15789
|
+
...defaultProps$w,
|
|
15254
15790
|
...props
|
|
15255
15791
|
};
|
|
15256
15792
|
const b2 = cn("circleprogress");
|
|
@@ -15336,9 +15872,9 @@
|
|
|
15336
15872
|
className: "nut-circleprogress-text"
|
|
15337
15873
|
}, children || /* @__PURE__ */ React__default["default"].createElement("div", null, progress, "%")));
|
|
15338
15874
|
};
|
|
15339
|
-
CircleProgress.defaultProps = defaultProps$
|
|
15875
|
+
CircleProgress.defaultProps = defaultProps$w;
|
|
15340
15876
|
CircleProgress.displayName = "NutCircleProgress";
|
|
15341
|
-
const defaultProps$
|
|
15877
|
+
const defaultProps$v = {
|
|
15342
15878
|
...ComponentDefaults,
|
|
15343
15879
|
direction: "across",
|
|
15344
15880
|
list: [],
|
|
@@ -15376,8 +15912,13 @@
|
|
|
15376
15912
|
speed,
|
|
15377
15913
|
rightIcon,
|
|
15378
15914
|
close,
|
|
15379
|
-
click
|
|
15380
|
-
|
|
15915
|
+
click,
|
|
15916
|
+
iconClassPrefix,
|
|
15917
|
+
iconFontClassName
|
|
15918
|
+
} = {
|
|
15919
|
+
...defaultProps$v,
|
|
15920
|
+
...props
|
|
15921
|
+
};
|
|
15381
15922
|
const wrap = React.useRef(null);
|
|
15382
15923
|
const content = React.useRef(null);
|
|
15383
15924
|
const [showNoticeBar, SetShowNoticeBar] = React.useState(true);
|
|
@@ -15568,8 +16109,8 @@
|
|
|
15568
16109
|
className: "left-icon",
|
|
15569
16110
|
style: { backgroundImage: `url(${iconBg() || ""})` }
|
|
15570
16111
|
}, !iconBg() ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
15571
|
-
classPrefix:
|
|
15572
|
-
fontClassName:
|
|
16112
|
+
classPrefix: iconClassPrefix,
|
|
16113
|
+
fontClassName: iconFontClassName,
|
|
15573
16114
|
name: "notice",
|
|
15574
16115
|
size: "16",
|
|
15575
16116
|
color
|
|
@@ -15585,8 +16126,8 @@
|
|
|
15585
16126
|
className: "right-icon",
|
|
15586
16127
|
onClick: onClickIcon
|
|
15587
16128
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
15588
|
-
classPrefix:
|
|
15589
|
-
fontClassName:
|
|
16129
|
+
classPrefix: iconClassPrefix,
|
|
16130
|
+
fontClassName: iconFontClassName,
|
|
15590
16131
|
name: rightIcon || "close",
|
|
15591
16132
|
color
|
|
15592
16133
|
})) : null) : null, scrollList.current.length > 0 && direction === "vertical" ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -15615,23 +16156,23 @@
|
|
|
15615
16156
|
handleClickIcon();
|
|
15616
16157
|
}
|
|
15617
16158
|
}, rightIcon || (closeMode ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
15618
|
-
classPrefix:
|
|
15619
|
-
fontClassName:
|
|
16159
|
+
classPrefix: iconClassPrefix,
|
|
16160
|
+
fontClassName: iconFontClassName,
|
|
15620
16161
|
name: "cross",
|
|
15621
16162
|
color,
|
|
15622
16163
|
size: "11px"
|
|
15623
16164
|
}) : null))) : null);
|
|
15624
16165
|
};
|
|
15625
|
-
NoticeBar.defaultProps = defaultProps$
|
|
16166
|
+
NoticeBar.defaultProps = defaultProps$v;
|
|
15626
16167
|
NoticeBar.displayName = "NutNoticeBar";
|
|
15627
16168
|
const DataContext$1 = React.createContext({});
|
|
15628
|
-
const defaultProps$
|
|
16169
|
+
const defaultProps$u = {
|
|
15629
16170
|
current: 0,
|
|
15630
16171
|
direction: "horizontal",
|
|
15631
16172
|
progressDot: false
|
|
15632
16173
|
};
|
|
15633
16174
|
const Steps = (props) => {
|
|
15634
|
-
const propSteps = { ...defaultProps$
|
|
16175
|
+
const propSteps = { ...defaultProps$u, ...props };
|
|
15635
16176
|
const {
|
|
15636
16177
|
children,
|
|
15637
16178
|
current,
|
|
@@ -15664,9 +16205,9 @@
|
|
|
15664
16205
|
children
|
|
15665
16206
|
));
|
|
15666
16207
|
};
|
|
15667
|
-
Steps.defaultProps = defaultProps$
|
|
16208
|
+
Steps.defaultProps = defaultProps$u;
|
|
15668
16209
|
Steps.displayName = "NutSteps";
|
|
15669
|
-
const defaultProps$
|
|
16210
|
+
const defaultProps$t = {
|
|
15670
16211
|
...ComponentDefaults,
|
|
15671
16212
|
title: "",
|
|
15672
16213
|
content: "",
|
|
@@ -15686,9 +16227,11 @@
|
|
|
15686
16227
|
size,
|
|
15687
16228
|
className,
|
|
15688
16229
|
renderContent,
|
|
16230
|
+
iconClassPrefix,
|
|
16231
|
+
iconFontClassName,
|
|
15689
16232
|
...restProps
|
|
15690
16233
|
} = {
|
|
15691
|
-
...defaultProps$
|
|
16234
|
+
...defaultProps$t,
|
|
15692
16235
|
...props
|
|
15693
16236
|
};
|
|
15694
16237
|
const parent = React.useContext(DataContext$1);
|
|
@@ -15733,8 +16276,8 @@
|
|
|
15733
16276
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
15734
16277
|
className: renderIconClass()
|
|
15735
16278
|
}, icon ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
15736
|
-
classPrefix:
|
|
15737
|
-
fontClassName:
|
|
16279
|
+
classPrefix: iconClassPrefix,
|
|
16280
|
+
fontClassName: iconFontClassName,
|
|
15738
16281
|
className: "nut-step-icon-inner",
|
|
15739
16282
|
color: iconColor,
|
|
15740
16283
|
name: icon,
|
|
@@ -15751,10 +16294,10 @@
|
|
|
15751
16294
|
className: "nut-step-content"
|
|
15752
16295
|
}, renderContent())));
|
|
15753
16296
|
};
|
|
15754
|
-
Step.defaultProps = defaultProps$
|
|
16297
|
+
Step.defaultProps = defaultProps$t;
|
|
15755
16298
|
Step.displayName = "NutStep";
|
|
15756
16299
|
const DataContext = React.createContext({});
|
|
15757
|
-
const defaultProps$
|
|
16300
|
+
const defaultProps$s = {
|
|
15758
16301
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
15759
16302
|
height: 0,
|
|
15760
16303
|
duration: 500,
|
|
@@ -15772,7 +16315,7 @@
|
|
|
15772
16315
|
};
|
|
15773
16316
|
const DISTANCE = 5;
|
|
15774
16317
|
const Swiper = React__default["default"].forwardRef((props, ref) => {
|
|
15775
|
-
const propSwiper = { ...defaultProps$
|
|
16318
|
+
const propSwiper = { ...defaultProps$s, ...props };
|
|
15776
16319
|
const {
|
|
15777
16320
|
children,
|
|
15778
16321
|
direction,
|
|
@@ -16182,13 +16725,13 @@
|
|
|
16182
16725
|
});
|
|
16183
16726
|
})) : /* @__PURE__ */ React__default["default"].createElement("div", null, pageContent)));
|
|
16184
16727
|
});
|
|
16185
|
-
Swiper.defaultProps = defaultProps$
|
|
16728
|
+
Swiper.defaultProps = defaultProps$s;
|
|
16186
16729
|
Swiper.displayName = "NutSwiper";
|
|
16187
|
-
const defaultProps$
|
|
16730
|
+
const defaultProps$r = {
|
|
16188
16731
|
direction: "horizontal"
|
|
16189
16732
|
};
|
|
16190
16733
|
const SwiperItem = React__default["default"].forwardRef((props, ref) => {
|
|
16191
|
-
const _props = { ...defaultProps$
|
|
16734
|
+
const _props = { ...defaultProps$r, ...props };
|
|
16192
16735
|
const { children, direction, size } = _props;
|
|
16193
16736
|
const parent = React.useContext(DataContext);
|
|
16194
16737
|
const b2 = cn("swiper-item");
|
|
@@ -16207,10 +16750,10 @@
|
|
|
16207
16750
|
style: style()
|
|
16208
16751
|
}, children);
|
|
16209
16752
|
});
|
|
16210
|
-
SwiperItem.defaultProps = defaultProps$
|
|
16753
|
+
SwiperItem.defaultProps = defaultProps$r;
|
|
16211
16754
|
SwiperItem.displayName = "NutSwiperItem";
|
|
16212
16755
|
const AvatarContext = React.createContext({});
|
|
16213
|
-
const defaultProps$
|
|
16756
|
+
const defaultProps$q = {
|
|
16214
16757
|
...ComponentDefaults,
|
|
16215
16758
|
size: "",
|
|
16216
16759
|
icon: "",
|
|
@@ -16236,9 +16779,11 @@
|
|
|
16236
16779
|
style,
|
|
16237
16780
|
activeAvatar,
|
|
16238
16781
|
onError,
|
|
16782
|
+
iconClassPrefix,
|
|
16783
|
+
iconFontClassName,
|
|
16239
16784
|
...rest
|
|
16240
16785
|
} = {
|
|
16241
|
-
...defaultProps$
|
|
16786
|
+
...defaultProps$q,
|
|
16242
16787
|
...props
|
|
16243
16788
|
};
|
|
16244
16789
|
const [maxSum, setMaxSum] = React.useState(0);
|
|
@@ -16311,8 +16856,8 @@
|
|
|
16311
16856
|
alt,
|
|
16312
16857
|
onError: errorEvent
|
|
16313
16858
|
}), icon && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
16314
|
-
classPrefix:
|
|
16315
|
-
fontClassName:
|
|
16859
|
+
classPrefix: iconClassPrefix,
|
|
16860
|
+
fontClassName: iconFontClassName,
|
|
16316
16861
|
className: "icon",
|
|
16317
16862
|
name: iconStyles
|
|
16318
16863
|
}), children && /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
@@ -16321,9 +16866,9 @@
|
|
|
16321
16866
|
className: "text"
|
|
16322
16867
|
}, ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - ((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.maxCount)}`)));
|
|
16323
16868
|
};
|
|
16324
|
-
Avatar.defaultProps = defaultProps$
|
|
16869
|
+
Avatar.defaultProps = defaultProps$q;
|
|
16325
16870
|
Avatar.displayName = "NutAvatar";
|
|
16326
|
-
const defaultProps$
|
|
16871
|
+
const defaultProps$p = {
|
|
16327
16872
|
maxContent: "",
|
|
16328
16873
|
maxCount: "",
|
|
16329
16874
|
maxBgColor: "#eee",
|
|
@@ -16335,7 +16880,7 @@
|
|
|
16335
16880
|
};
|
|
16336
16881
|
const AvatarGroup = (props) => {
|
|
16337
16882
|
useConfig();
|
|
16338
|
-
const propAvatarGroup = { ...defaultProps$
|
|
16883
|
+
const propAvatarGroup = { ...defaultProps$p, ...props };
|
|
16339
16884
|
const { className, style, children } = propAvatarGroup;
|
|
16340
16885
|
const avatarGroupRef = React.useRef(null);
|
|
16341
16886
|
const b2 = cn("avatar-group");
|
|
@@ -16352,9 +16897,9 @@
|
|
|
16352
16897
|
ref: avatarGroupRef
|
|
16353
16898
|
}, children));
|
|
16354
16899
|
};
|
|
16355
|
-
AvatarGroup.defaultProps = defaultProps$
|
|
16900
|
+
AvatarGroup.defaultProps = defaultProps$p;
|
|
16356
16901
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
16357
|
-
const defaultProps$
|
|
16902
|
+
const defaultProps$o = {
|
|
16358
16903
|
price: 0,
|
|
16359
16904
|
needSymbol: true,
|
|
16360
16905
|
symbol: "¥",
|
|
@@ -16372,7 +16917,7 @@
|
|
|
16372
16917
|
className,
|
|
16373
16918
|
...rest
|
|
16374
16919
|
} = {
|
|
16375
|
-
...defaultProps$
|
|
16920
|
+
...defaultProps$o,
|
|
16376
16921
|
...props
|
|
16377
16922
|
};
|
|
16378
16923
|
const b2 = cn("price");
|
|
@@ -16435,9 +16980,9 @@
|
|
|
16435
16980
|
className: `${b2("small")}`
|
|
16436
16981
|
}, formatDecimal(price)));
|
|
16437
16982
|
};
|
|
16438
|
-
Price.defaultProps = defaultProps$
|
|
16983
|
+
Price.defaultProps = defaultProps$o;
|
|
16439
16984
|
Price.displayName = "NutPrice";
|
|
16440
|
-
const defaultProps$
|
|
16985
|
+
const defaultProps$n = {
|
|
16441
16986
|
...ComponentDefaults,
|
|
16442
16987
|
value: "",
|
|
16443
16988
|
dot: false,
|
|
@@ -16449,8 +16994,18 @@
|
|
|
16449
16994
|
icons: ""
|
|
16450
16995
|
};
|
|
16451
16996
|
const Badge = (props) => {
|
|
16452
|
-
const {
|
|
16453
|
-
|
|
16997
|
+
const {
|
|
16998
|
+
children,
|
|
16999
|
+
dot,
|
|
17000
|
+
top,
|
|
17001
|
+
right,
|
|
17002
|
+
zIndex,
|
|
17003
|
+
color,
|
|
17004
|
+
icons,
|
|
17005
|
+
iconClassPrefix,
|
|
17006
|
+
iconFontClassName
|
|
17007
|
+
} = {
|
|
17008
|
+
...defaultProps$n,
|
|
16454
17009
|
...props
|
|
16455
17010
|
};
|
|
16456
17011
|
function content() {
|
|
@@ -16476,8 +17031,8 @@
|
|
|
16476
17031
|
}, icons !== "" && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
16477
17032
|
className: "slot-icons"
|
|
16478
17033
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
16479
|
-
classPrefix:
|
|
16480
|
-
fontClassName:
|
|
17034
|
+
classPrefix: iconClassPrefix,
|
|
17035
|
+
fontClassName: iconFontClassName,
|
|
16481
17036
|
className: "_icon",
|
|
16482
17037
|
name: icons,
|
|
16483
17038
|
color: "#ffffff",
|
|
@@ -16487,9 +17042,9 @@
|
|
|
16487
17042
|
style: getStyle()
|
|
16488
17043
|
}, content()));
|
|
16489
17044
|
};
|
|
16490
|
-
Badge.defaultProps = defaultProps$
|
|
17045
|
+
Badge.defaultProps = defaultProps$n;
|
|
16491
17046
|
Badge.displayName = "NutBadge";
|
|
16492
|
-
const defaultProps$
|
|
17047
|
+
const defaultProps$m = {
|
|
16493
17048
|
...ComponentDefaults,
|
|
16494
17049
|
type: "default",
|
|
16495
17050
|
color: "",
|
|
@@ -16516,9 +17071,11 @@
|
|
|
16516
17071
|
closeable,
|
|
16517
17072
|
textColor,
|
|
16518
17073
|
onClick,
|
|
16519
|
-
onClose
|
|
17074
|
+
onClose,
|
|
17075
|
+
iconClassPrefix,
|
|
17076
|
+
iconFontClassName
|
|
16520
17077
|
} = {
|
|
16521
|
-
...defaultProps$
|
|
17078
|
+
...defaultProps$m,
|
|
16522
17079
|
...props
|
|
16523
17080
|
};
|
|
16524
17081
|
const [btnName, setBtnName] = React.useState("");
|
|
@@ -16573,8 +17130,8 @@
|
|
|
16573
17130
|
}, children && /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
16574
17131
|
className: "text"
|
|
16575
17132
|
}, children), /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
16576
|
-
classPrefix:
|
|
16577
|
-
fontClassName:
|
|
17133
|
+
classPrefix: iconClassPrefix,
|
|
17134
|
+
fontClassName: iconFontClassName,
|
|
16578
17135
|
className: "_icon",
|
|
16579
17136
|
name: "close",
|
|
16580
17137
|
size: "12",
|
|
@@ -16592,7 +17149,7 @@
|
|
|
16592
17149
|
className: "text"
|
|
16593
17150
|
}, children)));
|
|
16594
17151
|
};
|
|
16595
|
-
Tag.defaultProps = defaultProps$
|
|
17152
|
+
Tag.defaultProps = defaultProps$m;
|
|
16596
17153
|
Tag.displayName = "NutTag";
|
|
16597
17154
|
function fillRef(ref, node) {
|
|
16598
17155
|
if (typeof ref === "function") {
|
|
@@ -16636,7 +17193,7 @@
|
|
|
16636
17193
|
return trigger;
|
|
16637
17194
|
}
|
|
16638
17195
|
}
|
|
16639
|
-
const defaultProps$
|
|
17196
|
+
const defaultProps$l = {
|
|
16640
17197
|
...ComponentDefaults,
|
|
16641
17198
|
list: [],
|
|
16642
17199
|
theme: "light",
|
|
@@ -16661,9 +17218,11 @@
|
|
|
16661
17218
|
style,
|
|
16662
17219
|
onClick,
|
|
16663
17220
|
onChoose,
|
|
17221
|
+
iconClassPrefix,
|
|
17222
|
+
iconFontClassName,
|
|
16664
17223
|
...reset
|
|
16665
17224
|
} = {
|
|
16666
|
-
...defaultProps$
|
|
17225
|
+
...defaultProps$l,
|
|
16667
17226
|
...props
|
|
16668
17227
|
};
|
|
16669
17228
|
const goodItem = React.useRef(null);
|
|
@@ -16744,8 +17303,8 @@
|
|
|
16744
17303
|
handleChoose(item, i);
|
|
16745
17304
|
}
|
|
16746
17305
|
}, item.icon ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
16747
|
-
classPrefix:
|
|
16748
|
-
fontClassName:
|
|
17306
|
+
classPrefix: iconClassPrefix,
|
|
17307
|
+
fontClassName: iconFontClassName,
|
|
16749
17308
|
className: "popover-menu-item-img",
|
|
16750
17309
|
name: item.icon
|
|
16751
17310
|
}) : "", /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -16757,9 +17316,9 @@
|
|
|
16757
17316
|
style: { background: "transparent" }
|
|
16758
17317
|
}) : "");
|
|
16759
17318
|
};
|
|
16760
|
-
Popover.defaultProps = defaultProps$
|
|
17319
|
+
Popover.defaultProps = defaultProps$l;
|
|
16761
17320
|
Popover.displayName = "NutPopover";
|
|
16762
|
-
const defaultProps$
|
|
17321
|
+
const defaultProps$k = {
|
|
16763
17322
|
width: "100px",
|
|
16764
17323
|
height: "100px",
|
|
16765
17324
|
row: 1,
|
|
@@ -16787,7 +17346,7 @@
|
|
|
16787
17346
|
avatarShape,
|
|
16788
17347
|
...restProps
|
|
16789
17348
|
} = {
|
|
16790
|
-
...defaultProps$
|
|
17349
|
+
...defaultProps$k,
|
|
16791
17350
|
...props
|
|
16792
17351
|
};
|
|
16793
17352
|
const b2 = cn("skeleton");
|
|
@@ -16842,9 +17401,9 @@
|
|
|
16842
17401
|
});
|
|
16843
17402
|
})))));
|
|
16844
17403
|
};
|
|
16845
|
-
Skeleton.defaultProps = defaultProps$
|
|
17404
|
+
Skeleton.defaultProps = defaultProps$k;
|
|
16846
17405
|
Skeleton.displayName = "NutSkeleton";
|
|
16847
|
-
const defaultProps$
|
|
17406
|
+
const defaultProps$j = {
|
|
16848
17407
|
paused: false,
|
|
16849
17408
|
startTime: Date.now(),
|
|
16850
17409
|
endTime: Date.now(),
|
|
@@ -16871,7 +17430,7 @@
|
|
|
16871
17430
|
onUpdate,
|
|
16872
17431
|
children,
|
|
16873
17432
|
...rest
|
|
16874
|
-
} = { ...defaultProps$
|
|
17433
|
+
} = { ...defaultProps$j, ...props };
|
|
16875
17434
|
const b2 = cn("countdown");
|
|
16876
17435
|
const [restTimeStamp, setRestTime] = React.useState(0);
|
|
16877
17436
|
const stateRef = React.useRef({
|
|
@@ -17067,9 +17626,9 @@
|
|
|
17067
17626
|
}));
|
|
17068
17627
|
};
|
|
17069
17628
|
const CountDown = React__default["default"].forwardRef(InternalCountDown);
|
|
17070
|
-
CountDown.defaultProps = defaultProps$
|
|
17629
|
+
CountDown.defaultProps = defaultProps$j;
|
|
17071
17630
|
CountDown.displayName = "NutCountDown";
|
|
17072
|
-
const defaultProps$
|
|
17631
|
+
const defaultProps$i = {
|
|
17073
17632
|
activeName: ["0"],
|
|
17074
17633
|
accordion: false,
|
|
17075
17634
|
icon: "",
|
|
@@ -17092,7 +17651,7 @@
|
|
|
17092
17651
|
iconColor,
|
|
17093
17652
|
change
|
|
17094
17653
|
} = {
|
|
17095
|
-
...defaultProps$
|
|
17654
|
+
...defaultProps$i,
|
|
17096
17655
|
...props
|
|
17097
17656
|
};
|
|
17098
17657
|
const childrenDom = React__default["default"].Children.toArray(children);
|
|
@@ -17143,15 +17702,16 @@
|
|
|
17143
17702
|
icon,
|
|
17144
17703
|
rotate,
|
|
17145
17704
|
iconSize,
|
|
17146
|
-
iconColor
|
|
17705
|
+
iconColor,
|
|
17706
|
+
childnull: !!item.props.children
|
|
17147
17707
|
});
|
|
17148
17708
|
}));
|
|
17149
17709
|
},
|
|
17150
17710
|
areEqual
|
|
17151
17711
|
);
|
|
17152
|
-
Collapse.defaultProps = defaultProps$
|
|
17712
|
+
Collapse.defaultProps = defaultProps$i;
|
|
17153
17713
|
Collapse.displayName = "NutCollapse";
|
|
17154
|
-
const defaultProps$
|
|
17714
|
+
const defaultProps$h = {
|
|
17155
17715
|
...ComponentDefaults,
|
|
17156
17716
|
title: "",
|
|
17157
17717
|
name: "",
|
|
@@ -17165,7 +17725,8 @@
|
|
|
17165
17725
|
titleIcon: "",
|
|
17166
17726
|
titleIconColor: "",
|
|
17167
17727
|
titleIconPosition: "",
|
|
17168
|
-
titleIconSize: ""
|
|
17728
|
+
titleIconSize: "",
|
|
17729
|
+
childnull: true
|
|
17169
17730
|
};
|
|
17170
17731
|
const CollapseItem = (props) => {
|
|
17171
17732
|
const {
|
|
@@ -17184,9 +17745,12 @@
|
|
|
17184
17745
|
titleIconSize,
|
|
17185
17746
|
iconSize,
|
|
17186
17747
|
iconColor,
|
|
17748
|
+
childnull,
|
|
17749
|
+
iconClassPrefix,
|
|
17750
|
+
iconFontClassName,
|
|
17187
17751
|
...rest
|
|
17188
17752
|
} = {
|
|
17189
|
-
...defaultProps$
|
|
17753
|
+
...defaultProps$h,
|
|
17190
17754
|
...props
|
|
17191
17755
|
};
|
|
17192
17756
|
const [domHeight, setDomHeight] = React.useState(-1);
|
|
@@ -17232,16 +17796,16 @@
|
|
|
17232
17796
|
}, titleIcon && titleIconPosition === "left" && /* @__PURE__ */ React__default["default"].createElement("b", {
|
|
17233
17797
|
className: colBem("title-icon-left")
|
|
17234
17798
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
17235
|
-
classPrefix:
|
|
17236
|
-
fontClassName:
|
|
17799
|
+
classPrefix: iconClassPrefix,
|
|
17800
|
+
fontClassName: iconFontClassName,
|
|
17237
17801
|
name: titleIcon,
|
|
17238
17802
|
size: titleIconSize,
|
|
17239
17803
|
color: disabled ? "#C2C2C2" : titleIconColor
|
|
17240
17804
|
})), title, titleIcon && titleIconPosition === "right" && /* @__PURE__ */ React__default["default"].createElement("b", {
|
|
17241
17805
|
className: colBem("title-icon-right")
|
|
17242
17806
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
17243
|
-
classPrefix:
|
|
17244
|
-
fontClassName:
|
|
17807
|
+
classPrefix: iconClassPrefix,
|
|
17808
|
+
fontClassName: iconFontClassName,
|
|
17245
17809
|
name: titleIcon,
|
|
17246
17810
|
size: titleIconSize,
|
|
17247
17811
|
color: disabled ? "#C2C2C2" : titleIconColor
|
|
@@ -17253,12 +17817,12 @@
|
|
|
17253
17817
|
className: colBem("icon"),
|
|
17254
17818
|
style: iconStyle
|
|
17255
17819
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
17256
|
-
classPrefix:
|
|
17257
|
-
fontClassName:
|
|
17820
|
+
classPrefix: iconClassPrefix,
|
|
17821
|
+
fontClassName: iconFontClassName,
|
|
17258
17822
|
name: icon,
|
|
17259
17823
|
size: iconSize,
|
|
17260
17824
|
color: disabled ? "#C2C2C2" : iconColor
|
|
17261
|
-
})))), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17825
|
+
})))), childnull && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17262
17826
|
className: colBem("content"),
|
|
17263
17827
|
style: { height: currHeight },
|
|
17264
17828
|
ref: measuredRef
|
|
@@ -17266,9 +17830,9 @@
|
|
|
17266
17830
|
className: colBem("content-text")
|
|
17267
17831
|
}, children)));
|
|
17268
17832
|
};
|
|
17269
|
-
CollapseItem.defaultProps = defaultProps$
|
|
17833
|
+
CollapseItem.defaultProps = defaultProps$h;
|
|
17270
17834
|
CollapseItem.displayName = "NutCollapseItem";
|
|
17271
|
-
const defaultProps$
|
|
17835
|
+
const defaultProps$g = {
|
|
17272
17836
|
maxLen: 0,
|
|
17273
17837
|
endNumber: "",
|
|
17274
17838
|
delaySpeed: 300,
|
|
@@ -17286,7 +17850,7 @@
|
|
|
17286
17850
|
thousands,
|
|
17287
17851
|
...reset
|
|
17288
17852
|
} = {
|
|
17289
|
-
...defaultProps$
|
|
17853
|
+
...defaultProps$g,
|
|
17290
17854
|
...props
|
|
17291
17855
|
};
|
|
17292
17856
|
const b2 = cn("countup");
|
|
@@ -17356,9 +17920,9 @@
|
|
|
17356
17920
|
}, item));
|
|
17357
17921
|
})));
|
|
17358
17922
|
};
|
|
17359
|
-
CountUp.defaultProps = defaultProps$
|
|
17923
|
+
CountUp.defaultProps = defaultProps$g;
|
|
17360
17924
|
CountUp.displayName = "NutCountUp";
|
|
17361
|
-
const defaultProps$
|
|
17925
|
+
const defaultProps$f = {};
|
|
17362
17926
|
class AnimatingNumbers extends React.Component {
|
|
17363
17927
|
constructor(props) {
|
|
17364
17928
|
super(props);
|
|
@@ -17370,7 +17934,7 @@
|
|
|
17370
17934
|
});
|
|
17371
17935
|
}
|
|
17372
17936
|
}
|
|
17373
|
-
AnimatingNumbers.defaultProps = defaultProps$
|
|
17937
|
+
AnimatingNumbers.defaultProps = defaultProps$f;
|
|
17374
17938
|
AnimatingNumbers.displayName = "NutAnimatingNumbers";
|
|
17375
17939
|
AnimatingNumbers.CountUp = CountUp;
|
|
17376
17940
|
AnimatingNumbers.CountUp = CountUp;
|
|
@@ -17379,7 +17943,7 @@
|
|
|
17379
17943
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
17380
17944
|
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
17381
17945
|
};
|
|
17382
|
-
const defaultProps$
|
|
17946
|
+
const defaultProps$e = {
|
|
17383
17947
|
description: "\u65E0\u5185\u5BB9",
|
|
17384
17948
|
image: "empty",
|
|
17385
17949
|
imageSize: "",
|
|
@@ -17387,9 +17951,9 @@
|
|
|
17387
17951
|
};
|
|
17388
17952
|
const Empty = (props) => {
|
|
17389
17953
|
const { locale } = useConfig();
|
|
17390
|
-
defaultProps$
|
|
17954
|
+
defaultProps$e.description = locale.noData || defaultProps$e.description;
|
|
17391
17955
|
const { image, imageSize, description, children, className, ...rest } = {
|
|
17392
|
-
...defaultProps$
|
|
17956
|
+
...defaultProps$e,
|
|
17393
17957
|
...props
|
|
17394
17958
|
};
|
|
17395
17959
|
const [imgStyle, setImgStyle] = React.useState({});
|
|
@@ -17431,7 +17995,7 @@
|
|
|
17431
17995
|
className: b2("description")
|
|
17432
17996
|
}, description) : { description }, children));
|
|
17433
17997
|
};
|
|
17434
|
-
Empty.defaultProps = defaultProps$
|
|
17998
|
+
Empty.defaultProps = defaultProps$e;
|
|
17435
17999
|
Empty.displayName = "NutEmpty";
|
|
17436
18000
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
17437
18001
|
let index2 = 0;
|
|
@@ -17544,7 +18108,7 @@
|
|
|
17544
18108
|
}
|
|
17545
18109
|
});
|
|
17546
18110
|
};
|
|
17547
|
-
const defaultProps$
|
|
18111
|
+
const defaultProps$d = {};
|
|
17548
18112
|
const VirtualList = (props) => {
|
|
17549
18113
|
const {
|
|
17550
18114
|
sourceData = [],
|
|
@@ -17703,9 +18267,9 @@
|
|
|
17703
18267
|
}) : data);
|
|
17704
18268
|
}))));
|
|
17705
18269
|
};
|
|
17706
|
-
VirtualList.defaultProps = defaultProps$
|
|
18270
|
+
VirtualList.defaultProps = defaultProps$d;
|
|
17707
18271
|
VirtualList.displayName = "NutVirtualList";
|
|
17708
|
-
const defaultProps$
|
|
18272
|
+
const defaultProps$c = {
|
|
17709
18273
|
...ComponentDefaults,
|
|
17710
18274
|
className: "",
|
|
17711
18275
|
style: {},
|
|
@@ -17717,7 +18281,7 @@
|
|
|
17717
18281
|
};
|
|
17718
18282
|
const Table = (props) => {
|
|
17719
18283
|
const { locale } = useConfig();
|
|
17720
|
-
defaultProps$
|
|
18284
|
+
defaultProps$c.noData = locale.noData;
|
|
17721
18285
|
const {
|
|
17722
18286
|
children,
|
|
17723
18287
|
className,
|
|
@@ -17729,9 +18293,11 @@
|
|
|
17729
18293
|
striped,
|
|
17730
18294
|
noData,
|
|
17731
18295
|
onSorter,
|
|
18296
|
+
iconClassPrefix,
|
|
18297
|
+
iconFontClassName,
|
|
17732
18298
|
...rest
|
|
17733
18299
|
} = {
|
|
17734
|
-
...defaultProps$
|
|
18300
|
+
...defaultProps$c,
|
|
17735
18301
|
...props
|
|
17736
18302
|
};
|
|
17737
18303
|
const [curData, setCurData] = React.useState(data);
|
|
@@ -17772,8 +18338,8 @@
|
|
|
17772
18338
|
key: item.key,
|
|
17773
18339
|
onClick: () => handleSorterClick(item)
|
|
17774
18340
|
}, item.title, item.sorter && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
17775
|
-
classPrefix:
|
|
17776
|
-
fontClassName:
|
|
18341
|
+
classPrefix: iconClassPrefix,
|
|
18342
|
+
fontClassName: iconFontClassName,
|
|
17777
18343
|
name: "down-arrow",
|
|
17778
18344
|
size: "12px"
|
|
17779
18345
|
}));
|
|
@@ -17829,9 +18395,9 @@
|
|
|
17829
18395
|
className: "nut-table__nodata__text"
|
|
17830
18396
|
}, noData))));
|
|
17831
18397
|
};
|
|
17832
|
-
Table.defaultProps = defaultProps$
|
|
18398
|
+
Table.defaultProps = defaultProps$c;
|
|
17833
18399
|
Table.displayName = "NutTable";
|
|
17834
|
-
const defaultProps$
|
|
18400
|
+
const defaultProps$b = {
|
|
17835
18401
|
source: {
|
|
17836
18402
|
type: {},
|
|
17837
18403
|
src: ""
|
|
@@ -17856,7 +18422,7 @@
|
|
|
17856
18422
|
playend,
|
|
17857
18423
|
...restProps
|
|
17858
18424
|
} = {
|
|
17859
|
-
...defaultProps$
|
|
18425
|
+
...defaultProps$b,
|
|
17860
18426
|
...props
|
|
17861
18427
|
};
|
|
17862
18428
|
const rootRef = React.useRef(null);
|
|
@@ -17910,195 +18476,8 @@
|
|
|
17910
18476
|
kind: "captions"
|
|
17911
18477
|
})));
|
|
17912
18478
|
};
|
|
17913
|
-
Video.defaultProps = defaultProps$
|
|
18479
|
+
Video.defaultProps = defaultProps$b;
|
|
17914
18480
|
Video.displayName = "NutVideo";
|
|
17915
|
-
const defaultProps$c = {
|
|
17916
|
-
name: "",
|
|
17917
|
-
size: "",
|
|
17918
|
-
classPrefix: "nut-icon",
|
|
17919
|
-
fontClassName: "nutui-iconfont",
|
|
17920
|
-
color: "",
|
|
17921
|
-
tag: "i",
|
|
17922
|
-
onClick: (e2) => {
|
|
17923
|
-
},
|
|
17924
|
-
className: ""
|
|
17925
|
-
};
|
|
17926
|
-
function pxCheck(value) {
|
|
17927
|
-
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
17928
|
-
}
|
|
17929
|
-
function Icon(props) {
|
|
17930
|
-
const {
|
|
17931
|
-
name,
|
|
17932
|
-
size,
|
|
17933
|
-
classPrefix,
|
|
17934
|
-
color,
|
|
17935
|
-
tag,
|
|
17936
|
-
children,
|
|
17937
|
-
className,
|
|
17938
|
-
fontClassName,
|
|
17939
|
-
style,
|
|
17940
|
-
onClick,
|
|
17941
|
-
...rest
|
|
17942
|
-
} = {
|
|
17943
|
-
...defaultProps$c,
|
|
17944
|
-
...props
|
|
17945
|
-
};
|
|
17946
|
-
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
17947
|
-
const type = isImage ? "img" : tag;
|
|
17948
|
-
const b2 = cn("icon");
|
|
17949
|
-
const handleClick2 = (e2) => {
|
|
17950
|
-
if (onClick) {
|
|
17951
|
-
onClick(e2);
|
|
17952
|
-
}
|
|
17953
|
-
};
|
|
17954
|
-
const hasSrc = () => {
|
|
17955
|
-
if (isImage)
|
|
17956
|
-
return { src: name };
|
|
17957
|
-
return {};
|
|
17958
|
-
};
|
|
17959
|
-
return React__default["default"].createElement(
|
|
17960
|
-
type,
|
|
17961
|
-
{
|
|
17962
|
-
className: isImage ? `${b2("img")} ${className || ""} ` : `${fontClassName} ${b2(null)} ${classPrefix}-${name} ${className || ""}`,
|
|
17963
|
-
style: {
|
|
17964
|
-
color,
|
|
17965
|
-
fontSize: pxCheck(size),
|
|
17966
|
-
width: pxCheck(size),
|
|
17967
|
-
height: pxCheck(size),
|
|
17968
|
-
...style
|
|
17969
|
-
},
|
|
17970
|
-
...rest,
|
|
17971
|
-
onClick: handleClick2,
|
|
17972
|
-
...hasSrc()
|
|
17973
|
-
},
|
|
17974
|
-
children
|
|
17975
|
-
);
|
|
17976
|
-
}
|
|
17977
|
-
Icon.defaultProps = defaultProps$c;
|
|
17978
|
-
Icon.displayName = "NutIcon";
|
|
17979
|
-
const defaultProps$b = {
|
|
17980
|
-
...ComponentDefaults,
|
|
17981
|
-
className: "",
|
|
17982
|
-
style: {},
|
|
17983
|
-
isShowPercentage: true,
|
|
17984
|
-
percentage: 0,
|
|
17985
|
-
fillColor: "#f3f3f3",
|
|
17986
|
-
strokeColor: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
17987
|
-
strokeWidth: "",
|
|
17988
|
-
textColor: "",
|
|
17989
|
-
textWidth: "",
|
|
17990
|
-
showText: true,
|
|
17991
|
-
textInside: false,
|
|
17992
|
-
textBackground: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
17993
|
-
textType: "text",
|
|
17994
|
-
status: false,
|
|
17995
|
-
iconName: "checked",
|
|
17996
|
-
iconColor: "#439422",
|
|
17997
|
-
iconSize: "16px",
|
|
17998
|
-
rounded: true,
|
|
17999
|
-
children: void 0
|
|
18000
|
-
};
|
|
18001
|
-
const Progress = (props) => {
|
|
18002
|
-
const {
|
|
18003
|
-
className,
|
|
18004
|
-
style,
|
|
18005
|
-
isShowPercentage,
|
|
18006
|
-
percentage,
|
|
18007
|
-
fillColor,
|
|
18008
|
-
strokeColor,
|
|
18009
|
-
strokeWidth,
|
|
18010
|
-
size,
|
|
18011
|
-
textColor,
|
|
18012
|
-
textWidth,
|
|
18013
|
-
showText,
|
|
18014
|
-
textInside,
|
|
18015
|
-
textBackground,
|
|
18016
|
-
textType,
|
|
18017
|
-
status,
|
|
18018
|
-
iconName,
|
|
18019
|
-
iconColor,
|
|
18020
|
-
iconSize,
|
|
18021
|
-
rounded,
|
|
18022
|
-
children,
|
|
18023
|
-
...rest
|
|
18024
|
-
} = { ...defaultProps$b, ...props };
|
|
18025
|
-
const b2 = cn("progress");
|
|
18026
|
-
const classes = classNames(b2(""));
|
|
18027
|
-
const classesOuter = classNames({
|
|
18028
|
-
[`${b2("")}-outer`]: true,
|
|
18029
|
-
[`${b2("")}-${size || "base"}`]: true
|
|
18030
|
-
});
|
|
18031
|
-
const classesInner = classNames({
|
|
18032
|
-
[`${b2("")}-inner`]: true,
|
|
18033
|
-
[`${b2("")}-active`]: status
|
|
18034
|
-
});
|
|
18035
|
-
const classesText = classNames({
|
|
18036
|
-
[`${b2("")}-text`]: true
|
|
18037
|
-
});
|
|
18038
|
-
const classesInsideText = classNames({
|
|
18039
|
-
[`${b2("")}-text`]: true,
|
|
18040
|
-
[`${b2("")}-insidetext`]: true
|
|
18041
|
-
});
|
|
18042
|
-
const classesTextInner = classNames({
|
|
18043
|
-
[`${b2("")}-text__inner`]: true
|
|
18044
|
-
});
|
|
18045
|
-
const stylesOuter = {
|
|
18046
|
-
height: `${strokeWidth}px`,
|
|
18047
|
-
borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
|
|
18048
|
-
background: `${fillColor}`
|
|
18049
|
-
};
|
|
18050
|
-
const stylesInner = {
|
|
18051
|
-
width: `${percentage}%`,
|
|
18052
|
-
borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
|
|
18053
|
-
background: `${strokeColor}`
|
|
18054
|
-
};
|
|
18055
|
-
const stylesInsideText = {
|
|
18056
|
-
width: `${textWidth}px`,
|
|
18057
|
-
left: `${percentage}%`,
|
|
18058
|
-
background: textBackground || strokeColor
|
|
18059
|
-
};
|
|
18060
|
-
const stylesInsideIcon = {
|
|
18061
|
-
width: `${textWidth}px`,
|
|
18062
|
-
left: `${percentage}%`
|
|
18063
|
-
};
|
|
18064
|
-
const stylesText = {
|
|
18065
|
-
width: `${textWidth}px`
|
|
18066
|
-
};
|
|
18067
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18068
|
-
className: `${classes} ${className}`,
|
|
18069
|
-
style,
|
|
18070
|
-
...rest
|
|
18071
|
-
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18072
|
-
className: classesOuter,
|
|
18073
|
-
style: stylesOuter
|
|
18074
|
-
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18075
|
-
className: classesInner,
|
|
18076
|
-
style: stylesInner
|
|
18077
|
-
}, showText && textInside && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18078
|
-
className: classesInsideText,
|
|
18079
|
-
style: stylesInsideIcon
|
|
18080
|
-
}, children) : /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18081
|
-
className: classesInsideText,
|
|
18082
|
-
style: stylesInsideText
|
|
18083
|
-
}, /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
18084
|
-
className: classesTextInner,
|
|
18085
|
-
style: { color: textColor || "#fff" }
|
|
18086
|
-
}, percentage, isShowPercentage ? "%" : ""))))), showText && !textInside && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18087
|
-
className: classesText,
|
|
18088
|
-
style: stylesText
|
|
18089
|
-
}, textType === "text" && /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
18090
|
-
className: classesTextInner,
|
|
18091
|
-
style: { color: textColor || "#333" }
|
|
18092
|
-
}, percentage, isShowPercentage ? "%" : ""), textType === "icon" && /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
18093
|
-
classPrefix: props.iconClassPrefix,
|
|
18094
|
-
fontClassName: props.iconFontClassName,
|
|
18095
|
-
size: iconSize,
|
|
18096
|
-
name: iconName,
|
|
18097
|
-
color: iconColor
|
|
18098
|
-
})));
|
|
18099
|
-
};
|
|
18100
|
-
Progress.defaultProps = defaultProps$b;
|
|
18101
|
-
Progress.displayName = "NutProgress";
|
|
18102
18481
|
const defaultProps$a = {
|
|
18103
18482
|
...ComponentDefaults,
|
|
18104
18483
|
className: "",
|
|
@@ -18140,6 +18519,8 @@
|
|
|
18140
18519
|
onMute,
|
|
18141
18520
|
onCanPlay,
|
|
18142
18521
|
children,
|
|
18522
|
+
iconClassPrefix,
|
|
18523
|
+
iconFontClassName,
|
|
18143
18524
|
...rest
|
|
18144
18525
|
} = {
|
|
18145
18526
|
...defaultProps$a,
|
|
@@ -18197,13 +18578,13 @@
|
|
|
18197
18578
|
className: `${b2("icon-box")} ${playing ? b2("icon-play") : b2("icon-stop")}`,
|
|
18198
18579
|
onClick: handleStatusChange
|
|
18199
18580
|
}, playing ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
18200
|
-
classPrefix:
|
|
18201
|
-
fontClassName:
|
|
18581
|
+
classPrefix: iconClassPrefix,
|
|
18582
|
+
fontClassName: iconFontClassName,
|
|
18202
18583
|
name: "service",
|
|
18203
18584
|
className: "nut-icon-loading"
|
|
18204
18585
|
}) : /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
18205
|
-
classPrefix:
|
|
18206
|
-
fontClassName:
|
|
18586
|
+
classPrefix: iconClassPrefix,
|
|
18587
|
+
fontClassName: iconFontClassName,
|
|
18207
18588
|
name: "service"
|
|
18208
18589
|
}))));
|
|
18209
18590
|
};
|
|
@@ -18940,8 +19321,13 @@
|
|
|
18940
19321
|
onTabChecked,
|
|
18941
19322
|
style,
|
|
18942
19323
|
className,
|
|
19324
|
+
iconClassPrefix,
|
|
19325
|
+
iconFontClassName,
|
|
18943
19326
|
...rest
|
|
18944
|
-
} = {
|
|
19327
|
+
} = {
|
|
19328
|
+
...defaultProps$6,
|
|
19329
|
+
...props
|
|
19330
|
+
};
|
|
18945
19331
|
const b2 = cn("address");
|
|
18946
19332
|
const [privateType, setPrivateType] = React.useState(type);
|
|
18947
19333
|
const [tabName] = React.useState(["province", "city", "country", "town"]);
|
|
@@ -19034,8 +19420,8 @@
|
|
|
19034
19420
|
className: "arrow-back",
|
|
19035
19421
|
onClick: onSwitchModule
|
|
19036
19422
|
}, privateType === "custom" && backBtnIcon && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
19037
|
-
classPrefix:
|
|
19038
|
-
fontClassName:
|
|
19423
|
+
classPrefix: iconClassPrefix,
|
|
19424
|
+
fontClassName: iconFontClassName,
|
|
19039
19425
|
name: backBtnIcon,
|
|
19040
19426
|
color: "#cccccc"
|
|
19041
19427
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -19043,8 +19429,8 @@
|
|
|
19043
19429
|
}, privateType === "custom" ? locale.address.selectRegion || customAddressTitle : locale.address.deliveryTo || existAddressTitle), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
19044
19430
|
onClick: () => handClose()
|
|
19045
19431
|
}, closeBtnIcon && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
19046
|
-
classPrefix:
|
|
19047
|
-
fontClassName:
|
|
19432
|
+
classPrefix: iconClassPrefix,
|
|
19433
|
+
fontClassName: iconFontClassName,
|
|
19048
19434
|
name: closeBtnIcon,
|
|
19049
19435
|
color: "#cccccc",
|
|
19050
19436
|
size: "18px"
|
|
@@ -19159,7 +19545,7 @@
|
|
|
19159
19545
|
el.classList.add("move");
|
|
19160
19546
|
el.style.animationDuration = `${speeds}ms`;
|
|
19161
19547
|
el.style.top = `${_index % rows * (height + top) + 20}px`;
|
|
19162
|
-
el.style.width = `${width
|
|
19548
|
+
el.style.width = `${width}px`;
|
|
19163
19549
|
el.style.setProperty("--move-distance", `-${barrageCWidth.current}px`);
|
|
19164
19550
|
el.dataset.index = `${_index}`;
|
|
19165
19551
|
el.addEventListener("animationend", () => {
|
|
@@ -19629,6 +20015,7 @@
|
|
|
19629
20015
|
exports2.Skeleton = Skeleton;
|
|
19630
20016
|
exports2.Step = Step;
|
|
19631
20017
|
exports2.Steps = Steps;
|
|
20018
|
+
exports2.Sticky = Sticky;
|
|
19632
20019
|
exports2.SubSideNavBar = SubSideNavBar;
|
|
19633
20020
|
exports2.Swipe = Swipe;
|
|
19634
20021
|
exports2.Swiper = Swiper;
|