@progress/kendo-vue-editor 2.7.1 → 2.7.3-dev.202201070829

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/dist/cdn/js/kendo-vue-editor.js +1 -1
  2. package/dist/es/Editor.d.ts +295 -0
  3. package/dist/es/Editor.js +705 -0
  4. package/dist/es/EditorProps.d.ts +176 -0
  5. package/dist/es/EditorProps.js +0 -0
  6. package/dist/es/additionalTypes.ts +3 -0
  7. package/dist/es/config/defaultStyles.d.ts +12 -0
  8. package/dist/es/config/defaultStyles.js +12 -0
  9. package/dist/es/config/pasteSettings.d.ts +6 -0
  10. package/dist/es/config/pasteSettings.js +0 -0
  11. package/dist/es/config/schema.d.ts +8 -0
  12. package/dist/es/config/schema.js +51 -0
  13. package/dist/es/config/shortcuts.d.ts +22 -0
  14. package/dist/es/config/shortcuts.js +70 -0
  15. package/dist/es/config/toolsSettings.d.ts +481 -0
  16. package/dist/es/config/toolsSettings.js +523 -0
  17. package/dist/es/dialogs/EditorDialogProps.d.ts +26 -0
  18. package/dist/es/dialogs/EditorDialogProps.js +0 -0
  19. package/dist/es/dialogs/FindReplace.d.ts +65 -0
  20. package/dist/es/dialogs/FindReplace.js +789 -0
  21. package/dist/es/dialogs/insertImage.d.ts +52 -0
  22. package/dist/es/dialogs/insertImage.js +282 -0
  23. package/dist/es/dialogs/insertLink.d.ts +50 -0
  24. package/dist/es/dialogs/insertLink.js +286 -0
  25. package/dist/es/dialogs/main.d.ts +1 -0
  26. package/dist/es/dialogs/main.js +42 -0
  27. package/dist/es/dialogs/viewHtml.d.ts +49 -0
  28. package/dist/es/dialogs/viewHtml.js +144 -0
  29. package/dist/es/main.d.ts +166 -1
  30. package/dist/es/main.js +110 -0
  31. package/dist/es/messages/index.d.ts +479 -0
  32. package/dist/es/messages/index.js +485 -0
  33. package/dist/es/package-metadata.d.ts +5 -0
  34. package/dist/es/package-metadata.js +11 -0
  35. package/dist/es/tools/ToolProps.d.ts +34 -0
  36. package/dist/es/tools/ToolProps.js +0 -0
  37. package/dist/es/tools/align.d.ts +37 -0
  38. package/dist/es/tools/align.js +116 -0
  39. package/dist/es/tools/applyColor.d.ts +43 -0
  40. package/dist/es/tools/applyColor.js +92 -0
  41. package/dist/es/tools/cleanFormatting.d.ts +47 -0
  42. package/dist/es/tools/cleanFormatting.js +114 -0
  43. package/dist/es/tools/findReplace.d.ts +41 -0
  44. package/dist/es/tools/findReplace.js +119 -0
  45. package/dist/es/tools/fontStyle.d.ts +53 -0
  46. package/dist/es/tools/fontStyle.js +163 -0
  47. package/dist/es/tools/formatBlock.d.ts +43 -0
  48. package/dist/es/tools/formatBlock.js +155 -0
  49. package/dist/es/tools/history.d.ts +18 -0
  50. package/dist/es/tools/history.js +4 -0
  51. package/dist/es/tools/indent.d.ts +42 -0
  52. package/dist/es/tools/indent.js +127 -0
  53. package/dist/es/tools/inlineFormat.d.ts +72 -0
  54. package/dist/es/tools/inlineFormat.js +125 -0
  55. package/dist/es/tools/insertImage.d.ts +44 -0
  56. package/dist/es/tools/insertImage.js +130 -0
  57. package/dist/es/tools/insertLink.d.ts +44 -0
  58. package/dist/es/tools/insertLink.js +130 -0
  59. package/dist/es/tools/insertTable/index.d.ts +1 -0
  60. package/dist/es/tools/insertTable/index.js +6 -0
  61. package/dist/es/tools/insertTable/popup.d.ts +78 -0
  62. package/dist/es/tools/insertTable/popup.js +168 -0
  63. package/dist/es/tools/insertTable/popupGrid.d.ts +49 -0
  64. package/dist/es/tools/insertTable/popupGrid.js +131 -0
  65. package/dist/es/tools/insertTable/tool.d.ts +51 -0
  66. package/dist/es/tools/insertTable/tool.js +165 -0
  67. package/dist/es/tools/lists.d.ts +52 -0
  68. package/dist/es/tools/lists.js +132 -0
  69. package/dist/es/tools/main.d.ts +137 -0
  70. package/dist/es/tools/main.js +0 -0
  71. package/dist/es/tools/outdent.d.ts +42 -0
  72. package/dist/es/tools/outdent.js +129 -0
  73. package/dist/es/tools/pdf.d.ts +56 -0
  74. package/dist/es/tools/pdf.js +105 -0
  75. package/dist/es/tools/print.d.ts +47 -0
  76. package/dist/es/tools/print.js +109 -0
  77. package/dist/es/tools/proseMirrorTool.d.ts +43 -0
  78. package/dist/es/tools/proseMirrorTool.js +110 -0
  79. package/dist/es/tools/selectAll.d.ts +47 -0
  80. package/dist/es/tools/selectAll.js +102 -0
  81. package/dist/es/tools/tableEdit.d.ts +51 -0
  82. package/dist/es/tools/tableEdit.js +42 -0
  83. package/dist/es/tools/unlink.d.ts +42 -0
  84. package/dist/es/tools/unlink.js +110 -0
  85. package/dist/es/tools/utils.d.ts +18 -0
  86. package/dist/es/tools/utils.js +36 -0
  87. package/dist/es/tools/viewHtml.d.ts +49 -0
  88. package/dist/es/tools/viewHtml.js +125 -0
  89. package/dist/es/utils/browser-detection.d.ts +4 -0
  90. package/dist/es/utils/browser-detection.js +5 -0
  91. package/dist/es/utils/controlled-value.d.ts +5 -0
  92. package/dist/es/utils/controlled-value.js +31 -0
  93. package/dist/es/utils/index.d.ts +358 -0
  94. package/dist/es/utils/index.js +422 -0
  95. package/dist/es/utils/props-key.d.ts +5 -0
  96. package/dist/es/utils/props-key.js +5 -0
  97. package/dist/npm/Editor.d.ts +295 -0
  98. package/dist/npm/Editor.js +746 -0
  99. package/dist/npm/EditorProps.d.ts +176 -0
  100. package/dist/npm/EditorProps.js +2 -0
  101. package/dist/npm/additionalTypes.ts +3 -0
  102. package/dist/npm/config/defaultStyles.d.ts +12 -0
  103. package/dist/npm/config/defaultStyles.js +15 -0
  104. package/dist/npm/config/pasteSettings.d.ts +6 -0
  105. package/dist/npm/config/pasteSettings.js +2 -0
  106. package/dist/npm/config/schema.d.ts +8 -0
  107. package/dist/npm/config/schema.js +55 -0
  108. package/dist/npm/config/shortcuts.d.ts +22 -0
  109. package/dist/npm/config/shortcuts.js +79 -0
  110. package/dist/npm/config/toolsSettings.d.ts +481 -0
  111. package/dist/npm/config/toolsSettings.js +526 -0
  112. package/dist/npm/dialogs/EditorDialogProps.d.ts +26 -0
  113. package/dist/npm/dialogs/EditorDialogProps.js +2 -0
  114. package/dist/npm/dialogs/FindReplace.d.ts +65 -0
  115. package/dist/npm/dialogs/FindReplace.js +805 -0
  116. package/dist/npm/dialogs/insertImage.d.ts +52 -0
  117. package/dist/npm/dialogs/insertImage.js +296 -0
  118. package/dist/npm/dialogs/insertLink.d.ts +50 -0
  119. package/dist/npm/dialogs/insertLink.js +300 -0
  120. package/dist/npm/dialogs/main.d.ts +1 -0
  121. package/dist/npm/dialogs/main.js +42 -0
  122. package/dist/npm/dialogs/viewHtml.d.ts +49 -0
  123. package/dist/npm/dialogs/viewHtml.js +159 -0
  124. package/dist/npm/main.d.ts +166 -1
  125. package/dist/npm/main.js +89 -0
  126. package/dist/npm/messages/index.d.ts +479 -0
  127. package/dist/npm/messages/index.js +488 -0
  128. package/dist/npm/package-metadata.d.ts +5 -0
  129. package/dist/npm/package-metadata.js +14 -0
  130. package/dist/npm/tools/ToolProps.d.ts +34 -0
  131. package/dist/npm/tools/ToolProps.js +2 -0
  132. package/dist/npm/tools/align.d.ts +37 -0
  133. package/dist/npm/tools/align.js +130 -0
  134. package/dist/npm/tools/applyColor.d.ts +43 -0
  135. package/dist/npm/tools/applyColor.js +105 -0
  136. package/dist/npm/tools/cleanFormatting.d.ts +47 -0
  137. package/dist/npm/tools/cleanFormatting.js +128 -0
  138. package/dist/npm/tools/findReplace.d.ts +41 -0
  139. package/dist/npm/tools/findReplace.js +133 -0
  140. package/dist/npm/tools/fontStyle.d.ts +53 -0
  141. package/dist/npm/tools/fontStyle.js +177 -0
  142. package/dist/npm/tools/formatBlock.d.ts +43 -0
  143. package/dist/npm/tools/formatBlock.js +169 -0
  144. package/dist/npm/tools/history.d.ts +18 -0
  145. package/dist/npm/tools/history.js +10 -0
  146. package/dist/npm/tools/indent.d.ts +42 -0
  147. package/dist/npm/tools/indent.js +140 -0
  148. package/dist/npm/tools/inlineFormat.d.ts +72 -0
  149. package/dist/npm/tools/inlineFormat.js +138 -0
  150. package/dist/npm/tools/insertImage.d.ts +44 -0
  151. package/dist/npm/tools/insertImage.js +144 -0
  152. package/dist/npm/tools/insertLink.d.ts +44 -0
  153. package/dist/npm/tools/insertLink.js +144 -0
  154. package/dist/npm/tools/insertTable/index.d.ts +1 -0
  155. package/dist/npm/tools/insertTable/index.js +6 -0
  156. package/dist/npm/tools/insertTable/popup.d.ts +78 -0
  157. package/dist/npm/tools/insertTable/popup.js +179 -0
  158. package/dist/npm/tools/insertTable/popupGrid.d.ts +49 -0
  159. package/dist/npm/tools/insertTable/popupGrid.js +141 -0
  160. package/dist/npm/tools/insertTable/tool.d.ts +51 -0
  161. package/dist/npm/tools/insertTable/tool.js +180 -0
  162. package/dist/npm/tools/lists.d.ts +52 -0
  163. package/dist/npm/tools/lists.js +145 -0
  164. package/dist/npm/tools/main.d.ts +137 -0
  165. package/dist/npm/tools/main.js +5 -0
  166. package/dist/npm/tools/outdent.d.ts +42 -0
  167. package/dist/npm/tools/outdent.js +142 -0
  168. package/dist/npm/tools/pdf.d.ts +56 -0
  169. package/dist/npm/tools/pdf.js +119 -0
  170. package/dist/npm/tools/print.d.ts +47 -0
  171. package/dist/npm/tools/print.js +122 -0
  172. package/dist/npm/tools/proseMirrorTool.d.ts +43 -0
  173. package/dist/npm/tools/proseMirrorTool.js +123 -0
  174. package/dist/npm/tools/selectAll.d.ts +47 -0
  175. package/dist/npm/tools/selectAll.js +116 -0
  176. package/dist/npm/tools/tableEdit.d.ts +51 -0
  177. package/dist/npm/tools/tableEdit.js +50 -0
  178. package/dist/npm/tools/unlink.d.ts +42 -0
  179. package/dist/npm/tools/unlink.js +123 -0
  180. package/dist/npm/tools/utils.d.ts +18 -0
  181. package/dist/npm/tools/utils.js +45 -0
  182. package/dist/npm/tools/viewHtml.d.ts +49 -0
  183. package/dist/npm/tools/viewHtml.js +138 -0
  184. package/dist/npm/utils/browser-detection.d.ts +4 -0
  185. package/dist/npm/utils/browser-detection.js +8 -0
  186. package/dist/npm/utils/controlled-value.d.ts +5 -0
  187. package/dist/npm/utils/controlled-value.js +34 -0
  188. package/dist/npm/utils/index.d.ts +358 -0
  189. package/dist/npm/utils/index.js +425 -0
  190. package/dist/npm/utils/props-key.d.ts +5 -0
  191. package/dist/npm/utils/props-key.js +8 -0
  192. package/package.json +20 -20
@@ -0,0 +1,789 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ import { Window } from '@progress/kendo-vue-dialogs';
6
+ import { TabStrip, TabStripTab } from '@progress/kendo-vue-layout';
7
+ import { provideLocalizationService } from '@progress/kendo-vue-intl';
8
+ import { messages } from './../messages';
9
+ import { EditorToolsSettings } from './../config/toolsSettings';
10
+ import { formatString } from './../tools/utils';
11
+ import { find, replace, replaceAll, findAll, TextSelection, textHighlightKey, selectedLineTextOnly } from '@progress/kendo-editor-common';
12
+ var enter = 13,
13
+ esc = 27;
14
+ var settings = EditorToolsSettings.findAndReplace; // tslint:enable:max-line-length
15
+
16
+ var FindAndReplaceDialog = {
17
+ name: 'KendoFindAndReplaceDialog',
18
+ props: {
19
+ view: Object,
20
+ settings: {
21
+ type: Object,
22
+ default: function _default() {
23
+ return settings;
24
+ }
25
+ },
26
+ dir: String
27
+ },
28
+ inject: {
29
+ kendoLocalizationService: {
30
+ default: null
31
+ }
32
+ },
33
+ data: function data() {
34
+ return {
35
+ selectedTab: 0,
36
+ searchText: selectedLineTextOnly(this.$props.view.state),
37
+ replaceText: '',
38
+ matchCase: false,
39
+ matchWord: false,
40
+ matchCyclic: false,
41
+ useRegExp: false,
42
+ nextMatch: undefined
43
+ };
44
+ },
45
+ mounted: function mounted() {
46
+ if (this.$el) {
47
+ document.body.append(this.$el);
48
+ }
49
+ },
50
+
51
+ /**
52
+ * @hidden
53
+ */
54
+ updated: function updated() {
55
+ var view = this.$props.view;
56
+ var _a = this.$data,
57
+ _b = _a.matches,
58
+ matches = _b === void 0 ? [] : _b,
59
+ nextMatch = _a.nextMatch;
60
+
61
+ if (this._prevMatch !== nextMatch) {
62
+ var state = view.state; // highlight selection
63
+
64
+ var tr = state.tr;
65
+ var highlights_1 = [];
66
+ matches.forEach(function (m) {
67
+ highlights_1.push({
68
+ from: m.from,
69
+ to: m.to,
70
+ attrs: {
71
+ class: nextMatch && m.eq(nextMatch) ? 'k-text-selected' : 'k-text-highlighted'
72
+ }
73
+ });
74
+ });
75
+ tr.setMeta(textHighlightKey, highlights_1);
76
+ tr.setSelection(nextMatch || TextSelection.create(state.doc, state.selection.from));
77
+ view.dispatch(tr);
78
+ }
79
+ },
80
+ destroyed: !!gh ? undefined : function () {
81
+ if (this.$el) {
82
+ this.$el.remove();
83
+ }
84
+ },
85
+ // @ts-ignore
86
+ unmounted: function unmounted() {
87
+ if (this.$el) {
88
+ this.$el.remove();
89
+ }
90
+ },
91
+ watch: {
92
+ nextMatch: function nextMatch(_newNextMatch, oldMatch) {
93
+ this._prevMatch = oldMatch;
94
+ }
95
+ },
96
+ // @ts-ignore
97
+ setup: !gh ? undefined : function () {
98
+ var v3 = !!gh;
99
+ return {
100
+ v3: v3
101
+ };
102
+ },
103
+ // @ts-ignore
104
+ render: function render(createElement) {
105
+ var _this = this;
106
+
107
+ var h = gh || createElement;
108
+ var localization = provideLocalizationService(this);
109
+ var _a = this.settings.messages,
110
+ findReplaceDialogTitle = _a.findReplaceDialogTitle,
111
+ findReplaceTabFind = _a.findReplaceTabFind,
112
+ findReplaceTabReplace = _a.findReplaceTabReplace,
113
+ findReplaceFindWhat = _a.findReplaceFindWhat,
114
+ findReplaceReplaceWith = _a.findReplaceReplaceWith,
115
+ findReplaceReplace = _a.findReplaceReplace,
116
+ findReplaceReplaceAll = _a.findReplaceReplaceAll,
117
+ findReplaceMatchCase = _a.findReplaceMatchCase,
118
+ findReplaceMatchWord = _a.findReplaceMatchWord,
119
+ findReplaceMatchCyclic = _a.findReplaceMatchCyclic,
120
+ findReplaceUseRegExp = _a.findReplaceUseRegExp,
121
+ findReplacePrevMatch = _a.findReplacePrevMatch,
122
+ findReplaceNextMatch = _a.findReplaceNextMatch,
123
+ findReplaceMatches = _a.findReplaceMatches;
124
+
125
+ var _b = this,
126
+ matchCase = _b.matchCase,
127
+ matchWord = _b.matchWord,
128
+ matchCyclic = _b.matchCyclic,
129
+ useRegExp = _b.useRegExp,
130
+ searchText = _b.searchText,
131
+ replaceText = _b.replaceText,
132
+ nextMatch = _b.nextMatch;
133
+
134
+ var checkboxes = h("div", {
135
+ "class": "k-search-options"
136
+ }, [h("span", [h("input", {
137
+ "class": "k-checkbox",
138
+ type: "checkbox",
139
+ attrs: this.v3 ? undefined : {
140
+ type: "checkbox",
141
+ id: "match-case"
142
+ },
143
+ id: "match-case",
144
+ checked: this.v3 ? matchCase : null,
145
+ domProps: this.v3 ? undefined : {
146
+ "checked": matchCase
147
+ },
148
+ onChange: this.onMatchCaseChecked,
149
+ on: this.v3 ? undefined : {
150
+ "change": this.onMatchCaseChecked
151
+ }
152
+ }), h("label", {
153
+ "for": "match-case",
154
+ attrs: this.v3 ? undefined : {
155
+ "for": "match-case"
156
+ },
157
+ "class": "k-checkbox-label"
158
+ }, [localization.toLanguageString(findReplaceMatchCase, messages[findReplaceMatchCase])])]), h("span", [h("input", {
159
+ "class": "k-checkbox",
160
+ type: "checkbox",
161
+ attrs: this.v3 ? undefined : {
162
+ type: "checkbox",
163
+ id: "match-whole"
164
+ },
165
+ id: "match-whole",
166
+ checked: this.v3 ? matchWord : null,
167
+ domProps: this.v3 ? undefined : {
168
+ "checked": matchWord
169
+ },
170
+ onChange: this.onMatchWordChecked,
171
+ on: this.v3 ? undefined : {
172
+ "change": this.onMatchWordChecked
173
+ }
174
+ }), h("label", {
175
+ "for": "match-whole",
176
+ attrs: this.v3 ? undefined : {
177
+ "for": "match-whole"
178
+ },
179
+ "class": "k-checkbox-label"
180
+ }, [localization.toLanguageString(findReplaceMatchWord, messages[findReplaceMatchWord])])]), h("span", [h("input", {
181
+ "class": "k-checkbox",
182
+ type: "checkbox",
183
+ attrs: this.v3 ? undefined : {
184
+ type: "checkbox",
185
+ id: "match-cyclic"
186
+ },
187
+ id: "match-cyclic",
188
+ checked: this.v3 ? matchCyclic : null,
189
+ domProps: this.v3 ? undefined : {
190
+ "checked": matchCyclic
191
+ },
192
+ onChange: this.onMatchCyclicChecked,
193
+ on: this.v3 ? undefined : {
194
+ "change": this.onMatchCyclicChecked
195
+ }
196
+ }), h("label", {
197
+ "for": "match-cyclic",
198
+ attrs: this.v3 ? undefined : {
199
+ "for": "match-cyclic"
200
+ },
201
+ "class": "k-checkbox-label"
202
+ }, [localization.toLanguageString(findReplaceMatchCyclic, messages[findReplaceMatchCyclic])])]), h("span", [h("input", {
203
+ "class": "k-checkbox",
204
+ type: "checkbox",
205
+ attrs: this.v3 ? undefined : {
206
+ type: "checkbox",
207
+ id: "regular-expression"
208
+ },
209
+ id: "regular-expression",
210
+ checked: this.v3 ? useRegExp : null,
211
+ domProps: this.v3 ? undefined : {
212
+ "checked": useRegExp
213
+ },
214
+ onChange: this.onUseRegExpChecked,
215
+ on: this.v3 ? undefined : {
216
+ "change": this.onUseRegExpChecked
217
+ }
218
+ }), h("label", {
219
+ "for": "regular-expression",
220
+ attrs: this.v3 ? undefined : {
221
+ "for": "regular-expression"
222
+ },
223
+ "class": "k-checkbox-label"
224
+ }, [localization.toLanguageString(findReplaceUseRegExp, messages[findReplaceUseRegExp])])])]);
225
+ var navigation = h("div", {
226
+ "class": "k-matches-container"
227
+ }, [h("button", {
228
+ "class": "k-button k-flat k-primary",
229
+ onClick: this.onFindPrev,
230
+ on: this.v3 ? undefined : {
231
+ "click": this.onFindPrev
232
+ }
233
+ }, [h("span", {
234
+ "class": "k-icon k-i-arrow-chevron-left"
235
+ }), localization.toLanguageString(findReplacePrevMatch, messages[findReplacePrevMatch])]), h("span", [this.matchesMessage(localization.toLanguageString(findReplaceMatches, messages[findReplaceMatches]))]), h("button", {
236
+ "class": "k-button k-flat k-primary",
237
+ onClick: this.onFindNext,
238
+ on: this.v3 ? undefined : {
239
+ "click": this.onFindNext
240
+ }
241
+ }, [localization.toLanguageString(findReplaceNextMatch, messages[findReplaceNextMatch]), h("span", {
242
+ "class": "k-icon k-i-arrow-chevron-right"
243
+ })])]);
244
+ var findWhatLabel = h("div", {
245
+ "class": "k-edit-label"
246
+ }, [h("label", {
247
+ "for": "findWhat",
248
+ attrs: this.v3 ? undefined : {
249
+ "for": "findWhat"
250
+ }
251
+ }, [localization.toLanguageString(findReplaceFindWhat, messages[findReplaceFindWhat])])]);
252
+ var findWhat = h("div", {
253
+ "class": "k-edit-field"
254
+ }, [h("input", {
255
+ id: "findWhat",
256
+ attrs: this.v3 ? undefined : {
257
+ id: "findWhat",
258
+ type: "text",
259
+ autoFocus: true
260
+ },
261
+ type: "text",
262
+ "class": "k-textbox",
263
+ value: this.v3 ? searchText : null,
264
+ domProps: this.v3 ? undefined : {
265
+ "value": searchText
266
+ },
267
+ onInput: this.onSearchChange,
268
+ on: this.v3 ? undefined : {
269
+ "input": this.onSearchChange,
270
+ "focus": this.onSearchChange,
271
+ "keydown": this.onKeyDown
272
+ },
273
+ onFocus: this.onSearchChange,
274
+ onKeydown: this.onKeyDown,
275
+ autoFocus: true
276
+ })]);
277
+ var replaceWithLabel = h("div", {
278
+ "class": "k-edit-label"
279
+ }, [h("label", {
280
+ "for": "replaceWith",
281
+ attrs: this.v3 ? undefined : {
282
+ "for": "replaceWith"
283
+ }
284
+ }, [localization.toLanguageString(findReplaceReplaceWith, messages[findReplaceReplaceWith])])]);
285
+ var replaceWith = h("div", {
286
+ "class": "k-edit-field"
287
+ }, [h("input", {
288
+ id: "replaceWith",
289
+ attrs: this.v3 ? undefined : {
290
+ id: "replaceWith",
291
+ type: "text"
292
+ },
293
+ "class": "k-textbox",
294
+ type: "text",
295
+ value: this.v3 ? replaceText : null,
296
+ domProps: this.v3 ? undefined : {
297
+ "value": replaceText
298
+ },
299
+ onInput: this.onReplaceChange,
300
+ on: this.v3 ? undefined : {
301
+ "input": this.onReplaceChange
302
+ }
303
+ })]);
304
+ return (// @ts-ignore function children
305
+ h(Window, {
306
+ title: localization.toLanguageString(findReplaceDialogTitle, messages[findReplaceDialogTitle]),
307
+ attrs: this.v3 ? undefined : {
308
+ title: localization.toLanguageString(findReplaceDialogTitle, messages[findReplaceDialogTitle]),
309
+ windowStyle: {
310
+ width: 'auto',
311
+ height: 'auto',
312
+ userSelect: 'none'
313
+ },
314
+ resizable: false,
315
+ minimizeButton: function minimizeButton() {
316
+ return null;
317
+ },
318
+ maximizeButton: function maximizeButton() {
319
+ return null;
320
+ }
321
+ },
322
+ onClose: this.onClose,
323
+ on: this.v3 ? undefined : {
324
+ "close": this.onClose
325
+ },
326
+ windowStyle: {
327
+ width: 'auto',
328
+ height: 'auto',
329
+ userSelect: 'none'
330
+ },
331
+ resizable: false,
332
+ minimizeButton: function minimizeButton() {
333
+ return null;
334
+ },
335
+ maximizeButton: function maximizeButton() {
336
+ return null;
337
+ }
338
+ }, this.v3 ? function () {
339
+ return [// @ts-ignore function children
340
+ h(TabStrip, {
341
+ selected: _this.selectedTab,
342
+ attrs: _this.v3 ? undefined : {
343
+ selected: _this.selectedTab,
344
+ animation: false
345
+ },
346
+ "class": "k-editor-find-replace",
347
+ onSelect: _this.onTabSelect,
348
+ on: _this.v3 ? undefined : {
349
+ "select": _this.onTabSelect
350
+ },
351
+ animation: false
352
+ }, _this.v3 ? function () {
353
+ return [// @ts-ignore function children
354
+ h(TabStripTab, {
355
+ title: localization.toLanguageString(findReplaceTabFind, messages[findReplaceTabFind]),
356
+ attrs: _this.v3 ? undefined : {
357
+ title: localization.toLanguageString(findReplaceTabFind, messages[findReplaceTabFind])
358
+ }
359
+ }, _this.v3 ? function () {
360
+ return [h("div", {
361
+ "class": "k-edit-form-container"
362
+ }, [findWhatLabel, findWhat]), checkboxes, navigation];
363
+ } : [h("div", {
364
+ "class": "k-edit-form-container"
365
+ }, [findWhatLabel, findWhat]), checkboxes, navigation]), // @ts-ignore function children
366
+ h(TabStripTab, {
367
+ title: localization.toLanguageString(findReplaceTabReplace, messages[findReplaceTabReplace]),
368
+ attrs: _this.v3 ? undefined : {
369
+ title: localization.toLanguageString(findReplaceTabReplace, messages[findReplaceTabReplace])
370
+ }
371
+ }, _this.v3 ? function () {
372
+ return [h("div", {
373
+ "class": "k-edit-form-container"
374
+ }, [findWhatLabel, findWhat, replaceWithLabel, replaceWith]), h("div", {
375
+ "class": "k-actions k-hstack k-justify-content-end"
376
+ }, [h("button", {
377
+ "class": "k-button",
378
+ disabled: !Boolean(nextMatch),
379
+ attrs: _this.v3 ? undefined : {
380
+ disabled: !Boolean(nextMatch)
381
+ },
382
+ onClick: _this.onReplace,
383
+ on: _this.v3 ? undefined : {
384
+ "click": _this.onReplace
385
+ }
386
+ }, [localization.toLanguageString(findReplaceReplace, messages[findReplaceReplace])]), h("button", {
387
+ "class": "k-button",
388
+ disabled: !Boolean(nextMatch),
389
+ attrs: _this.v3 ? undefined : {
390
+ disabled: !Boolean(nextMatch)
391
+ },
392
+ onClick: _this.onReplaceAll,
393
+ on: _this.v3 ? undefined : {
394
+ "click": _this.onReplaceAll
395
+ }
396
+ }, [localization.toLanguageString(findReplaceReplaceAll, messages[findReplaceReplaceAll])])]), checkboxes, navigation];
397
+ } : [h("div", {
398
+ "class": "k-edit-form-container"
399
+ }, [findWhatLabel, findWhat, replaceWithLabel, replaceWith]), h("div", {
400
+ "class": "k-actions k-hstack k-justify-content-end"
401
+ }, [h("button", {
402
+ "class": "k-button",
403
+ disabled: !Boolean(nextMatch),
404
+ attrs: _this.v3 ? undefined : {
405
+ disabled: !Boolean(nextMatch)
406
+ },
407
+ onClick: _this.onReplace,
408
+ on: _this.v3 ? undefined : {
409
+ "click": _this.onReplace
410
+ }
411
+ }, [localization.toLanguageString(findReplaceReplace, messages[findReplaceReplace])]), h("button", {
412
+ "class": "k-button",
413
+ disabled: !Boolean(nextMatch),
414
+ attrs: _this.v3 ? undefined : {
415
+ disabled: !Boolean(nextMatch)
416
+ },
417
+ onClick: _this.onReplaceAll,
418
+ on: _this.v3 ? undefined : {
419
+ "click": _this.onReplaceAll
420
+ }
421
+ }, [localization.toLanguageString(findReplaceReplaceAll, messages[findReplaceReplaceAll])])]), checkboxes, navigation])];
422
+ } : [h(TabStripTab, {
423
+ title: localization.toLanguageString(findReplaceTabFind, messages[findReplaceTabFind]),
424
+ attrs: _this.v3 ? undefined : {
425
+ title: localization.toLanguageString(findReplaceTabFind, messages[findReplaceTabFind])
426
+ }
427
+ }, _this.v3 ? function () {
428
+ return [h("div", {
429
+ "class": "k-edit-form-container"
430
+ }, [findWhatLabel, findWhat]), checkboxes, navigation];
431
+ } : [h("div", {
432
+ "class": "k-edit-form-container"
433
+ }, [findWhatLabel, findWhat]), checkboxes, navigation]), h(TabStripTab, {
434
+ title: localization.toLanguageString(findReplaceTabReplace, messages[findReplaceTabReplace]),
435
+ attrs: _this.v3 ? undefined : {
436
+ title: localization.toLanguageString(findReplaceTabReplace, messages[findReplaceTabReplace])
437
+ }
438
+ }, _this.v3 ? function () {
439
+ return [h("div", {
440
+ "class": "k-edit-form-container"
441
+ }, [findWhatLabel, findWhat, replaceWithLabel, replaceWith]), h("div", {
442
+ "class": "k-actions k-hstack k-justify-content-end"
443
+ }, [h("button", {
444
+ "class": "k-button",
445
+ disabled: !Boolean(nextMatch),
446
+ attrs: _this.v3 ? undefined : {
447
+ disabled: !Boolean(nextMatch)
448
+ },
449
+ onClick: _this.onReplace,
450
+ on: _this.v3 ? undefined : {
451
+ "click": _this.onReplace
452
+ }
453
+ }, [localization.toLanguageString(findReplaceReplace, messages[findReplaceReplace])]), h("button", {
454
+ "class": "k-button",
455
+ disabled: !Boolean(nextMatch),
456
+ attrs: _this.v3 ? undefined : {
457
+ disabled: !Boolean(nextMatch)
458
+ },
459
+ onClick: _this.onReplaceAll,
460
+ on: _this.v3 ? undefined : {
461
+ "click": _this.onReplaceAll
462
+ }
463
+ }, [localization.toLanguageString(findReplaceReplaceAll, messages[findReplaceReplaceAll])])]), checkboxes, navigation];
464
+ } : [h("div", {
465
+ "class": "k-edit-form-container"
466
+ }, [findWhatLabel, findWhat, replaceWithLabel, replaceWith]), h("div", {
467
+ "class": "k-actions k-hstack k-justify-content-end"
468
+ }, [h("button", {
469
+ "class": "k-button",
470
+ disabled: !Boolean(nextMatch),
471
+ attrs: _this.v3 ? undefined : {
472
+ disabled: !Boolean(nextMatch)
473
+ },
474
+ onClick: _this.onReplace,
475
+ on: _this.v3 ? undefined : {
476
+ "click": _this.onReplace
477
+ }
478
+ }, [localization.toLanguageString(findReplaceReplace, messages[findReplaceReplace])]), h("button", {
479
+ "class": "k-button",
480
+ disabled: !Boolean(nextMatch),
481
+ attrs: _this.v3 ? undefined : {
482
+ disabled: !Boolean(nextMatch)
483
+ },
484
+ onClick: _this.onReplaceAll,
485
+ on: _this.v3 ? undefined : {
486
+ "click": _this.onReplaceAll
487
+ }
488
+ }, [localization.toLanguageString(findReplaceReplaceAll, messages[findReplaceReplaceAll])])]), checkboxes, navigation])])];
489
+ } : [h(TabStrip, {
490
+ selected: _this.selectedTab,
491
+ attrs: _this.v3 ? undefined : {
492
+ selected: _this.selectedTab,
493
+ animation: false
494
+ },
495
+ "class": "k-editor-find-replace",
496
+ onSelect: _this.onTabSelect,
497
+ on: _this.v3 ? undefined : {
498
+ "select": _this.onTabSelect
499
+ },
500
+ animation: false
501
+ }, _this.v3 ? function () {
502
+ return [h(TabStripTab, {
503
+ title: localization.toLanguageString(findReplaceTabFind, messages[findReplaceTabFind]),
504
+ attrs: _this.v3 ? undefined : {
505
+ title: localization.toLanguageString(findReplaceTabFind, messages[findReplaceTabFind])
506
+ }
507
+ }, _this.v3 ? function () {
508
+ return [h("div", {
509
+ "class": "k-edit-form-container"
510
+ }, [findWhatLabel, findWhat]), checkboxes, navigation];
511
+ } : [h("div", {
512
+ "class": "k-edit-form-container"
513
+ }, [findWhatLabel, findWhat]), checkboxes, navigation]), h(TabStripTab, {
514
+ title: localization.toLanguageString(findReplaceTabReplace, messages[findReplaceTabReplace]),
515
+ attrs: _this.v3 ? undefined : {
516
+ title: localization.toLanguageString(findReplaceTabReplace, messages[findReplaceTabReplace])
517
+ }
518
+ }, _this.v3 ? function () {
519
+ return [h("div", {
520
+ "class": "k-edit-form-container"
521
+ }, [findWhatLabel, findWhat, replaceWithLabel, replaceWith]), h("div", {
522
+ "class": "k-actions k-hstack k-justify-content-end"
523
+ }, [h("button", {
524
+ "class": "k-button",
525
+ disabled: !Boolean(nextMatch),
526
+ attrs: _this.v3 ? undefined : {
527
+ disabled: !Boolean(nextMatch)
528
+ },
529
+ onClick: _this.onReplace,
530
+ on: _this.v3 ? undefined : {
531
+ "click": _this.onReplace
532
+ }
533
+ }, [localization.toLanguageString(findReplaceReplace, messages[findReplaceReplace])]), h("button", {
534
+ "class": "k-button",
535
+ disabled: !Boolean(nextMatch),
536
+ attrs: _this.v3 ? undefined : {
537
+ disabled: !Boolean(nextMatch)
538
+ },
539
+ onClick: _this.onReplaceAll,
540
+ on: _this.v3 ? undefined : {
541
+ "click": _this.onReplaceAll
542
+ }
543
+ }, [localization.toLanguageString(findReplaceReplaceAll, messages[findReplaceReplaceAll])])]), checkboxes, navigation];
544
+ } : [h("div", {
545
+ "class": "k-edit-form-container"
546
+ }, [findWhatLabel, findWhat, replaceWithLabel, replaceWith]), h("div", {
547
+ "class": "k-actions k-hstack k-justify-content-end"
548
+ }, [h("button", {
549
+ "class": "k-button",
550
+ disabled: !Boolean(nextMatch),
551
+ attrs: _this.v3 ? undefined : {
552
+ disabled: !Boolean(nextMatch)
553
+ },
554
+ onClick: _this.onReplace,
555
+ on: _this.v3 ? undefined : {
556
+ "click": _this.onReplace
557
+ }
558
+ }, [localization.toLanguageString(findReplaceReplace, messages[findReplaceReplace])]), h("button", {
559
+ "class": "k-button",
560
+ disabled: !Boolean(nextMatch),
561
+ attrs: _this.v3 ? undefined : {
562
+ disabled: !Boolean(nextMatch)
563
+ },
564
+ onClick: _this.onReplaceAll,
565
+ on: _this.v3 ? undefined : {
566
+ "click": _this.onReplaceAll
567
+ }
568
+ }, [localization.toLanguageString(findReplaceReplaceAll, messages[findReplaceReplaceAll])])]), checkboxes, navigation])];
569
+ } : [h(TabStripTab, {
570
+ title: localization.toLanguageString(findReplaceTabFind, messages[findReplaceTabFind]),
571
+ attrs: _this.v3 ? undefined : {
572
+ title: localization.toLanguageString(findReplaceTabFind, messages[findReplaceTabFind])
573
+ }
574
+ }, _this.v3 ? function () {
575
+ return [h("div", {
576
+ "class": "k-edit-form-container"
577
+ }, [findWhatLabel, findWhat]), checkboxes, navigation];
578
+ } : [h("div", {
579
+ "class": "k-edit-form-container"
580
+ }, [findWhatLabel, findWhat]), checkboxes, navigation]), h(TabStripTab, {
581
+ title: localization.toLanguageString(findReplaceTabReplace, messages[findReplaceTabReplace]),
582
+ attrs: _this.v3 ? undefined : {
583
+ title: localization.toLanguageString(findReplaceTabReplace, messages[findReplaceTabReplace])
584
+ }
585
+ }, _this.v3 ? function () {
586
+ return [h("div", {
587
+ "class": "k-edit-form-container"
588
+ }, [findWhatLabel, findWhat, replaceWithLabel, replaceWith]), h("div", {
589
+ "class": "k-actions k-hstack k-justify-content-end"
590
+ }, [h("button", {
591
+ "class": "k-button",
592
+ disabled: !Boolean(nextMatch),
593
+ attrs: _this.v3 ? undefined : {
594
+ disabled: !Boolean(nextMatch)
595
+ },
596
+ onClick: _this.onReplace,
597
+ on: _this.v3 ? undefined : {
598
+ "click": _this.onReplace
599
+ }
600
+ }, [localization.toLanguageString(findReplaceReplace, messages[findReplaceReplace])]), h("button", {
601
+ "class": "k-button",
602
+ disabled: !Boolean(nextMatch),
603
+ attrs: _this.v3 ? undefined : {
604
+ disabled: !Boolean(nextMatch)
605
+ },
606
+ onClick: _this.onReplaceAll,
607
+ on: _this.v3 ? undefined : {
608
+ "click": _this.onReplaceAll
609
+ }
610
+ }, [localization.toLanguageString(findReplaceReplaceAll, messages[findReplaceReplaceAll])])]), checkboxes, navigation];
611
+ } : [h("div", {
612
+ "class": "k-edit-form-container"
613
+ }, [findWhatLabel, findWhat, replaceWithLabel, replaceWith]), h("div", {
614
+ "class": "k-actions k-hstack k-justify-content-end"
615
+ }, [h("button", {
616
+ "class": "k-button",
617
+ disabled: !Boolean(nextMatch),
618
+ attrs: _this.v3 ? undefined : {
619
+ disabled: !Boolean(nextMatch)
620
+ },
621
+ onClick: _this.onReplace,
622
+ on: _this.v3 ? undefined : {
623
+ "click": _this.onReplace
624
+ }
625
+ }, [localization.toLanguageString(findReplaceReplace, messages[findReplaceReplace])]), h("button", {
626
+ "class": "k-button",
627
+ disabled: !Boolean(nextMatch),
628
+ attrs: _this.v3 ? undefined : {
629
+ disabled: !Boolean(nextMatch)
630
+ },
631
+ onClick: _this.onReplaceAll,
632
+ on: _this.v3 ? undefined : {
633
+ "click": _this.onReplaceAll
634
+ }
635
+ }, [localization.toLanguageString(findReplaceReplaceAll, messages[findReplaceReplaceAll])])]), checkboxes, navigation])])])
636
+ ); // document.body);
637
+ },
638
+ methods: {
639
+ onTabSelect: function onTabSelect(event) {
640
+ this.selectedTab = event.selected;
641
+ },
642
+ onClose: function onClose() {
643
+ var view = this.$props.view;
644
+ var state = view.state;
645
+ var transaction = state.tr.setSelection(TextSelection.create(state.doc, state.selection.from, state.selection.to));
646
+ view.updateState(state.apply(transaction));
647
+ view.focus();
648
+ this.$emit('close');
649
+ },
650
+ matchesMessage: function matchesMessage(locMessage) {
651
+ var matches = this.matches;
652
+ var nextMatch = this.nextMatch;
653
+ var cur = 0,
654
+ all = 0;
655
+
656
+ if (matches && nextMatch) {
657
+ var current = matches.findIndex(function (s) {
658
+ return s.eq(nextMatch);
659
+ });
660
+ cur = current === -1 ? matches.length : current + 1;
661
+ all = matches.length;
662
+ }
663
+
664
+ return formatString(locMessage, cur, all);
665
+ },
666
+ onFindNext: function onFindNext() {
667
+ this.onFind();
668
+ },
669
+ onFindPrev: function onFindPrev() {
670
+ this.onFind(true);
671
+ },
672
+ onFind: function onFind(backward) {
673
+ if (backward === void 0) {
674
+ backward = false;
675
+ }
676
+
677
+ var view = this.$props.view;
678
+ var _a = this.$data,
679
+ text = _a.searchText,
680
+ matchCase = _a.matchCase,
681
+ matchCyclic = _a.matchCyclic,
682
+ matchWord = _a.matchWord,
683
+ useRegExp = _a.useRegExp;
684
+ var searchOptions = {
685
+ text: text,
686
+ matchWord: matchWord,
687
+ matchCase: matchCase,
688
+ useRegExp: useRegExp,
689
+ backward: backward,
690
+ matchCyclic: matchCyclic
691
+ };
692
+ var selectionResult = find(view.state, searchOptions);
693
+
694
+ if (selectionResult) {
695
+ var transaction = view.state.tr.setSelection(selectionResult);
696
+ transaction.scrollIntoView();
697
+ view.updateState(view.state.apply(transaction));
698
+ this.nextMatch = selectionResult;
699
+ }
700
+ },
701
+ onReplace: function onReplace() {
702
+ var view = this.$props.view;
703
+ var selection = view.state.selection;
704
+ var replaceText = this.$data.replaceText;
705
+
706
+ if (!selection.empty) {
707
+ var start = selection.from;
708
+ var end = start + replaceText.length;
709
+ var transaction = replace(selection, replaceText, view.state.tr);
710
+ transaction.setSelection(TextSelection.create(transaction.doc, start, end));
711
+ transaction.scrollIntoView();
712
+ view.dispatch(transaction);
713
+ this.setNextState({});
714
+ }
715
+ },
716
+ onReplaceAll: function onReplaceAll() {
717
+ var view = this.$props.view;
718
+ var _a = this.$data,
719
+ searchText = _a.searchText,
720
+ replaceText = _a.replaceText,
721
+ matchCase = _a.matchCase,
722
+ matchWord = _a.matchWord,
723
+ useRegExp = _a.useRegExp;
724
+ var searchOptions = {
725
+ text: searchText,
726
+ matchWord: matchWord,
727
+ matchCase: matchCase,
728
+ useRegExp: useRegExp
729
+ };
730
+ view.dispatch(replaceAll(view.state, replaceText, searchOptions));
731
+ this.setNextState({});
732
+ },
733
+ onKeyDown: function onKeyDown(event) {
734
+ if (event.keyCode === enter) {
735
+ this.onFindNext();
736
+ } else if (event.keyCode === esc) {
737
+ this.onClose();
738
+ }
739
+ },
740
+ onMatchCaseChecked: function onMatchCaseChecked(e) {
741
+ this.matchCase = e.target.checked;
742
+ this.setNextState();
743
+ },
744
+ onMatchWordChecked: function onMatchWordChecked(e) {
745
+ this.matchWord = e.target.checked;
746
+ this.setNextState();
747
+ },
748
+ onMatchCyclicChecked: function onMatchCyclicChecked(e) {
749
+ this.matchCyclic = e.target.checked;
750
+ this.setNextState();
751
+ },
752
+ onUseRegExpChecked: function onUseRegExpChecked(e) {
753
+ this.useRegExp = e.target.checked;
754
+ this.setNextState();
755
+ },
756
+ onSearchChange: function onSearchChange(e) {
757
+ this.searchText = e.target.value;
758
+ this.setNextState();
759
+ },
760
+ onReplaceChange: function onReplaceChange(e) {
761
+ this.replaceText = e.target.value;
762
+ this.setNextState();
763
+ },
764
+ setNextState: function setNextState() {
765
+ var view = this.$props.view;
766
+
767
+ if (this.searchText) {
768
+ var searchOptions = {
769
+ text: this.searchText,
770
+ matchWord: this.matchWord,
771
+ matchCase: this.matchCase,
772
+ useRegExp: this.useRegExp
773
+ };
774
+ var selection_1 = view.state.selection;
775
+ var matches = findAll(view.state.doc, searchOptions);
776
+ var nextMatch = !this.searchText && matches[0] || matches.find(function (match) {
777
+ return match.from >= selection_1.from;
778
+ }) || this.matchCyclic && matches[0] || undefined;
779
+ this.matches = matches;
780
+ this.nextMatch = nextMatch;
781
+ } else {
782
+ this.matches = undefined;
783
+ this.nextMatch = undefined;
784
+ }
785
+ }
786
+ }
787
+ };
788
+ var FindAndReplaceDialogVue3 = FindAndReplaceDialog;
789
+ export { FindAndReplaceDialog, FindAndReplaceDialogVue3 };