@ucloud-fe/react-components 1.4.6 → 1.5.2
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/CHANGELOG.md +32 -0
- package/dist/icon.min.js +1 -1
- package/dist/main.min.js +4 -4
- package/lib/components/ActionList/ActionList.d.ts +3 -1
- package/lib/components/ActionList/ActionList.js +79 -5
- package/lib/components/ActionList/index.d.ts +1 -1
- package/lib/components/ActionList/style/index.d.ts +2 -0
- package/lib/components/ActionList/style/index.js +33 -2
- package/lib/components/ConfigProvider/ConfigContext.d.ts +1 -1
- package/lib/components/ConfigProvider/ConfigProvider.d.ts +2 -0
- package/lib/components/ConfigProvider/ConfigProvider.js +2 -1
- package/lib/components/ConfigProvider/index.d.ts +4 -2
- package/lib/components/ConfigProvider/index.js +8 -1
- package/lib/components/DatePicker/DatePicker.d.ts +5 -1
- package/lib/components/Form/ControllerContext.d.ts +1 -1
- package/lib/components/Input/.recodo/interaction.js +2 -2
- package/lib/components/Input/Input.js +12 -60
- package/lib/components/Input/Search.js +1 -0
- package/lib/components/Input/style/index.d.ts +23 -8
- package/lib/components/Input/style/index.js +97 -17
- package/lib/components/Menu/Item.js +9 -2
- package/lib/components/Menu/Menu.d.ts +11 -3
- package/lib/components/Menu/Menu.js +23 -9
- package/lib/components/Menu/MenuContext.d.ts +1 -0
- package/lib/components/Menu/index.d.ts +2 -2
- package/lib/components/Menu/style/index.d.ts +3 -0
- package/lib/components/Menu/style/index.js +14 -8
- package/lib/components/Notice/index.d.ts +1 -1
- package/lib/components/Select/Group.d.ts +3 -0
- package/lib/components/Select/Group.js +4 -0
- package/lib/components/Select/Option.js +2 -28
- package/lib/components/Select/Overflow.d.ts +19 -0
- package/lib/components/Select/Overflow.js +155 -0
- package/lib/components/Select/Select.d.ts +15 -9
- package/lib/components/Select/Select.js +1150 -322
- package/lib/components/Select/SelectContext.d.ts +1 -1
- package/lib/components/Select/index.d.ts +3 -1
- package/lib/components/Select/locale/en_US.js +2 -1
- package/lib/components/Select/locale/zh_CN.d.ts +1 -0
- package/lib/components/Select/locale/zh_CN.js +2 -1
- package/lib/components/Select/style/index.d.ts +45 -8
- package/lib/components/Select/style/index.js +132 -46
- package/lib/components/SvgIcon/icons/ArrowDown.js +2 -2
- package/lib/components/SvgIcon/icons/ArrowLeft.js +3 -2
- package/lib/components/SvgIcon/icons/ArrowRight.js +2 -2
- package/lib/components/SvgIcon/icons/ArrowUp.js +2 -2
- package/lib/components/SvgIcon/icons/DoubleArrowLeft.js +4 -7
- package/lib/components/SvgIcon/icons/DoubleArrowRight.js +4 -6
- package/lib/components/SvgIcon/style/index.js +2 -2
- package/lib/components/Tabs/style/index.d.ts +1 -1
- package/lib/config.d.ts +4 -2
- package/lib/config.js +22 -4
- package/lib/hooks/group.d.ts +1 -1
- package/lib/hooks/group.js +5 -9
- package/lib/hooks/useConfig.d.ts +2 -0
- package/lib/hooks/useConfig.js +30 -0
- package/lib/hooks/useOverflow.d.ts +24 -0
- package/lib/hooks/useOverflow.js +140 -0
- package/lib/hooks/useUncontrolled.d.ts +1 -1
- package/lib/hooks/useUncontrolled.js +1 -1
- package/lib/libs/rc-table/Table.js +2 -3
- package/lib/sharedComponents/InputWrap.d.ts +16 -0
- package/lib/sharedComponents/InputWrap.js +66 -0
- package/lib/utils/pick.d.ts +1 -1
- package/package.json +3 -3
|
@@ -16,8 +16,8 @@ var _this = void 0;
|
|
|
16
16
|
var _default = /*#__PURE__*/_react.default.memo(function () {
|
|
17
17
|
(0, _newArrowCheck2.default)(this, _this);
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
d: "M17.2928932,9.14644661 L18.7071068,10.5606602 L12.7071068,16.5606602 C12.3466228,16.9211441 11.7793918,16.9488737 11.3871006,16.6438488 L11.2928932,16.5606602 L5.29289322,10.5606602 L6.70710678,9.14644661 L12,14.438545 L17.2928932,9.14644661 Z"
|
|
21
21
|
});
|
|
22
22
|
}.bind(void 0));
|
|
23
23
|
|
|
@@ -16,8 +16,9 @@ var _this = void 0;
|
|
|
16
16
|
var _default = /*#__PURE__*/_react.default.memo(function () {
|
|
17
17
|
(0, _newArrowCheck2.default)(this, _this);
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
d: "M7.14644661,17.2928932 L8.56066017,18.7071068 L14.5606602,12.7071068 C14.9211441,12.3466228 14.9488737,11.7793918 14.6438488,11.3871006 L14.5606602,11.2928932 L8.56066017,5.29289322 L7.14644661,6.70710678 L12.438545,12 L7.14644661,17.2928932 Z",
|
|
21
|
+
transform: "matrix(-1 0 0 1 22 0)"
|
|
21
22
|
});
|
|
22
23
|
}.bind(void 0));
|
|
23
24
|
|
|
@@ -16,8 +16,8 @@ var _this = void 0;
|
|
|
16
16
|
var _default = /*#__PURE__*/_react.default.memo(function () {
|
|
17
17
|
(0, _newArrowCheck2.default)(this, _this);
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
d: "M9.14644661,17.2928932 L10.5606602,18.7071068 L16.5606602,12.7071068 C16.9211441,12.3466228 16.9488737,11.7793918 16.6438488,11.3871006 L16.5606602,11.2928932 L10.5606602,5.29289322 L9.14644661,6.70710678 L14.438545,12 L9.14644661,17.2928932 Z"
|
|
21
21
|
});
|
|
22
22
|
}.bind(void 0));
|
|
23
23
|
|
|
@@ -16,8 +16,8 @@ var _this = void 0;
|
|
|
16
16
|
var _default = /*#__PURE__*/_react.default.memo(function () {
|
|
17
17
|
(0, _newArrowCheck2.default)(this, _this);
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
d: "M17.2928932,15.8535534 L18.7071068,14.4393398 L12.7071068,8.43933983 C12.3466228,8.07885587 11.7793918,8.05112633 11.3871006,8.35615122 L11.2928932,8.43933983 L5.29289322,14.4393398 L6.70710678,15.8535534 L12,10.561455 L17.2928932,15.8535534 Z"
|
|
21
21
|
});
|
|
22
22
|
}.bind(void 0));
|
|
23
23
|
|
|
@@ -15,13 +15,10 @@ var _this = void 0;
|
|
|
15
15
|
|
|
16
16
|
var _default = /*#__PURE__*/_react.default.memo(function () {
|
|
17
17
|
(0, _newArrowCheck2.default)(this, _this);
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
23
|
-
d: "M7.99894297,7.45472138 L2.46174746,0.00265862103 L0.00227135586,0 L6.01254288,7.99729856 L8.8817842e-16,15.9973414 L2.45796294,16 L7.93597021,8.62812604 C8.20885216,8.30767788 8.22984308,7.80344423 7.99894297,7.45472138 Z M15.0369473,7.45472138 L9.49975179,0.00265862103 L7.04027568,0 L13.0505472,7.99729856 L7.03800433,15.9973414 L9.49596727,16 L14.9739745,8.62812604 C15.2468565,8.30767788 15.2678474,7.80344423 15.0369473,7.45472138 L15.0369473,7.45472138 Z"
|
|
24
|
-
}));
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
d: "M11.970589,19.7775908 L10.3653616,20.970589 L4.41979548,12.970589 C4.18293196,12.6518796 4.1592456,12.2273571 4.34873642,11.887485 L4.41979548,11.7775908 L10.3653616,3.77759079 L11.970589,4.97058903 L6.46828301,12.3742444 L11.970589,19.7775908 Z M18.970589,19.7775908 L17.3653616,20.970589 L11.4197955,12.970589 C11.182932,12.6518796 11.1592456,12.2273571 11.3487364,11.887485 L11.4197955,11.7775908 L17.3653616,3.77759079 L18.970589,4.97058903 L13.468283,12.3742444 L18.970589,19.7775908 Z"
|
|
21
|
+
});
|
|
25
22
|
}.bind(void 0));
|
|
26
23
|
|
|
27
24
|
exports.default = _default;
|
|
@@ -15,12 +15,10 @@ var _this = void 0;
|
|
|
15
15
|
|
|
16
16
|
var _default = /*#__PURE__*/_react.default.memo(function () {
|
|
17
17
|
(0, _newArrowCheck2.default)(this, _this);
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
d: "M7.99894297,7.45472138 L2.46174746,0.00265862103 L0.00227135586,0 L6.01254288,7.99729856 L8.8817842e-16,15.9973414 L2.45796294,16 L7.93597021,8.62812604 C8.20885216,8.30767788 8.22984308,7.80344423 7.99894297,7.45472138 Z M15.0369473,7.45472138 L9.49975179,0.00265862103 L7.04027568,0 L13.0505472,7.99729856 L7.03800433,15.9973414 L9.49596727,16 L14.9739745,8.62812604 C15.2468565,8.30767788 15.2678474,7.80344423 15.0369473,7.45472138 L15.0369473,7.45472138 Z"
|
|
23
|
-
}));
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
d: "M11.2224092,19.7775908 L12.8276367,20.970589 L18.7732028,12.970589 C19.0100663,12.6518796 19.0337526,12.2273571 18.8442618,11.887485 L18.7732028,11.7775908 L12.8276367,3.77759079 L11.2224092,4.97058903 L16.7247152,12.3742444 L11.2224092,19.7775908 Z M4.22240921,19.7775908 L5.82763667,20.970589 L11.7732028,12.970589 C12.0100663,12.6518796 12.0337526,12.2273571 11.8442618,11.887485 L11.7732028,11.7775908 L5.82763667,3.77759079 L4.22240921,4.97058903 L9.72471523,12.3742444 L4.22240921,19.7775908 Z"
|
|
21
|
+
});
|
|
24
22
|
}.bind(void 0));
|
|
25
23
|
|
|
26
24
|
exports.default = _default;
|
|
@@ -30,6 +30,6 @@ var SvgIconWrapper = (0, _withProps.default)({})(( /*#__PURE__*/0, _styledBase.d
|
|
|
30
30
|
var color = props.color,
|
|
31
31
|
size = props.size,
|
|
32
32
|
spin = props.spin;
|
|
33
|
-
return /*#__PURE__*/(0, _core.css)("transition:
|
|
34
|
-
}.bind(void 0), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1N2Z0ljb24vc3R5bGUvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBT0kiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvU3ZnSWNvbi9zdHlsZS9pbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL2NvcmUnO1xuXG5pbXBvcnQgeyBzcGluTWl4aW4sIGlubGluZUJsb2NrV2l0aFZlcnRpY2FsTWl4aW4gfSBmcm9tICdzcmMvc3R5bGUnO1xuaW1wb3J0IHdpdGhQcm9wcyBmcm9tICdzcmMvdXRpbHMvd2l0aFByb3BzJztcblxuZXhwb3J0IGNvbnN0IFN2Z0ljb25XcmFwcGVyID0gd2l0aFByb3BzKHt9KShcbiAgICBzdHlsZWQoJ3N2ZycpKHByb3BzID0+
|
|
33
|
+
return /*#__PURE__*/(0, _core.css)("transition:fill 0.3s,width 0.3s,height 0.3s;", _style.inlineBlockWithVerticalMixin, ";fill:currentcolor;", color && /*#__PURE__*/(0, _core.css)("fill:", color, ";;label:SvgIconWrapper;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1N2Z0ljb24vc3R5bGUvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBa0JlIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1N2Z0ljb24vc3R5bGUvaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9jb3JlJztcblxuaW1wb3J0IHsgc3Bpbk1peGluLCBpbmxpbmVCbG9ja1dpdGhWZXJ0aWNhbE1peGluIH0gZnJvbSAnc3JjL3N0eWxlJztcbmltcG9ydCB3aXRoUHJvcHMgZnJvbSAnc3JjL3V0aWxzL3dpdGhQcm9wcyc7XG5cbmV4cG9ydCBjb25zdCBTdmdJY29uV3JhcHBlciA9IHdpdGhQcm9wcyh7fSkoXG4gICAgc3R5bGVkKCdzdmcnKShwcm9wcyA9PiB7XG4gICAgICAgIGNvbnN0IHsgY29sb3IsIHNpemUsIHNwaW4gfSA9IHByb3BzO1xuXG4gICAgICAgIHJldHVybiBjc3NgXG4gICAgICAgICAgICB0cmFuc2l0aW9uOiBmaWxsIDAuM3MsIHdpZHRoIDAuM3MsIGhlaWdodCAwLjNzO1xuXG4gICAgICAgICAgICAke2lubGluZUJsb2NrV2l0aFZlcnRpY2FsTWl4aW59O1xuXG4gICAgICAgICAgICBmaWxsOiBjdXJyZW50Y29sb3I7XG5cbiAgICAgICAgICAgICR7Y29sb3IgJiZcbiAgICAgICAgICAgIGNzc2BcbiAgICAgICAgICAgICAgICBmaWxsOiAke2NvbG9yfTtcbiAgICAgICAgICAgIGB9O1xuXG4gICAgICAgICAgICAke2Nzc2BcbiAgICAgICAgICAgICAgICB3aWR0aDogJHtzaXplfTtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6ICR7c2l6ZX07XG4gICAgICAgICAgICBgfTtcbiAgICAgICAgICAgICR7c3BpbiAmJiBzcGluTWl4aW59O1xuICAgICAgICBgO1xuICAgIH0pXG4pO1xuIl19 */")), ";", (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n height: ", ";\n "])), size, size), ";", spin && _style.spinMixin, ";;label:SvgIconWrapper;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1N2Z0ljb24vc3R5bGUvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBVWtCIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1N2Z0ljb24vc3R5bGUvaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9jb3JlJztcblxuaW1wb3J0IHsgc3Bpbk1peGluLCBpbmxpbmVCbG9ja1dpdGhWZXJ0aWNhbE1peGluIH0gZnJvbSAnc3JjL3N0eWxlJztcbmltcG9ydCB3aXRoUHJvcHMgZnJvbSAnc3JjL3V0aWxzL3dpdGhQcm9wcyc7XG5cbmV4cG9ydCBjb25zdCBTdmdJY29uV3JhcHBlciA9IHdpdGhQcm9wcyh7fSkoXG4gICAgc3R5bGVkKCdzdmcnKShwcm9wcyA9PiB7XG4gICAgICAgIGNvbnN0IHsgY29sb3IsIHNpemUsIHNwaW4gfSA9IHByb3BzO1xuXG4gICAgICAgIHJldHVybiBjc3NgXG4gICAgICAgICAgICB0cmFuc2l0aW9uOiBmaWxsIDAuM3MsIHdpZHRoIDAuM3MsIGhlaWdodCAwLjNzO1xuXG4gICAgICAgICAgICAke2lubGluZUJsb2NrV2l0aFZlcnRpY2FsTWl4aW59O1xuXG4gICAgICAgICAgICBmaWxsOiBjdXJyZW50Y29sb3I7XG5cbiAgICAgICAgICAgICR7Y29sb3IgJiZcbiAgICAgICAgICAgIGNzc2BcbiAgICAgICAgICAgICAgICBmaWxsOiAke2NvbG9yfTtcbiAgICAgICAgICAgIGB9O1xuXG4gICAgICAgICAgICAke2Nzc2BcbiAgICAgICAgICAgICAgICB3aWR0aDogJHtzaXplfTtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6ICR7c2l6ZX07XG4gICAgICAgICAgICBgfTtcbiAgICAgICAgICAgICR7c3BpbiAmJiBzcGluTWl4aW59O1xuICAgICAgICBgO1xuICAgIH0pXG4pO1xuIl19 */"));
|
|
34
|
+
}.bind(void 0), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1N2Z0ljb24vc3R5bGUvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBT0kiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvU3ZnSWNvbi9zdHlsZS9pbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL2NvcmUnO1xuXG5pbXBvcnQgeyBzcGluTWl4aW4sIGlubGluZUJsb2NrV2l0aFZlcnRpY2FsTWl4aW4gfSBmcm9tICdzcmMvc3R5bGUnO1xuaW1wb3J0IHdpdGhQcm9wcyBmcm9tICdzcmMvdXRpbHMvd2l0aFByb3BzJztcblxuZXhwb3J0IGNvbnN0IFN2Z0ljb25XcmFwcGVyID0gd2l0aFByb3BzKHt9KShcbiAgICBzdHlsZWQoJ3N2ZycpKHByb3BzID0+IHtcbiAgICAgICAgY29uc3QgeyBjb2xvciwgc2l6ZSwgc3BpbiB9ID0gcHJvcHM7XG5cbiAgICAgICAgcmV0dXJuIGNzc2BcbiAgICAgICAgICAgIHRyYW5zaXRpb246IGZpbGwgMC4zcywgd2lkdGggMC4zcywgaGVpZ2h0IDAuM3M7XG5cbiAgICAgICAgICAgICR7aW5saW5lQmxvY2tXaXRoVmVydGljYWxNaXhpbn07XG5cbiAgICAgICAgICAgIGZpbGw6IGN1cnJlbnRjb2xvcjtcblxuICAgICAgICAgICAgJHtjb2xvciAmJlxuICAgICAgICAgICAgY3NzYFxuICAgICAgICAgICAgICAgIGZpbGw6ICR7Y29sb3J9O1xuICAgICAgICAgICAgYH07XG5cbiAgICAgICAgICAgICR7Y3NzYFxuICAgICAgICAgICAgICAgIHdpZHRoOiAke3NpemV9O1xuICAgICAgICAgICAgICAgIGhlaWdodDogJHtzaXplfTtcbiAgICAgICAgICAgIGB9O1xuICAgICAgICAgICAgJHtzcGluICYmIHNwaW5NaXhpbn07XG4gICAgICAgIGA7XG4gICAgfSlcbik7XG4iXX0= */"));
|
|
35
35
|
exports.SvgIconWrapper = SvgIconWrapper;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TabsProps } from '../Tabs';
|
|
3
3
|
export declare const prefixCls: string;
|
|
4
|
-
export declare const SWrap: import("react").ForwardRefExoticComponent<Required<Pick<TabsProps, "
|
|
4
|
+
export declare const SWrap: import("react").ForwardRefExoticComponent<Required<Pick<TabsProps, "size" | "styleType" | "tabBarPosition">> & import("react").HTMLAttributes<HTMLElement> & {
|
|
5
5
|
theme?: import("../../../style").Theme | undefined;
|
|
6
6
|
} & import("react").RefAttributes<HTMLElement>>;
|
package/lib/config.d.ts
CHANGED
package/lib/config.js
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
exports.setConfig = exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/newArrowCheck"));
|
|
11
|
+
|
|
12
|
+
var _this = void 0;
|
|
13
|
+
|
|
14
|
+
var config = {
|
|
15
|
+
prefixCls: 'uc-fe',
|
|
16
|
+
actionListAutoAdjustment: false
|
|
9
17
|
};
|
|
10
|
-
|
|
18
|
+
var _default = config;
|
|
19
|
+
/** 只能在组件初始化时使用,否则会导致意外的问题 */
|
|
20
|
+
|
|
21
|
+
exports.default = _default;
|
|
22
|
+
|
|
23
|
+
var setConfig = function setConfig(_config) {
|
|
24
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
25
|
+
Object.assign(config, _config);
|
|
26
|
+
}.bind(void 0);
|
|
27
|
+
|
|
28
|
+
exports.setConfig = setConfig;
|
package/lib/hooks/group.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare type SubGroupMap = Map<Key, {
|
|
|
20
20
|
* @param selectedKeys all selected keys
|
|
21
21
|
* @param onChange callback when selectedKeys change
|
|
22
22
|
*/
|
|
23
|
-
declare const useGroup: (selectedKeys: Key[], onChange: (keys: Key[], selectedStatus?: SelectedStatus | undefined) => void, multiple?: boolean, validKeys?: Key[] | undefined, disabledKeys?: Key[] | undefined, subGroupMap?: SubGroupMap | undefined) => [GroupContext, SelectedStatus, () => void];
|
|
23
|
+
declare const useGroup: (selectedKeys: Key[], onChange: (keys: Key[], selectedStatus?: SelectedStatus | undefined) => void, multiple?: boolean, validKeys?: Key[] | undefined, disabledKeys?: Key[] | undefined, subGroupMap?: SubGroupMap | undefined) => [GroupContext, SelectedStatus, (v?: boolean | undefined) => void];
|
|
24
24
|
/**
|
|
25
25
|
* @param key key of this item
|
|
26
26
|
* @param groupContext context
|
package/lib/hooks/group.js
CHANGED
|
@@ -82,15 +82,11 @@ var getSubSelectedStatus = function getSubSelectedStatus(selectedKeys, validKeys
|
|
|
82
82
|
return getSelectedStatusByUnionCount(selectedKeys, validKeys);
|
|
83
83
|
}.bind(void 0);
|
|
84
84
|
|
|
85
|
-
var getSelectedKeysAfterSelectAll = function getSelectedKeysAfterSelectAll(allSelectedStatus, selectedKeys, validKeys, disabledKeys) {
|
|
85
|
+
var getSelectedKeysAfterSelectAll = function getSelectedKeysAfterSelectAll(allSelectedStatus, selectedKeys, validKeys, disabledKeys, selected) {
|
|
86
86
|
(0, _newArrowCheck2.default)(this, _this);
|
|
87
87
|
var disabledSelectedKeys = union(selectedKeys, disabledKeys);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return disabledSelectedKeys;
|
|
91
|
-
} else {
|
|
92
|
-
return validKeys.concat(disabledSelectedKeys);
|
|
93
|
-
}
|
|
88
|
+
if (selected || allSelectedStatus !== 'ALL') return validKeys.concat(disabledSelectedKeys);
|
|
89
|
+
return disabledSelectedKeys;
|
|
94
90
|
}.bind(void 0);
|
|
95
91
|
/**
|
|
96
92
|
* @param selectedKeys all selected keys
|
|
@@ -198,7 +194,7 @@ var useGroup = function useGroup(selectedKeys, onChange) {
|
|
|
198
194
|
multiple: multiple,
|
|
199
195
|
subGroupMap: subGroupMap
|
|
200
196
|
};
|
|
201
|
-
var toggleAllItems = (0, _react.useCallback)(function () {
|
|
197
|
+
var toggleAllItems = (0, _react.useCallback)(function (selected) {
|
|
202
198
|
(0, _newArrowCheck2.default)(this, _this3);
|
|
203
199
|
var cache = cacheRef.current;
|
|
204
200
|
var selectedKeys = cache.selectedKeys,
|
|
@@ -207,7 +203,7 @@ var useGroup = function useGroup(selectedKeys, onChange) {
|
|
|
207
203
|
selectedStatus = cache.selectedStatus,
|
|
208
204
|
multiple = cache.multiple;
|
|
209
205
|
if (!multiple || !validKeys || !disabledKeys) return;
|
|
210
|
-
var newSelectedKeys = getSelectedKeysAfterSelectAll(selectedStatus, selectedKeys, validKeys, disabledKeys);
|
|
206
|
+
var newSelectedKeys = getSelectedKeysAfterSelectAll(selectedStatus, selectedKeys, validKeys, disabledKeys, selected);
|
|
211
207
|
onChange(newSelectedKeys, selectedStatus === 'ALL' ? 'NONE' : 'ALL');
|
|
212
208
|
}.bind(this), [onChange]);
|
|
213
209
|
return [groupContext, selectedStatus, toggleAllItems];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/newArrowCheck"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _ConfigContext = _interopRequireDefault(require("../components/ConfigProvider/ConfigContext"));
|
|
17
|
+
|
|
18
|
+
var _this = void 0;
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
var useConfig = function useConfig() {
|
|
25
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
26
|
+
return (0, _react.useContext)(_ConfigContext.default);
|
|
27
|
+
}.bind(void 0);
|
|
28
|
+
|
|
29
|
+
var _default = useConfig;
|
|
30
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* 计算容器内的元素最大展示数量
|
|
4
|
+
* @returns {[number, number, boolean]} [当前测试的展示数, 最终确定的展示数, 是否在测试过程中]
|
|
5
|
+
*/
|
|
6
|
+
declare const useOverflow: ({ containerRef, defaultCount, maxCount, minCount }: {
|
|
7
|
+
/**
|
|
8
|
+
* 容器元素的 ref
|
|
9
|
+
*/
|
|
10
|
+
containerRef?: import("react").MutableRefObject<HTMLElement | null> | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 默认的初始展示数量
|
|
13
|
+
*/
|
|
14
|
+
defaultCount?: number | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* 最大展示数量,一般传入元素数量即可
|
|
17
|
+
*/
|
|
18
|
+
maxCount: number;
|
|
19
|
+
/**
|
|
20
|
+
* 最小展示数量
|
|
21
|
+
*/
|
|
22
|
+
minCount?: number | undefined;
|
|
23
|
+
}, deps?: any[]) => [number, number, boolean];
|
|
24
|
+
export default useOverflow;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/newArrowCheck"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
var DEFAULT_DEP = [];
|
|
25
|
+
/**
|
|
26
|
+
* 计算容器内的元素最大展示数量
|
|
27
|
+
* @returns {[number, number, boolean]} [当前测试的展示数, 最终确定的展示数, 是否在测试过程中]
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
var useOverflow = function useOverflow(_ref) {
|
|
31
|
+
var _this = this;
|
|
32
|
+
|
|
33
|
+
var containerRef = _ref.containerRef,
|
|
34
|
+
_ref$defaultCount = _ref.defaultCount,
|
|
35
|
+
defaultCount = _ref$defaultCount === void 0 ? 0 : _ref$defaultCount,
|
|
36
|
+
maxCount = _ref.maxCount,
|
|
37
|
+
_ref$minCount = _ref.minCount,
|
|
38
|
+
minCount = _ref$minCount === void 0 ? 0 : _ref$minCount;
|
|
39
|
+
var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DEP;
|
|
40
|
+
|
|
41
|
+
var _useState = (0, _react.useState)(function () {
|
|
42
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
43
|
+
return Math.min(defaultCount, maxCount);
|
|
44
|
+
}.bind(this)),
|
|
45
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
46
|
+
count = _useState2[0],
|
|
47
|
+
setCount = _useState2[1];
|
|
48
|
+
|
|
49
|
+
var _useState3 = (0, _react.useState)(count),
|
|
50
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
51
|
+
measureCount = _useState4[0],
|
|
52
|
+
setMeasureCount = _useState4[1];
|
|
53
|
+
|
|
54
|
+
var _useState5 = (0, _react.useState)(null),
|
|
55
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
56
|
+
latestValidCount = _useState6[0],
|
|
57
|
+
setLatestValidCount = _useState6[1];
|
|
58
|
+
|
|
59
|
+
var _useState7 = (0, _react.useState)(true),
|
|
60
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
61
|
+
measuring = _useState8[0],
|
|
62
|
+
setMeasuring = _useState8[1];
|
|
63
|
+
|
|
64
|
+
var startMeasuring = (0, _react.useCallback)(function () {
|
|
65
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
66
|
+
setMeasuring(true);
|
|
67
|
+
setLatestValidCount(null);
|
|
68
|
+
}.bind(this), []);
|
|
69
|
+
var endMeasuring = (0, _react.useCallback)(function (measureCount) {
|
|
70
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
71
|
+
setMeasuring(false);
|
|
72
|
+
setMeasureCount(measureCount);
|
|
73
|
+
}.bind(this), []);
|
|
74
|
+
(0, _react.useEffect)(function () {
|
|
75
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
76
|
+
startMeasuring(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77
|
+
}.bind(this), deps);
|
|
78
|
+
(0, _react.useEffect)(function () {
|
|
79
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
80
|
+
// reset when config changed
|
|
81
|
+
startMeasuring();
|
|
82
|
+
}.bind(this), [minCount, maxCount, startMeasuring]);
|
|
83
|
+
var measuringRef = (0, _react.useRef)(measuring);
|
|
84
|
+
(0, _react.useEffect)(function () {
|
|
85
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
86
|
+
measuringRef.current = measuring;
|
|
87
|
+
}.bind(this), [measuring]);
|
|
88
|
+
(0, _react.useLayoutEffect)(function () {
|
|
89
|
+
var _this2 = this;
|
|
90
|
+
|
|
91
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
92
|
+
var containerDOM = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
93
|
+
var resizeObserver = null;
|
|
94
|
+
|
|
95
|
+
if (containerDOM) {
|
|
96
|
+
resizeObserver = new _resizeObserverPolyfill.default(function () {
|
|
97
|
+
(0, _newArrowCheck2.default)(this, _this2);
|
|
98
|
+
|
|
99
|
+
if (!measuringRef.current) {
|
|
100
|
+
startMeasuring();
|
|
101
|
+
}
|
|
102
|
+
}.bind(this));
|
|
103
|
+
resizeObserver.observe(containerDOM);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return function () {
|
|
107
|
+
(0, _newArrowCheck2.default)(this, _this2);
|
|
108
|
+
|
|
109
|
+
if (resizeObserver) {
|
|
110
|
+
resizeObserver.disconnect();
|
|
111
|
+
}
|
|
112
|
+
}.bind(this);
|
|
113
|
+
}.bind(this), [containerRef, startMeasuring]);
|
|
114
|
+
(0, _react.useLayoutEffect)(function () {
|
|
115
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
116
|
+
var containerDOM = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
117
|
+
if (!containerDOM) return;
|
|
118
|
+
|
|
119
|
+
if (count === latestValidCount) {
|
|
120
|
+
endMeasuring(latestValidCount);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
var newCount = count;
|
|
125
|
+
|
|
126
|
+
if (containerDOM.offsetWidth >= containerDOM.scrollWidth) {
|
|
127
|
+
setLatestValidCount(count);
|
|
128
|
+
newCount = Math.min(count + 1, maxCount);
|
|
129
|
+
} else if (containerDOM.offsetWidth < containerDOM.scrollWidth) {
|
|
130
|
+
if (count === 0) setLatestValidCount(count);
|
|
131
|
+
newCount = Math.max(0, minCount, count - 1);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
setCount(newCount);
|
|
135
|
+
}.bind(this), [containerRef, count, endMeasuring, latestValidCount, maxCount, minCount]);
|
|
136
|
+
return [count, measureCount, measuring];
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
var _default = useOverflow;
|
|
140
|
+
exports.default = _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare const useUncontrolled: <V, P = V, VT = V | undefined, U = never>(value: VT, defaultValue: V, onChange?: ((v: P, ...rest: U[]) => void) | undefined, options?: {
|
|
2
|
-
|
|
2
|
+
getter?: ((e: P) => V) | undefined;
|
|
3
3
|
} | undefined) => [V, (v: P) => void, (v: P) => void];
|
|
4
4
|
export default useUncontrolled;
|
|
@@ -62,7 +62,7 @@ var useUncontrolled = function useUncontrolled(value, defaultValue, onChange, op
|
|
|
62
62
|
var finalValue = isControlled ? value : cacheVRef.current;
|
|
63
63
|
var updateValueWithoutCallOnChange = (0, _react.useCallback)(function (v) {
|
|
64
64
|
(0, _newArrowCheck2.default)(this, _this2);
|
|
65
|
-
var r = options !== null && options !== void 0 && options.
|
|
65
|
+
var r = options !== null && options !== void 0 && options.getter ? options === null || options === void 0 ? void 0 : options.getter(v) : v; // save value for controlled change to be uncontrolled
|
|
66
66
|
// don't use state for reduce necessary update
|
|
67
67
|
// still keep state for uncontrolled update
|
|
68
68
|
|
|
@@ -189,9 +189,7 @@ var Table = /*#__PURE__*/function (_React$Component) {
|
|
|
189
189
|
}, {
|
|
190
190
|
key: "componentWillUnmount",
|
|
191
191
|
value: function componentWillUnmount() {
|
|
192
|
-
|
|
193
|
-
this.resizeEvent.remove();
|
|
194
|
-
}
|
|
192
|
+
window.removeEventListener('resize', this.debouncedWindowResize);
|
|
195
193
|
|
|
196
194
|
if (this.debouncedWindowResize) {
|
|
197
195
|
this.debouncedWindowResize.cancel();
|
|
@@ -201,6 +199,7 @@ var Table = /*#__PURE__*/function (_React$Component) {
|
|
|
201
199
|
key: "componentDidMount",
|
|
202
200
|
value: function componentDidMount() {
|
|
203
201
|
this.setScrollPositionClassName();
|
|
202
|
+
window.addEventListener('resize', this.debouncedWindowResize);
|
|
204
203
|
}
|
|
205
204
|
}, {
|
|
206
205
|
key: "setScrollPosition",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import { Size } from '../style';
|
|
3
|
+
export interface InputWrapProps {
|
|
4
|
+
size: Size;
|
|
5
|
+
focused?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
cursor?: CSSProperties['cursor'];
|
|
8
|
+
block?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const InputPart: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
11
|
+
stretch?: boolean | undefined;
|
|
12
|
+
}, object>;
|
|
13
|
+
declare const InputWrap: import("react").ForwardRefExoticComponent<InputWrapProps & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
14
|
+
theme?: import("../style").Theme | undefined;
|
|
15
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
16
|
+
export default InputWrap;
|