@ebuilding/base 2.0.0 → 2.0.1
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/components/codemirror/index.d.ts +1 -0
- package/components/codemirror/src/default/index.d.ts +210 -0
- package/components/codemirror/src/index.module.d.ts +7 -0
- package/components/codemirror/src/public_api.d.ts +2 -0
- package/components/codemirror/src/tools/common.d.ts +17 -0
- package/components/codemirror/src/tools/formula.d.ts +31 -0
- package/fesm2022/components.codemirror.mjs +2335 -0
- package/fesm2022/components.codemirror.mjs.map +1 -0
- package/fesm2022/shared.var.mjs +1 -1
- package/fesm2022/shared.var.mjs.map +1 -1
- package/fesm2022/var.shared.constant.mjs +1 -1
- package/fesm2022/var.shared.constant.mjs.map +1 -1
- package/package.json +235 -231
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/public_api';
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { AfterViewInit, DoCheck, ElementRef, EventEmitter, KeyValueDiffers, NgZone, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core";
|
|
2
|
+
import { ControlValueAccessor } from "@angular/forms";
|
|
3
|
+
import { NzConfigService } from "ng-zorro-antd/core/config";
|
|
4
|
+
import { NzMessageService } from "ng-zorro-antd/message";
|
|
5
|
+
import CodeMirror from 'codemirror';
|
|
6
|
+
import { Editor, EditorFromTextArea } from "codemirror";
|
|
7
|
+
import { Formula } from "../tools/formula";
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
type FormulaType = (a?: any, b?: any, c?: any, d?: any) => boolean;
|
|
10
|
+
export declare interface IFormulaClass {
|
|
11
|
+
FormulaUsage?: {
|
|
12
|
+
category: string;
|
|
13
|
+
categoryCode: string;
|
|
14
|
+
contains: {
|
|
15
|
+
name: string;
|
|
16
|
+
intro: string;
|
|
17
|
+
usage: string;
|
|
18
|
+
example: string;
|
|
19
|
+
}[];
|
|
20
|
+
}[];
|
|
21
|
+
Formula?: {
|
|
22
|
+
[funcName: string]: FormulaType;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare class GramCodemirrorComponent implements AfterViewInit, OnDestroy, ControlValueAccessor, OnChanges, DoCheck, OnInit {
|
|
26
|
+
private _differs;
|
|
27
|
+
private _ngZone;
|
|
28
|
+
el: ElementRef;
|
|
29
|
+
private message;
|
|
30
|
+
private nzConfigService;
|
|
31
|
+
private fmlService;
|
|
32
|
+
itemTitle: {};
|
|
33
|
+
set options(value: {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* 可用变量对象
|
|
38
|
+
* {
|
|
39
|
+
* formFields:[],tableList:[]
|
|
40
|
+
* }
|
|
41
|
+
*/
|
|
42
|
+
set fieldData(value: any);
|
|
43
|
+
get fieldData(): any;
|
|
44
|
+
/**
|
|
45
|
+
* 黑名单 值为函数名数组
|
|
46
|
+
*/
|
|
47
|
+
blacklist: Array<string>;
|
|
48
|
+
/**
|
|
49
|
+
* 启用默认黑名单
|
|
50
|
+
* 默认黑名单与blackList合并
|
|
51
|
+
*/
|
|
52
|
+
enableDefaultBlack: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* 显示的公式 值显示列表内指定公式
|
|
55
|
+
*/
|
|
56
|
+
showList: Array<string>;
|
|
57
|
+
get dateType(): string;
|
|
58
|
+
set variableSearch(value: string);
|
|
59
|
+
get variableSearch(): string;
|
|
60
|
+
set usageFunSearch(value: string);
|
|
61
|
+
get usageFunSearch(): string;
|
|
62
|
+
/**
|
|
63
|
+
* 所有支持函数分组信息
|
|
64
|
+
* name 分组名称 string
|
|
65
|
+
* code 分组code string
|
|
66
|
+
* items 函数名集合 string[]
|
|
67
|
+
*/
|
|
68
|
+
get globalCategorys(): any[];
|
|
69
|
+
/**
|
|
70
|
+
* 获取全局CodeMirror
|
|
71
|
+
*/
|
|
72
|
+
get codeMirrorGlobal(): any;
|
|
73
|
+
name: string;
|
|
74
|
+
title: string;
|
|
75
|
+
autoFocus: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* 函数显示类型
|
|
78
|
+
* 班次 attendance 所有 // attendance-items 精度 进位规则
|
|
79
|
+
*
|
|
80
|
+
* 与categorys互斥,有type时使用type
|
|
81
|
+
*/
|
|
82
|
+
type: string;
|
|
83
|
+
/**
|
|
84
|
+
* 显示的函数组
|
|
85
|
+
* 与type 互斥,如果type有值,当前参数无效。
|
|
86
|
+
*/
|
|
87
|
+
categorys: Array<string>;
|
|
88
|
+
/**
|
|
89
|
+
* 自定义公式
|
|
90
|
+
*/
|
|
91
|
+
formulaClass: IFormulaClass;
|
|
92
|
+
typeList: any;
|
|
93
|
+
preserveScrollPosition: boolean;
|
|
94
|
+
labelMap: any;
|
|
95
|
+
_fieldData: any;
|
|
96
|
+
cursorActivity: EventEmitter<CodeMirror.Editor>;
|
|
97
|
+
focusChange: EventEmitter<boolean>;
|
|
98
|
+
scroll: EventEmitter<CodeMirror.ScrollInfo>;
|
|
99
|
+
drop: EventEmitter<[CodeMirror.Editor, DragEvent]>;
|
|
100
|
+
textChange: EventEmitter<any>;
|
|
101
|
+
ref: ElementRef;
|
|
102
|
+
fml: any;
|
|
103
|
+
value: string;
|
|
104
|
+
disabled: boolean;
|
|
105
|
+
isFocused: boolean;
|
|
106
|
+
codeMirror?: EditorFromTextArea;
|
|
107
|
+
/**
|
|
108
|
+
* 存放匹配的变量集合
|
|
109
|
+
*/
|
|
110
|
+
variableSearchList: any[];
|
|
111
|
+
/**
|
|
112
|
+
* 存放匹配的函数集合
|
|
113
|
+
*/
|
|
114
|
+
usageFunSearchList: any[];
|
|
115
|
+
FormulaUsage: any[];
|
|
116
|
+
/**
|
|
117
|
+
* 查询可用变量
|
|
118
|
+
*/
|
|
119
|
+
_variableSearch: any;
|
|
120
|
+
/**
|
|
121
|
+
* 查询可用函数
|
|
122
|
+
*/
|
|
123
|
+
_usageFunSearch: any;
|
|
124
|
+
/**
|
|
125
|
+
* 函数描述
|
|
126
|
+
*/
|
|
127
|
+
usageDescription: string;
|
|
128
|
+
private _codeMirror;
|
|
129
|
+
private _differ?;
|
|
130
|
+
private _options;
|
|
131
|
+
private _fomulaContext;
|
|
132
|
+
/**
|
|
133
|
+
* 默认公式
|
|
134
|
+
*/
|
|
135
|
+
private defaultFml;
|
|
136
|
+
constructor(_differs: KeyValueDiffers, _ngZone: NgZone, el: ElementRef, message: NzMessageService, nzConfigService: NzConfigService, fmlService: Formula);
|
|
137
|
+
ngOnInit(): void;
|
|
138
|
+
/**
|
|
139
|
+
* 根据黑名单过滤公式
|
|
140
|
+
*/
|
|
141
|
+
filterUsageByBlackList(formulaUsage: any): any[];
|
|
142
|
+
/**
|
|
143
|
+
* 组装显示的函数
|
|
144
|
+
*/
|
|
145
|
+
resolveDisplayFormula(): string[];
|
|
146
|
+
/**
|
|
147
|
+
* 组装FomulaContext
|
|
148
|
+
*/
|
|
149
|
+
resolveFomulaContext(): string[];
|
|
150
|
+
/**
|
|
151
|
+
* 组装 this.FormulaUsage
|
|
152
|
+
*/
|
|
153
|
+
setFormulaUsage(): void;
|
|
154
|
+
ngAfterViewInit(): void;
|
|
155
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
156
|
+
ngDoCheck(): void;
|
|
157
|
+
ngOnDestroy(): void;
|
|
158
|
+
/**
|
|
159
|
+
* set FormulaClass
|
|
160
|
+
* @param formulaCalss
|
|
161
|
+
*/
|
|
162
|
+
setFormulaClass(formulaCalss: any): void;
|
|
163
|
+
codemirrorValueChanged(cm: any, change: any): void;
|
|
164
|
+
setOptionIfChanged(optionName: string, newValue: any): void;
|
|
165
|
+
focusChanged(focused: boolean): void;
|
|
166
|
+
scrollChanged(cm: Editor): void;
|
|
167
|
+
cursorActive(cm: Editor): void;
|
|
168
|
+
dropFiles(cm: Editor, e: DragEvent): void;
|
|
169
|
+
writeValue(value: string): void;
|
|
170
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
171
|
+
registerOnTouched(fn: () => void): void;
|
|
172
|
+
setDisabledState(isDisabled: boolean): void;
|
|
173
|
+
/**
|
|
174
|
+
* 函数鼠标滑动时事件
|
|
175
|
+
* @param e
|
|
176
|
+
*/
|
|
177
|
+
usageMouseover(e: any): void;
|
|
178
|
+
/**
|
|
179
|
+
* 插入函数
|
|
180
|
+
* @param e
|
|
181
|
+
*/
|
|
182
|
+
insertUsageFun(e: any): void;
|
|
183
|
+
/**
|
|
184
|
+
* 插入可用变量
|
|
185
|
+
* @param event
|
|
186
|
+
*/
|
|
187
|
+
insertField(event: any): void;
|
|
188
|
+
/**
|
|
189
|
+
* 复制
|
|
190
|
+
*/
|
|
191
|
+
btnCopy(): void;
|
|
192
|
+
/**
|
|
193
|
+
* 粘贴
|
|
194
|
+
*/
|
|
195
|
+
btnPaste(): void;
|
|
196
|
+
/**
|
|
197
|
+
* 清空
|
|
198
|
+
*/
|
|
199
|
+
btnClear(): void;
|
|
200
|
+
private onChange;
|
|
201
|
+
private onTouched;
|
|
202
|
+
private markField;
|
|
203
|
+
private insertBarcket;
|
|
204
|
+
private getValue;
|
|
205
|
+
private fakeLabel;
|
|
206
|
+
private setValue;
|
|
207
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GramCodemirrorComponent, never>;
|
|
208
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GramCodemirrorComponent, "deon-codemirror", never, { "itemTitle": { "alias": "itemTitle"; "required": false; }; "options": { "alias": "options"; "required": false; }; "fieldData": { "alias": "fieldData"; "required": false; }; "blacklist": { "alias": "blacklist"; "required": false; }; "enableDefaultBlack": { "alias": "enableDefaultBlack"; "required": false; }; "showList": { "alias": "showList"; "required": false; }; "name": { "alias": "name"; "required": false; }; "title": { "alias": "title"; "required": false; }; "autoFocus": { "alias": "autoFocus"; "required": false; }; "type": { "alias": "type"; "required": false; }; "categorys": { "alias": "categorys"; "required": false; }; "formulaClass": { "alias": "formulaClass"; "required": false; }; "preserveScrollPosition": { "alias": "preserveScrollPosition"; "required": false; }; }, { "cursorActivity": "cursorActivity"; "focusChange": "focusChange"; "scroll": "scroll"; "drop": "drop"; "textChange": "textChange"; }, never, never, true, never>;
|
|
209
|
+
}
|
|
210
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./default/index";
|
|
3
|
+
export declare class GramCodemirrorModule {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GramCodemirrorModule, never>;
|
|
5
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<GramCodemirrorModule, never, [typeof i1.GramCodemirrorComponent], [typeof i1.GramCodemirrorComponent]>;
|
|
6
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<GramCodemirrorModule>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 根据关键字匹配变量
|
|
3
|
+
* @param key
|
|
4
|
+
* @param fieldVariable
|
|
5
|
+
*/
|
|
6
|
+
export declare function searchVariable(key: string, fieldVariable: any): any[];
|
|
7
|
+
/**
|
|
8
|
+
* 根据关键字匹配变量 fieldVariable 为数组
|
|
9
|
+
* @param key
|
|
10
|
+
* @param fieldVariable
|
|
11
|
+
*/
|
|
12
|
+
export declare function searchArrayVariable(key: string, groupArray: any): any[];
|
|
13
|
+
/**
|
|
14
|
+
* 根据关键字匹配函数
|
|
15
|
+
* @param key
|
|
16
|
+
*/
|
|
17
|
+
export declare function searchUsageFun(key: string, formulaUsage: any[]): any[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { InjectionToken } from "@angular/core";
|
|
2
|
+
export declare const KRE_CODEMIRROR_TOKEN: InjectionToken<any>;
|
|
3
|
+
export declare class Formula {
|
|
4
|
+
FormulaUsage: {
|
|
5
|
+
category: string;
|
|
6
|
+
contains: {
|
|
7
|
+
name: string;
|
|
8
|
+
intro: string;
|
|
9
|
+
usage: string;
|
|
10
|
+
example: string;
|
|
11
|
+
}[];
|
|
12
|
+
}[];
|
|
13
|
+
FormulaEditor: {
|
|
14
|
+
CONST: {
|
|
15
|
+
NAME_FILED_CLS: string;
|
|
16
|
+
VALUE_FIELD_CLS: string;
|
|
17
|
+
INVALID_FIELD_CLS: string;
|
|
18
|
+
DEPRECATE_FIELD_CLS: string;
|
|
19
|
+
NEGATIVE_FIELD_CLS: string;
|
|
20
|
+
FIELD_REG: RegExp;
|
|
21
|
+
};
|
|
22
|
+
COMMON_REG: {
|
|
23
|
+
VALIDATOR_FORMULA: string;
|
|
24
|
+
FORM_FORMULA: string;
|
|
25
|
+
NEW_LINE: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
Utils: any;
|
|
29
|
+
Formula: any;
|
|
30
|
+
constructor();
|
|
31
|
+
}
|