antd-mobile 5.36.1 → 5.37.0
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 +355 -283
- package/2x/bundle/antd-mobile.cjs.js +7 -7
- package/2x/bundle/antd-mobile.es.development.js +355 -283
- package/2x/bundle/antd-mobile.es.js +5428 -5379
- package/2x/bundle/antd-mobile.umd.development.js +355 -283
- package/2x/bundle/antd-mobile.umd.js +7 -7
- package/2x/bundle/style.css +5 -8
- 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 +18 -13
- 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/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 +18 -13
- 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 +355 -283
- package/bundle/antd-mobile.cjs.js +7 -7
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +355 -283
- package/bundle/antd-mobile.es.js +5428 -5379
- package/bundle/antd-mobile.umd.development.js +355 -283
- package/bundle/antd-mobile.umd.js +7 -7
- package/bundle/style.css +1 -1
- 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 +18 -13
- 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/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 +18 -13
- package/es/components/notice-bar/notice-bar.css +0 -2
- package/es/components/notice-bar/notice-bar.d.ts +3 -1
- package/es/components/notice-bar/notice-bar.js +29 -24
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/es/components/number-keyboard/number-keyboard.js +13 -12
- package/es/components/popup/popup-base-props.d.ts +3 -2
- package/es/components/popup/popup-base-props.js +3 -0
- package/es/components/popup/popup.js +5 -5
- package/es/components/result/result.js +3 -10
- package/es/components/result/use-result-icon.d.ts +3 -0
- package/es/components/result/use-result-icon.js +29 -0
- package/es/components/result-page/result-page.js +3 -10
- package/es/components/search-bar/search-bar.d.ts +10 -2
- package/es/components/search-bar/search-bar.js +33 -32
- package/es/components/toast/toast.css +1 -1
- package/es/components/toast/toast.d.ts +2 -2
- package/es/components/toast/toast.js +3 -3
- package/es/components/virtual-input/virtual-input.d.ts +5 -5
- package/es/components/virtual-input/virtual-input.js +25 -23
- package/es/utils/is-node-with-content.d.ts +3 -0
- package/es/utils/is-node-with-content.js +3 -0
- package/es/utils/with-default-props.d.ts +7 -0
- package/es/utils/with-default-props.js +20 -5
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -452,14 +452,24 @@
|
|
|
452
452
|
function mergeProps(...items) {
|
|
453
453
|
const ret = {};
|
|
454
454
|
items.forEach((item) => {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
455
|
+
if (item) {
|
|
456
|
+
Object.keys(item).forEach((key) => {
|
|
457
|
+
if (item[key] !== void 0) {
|
|
458
|
+
ret[key] = item[key];
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
}
|
|
460
462
|
});
|
|
461
463
|
return ret;
|
|
462
464
|
}
|
|
465
|
+
function mergeProp(defaultProp, ...propList) {
|
|
466
|
+
for (let i2 = propList.length - 1; i2 >= 0; i2 -= 1) {
|
|
467
|
+
if (propList[i2] !== void 0) {
|
|
468
|
+
return propList[i2];
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return defaultProp;
|
|
472
|
+
}
|
|
463
473
|
var createUpdateEffect = function(hook) {
|
|
464
474
|
return function(effect, deps) {
|
|
465
475
|
var isMounted = React$1.useRef(false);
|
|
@@ -6511,6 +6521,7 @@
|
|
|
6511
6521
|
}
|
|
6512
6522
|
const defaultPopupBaseProps = {
|
|
6513
6523
|
closeOnMaskClick: false,
|
|
6524
|
+
closeIcon: React$1.createElement(CloseOutline, null),
|
|
6514
6525
|
destroyOnClose: false,
|
|
6515
6526
|
disableBodyScroll: true,
|
|
6516
6527
|
forceRender: false,
|
|
@@ -8368,11 +8379,12 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
8368
8379
|
position: "bottom"
|
|
8369
8380
|
});
|
|
8370
8381
|
const Popup = (p) => {
|
|
8371
|
-
const props = mergeProps(defaultProps$14, p);
|
|
8372
|
-
const bodyCls = classNames(`${classPrefix$1o}-body`, props.bodyClassName, `${classPrefix$1o}-body-position-${props.position}`);
|
|
8373
8382
|
const {
|
|
8374
|
-
locale
|
|
8383
|
+
locale,
|
|
8384
|
+
popup: componentConfig = {}
|
|
8375
8385
|
} = useConfig();
|
|
8386
|
+
const props = mergeProps(defaultProps$14, componentConfig, p);
|
|
8387
|
+
const bodyCls = classNames(`${classPrefix$1o}-body`, props.bodyClassName, `${classPrefix$1o}-body-position-${props.position}`);
|
|
8376
8388
|
const [active, setActive] = React$1.useState(props.visible);
|
|
8377
8389
|
const ref = React$1.useRef(null);
|
|
8378
8390
|
useLockScroll(ref, props.disableBodyScroll && active ? "strict" : false);
|
|
@@ -8469,7 +8481,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
8469
8481
|
},
|
|
8470
8482
|
role: "button",
|
|
8471
8483
|
"aria-label": locale.common.close
|
|
8472
|
-
},
|
|
8484
|
+
}, props.closeIcon), props.children))));
|
|
8473
8485
|
return React$1.createElement(ShouldRender, {
|
|
8474
8486
|
active,
|
|
8475
8487
|
forceRender: props.forceRender,
|
|
@@ -11413,9 +11425,17 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
11413
11425
|
}
|
|
11414
11426
|
const classPrefix$12 = `adm-list-item`;
|
|
11415
11427
|
const ListItem = (props) => {
|
|
11416
|
-
var _a;
|
|
11428
|
+
var _a, _b;
|
|
11429
|
+
const {
|
|
11430
|
+
arrow: arrow2,
|
|
11431
|
+
arrowIcon
|
|
11432
|
+
} = props;
|
|
11433
|
+
const {
|
|
11434
|
+
list: componentConfig = {}
|
|
11435
|
+
} = useConfig();
|
|
11417
11436
|
const clickable = (_a = props.clickable) !== null && _a !== void 0 ? _a : !!props.onClick;
|
|
11418
|
-
const
|
|
11437
|
+
const showArrow = (_b = arrow2 !== null && arrow2 !== void 0 ? arrow2 : arrowIcon) !== null && _b !== void 0 ? _b : clickable;
|
|
11438
|
+
const mergedArrowIcon = mergeProp(componentConfig.arrowIcon, arrow2 !== true ? arrow2 : null, arrowIcon !== true ? arrowIcon : null);
|
|
11419
11439
|
const content = React$1.createElement("div", {
|
|
11420
11440
|
className: `${classPrefix$12}-content`
|
|
11421
11441
|
}, isNodeWithContent(props.prefix) && React$1.createElement("div", {
|
|
@@ -11428,9 +11448,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
11428
11448
|
className: `${classPrefix$12}-description`
|
|
11429
11449
|
}, props.description)), isNodeWithContent(props.extra) && React$1.createElement("div", {
|
|
11430
11450
|
className: `${classPrefix$12}-content-extra`
|
|
11431
|
-
}, props.extra),
|
|
11451
|
+
}, props.extra), showArrow && React$1.createElement("div", {
|
|
11432
11452
|
className: `${classPrefix$12}-content-arrow`
|
|
11433
|
-
},
|
|
11453
|
+
}, mergedArrowIcon || React$1.createElement(RightOutline, null)));
|
|
11434
11454
|
return withNativeProps(props, React$1.createElement(clickable ? "a" : "div", {
|
|
11435
11455
|
className: classNames(`${classPrefix$12}`, clickable ? ["adm-plain-anchor"] : [], props.disabled && `${classPrefix$12}-disabled`),
|
|
11436
11456
|
onClick: props.disabled ? void 0 : props.onClick
|
|
@@ -11446,11 +11466,14 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
11446
11466
|
defaultValue: [],
|
|
11447
11467
|
activeIcon: React$1.createElement(CheckOutline, null)
|
|
11448
11468
|
};
|
|
11449
|
-
const CheckList$1 = (
|
|
11450
|
-
const
|
|
11451
|
-
|
|
11469
|
+
const CheckList$1 = (props) => {
|
|
11470
|
+
const {
|
|
11471
|
+
checkList: componentConfig = {}
|
|
11472
|
+
} = useConfig();
|
|
11473
|
+
const mergedProps = mergeProps(defaultProps$R, componentConfig, props);
|
|
11474
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
11452
11475
|
function check(val) {
|
|
11453
|
-
if (
|
|
11476
|
+
if (mergedProps.multiple) {
|
|
11454
11477
|
setValue2([...value, val]);
|
|
11455
11478
|
} else {
|
|
11456
11479
|
setValue2([val]);
|
|
@@ -11464,7 +11487,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
11464
11487
|
extra,
|
|
11465
11488
|
disabled,
|
|
11466
11489
|
readOnly
|
|
11467
|
-
} =
|
|
11490
|
+
} = mergedProps;
|
|
11468
11491
|
return React$1.createElement(CheckListContext.Provider, {
|
|
11469
11492
|
value: {
|
|
11470
11493
|
value,
|
|
@@ -11475,10 +11498,10 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
11475
11498
|
disabled,
|
|
11476
11499
|
readOnly
|
|
11477
11500
|
}
|
|
11478
|
-
}, withNativeProps(
|
|
11479
|
-
mode:
|
|
11501
|
+
}, withNativeProps(mergedProps, React$1.createElement(List$1, {
|
|
11502
|
+
mode: mergedProps.mode,
|
|
11480
11503
|
className: classPrefix$11
|
|
11481
|
-
},
|
|
11504
|
+
}, mergedProps.children)));
|
|
11482
11505
|
};
|
|
11483
11506
|
const classPrefix$10 = `adm-check-list-item`;
|
|
11484
11507
|
const CheckListItem = (props) => {
|
|
@@ -11951,12 +11974,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
11951
11974
|
const defaultProps$O = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
11952
11975
|
getContainer: null
|
|
11953
11976
|
});
|
|
11954
|
-
const CenterPopup = (
|
|
11955
|
-
const
|
|
11977
|
+
const CenterPopup = (props) => {
|
|
11978
|
+
const {
|
|
11979
|
+
popup: componentConfig = {}
|
|
11980
|
+
} = useConfig();
|
|
11981
|
+
const mergedProps = mergeProps(defaultProps$O, componentConfig, props);
|
|
11956
11982
|
const unmountedRef = useUnmountedRef$1();
|
|
11957
11983
|
const style = useSpring({
|
|
11958
|
-
scale:
|
|
11959
|
-
opacity:
|
|
11984
|
+
scale: mergedProps.visible ? 1 : 0.8,
|
|
11985
|
+
opacity: mergedProps.visible ? 1 : 0,
|
|
11960
11986
|
config: {
|
|
11961
11987
|
mass: 1.2,
|
|
11962
11988
|
tension: 200,
|
|
@@ -11967,69 +11993,69 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
11967
11993
|
var _a, _b;
|
|
11968
11994
|
if (unmountedRef.current)
|
|
11969
11995
|
return;
|
|
11970
|
-
setActive(
|
|
11971
|
-
if (
|
|
11972
|
-
(_a =
|
|
11996
|
+
setActive(mergedProps.visible);
|
|
11997
|
+
if (mergedProps.visible) {
|
|
11998
|
+
(_a = mergedProps.afterShow) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
11973
11999
|
} else {
|
|
11974
|
-
(_b =
|
|
12000
|
+
(_b = mergedProps.afterClose) === null || _b === void 0 ? void 0 : _b.call(mergedProps);
|
|
11975
12001
|
}
|
|
11976
12002
|
}
|
|
11977
12003
|
});
|
|
11978
|
-
const [active, setActive] = React$1.useState(
|
|
12004
|
+
const [active, setActive] = React$1.useState(mergedProps.visible);
|
|
11979
12005
|
useIsomorphicLayoutEffect$2(() => {
|
|
11980
|
-
if (
|
|
12006
|
+
if (mergedProps.visible) {
|
|
11981
12007
|
setActive(true);
|
|
11982
12008
|
}
|
|
11983
|
-
}, [
|
|
12009
|
+
}, [mergedProps.visible]);
|
|
11984
12010
|
const ref = React$1.useRef(null);
|
|
11985
|
-
useLockScroll(ref,
|
|
11986
|
-
const maskVisible = useInnerVisible(active &&
|
|
12011
|
+
useLockScroll(ref, mergedProps.disableBodyScroll && active);
|
|
12012
|
+
const maskVisible = useInnerVisible(active && mergedProps.visible);
|
|
11987
12013
|
const body = React$1.createElement("div", {
|
|
11988
|
-
className: classNames(`${classPrefix$Y}-body`,
|
|
11989
|
-
style:
|
|
11990
|
-
},
|
|
11991
|
-
const node = withStopPropagation(
|
|
12014
|
+
className: classNames(`${classPrefix$Y}-body`, mergedProps.bodyClassName),
|
|
12015
|
+
style: mergedProps.bodyStyle
|
|
12016
|
+
}, mergedProps.children);
|
|
12017
|
+
const node = withStopPropagation(mergedProps.stopPropagation, withNativeProps(mergedProps, React$1.createElement("div", {
|
|
11992
12018
|
className: classPrefix$Y,
|
|
11993
12019
|
style: {
|
|
11994
12020
|
display: active ? void 0 : "none",
|
|
11995
12021
|
pointerEvents: active ? void 0 : "none"
|
|
11996
12022
|
}
|
|
11997
|
-
},
|
|
12023
|
+
}, mergedProps.mask && React$1.createElement(Mask, {
|
|
11998
12024
|
visible: maskVisible,
|
|
11999
|
-
forceRender:
|
|
12000
|
-
destroyOnClose:
|
|
12025
|
+
forceRender: mergedProps.forceRender,
|
|
12026
|
+
destroyOnClose: mergedProps.destroyOnClose,
|
|
12001
12027
|
onMaskClick: (e2) => {
|
|
12002
12028
|
var _a, _b;
|
|
12003
|
-
(_a =
|
|
12004
|
-
if (
|
|
12005
|
-
(_b =
|
|
12029
|
+
(_a = mergedProps.onMaskClick) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
12030
|
+
if (mergedProps.closeOnMaskClick) {
|
|
12031
|
+
(_b = mergedProps.onClose) === null || _b === void 0 ? void 0 : _b.call(mergedProps);
|
|
12006
12032
|
}
|
|
12007
12033
|
},
|
|
12008
|
-
style:
|
|
12009
|
-
className: classNames(`${classPrefix$Y}-mask`,
|
|
12034
|
+
style: mergedProps.maskStyle,
|
|
12035
|
+
className: classNames(`${classPrefix$Y}-mask`, mergedProps.maskClassName),
|
|
12010
12036
|
disableBodyScroll: false,
|
|
12011
|
-
stopPropagation:
|
|
12037
|
+
stopPropagation: mergedProps.stopPropagation
|
|
12012
12038
|
}), React$1.createElement("div", {
|
|
12013
12039
|
className: `${classPrefix$Y}-wrap`,
|
|
12014
|
-
role:
|
|
12015
|
-
"aria-label":
|
|
12040
|
+
role: mergedProps.role,
|
|
12041
|
+
"aria-label": mergedProps["aria-label"]
|
|
12016
12042
|
}, React$1.createElement(animated.div, {
|
|
12017
12043
|
style: Object.assign(Object.assign({}, style), {
|
|
12018
12044
|
pointerEvents: style.opacity.to((v) => v === 1 ? "unset" : "none")
|
|
12019
12045
|
}),
|
|
12020
12046
|
ref
|
|
12021
|
-
},
|
|
12047
|
+
}, mergedProps.showCloseButton && React$1.createElement("a", {
|
|
12022
12048
|
className: classNames(`${classPrefix$Y}-close`, "adm-plain-anchor"),
|
|
12023
12049
|
onClick: () => {
|
|
12024
12050
|
var _a;
|
|
12025
|
-
(_a =
|
|
12051
|
+
(_a = mergedProps.onClose) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
12026
12052
|
}
|
|
12027
|
-
},
|
|
12053
|
+
}, mergedProps.closeIcon), body)))));
|
|
12028
12054
|
return React$1.createElement(ShouldRender, {
|
|
12029
12055
|
active,
|
|
12030
|
-
forceRender:
|
|
12031
|
-
destroyOnClose:
|
|
12032
|
-
}, renderToContainer(
|
|
12056
|
+
forceRender: mergedProps.forceRender,
|
|
12057
|
+
destroyOnClose: mergedProps.destroyOnClose
|
|
12058
|
+
}, renderToContainer(mergedProps.getContainer, node));
|
|
12033
12059
|
};
|
|
12034
12060
|
const CheckboxGroupContext = React$1.createContext(null);
|
|
12035
12061
|
const defaultProps$N = {
|
|
@@ -12273,8 +12299,12 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12273
12299
|
}, React$1.createElement(List$1.Item, null, shouldRender && props.children)));
|
|
12274
12300
|
};
|
|
12275
12301
|
const Collapse = (props) => {
|
|
12302
|
+
const {
|
|
12303
|
+
collapse: componentConfig = {}
|
|
12304
|
+
} = useConfig();
|
|
12305
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
12276
12306
|
const panels = [];
|
|
12277
|
-
traverseReactNode(
|
|
12307
|
+
traverseReactNode(mergedProps.children, (child) => {
|
|
12278
12308
|
if (!React$1.isValidElement(child))
|
|
12279
12309
|
return;
|
|
12280
12310
|
const key = child.key;
|
|
@@ -12284,11 +12314,11 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12284
12314
|
});
|
|
12285
12315
|
const handlePropsValue = () => {
|
|
12286
12316
|
var _a;
|
|
12287
|
-
if (!
|
|
12317
|
+
if (!mergedProps.accordion) {
|
|
12288
12318
|
return {
|
|
12289
|
-
value:
|
|
12290
|
-
defaultValue: (_a =
|
|
12291
|
-
onChange:
|
|
12319
|
+
value: mergedProps.activeKey,
|
|
12320
|
+
defaultValue: (_a = mergedProps.defaultActiveKey) !== null && _a !== void 0 ? _a : [],
|
|
12321
|
+
onChange: mergedProps.onChange
|
|
12292
12322
|
};
|
|
12293
12323
|
}
|
|
12294
12324
|
const initValue = {
|
|
@@ -12296,29 +12326,29 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12296
12326
|
defaultValue: [],
|
|
12297
12327
|
onChange: (v) => {
|
|
12298
12328
|
var _a2, _b;
|
|
12299
|
-
(_a2 =
|
|
12329
|
+
(_a2 = mergedProps.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(mergedProps, (_b = v[0]) !== null && _b !== void 0 ? _b : null);
|
|
12300
12330
|
}
|
|
12301
12331
|
};
|
|
12302
|
-
if (
|
|
12332
|
+
if (mergedProps.activeKey === void 0) {
|
|
12303
12333
|
initValue.value = void 0;
|
|
12304
|
-
} else if (
|
|
12305
|
-
initValue.value = [
|
|
12334
|
+
} else if (mergedProps.activeKey !== null) {
|
|
12335
|
+
initValue.value = [mergedProps.activeKey];
|
|
12306
12336
|
}
|
|
12307
|
-
if (![null, void 0].includes(
|
|
12308
|
-
initValue.defaultValue = [
|
|
12337
|
+
if (![null, void 0].includes(mergedProps.defaultActiveKey)) {
|
|
12338
|
+
initValue.defaultValue = [mergedProps.defaultActiveKey];
|
|
12309
12339
|
}
|
|
12310
12340
|
return initValue;
|
|
12311
12341
|
};
|
|
12312
12342
|
const [activeKey, setActiveKey] = usePropsValue(handlePropsValue());
|
|
12313
12343
|
const activeKeyList = activeKey === null ? [] : Array.isArray(activeKey) ? activeKey : [activeKey];
|
|
12314
|
-
return withNativeProps(
|
|
12344
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
12315
12345
|
className: classPrefix$W
|
|
12316
12346
|
}, React$1.createElement(List$1, null, panels.map((panel) => {
|
|
12317
12347
|
const key = panel.key;
|
|
12318
12348
|
const active = activeKeyList.includes(key);
|
|
12319
12349
|
function handleClick(event) {
|
|
12320
12350
|
var _a, _b;
|
|
12321
|
-
if (
|
|
12351
|
+
if (mergedProps.accordion) {
|
|
12322
12352
|
if (active) {
|
|
12323
12353
|
setActiveKey([]);
|
|
12324
12354
|
} else {
|
|
@@ -12333,27 +12363,19 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12333
12363
|
}
|
|
12334
12364
|
(_b = (_a = panel.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
12335
12365
|
}
|
|
12336
|
-
const
|
|
12337
|
-
|
|
12338
|
-
|
|
12339
|
-
|
|
12340
|
-
}
|
|
12341
|
-
|
|
12342
|
-
arrow2 = panel.props.arrow;
|
|
12343
|
-
}
|
|
12344
|
-
return typeof arrow2 === "function" ? arrow2(active) : React$1.createElement("div", {
|
|
12345
|
-
className: classNames(`${classPrefix$W}-arrow`, {
|
|
12346
|
-
[`${classPrefix$W}-arrow-active`]: active
|
|
12347
|
-
})
|
|
12348
|
-
}, arrow2);
|
|
12349
|
-
};
|
|
12366
|
+
const arrow2 = mergeProp(React$1.createElement(DownOutline, null), mergedProps.arrow, mergedProps.arrowIcon, panel.props.arrow, panel.props.arrowIcon);
|
|
12367
|
+
const arrowIcon = typeof arrow2 === "function" ? arrow2(active) : React$1.createElement("div", {
|
|
12368
|
+
className: classNames(`${classPrefix$W}-arrow`, {
|
|
12369
|
+
[`${classPrefix$W}-arrow-active`]: active
|
|
12370
|
+
})
|
|
12371
|
+
}, arrow2);
|
|
12350
12372
|
return React$1.createElement(React$1.Fragment, {
|
|
12351
12373
|
key
|
|
12352
12374
|
}, withNativeProps(panel.props, React$1.createElement(List$1.Item, {
|
|
12353
12375
|
className: `${classPrefix$W}-panel-header`,
|
|
12354
12376
|
onClick: handleClick,
|
|
12355
12377
|
disabled: panel.props.disabled,
|
|
12356
|
-
|
|
12378
|
+
arrowIcon
|
|
12357
12379
|
}, panel.props.title)), React$1.createElement(CollapsePanelContent, {
|
|
12358
12380
|
visible: active,
|
|
12359
12381
|
forceRender: !!panel.props.forceRender,
|
|
@@ -12989,25 +13011,37 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12989
13011
|
confirm: confirm$1,
|
|
12990
13012
|
clear: clear$2
|
|
12991
13013
|
});
|
|
13014
|
+
const IconContext = React$1.createContext(null);
|
|
12992
13015
|
const classPrefix$V = `adm-dropdown-item`;
|
|
12993
13016
|
const Item = (props) => {
|
|
12994
|
-
|
|
13017
|
+
const {
|
|
13018
|
+
dropdown: componentConfig = {}
|
|
13019
|
+
} = useConfig();
|
|
13020
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
13021
|
+
const {
|
|
13022
|
+
active,
|
|
13023
|
+
highlight,
|
|
13024
|
+
onClick,
|
|
13025
|
+
title
|
|
13026
|
+
} = mergedProps;
|
|
12995
13027
|
const cls2 = classNames(classPrefix$V, {
|
|
12996
|
-
[`${classPrefix$V}-active`]:
|
|
12997
|
-
[`${classPrefix$V}-highlight`]:
|
|
13028
|
+
[`${classPrefix$V}-active`]: active,
|
|
13029
|
+
[`${classPrefix$V}-highlight`]: highlight !== null && highlight !== void 0 ? highlight : active
|
|
12998
13030
|
});
|
|
13031
|
+
const contextArrowIcon = React$1.useContext(IconContext);
|
|
13032
|
+
const mergedArrowIcon = mergeProp(React$1.createElement(DownFill, null), contextArrowIcon, mergedProps.arrow, mergedProps.arrowIcon);
|
|
12999
13033
|
return withNativeProps(props, React$1.createElement("div", {
|
|
13000
13034
|
className: cls2,
|
|
13001
|
-
onClick
|
|
13035
|
+
onClick
|
|
13002
13036
|
}, React$1.createElement("div", {
|
|
13003
13037
|
className: `${classPrefix$V}-title`
|
|
13004
13038
|
}, React$1.createElement("span", {
|
|
13005
13039
|
className: `${classPrefix$V}-title-text`
|
|
13006
|
-
},
|
|
13040
|
+
}, title), React$1.createElement("span", {
|
|
13007
13041
|
className: classNames(`${classPrefix$V}-title-arrow`, {
|
|
13008
|
-
[`${classPrefix$V}-title-arrow-active`]:
|
|
13042
|
+
[`${classPrefix$V}-title-arrow-active`]: active
|
|
13009
13043
|
})
|
|
13010
|
-
},
|
|
13044
|
+
}, mergedArrowIcon))));
|
|
13011
13045
|
};
|
|
13012
13046
|
const Item$1 = Item;
|
|
13013
13047
|
const ItemChildrenWrap = (props) => {
|
|
@@ -13030,17 +13064,21 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13030
13064
|
closeOnClickAway: false,
|
|
13031
13065
|
getContainer: defaultPopupBaseProps["getContainer"]
|
|
13032
13066
|
};
|
|
13033
|
-
const Dropdown = React$1.forwardRef((
|
|
13034
|
-
const
|
|
13067
|
+
const Dropdown = React$1.forwardRef((props, ref) => {
|
|
13068
|
+
const {
|
|
13069
|
+
dropdown: componentConfig = {}
|
|
13070
|
+
} = useConfig();
|
|
13071
|
+
const mergedProps = mergeProps(defaultProps$H, componentConfig, props);
|
|
13072
|
+
const arrowIcon = mergeProp(componentConfig.arrowIcon, props.arrow, props.arrowIcon);
|
|
13035
13073
|
const [value, setValue2] = usePropsValue({
|
|
13036
|
-
value:
|
|
13037
|
-
defaultValue:
|
|
13038
|
-
onChange:
|
|
13074
|
+
value: mergedProps.activeKey,
|
|
13075
|
+
defaultValue: mergedProps.defaultActiveKey,
|
|
13076
|
+
onChange: mergedProps.onChange
|
|
13039
13077
|
});
|
|
13040
13078
|
const navRef = React$1.useRef(null);
|
|
13041
13079
|
const contentRef = React$1.useRef(null);
|
|
13042
13080
|
useClickAway(() => {
|
|
13043
|
-
if (!
|
|
13081
|
+
if (!mergedProps.closeOnClickAway)
|
|
13044
13082
|
return;
|
|
13045
13083
|
setValue2(null);
|
|
13046
13084
|
}, [navRef, contentRef]);
|
|
@@ -13064,7 +13102,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13064
13102
|
};
|
|
13065
13103
|
let popupForceRender = false;
|
|
13066
13104
|
const items = [];
|
|
13067
|
-
const navs = React$1.Children.map(
|
|
13105
|
+
const navs = React$1.Children.map(mergedProps.children, (child) => {
|
|
13068
13106
|
if (React$1.isValidElement(child)) {
|
|
13069
13107
|
const childProps = Object.assign(Object.assign({}, child.props), {
|
|
13070
13108
|
onClick: (event) => {
|
|
@@ -13072,8 +13110,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13072
13110
|
changeActive(child.key);
|
|
13073
13111
|
(_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
13074
13112
|
},
|
|
13075
|
-
active: child.key === value
|
|
13076
|
-
arrow: child.props.arrow === void 0 ? props.arrow : child.props.arrow
|
|
13113
|
+
active: child.key === value
|
|
13077
13114
|
});
|
|
13078
13115
|
items.push(child);
|
|
13079
13116
|
if (child.props.forceRender)
|
|
@@ -13088,18 +13125,20 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13088
13125
|
setValue2(null);
|
|
13089
13126
|
}
|
|
13090
13127
|
}), [setValue2]);
|
|
13091
|
-
return withNativeProps(
|
|
13128
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
13092
13129
|
className: classNames(classPrefix$U, {
|
|
13093
13130
|
[`${classPrefix$U}-open`]: !!value
|
|
13094
13131
|
}),
|
|
13095
13132
|
ref: containerRef
|
|
13133
|
+
}, React$1.createElement(IconContext.Provider, {
|
|
13134
|
+
value: arrowIcon
|
|
13096
13135
|
}, React$1.createElement("div", {
|
|
13097
13136
|
className: `${classPrefix$U}-nav`,
|
|
13098
13137
|
ref: navRef
|
|
13099
|
-
}, navs), React$1.createElement(Popup, {
|
|
13138
|
+
}, navs)), React$1.createElement(Popup, {
|
|
13100
13139
|
visible: !!value,
|
|
13101
13140
|
position: "top",
|
|
13102
|
-
getContainer:
|
|
13141
|
+
getContainer: mergedProps.getContainer,
|
|
13103
13142
|
className: `${classPrefix$U}-popup`,
|
|
13104
13143
|
maskClassName: `${classPrefix$U}-popup-mask`,
|
|
13105
13144
|
bodyClassName: `${classPrefix$U}-popup-body`,
|
|
@@ -13107,7 +13146,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13107
13146
|
top
|
|
13108
13147
|
},
|
|
13109
13148
|
forceRender: popupForceRender,
|
|
13110
|
-
onMaskClick:
|
|
13149
|
+
onMaskClick: mergedProps.closeOnMaskClick ? () => {
|
|
13111
13150
|
changeActive(null);
|
|
13112
13151
|
} : void 0
|
|
13113
13152
|
}, React$1.createElement("div", {
|
|
@@ -18320,24 +18359,13 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18320
18359
|
});
|
|
18321
18360
|
var _default = Context;
|
|
18322
18361
|
default_1 = FieldContext.default = _default;
|
|
18323
|
-
function
|
|
18324
|
-
|
|
18325
|
-
|
|
18326
|
-
|
|
18327
|
-
|
|
18328
|
-
|
|
18329
|
-
|
|
18330
|
-
return !!(prototype && prototype.isReactComponent);
|
|
18331
|
-
}
|
|
18332
|
-
function isSimpleFunctionComponent(type) {
|
|
18333
|
-
return typeof type === "function" && !shouldConstruct(type) && type.defaultProps === void 0;
|
|
18334
|
-
}
|
|
18335
|
-
function isSafeSetRefComponent(component) {
|
|
18336
|
-
if (reactIsExports.isFragment(component))
|
|
18337
|
-
return false;
|
|
18338
|
-
if (reactIsExports.isMemo(component))
|
|
18339
|
-
return isSafeSetRefComponent(component.type);
|
|
18340
|
-
return !isSimpleFunctionComponent(component.type);
|
|
18362
|
+
function undefinedFallback(...items) {
|
|
18363
|
+
let i2;
|
|
18364
|
+
for (i2 = 0; i2 < items.length; i2++) {
|
|
18365
|
+
if (items[i2] !== void 0)
|
|
18366
|
+
break;
|
|
18367
|
+
}
|
|
18368
|
+
return items[i2];
|
|
18341
18369
|
}
|
|
18342
18370
|
const Arrow = React$1.memo((props) => {
|
|
18343
18371
|
return withNativeProps(props, React$1.createElement("svg", {
|
|
@@ -19965,13 +19993,24 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19965
19993
|
const Popover = attachPropertiesToComponent(Popover$1, {
|
|
19966
19994
|
Menu: PopoverMenu
|
|
19967
19995
|
});
|
|
19968
|
-
function
|
|
19969
|
-
|
|
19970
|
-
|
|
19971
|
-
|
|
19972
|
-
|
|
19973
|
-
|
|
19974
|
-
|
|
19996
|
+
function toArray(candidate) {
|
|
19997
|
+
if (candidate === void 0 || candidate === false)
|
|
19998
|
+
return [];
|
|
19999
|
+
return Array.isArray(candidate) ? candidate : [candidate];
|
|
20000
|
+
}
|
|
20001
|
+
function shouldConstruct(Component) {
|
|
20002
|
+
const prototype = Component.prototype;
|
|
20003
|
+
return !!(prototype && prototype.isReactComponent);
|
|
20004
|
+
}
|
|
20005
|
+
function isSimpleFunctionComponent(type) {
|
|
20006
|
+
return typeof type === "function" && !shouldConstruct(type) && type.defaultProps === void 0;
|
|
20007
|
+
}
|
|
20008
|
+
function isSafeSetRefComponent(component) {
|
|
20009
|
+
if (reactIsExports.isFragment(component))
|
|
20010
|
+
return false;
|
|
20011
|
+
if (reactIsExports.isMemo(component))
|
|
20012
|
+
return isSafeSetRefComponent(component.type);
|
|
20013
|
+
return !isSimpleFunctionComponent(component.type);
|
|
19975
20014
|
}
|
|
19976
20015
|
const NAME_SPLIT = "__SPLIT__";
|
|
19977
20016
|
const classPrefix$L = `adm-form-item`;
|
|
@@ -19980,22 +20019,25 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19980
20019
|
}) => children, (prev, next) => prev.value === next.value && prev.update === next.update);
|
|
19981
20020
|
const FormItemLayout = (props) => {
|
|
19982
20021
|
var _a;
|
|
20022
|
+
const {
|
|
20023
|
+
locale,
|
|
20024
|
+
form: componentConfig = {}
|
|
20025
|
+
} = useConfig();
|
|
19983
20026
|
const {
|
|
19984
20027
|
style,
|
|
19985
20028
|
extra,
|
|
19986
20029
|
label,
|
|
19987
20030
|
help,
|
|
20031
|
+
helpIcon,
|
|
19988
20032
|
required,
|
|
19989
20033
|
children,
|
|
19990
20034
|
htmlFor,
|
|
19991
20035
|
hidden,
|
|
19992
20036
|
arrow: arrow2,
|
|
20037
|
+
arrowIcon,
|
|
19993
20038
|
childElementPosition = "normal"
|
|
19994
|
-
} = props;
|
|
20039
|
+
} = mergeProps(componentConfig, props);
|
|
19995
20040
|
const context = React$1.useContext(FormContext);
|
|
19996
|
-
const {
|
|
19997
|
-
locale
|
|
19998
|
-
} = useConfig();
|
|
19999
20041
|
const hasFeedback = props.hasFeedback !== void 0 ? props.hasFeedback : context.hasFeedback;
|
|
20000
20042
|
const layout = props.layout || context.layout;
|
|
20001
20043
|
const disabled = (_a = props.disabled) !== null && _a !== void 0 ? _a : context.disabled;
|
|
@@ -20035,7 +20077,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20035
20077
|
e2.stopPropagation();
|
|
20036
20078
|
e2.preventDefault();
|
|
20037
20079
|
}
|
|
20038
|
-
}, React$1.createElement(QuestionCircleOutline, null))));
|
|
20080
|
+
}, helpIcon || React$1.createElement(QuestionCircleOutline, null))));
|
|
20039
20081
|
const description = (!!props.description || hasFeedback) && React$1.createElement(React$1.Fragment, null, props.description, hasFeedback && React$1.createElement(React$1.Fragment, null, props.errors.map((error, index2) => React$1.createElement("div", {
|
|
20040
20082
|
key: `error-${index2}`,
|
|
20041
20083
|
className: `${classPrefix$L}-feedback-error`
|
|
@@ -20056,7 +20098,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20056
20098
|
disabled,
|
|
20057
20099
|
onClick: props.onClick,
|
|
20058
20100
|
clickable: props.clickable,
|
|
20059
|
-
|
|
20101
|
+
arrowIcon: arrowIcon || arrow2
|
|
20060
20102
|
}, React$1.createElement("div", {
|
|
20061
20103
|
className: classNames(`${classPrefix$L}-child`, `${classPrefix$L}-child-position-${childElementPosition}`)
|
|
20062
20104
|
}, React$1.createElement("div", {
|
|
@@ -20070,6 +20112,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20070
20112
|
// FormItem 相关
|
|
20071
20113
|
label,
|
|
20072
20114
|
help,
|
|
20115
|
+
helpIcon,
|
|
20073
20116
|
extra,
|
|
20074
20117
|
hasFeedback,
|
|
20075
20118
|
name,
|
|
@@ -20090,8 +20133,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20090
20133
|
shouldUpdate,
|
|
20091
20134
|
dependencies,
|
|
20092
20135
|
clickable,
|
|
20093
|
-
arrow: arrow2
|
|
20094
|
-
|
|
20136
|
+
arrow: arrow2,
|
|
20137
|
+
arrowIcon
|
|
20138
|
+
} = props, fieldProps = __rest(props, ["style", "label", "help", "helpIcon", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "childElementPosition", "description", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "clickable", "arrow", "arrowIcon"]);
|
|
20095
20139
|
const {
|
|
20096
20140
|
name: formName
|
|
20097
20141
|
} = React$1.useContext(FormContext);
|
|
@@ -20143,6 +20187,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20143
20187
|
label,
|
|
20144
20188
|
extra,
|
|
20145
20189
|
help,
|
|
20190
|
+
helpIcon,
|
|
20146
20191
|
description,
|
|
20147
20192
|
required: isRequired,
|
|
20148
20193
|
disabled,
|
|
@@ -20155,7 +20200,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20155
20200
|
layout,
|
|
20156
20201
|
childElementPosition,
|
|
20157
20202
|
clickable,
|
|
20158
|
-
arrow: arrow2
|
|
20203
|
+
arrow: arrow2,
|
|
20204
|
+
arrowIcon
|
|
20159
20205
|
}, React$1.createElement(NoStyleItemContext.Provider, {
|
|
20160
20206
|
value: onSubMetaChange
|
|
20161
20207
|
}, baseChildren)));
|
|
@@ -21382,22 +21428,24 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21382
21428
|
const classPrefix$A = `adm-input`;
|
|
21383
21429
|
const defaultProps$v = {
|
|
21384
21430
|
defaultValue: "",
|
|
21431
|
+
clearIcon: React$1.createElement(CloseCircleFill, null),
|
|
21385
21432
|
onlyShowClearWhenFocus: true
|
|
21386
21433
|
};
|
|
21387
|
-
const Input = React$1.forwardRef((
|
|
21388
|
-
const
|
|
21389
|
-
|
|
21434
|
+
const Input = React$1.forwardRef((props, ref) => {
|
|
21435
|
+
const {
|
|
21436
|
+
locale,
|
|
21437
|
+
input: componentConfig = {}
|
|
21438
|
+
} = useConfig();
|
|
21439
|
+
const mergedProps = mergeProps(defaultProps$v, componentConfig, props);
|
|
21440
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
21390
21441
|
const [hasFocus, setHasFocus] = React$1.useState(false);
|
|
21391
21442
|
const compositionStartRef = React$1.useRef(false);
|
|
21392
21443
|
const nativeInputRef = React$1.useRef(null);
|
|
21393
|
-
const {
|
|
21394
|
-
locale
|
|
21395
|
-
} = useConfig();
|
|
21396
21444
|
const handleKeydown = useInputHandleKeyDown({
|
|
21397
|
-
onEnterPress:
|
|
21398
|
-
onKeyDown:
|
|
21445
|
+
onEnterPress: mergedProps.onEnterPress,
|
|
21446
|
+
onKeyDown: mergedProps.onKeyDown,
|
|
21399
21447
|
nativeInputRef,
|
|
21400
|
-
enterKeyHint:
|
|
21448
|
+
enterKeyHint: mergedProps.enterKeyHint
|
|
21401
21449
|
});
|
|
21402
21450
|
React$1.useImperativeHandle(ref, () => ({
|
|
21403
21451
|
clear: () => {
|
|
@@ -21417,8 +21465,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21417
21465
|
}));
|
|
21418
21466
|
function checkValue() {
|
|
21419
21467
|
let nextValue = value;
|
|
21420
|
-
if (
|
|
21421
|
-
const boundValue = nextValue && bound(parseFloat(nextValue),
|
|
21468
|
+
if (mergedProps.type === "number") {
|
|
21469
|
+
const boundValue = nextValue && bound(parseFloat(nextValue), mergedProps.min, mergedProps.max).toString();
|
|
21422
21470
|
if (Number(nextValue) !== Number(boundValue)) {
|
|
21423
21471
|
nextValue = boundValue;
|
|
21424
21472
|
}
|
|
@@ -21428,16 +21476,16 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21428
21476
|
}
|
|
21429
21477
|
}
|
|
21430
21478
|
const shouldShowClear = (() => {
|
|
21431
|
-
if (!
|
|
21479
|
+
if (!mergedProps.clearable || !value || mergedProps.readOnly)
|
|
21432
21480
|
return false;
|
|
21433
|
-
if (
|
|
21481
|
+
if (mergedProps.onlyShowClearWhenFocus) {
|
|
21434
21482
|
return hasFocus;
|
|
21435
21483
|
} else {
|
|
21436
21484
|
return true;
|
|
21437
21485
|
}
|
|
21438
21486
|
})();
|
|
21439
|
-
return withNativeProps(
|
|
21440
|
-
className: classNames(`${classPrefix$A}`,
|
|
21487
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
21488
|
+
className: classNames(`${classPrefix$A}`, mergedProps.disabled && `${classPrefix$A}-disabled`)
|
|
21441
21489
|
}, React$1.createElement("input", {
|
|
21442
21490
|
ref: nativeInputRef,
|
|
21443
21491
|
className: `${classPrefix$A}-element`,
|
|
@@ -21448,50 +21496,50 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21448
21496
|
onFocus: (e2) => {
|
|
21449
21497
|
var _a;
|
|
21450
21498
|
setHasFocus(true);
|
|
21451
|
-
(_a =
|
|
21499
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21452
21500
|
},
|
|
21453
21501
|
onBlur: (e2) => {
|
|
21454
21502
|
var _a;
|
|
21455
21503
|
setHasFocus(false);
|
|
21456
21504
|
checkValue();
|
|
21457
|
-
(_a =
|
|
21505
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21458
21506
|
},
|
|
21459
|
-
id:
|
|
21460
|
-
placeholder:
|
|
21461
|
-
disabled:
|
|
21462
|
-
readOnly:
|
|
21463
|
-
maxLength:
|
|
21464
|
-
minLength:
|
|
21465
|
-
max:
|
|
21466
|
-
min:
|
|
21467
|
-
autoComplete:
|
|
21468
|
-
enterKeyHint:
|
|
21469
|
-
autoFocus:
|
|
21470
|
-
pattern:
|
|
21471
|
-
inputMode:
|
|
21472
|
-
type:
|
|
21473
|
-
name:
|
|
21474
|
-
autoCapitalize:
|
|
21475
|
-
autoCorrect:
|
|
21507
|
+
id: mergedProps.id,
|
|
21508
|
+
placeholder: mergedProps.placeholder,
|
|
21509
|
+
disabled: mergedProps.disabled,
|
|
21510
|
+
readOnly: mergedProps.readOnly,
|
|
21511
|
+
maxLength: mergedProps.maxLength,
|
|
21512
|
+
minLength: mergedProps.minLength,
|
|
21513
|
+
max: mergedProps.max,
|
|
21514
|
+
min: mergedProps.min,
|
|
21515
|
+
autoComplete: mergedProps.autoComplete,
|
|
21516
|
+
enterKeyHint: mergedProps.enterKeyHint,
|
|
21517
|
+
autoFocus: mergedProps.autoFocus,
|
|
21518
|
+
pattern: mergedProps.pattern,
|
|
21519
|
+
inputMode: mergedProps.inputMode,
|
|
21520
|
+
type: mergedProps.type,
|
|
21521
|
+
name: mergedProps.name,
|
|
21522
|
+
autoCapitalize: mergedProps.autoCapitalize,
|
|
21523
|
+
autoCorrect: mergedProps.autoCorrect,
|
|
21476
21524
|
onKeyDown: handleKeydown,
|
|
21477
|
-
onKeyUp:
|
|
21525
|
+
onKeyUp: mergedProps.onKeyUp,
|
|
21478
21526
|
onCompositionStart: (e2) => {
|
|
21479
21527
|
var _a;
|
|
21480
21528
|
compositionStartRef.current = true;
|
|
21481
|
-
(_a =
|
|
21529
|
+
(_a = mergedProps.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21482
21530
|
},
|
|
21483
21531
|
onCompositionEnd: (e2) => {
|
|
21484
21532
|
var _a;
|
|
21485
21533
|
compositionStartRef.current = false;
|
|
21486
|
-
(_a =
|
|
21534
|
+
(_a = mergedProps.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21487
21535
|
},
|
|
21488
|
-
onClick:
|
|
21489
|
-
step:
|
|
21490
|
-
role:
|
|
21491
|
-
"aria-valuenow":
|
|
21492
|
-
"aria-valuemax":
|
|
21493
|
-
"aria-valuemin":
|
|
21494
|
-
"aria-label":
|
|
21536
|
+
onClick: mergedProps.onClick,
|
|
21537
|
+
step: mergedProps.step,
|
|
21538
|
+
role: mergedProps.role,
|
|
21539
|
+
"aria-valuenow": mergedProps["aria-valuenow"],
|
|
21540
|
+
"aria-valuemax": mergedProps["aria-valuemax"],
|
|
21541
|
+
"aria-valuemin": mergedProps["aria-valuemin"],
|
|
21542
|
+
"aria-label": mergedProps["aria-label"]
|
|
21495
21543
|
}), shouldShowClear && React$1.createElement("div", {
|
|
21496
21544
|
className: `${classPrefix$A}-clear`,
|
|
21497
21545
|
onMouseDown: (e2) => {
|
|
@@ -21500,14 +21548,14 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21500
21548
|
onClick: () => {
|
|
21501
21549
|
var _a, _b;
|
|
21502
21550
|
setValue2("");
|
|
21503
|
-
(_a =
|
|
21551
|
+
(_a = mergedProps.onClear) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
21504
21552
|
if (isIOS() && compositionStartRef.current) {
|
|
21505
21553
|
compositionStartRef.current = false;
|
|
21506
21554
|
(_b = nativeInputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
21507
21555
|
}
|
|
21508
21556
|
},
|
|
21509
21557
|
"aria-label": locale.Input.clear
|
|
21510
|
-
},
|
|
21558
|
+
}, mergedProps.clearIcon)));
|
|
21511
21559
|
});
|
|
21512
21560
|
const classPrefix$z = `adm-jumbo-tabs`;
|
|
21513
21561
|
const JumboTab = () => {
|
|
@@ -21768,50 +21816,60 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21768
21816
|
});
|
|
21769
21817
|
const classPrefix$y = `adm-nav-bar`;
|
|
21770
21818
|
const defaultProps$s = {
|
|
21771
|
-
|
|
21819
|
+
backIcon: true
|
|
21772
21820
|
};
|
|
21773
|
-
const NavBar = (
|
|
21774
|
-
const
|
|
21821
|
+
const NavBar = (props) => {
|
|
21822
|
+
const {
|
|
21823
|
+
navBar: componentConfig = {}
|
|
21824
|
+
} = useConfig();
|
|
21825
|
+
const mergedProps = mergeProps(defaultProps$s, componentConfig, props);
|
|
21775
21826
|
const {
|
|
21776
21827
|
back,
|
|
21828
|
+
backIcon,
|
|
21777
21829
|
backArrow
|
|
21778
|
-
} =
|
|
21779
|
-
return withNativeProps(
|
|
21830
|
+
} = mergedProps;
|
|
21831
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
21780
21832
|
className: classNames(classPrefix$y)
|
|
21781
21833
|
}, React$1.createElement("div", {
|
|
21782
21834
|
className: `${classPrefix$y}-left`,
|
|
21783
21835
|
role: "button"
|
|
21784
21836
|
}, back !== null && React$1.createElement("div", {
|
|
21785
21837
|
className: `${classPrefix$y}-back`,
|
|
21786
|
-
onClick:
|
|
21787
|
-
}, backArrow && React$1.createElement("span", {
|
|
21838
|
+
onClick: mergedProps.onBack
|
|
21839
|
+
}, (backIcon || backArrow) && React$1.createElement("span", {
|
|
21788
21840
|
className: `${classPrefix$y}-back-arrow`
|
|
21789
|
-
}, backArrow === true ? React$1.createElement(LeftOutline, null) : backArrow), React$1.createElement("span", {
|
|
21841
|
+
}, backIcon === true || backArrow === true ? componentConfig.backIcon || React$1.createElement(LeftOutline, null) : backIcon || backArrow), React$1.createElement("span", {
|
|
21790
21842
|
"aria-hidden": "true"
|
|
21791
|
-
}, back)),
|
|
21843
|
+
}, back)), mergedProps.left), React$1.createElement("div", {
|
|
21792
21844
|
className: `${classPrefix$y}-title`
|
|
21793
|
-
},
|
|
21845
|
+
}, mergedProps.children), React$1.createElement("div", {
|
|
21794
21846
|
className: `${classPrefix$y}-right`
|
|
21795
|
-
},
|
|
21847
|
+
}, mergedProps.right)));
|
|
21796
21848
|
};
|
|
21797
21849
|
const classPrefix$x = `adm-notice-bar`;
|
|
21798
21850
|
const defaultProps$r = {
|
|
21799
21851
|
color: "default",
|
|
21800
21852
|
delay: 2e3,
|
|
21801
21853
|
speed: 50,
|
|
21802
|
-
|
|
21803
|
-
|
|
21854
|
+
icon: React$1.createElement(SoundOutline, null),
|
|
21855
|
+
wrap: false
|
|
21804
21856
|
};
|
|
21805
|
-
const NoticeBar = React$1.memo((
|
|
21806
|
-
const
|
|
21857
|
+
const NoticeBar = React$1.memo((props) => {
|
|
21858
|
+
const {
|
|
21859
|
+
noticeBar: componentConfig = {}
|
|
21860
|
+
} = useConfig();
|
|
21861
|
+
const mergedProps = mergeProps(defaultProps$r, componentConfig, props);
|
|
21862
|
+
const closeIcon = mergeProp(React$1.createElement(CloseOutline, {
|
|
21863
|
+
className: `${classPrefix$x}-close-icon`
|
|
21864
|
+
}), componentConfig.closeIcon, props.closeIcon);
|
|
21807
21865
|
const containerRef = React$1.useRef(null);
|
|
21808
21866
|
const textRef = React$1.useRef(null);
|
|
21809
21867
|
const [visible, setVisible] = React$1.useState(true);
|
|
21810
|
-
const speed =
|
|
21868
|
+
const speed = mergedProps.speed;
|
|
21811
21869
|
const delayLockRef = React$1.useRef(true);
|
|
21812
21870
|
const animatingRef = React$1.useRef(false);
|
|
21813
21871
|
function start2() {
|
|
21814
|
-
if (delayLockRef.current ||
|
|
21872
|
+
if (delayLockRef.current || mergedProps.wrap)
|
|
21815
21873
|
return;
|
|
21816
21874
|
const container = containerRef.current;
|
|
21817
21875
|
const text = textRef.current;
|
|
@@ -21840,7 +21898,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21840
21898
|
useTimeout$1(() => {
|
|
21841
21899
|
delayLockRef.current = false;
|
|
21842
21900
|
start2();
|
|
21843
|
-
},
|
|
21901
|
+
}, mergedProps.delay);
|
|
21844
21902
|
useResizeEffect(() => {
|
|
21845
21903
|
start2();
|
|
21846
21904
|
}, containerRef);
|
|
@@ -21853,14 +21911,14 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21853
21911
|
});
|
|
21854
21912
|
if (!visible)
|
|
21855
21913
|
return null;
|
|
21856
|
-
return withNativeProps(
|
|
21857
|
-
className: classNames(classPrefix$x, `${classPrefix$x}-${
|
|
21858
|
-
[`${classPrefix$x}-wrap`]:
|
|
21914
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
21915
|
+
className: classNames(classPrefix$x, `${classPrefix$x}-${mergedProps.color}`, {
|
|
21916
|
+
[`${classPrefix$x}-wrap`]: mergedProps.wrap
|
|
21859
21917
|
}),
|
|
21860
|
-
onClick:
|
|
21861
|
-
},
|
|
21918
|
+
onClick: mergedProps.onClick
|
|
21919
|
+
}, mergedProps.icon && React$1.createElement("span", {
|
|
21862
21920
|
className: `${classPrefix$x}-left`
|
|
21863
|
-
},
|
|
21921
|
+
}, mergedProps.icon), React$1.createElement("span", {
|
|
21864
21922
|
ref: containerRef,
|
|
21865
21923
|
className: `${classPrefix$x}-content`
|
|
21866
21924
|
}, React$1.createElement("span", {
|
|
@@ -21870,18 +21928,16 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21870
21928
|
},
|
|
21871
21929
|
ref: textRef,
|
|
21872
21930
|
className: `${classPrefix$x}-content-inner`
|
|
21873
|
-
},
|
|
21931
|
+
}, mergedProps.content)), (mergedProps.closeable || mergedProps.extra) && React$1.createElement("span", {
|
|
21874
21932
|
className: `${classPrefix$x}-right`
|
|
21875
|
-
},
|
|
21933
|
+
}, mergedProps.extra, mergedProps.closeable && React$1.createElement("div", {
|
|
21876
21934
|
className: `${classPrefix$x}-close`,
|
|
21877
21935
|
onClick: () => {
|
|
21878
21936
|
var _a;
|
|
21879
21937
|
setVisible(false);
|
|
21880
|
-
(_a =
|
|
21938
|
+
(_a = mergedProps.onClose) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
21881
21939
|
}
|
|
21882
|
-
},
|
|
21883
|
-
className: `${classPrefix$x}-close-icon`
|
|
21884
|
-
})))));
|
|
21940
|
+
}, closeIcon))));
|
|
21885
21941
|
});
|
|
21886
21942
|
function shuffle(array) {
|
|
21887
21943
|
const result = [...array];
|
|
@@ -21940,13 +21996,13 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21940
21996
|
var _a;
|
|
21941
21997
|
(_a = props.onDelete) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
21942
21998
|
});
|
|
21943
|
-
const
|
|
21999
|
+
const startContinueClear = () => {
|
|
21944
22000
|
timeoutRef.current = window.setTimeout(() => {
|
|
21945
22001
|
onDelete();
|
|
21946
22002
|
intervalRef.current = window.setInterval(onDelete, 150);
|
|
21947
22003
|
}, 700);
|
|
21948
22004
|
};
|
|
21949
|
-
const
|
|
22005
|
+
const stopContinueClear = () => {
|
|
21950
22006
|
clearTimeout(timeoutRef.current);
|
|
21951
22007
|
clearInterval(intervalRef.current);
|
|
21952
22008
|
};
|
|
@@ -22006,14 +22062,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22006
22062
|
key,
|
|
22007
22063
|
className,
|
|
22008
22064
|
onTouchStart: () => {
|
|
22065
|
+
stopContinueClear();
|
|
22009
22066
|
if (key === "BACKSPACE") {
|
|
22010
|
-
|
|
22067
|
+
startContinueClear();
|
|
22011
22068
|
}
|
|
22012
22069
|
},
|
|
22013
22070
|
onTouchEnd: (e2) => {
|
|
22014
22071
|
onKeyPress(e2, key);
|
|
22015
22072
|
if (key === "BACKSPACE") {
|
|
22016
|
-
|
|
22073
|
+
stopContinueClear();
|
|
22017
22074
|
}
|
|
22018
22075
|
}
|
|
22019
22076
|
}, ariaProps), key === "BACKSPACE" ? React$1.createElement(TextDeletionOutline, null) : key);
|
|
@@ -22045,11 +22102,11 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22045
22102
|
}, React$1.createElement("div", {
|
|
22046
22103
|
className: `${classPrefix$w}-key ${classPrefix$w}-key-extra ${classPrefix$w}-key-bs`,
|
|
22047
22104
|
onTouchStart: () => {
|
|
22048
|
-
|
|
22105
|
+
startContinueClear();
|
|
22049
22106
|
},
|
|
22050
22107
|
onTouchEnd: (e2) => {
|
|
22051
22108
|
onKeyPress(e2, "BACKSPACE");
|
|
22052
|
-
|
|
22109
|
+
stopContinueClear();
|
|
22053
22110
|
},
|
|
22054
22111
|
onContextMenu: (e2) => {
|
|
22055
22112
|
e2.preventDefault();
|
|
@@ -22617,14 +22674,33 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22617
22674
|
className: classNames(`${classPrefix$p}-box`)
|
|
22618
22675
|
}, props.allowHalf && renderStar(i2 + 0.5, true), renderStar(i2 + 1, false)))));
|
|
22619
22676
|
};
|
|
22620
|
-
const
|
|
22621
|
-
|
|
22622
|
-
|
|
22623
|
-
|
|
22624
|
-
|
|
22625
|
-
|
|
22626
|
-
|
|
22677
|
+
const useResultIcon = (status) => {
|
|
22678
|
+
const {
|
|
22679
|
+
result: componentConfig = {}
|
|
22680
|
+
} = useConfig();
|
|
22681
|
+
const {
|
|
22682
|
+
successIcon = React$1.createElement(CheckCircleFill, null),
|
|
22683
|
+
errorIcon = React$1.createElement(CloseCircleFill, null),
|
|
22684
|
+
infoIcon = React$1.createElement(InformationCircleFill, null),
|
|
22685
|
+
waitingIcon = React$1.createElement(ClockCircleFill, null),
|
|
22686
|
+
warningIcon = React$1.createElement(ExclamationCircleFill, null)
|
|
22687
|
+
} = componentConfig || {};
|
|
22688
|
+
switch (status) {
|
|
22689
|
+
case "success":
|
|
22690
|
+
return successIcon;
|
|
22691
|
+
case "error":
|
|
22692
|
+
return errorIcon;
|
|
22693
|
+
case "info":
|
|
22694
|
+
return infoIcon;
|
|
22695
|
+
case "waiting":
|
|
22696
|
+
return waitingIcon;
|
|
22697
|
+
case "warning":
|
|
22698
|
+
return warningIcon;
|
|
22699
|
+
default:
|
|
22700
|
+
return null;
|
|
22701
|
+
}
|
|
22627
22702
|
};
|
|
22703
|
+
const classPrefix$o = `adm-result`;
|
|
22628
22704
|
const defaultProps$i = {
|
|
22629
22705
|
status: "info"
|
|
22630
22706
|
};
|
|
@@ -22636,27 +22712,20 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22636
22712
|
description,
|
|
22637
22713
|
icon
|
|
22638
22714
|
} = props;
|
|
22715
|
+
const fallbackIcon = useResultIcon(status);
|
|
22639
22716
|
if (!status)
|
|
22640
22717
|
return null;
|
|
22641
|
-
const resultIcon = icon || React$1.createElement(iconRecord$1[status]);
|
|
22642
22718
|
return withNativeProps(props, React$1.createElement("div", {
|
|
22643
22719
|
className: classNames(classPrefix$o, `${classPrefix$o}-${status}`)
|
|
22644
22720
|
}, React$1.createElement("div", {
|
|
22645
22721
|
className: `${classPrefix$o}-icon`
|
|
22646
|
-
},
|
|
22722
|
+
}, icon || fallbackIcon), React$1.createElement("div", {
|
|
22647
22723
|
className: `${classPrefix$o}-title`
|
|
22648
22724
|
}, title), !!description && React$1.createElement("div", {
|
|
22649
22725
|
className: `${classPrefix$o}-description`
|
|
22650
22726
|
}, description)));
|
|
22651
22727
|
};
|
|
22652
22728
|
const classPrefix$n = `adm-result-page`;
|
|
22653
|
-
const iconRecord = {
|
|
22654
|
-
success: CheckCircleFill,
|
|
22655
|
-
error: CloseCircleFill,
|
|
22656
|
-
info: InformationCircleFill,
|
|
22657
|
-
waiting: ClockCircleFill,
|
|
22658
|
-
warning: ExclamationCircleFill
|
|
22659
|
-
};
|
|
22660
22729
|
const defaultProps$h = {
|
|
22661
22730
|
status: "info",
|
|
22662
22731
|
details: []
|
|
@@ -22674,7 +22743,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22674
22743
|
onPrimaryButtonClick,
|
|
22675
22744
|
onSecondaryButtonClick
|
|
22676
22745
|
} = props;
|
|
22677
|
-
const
|
|
22746
|
+
const fallbackIcon = useResultIcon(status);
|
|
22678
22747
|
const [collapse, setCollapse] = React$1.useState(true);
|
|
22679
22748
|
const showSecondaryButton = isNodeWithContent(secondaryButtonText);
|
|
22680
22749
|
const showPrimaryButton = isNodeWithContent(primaryButtonText);
|
|
@@ -22684,7 +22753,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22684
22753
|
className: `${classPrefix$n}-header`
|
|
22685
22754
|
}, React$1.createElement("div", {
|
|
22686
22755
|
className: `${classPrefix$n}-icon`
|
|
22687
|
-
},
|
|
22756
|
+
}, icon || fallbackIcon), React$1.createElement("div", {
|
|
22688
22757
|
className: `${classPrefix$n}-title`
|
|
22689
22758
|
}, title), isNodeWithContent(description) ? React$1.createElement("div", {
|
|
22690
22759
|
className: `${classPrefix$n}-description`
|
|
@@ -22740,17 +22809,18 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22740
22809
|
onlyShowClearWhenFocus: false,
|
|
22741
22810
|
showCancelButton: false,
|
|
22742
22811
|
defaultValue: "",
|
|
22743
|
-
clearOnCancel: true
|
|
22744
|
-
icon: React$1.createElement(SearchOutline, null)
|
|
22812
|
+
clearOnCancel: true
|
|
22745
22813
|
};
|
|
22746
|
-
const SearchBar = React$1.forwardRef((
|
|
22814
|
+
const SearchBar = React$1.forwardRef((props, ref) => {
|
|
22747
22815
|
const {
|
|
22748
|
-
locale
|
|
22816
|
+
locale,
|
|
22817
|
+
searchBar: componentConfig = {}
|
|
22749
22818
|
} = useConfig();
|
|
22750
|
-
const
|
|
22819
|
+
const mergedProps = mergeProps(defaultProps$g, componentConfig, {
|
|
22751
22820
|
cancelText: locale.common.cancel
|
|
22752
|
-
},
|
|
22753
|
-
const
|
|
22821
|
+
}, props);
|
|
22822
|
+
const searchIcon = mergeProp(React$1.createElement(SearchOutline, null), componentConfig.searchIcon, props.icon, props.searchIcon);
|
|
22823
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
22754
22824
|
const [hasFocus, setHasFocus] = React$1.useState(false);
|
|
22755
22825
|
const inputRef = React$1.useRef(null);
|
|
22756
22826
|
const composingRef = React$1.useRef(false);
|
|
@@ -22774,10 +22844,10 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22774
22844
|
}));
|
|
22775
22845
|
const renderCancelButton = () => {
|
|
22776
22846
|
let isShowCancel;
|
|
22777
|
-
if (typeof
|
|
22778
|
-
isShowCancel =
|
|
22847
|
+
if (typeof mergedProps.showCancelButton === "function") {
|
|
22848
|
+
isShowCancel = mergedProps.showCancelButton(hasFocus, value);
|
|
22779
22849
|
} else {
|
|
22780
|
-
isShowCancel =
|
|
22850
|
+
isShowCancel = mergedProps.showCancelButton && hasFocus;
|
|
22781
22851
|
}
|
|
22782
22852
|
return isShowCancel && React$1.createElement("div", {
|
|
22783
22853
|
className: `${classPrefix$l}-suffix`
|
|
@@ -22786,66 +22856,66 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22786
22856
|
className: `${classPrefix$l}-cancel-button`,
|
|
22787
22857
|
onClick: () => {
|
|
22788
22858
|
var _a, _b, _c;
|
|
22789
|
-
if (
|
|
22859
|
+
if (mergedProps.clearOnCancel) {
|
|
22790
22860
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.clear();
|
|
22791
22861
|
}
|
|
22792
22862
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
22793
|
-
(_c =
|
|
22863
|
+
(_c = mergedProps.onCancel) === null || _c === void 0 ? void 0 : _c.call(mergedProps);
|
|
22794
22864
|
},
|
|
22795
22865
|
onMouseDown: (e2) => {
|
|
22796
22866
|
e2.preventDefault();
|
|
22797
22867
|
}
|
|
22798
|
-
},
|
|
22868
|
+
}, mergedProps.cancelText));
|
|
22799
22869
|
};
|
|
22800
|
-
return withNativeProps(
|
|
22870
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
22801
22871
|
className: classNames(classPrefix$l, {
|
|
22802
22872
|
[`${classPrefix$l}-active`]: hasFocus
|
|
22803
22873
|
})
|
|
22804
22874
|
}, React$1.createElement("div", {
|
|
22805
22875
|
className: `${classPrefix$l}-input-box`
|
|
22806
|
-
},
|
|
22876
|
+
}, searchIcon && React$1.createElement("div", {
|
|
22807
22877
|
className: `${classPrefix$l}-input-box-icon`
|
|
22808
|
-
},
|
|
22878
|
+
}, searchIcon), React$1.createElement(Input, {
|
|
22809
22879
|
ref: inputRef,
|
|
22810
22880
|
className: classNames(`${classPrefix$l}-input`, {
|
|
22811
|
-
[`${classPrefix$l}-input-without-icon`]: !
|
|
22881
|
+
[`${classPrefix$l}-input-without-icon`]: !searchIcon
|
|
22812
22882
|
}),
|
|
22813
22883
|
value,
|
|
22814
22884
|
onChange: setValue2,
|
|
22815
|
-
maxLength:
|
|
22816
|
-
placeholder:
|
|
22817
|
-
clearable:
|
|
22818
|
-
onlyShowClearWhenFocus:
|
|
22885
|
+
maxLength: mergedProps.maxLength,
|
|
22886
|
+
placeholder: mergedProps.placeholder,
|
|
22887
|
+
clearable: mergedProps.clearable,
|
|
22888
|
+
onlyShowClearWhenFocus: mergedProps.onlyShowClearWhenFocus,
|
|
22819
22889
|
onFocus: (e2) => {
|
|
22820
22890
|
var _a;
|
|
22821
22891
|
setHasFocus(true);
|
|
22822
|
-
(_a =
|
|
22892
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22823
22893
|
},
|
|
22824
22894
|
onBlur: (e2) => {
|
|
22825
22895
|
var _a;
|
|
22826
22896
|
setHasFocus(false);
|
|
22827
|
-
(_a =
|
|
22897
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22828
22898
|
},
|
|
22829
|
-
onClear:
|
|
22899
|
+
onClear: mergedProps.onClear,
|
|
22830
22900
|
type: "search",
|
|
22831
22901
|
enterKeyHint: "search",
|
|
22832
22902
|
onEnterPress: () => {
|
|
22833
22903
|
var _a, _b;
|
|
22834
22904
|
if (!composingRef.current) {
|
|
22835
22905
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
22836
|
-
(_b =
|
|
22906
|
+
(_b = mergedProps.onSearch) === null || _b === void 0 ? void 0 : _b.call(mergedProps, value);
|
|
22837
22907
|
}
|
|
22838
22908
|
},
|
|
22839
22909
|
"aria-label": locale.SearchBar.name,
|
|
22840
22910
|
onCompositionStart: (e2) => {
|
|
22841
22911
|
var _a;
|
|
22842
22912
|
composingRef.current = true;
|
|
22843
|
-
(_a =
|
|
22913
|
+
(_a = mergedProps.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22844
22914
|
},
|
|
22845
22915
|
onCompositionEnd: (e2) => {
|
|
22846
22916
|
var _a;
|
|
22847
22917
|
composingRef.current = false;
|
|
22848
|
-
(_a =
|
|
22918
|
+
(_a = mergedProps.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22849
22919
|
}
|
|
22850
22920
|
})), renderCancelButton()));
|
|
22851
22921
|
});
|
|
@@ -25444,15 +25514,17 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25444
25514
|
const defaultProps$2 = {
|
|
25445
25515
|
defaultValue: ""
|
|
25446
25516
|
};
|
|
25447
|
-
const VirtualInput = React$1.forwardRef((
|
|
25448
|
-
const
|
|
25449
|
-
|
|
25517
|
+
const VirtualInput = React$1.forwardRef((props, ref) => {
|
|
25518
|
+
const {
|
|
25519
|
+
locale,
|
|
25520
|
+
input: componentConfig = {}
|
|
25521
|
+
} = useConfig();
|
|
25522
|
+
const mergedProps = mergeProps(defaultProps$2, componentConfig, props);
|
|
25523
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
25450
25524
|
const rootRef = React$1.useRef(null);
|
|
25451
25525
|
const contentRef = React$1.useRef(null);
|
|
25452
25526
|
const [hasFocus, setHasFocus] = React$1.useState(false);
|
|
25453
|
-
const
|
|
25454
|
-
locale
|
|
25455
|
-
} = useConfig();
|
|
25527
|
+
const clearIcon = mergeProp(React$1.createElement(CloseCircleFill, null), componentConfig.clearIcon, props.clearIcon);
|
|
25456
25528
|
function scrollToEnd() {
|
|
25457
25529
|
const root2 = rootRef.current;
|
|
25458
25530
|
if (!root2)
|
|
@@ -25486,14 +25558,14 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25486
25558
|
function onFocus() {
|
|
25487
25559
|
var _a;
|
|
25488
25560
|
setHasFocus(true);
|
|
25489
|
-
(_a =
|
|
25561
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25490
25562
|
}
|
|
25491
25563
|
function onBlur() {
|
|
25492
25564
|
var _a;
|
|
25493
25565
|
setHasFocus(false);
|
|
25494
|
-
(_a =
|
|
25566
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25495
25567
|
}
|
|
25496
|
-
const keyboard =
|
|
25568
|
+
const keyboard = mergedProps.keyboard;
|
|
25497
25569
|
const keyboardElement = keyboard && React$1.cloneElement(keyboard, {
|
|
25498
25570
|
onInput: (v) => {
|
|
25499
25571
|
var _a, _b;
|
|
@@ -25518,38 +25590,38 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25518
25590
|
},
|
|
25519
25591
|
getContainer: null
|
|
25520
25592
|
});
|
|
25521
|
-
return withNativeProps(
|
|
25593
|
+
return withNativeProps(mergedProps, React$1.createElement("div", {
|
|
25522
25594
|
ref: rootRef,
|
|
25523
25595
|
className: classNames(classPrefix$2, {
|
|
25524
|
-
[`${classPrefix$2}-disabled`]:
|
|
25596
|
+
[`${classPrefix$2}-disabled`]: mergedProps.disabled
|
|
25525
25597
|
}),
|
|
25526
|
-
tabIndex:
|
|
25598
|
+
tabIndex: mergedProps.disabled ? void 0 : 0,
|
|
25527
25599
|
role: "textbox",
|
|
25528
25600
|
onFocus,
|
|
25529
25601
|
onBlur,
|
|
25530
|
-
onClick:
|
|
25602
|
+
onClick: mergedProps.onClick
|
|
25531
25603
|
}, React$1.createElement("div", {
|
|
25532
25604
|
className: `${classPrefix$2}-content`,
|
|
25533
25605
|
ref: contentRef,
|
|
25534
|
-
"aria-disabled":
|
|
25535
|
-
"aria-label":
|
|
25606
|
+
"aria-disabled": mergedProps.disabled,
|
|
25607
|
+
"aria-label": mergedProps.placeholder
|
|
25536
25608
|
}, value, React$1.createElement("div", {
|
|
25537
25609
|
className: `${classPrefix$2}-caret-container`
|
|
25538
25610
|
}, hasFocus && React$1.createElement("div", {
|
|
25539
25611
|
className: `${classPrefix$2}-caret`
|
|
25540
|
-
}))),
|
|
25612
|
+
}))), mergedProps.clearable && !!value && hasFocus && React$1.createElement("div", {
|
|
25541
25613
|
className: `${classPrefix$2}-clear`,
|
|
25542
25614
|
onClick: (e2) => {
|
|
25543
25615
|
var _a;
|
|
25544
25616
|
e2.stopPropagation();
|
|
25545
25617
|
setValue2("");
|
|
25546
|
-
(_a =
|
|
25618
|
+
(_a = mergedProps.onClear) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25547
25619
|
},
|
|
25548
25620
|
role: "button",
|
|
25549
25621
|
"aria-label": locale.Input.clear
|
|
25550
|
-
},
|
|
25622
|
+
}, clearIcon), [void 0, null, ""].includes(value) && React$1.createElement("div", {
|
|
25551
25623
|
className: `${classPrefix$2}-placeholder`
|
|
25552
|
-
},
|
|
25624
|
+
}, mergedProps.placeholder), keyboardElement));
|
|
25553
25625
|
});
|
|
25554
25626
|
const classPrefix$1 = `adm-water-mark`;
|
|
25555
25627
|
const defaultProps$1 = {
|