@syncfusion/ej2-vue-documenteditor 20.4.54 → 21.1.37
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/CHANGELOG.md +46 -0
- package/dist/ej2-vue-documenteditor.umd.min.js +2 -2
- package/dist/ej2-vue-documenteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-vue-documenteditor.es2015.js +240 -282
- package/dist/es6/ej2-vue-documenteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-vue-documenteditor.es5.js +261 -313
- package/dist/es6/ej2-vue-documenteditor.es5.js.map +1 -1
- package/dist/global/ej2-vue-documenteditor.min.js +2 -2
- package/package.json +11 -10
- package/src/document-editor/documenteditor.component.d.ts +3 -50
- package/src/document-editor/documenteditor.component.js +168 -197
- package/src/document-editor-container/documenteditorcontainer.component.d.ts +3 -26
- package/src/document-editor-container/documenteditorcontainer.component.js +96 -125
- package/styles/bootstrap-dark.css +64 -21
- package/styles/bootstrap.css +60 -17
- package/styles/bootstrap4.css +74 -28
- package/styles/bootstrap5-dark.css +84 -37
- package/styles/bootstrap5.css +84 -37
- package/styles/document-editor/bootstrap-dark.css +6 -2
- package/styles/document-editor/bootstrap.css +6 -2
- package/styles/document-editor/bootstrap4.css +8 -4
- package/styles/document-editor/bootstrap5-dark.css +25 -17
- package/styles/document-editor/bootstrap5.css +25 -17
- package/styles/document-editor/fabric-dark.css +6 -2
- package/styles/document-editor/fabric.css +6 -2
- package/styles/document-editor/fluent-dark.css +40 -27
- package/styles/document-editor/fluent.css +40 -27
- package/styles/document-editor/highcontrast-light.css +4 -0
- package/styles/document-editor/highcontrast.css +6 -2
- package/styles/document-editor/material-dark.css +6 -2
- package/styles/document-editor/material.css +6 -2
- package/styles/document-editor/tailwind-dark.css +22 -17
- package/styles/document-editor/tailwind.css +25 -17
- package/styles/document-editor-container/bootstrap-dark.css +58 -19
- package/styles/document-editor-container/bootstrap.css +54 -15
- package/styles/document-editor-container/bootstrap4.css +66 -24
- package/styles/document-editor-container/bootstrap5-dark.css +59 -20
- package/styles/document-editor-container/bootstrap5.css +59 -20
- package/styles/document-editor-container/fabric-dark.css +58 -19
- package/styles/document-editor-container/fabric.css +58 -19
- package/styles/document-editor-container/fluent-dark.css +63 -27
- package/styles/document-editor-container/fluent.css +63 -27
- package/styles/document-editor-container/highcontrast-light.css +58 -19
- package/styles/document-editor-container/highcontrast.css +58 -19
- package/styles/document-editor-container/material-dark.css +58 -19
- package/styles/document-editor-container/material.css +57 -18
- package/styles/document-editor-container/tailwind-dark.css +58 -19
- package/styles/document-editor-container/tailwind.css +58 -19
- package/styles/fabric-dark.css +64 -21
- package/styles/fabric.css +64 -21
- package/styles/fluent-dark.css +103 -54
- package/styles/fluent.css +103 -54
- package/styles/highcontrast-light.css +62 -19
- package/styles/highcontrast.css +64 -21
- package/styles/material-dark.css +64 -21
- package/styles/material.css +63 -20
- package/styles/tailwind-dark.css +80 -36
- package/styles/tailwind.css +83 -36
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { DocumentEditor, DocumentEditorContainer } from '@syncfusion/ej2-documenteditor';
|
|
2
|
-
import { ComponentBase,
|
|
2
|
+
import { ComponentBase, getProps, gh, isExecute, vueDefineComponent } from '@syncfusion/ej2-vue-base';
|
|
3
3
|
import { getValue, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
-
};
|
|
11
|
-
// {{VueImport}}
|
|
12
|
-
const properties = ['isLazyUpdate', 'plugins', 'acceptTab', 'currentUser', 'defaultPasteOption', 'documentEditorSettings', 'documentName', 'documentSettings', 'enableBookmarkDialog', 'enableBordersAndShadingDialog', 'enableColumnsDialog', 'enableComment', 'enableContextMenu', 'enableCursorOnReadOnly', 'enableEditor', 'enableEditorHistory', 'enableFontDialog', 'enableFootnoteAndEndnoteDialog', 'enableFormField', 'enableHyperlinkDialog', 'enableImageResizer', 'enableListDialog', 'enableLocalPaste', 'enableLockAndEdit', 'enableOptionsPane', 'enablePageSetupDialog', 'enableParagraphDialog', 'enablePersistence', 'enablePrint', 'enableRtl', 'enableSearch', 'enableSelection', 'enableSfdtExport', 'enableSpellCheck', 'enableStyleDialog', 'enableTableDialog', 'enableTableOfContentsDialog', 'enableTableOptionsDialog', 'enableTablePropertiesDialog', 'enableTextExport', 'enableTrackChanges', 'enableWordExport', 'headers', 'height', 'isReadOnly', 'layoutType', 'locale', 'pageGap', 'pageOutline', 'serverActionSettings', 'serviceUrl', 'showComments', 'showRevisions', 'useCtrlClickToFollowHyperlink', 'userColor', 'width', 'zIndex', 'zoomFactor', 'actionComplete', 'afterFormFieldFill', 'beforeCommentAction', 'beforeFileOpen', 'beforeFormFieldFill', 'beforePaneSwitch', 'commentBegin', 'commentDelete', 'commentEnd', 'contentChange', 'contentControl', 'created', 'customContextMenuBeforeOpen', 'customContextMenuSelect', 'destroyed', 'documentChange', 'keyDown', 'requestNavigate', 'searchResultsChange', 'selectionChange', 'serviceFailure', 'trackChange', 'viewChange', 'zoomFactorChange', 'beforeXmlHttpRequestSend'];
|
|
5
|
+
const properties = ['isLazyUpdate', 'plugins', 'acceptTab', 'currentUser', 'defaultPasteOption', 'documentEditorSettings', 'documentName', 'documentSettings', 'enableAutoFocus', 'enableBookmarkDialog', 'enableBordersAndShadingDialog', 'enableColumnsDialog', 'enableComment', 'enableContextMenu', 'enableCursorOnReadOnly', 'enableEditor', 'enableEditorHistory', 'enableFontDialog', 'enableFootnoteAndEndnoteDialog', 'enableFormField', 'enableHyperlinkDialog', 'enableImageResizer', 'enableListDialog', 'enableLocalPaste', 'enableLockAndEdit', 'enableOptionsPane', 'enablePageSetupDialog', 'enableParagraphDialog', 'enablePersistence', 'enablePrint', 'enableRtl', 'enableSearch', 'enableSelection', 'enableSfdtExport', 'enableSpellCheck', 'enableStyleDialog', 'enableTableDialog', 'enableTableOfContentsDialog', 'enableTableOptionsDialog', 'enableTablePropertiesDialog', 'enableTextExport', 'enableTrackChanges', 'enableWordExport', 'headers', 'height', 'isReadOnly', 'layoutType', 'locale', 'pageGap', 'pageOutline', 'serverActionSettings', 'serviceUrl', 'showComments', 'showRevisions', 'useCtrlClickToFollowHyperlink', 'userColor', 'width', 'zIndex', 'zoomFactor', 'actionComplete', 'afterFormFieldFill', 'beforeCommentAction', 'beforeFileOpen', 'beforeFormFieldFill', 'beforePaneSwitch', 'commentBegin', 'commentDelete', 'commentEnd', 'contentChange', 'contentControl', 'created', 'customContextMenuBeforeOpen', 'customContextMenuSelect', 'destroyed', 'documentChange', 'keyDown', 'requestNavigate', 'searchResultsChange', 'selectionChange', 'serviceFailure', 'trackChange', 'viewChange', 'zoomFactorChange', 'beforeXmlHttpRequestSend'];
|
|
13
6
|
const modelProps = [];
|
|
14
7
|
const testProp = getProps({ props: properties });
|
|
15
8
|
const props = testProp[0];
|
|
@@ -25,79 +18,33 @@ for (let props of modelProps) {
|
|
|
25
18
|
* <ejs-documenteditor id='container'></ejs-documenteditor>
|
|
26
19
|
* ```
|
|
27
20
|
*/
|
|
28
|
-
let DocumentEditorComponent =
|
|
29
|
-
|
|
21
|
+
let DocumentEditorComponent = vueDefineComponent({
|
|
22
|
+
name: 'DocumentEditorComponent',
|
|
23
|
+
mixins: [ComponentBase],
|
|
30
24
|
props: props,
|
|
31
25
|
watch: watch,
|
|
32
26
|
emits: emitProbs,
|
|
33
|
-
provide:
|
|
27
|
+
provide() { return { custom: this.custom }; },
|
|
28
|
+
data() {
|
|
34
29
|
return {
|
|
35
|
-
|
|
30
|
+
ej2Instances: new DocumentEditor({}),
|
|
31
|
+
propKeys: properties,
|
|
32
|
+
models: modelProps,
|
|
33
|
+
hasChildDirective: false,
|
|
34
|
+
hasInjectedModules: true,
|
|
35
|
+
tagMapper: {},
|
|
36
|
+
tagNameMapper: {},
|
|
37
|
+
isVue3: !isExecute,
|
|
38
|
+
templateCollection: {},
|
|
36
39
|
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
class DocumentEditorComponent extends ComponentBase {
|
|
40
|
-
constructor() {
|
|
41
|
-
super(arguments);
|
|
42
|
-
this.propKeys = properties;
|
|
43
|
-
this.models = modelProps;
|
|
44
|
-
this.hasChildDirective = false;
|
|
45
|
-
this.hasInjectedModules = true;
|
|
46
|
-
this.tagMapper = {};
|
|
47
|
-
this.tagNameMapper = {};
|
|
48
|
-
this.isVue3 = !isExecute;
|
|
49
|
-
this.ej2Instances = new DocumentEditor({});
|
|
40
|
+
},
|
|
41
|
+
created() {
|
|
50
42
|
this.bindProperties();
|
|
51
43
|
this.ej2Instances._setProperties = this.ej2Instances.setProperties;
|
|
52
44
|
this.ej2Instances.setProperties = this.setProperties;
|
|
53
45
|
this.ej2Instances.clearTemplate = this.clearTemplate;
|
|
54
46
|
this.updated = this.updated;
|
|
55
|
-
}
|
|
56
|
-
clearTemplate(templateNames) {
|
|
57
|
-
if (!templateNames) {
|
|
58
|
-
templateNames = Object.keys(this.templateCollection || {});
|
|
59
|
-
}
|
|
60
|
-
if (templateNames.length && this.templateCollection) {
|
|
61
|
-
for (let tempName of templateNames) {
|
|
62
|
-
let elementCollection = this.templateCollection[tempName];
|
|
63
|
-
if (elementCollection && elementCollection.length) {
|
|
64
|
-
for (let ele of elementCollection) {
|
|
65
|
-
let destroy = getValue('__vue__.$destroy', ele);
|
|
66
|
-
if (destroy) {
|
|
67
|
-
ele.__vue__.$destroy();
|
|
68
|
-
}
|
|
69
|
-
if (ele.innerHTML) {
|
|
70
|
-
ele.innerHTML = '';
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
delete this.templateCollection[tempName];
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
setProperties(prop, muteOnChange) {
|
|
79
|
-
if (this.isVue3) {
|
|
80
|
-
this.models = !this.models ? this.ej2Instances.referModels : this.models;
|
|
81
|
-
}
|
|
82
|
-
if (this.ej2Instances && this.ej2Instances._setProperties) {
|
|
83
|
-
this.ej2Instances._setProperties(prop, muteOnChange);
|
|
84
|
-
}
|
|
85
|
-
if (prop && this.models && this.models.length) {
|
|
86
|
-
Object.keys(prop).map((key) => {
|
|
87
|
-
this.models.map((model) => {
|
|
88
|
-
if ((key === model) && !(/datasource/i.test(key))) {
|
|
89
|
-
if (this.isVue3) {
|
|
90
|
-
this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
this.$emit('update:' + key, prop[key]);
|
|
94
|
-
this.$emit('modelchanged', prop[key]);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
47
|
+
},
|
|
101
48
|
render(createElement) {
|
|
102
49
|
let h = !isExecute ? gh : createElement;
|
|
103
50
|
let slots = null;
|
|
@@ -105,110 +52,142 @@ class DocumentEditorComponent extends ComponentBase {
|
|
|
105
52
|
slots = !isExecute ? this.$slots.default() : this.$slots.default;
|
|
106
53
|
}
|
|
107
54
|
return h('div', slots);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
clearTemplate(templateNames) {
|
|
58
|
+
if (!templateNames) {
|
|
59
|
+
templateNames = Object.keys(this.templateCollection || {});
|
|
60
|
+
}
|
|
61
|
+
if (templateNames.length && this.templateCollection) {
|
|
62
|
+
for (let tempName of templateNames) {
|
|
63
|
+
let elementCollection = this.templateCollection[tempName];
|
|
64
|
+
if (elementCollection && elementCollection.length) {
|
|
65
|
+
for (let ele of elementCollection) {
|
|
66
|
+
let destroy = getValue('__vue__.$destroy', ele);
|
|
67
|
+
if (destroy) {
|
|
68
|
+
ele.__vue__.$destroy();
|
|
69
|
+
}
|
|
70
|
+
if (ele.innerHTML) {
|
|
71
|
+
ele.innerHTML = '';
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
delete this.templateCollection[tempName];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
setProperties(prop, muteOnChange) {
|
|
80
|
+
if (this.isVue3) {
|
|
81
|
+
this.models = !this.models ? this.ej2Instances.referModels : this.models;
|
|
82
|
+
}
|
|
83
|
+
if (this.ej2Instances && this.ej2Instances._setProperties) {
|
|
84
|
+
this.ej2Instances._setProperties(prop, muteOnChange);
|
|
85
|
+
}
|
|
86
|
+
if (prop && this.models && this.models.length) {
|
|
87
|
+
Object.keys(prop).map((key) => {
|
|
88
|
+
this.models.map((model) => {
|
|
89
|
+
if ((key === model) && !(/datasource/i.test(key))) {
|
|
90
|
+
if (this.isVue3) {
|
|
91
|
+
this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.$emit('update:' + key, prop[key]);
|
|
95
|
+
this.$emit('modelchanged', prop[key]);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
custom() {
|
|
103
|
+
this.updated();
|
|
104
|
+
},
|
|
105
|
+
enableAllModules() {
|
|
106
|
+
return this.ej2Instances.enableAllModules();
|
|
107
|
+
},
|
|
108
|
+
exportAsImage(pageNumber, format) {
|
|
109
|
+
return this.ej2Instances.exportAsImage(pageNumber, format);
|
|
110
|
+
},
|
|
111
|
+
exportFormData() {
|
|
112
|
+
return this.ej2Instances.exportFormData();
|
|
113
|
+
},
|
|
114
|
+
fitPage(pageFitType) {
|
|
115
|
+
return this.ej2Instances.fitPage(pageFitType);
|
|
116
|
+
},
|
|
117
|
+
focusIn() {
|
|
118
|
+
return this.ej2Instances.focusIn();
|
|
119
|
+
},
|
|
120
|
+
getBookmarks() {
|
|
121
|
+
return this.ej2Instances.getBookmarks();
|
|
122
|
+
},
|
|
123
|
+
getFormFieldInfo(name) {
|
|
124
|
+
return this.ej2Instances.getFormFieldInfo(name);
|
|
125
|
+
},
|
|
126
|
+
getFormFieldNames() {
|
|
127
|
+
return this.ej2Instances.getFormFieldNames();
|
|
128
|
+
},
|
|
129
|
+
getStyleNames(styleType) {
|
|
130
|
+
return this.ej2Instances.getStyleNames(styleType);
|
|
131
|
+
},
|
|
132
|
+
getStyles(styleType) {
|
|
133
|
+
return this.ej2Instances.getStyles(styleType);
|
|
134
|
+
},
|
|
135
|
+
importFormData(formData) {
|
|
136
|
+
return this.ej2Instances.importFormData(formData);
|
|
137
|
+
},
|
|
138
|
+
open(sfdtText) {
|
|
139
|
+
return this.ej2Instances.open(sfdtText);
|
|
140
|
+
},
|
|
141
|
+
openBlank() {
|
|
142
|
+
return this.ej2Instances.openBlank();
|
|
143
|
+
},
|
|
144
|
+
print(printWindow) {
|
|
145
|
+
return this.ej2Instances.print(printWindow);
|
|
146
|
+
},
|
|
147
|
+
resetFormFields(name) {
|
|
148
|
+
return this.ej2Instances.resetFormFields(name);
|
|
149
|
+
},
|
|
150
|
+
resize(width, height) {
|
|
151
|
+
return this.ej2Instances.resize(width, height);
|
|
152
|
+
},
|
|
153
|
+
save(fileName, formatType) {
|
|
154
|
+
return this.ej2Instances.save(fileName, formatType);
|
|
155
|
+
},
|
|
156
|
+
saveAsBlob(formatType) {
|
|
157
|
+
return this.ej2Instances.saveAsBlob(formatType);
|
|
158
|
+
},
|
|
159
|
+
scrollToPage(pageNumber) {
|
|
160
|
+
return this.ej2Instances.scrollToPage(pageNumber);
|
|
161
|
+
},
|
|
162
|
+
serialize() {
|
|
163
|
+
return this.ej2Instances.serialize();
|
|
164
|
+
},
|
|
165
|
+
setDefaultCharacterFormat(characterFormat) {
|
|
166
|
+
return this.ej2Instances.setDefaultCharacterFormat(characterFormat);
|
|
167
|
+
},
|
|
168
|
+
setDefaultParagraphFormat(paragraphFormat) {
|
|
169
|
+
return this.ej2Instances.setDefaultParagraphFormat(paragraphFormat);
|
|
170
|
+
},
|
|
171
|
+
setDefaultSectionFormat(sectionFormat) {
|
|
172
|
+
return this.ej2Instances.setDefaultSectionFormat(sectionFormat);
|
|
173
|
+
},
|
|
174
|
+
setFormFieldInfo(name, formFieldInfo) {
|
|
175
|
+
return this.ej2Instances.setFormFieldInfo(name, formFieldInfo);
|
|
176
|
+
},
|
|
177
|
+
showDialog(dialogType) {
|
|
178
|
+
return this.ej2Instances.showDialog(dialogType);
|
|
179
|
+
},
|
|
180
|
+
showOptionsPane() {
|
|
181
|
+
return this.ej2Instances.showOptionsPane();
|
|
182
|
+
},
|
|
183
|
+
showRestrictEditingPane(show) {
|
|
184
|
+
return this.ej2Instances.showRestrictEditingPane(show);
|
|
185
|
+
},
|
|
186
|
+
updateFields() {
|
|
187
|
+
return this.ej2Instances.updateFields();
|
|
188
|
+
},
|
|
189
|
+
}
|
|
190
|
+
});
|
|
212
191
|
const DocumentEditorPlugin = {
|
|
213
192
|
name: 'ejs-documenteditor',
|
|
214
193
|
install(Vue) {
|
|
@@ -216,14 +195,7 @@ const DocumentEditorPlugin = {
|
|
|
216
195
|
}
|
|
217
196
|
};
|
|
218
197
|
|
|
219
|
-
|
|
220
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
221
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
222
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
223
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
224
|
-
};
|
|
225
|
-
// {{VueImport}}
|
|
226
|
-
const properties$1 = ['isLazyUpdate', 'plugins', 'currentUser', 'documentEditorSettings', 'documentSettings', 'enableComment', 'enableCsp', 'enableLocalPaste', 'enableLockAndEdit', 'enablePersistence', 'enableRtl', 'enableSpellCheck', 'enableToolbar', 'enableTrackChanges', 'headers', 'height', 'layoutType', 'locale', 'restrictEditing', 'serverActionSettings', 'serviceUrl', 'showPropertiesPane', 'toolbarItems', 'userColor', 'width', 'zIndex', 'beforeCommentAction', 'beforePaneSwitch', 'commentDelete', 'contentChange', 'contentControl', 'created', 'customContextMenuBeforeOpen', 'customContextMenuSelect', 'destroyed', 'documentChange', 'selectionChange', 'serviceFailure', 'toolbarClick', 'trackChange', 'beforeXmlHttpRequestSend'];
|
|
198
|
+
const properties$1 = ['isLazyUpdate', 'plugins', 'currentUser', 'documentEditorSettings', 'documentSettings', 'enableAutoFocus', 'enableComment', 'enableCsp', 'enableLocalPaste', 'enableLockAndEdit', 'enablePersistence', 'enableRtl', 'enableSpellCheck', 'enableToolbar', 'enableTrackChanges', 'headers', 'height', 'layoutType', 'locale', 'restrictEditing', 'serverActionSettings', 'serviceUrl', 'showPropertiesPane', 'toolbarItems', 'userColor', 'width', 'zIndex', 'beforeCommentAction', 'beforePaneSwitch', 'commentDelete', 'contentChange', 'contentControl', 'created', 'customContextMenuBeforeOpen', 'customContextMenuSelect', 'destroyed', 'documentChange', 'selectionChange', 'serviceFailure', 'toolbarClick', 'trackChange', 'beforeXmlHttpRequestSend'];
|
|
227
199
|
const modelProps$1 = [];
|
|
228
200
|
const testProp$1 = getProps({ props: properties$1 });
|
|
229
201
|
const props$1 = testProp$1[0];
|
|
@@ -239,79 +211,33 @@ for (let props of modelProps$1) {
|
|
|
239
211
|
* <ejs-documenteditor-container id='container'></ejs-documenteditor-container>
|
|
240
212
|
* ```
|
|
241
213
|
*/
|
|
242
|
-
let DocumentEditorContainerComponent =
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
214
|
+
let DocumentEditorContainerComponent = vueDefineComponent({
|
|
215
|
+
name: 'DocumentEditorContainerComponent',
|
|
216
|
+
mixins: [ComponentBase],
|
|
217
|
+
props: props$1,
|
|
218
|
+
watch: watch$1,
|
|
219
|
+
emits: emitProbs$1,
|
|
220
|
+
provide() { return { custom: this.custom }; },
|
|
221
|
+
data() {
|
|
248
222
|
return {
|
|
249
|
-
|
|
223
|
+
ej2Instances: new DocumentEditorContainer({}),
|
|
224
|
+
propKeys: properties$1,
|
|
225
|
+
models: modelProps$1,
|
|
226
|
+
hasChildDirective: false,
|
|
227
|
+
hasInjectedModules: true,
|
|
228
|
+
tagMapper: {},
|
|
229
|
+
tagNameMapper: {},
|
|
230
|
+
isVue3: !isExecute,
|
|
231
|
+
templateCollection: {},
|
|
250
232
|
};
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
class DocumentEditorContainerComponent extends ComponentBase {
|
|
254
|
-
constructor() {
|
|
255
|
-
super(arguments);
|
|
256
|
-
this.propKeys = properties$1;
|
|
257
|
-
this.models = modelProps$1;
|
|
258
|
-
this.hasChildDirective = false;
|
|
259
|
-
this.hasInjectedModules = true;
|
|
260
|
-
this.tagMapper = {};
|
|
261
|
-
this.tagNameMapper = {};
|
|
262
|
-
this.isVue3 = !isExecute;
|
|
263
|
-
this.ej2Instances = new DocumentEditorContainer({});
|
|
233
|
+
},
|
|
234
|
+
created() {
|
|
264
235
|
this.bindProperties();
|
|
265
236
|
this.ej2Instances._setProperties = this.ej2Instances.setProperties;
|
|
266
237
|
this.ej2Instances.setProperties = this.setProperties;
|
|
267
238
|
this.ej2Instances.clearTemplate = this.clearTemplate;
|
|
268
239
|
this.updated = this.updated;
|
|
269
|
-
}
|
|
270
|
-
clearTemplate(templateNames) {
|
|
271
|
-
if (!templateNames) {
|
|
272
|
-
templateNames = Object.keys(this.templateCollection || {});
|
|
273
|
-
}
|
|
274
|
-
if (templateNames.length && this.templateCollection) {
|
|
275
|
-
for (let tempName of templateNames) {
|
|
276
|
-
let elementCollection = this.templateCollection[tempName];
|
|
277
|
-
if (elementCollection && elementCollection.length) {
|
|
278
|
-
for (let ele of elementCollection) {
|
|
279
|
-
let destroy = getValue('__vue__.$destroy', ele);
|
|
280
|
-
if (destroy) {
|
|
281
|
-
ele.__vue__.$destroy();
|
|
282
|
-
}
|
|
283
|
-
if (ele.innerHTML) {
|
|
284
|
-
ele.innerHTML = '';
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
delete this.templateCollection[tempName];
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
setProperties(prop, muteOnChange) {
|
|
293
|
-
if (this.isVue3) {
|
|
294
|
-
this.models = !this.models ? this.ej2Instances.referModels : this.models;
|
|
295
|
-
}
|
|
296
|
-
if (this.ej2Instances && this.ej2Instances._setProperties) {
|
|
297
|
-
this.ej2Instances._setProperties(prop, muteOnChange);
|
|
298
|
-
}
|
|
299
|
-
if (prop && this.models && this.models.length) {
|
|
300
|
-
Object.keys(prop).map((key) => {
|
|
301
|
-
this.models.map((model) => {
|
|
302
|
-
if ((key === model) && !(/datasource/i.test(key))) {
|
|
303
|
-
if (this.isVue3) {
|
|
304
|
-
this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);
|
|
305
|
-
}
|
|
306
|
-
else {
|
|
307
|
-
this.$emit('update:' + key, prop[key]);
|
|
308
|
-
this.$emit('modelchanged', prop[key]);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
}
|
|
240
|
+
},
|
|
315
241
|
render(createElement) {
|
|
316
242
|
let h = !isExecute ? gh : createElement;
|
|
317
243
|
let slots = null;
|
|
@@ -319,38 +245,70 @@ class DocumentEditorContainerComponent extends ComponentBase {
|
|
|
319
245
|
slots = !isExecute ? this.$slots.default() : this.$slots.default;
|
|
320
246
|
}
|
|
321
247
|
return h('div', slots);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
248
|
+
},
|
|
249
|
+
methods: {
|
|
250
|
+
clearTemplate(templateNames) {
|
|
251
|
+
if (!templateNames) {
|
|
252
|
+
templateNames = Object.keys(this.templateCollection || {});
|
|
253
|
+
}
|
|
254
|
+
if (templateNames.length && this.templateCollection) {
|
|
255
|
+
for (let tempName of templateNames) {
|
|
256
|
+
let elementCollection = this.templateCollection[tempName];
|
|
257
|
+
if (elementCollection && elementCollection.length) {
|
|
258
|
+
for (let ele of elementCollection) {
|
|
259
|
+
let destroy = getValue('__vue__.$destroy', ele);
|
|
260
|
+
if (destroy) {
|
|
261
|
+
ele.__vue__.$destroy();
|
|
262
|
+
}
|
|
263
|
+
if (ele.innerHTML) {
|
|
264
|
+
ele.innerHTML = '';
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
delete this.templateCollection[tempName];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
setProperties(prop, muteOnChange) {
|
|
273
|
+
if (this.isVue3) {
|
|
274
|
+
this.models = !this.models ? this.ej2Instances.referModels : this.models;
|
|
275
|
+
}
|
|
276
|
+
if (this.ej2Instances && this.ej2Instances._setProperties) {
|
|
277
|
+
this.ej2Instances._setProperties(prop, muteOnChange);
|
|
278
|
+
}
|
|
279
|
+
if (prop && this.models && this.models.length) {
|
|
280
|
+
Object.keys(prop).map((key) => {
|
|
281
|
+
this.models.map((model) => {
|
|
282
|
+
if ((key === model) && !(/datasource/i.test(key))) {
|
|
283
|
+
if (this.isVue3) {
|
|
284
|
+
this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
this.$emit('update:' + key, prop[key]);
|
|
288
|
+
this.$emit('modelchanged', prop[key]);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
custom() {
|
|
296
|
+
this.updated();
|
|
297
|
+
},
|
|
298
|
+
resize(width, height) {
|
|
299
|
+
return this.ej2Instances.resize(width, height);
|
|
300
|
+
},
|
|
301
|
+
setDefaultCharacterFormat(characterFormat) {
|
|
302
|
+
return this.ej2Instances.setDefaultCharacterFormat(characterFormat);
|
|
303
|
+
},
|
|
304
|
+
setDefaultParagraphFormat(paragraphFormat) {
|
|
305
|
+
return this.ej2Instances.setDefaultParagraphFormat(paragraphFormat);
|
|
306
|
+
},
|
|
307
|
+
setDefaultSectionFormat(sectionFormat) {
|
|
308
|
+
return this.ej2Instances.setDefaultSectionFormat(sectionFormat);
|
|
309
|
+
},
|
|
310
|
+
}
|
|
311
|
+
});
|
|
354
312
|
const DocumentEditorContainerPlugin = {
|
|
355
313
|
name: 'ejs-documenteditorcontainer',
|
|
356
314
|
install(Vue) {
|