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