ronds-metadata 1.3.89 → 1.3.91
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 +25 -25
- package/es/api/index.d.ts +11 -1
- package/es/api/index.js +202 -47
- package/es/comps/Chart/bar/index.d.ts +8 -0
- package/es/comps/Chart/bar/index.js +136 -0
- package/es/comps/Chart/constants.d.ts +7 -0
- package/es/comps/Chart/constants.js +8 -0
- package/es/comps/Chart/index.d.ts +9 -0
- package/es/comps/Chart/index.js +31 -0
- package/es/comps/Chart/line/index.d.ts +8 -0
- package/es/comps/Chart/line/index.js +163 -0
- package/es/comps/Chart/pie/index.d.ts +8 -0
- package/es/comps/Chart/pie/index.js +67 -0
- package/es/comps/Chart/type.d.ts +19 -0
- package/es/comps/Chart/type.js +1 -0
- package/es/comps/Chart/utils.d.ts +1 -0
- package/es/comps/Chart/utils.js +19 -0
- package/es/comps/CodeEdit/index.d.ts +5 -2
- package/es/comps/CodeEdit/index.js +42 -91
- package/es/comps/CodeEdit/index.less +6 -6
- package/es/comps/CodeEdit/utils.d.ts +2 -0
- package/es/comps/CodeEdit/utils.js +173 -0
- package/es/comps/CodeEditor/config.d.ts +27 -0
- package/es/comps/CodeEditor/config.js +64 -0
- package/es/comps/CodeEditor/index.d.ts +42 -0
- package/es/comps/CodeEditor/index.js +320 -0
- package/es/comps/CodeEditor/index.less +3 -0
- package/es/comps/CodeEditor/suggestions/constants/cassandra.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/cassandra.js +6 -0
- package/es/comps/CodeEditor/suggestions/constants/clickhouse.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/clickhouse.js +6 -0
- package/es/comps/CodeEditor/suggestions/constants/dm.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/dm.js +6 -0
- package/es/comps/CodeEditor/suggestions/constants/index.d.ts +33 -0
- package/es/comps/CodeEditor/suggestions/constants/index.js +19 -0
- package/es/comps/CodeEditor/suggestions/constants/pgsql.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/pgsql.js +6 -0
- package/es/comps/CodeEditor/suggestions/constants/redis.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/redis.js +6 -0
- package/es/comps/CodeEditor/suggestions/constants/sqlserver.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/sqlserver.js +6 -0
- package/es/comps/CodeEditor/suggestions/register/database.d.ts +8 -0
- package/es/comps/CodeEditor/suggestions/register/database.js +61 -0
- package/es/comps/CodeEditor/suggestions/register/field.d.ts +10 -0
- package/es/comps/CodeEditor/suggestions/register/field.js +144 -0
- package/es/comps/CodeEditor/suggestions/register/index.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/register/index.js +7 -0
- package/es/comps/CodeEditor/suggestions/register/keyword.d.ts +6 -0
- package/es/comps/CodeEditor/suggestions/register/keyword.js +79 -0
- package/es/comps/CodeEditor/suggestions/register/prompt.d.ts +5 -0
- package/es/comps/CodeEditor/suggestions/register/prompt.js +40 -0
- package/es/comps/CodeEditor/suggestions/register/schema.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/register/schema.js +85 -0
- package/es/comps/CodeEditor/suggestions/register/table.d.ts +14 -0
- package/es/comps/CodeEditor/suggestions/register/table.js +173 -0
- package/es/comps/CodeEditor/utils.d.ts +13 -0
- package/es/comps/CodeEditor/utils.js +69 -0
- package/es/comps/DataMine/Line.js +0 -1
- package/es/comps/DraggableDiv/index.d.ts +9 -0
- package/es/comps/DraggableDiv/index.js +139 -0
- package/es/comps/DraggableDiv/index.less +45 -0
- package/es/comps/DynamicPorts/comps/ContextMenu.less +8 -8
- package/es/comps/DynamicPorts/comps/DragNode.js +1 -1
- package/es/comps/DynamicPorts/comps/GraphHandler/index.less +39 -39
- package/es/comps/DynamicPorts/comps/NodeElementAlgo.d.ts +6 -0
- package/es/comps/DynamicPorts/comps/NodeElementAlgo.js +76 -0
- package/es/comps/DynamicPorts/comps/NodeElementConfig.d.ts +6 -0
- package/es/comps/DynamicPorts/comps/NodeElementConfig.js +73 -0
- package/es/comps/DynamicPorts/comps/NodeElementRead.d.ts +6 -0
- package/es/comps/DynamicPorts/comps/NodeElementRead.js +76 -0
- package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.less +5 -5
- package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.less +40 -40
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +1 -1
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.less +42 -42
- package/es/comps/DynamicPorts/comps/shape/connector.js +12 -2
- package/es/comps/DynamicPorts/comps/shape/edge.d.ts +2 -0
- package/es/comps/DynamicPorts/comps/shape/edge.js +30 -3
- package/es/comps/DynamicPorts/comps/shape/edge.less +8 -8
- package/es/comps/DynamicPorts/comps/shape/node.d.ts +15 -0
- package/es/comps/DynamicPorts/comps/shape/node.js +293 -5
- package/es/comps/DynamicPorts/constant/index.d.ts +2 -0
- package/es/comps/DynamicPorts/constant/index.js +3 -1
- package/es/comps/DynamicPorts/graph.d.ts +2 -2
- package/es/comps/DynamicPorts/graph.js +63 -38
- package/es/comps/DynamicPorts/index.d.ts +1 -1
- package/es/comps/DynamicPorts/index.js +1 -1
- package/es/comps/DynamicPorts/index.less +304 -3
- package/es/comps/DynamicPorts/interface.d.ts +7 -0
- package/es/comps/DynamicPorts/interface.js +1 -1
- package/es/comps/DynamicPorts/utils.d.ts +4 -0
- package/es/comps/DynamicPorts/utils.js +13 -2
- package/es/comps/Editable/DataCell/ButtonCell.js +28 -2
- package/es/comps/Editable/comps/EditableAction.d.ts +1 -0
- package/es/comps/Editable/comps/EditableAction.js +2 -1
- package/es/comps/Editable/comps/EditableRow.js +3 -2
- package/es/comps/Editable/comps/Texty.js +1 -2
- package/es/comps/Editable/comps/Texty.less +43 -43
- package/es/comps/Editable/comps/index.less +38 -38
- package/es/comps/Editable/index.d.ts +19 -0
- package/es/comps/Editable/index.js +15 -6
- package/es/comps/Editable/index.less +97 -97
- package/es/comps/Editable/interface.d.ts +1 -0
- package/es/comps/FileView/index.js +2 -2
- package/es/comps/FormGenerator/comps/Canvas/Preview.js +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/CassandraDs.d.ts +3 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/CassandraDs.js +258 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/KafkaDs.d.ts +3 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/KafkaDs.js +203 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/MinioDs.d.ts +3 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/MinioDs.js +203 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/PostgreSqlDs.d.ts +3 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/PostgreSqlDs.js +313 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/RedisDs.d.ts +3 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/RedisDs.js +203 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +11 -1
- package/es/comps/FormGenerator/comps/Canvas/core/index.less +53 -0
- package/es/comps/FormGenerator/comps/Canvas/index.js +1 -1
- package/es/comps/FormGenerator/comps/Sidebar/index.js +3 -2
- package/es/comps/FormGenerator/comps/Sidebar/index.less +21 -21
- package/es/comps/FormGenerator/index.less +20 -20
- package/es/comps/FormGenerator/settings/index.d.ts +131 -8
- package/es/comps/FormGenerator/settings/index.js +41 -1
- package/es/comps/FormGenerator/settings/ruleConfig.d.ts +49 -0
- package/es/comps/FormGenerator/settings/ruleConfig.js +49 -0
- package/es/comps/FormGenerator/transformer.js +33 -7
- package/es/comps/JsonEdit/index.js +0 -1
- package/es/comps/JsonEdit/index.less +64 -64
- package/es/comps/JsonView/index.less +41 -41
- package/es/comps/MdEdit/index.less +6 -6
- package/es/comps/MdEditPro/index.less +166 -166
- package/es/comps/MdNavbar/index.less +1 -1
- package/es/comps/MdView/index.less +3 -3
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +5 -5
- package/es/comps/MetadataEdit/constant/index.js +0 -2
- package/es/comps/MetadataEdit/index.js +3 -3
- package/es/comps/MetadataEdit/index.less +10 -10
- package/es/comps/MetadataEdit/type.d.ts +20 -20
- package/es/comps/MetadataForm/DataCell/Array.js +14 -2
- package/es/comps/MetadataForm/DataCell/Input.js +65 -8
- package/es/comps/MetadataForm/DataCell/Ref.js +6 -6
- package/es/comps/MetadataForm/DataCell/Select.js +72 -31
- package/es/comps/MetadataForm/DataCell/business/config.d.ts +32 -36
- package/es/comps/MetadataForm/DataCell/business/config.js +74 -67
- package/es/comps/MetadataForm/DataCell/business/index.js +44 -1
- package/es/comps/MetadataForm/DataCell/layout/TableArray.js +7 -7
- package/es/comps/MetadataForm/DataCell/plugin/ButtonSelect.d.ts +12 -0
- package/es/comps/MetadataForm/DataCell/plugin/ButtonSelect.js +68 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Cassandra.d.ts +9 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Cassandra.js +163 -90
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/DataLake.d.ts +20 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/DataLake.js +255 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/DatasourceType.d.ts +17 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/DatasourceType.js +133 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/ExtraAttr.d.ts +10 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/ExtraAttr.js +65 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Kafka.d.ts +11 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Kafka.js +146 -60
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Minio.d.ts +18 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Minio.js +92 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/PostgreSQL.d.ts +13 -3
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/PostgreSQL.js +206 -124
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Redis.d.ts +18 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Redis.js +92 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/SqlServer.d.ts +10 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/SqlServer.js +207 -122
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/hooks.d.ts +2 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/hooks.js +39 -16
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/index.js +359 -164
- package/es/comps/MetadataForm/DataCell/plugin/MappingTable.d.ts +12 -0
- package/es/comps/MetadataForm/DataCell/plugin/MappingTable.js +289 -0
- package/es/comps/MetadataForm/DataCell/plugin/RefreshSelect.js +17 -15
- package/es/comps/MetadataForm/DataCell/plugin/RunFrequency.d.ts +7 -0
- package/es/comps/MetadataForm/DataCell/plugin/RunFrequency.js +395 -0
- package/es/comps/MetadataForm/DataCell/plugin/RunStopSetting.d.ts +7 -0
- package/es/comps/MetadataForm/DataCell/plugin/RunStopSetting.js +238 -0
- package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.d.ts +4 -1
- package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.js +94 -78
- package/es/comps/MetadataForm/HOC/index.js +4 -4
- package/es/comps/MetadataForm/HOC/index.less +17 -6
- package/es/comps/MetadataForm/constants.d.ts +4 -0
- package/es/comps/MetadataForm/constants.js +6 -2
- package/es/comps/MetadataForm/hooks/index.js +5 -5
- package/es/comps/MetadataForm/index.d.ts +12 -0
- package/es/comps/MetadataForm/index.js +59 -3
- package/es/comps/MetadataForm/index.less +32 -29
- package/es/comps/MetadataForm/interface.d.ts +6 -0
- package/es/comps/MetadataForm/interface.js +2 -1
- package/es/comps/MetadataForm/utils.d.ts +2 -0
- package/es/comps/MetadataForm/utils.js +45 -9
- package/es/comps/Split/index.less +29 -29
- package/es/comps/VideoPlayer/index.d.ts +3 -0
- package/es/comps/VideoPlayer/index.js +14 -0
- package/es/comps/VideoPlayer/index.less +9 -0
- package/es/framework/canvas/EventBus.d.ts +21 -0
- package/es/framework/canvas/EventBus.js +66 -0
- package/es/framework/canvas/ImageLoadPool.d.ts +24 -0
- package/es/framework/canvas/ImageLoadPool.js +197 -0
- package/es/framework/canvas/index.d.ts +409 -0
- package/es/framework/canvas/index.js +2639 -0
- package/es/framework/canvas/shape/Circle.d.ts +7 -0
- package/es/framework/canvas/shape/Circle.js +35 -0
- package/es/framework/canvas/shape/Dot.d.ts +7 -0
- package/es/framework/canvas/shape/Dot.js +30 -0
- package/es/framework/canvas/shape/Grid.d.ts +12 -0
- package/es/framework/canvas/shape/Grid.js +82 -0
- package/es/framework/canvas/shape/Line.d.ts +6 -0
- package/es/framework/canvas/shape/Line.js +29 -0
- package/es/framework/canvas/shape/Polygon.d.ts +6 -0
- package/es/framework/canvas/shape/Polygon.js +24 -0
- package/es/framework/canvas/shape/Rect.d.ts +6 -0
- package/es/framework/canvas/shape/Rect.js +37 -0
- package/es/framework/canvas/shape/Shape.d.ts +42 -0
- package/es/framework/canvas/shape/Shape.js +49 -0
- package/es/framework/canvas/type.d.ts +17 -0
- package/es/framework/canvas/type.js +1 -0
- package/es/framework/graph/index.js +4 -4
- package/es/framework/graph/index.less +15 -15
- package/es/framework/http/index.js +8 -8
- package/es/framework/http/msgpack5/lib/helpers.js +0 -1
- package/es/framework/jsonQl/index.js +22 -22
- package/es/framework/libs/iconfont/iconfont.css +171 -3
- package/es/framework/libs/iconfont/iconfont.json +294 -0
- package/es/framework/libs/iconfont/iconfont.ttf +0 -0
- package/es/framework/libs/iconfont/iconfont.woff +0 -0
- package/es/framework/libs/iconfont/iconfont.woff2 +0 -0
- package/es/framework/libs/jquery.min.js +5 -5
- package/es/framework/metadata/MetadataService.d.ts +7 -0
- package/es/framework/metadata/MetadataService.js +124 -29
- package/es/framework/metadata/types.d.ts +14 -1
- package/es/framework/proto/index.d.ts +18 -0
- package/es/framework/proto/index.js +85 -1
- package/es/framework/rxjs-hooks/useMemoReplaySubject.d.ts +3 -0
- package/es/framework/rxjs-hooks/useMemoReplaySubject.js +49 -0
- package/es/framework/wave/index.d.ts +217 -0
- package/es/framework/wave/index.js +1448 -0
- package/es/framework/wave/type.d.ts +143 -0
- package/es/framework/wave/type.js +1 -0
- package/es/index.d.ts +10 -1
- package/es/index.js +13 -2
- package/es/theme.less +2 -0
- package/es/utils.js +1 -1
- package/package.json +122 -117
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.d.ts +0 -8
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.js +0 -297
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IEditorOptions } from '.';
|
|
2
|
+
export declare const editorDefaultOptions: IEditorOptions;
|
|
3
|
+
export declare enum EditorThemeType {
|
|
4
|
+
DashboardLightTheme = "DashboardLightTheme",
|
|
5
|
+
DashboardBlackTheme = "DashboardBlackTheme"
|
|
6
|
+
}
|
|
7
|
+
export declare enum DatabaseTypeCode {
|
|
8
|
+
MYSQL = "MySql",
|
|
9
|
+
ORACLE = "Oracle",
|
|
10
|
+
DB2 = "Db2",
|
|
11
|
+
MONGODB = "Mongodb",
|
|
12
|
+
REDIS = "Redis",
|
|
13
|
+
H2 = "H2",
|
|
14
|
+
POSTGRESQL = "PostgreSql",
|
|
15
|
+
SQLSERVER = "SqlServer",
|
|
16
|
+
SQLITE = "Sqlite",
|
|
17
|
+
MARIADB = "Mariadb",
|
|
18
|
+
CLICKHOUSE = "ClickHouse",
|
|
19
|
+
DM = "DM",
|
|
20
|
+
OCEANBASE = "Oceanbase",
|
|
21
|
+
PRESTO = "Presto",
|
|
22
|
+
HIVE = "Hive",
|
|
23
|
+
KINGBASE = "Kingbase",
|
|
24
|
+
TIMEPLUS = "TimePlus",
|
|
25
|
+
CASSANDRA = "Cassandra"
|
|
26
|
+
}
|
|
27
|
+
export declare const removableIds: string[];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export var editorDefaultOptions = {
|
|
2
|
+
fontFamily: "\"Menlo\", \n \"DejaVu Sans Mono\", \n \"Liberation Mono\", \n \"Consolas\", \n \"Ubuntu Mono\", \n \"Courier New\", \n \"andale mono\", \n \"lucida console\", \n \"monospace\"",
|
|
3
|
+
scrollBeyondLastLine: false,
|
|
4
|
+
automaticLayout: true,
|
|
5
|
+
dragAndDrop: false,
|
|
6
|
+
fontSize: 12,
|
|
7
|
+
tabSize: 2,
|
|
8
|
+
lineHeight: 18,
|
|
9
|
+
theme: 'vscode',
|
|
10
|
+
roundedSelection: false,
|
|
11
|
+
readOnly: false,
|
|
12
|
+
folding: false,
|
|
13
|
+
insertSpaces: true,
|
|
14
|
+
autoClosingQuotes: 'always',
|
|
15
|
+
detectIndentation: false,
|
|
16
|
+
wordWrap: 'on',
|
|
17
|
+
fixedOverflowWidgets: true,
|
|
18
|
+
// renderLineHighlight: 'none', // 渲染行高亮
|
|
19
|
+
codeLens: false,
|
|
20
|
+
scrollbar: {
|
|
21
|
+
// 滚动条
|
|
22
|
+
alwaysConsumeMouseWheel: false // 总是消耗鼠标滚轮
|
|
23
|
+
},
|
|
24
|
+
unicodeHighlight: {
|
|
25
|
+
ambiguousCharacters: false,
|
|
26
|
+
invisibleCharacters: false
|
|
27
|
+
},
|
|
28
|
+
// padding: {
|
|
29
|
+
// top: 2,
|
|
30
|
+
// bottom: 2,
|
|
31
|
+
// },
|
|
32
|
+
// contextmenu:false, //关闭右键菜单
|
|
33
|
+
minimap: {
|
|
34
|
+
// 缩略图
|
|
35
|
+
enabled: false // 启用
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export var EditorThemeType;
|
|
39
|
+
(function (EditorThemeType) {
|
|
40
|
+
EditorThemeType["DashboardLightTheme"] = "DashboardLightTheme";
|
|
41
|
+
EditorThemeType["DashboardBlackTheme"] = "DashboardBlackTheme";
|
|
42
|
+
})(EditorThemeType || (EditorThemeType = {}));
|
|
43
|
+
export var DatabaseTypeCode;
|
|
44
|
+
(function (DatabaseTypeCode) {
|
|
45
|
+
DatabaseTypeCode["MYSQL"] = "MySql";
|
|
46
|
+
DatabaseTypeCode["ORACLE"] = "Oracle";
|
|
47
|
+
DatabaseTypeCode["DB2"] = "Db2";
|
|
48
|
+
DatabaseTypeCode["MONGODB"] = "Mongodb";
|
|
49
|
+
DatabaseTypeCode["REDIS"] = "Redis";
|
|
50
|
+
DatabaseTypeCode["H2"] = "H2";
|
|
51
|
+
DatabaseTypeCode["POSTGRESQL"] = "PostgreSql";
|
|
52
|
+
DatabaseTypeCode["SQLSERVER"] = "SqlServer";
|
|
53
|
+
DatabaseTypeCode["SQLITE"] = "Sqlite";
|
|
54
|
+
DatabaseTypeCode["MARIADB"] = "Mariadb";
|
|
55
|
+
DatabaseTypeCode["CLICKHOUSE"] = "ClickHouse";
|
|
56
|
+
DatabaseTypeCode["DM"] = "DM";
|
|
57
|
+
DatabaseTypeCode["OCEANBASE"] = "Oceanbase";
|
|
58
|
+
DatabaseTypeCode["PRESTO"] = "Presto";
|
|
59
|
+
DatabaseTypeCode["HIVE"] = "Hive";
|
|
60
|
+
DatabaseTypeCode["KINGBASE"] = "Kingbase";
|
|
61
|
+
DatabaseTypeCode["TIMEPLUS"] = "TimePlus";
|
|
62
|
+
DatabaseTypeCode["CASSANDRA"] = "Cassandra";
|
|
63
|
+
})(DatabaseTypeCode || (DatabaseTypeCode = {}));
|
|
64
|
+
export var removableIds = ['editor.action.clipboardCutAction', 'editor.action.clipboardCopyAction', 'editor.action.clipboardPasteAction', 'editor.action.refactor', 'editor.action.sourceAction', 'editor.action.revealDefinition', 'editor.action.revealDeclaration', 'editor.action.goToTypeDefinition', 'editor.action.goToImplementation', 'editor.action.goToReferences', 'editor.action.formatDocument', 'editor.action.formatSelection', 'editor.action.changeAll', 'editor.action.rename', 'editor.action.quickOutline', 'editor.action.quickCommand', 'Peek'];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export type IEditorIns = monaco.editor.IStandaloneCodeEditor;
|
|
5
|
+
export type IEditorOptions = monaco.editor.IStandaloneEditorConstructionOptions;
|
|
6
|
+
export type IRangeType = 'end' | 'front' | 'cover' | 'reset' | any;
|
|
7
|
+
export type IAppendValue = {
|
|
8
|
+
text: any;
|
|
9
|
+
range?: IRangeType;
|
|
10
|
+
};
|
|
11
|
+
interface ICodeEditorProps {
|
|
12
|
+
id: string;
|
|
13
|
+
language?: string;
|
|
14
|
+
options?: IEditorOptions;
|
|
15
|
+
needDestroy?: boolean;
|
|
16
|
+
addAction?: Array<{
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
groupId?: string;
|
|
20
|
+
keybindings?: number[];
|
|
21
|
+
contextMenuOrder?: number;
|
|
22
|
+
action: (selectedText: string, ext?: string) => void;
|
|
23
|
+
}>;
|
|
24
|
+
defaultValue?: string;
|
|
25
|
+
appendValue?: IAppendValue;
|
|
26
|
+
readOnly?: boolean;
|
|
27
|
+
foldLevel?: number;
|
|
28
|
+
didMount?: (editor: IEditorIns) => any;
|
|
29
|
+
shortcutKey?: (editor: IEditorIns, monaco: any, isActive: boolean) => void;
|
|
30
|
+
focusChange?: (isActive: boolean) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface IExportRefFunction {
|
|
33
|
+
getCurrentSelectContent: () => string;
|
|
34
|
+
getAllContent: () => string;
|
|
35
|
+
setValue: (text: any, range?: IRangeType) => void;
|
|
36
|
+
getEditorIns: () => IEditorIns;
|
|
37
|
+
setAutoFold: (foldLevel: number) => void;
|
|
38
|
+
setUnfoldAll: () => void;
|
|
39
|
+
}
|
|
40
|
+
export declare const appendMonacoValue: (editor: any, text: any, range?: IRangeType) => void;
|
|
41
|
+
declare const _default: React.ForwardRefExoticComponent<ICodeEditorProps & React.RefAttributes<IExportRefFunction>>;
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
/*
|
|
4
|
+
* @Author: wangxian
|
|
5
|
+
* @Date: 2024-11-09 11:43:38
|
|
6
|
+
* @LastEditTime: 2024-12-02 08:32:32
|
|
7
|
+
*/
|
|
8
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { DatabaseTypeCode, EditorThemeType, editorDefaultOptions } from './config';
|
|
11
|
+
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput';
|
|
12
|
+
import ResizeSensor from 'css-element-queries/src/ResizeSensor';
|
|
13
|
+
import './index.less';
|
|
14
|
+
import { removeDefaultActions } from './utils';
|
|
15
|
+
var databaseTypeList = Object.keys(DatabaseTypeCode).map(function (d) {
|
|
16
|
+
return {
|
|
17
|
+
type: d,
|
|
18
|
+
id: d,
|
|
19
|
+
label: d
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
var CodeEditor = function CodeEditor(props, ref) {
|
|
23
|
+
var id = props.id,
|
|
24
|
+
_props$language = props.language,
|
|
25
|
+
language = _props$language === void 0 ? 'sql' : _props$language,
|
|
26
|
+
didMount = props.didMount,
|
|
27
|
+
options = props.options,
|
|
28
|
+
defaultValue = props.defaultValue,
|
|
29
|
+
appendValue = props.appendValue,
|
|
30
|
+
shortcutKey = props.shortcutKey,
|
|
31
|
+
readOnly = props.readOnly,
|
|
32
|
+
foldLevel = props.foldLevel;
|
|
33
|
+
var editorRef = React.useRef();
|
|
34
|
+
var quickInputCommand = React.useRef();
|
|
35
|
+
// const [appTheme] = useTheme();
|
|
36
|
+
var _React$useState = React.useState(false),
|
|
37
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
38
|
+
isActive = _React$useState2[0],
|
|
39
|
+
setIsActive = _React$useState2[1];
|
|
40
|
+
var divRef = React.useRef(null);
|
|
41
|
+
// 编辑器初始化
|
|
42
|
+
React.useEffect(function () {
|
|
43
|
+
var editorIns = monaco.editor.create(document.getElementById("monaco-editor-".concat(id)), _objectSpread(_objectSpread(_objectSpread({}, editorDefaultOptions), options), {}, {
|
|
44
|
+
value: defaultValue || '',
|
|
45
|
+
language: language,
|
|
46
|
+
readOnly: readOnly
|
|
47
|
+
// theme: appTheme.backgroundColor,
|
|
48
|
+
}));
|
|
49
|
+
editorRef.current = editorIns;
|
|
50
|
+
didMount && didMount(editorIns);
|
|
51
|
+
// Add a new command, for getting an accessor.
|
|
52
|
+
quickInputCommand.current = editorIns.addCommand(0, function (accessor, func) {
|
|
53
|
+
// a hacker way to get the input service
|
|
54
|
+
var quickInputService = accessor.get(IQuickInputService);
|
|
55
|
+
func(quickInputService);
|
|
56
|
+
});
|
|
57
|
+
monaco.editor.defineTheme(EditorThemeType.DashboardLightTheme, {
|
|
58
|
+
base: 'vs',
|
|
59
|
+
inherit: true,
|
|
60
|
+
rules: [{
|
|
61
|
+
background: '#15161a'
|
|
62
|
+
}],
|
|
63
|
+
colors: {
|
|
64
|
+
'editor.foreground': '#000000',
|
|
65
|
+
'editor.background': '#f8f9fa' //背景色
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
monaco.editor.defineTheme(EditorThemeType.DashboardBlackTheme, {
|
|
69
|
+
base: 'vs-dark',
|
|
70
|
+
inherit: true,
|
|
71
|
+
rules: [{
|
|
72
|
+
background: '#15161a'
|
|
73
|
+
}],
|
|
74
|
+
colors: {
|
|
75
|
+
'editor.foreground': '#ffffff',
|
|
76
|
+
'editor.background': '#131418' //背景色
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
createAction(editorIns);
|
|
80
|
+
// 自动折叠指定层级数据,需要将folding设为true
|
|
81
|
+
foldLevel && (editorIns === null || editorIns === void 0 ? void 0 : editorIns.trigger('auto-fold', "editor.foldLevel".concat(foldLevel), null));
|
|
82
|
+
return function () {
|
|
83
|
+
if (props.needDestroy) {
|
|
84
|
+
editorRef.current && editorRef.current.dispose();
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
88
|
+
// 如果编辑器聚焦,就设置为true
|
|
89
|
+
React.useEffect(function () {
|
|
90
|
+
var _editorRef$current, _editorRef$current2;
|
|
91
|
+
var focus = function focus() {
|
|
92
|
+
setIsActive(true);
|
|
93
|
+
props.focusChange && props.focusChange(true);
|
|
94
|
+
};
|
|
95
|
+
var blur = function blur() {
|
|
96
|
+
setIsActive(false);
|
|
97
|
+
props.focusChange && props.focusChange(false);
|
|
98
|
+
};
|
|
99
|
+
(_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 ? void 0 : _editorRef$current.onDidFocusEditorText(focus);
|
|
100
|
+
(_editorRef$current2 = editorRef.current) === null || _editorRef$current2 === void 0 ? void 0 : _editorRef$current2.onDidBlurEditorText(blur);
|
|
101
|
+
// 移除监听
|
|
102
|
+
// return () => {
|
|
103
|
+
// editorRef.current?.removeEventListener('focus', focus);
|
|
104
|
+
// editorRef.current?.removeEventListener('blur', blur);
|
|
105
|
+
// };
|
|
106
|
+
}, []);
|
|
107
|
+
React.useEffect(function () {
|
|
108
|
+
if (editorRef.current) {
|
|
109
|
+
shortcutKey === null || shortcutKey === void 0 ? void 0 : shortcutKey(editorRef.current, monaco, isActive);
|
|
110
|
+
}
|
|
111
|
+
}, [editorRef.current, isActive]);
|
|
112
|
+
React.useEffect(function () {
|
|
113
|
+
// 监听浏览器窗口大小变化,重新渲染编辑器
|
|
114
|
+
var resize = function resize() {
|
|
115
|
+
var _editorRef$current3;
|
|
116
|
+
(_editorRef$current3 = editorRef.current) === null || _editorRef$current3 === void 0 ? void 0 : _editorRef$current3.layout();
|
|
117
|
+
};
|
|
118
|
+
window.addEventListener('resize', resize);
|
|
119
|
+
return function () {
|
|
120
|
+
window.removeEventListener('resize', resize);
|
|
121
|
+
};
|
|
122
|
+
}, []);
|
|
123
|
+
var resizeSensorRef = React.useRef(null);
|
|
124
|
+
var onResizeStrategy = function onResizeStrategy() {
|
|
125
|
+
var _editorRef$current4;
|
|
126
|
+
(_editorRef$current4 = editorRef.current) === null || _editorRef$current4 === void 0 ? void 0 : _editorRef$current4.layout();
|
|
127
|
+
};
|
|
128
|
+
React.useEffect(function () {
|
|
129
|
+
if (editorRef.current) {
|
|
130
|
+
try {
|
|
131
|
+
resizeSensorRef.current = new ResizeSensor(divRef.current, onResizeStrategy);
|
|
132
|
+
} catch (ex) {
|
|
133
|
+
console.error(ex);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}, []);
|
|
137
|
+
React.useImperativeHandle(ref, function () {
|
|
138
|
+
return {
|
|
139
|
+
getCurrentSelectContent: getCurrentSelectContent,
|
|
140
|
+
getAllContent: getAllContent,
|
|
141
|
+
setValue: setValue,
|
|
142
|
+
getEditorIns: getEditorIns,
|
|
143
|
+
setAutoFold: setAutoFold,
|
|
144
|
+
setUnfoldAll: setUnfoldAll
|
|
145
|
+
// toFocus,
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
React.useEffect(function () {
|
|
149
|
+
if (appendValue) {
|
|
150
|
+
appendMonacoValue(editorRef.current, appendValue === null || appendValue === void 0 ? void 0 : appendValue.text, appendValue === null || appendValue === void 0 ? void 0 : appendValue.range);
|
|
151
|
+
}
|
|
152
|
+
}, [appendValue]);
|
|
153
|
+
var setValue = function setValue(text, range) {
|
|
154
|
+
var _editorRef$current5;
|
|
155
|
+
appendMonacoValue(editorRef.current, text, range);
|
|
156
|
+
// 自动折叠指定层级数据,需要将folding设为true
|
|
157
|
+
foldLevel && ((_editorRef$current5 = editorRef.current) === null || _editorRef$current5 === void 0 ? void 0 : _editorRef$current5.trigger('auto-fold', "editor.foldLevel".concat(foldLevel), null));
|
|
158
|
+
};
|
|
159
|
+
var getEditorIns = function getEditorIns() {
|
|
160
|
+
return editorRef.current;
|
|
161
|
+
};
|
|
162
|
+
var setAutoFold = function setAutoFold(foldLevel) {
|
|
163
|
+
var _editorRef$current6;
|
|
164
|
+
(_editorRef$current6 = editorRef.current) === null || _editorRef$current6 === void 0 ? void 0 : _editorRef$current6.trigger('auto-fold', "editor.foldLevel".concat(foldLevel), null);
|
|
165
|
+
};
|
|
166
|
+
var setUnfoldAll = function setUnfoldAll() {
|
|
167
|
+
var _editorRef$current7;
|
|
168
|
+
(_editorRef$current7 = editorRef.current) === null || _editorRef$current7 === void 0 ? void 0 : _editorRef$current7.trigger('unfoldAll', 'editor.unfoldAll', null);
|
|
169
|
+
};
|
|
170
|
+
// const toFocus = () => {
|
|
171
|
+
// editorRef.current?.focus();
|
|
172
|
+
// };
|
|
173
|
+
/**
|
|
174
|
+
* 获取当前选中的内容
|
|
175
|
+
* @returns
|
|
176
|
+
*/
|
|
177
|
+
var getCurrentSelectContent = function getCurrentSelectContent() {
|
|
178
|
+
var _editorRef$current8;
|
|
179
|
+
var selection = (_editorRef$current8 = editorRef.current) === null || _editorRef$current8 === void 0 ? void 0 : _editorRef$current8.getSelection();
|
|
180
|
+
if (!selection || selection.isEmpty()) {
|
|
181
|
+
return '';
|
|
182
|
+
} else {
|
|
183
|
+
var _editorRef$current9, _editorRef$current9$g;
|
|
184
|
+
var selectedText = (_editorRef$current9 = editorRef.current) === null || _editorRef$current9 === void 0 ? void 0 : (_editorRef$current9$g = _editorRef$current9.getModel()) === null || _editorRef$current9$g === void 0 ? void 0 : _editorRef$current9$g.getValueInRange(selection);
|
|
185
|
+
return selectedText || '';
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
/** 获取文本所有内容 */
|
|
189
|
+
var getAllContent = function getAllContent() {
|
|
190
|
+
var _editorRef$current0;
|
|
191
|
+
var model = (_editorRef$current0 = editorRef.current) === null || _editorRef$current0 === void 0 ? void 0 : _editorRef$current0.getModel();
|
|
192
|
+
var value = model === null || model === void 0 ? void 0 : model.getValue();
|
|
193
|
+
return value || '';
|
|
194
|
+
};
|
|
195
|
+
var createAction = function createAction(editor) {
|
|
196
|
+
// 默认移除默认的右键菜单
|
|
197
|
+
removeDefaultActions();
|
|
198
|
+
// 用于控制切换该菜单键的显示
|
|
199
|
+
editor.createContextKey('shouldShowSqlRunnerAction', true);
|
|
200
|
+
if (!props.addAction || !props.addAction.length) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
props.addAction.forEach(function (action) {
|
|
204
|
+
var _id = action.id,
|
|
205
|
+
label = action.label,
|
|
206
|
+
keybindings = action.keybindings,
|
|
207
|
+
groupId = action.groupId,
|
|
208
|
+
runFn = action.action;
|
|
209
|
+
editor.addAction({
|
|
210
|
+
id: _id,
|
|
211
|
+
label: label,
|
|
212
|
+
// 控制该菜单键显示
|
|
213
|
+
precondition: 'shouldShowSqlRunnerAction',
|
|
214
|
+
keybindings: action === null || action === void 0 ? void 0 : action.keybindings,
|
|
215
|
+
// 该菜单键位置
|
|
216
|
+
contextMenuGroupId: (action === null || action === void 0 ? void 0 : action.groupId) || 'navigation',
|
|
217
|
+
contextMenuOrder: (action === null || action === void 0 ? void 0 : action.contextMenuOrder) || 1.5,
|
|
218
|
+
// 点击该菜单键后运行
|
|
219
|
+
run: function run(ed) {
|
|
220
|
+
var _editor$getModel;
|
|
221
|
+
var selectedText = ((_editor$getModel = editor.getModel()) === null || _editor$getModel === void 0 ? void 0 : _editor$getModel.getValueInRange(editor.getSelection())) || '';
|
|
222
|
+
if (_id === 'changeSQL') {
|
|
223
|
+
ed.trigger('', quickInputCommand.current, function (quickInput) {
|
|
224
|
+
quickInput.pick(databaseTypeList).then(function (selected) {
|
|
225
|
+
runFn(selectedText, selected === null || selected === void 0 ? void 0 : selected.label);
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
} else {
|
|
229
|
+
runFn(selectedText);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
236
|
+
ref: divRef,
|
|
237
|
+
style: {
|
|
238
|
+
width: '100%',
|
|
239
|
+
height: '100%'
|
|
240
|
+
}
|
|
241
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
242
|
+
ref: ref,
|
|
243
|
+
id: "monaco-editor-".concat(id),
|
|
244
|
+
className: "editor-container"
|
|
245
|
+
}));
|
|
246
|
+
};
|
|
247
|
+
export var appendMonacoValue = function appendMonacoValue(editor, text) {
|
|
248
|
+
var range = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'end';
|
|
249
|
+
if (!editor) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
var model = (editor === null || editor === void 0 ? void 0 : editor.getModel) && editor.getModel(editor);
|
|
253
|
+
// 创建编辑操作,将当前文档内容替换为新内容
|
|
254
|
+
var newRange = range;
|
|
255
|
+
if (range === 'reset') {
|
|
256
|
+
editor.setValue(text || '');
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
var newText = text;
|
|
260
|
+
var lastLine = editor.getModel().getLineCount();
|
|
261
|
+
var lastLineLength = editor.getModel().getLineMaxColumn(lastLine);
|
|
262
|
+
switch (range) {
|
|
263
|
+
// 覆盖所有内容
|
|
264
|
+
case 'cover':
|
|
265
|
+
newRange = model.getFullModelRange();
|
|
266
|
+
editor.revealLine(lastLine);
|
|
267
|
+
break;
|
|
268
|
+
// 在开头添加内容
|
|
269
|
+
case 'front':
|
|
270
|
+
newRange = new monaco.Range(1, 1, 1, 1);
|
|
271
|
+
editor.revealLine(1);
|
|
272
|
+
editor.setPosition({
|
|
273
|
+
lineNumber: 1,
|
|
274
|
+
column: 1
|
|
275
|
+
});
|
|
276
|
+
break;
|
|
277
|
+
// 格式化选中区域的sql
|
|
278
|
+
case 'select':
|
|
279
|
+
{
|
|
280
|
+
var selection = editor.getSelection();
|
|
281
|
+
if (selection) {
|
|
282
|
+
newRange = new monaco.Range(selection.startLineNumber, selection.startColumn, selection.endLineNumber, selection.endColumn);
|
|
283
|
+
}
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
// 在末尾添加内容
|
|
287
|
+
case 'end':
|
|
288
|
+
newRange = new monaco.Range(lastLine, lastLineLength, lastLine, lastLineLength);
|
|
289
|
+
newText = "".concat(text);
|
|
290
|
+
break;
|
|
291
|
+
// 在光标处添加内容
|
|
292
|
+
case 'cursor':
|
|
293
|
+
{
|
|
294
|
+
var position = editor.getPosition();
|
|
295
|
+
if (position) {
|
|
296
|
+
newRange = new monaco.Range(position.lineNumber, position.column, position.lineNumber, position.column);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
break;
|
|
300
|
+
default:
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
var op = {
|
|
304
|
+
range: newRange,
|
|
305
|
+
text: newText
|
|
306
|
+
};
|
|
307
|
+
// decorations?: IModelDeltaDecoration[]: 一个数组类型的参数,用于指定插入的文本的装饰。可以用来设置文本的样式、颜色、背景色等。如果不需要设置装饰,可以忽略此参数。
|
|
308
|
+
var decorations = [{}]; // 解决新增的文本默认背景色为灰色
|
|
309
|
+
editor.executeEdits('setValue', [op], decorations);
|
|
310
|
+
var addedLastLine = editor.getModel().getLineCount();
|
|
311
|
+
// const addedLastLineLength = editor.getModel().getLineMaxColumn(lastLine);
|
|
312
|
+
if (range === 'end') {
|
|
313
|
+
setTimeout(function () {
|
|
314
|
+
editor.revealLine(addedLastLine + 1);
|
|
315
|
+
// editor.setPosition({ lineNumber: addedLastLine, column: addedLastLineLength });
|
|
316
|
+
// editor.focus();
|
|
317
|
+
}, 0);
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
export default /*#__PURE__*/React.forwardRef(CodeEditor);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DatabaseTypeCode } from '../../config';
|
|
2
|
+
export default {
|
|
3
|
+
type: DatabaseTypeCode.CASSANDRA,
|
|
4
|
+
keywords: ['ALTER', 'AND', 'ANY', 'AS', 'ASC', 'AUTHORIZE', 'BATCH', 'BEGIN', 'BY', 'CLUSTERING', 'COLUMNFAMILY', 'COMPACT', 'CONSISTENCY', 'CREATE', 'DELETE', 'DESC', 'DISTINCT', 'DROP', 'EXISTS', 'FILTERING', 'FROM', 'GRANT', 'IF', 'IN', 'INDEX', 'INSERT', 'INTO', 'KEYSPACE', 'LIMIT', 'LIST', 'MODIFY', 'NORECURSIVE', 'NOT', 'NULL', 'OF', 'ON', 'OPTION', 'PARTITION', 'PERMISSION', 'PRIMARY', 'RENAME', 'REVOKE', 'SCHEMA', 'SELECT', 'SET', 'STATIC', 'TABLE', 'TOKEN', 'TRUNCATE', 'TTL', 'TYPE', 'UPDATE', 'USE', 'VALUES', 'WHERE', 'WITH', 'WRITETIME'],
|
|
5
|
+
functions: ['token', 'ttl', 'writetime', 'dateOf', 'now', 'minTimeuuid', 'maxTimeuuid', 'toUnixTimestamp', 'toDate', 'timeuuid', 'uuid', 'blobAsBoolean', 'blobAsInt', 'blobAsBigint', 'blobAsVarint', 'blobAsDouble', 'blobAsFloat', 'blobAsInet', 'blobAsText', 'blobAsString', 'asciiAsBlob', 'bigintAsBlob', 'booleanAsBlob', 'doubleAsBlob', 'floatAsBlob', 'inetAsBlob', 'intAsBlob', 'textAsBlob', 'varcharAsBlob', 'varintAsBlob', 'json', 'count', 'sum', 'avg', 'min', 'max', 'writeTime', ' toJson']
|
|
6
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DatabaseTypeCode } from '../../config';
|
|
2
|
+
export default {
|
|
3
|
+
type: DatabaseTypeCode.CLICKHOUSE,
|
|
4
|
+
keywords: ['ALL', 'ALTER', 'AND', 'ARRAY', 'AS', 'ASCENDING', 'BETWEEN', 'BY', 'CASE', 'CREATE', 'CROSS', 'DESC', 'DESCENDING', 'DISTINCT', 'EXISTS', 'FINAL', 'FORMAT', 'FROM', 'FULL', 'GLOBAL', 'GROUP', 'HAVING', 'INNER', 'INSERT', 'INTERVAL', 'INTO', 'JOIN', 'LEFT', 'LIMIT', 'NOT', 'NULL', 'OFFSET', 'ON', 'OPTIMIZE', 'OR', 'ORDER', 'OUTER', 'PREWHERE', 'RIGHT', 'SAMPLE', 'SELECT', 'SEMI', 'SET', 'SETTINGS', 'TEMPORARY', 'UNION', 'UPDATE', 'USE', 'USING', 'WHEN', 'WHERE', 'WITH'],
|
|
5
|
+
functions: ['abs', 'acos', 'addDays', 'addMonths', 'addYears', 'any', 'anyHeavy', 'anyLast', 'argMax', 'argMin', 'array', 'arrayConcat', 'arrayCount', 'arrayElement', 'arrayEnumerate', 'arrayFilter', 'arrayJoin', 'arrayMap', 'arrayPopBack', 'arrayPopFront', 'arrayPushBack', 'arrayPushFront', 'arraySlice', 'arrayUniq', 'avg', 'bar', 'count', 'covarPop', 'covarSamp', 'currentDatabase', 'dateDiff', 'day', 'exp', 'exp10', 'extract', 'findClusterIndex', 'floor', 'formatDateTime', 'greatCircleAngle', 'hex', 'if', 'ifNotFinite', 'isFinite', 'isInfinite', 'isNaN', 'lagInFrame', 'last_value', 'length', 'ln', 'log', 'log10', 'log2', 'lower', 'ltrim', 'max', 'min', 'month', 'multiIf', 'now', 'now64', 'quantile', 'quantiles', 'rand', 'rand32', 'rand64', 'regexpReplace', 'replaceAll', 'replaceOne', 'round', 'roundAge', 'roundDown', 'rowNumberInBlock', 'runningDifference', 'sin', 'sqrt', 'startsWith', 'stddevPop', 'stddevSamp', 'substring', 'sum', 'tan', 'timeSlot', 'toDate', 'toDateTime', 'toFixedString', 'toHour', 'toISOWeek', 'toISOYear', 'toMinute', 'toMonday', 'toMonth', 'toQuarter', 'toRelativeHour', 'toRelativeMinute', 'toRelativeSecond', 'toSecond', 'toString', 'toStartOfDay', 'toStartOfHour', 'toStartOfMinute', 'toStartOfMonth', 'toStartOfQuarter', 'toStartOfWeek', 'toStartOfYear', 'toTime', 'toUnixTimestamp', 'toUUID', 'toWeek', 'toYear', 'toYYYYMM', 'toYYYYMMDD', 'toYYYYMMDDhhmmss', 'trim', 'trunc', 'uniq', 'uniqExact', 'upper', 'varPop', 'varSamp', 'week', 'year']
|
|
6
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DatabaseTypeCode } from '../../config';
|
|
2
|
+
export default {
|
|
3
|
+
type: DatabaseTypeCode.DM,
|
|
4
|
+
keywords: ['ABORT', 'ACCESSED', 'ACCOUNT', 'ACROSS', 'ACTION', 'ADVANCED', 'AFTER', 'AGGREGATE', 'ALLOW_DATETIME', 'ALLOW_IP', 'ANALYZE', 'APPLY', 'APR', 'ARCHIVE', 'ARCHIVEDIR', 'ARCHIVELOG', 'ARCHIVESTYLE', 'ASCII', 'ASENSITIVE', 'ASYNCHRONOUS', 'AT', 'ATTACH', 'AUG', 'AUTHID', 'AUTO', 'AUTOEXTEND', 'AUTONOMOUS_TRANSACTION', 'AVG', 'BACKED', 'BACKUP', 'BACKUPDIR', 'BACKUPINFO', 'BACKUPSET', 'BADFILE', 'BAKFILE', 'BASE', 'BATCH', 'BEFORE', 'BIGINT', 'BIT', 'BITMAP', 'BLOB', 'BLOCK', 'BOOLEAN', 'BRANCH', 'BREADTH', 'BTREE', 'BUFFER', 'BUILD', 'BULK', 'BYDAY', 'BYHOUR', 'BYMINUTE', 'BYMONTH', 'BYMONTHDAY', 'BYSECOND', 'BYWEEKNO', 'BYYEARDAY', 'CACHE', 'CALCULATE', 'CASCADE', 'CASCADED', 'CASE_SENSITIVE', 'CATALOG', 'CHAIN', 'CHANGE', 'CHARACTER', 'CHARACTERISTICS', 'CHECKPOINT', 'CIPHER', 'CLOB', 'CLOSE', 'COLLATE', 'COLLECT', 'COLUMNS', 'COMMITTED', 'COMPILE', 'COMPLETE', 'COMPRESS', 'COMPRESSED', 'CONDITIONAL', 'CONNECT_BY_ISCYCLE', 'CONNECT_BY_ISLEAF', 'CONNECT_IDLE_TIME', 'CONNECT_TIME', 'CONSTANT', 'CONSTRAINTS', 'CONSTRUCTOR', 'COPY', 'CORRUPT', 'COUNT', 'COUNTER', 'CPU_PER_CALL', 'CPU_PER_SESSION', 'CTLFILE', 'CUMULATIVE', 'CURRENT_SCHEMA', 'CURRENT_USER', 'CYCLE', 'DAILY', 'DANGLING', 'DATA', 'DATABASE', 'DATAFILE', 'DATE', 'DATETIME', 'DAY', 'DBFILE', 'DDL', 'DDL_CLONE', 'DEBUG', 'DEC', 'DEFERRABLE', 'DEFERRED', 'DEFINER', 'DELETING', 'DELIMITED', 'DELTA', 'DEMAND', 'DENSE_RANK', 'DEPTH', 'DEREF', 'DETACH', 'DETERMINISTIC', 'DEVICE', 'DIAGNOSTICS', 'DICTIONARY', 'DIRECTORY', 'DISCONNECT', 'DISKGROUP', 'DML', 'DOWN', 'DUMP', 'EACH', 'EDITIONABLE', 'EMPTY', 'ENCRYPT', 'ENCRYPTION', 'ERROR', 'ERRORS', 'ESCAPE', 'EVALNAME', 'EVENTINFO', 'EVENTS', 'EXCEPT', 'EXCEPTION', 'EXCEPTION_INIT', 'EXCEPTIONS', 'EXCLUDE', 'EXCLUDING', 'EXCLUSIVE', 'EXPIRE', 'EXTENDS', 'EXTERNAL', 'EXTERNALLY', 'FAILED_LOGIN_ATTEMPS', 'FAILED_LOGIN_ATTEMPTS', 'FAST', 'FEB', 'FIELDS', 'FILE', 'FILEGROUP', 'FILESIZE', 'FILLFACTOR', 'FOLLOWS', 'FOLLOWING', 'FORALL', 'FORCE', 'FORMAT', 'FREQ', 'FREQUENCE', 'FRI', 'GENERATED', 'GLOBAL', 'GLOBALLY', 'GLOBAL_SESSION_PER_USER', 'GREAT', 'HASH', 'HASHPARTMAP', 'HEXTORAW', 'HIGH', 'HOLD', 'HOUR', 'HOURLY', 'HUGE', 'IDENTIFIED', 'IDENTIFIER', 'IDENTITY_INSERT', 'IGNORE_ROW_ON_DUPKEY_INDEX', 'IMAGE', 'INCLUDE', 'INCLUDING', 'INCREASE', 'INCREMENT', 'INDEXES', 'INDICES', 'INITIAL', 'INITIALIZED', 'INITIALLY', 'INNERID', 'INPUT', 'INSENSITIVE', 'INSERTING', 'INSTANCE', 'INSTANTIABLE', 'INSTEAD', 'INTEGER', 'INTENT', 'INVISIBLE', 'ISOLATION', 'INACTIVE_ACCOUNT_TIME', 'JAN', 'JAVA', 'JOB', 'JSON', 'JUL', 'JUN', 'KEY', 'KEYS', 'LABEL', 'LAST', 'LAX', 'LEFTARG', 'LEVEL', 'LEVELS', 'LIMIT', 'LINK', 'LOB', 'LOCAL', 'LOCAL_OBJECT', 'LOCALLY', 'LOCATION', 'LOCK', 'LOCKED', 'LOG', 'LOGFILE', 'LOGGING', 'LOGOFF', 'LOGON', 'LOGOUT', 'LONG', 'LONGVARBINARY', 'LONGVARCHAR', 'LSN', 'MANUAL', 'MAP', 'MAPPED', 'MAR', 'MATCH', 'MATCHED', 'MATERIALIZED', 'MAX', 'MAX_RUN_DURATION', 'MAXPIECESIZE', 'MAXSIZE', 'MAXVALUE', 'MAY', 'MEM_SPACE', 'MEMORY', 'MERGE', 'MICRO', 'MIN', 'MINEXTENTS', 'MINUTE', 'MINUTELY', 'MINVALUE', 'MIRROR', 'MOD', 'MODE', 'MODIFY', 'MON', 'MONEY', 'MONITORING', 'MONTH', 'MONTHLY', 'MOUNT', 'MOVE', 'MOVEMENT', 'NATIONAL', 'NCHAR', 'NCHARACTER', 'NEVER', 'NO', 'NOARCHIVELOG', 'NOAUDIT', 'NOBRANCH', 'NOCACHE', 'NODE', 'NOLOGGING', 'NOMAXVALUE', 'NOMINVALUE', 'NOMONITORING', 'NONE', 'NONEDITIONABLE', 'NOORDER', 'NOPARALLEL', 'NORMAL', 'NOROWDEPENDENCIES', 'NOT_ALLOW_DATETIME', 'NOT_ALLOW_IP', 'NOV', 'NOVALIDATE', 'NOWAIT', 'NULLS', 'NUMBER', 'NUMERIC', 'OCT', 'OFF', 'OFFLINE', 'OFFSET', 'OIDINDEX', 'OLD', 'ONCE', 'ONLINE', 'ONLY', 'OPEN', 'OPERATOR', 'OPTION', 'ORDINALITY', 'OUTER', 'OVERLAPS', 'OVERRIDING', 'PACKAGE', 'PAD', 'PAGE', 'PARALLEL', 'PARALLEL_ENABLE', 'PARMS', 'PARTIAL', 'PARTITIONS', 'PASSING', 'PASSWORD', 'PASSWORD_GRACE_TIME', 'PASSWORD_LIFE_TIME', 'PASSWORD_LOCK_TIME', 'PASSWORD_POLICY', 'PASSWORD_REUSE_MAX', 'PASSWORD_REUSE_TIME', 'PATH', 'PIPELINED', 'PIVOT', 'PLACING', 'PLS_INTEGER', 'PRAGMA', 'PREBUILT', 'PRECEDES', 'PRECEDING', 'PRECISION', 'PRESERVE', 'PRETTY', 'PRIVILEGE', 'PROFILE', 'PURGE', 'QUERY_REWRITE_INTEGRITY', 'QUOTA', 'RANDOMLY', 'RANGE', 'RAWTOHEX', 'READ', 'READ_PER_CALL', 'READ_PER_SESSION', 'READONLY', 'REAL', 'REBUILD', 'RECORDS', 'REDUCED', 'REFRESH', 'REJECT', 'RELATED', 'RELEASE', 'RENAME', 'REPEATABLE', 'REPLACE', 'REPLAY', 'RESIZE', 'RESTORE', 'RESTRICT', 'RESTRICT_REFERENCES', 'RESULT', 'RESULT_CACHE', 'RIGHTARG', 'ROLE', 'ROLLFILE', 'ROOT', 'ROWCOUNT', 'ROWDEPENDENCIES', 'ROWID', 'RULE', 'SALT', 'SAMPLE', 'SAT', 'SAVE', 'SCHEMABINDING', 'SCN', 'SCOPE', 'SCROLL', 'SEARCH', 'SECOND', 'SECONDLY', 'SEED', 'SELF', 'SELECT', 'SENSITIVE', 'SEP', 'SEQUENCE', 'SERERR', 'SERIALIZABLE', 'SERVER', 'SESSION', 'SESSION_PER_USER', 'SHADOW', 'SHARE', 'SHUTDOWN', 'SIBLINGS', 'SIMPLE', 'SINCE', 'SIZE', 'SKIP', 'SMALLINT', 'SNAPSHOT', 'SOUND', 'SPACE', 'SPAN', 'SPATIAL', 'SPEED', 'SPFILE', 'SPLIT', 'SQL', 'STANDBY', 'STARTUP', 'STAT', 'STATEMENT', 'STDDEV', 'STOP', 'STORAGE', 'STORE', 'STRICT', 'STRING', 'STRIPING', 'STYLE', 'SUBPARTITIONS', 'SUBSCRIBE', 'SUBSTITUTABLE', 'SUBSTRING', 'SUBTYPE', 'SUCCESSFUL', 'SUM', 'SUN', 'SUSPEND', 'SYNC', 'SYNCHRONOUS', 'SYS_CONNECT_BY_PATH', 'SYSTEM', 'TABLE', 'TABLESPACE', 'TASK', 'TEMPLATE', 'TEMPORARY', 'TEXT', 'THEN', 'THREAD', 'THROUGH', 'THU', 'TIES', 'TIME', 'TIME_ZONE', 'TIMER', 'TIMES', 'TIMESTAMP', 'TINYINT', 'TRACE', 'TRACKING', 'TRANSACTION', 'TRANSACTIONAL', 'TRIGGERS', 'TRUNCSIZE', 'TRXID', 'TUE', 'TYPE', 'UNBOUNDED', 'UNCOMMITTED', 'UNCONDITIONAL', 'UNDER', 'UNLIMITED', 'UNLOCK', 'UNPIVOT', 'UNUSABLE', 'UP', 'UPDATING', 'USAGE', 'USE_HASH', 'USE_MERGE', 'USE_NL', 'USE_NL_WITH_INDEX', 'VALUE', 'VALIDATE', 'VARBINARY', 'VARCHAR', 'VARCHAR2', 'VARIANCE', 'VARYING', 'VERSIONS_ENDTIME', 'VERSIONS_ENDTRXID', 'VERSIONS_OPERATION', 'VERSIONS_STARTTIME', 'VERSIONS_STARTTRXID', 'VERTICAL', 'VISIBLE', 'VSIZE', 'WAIT', 'WED', 'WEEK', 'WEEKLY', 'WORK', 'WRAPPED', 'WRAPPER', 'WRITE', 'YEAR', 'YEARLY', 'ZONE'],
|
|
5
|
+
functions: ['ABS', 'ACOS', 'ASIN', 'ATAN', 'ATAN2', 'CEIL', 'CEILING', 'COS', 'COSH', 'COT', 'DEGREES', 'EXP', 'FLOOR', 'GREATEST', 'GREAT', 'LEAST', 'LN', 'LOG', 'LOG10', 'MOD', 'PI', 'POWER', 'POWER2', 'RADIANS', 'RAND', 'ROUND', 'SIGN', 'SIN', 'SINH', 'SQRT', 'TAN', 'TANH', 'TO_NUMBER', 'TRUNC', 'TRUNCATE', 'TO_CHAR', 'BITAND', 'NANVL', 'REMAINDER', 'TO_BINARY_FLOAT', 'TO_BINARY_DOUBLE', 'BIN_TO_NUM', 'FOUND_ROWS', 'ASCII', 'ASCIISTR', 'BIT_LENGTH', 'CHAR', 'CHAR_LENGTH', 'CHARACTER_LENGTH', 'CHR', 'NCHR', 'CONCAT', 'DIFFERENCE', 'INITCAP', 'INS', 'INSERT', 'INSSTR', 'INSTR', 'INSTRB', 'INSTRC', 'LCASE', 'LEFT', 'LEFTSTR', 'LEN', 'LENGTH', 'LENGTHC', 'LENGTH2', 'LENGTH4', 'OCTET_LENGTH', 'LOCATE', 'LOWER', 'LPAD', 'LTRIM', 'POSITION', 'REPEAT', 'REPEATSTR', 'REPLACE', 'REPLICATE', 'REVERSE', 'RIGHT', 'RIGHTSTR', 'RPAD', 'RTRIM', 'SOUNDEX', 'SPACE', 'STRPOSDEC', 'STRPOSINC', 'STUFF', 'SUBSTR', 'SUBSTRING', 'SUBSTRB', 'TRANSLATE', 'TRIM', 'UCASE', 'UPPER', 'NLS_UPPER', 'NLS_LOWER', 'REGEXP', 'OVERLAY', 'TEXT_EQUAL', 'BLOB_EQUAL', 'NLSSORT', 'GREATEST', 'GREAT', 'TO_SINGLE_BYTE', 'TO_MULTI_BYTE', 'EMPTY_CLOB', 'EMPTY_BLOB', 'UNISTR', 'ISNULL', 'CONCAT_WS', 'SUBSTRING_INDEX', 'COMPOSE', 'FIND_IN_SET', 'TRUNC', 'TO_BASE64', 'FROM_BASE64', 'ADD_DAYS', 'ADD_MONTHS', 'ADD_WEEKS', 'CURDATE', 'CURTIME', 'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'DATEADD', 'DATEDIFF', 'DATEPART', 'DAY', 'DAYNAME', 'DAYOFMONTH', 'DAYOFWEEK', 'DAYOFYEAR', 'DAYS_BETWEEN', 'EXTRACT', 'GETDATE', 'GREATEST', 'GREAT', 'HOUR', 'LAST_DAY', 'LEAST', 'MINUTE', 'MONTH', 'MONTHNAME', 'MONTHS_BETWEEN', 'NEXT_DAY', 'NOW', 'QUARTER', 'SECOND', 'ROUND', 'TIMESTAMPADD', 'TIMESTAMPDIFF', 'SYSDATE', 'TO_DATE', 'TO_TIMESTAMP', 'TO_TIMESTAMP_TZ', 'FROM_TZ', 'TZ_OFFSET', 'TRUNC', 'WEEK', 'WEEKDAY', 'WEEKS_BETWEEN', 'YEAR', 'YEARS_BETWEEN', 'LOCALTIME', 'LOCALTIMESTAMP', 'OVERLAPS', 'SYSTIMESTAMP', 'NUMTODSINTERVAL', 'NUMTOYMINTERVAL', 'UNIX_TIMESTAMP', 'FROM_UNIXTIME', 'SESSIONTIMEZONE', 'DBTIMEZONE', 'DATE_FORMAT', 'TIME_TO_SEC', 'SEC_TO_TIME', 'TO_DAYS', 'DATE_ADD', 'DATE_SUB', 'SYS_EXTRACT_UTC', 'TO_DSINTERVAL', 'TO_YMINTERVAL', 'COALESCE', 'IFNULL', 'ISNULL', 'NULLIF', 'NVL', 'NULL_EQU', 'CAST', 'CONVERT', 'HEXTORAW', 'RAWTOHEX', 'BINTOCHAR', 'TO_BLOB', 'UNHEX', 'HEX', 'CHARTOBIN', 'DECODE', 'ISDATE', 'ISNUMERIC', 'DM_HASH', 'LNNVL', 'LENGTHB', 'FIELD', 'ORA_HASH', 'IF', 'WIDTH_BUCKET', 'OBJECT_ID']
|
|
6
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
postgresql: {
|
|
3
|
+
type: import("../../config").DatabaseTypeCode;
|
|
4
|
+
keywords: string[];
|
|
5
|
+
functions: string[];
|
|
6
|
+
};
|
|
7
|
+
cassandra: {
|
|
8
|
+
type: import("../../config").DatabaseTypeCode;
|
|
9
|
+
keywords: string[];
|
|
10
|
+
functions: string[];
|
|
11
|
+
};
|
|
12
|
+
redis: {
|
|
13
|
+
type: import("../../config").DatabaseTypeCode;
|
|
14
|
+
keywords: string[];
|
|
15
|
+
functions: any[];
|
|
16
|
+
};
|
|
17
|
+
dm: {
|
|
18
|
+
type: import("../../config").DatabaseTypeCode;
|
|
19
|
+
keywords: string[];
|
|
20
|
+
functions: string[];
|
|
21
|
+
};
|
|
22
|
+
sqlserver: {
|
|
23
|
+
type: import("../../config").DatabaseTypeCode;
|
|
24
|
+
keywords: string[];
|
|
25
|
+
functions: string[];
|
|
26
|
+
};
|
|
27
|
+
clickhouse: {
|
|
28
|
+
type: import("../../config").DatabaseTypeCode;
|
|
29
|
+
keywords: string[];
|
|
30
|
+
functions: string[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: wangxian
|
|
3
|
+
* @Date: 2024-11-11 14:17:42
|
|
4
|
+
* @LastEditTime: 2024-11-11 14:17:45
|
|
5
|
+
*/
|
|
6
|
+
import postgresql from './pgsql';
|
|
7
|
+
import cassandra from './cassandra';
|
|
8
|
+
import redis from './redis';
|
|
9
|
+
import dm from './dm';
|
|
10
|
+
import sqlserver from './sqlserver';
|
|
11
|
+
import clickhouse from './clickhouse';
|
|
12
|
+
export default {
|
|
13
|
+
postgresql: postgresql,
|
|
14
|
+
cassandra: cassandra,
|
|
15
|
+
redis: redis,
|
|
16
|
+
dm: dm,
|
|
17
|
+
sqlserver: sqlserver,
|
|
18
|
+
clickhouse: clickhouse
|
|
19
|
+
};
|