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
|
@@ -434,14 +434,24 @@ function withNativeProps(props, element) {
|
|
|
434
434
|
function mergeProps(...items) {
|
|
435
435
|
const ret = {};
|
|
436
436
|
items.forEach((item) => {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
437
|
+
if (item) {
|
|
438
|
+
Object.keys(item).forEach((key) => {
|
|
439
|
+
if (item[key] !== void 0) {
|
|
440
|
+
ret[key] = item[key];
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
}
|
|
442
444
|
});
|
|
443
445
|
return ret;
|
|
444
446
|
}
|
|
447
|
+
function mergeProp(defaultProp, ...propList) {
|
|
448
|
+
for (let i2 = propList.length - 1; i2 >= 0; i2 -= 1) {
|
|
449
|
+
if (propList[i2] !== void 0) {
|
|
450
|
+
return propList[i2];
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return defaultProp;
|
|
454
|
+
}
|
|
445
455
|
var createUpdateEffect = function(hook) {
|
|
446
456
|
return function(effect, deps) {
|
|
447
457
|
var isMounted = useRef(false);
|
|
@@ -5820,7 +5830,7 @@ const colorRecord$4 = {
|
|
|
5820
5830
|
black: "0, 0, 0",
|
|
5821
5831
|
white: "255, 255, 255"
|
|
5822
5832
|
};
|
|
5823
|
-
const defaultProps$
|
|
5833
|
+
const defaultProps$14 = {
|
|
5824
5834
|
visible: true,
|
|
5825
5835
|
destroyOnClose: false,
|
|
5826
5836
|
forceRender: false,
|
|
@@ -5831,7 +5841,7 @@ const defaultProps$15 = {
|
|
|
5831
5841
|
stopPropagation: ["click"]
|
|
5832
5842
|
};
|
|
5833
5843
|
const Mask = (p) => {
|
|
5834
|
-
const props = mergeProps(defaultProps$
|
|
5844
|
+
const props = mergeProps(defaultProps$14, p);
|
|
5835
5845
|
const {
|
|
5836
5846
|
locale
|
|
5837
5847
|
} = useConfig();
|
|
@@ -6493,6 +6503,7 @@ function TextDeletionOutline(props) {
|
|
|
6493
6503
|
}
|
|
6494
6504
|
const defaultPopupBaseProps = {
|
|
6495
6505
|
closeOnMaskClick: false,
|
|
6506
|
+
closeIcon: React__default.createElement(CloseOutline, null),
|
|
6496
6507
|
destroyOnClose: false,
|
|
6497
6508
|
disableBodyScroll: true,
|
|
6498
6509
|
forceRender: false,
|
|
@@ -8345,16 +8356,17 @@ function createUseGesture(actions) {
|
|
|
8345
8356
|
};
|
|
8346
8357
|
}
|
|
8347
8358
|
const classPrefix$1o = `adm-popup`;
|
|
8348
|
-
const defaultProps$
|
|
8359
|
+
const defaultProps$13 = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
8349
8360
|
closeOnSwipe: false,
|
|
8350
8361
|
position: "bottom"
|
|
8351
8362
|
});
|
|
8352
8363
|
const Popup = (p) => {
|
|
8353
|
-
const props = mergeProps(defaultProps$14, p);
|
|
8354
|
-
const bodyCls = classNames(`${classPrefix$1o}-body`, props.bodyClassName, `${classPrefix$1o}-body-position-${props.position}`);
|
|
8355
8364
|
const {
|
|
8356
|
-
locale
|
|
8365
|
+
locale,
|
|
8366
|
+
popup: componentConfig = {}
|
|
8357
8367
|
} = useConfig();
|
|
8368
|
+
const props = mergeProps(defaultProps$13, componentConfig, p);
|
|
8369
|
+
const bodyCls = classNames(`${classPrefix$1o}-body`, props.bodyClassName, `${classPrefix$1o}-body-position-${props.position}`);
|
|
8358
8370
|
const [active, setActive] = useState(props.visible);
|
|
8359
8371
|
const ref = useRef(null);
|
|
8360
8372
|
useLockScroll(ref, props.disableBodyScroll && active ? "strict" : false);
|
|
@@ -8451,7 +8463,7 @@ const Popup = (p) => {
|
|
|
8451
8463
|
},
|
|
8452
8464
|
role: "button",
|
|
8453
8465
|
"aria-label": locale.common.close
|
|
8454
|
-
},
|
|
8466
|
+
}, props.closeIcon), props.children))));
|
|
8455
8467
|
return React__default.createElement(ShouldRender, {
|
|
8456
8468
|
active,
|
|
8457
8469
|
forceRender: props.forceRender,
|
|
@@ -8594,7 +8606,7 @@ function renderImperatively(element) {
|
|
|
8594
8606
|
};
|
|
8595
8607
|
}
|
|
8596
8608
|
const classPrefix$1m = `adm-action-sheet`;
|
|
8597
|
-
const defaultProps$
|
|
8609
|
+
const defaultProps$12 = {
|
|
8598
8610
|
visible: false,
|
|
8599
8611
|
actions: [],
|
|
8600
8612
|
cancelText: "",
|
|
@@ -8605,7 +8617,7 @@ const defaultProps$13 = {
|
|
|
8605
8617
|
forceRender: false
|
|
8606
8618
|
};
|
|
8607
8619
|
const ActionSheet = (p) => {
|
|
8608
|
-
const props = mergeProps(defaultProps$
|
|
8620
|
+
const props = mergeProps(defaultProps$12, p);
|
|
8609
8621
|
const {
|
|
8610
8622
|
styles
|
|
8611
8623
|
} = props;
|
|
@@ -8778,7 +8790,7 @@ const BrokenImageIcon = () => React__default.createElement("svg", {
|
|
|
8778
8790
|
fillRule: "nonzero"
|
|
8779
8791
|
}));
|
|
8780
8792
|
const classPrefix$1k = `adm-image`;
|
|
8781
|
-
const defaultProps$
|
|
8793
|
+
const defaultProps$11 = {
|
|
8782
8794
|
fit: "fill",
|
|
8783
8795
|
placeholder: React__default.createElement("div", {
|
|
8784
8796
|
className: `${classPrefix$1k}-tip`
|
|
@@ -8790,7 +8802,7 @@ const defaultProps$12 = {
|
|
|
8790
8802
|
draggable: false
|
|
8791
8803
|
};
|
|
8792
8804
|
const Image$1 = staged_1((p) => {
|
|
8793
|
-
const props = mergeProps(defaultProps$
|
|
8805
|
+
const props = mergeProps(defaultProps$11, p);
|
|
8794
8806
|
const [loaded, setLoaded] = useState(false);
|
|
8795
8807
|
const [failed, setFailed] = useState(false);
|
|
8796
8808
|
const ref = useRef(null);
|
|
@@ -8867,12 +8879,12 @@ const Image$1 = staged_1((p) => {
|
|
|
8867
8879
|
}), renderInner()));
|
|
8868
8880
|
});
|
|
8869
8881
|
const classPrefix$1j = "adm-avatar";
|
|
8870
|
-
const defaultProps$
|
|
8882
|
+
const defaultProps$10 = {
|
|
8871
8883
|
fallback: React__default.createElement(Fallback, null),
|
|
8872
8884
|
fit: "cover"
|
|
8873
8885
|
};
|
|
8874
8886
|
const Avatar = (p) => {
|
|
8875
|
-
const props = mergeProps(defaultProps$
|
|
8887
|
+
const props = mergeProps(defaultProps$10, p);
|
|
8876
8888
|
return withNativeProps(props, React__default.createElement(Image$1, {
|
|
8877
8889
|
className: classPrefix$1j,
|
|
8878
8890
|
src: props.src,
|
|
@@ -8922,12 +8934,12 @@ const colorRecord$3 = {
|
|
|
8922
8934
|
primary: "var(--adm-color-primary)",
|
|
8923
8935
|
white: "var(--adm-color-white)"
|
|
8924
8936
|
};
|
|
8925
|
-
const defaultProps
|
|
8937
|
+
const defaultProps$$ = {
|
|
8926
8938
|
color: "default"
|
|
8927
8939
|
};
|
|
8928
8940
|
const DotLoading = memo((p) => {
|
|
8929
8941
|
var _a;
|
|
8930
|
-
const props = mergeProps(defaultProps
|
|
8942
|
+
const props = mergeProps(defaultProps$$, p);
|
|
8931
8943
|
return withNativeProps(props, React__default.createElement("div", {
|
|
8932
8944
|
style: {
|
|
8933
8945
|
color: (_a = colorRecord$3[props.color]) !== null && _a !== void 0 ? _a : props.color
|
|
@@ -8976,7 +8988,7 @@ function isIOS() {
|
|
|
8976
8988
|
return canUseDom$1 ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
|
8977
8989
|
}
|
|
8978
8990
|
const classPrefix$1g = `adm-button`;
|
|
8979
|
-
const defaultProps
|
|
8991
|
+
const defaultProps$_ = {
|
|
8980
8992
|
color: "default",
|
|
8981
8993
|
fill: "solid",
|
|
8982
8994
|
block: false,
|
|
@@ -8989,7 +9001,7 @@ const defaultProps$$ = {
|
|
|
8989
9001
|
size: "middle"
|
|
8990
9002
|
};
|
|
8991
9003
|
const Button = forwardRef((p, ref) => {
|
|
8992
|
-
const props = mergeProps(defaultProps
|
|
9004
|
+
const props = mergeProps(defaultProps$_, p);
|
|
8993
9005
|
const [innerLoading, setInnerLoading] = useState(false);
|
|
8994
9006
|
const nativeButtonRef = useRef(null);
|
|
8995
9007
|
const loading = props.loading === "auto" ? innerLoading : props.loading;
|
|
@@ -9172,7 +9184,7 @@ function convertPageToDayjs$1(page) {
|
|
|
9172
9184
|
}
|
|
9173
9185
|
dayjs.extend(isoWeek);
|
|
9174
9186
|
const classPrefix$1f = "adm-calendar";
|
|
9175
|
-
const defaultProps$
|
|
9187
|
+
const defaultProps$Z = {
|
|
9176
9188
|
weekStartsOn: "Sunday",
|
|
9177
9189
|
defaultValue: null,
|
|
9178
9190
|
allowClear: true,
|
|
@@ -9183,7 +9195,7 @@ const defaultProps$_ = {
|
|
|
9183
9195
|
};
|
|
9184
9196
|
const Calendar = forwardRef((p, ref) => {
|
|
9185
9197
|
const today = dayjs();
|
|
9186
|
-
const props = mergeProps(defaultProps$
|
|
9198
|
+
const props = mergeProps(defaultProps$Z, p);
|
|
9187
9199
|
const {
|
|
9188
9200
|
locale
|
|
9189
9201
|
} = useConfig();
|
|
@@ -9381,19 +9393,6 @@ const Calendar = forwardRef((p, ref) => {
|
|
|
9381
9393
|
className: classPrefix$1f
|
|
9382
9394
|
}, header, mark, body));
|
|
9383
9395
|
});
|
|
9384
|
-
const classPrefix$1e = `adm-divider`;
|
|
9385
|
-
const defaultProps$Z = {
|
|
9386
|
-
contentPosition: "center",
|
|
9387
|
-
direction: "horizontal"
|
|
9388
|
-
};
|
|
9389
|
-
const Divider = (p) => {
|
|
9390
|
-
const props = mergeProps(defaultProps$Z, p);
|
|
9391
|
-
return withNativeProps(props, React__default.createElement("div", {
|
|
9392
|
-
className: classNames(classPrefix$1e, `${classPrefix$1e}-${props.direction}`, `${classPrefix$1e}-${props.contentPosition}`)
|
|
9393
|
-
}, props.children && React__default.createElement("div", {
|
|
9394
|
-
className: `${classPrefix$1e}-content`
|
|
9395
|
-
}, props.children)));
|
|
9396
|
-
};
|
|
9397
9396
|
var isSameOrBefore$1 = { exports: {} };
|
|
9398
9397
|
(function(module, exports) {
|
|
9399
9398
|
!function(e2, i2) {
|
|
@@ -9419,440 +9418,157 @@ function convertValueToRange(selectionMode, value) {
|
|
|
9419
9418
|
function convertPageToDayjs(page) {
|
|
9420
9419
|
return dayjs().year(page.year).month(page.month - 1).date(1);
|
|
9421
9420
|
}
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
usePopup: true,
|
|
9430
|
-
selectionMode: "single"
|
|
9431
|
-
};
|
|
9432
|
-
const CalendarPickerView = forwardRef((p, ref) => {
|
|
9433
|
-
var _a;
|
|
9434
|
-
const today = dayjs();
|
|
9435
|
-
const props = mergeProps(defaultProps$Y, p);
|
|
9436
|
-
const {
|
|
9437
|
-
locale
|
|
9438
|
-
} = useConfig();
|
|
9439
|
-
const markItems = [...locale.Calendar.markItems];
|
|
9440
|
-
if (props.weekStartsOn === "Sunday") {
|
|
9441
|
-
const item = markItems.pop();
|
|
9442
|
-
if (item)
|
|
9443
|
-
markItems.unshift(item);
|
|
9444
|
-
}
|
|
9445
|
-
const [dateRange, setDateRange] = usePropsValue({
|
|
9446
|
-
value: props.value === void 0 ? void 0 : convertValueToRange(props.selectionMode, props.value),
|
|
9447
|
-
defaultValue: convertValueToRange(props.selectionMode, props.defaultValue),
|
|
9448
|
-
onChange: (v) => {
|
|
9449
|
-
var _a2, _b;
|
|
9450
|
-
if (props.selectionMode === "single") {
|
|
9451
|
-
(_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, v ? v[0] : null);
|
|
9452
|
-
} else if (props.selectionMode === "range") {
|
|
9453
|
-
(_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, v);
|
|
9454
|
-
}
|
|
9421
|
+
function useEvent(callback) {
|
|
9422
|
+
var fnRef = React$1.useRef();
|
|
9423
|
+
fnRef.current = callback;
|
|
9424
|
+
var memoFn = React$1.useCallback(function() {
|
|
9425
|
+
var _fnRef$current;
|
|
9426
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9427
|
+
args[_key] = arguments[_key];
|
|
9455
9428
|
}
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9429
|
+
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
9430
|
+
}, []);
|
|
9431
|
+
return memoFn;
|
|
9432
|
+
}
|
|
9433
|
+
function _arrayWithHoles(arr) {
|
|
9434
|
+
if (Array.isArray(arr))
|
|
9435
|
+
return arr;
|
|
9436
|
+
}
|
|
9437
|
+
function _iterableToArrayLimit(r, l) {
|
|
9438
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
9439
|
+
if (null != t) {
|
|
9440
|
+
var e2, n2, i2, u, a = [], f = true, o = false;
|
|
9441
|
+
try {
|
|
9442
|
+
if (i2 = (t = t.call(r)).next, 0 === l) {
|
|
9443
|
+
if (Object(t) !== t)
|
|
9444
|
+
return;
|
|
9445
|
+
f = false;
|
|
9446
|
+
} else
|
|
9447
|
+
for (; !(f = (e2 = i2.call(t)).done) && (a.push(e2.value), a.length !== l); f = true)
|
|
9448
|
+
;
|
|
9449
|
+
} catch (r2) {
|
|
9450
|
+
o = true, n2 = r2;
|
|
9451
|
+
} finally {
|
|
9452
|
+
try {
|
|
9453
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u))
|
|
9454
|
+
return;
|
|
9455
|
+
} finally {
|
|
9456
|
+
if (o)
|
|
9457
|
+
throw n2;
|
|
9469
9458
|
}
|
|
9470
|
-
setCurrent(convertPageToDayjs(page));
|
|
9471
|
-
},
|
|
9472
|
-
jumpToToday: () => {
|
|
9473
|
-
setCurrent(dayjs().date(1));
|
|
9474
|
-
},
|
|
9475
|
-
getDateRange: () => dateRange
|
|
9476
|
-
}));
|
|
9477
|
-
const header = React__default.createElement("div", {
|
|
9478
|
-
className: `${classPrefix$1d}-header`
|
|
9479
|
-
}, React__default.createElement("div", {
|
|
9480
|
-
className: `${classPrefix$1d}-title`
|
|
9481
|
-
}, (_a = props.title) !== null && _a !== void 0 ? _a : locale.Calendar.title));
|
|
9482
|
-
const maxDay = useMemo(() => props.max ? dayjs(props.max) : current.add(6, "month"), [props.max, current]);
|
|
9483
|
-
const minDay = useMemo(() => props.min ? dayjs(props.min) : current, [props.min, current]);
|
|
9484
|
-
function renderBody() {
|
|
9485
|
-
var _a2;
|
|
9486
|
-
const cells = [];
|
|
9487
|
-
let monthIterator = minDay;
|
|
9488
|
-
while (monthIterator.isSameOrBefore(maxDay, "month")) {
|
|
9489
|
-
const year = monthIterator.year();
|
|
9490
|
-
const month = monthIterator.month();
|
|
9491
|
-
const renderMap = {
|
|
9492
|
-
year,
|
|
9493
|
-
month: month + 1
|
|
9494
|
-
};
|
|
9495
|
-
cells.push(React__default.createElement("div", {
|
|
9496
|
-
key: `${year}-${month}`
|
|
9497
|
-
}, React__default.createElement("div", {
|
|
9498
|
-
className: `${classPrefix$1d}-title`
|
|
9499
|
-
}, (_a2 = locale.Calendar.yearAndMonth) === null || _a2 === void 0 ? void 0 : _a2.replace(/\${(.*?)}/g, (_, variable) => {
|
|
9500
|
-
var _a3;
|
|
9501
|
-
return (_a3 = renderMap[variable]) === null || _a3 === void 0 ? void 0 : _a3.toString();
|
|
9502
|
-
})), React__default.createElement("div", {
|
|
9503
|
-
className: `${classPrefix$1d}-cells`
|
|
9504
|
-
}, Array(props.weekStartsOn === "Monday" ? monthIterator.date(1).isoWeekday() - 1 : monthIterator.date(1).isoWeekday()).fill(null).map((_, index2) => React__default.createElement("div", {
|
|
9505
|
-
key: index2,
|
|
9506
|
-
className: `${classPrefix$1d}-cell`
|
|
9507
|
-
})), Array(monthIterator.daysInMonth()).fill(null).map((_, index2) => {
|
|
9508
|
-
var _a3;
|
|
9509
|
-
const d = monthIterator.date(index2 + 1);
|
|
9510
|
-
let isSelect = false;
|
|
9511
|
-
let isBegin = false;
|
|
9512
|
-
let isEnd = false;
|
|
9513
|
-
let isSelectRowBegin = false;
|
|
9514
|
-
let isSelectRowEnd = false;
|
|
9515
|
-
if (dateRange) {
|
|
9516
|
-
const [begin, end] = dateRange;
|
|
9517
|
-
isBegin = d.isSame(begin, "day");
|
|
9518
|
-
isEnd = d.isSame(end, "day");
|
|
9519
|
-
isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
|
|
9520
|
-
if (isSelect) {
|
|
9521
|
-
isSelectRowBegin = (cells.length % 7 === 0 || d.isSame(d.startOf("month"), "day")) && !isBegin;
|
|
9522
|
-
isSelectRowEnd = (cells.length % 7 === 6 || d.isSame(d.endOf("month"), "day")) && !isEnd;
|
|
9523
|
-
}
|
|
9524
|
-
}
|
|
9525
|
-
const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
|
|
9526
|
-
const renderTop = () => {
|
|
9527
|
-
var _a4;
|
|
9528
|
-
const top = (_a4 = props.renderTop) === null || _a4 === void 0 ? void 0 : _a4.call(props, d.toDate());
|
|
9529
|
-
if (top) {
|
|
9530
|
-
return top;
|
|
9531
|
-
}
|
|
9532
|
-
if (props.selectionMode === "range") {
|
|
9533
|
-
if (isBegin) {
|
|
9534
|
-
return locale.Calendar.start;
|
|
9535
|
-
}
|
|
9536
|
-
if (isEnd) {
|
|
9537
|
-
return locale.Calendar.end;
|
|
9538
|
-
}
|
|
9539
|
-
}
|
|
9540
|
-
if (d.isSame(today, "day") && !isSelect) {
|
|
9541
|
-
return locale.Calendar.today;
|
|
9542
|
-
}
|
|
9543
|
-
};
|
|
9544
|
-
return React__default.createElement("div", {
|
|
9545
|
-
key: d.valueOf(),
|
|
9546
|
-
className: classNames(`${classPrefix$1d}-cell`, {
|
|
9547
|
-
[`${classPrefix$1d}-cell-today`]: d.isSame(today, "day"),
|
|
9548
|
-
[`${classPrefix$1d}-cell-selected`]: isSelect,
|
|
9549
|
-
[`${classPrefix$1d}-cell-selected-begin`]: isBegin,
|
|
9550
|
-
[`${classPrefix$1d}-cell-selected-end`]: isEnd,
|
|
9551
|
-
[`${classPrefix$1d}-cell-selected-row-begin`]: isSelectRowBegin,
|
|
9552
|
-
[`${classPrefix$1d}-cell-selected-row-end`]: isSelectRowEnd,
|
|
9553
|
-
[`${classPrefix$1d}-cell-disabled`]: !!disabled
|
|
9554
|
-
}),
|
|
9555
|
-
onClick: () => {
|
|
9556
|
-
if (!props.selectionMode)
|
|
9557
|
-
return;
|
|
9558
|
-
if (disabled)
|
|
9559
|
-
return;
|
|
9560
|
-
const date4 = d.toDate();
|
|
9561
|
-
function shouldClear() {
|
|
9562
|
-
if (!props.allowClear)
|
|
9563
|
-
return false;
|
|
9564
|
-
if (!dateRange)
|
|
9565
|
-
return false;
|
|
9566
|
-
const [begin, end] = dateRange;
|
|
9567
|
-
return d.isSame(begin, "date") && d.isSame(end, "day");
|
|
9568
|
-
}
|
|
9569
|
-
if (props.selectionMode === "single") {
|
|
9570
|
-
if (props.allowClear && shouldClear()) {
|
|
9571
|
-
setDateRange(null);
|
|
9572
|
-
return;
|
|
9573
|
-
}
|
|
9574
|
-
setDateRange([date4, date4]);
|
|
9575
|
-
} else if (props.selectionMode === "range") {
|
|
9576
|
-
if (!dateRange) {
|
|
9577
|
-
setDateRange([date4, date4]);
|
|
9578
|
-
setIntermediate(true);
|
|
9579
|
-
return;
|
|
9580
|
-
}
|
|
9581
|
-
if (shouldClear()) {
|
|
9582
|
-
setDateRange(null);
|
|
9583
|
-
setIntermediate(false);
|
|
9584
|
-
return;
|
|
9585
|
-
}
|
|
9586
|
-
if (intermediate) {
|
|
9587
|
-
const another = dateRange[0];
|
|
9588
|
-
setDateRange(another > date4 ? [date4, another] : [another, date4]);
|
|
9589
|
-
setIntermediate(false);
|
|
9590
|
-
} else {
|
|
9591
|
-
setDateRange([date4, date4]);
|
|
9592
|
-
setIntermediate(true);
|
|
9593
|
-
}
|
|
9594
|
-
}
|
|
9595
|
-
}
|
|
9596
|
-
}, React__default.createElement("div", {
|
|
9597
|
-
className: `${classPrefix$1d}-cell-top`
|
|
9598
|
-
}, renderTop()), React__default.createElement("div", {
|
|
9599
|
-
className: `${classPrefix$1d}-cell-date`
|
|
9600
|
-
}, props.renderDate ? props.renderDate(d.toDate()) : d.date()), React__default.createElement("div", {
|
|
9601
|
-
className: `${classPrefix$1d}-cell-bottom`
|
|
9602
|
-
}, (_a3 = props.renderBottom) === null || _a3 === void 0 ? void 0 : _a3.call(props, d.toDate())));
|
|
9603
|
-
}))));
|
|
9604
|
-
monthIterator = monthIterator.add(1, "month");
|
|
9605
9459
|
}
|
|
9606
|
-
return
|
|
9460
|
+
return a;
|
|
9607
9461
|
}
|
|
9608
|
-
const body = React__default.createElement("div", {
|
|
9609
|
-
className: `${classPrefix$1d}-body`
|
|
9610
|
-
}, renderBody());
|
|
9611
|
-
const mark = React__default.createElement("div", {
|
|
9612
|
-
className: `${classPrefix$1d}-mark`
|
|
9613
|
-
}, markItems.map((item, index2) => React__default.createElement("div", {
|
|
9614
|
-
key: index2,
|
|
9615
|
-
className: `${classPrefix$1d}-mark-cell`
|
|
9616
|
-
}, item)));
|
|
9617
|
-
return withNativeProps(props, React__default.createElement("div", {
|
|
9618
|
-
className: classPrefix$1d
|
|
9619
|
-
}, header, mark, body));
|
|
9620
|
-
});
|
|
9621
|
-
const classPrefix$1c = "adm-calendar-picker";
|
|
9622
|
-
const defaultProps$X = {
|
|
9623
|
-
weekStartsOn: "Sunday",
|
|
9624
|
-
defaultValue: null,
|
|
9625
|
-
allowClear: true,
|
|
9626
|
-
usePopup: true,
|
|
9627
|
-
selectionMode: "single"
|
|
9628
|
-
};
|
|
9629
|
-
const CalendarPicker = forwardRef((p, ref) => {
|
|
9630
|
-
const props = mergeProps(defaultProps$X, p);
|
|
9631
|
-
const {
|
|
9632
|
-
locale
|
|
9633
|
-
} = useConfig();
|
|
9634
|
-
const calendarRef = ref !== null && ref !== void 0 ? ref : useRef(null);
|
|
9635
|
-
const {
|
|
9636
|
-
visible,
|
|
9637
|
-
confirmText,
|
|
9638
|
-
popupClassName,
|
|
9639
|
-
popupStyle,
|
|
9640
|
-
popupBodyStyle,
|
|
9641
|
-
forceRender,
|
|
9642
|
-
closeOnMaskClick,
|
|
9643
|
-
onClose,
|
|
9644
|
-
onConfirm,
|
|
9645
|
-
onMaskClick,
|
|
9646
|
-
getContainer
|
|
9647
|
-
} = props, calendarViewProps = __rest(props, ["visible", "confirmText", "popupClassName", "popupStyle", "popupBodyStyle", "forceRender", "closeOnMaskClick", "onClose", "onConfirm", "onMaskClick", "getContainer"]);
|
|
9648
|
-
const footer = React__default.createElement("div", {
|
|
9649
|
-
className: `${classPrefix$1c}-footer`
|
|
9650
|
-
}, React__default.createElement(Divider, null), React__default.createElement("div", {
|
|
9651
|
-
className: `${classPrefix$1c}-footer-bottom`
|
|
9652
|
-
}, React__default.createElement(Button, {
|
|
9653
|
-
color: "primary",
|
|
9654
|
-
onClick: () => {
|
|
9655
|
-
var _a, _b, _c, _d;
|
|
9656
|
-
const dateRange = (_b = (_a = calendarRef.current) === null || _a === void 0 ? void 0 : _a.getDateRange()) !== null && _b !== void 0 ? _b : null;
|
|
9657
|
-
if (props.selectionMode === "single") {
|
|
9658
|
-
(_c = props.onConfirm) === null || _c === void 0 ? void 0 : _c.call(props, dateRange ? dateRange[0] : null);
|
|
9659
|
-
} else if (props.selectionMode === "range") {
|
|
9660
|
-
(_d = props.onConfirm) === null || _d === void 0 ? void 0 : _d.call(props, dateRange);
|
|
9661
|
-
}
|
|
9662
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
9663
|
-
}
|
|
9664
|
-
}, confirmText !== null && confirmText !== void 0 ? confirmText : locale.Calendar.confirm)));
|
|
9665
|
-
return withNativeProps(props, React__default.createElement("div", {
|
|
9666
|
-
className: classPrefix$1c
|
|
9667
|
-
}, React__default.createElement(Popup, {
|
|
9668
|
-
visible,
|
|
9669
|
-
className: classNames(`${classPrefix$1c}-popup`, popupClassName),
|
|
9670
|
-
showCloseButton: true,
|
|
9671
|
-
forceRender: ref ? true : forceRender,
|
|
9672
|
-
style: popupStyle,
|
|
9673
|
-
bodyStyle: Object.assign({
|
|
9674
|
-
borderTopLeftRadius: "8px",
|
|
9675
|
-
borderTopRightRadius: "8px",
|
|
9676
|
-
minHeight: "80vh",
|
|
9677
|
-
overflow: "auto"
|
|
9678
|
-
}, popupBodyStyle),
|
|
9679
|
-
onClose,
|
|
9680
|
-
onMaskClick: () => {
|
|
9681
|
-
onMaskClick === null || onMaskClick === void 0 ? void 0 : onMaskClick();
|
|
9682
|
-
if (closeOnMaskClick) {
|
|
9683
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
9684
|
-
}
|
|
9685
|
-
},
|
|
9686
|
-
getContainer
|
|
9687
|
-
}, React__default.createElement(CalendarPickerView, Object.assign({
|
|
9688
|
-
ref: calendarRef
|
|
9689
|
-
}, calendarViewProps)), footer)));
|
|
9690
|
-
});
|
|
9691
|
-
function useResizeEffect(effect, targetRef) {
|
|
9692
|
-
const fn = useMemoizedFn(effect);
|
|
9693
|
-
useIsomorphicLayoutEffect$2(() => {
|
|
9694
|
-
const target = targetRef.current;
|
|
9695
|
-
if (!target)
|
|
9696
|
-
return;
|
|
9697
|
-
if (window.ResizeObserver) {
|
|
9698
|
-
let animationFrame;
|
|
9699
|
-
const observer = new ResizeObserver(() => {
|
|
9700
|
-
animationFrame = window.requestAnimationFrame(() => fn(target));
|
|
9701
|
-
});
|
|
9702
|
-
observer.observe(target);
|
|
9703
|
-
return () => {
|
|
9704
|
-
window.cancelAnimationFrame(animationFrame);
|
|
9705
|
-
observer.disconnect();
|
|
9706
|
-
};
|
|
9707
|
-
} else {
|
|
9708
|
-
fn(target);
|
|
9709
|
-
}
|
|
9710
|
-
}, [targetRef]);
|
|
9711
9462
|
}
|
|
9712
|
-
function
|
|
9713
|
-
if (
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
return () => {
|
|
9719
|
-
if (observer) {
|
|
9720
|
-
observer.disconnect();
|
|
9721
|
-
observer = null;
|
|
9722
|
-
}
|
|
9723
|
-
};
|
|
9724
|
-
}
|
|
9725
|
-
return () => {
|
|
9726
|
-
};
|
|
9463
|
+
function _arrayLikeToArray(arr, len) {
|
|
9464
|
+
if (len == null || len > arr.length)
|
|
9465
|
+
len = arr.length;
|
|
9466
|
+
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
|
|
9467
|
+
arr2[i2] = arr[i2];
|
|
9468
|
+
return arr2;
|
|
9727
9469
|
}
|
|
9728
|
-
function
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
return
|
|
9733
|
-
|
|
9470
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
9471
|
+
if (!o)
|
|
9472
|
+
return;
|
|
9473
|
+
if (typeof o === "string")
|
|
9474
|
+
return _arrayLikeToArray(o, minLen);
|
|
9475
|
+
var n2 = Object.prototype.toString.call(o).slice(8, -1);
|
|
9476
|
+
if (n2 === "Object" && o.constructor)
|
|
9477
|
+
n2 = o.constructor.name;
|
|
9478
|
+
if (n2 === "Map" || n2 === "Set")
|
|
9479
|
+
return Array.from(o);
|
|
9480
|
+
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
9481
|
+
return _arrayLikeToArray(o, minLen);
|
|
9734
9482
|
}
|
|
9735
|
-
function
|
|
9736
|
-
|
|
9737
|
-
if (min2 !== void 0) {
|
|
9738
|
-
ret = Math.max(position, min2);
|
|
9739
|
-
}
|
|
9740
|
-
if (max2 !== void 0) {
|
|
9741
|
-
ret = Math.min(ret, max2);
|
|
9742
|
-
}
|
|
9743
|
-
return ret;
|
|
9483
|
+
function _nonIterableRest() {
|
|
9484
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
9744
9485
|
}
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
const activeTab = activeTabWrapper.children.item(0);
|
|
9763
|
-
const activeTabLeft = activeTab.offsetLeft;
|
|
9764
|
-
const activeTabWidth = activeTab.offsetWidth;
|
|
9765
|
-
const containerWidth = container.offsetWidth;
|
|
9766
|
-
const containerScrollWidth = container.scrollWidth;
|
|
9767
|
-
const containerScrollLeft = container.scrollLeft;
|
|
9768
|
-
const maxScrollDistance = containerScrollWidth - containerWidth;
|
|
9769
|
-
if (maxScrollDistance <= 0)
|
|
9770
|
-
return;
|
|
9771
|
-
const nextScrollLeft = bound(activeTabLeft - (containerWidth - activeTabWidth) / 2, 0, containerScrollWidth - containerWidth);
|
|
9772
|
-
api.start({
|
|
9773
|
-
scrollLeft: nextScrollLeft,
|
|
9774
|
-
from: {
|
|
9775
|
-
scrollLeft: containerScrollLeft
|
|
9776
|
-
},
|
|
9777
|
-
immediate: immediate && !scrollLeft.isAnimating
|
|
9778
|
-
});
|
|
9779
|
-
}
|
|
9780
|
-
useIsomorphicLayoutEffect$2(() => {
|
|
9781
|
-
animate(true);
|
|
9486
|
+
function _slicedToArray(arr, i2) {
|
|
9487
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
|
|
9488
|
+
}
|
|
9489
|
+
function canUseDom() {
|
|
9490
|
+
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
9491
|
+
}
|
|
9492
|
+
var useInternalLayoutEffect = canUseDom() ? React$1.useLayoutEffect : React$1.useEffect;
|
|
9493
|
+
var useLayoutEffect = function useLayoutEffect2(callback, deps) {
|
|
9494
|
+
var firstMountRef = React$1.useRef(true);
|
|
9495
|
+
useInternalLayoutEffect(function() {
|
|
9496
|
+
return callback(firstMountRef.current);
|
|
9497
|
+
}, deps);
|
|
9498
|
+
useInternalLayoutEffect(function() {
|
|
9499
|
+
firstMountRef.current = false;
|
|
9500
|
+
return function() {
|
|
9501
|
+
firstMountRef.current = true;
|
|
9502
|
+
};
|
|
9782
9503
|
}, []);
|
|
9783
|
-
useIsomorphicUpdateLayoutEffect(() => {
|
|
9784
|
-
animate();
|
|
9785
|
-
}, [activeIndex]);
|
|
9786
|
-
useMutationEffect(() => {
|
|
9787
|
-
animate(true);
|
|
9788
|
-
}, targetRef, {
|
|
9789
|
-
subtree: true,
|
|
9790
|
-
childList: true,
|
|
9791
|
-
characterData: true
|
|
9792
|
-
});
|
|
9793
|
-
return {
|
|
9794
|
-
scrollLeft,
|
|
9795
|
-
animate
|
|
9796
|
-
};
|
|
9797
9504
|
};
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
leftMaskOpacity,
|
|
9803
|
-
rightMaskOpacity
|
|
9804
|
-
}, api] = useSpring(() => ({
|
|
9805
|
-
leftMaskOpacity: 0,
|
|
9806
|
-
rightMaskOpacity: 0,
|
|
9807
|
-
config: {
|
|
9808
|
-
clamp: true
|
|
9505
|
+
var useLayoutUpdateEffect = function useLayoutUpdateEffect2(callback, deps) {
|
|
9506
|
+
useLayoutEffect(function(firstMount) {
|
|
9507
|
+
if (!firstMount) {
|
|
9508
|
+
return callback();
|
|
9809
9509
|
}
|
|
9810
|
-
})
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
const scrollLeft = scrollEl.scrollLeft;
|
|
9821
|
-
const showLeftMask = scrollLeft > 0;
|
|
9822
|
-
const showRightMask = scrollLeft + scrollEl.offsetWidth < scrollEl.scrollWidth;
|
|
9823
|
-
api.start({
|
|
9824
|
-
leftMaskOpacity: showLeftMask ? 1 : 0,
|
|
9825
|
-
rightMaskOpacity: showRightMask ? 1 : 0,
|
|
9826
|
-
immediate
|
|
9827
|
-
});
|
|
9828
|
-
}, {
|
|
9829
|
-
wait: 100,
|
|
9830
|
-
trailing: true,
|
|
9831
|
-
leading: true
|
|
9832
|
-
});
|
|
9833
|
-
useEffect(() => {
|
|
9834
|
-
updateMask(true);
|
|
9510
|
+
}, deps);
|
|
9511
|
+
};
|
|
9512
|
+
function useSafeState(defaultValue) {
|
|
9513
|
+
var destroyRef = React$1.useRef(false);
|
|
9514
|
+
var _React$useState = React$1.useState(defaultValue), _React$useState2 = _slicedToArray(_React$useState, 2), value = _React$useState2[0], setValue2 = _React$useState2[1];
|
|
9515
|
+
React$1.useEffect(function() {
|
|
9516
|
+
destroyRef.current = false;
|
|
9517
|
+
return function() {
|
|
9518
|
+
destroyRef.current = true;
|
|
9519
|
+
};
|
|
9835
9520
|
}, []);
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
if (!scrollEl)
|
|
9521
|
+
function safeSetState(updater, ignoreDestroy) {
|
|
9522
|
+
if (ignoreDestroy && destroyRef.current) {
|
|
9839
9523
|
return;
|
|
9840
|
-
scrollEl.addEventListener("scroll", updateMask);
|
|
9841
|
-
return () => scrollEl.removeEventListener("scroll", updateMask);
|
|
9842
|
-
}, []);
|
|
9843
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(animated.div, {
|
|
9844
|
-
ref: maskRef,
|
|
9845
|
-
className: classNames(classPrefix$1b, `${classPrefix$1b}-left`),
|
|
9846
|
-
style: {
|
|
9847
|
-
opacity: leftMaskOpacity
|
|
9848
9524
|
}
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9525
|
+
setValue2(updater);
|
|
9526
|
+
}
|
|
9527
|
+
return [value, safeSetState];
|
|
9528
|
+
}
|
|
9529
|
+
function hasValue(value) {
|
|
9530
|
+
return value !== void 0;
|
|
9531
|
+
}
|
|
9532
|
+
function useMergedState(defaultStateValue, option) {
|
|
9533
|
+
var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState;
|
|
9534
|
+
var _useState = useSafeState(function() {
|
|
9535
|
+
if (hasValue(value)) {
|
|
9536
|
+
return value;
|
|
9537
|
+
} else if (hasValue(defaultValue)) {
|
|
9538
|
+
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
9539
|
+
} else {
|
|
9540
|
+
return typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue;
|
|
9853
9541
|
}
|
|
9854
|
-
}));
|
|
9855
|
-
|
|
9542
|
+
}), _useState2 = _slicedToArray(_useState, 2), innerValue = _useState2[0], setInnerValue = _useState2[1];
|
|
9543
|
+
var mergedValue = value !== void 0 ? value : innerValue;
|
|
9544
|
+
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
|
|
9545
|
+
var onChangeFn = useEvent(onChange);
|
|
9546
|
+
var _useState3 = useSafeState([mergedValue]), _useState4 = _slicedToArray(_useState3, 2), prevValue = _useState4[0], setPrevValue = _useState4[1];
|
|
9547
|
+
useLayoutUpdateEffect(function() {
|
|
9548
|
+
var prev = prevValue[0];
|
|
9549
|
+
if (innerValue !== prev) {
|
|
9550
|
+
onChangeFn(innerValue, prev);
|
|
9551
|
+
}
|
|
9552
|
+
}, [prevValue]);
|
|
9553
|
+
useLayoutUpdateEffect(function() {
|
|
9554
|
+
if (!hasValue(value)) {
|
|
9555
|
+
setInnerValue(value);
|
|
9556
|
+
}
|
|
9557
|
+
}, [value]);
|
|
9558
|
+
var triggerChange = useEvent(function(updater, ignoreDestroy) {
|
|
9559
|
+
setInnerValue(updater, ignoreDestroy);
|
|
9560
|
+
setPrevValue([mergedValue], ignoreDestroy);
|
|
9561
|
+
});
|
|
9562
|
+
return [postMergedValue, triggerChange];
|
|
9563
|
+
}
|
|
9564
|
+
function _typeof$1(o) {
|
|
9565
|
+
"@babel/helpers - typeof";
|
|
9566
|
+
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
9567
|
+
return typeof o2;
|
|
9568
|
+
} : function(o2) {
|
|
9569
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
9570
|
+
}, _typeof$1(o);
|
|
9571
|
+
}
|
|
9856
9572
|
var reactIs = { exports: {} };
|
|
9857
9573
|
var reactIs_development = {};
|
|
9858
9574
|
/**
|
|
@@ -9999,49 +9715,694 @@ var reactIs_development = {};
|
|
|
9999
9715
|
function isProfiler(object4) {
|
|
10000
9716
|
return typeOf(object4) === REACT_PROFILER_TYPE;
|
|
10001
9717
|
}
|
|
10002
|
-
function isStrictMode(object4) {
|
|
10003
|
-
return typeOf(object4) === REACT_STRICT_MODE_TYPE;
|
|
9718
|
+
function isStrictMode(object4) {
|
|
9719
|
+
return typeOf(object4) === REACT_STRICT_MODE_TYPE;
|
|
9720
|
+
}
|
|
9721
|
+
function isSuspense(object4) {
|
|
9722
|
+
return typeOf(object4) === REACT_SUSPENSE_TYPE;
|
|
9723
|
+
}
|
|
9724
|
+
function isSuspenseList(object4) {
|
|
9725
|
+
return typeOf(object4) === REACT_SUSPENSE_LIST_TYPE;
|
|
9726
|
+
}
|
|
9727
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
9728
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
9729
|
+
reactIs_development.Element = Element2;
|
|
9730
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
9731
|
+
reactIs_development.Fragment = Fragment;
|
|
9732
|
+
reactIs_development.Lazy = Lazy;
|
|
9733
|
+
reactIs_development.Memo = Memo;
|
|
9734
|
+
reactIs_development.Portal = Portal;
|
|
9735
|
+
reactIs_development.Profiler = Profiler;
|
|
9736
|
+
reactIs_development.StrictMode = StrictMode;
|
|
9737
|
+
reactIs_development.Suspense = Suspense;
|
|
9738
|
+
reactIs_development.SuspenseList = SuspenseList;
|
|
9739
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
9740
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
9741
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
9742
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
9743
|
+
reactIs_development.isElement = isElement2;
|
|
9744
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
9745
|
+
reactIs_development.isFragment = isFragment;
|
|
9746
|
+
reactIs_development.isLazy = isLazy;
|
|
9747
|
+
reactIs_development.isMemo = isMemo;
|
|
9748
|
+
reactIs_development.isPortal = isPortal;
|
|
9749
|
+
reactIs_development.isProfiler = isProfiler;
|
|
9750
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
9751
|
+
reactIs_development.isSuspense = isSuspense;
|
|
9752
|
+
reactIs_development.isSuspenseList = isSuspenseList;
|
|
9753
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
9754
|
+
reactIs_development.typeOf = typeOf;
|
|
9755
|
+
})();
|
|
9756
|
+
}
|
|
9757
|
+
{
|
|
9758
|
+
reactIs.exports = reactIs_development;
|
|
9759
|
+
}
|
|
9760
|
+
var reactIsExports = reactIs.exports;
|
|
9761
|
+
function get(entity, path) {
|
|
9762
|
+
var current = entity;
|
|
9763
|
+
for (var i2 = 0; i2 < path.length; i2 += 1) {
|
|
9764
|
+
if (current === null || current === void 0) {
|
|
9765
|
+
return void 0;
|
|
9766
|
+
}
|
|
9767
|
+
current = current[path[i2]];
|
|
9768
|
+
}
|
|
9769
|
+
return current;
|
|
9770
|
+
}
|
|
9771
|
+
function _toPrimitive(input, hint) {
|
|
9772
|
+
if (_typeof$1(input) !== "object" || input === null)
|
|
9773
|
+
return input;
|
|
9774
|
+
var prim = input[Symbol.toPrimitive];
|
|
9775
|
+
if (prim !== void 0) {
|
|
9776
|
+
var res = prim.call(input, hint || "default");
|
|
9777
|
+
if (_typeof$1(res) !== "object")
|
|
9778
|
+
return res;
|
|
9779
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
9780
|
+
}
|
|
9781
|
+
return (hint === "string" ? String : Number)(input);
|
|
9782
|
+
}
|
|
9783
|
+
function _toPropertyKey(arg) {
|
|
9784
|
+
var key = _toPrimitive(arg, "string");
|
|
9785
|
+
return _typeof$1(key) === "symbol" ? key : String(key);
|
|
9786
|
+
}
|
|
9787
|
+
function _defineProperty(obj, key, value) {
|
|
9788
|
+
key = _toPropertyKey(key);
|
|
9789
|
+
if (key in obj) {
|
|
9790
|
+
Object.defineProperty(obj, key, {
|
|
9791
|
+
value,
|
|
9792
|
+
enumerable: true,
|
|
9793
|
+
configurable: true,
|
|
9794
|
+
writable: true
|
|
9795
|
+
});
|
|
9796
|
+
} else {
|
|
9797
|
+
obj[key] = value;
|
|
9798
|
+
}
|
|
9799
|
+
return obj;
|
|
9800
|
+
}
|
|
9801
|
+
function ownKeys(e2, r) {
|
|
9802
|
+
var t = Object.keys(e2);
|
|
9803
|
+
if (Object.getOwnPropertySymbols) {
|
|
9804
|
+
var o = Object.getOwnPropertySymbols(e2);
|
|
9805
|
+
r && (o = o.filter(function(r2) {
|
|
9806
|
+
return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
|
|
9807
|
+
})), t.push.apply(t, o);
|
|
9808
|
+
}
|
|
9809
|
+
return t;
|
|
9810
|
+
}
|
|
9811
|
+
function _objectSpread2(e2) {
|
|
9812
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
9813
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
9814
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
9815
|
+
_defineProperty(e2, r2, t[r2]);
|
|
9816
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
9817
|
+
Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
9818
|
+
});
|
|
9819
|
+
}
|
|
9820
|
+
return e2;
|
|
9821
|
+
}
|
|
9822
|
+
function _arrayWithoutHoles(arr) {
|
|
9823
|
+
if (Array.isArray(arr))
|
|
9824
|
+
return _arrayLikeToArray(arr);
|
|
9825
|
+
}
|
|
9826
|
+
function _iterableToArray(iter) {
|
|
9827
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
9828
|
+
return Array.from(iter);
|
|
9829
|
+
}
|
|
9830
|
+
function _nonIterableSpread() {
|
|
9831
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
9832
|
+
}
|
|
9833
|
+
function _toConsumableArray(arr) {
|
|
9834
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
9835
|
+
}
|
|
9836
|
+
function _toArray(arr) {
|
|
9837
|
+
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
9838
|
+
}
|
|
9839
|
+
function internalSet(entity, paths, value, removeIfUndefined) {
|
|
9840
|
+
if (!paths.length) {
|
|
9841
|
+
return value;
|
|
9842
|
+
}
|
|
9843
|
+
var _paths = _toArray(paths), path = _paths[0], restPath = _paths.slice(1);
|
|
9844
|
+
var clone;
|
|
9845
|
+
if (!entity && typeof path === "number") {
|
|
9846
|
+
clone = [];
|
|
9847
|
+
} else if (Array.isArray(entity)) {
|
|
9848
|
+
clone = _toConsumableArray(entity);
|
|
9849
|
+
} else {
|
|
9850
|
+
clone = _objectSpread2({}, entity);
|
|
9851
|
+
}
|
|
9852
|
+
if (removeIfUndefined && value === void 0 && restPath.length === 1) {
|
|
9853
|
+
delete clone[path][restPath[0]];
|
|
9854
|
+
} else {
|
|
9855
|
+
clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
|
|
9856
|
+
}
|
|
9857
|
+
return clone;
|
|
9858
|
+
}
|
|
9859
|
+
function set(entity, paths, value) {
|
|
9860
|
+
var removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
9861
|
+
if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) {
|
|
9862
|
+
return entity;
|
|
9863
|
+
}
|
|
9864
|
+
return internalSet(entity, paths, value, removeIfUndefined);
|
|
9865
|
+
}
|
|
9866
|
+
var warned$1 = {};
|
|
9867
|
+
var preWarningFns$1 = [];
|
|
9868
|
+
var preMessage$1 = function preMessage2(fn) {
|
|
9869
|
+
preWarningFns$1.push(fn);
|
|
9870
|
+
};
|
|
9871
|
+
function warning$3(valid, message) {
|
|
9872
|
+
if (!valid && console !== void 0) {
|
|
9873
|
+
var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
|
|
9874
|
+
return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "warning");
|
|
9875
|
+
}, message);
|
|
9876
|
+
if (finalMessage) {
|
|
9877
|
+
console.error("Warning: ".concat(finalMessage));
|
|
9878
|
+
}
|
|
9879
|
+
}
|
|
9880
|
+
}
|
|
9881
|
+
function note$1(valid, message) {
|
|
9882
|
+
if (!valid && console !== void 0) {
|
|
9883
|
+
var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
|
|
9884
|
+
return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "note");
|
|
9885
|
+
}, message);
|
|
9886
|
+
if (finalMessage) {
|
|
9887
|
+
console.warn("Note: ".concat(finalMessage));
|
|
9888
|
+
}
|
|
9889
|
+
}
|
|
9890
|
+
}
|
|
9891
|
+
function resetWarned$1() {
|
|
9892
|
+
warned$1 = {};
|
|
9893
|
+
}
|
|
9894
|
+
function call$1(method4, valid, message) {
|
|
9895
|
+
if (!valid && !warned$1[message]) {
|
|
9896
|
+
method4(false, message);
|
|
9897
|
+
warned$1[message] = true;
|
|
9898
|
+
}
|
|
9899
|
+
}
|
|
9900
|
+
function warningOnce$1(valid, message) {
|
|
9901
|
+
call$1(warning$3, valid, message);
|
|
9902
|
+
}
|
|
9903
|
+
function noteOnce$1(valid, message) {
|
|
9904
|
+
call$1(note$1, valid, message);
|
|
9905
|
+
}
|
|
9906
|
+
warningOnce$1.preMessage = preMessage$1;
|
|
9907
|
+
warningOnce$1.resetWarned = resetWarned$1;
|
|
9908
|
+
warningOnce$1.noteOnce = noteOnce$1;
|
|
9909
|
+
function useSyncScroll(current, visible, bodyRef) {
|
|
9910
|
+
const rafRef = useRef();
|
|
9911
|
+
const clean = () => {
|
|
9912
|
+
if (rafRef.current) {
|
|
9913
|
+
cancelAnimationFrame(rafRef.current);
|
|
9914
|
+
}
|
|
9915
|
+
};
|
|
9916
|
+
const scrollTo = useEvent((date4) => {
|
|
9917
|
+
clean();
|
|
9918
|
+
rafRef.current = requestAnimationFrame(() => {
|
|
9919
|
+
if (bodyRef.current) {
|
|
9920
|
+
const yearMonth = date4.format("YYYY-M");
|
|
9921
|
+
const target = bodyRef.current.querySelector(`[data-year-month="${yearMonth}"]`);
|
|
9922
|
+
if (target) {
|
|
9923
|
+
target.scrollIntoView({
|
|
9924
|
+
block: "start",
|
|
9925
|
+
inline: "nearest"
|
|
9926
|
+
});
|
|
9927
|
+
}
|
|
9928
|
+
}
|
|
9929
|
+
});
|
|
9930
|
+
});
|
|
9931
|
+
useEffect(() => {
|
|
9932
|
+
if (visible && current) {
|
|
9933
|
+
scrollTo(current);
|
|
9934
|
+
return clean;
|
|
9935
|
+
}
|
|
9936
|
+
}, [current, visible]);
|
|
9937
|
+
return scrollTo;
|
|
9938
|
+
}
|
|
9939
|
+
dayjs.extend(isoWeek);
|
|
9940
|
+
dayjs.extend(isSameOrBefore);
|
|
9941
|
+
const classPrefix$1e = "adm-calendar-picker-view";
|
|
9942
|
+
const Context$2 = React__default.createContext({
|
|
9943
|
+
visible: false
|
|
9944
|
+
});
|
|
9945
|
+
const defaultProps$Y = {
|
|
9946
|
+
weekStartsOn: "Sunday",
|
|
9947
|
+
defaultValue: null,
|
|
9948
|
+
allowClear: true,
|
|
9949
|
+
usePopup: true,
|
|
9950
|
+
selectionMode: "single"
|
|
9951
|
+
};
|
|
9952
|
+
const CalendarPickerView = forwardRef((p, ref) => {
|
|
9953
|
+
var _a;
|
|
9954
|
+
const bodyRef = useRef(null);
|
|
9955
|
+
const today = dayjs();
|
|
9956
|
+
const props = mergeProps(defaultProps$Y, p);
|
|
9957
|
+
const {
|
|
9958
|
+
locale
|
|
9959
|
+
} = useConfig();
|
|
9960
|
+
const markItems = [...locale.Calendar.markItems];
|
|
9961
|
+
if (props.weekStartsOn === "Sunday") {
|
|
9962
|
+
const item = markItems.pop();
|
|
9963
|
+
if (item)
|
|
9964
|
+
markItems.unshift(item);
|
|
9965
|
+
}
|
|
9966
|
+
const [dateRange, setDateRange] = usePropsValue({
|
|
9967
|
+
value: props.value === void 0 ? void 0 : convertValueToRange(props.selectionMode, props.value),
|
|
9968
|
+
defaultValue: convertValueToRange(props.selectionMode, props.defaultValue),
|
|
9969
|
+
onChange: (v) => {
|
|
9970
|
+
var _a2, _b;
|
|
9971
|
+
if (props.selectionMode === "single") {
|
|
9972
|
+
(_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, v ? v[0] : null);
|
|
9973
|
+
} else if (props.selectionMode === "range") {
|
|
9974
|
+
(_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, v);
|
|
9975
|
+
}
|
|
9976
|
+
}
|
|
9977
|
+
});
|
|
9978
|
+
const [intermediate, setIntermediate] = useState(false);
|
|
9979
|
+
const [current, setCurrent] = useState(() => dayjs(dateRange ? dateRange[0] : today).date(1));
|
|
9980
|
+
const context = useContext(Context$2);
|
|
9981
|
+
const scrollTo = useSyncScroll(current, context.visible, bodyRef);
|
|
9982
|
+
const maxDay = useMemo(() => props.max ? dayjs(props.max) : current.add(6, "month"), [props.max, current]);
|
|
9983
|
+
const minDay = useMemo(() => props.min ? dayjs(props.min) : current, [props.min, current]);
|
|
9984
|
+
useImperativeHandle(ref, () => ({
|
|
9985
|
+
jumpTo: (pageOrPageGenerator) => {
|
|
9986
|
+
let page;
|
|
9987
|
+
if (typeof pageOrPageGenerator === "function") {
|
|
9988
|
+
page = pageOrPageGenerator({
|
|
9989
|
+
year: current.year(),
|
|
9990
|
+
month: current.month() + 1
|
|
9991
|
+
});
|
|
9992
|
+
} else {
|
|
9993
|
+
page = pageOrPageGenerator;
|
|
9994
|
+
}
|
|
9995
|
+
const next = convertPageToDayjs(page);
|
|
9996
|
+
setCurrent(next);
|
|
9997
|
+
scrollTo(next);
|
|
9998
|
+
},
|
|
9999
|
+
jumpToToday: () => {
|
|
10000
|
+
const next = dayjs().date(1);
|
|
10001
|
+
setCurrent(next);
|
|
10002
|
+
scrollTo(next);
|
|
10003
|
+
},
|
|
10004
|
+
getDateRange: () => dateRange
|
|
10005
|
+
}));
|
|
10006
|
+
const header = React__default.createElement("div", {
|
|
10007
|
+
className: `${classPrefix$1e}-header`
|
|
10008
|
+
}, React__default.createElement("div", {
|
|
10009
|
+
className: `${classPrefix$1e}-title`
|
|
10010
|
+
}, (_a = props.title) !== null && _a !== void 0 ? _a : locale.Calendar.title));
|
|
10011
|
+
function renderBody() {
|
|
10012
|
+
var _a2;
|
|
10013
|
+
const cells = [];
|
|
10014
|
+
let monthIterator = minDay;
|
|
10015
|
+
while (monthIterator.isSameOrBefore(maxDay, "month")) {
|
|
10016
|
+
const year = monthIterator.year();
|
|
10017
|
+
const month = monthIterator.month() + 1;
|
|
10018
|
+
const renderMap = {
|
|
10019
|
+
year,
|
|
10020
|
+
month
|
|
10021
|
+
};
|
|
10022
|
+
const yearMonth = `${year}-${month}`;
|
|
10023
|
+
const presetEmptyCellCount = props.weekStartsOn === "Monday" ? monthIterator.date(1).isoWeekday() - 1 : monthIterator.date(1).isoWeekday();
|
|
10024
|
+
const presetEmptyCells = presetEmptyCellCount == 7 ? null : Array(presetEmptyCellCount).fill(null).map((_, index2) => React__default.createElement("div", {
|
|
10025
|
+
key: index2,
|
|
10026
|
+
className: `${classPrefix$1e}-cell`
|
|
10027
|
+
}));
|
|
10028
|
+
cells.push(React__default.createElement("div", {
|
|
10029
|
+
key: yearMonth,
|
|
10030
|
+
"data-year-month": yearMonth
|
|
10031
|
+
}, React__default.createElement("div", {
|
|
10032
|
+
className: `${classPrefix$1e}-title`
|
|
10033
|
+
}, (_a2 = locale.Calendar.yearAndMonth) === null || _a2 === void 0 ? void 0 : _a2.replace(/\${(.*?)}/g, (_, variable) => {
|
|
10034
|
+
var _a3;
|
|
10035
|
+
return (_a3 = renderMap[variable]) === null || _a3 === void 0 ? void 0 : _a3.toString();
|
|
10036
|
+
})), React__default.createElement("div", {
|
|
10037
|
+
className: `${classPrefix$1e}-cells`
|
|
10038
|
+
}, presetEmptyCells, Array(monthIterator.daysInMonth()).fill(null).map((_, index2) => {
|
|
10039
|
+
var _a3;
|
|
10040
|
+
const d = monthIterator.date(index2 + 1);
|
|
10041
|
+
let isSelect = false;
|
|
10042
|
+
let isBegin = false;
|
|
10043
|
+
let isEnd = false;
|
|
10044
|
+
let isSelectRowBegin = false;
|
|
10045
|
+
let isSelectRowEnd = false;
|
|
10046
|
+
if (dateRange) {
|
|
10047
|
+
const [begin, end] = dateRange;
|
|
10048
|
+
isBegin = d.isSame(begin, "day");
|
|
10049
|
+
isEnd = d.isSame(end, "day");
|
|
10050
|
+
isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
|
|
10051
|
+
if (isSelect) {
|
|
10052
|
+
isSelectRowBegin = (cells.length % 7 === 0 || d.isSame(d.startOf("month"), "day")) && !isBegin;
|
|
10053
|
+
isSelectRowEnd = (cells.length % 7 === 6 || d.isSame(d.endOf("month"), "day")) && !isEnd;
|
|
10054
|
+
}
|
|
10055
|
+
}
|
|
10056
|
+
const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
|
|
10057
|
+
const renderTop = () => {
|
|
10058
|
+
var _a4;
|
|
10059
|
+
const top = (_a4 = props.renderTop) === null || _a4 === void 0 ? void 0 : _a4.call(props, d.toDate());
|
|
10060
|
+
if (top) {
|
|
10061
|
+
return top;
|
|
10062
|
+
}
|
|
10063
|
+
if (props.selectionMode === "range") {
|
|
10064
|
+
if (isBegin) {
|
|
10065
|
+
return locale.Calendar.start;
|
|
10066
|
+
}
|
|
10067
|
+
if (isEnd) {
|
|
10068
|
+
return locale.Calendar.end;
|
|
10069
|
+
}
|
|
10070
|
+
}
|
|
10071
|
+
if (d.isSame(today, "day") && !isSelect) {
|
|
10072
|
+
return locale.Calendar.today;
|
|
10073
|
+
}
|
|
10074
|
+
};
|
|
10075
|
+
return React__default.createElement("div", {
|
|
10076
|
+
key: d.valueOf(),
|
|
10077
|
+
className: classNames(`${classPrefix$1e}-cell`, {
|
|
10078
|
+
[`${classPrefix$1e}-cell-today`]: d.isSame(today, "day"),
|
|
10079
|
+
[`${classPrefix$1e}-cell-selected`]: isSelect,
|
|
10080
|
+
[`${classPrefix$1e}-cell-selected-begin`]: isBegin,
|
|
10081
|
+
[`${classPrefix$1e}-cell-selected-end`]: isEnd,
|
|
10082
|
+
[`${classPrefix$1e}-cell-selected-row-begin`]: isSelectRowBegin,
|
|
10083
|
+
[`${classPrefix$1e}-cell-selected-row-end`]: isSelectRowEnd,
|
|
10084
|
+
[`${classPrefix$1e}-cell-disabled`]: !!disabled
|
|
10085
|
+
}),
|
|
10086
|
+
onClick: () => {
|
|
10087
|
+
if (!props.selectionMode)
|
|
10088
|
+
return;
|
|
10089
|
+
if (disabled)
|
|
10090
|
+
return;
|
|
10091
|
+
const date4 = d.toDate();
|
|
10092
|
+
function shouldClear() {
|
|
10093
|
+
if (!props.allowClear)
|
|
10094
|
+
return false;
|
|
10095
|
+
if (!dateRange)
|
|
10096
|
+
return false;
|
|
10097
|
+
const [begin, end] = dateRange;
|
|
10098
|
+
return d.isSame(begin, "date") && d.isSame(end, "day");
|
|
10099
|
+
}
|
|
10100
|
+
if (props.selectionMode === "single") {
|
|
10101
|
+
if (props.allowClear && shouldClear()) {
|
|
10102
|
+
setDateRange(null);
|
|
10103
|
+
return;
|
|
10104
|
+
}
|
|
10105
|
+
setDateRange([date4, date4]);
|
|
10106
|
+
} else if (props.selectionMode === "range") {
|
|
10107
|
+
if (!dateRange) {
|
|
10108
|
+
setDateRange([date4, date4]);
|
|
10109
|
+
setIntermediate(true);
|
|
10110
|
+
return;
|
|
10111
|
+
}
|
|
10112
|
+
if (shouldClear()) {
|
|
10113
|
+
setDateRange(null);
|
|
10114
|
+
setIntermediate(false);
|
|
10115
|
+
return;
|
|
10116
|
+
}
|
|
10117
|
+
if (intermediate) {
|
|
10118
|
+
const another = dateRange[0];
|
|
10119
|
+
setDateRange(another > date4 ? [date4, another] : [another, date4]);
|
|
10120
|
+
setIntermediate(false);
|
|
10121
|
+
} else {
|
|
10122
|
+
setDateRange([date4, date4]);
|
|
10123
|
+
setIntermediate(true);
|
|
10124
|
+
}
|
|
10125
|
+
}
|
|
10126
|
+
}
|
|
10127
|
+
}, React__default.createElement("div", {
|
|
10128
|
+
className: `${classPrefix$1e}-cell-top`
|
|
10129
|
+
}, renderTop()), React__default.createElement("div", {
|
|
10130
|
+
className: `${classPrefix$1e}-cell-date`
|
|
10131
|
+
}, props.renderDate ? props.renderDate(d.toDate()) : d.date()), React__default.createElement("div", {
|
|
10132
|
+
className: `${classPrefix$1e}-cell-bottom`
|
|
10133
|
+
}, (_a3 = props.renderBottom) === null || _a3 === void 0 ? void 0 : _a3.call(props, d.toDate())));
|
|
10134
|
+
}))));
|
|
10135
|
+
monthIterator = monthIterator.add(1, "month");
|
|
10136
|
+
}
|
|
10137
|
+
return cells;
|
|
10138
|
+
}
|
|
10139
|
+
const body = React__default.createElement("div", {
|
|
10140
|
+
className: `${classPrefix$1e}-body`,
|
|
10141
|
+
ref: bodyRef
|
|
10142
|
+
}, renderBody());
|
|
10143
|
+
const mark = React__default.createElement("div", {
|
|
10144
|
+
className: `${classPrefix$1e}-mark`
|
|
10145
|
+
}, markItems.map((item, index2) => React__default.createElement("div", {
|
|
10146
|
+
key: index2,
|
|
10147
|
+
className: `${classPrefix$1e}-mark-cell`
|
|
10148
|
+
}, item)));
|
|
10149
|
+
return withNativeProps(props, React__default.createElement("div", {
|
|
10150
|
+
className: classPrefix$1e
|
|
10151
|
+
}, header, mark, body));
|
|
10152
|
+
});
|
|
10153
|
+
const classPrefix$1d = `adm-divider`;
|
|
10154
|
+
const defaultProps$X = {
|
|
10155
|
+
contentPosition: "center",
|
|
10156
|
+
direction: "horizontal"
|
|
10157
|
+
};
|
|
10158
|
+
const Divider = (p) => {
|
|
10159
|
+
const props = mergeProps(defaultProps$X, p);
|
|
10160
|
+
return withNativeProps(props, React__default.createElement("div", {
|
|
10161
|
+
className: classNames(classPrefix$1d, `${classPrefix$1d}-${props.direction}`, `${classPrefix$1d}-${props.contentPosition}`)
|
|
10162
|
+
}, props.children && React__default.createElement("div", {
|
|
10163
|
+
className: `${classPrefix$1d}-content`
|
|
10164
|
+
}, props.children)));
|
|
10165
|
+
};
|
|
10166
|
+
const classPrefix$1c = "adm-calendar-picker";
|
|
10167
|
+
const defaultProps$W = {
|
|
10168
|
+
weekStartsOn: "Sunday",
|
|
10169
|
+
defaultValue: null,
|
|
10170
|
+
allowClear: true,
|
|
10171
|
+
usePopup: true,
|
|
10172
|
+
selectionMode: "single"
|
|
10173
|
+
};
|
|
10174
|
+
const CalendarPicker = forwardRef((p, ref) => {
|
|
10175
|
+
const props = mergeProps(defaultProps$W, p);
|
|
10176
|
+
const {
|
|
10177
|
+
locale
|
|
10178
|
+
} = useConfig();
|
|
10179
|
+
const calendarRef = ref !== null && ref !== void 0 ? ref : useRef(null);
|
|
10180
|
+
const {
|
|
10181
|
+
visible,
|
|
10182
|
+
confirmText,
|
|
10183
|
+
popupClassName,
|
|
10184
|
+
popupStyle,
|
|
10185
|
+
popupBodyStyle,
|
|
10186
|
+
forceRender,
|
|
10187
|
+
closeOnMaskClick,
|
|
10188
|
+
onClose,
|
|
10189
|
+
onConfirm,
|
|
10190
|
+
onMaskClick,
|
|
10191
|
+
getContainer
|
|
10192
|
+
} = props, calendarViewProps = __rest(props, ["visible", "confirmText", "popupClassName", "popupStyle", "popupBodyStyle", "forceRender", "closeOnMaskClick", "onClose", "onConfirm", "onMaskClick", "getContainer"]);
|
|
10193
|
+
const viewContext = React__default.useMemo(() => ({
|
|
10194
|
+
visible: !!visible
|
|
10195
|
+
}), [visible]);
|
|
10196
|
+
const footer = React__default.createElement("div", {
|
|
10197
|
+
className: `${classPrefix$1c}-footer`
|
|
10198
|
+
}, React__default.createElement(Divider, null), React__default.createElement("div", {
|
|
10199
|
+
className: `${classPrefix$1c}-footer-bottom`
|
|
10200
|
+
}, React__default.createElement(Button, {
|
|
10201
|
+
color: "primary",
|
|
10202
|
+
onClick: () => {
|
|
10203
|
+
var _a, _b, _c, _d;
|
|
10204
|
+
const dateRange = (_b = (_a = calendarRef.current) === null || _a === void 0 ? void 0 : _a.getDateRange()) !== null && _b !== void 0 ? _b : null;
|
|
10205
|
+
if (props.selectionMode === "single") {
|
|
10206
|
+
(_c = props.onConfirm) === null || _c === void 0 ? void 0 : _c.call(props, dateRange ? dateRange[0] : null);
|
|
10207
|
+
} else if (props.selectionMode === "range") {
|
|
10208
|
+
(_d = props.onConfirm) === null || _d === void 0 ? void 0 : _d.call(props, dateRange);
|
|
10209
|
+
}
|
|
10210
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
10211
|
+
}
|
|
10212
|
+
}, confirmText !== null && confirmText !== void 0 ? confirmText : locale.Calendar.confirm)));
|
|
10213
|
+
return withNativeProps(props, React__default.createElement("div", {
|
|
10214
|
+
className: classPrefix$1c
|
|
10215
|
+
}, React__default.createElement(Popup, {
|
|
10216
|
+
visible,
|
|
10217
|
+
className: classNames(`${classPrefix$1c}-popup`, popupClassName),
|
|
10218
|
+
showCloseButton: true,
|
|
10219
|
+
forceRender: ref ? true : forceRender,
|
|
10220
|
+
style: popupStyle,
|
|
10221
|
+
bodyStyle: Object.assign({
|
|
10222
|
+
borderTopLeftRadius: "8px",
|
|
10223
|
+
borderTopRightRadius: "8px",
|
|
10224
|
+
minHeight: "80vh",
|
|
10225
|
+
overflow: "auto"
|
|
10226
|
+
}, popupBodyStyle),
|
|
10227
|
+
onClose,
|
|
10228
|
+
onMaskClick: () => {
|
|
10229
|
+
onMaskClick === null || onMaskClick === void 0 ? void 0 : onMaskClick();
|
|
10230
|
+
if (closeOnMaskClick) {
|
|
10231
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
10232
|
+
}
|
|
10233
|
+
},
|
|
10234
|
+
getContainer
|
|
10235
|
+
}, React__default.createElement(Context$2.Provider, {
|
|
10236
|
+
value: viewContext
|
|
10237
|
+
}, React__default.createElement(CalendarPickerView, Object.assign({
|
|
10238
|
+
ref: calendarRef
|
|
10239
|
+
}, calendarViewProps))), footer)));
|
|
10240
|
+
});
|
|
10241
|
+
function useResizeEffect(effect, targetRef) {
|
|
10242
|
+
const fn = useMemoizedFn(effect);
|
|
10243
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
10244
|
+
const target = targetRef.current;
|
|
10245
|
+
if (!target)
|
|
10246
|
+
return;
|
|
10247
|
+
if (window.ResizeObserver) {
|
|
10248
|
+
let animationFrame;
|
|
10249
|
+
const observer = new ResizeObserver(() => {
|
|
10250
|
+
animationFrame = window.requestAnimationFrame(() => fn(target));
|
|
10251
|
+
});
|
|
10252
|
+
observer.observe(target);
|
|
10253
|
+
return () => {
|
|
10254
|
+
window.cancelAnimationFrame(animationFrame);
|
|
10255
|
+
observer.disconnect();
|
|
10256
|
+
};
|
|
10257
|
+
} else {
|
|
10258
|
+
fn(target);
|
|
10259
|
+
}
|
|
10260
|
+
}, [targetRef]);
|
|
10261
|
+
}
|
|
10262
|
+
function observe(element, options, callback) {
|
|
10263
|
+
if (element && typeof MutationObserver !== "undefined") {
|
|
10264
|
+
let observer = new MutationObserver(() => {
|
|
10265
|
+
callback();
|
|
10266
|
+
});
|
|
10267
|
+
observer.observe(element, options);
|
|
10268
|
+
return () => {
|
|
10269
|
+
if (observer) {
|
|
10270
|
+
observer.disconnect();
|
|
10271
|
+
observer = null;
|
|
10272
|
+
}
|
|
10273
|
+
};
|
|
10274
|
+
}
|
|
10275
|
+
return () => {
|
|
10276
|
+
};
|
|
10277
|
+
}
|
|
10278
|
+
function useMutationEffect(effect, targetRef, options) {
|
|
10279
|
+
const fn = useMemoizedFn(effect);
|
|
10280
|
+
useEffect(() => {
|
|
10281
|
+
const cleanup = observe(targetRef.current, options, fn);
|
|
10282
|
+
return cleanup;
|
|
10283
|
+
}, [targetRef]);
|
|
10284
|
+
}
|
|
10285
|
+
function bound(position, min2, max2) {
|
|
10286
|
+
let ret = position;
|
|
10287
|
+
if (min2 !== void 0) {
|
|
10288
|
+
ret = Math.max(position, min2);
|
|
10289
|
+
}
|
|
10290
|
+
if (max2 !== void 0) {
|
|
10291
|
+
ret = Math.min(ret, max2);
|
|
10292
|
+
}
|
|
10293
|
+
return ret;
|
|
10294
|
+
}
|
|
10295
|
+
const useTabListScroll = (targetRef, activeIndex) => {
|
|
10296
|
+
const [{
|
|
10297
|
+
scrollLeft
|
|
10298
|
+
}, api] = useSpring(() => ({
|
|
10299
|
+
scrollLeft: 0,
|
|
10300
|
+
config: {
|
|
10301
|
+
tension: 300,
|
|
10302
|
+
clamp: true
|
|
10303
|
+
}
|
|
10304
|
+
}));
|
|
10305
|
+
function animate(immediate = false) {
|
|
10306
|
+
const container = targetRef.current;
|
|
10307
|
+
if (!container)
|
|
10308
|
+
return;
|
|
10309
|
+
if (activeIndex === void 0)
|
|
10310
|
+
return;
|
|
10311
|
+
const activeTabWrapper = container.children.item(activeIndex);
|
|
10312
|
+
const activeTab = activeTabWrapper.children.item(0);
|
|
10313
|
+
const activeTabLeft = activeTab.offsetLeft;
|
|
10314
|
+
const activeTabWidth = activeTab.offsetWidth;
|
|
10315
|
+
const containerWidth = container.offsetWidth;
|
|
10316
|
+
const containerScrollWidth = container.scrollWidth;
|
|
10317
|
+
const containerScrollLeft = container.scrollLeft;
|
|
10318
|
+
const maxScrollDistance = containerScrollWidth - containerWidth;
|
|
10319
|
+
if (maxScrollDistance <= 0)
|
|
10320
|
+
return;
|
|
10321
|
+
const nextScrollLeft = bound(activeTabLeft - (containerWidth - activeTabWidth) / 2, 0, containerScrollWidth - containerWidth);
|
|
10322
|
+
api.start({
|
|
10323
|
+
scrollLeft: nextScrollLeft,
|
|
10324
|
+
from: {
|
|
10325
|
+
scrollLeft: containerScrollLeft
|
|
10326
|
+
},
|
|
10327
|
+
immediate: immediate && !scrollLeft.isAnimating
|
|
10328
|
+
});
|
|
10329
|
+
}
|
|
10330
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
10331
|
+
animate(true);
|
|
10332
|
+
}, []);
|
|
10333
|
+
useIsomorphicUpdateLayoutEffect(() => {
|
|
10334
|
+
animate();
|
|
10335
|
+
}, [activeIndex]);
|
|
10336
|
+
useMutationEffect(() => {
|
|
10337
|
+
animate(true);
|
|
10338
|
+
}, targetRef, {
|
|
10339
|
+
subtree: true,
|
|
10340
|
+
childList: true,
|
|
10341
|
+
characterData: true
|
|
10342
|
+
});
|
|
10343
|
+
return {
|
|
10344
|
+
scrollLeft,
|
|
10345
|
+
animate
|
|
10346
|
+
};
|
|
10347
|
+
};
|
|
10348
|
+
const classPrefix$1b = `adm-scroll-mask`;
|
|
10349
|
+
const ScrollMask = (props) => {
|
|
10350
|
+
const maskRef = useRef(null);
|
|
10351
|
+
const [{
|
|
10352
|
+
leftMaskOpacity,
|
|
10353
|
+
rightMaskOpacity
|
|
10354
|
+
}, api] = useSpring(() => ({
|
|
10355
|
+
leftMaskOpacity: 0,
|
|
10356
|
+
rightMaskOpacity: 0,
|
|
10357
|
+
config: {
|
|
10358
|
+
clamp: true
|
|
10004
10359
|
}
|
|
10005
|
-
|
|
10006
|
-
|
|
10360
|
+
}));
|
|
10361
|
+
const {
|
|
10362
|
+
run: updateMask
|
|
10363
|
+
} = useThrottleFn((immediate = false) => {
|
|
10364
|
+
const mask = maskRef.current;
|
|
10365
|
+
if (!mask)
|
|
10366
|
+
return;
|
|
10367
|
+
const scrollEl = props.scrollTrackRef.current;
|
|
10368
|
+
if (!scrollEl)
|
|
10369
|
+
return;
|
|
10370
|
+
const scrollLeft = scrollEl.scrollLeft;
|
|
10371
|
+
const showLeftMask = scrollLeft > 0;
|
|
10372
|
+
const showRightMask = scrollLeft + scrollEl.offsetWidth < scrollEl.scrollWidth;
|
|
10373
|
+
api.start({
|
|
10374
|
+
leftMaskOpacity: showLeftMask ? 1 : 0,
|
|
10375
|
+
rightMaskOpacity: showRightMask ? 1 : 0,
|
|
10376
|
+
immediate
|
|
10377
|
+
});
|
|
10378
|
+
}, {
|
|
10379
|
+
wait: 100,
|
|
10380
|
+
trailing: true,
|
|
10381
|
+
leading: true
|
|
10382
|
+
});
|
|
10383
|
+
useEffect(() => {
|
|
10384
|
+
updateMask(true);
|
|
10385
|
+
}, []);
|
|
10386
|
+
useEffect(() => {
|
|
10387
|
+
const scrollEl = props.scrollTrackRef.current;
|
|
10388
|
+
if (!scrollEl)
|
|
10389
|
+
return;
|
|
10390
|
+
scrollEl.addEventListener("scroll", updateMask);
|
|
10391
|
+
return () => scrollEl.removeEventListener("scroll", updateMask);
|
|
10392
|
+
}, []);
|
|
10393
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(animated.div, {
|
|
10394
|
+
ref: maskRef,
|
|
10395
|
+
className: classNames(classPrefix$1b, `${classPrefix$1b}-left`),
|
|
10396
|
+
style: {
|
|
10397
|
+
opacity: leftMaskOpacity
|
|
10007
10398
|
}
|
|
10008
|
-
|
|
10009
|
-
|
|
10399
|
+
}), React__default.createElement(animated.div, {
|
|
10400
|
+
className: classNames(classPrefix$1b, `${classPrefix$1b}-right`),
|
|
10401
|
+
style: {
|
|
10402
|
+
opacity: rightMaskOpacity
|
|
10010
10403
|
}
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
reactIs_development.Element = Element2;
|
|
10014
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
10015
|
-
reactIs_development.Fragment = Fragment;
|
|
10016
|
-
reactIs_development.Lazy = Lazy;
|
|
10017
|
-
reactIs_development.Memo = Memo;
|
|
10018
|
-
reactIs_development.Portal = Portal;
|
|
10019
|
-
reactIs_development.Profiler = Profiler;
|
|
10020
|
-
reactIs_development.StrictMode = StrictMode;
|
|
10021
|
-
reactIs_development.Suspense = Suspense;
|
|
10022
|
-
reactIs_development.SuspenseList = SuspenseList;
|
|
10023
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
10024
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
10025
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
10026
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
10027
|
-
reactIs_development.isElement = isElement2;
|
|
10028
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
10029
|
-
reactIs_development.isFragment = isFragment;
|
|
10030
|
-
reactIs_development.isLazy = isLazy;
|
|
10031
|
-
reactIs_development.isMemo = isMemo;
|
|
10032
|
-
reactIs_development.isPortal = isPortal;
|
|
10033
|
-
reactIs_development.isProfiler = isProfiler;
|
|
10034
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
10035
|
-
reactIs_development.isSuspense = isSuspense;
|
|
10036
|
-
reactIs_development.isSuspenseList = isSuspenseList;
|
|
10037
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
10038
|
-
reactIs_development.typeOf = typeOf;
|
|
10039
|
-
})();
|
|
10040
|
-
}
|
|
10041
|
-
{
|
|
10042
|
-
reactIs.exports = reactIs_development;
|
|
10043
|
-
}
|
|
10044
|
-
var reactIsExports = reactIs.exports;
|
|
10404
|
+
}));
|
|
10405
|
+
};
|
|
10045
10406
|
function traverseReactNode(children, fn) {
|
|
10046
10407
|
let i2 = 0;
|
|
10047
10408
|
function handle(target) {
|
|
@@ -10747,13 +11108,13 @@ const colorRecord$2 = {
|
|
|
10747
11108
|
primary: "var(--adm-color-primary)",
|
|
10748
11109
|
white: "var(--adm-color-white)"
|
|
10749
11110
|
};
|
|
10750
|
-
const defaultProps$
|
|
11111
|
+
const defaultProps$V = {
|
|
10751
11112
|
color: "default"
|
|
10752
11113
|
};
|
|
10753
11114
|
const circumference = 15 * 3.14159265358979 * 2;
|
|
10754
11115
|
const SpinLoading = memo((p) => {
|
|
10755
11116
|
var _a;
|
|
10756
|
-
const props = mergeProps(defaultProps$
|
|
11117
|
+
const props = mergeProps(defaultProps$V, p);
|
|
10757
11118
|
const motionReduced = useMotionReduced();
|
|
10758
11119
|
const {
|
|
10759
11120
|
percent
|
|
@@ -10794,7 +11155,7 @@ const SpinLoading = memo((p) => {
|
|
|
10794
11155
|
}))));
|
|
10795
11156
|
});
|
|
10796
11157
|
const classPrefix$16 = `adm-picker-view`;
|
|
10797
|
-
const defaultProps$
|
|
11158
|
+
const defaultProps$U = {
|
|
10798
11159
|
defaultValue: [],
|
|
10799
11160
|
renderLabel: defaultRenderLabel,
|
|
10800
11161
|
mouseWheel: false,
|
|
@@ -10803,7 +11164,7 @@ const defaultProps$V = {
|
|
|
10803
11164
|
}, React__default.createElement(SpinLoading, null))
|
|
10804
11165
|
};
|
|
10805
11166
|
const PickerView = memo((p) => {
|
|
10806
|
-
const props = mergeProps(defaultProps$
|
|
11167
|
+
const props = mergeProps(defaultProps$U, p);
|
|
10807
11168
|
const [innerValue, setInnerValue] = useState(props.value === void 0 ? props.defaultValue : props.value);
|
|
10808
11169
|
useEffect(() => {
|
|
10809
11170
|
if (props.value === void 0)
|
|
@@ -10865,7 +11226,7 @@ const PickerView = memo((p) => {
|
|
|
10865
11226
|
});
|
|
10866
11227
|
PickerView.displayName = "PickerView";
|
|
10867
11228
|
const classPrefix$15 = `adm-picker`;
|
|
10868
|
-
const defaultProps$
|
|
11229
|
+
const defaultProps$T = {
|
|
10869
11230
|
defaultValue: [],
|
|
10870
11231
|
closeOnMaskClick: true,
|
|
10871
11232
|
renderLabel: defaultRenderLabel,
|
|
@@ -10877,7 +11238,7 @@ const Picker$1 = memo(forwardRef((p, ref) => {
|
|
|
10877
11238
|
const {
|
|
10878
11239
|
locale
|
|
10879
11240
|
} = useConfig();
|
|
10880
|
-
const props = mergeProps(defaultProps$
|
|
11241
|
+
const props = mergeProps(defaultProps$T, {
|
|
10881
11242
|
confirmText: locale.common.confirm,
|
|
10882
11243
|
cancelText: locale.common.cancel
|
|
10883
11244
|
}, p);
|
|
@@ -11117,14 +11478,14 @@ const classPrefix$14 = `adm-tabs`;
|
|
|
11117
11478
|
const Tab = () => {
|
|
11118
11479
|
return null;
|
|
11119
11480
|
};
|
|
11120
|
-
const defaultProps$
|
|
11481
|
+
const defaultProps$S = {
|
|
11121
11482
|
activeLineMode: "auto",
|
|
11122
11483
|
stretch: true,
|
|
11123
11484
|
direction: "ltr"
|
|
11124
11485
|
};
|
|
11125
11486
|
const Tabs$1 = (p) => {
|
|
11126
11487
|
var _a;
|
|
11127
|
-
const props = mergeProps(defaultProps$
|
|
11488
|
+
const props = mergeProps(defaultProps$S, p);
|
|
11128
11489
|
const tabListContainerRef = useRef(null);
|
|
11129
11490
|
const activeLineRef = useRef(null);
|
|
11130
11491
|
const keyToIndexRecord = {};
|
|
@@ -11368,11 +11729,11 @@ const Tabs = attachPropertiesToComponent(Tabs$1, {
|
|
|
11368
11729
|
Tab
|
|
11369
11730
|
});
|
|
11370
11731
|
const classPrefix$13 = `adm-list`;
|
|
11371
|
-
const defaultProps$
|
|
11732
|
+
const defaultProps$R = {
|
|
11372
11733
|
mode: "default"
|
|
11373
11734
|
};
|
|
11374
11735
|
const List$2 = forwardRef((p, ref) => {
|
|
11375
|
-
const props = mergeProps(defaultProps$
|
|
11736
|
+
const props = mergeProps(defaultProps$R, p);
|
|
11376
11737
|
const nativeElementRef = useRef(null);
|
|
11377
11738
|
useImperativeHandle(ref, () => ({
|
|
11378
11739
|
get nativeElement() {
|
|
@@ -11395,9 +11756,17 @@ function isNodeWithContent(node) {
|
|
|
11395
11756
|
}
|
|
11396
11757
|
const classPrefix$12 = `adm-list-item`;
|
|
11397
11758
|
const ListItem = (props) => {
|
|
11398
|
-
var _a;
|
|
11759
|
+
var _a, _b;
|
|
11760
|
+
const {
|
|
11761
|
+
arrow: arrow2,
|
|
11762
|
+
arrowIcon
|
|
11763
|
+
} = props;
|
|
11764
|
+
const {
|
|
11765
|
+
list: componentConfig = {}
|
|
11766
|
+
} = useConfig();
|
|
11399
11767
|
const clickable = (_a = props.clickable) !== null && _a !== void 0 ? _a : !!props.onClick;
|
|
11400
|
-
const
|
|
11768
|
+
const showArrow = (_b = arrow2 !== null && arrow2 !== void 0 ? arrow2 : arrowIcon) !== null && _b !== void 0 ? _b : clickable;
|
|
11769
|
+
const mergedArrowIcon = mergeProp(componentConfig.arrowIcon, arrow2 !== true ? arrow2 : null, arrowIcon !== true ? arrowIcon : null);
|
|
11401
11770
|
const content = React__default.createElement("div", {
|
|
11402
11771
|
className: `${classPrefix$12}-content`
|
|
11403
11772
|
}, isNodeWithContent(props.prefix) && React__default.createElement("div", {
|
|
@@ -11410,9 +11779,9 @@ const ListItem = (props) => {
|
|
|
11410
11779
|
className: `${classPrefix$12}-description`
|
|
11411
11780
|
}, props.description)), isNodeWithContent(props.extra) && React__default.createElement("div", {
|
|
11412
11781
|
className: `${classPrefix$12}-content-extra`
|
|
11413
|
-
}, props.extra),
|
|
11782
|
+
}, props.extra), showArrow && React__default.createElement("div", {
|
|
11414
11783
|
className: `${classPrefix$12}-content-arrow`
|
|
11415
|
-
},
|
|
11784
|
+
}, mergedArrowIcon || React__default.createElement(RightOutline, null)));
|
|
11416
11785
|
return withNativeProps(props, React__default.createElement(clickable ? "a" : "div", {
|
|
11417
11786
|
className: classNames(`${classPrefix$12}`, clickable ? ["adm-plain-anchor"] : [], props.disabled && `${classPrefix$12}-disabled`),
|
|
11418
11787
|
onClick: props.disabled ? void 0 : props.onClick
|
|
@@ -11423,16 +11792,19 @@ const List$1 = attachPropertiesToComponent(List$2, {
|
|
|
11423
11792
|
});
|
|
11424
11793
|
const CheckListContext = createContext(null);
|
|
11425
11794
|
const classPrefix$11 = "adm-check-list";
|
|
11426
|
-
const defaultProps$
|
|
11795
|
+
const defaultProps$Q = {
|
|
11427
11796
|
multiple: false,
|
|
11428
11797
|
defaultValue: [],
|
|
11429
11798
|
activeIcon: React__default.createElement(CheckOutline, null)
|
|
11430
11799
|
};
|
|
11431
|
-
const CheckList$1 = (
|
|
11432
|
-
const
|
|
11433
|
-
|
|
11800
|
+
const CheckList$1 = (props) => {
|
|
11801
|
+
const {
|
|
11802
|
+
checkList: componentConfig = {}
|
|
11803
|
+
} = useConfig();
|
|
11804
|
+
const mergedProps = mergeProps(defaultProps$Q, componentConfig, props);
|
|
11805
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
11434
11806
|
function check(val) {
|
|
11435
|
-
if (
|
|
11807
|
+
if (mergedProps.multiple) {
|
|
11436
11808
|
setValue2([...value, val]);
|
|
11437
11809
|
} else {
|
|
11438
11810
|
setValue2([val]);
|
|
@@ -11446,7 +11818,7 @@ const CheckList$1 = (p) => {
|
|
|
11446
11818
|
extra,
|
|
11447
11819
|
disabled,
|
|
11448
11820
|
readOnly
|
|
11449
|
-
} =
|
|
11821
|
+
} = mergedProps;
|
|
11450
11822
|
return React__default.createElement(CheckListContext.Provider, {
|
|
11451
11823
|
value: {
|
|
11452
11824
|
value,
|
|
@@ -11457,10 +11829,10 @@ const CheckList$1 = (p) => {
|
|
|
11457
11829
|
disabled,
|
|
11458
11830
|
readOnly
|
|
11459
11831
|
}
|
|
11460
|
-
}, withNativeProps(
|
|
11461
|
-
mode:
|
|
11832
|
+
}, withNativeProps(mergedProps, React__default.createElement(List$1, {
|
|
11833
|
+
mode: mergedProps.mode,
|
|
11462
11834
|
className: classPrefix$11
|
|
11463
|
-
},
|
|
11835
|
+
}, mergedProps.children)));
|
|
11464
11836
|
};
|
|
11465
11837
|
const classPrefix$10 = `adm-check-list-item`;
|
|
11466
11838
|
const CheckListItem = (props) => {
|
|
@@ -11671,11 +12043,11 @@ const useFieldNames = (fieldNames = {}) => {
|
|
|
11671
12043
|
return fields;
|
|
11672
12044
|
};
|
|
11673
12045
|
const classPrefix$_ = `adm-cascader-view`;
|
|
11674
|
-
const defaultProps$
|
|
12046
|
+
const defaultProps$P = {
|
|
11675
12047
|
defaultValue: []
|
|
11676
12048
|
};
|
|
11677
12049
|
const CascaderView$1 = (p) => {
|
|
11678
|
-
const props = mergeProps(defaultProps$
|
|
12050
|
+
const props = mergeProps(defaultProps$P, p);
|
|
11679
12051
|
const {
|
|
11680
12052
|
locale
|
|
11681
12053
|
} = useConfig();
|
|
@@ -11792,7 +12164,7 @@ const CascaderView = attachPropertiesToComponent(CascaderView$1, {
|
|
|
11792
12164
|
optionSkeleton
|
|
11793
12165
|
});
|
|
11794
12166
|
const classPrefix$Z = `adm-cascader`;
|
|
11795
|
-
const defaultProps$
|
|
12167
|
+
const defaultProps$O = {
|
|
11796
12168
|
defaultValue: [],
|
|
11797
12169
|
destroyOnClose: true,
|
|
11798
12170
|
forceRender: false
|
|
@@ -11802,7 +12174,7 @@ const Cascader = forwardRef((p, ref) => {
|
|
|
11802
12174
|
const {
|
|
11803
12175
|
locale
|
|
11804
12176
|
} = useConfig();
|
|
11805
|
-
const props = mergeProps(defaultProps$
|
|
12177
|
+
const props = mergeProps(defaultProps$O, {
|
|
11806
12178
|
confirmText: locale.common.confirm,
|
|
11807
12179
|
cancelText: locale.common.cancel,
|
|
11808
12180
|
placeholder: locale.Cascader.placeholder
|
|
@@ -11930,15 +12302,18 @@ const index$f = attachPropertiesToComponent(Cascader, {
|
|
|
11930
12302
|
optionSkeleton
|
|
11931
12303
|
});
|
|
11932
12304
|
const classPrefix$Y = "adm-center-popup";
|
|
11933
|
-
const defaultProps$
|
|
12305
|
+
const defaultProps$N = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
11934
12306
|
getContainer: null
|
|
11935
12307
|
});
|
|
11936
|
-
const CenterPopup = (
|
|
11937
|
-
const
|
|
12308
|
+
const CenterPopup = (props) => {
|
|
12309
|
+
const {
|
|
12310
|
+
popup: componentConfig = {}
|
|
12311
|
+
} = useConfig();
|
|
12312
|
+
const mergedProps = mergeProps(defaultProps$N, componentConfig, props);
|
|
11938
12313
|
const unmountedRef = useUnmountedRef$1();
|
|
11939
12314
|
const style = useSpring({
|
|
11940
|
-
scale:
|
|
11941
|
-
opacity:
|
|
12315
|
+
scale: mergedProps.visible ? 1 : 0.8,
|
|
12316
|
+
opacity: mergedProps.visible ? 1 : 0,
|
|
11942
12317
|
config: {
|
|
11943
12318
|
mass: 1.2,
|
|
11944
12319
|
tension: 200,
|
|
@@ -11949,77 +12324,77 @@ const CenterPopup = (p) => {
|
|
|
11949
12324
|
var _a, _b;
|
|
11950
12325
|
if (unmountedRef.current)
|
|
11951
12326
|
return;
|
|
11952
|
-
setActive(
|
|
11953
|
-
if (
|
|
11954
|
-
(_a =
|
|
12327
|
+
setActive(mergedProps.visible);
|
|
12328
|
+
if (mergedProps.visible) {
|
|
12329
|
+
(_a = mergedProps.afterShow) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
11955
12330
|
} else {
|
|
11956
|
-
(_b =
|
|
12331
|
+
(_b = mergedProps.afterClose) === null || _b === void 0 ? void 0 : _b.call(mergedProps);
|
|
11957
12332
|
}
|
|
11958
12333
|
}
|
|
11959
12334
|
});
|
|
11960
|
-
const [active, setActive] = useState(
|
|
12335
|
+
const [active, setActive] = useState(mergedProps.visible);
|
|
11961
12336
|
useIsomorphicLayoutEffect$2(() => {
|
|
11962
|
-
if (
|
|
12337
|
+
if (mergedProps.visible) {
|
|
11963
12338
|
setActive(true);
|
|
11964
12339
|
}
|
|
11965
|
-
}, [
|
|
12340
|
+
}, [mergedProps.visible]);
|
|
11966
12341
|
const ref = useRef(null);
|
|
11967
|
-
useLockScroll(ref,
|
|
11968
|
-
const maskVisible = useInnerVisible(active &&
|
|
12342
|
+
useLockScroll(ref, mergedProps.disableBodyScroll && active);
|
|
12343
|
+
const maskVisible = useInnerVisible(active && mergedProps.visible);
|
|
11969
12344
|
const body = React__default.createElement("div", {
|
|
11970
|
-
className: classNames(`${classPrefix$Y}-body`,
|
|
11971
|
-
style:
|
|
11972
|
-
},
|
|
11973
|
-
const node = withStopPropagation(
|
|
12345
|
+
className: classNames(`${classPrefix$Y}-body`, mergedProps.bodyClassName),
|
|
12346
|
+
style: mergedProps.bodyStyle
|
|
12347
|
+
}, mergedProps.children);
|
|
12348
|
+
const node = withStopPropagation(mergedProps.stopPropagation, withNativeProps(mergedProps, React__default.createElement("div", {
|
|
11974
12349
|
className: classPrefix$Y,
|
|
11975
12350
|
style: {
|
|
11976
12351
|
display: active ? void 0 : "none",
|
|
11977
12352
|
pointerEvents: active ? void 0 : "none"
|
|
11978
12353
|
}
|
|
11979
|
-
},
|
|
12354
|
+
}, mergedProps.mask && React__default.createElement(Mask, {
|
|
11980
12355
|
visible: maskVisible,
|
|
11981
|
-
forceRender:
|
|
11982
|
-
destroyOnClose:
|
|
12356
|
+
forceRender: mergedProps.forceRender,
|
|
12357
|
+
destroyOnClose: mergedProps.destroyOnClose,
|
|
11983
12358
|
onMaskClick: (e2) => {
|
|
11984
12359
|
var _a, _b;
|
|
11985
|
-
(_a =
|
|
11986
|
-
if (
|
|
11987
|
-
(_b =
|
|
12360
|
+
(_a = mergedProps.onMaskClick) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
12361
|
+
if (mergedProps.closeOnMaskClick) {
|
|
12362
|
+
(_b = mergedProps.onClose) === null || _b === void 0 ? void 0 : _b.call(mergedProps);
|
|
11988
12363
|
}
|
|
11989
12364
|
},
|
|
11990
|
-
style:
|
|
11991
|
-
className: classNames(`${classPrefix$Y}-mask`,
|
|
12365
|
+
style: mergedProps.maskStyle,
|
|
12366
|
+
className: classNames(`${classPrefix$Y}-mask`, mergedProps.maskClassName),
|
|
11992
12367
|
disableBodyScroll: false,
|
|
11993
|
-
stopPropagation:
|
|
12368
|
+
stopPropagation: mergedProps.stopPropagation
|
|
11994
12369
|
}), React__default.createElement("div", {
|
|
11995
12370
|
className: `${classPrefix$Y}-wrap`,
|
|
11996
|
-
role:
|
|
11997
|
-
"aria-label":
|
|
12371
|
+
role: mergedProps.role,
|
|
12372
|
+
"aria-label": mergedProps["aria-label"]
|
|
11998
12373
|
}, React__default.createElement(animated.div, {
|
|
11999
12374
|
style: Object.assign(Object.assign({}, style), {
|
|
12000
12375
|
pointerEvents: style.opacity.to((v) => v === 1 ? "unset" : "none")
|
|
12001
12376
|
}),
|
|
12002
12377
|
ref
|
|
12003
|
-
},
|
|
12378
|
+
}, mergedProps.showCloseButton && React__default.createElement("a", {
|
|
12004
12379
|
className: classNames(`${classPrefix$Y}-close`, "adm-plain-anchor"),
|
|
12005
12380
|
onClick: () => {
|
|
12006
12381
|
var _a;
|
|
12007
|
-
(_a =
|
|
12382
|
+
(_a = mergedProps.onClose) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
12008
12383
|
}
|
|
12009
|
-
},
|
|
12384
|
+
}, mergedProps.closeIcon), body)))));
|
|
12010
12385
|
return React__default.createElement(ShouldRender, {
|
|
12011
12386
|
active,
|
|
12012
|
-
forceRender:
|
|
12013
|
-
destroyOnClose:
|
|
12014
|
-
}, renderToContainer(
|
|
12387
|
+
forceRender: mergedProps.forceRender,
|
|
12388
|
+
destroyOnClose: mergedProps.destroyOnClose
|
|
12389
|
+
}, renderToContainer(mergedProps.getContainer, node));
|
|
12015
12390
|
};
|
|
12016
12391
|
const CheckboxGroupContext = createContext(null);
|
|
12017
|
-
const defaultProps$
|
|
12392
|
+
const defaultProps$M = {
|
|
12018
12393
|
disabled: false,
|
|
12019
12394
|
defaultValue: []
|
|
12020
12395
|
};
|
|
12021
12396
|
const Group$1 = (p) => {
|
|
12022
|
-
const props = mergeProps(defaultProps$
|
|
12397
|
+
const props = mergeProps(defaultProps$M, p);
|
|
12023
12398
|
const [value, setValue2] = usePropsValue(props);
|
|
12024
12399
|
return React__default.createElement(
|
|
12025
12400
|
CheckboxGroupContext.Provider,
|
|
@@ -12087,13 +12462,13 @@ const NativeInput = (props) => {
|
|
|
12087
12462
|
});
|
|
12088
12463
|
};
|
|
12089
12464
|
const classPrefix$X = `adm-checkbox`;
|
|
12090
|
-
const defaultProps$
|
|
12465
|
+
const defaultProps$L = {
|
|
12091
12466
|
defaultChecked: false,
|
|
12092
12467
|
indeterminate: false
|
|
12093
12468
|
};
|
|
12094
12469
|
const Checkbox$1 = forwardRef((p, ref) => {
|
|
12095
12470
|
const groupContext = useContext(CheckboxGroupContext);
|
|
12096
|
-
const props = mergeProps(defaultProps$
|
|
12471
|
+
const props = mergeProps(defaultProps$L, p);
|
|
12097
12472
|
let [checked, setChecked] = usePropsValue({
|
|
12098
12473
|
value: props.checked,
|
|
12099
12474
|
defaultValue: props.defaultChecked,
|
|
@@ -12255,8 +12630,12 @@ const CollapsePanelContent = (props) => {
|
|
|
12255
12630
|
}, React__default.createElement(List$1.Item, null, shouldRender && props.children)));
|
|
12256
12631
|
};
|
|
12257
12632
|
const Collapse = (props) => {
|
|
12633
|
+
const {
|
|
12634
|
+
collapse: componentConfig = {}
|
|
12635
|
+
} = useConfig();
|
|
12636
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
12258
12637
|
const panels = [];
|
|
12259
|
-
traverseReactNode(
|
|
12638
|
+
traverseReactNode(mergedProps.children, (child) => {
|
|
12260
12639
|
if (!isValidElement(child))
|
|
12261
12640
|
return;
|
|
12262
12641
|
const key = child.key;
|
|
@@ -12266,11 +12645,11 @@ const Collapse = (props) => {
|
|
|
12266
12645
|
});
|
|
12267
12646
|
const handlePropsValue = () => {
|
|
12268
12647
|
var _a;
|
|
12269
|
-
if (!
|
|
12648
|
+
if (!mergedProps.accordion) {
|
|
12270
12649
|
return {
|
|
12271
|
-
value:
|
|
12272
|
-
defaultValue: (_a =
|
|
12273
|
-
onChange:
|
|
12650
|
+
value: mergedProps.activeKey,
|
|
12651
|
+
defaultValue: (_a = mergedProps.defaultActiveKey) !== null && _a !== void 0 ? _a : [],
|
|
12652
|
+
onChange: mergedProps.onChange
|
|
12274
12653
|
};
|
|
12275
12654
|
}
|
|
12276
12655
|
const initValue = {
|
|
@@ -12278,29 +12657,29 @@ const Collapse = (props) => {
|
|
|
12278
12657
|
defaultValue: [],
|
|
12279
12658
|
onChange: (v) => {
|
|
12280
12659
|
var _a2, _b;
|
|
12281
|
-
(_a2 =
|
|
12660
|
+
(_a2 = mergedProps.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(mergedProps, (_b = v[0]) !== null && _b !== void 0 ? _b : null);
|
|
12282
12661
|
}
|
|
12283
12662
|
};
|
|
12284
|
-
if (
|
|
12663
|
+
if (mergedProps.activeKey === void 0) {
|
|
12285
12664
|
initValue.value = void 0;
|
|
12286
|
-
} else if (
|
|
12287
|
-
initValue.value = [
|
|
12665
|
+
} else if (mergedProps.activeKey !== null) {
|
|
12666
|
+
initValue.value = [mergedProps.activeKey];
|
|
12288
12667
|
}
|
|
12289
|
-
if (![null, void 0].includes(
|
|
12290
|
-
initValue.defaultValue = [
|
|
12668
|
+
if (![null, void 0].includes(mergedProps.defaultActiveKey)) {
|
|
12669
|
+
initValue.defaultValue = [mergedProps.defaultActiveKey];
|
|
12291
12670
|
}
|
|
12292
12671
|
return initValue;
|
|
12293
12672
|
};
|
|
12294
12673
|
const [activeKey, setActiveKey] = usePropsValue(handlePropsValue());
|
|
12295
12674
|
const activeKeyList = activeKey === null ? [] : Array.isArray(activeKey) ? activeKey : [activeKey];
|
|
12296
|
-
return withNativeProps(
|
|
12675
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
12297
12676
|
className: classPrefix$W
|
|
12298
12677
|
}, React__default.createElement(List$1, null, panels.map((panel) => {
|
|
12299
12678
|
const key = panel.key;
|
|
12300
12679
|
const active = activeKeyList.includes(key);
|
|
12301
12680
|
function handleClick(event) {
|
|
12302
12681
|
var _a, _b;
|
|
12303
|
-
if (
|
|
12682
|
+
if (mergedProps.accordion) {
|
|
12304
12683
|
if (active) {
|
|
12305
12684
|
setActiveKey([]);
|
|
12306
12685
|
} else {
|
|
@@ -12313,29 +12692,21 @@ const Collapse = (props) => {
|
|
|
12313
12692
|
setActiveKey([...activeKeyList, key]);
|
|
12314
12693
|
}
|
|
12315
12694
|
}
|
|
12316
|
-
(_b = (_a = panel.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
12317
|
-
}
|
|
12318
|
-
const
|
|
12319
|
-
|
|
12320
|
-
|
|
12321
|
-
|
|
12322
|
-
}
|
|
12323
|
-
|
|
12324
|
-
arrow2 = panel.props.arrow;
|
|
12325
|
-
}
|
|
12326
|
-
return typeof arrow2 === "function" ? arrow2(active) : React__default.createElement("div", {
|
|
12327
|
-
className: classNames(`${classPrefix$W}-arrow`, {
|
|
12328
|
-
[`${classPrefix$W}-arrow-active`]: active
|
|
12329
|
-
})
|
|
12330
|
-
}, arrow2);
|
|
12331
|
-
};
|
|
12695
|
+
(_b = (_a = panel.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
12696
|
+
}
|
|
12697
|
+
const arrow2 = mergeProp(React__default.createElement(DownOutline, null), mergedProps.arrow, mergedProps.arrowIcon, panel.props.arrow, panel.props.arrowIcon);
|
|
12698
|
+
const arrowIcon = typeof arrow2 === "function" ? arrow2(active) : React__default.createElement("div", {
|
|
12699
|
+
className: classNames(`${classPrefix$W}-arrow`, {
|
|
12700
|
+
[`${classPrefix$W}-arrow-active`]: active
|
|
12701
|
+
})
|
|
12702
|
+
}, arrow2);
|
|
12332
12703
|
return React__default.createElement(React__default.Fragment, {
|
|
12333
12704
|
key
|
|
12334
12705
|
}, withNativeProps(panel.props, React__default.createElement(List$1.Item, {
|
|
12335
12706
|
className: `${classPrefix$W}-panel-header`,
|
|
12336
12707
|
onClick: handleClick,
|
|
12337
12708
|
disabled: panel.props.disabled,
|
|
12338
|
-
|
|
12709
|
+
arrowIcon
|
|
12339
12710
|
}, panel.props.title)), React__default.createElement(CollapsePanelContent, {
|
|
12340
12711
|
visible: active,
|
|
12341
12712
|
forceRender: !!panel.props.forceRender,
|
|
@@ -12660,14 +13031,14 @@ function useRenderLabel(renderLabel) {
|
|
|
12660
13031
|
}, [renderLabel]);
|
|
12661
13032
|
}
|
|
12662
13033
|
const thisYear$1 = (/* @__PURE__ */ new Date()).getFullYear();
|
|
12663
|
-
const defaultProps$
|
|
13034
|
+
const defaultProps$K = {
|
|
12664
13035
|
min: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear$1 - 10)),
|
|
12665
13036
|
max: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear$1 + 10)),
|
|
12666
13037
|
precision: "day",
|
|
12667
13038
|
defaultValue: null
|
|
12668
13039
|
};
|
|
12669
13040
|
const DatePicker = forwardRef((p, ref) => {
|
|
12670
|
-
const props = mergeProps(defaultProps$
|
|
13041
|
+
const props = mergeProps(defaultProps$K, p);
|
|
12671
13042
|
const {
|
|
12672
13043
|
renderLabel
|
|
12673
13044
|
} = props;
|
|
@@ -12764,14 +13135,14 @@ const index$d = attachPropertiesToComponent(DatePicker, {
|
|
|
12764
13135
|
DATE_NOW: TILL_NOW
|
|
12765
13136
|
});
|
|
12766
13137
|
const thisYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
12767
|
-
const defaultProps$
|
|
13138
|
+
const defaultProps$J = {
|
|
12768
13139
|
min: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear - 10)),
|
|
12769
13140
|
max: new Date((/* @__PURE__ */ new Date()).setFullYear(thisYear + 10)),
|
|
12770
13141
|
precision: "day"
|
|
12771
13142
|
};
|
|
12772
13143
|
const DatePickerView = (p) => {
|
|
12773
13144
|
var _a;
|
|
12774
|
-
const props = mergeProps(defaultProps$
|
|
13145
|
+
const props = mergeProps(defaultProps$J, p);
|
|
12775
13146
|
const {
|
|
12776
13147
|
renderLabel
|
|
12777
13148
|
} = props;
|
|
@@ -12821,14 +13192,14 @@ const DialogActionButton = (props) => {
|
|
|
12821
13192
|
disabled: action.disabled
|
|
12822
13193
|
}, action.text));
|
|
12823
13194
|
};
|
|
12824
|
-
const defaultProps$
|
|
13195
|
+
const defaultProps$I = {
|
|
12825
13196
|
actions: [],
|
|
12826
13197
|
closeOnAction: false,
|
|
12827
13198
|
closeOnMaskClick: false,
|
|
12828
13199
|
getContainer: null
|
|
12829
13200
|
};
|
|
12830
13201
|
const Dialog = (p) => {
|
|
12831
|
-
const props = mergeProps(defaultProps$
|
|
13202
|
+
const props = mergeProps(defaultProps$I, p);
|
|
12832
13203
|
const element = React__default.createElement(React__default.Fragment, null, !!props.image && React__default.createElement("div", {
|
|
12833
13204
|
className: cls$1("image-container")
|
|
12834
13205
|
}, React__default.createElement(Image$1, {
|
|
@@ -12919,7 +13290,7 @@ function alert$1(p) {
|
|
|
12919
13290
|
}));
|
|
12920
13291
|
});
|
|
12921
13292
|
}
|
|
12922
|
-
const defaultProps$
|
|
13293
|
+
const defaultProps$H = {
|
|
12923
13294
|
confirmText: "确认",
|
|
12924
13295
|
cancelText: "取消"
|
|
12925
13296
|
};
|
|
@@ -12927,7 +13298,7 @@ function confirm$1(p) {
|
|
|
12927
13298
|
const {
|
|
12928
13299
|
locale
|
|
12929
13300
|
} = getDefaultConfig();
|
|
12930
|
-
const props = mergeProps(defaultProps$
|
|
13301
|
+
const props = mergeProps(defaultProps$H, {
|
|
12931
13302
|
confirmText: locale.common.confirm,
|
|
12932
13303
|
cancelText: locale.common.cancel
|
|
12933
13304
|
}, p);
|
|
@@ -12971,25 +13342,37 @@ const index$c = attachPropertiesToComponent(Dialog, {
|
|
|
12971
13342
|
confirm: confirm$1,
|
|
12972
13343
|
clear: clear$2
|
|
12973
13344
|
});
|
|
13345
|
+
const IconContext = React__default.createContext(null);
|
|
12974
13346
|
const classPrefix$V = `adm-dropdown-item`;
|
|
12975
13347
|
const Item = (props) => {
|
|
12976
|
-
|
|
13348
|
+
const {
|
|
13349
|
+
dropdown: componentConfig = {}
|
|
13350
|
+
} = useConfig();
|
|
13351
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
13352
|
+
const {
|
|
13353
|
+
active,
|
|
13354
|
+
highlight,
|
|
13355
|
+
onClick,
|
|
13356
|
+
title
|
|
13357
|
+
} = mergedProps;
|
|
12977
13358
|
const cls2 = classNames(classPrefix$V, {
|
|
12978
|
-
[`${classPrefix$V}-active`]:
|
|
12979
|
-
[`${classPrefix$V}-highlight`]:
|
|
13359
|
+
[`${classPrefix$V}-active`]: active,
|
|
13360
|
+
[`${classPrefix$V}-highlight`]: highlight !== null && highlight !== void 0 ? highlight : active
|
|
12980
13361
|
});
|
|
13362
|
+
const contextArrowIcon = React__default.useContext(IconContext);
|
|
13363
|
+
const mergedArrowIcon = mergeProp(React__default.createElement(DownFill, null), contextArrowIcon, mergedProps.arrow, mergedProps.arrowIcon);
|
|
12981
13364
|
return withNativeProps(props, React__default.createElement("div", {
|
|
12982
13365
|
className: cls2,
|
|
12983
|
-
onClick
|
|
13366
|
+
onClick
|
|
12984
13367
|
}, React__default.createElement("div", {
|
|
12985
13368
|
className: `${classPrefix$V}-title`
|
|
12986
13369
|
}, React__default.createElement("span", {
|
|
12987
13370
|
className: `${classPrefix$V}-title-text`
|
|
12988
|
-
},
|
|
13371
|
+
}, title), React__default.createElement("span", {
|
|
12989
13372
|
className: classNames(`${classPrefix$V}-title-arrow`, {
|
|
12990
|
-
[`${classPrefix$V}-title-arrow-active`]:
|
|
13373
|
+
[`${classPrefix$V}-title-arrow-active`]: active
|
|
12991
13374
|
})
|
|
12992
|
-
},
|
|
13375
|
+
}, mergedArrowIcon))));
|
|
12993
13376
|
};
|
|
12994
13377
|
const Item$1 = Item;
|
|
12995
13378
|
const ItemChildrenWrap = (props) => {
|
|
@@ -13006,23 +13389,27 @@ const ItemChildrenWrap = (props) => {
|
|
|
13006
13389
|
}, props.children) : null;
|
|
13007
13390
|
};
|
|
13008
13391
|
const classPrefix$U = `adm-dropdown`;
|
|
13009
|
-
const defaultProps$
|
|
13392
|
+
const defaultProps$G = {
|
|
13010
13393
|
defaultActiveKey: null,
|
|
13011
13394
|
closeOnMaskClick: true,
|
|
13012
13395
|
closeOnClickAway: false,
|
|
13013
13396
|
getContainer: defaultPopupBaseProps["getContainer"]
|
|
13014
13397
|
};
|
|
13015
|
-
const Dropdown = forwardRef((
|
|
13016
|
-
const
|
|
13398
|
+
const Dropdown = forwardRef((props, ref) => {
|
|
13399
|
+
const {
|
|
13400
|
+
dropdown: componentConfig = {}
|
|
13401
|
+
} = useConfig();
|
|
13402
|
+
const mergedProps = mergeProps(defaultProps$G, componentConfig, props);
|
|
13403
|
+
const arrowIcon = mergeProp(componentConfig.arrowIcon, props.arrow, props.arrowIcon);
|
|
13017
13404
|
const [value, setValue2] = usePropsValue({
|
|
13018
|
-
value:
|
|
13019
|
-
defaultValue:
|
|
13020
|
-
onChange:
|
|
13405
|
+
value: mergedProps.activeKey,
|
|
13406
|
+
defaultValue: mergedProps.defaultActiveKey,
|
|
13407
|
+
onChange: mergedProps.onChange
|
|
13021
13408
|
});
|
|
13022
13409
|
const navRef = useRef(null);
|
|
13023
13410
|
const contentRef = useRef(null);
|
|
13024
13411
|
useClickAway(() => {
|
|
13025
|
-
if (!
|
|
13412
|
+
if (!mergedProps.closeOnClickAway)
|
|
13026
13413
|
return;
|
|
13027
13414
|
setValue2(null);
|
|
13028
13415
|
}, [navRef, contentRef]);
|
|
@@ -13046,7 +13433,7 @@ const Dropdown = forwardRef((p, ref) => {
|
|
|
13046
13433
|
};
|
|
13047
13434
|
let popupForceRender = false;
|
|
13048
13435
|
const items = [];
|
|
13049
|
-
const navs = React__default.Children.map(
|
|
13436
|
+
const navs = React__default.Children.map(mergedProps.children, (child) => {
|
|
13050
13437
|
if (isValidElement(child)) {
|
|
13051
13438
|
const childProps = Object.assign(Object.assign({}, child.props), {
|
|
13052
13439
|
onClick: (event) => {
|
|
@@ -13054,8 +13441,7 @@ const Dropdown = forwardRef((p, ref) => {
|
|
|
13054
13441
|
changeActive(child.key);
|
|
13055
13442
|
(_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
13056
13443
|
},
|
|
13057
|
-
active: child.key === value
|
|
13058
|
-
arrow: child.props.arrow === void 0 ? props.arrow : child.props.arrow
|
|
13444
|
+
active: child.key === value
|
|
13059
13445
|
});
|
|
13060
13446
|
items.push(child);
|
|
13061
13447
|
if (child.props.forceRender)
|
|
@@ -13070,18 +13456,20 @@ const Dropdown = forwardRef((p, ref) => {
|
|
|
13070
13456
|
setValue2(null);
|
|
13071
13457
|
}
|
|
13072
13458
|
}), [setValue2]);
|
|
13073
|
-
return withNativeProps(
|
|
13459
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
13074
13460
|
className: classNames(classPrefix$U, {
|
|
13075
13461
|
[`${classPrefix$U}-open`]: !!value
|
|
13076
13462
|
}),
|
|
13077
13463
|
ref: containerRef
|
|
13464
|
+
}, React__default.createElement(IconContext.Provider, {
|
|
13465
|
+
value: arrowIcon
|
|
13078
13466
|
}, React__default.createElement("div", {
|
|
13079
13467
|
className: `${classPrefix$U}-nav`,
|
|
13080
13468
|
ref: navRef
|
|
13081
|
-
}, navs), React__default.createElement(Popup, {
|
|
13469
|
+
}, navs)), React__default.createElement(Popup, {
|
|
13082
13470
|
visible: !!value,
|
|
13083
13471
|
position: "top",
|
|
13084
|
-
getContainer:
|
|
13472
|
+
getContainer: mergedProps.getContainer,
|
|
13085
13473
|
className: `${classPrefix$U}-popup`,
|
|
13086
13474
|
maskClassName: `${classPrefix$U}-popup-mask`,
|
|
13087
13475
|
bodyClassName: `${classPrefix$U}-popup-body`,
|
|
@@ -13089,7 +13477,7 @@ const Dropdown = forwardRef((p, ref) => {
|
|
|
13089
13477
|
top
|
|
13090
13478
|
},
|
|
13091
13479
|
forceRender: popupForceRender,
|
|
13092
|
-
onMaskClick:
|
|
13480
|
+
onMaskClick: mergedProps.closeOnMaskClick ? () => {
|
|
13093
13481
|
changeActive(null);
|
|
13094
13482
|
} : void 0
|
|
13095
13483
|
}, React__default.createElement("div", {
|
|
@@ -13169,7 +13557,7 @@ function betweenInclusive(i2, e2, n2) {
|
|
|
13169
13557
|
i2[i2.unit_1 = 1] = "unit_1", i2[i2.unit_2 = 2] = "unit_2", i2[i2.unit_4 = 4] = "unit_4";
|
|
13170
13558
|
}(n || (n = {}));
|
|
13171
13559
|
const classPrefix$T = `adm-ellipsis`;
|
|
13172
|
-
const defaultProps$
|
|
13560
|
+
const defaultProps$F = {
|
|
13173
13561
|
direction: "end",
|
|
13174
13562
|
rows: 1,
|
|
13175
13563
|
expandText: "",
|
|
@@ -13181,7 +13569,7 @@ const defaultProps$G = {
|
|
|
13181
13569
|
defaultExpanded: false
|
|
13182
13570
|
};
|
|
13183
13571
|
const Ellipsis = (p) => {
|
|
13184
|
-
const props = mergeProps(defaultProps$
|
|
13572
|
+
const props = mergeProps(defaultProps$F, p);
|
|
13185
13573
|
const rootRef = useRef(null);
|
|
13186
13574
|
const expandElRef = useRef(null);
|
|
13187
13575
|
const collapseElRef = useRef(null);
|
|
@@ -13369,13 +13757,13 @@ const Empty = (props) => {
|
|
|
13369
13757
|
}, props.description)));
|
|
13370
13758
|
};
|
|
13371
13759
|
const classPrefix$R = `adm-error-block`;
|
|
13372
|
-
const defaultProps$
|
|
13760
|
+
const defaultProps$E = {
|
|
13373
13761
|
status: "default"
|
|
13374
13762
|
};
|
|
13375
13763
|
function createErrorBlock(imageRecord2) {
|
|
13376
13764
|
const ErrorBlock2 = (p) => {
|
|
13377
13765
|
var _a;
|
|
13378
|
-
const props = mergeProps(defaultProps$
|
|
13766
|
+
const props = mergeProps(defaultProps$E, p);
|
|
13379
13767
|
const {
|
|
13380
13768
|
locale
|
|
13381
13769
|
} = useConfig();
|
|
@@ -13907,7 +14295,7 @@ const imageRecord = {
|
|
|
13907
14295
|
};
|
|
13908
14296
|
const ErrorBlock = createErrorBlock(imageRecord);
|
|
13909
14297
|
const classPrefix$Q = `adm-floating-bubble`;
|
|
13910
|
-
const defaultProps$
|
|
14298
|
+
const defaultProps$D = {
|
|
13911
14299
|
axis: "y",
|
|
13912
14300
|
defaultOffset: {
|
|
13913
14301
|
x: 0,
|
|
@@ -13915,7 +14303,7 @@ const defaultProps$E = {
|
|
|
13915
14303
|
}
|
|
13916
14304
|
};
|
|
13917
14305
|
const FloatingBubble = (p) => {
|
|
13918
|
-
const props = mergeProps(defaultProps$
|
|
14306
|
+
const props = mergeProps(defaultProps$D, p);
|
|
13919
14307
|
const boundaryRef = useRef(null);
|
|
13920
14308
|
const buttonRef = useRef(null);
|
|
13921
14309
|
const [innerValue, setInnerValue] = useState(props.offset === void 0 ? props.defaultOffset : props.offset);
|
|
@@ -14014,12 +14402,12 @@ function nearest(arr, target) {
|
|
|
14014
14402
|
});
|
|
14015
14403
|
}
|
|
14016
14404
|
const classPrefix$P = "adm-floating-panel";
|
|
14017
|
-
const defaultProps$
|
|
14405
|
+
const defaultProps$C = {
|
|
14018
14406
|
handleDraggingOfContent: true
|
|
14019
14407
|
};
|
|
14020
14408
|
const FloatingPanel = forwardRef((p, ref) => {
|
|
14021
14409
|
var _a, _b;
|
|
14022
|
-
const props = mergeProps(defaultProps$
|
|
14410
|
+
const props = mergeProps(defaultProps$C, p);
|
|
14023
14411
|
const {
|
|
14024
14412
|
anchors
|
|
14025
14413
|
} = props;
|
|
@@ -14179,99 +14567,6 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
14179
14567
|
}
|
|
14180
14568
|
return target;
|
|
14181
14569
|
}
|
|
14182
|
-
function _typeof$1(o) {
|
|
14183
|
-
"@babel/helpers - typeof";
|
|
14184
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
14185
|
-
return typeof o2;
|
|
14186
|
-
} : function(o2) {
|
|
14187
|
-
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
14188
|
-
}, _typeof$1(o);
|
|
14189
|
-
}
|
|
14190
|
-
function _toPrimitive(input, hint) {
|
|
14191
|
-
if (_typeof$1(input) !== "object" || input === null)
|
|
14192
|
-
return input;
|
|
14193
|
-
var prim = input[Symbol.toPrimitive];
|
|
14194
|
-
if (prim !== void 0) {
|
|
14195
|
-
var res = prim.call(input, hint || "default");
|
|
14196
|
-
if (_typeof$1(res) !== "object")
|
|
14197
|
-
return res;
|
|
14198
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
14199
|
-
}
|
|
14200
|
-
return (hint === "string" ? String : Number)(input);
|
|
14201
|
-
}
|
|
14202
|
-
function _toPropertyKey(arg) {
|
|
14203
|
-
var key = _toPrimitive(arg, "string");
|
|
14204
|
-
return _typeof$1(key) === "symbol" ? key : String(key);
|
|
14205
|
-
}
|
|
14206
|
-
function _defineProperty(obj, key, value) {
|
|
14207
|
-
key = _toPropertyKey(key);
|
|
14208
|
-
if (key in obj) {
|
|
14209
|
-
Object.defineProperty(obj, key, {
|
|
14210
|
-
value,
|
|
14211
|
-
enumerable: true,
|
|
14212
|
-
configurable: true,
|
|
14213
|
-
writable: true
|
|
14214
|
-
});
|
|
14215
|
-
} else {
|
|
14216
|
-
obj[key] = value;
|
|
14217
|
-
}
|
|
14218
|
-
return obj;
|
|
14219
|
-
}
|
|
14220
|
-
function ownKeys(e2, r) {
|
|
14221
|
-
var t = Object.keys(e2);
|
|
14222
|
-
if (Object.getOwnPropertySymbols) {
|
|
14223
|
-
var o = Object.getOwnPropertySymbols(e2);
|
|
14224
|
-
r && (o = o.filter(function(r2) {
|
|
14225
|
-
return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
|
|
14226
|
-
})), t.push.apply(t, o);
|
|
14227
|
-
}
|
|
14228
|
-
return t;
|
|
14229
|
-
}
|
|
14230
|
-
function _objectSpread2(e2) {
|
|
14231
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
14232
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
14233
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
14234
|
-
_defineProperty(e2, r2, t[r2]);
|
|
14235
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
14236
|
-
Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
14237
|
-
});
|
|
14238
|
-
}
|
|
14239
|
-
return e2;
|
|
14240
|
-
}
|
|
14241
|
-
function _arrayLikeToArray(arr, len) {
|
|
14242
|
-
if (len == null || len > arr.length)
|
|
14243
|
-
len = arr.length;
|
|
14244
|
-
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
|
|
14245
|
-
arr2[i2] = arr[i2];
|
|
14246
|
-
return arr2;
|
|
14247
|
-
}
|
|
14248
|
-
function _arrayWithoutHoles(arr) {
|
|
14249
|
-
if (Array.isArray(arr))
|
|
14250
|
-
return _arrayLikeToArray(arr);
|
|
14251
|
-
}
|
|
14252
|
-
function _iterableToArray(iter) {
|
|
14253
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
14254
|
-
return Array.from(iter);
|
|
14255
|
-
}
|
|
14256
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
14257
|
-
if (!o)
|
|
14258
|
-
return;
|
|
14259
|
-
if (typeof o === "string")
|
|
14260
|
-
return _arrayLikeToArray(o, minLen);
|
|
14261
|
-
var n2 = Object.prototype.toString.call(o).slice(8, -1);
|
|
14262
|
-
if (n2 === "Object" && o.constructor)
|
|
14263
|
-
n2 = o.constructor.name;
|
|
14264
|
-
if (n2 === "Map" || n2 === "Set")
|
|
14265
|
-
return Array.from(o);
|
|
14266
|
-
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
14267
|
-
return _arrayLikeToArray(o, minLen);
|
|
14268
|
-
}
|
|
14269
|
-
function _nonIterableSpread() {
|
|
14270
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14271
|
-
}
|
|
14272
|
-
function _toConsumableArray(arr) {
|
|
14273
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
14274
|
-
}
|
|
14275
14570
|
function _classCallCheck(instance, Constructor) {
|
|
14276
14571
|
if (!(instance instanceof Constructor)) {
|
|
14277
14572
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -14386,49 +14681,6 @@ function toArray$2(children) {
|
|
|
14386
14681
|
});
|
|
14387
14682
|
return ret;
|
|
14388
14683
|
}
|
|
14389
|
-
var warned$1 = {};
|
|
14390
|
-
var preWarningFns$1 = [];
|
|
14391
|
-
var preMessage$1 = function preMessage2(fn) {
|
|
14392
|
-
preWarningFns$1.push(fn);
|
|
14393
|
-
};
|
|
14394
|
-
function warning$3(valid, message) {
|
|
14395
|
-
if (!valid && console !== void 0) {
|
|
14396
|
-
var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
|
|
14397
|
-
return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "warning");
|
|
14398
|
-
}, message);
|
|
14399
|
-
if (finalMessage) {
|
|
14400
|
-
console.error("Warning: ".concat(finalMessage));
|
|
14401
|
-
}
|
|
14402
|
-
}
|
|
14403
|
-
}
|
|
14404
|
-
function note$1(valid, message) {
|
|
14405
|
-
if (!valid && console !== void 0) {
|
|
14406
|
-
var finalMessage = preWarningFns$1.reduce(function(msg, preMessageFn) {
|
|
14407
|
-
return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "note");
|
|
14408
|
-
}, message);
|
|
14409
|
-
if (finalMessage) {
|
|
14410
|
-
console.warn("Note: ".concat(finalMessage));
|
|
14411
|
-
}
|
|
14412
|
-
}
|
|
14413
|
-
}
|
|
14414
|
-
function resetWarned$1() {
|
|
14415
|
-
warned$1 = {};
|
|
14416
|
-
}
|
|
14417
|
-
function call$1(method4, valid, message) {
|
|
14418
|
-
if (!valid && !warned$1[message]) {
|
|
14419
|
-
method4(false, message);
|
|
14420
|
-
warned$1[message] = true;
|
|
14421
|
-
}
|
|
14422
|
-
}
|
|
14423
|
-
function warningOnce$1(valid, message) {
|
|
14424
|
-
call$1(warning$3, valid, message);
|
|
14425
|
-
}
|
|
14426
|
-
function noteOnce$1(valid, message) {
|
|
14427
|
-
call$1(note$1, valid, message);
|
|
14428
|
-
}
|
|
14429
|
-
warningOnce$1.preMessage = preMessage$1;
|
|
14430
|
-
warningOnce$1.resetWarned = resetWarned$1;
|
|
14431
|
-
warningOnce$1.noteOnce = noteOnce$1;
|
|
14432
14684
|
var HOOK_MARK$1 = "RC_FORM_INTERNAL_HOOKS";
|
|
14433
14685
|
var warningFunc$1 = function warningFunc() {
|
|
14434
14686
|
warningOnce$1(false, "Can not find FormContext. Please make sure you wrap Field under Form.");
|
|
@@ -15914,53 +16166,6 @@ var defaultValidateMessages = {
|
|
|
15914
16166
|
mismatch: "'${name}' does not match pattern ${pattern}"
|
|
15915
16167
|
}
|
|
15916
16168
|
};
|
|
15917
|
-
function get(entity, path) {
|
|
15918
|
-
var current = entity;
|
|
15919
|
-
for (var i2 = 0; i2 < path.length; i2 += 1) {
|
|
15920
|
-
if (current === null || current === void 0) {
|
|
15921
|
-
return void 0;
|
|
15922
|
-
}
|
|
15923
|
-
current = current[path[i2]];
|
|
15924
|
-
}
|
|
15925
|
-
return current;
|
|
15926
|
-
}
|
|
15927
|
-
function _arrayWithHoles(arr) {
|
|
15928
|
-
if (Array.isArray(arr))
|
|
15929
|
-
return arr;
|
|
15930
|
-
}
|
|
15931
|
-
function _nonIterableRest() {
|
|
15932
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
15933
|
-
}
|
|
15934
|
-
function _toArray(arr) {
|
|
15935
|
-
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
15936
|
-
}
|
|
15937
|
-
function internalSet(entity, paths, value, removeIfUndefined) {
|
|
15938
|
-
if (!paths.length) {
|
|
15939
|
-
return value;
|
|
15940
|
-
}
|
|
15941
|
-
var _paths = _toArray(paths), path = _paths[0], restPath = _paths.slice(1);
|
|
15942
|
-
var clone;
|
|
15943
|
-
if (!entity && typeof path === "number") {
|
|
15944
|
-
clone = [];
|
|
15945
|
-
} else if (Array.isArray(entity)) {
|
|
15946
|
-
clone = _toConsumableArray(entity);
|
|
15947
|
-
} else {
|
|
15948
|
-
clone = _objectSpread2({}, entity);
|
|
15949
|
-
}
|
|
15950
|
-
if (removeIfUndefined && value === void 0 && restPath.length === 1) {
|
|
15951
|
-
delete clone[path][restPath[0]];
|
|
15952
|
-
} else {
|
|
15953
|
-
clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
|
|
15954
|
-
}
|
|
15955
|
-
return clone;
|
|
15956
|
-
}
|
|
15957
|
-
function set(entity, paths, value) {
|
|
15958
|
-
var removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
15959
|
-
if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) {
|
|
15960
|
-
return entity;
|
|
15961
|
-
}
|
|
15962
|
-
return internalSet(entity, paths, value, removeIfUndefined);
|
|
15963
|
-
}
|
|
15964
16169
|
function cloneDeep(val) {
|
|
15965
16170
|
if (Array.isArray(val)) {
|
|
15966
16171
|
return cloneArrayDeep(val);
|
|
@@ -16860,43 +17065,14 @@ var List = function List2(_ref) {
|
|
|
16860
17065
|
key = keyManager.keys[index2];
|
|
16861
17066
|
keyManager.id += 1;
|
|
16862
17067
|
}
|
|
16863
|
-
return {
|
|
16864
|
-
name: index2,
|
|
16865
|
-
key,
|
|
16866
|
-
isListField: true
|
|
16867
|
-
};
|
|
16868
|
-
}), operations, meta);
|
|
16869
|
-
})));
|
|
16870
|
-
};
|
|
16871
|
-
function _iterableToArrayLimit(r, l) {
|
|
16872
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
16873
|
-
if (null != t) {
|
|
16874
|
-
var e2, n2, i2, u, a = [], f = true, o = false;
|
|
16875
|
-
try {
|
|
16876
|
-
if (i2 = (t = t.call(r)).next, 0 === l) {
|
|
16877
|
-
if (Object(t) !== t)
|
|
16878
|
-
return;
|
|
16879
|
-
f = false;
|
|
16880
|
-
} else
|
|
16881
|
-
for (; !(f = (e2 = i2.call(t)).done) && (a.push(e2.value), a.length !== l); f = true)
|
|
16882
|
-
;
|
|
16883
|
-
} catch (r2) {
|
|
16884
|
-
o = true, n2 = r2;
|
|
16885
|
-
} finally {
|
|
16886
|
-
try {
|
|
16887
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u))
|
|
16888
|
-
return;
|
|
16889
|
-
} finally {
|
|
16890
|
-
if (o)
|
|
16891
|
-
throw n2;
|
|
16892
|
-
}
|
|
16893
|
-
}
|
|
16894
|
-
return a;
|
|
16895
|
-
}
|
|
16896
|
-
}
|
|
16897
|
-
function _slicedToArray(arr, i2) {
|
|
16898
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
|
|
16899
|
-
}
|
|
17068
|
+
return {
|
|
17069
|
+
name: index2,
|
|
17070
|
+
key,
|
|
17071
|
+
isListField: true
|
|
17072
|
+
};
|
|
17073
|
+
}), operations, meta);
|
|
17074
|
+
})));
|
|
17075
|
+
};
|
|
16900
17076
|
function allPromiseFinish(promiseList) {
|
|
16901
17077
|
var hasError = false;
|
|
16902
17078
|
var count = promiseList.length;
|
|
@@ -18060,9 +18236,9 @@ const FormArray = (props) => {
|
|
|
18060
18236
|
});
|
|
18061
18237
|
};
|
|
18062
18238
|
const classPrefix$O = "adm-form";
|
|
18063
|
-
const defaultProps$
|
|
18239
|
+
const defaultProps$B = defaultFormContext;
|
|
18064
18240
|
const Form2 = forwardRef((p, ref) => {
|
|
18065
|
-
const props = mergeProps(defaultProps$
|
|
18241
|
+
const props = mergeProps(defaultProps$B, p);
|
|
18066
18242
|
const {
|
|
18067
18243
|
className,
|
|
18068
18244
|
style,
|
|
@@ -18302,24 +18478,13 @@ var Context = /* @__PURE__ */ React.createContext({
|
|
|
18302
18478
|
});
|
|
18303
18479
|
var _default = Context;
|
|
18304
18480
|
default_1 = FieldContext.default = _default;
|
|
18305
|
-
function
|
|
18306
|
-
|
|
18307
|
-
|
|
18308
|
-
|
|
18309
|
-
|
|
18310
|
-
|
|
18311
|
-
|
|
18312
|
-
return !!(prototype && prototype.isReactComponent);
|
|
18313
|
-
}
|
|
18314
|
-
function isSimpleFunctionComponent(type4) {
|
|
18315
|
-
return typeof type4 === "function" && !shouldConstruct(type4) && type4.defaultProps === void 0;
|
|
18316
|
-
}
|
|
18317
|
-
function isSafeSetRefComponent(component) {
|
|
18318
|
-
if (reactIsExports.isFragment(component))
|
|
18319
|
-
return false;
|
|
18320
|
-
if (reactIsExports.isMemo(component))
|
|
18321
|
-
return isSafeSetRefComponent(component.type);
|
|
18322
|
-
return !isSimpleFunctionComponent(component.type);
|
|
18481
|
+
function undefinedFallback(...items) {
|
|
18482
|
+
let i2;
|
|
18483
|
+
for (i2 = 0; i2 < items.length; i2++) {
|
|
18484
|
+
if (items[i2] !== void 0)
|
|
18485
|
+
break;
|
|
18486
|
+
}
|
|
18487
|
+
return items[i2];
|
|
18323
18488
|
}
|
|
18324
18489
|
const Arrow = memo((props) => {
|
|
18325
18490
|
return withNativeProps(props, React__default.createElement("svg", {
|
|
@@ -19758,7 +19923,7 @@ function convertPx(px) {
|
|
|
19758
19923
|
return tester.getBoundingClientRect().height;
|
|
19759
19924
|
}
|
|
19760
19925
|
const classPrefix$N = `adm-popover`;
|
|
19761
|
-
const defaultProps$
|
|
19926
|
+
const defaultProps$A = {
|
|
19762
19927
|
placement: "top",
|
|
19763
19928
|
defaultVisible: false,
|
|
19764
19929
|
stopPropagation: ["click"],
|
|
@@ -19766,7 +19931,7 @@ const defaultProps$B = {
|
|
|
19766
19931
|
mode: "light"
|
|
19767
19932
|
};
|
|
19768
19933
|
const Popover$1 = forwardRef((p, ref) => {
|
|
19769
|
-
const props = mergeProps(defaultProps$
|
|
19934
|
+
const props = mergeProps(defaultProps$A, p);
|
|
19770
19935
|
const placement = normalizePlacement(props.placement);
|
|
19771
19936
|
const [visible, setVisible] = usePropsValue({
|
|
19772
19937
|
value: props.visible,
|
|
@@ -19947,13 +20112,24 @@ const PopoverMenu = forwardRef((props, ref) => {
|
|
|
19947
20112
|
const Popover = attachPropertiesToComponent(Popover$1, {
|
|
19948
20113
|
Menu: PopoverMenu
|
|
19949
20114
|
});
|
|
19950
|
-
function
|
|
19951
|
-
|
|
19952
|
-
|
|
19953
|
-
|
|
19954
|
-
|
|
19955
|
-
|
|
19956
|
-
|
|
20115
|
+
function toArray(candidate) {
|
|
20116
|
+
if (candidate === void 0 || candidate === false)
|
|
20117
|
+
return [];
|
|
20118
|
+
return Array.isArray(candidate) ? candidate : [candidate];
|
|
20119
|
+
}
|
|
20120
|
+
function shouldConstruct(Component) {
|
|
20121
|
+
const prototype = Component.prototype;
|
|
20122
|
+
return !!(prototype && prototype.isReactComponent);
|
|
20123
|
+
}
|
|
20124
|
+
function isSimpleFunctionComponent(type4) {
|
|
20125
|
+
return typeof type4 === "function" && !shouldConstruct(type4) && type4.defaultProps === void 0;
|
|
20126
|
+
}
|
|
20127
|
+
function isSafeSetRefComponent(component) {
|
|
20128
|
+
if (reactIsExports.isFragment(component))
|
|
20129
|
+
return false;
|
|
20130
|
+
if (reactIsExports.isMemo(component))
|
|
20131
|
+
return isSafeSetRefComponent(component.type);
|
|
20132
|
+
return !isSimpleFunctionComponent(component.type);
|
|
19957
20133
|
}
|
|
19958
20134
|
const NAME_SPLIT = "__SPLIT__";
|
|
19959
20135
|
const classPrefix$L = `adm-form-item`;
|
|
@@ -19962,22 +20138,25 @@ const MemoInput = React__default.memo(({
|
|
|
19962
20138
|
}) => children, (prev, next) => prev.value === next.value && prev.update === next.update);
|
|
19963
20139
|
const FormItemLayout = (props) => {
|
|
19964
20140
|
var _a;
|
|
20141
|
+
const {
|
|
20142
|
+
locale,
|
|
20143
|
+
form: componentConfig = {}
|
|
20144
|
+
} = useConfig();
|
|
19965
20145
|
const {
|
|
19966
20146
|
style,
|
|
19967
20147
|
extra,
|
|
19968
20148
|
label,
|
|
19969
20149
|
help,
|
|
20150
|
+
helpIcon,
|
|
19970
20151
|
required: required4,
|
|
19971
20152
|
children,
|
|
19972
20153
|
htmlFor,
|
|
19973
20154
|
hidden,
|
|
19974
20155
|
arrow: arrow2,
|
|
20156
|
+
arrowIcon,
|
|
19975
20157
|
childElementPosition = "normal"
|
|
19976
|
-
} = props;
|
|
20158
|
+
} = mergeProps(componentConfig, props);
|
|
19977
20159
|
const context = useContext(FormContext);
|
|
19978
|
-
const {
|
|
19979
|
-
locale
|
|
19980
|
-
} = useConfig();
|
|
19981
20160
|
const hasFeedback = props.hasFeedback !== void 0 ? props.hasFeedback : context.hasFeedback;
|
|
19982
20161
|
const layout = props.layout || context.layout;
|
|
19983
20162
|
const disabled = (_a = props.disabled) !== null && _a !== void 0 ? _a : context.disabled;
|
|
@@ -20017,7 +20196,7 @@ const FormItemLayout = (props) => {
|
|
|
20017
20196
|
e2.stopPropagation();
|
|
20018
20197
|
e2.preventDefault();
|
|
20019
20198
|
}
|
|
20020
|
-
}, React__default.createElement(QuestionCircleOutline, null))));
|
|
20199
|
+
}, helpIcon || React__default.createElement(QuestionCircleOutline, null))));
|
|
20021
20200
|
const description = (!!props.description || hasFeedback) && React__default.createElement(React__default.Fragment, null, props.description, hasFeedback && React__default.createElement(React__default.Fragment, null, props.errors.map((error, index2) => React__default.createElement("div", {
|
|
20022
20201
|
key: `error-${index2}`,
|
|
20023
20202
|
className: `${classPrefix$L}-feedback-error`
|
|
@@ -20038,7 +20217,7 @@ const FormItemLayout = (props) => {
|
|
|
20038
20217
|
disabled,
|
|
20039
20218
|
onClick: props.onClick,
|
|
20040
20219
|
clickable: props.clickable,
|
|
20041
|
-
|
|
20220
|
+
arrowIcon: arrowIcon || arrow2
|
|
20042
20221
|
}, React__default.createElement("div", {
|
|
20043
20222
|
className: classNames(`${classPrefix$L}-child`, `${classPrefix$L}-child-position-${childElementPosition}`)
|
|
20044
20223
|
}, React__default.createElement("div", {
|
|
@@ -20052,6 +20231,7 @@ const FormItem = (props) => {
|
|
|
20052
20231
|
// FormItem 相关
|
|
20053
20232
|
label,
|
|
20054
20233
|
help,
|
|
20234
|
+
helpIcon,
|
|
20055
20235
|
extra,
|
|
20056
20236
|
hasFeedback,
|
|
20057
20237
|
name,
|
|
@@ -20072,8 +20252,9 @@ const FormItem = (props) => {
|
|
|
20072
20252
|
shouldUpdate,
|
|
20073
20253
|
dependencies,
|
|
20074
20254
|
clickable,
|
|
20075
|
-
arrow: arrow2
|
|
20076
|
-
|
|
20255
|
+
arrow: arrow2,
|
|
20256
|
+
arrowIcon
|
|
20257
|
+
} = 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"]);
|
|
20077
20258
|
const {
|
|
20078
20259
|
name: formName
|
|
20079
20260
|
} = useContext(FormContext);
|
|
@@ -20125,6 +20306,7 @@ const FormItem = (props) => {
|
|
|
20125
20306
|
label,
|
|
20126
20307
|
extra,
|
|
20127
20308
|
help,
|
|
20309
|
+
helpIcon,
|
|
20128
20310
|
description,
|
|
20129
20311
|
required: isRequired,
|
|
20130
20312
|
disabled,
|
|
@@ -20137,7 +20319,8 @@ const FormItem = (props) => {
|
|
|
20137
20319
|
layout,
|
|
20138
20320
|
childElementPosition,
|
|
20139
20321
|
clickable,
|
|
20140
|
-
arrow: arrow2
|
|
20322
|
+
arrow: arrow2,
|
|
20323
|
+
arrowIcon
|
|
20141
20324
|
}, React__default.createElement(NoStyleItemContext.Provider, {
|
|
20142
20325
|
value: onSubMetaChange
|
|
20143
20326
|
}, baseChildren)));
|
|
@@ -20629,14 +20812,14 @@ const Slides = forwardRef((props, ref) => {
|
|
|
20629
20812
|
}))));
|
|
20630
20813
|
});
|
|
20631
20814
|
const classPrefix$H = `adm-image-viewer`;
|
|
20632
|
-
const defaultProps$
|
|
20815
|
+
const defaultProps$z = {
|
|
20633
20816
|
maxZoom: 3,
|
|
20634
20817
|
getContainer: null,
|
|
20635
20818
|
visible: false
|
|
20636
20819
|
};
|
|
20637
20820
|
const ImageViewer$1 = (p) => {
|
|
20638
20821
|
var _a, _b, _c;
|
|
20639
|
-
const props = mergeProps(defaultProps$
|
|
20822
|
+
const props = mergeProps(defaultProps$z, p);
|
|
20640
20823
|
const node = React__default.createElement(Mask, {
|
|
20641
20824
|
visible: props.visible,
|
|
20642
20825
|
disableBodyScroll: false,
|
|
@@ -20657,7 +20840,7 @@ const ImageViewer$1 = (p) => {
|
|
|
20657
20840
|
})));
|
|
20658
20841
|
return renderToContainer(props.getContainer, node);
|
|
20659
20842
|
};
|
|
20660
|
-
const multiDefaultProps = Object.assign(Object.assign({}, defaultProps$
|
|
20843
|
+
const multiDefaultProps = Object.assign(Object.assign({}, defaultProps$z), {
|
|
20661
20844
|
defaultIndex: 0
|
|
20662
20845
|
});
|
|
20663
20846
|
const MultiImageViewer = forwardRef((p, ref) => {
|
|
@@ -20797,11 +20980,11 @@ const PreviewItem = (props) => {
|
|
|
20797
20980
|
};
|
|
20798
20981
|
const PreviewItem$1 = PreviewItem;
|
|
20799
20982
|
const classPrefix$F = `adm-space`;
|
|
20800
|
-
const defaultProps$
|
|
20983
|
+
const defaultProps$y = {
|
|
20801
20984
|
direction: "horizontal"
|
|
20802
20985
|
};
|
|
20803
20986
|
const Space = (p) => {
|
|
20804
|
-
const props = mergeProps(defaultProps$
|
|
20987
|
+
const props = mergeProps(defaultProps$y, p);
|
|
20805
20988
|
const {
|
|
20806
20989
|
direction,
|
|
20807
20990
|
onClick
|
|
@@ -20822,7 +21005,7 @@ const Space = (p) => {
|
|
|
20822
21005
|
})));
|
|
20823
21006
|
};
|
|
20824
21007
|
const classPrefix$E = `adm-image-uploader`;
|
|
20825
|
-
const defaultProps$
|
|
21008
|
+
const defaultProps$x = {
|
|
20826
21009
|
disableUpload: false,
|
|
20827
21010
|
deletable: true,
|
|
20828
21011
|
deleteIcon: React__default.createElement(CloseOutline, {
|
|
@@ -20841,7 +21024,7 @@ const ImageUploader = forwardRef((p, ref) => {
|
|
|
20841
21024
|
const {
|
|
20842
21025
|
locale
|
|
20843
21026
|
} = useConfig();
|
|
20844
|
-
const props = mergeProps(defaultProps$
|
|
21027
|
+
const props = mergeProps(defaultProps$x, p);
|
|
20845
21028
|
const {
|
|
20846
21029
|
columns
|
|
20847
21030
|
} = props;
|
|
@@ -21127,11 +21310,11 @@ const Sidebar = (props) => {
|
|
|
21127
21310
|
}));
|
|
21128
21311
|
};
|
|
21129
21312
|
const classPrefix$C = `adm-index-bar`;
|
|
21130
|
-
const defaultProps$
|
|
21313
|
+
const defaultProps$w = {
|
|
21131
21314
|
sticky: true
|
|
21132
21315
|
};
|
|
21133
21316
|
const IndexBar = forwardRef((p, ref) => {
|
|
21134
|
-
const props = mergeProps(defaultProps$
|
|
21317
|
+
const props = mergeProps(defaultProps$w, p);
|
|
21135
21318
|
const titleHeight = convertPx(35);
|
|
21136
21319
|
const bodyRef = useRef(null);
|
|
21137
21320
|
const indexItems = [];
|
|
@@ -21232,7 +21415,7 @@ function isWindow(element) {
|
|
|
21232
21415
|
return element === window;
|
|
21233
21416
|
}
|
|
21234
21417
|
const classPrefix$B = `adm-infinite-scroll`;
|
|
21235
|
-
const defaultProps$
|
|
21418
|
+
const defaultProps$v = {
|
|
21236
21419
|
threshold: 250,
|
|
21237
21420
|
children: (hasMore, failed, retry) => React__default.createElement(InfiniteScrollContent, {
|
|
21238
21421
|
hasMore,
|
|
@@ -21241,7 +21424,7 @@ const defaultProps$w = {
|
|
|
21241
21424
|
})
|
|
21242
21425
|
};
|
|
21243
21426
|
const InfiniteScroll = (p) => {
|
|
21244
|
-
const props = mergeProps(defaultProps$
|
|
21427
|
+
const props = mergeProps(defaultProps$v, p);
|
|
21245
21428
|
const [failed, setFailed] = useState(false);
|
|
21246
21429
|
const doLoadMore = useLockFn((isRetry) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21247
21430
|
try {
|
|
@@ -21362,24 +21545,26 @@ function useInputHandleKeyDown({
|
|
|
21362
21545
|
return handleKeydown;
|
|
21363
21546
|
}
|
|
21364
21547
|
const classPrefix$A = `adm-input`;
|
|
21365
|
-
const defaultProps$
|
|
21548
|
+
const defaultProps$u = {
|
|
21366
21549
|
defaultValue: "",
|
|
21550
|
+
clearIcon: React__default.createElement(CloseCircleFill, null),
|
|
21367
21551
|
onlyShowClearWhenFocus: true
|
|
21368
21552
|
};
|
|
21369
|
-
const Input = forwardRef((
|
|
21370
|
-
const
|
|
21371
|
-
|
|
21553
|
+
const Input = forwardRef((props, ref) => {
|
|
21554
|
+
const {
|
|
21555
|
+
locale,
|
|
21556
|
+
input: componentConfig = {}
|
|
21557
|
+
} = useConfig();
|
|
21558
|
+
const mergedProps = mergeProps(defaultProps$u, componentConfig, props);
|
|
21559
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
21372
21560
|
const [hasFocus, setHasFocus] = useState(false);
|
|
21373
21561
|
const compositionStartRef = useRef(false);
|
|
21374
21562
|
const nativeInputRef = useRef(null);
|
|
21375
|
-
const {
|
|
21376
|
-
locale
|
|
21377
|
-
} = useConfig();
|
|
21378
21563
|
const handleKeydown = useInputHandleKeyDown({
|
|
21379
|
-
onEnterPress:
|
|
21380
|
-
onKeyDown:
|
|
21564
|
+
onEnterPress: mergedProps.onEnterPress,
|
|
21565
|
+
onKeyDown: mergedProps.onKeyDown,
|
|
21381
21566
|
nativeInputRef,
|
|
21382
|
-
enterKeyHint:
|
|
21567
|
+
enterKeyHint: mergedProps.enterKeyHint
|
|
21383
21568
|
});
|
|
21384
21569
|
useImperativeHandle(ref, () => ({
|
|
21385
21570
|
clear: () => {
|
|
@@ -21399,8 +21584,8 @@ const Input = forwardRef((p, ref) => {
|
|
|
21399
21584
|
}));
|
|
21400
21585
|
function checkValue() {
|
|
21401
21586
|
let nextValue = value;
|
|
21402
|
-
if (
|
|
21403
|
-
const boundValue = nextValue && bound(parseFloat(nextValue),
|
|
21587
|
+
if (mergedProps.type === "number") {
|
|
21588
|
+
const boundValue = nextValue && bound(parseFloat(nextValue), mergedProps.min, mergedProps.max).toString();
|
|
21404
21589
|
if (Number(nextValue) !== Number(boundValue)) {
|
|
21405
21590
|
nextValue = boundValue;
|
|
21406
21591
|
}
|
|
@@ -21410,16 +21595,16 @@ const Input = forwardRef((p, ref) => {
|
|
|
21410
21595
|
}
|
|
21411
21596
|
}
|
|
21412
21597
|
const shouldShowClear = (() => {
|
|
21413
|
-
if (!
|
|
21598
|
+
if (!mergedProps.clearable || !value || mergedProps.readOnly)
|
|
21414
21599
|
return false;
|
|
21415
|
-
if (
|
|
21600
|
+
if (mergedProps.onlyShowClearWhenFocus) {
|
|
21416
21601
|
return hasFocus;
|
|
21417
21602
|
} else {
|
|
21418
21603
|
return true;
|
|
21419
21604
|
}
|
|
21420
21605
|
})();
|
|
21421
|
-
return withNativeProps(
|
|
21422
|
-
className: classNames(`${classPrefix$A}`,
|
|
21606
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
21607
|
+
className: classNames(`${classPrefix$A}`, mergedProps.disabled && `${classPrefix$A}-disabled`)
|
|
21423
21608
|
}, React__default.createElement("input", {
|
|
21424
21609
|
ref: nativeInputRef,
|
|
21425
21610
|
className: `${classPrefix$A}-element`,
|
|
@@ -21430,50 +21615,50 @@ const Input = forwardRef((p, ref) => {
|
|
|
21430
21615
|
onFocus: (e2) => {
|
|
21431
21616
|
var _a;
|
|
21432
21617
|
setHasFocus(true);
|
|
21433
|
-
(_a =
|
|
21618
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21434
21619
|
},
|
|
21435
21620
|
onBlur: (e2) => {
|
|
21436
21621
|
var _a;
|
|
21437
21622
|
setHasFocus(false);
|
|
21438
21623
|
checkValue();
|
|
21439
|
-
(_a =
|
|
21624
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21440
21625
|
},
|
|
21441
|
-
id:
|
|
21442
|
-
placeholder:
|
|
21443
|
-
disabled:
|
|
21444
|
-
readOnly:
|
|
21445
|
-
maxLength:
|
|
21446
|
-
minLength:
|
|
21447
|
-
max:
|
|
21448
|
-
min:
|
|
21449
|
-
autoComplete:
|
|
21450
|
-
enterKeyHint:
|
|
21451
|
-
autoFocus:
|
|
21452
|
-
pattern:
|
|
21453
|
-
inputMode:
|
|
21454
|
-
type:
|
|
21455
|
-
name:
|
|
21456
|
-
autoCapitalize:
|
|
21457
|
-
autoCorrect:
|
|
21626
|
+
id: mergedProps.id,
|
|
21627
|
+
placeholder: mergedProps.placeholder,
|
|
21628
|
+
disabled: mergedProps.disabled,
|
|
21629
|
+
readOnly: mergedProps.readOnly,
|
|
21630
|
+
maxLength: mergedProps.maxLength,
|
|
21631
|
+
minLength: mergedProps.minLength,
|
|
21632
|
+
max: mergedProps.max,
|
|
21633
|
+
min: mergedProps.min,
|
|
21634
|
+
autoComplete: mergedProps.autoComplete,
|
|
21635
|
+
enterKeyHint: mergedProps.enterKeyHint,
|
|
21636
|
+
autoFocus: mergedProps.autoFocus,
|
|
21637
|
+
pattern: mergedProps.pattern,
|
|
21638
|
+
inputMode: mergedProps.inputMode,
|
|
21639
|
+
type: mergedProps.type,
|
|
21640
|
+
name: mergedProps.name,
|
|
21641
|
+
autoCapitalize: mergedProps.autoCapitalize,
|
|
21642
|
+
autoCorrect: mergedProps.autoCorrect,
|
|
21458
21643
|
onKeyDown: handleKeydown,
|
|
21459
|
-
onKeyUp:
|
|
21644
|
+
onKeyUp: mergedProps.onKeyUp,
|
|
21460
21645
|
onCompositionStart: (e2) => {
|
|
21461
21646
|
var _a;
|
|
21462
21647
|
compositionStartRef.current = true;
|
|
21463
|
-
(_a =
|
|
21648
|
+
(_a = mergedProps.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21464
21649
|
},
|
|
21465
21650
|
onCompositionEnd: (e2) => {
|
|
21466
21651
|
var _a;
|
|
21467
21652
|
compositionStartRef.current = false;
|
|
21468
|
-
(_a =
|
|
21653
|
+
(_a = mergedProps.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21469
21654
|
},
|
|
21470
|
-
onClick:
|
|
21471
|
-
step:
|
|
21472
|
-
role:
|
|
21473
|
-
"aria-valuenow":
|
|
21474
|
-
"aria-valuemax":
|
|
21475
|
-
"aria-valuemin":
|
|
21476
|
-
"aria-label":
|
|
21655
|
+
onClick: mergedProps.onClick,
|
|
21656
|
+
step: mergedProps.step,
|
|
21657
|
+
role: mergedProps.role,
|
|
21658
|
+
"aria-valuenow": mergedProps["aria-valuenow"],
|
|
21659
|
+
"aria-valuemax": mergedProps["aria-valuemax"],
|
|
21660
|
+
"aria-valuemin": mergedProps["aria-valuemin"],
|
|
21661
|
+
"aria-label": mergedProps["aria-label"]
|
|
21477
21662
|
}), shouldShowClear && React__default.createElement("div", {
|
|
21478
21663
|
className: `${classPrefix$A}-clear`,
|
|
21479
21664
|
onMouseDown: (e2) => {
|
|
@@ -21482,14 +21667,14 @@ const Input = forwardRef((p, ref) => {
|
|
|
21482
21667
|
onClick: () => {
|
|
21483
21668
|
var _a, _b;
|
|
21484
21669
|
setValue2("");
|
|
21485
|
-
(_a =
|
|
21670
|
+
(_a = mergedProps.onClear) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
21486
21671
|
if (isIOS() && compositionStartRef.current) {
|
|
21487
21672
|
compositionStartRef.current = false;
|
|
21488
21673
|
(_b = nativeInputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
21489
21674
|
}
|
|
21490
21675
|
},
|
|
21491
21676
|
"aria-label": locale.Input.clear
|
|
21492
|
-
},
|
|
21677
|
+
}, mergedProps.clearIcon)));
|
|
21493
21678
|
});
|
|
21494
21679
|
const classPrefix$z = `adm-jumbo-tabs`;
|
|
21495
21680
|
const JumboTab = () => {
|
|
@@ -21604,14 +21789,14 @@ const ModalActionButton = (props) => {
|
|
|
21604
21789
|
disabled: action.disabled
|
|
21605
21790
|
}, action.text));
|
|
21606
21791
|
};
|
|
21607
|
-
const defaultProps$
|
|
21792
|
+
const defaultProps$t = {
|
|
21608
21793
|
actions: [],
|
|
21609
21794
|
closeOnAction: false,
|
|
21610
21795
|
closeOnMaskClick: false,
|
|
21611
21796
|
getContainer: null
|
|
21612
21797
|
};
|
|
21613
21798
|
const Modal = (p) => {
|
|
21614
|
-
const props = mergeProps(defaultProps$
|
|
21799
|
+
const props = mergeProps(defaultProps$t, p);
|
|
21615
21800
|
const element = React__default.createElement(React__default.Fragment, null, !!props.image && React__default.createElement("div", {
|
|
21616
21801
|
className: cls("image-container")
|
|
21617
21802
|
}, React__default.createElement(Image$1, {
|
|
@@ -21696,7 +21881,7 @@ function alert(p) {
|
|
|
21696
21881
|
}));
|
|
21697
21882
|
});
|
|
21698
21883
|
}
|
|
21699
|
-
const defaultProps$
|
|
21884
|
+
const defaultProps$s = {
|
|
21700
21885
|
confirmText: "确认",
|
|
21701
21886
|
cancelText: "取消"
|
|
21702
21887
|
};
|
|
@@ -21704,7 +21889,7 @@ function confirm(p) {
|
|
|
21704
21889
|
const {
|
|
21705
21890
|
locale
|
|
21706
21891
|
} = getDefaultConfig();
|
|
21707
|
-
const props = mergeProps(defaultProps$
|
|
21892
|
+
const props = mergeProps(defaultProps$s, {
|
|
21708
21893
|
confirmText: locale.common.confirm,
|
|
21709
21894
|
cancelText: locale.common.cancel
|
|
21710
21895
|
}, p);
|
|
@@ -21749,51 +21934,61 @@ const index$7 = attachPropertiesToComponent(Modal, {
|
|
|
21749
21934
|
clear: clear$1
|
|
21750
21935
|
});
|
|
21751
21936
|
const classPrefix$y = `adm-nav-bar`;
|
|
21752
|
-
const
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21937
|
+
const defaultBackIcon = React__default.createElement(LeftOutline, null);
|
|
21938
|
+
const NavBar = (props) => {
|
|
21939
|
+
const {
|
|
21940
|
+
navBar: componentConfig = {}
|
|
21941
|
+
} = useConfig();
|
|
21942
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
21757
21943
|
const {
|
|
21758
21944
|
back,
|
|
21945
|
+
backIcon,
|
|
21759
21946
|
backArrow
|
|
21760
|
-
} =
|
|
21761
|
-
|
|
21947
|
+
} = mergedProps;
|
|
21948
|
+
const mergedDefaultBackIcon = componentConfig.backIcon || defaultBackIcon;
|
|
21949
|
+
const mergedBackIcon = mergeProp(defaultBackIcon, componentConfig.backIcon, backArrow === true ? mergedDefaultBackIcon : backArrow, backIcon === true ? mergedDefaultBackIcon : backIcon);
|
|
21950
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
21762
21951
|
className: classNames(classPrefix$y)
|
|
21763
21952
|
}, React__default.createElement("div", {
|
|
21764
21953
|
className: `${classPrefix$y}-left`,
|
|
21765
21954
|
role: "button"
|
|
21766
21955
|
}, back !== null && React__default.createElement("div", {
|
|
21767
21956
|
className: `${classPrefix$y}-back`,
|
|
21768
|
-
onClick:
|
|
21769
|
-
},
|
|
21957
|
+
onClick: mergedProps.onBack
|
|
21958
|
+
}, mergedBackIcon && React__default.createElement("span", {
|
|
21770
21959
|
className: `${classPrefix$y}-back-arrow`
|
|
21771
|
-
},
|
|
21960
|
+
}, mergedBackIcon), React__default.createElement("span", {
|
|
21772
21961
|
"aria-hidden": "true"
|
|
21773
|
-
}, back)),
|
|
21962
|
+
}, back)), mergedProps.left), React__default.createElement("div", {
|
|
21774
21963
|
className: `${classPrefix$y}-title`
|
|
21775
|
-
},
|
|
21964
|
+
}, mergedProps.children), React__default.createElement("div", {
|
|
21776
21965
|
className: `${classPrefix$y}-right`
|
|
21777
|
-
},
|
|
21966
|
+
}, mergedProps.right)));
|
|
21778
21967
|
};
|
|
21779
21968
|
const classPrefix$x = `adm-notice-bar`;
|
|
21780
21969
|
const defaultProps$r = {
|
|
21781
21970
|
color: "default",
|
|
21782
21971
|
delay: 2e3,
|
|
21783
21972
|
speed: 50,
|
|
21784
|
-
|
|
21785
|
-
|
|
21973
|
+
icon: React__default.createElement(SoundOutline, null),
|
|
21974
|
+
wrap: false
|
|
21786
21975
|
};
|
|
21787
|
-
const NoticeBar = memo((
|
|
21788
|
-
const
|
|
21976
|
+
const NoticeBar = memo((props) => {
|
|
21977
|
+
const {
|
|
21978
|
+
noticeBar: componentConfig = {}
|
|
21979
|
+
} = useConfig();
|
|
21980
|
+
const mergedProps = mergeProps(defaultProps$r, componentConfig, props);
|
|
21981
|
+
const closeIcon = mergeProp(React__default.createElement(CloseOutline, {
|
|
21982
|
+
className: `${classPrefix$x}-close-icon`
|
|
21983
|
+
}), componentConfig.closeIcon, props.closeIcon);
|
|
21789
21984
|
const containerRef = useRef(null);
|
|
21790
21985
|
const textRef = useRef(null);
|
|
21791
21986
|
const [visible, setVisible] = useState(true);
|
|
21792
|
-
const speed =
|
|
21987
|
+
const speed = mergedProps.speed;
|
|
21793
21988
|
const delayLockRef = useRef(true);
|
|
21794
21989
|
const animatingRef = useRef(false);
|
|
21795
21990
|
function start2() {
|
|
21796
|
-
if (delayLockRef.current ||
|
|
21991
|
+
if (delayLockRef.current || mergedProps.wrap)
|
|
21797
21992
|
return;
|
|
21798
21993
|
const container = containerRef.current;
|
|
21799
21994
|
const text = textRef.current;
|
|
@@ -21822,7 +22017,7 @@ const NoticeBar = memo((p) => {
|
|
|
21822
22017
|
useTimeout$1(() => {
|
|
21823
22018
|
delayLockRef.current = false;
|
|
21824
22019
|
start2();
|
|
21825
|
-
},
|
|
22020
|
+
}, mergedProps.delay);
|
|
21826
22021
|
useResizeEffect(() => {
|
|
21827
22022
|
start2();
|
|
21828
22023
|
}, containerRef);
|
|
@@ -21835,14 +22030,14 @@ const NoticeBar = memo((p) => {
|
|
|
21835
22030
|
});
|
|
21836
22031
|
if (!visible)
|
|
21837
22032
|
return null;
|
|
21838
|
-
return withNativeProps(
|
|
21839
|
-
className: classNames(classPrefix$x, `${classPrefix$x}-${
|
|
21840
|
-
[`${classPrefix$x}-wrap`]:
|
|
22033
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
22034
|
+
className: classNames(classPrefix$x, `${classPrefix$x}-${mergedProps.color}`, {
|
|
22035
|
+
[`${classPrefix$x}-wrap`]: mergedProps.wrap
|
|
21841
22036
|
}),
|
|
21842
|
-
onClick:
|
|
21843
|
-
},
|
|
22037
|
+
onClick: mergedProps.onClick
|
|
22038
|
+
}, mergedProps.icon && React__default.createElement("span", {
|
|
21844
22039
|
className: `${classPrefix$x}-left`
|
|
21845
|
-
},
|
|
22040
|
+
}, mergedProps.icon), React__default.createElement("span", {
|
|
21846
22041
|
ref: containerRef,
|
|
21847
22042
|
className: `${classPrefix$x}-content`
|
|
21848
22043
|
}, React__default.createElement("span", {
|
|
@@ -21852,18 +22047,16 @@ const NoticeBar = memo((p) => {
|
|
|
21852
22047
|
},
|
|
21853
22048
|
ref: textRef,
|
|
21854
22049
|
className: `${classPrefix$x}-content-inner`
|
|
21855
|
-
},
|
|
22050
|
+
}, mergedProps.content)), (mergedProps.closeable || mergedProps.extra) && React__default.createElement("span", {
|
|
21856
22051
|
className: `${classPrefix$x}-right`
|
|
21857
|
-
},
|
|
22052
|
+
}, mergedProps.extra, mergedProps.closeable && React__default.createElement("div", {
|
|
21858
22053
|
className: `${classPrefix$x}-close`,
|
|
21859
22054
|
onClick: () => {
|
|
21860
22055
|
var _a;
|
|
21861
22056
|
setVisible(false);
|
|
21862
|
-
(_a =
|
|
22057
|
+
(_a = mergedProps.onClose) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
21863
22058
|
}
|
|
21864
|
-
},
|
|
21865
|
-
className: `${classPrefix$x}-close-icon`
|
|
21866
|
-
})))));
|
|
22059
|
+
}, closeIcon))));
|
|
21867
22060
|
});
|
|
21868
22061
|
function shuffle(array4) {
|
|
21869
22062
|
const result = [...array4];
|
|
@@ -21922,13 +22115,13 @@ const NumberKeyboard = (p) => {
|
|
|
21922
22115
|
var _a;
|
|
21923
22116
|
(_a = props.onDelete) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
21924
22117
|
});
|
|
21925
|
-
const
|
|
22118
|
+
const startContinueClear = () => {
|
|
21926
22119
|
timeoutRef.current = window.setTimeout(() => {
|
|
21927
22120
|
onDelete();
|
|
21928
22121
|
intervalRef.current = window.setInterval(onDelete, 150);
|
|
21929
22122
|
}, 700);
|
|
21930
22123
|
};
|
|
21931
|
-
const
|
|
22124
|
+
const stopContinueClear = () => {
|
|
21932
22125
|
clearTimeout(timeoutRef.current);
|
|
21933
22126
|
clearInterval(intervalRef.current);
|
|
21934
22127
|
};
|
|
@@ -21988,14 +22181,15 @@ const NumberKeyboard = (p) => {
|
|
|
21988
22181
|
key,
|
|
21989
22182
|
className,
|
|
21990
22183
|
onTouchStart: () => {
|
|
22184
|
+
stopContinueClear();
|
|
21991
22185
|
if (key === "BACKSPACE") {
|
|
21992
|
-
|
|
22186
|
+
startContinueClear();
|
|
21993
22187
|
}
|
|
21994
22188
|
},
|
|
21995
22189
|
onTouchEnd: (e2) => {
|
|
21996
22190
|
onKeyPress(e2, key);
|
|
21997
22191
|
if (key === "BACKSPACE") {
|
|
21998
|
-
|
|
22192
|
+
stopContinueClear();
|
|
21999
22193
|
}
|
|
22000
22194
|
}
|
|
22001
22195
|
}, ariaProps), key === "BACKSPACE" ? React__default.createElement(TextDeletionOutline, null) : key);
|
|
@@ -22027,11 +22221,11 @@ const NumberKeyboard = (p) => {
|
|
|
22027
22221
|
}, React__default.createElement("div", {
|
|
22028
22222
|
className: `${classPrefix$w}-key ${classPrefix$w}-key-extra ${classPrefix$w}-key-bs`,
|
|
22029
22223
|
onTouchStart: () => {
|
|
22030
|
-
|
|
22224
|
+
startContinueClear();
|
|
22031
22225
|
},
|
|
22032
22226
|
onTouchEnd: (e2) => {
|
|
22033
22227
|
onKeyPress(e2, "BACKSPACE");
|
|
22034
|
-
|
|
22228
|
+
stopContinueClear();
|
|
22035
22229
|
},
|
|
22036
22230
|
onContextMenu: (e2) => {
|
|
22037
22231
|
e2.preventDefault();
|
|
@@ -22599,14 +22793,33 @@ const Rate = (p) => {
|
|
|
22599
22793
|
className: classNames(`${classPrefix$p}-box`)
|
|
22600
22794
|
}, props.allowHalf && renderStar(i2 + 0.5, true), renderStar(i2 + 1, false)))));
|
|
22601
22795
|
};
|
|
22602
|
-
const
|
|
22603
|
-
const
|
|
22604
|
-
|
|
22605
|
-
|
|
22606
|
-
|
|
22607
|
-
|
|
22608
|
-
|
|
22796
|
+
const useResultIcon = (status) => {
|
|
22797
|
+
const {
|
|
22798
|
+
result: componentConfig = {}
|
|
22799
|
+
} = useConfig();
|
|
22800
|
+
const {
|
|
22801
|
+
successIcon = React__default.createElement(CheckCircleFill, null),
|
|
22802
|
+
errorIcon = React__default.createElement(CloseCircleFill, null),
|
|
22803
|
+
infoIcon = React__default.createElement(InformationCircleFill, null),
|
|
22804
|
+
waitingIcon = React__default.createElement(ClockCircleFill, null),
|
|
22805
|
+
warningIcon = React__default.createElement(ExclamationCircleFill, null)
|
|
22806
|
+
} = componentConfig || {};
|
|
22807
|
+
switch (status) {
|
|
22808
|
+
case "success":
|
|
22809
|
+
return successIcon;
|
|
22810
|
+
case "error":
|
|
22811
|
+
return errorIcon;
|
|
22812
|
+
case "info":
|
|
22813
|
+
return infoIcon;
|
|
22814
|
+
case "waiting":
|
|
22815
|
+
return waitingIcon;
|
|
22816
|
+
case "warning":
|
|
22817
|
+
return warningIcon;
|
|
22818
|
+
default:
|
|
22819
|
+
return null;
|
|
22820
|
+
}
|
|
22609
22821
|
};
|
|
22822
|
+
const classPrefix$o = `adm-result`;
|
|
22610
22823
|
const defaultProps$i = {
|
|
22611
22824
|
status: "info"
|
|
22612
22825
|
};
|
|
@@ -22618,27 +22831,20 @@ const Result = (p) => {
|
|
|
22618
22831
|
description,
|
|
22619
22832
|
icon
|
|
22620
22833
|
} = props;
|
|
22834
|
+
const fallbackIcon = useResultIcon(status);
|
|
22621
22835
|
if (!status)
|
|
22622
22836
|
return null;
|
|
22623
|
-
const resultIcon = icon || React__default.createElement(iconRecord$1[status]);
|
|
22624
22837
|
return withNativeProps(props, React__default.createElement("div", {
|
|
22625
22838
|
className: classNames(classPrefix$o, `${classPrefix$o}-${status}`)
|
|
22626
22839
|
}, React__default.createElement("div", {
|
|
22627
22840
|
className: `${classPrefix$o}-icon`
|
|
22628
|
-
},
|
|
22841
|
+
}, icon || fallbackIcon), React__default.createElement("div", {
|
|
22629
22842
|
className: `${classPrefix$o}-title`
|
|
22630
22843
|
}, title), !!description && React__default.createElement("div", {
|
|
22631
22844
|
className: `${classPrefix$o}-description`
|
|
22632
22845
|
}, description)));
|
|
22633
22846
|
};
|
|
22634
22847
|
const classPrefix$n = `adm-result-page`;
|
|
22635
|
-
const iconRecord = {
|
|
22636
|
-
success: CheckCircleFill,
|
|
22637
|
-
error: CloseCircleFill,
|
|
22638
|
-
info: InformationCircleFill,
|
|
22639
|
-
waiting: ClockCircleFill,
|
|
22640
|
-
warning: ExclamationCircleFill
|
|
22641
|
-
};
|
|
22642
22848
|
const defaultProps$h = {
|
|
22643
22849
|
status: "info",
|
|
22644
22850
|
details: []
|
|
@@ -22656,7 +22862,7 @@ const ResultPage = (p) => {
|
|
|
22656
22862
|
onPrimaryButtonClick,
|
|
22657
22863
|
onSecondaryButtonClick
|
|
22658
22864
|
} = props;
|
|
22659
|
-
const
|
|
22865
|
+
const fallbackIcon = useResultIcon(status);
|
|
22660
22866
|
const [collapse, setCollapse] = useState(true);
|
|
22661
22867
|
const showSecondaryButton = isNodeWithContent(secondaryButtonText);
|
|
22662
22868
|
const showPrimaryButton = isNodeWithContent(primaryButtonText);
|
|
@@ -22666,7 +22872,7 @@ const ResultPage = (p) => {
|
|
|
22666
22872
|
className: `${classPrefix$n}-header`
|
|
22667
22873
|
}, React__default.createElement("div", {
|
|
22668
22874
|
className: `${classPrefix$n}-icon`
|
|
22669
|
-
},
|
|
22875
|
+
}, icon || fallbackIcon), React__default.createElement("div", {
|
|
22670
22876
|
className: `${classPrefix$n}-title`
|
|
22671
22877
|
}, title), isNodeWithContent(description) ? React__default.createElement("div", {
|
|
22672
22878
|
className: `${classPrefix$n}-description`
|
|
@@ -22722,17 +22928,18 @@ const defaultProps$g = {
|
|
|
22722
22928
|
onlyShowClearWhenFocus: false,
|
|
22723
22929
|
showCancelButton: false,
|
|
22724
22930
|
defaultValue: "",
|
|
22725
|
-
clearOnCancel: true
|
|
22726
|
-
icon: React__default.createElement(SearchOutline, null)
|
|
22931
|
+
clearOnCancel: true
|
|
22727
22932
|
};
|
|
22728
|
-
const SearchBar = forwardRef((
|
|
22933
|
+
const SearchBar = forwardRef((props, ref) => {
|
|
22729
22934
|
const {
|
|
22730
|
-
locale
|
|
22935
|
+
locale,
|
|
22936
|
+
searchBar: componentConfig = {}
|
|
22731
22937
|
} = useConfig();
|
|
22732
|
-
const
|
|
22938
|
+
const mergedProps = mergeProps(defaultProps$g, componentConfig, {
|
|
22733
22939
|
cancelText: locale.common.cancel
|
|
22734
|
-
},
|
|
22735
|
-
const
|
|
22940
|
+
}, props);
|
|
22941
|
+
const searchIcon = mergeProp(React__default.createElement(SearchOutline, null), componentConfig.searchIcon, props.icon, props.searchIcon);
|
|
22942
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
22736
22943
|
const [hasFocus, setHasFocus] = useState(false);
|
|
22737
22944
|
const inputRef = useRef(null);
|
|
22738
22945
|
const composingRef = useRef(false);
|
|
@@ -22756,10 +22963,10 @@ const SearchBar = forwardRef((p, ref) => {
|
|
|
22756
22963
|
}));
|
|
22757
22964
|
const renderCancelButton = () => {
|
|
22758
22965
|
let isShowCancel;
|
|
22759
|
-
if (typeof
|
|
22760
|
-
isShowCancel =
|
|
22966
|
+
if (typeof mergedProps.showCancelButton === "function") {
|
|
22967
|
+
isShowCancel = mergedProps.showCancelButton(hasFocus, value);
|
|
22761
22968
|
} else {
|
|
22762
|
-
isShowCancel =
|
|
22969
|
+
isShowCancel = mergedProps.showCancelButton && hasFocus;
|
|
22763
22970
|
}
|
|
22764
22971
|
return isShowCancel && React__default.createElement("div", {
|
|
22765
22972
|
className: `${classPrefix$l}-suffix`
|
|
@@ -22768,66 +22975,66 @@ const SearchBar = forwardRef((p, ref) => {
|
|
|
22768
22975
|
className: `${classPrefix$l}-cancel-button`,
|
|
22769
22976
|
onClick: () => {
|
|
22770
22977
|
var _a, _b, _c;
|
|
22771
|
-
if (
|
|
22978
|
+
if (mergedProps.clearOnCancel) {
|
|
22772
22979
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.clear();
|
|
22773
22980
|
}
|
|
22774
22981
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
22775
|
-
(_c =
|
|
22982
|
+
(_c = mergedProps.onCancel) === null || _c === void 0 ? void 0 : _c.call(mergedProps);
|
|
22776
22983
|
},
|
|
22777
22984
|
onMouseDown: (e2) => {
|
|
22778
22985
|
e2.preventDefault();
|
|
22779
22986
|
}
|
|
22780
|
-
},
|
|
22987
|
+
}, mergedProps.cancelText));
|
|
22781
22988
|
};
|
|
22782
|
-
return withNativeProps(
|
|
22989
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
22783
22990
|
className: classNames(classPrefix$l, {
|
|
22784
22991
|
[`${classPrefix$l}-active`]: hasFocus
|
|
22785
22992
|
})
|
|
22786
22993
|
}, React__default.createElement("div", {
|
|
22787
22994
|
className: `${classPrefix$l}-input-box`
|
|
22788
|
-
},
|
|
22995
|
+
}, searchIcon && React__default.createElement("div", {
|
|
22789
22996
|
className: `${classPrefix$l}-input-box-icon`
|
|
22790
|
-
},
|
|
22997
|
+
}, searchIcon), React__default.createElement(Input, {
|
|
22791
22998
|
ref: inputRef,
|
|
22792
22999
|
className: classNames(`${classPrefix$l}-input`, {
|
|
22793
|
-
[`${classPrefix$l}-input-without-icon`]: !
|
|
23000
|
+
[`${classPrefix$l}-input-without-icon`]: !searchIcon
|
|
22794
23001
|
}),
|
|
22795
23002
|
value,
|
|
22796
23003
|
onChange: setValue2,
|
|
22797
|
-
maxLength:
|
|
22798
|
-
placeholder:
|
|
22799
|
-
clearable:
|
|
22800
|
-
onlyShowClearWhenFocus:
|
|
23004
|
+
maxLength: mergedProps.maxLength,
|
|
23005
|
+
placeholder: mergedProps.placeholder,
|
|
23006
|
+
clearable: mergedProps.clearable,
|
|
23007
|
+
onlyShowClearWhenFocus: mergedProps.onlyShowClearWhenFocus,
|
|
22801
23008
|
onFocus: (e2) => {
|
|
22802
23009
|
var _a;
|
|
22803
23010
|
setHasFocus(true);
|
|
22804
|
-
(_a =
|
|
23011
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22805
23012
|
},
|
|
22806
23013
|
onBlur: (e2) => {
|
|
22807
23014
|
var _a;
|
|
22808
23015
|
setHasFocus(false);
|
|
22809
|
-
(_a =
|
|
23016
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22810
23017
|
},
|
|
22811
|
-
onClear:
|
|
23018
|
+
onClear: mergedProps.onClear,
|
|
22812
23019
|
type: "search",
|
|
22813
23020
|
enterKeyHint: "search",
|
|
22814
23021
|
onEnterPress: () => {
|
|
22815
23022
|
var _a, _b;
|
|
22816
23023
|
if (!composingRef.current) {
|
|
22817
23024
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
22818
|
-
(_b =
|
|
23025
|
+
(_b = mergedProps.onSearch) === null || _b === void 0 ? void 0 : _b.call(mergedProps, value);
|
|
22819
23026
|
}
|
|
22820
23027
|
},
|
|
22821
23028
|
"aria-label": locale.SearchBar.name,
|
|
22822
23029
|
onCompositionStart: (e2) => {
|
|
22823
23030
|
var _a;
|
|
22824
23031
|
composingRef.current = true;
|
|
22825
|
-
(_a =
|
|
23032
|
+
(_a = mergedProps.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22826
23033
|
},
|
|
22827
23034
|
onCompositionEnd: (e2) => {
|
|
22828
23035
|
var _a;
|
|
22829
23036
|
composingRef.current = false;
|
|
22830
|
-
(_a =
|
|
23037
|
+
(_a = mergedProps.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22831
23038
|
}
|
|
22832
23039
|
})), renderCancelButton()));
|
|
22833
23040
|
});
|
|
@@ -23714,93 +23921,6 @@ const Slider = (p) => {
|
|
|
23714
23921
|
upperBound: sliderValue[1]
|
|
23715
23922
|
})));
|
|
23716
23923
|
};
|
|
23717
|
-
function useEvent(callback) {
|
|
23718
|
-
var fnRef = React$1.useRef();
|
|
23719
|
-
fnRef.current = callback;
|
|
23720
|
-
var memoFn = React$1.useCallback(function() {
|
|
23721
|
-
var _fnRef$current;
|
|
23722
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23723
|
-
args[_key] = arguments[_key];
|
|
23724
|
-
}
|
|
23725
|
-
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
23726
|
-
}, []);
|
|
23727
|
-
return memoFn;
|
|
23728
|
-
}
|
|
23729
|
-
function canUseDom() {
|
|
23730
|
-
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
23731
|
-
}
|
|
23732
|
-
var useInternalLayoutEffect = canUseDom() ? React$1.useLayoutEffect : React$1.useEffect;
|
|
23733
|
-
var useLayoutEffect = function useLayoutEffect2(callback, deps) {
|
|
23734
|
-
var firstMountRef = React$1.useRef(true);
|
|
23735
|
-
useInternalLayoutEffect(function() {
|
|
23736
|
-
return callback(firstMountRef.current);
|
|
23737
|
-
}, deps);
|
|
23738
|
-
useInternalLayoutEffect(function() {
|
|
23739
|
-
firstMountRef.current = false;
|
|
23740
|
-
return function() {
|
|
23741
|
-
firstMountRef.current = true;
|
|
23742
|
-
};
|
|
23743
|
-
}, []);
|
|
23744
|
-
};
|
|
23745
|
-
var useLayoutUpdateEffect = function useLayoutUpdateEffect2(callback, deps) {
|
|
23746
|
-
useLayoutEffect(function(firstMount) {
|
|
23747
|
-
if (!firstMount) {
|
|
23748
|
-
return callback();
|
|
23749
|
-
}
|
|
23750
|
-
}, deps);
|
|
23751
|
-
};
|
|
23752
|
-
function useSafeState(defaultValue) {
|
|
23753
|
-
var destroyRef = React$1.useRef(false);
|
|
23754
|
-
var _React$useState = React$1.useState(defaultValue), _React$useState2 = _slicedToArray(_React$useState, 2), value = _React$useState2[0], setValue2 = _React$useState2[1];
|
|
23755
|
-
React$1.useEffect(function() {
|
|
23756
|
-
destroyRef.current = false;
|
|
23757
|
-
return function() {
|
|
23758
|
-
destroyRef.current = true;
|
|
23759
|
-
};
|
|
23760
|
-
}, []);
|
|
23761
|
-
function safeSetState(updater, ignoreDestroy) {
|
|
23762
|
-
if (ignoreDestroy && destroyRef.current) {
|
|
23763
|
-
return;
|
|
23764
|
-
}
|
|
23765
|
-
setValue2(updater);
|
|
23766
|
-
}
|
|
23767
|
-
return [value, safeSetState];
|
|
23768
|
-
}
|
|
23769
|
-
function hasValue(value) {
|
|
23770
|
-
return value !== void 0;
|
|
23771
|
-
}
|
|
23772
|
-
function useMergedState(defaultStateValue, option) {
|
|
23773
|
-
var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState;
|
|
23774
|
-
var _useState = useSafeState(function() {
|
|
23775
|
-
if (hasValue(value)) {
|
|
23776
|
-
return value;
|
|
23777
|
-
} else if (hasValue(defaultValue)) {
|
|
23778
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
23779
|
-
} else {
|
|
23780
|
-
return typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue;
|
|
23781
|
-
}
|
|
23782
|
-
}), _useState2 = _slicedToArray(_useState, 2), innerValue = _useState2[0], setInnerValue = _useState2[1];
|
|
23783
|
-
var mergedValue = value !== void 0 ? value : innerValue;
|
|
23784
|
-
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
|
|
23785
|
-
var onChangeFn = useEvent(onChange);
|
|
23786
|
-
var _useState3 = useSafeState([mergedValue]), _useState4 = _slicedToArray(_useState3, 2), prevValue = _useState4[0], setPrevValue = _useState4[1];
|
|
23787
|
-
useLayoutUpdateEffect(function() {
|
|
23788
|
-
var prev = prevValue[0];
|
|
23789
|
-
if (innerValue !== prev) {
|
|
23790
|
-
onChangeFn(innerValue, prev);
|
|
23791
|
-
}
|
|
23792
|
-
}, [prevValue]);
|
|
23793
|
-
useLayoutUpdateEffect(function() {
|
|
23794
|
-
if (!hasValue(value)) {
|
|
23795
|
-
setInnerValue(value);
|
|
23796
|
-
}
|
|
23797
|
-
}, [value]);
|
|
23798
|
-
var triggerChange = useEvent(function(updater, ignoreDestroy) {
|
|
23799
|
-
setInnerValue(updater, ignoreDestroy);
|
|
23800
|
-
setPrevValue([mergedValue], ignoreDestroy);
|
|
23801
|
-
});
|
|
23802
|
-
return [postMergedValue, triggerChange];
|
|
23803
|
-
}
|
|
23804
23924
|
const classPrefix$e = `adm-stepper`;
|
|
23805
23925
|
const defaultProps$d = {
|
|
23806
23926
|
step: 1,
|
|
@@ -25426,15 +25546,17 @@ const classPrefix$2 = "adm-virtual-input";
|
|
|
25426
25546
|
const defaultProps$2 = {
|
|
25427
25547
|
defaultValue: ""
|
|
25428
25548
|
};
|
|
25429
|
-
const VirtualInput = forwardRef((
|
|
25430
|
-
const
|
|
25431
|
-
|
|
25549
|
+
const VirtualInput = forwardRef((props, ref) => {
|
|
25550
|
+
const {
|
|
25551
|
+
locale,
|
|
25552
|
+
input: componentConfig = {}
|
|
25553
|
+
} = useConfig();
|
|
25554
|
+
const mergedProps = mergeProps(defaultProps$2, componentConfig, props);
|
|
25555
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
25432
25556
|
const rootRef = useRef(null);
|
|
25433
25557
|
const contentRef = useRef(null);
|
|
25434
25558
|
const [hasFocus, setHasFocus] = useState(false);
|
|
25435
|
-
const
|
|
25436
|
-
locale
|
|
25437
|
-
} = useConfig();
|
|
25559
|
+
const clearIcon = mergeProp(React__default.createElement(CloseCircleFill, null), componentConfig.clearIcon, props.clearIcon);
|
|
25438
25560
|
function scrollToEnd() {
|
|
25439
25561
|
const root2 = rootRef.current;
|
|
25440
25562
|
if (!root2)
|
|
@@ -25468,14 +25590,14 @@ const VirtualInput = forwardRef((p, ref) => {
|
|
|
25468
25590
|
function onFocus() {
|
|
25469
25591
|
var _a;
|
|
25470
25592
|
setHasFocus(true);
|
|
25471
|
-
(_a =
|
|
25593
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25472
25594
|
}
|
|
25473
25595
|
function onBlur() {
|
|
25474
25596
|
var _a;
|
|
25475
25597
|
setHasFocus(false);
|
|
25476
|
-
(_a =
|
|
25598
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25477
25599
|
}
|
|
25478
|
-
const keyboard =
|
|
25600
|
+
const keyboard = mergedProps.keyboard;
|
|
25479
25601
|
const keyboardElement = keyboard && React__default.cloneElement(keyboard, {
|
|
25480
25602
|
onInput: (v) => {
|
|
25481
25603
|
var _a, _b;
|
|
@@ -25500,38 +25622,38 @@ const VirtualInput = forwardRef((p, ref) => {
|
|
|
25500
25622
|
},
|
|
25501
25623
|
getContainer: null
|
|
25502
25624
|
});
|
|
25503
|
-
return withNativeProps(
|
|
25625
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
25504
25626
|
ref: rootRef,
|
|
25505
25627
|
className: classNames(classPrefix$2, {
|
|
25506
|
-
[`${classPrefix$2}-disabled`]:
|
|
25628
|
+
[`${classPrefix$2}-disabled`]: mergedProps.disabled
|
|
25507
25629
|
}),
|
|
25508
|
-
tabIndex:
|
|
25630
|
+
tabIndex: mergedProps.disabled ? void 0 : 0,
|
|
25509
25631
|
role: "textbox",
|
|
25510
25632
|
onFocus,
|
|
25511
25633
|
onBlur,
|
|
25512
|
-
onClick:
|
|
25634
|
+
onClick: mergedProps.onClick
|
|
25513
25635
|
}, React__default.createElement("div", {
|
|
25514
25636
|
className: `${classPrefix$2}-content`,
|
|
25515
25637
|
ref: contentRef,
|
|
25516
|
-
"aria-disabled":
|
|
25517
|
-
"aria-label":
|
|
25638
|
+
"aria-disabled": mergedProps.disabled,
|
|
25639
|
+
"aria-label": mergedProps.placeholder
|
|
25518
25640
|
}, value, React__default.createElement("div", {
|
|
25519
25641
|
className: `${classPrefix$2}-caret-container`
|
|
25520
25642
|
}, hasFocus && React__default.createElement("div", {
|
|
25521
25643
|
className: `${classPrefix$2}-caret`
|
|
25522
|
-
}))),
|
|
25644
|
+
}))), mergedProps.clearable && !!value && hasFocus && React__default.createElement("div", {
|
|
25523
25645
|
className: `${classPrefix$2}-clear`,
|
|
25524
25646
|
onClick: (e2) => {
|
|
25525
25647
|
var _a;
|
|
25526
25648
|
e2.stopPropagation();
|
|
25527
25649
|
setValue2("");
|
|
25528
|
-
(_a =
|
|
25650
|
+
(_a = mergedProps.onClear) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25529
25651
|
},
|
|
25530
25652
|
role: "button",
|
|
25531
25653
|
"aria-label": locale.Input.clear
|
|
25532
|
-
},
|
|
25654
|
+
}, clearIcon), [void 0, null, ""].includes(value) && React__default.createElement("div", {
|
|
25533
25655
|
className: `${classPrefix$2}-placeholder`
|
|
25534
|
-
},
|
|
25656
|
+
}, mergedProps.placeholder), keyboardElement));
|
|
25535
25657
|
});
|
|
25536
25658
|
const classPrefix$1 = `adm-water-mark`;
|
|
25537
25659
|
const defaultProps$1 = {
|