ng-zorro-antd-extension 17.4.4 → 17.4.6
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/blank-field/blank-field.component.d.ts +1 -0
- package/esm2022/blank-field/blank-field.component.mjs +20 -10
- package/esm2022/print/nzx-print-v.component.mjs +15 -10
- package/esm2022/util/lib/scrollToInvalidControl.mjs +29 -0
- package/esm2022/util/public-api.mjs +2 -1
- package/esm2022/wang-editor-next/ng-zorro-antd-extension-wang-editor-next.mjs +5 -0
- package/esm2022/wang-editor-next/public-api.mjs +9 -0
- package/esm2022/wang-editor-next/type.mjs +2 -0
- package/esm2022/wang-editor-next/wang-editor.component.mjs +247 -0
- package/esm2022/wang-editor-next/wang-editor.module.mjs +19 -0
- package/esm2022/wang-editor-next/wang-toolbar.component.mjs +57 -0
- package/fesm2022/ng-zorro-antd-extension-blank-field.mjs +19 -9
- package/fesm2022/ng-zorro-antd-extension-blank-field.mjs.map +1 -1
- package/fesm2022/ng-zorro-antd-extension-print.mjs +13 -9
- package/fesm2022/ng-zorro-antd-extension-print.mjs.map +1 -1
- package/fesm2022/ng-zorro-antd-extension-util.mjs +30 -1
- package/fesm2022/ng-zorro-antd-extension-util.mjs.map +1 -1
- package/fesm2022/ng-zorro-antd-extension-wang-editor-next.mjs +328 -0
- package/fesm2022/ng-zorro-antd-extension-wang-editor-next.mjs.map +1 -0
- package/package.json +14 -7
- package/print/nzx-print-v.component.d.ts +3 -1
- package/util/lib/scrollToInvalidControl.d.ts +7 -0
- package/util/public-api.d.ts +1 -0
- package/wang-editor-next/index.d.ts +5 -0
- package/wang-editor-next/public-api.d.ts +8 -0
- package/wang-editor-next/type.d.ts +3 -0
- package/wang-editor-next/wang-editor.component.d.ts +43 -0
- package/wang-editor-next/wang-editor.module.d.ts +9 -0
- package/wang-editor-next/wang-toolbar.component.d.ts +19 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { EventEmitter, forwardRef, Directive, Input, Output, HostBinding, NgModule } from '@angular/core';
|
|
4
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
5
|
+
import { createEditor, DomEditor, createToolbar } from '@wangeditor-next/editor';
|
|
6
|
+
|
|
7
|
+
/* eslint-disable @angular-eslint/no-output-on-prefix */
|
|
8
|
+
class NzxWangEditorDirective {
|
|
9
|
+
constructor(editorRef, cd) {
|
|
10
|
+
this.editorRef = editorRef;
|
|
11
|
+
this.cd = cd;
|
|
12
|
+
this.mode = 'default';
|
|
13
|
+
this.defaultContent = [];
|
|
14
|
+
this.defaultHtml = '';
|
|
15
|
+
this.defaultConfig = {};
|
|
16
|
+
this.height = '350px';
|
|
17
|
+
/**富文本编辑器必填,必须有text内容 */
|
|
18
|
+
this.textRequired = false;
|
|
19
|
+
/**富文本编辑器必填,必须有内容仅当<p><br/><p>不通过校验注意与textRequired互斥*/
|
|
20
|
+
this.tagRequired = false;
|
|
21
|
+
this.onCreated = new EventEmitter();
|
|
22
|
+
this.onDestroyed = new EventEmitter();
|
|
23
|
+
this.onMaxLength = new EventEmitter();
|
|
24
|
+
this.onFocus = new EventEmitter();
|
|
25
|
+
this.onBlur = new EventEmitter();
|
|
26
|
+
this.customAlert = new EventEmitter();
|
|
27
|
+
this.customPaste = new EventEmitter();
|
|
28
|
+
this.onChange = new EventEmitter();
|
|
29
|
+
this.display = 'display:block';
|
|
30
|
+
this.currentValue = '';
|
|
31
|
+
this.propagateChange = (_) => { };
|
|
32
|
+
}
|
|
33
|
+
ngOnInit() {
|
|
34
|
+
this.init();
|
|
35
|
+
}
|
|
36
|
+
ngOnChanges(changes) {
|
|
37
|
+
if (changes['defaultConfig'] && !changes['defaultConfig'].isFirstChange()) {
|
|
38
|
+
this.init();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
validate(control) {
|
|
42
|
+
let result = null;
|
|
43
|
+
if (this.textRequired) {
|
|
44
|
+
if (!this.editor?.getText()) {
|
|
45
|
+
result = {
|
|
46
|
+
editorTextRequired: true,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (this.tagRequired) {
|
|
51
|
+
const html = this.editor?.getHtml();
|
|
52
|
+
if (html === '<p><br></p>' || html === void 0) {
|
|
53
|
+
result = {
|
|
54
|
+
editorTextRequired: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
init() {
|
|
61
|
+
if (this.editor) {
|
|
62
|
+
this.editor.destroy();
|
|
63
|
+
}
|
|
64
|
+
const that = this;
|
|
65
|
+
createEditor({
|
|
66
|
+
selector: this.editorRef.nativeElement,
|
|
67
|
+
mode: this.mode,
|
|
68
|
+
content: this.defaultContent || [],
|
|
69
|
+
html: this.defaultHtml || '',
|
|
70
|
+
config: {
|
|
71
|
+
...this.defaultConfig,
|
|
72
|
+
onCreated(editor) {
|
|
73
|
+
that.editor = editor; // 记录 editor 实例
|
|
74
|
+
that.onCreated.emit(editor);
|
|
75
|
+
that.cd.markForCheck();
|
|
76
|
+
if (that.defaultConfig.onCreated) {
|
|
77
|
+
const info = that.genErrorInfo('onCreated');
|
|
78
|
+
throw new Error(info);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
onChange(editor) {
|
|
82
|
+
const editorHtml = editor.getHtml();
|
|
83
|
+
that.currentValue = editorHtml; // 记录当前内容
|
|
84
|
+
that.onChange.emit(editor);
|
|
85
|
+
that.propagateChange(editorHtml);
|
|
86
|
+
that.cd.markForCheck();
|
|
87
|
+
if (that.defaultConfig.onChange) {
|
|
88
|
+
const info = that.genErrorInfo('ngModelChange');
|
|
89
|
+
throw new Error(info);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
onDestroyed(editor) {
|
|
93
|
+
that.onDestroyed.emit(editor);
|
|
94
|
+
if (that.defaultConfig.onDestroyed) {
|
|
95
|
+
const info = that.genErrorInfo('onDestroyed');
|
|
96
|
+
throw new Error(info);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
onMaxLength(editor) {
|
|
100
|
+
that.onMaxLength.emit(editor);
|
|
101
|
+
if (that.defaultConfig.onMaxLength) {
|
|
102
|
+
const info = that.genErrorInfo('onMaxLength');
|
|
103
|
+
throw new Error(info);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
onFocus(editor) {
|
|
107
|
+
that.onFocus.emit(editor);
|
|
108
|
+
if (that.defaultConfig.onFocus) {
|
|
109
|
+
const info = that.genErrorInfo('onFocus');
|
|
110
|
+
throw new Error(info);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
onBlur(editor) {
|
|
114
|
+
that.onBlur.emit(editor);
|
|
115
|
+
if (that.defaultConfig.onBlur) {
|
|
116
|
+
const info = that.genErrorInfo('onBlur');
|
|
117
|
+
throw new Error(info);
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
customAlert(info, type) {
|
|
121
|
+
that.customAlert.emit({ info, type });
|
|
122
|
+
if (that.defaultConfig.customAlert) {
|
|
123
|
+
const info = that.genErrorInfo('customAlert');
|
|
124
|
+
throw new Error(info);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
customPaste: (editor, event) => {
|
|
128
|
+
if (that.defaultConfig.customPaste) {
|
|
129
|
+
const info = that.genErrorInfo('customPaste');
|
|
130
|
+
throw new Error(info);
|
|
131
|
+
}
|
|
132
|
+
let res;
|
|
133
|
+
that.customPaste.emit({
|
|
134
|
+
editor,
|
|
135
|
+
event,
|
|
136
|
+
callback: (val) => {
|
|
137
|
+
res = val;
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
return res;
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
writeValue(html) {
|
|
146
|
+
setTimeout(() => {
|
|
147
|
+
if (html === this.currentValue)
|
|
148
|
+
return; // 和当前内容一样,则忽略
|
|
149
|
+
if (html) {
|
|
150
|
+
if (this.editor) {
|
|
151
|
+
this.editor.setHtml(html);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
this.editor.clear();
|
|
156
|
+
}
|
|
157
|
+
}, 0);
|
|
158
|
+
}
|
|
159
|
+
registerOnChange(fn) {
|
|
160
|
+
this.propagateChange = fn;
|
|
161
|
+
}
|
|
162
|
+
registerOnTouched(fn) { }
|
|
163
|
+
setDisabledState(isDisabled) {
|
|
164
|
+
setTimeout(() => {
|
|
165
|
+
if (isDisabled) {
|
|
166
|
+
this.editor?.disable();
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
this.editor?.enable();
|
|
170
|
+
}
|
|
171
|
+
}, 0);
|
|
172
|
+
}
|
|
173
|
+
ngOnDestroy() {
|
|
174
|
+
if (this.editor) {
|
|
175
|
+
this.editor.destroy();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
genErrorInfo(fnName) {
|
|
179
|
+
let info = `请使用 '(${fnName})=' 事件!`;
|
|
180
|
+
info += `\nPlease use '(${fnName})' event!`;
|
|
181
|
+
return info;
|
|
182
|
+
}
|
|
183
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NzxWangEditorDirective, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
184
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: NzxWangEditorDirective, selector: "nzx-wang-editor,[nzxWangEditor]", inputs: { mode: "mode", defaultContent: "defaultContent", defaultHtml: "defaultHtml", defaultConfig: "defaultConfig", height: "height", textRequired: "textRequired", tagRequired: "tagRequired" }, outputs: { onCreated: "onCreated", onDestroyed: "onDestroyed", onMaxLength: "onMaxLength", onFocus: "onFocus", onBlur: "onBlur", customAlert: "customAlert", customPaste: "customPaste", onChange: "onChange" }, host: { properties: { "style": "this.display" } }, providers: [
|
|
185
|
+
{
|
|
186
|
+
provide: NG_VALUE_ACCESSOR,
|
|
187
|
+
useExisting: forwardRef(() => NzxWangEditorDirective),
|
|
188
|
+
multi: true,
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
provide: NG_VALIDATORS,
|
|
192
|
+
useExisting: NzxWangEditorDirective,
|
|
193
|
+
multi: true,
|
|
194
|
+
},
|
|
195
|
+
], exportAs: ["NzxWangEditor"], usesOnChanges: true, ngImport: i0 }); }
|
|
196
|
+
}
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NzxWangEditorDirective, decorators: [{
|
|
198
|
+
type: Directive,
|
|
199
|
+
args: [{
|
|
200
|
+
selector: 'nzx-wang-editor,[nzxWangEditor]',
|
|
201
|
+
providers: [
|
|
202
|
+
{
|
|
203
|
+
provide: NG_VALUE_ACCESSOR,
|
|
204
|
+
useExisting: forwardRef(() => NzxWangEditorDirective),
|
|
205
|
+
multi: true,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
provide: NG_VALIDATORS,
|
|
209
|
+
useExisting: NzxWangEditorDirective,
|
|
210
|
+
multi: true,
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
exportAs: 'NzxWangEditor',
|
|
214
|
+
}]
|
|
215
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { mode: [{
|
|
216
|
+
type: Input
|
|
217
|
+
}], defaultContent: [{
|
|
218
|
+
type: Input
|
|
219
|
+
}], defaultHtml: [{
|
|
220
|
+
type: Input
|
|
221
|
+
}], defaultConfig: [{
|
|
222
|
+
type: Input
|
|
223
|
+
}], height: [{
|
|
224
|
+
type: Input
|
|
225
|
+
}], textRequired: [{
|
|
226
|
+
type: Input
|
|
227
|
+
}], tagRequired: [{
|
|
228
|
+
type: Input
|
|
229
|
+
}], onCreated: [{
|
|
230
|
+
type: Output
|
|
231
|
+
}], onDestroyed: [{
|
|
232
|
+
type: Output
|
|
233
|
+
}], onMaxLength: [{
|
|
234
|
+
type: Output
|
|
235
|
+
}], onFocus: [{
|
|
236
|
+
type: Output
|
|
237
|
+
}], onBlur: [{
|
|
238
|
+
type: Output
|
|
239
|
+
}], customAlert: [{
|
|
240
|
+
type: Output
|
|
241
|
+
}], customPaste: [{
|
|
242
|
+
type: Output
|
|
243
|
+
}], onChange: [{
|
|
244
|
+
type: Output
|
|
245
|
+
}], display: [{
|
|
246
|
+
type: HostBinding,
|
|
247
|
+
args: ['style']
|
|
248
|
+
}] } });
|
|
249
|
+
|
|
250
|
+
class NzxWangToolbarDirective {
|
|
251
|
+
constructor(toolbarRef) {
|
|
252
|
+
this.toolbarRef = toolbarRef;
|
|
253
|
+
this.mode = 'default';
|
|
254
|
+
this.defaultConfig = {};
|
|
255
|
+
this.display = 'display:block';
|
|
256
|
+
}
|
|
257
|
+
ngOnInit() {
|
|
258
|
+
this.initToolbar();
|
|
259
|
+
}
|
|
260
|
+
ngOnChanges(changes) {
|
|
261
|
+
if (changes['editor'] && !changes['editor'].isFirstChange()) {
|
|
262
|
+
this.initToolbar();
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
initToolbar() {
|
|
266
|
+
if (!this.toolbarRef)
|
|
267
|
+
return;
|
|
268
|
+
if (!this.editor)
|
|
269
|
+
return;
|
|
270
|
+
if (DomEditor.getToolbar(this.editor))
|
|
271
|
+
return; // 不重复创建
|
|
272
|
+
this.toolbar = createToolbar({
|
|
273
|
+
editor: this.editor,
|
|
274
|
+
selector: this.toolbarRef.nativeElement || '<div></div>',
|
|
275
|
+
mode: this.mode,
|
|
276
|
+
config: this.defaultConfig,
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
ngOnDestroy() {
|
|
280
|
+
if (this.toolbar) {
|
|
281
|
+
this.toolbar.destroy();
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NzxWangToolbarDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
285
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: NzxWangToolbarDirective, selector: "nzx-wang-toolbar,[nzxWangToolbar]", inputs: { mode: "mode", editor: "editor", defaultConfig: "defaultConfig" }, host: { properties: { "style": "this.display" } }, exportAs: ["NzxWangToolbar"], usesOnChanges: true, ngImport: i0 }); }
|
|
286
|
+
}
|
|
287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NzxWangToolbarDirective, decorators: [{
|
|
288
|
+
type: Directive,
|
|
289
|
+
args: [{
|
|
290
|
+
selector: 'nzx-wang-toolbar,[nzxWangToolbar]',
|
|
291
|
+
exportAs: 'NzxWangToolbar',
|
|
292
|
+
}]
|
|
293
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { mode: [{
|
|
294
|
+
type: Input
|
|
295
|
+
}], editor: [{
|
|
296
|
+
type: Input
|
|
297
|
+
}], defaultConfig: [{
|
|
298
|
+
type: Input
|
|
299
|
+
}], display: [{
|
|
300
|
+
type: HostBinding,
|
|
301
|
+
args: ['style']
|
|
302
|
+
}] } });
|
|
303
|
+
|
|
304
|
+
class NzxWangEditorModule {
|
|
305
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NzxWangEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
306
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: NzxWangEditorModule, declarations: [NzxWangToolbarDirective, NzxWangEditorDirective], imports: [CommonModule], exports: [NzxWangToolbarDirective, NzxWangEditorDirective] }); }
|
|
307
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NzxWangEditorModule, imports: [CommonModule] }); }
|
|
308
|
+
}
|
|
309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NzxWangEditorModule, decorators: [{
|
|
310
|
+
type: NgModule,
|
|
311
|
+
args: [{
|
|
312
|
+
declarations: [NzxWangToolbarDirective, NzxWangEditorDirective],
|
|
313
|
+
imports: [CommonModule],
|
|
314
|
+
exports: [NzxWangToolbarDirective, NzxWangEditorDirective],
|
|
315
|
+
}]
|
|
316
|
+
}] });
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
320
|
+
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
|
|
321
|
+
*/
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Generated bundle index. Do not edit.
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
export { NzxWangEditorDirective, NzxWangEditorModule, NzxWangToolbarDirective };
|
|
328
|
+
//# sourceMappingURL=ng-zorro-antd-extension-wang-editor-next.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-zorro-antd-extension-wang-editor-next.mjs","sources":["../../../components/wang-editor-next/wang-editor.component.ts","../../../components/wang-editor-next/wang-toolbar.component.ts","../../../components/wang-editor-next/wang-editor.module.ts","../../../components/wang-editor-next/public-api.ts","../../../components/wang-editor-next/ng-zorro-antd-extension-wang-editor-next.ts"],"sourcesContent":["/* eslint-disable @angular-eslint/no-output-on-prefix */\nimport {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\nimport {\n createEditor,\n IDomEditor,\n IEditorConfig,\n SlateDescendant,\n} from '@wangeditor-next/editor';\nimport { Mode } from './type';\n\n@Directive({\n selector: 'nzx-wang-editor,[nzxWangEditor]',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NzxWangEditorDirective),\n multi: true,\n },\n {\n provide: NG_VALIDATORS,\n useExisting: NzxWangEditorDirective,\n multi: true,\n },\n ],\n exportAs: 'NzxWangEditor',\n})\nexport class NzxWangEditorDirective\n implements OnInit, ControlValueAccessor, OnDestroy, OnChanges, Validator\n{\n @Input() mode: Mode = 'default';\n @Input() defaultContent: SlateDescendant[] = [];\n @Input() defaultHtml = '';\n @Input() defaultConfig: Partial<IEditorConfig> = {};\n @Input() height = '350px';\n /**富文本编辑器必填,必须有text内容 */\n @Input() textRequired = false;\n /**富文本编辑器必填,必须有内容仅当<p><br/><p>不通过校验注意与textRequired互斥*/\n @Input() tagRequired = false;\n\n @Output() onCreated = new EventEmitter();\n @Output() onDestroyed = new EventEmitter();\n @Output() onMaxLength = new EventEmitter();\n @Output() onFocus = new EventEmitter();\n @Output() onBlur = new EventEmitter();\n @Output() customAlert = new EventEmitter();\n @Output() customPaste = new EventEmitter();\n @Output() onChange = new EventEmitter();\n\n @HostBinding('style') display = 'display:block';\n\n editor!: IDomEditor;\n currentValue = '';\n\n private propagateChange = (_: any) => {};\n\n constructor(private editorRef: ElementRef, private cd: ChangeDetectorRef) {}\n\n ngOnInit(): void {\n this.init();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['defaultConfig'] && !changes['defaultConfig'].isFirstChange()) {\n this.init();\n }\n }\n\n validate(control: AbstractControl<any, any>): ValidationErrors | null {\n let result: ValidationErrors | null = null;\n if (this.textRequired) {\n if (!this.editor?.getText()) {\n result = {\n editorTextRequired: true,\n };\n }\n }\n if (this.tagRequired) {\n const html = this.editor?.getHtml();\n if (html === '<p><br></p>' || html === void 0) {\n result = {\n editorTextRequired: true,\n };\n }\n }\n return result;\n }\n\n private init() {\n if (this.editor) {\n this.editor.destroy();\n }\n const that = this;\n\n createEditor({\n selector: this.editorRef.nativeElement,\n mode: this.mode,\n content: this.defaultContent || [],\n html: this.defaultHtml || '',\n config: {\n ...this.defaultConfig,\n onCreated(editor) {\n that.editor = editor; // 记录 editor 实例\n that.onCreated.emit(editor);\n that.cd.markForCheck();\n if (that.defaultConfig.onCreated) {\n const info = that.genErrorInfo('onCreated');\n throw new Error(info);\n }\n },\n onChange(editor) {\n const editorHtml = editor.getHtml();\n that.currentValue = editorHtml; // 记录当前内容\n that.onChange.emit(editor);\n that.propagateChange(editorHtml);\n that.cd.markForCheck();\n\n if (that.defaultConfig.onChange) {\n const info = that.genErrorInfo('ngModelChange');\n throw new Error(info);\n }\n },\n onDestroyed(editor) {\n that.onDestroyed.emit(editor);\n if (that.defaultConfig.onDestroyed) {\n const info = that.genErrorInfo('onDestroyed');\n throw new Error(info);\n }\n },\n onMaxLength(editor) {\n that.onMaxLength.emit(editor);\n if (that.defaultConfig.onMaxLength) {\n const info = that.genErrorInfo('onMaxLength');\n throw new Error(info);\n }\n },\n onFocus(editor) {\n that.onFocus.emit(editor);\n if (that.defaultConfig.onFocus) {\n const info = that.genErrorInfo('onFocus');\n throw new Error(info);\n }\n },\n onBlur(editor) {\n that.onBlur.emit(editor);\n if (that.defaultConfig.onBlur) {\n const info = that.genErrorInfo('onBlur');\n throw new Error(info);\n }\n },\n customAlert(info: string, type) {\n that.customAlert.emit({ info, type });\n if (that.defaultConfig.customAlert) {\n const info = that.genErrorInfo('customAlert');\n throw new Error(info);\n }\n },\n customPaste: (editor, event): any => {\n if (that.defaultConfig.customPaste) {\n const info = that.genErrorInfo('customPaste');\n throw new Error(info);\n }\n let res;\n that.customPaste.emit({\n editor,\n event,\n callback: (val: boolean) => {\n res = val;\n },\n });\n return res;\n },\n },\n });\n }\n\n writeValue(html: any): void {\n setTimeout(() => {\n if (html === this.currentValue) return; // 和当前内容一样,则忽略\n if (html) {\n if (this.editor) {\n this.editor.setHtml(html);\n }\n } else {\n this.editor.clear();\n }\n }, 0);\n }\n\n registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n\n registerOnTouched(fn: any): void {}\n\n setDisabledState?(isDisabled: boolean): void {\n setTimeout(() => {\n if (isDisabled) {\n this.editor?.disable();\n } else {\n this.editor?.enable();\n }\n }, 0);\n }\n\n ngOnDestroy(): void {\n if (this.editor) {\n this.editor.destroy();\n }\n }\n\n private genErrorInfo(fnName: string): string {\n let info = `请使用 '(${fnName})=' 事件!`;\n info += `\\nPlease use '(${fnName})' event!`;\n return info;\n }\n}\n","import {\n Directive,\n ElementRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n} from '@angular/core';\nimport {\n createToolbar,\n DomEditor,\n IDomEditor,\n IToolbarConfig,\n Toolbar,\n} from '@wangeditor-next/editor';\nimport { Mode } from './type';\n\n@Directive({\n selector: 'nzx-wang-toolbar,[nzxWangToolbar]',\n exportAs: 'NzxWangToolbar',\n})\nexport class NzxWangToolbarDirective implements OnInit, OnChanges, OnDestroy {\n @Input() mode: Mode = 'default';\n @Input() editor!: IDomEditor;\n @Input() defaultConfig: Partial<IToolbarConfig> = {};\n\n @HostBinding('style') display = 'display:block';\n\n toolbar!: Toolbar;\n\n constructor(private toolbarRef: ElementRef) {}\n\n ngOnInit(): void {\n this.initToolbar();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['editor'] && !changes['editor'].isFirstChange()) {\n this.initToolbar();\n }\n }\n\n private initToolbar() {\n if (!this.toolbarRef) return;\n if (!this.editor) return;\n if (DomEditor.getToolbar(this.editor)) return; // 不重复创建\n this.toolbar = createToolbar({\n editor: this.editor,\n selector: this.toolbarRef.nativeElement || '<div></div>',\n mode: this.mode,\n config: this.defaultConfig,\n });\n }\n\n ngOnDestroy(): void {\n if (this.toolbar) {\n this.toolbar.destroy();\n }\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzxWangEditorDirective } from './wang-editor.component';\nimport { NzxWangToolbarDirective } from './wang-toolbar.component';\n\n@NgModule({\n declarations: [NzxWangToolbarDirective, NzxWangEditorDirective],\n imports: [CommonModule],\n exports: [NzxWangToolbarDirective, NzxWangEditorDirective],\n})\nexport class NzxWangEditorModule {}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport * from './wang-editor.module';\nexport * from './wang-editor.component';\nexport * from './wang-toolbar.component';\n\nexport * from './type';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;MA+Ca,sBAAsB,CAAA;IA6BjC,WAAoB,CAAA,SAAqB,EAAU,EAAqB,EAAA;QAApD,IAAS,CAAA,SAAA,GAAT,SAAS;QAAsB,IAAE,CAAA,EAAA,GAAF,EAAE;QA1B5C,IAAI,CAAA,IAAA,GAAS,SAAS;QACtB,IAAc,CAAA,cAAA,GAAsB,EAAE;QACtC,IAAW,CAAA,WAAA,GAAG,EAAE;QAChB,IAAa,CAAA,aAAA,GAA2B,EAAE;QAC1C,IAAM,CAAA,MAAA,GAAG,OAAO;;QAEhB,IAAY,CAAA,YAAA,GAAG,KAAK;;QAEpB,IAAW,CAAA,WAAA,GAAG,KAAK;AAElB,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAAE;AAC9B,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,YAAY,EAAE;AAChC,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,YAAY,EAAE;AAChC,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,YAAY,EAAE;AAC5B,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,YAAY,EAAE;AAC3B,QAAA,IAA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BAAsB,CAAC;oBAC/D,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,OAAO,EAAE,CAAC,uBAAuB,EAAE,sBAAsB,CAAC;AAC3D,iBAAA;;;ACVD;;;AAGG;;ACHH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ng-zorro-antd-extension",
|
|
3
|
-
"version": "17.4.
|
|
3
|
+
"version": "17.4.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "An extension based on ng-zorro-antd",
|
|
6
6
|
"keywords": [
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"@angular/common": "^15.0.0||^16.0.0||^17.0.0",
|
|
28
28
|
"@angular/core": "^15.0.0||^16.0.0||^17.0.0",
|
|
29
29
|
"@wangeditor/editor": "^5.0.0",
|
|
30
|
+
"@wangeditor-next/editor": "^5.0.0",
|
|
30
31
|
"@vivliostyle/core": "^2.29.0",
|
|
31
32
|
"date-fns": "^2.16.1",
|
|
32
33
|
"ng-zorro-antd": "^15.0.0||^16.0.0||^17.0.0"
|
|
@@ -58,18 +59,18 @@
|
|
|
58
59
|
"esm": "./esm2022/blank-field/ng-zorro-antd-extension-blank-field.mjs",
|
|
59
60
|
"default": "./fesm2022/ng-zorro-antd-extension-blank-field.mjs"
|
|
60
61
|
},
|
|
61
|
-
"./checkbox": {
|
|
62
|
-
"types": "./checkbox/index.d.ts",
|
|
63
|
-
"esm2022": "./esm2022/checkbox/ng-zorro-antd-extension-checkbox.mjs",
|
|
64
|
-
"esm": "./esm2022/checkbox/ng-zorro-antd-extension-checkbox.mjs",
|
|
65
|
-
"default": "./fesm2022/ng-zorro-antd-extension-checkbox.mjs"
|
|
66
|
-
},
|
|
67
62
|
"./configurable-query": {
|
|
68
63
|
"types": "./configurable-query/index.d.ts",
|
|
69
64
|
"esm2022": "./esm2022/configurable-query/ng-zorro-antd-extension-configurable-query.mjs",
|
|
70
65
|
"esm": "./esm2022/configurable-query/ng-zorro-antd-extension-configurable-query.mjs",
|
|
71
66
|
"default": "./fesm2022/ng-zorro-antd-extension-configurable-query.mjs"
|
|
72
67
|
},
|
|
68
|
+
"./checkbox": {
|
|
69
|
+
"types": "./checkbox/index.d.ts",
|
|
70
|
+
"esm2022": "./esm2022/checkbox/ng-zorro-antd-extension-checkbox.mjs",
|
|
71
|
+
"esm": "./esm2022/checkbox/ng-zorro-antd-extension-checkbox.mjs",
|
|
72
|
+
"default": "./fesm2022/ng-zorro-antd-extension-checkbox.mjs"
|
|
73
|
+
},
|
|
73
74
|
"./dynamic-form": {
|
|
74
75
|
"types": "./dynamic-form/index.d.ts",
|
|
75
76
|
"esm2022": "./esm2022/dynamic-form/ng-zorro-antd-extension-dynamic-form.mjs",
|
|
@@ -160,6 +161,12 @@
|
|
|
160
161
|
"esm": "./esm2022/wang-editor/ng-zorro-antd-extension-wang-editor.mjs",
|
|
161
162
|
"default": "./fesm2022/ng-zorro-antd-extension-wang-editor.mjs"
|
|
162
163
|
},
|
|
164
|
+
"./wang-editor-next": {
|
|
165
|
+
"types": "./wang-editor-next/index.d.ts",
|
|
166
|
+
"esm2022": "./esm2022/wang-editor-next/ng-zorro-antd-extension-wang-editor-next.mjs",
|
|
167
|
+
"esm": "./esm2022/wang-editor-next/ng-zorro-antd-extension-wang-editor-next.mjs",
|
|
168
|
+
"default": "./fesm2022/ng-zorro-antd-extension-wang-editor-next.mjs"
|
|
169
|
+
},
|
|
163
170
|
"./core/config": {
|
|
164
171
|
"types": "./core/config/index.d.ts",
|
|
165
172
|
"esm2022": "./esm2022/core/config/ng-zorro-antd-extension-core-config.mjs",
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnDestroy } from '@angular/core';
|
|
2
|
+
import { Platform } from '@angular/cdk/platform';
|
|
2
3
|
import { CoreViewer } from '@vivliostyle/core';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
/**
|
|
5
6
|
* Vivliostyle 打印
|
|
6
7
|
*/
|
|
7
8
|
export declare class NzxPrintVComponent implements OnDestroy, AfterViewInit {
|
|
9
|
+
private platform;
|
|
8
10
|
private cd;
|
|
9
11
|
printTitle: string;
|
|
10
12
|
/**
|
|
@@ -22,7 +24,7 @@ export declare class NzxPrintVComponent implements OnDestroy, AfterViewInit {
|
|
|
22
24
|
private _title;
|
|
23
25
|
private iframeEl;
|
|
24
26
|
private _isRenderComplete;
|
|
25
|
-
constructor(cd: ChangeDetectorRef);
|
|
27
|
+
constructor(platform: Platform, cd: ChangeDetectorRef);
|
|
26
28
|
ngAfterViewInit(): void;
|
|
27
29
|
ngOnDestroy(): void;
|
|
28
30
|
onPageIndexChange(num: number): void;
|
package/util/public-api.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3
|
+
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
|
|
4
|
+
*/
|
|
5
|
+
export * from './wang-editor.module';
|
|
6
|
+
export * from './wang-editor.component';
|
|
7
|
+
export * from './wang-toolbar.component';
|
|
8
|
+
export * from './type';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms';
|
|
3
|
+
import { IDomEditor, IEditorConfig, SlateDescendant } from '@wangeditor-next/editor';
|
|
4
|
+
import { Mode } from './type';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class NzxWangEditorDirective implements OnInit, ControlValueAccessor, OnDestroy, OnChanges, Validator {
|
|
7
|
+
private editorRef;
|
|
8
|
+
private cd;
|
|
9
|
+
mode: Mode;
|
|
10
|
+
defaultContent: SlateDescendant[];
|
|
11
|
+
defaultHtml: string;
|
|
12
|
+
defaultConfig: Partial<IEditorConfig>;
|
|
13
|
+
height: string;
|
|
14
|
+
/**富文本编辑器必填,必须有text内容 */
|
|
15
|
+
textRequired: boolean;
|
|
16
|
+
/**富文本编辑器必填,必须有内容仅当<p><br/><p>不通过校验注意与textRequired互斥*/
|
|
17
|
+
tagRequired: boolean;
|
|
18
|
+
onCreated: EventEmitter<any>;
|
|
19
|
+
onDestroyed: EventEmitter<any>;
|
|
20
|
+
onMaxLength: EventEmitter<any>;
|
|
21
|
+
onFocus: EventEmitter<any>;
|
|
22
|
+
onBlur: EventEmitter<any>;
|
|
23
|
+
customAlert: EventEmitter<any>;
|
|
24
|
+
customPaste: EventEmitter<any>;
|
|
25
|
+
onChange: EventEmitter<any>;
|
|
26
|
+
display: string;
|
|
27
|
+
editor: IDomEditor;
|
|
28
|
+
currentValue: string;
|
|
29
|
+
private propagateChange;
|
|
30
|
+
constructor(editorRef: ElementRef, cd: ChangeDetectorRef);
|
|
31
|
+
ngOnInit(): void;
|
|
32
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
33
|
+
validate(control: AbstractControl<any, any>): ValidationErrors | null;
|
|
34
|
+
private init;
|
|
35
|
+
writeValue(html: any): void;
|
|
36
|
+
registerOnChange(fn: any): void;
|
|
37
|
+
registerOnTouched(fn: any): void;
|
|
38
|
+
setDisabledState?(isDisabled: boolean): void;
|
|
39
|
+
ngOnDestroy(): void;
|
|
40
|
+
private genErrorInfo;
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NzxWangEditorDirective, never>;
|
|
42
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NzxWangEditorDirective, "nzx-wang-editor,[nzxWangEditor]", ["NzxWangEditor"], { "mode": { "alias": "mode"; "required": false; }; "defaultContent": { "alias": "defaultContent"; "required": false; }; "defaultHtml": { "alias": "defaultHtml"; "required": false; }; "defaultConfig": { "alias": "defaultConfig"; "required": false; }; "height": { "alias": "height"; "required": false; }; "textRequired": { "alias": "textRequired"; "required": false; }; "tagRequired": { "alias": "tagRequired"; "required": false; }; }, { "onCreated": "onCreated"; "onDestroyed": "onDestroyed"; "onMaxLength": "onMaxLength"; "onFocus": "onFocus"; "onBlur": "onBlur"; "customAlert": "customAlert"; "customPaste": "customPaste"; "onChange": "onChange"; }, never, never, false, never>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./wang-toolbar.component";
|
|
3
|
+
import * as i2 from "./wang-editor.component";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
export declare class NzxWangEditorModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NzxWangEditorModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NzxWangEditorModule, [typeof i1.NzxWangToolbarDirective, typeof i2.NzxWangEditorDirective], [typeof i3.CommonModule], [typeof i1.NzxWangToolbarDirective, typeof i2.NzxWangEditorDirective]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NzxWangEditorModule>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ElementRef, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { IDomEditor, IToolbarConfig, Toolbar } from '@wangeditor-next/editor';
|
|
3
|
+
import { Mode } from './type';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class NzxWangToolbarDirective implements OnInit, OnChanges, OnDestroy {
|
|
6
|
+
private toolbarRef;
|
|
7
|
+
mode: Mode;
|
|
8
|
+
editor: IDomEditor;
|
|
9
|
+
defaultConfig: Partial<IToolbarConfig>;
|
|
10
|
+
display: string;
|
|
11
|
+
toolbar: Toolbar;
|
|
12
|
+
constructor(toolbarRef: ElementRef);
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
15
|
+
private initToolbar;
|
|
16
|
+
ngOnDestroy(): void;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NzxWangToolbarDirective, never>;
|
|
18
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NzxWangToolbarDirective, "nzx-wang-toolbar,[nzxWangToolbar]", ["NzxWangToolbar"], { "mode": { "alias": "mode"; "required": false; }; "editor": { "alias": "editor"; "required": false; }; "defaultConfig": { "alias": "defaultConfig"; "required": false; }; }, {}, never, never, false, never>;
|
|
19
|
+
}
|