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
|
@@ -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);
|
|
@@ -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,
|
|
@@ -8350,11 +8361,12 @@ const defaultProps$14 = Object.assign(Object.assign({}, defaultPopupBaseProps),
|
|
|
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$14, 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,
|
|
@@ -11395,9 +11407,17 @@ function isNodeWithContent(node) {
|
|
|
11395
11407
|
}
|
|
11396
11408
|
const classPrefix$12 = `adm-list-item`;
|
|
11397
11409
|
const ListItem = (props) => {
|
|
11398
|
-
var _a;
|
|
11410
|
+
var _a, _b;
|
|
11411
|
+
const {
|
|
11412
|
+
arrow: arrow2,
|
|
11413
|
+
arrowIcon
|
|
11414
|
+
} = props;
|
|
11415
|
+
const {
|
|
11416
|
+
list: componentConfig = {}
|
|
11417
|
+
} = useConfig();
|
|
11399
11418
|
const clickable = (_a = props.clickable) !== null && _a !== void 0 ? _a : !!props.onClick;
|
|
11400
|
-
const
|
|
11419
|
+
const showArrow = (_b = arrow2 !== null && arrow2 !== void 0 ? arrow2 : arrowIcon) !== null && _b !== void 0 ? _b : clickable;
|
|
11420
|
+
const mergedArrowIcon = mergeProp(componentConfig.arrowIcon, arrow2 !== true ? arrow2 : null, arrowIcon !== true ? arrowIcon : null);
|
|
11401
11421
|
const content = React__default.createElement("div", {
|
|
11402
11422
|
className: `${classPrefix$12}-content`
|
|
11403
11423
|
}, isNodeWithContent(props.prefix) && React__default.createElement("div", {
|
|
@@ -11410,9 +11430,9 @@ const ListItem = (props) => {
|
|
|
11410
11430
|
className: `${classPrefix$12}-description`
|
|
11411
11431
|
}, props.description)), isNodeWithContent(props.extra) && React__default.createElement("div", {
|
|
11412
11432
|
className: `${classPrefix$12}-content-extra`
|
|
11413
|
-
}, props.extra),
|
|
11433
|
+
}, props.extra), showArrow && React__default.createElement("div", {
|
|
11414
11434
|
className: `${classPrefix$12}-content-arrow`
|
|
11415
|
-
},
|
|
11435
|
+
}, mergedArrowIcon || React__default.createElement(RightOutline, null)));
|
|
11416
11436
|
return withNativeProps(props, React__default.createElement(clickable ? "a" : "div", {
|
|
11417
11437
|
className: classNames(`${classPrefix$12}`, clickable ? ["adm-plain-anchor"] : [], props.disabled && `${classPrefix$12}-disabled`),
|
|
11418
11438
|
onClick: props.disabled ? void 0 : props.onClick
|
|
@@ -11428,11 +11448,14 @@ const defaultProps$R = {
|
|
|
11428
11448
|
defaultValue: [],
|
|
11429
11449
|
activeIcon: React__default.createElement(CheckOutline, null)
|
|
11430
11450
|
};
|
|
11431
|
-
const CheckList$1 = (
|
|
11432
|
-
const
|
|
11433
|
-
|
|
11451
|
+
const CheckList$1 = (props) => {
|
|
11452
|
+
const {
|
|
11453
|
+
checkList: componentConfig = {}
|
|
11454
|
+
} = useConfig();
|
|
11455
|
+
const mergedProps = mergeProps(defaultProps$R, componentConfig, props);
|
|
11456
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
11434
11457
|
function check(val) {
|
|
11435
|
-
if (
|
|
11458
|
+
if (mergedProps.multiple) {
|
|
11436
11459
|
setValue2([...value, val]);
|
|
11437
11460
|
} else {
|
|
11438
11461
|
setValue2([val]);
|
|
@@ -11446,7 +11469,7 @@ const CheckList$1 = (p) => {
|
|
|
11446
11469
|
extra,
|
|
11447
11470
|
disabled,
|
|
11448
11471
|
readOnly
|
|
11449
|
-
} =
|
|
11472
|
+
} = mergedProps;
|
|
11450
11473
|
return React__default.createElement(CheckListContext.Provider, {
|
|
11451
11474
|
value: {
|
|
11452
11475
|
value,
|
|
@@ -11457,10 +11480,10 @@ const CheckList$1 = (p) => {
|
|
|
11457
11480
|
disabled,
|
|
11458
11481
|
readOnly
|
|
11459
11482
|
}
|
|
11460
|
-
}, withNativeProps(
|
|
11461
|
-
mode:
|
|
11483
|
+
}, withNativeProps(mergedProps, React__default.createElement(List$1, {
|
|
11484
|
+
mode: mergedProps.mode,
|
|
11462
11485
|
className: classPrefix$11
|
|
11463
|
-
},
|
|
11486
|
+
}, mergedProps.children)));
|
|
11464
11487
|
};
|
|
11465
11488
|
const classPrefix$10 = `adm-check-list-item`;
|
|
11466
11489
|
const CheckListItem = (props) => {
|
|
@@ -11933,12 +11956,15 @@ const classPrefix$Y = "adm-center-popup";
|
|
|
11933
11956
|
const defaultProps$O = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
11934
11957
|
getContainer: null
|
|
11935
11958
|
});
|
|
11936
|
-
const CenterPopup = (
|
|
11937
|
-
const
|
|
11959
|
+
const CenterPopup = (props) => {
|
|
11960
|
+
const {
|
|
11961
|
+
popup: componentConfig = {}
|
|
11962
|
+
} = useConfig();
|
|
11963
|
+
const mergedProps = mergeProps(defaultProps$O, componentConfig, props);
|
|
11938
11964
|
const unmountedRef = useUnmountedRef$1();
|
|
11939
11965
|
const style = useSpring({
|
|
11940
|
-
scale:
|
|
11941
|
-
opacity:
|
|
11966
|
+
scale: mergedProps.visible ? 1 : 0.8,
|
|
11967
|
+
opacity: mergedProps.visible ? 1 : 0,
|
|
11942
11968
|
config: {
|
|
11943
11969
|
mass: 1.2,
|
|
11944
11970
|
tension: 200,
|
|
@@ -11949,69 +11975,69 @@ const CenterPopup = (p) => {
|
|
|
11949
11975
|
var _a, _b;
|
|
11950
11976
|
if (unmountedRef.current)
|
|
11951
11977
|
return;
|
|
11952
|
-
setActive(
|
|
11953
|
-
if (
|
|
11954
|
-
(_a =
|
|
11978
|
+
setActive(mergedProps.visible);
|
|
11979
|
+
if (mergedProps.visible) {
|
|
11980
|
+
(_a = mergedProps.afterShow) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
11955
11981
|
} else {
|
|
11956
|
-
(_b =
|
|
11982
|
+
(_b = mergedProps.afterClose) === null || _b === void 0 ? void 0 : _b.call(mergedProps);
|
|
11957
11983
|
}
|
|
11958
11984
|
}
|
|
11959
11985
|
});
|
|
11960
|
-
const [active, setActive] = useState(
|
|
11986
|
+
const [active, setActive] = useState(mergedProps.visible);
|
|
11961
11987
|
useIsomorphicLayoutEffect$2(() => {
|
|
11962
|
-
if (
|
|
11988
|
+
if (mergedProps.visible) {
|
|
11963
11989
|
setActive(true);
|
|
11964
11990
|
}
|
|
11965
|
-
}, [
|
|
11991
|
+
}, [mergedProps.visible]);
|
|
11966
11992
|
const ref = useRef(null);
|
|
11967
|
-
useLockScroll(ref,
|
|
11968
|
-
const maskVisible = useInnerVisible(active &&
|
|
11993
|
+
useLockScroll(ref, mergedProps.disableBodyScroll && active);
|
|
11994
|
+
const maskVisible = useInnerVisible(active && mergedProps.visible);
|
|
11969
11995
|
const body = React__default.createElement("div", {
|
|
11970
|
-
className: classNames(`${classPrefix$Y}-body`,
|
|
11971
|
-
style:
|
|
11972
|
-
},
|
|
11973
|
-
const node = withStopPropagation(
|
|
11996
|
+
className: classNames(`${classPrefix$Y}-body`, mergedProps.bodyClassName),
|
|
11997
|
+
style: mergedProps.bodyStyle
|
|
11998
|
+
}, mergedProps.children);
|
|
11999
|
+
const node = withStopPropagation(mergedProps.stopPropagation, withNativeProps(mergedProps, React__default.createElement("div", {
|
|
11974
12000
|
className: classPrefix$Y,
|
|
11975
12001
|
style: {
|
|
11976
12002
|
display: active ? void 0 : "none",
|
|
11977
12003
|
pointerEvents: active ? void 0 : "none"
|
|
11978
12004
|
}
|
|
11979
|
-
},
|
|
12005
|
+
}, mergedProps.mask && React__default.createElement(Mask, {
|
|
11980
12006
|
visible: maskVisible,
|
|
11981
|
-
forceRender:
|
|
11982
|
-
destroyOnClose:
|
|
12007
|
+
forceRender: mergedProps.forceRender,
|
|
12008
|
+
destroyOnClose: mergedProps.destroyOnClose,
|
|
11983
12009
|
onMaskClick: (e2) => {
|
|
11984
12010
|
var _a, _b;
|
|
11985
|
-
(_a =
|
|
11986
|
-
if (
|
|
11987
|
-
(_b =
|
|
12011
|
+
(_a = mergedProps.onMaskClick) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
12012
|
+
if (mergedProps.closeOnMaskClick) {
|
|
12013
|
+
(_b = mergedProps.onClose) === null || _b === void 0 ? void 0 : _b.call(mergedProps);
|
|
11988
12014
|
}
|
|
11989
12015
|
},
|
|
11990
|
-
style:
|
|
11991
|
-
className: classNames(`${classPrefix$Y}-mask`,
|
|
12016
|
+
style: mergedProps.maskStyle,
|
|
12017
|
+
className: classNames(`${classPrefix$Y}-mask`, mergedProps.maskClassName),
|
|
11992
12018
|
disableBodyScroll: false,
|
|
11993
|
-
stopPropagation:
|
|
12019
|
+
stopPropagation: mergedProps.stopPropagation
|
|
11994
12020
|
}), React__default.createElement("div", {
|
|
11995
12021
|
className: `${classPrefix$Y}-wrap`,
|
|
11996
|
-
role:
|
|
11997
|
-
"aria-label":
|
|
12022
|
+
role: mergedProps.role,
|
|
12023
|
+
"aria-label": mergedProps["aria-label"]
|
|
11998
12024
|
}, React__default.createElement(animated.div, {
|
|
11999
12025
|
style: Object.assign(Object.assign({}, style), {
|
|
12000
12026
|
pointerEvents: style.opacity.to((v) => v === 1 ? "unset" : "none")
|
|
12001
12027
|
}),
|
|
12002
12028
|
ref
|
|
12003
|
-
},
|
|
12029
|
+
}, mergedProps.showCloseButton && React__default.createElement("a", {
|
|
12004
12030
|
className: classNames(`${classPrefix$Y}-close`, "adm-plain-anchor"),
|
|
12005
12031
|
onClick: () => {
|
|
12006
12032
|
var _a;
|
|
12007
|
-
(_a =
|
|
12033
|
+
(_a = mergedProps.onClose) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
12008
12034
|
}
|
|
12009
|
-
},
|
|
12035
|
+
}, mergedProps.closeIcon), body)))));
|
|
12010
12036
|
return React__default.createElement(ShouldRender, {
|
|
12011
12037
|
active,
|
|
12012
|
-
forceRender:
|
|
12013
|
-
destroyOnClose:
|
|
12014
|
-
}, renderToContainer(
|
|
12038
|
+
forceRender: mergedProps.forceRender,
|
|
12039
|
+
destroyOnClose: mergedProps.destroyOnClose
|
|
12040
|
+
}, renderToContainer(mergedProps.getContainer, node));
|
|
12015
12041
|
};
|
|
12016
12042
|
const CheckboxGroupContext = createContext(null);
|
|
12017
12043
|
const defaultProps$N = {
|
|
@@ -12255,8 +12281,12 @@ const CollapsePanelContent = (props) => {
|
|
|
12255
12281
|
}, React__default.createElement(List$1.Item, null, shouldRender && props.children)));
|
|
12256
12282
|
};
|
|
12257
12283
|
const Collapse = (props) => {
|
|
12284
|
+
const {
|
|
12285
|
+
collapse: componentConfig = {}
|
|
12286
|
+
} = useConfig();
|
|
12287
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
12258
12288
|
const panels = [];
|
|
12259
|
-
traverseReactNode(
|
|
12289
|
+
traverseReactNode(mergedProps.children, (child) => {
|
|
12260
12290
|
if (!isValidElement(child))
|
|
12261
12291
|
return;
|
|
12262
12292
|
const key = child.key;
|
|
@@ -12266,11 +12296,11 @@ const Collapse = (props) => {
|
|
|
12266
12296
|
});
|
|
12267
12297
|
const handlePropsValue = () => {
|
|
12268
12298
|
var _a;
|
|
12269
|
-
if (!
|
|
12299
|
+
if (!mergedProps.accordion) {
|
|
12270
12300
|
return {
|
|
12271
|
-
value:
|
|
12272
|
-
defaultValue: (_a =
|
|
12273
|
-
onChange:
|
|
12301
|
+
value: mergedProps.activeKey,
|
|
12302
|
+
defaultValue: (_a = mergedProps.defaultActiveKey) !== null && _a !== void 0 ? _a : [],
|
|
12303
|
+
onChange: mergedProps.onChange
|
|
12274
12304
|
};
|
|
12275
12305
|
}
|
|
12276
12306
|
const initValue = {
|
|
@@ -12278,29 +12308,29 @@ const Collapse = (props) => {
|
|
|
12278
12308
|
defaultValue: [],
|
|
12279
12309
|
onChange: (v) => {
|
|
12280
12310
|
var _a2, _b;
|
|
12281
|
-
(_a2 =
|
|
12311
|
+
(_a2 = mergedProps.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(mergedProps, (_b = v[0]) !== null && _b !== void 0 ? _b : null);
|
|
12282
12312
|
}
|
|
12283
12313
|
};
|
|
12284
|
-
if (
|
|
12314
|
+
if (mergedProps.activeKey === void 0) {
|
|
12285
12315
|
initValue.value = void 0;
|
|
12286
|
-
} else if (
|
|
12287
|
-
initValue.value = [
|
|
12316
|
+
} else if (mergedProps.activeKey !== null) {
|
|
12317
|
+
initValue.value = [mergedProps.activeKey];
|
|
12288
12318
|
}
|
|
12289
|
-
if (![null, void 0].includes(
|
|
12290
|
-
initValue.defaultValue = [
|
|
12319
|
+
if (![null, void 0].includes(mergedProps.defaultActiveKey)) {
|
|
12320
|
+
initValue.defaultValue = [mergedProps.defaultActiveKey];
|
|
12291
12321
|
}
|
|
12292
12322
|
return initValue;
|
|
12293
12323
|
};
|
|
12294
12324
|
const [activeKey, setActiveKey] = usePropsValue(handlePropsValue());
|
|
12295
12325
|
const activeKeyList = activeKey === null ? [] : Array.isArray(activeKey) ? activeKey : [activeKey];
|
|
12296
|
-
return withNativeProps(
|
|
12326
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
12297
12327
|
className: classPrefix$W
|
|
12298
12328
|
}, React__default.createElement(List$1, null, panels.map((panel) => {
|
|
12299
12329
|
const key = panel.key;
|
|
12300
12330
|
const active = activeKeyList.includes(key);
|
|
12301
12331
|
function handleClick(event) {
|
|
12302
12332
|
var _a, _b;
|
|
12303
|
-
if (
|
|
12333
|
+
if (mergedProps.accordion) {
|
|
12304
12334
|
if (active) {
|
|
12305
12335
|
setActiveKey([]);
|
|
12306
12336
|
} else {
|
|
@@ -12315,27 +12345,19 @@ const Collapse = (props) => {
|
|
|
12315
12345
|
}
|
|
12316
12346
|
(_b = (_a = panel.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
12317
12347
|
}
|
|
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
|
-
};
|
|
12348
|
+
const arrow2 = mergeProp(React__default.createElement(DownOutline, null), mergedProps.arrow, mergedProps.arrowIcon, panel.props.arrow, panel.props.arrowIcon);
|
|
12349
|
+
const arrowIcon = typeof arrow2 === "function" ? arrow2(active) : React__default.createElement("div", {
|
|
12350
|
+
className: classNames(`${classPrefix$W}-arrow`, {
|
|
12351
|
+
[`${classPrefix$W}-arrow-active`]: active
|
|
12352
|
+
})
|
|
12353
|
+
}, arrow2);
|
|
12332
12354
|
return React__default.createElement(React__default.Fragment, {
|
|
12333
12355
|
key
|
|
12334
12356
|
}, withNativeProps(panel.props, React__default.createElement(List$1.Item, {
|
|
12335
12357
|
className: `${classPrefix$W}-panel-header`,
|
|
12336
12358
|
onClick: handleClick,
|
|
12337
12359
|
disabled: panel.props.disabled,
|
|
12338
|
-
|
|
12360
|
+
arrowIcon
|
|
12339
12361
|
}, panel.props.title)), React__default.createElement(CollapsePanelContent, {
|
|
12340
12362
|
visible: active,
|
|
12341
12363
|
forceRender: !!panel.props.forceRender,
|
|
@@ -12971,25 +12993,37 @@ const index$c = attachPropertiesToComponent(Dialog, {
|
|
|
12971
12993
|
confirm: confirm$1,
|
|
12972
12994
|
clear: clear$2
|
|
12973
12995
|
});
|
|
12996
|
+
const IconContext = React__default.createContext(null);
|
|
12974
12997
|
const classPrefix$V = `adm-dropdown-item`;
|
|
12975
12998
|
const Item = (props) => {
|
|
12976
|
-
|
|
12999
|
+
const {
|
|
13000
|
+
dropdown: componentConfig = {}
|
|
13001
|
+
} = useConfig();
|
|
13002
|
+
const mergedProps = mergeProps(componentConfig, props);
|
|
13003
|
+
const {
|
|
13004
|
+
active,
|
|
13005
|
+
highlight,
|
|
13006
|
+
onClick,
|
|
13007
|
+
title
|
|
13008
|
+
} = mergedProps;
|
|
12977
13009
|
const cls2 = classNames(classPrefix$V, {
|
|
12978
|
-
[`${classPrefix$V}-active`]:
|
|
12979
|
-
[`${classPrefix$V}-highlight`]:
|
|
13010
|
+
[`${classPrefix$V}-active`]: active,
|
|
13011
|
+
[`${classPrefix$V}-highlight`]: highlight !== null && highlight !== void 0 ? highlight : active
|
|
12980
13012
|
});
|
|
13013
|
+
const contextArrowIcon = React__default.useContext(IconContext);
|
|
13014
|
+
const mergedArrowIcon = mergeProp(React__default.createElement(DownFill, null), contextArrowIcon, mergedProps.arrow, mergedProps.arrowIcon);
|
|
12981
13015
|
return withNativeProps(props, React__default.createElement("div", {
|
|
12982
13016
|
className: cls2,
|
|
12983
|
-
onClick
|
|
13017
|
+
onClick
|
|
12984
13018
|
}, React__default.createElement("div", {
|
|
12985
13019
|
className: `${classPrefix$V}-title`
|
|
12986
13020
|
}, React__default.createElement("span", {
|
|
12987
13021
|
className: `${classPrefix$V}-title-text`
|
|
12988
|
-
},
|
|
13022
|
+
}, title), React__default.createElement("span", {
|
|
12989
13023
|
className: classNames(`${classPrefix$V}-title-arrow`, {
|
|
12990
|
-
[`${classPrefix$V}-title-arrow-active`]:
|
|
13024
|
+
[`${classPrefix$V}-title-arrow-active`]: active
|
|
12991
13025
|
})
|
|
12992
|
-
},
|
|
13026
|
+
}, mergedArrowIcon))));
|
|
12993
13027
|
};
|
|
12994
13028
|
const Item$1 = Item;
|
|
12995
13029
|
const ItemChildrenWrap = (props) => {
|
|
@@ -13012,17 +13046,21 @@ const defaultProps$H = {
|
|
|
13012
13046
|
closeOnClickAway: false,
|
|
13013
13047
|
getContainer: defaultPopupBaseProps["getContainer"]
|
|
13014
13048
|
};
|
|
13015
|
-
const Dropdown = forwardRef((
|
|
13016
|
-
const
|
|
13049
|
+
const Dropdown = forwardRef((props, ref) => {
|
|
13050
|
+
const {
|
|
13051
|
+
dropdown: componentConfig = {}
|
|
13052
|
+
} = useConfig();
|
|
13053
|
+
const mergedProps = mergeProps(defaultProps$H, componentConfig, props);
|
|
13054
|
+
const arrowIcon = mergeProp(componentConfig.arrowIcon, props.arrow, props.arrowIcon);
|
|
13017
13055
|
const [value, setValue2] = usePropsValue({
|
|
13018
|
-
value:
|
|
13019
|
-
defaultValue:
|
|
13020
|
-
onChange:
|
|
13056
|
+
value: mergedProps.activeKey,
|
|
13057
|
+
defaultValue: mergedProps.defaultActiveKey,
|
|
13058
|
+
onChange: mergedProps.onChange
|
|
13021
13059
|
});
|
|
13022
13060
|
const navRef = useRef(null);
|
|
13023
13061
|
const contentRef = useRef(null);
|
|
13024
13062
|
useClickAway(() => {
|
|
13025
|
-
if (!
|
|
13063
|
+
if (!mergedProps.closeOnClickAway)
|
|
13026
13064
|
return;
|
|
13027
13065
|
setValue2(null);
|
|
13028
13066
|
}, [navRef, contentRef]);
|
|
@@ -13046,7 +13084,7 @@ const Dropdown = forwardRef((p, ref) => {
|
|
|
13046
13084
|
};
|
|
13047
13085
|
let popupForceRender = false;
|
|
13048
13086
|
const items = [];
|
|
13049
|
-
const navs = React__default.Children.map(
|
|
13087
|
+
const navs = React__default.Children.map(mergedProps.children, (child) => {
|
|
13050
13088
|
if (isValidElement(child)) {
|
|
13051
13089
|
const childProps = Object.assign(Object.assign({}, child.props), {
|
|
13052
13090
|
onClick: (event) => {
|
|
@@ -13054,8 +13092,7 @@ const Dropdown = forwardRef((p, ref) => {
|
|
|
13054
13092
|
changeActive(child.key);
|
|
13055
13093
|
(_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
13056
13094
|
},
|
|
13057
|
-
active: child.key === value
|
|
13058
|
-
arrow: child.props.arrow === void 0 ? props.arrow : child.props.arrow
|
|
13095
|
+
active: child.key === value
|
|
13059
13096
|
});
|
|
13060
13097
|
items.push(child);
|
|
13061
13098
|
if (child.props.forceRender)
|
|
@@ -13070,18 +13107,20 @@ const Dropdown = forwardRef((p, ref) => {
|
|
|
13070
13107
|
setValue2(null);
|
|
13071
13108
|
}
|
|
13072
13109
|
}), [setValue2]);
|
|
13073
|
-
return withNativeProps(
|
|
13110
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
13074
13111
|
className: classNames(classPrefix$U, {
|
|
13075
13112
|
[`${classPrefix$U}-open`]: !!value
|
|
13076
13113
|
}),
|
|
13077
13114
|
ref: containerRef
|
|
13115
|
+
}, React__default.createElement(IconContext.Provider, {
|
|
13116
|
+
value: arrowIcon
|
|
13078
13117
|
}, React__default.createElement("div", {
|
|
13079
13118
|
className: `${classPrefix$U}-nav`,
|
|
13080
13119
|
ref: navRef
|
|
13081
|
-
}, navs), React__default.createElement(Popup, {
|
|
13120
|
+
}, navs)), React__default.createElement(Popup, {
|
|
13082
13121
|
visible: !!value,
|
|
13083
13122
|
position: "top",
|
|
13084
|
-
getContainer:
|
|
13123
|
+
getContainer: mergedProps.getContainer,
|
|
13085
13124
|
className: `${classPrefix$U}-popup`,
|
|
13086
13125
|
maskClassName: `${classPrefix$U}-popup-mask`,
|
|
13087
13126
|
bodyClassName: `${classPrefix$U}-popup-body`,
|
|
@@ -13089,7 +13128,7 @@ const Dropdown = forwardRef((p, ref) => {
|
|
|
13089
13128
|
top
|
|
13090
13129
|
},
|
|
13091
13130
|
forceRender: popupForceRender,
|
|
13092
|
-
onMaskClick:
|
|
13131
|
+
onMaskClick: mergedProps.closeOnMaskClick ? () => {
|
|
13093
13132
|
changeActive(null);
|
|
13094
13133
|
} : void 0
|
|
13095
13134
|
}, React__default.createElement("div", {
|
|
@@ -18302,24 +18341,13 @@ var Context = /* @__PURE__ */ React.createContext({
|
|
|
18302
18341
|
});
|
|
18303
18342
|
var _default = Context;
|
|
18304
18343
|
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);
|
|
18344
|
+
function undefinedFallback(...items) {
|
|
18345
|
+
let i2;
|
|
18346
|
+
for (i2 = 0; i2 < items.length; i2++) {
|
|
18347
|
+
if (items[i2] !== void 0)
|
|
18348
|
+
break;
|
|
18349
|
+
}
|
|
18350
|
+
return items[i2];
|
|
18323
18351
|
}
|
|
18324
18352
|
const Arrow = memo((props) => {
|
|
18325
18353
|
return withNativeProps(props, React__default.createElement("svg", {
|
|
@@ -19947,13 +19975,24 @@ const PopoverMenu = forwardRef((props, ref) => {
|
|
|
19947
19975
|
const Popover = attachPropertiesToComponent(Popover$1, {
|
|
19948
19976
|
Menu: PopoverMenu
|
|
19949
19977
|
});
|
|
19950
|
-
function
|
|
19951
|
-
|
|
19952
|
-
|
|
19953
|
-
|
|
19954
|
-
|
|
19955
|
-
|
|
19956
|
-
|
|
19978
|
+
function toArray(candidate) {
|
|
19979
|
+
if (candidate === void 0 || candidate === false)
|
|
19980
|
+
return [];
|
|
19981
|
+
return Array.isArray(candidate) ? candidate : [candidate];
|
|
19982
|
+
}
|
|
19983
|
+
function shouldConstruct(Component) {
|
|
19984
|
+
const prototype = Component.prototype;
|
|
19985
|
+
return !!(prototype && prototype.isReactComponent);
|
|
19986
|
+
}
|
|
19987
|
+
function isSimpleFunctionComponent(type4) {
|
|
19988
|
+
return typeof type4 === "function" && !shouldConstruct(type4) && type4.defaultProps === void 0;
|
|
19989
|
+
}
|
|
19990
|
+
function isSafeSetRefComponent(component) {
|
|
19991
|
+
if (reactIsExports.isFragment(component))
|
|
19992
|
+
return false;
|
|
19993
|
+
if (reactIsExports.isMemo(component))
|
|
19994
|
+
return isSafeSetRefComponent(component.type);
|
|
19995
|
+
return !isSimpleFunctionComponent(component.type);
|
|
19957
19996
|
}
|
|
19958
19997
|
const NAME_SPLIT = "__SPLIT__";
|
|
19959
19998
|
const classPrefix$L = `adm-form-item`;
|
|
@@ -19962,22 +20001,25 @@ const MemoInput = React__default.memo(({
|
|
|
19962
20001
|
}) => children, (prev, next) => prev.value === next.value && prev.update === next.update);
|
|
19963
20002
|
const FormItemLayout = (props) => {
|
|
19964
20003
|
var _a;
|
|
20004
|
+
const {
|
|
20005
|
+
locale,
|
|
20006
|
+
form: componentConfig = {}
|
|
20007
|
+
} = useConfig();
|
|
19965
20008
|
const {
|
|
19966
20009
|
style,
|
|
19967
20010
|
extra,
|
|
19968
20011
|
label,
|
|
19969
20012
|
help,
|
|
20013
|
+
helpIcon,
|
|
19970
20014
|
required: required4,
|
|
19971
20015
|
children,
|
|
19972
20016
|
htmlFor,
|
|
19973
20017
|
hidden,
|
|
19974
20018
|
arrow: arrow2,
|
|
20019
|
+
arrowIcon,
|
|
19975
20020
|
childElementPosition = "normal"
|
|
19976
|
-
} = props;
|
|
20021
|
+
} = mergeProps(componentConfig, props);
|
|
19977
20022
|
const context = useContext(FormContext);
|
|
19978
|
-
const {
|
|
19979
|
-
locale
|
|
19980
|
-
} = useConfig();
|
|
19981
20023
|
const hasFeedback = props.hasFeedback !== void 0 ? props.hasFeedback : context.hasFeedback;
|
|
19982
20024
|
const layout = props.layout || context.layout;
|
|
19983
20025
|
const disabled = (_a = props.disabled) !== null && _a !== void 0 ? _a : context.disabled;
|
|
@@ -20017,7 +20059,7 @@ const FormItemLayout = (props) => {
|
|
|
20017
20059
|
e2.stopPropagation();
|
|
20018
20060
|
e2.preventDefault();
|
|
20019
20061
|
}
|
|
20020
|
-
}, React__default.createElement(QuestionCircleOutline, null))));
|
|
20062
|
+
}, helpIcon || React__default.createElement(QuestionCircleOutline, null))));
|
|
20021
20063
|
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
20064
|
key: `error-${index2}`,
|
|
20023
20065
|
className: `${classPrefix$L}-feedback-error`
|
|
@@ -20038,7 +20080,7 @@ const FormItemLayout = (props) => {
|
|
|
20038
20080
|
disabled,
|
|
20039
20081
|
onClick: props.onClick,
|
|
20040
20082
|
clickable: props.clickable,
|
|
20041
|
-
|
|
20083
|
+
arrowIcon: arrowIcon || arrow2
|
|
20042
20084
|
}, React__default.createElement("div", {
|
|
20043
20085
|
className: classNames(`${classPrefix$L}-child`, `${classPrefix$L}-child-position-${childElementPosition}`)
|
|
20044
20086
|
}, React__default.createElement("div", {
|
|
@@ -20052,6 +20094,7 @@ const FormItem = (props) => {
|
|
|
20052
20094
|
// FormItem 相关
|
|
20053
20095
|
label,
|
|
20054
20096
|
help,
|
|
20097
|
+
helpIcon,
|
|
20055
20098
|
extra,
|
|
20056
20099
|
hasFeedback,
|
|
20057
20100
|
name,
|
|
@@ -20072,8 +20115,9 @@ const FormItem = (props) => {
|
|
|
20072
20115
|
shouldUpdate,
|
|
20073
20116
|
dependencies,
|
|
20074
20117
|
clickable,
|
|
20075
|
-
arrow: arrow2
|
|
20076
|
-
|
|
20118
|
+
arrow: arrow2,
|
|
20119
|
+
arrowIcon
|
|
20120
|
+
} = 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
20121
|
const {
|
|
20078
20122
|
name: formName
|
|
20079
20123
|
} = useContext(FormContext);
|
|
@@ -20125,6 +20169,7 @@ const FormItem = (props) => {
|
|
|
20125
20169
|
label,
|
|
20126
20170
|
extra,
|
|
20127
20171
|
help,
|
|
20172
|
+
helpIcon,
|
|
20128
20173
|
description,
|
|
20129
20174
|
required: isRequired,
|
|
20130
20175
|
disabled,
|
|
@@ -20137,7 +20182,8 @@ const FormItem = (props) => {
|
|
|
20137
20182
|
layout,
|
|
20138
20183
|
childElementPosition,
|
|
20139
20184
|
clickable,
|
|
20140
|
-
arrow: arrow2
|
|
20185
|
+
arrow: arrow2,
|
|
20186
|
+
arrowIcon
|
|
20141
20187
|
}, React__default.createElement(NoStyleItemContext.Provider, {
|
|
20142
20188
|
value: onSubMetaChange
|
|
20143
20189
|
}, baseChildren)));
|
|
@@ -21364,22 +21410,24 @@ function useInputHandleKeyDown({
|
|
|
21364
21410
|
const classPrefix$A = `adm-input`;
|
|
21365
21411
|
const defaultProps$v = {
|
|
21366
21412
|
defaultValue: "",
|
|
21413
|
+
clearIcon: React__default.createElement(CloseCircleFill, null),
|
|
21367
21414
|
onlyShowClearWhenFocus: true
|
|
21368
21415
|
};
|
|
21369
|
-
const Input = forwardRef((
|
|
21370
|
-
const
|
|
21371
|
-
|
|
21416
|
+
const Input = forwardRef((props, ref) => {
|
|
21417
|
+
const {
|
|
21418
|
+
locale,
|
|
21419
|
+
input: componentConfig = {}
|
|
21420
|
+
} = useConfig();
|
|
21421
|
+
const mergedProps = mergeProps(defaultProps$v, componentConfig, props);
|
|
21422
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
21372
21423
|
const [hasFocus, setHasFocus] = useState(false);
|
|
21373
21424
|
const compositionStartRef = useRef(false);
|
|
21374
21425
|
const nativeInputRef = useRef(null);
|
|
21375
|
-
const {
|
|
21376
|
-
locale
|
|
21377
|
-
} = useConfig();
|
|
21378
21426
|
const handleKeydown = useInputHandleKeyDown({
|
|
21379
|
-
onEnterPress:
|
|
21380
|
-
onKeyDown:
|
|
21427
|
+
onEnterPress: mergedProps.onEnterPress,
|
|
21428
|
+
onKeyDown: mergedProps.onKeyDown,
|
|
21381
21429
|
nativeInputRef,
|
|
21382
|
-
enterKeyHint:
|
|
21430
|
+
enterKeyHint: mergedProps.enterKeyHint
|
|
21383
21431
|
});
|
|
21384
21432
|
useImperativeHandle(ref, () => ({
|
|
21385
21433
|
clear: () => {
|
|
@@ -21399,8 +21447,8 @@ const Input = forwardRef((p, ref) => {
|
|
|
21399
21447
|
}));
|
|
21400
21448
|
function checkValue() {
|
|
21401
21449
|
let nextValue = value;
|
|
21402
|
-
if (
|
|
21403
|
-
const boundValue = nextValue && bound(parseFloat(nextValue),
|
|
21450
|
+
if (mergedProps.type === "number") {
|
|
21451
|
+
const boundValue = nextValue && bound(parseFloat(nextValue), mergedProps.min, mergedProps.max).toString();
|
|
21404
21452
|
if (Number(nextValue) !== Number(boundValue)) {
|
|
21405
21453
|
nextValue = boundValue;
|
|
21406
21454
|
}
|
|
@@ -21410,16 +21458,16 @@ const Input = forwardRef((p, ref) => {
|
|
|
21410
21458
|
}
|
|
21411
21459
|
}
|
|
21412
21460
|
const shouldShowClear = (() => {
|
|
21413
|
-
if (!
|
|
21461
|
+
if (!mergedProps.clearable || !value || mergedProps.readOnly)
|
|
21414
21462
|
return false;
|
|
21415
|
-
if (
|
|
21463
|
+
if (mergedProps.onlyShowClearWhenFocus) {
|
|
21416
21464
|
return hasFocus;
|
|
21417
21465
|
} else {
|
|
21418
21466
|
return true;
|
|
21419
21467
|
}
|
|
21420
21468
|
})();
|
|
21421
|
-
return withNativeProps(
|
|
21422
|
-
className: classNames(`${classPrefix$A}`,
|
|
21469
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
21470
|
+
className: classNames(`${classPrefix$A}`, mergedProps.disabled && `${classPrefix$A}-disabled`)
|
|
21423
21471
|
}, React__default.createElement("input", {
|
|
21424
21472
|
ref: nativeInputRef,
|
|
21425
21473
|
className: `${classPrefix$A}-element`,
|
|
@@ -21430,50 +21478,50 @@ const Input = forwardRef((p, ref) => {
|
|
|
21430
21478
|
onFocus: (e2) => {
|
|
21431
21479
|
var _a;
|
|
21432
21480
|
setHasFocus(true);
|
|
21433
|
-
(_a =
|
|
21481
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21434
21482
|
},
|
|
21435
21483
|
onBlur: (e2) => {
|
|
21436
21484
|
var _a;
|
|
21437
21485
|
setHasFocus(false);
|
|
21438
21486
|
checkValue();
|
|
21439
|
-
(_a =
|
|
21487
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21440
21488
|
},
|
|
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:
|
|
21489
|
+
id: mergedProps.id,
|
|
21490
|
+
placeholder: mergedProps.placeholder,
|
|
21491
|
+
disabled: mergedProps.disabled,
|
|
21492
|
+
readOnly: mergedProps.readOnly,
|
|
21493
|
+
maxLength: mergedProps.maxLength,
|
|
21494
|
+
minLength: mergedProps.minLength,
|
|
21495
|
+
max: mergedProps.max,
|
|
21496
|
+
min: mergedProps.min,
|
|
21497
|
+
autoComplete: mergedProps.autoComplete,
|
|
21498
|
+
enterKeyHint: mergedProps.enterKeyHint,
|
|
21499
|
+
autoFocus: mergedProps.autoFocus,
|
|
21500
|
+
pattern: mergedProps.pattern,
|
|
21501
|
+
inputMode: mergedProps.inputMode,
|
|
21502
|
+
type: mergedProps.type,
|
|
21503
|
+
name: mergedProps.name,
|
|
21504
|
+
autoCapitalize: mergedProps.autoCapitalize,
|
|
21505
|
+
autoCorrect: mergedProps.autoCorrect,
|
|
21458
21506
|
onKeyDown: handleKeydown,
|
|
21459
|
-
onKeyUp:
|
|
21507
|
+
onKeyUp: mergedProps.onKeyUp,
|
|
21460
21508
|
onCompositionStart: (e2) => {
|
|
21461
21509
|
var _a;
|
|
21462
21510
|
compositionStartRef.current = true;
|
|
21463
|
-
(_a =
|
|
21511
|
+
(_a = mergedProps.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21464
21512
|
},
|
|
21465
21513
|
onCompositionEnd: (e2) => {
|
|
21466
21514
|
var _a;
|
|
21467
21515
|
compositionStartRef.current = false;
|
|
21468
|
-
(_a =
|
|
21516
|
+
(_a = mergedProps.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
21469
21517
|
},
|
|
21470
|
-
onClick:
|
|
21471
|
-
step:
|
|
21472
|
-
role:
|
|
21473
|
-
"aria-valuenow":
|
|
21474
|
-
"aria-valuemax":
|
|
21475
|
-
"aria-valuemin":
|
|
21476
|
-
"aria-label":
|
|
21518
|
+
onClick: mergedProps.onClick,
|
|
21519
|
+
step: mergedProps.step,
|
|
21520
|
+
role: mergedProps.role,
|
|
21521
|
+
"aria-valuenow": mergedProps["aria-valuenow"],
|
|
21522
|
+
"aria-valuemax": mergedProps["aria-valuemax"],
|
|
21523
|
+
"aria-valuemin": mergedProps["aria-valuemin"],
|
|
21524
|
+
"aria-label": mergedProps["aria-label"]
|
|
21477
21525
|
}), shouldShowClear && React__default.createElement("div", {
|
|
21478
21526
|
className: `${classPrefix$A}-clear`,
|
|
21479
21527
|
onMouseDown: (e2) => {
|
|
@@ -21482,14 +21530,14 @@ const Input = forwardRef((p, ref) => {
|
|
|
21482
21530
|
onClick: () => {
|
|
21483
21531
|
var _a, _b;
|
|
21484
21532
|
setValue2("");
|
|
21485
|
-
(_a =
|
|
21533
|
+
(_a = mergedProps.onClear) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
21486
21534
|
if (isIOS() && compositionStartRef.current) {
|
|
21487
21535
|
compositionStartRef.current = false;
|
|
21488
21536
|
(_b = nativeInputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
21489
21537
|
}
|
|
21490
21538
|
},
|
|
21491
21539
|
"aria-label": locale.Input.clear
|
|
21492
|
-
},
|
|
21540
|
+
}, mergedProps.clearIcon)));
|
|
21493
21541
|
});
|
|
21494
21542
|
const classPrefix$z = `adm-jumbo-tabs`;
|
|
21495
21543
|
const JumboTab = () => {
|
|
@@ -21750,50 +21798,60 @@ const index$7 = attachPropertiesToComponent(Modal, {
|
|
|
21750
21798
|
});
|
|
21751
21799
|
const classPrefix$y = `adm-nav-bar`;
|
|
21752
21800
|
const defaultProps$s = {
|
|
21753
|
-
|
|
21801
|
+
backIcon: true
|
|
21754
21802
|
};
|
|
21755
|
-
const NavBar = (
|
|
21756
|
-
const
|
|
21803
|
+
const NavBar = (props) => {
|
|
21804
|
+
const {
|
|
21805
|
+
navBar: componentConfig = {}
|
|
21806
|
+
} = useConfig();
|
|
21807
|
+
const mergedProps = mergeProps(defaultProps$s, componentConfig, props);
|
|
21757
21808
|
const {
|
|
21758
21809
|
back,
|
|
21810
|
+
backIcon,
|
|
21759
21811
|
backArrow
|
|
21760
|
-
} =
|
|
21761
|
-
return withNativeProps(
|
|
21812
|
+
} = mergedProps;
|
|
21813
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
21762
21814
|
className: classNames(classPrefix$y)
|
|
21763
21815
|
}, React__default.createElement("div", {
|
|
21764
21816
|
className: `${classPrefix$y}-left`,
|
|
21765
21817
|
role: "button"
|
|
21766
21818
|
}, back !== null && React__default.createElement("div", {
|
|
21767
21819
|
className: `${classPrefix$y}-back`,
|
|
21768
|
-
onClick:
|
|
21769
|
-
}, backArrow && React__default.createElement("span", {
|
|
21820
|
+
onClick: mergedProps.onBack
|
|
21821
|
+
}, (backIcon || backArrow) && React__default.createElement("span", {
|
|
21770
21822
|
className: `${classPrefix$y}-back-arrow`
|
|
21771
|
-
}, backArrow === true ? React__default.createElement(LeftOutline, null) : backArrow), React__default.createElement("span", {
|
|
21823
|
+
}, backIcon === true || backArrow === true ? componentConfig.backIcon || React__default.createElement(LeftOutline, null) : backIcon || backArrow), React__default.createElement("span", {
|
|
21772
21824
|
"aria-hidden": "true"
|
|
21773
|
-
}, back)),
|
|
21825
|
+
}, back)), mergedProps.left), React__default.createElement("div", {
|
|
21774
21826
|
className: `${classPrefix$y}-title`
|
|
21775
|
-
},
|
|
21827
|
+
}, mergedProps.children), React__default.createElement("div", {
|
|
21776
21828
|
className: `${classPrefix$y}-right`
|
|
21777
|
-
},
|
|
21829
|
+
}, mergedProps.right)));
|
|
21778
21830
|
};
|
|
21779
21831
|
const classPrefix$x = `adm-notice-bar`;
|
|
21780
21832
|
const defaultProps$r = {
|
|
21781
21833
|
color: "default",
|
|
21782
21834
|
delay: 2e3,
|
|
21783
21835
|
speed: 50,
|
|
21784
|
-
|
|
21785
|
-
|
|
21836
|
+
icon: React__default.createElement(SoundOutline, null),
|
|
21837
|
+
wrap: false
|
|
21786
21838
|
};
|
|
21787
|
-
const NoticeBar = memo((
|
|
21788
|
-
const
|
|
21839
|
+
const NoticeBar = memo((props) => {
|
|
21840
|
+
const {
|
|
21841
|
+
noticeBar: componentConfig = {}
|
|
21842
|
+
} = useConfig();
|
|
21843
|
+
const mergedProps = mergeProps(defaultProps$r, componentConfig, props);
|
|
21844
|
+
const closeIcon = mergeProp(React__default.createElement(CloseOutline, {
|
|
21845
|
+
className: `${classPrefix$x}-close-icon`
|
|
21846
|
+
}), componentConfig.closeIcon, props.closeIcon);
|
|
21789
21847
|
const containerRef = useRef(null);
|
|
21790
21848
|
const textRef = useRef(null);
|
|
21791
21849
|
const [visible, setVisible] = useState(true);
|
|
21792
|
-
const speed =
|
|
21850
|
+
const speed = mergedProps.speed;
|
|
21793
21851
|
const delayLockRef = useRef(true);
|
|
21794
21852
|
const animatingRef = useRef(false);
|
|
21795
21853
|
function start2() {
|
|
21796
|
-
if (delayLockRef.current ||
|
|
21854
|
+
if (delayLockRef.current || mergedProps.wrap)
|
|
21797
21855
|
return;
|
|
21798
21856
|
const container = containerRef.current;
|
|
21799
21857
|
const text = textRef.current;
|
|
@@ -21822,7 +21880,7 @@ const NoticeBar = memo((p) => {
|
|
|
21822
21880
|
useTimeout$1(() => {
|
|
21823
21881
|
delayLockRef.current = false;
|
|
21824
21882
|
start2();
|
|
21825
|
-
},
|
|
21883
|
+
}, mergedProps.delay);
|
|
21826
21884
|
useResizeEffect(() => {
|
|
21827
21885
|
start2();
|
|
21828
21886
|
}, containerRef);
|
|
@@ -21835,14 +21893,14 @@ const NoticeBar = memo((p) => {
|
|
|
21835
21893
|
});
|
|
21836
21894
|
if (!visible)
|
|
21837
21895
|
return null;
|
|
21838
|
-
return withNativeProps(
|
|
21839
|
-
className: classNames(classPrefix$x, `${classPrefix$x}-${
|
|
21840
|
-
[`${classPrefix$x}-wrap`]:
|
|
21896
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
21897
|
+
className: classNames(classPrefix$x, `${classPrefix$x}-${mergedProps.color}`, {
|
|
21898
|
+
[`${classPrefix$x}-wrap`]: mergedProps.wrap
|
|
21841
21899
|
}),
|
|
21842
|
-
onClick:
|
|
21843
|
-
},
|
|
21900
|
+
onClick: mergedProps.onClick
|
|
21901
|
+
}, mergedProps.icon && React__default.createElement("span", {
|
|
21844
21902
|
className: `${classPrefix$x}-left`
|
|
21845
|
-
},
|
|
21903
|
+
}, mergedProps.icon), React__default.createElement("span", {
|
|
21846
21904
|
ref: containerRef,
|
|
21847
21905
|
className: `${classPrefix$x}-content`
|
|
21848
21906
|
}, React__default.createElement("span", {
|
|
@@ -21852,18 +21910,16 @@ const NoticeBar = memo((p) => {
|
|
|
21852
21910
|
},
|
|
21853
21911
|
ref: textRef,
|
|
21854
21912
|
className: `${classPrefix$x}-content-inner`
|
|
21855
|
-
},
|
|
21913
|
+
}, mergedProps.content)), (mergedProps.closeable || mergedProps.extra) && React__default.createElement("span", {
|
|
21856
21914
|
className: `${classPrefix$x}-right`
|
|
21857
|
-
},
|
|
21915
|
+
}, mergedProps.extra, mergedProps.closeable && React__default.createElement("div", {
|
|
21858
21916
|
className: `${classPrefix$x}-close`,
|
|
21859
21917
|
onClick: () => {
|
|
21860
21918
|
var _a;
|
|
21861
21919
|
setVisible(false);
|
|
21862
|
-
(_a =
|
|
21920
|
+
(_a = mergedProps.onClose) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
21863
21921
|
}
|
|
21864
|
-
},
|
|
21865
|
-
className: `${classPrefix$x}-close-icon`
|
|
21866
|
-
})))));
|
|
21922
|
+
}, closeIcon))));
|
|
21867
21923
|
});
|
|
21868
21924
|
function shuffle(array4) {
|
|
21869
21925
|
const result = [...array4];
|
|
@@ -21922,13 +21978,13 @@ const NumberKeyboard = (p) => {
|
|
|
21922
21978
|
var _a;
|
|
21923
21979
|
(_a = props.onDelete) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
21924
21980
|
});
|
|
21925
|
-
const
|
|
21981
|
+
const startContinueClear = () => {
|
|
21926
21982
|
timeoutRef.current = window.setTimeout(() => {
|
|
21927
21983
|
onDelete();
|
|
21928
21984
|
intervalRef.current = window.setInterval(onDelete, 150);
|
|
21929
21985
|
}, 700);
|
|
21930
21986
|
};
|
|
21931
|
-
const
|
|
21987
|
+
const stopContinueClear = () => {
|
|
21932
21988
|
clearTimeout(timeoutRef.current);
|
|
21933
21989
|
clearInterval(intervalRef.current);
|
|
21934
21990
|
};
|
|
@@ -21988,14 +22044,15 @@ const NumberKeyboard = (p) => {
|
|
|
21988
22044
|
key,
|
|
21989
22045
|
className,
|
|
21990
22046
|
onTouchStart: () => {
|
|
22047
|
+
stopContinueClear();
|
|
21991
22048
|
if (key === "BACKSPACE") {
|
|
21992
|
-
|
|
22049
|
+
startContinueClear();
|
|
21993
22050
|
}
|
|
21994
22051
|
},
|
|
21995
22052
|
onTouchEnd: (e2) => {
|
|
21996
22053
|
onKeyPress(e2, key);
|
|
21997
22054
|
if (key === "BACKSPACE") {
|
|
21998
|
-
|
|
22055
|
+
stopContinueClear();
|
|
21999
22056
|
}
|
|
22000
22057
|
}
|
|
22001
22058
|
}, ariaProps), key === "BACKSPACE" ? React__default.createElement(TextDeletionOutline, null) : key);
|
|
@@ -22027,11 +22084,11 @@ const NumberKeyboard = (p) => {
|
|
|
22027
22084
|
}, React__default.createElement("div", {
|
|
22028
22085
|
className: `${classPrefix$w}-key ${classPrefix$w}-key-extra ${classPrefix$w}-key-bs`,
|
|
22029
22086
|
onTouchStart: () => {
|
|
22030
|
-
|
|
22087
|
+
startContinueClear();
|
|
22031
22088
|
},
|
|
22032
22089
|
onTouchEnd: (e2) => {
|
|
22033
22090
|
onKeyPress(e2, "BACKSPACE");
|
|
22034
|
-
|
|
22091
|
+
stopContinueClear();
|
|
22035
22092
|
},
|
|
22036
22093
|
onContextMenu: (e2) => {
|
|
22037
22094
|
e2.preventDefault();
|
|
@@ -22599,14 +22656,33 @@ const Rate = (p) => {
|
|
|
22599
22656
|
className: classNames(`${classPrefix$p}-box`)
|
|
22600
22657
|
}, props.allowHalf && renderStar(i2 + 0.5, true), renderStar(i2 + 1, false)))));
|
|
22601
22658
|
};
|
|
22602
|
-
const
|
|
22603
|
-
const
|
|
22604
|
-
|
|
22605
|
-
|
|
22606
|
-
|
|
22607
|
-
|
|
22608
|
-
|
|
22659
|
+
const useResultIcon = (status) => {
|
|
22660
|
+
const {
|
|
22661
|
+
result: componentConfig = {}
|
|
22662
|
+
} = useConfig();
|
|
22663
|
+
const {
|
|
22664
|
+
successIcon = React__default.createElement(CheckCircleFill, null),
|
|
22665
|
+
errorIcon = React__default.createElement(CloseCircleFill, null),
|
|
22666
|
+
infoIcon = React__default.createElement(InformationCircleFill, null),
|
|
22667
|
+
waitingIcon = React__default.createElement(ClockCircleFill, null),
|
|
22668
|
+
warningIcon = React__default.createElement(ExclamationCircleFill, null)
|
|
22669
|
+
} = componentConfig || {};
|
|
22670
|
+
switch (status) {
|
|
22671
|
+
case "success":
|
|
22672
|
+
return successIcon;
|
|
22673
|
+
case "error":
|
|
22674
|
+
return errorIcon;
|
|
22675
|
+
case "info":
|
|
22676
|
+
return infoIcon;
|
|
22677
|
+
case "waiting":
|
|
22678
|
+
return waitingIcon;
|
|
22679
|
+
case "warning":
|
|
22680
|
+
return warningIcon;
|
|
22681
|
+
default:
|
|
22682
|
+
return null;
|
|
22683
|
+
}
|
|
22609
22684
|
};
|
|
22685
|
+
const classPrefix$o = `adm-result`;
|
|
22610
22686
|
const defaultProps$i = {
|
|
22611
22687
|
status: "info"
|
|
22612
22688
|
};
|
|
@@ -22618,27 +22694,20 @@ const Result = (p) => {
|
|
|
22618
22694
|
description,
|
|
22619
22695
|
icon
|
|
22620
22696
|
} = props;
|
|
22697
|
+
const fallbackIcon = useResultIcon(status);
|
|
22621
22698
|
if (!status)
|
|
22622
22699
|
return null;
|
|
22623
|
-
const resultIcon = icon || React__default.createElement(iconRecord$1[status]);
|
|
22624
22700
|
return withNativeProps(props, React__default.createElement("div", {
|
|
22625
22701
|
className: classNames(classPrefix$o, `${classPrefix$o}-${status}`)
|
|
22626
22702
|
}, React__default.createElement("div", {
|
|
22627
22703
|
className: `${classPrefix$o}-icon`
|
|
22628
|
-
},
|
|
22704
|
+
}, icon || fallbackIcon), React__default.createElement("div", {
|
|
22629
22705
|
className: `${classPrefix$o}-title`
|
|
22630
22706
|
}, title), !!description && React__default.createElement("div", {
|
|
22631
22707
|
className: `${classPrefix$o}-description`
|
|
22632
22708
|
}, description)));
|
|
22633
22709
|
};
|
|
22634
22710
|
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
22711
|
const defaultProps$h = {
|
|
22643
22712
|
status: "info",
|
|
22644
22713
|
details: []
|
|
@@ -22656,7 +22725,7 @@ const ResultPage = (p) => {
|
|
|
22656
22725
|
onPrimaryButtonClick,
|
|
22657
22726
|
onSecondaryButtonClick
|
|
22658
22727
|
} = props;
|
|
22659
|
-
const
|
|
22728
|
+
const fallbackIcon = useResultIcon(status);
|
|
22660
22729
|
const [collapse, setCollapse] = useState(true);
|
|
22661
22730
|
const showSecondaryButton = isNodeWithContent(secondaryButtonText);
|
|
22662
22731
|
const showPrimaryButton = isNodeWithContent(primaryButtonText);
|
|
@@ -22666,7 +22735,7 @@ const ResultPage = (p) => {
|
|
|
22666
22735
|
className: `${classPrefix$n}-header`
|
|
22667
22736
|
}, React__default.createElement("div", {
|
|
22668
22737
|
className: `${classPrefix$n}-icon`
|
|
22669
|
-
},
|
|
22738
|
+
}, icon || fallbackIcon), React__default.createElement("div", {
|
|
22670
22739
|
className: `${classPrefix$n}-title`
|
|
22671
22740
|
}, title), isNodeWithContent(description) ? React__default.createElement("div", {
|
|
22672
22741
|
className: `${classPrefix$n}-description`
|
|
@@ -22722,17 +22791,18 @@ const defaultProps$g = {
|
|
|
22722
22791
|
onlyShowClearWhenFocus: false,
|
|
22723
22792
|
showCancelButton: false,
|
|
22724
22793
|
defaultValue: "",
|
|
22725
|
-
clearOnCancel: true
|
|
22726
|
-
icon: React__default.createElement(SearchOutline, null)
|
|
22794
|
+
clearOnCancel: true
|
|
22727
22795
|
};
|
|
22728
|
-
const SearchBar = forwardRef((
|
|
22796
|
+
const SearchBar = forwardRef((props, ref) => {
|
|
22729
22797
|
const {
|
|
22730
|
-
locale
|
|
22798
|
+
locale,
|
|
22799
|
+
searchBar: componentConfig = {}
|
|
22731
22800
|
} = useConfig();
|
|
22732
|
-
const
|
|
22801
|
+
const mergedProps = mergeProps(defaultProps$g, componentConfig, {
|
|
22733
22802
|
cancelText: locale.common.cancel
|
|
22734
|
-
},
|
|
22735
|
-
const
|
|
22803
|
+
}, props);
|
|
22804
|
+
const searchIcon = mergeProp(React__default.createElement(SearchOutline, null), componentConfig.searchIcon, props.icon, props.searchIcon);
|
|
22805
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
22736
22806
|
const [hasFocus, setHasFocus] = useState(false);
|
|
22737
22807
|
const inputRef = useRef(null);
|
|
22738
22808
|
const composingRef = useRef(false);
|
|
@@ -22756,10 +22826,10 @@ const SearchBar = forwardRef((p, ref) => {
|
|
|
22756
22826
|
}));
|
|
22757
22827
|
const renderCancelButton = () => {
|
|
22758
22828
|
let isShowCancel;
|
|
22759
|
-
if (typeof
|
|
22760
|
-
isShowCancel =
|
|
22829
|
+
if (typeof mergedProps.showCancelButton === "function") {
|
|
22830
|
+
isShowCancel = mergedProps.showCancelButton(hasFocus, value);
|
|
22761
22831
|
} else {
|
|
22762
|
-
isShowCancel =
|
|
22832
|
+
isShowCancel = mergedProps.showCancelButton && hasFocus;
|
|
22763
22833
|
}
|
|
22764
22834
|
return isShowCancel && React__default.createElement("div", {
|
|
22765
22835
|
className: `${classPrefix$l}-suffix`
|
|
@@ -22768,66 +22838,66 @@ const SearchBar = forwardRef((p, ref) => {
|
|
|
22768
22838
|
className: `${classPrefix$l}-cancel-button`,
|
|
22769
22839
|
onClick: () => {
|
|
22770
22840
|
var _a, _b, _c;
|
|
22771
|
-
if (
|
|
22841
|
+
if (mergedProps.clearOnCancel) {
|
|
22772
22842
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.clear();
|
|
22773
22843
|
}
|
|
22774
22844
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
22775
|
-
(_c =
|
|
22845
|
+
(_c = mergedProps.onCancel) === null || _c === void 0 ? void 0 : _c.call(mergedProps);
|
|
22776
22846
|
},
|
|
22777
22847
|
onMouseDown: (e2) => {
|
|
22778
22848
|
e2.preventDefault();
|
|
22779
22849
|
}
|
|
22780
|
-
},
|
|
22850
|
+
}, mergedProps.cancelText));
|
|
22781
22851
|
};
|
|
22782
|
-
return withNativeProps(
|
|
22852
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
22783
22853
|
className: classNames(classPrefix$l, {
|
|
22784
22854
|
[`${classPrefix$l}-active`]: hasFocus
|
|
22785
22855
|
})
|
|
22786
22856
|
}, React__default.createElement("div", {
|
|
22787
22857
|
className: `${classPrefix$l}-input-box`
|
|
22788
|
-
},
|
|
22858
|
+
}, searchIcon && React__default.createElement("div", {
|
|
22789
22859
|
className: `${classPrefix$l}-input-box-icon`
|
|
22790
|
-
},
|
|
22860
|
+
}, searchIcon), React__default.createElement(Input, {
|
|
22791
22861
|
ref: inputRef,
|
|
22792
22862
|
className: classNames(`${classPrefix$l}-input`, {
|
|
22793
|
-
[`${classPrefix$l}-input-without-icon`]: !
|
|
22863
|
+
[`${classPrefix$l}-input-without-icon`]: !searchIcon
|
|
22794
22864
|
}),
|
|
22795
22865
|
value,
|
|
22796
22866
|
onChange: setValue2,
|
|
22797
|
-
maxLength:
|
|
22798
|
-
placeholder:
|
|
22799
|
-
clearable:
|
|
22800
|
-
onlyShowClearWhenFocus:
|
|
22867
|
+
maxLength: mergedProps.maxLength,
|
|
22868
|
+
placeholder: mergedProps.placeholder,
|
|
22869
|
+
clearable: mergedProps.clearable,
|
|
22870
|
+
onlyShowClearWhenFocus: mergedProps.onlyShowClearWhenFocus,
|
|
22801
22871
|
onFocus: (e2) => {
|
|
22802
22872
|
var _a;
|
|
22803
22873
|
setHasFocus(true);
|
|
22804
|
-
(_a =
|
|
22874
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22805
22875
|
},
|
|
22806
22876
|
onBlur: (e2) => {
|
|
22807
22877
|
var _a;
|
|
22808
22878
|
setHasFocus(false);
|
|
22809
|
-
(_a =
|
|
22879
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22810
22880
|
},
|
|
22811
|
-
onClear:
|
|
22881
|
+
onClear: mergedProps.onClear,
|
|
22812
22882
|
type: "search",
|
|
22813
22883
|
enterKeyHint: "search",
|
|
22814
22884
|
onEnterPress: () => {
|
|
22815
22885
|
var _a, _b;
|
|
22816
22886
|
if (!composingRef.current) {
|
|
22817
22887
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
22818
|
-
(_b =
|
|
22888
|
+
(_b = mergedProps.onSearch) === null || _b === void 0 ? void 0 : _b.call(mergedProps, value);
|
|
22819
22889
|
}
|
|
22820
22890
|
},
|
|
22821
22891
|
"aria-label": locale.SearchBar.name,
|
|
22822
22892
|
onCompositionStart: (e2) => {
|
|
22823
22893
|
var _a;
|
|
22824
22894
|
composingRef.current = true;
|
|
22825
|
-
(_a =
|
|
22895
|
+
(_a = mergedProps.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22826
22896
|
},
|
|
22827
22897
|
onCompositionEnd: (e2) => {
|
|
22828
22898
|
var _a;
|
|
22829
22899
|
composingRef.current = false;
|
|
22830
|
-
(_a =
|
|
22900
|
+
(_a = mergedProps.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(mergedProps, e2);
|
|
22831
22901
|
}
|
|
22832
22902
|
})), renderCancelButton()));
|
|
22833
22903
|
});
|
|
@@ -25426,15 +25496,17 @@ const classPrefix$2 = "adm-virtual-input";
|
|
|
25426
25496
|
const defaultProps$2 = {
|
|
25427
25497
|
defaultValue: ""
|
|
25428
25498
|
};
|
|
25429
|
-
const VirtualInput = forwardRef((
|
|
25430
|
-
const
|
|
25431
|
-
|
|
25499
|
+
const VirtualInput = forwardRef((props, ref) => {
|
|
25500
|
+
const {
|
|
25501
|
+
locale,
|
|
25502
|
+
input: componentConfig = {}
|
|
25503
|
+
} = useConfig();
|
|
25504
|
+
const mergedProps = mergeProps(defaultProps$2, componentConfig, props);
|
|
25505
|
+
const [value, setValue2] = usePropsValue(mergedProps);
|
|
25432
25506
|
const rootRef = useRef(null);
|
|
25433
25507
|
const contentRef = useRef(null);
|
|
25434
25508
|
const [hasFocus, setHasFocus] = useState(false);
|
|
25435
|
-
const
|
|
25436
|
-
locale
|
|
25437
|
-
} = useConfig();
|
|
25509
|
+
const clearIcon = mergeProp(React__default.createElement(CloseCircleFill, null), componentConfig.clearIcon, props.clearIcon);
|
|
25438
25510
|
function scrollToEnd() {
|
|
25439
25511
|
const root2 = rootRef.current;
|
|
25440
25512
|
if (!root2)
|
|
@@ -25468,14 +25540,14 @@ const VirtualInput = forwardRef((p, ref) => {
|
|
|
25468
25540
|
function onFocus() {
|
|
25469
25541
|
var _a;
|
|
25470
25542
|
setHasFocus(true);
|
|
25471
|
-
(_a =
|
|
25543
|
+
(_a = mergedProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25472
25544
|
}
|
|
25473
25545
|
function onBlur() {
|
|
25474
25546
|
var _a;
|
|
25475
25547
|
setHasFocus(false);
|
|
25476
|
-
(_a =
|
|
25548
|
+
(_a = mergedProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25477
25549
|
}
|
|
25478
|
-
const keyboard =
|
|
25550
|
+
const keyboard = mergedProps.keyboard;
|
|
25479
25551
|
const keyboardElement = keyboard && React__default.cloneElement(keyboard, {
|
|
25480
25552
|
onInput: (v) => {
|
|
25481
25553
|
var _a, _b;
|
|
@@ -25500,38 +25572,38 @@ const VirtualInput = forwardRef((p, ref) => {
|
|
|
25500
25572
|
},
|
|
25501
25573
|
getContainer: null
|
|
25502
25574
|
});
|
|
25503
|
-
return withNativeProps(
|
|
25575
|
+
return withNativeProps(mergedProps, React__default.createElement("div", {
|
|
25504
25576
|
ref: rootRef,
|
|
25505
25577
|
className: classNames(classPrefix$2, {
|
|
25506
|
-
[`${classPrefix$2}-disabled`]:
|
|
25578
|
+
[`${classPrefix$2}-disabled`]: mergedProps.disabled
|
|
25507
25579
|
}),
|
|
25508
|
-
tabIndex:
|
|
25580
|
+
tabIndex: mergedProps.disabled ? void 0 : 0,
|
|
25509
25581
|
role: "textbox",
|
|
25510
25582
|
onFocus,
|
|
25511
25583
|
onBlur,
|
|
25512
|
-
onClick:
|
|
25584
|
+
onClick: mergedProps.onClick
|
|
25513
25585
|
}, React__default.createElement("div", {
|
|
25514
25586
|
className: `${classPrefix$2}-content`,
|
|
25515
25587
|
ref: contentRef,
|
|
25516
|
-
"aria-disabled":
|
|
25517
|
-
"aria-label":
|
|
25588
|
+
"aria-disabled": mergedProps.disabled,
|
|
25589
|
+
"aria-label": mergedProps.placeholder
|
|
25518
25590
|
}, value, React__default.createElement("div", {
|
|
25519
25591
|
className: `${classPrefix$2}-caret-container`
|
|
25520
25592
|
}, hasFocus && React__default.createElement("div", {
|
|
25521
25593
|
className: `${classPrefix$2}-caret`
|
|
25522
|
-
}))),
|
|
25594
|
+
}))), mergedProps.clearable && !!value && hasFocus && React__default.createElement("div", {
|
|
25523
25595
|
className: `${classPrefix$2}-clear`,
|
|
25524
25596
|
onClick: (e2) => {
|
|
25525
25597
|
var _a;
|
|
25526
25598
|
e2.stopPropagation();
|
|
25527
25599
|
setValue2("");
|
|
25528
|
-
(_a =
|
|
25600
|
+
(_a = mergedProps.onClear) === null || _a === void 0 ? void 0 : _a.call(mergedProps);
|
|
25529
25601
|
},
|
|
25530
25602
|
role: "button",
|
|
25531
25603
|
"aria-label": locale.Input.clear
|
|
25532
|
-
},
|
|
25604
|
+
}, clearIcon), [void 0, null, ""].includes(value) && React__default.createElement("div", {
|
|
25533
25605
|
className: `${classPrefix$2}-placeholder`
|
|
25534
|
-
},
|
|
25606
|
+
}, mergedProps.placeholder), keyboardElement));
|
|
25535
25607
|
});
|
|
25536
25608
|
const classPrefix$1 = `adm-water-mark`;
|
|
25537
25609
|
const defaultProps$1 = {
|