@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,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFromIconfontCN = 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
|
+
const icon_1 = require("./icon");
|
|
8
|
+
const util_1 = require("./util");
|
|
9
|
+
// source code from '@ant-design/icons'
|
|
10
|
+
const customCache = new Set();
|
|
11
|
+
function isValidCustomScriptUrl(scriptUrl) {
|
|
12
|
+
return Boolean(typeof scriptUrl === 'string'
|
|
13
|
+
&& scriptUrl.length
|
|
14
|
+
&& !customCache.has(scriptUrl));
|
|
15
|
+
}
|
|
16
|
+
function createScriptUrlElements(scriptUrls, index = 0) {
|
|
17
|
+
const currentScriptUrl = scriptUrls[index];
|
|
18
|
+
if (isValidCustomScriptUrl(currentScriptUrl)) {
|
|
19
|
+
const script = document.createElement('script');
|
|
20
|
+
script.setAttribute('src', currentScriptUrl);
|
|
21
|
+
script.setAttribute('data-namespace', currentScriptUrl);
|
|
22
|
+
if (scriptUrls.length > index + 1) {
|
|
23
|
+
script.onload = () => {
|
|
24
|
+
createScriptUrlElements(scriptUrls, index + 1);
|
|
25
|
+
};
|
|
26
|
+
script.onerror = () => {
|
|
27
|
+
createScriptUrlElements(scriptUrls, index + 1);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
customCache.add(currentScriptUrl);
|
|
31
|
+
document.body.appendChild(script);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const svgBaseProps = {
|
|
35
|
+
width: '1em',
|
|
36
|
+
height: '1em',
|
|
37
|
+
fill: 'currentColor',
|
|
38
|
+
};
|
|
39
|
+
function createFromIconfontCN(options = {}) {
|
|
40
|
+
const { scriptUrl, extraCommonProps = {} } = options;
|
|
41
|
+
/**
|
|
42
|
+
* DOM API required.
|
|
43
|
+
* Make sure in browser environment.
|
|
44
|
+
* The Custom Icon will create a <script/>
|
|
45
|
+
* that loads SVG symbols and insert the SVG Element into the document body.
|
|
46
|
+
*/
|
|
47
|
+
if (scriptUrl &&
|
|
48
|
+
typeof document !== 'undefined' &&
|
|
49
|
+
typeof window !== 'undefined' &&
|
|
50
|
+
typeof document.createElement === 'function') {
|
|
51
|
+
if (Array.isArray(scriptUrl)) {
|
|
52
|
+
// 因为iconfont资源会把svg插入before,所以前加载相同type会覆盖后加载,为了数组覆盖顺序,倒叙插入
|
|
53
|
+
createScriptUrlElements(scriptUrl.reverse());
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
createScriptUrlElements([scriptUrl]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const IconFont = react_1.default.forwardRef((props, ref) => {
|
|
60
|
+
const { icon, children, rotate, anim, fill, className = '' } = props, restProps = (0, tslib_1.__rest)(props, ["icon", "children", "rotate", "anim", "fill", "className"]);
|
|
61
|
+
const iconShapeOptions = { rotate, anim, fill };
|
|
62
|
+
// children > icon
|
|
63
|
+
let content = null;
|
|
64
|
+
if (icon) {
|
|
65
|
+
content = (react_1.default.createElement("svg", Object.assign({}, svgBaseProps, { focusable: 'false' }),
|
|
66
|
+
react_1.default.createElement("use", { xlinkHref: `#${icon}` })));
|
|
67
|
+
}
|
|
68
|
+
if (children) {
|
|
69
|
+
content = children;
|
|
70
|
+
}
|
|
71
|
+
const iconShapeClx = (0, util_1.getIconShapeClxList)(iconShapeOptions);
|
|
72
|
+
return (react_1.default.createElement(icon_1._InternalIcon, Object.assign({}, extraCommonProps, restProps, { className: (0, classnames_1.default)(className, iconShapeClx), ref: ref }), content));
|
|
73
|
+
});
|
|
74
|
+
IconFont.displayName = 'Iconfont';
|
|
75
|
+
return IconFont;
|
|
76
|
+
}
|
|
77
|
+
exports.createFromIconfontCN = createFromIconfontCN;
|
|
78
|
+
//# sourceMappingURL=iconfont-cn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconfont-cn.js","sourceRoot":"","sources":["../../src/icon/iconfont-cn.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,yEAA6B;AAC7B,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ACJ,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;IAElC,OAAO,QAGgB,CAAC;AAC1B,CAAC;AA7DD,oDA6DC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFromIconfontCN = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./icon"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./util"), exports);
|
|
7
|
+
var iconfont_cn_1 = require("./iconfont-cn");
|
|
8
|
+
Object.defineProperty(exports, "createFromIconfontCN", { enumerable: true, get: function () { return iconfont_cn_1.createFromIconfontCN; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/icon/index.ts"],"names":[],"mappings":";;;;AAAA,sDAAuB;AACvB,sDAAuB;AACvB,6CAAqD;AAA5C,mHAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
.kt-icon {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
background-repeat: no-repeat;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
color: var(--kt-icon-foreground);
|
|
6
|
+
line-height: 1;
|
|
7
|
+
|
|
8
|
+
&.mask-mode {
|
|
9
|
+
background-color: var(--foreground);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
&-loading {
|
|
14
|
+
animation: ktIconloadingCircle 1s infinite linear;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-small {
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-large {
|
|
22
|
+
font-size: 16px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
&-clickable {
|
|
27
|
+
&:hover {
|
|
28
|
+
// transform: scale(1.2);
|
|
29
|
+
color: var(--kt-icon-hoverForeground);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:active {
|
|
33
|
+
// transform: scale(1.2);
|
|
34
|
+
color: var(--kt-icon-clickForeground);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&-disabled {
|
|
39
|
+
color: var(--kt-icon-disableForeground);
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
cursor: not-allowed;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@keyframes ktIconloadingCircle {
|
|
46
|
+
100% {
|
|
47
|
+
transform: rotate(360deg)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// Animated Icons
|
|
53
|
+
// --------------------------
|
|
54
|
+
|
|
55
|
+
.iconfont-anim-spin {
|
|
56
|
+
animation: fa-spin 2s infinite linear;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.iconfont-anim-pulse {
|
|
60
|
+
animation: fa-spin 1s infinite steps(8);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes fa-spin {
|
|
64
|
+
0% {
|
|
65
|
+
transform: rotate(0deg);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
100% {
|
|
69
|
+
transform: rotate(360deg);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Rotated & Flipped Icons Mixins
|
|
74
|
+
// -------------------------
|
|
75
|
+
.icon-anim-rotate(@degrees, @rotation) {
|
|
76
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{@rotation})";
|
|
77
|
+
transform: rotate(@degrees);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.icon-anim-flip(@horiz, @vert, @rotation) {
|
|
81
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{@rotation}, mirror=1)";
|
|
82
|
+
transform: scale(@horiz, @vert);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.iconfont-rotate-90 { .icon-anim-rotate(90deg, 1); }
|
|
86
|
+
.iconfont-rotate-180 { .icon-anim-rotate(180deg, 2); }
|
|
87
|
+
.iconfont-rotate-270 { .icon-anim-rotate(270deg, 3); }
|
|
88
|
+
|
|
89
|
+
.iconfont-flip-horizontal { .icon-anim-flip(-1, 1, 0); }
|
|
90
|
+
.iconfont-flip-vertical { .icon-anim-flip(1, -1, 2); }
|
|
91
|
+
.iconfont-flip-both, .iconfont-flip-horizontal.iconfont-flip-vertical { .icon-anim-flip(-1, -1, 2); }
|
|
92
|
+
|
|
93
|
+
// Hook for IE8-9
|
|
94
|
+
// -------------------------
|
|
95
|
+
|
|
96
|
+
:root {
|
|
97
|
+
.iconfont-rotate-90,
|
|
98
|
+
.iconfont-rotate-180,
|
|
99
|
+
.iconfont-rotate-270,
|
|
100
|
+
.iconfont-flip-horizontal,
|
|
101
|
+
.iconfont-flip-vertical,
|
|
102
|
+
.iconfont-flip-both {
|
|
103
|
+
filter: none;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare enum ROTATE_TYPE {
|
|
2
|
+
rotate_90 = 0,
|
|
3
|
+
rotate_180 = 1,
|
|
4
|
+
rotate_270 = 2,
|
|
5
|
+
flip_horizontal = 3,
|
|
6
|
+
flip_vertical = 4,
|
|
7
|
+
flip_both = 5
|
|
8
|
+
}
|
|
9
|
+
export declare enum ANIM_TYPE {
|
|
10
|
+
spin = 0,
|
|
11
|
+
pulse = 1
|
|
12
|
+
}
|
|
13
|
+
export declare function updateKaitianIconMap(prefix: string, customIconMap: {
|
|
14
|
+
[iconKey: string]: string;
|
|
15
|
+
}): void;
|
|
16
|
+
export interface IIconShapeOptions {
|
|
17
|
+
rotate?: ROTATE_TYPE;
|
|
18
|
+
anim?: ANIM_TYPE;
|
|
19
|
+
fill?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function getIconShapeClxList(options?: IIconShapeOptions): string[];
|
|
22
|
+
/**
|
|
23
|
+
* 获取 icon className
|
|
24
|
+
* @param iconKey
|
|
25
|
+
* @param options
|
|
26
|
+
* @return 获取拼接好的 className,如果拿不到则返回空字符串
|
|
27
|
+
*/
|
|
28
|
+
export declare function getKaitianIcon(iconKey: string, options?: IIconShapeOptions): string;
|
|
29
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/icon/util.ts"],"names":[],"mappings":"AAEA,oBAAY,WAAW;IACrB,SAAS,IAAA;IACT,UAAU,IAAA;IACV,UAAU,IAAA;IACV,eAAe,IAAA;IACf,aAAa,IAAA;IACb,SAAS,IAAA;CACV;AAED,oBAAY,SAAS;IACnB,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AAKD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,QAEhG;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAezE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAKnF"}
|
package/lib/icon/util.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getKaitianIcon = exports.getIconShapeClxList = exports.updateKaitianIconMap = exports.ANIM_TYPE = exports.ROTATE_TYPE = void 0;
|
|
4
|
+
const iconManager_1 = require("./iconfont/iconManager");
|
|
5
|
+
var ROTATE_TYPE;
|
|
6
|
+
(function (ROTATE_TYPE) {
|
|
7
|
+
ROTATE_TYPE[ROTATE_TYPE["rotate_90"] = 0] = "rotate_90";
|
|
8
|
+
ROTATE_TYPE[ROTATE_TYPE["rotate_180"] = 1] = "rotate_180";
|
|
9
|
+
ROTATE_TYPE[ROTATE_TYPE["rotate_270"] = 2] = "rotate_270";
|
|
10
|
+
ROTATE_TYPE[ROTATE_TYPE["flip_horizontal"] = 3] = "flip_horizontal";
|
|
11
|
+
ROTATE_TYPE[ROTATE_TYPE["flip_vertical"] = 4] = "flip_vertical";
|
|
12
|
+
ROTATE_TYPE[ROTATE_TYPE["flip_both"] = 5] = "flip_both";
|
|
13
|
+
})(ROTATE_TYPE = exports.ROTATE_TYPE || (exports.ROTATE_TYPE = {}));
|
|
14
|
+
var ANIM_TYPE;
|
|
15
|
+
(function (ANIM_TYPE) {
|
|
16
|
+
ANIM_TYPE[ANIM_TYPE["spin"] = 0] = "spin";
|
|
17
|
+
ANIM_TYPE[ANIM_TYPE["pulse"] = 1] = "pulse";
|
|
18
|
+
})(ANIM_TYPE = exports.ANIM_TYPE || (exports.ANIM_TYPE = {}));
|
|
19
|
+
const ROTATE_CLASS_NAME = ['rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical', 'flip-both'];
|
|
20
|
+
const ANIM_CLASS_NAME = ['spin', 'pulse'];
|
|
21
|
+
function updateKaitianIconMap(prefix, customIconMap) {
|
|
22
|
+
iconManager_1.iconManager.update(prefix, customIconMap);
|
|
23
|
+
}
|
|
24
|
+
exports.updateKaitianIconMap = updateKaitianIconMap;
|
|
25
|
+
function getIconShapeClxList(options) {
|
|
26
|
+
const { rotate, anim, fill } = options || {};
|
|
27
|
+
const iconClassList = [];
|
|
28
|
+
if (rotate !== undefined) {
|
|
29
|
+
iconClassList.push(`iconfont-${ROTATE_CLASS_NAME[rotate]}`);
|
|
30
|
+
}
|
|
31
|
+
if (anim !== undefined) {
|
|
32
|
+
iconClassList.push(`iconfont-anim-${ANIM_CLASS_NAME[anim]}`);
|
|
33
|
+
}
|
|
34
|
+
if (fill) {
|
|
35
|
+
iconClassList.push('toggled');
|
|
36
|
+
}
|
|
37
|
+
return iconClassList;
|
|
38
|
+
}
|
|
39
|
+
exports.getIconShapeClxList = getIconShapeClxList;
|
|
40
|
+
/**
|
|
41
|
+
* 获取 icon className
|
|
42
|
+
* @param iconKey
|
|
43
|
+
* @param options
|
|
44
|
+
* @return 获取拼接好的 className,如果拿不到则返回空字符串
|
|
45
|
+
*/
|
|
46
|
+
function getKaitianIcon(iconKey, options) {
|
|
47
|
+
const iconClassList = iconManager_1.iconManager.getIconClx(iconKey);
|
|
48
|
+
const iconShapeClxList = getIconShapeClxList(options);
|
|
49
|
+
iconClassList.push(...iconShapeClxList);
|
|
50
|
+
return iconClassList.join(' ');
|
|
51
|
+
}
|
|
52
|
+
exports.getKaitianIcon = getKaitianIcon;
|
|
53
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/icon/util.ts"],"names":[],"mappings":";;;AAAA,wDAAqD;AAErD,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,uDAAS,CAAA;IACT,yDAAU,CAAA;IACV,yDAAU,CAAA;IACV,mEAAe,CAAA;IACf,+DAAa,CAAA;IACb,uDAAS,CAAA;AACX,CAAC,EAPW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAOtB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,y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AC;AALD,wCAKC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import './style/index.less';
|
|
2
|
+
export * from './button';
|
|
3
|
+
export * from './badge';
|
|
4
|
+
export * from './input';
|
|
5
|
+
export * from './checkbox';
|
|
6
|
+
export * from './select';
|
|
7
|
+
export * from './tabs';
|
|
8
|
+
export * from './overlay';
|
|
9
|
+
export * from './dialog';
|
|
10
|
+
export * from './icon';
|
|
11
|
+
export * from './notification';
|
|
12
|
+
export * from './popover';
|
|
13
|
+
export * from './message';
|
|
14
|
+
export * from './tooltip';
|
|
15
|
+
export * from './recycle-tree';
|
|
16
|
+
export * from './recycle-list';
|
|
17
|
+
export * from './common';
|
|
18
|
+
export * from './scrollbars';
|
|
19
|
+
export * from './locale-context-provider';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAE5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAE7B,cAAc,2BAA2B,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
require("./style/index.less");
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./button"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./badge"), exports);
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./input"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./checkbox"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./select"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./tabs"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./overlay"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./dialog"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./icon"), exports);
|
|
14
|
+
(0, tslib_1.__exportStar)(require("./notification"), exports);
|
|
15
|
+
(0, tslib_1.__exportStar)(require("./popover"), exports);
|
|
16
|
+
(0, tslib_1.__exportStar)(require("./message"), exports);
|
|
17
|
+
(0, tslib_1.__exportStar)(require("./tooltip"), exports);
|
|
18
|
+
(0, tslib_1.__exportStar)(require("./recycle-tree"), exports);
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./recycle-list"), exports);
|
|
20
|
+
(0, tslib_1.__exportStar)(require("./common"), exports);
|
|
21
|
+
(0, tslib_1.__exportStar)(require("./scrollbars"), exports);
|
|
22
|
+
(0, tslib_1.__exportStar)(require("./locale-context-provider"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,8BAA4B;AAE5B,wDAAyB;AACzB,uDAAwB;AACxB,uDAAwB;AACxB,0DAA2B;AAC3B,wDAAyB;AACzB,sDAAuB;AACvB,yDAA0B;AAC1B,wDAAyB;AACzB,sDAAuB;AACvB,8DAA+B;AAC/B,yDAA0B;AAC1B,yDAA0B;AAC1B,yDAA0B;AAC1B,8DAA+B;AAC/B,8DAA+B;AAC/B,wDAAyB;AACzB,4DAA6B;AAE7B,yEAA0C"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IInputBaseProps } from './Input';
|
|
3
|
+
import { HistoryNavigator } from '@opensumi/monaco-editor-core/esm/vs/base/common/history';
|
|
4
|
+
export interface HistoryInputBoxProp extends IInputBaseProps {
|
|
5
|
+
history?: string[];
|
|
6
|
+
onReady?: (api: IHistoryInputBoxHandler) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface IHistoryInputBoxHandler {
|
|
9
|
+
addToHistory: (v: string) => void;
|
|
10
|
+
getHistory: () => string[];
|
|
11
|
+
clearHistory: () => void;
|
|
12
|
+
getCurrentValue: () => string | null;
|
|
13
|
+
showNextValue: () => void;
|
|
14
|
+
showPreviousValue: () => void;
|
|
15
|
+
focus: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare class HistoryInputBox extends React.Component<HistoryInputBoxProp> {
|
|
18
|
+
private inputRef;
|
|
19
|
+
history: HistoryNavigator<string>;
|
|
20
|
+
inputProps: HistoryInputBoxProp;
|
|
21
|
+
readonly state: {
|
|
22
|
+
inputValue: '';
|
|
23
|
+
};
|
|
24
|
+
componentDidMount(): void;
|
|
25
|
+
addToHistory: (v: string) => void;
|
|
26
|
+
getHistory: () => string[];
|
|
27
|
+
showNextValue: () => void;
|
|
28
|
+
showPreviousValue: () => void;
|
|
29
|
+
clearHistory: () => void;
|
|
30
|
+
getCurrentValue: () => string | null;
|
|
31
|
+
getPreviousValue: () => string | null;
|
|
32
|
+
getNextValue: () => string | null;
|
|
33
|
+
onValueChange: (v: string) => void;
|
|
34
|
+
private onKeyDown;
|
|
35
|
+
private focus;
|
|
36
|
+
render(): JSX.Element;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=HistoryInputBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HistoryInputBox.d.ts","sourceRoot":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AAa,MAAO,MAAM,UAUhC;IAED,OAAO,CAAC,SAAS,CAMhB;IAED,OAAO,CAAC,KAAK,CAIZ;IAEM,MAAM;CAId"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HistoryInputBox = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
6
|
+
const Input_1 = require("./Input");
|
|
7
|
+
const history_1 = require("@opensumi/monaco-editor-core/esm/vs/base/common/history");
|
|
8
|
+
class HistoryInputBox extends react_1.default.Component {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.inputRef = react_1.default.createRef();
|
|
12
|
+
this.addToHistory = (v) => {
|
|
13
|
+
if (this.history && v && v !== this.getCurrentValue()) {
|
|
14
|
+
this.history.add(v);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
this.getHistory = () => {
|
|
18
|
+
return this.history && this.history.getHistory() || [];
|
|
19
|
+
};
|
|
20
|
+
this.showNextValue = () => {
|
|
21
|
+
const value = this.getCurrentValue() || '';
|
|
22
|
+
if (this.history && !this.history.has(value)) {
|
|
23
|
+
this.addToHistory(value);
|
|
24
|
+
}
|
|
25
|
+
let next = this.getNextValue();
|
|
26
|
+
if (next) {
|
|
27
|
+
next = next === value ? this.getNextValue() : next;
|
|
28
|
+
}
|
|
29
|
+
if (next) {
|
|
30
|
+
this.onValueChange(next);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.showPreviousValue = () => {
|
|
34
|
+
const value = this.getCurrentValue() || '';
|
|
35
|
+
if (this.history && !this.history.has(value)) {
|
|
36
|
+
this.addToHistory(value);
|
|
37
|
+
}
|
|
38
|
+
let previous = this.getPreviousValue();
|
|
39
|
+
if (previous) {
|
|
40
|
+
previous = previous === value ? this.getPreviousValue() : previous;
|
|
41
|
+
}
|
|
42
|
+
if (previous) {
|
|
43
|
+
this.onValueChange(previous);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
this.clearHistory = () => {
|
|
47
|
+
this.history && this.history.clear();
|
|
48
|
+
};
|
|
49
|
+
this.getCurrentValue = () => {
|
|
50
|
+
if (!this.history) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
let currentValue = this.history.current();
|
|
54
|
+
if (!currentValue) {
|
|
55
|
+
currentValue = this.history.last();
|
|
56
|
+
this.history.next();
|
|
57
|
+
}
|
|
58
|
+
return currentValue;
|
|
59
|
+
};
|
|
60
|
+
this.getPreviousValue = () => {
|
|
61
|
+
return this.history && (this.history.previous() || this.history.first()) || null;
|
|
62
|
+
};
|
|
63
|
+
this.getNextValue = () => {
|
|
64
|
+
return this.history && (this.history.next() || this.history.last()) || null;
|
|
65
|
+
};
|
|
66
|
+
this.onValueChange = (v) => {
|
|
67
|
+
const { onValueChange } = this.props;
|
|
68
|
+
this.setState({
|
|
69
|
+
inputValue: v,
|
|
70
|
+
});
|
|
71
|
+
if (onValueChange) {
|
|
72
|
+
onValueChange(v);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
this.onKeyDown = (e) => {
|
|
76
|
+
const { onKeyDown } = this.props;
|
|
77
|
+
if (onKeyDown) {
|
|
78
|
+
onKeyDown(e);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
this.focus = () => {
|
|
82
|
+
if (this.inputRef && this.inputRef.current) {
|
|
83
|
+
this.inputRef.current.focus();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
componentDidMount() {
|
|
88
|
+
var _a;
|
|
89
|
+
const { history, onReady } = this.props;
|
|
90
|
+
this.history = new history_1.HistoryNavigator(history || [], 100);
|
|
91
|
+
this.inputProps = Object.assign({}, this.props);
|
|
92
|
+
delete this.inputProps.onReady;
|
|
93
|
+
this.setState({
|
|
94
|
+
inputValue: ((_a = this.props.value) !== null && _a !== void 0 ? _a : this.props.defaultValue) || '',
|
|
95
|
+
});
|
|
96
|
+
if (typeof onReady === 'function') {
|
|
97
|
+
onReady({
|
|
98
|
+
addToHistory: this.addToHistory,
|
|
99
|
+
getHistory: this.getHistory,
|
|
100
|
+
clearHistory: this.clearHistory,
|
|
101
|
+
getCurrentValue: this.getCurrentValue,
|
|
102
|
+
showNextValue: this.showNextValue,
|
|
103
|
+
showPreviousValue: this.showPreviousValue,
|
|
104
|
+
focus: this.focus,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
render() {
|
|
109
|
+
const inputValue = this.state && this.state.inputValue;
|
|
110
|
+
return react_1.default.createElement(Input_1.Input, Object.assign({ ref: this.inputRef }, this.inputProps, { onValueChange: this.onValueChange, onKeyDown: this.onKeyDown, value: inputValue }));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.HistoryInputBox = HistoryInputBox;
|
|
114
|
+
//# sourceMappingURL=HistoryInputBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HistoryInputBox.js","sourceRoot":"","sources":["../../src/input/HistoryInputBox.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,mCAAiD;AACjD,qFAA2F;AAkB3F,MAAa,eAAgB,SAAQ,eAAK,CAAC,SAA8B;IAAzE;;QAEU,aAAQ,GAAG,eAAK,CAAC,SAAS,EAAO,CAAC;QAgCnC,iBAAY,GAAG,CAAC,CAAS,EAAE,EAAE;YAClC,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,eAAe,EAAE,EAAE;gBACrD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACrB;QACH,CAAC,CAAA;QAEM,eAAU,GAAG,GAAa,EAAE;YACjC,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC;Q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EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,IAAG,CAAC;IAC5I,CAAC;CACF;AAnID,0CAmIC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './input.less';
|
|
3
|
+
export interface InputSelection {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
}
|
|
7
|
+
export interface IInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
|
|
8
|
+
className?: string;
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
wrapperStyle?: React.CSSProperties;
|
|
12
|
+
value?: string;
|
|
13
|
+
onValueChange?: (value: string) => void;
|
|
14
|
+
size?: 'default' | 'large' | 'small';
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
selection?: InputSelection;
|
|
17
|
+
addonBefore?: React.ReactNode;
|
|
18
|
+
addonAfter?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* 处理按下 Enter
|
|
21
|
+
*/
|
|
22
|
+
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
23
|
+
/**
|
|
24
|
+
* @default true
|
|
25
|
+
* 保持 focus,即使点击到 addon 部分
|
|
26
|
+
*/
|
|
27
|
+
persistFocus?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @default false
|
|
30
|
+
* 是否展示清空按钮
|
|
31
|
+
*/
|
|
32
|
+
hasClear?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 点击清空之后的回调
|
|
35
|
+
*/
|
|
36
|
+
afterClear?: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated please use `addonAfter` instead
|
|
39
|
+
*/
|
|
40
|
+
controls?: React.ReactNode[];
|
|
41
|
+
}
|
|
42
|
+
export declare const Input: React.ForwardRefExoticComponent<IInputBaseProps & React.RefAttributes<HTMLInputElement>>;
|
|
43
|
+
//# sourceMappingURL=Input.d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