@nutui/nutui-react 3.0.0 → 3.0.1
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 +24 -0
- package/dist/cjs/packages/actionsheet/style/style.css +12 -0
- package/dist/cjs/packages/address/style/style.css +12 -0
- package/dist/cjs/packages/calendar/style/style.css +12 -0
- package/dist/cjs/packages/cascader/style/style.css +12 -0
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/datepicker.js +8 -6
- package/dist/cjs/packages/datepicker/style/style.css +12 -0
- package/dist/cjs/packages/datepickerview/datepickerview.d.ts +3 -0
- package/dist/cjs/packages/datepickerview/datepickerview.js +118 -0
- package/dist/cjs/packages/datepickerview/index.d.ts +3 -0
- package/dist/cjs/packages/{subsidenavbar → datepickerview}/index.js +2 -2
- package/dist/cjs/packages/datepickerview/style/datepickerview.scss +4 -0
- package/dist/cjs/packages/datepickerview/style/index.js +1 -0
- package/dist/cjs/packages/datepickerview/style/style.css +8 -0
- package/dist/cjs/packages/datepickerview/types.d.ts +15 -0
- package/dist/cjs/packages/datepickerview/types.js +4 -0
- package/dist/cjs/packages/dialog/dialogwrap.js +3 -0
- package/dist/cjs/packages/dialog/style/dialog.scss +0 -1
- package/dist/cjs/packages/dialog/style/style.css +0 -1
- package/dist/cjs/packages/drag/style/drag.scss +1 -0
- package/dist/cjs/packages/drag/style/style.css +1 -0
- package/dist/cjs/packages/imagepreview/style/style.css +12 -0
- package/dist/cjs/packages/input/style/input.scss +6 -4
- package/dist/cjs/packages/input/style/style.css +4 -0
- package/dist/cjs/packages/numberkeyboard/style/style.css +12 -0
- package/dist/cjs/packages/nutui.react.build.d.ts +11 -15
- package/dist/cjs/packages/nutui.react.build.js +8 -16
- package/dist/cjs/packages/nutui.react.d.ts +16 -22
- package/dist/cjs/packages/nutui.react.js +13 -23
- package/dist/cjs/packages/nutui.react.scss.d.ts +5 -7
- package/dist/cjs/packages/nutui.react.scss.js +5 -7
- package/dist/cjs/packages/overlay/style/overlay.scss +0 -4
- package/dist/cjs/packages/picker/style/style.css +12 -0
- package/dist/cjs/packages/popover/style/style.css +12 -0
- package/dist/cjs/packages/popup/style/popup.scss +12 -4
- package/dist/cjs/packages/popup/style/style.css +12 -0
- package/dist/cjs/packages/shortpassword/shortpassword.js +5 -7
- package/dist/cjs/packages/shortpassword/style/shortpassword.scss +10 -0
- package/dist/cjs/packages/shortpassword/style/style.css +21 -0
- package/dist/cjs/packages/tabbar/style/style.css +6 -0
- package/dist/cjs/packages/tabbaritem/style/style.css +6 -0
- package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +6 -0
- package/dist/cjs/packages/timeselect/style/style.css +12 -0
- package/dist/cjs/packages/tour/style/style.css +12 -0
- package/dist/es/packages/actionsheet/style/style.css +12 -0
- package/dist/es/packages/address/style/style.css +12 -0
- package/dist/es/packages/calendar/style/style.css +12 -0
- package/dist/es/packages/cascader/style/style.css +12 -0
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/datepicker.js +8 -6
- package/dist/es/packages/datepicker/style/style.css +12 -0
- package/dist/es/packages/datepickerview/datepickerview.d.ts +3 -0
- package/dist/es/packages/datepickerview/datepickerview.js +106 -0
- package/dist/es/packages/datepickerview/index.d.ts +3 -0
- package/dist/es/packages/datepickerview/index.js +2 -0
- package/dist/es/packages/datepickerview/style/datepickerview.scss +4 -0
- package/dist/es/packages/datepickerview/style/index.js +1 -0
- package/dist/es/packages/datepickerview/style/style.css +8 -0
- package/dist/es/packages/datepickerview/types.d.ts +15 -0
- package/dist/es/packages/datepickerview/types.js +1 -0
- package/dist/es/packages/dialog/dialogwrap.js +3 -0
- package/dist/es/packages/dialog/style/dialog.scss +0 -1
- package/dist/es/packages/dialog/style/style.css +0 -1
- package/dist/es/packages/drag/style/drag.scss +1 -0
- package/dist/es/packages/drag/style/style.css +1 -0
- package/dist/es/packages/imagepreview/style/style.css +12 -0
- package/dist/es/packages/input/style/input.scss +6 -4
- package/dist/es/packages/input/style/style.css +4 -0
- package/dist/es/packages/numberkeyboard/style/style.css +12 -0
- package/dist/es/packages/nutui.react.build.d.ts +11 -15
- package/dist/es/packages/nutui.react.build.js +11 -15
- package/dist/es/packages/overlay/style/overlay.scss +0 -4
- package/dist/es/packages/picker/style/style.css +12 -0
- package/dist/es/packages/popover/style/style.css +12 -0
- package/dist/es/packages/popup/style/popup.scss +12 -4
- package/dist/es/packages/popup/style/style.css +12 -0
- package/dist/es/packages/shortpassword/shortpassword.js +5 -7
- package/dist/es/packages/shortpassword/style/shortpassword.scss +10 -0
- package/dist/es/packages/shortpassword/style/style.css +21 -0
- package/dist/es/packages/tabbar/style/style.css +6 -0
- package/dist/es/packages/tabbaritem/style/style.css +6 -0
- package/dist/es/packages/tabbaritem/style/tabbaritem.scss +6 -0
- package/dist/es/packages/timeselect/style/style.css +12 -0
- package/dist/es/packages/tour/style/style.css +12 -0
- package/dist/nutui.react.umd.js +942 -1008
- package/dist/style.css +1 -1
- package/dist/style.scss +41 -43
- package/dist/styles/variables-jmapp.scss +0 -50
- package/dist/styles/variables-jrkf.scss +0 -50
- package/dist/styles/variables.scss +0 -49
- package/package.json +1 -1
- package/dist/cjs/packages/sidenavbar/context.d.ts +0 -1
- package/dist/cjs/packages/sidenavbar/context.js +0 -12
- package/dist/cjs/packages/sidenavbar/index.d.ts +0 -3
- package/dist/cjs/packages/sidenavbar/index.js +0 -12
- package/dist/cjs/packages/sidenavbar/sidenavbar.d.ts +0 -14
- package/dist/cjs/packages/sidenavbar/sidenavbar.js +0 -70
- package/dist/cjs/packages/sidenavbar/style/index.js +0 -2
- package/dist/cjs/packages/sidenavbar/style/sidenavbar.scss +0 -89
- package/dist/cjs/packages/sidenavbar/style/style.css +0 -443
- package/dist/cjs/packages/sidenavbar/utils.d.ts +0 -3
- package/dist/cjs/packages/sidenavbar/utils.js +0 -23
- package/dist/cjs/packages/sidenavbaritem/index.d.ts +0 -3
- package/dist/cjs/packages/sidenavbaritem/index.js +0 -12
- package/dist/cjs/packages/sidenavbaritem/sidenavbaritem.d.ts +0 -11
- package/dist/cjs/packages/sidenavbaritem/sidenavbaritem.js +0 -34
- package/dist/cjs/packages/sidenavbaritem/style/index.js +0 -1
- package/dist/cjs/packages/sidenavbaritem/style/sidenavbaritem.scss +0 -13
- package/dist/cjs/packages/sidenavbaritem/style/style.css +0 -14
- package/dist/cjs/packages/subsidenavbar/index.d.ts +0 -3
- package/dist/cjs/packages/subsidenavbar/style/css.js +0 -1
- package/dist/cjs/packages/subsidenavbar/style/index.js +0 -1
- package/dist/cjs/packages/subsidenavbar/style/style.css +0 -20
- package/dist/cjs/packages/subsidenavbar/style/subsidenavbar.scss +0 -26
- package/dist/cjs/packages/subsidenavbar/subsidenavbar.d.ts +0 -13
- package/dist/cjs/packages/subsidenavbar/subsidenavbar.js +0 -88
- package/dist/es/packages/sidenavbar/context.d.ts +0 -1
- package/dist/es/packages/sidenavbar/context.js +0 -2
- package/dist/es/packages/sidenavbar/index.d.ts +0 -3
- package/dist/es/packages/sidenavbar/index.js +0 -2
- package/dist/es/packages/sidenavbar/sidenavbar.d.ts +0 -38
- package/dist/es/packages/sidenavbar/sidenavbar.js +0 -58
- package/dist/es/packages/sidenavbar/style/css.js +0 -1
- package/dist/es/packages/sidenavbar/style/index.js +0 -2
- package/dist/es/packages/sidenavbar/style/sidenavbar.scss +0 -89
- package/dist/es/packages/sidenavbar/style/style.css +0 -443
- package/dist/es/packages/sidenavbar/utils.d.ts +0 -3
- package/dist/es/packages/sidenavbar/utils.js +0 -14
- package/dist/es/packages/sidenavbaritem/index.d.ts +0 -3
- package/dist/es/packages/sidenavbaritem/index.js +0 -2
- package/dist/es/packages/sidenavbaritem/sidenavbaritem.d.ts +0 -11
- package/dist/es/packages/sidenavbaritem/sidenavbaritem.js +0 -23
- package/dist/es/packages/sidenavbaritem/style/css.js +0 -1
- package/dist/es/packages/sidenavbaritem/style/index.js +0 -1
- package/dist/es/packages/sidenavbaritem/style/sidenavbaritem.scss +0 -13
- package/dist/es/packages/sidenavbaritem/style/style.css +0 -14
- package/dist/es/packages/subsidenavbar/index.d.ts +0 -3
- package/dist/es/packages/subsidenavbar/index.js +0 -2
- package/dist/es/packages/subsidenavbar/style/css.js +0 -1
- package/dist/es/packages/subsidenavbar/style/index.js +0 -1
- package/dist/es/packages/subsidenavbar/style/style.css +0 -20
- package/dist/es/packages/subsidenavbar/style/subsidenavbar.scss +0 -26
- package/dist/es/packages/subsidenavbar/subsidenavbar.d.ts +0 -13
- package/dist/es/packages/subsidenavbar/subsidenavbar.js +0 -77
- /package/dist/cjs/packages/{sidenavbar → datepickerview}/style/css.js +0 -0
- /package/dist/{cjs/packages/sidenavbaritem → es/packages/datepickerview}/style/css.js +0 -0
package/dist/nutui.react.umd.js
CHANGED
|
@@ -1182,7 +1182,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1182
1182
|
style: {}
|
|
1183
1183
|
};
|
|
1184
1184
|
var prefixCls$2 = "nut-button";
|
|
1185
|
-
var defaultProps$
|
|
1185
|
+
var defaultProps$1A = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
1186
1186
|
color: "",
|
|
1187
1187
|
type: "default",
|
|
1188
1188
|
size: "normal",
|
|
@@ -1198,7 +1198,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1198
1198
|
}
|
|
1199
1199
|
});
|
|
1200
1200
|
var Button = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
1201
|
-
var _ref = _object_spread({}, defaultProps$
|
|
1201
|
+
var _ref = _object_spread({}, defaultProps$1A, props), color = _ref.color, shape = _ref.shape, fill = _ref.fill, loading = _ref.loading, disabled = _ref.disabled, type2 = _ref.type, size = _ref.size, block = _ref.block, icon = _ref.icon, rightIcon = _ref.rightIcon, children = _ref.children, className = _ref.className, style = _ref.style, nativeType = _ref.nativeType, onClick = _ref.onClick, rest = _object_without_properties(_ref, [
|
|
1202
1202
|
"color",
|
|
1203
1203
|
"shape",
|
|
1204
1204
|
"fill",
|
|
@@ -1234,7 +1234,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1234
1234
|
color,
|
|
1235
1235
|
props.fill
|
|
1236
1236
|
]);
|
|
1237
|
-
var
|
|
1237
|
+
var handleClick = React.useCallback(function(e2) {
|
|
1238
1238
|
if (!loading && !disabled && onClick) {
|
|
1239
1239
|
onClick(e2);
|
|
1240
1240
|
}
|
|
@@ -1250,7 +1250,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1250
1250
|
type: nativeType,
|
|
1251
1251
|
className: buttonClassNames,
|
|
1252
1252
|
style: _object_spread({}, getStyle, style),
|
|
1253
|
-
onClick:
|
|
1253
|
+
onClick: handleClick
|
|
1254
1254
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
1255
1255
|
className: "nut-button-wrap"
|
|
1256
1256
|
}, loading && /* @__PURE__ */ React.createElement(s, {
|
|
@@ -1261,14 +1261,14 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1261
1261
|
});
|
|
1262
1262
|
Button.displayName = "NutButton";
|
|
1263
1263
|
var CellGroupContext = React.createContext(null);
|
|
1264
|
-
var defaultProps$
|
|
1264
|
+
var defaultProps$1z = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
1265
1265
|
title: "",
|
|
1266
1266
|
description: "",
|
|
1267
1267
|
divider: true
|
|
1268
1268
|
});
|
|
1269
1269
|
var classPrefix$v = "nut-cell-group";
|
|
1270
1270
|
var CellGroup = function(props) {
|
|
1271
|
-
var _ref = _object_spread({}, defaultProps$
|
|
1271
|
+
var _ref = _object_spread({}, defaultProps$1z, props), children = _ref.children, className = _ref.className, title = _ref.title, description = _ref.description, divider = _ref.divider, rest = _object_without_properties(_ref, [
|
|
1272
1272
|
"children",
|
|
1273
1273
|
"className",
|
|
1274
1274
|
"title",
|
|
@@ -1900,7 +1900,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1900
1900
|
}, children));
|
|
1901
1901
|
};
|
|
1902
1902
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
1903
|
-
var defaultProps$
|
|
1903
|
+
var defaultProps$1y = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
1904
1904
|
title: null,
|
|
1905
1905
|
description: null,
|
|
1906
1906
|
extra: null,
|
|
@@ -1914,7 +1914,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1914
1914
|
var classPrefix$t = "nut-cell";
|
|
1915
1915
|
var Cell = function(props) {
|
|
1916
1916
|
var ctx2 = React.useContext(CellGroupContext);
|
|
1917
|
-
var _ref = _object_spread({}, defaultProps$
|
|
1917
|
+
var _ref = _object_spread({}, defaultProps$1y, props), children = _ref.children, clickable = _ref.clickable, onClick = _ref.onClick, title = _ref.title, description = _ref.description, extra = _ref.extra, radius = _ref.radius, align = _ref.align, isLast = _ref.isLast, className = _ref.className, style = _ref.style, rest = _object_without_properties(_ref, [
|
|
1918
1918
|
"children",
|
|
1919
1919
|
"clickable",
|
|
1920
1920
|
"onClick",
|
|
@@ -1928,7 +1928,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1928
1928
|
"style"
|
|
1929
1929
|
]);
|
|
1930
1930
|
var rtl = useRtl();
|
|
1931
|
-
var
|
|
1931
|
+
var handleClick = function(event) {
|
|
1932
1932
|
onClick(event);
|
|
1933
1933
|
};
|
|
1934
1934
|
var baseStyle = _object_spread_props(_object_spread({}, style), {
|
|
@@ -1943,7 +1943,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1943
1943
|
_define_property({}, "".concat(classPrefix$t, "-group-item"), ctx2 === null || ctx2 === void 0 ? void 0 : ctx2.group)
|
|
1944
1944
|
], clickable ? "".concat(classPrefix$t, "-clickable") : "")),
|
|
1945
1945
|
onClick: function(event) {
|
|
1946
|
-
return
|
|
1946
|
+
return handleClick(event);
|
|
1947
1947
|
},
|
|
1948
1948
|
style: baseStyle
|
|
1949
1949
|
}, rest), children || /* @__PURE__ */ React.createElement(React.Fragment, null, title || description ? /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2010,7 +2010,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2010
2010
|
function _sliced_to_array(arr, i2) {
|
|
2011
2011
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i2) || _unsupported_iterable_to_array(arr, i2) || _non_iterable_rest();
|
|
2012
2012
|
}
|
|
2013
|
-
var defaultProps$
|
|
2013
|
+
var defaultProps$1x = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
2014
2014
|
fit: "fill",
|
|
2015
2015
|
position: "center",
|
|
2016
2016
|
alt: "",
|
|
@@ -2022,7 +2022,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2022
2022
|
});
|
|
2023
2023
|
var classPrefix$s = "nut-image";
|
|
2024
2024
|
var Image$1 = function(props) {
|
|
2025
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
2025
|
+
var _$_object_spread = _object_spread({}, defaultProps$1x, props), className = _$_object_spread.className, style = _$_object_spread.style, src = _$_object_spread.src, fit = _$_object_spread.fit, position2 = _$_object_spread.position, alt = _$_object_spread.alt, width2 = _$_object_spread.width, height2 = _$_object_spread.height, radius = _$_object_spread.radius, error = _$_object_spread.error, loading = _$_object_spread.loading, lazy = _$_object_spread.lazy, draggable = _$_object_spread.draggable, onClick = _$_object_spread.onClick, onLoad = _$_object_spread.onLoad, onError = _$_object_spread.onError;
|
|
2026
2026
|
var _useState = _sliced_to_array(React.useState(false), 2), innerLoading = _useState[0], setInnerLoading = _useState[1];
|
|
2027
2027
|
var _useState1 = _sliced_to_array(React.useState(false), 2), isError = _useState1[0], setIsError = _useState1[1];
|
|
2028
2028
|
var _useState2 = _sliced_to_array(React.useState(false), 2), complete = _useState2[0], setComplete = _useState2[1];
|
|
@@ -4125,7 +4125,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4125
4125
|
var styles = _object_spread_props(_object_spread({}, style), {
|
|
4126
4126
|
zIndex
|
|
4127
4127
|
});
|
|
4128
|
-
var
|
|
4128
|
+
var handleClick = function(e2) {
|
|
4129
4129
|
if (closeOnOverlayClick) {
|
|
4130
4130
|
onClick && onClick(e2);
|
|
4131
4131
|
}
|
|
@@ -4143,17 +4143,17 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4143
4143
|
className: classes,
|
|
4144
4144
|
style: styles
|
|
4145
4145
|
}, rest), {
|
|
4146
|
-
onClick:
|
|
4146
|
+
onClick: handleClick
|
|
4147
4147
|
}), children));
|
|
4148
4148
|
};
|
|
4149
4149
|
Overlay.displayName = "NutOverlay";
|
|
4150
|
-
var defaultProps$
|
|
4150
|
+
var defaultProps$1w = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
4151
4151
|
contentPosition: "center",
|
|
4152
4152
|
direction: "horizontal"
|
|
4153
4153
|
});
|
|
4154
4154
|
var classPrefix$r = "nut-divider";
|
|
4155
4155
|
var Divider = function(props) {
|
|
4156
|
-
var _ref = _object_spread({}, defaultProps$
|
|
4156
|
+
var _ref = _object_spread({}, defaultProps$1w, props), children = _ref.children, contentPosition = _ref.contentPosition, style = _ref.style, className = _ref.className, direction = _ref.direction, rest = _object_without_properties(_ref, [
|
|
4157
4157
|
"children",
|
|
4158
4158
|
"contentPosition",
|
|
4159
4159
|
"style",
|
|
@@ -4191,7 +4191,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4191
4191
|
var pxCheck = function(value2) {
|
|
4192
4192
|
return parseFloat(value2.toString());
|
|
4193
4193
|
};
|
|
4194
|
-
var defaultProps$
|
|
4194
|
+
var defaultProps$1v = {
|
|
4195
4195
|
text: "",
|
|
4196
4196
|
columns: 4,
|
|
4197
4197
|
gap: 9,
|
|
@@ -4201,7 +4201,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4201
4201
|
direction: "vertical"
|
|
4202
4202
|
};
|
|
4203
4203
|
var GridItem = function(props) {
|
|
4204
|
-
var _ref = _object_spread({}, defaultProps$
|
|
4204
|
+
var _ref = _object_spread({}, defaultProps$1v, props), children = _ref.children, style = _ref.style, columns = _ref.columns, index2 = _ref.index, gap = _ref.gap, square = _ref.square, text2 = _ref.text, center = _ref.center, reverse = _ref.reverse, direction = _ref.direction, className = _ref.className, onClick = _ref.onClick, rest = _object_without_properties(_ref, [
|
|
4205
4205
|
"children",
|
|
4206
4206
|
"style",
|
|
4207
4207
|
"columns",
|
|
@@ -4246,7 +4246,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4246
4246
|
var _obj;
|
|
4247
4247
|
return classNames("".concat(classPrefix2, "-text"), (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-text-reverse"), reverse && direction !== "horizontal"), _define_property(_obj, "".concat(classPrefix2, "-text-horizontal"), direction === "horizontal"), _define_property(_obj, "".concat(classPrefix2, "-text-horizontal-reverse"), reverse && direction === "horizontal"), _obj));
|
|
4248
4248
|
};
|
|
4249
|
-
var
|
|
4249
|
+
var handleClick = function(e2) {
|
|
4250
4250
|
onClick && onClick(e2);
|
|
4251
4251
|
context2.onClick && context2.onClick({
|
|
4252
4252
|
text: text2,
|
|
@@ -4263,7 +4263,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4263
4263
|
className: classes,
|
|
4264
4264
|
style: rootStyle()
|
|
4265
4265
|
}, rest), {
|
|
4266
|
-
onClick:
|
|
4266
|
+
onClick: handleClick
|
|
4267
4267
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
4268
4268
|
className: contentClass()
|
|
4269
4269
|
}, children && /* @__PURE__ */ React.createElement(React.Fragment, null, children), text2 && /* @__PURE__ */ React.createElement("div", {
|
|
@@ -4271,7 +4271,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4271
4271
|
}, text2)));
|
|
4272
4272
|
};
|
|
4273
4273
|
GridItem.displayName = "NutGridItem";
|
|
4274
|
-
var defaultProps$
|
|
4274
|
+
var defaultProps$1u = {
|
|
4275
4275
|
columns: 4,
|
|
4276
4276
|
gap: 9,
|
|
4277
4277
|
center: true,
|
|
@@ -4280,7 +4280,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4280
4280
|
direction: "vertical"
|
|
4281
4281
|
};
|
|
4282
4282
|
var Grid = function(props) {
|
|
4283
|
-
var _ref = _object_spread({}, defaultProps$
|
|
4283
|
+
var _ref = _object_spread({}, defaultProps$1u, props), children = _ref.children, columns = _ref.columns, gap = _ref.gap, center = _ref.center, square = _ref.square, reverse = _ref.reverse, direction = _ref.direction, style = _ref.style, className = _ref.className, onClick = _ref.onClick, rest = _object_without_properties(_ref, [
|
|
4284
4284
|
"children",
|
|
4285
4285
|
"columns",
|
|
4286
4286
|
"gap",
|
|
@@ -4332,7 +4332,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4332
4332
|
};
|
|
4333
4333
|
Layout.displayName = "NutLayout";
|
|
4334
4334
|
var DataContext$1 = React.createContext({});
|
|
4335
|
-
var defaultProps$
|
|
4335
|
+
var defaultProps$1t = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
4336
4336
|
span: "24",
|
|
4337
4337
|
offset: "0",
|
|
4338
4338
|
gutter: "0",
|
|
@@ -4340,7 +4340,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4340
4340
|
isLast: false
|
|
4341
4341
|
});
|
|
4342
4342
|
var Col = function(props) {
|
|
4343
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
4343
|
+
var _$_object_spread = _object_spread({}, defaultProps$1t, props), className = _$_object_spread.className, style = _$_object_spread.style, span = _$_object_spread.span, offset = _$_object_spread.offset, children = _$_object_spread.children, isFirst = _$_object_spread.isFirst, isLast = _$_object_spread.isLast, onClick = _$_object_spread.onClick;
|
|
4344
4344
|
var _useState = _sliced_to_array(React.useState(""), 2), colName = _useState[0], setColName = _useState[1];
|
|
4345
4345
|
var _useState1 = _sliced_to_array(React.useState({}), 2), colStyle = _useState1[0], setColStyle = _useState1[1];
|
|
4346
4346
|
var gutter = React.useContext(DataContext$1).gutter;
|
|
@@ -4376,7 +4376,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4376
4376
|
};
|
|
4377
4377
|
Col.displayName = "NutCol";
|
|
4378
4378
|
var classPrefix$q = "nut-row";
|
|
4379
|
-
var defaultProps$
|
|
4379
|
+
var defaultProps$1s = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
4380
4380
|
type: "",
|
|
4381
4381
|
justify: "start",
|
|
4382
4382
|
align: "flex-start",
|
|
@@ -4384,7 +4384,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4384
4384
|
gutter: "0"
|
|
4385
4385
|
});
|
|
4386
4386
|
var Row = function(props) {
|
|
4387
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
4387
|
+
var _$_object_spread = _object_spread({}, defaultProps$1s, props), className = _$_object_spread.className, style = _$_object_spread.style, children = _$_object_spread.children, type2 = _$_object_spread.type, justify = _$_object_spread.justify, align = _$_object_spread.align, wrap = _$_object_spread.wrap, gutter = _$_object_spread.gutter, onClick = _$_object_spread.onClick;
|
|
4388
4388
|
var getClass = function(prefix2, type3) {
|
|
4389
4389
|
var classType = type3 ? "nut-row-".concat(prefix2, "-").concat(type3) : "";
|
|
4390
4390
|
if (prefix2) return classType;
|
|
@@ -4414,12 +4414,19 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4414
4414
|
})));
|
|
4415
4415
|
};
|
|
4416
4416
|
Row.displayName = "NutRow";
|
|
4417
|
+
var classPrefix$p = "nut-safe-area";
|
|
4418
|
+
var SafeArea = function(props) {
|
|
4419
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
4420
|
+
className: classNames(classPrefix$p, "".concat(classPrefix$p, "-position-").concat(props.position))
|
|
4421
|
+
});
|
|
4422
|
+
};
|
|
4423
|
+
SafeArea.displayName = "NutSafeArea";
|
|
4417
4424
|
var prefixCls$1 = "nut-space";
|
|
4418
|
-
var defaultProps$
|
|
4425
|
+
var defaultProps$1r = {
|
|
4419
4426
|
direction: "horizontal"
|
|
4420
4427
|
};
|
|
4421
4428
|
var Space = function(props) {
|
|
4422
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
4429
|
+
var _$_object_spread = _object_spread({}, defaultProps$1r, props), className = _$_object_spread.className, style = _$_object_spread.style, children = _$_object_spread.children, wrap = _$_object_spread.wrap, align = _$_object_spread.align, direction = _$_object_spread.direction, justify = _$_object_spread.justify;
|
|
4423
4430
|
var _obj;
|
|
4424
4431
|
var cls = classNames(prefixCls$1, (_obj = {}, _define_property(_obj, "".concat(prefixCls$1, "-").concat(direction), direction), _define_property(_obj, "".concat(prefixCls$1, "-").concat(direction, "-wrap"), wrap), _define_property(_obj, "".concat(prefixCls$1, "-align-").concat(align), align), _define_property(_obj, "".concat(prefixCls$1, "-justify-").concat(justify), justify), _define_property(_obj, "".concat(className), className), _obj));
|
|
4425
4432
|
var _obj1;
|
|
@@ -4495,14 +4502,14 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4495
4502
|
stop2.current = true;
|
|
4496
4503
|
};
|
|
4497
4504
|
}
|
|
4498
|
-
var defaultProps$
|
|
4505
|
+
var defaultProps$1q = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
4499
4506
|
position: "top",
|
|
4500
4507
|
threshold: 0,
|
|
4501
4508
|
zIndex: 900
|
|
4502
4509
|
});
|
|
4503
|
-
var classPrefix$
|
|
4510
|
+
var classPrefix$o = "nut-sticky";
|
|
4504
4511
|
var Sticky = function(props) {
|
|
4505
|
-
var _ref = _object_spread({}, defaultProps$
|
|
4512
|
+
var _ref = _object_spread({}, defaultProps$1q, props), position2 = _ref.position, zIndex = _ref.zIndex, children = _ref.children, container = _ref.container, style = _ref.style, className = _ref.className, threshold = _ref.threshold, onChange = _ref.onChange, rest = _object_without_properties(_ref, [
|
|
4506
4513
|
"position",
|
|
4507
4514
|
"zIndex",
|
|
4508
4515
|
"children",
|
|
@@ -4629,7 +4636,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4629
4636
|
return /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
4630
4637
|
ref: rootRef,
|
|
4631
4638
|
style: _object_spread({}, style, rootStyle),
|
|
4632
|
-
className: classNames(classPrefix$
|
|
4639
|
+
className: classNames(classPrefix$o, className)
|
|
4633
4640
|
}, rest), /* @__PURE__ */ React.createElement("div", {
|
|
4634
4641
|
className: "nut-sticky-box",
|
|
4635
4642
|
ref: stickyRef,
|
|
@@ -4637,13 +4644,6 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4637
4644
|
}, children));
|
|
4638
4645
|
};
|
|
4639
4646
|
Sticky.displayName = "NutSticky";
|
|
4640
|
-
var classPrefix$o = "nut-safe-area";
|
|
4641
|
-
var SafeArea = function(props) {
|
|
4642
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
4643
|
-
className: classNames(classPrefix$o, "".concat(classPrefix$o, "-position-").concat(props.position))
|
|
4644
|
-
});
|
|
4645
|
-
};
|
|
4646
|
-
SafeArea.displayName = "NutSafeArea";
|
|
4647
4647
|
function _instanceof(left, right) {
|
|
4648
4648
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
4649
4649
|
return !!right[Symbol.hasInstance](left);
|
|
@@ -4655,15 +4655,15 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4655
4655
|
className: "nut-icon"
|
|
4656
4656
|
}) : icon;
|
|
4657
4657
|
};
|
|
4658
|
-
var defaultProps$
|
|
4658
|
+
var defaultProps$1p = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
4659
4659
|
icon: null,
|
|
4660
4660
|
onClick: function(event) {
|
|
4661
4661
|
}
|
|
4662
4662
|
});
|
|
4663
4663
|
var classPrefix$n = "nut-hoverbutton-item";
|
|
4664
4664
|
var HoverButtonItem = function(props) {
|
|
4665
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
4666
|
-
var
|
|
4665
|
+
var _$_object_spread = _object_spread({}, defaultProps$1p, props), className = _$_object_spread.className, children = _$_object_spread.children, style = _$_object_spread.style, icon = _$_object_spread.icon, onClick = _$_object_spread.onClick;
|
|
4666
|
+
var handleClick = function(event) {
|
|
4667
4667
|
if (onClick) {
|
|
4668
4668
|
onClick(event);
|
|
4669
4669
|
}
|
|
@@ -4686,15 +4686,15 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4686
4686
|
className
|
|
4687
4687
|
], _define_property({}, "".concat(classPrefix$n, "-container-icontext"), icon && children)),
|
|
4688
4688
|
style,
|
|
4689
|
-
onClick:
|
|
4689
|
+
onClick: handleClick
|
|
4690
4690
|
}, renderBody());
|
|
4691
4691
|
};
|
|
4692
4692
|
HoverButtonItem.displayName = "NutHoverButtonItem";
|
|
4693
4693
|
var UI_BOTTOM_DISTANCE = 60;
|
|
4694
|
-
var defaultProps$
|
|
4694
|
+
var defaultProps$1o = _object_spread({}, ComponentDefaults);
|
|
4695
4695
|
var classPrefix$m = "nut-hoverbutton";
|
|
4696
4696
|
var HoverButton = function(props) {
|
|
4697
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
4697
|
+
var _$_object_spread = _object_spread({}, defaultProps$1o, props), children = _$_object_spread.children, zIndex = _$_object_spread.zIndex, tabbarHeight = _$_object_spread.tabbarHeight, className = _$_object_spread.className, style = _$_object_spread.style, icon = _$_object_spread.icon, onClick = _$_object_spread.onClick;
|
|
4698
4698
|
var rtl = useRtl();
|
|
4699
4699
|
var baseStyle = _object_spread({}, style);
|
|
4700
4700
|
if (tabbarHeight) {
|
|
@@ -4721,14 +4721,14 @@ Check the top-level render call using <` + t + ">.");
|
|
|
4721
4721
|
};
|
|
4722
4722
|
HoverButton.displayName = "NutHoverButton";
|
|
4723
4723
|
HoverButton.Item = HoverButtonItem;
|
|
4724
|
-
var defaultProps$
|
|
4724
|
+
var defaultProps$1n = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
4725
4725
|
target: "",
|
|
4726
4726
|
threshold: 200,
|
|
4727
4727
|
zIndex: 900,
|
|
4728
4728
|
duration: 1e3
|
|
4729
4729
|
});
|
|
4730
4730
|
var BackTop = function(props) {
|
|
4731
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
4731
|
+
var _$_object_spread = _object_spread({}, defaultProps$1n, props), children = _$_object_spread.children, target = _$_object_spread.target, threshold = _$_object_spread.threshold, zIndex = _$_object_spread.zIndex, className = _$_object_spread.className, duration = _$_object_spread.duration, icon = _$_object_spread.icon, style = _$_object_spread.style, onClick = _$_object_spread.onClick;
|
|
4732
4732
|
var classPrefix2 = "nut-backtop";
|
|
4733
4733
|
var _useState = _sliced_to_array(React.useState(false), 2), backTop = _useState[0], setBackTop = _useState[1];
|
|
4734
4734
|
var _useState1 = _sliced_to_array(React.useState(0), 2), scrollTop = _useState1[0], setScrollTop = _useState1[1];
|
|
@@ -9749,7 +9749,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
9749
9749
|
});
|
|
9750
9750
|
const animated = host.animated;
|
|
9751
9751
|
var elevatorContext = /* @__PURE__ */ React.createContext({});
|
|
9752
|
-
var defaultProps$
|
|
9752
|
+
var defaultProps$1m = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
9753
9753
|
height: "200px",
|
|
9754
9754
|
floorKey: "title",
|
|
9755
9755
|
list: [],
|
|
@@ -9759,7 +9759,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
9759
9759
|
showKeys: true
|
|
9760
9760
|
});
|
|
9761
9761
|
var Elevator = function(props) {
|
|
9762
|
-
var _ref = _object_spread({}, defaultProps$
|
|
9762
|
+
var _ref = _object_spread({}, defaultProps$1m, props), height2 = _ref.height, floorKey = _ref.floorKey, list = _ref.list, sticky = _ref.sticky, spaceHeight = _ref.spaceHeight;
|
|
9763
9763
|
_ref.titleHeight;
|
|
9764
9764
|
var showKeys = _ref.showKeys, className = _ref.className, style = _ref.style, onItemClick = _ref.onItemClick, onIndexClick = _ref.onIndexClick, children = _ref.children, rest = _object_without_properties(_ref, [
|
|
9765
9765
|
"height",
|
|
@@ -9955,7 +9955,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
9955
9955
|
};
|
|
9956
9956
|
Elevator.displayName = "NutElevator";
|
|
9957
9957
|
Elevator.Context = elevatorContext;
|
|
9958
|
-
var defaultProps$
|
|
9958
|
+
var defaultProps$1l = _object_spread_props(_object_spread({}, defaultOverlayProps), {
|
|
9959
9959
|
activeText: "",
|
|
9960
9960
|
inactiveText: "",
|
|
9961
9961
|
type: "right",
|
|
@@ -9973,7 +9973,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
9973
9973
|
});
|
|
9974
9974
|
var FixedNav = function(props) {
|
|
9975
9975
|
var locale = useConfig().locale;
|
|
9976
|
-
var _ref = _object_spread({}, defaultProps$
|
|
9976
|
+
var _ref = _object_spread({}, defaultProps$1l, props), overlay = _ref.overlay, visible = _ref.visible, list = _ref.list, activeText = _ref.activeText, inactiveText = _ref.inactiveText, position2 = _ref.position, type2 = _ref.type, children = _ref.children, style = _ref.style, className = _ref.className, content2 = _ref.content, zIndex = _ref.zIndex, onChange = _ref.onChange, onSelect = _ref.onSelect, rest = _object_without_properties(_ref, [
|
|
9977
9977
|
"overlay",
|
|
9978
9978
|
"visible",
|
|
9979
9979
|
"list",
|
|
@@ -10033,7 +10033,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10033
10033
|
}, visible ? activeText || locale.fixednav.activeText : inactiveText || locale.fixednav.inactiveText))));
|
|
10034
10034
|
};
|
|
10035
10035
|
FixedNav.displayName = "NutFixedNav";
|
|
10036
|
-
var defaultProps$
|
|
10036
|
+
var defaultProps$1k = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
10037
10037
|
left: "",
|
|
10038
10038
|
right: "",
|
|
10039
10039
|
back: "",
|
|
@@ -10043,7 +10043,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10043
10043
|
zIndex: 10
|
|
10044
10044
|
});
|
|
10045
10045
|
var NavBar = function(props) {
|
|
10046
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
10046
|
+
var _$_object_spread = _object_spread({}, defaultProps$1k, props), right = _$_object_spread.right, left = _$_object_spread.left, title = _$_object_spread.title, className = _$_object_spread.className, style = _$_object_spread.style, back = _$_object_spread.back, fixed = _$_object_spread.fixed, safeAreaInsetTop = _$_object_spread.safeAreaInsetTop, placeholder = _$_object_spread.placeholder, zIndex = _$_object_spread.zIndex, onBackClick = _$_object_spread.onBackClick;
|
|
10047
10047
|
var classPrefix2 = "nut-navbar";
|
|
10048
10048
|
var rtl = useRtl();
|
|
10049
10049
|
var children = Array.isArray(props.children) ? props.children : [
|
|
@@ -10093,217 +10093,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10093
10093
|
}, renderWrapper()) : renderWrapper());
|
|
10094
10094
|
};
|
|
10095
10095
|
NavBar.displayName = "NutNavBar";
|
|
10096
|
-
var defaultProps$1k = _object_spread_props(_object_spread({}, defaultOverlayProps), {
|
|
10097
|
-
position: "center",
|
|
10098
|
-
transition: "",
|
|
10099
|
-
overlayStyle: {},
|
|
10100
|
-
overlayClassName: "",
|
|
10101
|
-
closeable: false,
|
|
10102
|
-
closeIconPosition: "top-right",
|
|
10103
|
-
closeIcon: "close",
|
|
10104
|
-
destroyOnClose: false,
|
|
10105
|
-
portal: null,
|
|
10106
|
-
overlay: true,
|
|
10107
|
-
round: false,
|
|
10108
|
-
onOpen: function() {
|
|
10109
|
-
},
|
|
10110
|
-
onClose: function() {
|
|
10111
|
-
},
|
|
10112
|
-
onOverlayClick: function() {
|
|
10113
|
-
return true;
|
|
10114
|
-
},
|
|
10115
|
-
onCloseIconClick: function() {
|
|
10116
|
-
return true;
|
|
10117
|
-
}
|
|
10118
|
-
});
|
|
10119
|
-
var _zIndex = 1100;
|
|
10120
|
-
var Popup = function(props) {
|
|
10121
|
-
var _$_object_spread = _object_spread({}, defaultProps$1k, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left = _$_object_spread.left, title = _$_object_spread.title, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position2 = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick;
|
|
10122
|
-
var nodeRef = React.useRef(null);
|
|
10123
|
-
var innerIndex = zIndex || _zIndex;
|
|
10124
|
-
var _useState = _sliced_to_array(React.useState(innerIndex), 2), index2 = _useState[0], setIndex = _useState[1];
|
|
10125
|
-
var _useState1 = _sliced_to_array(React.useState(visible), 2), innerVisible = _useState1[0], setInnerVisible = _useState1[1];
|
|
10126
|
-
var _useState2 = _sliced_to_array(React.useState(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
|
|
10127
|
-
var _useState3 = _sliced_to_array(React.useState(""), 2), transitionName = _useState3[0], setTransitionName = _useState3[1];
|
|
10128
|
-
useLockScroll(nodeRef, innerVisible && lockScroll);
|
|
10129
|
-
var classPrefix2 = "nut-popup";
|
|
10130
|
-
var overlayStyles = _object_spread({}, overlayStyle);
|
|
10131
|
-
var popStyles = _object_spread_props(_object_spread({}, style), {
|
|
10132
|
-
zIndex: index2
|
|
10133
|
-
});
|
|
10134
|
-
var _obj;
|
|
10135
|
-
var popClassName = classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-round"), round || position2 === "bottom"), _define_property(_obj, "".concat(classPrefix2, "-").concat(position2), true), _obj), className);
|
|
10136
|
-
var open = function() {
|
|
10137
|
-
if (!innerVisible) {
|
|
10138
|
-
setInnerVisible(true);
|
|
10139
|
-
setIndex(++innerIndex);
|
|
10140
|
-
}
|
|
10141
|
-
if (destroyOnClose) {
|
|
10142
|
-
setShowChildren(true);
|
|
10143
|
-
}
|
|
10144
|
-
onOpen && onOpen();
|
|
10145
|
-
};
|
|
10146
|
-
var close = function() {
|
|
10147
|
-
if (innerVisible) {
|
|
10148
|
-
setInnerVisible(false);
|
|
10149
|
-
if (destroyOnClose) {
|
|
10150
|
-
setTimeout(function() {
|
|
10151
|
-
setShowChildren(false);
|
|
10152
|
-
}, Number(duration));
|
|
10153
|
-
}
|
|
10154
|
-
onClose && onClose();
|
|
10155
|
-
}
|
|
10156
|
-
};
|
|
10157
|
-
var handleOverlayClick = function(e2) {
|
|
10158
|
-
e2.stopPropagation();
|
|
10159
|
-
if (closeOnOverlayClick && onOverlayClick(e2)) {
|
|
10160
|
-
close();
|
|
10161
|
-
}
|
|
10162
|
-
};
|
|
10163
|
-
var handleCloseIconClick = function(e2) {
|
|
10164
|
-
onCloseIconClick(e2) && close();
|
|
10165
|
-
};
|
|
10166
|
-
var renderCloseIcon = function() {
|
|
10167
|
-
var closeClasses = classNames("".concat(classPrefix2, "-title-right"), "".concat(classPrefix2, "-title-right-").concat(closeIconPosition));
|
|
10168
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, closeable && /* @__PURE__ */ React.createElement("div", {
|
|
10169
|
-
className: closeClasses,
|
|
10170
|
-
onClick: handleCloseIconClick
|
|
10171
|
-
}, /* @__PURE__ */ React.isValidElement(closeIcon) ? closeIcon : /* @__PURE__ */ React.createElement(n$6, null)));
|
|
10172
|
-
};
|
|
10173
|
-
var renderTitle = function() {
|
|
10174
|
-
if (left || title || description) {
|
|
10175
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
10176
|
-
className: "".concat(classPrefix2, "-title")
|
|
10177
|
-
}, position2 === "bottom" && /* @__PURE__ */ React.createElement(React.Fragment, null, left && /* @__PURE__ */ React.createElement("div", {
|
|
10178
|
-
className: "".concat(classPrefix2, "-title-left")
|
|
10179
|
-
}, left), (title || description) && /* @__PURE__ */ React.createElement("div", {
|
|
10180
|
-
className: "".concat(classPrefix2, "-title-wrapper")
|
|
10181
|
-
}, title && /* @__PURE__ */ React.createElement("div", {
|
|
10182
|
-
className: "".concat(classPrefix2, "-title-title")
|
|
10183
|
-
}, title), description && /* @__PURE__ */ React.createElement("div", {
|
|
10184
|
-
className: "".concat(classPrefix2, "-title-description ").concat(title ? "".concat(classPrefix2, "-title-description-gap") : "")
|
|
10185
|
-
}, description))), renderCloseIcon());
|
|
10186
|
-
}
|
|
10187
|
-
if (closeable) {
|
|
10188
|
-
return renderCloseIcon();
|
|
10189
|
-
}
|
|
10190
|
-
};
|
|
10191
|
-
var renderPop = function() {
|
|
10192
|
-
return /* @__PURE__ */ React.createElement(CSSTransition, {
|
|
10193
|
-
nodeRef,
|
|
10194
|
-
classNames: transitionName,
|
|
10195
|
-
mountOnEnter: true,
|
|
10196
|
-
unmountOnExit: destroyOnClose,
|
|
10197
|
-
timeout: duration,
|
|
10198
|
-
in: innerVisible,
|
|
10199
|
-
onEntered: afterShow,
|
|
10200
|
-
onExited: afterClose
|
|
10201
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
10202
|
-
ref: nodeRef,
|
|
10203
|
-
style: popStyles,
|
|
10204
|
-
className: popClassName,
|
|
10205
|
-
onClick
|
|
10206
|
-
}, renderTitle(), showChildren && children));
|
|
10207
|
-
};
|
|
10208
|
-
var renderNode = function() {
|
|
10209
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, overlay && /* @__PURE__ */ React.createElement(Overlay, {
|
|
10210
|
-
zIndex: index2,
|
|
10211
|
-
style: overlayStyles,
|
|
10212
|
-
className: overlayClassName,
|
|
10213
|
-
visible: innerVisible,
|
|
10214
|
-
closeOnOverlayClick,
|
|
10215
|
-
lockScroll,
|
|
10216
|
-
duration,
|
|
10217
|
-
onClick: handleOverlayClick
|
|
10218
|
-
}), renderPop());
|
|
10219
|
-
};
|
|
10220
|
-
React.useEffect(function() {
|
|
10221
|
-
visible ? open() : close();
|
|
10222
|
-
}, [
|
|
10223
|
-
visible
|
|
10224
|
-
]);
|
|
10225
|
-
React.useEffect(function() {
|
|
10226
|
-
setTransitionName(transition || "".concat(classPrefix2, "-slide-").concat(position2));
|
|
10227
|
-
}, [
|
|
10228
|
-
position2,
|
|
10229
|
-
transition
|
|
10230
|
-
]);
|
|
10231
|
-
var resolveContainer = function(getContainer) {
|
|
10232
|
-
return (typeof getContainer === "function" ? getContainer() : getContainer) || document.body;
|
|
10233
|
-
};
|
|
10234
|
-
var renderToContainer = function(getContainer, node) {
|
|
10235
|
-
if (getContainer) {
|
|
10236
|
-
var container = resolveContainer(getContainer);
|
|
10237
|
-
return /* @__PURE__ */ ReactDOM.createPortal(node, container);
|
|
10238
|
-
}
|
|
10239
|
-
return node;
|
|
10240
|
-
};
|
|
10241
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, renderToContainer(portal, renderNode()));
|
|
10242
|
-
};
|
|
10243
|
-
Popup.displayName = "NutPopup";
|
|
10244
|
-
var handleClick = function(e2) {
|
|
10245
|
-
e2.stopPropagation();
|
|
10246
|
-
var isIcon = e2.target.className.includes("arrow-icon");
|
|
10247
|
-
var isTitle = e2.target.className.includes("-title") || isIcon;
|
|
10248
|
-
var currentClass = e2.currentTarget.className;
|
|
10249
|
-
var isShow = currentClass.includes("sidenavbar-show");
|
|
10250
|
-
var arrowIcon = e2.currentTarget.querySelector(".arrow-icon");
|
|
10251
|
-
var iconClass = arrowIcon.className;
|
|
10252
|
-
if (isTitle) {
|
|
10253
|
-
e2.currentTarget.className = isShow ? currentClass.replace("sidenavbar-show", "sidenavbar-hide") : currentClass.replace("sidenavbar-hide", "sidenavbar-show");
|
|
10254
|
-
arrowIcon.className = isShow ? iconClass.replace("arrow-down", "arrow-up") : iconClass.replace("arrow-up", "arrow-down");
|
|
10255
|
-
}
|
|
10256
|
-
};
|
|
10257
|
-
var OffsetContext = React.createContext(20);
|
|
10258
|
-
var defaultProps$1j = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
10259
|
-
position: "left",
|
|
10260
|
-
width: "80%"
|
|
10261
|
-
});
|
|
10262
|
-
var SideNavBar = function(props) {
|
|
10263
|
-
React.useEffect(function() {
|
|
10264
|
-
console.warn("Warning: SideNavBar is deprecated and will be removed in future versions. Please use NewComponent SideBar instead.");
|
|
10265
|
-
}, []);
|
|
10266
|
-
var classPrefix2 = "nut-sidenavbar";
|
|
10267
|
-
var _ref = _object_spread({}, defaultProps$1j, props), title = _ref.title, visible = _ref.visible, width2 = _ref.width, position2 = _ref.position, children = _ref.children, className = _ref.className, onClose = _ref.onClose, indent = _ref.indent, rest = _object_without_properties(_ref, [
|
|
10268
|
-
"title",
|
|
10269
|
-
"visible",
|
|
10270
|
-
"width",
|
|
10271
|
-
"position",
|
|
10272
|
-
"children",
|
|
10273
|
-
"className",
|
|
10274
|
-
"onClose",
|
|
10275
|
-
"indent"
|
|
10276
|
-
]);
|
|
10277
|
-
var innerIndent = indent ? Number(indent) : 20;
|
|
10278
|
-
return /* @__PURE__ */ React.createElement(Popup, {
|
|
10279
|
-
visible,
|
|
10280
|
-
style: {
|
|
10281
|
-
width: width2,
|
|
10282
|
-
height: "100%"
|
|
10283
|
-
},
|
|
10284
|
-
position: position2,
|
|
10285
|
-
onClose
|
|
10286
|
-
}, /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
10287
|
-
className: classNames(classPrefix2, className)
|
|
10288
|
-
}, rest), /* @__PURE__ */ React.createElement("div", {
|
|
10289
|
-
className: "".concat(classPrefix2, "-content")
|
|
10290
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
10291
|
-
className: "".concat(classPrefix2, "-list sidenavbar-show"),
|
|
10292
|
-
onClick: handleClick
|
|
10293
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
10294
|
-
className: "".concat(classPrefix2, "-title ").concat(classPrefix2, "-border-bt"),
|
|
10295
|
-
style: {
|
|
10296
|
-
paddingLeft: "".concat(innerIndent, "px")
|
|
10297
|
-
}
|
|
10298
|
-
}, title, " ", /* @__PURE__ */ React.createElement("i", {
|
|
10299
|
-
className: "arrow-icon arrow-down"
|
|
10300
|
-
})), /* @__PURE__ */ React.createElement(OffsetContext.Provider, {
|
|
10301
|
-
value: innerIndent
|
|
10302
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
10303
|
-
className: "".concat(classPrefix2, "-content")
|
|
10304
|
-
}, children))))));
|
|
10305
|
-
};
|
|
10306
|
-
SideNavBar.displayName = "NutSideNavBar";
|
|
10307
10096
|
function mergeProps() {
|
|
10308
10097
|
for (var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10309
10098
|
items[_key] = arguments[_key];
|
|
@@ -10320,13 +10109,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10320
10109
|
});
|
|
10321
10110
|
return ret;
|
|
10322
10111
|
}
|
|
10323
|
-
var defaultProps$
|
|
10112
|
+
var defaultProps$1j = {
|
|
10324
10113
|
title: "",
|
|
10325
10114
|
value: "",
|
|
10326
10115
|
disabled: false
|
|
10327
10116
|
};
|
|
10328
10117
|
var SideBarItem = function(props) {
|
|
10329
|
-
var _mergeProps = mergeProps(defaultProps$
|
|
10118
|
+
var _mergeProps = mergeProps(defaultProps$1j, props), children = _mergeProps.children, className = _mergeProps.className, disabled = _mergeProps.disabled;
|
|
10330
10119
|
var classPrefix2 = "nut-sidebaritem";
|
|
10331
10120
|
var classes = classNames(classPrefix2, {
|
|
10332
10121
|
active: !disabled && props.active
|
|
@@ -10367,13 +10156,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10367
10156
|
setState
|
|
10368
10157
|
];
|
|
10369
10158
|
}
|
|
10370
|
-
var defaultProps$
|
|
10159
|
+
var defaultProps$1i = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
10371
10160
|
contentDuration: 0,
|
|
10372
10161
|
sidebarDuration: 0
|
|
10373
10162
|
});
|
|
10374
10163
|
var classPrefix$l = "nut-sidebar";
|
|
10375
10164
|
var SideBar = function(props) {
|
|
10376
|
-
var _mergeProps = mergeProps(defaultProps$
|
|
10165
|
+
var _mergeProps = mergeProps(defaultProps$1i, props), contentDuration = _mergeProps.contentDuration, sidebarDuration = _mergeProps.sidebarDuration, children = _mergeProps.children, onClick = _mergeProps.onClick, onChange = _mergeProps.onChange, className = _mergeProps.className, rest = _object_without_properties(_mergeProps, [
|
|
10377
10166
|
"contentDuration",
|
|
10378
10167
|
"sidebarDuration",
|
|
10379
10168
|
"children",
|
|
@@ -10512,105 +10301,11 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10512
10301
|
};
|
|
10513
10302
|
SideBar.displayName = "NutSideBar";
|
|
10514
10303
|
SideBar.Item = SideBarItem;
|
|
10515
|
-
var SideNavBarItem = function(props) {
|
|
10516
|
-
var classPrefix2 = "nut-subsidenavbar";
|
|
10517
|
-
var title = props.title, value2 = props.value;
|
|
10518
|
-
props.children;
|
|
10519
|
-
var onClick = props.onClick, rest = _object_without_properties(props, [
|
|
10520
|
-
"title",
|
|
10521
|
-
"value",
|
|
10522
|
-
"children",
|
|
10523
|
-
"onClick"
|
|
10524
|
-
]);
|
|
10525
|
-
var clickFn = function(e2) {
|
|
10526
|
-
e2.stopPropagation();
|
|
10527
|
-
onClick && onClick({
|
|
10528
|
-
title,
|
|
10529
|
-
value: value2
|
|
10530
|
-
});
|
|
10531
|
-
};
|
|
10532
|
-
return /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
10533
|
-
className: "".concat(classPrefix2, "-item ").concat(classPrefix2, "-border-bt"),
|
|
10534
|
-
onClick: clickFn
|
|
10535
|
-
}, rest), title);
|
|
10536
|
-
};
|
|
10537
|
-
var defaultProps$1g = {
|
|
10538
|
-
open: true
|
|
10539
|
-
};
|
|
10540
|
-
var SubSideNavBar = function(props) {
|
|
10541
|
-
var classPrefix2 = "nut-subsidenavbar";
|
|
10542
|
-
var _ref = _object_spread({}, defaultProps$1g, props), title = _ref.title, value2 = _ref.value, children = _ref.children, onClick = _ref.onClick, open = _ref.open, rest = _object_without_properties(_ref, [
|
|
10543
|
-
"title",
|
|
10544
|
-
"value",
|
|
10545
|
-
"children",
|
|
10546
|
-
"onClick",
|
|
10547
|
-
"open"
|
|
10548
|
-
]);
|
|
10549
|
-
var offset = React.useContext(OffsetContext);
|
|
10550
|
-
var listRef = React.useRef(null);
|
|
10551
|
-
var setListLevel = React.useCallback(function(nodeList) {
|
|
10552
|
-
var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
|
|
10553
|
-
var titleClass = nodeList[0].className;
|
|
10554
|
-
if (titleClass.includes("".concat(classPrefix2, "-title"))) {
|
|
10555
|
-
var left = offset * (level + 1);
|
|
10556
|
-
nodeList[0].style.paddingLeft = "".concat(left, "px");
|
|
10557
|
-
}
|
|
10558
|
-
var childNodes = nodeList[1] && nodeList[1].children && Array.from(nodeList[1].children).filter(function(item) {
|
|
10559
|
-
return item.nodeType !== 3 && item.nodeType !== 8;
|
|
10560
|
-
});
|
|
10561
|
-
childNodes.forEach(function(item) {
|
|
10562
|
-
var itemClass = item.className;
|
|
10563
|
-
if (itemClass.includes("".concat(classPrefix2, "-item"))) {
|
|
10564
|
-
var left2 = offset * (level + 2);
|
|
10565
|
-
item.style.paddingLeft = "".concat(left2, "px");
|
|
10566
|
-
}
|
|
10567
|
-
if (itemClass.includes("".concat(classPrefix2, "-list"))) {
|
|
10568
|
-
var level1 = item.getAttribute("level") ? Number(item.getAttribute("level")) : 1;
|
|
10569
|
-
level1 += 1;
|
|
10570
|
-
item.setAttribute("level", level1.toString());
|
|
10571
|
-
item.children && setListLevel(item.children, level1);
|
|
10572
|
-
}
|
|
10573
|
-
});
|
|
10574
|
-
}, [
|
|
10575
|
-
offset
|
|
10576
|
-
]);
|
|
10577
|
-
var clickFn = function(e2) {
|
|
10578
|
-
handleClick(e2);
|
|
10579
|
-
var currentClass = e2.currentTarget.className;
|
|
10580
|
-
var isShow = currentClass.includes("sidenavbar-show");
|
|
10581
|
-
onClick && onClick({
|
|
10582
|
-
title,
|
|
10583
|
-
value: value2,
|
|
10584
|
-
isShow
|
|
10585
|
-
});
|
|
10586
|
-
};
|
|
10587
|
-
React.useEffect(function() {
|
|
10588
|
-
var _listRef_current, _listRef_current1;
|
|
10589
|
-
var childNodes = (_listRef_current = listRef.current) === null || _listRef_current === void 0 ? void 0 : _listRef_current.children;
|
|
10590
|
-
(_listRef_current1 = listRef.current) === null || _listRef_current1 === void 0 ? void 0 : _listRef_current1.setAttribute("level", "1");
|
|
10591
|
-
childNodes && setListLevel(childNodes);
|
|
10592
|
-
}, [
|
|
10593
|
-
setListLevel
|
|
10594
|
-
]);
|
|
10595
|
-
var divClass = open ? "".concat(classPrefix2, "-list sidenavbar-show") : "".concat(classPrefix2, "-list sidenavbar-hide");
|
|
10596
|
-
var iconClass = open ? "arrow-icon arrow-down" : "arrow-icon arrow-up";
|
|
10597
|
-
return /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
10598
|
-
className: divClass,
|
|
10599
|
-
ref: listRef,
|
|
10600
|
-
onClick: clickFn
|
|
10601
|
-
}, rest), /* @__PURE__ */ React.createElement("div", {
|
|
10602
|
-
className: "".concat(classPrefix2, "-title ").concat(classPrefix2, "-border-bt")
|
|
10603
|
-
}, title, " ", /* @__PURE__ */ React.createElement("i", {
|
|
10604
|
-
className: iconClass
|
|
10605
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
10606
|
-
className: "".concat(classPrefix2, "-content")
|
|
10607
|
-
}, children));
|
|
10608
|
-
};
|
|
10609
10304
|
function _type_of(obj) {
|
|
10610
10305
|
"@swc/helpers - typeof";
|
|
10611
10306
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
10612
10307
|
}
|
|
10613
|
-
var defaultProps$
|
|
10308
|
+
var defaultProps$1h = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
10614
10309
|
value: "",
|
|
10615
10310
|
dot: false,
|
|
10616
10311
|
max: 99,
|
|
@@ -10631,7 +10326,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10631
10326
|
};
|
|
10632
10327
|
var _this;
|
|
10633
10328
|
var rtl = useRtl();
|
|
10634
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
10329
|
+
var _$_object_spread = _object_spread({}, defaultProps$1h, props), className = _$_object_spread.className, style = _$_object_spread.style, value2 = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size;
|
|
10635
10330
|
var classPrefix2 = "nut-badge";
|
|
10636
10331
|
var classes = classNames(classPrefix2, className);
|
|
10637
10332
|
var getContent = function() {
|
|
@@ -10662,7 +10357,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10662
10357
|
};
|
|
10663
10358
|
Badge.displayName = "NutBadge";
|
|
10664
10359
|
const TabbarContext = React.createContext(null);
|
|
10665
|
-
var defaultProps$
|
|
10360
|
+
var defaultProps$1g = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
10666
10361
|
title: "",
|
|
10667
10362
|
icon: null,
|
|
10668
10363
|
value: "",
|
|
@@ -10673,7 +10368,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10673
10368
|
});
|
|
10674
10369
|
var TabbarItem = function(props) {
|
|
10675
10370
|
var ctx2 = React.useContext(TabbarContext);
|
|
10676
|
-
var _ref = _object_spread({}, defaultProps$
|
|
10371
|
+
var _ref = _object_spread({}, defaultProps$1g, props), className = _ref.className, style = _ref.style, title = _ref.title, icon = _ref.icon, value2 = _ref.value, dot = _ref.dot, max = _ref.max, top = _ref.top, right = _ref.right, index2 = _ref.index, rest = _object_without_properties(_ref, [
|
|
10677
10372
|
"className",
|
|
10678
10373
|
"style",
|
|
10679
10374
|
"title",
|
|
@@ -10715,7 +10410,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10715
10410
|
className: boxPrefix
|
|
10716
10411
|
}, icon)), renderTitleText()) : /* @__PURE__ */ React.createElement(Badge, badgeProps, renderTitleText()));
|
|
10717
10412
|
};
|
|
10718
|
-
var defaultProps$
|
|
10413
|
+
var defaultProps$1f = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
10719
10414
|
defaultValue: 0,
|
|
10720
10415
|
fixed: false,
|
|
10721
10416
|
inactiveColor: "",
|
|
@@ -10725,7 +10420,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10725
10420
|
}
|
|
10726
10421
|
});
|
|
10727
10422
|
var Tabbar = function(props) {
|
|
10728
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
10423
|
+
var _$_object_spread = _object_spread({}, defaultProps$1f, props), children = _$_object_spread.children, defaultValue = _$_object_spread.defaultValue, value2 = _$_object_spread.value, fixed = _$_object_spread.fixed, activeColor = _$_object_spread.activeColor, inactiveColor = _$_object_spread.inactiveColor, safeArea = _$_object_spread.safeArea, className = _$_object_spread.className, style = _$_object_spread.style, onSwitch = _$_object_spread.onSwitch;
|
|
10729
10424
|
var classPrefix2 = "nut-tabbar";
|
|
10730
10425
|
var _usePropsValue = _sliced_to_array(usePropsValue({
|
|
10731
10426
|
value: value2,
|
|
@@ -10756,13 +10451,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10756
10451
|
};
|
|
10757
10452
|
Tabbar.displayName = "NutTabbar";
|
|
10758
10453
|
Tabbar.Item = TabbarItem;
|
|
10759
|
-
var defaultProps$
|
|
10454
|
+
var defaultProps$1e = {
|
|
10760
10455
|
title: "",
|
|
10761
10456
|
value: "",
|
|
10762
10457
|
disabled: false
|
|
10763
10458
|
};
|
|
10764
10459
|
var TabPane = function(props) {
|
|
10765
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
10460
|
+
var _$_object_spread = _object_spread({}, defaultProps$1e, props), children = _$_object_spread.children, autoHeightClassName = _$_object_spread.autoHeightClassName, className = _$_object_spread.className, disabled = _$_object_spread.disabled;
|
|
10766
10461
|
var classPrefix2 = "nut-tabpane";
|
|
10767
10462
|
var classes = classNames(classPrefix2, {
|
|
10768
10463
|
active: !disabled && props.active
|
|
@@ -10771,7 +10466,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10771
10466
|
className: classes
|
|
10772
10467
|
}, !disabled && children);
|
|
10773
10468
|
};
|
|
10774
|
-
var defaultProps$
|
|
10469
|
+
var defaultProps$1d = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
10775
10470
|
tabStyle: {},
|
|
10776
10471
|
activeColor: "",
|
|
10777
10472
|
direction: "horizontal",
|
|
@@ -10782,7 +10477,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10782
10477
|
var classPrefix$k = "nut-tabs";
|
|
10783
10478
|
var Tabs = function(props) {
|
|
10784
10479
|
var rtl = useRtl();
|
|
10785
|
-
var _ref = _object_spread({}, defaultProps$
|
|
10480
|
+
var _ref = _object_spread({}, defaultProps$1d, props), activeColor = _ref.activeColor, tabStyle = _ref.tabStyle, direction = _ref.direction, activeType = _ref.activeType, duration = _ref.duration, align = _ref.align, title = _ref.title, children = _ref.children, onClick = _ref.onClick, onChange = _ref.onChange, className = _ref.className, autoHeight = _ref.autoHeight, outerValue = _ref.value, outerDefaultValue = _ref.defaultValue, rest = _object_without_properties(_ref, [
|
|
10786
10481
|
"activeColor",
|
|
10787
10482
|
"tabStyle",
|
|
10788
10483
|
"direction",
|
|
@@ -10947,6 +10642,154 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10947
10642
|
};
|
|
10948
10643
|
Tabs.displayName = "NutTabs";
|
|
10949
10644
|
Tabs.TabPane = TabPane;
|
|
10645
|
+
var defaultProps$1c = _object_spread_props(_object_spread({}, defaultOverlayProps), {
|
|
10646
|
+
position: "center",
|
|
10647
|
+
transition: "",
|
|
10648
|
+
overlayStyle: {},
|
|
10649
|
+
overlayClassName: "",
|
|
10650
|
+
closeable: false,
|
|
10651
|
+
closeIconPosition: "top-right",
|
|
10652
|
+
closeIcon: "close",
|
|
10653
|
+
destroyOnClose: false,
|
|
10654
|
+
portal: null,
|
|
10655
|
+
overlay: true,
|
|
10656
|
+
round: false,
|
|
10657
|
+
onOpen: function() {
|
|
10658
|
+
},
|
|
10659
|
+
onClose: function() {
|
|
10660
|
+
},
|
|
10661
|
+
onOverlayClick: function() {
|
|
10662
|
+
return true;
|
|
10663
|
+
},
|
|
10664
|
+
onCloseIconClick: function() {
|
|
10665
|
+
return true;
|
|
10666
|
+
}
|
|
10667
|
+
});
|
|
10668
|
+
var _zIndex = 1100;
|
|
10669
|
+
var Popup = function(props) {
|
|
10670
|
+
var _$_object_spread = _object_spread({}, defaultProps$1c, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left = _$_object_spread.left, title = _$_object_spread.title, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position2 = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick;
|
|
10671
|
+
var nodeRef = React.useRef(null);
|
|
10672
|
+
var innerIndex = zIndex || _zIndex;
|
|
10673
|
+
var _useState = _sliced_to_array(React.useState(innerIndex), 2), index2 = _useState[0], setIndex = _useState[1];
|
|
10674
|
+
var _useState1 = _sliced_to_array(React.useState(visible), 2), innerVisible = _useState1[0], setInnerVisible = _useState1[1];
|
|
10675
|
+
var _useState2 = _sliced_to_array(React.useState(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
|
|
10676
|
+
var _useState3 = _sliced_to_array(React.useState(""), 2), transitionName = _useState3[0], setTransitionName = _useState3[1];
|
|
10677
|
+
useLockScroll(nodeRef, innerVisible && lockScroll);
|
|
10678
|
+
var classPrefix2 = "nut-popup";
|
|
10679
|
+
var overlayStyles = _object_spread({}, overlayStyle);
|
|
10680
|
+
var popStyles = _object_spread_props(_object_spread({}, style), {
|
|
10681
|
+
zIndex: index2
|
|
10682
|
+
});
|
|
10683
|
+
var _obj;
|
|
10684
|
+
var popClassName = classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-round"), round || position2 === "bottom"), _define_property(_obj, "".concat(classPrefix2, "-").concat(position2), true), _obj), className);
|
|
10685
|
+
var open = function() {
|
|
10686
|
+
if (!innerVisible) {
|
|
10687
|
+
setInnerVisible(true);
|
|
10688
|
+
setIndex(++innerIndex);
|
|
10689
|
+
}
|
|
10690
|
+
if (destroyOnClose) {
|
|
10691
|
+
setShowChildren(true);
|
|
10692
|
+
}
|
|
10693
|
+
onOpen && onOpen();
|
|
10694
|
+
};
|
|
10695
|
+
var close = function() {
|
|
10696
|
+
if (innerVisible) {
|
|
10697
|
+
setInnerVisible(false);
|
|
10698
|
+
if (destroyOnClose) {
|
|
10699
|
+
setTimeout(function() {
|
|
10700
|
+
setShowChildren(false);
|
|
10701
|
+
}, Number(duration));
|
|
10702
|
+
}
|
|
10703
|
+
onClose && onClose();
|
|
10704
|
+
}
|
|
10705
|
+
};
|
|
10706
|
+
var handleOverlayClick = function(e2) {
|
|
10707
|
+
e2.stopPropagation();
|
|
10708
|
+
if (closeOnOverlayClick && onOverlayClick(e2)) {
|
|
10709
|
+
close();
|
|
10710
|
+
}
|
|
10711
|
+
};
|
|
10712
|
+
var handleCloseIconClick = function(e2) {
|
|
10713
|
+
onCloseIconClick(e2) && close();
|
|
10714
|
+
};
|
|
10715
|
+
var renderCloseIcon = function() {
|
|
10716
|
+
var closeClasses = classNames("".concat(classPrefix2, "-title-right"), "".concat(classPrefix2, "-title-right-").concat(closeIconPosition));
|
|
10717
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, closeable && /* @__PURE__ */ React.createElement("div", {
|
|
10718
|
+
className: closeClasses,
|
|
10719
|
+
onClick: handleCloseIconClick
|
|
10720
|
+
}, /* @__PURE__ */ React.isValidElement(closeIcon) ? closeIcon : /* @__PURE__ */ React.createElement(n$6, null)));
|
|
10721
|
+
};
|
|
10722
|
+
var renderTitle = function() {
|
|
10723
|
+
if (left || title || description) {
|
|
10724
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
10725
|
+
className: "".concat(classPrefix2, "-title")
|
|
10726
|
+
}, position2 === "bottom" && /* @__PURE__ */ React.createElement(React.Fragment, null, left && /* @__PURE__ */ React.createElement("div", {
|
|
10727
|
+
className: "".concat(classPrefix2, "-title-left")
|
|
10728
|
+
}, left), (title || description) && /* @__PURE__ */ React.createElement("div", {
|
|
10729
|
+
className: "".concat(classPrefix2, "-title-wrapper")
|
|
10730
|
+
}, title && /* @__PURE__ */ React.createElement("div", {
|
|
10731
|
+
className: "".concat(classPrefix2, "-title-title")
|
|
10732
|
+
}, title), description && /* @__PURE__ */ React.createElement("div", {
|
|
10733
|
+
className: "".concat(classPrefix2, "-title-description ").concat(title ? "".concat(classPrefix2, "-title-description-gap") : "")
|
|
10734
|
+
}, description))), renderCloseIcon());
|
|
10735
|
+
}
|
|
10736
|
+
if (closeable) {
|
|
10737
|
+
return renderCloseIcon();
|
|
10738
|
+
}
|
|
10739
|
+
};
|
|
10740
|
+
var renderPop = function() {
|
|
10741
|
+
return /* @__PURE__ */ React.createElement(CSSTransition, {
|
|
10742
|
+
nodeRef,
|
|
10743
|
+
classNames: transitionName,
|
|
10744
|
+
mountOnEnter: true,
|
|
10745
|
+
unmountOnExit: destroyOnClose,
|
|
10746
|
+
timeout: duration,
|
|
10747
|
+
in: innerVisible,
|
|
10748
|
+
onEntered: afterShow,
|
|
10749
|
+
onExited: afterClose
|
|
10750
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
10751
|
+
ref: nodeRef,
|
|
10752
|
+
style: popStyles,
|
|
10753
|
+
className: popClassName,
|
|
10754
|
+
onClick
|
|
10755
|
+
}, renderTitle(), showChildren && children));
|
|
10756
|
+
};
|
|
10757
|
+
var renderNode = function() {
|
|
10758
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, overlay && /* @__PURE__ */ React.createElement(Overlay, {
|
|
10759
|
+
zIndex: index2,
|
|
10760
|
+
style: overlayStyles,
|
|
10761
|
+
className: overlayClassName,
|
|
10762
|
+
visible: innerVisible,
|
|
10763
|
+
closeOnOverlayClick,
|
|
10764
|
+
lockScroll,
|
|
10765
|
+
duration,
|
|
10766
|
+
onClick: handleOverlayClick
|
|
10767
|
+
}), renderPop());
|
|
10768
|
+
};
|
|
10769
|
+
React.useEffect(function() {
|
|
10770
|
+
visible ? open() : close();
|
|
10771
|
+
}, [
|
|
10772
|
+
visible
|
|
10773
|
+
]);
|
|
10774
|
+
React.useEffect(function() {
|
|
10775
|
+
setTransitionName(transition || "".concat(classPrefix2, "-slide-").concat(position2));
|
|
10776
|
+
}, [
|
|
10777
|
+
position2,
|
|
10778
|
+
transition
|
|
10779
|
+
]);
|
|
10780
|
+
var resolveContainer = function(getContainer) {
|
|
10781
|
+
return (typeof getContainer === "function" ? getContainer() : getContainer) || document.body;
|
|
10782
|
+
};
|
|
10783
|
+
var renderToContainer = function(getContainer, node) {
|
|
10784
|
+
if (getContainer) {
|
|
10785
|
+
var container = resolveContainer(getContainer);
|
|
10786
|
+
return /* @__PURE__ */ ReactDOM.createPortal(node, container);
|
|
10787
|
+
}
|
|
10788
|
+
return node;
|
|
10789
|
+
};
|
|
10790
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, renderToContainer(portal, renderNode()));
|
|
10791
|
+
};
|
|
10792
|
+
Popup.displayName = "NutPopup";
|
|
10950
10793
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key2, arg) {
|
|
10951
10794
|
try {
|
|
10952
10795
|
var info = gen[key2](arg);
|
|
@@ -11231,7 +11074,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
11231
11074
|
]);
|
|
11232
11075
|
return Tree2;
|
|
11233
11076
|
}();
|
|
11234
|
-
var defaultProps$
|
|
11077
|
+
var defaultProps$1b = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
11235
11078
|
activeColor: "",
|
|
11236
11079
|
activeIcon: "checklist",
|
|
11237
11080
|
popup: true,
|
|
@@ -11257,7 +11100,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
11257
11100
|
});
|
|
11258
11101
|
var InternalCascader = function(props, ref) {
|
|
11259
11102
|
var locale = useConfig().locale;
|
|
11260
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
11103
|
+
var _$_object_spread = _object_spread({}, defaultProps$1b, props), className = _$_object_spread.className, style = _$_object_spread.style, activeColor = _$_object_spread.activeColor, activeIcon = _$_object_spread.activeIcon, popup = _$_object_spread.popup, _object_spread_popupProps = _$_object_spread.popupProps, popupProps = _object_spread_popupProps === void 0 ? {} : _object_spread_popupProps, visible = _$_object_spread.visible, options2 = _$_object_spread.options, value2 = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, optionKey = _$_object_spread.optionKey, format2 = _$_object_spread.format, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, lazy = _$_object_spread.lazy, title = _$_object_spread.title, left = _$_object_spread.left, onLoad = _$_object_spread.onLoad, onClose = _$_object_spread.onClose, onChange = _$_object_spread.onChange, onPathChange = _$_object_spread.onPathChange;
|
|
11261
11104
|
var _useState = _sliced_to_array(React.useState("c1"), 2), tabvalue = _useState[0], setTabvalue = _useState[1];
|
|
11262
11105
|
var _useState1 = _sliced_to_array(React.useState([]), 2), optionsData = _useState1[0], setOptionsData = _useState1[1];
|
|
11263
11106
|
var isLazy = function() {
|
|
@@ -11712,7 +11555,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
11712
11555
|
};
|
|
11713
11556
|
var Cascader = /* @__PURE__ */ React.forwardRef(InternalCascader);
|
|
11714
11557
|
Cascader.displayName = "NutCascader";
|
|
11715
|
-
var defaultProps$
|
|
11558
|
+
var defaultProps$1a = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
11716
11559
|
visible: false,
|
|
11717
11560
|
type: "custom",
|
|
11718
11561
|
options: [],
|
|
@@ -11725,7 +11568,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
11725
11568
|
height: "200px"
|
|
11726
11569
|
});
|
|
11727
11570
|
var CustomRender = function(props) {
|
|
11728
|
-
var _ref = _object_spread({}, defaultProps$
|
|
11571
|
+
var _ref = _object_spread({}, defaultProps$1a, props);
|
|
11729
11572
|
_ref.children;
|
|
11730
11573
|
var visible = _ref.visible, type2 = _ref.type;
|
|
11731
11574
|
_ref.height;
|
|
@@ -11763,7 +11606,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
11763
11606
|
onPathChange
|
|
11764
11607
|
}, rest)));
|
|
11765
11608
|
};
|
|
11766
|
-
var defaultProps$
|
|
11609
|
+
var defaultProps$19 = {
|
|
11767
11610
|
type: "custom",
|
|
11768
11611
|
existList: [],
|
|
11769
11612
|
defaultIcon: null,
|
|
@@ -11772,7 +11615,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
11772
11615
|
};
|
|
11773
11616
|
var ExistRender = function(props) {
|
|
11774
11617
|
var locale = useConfig().locale;
|
|
11775
|
-
var _ref = _object_spread({}, defaultProps$
|
|
11618
|
+
var _ref = _object_spread({}, defaultProps$19, props);
|
|
11776
11619
|
_ref.children;
|
|
11777
11620
|
var type2 = _ref.type, existList = _ref.existList, selectIcon = _ref.selectIcon, defaultIcon = _ref.defaultIcon, custom = _ref.custom, onSelect = _ref.onSelect, onSwitch = _ref.onSwitch;
|
|
11778
11621
|
_object_without_properties(_ref, [
|
|
@@ -11821,7 +11664,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
11821
11664
|
className: "".concat(classPrefix2, "-footer-btn")
|
|
11822
11665
|
}, custom)));
|
|
11823
11666
|
};
|
|
11824
|
-
var defaultProps$
|
|
11667
|
+
var defaultProps$18 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
11825
11668
|
defaultValue: [],
|
|
11826
11669
|
type: "custom",
|
|
11827
11670
|
options: [],
|
|
@@ -11841,7 +11684,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
11841
11684
|
});
|
|
11842
11685
|
var InternalAddress = function(props, ref) {
|
|
11843
11686
|
var locale = useConfig().locale;
|
|
11844
|
-
var _ref = _object_spread({}, defaultProps$
|
|
11687
|
+
var _ref = _object_spread({}, defaultProps$18, props), style = _ref.style, className = _ref.className, visible = _ref.visible, defaultVisible = _ref.defaultVisible, defaultValue = _ref.defaultValue;
|
|
11845
11688
|
_ref.children;
|
|
11846
11689
|
var type2 = _ref.type, options2 = _ref.options, optionKey = _ref.optionKey, format2 = _ref.format, height2 = _ref.height, title = _ref.title, existList = _ref.existList, custom = _ref.custom, selectIcon = _ref.selectIcon, defaultIcon = _ref.defaultIcon, closeIcon = _ref.closeIcon, backIcon = _ref.backIcon, onChange = _ref.onChange, onExistSelect = _ref.onExistSelect, onClose = _ref.onClose, onSwitch = _ref.onSwitch;
|
|
11847
11690
|
_object_without_properties(_ref, [
|
|
@@ -12225,7 +12068,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
12225
12068
|
var isStartAndEnd = function(days) {
|
|
12226
12069
|
return days.length >= 2 && Utils.isEqual(days[0], days[1]);
|
|
12227
12070
|
};
|
|
12228
|
-
var defaultProps$
|
|
12071
|
+
var defaultProps$17 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
12229
12072
|
type: "single",
|
|
12230
12073
|
autoBackfill: false,
|
|
12231
12074
|
popup: true,
|
|
@@ -12258,7 +12101,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
12258
12101
|
});
|
|
12259
12102
|
var CalendarItem = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
12260
12103
|
var locale = useConfig().locale;
|
|
12261
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
12104
|
+
var _$_object_spread = _object_spread({}, defaultProps$17, props), style = _$_object_spread.style, className = _$_object_spread.className, children = _$_object_spread.children, popup = _$_object_spread.popup, type2 = _$_object_spread.type, autoBackfill = _$_object_spread.autoBackfill, title = _$_object_spread.title, defaultValue = _$_object_spread.defaultValue, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, showToday = _$_object_spread.showToday, startText = _$_object_spread.startText, endText = _$_object_spread.endText, confirmText = _$_object_spread.confirmText, showTitle = _$_object_spread.showTitle, showSubTitle = _$_object_spread.showSubTitle, scrollAnimation = _$_object_spread.scrollAnimation, firstDayOfWeek = _$_object_spread.firstDayOfWeek, disableDate = _$_object_spread.disableDate, renderHeaderButtons = _$_object_spread.renderHeaderButtons, renderBottomButton = _$_object_spread.renderBottomButton, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, value2 = _$_object_spread.value, onConfirm = _$_object_spread.onConfirm, onUpdate = _$_object_spread.onUpdate, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange;
|
|
12262
12105
|
var weekdays = locale.calendaritem.weekdays;
|
|
12263
12106
|
var weeks = _to_consumable_array(weekdays.slice(firstDayOfWeek, 7)).concat(_to_consumable_array(weekdays.slice(0, firstDayOfWeek)));
|
|
12264
12107
|
var monthTitle = locale.calendaritem.monthTitle;
|
|
@@ -12818,7 +12661,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
12818
12661
|
}, renderHeader(), renderContent(), popup && !autoBackfill ? renderFooter() : "");
|
|
12819
12662
|
});
|
|
12820
12663
|
CalendarItem.displayName = "NutCalendarItem";
|
|
12821
|
-
var defaultProps$
|
|
12664
|
+
var defaultProps$16 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
12822
12665
|
type: "single",
|
|
12823
12666
|
autoBackfill: false,
|
|
12824
12667
|
popup: true,
|
|
@@ -12853,7 +12696,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
12853
12696
|
});
|
|
12854
12697
|
var Calendar = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
12855
12698
|
var locale = useConfig().locale;
|
|
12856
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
12699
|
+
var _$_object_spread = _object_spread({}, defaultProps$16, props), style = _$_object_spread.style, className = _$_object_spread.className, children = _$_object_spread.children, popup = _$_object_spread.popup, visible = _$_object_spread.visible, type2 = _$_object_spread.type, autoBackfill = _$_object_spread.autoBackfill, title = _$_object_spread.title, defaultValue = _$_object_spread.defaultValue, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, showToday = _$_object_spread.showToday, startText = _$_object_spread.startText, endText = _$_object_spread.endText, confirmText = _$_object_spread.confirmText, showTitle = _$_object_spread.showTitle, showSubTitle = _$_object_spread.showSubTitle, scrollAnimation = _$_object_spread.scrollAnimation, firstDayOfWeek = _$_object_spread.firstDayOfWeek, closeIcon = _$_object_spread.closeIcon, disableDate = _$_object_spread.disableDate, renderHeaderButtons = _$_object_spread.renderHeaderButtons, renderBottomButton = _$_object_spread.renderBottomButton, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, onClose = _$_object_spread.onClose, onConfirm = _$_object_spread.onConfirm, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange;
|
|
12857
12700
|
var calendarRef = React.useRef(null);
|
|
12858
12701
|
var close = function() {
|
|
12859
12702
|
onClose && onClose();
|
|
@@ -13020,14 +12863,14 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
13020
12863
|
convertDateToDay(new Date(current.getTime() + 24 * 60 * 60 * 1e3 * (6 - count)))
|
|
13021
12864
|
];
|
|
13022
12865
|
};
|
|
13023
|
-
var defaultProps$
|
|
12866
|
+
var defaultProps$15 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
13024
12867
|
type: "single",
|
|
13025
12868
|
firstDayOfWeek: 0
|
|
13026
12869
|
});
|
|
13027
12870
|
var prefixCls = "nut-calendarcard";
|
|
13028
12871
|
var CalendarCard = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
13029
12872
|
var locale = useConfig().locale;
|
|
13030
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
12873
|
+
var _$_object_spread = _object_spread({}, defaultProps$15, props), style = _$_object_spread.style, className = _$_object_spread.className, type2 = _$_object_spread.type, value2 = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, firstDayOfWeek = _$_object_spread.firstDayOfWeek, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, disableDay = _$_object_spread.disableDay, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange, onChange = _$_object_spread.onChange;
|
|
13031
12874
|
var _useState = _sliced_to_array(React.useState(function() {
|
|
13032
12875
|
var date2 = new Date(Date.now());
|
|
13033
12876
|
var val2 = value2 || defaultValue;
|
|
@@ -13405,7 +13248,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
13405
13248
|
});
|
|
13406
13249
|
CalendarCard.displayName = "NutCalendarCard";
|
|
13407
13250
|
var CheckboxGroupContext = React.createContext(null);
|
|
13408
|
-
var defaultProps$
|
|
13251
|
+
var defaultProps$14 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
13409
13252
|
disabled: false,
|
|
13410
13253
|
shape: "round",
|
|
13411
13254
|
labelPosition: "right",
|
|
@@ -13417,7 +13260,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
13417
13260
|
});
|
|
13418
13261
|
var classPrefix$j = "nut-checkbox";
|
|
13419
13262
|
var Checkbox = function(props) {
|
|
13420
|
-
var children = _object_spread({}, defaultProps$
|
|
13263
|
+
var children = _object_spread({}, defaultProps$14, props).children;
|
|
13421
13264
|
var icon = props.icon, label = props.label, className = props.className, activeIcon = props.activeIcon, checked = props.checked, value2 = props.value, defaultChecked = props.defaultChecked, shape = props.shape, disabled = props.disabled, onChange = props.onChange, indeterminate = props.indeterminate, indeterminateIcon = props.indeterminateIcon, others = _object_without_properties(props, [
|
|
13422
13265
|
"icon",
|
|
13423
13266
|
"label",
|
|
@@ -13522,7 +13365,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
13522
13365
|
className: classNames("".concat(classPrefix$j, "-label "), _define_property({}, "".concat(classPrefix$j, "-label-disabled"), innerDisabled))
|
|
13523
13366
|
}, children || label);
|
|
13524
13367
|
};
|
|
13525
|
-
var
|
|
13368
|
+
var handleClick = function() {
|
|
13526
13369
|
if (disabled) return;
|
|
13527
13370
|
var latestChecked = !innerChecked;
|
|
13528
13371
|
setChecked(latestChecked);
|
|
@@ -13551,11 +13394,11 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
13551
13394
|
return /* @__PURE__ */ React.createElement("div", _object_spread_props(_object_spread({
|
|
13552
13395
|
className: classNames(classPrefix$j, (_obj = {}, _define_property(_obj, "".concat(classPrefix$j, "-reverse"), labelPosition === "left"), _define_property(_obj, "nut-checkbox-list-item", ctx2 === null || ctx2 === void 0 ? void 0 : ctx2.list), _obj), className)
|
|
13553
13396
|
}, rest), {
|
|
13554
|
-
onClick:
|
|
13397
|
+
onClick: handleClick
|
|
13555
13398
|
}), renderCheckboxItem());
|
|
13556
13399
|
};
|
|
13557
13400
|
Checkbox.displayName = "NutCheckBox";
|
|
13558
|
-
var defaultProps$
|
|
13401
|
+
var defaultProps$13 = {
|
|
13559
13402
|
max: void 0,
|
|
13560
13403
|
min: void 0,
|
|
13561
13404
|
list: false,
|
|
@@ -13569,7 +13412,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
13569
13412
|
};
|
|
13570
13413
|
var classPrefix$i = "nut-checkboxgroup";
|
|
13571
13414
|
var CheckboxGroup = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
13572
|
-
var _ref = _object_spread({}, defaultProps$
|
|
13415
|
+
var _ref = _object_spread({}, defaultProps$13, props), children = _ref.children, className = _ref.className, disabled = _ref.disabled, list = _ref.list, value2 = _ref.value, defaultValue = _ref.defaultValue, max = _ref.max, min = _ref.min, labelPosition = _ref.labelPosition, direction = _ref.direction, options2 = _ref.options, onChange = _ref.onChange, onLimit = _ref.onLimit, rest = _object_without_properties(_ref, [
|
|
13573
13416
|
"children",
|
|
13574
13417
|
"className",
|
|
13575
13418
|
"disabled",
|
|
@@ -13888,7 +13731,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
13888
13731
|
})));
|
|
13889
13732
|
};
|
|
13890
13733
|
var PickerRoller = /* @__PURE__ */ React.forwardRef(InternalPickerRoller);
|
|
13891
|
-
var defaultProps$
|
|
13734
|
+
var defaultProps$12 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
13892
13735
|
options: [],
|
|
13893
13736
|
defaultValue: [],
|
|
13894
13737
|
value: void 0,
|
|
@@ -13897,7 +13740,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
13897
13740
|
}
|
|
13898
13741
|
});
|
|
13899
13742
|
var InternalPickerView = function(props, ref) {
|
|
13900
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
13743
|
+
var _$_object_spread = _object_spread({}, defaultProps$12, props), options2 = _$_object_spread.options, _object_spread_defaultValue = _$_object_spread.defaultValue, defaultValue = _object_spread_defaultValue === void 0 ? [] : _object_spread_defaultValue, value2 = _$_object_spread.value, duration = _$_object_spread.duration, threeDimensional = _$_object_spread.threeDimensional, renderLabel = _$_object_spread.renderLabel, className = _$_object_spread.className, style = _$_object_spread.style, onChange = _$_object_spread.onChange;
|
|
13901
13744
|
var classPrefix2 = "nut-pickerview";
|
|
13902
13745
|
var cls = classNames(classPrefix2, className);
|
|
13903
13746
|
var _usePropsValue = _sliced_to_array(usePropsValue({
|
|
@@ -14072,7 +13915,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
14072
13915
|
reset
|
|
14073
13916
|
];
|
|
14074
13917
|
}
|
|
14075
|
-
var defaultProps$
|
|
13918
|
+
var defaultProps$11 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
14076
13919
|
title: "",
|
|
14077
13920
|
options: [],
|
|
14078
13921
|
value: void 0,
|
|
@@ -14081,7 +13924,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
14081
13924
|
});
|
|
14082
13925
|
var InternalPicker$1 = function(props, ref) {
|
|
14083
13926
|
var locale = useConfig().locale;
|
|
14084
|
-
var _ref = _object_spread({}, defaultProps$
|
|
13927
|
+
var _ref = _object_spread({}, defaultProps$11, props), children = _ref.children;
|
|
14085
13928
|
_ref.visible;
|
|
14086
13929
|
var title = _ref.title, _ref_options = _ref.options, options2 = _ref_options === void 0 ? [] : _ref_options, closeOnOverlayClick = _ref.closeOnOverlayClick, _ref_popupProps = _ref.popupProps, popupProps = _ref_popupProps === void 0 ? {} : _ref_popupProps, _ref_defaultValue = _ref.defaultValue, defaultValue = _ref_defaultValue === void 0 ? [] : _ref_defaultValue, className = _ref.className, style = _ref.style, threeDimensional = _ref.threeDimensional, duration = _ref.duration;
|
|
14087
13930
|
_ref.onConfirm;
|
|
@@ -14439,19 +14282,19 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
14439
14282
|
handleDateComparison(date1, selectedOptions, index2);
|
|
14440
14283
|
}
|
|
14441
14284
|
};
|
|
14442
|
-
var currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
14443
|
-
var defaultProps
|
|
14285
|
+
var currentYear$1 = (/* @__PURE__ */ new Date()).getFullYear();
|
|
14286
|
+
var defaultProps$10 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
14444
14287
|
visible: false,
|
|
14445
14288
|
title: "",
|
|
14446
14289
|
type: "date",
|
|
14447
14290
|
showChinese: false,
|
|
14448
14291
|
threeDimensional: true,
|
|
14449
14292
|
minuteStep: 1,
|
|
14450
|
-
startDate: new Date(currentYear - 10, 0, 1),
|
|
14451
|
-
endDate: new Date(currentYear + 10, 11, 31)
|
|
14293
|
+
startDate: new Date(currentYear$1 - 10, 0, 1),
|
|
14294
|
+
endDate: new Date(currentYear$1 + 10, 11, 31)
|
|
14452
14295
|
});
|
|
14453
14296
|
var InternalPicker = function(props, ref) {
|
|
14454
|
-
var _ref = _object_spread({}, defaultProps
|
|
14297
|
+
var _ref = _object_spread({}, defaultProps$10, props), startDate = _ref.startDate, endDate = _ref.endDate, type2 = _ref.type, showChinese = _ref.showChinese, minuteStep = _ref.minuteStep;
|
|
14455
14298
|
_ref.visible;
|
|
14456
14299
|
var title = _ref.title, defaultValue = _ref.defaultValue, _ref_pickerProps = _ref.pickerProps, pickerProps = _ref_pickerProps === void 0 ? {} : _ref_pickerProps, formatter = _ref.formatter, onClose = _ref.onClose, onCancel = _ref.onCancel, onConfirm = _ref.onConfirm, filter = _ref.filter, onChange = _ref.onChange, threeDimensional = _ref.threeDimensional, className = _ref.className, style = _ref.style, children = _ref.children, rest = _object_without_properties(_ref, [
|
|
14457
14300
|
"startDate",
|
|
@@ -14484,6 +14327,8 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
14484
14327
|
minute: lang.min,
|
|
14485
14328
|
seconds: lang.seconds
|
|
14486
14329
|
};
|
|
14330
|
+
var classPrefix2 = "nut-datepicker";
|
|
14331
|
+
var cls = classNames(classPrefix2, className);
|
|
14487
14332
|
var _useState = _sliced_to_array(React.useState([]), 2), pickerValue = _useState[0], setPickerValue = _useState[1];
|
|
14488
14333
|
var _useState1 = _sliced_to_array(React.useState([]), 2), pickerOptions = _useState1[0], setPickerOptions = _useState1[1];
|
|
14489
14334
|
var _usePropsValue = _sliced_to_array(usePropsValue({
|
|
@@ -14509,10 +14354,9 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
14509
14354
|
return actions;
|
|
14510
14355
|
});
|
|
14511
14356
|
var handleDateComparison = function(newDate, selectedOptions, index2) {
|
|
14512
|
-
var _this;
|
|
14513
|
-
var isEqual2 = ((_this = new Date(innerDate)) === null || _this === void 0 ? void 0 : _this.getTime()) === (newDate === null || newDate === void 0 ? void 0 : newDate.getTime());
|
|
14514
14357
|
if (newDate && isDate(newDate)) {
|
|
14515
|
-
|
|
14358
|
+
var _this;
|
|
14359
|
+
if (!isEqual$1((_this = new Date(selectedDate)) === null || _this === void 0 ? void 0 : _this.getTime(), newDate === null || newDate === void 0 ? void 0 : newDate.getTime())) {
|
|
14516
14360
|
setInnerDate(formatValue(newDate, startDate, endDate));
|
|
14517
14361
|
}
|
|
14518
14362
|
onChange === null || onChange === void 0 ? void 0 : onChange(selectedOptions, [
|
|
@@ -14525,8 +14369,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
14525
14369
|
var handleConfirmDateComparison = function(newDate) {
|
|
14526
14370
|
if (newDate && isDate(newDate)) {
|
|
14527
14371
|
var _this;
|
|
14528
|
-
|
|
14529
|
-
if (!isEqual2) {
|
|
14372
|
+
if (!isEqual$1((_this = new Date(selectedDate)) === null || _this === void 0 ? void 0 : _this.getTime(), newDate === null || newDate === void 0 ? void 0 : newDate.getTime())) {
|
|
14530
14373
|
setSelectedDate(formatValue(newDate, startDate, endDate));
|
|
14531
14374
|
}
|
|
14532
14375
|
}
|
|
@@ -14576,7 +14419,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
14576
14419
|
endDate
|
|
14577
14420
|
]);
|
|
14578
14421
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, typeof children === "function" && children(selectedDate), /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
14579
|
-
className:
|
|
14422
|
+
className: cls,
|
|
14580
14423
|
style
|
|
14581
14424
|
}, rest), pickerOptions.length && /* @__PURE__ */ React.createElement(Picker, _object_spread_props(_object_spread({}, pickerProps), {
|
|
14582
14425
|
title,
|
|
@@ -14594,6 +14437,98 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
14594
14437
|
}))));
|
|
14595
14438
|
};
|
|
14596
14439
|
var DatePicker = /* @__PURE__ */ React.forwardRef(InternalPicker);
|
|
14440
|
+
var currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
14441
|
+
var defaultProps$$ = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
14442
|
+
type: "date",
|
|
14443
|
+
showChinese: false,
|
|
14444
|
+
threeDimensional: true,
|
|
14445
|
+
minuteStep: 1,
|
|
14446
|
+
startDate: new Date(currentYear - 10, 0, 1),
|
|
14447
|
+
endDate: new Date(currentYear + 10, 11, 31)
|
|
14448
|
+
});
|
|
14449
|
+
var DatePickerView = function(props) {
|
|
14450
|
+
var _$_object_spread = _object_spread({}, defaultProps$$, props), startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, type2 = _$_object_spread.type, showChinese = _$_object_spread.showChinese, minuteStep = _$_object_spread.minuteStep, defaultValue = _$_object_spread.defaultValue, formatter = _$_object_spread.formatter, filter = _$_object_spread.filter, onChange = _$_object_spread.onChange, threeDimensional = _$_object_spread.threeDimensional, className = _$_object_spread.className, style = _$_object_spread.style;
|
|
14451
|
+
var classPrefix2 = "nut-datepickerview";
|
|
14452
|
+
var cls = classNames(classPrefix2, className);
|
|
14453
|
+
var locale = useConfig().locale;
|
|
14454
|
+
var lang = locale.datepicker;
|
|
14455
|
+
var zhCNType = {
|
|
14456
|
+
day: lang.day,
|
|
14457
|
+
year: lang.year,
|
|
14458
|
+
month: lang.month,
|
|
14459
|
+
hour: lang.hour,
|
|
14460
|
+
minute: lang.min,
|
|
14461
|
+
seconds: lang.seconds
|
|
14462
|
+
};
|
|
14463
|
+
var _useState = _sliced_to_array(React.useState([]), 2), pickerValue = _useState[0], setPickerValue = _useState[1];
|
|
14464
|
+
var _useState1 = _sliced_to_array(React.useState([]), 2), pickerOptions = _useState1[0], setPickerOptions = _useState1[1];
|
|
14465
|
+
var _usePropsValue = _sliced_to_array(usePropsValue({
|
|
14466
|
+
value: props.value && formatValue(props.value, startDate, endDate),
|
|
14467
|
+
defaultValue: defaultValue && formatValue(defaultValue, startDate, endDate),
|
|
14468
|
+
finalValue: 0
|
|
14469
|
+
}), 2), selectedDate = _usePropsValue[0], setSelectedDate = _usePropsValue[1];
|
|
14470
|
+
var handleDateComparison = function(newDate, selectedOptions, index2) {
|
|
14471
|
+
if (newDate && isDate(newDate)) {
|
|
14472
|
+
var _this;
|
|
14473
|
+
if (!isEqual$1((_this = new Date(selectedDate)) === null || _this === void 0 ? void 0 : _this.getTime(), newDate === null || newDate === void 0 ? void 0 : newDate.getTime())) {
|
|
14474
|
+
setSelectedDate(formatValue(newDate, startDate, endDate));
|
|
14475
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(selectedOptions, [
|
|
14476
|
+
String(newDate.getFullYear()),
|
|
14477
|
+
padZero(newDate.getMonth() + 1),
|
|
14478
|
+
padZero(newDate.getDate())
|
|
14479
|
+
], index2);
|
|
14480
|
+
}
|
|
14481
|
+
}
|
|
14482
|
+
};
|
|
14483
|
+
var handleChange = function(selectedOptions, selectedValue, index2) {
|
|
14484
|
+
handlePickerValueChange(selectedOptions, selectedValue, index2, type2, defaultValue || startDate || endDate, handleDateComparison);
|
|
14485
|
+
};
|
|
14486
|
+
var generatePickerColumns = function() {
|
|
14487
|
+
var dateRanges = generateDatePickerRanges(type2, selectedDate, startDate, endDate);
|
|
14488
|
+
var columns = dateRanges.map(function(rangeConfig, columnIndex) {
|
|
14489
|
+
var columnType = rangeConfig.type, range2 = rangeConfig.range;
|
|
14490
|
+
var selectedValue = getDatePartValue(columnType, selectedDate);
|
|
14491
|
+
var pickerColumn = generatePickerColumnWithCallback(range2[0], range2[1], selectedValue, columnType, minuteStep, function(selectedIndex, options2) {
|
|
14492
|
+
var _options_selectedIndex;
|
|
14493
|
+
pickerValue[columnIndex] = (_options_selectedIndex = options2[selectedIndex]) === null || _options_selectedIndex === void 0 ? void 0 : _options_selectedIndex.value;
|
|
14494
|
+
setPickerValue(_to_consumable_array(pickerValue));
|
|
14495
|
+
}, showChinese, zhCNType, formatter);
|
|
14496
|
+
if (filter === null || filter === void 0 ? void 0 : filter(columnType, pickerColumn)) {
|
|
14497
|
+
return filter(columnType, pickerColumn);
|
|
14498
|
+
}
|
|
14499
|
+
return pickerColumn;
|
|
14500
|
+
});
|
|
14501
|
+
return columns || [];
|
|
14502
|
+
};
|
|
14503
|
+
React.useEffect(function() {
|
|
14504
|
+
var _this, _this1;
|
|
14505
|
+
if (!isEqual$1((_this = new Date(selectedDate)) === null || _this === void 0 ? void 0 : _this.getTime(), (_this1 = new Date(selectedDate)) === null || _this1 === void 0 ? void 0 : _this1.getTime())) {
|
|
14506
|
+
setSelectedDate(selectedDate);
|
|
14507
|
+
}
|
|
14508
|
+
}, [
|
|
14509
|
+
selectedDate
|
|
14510
|
+
]);
|
|
14511
|
+
React.useEffect(function() {
|
|
14512
|
+
setPickerOptions(generatePickerColumns());
|
|
14513
|
+
}, [
|
|
14514
|
+
selectedDate,
|
|
14515
|
+
startDate,
|
|
14516
|
+
endDate
|
|
14517
|
+
]);
|
|
14518
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
14519
|
+
className: cls,
|
|
14520
|
+
style
|
|
14521
|
+
}, pickerOptions.length && /* @__PURE__ */ React.createElement(PickerView, {
|
|
14522
|
+
value: pickerValue,
|
|
14523
|
+
options: pickerOptions,
|
|
14524
|
+
onChange: function(param) {
|
|
14525
|
+
var selectedOptions = param.selectedOptions, value2 = param.value, index2 = param.index;
|
|
14526
|
+
handleChange(selectedOptions, value2, index2);
|
|
14527
|
+
},
|
|
14528
|
+
threeDimensional
|
|
14529
|
+
}));
|
|
14530
|
+
};
|
|
14531
|
+
DatePickerView.displayName = "NutDatePickerView";
|
|
14597
14532
|
var Context = React.createContext({});
|
|
14598
14533
|
function _extends() {
|
|
14599
14534
|
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
@@ -16750,7 +16685,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
16750
16685
|
parent2.updateTitle(text2, index2);
|
|
16751
16686
|
}
|
|
16752
16687
|
};
|
|
16753
|
-
var
|
|
16688
|
+
var handleClick = function(item) {
|
|
16754
16689
|
parent2.toggleMenuItem(index2);
|
|
16755
16690
|
setTitle(item.text);
|
|
16756
16691
|
setValue(item.value);
|
|
@@ -16845,7 +16780,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
16845
16780
|
flexBasis: "".concat(100 / columns, "%")
|
|
16846
16781
|
},
|
|
16847
16782
|
onClick: function() {
|
|
16848
|
-
|
|
16783
|
+
handleClick(item);
|
|
16849
16784
|
}
|
|
16850
16785
|
}, item.value === innerValue ? /* @__PURE__ */ React.createElement("i", {
|
|
16851
16786
|
className: "nut-menu-container-item-icon"
|
|
@@ -17308,7 +17243,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
17308
17243
|
var renderRadioItem = function() {
|
|
17309
17244
|
return renderByShape(context2 && context2.shape ? context2.shape : shape);
|
|
17310
17245
|
};
|
|
17311
|
-
var
|
|
17246
|
+
var handleClick = function(e2) {
|
|
17312
17247
|
if (disabled || checkedStatement) return;
|
|
17313
17248
|
setCheckedStatement(!checkedStatement);
|
|
17314
17249
|
};
|
|
@@ -17316,7 +17251,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
17316
17251
|
return /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
17317
17252
|
className: cls,
|
|
17318
17253
|
style,
|
|
17319
|
-
onClick:
|
|
17254
|
+
onClick: handleClick
|
|
17320
17255
|
}, rest), renderRadioItem());
|
|
17321
17256
|
};
|
|
17322
17257
|
Radio.displayName = "NutRadio";
|
|
@@ -18195,7 +18130,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18195
18130
|
var locale = useConfig().locale;
|
|
18196
18131
|
var _ref = _object_spread({}, defaultProps$O, props), title = _ref.title, description = _ref.description, tips = _ref.tips, outerVisible = _ref.visible, value2 = _ref.value, error = _ref.error, hideFooter = _ref.hideFooter, length2 = _ref.length, plain = _ref.plain, style = _ref.style, className = _ref.className;
|
|
18197
18132
|
_ref.closeable;
|
|
18198
|
-
var autoFocus = _ref.autoFocus, onFocus = _ref.onFocus, onChange = _ref.onChange, onConfirm = _ref.onConfirm, onTips = _ref.onTips, onCancel = _ref.onCancel, onClose = _ref.onClose, onComplete = _ref.onComplete;
|
|
18133
|
+
var autoFocus = _ref.autoFocus, round = _ref.round, onFocus = _ref.onFocus, onChange = _ref.onChange, onConfirm = _ref.onConfirm, onTips = _ref.onTips, onCancel = _ref.onCancel, onClose = _ref.onClose, onComplete = _ref.onComplete;
|
|
18199
18134
|
_ref.onOverlayClick;
|
|
18200
18135
|
_ref.onCloseIconClick;
|
|
18201
18136
|
var rest = _object_without_properties(_ref, [
|
|
@@ -18212,6 +18147,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18212
18147
|
"className",
|
|
18213
18148
|
"closeable",
|
|
18214
18149
|
"autoFocus",
|
|
18150
|
+
"round",
|
|
18215
18151
|
"onFocus",
|
|
18216
18152
|
"onChange",
|
|
18217
18153
|
"onConfirm",
|
|
@@ -18275,15 +18211,12 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18275
18211
|
onConfirm && onConfirm(inputValue);
|
|
18276
18212
|
};
|
|
18277
18213
|
return /* @__PURE__ */ React.createElement(Popup, _object_spread({
|
|
18278
|
-
|
|
18279
|
-
padding: "32px 24px 28px 24px",
|
|
18280
|
-
borderRadius: "12px",
|
|
18281
|
-
textAlign: "center"
|
|
18282
|
-
},
|
|
18214
|
+
className: "".concat(classPrefix2, "-popup"),
|
|
18283
18215
|
visible,
|
|
18284
18216
|
closeable: true,
|
|
18285
18217
|
onOverlayClick: handleClose,
|
|
18286
|
-
onCloseIconClick: handleClose
|
|
18218
|
+
onCloseIconClick: handleClose,
|
|
18219
|
+
round
|
|
18287
18220
|
}, rest), /* @__PURE__ */ React.createElement("div", {
|
|
18288
18221
|
className: classNames(classPrefix2, className),
|
|
18289
18222
|
style
|
|
@@ -19475,13 +19408,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19475
19408
|
className: classNames("".concat(classPrefix2, "-footer"), _define_property({}, footerDirection, footerDirection))
|
|
19476
19409
|
}, footer);
|
|
19477
19410
|
};
|
|
19478
|
-
var
|
|
19411
|
+
var handleClick = function(e2) {
|
|
19479
19412
|
onClick && onClick(e2);
|
|
19480
19413
|
};
|
|
19481
19414
|
return /* @__PURE__ */ React.createElement("div", {
|
|
19482
19415
|
className: classNames("".concat(classPrefix2, "-outer"), className),
|
|
19483
19416
|
style,
|
|
19484
|
-
onClick:
|
|
19417
|
+
onClick: handleClick
|
|
19485
19418
|
}, close, header, /* @__PURE__ */ React.createElement("div", {
|
|
19486
19419
|
className: classPrefix2,
|
|
19487
19420
|
style: {
|
|
@@ -19539,6 +19472,9 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19539
19472
|
unmountOnExit: true,
|
|
19540
19473
|
appear: true
|
|
19541
19474
|
}, /* @__PURE__ */ React.createElement(Content, _object_spread_props(_object_spread({}, restProps), {
|
|
19475
|
+
style: {
|
|
19476
|
+
zIndex
|
|
19477
|
+
},
|
|
19542
19478
|
visible
|
|
19543
19479
|
}))));
|
|
19544
19480
|
};
|
|
@@ -19911,59 +19847,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19911
19847
|
};
|
|
19912
19848
|
Empty.displayName = "NutEmpty";
|
|
19913
19849
|
var defaultProps$E = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
19914
|
-
title: null,
|
|
19915
|
-
description: null,
|
|
19916
|
-
icon: "",
|
|
19917
|
-
status: "info",
|
|
19918
|
-
actions: []
|
|
19919
|
-
});
|
|
19920
|
-
var ResultPage = function(props) {
|
|
19921
|
-
var _$_object_spread = _object_spread({}, defaultProps$E, props), className = _$_object_spread.className, style = _$_object_spread.style, title = _$_object_spread.title, description = _$_object_spread.description, icon = _$_object_spread.icon, status = _$_object_spread.status, actions = _$_object_spread.actions, children = _$_object_spread.children;
|
|
19922
|
-
var classPrefix2 = "nut-resultpage";
|
|
19923
|
-
var cls = classNames(classPrefix2, className);
|
|
19924
|
-
var defaultStatus2 = {
|
|
19925
|
-
success: /* @__PURE__ */ React.createElement(m$1, {
|
|
19926
|
-
color: "#00D900"
|
|
19927
|
-
}),
|
|
19928
|
-
error: /* @__PURE__ */ React.createElement(n$4, {
|
|
19929
|
-
color: "#FF0F23"
|
|
19930
|
-
}),
|
|
19931
|
-
warning: /* @__PURE__ */ React.createElement(c, {
|
|
19932
|
-
color: "#FFBF00"
|
|
19933
|
-
}),
|
|
19934
|
-
info: /* @__PURE__ */ React.createElement(p$2, {
|
|
19935
|
-
color: "#0073FF"
|
|
19936
|
-
}),
|
|
19937
|
-
waiting: /* @__PURE__ */ React.createElement(n$a, {
|
|
19938
|
-
color: "#0073FF"
|
|
19939
|
-
})
|
|
19940
|
-
};
|
|
19941
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
19942
|
-
className: cls,
|
|
19943
|
-
style
|
|
19944
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
19945
|
-
className: "".concat(classPrefix2, "-icon")
|
|
19946
|
-
}, icon || defaultStatus2[status]), typeof title === "string" && title ? /* @__PURE__ */ React.createElement("div", {
|
|
19947
|
-
className: "".concat(classPrefix2, "-title")
|
|
19948
|
-
}, title) : title, typeof description === "string" && description ? /* @__PURE__ */ React.createElement("div", {
|
|
19949
|
-
className: "".concat(classPrefix2, "-description")
|
|
19950
|
-
}, description) : description, actions.length ? /* @__PURE__ */ React.createElement("div", {
|
|
19951
|
-
className: "".concat(classPrefix2, "-actions")
|
|
19952
|
-
}, actions.map(function(action, index2) {
|
|
19953
|
-
action.text;
|
|
19954
|
-
var rest = _object_without_properties(action, [
|
|
19955
|
-
"text"
|
|
19956
|
-
]);
|
|
19957
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
19958
|
-
className: "".concat(classPrefix2, "-action"),
|
|
19959
|
-
key: index2
|
|
19960
|
-
}, /* @__PURE__ */ React.createElement(Button, _object_spread_props(_object_spread({}, rest), {
|
|
19961
|
-
size: "large"
|
|
19962
|
-
}), action === null || action === void 0 ? void 0 : action.text));
|
|
19963
|
-
})) : null, children);
|
|
19964
|
-
};
|
|
19965
|
-
ResultPage.displayName = "NutResultPage";
|
|
19966
|
-
var defaultProps$D = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
19967
19850
|
type: "default",
|
|
19968
19851
|
hasMore: true,
|
|
19969
19852
|
threshold: 200,
|
|
@@ -19983,7 +19866,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19983
19866
|
return null;
|
|
19984
19867
|
};
|
|
19985
19868
|
var locale = useConfig().locale;
|
|
19986
|
-
var _ref = _object_spread({}, defaultProps$
|
|
19869
|
+
var _ref = _object_spread({}, defaultProps$E, props), children = _ref.children, type2 = _ref.type, hasMore = _ref.hasMore, threshold = _ref.threshold, target = _ref.target, capture = _ref.capture, pullRefresh = _ref.pullRefresh, pullingText = _ref.pullingText, loadingText = _ref.loadingText, loadMoreText = _ref.loadMoreText, className = _ref.className, onRefresh = _ref.onRefresh, onLoadMore = _ref.onLoadMore, onScroll = _ref.onScroll, restProps = _object_without_properties(_ref, [
|
|
19987
19870
|
"children",
|
|
19988
19871
|
"type",
|
|
19989
19872
|
"hasMore",
|
|
@@ -36989,7 +36872,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
36989
36872
|
circular: d$3,
|
|
36990
36873
|
spinner: s
|
|
36991
36874
|
};
|
|
36992
|
-
var defaultProps$
|
|
36875
|
+
var defaultProps$D = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
36993
36876
|
// 对比一下,个人感觉还是Loading1比较好看一些,所以用它作为了默认的loading图标
|
|
36994
36877
|
type: "circular",
|
|
36995
36878
|
direction: "horizontal",
|
|
@@ -37000,7 +36883,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37000
36883
|
autoplay: true
|
|
37001
36884
|
};
|
|
37002
36885
|
var Loading = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
37003
|
-
var _ref = _object_spread({}, defaultProps$
|
|
36886
|
+
var _ref = _object_spread({}, defaultProps$D, props), className = _ref.className, style = _ref.style, children = _ref.children, direction = _ref.direction, icon = _ref.icon, lottieProps = _ref.lottieProps, rest = _object_without_properties(_ref, [
|
|
37004
36887
|
"className",
|
|
37005
36888
|
"style",
|
|
37006
36889
|
"children",
|
|
@@ -37043,7 +36926,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37043
36926
|
}, children) : null);
|
|
37044
36927
|
});
|
|
37045
36928
|
Loading.displayName = "NutLoading";
|
|
37046
|
-
var defaultProps$
|
|
36929
|
+
var defaultProps$C = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
37047
36930
|
align: "left",
|
|
37048
36931
|
direction: "horizontal",
|
|
37049
36932
|
list: [],
|
|
@@ -37064,7 +36947,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37064
36947
|
});
|
|
37065
36948
|
var NoticeBar = function(props) {
|
|
37066
36949
|
var rtl = useRtl();
|
|
37067
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
36950
|
+
var _$_object_spread = _object_spread({}, defaultProps$C, props), children = _$_object_spread.children, className = _$_object_spread.className, style = _$_object_spread.style, align = _$_object_spread.align, direction = _$_object_spread.direction, list = _$_object_spread.list, duration = _$_object_spread.duration, height2 = _$_object_spread.height, content2 = _$_object_spread.content, closeable = _$_object_spread.closeable, wrap = _$_object_spread.wrap, leftIcon = _$_object_spread.leftIcon, rightIcon = _$_object_spread.rightIcon, right = _$_object_spread.right, delay = _$_object_spread.delay, scrollable = _$_object_spread.scrollable, speed = _$_object_spread.speed, close = _$_object_spread.close, click = _$_object_spread.click, onClose = _$_object_spread.onClose, onClick = _$_object_spread.onClick, onItemClick = _$_object_spread.onItemClick;
|
|
37068
36951
|
var classPrefix2 = "nut-noticebar";
|
|
37069
36952
|
var wrapRef = React.useRef(null);
|
|
37070
36953
|
var contentRef = React.useRef(null);
|
|
@@ -37165,7 +37048,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37165
37048
|
}
|
|
37166
37049
|
}, 0);
|
|
37167
37050
|
};
|
|
37168
|
-
var
|
|
37051
|
+
var handleClick = function(event) {
|
|
37169
37052
|
click && click(event);
|
|
37170
37053
|
onClick && onClick(event);
|
|
37171
37054
|
};
|
|
@@ -37374,7 +37257,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37374
37257
|
}, showNoticeBar && direction === "horizontal" ? /* @__PURE__ */ React.createElement("div", {
|
|
37375
37258
|
className: noticebarClass,
|
|
37376
37259
|
style: barStyle,
|
|
37377
|
-
onClick:
|
|
37260
|
+
onClick: handleClick
|
|
37378
37261
|
}, leftIcon ? /* @__PURE__ */ React.createElement("div", {
|
|
37379
37262
|
className: "nut-noticebar-box-left-icon"
|
|
37380
37263
|
}, leftIcon) : null, /* @__PURE__ */ React.createElement("div", {
|
|
@@ -37397,7 +37280,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37397
37280
|
className: "nut-noticebar-vertical",
|
|
37398
37281
|
style: barStyle,
|
|
37399
37282
|
ref: container,
|
|
37400
|
-
onClick:
|
|
37283
|
+
onClick: handleClick
|
|
37401
37284
|
}, leftIcon ? /* @__PURE__ */ React.createElement("div", {
|
|
37402
37285
|
className: "nut-noticebar-box-left-icon"
|
|
37403
37286
|
}, leftIcon) : null, children ? /* @__PURE__ */ React.createElement("div", {
|
|
@@ -37641,7 +37524,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37641
37524
|
}
|
|
37642
37525
|
}
|
|
37643
37526
|
};
|
|
37644
|
-
var defaultProps$
|
|
37527
|
+
var defaultProps$B = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
37645
37528
|
list: [],
|
|
37646
37529
|
theme: "light",
|
|
37647
37530
|
location: "bottom",
|
|
@@ -37666,7 +37549,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37666
37549
|
var classPrefix$b = "nut-popover";
|
|
37667
37550
|
var Popover = function(props) {
|
|
37668
37551
|
var rtl = useRtl();
|
|
37669
|
-
var _ref = _object_spread({}, defaultProps$
|
|
37552
|
+
var _ref = _object_spread({}, defaultProps$B, props), children = _ref.children, list = _ref.list, theme = _ref.theme, location = _ref.location, visible = _ref.visible, offset = _ref.offset, arrowOffset = _ref.arrowOffset, targetId = _ref.targetId, overlay = _ref.overlay, closeOnOutsideClick = _ref.closeOnOutsideClick, closeOnActionClick = _ref.closeOnActionClick, className = _ref.className, showArrow = _ref.showArrow, style = _ref.style, onClick = _ref.onClick, onOpen = _ref.onOpen, onClose = _ref.onClose, onSelect = _ref.onSelect, rest = _object_without_properties(_ref, [
|
|
37670
37553
|
"children",
|
|
37671
37554
|
"list",
|
|
37672
37555
|
"theme",
|
|
@@ -37939,7 +37822,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37939
37822
|
return setTimeout(resolve, time2);
|
|
37940
37823
|
});
|
|
37941
37824
|
};
|
|
37942
|
-
var defaultProps$
|
|
37825
|
+
var defaultProps$A = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
37943
37826
|
type: "default",
|
|
37944
37827
|
pullingText: "",
|
|
37945
37828
|
canReleaseText: "",
|
|
@@ -37958,7 +37841,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37958
37841
|
};
|
|
37959
37842
|
var classPrefix2 = "nut-pulltorefresh";
|
|
37960
37843
|
var locale = useConfig().locale;
|
|
37961
|
-
var props = _object_spread({}, defaultProps$
|
|
37844
|
+
var props = _object_spread({}, defaultProps$A, p2, {
|
|
37962
37845
|
pullingText: p2.pullingText || locale.pullToRefresh.pullingText,
|
|
37963
37846
|
canReleaseText: p2.canReleaseText || locale.pullToRefresh.canReleaseText,
|
|
37964
37847
|
refreshingText: p2.refreshingText || locale.pullToRefresh.refreshingText,
|
|
@@ -38193,6 +38076,59 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38193
38076
|
}, props.children));
|
|
38194
38077
|
};
|
|
38195
38078
|
PullToRefresh.displayName = "NutPullToRefresh";
|
|
38079
|
+
var defaultProps$z = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
38080
|
+
title: null,
|
|
38081
|
+
description: null,
|
|
38082
|
+
icon: "",
|
|
38083
|
+
status: "info",
|
|
38084
|
+
actions: []
|
|
38085
|
+
});
|
|
38086
|
+
var ResultPage = function(props) {
|
|
38087
|
+
var _$_object_spread = _object_spread({}, defaultProps$z, props), className = _$_object_spread.className, style = _$_object_spread.style, title = _$_object_spread.title, description = _$_object_spread.description, icon = _$_object_spread.icon, status = _$_object_spread.status, actions = _$_object_spread.actions, children = _$_object_spread.children;
|
|
38088
|
+
var classPrefix2 = "nut-resultpage";
|
|
38089
|
+
var cls = classNames(classPrefix2, className);
|
|
38090
|
+
var defaultStatus2 = {
|
|
38091
|
+
success: /* @__PURE__ */ React.createElement(m$1, {
|
|
38092
|
+
color: "#00D900"
|
|
38093
|
+
}),
|
|
38094
|
+
error: /* @__PURE__ */ React.createElement(n$4, {
|
|
38095
|
+
color: "#FF0F23"
|
|
38096
|
+
}),
|
|
38097
|
+
warning: /* @__PURE__ */ React.createElement(c, {
|
|
38098
|
+
color: "#FFBF00"
|
|
38099
|
+
}),
|
|
38100
|
+
info: /* @__PURE__ */ React.createElement(p$2, {
|
|
38101
|
+
color: "#0073FF"
|
|
38102
|
+
}),
|
|
38103
|
+
waiting: /* @__PURE__ */ React.createElement(n$a, {
|
|
38104
|
+
color: "#0073FF"
|
|
38105
|
+
})
|
|
38106
|
+
};
|
|
38107
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
38108
|
+
className: cls,
|
|
38109
|
+
style
|
|
38110
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
38111
|
+
className: "".concat(classPrefix2, "-icon")
|
|
38112
|
+
}, icon || defaultStatus2[status]), typeof title === "string" && title ? /* @__PURE__ */ React.createElement("div", {
|
|
38113
|
+
className: "".concat(classPrefix2, "-title")
|
|
38114
|
+
}, title) : title, typeof description === "string" && description ? /* @__PURE__ */ React.createElement("div", {
|
|
38115
|
+
className: "".concat(classPrefix2, "-description")
|
|
38116
|
+
}, description) : description, actions.length ? /* @__PURE__ */ React.createElement("div", {
|
|
38117
|
+
className: "".concat(classPrefix2, "-actions")
|
|
38118
|
+
}, actions.map(function(action, index2) {
|
|
38119
|
+
action.text;
|
|
38120
|
+
var rest = _object_without_properties(action, [
|
|
38121
|
+
"text"
|
|
38122
|
+
]);
|
|
38123
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
38124
|
+
className: "".concat(classPrefix2, "-action"),
|
|
38125
|
+
key: index2
|
|
38126
|
+
}, /* @__PURE__ */ React.createElement(Button, _object_spread_props(_object_spread({}, rest), {
|
|
38127
|
+
size: "large"
|
|
38128
|
+
}), action === null || action === void 0 ? void 0 : action.text));
|
|
38129
|
+
})) : null, children);
|
|
38130
|
+
};
|
|
38131
|
+
ResultPage.displayName = "NutResultPage";
|
|
38196
38132
|
var AvatarContext = React.createContext({});
|
|
38197
38133
|
var defaultProps$y = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
38198
38134
|
maxContent: "",
|
|
@@ -38862,7 +38798,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38862
38798
|
var classes = classNames((_obj = {
|
|
38863
38799
|
"nut-ani-container": true
|
|
38864
38800
|
}, _define_property(_obj, "".concat(classPrefix$7, "-").concat(type2), action === "initial" || clicked), _define_property(_obj, "loop", loop2), _obj), className);
|
|
38865
|
-
var
|
|
38801
|
+
var handleClick = function(event) {
|
|
38866
38802
|
setClicked(true);
|
|
38867
38803
|
if (!loop2) {
|
|
38868
38804
|
setTimeout(function() {
|
|
@@ -38875,7 +38811,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38875
38811
|
className: "nut-animate"
|
|
38876
38812
|
}, /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
38877
38813
|
className: classes,
|
|
38878
|
-
onClick:
|
|
38814
|
+
onClick: handleClick
|
|
38879
38815
|
}, rest), children));
|
|
38880
38816
|
};
|
|
38881
38817
|
Animate.displayName = "NutAnimate";
|
|
@@ -39391,7 +39327,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
39391
39327
|
expanded,
|
|
39392
39328
|
rotate
|
|
39393
39329
|
]);
|
|
39394
|
-
var
|
|
39330
|
+
var handleClick = function() {
|
|
39395
39331
|
if (!disabled) {
|
|
39396
39332
|
context2.updateValue(name2);
|
|
39397
39333
|
}
|
|
@@ -39442,7 +39378,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
39442
39378
|
className: classNames("".concat(classPrefix2, "-header"), {
|
|
39443
39379
|
disabled
|
|
39444
39380
|
}),
|
|
39445
|
-
onClick:
|
|
39381
|
+
onClick: handleClick
|
|
39446
39382
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
39447
39383
|
className: "".concat(classPrefix2, "-title")
|
|
39448
39384
|
}, title), /* @__PURE__ */ React.createElement("div", {
|
|
@@ -39921,12 +39857,12 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
39921
39857
|
onChange && onChange("collapse");
|
|
39922
39858
|
}
|
|
39923
39859
|
};
|
|
39924
|
-
var
|
|
39860
|
+
var handleClick = function() {
|
|
39925
39861
|
onClick && onClick();
|
|
39926
39862
|
};
|
|
39927
39863
|
return /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
39928
39864
|
className: classes,
|
|
39929
|
-
onClick:
|
|
39865
|
+
onClick: handleClick,
|
|
39930
39866
|
ref: root2
|
|
39931
39867
|
}, rest), !exceeded ? content2 : null, exceeded && !expanded ? /* @__PURE__ */ React.createElement("span", null, (_ellipsis_current = ellipsis.current) === null || _ellipsis_current === void 0 ? void 0 : _ellipsis_current.leading, expandText ? /* @__PURE__ */ React.createElement("span", {
|
|
39932
39868
|
className: "nut-ellipsis-text",
|
|
@@ -40811,63 +40747,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
40811
40747
|
}, pageCount)));
|
|
40812
40748
|
};
|
|
40813
40749
|
Pagination.displayName = "NutPagination";
|
|
40814
|
-
var defaultProps$e = {
|
|
40815
|
-
options: [],
|
|
40816
|
-
onChange: function(value2) {
|
|
40817
|
-
}
|
|
40818
|
-
};
|
|
40819
|
-
var Segmented = function(props) {
|
|
40820
|
-
var classPrefix2 = "nut-segmented";
|
|
40821
|
-
var itemClassPrefix = "nut-segmented-item";
|
|
40822
|
-
var mergedProps = mergeProps(defaultProps$e, props);
|
|
40823
|
-
var options2 = mergedProps.options;
|
|
40824
|
-
mergedProps.onChange;
|
|
40825
|
-
var _usePropsValue = _sliced_to_array(usePropsValue({
|
|
40826
|
-
value: mergedProps.value,
|
|
40827
|
-
defaultValue: mergedProps.defaultValue,
|
|
40828
|
-
finalValue: 0,
|
|
40829
|
-
onChange: mergedProps.onChange
|
|
40830
|
-
}), 2), value2 = _usePropsValue[0], setValue = _usePropsValue[1];
|
|
40831
|
-
var renderItems = React.useCallback(function(options3, value3) {
|
|
40832
|
-
return options3.map(function(option, index2) {
|
|
40833
|
-
var optionType = typeof option === "undefined" ? "undefined" : _type_of(option);
|
|
40834
|
-
switch (optionType) {
|
|
40835
|
-
case "object":
|
|
40836
|
-
var opt = option;
|
|
40837
|
-
var _obj;
|
|
40838
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
40839
|
-
className: classNames(itemClassPrefix, (_obj = {}, _define_property(_obj, "".concat(itemClassPrefix, "-active"), opt.value === value3), _define_property(_obj, "".concat(opt.className), !!opt.className), _obj)),
|
|
40840
|
-
key: opt.value,
|
|
40841
|
-
onClick: function() {
|
|
40842
|
-
if (opt.disabled) return;
|
|
40843
|
-
setValue(opt.value);
|
|
40844
|
-
}
|
|
40845
|
-
}, opt.icon ? /* @__PURE__ */ React.createElement("span", {
|
|
40846
|
-
className: "nut-segmented-icon"
|
|
40847
|
-
}, opt.icon) : null, opt.label);
|
|
40848
|
-
default: {
|
|
40849
|
-
if (typeof option !== "string" && typeof option !== "number") {
|
|
40850
|
-
console.warn("Unsupported option type:", optionType);
|
|
40851
|
-
}
|
|
40852
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
40853
|
-
className: classNames(itemClassPrefix, _define_property({}, "".concat(itemClassPrefix, "-active"), index2 === value3)),
|
|
40854
|
-
key: option.toString(),
|
|
40855
|
-
onClick: function() {
|
|
40856
|
-
setValue(index2);
|
|
40857
|
-
}
|
|
40858
|
-
}, option);
|
|
40859
|
-
}
|
|
40860
|
-
}
|
|
40861
|
-
});
|
|
40862
|
-
}, [
|
|
40863
|
-
value2
|
|
40864
|
-
]);
|
|
40865
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
40866
|
-
className: classNames(classPrefix2),
|
|
40867
|
-
style: mergedProps.style
|
|
40868
|
-
}, renderItems(options2, value2));
|
|
40869
|
-
};
|
|
40870
|
-
var defaultProps$d = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
40750
|
+
var defaultProps$e = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
40871
40751
|
color: "primary",
|
|
40872
40752
|
price: 0,
|
|
40873
40753
|
symbol: "¥",
|
|
@@ -40878,7 +40758,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
40878
40758
|
line: false
|
|
40879
40759
|
});
|
|
40880
40760
|
var Price = function(props) {
|
|
40881
|
-
var _ref = _object_spread({}, defaultProps$
|
|
40761
|
+
var _ref = _object_spread({}, defaultProps$e, props), color = _ref.color, price = _ref.price, symbol = _ref.symbol, digits = _ref.digits, thousands = _ref.thousands, position2 = _ref.position, size = _ref.size, line = _ref.line, className = _ref.className, style = _ref.style, rest = _object_without_properties(_ref, [
|
|
40882
40762
|
"color",
|
|
40883
40763
|
"price",
|
|
40884
40764
|
"symbol",
|
|
@@ -40947,6 +40827,62 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
40947
40827
|
}, formatDecimal(price))) : null, symbol && position2 === "after" ? renderSymbol() : null);
|
|
40948
40828
|
};
|
|
40949
40829
|
Price.displayName = "NutPrice";
|
|
40830
|
+
var defaultProps$d = {
|
|
40831
|
+
options: [],
|
|
40832
|
+
onChange: function(value2) {
|
|
40833
|
+
}
|
|
40834
|
+
};
|
|
40835
|
+
var Segmented = function(props) {
|
|
40836
|
+
var classPrefix2 = "nut-segmented";
|
|
40837
|
+
var itemClassPrefix = "nut-segmented-item";
|
|
40838
|
+
var mergedProps = mergeProps(defaultProps$d, props);
|
|
40839
|
+
var options2 = mergedProps.options;
|
|
40840
|
+
mergedProps.onChange;
|
|
40841
|
+
var _usePropsValue = _sliced_to_array(usePropsValue({
|
|
40842
|
+
value: mergedProps.value,
|
|
40843
|
+
defaultValue: mergedProps.defaultValue,
|
|
40844
|
+
finalValue: 0,
|
|
40845
|
+
onChange: mergedProps.onChange
|
|
40846
|
+
}), 2), value2 = _usePropsValue[0], setValue = _usePropsValue[1];
|
|
40847
|
+
var renderItems = React.useCallback(function(options3, value3) {
|
|
40848
|
+
return options3.map(function(option, index2) {
|
|
40849
|
+
var optionType = typeof option === "undefined" ? "undefined" : _type_of(option);
|
|
40850
|
+
switch (optionType) {
|
|
40851
|
+
case "object":
|
|
40852
|
+
var opt = option;
|
|
40853
|
+
var _obj;
|
|
40854
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
40855
|
+
className: classNames(itemClassPrefix, (_obj = {}, _define_property(_obj, "".concat(itemClassPrefix, "-active"), opt.value === value3), _define_property(_obj, "".concat(opt.className), !!opt.className), _obj)),
|
|
40856
|
+
key: opt.value,
|
|
40857
|
+
onClick: function() {
|
|
40858
|
+
if (opt.disabled) return;
|
|
40859
|
+
setValue(opt.value);
|
|
40860
|
+
}
|
|
40861
|
+
}, opt.icon ? /* @__PURE__ */ React.createElement("span", {
|
|
40862
|
+
className: "nut-segmented-icon"
|
|
40863
|
+
}, opt.icon) : null, opt.label);
|
|
40864
|
+
default: {
|
|
40865
|
+
if (typeof option !== "string" && typeof option !== "number") {
|
|
40866
|
+
console.warn("Unsupported option type:", optionType);
|
|
40867
|
+
}
|
|
40868
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
40869
|
+
className: classNames(itemClassPrefix, _define_property({}, "".concat(itemClassPrefix, "-active"), index2 === value3)),
|
|
40870
|
+
key: option.toString(),
|
|
40871
|
+
onClick: function() {
|
|
40872
|
+
setValue(index2);
|
|
40873
|
+
}
|
|
40874
|
+
}, option);
|
|
40875
|
+
}
|
|
40876
|
+
}
|
|
40877
|
+
});
|
|
40878
|
+
}, [
|
|
40879
|
+
value2
|
|
40880
|
+
]);
|
|
40881
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
40882
|
+
className: classNames(classPrefix2),
|
|
40883
|
+
style: mergedProps.style
|
|
40884
|
+
}, renderItems(options2, value2));
|
|
40885
|
+
};
|
|
40950
40886
|
var DataContext = React.createContext({});
|
|
40951
40887
|
var defaultProps$c = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
40952
40888
|
title: "",
|
|
@@ -41278,7 +41214,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
41278
41214
|
var classPrefix2 = "nut-tag";
|
|
41279
41215
|
var _obj;
|
|
41280
41216
|
var classes = classNames((_obj = {}, _define_property(_obj, classPrefix2, true), _define_property(_obj, "".concat(classPrefix2, "-").concat(type2), type2), _define_property(_obj, "".concat(classPrefix2, "-plain"), plain), _define_property(_obj, "".concat(classPrefix2, "-round"), round), _define_property(_obj, "".concat(classPrefix2, "-mark"), mark), _define_property(_obj, "".concat(classPrefix2, "-close"), closeable), _define_property(_obj, "".concat(className), className), _obj));
|
|
41281
|
-
var
|
|
41217
|
+
var handleClick = function(e2) {
|
|
41282
41218
|
onClick && onClick(e2);
|
|
41283
41219
|
};
|
|
41284
41220
|
var getStyle = function() {
|
|
@@ -41304,7 +41240,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
41304
41240
|
className: classes,
|
|
41305
41241
|
style: _object_spread({}, style, getStyle()),
|
|
41306
41242
|
onClick: function(e2) {
|
|
41307
|
-
return
|
|
41243
|
+
return handleClick(e2);
|
|
41308
41244
|
}
|
|
41309
41245
|
}, children && /* @__PURE__ */ React.createElement("span", {
|
|
41310
41246
|
className: textClasses,
|
|
@@ -41326,7 +41262,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
41326
41262
|
className: classes,
|
|
41327
41263
|
style: _object_spread({}, style, getStyle()),
|
|
41328
41264
|
onClick: function(e2) {
|
|
41329
|
-
return
|
|
41265
|
+
return handleClick(e2);
|
|
41330
41266
|
}
|
|
41331
41267
|
}, children && /* @__PURE__ */ React.createElement("span", {
|
|
41332
41268
|
className: textClasses,
|
|
@@ -41808,6 +41744,446 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
41808
41744
|
};
|
|
41809
41745
|
VirtualList.displayName = "NutVirtualList";
|
|
41810
41746
|
var defaultProps$6 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
41747
|
+
maxZoom: 3,
|
|
41748
|
+
space: 10,
|
|
41749
|
+
toolbar: [
|
|
41750
|
+
/* @__PURE__ */ React.createElement(Button, {
|
|
41751
|
+
type: "danger",
|
|
41752
|
+
key: "cancel"
|
|
41753
|
+
}, "Cancel"),
|
|
41754
|
+
/* @__PURE__ */ React.createElement(Button, {
|
|
41755
|
+
key: "reset"
|
|
41756
|
+
}, "Reset"),
|
|
41757
|
+
/* @__PURE__ */ React.createElement(Button, {
|
|
41758
|
+
key: "rotate"
|
|
41759
|
+
}, "Rotate"),
|
|
41760
|
+
/* @__PURE__ */ React.createElement(Button, {
|
|
41761
|
+
type: "success",
|
|
41762
|
+
key: "confirm"
|
|
41763
|
+
}, "Confirm")
|
|
41764
|
+
],
|
|
41765
|
+
toolbarPosition: "bottom",
|
|
41766
|
+
editText: "Edit",
|
|
41767
|
+
shape: "square"
|
|
41768
|
+
});
|
|
41769
|
+
var classPrefix$1 = "nut-avatar-cropper";
|
|
41770
|
+
var AvatarCropper = function(props) {
|
|
41771
|
+
var locale = useConfig().locale;
|
|
41772
|
+
defaultProps$6.toolbar = [
|
|
41773
|
+
/* @__PURE__ */ React.createElement(Button, {
|
|
41774
|
+
type: "danger",
|
|
41775
|
+
key: "cancel"
|
|
41776
|
+
}, locale.cancel),
|
|
41777
|
+
/* @__PURE__ */ React.createElement(Button, {
|
|
41778
|
+
key: "reset"
|
|
41779
|
+
}, locale.reset),
|
|
41780
|
+
/* @__PURE__ */ React.createElement(Button, {
|
|
41781
|
+
key: "rotate"
|
|
41782
|
+
}, locale.avatarCropper.rotate),
|
|
41783
|
+
/* @__PURE__ */ React.createElement(Button, {
|
|
41784
|
+
type: "success",
|
|
41785
|
+
key: "confirm"
|
|
41786
|
+
}, locale.confirm)
|
|
41787
|
+
];
|
|
41788
|
+
var _ref = _object_spread({}, defaultProps$6, props), children = _ref.children, maxZoom = _ref.maxZoom, space = _ref.space, toolbar = _ref.toolbar, toolbarPosition = _ref.toolbarPosition, editText = _ref.editText, shape = _ref.shape, className = _ref.className, style = _ref.style, onConfirm = _ref.onConfirm, onCancel = _ref.onCancel, rest = _object_without_properties(_ref, [
|
|
41789
|
+
"children",
|
|
41790
|
+
"maxZoom",
|
|
41791
|
+
"space",
|
|
41792
|
+
"toolbar",
|
|
41793
|
+
"toolbarPosition",
|
|
41794
|
+
"editText",
|
|
41795
|
+
"shape",
|
|
41796
|
+
"className",
|
|
41797
|
+
"style",
|
|
41798
|
+
"onConfirm",
|
|
41799
|
+
"onCancel"
|
|
41800
|
+
]);
|
|
41801
|
+
var cls = classNames(classPrefix$1, className, shape === "round" && "round");
|
|
41802
|
+
var toolbarPositionCls = classNames("".concat(classPrefix$1, "-popup-toolbar"), toolbarPosition);
|
|
41803
|
+
var inputImageRef = React.useRef(null);
|
|
41804
|
+
var cropperPopupRef = React.useRef(null);
|
|
41805
|
+
var canvasRef = React.useRef(null);
|
|
41806
|
+
var _useState = _sliced_to_array(React.useState(false), 2), visible = _useState[0], setVisible = _useState[1];
|
|
41807
|
+
var _useState1 = _sliced_to_array(React.useState(false), 2), moving = _useState1[0], setMoving = _useState1[1];
|
|
41808
|
+
var _useState2 = _sliced_to_array(React.useState(false), 2), zooming = _useState2[0], setZooming = _useState2[1];
|
|
41809
|
+
var _useState3 = _sliced_to_array(React.useState({
|
|
41810
|
+
defScale: 1,
|
|
41811
|
+
scale: 1,
|
|
41812
|
+
angle: 0,
|
|
41813
|
+
moveX: 0,
|
|
41814
|
+
moveY: 0,
|
|
41815
|
+
displayWidth: 0,
|
|
41816
|
+
displayHeight: 0
|
|
41817
|
+
}), 2), state = _useState3[0], setState = _useState3[1];
|
|
41818
|
+
var defDrawImage = {
|
|
41819
|
+
img: new Image(),
|
|
41820
|
+
sx: 0,
|
|
41821
|
+
sy: 0,
|
|
41822
|
+
swidth: 0,
|
|
41823
|
+
sheight: 0,
|
|
41824
|
+
x: 0,
|
|
41825
|
+
y: 0,
|
|
41826
|
+
width: 0,
|
|
41827
|
+
height: 0
|
|
41828
|
+
};
|
|
41829
|
+
var _useState4 = _sliced_to_array(React.useState(_object_spread({}, defDrawImage)), 2), drawImage = _useState4[0], setDrawImg = _useState4[1];
|
|
41830
|
+
var devicePixelRatio = window.devicePixelRatio || 1;
|
|
41831
|
+
var touch = useTouch();
|
|
41832
|
+
var highlightStyle = React.useMemo(function() {
|
|
41833
|
+
var width2 = "".concat(drawImage.swidth / devicePixelRatio, "px");
|
|
41834
|
+
var height2 = width2;
|
|
41835
|
+
return {
|
|
41836
|
+
width: width2,
|
|
41837
|
+
height: height2,
|
|
41838
|
+
borderRadius: shape === "round" ? "50%" : ""
|
|
41839
|
+
};
|
|
41840
|
+
}, [
|
|
41841
|
+
devicePixelRatio,
|
|
41842
|
+
drawImage.swidth
|
|
41843
|
+
]);
|
|
41844
|
+
var isAngle = React.useMemo(function() {
|
|
41845
|
+
return state.angle === 90 || state.angle === 270;
|
|
41846
|
+
}, [
|
|
41847
|
+
state.angle
|
|
41848
|
+
]);
|
|
41849
|
+
var maxMoveX = React.useMemo(function() {
|
|
41850
|
+
var swidth = drawImage.swidth, height2 = drawImage.height;
|
|
41851
|
+
if (isAngle) {
|
|
41852
|
+
return Math.max(0, (height2 * state.scale - swidth) / 2);
|
|
41853
|
+
}
|
|
41854
|
+
return Math.max(0, (state.displayWidth * state.scale - swidth) / 2);
|
|
41855
|
+
}, [
|
|
41856
|
+
state.scale,
|
|
41857
|
+
state.displayWidth,
|
|
41858
|
+
drawImage,
|
|
41859
|
+
isAngle
|
|
41860
|
+
]);
|
|
41861
|
+
var maxMoveY = React.useMemo(function() {
|
|
41862
|
+
var swidth = drawImage.swidth, height2 = drawImage.height;
|
|
41863
|
+
if (isAngle) {
|
|
41864
|
+
return Math.max(0, (state.displayWidth * state.scale - swidth) / 2);
|
|
41865
|
+
}
|
|
41866
|
+
return Math.max(0, (height2 * state.scale - swidth) / 2);
|
|
41867
|
+
}, [
|
|
41868
|
+
state.scale,
|
|
41869
|
+
state.displayWidth,
|
|
41870
|
+
drawImage,
|
|
41871
|
+
isAngle
|
|
41872
|
+
]);
|
|
41873
|
+
var fileToDataURL = function(file) {
|
|
41874
|
+
return new Promise(function(resolve) {
|
|
41875
|
+
var reader = new FileReader();
|
|
41876
|
+
reader.onloadend = function(e2) {
|
|
41877
|
+
return resolve(e2.target.result);
|
|
41878
|
+
};
|
|
41879
|
+
reader.readAsDataURL(file);
|
|
41880
|
+
});
|
|
41881
|
+
};
|
|
41882
|
+
var dataURLToImage = function(dataURL) {
|
|
41883
|
+
return new Promise(function(resolve) {
|
|
41884
|
+
var img = new Image();
|
|
41885
|
+
img.onload = function() {
|
|
41886
|
+
return resolve(img);
|
|
41887
|
+
};
|
|
41888
|
+
img.src = dataURL;
|
|
41889
|
+
});
|
|
41890
|
+
};
|
|
41891
|
+
var draw = React.useCallback(function() {
|
|
41892
|
+
var img = drawImage.img, width2 = drawImage.width, height2 = drawImage.height, x = drawImage.x, y = drawImage.y, swidth = drawImage.swidth;
|
|
41893
|
+
var moveX = state.moveX, moveY = state.moveY, scale2 = state.scale, angle = state.angle, displayWidth = state.displayWidth, displayHeight = state.displayHeight;
|
|
41894
|
+
var canvas = canvasRef.current;
|
|
41895
|
+
if (!canvas) return;
|
|
41896
|
+
var ctx2 = canvas.getContext("2d");
|
|
41897
|
+
canvas.width = displayWidth;
|
|
41898
|
+
canvas.height = displayHeight;
|
|
41899
|
+
ctx2.clearRect(0, 0, canvas.width, canvas.height);
|
|
41900
|
+
ctx2.fillStyle = "#666";
|
|
41901
|
+
ctx2.fillRect(0, 0, canvas.width, canvas.height);
|
|
41902
|
+
ctx2.fillStyle = "#000";
|
|
41903
|
+
ctx2.fillRect(space * devicePixelRatio, (canvas.height - swidth) / 2, swidth, swidth);
|
|
41904
|
+
ctx2.translate(canvas.width / 2 + moveX, canvas.height / 2 + moveY);
|
|
41905
|
+
ctx2.rotate(Math.PI / 180 * angle);
|
|
41906
|
+
ctx2.scale(scale2, scale2);
|
|
41907
|
+
ctx2.drawImage(img, x, y, width2, height2);
|
|
41908
|
+
}, [
|
|
41909
|
+
drawImage,
|
|
41910
|
+
state,
|
|
41911
|
+
devicePixelRatio,
|
|
41912
|
+
space
|
|
41913
|
+
]);
|
|
41914
|
+
React.useEffect(function() {
|
|
41915
|
+
if (Math.abs(state.moveX) > maxMoveX) {
|
|
41916
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
41917
|
+
moveX: maxMoveX
|
|
41918
|
+
}));
|
|
41919
|
+
}
|
|
41920
|
+
if (Math.abs(state.moveY) > maxMoveY) {
|
|
41921
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
41922
|
+
moveY: maxMoveY
|
|
41923
|
+
}));
|
|
41924
|
+
}
|
|
41925
|
+
draw();
|
|
41926
|
+
}, [
|
|
41927
|
+
state,
|
|
41928
|
+
maxMoveX,
|
|
41929
|
+
maxMoveY,
|
|
41930
|
+
draw
|
|
41931
|
+
]);
|
|
41932
|
+
var setDrawImgs = function(image) {
|
|
41933
|
+
var rect = getRect(cropperPopupRef.current);
|
|
41934
|
+
if (!rect) return;
|
|
41935
|
+
var clientWidth = rect.width, clientHeight = rect.height;
|
|
41936
|
+
var canvasWidth = state.displayWidth = clientWidth * devicePixelRatio;
|
|
41937
|
+
var canvasHeight = state.displayHeight = clientHeight * devicePixelRatio;
|
|
41938
|
+
var copyDrawImg = _object_spread({}, defDrawImage);
|
|
41939
|
+
var imgWidth = image.width, imgHeight = image.height;
|
|
41940
|
+
copyDrawImg.img = image;
|
|
41941
|
+
var isPortrait = imgHeight > imgWidth;
|
|
41942
|
+
var rate = isPortrait ? imgWidth / imgHeight : imgHeight / imgWidth;
|
|
41943
|
+
copyDrawImg.width = canvasWidth;
|
|
41944
|
+
copyDrawImg.height = isPortrait ? canvasWidth / rate : canvasWidth * rate;
|
|
41945
|
+
copyDrawImg.x = -copyDrawImg.width / 2;
|
|
41946
|
+
copyDrawImg.y = -copyDrawImg.height / 2;
|
|
41947
|
+
copyDrawImg.swidth = canvasWidth - space * 2 * devicePixelRatio;
|
|
41948
|
+
copyDrawImg.sheight = isPortrait ? copyDrawImg.swidth / rate : copyDrawImg.swidth * rate;
|
|
41949
|
+
copyDrawImg.sx = space * devicePixelRatio;
|
|
41950
|
+
copyDrawImg.sy = (canvasHeight - copyDrawImg.swidth) / 2;
|
|
41951
|
+
setDrawImg(copyDrawImg);
|
|
41952
|
+
var scale2 = copyDrawImg.swidth / (isPortrait ? copyDrawImg.width : copyDrawImg.height);
|
|
41953
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
41954
|
+
defScale: scale2
|
|
41955
|
+
}));
|
|
41956
|
+
resetScale(scale2);
|
|
41957
|
+
};
|
|
41958
|
+
var inputImageChange = /* @__PURE__ */ function() {
|
|
41959
|
+
var _ref2 = _async_to_generator(function(event) {
|
|
41960
|
+
var $el, files, base64, image;
|
|
41961
|
+
return __generator(this, function(_state) {
|
|
41962
|
+
switch (_state.label) {
|
|
41963
|
+
case 0:
|
|
41964
|
+
setVisible(true);
|
|
41965
|
+
$el = event.target;
|
|
41966
|
+
files = $el.files;
|
|
41967
|
+
if (!(files === null || files === void 0 ? void 0 : files.length)) return [
|
|
41968
|
+
2
|
|
41969
|
+
];
|
|
41970
|
+
return [
|
|
41971
|
+
4,
|
|
41972
|
+
fileToDataURL(files[0])
|
|
41973
|
+
];
|
|
41974
|
+
case 1:
|
|
41975
|
+
base64 = _state.sent();
|
|
41976
|
+
return [
|
|
41977
|
+
4,
|
|
41978
|
+
dataURLToImage(base64)
|
|
41979
|
+
];
|
|
41980
|
+
case 2:
|
|
41981
|
+
image = _state.sent();
|
|
41982
|
+
setDrawImgs(image);
|
|
41983
|
+
return [
|
|
41984
|
+
2
|
|
41985
|
+
];
|
|
41986
|
+
}
|
|
41987
|
+
});
|
|
41988
|
+
});
|
|
41989
|
+
return function inputImageChange2(event) {
|
|
41990
|
+
return _ref2.apply(this, arguments);
|
|
41991
|
+
};
|
|
41992
|
+
}();
|
|
41993
|
+
var resetScale = function(scale2) {
|
|
41994
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
41995
|
+
moveX: 0,
|
|
41996
|
+
moveY: 0,
|
|
41997
|
+
angle: 0,
|
|
41998
|
+
scale: scale2 || state.defScale,
|
|
41999
|
+
defScale: scale2 || state.defScale
|
|
42000
|
+
}));
|
|
42001
|
+
};
|
|
42002
|
+
var setScale = function(scale2) {
|
|
42003
|
+
scale2 = clamp(scale2, 0.3, +maxZoom + 1);
|
|
42004
|
+
if (scale2 !== state.scale) {
|
|
42005
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
42006
|
+
scale: scale2
|
|
42007
|
+
}));
|
|
42008
|
+
}
|
|
42009
|
+
};
|
|
42010
|
+
var getDistance = function(touches) {
|
|
42011
|
+
return Math.sqrt(Math.pow(touches[0].clientX - touches[1].clientX, 2) + Math.pow(touches[0].clientY - touches[1].clientY, 2));
|
|
42012
|
+
};
|
|
42013
|
+
var _useState5 = _sliced_to_array(React.useState({
|
|
42014
|
+
startMoveX: 0,
|
|
42015
|
+
startMoveY: 0,
|
|
42016
|
+
startScale: 0,
|
|
42017
|
+
startDistance: 0
|
|
42018
|
+
}), 2), startMove = _useState5[0], setStartMove = _useState5[1];
|
|
42019
|
+
var startMoveX = startMove.startMoveX, startMoveY = startMove.startMoveY, startScale = startMove.startScale, startDistance = startMove.startDistance;
|
|
42020
|
+
var onTouchStart = function(event) {
|
|
42021
|
+
var touches = event.touches;
|
|
42022
|
+
var offsetX = touch.offsetX;
|
|
42023
|
+
touch.start(event);
|
|
42024
|
+
var fingerNum = touches === null || touches === void 0 ? void 0 : touches.length;
|
|
42025
|
+
setStartMove(_object_spread_props(_object_spread({}, startMove), {
|
|
42026
|
+
startMoveX: state.moveX,
|
|
42027
|
+
startMoveY: state.moveY
|
|
42028
|
+
}));
|
|
42029
|
+
setMoving(fingerNum === 1);
|
|
42030
|
+
setZooming(fingerNum === 2 && !offsetX.current);
|
|
42031
|
+
if (fingerNum === 2 && !offsetX.current) {
|
|
42032
|
+
setStartMove(_object_spread_props(_object_spread({}, startMove), {
|
|
42033
|
+
startScale: state.scale,
|
|
42034
|
+
startDistance: getDistance(event.touches)
|
|
42035
|
+
}));
|
|
42036
|
+
}
|
|
42037
|
+
};
|
|
42038
|
+
var onTouchMove = function(event) {
|
|
42039
|
+
var touches = event.touches;
|
|
42040
|
+
touch.move(event);
|
|
42041
|
+
if (moving || zooming) {
|
|
42042
|
+
preventDefault$1(event, true);
|
|
42043
|
+
}
|
|
42044
|
+
if (moving) {
|
|
42045
|
+
var deltaX = touch.deltaX, deltaY = touch.deltaY;
|
|
42046
|
+
var moveX = deltaX.current * state.scale + startMoveX;
|
|
42047
|
+
var moveY = deltaY.current * state.scale + startMoveY;
|
|
42048
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
42049
|
+
moveX: clamp(moveX, -maxMoveX, maxMoveX),
|
|
42050
|
+
moveY: clamp(moveY, -maxMoveY, maxMoveY)
|
|
42051
|
+
}));
|
|
42052
|
+
}
|
|
42053
|
+
if (zooming && touches.length === 2) {
|
|
42054
|
+
var distance = getDistance(touches);
|
|
42055
|
+
var scale2 = startScale * distance / startDistance;
|
|
42056
|
+
setScale(scale2);
|
|
42057
|
+
}
|
|
42058
|
+
};
|
|
42059
|
+
var onTouchEnd = function(event) {
|
|
42060
|
+
var stopPropagation = false;
|
|
42061
|
+
if (moving || zooming) {
|
|
42062
|
+
stopPropagation = !(moving && startMoveX === state.moveX && startMoveY === state.moveY);
|
|
42063
|
+
if (!event.touches.length) {
|
|
42064
|
+
if (zooming) {
|
|
42065
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
42066
|
+
moveX: clamp(state.moveX, -maxMoveX, maxMoveX),
|
|
42067
|
+
moveY: clamp(state.moveY, -maxMoveY, maxMoveY)
|
|
42068
|
+
}));
|
|
42069
|
+
setZooming(false);
|
|
42070
|
+
}
|
|
42071
|
+
setMoving(false);
|
|
42072
|
+
setStartMove(_object_spread_props(_object_spread({}, startMove), {
|
|
42073
|
+
startMoveX: 0,
|
|
42074
|
+
startMoveY: 0,
|
|
42075
|
+
startScale: state.defScale
|
|
42076
|
+
}));
|
|
42077
|
+
if (state.scale < state.defScale) {
|
|
42078
|
+
resetScale();
|
|
42079
|
+
}
|
|
42080
|
+
if (state.scale > maxZoom) {
|
|
42081
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
42082
|
+
scale: +maxZoom
|
|
42083
|
+
}));
|
|
42084
|
+
}
|
|
42085
|
+
}
|
|
42086
|
+
}
|
|
42087
|
+
preventDefault$1(event, stopPropagation);
|
|
42088
|
+
touch.reset();
|
|
42089
|
+
};
|
|
42090
|
+
var reset = function() {
|
|
42091
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
42092
|
+
angle: 0
|
|
42093
|
+
}));
|
|
42094
|
+
};
|
|
42095
|
+
var rotate = function() {
|
|
42096
|
+
if (state.angle === 270) {
|
|
42097
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
42098
|
+
angle: 0
|
|
42099
|
+
}));
|
|
42100
|
+
return;
|
|
42101
|
+
}
|
|
42102
|
+
setState(_object_spread_props(_object_spread({}, state), {
|
|
42103
|
+
angle: state.angle + 90
|
|
42104
|
+
}));
|
|
42105
|
+
};
|
|
42106
|
+
var cancel = function() {
|
|
42107
|
+
var isEmit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
42108
|
+
setVisible(false);
|
|
42109
|
+
resetScale();
|
|
42110
|
+
inputImageRef.current && (inputImageRef.current.value = "");
|
|
42111
|
+
isEmit && onCancel && onCancel();
|
|
42112
|
+
};
|
|
42113
|
+
var confirm2 = function() {
|
|
42114
|
+
var canvas = canvasRef.current;
|
|
42115
|
+
var sx = drawImage.sx, sy = drawImage.sy, swidth = drawImage.swidth;
|
|
42116
|
+
var width2 = swidth;
|
|
42117
|
+
var height2 = swidth;
|
|
42118
|
+
var croppedCanvas = document.createElement("canvas");
|
|
42119
|
+
var croppedCtx = croppedCanvas.getContext("2d");
|
|
42120
|
+
croppedCanvas.width = width2;
|
|
42121
|
+
croppedCanvas.height = height2;
|
|
42122
|
+
canvas && croppedCtx.drawImage(canvas, sx, sy, width2, height2, 0, 0, width2, height2);
|
|
42123
|
+
var imageDataURL = croppedCanvas.toDataURL("image/png");
|
|
42124
|
+
onConfirm && onConfirm(imageDataURL);
|
|
42125
|
+
cancel(false);
|
|
42126
|
+
};
|
|
42127
|
+
var ToolBar = function() {
|
|
42128
|
+
var actions = [
|
|
42129
|
+
cancel,
|
|
42130
|
+
reset,
|
|
42131
|
+
rotate,
|
|
42132
|
+
confirm2
|
|
42133
|
+
];
|
|
42134
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
42135
|
+
className: "".concat(classPrefix$1, "-popup-toolbar-flex")
|
|
42136
|
+
}, actions.map(function(action, index2) {
|
|
42137
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
42138
|
+
key: index2,
|
|
42139
|
+
className: "".concat(classPrefix$1, "-popup-toolbar-item"),
|
|
42140
|
+
onClick: function(_e) {
|
|
42141
|
+
return action();
|
|
42142
|
+
}
|
|
42143
|
+
}, toolbar[index2]);
|
|
42144
|
+
}));
|
|
42145
|
+
};
|
|
42146
|
+
var CropperPopup = function() {
|
|
42147
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
42148
|
+
ref: cropperPopupRef,
|
|
42149
|
+
className: "".concat(classPrefix$1, "-popup"),
|
|
42150
|
+
style: {
|
|
42151
|
+
display: visible ? "block" : "none"
|
|
42152
|
+
}
|
|
42153
|
+
}, /* @__PURE__ */ React.createElement("canvas", {
|
|
42154
|
+
ref: canvasRef,
|
|
42155
|
+
className: "".concat(classPrefix$1, "-popup-canvas")
|
|
42156
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
42157
|
+
className: "".concat(classPrefix$1, "-popup-highlight"),
|
|
42158
|
+
onTouchStart,
|
|
42159
|
+
onTouchMove,
|
|
42160
|
+
onTouchEnd
|
|
42161
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
42162
|
+
className: "highlight",
|
|
42163
|
+
style: highlightStyle
|
|
42164
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
42165
|
+
className: toolbarPositionCls
|
|
42166
|
+
}, /* @__PURE__ */ React.createElement(ToolBar, null)));
|
|
42167
|
+
};
|
|
42168
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", _object_spread_props(_object_spread({
|
|
42169
|
+
className: cls
|
|
42170
|
+
}, rest), {
|
|
42171
|
+
style
|
|
42172
|
+
}), children, /* @__PURE__ */ React.createElement("input", {
|
|
42173
|
+
ref: inputImageRef,
|
|
42174
|
+
type: "file",
|
|
42175
|
+
accept: "image/*",
|
|
42176
|
+
className: "".concat(classPrefix$1, "-input"),
|
|
42177
|
+
onChange: function(e2) {
|
|
42178
|
+
return inputImageChange(e2);
|
|
42179
|
+
},
|
|
42180
|
+
"aria-label": locale.avatarCropper.selectImage
|
|
42181
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
42182
|
+
className: "nut-avatar-cropper-edit-text"
|
|
42183
|
+
}, editText)), CropperPopup());
|
|
42184
|
+
};
|
|
42185
|
+
AvatarCropper.displayName = "NutAvatarCropper";
|
|
42186
|
+
var defaultProps$5 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
41811
42187
|
list: [],
|
|
41812
42188
|
interval: 500,
|
|
41813
42189
|
loop: true,
|
|
@@ -41815,9 +42191,9 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
41815
42191
|
rows: 3,
|
|
41816
42192
|
gapY: 10
|
|
41817
42193
|
});
|
|
41818
|
-
var classPrefix
|
|
42194
|
+
var classPrefix = "nut-barrage";
|
|
41819
42195
|
var InternalBarrage = function(props, ref) {
|
|
41820
|
-
var _ref = _object_spread({}, defaultProps$
|
|
42196
|
+
var _ref = _object_spread({}, defaultProps$5, props), className = _ref.className, interval = _ref.interval, loop2 = _ref.loop, list = _ref.list, duration = _ref.duration, rows = _ref.rows, gapY = _ref.gapY, restProps = _object_without_properties(_ref, [
|
|
41821
42197
|
"className",
|
|
41822
42198
|
"interval",
|
|
41823
42199
|
"loop",
|
|
@@ -41833,7 +42209,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
41833
42209
|
var index2 = React.useRef(0);
|
|
41834
42210
|
var times = React.useRef([]);
|
|
41835
42211
|
var historyIndex = React.useRef(-1);
|
|
41836
|
-
var classes = classNames(classPrefix
|
|
42212
|
+
var classes = classNames(classPrefix, className);
|
|
41837
42213
|
React.useImperativeHandle(ref, function() {
|
|
41838
42214
|
return {
|
|
41839
42215
|
add: function(word) {
|
|
@@ -41912,7 +42288,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
41912
42288
|
};
|
|
41913
42289
|
var Barrage = /* @__PURE__ */ React.forwardRef(InternalBarrage);
|
|
41914
42290
|
Barrage.displayName = "NutBarrage";
|
|
41915
|
-
var defaultProps$
|
|
42291
|
+
var defaultProps$4 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
41916
42292
|
src: "",
|
|
41917
42293
|
title: "",
|
|
41918
42294
|
price: "",
|
|
@@ -41926,7 +42302,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
41926
42302
|
extra: ""
|
|
41927
42303
|
});
|
|
41928
42304
|
var Card = function(props) {
|
|
41929
|
-
var _ref = _object_spread({}, defaultProps$
|
|
42305
|
+
var _ref = _object_spread({}, defaultProps$4, props), className = _ref.className, style = _ref.style, src = _ref.src, title = _ref.title, price = _ref.price, vipPrice = _ref.vipPrice, shopDescription = _ref.shopDescription, delivery = _ref.delivery, shopName = _ref.shopName, tag = _ref.tag, priceTag = _ref.priceTag, description = _ref.description, extra = _ref.extra, rest = _object_without_properties(_ref, [
|
|
41930
42306
|
"className",
|
|
41931
42307
|
"style",
|
|
41932
42308
|
"src",
|
|
@@ -41976,7 +42352,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
41976
42352
|
}, shopName), extra)));
|
|
41977
42353
|
};
|
|
41978
42354
|
Card.displayName = "NutCard";
|
|
41979
|
-
var defaultProps$
|
|
42355
|
+
var defaultProps$3 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
41980
42356
|
activeDate: "",
|
|
41981
42357
|
activeTime: [],
|
|
41982
42358
|
options: [],
|
|
@@ -41989,7 +42365,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
41989
42365
|
}
|
|
41990
42366
|
});
|
|
41991
42367
|
var TimeDetail = function(props) {
|
|
41992
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
42368
|
+
var _$_object_spread = _object_spread({}, defaultProps$3, props), options2 = _$_object_spread.options, optionKey = _$_object_spread.optionKey, className = _$_object_spread.className, activeDate = _$_object_spread.activeDate, activeTime = _$_object_spread.activeTime, onSelect = _$_object_spread.onSelect;
|
|
41993
42369
|
var classPrefix2 = "nut-timedetail";
|
|
41994
42370
|
var timeList = React.useMemo(function() {
|
|
41995
42371
|
return (options2 === null || options2 === void 0 ? void 0 : options2.find(function(item) {
|
|
@@ -42031,7 +42407,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42031
42407
|
}));
|
|
42032
42408
|
};
|
|
42033
42409
|
TimeDetail.displayName = "NutTimeDetail";
|
|
42034
|
-
var defaultProps$
|
|
42410
|
+
var defaultProps$2 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
42035
42411
|
visible: false,
|
|
42036
42412
|
multiple: false,
|
|
42037
42413
|
defaultValue: [],
|
|
@@ -42044,7 +42420,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42044
42420
|
});
|
|
42045
42421
|
var TimeSelect = function(props) {
|
|
42046
42422
|
var locale = useConfig().locale;
|
|
42047
|
-
var _ref = _object_spread({}, defaultProps$
|
|
42423
|
+
var _ref = _object_spread({}, defaultProps$2, props), visible = _ref.visible, className = _ref.className, style = _ref.style, title = _ref.title, defaultValue = _ref.defaultValue, options2 = _ref.options, optionKey = _ref.optionKey, multiple = _ref.multiple, onSelect = _ref.onSelect, onDateChange = _ref.onDateChange, onTimeChange = _ref.onTimeChange, rest = _object_without_properties(_ref, [
|
|
42048
42424
|
"visible",
|
|
42049
42425
|
"className",
|
|
42050
42426
|
"style",
|
|
@@ -42155,7 +42531,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42155
42531
|
}))));
|
|
42156
42532
|
};
|
|
42157
42533
|
TimeSelect.displayName = "NutTimeSelect";
|
|
42158
|
-
var defaultProps$
|
|
42534
|
+
var defaultProps$1 = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
42159
42535
|
value: 0,
|
|
42160
42536
|
digits: 2,
|
|
42161
42537
|
symbol: false,
|
|
@@ -42169,7 +42545,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42169
42545
|
dropIcon: null
|
|
42170
42546
|
});
|
|
42171
42547
|
var TrendArrow = function(props) {
|
|
42172
|
-
var _ref = _object_spread({}, defaultProps$
|
|
42548
|
+
var _ref = _object_spread({}, defaultProps$1, props), value2 = _ref.value, digits = _ref.digits, symbol = _ref.symbol, zero = _ref.zero, left = _ref.left, sync2 = _ref.sync, color = _ref.color, riseColor = _ref.riseColor, dropColor = _ref.dropColor, riseIcon = _ref.riseIcon, dropIcon = _ref.dropIcon, className = _ref.className, style = _ref.style;
|
|
42173
42549
|
_ref.children;
|
|
42174
42550
|
var rest = _object_without_properties(_ref, [
|
|
42175
42551
|
"value",
|
|
@@ -42241,7 +42617,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42241
42617
|
}))), left && renderContent(!left));
|
|
42242
42618
|
};
|
|
42243
42619
|
TrendArrow.displayName = "NutTrendArrow";
|
|
42244
|
-
var defaultProps
|
|
42620
|
+
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
42245
42621
|
content: "",
|
|
42246
42622
|
fullPage: true,
|
|
42247
42623
|
zIndex: 2e3,
|
|
@@ -42262,7 +42638,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42262
42638
|
});
|
|
42263
42639
|
var WaterMark = function(props) {
|
|
42264
42640
|
var locale = useConfig().locale;
|
|
42265
|
-
var _$_object_spread = _object_spread({}, defaultProps
|
|
42641
|
+
var _$_object_spread = _object_spread({}, defaultProps, props), content2 = _$_object_spread.content, fullPage = _$_object_spread.fullPage, zIndex = _$_object_spread.zIndex, className = _$_object_spread.className, gapX = _$_object_spread.gapX, gapY = _$_object_spread.gapY, startX = _$_object_spread.startX, startY = _$_object_spread.startY, width2 = _$_object_spread.width, height2 = _$_object_spread.height, image = _$_object_spread.image, imageWidth = _$_object_spread.imageWidth, imageHeight = _$_object_spread.imageHeight, rotate = _$_object_spread.rotate, color = _$_object_spread.color, fontStyle = _$_object_spread.fontStyle, fontFamily = _$_object_spread.fontFamily, fontWeight = _$_object_spread.fontWeight, fontSize = _$_object_spread.fontSize, style = _$_object_spread.style;
|
|
42266
42642
|
var _useState = _sliced_to_array(React.useState(""), 2), base64Url = _useState[0], setBase64Url = _useState[1];
|
|
42267
42643
|
var classPrefix2 = "nut-watermark";
|
|
42268
42644
|
var classes = classNames(classPrefix2, _define_property({}, "".concat(classPrefix2, "-full-page"), fullPage));
|
|
@@ -42319,446 +42695,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42319
42695
|
});
|
|
42320
42696
|
};
|
|
42321
42697
|
WaterMark.displayName = "NutWaterMark";
|
|
42322
|
-
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
42323
|
-
maxZoom: 3,
|
|
42324
|
-
space: 10,
|
|
42325
|
-
toolbar: [
|
|
42326
|
-
/* @__PURE__ */ React.createElement(Button, {
|
|
42327
|
-
type: "danger",
|
|
42328
|
-
key: "cancel"
|
|
42329
|
-
}, "Cancel"),
|
|
42330
|
-
/* @__PURE__ */ React.createElement(Button, {
|
|
42331
|
-
key: "reset"
|
|
42332
|
-
}, "Reset"),
|
|
42333
|
-
/* @__PURE__ */ React.createElement(Button, {
|
|
42334
|
-
key: "rotate"
|
|
42335
|
-
}, "Rotate"),
|
|
42336
|
-
/* @__PURE__ */ React.createElement(Button, {
|
|
42337
|
-
type: "success",
|
|
42338
|
-
key: "confirm"
|
|
42339
|
-
}, "Confirm")
|
|
42340
|
-
],
|
|
42341
|
-
toolbarPosition: "bottom",
|
|
42342
|
-
editText: "Edit",
|
|
42343
|
-
shape: "square"
|
|
42344
|
-
});
|
|
42345
|
-
var classPrefix = "nut-avatar-cropper";
|
|
42346
|
-
var AvatarCropper = function(props) {
|
|
42347
|
-
var locale = useConfig().locale;
|
|
42348
|
-
defaultProps.toolbar = [
|
|
42349
|
-
/* @__PURE__ */ React.createElement(Button, {
|
|
42350
|
-
type: "danger",
|
|
42351
|
-
key: "cancel"
|
|
42352
|
-
}, locale.cancel),
|
|
42353
|
-
/* @__PURE__ */ React.createElement(Button, {
|
|
42354
|
-
key: "reset"
|
|
42355
|
-
}, locale.reset),
|
|
42356
|
-
/* @__PURE__ */ React.createElement(Button, {
|
|
42357
|
-
key: "rotate"
|
|
42358
|
-
}, locale.avatarCropper.rotate),
|
|
42359
|
-
/* @__PURE__ */ React.createElement(Button, {
|
|
42360
|
-
type: "success",
|
|
42361
|
-
key: "confirm"
|
|
42362
|
-
}, locale.confirm)
|
|
42363
|
-
];
|
|
42364
|
-
var _ref = _object_spread({}, defaultProps, props), children = _ref.children, maxZoom = _ref.maxZoom, space = _ref.space, toolbar = _ref.toolbar, toolbarPosition = _ref.toolbarPosition, editText = _ref.editText, shape = _ref.shape, className = _ref.className, style = _ref.style, onConfirm = _ref.onConfirm, onCancel = _ref.onCancel, rest = _object_without_properties(_ref, [
|
|
42365
|
-
"children",
|
|
42366
|
-
"maxZoom",
|
|
42367
|
-
"space",
|
|
42368
|
-
"toolbar",
|
|
42369
|
-
"toolbarPosition",
|
|
42370
|
-
"editText",
|
|
42371
|
-
"shape",
|
|
42372
|
-
"className",
|
|
42373
|
-
"style",
|
|
42374
|
-
"onConfirm",
|
|
42375
|
-
"onCancel"
|
|
42376
|
-
]);
|
|
42377
|
-
var cls = classNames(classPrefix, className, shape === "round" && "round");
|
|
42378
|
-
var toolbarPositionCls = classNames("".concat(classPrefix, "-popup-toolbar"), toolbarPosition);
|
|
42379
|
-
var inputImageRef = React.useRef(null);
|
|
42380
|
-
var cropperPopupRef = React.useRef(null);
|
|
42381
|
-
var canvasRef = React.useRef(null);
|
|
42382
|
-
var _useState = _sliced_to_array(React.useState(false), 2), visible = _useState[0], setVisible = _useState[1];
|
|
42383
|
-
var _useState1 = _sliced_to_array(React.useState(false), 2), moving = _useState1[0], setMoving = _useState1[1];
|
|
42384
|
-
var _useState2 = _sliced_to_array(React.useState(false), 2), zooming = _useState2[0], setZooming = _useState2[1];
|
|
42385
|
-
var _useState3 = _sliced_to_array(React.useState({
|
|
42386
|
-
defScale: 1,
|
|
42387
|
-
scale: 1,
|
|
42388
|
-
angle: 0,
|
|
42389
|
-
moveX: 0,
|
|
42390
|
-
moveY: 0,
|
|
42391
|
-
displayWidth: 0,
|
|
42392
|
-
displayHeight: 0
|
|
42393
|
-
}), 2), state = _useState3[0], setState = _useState3[1];
|
|
42394
|
-
var defDrawImage = {
|
|
42395
|
-
img: new Image(),
|
|
42396
|
-
sx: 0,
|
|
42397
|
-
sy: 0,
|
|
42398
|
-
swidth: 0,
|
|
42399
|
-
sheight: 0,
|
|
42400
|
-
x: 0,
|
|
42401
|
-
y: 0,
|
|
42402
|
-
width: 0,
|
|
42403
|
-
height: 0
|
|
42404
|
-
};
|
|
42405
|
-
var _useState4 = _sliced_to_array(React.useState(_object_spread({}, defDrawImage)), 2), drawImage = _useState4[0], setDrawImg = _useState4[1];
|
|
42406
|
-
var devicePixelRatio = window.devicePixelRatio || 1;
|
|
42407
|
-
var touch = useTouch();
|
|
42408
|
-
var highlightStyle = React.useMemo(function() {
|
|
42409
|
-
var width2 = "".concat(drawImage.swidth / devicePixelRatio, "px");
|
|
42410
|
-
var height2 = width2;
|
|
42411
|
-
return {
|
|
42412
|
-
width: width2,
|
|
42413
|
-
height: height2,
|
|
42414
|
-
borderRadius: shape === "round" ? "50%" : ""
|
|
42415
|
-
};
|
|
42416
|
-
}, [
|
|
42417
|
-
devicePixelRatio,
|
|
42418
|
-
drawImage.swidth
|
|
42419
|
-
]);
|
|
42420
|
-
var isAngle = React.useMemo(function() {
|
|
42421
|
-
return state.angle === 90 || state.angle === 270;
|
|
42422
|
-
}, [
|
|
42423
|
-
state.angle
|
|
42424
|
-
]);
|
|
42425
|
-
var maxMoveX = React.useMemo(function() {
|
|
42426
|
-
var swidth = drawImage.swidth, height2 = drawImage.height;
|
|
42427
|
-
if (isAngle) {
|
|
42428
|
-
return Math.max(0, (height2 * state.scale - swidth) / 2);
|
|
42429
|
-
}
|
|
42430
|
-
return Math.max(0, (state.displayWidth * state.scale - swidth) / 2);
|
|
42431
|
-
}, [
|
|
42432
|
-
state.scale,
|
|
42433
|
-
state.displayWidth,
|
|
42434
|
-
drawImage,
|
|
42435
|
-
isAngle
|
|
42436
|
-
]);
|
|
42437
|
-
var maxMoveY = React.useMemo(function() {
|
|
42438
|
-
var swidth = drawImage.swidth, height2 = drawImage.height;
|
|
42439
|
-
if (isAngle) {
|
|
42440
|
-
return Math.max(0, (state.displayWidth * state.scale - swidth) / 2);
|
|
42441
|
-
}
|
|
42442
|
-
return Math.max(0, (height2 * state.scale - swidth) / 2);
|
|
42443
|
-
}, [
|
|
42444
|
-
state.scale,
|
|
42445
|
-
state.displayWidth,
|
|
42446
|
-
drawImage,
|
|
42447
|
-
isAngle
|
|
42448
|
-
]);
|
|
42449
|
-
var fileToDataURL = function(file) {
|
|
42450
|
-
return new Promise(function(resolve) {
|
|
42451
|
-
var reader = new FileReader();
|
|
42452
|
-
reader.onloadend = function(e2) {
|
|
42453
|
-
return resolve(e2.target.result);
|
|
42454
|
-
};
|
|
42455
|
-
reader.readAsDataURL(file);
|
|
42456
|
-
});
|
|
42457
|
-
};
|
|
42458
|
-
var dataURLToImage = function(dataURL) {
|
|
42459
|
-
return new Promise(function(resolve) {
|
|
42460
|
-
var img = new Image();
|
|
42461
|
-
img.onload = function() {
|
|
42462
|
-
return resolve(img);
|
|
42463
|
-
};
|
|
42464
|
-
img.src = dataURL;
|
|
42465
|
-
});
|
|
42466
|
-
};
|
|
42467
|
-
var draw = React.useCallback(function() {
|
|
42468
|
-
var img = drawImage.img, width2 = drawImage.width, height2 = drawImage.height, x = drawImage.x, y = drawImage.y, swidth = drawImage.swidth;
|
|
42469
|
-
var moveX = state.moveX, moveY = state.moveY, scale2 = state.scale, angle = state.angle, displayWidth = state.displayWidth, displayHeight = state.displayHeight;
|
|
42470
|
-
var canvas = canvasRef.current;
|
|
42471
|
-
if (!canvas) return;
|
|
42472
|
-
var ctx2 = canvas.getContext("2d");
|
|
42473
|
-
canvas.width = displayWidth;
|
|
42474
|
-
canvas.height = displayHeight;
|
|
42475
|
-
ctx2.clearRect(0, 0, canvas.width, canvas.height);
|
|
42476
|
-
ctx2.fillStyle = "#666";
|
|
42477
|
-
ctx2.fillRect(0, 0, canvas.width, canvas.height);
|
|
42478
|
-
ctx2.fillStyle = "#000";
|
|
42479
|
-
ctx2.fillRect(space * devicePixelRatio, (canvas.height - swidth) / 2, swidth, swidth);
|
|
42480
|
-
ctx2.translate(canvas.width / 2 + moveX, canvas.height / 2 + moveY);
|
|
42481
|
-
ctx2.rotate(Math.PI / 180 * angle);
|
|
42482
|
-
ctx2.scale(scale2, scale2);
|
|
42483
|
-
ctx2.drawImage(img, x, y, width2, height2);
|
|
42484
|
-
}, [
|
|
42485
|
-
drawImage,
|
|
42486
|
-
state,
|
|
42487
|
-
devicePixelRatio,
|
|
42488
|
-
space
|
|
42489
|
-
]);
|
|
42490
|
-
React.useEffect(function() {
|
|
42491
|
-
if (Math.abs(state.moveX) > maxMoveX) {
|
|
42492
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42493
|
-
moveX: maxMoveX
|
|
42494
|
-
}));
|
|
42495
|
-
}
|
|
42496
|
-
if (Math.abs(state.moveY) > maxMoveY) {
|
|
42497
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42498
|
-
moveY: maxMoveY
|
|
42499
|
-
}));
|
|
42500
|
-
}
|
|
42501
|
-
draw();
|
|
42502
|
-
}, [
|
|
42503
|
-
state,
|
|
42504
|
-
maxMoveX,
|
|
42505
|
-
maxMoveY,
|
|
42506
|
-
draw
|
|
42507
|
-
]);
|
|
42508
|
-
var setDrawImgs = function(image) {
|
|
42509
|
-
var rect = getRect(cropperPopupRef.current);
|
|
42510
|
-
if (!rect) return;
|
|
42511
|
-
var clientWidth = rect.width, clientHeight = rect.height;
|
|
42512
|
-
var canvasWidth = state.displayWidth = clientWidth * devicePixelRatio;
|
|
42513
|
-
var canvasHeight = state.displayHeight = clientHeight * devicePixelRatio;
|
|
42514
|
-
var copyDrawImg = _object_spread({}, defDrawImage);
|
|
42515
|
-
var imgWidth = image.width, imgHeight = image.height;
|
|
42516
|
-
copyDrawImg.img = image;
|
|
42517
|
-
var isPortrait = imgHeight > imgWidth;
|
|
42518
|
-
var rate = isPortrait ? imgWidth / imgHeight : imgHeight / imgWidth;
|
|
42519
|
-
copyDrawImg.width = canvasWidth;
|
|
42520
|
-
copyDrawImg.height = isPortrait ? canvasWidth / rate : canvasWidth * rate;
|
|
42521
|
-
copyDrawImg.x = -copyDrawImg.width / 2;
|
|
42522
|
-
copyDrawImg.y = -copyDrawImg.height / 2;
|
|
42523
|
-
copyDrawImg.swidth = canvasWidth - space * 2 * devicePixelRatio;
|
|
42524
|
-
copyDrawImg.sheight = isPortrait ? copyDrawImg.swidth / rate : copyDrawImg.swidth * rate;
|
|
42525
|
-
copyDrawImg.sx = space * devicePixelRatio;
|
|
42526
|
-
copyDrawImg.sy = (canvasHeight - copyDrawImg.swidth) / 2;
|
|
42527
|
-
setDrawImg(copyDrawImg);
|
|
42528
|
-
var scale2 = copyDrawImg.swidth / (isPortrait ? copyDrawImg.width : copyDrawImg.height);
|
|
42529
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42530
|
-
defScale: scale2
|
|
42531
|
-
}));
|
|
42532
|
-
resetScale(scale2);
|
|
42533
|
-
};
|
|
42534
|
-
var inputImageChange = /* @__PURE__ */ function() {
|
|
42535
|
-
var _ref2 = _async_to_generator(function(event) {
|
|
42536
|
-
var $el, files, base64, image;
|
|
42537
|
-
return __generator(this, function(_state) {
|
|
42538
|
-
switch (_state.label) {
|
|
42539
|
-
case 0:
|
|
42540
|
-
setVisible(true);
|
|
42541
|
-
$el = event.target;
|
|
42542
|
-
files = $el.files;
|
|
42543
|
-
if (!(files === null || files === void 0 ? void 0 : files.length)) return [
|
|
42544
|
-
2
|
|
42545
|
-
];
|
|
42546
|
-
return [
|
|
42547
|
-
4,
|
|
42548
|
-
fileToDataURL(files[0])
|
|
42549
|
-
];
|
|
42550
|
-
case 1:
|
|
42551
|
-
base64 = _state.sent();
|
|
42552
|
-
return [
|
|
42553
|
-
4,
|
|
42554
|
-
dataURLToImage(base64)
|
|
42555
|
-
];
|
|
42556
|
-
case 2:
|
|
42557
|
-
image = _state.sent();
|
|
42558
|
-
setDrawImgs(image);
|
|
42559
|
-
return [
|
|
42560
|
-
2
|
|
42561
|
-
];
|
|
42562
|
-
}
|
|
42563
|
-
});
|
|
42564
|
-
});
|
|
42565
|
-
return function inputImageChange2(event) {
|
|
42566
|
-
return _ref2.apply(this, arguments);
|
|
42567
|
-
};
|
|
42568
|
-
}();
|
|
42569
|
-
var resetScale = function(scale2) {
|
|
42570
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42571
|
-
moveX: 0,
|
|
42572
|
-
moveY: 0,
|
|
42573
|
-
angle: 0,
|
|
42574
|
-
scale: scale2 || state.defScale,
|
|
42575
|
-
defScale: scale2 || state.defScale
|
|
42576
|
-
}));
|
|
42577
|
-
};
|
|
42578
|
-
var setScale = function(scale2) {
|
|
42579
|
-
scale2 = clamp(scale2, 0.3, +maxZoom + 1);
|
|
42580
|
-
if (scale2 !== state.scale) {
|
|
42581
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42582
|
-
scale: scale2
|
|
42583
|
-
}));
|
|
42584
|
-
}
|
|
42585
|
-
};
|
|
42586
|
-
var getDistance = function(touches) {
|
|
42587
|
-
return Math.sqrt(Math.pow(touches[0].clientX - touches[1].clientX, 2) + Math.pow(touches[0].clientY - touches[1].clientY, 2));
|
|
42588
|
-
};
|
|
42589
|
-
var _useState5 = _sliced_to_array(React.useState({
|
|
42590
|
-
startMoveX: 0,
|
|
42591
|
-
startMoveY: 0,
|
|
42592
|
-
startScale: 0,
|
|
42593
|
-
startDistance: 0
|
|
42594
|
-
}), 2), startMove = _useState5[0], setStartMove = _useState5[1];
|
|
42595
|
-
var startMoveX = startMove.startMoveX, startMoveY = startMove.startMoveY, startScale = startMove.startScale, startDistance = startMove.startDistance;
|
|
42596
|
-
var onTouchStart = function(event) {
|
|
42597
|
-
var touches = event.touches;
|
|
42598
|
-
var offsetX = touch.offsetX;
|
|
42599
|
-
touch.start(event);
|
|
42600
|
-
var fingerNum = touches === null || touches === void 0 ? void 0 : touches.length;
|
|
42601
|
-
setStartMove(_object_spread_props(_object_spread({}, startMove), {
|
|
42602
|
-
startMoveX: state.moveX,
|
|
42603
|
-
startMoveY: state.moveY
|
|
42604
|
-
}));
|
|
42605
|
-
setMoving(fingerNum === 1);
|
|
42606
|
-
setZooming(fingerNum === 2 && !offsetX.current);
|
|
42607
|
-
if (fingerNum === 2 && !offsetX.current) {
|
|
42608
|
-
setStartMove(_object_spread_props(_object_spread({}, startMove), {
|
|
42609
|
-
startScale: state.scale,
|
|
42610
|
-
startDistance: getDistance(event.touches)
|
|
42611
|
-
}));
|
|
42612
|
-
}
|
|
42613
|
-
};
|
|
42614
|
-
var onTouchMove = function(event) {
|
|
42615
|
-
var touches = event.touches;
|
|
42616
|
-
touch.move(event);
|
|
42617
|
-
if (moving || zooming) {
|
|
42618
|
-
preventDefault$1(event, true);
|
|
42619
|
-
}
|
|
42620
|
-
if (moving) {
|
|
42621
|
-
var deltaX = touch.deltaX, deltaY = touch.deltaY;
|
|
42622
|
-
var moveX = deltaX.current * state.scale + startMoveX;
|
|
42623
|
-
var moveY = deltaY.current * state.scale + startMoveY;
|
|
42624
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42625
|
-
moveX: clamp(moveX, -maxMoveX, maxMoveX),
|
|
42626
|
-
moveY: clamp(moveY, -maxMoveY, maxMoveY)
|
|
42627
|
-
}));
|
|
42628
|
-
}
|
|
42629
|
-
if (zooming && touches.length === 2) {
|
|
42630
|
-
var distance = getDistance(touches);
|
|
42631
|
-
var scale2 = startScale * distance / startDistance;
|
|
42632
|
-
setScale(scale2);
|
|
42633
|
-
}
|
|
42634
|
-
};
|
|
42635
|
-
var onTouchEnd = function(event) {
|
|
42636
|
-
var stopPropagation = false;
|
|
42637
|
-
if (moving || zooming) {
|
|
42638
|
-
stopPropagation = !(moving && startMoveX === state.moveX && startMoveY === state.moveY);
|
|
42639
|
-
if (!event.touches.length) {
|
|
42640
|
-
if (zooming) {
|
|
42641
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42642
|
-
moveX: clamp(state.moveX, -maxMoveX, maxMoveX),
|
|
42643
|
-
moveY: clamp(state.moveY, -maxMoveY, maxMoveY)
|
|
42644
|
-
}));
|
|
42645
|
-
setZooming(false);
|
|
42646
|
-
}
|
|
42647
|
-
setMoving(false);
|
|
42648
|
-
setStartMove(_object_spread_props(_object_spread({}, startMove), {
|
|
42649
|
-
startMoveX: 0,
|
|
42650
|
-
startMoveY: 0,
|
|
42651
|
-
startScale: state.defScale
|
|
42652
|
-
}));
|
|
42653
|
-
if (state.scale < state.defScale) {
|
|
42654
|
-
resetScale();
|
|
42655
|
-
}
|
|
42656
|
-
if (state.scale > maxZoom) {
|
|
42657
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42658
|
-
scale: +maxZoom
|
|
42659
|
-
}));
|
|
42660
|
-
}
|
|
42661
|
-
}
|
|
42662
|
-
}
|
|
42663
|
-
preventDefault$1(event, stopPropagation);
|
|
42664
|
-
touch.reset();
|
|
42665
|
-
};
|
|
42666
|
-
var reset = function() {
|
|
42667
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42668
|
-
angle: 0
|
|
42669
|
-
}));
|
|
42670
|
-
};
|
|
42671
|
-
var rotate = function() {
|
|
42672
|
-
if (state.angle === 270) {
|
|
42673
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42674
|
-
angle: 0
|
|
42675
|
-
}));
|
|
42676
|
-
return;
|
|
42677
|
-
}
|
|
42678
|
-
setState(_object_spread_props(_object_spread({}, state), {
|
|
42679
|
-
angle: state.angle + 90
|
|
42680
|
-
}));
|
|
42681
|
-
};
|
|
42682
|
-
var cancel = function() {
|
|
42683
|
-
var isEmit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
42684
|
-
setVisible(false);
|
|
42685
|
-
resetScale();
|
|
42686
|
-
inputImageRef.current && (inputImageRef.current.value = "");
|
|
42687
|
-
isEmit && onCancel && onCancel();
|
|
42688
|
-
};
|
|
42689
|
-
var confirm2 = function() {
|
|
42690
|
-
var canvas = canvasRef.current;
|
|
42691
|
-
var sx = drawImage.sx, sy = drawImage.sy, swidth = drawImage.swidth;
|
|
42692
|
-
var width2 = swidth;
|
|
42693
|
-
var height2 = swidth;
|
|
42694
|
-
var croppedCanvas = document.createElement("canvas");
|
|
42695
|
-
var croppedCtx = croppedCanvas.getContext("2d");
|
|
42696
|
-
croppedCanvas.width = width2;
|
|
42697
|
-
croppedCanvas.height = height2;
|
|
42698
|
-
canvas && croppedCtx.drawImage(canvas, sx, sy, width2, height2, 0, 0, width2, height2);
|
|
42699
|
-
var imageDataURL = croppedCanvas.toDataURL("image/png");
|
|
42700
|
-
onConfirm && onConfirm(imageDataURL);
|
|
42701
|
-
cancel(false);
|
|
42702
|
-
};
|
|
42703
|
-
var ToolBar = function() {
|
|
42704
|
-
var actions = [
|
|
42705
|
-
cancel,
|
|
42706
|
-
reset,
|
|
42707
|
-
rotate,
|
|
42708
|
-
confirm2
|
|
42709
|
-
];
|
|
42710
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
42711
|
-
className: "".concat(classPrefix, "-popup-toolbar-flex")
|
|
42712
|
-
}, actions.map(function(action, index2) {
|
|
42713
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
42714
|
-
key: index2,
|
|
42715
|
-
className: "".concat(classPrefix, "-popup-toolbar-item"),
|
|
42716
|
-
onClick: function(_e) {
|
|
42717
|
-
return action();
|
|
42718
|
-
}
|
|
42719
|
-
}, toolbar[index2]);
|
|
42720
|
-
}));
|
|
42721
|
-
};
|
|
42722
|
-
var CropperPopup = function() {
|
|
42723
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
42724
|
-
ref: cropperPopupRef,
|
|
42725
|
-
className: "".concat(classPrefix, "-popup"),
|
|
42726
|
-
style: {
|
|
42727
|
-
display: visible ? "block" : "none"
|
|
42728
|
-
}
|
|
42729
|
-
}, /* @__PURE__ */ React.createElement("canvas", {
|
|
42730
|
-
ref: canvasRef,
|
|
42731
|
-
className: "".concat(classPrefix, "-popup-canvas")
|
|
42732
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
42733
|
-
className: "".concat(classPrefix, "-popup-highlight"),
|
|
42734
|
-
onTouchStart,
|
|
42735
|
-
onTouchMove,
|
|
42736
|
-
onTouchEnd
|
|
42737
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
42738
|
-
className: "highlight",
|
|
42739
|
-
style: highlightStyle
|
|
42740
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
42741
|
-
className: toolbarPositionCls
|
|
42742
|
-
}, /* @__PURE__ */ React.createElement(ToolBar, null)));
|
|
42743
|
-
};
|
|
42744
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", _object_spread_props(_object_spread({
|
|
42745
|
-
className: cls
|
|
42746
|
-
}, rest), {
|
|
42747
|
-
style
|
|
42748
|
-
}), children, /* @__PURE__ */ React.createElement("input", {
|
|
42749
|
-
ref: inputImageRef,
|
|
42750
|
-
type: "file",
|
|
42751
|
-
accept: "image/*",
|
|
42752
|
-
className: "".concat(classPrefix, "-input"),
|
|
42753
|
-
onChange: function(e2) {
|
|
42754
|
-
return inputImageChange(e2);
|
|
42755
|
-
},
|
|
42756
|
-
"aria-label": locale.avatarCropper.selectImage
|
|
42757
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
42758
|
-
className: "nut-avatar-cropper-edit-text"
|
|
42759
|
-
}, editText)), CropperPopup());
|
|
42760
|
-
};
|
|
42761
|
-
AvatarCropper.displayName = "NutAvatarCropper";
|
|
42762
42698
|
exports.ActionSheet = ActionSheet;
|
|
42763
42699
|
exports.Address = Address;
|
|
42764
42700
|
exports.Animate = Animate;
|
|
@@ -42787,6 +42723,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42787
42723
|
exports.ConfigProvider = ConfigProvider;
|
|
42788
42724
|
exports.CountDown = CountDown;
|
|
42789
42725
|
exports.DatePicker = DatePicker;
|
|
42726
|
+
exports.DatePickerView = DatePickerView;
|
|
42790
42727
|
exports.Dialog = Dialog;
|
|
42791
42728
|
exports.Divider = Divider;
|
|
42792
42729
|
exports.Drag = Drag;
|
|
@@ -42835,15 +42772,12 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42835
42772
|
exports.Segmented = Segmented;
|
|
42836
42773
|
exports.ShortPassword = ShortPassword;
|
|
42837
42774
|
exports.SideBar = SideBar;
|
|
42838
|
-
exports.SideNavBar = SideNavBar;
|
|
42839
|
-
exports.SideNavBarItem = SideNavBarItem;
|
|
42840
42775
|
exports.Signature = Signature;
|
|
42841
42776
|
exports.Skeleton = Skeleton;
|
|
42842
42777
|
exports.Space = Space;
|
|
42843
42778
|
exports.Step = Step;
|
|
42844
42779
|
exports.Steps = Steps;
|
|
42845
42780
|
exports.Sticky = Sticky;
|
|
42846
|
-
exports.SubSideNavBar = SubSideNavBar;
|
|
42847
42781
|
exports.Swipe = Swipe;
|
|
42848
42782
|
exports.Swiper = InnerSwiper;
|
|
42849
42783
|
exports.SwiperItem = SwiperItem;
|