qms-angular 1.0.86 → 1.0.89

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 (289) hide show
  1. package/README.md +5 -1
  2. package/bundles/qms-angular.umd.js +6943 -219
  3. package/bundles/qms-angular.umd.js.map +1 -1
  4. package/esm2015/lib/components/badges/qms-badges.component.js +1 -1
  5. package/esm2015/lib/components/banner/qms-banner/qms-banner.component.js +1 -1
  6. package/esm2015/lib/components/banner/qms-banner-confirm/qms-banner-confirm.component.js +1 -1
  7. package/esm2015/lib/components/banner/qms-banner-loading/qms-banner-loading.component.js +1 -1
  8. package/esm2015/lib/components/button/button-toggle.js +1 -1
  9. package/esm2015/lib/components/button/button.js +3 -3
  10. package/esm2015/lib/components/comment/comment.js +6 -3
  11. package/esm2015/lib/components/dialog/dialog.js +2 -2
  12. package/esm2015/lib/components/list/list.js +2 -2
  13. package/esm2015/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.js +3 -3
  14. package/esm2015/lib/components/qms-paginator/qms-paginator.component.js +16 -7
  15. package/esm2015/lib/components/related/content/related-content.component.js +2 -2
  16. package/esm2015/lib/components/related/list-other-related/list-related.component.js +1 -1
  17. package/esm2015/lib/components/related/risk/list/list.component.js +1 -1
  18. package/esm2015/lib/components/related/risk/result/result.component.js +1 -1
  19. package/esm2015/lib/components/rich-text/rich-text.js +1 -1
  20. package/esm2015/lib/components/table/table-action.js +2 -2
  21. package/esm2015/lib/components/table/table.module.js +4 -4
  22. package/esm2015/lib/components/tooltip/tooltip.js +1 -1
  23. package/esm2015/lib/components/tree/tree.component.js +1 -1
  24. package/esm2015/lib/components/treeNew/tree.component.js +18 -2
  25. package/esm2015/lib/directives/file-upload/file-upload-multiple-selector.directive.js +3 -1
  26. package/esm2015/lib/directives/file-upload/file-upload-selector.directive.js +3 -1
  27. package/esm2015/lib/directives/file-upload/file-upload.directive.js +1 -1
  28. package/esm2015/lib/directives/text-truncate/text-truncate.directive.js +58 -0
  29. package/esm2015/lib/model/en.js +63 -2
  30. package/esm2015/lib/model/no.js +63 -2
  31. package/esm2015/lib/qms-angular.module.js +4 -1
  32. package/esm2015/lib/qms-ckeditor-components/common/flowchart/config/halo.function.js +87 -0
  33. package/esm2015/lib/qms-ckeditor-components/common/flowchart/config/inspector.function.js +3767 -0
  34. package/esm2015/lib/qms-ckeditor-components/common/flowchart/config/selection.function.js +56 -0
  35. package/esm2015/lib/qms-ckeditor-components/common/flowchart/config/stencil.function.js +1003 -0
  36. package/esm2015/lib/qms-ckeditor-components/common/flowchart/config/toolbar.function.js +302 -0
  37. package/esm2015/lib/qms-ckeditor-components/common/flowchart/models/app-shapes.js +320 -0
  38. package/esm2015/lib/qms-ckeditor-components/common/flowchart/service/keyboard-service.js +69 -0
  39. package/esm2015/lib/qms-ckeditor-components/common/flowchart/service/kitchensink-service.js +412 -0
  40. package/esm2015/lib/qms-ckeditor-components/common/flowchart/themes/theme-picker.js +80 -0
  41. package/esm2015/lib/qms-ckeditor-components/common/functions/common.function.js +34 -1
  42. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-save-as-template.model.js +1 -1
  43. package/esm2015/lib/qms-ckeditor-components/common/module/confirm/qms-ckeditor-confirm.component.js +3 -3
  44. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.js +1 -1
  45. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/qms-ckeditor-bpmn.component.js +2 -2
  46. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/save-template/save-template.component.js +2 -2
  47. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-flowchart/qms-ckeditor-flowchart.component.js +317 -0
  48. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.js +3 -3
  49. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/attachments/link-attachment.component.js +3 -3
  50. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +3 -3
  51. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.js +3 -3
  52. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.js +3 -3
  53. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.js +3 -3
  54. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +3 -3
  55. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +35 -3
  56. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.module.js +4 -2
  57. package/esm2015/public-api.js +8 -1
  58. package/esm2015/qms-angular.js +2 -1
  59. package/fesm2015/qms-angular.js +6882 -213
  60. package/fesm2015/qms-angular.js.map +1 -1
  61. package/lib/components/comment/comment.d.ts +1 -0
  62. package/lib/components/qms-paginator/qms-paginator.component.d.ts +1 -0
  63. package/lib/components/treeNew/tree.component.d.ts +1 -0
  64. package/lib/directives/text-truncate/text-truncate.directive.d.ts +15 -0
  65. package/lib/model/en.d.ts +61 -0
  66. package/lib/model/no.d.ts +61 -0
  67. package/lib/qms-ckeditor-components/common/flowchart/config/halo.function.d.ts +37 -0
  68. package/lib/qms-ckeditor-components/common/flowchart/config/inspector.function.d.ts +7 -0
  69. package/lib/qms-ckeditor-components/common/flowchart/config/selection.function.d.ts +39 -0
  70. package/lib/qms-ckeditor-components/common/flowchart/config/stencil.function.d.ts +11 -0
  71. package/lib/qms-ckeditor-components/common/flowchart/config/toolbar.function.d.ts +224 -0
  72. package/lib/qms-ckeditor-components/common/flowchart/models/app-shapes.d.ts +58 -0
  73. package/lib/qms-ckeditor-components/common/flowchart/service/keyboard-service.d.ts +16 -0
  74. package/lib/qms-ckeditor-components/common/flowchart/service/kitchensink-service.d.ts +56 -0
  75. package/lib/qms-ckeditor-components/common/flowchart/themes/theme-picker.d.ts +35 -0
  76. package/lib/qms-ckeditor-components/common/functions/common.function.d.ts +12 -0
  77. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-save-as-template.model.d.ts +2 -0
  78. package/lib/qms-ckeditor-components/components/qms-ckeditor-flowchart/qms-ckeditor-flowchart.component.d.ts +41 -0
  79. package/lib/qms-ckeditor-components/qms-ckeditor.component.d.ts +4 -0
  80. package/lib.theme.scss +179 -0
  81. package/package.json +1 -1
  82. package/public-api.d.ts +7 -0
  83. package/qms-angular.d.ts +1 -0
  84. package/qms-angular.metadata.json +1 -1
  85. package/src/assets/fonts/Material/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2 +0 -0
  86. package/src/assets/fonts/Material/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUce.woff2 +0 -0
  87. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFUZ0bbck.woff2 +0 -0
  88. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFVZ0b.woff2 +0 -0
  89. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFVp0bbck.woff2 +0 -0
  90. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFW50bbck.woff2 +0 -0
  91. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFWJ0bbck.woff2 +0 -0
  92. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFWZ0bbck.woff2 +0 -0
  93. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFWp0bbck.woff2 +0 -0
  94. package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCFPrEHJA.woff2 +0 -0
  95. package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCGPrEHJA.woff2 +0 -0
  96. package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCHPrEHJA.woff2 +0 -0
  97. package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrE.woff2 +0 -0
  98. package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCMPrEHJA.woff2 +0 -0
  99. package/src/assets/jointjs/images/delete-icon-modern.png +0 -0
  100. package/src/assets/jointjs/images/reset-icon-modern.png +0 -0
  101. package/src/assets/jointjs/images/save-icon-modern.png +0 -0
  102. package/src/assets/jointjs/images/to-front-icon-modern.png +0 -0
  103. package/src/assets/jointjs/images/toback-icon-modern.png +0 -0
  104. package/src/assets/jointjs/images/toolbar-icons-material.png +0 -0
  105. package/src/assets/jointjs/images/toolbar-icons-modern.png +0 -0
  106. package/src/assets/jointjs/scss/rappid.scss +326 -0
  107. package/src/assets/jointjs/scss/theme-picker.scss +22 -0
  108. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
  109. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
  110. package/src/assets/qms-ckeditor-plugin/build/translations/ar.js +1 -1
  111. package/src/assets/qms-ckeditor-plugin/build/translations/az.js +1 -1
  112. package/src/assets/qms-ckeditor-plugin/build/translations/bg.js +1 -1
  113. package/src/assets/qms-ckeditor-plugin/build/translations/ca.js +1 -1
  114. package/src/assets/qms-ckeditor-plugin/build/translations/cs.js +1 -1
  115. package/src/assets/qms-ckeditor-plugin/build/translations/da.js +1 -1
  116. package/src/assets/qms-ckeditor-plugin/build/translations/de-ch.js +1 -1
  117. package/src/assets/qms-ckeditor-plugin/build/translations/de.js +1 -1
  118. package/src/assets/qms-ckeditor-plugin/build/translations/el.js +1 -1
  119. package/src/assets/qms-ckeditor-plugin/build/translations/en-au.js +1 -1
  120. package/src/assets/qms-ckeditor-plugin/build/translations/en-gb.js +1 -1
  121. package/src/assets/qms-ckeditor-plugin/build/translations/eo.js +1 -1
  122. package/src/assets/qms-ckeditor-plugin/build/translations/es.js +1 -1
  123. package/src/assets/qms-ckeditor-plugin/build/translations/et.js +1 -1
  124. package/src/assets/qms-ckeditor-plugin/build/translations/eu.js +1 -1
  125. package/src/assets/qms-ckeditor-plugin/build/translations/fa.js +1 -1
  126. package/src/assets/qms-ckeditor-plugin/build/translations/fi.js +1 -1
  127. package/src/assets/qms-ckeditor-plugin/build/translations/fr.js +1 -1
  128. package/src/assets/qms-ckeditor-plugin/build/translations/gl.js +1 -1
  129. package/src/assets/qms-ckeditor-plugin/build/translations/he.js +1 -1
  130. package/src/assets/qms-ckeditor-plugin/build/translations/hi.js +1 -1
  131. package/src/assets/qms-ckeditor-plugin/build/translations/hr.js +1 -1
  132. package/src/assets/qms-ckeditor-plugin/build/translations/hu.js +1 -1
  133. package/src/assets/qms-ckeditor-plugin/build/translations/id.js +1 -1
  134. package/src/assets/qms-ckeditor-plugin/build/translations/it.js +1 -1
  135. package/src/assets/qms-ckeditor-plugin/build/translations/ja.js +1 -1
  136. package/src/assets/qms-ckeditor-plugin/build/translations/km.js +1 -1
  137. package/src/assets/qms-ckeditor-plugin/build/translations/kn.js +1 -1
  138. package/src/assets/qms-ckeditor-plugin/build/translations/ko.js +1 -1
  139. package/src/assets/qms-ckeditor-plugin/build/translations/ku.js +1 -1
  140. package/src/assets/qms-ckeditor-plugin/build/translations/lt.js +1 -1
  141. package/src/assets/qms-ckeditor-plugin/build/translations/lv.js +1 -1
  142. package/src/assets/qms-ckeditor-plugin/build/translations/nb.js +1 -1
  143. package/src/assets/qms-ckeditor-plugin/build/translations/ne.js +1 -1
  144. package/src/assets/qms-ckeditor-plugin/build/translations/nl.js +1 -1
  145. package/src/assets/qms-ckeditor-plugin/build/translations/no.js +1 -1
  146. package/src/assets/qms-ckeditor-plugin/build/translations/pl.js +1 -1
  147. package/src/assets/qms-ckeditor-plugin/build/translations/pt-br.js +1 -1
  148. package/src/assets/qms-ckeditor-plugin/build/translations/pt.js +1 -1
  149. package/src/assets/qms-ckeditor-plugin/build/translations/ro.js +1 -1
  150. package/src/assets/qms-ckeditor-plugin/build/translations/ru.js +1 -1
  151. package/src/assets/qms-ckeditor-plugin/build/translations/sk.js +1 -1
  152. package/src/assets/qms-ckeditor-plugin/build/translations/sl.js +1 -1
  153. package/src/assets/qms-ckeditor-plugin/build/translations/sq.js +1 -1
  154. package/src/assets/qms-ckeditor-plugin/build/translations/sr-latn.js +1 -1
  155. package/src/assets/qms-ckeditor-plugin/build/translations/sr.js +1 -1
  156. package/src/assets/qms-ckeditor-plugin/build/translations/sv.js +1 -1
  157. package/src/assets/qms-ckeditor-plugin/build/translations/th.js +1 -1
  158. package/src/assets/qms-ckeditor-plugin/build/translations/tk.js +1 -1
  159. package/src/assets/qms-ckeditor-plugin/build/translations/tr.js +1 -1
  160. package/src/assets/qms-ckeditor-plugin/build/translations/ug.js +1 -1
  161. package/src/assets/qms-ckeditor-plugin/build/translations/uk.js +1 -1
  162. package/src/assets/qms-ckeditor-plugin/build/translations/vi.js +1 -1
  163. package/src/assets/qms-ckeditor-plugin/build/translations/zh-cn.js +1 -1
  164. package/src/assets/qms-ckeditor-plugin/build/translations/zh.js +1 -1
  165. package/src/assets/qms-ckeditor-plugin/package-lock.json +12632 -345
  166. package/src/assets/qms-ckeditor-plugin/package.json +0 -2
  167. package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +8 -8
  168. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorService.js +9 -0
  169. package/src/assets/qms-ckeditor-plugin/src/plugins/flowchart/flowchartdialogcommand.js +47 -0
  170. package/src/assets/qms-ckeditor-plugin/src/plugins/flowchart/qmsCKEditorFlowchartPlugin.js +30 -0
  171. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/heading.js +119 -0
  172. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingbuttonsui.js +103 -0
  173. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingcommand.js +96 -0
  174. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingediting.js +163 -0
  175. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingui.js +115 -0
  176. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/index.js +22 -0
  177. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/heading.css +35 -0
  178. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading1.svg +1 -0
  179. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading2.svg +1 -0
  180. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading3.svg +1 -0
  181. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading4.svg +1 -0
  182. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading5.svg +1 -0
  183. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading6.svg +1 -0
  184. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/title.js +598 -0
  185. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/utils.js +42 -0
  186. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/insertcolumncommand.js +83 -0
  187. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/insertrowcommand.js +82 -0
  188. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/inserttablecommand.js +76 -0
  189. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/mergecellcommand.js +272 -0
  190. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/mergecellscommand.js +122 -0
  191. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/removecolumncommand.js +122 -0
  192. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/removerowcommand.js +97 -0
  193. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/selectcolumncommand.js +63 -0
  194. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/selectrowcommand.js +56 -0
  195. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/setheadercolumncommand.js +95 -0
  196. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/setheaderrowcommand.js +105 -0
  197. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/splitcellcommand.js +68 -0
  198. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/downcast.js +529 -0
  199. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-cell-paragraph-post-fixer.js +136 -0
  200. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-cell-refresh-post-fixer.js +75 -0
  201. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-heading-rows-refresh-post-fixer.js +55 -0
  202. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-layout-post-fixer.js +399 -0
  203. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/tableproperties.js +126 -0
  204. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/upcasttable.js +211 -0
  205. package/src/assets/qms-ckeditor-plugin/src/plugins/table/index.js +42 -0
  206. package/src/assets/qms-ckeditor-plugin/src/plugins/table/table.js +103 -0
  207. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +35 -0
  208. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellbordercolorcommand.js +47 -0
  209. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellborderstylecommand.js +47 -0
  210. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellborderwidthcommand.js +62 -0
  211. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellheightcommand.js +51 -0
  212. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +35 -0
  213. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellpaddingcommand.js +62 -0
  214. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellpropertycommand.js +110 -0
  215. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellverticalalignmentcommand.js +43 -0
  216. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellwidthcommand.js +51 -0
  217. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/tablecellpropertiesediting.js +204 -0
  218. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/tablecellpropertiesui.js +401 -0
  219. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/ui/tablecellpropertiesview.js +829 -0
  220. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties.js +80 -0
  221. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableclipboard.js +586 -0
  222. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableediting.js +160 -0
  223. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablekeyboard.js +343 -0
  224. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablemouse/mouseeventsobserver.js +72 -0
  225. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablemouse.js +218 -0
  226. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablealignmentcommand.js +35 -0
  227. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablebackgroundcolorcommand.js +35 -0
  228. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablebordercolorcommand.js +47 -0
  229. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tableborderstylecommand.js +47 -0
  230. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tableborderwidthcommand.js +62 -0
  231. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tableheightcommand.js +51 -0
  232. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablepropertycommand.js +98 -0
  233. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablewidthcommand.js +51 -0
  234. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/tablepropertiesediting.js +182 -0
  235. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/tablepropertiesui.js +397 -0
  236. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/ui/tablepropertiesview.js +714 -0
  237. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties.js +81 -0
  238. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableselection.js +357 -0
  239. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tabletoolbar.js +111 -0
  240. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableui.js +359 -0
  241. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableutils.js +909 -0
  242. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablewalker.js +538 -0
  243. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/colorinput.css +39 -0
  244. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/form.css +11 -0
  245. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/formrow.css +23 -0
  246. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-cell-properties.svg +1 -0
  247. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-column.svg +1 -0
  248. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-merge-cell.svg +1 -0
  249. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-properties.svg +1 -0
  250. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-row.svg +1 -0
  251. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table.svg +1 -0
  252. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/inserttable.css +10 -0
  253. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/snippet.css +3876 -0
  254. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/table.css +67 -0
  255. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tablecaption.css +53 -0
  256. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tablecellproperties.css +28 -0
  257. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableediting.css +10 -0
  258. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableform.css +59 -0
  259. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableproperties.css +18 -0
  260. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableselection.css +10 -0
  261. package/src/assets/qms-ckeditor-plugin/src/plugins/table/ui/colorinputview.js +343 -0
  262. package/src/assets/qms-ckeditor-plugin/src/plugins/table/ui/formrowview.js +103 -0
  263. package/src/assets/qms-ckeditor-plugin/src/plugins/table/ui/inserttableview.js +222 -0
  264. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/common.js +57 -0
  265. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/selection.js +276 -0
  266. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/structure.js +543 -0
  267. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/table-properties.js +66 -0
  268. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/ui/contextualballoon.js +130 -0
  269. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/ui/table-properties.js +397 -0
  270. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/ui/widget.js +62 -0
  271. package/src/assets/qms-ckeditor-plugin/src/themes/icons/flowchart.svg +507 -0
  272. package/src/lib/components/comment/comment.scss +1 -0
  273. package/src/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.scss +1 -0
  274. package/src/lib/components/qms-paginator/qms-paginator.component.scss +4 -1
  275. package/src/lib/qms-ckeditor-components/common/flowchart/assets/image-icon1.svg +1 -0
  276. package/src/lib/qms-ckeditor-components/common/flowchart/assets/image-icon2.svg +6 -0
  277. package/src/lib/qms-ckeditor-components/common/flowchart/assets/image-icon3.svg +11 -0
  278. package/src/lib/qms-ckeditor-components/common/flowchart/assets/image-icon4.svg +8 -0
  279. package/src/lib/qms-ckeditor-components/common/flowchart/assets/member-female.png +0 -0
  280. package/src/lib/qms-ckeditor-components/common/flowchart/assets/member-male.png +0 -0
  281. package/src/lib/qms-ckeditor-components/common/flowchart/assets/no-color-icon.svg +72 -0
  282. package/src/lib/qms-ckeditor-components/common/flowchart/assets/toolbar-icons-material.png +0 -0
  283. package/src/lib/qms-ckeditor-components/common/flowchart/assets/toolbar-icons-modern.png +0 -0
  284. package/src/lib/qms-ckeditor-components/common/flowchart/assets/transparent-icon.svg +50 -0
  285. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-flowchart/qms-ckeditor-flowchart.component.scss +68 -0
  286. package/src/lib/qms-ckeditor-components/styles/_modules.scss +9 -0
  287. package/src/themes/core/_mat-icon.scss +60 -60
  288. package/src/themes/core/_table.scss +72 -4
  289. package/src/themes/core/_typography.scss +108 -108
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @module table/commands/insertcolumncommand
8
+ */
9
+
10
+ import { Command } from 'ckeditor5/src/core';
11
+ import { getColumnIndexes, getSelectionAffectedTableCells } from '../utils/selection';
12
+
13
+ /**
14
+ * The insert column command.
15
+ *
16
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableColumnLeft'` and
17
+ * `'insertTableColumnRight'` editor commands.
18
+ *
19
+ * To insert a column to the left of the selected cell, execute the following command:
20
+ *
21
+ * editor.execute( 'insertTableColumnLeft' );
22
+ *
23
+ * To insert a column to the right of the selected cell, execute the following command:
24
+ *
25
+ * editor.execute( 'insertTableColumnRight' );
26
+ *
27
+ * @extends module:core/command~Command
28
+ */
29
+ export default class InsertColumnCommand extends Command {
30
+ /**
31
+ * Creates a new `InsertColumnCommand` instance.
32
+ *
33
+ * @param {module:core/editor/editor~Editor} editor An editor on which this command will be used.
34
+ * @param {Object} options
35
+ * @param {String} [options.order="right"] The order of insertion relative to the column in which the caret is located.
36
+ * Possible values: `"left"` and `"right"`.
37
+ */
38
+ constructor( editor, options = {} ) {
39
+ super( editor );
40
+
41
+ /**
42
+ * The order of insertion relative to the column in which the caret is located.
43
+ *
44
+ * @readonly
45
+ * @member {String} module:table/commands/insertcolumncommand~InsertColumnCommand#order
46
+ */
47
+ this.order = options.order || 'right';
48
+ }
49
+
50
+ /**
51
+ * @inheritDoc
52
+ */
53
+ refresh() {
54
+ const selection = this.editor.model.document.selection;
55
+
56
+ const tableParent = selection.getFirstPosition().findAncestor( 'table' );
57
+
58
+ this.isEnabled = !!tableParent;
59
+ }
60
+
61
+ /**
62
+ * Executes the command.
63
+ *
64
+ * Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column
65
+ * in which the selection is set.
66
+ *
67
+ * @fires execute
68
+ */
69
+ execute() {
70
+ const editor = this.editor;
71
+ const selection = editor.model.document.selection;
72
+ const tableUtils = editor.plugins.get( 'TableUtils' );
73
+ const insertBefore = this.order === 'left';
74
+
75
+ const affectedTableCells = getSelectionAffectedTableCells( selection );
76
+ const columnIndexes = getColumnIndexes( affectedTableCells );
77
+
78
+ const column = insertBefore ? columnIndexes.first : columnIndexes.last;
79
+ const table = affectedTableCells[ 0 ].findAncestor( 'table' );
80
+
81
+ tableUtils.insertColumns( table, { columns: 1, at: insertBefore ? column : column + 1 } );
82
+ }
83
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @module table/commands/insertrowcommand
8
+ */
9
+
10
+ import { Command } from 'ckeditor5/src/core';
11
+ import { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection';
12
+
13
+ /**
14
+ * The insert row command.
15
+ *
16
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableRowBelow'` and
17
+ * `'insertTableRowAbove'` editor commands.
18
+ *
19
+ * To insert a row below the selected cell, execute the following command:
20
+ *
21
+ * editor.execute( 'insertTableRowBelow' );
22
+ *
23
+ * To insert a row above the selected cell, execute the following command:
24
+ *
25
+ * editor.execute( 'insertTableRowAbove' );
26
+ *
27
+ * @extends module:core/command~Command
28
+ */
29
+ export default class InsertRowCommand extends Command {
30
+ /**
31
+ * Creates a new `InsertRowCommand` instance.
32
+ *
33
+ * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
34
+ * @param {Object} options
35
+ * @param {String} [options.order="below"] The order of insertion relative to the row in which the caret is located.
36
+ * Possible values: `"above"` and `"below"`.
37
+ */
38
+ constructor( editor, options = {} ) {
39
+ super( editor );
40
+
41
+ /**
42
+ * The order of insertion relative to the row in which the caret is located.
43
+ *
44
+ * @readonly
45
+ * @member {String} module:table/commands/insertrowcommand~InsertRowCommand#order
46
+ */
47
+ this.order = options.order || 'below';
48
+ }
49
+
50
+ /**
51
+ * @inheritDoc
52
+ */
53
+ refresh() {
54
+ const selection = this.editor.model.document.selection;
55
+
56
+ const tableParent = selection.getFirstPosition().findAncestor( 'table' );
57
+
58
+ this.isEnabled = !!tableParent;
59
+ }
60
+
61
+ /**
62
+ * Executes the command.
63
+ *
64
+ * Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.
65
+ *
66
+ * @fires execute
67
+ */
68
+ execute() {
69
+ const editor = this.editor;
70
+ const selection = editor.model.document.selection;
71
+ const tableUtils = editor.plugins.get( 'TableUtils' );
72
+ const insertAbove = this.order === 'above';
73
+
74
+ const affectedTableCells = getSelectionAffectedTableCells( selection );
75
+ const rowIndexes = getRowIndexes( affectedTableCells );
76
+
77
+ const row = insertAbove ? rowIndexes.first : rowIndexes.last;
78
+ const table = affectedTableCells[ 0 ].findAncestor( 'table' );
79
+
80
+ tableUtils.insertRows( table, { at: insertAbove ? row : row + 1, copyStructureFromAbove: !insertAbove } );
81
+ }
82
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @module table/commands/inserttablecommand
8
+ */
9
+
10
+ import { Command } from 'ckeditor5/src/core';
11
+ import { findOptimalInsertionPosition, checkSelectionOnObject } from 'ckeditor5/src/widget';
12
+
13
+ /**
14
+ * The insert table command.
15
+ *
16
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTable'` editor command.
17
+ *
18
+ * To insert a table at the current selection, execute the command and specify the dimensions:
19
+ *
20
+ * editor.execute( 'insertTable', { rows: 20, columns: 5 } );
21
+ *
22
+ * @extends module:core/command~Command
23
+ */
24
+ export default class InsertTableCommand extends Command {
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ refresh() {
29
+ const model = this.editor.model;
30
+ const selection = model.document.selection;
31
+ const schema = model.schema;
32
+
33
+ this.isEnabled = isAllowedInParent( selection, schema ) &&
34
+ !checkSelectionOnObject( selection, schema );
35
+ }
36
+
37
+ /**
38
+ * Executes the command.
39
+ *
40
+ * Inserts a table with the given number of rows and columns into the editor.
41
+ *
42
+ * @param {Object} options
43
+ * @param {Number} [options.rows=2] The number of rows to create in the inserted table.
44
+ * @param {Number} [options.columns=2] The number of columns to create in the inserted table.
45
+ * @param {Number} [options.headingRows=0] The number of heading rows.
46
+ * @param {Number} [options.headingColumns=0] The number of heading columns.
47
+ * @fires execute
48
+ */
49
+ execute( options = {} ) {
50
+ const model = this.editor.model;
51
+ const selection = model.document.selection;
52
+ const tableUtils = this.editor.plugins.get( 'TableUtils' );
53
+
54
+ const insertPosition = findOptimalInsertionPosition( selection, model );
55
+
56
+ model.change( writer => {
57
+ const table = tableUtils.createTable( writer, options );
58
+
59
+ model.insertContent( table, insertPosition );
60
+
61
+ writer.setSelection( writer.createPositionAt( table.getNodeByPath( [ 0, 0, 0 ] ), 0 ) );
62
+ } );
63
+ }
64
+ }
65
+
66
+ // Checks if the table is allowed in the parent.
67
+ //
68
+ // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
69
+ // @param {module:engine/model/schema~Schema} schema
70
+ // @returns {Boolean}
71
+ function isAllowedInParent( selection, schema ) {
72
+ const positionParent = selection.getFirstPosition().parent;
73
+ const validParent = positionParent === positionParent.root ? positionParent : positionParent.parent;
74
+
75
+ return schema.checkChild( validParent, 'table' );
76
+ }
@@ -0,0 +1,272 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @module table/commands/mergecellcommand
8
+ */
9
+
10
+ import { Command } from 'ckeditor5/src/core';
11
+ import TableWalker from '../tablewalker';
12
+ import { getTableCellsContainingSelection } from '../utils/selection';
13
+ import { isHeadingColumnCell } from '../utils/common';
14
+ import { removeEmptyRowsColumns } from '../utils/structure';
15
+
16
+ /**
17
+ * The merge cell command.
18
+ *
19
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCellRight'`, `'mergeTableCellLeft'`,
20
+ * `'mergeTableCellUp'` and `'mergeTableCellDown'` editor commands.
21
+ *
22
+ * To merge a table cell at the current selection with another cell, execute the command corresponding with the preferred direction.
23
+ *
24
+ * For example, to merge with a cell to the right:
25
+ *
26
+ * editor.execute( 'mergeTableCellRight' );
27
+ *
28
+ * **Note**: If a table cell has a different [`rowspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-rowspan)
29
+ * (for `'mergeTableCellRight'` and `'mergeTableCellLeft'`) or [`colspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-colspan)
30
+ * (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.
31
+ *
32
+ * @extends module:core/command~Command
33
+ */
34
+ export default class MergeCellCommand extends Command {
35
+ /**
36
+ * Creates a new `MergeCellCommand` instance.
37
+ *
38
+ * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
39
+ * @param {Object} options
40
+ * @param {String} options.direction Indicates which cell to merge with the currently selected one.
41
+ * Possible values are: `'left'`, `'right'`, `'up'` and `'down'`.
42
+ */
43
+ constructor( editor, options ) {
44
+ super( editor );
45
+
46
+ /**
47
+ * The direction that indicates which cell will be merged with the currently selected one.
48
+ *
49
+ * @readonly
50
+ * @member {String} #direction
51
+ */
52
+ this.direction = options.direction;
53
+
54
+ /**
55
+ * Whether the merge is horizontal (left/right) or vertical (up/down).
56
+ *
57
+ * @readonly
58
+ * @member {Boolean} #isHorizontal
59
+ */
60
+ this.isHorizontal = this.direction == 'right' || this.direction == 'left';
61
+ }
62
+
63
+ /**
64
+ * @inheritDoc
65
+ */
66
+ refresh() {
67
+ const cellToMerge = this._getMergeableCell();
68
+
69
+ this.value = cellToMerge;
70
+ this.isEnabled = !!cellToMerge;
71
+ }
72
+
73
+ /**
74
+ * Executes the command.
75
+ *
76
+ * Depending on the command's {@link #direction} value, it will merge the cell that is to the `'left'`, `'right'`, `'up'` or `'down'`.
77
+ *
78
+ * @fires execute
79
+ */
80
+ execute() {
81
+ const model = this.editor.model;
82
+ const doc = model.document;
83
+ const tableCell = getTableCellsContainingSelection( doc.selection )[ 0 ];
84
+
85
+ const cellToMerge = this.value;
86
+ const direction = this.direction;
87
+
88
+ model.change( writer => {
89
+ const isMergeNext = direction == 'right' || direction == 'down';
90
+
91
+ // The merge mechanism is always the same so sort cells to be merged.
92
+ const cellToExpand = isMergeNext ? tableCell : cellToMerge;
93
+ const cellToRemove = isMergeNext ? cellToMerge : tableCell;
94
+
95
+ // Cache the parent of cell to remove for later check.
96
+ const removedTableCellRow = cellToRemove.parent;
97
+
98
+ mergeTableCells( cellToRemove, cellToExpand, writer );
99
+
100
+ const spanAttribute = this.isHorizontal ? 'colspan' : 'rowspan';
101
+ const cellSpan = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
102
+ const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );
103
+
104
+ // Update table cell span attribute and merge set selection on merged contents.
105
+ writer.setAttribute( spanAttribute, cellSpan + cellToMergeSpan, cellToExpand );
106
+ writer.setSelection( writer.createRangeIn( cellToExpand ) );
107
+
108
+ const tableUtils = this.editor.plugins.get( 'TableUtils' );
109
+ const table = removedTableCellRow.findAncestor( 'table' );
110
+
111
+ // Remove empty rows and columns after merging.
112
+ removeEmptyRowsColumns( table, tableUtils );
113
+ } );
114
+ }
115
+
116
+ /**
117
+ * Returns a cell that can be merged with the current cell depending on the command's direction.
118
+ *
119
+ * @returns {module:engine/model/element~Element|undefined}
120
+ * @private
121
+ */
122
+ _getMergeableCell() {
123
+ const model = this.editor.model;
124
+ const doc = model.document;
125
+ const tableCell = getTableCellsContainingSelection( doc.selection )[ 0 ];
126
+
127
+ if ( !tableCell ) {
128
+ return;
129
+ }
130
+
131
+ const tableUtils = this.editor.plugins.get( 'TableUtils' );
132
+
133
+ // First get the cell on proper direction.
134
+ const cellToMerge = this.isHorizontal ?
135
+ getHorizontalCell( tableCell, this.direction, tableUtils ) :
136
+ getVerticalCell( tableCell, this.direction );
137
+
138
+ if ( !cellToMerge ) {
139
+ return;
140
+ }
141
+
142
+ // If found check if the span perpendicular to merge direction is equal on both cells.
143
+ const spanAttribute = this.isHorizontal ? 'rowspan' : 'colspan';
144
+ const span = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
145
+
146
+ const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );
147
+
148
+ if ( cellToMergeSpan === span ) {
149
+ return cellToMerge;
150
+ }
151
+ }
152
+ }
153
+
154
+ // Returns the cell that can be merged horizontally.
155
+ //
156
+ // @param {module:engine/model/element~Element} tableCell
157
+ // @param {String} direction
158
+ // @returns {module:engine/model/node~Node|null}
159
+ function getHorizontalCell( tableCell, direction, tableUtils ) {
160
+ const tableRow = tableCell.parent;
161
+ const table = tableRow.parent;
162
+ const horizontalCell = direction == 'right' ? tableCell.nextSibling : tableCell.previousSibling;
163
+ const hasHeadingColumns = ( table.getAttribute( 'headingColumns' ) || 0 ) > 0;
164
+
165
+ if ( !horizontalCell ) {
166
+ return;
167
+ }
168
+
169
+ // Sort cells:
170
+ const cellOnLeft = direction == 'right' ? tableCell : horizontalCell;
171
+ const cellOnRight = direction == 'right' ? horizontalCell : tableCell;
172
+
173
+ // Get their column indexes:
174
+ const { column: leftCellColumn } = tableUtils.getCellLocation( cellOnLeft );
175
+ const { column: rightCellColumn } = tableUtils.getCellLocation( cellOnRight );
176
+
177
+ const leftCellSpan = parseInt( cellOnLeft.getAttribute( 'colspan' ) || 1 );
178
+
179
+ const isCellOnLeftInHeadingColumn = isHeadingColumnCell( tableUtils, cellOnLeft, table );
180
+ const isCellOnRightInHeadingColumn = isHeadingColumnCell( tableUtils, cellOnRight, table );
181
+
182
+ // We cannot merge heading columns cells with regular cells.
183
+ if ( hasHeadingColumns && isCellOnLeftInHeadingColumn != isCellOnRightInHeadingColumn ) {
184
+ return;
185
+ }
186
+
187
+ // The cell on the right must have index that is distant to the cell on the left by the left cell's width (colspan).
188
+ const cellsAreTouching = leftCellColumn + leftCellSpan === rightCellColumn;
189
+
190
+ // If the right cell's column index is different it means that there are rowspanned cells between them.
191
+ return cellsAreTouching ? horizontalCell : undefined;
192
+ }
193
+
194
+ // Returns the cell that can be merged vertically.
195
+ //
196
+ // @param {module:engine/model/element~Element} tableCell
197
+ // @param {String} direction
198
+ // @returns {module:engine/model/node~Node|null}
199
+ function getVerticalCell( tableCell, direction ) {
200
+ const tableRow = tableCell.parent;
201
+ const table = tableRow.parent;
202
+
203
+ const rowIndex = table.getChildIndex( tableRow );
204
+
205
+ // Don't search for mergeable cell if direction points out of the table.
206
+ if ( ( direction == 'down' && rowIndex === table.childCount - 1 ) || ( direction == 'up' && rowIndex === 0 ) ) {
207
+ return;
208
+ }
209
+
210
+ const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
211
+ const headingRows = table.getAttribute( 'headingRows' ) || 0;
212
+
213
+ const isMergeWithBodyCell = direction == 'down' && ( rowIndex + rowspan ) === headingRows;
214
+ const isMergeWithHeadCell = direction == 'up' && rowIndex === headingRows;
215
+
216
+ // Don't search for mergeable cell if direction points out of the current table section.
217
+ if ( headingRows && ( isMergeWithBodyCell || isMergeWithHeadCell ) ) {
218
+ return;
219
+ }
220
+
221
+ const currentCellRowSpan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
222
+ const rowOfCellToMerge = direction == 'down' ? rowIndex + currentCellRowSpan : rowIndex;
223
+
224
+ const tableMap = [ ...new TableWalker( table, { endRow: rowOfCellToMerge } ) ];
225
+
226
+ const currentCellData = tableMap.find( value => value.cell === tableCell );
227
+ const mergeColumn = currentCellData.column;
228
+
229
+ const cellToMergeData = tableMap.find( ( { row, cellHeight, column } ) => {
230
+ if ( column !== mergeColumn ) {
231
+ return false;
232
+ }
233
+
234
+ if ( direction == 'down' ) {
235
+ // If merging a cell below the mergeRow is already calculated.
236
+ return row === rowOfCellToMerge;
237
+ } else {
238
+ // If merging a cell above calculate if it spans to mergeRow.
239
+ return rowOfCellToMerge === row + cellHeight;
240
+ }
241
+ } );
242
+
243
+ return cellToMergeData && cellToMergeData.cell;
244
+ }
245
+
246
+ // Merges two table cells. It will ensure that after merging cells with an empty paragraph, the resulting table cell will only have one
247
+ // paragraph. If one of the merged table cells is empty, the merged table cell will have the contents of the non-empty table cell.
248
+ // If both are empty, the merged table cell will have only one empty paragraph.
249
+ //
250
+ // @param {module:engine/model/element~Element} cellToRemove
251
+ // @param {module:engine/model/element~Element} cellToExpand
252
+ // @param {module:engine/model/writer~Writer} writer
253
+ function mergeTableCells( cellToRemove, cellToExpand, writer ) {
254
+ if ( !isEmpty( cellToRemove ) ) {
255
+ if ( isEmpty( cellToExpand ) ) {
256
+ writer.remove( writer.createRangeIn( cellToExpand ) );
257
+ }
258
+
259
+ writer.move( writer.createRangeIn( cellToRemove ), writer.createPositionAt( cellToExpand, 'end' ) );
260
+ }
261
+
262
+ // Remove merged table cell.
263
+ writer.remove( cellToRemove );
264
+ }
265
+
266
+ // Checks if the passed table cell contains an empty paragraph.
267
+ //
268
+ // @param {module:engine/model/element~Element} tableCell
269
+ // @returns {Boolean}
270
+ function isEmpty( tableCell ) {
271
+ return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'element', 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
272
+ }
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @module table/commands/mergecellscommand
8
+ */
9
+
10
+ import { Command } from 'ckeditor5/src/core';
11
+ import TableUtils from '../tableutils';
12
+ import { getSelectedTableCells, isSelectionRectangular } from '../utils/selection';
13
+ import { updateNumericAttribute } from '../utils/common';
14
+ import { removeEmptyRowsColumns } from '../utils/structure';
15
+
16
+ /**
17
+ * The merge cells command.
18
+ *
19
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCells'` editor command.
20
+ *
21
+ * For example, to merge selected table cells:
22
+ *
23
+ * editor.execute( 'mergeTableCells' );
24
+ *
25
+ * @extends module:core/command~Command
26
+ */
27
+ export default class MergeCellsCommand extends Command {
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ refresh() {
32
+ const selectedTableCells = getSelectedTableCells( this.editor.model.document.selection );
33
+ this.isEnabled = isSelectionRectangular( selectedTableCells, this.editor.plugins.get( TableUtils ) );
34
+ }
35
+
36
+ /**
37
+ * Executes the command.
38
+ *
39
+ * @fires execute
40
+ */
41
+ execute() {
42
+ const model = this.editor.model;
43
+ const tableUtils = this.editor.plugins.get( TableUtils );
44
+
45
+ model.change( writer => {
46
+ const selectedTableCells = getSelectedTableCells( model.document.selection );
47
+
48
+ // All cells will be merged into the first one.
49
+ const firstTableCell = selectedTableCells.shift();
50
+
51
+ // Update target cell dimensions.
52
+ const { mergeWidth, mergeHeight } = getMergeDimensions( firstTableCell, selectedTableCells, tableUtils );
53
+ updateNumericAttribute( 'colspan', mergeWidth, firstTableCell, writer );
54
+ updateNumericAttribute( 'rowspan', mergeHeight, firstTableCell, writer );
55
+
56
+ for ( const tableCell of selectedTableCells ) {
57
+ mergeTableCells( tableCell, firstTableCell, writer );
58
+ }
59
+
60
+ const table = firstTableCell.findAncestor( 'table' );
61
+
62
+ // Remove rows and columns that become empty (have no anchored cells).
63
+ removeEmptyRowsColumns( table, tableUtils );
64
+
65
+ writer.setSelection( firstTableCell, 'in' );
66
+ } );
67
+ }
68
+ }
69
+
70
+ // Merges two table cells. It will ensure that after merging cells with empty paragraphs the resulting table cell will only have one
71
+ // paragraph. If one of the merged table cells is empty, the merged table cell will have contents of the non-empty table cell.
72
+ // If both are empty, the merged table cell will have only one empty paragraph.
73
+ //
74
+ // @param {module:engine/model/element~Element} cellBeingMerged
75
+ // @param {module:engine/model/element~Element} targetCell
76
+ // @param {module:engine/model/writer~Writer} writer
77
+ function mergeTableCells( cellBeingMerged, targetCell, writer ) {
78
+ if ( !isEmpty( cellBeingMerged ) ) {
79
+ if ( isEmpty( targetCell ) ) {
80
+ writer.remove( writer.createRangeIn( targetCell ) );
81
+ }
82
+
83
+ writer.move( writer.createRangeIn( cellBeingMerged ), writer.createPositionAt( targetCell, 'end' ) );
84
+ }
85
+
86
+ // Remove merged table cell.
87
+ writer.remove( cellBeingMerged );
88
+ }
89
+
90
+ // Checks if the passed table cell contains an empty paragraph.
91
+ //
92
+ // @param {module:engine/model/element~Element} tableCell
93
+ // @returns {Boolean}
94
+ function isEmpty( tableCell ) {
95
+ return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'element', 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
96
+ }
97
+
98
+ function getMergeDimensions( firstTableCell, selectedTableCells, tableUtils ) {
99
+ let maxWidthOffset = 0;
100
+ let maxHeightOffset = 0;
101
+
102
+ for ( const tableCell of selectedTableCells ) {
103
+ const { row, column } = tableUtils.getCellLocation( tableCell );
104
+
105
+ maxWidthOffset = getMaxOffset( tableCell, column, maxWidthOffset, 'colspan' );
106
+ maxHeightOffset = getMaxOffset( tableCell, row, maxHeightOffset, 'rowspan' );
107
+ }
108
+
109
+ // Update table cell span attribute and merge set selection on a merged contents.
110
+ const { row: firstCellRow, column: firstCellColumn } = tableUtils.getCellLocation( firstTableCell );
111
+
112
+ const mergeWidth = maxWidthOffset - firstCellColumn;
113
+ const mergeHeight = maxHeightOffset - firstCellRow;
114
+
115
+ return { mergeWidth, mergeHeight };
116
+ }
117
+
118
+ function getMaxOffset( tableCell, start, currentMaxOffset, which ) {
119
+ const dimensionValue = parseInt( tableCell.getAttribute( which ) || 1 );
120
+
121
+ return Math.max( currentMaxOffset, start + dimensionValue );
122
+ }