@progress/kendo-vue-editor 2.7.1-dev.202112201220 → 2.7.2

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