qms-angular 1.0.87 → 1.0.90

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 (292) hide show
  1. package/README.md +5 -1
  2. package/bundles/qms-angular.umd.js +262 -87
  3. package/bundles/qms-angular.umd.js.map +1 -1
  4. package/esm2015/lib/common/themes.const.js +3 -0
  5. package/esm2015/lib/components/badges/qms-badges.component.js +1 -1
  6. package/esm2015/lib/components/banner/qms-banner/qms-banner.component.js +1 -1
  7. package/esm2015/lib/components/banner/qms-banner-confirm/qms-banner-confirm.component.js +1 -1
  8. package/esm2015/lib/components/banner/qms-banner-loading/qms-banner-loading.component.js +1 -1
  9. package/esm2015/lib/components/button/button-toggle.js +1 -1
  10. package/esm2015/lib/components/button/button.js +3 -3
  11. package/esm2015/lib/components/comment/comment.js +1 -1
  12. package/esm2015/lib/components/dialog/dialog.js +2 -2
  13. package/esm2015/lib/components/list/list.js +5 -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 +1 -1
  16. package/esm2015/lib/components/related/list-other-related/list-related.component.js +1 -1
  17. package/esm2015/lib/components/related/popup/related-popup.component.js +1 -1
  18. package/esm2015/lib/components/related/risk/analysis/analysis.component.js +1 -1
  19. package/esm2015/lib/components/related/risk/list/list.component.js +1 -1
  20. package/esm2015/lib/components/related/risk/result/result.component.js +1 -1
  21. package/esm2015/lib/components/rich-text/rich-text.js +1 -1
  22. package/esm2015/lib/components/select-dialog/select-dialog.js +1 -1
  23. package/esm2015/lib/components/select-include-children/select-include-children.component.js +1 -1
  24. package/esm2015/lib/components/select-one/select-one.component.js +1 -1
  25. package/esm2015/lib/components/select-process-document/select-process-document.component.js +1 -1
  26. package/esm2015/lib/components/table/table-action.js +2 -2
  27. package/esm2015/lib/components/tooltip/tooltip.js +1 -1
  28. package/esm2015/lib/components/tree/tree.component.js +1 -1
  29. package/esm2015/lib/components/treeNew/tree.component.js +18 -2
  30. package/esm2015/lib/directives/text-truncate/text-truncate.directive.js +58 -0
  31. package/esm2015/lib/qms-angular.module.js +4 -1
  32. package/esm2015/lib/qms-ckeditor-components/common/functions/common.function.js +34 -1
  33. package/esm2015/lib/qms-ckeditor-components/common/module/confirm/qms-ckeditor-confirm.component.js +1 -1
  34. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.js +1 -1
  35. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.js +1 -1
  36. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/attachments/link-attachment.component.js +1 -1
  37. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +1 -1
  38. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.js +1 -1
  39. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.js +1 -1
  40. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.js +1 -1
  41. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +1 -1
  42. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +5 -3
  43. package/esm2015/lib/services/theming.service.js +36 -0
  44. package/esm2015/lib/shared.module.js +1 -1
  45. package/esm2015/public-api.js +4 -1
  46. package/fesm2015/qms-angular.js +212 -56
  47. package/fesm2015/qms-angular.js.map +1 -1
  48. package/lib/common/themes.const.d.ts +2 -0
  49. package/lib/components/list/list.d.ts +1 -1
  50. package/lib/components/qms-paginator/qms-paginator.component.d.ts +1 -0
  51. package/lib/components/treeNew/tree.component.d.ts +1 -0
  52. package/lib/directives/text-truncate/text-truncate.directive.d.ts +15 -0
  53. package/lib/qms-ckeditor-components/common/functions/common.function.d.ts +12 -0
  54. package/lib/services/theming.service.d.ts +7 -0
  55. package/lib.theme.scss +181 -4
  56. package/package.json +1 -1
  57. package/public-api.d.ts +3 -0
  58. package/qms-angular.metadata.json +1 -1
  59. package/src/assets/fonts/Material/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2 +0 -0
  60. package/src/assets/fonts/Material/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUce.woff2 +0 -0
  61. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFUZ0bbck.woff2 +0 -0
  62. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFVZ0b.woff2 +0 -0
  63. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFVp0bbck.woff2 +0 -0
  64. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFW50bbck.woff2 +0 -0
  65. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFWJ0bbck.woff2 +0 -0
  66. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFWZ0bbck.woff2 +0 -0
  67. package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFWp0bbck.woff2 +0 -0
  68. package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCFPrEHJA.woff2 +0 -0
  69. package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCGPrEHJA.woff2 +0 -0
  70. package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCHPrEHJA.woff2 +0 -0
  71. package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrE.woff2 +0 -0
  72. package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCMPrEHJA.woff2 +0 -0
  73. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
  74. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
  75. package/src/assets/qms-ckeditor-plugin/build/translations/ar.js +1 -1
  76. package/src/assets/qms-ckeditor-plugin/build/translations/az.js +1 -1
  77. package/src/assets/qms-ckeditor-plugin/build/translations/bg.js +1 -1
  78. package/src/assets/qms-ckeditor-plugin/build/translations/ca.js +1 -1
  79. package/src/assets/qms-ckeditor-plugin/build/translations/cs.js +1 -1
  80. package/src/assets/qms-ckeditor-plugin/build/translations/da.js +1 -1
  81. package/src/assets/qms-ckeditor-plugin/build/translations/de-ch.js +1 -1
  82. package/src/assets/qms-ckeditor-plugin/build/translations/de.js +1 -1
  83. package/src/assets/qms-ckeditor-plugin/build/translations/el.js +1 -1
  84. package/src/assets/qms-ckeditor-plugin/build/translations/en-au.js +1 -1
  85. package/src/assets/qms-ckeditor-plugin/build/translations/en-gb.js +1 -1
  86. package/src/assets/qms-ckeditor-plugin/build/translations/eo.js +1 -1
  87. package/src/assets/qms-ckeditor-plugin/build/translations/es.js +1 -1
  88. package/src/assets/qms-ckeditor-plugin/build/translations/et.js +1 -1
  89. package/src/assets/qms-ckeditor-plugin/build/translations/eu.js +1 -1
  90. package/src/assets/qms-ckeditor-plugin/build/translations/fa.js +1 -1
  91. package/src/assets/qms-ckeditor-plugin/build/translations/fi.js +1 -1
  92. package/src/assets/qms-ckeditor-plugin/build/translations/fr.js +1 -1
  93. package/src/assets/qms-ckeditor-plugin/build/translations/gl.js +1 -1
  94. package/src/assets/qms-ckeditor-plugin/build/translations/he.js +1 -1
  95. package/src/assets/qms-ckeditor-plugin/build/translations/hi.js +1 -1
  96. package/src/assets/qms-ckeditor-plugin/build/translations/hr.js +1 -1
  97. package/src/assets/qms-ckeditor-plugin/build/translations/hu.js +1 -1
  98. package/src/assets/qms-ckeditor-plugin/build/translations/id.js +1 -1
  99. package/src/assets/qms-ckeditor-plugin/build/translations/it.js +1 -1
  100. package/src/assets/qms-ckeditor-plugin/build/translations/ja.js +1 -1
  101. package/src/assets/qms-ckeditor-plugin/build/translations/km.js +1 -1
  102. package/src/assets/qms-ckeditor-plugin/build/translations/kn.js +1 -1
  103. package/src/assets/qms-ckeditor-plugin/build/translations/ko.js +1 -1
  104. package/src/assets/qms-ckeditor-plugin/build/translations/ku.js +1 -1
  105. package/src/assets/qms-ckeditor-plugin/build/translations/lt.js +1 -1
  106. package/src/assets/qms-ckeditor-plugin/build/translations/lv.js +1 -1
  107. package/src/assets/qms-ckeditor-plugin/build/translations/nb.js +1 -1
  108. package/src/assets/qms-ckeditor-plugin/build/translations/ne.js +1 -1
  109. package/src/assets/qms-ckeditor-plugin/build/translations/nl.js +1 -1
  110. package/src/assets/qms-ckeditor-plugin/build/translations/no.js +1 -1
  111. package/src/assets/qms-ckeditor-plugin/build/translations/pl.js +1 -1
  112. package/src/assets/qms-ckeditor-plugin/build/translations/pt-br.js +1 -1
  113. package/src/assets/qms-ckeditor-plugin/build/translations/pt.js +1 -1
  114. package/src/assets/qms-ckeditor-plugin/build/translations/ro.js +1 -1
  115. package/src/assets/qms-ckeditor-plugin/build/translations/ru.js +1 -1
  116. package/src/assets/qms-ckeditor-plugin/build/translations/sk.js +1 -1
  117. package/src/assets/qms-ckeditor-plugin/build/translations/sl.js +1 -1
  118. package/src/assets/qms-ckeditor-plugin/build/translations/sq.js +1 -1
  119. package/src/assets/qms-ckeditor-plugin/build/translations/sr-latn.js +1 -1
  120. package/src/assets/qms-ckeditor-plugin/build/translations/sr.js +1 -1
  121. package/src/assets/qms-ckeditor-plugin/build/translations/sv.js +1 -1
  122. package/src/assets/qms-ckeditor-plugin/build/translations/th.js +1 -1
  123. package/src/assets/qms-ckeditor-plugin/build/translations/tk.js +1 -1
  124. package/src/assets/qms-ckeditor-plugin/build/translations/tr.js +1 -1
  125. package/src/assets/qms-ckeditor-plugin/build/translations/ug.js +1 -1
  126. package/src/assets/qms-ckeditor-plugin/build/translations/uk.js +1 -1
  127. package/src/assets/qms-ckeditor-plugin/build/translations/vi.js +1 -1
  128. package/src/assets/qms-ckeditor-plugin/build/translations/zh-cn.js +1 -1
  129. package/src/assets/qms-ckeditor-plugin/build/translations/zh.js +1 -1
  130. package/src/assets/qms-ckeditor-plugin/package-lock.json +0 -2
  131. package/src/assets/qms-ckeditor-plugin/package.json +0 -2
  132. package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +6 -6
  133. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/heading.js +119 -0
  134. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingbuttonsui.js +103 -0
  135. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingcommand.js +96 -0
  136. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingediting.js +163 -0
  137. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingui.js +115 -0
  138. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/index.js +22 -0
  139. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/heading.css +35 -0
  140. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading1.svg +1 -0
  141. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading2.svg +1 -0
  142. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading3.svg +1 -0
  143. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading4.svg +1 -0
  144. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading5.svg +1 -0
  145. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading6.svg +1 -0
  146. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/title.js +598 -0
  147. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/utils.js +42 -0
  148. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/insertcolumncommand.js +83 -0
  149. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/insertrowcommand.js +82 -0
  150. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/inserttablecommand.js +76 -0
  151. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/mergecellcommand.js +272 -0
  152. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/mergecellscommand.js +122 -0
  153. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/removecolumncommand.js +122 -0
  154. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/removerowcommand.js +97 -0
  155. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/selectcolumncommand.js +63 -0
  156. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/selectrowcommand.js +56 -0
  157. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/setheadercolumncommand.js +95 -0
  158. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/setheaderrowcommand.js +105 -0
  159. package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/splitcellcommand.js +68 -0
  160. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/downcast.js +529 -0
  161. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-cell-paragraph-post-fixer.js +136 -0
  162. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-cell-refresh-post-fixer.js +75 -0
  163. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-heading-rows-refresh-post-fixer.js +55 -0
  164. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-layout-post-fixer.js +399 -0
  165. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/tableproperties.js +126 -0
  166. package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/upcasttable.js +211 -0
  167. package/src/assets/qms-ckeditor-plugin/src/plugins/table/index.js +42 -0
  168. package/src/assets/qms-ckeditor-plugin/src/plugins/table/table.js +103 -0
  169. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +35 -0
  170. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellbordercolorcommand.js +47 -0
  171. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellborderstylecommand.js +47 -0
  172. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellborderwidthcommand.js +62 -0
  173. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellheightcommand.js +51 -0
  174. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +35 -0
  175. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellpaddingcommand.js +62 -0
  176. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellpropertycommand.js +110 -0
  177. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellverticalalignmentcommand.js +43 -0
  178. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellwidthcommand.js +51 -0
  179. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/tablecellpropertiesediting.js +204 -0
  180. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/tablecellpropertiesui.js +401 -0
  181. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/ui/tablecellpropertiesview.js +829 -0
  182. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties.js +80 -0
  183. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableclipboard.js +586 -0
  184. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableediting.js +160 -0
  185. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablekeyboard.js +343 -0
  186. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablemouse/mouseeventsobserver.js +72 -0
  187. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablemouse.js +218 -0
  188. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablealignmentcommand.js +35 -0
  189. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablebackgroundcolorcommand.js +35 -0
  190. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablebordercolorcommand.js +47 -0
  191. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tableborderstylecommand.js +47 -0
  192. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tableborderwidthcommand.js +62 -0
  193. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tableheightcommand.js +51 -0
  194. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablepropertycommand.js +98 -0
  195. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablewidthcommand.js +51 -0
  196. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/tablepropertiesediting.js +182 -0
  197. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/tablepropertiesui.js +397 -0
  198. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/ui/tablepropertiesview.js +714 -0
  199. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties.js +81 -0
  200. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableselection.js +357 -0
  201. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tabletoolbar.js +111 -0
  202. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableui.js +359 -0
  203. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableutils.js +909 -0
  204. package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablewalker.js +538 -0
  205. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/colorinput.css +39 -0
  206. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/form.css +11 -0
  207. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/formrow.css +23 -0
  208. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-cell-properties.svg +1 -0
  209. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-column.svg +1 -0
  210. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-merge-cell.svg +1 -0
  211. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-properties.svg +1 -0
  212. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-row.svg +1 -0
  213. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table.svg +1 -0
  214. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/inserttable.css +10 -0
  215. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/snippet.css +3876 -0
  216. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/table.css +67 -0
  217. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tablecaption.css +53 -0
  218. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tablecellproperties.css +28 -0
  219. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableediting.css +10 -0
  220. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableform.css +59 -0
  221. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableproperties.css +18 -0
  222. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableselection.css +10 -0
  223. package/src/assets/qms-ckeditor-plugin/src/plugins/table/ui/colorinputview.js +343 -0
  224. package/src/assets/qms-ckeditor-plugin/src/plugins/table/ui/formrowview.js +103 -0
  225. package/src/assets/qms-ckeditor-plugin/src/plugins/table/ui/inserttableview.js +222 -0
  226. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/common.js +57 -0
  227. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/selection.js +276 -0
  228. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/structure.js +543 -0
  229. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/table-properties.js +66 -0
  230. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/ui/contextualballoon.js +130 -0
  231. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/ui/table-properties.js +397 -0
  232. package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/ui/widget.js +62 -0
  233. package/src/lib/components/breadcrumb/breadcrumb.scss +2 -1
  234. package/src/lib/components/button/_button-base.scss +45 -52
  235. package/src/lib/components/button/_button-theme.scss +4 -2
  236. package/src/lib/components/button/button-icon.scss +17 -14
  237. package/src/lib/components/button/button-toggle.scss +64 -115
  238. package/src/lib/components/comment/comment.scss +3 -2
  239. package/src/lib/components/dialog/dialog.scss +2 -1
  240. package/src/lib/components/list/_list-base.scss +2 -2
  241. package/src/lib/components/list/_list-expansion.scss +33 -7
  242. package/src/lib/components/list/list.scss +21 -4
  243. package/src/lib/components/qms-paginator/qms-paginator.component.scss +4 -1
  244. package/src/lib/components/related/content/related-content.component.scss +4 -2
  245. package/src/lib/components/related/list-other-related/list-related.component.scss +7 -6
  246. package/src/lib/components/related/popup/related-popup.component.scss +10 -9
  247. package/src/lib/components/related/risk/analysis/analysis.component.scss +4 -3
  248. package/src/lib/components/related/risk/list/list.component.scss +7 -6
  249. package/src/lib/components/related/risk/result/result.component.scss +9 -8
  250. package/src/lib/components/rich-text/rich-text.scss +3 -2
  251. package/src/lib/components/select-dialog/select-dialog.scss +5 -5
  252. package/src/lib/components/select-include-children/select-include-children.component.scss +10 -9
  253. package/src/lib/components/select-one/select-one.component.scss +5 -4
  254. package/src/lib/components/select-process-document/select-process-document.component.scss +12 -12
  255. package/src/lib/components/substance-conflict/substance-conflict.component.scss +4 -3
  256. package/src/lib/components/table/table.scss +4 -3
  257. package/src/lib/components/tooltip/tooltip.scss +3 -1
  258. package/src/lib/components/tree/tree.component.scss +12 -12
  259. package/src/lib/components/treeNew/tree.component.scss +11 -18
  260. package/src/lib/qms-ckeditor-components/qms-ckeditor.component.scss +3 -2
  261. package/src/lib/qms-ckeditor-components/styles/_modules.scss +9 -0
  262. package/src/themes/_non-bg-scrollbar.scss +4 -3
  263. package/src/themes/core/_app-bar.scss +5 -4
  264. package/src/themes/core/_button.scss +14 -12
  265. package/src/themes/core/_checkbox.scss +9 -24
  266. package/src/themes/core/_chip-input.scss +29 -27
  267. package/src/themes/core/_chip.scss +12 -10
  268. package/src/themes/core/_date-picker.scss +9 -8
  269. package/src/themes/core/_dropdown-menu.scss +12 -11
  270. package/src/themes/core/_file-upload.scss +12 -11
  271. package/src/themes/core/_form-prefix.scss +6 -4
  272. package/src/themes/core/_form.scss +28 -27
  273. package/src/themes/core/_mat-icon.scss +60 -60
  274. package/src/themes/core/_progress.scss +5 -3
  275. package/src/themes/core/_radio.scss +13 -15
  276. package/src/themes/core/_range-slider.scss +34 -33
  277. package/src/themes/core/_scrollbar.scss +25 -34
  278. package/src/themes/core/_search-field.scss +5 -3
  279. package/src/themes/core/_select.scss +5 -2
  280. package/src/themes/core/_slide-toggle.scss +10 -11
  281. package/src/themes/core/_styles.scss +19 -17
  282. package/src/themes/core/_tab.scss +88 -87
  283. package/src/themes/core/_table.scss +89 -20
  284. package/src/themes/core/_text-block.scss +3 -1
  285. package/src/themes/core/_typography.scss +108 -108
  286. package/src/themes/theme/_mixins.scss +18 -0
  287. package/src/themes/theme/_theme.scss +17 -0
  288. package/src/themes/theme/_variable.scss +303 -0
  289. package/src/assets/fonts/OpenSans/OpenSans.woff2 +0 -0
  290. package/src/themes/_color.scss +0 -61
  291. package/src/themes/_scrollbar.scss +0 -27
  292. package/src/themes/core/_colors.scss +0 -60
@@ -0,0 +1,218 @@
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/tablemouse
8
+ */
9
+
10
+ import { Plugin } from 'ckeditor5/src/core';
11
+
12
+ import TableSelection from './tableselection';
13
+ import MouseEventsObserver from './tablemouse/mouseeventsobserver';
14
+
15
+ import { getTableCellsContainingSelection } from './utils/selection';
16
+
17
+ /**
18
+ * This plugin enables a table cells' selection with the mouse.
19
+ * It is loaded automatically by the {@link module:table/table~Table} plugin.
20
+ *
21
+ * @extends module:core/plugin~Plugin
22
+ */
23
+ export default class TableMouse extends Plugin {
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get pluginName() {
28
+ return 'TableMouse';
29
+ }
30
+
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ static get requires() {
35
+ return [ TableSelection ];
36
+ }
37
+
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ init() {
42
+ const editor = this.editor;
43
+
44
+ // Currently the MouseObserver only handles `mousedown` and `mouseup` events.
45
+ // TODO move to the engine?
46
+ editor.editing.view.addObserver( MouseEventsObserver );
47
+
48
+ this._enableShiftClickSelection();
49
+ this._enableMouseDragSelection();
50
+ }
51
+
52
+ /**
53
+ * Enables making cells selection by <kbd>Shift</kbd>+click. Creates a selection from the cell which previously held
54
+ * the selection to the cell which was clicked. It can be the same cell, in which case it selects a single cell.
55
+ *
56
+ * @private
57
+ */
58
+ _enableShiftClickSelection() {
59
+ const editor = this.editor;
60
+ let blockSelectionChange = false;
61
+
62
+ const tableSelection = editor.plugins.get( TableSelection );
63
+
64
+ this.listenTo( editor.editing.view.document, 'mousedown', ( evt, domEventData ) => {
65
+ if ( !this.isEnabled || !tableSelection.isEnabled ) {
66
+ return;
67
+ }
68
+
69
+ if ( !domEventData.domEvent.shiftKey ) {
70
+ return;
71
+ }
72
+
73
+ const anchorCell = tableSelection.getAnchorCell() || getTableCellsContainingSelection( editor.model.document.selection )[ 0 ];
74
+
75
+ if ( !anchorCell ) {
76
+ return;
77
+ }
78
+
79
+ const targetCell = this._getModelTableCellFromDomEvent( domEventData );
80
+
81
+ if ( targetCell && haveSameTableParent( anchorCell, targetCell ) ) {
82
+ blockSelectionChange = true;
83
+ tableSelection.setCellSelection( anchorCell, targetCell );
84
+
85
+ domEventData.preventDefault();
86
+ }
87
+ } );
88
+
89
+ this.listenTo( editor.editing.view.document, 'mouseup', () => {
90
+ blockSelectionChange = false;
91
+ } );
92
+
93
+ // We need to ignore a `selectionChange` event that is fired after we render our new table cells selection.
94
+ // When downcasting table cells selection to the view, we put the view selection in the last selected cell
95
+ // in a place that may not be natively a "correct" location. This is – we put it directly in the `<td>` element.
96
+ // All browsers fire the native `selectionchange` event.
97
+ // However, all browsers except Safari return the selection in the exact place where we put it
98
+ // (even though it's visually normalized). Safari returns `<td><p>^foo` that makes our selection observer
99
+ // fire our `selectionChange` event (because the view selection that we set in the first step differs from the DOM selection).
100
+ // Since `selectionChange` is fired, we automatically update the model selection that moves it that paragraph.
101
+ // This breaks our dear cells selection.
102
+ //
103
+ // Theoretically this issue concerns only Safari that is the only browser that do normalize the selection.
104
+ // However, to avoid code branching and to have a good coverage for this event blocker, I enabled it for all browsers.
105
+ //
106
+ // Note: I'm keeping the `blockSelectionChange` state separately for shift+click and mouse drag (exact same logic)
107
+ // so I don't have to try to analyze whether they don't overlap in some weird cases. Probably they don't.
108
+ // But I have other things to do, like writing this comment.
109
+ this.listenTo( editor.editing.view.document, 'selectionChange', evt => {
110
+ if ( blockSelectionChange ) {
111
+ // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );
112
+
113
+ evt.stop();
114
+ }
115
+ }, { priority: 'highest' } );
116
+ }
117
+
118
+ /**
119
+ * Enables making cells selection by dragging.
120
+ *
121
+ * The selection is made only on mousemove. Mouse tracking is started on mousedown.
122
+ * However, the cells selection is enabled only after the mouse cursor left the anchor cell.
123
+ * Thanks to that normal text selection within one cell works just fine. However, you can still select
124
+ * just one cell by leaving the anchor cell and moving back to it.
125
+ *
126
+ * @private
127
+ */
128
+ _enableMouseDragSelection() {
129
+ const editor = this.editor;
130
+ let anchorCell, targetCell;
131
+ let beganCellSelection = false;
132
+ let blockSelectionChange = false;
133
+
134
+ const tableSelection = editor.plugins.get( TableSelection );
135
+
136
+ this.listenTo( editor.editing.view.document, 'mousedown', ( evt, domEventData ) => {
137
+ if ( !this.isEnabled || !tableSelection.isEnabled ) {
138
+ return;
139
+ }
140
+
141
+ // Make sure to not conflict with the shift+click listener and any other possible handler.
142
+ if ( domEventData.domEvent.shiftKey || domEventData.domEvent.ctrlKey || domEventData.domEvent.altKey ) {
143
+ return;
144
+ }
145
+
146
+ anchorCell = this._getModelTableCellFromDomEvent( domEventData );
147
+ } );
148
+
149
+ this.listenTo( editor.editing.view.document, 'mousemove', ( evt, domEventData ) => {
150
+ if ( !domEventData.domEvent.buttons ) {
151
+ return;
152
+ }
153
+
154
+ if ( !anchorCell ) {
155
+ return;
156
+ }
157
+
158
+ const newTargetCell = this._getModelTableCellFromDomEvent( domEventData );
159
+
160
+ if ( newTargetCell && haveSameTableParent( anchorCell, newTargetCell ) ) {
161
+ targetCell = newTargetCell;
162
+
163
+ // Switch to the cell selection mode after the mouse cursor left the anchor cell.
164
+ // Switch off only on mouseup (makes selecting a single cell possible).
165
+ if ( !beganCellSelection && targetCell != anchorCell ) {
166
+ beganCellSelection = true;
167
+ }
168
+ }
169
+
170
+ // Yep, not making a cell selection yet. See method docs.
171
+ if ( !beganCellSelection ) {
172
+ return;
173
+ }
174
+
175
+ blockSelectionChange = true;
176
+ tableSelection.setCellSelection( anchorCell, targetCell );
177
+
178
+ domEventData.preventDefault();
179
+ } );
180
+
181
+ this.listenTo( editor.editing.view.document, 'mouseup', () => {
182
+ beganCellSelection = false;
183
+ blockSelectionChange = false;
184
+ anchorCell = null;
185
+ targetCell = null;
186
+ } );
187
+
188
+ // See the explanation in `_enableShiftClickSelection()`.
189
+ this.listenTo( editor.editing.view.document, 'selectionChange', evt => {
190
+ if ( blockSelectionChange ) {
191
+ // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );
192
+
193
+ evt.stop();
194
+ }
195
+ }, { priority: 'highest' } );
196
+ }
197
+
198
+ /**
199
+ * Returns the model table cell element based on the target element of the passed DOM event.
200
+ *
201
+ * @private
202
+ * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
203
+ * @returns {module:engine/model/element~Element|undefined} Returns the table cell or `undefined`.
204
+ */
205
+ _getModelTableCellFromDomEvent( domEventData ) {
206
+ // Note: Work with positions (not element mapping) because the target element can be an attribute or other non-mapped element.
207
+ const viewTargetElement = domEventData.target;
208
+ const viewPosition = this.editor.editing.view.createPositionAt( viewTargetElement, 0 );
209
+ const modelPosition = this.editor.editing.mapper.toModelPosition( viewPosition );
210
+ const modelElement = modelPosition.parent;
211
+
212
+ return modelElement.findAncestor( 'tableCell', { includeSelf: true } );
213
+ }
214
+ }
215
+
216
+ function haveSameTableParent( cellA, cellB ) {
217
+ return cellA.parent.parent == cellB.parent.parent;
218
+ }
@@ -0,0 +1,35 @@
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/tableproperties/commands/tablealignmentcommand
8
+ */
9
+
10
+ import TablePropertyCommand from './tablepropertycommand';
11
+
12
+ /**
13
+ * The table alignment command.
14
+ *
15
+ * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as
16
+ * the `'tableAlignment'` editor command.
17
+ *
18
+ * To change the alignment of the selected table, execute the command:
19
+ *
20
+ * editor.execute( 'tableAlignment', {
21
+ * value: 'right'
22
+ * } );
23
+ *
24
+ * @extends module:table/tableproperties/commands/tablepropertycommand~TablePropertyCommand
25
+ */
26
+ export default class TableAlignmentCommand extends TablePropertyCommand {
27
+ /**
28
+ * Creates a new `TableAlignmentCommand` instance.
29
+ *
30
+ * @param {module:core/editor/editor~Editor} editor An editor in which this command will be used.
31
+ */
32
+ constructor( editor ) {
33
+ super( editor, 'alignment' );
34
+ }
35
+ }
@@ -0,0 +1,35 @@
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/tableproperties/commands/tablebackgroundcolorcommand
8
+ */
9
+
10
+ import TablePropertyCommand from './tablepropertycommand';
11
+
12
+ /**
13
+ * The table background color command.
14
+ *
15
+ * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as
16
+ * the `'tableBackgroundColor'` editor command.
17
+ *
18
+ * To change the background color of the selected table, execute the command:
19
+ *
20
+ * editor.execute( 'tableBackgroundColor', {
21
+ * value: '#f00'
22
+ * } );
23
+ *
24
+ * @extends module:table/tableproperties/commands/tablepropertycommand~TablePropertyCommand
25
+ */
26
+ export default class TableBackgroundColorCommand extends TablePropertyCommand {
27
+ /**
28
+ * Creates a new `TableBackgroundColorCommand` instance.
29
+ *
30
+ * @param {module:core/editor/editor~Editor} editor An editor in which this command will be used.
31
+ */
32
+ constructor( editor ) {
33
+ super( editor, 'backgroundColor' );
34
+ }
35
+ }
@@ -0,0 +1,47 @@
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/tableproperties/commands/tablebordercolorcommand
8
+ */
9
+
10
+ import TablePropertyCommand from './tablepropertycommand';
11
+ import { getSingleValue } from '../../utils/table-properties';
12
+
13
+ /**
14
+ * The table border color command.
15
+ *
16
+ * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as
17
+ * the `'tableBorderColor'` editor command.
18
+ *
19
+ * To change the border color of the selected table, execute the command:
20
+ *
21
+ * editor.execute( 'tableBorderColor', {
22
+ * value: '#f00'
23
+ * } );
24
+ *
25
+ * @extends module:table/tableproperties/commands/tablepropertycommand~TablePropertyCommand
26
+ */
27
+ export default class TableBorderColorCommand extends TablePropertyCommand {
28
+ /**
29
+ * Creates a new `TableBorderColorCommand` instance.
30
+ *
31
+ * @param {module:core/editor/editor~Editor} editor An editor in which this command will be used.
32
+ */
33
+ constructor( editor ) {
34
+ super( editor, 'borderColor' );
35
+ }
36
+
37
+ /**
38
+ * @inheritDoc
39
+ */
40
+ _getValue( table ) {
41
+ if ( !table ) {
42
+ return;
43
+ }
44
+
45
+ return getSingleValue( table.getAttribute( this.attributeName ) );
46
+ }
47
+ }
@@ -0,0 +1,47 @@
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/tableproperties/commands/tableborderstylecommand
8
+ */
9
+
10
+ import TablePropertyCommand from './tablepropertycommand';
11
+ import { getSingleValue } from '../../utils/table-properties';
12
+
13
+ /**
14
+ * The table style border command.
15
+ *
16
+ * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as
17
+ * the `'tableBorderStyle'` editor command.
18
+ *
19
+ * To change the border style of the selected table, execute the command:
20
+ *
21
+ * editor.execute( 'tableBorderStyle', {
22
+ * value: 'dashed'
23
+ * } );
24
+ *
25
+ * @extends module:table/tableproperties/commands/tablepropertycommand~TablePropertyCommand
26
+ */
27
+ export default class TableBorderStyleCommand extends TablePropertyCommand {
28
+ /**
29
+ * Creates a new `TableBorderStyleCommand` instance.
30
+ *
31
+ * @param {module:core/editor/editor~Editor} editor An editor in which this command will be used.
32
+ */
33
+ constructor( editor ) {
34
+ super( editor, 'borderStyle' );
35
+ }
36
+
37
+ /**
38
+ * @inheritDoc
39
+ */
40
+ _getValue( table ) {
41
+ if ( !table ) {
42
+ return;
43
+ }
44
+
45
+ return getSingleValue( table.getAttribute( this.attributeName ) );
46
+ }
47
+ }
@@ -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/tableproperties/commands/tableborderwidthcommand
8
+ */
9
+
10
+ import TablePropertyCommand from './tablepropertycommand';
11
+ import { addDefaultUnitToNumericValue, getSingleValue } from '../../utils/table-properties';
12
+
13
+ /**
14
+ * The table width border command.
15
+ *
16
+ * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as
17
+ * the `'tableBorderWidth'` editor command.
18
+ *
19
+ * To change the border width of the selected table, execute the command:
20
+ *
21
+ * editor.execute( 'tableBorderWidth', {
22
+ * value: '5px'
23
+ * } );
24
+ *
25
+ * **Note**: This command adds the default `'px'` unit to numeric values. Executing:
26
+ *
27
+ * editor.execute( 'tableBorderWidth', {
28
+ * value: '5'
29
+ * } );
30
+ *
31
+ * will set the `borderWidth` attribute to `'5px'` in the model.
32
+ *
33
+ * @extends module:table/tableproperties/commands/tablepropertycommand~TablePropertyCommand
34
+ */
35
+ export default class TableBorderWidthCommand extends TablePropertyCommand {
36
+ /**
37
+ * Creates a new `TableBorderWidthCommand` instance.
38
+ *
39
+ * @param {module:core/editor/editor~Editor} editor An editor in which this command will be used.
40
+ */
41
+ constructor( editor ) {
42
+ super( editor, 'borderWidth' );
43
+ }
44
+
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ _getValue( table ) {
49
+ if ( !table ) {
50
+ return;
51
+ }
52
+
53
+ return getSingleValue( table.getAttribute( this.attributeName ) );
54
+ }
55
+
56
+ /**
57
+ * @inheritDoc
58
+ */
59
+ _getValueToSet( value ) {
60
+ return addDefaultUnitToNumericValue( value, 'px' );
61
+ }
62
+ }
@@ -0,0 +1,51 @@
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/tableproperties/commands/tableheightcommand
8
+ */
9
+
10
+ import TablePropertyCommand from './tablepropertycommand';
11
+ import { addDefaultUnitToNumericValue } from '../../utils/table-properties';
12
+
13
+ /**
14
+ * The table height command.
15
+ *
16
+ * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as
17
+ * the `'tableHeight'` editor command.
18
+ *
19
+ * To change the height of the selected table, execute the command:
20
+ *
21
+ * editor.execute( 'tableHeight', {
22
+ * value: '500px'
23
+ * } );
24
+ *
25
+ * **Note**: This command adds the default `'px'` unit to numeric values. Executing:
26
+ *
27
+ * editor.execute( 'tableHeight', {
28
+ * value: '50'
29
+ * } );
30
+ *
31
+ * will set the `height` attribute to `'50px'` in the model.
32
+ *
33
+ * @extends module:table/tableproperties/commands/tablepropertycommand~TablePropertyCommand
34
+ */
35
+ export default class TableHeightCommand extends TablePropertyCommand {
36
+ /**
37
+ * Creates a new `TableHeightCommand` instance.
38
+ *
39
+ * @param {module:core/editor/editor~Editor} editor An editor in which this command will be used.
40
+ */
41
+ constructor( editor ) {
42
+ super( editor, 'height' );
43
+ }
44
+
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ _getValueToSet( value ) {
49
+ return addDefaultUnitToNumericValue( value, 'px' );
50
+ }
51
+ }
@@ -0,0 +1,98 @@
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/tableproperties/commands/tablepropertycommand
8
+ */
9
+
10
+ import { Command } from 'ckeditor5/src/core';
11
+
12
+ /**
13
+ * The table cell attribute command.
14
+ *
15
+ * This command is a base command for other table property commands.
16
+ *
17
+ * @extends module:core/command~Command
18
+ */
19
+ export default class TablePropertyCommand extends Command {
20
+ /**
21
+ * Creates a new `TablePropertyCommand` instance.
22
+ *
23
+ * @param {module:core/editor/editor~Editor} editor An editor in which this command will be used.
24
+ * @param {String} attributeName Table cell attribute name.
25
+ */
26
+ constructor( editor, attributeName ) {
27
+ super( editor );
28
+
29
+ this.attributeName = attributeName;
30
+ }
31
+
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ refresh() {
36
+ const editor = this.editor;
37
+ const selection = editor.model.document.selection;
38
+
39
+ const table = selection.getFirstPosition().findAncestor( 'table' );
40
+
41
+ this.isEnabled = !!table;
42
+ this.value = this._getValue( table );
43
+ }
44
+
45
+ /**
46
+ * Executes the command.
47
+ *
48
+ * @fires execute
49
+ * @param {Object} [options]
50
+ * @param {*} [options.value] If set, the command will set the attribute on the selected table.
51
+ * If not set, the command will remove the attribute from the selected table.
52
+ * @param {module:engine/model/batch~Batch} [options.batch] Pass the model batch instance to the command to aggregate changes,
53
+ * for example, to allow a single undo step for multiple executions.
54
+ */
55
+ execute( options = {} ) {
56
+ const model = this.editor.model;
57
+ const selection = model.document.selection;
58
+
59
+ const { value, batch } = options;
60
+
61
+ const table = selection.getFirstPosition().findAncestor( 'table' );
62
+ const valueToSet = this._getValueToSet( value );
63
+
64
+ model.enqueueChange( batch || 'default', writer => {
65
+ if ( valueToSet ) {
66
+ writer.setAttribute( this.attributeName, valueToSet, table );
67
+ } else {
68
+ writer.removeAttribute( this.attributeName, table );
69
+ }
70
+ } );
71
+ }
72
+
73
+ /**
74
+ * Returns the attribute value for a table.
75
+ *
76
+ * @param {module:engine/model/element~Element} table
77
+ * @returns {String|undefined}
78
+ * @private
79
+ */
80
+ _getValue( table ) {
81
+ if ( !table ) {
82
+ return;
83
+ }
84
+
85
+ return table.getAttribute( this.attributeName );
86
+ }
87
+
88
+ /**
89
+ * Returns the proper model value. It can be used to add a default unit to numeric values.
90
+ *
91
+ * @private
92
+ * @param {*} value
93
+ * @returns {*}
94
+ */
95
+ _getValueToSet( value ) {
96
+ return value;
97
+ }
98
+ }
@@ -0,0 +1,51 @@
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/tableproperties/commands/tablewidthcommand
8
+ */
9
+
10
+ import TablePropertyCommand from './tablepropertycommand';
11
+ import { addDefaultUnitToNumericValue } from '../../utils/table-properties';
12
+
13
+ /**
14
+ * The table width command.
15
+ *
16
+ * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as
17
+ * the `'tableWidth'` editor command.
18
+ *
19
+ * To change the width of the selected table, execute the command:
20
+ *
21
+ * editor.execute( 'tableWidth', {
22
+ * value: '400px'
23
+ * } );
24
+ *
25
+ * **Note**: This command adds the default `'px'` unit to numeric values. Executing:
26
+ *
27
+ * editor.execute( 'tableWidth', {
28
+ * value: '50'
29
+ * } );
30
+ *
31
+ * will set the `width` attribute to `'50px'` in the model.
32
+ *
33
+ * @extends module:table/tableproperties/commands/tablepropertycommand~TablePropertyCommand
34
+ */
35
+ export default class TableWidthCommand extends TablePropertyCommand {
36
+ /**
37
+ * Creates a new `TableWidthCommand` instance.
38
+ *
39
+ * @param {module:core/editor/editor~Editor} editor An editor in which this command will be used.
40
+ */
41
+ constructor( editor ) {
42
+ super( editor, 'width' );
43
+ }
44
+
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ _getValueToSet( value ) {
49
+ return addDefaultUnitToNumericValue( value, 'px' );
50
+ }
51
+ }