@oceanbase/design 0.4.0 → 0.4.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/dist/design.min.css +1 -1
- package/dist/design.min.js +1 -1
- package/dist/reset.css +1 -0
- package/es/_util/genComponentStyleHook.d.ts +0 -1
- package/es/_util/genComponentStyleHook.js +1 -25
- package/es/button/style/index.js +17 -3
- package/es/card/index.js +11 -19
- package/es/card/style/index.js +5 -3
- package/es/checkbox/index.d.ts +2 -0
- package/es/checkbox/index.js +40 -1
- package/es/checkbox/style/index.d.ts +9 -0
- package/es/checkbox/style/index.js +22 -0
- package/es/config-provider/index.d.ts +2 -0
- package/es/config-provider/index.js +6 -4
- package/es/descriptions/hooks/useItems.d.ts +4 -4
- package/es/empty/default.js +34 -55
- package/es/empty/style/index.js +13 -11
- package/es/global.css +48 -0
- package/es/index.d.ts +9 -1
- package/es/index.js +5 -1
- package/es/progress/index.d.ts +1 -0
- package/es/progress/index.js +1 -0
- package/es/progress/progress.d.ts +1 -0
- package/es/progress/progress.js +1 -0
- package/es/radio/index.d.ts +7 -0
- package/es/radio/index.js +41 -1
- package/es/radio/style/index.d.ts +9 -0
- package/es/radio/style/index.js +23 -0
- package/es/result/style/index.js +10 -2
- package/es/slider/index.d.ts +5 -0
- package/es/slider/index.js +36 -1
- package/es/slider/style/index.d.ts +9 -0
- package/es/slider/style/index.js +21 -0
- package/es/switch/index.d.ts +4 -0
- package/es/switch/index.js +40 -1
- package/es/switch/style/index.d.ts +9 -0
- package/es/switch/style/index.js +17 -0
- package/es/table/index.js +18 -3
- package/es/table/style/index.js +55 -40
- package/es/theme/default.js +13 -12
- package/es/theme/style/aliyun.less +5 -1
- package/es/theme/style/compact.less +7 -3
- package/es/theme/style/dark.less +5 -1
- package/es/theme/style/default.less +15 -11
- package/es/tooltip/MouseTooltip.js +3 -2
- package/es/tooltip/index.js +3 -2
- package/es/tooltip/style/index.js +11 -2
- package/es/typography/Link.js +9 -3
- package/es/typography/Paragraph.js +9 -3
- package/es/typography/Text.js +9 -3
- package/es/typography/Title.js +9 -3
- package/es/typography/hooks/useClassName.d.ts +3 -0
- package/es/typography/hooks/useClassName.js +11 -0
- package/es/typography/style/index.js +45 -3
- package/lib/_util/genComponentStyleHook.d.ts +0 -1
- package/lib/_util/genComponentStyleHook.js +3 -38
- package/lib/button/style/index.js +21 -1
- package/lib/card/index.js +10 -21
- package/lib/card/style/index.js +7 -2
- package/lib/checkbox/index.d.ts +2 -0
- package/lib/checkbox/index.js +49 -1
- package/lib/checkbox/style/index.d.ts +9 -0
- package/lib/checkbox/style/index.js +49 -0
- package/lib/config-provider/index.d.ts +2 -0
- package/lib/config-provider/index.js +2 -1
- package/lib/descriptions/hooks/useItems.d.ts +4 -4
- package/lib/empty/default.js +8 -39
- package/lib/empty/style/index.js +42 -46
- package/lib/global.css +48 -0
- package/lib/index.d.ts +9 -1
- package/lib/index.js +13 -1
- package/lib/progress/index.d.ts +1 -0
- package/lib/progress/index.js +2 -0
- package/lib/progress/progress.d.ts +1 -0
- package/lib/progress/progress.js +23 -0
- package/lib/radio/index.d.ts +7 -0
- package/lib/radio/index.js +42 -1
- package/lib/radio/style/index.d.ts +9 -0
- package/lib/radio/style/index.js +49 -0
- package/lib/result/style/index.js +10 -1
- package/lib/slider/index.d.ts +5 -0
- package/lib/slider/index.js +38 -1
- package/lib/slider/style/index.d.ts +9 -0
- package/lib/slider/style/index.js +51 -0
- package/lib/switch/index.d.ts +4 -0
- package/lib/switch/index.js +40 -1
- package/lib/switch/style/index.d.ts +9 -0
- package/lib/switch/style/index.js +44 -0
- package/lib/table/index.js +19 -3
- package/lib/table/style/index.js +94 -55
- package/lib/theme/default.js +13 -12
- package/lib/theme/style/aliyun.less +5 -1
- package/lib/theme/style/compact.less +7 -3
- package/lib/theme/style/dark.less +5 -1
- package/lib/theme/style/default.less +15 -11
- package/lib/tooltip/MouseTooltip.js +3 -2
- package/lib/tooltip/index.js +3 -2
- package/lib/tooltip/style/index.js +10 -1
- package/lib/typography/Link.js +14 -2
- package/lib/typography/Paragraph.js +14 -2
- package/lib/typography/Text.js +14 -2
- package/lib/typography/Title.js +14 -2
- package/lib/typography/hooks/useClassName.d.ts +3 -0
- package/lib/typography/hooks/useClassName.js +46 -0
- package/lib/typography/style/index.js +49 -1
- package/package.json +13 -13
- package/es/reset.css +0 -10
- package/lib/reset.css +0 -10
- /package/es/{_util/fonts → fonts}/Consolas.woff2 +0 -0
- /package/es/{_util/fonts → fonts}/HelveticaNeue.woff2 +0 -0
- /package/es/{_util/fonts → fonts}/Inter.woff2 +0 -0
- /package/lib/{_util/fonts → fonts}/Consolas.woff2 +0 -0
- /package/lib/{_util/fonts → fonts}/HelveticaNeue.woff2 +0 -0
- /package/lib/{_util/fonts → fonts}/Inter.woff2 +0 -0
package/lib/slider/index.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
5
11
|
var __copyProps = (to, from, except, desc) => {
|
|
6
12
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
13
|
for (let key of __getOwnPropNames(from))
|
|
@@ -11,12 +17,43 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
11
17
|
return to;
|
|
12
18
|
};
|
|
13
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
14
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
29
|
|
|
16
|
-
// src/slider/index.
|
|
30
|
+
// src/slider/index.tsx
|
|
17
31
|
var slider_exports = {};
|
|
32
|
+
__export(slider_exports, {
|
|
33
|
+
default: () => slider_default
|
|
34
|
+
});
|
|
18
35
|
module.exports = __toCommonJS(slider_exports);
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_config_provider = __toESM(require("../config-provider"));
|
|
40
|
+
var import_style = __toESM(require("./style"));
|
|
19
41
|
__reExport(slider_exports, require("antd/es/slider"), module.exports);
|
|
42
|
+
var Slider = import_react.default.forwardRef(
|
|
43
|
+
({ prefixCls: customizePrefixCls, className, ...restProps }, ref) => {
|
|
44
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
45
|
+
const prefixCls = getPrefixCls("slider", customizePrefixCls);
|
|
46
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
47
|
+
const sliderCls = (0, import_classnames.default)(className);
|
|
48
|
+
return wrapSSR(
|
|
49
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Slider, { ref, prefixCls: customizePrefixCls, className: sliderCls, ...restProps })
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
if (process.env.NODE_ENV !== "production") {
|
|
54
|
+
Slider.displayName = import_antd.Slider.displayName;
|
|
55
|
+
}
|
|
56
|
+
var slider_default = Slider;
|
|
20
57
|
// Annotate the CommonJS export names for ESM import in node:
|
|
21
58
|
0 && (module.exports = {
|
|
22
59
|
...require("antd/es/slider")
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
|
|
3
|
+
export type SliderToken = FullToken<'Slider'>;
|
|
4
|
+
export declare const genSliderStyle: GenerateStyle<SliderToken>;
|
|
5
|
+
declare const _default: (prefixCls: string) => {
|
|
6
|
+
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
7
|
+
hashId: string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/slider/style/index.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
default: () => style_default,
|
|
23
|
+
genSliderStyle: () => genSliderStyle
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
|
+
var genSliderStyle = (token) => {
|
|
28
|
+
const { componentCls, dotSize = 8 } = token;
|
|
29
|
+
return {
|
|
30
|
+
[`${componentCls}${componentCls}-horizontal`]: {
|
|
31
|
+
[`${componentCls}-mark`]: {
|
|
32
|
+
[`${componentCls}-mark-text[style*="left: 0%;"]`]: {
|
|
33
|
+
transform: `translateX(calc(0% - ${dotSize / 2}px)) !important`
|
|
34
|
+
},
|
|
35
|
+
[`${componentCls}-mark-text[style*="left: 100%;"]`]: {
|
|
36
|
+
transform: `translateX(calc(-100% + ${dotSize / 2}px)) !important`
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
var style_default = (prefixCls) => {
|
|
43
|
+
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("Slider", (token) => {
|
|
44
|
+
return [genSliderStyle(token)];
|
|
45
|
+
});
|
|
46
|
+
return useStyle(prefixCls);
|
|
47
|
+
};
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
genSliderStyle
|
|
51
|
+
});
|
package/lib/switch/index.d.ts
CHANGED
package/lib/switch/index.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
5
11
|
var __copyProps = (to, from, except, desc) => {
|
|
6
12
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
13
|
for (let key of __getOwnPropNames(from))
|
|
@@ -11,12 +17,45 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
11
17
|
return to;
|
|
12
18
|
};
|
|
13
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
14
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
29
|
|
|
16
|
-
// src/switch/index.
|
|
30
|
+
// src/switch/index.tsx
|
|
17
31
|
var switch_exports = {};
|
|
32
|
+
__export(switch_exports, {
|
|
33
|
+
default: () => switch_default
|
|
34
|
+
});
|
|
18
35
|
module.exports = __toCommonJS(switch_exports);
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_config_provider = __toESM(require("../config-provider"));
|
|
40
|
+
var import_style = __toESM(require("./style"));
|
|
19
41
|
__reExport(switch_exports, require("antd/es/switch"), module.exports);
|
|
42
|
+
var InternalSwitch = import_react.default.forwardRef(
|
|
43
|
+
({ prefixCls: customizePrefixCls, className, ...restProps }, ref) => {
|
|
44
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
45
|
+
const prefixCls = getPrefixCls("switch", customizePrefixCls);
|
|
46
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
47
|
+
const switchCls = (0, import_classnames.default)(className);
|
|
48
|
+
return wrapSSR(
|
|
49
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Switch, { ref, prefixCls: customizePrefixCls, className: switchCls, ...restProps })
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
var Switch = InternalSwitch;
|
|
54
|
+
Switch.__ANT_SWITCH = import_antd.Switch.__ANT_SWITCH;
|
|
55
|
+
if (process.env.NODE_ENV !== "production") {
|
|
56
|
+
Switch.displayName = import_antd.Switch.displayName;
|
|
57
|
+
}
|
|
58
|
+
var switch_default = Switch;
|
|
20
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
21
60
|
0 && (module.exports = {
|
|
22
61
|
...require("antd/es/switch")
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
|
|
3
|
+
export type SwitchToken = FullToken<'Switch'>;
|
|
4
|
+
export declare const genSwitchStyle: GenerateStyle<SwitchToken>;
|
|
5
|
+
declare const _default: (prefixCls: string) => {
|
|
6
|
+
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
7
|
+
hashId: string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/switch/style/index.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
default: () => style_default,
|
|
23
|
+
genSwitchStyle: () => genSwitchStyle
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
|
+
var genSwitchStyle = (token) => {
|
|
28
|
+
const { componentCls } = token;
|
|
29
|
+
return {
|
|
30
|
+
[`${componentCls}:not(${componentCls}-checked):not(${componentCls}-disabled):not(${componentCls}-loading)`]: {
|
|
31
|
+
background: token.colorTextTertiary
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
var style_default = (prefixCls) => {
|
|
36
|
+
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("Switch", (token) => {
|
|
37
|
+
return [genSwitchStyle(token)];
|
|
38
|
+
});
|
|
39
|
+
return useStyle(prefixCls);
|
|
40
|
+
};
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
genSwitchStyle
|
|
44
|
+
});
|
package/lib/table/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_lodash = require("lodash");
|
|
|
39
39
|
var import_react = __toESM(require("react"));
|
|
40
40
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
41
41
|
var import_typography = __toESM(require("../typography"));
|
|
42
|
+
var import_empty = __toESM(require("../empty"));
|
|
42
43
|
var import_style = __toESM(require("./style"));
|
|
43
44
|
var import_useDefaultPagination = __toESM(require("./hooks/useDefaultPagination"));
|
|
44
45
|
var import_useMergedState = __toESM(require("rc-util/lib/hooks/useMergedState"));
|
|
@@ -49,6 +50,7 @@ function Table(props, ref) {
|
|
|
49
50
|
const {
|
|
50
51
|
locale: customLocale,
|
|
51
52
|
columns,
|
|
53
|
+
footer,
|
|
52
54
|
pagination: customPagination,
|
|
53
55
|
rowSelection,
|
|
54
56
|
toolAlertRender,
|
|
@@ -65,7 +67,11 @@ function Table(props, ref) {
|
|
|
65
67
|
const extendedContext = (0, import_react.useContext)(import_config_provider.default.ExtendedConfigContext);
|
|
66
68
|
const pagination = (0, import_useDefaultPagination.default)(customPagination);
|
|
67
69
|
const { getPrefixCls, locale, table } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
68
|
-
const {
|
|
70
|
+
const {
|
|
71
|
+
batchOperationBar,
|
|
72
|
+
emptyText = /* @__PURE__ */ import_react.default.createElement(import_empty.default, { image: import_empty.default.PRESENTED_IMAGE_SIMPLE }),
|
|
73
|
+
...restLocale
|
|
74
|
+
} = {
|
|
69
75
|
...customLocale,
|
|
70
76
|
batchOperationBar: {
|
|
71
77
|
...(_a = import_en_US.default.Table) == null ? void 0 : _a.batchOperationBar,
|
|
@@ -77,7 +83,9 @@ function Table(props, ref) {
|
|
|
77
83
|
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
78
84
|
const tableCls = (0, import_classnames.default)(
|
|
79
85
|
{
|
|
80
|
-
[`${prefixCls}-expandable`]: !(0, import_lodash.isEmpty)(expandable)
|
|
86
|
+
[`${prefixCls}-expandable`]: !(0, import_lodash.isEmpty)(expandable),
|
|
87
|
+
[`${prefixCls}-selectable`]: !!rowSelection,
|
|
88
|
+
[`${prefixCls}-has-footer`]: !!footer
|
|
81
89
|
},
|
|
82
90
|
className
|
|
83
91
|
);
|
|
@@ -170,8 +178,15 @@ function Table(props, ref) {
|
|
|
170
178
|
ref,
|
|
171
179
|
prefixCls: customizePrefixCls,
|
|
172
180
|
className: tableCls,
|
|
173
|
-
locale:
|
|
181
|
+
locale: {
|
|
182
|
+
...restLocale,
|
|
183
|
+
emptyText: /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-empty-wrapper` }, typeof emptyText === "function" ? emptyText() : emptyText)
|
|
184
|
+
},
|
|
174
185
|
columns: newColumns,
|
|
186
|
+
expandable: expandable ? {
|
|
187
|
+
columnWidth: 32,
|
|
188
|
+
...expandable
|
|
189
|
+
} : void 0,
|
|
175
190
|
rowSelection: rowSelection ? {
|
|
176
191
|
columnWidth: table == null ? void 0 : table.selectionColumnWidth,
|
|
177
192
|
...rowSelection,
|
|
@@ -181,6 +196,7 @@ function Table(props, ref) {
|
|
|
181
196
|
(_a2 = rowSelection == null ? void 0 : rowSelection.onChange) == null ? void 0 : _a2.call(rowSelection, selectedRowKeys, selectedRows, info);
|
|
182
197
|
}
|
|
183
198
|
} : void 0,
|
|
199
|
+
footer,
|
|
184
200
|
pagination: pagination === false ? false : {
|
|
185
201
|
...pagination,
|
|
186
202
|
hideOnSinglePage: toolAlertRender || toolOptionsRender || toolSelectedContent || (pagination == null ? void 0 : pagination.showSizeChanger) ? false : (pagination == null ? void 0 : pagination.hideOnSinglePage) !== void 0 ? pagination == null ? void 0 : pagination.hideOnSinglePage : extendedContext.hideOnSinglePage,
|
package/lib/table/style/index.js
CHANGED
|
@@ -36,12 +36,9 @@ var genTableStyle = (token) => {
|
|
|
36
36
|
colorLink,
|
|
37
37
|
borderRadiusLG,
|
|
38
38
|
colorBorderSecondary,
|
|
39
|
-
paddingSM,
|
|
40
39
|
padding,
|
|
41
|
-
paddingLG,
|
|
42
40
|
marginLG,
|
|
43
|
-
marginXS
|
|
44
|
-
marginSM
|
|
41
|
+
marginXS
|
|
45
42
|
} = token;
|
|
46
43
|
return {
|
|
47
44
|
// 表格通用样式
|
|
@@ -49,19 +46,32 @@ var genTableStyle = (token) => {
|
|
|
49
46
|
color: colorText,
|
|
50
47
|
backgroundColor: colorBgBase,
|
|
51
48
|
borderRadius: borderRadiusLG,
|
|
49
|
+
[`${componentCls}-footer`]: {
|
|
50
|
+
borderBottom: `1px solid ${colorBorderSecondary}`
|
|
51
|
+
},
|
|
52
|
+
// 单元格通用样式
|
|
53
|
+
[`${componentCls}-thead, ${componentCls}-tbody`]: {
|
|
54
|
+
["td, th"]: {
|
|
55
|
+
[`&${componentCls}-row-expand-icon-cell`]: {
|
|
56
|
+
backgroundColor: colorBgBase,
|
|
57
|
+
padding: `${token.paddingSM}px ${token.paddingXS}px`
|
|
58
|
+
},
|
|
59
|
+
// 内容第一列,左侧间距减小为 8px
|
|
60
|
+
[`&:not(:first-child):not(${componentCls}-selection-column):not(${componentCls}-row-expand-icon-cell)`]: {
|
|
61
|
+
paddingLeft: token.paddingXS
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
52
65
|
// head 样式
|
|
53
66
|
[`${componentCls}-thead > tr`]: {
|
|
54
|
-
["
|
|
67
|
+
["th"]: {
|
|
55
68
|
// 弱化列标题
|
|
56
69
|
color: colorTextSecondary,
|
|
57
70
|
fontWeight: "normal",
|
|
58
71
|
backgroundColor: colorBgBase
|
|
59
72
|
},
|
|
60
|
-
[`td${componentCls}-row-expand-icon-cell`]: {
|
|
61
|
-
backgroundColor: colorBgBase
|
|
62
|
-
},
|
|
63
73
|
// 去掉排序列表头的灰色背景
|
|
64
|
-
[`th${componentCls}-column-
|
|
74
|
+
[`th${componentCls}-column-has-sorters`]: {
|
|
65
75
|
backgroundColor: colorBgBase
|
|
66
76
|
},
|
|
67
77
|
[`${componentCls}-cell-scrollbar`]: {
|
|
@@ -85,39 +95,56 @@ var genTableStyle = (token) => {
|
|
|
85
95
|
[`tr${componentCls}-row-selected > td`]: {
|
|
86
96
|
backgroundColor: `${colorPrimaryBg} !important`
|
|
87
97
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
backgroundColor: colorFillQuaternary,
|
|
97
|
-
borderRadius: borderRadiusLG
|
|
98
|
+
[`${componentCls}-tbody-virtual-scrollbar ${componentCls}-tbody-virtual-scrollbar-thumb`]: {
|
|
99
|
+
background: `${token.colorFillSecondary} !important`
|
|
100
|
+
},
|
|
101
|
+
// 去掉可展开行在展开时的底部 border
|
|
102
|
+
[`tr > td:has(${componentCls}-row-expand-icon-expanded)`]: {
|
|
103
|
+
borderBottom: "none",
|
|
104
|
+
[`& ~ td`]: {
|
|
105
|
+
borderBottom: "none"
|
|
98
106
|
}
|
|
99
107
|
},
|
|
108
|
+
// 为了避免行展开/收起时出现 border 动画,覆盖 antd 默认配置,仅设置背景色动画
|
|
109
|
+
[`tr > td`]: {
|
|
110
|
+
transition: `background ${token.motionDurationMid}`
|
|
111
|
+
},
|
|
112
|
+
// empty style
|
|
113
|
+
[`${componentCls}-placeholder td`]: {
|
|
114
|
+
borderBottom: "none"
|
|
115
|
+
},
|
|
116
|
+
[`${componentCls}-empty-wrapper`]: {
|
|
117
|
+
minHeight: 360,
|
|
118
|
+
display: "flex",
|
|
119
|
+
justifyContent: "center",
|
|
120
|
+
alignItems: "center"
|
|
121
|
+
},
|
|
100
122
|
// 嵌套子表格样式
|
|
101
123
|
[`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
marginInline: "0 !important",
|
|
105
|
-
// 设置嵌套子表格的单元格背景色
|
|
124
|
+
borderBottom: "none",
|
|
125
|
+
// 设置嵌套子表格的表头背景色
|
|
106
126
|
[`${componentCls}-thead > tr > th`]: {
|
|
107
|
-
backgroundColor:
|
|
127
|
+
backgroundColor: token.colorFillQuaternary
|
|
108
128
|
},
|
|
109
|
-
|
|
110
|
-
|
|
129
|
+
// 去掉表头左右单元格的圆角
|
|
130
|
+
[`${componentCls}-thead > tr:first-child > th:first-child`]: {
|
|
131
|
+
borderRadius: 0
|
|
111
132
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
133
|
+
[`${componentCls}-thead > tr:first-child > th:last-child`]: {
|
|
134
|
+
borderRadius: 0
|
|
135
|
+
},
|
|
136
|
+
// empty wrapper style
|
|
137
|
+
[`${componentCls}-empty-wrapper`]: {
|
|
138
|
+
minHeight: "auto"
|
|
117
139
|
}
|
|
118
140
|
}
|
|
119
141
|
}
|
|
120
142
|
},
|
|
143
|
+
// 非可展开表格、带 footer 表格、空表格、带边框表格: 底部添加分隔线
|
|
144
|
+
[`${componentCls}-wrapper:not(${componentCls}-expandable):not(${componentCls}-has-footer) ${componentCls}:not(${componentCls}-bordered):not(${componentCls}-empty)`]: {
|
|
145
|
+
borderBottom: `1px solid ${colorBorderSecondary}`,
|
|
146
|
+
borderRadius: 0
|
|
147
|
+
},
|
|
121
148
|
// 滚动表格样式
|
|
122
149
|
// 由于滚动表格会在 tbody 下最前面多一个 tr 元素,因此需要设置相反的斑马条样式
|
|
123
150
|
// .ant-table-scroll-horizontal: 水平滚动
|
|
@@ -133,16 +160,6 @@ var genTableStyle = (token) => {
|
|
|
133
160
|
}
|
|
134
161
|
}
|
|
135
162
|
},
|
|
136
|
-
// 去掉非展开表格的边框
|
|
137
|
-
[`${componentCls}-wrapper:not(${componentCls}-expandable)`]: {
|
|
138
|
-
[`${componentCls}:not(${componentCls}-bordered)`]: {
|
|
139
|
-
[`${componentCls}-tbody`]: {
|
|
140
|
-
[`tr:not(${componentCls}-measure-row) > td`]: {
|
|
141
|
-
border: "none"
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
163
|
// 可展开表格样式
|
|
147
164
|
[`${componentCls}-wrapper${componentCls}-expandable`]: {
|
|
148
165
|
[`${componentCls}`]: {
|
|
@@ -157,13 +174,44 @@ var genTableStyle = (token) => {
|
|
|
157
174
|
backgroundColor: colorPrimaryBg
|
|
158
175
|
}
|
|
159
176
|
}
|
|
177
|
+
},
|
|
178
|
+
// 嵌套子表格和父表格第一列对齐
|
|
179
|
+
[`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
|
|
180
|
+
marginLeft: token.marginXS + token.lineWidth * 2
|
|
160
181
|
}
|
|
161
182
|
}
|
|
162
183
|
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
184
|
+
[`${componentCls}-middle, ${componentCls}-small`]: {
|
|
185
|
+
[`${componentCls}-tbody`]: {
|
|
186
|
+
// 嵌套子表格和父表格第一列对齐
|
|
187
|
+
[`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
|
|
188
|
+
marginLeft: token.marginXS + token.lineWidth * 2 + token.margin
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
// 可展开表格 + 可选择表格样式
|
|
194
|
+
[`${componentCls}-wrapper${componentCls}-expandable${componentCls}-selectable`]: {
|
|
195
|
+
[`${componentCls}`]: {
|
|
196
|
+
[`${componentCls}-tbody`]: {
|
|
197
|
+
[`${componentCls}-expanded-row > td`]: {
|
|
198
|
+
// 除内嵌子表格外,设置其他内嵌元素样式
|
|
199
|
+
[`& > *:not(${componentCls}-wrapper)`]: {
|
|
200
|
+
marginLeft: token.marginLG + token.marginXL + token.lineWidth * 2
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
// 嵌套子表格和父表格第一列对齐
|
|
204
|
+
[`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
|
|
205
|
+
marginLeft: token.marginXS + token.marginXL + token.lineWidth * 2
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
[`${componentCls}-middle, ${componentCls}-small`]: {
|
|
210
|
+
[`${componentCls}-tbody`]: {
|
|
211
|
+
// 嵌套子表格和父表格第一列对齐
|
|
212
|
+
[`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
|
|
213
|
+
marginLeft: token.marginXS + token.marginXL + token.lineWidth * 2 + token.margin
|
|
214
|
+
}
|
|
167
215
|
}
|
|
168
216
|
}
|
|
169
217
|
},
|
|
@@ -181,8 +229,7 @@ var genTableStyle = (token) => {
|
|
|
181
229
|
[`${componentCls}-pagination`]: {
|
|
182
230
|
[`&${antCls}-pagination`]: {
|
|
183
231
|
padding: `${padding}px 0`,
|
|
184
|
-
margin: "0 !important"
|
|
185
|
-
borderTop: `1px solid ${colorBorderSecondary}`
|
|
232
|
+
margin: "0 !important"
|
|
186
233
|
},
|
|
187
234
|
// 批量操作栏样式
|
|
188
235
|
[`${componentCls}-batch-operation-bar`]: {
|
|
@@ -199,14 +246,6 @@ var genTableStyle = (token) => {
|
|
|
199
246
|
}
|
|
200
247
|
}
|
|
201
248
|
}
|
|
202
|
-
},
|
|
203
|
-
// Remove pagination borderTop for bordered Table
|
|
204
|
-
[`${componentCls}${componentCls}-bordered`]: {
|
|
205
|
-
[`&+${componentCls}-pagination`]: {
|
|
206
|
-
[`&${antCls}-pagination`]: {
|
|
207
|
-
borderTop: "none"
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
249
|
}
|
|
211
250
|
},
|
|
212
251
|
// 批量操作栏中的弹出层样式
|
package/lib/theme/default.js
CHANGED
|
@@ -30,16 +30,6 @@ var defaultTheme = {
|
|
|
30
30
|
token: {
|
|
31
31
|
fontFamily: `-apple-system, 'Noto Sans', BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`,
|
|
32
32
|
fontFamilyCode: `Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace`,
|
|
33
|
-
fontSizeHeading1: 32,
|
|
34
|
-
fontSizeHeading2: 24,
|
|
35
|
-
fontSizeHeading3: 20,
|
|
36
|
-
fontSizeHeading4: 16,
|
|
37
|
-
fontSizeHeading5: 14,
|
|
38
|
-
lineHeightHeading1: 40 / 32,
|
|
39
|
-
lineHeightHeading2: 32 / 24,
|
|
40
|
-
lineHeightHeading3: 28 / 20,
|
|
41
|
-
lineHeightHeading4: 24 / 16,
|
|
42
|
-
lineHeightHeading5: 22 / 14,
|
|
43
33
|
colorPrimaryBg: "#EAF1FF",
|
|
44
34
|
colorPrimary: "#006AFF",
|
|
45
35
|
colorPrimaryBgHover: "#EAF1FF",
|
|
@@ -110,14 +100,17 @@ var defaultTheme = {
|
|
|
110
100
|
boxShadowSecondary: "0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05)",
|
|
111
101
|
boxShadow: "0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02)",
|
|
112
102
|
borderRadius: 6,
|
|
113
|
-
wireframe: false
|
|
103
|
+
wireframe: false,
|
|
104
|
+
// Remove focus outline
|
|
105
|
+
lineWidthFocus: 0
|
|
114
106
|
},
|
|
115
107
|
components: {
|
|
116
108
|
Breadcrumb: {
|
|
117
109
|
fontSize: 12,
|
|
118
110
|
// @ts-ignore
|
|
119
111
|
// fontHeight is internal token
|
|
120
|
-
fontHeight: 20
|
|
112
|
+
fontHeight: 20,
|
|
113
|
+
lastItemColor: "#5c6b8a"
|
|
121
114
|
},
|
|
122
115
|
InputNumber: {
|
|
123
116
|
handleVisible: true
|
|
@@ -132,6 +125,14 @@ var defaultTheme = {
|
|
|
132
125
|
multipleItemBorderColor: tagColorBorder,
|
|
133
126
|
multipleItemBorderColorDisabled: tagColorBorder
|
|
134
127
|
},
|
|
128
|
+
Slider: {
|
|
129
|
+
trackBg: "#006AFF",
|
|
130
|
+
trackHoverBg: "#5189fb",
|
|
131
|
+
trackBgDisabled: "#b3ccff",
|
|
132
|
+
handleColor: "#006AFF",
|
|
133
|
+
handleActiveColor: "#5189fb",
|
|
134
|
+
handleColorDisabled: "#b3ccff"
|
|
135
|
+
},
|
|
135
136
|
Tag: {
|
|
136
137
|
defaultColor: "#5c6b8a",
|
|
137
138
|
colorBorder: tagColorBorder
|
|
@@ -312,6 +312,9 @@
|
|
|
312
312
|
@colorFillSecondary: rgba(0, 0, 0, 0.06);
|
|
313
313
|
@colorFillTertiary: rgba(0, 0, 0, 0.04);
|
|
314
314
|
@colorFillQuaternary: rgba(0, 0, 0, 0.02);
|
|
315
|
+
@colorBgSolid: rgb(0, 0, 0);
|
|
316
|
+
@colorBgSolidHover: rgba(0, 0, 0, 0.75);
|
|
317
|
+
@colorBgSolidActive: rgba(0, 0, 0, 0.95);
|
|
315
318
|
@colorBgLayout: #f2f3f5;
|
|
316
319
|
@colorBgContainer: #ffffff;
|
|
317
320
|
@colorBgElevated: #ffffff;
|
|
@@ -339,6 +342,7 @@
|
|
|
339
342
|
@colorSuccessTextActive: #009c6d;
|
|
340
343
|
@colorErrorBg: #fff2f0;
|
|
341
344
|
@colorErrorBgHover: #ffe2de;
|
|
345
|
+
@colorErrorBgFilledHover: #ffd7d3;
|
|
342
346
|
@colorErrorBgActive: #ffbcb5;
|
|
343
347
|
@colorErrorBorder: #ffbcb5;
|
|
344
348
|
@colorErrorBorderHover: #ff948c;
|
|
@@ -430,7 +434,7 @@
|
|
|
430
434
|
@colorErrorOutline: rgba(255, 38, 5, 0.06);
|
|
431
435
|
@colorWarningOutline: rgba(255, 195, 5, 0.1);
|
|
432
436
|
@fontSizeIcon: 12;
|
|
433
|
-
@lineWidthFocus:
|
|
437
|
+
@lineWidthFocus: 3;
|
|
434
438
|
@controlInteractiveSize: 16;
|
|
435
439
|
@controlItemBgHover: rgba(0, 0, 0, 0.04);
|
|
436
440
|
@controlItemBgActive: #e6f4ff;
|
|
@@ -312,6 +312,9 @@
|
|
|
312
312
|
@colorFillSecondary: #e2e8f3;
|
|
313
313
|
@colorFillTertiary: #f3f6fc;
|
|
314
314
|
@colorFillQuaternary: #f8fafe;
|
|
315
|
+
@colorBgSolid: rgb(0, 0, 0);
|
|
316
|
+
@colorBgSolidHover: rgba(0, 0, 0, 0.75);
|
|
317
|
+
@colorBgSolidActive: rgba(0, 0, 0, 0.95);
|
|
315
318
|
@colorBgLayout: #f3f6fc;
|
|
316
319
|
@colorBgContainer: #ffffff;
|
|
317
320
|
@colorBgElevated: #ffffff;
|
|
@@ -339,6 +342,7 @@
|
|
|
339
342
|
@colorSuccessTextActive: #00b378;
|
|
340
343
|
@colorErrorBg: #ffebeb;
|
|
341
344
|
@colorErrorBgHover: #ffd6d6;
|
|
345
|
+
@colorErrorBgFilledHover: #ffd7d3;
|
|
342
346
|
@colorErrorBgActive: #ffbcb5;
|
|
343
347
|
@colorErrorBorder: #ffb3b3;
|
|
344
348
|
@colorErrorBorderHover: #ff7575;
|
|
@@ -373,7 +377,7 @@
|
|
|
373
377
|
@fontSizeLG: 14;
|
|
374
378
|
@fontSizeXL: 16;
|
|
375
379
|
@fontSizeHeading1: 32;
|
|
376
|
-
@fontSizeHeading2:
|
|
380
|
+
@fontSizeHeading2: 26;
|
|
377
381
|
@fontSizeHeading3: 20;
|
|
378
382
|
@fontSizeHeading4: 16;
|
|
379
383
|
@fontSizeHeading5: 14;
|
|
@@ -384,7 +388,7 @@
|
|
|
384
388
|
@fontHeightLG: 22;
|
|
385
389
|
@fontHeightSM: 18;
|
|
386
390
|
@lineHeightHeading1: 1.25;
|
|
387
|
-
@lineHeightHeading2: 1.
|
|
391
|
+
@lineHeightHeading2: 1.3076923076923077;
|
|
388
392
|
@lineHeightHeading3: 1.4;
|
|
389
393
|
@lineHeightHeading4: 1.5;
|
|
390
394
|
@lineHeightHeading5: 1.5714285714285714;
|
|
@@ -410,6 +414,7 @@
|
|
|
410
414
|
@borderRadiusOuter: 4;
|
|
411
415
|
@boxShadowSecondary: 0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05);
|
|
412
416
|
@boxShadow: 0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02);
|
|
417
|
+
@lineWidthFocus: 3;
|
|
413
418
|
@colorFillContent: #e2e8f3;
|
|
414
419
|
@colorFillContentHover: #cdd5e4;
|
|
415
420
|
@colorFillAlter: #f8fafe;
|
|
@@ -430,7 +435,6 @@
|
|
|
430
435
|
@colorErrorOutline: rgba(255, 5, 5, 0.08);
|
|
431
436
|
@colorWarningOutline: rgba(255, 164, 19, 0.11);
|
|
432
437
|
@fontSizeIcon: 10;
|
|
433
|
-
@lineWidthFocus: 4;
|
|
434
438
|
@controlOutlineWidth: 2;
|
|
435
439
|
@controlInteractiveSize: 14;
|
|
436
440
|
@controlItemBgHover: #f3f6fc;
|