antd-mobile 5.36.1 → 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 +1260 -1138
- package/2x/bundle/antd-mobile.cjs.js +7 -7
- package/2x/bundle/antd-mobile.es.development.js +1260 -1138
- package/2x/bundle/antd-mobile.es.js +6853 -6777
- package/2x/bundle/antd-mobile.umd.development.js +1260 -1138
- package/2x/bundle/antd-mobile.umd.js +7 -7
- package/2x/bundle/style.css +50 -53
- 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/card/card.css +5 -5
- package/2x/cjs/components/card/card.patch.css +21 -0
- package/2x/cjs/components/center-popup/center-popup.js +46 -43
- package/2x/cjs/components/check-list/check-list.js +15 -11
- package/2x/cjs/components/collapse/collapse.d.ts +9 -1
- package/2x/cjs/components/collapse/collapse.js +26 -28
- package/2x/cjs/components/config-provider/config-provider.d.ts +40 -2
- package/2x/cjs/components/dropdown/context.d.ts +2 -0
- package/2x/cjs/components/dropdown/context.js +10 -0
- package/2x/cjs/components/dropdown/dropdown.d.ts +11 -3
- package/2x/cjs/components/dropdown/dropdown.js +23 -16
- package/2x/cjs/components/dropdown/index.d.ts +1 -0
- package/2x/cjs/components/dropdown/item.d.ts +5 -1
- package/2x/cjs/components/dropdown/item.js +22 -8
- package/2x/cjs/components/form/form-item.d.ts +6 -5
- package/2x/cjs/components/form/form-item.js +25 -17
- package/2x/cjs/components/form/form.d.ts +1 -1
- package/2x/cjs/components/form/index.d.ts +1 -1
- package/2x/cjs/components/input/input.d.ts +3 -1
- package/2x/cjs/components/input/input.js +53 -51
- package/2x/cjs/components/list/list-item.d.ts +6 -2
- package/2x/cjs/components/list/list-item.js +16 -6
- package/2x/cjs/components/nav-bar/nav-bar.d.ts +4 -0
- package/2x/cjs/components/nav-bar/nav-bar.js +20 -15
- package/2x/cjs/components/notice-bar/notice-bar.css +0 -3
- package/2x/cjs/components/notice-bar/notice-bar.d.ts +3 -1
- package/2x/cjs/components/notice-bar/notice-bar.js +30 -25
- package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.js +14 -13
- package/2x/cjs/components/popup/popup-base-props.d.ts +3 -2
- package/2x/cjs/components/popup/popup-base-props.js +4 -0
- package/2x/cjs/components/popup/popup.js +5 -5
- package/2x/cjs/components/result/result.js +3 -10
- package/2x/cjs/components/result/use-result-icon.d.ts +3 -0
- package/2x/cjs/components/result/use-result-icon.js +37 -0
- package/2x/cjs/components/result-page/result-page.js +3 -10
- package/2x/cjs/components/search-bar/search-bar.d.ts +10 -2
- package/2x/cjs/components/search-bar/search-bar.js +34 -33
- package/2x/cjs/components/toast/toast.d.ts +2 -2
- package/2x/cjs/components/toast/toast.js +4 -4
- package/2x/cjs/components/virtual-input/virtual-input.d.ts +5 -5
- package/2x/cjs/components/virtual-input/virtual-input.js +26 -24
- package/2x/cjs/utils/is-node-with-content.d.ts +3 -0
- package/2x/cjs/utils/is-node-with-content.js +3 -0
- package/2x/cjs/utils/with-default-props.d.ts +7 -0
- package/2x/cjs/utils/with-default-props.js +21 -5
- 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/card/card.css +5 -5
- package/2x/es/components/card/card.patch.css +21 -0
- package/2x/es/components/center-popup/center-popup.js +45 -42
- package/2x/es/components/check-list/check-list.js +15 -11
- package/2x/es/components/collapse/collapse.d.ts +9 -1
- package/2x/es/components/collapse/collapse.js +26 -28
- package/2x/es/components/config-provider/config-provider.d.ts +40 -2
- package/2x/es/components/dropdown/context.d.ts +2 -0
- package/2x/es/components/dropdown/context.js +2 -0
- package/2x/es/components/dropdown/dropdown.d.ts +11 -3
- package/2x/es/components/dropdown/dropdown.js +24 -17
- package/2x/es/components/dropdown/index.d.ts +1 -0
- package/2x/es/components/dropdown/item.d.ts +5 -1
- package/2x/es/components/dropdown/item.js +22 -8
- package/2x/es/components/form/form-item.d.ts +6 -5
- package/2x/es/components/form/form-item.js +24 -16
- package/2x/es/components/form/form.d.ts +1 -1
- package/2x/es/components/form/index.d.ts +1 -1
- package/2x/es/components/input/input.d.ts +3 -1
- package/2x/es/components/input/input.js +52 -50
- package/2x/es/components/list/list-item.d.ts +6 -2
- package/2x/es/components/list/list-item.js +16 -6
- package/2x/es/components/nav-bar/nav-bar.d.ts +4 -0
- package/2x/es/components/nav-bar/nav-bar.js +21 -16
- package/2x/es/components/notice-bar/notice-bar.css +0 -3
- package/2x/es/components/notice-bar/notice-bar.d.ts +3 -1
- package/2x/es/components/notice-bar/notice-bar.js +29 -24
- package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.js +13 -12
- package/2x/es/components/popup/popup-base-props.d.ts +3 -2
- package/2x/es/components/popup/popup-base-props.js +3 -0
- package/2x/es/components/popup/popup.js +5 -5
- package/2x/es/components/result/result.js +3 -10
- package/2x/es/components/result/use-result-icon.d.ts +3 -0
- package/2x/es/components/result/use-result-icon.js +29 -0
- package/2x/es/components/result-page/result-page.js +3 -10
- package/2x/es/components/search-bar/search-bar.d.ts +10 -2
- package/2x/es/components/search-bar/search-bar.js +33 -32
- package/2x/es/components/toast/toast.d.ts +2 -2
- package/2x/es/components/toast/toast.js +3 -3
- package/2x/es/components/virtual-input/virtual-input.d.ts +5 -5
- package/2x/es/components/virtual-input/virtual-input.js +25 -23
- package/2x/es/utils/is-node-with-content.d.ts +3 -0
- package/2x/es/utils/is-node-with-content.js +3 -0
- package/2x/es/utils/with-default-props.d.ts +7 -0
- package/2x/es/utils/with-default-props.js +20 -5
- package/2x/package.json +1 -1
- package/bundle/antd-mobile.cjs.development.js +1260 -1138
- package/bundle/antd-mobile.cjs.js +7 -7
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +1260 -1138
- package/bundle/antd-mobile.es.js +6853 -6777
- package/bundle/antd-mobile.umd.development.js +1260 -1138
- 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/card/card.css +5 -5
- package/cjs/components/card/card.patch.css +17 -0
- package/cjs/components/center-popup/center-popup.js +46 -43
- package/cjs/components/check-list/check-list.js +15 -11
- package/cjs/components/collapse/collapse.d.ts +9 -1
- package/cjs/components/collapse/collapse.js +26 -28
- package/cjs/components/config-provider/config-provider.d.ts +40 -2
- package/cjs/components/dropdown/context.d.ts +2 -0
- package/cjs/components/dropdown/context.js +10 -0
- package/cjs/components/dropdown/dropdown.d.ts +11 -3
- package/cjs/components/dropdown/dropdown.js +23 -16
- package/cjs/components/dropdown/index.d.ts +1 -0
- package/cjs/components/dropdown/item.d.ts +5 -1
- package/cjs/components/dropdown/item.js +22 -8
- package/cjs/components/form/form-item.d.ts +6 -5
- package/cjs/components/form/form-item.js +25 -17
- package/cjs/components/form/form.d.ts +1 -1
- package/cjs/components/form/index.d.ts +1 -1
- package/cjs/components/input/input.d.ts +3 -1
- package/cjs/components/input/input.js +53 -51
- package/cjs/components/list/list-item.d.ts +6 -2
- package/cjs/components/list/list-item.js +16 -6
- package/cjs/components/nav-bar/nav-bar.d.ts +4 -0
- package/cjs/components/nav-bar/nav-bar.js +20 -15
- package/cjs/components/notice-bar/notice-bar.css +0 -2
- package/cjs/components/notice-bar/notice-bar.d.ts +3 -1
- package/cjs/components/notice-bar/notice-bar.js +30 -25
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/cjs/components/number-keyboard/number-keyboard.js +14 -13
- package/cjs/components/popup/popup-base-props.d.ts +3 -2
- package/cjs/components/popup/popup-base-props.js +4 -0
- package/cjs/components/popup/popup.js +5 -5
- package/cjs/components/result/result.js +3 -10
- package/cjs/components/result/use-result-icon.d.ts +3 -0
- package/cjs/components/result/use-result-icon.js +37 -0
- package/cjs/components/result-page/result-page.js +3 -10
- package/cjs/components/search-bar/search-bar.d.ts +10 -2
- package/cjs/components/search-bar/search-bar.js +34 -33
- package/cjs/components/toast/toast.css +1 -1
- package/cjs/components/toast/toast.d.ts +2 -2
- package/cjs/components/toast/toast.js +4 -4
- package/cjs/components/virtual-input/virtual-input.d.ts +5 -5
- package/cjs/components/virtual-input/virtual-input.js +26 -24
- package/cjs/utils/is-node-with-content.d.ts +3 -0
- package/cjs/utils/is-node-with-content.js +3 -0
- package/cjs/utils/with-default-props.d.ts +7 -0
- package/cjs/utils/with-default-props.js +21 -5
- 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/card/card.css +5 -5
- package/es/components/card/card.patch.css +17 -0
- package/es/components/center-popup/center-popup.js +45 -42
- package/es/components/check-list/check-list.js +15 -11
- package/es/components/collapse/collapse.d.ts +9 -1
- package/es/components/collapse/collapse.js +26 -28
- package/es/components/config-provider/config-provider.d.ts +40 -2
- package/es/components/dropdown/context.d.ts +2 -0
- package/es/components/dropdown/context.js +2 -0
- package/es/components/dropdown/dropdown.d.ts +11 -3
- package/es/components/dropdown/dropdown.js +24 -17
- package/es/components/dropdown/index.d.ts +1 -0
- package/es/components/dropdown/item.d.ts +5 -1
- package/es/components/dropdown/item.js +22 -8
- package/es/components/form/form-item.d.ts +6 -5
- package/es/components/form/form-item.js +24 -16
- package/es/components/form/form.d.ts +1 -1
- package/es/components/form/index.d.ts +1 -1
- package/es/components/input/input.d.ts +3 -1
- package/es/components/input/input.js +52 -50
- package/es/components/list/list-item.d.ts +6 -2
- package/es/components/list/list-item.js +16 -6
- package/es/components/nav-bar/nav-bar.d.ts +4 -0
- package/es/components/nav-bar/nav-bar.js +21 -16
- package/es/components/notice-bar/notice-bar.css +0 -2
- package/es/components/notice-bar/notice-bar.d.ts +3 -1
- package/es/components/notice-bar/notice-bar.js +29 -24
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/es/components/number-keyboard/number-keyboard.js +13 -12
- package/es/components/popup/popup-base-props.d.ts +3 -2
- package/es/components/popup/popup-base-props.js +3 -0
- package/es/components/popup/popup.js +5 -5
- package/es/components/result/result.js +3 -10
- package/es/components/result/use-result-icon.d.ts +3 -0
- package/es/components/result/use-result-icon.js +29 -0
- package/es/components/result-page/result-page.js +3 -10
- package/es/components/search-bar/search-bar.d.ts +10 -2
- package/es/components/search-bar/search-bar.js +33 -32
- package/es/components/toast/toast.css +1 -1
- package/es/components/toast/toast.d.ts +2 -2
- package/es/components/toast/toast.js +3 -3
- package/es/components/virtual-input/virtual-input.d.ts +5 -5
- package/es/components/virtual-input/virtual-input.js +25 -23
- package/es/utils/is-node-with-content.d.ts +3 -0
- package/es/utils/is-node-with-content.js +3 -0
- package/es/utils/with-default-props.d.ts +7 -0
- package/es/utils/with-default-props.js +20 -5
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -452,14 +452,24 @@ function withNativeProps(props, element) {
|
|
|
452
452
|
function mergeProps(...items) {
|
|
453
453
|
const ret = {};
|
|
454
454
|
items.forEach((item) => {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
455
|
+
if (item) {
|
|
456
|
+
Object.keys(item).forEach((key) => {
|
|
457
|
+
if (item[key] !== void 0) {
|
|
458
|
+
ret[key] = item[key];
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
}
|
|
460
462
|
});
|
|
461
463
|
return ret;
|
|
462
464
|
}
|
|
465
|
+
function mergeProp(defaultProp, ...propList) {
|
|
466
|
+
for (let i2 = propList.length - 1; i2 >= 0; i2 -= 1) {
|
|
467
|
+
if (propList[i2] !== void 0) {
|
|
468
|
+
return propList[i2];
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return defaultProp;
|
|
472
|
+
}
|
|
463
473
|
var createUpdateEffect = function(hook) {
|
|
464
474
|
return function(effect, deps) {
|
|
465
475
|
var isMounted = React$1.useRef(false);
|
|
@@ -5838,7 +5848,7 @@ const colorRecord$4 = {
|
|
|
5838
5848
|
black: "0, 0, 0",
|
|
5839
5849
|
white: "255, 255, 255"
|
|
5840
5850
|
};
|
|
5841
|
-
const defaultProps$
|
|
5851
|
+
const defaultProps$14 = {
|
|
5842
5852
|
visible: true,
|
|
5843
5853
|
destroyOnClose: false,
|
|
5844
5854
|
forceRender: false,
|
|
@@ -5849,7 +5859,7 @@ const defaultProps$15 = {
|
|
|
5849
5859
|
stopPropagation: ["click"]
|
|
5850
5860
|
};
|
|
5851
5861
|
const Mask = (p) => {
|
|
5852
|
-
const props = mergeProps(defaultProps$
|
|
5862
|
+
const props = mergeProps(defaultProps$14, p);
|
|
5853
5863
|
const {
|
|
5854
5864
|
locale
|
|
5855
5865
|
} = useConfig();
|
|
@@ -6511,6 +6521,7 @@ function TextDeletionOutline(props) {
|
|
|
6511
6521
|
}
|
|
6512
6522
|
const defaultPopupBaseProps = {
|
|
6513
6523
|
closeOnMaskClick: false,
|
|
6524
|
+
closeIcon: React$1.createElement(CloseOutline, null),
|
|
6514
6525
|
destroyOnClose: false,
|
|
6515
6526
|
disableBodyScroll: true,
|
|
6516
6527
|
forceRender: false,
|
|
@@ -8363,16 +8374,17 @@ function createUseGesture(actions) {
|
|
|
8363
8374
|
};
|
|
8364
8375
|
}
|
|
8365
8376
|
const classPrefix$1o = `adm-popup`;
|
|
8366
|
-
const defaultProps$
|
|
8377
|
+
const defaultProps$13 = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
8367
8378
|
closeOnSwipe: false,
|
|
8368
8379
|
position: "bottom"
|
|
8369
8380
|
});
|
|
8370
8381
|
const Popup = (p) => {
|
|
8371
|
-
const props = mergeProps(defaultProps$14, p);
|
|
8372
|
-
const bodyCls = classNames(`${classPrefix$1o}-body`, props.bodyClassName, `${classPrefix$1o}-body-position-${props.position}`);
|
|
8373
8382
|
const {
|
|
8374
|
-
locale
|
|
8383
|
+
locale,
|
|
8384
|
+
popup: componentConfig = {}
|
|
8375
8385
|
} = useConfig();
|
|
8386
|
+
const props = mergeProps(defaultProps$13, componentConfig, p);
|
|
8387
|
+
const bodyCls = classNames(`${classPrefix$1o}-body`, props.bodyClassName, `${classPrefix$1o}-body-position-${props.position}`);
|
|
8376
8388
|
const [active, setActive] = React$1.useState(props.visible);
|
|
8377
8389
|
const ref = React$1.useRef(null);
|
|
8378
8390
|
useLockScroll(ref, props.disableBodyScroll && active ? "strict" : false);
|
|
@@ -8469,7 +8481,7 @@ const Popup = (p) => {
|
|
|
8469
8481
|
},
|
|
8470
8482
|
role: "button",
|
|
8471
8483
|
"aria-label": locale.common.close
|
|
8472
|
-
},
|
|
8484
|
+
}, props.closeIcon), props.children))));
|
|
8473
8485
|
return React$1.createElement(ShouldRender, {
|
|
8474
8486
|
active,
|
|
8475
8487
|
forceRender: props.forceRender,
|
|
@@ -8612,7 +8624,7 @@ function renderImperatively(element) {
|
|
|
8612
8624
|
};
|
|
8613
8625
|
}
|
|
8614
8626
|
const classPrefix$1m = `adm-action-sheet`;
|
|
8615
|
-
const defaultProps$
|
|
8627
|
+
const defaultProps$12 = {
|
|
8616
8628
|
visible: false,
|
|
8617
8629
|
actions: [],
|
|
8618
8630
|
cancelText: "",
|
|
@@ -8623,7 +8635,7 @@ const defaultProps$13 = {
|
|
|
8623
8635
|
forceRender: false
|
|
8624
8636
|
};
|
|
8625
8637
|
const ActionSheet = (p) => {
|
|
8626
|
-
const props = mergeProps(defaultProps$
|
|
8638
|
+
const props = mergeProps(defaultProps$12, p);
|
|
8627
8639
|
const {
|
|
8628
8640
|
styles
|
|
8629
8641
|
} = props;
|
|
@@ -8796,7 +8808,7 @@ const BrokenImageIcon = () => React$1.createElement("svg", {
|
|
|
8796
8808
|
fillRule: "nonzero"
|
|
8797
8809
|
}));
|
|
8798
8810
|
const classPrefix$1k = `adm-image`;
|
|
8799
|
-
const defaultProps$
|
|
8811
|
+
const defaultProps$11 = {
|
|
8800
8812
|
fit: "fill",
|
|
8801
8813
|
placeholder: React$1.createElement("div", {
|
|
8802
8814
|
className: `${classPrefix$1k}-tip`
|
|
@@ -8808,7 +8820,7 @@ const defaultProps$12 = {
|
|
|
8808
8820
|
draggable: false
|
|
8809
8821
|
};
|
|
8810
8822
|
const Image$1 = staged_1((p) => {
|
|
8811
|
-
const props = mergeProps(defaultProps$
|
|
8823
|
+
const props = mergeProps(defaultProps$11, p);
|
|
8812
8824
|
const [loaded, setLoaded] = React$1.useState(false);
|
|
8813
8825
|
const [failed, setFailed] = React$1.useState(false);
|
|
8814
8826
|
const ref = React$1.useRef(null);
|
|
@@ -8885,12 +8897,12 @@ const Image$1 = staged_1((p) => {
|
|
|
8885
8897
|
}), renderInner()));
|
|
8886
8898
|
});
|
|
8887
8899
|
const classPrefix$1j = "adm-avatar";
|
|
8888
|
-
const defaultProps$
|
|
8900
|
+
const defaultProps$10 = {
|
|
8889
8901
|
fallback: React$1.createElement(Fallback, null),
|
|
8890
8902
|
fit: "cover"
|
|
8891
8903
|
};
|
|
8892
8904
|
const Avatar = (p) => {
|
|
8893
|
-
const props = mergeProps(defaultProps$
|
|
8905
|
+
const props = mergeProps(defaultProps$10, p);
|
|
8894
8906
|
return withNativeProps(props, React$1.createElement(Image$1, {
|
|
8895
8907
|
className: classPrefix$1j,
|
|
8896
8908
|
src: props.src,
|
|
@@ -8940,12 +8952,12 @@ const colorRecord$3 = {
|
|
|
8940
8952
|
primary: "var(--adm-color-primary)",
|
|
8941
8953
|
white: "var(--adm-color-white)"
|
|
8942
8954
|
};
|
|
8943
|
-
const defaultProps
|
|
8955
|
+
const defaultProps$$ = {
|
|
8944
8956
|
color: "default"
|
|
8945
8957
|
};
|
|
8946
8958
|
const DotLoading = React$1.memo((p) => {
|
|
8947
8959
|
var _a;
|
|
8948
|
-
const props = mergeProps(defaultProps
|
|
8960
|
+
const props = mergeProps(defaultProps$$, p);
|
|
8949
8961
|
return withNativeProps(props, React$1.createElement("div", {
|
|
8950
8962
|
style: {
|
|
8951
8963
|
color: (_a = colorRecord$3[props.color]) !== null && _a !== void 0 ? _a : props.color
|
|
@@ -8994,7 +9006,7 @@ function isIOS() {
|
|
|
8994
9006
|
return canUseDom$1 ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
|
8995
9007
|
}
|
|
8996
9008
|
const classPrefix$1g = `adm-button`;
|
|
8997
|
-
const defaultProps
|
|
9009
|
+
const defaultProps$_ = {
|
|
8998
9010
|
color: "default",
|
|
8999
9011
|
fill: "solid",
|
|
9000
9012
|
block: false,
|
|
@@ -9007,7 +9019,7 @@ const defaultProps$$ = {
|
|
|
9007
9019
|
size: "middle"
|
|
9008
9020
|
};
|
|
9009
9021
|
const Button = React$1.forwardRef((p, ref) => {
|
|
9010
|
-
const props = mergeProps(defaultProps
|
|
9022
|
+
const props = mergeProps(defaultProps$_, p);
|
|
9011
9023
|
const [innerLoading, setInnerLoading] = React$1.useState(false);
|
|
9012
9024
|
const nativeButtonRef = React$1.useRef(null);
|
|
9013
9025
|
const loading = props.loading === "auto" ? innerLoading : props.loading;
|
|
@@ -9190,7 +9202,7 @@ function convertPageToDayjs$1(page) {
|
|
|
9190
9202
|
}
|
|
9191
9203
|
dayjs.extend(isoWeek);
|
|
9192
9204
|
const classPrefix$1f = "adm-calendar";
|
|
9193
|
-
const defaultProps$
|
|
9205
|
+
const defaultProps$Z = {
|
|
9194
9206
|
weekStartsOn: "Sunday",
|
|
9195
9207
|
defaultValue: null,
|
|
9196
9208
|
allowClear: true,
|
|
@@ -9201,7 +9213,7 @@ const defaultProps$_ = {
|
|
|
9201
9213
|
};
|
|
9202
9214
|
const Calendar = React$1.forwardRef((p, ref) => {
|
|
9203
9215
|
const today = dayjs();
|
|
9204
|
-
const props = mergeProps(defaultProps$
|
|
9216
|
+
const props = mergeProps(defaultProps$Z, p);
|
|
9205
9217
|
const {
|
|
9206
9218
|
locale
|
|
9207
9219
|
} = useConfig();
|
|
@@ -9399,19 +9411,6 @@ const Calendar = React$1.forwardRef((p, ref) => {
|
|
|
9399
9411
|
className: classPrefix$1f
|
|
9400
9412
|
}, header, mark, body));
|
|
9401
9413
|
});
|
|
9402
|
-
const classPrefix$1e = `adm-divider`;
|
|
9403
|
-
const defaultProps$Z = {
|
|
9404
|
-
contentPosition: "center",
|
|
9405
|
-
direction: "horizontal"
|
|
9406
|
-
};
|
|
9407
|
-
const Divider = (p) => {
|
|
9408
|
-
const props = mergeProps(defaultProps$Z, p);
|
|
9409
|
-
return withNativeProps(props, React$1.createElement("div", {
|
|
9410
|
-
className: classNames(classPrefix$1e, `${classPrefix$1e}-${props.direction}`, `${classPrefix$1e}-${props.contentPosition}`)
|
|
9411
|
-
}, props.children && React$1.createElement("div", {
|
|
9412
|
-
className: `${classPrefix$1e}-content`
|
|
9413
|
-
}, props.children)));
|
|
9414
|
-
};
|
|
9415
9414
|
var isSameOrBefore$1 = { exports: {} };
|
|
9416
9415
|
(function(module2, exports2) {
|
|
9417
9416
|
!function(e2, i2) {
|
|
@@ -9437,440 +9436,157 @@ function convertValueToRange(selectionMode, value) {
|
|
|
9437
9436
|
function convertPageToDayjs(page) {
|
|
9438
9437
|
return dayjs().year(page.year).month(page.month - 1).date(1);
|
|
9439
9438
|
}
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
usePopup: true,
|
|
9448
|
-
selectionMode: "single"
|
|
9449
|
-
};
|
|
9450
|
-
const CalendarPickerView = React$1.forwardRef((p, ref) => {
|
|
9451
|
-
var _a;
|
|
9452
|
-
const today = dayjs();
|
|
9453
|
-
const props = mergeProps(defaultProps$Y, p);
|
|
9454
|
-
const {
|
|
9455
|
-
locale
|
|
9456
|
-
} = useConfig();
|
|
9457
|
-
const markItems = [...locale.Calendar.markItems];
|
|
9458
|
-
if (props.weekStartsOn === "Sunday") {
|
|
9459
|
-
const item = markItems.pop();
|
|
9460
|
-
if (item)
|
|
9461
|
-
markItems.unshift(item);
|
|
9462
|
-
}
|
|
9463
|
-
const [dateRange, setDateRange] = usePropsValue({
|
|
9464
|
-
value: props.value === void 0 ? void 0 : convertValueToRange(props.selectionMode, props.value),
|
|
9465
|
-
defaultValue: convertValueToRange(props.selectionMode, props.defaultValue),
|
|
9466
|
-
onChange: (v) => {
|
|
9467
|
-
var _a2, _b;
|
|
9468
|
-
if (props.selectionMode === "single") {
|
|
9469
|
-
(_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, v ? v[0] : null);
|
|
9470
|
-
} else if (props.selectionMode === "range") {
|
|
9471
|
-
(_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, v);
|
|
9472
|
-
}
|
|
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];
|
|
9473
9446
|
}
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
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;
|
|
9487
9476
|
}
|
|
9488
|
-
setCurrent(convertPageToDayjs(page));
|
|
9489
|
-
},
|
|
9490
|
-
jumpToToday: () => {
|
|
9491
|
-
setCurrent(dayjs().date(1));
|
|
9492
|
-
},
|
|
9493
|
-
getDateRange: () => dateRange
|
|
9494
|
-
}));
|
|
9495
|
-
const header = React$1.createElement("div", {
|
|
9496
|
-
className: `${classPrefix$1d}-header`
|
|
9497
|
-
}, React$1.createElement("div", {
|
|
9498
|
-
className: `${classPrefix$1d}-title`
|
|
9499
|
-
}, (_a = props.title) !== null && _a !== void 0 ? _a : locale.Calendar.title));
|
|
9500
|
-
const maxDay = React$1.useMemo(() => props.max ? dayjs(props.max) : current.add(6, "month"), [props.max, current]);
|
|
9501
|
-
const minDay = React$1.useMemo(() => props.min ? dayjs(props.min) : current, [props.min, current]);
|
|
9502
|
-
function renderBody() {
|
|
9503
|
-
var _a2;
|
|
9504
|
-
const cells = [];
|
|
9505
|
-
let monthIterator = minDay;
|
|
9506
|
-
while (monthIterator.isSameOrBefore(maxDay, "month")) {
|
|
9507
|
-
const year = monthIterator.year();
|
|
9508
|
-
const month = monthIterator.month();
|
|
9509
|
-
const renderMap = {
|
|
9510
|
-
year,
|
|
9511
|
-
month: month + 1
|
|
9512
|
-
};
|
|
9513
|
-
cells.push(React$1.createElement("div", {
|
|
9514
|
-
key: `${year}-${month}`
|
|
9515
|
-
}, React$1.createElement("div", {
|
|
9516
|
-
className: `${classPrefix$1d}-title`
|
|
9517
|
-
}, (_a2 = locale.Calendar.yearAndMonth) === null || _a2 === void 0 ? void 0 : _a2.replace(/\${(.*?)}/g, (_, variable) => {
|
|
9518
|
-
var _a3;
|
|
9519
|
-
return (_a3 = renderMap[variable]) === null || _a3 === void 0 ? void 0 : _a3.toString();
|
|
9520
|
-
})), React$1.createElement("div", {
|
|
9521
|
-
className: `${classPrefix$1d}-cells`
|
|
9522
|
-
}, Array(props.weekStartsOn === "Monday" ? monthIterator.date(1).isoWeekday() - 1 : monthIterator.date(1).isoWeekday()).fill(null).map((_, index2) => React$1.createElement("div", {
|
|
9523
|
-
key: index2,
|
|
9524
|
-
className: `${classPrefix$1d}-cell`
|
|
9525
|
-
})), Array(monthIterator.daysInMonth()).fill(null).map((_, index2) => {
|
|
9526
|
-
var _a3;
|
|
9527
|
-
const d = monthIterator.date(index2 + 1);
|
|
9528
|
-
let isSelect = false;
|
|
9529
|
-
let isBegin = false;
|
|
9530
|
-
let isEnd = false;
|
|
9531
|
-
let isSelectRowBegin = false;
|
|
9532
|
-
let isSelectRowEnd = false;
|
|
9533
|
-
if (dateRange) {
|
|
9534
|
-
const [begin, end] = dateRange;
|
|
9535
|
-
isBegin = d.isSame(begin, "day");
|
|
9536
|
-
isEnd = d.isSame(end, "day");
|
|
9537
|
-
isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
|
|
9538
|
-
if (isSelect) {
|
|
9539
|
-
isSelectRowBegin = (cells.length % 7 === 0 || d.isSame(d.startOf("month"), "day")) && !isBegin;
|
|
9540
|
-
isSelectRowEnd = (cells.length % 7 === 6 || d.isSame(d.endOf("month"), "day")) && !isEnd;
|
|
9541
|
-
}
|
|
9542
|
-
}
|
|
9543
|
-
const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
|
|
9544
|
-
const renderTop = () => {
|
|
9545
|
-
var _a4;
|
|
9546
|
-
const top = (_a4 = props.renderTop) === null || _a4 === void 0 ? void 0 : _a4.call(props, d.toDate());
|
|
9547
|
-
if (top) {
|
|
9548
|
-
return top;
|
|
9549
|
-
}
|
|
9550
|
-
if (props.selectionMode === "range") {
|
|
9551
|
-
if (isBegin) {
|
|
9552
|
-
return locale.Calendar.start;
|
|
9553
|
-
}
|
|
9554
|
-
if (isEnd) {
|
|
9555
|
-
return locale.Calendar.end;
|
|
9556
|
-
}
|
|
9557
|
-
}
|
|
9558
|
-
if (d.isSame(today, "day") && !isSelect) {
|
|
9559
|
-
return locale.Calendar.today;
|
|
9560
|
-
}
|
|
9561
|
-
};
|
|
9562
|
-
return React$1.createElement("div", {
|
|
9563
|
-
key: d.valueOf(),
|
|
9564
|
-
className: classNames(`${classPrefix$1d}-cell`, {
|
|
9565
|
-
[`${classPrefix$1d}-cell-today`]: d.isSame(today, "day"),
|
|
9566
|
-
[`${classPrefix$1d}-cell-selected`]: isSelect,
|
|
9567
|
-
[`${classPrefix$1d}-cell-selected-begin`]: isBegin,
|
|
9568
|
-
[`${classPrefix$1d}-cell-selected-end`]: isEnd,
|
|
9569
|
-
[`${classPrefix$1d}-cell-selected-row-begin`]: isSelectRowBegin,
|
|
9570
|
-
[`${classPrefix$1d}-cell-selected-row-end`]: isSelectRowEnd,
|
|
9571
|
-
[`${classPrefix$1d}-cell-disabled`]: !!disabled
|
|
9572
|
-
}),
|
|
9573
|
-
onClick: () => {
|
|
9574
|
-
if (!props.selectionMode)
|
|
9575
|
-
return;
|
|
9576
|
-
if (disabled)
|
|
9577
|
-
return;
|
|
9578
|
-
const date4 = d.toDate();
|
|
9579
|
-
function shouldClear() {
|
|
9580
|
-
if (!props.allowClear)
|
|
9581
|
-
return false;
|
|
9582
|
-
if (!dateRange)
|
|
9583
|
-
return false;
|
|
9584
|
-
const [begin, end] = dateRange;
|
|
9585
|
-
return d.isSame(begin, "date") && d.isSame(end, "day");
|
|
9586
|
-
}
|
|
9587
|
-
if (props.selectionMode === "single") {
|
|
9588
|
-
if (props.allowClear && shouldClear()) {
|
|
9589
|
-
setDateRange(null);
|
|
9590
|
-
return;
|
|
9591
|
-
}
|
|
9592
|
-
setDateRange([date4, date4]);
|
|
9593
|
-
} else if (props.selectionMode === "range") {
|
|
9594
|
-
if (!dateRange) {
|
|
9595
|
-
setDateRange([date4, date4]);
|
|
9596
|
-
setIntermediate(true);
|
|
9597
|
-
return;
|
|
9598
|
-
}
|
|
9599
|
-
if (shouldClear()) {
|
|
9600
|
-
setDateRange(null);
|
|
9601
|
-
setIntermediate(false);
|
|
9602
|
-
return;
|
|
9603
|
-
}
|
|
9604
|
-
if (intermediate) {
|
|
9605
|
-
const another = dateRange[0];
|
|
9606
|
-
setDateRange(another > date4 ? [date4, another] : [another, date4]);
|
|
9607
|
-
setIntermediate(false);
|
|
9608
|
-
} else {
|
|
9609
|
-
setDateRange([date4, date4]);
|
|
9610
|
-
setIntermediate(true);
|
|
9611
|
-
}
|
|
9612
|
-
}
|
|
9613
|
-
}
|
|
9614
|
-
}, React$1.createElement("div", {
|
|
9615
|
-
className: `${classPrefix$1d}-cell-top`
|
|
9616
|
-
}, renderTop()), React$1.createElement("div", {
|
|
9617
|
-
className: `${classPrefix$1d}-cell-date`
|
|
9618
|
-
}, props.renderDate ? props.renderDate(d.toDate()) : d.date()), React$1.createElement("div", {
|
|
9619
|
-
className: `${classPrefix$1d}-cell-bottom`
|
|
9620
|
-
}, (_a3 = props.renderBottom) === null || _a3 === void 0 ? void 0 : _a3.call(props, d.toDate())));
|
|
9621
|
-
}))));
|
|
9622
|
-
monthIterator = monthIterator.add(1, "month");
|
|
9623
9477
|
}
|
|
9624
|
-
return
|
|
9478
|
+
return a;
|
|
9625
9479
|
}
|
|
9626
|
-
const body = React$1.createElement("div", {
|
|
9627
|
-
className: `${classPrefix$1d}-body`
|
|
9628
|
-
}, renderBody());
|
|
9629
|
-
const mark = React$1.createElement("div", {
|
|
9630
|
-
className: `${classPrefix$1d}-mark`
|
|
9631
|
-
}, markItems.map((item, index2) => React$1.createElement("div", {
|
|
9632
|
-
key: index2,
|
|
9633
|
-
className: `${classPrefix$1d}-mark-cell`
|
|
9634
|
-
}, item)));
|
|
9635
|
-
return withNativeProps(props, React$1.createElement("div", {
|
|
9636
|
-
className: classPrefix$1d
|
|
9637
|
-
}, header, mark, body));
|
|
9638
|
-
});
|
|
9639
|
-
const classPrefix$1c = "adm-calendar-picker";
|
|
9640
|
-
const defaultProps$X = {
|
|
9641
|
-
weekStartsOn: "Sunday",
|
|
9642
|
-
defaultValue: null,
|
|
9643
|
-
allowClear: true,
|
|
9644
|
-
usePopup: true,
|
|
9645
|
-
selectionMode: "single"
|
|
9646
|
-
};
|
|
9647
|
-
const CalendarPicker = React$1.forwardRef((p, ref) => {
|
|
9648
|
-
const props = mergeProps(defaultProps$X, p);
|
|
9649
|
-
const {
|
|
9650
|
-
locale
|
|
9651
|
-
} = useConfig();
|
|
9652
|
-
const calendarRef = ref !== null && ref !== void 0 ? ref : React$1.useRef(null);
|
|
9653
|
-
const {
|
|
9654
|
-
visible,
|
|
9655
|
-
confirmText,
|
|
9656
|
-
popupClassName,
|
|
9657
|
-
popupStyle,
|
|
9658
|
-
popupBodyStyle,
|
|
9659
|
-
forceRender,
|
|
9660
|
-
closeOnMaskClick,
|
|
9661
|
-
onClose,
|
|
9662
|
-
onConfirm,
|
|
9663
|
-
onMaskClick,
|
|
9664
|
-
getContainer
|
|
9665
|
-
} = props, calendarViewProps = __rest(props, ["visible", "confirmText", "popupClassName", "popupStyle", "popupBodyStyle", "forceRender", "closeOnMaskClick", "onClose", "onConfirm", "onMaskClick", "getContainer"]);
|
|
9666
|
-
const footer = React$1.createElement("div", {
|
|
9667
|
-
className: `${classPrefix$1c}-footer`
|
|
9668
|
-
}, React$1.createElement(Divider, null), React$1.createElement("div", {
|
|
9669
|
-
className: `${classPrefix$1c}-footer-bottom`
|
|
9670
|
-
}, React$1.createElement(Button, {
|
|
9671
|
-
color: "primary",
|
|
9672
|
-
onClick: () => {
|
|
9673
|
-
var _a, _b, _c, _d;
|
|
9674
|
-
const dateRange = (_b = (_a = calendarRef.current) === null || _a === void 0 ? void 0 : _a.getDateRange()) !== null && _b !== void 0 ? _b : null;
|
|
9675
|
-
if (props.selectionMode === "single") {
|
|
9676
|
-
(_c = props.onConfirm) === null || _c === void 0 ? void 0 : _c.call(props, dateRange ? dateRange[0] : null);
|
|
9677
|
-
} else if (props.selectionMode === "range") {
|
|
9678
|
-
(_d = props.onConfirm) === null || _d === void 0 ? void 0 : _d.call(props, dateRange);
|
|
9679
|
-
}
|
|
9680
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
9681
|
-
}
|
|
9682
|
-
}, confirmText !== null && confirmText !== void 0 ? confirmText : locale.Calendar.confirm)));
|
|
9683
|
-
return withNativeProps(props, React$1.createElement("div", {
|
|
9684
|
-
className: classPrefix$1c
|
|
9685
|
-
}, React$1.createElement(Popup, {
|
|
9686
|
-
visible,
|
|
9687
|
-
className: classNames(`${classPrefix$1c}-popup`, popupClassName),
|
|
9688
|
-
showCloseButton: true,
|
|
9689
|
-
forceRender: ref ? true : forceRender,
|
|
9690
|
-
style: popupStyle,
|
|
9691
|
-
bodyStyle: Object.assign({
|
|
9692
|
-
borderTopLeftRadius: "8px",
|
|
9693
|
-
borderTopRightRadius: "8px",
|
|
9694
|
-
minHeight: "80vh",
|
|
9695
|
-
overflow: "auto"
|
|
9696
|
-
}, popupBodyStyle),
|
|
9697
|
-
onClose,
|
|
9698
|
-
onMaskClick: () => {
|
|
9699
|
-
onMaskClick === null || onMaskClick === void 0 ? void 0 : onMaskClick();
|
|
9700
|
-
if (closeOnMaskClick) {
|
|
9701
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
9702
|
-
}
|
|
9703
|
-
},
|
|
9704
|
-
getContainer
|
|
9705
|
-
}, React$1.createElement(CalendarPickerView, Object.assign({
|
|
9706
|
-
ref: calendarRef
|
|
9707
|
-
}, calendarViewProps)), footer)));
|
|
9708
|
-
});
|
|
9709
|
-
function useResizeEffect(effect, targetRef) {
|
|
9710
|
-
const fn = useMemoizedFn(effect);
|
|
9711
|
-
useIsomorphicLayoutEffect$2(() => {
|
|
9712
|
-
const target = targetRef.current;
|
|
9713
|
-
if (!target)
|
|
9714
|
-
return;
|
|
9715
|
-
if (window.ResizeObserver) {
|
|
9716
|
-
let animationFrame;
|
|
9717
|
-
const observer = new ResizeObserver(() => {
|
|
9718
|
-
animationFrame = window.requestAnimationFrame(() => fn(target));
|
|
9719
|
-
});
|
|
9720
|
-
observer.observe(target);
|
|
9721
|
-
return () => {
|
|
9722
|
-
window.cancelAnimationFrame(animationFrame);
|
|
9723
|
-
observer.disconnect();
|
|
9724
|
-
};
|
|
9725
|
-
} else {
|
|
9726
|
-
fn(target);
|
|
9727
|
-
}
|
|
9728
|
-
}, [targetRef]);
|
|
9729
9480
|
}
|
|
9730
|
-
function
|
|
9731
|
-
if (
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
return () => {
|
|
9737
|
-
if (observer) {
|
|
9738
|
-
observer.disconnect();
|
|
9739
|
-
observer = null;
|
|
9740
|
-
}
|
|
9741
|
-
};
|
|
9742
|
-
}
|
|
9743
|
-
return () => {
|
|
9744
|
-
};
|
|
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;
|
|
9745
9487
|
}
|
|
9746
|
-
function
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
return
|
|
9751
|
-
|
|
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);
|
|
9752
9500
|
}
|
|
9753
|
-
function
|
|
9754
|
-
|
|
9755
|
-
if (min2 !== void 0) {
|
|
9756
|
-
ret = Math.max(position, min2);
|
|
9757
|
-
}
|
|
9758
|
-
if (max2 !== void 0) {
|
|
9759
|
-
ret = Math.min(ret, max2);
|
|
9760
|
-
}
|
|
9761
|
-
return ret;
|
|
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.");
|
|
9762
9503
|
}
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
const activeTab = activeTabWrapper.children.item(0);
|
|
9781
|
-
const activeTabLeft = activeTab.offsetLeft;
|
|
9782
|
-
const activeTabWidth = activeTab.offsetWidth;
|
|
9783
|
-
const containerWidth = container.offsetWidth;
|
|
9784
|
-
const containerScrollWidth = container.scrollWidth;
|
|
9785
|
-
const containerScrollLeft = container.scrollLeft;
|
|
9786
|
-
const maxScrollDistance = containerScrollWidth - containerWidth;
|
|
9787
|
-
if (maxScrollDistance <= 0)
|
|
9788
|
-
return;
|
|
9789
|
-
const nextScrollLeft = bound(activeTabLeft - (containerWidth - activeTabWidth) / 2, 0, containerScrollWidth - containerWidth);
|
|
9790
|
-
api.start({
|
|
9791
|
-
scrollLeft: nextScrollLeft,
|
|
9792
|
-
from: {
|
|
9793
|
-
scrollLeft: containerScrollLeft
|
|
9794
|
-
},
|
|
9795
|
-
immediate: immediate && !scrollLeft.isAnimating
|
|
9796
|
-
});
|
|
9797
|
-
}
|
|
9798
|
-
useIsomorphicLayoutEffect$2(() => {
|
|
9799
|
-
animate(true);
|
|
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
|
+
};
|
|
9800
9521
|
}, []);
|
|
9801
|
-
useIsomorphicUpdateLayoutEffect(() => {
|
|
9802
|
-
animate();
|
|
9803
|
-
}, [activeIndex]);
|
|
9804
|
-
useMutationEffect(() => {
|
|
9805
|
-
animate(true);
|
|
9806
|
-
}, targetRef, {
|
|
9807
|
-
subtree: true,
|
|
9808
|
-
childList: true,
|
|
9809
|
-
characterData: true
|
|
9810
|
-
});
|
|
9811
|
-
return {
|
|
9812
|
-
scrollLeft,
|
|
9813
|
-
animate
|
|
9814
|
-
};
|
|
9815
9522
|
};
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
leftMaskOpacity,
|
|
9821
|
-
rightMaskOpacity
|
|
9822
|
-
}, api] = useSpring(() => ({
|
|
9823
|
-
leftMaskOpacity: 0,
|
|
9824
|
-
rightMaskOpacity: 0,
|
|
9825
|
-
config: {
|
|
9826
|
-
clamp: true
|
|
9523
|
+
var useLayoutUpdateEffect = function useLayoutUpdateEffect2(callback, deps) {
|
|
9524
|
+
useLayoutEffect(function(firstMount) {
|
|
9525
|
+
if (!firstMount) {
|
|
9526
|
+
return callback();
|
|
9827
9527
|
}
|
|
9828
|
-
})
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
const scrollLeft = scrollEl.scrollLeft;
|
|
9839
|
-
const showLeftMask = scrollLeft > 0;
|
|
9840
|
-
const showRightMask = scrollLeft + scrollEl.offsetWidth < scrollEl.scrollWidth;
|
|
9841
|
-
api.start({
|
|
9842
|
-
leftMaskOpacity: showLeftMask ? 1 : 0,
|
|
9843
|
-
rightMaskOpacity: showRightMask ? 1 : 0,
|
|
9844
|
-
immediate
|
|
9845
|
-
});
|
|
9846
|
-
}, {
|
|
9847
|
-
wait: 100,
|
|
9848
|
-
trailing: true,
|
|
9849
|
-
leading: true
|
|
9850
|
-
});
|
|
9851
|
-
React$1.useEffect(() => {
|
|
9852
|
-
updateMask(true);
|
|
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
|
+
};
|
|
9853
9538
|
}, []);
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
if (!scrollEl)
|
|
9539
|
+
function safeSetState(updater, ignoreDestroy) {
|
|
9540
|
+
if (ignoreDestroy && destroyRef.current) {
|
|
9857
9541
|
return;
|
|
9858
|
-
scrollEl.addEventListener("scroll", updateMask);
|
|
9859
|
-
return () => scrollEl.removeEventListener("scroll", updateMask);
|
|
9860
|
-
}, []);
|
|
9861
|
-
return React$1.createElement(React$1.Fragment, null, React$1.createElement(animated.div, {
|
|
9862
|
-
ref: maskRef,
|
|
9863
|
-
className: classNames(classPrefix$1b, `${classPrefix$1b}-left`),
|
|
9864
|
-
style: {
|
|
9865
|
-
opacity: leftMaskOpacity
|
|
9866
9542
|
}
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
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;
|
|
9871
9559
|
}
|
|
9872
|
-
}));
|
|
9873
|
-
|
|
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
|
+
}
|
|
9874
9590
|
var reactIs = { exports: {} };
|
|
9875
9591
|
var reactIs_development = {};
|
|
9876
9592
|
/**
|
|
@@ -10017,49 +9733,694 @@ var reactIs_development = {};
|
|
|
10017
9733
|
function isProfiler(object4) {
|
|
10018
9734
|
return typeOf(object4) === REACT_PROFILER_TYPE;
|
|
10019
9735
|
}
|
|
10020
|
-
function isStrictMode(object4) {
|
|
10021
|
-
return typeOf(object4) === REACT_STRICT_MODE_TYPE;
|
|
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,
|
|
10203
|
+
popupBodyStyle,
|
|
10204
|
+
forceRender,
|
|
10205
|
+
closeOnMaskClick,
|
|
10206
|
+
onClose,
|
|
10207
|
+
onConfirm,
|
|
10208
|
+
onMaskClick,
|
|
10209
|
+
getContainer
|
|
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]);
|
|
10214
|
+
const footer = React$1.createElement("div", {
|
|
10215
|
+
className: `${classPrefix$1c}-footer`
|
|
10216
|
+
}, React$1.createElement(Divider, null), React$1.createElement("div", {
|
|
10217
|
+
className: `${classPrefix$1c}-footer-bottom`
|
|
10218
|
+
}, React$1.createElement(Button, {
|
|
10219
|
+
color: "primary",
|
|
10220
|
+
onClick: () => {
|
|
10221
|
+
var _a, _b, _c, _d;
|
|
10222
|
+
const dateRange = (_b = (_a = calendarRef.current) === null || _a === void 0 ? void 0 : _a.getDateRange()) !== null && _b !== void 0 ? _b : null;
|
|
10223
|
+
if (props.selectionMode === "single") {
|
|
10224
|
+
(_c = props.onConfirm) === null || _c === void 0 ? void 0 : _c.call(props, dateRange ? dateRange[0] : null);
|
|
10225
|
+
} else if (props.selectionMode === "range") {
|
|
10226
|
+
(_d = props.onConfirm) === null || _d === void 0 ? void 0 : _d.call(props, dateRange);
|
|
10227
|
+
}
|
|
10228
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
10229
|
+
}
|
|
10230
|
+
}, confirmText !== null && confirmText !== void 0 ? confirmText : locale.Calendar.confirm)));
|
|
10231
|
+
return withNativeProps(props, React$1.createElement("div", {
|
|
10232
|
+
className: classPrefix$1c
|
|
10233
|
+
}, React$1.createElement(Popup, {
|
|
10234
|
+
visible,
|
|
10235
|
+
className: classNames(`${classPrefix$1c}-popup`, popupClassName),
|
|
10236
|
+
showCloseButton: true,
|
|
10237
|
+
forceRender: ref ? true : forceRender,
|
|
10238
|
+
style: popupStyle,
|
|
10239
|
+
bodyStyle: Object.assign({
|
|
10240
|
+
borderTopLeftRadius: "8px",
|
|
10241
|
+
borderTopRightRadius: "8px",
|
|
10242
|
+
minHeight: "80vh",
|
|
10243
|
+
overflow: "auto"
|
|
10244
|
+
}, popupBodyStyle),
|
|
10245
|
+
onClose,
|
|
10246
|
+
onMaskClick: () => {
|
|
10247
|
+
onMaskClick === null || onMaskClick === void 0 ? void 0 : onMaskClick();
|
|
10248
|
+
if (closeOnMaskClick) {
|
|
10249
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
10250
|
+
}
|
|
10251
|
+
},
|
|
10252
|
+
getContainer
|
|
10253
|
+
}, React$1.createElement(Context$2.Provider, {
|
|
10254
|
+
value: viewContext
|
|
10255
|
+
}, React$1.createElement(CalendarPickerView, Object.assign({
|
|
10256
|
+
ref: calendarRef
|
|
10257
|
+
}, calendarViewProps))), footer)));
|
|
10258
|
+
});
|
|
10259
|
+
function useResizeEffect(effect, targetRef) {
|
|
10260
|
+
const fn = useMemoizedFn(effect);
|
|
10261
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
10262
|
+
const target = targetRef.current;
|
|
10263
|
+
if (!target)
|
|
10264
|
+
return;
|
|
10265
|
+
if (window.ResizeObserver) {
|
|
10266
|
+
let animationFrame;
|
|
10267
|
+
const observer = new ResizeObserver(() => {
|
|
10268
|
+
animationFrame = window.requestAnimationFrame(() => fn(target));
|
|
10269
|
+
});
|
|
10270
|
+
observer.observe(target);
|
|
10271
|
+
return () => {
|
|
10272
|
+
window.cancelAnimationFrame(animationFrame);
|
|
10273
|
+
observer.disconnect();
|
|
10274
|
+
};
|
|
10275
|
+
} else {
|
|
10276
|
+
fn(target);
|
|
10277
|
+
}
|
|
10278
|
+
}, [targetRef]);
|
|
10279
|
+
}
|
|
10280
|
+
function observe(element, options, callback) {
|
|
10281
|
+
if (element && typeof MutationObserver !== "undefined") {
|
|
10282
|
+
let observer = new MutationObserver(() => {
|
|
10283
|
+
callback();
|
|
10284
|
+
});
|
|
10285
|
+
observer.observe(element, options);
|
|
10286
|
+
return () => {
|
|
10287
|
+
if (observer) {
|
|
10288
|
+
observer.disconnect();
|
|
10289
|
+
observer = null;
|
|
10290
|
+
}
|
|
10291
|
+
};
|
|
10292
|
+
}
|
|
10293
|
+
return () => {
|
|
10294
|
+
};
|
|
10295
|
+
}
|
|
10296
|
+
function useMutationEffect(effect, targetRef, options) {
|
|
10297
|
+
const fn = useMemoizedFn(effect);
|
|
10298
|
+
React$1.useEffect(() => {
|
|
10299
|
+
const cleanup = observe(targetRef.current, options, fn);
|
|
10300
|
+
return cleanup;
|
|
10301
|
+
}, [targetRef]);
|
|
10302
|
+
}
|
|
10303
|
+
function bound(position, min2, max2) {
|
|
10304
|
+
let ret = position;
|
|
10305
|
+
if (min2 !== void 0) {
|
|
10306
|
+
ret = Math.max(position, min2);
|
|
10307
|
+
}
|
|
10308
|
+
if (max2 !== void 0) {
|
|
10309
|
+
ret = Math.min(ret, max2);
|
|
10310
|
+
}
|
|
10311
|
+
return ret;
|
|
10312
|
+
}
|
|
10313
|
+
const useTabListScroll = (targetRef, activeIndex) => {
|
|
10314
|
+
const [{
|
|
10315
|
+
scrollLeft
|
|
10316
|
+
}, api] = useSpring(() => ({
|
|
10317
|
+
scrollLeft: 0,
|
|
10318
|
+
config: {
|
|
10319
|
+
tension: 300,
|
|
10320
|
+
clamp: true
|
|
10321
|
+
}
|
|
10322
|
+
}));
|
|
10323
|
+
function animate(immediate = false) {
|
|
10324
|
+
const container = targetRef.current;
|
|
10325
|
+
if (!container)
|
|
10326
|
+
return;
|
|
10327
|
+
if (activeIndex === void 0)
|
|
10328
|
+
return;
|
|
10329
|
+
const activeTabWrapper = container.children.item(activeIndex);
|
|
10330
|
+
const activeTab = activeTabWrapper.children.item(0);
|
|
10331
|
+
const activeTabLeft = activeTab.offsetLeft;
|
|
10332
|
+
const activeTabWidth = activeTab.offsetWidth;
|
|
10333
|
+
const containerWidth = container.offsetWidth;
|
|
10334
|
+
const containerScrollWidth = container.scrollWidth;
|
|
10335
|
+
const containerScrollLeft = container.scrollLeft;
|
|
10336
|
+
const maxScrollDistance = containerScrollWidth - containerWidth;
|
|
10337
|
+
if (maxScrollDistance <= 0)
|
|
10338
|
+
return;
|
|
10339
|
+
const nextScrollLeft = bound(activeTabLeft - (containerWidth - activeTabWidth) / 2, 0, containerScrollWidth - containerWidth);
|
|
10340
|
+
api.start({
|
|
10341
|
+
scrollLeft: nextScrollLeft,
|
|
10342
|
+
from: {
|
|
10343
|
+
scrollLeft: containerScrollLeft
|
|
10344
|
+
},
|
|
10345
|
+
immediate: immediate && !scrollLeft.isAnimating
|
|
10346
|
+
});
|
|
10347
|
+
}
|
|
10348
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
10349
|
+
animate(true);
|
|
10350
|
+
}, []);
|
|
10351
|
+
useIsomorphicUpdateLayoutEffect(() => {
|
|
10352
|
+
animate();
|
|
10353
|
+
}, [activeIndex]);
|
|
10354
|
+
useMutationEffect(() => {
|
|
10355
|
+
animate(true);
|
|
10356
|
+
}, targetRef, {
|
|
10357
|
+
subtree: true,
|
|
10358
|
+
childList: true,
|
|
10359
|
+
characterData: true
|
|
10360
|
+
});
|
|
10361
|
+
return {
|
|
10362
|
+
scrollLeft,
|
|
10363
|
+
animate
|
|
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
|
|
10022
10377
|
}
|
|
10023
|
-
|
|
10024
|
-
|
|
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
|
|
10025
10416
|
}
|
|
10026
|
-
|
|
10027
|
-
|
|
10417
|
+
}), React$1.createElement(animated.div, {
|
|
10418
|
+
className: classNames(classPrefix$1b, `${classPrefix$1b}-right`),
|
|
10419
|
+
style: {
|
|
10420
|
+
opacity: rightMaskOpacity
|
|
10028
10421
|
}
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
reactIs_development.Element = Element2;
|
|
10032
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
10033
|
-
reactIs_development.Fragment = Fragment;
|
|
10034
|
-
reactIs_development.Lazy = Lazy;
|
|
10035
|
-
reactIs_development.Memo = Memo;
|
|
10036
|
-
reactIs_development.Portal = Portal;
|
|
10037
|
-
reactIs_development.Profiler = Profiler;
|
|
10038
|
-
reactIs_development.StrictMode = StrictMode;
|
|
10039
|
-
reactIs_development.Suspense = Suspense;
|
|
10040
|
-
reactIs_development.SuspenseList = SuspenseList;
|
|
10041
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
10042
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
10043
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
10044
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
10045
|
-
reactIs_development.isElement = isElement2;
|
|
10046
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
10047
|
-
reactIs_development.isFragment = isFragment;
|
|
10048
|
-
reactIs_development.isLazy = isLazy;
|
|
10049
|
-
reactIs_development.isMemo = isMemo;
|
|
10050
|
-
reactIs_development.isPortal = isPortal;
|
|
10051
|
-
reactIs_development.isProfiler = isProfiler;
|
|
10052
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
10053
|
-
reactIs_development.isSuspense = isSuspense;
|
|
10054
|
-
reactIs_development.isSuspenseList = isSuspenseList;
|
|
10055
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
10056
|
-
reactIs_development.typeOf = typeOf;
|
|
10057
|
-
})();
|
|
10058
|
-
}
|
|
10059
|
-
{
|
|
10060
|
-
reactIs.exports = reactIs_development;
|
|
10061
|
-
}
|
|
10062
|
-
var reactIsExports = reactIs.exports;
|
|
10422
|
+
}));
|
|
10423
|
+
};
|
|
10063
10424
|
function traverseReactNode(children, fn) {
|
|
10064
10425
|
let i2 = 0;
|
|
10065
10426
|
function handle(target) {
|
|
@@ -10765,13 +11126,13 @@ const colorRecord$2 = {
|
|
|
10765
11126
|
primary: "var(--adm-color-primary)",
|
|
10766
11127
|
white: "var(--adm-color-white)"
|
|
10767
11128
|
};
|
|
10768
|
-
const defaultProps$
|
|
11129
|
+
const defaultProps$V = {
|
|
10769
11130
|
color: "default"
|
|
10770
11131
|
};
|
|
10771
11132
|
const circumference = 15 * 3.14159265358979 * 2;
|
|
10772
11133
|
const SpinLoading = React$1.memo((p) => {
|
|
10773
11134
|
var _a;
|
|
10774
|
-
const props = mergeProps(defaultProps$
|
|
11135
|
+
const props = mergeProps(defaultProps$V, p);
|
|
10775
11136
|
const motionReduced = useMotionReduced();
|
|
10776
11137
|
const {
|
|
10777
11138
|
percent
|
|
@@ -10812,7 +11173,7 @@ const SpinLoading = React$1.memo((p) => {
|
|
|
10812
11173
|
}))));
|
|
10813
11174
|
});
|
|
10814
11175
|
const classPrefix$16 = `adm-picker-view`;
|
|
10815
|
-
const defaultProps$
|
|
11176
|
+
const defaultProps$U = {
|
|
10816
11177
|
defaultValue: [],
|
|
10817
11178
|
renderLabel: defaultRenderLabel,
|
|
10818
11179
|
mouseWheel: false,
|
|
@@ -10821,7 +11182,7 @@ const defaultProps$V = {
|
|
|
10821
11182
|
}, React$1.createElement(SpinLoading, null))
|
|
10822
11183
|
};
|
|
10823
11184
|
const PickerView = React$1.memo((p) => {
|
|
10824
|
-
const props = mergeProps(defaultProps$
|
|
11185
|
+
const props = mergeProps(defaultProps$U, p);
|
|
10825
11186
|
const [innerValue, setInnerValue] = React$1.useState(props.value === void 0 ? props.defaultValue : props.value);
|
|
10826
11187
|
React$1.useEffect(() => {
|
|
10827
11188
|
if (props.value === void 0)
|
|
@@ -10883,7 +11244,7 @@ const PickerView = React$1.memo((p) => {
|
|
|
10883
11244
|
});
|
|
10884
11245
|
PickerView.displayName = "PickerView";
|
|
10885
11246
|
const classPrefix$15 = `adm-picker`;
|
|
10886
|
-
const defaultProps$
|
|
11247
|
+
const defaultProps$T = {
|
|
10887
11248
|
defaultValue: [],
|
|
10888
11249
|
closeOnMaskClick: true,
|
|
10889
11250
|
renderLabel: defaultRenderLabel,
|
|
@@ -10895,7 +11256,7 @@ const Picker$1 = React$1.memo(React$1.forwardRef((p, ref) => {
|
|
|
10895
11256
|
const {
|
|
10896
11257
|
locale
|
|
10897
11258
|
} = useConfig();
|
|
10898
|
-
const props = mergeProps(defaultProps$
|
|
11259
|
+
const props = mergeProps(defaultProps$T, {
|
|
10899
11260
|
confirmText: locale.common.confirm,
|
|
10900
11261
|
cancelText: locale.common.cancel
|
|
10901
11262
|
}, p);
|
|
@@ -11135,14 +11496,14 @@ const classPrefix$14 = `adm-tabs`;
|
|
|
11135
11496
|
const Tab = () => {
|
|
11136
11497
|
return null;
|
|
11137
11498
|
};
|
|
11138
|
-
const defaultProps$
|
|
11499
|
+
const defaultProps$S = {
|
|
11139
11500
|
activeLineMode: "auto",
|
|
11140
11501
|
stretch: true,
|
|
11141
11502
|
direction: "ltr"
|
|
11142
11503
|
};
|
|
11143
11504
|
const Tabs$1 = (p) => {
|
|
11144
11505
|
var _a;
|
|
11145
|
-
const props = mergeProps(defaultProps$
|
|
11506
|
+
const props = mergeProps(defaultProps$S, p);
|
|
11146
11507
|
const tabListContainerRef = React$1.useRef(null);
|
|
11147
11508
|
const activeLineRef = React$1.useRef(null);
|
|
11148
11509
|
const keyToIndexRecord = {};
|
|
@@ -11386,11 +11747,11 @@ const Tabs = attachPropertiesToComponent(Tabs$1, {
|
|
|
11386
11747
|
Tab
|
|
11387
11748
|
});
|
|
11388
11749
|
const classPrefix$13 = `adm-list`;
|
|
11389
|
-
const defaultProps$
|
|
11750
|
+
const defaultProps$R = {
|
|
11390
11751
|
mode: "default"
|
|
11391
11752
|
};
|
|
11392
11753
|
const List$2 = React$1.forwardRef((p, ref) => {
|
|
11393
|
-
const props = mergeProps(defaultProps$
|
|
11754
|
+
const props = mergeProps(defaultProps$R, p);
|
|
11394
11755
|
const nativeElementRef = React$1.useRef(null);
|
|
11395
11756
|
React$1.useImperativeHandle(ref, () => ({
|
|
11396
11757
|
get nativeElement() {
|
|
@@ -11413,9 +11774,17 @@ function isNodeWithContent(node) {
|
|
|
11413
11774
|
}
|
|
11414
11775
|
const classPrefix$12 = `adm-list-item`;
|
|
11415
11776
|
const ListItem = (props) => {
|
|
11416
|
-
var _a;
|
|
11777
|
+
var _a, _b;
|
|
11778
|
+
const {
|
|
11779
|
+
arrow: arrow2,
|
|
11780
|
+
arrowIcon
|
|
11781
|
+
} = props;
|
|
11782
|
+
const {
|
|
11783
|
+
list: componentConfig = {}
|
|
11784
|
+
} = useConfig();
|
|
11417
11785
|
const clickable = (_a = props.clickable) !== null && _a !== void 0 ? _a : !!props.onClick;
|
|
11418
|
-
const
|
|
11786
|
+
const showArrow = (_b = arrow2 !== null && arrow2 !== void 0 ? arrow2 : arrowIcon) !== null && _b !== void 0 ? _b : clickable;
|
|
11787
|
+
const mergedArrowIcon = mergeProp(componentConfig.arrowIcon, arrow2 !== true ? arrow2 : null, arrowIcon !== true ? arrowIcon : null);
|
|
11419
11788
|
const content = React$1.createElement("div", {
|
|
11420
11789
|
className: `${classPrefix$12}-content`
|
|
11421
11790
|
}, isNodeWithContent(props.prefix) && React$1.createElement("div", {
|
|
@@ -11428,9 +11797,9 @@ const ListItem = (props) => {
|
|
|
11428
11797
|
className: `${classPrefix$12}-description`
|
|
11429
11798
|
}, props.description)), isNodeWithContent(props.extra) && React$1.createElement("div", {
|
|
11430
11799
|
className: `${classPrefix$12}-content-extra`
|
|
11431
|
-
}, props.extra),
|
|
11800
|
+
}, props.extra), showArrow && React$1.createElement("div", {
|
|
11432
11801
|
className: `${classPrefix$12}-content-arrow`
|
|
11433
|
-
},
|
|
11802
|
+
}, mergedArrowIcon || React$1.createElement(RightOutline, null)));
|
|
11434
11803
|
return withNativeProps(props, React$1.createElement(clickable ? "a" : "div", {
|
|
11435
11804
|
className: classNames(`${classPrefix$12}`, clickable ? ["adm-plain-anchor"] : [], props.disabled && `${classPrefix$12}-disabled`),
|
|
11436
11805
|
onClick: props.disabled ? void 0 : props.onClick
|
|
@@ -11441,16 +11810,19 @@ const List$1 = attachPropertiesToComponent(List$2, {
|
|
|
11441
11810
|
});
|
|
11442
11811
|
const CheckListContext = React$1.createContext(null);
|
|
11443
11812
|
const classPrefix$11 = "adm-check-list";
|
|
11444
|
-
const defaultProps$
|
|
11813
|
+
const defaultProps$Q = {
|
|
11445
11814
|
multiple: false,
|
|
11446
11815
|
defaultValue: [],
|
|
11447
11816
|
activeIcon: React$1.createElement(CheckOutline, null)
|
|
11448
11817
|
};
|
|
11449
|
-
const CheckList$1 = (
|
|
11450
|
-
const
|
|
11451
|
-
|
|
11818
|
+
const CheckList$1 = (props) => {
|
|
11819
|
+
const {
|
|
11820
|
+
checkList: componentConfig = {}
|
|
11821
|
+
} = useConfig();
|
|
11822
|
+
const mergedProps = mergeProps(defaultProps$Q, componentConfig, props);
|
|
11823
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
11452
11824
|
function check(val) {
|
|
11453
|
-
if (
|
|
11825
|
+
if (mergedProps.multiple) {
|
|
11454
11826
|
setValue2([...value, val]);
|
|
11455
11827
|
} else {
|
|
11456
11828
|
setValue2([val]);
|
|
@@ -11464,7 +11836,7 @@ const CheckList$1 = (p) => {
|
|
|
11464
11836
|
extra,
|
|
11465
11837
|
disabled,
|
|
11466
11838
|
readOnly
|
|
11467
|
-
} =
|
|
11839
|
+
} = mergedProps;
|
|
11468
11840
|
return React$1.createElement(CheckListContext.Provider, {
|
|
11469
11841
|
value: {
|
|
11470
11842
|
value,
|
|
@@ -11475,10 +11847,10 @@ const CheckList$1 = (p) => {
|
|
|
11475
11847
|
disabled,
|
|
11476
11848
|
readOnly
|
|
11477
11849
|
}
|
|
11478
|
-
}, withNativeProps(
|
|
11479
|
-
mode:
|
|
11850
|
+
}, withNativeProps(mergedProps, React$1.createElement(List$1, {
|
|
11851
|
+
mode: mergedProps.mode,
|
|
11480
11852
|
className: classPrefix$11
|
|
11481
|
-
},
|
|
11853
|
+
}, mergedProps.children)));
|
|
11482
11854
|
};
|
|
11483
11855
|
const classPrefix$10 = `adm-check-list-item`;
|
|
11484
11856
|
const CheckListItem = (props) => {
|
|
@@ -11689,11 +12061,11 @@ const useFieldNames = (fieldNames = {}) => {
|
|
|
11689
12061
|
return fields;
|
|
11690
12062
|
};
|
|
11691
12063
|
const classPrefix$_ = `adm-cascader-view`;
|
|
11692
|
-
const defaultProps$
|
|
12064
|
+
const defaultProps$P = {
|
|
11693
12065
|
defaultValue: []
|
|
11694
12066
|
};
|
|
11695
12067
|
const CascaderView$1 = (p) => {
|
|
11696
|
-
const props = mergeProps(defaultProps$
|
|
12068
|
+
const props = mergeProps(defaultProps$P, p);
|
|
11697
12069
|
const {
|
|
11698
12070
|
locale
|
|
11699
12071
|
} = useConfig();
|
|
@@ -11810,7 +12182,7 @@ const CascaderView = attachPropertiesToComponent(CascaderView$1, {
|
|
|
11810
12182
|
optionSkeleton
|
|
11811
12183
|
});
|
|
11812
12184
|
const classPrefix$Z = `adm-cascader`;
|
|
11813
|
-
const defaultProps$
|
|
12185
|
+
const defaultProps$O = {
|
|
11814
12186
|
defaultValue: [],
|
|
11815
12187
|
destroyOnClose: true,
|
|
11816
12188
|
forceRender: false
|
|
@@ -11820,7 +12192,7 @@ const Cascader = React$1.forwardRef((p, ref) => {
|
|
|
11820
12192
|
const {
|
|
11821
12193
|
locale
|
|
11822
12194
|
} = useConfig();
|
|
11823
|
-
const props = mergeProps(defaultProps$
|
|
12195
|
+
const props = mergeProps(defaultProps$O, {
|
|
11824
12196
|
confirmText: locale.common.confirm,
|
|
11825
12197
|
cancelText: locale.common.cancel,
|
|
11826
12198
|
placeholder: locale.Cascader.placeholder
|
|
@@ -11948,15 +12320,18 @@ const index$f = attachPropertiesToComponent(Cascader, {
|
|
|
11948
12320
|
optionSkeleton
|
|
11949
12321
|
});
|
|
11950
12322
|
const classPrefix$Y = "adm-center-popup";
|
|
11951
|
-
const defaultProps$
|
|
12323
|
+
const defaultProps$N = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
11952
12324
|
getContainer: null
|
|
11953
12325
|
});
|
|
11954
|
-
const CenterPopup = (
|
|
11955
|
-
const
|
|
12326
|
+
const CenterPopup = (props) => {
|
|
12327
|
+
const {
|
|
12328
|
+
popup: componentConfig = {}
|
|
12329
|
+
} = useConfig();
|
|
12330
|
+
const mergedProps = mergeProps(defaultProps$N, componentConfig, props);
|
|
11956
12331
|
const unmountedRef = useUnmountedRef$1();
|
|
11957
12332
|
const style = useSpring({
|
|
11958
|
-
scale:
|
|
11959
|
-
opacity:
|
|
12333
|
+
scale: mergedProps.visible ? 1 : 0.8,
|
|
12334
|
+
opacity: mergedProps.visible ? 1 : 0,
|
|
11960
12335
|
config: {
|
|
11961
12336
|
mass: 1.2,
|
|
11962
12337
|
tension: 200,
|
|
@@ -11967,77 +12342,77 @@ const CenterPopup = (p) => {
|
|
|
11967
12342
|
var _a, _b;
|
|
11968
12343
|
if (unmountedRef.current)
|
|
11969
12344
|
return;
|
|
11970
|
-
setActive(
|
|
11971
|
-
if (
|
|
11972
|
-
(_a =
|
|
12345
|
+
setActive(mergedProps.visible);
|
|
12346
|
+
if (mergedProps.visible) {
|
|
12347
|
+
(_a = mergedProps.afterShow) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
11973
12348
|
} else {
|
|
11974
|
-
(_b =
|
|
12349
|
+
(_b = mergedProps.afterClose) === null || _b === void 0 ? void 0 : _b.call(mergedProps);
|
|
11975
12350
|
}
|
|
11976
12351
|
}
|
|
11977
12352
|
});
|
|
11978
|
-
const [active, setActive] = React$1.useState(
|
|
12353
|
+
const [active, setActive] = React$1.useState(mergedProps.visible);
|
|
11979
12354
|
useIsomorphicLayoutEffect$2(() => {
|
|
11980
|
-
if (
|
|
12355
|
+
if (mergedProps.visible) {
|
|
11981
12356
|
setActive(true);
|
|
11982
12357
|
}
|
|
11983
|
-
}, [
|
|
12358
|
+
}, [mergedProps.visible]);
|
|
11984
12359
|
const ref = React$1.useRef(null);
|
|
11985
|
-
useLockScroll(ref,
|
|
11986
|
-
const maskVisible = useInnerVisible(active &&
|
|
12360
|
+
useLockScroll(ref, mergedProps.disableBodyScroll && active);
|
|
12361
|
+
const maskVisible = useInnerVisible(active && mergedProps.visible);
|
|
11987
12362
|
const body = React$1.createElement("div", {
|
|
11988
|
-
className: classNames(`${classPrefix$Y}-body`,
|
|
11989
|
-
style:
|
|
11990
|
-
},
|
|
11991
|
-
const node = withStopPropagation(
|
|
12363
|
+
className: classNames(`${classPrefix$Y}-body`, mergedProps.bodyClassName),
|
|
12364
|
+
style: mergedProps.bodyStyle
|
|
12365
|
+
}, mergedProps.children);
|
|
12366
|
+
const node = withStopPropagation(mergedProps.stopPropagation, withNativeProps(mergedProps, React$1.createElement("div", {
|
|
11992
12367
|
className: classPrefix$Y,
|
|
11993
12368
|
style: {
|
|
11994
12369
|
display: active ? void 0 : "none",
|
|
11995
12370
|
pointerEvents: active ? void 0 : "none"
|
|
11996
12371
|
}
|
|
11997
|
-
},
|
|
12372
|
+
}, mergedProps.mask && React$1.createElement(Mask, {
|
|
11998
12373
|
visible: maskVisible,
|
|
11999
|
-
forceRender:
|
|
12000
|
-
destroyOnClose:
|
|
12374
|
+
forceRender: mergedProps.forceRender,
|
|
12375
|
+
destroyOnClose: mergedProps.destroyOnClose,
|
|
12001
12376
|
onMaskClick: (e2) => {
|
|
12002
12377
|
var _a, _b;
|
|
12003
|
-
(_a =
|
|
12004
|
-
if (
|
|
12005
|
-
(_b =
|
|
12378
|
+
(_a = mergedProps.onMaskClick) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
12379
|
+
if (mergedProps.closeOnMaskClick) {
|
|
12380
|
+
(_b = mergedProps.onClose) === null || _b === void 0 ? void 0 : _b.call(mergedProps);
|
|
12006
12381
|
}
|
|
12007
12382
|
},
|
|
12008
|
-
style:
|
|
12009
|
-
className: classNames(`${classPrefix$Y}-mask`,
|
|
12383
|
+
style: mergedProps.maskStyle,
|
|
12384
|
+
className: classNames(`${classPrefix$Y}-mask`, mergedProps.maskClassName),
|
|
12010
12385
|
disableBodyScroll: false,
|
|
12011
|
-
stopPropagation:
|
|
12386
|
+
stopPropagation: mergedProps.stopPropagation
|
|
12012
12387
|
}), React$1.createElement("div", {
|
|
12013
12388
|
className: `${classPrefix$Y}-wrap`,
|
|
12014
|
-
role:
|
|
12015
|
-
"aria-label":
|
|
12389
|
+
role: mergedProps.role,
|
|
12390
|
+
"aria-label": mergedProps["aria-label"]
|
|
12016
12391
|
}, React$1.createElement(animated.div, {
|
|
12017
12392
|
style: Object.assign(Object.assign({}, style), {
|
|
12018
12393
|
pointerEvents: style.opacity.to((v) => v === 1 ? "unset" : "none")
|
|
12019
12394
|
}),
|
|
12020
12395
|
ref
|
|
12021
|
-
},
|
|
12396
|
+
}, mergedProps.showCloseButton && React$1.createElement("a", {
|
|
12022
12397
|
className: classNames(`${classPrefix$Y}-close`, "adm-plain-anchor"),
|
|
12023
12398
|
onClick: () => {
|
|
12024
12399
|
var _a;
|
|
12025
|
-
(_a =
|
|
12400
|
+
(_a = mergedProps.onClose) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
12026
12401
|
}
|
|
12027
|
-
},
|
|
12402
|
+
}, mergedProps.closeIcon), body)))));
|
|
12028
12403
|
return React$1.createElement(ShouldRender, {
|
|
12029
12404
|
active,
|
|
12030
|
-
forceRender:
|
|
12031
|
-
destroyOnClose:
|
|
12032
|
-
}, renderToContainer(
|
|
12405
|
+
forceRender: mergedProps.forceRender,
|
|
12406
|
+
destroyOnClose: mergedProps.destroyOnClose
|
|
12407
|
+
}, renderToContainer(mergedProps.getContainer, node));
|
|
12033
12408
|
};
|
|
12034
12409
|
const CheckboxGroupContext = React$1.createContext(null);
|
|
12035
|
-
const defaultProps$
|
|
12410
|
+
const defaultProps$M = {
|
|
12036
12411
|
disabled: false,
|
|
12037
12412
|
defaultValue: []
|
|
12038
12413
|
};
|
|
12039
12414
|
const Group$1 = (p) => {
|
|
12040
|
-
const props = mergeProps(defaultProps$
|
|
12415
|
+
const props = mergeProps(defaultProps$M, p);
|
|
12041
12416
|
const [value, setValue2] = usePropsValue(props);
|
|
12042
12417
|
return React$1.createElement(
|
|
12043
12418
|
CheckboxGroupContext.Provider,
|
|
@@ -12105,13 +12480,13 @@ const NativeInput = (props) => {
|
|
|
12105
12480
|
});
|
|
12106
12481
|
};
|
|
12107
12482
|
const classPrefix$X = `adm-checkbox`;
|
|
12108
|
-
const defaultProps$
|
|
12483
|
+
const defaultProps$L = {
|
|
12109
12484
|
defaultChecked: false,
|
|
12110
12485
|
indeterminate: false
|
|
12111
12486
|
};
|
|
12112
12487
|
const Checkbox$1 = React$1.forwardRef((p, ref) => {
|
|
12113
12488
|
const groupContext = React$1.useContext(CheckboxGroupContext);
|
|
12114
|
-
const props = mergeProps(defaultProps$
|
|
12489
|
+
const props = mergeProps(defaultProps$L, p);
|
|
12115
12490
|
let [checked, setChecked] = usePropsValue({
|
|
12116
12491
|
value: props.checked,
|
|
12117
12492
|
defaultValue: props.defaultChecked,
|
|
@@ -12273,8 +12648,12 @@ const CollapsePanelContent = (props) => {
|
|
|
12273
12648
|
}, React$1.createElement(List$1.Item, null, shouldRender && props.children)));
|
|
12274
12649
|
};
|
|
12275
12650
|
const Collapse = (props) => {
|
|
12651
|
+
const {
|
|
12652
|
+
collapse: componentConfig = {}
|
|
12653
|
+
} = useConfig();
|
|
12654
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
12276
12655
|
const panels = [];
|
|
12277
|
-
traverseReactNode(
|
|
12656
|
+
traverseReactNode(mergedProps.children, (child) => {
|
|
12278
12657
|
if (!React$1.isValidElement(child))
|
|
12279
12658
|
return;
|
|
12280
12659
|
const key = child.key;
|
|
@@ -12284,11 +12663,11 @@ const Collapse = (props) => {
|
|
|
12284
12663
|
});
|
|
12285
12664
|
const handlePropsValue = () => {
|
|
12286
12665
|
var _a;
|
|
12287
|
-
if (!
|
|
12666
|
+
if (!mergedProps.accordion) {
|
|
12288
12667
|
return {
|
|
12289
|
-
value:
|
|
12290
|
-
defaultValue: (_a =
|
|
12291
|
-
onChange:
|
|
12668
|
+
value: mergedProps.activeKey,
|
|
12669
|
+
defaultValue: (_a = mergedProps.defaultActiveKey) !== null && _a !== void 0 ? _a : [],
|
|
12670
|
+
onChange: mergedProps.onChange
|
|
12292
12671
|
};
|
|
12293
12672
|
}
|
|
12294
12673
|
const initValue = {
|
|
@@ -12296,29 +12675,29 @@ const Collapse = (props) => {
|
|
|
12296
12675
|
defaultValue: [],
|
|
12297
12676
|
onChange: (v) => {
|
|
12298
12677
|
var _a2, _b;
|
|
12299
|
-
(_a2 =
|
|
12678
|
+
(_a2 = mergedProps.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(mergedProps, (_b = v[0]) !== null && _b !== void 0 ? _b : null);
|
|
12300
12679
|
}
|
|
12301
12680
|
};
|
|
12302
|
-
if (
|
|
12681
|
+
if (mergedProps.activeKey === void 0) {
|
|
12303
12682
|
initValue.value = void 0;
|
|
12304
|
-
} else if (
|
|
12305
|
-
initValue.value = [
|
|
12683
|
+
} else if (mergedProps.activeKey !== null) {
|
|
12684
|
+
initValue.value = [mergedProps.activeKey];
|
|
12306
12685
|
}
|
|
12307
|
-
if (![null, void 0].includes(
|
|
12308
|
-
initValue.defaultValue = [
|
|
12686
|
+
if (![null, void 0].includes(mergedProps.defaultActiveKey)) {
|
|
12687
|
+
initValue.defaultValue = [mergedProps.defaultActiveKey];
|
|
12309
12688
|
}
|
|
12310
12689
|
return initValue;
|
|
12311
12690
|
};
|
|
12312
12691
|
const [activeKey, setActiveKey] = usePropsValue(handlePropsValue());
|
|
12313
12692
|
const activeKeyList = activeKey === null ? [] : Array.isArray(activeKey) ? activeKey : [activeKey];
|
|
12314
|
-
return withNativeProps(
|
|
12693
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
12315
12694
|
className: classPrefix$W
|
|
12316
12695
|
}, React$1.createElement(List$1, null, panels.map((panel) => {
|
|
12317
12696
|
const key = panel.key;
|
|
12318
12697
|
const active = activeKeyList.includes(key);
|
|
12319
12698
|
function handleClick(event) {
|
|
12320
12699
|
var _a, _b;
|
|
12321
|
-
if (
|
|
12700
|
+
if (mergedProps.accordion) {
|
|
12322
12701
|
if (active) {
|
|
12323
12702
|
setActiveKey([]);
|
|
12324
12703
|
} else {
|
|
@@ -12331,29 +12710,21 @@ const Collapse = (props) => {
|
|
|
12331
12710
|
setActiveKey([...activeKeyList, key]);
|
|
12332
12711
|
}
|
|
12333
12712
|
}
|
|
12334
|
-
(_b = (_a = panel.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
12335
|
-
}
|
|
12336
|
-
const
|
|
12337
|
-
|
|
12338
|
-
|
|
12339
|
-
|
|
12340
|
-
}
|
|
12341
|
-
|
|
12342
|
-
arrow2 = panel.props.arrow;
|
|
12343
|
-
}
|
|
12344
|
-
return typeof arrow2 === "function" ? arrow2(active) : React$1.createElement("div", {
|
|
12345
|
-
className: classNames(`${classPrefix$W}-arrow`, {
|
|
12346
|
-
[`${classPrefix$W}-arrow-active`]: active
|
|
12347
|
-
})
|
|
12348
|
-
}, arrow2);
|
|
12349
|
-
};
|
|
12713
|
+
(_b = (_a = panel.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
12714
|
+
}
|
|
12715
|
+
const arrow2 = mergeProp(React$1.createElement(DownOutline, null), mergedProps.arrow, mergedProps.arrowIcon, panel.props.arrow, panel.props.arrowIcon);
|
|
12716
|
+
const arrowIcon = typeof arrow2 === "function" ? arrow2(active) : React$1.createElement("div", {
|
|
12717
|
+
className: classNames(`${classPrefix$W}-arrow`, {
|
|
12718
|
+
[`${classPrefix$W}-arrow-active`]: active
|
|
12719
|
+
})
|
|
12720
|
+
}, arrow2);
|
|
12350
12721
|
return React$1.createElement(React$1.Fragment, {
|
|
12351
12722
|
key
|
|
12352
12723
|
}, withNativeProps(panel.props, React$1.createElement(List$1.Item, {
|
|
12353
12724
|
className: `${classPrefix$W}-panel-header`,
|
|
12354
12725
|
onClick: handleClick,
|
|
12355
12726
|
disabled: panel.props.disabled,
|
|
12356
|
-
|
|
12727
|
+
arrowIcon
|
|
12357
12728
|
}, panel.props.title)), React$1.createElement(CollapsePanelContent, {
|
|
12358
12729
|
visible: active,
|
|
12359
12730
|
forceRender: !!panel.props.forceRender,
|
|
@@ -12678,14 +13049,14 @@ function useRenderLabel(renderLabel) {
|
|
|
12678
13049
|
}, [renderLabel]);
|
|
12679
13050
|
}
|
|
12680
13051
|
const thisYear$1 = (/* @__PURE__ */ new Date()).getFullYear();
|
|
12681
|
-
const defaultProps$
|
|
13052
|
+
const defaultProps$K = {
|
|
12682
13053
|
min: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear$1 - 10)),
|
|
12683
13054
|
max: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear$1 + 10)),
|
|
12684
13055
|
precision: "day",
|
|
12685
13056
|
defaultValue: null
|
|
12686
13057
|
};
|
|
12687
13058
|
const DatePicker = React$1.forwardRef((p, ref) => {
|
|
12688
|
-
const props = mergeProps(defaultProps$
|
|
13059
|
+
const props = mergeProps(defaultProps$K, p);
|
|
12689
13060
|
const {
|
|
12690
13061
|
renderLabel
|
|
12691
13062
|
} = props;
|
|
@@ -12782,14 +13153,14 @@ const index$d = attachPropertiesToComponent(DatePicker, {
|
|
|
12782
13153
|
DATE_NOW: TILL_NOW
|
|
12783
13154
|
});
|
|
12784
13155
|
const thisYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
12785
|
-
const defaultProps$
|
|
13156
|
+
const defaultProps$J = {
|
|
12786
13157
|
min: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear - 10)),
|
|
12787
13158
|
max: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear + 10)),
|
|
12788
13159
|
precision: "day"
|
|
12789
13160
|
};
|
|
12790
13161
|
const DatePickerView = (p) => {
|
|
12791
13162
|
var _a;
|
|
12792
|
-
const props = mergeProps(defaultProps$
|
|
13163
|
+
const props = mergeProps(defaultProps$J, p);
|
|
12793
13164
|
const {
|
|
12794
13165
|
renderLabel
|
|
12795
13166
|
} = props;
|
|
@@ -12839,14 +13210,14 @@ const DialogActionButton = (props) => {
|
|
|
12839
13210
|
disabled: action.disabled
|
|
12840
13211
|
}, action.text));
|
|
12841
13212
|
};
|
|
12842
|
-
const defaultProps$
|
|
13213
|
+
const defaultProps$I = {
|
|
12843
13214
|
actions: [],
|
|
12844
13215
|
closeOnAction: false,
|
|
12845
13216
|
closeOnMaskClick: false,
|
|
12846
13217
|
getContainer: null
|
|
12847
13218
|
};
|
|
12848
13219
|
const Dialog = (p) => {
|
|
12849
|
-
const props = mergeProps(defaultProps$
|
|
13220
|
+
const props = mergeProps(defaultProps$I, p);
|
|
12850
13221
|
const element = React$1.createElement(React$1.Fragment, null, !!props.image && React$1.createElement("div", {
|
|
12851
13222
|
className: cls$1("image-container")
|
|
12852
13223
|
}, React$1.createElement(Image$1, {
|
|
@@ -12937,7 +13308,7 @@ function alert$1(p) {
|
|
|
12937
13308
|
}));
|
|
12938
13309
|
});
|
|
12939
13310
|
}
|
|
12940
|
-
const defaultProps$
|
|
13311
|
+
const defaultProps$H = {
|
|
12941
13312
|
confirmText: "确认",
|
|
12942
13313
|
cancelText: "取消"
|
|
12943
13314
|
};
|
|
@@ -12945,7 +13316,7 @@ function confirm$1(p) {
|
|
|
12945
13316
|
const {
|
|
12946
13317
|
locale
|
|
12947
13318
|
} = getDefaultConfig();
|
|
12948
|
-
const props = mergeProps(defaultProps$
|
|
13319
|
+
const props = mergeProps(defaultProps$H, {
|
|
12949
13320
|
confirmText: locale.common.confirm,
|
|
12950
13321
|
cancelText: locale.common.cancel
|
|
12951
13322
|
}, p);
|
|
@@ -12989,25 +13360,37 @@ const index$c = attachPropertiesToComponent(Dialog, {
|
|
|
12989
13360
|
confirm: confirm$1,
|
|
12990
13361
|
clear: clear$2
|
|
12991
13362
|
});
|
|
13363
|
+
const IconContext = React$1.createContext(null);
|
|
12992
13364
|
const classPrefix$V = `adm-dropdown-item`;
|
|
12993
13365
|
const Item = (props) => {
|
|
12994
|
-
|
|
13366
|
+
const {
|
|
13367
|
+
dropdown: componentConfig = {}
|
|
13368
|
+
} = useConfig();
|
|
13369
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
13370
|
+
const {
|
|
13371
|
+
active,
|
|
13372
|
+
highlight,
|
|
13373
|
+
onClick,
|
|
13374
|
+
title
|
|
13375
|
+
} = mergedProps;
|
|
12995
13376
|
const cls2 = classNames(classPrefix$V, {
|
|
12996
|
-
[`${classPrefix$V}-active`]:
|
|
12997
|
-
[`${classPrefix$V}-highlight`]:
|
|
13377
|
+
[`${classPrefix$V}-active`]: active,
|
|
13378
|
+
[`${classPrefix$V}-highlight`]: highlight !== null && highlight !== void 0 ? highlight : active
|
|
12998
13379
|
});
|
|
13380
|
+
const contextArrowIcon = React$1.useContext(IconContext);
|
|
13381
|
+
const mergedArrowIcon = mergeProp(React$1.createElement(DownFill, null), contextArrowIcon, mergedProps.arrow, mergedProps.arrowIcon);
|
|
12999
13382
|
return withNativeProps(props, React$1.createElement("div", {
|
|
13000
13383
|
className: cls2,
|
|
13001
|
-
onClick
|
|
13384
|
+
onClick
|
|
13002
13385
|
}, React$1.createElement("div", {
|
|
13003
13386
|
className: `${classPrefix$V}-title`
|
|
13004
13387
|
}, React$1.createElement("span", {
|
|
13005
13388
|
className: `${classPrefix$V}-title-text`
|
|
13006
|
-
},
|
|
13389
|
+
}, title), React$1.createElement("span", {
|
|
13007
13390
|
className: classNames(`${classPrefix$V}-title-arrow`, {
|
|
13008
|
-
[`${classPrefix$V}-title-arrow-active`]:
|
|
13391
|
+
[`${classPrefix$V}-title-arrow-active`]: active
|
|
13009
13392
|
})
|
|
13010
|
-
},
|
|
13393
|
+
}, mergedArrowIcon))));
|
|
13011
13394
|
};
|
|
13012
13395
|
const Item$1 = Item;
|
|
13013
13396
|
const ItemChildrenWrap = (props) => {
|
|
@@ -13024,23 +13407,27 @@ const ItemChildrenWrap = (props) => {
|
|
|
13024
13407
|
}, props.children) : null;
|
|
13025
13408
|
};
|
|
13026
13409
|
const classPrefix$U = `adm-dropdown`;
|
|
13027
|
-
const defaultProps$
|
|
13410
|
+
const defaultProps$G = {
|
|
13028
13411
|
defaultActiveKey: null,
|
|
13029
13412
|
closeOnMaskClick: true,
|
|
13030
13413
|
closeOnClickAway: false,
|
|
13031
13414
|
getContainer: defaultPopupBaseProps["getContainer"]
|
|
13032
13415
|
};
|
|
13033
|
-
const Dropdown = React$1.forwardRef((
|
|
13034
|
-
const
|
|
13416
|
+
const Dropdown = React$1.forwardRef((props, ref) => {
|
|
13417
|
+
const {
|
|
13418
|
+
dropdown: componentConfig = {}
|
|
13419
|
+
} = useConfig();
|
|
13420
|
+
const mergedProps = mergeProps(defaultProps$G, componentConfig, props);
|
|
13421
|
+
const arrowIcon = mergeProp(componentConfig.arrowIcon, props.arrow, props.arrowIcon);
|
|
13035
13422
|
const [value, setValue2] = usePropsValue({
|
|
13036
|
-
value:
|
|
13037
|
-
defaultValue:
|
|
13038
|
-
onChange:
|
|
13423
|
+
value: mergedProps.activeKey,
|
|
13424
|
+
defaultValue: mergedProps.defaultActiveKey,
|
|
13425
|
+
onChange: mergedProps.onChange
|
|
13039
13426
|
});
|
|
13040
13427
|
const navRef = React$1.useRef(null);
|
|
13041
13428
|
const contentRef = React$1.useRef(null);
|
|
13042
13429
|
useClickAway(() => {
|
|
13043
|
-
if (!
|
|
13430
|
+
if (!mergedProps.closeOnClickAway)
|
|
13044
13431
|
return;
|
|
13045
13432
|
setValue2(null);
|
|
13046
13433
|
}, [navRef, contentRef]);
|
|
@@ -13064,7 +13451,7 @@ const Dropdown = React$1.forwardRef((p, ref) => {
|
|
|
13064
13451
|
};
|
|
13065
13452
|
let popupForceRender = false;
|
|
13066
13453
|
const items = [];
|
|
13067
|
-
const navs = React$1.Children.map(
|
|
13454
|
+
const navs = React$1.Children.map(mergedProps.children, (child) => {
|
|
13068
13455
|
if (React$1.isValidElement(child)) {
|
|
13069
13456
|
const childProps = Object.assign(Object.assign({}, child.props), {
|
|
13070
13457
|
onClick: (event) => {
|
|
@@ -13072,8 +13459,7 @@ const Dropdown = React$1.forwardRef((p, ref) => {
|
|
|
13072
13459
|
changeActive(child.key);
|
|
13073
13460
|
(_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
13074
13461
|
},
|
|
13075
|
-
active: child.key === value
|
|
13076
|
-
arrow: child.props.arrow === void 0 ? props.arrow : child.props.arrow
|
|
13462
|
+
active: child.key === value
|
|
13077
13463
|
});
|
|
13078
13464
|
items.push(child);
|
|
13079
13465
|
if (child.props.forceRender)
|
|
@@ -13088,18 +13474,20 @@ const Dropdown = React$1.forwardRef((p, ref) => {
|
|
|
13088
13474
|
setValue2(null);
|
|
13089
13475
|
}
|
|
13090
13476
|
}), [setValue2]);
|
|
13091
|
-
return withNativeProps(
|
|
13477
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
13092
13478
|
className: classNames(classPrefix$U, {
|
|
13093
13479
|
[`${classPrefix$U}-open`]: !!value
|
|
13094
13480
|
}),
|
|
13095
13481
|
ref: containerRef
|
|
13482
|
+
}, React$1.createElement(IconContext.Provider, {
|
|
13483
|
+
value: arrowIcon
|
|
13096
13484
|
}, React$1.createElement("div", {
|
|
13097
13485
|
className: `${classPrefix$U}-nav`,
|
|
13098
13486
|
ref: navRef
|
|
13099
|
-
}, navs), React$1.createElement(Popup, {
|
|
13487
|
+
}, navs)), React$1.createElement(Popup, {
|
|
13100
13488
|
visible: !!value,
|
|
13101
13489
|
position: "top",
|
|
13102
|
-
getContainer:
|
|
13490
|
+
getContainer: mergedProps.getContainer,
|
|
13103
13491
|
className: `${classPrefix$U}-popup`,
|
|
13104
13492
|
maskClassName: `${classPrefix$U}-popup-mask`,
|
|
13105
13493
|
bodyClassName: `${classPrefix$U}-popup-body`,
|
|
@@ -13107,7 +13495,7 @@ const Dropdown = React$1.forwardRef((p, ref) => {
|
|
|
13107
13495
|
top
|
|
13108
13496
|
},
|
|
13109
13497
|
forceRender: popupForceRender,
|
|
13110
|
-
onMaskClick:
|
|
13498
|
+
onMaskClick: mergedProps.closeOnMaskClick ? () => {
|
|
13111
13499
|
changeActive(null);
|
|
13112
13500
|
} : void 0
|
|
13113
13501
|
}, React$1.createElement("div", {
|
|
@@ -13187,7 +13575,7 @@ function betweenInclusive(i2, e2, n2) {
|
|
|
13187
13575
|
i2[i2.unit_1 = 1] = "unit_1", i2[i2.unit_2 = 2] = "unit_2", i2[i2.unit_4 = 4] = "unit_4";
|
|
13188
13576
|
}(n || (n = {}));
|
|
13189
13577
|
const classPrefix$T = `adm-ellipsis`;
|
|
13190
|
-
const defaultProps$
|
|
13578
|
+
const defaultProps$F = {
|
|
13191
13579
|
direction: "end",
|
|
13192
13580
|
rows: 1,
|
|
13193
13581
|
expandText: "",
|
|
@@ -13199,7 +13587,7 @@ const defaultProps$G = {
|
|
|
13199
13587
|
defaultExpanded: false
|
|
13200
13588
|
};
|
|
13201
13589
|
const Ellipsis = (p) => {
|
|
13202
|
-
const props = mergeProps(defaultProps$
|
|
13590
|
+
const props = mergeProps(defaultProps$F, p);
|
|
13203
13591
|
const rootRef = React$1.useRef(null);
|
|
13204
13592
|
const expandElRef = React$1.useRef(null);
|
|
13205
13593
|
const collapseElRef = React$1.useRef(null);
|
|
@@ -13387,13 +13775,13 @@ const Empty = (props) => {
|
|
|
13387
13775
|
}, props.description)));
|
|
13388
13776
|
};
|
|
13389
13777
|
const classPrefix$R = `adm-error-block`;
|
|
13390
|
-
const defaultProps$
|
|
13778
|
+
const defaultProps$E = {
|
|
13391
13779
|
status: "default"
|
|
13392
13780
|
};
|
|
13393
13781
|
function createErrorBlock(imageRecord2) {
|
|
13394
13782
|
const ErrorBlock2 = (p) => {
|
|
13395
13783
|
var _a;
|
|
13396
|
-
const props = mergeProps(defaultProps$
|
|
13784
|
+
const props = mergeProps(defaultProps$E, p);
|
|
13397
13785
|
const {
|
|
13398
13786
|
locale
|
|
13399
13787
|
} = useConfig();
|
|
@@ -13925,7 +14313,7 @@ const imageRecord = {
|
|
|
13925
14313
|
};
|
|
13926
14314
|
const ErrorBlock = createErrorBlock(imageRecord);
|
|
13927
14315
|
const classPrefix$Q = `adm-floating-bubble`;
|
|
13928
|
-
const defaultProps$
|
|
14316
|
+
const defaultProps$D = {
|
|
13929
14317
|
axis: "y",
|
|
13930
14318
|
defaultOffset: {
|
|
13931
14319
|
x: 0,
|
|
@@ -13933,7 +14321,7 @@ const defaultProps$E = {
|
|
|
13933
14321
|
}
|
|
13934
14322
|
};
|
|
13935
14323
|
const FloatingBubble = (p) => {
|
|
13936
|
-
const props = mergeProps(defaultProps$
|
|
14324
|
+
const props = mergeProps(defaultProps$D, p);
|
|
13937
14325
|
const boundaryRef = React$1.useRef(null);
|
|
13938
14326
|
const buttonRef = React$1.useRef(null);
|
|
13939
14327
|
const [innerValue, setInnerValue] = React$1.useState(props.offset === void 0 ? props.defaultOffset : props.offset);
|
|
@@ -14032,12 +14420,12 @@ function nearest(arr, target) {
|
|
|
14032
14420
|
});
|
|
14033
14421
|
}
|
|
14034
14422
|
const classPrefix$P = "adm-floating-panel";
|
|
14035
|
-
const defaultProps$
|
|
14423
|
+
const defaultProps$C = {
|
|
14036
14424
|
handleDraggingOfContent: true
|
|
14037
14425
|
};
|
|
14038
14426
|
const FloatingPanel = React$1.forwardRef((p, ref) => {
|
|
14039
14427
|
var _a, _b;
|
|
14040
|
-
const props = mergeProps(defaultProps$
|
|
14428
|
+
const props = mergeProps(defaultProps$C, p);
|
|
14041
14429
|
const {
|
|
14042
14430
|
anchors
|
|
14043
14431
|
} = props;
|
|
@@ -14197,99 +14585,6 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
14197
14585
|
}
|
|
14198
14586
|
return target;
|
|
14199
14587
|
}
|
|
14200
|
-
function _typeof$1(o) {
|
|
14201
|
-
"@babel/helpers - typeof";
|
|
14202
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
14203
|
-
return typeof o2;
|
|
14204
|
-
} : function(o2) {
|
|
14205
|
-
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
14206
|
-
}, _typeof$1(o);
|
|
14207
|
-
}
|
|
14208
|
-
function _toPrimitive(input, hint) {
|
|
14209
|
-
if (_typeof$1(input) !== "object" || input === null)
|
|
14210
|
-
return input;
|
|
14211
|
-
var prim = input[Symbol.toPrimitive];
|
|
14212
|
-
if (prim !== void 0) {
|
|
14213
|
-
var res = prim.call(input, hint || "default");
|
|
14214
|
-
if (_typeof$1(res) !== "object")
|
|
14215
|
-
return res;
|
|
14216
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
14217
|
-
}
|
|
14218
|
-
return (hint === "string" ? String : Number)(input);
|
|
14219
|
-
}
|
|
14220
|
-
function _toPropertyKey(arg) {
|
|
14221
|
-
var key = _toPrimitive(arg, "string");
|
|
14222
|
-
return _typeof$1(key) === "symbol" ? key : String(key);
|
|
14223
|
-
}
|
|
14224
|
-
function _defineProperty(obj, key, value) {
|
|
14225
|
-
key = _toPropertyKey(key);
|
|
14226
|
-
if (key in obj) {
|
|
14227
|
-
Object.defineProperty(obj, key, {
|
|
14228
|
-
value,
|
|
14229
|
-
enumerable: true,
|
|
14230
|
-
configurable: true,
|
|
14231
|
-
writable: true
|
|
14232
|
-
});
|
|
14233
|
-
} else {
|
|
14234
|
-
obj[key] = value;
|
|
14235
|
-
}
|
|
14236
|
-
return obj;
|
|
14237
|
-
}
|
|
14238
|
-
function ownKeys(e2, r) {
|
|
14239
|
-
var t = Object.keys(e2);
|
|
14240
|
-
if (Object.getOwnPropertySymbols) {
|
|
14241
|
-
var o = Object.getOwnPropertySymbols(e2);
|
|
14242
|
-
r && (o = o.filter(function(r2) {
|
|
14243
|
-
return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
|
|
14244
|
-
})), t.push.apply(t, o);
|
|
14245
|
-
}
|
|
14246
|
-
return t;
|
|
14247
|
-
}
|
|
14248
|
-
function _objectSpread2(e2) {
|
|
14249
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
14250
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
14251
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
14252
|
-
_defineProperty(e2, r2, t[r2]);
|
|
14253
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
14254
|
-
Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
14255
|
-
});
|
|
14256
|
-
}
|
|
14257
|
-
return e2;
|
|
14258
|
-
}
|
|
14259
|
-
function _arrayLikeToArray(arr, len) {
|
|
14260
|
-
if (len == null || len > arr.length)
|
|
14261
|
-
len = arr.length;
|
|
14262
|
-
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
|
|
14263
|
-
arr2[i2] = arr[i2];
|
|
14264
|
-
return arr2;
|
|
14265
|
-
}
|
|
14266
|
-
function _arrayWithoutHoles(arr) {
|
|
14267
|
-
if (Array.isArray(arr))
|
|
14268
|
-
return _arrayLikeToArray(arr);
|
|
14269
|
-
}
|
|
14270
|
-
function _iterableToArray(iter) {
|
|
14271
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
14272
|
-
return Array.from(iter);
|
|
14273
|
-
}
|
|
14274
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
14275
|
-
if (!o)
|
|
14276
|
-
return;
|
|
14277
|
-
if (typeof o === "string")
|
|
14278
|
-
return _arrayLikeToArray(o, minLen);
|
|
14279
|
-
var n2 = Object.prototype.toString.call(o).slice(8, -1);
|
|
14280
|
-
if (n2 === "Object" && o.constructor)
|
|
14281
|
-
n2 = o.constructor.name;
|
|
14282
|
-
if (n2 === "Map" || n2 === "Set")
|
|
14283
|
-
return Array.from(o);
|
|
14284
|
-
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
14285
|
-
return _arrayLikeToArray(o, minLen);
|
|
14286
|
-
}
|
|
14287
|
-
function _nonIterableSpread() {
|
|
14288
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14289
|
-
}
|
|
14290
|
-
function _toConsumableArray(arr) {
|
|
14291
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
14292
|
-
}
|
|
14293
14588
|
function _classCallCheck(instance, Constructor) {
|
|
14294
14589
|
if (!(instance instanceof Constructor)) {
|
|
14295
14590
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -14404,49 +14699,6 @@ function toArray$2(children) {
|
|
|
14404
14699
|
});
|
|
14405
14700
|
return ret;
|
|
14406
14701
|
}
|
|
14407
|
-
var warned$1 = {};
|
|
14408
|
-
var preWarningFns$1 = [];
|
|
14409
|
-
var preMessage$1 = function preMessage2(fn) {
|
|
14410
|
-
preWarningFns$1.push(fn);
|
|
14411
|
-
};
|
|
14412
|
-
function warning$3(valid, message) {
|
|
14413
|
-
if (!valid && console !== void 0) {
|
|
14414
|
-
var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
|
|
14415
|
-
return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "warning");
|
|
14416
|
-
}, message);
|
|
14417
|
-
if (finalMessage) {
|
|
14418
|
-
console.error("Warning: ".concat(finalMessage));
|
|
14419
|
-
}
|
|
14420
|
-
}
|
|
14421
|
-
}
|
|
14422
|
-
function note$1(valid, message) {
|
|
14423
|
-
if (!valid && console !== void 0) {
|
|
14424
|
-
var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
|
|
14425
|
-
return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "note");
|
|
14426
|
-
}, message);
|
|
14427
|
-
if (finalMessage) {
|
|
14428
|
-
console.warn("Note: ".concat(finalMessage));
|
|
14429
|
-
}
|
|
14430
|
-
}
|
|
14431
|
-
}
|
|
14432
|
-
function resetWarned$1() {
|
|
14433
|
-
warned$1 = {};
|
|
14434
|
-
}
|
|
14435
|
-
function call$1(method4, valid, message) {
|
|
14436
|
-
if (!valid && !warned$1[message]) {
|
|
14437
|
-
method4(false, message);
|
|
14438
|
-
warned$1[message] = true;
|
|
14439
|
-
}
|
|
14440
|
-
}
|
|
14441
|
-
function warningOnce$1(valid, message) {
|
|
14442
|
-
call$1(warning$3, valid, message);
|
|
14443
|
-
}
|
|
14444
|
-
function noteOnce$1(valid, message) {
|
|
14445
|
-
call$1(note$1, valid, message);
|
|
14446
|
-
}
|
|
14447
|
-
warningOnce$1.preMessage = preMessage$1;
|
|
14448
|
-
warningOnce$1.resetWarned = resetWarned$1;
|
|
14449
|
-
warningOnce$1.noteOnce = noteOnce$1;
|
|
14450
14702
|
var HOOK_MARK$1 = "RC_FORM_INTERNAL_HOOKS";
|
|
14451
14703
|
var warningFunc$1 = function warningFunc() {
|
|
14452
14704
|
warningOnce$1(false, "Can not find FormContext. Please make sure you wrap Field under Form.");
|
|
@@ -15932,53 +16184,6 @@ var defaultValidateMessages = {
|
|
|
15932
16184
|
mismatch: "'${name}' does not match pattern ${pattern}"
|
|
15933
16185
|
}
|
|
15934
16186
|
};
|
|
15935
|
-
function get(entity, path) {
|
|
15936
|
-
var current = entity;
|
|
15937
|
-
for (var i2 = 0; i2 < path.length; i2 += 1) {
|
|
15938
|
-
if (current === null || current === void 0) {
|
|
15939
|
-
return void 0;
|
|
15940
|
-
}
|
|
15941
|
-
current = current[path[i2]];
|
|
15942
|
-
}
|
|
15943
|
-
return current;
|
|
15944
|
-
}
|
|
15945
|
-
function _arrayWithHoles(arr) {
|
|
15946
|
-
if (Array.isArray(arr))
|
|
15947
|
-
return arr;
|
|
15948
|
-
}
|
|
15949
|
-
function _nonIterableRest() {
|
|
15950
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
15951
|
-
}
|
|
15952
|
-
function _toArray(arr) {
|
|
15953
|
-
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
15954
|
-
}
|
|
15955
|
-
function internalSet(entity, paths, value, removeIfUndefined) {
|
|
15956
|
-
if (!paths.length) {
|
|
15957
|
-
return value;
|
|
15958
|
-
}
|
|
15959
|
-
var _paths = _toArray(paths), path = _paths[0], restPath = _paths.slice(1);
|
|
15960
|
-
var clone;
|
|
15961
|
-
if (!entity && typeof path === "number") {
|
|
15962
|
-
clone = [];
|
|
15963
|
-
} else if (Array.isArray(entity)) {
|
|
15964
|
-
clone = _toConsumableArray(entity);
|
|
15965
|
-
} else {
|
|
15966
|
-
clone = _objectSpread2({}, entity);
|
|
15967
|
-
}
|
|
15968
|
-
if (removeIfUndefined && value === void 0 && restPath.length === 1) {
|
|
15969
|
-
delete clone[path][restPath[0]];
|
|
15970
|
-
} else {
|
|
15971
|
-
clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
|
|
15972
|
-
}
|
|
15973
|
-
return clone;
|
|
15974
|
-
}
|
|
15975
|
-
function set(entity, paths, value) {
|
|
15976
|
-
var removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
15977
|
-
if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) {
|
|
15978
|
-
return entity;
|
|
15979
|
-
}
|
|
15980
|
-
return internalSet(entity, paths, value, removeIfUndefined);
|
|
15981
|
-
}
|
|
15982
16187
|
function cloneDeep(val) {
|
|
15983
16188
|
if (Array.isArray(val)) {
|
|
15984
16189
|
return cloneArrayDeep(val);
|
|
@@ -16878,43 +17083,14 @@ var List = function List2(_ref) {
|
|
|
16878
17083
|
key = keyManager.keys[index2];
|
|
16879
17084
|
keyManager.id += 1;
|
|
16880
17085
|
}
|
|
16881
|
-
return {
|
|
16882
|
-
name: index2,
|
|
16883
|
-
key,
|
|
16884
|
-
isListField: true
|
|
16885
|
-
};
|
|
16886
|
-
}), operations, meta);
|
|
16887
|
-
})));
|
|
16888
|
-
};
|
|
16889
|
-
function _iterableToArrayLimit(r, l) {
|
|
16890
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
16891
|
-
if (null != t) {
|
|
16892
|
-
var e2, n2, i2, u, a = [], f = true, o = false;
|
|
16893
|
-
try {
|
|
16894
|
-
if (i2 = (t = t.call(r)).next, 0 === l) {
|
|
16895
|
-
if (Object(t) !== t)
|
|
16896
|
-
return;
|
|
16897
|
-
f = false;
|
|
16898
|
-
} else
|
|
16899
|
-
for (; !(f = (e2 = i2.call(t)).done) && (a.push(e2.value), a.length !== l); f = true)
|
|
16900
|
-
;
|
|
16901
|
-
} catch (r2) {
|
|
16902
|
-
o = true, n2 = r2;
|
|
16903
|
-
} finally {
|
|
16904
|
-
try {
|
|
16905
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u))
|
|
16906
|
-
return;
|
|
16907
|
-
} finally {
|
|
16908
|
-
if (o)
|
|
16909
|
-
throw n2;
|
|
16910
|
-
}
|
|
16911
|
-
}
|
|
16912
|
-
return a;
|
|
16913
|
-
}
|
|
16914
|
-
}
|
|
16915
|
-
function _slicedToArray(arr, i2) {
|
|
16916
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
|
|
16917
|
-
}
|
|
17086
|
+
return {
|
|
17087
|
+
name: index2,
|
|
17088
|
+
key,
|
|
17089
|
+
isListField: true
|
|
17090
|
+
};
|
|
17091
|
+
}), operations, meta);
|
|
17092
|
+
})));
|
|
17093
|
+
};
|
|
16918
17094
|
function allPromiseFinish(promiseList) {
|
|
16919
17095
|
var hasError = false;
|
|
16920
17096
|
var count = promiseList.length;
|
|
@@ -18078,9 +18254,9 @@ const FormArray = (props) => {
|
|
|
18078
18254
|
});
|
|
18079
18255
|
};
|
|
18080
18256
|
const classPrefix$O = "adm-form";
|
|
18081
|
-
const defaultProps$
|
|
18257
|
+
const defaultProps$B = defaultFormContext;
|
|
18082
18258
|
const Form2 = React$1.forwardRef((p, ref) => {
|
|
18083
|
-
const props = mergeProps(defaultProps$
|
|
18259
|
+
const props = mergeProps(defaultProps$B, p);
|
|
18084
18260
|
const {
|
|
18085
18261
|
className,
|
|
18086
18262
|
style,
|
|
@@ -18320,24 +18496,13 @@ var Context = /* @__PURE__ */ React.createContext({
|
|
|
18320
18496
|
});
|
|
18321
18497
|
var _default = Context;
|
|
18322
18498
|
default_1 = FieldContext.default = _default;
|
|
18323
|
-
function
|
|
18324
|
-
|
|
18325
|
-
|
|
18326
|
-
|
|
18327
|
-
|
|
18328
|
-
|
|
18329
|
-
|
|
18330
|
-
return !!(prototype && prototype.isReactComponent);
|
|
18331
|
-
}
|
|
18332
|
-
function isSimpleFunctionComponent(type4) {
|
|
18333
|
-
return typeof type4 === "function" && !shouldConstruct(type4) && type4.defaultProps === void 0;
|
|
18334
|
-
}
|
|
18335
|
-
function isSafeSetRefComponent(component) {
|
|
18336
|
-
if (reactIsExports.isFragment(component))
|
|
18337
|
-
return false;
|
|
18338
|
-
if (reactIsExports.isMemo(component))
|
|
18339
|
-
return isSafeSetRefComponent(component.type);
|
|
18340
|
-
return !isSimpleFunctionComponent(component.type);
|
|
18499
|
+
function undefinedFallback(...items) {
|
|
18500
|
+
let i2;
|
|
18501
|
+
for (i2 = 0; i2 < items.length; i2++) {
|
|
18502
|
+
if (items[i2] !== void 0)
|
|
18503
|
+
break;
|
|
18504
|
+
}
|
|
18505
|
+
return items[i2];
|
|
18341
18506
|
}
|
|
18342
18507
|
const Arrow = React$1.memo((props) => {
|
|
18343
18508
|
return withNativeProps(props, React$1.createElement("svg", {
|
|
@@ -19776,7 +19941,7 @@ function convertPx(px) {
|
|
|
19776
19941
|
return tester.getBoundingClientRect().height;
|
|
19777
19942
|
}
|
|
19778
19943
|
const classPrefix$N = `adm-popover`;
|
|
19779
|
-
const defaultProps$
|
|
19944
|
+
const defaultProps$A = {
|
|
19780
19945
|
placement: "top",
|
|
19781
19946
|
defaultVisible: false,
|
|
19782
19947
|
stopPropagation: ["click"],
|
|
@@ -19784,7 +19949,7 @@ const defaultProps$B = {
|
|
|
19784
19949
|
mode: "light"
|
|
19785
19950
|
};
|
|
19786
19951
|
const Popover$1 = React$1.forwardRef((p, ref) => {
|
|
19787
|
-
const props = mergeProps(defaultProps$
|
|
19952
|
+
const props = mergeProps(defaultProps$A, p);
|
|
19788
19953
|
const placement = normalizePlacement(props.placement);
|
|
19789
19954
|
const [visible, setVisible] = usePropsValue({
|
|
19790
19955
|
value: props.visible,
|
|
@@ -19965,13 +20130,24 @@ const PopoverMenu = React$1.forwardRef((props, ref) => {
|
|
|
19965
20130
|
const Popover = attachPropertiesToComponent(Popover$1, {
|
|
19966
20131
|
Menu: PopoverMenu
|
|
19967
20132
|
});
|
|
19968
|
-
function
|
|
19969
|
-
|
|
19970
|
-
|
|
19971
|
-
|
|
19972
|
-
|
|
19973
|
-
|
|
19974
|
-
|
|
20133
|
+
function toArray(candidate) {
|
|
20134
|
+
if (candidate === void 0 || candidate === false)
|
|
20135
|
+
return [];
|
|
20136
|
+
return Array.isArray(candidate) ? candidate : [candidate];
|
|
20137
|
+
}
|
|
20138
|
+
function shouldConstruct(Component) {
|
|
20139
|
+
const prototype = Component.prototype;
|
|
20140
|
+
return !!(prototype && prototype.isReactComponent);
|
|
20141
|
+
}
|
|
20142
|
+
function isSimpleFunctionComponent(type4) {
|
|
20143
|
+
return typeof type4 === "function" && !shouldConstruct(type4) && type4.defaultProps === void 0;
|
|
20144
|
+
}
|
|
20145
|
+
function isSafeSetRefComponent(component) {
|
|
20146
|
+
if (reactIsExports.isFragment(component))
|
|
20147
|
+
return false;
|
|
20148
|
+
if (reactIsExports.isMemo(component))
|
|
20149
|
+
return isSafeSetRefComponent(component.type);
|
|
20150
|
+
return !isSimpleFunctionComponent(component.type);
|
|
19975
20151
|
}
|
|
19976
20152
|
const NAME_SPLIT = "__SPLIT__";
|
|
19977
20153
|
const classPrefix$L = `adm-form-item`;
|
|
@@ -19980,22 +20156,25 @@ const MemoInput = React$1.memo(({
|
|
|
19980
20156
|
}) => children, (prev, next) => prev.value === next.value && prev.update === next.update);
|
|
19981
20157
|
const FormItemLayout = (props) => {
|
|
19982
20158
|
var _a;
|
|
20159
|
+
const {
|
|
20160
|
+
locale,
|
|
20161
|
+
form: componentConfig = {}
|
|
20162
|
+
} = useConfig();
|
|
19983
20163
|
const {
|
|
19984
20164
|
style,
|
|
19985
20165
|
extra,
|
|
19986
20166
|
label,
|
|
19987
20167
|
help,
|
|
20168
|
+
helpIcon,
|
|
19988
20169
|
required: required4,
|
|
19989
20170
|
children,
|
|
19990
20171
|
htmlFor,
|
|
19991
20172
|
hidden,
|
|
19992
20173
|
arrow: arrow2,
|
|
20174
|
+
arrowIcon,
|
|
19993
20175
|
childElementPosition = "normal"
|
|
19994
|
-
} = props;
|
|
20176
|
+
} = mergeProps(componentConfig, props);
|
|
19995
20177
|
const context = React$1.useContext(FormContext);
|
|
19996
|
-
const {
|
|
19997
|
-
locale
|
|
19998
|
-
} = useConfig();
|
|
19999
20178
|
const hasFeedback = props.hasFeedback !== void 0 ? props.hasFeedback : context.hasFeedback;
|
|
20000
20179
|
const layout = props.layout || context.layout;
|
|
20001
20180
|
const disabled = (_a = props.disabled) !== null && _a !== void 0 ? _a : context.disabled;
|
|
@@ -20035,7 +20214,7 @@ const FormItemLayout = (props) => {
|
|
|
20035
20214
|
e2.stopPropagation();
|
|
20036
20215
|
e2.preventDefault();
|
|
20037
20216
|
}
|
|
20038
|
-
}, React$1.createElement(QuestionCircleOutline, null))));
|
|
20217
|
+
}, helpIcon || React$1.createElement(QuestionCircleOutline, null))));
|
|
20039
20218
|
const description = (!!props.description || hasFeedback) && React$1.createElement(React$1.Fragment, null, props.description, hasFeedback && React$1.createElement(React$1.Fragment, null, props.errors.map((error, index2) => React$1.createElement("div", {
|
|
20040
20219
|
key: `error-${index2}`,
|
|
20041
20220
|
className: `${classPrefix$L}-feedback-error`
|
|
@@ -20056,7 +20235,7 @@ const FormItemLayout = (props) => {
|
|
|
20056
20235
|
disabled,
|
|
20057
20236
|
onClick: props.onClick,
|
|
20058
20237
|
clickable: props.clickable,
|
|
20059
|
-
|
|
20238
|
+
arrowIcon: arrowIcon || arrow2
|
|
20060
20239
|
}, React$1.createElement("div", {
|
|
20061
20240
|
className: classNames(`${classPrefix$L}-child`, `${classPrefix$L}-child-position-${childElementPosition}`)
|
|
20062
20241
|
}, React$1.createElement("div", {
|
|
@@ -20070,6 +20249,7 @@ const FormItem = (props) => {
|
|
|
20070
20249
|
// FormItem 相关
|
|
20071
20250
|
label,
|
|
20072
20251
|
help,
|
|
20252
|
+
helpIcon,
|
|
20073
20253
|
extra,
|
|
20074
20254
|
hasFeedback,
|
|
20075
20255
|
name,
|
|
@@ -20090,8 +20270,9 @@ const FormItem = (props) => {
|
|
|
20090
20270
|
shouldUpdate,
|
|
20091
20271
|
dependencies,
|
|
20092
20272
|
clickable,
|
|
20093
|
-
arrow: arrow2
|
|
20094
|
-
|
|
20273
|
+
arrow: arrow2,
|
|
20274
|
+
arrowIcon
|
|
20275
|
+
} = props, fieldProps = __rest(props, ["style", "label", "help", "helpIcon", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "childElementPosition", "description", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "clickable", "arrow", "arrowIcon"]);
|
|
20095
20276
|
const {
|
|
20096
20277
|
name: formName
|
|
20097
20278
|
} = React$1.useContext(FormContext);
|
|
@@ -20143,6 +20324,7 @@ const FormItem = (props) => {
|
|
|
20143
20324
|
label,
|
|
20144
20325
|
extra,
|
|
20145
20326
|
help,
|
|
20327
|
+
helpIcon,
|
|
20146
20328
|
description,
|
|
20147
20329
|
required: isRequired,
|
|
20148
20330
|
disabled,
|
|
@@ -20155,7 +20337,8 @@ const FormItem = (props) => {
|
|
|
20155
20337
|
layout,
|
|
20156
20338
|
childElementPosition,
|
|
20157
20339
|
clickable,
|
|
20158
|
-
arrow: arrow2
|
|
20340
|
+
arrow: arrow2,
|
|
20341
|
+
arrowIcon
|
|
20159
20342
|
}, React$1.createElement(NoStyleItemContext.Provider, {
|
|
20160
20343
|
value: onSubMetaChange
|
|
20161
20344
|
}, baseChildren)));
|
|
@@ -20647,14 +20830,14 @@ const Slides = React$1.forwardRef((props, ref) => {
|
|
|
20647
20830
|
}))));
|
|
20648
20831
|
});
|
|
20649
20832
|
const classPrefix$H = `adm-image-viewer`;
|
|
20650
|
-
const defaultProps$
|
|
20833
|
+
const defaultProps$z = {
|
|
20651
20834
|
maxZoom: 3,
|
|
20652
20835
|
getContainer: null,
|
|
20653
20836
|
visible: false
|
|
20654
20837
|
};
|
|
20655
20838
|
const ImageViewer$1 = (p) => {
|
|
20656
20839
|
var _a, _b, _c;
|
|
20657
|
-
const props = mergeProps(defaultProps$
|
|
20840
|
+
const props = mergeProps(defaultProps$z, p);
|
|
20658
20841
|
const node = React$1.createElement(Mask, {
|
|
20659
20842
|
visible: props.visible,
|
|
20660
20843
|
disableBodyScroll: false,
|
|
@@ -20675,7 +20858,7 @@ const ImageViewer$1 = (p) => {
|
|
|
20675
20858
|
})));
|
|
20676
20859
|
return renderToContainer(props.getContainer, node);
|
|
20677
20860
|
};
|
|
20678
|
-
const multiDefaultProps = Object.assign(Object.assign({}, defaultProps$
|
|
20861
|
+
const multiDefaultProps = Object.assign(Object.assign({}, defaultProps$z), {
|
|
20679
20862
|
defaultIndex: 0
|
|
20680
20863
|
});
|
|
20681
20864
|
const MultiImageViewer = React$1.forwardRef((p, ref) => {
|
|
@@ -20815,11 +20998,11 @@ const PreviewItem = (props) => {
|
|
|
20815
20998
|
};
|
|
20816
20999
|
const PreviewItem$1 = PreviewItem;
|
|
20817
21000
|
const classPrefix$F = `adm-space`;
|
|
20818
|
-
const defaultProps$
|
|
21001
|
+
const defaultProps$y = {
|
|
20819
21002
|
direction: "horizontal"
|
|
20820
21003
|
};
|
|
20821
21004
|
const Space = (p) => {
|
|
20822
|
-
const props = mergeProps(defaultProps$
|
|
21005
|
+
const props = mergeProps(defaultProps$y, p);
|
|
20823
21006
|
const {
|
|
20824
21007
|
direction,
|
|
20825
21008
|
onClick
|
|
@@ -20840,7 +21023,7 @@ const Space = (p) => {
|
|
|
20840
21023
|
})));
|
|
20841
21024
|
};
|
|
20842
21025
|
const classPrefix$E = `adm-image-uploader`;
|
|
20843
|
-
const defaultProps$
|
|
21026
|
+
const defaultProps$x = {
|
|
20844
21027
|
disableUpload: false,
|
|
20845
21028
|
deletable: true,
|
|
20846
21029
|
deleteIcon: React$1.createElement(CloseOutline, {
|
|
@@ -20859,7 +21042,7 @@ const ImageUploader = React$1.forwardRef((p, ref) => {
|
|
|
20859
21042
|
const {
|
|
20860
21043
|
locale
|
|
20861
21044
|
} = useConfig();
|
|
20862
|
-
const props = mergeProps(defaultProps$
|
|
21045
|
+
const props = mergeProps(defaultProps$x, p);
|
|
20863
21046
|
const {
|
|
20864
21047
|
columns
|
|
20865
21048
|
} = props;
|
|
@@ -21145,11 +21328,11 @@ const Sidebar = (props) => {
|
|
|
21145
21328
|
}));
|
|
21146
21329
|
};
|
|
21147
21330
|
const classPrefix$C = `adm-index-bar`;
|
|
21148
|
-
const defaultProps$
|
|
21331
|
+
const defaultProps$w = {
|
|
21149
21332
|
sticky: true
|
|
21150
21333
|
};
|
|
21151
21334
|
const IndexBar = React$1.forwardRef((p, ref) => {
|
|
21152
|
-
const props = mergeProps(defaultProps$
|
|
21335
|
+
const props = mergeProps(defaultProps$w, p);
|
|
21153
21336
|
const titleHeight = convertPx(35);
|
|
21154
21337
|
const bodyRef = React$1.useRef(null);
|
|
21155
21338
|
const indexItems = [];
|
|
@@ -21250,7 +21433,7 @@ function isWindow(element) {
|
|
|
21250
21433
|
return element === window;
|
|
21251
21434
|
}
|
|
21252
21435
|
const classPrefix$B = `adm-infinite-scroll`;
|
|
21253
|
-
const defaultProps$
|
|
21436
|
+
const defaultProps$v = {
|
|
21254
21437
|
threshold: 250,
|
|
21255
21438
|
children: (hasMore, failed, retry) => React$1.createElement(InfiniteScrollContent, {
|
|
21256
21439
|
hasMore,
|
|
@@ -21259,7 +21442,7 @@ const defaultProps$w = {
|
|
|
21259
21442
|
})
|
|
21260
21443
|
};
|
|
21261
21444
|
const InfiniteScroll = (p) => {
|
|
21262
|
-
const props = mergeProps(defaultProps$
|
|
21445
|
+
const props = mergeProps(defaultProps$v, p);
|
|
21263
21446
|
const [failed, setFailed] = React$1.useState(false);
|
|
21264
21447
|
const doLoadMore = useLockFn((isRetry) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21265
21448
|
try {
|
|
@@ -21380,24 +21563,26 @@ function useInputHandleKeyDown({
|
|
|
21380
21563
|
return handleKeydown;
|
|
21381
21564
|
}
|
|
21382
21565
|
const classPrefix$A = `adm-input`;
|
|
21383
|
-
const defaultProps$
|
|
21566
|
+
const defaultProps$u = {
|
|
21384
21567
|
defaultValue: "",
|
|
21568
|
+
clearIcon: React$1.createElement(CloseCircleFill, null),
|
|
21385
21569
|
onlyShowClearWhenFocus: true
|
|
21386
21570
|
};
|
|
21387
|
-
const Input = React$1.forwardRef((
|
|
21388
|
-
const
|
|
21389
|
-
|
|
21571
|
+
const Input = React$1.forwardRef((props, ref) => {
|
|
21572
|
+
const {
|
|
21573
|
+
locale,
|
|
21574
|
+
input: componentConfig = {}
|
|
21575
|
+
} = useConfig();
|
|
21576
|
+
const mergedProps = mergeProps(defaultProps$u, componentConfig, props);
|
|
21577
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
21390
21578
|
const [hasFocus, setHasFocus] = React$1.useState(false);
|
|
21391
21579
|
const compositionStartRef = React$1.useRef(false);
|
|
21392
21580
|
const nativeInputRef = React$1.useRef(null);
|
|
21393
|
-
const {
|
|
21394
|
-
locale
|
|
21395
|
-
} = useConfig();
|
|
21396
21581
|
const handleKeydown = useInputHandleKeyDown({
|
|
21397
|
-
onEnterPress:
|
|
21398
|
-
onKeyDown:
|
|
21582
|
+
onEnterPress: mergedProps.onEnterPress,
|
|
21583
|
+
onKeyDown: mergedProps.onKeyDown,
|
|
21399
21584
|
nativeInputRef,
|
|
21400
|
-
enterKeyHint:
|
|
21585
|
+
enterKeyHint: mergedProps.enterKeyHint
|
|
21401
21586
|
});
|
|
21402
21587
|
React$1.useImperativeHandle(ref, () => ({
|
|
21403
21588
|
clear: () => {
|
|
@@ -21417,8 +21602,8 @@ const Input = React$1.forwardRef((p, ref) => {
|
|
|
21417
21602
|
}));
|
|
21418
21603
|
function checkValue() {
|
|
21419
21604
|
let nextValue = value;
|
|
21420
|
-
if (
|
|
21421
|
-
const boundValue = nextValue && bound(parseFloat(nextValue),
|
|
21605
|
+
if (mergedProps.type === "number") {
|
|
21606
|
+
const boundValue = nextValue && bound(parseFloat(nextValue), mergedProps.min, mergedProps.max).toString();
|
|
21422
21607
|
if (Number(nextValue) !== Number(boundValue)) {
|
|
21423
21608
|
nextValue = boundValue;
|
|
21424
21609
|
}
|
|
@@ -21428,16 +21613,16 @@ const Input = React$1.forwardRef((p, ref) => {
|
|
|
21428
21613
|
}
|
|
21429
21614
|
}
|
|
21430
21615
|
const shouldShowClear = (() => {
|
|
21431
|
-
if (!
|
|
21616
|
+
if (!mergedProps.clearable || !value || mergedProps.readOnly)
|
|
21432
21617
|
return false;
|
|
21433
|
-
if (
|
|
21618
|
+
if (mergedProps.onlyShowClearWhenFocus) {
|
|
21434
21619
|
return hasFocus;
|
|
21435
21620
|
} else {
|
|
21436
21621
|
return true;
|
|
21437
21622
|
}
|
|
21438
21623
|
})();
|
|
21439
|
-
return withNativeProps(
|
|
21440
|
-
className: classNames(`${classPrefix$A}`,
|
|
21624
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
21625
|
+
className: classNames(`${classPrefix$A}`, mergedProps.disabled && `${classPrefix$A}-disabled`)
|
|
21441
21626
|
}, React$1.createElement("input", {
|
|
21442
21627
|
ref: nativeInputRef,
|
|
21443
21628
|
className: `${classPrefix$A}-element`,
|
|
@@ -21448,50 +21633,50 @@ const Input = React$1.forwardRef((p, ref) => {
|
|
|
21448
21633
|
onFocus: (e2) => {
|
|
21449
21634
|
var _a;
|
|
21450
21635
|
setHasFocus(true);
|
|
21451
|
-
(_a =
|
|
21636
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21452
21637
|
},
|
|
21453
21638
|
onBlur: (e2) => {
|
|
21454
21639
|
var _a;
|
|
21455
21640
|
setHasFocus(false);
|
|
21456
21641
|
checkValue();
|
|
21457
|
-
(_a =
|
|
21642
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21458
21643
|
},
|
|
21459
|
-
id:
|
|
21460
|
-
placeholder:
|
|
21461
|
-
disabled:
|
|
21462
|
-
readOnly:
|
|
21463
|
-
maxLength:
|
|
21464
|
-
minLength:
|
|
21465
|
-
max:
|
|
21466
|
-
min:
|
|
21467
|
-
autoComplete:
|
|
21468
|
-
enterKeyHint:
|
|
21469
|
-
autoFocus:
|
|
21470
|
-
pattern:
|
|
21471
|
-
inputMode:
|
|
21472
|
-
type:
|
|
21473
|
-
name:
|
|
21474
|
-
autoCapitalize:
|
|
21475
|
-
autoCorrect:
|
|
21644
|
+
id: mergedProps.id,
|
|
21645
|
+
placeholder: mergedProps.placeholder,
|
|
21646
|
+
disabled: mergedProps.disabled,
|
|
21647
|
+
readOnly: mergedProps.readOnly,
|
|
21648
|
+
maxLength: mergedProps.maxLength,
|
|
21649
|
+
minLength: mergedProps.minLength,
|
|
21650
|
+
max: mergedProps.max,
|
|
21651
|
+
min: mergedProps.min,
|
|
21652
|
+
autoComplete: mergedProps.autoComplete,
|
|
21653
|
+
enterKeyHint: mergedProps.enterKeyHint,
|
|
21654
|
+
autoFocus: mergedProps.autoFocus,
|
|
21655
|
+
pattern: mergedProps.pattern,
|
|
21656
|
+
inputMode: mergedProps.inputMode,
|
|
21657
|
+
type: mergedProps.type,
|
|
21658
|
+
name: mergedProps.name,
|
|
21659
|
+
autoCapitalize: mergedProps.autoCapitalize,
|
|
21660
|
+
autoCorrect: mergedProps.autoCorrect,
|
|
21476
21661
|
onKeyDown: handleKeydown,
|
|
21477
|
-
onKeyUp:
|
|
21662
|
+
onKeyUp: mergedProps.onKeyUp,
|
|
21478
21663
|
onCompositionStart: (e2) => {
|
|
21479
21664
|
var _a;
|
|
21480
21665
|
compositionStartRef.current = true;
|
|
21481
|
-
(_a =
|
|
21666
|
+
(_a = mergedProps.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21482
21667
|
},
|
|
21483
21668
|
onCompositionEnd: (e2) => {
|
|
21484
21669
|
var _a;
|
|
21485
21670
|
compositionStartRef.current = false;
|
|
21486
|
-
(_a =
|
|
21671
|
+
(_a = mergedProps.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21487
21672
|
},
|
|
21488
|
-
onClick:
|
|
21489
|
-
step:
|
|
21490
|
-
role:
|
|
21491
|
-
"aria-valuenow":
|
|
21492
|
-
"aria-valuemax":
|
|
21493
|
-
"aria-valuemin":
|
|
21494
|
-
"aria-label":
|
|
21673
|
+
onClick: mergedProps.onClick,
|
|
21674
|
+
step: mergedProps.step,
|
|
21675
|
+
role: mergedProps.role,
|
|
21676
|
+
"aria-valuenow": mergedProps["aria-valuenow"],
|
|
21677
|
+
"aria-valuemax": mergedProps["aria-valuemax"],
|
|
21678
|
+
"aria-valuemin": mergedProps["aria-valuemin"],
|
|
21679
|
+
"aria-label": mergedProps["aria-label"]
|
|
21495
21680
|
}), shouldShowClear && React$1.createElement("div", {
|
|
21496
21681
|
className: `${classPrefix$A}-clear`,
|
|
21497
21682
|
onMouseDown: (e2) => {
|
|
@@ -21500,14 +21685,14 @@ const Input = React$1.forwardRef((p, ref) => {
|
|
|
21500
21685
|
onClick: () => {
|
|
21501
21686
|
var _a, _b;
|
|
21502
21687
|
setValue2("");
|
|
21503
|
-
(_a =
|
|
21688
|
+
(_a = mergedProps.onClear) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
21504
21689
|
if (isIOS() && compositionStartRef.current) {
|
|
21505
21690
|
compositionStartRef.current = false;
|
|
21506
21691
|
(_b = nativeInputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
21507
21692
|
}
|
|
21508
21693
|
},
|
|
21509
21694
|
"aria-label": locale.Input.clear
|
|
21510
|
-
},
|
|
21695
|
+
}, mergedProps.clearIcon)));
|
|
21511
21696
|
});
|
|
21512
21697
|
const classPrefix$z = `adm-jumbo-tabs`;
|
|
21513
21698
|
const JumboTab = () => {
|
|
@@ -21622,14 +21807,14 @@ const ModalActionButton = (props) => {
|
|
|
21622
21807
|
disabled: action.disabled
|
|
21623
21808
|
}, action.text));
|
|
21624
21809
|
};
|
|
21625
|
-
const defaultProps$
|
|
21810
|
+
const defaultProps$t = {
|
|
21626
21811
|
actions: [],
|
|
21627
21812
|
closeOnAction: false,
|
|
21628
21813
|
closeOnMaskClick: false,
|
|
21629
21814
|
getContainer: null
|
|
21630
21815
|
};
|
|
21631
21816
|
const Modal = (p) => {
|
|
21632
|
-
const props = mergeProps(defaultProps$
|
|
21817
|
+
const props = mergeProps(defaultProps$t, p);
|
|
21633
21818
|
const element = React$1.createElement(React$1.Fragment, null, !!props.image && React$1.createElement("div", {
|
|
21634
21819
|
className: cls("image-container")
|
|
21635
21820
|
}, React$1.createElement(Image$1, {
|
|
@@ -21714,7 +21899,7 @@ function alert(p) {
|
|
|
21714
21899
|
}));
|
|
21715
21900
|
});
|
|
21716
21901
|
}
|
|
21717
|
-
const defaultProps$
|
|
21902
|
+
const defaultProps$s = {
|
|
21718
21903
|
confirmText: "确认",
|
|
21719
21904
|
cancelText: "取消"
|
|
21720
21905
|
};
|
|
@@ -21722,7 +21907,7 @@ function confirm(p) {
|
|
|
21722
21907
|
const {
|
|
21723
21908
|
locale
|
|
21724
21909
|
} = getDefaultConfig();
|
|
21725
|
-
const props = mergeProps(defaultProps$
|
|
21910
|
+
const props = mergeProps(defaultProps$s, {
|
|
21726
21911
|
confirmText: locale.common.confirm,
|
|
21727
21912
|
cancelText: locale.common.cancel
|
|
21728
21913
|
}, p);
|
|
@@ -21767,51 +21952,61 @@ const index$7 = attachPropertiesToComponent(Modal, {
|
|
|
21767
21952
|
clear: clear$1
|
|
21768
21953
|
});
|
|
21769
21954
|
const classPrefix$y = `adm-nav-bar`;
|
|
21770
|
-
const
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21955
|
+
const defaultBackIcon = React$1.createElement(LeftOutline, null);
|
|
21956
|
+
const NavBar = (props) => {
|
|
21957
|
+
const {
|
|
21958
|
+
navBar: componentConfig = {}
|
|
21959
|
+
} = useConfig();
|
|
21960
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
21775
21961
|
const {
|
|
21776
21962
|
back,
|
|
21963
|
+
backIcon,
|
|
21777
21964
|
backArrow
|
|
21778
|
-
} =
|
|
21779
|
-
|
|
21965
|
+
} = mergedProps;
|
|
21966
|
+
const mergedDefaultBackIcon = componentConfig.backIcon || defaultBackIcon;
|
|
21967
|
+
const mergedBackIcon = mergeProp(defaultBackIcon, componentConfig.backIcon, backArrow === true ? mergedDefaultBackIcon : backArrow, backIcon === true ? mergedDefaultBackIcon : backIcon);
|
|
21968
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
21780
21969
|
className: classNames(classPrefix$y)
|
|
21781
21970
|
}, React$1.createElement("div", {
|
|
21782
21971
|
className: `${classPrefix$y}-left`,
|
|
21783
21972
|
role: "button"
|
|
21784
21973
|
}, back !== null && React$1.createElement("div", {
|
|
21785
21974
|
className: `${classPrefix$y}-back`,
|
|
21786
|
-
onClick:
|
|
21787
|
-
},
|
|
21975
|
+
onClick: mergedProps.onBack
|
|
21976
|
+
}, mergedBackIcon && React$1.createElement("span", {
|
|
21788
21977
|
className: `${classPrefix$y}-back-arrow`
|
|
21789
|
-
},
|
|
21978
|
+
}, mergedBackIcon), React$1.createElement("span", {
|
|
21790
21979
|
"aria-hidden": "true"
|
|
21791
|
-
}, back)),
|
|
21980
|
+
}, back)), mergedProps.left), React$1.createElement("div", {
|
|
21792
21981
|
className: `${classPrefix$y}-title`
|
|
21793
|
-
},
|
|
21982
|
+
}, mergedProps.children), React$1.createElement("div", {
|
|
21794
21983
|
className: `${classPrefix$y}-right`
|
|
21795
|
-
},
|
|
21984
|
+
}, mergedProps.right)));
|
|
21796
21985
|
};
|
|
21797
21986
|
const classPrefix$x = `adm-notice-bar`;
|
|
21798
21987
|
const defaultProps$r = {
|
|
21799
21988
|
color: "default",
|
|
21800
21989
|
delay: 2e3,
|
|
21801
21990
|
speed: 50,
|
|
21802
|
-
|
|
21803
|
-
|
|
21991
|
+
icon: React$1.createElement(SoundOutline, null),
|
|
21992
|
+
wrap: false
|
|
21804
21993
|
};
|
|
21805
|
-
const NoticeBar = React$1.memo((
|
|
21806
|
-
const
|
|
21994
|
+
const NoticeBar = React$1.memo((props) => {
|
|
21995
|
+
const {
|
|
21996
|
+
noticeBar: componentConfig = {}
|
|
21997
|
+
} = useConfig();
|
|
21998
|
+
const mergedProps = mergeProps(defaultProps$r, componentConfig, props);
|
|
21999
|
+
const closeIcon = mergeProp(React$1.createElement(CloseOutline, {
|
|
22000
|
+
className: `${classPrefix$x}-close-icon`
|
|
22001
|
+
}), componentConfig.closeIcon, props.closeIcon);
|
|
21807
22002
|
const containerRef = React$1.useRef(null);
|
|
21808
22003
|
const textRef = React$1.useRef(null);
|
|
21809
22004
|
const [visible, setVisible] = React$1.useState(true);
|
|
21810
|
-
const speed =
|
|
22005
|
+
const speed = mergedProps.speed;
|
|
21811
22006
|
const delayLockRef = React$1.useRef(true);
|
|
21812
22007
|
const animatingRef = React$1.useRef(false);
|
|
21813
22008
|
function start2() {
|
|
21814
|
-
if (delayLockRef.current ||
|
|
22009
|
+
if (delayLockRef.current || mergedProps.wrap)
|
|
21815
22010
|
return;
|
|
21816
22011
|
const container = containerRef.current;
|
|
21817
22012
|
const text = textRef.current;
|
|
@@ -21840,7 +22035,7 @@ const NoticeBar = React$1.memo((p) => {
|
|
|
21840
22035
|
useTimeout$1(() => {
|
|
21841
22036
|
delayLockRef.current = false;
|
|
21842
22037
|
start2();
|
|
21843
|
-
},
|
|
22038
|
+
}, mergedProps.delay);
|
|
21844
22039
|
useResizeEffect(() => {
|
|
21845
22040
|
start2();
|
|
21846
22041
|
}, containerRef);
|
|
@@ -21853,14 +22048,14 @@ const NoticeBar = React$1.memo((p) => {
|
|
|
21853
22048
|
});
|
|
21854
22049
|
if (!visible)
|
|
21855
22050
|
return null;
|
|
21856
|
-
return withNativeProps(
|
|
21857
|
-
className: classNames(classPrefix$x, `${classPrefix$x}-${
|
|
21858
|
-
[`${classPrefix$x}-wrap`]:
|
|
22051
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
22052
|
+
className: classNames(classPrefix$x, `${classPrefix$x}-${mergedProps.color}`, {
|
|
22053
|
+
[`${classPrefix$x}-wrap`]: mergedProps.wrap
|
|
21859
22054
|
}),
|
|
21860
|
-
onClick:
|
|
21861
|
-
},
|
|
22055
|
+
onClick: mergedProps.onClick
|
|
22056
|
+
}, mergedProps.icon && React$1.createElement("span", {
|
|
21862
22057
|
className: `${classPrefix$x}-left`
|
|
21863
|
-
},
|
|
22058
|
+
}, mergedProps.icon), React$1.createElement("span", {
|
|
21864
22059
|
ref: containerRef,
|
|
21865
22060
|
className: `${classPrefix$x}-content`
|
|
21866
22061
|
}, React$1.createElement("span", {
|
|
@@ -21870,18 +22065,16 @@ const NoticeBar = React$1.memo((p) => {
|
|
|
21870
22065
|
},
|
|
21871
22066
|
ref: textRef,
|
|
21872
22067
|
className: `${classPrefix$x}-content-inner`
|
|
21873
|
-
},
|
|
22068
|
+
}, mergedProps.content)), (mergedProps.closeable || mergedProps.extra) && React$1.createElement("span", {
|
|
21874
22069
|
className: `${classPrefix$x}-right`
|
|
21875
|
-
},
|
|
22070
|
+
}, mergedProps.extra, mergedProps.closeable && React$1.createElement("div", {
|
|
21876
22071
|
className: `${classPrefix$x}-close`,
|
|
21877
22072
|
onClick: () => {
|
|
21878
22073
|
var _a;
|
|
21879
22074
|
setVisible(false);
|
|
21880
|
-
(_a =
|
|
22075
|
+
(_a = mergedProps.onClose) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
21881
22076
|
}
|
|
21882
|
-
},
|
|
21883
|
-
className: `${classPrefix$x}-close-icon`
|
|
21884
|
-
})))));
|
|
22077
|
+
}, closeIcon))));
|
|
21885
22078
|
});
|
|
21886
22079
|
function shuffle(array4) {
|
|
21887
22080
|
const result = [...array4];
|
|
@@ -21940,13 +22133,13 @@ const NumberKeyboard = (p) => {
|
|
|
21940
22133
|
var _a;
|
|
21941
22134
|
(_a = props.onDelete) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
21942
22135
|
});
|
|
21943
|
-
const
|
|
22136
|
+
const startContinueClear = () => {
|
|
21944
22137
|
timeoutRef.current = window.setTimeout(() => {
|
|
21945
22138
|
onDelete();
|
|
21946
22139
|
intervalRef.current = window.setInterval(onDelete, 150);
|
|
21947
22140
|
}, 700);
|
|
21948
22141
|
};
|
|
21949
|
-
const
|
|
22142
|
+
const stopContinueClear = () => {
|
|
21950
22143
|
clearTimeout(timeoutRef.current);
|
|
21951
22144
|
clearInterval(intervalRef.current);
|
|
21952
22145
|
};
|
|
@@ -22006,14 +22199,15 @@ const NumberKeyboard = (p) => {
|
|
|
22006
22199
|
key,
|
|
22007
22200
|
className,
|
|
22008
22201
|
onTouchStart: () => {
|
|
22202
|
+
stopContinueClear();
|
|
22009
22203
|
if (key === "BACKSPACE") {
|
|
22010
|
-
|
|
22204
|
+
startContinueClear();
|
|
22011
22205
|
}
|
|
22012
22206
|
},
|
|
22013
22207
|
onTouchEnd: (e2) => {
|
|
22014
22208
|
onKeyPress(e2, key);
|
|
22015
22209
|
if (key === "BACKSPACE") {
|
|
22016
|
-
|
|
22210
|
+
stopContinueClear();
|
|
22017
22211
|
}
|
|
22018
22212
|
}
|
|
22019
22213
|
}, ariaProps), key === "BACKSPACE" ? React$1.createElement(TextDeletionOutline, null) : key);
|
|
@@ -22045,11 +22239,11 @@ const NumberKeyboard = (p) => {
|
|
|
22045
22239
|
}, React$1.createElement("div", {
|
|
22046
22240
|
className: `${classPrefix$w}-key ${classPrefix$w}-key-extra ${classPrefix$w}-key-bs`,
|
|
22047
22241
|
onTouchStart: () => {
|
|
22048
|
-
|
|
22242
|
+
startContinueClear();
|
|
22049
22243
|
},
|
|
22050
22244
|
onTouchEnd: (e2) => {
|
|
22051
22245
|
onKeyPress(e2, "BACKSPACE");
|
|
22052
|
-
|
|
22246
|
+
stopContinueClear();
|
|
22053
22247
|
},
|
|
22054
22248
|
onContextMenu: (e2) => {
|
|
22055
22249
|
e2.preventDefault();
|
|
@@ -22617,14 +22811,33 @@ const Rate = (p) => {
|
|
|
22617
22811
|
className: classNames(`${classPrefix$p}-box`)
|
|
22618
22812
|
}, props.allowHalf && renderStar(i2 + 0.5, true), renderStar(i2 + 1, false)))));
|
|
22619
22813
|
};
|
|
22620
|
-
const
|
|
22621
|
-
const
|
|
22622
|
-
|
|
22623
|
-
|
|
22624
|
-
|
|
22625
|
-
|
|
22626
|
-
|
|
22814
|
+
const useResultIcon = (status) => {
|
|
22815
|
+
const {
|
|
22816
|
+
result: componentConfig = {}
|
|
22817
|
+
} = useConfig();
|
|
22818
|
+
const {
|
|
22819
|
+
successIcon = React$1.createElement(CheckCircleFill, null),
|
|
22820
|
+
errorIcon = React$1.createElement(CloseCircleFill, null),
|
|
22821
|
+
infoIcon = React$1.createElement(InformationCircleFill, null),
|
|
22822
|
+
waitingIcon = React$1.createElement(ClockCircleFill, null),
|
|
22823
|
+
warningIcon = React$1.createElement(ExclamationCircleFill, null)
|
|
22824
|
+
} = componentConfig || {};
|
|
22825
|
+
switch (status) {
|
|
22826
|
+
case "success":
|
|
22827
|
+
return successIcon;
|
|
22828
|
+
case "error":
|
|
22829
|
+
return errorIcon;
|
|
22830
|
+
case "info":
|
|
22831
|
+
return infoIcon;
|
|
22832
|
+
case "waiting":
|
|
22833
|
+
return waitingIcon;
|
|
22834
|
+
case "warning":
|
|
22835
|
+
return warningIcon;
|
|
22836
|
+
default:
|
|
22837
|
+
return null;
|
|
22838
|
+
}
|
|
22627
22839
|
};
|
|
22840
|
+
const classPrefix$o = `adm-result`;
|
|
22628
22841
|
const defaultProps$i = {
|
|
22629
22842
|
status: "info"
|
|
22630
22843
|
};
|
|
@@ -22636,27 +22849,20 @@ const Result = (p) => {
|
|
|
22636
22849
|
description,
|
|
22637
22850
|
icon
|
|
22638
22851
|
} = props;
|
|
22852
|
+
const fallbackIcon = useResultIcon(status);
|
|
22639
22853
|
if (!status)
|
|
22640
22854
|
return null;
|
|
22641
|
-
const resultIcon = icon || React$1.createElement(iconRecord$1[status]);
|
|
22642
22855
|
return withNativeProps(props, React$1.createElement("div", {
|
|
22643
22856
|
className: classNames(classPrefix$o, `${classPrefix$o}-${status}`)
|
|
22644
22857
|
}, React$1.createElement("div", {
|
|
22645
22858
|
className: `${classPrefix$o}-icon`
|
|
22646
|
-
},
|
|
22859
|
+
}, icon || fallbackIcon), React$1.createElement("div", {
|
|
22647
22860
|
className: `${classPrefix$o}-title`
|
|
22648
22861
|
}, title), !!description && React$1.createElement("div", {
|
|
22649
22862
|
className: `${classPrefix$o}-description`
|
|
22650
22863
|
}, description)));
|
|
22651
22864
|
};
|
|
22652
22865
|
const classPrefix$n = `adm-result-page`;
|
|
22653
|
-
const iconRecord = {
|
|
22654
|
-
success: CheckCircleFill,
|
|
22655
|
-
error: CloseCircleFill,
|
|
22656
|
-
info: InformationCircleFill,
|
|
22657
|
-
waiting: ClockCircleFill,
|
|
22658
|
-
warning: ExclamationCircleFill
|
|
22659
|
-
};
|
|
22660
22866
|
const defaultProps$h = {
|
|
22661
22867
|
status: "info",
|
|
22662
22868
|
details: []
|
|
@@ -22674,7 +22880,7 @@ const ResultPage = (p) => {
|
|
|
22674
22880
|
onPrimaryButtonClick,
|
|
22675
22881
|
onSecondaryButtonClick
|
|
22676
22882
|
} = props;
|
|
22677
|
-
const
|
|
22883
|
+
const fallbackIcon = useResultIcon(status);
|
|
22678
22884
|
const [collapse, setCollapse] = React$1.useState(true);
|
|
22679
22885
|
const showSecondaryButton = isNodeWithContent(secondaryButtonText);
|
|
22680
22886
|
const showPrimaryButton = isNodeWithContent(primaryButtonText);
|
|
@@ -22684,7 +22890,7 @@ const ResultPage = (p) => {
|
|
|
22684
22890
|
className: `${classPrefix$n}-header`
|
|
22685
22891
|
}, React$1.createElement("div", {
|
|
22686
22892
|
className: `${classPrefix$n}-icon`
|
|
22687
|
-
},
|
|
22893
|
+
}, icon || fallbackIcon), React$1.createElement("div", {
|
|
22688
22894
|
className: `${classPrefix$n}-title`
|
|
22689
22895
|
}, title), isNodeWithContent(description) ? React$1.createElement("div", {
|
|
22690
22896
|
className: `${classPrefix$n}-description`
|
|
@@ -22740,17 +22946,18 @@ const defaultProps$g = {
|
|
|
22740
22946
|
onlyShowClearWhenFocus: false,
|
|
22741
22947
|
showCancelButton: false,
|
|
22742
22948
|
defaultValue: "",
|
|
22743
|
-
clearOnCancel: true
|
|
22744
|
-
icon: React$1.createElement(SearchOutline, null)
|
|
22949
|
+
clearOnCancel: true
|
|
22745
22950
|
};
|
|
22746
|
-
const SearchBar = React$1.forwardRef((
|
|
22951
|
+
const SearchBar = React$1.forwardRef((props, ref) => {
|
|
22747
22952
|
const {
|
|
22748
|
-
locale
|
|
22953
|
+
locale,
|
|
22954
|
+
searchBar: componentConfig = {}
|
|
22749
22955
|
} = useConfig();
|
|
22750
|
-
const
|
|
22956
|
+
const mergedProps = mergeProps(defaultProps$g, componentConfig, {
|
|
22751
22957
|
cancelText: locale.common.cancel
|
|
22752
|
-
},
|
|
22753
|
-
const
|
|
22958
|
+
}, props);
|
|
22959
|
+
const searchIcon = mergeProp(React$1.createElement(SearchOutline, null), componentConfig.searchIcon, props.icon, props.searchIcon);
|
|
22960
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
22754
22961
|
const [hasFocus, setHasFocus] = React$1.useState(false);
|
|
22755
22962
|
const inputRef = React$1.useRef(null);
|
|
22756
22963
|
const composingRef = React$1.useRef(false);
|
|
@@ -22774,10 +22981,10 @@ const SearchBar = React$1.forwardRef((p, ref) => {
|
|
|
22774
22981
|
}));
|
|
22775
22982
|
const renderCancelButton = () => {
|
|
22776
22983
|
let isShowCancel;
|
|
22777
|
-
if (typeof
|
|
22778
|
-
isShowCancel =
|
|
22984
|
+
if (typeof mergedProps.showCancelButton === "function") {
|
|
22985
|
+
isShowCancel = mergedProps.showCancelButton(hasFocus, value);
|
|
22779
22986
|
} else {
|
|
22780
|
-
isShowCancel =
|
|
22987
|
+
isShowCancel = mergedProps.showCancelButton && hasFocus;
|
|
22781
22988
|
}
|
|
22782
22989
|
return isShowCancel && React$1.createElement("div", {
|
|
22783
22990
|
className: `${classPrefix$l}-suffix`
|
|
@@ -22786,66 +22993,66 @@ const SearchBar = React$1.forwardRef((p, ref) => {
|
|
|
22786
22993
|
className: `${classPrefix$l}-cancel-button`,
|
|
22787
22994
|
onClick: () => {
|
|
22788
22995
|
var _a, _b, _c;
|
|
22789
|
-
if (
|
|
22996
|
+
if (mergedProps.clearOnCancel) {
|
|
22790
22997
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.clear();
|
|
22791
22998
|
}
|
|
22792
22999
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
22793
|
-
(_c =
|
|
23000
|
+
(_c = mergedProps.onCancel) === null || _c === void 0 ? void 0 : _c.call(mergedProps);
|
|
22794
23001
|
},
|
|
22795
23002
|
onMouseDown: (e2) => {
|
|
22796
23003
|
e2.preventDefault();
|
|
22797
23004
|
}
|
|
22798
|
-
},
|
|
23005
|
+
}, mergedProps.cancelText));
|
|
22799
23006
|
};
|
|
22800
|
-
return withNativeProps(
|
|
23007
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
22801
23008
|
className: classNames(classPrefix$l, {
|
|
22802
23009
|
[`${classPrefix$l}-active`]: hasFocus
|
|
22803
23010
|
})
|
|
22804
23011
|
}, React$1.createElement("div", {
|
|
22805
23012
|
className: `${classPrefix$l}-input-box`
|
|
22806
|
-
},
|
|
23013
|
+
}, searchIcon && React$1.createElement("div", {
|
|
22807
23014
|
className: `${classPrefix$l}-input-box-icon`
|
|
22808
|
-
},
|
|
23015
|
+
}, searchIcon), React$1.createElement(Input, {
|
|
22809
23016
|
ref: inputRef,
|
|
22810
23017
|
className: classNames(`${classPrefix$l}-input`, {
|
|
22811
|
-
[`${classPrefix$l}-input-without-icon`]: !
|
|
23018
|
+
[`${classPrefix$l}-input-without-icon`]: !searchIcon
|
|
22812
23019
|
}),
|
|
22813
23020
|
value,
|
|
22814
23021
|
onChange: setValue2,
|
|
22815
|
-
maxLength:
|
|
22816
|
-
placeholder:
|
|
22817
|
-
clearable:
|
|
22818
|
-
onlyShowClearWhenFocus:
|
|
23022
|
+
maxLength: mergedProps.maxLength,
|
|
23023
|
+
placeholder: mergedProps.placeholder,
|
|
23024
|
+
clearable: mergedProps.clearable,
|
|
23025
|
+
onlyShowClearWhenFocus: mergedProps.onlyShowClearWhenFocus,
|
|
22819
23026
|
onFocus: (e2) => {
|
|
22820
23027
|
var _a;
|
|
22821
23028
|
setHasFocus(true);
|
|
22822
|
-
(_a =
|
|
23029
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22823
23030
|
},
|
|
22824
23031
|
onBlur: (e2) => {
|
|
22825
23032
|
var _a;
|
|
22826
23033
|
setHasFocus(false);
|
|
22827
|
-
(_a =
|
|
23034
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22828
23035
|
},
|
|
22829
|
-
onClear:
|
|
23036
|
+
onClear: mergedProps.onClear,
|
|
22830
23037
|
type: "search",
|
|
22831
23038
|
enterKeyHint: "search",
|
|
22832
23039
|
onEnterPress: () => {
|
|
22833
23040
|
var _a, _b;
|
|
22834
23041
|
if (!composingRef.current) {
|
|
22835
23042
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
22836
|
-
(_b =
|
|
23043
|
+
(_b = mergedProps.onSearch) === null || _b === void 0 ? void 0 : _b.call(mergedProps, value);
|
|
22837
23044
|
}
|
|
22838
23045
|
},
|
|
22839
23046
|
"aria-label": locale.SearchBar.name,
|
|
22840
23047
|
onCompositionStart: (e2) => {
|
|
22841
23048
|
var _a;
|
|
22842
23049
|
composingRef.current = true;
|
|
22843
|
-
(_a =
|
|
23050
|
+
(_a = mergedProps.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22844
23051
|
},
|
|
22845
23052
|
onCompositionEnd: (e2) => {
|
|
22846
23053
|
var _a;
|
|
22847
23054
|
composingRef.current = false;
|
|
22848
|
-
(_a =
|
|
23055
|
+
(_a = mergedProps.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22849
23056
|
}
|
|
22850
23057
|
})), renderCancelButton()));
|
|
22851
23058
|
});
|
|
@@ -23732,93 +23939,6 @@ const Slider = (p) => {
|
|
|
23732
23939
|
upperBound: sliderValue[1]
|
|
23733
23940
|
})));
|
|
23734
23941
|
};
|
|
23735
|
-
function useEvent(callback) {
|
|
23736
|
-
var fnRef = React__namespace.useRef();
|
|
23737
|
-
fnRef.current = callback;
|
|
23738
|
-
var memoFn = React__namespace.useCallback(function() {
|
|
23739
|
-
var _fnRef$current;
|
|
23740
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23741
|
-
args[_key] = arguments[_key];
|
|
23742
|
-
}
|
|
23743
|
-
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
23744
|
-
}, []);
|
|
23745
|
-
return memoFn;
|
|
23746
|
-
}
|
|
23747
|
-
function canUseDom() {
|
|
23748
|
-
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
23749
|
-
}
|
|
23750
|
-
var useInternalLayoutEffect = canUseDom() ? React__namespace.useLayoutEffect : React__namespace.useEffect;
|
|
23751
|
-
var useLayoutEffect = function useLayoutEffect2(callback, deps) {
|
|
23752
|
-
var firstMountRef = React__namespace.useRef(true);
|
|
23753
|
-
useInternalLayoutEffect(function() {
|
|
23754
|
-
return callback(firstMountRef.current);
|
|
23755
|
-
}, deps);
|
|
23756
|
-
useInternalLayoutEffect(function() {
|
|
23757
|
-
firstMountRef.current = false;
|
|
23758
|
-
return function() {
|
|
23759
|
-
firstMountRef.current = true;
|
|
23760
|
-
};
|
|
23761
|
-
}, []);
|
|
23762
|
-
};
|
|
23763
|
-
var useLayoutUpdateEffect = function useLayoutUpdateEffect2(callback, deps) {
|
|
23764
|
-
useLayoutEffect(function(firstMount) {
|
|
23765
|
-
if (!firstMount) {
|
|
23766
|
-
return callback();
|
|
23767
|
-
}
|
|
23768
|
-
}, deps);
|
|
23769
|
-
};
|
|
23770
|
-
function useSafeState(defaultValue) {
|
|
23771
|
-
var destroyRef = React__namespace.useRef(false);
|
|
23772
|
-
var _React$useState = React__namespace.useState(defaultValue), _React$useState2 = _slicedToArray(_React$useState, 2), value = _React$useState2[0], setValue2 = _React$useState2[1];
|
|
23773
|
-
React__namespace.useEffect(function() {
|
|
23774
|
-
destroyRef.current = false;
|
|
23775
|
-
return function() {
|
|
23776
|
-
destroyRef.current = true;
|
|
23777
|
-
};
|
|
23778
|
-
}, []);
|
|
23779
|
-
function safeSetState(updater, ignoreDestroy) {
|
|
23780
|
-
if (ignoreDestroy && destroyRef.current) {
|
|
23781
|
-
return;
|
|
23782
|
-
}
|
|
23783
|
-
setValue2(updater);
|
|
23784
|
-
}
|
|
23785
|
-
return [value, safeSetState];
|
|
23786
|
-
}
|
|
23787
|
-
function hasValue(value) {
|
|
23788
|
-
return value !== void 0;
|
|
23789
|
-
}
|
|
23790
|
-
function useMergedState(defaultStateValue, option) {
|
|
23791
|
-
var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState;
|
|
23792
|
-
var _useState = useSafeState(function() {
|
|
23793
|
-
if (hasValue(value)) {
|
|
23794
|
-
return value;
|
|
23795
|
-
} else if (hasValue(defaultValue)) {
|
|
23796
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
23797
|
-
} else {
|
|
23798
|
-
return typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue;
|
|
23799
|
-
}
|
|
23800
|
-
}), _useState2 = _slicedToArray(_useState, 2), innerValue = _useState2[0], setInnerValue = _useState2[1];
|
|
23801
|
-
var mergedValue = value !== void 0 ? value : innerValue;
|
|
23802
|
-
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
|
|
23803
|
-
var onChangeFn = useEvent(onChange);
|
|
23804
|
-
var _useState3 = useSafeState([mergedValue]), _useState4 = _slicedToArray(_useState3, 2), prevValue = _useState4[0], setPrevValue = _useState4[1];
|
|
23805
|
-
useLayoutUpdateEffect(function() {
|
|
23806
|
-
var prev = prevValue[0];
|
|
23807
|
-
if (innerValue !== prev) {
|
|
23808
|
-
onChangeFn(innerValue, prev);
|
|
23809
|
-
}
|
|
23810
|
-
}, [prevValue]);
|
|
23811
|
-
useLayoutUpdateEffect(function() {
|
|
23812
|
-
if (!hasValue(value)) {
|
|
23813
|
-
setInnerValue(value);
|
|
23814
|
-
}
|
|
23815
|
-
}, [value]);
|
|
23816
|
-
var triggerChange = useEvent(function(updater, ignoreDestroy) {
|
|
23817
|
-
setInnerValue(updater, ignoreDestroy);
|
|
23818
|
-
setPrevValue([mergedValue], ignoreDestroy);
|
|
23819
|
-
});
|
|
23820
|
-
return [postMergedValue, triggerChange];
|
|
23821
|
-
}
|
|
23822
23942
|
const classPrefix$e = `adm-stepper`;
|
|
23823
23943
|
const defaultProps$d = {
|
|
23824
23944
|
step: 1,
|
|
@@ -25444,15 +25564,17 @@ const classPrefix$2 = "adm-virtual-input";
|
|
|
25444
25564
|
const defaultProps$2 = {
|
|
25445
25565
|
defaultValue: ""
|
|
25446
25566
|
};
|
|
25447
|
-
const VirtualInput = React$1.forwardRef((
|
|
25448
|
-
const
|
|
25449
|
-
|
|
25567
|
+
const VirtualInput = React$1.forwardRef((props, ref) => {
|
|
25568
|
+
const {
|
|
25569
|
+
locale,
|
|
25570
|
+
input: componentConfig = {}
|
|
25571
|
+
} = useConfig();
|
|
25572
|
+
const mergedProps = mergeProps(defaultProps$2, componentConfig, props);
|
|
25573
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
25450
25574
|
const rootRef = React$1.useRef(null);
|
|
25451
25575
|
const contentRef = React$1.useRef(null);
|
|
25452
25576
|
const [hasFocus, setHasFocus] = React$1.useState(false);
|
|
25453
|
-
const
|
|
25454
|
-
locale
|
|
25455
|
-
} = useConfig();
|
|
25577
|
+
const clearIcon = mergeProp(React$1.createElement(CloseCircleFill, null), componentConfig.clearIcon, props.clearIcon);
|
|
25456
25578
|
function scrollToEnd() {
|
|
25457
25579
|
const root2 = rootRef.current;
|
|
25458
25580
|
if (!root2)
|
|
@@ -25486,14 +25608,14 @@ const VirtualInput = React$1.forwardRef((p, ref) => {
|
|
|
25486
25608
|
function onFocus() {
|
|
25487
25609
|
var _a;
|
|
25488
25610
|
setHasFocus(true);
|
|
25489
|
-
(_a =
|
|
25611
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25490
25612
|
}
|
|
25491
25613
|
function onBlur() {
|
|
25492
25614
|
var _a;
|
|
25493
25615
|
setHasFocus(false);
|
|
25494
|
-
(_a =
|
|
25616
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25495
25617
|
}
|
|
25496
|
-
const keyboard =
|
|
25618
|
+
const keyboard = mergedProps.keyboard;
|
|
25497
25619
|
const keyboardElement = keyboard && React$1.cloneElement(keyboard, {
|
|
25498
25620
|
onInput: (v) => {
|
|
25499
25621
|
var _a, _b;
|
|
@@ -25518,38 +25640,38 @@ const VirtualInput = React$1.forwardRef((p, ref) => {
|
|
|
25518
25640
|
},
|
|
25519
25641
|
getContainer: null
|
|
25520
25642
|
});
|
|
25521
|
-
return withNativeProps(
|
|
25643
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
25522
25644
|
ref: rootRef,
|
|
25523
25645
|
className: classNames(classPrefix$2, {
|
|
25524
|
-
[`${classPrefix$2}-disabled`]:
|
|
25646
|
+
[`${classPrefix$2}-disabled`]: mergedProps.disabled
|
|
25525
25647
|
}),
|
|
25526
|
-
tabIndex:
|
|
25648
|
+
tabIndex: mergedProps.disabled ? void 0 : 0,
|
|
25527
25649
|
role: "textbox",
|
|
25528
25650
|
onFocus,
|
|
25529
25651
|
onBlur,
|
|
25530
|
-
onClick:
|
|
25652
|
+
onClick: mergedProps.onClick
|
|
25531
25653
|
}, React$1.createElement("div", {
|
|
25532
25654
|
className: `${classPrefix$2}-content`,
|
|
25533
25655
|
ref: contentRef,
|
|
25534
|
-
"aria-disabled":
|
|
25535
|
-
"aria-label":
|
|
25656
|
+
"aria-disabled": mergedProps.disabled,
|
|
25657
|
+
"aria-label": mergedProps.placeholder
|
|
25536
25658
|
}, value, React$1.createElement("div", {
|
|
25537
25659
|
className: `${classPrefix$2}-caret-container`
|
|
25538
25660
|
}, hasFocus && React$1.createElement("div", {
|
|
25539
25661
|
className: `${classPrefix$2}-caret`
|
|
25540
|
-
}))),
|
|
25662
|
+
}))), mergedProps.clearable && !!value && hasFocus && React$1.createElement("div", {
|
|
25541
25663
|
className: `${classPrefix$2}-clear`,
|
|
25542
25664
|
onClick: (e2) => {
|
|
25543
25665
|
var _a;
|
|
25544
25666
|
e2.stopPropagation();
|
|
25545
25667
|
setValue2("");
|
|
25546
|
-
(_a =
|
|
25668
|
+
(_a = mergedProps.onClear) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25547
25669
|
},
|
|
25548
25670
|
role: "button",
|
|
25549
25671
|
"aria-label": locale.Input.clear
|
|
25550
|
-
},
|
|
25672
|
+
}, clearIcon), [void 0, null, ""].includes(value) && React$1.createElement("div", {
|
|
25551
25673
|
className: `${classPrefix$2}-placeholder`
|
|
25552
|
-
},
|
|
25674
|
+
}, mergedProps.placeholder), keyboardElement));
|
|
25553
25675
|
});
|
|
25554
25676
|
const classPrefix$1 = `adm-water-mark`;
|
|
25555
25677
|
const defaultProps$1 = {
|