@opensumi/ide-components 2.12.1-next-079c1930
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/README.md +65 -0
- package/dist/index.css +1 -0
- package/dist/index.js +26330 -0
- package/lib/badge/index.d.ts +4 -0
- package/lib/badge/index.d.ts.map +1 -0
- package/lib/badge/index.js +13 -0
- package/lib/badge/index.js.map +1 -0
- package/lib/badge/styles.less +17 -0
- package/lib/button/index.d.ts +54 -0
- package/lib/button/index.d.ts.map +1 -0
- package/lib/button/index.js +68 -0
- package/lib/button/index.js.map +1 -0
- package/lib/button/style.less +251 -0
- package/lib/checkbox/index.d.ts +9 -0
- package/lib/checkbox/index.d.ts.map +1 -0
- package/lib/checkbox/index.js +27 -0
- package/lib/checkbox/index.js.map +1 -0
- package/lib/checkbox/style.less +80 -0
- package/lib/common.d.ts +7 -0
- package/lib/common.d.ts.map +1 -0
- package/lib/common.js +11 -0
- package/lib/common.js.map +1 -0
- package/lib/dialog/index.d.ts +26 -0
- package/lib/dialog/index.d.ts.map +1 -0
- package/lib/dialog/index.js +28 -0
- package/lib/dialog/index.js.map +1 -0
- package/lib/dialog/styles.less +85 -0
- package/lib/dropdown/dropdown.d.ts +48 -0
- package/lib/dropdown/dropdown.d.ts.map +1 -0
- package/lib/dropdown/dropdown.js +80 -0
- package/lib/dropdown/dropdown.js.map +1 -0
- package/lib/dropdown/index.d.ts +5 -0
- package/lib/dropdown/index.d.ts.map +1 -0
- package/lib/dropdown/index.js +8 -0
- package/lib/dropdown/index.js.map +1 -0
- package/lib/dropdown/style.less +254 -0
- package/lib/icon/icon.d.ts +33 -0
- package/lib/icon/icon.d.ts.map +1 -0
- package/lib/icon/icon.js +71 -0
- package/lib/icon/icon.js.map +1 -0
- package/lib/icon/iconfont/iconManager.d.ts +187 -0
- package/lib/icon/iconfont/iconManager.d.ts.map +1 -0
- package/lib/icon/iconfont/iconManager.js +67 -0
- package/lib/icon/iconfont/iconManager.js.map +1 -0
- package/lib/icon/iconfont/iconMap.d.ts +160 -0
- package/lib/icon/iconfont/iconMap.d.ts.map +1 -0
- package/lib/icon/iconfont/iconMap.js +165 -0
- package/lib/icon/iconfont/iconMap.js.map +1 -0
- package/lib/icon/iconfont/iconfont.css +646 -0
- package/lib/icon/iconfont/iconfont.eot +0 -0
- package/lib/icon/iconfont/iconfont.html +1522 -0
- package/lib/icon/iconfont/iconfont.svg +333 -0
- package/lib/icon/iconfont/iconfont.ttf +0 -0
- package/lib/icon/iconfont/iconfont.woff +0 -0
- package/lib/icon/iconfont/iconfont.woff2 +0 -0
- package/lib/icon/iconfont-cn.d.ts +15 -0
- package/lib/icon/iconfont-cn.d.ts.map +1 -0
- package/lib/icon/iconfont-cn.js +78 -0
- package/lib/icon/iconfont-cn.js.map +1 -0
- package/lib/icon/index.d.ts +4 -0
- package/lib/icon/index.d.ts.map +1 -0
- package/lib/icon/index.js +9 -0
- package/lib/icon/index.js.map +1 -0
- package/lib/icon/styles.less +105 -0
- package/lib/icon/util.d.ts +29 -0
- package/lib/icon/util.d.ts.map +1 -0
- package/lib/icon/util.js +53 -0
- package/lib/icon/util.js.map +1 -0
- package/lib/index.d.ts +20 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +23 -0
- package/lib/index.js.map +1 -0
- package/lib/input/HistoryInputBox.d.ts +38 -0
- package/lib/input/HistoryInputBox.d.ts.map +1 -0
- package/lib/input/HistoryInputBox.js +114 -0
- package/lib/input/HistoryInputBox.js.map +1 -0
- package/lib/input/Input.d.ts +43 -0
- package/lib/input/Input.d.ts.map +1 -0
- package/lib/input/Input.js +124 -0
- package/lib/input/Input.js.map +1 -0
- package/lib/input/ProxiedInput.d.ts +8 -0
- package/lib/input/ProxiedInput.d.ts.map +1 -0
- package/lib/input/ProxiedInput.js +67 -0
- package/lib/input/ProxiedInput.js.map +1 -0
- package/lib/input/TextArea.d.ts +6 -0
- package/lib/input/TextArea.d.ts.map +1 -0
- package/lib/input/TextArea.js +11 -0
- package/lib/input/TextArea.js.map +1 -0
- package/lib/input/ValidateInput.d.ts +20 -0
- package/lib/input/ValidateInput.d.ts.map +1 -0
- package/lib/input/ValidateInput.js +59 -0
- package/lib/input/ValidateInput.js.map +1 -0
- package/lib/input/index.d.ts +5 -0
- package/lib/input/index.d.ts.map +1 -0
- package/lib/input/index.js +8 -0
- package/lib/input/index.js.map +1 -0
- package/lib/input/input.less +83 -0
- package/lib/input/validate-input.less +88 -0
- package/lib/locale-context-provider.d.ts +16 -0
- package/lib/locale-context-provider.d.ts.map +1 -0
- package/lib/locale-context-provider.js +26 -0
- package/lib/locale-context-provider.js.map +1 -0
- package/lib/menu/MenuContext.d.ts +8 -0
- package/lib/menu/MenuContext.d.ts.map +1 -0
- package/lib/menu/MenuContext.js +8 -0
- package/lib/menu/MenuContext.js.map +1 -0
- package/lib/menu/MenuItem.d.ts +29 -0
- package/lib/menu/MenuItem.d.ts.map +1 -0
- package/lib/menu/MenuItem.js +32 -0
- package/lib/menu/MenuItem.js.map +1 -0
- package/lib/menu/SubMenu.d.ts +30 -0
- package/lib/menu/SubMenu.d.ts.map +1 -0
- package/lib/menu/SubMenu.js +28 -0
- package/lib/menu/SubMenu.js.map +1 -0
- package/lib/menu/index.d.ts +64 -0
- package/lib/menu/index.d.ts.map +1 -0
- package/lib/menu/index.js +203 -0
- package/lib/menu/index.js.map +1 -0
- package/lib/menu/style.less +513 -0
- package/lib/message/index.d.ts +10 -0
- package/lib/message/index.d.ts.map +1 -0
- package/lib/message/index.js +21 -0
- package/lib/message/index.js.map +1 -0
- package/lib/message/message.d.ts +42 -0
- package/lib/message/message.d.ts.map +1 -0
- package/lib/message/message.js +128 -0
- package/lib/message/message.js.map +1 -0
- package/lib/message/style.less +76 -0
- package/lib/modal/Modal.d.ts +127 -0
- package/lib/modal/Modal.d.ts.map +1 -0
- package/lib/modal/Modal.js +87 -0
- package/lib/modal/Modal.js.map +1 -0
- package/lib/modal/index.d.ts +5 -0
- package/lib/modal/index.d.ts.map +1 -0
- package/lib/modal/index.js +8 -0
- package/lib/modal/index.js.map +1 -0
- package/lib/modal/locale.d.ts +8 -0
- package/lib/modal/locale.d.ts.map +1 -0
- package/lib/modal/locale.js +23 -0
- package/lib/modal/locale.js.map +1 -0
- package/lib/modal/style.less +168 -0
- package/lib/notification/index.d.ts +8 -0
- package/lib/notification/index.d.ts.map +1 -0
- package/lib/notification/index.js +80 -0
- package/lib/notification/index.js.map +1 -0
- package/lib/notification/notification.d.ts +44 -0
- package/lib/notification/notification.d.ts.map +1 -0
- package/lib/notification/notification.js +156 -0
- package/lib/notification/notification.js.map +1 -0
- package/lib/notification/notification.less +231 -0
- package/lib/overlay/index.d.ts +19 -0
- package/lib/overlay/index.d.ts.map +1 -0
- package/lib/overlay/index.js +13 -0
- package/lib/overlay/index.js.map +1 -0
- package/lib/overlay/styles.less +44 -0
- package/lib/popover/index.d.ts +28 -0
- package/lib/popover/index.d.ts.map +1 -0
- package/lib/popover/index.js +127 -0
- package/lib/popover/index.js.map +1 -0
- package/lib/popover/styles.less +135 -0
- package/lib/recycle-list/RecycleList.d.ts +105 -0
- package/lib/recycle-list/RecycleList.d.ts.map +1 -0
- package/lib/recycle-list/RecycleList.js +253 -0
- package/lib/recycle-list/RecycleList.js.map +1 -0
- package/lib/recycle-list/index.d.ts +2 -0
- package/lib/recycle-list/index.d.ts.map +1 -0
- package/lib/recycle-list/index.js +5 -0
- package/lib/recycle-list/index.js.map +1 -0
- package/lib/recycle-tree/RecycleTree.d.ts +254 -0
- package/lib/recycle-tree/RecycleTree.d.ts.map +1 -0
- package/lib/recycle-tree/RecycleTree.js +635 -0
- package/lib/recycle-tree/RecycleTree.js.map +1 -0
- package/lib/recycle-tree/TreeNodeRendererWrap.d.ts +37 -0
- package/lib/recycle-tree/TreeNodeRendererWrap.d.ts.map +1 -0
- package/lib/recycle-tree/TreeNodeRendererWrap.js +18 -0
- package/lib/recycle-tree/TreeNodeRendererWrap.js.map +1 -0
- package/lib/recycle-tree/decorators/Adaptive/index.d.ts +10 -0
- package/lib/recycle-tree/decorators/Adaptive/index.d.ts.map +1 -0
- package/lib/recycle-tree/decorators/Adaptive/index.js +97 -0
- package/lib/recycle-tree/decorators/Adaptive/index.js.map +1 -0
- package/lib/recycle-tree/decorators/Filter/filter.less +11 -0
- package/lib/recycle-tree/decorators/Filter/index.d.ts +26 -0
- package/lib/recycle-tree/decorators/Filter/index.d.ts.map +1 -0
- package/lib/recycle-tree/decorators/Filter/index.js +53 -0
- package/lib/recycle-tree/decorators/Filter/index.js.map +1 -0
- package/lib/recycle-tree/decorators/index.d.ts +3 -0
- package/lib/recycle-tree/decorators/index.d.ts.map +1 -0
- package/lib/recycle-tree/decorators/index.js +6 -0
- package/lib/recycle-tree/decorators/index.js.map +1 -0
- package/lib/recycle-tree/index.d.ts +7 -0
- package/lib/recycle-tree/index.d.ts.map +1 -0
- package/lib/recycle-tree/index.js +10 -0
- package/lib/recycle-tree/index.js.map +1 -0
- package/lib/recycle-tree/prompt/NewPromptHandle.d.ts +12 -0
- package/lib/recycle-tree/prompt/NewPromptHandle.d.ts.map +1 -0
- package/lib/recycle-tree/prompt/NewPromptHandle.js +21 -0
- package/lib/recycle-tree/prompt/NewPromptHandle.js.map +1 -0
- package/lib/recycle-tree/prompt/PromptHandle.d.ts +59 -0
- package/lib/recycle-tree/prompt/PromptHandle.d.ts.map +1 -0
- package/lib/recycle-tree/prompt/PromptHandle.js +200 -0
- package/lib/recycle-tree/prompt/PromptHandle.js.map +1 -0
- package/lib/recycle-tree/prompt/RenamePromptHandle.d.ts +10 -0
- package/lib/recycle-tree/prompt/RenamePromptHandle.d.ts.map +1 -0
- package/lib/recycle-tree/prompt/RenamePromptHandle.js +21 -0
- package/lib/recycle-tree/prompt/RenamePromptHandle.js.map +1 -0
- package/lib/recycle-tree/prompt/index.d.ts +4 -0
- package/lib/recycle-tree/prompt/index.d.ts.map +1 -0
- package/lib/recycle-tree/prompt/index.js +7 -0
- package/lib/recycle-tree/prompt/index.js.map +1 -0
- package/lib/recycle-tree/tree/Tree.d.ts +20 -0
- package/lib/recycle-tree/tree/Tree.d.ts.map +1 -0
- package/lib/recycle-tree/tree/Tree.js +43 -0
- package/lib/recycle-tree/tree/Tree.js.map +1 -0
- package/lib/recycle-tree/tree/TreeNode.d.ts +222 -0
- package/lib/recycle-tree/tree/TreeNode.d.ts.map +1 -0
- package/lib/recycle-tree/tree/TreeNode.js +1099 -0
- package/lib/recycle-tree/tree/TreeNode.js.map +1 -0
- package/lib/recycle-tree/tree/decoration/CompositeDecoration.d.ts +60 -0
- package/lib/recycle-tree/tree/decoration/CompositeDecoration.d.ts.map +1 -0
- package/lib/recycle-tree/tree/decoration/CompositeDecoration.js +328 -0
- package/lib/recycle-tree/tree/decoration/CompositeDecoration.js.map +1 -0
- package/lib/recycle-tree/tree/decoration/Decoration.d.ts +79 -0
- package/lib/recycle-tree/tree/decoration/Decoration.d.ts.map +1 -0
- package/lib/recycle-tree/tree/decoration/Decoration.js +183 -0
- package/lib/recycle-tree/tree/decoration/Decoration.js.map +1 -0
- package/lib/recycle-tree/tree/decoration/DecorationManager.d.ts +34 -0
- package/lib/recycle-tree/tree/decoration/DecorationManager.d.ts.map +1 -0
- package/lib/recycle-tree/tree/decoration/DecorationManager.js +166 -0
- package/lib/recycle-tree/tree/decoration/DecorationManager.js.map +1 -0
- package/lib/recycle-tree/tree/decoration/index.d.ts +4 -0
- package/lib/recycle-tree/tree/decoration/index.d.ts.map +1 -0
- package/lib/recycle-tree/tree/decoration/index.js +7 -0
- package/lib/recycle-tree/tree/decoration/index.js.map +1 -0
- package/lib/recycle-tree/tree/index.d.ts +5 -0
- package/lib/recycle-tree/tree/index.d.ts.map +1 -0
- package/lib/recycle-tree/tree/index.js +8 -0
- package/lib/recycle-tree/tree/index.js.map +1 -0
- package/lib/recycle-tree/tree/model/TreeModel.d.ts +50 -0
- package/lib/recycle-tree/tree/model/TreeModel.d.ts.map +1 -0
- package/lib/recycle-tree/tree/model/TreeModel.js +81 -0
- package/lib/recycle-tree/tree/model/TreeModel.js.map +1 -0
- package/lib/recycle-tree/tree/model/index.d.ts +2 -0
- package/lib/recycle-tree/tree/model/index.d.ts.map +1 -0
- package/lib/recycle-tree/tree/model/index.js +5 -0
- package/lib/recycle-tree/tree/model/index.js.map +1 -0
- package/lib/recycle-tree/tree/model/treeState/TreeStateManager.d.ts +65 -0
- package/lib/recycle-tree/tree/model/treeState/TreeStateManager.d.ts.map +1 -0
- package/lib/recycle-tree/tree/model/treeState/TreeStateManager.js +191 -0
- package/lib/recycle-tree/tree/model/treeState/TreeStateManager.js.map +1 -0
- package/lib/recycle-tree/tree/model/treeState/TreeStateWatcher.d.ts +15 -0
- package/lib/recycle-tree/tree/model/treeState/TreeStateWatcher.d.ts.map +1 -0
- package/lib/recycle-tree/tree/model/treeState/TreeStateWatcher.js +104 -0
- package/lib/recycle-tree/tree/model/treeState/TreeStateWatcher.js.map +1 -0
- package/lib/recycle-tree/tree/model/treeState/index.d.ts +4 -0
- package/lib/recycle-tree/tree/model/treeState/index.d.ts.map +1 -0
- package/lib/recycle-tree/tree/model/treeState/index.js +8 -0
- package/lib/recycle-tree/tree/model/treeState/index.js.map +1 -0
- package/lib/recycle-tree/tree/model/treeState/types.d.ts +21 -0
- package/lib/recycle-tree/tree/model/treeState/types.d.ts.map +1 -0
- package/lib/recycle-tree/tree/model/treeState/types.js +18 -0
- package/lib/recycle-tree/tree/model/treeState/types.js.map +1 -0
- package/lib/recycle-tree/types/index.d.ts +4 -0
- package/lib/recycle-tree/types/index.d.ts.map +1 -0
- package/lib/recycle-tree/types/index.js +7 -0
- package/lib/recycle-tree/types/index.js.map +1 -0
- package/lib/recycle-tree/types/tree-node.d.ts +70 -0
- package/lib/recycle-tree/types/tree-node.d.ts.map +1 -0
- package/lib/recycle-tree/types/tree-node.js +11 -0
- package/lib/recycle-tree/types/tree-node.js.map +1 -0
- package/lib/recycle-tree/types/tree.d.ts +8 -0
- package/lib/recycle-tree/types/tree.d.ts.map +1 -0
- package/lib/recycle-tree/types/tree.js +3 -0
- package/lib/recycle-tree/types/tree.js.map +1 -0
- package/lib/recycle-tree/types/watcher.d.ts +114 -0
- package/lib/recycle-tree/types/watcher.d.ts.map +1 -0
- package/lib/recycle-tree/types/watcher.js +46 -0
- package/lib/recycle-tree/types/watcher.js.map +1 -0
- package/lib/scrollbars/index.d.ts +14 -0
- package/lib/scrollbars/index.d.ts.map +1 -0
- package/lib/scrollbars/index.js +52 -0
- package/lib/scrollbars/index.js.map +1 -0
- package/lib/scrollbars/styles.less +46 -0
- package/lib/select/index.d.ts +119 -0
- package/lib/select/index.d.ts.map +1 -0
- package/lib/select/index.js +327 -0
- package/lib/select/index.js.map +1 -0
- package/lib/select/style.less +224 -0
- package/lib/style/base.less +542 -0
- package/lib/style/index.less +14 -0
- package/lib/style/mixins.less +135 -0
- package/lib/style/motion/fade.less +31 -0
- package/lib/style/motion/move.less +120 -0
- package/lib/style/motion/other.less +45 -0
- package/lib/style/motion/slide.less +120 -0
- package/lib/style/motion/swing.less +34 -0
- package/lib/style/motion/zoom.less +162 -0
- package/lib/style/variable.less +204 -0
- package/lib/tabs/index.d.ts +12 -0
- package/lib/tabs/index.d.ts.map +1 -0
- package/lib/tabs/index.js +24 -0
- package/lib/tabs/index.js.map +1 -0
- package/lib/tabs/style.less +34 -0
- package/lib/tooltip/index.d.ts +7 -0
- package/lib/tooltip/index.d.ts.map +1 -0
- package/lib/tooltip/index.js +58 -0
- package/lib/tooltip/index.js.map +1 -0
- package/lib/tooltip/style.less +41 -0
- package/lib/utils/deprecated.d.ts +3 -0
- package/lib/utils/deprecated.d.ts.map +1 -0
- package/lib/utils/deprecated.js +18 -0
- package/lib/utils/deprecated.js.map +1 -0
- package/lib/utils/disposable.d.ts +37 -0
- package/lib/utils/disposable.d.ts.map +1 -0
- package/lib/utils/disposable.js +140 -0
- package/lib/utils/disposable.js.map +1 -0
- package/lib/utils/event.d.ts +189 -0
- package/lib/utils/event.d.ts.map +1 -0
- package/lib/utils/event.js +569 -0
- package/lib/utils/event.js.map +1 -0
- package/lib/utils/index.d.ts +10 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/iterator.d.ts +14 -0
- package/lib/utils/iterator.d.ts.map +1 -0
- package/lib/utils/iterator.js +9 -0
- package/lib/utils/iterator.js.map +1 -0
- package/lib/utils/linkedList.d.ts +18 -0
- package/lib/utils/linkedList.d.ts.map +1 -0
- package/lib/utils/linkedList.js +139 -0
- package/lib/utils/linkedList.js.map +1 -0
- package/lib/utils/motion.d.ts +24 -0
- package/lib/utils/motion.d.ts.map +1 -0
- package/lib/utils/motion.js +17 -0
- package/lib/utils/motion.js.map +1 -0
- package/lib/utils/os.d.ts +4 -0
- package/lib/utils/os.d.ts.map +1 -0
- package/lib/utils/os.js +22 -0
- package/lib/utils/os.js.map +1 -0
- package/lib/utils/path.d.ts +92 -0
- package/lib/utils/path.d.ts.map +1 -0
- package/lib/utils/path.js +1712 -0
- package/lib/utils/path.js.map +1 -0
- package/lib/utils/process.d.ts +6 -0
- package/lib/utils/process.d.ts.map +1 -0
- package/lib/utils/process.js +17 -0
- package/lib/utils/process.js.map +1 -0
- package/lib/utils/raf.d.ts +10 -0
- package/lib/utils/raf.d.ts.map +1 -0
- package/lib/utils/raf.js +33 -0
- package/lib/utils/raf.js.map +1 -0
- package/lib/utils/type.d.ts +4 -0
- package/lib/utils/type.d.ts.map +1 -0
- package/lib/utils/type.js +9 -0
- package/lib/utils/type.js.map +1 -0
- package/lib/utils/warning.d.ts +8 -0
- package/lib/utils/warning.d.ts.map +1 -0
- package/lib/utils/warning.js +40 -0
- package/lib/utils/warning.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Popover = exports.PopoverPosition = exports.PopoverTriggerType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
6
|
+
const classnames_1 = (0, tslib_1.__importDefault)(require("classnames"));
|
|
7
|
+
require("./styles.less");
|
|
8
|
+
const button_1 = require("../button");
|
|
9
|
+
// 目前支持支持 hover,后面按需拓展
|
|
10
|
+
var PopoverTriggerType;
|
|
11
|
+
(function (PopoverTriggerType) {
|
|
12
|
+
PopoverTriggerType[PopoverTriggerType["hover"] = 0] = "hover";
|
|
13
|
+
PopoverTriggerType[PopoverTriggerType["program"] = 1] = "program";
|
|
14
|
+
})(PopoverTriggerType = exports.PopoverTriggerType || (exports.PopoverTriggerType = {}));
|
|
15
|
+
var PopoverPosition;
|
|
16
|
+
(function (PopoverPosition) {
|
|
17
|
+
PopoverPosition["top"] = "top";
|
|
18
|
+
PopoverPosition["bottom"] = "bottom";
|
|
19
|
+
PopoverPosition["left"] = "left";
|
|
20
|
+
PopoverPosition["right"] = "right";
|
|
21
|
+
})(PopoverPosition = exports.PopoverPosition || (exports.PopoverPosition = {}));
|
|
22
|
+
function noop() { }
|
|
23
|
+
const Popover = (_a) => {
|
|
24
|
+
var { delay, children, trigger, display, id, insertClass, popoverClass, content, position = PopoverPosition.top, title, titleClassName, action, onClickAction } = _a, restProps = (0, tslib_1.__rest)(_a, ["delay", "children", "trigger", "display", "id", "insertClass", "popoverClass", "content", "position", "title", "titleClassName", "action", "onClickAction"]);
|
|
25
|
+
const childEl = react_1.default.useRef(null);
|
|
26
|
+
const contentEl = react_1.default.useRef(null);
|
|
27
|
+
const triggerType = trigger || PopoverTriggerType.hover;
|
|
28
|
+
let hideContentTimer;
|
|
29
|
+
let actionDelayTimer;
|
|
30
|
+
function onMouseEnter() {
|
|
31
|
+
if (triggerType === PopoverTriggerType.hover) {
|
|
32
|
+
if (delay) {
|
|
33
|
+
actionDelayTimer = setTimeout(() => {
|
|
34
|
+
showContent();
|
|
35
|
+
}, delay);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
showContent();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function onMouseLeave() {
|
|
43
|
+
if (triggerType === PopoverTriggerType.hover) {
|
|
44
|
+
clearTimeout(actionDelayTimer);
|
|
45
|
+
hideContent();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function showContent() {
|
|
49
|
+
if (!contentEl.current || !childEl.current) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
clearTimeout(hideContentTimer);
|
|
53
|
+
contentEl.current.style.display = 'block';
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
if (!childEl.current || !contentEl.current) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const { left, top, width, height } = childEl.current.getBoundingClientRect();
|
|
59
|
+
const contentRect = contentEl.current.getBoundingClientRect();
|
|
60
|
+
if (position === PopoverPosition.top) {
|
|
61
|
+
const contentLeft = left - contentRect.width / 2 + width / 2;
|
|
62
|
+
const contentTop = top - contentRect.height - 7;
|
|
63
|
+
contentEl.current.style.left = (contentLeft < 0 ? 0 : contentLeft) + 'px';
|
|
64
|
+
contentEl.current.style.top = (contentTop < 0 ? 0 : contentTop) + 'px';
|
|
65
|
+
contentEl.current.style.visibility = 'visible';
|
|
66
|
+
}
|
|
67
|
+
else if (position === PopoverPosition.bottom) {
|
|
68
|
+
const contentLeft = left - contentRect.width / 2 + width / 2;
|
|
69
|
+
const contentTop = top + height + 7;
|
|
70
|
+
contentEl.current.style.left = (contentLeft < 0 ? 0 : contentLeft) + 'px';
|
|
71
|
+
contentEl.current.style.top = (contentTop < 0 ? 0 : contentTop) + 'px';
|
|
72
|
+
contentEl.current.style.visibility = 'visible';
|
|
73
|
+
}
|
|
74
|
+
else if (position === PopoverPosition.left) {
|
|
75
|
+
const contentLeft = left - contentRect.width - 7;
|
|
76
|
+
const contentTop = top - contentRect.height / 2 + height / 2;
|
|
77
|
+
contentEl.current.style.left = (contentLeft < 0 ? 0 : contentLeft) + 'px';
|
|
78
|
+
contentEl.current.style.top = (contentTop < 0 ? 0 : contentTop) + 'px';
|
|
79
|
+
contentEl.current.style.visibility = 'visible';
|
|
80
|
+
}
|
|
81
|
+
else if (position === PopoverPosition.right) {
|
|
82
|
+
const contentLeft = left + width + 7;
|
|
83
|
+
const contentTop = top - contentRect.height / 2 + height / 2;
|
|
84
|
+
contentEl.current.style.left = (contentLeft < 0 ? 0 : contentLeft) + 'px';
|
|
85
|
+
contentEl.current.style.top = (contentTop < 0 ? 0 : contentTop) + 'px';
|
|
86
|
+
contentEl.current.style.visibility = 'visible';
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function hideContent() {
|
|
91
|
+
if (!contentEl.current) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
hideContentTimer = setTimeout(() => {
|
|
95
|
+
contentEl.current.style.display = 'none';
|
|
96
|
+
}, 500);
|
|
97
|
+
}
|
|
98
|
+
react_1.default.useEffect(() => {
|
|
99
|
+
if (!contentEl.current) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const oldEl = document.body.querySelector(`body > #${id}`);
|
|
103
|
+
if (oldEl) {
|
|
104
|
+
document.body.removeChild(oldEl);
|
|
105
|
+
}
|
|
106
|
+
contentEl.current.style.display = 'none';
|
|
107
|
+
document.body.appendChild(contentEl.current);
|
|
108
|
+
if (display) {
|
|
109
|
+
showContent();
|
|
110
|
+
}
|
|
111
|
+
return () => {
|
|
112
|
+
const oldEl = document.body.querySelector(`body > #${id}`);
|
|
113
|
+
if (oldEl) {
|
|
114
|
+
document.body.removeChild(oldEl);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}, [display]);
|
|
118
|
+
return (react_1.default.createElement("div", Object.assign({}, Object.assign({}, restProps), { className: (0, classnames_1.default)('kt-popover', insertClass), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }),
|
|
119
|
+
react_1.default.createElement("div", { className: (0, classnames_1.default)(popoverClass || '', 'kt-popover-content', `kt-popover-${position}`), ref: contentEl, id: id },
|
|
120
|
+
title && react_1.default.createElement("p", { className: (0, classnames_1.default)('kt-popover-title', titleClassName) },
|
|
121
|
+
title,
|
|
122
|
+
action && react_1.default.createElement(button_1.Button, { size: 'small', type: 'link', onClick: onClickAction || noop }, action)),
|
|
123
|
+
content || ''),
|
|
124
|
+
react_1.default.createElement("span", { ref: childEl }, children)));
|
|
125
|
+
};
|
|
126
|
+
exports.Popover = Popover;
|
|
127
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,yEAA6B;AAE7B,yBAAuB;AACvB,sCAAmC;AAEnC,sBAAsB;AACtB,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,6DAAK,CAAA;IACL,iEAAO,CAAA;AACT,CAAC,EAHW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAG7B;AAED,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,gCAAa,CAAA;IACb,kCAAe,CAAA;AACjB,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B;AAED,SAAS,IAAI,KAAI,CAAC;AAEX,MAAM,OAAO,GAcf,CAAC,EAEL,EAAE,EAAE;QAFC,EACJ,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,GAAG,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,OACxJ,EAD6J,SAAS,2BADjK,6JAEL,CADsK;IAErK,MAAM,OAAO,GAAG,eAAK,CAAC,MAAM,CAAyB,IAAI,CAAC,CAAC;IAC3D,MAAM,SAA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L,MAAM,IAAI,8BAAC,eAAM,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,aAAa,IAAI,IAAI,IAAG,MAAM,CAAU,CAC3F;YACH,OAAO,IAAI,EAAE,CACV;QACN,wCAAM,GAAG,EAAE,OAAO,IACf,QAAQ,CACJ,CACH,CACP,CAAC;AACJ,CAAC,CAAC;AAxIW,QAAA,OAAO,WAwIlB"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
@import '../style/mixins.less';
|
|
2
|
+
|
|
3
|
+
.arrow(@position) {
|
|
4
|
+
& when (@position = 'top'), (@position = 'bottom') {
|
|
5
|
+
&::after {
|
|
6
|
+
position: absolute;
|
|
7
|
+
left: 50%;
|
|
8
|
+
margin-left: -7px;
|
|
9
|
+
content: '';
|
|
10
|
+
width: 0;
|
|
11
|
+
height: 0;
|
|
12
|
+
border: 7px solid transparent;
|
|
13
|
+
}
|
|
14
|
+
&::before {
|
|
15
|
+
content: '';
|
|
16
|
+
position: absolute;
|
|
17
|
+
left: 0;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 15px;
|
|
20
|
+
border-style: solid;
|
|
21
|
+
background: transparent;
|
|
22
|
+
border: 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
& when (@position = 'top') {
|
|
26
|
+
&::after {
|
|
27
|
+
top: 100%;
|
|
28
|
+
border-bottom-width: 0;
|
|
29
|
+
border-top-color: var(--kt-popover-background);
|
|
30
|
+
}
|
|
31
|
+
&::before {
|
|
32
|
+
top: 100%;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
& when (@position = 'bottom') {
|
|
36
|
+
&::after {
|
|
37
|
+
bottom: 100%;
|
|
38
|
+
border-top-width: 0;
|
|
39
|
+
border-bottom-color: var(--kt-popover-background);
|
|
40
|
+
}
|
|
41
|
+
&::before {
|
|
42
|
+
bottom: 100%;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
& when (@position = 'left'), (@position = 'right') {
|
|
47
|
+
&::after {
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 50%;
|
|
50
|
+
transform: translateY(-7px);
|
|
51
|
+
content: '';
|
|
52
|
+
width: 0;
|
|
53
|
+
height: 0;
|
|
54
|
+
border: 7px solid transparent;
|
|
55
|
+
}
|
|
56
|
+
&::before {
|
|
57
|
+
content: '';
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: 0;
|
|
60
|
+
width: 15px;
|
|
61
|
+
height: 100%;
|
|
62
|
+
border-style: solid;
|
|
63
|
+
background: transparent;
|
|
64
|
+
border: 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
& when (@position = 'left') {
|
|
68
|
+
&::after {
|
|
69
|
+
left: 100%;
|
|
70
|
+
border-right-width: 0;
|
|
71
|
+
border-left-color: var(--kt-popover-background);
|
|
72
|
+
}
|
|
73
|
+
&::before {
|
|
74
|
+
left: 100%;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
& when (@position = 'right') {
|
|
78
|
+
&::after {
|
|
79
|
+
right: 100%;
|
|
80
|
+
border-left-width: 0;
|
|
81
|
+
border-right-color: var(--kt-popover-background);
|
|
82
|
+
}
|
|
83
|
+
&::before {
|
|
84
|
+
right: 100%;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.kt-popover {
|
|
90
|
+
position: relative;
|
|
91
|
+
position: relative;
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
align-items: center;
|
|
95
|
+
|
|
96
|
+
&-content {
|
|
97
|
+
display: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&-title {
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: space-between;
|
|
104
|
+
margin-bottom: 4px;
|
|
105
|
+
|
|
106
|
+
&.kt-button, .small-button-size {
|
|
107
|
+
padding: 0px;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&-content {
|
|
112
|
+
position: absolute;
|
|
113
|
+
color: var(--kt-popover-foreground);
|
|
114
|
+
background: var(--kt-popover-background);
|
|
115
|
+
border-color: var(--kt-popover-border);
|
|
116
|
+
border-radius: 2px;
|
|
117
|
+
.overlay-shadow();
|
|
118
|
+
padding: 5px 10px;
|
|
119
|
+
z-index: 10001;
|
|
120
|
+
padding: 16px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&-top {
|
|
124
|
+
.arrow('top');
|
|
125
|
+
}
|
|
126
|
+
&-bottom {
|
|
127
|
+
.arrow('bottom');
|
|
128
|
+
}
|
|
129
|
+
&-left {
|
|
130
|
+
.arrow('left')
|
|
131
|
+
}
|
|
132
|
+
&-right {
|
|
133
|
+
.arrow('right')
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Align } from 'react-window';
|
|
3
|
+
export interface IRecycleListProps {
|
|
4
|
+
/**
|
|
5
|
+
* 容器高度
|
|
6
|
+
* height 计算出可视区域渲染数量
|
|
7
|
+
* @type {number}
|
|
8
|
+
* @memberof RecycleTreeProps
|
|
9
|
+
*/
|
|
10
|
+
height?: number;
|
|
11
|
+
/**
|
|
12
|
+
* 容器宽度
|
|
13
|
+
* height 计算出可视区域渲染数量
|
|
14
|
+
* @type {number}
|
|
15
|
+
* @memberof RecycleTreeProps
|
|
16
|
+
*/
|
|
17
|
+
width?: number;
|
|
18
|
+
/**
|
|
19
|
+
* 最大容器高度
|
|
20
|
+
* 当容器内容高度大于该值时列表将不再增长,而是出现滚动条
|
|
21
|
+
* maxHeight 匹配优先级高于 height 属性
|
|
22
|
+
* @type {number}
|
|
23
|
+
* @memberof RecycleTreeProps
|
|
24
|
+
*/
|
|
25
|
+
maxHeight?: number;
|
|
26
|
+
/**
|
|
27
|
+
* 最小容器高度
|
|
28
|
+
* 当容器内容高度小于该值时将不再收缩,而是固定高度,一般需要配合 maxHeight一起使用
|
|
29
|
+
* maxHeight 匹配优先级高于 height 属性
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof RecycleTreeProps
|
|
32
|
+
*/
|
|
33
|
+
minHeight?: number;
|
|
34
|
+
/**
|
|
35
|
+
* 节点高度
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof RecycleTreeProps
|
|
38
|
+
*/
|
|
39
|
+
itemHeight?: number;
|
|
40
|
+
/**
|
|
41
|
+
* List外部样式
|
|
42
|
+
* @type {React.CSSProperties}
|
|
43
|
+
* @memberof RecycleListProps
|
|
44
|
+
*/
|
|
45
|
+
style?: React.CSSProperties;
|
|
46
|
+
/**
|
|
47
|
+
* List外部样式名
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof RecycleListProps
|
|
50
|
+
*/
|
|
51
|
+
className?: string;
|
|
52
|
+
/**
|
|
53
|
+
* List数据源
|
|
54
|
+
* @type {any[]}
|
|
55
|
+
* @memberof IRecycleListProps
|
|
56
|
+
*/
|
|
57
|
+
data: any[];
|
|
58
|
+
/**
|
|
59
|
+
* 基础数据源渲染模板
|
|
60
|
+
* 默认传入参数为:(data, index) => {}
|
|
61
|
+
* data 为 this.props.data中的子项
|
|
62
|
+
* index 为当前下标
|
|
63
|
+
* @type {React.ComponentType<any>}
|
|
64
|
+
* @memberof IRecycleListProps
|
|
65
|
+
*/
|
|
66
|
+
template: React.ComponentType<any>;
|
|
67
|
+
/**
|
|
68
|
+
* 头部组件渲染模板
|
|
69
|
+
* 默认传入参数为:() => {}
|
|
70
|
+
* @type {React.ComponentType<any>}
|
|
71
|
+
* @memberof IRecycleListProps
|
|
72
|
+
*/
|
|
73
|
+
header?: React.ComponentType<any>;
|
|
74
|
+
/**
|
|
75
|
+
* 底部组件渲染模板
|
|
76
|
+
* 默认传入参数为:() => {}
|
|
77
|
+
* @type {React.ComponentType<any>}
|
|
78
|
+
* @memberof IRecycleListProps
|
|
79
|
+
*/
|
|
80
|
+
footer?: React.ComponentType<any>;
|
|
81
|
+
/**
|
|
82
|
+
* List 底部边距大小,默认值为 0
|
|
83
|
+
* @type {React.ComponentType<any>}
|
|
84
|
+
* @memberof IRecycleListProps
|
|
85
|
+
*/
|
|
86
|
+
paddingBottomSize?: number;
|
|
87
|
+
/**
|
|
88
|
+
* 处理 RecycleList API回调
|
|
89
|
+
* @memberof IRecycleListProps
|
|
90
|
+
*/
|
|
91
|
+
onReady?: (api: IRecycleListHandler) => void;
|
|
92
|
+
/**
|
|
93
|
+
* 如果为不定高 Item 时可以指定动态获取 item Size
|
|
94
|
+
* https://react-window.vercel.app/#/examples/list/variable-size
|
|
95
|
+
*/
|
|
96
|
+
getSize?: (index: number) => number;
|
|
97
|
+
}
|
|
98
|
+
export interface IRecycleListHandler {
|
|
99
|
+
scrollTo: (offset: number) => void;
|
|
100
|
+
scrollToIndex: (index: number, position?: Align) => void;
|
|
101
|
+
}
|
|
102
|
+
export declare const RECYCLE_LIST_STABILIZATION_TIME: number;
|
|
103
|
+
export declare const RECYCLE_LIST_OVER_SCAN_COUNT: number;
|
|
104
|
+
export declare const RecycleList: React.FC<IRecycleListProps>;
|
|
105
|
+
//# sourceMappingURL=RecycleList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecycleList.d.ts","sourceRoot":"","sources":["../../src/recycle-list/RecycleList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAmC,KAAK,EAAE,MAAM,cAAc,CAAC;AAKtE,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACnC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAClC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAClC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,+BAA+B,EAAE,MAAY,CAAC;AAC3D,eAAO,MAAM,4BAA4B,EAAE,MAAW,CAAC;AAEvD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2SnD,CAAC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RecycleList = exports.RECYCLE_LIST_OVER_SCAN_COUNT = exports.RECYCLE_LIST_STABILIZATION_TIME = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
6
|
+
const react_window_1 = require("react-window");
|
|
7
|
+
const scrollbars_1 = require("../scrollbars");
|
|
8
|
+
const react_virtualized_auto_sizer_1 = (0, tslib_1.__importDefault)(require("react-virtualized-auto-sizer"));
|
|
9
|
+
const classnames_1 = (0, tslib_1.__importDefault)(require("classnames"));
|
|
10
|
+
exports.RECYCLE_LIST_STABILIZATION_TIME = 500;
|
|
11
|
+
exports.RECYCLE_LIST_OVER_SCAN_COUNT = 50;
|
|
12
|
+
const RecycleList = ({ width, height, maxHeight, minHeight, className, style, data, onReady, itemHeight, header: Header, footer: Footer, template: Template, paddingBottomSize, getSize: customGetSize, }) => {
|
|
13
|
+
const listRef = react_1.default.useRef();
|
|
14
|
+
const sizeMap = react_1.default.useRef({});
|
|
15
|
+
const scrollToIndexTimer = react_1.default.useRef();
|
|
16
|
+
react_1.default.useEffect(() => {
|
|
17
|
+
if (typeof onReady === 'function') {
|
|
18
|
+
const api = {
|
|
19
|
+
scrollTo: (offset) => {
|
|
20
|
+
var _a;
|
|
21
|
+
(_a = listRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(offset);
|
|
22
|
+
},
|
|
23
|
+
// custom alignment: center, start, or end
|
|
24
|
+
scrollToIndex: (index, position = 'start') => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
let locationIndex = index;
|
|
27
|
+
if (!!Header) {
|
|
28
|
+
locationIndex++;
|
|
29
|
+
}
|
|
30
|
+
if (typeof itemHeight === 'number') {
|
|
31
|
+
(_a = listRef.current) === null || _a === void 0 ? void 0 : _a.scrollToItem(locationIndex, position);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
if (scrollToIndexTimer.current) {
|
|
35
|
+
clearTimeout(scrollToIndexTimer.current);
|
|
36
|
+
}
|
|
37
|
+
const keys = sizeMap.current ? Object.keys(sizeMap.current) : [];
|
|
38
|
+
const offset = keys.slice(0, locationIndex).reduce((p, i) => p + getSize(i), 0);
|
|
39
|
+
(_b = listRef.current) === null || _b === void 0 ? void 0 : _b.scrollToItem(index, position);
|
|
40
|
+
// 在动态列表情况下,由于渲染抖动问题,可能需要再渲染后尝试再进行一次滚动位置定位
|
|
41
|
+
scrollToIndexTimer.current = setTimeout(() => {
|
|
42
|
+
var _a;
|
|
43
|
+
const keys = sizeMap.current ? Object.keys(sizeMap.current) : [];
|
|
44
|
+
const nextOffset = keys.slice(0, locationIndex).reduce((p, i) => p + getSize(i), 0);
|
|
45
|
+
if (nextOffset !== offset) {
|
|
46
|
+
(_a = listRef.current) === null || _a === void 0 ? void 0 : _a.scrollToItem(index, position);
|
|
47
|
+
}
|
|
48
|
+
scrollToIndexTimer.current = null;
|
|
49
|
+
}, exports.RECYCLE_LIST_STABILIZATION_TIME);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
onReady(api);
|
|
54
|
+
}
|
|
55
|
+
}, []);
|
|
56
|
+
const setSize = (index, size) => {
|
|
57
|
+
var _a;
|
|
58
|
+
if (sizeMap.current[index] !== size) {
|
|
59
|
+
sizeMap.current = Object.assign(Object.assign({}, sizeMap.current), { [index]: size });
|
|
60
|
+
if (listRef.current) {
|
|
61
|
+
// 清理缓存数据并重新渲染
|
|
62
|
+
(_a = listRef.current) === null || _a === void 0 ? void 0 : _a.resetAfterIndex(0);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const getSize = react_1.default.useCallback((index) => {
|
|
67
|
+
if (customGetSize) {
|
|
68
|
+
return customGetSize(Number(index));
|
|
69
|
+
}
|
|
70
|
+
return ((sizeMap === null || sizeMap === void 0 ? void 0 : sizeMap.current) || [])[index] || itemHeight || 100;
|
|
71
|
+
}, [itemHeight, customGetSize]);
|
|
72
|
+
const getMaxListHeight = react_1.default.useCallback(() => {
|
|
73
|
+
if (maxHeight) {
|
|
74
|
+
let height = 0;
|
|
75
|
+
for (let i = 0; i < data.length; i++) {
|
|
76
|
+
height += getSize(i);
|
|
77
|
+
}
|
|
78
|
+
if (height > maxHeight) {
|
|
79
|
+
return maxHeight;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
return height;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, [maxHeight, data]);
|
|
86
|
+
const getMinListHeight = react_1.default.useCallback(() => {
|
|
87
|
+
if (minHeight) {
|
|
88
|
+
return minHeight;
|
|
89
|
+
}
|
|
90
|
+
}, [minHeight, data]);
|
|
91
|
+
const adjustedRowCount = react_1.default.useMemo(() => {
|
|
92
|
+
let count = data.length;
|
|
93
|
+
if (!!Header) {
|
|
94
|
+
count++;
|
|
95
|
+
}
|
|
96
|
+
if (!!Footer) {
|
|
97
|
+
count++;
|
|
98
|
+
}
|
|
99
|
+
return count;
|
|
100
|
+
}, [data]);
|
|
101
|
+
const renderItem = ({ index, style }) => {
|
|
102
|
+
let node;
|
|
103
|
+
if (index === 0) {
|
|
104
|
+
if (Header) {
|
|
105
|
+
return react_1.default.createElement("div", { style: style },
|
|
106
|
+
react_1.default.createElement(Header, null));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if ((index + 1) === adjustedRowCount) {
|
|
110
|
+
if (!!Footer) {
|
|
111
|
+
return react_1.default.createElement("div", { style: style },
|
|
112
|
+
react_1.default.createElement(Footer, null));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (!!Header) {
|
|
116
|
+
node = data[index - 1];
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
node = data[index];
|
|
120
|
+
}
|
|
121
|
+
if (!node) {
|
|
122
|
+
return react_1.default.createElement("div", { style: style });
|
|
123
|
+
}
|
|
124
|
+
// ref: https://developers.google.com/web/fundamentals/accessibility/semantics-aria/aria-labels-and-relationships
|
|
125
|
+
const ariaInfo = {
|
|
126
|
+
'aria-setsize': adjustedRowCount,
|
|
127
|
+
'aria-posinset': index,
|
|
128
|
+
};
|
|
129
|
+
return react_1.default.createElement("div", Object.assign({ style: style, role: 'listitem' }, ariaInfo),
|
|
130
|
+
react_1.default.createElement(Template, { data: node, index: index }));
|
|
131
|
+
};
|
|
132
|
+
const renderDynamicItem = ({ index, style }) => {
|
|
133
|
+
const rowRoot = react_1.default.useRef(null);
|
|
134
|
+
const observer = react_1.default.useRef();
|
|
135
|
+
const setItemSize = () => {
|
|
136
|
+
if (rowRoot.current) {
|
|
137
|
+
let height = 0;
|
|
138
|
+
// tslint:disable-next-line:prefer-for-of
|
|
139
|
+
for (let i = 0; i < rowRoot.current.children.length; i++) {
|
|
140
|
+
height += rowRoot.current.children[i].getBoundingClientRect().height;
|
|
141
|
+
}
|
|
142
|
+
setSize(index, height);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
react_1.default.useEffect(() => {
|
|
146
|
+
if (rowRoot.current && listRef.current) {
|
|
147
|
+
observer.current = new MutationObserver((mutations, observer) => {
|
|
148
|
+
setItemSize();
|
|
149
|
+
});
|
|
150
|
+
const observerOption = {
|
|
151
|
+
childList: true,
|
|
152
|
+
attributes: true,
|
|
153
|
+
characterData: true,
|
|
154
|
+
attributeFilter: ['class', 'style'],
|
|
155
|
+
attributeOldValue: true,
|
|
156
|
+
characterDataOldValue: true, // 观察 characterData 变动,是否需要记录变动前的值
|
|
157
|
+
};
|
|
158
|
+
// 监听子节点属性变化
|
|
159
|
+
observer.current.observe(rowRoot.current, observerOption);
|
|
160
|
+
setItemSize();
|
|
161
|
+
}
|
|
162
|
+
return () => {
|
|
163
|
+
observer.current.disconnect();
|
|
164
|
+
};
|
|
165
|
+
}, [rowRoot.current]);
|
|
166
|
+
let node;
|
|
167
|
+
if (index === 0) {
|
|
168
|
+
if (Header) {
|
|
169
|
+
return react_1.default.createElement("div", { style: style },
|
|
170
|
+
react_1.default.createElement(Header, null));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if ((index + 1) === adjustedRowCount) {
|
|
174
|
+
if (!!Footer) {
|
|
175
|
+
return react_1.default.createElement("div", { style: style },
|
|
176
|
+
react_1.default.createElement(Footer, null));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (!!Header) {
|
|
180
|
+
node = data[index - 1];
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
node = data[index];
|
|
184
|
+
}
|
|
185
|
+
if (!node) {
|
|
186
|
+
return react_1.default.createElement("div", { style: style });
|
|
187
|
+
}
|
|
188
|
+
return react_1.default.createElement("div", { style: style, ref: rowRoot },
|
|
189
|
+
react_1.default.createElement(Template, { data: node, index: index }));
|
|
190
|
+
};
|
|
191
|
+
const getItemKey = (index) => {
|
|
192
|
+
const node = data[index];
|
|
193
|
+
if (node && node.id) {
|
|
194
|
+
return node.id;
|
|
195
|
+
}
|
|
196
|
+
return index;
|
|
197
|
+
};
|
|
198
|
+
// 通过计算平均行高来提高准确性
|
|
199
|
+
// 修复滚动条行为,见: https://github.com/bvaughn/react-window/issues/408
|
|
200
|
+
const calcEstimatedSize = react_1.default.useMemo(() => {
|
|
201
|
+
const estimatedHeight = data.reduce((p, i) => p + getSize(i), 0);
|
|
202
|
+
return estimatedHeight / data.length;
|
|
203
|
+
}, [data]);
|
|
204
|
+
// 为 List 添加下边距
|
|
205
|
+
const InnerElementType = react_1.default.forwardRef((props, ref) => {
|
|
206
|
+
const _a = props, { style } = _a, rest = (0, tslib_1.__rest)(_a, ["style"]);
|
|
207
|
+
return react_1.default.createElement("div", Object.assign({ ref: ref, style: Object.assign(Object.assign({}, style), { height: `${parseFloat(style.height) + (paddingBottomSize ? paddingBottomSize : 0)}px` }) }, rest));
|
|
208
|
+
});
|
|
209
|
+
const render = () => {
|
|
210
|
+
const isDynamicList = typeof itemHeight !== 'number';
|
|
211
|
+
const isAutoSizeList = !width || !height;
|
|
212
|
+
const renderList = () => {
|
|
213
|
+
let List;
|
|
214
|
+
if (!isDynamicList) {
|
|
215
|
+
List = react_window_1.FixedSizeList;
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
List = react_window_1.VariableSizeList;
|
|
219
|
+
}
|
|
220
|
+
const renderContent = ({ width, height }) => {
|
|
221
|
+
const maxH = getMaxListHeight();
|
|
222
|
+
const minH = getMinListHeight();
|
|
223
|
+
let currentHeight = height;
|
|
224
|
+
if (minH) {
|
|
225
|
+
currentHeight = Math.min(height, minH);
|
|
226
|
+
}
|
|
227
|
+
else if (maxH) {
|
|
228
|
+
currentHeight = maxH;
|
|
229
|
+
}
|
|
230
|
+
if (isDynamicList) {
|
|
231
|
+
return react_1.default.createElement(List, { width: width, height: currentHeight,
|
|
232
|
+
// 这里的数据不是必要的,主要用于在每次更新列表
|
|
233
|
+
itemData: [], itemSize: getSize, itemCount: adjustedRowCount, getItemKey: getItemKey, overscanCount: exports.RECYCLE_LIST_OVER_SCAN_COUNT, ref: listRef, style: Object.assign({ transform: 'translate3d(0px, 0px, 0px)' }, style), className: (0, classnames_1.default)(className, 'kt-recycle-list'), innerElementType: InnerElementType, outerElementType: scrollbars_1.ScrollbarsVirtualList, estimatedItemSize: calcEstimatedSize }, renderDynamicItem);
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
return react_1.default.createElement(List, { width: width, height: currentHeight,
|
|
237
|
+
// 这里的数据不是必要的,主要用于在每次更新列表
|
|
238
|
+
itemData: [], itemSize: itemHeight, itemCount: adjustedRowCount, getItemKey: getItemKey, overscanCount: exports.RECYCLE_LIST_OVER_SCAN_COUNT, ref: listRef, style: Object.assign({ transform: 'translate3d(0px, 0px, 0px)' }, style), className: (0, classnames_1.default)(className, 'kt-recycle-list'), innerElementType: InnerElementType, outerElementType: scrollbars_1.ScrollbarsVirtualList }, renderItem);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
if (!isAutoSizeList) {
|
|
242
|
+
return renderContent({ width, height });
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
return react_1.default.createElement(react_virtualized_auto_sizer_1.default, null, renderContent);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
return renderList();
|
|
249
|
+
};
|
|
250
|
+
return render();
|
|
251
|
+
};
|
|
252
|
+
exports.RecycleList = RecycleList;
|
|
253
|
+
//# sourceMappingURL=RecycleList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecycleList.js","sourceRoot":"","sources":["../../src/recycle-list/RecycleList.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,+CAAsE;AACtE,8CAAsD;AACtD,6GAAqD;AACrD,yEAA6B;AAuGhB,QAAA,+BAA+B,GAAW,GAAG,CAAC;AAC9C,QAAA,4BAA4B,GAAW,EAAE,CAAC;AAEhD,MAAM,WAAW,GAAgC,CAAC,EACvD,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAa,GAChL,EAAE,EAAE;IAEH,MAAM,OAAO,GAAG,eAAK,CAAC,MAAM,EAAoC,CAAC;IACjE,MAAM,OAAO,GAAG,eAAK,CAAC,MAAM,CAA4B,EAAE,CAAC,CAAC;IAC5D,MAAM,kBAAkB,GAAG,eAAK,CAAC,MAAM,EAAO,CAAC;IAE/C,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;YACjC,MAAM,GAAG,GAAG;gBACV,QAAQ,EAAE,CAAC,MAAc,EAAE,EAAE;;oBAC3B,MAAA,OAAO,CAAC,OAAO,0CAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACpC,CAAC;gBACD,0CAA0C;gBAC1C,aAAa,EAAE,CAAC,KAAa,EAAE,WAAkB,OAAO,EAAE,EAAE;;oBAC1D,IAAI,aAAa,GAAG,KAAK,CAAC;oBAC1B,IAAI,CAAC,CAAC,MAAM,EAAE;wBAC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kBACH,SAAS,EAAE,4BAA4B,IACpC,KAAK,GAEV,SAAS,EAAE,IAAA,oBAAG,EAAC,SAAS,EAAE,iBAAiB,CAAC,EAC5C,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,kCAAqB,IACtC,UAAU,CACN,CAAC;iBACT;YACH,CAAC,CAAC;YAEF,IAAI,CAAC,cAAc,EAAE;gBACnB,OAAO,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;aACzC;iBAAM;gBACL,OAAO,8BAAC,sCAAS,QACd,aAAa,CACJ,CAAC;aACd;QACH,CAAC,CAAC;QAEF,OAAO,UAAU,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,MAAM,EAAE,CAAC;AAClB,CAAC,CAAC;AA3SW,QAAA,WAAW,eA2StB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recycle-list/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recycle-list/index.ts"],"names":[],"mappings":";;;AAAA,6DAA8B"}
|