@oceanbase/design 1.0.0-alpha.0 → 1.0.0-alpha.10
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 +2 -1
- package/dist/static/Inter-Medium.ea234620.woff2 +0 -0
- package/dist/static/Inter-Regular.34ba43c9.woff2 +0 -0
- package/dist/static/Inter-SemiBold.95439fb4.woff2 +0 -0
- package/es/_util/genComponentStyleHook.d.ts +21 -4
- package/es/_util/genComponentStyleHook.js +68 -20
- package/es/alert/index.d.ts +2 -2
- package/es/alert/index.js +22 -6
- package/es/alert/style/index.d.ts +2 -5
- package/es/alert/style/index.js +157 -67
- package/es/app/index.d.ts +8 -0
- package/es/app/index.js +43 -1
- package/es/app/style/index.d.ts +6 -0
- package/es/app/style/index.js +9 -0
- package/es/badge/index.js +15 -7
- package/es/badge/style/index.d.ts +2 -5
- package/es/badge/style/index.js +13 -18
- package/es/button/index.js +10 -4
- package/es/button/style/index.d.ts +4 -5
- package/es/button/style/index.js +40 -7
- package/es/card/index.d.ts +11 -0
- package/es/card/index.js +151 -9
- package/es/card/style/index.d.ts +2 -5
- package/es/card/style/index.js +83 -18
- package/es/checkbox/index.js +9 -2
- package/es/checkbox/style/index.d.ts +2 -5
- package/es/checkbox/style/index.js +14 -11
- package/es/config-provider/context.d.ts +11 -0
- package/es/config-provider/context.js +2 -1
- package/es/config-provider/index.d.ts +4 -3
- package/es/config-provider/index.js +92 -40
- package/es/descriptions/index.d.ts +10 -0
- package/es/descriptions/index.js +62 -5
- package/es/descriptions/style/index.d.ts +3 -6
- package/es/descriptions/style/index.js +70 -10
- package/es/drawer/index.js +10 -7
- package/es/drawer/style/index.d.ts +2 -5
- package/es/drawer/style/index.js +44 -17
- package/es/dropdown/dropdown-button.js +26 -6
- package/es/dropdown/style/index.d.ts +6 -0
- package/es/{_util/genStyle.js → dropdown/style/index.js} +14 -11
- package/es/empty/index.js +4 -3
- package/es/empty/style/index.d.ts +2 -5
- package/es/empty/style/index.js +10 -10
- package/es/fonts/Inter-Medium.woff2 +0 -0
- package/es/fonts/Inter-Regular.woff2 +0 -0
- package/es/fonts/Inter-SemiBold.woff2 +0 -0
- package/es/form/FormItem.d.ts +2 -1
- package/es/form/FormItem.js +26 -11
- package/es/form/index.js +9 -2
- package/es/form/style/index.d.ts +2 -5
- package/es/form/style/index.js +19 -8
- package/es/index.d.ts +4 -3
- package/es/index.js +1 -1
- package/es/input/Input.d.ts +2 -0
- package/es/input/Input.js +30 -7
- package/es/input/Password.js +24 -5
- package/es/input/Search.js +24 -5
- package/es/input/TextArea.js +24 -5
- package/es/input/style/index.d.ts +6 -0
- package/es/input/style/index.js +32 -0
- package/es/input-number/index.d.ts +2 -1
- package/es/input-number/index.js +18 -4
- package/es/input-number/style/index.d.ts +6 -0
- package/es/input-number/style/index.js +19 -0
- package/es/locale/en-US.js +4 -1
- package/es/locale/index.d.ts +2 -0
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +31 -0
- package/es/locale/zh-CN.js +4 -1
- package/es/locale/zh-TW.js +4 -1
- package/es/modal/Modal.js +29 -8
- package/es/modal/style/index.d.ts +2 -5
- package/es/modal/style/index.js +67 -26
- package/es/radio/index.js +9 -2
- package/es/radio/style/index.d.ts +2 -5
- package/es/radio/style/index.js +16 -10
- package/es/result/index.d.ts +2 -2
- package/es/result/index.js +14 -6
- package/es/result/style/index.d.ts +2 -5
- package/es/result/style/index.js +3 -6
- package/es/segmented/index.d.ts +1 -0
- package/es/segmented/index.js +24 -9
- package/es/segmented/style/index.d.ts +1 -4
- package/es/segmented/style/index.js +4 -6
- package/es/select/index.js +9 -2
- package/es/select/style/index.d.ts +2 -5
- package/es/select/style/index.js +6 -7
- package/es/slider/index.js +9 -2
- package/es/slider/style/index.d.ts +2 -5
- package/es/slider/style/index.js +11 -11
- package/es/space/index.js +9 -2
- package/es/space/style/index.d.ts +2 -5
- package/es/space/style/index.js +3 -6
- package/es/spin/index.js +9 -2
- package/es/spin/style/index.d.ts +2 -5
- package/es/spin/style/index.js +27 -27
- package/es/static-function/index.js +13 -4
- package/es/style/cssVariables.d.ts +25 -0
- package/es/style/cssVariables.js +48 -0
- package/es/style/cssVariablesMeta.d.ts +24 -0
- package/es/style/cssVariablesMeta.js +974 -0
- package/es/style/global.d.ts +8 -0
- package/es/style/global.js +121 -0
- package/es/style/reset.css +2 -1
- package/es/switch/index.js +9 -2
- package/es/switch/style/index.d.ts +2 -5
- package/es/switch/style/index.js +3 -6
- package/es/table/index.d.ts +1 -4
- package/es/table/index.js +67 -34
- package/es/table/style/index.d.ts +2 -5
- package/es/table/style/index.js +58 -36
- package/es/tabs/index.js +9 -2
- package/es/tabs/style/index.d.ts +2 -5
- package/es/tabs/style/index.js +10 -10
- package/es/tag/index.d.ts +1 -0
- package/es/tag/index.js +17 -4
- package/es/tag/style/index.d.ts +3 -8
- package/es/tag/style/index.js +39 -35
- package/es/theme/compact.d.ts +1 -1
- package/es/theme/compact.js +2 -6
- package/es/theme/dark.d.ts +1 -48
- package/es/theme/default.d.ts +48 -2
- package/es/theme/default.js +333 -78
- package/es/theme/index.d.ts +20 -57
- package/es/theme/interface.d.ts +130 -0
- package/es/theme/interface.js +4 -1
- package/es/theme/style/aliyun.less +86 -86
- package/es/theme/style/compact.less +199 -170
- package/es/theme/style/dark.less +103 -103
- package/es/theme/style/default.less +202 -173
- package/es/tooltip/index.js +4 -4
- package/es/tooltip/style/index.d.ts +2 -5
- package/es/tooltip/style/index.js +10 -13
- package/es/tree-select/index.js +9 -2
- package/es/tree-select/style/index.d.ts +2 -5
- package/es/tree-select/style/index.js +3 -6
- package/es/typography/Link.js +9 -2
- package/es/typography/Paragraph.js +9 -2
- package/es/typography/Text.d.ts +1 -0
- package/es/typography/Text.js +12 -4
- package/es/typography/Title.js +9 -2
- package/es/typography/hooks/useClassName.d.ts +1 -1
- package/es/typography/hooks/useClassName.js +2 -2
- package/es/typography/index.d.ts +12 -1
- package/es/typography/index.js +2 -1
- package/es/typography/style/index.d.ts +2 -5
- package/es/typography/style/index.js +36 -28
- package/lib/_util/genComponentStyleHook.d.ts +21 -4
- package/lib/_util/genComponentStyleHook.js +50 -31
- package/lib/alert/index.d.ts +2 -2
- package/lib/alert/index.js +20 -11
- package/lib/alert/style/index.d.ts +2 -5
- package/lib/alert/style/index.js +174 -79
- package/lib/app/index.d.ts +8 -0
- package/lib/app/index.js +36 -1
- package/lib/app/style/index.d.ts +6 -0
- package/lib/{_util/getWeakenBorderColor.js → app/style/index.js} +15 -10
- package/lib/badge/index.js +32 -23
- package/lib/badge/style/index.d.ts +2 -5
- package/lib/badge/style/index.js +14 -16
- package/lib/button/index.js +5 -4
- package/lib/button/style/index.d.ts +4 -5
- package/lib/button/style/index.js +48 -9
- package/lib/card/index.d.ts +11 -0
- package/lib/card/index.js +160 -12
- package/lib/card/style/index.d.ts +2 -5
- package/lib/card/style/index.js +132 -21
- package/lib/checkbox/index.js +4 -3
- package/lib/checkbox/style/index.d.ts +2 -5
- package/lib/checkbox/style/index.js +10 -8
- package/lib/config-provider/DefaultRenderEmpty.js +4 -3
- package/lib/config-provider/context.d.ts +11 -0
- package/lib/config-provider/index.d.ts +4 -3
- package/lib/config-provider/index.js +133 -30
- package/lib/descriptions/hooks/useItems.js +5 -4
- package/lib/descriptions/index.d.ts +10 -0
- package/lib/descriptions/index.js +54 -6
- package/lib/descriptions/style/index.d.ts +3 -6
- package/lib/descriptions/style/index.js +117 -7
- package/lib/drawer/index.js +46 -35
- package/lib/drawer/style/index.d.ts +2 -5
- package/lib/drawer/style/index.js +44 -14
- package/lib/dropdown/dropdown-button.js +26 -3
- package/lib/dropdown/index.js +2 -2
- package/lib/dropdown/style/index.d.ts +6 -0
- package/lib/dropdown/style/index.js +46 -0
- package/lib/empty/colored.js +413 -327
- package/lib/empty/database.js +267 -222
- package/lib/empty/default.js +16 -21
- package/lib/empty/guide.js +201 -184
- package/lib/empty/index.js +25 -20
- package/lib/empty/style/index.d.ts +2 -5
- package/lib/empty/style/index.js +9 -10
- package/lib/fonts/Inter-Medium.woff2 +0 -0
- package/lib/fonts/Inter-Regular.woff2 +0 -0
- package/lib/fonts/Inter-SemiBold.woff2 +0 -0
- package/lib/form/FormItem.d.ts +2 -1
- package/lib/form/FormItem.js +19 -8
- package/lib/form/index.js +8 -5
- package/lib/form/style/index.d.ts +2 -5
- package/lib/form/style/index.js +28 -7
- package/lib/grid/col.js +2 -1
- package/lib/grid/row.js +2 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.js +3 -1
- package/lib/input/Input.d.ts +2 -0
- package/lib/input/Input.js +37 -13
- package/lib/input/Password.js +22 -4
- package/lib/input/Search.js +32 -12
- package/lib/input/TextArea.js +22 -4
- package/lib/input/style/index.d.ts +6 -0
- package/lib/input/style/index.js +74 -0
- package/lib/input-number/index.d.ts +2 -1
- package/lib/input-number/index.js +19 -3
- package/lib/input-number/style/index.d.ts +6 -0
- package/lib/{_util/genStyle.js → input-number/style/index.js} +22 -17
- package/lib/list/index.js +3 -2
- package/lib/locale/en-US.js +3 -0
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +63 -0
- package/lib/locale/zh-CN.js +3 -0
- package/lib/locale/zh-TW.js +3 -0
- package/lib/lottie/index.js +2 -1
- package/lib/modal/Modal.js +35 -11
- package/lib/modal/Progress.js +9 -5
- package/lib/modal/style/index.d.ts +2 -5
- package/lib/modal/style/index.js +81 -24
- package/lib/radio/index.js +4 -3
- package/lib/radio/style/index.d.ts +2 -5
- package/lib/radio/style/index.js +17 -8
- package/lib/result/403.js +156 -121
- package/lib/result/404.js +328 -267
- package/lib/result/500.js +295 -257
- package/lib/result/Error.js +127 -99
- package/lib/result/Processing.js +246 -213
- package/lib/result/Success.js +233 -169
- package/lib/result/Warning.js +611 -515
- package/lib/result/index.d.ts +2 -2
- package/lib/result/index.js +14 -13
- package/lib/result/style/index.d.ts +2 -5
- package/lib/result/style/index.js +3 -6
- package/lib/segmented/index.d.ts +1 -0
- package/lib/segmented/index.js +17 -6
- package/lib/segmented/style/index.d.ts +1 -4
- package/lib/segmented/style/index.js +4 -6
- package/lib/select/index.js +4 -3
- package/lib/select/style/index.d.ts +2 -5
- package/lib/select/style/index.js +7 -7
- package/lib/slider/index.js +4 -3
- package/lib/slider/style/index.d.ts +2 -5
- package/lib/slider/style/index.js +12 -11
- package/lib/space/index.js +3 -2
- package/lib/space/style/index.d.ts +2 -5
- package/lib/space/style/index.js +3 -6
- package/lib/spin/index.js +7 -6
- package/lib/spin/style/index.d.ts +2 -5
- package/lib/spin/style/index.js +26 -28
- package/lib/static-function/index.js +7 -1
- package/lib/style/cssVariables.d.ts +25 -0
- package/lib/style/cssVariables.js +261 -0
- package/lib/style/cssVariablesMeta.d.ts +24 -0
- package/lib/style/cssVariablesMeta.js +1059 -0
- package/lib/style/global.d.ts +8 -0
- package/lib/style/global.js +176 -0
- package/lib/style/reset.css +2 -1
- package/lib/switch/index.js +4 -3
- package/lib/switch/style/index.d.ts +2 -5
- package/lib/switch/style/index.js +3 -6
- package/lib/table/index.d.ts +1 -4
- package/lib/table/index.js +114 -68
- package/lib/table/style/index.d.ts +2 -5
- package/lib/table/style/index.js +68 -32
- package/lib/tabs/index.js +12 -7
- package/lib/tabs/style/index.d.ts +2 -5
- package/lib/tabs/style/index.js +12 -8
- package/lib/tag/index.d.ts +1 -0
- package/lib/tag/index.js +18 -8
- package/lib/tag/style/index.d.ts +3 -8
- package/lib/tag/style/index.js +45 -36
- package/lib/theme/compact.d.ts +1 -1
- package/lib/theme/compact.js +1 -5
- package/lib/theme/dark.d.ts +1 -48
- package/lib/theme/default.d.ts +48 -2
- package/lib/theme/default.js +412 -79
- package/lib/theme/index.d.ts +20 -57
- package/lib/theme/interface.d.ts +130 -0
- package/lib/theme/style/aliyun.less +86 -86
- package/lib/theme/style/compact.less +199 -170
- package/lib/theme/style/dark.less +103 -103
- package/lib/theme/style/default.less +202 -173
- package/lib/tooltip/MouseTooltip.js +43 -39
- package/lib/tooltip/ReactStickyMouseTooltip.js +5 -4
- package/lib/tooltip/index.js +17 -13
- package/lib/tooltip/style/index.d.ts +2 -5
- package/lib/tooltip/style/index.js +10 -13
- package/lib/tree-select/index.js +4 -3
- package/lib/tree-select/style/index.d.ts +2 -5
- package/lib/tree-select/style/index.js +3 -6
- package/lib/typography/Link.js +7 -6
- package/lib/typography/Paragraph.js +7 -6
- package/lib/typography/Text.d.ts +1 -0
- package/lib/typography/Text.js +9 -8
- package/lib/typography/Title.js +7 -6
- package/lib/typography/hooks/useClassName.d.ts +1 -1
- package/lib/typography/hooks/useClassName.js +3 -2
- package/lib/typography/index.d.ts +12 -1
- package/lib/typography/index.js +6 -5
- package/lib/typography/style/index.d.ts +2 -5
- package/lib/typography/style/index.js +34 -26
- package/package.json +11 -10
- package/dist/static/Inter.f6bcdfb6.woff2 +0 -0
- package/es/_util/genStyle.d.ts +0 -2
- package/es/_util/getWeakenBorderColor.d.ts +0 -1
- package/es/_util/getWeakenBorderColor.js +0 -4
- package/es/fonts/Inter.woff2 +0 -0
- package/es/global.css +0 -48
- package/lib/_util/genStyle.d.ts +0 -2
- package/lib/_util/getWeakenBorderColor.d.ts +0 -1
- package/lib/fonts/Inter.woff2 +0 -0
- package/lib/global.css +0 -48
package/lib/drawer/index.js
CHANGED
|
@@ -43,9 +43,11 @@ var import_button = __toESM(require("../button"));
|
|
|
43
43
|
var import_en_US = __toESM(require("../locale/en-US"));
|
|
44
44
|
var import_style = __toESM(require("./style"));
|
|
45
45
|
__reExport(drawer_exports, require("antd/es/drawer"), module.exports);
|
|
46
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
47
|
var Drawer = ({
|
|
47
48
|
locale: customLocale,
|
|
48
49
|
children,
|
|
50
|
+
loading,
|
|
49
51
|
onOk,
|
|
50
52
|
onClose,
|
|
51
53
|
onCancel,
|
|
@@ -71,28 +73,29 @@ var Drawer = ({
|
|
|
71
73
|
};
|
|
72
74
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
73
75
|
const prefixCls = getPrefixCls("drawer", customizePrefixCls);
|
|
74
|
-
const
|
|
76
|
+
const [wrapCSSVar] = (0, import_style.default)(prefixCls);
|
|
75
77
|
const [contentElment, setContentElement] = (0, import_react.useState)(null);
|
|
76
78
|
(0, import_ahooks.useSize)(contentElment);
|
|
77
79
|
const scroll = (0, import_ahooks.useScroll)(contentElment);
|
|
78
|
-
const isScroll = (contentElment == null ? void 0 : contentElment.scrollHeight) !== (contentElment == null ? void 0 : contentElment.clientHeight);
|
|
79
|
-
const isStartScroll = scroll.top > 0;
|
|
80
|
-
const isTotalScroll = Math.abs(
|
|
80
|
+
const isScroll = !loading && (contentElment == null ? void 0 : contentElment.scrollHeight) !== (contentElment == null ? void 0 : contentElment.clientHeight);
|
|
81
|
+
const isStartScroll = !loading && scroll.top > 0;
|
|
82
|
+
const isTotalScroll = !loading && Math.abs(
|
|
81
83
|
((contentElment == null ? void 0 : contentElment.scrollHeight) || 0) - ((contentElment == null ? void 0 : contentElment.clientHeight) || 0) - ((contentElment == null ? void 0 : contentElment.scrollTop) || 0)
|
|
82
84
|
) < 1;
|
|
83
85
|
const handleCancel = onCancel || onClose;
|
|
84
86
|
const showFooter = !!(footer || onOk) && footer !== false && footer !== null;
|
|
85
87
|
const drawerCls = (0, import_classnames.default)(
|
|
86
|
-
prefixCls,
|
|
87
88
|
{
|
|
89
|
+
[`${prefixCls}-loading`]: loading,
|
|
88
90
|
[`${prefixCls}-with-footer`]: showFooter
|
|
89
91
|
},
|
|
90
92
|
rootClassName
|
|
91
93
|
);
|
|
92
|
-
return
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
return wrapCSSVar(
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
94
96
|
import_antd.Drawer,
|
|
95
97
|
{
|
|
98
|
+
loading,
|
|
96
99
|
destroyOnClose: true,
|
|
97
100
|
onClose: handleCancel,
|
|
98
101
|
rootClassName: drawerCls,
|
|
@@ -103,34 +106,42 @@ var Drawer = ({
|
|
|
103
106
|
})
|
|
104
107
|
},
|
|
105
108
|
styles: (0, import_lodash.omit)(styles, ["body", "footer"]),
|
|
106
|
-
...restProps
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
109
|
+
...restProps,
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
ref: (element) => {
|
|
115
|
+
setContentElement(element);
|
|
116
|
+
},
|
|
117
|
+
className: `${prefixCls}-body-content`,
|
|
118
|
+
style: {
|
|
119
|
+
...bodyStyle,
|
|
120
|
+
...styles == null ? void 0 : styles.body
|
|
121
|
+
},
|
|
122
|
+
children
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
showFooter && // footer className should not be `${prefixCls}-footer` to avoid conflicts with antd
|
|
126
|
+
// ref: https://github.com/ant-design/ant-design/blob/master/components/drawer/style/index.ts#L214
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
className: (0, import_classnames.default)(`${prefixCls}-footer-container`, {
|
|
131
|
+
[`${prefixCls}-footer-container-shadow`]: isScroll && !isTotalScroll
|
|
132
|
+
}),
|
|
133
|
+
style: styles == null ? void 0 : styles.footer,
|
|
134
|
+
children: (0, import_react.isValidElement)(footer) ? footer : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-footer-content`, children: [
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { children: [
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.default, { onClick: onOk, type: "primary", loading: confirmLoading, ...okButtonProps, children: okText || (drawerLocale == null ? void 0 : drawerLocale.okText) }),
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.default, { onClick: handleCancel, children: cancelText || (drawerLocale == null ? void 0 : drawerLocale.cancelText) })
|
|
138
|
+
] }),
|
|
139
|
+
footerExtra
|
|
140
|
+
] })
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
]
|
|
144
|
+
}
|
|
134
145
|
)
|
|
135
146
|
);
|
|
136
147
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type DrawerToken = FullToken<'Drawer'>;
|
|
4
4
|
export declare const genDrawerStyle: GenerateStyle<DrawerToken>;
|
|
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
|
-
};
|
|
5
|
+
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
|
|
9
6
|
export default _default;
|
|
@@ -23,21 +23,45 @@ __export(style_exports, {
|
|
|
23
23
|
genDrawerStyle: () => genDrawerStyle
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_cssinjs = require("@ant-design/cssinjs");
|
|
26
27
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
28
|
var genDrawerStyle = (token) => {
|
|
28
|
-
const { componentCls } = token;
|
|
29
|
-
const
|
|
30
|
-
const boxShadowTop = "0 -2px
|
|
29
|
+
const { componentCls, antCls, iconCls, fontSizeHeading3, colorSplit, calc } = token;
|
|
30
|
+
const contentPadding = token.paddingLG;
|
|
31
|
+
const boxShadowTop = "0 -1px 2px 0 rgba(19, 33, 57, 0.1)";
|
|
32
|
+
const boxShadowBottom = "0 1px 2px 0 rgba(19, 33, 57, 0.1)";
|
|
31
33
|
return {
|
|
32
34
|
[`${componentCls}`]: {
|
|
33
35
|
// should be wrapped by `${componentCls}-content` to overwritten antd style
|
|
34
36
|
[`${componentCls}-content`]: {
|
|
37
|
+
// to avoid x scroll
|
|
38
|
+
overflow: "initial",
|
|
35
39
|
[`${componentCls}-header`]: {
|
|
36
|
-
|
|
40
|
+
position: "relative",
|
|
41
|
+
padding: `${(0, import_cssinjs.unit)(token.padding)} ${(0, import_cssinjs.unit)(token.paddingLG)}`,
|
|
37
42
|
borderBottom: "none",
|
|
38
43
|
transition: `box-shadow ${token.motionDurationMid}`,
|
|
39
44
|
// ensure header box-shadow cover body content
|
|
40
|
-
zIndex: 10
|
|
45
|
+
zIndex: 10,
|
|
46
|
+
[`${componentCls}-title`]: {
|
|
47
|
+
fontSize: fontSizeHeading3,
|
|
48
|
+
[iconCls]: {
|
|
49
|
+
fontSize: token.fontSizeLG
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
// 标题栏底部增加分割线
|
|
53
|
+
"&::after": {
|
|
54
|
+
content: '""',
|
|
55
|
+
position: "absolute",
|
|
56
|
+
bottom: 0,
|
|
57
|
+
left: 0,
|
|
58
|
+
right: 0,
|
|
59
|
+
height: "1px",
|
|
60
|
+
backgroundColor: colorSplit,
|
|
61
|
+
// 使用负margin让分割线贯通到content边缘
|
|
62
|
+
marginLeft: calc(token.paddingLG).mul(-1).equal(),
|
|
63
|
+
marginRight: calc(token.paddingLG).mul(-1).equal()
|
|
64
|
+
}
|
|
41
65
|
},
|
|
42
66
|
[`${componentCls}-header-shadow`]: {
|
|
43
67
|
boxShadow: boxShadowBottom
|
|
@@ -48,12 +72,12 @@ var genDrawerStyle = (token) => {
|
|
|
48
72
|
flexDirection: "column"
|
|
49
73
|
},
|
|
50
74
|
[`${componentCls}-body-content`]: {
|
|
51
|
-
padding:
|
|
75
|
+
padding: contentPadding,
|
|
52
76
|
overflow: "auto"
|
|
53
77
|
},
|
|
54
78
|
[`${componentCls}-footer-container`]: {
|
|
55
79
|
position: "sticky",
|
|
56
|
-
padding:
|
|
80
|
+
padding: `${(0, import_cssinjs.unit)(token.padding)} ${(0, import_cssinjs.unit)(token.paddingLG)}`,
|
|
57
81
|
transition: `box-shadow ${token.motionDurationMid}`,
|
|
58
82
|
// ensure footer box-shadow cover body content
|
|
59
83
|
zIndex: 10,
|
|
@@ -64,27 +88,33 @@ var genDrawerStyle = (token) => {
|
|
|
64
88
|
alignItems: "center"
|
|
65
89
|
}
|
|
66
90
|
},
|
|
91
|
+
// footer 跟随内容或滚动到底部时,padding-top 设为 0
|
|
92
|
+
[`${componentCls}-footer-container-no-padding-top`]: {
|
|
93
|
+
paddingTop: 0
|
|
94
|
+
},
|
|
67
95
|
[`${componentCls}-footer-container-shadow`]: {
|
|
68
96
|
boxShadow: boxShadowTop
|
|
69
97
|
}
|
|
70
98
|
}
|
|
71
99
|
},
|
|
100
|
+
[`${componentCls}${componentCls}-loading`]: {
|
|
101
|
+
[`${componentCls}-body > ${antCls}-skeleton`]: {
|
|
102
|
+
padding: contentPadding
|
|
103
|
+
}
|
|
104
|
+
},
|
|
72
105
|
[`${componentCls}${componentCls}-with-footer`]: {
|
|
73
106
|
// should be wrapped by `${componentCls}-content` to overwritten antd style
|
|
74
107
|
[`${componentCls}-content`]: {
|
|
75
108
|
[`${componentCls}-body-content`]: {
|
|
76
|
-
|
|
109
|
+
paddingBottom: token.paddingXS
|
|
77
110
|
}
|
|
78
111
|
}
|
|
79
112
|
}
|
|
80
113
|
};
|
|
81
114
|
};
|
|
82
|
-
var style_default = (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
return useStyle(prefixCls);
|
|
87
|
-
};
|
|
115
|
+
var style_default = (0, import_genComponentStyleHook.genStyleHooks)("Drawer", (token) => {
|
|
116
|
+
return [genDrawerStyle(token)];
|
|
117
|
+
});
|
|
88
118
|
// Annotate the CommonJS export names for ESM import in node:
|
|
89
119
|
0 && (module.exports = {
|
|
90
120
|
genDrawerStyle
|
|
@@ -32,11 +32,34 @@ __export(dropdown_button_exports, {
|
|
|
32
32
|
default: () => dropdown_button_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(dropdown_button_exports);
|
|
35
|
-
var import_react =
|
|
35
|
+
var import_react = require("react");
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_icons = require("@oceanbase/icons");
|
|
38
|
-
var
|
|
39
|
-
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_config_provider = __toESM(require("../config-provider"));
|
|
40
|
+
var import_style = __toESM(require("./style"));
|
|
41
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
var DropdownButton = ({
|
|
43
|
+
prefixCls: customizePrefixCls,
|
|
44
|
+
className,
|
|
45
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DownOutlined, {}),
|
|
46
|
+
...restProps
|
|
47
|
+
}) => {
|
|
48
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
49
|
+
const prefixCls = getPrefixCls("dropdown", customizePrefixCls);
|
|
50
|
+
const [wrapCSSVar] = (0, import_style.default)(prefixCls);
|
|
51
|
+
const buttonCls = (0, import_classnames.default)(className);
|
|
52
|
+
return wrapCSSVar(
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
import_antd.Dropdown.Button,
|
|
55
|
+
{
|
|
56
|
+
icon,
|
|
57
|
+
prefixCls: customizePrefixCls,
|
|
58
|
+
className: buttonCls,
|
|
59
|
+
...restProps
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
);
|
|
40
63
|
};
|
|
41
64
|
DropdownButton.__ANT_BUTTON = true;
|
|
42
65
|
var dropdown_button_default = DropdownButton;
|
package/lib/dropdown/index.js
CHANGED
|
@@ -33,12 +33,12 @@ __export(dropdown_exports, {
|
|
|
33
33
|
default: () => dropdown_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(dropdown_exports);
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
36
|
var import_antd = require("antd");
|
|
38
37
|
var import_dropdown_button = __toESM(require("./dropdown-button"));
|
|
39
38
|
__reExport(dropdown_exports, require("antd/es/dropdown"), module.exports);
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
40
|
var Dropdown = (props) => {
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Dropdown, { ...props });
|
|
42
42
|
};
|
|
43
43
|
Dropdown._InternalPanelDoNotUseOrYouWillBeFired = import_antd.Dropdown._InternalPanelDoNotUseOrYouWillBeFired;
|
|
44
44
|
Dropdown.Button = import_dropdown_button.default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
|
+
export type DropdownToken = FullToken<'Dropdown'>;
|
|
4
|
+
export declare const genDropdownStyle: GenerateStyle<DropdownToken>;
|
|
5
|
+
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
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/dropdown/style/index.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
default: () => style_default,
|
|
23
|
+
genDropdownStyle: () => genDropdownStyle
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
|
+
var genDropdownStyle = (token) => {
|
|
28
|
+
const { antCls, lineWidth } = token;
|
|
29
|
+
const btnComponentCls = `${antCls}-btn`;
|
|
30
|
+
const selector = `${btnComponentCls}-compact-item${btnComponentCls}-primary:not([disabled])`;
|
|
31
|
+
return {
|
|
32
|
+
// special style for primary Dropdown.Button
|
|
33
|
+
[`${selector} + ${selector}::before`]: {
|
|
34
|
+
top: -1,
|
|
35
|
+
backgroundColor: token.colorWhite,
|
|
36
|
+
height: `calc(100% + ${lineWidth * 2}px)`
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
var style_default = (0, import_genComponentStyleHook.genStyleHooks)("Dropdown", (token) => {
|
|
41
|
+
return [genDropdownStyle(token)];
|
|
42
|
+
});
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
genDropdownStyle
|
|
46
|
+
});
|