@jetlinks-web/components 2.7.0 → 3.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/es/AutoComplete/AutoComplete.js +2 -3
- package/es/BadgeStatus/Badge.js +2 -3
- package/es/CardSelect/CardSelect.js +23 -18
- package/es/CardSelect/style/index.js +25 -1
- package/es/CheckButton/CheckButton.js +12 -4
- package/es/CheckButton/style/index.js +41 -1
- package/es/ConfigProvider/index.js +1 -1
- package/es/DragModal/DragModal.js +15 -9
- package/es/DragModal/style/index.js +64 -1
- package/es/EditTable/Body.js +10 -3
- package/es/EditTable/EditTable.js +14 -8
- package/es/EditTable/FormItem.js +15 -10
- package/es/EditTable/Header.js +16 -6
- package/es/EditTable/components/ContextMenu/Menu.js +12 -6
- package/es/EditTable/components/Search/search.js +1 -2
- package/es/EditTable/components/Search/sort.js +1 -3
- package/es/EditTable/group.js +24 -19
- package/es/EditTable/hooks/useValidate.js +1 -1
- package/es/EditTable/style/body.js +53 -0
- package/es/EditTable/style/form.js +24 -0
- package/es/EditTable/style/group.js +25 -0
- package/es/EditTable/style/header.js +58 -0
- package/es/EditTable/style/index.js +42 -1
- package/es/EditTable/style/menu.js +27 -0
- package/es/EditTable/style/table.js +46 -0
- package/es/EditTable/utils.js +1 -1
- package/es/Ellipsis/Ellipsis.js +11 -3
- package/es/Ellipsis/style/index.js +24 -1
- package/es/Empty/Empty.js +1 -1
- package/es/FullPage/FullPage.js +1 -2
- package/es/LocaleProvider/index.js +1 -2
- package/es/PermissionButton/index.js +4 -5
- package/es/ProLayout/Basic/BasicLayout.js +46 -42
- package/es/ProLayout/Basic/BasicLayoutStyle.js +39 -0
- package/es/ProLayout/Basic/Header.js +4 -8
- package/es/ProLayout/Basic/HeaderStyle.js +10 -0
- package/es/ProLayout/PageContainer/index.js +20 -16
- package/es/ProLayout/PageContainer/style.js +46 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +14 -37
- package/es/ProLayout/SiderMenu/SiderMenu.js +25 -36
- package/es/ProLayout/SiderMenu/style.js +166 -0
- package/es/ProLayout/TopHeader/index.js +12 -11
- package/es/ProLayout/TopHeader/style.js +126 -0
- package/es/ProLayout/style/index.js +7 -1
- package/es/ProLayout/util.js +5 -5
- package/es/ProTable/Alert.js +13 -5
- package/es/ProTable/Content.js +22 -14
- package/es/ProTable/Header.js +22 -12
- package/es/ProTable/Pagination.js +13 -5
- package/es/ProTable/ProTable.js +43 -27
- package/es/ProTable/setting.js +1 -1
- package/es/ProTable/style/index.js +109 -1
- package/es/RadioButton/RadioButton.js +10 -4
- package/es/RadioButton/style/index.js +23 -1
- package/es/Scrollbar/Scrollbar.js +10 -3
- package/es/Scrollbar/Thumb.js +36 -25
- package/es/Scrollbar/style/index.js +63 -1
- package/es/Search/Advanced/History.js +24 -17
- package/es/Search/Advanced/SaveHistory.js +2 -3
- package/es/Search/Advanced/index.js +213 -293
- package/es/Search/Item.js +175 -415
- package/es/Search/Search.js +78 -172
- package/es/Search/hooks/index.js +108 -1
- package/es/Search/hooks/useRouteQuery.js +57 -0
- package/es/Search/setting.js +132 -14
- package/es/Search/style/index.js +4 -2
- package/es/Search/style/item.js +28 -0
- package/es/Search/style/search.js +133 -0
- package/es/Search/util.js +116 -124
- package/es/Skeleton/components/DashBoardCard.js +64 -0
- package/es/Skeleton/components/DashBoardChart.js +96 -0
- package/es/Skeleton/components/Detail.js +110 -0
- package/es/Skeleton/components/Drawer.js +91 -0
- package/es/Skeleton/components/Item.js +68 -0
- package/es/Skeleton/components/List.js +45 -0
- package/es/Skeleton/components/ListCard.js +63 -0
- package/es/Skeleton/components/ListCardItem.js +86 -0
- package/es/Skeleton/components/ListTable.js +76 -0
- package/es/Skeleton/components/Page.js +62 -0
- package/es/Skeleton/components/Search.js +54 -0
- package/es/Skeleton/components/Tree.js +72 -0
- package/es/Skeleton/index.js +15 -0
- package/es/Skeleton/skeleton.js +58 -0
- package/es/Skeleton/style/index.js +132 -0
- package/es/Title/style/index.js +29 -1
- package/es/Title/title.js +13 -5
- package/es/ValueItem/ValueItem.js +29 -72
- package/es/components.js +0 -3
- package/es/locale/en-US.js +0 -7
- package/es/locale/zh-CN.js +0 -7
- package/es/style/index.js +0 -3
- package/es/style/styleRegister.js +21 -0
- package/es/style/variable.js +4 -0
- package/es/style.js +0 -12
- package/lib/AutoComplete/AutoComplete.js +1 -2
- package/lib/BadgeStatus/Badge.js +2 -3
- package/lib/CardSelect/CardSelect.js +23 -18
- package/lib/CardSelect/style/index.js +30 -1
- package/lib/CheckButton/CheckButton.js +12 -4
- package/lib/CheckButton/style/index.js +46 -1
- package/lib/ConfigProvider/context.js +1 -1
- package/lib/ConfigProvider/index.js +3 -3
- package/lib/DragModal/DragModal.js +15 -9
- package/lib/DragModal/style/index.js +69 -1
- package/lib/EditTable/Body.js +10 -3
- package/lib/EditTable/EditTable.js +13 -7
- package/lib/EditTable/FormItem.js +16 -11
- package/lib/EditTable/Header.js +16 -6
- package/lib/EditTable/components/ContextMenu/Menu.js +12 -6
- package/lib/EditTable/components/Search/search.js +1 -2
- package/lib/EditTable/components/Search/sort.js +1 -3
- package/lib/EditTable/group.js +24 -19
- package/lib/EditTable/hooks/useValidate.js +1 -1
- package/lib/EditTable/style/body.js +60 -0
- package/lib/EditTable/style/form.js +31 -0
- package/lib/EditTable/style/group.js +32 -0
- package/lib/EditTable/style/header.js +65 -0
- package/lib/EditTable/style/index.js +47 -1
- package/lib/EditTable/style/menu.js +33 -0
- package/lib/EditTable/style/table.js +52 -0
- package/lib/EditTable/utils.js +1 -1
- package/lib/Ellipsis/Ellipsis.js +11 -3
- package/lib/Ellipsis/style/index.js +29 -1
- package/lib/Empty/Empty.js +1 -1
- package/lib/FullPage/FullPage.js +1 -2
- package/lib/LocaleProvider/index.js +1 -2
- package/lib/PermissionButton/index.js +9 -10
- package/lib/ProLayout/Basic/BasicLayout.js +55 -51
- package/lib/ProLayout/Basic/BasicLayoutStyle.js +46 -0
- package/lib/ProLayout/Basic/Header.js +6 -10
- package/lib/ProLayout/Basic/HeaderStyle.js +17 -0
- package/lib/ProLayout/PageContainer/index.js +24 -20
- package/lib/ProLayout/PageContainer/style.js +53 -0
- package/lib/ProLayout/SiderMenu/BaseMenu.js +18 -40
- package/lib/ProLayout/SiderMenu/SiderMenu.js +28 -39
- package/lib/ProLayout/SiderMenu/style.js +173 -0
- package/lib/ProLayout/TopHeader/index.js +12 -10
- package/lib/ProLayout/TopHeader/style.js +133 -0
- package/lib/ProLayout/defaultSettings.js +1 -1
- package/lib/ProLayout/style/index.js +12 -1
- package/lib/ProLayout/util.js +5 -5
- package/lib/ProTable/Alert.js +13 -5
- package/lib/ProTable/Content.js +22 -14
- package/lib/ProTable/Header.js +22 -12
- package/lib/ProTable/Pagination.js +13 -5
- package/lib/ProTable/ProTable.js +43 -27
- package/lib/ProTable/setting.js +3 -3
- package/lib/ProTable/style/index.js +114 -1
- package/lib/RadioButton/RadioButton.js +10 -4
- package/lib/RadioButton/style/index.js +28 -1
- package/lib/Scrollbar/Scrollbar.js +10 -3
- package/lib/Scrollbar/Thumb.js +36 -25
- package/lib/Scrollbar/style/index.js +68 -1
- package/lib/Search/Advanced/History.js +24 -17
- package/lib/Search/Advanced/SaveHistory.js +2 -3
- package/lib/Search/Advanced/index.js +213 -293
- package/lib/Search/Item.js +175 -415
- package/lib/Search/Search.js +78 -172
- package/lib/Search/hooks/index.js +130 -1
- package/lib/Search/hooks/useRouteQuery.js +64 -0
- package/lib/Search/setting.js +133 -15
- package/lib/Search/style/index.js +9 -2
- package/lib/Search/style/item.js +35 -0
- package/lib/Search/style/search.js +140 -0
- package/lib/Search/util.js +116 -124
- package/lib/Skeleton/components/DashBoardCard.js +64 -0
- package/lib/Skeleton/components/DashBoardChart.js +96 -0
- package/lib/Skeleton/components/Detail.js +110 -0
- package/lib/Skeleton/components/Drawer.js +91 -0
- package/lib/Skeleton/components/Item.js +68 -0
- package/lib/Skeleton/components/List.js +45 -0
- package/lib/Skeleton/components/ListCard.js +63 -0
- package/lib/Skeleton/components/ListCardItem.js +86 -0
- package/lib/Skeleton/components/ListTable.js +76 -0
- package/lib/Skeleton/components/Page.js +62 -0
- package/lib/Skeleton/components/Search.js +54 -0
- package/lib/Skeleton/components/Tree.js +72 -0
- package/lib/Skeleton/index.js +75 -0
- package/lib/Skeleton/skeleton.js +58 -0
- package/lib/Skeleton/style/index.js +139 -0
- package/lib/Title/style/index.js +34 -1
- package/lib/Title/title.js +13 -5
- package/lib/ValueItem/ValueItem.js +29 -72
- package/lib/components.js +0 -21
- package/lib/locale/en-US.js +0 -7
- package/lib/locale/zh-CN.js +0 -7
- package/lib/style/components.less +0 -1
- package/lib/style/index.js +1 -4
- package/lib/style/styleRegister.js +28 -0
- package/lib/style/variable.js +10 -0
- package/lib/style.js +1 -14
- package/package.json +13 -14
- package/es/AMap/Map.js +0 -133
- package/es/AMap/index.js +0 -5
- package/es/AMap/util.js +0 -56
- package/es/CardSelect/style/index.css +0 -24
- package/es/CardSelect/style/index.less +0 -26
- package/es/CheckButton/style/index.css +0 -37
- package/es/CheckButton/style/index.less +0 -40
- package/es/DragModal/style/index.css +0 -82
- package/es/DragModal/style/index.less +0 -97
- package/es/Echarts/Echarts.js +0 -48
- package/es/Echarts/index.js +0 -5
- package/es/EditTable/style/body.less +0 -66
- package/es/EditTable/style/form.less +0 -33
- package/es/EditTable/style/group.less +0 -32
- package/es/EditTable/style/header.less +0 -77
- package/es/EditTable/style/index.css +0 -267
- package/es/EditTable/style/index.less +0 -41
- package/es/EditTable/style/menu.less +0 -25
- package/es/EditTable/style/table.less +0 -47
- package/es/Ellipsis/style/index.css +0 -17
- package/es/Ellipsis/style/index.less +0 -20
- package/es/MonacoEditor/Monaco.js +0 -242
- package/es/MonacoEditor/index.js +0 -5
- package/es/MonacoEditor/style/index.css +0 -4
- package/es/MonacoEditor/style/index.js +0 -1
- package/es/MonacoEditor/style/index.less +0 -4
- package/es/ProLayout/Basic/BasicLayout.less +0 -66
- package/es/ProLayout/Basic/Header.less +0 -8
- package/es/ProLayout/PageContainer/index.less +0 -103
- package/es/ProLayout/SiderMenu/index.less +0 -231
- package/es/ProLayout/TopHeader/index.less +0 -174
- package/es/ProLayout/style/default.less +0 -4
- package/es/ProLayout/style/style.less +0 -7
- package/es/ProTable/style/ProTable.less +0 -141
- package/es/RadioButton/style/index.css +0 -20
- package/es/RadioButton/style/index.less +0 -19
- package/es/Scrollbar/style/index.css +0 -65
- package/es/Scrollbar/style/index.less +0 -83
- package/es/Search/style/Item.less +0 -33
- package/es/Search/style/Search.less +0 -179
- package/es/Title/style/index.css +0 -23
- package/es/Title/style/index.less +0 -25
- package/es/style/index.css +0 -5197
- package/es/style/index.less +0 -13
- package/es/style/variable.css +0 -4
- package/es/style/variable.less +0 -4
- package/lib/AMap/Map.js +0 -133
- package/lib/AMap/index.js +0 -12
- package/lib/AMap/util.js +0 -62
- package/lib/CardSelect/style/index.css +0 -24
- package/lib/CardSelect/style/index.less +0 -26
- package/lib/CheckButton/style/index.css +0 -37
- package/lib/CheckButton/style/index.less +0 -40
- package/lib/DragModal/style/index.css +0 -82
- package/lib/DragModal/style/index.less +0 -97
- package/lib/Echarts/Echarts.js +0 -48
- package/lib/Echarts/index.js +0 -12
- package/lib/EditTable/style/body.less +0 -66
- package/lib/EditTable/style/form.less +0 -33
- package/lib/EditTable/style/group.less +0 -32
- package/lib/EditTable/style/header.less +0 -77
- package/lib/EditTable/style/index.css +0 -267
- package/lib/EditTable/style/index.less +0 -41
- package/lib/EditTable/style/menu.less +0 -25
- package/lib/EditTable/style/table.less +0 -47
- package/lib/Ellipsis/style/index.css +0 -17
- package/lib/Ellipsis/style/index.less +0 -20
- package/lib/MonacoEditor/Monaco.js +0 -242
- package/lib/MonacoEditor/index.js +0 -12
- package/lib/MonacoEditor/style/index.css +0 -4
- package/lib/MonacoEditor/style/index.js +0 -3
- package/lib/MonacoEditor/style/index.less +0 -4
- package/lib/ProLayout/Basic/BasicLayout.less +0 -66
- package/lib/ProLayout/Basic/Header.less +0 -8
- package/lib/ProLayout/PageContainer/index.less +0 -103
- package/lib/ProLayout/SiderMenu/index.less +0 -231
- package/lib/ProLayout/TopHeader/index.less +0 -174
- package/lib/ProLayout/style/default.less +0 -4
- package/lib/ProLayout/style/style.less +0 -7
- package/lib/ProTable/style/ProTable.less +0 -141
- package/lib/RadioButton/style/index.css +0 -20
- package/lib/RadioButton/style/index.less +0 -19
- package/lib/Scrollbar/style/index.css +0 -65
- package/lib/Scrollbar/style/index.less +0 -83
- package/lib/Search/style/Item.less +0 -33
- package/lib/Search/style/Search.less +0 -179
- package/lib/Title/style/index.css +0 -23
- package/lib/Title/style/index.less +0 -25
- package/lib/style/index.css +0 -5197
- package/lib/style/index.less +0 -13
- package/lib/style/variable.css +0 -4
- package/lib/style/variable.less +0 -4
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
|
|
2
|
-
const op = ops[i];
|
|
3
|
-
const fn = ops[i + 1];
|
|
4
|
-
i += 2;
|
|
5
|
-
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
6
|
-
return undefined;
|
|
7
|
-
}
|
|
8
|
-
if (op === 'access' || op === 'optionalAccess') {
|
|
9
|
-
lastAccessLHS = value;
|
|
10
|
-
value = fn(value);
|
|
11
|
-
}
|
|
12
|
-
else if (op === 'call' || op === 'optionalCall') {
|
|
13
|
-
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
14
|
-
lastAccessLHS = undefined;
|
|
15
|
-
}
|
|
16
|
-
} return value; }
|
|
17
|
-
/* Analyzed bindings: {
|
|
18
|
-
"modelValue": "props",
|
|
19
|
-
"theme": "props",
|
|
20
|
-
"language": "props",
|
|
21
|
-
"codeTips": "props",
|
|
22
|
-
"init": "props",
|
|
23
|
-
"registrationTips": "props",
|
|
24
|
-
"registrationTypescript": "props",
|
|
25
|
-
"blurFormat": "props",
|
|
26
|
-
"readOnly": "props",
|
|
27
|
-
"options": "props",
|
|
28
|
-
"ref": "setup-const",
|
|
29
|
-
"onMounted": "setup-const",
|
|
30
|
-
"watch": "setup-const",
|
|
31
|
-
"onUnmounted": "setup-const",
|
|
32
|
-
"toRaw": "setup-const",
|
|
33
|
-
"nextTick": "setup-const",
|
|
34
|
-
"monaco": "setup-const",
|
|
35
|
-
"omit": "setup-maybe-ref",
|
|
36
|
-
"props": "setup-reactive-const",
|
|
37
|
-
"emit": "setup-const",
|
|
38
|
-
"dom": "setup-ref",
|
|
39
|
-
"instance": "setup-let",
|
|
40
|
-
"monacoProviderRef": "setup-ref",
|
|
41
|
-
"monacoTypescriptProviderRef": "setup-ref",
|
|
42
|
-
"handleSuggestions": "setup-const",
|
|
43
|
-
"disposeRegister": "setup-const",
|
|
44
|
-
"registerCompletionItemProvider": "setup-const",
|
|
45
|
-
"disposeTypescript": "setup-const",
|
|
46
|
-
"registerTypescript": "setup-const",
|
|
47
|
-
"editorFormat": "setup-const",
|
|
48
|
-
"insert": "setup-const"
|
|
49
|
-
} */
|
|
50
|
-
import { openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
51
|
-
import { ref, onMounted, watch, onUnmounted, nextTick } from 'vue';
|
|
52
|
-
import * as monaco from 'monaco-editor';
|
|
53
|
-
import { omit } from 'lodash-es';
|
|
54
|
-
const __sfc_main__ = Object.assign({
|
|
55
|
-
name: 'JMonacoEditor'
|
|
56
|
-
}, {
|
|
57
|
-
props: {
|
|
58
|
-
modelValue: [String, Number],
|
|
59
|
-
theme: { type: String, default: 'vs-dark' },
|
|
60
|
-
language: { type: String, default: 'json' },
|
|
61
|
-
codeTips: { type: Array, default: () => [] },
|
|
62
|
-
init: { type: Function, default: undefined },
|
|
63
|
-
registrationTips: { type: Object, default: () => ({}) },
|
|
64
|
-
registrationTypescript: { type: Object, default: () => ({}) },
|
|
65
|
-
blurFormat: { type: Boolean, default: true },
|
|
66
|
-
readOnly: { type: Boolean, default: false },
|
|
67
|
-
options: { type: Object, default: () => ({}) },
|
|
68
|
-
},
|
|
69
|
-
emits: [
|
|
70
|
-
'update:modelValue',
|
|
71
|
-
'blur',
|
|
72
|
-
'focus',
|
|
73
|
-
'change',
|
|
74
|
-
'errorChange',
|
|
75
|
-
],
|
|
76
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
77
|
-
const props = __props;
|
|
78
|
-
const emit = __emit;
|
|
79
|
-
const dom = ref();
|
|
80
|
-
let instance;
|
|
81
|
-
const monacoProviderRef = ref();
|
|
82
|
-
const monacoTypescriptProviderRef = ref();
|
|
83
|
-
// codeTipItem.dispose() // 销毁自定义提示
|
|
84
|
-
const handleSuggestions = (suggestions, range) => {
|
|
85
|
-
return Array.isArray(suggestions)
|
|
86
|
-
? suggestions.map((item) => ({ ...item, range }))
|
|
87
|
-
: [];
|
|
88
|
-
};
|
|
89
|
-
const disposeRegister = () => {
|
|
90
|
-
_optionalChain([monacoProviderRef, 'access', _ => _.value, 'optionalAccess', _2 => _2.dispose, 'call', _3 => _3()]);
|
|
91
|
-
monacoProviderRef.value = null;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* 代码提示注册
|
|
95
|
-
*/
|
|
96
|
-
const registerCompletionItemProvider = () => {
|
|
97
|
-
disposeRegister();
|
|
98
|
-
if (monaco.languages && _optionalChain([props, 'access', _4 => _4.registrationTips, 'optionalAccess', _5 => _5.suggestions])) {
|
|
99
|
-
const { name, suggestions } = props.registrationTips;
|
|
100
|
-
monacoProviderRef.value =
|
|
101
|
-
monaco.languages.registerCompletionItemProvider(name || 'json', {
|
|
102
|
-
provideCompletionItems: function (model, position) {
|
|
103
|
-
const word = model.getWordUntilPosition(position); // 获取提示代码范围位置
|
|
104
|
-
const range = {
|
|
105
|
-
startLineNumber: position.lineNumber,
|
|
106
|
-
endLineNumber: position.lineNumber,
|
|
107
|
-
startColumn: word.startColumn,
|
|
108
|
-
endColumn: word.endColumn,
|
|
109
|
-
};
|
|
110
|
-
return {
|
|
111
|
-
suggestions: handleSuggestions(suggestions, range),
|
|
112
|
-
};
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
const disposeTypescript = () => {
|
|
118
|
-
_optionalChain([monacoTypescriptProviderRef, 'access', _6 => _6.value, 'optionalAccess', _7 => _7.dispose, 'call', _8 => _8()]);
|
|
119
|
-
monacoTypescriptProviderRef.value = null;
|
|
120
|
-
};
|
|
121
|
-
const registerTypescript = () => {
|
|
122
|
-
disposeTypescript();
|
|
123
|
-
if (monaco.languages && _optionalChain([props, 'access', _9 => _9.registrationTypescript, 'optionalAccess', _10 => _10.typescript])) {
|
|
124
|
-
const { name, typescript } = props.registrationTypescript;
|
|
125
|
-
monacoTypescriptProviderRef.value =
|
|
126
|
-
monaco.languages.typescript.javascriptDefaults.addExtraLib(typescript);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* 代码格式化
|
|
131
|
-
*/
|
|
132
|
-
const editorFormat = () => {
|
|
133
|
-
if (!instance)
|
|
134
|
-
return;
|
|
135
|
-
setTimeout(() => {
|
|
136
|
-
_optionalChain([instance, 'access', _11 => _11.getAction, 'call', _12 => _12('editor.action.formatDocument'), 'optionalAccess', _13 => _13.run, 'call', _14 => _14()]);
|
|
137
|
-
}, 300);
|
|
138
|
-
if (props.hasOwnProperty('readOnly')) {
|
|
139
|
-
setTimeout(() => {
|
|
140
|
-
instance.updateOptions({
|
|
141
|
-
readOnly: props.readOnly !== false,
|
|
142
|
-
});
|
|
143
|
-
}, 400);
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
monaco.editor.onDidChangeMarkers(([uri]) => {
|
|
147
|
-
const markers = monaco.editor.getModelMarkers({ resource: uri });
|
|
148
|
-
emit('errorChange', markers);
|
|
149
|
-
});
|
|
150
|
-
onMounted(async () => {
|
|
151
|
-
const _model = monaco.editor.createModel(props.modelValue, props.language);
|
|
152
|
-
instance = monaco.editor.create(dom.value, {
|
|
153
|
-
model: _model,
|
|
154
|
-
tabSize: 2,
|
|
155
|
-
automaticLayout: true,
|
|
156
|
-
scrollBeyondLastLine: false,
|
|
157
|
-
theme: props.theme,
|
|
158
|
-
formatOnPaste: true,
|
|
159
|
-
...(omit(props.options, ['readOnly']) || {}),
|
|
160
|
-
});
|
|
161
|
-
instance.onDidChangeModelContent(() => {
|
|
162
|
-
//
|
|
163
|
-
const value = instance.getValue();
|
|
164
|
-
nextTick(() => {
|
|
165
|
-
emit('update:modelValue', value);
|
|
166
|
-
emit('change', value);
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
instance.onDidBlurEditorText(() => {
|
|
170
|
-
emit('blur');
|
|
171
|
-
if (props.blurFormat) {
|
|
172
|
-
editorFormat();
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
instance.onDidFocusEditorText(() => {
|
|
176
|
-
emit('focus');
|
|
177
|
-
});
|
|
178
|
-
if (props.modelValue) {
|
|
179
|
-
setTimeout(() => {
|
|
180
|
-
editorFormat();
|
|
181
|
-
}, 200);
|
|
182
|
-
}
|
|
183
|
-
_optionalChain([props, 'access', _15 => _15.init, 'optionalCall', _16 => _16(instance, monaco)]);
|
|
184
|
-
});
|
|
185
|
-
/**
|
|
186
|
-
* 光标位置插入内容
|
|
187
|
-
* @param {String} val
|
|
188
|
-
* @param position
|
|
189
|
-
*/
|
|
190
|
-
const insert = (val, position) => {
|
|
191
|
-
if (!instance)
|
|
192
|
-
return;
|
|
193
|
-
const _position = position || instance.getPosition();
|
|
194
|
-
const value = instance.getValue();
|
|
195
|
-
if (position && position.lineNumber) {
|
|
196
|
-
instance.setPosition(position);
|
|
197
|
-
}
|
|
198
|
-
instance.executeEdits(value, [
|
|
199
|
-
{
|
|
200
|
-
range: new monaco.Range(_optionalChain([_position, 'optionalAccess', _17 => _17.lineNumber]), _optionalChain([_position, 'optionalAccess', _18 => _18.column]), _optionalChain([_position, 'optionalAccess', _19 => _19.lineNumber]), _optionalChain([_position, 'optionalAccess', _20 => _20.column])),
|
|
201
|
-
text: val,
|
|
202
|
-
},
|
|
203
|
-
]);
|
|
204
|
-
};
|
|
205
|
-
watch(() => props.modelValue, (val) => {
|
|
206
|
-
if (!instance ||
|
|
207
|
-
(instance &&
|
|
208
|
-
props.modelValue === instance.getValue()))
|
|
209
|
-
return;
|
|
210
|
-
// setValue之前获取光标位置
|
|
211
|
-
const position = instance.getPosition();
|
|
212
|
-
// setValue之后光标位置改变
|
|
213
|
-
instance.setValue(val);
|
|
214
|
-
// 设置光标位置为setValue之前的位置
|
|
215
|
-
instance.setPosition(position);
|
|
216
|
-
editorFormat();
|
|
217
|
-
});
|
|
218
|
-
watch(() => JSON.stringify(props.registrationTips), () => {
|
|
219
|
-
registerCompletionItemProvider();
|
|
220
|
-
}, { immediate: true });
|
|
221
|
-
watch(() => JSON.stringify(props.registrationTypescript), () => {
|
|
222
|
-
registerTypescript();
|
|
223
|
-
}, { immediate: true });
|
|
224
|
-
onUnmounted(() => {
|
|
225
|
-
disposeRegister();
|
|
226
|
-
disposeTypescript();
|
|
227
|
-
_optionalChain([instance, 'access', _21 => _21.editor, 'optionalAccess', _22 => _22.dispose, 'optionalCall', _23 => _23()]);
|
|
228
|
-
});
|
|
229
|
-
__expose({
|
|
230
|
-
editorFormat,
|
|
231
|
-
insert,
|
|
232
|
-
});
|
|
233
|
-
return (_ctx, _cache) => {
|
|
234
|
-
return (_openBlock(), _createElementBlock("div", {
|
|
235
|
-
ref_key: "dom",
|
|
236
|
-
ref: dom,
|
|
237
|
-
class: "j-monaco-editor"
|
|
238
|
-
}, null, 512 /* NEED_PATCH */));
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
export default __sfc_main__;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _Monaco = _interopRequireDefault(require("./Monaco.js"));
|
|
9
|
-
_Monaco.default.install = function (app) {
|
|
10
|
-
app.component(_Monaco.default.name, _Monaco.default);
|
|
11
|
-
};
|
|
12
|
-
var _default = exports.default = _Monaco.default;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
@import '../style/default.less';
|
|
2
|
-
|
|
3
|
-
.@{basicLayout-prefix-cls} {
|
|
4
|
-
// BFC
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
width: 100%;
|
|
8
|
-
min-height: 100%;
|
|
9
|
-
|
|
10
|
-
.@{ant-prefix}-layout-header {
|
|
11
|
-
&.@{ant-prefix}-pro-fixed-header {
|
|
12
|
-
position: fixed;
|
|
13
|
-
top: 0;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&-content {
|
|
18
|
-
position: relative;
|
|
19
|
-
margin: 24px;
|
|
20
|
-
|
|
21
|
-
.@{ant-prefix}-pro-page-container {
|
|
22
|
-
margin: -24px -24px 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&-disable-margin {
|
|
26
|
-
margin: 0;
|
|
27
|
-
|
|
28
|
-
.@{ant-prefix}-pro-page-container {
|
|
29
|
-
margin: 0;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
> .@{ant-prefix}-layout {
|
|
34
|
-
max-height: 100%;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// children should support fixed
|
|
39
|
-
.@{basicLayout-prefix-cls}-is-children.@{basicLayout-prefix-cls}-fix-siderbar {
|
|
40
|
-
height: 100vh;
|
|
41
|
-
overflow: hidden;
|
|
42
|
-
transform: rotate(0);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.@{basicLayout-prefix-cls}-has-header {
|
|
46
|
-
// tech-page-container
|
|
47
|
-
.tech-page-container {
|
|
48
|
-
height: calc(100vh - @pro-layout-header-height);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.@{basicLayout-prefix-cls}-is-children.@{basicLayout-prefix-cls}-has-header {
|
|
52
|
-
.tech-page-container {
|
|
53
|
-
height: calc(100vh - @pro-layout-header-height -
|
|
54
|
-
@pro-layout-header-height);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.@{basicLayout-prefix-cls}-is-children {
|
|
58
|
-
min-height: calc(100vh - @pro-layout-header-height);
|
|
59
|
-
|
|
60
|
-
&.@{basicLayout-prefix-cls}-fix-siderbar {
|
|
61
|
-
height: calc(100vh - @pro-layout-header-height);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
@import '../style/default.less';
|
|
2
|
-
|
|
3
|
-
@pro-layout-page-container: ~'@{ant-prefix}-pro-page-container';
|
|
4
|
-
|
|
5
|
-
.@{pro-layout-page-container}-children-content {
|
|
6
|
-
margin: 24px 24px 0;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.@{pro-layout-page-container} {
|
|
10
|
-
&-warp {
|
|
11
|
-
background-color: @component-background;
|
|
12
|
-
.@{ant-prefix}-tabs-bar {
|
|
13
|
-
margin: 0;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
&-ghost {
|
|
17
|
-
.@{pro-layout-page-container}-warp {
|
|
18
|
-
background-color: @component-background;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.@{pro-layout-page-container}-main {
|
|
24
|
-
.@{pro-layout-page-container}-detail {
|
|
25
|
-
display: flex;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.@{pro-layout-page-container}-row {
|
|
29
|
-
display: flex;
|
|
30
|
-
width: 100%;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.@{pro-layout-page-container}-title-content {
|
|
34
|
-
margin-bottom: 16px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.@{pro-layout-page-container}-title,
|
|
38
|
-
.@{pro-layout-page-container}-content {
|
|
39
|
-
flex: auto;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.@{pro-layout-page-container}-extraContent,
|
|
43
|
-
.@{pro-layout-page-container}-main {
|
|
44
|
-
flex: 0 1 auto;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.@{pro-layout-page-container}-main {
|
|
48
|
-
width: 100%;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.@{pro-layout-page-container}-title {
|
|
52
|
-
margin-bottom: 16px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.@{pro-layout-page-container}-logo {
|
|
56
|
-
margin-bottom: 16px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.@{pro-layout-page-container}-extraContent {
|
|
60
|
-
min-width: 242px;
|
|
61
|
-
margin-left: 88px;
|
|
62
|
-
text-align: right;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@media screen and (max-width: @screen-xl) {
|
|
67
|
-
.@{pro-layout-page-container}-main {
|
|
68
|
-
.@{pro-layout-page-container}-extraContent {
|
|
69
|
-
margin-left: 44px;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@media screen and (max-width: @screen-lg) {
|
|
75
|
-
.@{pro-layout-page-container}-main {
|
|
76
|
-
.@{pro-layout-page-container}-extraContent {
|
|
77
|
-
margin-left: 20px;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@media screen and (max-width: @screen-md) {
|
|
83
|
-
.@{pro-layout-page-container}-main {
|
|
84
|
-
.@{pro-layout-page-container}-row {
|
|
85
|
-
display: block;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.@{pro-layout-page-container}-action,
|
|
89
|
-
.@{pro-layout-page-container}-extraContent {
|
|
90
|
-
margin-left: 0;
|
|
91
|
-
text-align: left;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
@media screen and (max-width: @screen-sm) {
|
|
97
|
-
.@{pro-layout-page-container}-detail {
|
|
98
|
-
display: block;
|
|
99
|
-
}
|
|
100
|
-
.@{pro-layout-page-container}-extraContent {
|
|
101
|
-
margin-left: 0;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
@import '../style/default.less';
|
|
2
|
-
|
|
3
|
-
@pro-layout-sider-menu-prefix-cls: ~'@{ant-prefix}-pro-sider';
|
|
4
|
-
|
|
5
|
-
@nav-header-height: @pro-layout-header-height;
|
|
6
|
-
|
|
7
|
-
.@{pro-layout-sider-menu-prefix-cls} {
|
|
8
|
-
position: relative;
|
|
9
|
-
background-color: @layout-sider-background;
|
|
10
|
-
border-right: 0;
|
|
11
|
-
// FIXME: 临时修正(可能不会做兼容)
|
|
12
|
-
z-index: 20;
|
|
13
|
-
|
|
14
|
-
// 这里关掉了动画,不然使用无法兼容
|
|
15
|
-
.@{ant-prefix}-menu {
|
|
16
|
-
background: transparent;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&.@{ant-prefix}-layout-sider-light {
|
|
20
|
-
.@{ant-prefix}-menu-item a {
|
|
21
|
-
color: @heading-color;
|
|
22
|
-
}
|
|
23
|
-
.@{ant-prefix}-menu-item-selected a,
|
|
24
|
-
.@{ant-prefix}-menu-item a:hover {
|
|
25
|
-
color: @primary-color;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&-logo {
|
|
30
|
-
position: relative;
|
|
31
|
-
display: flex;
|
|
32
|
-
align-items: center;
|
|
33
|
-
padding: 16px 16px;
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
transition: padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
36
|
-
|
|
37
|
-
> a {
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
min-height: 32px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
img {
|
|
45
|
-
display: inline-block;
|
|
46
|
-
height: 32px;
|
|
47
|
-
vertical-align: middle;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
h1 {
|
|
51
|
-
display: inline-block;
|
|
52
|
-
height: 32px;
|
|
53
|
-
margin: 0 0 0 12px;
|
|
54
|
-
color: white;
|
|
55
|
-
font-weight: 600;
|
|
56
|
-
font-size: 18px;
|
|
57
|
-
line-height: 32px;
|
|
58
|
-
vertical-align: middle;
|
|
59
|
-
animation: pro-layout-title-hide 0.3s;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&-logo-card {
|
|
64
|
-
padding: 16px 0;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&-extra {
|
|
69
|
-
margin-bottom: 16px;
|
|
70
|
-
padding: 0 16px;
|
|
71
|
-
&-no-logo {
|
|
72
|
-
margin-top: 16px;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&-menu {
|
|
77
|
-
position: relative;
|
|
78
|
-
z-index: 10;
|
|
79
|
-
min-height: 100%;
|
|
80
|
-
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.@{ant-prefix}-layout-sider-children {
|
|
84
|
-
display: flex;
|
|
85
|
-
flex-direction: column;
|
|
86
|
-
height: 100%;
|
|
87
|
-
|
|
88
|
-
::-webkit-scrollbar {
|
|
89
|
-
width: 6px;
|
|
90
|
-
height: 6px;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
::-webkit-scrollbar-track {
|
|
94
|
-
background: rgba(255, 255, 255, 0.15);
|
|
95
|
-
border-radius: 3px;
|
|
96
|
-
box-shadow: inset 0 0 5px rgba(37, 37, 37, 0.05);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/* 滚动条滑块 */
|
|
100
|
-
::-webkit-scrollbar-thumb {
|
|
101
|
-
background: rgba(255, 255, 255, 0.2);
|
|
102
|
-
border-radius: 3px;
|
|
103
|
-
box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.05);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
&.@{ant-prefix}-layout-sider-collapsed {
|
|
108
|
-
.@{ant-prefix}-menu-inline-collapsed {
|
|
109
|
-
width: 48px;
|
|
110
|
-
}
|
|
111
|
-
.@{pro-layout-sider-menu-prefix-cls} {
|
|
112
|
-
&-logo {
|
|
113
|
-
padding: 16px 8px;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
&.@{ant-prefix}-layout-sider.@{pro-layout-sider-menu-prefix-cls}-fixed {
|
|
119
|
-
position: fixed;
|
|
120
|
-
top: 0;
|
|
121
|
-
left: 0;
|
|
122
|
-
z-index: 99; // react pro-components: z-index: 100;
|
|
123
|
-
height: 100%;
|
|
124
|
-
overflow: auto;
|
|
125
|
-
overflow-x: hidden;
|
|
126
|
-
box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
|
|
127
|
-
> .@{ant-prefix}-menu-root {
|
|
128
|
-
:not(.@{pro-layout-sider-menu-prefix-cls}-link-menu) {
|
|
129
|
-
height: ~'calc(100vh - @{nav-header-height})';
|
|
130
|
-
overflow-y: auto;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
&-light {
|
|
136
|
-
background-color: @component-background;
|
|
137
|
-
box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
|
|
138
|
-
|
|
139
|
-
.@{ant-prefix}-layout-sider-children {
|
|
140
|
-
::-webkit-scrollbar-track {
|
|
141
|
-
background: rgba(0, 0, 0, 0.06);
|
|
142
|
-
border-radius: 3px;
|
|
143
|
-
box-shadow: inset 0 0 5px rgba(0, 21, 41, 0.05);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/* 滚动条滑块 */
|
|
147
|
-
::-webkit-scrollbar-thumb {
|
|
148
|
-
background: rgba(0, 0, 0, 0.12);
|
|
149
|
-
border-radius: 3px;
|
|
150
|
-
box-shadow: inset 0 0 5px rgba(0, 21, 41, 0.05);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.@{pro-layout-sider-menu-prefix-cls}-logo {
|
|
155
|
-
h1 {
|
|
156
|
-
color: @primary-color;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
.@{ant-prefix}-menu-light {
|
|
160
|
-
border-right-color: transparent;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.@{pro-layout-sider-menu-prefix-cls}-collapsed-button {
|
|
164
|
-
border-top: @border-width-base @border-style-base
|
|
165
|
-
@border-color-split;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
&-icon {
|
|
170
|
-
width: 14px;
|
|
171
|
-
vertical-align: baseline;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
&-links {
|
|
175
|
-
width: 100%;
|
|
176
|
-
ul.@{ant-prefix}-menu-root {
|
|
177
|
-
height: auto;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
&-collapsed-button {
|
|
182
|
-
border-top: @border-width-base @border-style-base rgba(0, 0, 0, 0.25);
|
|
183
|
-
.anticon {
|
|
184
|
-
font-size: 16px;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.top-nav-menu li.@{ant-prefix}-menu-item {
|
|
189
|
-
height: 100%;
|
|
190
|
-
line-height: 1;
|
|
191
|
-
}
|
|
192
|
-
.drawer .drawer-content {
|
|
193
|
-
background: @layout-sider-background;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// 修正菜单 collapsed 时,icon 与 title 的间距
|
|
198
|
-
.@{ant-prefix}-pro-menu-item {
|
|
199
|
-
.anticon + .@{ant-prefix}-pro-menu-item-title {
|
|
200
|
-
margin-left: 10px;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.sider-app-menus {
|
|
205
|
-
width: 100px;
|
|
206
|
-
background-color: #fff;
|
|
207
|
-
cursor: pointer;
|
|
208
|
-
padding: 6px;
|
|
209
|
-
transition: all .3s;
|
|
210
|
-
border-radius: 4px;
|
|
211
|
-
color: #333;
|
|
212
|
-
|
|
213
|
-
&:hover {
|
|
214
|
-
background-color: #efefef;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
@keyframes pro-layout-title-hide {
|
|
219
|
-
0% {
|
|
220
|
-
display: none;
|
|
221
|
-
opacity: 0;
|
|
222
|
-
}
|
|
223
|
-
80% {
|
|
224
|
-
display: none;
|
|
225
|
-
opacity: 0;
|
|
226
|
-
}
|
|
227
|
-
100% {
|
|
228
|
-
display: unset;
|
|
229
|
-
opacity: 1;
|
|
230
|
-
}
|
|
231
|
-
}
|