antd-mobile 5.12.2 → 5.12.5
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/2x/cjs/components/action-sheet/action-sheet.css +22 -7
- package/2x/cjs/components/action-sheet/action-sheet.js +8 -16
- package/2x/cjs/components/badge/badge.d.ts +1 -1
- package/2x/cjs/components/badge/badge.js +3 -1
- package/2x/cjs/components/badge/index.d.ts +1 -1
- package/2x/cjs/components/button/button.d.ts +6 -4
- package/2x/cjs/components/button/button.js +5 -1
- package/2x/cjs/components/calendar/calendar.css +4 -0
- package/2x/cjs/components/calendar/calendar.d.ts +1 -0
- package/2x/cjs/components/calendar/calendar.js +2 -2
- package/2x/cjs/components/form/form-item.js +1 -4
- package/2x/cjs/components/image/broken-image-icon.d.ts +1 -0
- package/2x/cjs/components/image/broken-image-icon.js +21 -0
- package/2x/cjs/components/image/image-icon.d.ts +1 -0
- package/2x/cjs/components/image/image-icon.js +21 -0
- package/2x/cjs/components/image/image.css +4 -2
- package/2x/cjs/components/image/image.d.ts +1 -0
- package/2x/cjs/components/image/image.js +10 -6
- package/2x/cjs/components/image-uploader/image-uploader.js +1 -4
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +8 -6
- package/2x/cjs/components/popover/popover.css +1 -0
- package/2x/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/2x/cjs/components/search-bar/search-bar.js +3 -0
- package/2x/cjs/components/side-bar/side-bar.d.ts +2 -1
- package/2x/cjs/components/swiper/index.d.ts +1 -1
- package/2x/cjs/components/swiper/swiper.d.ts +1 -1
- package/2x/cjs/components/text-area/text-area.js +2 -1
- package/2x/cjs/components/toast/toast.css +1 -1
- package/2x/cjs/utils/get-scroll-parent.js +1 -1
- package/2x/es/components/action-sheet/action-sheet.css +22 -7
- package/2x/es/components/action-sheet/action-sheet.js +8 -15
- package/2x/es/components/badge/badge.d.ts +1 -1
- package/2x/es/components/badge/badge.js +1 -1
- package/2x/es/components/badge/index.d.ts +1 -1
- package/2x/es/components/button/button.d.ts +6 -4
- package/2x/es/components/button/button.js +5 -1
- package/2x/es/components/calendar/calendar.css +4 -0
- package/2x/es/components/calendar/calendar.d.ts +1 -0
- package/2x/es/components/calendar/calendar.js +2 -2
- package/2x/es/components/form/form-item.js +1 -4
- package/2x/es/components/image/broken-image-icon.d.ts +1 -0
- package/2x/es/components/image/broken-image-icon.js +9 -0
- package/2x/es/components/image/image-icon.d.ts +1 -0
- package/2x/es/components/image/image-icon.js +9 -0
- package/2x/es/components/image/image.css +4 -2
- package/2x/es/components/image/image.d.ts +1 -0
- package/2x/es/components/image/image.js +8 -5
- package/2x/es/components/image-uploader/image-uploader.js +2 -5
- package/2x/es/components/infinite-scroll/infinite-scroll.js +8 -6
- package/2x/es/components/popover/popover.css +1 -0
- package/2x/es/components/search-bar/search-bar.d.ts +1 -1
- package/2x/es/components/search-bar/search-bar.js +3 -0
- package/2x/es/components/side-bar/side-bar.d.ts +2 -1
- package/2x/es/components/swiper/index.d.ts +1 -1
- package/2x/es/components/swiper/swiper.d.ts +1 -1
- package/2x/es/components/text-area/text-area.js +2 -1
- package/2x/es/components/toast/toast.css +1 -1
- package/2x/es/utils/get-scroll-parent.js +1 -1
- package/2x/package.json +5 -5
- package/bundle/antd-mobile.cjs.js +193 -177
- package/bundle/antd-mobile.es.js +195 -179
- package/bundle/style.css +99 -81
- package/cjs/components/action-sheet/action-sheet.css +19 -7
- package/cjs/components/action-sheet/action-sheet.js +8 -16
- package/cjs/components/badge/badge.d.ts +1 -1
- package/cjs/components/badge/badge.js +3 -1
- package/cjs/components/badge/index.d.ts +1 -1
- package/cjs/components/button/button.d.ts +6 -4
- package/cjs/components/button/button.js +5 -1
- package/cjs/components/calendar/calendar.css +3 -0
- package/cjs/components/calendar/calendar.d.ts +1 -0
- package/cjs/components/calendar/calendar.js +2 -2
- package/cjs/components/form/form-item.js +1 -4
- package/cjs/components/image/broken-image-icon.d.ts +1 -0
- package/cjs/components/image/broken-image-icon.js +21 -0
- package/cjs/components/image/image-icon.d.ts +1 -0
- package/cjs/components/image/image-icon.js +21 -0
- package/cjs/components/image/image.css +4 -2
- package/cjs/components/image/image.d.ts +1 -0
- package/cjs/components/image/image.js +10 -6
- package/cjs/components/image-uploader/image-uploader.js +1 -4
- package/cjs/components/infinite-scroll/infinite-scroll.js +8 -6
- package/cjs/components/popover/popover.css +1 -0
- package/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/cjs/components/search-bar/search-bar.js +3 -0
- package/cjs/components/side-bar/side-bar.d.ts +2 -1
- package/cjs/components/swiper/index.d.ts +1 -1
- package/cjs/components/swiper/swiper.d.ts +1 -1
- package/cjs/components/text-area/text-area.js +2 -1
- package/cjs/components/toast/toast.css +1 -1
- package/cjs/utils/get-scroll-parent.js +1 -1
- package/es/components/action-sheet/action-sheet.css +19 -7
- package/es/components/action-sheet/action-sheet.js +8 -15
- package/es/components/badge/badge.d.ts +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/index.d.ts +1 -1
- package/es/components/button/button.d.ts +6 -4
- package/es/components/button/button.js +5 -1
- package/es/components/calendar/calendar.css +3 -0
- package/es/components/calendar/calendar.d.ts +1 -0
- package/es/components/calendar/calendar.js +2 -2
- package/es/components/form/form-item.js +1 -4
- package/es/components/image/broken-image-icon.d.ts +1 -0
- package/es/components/image/broken-image-icon.js +9 -0
- package/es/components/image/image-icon.d.ts +1 -0
- package/es/components/image/image-icon.js +9 -0
- package/es/components/image/image.css +4 -2
- package/es/components/image/image.d.ts +1 -0
- package/es/components/image/image.js +8 -5
- package/es/components/image-uploader/image-uploader.js +2 -5
- package/es/components/infinite-scroll/infinite-scroll.js +8 -6
- package/es/components/popover/popover.css +1 -0
- package/es/components/search-bar/search-bar.d.ts +1 -1
- package/es/components/search-bar/search-bar.js +3 -0
- package/es/components/side-bar/side-bar.d.ts +2 -1
- package/es/components/swiper/index.d.ts +1 -1
- package/es/components/swiper/swiper.d.ts +1 -1
- package/es/components/text-area/text-area.js +2 -1
- package/es/components/toast/toast.css +1 -1
- package/es/utils/get-scroll-parent.js +1 -1
- package/package.json +5 -5
- package/umd/antd-mobile.js +1 -1
package/bundle/antd-mobile.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __rest, __awaiter } from "tslib";
|
|
2
|
-
import React$1, { useContext, useRef, useEffect, useMemo, useState, memo, forwardRef,
|
|
2
|
+
import React$1, { useContext, useRef, useEffect, useMemo, useState, useImperativeHandle, memo, forwardRef, useCallback, createContext, cloneElement, createRef } from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { useUnmountedRef, useUpdate, useMemoizedFn, useUpdateEffect, useIsomorphicLayoutEffect, createUpdateEffect, useThrottleFn, useDebounceEffect, useMount, useInViewport, useClickAway, useUnmount, useLockFn, useTimeout } from "ahooks";
|
|
5
5
|
import { useSpring, animated, to } from "@react-spring/web";
|
|
6
6
|
import dayjs from "dayjs";
|
|
7
7
|
import { isFragment, isMemo } from "react-is";
|
|
8
8
|
import { useDrag, useWheel, createUseGesture, dragAction, pinchAction } from "@use-gesture/react";
|
|
9
|
-
import { RightOutline, CheckOutline, DownOutline,
|
|
9
|
+
import { RightOutline, CheckOutline, DownOutline, DownFill, QuestionCircleOutline, CloseOutline, AddOutline, CloseCircleFill, LeftOutline, SoundOutline, TextDeletionOutline, StarFill, CheckCircleFill, InformationCircleFill, ClockCircleFill, ExclamationCircleFill, SearchOutline, MinusOutline } from "antd-mobile-icons";
|
|
10
10
|
import { staged } from "staged-components";
|
|
11
11
|
import RcForm, { List as List$2, Field, useForm, useWatch } from "rc-field-form";
|
|
12
12
|
import { computePosition, offset, shift, limitShift, flip, hide, arrow, autoUpdate } from "@floating-ui/dom";
|
|
@@ -1616,7 +1616,7 @@ function getScrollParent(el2, root2 = defaultRoot) {
|
|
|
1616
1616
|
const {
|
|
1617
1617
|
overflowY
|
|
1618
1618
|
} = window.getComputedStyle(node);
|
|
1619
|
-
if (overflowStylePatterns.includes(overflowY)) {
|
|
1619
|
+
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
1620
1620
|
return node;
|
|
1621
1621
|
}
|
|
1622
1622
|
node = node.parentNode;
|
|
@@ -9023,127 +9023,11 @@ const Popup = (p2) => {
|
|
|
9023
9023
|
}, shouldRender && props.children))));
|
|
9024
9024
|
return renderToContainer(props.getContainer, node);
|
|
9025
9025
|
};
|
|
9026
|
-
var button = "";
|
|
9027
|
-
var dotLoading = "";
|
|
9028
|
-
const classPrefix$1e = `adm-dot-loading`;
|
|
9029
|
-
const colorRecord$3 = {
|
|
9030
|
-
default: "var(--adm-color-weak)",
|
|
9031
|
-
primary: "var(--adm-color-primary)",
|
|
9032
|
-
white: "var(--adm-color-white)"
|
|
9033
|
-
};
|
|
9034
|
-
const defaultProps$X = {
|
|
9035
|
-
color: "default"
|
|
9036
|
-
};
|
|
9037
|
-
const DotLoading = memo((p2) => {
|
|
9038
|
-
var _a;
|
|
9039
|
-
const props = mergeProps(defaultProps$X, p2);
|
|
9040
|
-
return withNativeProps(props, React$1.createElement("div", {
|
|
9041
|
-
style: {
|
|
9042
|
-
color: (_a = colorRecord$3[props.color]) !== null && _a !== void 0 ? _a : props.color
|
|
9043
|
-
},
|
|
9044
|
-
className: classNames("adm-loading", classPrefix$1e)
|
|
9045
|
-
}, React$1.createElement("svg", {
|
|
9046
|
-
height: "1em",
|
|
9047
|
-
viewBox: "0 0 100 40",
|
|
9048
|
-
style: {
|
|
9049
|
-
verticalAlign: "-0.125em"
|
|
9050
|
-
}
|
|
9051
|
-
}, React$1.createElement("g", {
|
|
9052
|
-
stroke: "none",
|
|
9053
|
-
strokeWidth: "1",
|
|
9054
|
-
fill: "none",
|
|
9055
|
-
fillRule: "evenodd"
|
|
9056
|
-
}, React$1.createElement("g", {
|
|
9057
|
-
transform: "translate(-100.000000, -71.000000)"
|
|
9058
|
-
}, React$1.createElement("g", {
|
|
9059
|
-
transform: "translate(95.000000, 71.000000)"
|
|
9060
|
-
}, React$1.createElement("g", {
|
|
9061
|
-
transform: "translate(5.000000, 0.000000)"
|
|
9062
|
-
}, [0, 1, 2].map((i) => React$1.createElement("rect", {
|
|
9063
|
-
key: i,
|
|
9064
|
-
fill: "currentColor",
|
|
9065
|
-
x: 20 + i * 26,
|
|
9066
|
-
y: "16",
|
|
9067
|
-
width: "8",
|
|
9068
|
-
height: "8",
|
|
9069
|
-
rx: "2"
|
|
9070
|
-
}, React$1.createElement("animate", {
|
|
9071
|
-
attributeName: "y",
|
|
9072
|
-
from: "16",
|
|
9073
|
-
to: "16",
|
|
9074
|
-
dur: "2s",
|
|
9075
|
-
begin: `${i * 0.2}s`,
|
|
9076
|
-
repeatCount: "indefinite",
|
|
9077
|
-
values: "16; 6; 26; 16; 16",
|
|
9078
|
-
keyTimes: "0; 0.1; 0.3; 0.4; 1"
|
|
9079
|
-
}))))))))));
|
|
9080
|
-
});
|
|
9081
|
-
function isPromise(obj) {
|
|
9082
|
-
return !!obj && typeof obj === "object" && typeof obj.then === "function";
|
|
9083
|
-
}
|
|
9084
|
-
const classPrefix$1d = `adm-button`;
|
|
9085
|
-
const defaultProps$W = {
|
|
9086
|
-
color: "default",
|
|
9087
|
-
fill: "solid",
|
|
9088
|
-
block: false,
|
|
9089
|
-
loading: false,
|
|
9090
|
-
loadingIcon: React$1.createElement(DotLoading, {
|
|
9091
|
-
color: "currentColor"
|
|
9092
|
-
}),
|
|
9093
|
-
type: "button",
|
|
9094
|
-
shape: "default",
|
|
9095
|
-
size: "middle"
|
|
9096
|
-
};
|
|
9097
|
-
const Button = forwardRef((p2, ref) => {
|
|
9098
|
-
const props = mergeProps(defaultProps$W, p2);
|
|
9099
|
-
const [innerLoading, setInnerLoading] = useState(false);
|
|
9100
|
-
const nativeButtonRef = useRef(null);
|
|
9101
|
-
const loading = props.loading === "auto" ? innerLoading : props.loading;
|
|
9102
|
-
const disabled = props.disabled || loading;
|
|
9103
|
-
useImperativeHandle(ref, () => ({
|
|
9104
|
-
get nativeElement() {
|
|
9105
|
-
return nativeButtonRef.current;
|
|
9106
|
-
}
|
|
9107
|
-
}));
|
|
9108
|
-
const handleClick = (e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
9109
|
-
if (!props.onClick)
|
|
9110
|
-
return;
|
|
9111
|
-
const promise = props.onClick(e);
|
|
9112
|
-
if (isPromise(promise)) {
|
|
9113
|
-
try {
|
|
9114
|
-
setInnerLoading(true);
|
|
9115
|
-
yield promise;
|
|
9116
|
-
setInnerLoading(false);
|
|
9117
|
-
} catch (e2) {
|
|
9118
|
-
setInnerLoading(false);
|
|
9119
|
-
throw e2;
|
|
9120
|
-
}
|
|
9121
|
-
}
|
|
9122
|
-
});
|
|
9123
|
-
return withNativeProps(props, React$1.createElement("button", {
|
|
9124
|
-
ref: nativeButtonRef,
|
|
9125
|
-
type: props.type,
|
|
9126
|
-
onClick: handleClick,
|
|
9127
|
-
className: classNames(classPrefix$1d, props.color ? `${classPrefix$1d}-${props.color}` : null, {
|
|
9128
|
-
[`${classPrefix$1d}-block`]: props.block,
|
|
9129
|
-
[`${classPrefix$1d}-disabled`]: disabled,
|
|
9130
|
-
[`${classPrefix$1d}-fill-outline`]: props.fill === "outline",
|
|
9131
|
-
[`${classPrefix$1d}-fill-none`]: props.fill === "none",
|
|
9132
|
-
[`${classPrefix$1d}-mini`]: props.size === "mini",
|
|
9133
|
-
[`${classPrefix$1d}-small`]: props.size === "small",
|
|
9134
|
-
[`${classPrefix$1d}-large`]: props.size === "large",
|
|
9135
|
-
[`${classPrefix$1d}-loading`]: loading
|
|
9136
|
-
}, `${classPrefix$1d}-shape-${props.shape}`),
|
|
9137
|
-
disabled
|
|
9138
|
-
}, loading ? React$1.createElement("div", {
|
|
9139
|
-
className: `${classPrefix$1d}-loading-wrapper`
|
|
9140
|
-
}, props.loadingIcon, props.loadingText) : props.children));
|
|
9141
|
-
});
|
|
9142
9026
|
var safeArea = "";
|
|
9143
|
-
const classPrefix$
|
|
9027
|
+
const classPrefix$1e = "adm-safe-area";
|
|
9144
9028
|
const SafeArea = (props) => {
|
|
9145
9029
|
return withNativeProps(props, React$1.createElement("div", {
|
|
9146
|
-
className: classNames(classPrefix$
|
|
9030
|
+
className: classNames(classPrefix$1e, `${classPrefix$1e}-position-${props.position}`)
|
|
9147
9031
|
}));
|
|
9148
9032
|
};
|
|
9149
9033
|
const fullClone = Object.assign({}, ReactDOM);
|
|
@@ -9259,8 +9143,8 @@ function renderImperatively(element) {
|
|
|
9259
9143
|
close
|
|
9260
9144
|
};
|
|
9261
9145
|
}
|
|
9262
|
-
const classPrefix$
|
|
9263
|
-
const defaultProps$
|
|
9146
|
+
const classPrefix$1d = `adm-action-sheet`;
|
|
9147
|
+
const defaultProps$X = {
|
|
9264
9148
|
visible: false,
|
|
9265
9149
|
actions: [],
|
|
9266
9150
|
cancelText: "",
|
|
@@ -9269,7 +9153,7 @@ const defaultProps$V = {
|
|
|
9269
9153
|
safeArea: true
|
|
9270
9154
|
};
|
|
9271
9155
|
const ActionSheet = (p2) => {
|
|
9272
|
-
const props = mergeProps(defaultProps$
|
|
9156
|
+
const props = mergeProps(defaultProps$X, p2);
|
|
9273
9157
|
return React$1.createElement(Popup, {
|
|
9274
9158
|
visible: props.visible,
|
|
9275
9159
|
onMaskClick: () => {
|
|
@@ -9280,23 +9164,23 @@ const ActionSheet = (p2) => {
|
|
|
9280
9164
|
}
|
|
9281
9165
|
},
|
|
9282
9166
|
afterClose: props.afterClose,
|
|
9283
|
-
className: classNames(`${classPrefix$
|
|
9167
|
+
className: classNames(`${classPrefix$1d}-popup`, props.popupClassName),
|
|
9284
9168
|
style: props.popupStyle,
|
|
9285
9169
|
getContainer: props.getContainer
|
|
9286
9170
|
}, withNativeProps(props, React$1.createElement("div", {
|
|
9287
|
-
className: classPrefix$
|
|
9171
|
+
className: classPrefix$1d
|
|
9288
9172
|
}, props.extra && React$1.createElement("div", {
|
|
9289
|
-
className: `${classPrefix$
|
|
9173
|
+
className: `${classPrefix$1d}-extra`
|
|
9290
9174
|
}, props.extra), React$1.createElement("div", {
|
|
9291
|
-
className: `${classPrefix$
|
|
9175
|
+
className: `${classPrefix$1d}-button-list`
|
|
9292
9176
|
}, props.actions.map((action, index2) => React$1.createElement("div", {
|
|
9293
9177
|
key: action.key,
|
|
9294
|
-
className: `${classPrefix$
|
|
9295
|
-
}, React$1.createElement(
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9178
|
+
className: `${classPrefix$1d}-button-item-wrapper`
|
|
9179
|
+
}, React$1.createElement("a", {
|
|
9180
|
+
className: classNames("adm-plain-anchor", `${classPrefix$1d}-button-item`, {
|
|
9181
|
+
[`${classPrefix$1d}-button-item-danger`]: action.danger,
|
|
9182
|
+
[`${classPrefix$1d}-button-item-disabled`]: action.disabled
|
|
9183
|
+
}),
|
|
9300
9184
|
onClick: () => {
|
|
9301
9185
|
var _a, _b, _c;
|
|
9302
9186
|
(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action);
|
|
@@ -9304,29 +9188,23 @@ const ActionSheet = (p2) => {
|
|
|
9304
9188
|
if (props.closeOnAction) {
|
|
9305
9189
|
(_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
9306
9190
|
}
|
|
9307
|
-
}
|
|
9308
|
-
className: classNames(`${classPrefix$1b}-button-item`, {
|
|
9309
|
-
[`${classPrefix$1b}-button-item-danger`]: action.danger
|
|
9310
|
-
})
|
|
9191
|
+
}
|
|
9311
9192
|
}, React$1.createElement("div", {
|
|
9312
|
-
className: `${classPrefix$
|
|
9193
|
+
className: `${classPrefix$1d}-button-item-name`
|
|
9313
9194
|
}, action.text), action.description && React$1.createElement("div", {
|
|
9314
|
-
className: `${classPrefix$
|
|
9195
|
+
className: `${classPrefix$1d}-button-item-description`
|
|
9315
9196
|
}, action.description))))), props.cancelText && React$1.createElement("div", {
|
|
9316
|
-
className: `${classPrefix$
|
|
9197
|
+
className: `${classPrefix$1d}-cancel`
|
|
9317
9198
|
}, React$1.createElement("div", {
|
|
9318
|
-
className: `${classPrefix$
|
|
9319
|
-
}, React$1.createElement(
|
|
9320
|
-
|
|
9321
|
-
fill: "none",
|
|
9322
|
-
shape: "rectangular",
|
|
9323
|
-
className: `${classPrefix$1b}-button-item`,
|
|
9199
|
+
className: `${classPrefix$1d}-button-item-wrapper`
|
|
9200
|
+
}, React$1.createElement("a", {
|
|
9201
|
+
className: classNames("adm-plain-anchor", `${classPrefix$1d}-button-item`),
|
|
9324
9202
|
onClick: () => {
|
|
9325
9203
|
var _a;
|
|
9326
9204
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
9327
9205
|
}
|
|
9328
9206
|
}, React$1.createElement("div", {
|
|
9329
|
-
className: `${classPrefix$
|
|
9207
|
+
className: `${classPrefix$1d}-button-item-name`
|
|
9330
9208
|
}, props.cancelText)))), props.safeArea && React$1.createElement(SafeArea, {
|
|
9331
9209
|
position: "bottom"
|
|
9332
9210
|
}))));
|
|
@@ -9338,12 +9216,12 @@ var index$h = attachPropertiesToComponent(ActionSheet, {
|
|
|
9338
9216
|
show: showActionSheet
|
|
9339
9217
|
});
|
|
9340
9218
|
var autoCenter = "";
|
|
9341
|
-
const classPrefix$
|
|
9219
|
+
const classPrefix$1c = "adm-auto-center";
|
|
9342
9220
|
const AutoCenter = (props) => {
|
|
9343
9221
|
return withNativeProps(props, React$1.createElement("div", {
|
|
9344
|
-
className: classPrefix$
|
|
9222
|
+
className: classPrefix$1c
|
|
9345
9223
|
}, React$1.createElement("div", {
|
|
9346
|
-
className: `${classPrefix$
|
|
9224
|
+
className: `${classPrefix$1c}-content`
|
|
9347
9225
|
}, props.children)));
|
|
9348
9226
|
};
|
|
9349
9227
|
var avatar = "";
|
|
@@ -9385,15 +9263,15 @@ const Fallback = memo(() => React$1.createElement("svg", {
|
|
|
9385
9263
|
fillRule: "nonzero",
|
|
9386
9264
|
mask: "url(#mask-2)"
|
|
9387
9265
|
}))))));
|
|
9388
|
-
const classPrefix$
|
|
9389
|
-
const defaultProps$
|
|
9266
|
+
const classPrefix$1b = "adm-avatar";
|
|
9267
|
+
const defaultProps$W = {
|
|
9390
9268
|
fallback: React$1.createElement(Fallback, null),
|
|
9391
9269
|
fit: "cover"
|
|
9392
9270
|
};
|
|
9393
9271
|
const Avatar = (p2) => {
|
|
9394
|
-
const props = mergeProps(defaultProps$
|
|
9272
|
+
const props = mergeProps(defaultProps$W, p2);
|
|
9395
9273
|
return withNativeProps(props, React$1.createElement(Image$1, {
|
|
9396
|
-
className: classPrefix$
|
|
9274
|
+
className: classPrefix$1b,
|
|
9397
9275
|
src: props.src,
|
|
9398
9276
|
fallback: props.fallback,
|
|
9399
9277
|
placeholder: props.fallback,
|
|
@@ -9405,8 +9283,8 @@ const Avatar = (p2) => {
|
|
|
9405
9283
|
}));
|
|
9406
9284
|
};
|
|
9407
9285
|
var badge = "";
|
|
9408
|
-
const classPrefix$
|
|
9409
|
-
const dot =
|
|
9286
|
+
const classPrefix$1a = `adm-badge`;
|
|
9287
|
+
const dot = React$1.createElement(React$1.Fragment, null);
|
|
9410
9288
|
const Badge$1 = (props) => {
|
|
9411
9289
|
const {
|
|
9412
9290
|
content,
|
|
@@ -9414,22 +9292,142 @@ const Badge$1 = (props) => {
|
|
|
9414
9292
|
children
|
|
9415
9293
|
} = props;
|
|
9416
9294
|
const isDot = content === dot;
|
|
9417
|
-
const badgeCls = classNames(classPrefix$
|
|
9295
|
+
const badgeCls = classNames(classPrefix$1a, !!children && `${classPrefix$1a}-fixed`, isDot && `${classPrefix$1a}-dot`, props.bordered && `${classPrefix$1a}-bordered`);
|
|
9418
9296
|
const element = content || content === 0 ? withNativeProps(props, React$1.createElement("div", {
|
|
9419
9297
|
className: badgeCls,
|
|
9420
9298
|
style: {
|
|
9421
9299
|
"--color": color
|
|
9422
9300
|
}
|
|
9423
9301
|
}, !isDot && React$1.createElement("div", {
|
|
9424
|
-
className: `${classPrefix$
|
|
9302
|
+
className: `${classPrefix$1a}-content`
|
|
9425
9303
|
}, content))) : null;
|
|
9426
9304
|
return children ? React$1.createElement("div", {
|
|
9427
|
-
className: `${classPrefix$
|
|
9305
|
+
className: `${classPrefix$1a}-wrap`
|
|
9428
9306
|
}, children, element) : element;
|
|
9429
9307
|
};
|
|
9430
9308
|
var Badge = attachPropertiesToComponent(Badge$1, {
|
|
9431
9309
|
dot
|
|
9432
9310
|
});
|
|
9311
|
+
var button = "";
|
|
9312
|
+
var dotLoading = "";
|
|
9313
|
+
const classPrefix$19 = `adm-dot-loading`;
|
|
9314
|
+
const colorRecord$3 = {
|
|
9315
|
+
default: "var(--adm-color-weak)",
|
|
9316
|
+
primary: "var(--adm-color-primary)",
|
|
9317
|
+
white: "var(--adm-color-white)"
|
|
9318
|
+
};
|
|
9319
|
+
const defaultProps$V = {
|
|
9320
|
+
color: "default"
|
|
9321
|
+
};
|
|
9322
|
+
const DotLoading = memo((p2) => {
|
|
9323
|
+
var _a;
|
|
9324
|
+
const props = mergeProps(defaultProps$V, p2);
|
|
9325
|
+
return withNativeProps(props, React$1.createElement("div", {
|
|
9326
|
+
style: {
|
|
9327
|
+
color: (_a = colorRecord$3[props.color]) !== null && _a !== void 0 ? _a : props.color
|
|
9328
|
+
},
|
|
9329
|
+
className: classNames("adm-loading", classPrefix$19)
|
|
9330
|
+
}, React$1.createElement("svg", {
|
|
9331
|
+
height: "1em",
|
|
9332
|
+
viewBox: "0 0 100 40",
|
|
9333
|
+
style: {
|
|
9334
|
+
verticalAlign: "-0.125em"
|
|
9335
|
+
}
|
|
9336
|
+
}, React$1.createElement("g", {
|
|
9337
|
+
stroke: "none",
|
|
9338
|
+
strokeWidth: "1",
|
|
9339
|
+
fill: "none",
|
|
9340
|
+
fillRule: "evenodd"
|
|
9341
|
+
}, React$1.createElement("g", {
|
|
9342
|
+
transform: "translate(-100.000000, -71.000000)"
|
|
9343
|
+
}, React$1.createElement("g", {
|
|
9344
|
+
transform: "translate(95.000000, 71.000000)"
|
|
9345
|
+
}, React$1.createElement("g", {
|
|
9346
|
+
transform: "translate(5.000000, 0.000000)"
|
|
9347
|
+
}, [0, 1, 2].map((i) => React$1.createElement("rect", {
|
|
9348
|
+
key: i,
|
|
9349
|
+
fill: "currentColor",
|
|
9350
|
+
x: 20 + i * 26,
|
|
9351
|
+
y: "16",
|
|
9352
|
+
width: "8",
|
|
9353
|
+
height: "8",
|
|
9354
|
+
rx: "2"
|
|
9355
|
+
}, React$1.createElement("animate", {
|
|
9356
|
+
attributeName: "y",
|
|
9357
|
+
from: "16",
|
|
9358
|
+
to: "16",
|
|
9359
|
+
dur: "2s",
|
|
9360
|
+
begin: `${i * 0.2}s`,
|
|
9361
|
+
repeatCount: "indefinite",
|
|
9362
|
+
values: "16; 6; 26; 16; 16",
|
|
9363
|
+
keyTimes: "0; 0.1; 0.3; 0.4; 1"
|
|
9364
|
+
}))))))))));
|
|
9365
|
+
});
|
|
9366
|
+
function isPromise(obj) {
|
|
9367
|
+
return !!obj && typeof obj === "object" && typeof obj.then === "function";
|
|
9368
|
+
}
|
|
9369
|
+
const classPrefix$18 = `adm-button`;
|
|
9370
|
+
const defaultProps$U = {
|
|
9371
|
+
color: "default",
|
|
9372
|
+
fill: "solid",
|
|
9373
|
+
block: false,
|
|
9374
|
+
loading: false,
|
|
9375
|
+
loadingIcon: React$1.createElement(DotLoading, {
|
|
9376
|
+
color: "currentColor"
|
|
9377
|
+
}),
|
|
9378
|
+
type: "button",
|
|
9379
|
+
shape: "default",
|
|
9380
|
+
size: "middle"
|
|
9381
|
+
};
|
|
9382
|
+
const Button = forwardRef((p2, ref) => {
|
|
9383
|
+
const props = mergeProps(defaultProps$U, p2);
|
|
9384
|
+
const [innerLoading, setInnerLoading] = useState(false);
|
|
9385
|
+
const nativeButtonRef = useRef(null);
|
|
9386
|
+
const loading = props.loading === "auto" ? innerLoading : props.loading;
|
|
9387
|
+
const disabled = props.disabled || loading;
|
|
9388
|
+
useImperativeHandle(ref, () => ({
|
|
9389
|
+
get nativeElement() {
|
|
9390
|
+
return nativeButtonRef.current;
|
|
9391
|
+
}
|
|
9392
|
+
}));
|
|
9393
|
+
const handleClick = (e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
9394
|
+
if (!props.onClick)
|
|
9395
|
+
return;
|
|
9396
|
+
const promise = props.onClick(e);
|
|
9397
|
+
if (isPromise(promise)) {
|
|
9398
|
+
try {
|
|
9399
|
+
setInnerLoading(true);
|
|
9400
|
+
yield promise;
|
|
9401
|
+
setInnerLoading(false);
|
|
9402
|
+
} catch (e2) {
|
|
9403
|
+
setInnerLoading(false);
|
|
9404
|
+
throw e2;
|
|
9405
|
+
}
|
|
9406
|
+
}
|
|
9407
|
+
});
|
|
9408
|
+
return withNativeProps(props, React$1.createElement("button", {
|
|
9409
|
+
ref: nativeButtonRef,
|
|
9410
|
+
type: props.type,
|
|
9411
|
+
onClick: handleClick,
|
|
9412
|
+
className: classNames(classPrefix$18, props.color ? `${classPrefix$18}-${props.color}` : null, {
|
|
9413
|
+
[`${classPrefix$18}-block`]: props.block,
|
|
9414
|
+
[`${classPrefix$18}-disabled`]: disabled,
|
|
9415
|
+
[`${classPrefix$18}-fill-outline`]: props.fill === "outline",
|
|
9416
|
+
[`${classPrefix$18}-fill-none`]: props.fill === "none",
|
|
9417
|
+
[`${classPrefix$18}-mini`]: props.size === "mini",
|
|
9418
|
+
[`${classPrefix$18}-small`]: props.size === "small",
|
|
9419
|
+
[`${classPrefix$18}-large`]: props.size === "large",
|
|
9420
|
+
[`${classPrefix$18}-loading`]: loading
|
|
9421
|
+
}, `${classPrefix$18}-shape-${props.shape}`),
|
|
9422
|
+
disabled,
|
|
9423
|
+
onMouseDown: props.onMouseDown,
|
|
9424
|
+
onMouseUp: props.onMouseUp,
|
|
9425
|
+
onTouchStart: props.onTouchStart,
|
|
9426
|
+
onTouchEnd: props.onTouchEnd
|
|
9427
|
+
}, loading ? React$1.createElement("div", {
|
|
9428
|
+
className: `${classPrefix$18}-loading-wrapper`
|
|
9429
|
+
}, props.loadingIcon, props.loadingText) : props.children));
|
|
9430
|
+
});
|
|
9433
9431
|
var calendar = "";
|
|
9434
9432
|
const ArrowLeft = () => {
|
|
9435
9433
|
return React$1.createElement("svg", {
|
|
@@ -9651,10 +9649,10 @@ const Calendar = forwardRef((p2, ref) => {
|
|
|
9651
9649
|
isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
|
|
9652
9650
|
}
|
|
9653
9651
|
const inThisMonth = d.month() === current.month();
|
|
9654
|
-
const disabled =
|
|
9652
|
+
const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
|
|
9655
9653
|
cells.push(React$1.createElement("div", {
|
|
9656
9654
|
key: d.valueOf(),
|
|
9657
|
-
className: classNames(`${classPrefix$17}-cell`, disabled && `${classPrefix$17}-cell-disabled`, inThisMonth && {
|
|
9655
|
+
className: classNames(`${classPrefix$17}-cell`, (disabled || !inThisMonth) && `${classPrefix$17}-cell-disabled`, inThisMonth && {
|
|
9658
9656
|
[`${classPrefix$17}-cell-today`]: d.isSame(today, "day"),
|
|
9659
9657
|
[`${classPrefix$17}-cell-selected`]: isSelect,
|
|
9660
9658
|
[`${classPrefix$17}-cell-selected-begin`]: isBegin,
|
|
@@ -12253,16 +12251,33 @@ const LazyDetector = (props) => {
|
|
|
12253
12251
|
ref
|
|
12254
12252
|
});
|
|
12255
12253
|
};
|
|
12254
|
+
const ImageIcon = () => React$1.createElement("svg", {
|
|
12255
|
+
viewBox: "0 0 48 48",
|
|
12256
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
12257
|
+
}, React$1.createElement("path", {
|
|
12258
|
+
d: "M41.396 6.234c1.923 0 3.487 1.574 3.487 3.505v29.14c0 1.937-1.568 3.51-3.491 3.51H6.604c-1.923 0-3.487-1.573-3.487-3.51V9.745c0-1.936 1.564-3.51 3.487-3.51Zm0 2.847H6.604c-.355 0-.654.3-.654.658V34.9l5.989-8.707a2.373 2.373 0 0 1 1.801-1.005 2.405 2.405 0 0 1 1.933.752l4.182 4.525 7.58-11.005a2.374 2.374 0 0 1 1.96-1.01c.79 0 1.532.38 1.966 1.01L42.05 34.89V9.74a.664.664 0 0 0-.654-.658Zm-28.305 2.763a3.119 3.119 0 0 1 3.117 3.117 3.119 3.119 0 0 1-3.117 3.117 3.122 3.122 0 0 1-3.117-3.117 3.119 3.119 0 0 1 3.117-3.117Z",
|
|
12259
|
+
fill: "#DBDBDB",
|
|
12260
|
+
fillRule: "nonzero"
|
|
12261
|
+
}));
|
|
12262
|
+
const BrokenImageIcon = () => React$1.createElement("svg", {
|
|
12263
|
+
viewBox: "0 0 48 48",
|
|
12264
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
12265
|
+
}, React$1.createElement("path", {
|
|
12266
|
+
d: "M19.233 6.233 17.42 9.08l-10.817.001a.665.665 0 0 0-.647.562l-.007.096V34.9l5.989-8.707a2.373 2.373 0 0 1 1.801-1.005 2.415 2.415 0 0 1 1.807.625l.126.127 4.182 4.525 2.267-3.292 5.461 7.841-4.065 7.375H6.604c-1.86 0-3.382-1.47-3.482-3.317l-.005-.192V9.744c0-1.872 1.461-3.405 3.296-3.505l.19-.005h12.63Zm22.163 0c1.86 0 3.382 1.472 3.482 3.314l.005.192v29.14a3.507 3.507 0 0 1-3.3 3.505l-.191.006H27.789l3.63-6.587.06-.119a1.87 1.87 0 0 0-.163-1.853l-6.928-9.949 3.047-4.422a2.374 2.374 0 0 1 1.96-1.01 2.4 2.4 0 0 1 1.86.87l.106.14L42.05 34.89V9.74a.664.664 0 0 0-.654-.658H21.855l1.812-2.848h17.73Zm-28.305 5.611c.794 0 1.52.298 2.07.788l-.843 1.325-.067.114a1.87 1.87 0 0 0 .11 1.959l.848 1.217c-.556.515-1.3.83-2.118.83a3.122 3.122 0 0 1-3.117-3.116 3.119 3.119 0 0 1 3.117-3.117Z",
|
|
12267
|
+
fill: "#DBDBDB",
|
|
12268
|
+
fillRule: "nonzero"
|
|
12269
|
+
}));
|
|
12256
12270
|
const classPrefix$S = `adm-image`;
|
|
12257
12271
|
const defaultProps$H = {
|
|
12258
12272
|
fit: "fill",
|
|
12259
12273
|
placeholder: React$1.createElement("div", {
|
|
12260
12274
|
className: `${classPrefix$S}-tip`
|
|
12261
|
-
}, React$1.createElement(
|
|
12275
|
+
}, React$1.createElement(ImageIcon, null)),
|
|
12262
12276
|
fallback: React$1.createElement("div", {
|
|
12263
12277
|
className: `${classPrefix$S}-tip`
|
|
12264
|
-
}, React$1.createElement(
|
|
12265
|
-
lazy: false
|
|
12278
|
+
}, React$1.createElement(BrokenImageIcon, null)),
|
|
12279
|
+
lazy: false,
|
|
12280
|
+
draggable: false
|
|
12266
12281
|
};
|
|
12267
12282
|
const Image$1 = staged((p2) => {
|
|
12268
12283
|
const props = mergeProps(defaultProps$H, p2);
|
|
@@ -12307,7 +12322,8 @@ const Image$1 = staged((p2) => {
|
|
|
12307
12322
|
referrerPolicy: props.referrerPolicy,
|
|
12308
12323
|
sizes: props.sizes,
|
|
12309
12324
|
srcSet,
|
|
12310
|
-
useMap: props.useMap
|
|
12325
|
+
useMap: props.useMap,
|
|
12326
|
+
draggable: props.draggable
|
|
12311
12327
|
});
|
|
12312
12328
|
return React$1.createElement(React$1.Fragment, null, !loaded && props.placeholder, img);
|
|
12313
12329
|
}
|
|
@@ -14316,9 +14332,7 @@ const FormItem = (props) => {
|
|
|
14316
14332
|
return renderLayout(children);
|
|
14317
14333
|
}
|
|
14318
14334
|
let Variables = {};
|
|
14319
|
-
|
|
14320
|
-
Variables.label = label;
|
|
14321
|
-
}
|
|
14335
|
+
Variables.label = typeof label === "string" ? label : "";
|
|
14322
14336
|
if (messageVariables) {
|
|
14323
14337
|
Variables = Object.assign(Object.assign({}, Variables), messageVariables);
|
|
14324
14338
|
}
|
|
@@ -14913,9 +14927,6 @@ const ImageUploader = (p2) => {
|
|
|
14913
14927
|
} = useConfig();
|
|
14914
14928
|
const props = mergeProps(defaultProps$t, p2);
|
|
14915
14929
|
const [value, setValue] = usePropsValue(props);
|
|
14916
|
-
const updateValue = useMemoizedFn((updater) => {
|
|
14917
|
-
setValue(updater(value));
|
|
14918
|
-
});
|
|
14919
14930
|
const [tasks, setTasks] = useState([]);
|
|
14920
14931
|
useIsomorphicLayoutEffect(() => {
|
|
14921
14932
|
setTasks((prev) => prev.filter((task) => {
|
|
@@ -14987,7 +14998,7 @@ const ImageUploader = (p2) => {
|
|
|
14987
14998
|
return task;
|
|
14988
14999
|
});
|
|
14989
15000
|
});
|
|
14990
|
-
|
|
15001
|
+
setValue((prev) => {
|
|
14991
15002
|
const newVal = Object.assign({}, result2);
|
|
14992
15003
|
return [...prev, newVal];
|
|
14993
15004
|
});
|
|
@@ -15266,6 +15277,7 @@ const InfiniteScroll = (p2) => {
|
|
|
15266
15277
|
const elementRef = useRef(null);
|
|
15267
15278
|
const [flag, setFlag] = useState({});
|
|
15268
15279
|
const nextFlagRef = useRef(flag);
|
|
15280
|
+
const [scrollParent, setScrollParent] = useState();
|
|
15269
15281
|
const check = useMemoizedFn(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
15270
15282
|
if (nextFlagRef.current !== flag)
|
|
15271
15283
|
return;
|
|
@@ -15277,6 +15289,7 @@ const InfiniteScroll = (p2) => {
|
|
|
15277
15289
|
if (!element.offsetParent)
|
|
15278
15290
|
return;
|
|
15279
15291
|
const parent = getScrollParent(element);
|
|
15292
|
+
setScrollParent(parent);
|
|
15280
15293
|
if (!parent)
|
|
15281
15294
|
return;
|
|
15282
15295
|
const rect = element.getBoundingClientRect();
|
|
@@ -15296,17 +15309,16 @@ const InfiniteScroll = (p2) => {
|
|
|
15296
15309
|
const element = elementRef.current;
|
|
15297
15310
|
if (!element)
|
|
15298
15311
|
return;
|
|
15299
|
-
|
|
15300
|
-
if (!parent)
|
|
15312
|
+
if (!scrollParent)
|
|
15301
15313
|
return;
|
|
15302
15314
|
function onScroll() {
|
|
15303
15315
|
check();
|
|
15304
15316
|
}
|
|
15305
|
-
|
|
15317
|
+
scrollParent.addEventListener("scroll", onScroll);
|
|
15306
15318
|
return () => {
|
|
15307
|
-
|
|
15319
|
+
scrollParent.removeEventListener("scroll", onScroll);
|
|
15308
15320
|
};
|
|
15309
|
-
}, []);
|
|
15321
|
+
}, [scrollParent]);
|
|
15310
15322
|
return withNativeProps(props, React$1.createElement("div", {
|
|
15311
15323
|
className: classPrefix$w,
|
|
15312
15324
|
ref: elementRef
|
|
@@ -16570,6 +16582,9 @@ const SearchBar = forwardRef((p2, ref) => {
|
|
|
16570
16582
|
}
|
|
16571
16583
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
16572
16584
|
(_c = props.onCancel) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
16585
|
+
},
|
|
16586
|
+
onMouseDown: (e) => {
|
|
16587
|
+
e.preventDefault();
|
|
16573
16588
|
}
|
|
16574
16589
|
}, props.cancelText));
|
|
16575
16590
|
};
|
|
@@ -17986,7 +18001,8 @@ const TextArea = forwardRef((p2, ref) => {
|
|
|
17986
18001
|
var _a;
|
|
17987
18002
|
compositingRef.current = false;
|
|
17988
18003
|
if (maxLength) {
|
|
17989
|
-
|
|
18004
|
+
const v = e.target.value;
|
|
18005
|
+
setValue([...v].slice(0, maxLength).join(""));
|
|
17990
18006
|
}
|
|
17991
18007
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
17992
18008
|
},
|