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,130 @@
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/utils/ui/contextualballoon
8
+ */
9
+
10
+ import { centeredBalloonPositionForLongWidgets } from 'ckeditor5/src/widget';
11
+ import { Rect } from 'ckeditor5/src/utils';
12
+ import { BalloonPanelView } from 'ckeditor5/src/ui';
13
+
14
+ import { getTableWidgetAncestor } from './widget';
15
+
16
+ const DEFAULT_BALLOON_POSITIONS = BalloonPanelView.defaultPositions;
17
+
18
+ const BALLOON_POSITIONS = [
19
+ DEFAULT_BALLOON_POSITIONS.northArrowSouth,
20
+ DEFAULT_BALLOON_POSITIONS.northArrowSouthWest,
21
+ DEFAULT_BALLOON_POSITIONS.northArrowSouthEast,
22
+ DEFAULT_BALLOON_POSITIONS.southArrowNorth,
23
+ DEFAULT_BALLOON_POSITIONS.southArrowNorthWest,
24
+ DEFAULT_BALLOON_POSITIONS.southArrowNorthEast
25
+ ];
26
+
27
+ const TABLE_PROPERTIES_BALLOON_POSITIONS = [
28
+ ...BALLOON_POSITIONS,
29
+ centeredBalloonPositionForLongWidgets
30
+ ];
31
+
32
+ /**
33
+ * A helper utility that positions the
34
+ * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance
35
+ * with respect to the table in the editor content, if one is selected.
36
+ *
37
+ * @param {module:core/editor/editor~Editor} editor The editor instance.
38
+ * @param {String} target Either "cell" or "table". Determines the target the balloon will
39
+ * be attached to.
40
+ */
41
+ export function repositionContextualBalloon( editor, target ) {
42
+ const balloon = editor.plugins.get( 'ContextualBalloon' );
43
+
44
+ if ( getTableWidgetAncestor( editor.editing.view.document.selection ) ) {
45
+ let position;
46
+
47
+ if ( target === 'cell' ) {
48
+ position = getBalloonCellPositionData( editor );
49
+ } else {
50
+ position = getBalloonTablePositionData( editor );
51
+ }
52
+
53
+ balloon.updatePosition( position );
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Returns the positioning options that control the geometry of the
59
+ * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
60
+ * to the selected table in the editor content.
61
+ *
62
+ * @param {module:core/editor/editor~Editor} editor The editor instance.
63
+ * @returns {module:utils/dom/position~Options}
64
+ */
65
+ export function getBalloonTablePositionData( editor ) {
66
+ const firstPosition = editor.model.document.selection.getFirstPosition();
67
+ const modelTable = firstPosition.findAncestor( 'table' );
68
+ const viewTable = editor.editing.mapper.toViewElement( modelTable );
69
+
70
+ return {
71
+ target: editor.editing.view.domConverter.viewToDom( viewTable ),
72
+ positions: TABLE_PROPERTIES_BALLOON_POSITIONS
73
+ };
74
+ }
75
+
76
+ /**
77
+ * Returns the positioning options that control the geometry of the
78
+ * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
79
+ * to the selected table cell in the editor content.
80
+ *
81
+ * @param {module:core/editor/editor~Editor} editor The editor instance.
82
+ * @returns {module:utils/dom/position~Options}
83
+ */
84
+ export function getBalloonCellPositionData( editor ) {
85
+ const mapper = editor.editing.mapper;
86
+ const domConverter = editor.editing.view.domConverter;
87
+ const selection = editor.model.document.selection;
88
+
89
+ if ( selection.rangeCount > 1 ) {
90
+ return {
91
+ target: () => createBoundingRect( selection.getRanges(), editor ),
92
+ positions: BALLOON_POSITIONS
93
+ };
94
+ }
95
+
96
+ const modelTableCell = getTableCellAtPosition( selection.getFirstPosition() );
97
+ const viewTableCell = mapper.toViewElement( modelTableCell );
98
+
99
+ return {
100
+ target: domConverter.viewToDom( viewTableCell ),
101
+ positions: BALLOON_POSITIONS
102
+ };
103
+ }
104
+
105
+ // Returns the first selected table cell from a multi-cell or in-cell selection.
106
+ //
107
+ // @param {module:engine/model/position~Position} position Document position.
108
+ // @returns {module:engine/model/element~Element}
109
+ function getTableCellAtPosition( position ) {
110
+ const isTableCellSelected = position.nodeAfter && position.nodeAfter.is( 'element', 'tableCell' );
111
+
112
+ return isTableCellSelected ? position.nodeAfter : position.findAncestor( 'tableCell' );
113
+ }
114
+
115
+ // Returns bounding rectangle for given model ranges.
116
+ //
117
+ // @param {Iterable.<module:engine/model/range~Range>} ranges Model ranges that the bounding rect should be returned for.
118
+ // @param {module:core/editor/editor~Editor} editor The editor instance.
119
+ // @returns {module:utils/dom/rect~Rect}
120
+ function createBoundingRect( ranges, editor ) {
121
+ const mapper = editor.editing.mapper;
122
+ const domConverter = editor.editing.view.domConverter;
123
+ const rects = Array.from( ranges ).map( range => {
124
+ const modelTableCell = getTableCellAtPosition( range.start );
125
+ const viewTableCell = mapper.toViewElement( modelTableCell );
126
+ return new Rect( domConverter.viewToDom( viewTableCell ) );
127
+ } );
128
+
129
+ return Rect.getBoundingRect( rects );
130
+ }
@@ -0,0 +1,397 @@
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/utils/ui/table-properties
8
+ */
9
+
10
+ import { ButtonView, Model } from 'ckeditor5/src/ui';
11
+ import { Collection } from 'ckeditor5/src/utils';
12
+ import { isColor, isLength, isPercentage } from 'ckeditor5/src/engine';
13
+
14
+ import ColorInputView from '../../ui/colorinputview';
15
+
16
+ const isEmpty = val => val === '';
17
+
18
+ /**
19
+ * Returns an object containing pairs of CSS border style values and their localized UI
20
+ * labels. Used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}
21
+ * and {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView}.
22
+ *
23
+ * @param {module:utils/locale~Locale#t} t The "t" function provided by the editor
24
+ * that is used to localize strings.
25
+ * @returns {Object.<String,String>}
26
+ */
27
+ export function getBorderStyleLabels( t ) {
28
+ return {
29
+ none: t( 'None' ),
30
+ solid: t( 'Solid' ),
31
+ dotted: t( 'Dotted' ),
32
+ dashed: t( 'Dashed' ),
33
+ double: t( 'Double' ),
34
+ groove: t( 'Groove' ),
35
+ ridge: t( 'Ridge' ),
36
+ inset: t( 'Inset' ),
37
+ outset: t( 'Outset' )
38
+ };
39
+ }
40
+
41
+ /**
42
+ * Returns a localized error string that can be displayed next to color (background, border)
43
+ * fields that have an invalid value.
44
+ *
45
+ * @param {module:utils/locale~Locale#t} t The "t" function provided by the editor
46
+ * that is used to localize strings.
47
+ * @returns {String}
48
+ */
49
+ export function getLocalizedColorErrorText( t ) {
50
+ return t( 'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".' );
51
+ }
52
+
53
+ /**
54
+ * Returns a localized error string that can be displayed next to length (padding, border width)
55
+ * fields that have an invalid value.
56
+ *
57
+ * @param {module:utils/locale~Locale#t} t The "t" function provided by the editor
58
+ * that is used to localize strings.
59
+ * @returns {String}
60
+ */
61
+ export function getLocalizedLengthErrorText( t ) {
62
+ return t( 'The value is invalid. Try "10px" or "2em" or simply "2".' );
63
+ }
64
+
65
+ /**
66
+ * Returns `true` when the passed value is an empty string or a valid CSS color expression.
67
+ * Otherwise, `false` is returned.
68
+ *
69
+ * See {@link module:engine/view/styles/utils~isColor}.
70
+ *
71
+ * @param {String} value
72
+ * @returns {Boolean}
73
+ */
74
+ export function colorFieldValidator( value ) {
75
+ value = value.trim();
76
+
77
+ return isEmpty( value ) || isColor( value );
78
+ }
79
+
80
+ /**
81
+ * Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.
82
+ * Otherwise, `false` is returned.
83
+ *
84
+ * See {@link module:engine/view/styles/utils~isLength}.
85
+ * See {@link module:engine/view/styles/utils~isPercentage}.
86
+ *
87
+ * @param {String} value
88
+ * @returns {Boolean}
89
+ */
90
+ export function lengthFieldValidator( value ) {
91
+ value = value.trim();
92
+
93
+ return isEmpty( value ) || isNumberString( value ) || isLength( value ) || isPercentage( value );
94
+ }
95
+
96
+ /**
97
+ * Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.
98
+ * Otherwise, `false` is returned.
99
+ *
100
+ * See {@link module:engine/view/styles/utils~isLength}.
101
+ *
102
+ * @param {String} value
103
+ * @returns {Boolean}
104
+ */
105
+ export function lineWidthFieldValidator( value ) {
106
+ value = value.trim();
107
+
108
+ return isEmpty( value ) || isNumberString( value ) || isLength( value );
109
+ }
110
+
111
+ /**
112
+ * Generates item definitions for a UI dropdown that allows changing the border style of a table or a table cell.
113
+ *
114
+ * @param {module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView|
115
+ * module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView} view
116
+ * @returns {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>}
117
+ */
118
+ export function getBorderStyleDefinitions( view ) {
119
+ const itemDefinitions = new Collection();
120
+ const styleLabels = getBorderStyleLabels( view.t );
121
+
122
+ for ( const style in styleLabels ) {
123
+ const definition = {
124
+ type: 'button',
125
+ model: new Model( {
126
+ _borderStyleValue: style === 'none' ? '' : style,
127
+ label: styleLabels[ style ],
128
+ withText: true
129
+ } )
130
+ };
131
+
132
+ if ( style === 'none' ) {
133
+ definition.model.bind( 'isOn' ).to( view, 'borderStyle', value => !value );
134
+ } else {
135
+ definition.model.bind( 'isOn' ).to( view, 'borderStyle', value => {
136
+ return value === style;
137
+ } );
138
+ }
139
+
140
+ itemDefinitions.add( definition );
141
+ }
142
+
143
+ return itemDefinitions;
144
+ }
145
+
146
+ /**
147
+ * A helper that fills a toolbar with buttons that:
148
+ *
149
+ * * have some labels,
150
+ * * have some icons,
151
+ * * set a certain UI view property value upon execution.
152
+ *
153
+ * @param {Object} options
154
+ * @param {module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView|
155
+ * module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView} options.view
156
+ * @param {Array.<String>} options.icons
157
+ * @param {module:ui/toolbar/toolbarview~ToolbarView} options.toolbar
158
+ * @param {Object.<String,String>} labels
159
+ * @param {String} propertyName
160
+ * @param {Function} nameToValue A function that maps a button name to a value. By default names are the same as values.
161
+ */
162
+ export function fillToolbar( { view, icons, toolbar, labels, propertyName, nameToValue } ) {
163
+ for ( const name in labels ) {
164
+ const button = new ButtonView( view.locale );
165
+
166
+ button.set( {
167
+ label: labels[ name ],
168
+ icon: icons[ name ],
169
+ tooltip: labels[ name ]
170
+ } );
171
+
172
+ button.bind( 'isOn' ).to( view, propertyName, value => {
173
+ return value === nameToValue( name );
174
+ } );
175
+
176
+ button.on( 'execute', () => {
177
+ view[ propertyName ] = nameToValue( name );
178
+ } );
179
+
180
+ toolbar.items.add( button );
181
+ }
182
+ }
183
+
184
+ /**
185
+ * A default color palette used by various user interfaces related to tables, for instance,
186
+ * by {@link module:table/tablecellproperties/tablecellpropertiesui~TableCellPropertiesUI} or
187
+ * {@link module:table/tableproperties/tablepropertiesui~TablePropertiesUI}.
188
+ *
189
+ * The color palette follows the {@link module:table/table~TableColorConfig table color configuration format}
190
+ * and contains the following color definitions:
191
+ *
192
+ * const defaultColors = [
193
+ * {
194
+ * color: 'hsl(0, 0%, 0%)',
195
+ * label: 'Black'
196
+ * },
197
+ * {
198
+ * color: 'hsl(0, 0%, 30%)',
199
+ * label: 'Dim grey'
200
+ * },
201
+ * {
202
+ * color: 'hsl(0, 0%, 60%)',
203
+ * label: 'Grey'
204
+ * },
205
+ * {
206
+ * color: 'hsl(0, 0%, 90%)',
207
+ * label: 'Light grey'
208
+ * },
209
+ * {
210
+ * color: 'hsl(0, 0%, 100%)',
211
+ * label: 'White',
212
+ * hasBorder: true
213
+ * },
214
+ * {
215
+ * color: 'hsl(0, 75%, 60%)',
216
+ * label: 'Red'
217
+ * },
218
+ * {
219
+ * color: 'hsl(30, 75%, 60%)',
220
+ * label: 'Orange'
221
+ * },
222
+ * {
223
+ * color: 'hsl(60, 75%, 60%)',
224
+ * label: 'Yellow'
225
+ * },
226
+ * {
227
+ * color: 'hsl(90, 75%, 60%)',
228
+ * label: 'Light green'
229
+ * },
230
+ * {
231
+ * color: 'hsl(120, 75%, 60%)',
232
+ * label: 'Green'
233
+ * },
234
+ * {
235
+ * color: 'hsl(150, 75%, 60%)',
236
+ * label: 'Aquamarine'
237
+ * },
238
+ * {
239
+ * color: 'hsl(180, 75%, 60%)',
240
+ * label: 'Turquoise'
241
+ * },
242
+ * {
243
+ * color: 'hsl(210, 75%, 60%)',
244
+ * label: 'Light blue'
245
+ * },
246
+ * {
247
+ * color: 'hsl(240, 75%, 60%)',
248
+ * label: 'Blue'
249
+ * },
250
+ * {
251
+ * color: 'hsl(270, 75%, 60%)',
252
+ * label: 'Purple'
253
+ * }
254
+ * ];
255
+ */
256
+ export const defaultColors = [
257
+ {
258
+ color: 'hsl(0, 0%, 0%)',
259
+ label: 'Black'
260
+ },
261
+ {
262
+ color: 'hsl(0, 0%, 30%)',
263
+ label: 'Dim grey'
264
+ },
265
+ {
266
+ color: 'hsl(0, 0%, 60%)',
267
+ label: 'Grey'
268
+ },
269
+ {
270
+ color: 'hsl(0, 0%, 90%)',
271
+ label: 'Light grey'
272
+ },
273
+ {
274
+ color: 'hsl(0, 0%, 100%)',
275
+ label: 'White',
276
+ hasBorder: true
277
+ },
278
+ {
279
+ color: 'hsl(0, 75%, 60%)',
280
+ label: 'Red'
281
+ },
282
+ {
283
+ color: 'hsl(30, 75%, 60%)',
284
+ label: 'Orange'
285
+ },
286
+ {
287
+ color: 'hsl(60, 75%, 60%)',
288
+ label: 'Yellow'
289
+ },
290
+ {
291
+ color: 'hsl(90, 75%, 60%)',
292
+ label: 'Light green'
293
+ },
294
+ {
295
+ color: 'hsl(120, 75%, 60%)',
296
+ label: 'Green'
297
+ },
298
+ {
299
+ color: 'hsl(150, 75%, 60%)',
300
+ label: 'Aquamarine'
301
+ },
302
+ {
303
+ color: 'hsl(180, 75%, 60%)',
304
+ label: 'Turquoise'
305
+ },
306
+ {
307
+ color: 'hsl(210, 75%, 60%)',
308
+ label: 'Light blue'
309
+ },
310
+ {
311
+ color: 'hsl(240, 75%, 60%)',
312
+ label: 'Blue'
313
+ },
314
+ {
315
+ color: 'hsl(270, 75%, 60%)',
316
+ label: 'Purple'
317
+ }
318
+ ];
319
+
320
+ /**
321
+ * Returns a creator for a color input with a label.
322
+ *
323
+ * For given options, it returns a function that creates an instance of a
324
+ * {@link module:table/ui/colorinputview~ColorInputView color input} logically related to
325
+ * a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in the DOM.
326
+ *
327
+ * The helper does the following:
328
+ *
329
+ * * It sets the color input `id` and `ariaDescribedById` attributes.
330
+ * * It binds the color input `isReadOnly` to the labeled view.
331
+ * * It binds the color input `hasError` to the labeled view.
332
+ * * It enables a logic that cleans up the error when the user starts typing in the color input.
333
+ *
334
+ * Usage:
335
+ *
336
+ * const colorInputCreator = getLabeledColorInputCreator( {
337
+ * colorConfig: [ ... ],
338
+ * columns: 3,
339
+ * } );
340
+ *
341
+ * const labeledInputView = new LabeledFieldView( locale, colorInputCreator );
342
+ * console.log( labeledInputView.view ); // A color input instance.
343
+ *
344
+ * @private
345
+ * @param options Color input options.
346
+ * @param {module:table/table~TableColorConfig} options.colorConfig The configuration of the color palette
347
+ * displayed in the input's dropdown.
348
+ * @param {Number} options.columns The configuration of the number of columns the color palette consists of
349
+ * in the input's dropdown.
350
+ * @returns {Function}
351
+ */
352
+ export function getLabeledColorInputCreator( options ) {
353
+ return ( labeledFieldView, viewUid, statusUid ) => {
354
+ const inputView = new ColorInputView( labeledFieldView.locale, {
355
+ colorDefinitions: colorConfigToColorGridDefinitions( options.colorConfig ),
356
+ columns: options.columns
357
+ } );
358
+
359
+ inputView.set( {
360
+ id: viewUid,
361
+ ariaDescribedById: statusUid
362
+ } );
363
+
364
+ inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
365
+ inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
366
+
367
+ inputView.on( 'input', () => {
368
+ // UX: Make the error text disappear and disable the error indicator as the user
369
+ // starts fixing the errors.
370
+ labeledFieldView.errorText = null;
371
+ } );
372
+
373
+ labeledFieldView.bind( 'isEmpty', 'isFocused' ).to( inputView );
374
+
375
+ return inputView;
376
+ };
377
+ }
378
+
379
+ // A simple helper method to detect number strings.
380
+ // I allows full number notation, so omitting 0 is not allowed:
381
+ function isNumberString( value ) {
382
+ const parsedValue = parseFloat( value );
383
+
384
+ return !Number.isNaN( parsedValue ) && value === String( parsedValue );
385
+ }
386
+
387
+ // @param {Array.<Object>} colorConfig
388
+ // @returns {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>}
389
+ function colorConfigToColorGridDefinitions( colorConfig ) {
390
+ return colorConfig.map( item => ( {
391
+ color: item.model,
392
+ label: item.label,
393
+ options: {
394
+ hasBorder: item.hasBorder
395
+ }
396
+ } ) );
397
+ }
@@ -0,0 +1,62 @@
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/utils/ui/widget
8
+ */
9
+
10
+ import { isWidget } from 'ckeditor5/src/widget';
11
+
12
+ /**
13
+ * Returns a table widget editing view element if one is selected.
14
+ *
15
+ * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
16
+ * @returns {module:engine/view/element~Element|null}
17
+ */
18
+ export function getSelectedTableWidget( selection ) {
19
+ const viewElement = selection.getSelectedElement();
20
+
21
+ if ( viewElement && isTableWidget( viewElement ) ) {
22
+ return viewElement;
23
+ }
24
+
25
+ return null;
26
+ }
27
+
28
+ /**
29
+ * Returns a table widget editing view element if one is among the selection's ancestors.
30
+ *
31
+ * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
32
+ * @returns {module:engine/view/element~Element|null}
33
+ */
34
+ export function getTableWidgetAncestor( selection ) {
35
+ const parentTable = findAncestor( 'table', selection.getFirstPosition() );
36
+
37
+ if ( parentTable && isTableWidget( parentTable.parent ) ) {
38
+ return parentTable.parent;
39
+ }
40
+
41
+ return null;
42
+ }
43
+
44
+ // Checks if a given view element is a table widget.
45
+ //
46
+ // @param {module:engine/view/element~Element} viewElement
47
+ // @returns {Boolean}
48
+ function isTableWidget( viewElement ) {
49
+ return !!viewElement.getCustomProperty( 'table' ) && isWidget( viewElement );
50
+ }
51
+
52
+ function findAncestor( parentName, positionOrElement ) {
53
+ let parent = positionOrElement.parent;
54
+
55
+ while ( parent ) {
56
+ if ( parent.name === parentName ) {
57
+ return parent;
58
+ }
59
+
60
+ parent = parent.parent;
61
+ }
62
+ }