@alicloud/console-base-rc-side-panel 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +3 -0
- package/build/cjs/index.js +20 -0
- package/build/cjs/model/const/index.js +15 -0
- package/build/cjs/model/context/index.js +9 -0
- package/build/cjs/model/enum/index.js +12 -0
- package/build/cjs/model/hook/_use-model-context.js +12 -0
- package/build/cjs/model/hook/_use-model-dispatch.js +11 -0
- package/build/cjs/model/hook/_use-model-props.js +29 -0
- package/build/cjs/model/hook/_use-model-state.js +11 -0
- package/build/cjs/model/hook/index.js +62 -0
- package/build/cjs/model/hook/use-children.js +11 -0
- package/build/cjs/model/hook/use-collapsed.js +16 -0
- package/build/cjs/model/hook/use-dispatch-set-collapsed.js +19 -0
- package/build/cjs/model/hook/use-dispatch-set-quick-top-visible.js +19 -0
- package/build/cjs/model/hook/use-effect-quick-top.js +40 -0
- package/build/cjs/model/hook/use-effect-toggle-body-class.js +25 -0
- package/build/cjs/model/hook/use-effects.js +13 -0
- package/build/cjs/model/hook/use-handle-collapsed-change.js +21 -0
- package/build/cjs/model/hook/use-handle-go-top.js +22 -0
- package/build/cjs/model/hook/use-handle-set-quick-top-visible.js +19 -0
- package/build/cjs/model/hook/use-items-bottom.js +11 -0
- package/build/cjs/model/hook/use-items-top.js +11 -0
- package/build/cjs/model/hook/use-quick-top.js +19 -0
- package/build/cjs/model/hook/use-visible.js +14 -0
- package/build/cjs/model/index.js +35 -0
- package/build/cjs/model/lifecycle/index.js +12 -0
- package/build/cjs/model/provider/index.js +40 -0
- package/build/cjs/model/reducer/index.js +20 -0
- package/build/cjs/model/reducer/reduce-set-collapsed.js +15 -0
- package/build/cjs/model/reducer/reduce-set-quick-top-visible.js +15 -0
- package/build/cjs/model/types/action.js +5 -0
- package/build/cjs/model/types/common.js +5 -0
- package/build/cjs/model/types/context.js +5 -0
- package/build/cjs/model/types/index.js +60 -0
- package/build/cjs/model/types/props.js +5 -0
- package/build/cjs/model/types/state.js +5 -0
- package/build/cjs/model/util/index.js +13 -0
- package/build/cjs/model/util/toggle-body-class.js +16 -0
- package/build/cjs/ui/const/index.js +26 -0
- package/build/cjs/ui/index.js +29 -0
- package/build/cjs/ui/intl/index.js +19 -0
- package/build/cjs/ui/intl/locales/en-us.js +12 -0
- package/build/cjs/ui/intl/locales/ja-jp.js +12 -0
- package/build/cjs/ui/intl/locales/zh-cn.js +12 -0
- package/build/cjs/ui/intl/locales/zh-tw.js +12 -0
- package/build/cjs/ui/rc/aside/index.js +14 -0
- package/build/cjs/ui/rc/global-style-on-body/index.js +15 -0
- package/build/cjs/ui/rc/index.js +48 -0
- package/build/cjs/ui/rc/side-panel-item-badge/index.js +56 -0
- package/build/cjs/ui/rc/side-panel-item-button/index.js +39 -0
- package/build/cjs/ui/rc/side-panel-item-tooltip/index.js +58 -0
- package/build/cjs/ui/rc/side-panel-item-wrap/index.js +16 -0
- package/build/cjs/ui/rc-container/collapse-toggle/index.js +77 -0
- package/build/cjs/ui/rc-container/index.js +27 -0
- package/build/cjs/ui/rc-container/item/index.js +103 -0
- package/build/cjs/ui/rc-container/items/index.js +20 -0
- package/build/cjs/ui/rc-container/items-bottom/index.js +28 -0
- package/build/cjs/ui/rc-container/items-bottom/quick-top/index.js +47 -0
- package/build/cjs/ui/rc-container/items-top/index.js +20 -0
- package/build/cjs/ui/types/index.js +5 -0
- package/build/cjs/ui/util/get-value-by-status.js +23 -0
- package/build/cjs/ui/util/index.js +13 -0
- package/build/cjs/with-model/index.js +15 -0
- package/build/es/index.js +2 -0
- package/build/es/model/const/index.js +6 -0
- package/build/es/model/context/index.js +2 -0
- package/build/es/model/enum/index.js +5 -0
- package/build/es/model/hook/_use-model-context.js +5 -0
- package/build/es/model/hook/_use-model-dispatch.js +4 -0
- package/build/es/model/hook/_use-model-props.js +22 -0
- package/build/es/model/hook/_use-model-state.js +4 -0
- package/build/es/model/hook/index.js +10 -0
- package/build/es/model/hook/use-children.js +4 -0
- package/build/es/model/hook/use-collapsed.js +9 -0
- package/build/es/model/hook/use-dispatch-set-collapsed.js +12 -0
- package/build/es/model/hook/use-dispatch-set-quick-top-visible.js +12 -0
- package/build/es/model/hook/use-effect-quick-top.js +33 -0
- package/build/es/model/hook/use-effect-toggle-body-class.js +18 -0
- package/build/es/model/hook/use-effects.js +6 -0
- package/build/es/model/hook/use-handle-collapsed-change.js +14 -0
- package/build/es/model/hook/use-handle-go-top.js +15 -0
- package/build/es/model/hook/use-handle-set-quick-top-visible.js +12 -0
- package/build/es/model/hook/use-items-bottom.js +4 -0
- package/build/es/model/hook/use-items-top.js +4 -0
- package/build/es/model/hook/use-quick-top.js +12 -0
- package/build/es/model/hook/use-visible.js +7 -0
- package/build/es/model/index.js +3 -0
- package/build/es/model/lifecycle/index.js +5 -0
- package/build/es/model/provider/index.js +30 -0
- package/build/es/model/reducer/index.js +13 -0
- package/build/es/model/reducer/reduce-set-collapsed.js +8 -0
- package/build/es/model/reducer/reduce-set-quick-top-visible.js +8 -0
- package/build/es/model/types/action.js +1 -0
- package/build/es/model/types/common.js +1 -0
- package/build/es/model/types/context.js +1 -0
- package/build/es/model/types/index.js +5 -0
- package/build/es/model/types/props.js +1 -0
- package/build/es/model/types/state.js +1 -0
- package/build/es/model/util/index.js +1 -0
- package/build/es/model/util/toggle-body-class.js +10 -0
- package/build/es/ui/const/index.js +12 -0
- package/build/es/ui/index.js +19 -0
- package/build/es/ui/intl/index.js +11 -0
- package/build/es/ui/intl/locales/en-us.js +5 -0
- package/build/es/ui/intl/locales/ja-jp.js +5 -0
- package/build/es/ui/intl/locales/zh-cn.js +5 -0
- package/build/es/ui/intl/locales/zh-tw.js +5 -0
- package/build/es/ui/rc/aside/index.js +6 -0
- package/build/es/ui/rc/global-style-on-body/index.js +8 -0
- package/build/es/ui/rc/index.js +6 -0
- package/build/es/ui/rc/side-panel-item-badge/index.js +46 -0
- package/build/es/ui/rc/side-panel-item-button/index.js +29 -0
- package/build/es/ui/rc/side-panel-item-tooltip/index.js +48 -0
- package/build/es/ui/rc/side-panel-item-wrap/index.js +9 -0
- package/build/es/ui/rc-container/collapse-toggle/index.js +67 -0
- package/build/es/ui/rc-container/index.js +3 -0
- package/build/es/ui/rc-container/item/index.js +93 -0
- package/build/es/ui/rc-container/items/index.js +13 -0
- package/build/es/ui/rc-container/items-bottom/index.js +21 -0
- package/build/es/ui/rc-container/items-bottom/quick-top/index.js +37 -0
- package/build/es/ui/rc-container/items-top/index.js +13 -0
- package/build/es/ui/types/index.js +1 -0
- package/build/es/ui/util/get-value-by-status.js +17 -0
- package/build/es/ui/util/index.js +1 -0
- package/build/es/with-model/index.js +8 -0
- package/build/types/index.d.ts +3 -0
- package/build/types/model/const/index.d.ts +4 -0
- package/build/types/model/context/index.d.ts +4 -0
- package/build/types/model/enum/index.d.ts +4 -0
- package/build/types/model/hook/_use-model-context.d.ts +2 -0
- package/build/types/model/hook/_use-model-dispatch.d.ts +2 -0
- package/build/types/model/hook/_use-model-props.d.ts +5 -0
- package/build/types/model/hook/_use-model-state.d.ts +2 -0
- package/build/types/model/hook/index.d.ts +8 -0
- package/build/types/model/hook/use-children.d.ts +2 -0
- package/build/types/model/hook/use-collapsed.d.ts +1 -0
- package/build/types/model/hook/use-dispatch-set-collapsed.d.ts +1 -0
- package/build/types/model/hook/use-dispatch-set-quick-top-visible.d.ts +1 -0
- package/build/types/model/hook/use-effect-quick-top.d.ts +1 -0
- package/build/types/model/hook/use-effect-toggle-body-class.d.ts +1 -0
- package/build/types/model/hook/use-effects.d.ts +1 -0
- package/build/types/model/hook/use-handle-collapsed-change.d.ts +1 -0
- package/build/types/model/hook/use-handle-go-top.d.ts +1 -0
- package/build/types/model/hook/use-handle-set-quick-top-visible.d.ts +1 -0
- package/build/types/model/hook/use-items-bottom.d.ts +2 -0
- package/build/types/model/hook/use-items-top.d.ts +2 -0
- package/build/types/model/hook/use-quick-top.d.ts +6 -0
- package/build/types/model/hook/use-visible.d.ts +1 -0
- package/build/types/model/index.d.ts +4 -0
- package/build/types/model/lifecycle/index.d.ts +1 -0
- package/build/types/model/provider/index.d.ts +8 -0
- package/build/types/model/reducer/index.d.ts +2 -0
- package/build/types/model/reducer/reduce-set-collapsed.d.ts +2 -0
- package/build/types/model/reducer/reduce-set-quick-top-visible.d.ts +2 -0
- package/build/types/model/types/action.d.ts +7 -0
- package/build/types/model/types/common.d.ts +66 -0
- package/build/types/model/types/context.d.ts +11 -0
- package/build/types/model/types/index.d.ts +5 -0
- package/build/types/model/types/props.d.ts +37 -0
- package/build/types/model/types/state.d.ts +4 -0
- package/build/types/model/util/index.d.ts +1 -0
- package/build/types/model/util/toggle-body-class.d.ts +1 -0
- package/build/types/ui/const/index.d.ts +8 -0
- package/build/types/ui/index.d.ts +1 -0
- package/build/types/ui/intl/index.d.ts +6 -0
- package/build/types/ui/intl/locales/en-us.d.ts +6 -0
- package/build/types/ui/intl/locales/ja-jp.d.ts +6 -0
- package/build/types/ui/intl/locales/zh-cn.d.ts +6 -0
- package/build/types/ui/intl/locales/zh-tw.d.ts +6 -0
- package/build/types/ui/rc/aside/index.d.ts +2 -0
- package/build/types/ui/rc/global-style-on-body/index.d.ts +1 -0
- package/build/types/ui/rc/index.d.ts +6 -0
- package/build/types/ui/rc/side-panel-item-badge/index.d.ts +9 -0
- package/build/types/ui/rc/side-panel-item-button/index.d.ts +5 -0
- package/build/types/ui/rc/side-panel-item-tooltip/index.d.ts +10 -0
- package/build/types/ui/rc/side-panel-item-wrap/index.d.ts +5 -0
- package/build/types/ui/rc-container/collapse-toggle/index.d.ts +1 -0
- package/build/types/ui/rc-container/index.d.ts +3 -0
- package/build/types/ui/rc-container/item/index.d.ts +5 -0
- package/build/types/ui/rc-container/items/index.d.ts +6 -0
- package/build/types/ui/rc-container/items-bottom/index.d.ts +1 -0
- package/build/types/ui/rc-container/items-bottom/quick-top/index.d.ts +1 -0
- package/build/types/ui/rc-container/items-top/index.d.ts +1 -0
- package/build/types/ui/types/index.d.ts +4 -0
- package/build/types/ui/util/get-value-by-status.d.ts +8 -0
- package/build/types/ui/util/index.d.ts +1 -0
- package/build/types/with-model/index.d.ts +2 -0
- package/package.json +69 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as toggleBodyClass } from './toggle-body-class';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { addClass, removeClass } from '@alicloud/mere-dom';
|
|
2
|
+
import { BODY_CLASS_WITH_SIDE_PANEL } from '../const';
|
|
3
|
+
export default function toggleBodyClass() {
|
|
4
|
+
var yes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
5
|
+
if (yes) {
|
|
6
|
+
addClass(document.body, BODY_CLASS_WITH_SIDE_PANEL);
|
|
7
|
+
} else {
|
|
8
|
+
removeClass(document.body, BODY_CLASS_WITH_SIDE_PANEL);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SIZE } from '@alicloud/console-base-theme';
|
|
2
|
+
export var SPACING_X = 10; // 圆形按钮与条状 Panel 的水平间隙
|
|
3
|
+
export var SPACING_Y = 6;
|
|
4
|
+
export var SIZE_BUTTON = SIZE.WIDTH_SIDE_PANEL - SPACING_X * 2;
|
|
5
|
+
export var SIZE_BUTTON_ICON = SIZE_BUTTON * 0.5;
|
|
6
|
+
export var SIZE_BUTTON_WRAP_WIDTH = SIZE.WIDTH_SIDE_PANEL;
|
|
7
|
+
export var SIZE_BUTTON_WRAP_HEIGHT = SIZE_BUTTON + 2 * SPACING_Y;
|
|
8
|
+
export var DATA_KEY_SIDE_PANEL_ITEM = 'data-console-base-side-panel-item';
|
|
9
|
+
|
|
10
|
+
// 给应用一些属性钩子,不需要值(所有 ConsoleBase 下的组件,钩子属性的规范是 `data-j-[组件名]-xx`)
|
|
11
|
+
// 不要随意改
|
|
12
|
+
export var DATA_KEY_J = 'data-j-side-panel';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { useVisible, useCollapsed } from '../model';
|
|
5
|
+
import { DATA_KEY_J } from './const';
|
|
6
|
+
import { Aside, GlobalStyleOnBody } from './rc';
|
|
7
|
+
import { ItemsTop, ItemsBottom, CollapseToggle } from './rc-container';
|
|
8
|
+
var ScUi = styled(Aside).withConfig({
|
|
9
|
+
componentId: "sc-1ok6knf-0"
|
|
10
|
+
})(["", ""], function (props) {
|
|
11
|
+
return props.collapsed ? css(["transform:translateX(100%);"]) : null;
|
|
12
|
+
});
|
|
13
|
+
export default function Ui() {
|
|
14
|
+
var visible = useVisible();
|
|
15
|
+
var collapsed = useCollapsed();
|
|
16
|
+
return visible ? /*#__PURE__*/React.createElement(ScUi, _defineProperty({
|
|
17
|
+
collapsed: collapsed
|
|
18
|
+
}, DATA_KEY_J, ''), /*#__PURE__*/React.createElement(GlobalStyleOnBody, null), /*#__PURE__*/React.createElement(ItemsTop, null), /*#__PURE__*/React.createElement(ItemsBottom, null), /*#__PURE__*/React.createElement(CollapseToggle, null)) : null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import intlFactory from '@alicloud/console-base-intl-factory-basic';
|
|
2
|
+
import localesEnUS from './locales/en-us';
|
|
3
|
+
import localesZhCN from './locales/zh-cn';
|
|
4
|
+
import localesZhTW from './locales/zh-tw';
|
|
5
|
+
import localesJaJP from './locales/ja-jp';
|
|
6
|
+
export default intlFactory({
|
|
7
|
+
'en-US': localesEnUS,
|
|
8
|
+
'zh-CN': localesZhCN,
|
|
9
|
+
'zh-TW': localesZhTW,
|
|
10
|
+
'ja-JP': localesJaJP
|
|
11
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { SIZE, Z_INDEX, mixinBgPrimary, mixinShadowSLeft } from '@alicloud/console-base-theme';
|
|
3
|
+
import { SIZE_BUTTON_WRAP_HEIGHT, SPACING_Y } from '../../const';
|
|
4
|
+
export default styled.aside.withConfig({
|
|
5
|
+
componentId: "sc-1e5hmz-0"
|
|
6
|
+
})(["display:flex;flex-direction:column;position:fixed;top:0;right:0;bottom:0;z-index:", ";padding:", "px 0 ", "px 0;width:", "px;transition:all ease-in-out 250ms;", " ", " .hasTopbar &{top:", "px;}"], Z_INDEX.SIDE_PANEL, SPACING_Y * 1.5, SIZE_BUTTON_WRAP_HEIGHT + SPACING_Y, SIZE.WIDTH_SIDE_PANEL, mixinBgPrimary, mixinShadowSLeft, SIZE.HEIGHT_TOP_NAV);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createGlobalStyle } from 'styled-components';
|
|
3
|
+
import { SIZE, Z_INDEX } from '@alicloud/console-base-theme';
|
|
4
|
+
import { BODY_CLASS_WITH_SIDE_PANEL } from '../../../model';
|
|
5
|
+
var GlobalStyle = createGlobalStyle(["body.", "{padding-right:", "px;transition:padding-right ease-in-out 250ms;.viewFramework-body{right:", "px;left:0;z-index:", ";width:auto !important;}}"], BODY_CLASS_WITH_SIDE_PANEL, SIZE.WIDTH_SIDE_PANEL, SIZE.WIDTH_SIDE_PANEL, Z_INDEX.SIDE_PANEL - 1);
|
|
6
|
+
export default function GlobalStyleOnBody() {
|
|
7
|
+
return /*#__PURE__*/React.createElement(GlobalStyle, null);
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Aside } from './aside';
|
|
2
|
+
export { default as GlobalStyleOnBody } from './global-style-on-body';
|
|
3
|
+
export { default as SidePanelItemWrap } from './side-panel-item-wrap';
|
|
4
|
+
export { default as SidePanelItemButton } from './side-panel-item-button';
|
|
5
|
+
export { default as SidePanelItemBadge } from './side-panel-item-badge';
|
|
6
|
+
export { default as SidePanelItemTooltip } from './side-panel-item-tooltip';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { BadgeBaseDot, BadgeBaseNumber } from '@alicloud/console-base-theme-sc-base';
|
|
4
|
+
import Mark from '@alicloud/console-base-rc-marks';
|
|
5
|
+
var ScUnreadDot = styled(BadgeBaseDot).withConfig({
|
|
6
|
+
componentId: "sc-1isvxe9-0"
|
|
7
|
+
})(["top:8px;", ""], function (props) {
|
|
8
|
+
return props.$alignLeft ? css(["left:8px;"]) : css(["right:8px;"]);
|
|
9
|
+
});
|
|
10
|
+
var ScUnreadNumber = styled(BadgeBaseNumber).withConfig({
|
|
11
|
+
componentId: "sc-1isvxe9-1"
|
|
12
|
+
})(["top:4px;", ""], function (props) {
|
|
13
|
+
return props.$alignLeft ? css(["left:2px;right:auto;"]) : css(["right:2px;"]);
|
|
14
|
+
});
|
|
15
|
+
var ScMark = styled(Mark).withConfig({
|
|
16
|
+
componentId: "sc-1isvxe9-2"
|
|
17
|
+
})(["position:absolute;top:4px;", " transform:scale(0.75);"], function (props) {
|
|
18
|
+
return props.$alignLeft ? css(["left:0;"]) : css(["right:0;"]);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 右上角的徽标,unread 优先于 mark
|
|
23
|
+
*/
|
|
24
|
+
export default function SidePanelItemBadge(_ref) {
|
|
25
|
+
var unread = _ref.unread,
|
|
26
|
+
mark = _ref.mark,
|
|
27
|
+
alignLeft = _ref.alignLeft;
|
|
28
|
+
if (unread) {
|
|
29
|
+
if (unread === true) {
|
|
30
|
+
return /*#__PURE__*/React.createElement(ScUnreadDot, {
|
|
31
|
+
$alignLeft: alignLeft
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return /*#__PURE__*/React.createElement(ScUnreadNumber, {
|
|
35
|
+
$alignLeft: alignLeft
|
|
36
|
+
}, unread < 100 ? unread : '99+');
|
|
37
|
+
}
|
|
38
|
+
if (mark === 'NEW' || mark === 'HOT') {
|
|
39
|
+
return /*#__PURE__*/React.createElement(ScMark, {
|
|
40
|
+
$alignLeft: alignLeft,
|
|
41
|
+
type: mark,
|
|
42
|
+
borderRadius: true
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["title"];
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { mixinTextSecondary, mixinBgSecondaryFade, mixinBgTertiaryFade, mixinShadowSDown } from '@alicloud/console-base-theme';
|
|
9
|
+
import Button, { ButtonSize, ButtonTheme } from '@alicloud/console-base-rc-button';
|
|
10
|
+
import { SIZE_BUTTON, SIZE_BUTTON_ICON } from '../../const';
|
|
11
|
+
var ScButton = styled(Button).withConfig({
|
|
12
|
+
componentId: "sc-titsgb-0"
|
|
13
|
+
})(["border-radius:", "px;width:", "px;height:", "px;line-height:", "px;", " ", " ", " i{font-size:", "px;}svg,img{display:inline-block;width:", "px;height:", "px;vertical-align:middle;}&:hover{", "}a:link&,a:visited&{", "}"], SIZE_BUTTON, SIZE_BUTTON, SIZE_BUTTON, SIZE_BUTTON, mixinBgSecondaryFade, mixinTextSecondary, function (props) {
|
|
14
|
+
return props.active ? css(["", " ", ""], mixinBgTertiaryFade, mixinShadowSDown) : null;
|
|
15
|
+
}, SIZE_BUTTON_ICON, SIZE_BUTTON_ICON, SIZE_BUTTON_ICON, mixinBgTertiaryFade, mixinTextSecondary);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 工具的按钮
|
|
19
|
+
*/
|
|
20
|
+
export default function SidePanelItemButton(_ref) {
|
|
21
|
+
var title = _ref.title,
|
|
22
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
return /*#__PURE__*/React.createElement(ScButton, _objectSpread(_objectSpread({
|
|
24
|
+
'aria-label': title
|
|
25
|
+
}, props), {}, {
|
|
26
|
+
size: ButtonSize.NONE,
|
|
27
|
+
theme: ButtonTheme.NONE
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["visible", "align", "content"];
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { SIZE } from '@alicloud/console-base-theme';
|
|
9
|
+
import Tooltip, { TooltipPlacement } from '@alicloud/console-base-rc-tooltip';
|
|
10
|
+
import { SIZE_BUTTON_WRAP_HEIGHT } from '../../const';
|
|
11
|
+
var ScTooltip = styled(Tooltip).withConfig({
|
|
12
|
+
componentId: "sc-11m2ouk-0"
|
|
13
|
+
})(["right:", "px;", " img{max-width:100%;}"], SIZE.WIDTH_SIDE_PANEL - 4, function (props) {
|
|
14
|
+
switch (props.placement) {
|
|
15
|
+
case TooltipPlacement.LEFT_TOP:
|
|
16
|
+
return css(["top:0;"]);
|
|
17
|
+
case TooltipPlacement.LEFT_BOTTOM:
|
|
18
|
+
return css(["bottom:0;"]);
|
|
19
|
+
default:
|
|
20
|
+
return css(["bottom:", "px;transform:translateY(50%);"], SIZE_BUTTON_WRAP_HEIGHT * 0.5);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function getPlacement(align) {
|
|
24
|
+
switch (align) {
|
|
25
|
+
case 'top':
|
|
26
|
+
return TooltipPlacement.LEFT_TOP;
|
|
27
|
+
case 'bottom':
|
|
28
|
+
return TooltipPlacement.LEFT_BOTTOM;
|
|
29
|
+
default:
|
|
30
|
+
return TooltipPlacement.LEFT;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 工具按钮之外的部分(如果不是 tooltip 则期望它是 createPortal 出去的)
|
|
36
|
+
*/
|
|
37
|
+
export default function SidePanelItemTooltip(_ref) {
|
|
38
|
+
var visible = _ref.visible,
|
|
39
|
+
align = _ref.align,
|
|
40
|
+
content = _ref.content,
|
|
41
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
+
return /*#__PURE__*/React.createElement(ScTooltip, _objectSpread({
|
|
43
|
+
visible: visible,
|
|
44
|
+
placement: getPlacement(align),
|
|
45
|
+
arrowOffset: SIZE_BUTTON_WRAP_HEIGHT * 0.5,
|
|
46
|
+
content: content
|
|
47
|
+
}, props));
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { SIZE_BUTTON_WRAP_WIDTH, SIZE_BUTTON_WRAP_HEIGHT } from '../../const';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 工具的外层包裹
|
|
6
|
+
*/
|
|
7
|
+
export default styled.div.withConfig({
|
|
8
|
+
componentId: "sc-3r2cly-0"
|
|
9
|
+
})(["display:flex;align-items:center;justify-content:center;position:relative;width:", "px;height:", "px;transition:all ease-in-out 250ms;"], SIZE_BUTTON_WRAP_WIDTH, SIZE_BUTTON_WRAP_HEIGHT);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState, useCallback } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { mixinBgAccent, mixinTextWhite } from '@alicloud/console-base-theme';
|
|
5
|
+
import useMouseEnterLeave from '@alicloud/react-hook-mouse-enter-leave';
|
|
6
|
+
import Icon from '@alicloud/console-base-rc-icon';
|
|
7
|
+
import { SPACING_Y } from '../../const';
|
|
8
|
+
import intl from '../../intl';
|
|
9
|
+
import { useCollapsed, useItemsTop, useHandleCollapsedChange } from '../../../model';
|
|
10
|
+
import { SidePanelItemWrap, SidePanelItemButton, SidePanelItemBadge, SidePanelItemTooltip } from '../../rc';
|
|
11
|
+
var ScCollapseToggle = styled(SidePanelItemWrap).withConfig({
|
|
12
|
+
componentId: "sc-15z8r94-0"
|
|
13
|
+
})(["position:absolute;right:0;bottom:", "px;", ""], SPACING_Y, function (props) {
|
|
14
|
+
if (!props.collapsed) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return props.hovered ? css(["transform:translateX(-100%);"]) : css(["transform:translateX(-50%);"]);
|
|
18
|
+
});
|
|
19
|
+
var ScCollapseToggleButton = styled(SidePanelItemButton).withConfig({
|
|
20
|
+
componentId: "sc-15z8r94-1"
|
|
21
|
+
})(["", " ", ""], function (props) {
|
|
22
|
+
return props.active ? css(["", " ", " &:hover{", " ", "}"], mixinBgAccent, mixinTextWhite, mixinBgAccent, mixinTextWhite) : null;
|
|
23
|
+
}, function (props) {
|
|
24
|
+
return props.collapsed && !props.hovered ? css(["padding-left:4px;;text-align:left;"]) : null;
|
|
25
|
+
});
|
|
26
|
+
export default function PanelToggle() {
|
|
27
|
+
var _useState = useState(false),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
stateHovered = _useState2[0],
|
|
30
|
+
setStateHovered = _useState2[1];
|
|
31
|
+
var collapsed = useCollapsed();
|
|
32
|
+
var unread = useItemsTop().some(function (v) {
|
|
33
|
+
return v.unread;
|
|
34
|
+
});
|
|
35
|
+
var handleToggleCollapsed = useHandleCollapsedChange();
|
|
36
|
+
var _useMouseEnterLeave = useMouseEnterLeave(useCallback(function () {
|
|
37
|
+
setStateHovered(true);
|
|
38
|
+
}, [setStateHovered]), useCallback(function () {
|
|
39
|
+
setStateHovered(false);
|
|
40
|
+
}, [setStateHovered])),
|
|
41
|
+
_useMouseEnterLeave2 = _slicedToArray(_useMouseEnterLeave, 2),
|
|
42
|
+
handleMouseEnter = _useMouseEnterLeave2[0],
|
|
43
|
+
handleMouseLeave = _useMouseEnterLeave2[1];
|
|
44
|
+
var title = intl(collapsed ? 'op:toggle_visible' : 'op:toggle_hidden');
|
|
45
|
+
return /*#__PURE__*/React.createElement(ScCollapseToggle, {
|
|
46
|
+
hovered: stateHovered,
|
|
47
|
+
collapsed: collapsed,
|
|
48
|
+
onMouseLeave: handleMouseLeave
|
|
49
|
+
}, /*#__PURE__*/React.createElement(ScCollapseToggleButton, {
|
|
50
|
+
hovered: stateHovered,
|
|
51
|
+
collapsed: collapsed,
|
|
52
|
+
active: collapsed,
|
|
53
|
+
title: title,
|
|
54
|
+
label: /*#__PURE__*/React.createElement(Icon, {
|
|
55
|
+
type: "angle-right",
|
|
56
|
+
rotate: collapsed ? 180 : undefined
|
|
57
|
+
}),
|
|
58
|
+
onMouseEnter: handleMouseEnter,
|
|
59
|
+
onClick: handleToggleCollapsed
|
|
60
|
+
}), collapsed && unread ? /*#__PURE__*/React.createElement(SidePanelItemBadge, {
|
|
61
|
+
unread: true,
|
|
62
|
+
alignLeft: !stateHovered
|
|
63
|
+
}) : null, /*#__PURE__*/React.createElement(SidePanelItemTooltip, {
|
|
64
|
+
visible: stateHovered,
|
|
65
|
+
content: title
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["id", "className", "style", "active", "title", "titleActive", "icon", "iconHovered", "iconActive", "iconActiveHovered", "unread", "mark", "tooltip", "tooltipActive", "tooltipAsHtml", "tooltipAlign", "tooltipDefaultVisible", "onClick", "onActiveChange", "onMouseEnter", "onMouseLeave"];
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
import React, { useState, useCallback } from 'react';
|
|
8
|
+
import useMouseEnterLeave from '@alicloud/react-hook-mouse-enter-leave';
|
|
9
|
+
import HtmlTrusted from '@alicloud/console-base-rc-html-trusted';
|
|
10
|
+
import { renderEasyIcon } from '@alicloud/console-base-rc-easy-icon';
|
|
11
|
+
import { useCollapsed } from '../../../model';
|
|
12
|
+
import { getValueByStatus } from '../../util';
|
|
13
|
+
import { SidePanelItemWrap, SidePanelItemButton, SidePanelItemBadge, SidePanelItemTooltip } from '../../rc';
|
|
14
|
+
export default function Item(_ref) {
|
|
15
|
+
var id = _ref.id,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
style = _ref.style,
|
|
18
|
+
active = _ref.active,
|
|
19
|
+
title = _ref.title,
|
|
20
|
+
titleActive = _ref.titleActive,
|
|
21
|
+
icon = _ref.icon,
|
|
22
|
+
iconHovered = _ref.iconHovered,
|
|
23
|
+
iconActive = _ref.iconActive,
|
|
24
|
+
iconActiveHovered = _ref.iconActiveHovered,
|
|
25
|
+
unread = _ref.unread,
|
|
26
|
+
mark = _ref.mark,
|
|
27
|
+
tooltip = _ref.tooltip,
|
|
28
|
+
tooltipActive = _ref.tooltipActive,
|
|
29
|
+
tooltipAsHtml = _ref.tooltipAsHtml,
|
|
30
|
+
tooltipAlign = _ref.tooltipAlign,
|
|
31
|
+
_ref$tooltipDefaultVi = _ref.tooltipDefaultVisible,
|
|
32
|
+
tooltipDefaultVisible = _ref$tooltipDefaultVi === void 0 ? false : _ref$tooltipDefaultVi,
|
|
33
|
+
onClick = _ref.onClick,
|
|
34
|
+
onActiveChange = _ref.onActiveChange,
|
|
35
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
36
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
37
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
var collapsed = useCollapsed();
|
|
39
|
+
var _useState = useState(tooltipDefaultVisible),
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
+
stateTooltipVisible = _useState2[0],
|
|
42
|
+
setStateTooltipVisible = _useState2[1];
|
|
43
|
+
var _useMouseEnterLeave = useMouseEnterLeave(useCallback(function () {
|
|
44
|
+
setStateTooltipVisible(true);
|
|
45
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter();
|
|
46
|
+
}, [setStateTooltipVisible, onMouseEnter]), useCallback(function () {
|
|
47
|
+
setStateTooltipVisible(false);
|
|
48
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
|
|
49
|
+
}, [setStateTooltipVisible, onMouseLeave])),
|
|
50
|
+
_useMouseEnterLeave2 = _slicedToArray(_useMouseEnterLeave, 2),
|
|
51
|
+
handleMouseEnter = _useMouseEnterLeave2[0],
|
|
52
|
+
handleMouseLeave = _useMouseEnterLeave2[1];
|
|
53
|
+
var handleClick = useCallback(function (e) {
|
|
54
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
55
|
+
onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(!active);
|
|
56
|
+
}, [active, onClick, onActiveChange]);
|
|
57
|
+
var finalTitle = getValueByStatus({
|
|
58
|
+
valueNormal: title,
|
|
59
|
+
valueActive: titleActive
|
|
60
|
+
}, stateTooltipVisible, active);
|
|
61
|
+
var finalIcon = getValueByStatus({
|
|
62
|
+
valueNormal: icon,
|
|
63
|
+
valueHovered: iconHovered,
|
|
64
|
+
valueActive: iconActive,
|
|
65
|
+
valueActiveHovered: iconActiveHovered
|
|
66
|
+
}, stateTooltipVisible, active);
|
|
67
|
+
var finalTooltip = getValueByStatus({
|
|
68
|
+
valueNormal: tooltip,
|
|
69
|
+
valueActive: tooltipActive
|
|
70
|
+
}, stateTooltipVisible, active);
|
|
71
|
+
return /*#__PURE__*/React.createElement(SidePanelItemWrap, {
|
|
72
|
+
id: id,
|
|
73
|
+
className: className,
|
|
74
|
+
style: style,
|
|
75
|
+
onMouseLeave: handleMouseLeave
|
|
76
|
+
}, /*#__PURE__*/React.createElement(SidePanelItemButton, _objectSpread(_objectSpread({}, props), {}, {
|
|
77
|
+
active: active,
|
|
78
|
+
title: title,
|
|
79
|
+
label: renderEasyIcon(finalIcon) || title,
|
|
80
|
+
onMouseEnter: handleMouseEnter,
|
|
81
|
+
onClick: handleClick
|
|
82
|
+
})), /*#__PURE__*/React.createElement(SidePanelItemBadge, {
|
|
83
|
+
unread: unread,
|
|
84
|
+
mark: mark
|
|
85
|
+
}), finalTooltip || finalTitle ? /*#__PURE__*/React.createElement(SidePanelItemTooltip, {
|
|
86
|
+
visible: stateTooltipVisible && !collapsed,
|
|
87
|
+
align: tooltipAlign,
|
|
88
|
+
content: tooltipAsHtml && finalTooltip && typeof finalTooltip === 'string' ? /*#__PURE__*/React.createElement(HtmlTrusted, {
|
|
89
|
+
text: finalTooltip
|
|
90
|
+
}) : finalTooltip || finalTitle,
|
|
91
|
+
onMouseEnter: handleMouseEnter
|
|
92
|
+
}) : null);
|
|
93
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { DATA_KEY_SIDE_PANEL_ITEM } from '../../const';
|
|
6
|
+
import PanelItem from '../item';
|
|
7
|
+
export default function Items(_ref) {
|
|
8
|
+
var items = _ref.items;
|
|
9
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, items.map(function (v) {
|
|
10
|
+
var _objectSpread2;
|
|
11
|
+
return /*#__PURE__*/React.createElement(PanelItem, _objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, DATA_KEY_SIDE_PANEL_ITEM, v.key), _defineProperty(_objectSpread2, "spm", v.key), _objectSpread2), v));
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { HrBase } from '@alicloud/console-base-theme-sc-base';
|
|
4
|
+
import Flex from '@alicloud/console-base-rc-flex';
|
|
5
|
+
import { SPACING_Y } from '../../const';
|
|
6
|
+
import { useChildren, useItemsBottom, useQuickTop } from '../../../model';
|
|
7
|
+
import Items from '../items';
|
|
8
|
+
import QuickTop from './quick-top';
|
|
9
|
+
var ScHr = styled(HrBase).withConfig({
|
|
10
|
+
componentId: "sc-1rxhuz5-0"
|
|
11
|
+
})(["margin:", "px 4px;"], SPACING_Y);
|
|
12
|
+
export default function ItemsBottom() {
|
|
13
|
+
var quickTop = useQuickTop();
|
|
14
|
+
var children = useChildren();
|
|
15
|
+
var items = useItemsBottom();
|
|
16
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
17
|
+
vertical: true
|
|
18
|
+
}, quickTop.container && quickTop.visible ? /*#__PURE__*/React.createElement(QuickTop, null) : null, children || items.length ? /*#__PURE__*/React.createElement(ScHr, null) : null, children || /*#__PURE__*/React.createElement(Items, {
|
|
19
|
+
items: items
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState, useCallback } from 'react';
|
|
3
|
+
import useMouseEnterLeave from '@alicloud/react-hook-mouse-enter-leave';
|
|
4
|
+
import Icon from '@alicloud/console-base-rc-icon';
|
|
5
|
+
import { useHandleGoTop } from '../../../../model';
|
|
6
|
+
import intl from '../../../intl';
|
|
7
|
+
import { SidePanelItemWrap, SidePanelItemButton, SidePanelItemTooltip } from '../../../rc';
|
|
8
|
+
export default function QuickTop() {
|
|
9
|
+
var handleGoTop = useHandleGoTop();
|
|
10
|
+
var _useState = useState(false),
|
|
11
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
+
stateHovered = _useState2[0],
|
|
13
|
+
setStateHovered = _useState2[1];
|
|
14
|
+
var _useMouseEnterLeave = useMouseEnterLeave(useCallback(function () {
|
|
15
|
+
setStateHovered(true);
|
|
16
|
+
}, [setStateHovered]), useCallback(function () {
|
|
17
|
+
setStateHovered(false);
|
|
18
|
+
}, [setStateHovered])),
|
|
19
|
+
_useMouseEnterLeave2 = _slicedToArray(_useMouseEnterLeave, 2),
|
|
20
|
+
handleMouseEnter = _useMouseEnterLeave2[0],
|
|
21
|
+
handleMouseLeave = _useMouseEnterLeave2[1];
|
|
22
|
+
var title = intl('op:back_to_top');
|
|
23
|
+
return /*#__PURE__*/React.createElement(SidePanelItemWrap, {
|
|
24
|
+
hovered: stateHovered,
|
|
25
|
+
onMouseLeave: handleMouseLeave
|
|
26
|
+
}, /*#__PURE__*/React.createElement(SidePanelItemButton, {
|
|
27
|
+
title: title,
|
|
28
|
+
label: /*#__PURE__*/React.createElement(Icon, {
|
|
29
|
+
type: "go-top"
|
|
30
|
+
}),
|
|
31
|
+
onMouseEnter: handleMouseEnter,
|
|
32
|
+
onClick: handleGoTop
|
|
33
|
+
}), /*#__PURE__*/React.createElement(SidePanelItemTooltip, {
|
|
34
|
+
visible: stateHovered,
|
|
35
|
+
content: title
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Flex from '@alicloud/console-base-rc-flex';
|
|
3
|
+
import { useItemsTop } from '../../../model';
|
|
4
|
+
import Items from '../items';
|
|
5
|
+
export default function ItemsTop() {
|
|
6
|
+
var items = useItemsTop();
|
|
7
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
8
|
+
vertical: true,
|
|
9
|
+
flex: true
|
|
10
|
+
}, /*#__PURE__*/React.createElement(Items, {
|
|
11
|
+
items: items
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default function getValueByStatus(values, hovered, active) {
|
|
2
|
+
var valueNormal = values.valueNormal,
|
|
3
|
+
valueHovered = values.valueHovered,
|
|
4
|
+
valueActive = values.valueActive,
|
|
5
|
+
valueActiveHovered = values.valueActiveHovered;
|
|
6
|
+
if (hovered && active) {
|
|
7
|
+
var _ref;
|
|
8
|
+
return (_ref = valueActiveHovered !== null && valueActiveHovered !== void 0 ? valueActiveHovered : valueActive) !== null && _ref !== void 0 ? _ref : valueNormal;
|
|
9
|
+
}
|
|
10
|
+
if (active) {
|
|
11
|
+
return valueActive !== null && valueActive !== void 0 ? valueActive : valueNormal;
|
|
12
|
+
}
|
|
13
|
+
if (hovered) {
|
|
14
|
+
return valueHovered !== null && valueHovered !== void 0 ? valueHovered : valueNormal;
|
|
15
|
+
}
|
|
16
|
+
return valueNormal;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as getValueByStatus } from './get-value-by-status';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as useChildren } from './use-children';
|
|
2
|
+
export { default as useVisible } from './use-visible';
|
|
3
|
+
export { default as useCollapsed } from './use-collapsed';
|
|
4
|
+
export { default as useItemsTop } from './use-items-top';
|
|
5
|
+
export { default as useItemsBottom } from './use-items-bottom';
|
|
6
|
+
export { default as useQuickTop } from './use-quick-top';
|
|
7
|
+
export { default as useHandleCollapsedChange } from './use-handle-collapsed-change';
|
|
8
|
+
export { default as useHandleGoTop } from './use-handle-go-top';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useCollapsed(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useDispatchSetCollapsed(): (payload: boolean) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useDispatchSetQuickTopVisible(): (payload: boolean) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useEffectQuickTop(): void;
|