@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.
Files changed (284) hide show
  1. package/es/AutoComplete/AutoComplete.js +2 -3
  2. package/es/BadgeStatus/Badge.js +2 -3
  3. package/es/CardSelect/CardSelect.js +23 -18
  4. package/es/CardSelect/style/index.js +25 -1
  5. package/es/CheckButton/CheckButton.js +12 -4
  6. package/es/CheckButton/style/index.js +41 -1
  7. package/es/ConfigProvider/index.js +1 -1
  8. package/es/DragModal/DragModal.js +15 -9
  9. package/es/DragModal/style/index.js +64 -1
  10. package/es/EditTable/Body.js +10 -3
  11. package/es/EditTable/EditTable.js +14 -8
  12. package/es/EditTable/FormItem.js +15 -10
  13. package/es/EditTable/Header.js +16 -6
  14. package/es/EditTable/components/ContextMenu/Menu.js +12 -6
  15. package/es/EditTable/components/Search/search.js +1 -2
  16. package/es/EditTable/components/Search/sort.js +1 -3
  17. package/es/EditTable/group.js +24 -19
  18. package/es/EditTable/hooks/useValidate.js +1 -1
  19. package/es/EditTable/style/body.js +53 -0
  20. package/es/EditTable/style/form.js +24 -0
  21. package/es/EditTable/style/group.js +25 -0
  22. package/es/EditTable/style/header.js +58 -0
  23. package/es/EditTable/style/index.js +42 -1
  24. package/es/EditTable/style/menu.js +27 -0
  25. package/es/EditTable/style/table.js +46 -0
  26. package/es/EditTable/utils.js +1 -1
  27. package/es/Ellipsis/Ellipsis.js +11 -3
  28. package/es/Ellipsis/style/index.js +24 -1
  29. package/es/Empty/Empty.js +1 -1
  30. package/es/FullPage/FullPage.js +1 -2
  31. package/es/LocaleProvider/index.js +1 -2
  32. package/es/PermissionButton/index.js +4 -5
  33. package/es/ProLayout/Basic/BasicLayout.js +46 -42
  34. package/es/ProLayout/Basic/BasicLayoutStyle.js +39 -0
  35. package/es/ProLayout/Basic/Header.js +4 -8
  36. package/es/ProLayout/Basic/HeaderStyle.js +10 -0
  37. package/es/ProLayout/PageContainer/index.js +20 -16
  38. package/es/ProLayout/PageContainer/style.js +46 -0
  39. package/es/ProLayout/SiderMenu/BaseMenu.js +14 -37
  40. package/es/ProLayout/SiderMenu/SiderMenu.js +25 -36
  41. package/es/ProLayout/SiderMenu/style.js +166 -0
  42. package/es/ProLayout/TopHeader/index.js +12 -11
  43. package/es/ProLayout/TopHeader/style.js +126 -0
  44. package/es/ProLayout/style/index.js +7 -1
  45. package/es/ProLayout/util.js +5 -5
  46. package/es/ProTable/Alert.js +13 -5
  47. package/es/ProTable/Content.js +22 -14
  48. package/es/ProTable/Header.js +22 -12
  49. package/es/ProTable/Pagination.js +13 -5
  50. package/es/ProTable/ProTable.js +43 -27
  51. package/es/ProTable/setting.js +1 -1
  52. package/es/ProTable/style/index.js +109 -1
  53. package/es/RadioButton/RadioButton.js +10 -4
  54. package/es/RadioButton/style/index.js +23 -1
  55. package/es/Scrollbar/Scrollbar.js +10 -3
  56. package/es/Scrollbar/Thumb.js +36 -25
  57. package/es/Scrollbar/style/index.js +63 -1
  58. package/es/Search/Advanced/History.js +24 -17
  59. package/es/Search/Advanced/SaveHistory.js +2 -3
  60. package/es/Search/Advanced/index.js +213 -293
  61. package/es/Search/Item.js +175 -415
  62. package/es/Search/Search.js +78 -172
  63. package/es/Search/hooks/index.js +108 -1
  64. package/es/Search/hooks/useRouteQuery.js +57 -0
  65. package/es/Search/setting.js +132 -14
  66. package/es/Search/style/index.js +4 -2
  67. package/es/Search/style/item.js +28 -0
  68. package/es/Search/style/search.js +133 -0
  69. package/es/Search/util.js +116 -124
  70. package/es/Skeleton/components/DashBoardCard.js +64 -0
  71. package/es/Skeleton/components/DashBoardChart.js +96 -0
  72. package/es/Skeleton/components/Detail.js +110 -0
  73. package/es/Skeleton/components/Drawer.js +91 -0
  74. package/es/Skeleton/components/Item.js +68 -0
  75. package/es/Skeleton/components/List.js +45 -0
  76. package/es/Skeleton/components/ListCard.js +63 -0
  77. package/es/Skeleton/components/ListCardItem.js +86 -0
  78. package/es/Skeleton/components/ListTable.js +76 -0
  79. package/es/Skeleton/components/Page.js +62 -0
  80. package/es/Skeleton/components/Search.js +54 -0
  81. package/es/Skeleton/components/Tree.js +72 -0
  82. package/es/Skeleton/index.js +15 -0
  83. package/es/Skeleton/skeleton.js +58 -0
  84. package/es/Skeleton/style/index.js +132 -0
  85. package/es/Title/style/index.js +29 -1
  86. package/es/Title/title.js +13 -5
  87. package/es/ValueItem/ValueItem.js +29 -72
  88. package/es/components.js +0 -3
  89. package/es/locale/en-US.js +0 -7
  90. package/es/locale/zh-CN.js +0 -7
  91. package/es/style/index.js +0 -3
  92. package/es/style/styleRegister.js +21 -0
  93. package/es/style/variable.js +4 -0
  94. package/es/style.js +0 -12
  95. package/lib/AutoComplete/AutoComplete.js +1 -2
  96. package/lib/BadgeStatus/Badge.js +2 -3
  97. package/lib/CardSelect/CardSelect.js +23 -18
  98. package/lib/CardSelect/style/index.js +30 -1
  99. package/lib/CheckButton/CheckButton.js +12 -4
  100. package/lib/CheckButton/style/index.js +46 -1
  101. package/lib/ConfigProvider/context.js +1 -1
  102. package/lib/ConfigProvider/index.js +3 -3
  103. package/lib/DragModal/DragModal.js +15 -9
  104. package/lib/DragModal/style/index.js +69 -1
  105. package/lib/EditTable/Body.js +10 -3
  106. package/lib/EditTable/EditTable.js +13 -7
  107. package/lib/EditTable/FormItem.js +16 -11
  108. package/lib/EditTable/Header.js +16 -6
  109. package/lib/EditTable/components/ContextMenu/Menu.js +12 -6
  110. package/lib/EditTable/components/Search/search.js +1 -2
  111. package/lib/EditTable/components/Search/sort.js +1 -3
  112. package/lib/EditTable/group.js +24 -19
  113. package/lib/EditTable/hooks/useValidate.js +1 -1
  114. package/lib/EditTable/style/body.js +60 -0
  115. package/lib/EditTable/style/form.js +31 -0
  116. package/lib/EditTable/style/group.js +32 -0
  117. package/lib/EditTable/style/header.js +65 -0
  118. package/lib/EditTable/style/index.js +47 -1
  119. package/lib/EditTable/style/menu.js +33 -0
  120. package/lib/EditTable/style/table.js +52 -0
  121. package/lib/EditTable/utils.js +1 -1
  122. package/lib/Ellipsis/Ellipsis.js +11 -3
  123. package/lib/Ellipsis/style/index.js +29 -1
  124. package/lib/Empty/Empty.js +1 -1
  125. package/lib/FullPage/FullPage.js +1 -2
  126. package/lib/LocaleProvider/index.js +1 -2
  127. package/lib/PermissionButton/index.js +9 -10
  128. package/lib/ProLayout/Basic/BasicLayout.js +55 -51
  129. package/lib/ProLayout/Basic/BasicLayoutStyle.js +46 -0
  130. package/lib/ProLayout/Basic/Header.js +6 -10
  131. package/lib/ProLayout/Basic/HeaderStyle.js +17 -0
  132. package/lib/ProLayout/PageContainer/index.js +24 -20
  133. package/lib/ProLayout/PageContainer/style.js +53 -0
  134. package/lib/ProLayout/SiderMenu/BaseMenu.js +18 -40
  135. package/lib/ProLayout/SiderMenu/SiderMenu.js +28 -39
  136. package/lib/ProLayout/SiderMenu/style.js +173 -0
  137. package/lib/ProLayout/TopHeader/index.js +12 -10
  138. package/lib/ProLayout/TopHeader/style.js +133 -0
  139. package/lib/ProLayout/defaultSettings.js +1 -1
  140. package/lib/ProLayout/style/index.js +12 -1
  141. package/lib/ProLayout/util.js +5 -5
  142. package/lib/ProTable/Alert.js +13 -5
  143. package/lib/ProTable/Content.js +22 -14
  144. package/lib/ProTable/Header.js +22 -12
  145. package/lib/ProTable/Pagination.js +13 -5
  146. package/lib/ProTable/ProTable.js +43 -27
  147. package/lib/ProTable/setting.js +3 -3
  148. package/lib/ProTable/style/index.js +114 -1
  149. package/lib/RadioButton/RadioButton.js +10 -4
  150. package/lib/RadioButton/style/index.js +28 -1
  151. package/lib/Scrollbar/Scrollbar.js +10 -3
  152. package/lib/Scrollbar/Thumb.js +36 -25
  153. package/lib/Scrollbar/style/index.js +68 -1
  154. package/lib/Search/Advanced/History.js +24 -17
  155. package/lib/Search/Advanced/SaveHistory.js +2 -3
  156. package/lib/Search/Advanced/index.js +213 -293
  157. package/lib/Search/Item.js +175 -415
  158. package/lib/Search/Search.js +78 -172
  159. package/lib/Search/hooks/index.js +130 -1
  160. package/lib/Search/hooks/useRouteQuery.js +64 -0
  161. package/lib/Search/setting.js +133 -15
  162. package/lib/Search/style/index.js +9 -2
  163. package/lib/Search/style/item.js +35 -0
  164. package/lib/Search/style/search.js +140 -0
  165. package/lib/Search/util.js +116 -124
  166. package/lib/Skeleton/components/DashBoardCard.js +64 -0
  167. package/lib/Skeleton/components/DashBoardChart.js +96 -0
  168. package/lib/Skeleton/components/Detail.js +110 -0
  169. package/lib/Skeleton/components/Drawer.js +91 -0
  170. package/lib/Skeleton/components/Item.js +68 -0
  171. package/lib/Skeleton/components/List.js +45 -0
  172. package/lib/Skeleton/components/ListCard.js +63 -0
  173. package/lib/Skeleton/components/ListCardItem.js +86 -0
  174. package/lib/Skeleton/components/ListTable.js +76 -0
  175. package/lib/Skeleton/components/Page.js +62 -0
  176. package/lib/Skeleton/components/Search.js +54 -0
  177. package/lib/Skeleton/components/Tree.js +72 -0
  178. package/lib/Skeleton/index.js +75 -0
  179. package/lib/Skeleton/skeleton.js +58 -0
  180. package/lib/Skeleton/style/index.js +139 -0
  181. package/lib/Title/style/index.js +34 -1
  182. package/lib/Title/title.js +13 -5
  183. package/lib/ValueItem/ValueItem.js +29 -72
  184. package/lib/components.js +0 -21
  185. package/lib/locale/en-US.js +0 -7
  186. package/lib/locale/zh-CN.js +0 -7
  187. package/lib/style/components.less +0 -1
  188. package/lib/style/index.js +1 -4
  189. package/lib/style/styleRegister.js +28 -0
  190. package/lib/style/variable.js +10 -0
  191. package/lib/style.js +1 -14
  192. package/package.json +13 -14
  193. package/es/AMap/Map.js +0 -133
  194. package/es/AMap/index.js +0 -5
  195. package/es/AMap/util.js +0 -56
  196. package/es/CardSelect/style/index.css +0 -24
  197. package/es/CardSelect/style/index.less +0 -26
  198. package/es/CheckButton/style/index.css +0 -37
  199. package/es/CheckButton/style/index.less +0 -40
  200. package/es/DragModal/style/index.css +0 -82
  201. package/es/DragModal/style/index.less +0 -97
  202. package/es/Echarts/Echarts.js +0 -48
  203. package/es/Echarts/index.js +0 -5
  204. package/es/EditTable/style/body.less +0 -66
  205. package/es/EditTable/style/form.less +0 -33
  206. package/es/EditTable/style/group.less +0 -32
  207. package/es/EditTable/style/header.less +0 -77
  208. package/es/EditTable/style/index.css +0 -267
  209. package/es/EditTable/style/index.less +0 -41
  210. package/es/EditTable/style/menu.less +0 -25
  211. package/es/EditTable/style/table.less +0 -47
  212. package/es/Ellipsis/style/index.css +0 -17
  213. package/es/Ellipsis/style/index.less +0 -20
  214. package/es/MonacoEditor/Monaco.js +0 -242
  215. package/es/MonacoEditor/index.js +0 -5
  216. package/es/MonacoEditor/style/index.css +0 -4
  217. package/es/MonacoEditor/style/index.js +0 -1
  218. package/es/MonacoEditor/style/index.less +0 -4
  219. package/es/ProLayout/Basic/BasicLayout.less +0 -66
  220. package/es/ProLayout/Basic/Header.less +0 -8
  221. package/es/ProLayout/PageContainer/index.less +0 -103
  222. package/es/ProLayout/SiderMenu/index.less +0 -231
  223. package/es/ProLayout/TopHeader/index.less +0 -174
  224. package/es/ProLayout/style/default.less +0 -4
  225. package/es/ProLayout/style/style.less +0 -7
  226. package/es/ProTable/style/ProTable.less +0 -141
  227. package/es/RadioButton/style/index.css +0 -20
  228. package/es/RadioButton/style/index.less +0 -19
  229. package/es/Scrollbar/style/index.css +0 -65
  230. package/es/Scrollbar/style/index.less +0 -83
  231. package/es/Search/style/Item.less +0 -33
  232. package/es/Search/style/Search.less +0 -179
  233. package/es/Title/style/index.css +0 -23
  234. package/es/Title/style/index.less +0 -25
  235. package/es/style/index.css +0 -5197
  236. package/es/style/index.less +0 -13
  237. package/es/style/variable.css +0 -4
  238. package/es/style/variable.less +0 -4
  239. package/lib/AMap/Map.js +0 -133
  240. package/lib/AMap/index.js +0 -12
  241. package/lib/AMap/util.js +0 -62
  242. package/lib/CardSelect/style/index.css +0 -24
  243. package/lib/CardSelect/style/index.less +0 -26
  244. package/lib/CheckButton/style/index.css +0 -37
  245. package/lib/CheckButton/style/index.less +0 -40
  246. package/lib/DragModal/style/index.css +0 -82
  247. package/lib/DragModal/style/index.less +0 -97
  248. package/lib/Echarts/Echarts.js +0 -48
  249. package/lib/Echarts/index.js +0 -12
  250. package/lib/EditTable/style/body.less +0 -66
  251. package/lib/EditTable/style/form.less +0 -33
  252. package/lib/EditTable/style/group.less +0 -32
  253. package/lib/EditTable/style/header.less +0 -77
  254. package/lib/EditTable/style/index.css +0 -267
  255. package/lib/EditTable/style/index.less +0 -41
  256. package/lib/EditTable/style/menu.less +0 -25
  257. package/lib/EditTable/style/table.less +0 -47
  258. package/lib/Ellipsis/style/index.css +0 -17
  259. package/lib/Ellipsis/style/index.less +0 -20
  260. package/lib/MonacoEditor/Monaco.js +0 -242
  261. package/lib/MonacoEditor/index.js +0 -12
  262. package/lib/MonacoEditor/style/index.css +0 -4
  263. package/lib/MonacoEditor/style/index.js +0 -3
  264. package/lib/MonacoEditor/style/index.less +0 -4
  265. package/lib/ProLayout/Basic/BasicLayout.less +0 -66
  266. package/lib/ProLayout/Basic/Header.less +0 -8
  267. package/lib/ProLayout/PageContainer/index.less +0 -103
  268. package/lib/ProLayout/SiderMenu/index.less +0 -231
  269. package/lib/ProLayout/TopHeader/index.less +0 -174
  270. package/lib/ProLayout/style/default.less +0 -4
  271. package/lib/ProLayout/style/style.less +0 -7
  272. package/lib/ProTable/style/ProTable.less +0 -141
  273. package/lib/RadioButton/style/index.css +0 -20
  274. package/lib/RadioButton/style/index.less +0 -19
  275. package/lib/Scrollbar/style/index.css +0 -65
  276. package/lib/Scrollbar/style/index.less +0 -83
  277. package/lib/Search/style/Item.less +0 -33
  278. package/lib/Search/style/Search.less +0 -179
  279. package/lib/Title/style/index.css +0 -23
  280. package/lib/Title/style/index.less +0 -25
  281. package/lib/style/index.css +0 -5197
  282. package/lib/style/index.less +0 -13
  283. package/lib/style/variable.css +0 -4
  284. 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,4 +0,0 @@
1
- .j-monaco-editor {
2
- min-height: 50px;
3
- height: 100%;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
-
3
- require("./index.less");
@@ -1,4 +0,0 @@
1
- .j-monaco-editor {
2
- min-height: 50px;
3
- height: 100%;
4
- }
@@ -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,8 +0,0 @@
1
- @import '../style/default.less';
2
-
3
- @pro-layout-fixed-header-prefix-cls: ~'@{ant-prefix}-pro-fixed-header';
4
-
5
- .@{pro-layout-fixed-header-prefix-cls} {
6
- z-index: 9;
7
- width: 100%;
8
- }
@@ -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
- }