antd-mobile 5.37.0 → 5.37.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/2x/bundle/antd-mobile.cjs.development.js +923 -873
- package/2x/bundle/antd-mobile.cjs.js +7 -7
- package/2x/bundle/antd-mobile.es.development.js +923 -873
- package/2x/bundle/antd-mobile.es.js +4924 -4897
- package/2x/bundle/antd-mobile.umd.development.js +923 -873
- package/2x/bundle/antd-mobile.umd.js +7 -7
- package/2x/bundle/style.css +45 -45
- package/2x/cjs/components/calendar-picker/calendar-picker.js +12 -6
- package/2x/cjs/components/calendar-picker-view/calendar-picker-view.d.ts +3 -0
- package/2x/cjs/components/calendar-picker-view/calendar-picker-view.js +41 -19
- package/2x/cjs/components/calendar-picker-view/useSyncScroll.d.ts +2 -0
- package/2x/cjs/components/calendar-picker-view/useSyncScroll.js +39 -0
- package/2x/cjs/components/nav-bar/nav-bar.js +6 -6
- package/2x/es/components/calendar-picker/calendar-picker.js +11 -5
- package/2x/es/components/calendar-picker-view/calendar-picker-view.d.ts +3 -0
- package/2x/es/components/calendar-picker-view/calendar-picker-view.js +40 -19
- package/2x/es/components/calendar-picker-view/useSyncScroll.d.ts +2 -0
- package/2x/es/components/calendar-picker-view/useSyncScroll.js +33 -0
- package/2x/es/components/nav-bar/nav-bar.js +7 -7
- package/2x/package.json +1 -1
- package/bundle/antd-mobile.cjs.development.js +923 -873
- package/bundle/antd-mobile.cjs.js +7 -7
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +923 -873
- package/bundle/antd-mobile.es.js +4924 -4897
- package/bundle/antd-mobile.umd.development.js +923 -873
- package/bundle/antd-mobile.umd.js +7 -7
- package/bundle/style.css +1 -1
- package/cjs/components/calendar-picker/calendar-picker.js +12 -6
- package/cjs/components/calendar-picker-view/calendar-picker-view.d.ts +3 -0
- package/cjs/components/calendar-picker-view/calendar-picker-view.js +41 -19
- package/cjs/components/calendar-picker-view/useSyncScroll.d.ts +2 -0
- package/cjs/components/calendar-picker-view/useSyncScroll.js +39 -0
- package/cjs/components/nav-bar/nav-bar.js +6 -6
- package/es/components/calendar-picker/calendar-picker.js +11 -5
- package/es/components/calendar-picker-view/calendar-picker-view.d.ts +3 -0
- package/es/components/calendar-picker-view/calendar-picker-view.js +40 -19
- package/es/components/calendar-picker-view/useSyncScroll.d.ts +2 -0
- package/es/components/calendar-picker-view/useSyncScroll.js +33 -0
- package/es/components/nav-bar/nav-bar.js +7 -7
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -5848,7 +5848,7 @@ const colorRecord$4 = {
|
|
|
5848
5848
|
black: "0, 0, 0",
|
|
5849
5849
|
white: "255, 255, 255"
|
|
5850
5850
|
};
|
|
5851
|
-
const defaultProps$
|
|
5851
|
+
const defaultProps$14 = {
|
|
5852
5852
|
visible: true,
|
|
5853
5853
|
destroyOnClose: false,
|
|
5854
5854
|
forceRender: false,
|
|
@@ -5859,7 +5859,7 @@ const defaultProps$15 = {
|
|
|
5859
5859
|
stopPropagation: ["click"]
|
|
5860
5860
|
};
|
|
5861
5861
|
const Mask = (p) => {
|
|
5862
|
-
const props = mergeProps(defaultProps$
|
|
5862
|
+
const props = mergeProps(defaultProps$14, p);
|
|
5863
5863
|
const {
|
|
5864
5864
|
locale
|
|
5865
5865
|
} = useConfig();
|
|
@@ -8374,7 +8374,7 @@ function createUseGesture(actions) {
|
|
|
8374
8374
|
};
|
|
8375
8375
|
}
|
|
8376
8376
|
const classPrefix$1o = `adm-popup`;
|
|
8377
|
-
const defaultProps$
|
|
8377
|
+
const defaultProps$13 = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
8378
8378
|
closeOnSwipe: false,
|
|
8379
8379
|
position: "bottom"
|
|
8380
8380
|
});
|
|
@@ -8383,7 +8383,7 @@ const Popup = (p) => {
|
|
|
8383
8383
|
locale,
|
|
8384
8384
|
popup: componentConfig = {}
|
|
8385
8385
|
} = useConfig();
|
|
8386
|
-
const props = mergeProps(defaultProps$
|
|
8386
|
+
const props = mergeProps(defaultProps$13, componentConfig, p);
|
|
8387
8387
|
const bodyCls = classNames(`${classPrefix$1o}-body`, props.bodyClassName, `${classPrefix$1o}-body-position-${props.position}`);
|
|
8388
8388
|
const [active, setActive] = React$1.useState(props.visible);
|
|
8389
8389
|
const ref = React$1.useRef(null);
|
|
@@ -8624,7 +8624,7 @@ function renderImperatively(element) {
|
|
|
8624
8624
|
};
|
|
8625
8625
|
}
|
|
8626
8626
|
const classPrefix$1m = `adm-action-sheet`;
|
|
8627
|
-
const defaultProps$
|
|
8627
|
+
const defaultProps$12 = {
|
|
8628
8628
|
visible: false,
|
|
8629
8629
|
actions: [],
|
|
8630
8630
|
cancelText: "",
|
|
@@ -8635,7 +8635,7 @@ const defaultProps$13 = {
|
|
|
8635
8635
|
forceRender: false
|
|
8636
8636
|
};
|
|
8637
8637
|
const ActionSheet = (p) => {
|
|
8638
|
-
const props = mergeProps(defaultProps$
|
|
8638
|
+
const props = mergeProps(defaultProps$12, p);
|
|
8639
8639
|
const {
|
|
8640
8640
|
styles
|
|
8641
8641
|
} = props;
|
|
@@ -8808,7 +8808,7 @@ const BrokenImageIcon = () => React$1.createElement("svg", {
|
|
|
8808
8808
|
fillRule: "nonzero"
|
|
8809
8809
|
}));
|
|
8810
8810
|
const classPrefix$1k = `adm-image`;
|
|
8811
|
-
const defaultProps$
|
|
8811
|
+
const defaultProps$11 = {
|
|
8812
8812
|
fit: "fill",
|
|
8813
8813
|
placeholder: React$1.createElement("div", {
|
|
8814
8814
|
className: `${classPrefix$1k}-tip`
|
|
@@ -8820,7 +8820,7 @@ const defaultProps$12 = {
|
|
|
8820
8820
|
draggable: false
|
|
8821
8821
|
};
|
|
8822
8822
|
const Image$1 = staged_1((p) => {
|
|
8823
|
-
const props = mergeProps(defaultProps$
|
|
8823
|
+
const props = mergeProps(defaultProps$11, p);
|
|
8824
8824
|
const [loaded, setLoaded] = React$1.useState(false);
|
|
8825
8825
|
const [failed, setFailed] = React$1.useState(false);
|
|
8826
8826
|
const ref = React$1.useRef(null);
|
|
@@ -8897,12 +8897,12 @@ const Image$1 = staged_1((p) => {
|
|
|
8897
8897
|
}), renderInner()));
|
|
8898
8898
|
});
|
|
8899
8899
|
const classPrefix$1j = "adm-avatar";
|
|
8900
|
-
const defaultProps$
|
|
8900
|
+
const defaultProps$10 = {
|
|
8901
8901
|
fallback: React$1.createElement(Fallback, null),
|
|
8902
8902
|
fit: "cover"
|
|
8903
8903
|
};
|
|
8904
8904
|
const Avatar = (p) => {
|
|
8905
|
-
const props = mergeProps(defaultProps$
|
|
8905
|
+
const props = mergeProps(defaultProps$10, p);
|
|
8906
8906
|
return withNativeProps(props, React$1.createElement(Image$1, {
|
|
8907
8907
|
className: classPrefix$1j,
|
|
8908
8908
|
src: props.src,
|
|
@@ -8952,12 +8952,12 @@ const colorRecord$3 = {
|
|
|
8952
8952
|
primary: "var(--adm-color-primary)",
|
|
8953
8953
|
white: "var(--adm-color-white)"
|
|
8954
8954
|
};
|
|
8955
|
-
const defaultProps
|
|
8955
|
+
const defaultProps$$ = {
|
|
8956
8956
|
color: "default"
|
|
8957
8957
|
};
|
|
8958
8958
|
const DotLoading = React$1.memo((p) => {
|
|
8959
8959
|
var _a;
|
|
8960
|
-
const props = mergeProps(defaultProps
|
|
8960
|
+
const props = mergeProps(defaultProps$$, p);
|
|
8961
8961
|
return withNativeProps(props, React$1.createElement("div", {
|
|
8962
8962
|
style: {
|
|
8963
8963
|
color: (_a = colorRecord$3[props.color]) !== null && _a !== void 0 ? _a : props.color
|
|
@@ -9006,7 +9006,7 @@ function isIOS() {
|
|
|
9006
9006
|
return canUseDom$1 ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
|
9007
9007
|
}
|
|
9008
9008
|
const classPrefix$1g = `adm-button`;
|
|
9009
|
-
const defaultProps
|
|
9009
|
+
const defaultProps$_ = {
|
|
9010
9010
|
color: "default",
|
|
9011
9011
|
fill: "solid",
|
|
9012
9012
|
block: false,
|
|
@@ -9019,7 +9019,7 @@ const defaultProps$$ = {
|
|
|
9019
9019
|
size: "middle"
|
|
9020
9020
|
};
|
|
9021
9021
|
const Button = React$1.forwardRef((p, ref) => {
|
|
9022
|
-
const props = mergeProps(defaultProps
|
|
9022
|
+
const props = mergeProps(defaultProps$_, p);
|
|
9023
9023
|
const [innerLoading, setInnerLoading] = React$1.useState(false);
|
|
9024
9024
|
const nativeButtonRef = React$1.useRef(null);
|
|
9025
9025
|
const loading = props.loading === "auto" ? innerLoading : props.loading;
|
|
@@ -9202,7 +9202,7 @@ function convertPageToDayjs$1(page) {
|
|
|
9202
9202
|
}
|
|
9203
9203
|
dayjs.extend(isoWeek);
|
|
9204
9204
|
const classPrefix$1f = "adm-calendar";
|
|
9205
|
-
const defaultProps$
|
|
9205
|
+
const defaultProps$Z = {
|
|
9206
9206
|
weekStartsOn: "Sunday",
|
|
9207
9207
|
defaultValue: null,
|
|
9208
9208
|
allowClear: true,
|
|
@@ -9213,7 +9213,7 @@ const defaultProps$_ = {
|
|
|
9213
9213
|
};
|
|
9214
9214
|
const Calendar = React$1.forwardRef((p, ref) => {
|
|
9215
9215
|
const today = dayjs();
|
|
9216
|
-
const props = mergeProps(defaultProps$
|
|
9216
|
+
const props = mergeProps(defaultProps$Z, p);
|
|
9217
9217
|
const {
|
|
9218
9218
|
locale
|
|
9219
9219
|
} = useConfig();
|
|
@@ -9411,19 +9411,6 @@ const Calendar = React$1.forwardRef((p, ref) => {
|
|
|
9411
9411
|
className: classPrefix$1f
|
|
9412
9412
|
}, header, mark, body));
|
|
9413
9413
|
});
|
|
9414
|
-
const classPrefix$1e = `adm-divider`;
|
|
9415
|
-
const defaultProps$Z = {
|
|
9416
|
-
contentPosition: "center",
|
|
9417
|
-
direction: "horizontal"
|
|
9418
|
-
};
|
|
9419
|
-
const Divider = (p) => {
|
|
9420
|
-
const props = mergeProps(defaultProps$Z, p);
|
|
9421
|
-
return withNativeProps(props, React$1.createElement("div", {
|
|
9422
|
-
className: classNames(classPrefix$1e, `${classPrefix$1e}-${props.direction}`, `${classPrefix$1e}-${props.contentPosition}`)
|
|
9423
|
-
}, props.children && React$1.createElement("div", {
|
|
9424
|
-
className: `${classPrefix$1e}-content`
|
|
9425
|
-
}, props.children)));
|
|
9426
|
-
};
|
|
9427
9414
|
var isSameOrBefore$1 = { exports: {} };
|
|
9428
9415
|
(function(module2, exports2) {
|
|
9429
9416
|
!function(e2, i2) {
|
|
@@ -9449,224 +9436,770 @@ function convertValueToRange(selectionMode, value) {
|
|
|
9449
9436
|
function convertPageToDayjs(page) {
|
|
9450
9437
|
return dayjs().year(page.year).month(page.month - 1).date(1);
|
|
9451
9438
|
}
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
usePopup: true,
|
|
9460
|
-
selectionMode: "single"
|
|
9461
|
-
};
|
|
9462
|
-
const CalendarPickerView = React$1.forwardRef((p, ref) => {
|
|
9463
|
-
var _a;
|
|
9464
|
-
const today = dayjs();
|
|
9465
|
-
const props = mergeProps(defaultProps$Y, p);
|
|
9466
|
-
const {
|
|
9467
|
-
locale
|
|
9468
|
-
} = useConfig();
|
|
9469
|
-
const markItems = [...locale.Calendar.markItems];
|
|
9470
|
-
if (props.weekStartsOn === "Sunday") {
|
|
9471
|
-
const item = markItems.pop();
|
|
9472
|
-
if (item)
|
|
9473
|
-
markItems.unshift(item);
|
|
9474
|
-
}
|
|
9475
|
-
const [dateRange, setDateRange] = usePropsValue({
|
|
9476
|
-
value: props.value === void 0 ? void 0 : convertValueToRange(props.selectionMode, props.value),
|
|
9477
|
-
defaultValue: convertValueToRange(props.selectionMode, props.defaultValue),
|
|
9478
|
-
onChange: (v) => {
|
|
9479
|
-
var _a2, _b;
|
|
9480
|
-
if (props.selectionMode === "single") {
|
|
9481
|
-
(_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, v ? v[0] : null);
|
|
9482
|
-
} else if (props.selectionMode === "range") {
|
|
9483
|
-
(_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, v);
|
|
9484
|
-
}
|
|
9439
|
+
function useEvent(callback) {
|
|
9440
|
+
var fnRef = React__namespace.useRef();
|
|
9441
|
+
fnRef.current = callback;
|
|
9442
|
+
var memoFn = React__namespace.useCallback(function() {
|
|
9443
|
+
var _fnRef$current;
|
|
9444
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9445
|
+
args[_key] = arguments[_key];
|
|
9485
9446
|
}
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9447
|
+
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
9448
|
+
}, []);
|
|
9449
|
+
return memoFn;
|
|
9450
|
+
}
|
|
9451
|
+
function _arrayWithHoles(arr) {
|
|
9452
|
+
if (Array.isArray(arr))
|
|
9453
|
+
return arr;
|
|
9454
|
+
}
|
|
9455
|
+
function _iterableToArrayLimit(r, l) {
|
|
9456
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
9457
|
+
if (null != t) {
|
|
9458
|
+
var e2, n2, i2, u, a = [], f = true, o = false;
|
|
9459
|
+
try {
|
|
9460
|
+
if (i2 = (t = t.call(r)).next, 0 === l) {
|
|
9461
|
+
if (Object(t) !== t)
|
|
9462
|
+
return;
|
|
9463
|
+
f = false;
|
|
9464
|
+
} else
|
|
9465
|
+
for (; !(f = (e2 = i2.call(t)).done) && (a.push(e2.value), a.length !== l); f = true)
|
|
9466
|
+
;
|
|
9467
|
+
} catch (r2) {
|
|
9468
|
+
o = true, n2 = r2;
|
|
9469
|
+
} finally {
|
|
9470
|
+
try {
|
|
9471
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u))
|
|
9472
|
+
return;
|
|
9473
|
+
} finally {
|
|
9474
|
+
if (o)
|
|
9475
|
+
throw n2;
|
|
9499
9476
|
}
|
|
9500
|
-
setCurrent(convertPageToDayjs(page));
|
|
9501
|
-
},
|
|
9502
|
-
jumpToToday: () => {
|
|
9503
|
-
setCurrent(dayjs().date(1));
|
|
9504
|
-
},
|
|
9505
|
-
getDateRange: () => dateRange
|
|
9506
|
-
}));
|
|
9507
|
-
const header = React$1.createElement("div", {
|
|
9508
|
-
className: `${classPrefix$1d}-header`
|
|
9509
|
-
}, React$1.createElement("div", {
|
|
9510
|
-
className: `${classPrefix$1d}-title`
|
|
9511
|
-
}, (_a = props.title) !== null && _a !== void 0 ? _a : locale.Calendar.title));
|
|
9512
|
-
const maxDay = React$1.useMemo(() => props.max ? dayjs(props.max) : current.add(6, "month"), [props.max, current]);
|
|
9513
|
-
const minDay = React$1.useMemo(() => props.min ? dayjs(props.min) : current, [props.min, current]);
|
|
9514
|
-
function renderBody() {
|
|
9515
|
-
var _a2;
|
|
9516
|
-
const cells = [];
|
|
9517
|
-
let monthIterator = minDay;
|
|
9518
|
-
while (monthIterator.isSameOrBefore(maxDay, "month")) {
|
|
9519
|
-
const year = monthIterator.year();
|
|
9520
|
-
const month = monthIterator.month();
|
|
9521
|
-
const renderMap = {
|
|
9522
|
-
year,
|
|
9523
|
-
month: month + 1
|
|
9524
|
-
};
|
|
9525
|
-
cells.push(React$1.createElement("div", {
|
|
9526
|
-
key: `${year}-${month}`
|
|
9527
|
-
}, React$1.createElement("div", {
|
|
9528
|
-
className: `${classPrefix$1d}-title`
|
|
9529
|
-
}, (_a2 = locale.Calendar.yearAndMonth) === null || _a2 === void 0 ? void 0 : _a2.replace(/\${(.*?)}/g, (_, variable) => {
|
|
9530
|
-
var _a3;
|
|
9531
|
-
return (_a3 = renderMap[variable]) === null || _a3 === void 0 ? void 0 : _a3.toString();
|
|
9532
|
-
})), React$1.createElement("div", {
|
|
9533
|
-
className: `${classPrefix$1d}-cells`
|
|
9534
|
-
}, Array(props.weekStartsOn === "Monday" ? monthIterator.date(1).isoWeekday() - 1 : monthIterator.date(1).isoWeekday()).fill(null).map((_, index2) => React$1.createElement("div", {
|
|
9535
|
-
key: index2,
|
|
9536
|
-
className: `${classPrefix$1d}-cell`
|
|
9537
|
-
})), Array(monthIterator.daysInMonth()).fill(null).map((_, index2) => {
|
|
9538
|
-
var _a3;
|
|
9539
|
-
const d = monthIterator.date(index2 + 1);
|
|
9540
|
-
let isSelect = false;
|
|
9541
|
-
let isBegin = false;
|
|
9542
|
-
let isEnd = false;
|
|
9543
|
-
let isSelectRowBegin = false;
|
|
9544
|
-
let isSelectRowEnd = false;
|
|
9545
|
-
if (dateRange) {
|
|
9546
|
-
const [begin, end] = dateRange;
|
|
9547
|
-
isBegin = d.isSame(begin, "day");
|
|
9548
|
-
isEnd = d.isSame(end, "day");
|
|
9549
|
-
isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
|
|
9550
|
-
if (isSelect) {
|
|
9551
|
-
isSelectRowBegin = (cells.length % 7 === 0 || d.isSame(d.startOf("month"), "day")) && !isBegin;
|
|
9552
|
-
isSelectRowEnd = (cells.length % 7 === 6 || d.isSame(d.endOf("month"), "day")) && !isEnd;
|
|
9553
|
-
}
|
|
9554
|
-
}
|
|
9555
|
-
const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
|
|
9556
|
-
const renderTop = () => {
|
|
9557
|
-
var _a4;
|
|
9558
|
-
const top = (_a4 = props.renderTop) === null || _a4 === void 0 ? void 0 : _a4.call(props, d.toDate());
|
|
9559
|
-
if (top) {
|
|
9560
|
-
return top;
|
|
9561
|
-
}
|
|
9562
|
-
if (props.selectionMode === "range") {
|
|
9563
|
-
if (isBegin) {
|
|
9564
|
-
return locale.Calendar.start;
|
|
9565
|
-
}
|
|
9566
|
-
if (isEnd) {
|
|
9567
|
-
return locale.Calendar.end;
|
|
9568
|
-
}
|
|
9569
|
-
}
|
|
9570
|
-
if (d.isSame(today, "day") && !isSelect) {
|
|
9571
|
-
return locale.Calendar.today;
|
|
9572
|
-
}
|
|
9573
|
-
};
|
|
9574
|
-
return React$1.createElement("div", {
|
|
9575
|
-
key: d.valueOf(),
|
|
9576
|
-
className: classNames(`${classPrefix$1d}-cell`, {
|
|
9577
|
-
[`${classPrefix$1d}-cell-today`]: d.isSame(today, "day"),
|
|
9578
|
-
[`${classPrefix$1d}-cell-selected`]: isSelect,
|
|
9579
|
-
[`${classPrefix$1d}-cell-selected-begin`]: isBegin,
|
|
9580
|
-
[`${classPrefix$1d}-cell-selected-end`]: isEnd,
|
|
9581
|
-
[`${classPrefix$1d}-cell-selected-row-begin`]: isSelectRowBegin,
|
|
9582
|
-
[`${classPrefix$1d}-cell-selected-row-end`]: isSelectRowEnd,
|
|
9583
|
-
[`${classPrefix$1d}-cell-disabled`]: !!disabled
|
|
9584
|
-
}),
|
|
9585
|
-
onClick: () => {
|
|
9586
|
-
if (!props.selectionMode)
|
|
9587
|
-
return;
|
|
9588
|
-
if (disabled)
|
|
9589
|
-
return;
|
|
9590
|
-
const date4 = d.toDate();
|
|
9591
|
-
function shouldClear() {
|
|
9592
|
-
if (!props.allowClear)
|
|
9593
|
-
return false;
|
|
9594
|
-
if (!dateRange)
|
|
9595
|
-
return false;
|
|
9596
|
-
const [begin, end] = dateRange;
|
|
9597
|
-
return d.isSame(begin, "date") && d.isSame(end, "day");
|
|
9598
|
-
}
|
|
9599
|
-
if (props.selectionMode === "single") {
|
|
9600
|
-
if (props.allowClear && shouldClear()) {
|
|
9601
|
-
setDateRange(null);
|
|
9602
|
-
return;
|
|
9603
|
-
}
|
|
9604
|
-
setDateRange([date4, date4]);
|
|
9605
|
-
} else if (props.selectionMode === "range") {
|
|
9606
|
-
if (!dateRange) {
|
|
9607
|
-
setDateRange([date4, date4]);
|
|
9608
|
-
setIntermediate(true);
|
|
9609
|
-
return;
|
|
9610
|
-
}
|
|
9611
|
-
if (shouldClear()) {
|
|
9612
|
-
setDateRange(null);
|
|
9613
|
-
setIntermediate(false);
|
|
9614
|
-
return;
|
|
9615
|
-
}
|
|
9616
|
-
if (intermediate) {
|
|
9617
|
-
const another = dateRange[0];
|
|
9618
|
-
setDateRange(another > date4 ? [date4, another] : [another, date4]);
|
|
9619
|
-
setIntermediate(false);
|
|
9620
|
-
} else {
|
|
9621
|
-
setDateRange([date4, date4]);
|
|
9622
|
-
setIntermediate(true);
|
|
9623
|
-
}
|
|
9624
|
-
}
|
|
9625
|
-
}
|
|
9626
|
-
}, React$1.createElement("div", {
|
|
9627
|
-
className: `${classPrefix$1d}-cell-top`
|
|
9628
|
-
}, renderTop()), React$1.createElement("div", {
|
|
9629
|
-
className: `${classPrefix$1d}-cell-date`
|
|
9630
|
-
}, props.renderDate ? props.renderDate(d.toDate()) : d.date()), React$1.createElement("div", {
|
|
9631
|
-
className: `${classPrefix$1d}-cell-bottom`
|
|
9632
|
-
}, (_a3 = props.renderBottom) === null || _a3 === void 0 ? void 0 : _a3.call(props, d.toDate())));
|
|
9633
|
-
}))));
|
|
9634
|
-
monthIterator = monthIterator.add(1, "month");
|
|
9635
9477
|
}
|
|
9636
|
-
return
|
|
9478
|
+
return a;
|
|
9637
9479
|
}
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
}
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9480
|
+
}
|
|
9481
|
+
function _arrayLikeToArray(arr, len) {
|
|
9482
|
+
if (len == null || len > arr.length)
|
|
9483
|
+
len = arr.length;
|
|
9484
|
+
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
|
|
9485
|
+
arr2[i2] = arr[i2];
|
|
9486
|
+
return arr2;
|
|
9487
|
+
}
|
|
9488
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
9489
|
+
if (!o)
|
|
9490
|
+
return;
|
|
9491
|
+
if (typeof o === "string")
|
|
9492
|
+
return _arrayLikeToArray(o, minLen);
|
|
9493
|
+
var n2 = Object.prototype.toString.call(o).slice(8, -1);
|
|
9494
|
+
if (n2 === "Object" && o.constructor)
|
|
9495
|
+
n2 = o.constructor.name;
|
|
9496
|
+
if (n2 === "Map" || n2 === "Set")
|
|
9497
|
+
return Array.from(o);
|
|
9498
|
+
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
9499
|
+
return _arrayLikeToArray(o, minLen);
|
|
9500
|
+
}
|
|
9501
|
+
function _nonIterableRest() {
|
|
9502
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
9503
|
+
}
|
|
9504
|
+
function _slicedToArray(arr, i2) {
|
|
9505
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
|
|
9506
|
+
}
|
|
9507
|
+
function canUseDom() {
|
|
9508
|
+
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
9509
|
+
}
|
|
9510
|
+
var useInternalLayoutEffect = canUseDom() ? React__namespace.useLayoutEffect : React__namespace.useEffect;
|
|
9511
|
+
var useLayoutEffect = function useLayoutEffect2(callback, deps) {
|
|
9512
|
+
var firstMountRef = React__namespace.useRef(true);
|
|
9513
|
+
useInternalLayoutEffect(function() {
|
|
9514
|
+
return callback(firstMountRef.current);
|
|
9515
|
+
}, deps);
|
|
9516
|
+
useInternalLayoutEffect(function() {
|
|
9517
|
+
firstMountRef.current = false;
|
|
9518
|
+
return function() {
|
|
9519
|
+
firstMountRef.current = true;
|
|
9520
|
+
};
|
|
9521
|
+
}, []);
|
|
9522
|
+
};
|
|
9523
|
+
var useLayoutUpdateEffect = function useLayoutUpdateEffect2(callback, deps) {
|
|
9524
|
+
useLayoutEffect(function(firstMount) {
|
|
9525
|
+
if (!firstMount) {
|
|
9526
|
+
return callback();
|
|
9527
|
+
}
|
|
9528
|
+
}, deps);
|
|
9529
|
+
};
|
|
9530
|
+
function useSafeState(defaultValue) {
|
|
9531
|
+
var destroyRef = React__namespace.useRef(false);
|
|
9532
|
+
var _React$useState = React__namespace.useState(defaultValue), _React$useState2 = _slicedToArray(_React$useState, 2), value = _React$useState2[0], setValue2 = _React$useState2[1];
|
|
9533
|
+
React__namespace.useEffect(function() {
|
|
9534
|
+
destroyRef.current = false;
|
|
9535
|
+
return function() {
|
|
9536
|
+
destroyRef.current = true;
|
|
9537
|
+
};
|
|
9538
|
+
}, []);
|
|
9539
|
+
function safeSetState(updater, ignoreDestroy) {
|
|
9540
|
+
if (ignoreDestroy && destroyRef.current) {
|
|
9541
|
+
return;
|
|
9542
|
+
}
|
|
9543
|
+
setValue2(updater);
|
|
9544
|
+
}
|
|
9545
|
+
return [value, safeSetState];
|
|
9546
|
+
}
|
|
9547
|
+
function hasValue(value) {
|
|
9548
|
+
return value !== void 0;
|
|
9549
|
+
}
|
|
9550
|
+
function useMergedState(defaultStateValue, option) {
|
|
9551
|
+
var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState;
|
|
9552
|
+
var _useState = useSafeState(function() {
|
|
9553
|
+
if (hasValue(value)) {
|
|
9554
|
+
return value;
|
|
9555
|
+
} else if (hasValue(defaultValue)) {
|
|
9556
|
+
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
9557
|
+
} else {
|
|
9558
|
+
return typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue;
|
|
9559
|
+
}
|
|
9560
|
+
}), _useState2 = _slicedToArray(_useState, 2), innerValue = _useState2[0], setInnerValue = _useState2[1];
|
|
9561
|
+
var mergedValue = value !== void 0 ? value : innerValue;
|
|
9562
|
+
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
|
|
9563
|
+
var onChangeFn = useEvent(onChange);
|
|
9564
|
+
var _useState3 = useSafeState([mergedValue]), _useState4 = _slicedToArray(_useState3, 2), prevValue = _useState4[0], setPrevValue = _useState4[1];
|
|
9565
|
+
useLayoutUpdateEffect(function() {
|
|
9566
|
+
var prev = prevValue[0];
|
|
9567
|
+
if (innerValue !== prev) {
|
|
9568
|
+
onChangeFn(innerValue, prev);
|
|
9569
|
+
}
|
|
9570
|
+
}, [prevValue]);
|
|
9571
|
+
useLayoutUpdateEffect(function() {
|
|
9572
|
+
if (!hasValue(value)) {
|
|
9573
|
+
setInnerValue(value);
|
|
9574
|
+
}
|
|
9575
|
+
}, [value]);
|
|
9576
|
+
var triggerChange = useEvent(function(updater, ignoreDestroy) {
|
|
9577
|
+
setInnerValue(updater, ignoreDestroy);
|
|
9578
|
+
setPrevValue([mergedValue], ignoreDestroy);
|
|
9579
|
+
});
|
|
9580
|
+
return [postMergedValue, triggerChange];
|
|
9581
|
+
}
|
|
9582
|
+
function _typeof$1(o) {
|
|
9583
|
+
"@babel/helpers - typeof";
|
|
9584
|
+
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
9585
|
+
return typeof o2;
|
|
9586
|
+
} : function(o2) {
|
|
9587
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
9588
|
+
}, _typeof$1(o);
|
|
9589
|
+
}
|
|
9590
|
+
var reactIs = { exports: {} };
|
|
9591
|
+
var reactIs_development = {};
|
|
9592
|
+
/**
|
|
9593
|
+
* @license React
|
|
9594
|
+
* react-is.development.js
|
|
9595
|
+
*
|
|
9596
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9597
|
+
*
|
|
9598
|
+
* This source code is licensed under the MIT license found in the
|
|
9599
|
+
* LICENSE file in the root directory of this source tree.
|
|
9600
|
+
*/
|
|
9601
|
+
{
|
|
9602
|
+
(function() {
|
|
9603
|
+
var REACT_ELEMENT_TYPE2 = Symbol.for("react.element");
|
|
9604
|
+
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
9605
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
9606
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
9607
|
+
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
9608
|
+
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
9609
|
+
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
9610
|
+
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
|
|
9611
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
9612
|
+
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
9613
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
9614
|
+
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
9615
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
9616
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
9617
|
+
var enableScopeAPI = false;
|
|
9618
|
+
var enableCacheElement = false;
|
|
9619
|
+
var enableTransitionTracing = false;
|
|
9620
|
+
var enableLegacyHidden = false;
|
|
9621
|
+
var enableDebugTracing = false;
|
|
9622
|
+
var REACT_MODULE_REFERENCE;
|
|
9623
|
+
{
|
|
9624
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
9625
|
+
}
|
|
9626
|
+
function isValidElementType(type4) {
|
|
9627
|
+
if (typeof type4 === "string" || typeof type4 === "function") {
|
|
9628
|
+
return true;
|
|
9629
|
+
}
|
|
9630
|
+
if (type4 === REACT_FRAGMENT_TYPE || type4 === REACT_PROFILER_TYPE || enableDebugTracing || type4 === REACT_STRICT_MODE_TYPE || type4 === REACT_SUSPENSE_TYPE || type4 === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type4 === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
9631
|
+
return true;
|
|
9632
|
+
}
|
|
9633
|
+
if (typeof type4 === "object" && type4 !== null) {
|
|
9634
|
+
if (type4.$$typeof === REACT_LAZY_TYPE || type4.$$typeof === REACT_MEMO_TYPE || type4.$$typeof === REACT_PROVIDER_TYPE || type4.$$typeof === REACT_CONTEXT_TYPE || type4.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
9635
|
+
// types supported by any Flight configuration anywhere since
|
|
9636
|
+
// we don't know which Flight build this will end up being used
|
|
9637
|
+
// with.
|
|
9638
|
+
type4.$$typeof === REACT_MODULE_REFERENCE || type4.getModuleId !== void 0) {
|
|
9639
|
+
return true;
|
|
9640
|
+
}
|
|
9641
|
+
}
|
|
9642
|
+
return false;
|
|
9643
|
+
}
|
|
9644
|
+
function typeOf(object4) {
|
|
9645
|
+
if (typeof object4 === "object" && object4 !== null) {
|
|
9646
|
+
var $$typeof = object4.$$typeof;
|
|
9647
|
+
switch ($$typeof) {
|
|
9648
|
+
case REACT_ELEMENT_TYPE2:
|
|
9649
|
+
var type4 = object4.type;
|
|
9650
|
+
switch (type4) {
|
|
9651
|
+
case REACT_FRAGMENT_TYPE:
|
|
9652
|
+
case REACT_PROFILER_TYPE:
|
|
9653
|
+
case REACT_STRICT_MODE_TYPE:
|
|
9654
|
+
case REACT_SUSPENSE_TYPE:
|
|
9655
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
9656
|
+
return type4;
|
|
9657
|
+
default:
|
|
9658
|
+
var $$typeofType = type4 && type4.$$typeof;
|
|
9659
|
+
switch ($$typeofType) {
|
|
9660
|
+
case REACT_SERVER_CONTEXT_TYPE:
|
|
9661
|
+
case REACT_CONTEXT_TYPE:
|
|
9662
|
+
case REACT_FORWARD_REF_TYPE:
|
|
9663
|
+
case REACT_LAZY_TYPE:
|
|
9664
|
+
case REACT_MEMO_TYPE:
|
|
9665
|
+
case REACT_PROVIDER_TYPE:
|
|
9666
|
+
return $$typeofType;
|
|
9667
|
+
default:
|
|
9668
|
+
return $$typeof;
|
|
9669
|
+
}
|
|
9670
|
+
}
|
|
9671
|
+
case REACT_PORTAL_TYPE:
|
|
9672
|
+
return $$typeof;
|
|
9673
|
+
}
|
|
9674
|
+
}
|
|
9675
|
+
return void 0;
|
|
9676
|
+
}
|
|
9677
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
9678
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
9679
|
+
var Element2 = REACT_ELEMENT_TYPE2;
|
|
9680
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
9681
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
9682
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
9683
|
+
var Memo = REACT_MEMO_TYPE;
|
|
9684
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
9685
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
9686
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
9687
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
9688
|
+
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
9689
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
9690
|
+
var hasWarnedAboutDeprecatedIsConcurrentMode = false;
|
|
9691
|
+
function isAsyncMode(object4) {
|
|
9692
|
+
{
|
|
9693
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
9694
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
9695
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
|
|
9696
|
+
}
|
|
9697
|
+
}
|
|
9698
|
+
return false;
|
|
9699
|
+
}
|
|
9700
|
+
function isConcurrentMode(object4) {
|
|
9701
|
+
{
|
|
9702
|
+
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
9703
|
+
hasWarnedAboutDeprecatedIsConcurrentMode = true;
|
|
9704
|
+
console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
|
|
9705
|
+
}
|
|
9706
|
+
}
|
|
9707
|
+
return false;
|
|
9708
|
+
}
|
|
9709
|
+
function isContextConsumer(object4) {
|
|
9710
|
+
return typeOf(object4) === REACT_CONTEXT_TYPE;
|
|
9711
|
+
}
|
|
9712
|
+
function isContextProvider(object4) {
|
|
9713
|
+
return typeOf(object4) === REACT_PROVIDER_TYPE;
|
|
9714
|
+
}
|
|
9715
|
+
function isElement2(object4) {
|
|
9716
|
+
return typeof object4 === "object" && object4 !== null && object4.$$typeof === REACT_ELEMENT_TYPE2;
|
|
9717
|
+
}
|
|
9718
|
+
function isForwardRef(object4) {
|
|
9719
|
+
return typeOf(object4) === REACT_FORWARD_REF_TYPE;
|
|
9720
|
+
}
|
|
9721
|
+
function isFragment(object4) {
|
|
9722
|
+
return typeOf(object4) === REACT_FRAGMENT_TYPE;
|
|
9723
|
+
}
|
|
9724
|
+
function isLazy(object4) {
|
|
9725
|
+
return typeOf(object4) === REACT_LAZY_TYPE;
|
|
9726
|
+
}
|
|
9727
|
+
function isMemo(object4) {
|
|
9728
|
+
return typeOf(object4) === REACT_MEMO_TYPE;
|
|
9729
|
+
}
|
|
9730
|
+
function isPortal(object4) {
|
|
9731
|
+
return typeOf(object4) === REACT_PORTAL_TYPE;
|
|
9732
|
+
}
|
|
9733
|
+
function isProfiler(object4) {
|
|
9734
|
+
return typeOf(object4) === REACT_PROFILER_TYPE;
|
|
9735
|
+
}
|
|
9736
|
+
function isStrictMode(object4) {
|
|
9737
|
+
return typeOf(object4) === REACT_STRICT_MODE_TYPE;
|
|
9738
|
+
}
|
|
9739
|
+
function isSuspense(object4) {
|
|
9740
|
+
return typeOf(object4) === REACT_SUSPENSE_TYPE;
|
|
9741
|
+
}
|
|
9742
|
+
function isSuspenseList(object4) {
|
|
9743
|
+
return typeOf(object4) === REACT_SUSPENSE_LIST_TYPE;
|
|
9744
|
+
}
|
|
9745
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
9746
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
9747
|
+
reactIs_development.Element = Element2;
|
|
9748
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
9749
|
+
reactIs_development.Fragment = Fragment;
|
|
9750
|
+
reactIs_development.Lazy = Lazy;
|
|
9751
|
+
reactIs_development.Memo = Memo;
|
|
9752
|
+
reactIs_development.Portal = Portal;
|
|
9753
|
+
reactIs_development.Profiler = Profiler;
|
|
9754
|
+
reactIs_development.StrictMode = StrictMode;
|
|
9755
|
+
reactIs_development.Suspense = Suspense;
|
|
9756
|
+
reactIs_development.SuspenseList = SuspenseList;
|
|
9757
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
9758
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
9759
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
9760
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
9761
|
+
reactIs_development.isElement = isElement2;
|
|
9762
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
9763
|
+
reactIs_development.isFragment = isFragment;
|
|
9764
|
+
reactIs_development.isLazy = isLazy;
|
|
9765
|
+
reactIs_development.isMemo = isMemo;
|
|
9766
|
+
reactIs_development.isPortal = isPortal;
|
|
9767
|
+
reactIs_development.isProfiler = isProfiler;
|
|
9768
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
9769
|
+
reactIs_development.isSuspense = isSuspense;
|
|
9770
|
+
reactIs_development.isSuspenseList = isSuspenseList;
|
|
9771
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
9772
|
+
reactIs_development.typeOf = typeOf;
|
|
9773
|
+
})();
|
|
9774
|
+
}
|
|
9775
|
+
{
|
|
9776
|
+
reactIs.exports = reactIs_development;
|
|
9777
|
+
}
|
|
9778
|
+
var reactIsExports = reactIs.exports;
|
|
9779
|
+
function get(entity, path) {
|
|
9780
|
+
var current = entity;
|
|
9781
|
+
for (var i2 = 0; i2 < path.length; i2 += 1) {
|
|
9782
|
+
if (current === null || current === void 0) {
|
|
9783
|
+
return void 0;
|
|
9784
|
+
}
|
|
9785
|
+
current = current[path[i2]];
|
|
9786
|
+
}
|
|
9787
|
+
return current;
|
|
9788
|
+
}
|
|
9789
|
+
function _toPrimitive(input, hint) {
|
|
9790
|
+
if (_typeof$1(input) !== "object" || input === null)
|
|
9791
|
+
return input;
|
|
9792
|
+
var prim = input[Symbol.toPrimitive];
|
|
9793
|
+
if (prim !== void 0) {
|
|
9794
|
+
var res = prim.call(input, hint || "default");
|
|
9795
|
+
if (_typeof$1(res) !== "object")
|
|
9796
|
+
return res;
|
|
9797
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
9798
|
+
}
|
|
9799
|
+
return (hint === "string" ? String : Number)(input);
|
|
9800
|
+
}
|
|
9801
|
+
function _toPropertyKey(arg) {
|
|
9802
|
+
var key = _toPrimitive(arg, "string");
|
|
9803
|
+
return _typeof$1(key) === "symbol" ? key : String(key);
|
|
9804
|
+
}
|
|
9805
|
+
function _defineProperty(obj, key, value) {
|
|
9806
|
+
key = _toPropertyKey(key);
|
|
9807
|
+
if (key in obj) {
|
|
9808
|
+
Object.defineProperty(obj, key, {
|
|
9809
|
+
value,
|
|
9810
|
+
enumerable: true,
|
|
9811
|
+
configurable: true,
|
|
9812
|
+
writable: true
|
|
9813
|
+
});
|
|
9814
|
+
} else {
|
|
9815
|
+
obj[key] = value;
|
|
9816
|
+
}
|
|
9817
|
+
return obj;
|
|
9818
|
+
}
|
|
9819
|
+
function ownKeys(e2, r) {
|
|
9820
|
+
var t = Object.keys(e2);
|
|
9821
|
+
if (Object.getOwnPropertySymbols) {
|
|
9822
|
+
var o = Object.getOwnPropertySymbols(e2);
|
|
9823
|
+
r && (o = o.filter(function(r2) {
|
|
9824
|
+
return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
|
|
9825
|
+
})), t.push.apply(t, o);
|
|
9826
|
+
}
|
|
9827
|
+
return t;
|
|
9828
|
+
}
|
|
9829
|
+
function _objectSpread2(e2) {
|
|
9830
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
9831
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
9832
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
9833
|
+
_defineProperty(e2, r2, t[r2]);
|
|
9834
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
9835
|
+
Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
9836
|
+
});
|
|
9837
|
+
}
|
|
9838
|
+
return e2;
|
|
9839
|
+
}
|
|
9840
|
+
function _arrayWithoutHoles(arr) {
|
|
9841
|
+
if (Array.isArray(arr))
|
|
9842
|
+
return _arrayLikeToArray(arr);
|
|
9843
|
+
}
|
|
9844
|
+
function _iterableToArray(iter) {
|
|
9845
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
9846
|
+
return Array.from(iter);
|
|
9847
|
+
}
|
|
9848
|
+
function _nonIterableSpread() {
|
|
9849
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
9850
|
+
}
|
|
9851
|
+
function _toConsumableArray(arr) {
|
|
9852
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
9853
|
+
}
|
|
9854
|
+
function _toArray(arr) {
|
|
9855
|
+
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
9856
|
+
}
|
|
9857
|
+
function internalSet(entity, paths, value, removeIfUndefined) {
|
|
9858
|
+
if (!paths.length) {
|
|
9859
|
+
return value;
|
|
9860
|
+
}
|
|
9861
|
+
var _paths = _toArray(paths), path = _paths[0], restPath = _paths.slice(1);
|
|
9862
|
+
var clone;
|
|
9863
|
+
if (!entity && typeof path === "number") {
|
|
9864
|
+
clone = [];
|
|
9865
|
+
} else if (Array.isArray(entity)) {
|
|
9866
|
+
clone = _toConsumableArray(entity);
|
|
9867
|
+
} else {
|
|
9868
|
+
clone = _objectSpread2({}, entity);
|
|
9869
|
+
}
|
|
9870
|
+
if (removeIfUndefined && value === void 0 && restPath.length === 1) {
|
|
9871
|
+
delete clone[path][restPath[0]];
|
|
9872
|
+
} else {
|
|
9873
|
+
clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
|
|
9874
|
+
}
|
|
9875
|
+
return clone;
|
|
9876
|
+
}
|
|
9877
|
+
function set(entity, paths, value) {
|
|
9878
|
+
var removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
9879
|
+
if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) {
|
|
9880
|
+
return entity;
|
|
9881
|
+
}
|
|
9882
|
+
return internalSet(entity, paths, value, removeIfUndefined);
|
|
9883
|
+
}
|
|
9884
|
+
var warned$1 = {};
|
|
9885
|
+
var preWarningFns$1 = [];
|
|
9886
|
+
var preMessage$1 = function preMessage2(fn) {
|
|
9887
|
+
preWarningFns$1.push(fn);
|
|
9888
|
+
};
|
|
9889
|
+
function warning$3(valid, message) {
|
|
9890
|
+
if (!valid && console !== void 0) {
|
|
9891
|
+
var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
|
|
9892
|
+
return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "warning");
|
|
9893
|
+
}, message);
|
|
9894
|
+
if (finalMessage) {
|
|
9895
|
+
console.error("Warning: ".concat(finalMessage));
|
|
9896
|
+
}
|
|
9897
|
+
}
|
|
9898
|
+
}
|
|
9899
|
+
function note$1(valid, message) {
|
|
9900
|
+
if (!valid && console !== void 0) {
|
|
9901
|
+
var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
|
|
9902
|
+
return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "note");
|
|
9903
|
+
}, message);
|
|
9904
|
+
if (finalMessage) {
|
|
9905
|
+
console.warn("Note: ".concat(finalMessage));
|
|
9906
|
+
}
|
|
9907
|
+
}
|
|
9908
|
+
}
|
|
9909
|
+
function resetWarned$1() {
|
|
9910
|
+
warned$1 = {};
|
|
9911
|
+
}
|
|
9912
|
+
function call$1(method4, valid, message) {
|
|
9913
|
+
if (!valid && !warned$1[message]) {
|
|
9914
|
+
method4(false, message);
|
|
9915
|
+
warned$1[message] = true;
|
|
9916
|
+
}
|
|
9917
|
+
}
|
|
9918
|
+
function warningOnce$1(valid, message) {
|
|
9919
|
+
call$1(warning$3, valid, message);
|
|
9920
|
+
}
|
|
9921
|
+
function noteOnce$1(valid, message) {
|
|
9922
|
+
call$1(note$1, valid, message);
|
|
9923
|
+
}
|
|
9924
|
+
warningOnce$1.preMessage = preMessage$1;
|
|
9925
|
+
warningOnce$1.resetWarned = resetWarned$1;
|
|
9926
|
+
warningOnce$1.noteOnce = noteOnce$1;
|
|
9927
|
+
function useSyncScroll(current, visible, bodyRef) {
|
|
9928
|
+
const rafRef = React$1.useRef();
|
|
9929
|
+
const clean = () => {
|
|
9930
|
+
if (rafRef.current) {
|
|
9931
|
+
cancelAnimationFrame(rafRef.current);
|
|
9932
|
+
}
|
|
9933
|
+
};
|
|
9934
|
+
const scrollTo = useEvent((date4) => {
|
|
9935
|
+
clean();
|
|
9936
|
+
rafRef.current = requestAnimationFrame(() => {
|
|
9937
|
+
if (bodyRef.current) {
|
|
9938
|
+
const yearMonth = date4.format("YYYY-M");
|
|
9939
|
+
const target = bodyRef.current.querySelector(`[data-year-month="${yearMonth}"]`);
|
|
9940
|
+
if (target) {
|
|
9941
|
+
target.scrollIntoView({
|
|
9942
|
+
block: "start",
|
|
9943
|
+
inline: "nearest"
|
|
9944
|
+
});
|
|
9945
|
+
}
|
|
9946
|
+
}
|
|
9947
|
+
});
|
|
9948
|
+
});
|
|
9949
|
+
React$1.useEffect(() => {
|
|
9950
|
+
if (visible && current) {
|
|
9951
|
+
scrollTo(current);
|
|
9952
|
+
return clean;
|
|
9953
|
+
}
|
|
9954
|
+
}, [current, visible]);
|
|
9955
|
+
return scrollTo;
|
|
9956
|
+
}
|
|
9957
|
+
dayjs.extend(isoWeek);
|
|
9958
|
+
dayjs.extend(isSameOrBefore);
|
|
9959
|
+
const classPrefix$1e = "adm-calendar-picker-view";
|
|
9960
|
+
const Context$2 = React$1.createContext({
|
|
9961
|
+
visible: false
|
|
9962
|
+
});
|
|
9963
|
+
const defaultProps$Y = {
|
|
9964
|
+
weekStartsOn: "Sunday",
|
|
9965
|
+
defaultValue: null,
|
|
9966
|
+
allowClear: true,
|
|
9967
|
+
usePopup: true,
|
|
9968
|
+
selectionMode: "single"
|
|
9969
|
+
};
|
|
9970
|
+
const CalendarPickerView = React$1.forwardRef((p, ref) => {
|
|
9971
|
+
var _a;
|
|
9972
|
+
const bodyRef = React$1.useRef(null);
|
|
9973
|
+
const today = dayjs();
|
|
9974
|
+
const props = mergeProps(defaultProps$Y, p);
|
|
9975
|
+
const {
|
|
9976
|
+
locale
|
|
9977
|
+
} = useConfig();
|
|
9978
|
+
const markItems = [...locale.Calendar.markItems];
|
|
9979
|
+
if (props.weekStartsOn === "Sunday") {
|
|
9980
|
+
const item = markItems.pop();
|
|
9981
|
+
if (item)
|
|
9982
|
+
markItems.unshift(item);
|
|
9983
|
+
}
|
|
9984
|
+
const [dateRange, setDateRange] = usePropsValue({
|
|
9985
|
+
value: props.value === void 0 ? void 0 : convertValueToRange(props.selectionMode, props.value),
|
|
9986
|
+
defaultValue: convertValueToRange(props.selectionMode, props.defaultValue),
|
|
9987
|
+
onChange: (v) => {
|
|
9988
|
+
var _a2, _b;
|
|
9989
|
+
if (props.selectionMode === "single") {
|
|
9990
|
+
(_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, v ? v[0] : null);
|
|
9991
|
+
} else if (props.selectionMode === "range") {
|
|
9992
|
+
(_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, v);
|
|
9993
|
+
}
|
|
9994
|
+
}
|
|
9995
|
+
});
|
|
9996
|
+
const [intermediate, setIntermediate] = React$1.useState(false);
|
|
9997
|
+
const [current, setCurrent] = React$1.useState(() => dayjs(dateRange ? dateRange[0] : today).date(1));
|
|
9998
|
+
const context = React$1.useContext(Context$2);
|
|
9999
|
+
const scrollTo = useSyncScroll(current, context.visible, bodyRef);
|
|
10000
|
+
const maxDay = React$1.useMemo(() => props.max ? dayjs(props.max) : current.add(6, "month"), [props.max, current]);
|
|
10001
|
+
const minDay = React$1.useMemo(() => props.min ? dayjs(props.min) : current, [props.min, current]);
|
|
10002
|
+
React$1.useImperativeHandle(ref, () => ({
|
|
10003
|
+
jumpTo: (pageOrPageGenerator) => {
|
|
10004
|
+
let page;
|
|
10005
|
+
if (typeof pageOrPageGenerator === "function") {
|
|
10006
|
+
page = pageOrPageGenerator({
|
|
10007
|
+
year: current.year(),
|
|
10008
|
+
month: current.month() + 1
|
|
10009
|
+
});
|
|
10010
|
+
} else {
|
|
10011
|
+
page = pageOrPageGenerator;
|
|
10012
|
+
}
|
|
10013
|
+
const next = convertPageToDayjs(page);
|
|
10014
|
+
setCurrent(next);
|
|
10015
|
+
scrollTo(next);
|
|
10016
|
+
},
|
|
10017
|
+
jumpToToday: () => {
|
|
10018
|
+
const next = dayjs().date(1);
|
|
10019
|
+
setCurrent(next);
|
|
10020
|
+
scrollTo(next);
|
|
10021
|
+
},
|
|
10022
|
+
getDateRange: () => dateRange
|
|
10023
|
+
}));
|
|
10024
|
+
const header = React$1.createElement("div", {
|
|
10025
|
+
className: `${classPrefix$1e}-header`
|
|
10026
|
+
}, React$1.createElement("div", {
|
|
10027
|
+
className: `${classPrefix$1e}-title`
|
|
10028
|
+
}, (_a = props.title) !== null && _a !== void 0 ? _a : locale.Calendar.title));
|
|
10029
|
+
function renderBody() {
|
|
10030
|
+
var _a2;
|
|
10031
|
+
const cells = [];
|
|
10032
|
+
let monthIterator = minDay;
|
|
10033
|
+
while (monthIterator.isSameOrBefore(maxDay, "month")) {
|
|
10034
|
+
const year = monthIterator.year();
|
|
10035
|
+
const month = monthIterator.month() + 1;
|
|
10036
|
+
const renderMap = {
|
|
10037
|
+
year,
|
|
10038
|
+
month
|
|
10039
|
+
};
|
|
10040
|
+
const yearMonth = `${year}-${month}`;
|
|
10041
|
+
const presetEmptyCellCount = props.weekStartsOn === "Monday" ? monthIterator.date(1).isoWeekday() - 1 : monthIterator.date(1).isoWeekday();
|
|
10042
|
+
const presetEmptyCells = presetEmptyCellCount == 7 ? null : Array(presetEmptyCellCount).fill(null).map((_, index2) => React$1.createElement("div", {
|
|
10043
|
+
key: index2,
|
|
10044
|
+
className: `${classPrefix$1e}-cell`
|
|
10045
|
+
}));
|
|
10046
|
+
cells.push(React$1.createElement("div", {
|
|
10047
|
+
key: yearMonth,
|
|
10048
|
+
"data-year-month": yearMonth
|
|
10049
|
+
}, React$1.createElement("div", {
|
|
10050
|
+
className: `${classPrefix$1e}-title`
|
|
10051
|
+
}, (_a2 = locale.Calendar.yearAndMonth) === null || _a2 === void 0 ? void 0 : _a2.replace(/\${(.*?)}/g, (_, variable) => {
|
|
10052
|
+
var _a3;
|
|
10053
|
+
return (_a3 = renderMap[variable]) === null || _a3 === void 0 ? void 0 : _a3.toString();
|
|
10054
|
+
})), React$1.createElement("div", {
|
|
10055
|
+
className: `${classPrefix$1e}-cells`
|
|
10056
|
+
}, presetEmptyCells, Array(monthIterator.daysInMonth()).fill(null).map((_, index2) => {
|
|
10057
|
+
var _a3;
|
|
10058
|
+
const d = monthIterator.date(index2 + 1);
|
|
10059
|
+
let isSelect = false;
|
|
10060
|
+
let isBegin = false;
|
|
10061
|
+
let isEnd = false;
|
|
10062
|
+
let isSelectRowBegin = false;
|
|
10063
|
+
let isSelectRowEnd = false;
|
|
10064
|
+
if (dateRange) {
|
|
10065
|
+
const [begin, end] = dateRange;
|
|
10066
|
+
isBegin = d.isSame(begin, "day");
|
|
10067
|
+
isEnd = d.isSame(end, "day");
|
|
10068
|
+
isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
|
|
10069
|
+
if (isSelect) {
|
|
10070
|
+
isSelectRowBegin = (cells.length % 7 === 0 || d.isSame(d.startOf("month"), "day")) && !isBegin;
|
|
10071
|
+
isSelectRowEnd = (cells.length % 7 === 6 || d.isSame(d.endOf("month"), "day")) && !isEnd;
|
|
10072
|
+
}
|
|
10073
|
+
}
|
|
10074
|
+
const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
|
|
10075
|
+
const renderTop = () => {
|
|
10076
|
+
var _a4;
|
|
10077
|
+
const top = (_a4 = props.renderTop) === null || _a4 === void 0 ? void 0 : _a4.call(props, d.toDate());
|
|
10078
|
+
if (top) {
|
|
10079
|
+
return top;
|
|
10080
|
+
}
|
|
10081
|
+
if (props.selectionMode === "range") {
|
|
10082
|
+
if (isBegin) {
|
|
10083
|
+
return locale.Calendar.start;
|
|
10084
|
+
}
|
|
10085
|
+
if (isEnd) {
|
|
10086
|
+
return locale.Calendar.end;
|
|
10087
|
+
}
|
|
10088
|
+
}
|
|
10089
|
+
if (d.isSame(today, "day") && !isSelect) {
|
|
10090
|
+
return locale.Calendar.today;
|
|
10091
|
+
}
|
|
10092
|
+
};
|
|
10093
|
+
return React$1.createElement("div", {
|
|
10094
|
+
key: d.valueOf(),
|
|
10095
|
+
className: classNames(`${classPrefix$1e}-cell`, {
|
|
10096
|
+
[`${classPrefix$1e}-cell-today`]: d.isSame(today, "day"),
|
|
10097
|
+
[`${classPrefix$1e}-cell-selected`]: isSelect,
|
|
10098
|
+
[`${classPrefix$1e}-cell-selected-begin`]: isBegin,
|
|
10099
|
+
[`${classPrefix$1e}-cell-selected-end`]: isEnd,
|
|
10100
|
+
[`${classPrefix$1e}-cell-selected-row-begin`]: isSelectRowBegin,
|
|
10101
|
+
[`${classPrefix$1e}-cell-selected-row-end`]: isSelectRowEnd,
|
|
10102
|
+
[`${classPrefix$1e}-cell-disabled`]: !!disabled
|
|
10103
|
+
}),
|
|
10104
|
+
onClick: () => {
|
|
10105
|
+
if (!props.selectionMode)
|
|
10106
|
+
return;
|
|
10107
|
+
if (disabled)
|
|
10108
|
+
return;
|
|
10109
|
+
const date4 = d.toDate();
|
|
10110
|
+
function shouldClear() {
|
|
10111
|
+
if (!props.allowClear)
|
|
10112
|
+
return false;
|
|
10113
|
+
if (!dateRange)
|
|
10114
|
+
return false;
|
|
10115
|
+
const [begin, end] = dateRange;
|
|
10116
|
+
return d.isSame(begin, "date") && d.isSame(end, "day");
|
|
10117
|
+
}
|
|
10118
|
+
if (props.selectionMode === "single") {
|
|
10119
|
+
if (props.allowClear && shouldClear()) {
|
|
10120
|
+
setDateRange(null);
|
|
10121
|
+
return;
|
|
10122
|
+
}
|
|
10123
|
+
setDateRange([date4, date4]);
|
|
10124
|
+
} else if (props.selectionMode === "range") {
|
|
10125
|
+
if (!dateRange) {
|
|
10126
|
+
setDateRange([date4, date4]);
|
|
10127
|
+
setIntermediate(true);
|
|
10128
|
+
return;
|
|
10129
|
+
}
|
|
10130
|
+
if (shouldClear()) {
|
|
10131
|
+
setDateRange(null);
|
|
10132
|
+
setIntermediate(false);
|
|
10133
|
+
return;
|
|
10134
|
+
}
|
|
10135
|
+
if (intermediate) {
|
|
10136
|
+
const another = dateRange[0];
|
|
10137
|
+
setDateRange(another > date4 ? [date4, another] : [another, date4]);
|
|
10138
|
+
setIntermediate(false);
|
|
10139
|
+
} else {
|
|
10140
|
+
setDateRange([date4, date4]);
|
|
10141
|
+
setIntermediate(true);
|
|
10142
|
+
}
|
|
10143
|
+
}
|
|
10144
|
+
}
|
|
10145
|
+
}, React$1.createElement("div", {
|
|
10146
|
+
className: `${classPrefix$1e}-cell-top`
|
|
10147
|
+
}, renderTop()), React$1.createElement("div", {
|
|
10148
|
+
className: `${classPrefix$1e}-cell-date`
|
|
10149
|
+
}, props.renderDate ? props.renderDate(d.toDate()) : d.date()), React$1.createElement("div", {
|
|
10150
|
+
className: `${classPrefix$1e}-cell-bottom`
|
|
10151
|
+
}, (_a3 = props.renderBottom) === null || _a3 === void 0 ? void 0 : _a3.call(props, d.toDate())));
|
|
10152
|
+
}))));
|
|
10153
|
+
monthIterator = monthIterator.add(1, "month");
|
|
10154
|
+
}
|
|
10155
|
+
return cells;
|
|
10156
|
+
}
|
|
10157
|
+
const body = React$1.createElement("div", {
|
|
10158
|
+
className: `${classPrefix$1e}-body`,
|
|
10159
|
+
ref: bodyRef
|
|
10160
|
+
}, renderBody());
|
|
10161
|
+
const mark = React$1.createElement("div", {
|
|
10162
|
+
className: `${classPrefix$1e}-mark`
|
|
10163
|
+
}, markItems.map((item, index2) => React$1.createElement("div", {
|
|
10164
|
+
key: index2,
|
|
10165
|
+
className: `${classPrefix$1e}-mark-cell`
|
|
10166
|
+
}, item)));
|
|
10167
|
+
return withNativeProps(props, React$1.createElement("div", {
|
|
10168
|
+
className: classPrefix$1e
|
|
10169
|
+
}, header, mark, body));
|
|
10170
|
+
});
|
|
10171
|
+
const classPrefix$1d = `adm-divider`;
|
|
10172
|
+
const defaultProps$X = {
|
|
10173
|
+
contentPosition: "center",
|
|
10174
|
+
direction: "horizontal"
|
|
10175
|
+
};
|
|
10176
|
+
const Divider = (p) => {
|
|
10177
|
+
const props = mergeProps(defaultProps$X, p);
|
|
10178
|
+
return withNativeProps(props, React$1.createElement("div", {
|
|
10179
|
+
className: classNames(classPrefix$1d, `${classPrefix$1d}-${props.direction}`, `${classPrefix$1d}-${props.contentPosition}`)
|
|
10180
|
+
}, props.children && React$1.createElement("div", {
|
|
10181
|
+
className: `${classPrefix$1d}-content`
|
|
10182
|
+
}, props.children)));
|
|
10183
|
+
};
|
|
10184
|
+
const classPrefix$1c = "adm-calendar-picker";
|
|
10185
|
+
const defaultProps$W = {
|
|
10186
|
+
weekStartsOn: "Sunday",
|
|
10187
|
+
defaultValue: null,
|
|
10188
|
+
allowClear: true,
|
|
10189
|
+
usePopup: true,
|
|
10190
|
+
selectionMode: "single"
|
|
10191
|
+
};
|
|
10192
|
+
const CalendarPicker = React$1.forwardRef((p, ref) => {
|
|
10193
|
+
const props = mergeProps(defaultProps$W, p);
|
|
10194
|
+
const {
|
|
10195
|
+
locale
|
|
10196
|
+
} = useConfig();
|
|
10197
|
+
const calendarRef = ref !== null && ref !== void 0 ? ref : React$1.useRef(null);
|
|
10198
|
+
const {
|
|
10199
|
+
visible,
|
|
10200
|
+
confirmText,
|
|
10201
|
+
popupClassName,
|
|
10202
|
+
popupStyle,
|
|
9670
10203
|
popupBodyStyle,
|
|
9671
10204
|
forceRender,
|
|
9672
10205
|
closeOnMaskClick,
|
|
@@ -9675,6 +10208,9 @@ const CalendarPicker = React$1.forwardRef((p, ref) => {
|
|
|
9675
10208
|
onMaskClick,
|
|
9676
10209
|
getContainer
|
|
9677
10210
|
} = props, calendarViewProps = __rest(props, ["visible", "confirmText", "popupClassName", "popupStyle", "popupBodyStyle", "forceRender", "closeOnMaskClick", "onClose", "onConfirm", "onMaskClick", "getContainer"]);
|
|
10211
|
+
const viewContext = React$1.useMemo(() => ({
|
|
10212
|
+
visible: !!visible
|
|
10213
|
+
}), [visible]);
|
|
9678
10214
|
const footer = React$1.createElement("div", {
|
|
9679
10215
|
className: `${classPrefix$1c}-footer`
|
|
9680
10216
|
}, React$1.createElement(Divider, null), React$1.createElement("div", {
|
|
@@ -9714,9 +10250,11 @@ const CalendarPicker = React$1.forwardRef((p, ref) => {
|
|
|
9714
10250
|
}
|
|
9715
10251
|
},
|
|
9716
10252
|
getContainer
|
|
10253
|
+
}, React$1.createElement(Context$2.Provider, {
|
|
10254
|
+
value: viewContext
|
|
9717
10255
|
}, React$1.createElement(CalendarPickerView, Object.assign({
|
|
9718
10256
|
ref: calendarRef
|
|
9719
|
-
}, calendarViewProps)), footer)));
|
|
10257
|
+
}, calendarViewProps))), footer)));
|
|
9720
10258
|
});
|
|
9721
10259
|
function useResizeEffect(effect, targetRef) {
|
|
9722
10260
|
const fn = useMemoizedFn(effect);
|
|
@@ -9823,255 +10361,66 @@ const useTabListScroll = (targetRef, activeIndex) => {
|
|
|
9823
10361
|
return {
|
|
9824
10362
|
scrollLeft,
|
|
9825
10363
|
animate
|
|
9826
|
-
};
|
|
9827
|
-
};
|
|
9828
|
-
const classPrefix$1b = `adm-scroll-mask`;
|
|
9829
|
-
const ScrollMask = (props) => {
|
|
9830
|
-
const maskRef = React$1.useRef(null);
|
|
9831
|
-
const [{
|
|
9832
|
-
leftMaskOpacity,
|
|
9833
|
-
rightMaskOpacity
|
|
9834
|
-
}, api] = useSpring(() => ({
|
|
9835
|
-
leftMaskOpacity: 0,
|
|
9836
|
-
rightMaskOpacity: 0,
|
|
9837
|
-
config: {
|
|
9838
|
-
clamp: true
|
|
9839
|
-
}
|
|
9840
|
-
}));
|
|
9841
|
-
const {
|
|
9842
|
-
run: updateMask
|
|
9843
|
-
} = useThrottleFn((immediate = false) => {
|
|
9844
|
-
const mask = maskRef.current;
|
|
9845
|
-
if (!mask)
|
|
9846
|
-
return;
|
|
9847
|
-
const scrollEl = props.scrollTrackRef.current;
|
|
9848
|
-
if (!scrollEl)
|
|
9849
|
-
return;
|
|
9850
|
-
const scrollLeft = scrollEl.scrollLeft;
|
|
9851
|
-
const showLeftMask = scrollLeft > 0;
|
|
9852
|
-
const showRightMask = scrollLeft + scrollEl.offsetWidth < scrollEl.scrollWidth;
|
|
9853
|
-
api.start({
|
|
9854
|
-
leftMaskOpacity: showLeftMask ? 1 : 0,
|
|
9855
|
-
rightMaskOpacity: showRightMask ? 1 : 0,
|
|
9856
|
-
immediate
|
|
9857
|
-
});
|
|
9858
|
-
}, {
|
|
9859
|
-
wait: 100,
|
|
9860
|
-
trailing: true,
|
|
9861
|
-
leading: true
|
|
9862
|
-
});
|
|
9863
|
-
React$1.useEffect(() => {
|
|
9864
|
-
updateMask(true);
|
|
9865
|
-
}, []);
|
|
9866
|
-
React$1.useEffect(() => {
|
|
9867
|
-
const scrollEl = props.scrollTrackRef.current;
|
|
9868
|
-
if (!scrollEl)
|
|
9869
|
-
return;
|
|
9870
|
-
scrollEl.addEventListener("scroll", updateMask);
|
|
9871
|
-
return () => scrollEl.removeEventListener("scroll", updateMask);
|
|
9872
|
-
}, []);
|
|
9873
|
-
return React$1.createElement(React$1.Fragment, null, React$1.createElement(animated.div, {
|
|
9874
|
-
ref: maskRef,
|
|
9875
|
-
className: classNames(classPrefix$1b, `${classPrefix$1b}-left`),
|
|
9876
|
-
style: {
|
|
9877
|
-
opacity: leftMaskOpacity
|
|
9878
|
-
}
|
|
9879
|
-
}), React$1.createElement(animated.div, {
|
|
9880
|
-
className: classNames(classPrefix$1b, `${classPrefix$1b}-right`),
|
|
9881
|
-
style: {
|
|
9882
|
-
opacity: rightMaskOpacity
|
|
9883
|
-
}
|
|
9884
|
-
}));
|
|
9885
|
-
};
|
|
9886
|
-
var reactIs = { exports: {} };
|
|
9887
|
-
var reactIs_development = {};
|
|
9888
|
-
/**
|
|
9889
|
-
* @license React
|
|
9890
|
-
* react-is.development.js
|
|
9891
|
-
*
|
|
9892
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9893
|
-
*
|
|
9894
|
-
* This source code is licensed under the MIT license found in the
|
|
9895
|
-
* LICENSE file in the root directory of this source tree.
|
|
9896
|
-
*/
|
|
9897
|
-
{
|
|
9898
|
-
(function() {
|
|
9899
|
-
var REACT_ELEMENT_TYPE2 = Symbol.for("react.element");
|
|
9900
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
9901
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
9902
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
9903
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
9904
|
-
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
9905
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
9906
|
-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
|
|
9907
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
9908
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
9909
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
9910
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
9911
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
9912
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
9913
|
-
var enableScopeAPI = false;
|
|
9914
|
-
var enableCacheElement = false;
|
|
9915
|
-
var enableTransitionTracing = false;
|
|
9916
|
-
var enableLegacyHidden = false;
|
|
9917
|
-
var enableDebugTracing = false;
|
|
9918
|
-
var REACT_MODULE_REFERENCE;
|
|
9919
|
-
{
|
|
9920
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
9921
|
-
}
|
|
9922
|
-
function isValidElementType(type4) {
|
|
9923
|
-
if (typeof type4 === "string" || typeof type4 === "function") {
|
|
9924
|
-
return true;
|
|
9925
|
-
}
|
|
9926
|
-
if (type4 === REACT_FRAGMENT_TYPE || type4 === REACT_PROFILER_TYPE || enableDebugTracing || type4 === REACT_STRICT_MODE_TYPE || type4 === REACT_SUSPENSE_TYPE || type4 === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type4 === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
9927
|
-
return true;
|
|
9928
|
-
}
|
|
9929
|
-
if (typeof type4 === "object" && type4 !== null) {
|
|
9930
|
-
if (type4.$$typeof === REACT_LAZY_TYPE || type4.$$typeof === REACT_MEMO_TYPE || type4.$$typeof === REACT_PROVIDER_TYPE || type4.$$typeof === REACT_CONTEXT_TYPE || type4.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
9931
|
-
// types supported by any Flight configuration anywhere since
|
|
9932
|
-
// we don't know which Flight build this will end up being used
|
|
9933
|
-
// with.
|
|
9934
|
-
type4.$$typeof === REACT_MODULE_REFERENCE || type4.getModuleId !== void 0) {
|
|
9935
|
-
return true;
|
|
9936
|
-
}
|
|
9937
|
-
}
|
|
9938
|
-
return false;
|
|
9939
|
-
}
|
|
9940
|
-
function typeOf(object4) {
|
|
9941
|
-
if (typeof object4 === "object" && object4 !== null) {
|
|
9942
|
-
var $$typeof = object4.$$typeof;
|
|
9943
|
-
switch ($$typeof) {
|
|
9944
|
-
case REACT_ELEMENT_TYPE2:
|
|
9945
|
-
var type4 = object4.type;
|
|
9946
|
-
switch (type4) {
|
|
9947
|
-
case REACT_FRAGMENT_TYPE:
|
|
9948
|
-
case REACT_PROFILER_TYPE:
|
|
9949
|
-
case REACT_STRICT_MODE_TYPE:
|
|
9950
|
-
case REACT_SUSPENSE_TYPE:
|
|
9951
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
9952
|
-
return type4;
|
|
9953
|
-
default:
|
|
9954
|
-
var $$typeofType = type4 && type4.$$typeof;
|
|
9955
|
-
switch ($$typeofType) {
|
|
9956
|
-
case REACT_SERVER_CONTEXT_TYPE:
|
|
9957
|
-
case REACT_CONTEXT_TYPE:
|
|
9958
|
-
case REACT_FORWARD_REF_TYPE:
|
|
9959
|
-
case REACT_LAZY_TYPE:
|
|
9960
|
-
case REACT_MEMO_TYPE:
|
|
9961
|
-
case REACT_PROVIDER_TYPE:
|
|
9962
|
-
return $$typeofType;
|
|
9963
|
-
default:
|
|
9964
|
-
return $$typeof;
|
|
9965
|
-
}
|
|
9966
|
-
}
|
|
9967
|
-
case REACT_PORTAL_TYPE:
|
|
9968
|
-
return $$typeof;
|
|
9969
|
-
}
|
|
9970
|
-
}
|
|
9971
|
-
return void 0;
|
|
9972
|
-
}
|
|
9973
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
9974
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
9975
|
-
var Element2 = REACT_ELEMENT_TYPE2;
|
|
9976
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
9977
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
9978
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
9979
|
-
var Memo = REACT_MEMO_TYPE;
|
|
9980
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
9981
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
9982
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
9983
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
9984
|
-
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
9985
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
9986
|
-
var hasWarnedAboutDeprecatedIsConcurrentMode = false;
|
|
9987
|
-
function isAsyncMode(object4) {
|
|
9988
|
-
{
|
|
9989
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
9990
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
9991
|
-
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
|
|
9992
|
-
}
|
|
9993
|
-
}
|
|
9994
|
-
return false;
|
|
9995
|
-
}
|
|
9996
|
-
function isConcurrentMode(object4) {
|
|
9997
|
-
{
|
|
9998
|
-
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
9999
|
-
hasWarnedAboutDeprecatedIsConcurrentMode = true;
|
|
10000
|
-
console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
|
|
10001
|
-
}
|
|
10002
|
-
}
|
|
10003
|
-
return false;
|
|
10004
|
-
}
|
|
10005
|
-
function isContextConsumer(object4) {
|
|
10006
|
-
return typeOf(object4) === REACT_CONTEXT_TYPE;
|
|
10007
|
-
}
|
|
10008
|
-
function isContextProvider(object4) {
|
|
10009
|
-
return typeOf(object4) === REACT_PROVIDER_TYPE;
|
|
10010
|
-
}
|
|
10011
|
-
function isElement2(object4) {
|
|
10012
|
-
return typeof object4 === "object" && object4 !== null && object4.$$typeof === REACT_ELEMENT_TYPE2;
|
|
10013
|
-
}
|
|
10014
|
-
function isForwardRef(object4) {
|
|
10015
|
-
return typeOf(object4) === REACT_FORWARD_REF_TYPE;
|
|
10016
|
-
}
|
|
10017
|
-
function isFragment(object4) {
|
|
10018
|
-
return typeOf(object4) === REACT_FRAGMENT_TYPE;
|
|
10019
|
-
}
|
|
10020
|
-
function isLazy(object4) {
|
|
10021
|
-
return typeOf(object4) === REACT_LAZY_TYPE;
|
|
10022
|
-
}
|
|
10023
|
-
function isMemo(object4) {
|
|
10024
|
-
return typeOf(object4) === REACT_MEMO_TYPE;
|
|
10025
|
-
}
|
|
10026
|
-
function isPortal(object4) {
|
|
10027
|
-
return typeOf(object4) === REACT_PORTAL_TYPE;
|
|
10028
|
-
}
|
|
10029
|
-
function isProfiler(object4) {
|
|
10030
|
-
return typeOf(object4) === REACT_PROFILER_TYPE;
|
|
10031
|
-
}
|
|
10032
|
-
function isStrictMode(object4) {
|
|
10033
|
-
return typeOf(object4) === REACT_STRICT_MODE_TYPE;
|
|
10364
|
+
};
|
|
10365
|
+
};
|
|
10366
|
+
const classPrefix$1b = `adm-scroll-mask`;
|
|
10367
|
+
const ScrollMask = (props) => {
|
|
10368
|
+
const maskRef = React$1.useRef(null);
|
|
10369
|
+
const [{
|
|
10370
|
+
leftMaskOpacity,
|
|
10371
|
+
rightMaskOpacity
|
|
10372
|
+
}, api] = useSpring(() => ({
|
|
10373
|
+
leftMaskOpacity: 0,
|
|
10374
|
+
rightMaskOpacity: 0,
|
|
10375
|
+
config: {
|
|
10376
|
+
clamp: true
|
|
10034
10377
|
}
|
|
10035
|
-
|
|
10036
|
-
|
|
10378
|
+
}));
|
|
10379
|
+
const {
|
|
10380
|
+
run: updateMask
|
|
10381
|
+
} = useThrottleFn((immediate = false) => {
|
|
10382
|
+
const mask = maskRef.current;
|
|
10383
|
+
if (!mask)
|
|
10384
|
+
return;
|
|
10385
|
+
const scrollEl = props.scrollTrackRef.current;
|
|
10386
|
+
if (!scrollEl)
|
|
10387
|
+
return;
|
|
10388
|
+
const scrollLeft = scrollEl.scrollLeft;
|
|
10389
|
+
const showLeftMask = scrollLeft > 0;
|
|
10390
|
+
const showRightMask = scrollLeft + scrollEl.offsetWidth < scrollEl.scrollWidth;
|
|
10391
|
+
api.start({
|
|
10392
|
+
leftMaskOpacity: showLeftMask ? 1 : 0,
|
|
10393
|
+
rightMaskOpacity: showRightMask ? 1 : 0,
|
|
10394
|
+
immediate
|
|
10395
|
+
});
|
|
10396
|
+
}, {
|
|
10397
|
+
wait: 100,
|
|
10398
|
+
trailing: true,
|
|
10399
|
+
leading: true
|
|
10400
|
+
});
|
|
10401
|
+
React$1.useEffect(() => {
|
|
10402
|
+
updateMask(true);
|
|
10403
|
+
}, []);
|
|
10404
|
+
React$1.useEffect(() => {
|
|
10405
|
+
const scrollEl = props.scrollTrackRef.current;
|
|
10406
|
+
if (!scrollEl)
|
|
10407
|
+
return;
|
|
10408
|
+
scrollEl.addEventListener("scroll", updateMask);
|
|
10409
|
+
return () => scrollEl.removeEventListener("scroll", updateMask);
|
|
10410
|
+
}, []);
|
|
10411
|
+
return React$1.createElement(React$1.Fragment, null, React$1.createElement(animated.div, {
|
|
10412
|
+
ref: maskRef,
|
|
10413
|
+
className: classNames(classPrefix$1b, `${classPrefix$1b}-left`),
|
|
10414
|
+
style: {
|
|
10415
|
+
opacity: leftMaskOpacity
|
|
10037
10416
|
}
|
|
10038
|
-
|
|
10039
|
-
|
|
10417
|
+
}), React$1.createElement(animated.div, {
|
|
10418
|
+
className: classNames(classPrefix$1b, `${classPrefix$1b}-right`),
|
|
10419
|
+
style: {
|
|
10420
|
+
opacity: rightMaskOpacity
|
|
10040
10421
|
}
|
|
10041
|
-
|
|
10042
|
-
|
|
10043
|
-
reactIs_development.Element = Element2;
|
|
10044
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
10045
|
-
reactIs_development.Fragment = Fragment;
|
|
10046
|
-
reactIs_development.Lazy = Lazy;
|
|
10047
|
-
reactIs_development.Memo = Memo;
|
|
10048
|
-
reactIs_development.Portal = Portal;
|
|
10049
|
-
reactIs_development.Profiler = Profiler;
|
|
10050
|
-
reactIs_development.StrictMode = StrictMode;
|
|
10051
|
-
reactIs_development.Suspense = Suspense;
|
|
10052
|
-
reactIs_development.SuspenseList = SuspenseList;
|
|
10053
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
10054
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
10055
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
10056
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
10057
|
-
reactIs_development.isElement = isElement2;
|
|
10058
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
10059
|
-
reactIs_development.isFragment = isFragment;
|
|
10060
|
-
reactIs_development.isLazy = isLazy;
|
|
10061
|
-
reactIs_development.isMemo = isMemo;
|
|
10062
|
-
reactIs_development.isPortal = isPortal;
|
|
10063
|
-
reactIs_development.isProfiler = isProfiler;
|
|
10064
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
10065
|
-
reactIs_development.isSuspense = isSuspense;
|
|
10066
|
-
reactIs_development.isSuspenseList = isSuspenseList;
|
|
10067
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
10068
|
-
reactIs_development.typeOf = typeOf;
|
|
10069
|
-
})();
|
|
10070
|
-
}
|
|
10071
|
-
{
|
|
10072
|
-
reactIs.exports = reactIs_development;
|
|
10073
|
-
}
|
|
10074
|
-
var reactIsExports = reactIs.exports;
|
|
10422
|
+
}));
|
|
10423
|
+
};
|
|
10075
10424
|
function traverseReactNode(children, fn) {
|
|
10076
10425
|
let i2 = 0;
|
|
10077
10426
|
function handle(target) {
|
|
@@ -10777,13 +11126,13 @@ const colorRecord$2 = {
|
|
|
10777
11126
|
primary: "var(--adm-color-primary)",
|
|
10778
11127
|
white: "var(--adm-color-white)"
|
|
10779
11128
|
};
|
|
10780
|
-
const defaultProps$
|
|
11129
|
+
const defaultProps$V = {
|
|
10781
11130
|
color: "default"
|
|
10782
11131
|
};
|
|
10783
11132
|
const circumference = 15 * 3.14159265358979 * 2;
|
|
10784
11133
|
const SpinLoading = React$1.memo((p) => {
|
|
10785
11134
|
var _a;
|
|
10786
|
-
const props = mergeProps(defaultProps$
|
|
11135
|
+
const props = mergeProps(defaultProps$V, p);
|
|
10787
11136
|
const motionReduced = useMotionReduced();
|
|
10788
11137
|
const {
|
|
10789
11138
|
percent
|
|
@@ -10824,7 +11173,7 @@ const SpinLoading = React$1.memo((p) => {
|
|
|
10824
11173
|
}))));
|
|
10825
11174
|
});
|
|
10826
11175
|
const classPrefix$16 = `adm-picker-view`;
|
|
10827
|
-
const defaultProps$
|
|
11176
|
+
const defaultProps$U = {
|
|
10828
11177
|
defaultValue: [],
|
|
10829
11178
|
renderLabel: defaultRenderLabel,
|
|
10830
11179
|
mouseWheel: false,
|
|
@@ -10833,7 +11182,7 @@ const defaultProps$V = {
|
|
|
10833
11182
|
}, React$1.createElement(SpinLoading, null))
|
|
10834
11183
|
};
|
|
10835
11184
|
const PickerView = React$1.memo((p) => {
|
|
10836
|
-
const props = mergeProps(defaultProps$
|
|
11185
|
+
const props = mergeProps(defaultProps$U, p);
|
|
10837
11186
|
const [innerValue, setInnerValue] = React$1.useState(props.value === void 0 ? props.defaultValue : props.value);
|
|
10838
11187
|
React$1.useEffect(() => {
|
|
10839
11188
|
if (props.value === void 0)
|
|
@@ -10895,7 +11244,7 @@ const PickerView = React$1.memo((p) => {
|
|
|
10895
11244
|
});
|
|
10896
11245
|
PickerView.displayName = "PickerView";
|
|
10897
11246
|
const classPrefix$15 = `adm-picker`;
|
|
10898
|
-
const defaultProps$
|
|
11247
|
+
const defaultProps$T = {
|
|
10899
11248
|
defaultValue: [],
|
|
10900
11249
|
closeOnMaskClick: true,
|
|
10901
11250
|
renderLabel: defaultRenderLabel,
|
|
@@ -10907,7 +11256,7 @@ const Picker$1 = React$1.memo(React$1.forwardRef((p, ref) => {
|
|
|
10907
11256
|
const {
|
|
10908
11257
|
locale
|
|
10909
11258
|
} = useConfig();
|
|
10910
|
-
const props = mergeProps(defaultProps$
|
|
11259
|
+
const props = mergeProps(defaultProps$T, {
|
|
10911
11260
|
confirmText: locale.common.confirm,
|
|
10912
11261
|
cancelText: locale.common.cancel
|
|
10913
11262
|
}, p);
|
|
@@ -11147,14 +11496,14 @@ const classPrefix$14 = `adm-tabs`;
|
|
|
11147
11496
|
const Tab = () => {
|
|
11148
11497
|
return null;
|
|
11149
11498
|
};
|
|
11150
|
-
const defaultProps$
|
|
11499
|
+
const defaultProps$S = {
|
|
11151
11500
|
activeLineMode: "auto",
|
|
11152
11501
|
stretch: true,
|
|
11153
11502
|
direction: "ltr"
|
|
11154
11503
|
};
|
|
11155
11504
|
const Tabs$1 = (p) => {
|
|
11156
11505
|
var _a;
|
|
11157
|
-
const props = mergeProps(defaultProps$
|
|
11506
|
+
const props = mergeProps(defaultProps$S, p);
|
|
11158
11507
|
const tabListContainerRef = React$1.useRef(null);
|
|
11159
11508
|
const activeLineRef = React$1.useRef(null);
|
|
11160
11509
|
const keyToIndexRecord = {};
|
|
@@ -11398,11 +11747,11 @@ const Tabs = attachPropertiesToComponent(Tabs$1, {
|
|
|
11398
11747
|
Tab
|
|
11399
11748
|
});
|
|
11400
11749
|
const classPrefix$13 = `adm-list`;
|
|
11401
|
-
const defaultProps$
|
|
11750
|
+
const defaultProps$R = {
|
|
11402
11751
|
mode: "default"
|
|
11403
11752
|
};
|
|
11404
11753
|
const List$2 = React$1.forwardRef((p, ref) => {
|
|
11405
|
-
const props = mergeProps(defaultProps$
|
|
11754
|
+
const props = mergeProps(defaultProps$R, p);
|
|
11406
11755
|
const nativeElementRef = React$1.useRef(null);
|
|
11407
11756
|
React$1.useImperativeHandle(ref, () => ({
|
|
11408
11757
|
get nativeElement() {
|
|
@@ -11461,7 +11810,7 @@ const List$1 = attachPropertiesToComponent(List$2, {
|
|
|
11461
11810
|
});
|
|
11462
11811
|
const CheckListContext = React$1.createContext(null);
|
|
11463
11812
|
const classPrefix$11 = "adm-check-list";
|
|
11464
|
-
const defaultProps$
|
|
11813
|
+
const defaultProps$Q = {
|
|
11465
11814
|
multiple: false,
|
|
11466
11815
|
defaultValue: [],
|
|
11467
11816
|
activeIcon: React$1.createElement(CheckOutline, null)
|
|
@@ -11470,7 +11819,7 @@ const CheckList$1 = (props) => {
|
|
|
11470
11819
|
const {
|
|
11471
11820
|
checkList: componentConfig = {}
|
|
11472
11821
|
} = useConfig();
|
|
11473
|
-
const mergedProps = mergeProps(defaultProps$
|
|
11822
|
+
const mergedProps = mergeProps(defaultProps$Q, componentConfig, props);
|
|
11474
11823
|
const [value, setValue2] = usePropsValue(mergedProps);
|
|
11475
11824
|
function check(val) {
|
|
11476
11825
|
if (mergedProps.multiple) {
|
|
@@ -11712,11 +12061,11 @@ const useFieldNames = (fieldNames = {}) => {
|
|
|
11712
12061
|
return fields;
|
|
11713
12062
|
};
|
|
11714
12063
|
const classPrefix$_ = `adm-cascader-view`;
|
|
11715
|
-
const defaultProps$
|
|
12064
|
+
const defaultProps$P = {
|
|
11716
12065
|
defaultValue: []
|
|
11717
12066
|
};
|
|
11718
12067
|
const CascaderView$1 = (p) => {
|
|
11719
|
-
const props = mergeProps(defaultProps$
|
|
12068
|
+
const props = mergeProps(defaultProps$P, p);
|
|
11720
12069
|
const {
|
|
11721
12070
|
locale
|
|
11722
12071
|
} = useConfig();
|
|
@@ -11833,7 +12182,7 @@ const CascaderView = attachPropertiesToComponent(CascaderView$1, {
|
|
|
11833
12182
|
optionSkeleton
|
|
11834
12183
|
});
|
|
11835
12184
|
const classPrefix$Z = `adm-cascader`;
|
|
11836
|
-
const defaultProps$
|
|
12185
|
+
const defaultProps$O = {
|
|
11837
12186
|
defaultValue: [],
|
|
11838
12187
|
destroyOnClose: true,
|
|
11839
12188
|
forceRender: false
|
|
@@ -11843,7 +12192,7 @@ const Cascader = React$1.forwardRef((p, ref) => {
|
|
|
11843
12192
|
const {
|
|
11844
12193
|
locale
|
|
11845
12194
|
} = useConfig();
|
|
11846
|
-
const props = mergeProps(defaultProps$
|
|
12195
|
+
const props = mergeProps(defaultProps$O, {
|
|
11847
12196
|
confirmText: locale.common.confirm,
|
|
11848
12197
|
cancelText: locale.common.cancel,
|
|
11849
12198
|
placeholder: locale.Cascader.placeholder
|
|
@@ -11971,14 +12320,14 @@ const index$f = attachPropertiesToComponent(Cascader, {
|
|
|
11971
12320
|
optionSkeleton
|
|
11972
12321
|
});
|
|
11973
12322
|
const classPrefix$Y = "adm-center-popup";
|
|
11974
|
-
const defaultProps$
|
|
12323
|
+
const defaultProps$N = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
11975
12324
|
getContainer: null
|
|
11976
12325
|
});
|
|
11977
12326
|
const CenterPopup = (props) => {
|
|
11978
12327
|
const {
|
|
11979
12328
|
popup: componentConfig = {}
|
|
11980
12329
|
} = useConfig();
|
|
11981
|
-
const mergedProps = mergeProps(defaultProps$
|
|
12330
|
+
const mergedProps = mergeProps(defaultProps$N, componentConfig, props);
|
|
11982
12331
|
const unmountedRef = useUnmountedRef$1();
|
|
11983
12332
|
const style = useSpring({
|
|
11984
12333
|
scale: mergedProps.visible ? 1 : 0.8,
|
|
@@ -12058,12 +12407,12 @@ const CenterPopup = (props) => {
|
|
|
12058
12407
|
}, renderToContainer(mergedProps.getContainer, node));
|
|
12059
12408
|
};
|
|
12060
12409
|
const CheckboxGroupContext = React$1.createContext(null);
|
|
12061
|
-
const defaultProps$
|
|
12410
|
+
const defaultProps$M = {
|
|
12062
12411
|
disabled: false,
|
|
12063
12412
|
defaultValue: []
|
|
12064
12413
|
};
|
|
12065
12414
|
const Group$1 = (p) => {
|
|
12066
|
-
const props = mergeProps(defaultProps$
|
|
12415
|
+
const props = mergeProps(defaultProps$M, p);
|
|
12067
12416
|
const [value, setValue2] = usePropsValue(props);
|
|
12068
12417
|
return React$1.createElement(
|
|
12069
12418
|
CheckboxGroupContext.Provider,
|
|
@@ -12131,13 +12480,13 @@ const NativeInput = (props) => {
|
|
|
12131
12480
|
});
|
|
12132
12481
|
};
|
|
12133
12482
|
const classPrefix$X = `adm-checkbox`;
|
|
12134
|
-
const defaultProps$
|
|
12483
|
+
const defaultProps$L = {
|
|
12135
12484
|
defaultChecked: false,
|
|
12136
12485
|
indeterminate: false
|
|
12137
12486
|
};
|
|
12138
12487
|
const Checkbox$1 = React$1.forwardRef((p, ref) => {
|
|
12139
12488
|
const groupContext = React$1.useContext(CheckboxGroupContext);
|
|
12140
|
-
const props = mergeProps(defaultProps$
|
|
12489
|
+
const props = mergeProps(defaultProps$L, p);
|
|
12141
12490
|
let [checked, setChecked] = usePropsValue({
|
|
12142
12491
|
value: props.checked,
|
|
12143
12492
|
defaultValue: props.defaultChecked,
|
|
@@ -12700,14 +13049,14 @@ function useRenderLabel(renderLabel) {
|
|
|
12700
13049
|
}, [renderLabel]);
|
|
12701
13050
|
}
|
|
12702
13051
|
const thisYear$1 = (/* @__PURE__ */ new Date()).getFullYear();
|
|
12703
|
-
const defaultProps$
|
|
13052
|
+
const defaultProps$K = {
|
|
12704
13053
|
min: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear$1 - 10)),
|
|
12705
13054
|
max: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear$1 + 10)),
|
|
12706
13055
|
precision: "day",
|
|
12707
13056
|
defaultValue: null
|
|
12708
13057
|
};
|
|
12709
13058
|
const DatePicker = React$1.forwardRef((p, ref) => {
|
|
12710
|
-
const props = mergeProps(defaultProps$
|
|
13059
|
+
const props = mergeProps(defaultProps$K, p);
|
|
12711
13060
|
const {
|
|
12712
13061
|
renderLabel
|
|
12713
13062
|
} = props;
|
|
@@ -12804,14 +13153,14 @@ const index$d = attachPropertiesToComponent(DatePicker, {
|
|
|
12804
13153
|
DATE_NOW: TILL_NOW
|
|
12805
13154
|
});
|
|
12806
13155
|
const thisYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
12807
|
-
const defaultProps$
|
|
13156
|
+
const defaultProps$J = {
|
|
12808
13157
|
min: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear - 10)),
|
|
12809
13158
|
max: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear + 10)),
|
|
12810
13159
|
precision: "day"
|
|
12811
13160
|
};
|
|
12812
13161
|
const DatePickerView = (p) => {
|
|
12813
13162
|
var _a;
|
|
12814
|
-
const props = mergeProps(defaultProps$
|
|
13163
|
+
const props = mergeProps(defaultProps$J, p);
|
|
12815
13164
|
const {
|
|
12816
13165
|
renderLabel
|
|
12817
13166
|
} = props;
|
|
@@ -12861,14 +13210,14 @@ const DialogActionButton = (props) => {
|
|
|
12861
13210
|
disabled: action.disabled
|
|
12862
13211
|
}, action.text));
|
|
12863
13212
|
};
|
|
12864
|
-
const defaultProps$
|
|
13213
|
+
const defaultProps$I = {
|
|
12865
13214
|
actions: [],
|
|
12866
13215
|
closeOnAction: false,
|
|
12867
13216
|
closeOnMaskClick: false,
|
|
12868
13217
|
getContainer: null
|
|
12869
13218
|
};
|
|
12870
13219
|
const Dialog = (p) => {
|
|
12871
|
-
const props = mergeProps(defaultProps$
|
|
13220
|
+
const props = mergeProps(defaultProps$I, p);
|
|
12872
13221
|
const element = React$1.createElement(React$1.Fragment, null, !!props.image && React$1.createElement("div", {
|
|
12873
13222
|
className: cls$1("image-container")
|
|
12874
13223
|
}, React$1.createElement(Image$1, {
|
|
@@ -12959,7 +13308,7 @@ function alert$1(p) {
|
|
|
12959
13308
|
}));
|
|
12960
13309
|
});
|
|
12961
13310
|
}
|
|
12962
|
-
const defaultProps$
|
|
13311
|
+
const defaultProps$H = {
|
|
12963
13312
|
confirmText: "确认",
|
|
12964
13313
|
cancelText: "取消"
|
|
12965
13314
|
};
|
|
@@ -12967,7 +13316,7 @@ function confirm$1(p) {
|
|
|
12967
13316
|
const {
|
|
12968
13317
|
locale
|
|
12969
13318
|
} = getDefaultConfig();
|
|
12970
|
-
const props = mergeProps(defaultProps$
|
|
13319
|
+
const props = mergeProps(defaultProps$H, {
|
|
12971
13320
|
confirmText: locale.common.confirm,
|
|
12972
13321
|
cancelText: locale.common.cancel
|
|
12973
13322
|
}, p);
|
|
@@ -13058,7 +13407,7 @@ const ItemChildrenWrap = (props) => {
|
|
|
13058
13407
|
}, props.children) : null;
|
|
13059
13408
|
};
|
|
13060
13409
|
const classPrefix$U = `adm-dropdown`;
|
|
13061
|
-
const defaultProps$
|
|
13410
|
+
const defaultProps$G = {
|
|
13062
13411
|
defaultActiveKey: null,
|
|
13063
13412
|
closeOnMaskClick: true,
|
|
13064
13413
|
closeOnClickAway: false,
|
|
@@ -13068,7 +13417,7 @@ const Dropdown = React$1.forwardRef((props, ref) => {
|
|
|
13068
13417
|
const {
|
|
13069
13418
|
dropdown: componentConfig = {}
|
|
13070
13419
|
} = useConfig();
|
|
13071
|
-
const mergedProps = mergeProps(defaultProps$
|
|
13420
|
+
const mergedProps = mergeProps(defaultProps$G, componentConfig, props);
|
|
13072
13421
|
const arrowIcon = mergeProp(componentConfig.arrowIcon, props.arrow, props.arrowIcon);
|
|
13073
13422
|
const [value, setValue2] = usePropsValue({
|
|
13074
13423
|
value: mergedProps.activeKey,
|
|
@@ -13226,7 +13575,7 @@ function betweenInclusive(i2, e2, n2) {
|
|
|
13226
13575
|
i2[i2.unit_1 = 1] = "unit_1", i2[i2.unit_2 = 2] = "unit_2", i2[i2.unit_4 = 4] = "unit_4";
|
|
13227
13576
|
}(n || (n = {}));
|
|
13228
13577
|
const classPrefix$T = `adm-ellipsis`;
|
|
13229
|
-
const defaultProps$
|
|
13578
|
+
const defaultProps$F = {
|
|
13230
13579
|
direction: "end",
|
|
13231
13580
|
rows: 1,
|
|
13232
13581
|
expandText: "",
|
|
@@ -13238,7 +13587,7 @@ const defaultProps$G = {
|
|
|
13238
13587
|
defaultExpanded: false
|
|
13239
13588
|
};
|
|
13240
13589
|
const Ellipsis = (p) => {
|
|
13241
|
-
const props = mergeProps(defaultProps$
|
|
13590
|
+
const props = mergeProps(defaultProps$F, p);
|
|
13242
13591
|
const rootRef = React$1.useRef(null);
|
|
13243
13592
|
const expandElRef = React$1.useRef(null);
|
|
13244
13593
|
const collapseElRef = React$1.useRef(null);
|
|
@@ -13426,13 +13775,13 @@ const Empty = (props) => {
|
|
|
13426
13775
|
}, props.description)));
|
|
13427
13776
|
};
|
|
13428
13777
|
const classPrefix$R = `adm-error-block`;
|
|
13429
|
-
const defaultProps$
|
|
13778
|
+
const defaultProps$E = {
|
|
13430
13779
|
status: "default"
|
|
13431
13780
|
};
|
|
13432
13781
|
function createErrorBlock(imageRecord2) {
|
|
13433
13782
|
const ErrorBlock2 = (p) => {
|
|
13434
13783
|
var _a;
|
|
13435
|
-
const props = mergeProps(defaultProps$
|
|
13784
|
+
const props = mergeProps(defaultProps$E, p);
|
|
13436
13785
|
const {
|
|
13437
13786
|
locale
|
|
13438
13787
|
} = useConfig();
|
|
@@ -13964,7 +14313,7 @@ const imageRecord = {
|
|
|
13964
14313
|
};
|
|
13965
14314
|
const ErrorBlock = createErrorBlock(imageRecord);
|
|
13966
14315
|
const classPrefix$Q = `adm-floating-bubble`;
|
|
13967
|
-
const defaultProps$
|
|
14316
|
+
const defaultProps$D = {
|
|
13968
14317
|
axis: "y",
|
|
13969
14318
|
defaultOffset: {
|
|
13970
14319
|
x: 0,
|
|
@@ -13972,7 +14321,7 @@ const defaultProps$E = {
|
|
|
13972
14321
|
}
|
|
13973
14322
|
};
|
|
13974
14323
|
const FloatingBubble = (p) => {
|
|
13975
|
-
const props = mergeProps(defaultProps$
|
|
14324
|
+
const props = mergeProps(defaultProps$D, p);
|
|
13976
14325
|
const boundaryRef = React$1.useRef(null);
|
|
13977
14326
|
const buttonRef = React$1.useRef(null);
|
|
13978
14327
|
const [innerValue, setInnerValue] = React$1.useState(props.offset === void 0 ? props.defaultOffset : props.offset);
|
|
@@ -14071,12 +14420,12 @@ function nearest(arr, target) {
|
|
|
14071
14420
|
});
|
|
14072
14421
|
}
|
|
14073
14422
|
const classPrefix$P = "adm-floating-panel";
|
|
14074
|
-
const defaultProps$
|
|
14423
|
+
const defaultProps$C = {
|
|
14075
14424
|
handleDraggingOfContent: true
|
|
14076
14425
|
};
|
|
14077
14426
|
const FloatingPanel = React$1.forwardRef((p, ref) => {
|
|
14078
14427
|
var _a, _b;
|
|
14079
|
-
const props = mergeProps(defaultProps$
|
|
14428
|
+
const props = mergeProps(defaultProps$C, p);
|
|
14080
14429
|
const {
|
|
14081
14430
|
anchors
|
|
14082
14431
|
} = props;
|
|
@@ -14218,116 +14567,23 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
14218
14567
|
}
|
|
14219
14568
|
return target;
|
|
14220
14569
|
}
|
|
14221
|
-
function _objectWithoutProperties(source, excluded) {
|
|
14222
|
-
if (source == null)
|
|
14223
|
-
return {};
|
|
14224
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
14225
|
-
var key, i2;
|
|
14226
|
-
if (Object.getOwnPropertySymbols) {
|
|
14227
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
14228
|
-
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
|
|
14229
|
-
key = sourceSymbolKeys[i2];
|
|
14230
|
-
if (excluded.indexOf(key) >= 0)
|
|
14231
|
-
continue;
|
|
14232
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
14233
|
-
continue;
|
|
14234
|
-
target[key] = source[key];
|
|
14235
|
-
}
|
|
14236
|
-
}
|
|
14237
|
-
return target;
|
|
14238
|
-
}
|
|
14239
|
-
function _typeof$1(o) {
|
|
14240
|
-
"@babel/helpers - typeof";
|
|
14241
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
14242
|
-
return typeof o2;
|
|
14243
|
-
} : function(o2) {
|
|
14244
|
-
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
14245
|
-
}, _typeof$1(o);
|
|
14246
|
-
}
|
|
14247
|
-
function _toPrimitive(input, hint) {
|
|
14248
|
-
if (_typeof$1(input) !== "object" || input === null)
|
|
14249
|
-
return input;
|
|
14250
|
-
var prim = input[Symbol.toPrimitive];
|
|
14251
|
-
if (prim !== void 0) {
|
|
14252
|
-
var res = prim.call(input, hint || "default");
|
|
14253
|
-
if (_typeof$1(res) !== "object")
|
|
14254
|
-
return res;
|
|
14255
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
14256
|
-
}
|
|
14257
|
-
return (hint === "string" ? String : Number)(input);
|
|
14258
|
-
}
|
|
14259
|
-
function _toPropertyKey(arg) {
|
|
14260
|
-
var key = _toPrimitive(arg, "string");
|
|
14261
|
-
return _typeof$1(key) === "symbol" ? key : String(key);
|
|
14262
|
-
}
|
|
14263
|
-
function _defineProperty(obj, key, value) {
|
|
14264
|
-
key = _toPropertyKey(key);
|
|
14265
|
-
if (key in obj) {
|
|
14266
|
-
Object.defineProperty(obj, key, {
|
|
14267
|
-
value,
|
|
14268
|
-
enumerable: true,
|
|
14269
|
-
configurable: true,
|
|
14270
|
-
writable: true
|
|
14271
|
-
});
|
|
14272
|
-
} else {
|
|
14273
|
-
obj[key] = value;
|
|
14274
|
-
}
|
|
14275
|
-
return obj;
|
|
14276
|
-
}
|
|
14277
|
-
function ownKeys(e2, r) {
|
|
14278
|
-
var t = Object.keys(e2);
|
|
14279
|
-
if (Object.getOwnPropertySymbols) {
|
|
14280
|
-
var o = Object.getOwnPropertySymbols(e2);
|
|
14281
|
-
r && (o = o.filter(function(r2) {
|
|
14282
|
-
return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
|
|
14283
|
-
})), t.push.apply(t, o);
|
|
14284
|
-
}
|
|
14285
|
-
return t;
|
|
14286
|
-
}
|
|
14287
|
-
function _objectSpread2(e2) {
|
|
14288
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
14289
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
14290
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
14291
|
-
_defineProperty(e2, r2, t[r2]);
|
|
14292
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
14293
|
-
Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
14294
|
-
});
|
|
14295
|
-
}
|
|
14296
|
-
return e2;
|
|
14297
|
-
}
|
|
14298
|
-
function _arrayLikeToArray(arr, len) {
|
|
14299
|
-
if (len == null || len > arr.length)
|
|
14300
|
-
len = arr.length;
|
|
14301
|
-
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
|
|
14302
|
-
arr2[i2] = arr[i2];
|
|
14303
|
-
return arr2;
|
|
14304
|
-
}
|
|
14305
|
-
function _arrayWithoutHoles(arr) {
|
|
14306
|
-
if (Array.isArray(arr))
|
|
14307
|
-
return _arrayLikeToArray(arr);
|
|
14308
|
-
}
|
|
14309
|
-
function _iterableToArray(iter) {
|
|
14310
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
14311
|
-
return Array.from(iter);
|
|
14312
|
-
}
|
|
14313
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
14314
|
-
if (!o)
|
|
14315
|
-
return;
|
|
14316
|
-
if (typeof o === "string")
|
|
14317
|
-
return _arrayLikeToArray(o, minLen);
|
|
14318
|
-
var n2 = Object.prototype.toString.call(o).slice(8, -1);
|
|
14319
|
-
if (n2 === "Object" && o.constructor)
|
|
14320
|
-
n2 = o.constructor.name;
|
|
14321
|
-
if (n2 === "Map" || n2 === "Set")
|
|
14322
|
-
return Array.from(o);
|
|
14323
|
-
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
14324
|
-
return _arrayLikeToArray(o, minLen);
|
|
14325
|
-
}
|
|
14326
|
-
function _nonIterableSpread() {
|
|
14327
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14328
|
-
}
|
|
14329
|
-
function _toConsumableArray(arr) {
|
|
14330
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
14570
|
+
function _objectWithoutProperties(source, excluded) {
|
|
14571
|
+
if (source == null)
|
|
14572
|
+
return {};
|
|
14573
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
14574
|
+
var key, i2;
|
|
14575
|
+
if (Object.getOwnPropertySymbols) {
|
|
14576
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
14577
|
+
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
|
|
14578
|
+
key = sourceSymbolKeys[i2];
|
|
14579
|
+
if (excluded.indexOf(key) >= 0)
|
|
14580
|
+
continue;
|
|
14581
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
14582
|
+
continue;
|
|
14583
|
+
target[key] = source[key];
|
|
14584
|
+
}
|
|
14585
|
+
}
|
|
14586
|
+
return target;
|
|
14331
14587
|
}
|
|
14332
14588
|
function _classCallCheck(instance, Constructor) {
|
|
14333
14589
|
if (!(instance instanceof Constructor)) {
|
|
@@ -14443,49 +14699,6 @@ function toArray$2(children) {
|
|
|
14443
14699
|
});
|
|
14444
14700
|
return ret;
|
|
14445
14701
|
}
|
|
14446
|
-
var warned$1 = {};
|
|
14447
|
-
var preWarningFns$1 = [];
|
|
14448
|
-
var preMessage$1 = function preMessage2(fn) {
|
|
14449
|
-
preWarningFns$1.push(fn);
|
|
14450
|
-
};
|
|
14451
|
-
function warning$3(valid, message) {
|
|
14452
|
-
if (!valid && console !== void 0) {
|
|
14453
|
-
var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
|
|
14454
|
-
return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "warning");
|
|
14455
|
-
}, message);
|
|
14456
|
-
if (finalMessage) {
|
|
14457
|
-
console.error("Warning: ".concat(finalMessage));
|
|
14458
|
-
}
|
|
14459
|
-
}
|
|
14460
|
-
}
|
|
14461
|
-
function note$1(valid, message) {
|
|
14462
|
-
if (!valid && console !== void 0) {
|
|
14463
|
-
var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
|
|
14464
|
-
return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "note");
|
|
14465
|
-
}, message);
|
|
14466
|
-
if (finalMessage) {
|
|
14467
|
-
console.warn("Note: ".concat(finalMessage));
|
|
14468
|
-
}
|
|
14469
|
-
}
|
|
14470
|
-
}
|
|
14471
|
-
function resetWarned$1() {
|
|
14472
|
-
warned$1 = {};
|
|
14473
|
-
}
|
|
14474
|
-
function call$1(method4, valid, message) {
|
|
14475
|
-
if (!valid && !warned$1[message]) {
|
|
14476
|
-
method4(false, message);
|
|
14477
|
-
warned$1[message] = true;
|
|
14478
|
-
}
|
|
14479
|
-
}
|
|
14480
|
-
function warningOnce$1(valid, message) {
|
|
14481
|
-
call$1(warning$3, valid, message);
|
|
14482
|
-
}
|
|
14483
|
-
function noteOnce$1(valid, message) {
|
|
14484
|
-
call$1(note$1, valid, message);
|
|
14485
|
-
}
|
|
14486
|
-
warningOnce$1.preMessage = preMessage$1;
|
|
14487
|
-
warningOnce$1.resetWarned = resetWarned$1;
|
|
14488
|
-
warningOnce$1.noteOnce = noteOnce$1;
|
|
14489
14702
|
var HOOK_MARK$1 = "RC_FORM_INTERNAL_HOOKS";
|
|
14490
14703
|
var warningFunc$1 = function warningFunc() {
|
|
14491
14704
|
warningOnce$1(false, "Can not find FormContext. Please make sure you wrap Field under Form.");
|
|
@@ -15971,53 +16184,6 @@ var defaultValidateMessages = {
|
|
|
15971
16184
|
mismatch: "'${name}' does not match pattern ${pattern}"
|
|
15972
16185
|
}
|
|
15973
16186
|
};
|
|
15974
|
-
function get(entity, path) {
|
|
15975
|
-
var current = entity;
|
|
15976
|
-
for (var i2 = 0; i2 < path.length; i2 += 1) {
|
|
15977
|
-
if (current === null || current === void 0) {
|
|
15978
|
-
return void 0;
|
|
15979
|
-
}
|
|
15980
|
-
current = current[path[i2]];
|
|
15981
|
-
}
|
|
15982
|
-
return current;
|
|
15983
|
-
}
|
|
15984
|
-
function _arrayWithHoles(arr) {
|
|
15985
|
-
if (Array.isArray(arr))
|
|
15986
|
-
return arr;
|
|
15987
|
-
}
|
|
15988
|
-
function _nonIterableRest() {
|
|
15989
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
15990
|
-
}
|
|
15991
|
-
function _toArray(arr) {
|
|
15992
|
-
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
15993
|
-
}
|
|
15994
|
-
function internalSet(entity, paths, value, removeIfUndefined) {
|
|
15995
|
-
if (!paths.length) {
|
|
15996
|
-
return value;
|
|
15997
|
-
}
|
|
15998
|
-
var _paths = _toArray(paths), path = _paths[0], restPath = _paths.slice(1);
|
|
15999
|
-
var clone;
|
|
16000
|
-
if (!entity && typeof path === "number") {
|
|
16001
|
-
clone = [];
|
|
16002
|
-
} else if (Array.isArray(entity)) {
|
|
16003
|
-
clone = _toConsumableArray(entity);
|
|
16004
|
-
} else {
|
|
16005
|
-
clone = _objectSpread2({}, entity);
|
|
16006
|
-
}
|
|
16007
|
-
if (removeIfUndefined && value === void 0 && restPath.length === 1) {
|
|
16008
|
-
delete clone[path][restPath[0]];
|
|
16009
|
-
} else {
|
|
16010
|
-
clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
|
|
16011
|
-
}
|
|
16012
|
-
return clone;
|
|
16013
|
-
}
|
|
16014
|
-
function set(entity, paths, value) {
|
|
16015
|
-
var removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
16016
|
-
if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) {
|
|
16017
|
-
return entity;
|
|
16018
|
-
}
|
|
16019
|
-
return internalSet(entity, paths, value, removeIfUndefined);
|
|
16020
|
-
}
|
|
16021
16187
|
function cloneDeep(val) {
|
|
16022
16188
|
if (Array.isArray(val)) {
|
|
16023
16189
|
return cloneArrayDeep(val);
|
|
@@ -16925,35 +17091,6 @@ var List = function List2(_ref) {
|
|
|
16925
17091
|
}), operations, meta);
|
|
16926
17092
|
})));
|
|
16927
17093
|
};
|
|
16928
|
-
function _iterableToArrayLimit(r, l) {
|
|
16929
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
16930
|
-
if (null != t) {
|
|
16931
|
-
var e2, n2, i2, u, a = [], f = true, o = false;
|
|
16932
|
-
try {
|
|
16933
|
-
if (i2 = (t = t.call(r)).next, 0 === l) {
|
|
16934
|
-
if (Object(t) !== t)
|
|
16935
|
-
return;
|
|
16936
|
-
f = false;
|
|
16937
|
-
} else
|
|
16938
|
-
for (; !(f = (e2 = i2.call(t)).done) && (a.push(e2.value), a.length !== l); f = true)
|
|
16939
|
-
;
|
|
16940
|
-
} catch (r2) {
|
|
16941
|
-
o = true, n2 = r2;
|
|
16942
|
-
} finally {
|
|
16943
|
-
try {
|
|
16944
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u))
|
|
16945
|
-
return;
|
|
16946
|
-
} finally {
|
|
16947
|
-
if (o)
|
|
16948
|
-
throw n2;
|
|
16949
|
-
}
|
|
16950
|
-
}
|
|
16951
|
-
return a;
|
|
16952
|
-
}
|
|
16953
|
-
}
|
|
16954
|
-
function _slicedToArray(arr, i2) {
|
|
16955
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
|
|
16956
|
-
}
|
|
16957
17094
|
function allPromiseFinish(promiseList) {
|
|
16958
17095
|
var hasError = false;
|
|
16959
17096
|
var count = promiseList.length;
|
|
@@ -18117,9 +18254,9 @@ const FormArray = (props) => {
|
|
|
18117
18254
|
});
|
|
18118
18255
|
};
|
|
18119
18256
|
const classPrefix$O = "adm-form";
|
|
18120
|
-
const defaultProps$
|
|
18257
|
+
const defaultProps$B = defaultFormContext;
|
|
18121
18258
|
const Form2 = React$1.forwardRef((p, ref) => {
|
|
18122
|
-
const props = mergeProps(defaultProps$
|
|
18259
|
+
const props = mergeProps(defaultProps$B, p);
|
|
18123
18260
|
const {
|
|
18124
18261
|
className,
|
|
18125
18262
|
style,
|
|
@@ -19804,7 +19941,7 @@ function convertPx(px) {
|
|
|
19804
19941
|
return tester.getBoundingClientRect().height;
|
|
19805
19942
|
}
|
|
19806
19943
|
const classPrefix$N = `adm-popover`;
|
|
19807
|
-
const defaultProps$
|
|
19944
|
+
const defaultProps$A = {
|
|
19808
19945
|
placement: "top",
|
|
19809
19946
|
defaultVisible: false,
|
|
19810
19947
|
stopPropagation: ["click"],
|
|
@@ -19812,7 +19949,7 @@ const defaultProps$B = {
|
|
|
19812
19949
|
mode: "light"
|
|
19813
19950
|
};
|
|
19814
19951
|
const Popover$1 = React$1.forwardRef((p, ref) => {
|
|
19815
|
-
const props = mergeProps(defaultProps$
|
|
19952
|
+
const props = mergeProps(defaultProps$A, p);
|
|
19816
19953
|
const placement = normalizePlacement(props.placement);
|
|
19817
19954
|
const [visible, setVisible] = usePropsValue({
|
|
19818
19955
|
value: props.visible,
|
|
@@ -20693,14 +20830,14 @@ const Slides = React$1.forwardRef((props, ref) => {
|
|
|
20693
20830
|
}))));
|
|
20694
20831
|
});
|
|
20695
20832
|
const classPrefix$H = `adm-image-viewer`;
|
|
20696
|
-
const defaultProps$
|
|
20833
|
+
const defaultProps$z = {
|
|
20697
20834
|
maxZoom: 3,
|
|
20698
20835
|
getContainer: null,
|
|
20699
20836
|
visible: false
|
|
20700
20837
|
};
|
|
20701
20838
|
const ImageViewer$1 = (p) => {
|
|
20702
20839
|
var _a, _b, _c;
|
|
20703
|
-
const props = mergeProps(defaultProps$
|
|
20840
|
+
const props = mergeProps(defaultProps$z, p);
|
|
20704
20841
|
const node = React$1.createElement(Mask, {
|
|
20705
20842
|
visible: props.visible,
|
|
20706
20843
|
disableBodyScroll: false,
|
|
@@ -20721,7 +20858,7 @@ const ImageViewer$1 = (p) => {
|
|
|
20721
20858
|
})));
|
|
20722
20859
|
return renderToContainer(props.getContainer, node);
|
|
20723
20860
|
};
|
|
20724
|
-
const multiDefaultProps = Object.assign(Object.assign({}, defaultProps$
|
|
20861
|
+
const multiDefaultProps = Object.assign(Object.assign({}, defaultProps$z), {
|
|
20725
20862
|
defaultIndex: 0
|
|
20726
20863
|
});
|
|
20727
20864
|
const MultiImageViewer = React$1.forwardRef((p, ref) => {
|
|
@@ -20861,11 +20998,11 @@ const PreviewItem = (props) => {
|
|
|
20861
20998
|
};
|
|
20862
20999
|
const PreviewItem$1 = PreviewItem;
|
|
20863
21000
|
const classPrefix$F = `adm-space`;
|
|
20864
|
-
const defaultProps$
|
|
21001
|
+
const defaultProps$y = {
|
|
20865
21002
|
direction: "horizontal"
|
|
20866
21003
|
};
|
|
20867
21004
|
const Space = (p) => {
|
|
20868
|
-
const props = mergeProps(defaultProps$
|
|
21005
|
+
const props = mergeProps(defaultProps$y, p);
|
|
20869
21006
|
const {
|
|
20870
21007
|
direction,
|
|
20871
21008
|
onClick
|
|
@@ -20886,7 +21023,7 @@ const Space = (p) => {
|
|
|
20886
21023
|
})));
|
|
20887
21024
|
};
|
|
20888
21025
|
const classPrefix$E = `adm-image-uploader`;
|
|
20889
|
-
const defaultProps$
|
|
21026
|
+
const defaultProps$x = {
|
|
20890
21027
|
disableUpload: false,
|
|
20891
21028
|
deletable: true,
|
|
20892
21029
|
deleteIcon: React$1.createElement(CloseOutline, {
|
|
@@ -20905,7 +21042,7 @@ const ImageUploader = React$1.forwardRef((p, ref) => {
|
|
|
20905
21042
|
const {
|
|
20906
21043
|
locale
|
|
20907
21044
|
} = useConfig();
|
|
20908
|
-
const props = mergeProps(defaultProps$
|
|
21045
|
+
const props = mergeProps(defaultProps$x, p);
|
|
20909
21046
|
const {
|
|
20910
21047
|
columns
|
|
20911
21048
|
} = props;
|
|
@@ -21191,11 +21328,11 @@ const Sidebar = (props) => {
|
|
|
21191
21328
|
}));
|
|
21192
21329
|
};
|
|
21193
21330
|
const classPrefix$C = `adm-index-bar`;
|
|
21194
|
-
const defaultProps$
|
|
21331
|
+
const defaultProps$w = {
|
|
21195
21332
|
sticky: true
|
|
21196
21333
|
};
|
|
21197
21334
|
const IndexBar = React$1.forwardRef((p, ref) => {
|
|
21198
|
-
const props = mergeProps(defaultProps$
|
|
21335
|
+
const props = mergeProps(defaultProps$w, p);
|
|
21199
21336
|
const titleHeight = convertPx(35);
|
|
21200
21337
|
const bodyRef = React$1.useRef(null);
|
|
21201
21338
|
const indexItems = [];
|
|
@@ -21296,7 +21433,7 @@ function isWindow(element) {
|
|
|
21296
21433
|
return element === window;
|
|
21297
21434
|
}
|
|
21298
21435
|
const classPrefix$B = `adm-infinite-scroll`;
|
|
21299
|
-
const defaultProps$
|
|
21436
|
+
const defaultProps$v = {
|
|
21300
21437
|
threshold: 250,
|
|
21301
21438
|
children: (hasMore, failed, retry) => React$1.createElement(InfiniteScrollContent, {
|
|
21302
21439
|
hasMore,
|
|
@@ -21305,7 +21442,7 @@ const defaultProps$w = {
|
|
|
21305
21442
|
})
|
|
21306
21443
|
};
|
|
21307
21444
|
const InfiniteScroll = (p) => {
|
|
21308
|
-
const props = mergeProps(defaultProps$
|
|
21445
|
+
const props = mergeProps(defaultProps$v, p);
|
|
21309
21446
|
const [failed, setFailed] = React$1.useState(false);
|
|
21310
21447
|
const doLoadMore = useLockFn((isRetry) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21311
21448
|
try {
|
|
@@ -21426,7 +21563,7 @@ function useInputHandleKeyDown({
|
|
|
21426
21563
|
return handleKeydown;
|
|
21427
21564
|
}
|
|
21428
21565
|
const classPrefix$A = `adm-input`;
|
|
21429
|
-
const defaultProps$
|
|
21566
|
+
const defaultProps$u = {
|
|
21430
21567
|
defaultValue: "",
|
|
21431
21568
|
clearIcon: React$1.createElement(CloseCircleFill, null),
|
|
21432
21569
|
onlyShowClearWhenFocus: true
|
|
@@ -21436,7 +21573,7 @@ const Input = React$1.forwardRef((props, ref) => {
|
|
|
21436
21573
|
locale,
|
|
21437
21574
|
input: componentConfig = {}
|
|
21438
21575
|
} = useConfig();
|
|
21439
|
-
const mergedProps = mergeProps(defaultProps$
|
|
21576
|
+
const mergedProps = mergeProps(defaultProps$u, componentConfig, props);
|
|
21440
21577
|
const [value, setValue2] = usePropsValue(mergedProps);
|
|
21441
21578
|
const [hasFocus, setHasFocus] = React$1.useState(false);
|
|
21442
21579
|
const compositionStartRef = React$1.useRef(false);
|
|
@@ -21670,14 +21807,14 @@ const ModalActionButton = (props) => {
|
|
|
21670
21807
|
disabled: action.disabled
|
|
21671
21808
|
}, action.text));
|
|
21672
21809
|
};
|
|
21673
|
-
const defaultProps$
|
|
21810
|
+
const defaultProps$t = {
|
|
21674
21811
|
actions: [],
|
|
21675
21812
|
closeOnAction: false,
|
|
21676
21813
|
closeOnMaskClick: false,
|
|
21677
21814
|
getContainer: null
|
|
21678
21815
|
};
|
|
21679
21816
|
const Modal = (p) => {
|
|
21680
|
-
const props = mergeProps(defaultProps$
|
|
21817
|
+
const props = mergeProps(defaultProps$t, p);
|
|
21681
21818
|
const element = React$1.createElement(React$1.Fragment, null, !!props.image && React$1.createElement("div", {
|
|
21682
21819
|
className: cls("image-container")
|
|
21683
21820
|
}, React$1.createElement(Image$1, {
|
|
@@ -21762,7 +21899,7 @@ function alert(p) {
|
|
|
21762
21899
|
}));
|
|
21763
21900
|
});
|
|
21764
21901
|
}
|
|
21765
|
-
const defaultProps$
|
|
21902
|
+
const defaultProps$s = {
|
|
21766
21903
|
confirmText: "确认",
|
|
21767
21904
|
cancelText: "取消"
|
|
21768
21905
|
};
|
|
@@ -21770,7 +21907,7 @@ function confirm(p) {
|
|
|
21770
21907
|
const {
|
|
21771
21908
|
locale
|
|
21772
21909
|
} = getDefaultConfig();
|
|
21773
|
-
const props = mergeProps(defaultProps$
|
|
21910
|
+
const props = mergeProps(defaultProps$s, {
|
|
21774
21911
|
confirmText: locale.common.confirm,
|
|
21775
21912
|
cancelText: locale.common.cancel
|
|
21776
21913
|
}, p);
|
|
@@ -21815,19 +21952,19 @@ const index$7 = attachPropertiesToComponent(Modal, {
|
|
|
21815
21952
|
clear: clear$1
|
|
21816
21953
|
});
|
|
21817
21954
|
const classPrefix$y = `adm-nav-bar`;
|
|
21818
|
-
const
|
|
21819
|
-
backIcon: true
|
|
21820
|
-
};
|
|
21955
|
+
const defaultBackIcon = React$1.createElement(LeftOutline, null);
|
|
21821
21956
|
const NavBar = (props) => {
|
|
21822
21957
|
const {
|
|
21823
21958
|
navBar: componentConfig = {}
|
|
21824
21959
|
} = useConfig();
|
|
21825
|
-
const mergedProps = mergeProps(
|
|
21960
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
21826
21961
|
const {
|
|
21827
21962
|
back,
|
|
21828
21963
|
backIcon,
|
|
21829
21964
|
backArrow
|
|
21830
21965
|
} = mergedProps;
|
|
21966
|
+
const mergedDefaultBackIcon = componentConfig.backIcon || defaultBackIcon;
|
|
21967
|
+
const mergedBackIcon = mergeProp(defaultBackIcon, componentConfig.backIcon, backArrow === true ? mergedDefaultBackIcon : backArrow, backIcon === true ? mergedDefaultBackIcon : backIcon);
|
|
21831
21968
|
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
21832
21969
|
className: classNames(classPrefix$y)
|
|
21833
21970
|
}, React$1.createElement("div", {
|
|
@@ -21836,9 +21973,9 @@ const NavBar = (props) => {
|
|
|
21836
21973
|
}, back !== null && React$1.createElement("div", {
|
|
21837
21974
|
className: `${classPrefix$y}-back`,
|
|
21838
21975
|
onClick: mergedProps.onBack
|
|
21839
|
-
},
|
|
21976
|
+
}, mergedBackIcon && React$1.createElement("span", {
|
|
21840
21977
|
className: `${classPrefix$y}-back-arrow`
|
|
21841
|
-
},
|
|
21978
|
+
}, mergedBackIcon), React$1.createElement("span", {
|
|
21842
21979
|
"aria-hidden": "true"
|
|
21843
21980
|
}, back)), mergedProps.left), React$1.createElement("div", {
|
|
21844
21981
|
className: `${classPrefix$y}-title`
|
|
@@ -23802,93 +23939,6 @@ const Slider = (p) => {
|
|
|
23802
23939
|
upperBound: sliderValue[1]
|
|
23803
23940
|
})));
|
|
23804
23941
|
};
|
|
23805
|
-
function useEvent(callback) {
|
|
23806
|
-
var fnRef = React__namespace.useRef();
|
|
23807
|
-
fnRef.current = callback;
|
|
23808
|
-
var memoFn = React__namespace.useCallback(function() {
|
|
23809
|
-
var _fnRef$current;
|
|
23810
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23811
|
-
args[_key] = arguments[_key];
|
|
23812
|
-
}
|
|
23813
|
-
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
23814
|
-
}, []);
|
|
23815
|
-
return memoFn;
|
|
23816
|
-
}
|
|
23817
|
-
function canUseDom() {
|
|
23818
|
-
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
23819
|
-
}
|
|
23820
|
-
var useInternalLayoutEffect = canUseDom() ? React__namespace.useLayoutEffect : React__namespace.useEffect;
|
|
23821
|
-
var useLayoutEffect = function useLayoutEffect2(callback, deps) {
|
|
23822
|
-
var firstMountRef = React__namespace.useRef(true);
|
|
23823
|
-
useInternalLayoutEffect(function() {
|
|
23824
|
-
return callback(firstMountRef.current);
|
|
23825
|
-
}, deps);
|
|
23826
|
-
useInternalLayoutEffect(function() {
|
|
23827
|
-
firstMountRef.current = false;
|
|
23828
|
-
return function() {
|
|
23829
|
-
firstMountRef.current = true;
|
|
23830
|
-
};
|
|
23831
|
-
}, []);
|
|
23832
|
-
};
|
|
23833
|
-
var useLayoutUpdateEffect = function useLayoutUpdateEffect2(callback, deps) {
|
|
23834
|
-
useLayoutEffect(function(firstMount) {
|
|
23835
|
-
if (!firstMount) {
|
|
23836
|
-
return callback();
|
|
23837
|
-
}
|
|
23838
|
-
}, deps);
|
|
23839
|
-
};
|
|
23840
|
-
function useSafeState(defaultValue) {
|
|
23841
|
-
var destroyRef = React__namespace.useRef(false);
|
|
23842
|
-
var _React$useState = React__namespace.useState(defaultValue), _React$useState2 = _slicedToArray(_React$useState, 2), value = _React$useState2[0], setValue2 = _React$useState2[1];
|
|
23843
|
-
React__namespace.useEffect(function() {
|
|
23844
|
-
destroyRef.current = false;
|
|
23845
|
-
return function() {
|
|
23846
|
-
destroyRef.current = true;
|
|
23847
|
-
};
|
|
23848
|
-
}, []);
|
|
23849
|
-
function safeSetState(updater, ignoreDestroy) {
|
|
23850
|
-
if (ignoreDestroy && destroyRef.current) {
|
|
23851
|
-
return;
|
|
23852
|
-
}
|
|
23853
|
-
setValue2(updater);
|
|
23854
|
-
}
|
|
23855
|
-
return [value, safeSetState];
|
|
23856
|
-
}
|
|
23857
|
-
function hasValue(value) {
|
|
23858
|
-
return value !== void 0;
|
|
23859
|
-
}
|
|
23860
|
-
function useMergedState(defaultStateValue, option) {
|
|
23861
|
-
var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState;
|
|
23862
|
-
var _useState = useSafeState(function() {
|
|
23863
|
-
if (hasValue(value)) {
|
|
23864
|
-
return value;
|
|
23865
|
-
} else if (hasValue(defaultValue)) {
|
|
23866
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
23867
|
-
} else {
|
|
23868
|
-
return typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue;
|
|
23869
|
-
}
|
|
23870
|
-
}), _useState2 = _slicedToArray(_useState, 2), innerValue = _useState2[0], setInnerValue = _useState2[1];
|
|
23871
|
-
var mergedValue = value !== void 0 ? value : innerValue;
|
|
23872
|
-
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
|
|
23873
|
-
var onChangeFn = useEvent(onChange);
|
|
23874
|
-
var _useState3 = useSafeState([mergedValue]), _useState4 = _slicedToArray(_useState3, 2), prevValue = _useState4[0], setPrevValue = _useState4[1];
|
|
23875
|
-
useLayoutUpdateEffect(function() {
|
|
23876
|
-
var prev = prevValue[0];
|
|
23877
|
-
if (innerValue !== prev) {
|
|
23878
|
-
onChangeFn(innerValue, prev);
|
|
23879
|
-
}
|
|
23880
|
-
}, [prevValue]);
|
|
23881
|
-
useLayoutUpdateEffect(function() {
|
|
23882
|
-
if (!hasValue(value)) {
|
|
23883
|
-
setInnerValue(value);
|
|
23884
|
-
}
|
|
23885
|
-
}, [value]);
|
|
23886
|
-
var triggerChange = useEvent(function(updater, ignoreDestroy) {
|
|
23887
|
-
setInnerValue(updater, ignoreDestroy);
|
|
23888
|
-
setPrevValue([mergedValue], ignoreDestroy);
|
|
23889
|
-
});
|
|
23890
|
-
return [postMergedValue, triggerChange];
|
|
23891
|
-
}
|
|
23892
23942
|
const classPrefix$e = `adm-stepper`;
|
|
23893
23943
|
const defaultProps$d = {
|
|
23894
23944
|
step: 1,
|