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.
- package/README.md +5 -1
- package/bundles/qms-angular.umd.js +262 -87
- package/bundles/qms-angular.umd.js.map +1 -1
- package/esm2015/lib/common/themes.const.js +3 -0
- package/esm2015/lib/components/badges/qms-badges.component.js +1 -1
- package/esm2015/lib/components/banner/qms-banner/qms-banner.component.js +1 -1
- package/esm2015/lib/components/banner/qms-banner-confirm/qms-banner-confirm.component.js +1 -1
- package/esm2015/lib/components/banner/qms-banner-loading/qms-banner-loading.component.js +1 -1
- package/esm2015/lib/components/button/button-toggle.js +1 -1
- package/esm2015/lib/components/button/button.js +3 -3
- package/esm2015/lib/components/comment/comment.js +1 -1
- package/esm2015/lib/components/dialog/dialog.js +2 -2
- package/esm2015/lib/components/list/list.js +5 -3
- package/esm2015/lib/components/qms-paginator/qms-paginator.component.js +16 -7
- package/esm2015/lib/components/related/content/related-content.component.js +1 -1
- package/esm2015/lib/components/related/list-other-related/list-related.component.js +1 -1
- package/esm2015/lib/components/related/popup/related-popup.component.js +1 -1
- package/esm2015/lib/components/related/risk/analysis/analysis.component.js +1 -1
- package/esm2015/lib/components/related/risk/list/list.component.js +1 -1
- package/esm2015/lib/components/related/risk/result/result.component.js +1 -1
- package/esm2015/lib/components/rich-text/rich-text.js +1 -1
- package/esm2015/lib/components/select-dialog/select-dialog.js +1 -1
- package/esm2015/lib/components/select-include-children/select-include-children.component.js +1 -1
- package/esm2015/lib/components/select-one/select-one.component.js +1 -1
- package/esm2015/lib/components/select-process-document/select-process-document.component.js +1 -1
- package/esm2015/lib/components/table/table-action.js +2 -2
- package/esm2015/lib/components/tooltip/tooltip.js +1 -1
- package/esm2015/lib/components/tree/tree.component.js +1 -1
- package/esm2015/lib/components/treeNew/tree.component.js +18 -2
- package/esm2015/lib/directives/text-truncate/text-truncate.directive.js +58 -0
- package/esm2015/lib/qms-angular.module.js +4 -1
- package/esm2015/lib/qms-ckeditor-components/common/functions/common.function.js +34 -1
- package/esm2015/lib/qms-ckeditor-components/common/module/confirm/qms-ckeditor-confirm.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/attachments/link-attachment.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +5 -3
- package/esm2015/lib/services/theming.service.js +36 -0
- package/esm2015/lib/shared.module.js +1 -1
- package/esm2015/public-api.js +4 -1
- package/fesm2015/qms-angular.js +212 -56
- package/fesm2015/qms-angular.js.map +1 -1
- package/lib/common/themes.const.d.ts +2 -0
- package/lib/components/list/list.d.ts +1 -1
- package/lib/components/qms-paginator/qms-paginator.component.d.ts +1 -0
- package/lib/components/treeNew/tree.component.d.ts +1 -0
- package/lib/directives/text-truncate/text-truncate.directive.d.ts +15 -0
- package/lib/qms-ckeditor-components/common/functions/common.function.d.ts +12 -0
- package/lib/services/theming.service.d.ts +7 -0
- package/lib.theme.scss +181 -4
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
- package/qms-angular.metadata.json +1 -1
- package/src/assets/fonts/Material/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2 +0 -0
- package/src/assets/fonts/Material/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUce.woff2 +0 -0
- package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFUZ0bbck.woff2 +0 -0
- package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFVZ0b.woff2 +0 -0
- package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFVp0bbck.woff2 +0 -0
- package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFW50bbck.woff2 +0 -0
- package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFWJ0bbck.woff2 +0 -0
- package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFWZ0bbck.woff2 +0 -0
- package/src/assets/fonts/OpenSans/mem8YaGs126MiZpBA-UFWp0bbck.woff2 +0 -0
- package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCFPrEHJA.woff2 +0 -0
- package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCGPrEHJA.woff2 +0 -0
- package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCHPrEHJA.woff2 +0 -0
- package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrE.woff2 +0 -0
- package/src/assets/fonts/Raleway/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCMPrEHJA.woff2 +0 -0
- package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ar.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/az.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/bg.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ca.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/cs.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/da.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/de-ch.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/de.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/el.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/en-au.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/en-gb.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/eo.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/es.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/et.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/eu.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/fa.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/fi.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/fr.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/gl.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/he.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/hi.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/hr.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/hu.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/id.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/it.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ja.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/km.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/kn.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ko.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ku.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/lt.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/lv.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/nb.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ne.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/nl.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/no.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/pl.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/pt-br.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/pt.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ro.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ru.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/sk.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/sl.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/sq.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/sr-latn.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/sr.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/sv.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/th.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/tk.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/tr.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ug.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/uk.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/vi.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/zh-cn.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/zh.js +1 -1
- package/src/assets/qms-ckeditor-plugin/package-lock.json +0 -2
- package/src/assets/qms-ckeditor-plugin/package.json +0 -2
- package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +6 -6
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/heading.js +119 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingbuttonsui.js +103 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingcommand.js +96 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingediting.js +163 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingui.js +115 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/index.js +22 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/heading.css +35 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading1.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading2.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading3.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading4.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading5.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/theme/icons/heading6.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/title.js +598 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/utils.js +42 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/insertcolumncommand.js +83 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/insertrowcommand.js +82 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/inserttablecommand.js +76 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/mergecellcommand.js +272 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/mergecellscommand.js +122 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/removecolumncommand.js +122 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/removerowcommand.js +97 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/selectcolumncommand.js +63 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/selectrowcommand.js +56 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/setheadercolumncommand.js +95 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/setheaderrowcommand.js +105 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/commands/splitcellcommand.js +68 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/downcast.js +529 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-cell-paragraph-post-fixer.js +136 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-cell-refresh-post-fixer.js +75 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-heading-rows-refresh-post-fixer.js +55 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/table-layout-post-fixer.js +399 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/tableproperties.js +126 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/converters/upcasttable.js +211 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/index.js +42 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/table.js +103 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +35 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellbordercolorcommand.js +47 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellborderstylecommand.js +47 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellborderwidthcommand.js +62 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellheightcommand.js +51 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +35 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellpaddingcommand.js +62 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellpropertycommand.js +110 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellverticalalignmentcommand.js +43 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/commands/tablecellwidthcommand.js +51 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/tablecellpropertiesediting.js +204 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/tablecellpropertiesui.js +401 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties/ui/tablecellpropertiesview.js +829 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablecellproperties.js +80 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableclipboard.js +586 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableediting.js +160 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablekeyboard.js +343 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablemouse/mouseeventsobserver.js +72 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablemouse.js +218 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablealignmentcommand.js +35 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablebackgroundcolorcommand.js +35 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablebordercolorcommand.js +47 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tableborderstylecommand.js +47 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tableborderwidthcommand.js +62 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tableheightcommand.js +51 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablepropertycommand.js +98 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/commands/tablewidthcommand.js +51 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/tablepropertiesediting.js +182 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/tablepropertiesui.js +397 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/ui/tablepropertiesview.js +714 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties.js +81 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableselection.js +357 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tabletoolbar.js +111 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableui.js +359 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableutils.js +909 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/tablewalker.js +538 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/colorinput.css +39 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/form.css +11 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/formrow.css +23 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-cell-properties.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-column.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-merge-cell.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-properties.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table-row.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/icons/table.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/inserttable.css +10 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/snippet.css +3876 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/table.css +67 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tablecaption.css +53 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tablecellproperties.css +28 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableediting.css +10 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableform.css +59 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableproperties.css +18 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/tableselection.css +10 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/ui/colorinputview.js +343 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/ui/formrowview.js +103 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/ui/inserttableview.js +222 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/common.js +57 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/selection.js +276 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/structure.js +543 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/table-properties.js +66 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/ui/contextualballoon.js +130 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/ui/table-properties.js +397 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/utils/ui/widget.js +62 -0
- package/src/lib/components/breadcrumb/breadcrumb.scss +2 -1
- package/src/lib/components/button/_button-base.scss +45 -52
- package/src/lib/components/button/_button-theme.scss +4 -2
- package/src/lib/components/button/button-icon.scss +17 -14
- package/src/lib/components/button/button-toggle.scss +64 -115
- package/src/lib/components/comment/comment.scss +3 -2
- package/src/lib/components/dialog/dialog.scss +2 -1
- package/src/lib/components/list/_list-base.scss +2 -2
- package/src/lib/components/list/_list-expansion.scss +33 -7
- package/src/lib/components/list/list.scss +21 -4
- package/src/lib/components/qms-paginator/qms-paginator.component.scss +4 -1
- package/src/lib/components/related/content/related-content.component.scss +4 -2
- package/src/lib/components/related/list-other-related/list-related.component.scss +7 -6
- package/src/lib/components/related/popup/related-popup.component.scss +10 -9
- package/src/lib/components/related/risk/analysis/analysis.component.scss +4 -3
- package/src/lib/components/related/risk/list/list.component.scss +7 -6
- package/src/lib/components/related/risk/result/result.component.scss +9 -8
- package/src/lib/components/rich-text/rich-text.scss +3 -2
- package/src/lib/components/select-dialog/select-dialog.scss +5 -5
- package/src/lib/components/select-include-children/select-include-children.component.scss +10 -9
- package/src/lib/components/select-one/select-one.component.scss +5 -4
- package/src/lib/components/select-process-document/select-process-document.component.scss +12 -12
- package/src/lib/components/substance-conflict/substance-conflict.component.scss +4 -3
- package/src/lib/components/table/table.scss +4 -3
- package/src/lib/components/tooltip/tooltip.scss +3 -1
- package/src/lib/components/tree/tree.component.scss +12 -12
- package/src/lib/components/treeNew/tree.component.scss +11 -18
- package/src/lib/qms-ckeditor-components/qms-ckeditor.component.scss +3 -2
- package/src/lib/qms-ckeditor-components/styles/_modules.scss +9 -0
- package/src/themes/_non-bg-scrollbar.scss +4 -3
- package/src/themes/core/_app-bar.scss +5 -4
- package/src/themes/core/_button.scss +14 -12
- package/src/themes/core/_checkbox.scss +9 -24
- package/src/themes/core/_chip-input.scss +29 -27
- package/src/themes/core/_chip.scss +12 -10
- package/src/themes/core/_date-picker.scss +9 -8
- package/src/themes/core/_dropdown-menu.scss +12 -11
- package/src/themes/core/_file-upload.scss +12 -11
- package/src/themes/core/_form-prefix.scss +6 -4
- package/src/themes/core/_form.scss +28 -27
- package/src/themes/core/_mat-icon.scss +60 -60
- package/src/themes/core/_progress.scss +5 -3
- package/src/themes/core/_radio.scss +13 -15
- package/src/themes/core/_range-slider.scss +34 -33
- package/src/themes/core/_scrollbar.scss +25 -34
- package/src/themes/core/_search-field.scss +5 -3
- package/src/themes/core/_select.scss +5 -2
- package/src/themes/core/_slide-toggle.scss +10 -11
- package/src/themes/core/_styles.scss +19 -17
- package/src/themes/core/_tab.scss +88 -87
- package/src/themes/core/_table.scss +89 -20
- package/src/themes/core/_text-block.scss +3 -1
- package/src/themes/core/_typography.scss +108 -108
- package/src/themes/theme/_mixins.scss +18 -0
- package/src/themes/theme/_theme.scss +17 -0
- package/src/themes/theme/_variable.scss +303 -0
- package/src/assets/fonts/OpenSans/OpenSans.woff2 +0 -0
- package/src/themes/_color.scss +0 -61
- package/src/themes/_scrollbar.scss +0 -27
- package/src/themes/core/_colors.scss +0 -60
@@ -0,0 +1,222 @@
|
|
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/ui/inserttableview
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { View } from 'ckeditor5/src/ui';
|
11
|
+
|
12
|
+
import '../../table/theme/inserttable.css';
|
13
|
+
|
14
|
+
/**
|
15
|
+
* The table size view.
|
16
|
+
*
|
17
|
+
* It renders a 10x10 grid to choose the inserted table size.
|
18
|
+
*
|
19
|
+
* @extends module:ui/view~View
|
20
|
+
* @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
|
21
|
+
*/
|
22
|
+
export default class InsertTableView extends View {
|
23
|
+
/**
|
24
|
+
* @inheritDoc
|
25
|
+
*/
|
26
|
+
constructor( locale ) {
|
27
|
+
super( locale );
|
28
|
+
|
29
|
+
const bind = this.bindTemplate;
|
30
|
+
|
31
|
+
/**
|
32
|
+
* A collection of table size box items.
|
33
|
+
*
|
34
|
+
* @readonly
|
35
|
+
* @member {module:ui/viewcollection~ViewCollection}
|
36
|
+
*/
|
37
|
+
this.items = this._createGridCollection();
|
38
|
+
|
39
|
+
/**
|
40
|
+
* The currently selected number of rows of the new table.
|
41
|
+
*
|
42
|
+
* @observable
|
43
|
+
* @member {Number} #rows
|
44
|
+
*/
|
45
|
+
this.set( 'rows', 0 );
|
46
|
+
|
47
|
+
/**
|
48
|
+
* The currently selected number of columns of the new table.
|
49
|
+
*
|
50
|
+
* @observable
|
51
|
+
* @member {Number} #columns
|
52
|
+
*/
|
53
|
+
this.set( 'columns', 0 );
|
54
|
+
|
55
|
+
/**
|
56
|
+
* The label text displayed under the boxes.
|
57
|
+
*
|
58
|
+
* @observable
|
59
|
+
* @member {String} #label
|
60
|
+
*/
|
61
|
+
this.bind( 'label' )
|
62
|
+
.to( this, 'columns', this, 'rows', ( columns, rows ) => `${ rows } × ${ columns }` );
|
63
|
+
|
64
|
+
this.setTemplate( {
|
65
|
+
tag: 'div',
|
66
|
+
attributes: {
|
67
|
+
class: [ 'ck' ]
|
68
|
+
},
|
69
|
+
|
70
|
+
children: [
|
71
|
+
{
|
72
|
+
tag: 'div',
|
73
|
+
attributes: {
|
74
|
+
class: [ 'ck-insert-table-dropdown__grid' ]
|
75
|
+
},
|
76
|
+
on: {
|
77
|
+
'mouseover@.ck-insert-table-dropdown-grid-box': bind.to( 'boxover' )
|
78
|
+
},
|
79
|
+
children: this.items
|
80
|
+
},
|
81
|
+
{
|
82
|
+
tag: 'div',
|
83
|
+
attributes: {
|
84
|
+
class: [ 'ck-insert-table-dropdown__label' ]
|
85
|
+
},
|
86
|
+
children: [
|
87
|
+
{
|
88
|
+
text: bind.to( 'label' )
|
89
|
+
}
|
90
|
+
]
|
91
|
+
}
|
92
|
+
],
|
93
|
+
|
94
|
+
on: {
|
95
|
+
mousedown: bind.to( evt => {
|
96
|
+
evt.preventDefault();
|
97
|
+
} ),
|
98
|
+
|
99
|
+
click: bind.to( () => {
|
100
|
+
this.fire( 'execute' );
|
101
|
+
} )
|
102
|
+
}
|
103
|
+
} );
|
104
|
+
|
105
|
+
this.on( 'boxover', ( evt, domEvt ) => {
|
106
|
+
const { row, column } = domEvt.target.dataset;
|
107
|
+
|
108
|
+
// As row & column indexes are zero-based transform it to number of selected rows & columns.
|
109
|
+
this.set( {
|
110
|
+
rows: parseInt( row ),
|
111
|
+
columns: parseInt( column )
|
112
|
+
} );
|
113
|
+
} );
|
114
|
+
|
115
|
+
this.on( 'change:columns', () => {
|
116
|
+
this._highlightGridBoxes();
|
117
|
+
} );
|
118
|
+
|
119
|
+
this.on( 'change:rows', () => {
|
120
|
+
this._highlightGridBoxes();
|
121
|
+
} );
|
122
|
+
}
|
123
|
+
|
124
|
+
/**
|
125
|
+
* @inheritDoc
|
126
|
+
*/
|
127
|
+
focus() {
|
128
|
+
// The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
|
129
|
+
// The method should be implemented while working on keyboard support for this view. See #22.
|
130
|
+
}
|
131
|
+
|
132
|
+
/**
|
133
|
+
* @inheritDoc
|
134
|
+
*/
|
135
|
+
focusLast() {
|
136
|
+
// The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
|
137
|
+
// The method should be implemented while working on keyboard support for this view. See #22.
|
138
|
+
}
|
139
|
+
|
140
|
+
/**
|
141
|
+
* Highlights grid boxes depending on rows and columns selected.
|
142
|
+
*
|
143
|
+
* @private
|
144
|
+
*/
|
145
|
+
_highlightGridBoxes() {
|
146
|
+
const rows = this.rows;
|
147
|
+
const columns = this.columns;
|
148
|
+
|
149
|
+
this.items.map( ( boxView, index ) => {
|
150
|
+
// Translate box index to the row & column index.
|
151
|
+
const itemRow = Math.floor( index / 10 );
|
152
|
+
const itemColumn = index % 10;
|
153
|
+
|
154
|
+
// Grid box is highlighted when its row & column index belongs to selected number of rows & columns.
|
155
|
+
const isOn = itemRow < rows && itemColumn < columns;
|
156
|
+
|
157
|
+
boxView.set( 'isOn', isOn );
|
158
|
+
} );
|
159
|
+
}
|
160
|
+
|
161
|
+
/**
|
162
|
+
* @private
|
163
|
+
* @returns {module:ui/viewcollection~ViewCollection} A view collection containing boxes to be placed in a table grid.
|
164
|
+
*/
|
165
|
+
_createGridCollection() {
|
166
|
+
const boxes = [];
|
167
|
+
|
168
|
+
// Add grid boxes to table selection view.
|
169
|
+
for ( let index = 0; index < 100; index++ ) {
|
170
|
+
const row = Math.floor( index / 10 );
|
171
|
+
const column = index % 10;
|
172
|
+
|
173
|
+
boxes.push( new TableSizeGridBoxView( this.locale, row + 1, column + 1 ) );
|
174
|
+
}
|
175
|
+
|
176
|
+
return this.createCollection( boxes );
|
177
|
+
}
|
178
|
+
|
179
|
+
/**
|
180
|
+
* Fired when the mouse hover over one of the {@link #items child grid boxes}.
|
181
|
+
*
|
182
|
+
* @event boxover
|
183
|
+
*/
|
184
|
+
}
|
185
|
+
|
186
|
+
/**
|
187
|
+
* A single grid box view element.
|
188
|
+
*
|
189
|
+
* This class is used to render the table size selection grid in {@link module:table/ui/inserttableview~InsertTableView}.
|
190
|
+
*
|
191
|
+
* @private
|
192
|
+
*/
|
193
|
+
class TableSizeGridBoxView extends View {
|
194
|
+
/**
|
195
|
+
* @inheritDoc
|
196
|
+
*/
|
197
|
+
constructor( locale, row, column ) {
|
198
|
+
super( locale );
|
199
|
+
|
200
|
+
const bind = this.bindTemplate;
|
201
|
+
|
202
|
+
/**
|
203
|
+
* Controls whether the grid box view is "on".
|
204
|
+
*
|
205
|
+
* @observable
|
206
|
+
* @member {Boolean} #isOn
|
207
|
+
*/
|
208
|
+
this.set( 'isOn', false );
|
209
|
+
|
210
|
+
this.setTemplate( {
|
211
|
+
tag: 'div',
|
212
|
+
attributes: {
|
213
|
+
class: [
|
214
|
+
'ck-insert-table-dropdown-grid-box',
|
215
|
+
bind.if( 'isOn', 'ck-on' )
|
216
|
+
],
|
217
|
+
'data-row': row,
|
218
|
+
'data-column': column
|
219
|
+
}
|
220
|
+
} );
|
221
|
+
}
|
222
|
+
}
|
@@ -0,0 +1,57 @@
|
|
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/common
|
8
|
+
*/
|
9
|
+
|
10
|
+
/**
|
11
|
+
* A common method to update the numeric value. If a value is the default one, it will be unset.
|
12
|
+
*
|
13
|
+
* @param {String} key An attribute key.
|
14
|
+
* @param {*} value The new attribute value.
|
15
|
+
* @param {module:engine/model/item~Item} item A model item on which the attribute will be set.
|
16
|
+
* @param {module:engine/model/writer~Writer} writer
|
17
|
+
* @param {*} defaultValue The default attribute value. If a value is lower or equal, it will be unset.
|
18
|
+
*/
|
19
|
+
export function updateNumericAttribute( key, value, item, writer, defaultValue = 1 ) {
|
20
|
+
if ( value > defaultValue ) {
|
21
|
+
writer.setAttribute( key, value, item );
|
22
|
+
} else {
|
23
|
+
writer.removeAttribute( key, item );
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
/**
|
28
|
+
* A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.
|
29
|
+
*
|
30
|
+
* @param {module:engine/model/writer~Writer} writer The model writer.
|
31
|
+
* @param {module:engine/model/position~Position} insertPosition The position at which the table cell should be inserted.
|
32
|
+
* @param {Object} attributes The element attributes.
|
33
|
+
* @returns {module:engine/model/element~Element} Created table cell.
|
34
|
+
*/
|
35
|
+
export function createEmptyTableCell( writer, insertPosition, attributes = {} ) {
|
36
|
+
const tableCell = writer.createElement( 'tableCell', attributes );
|
37
|
+
|
38
|
+
writer.insertElement( 'paragraph', tableCell );
|
39
|
+
writer.insert( tableCell, insertPosition );
|
40
|
+
|
41
|
+
return tableCell;
|
42
|
+
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Checks if a table cell belongs to the heading column section.
|
46
|
+
*
|
47
|
+
* @param {module:table/tableutils~TableUtils} tableUtils
|
48
|
+
* @param {module:engine/model/element~Element} tableCell
|
49
|
+
* @returns {Boolean}
|
50
|
+
*/
|
51
|
+
export function isHeadingColumnCell( tableUtils, tableCell ) {
|
52
|
+
const table = tableCell.parent.parent;
|
53
|
+
const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );
|
54
|
+
const { column } = tableUtils.getCellLocation( tableCell );
|
55
|
+
|
56
|
+
return !!headingColumns && column < headingColumns;
|
57
|
+
}
|
@@ -0,0 +1,276 @@
|
|
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/selection
|
8
|
+
*/
|
9
|
+
|
10
|
+
import TableWalker from '../tablewalker';
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Returns all model table cells that are fully selected (from the outside)
|
14
|
+
* within the provided model selection's ranges.
|
15
|
+
*
|
16
|
+
* To obtain the cells selected from the inside, use
|
17
|
+
* {@link module:table/utils/selection~getTableCellsContainingSelection}.
|
18
|
+
*
|
19
|
+
* @param {module:engine/model/selection~Selection} selection
|
20
|
+
* @returns {Array.<module:engine/model/element~Element>}
|
21
|
+
*/
|
22
|
+
export function getSelectedTableCells( selection ) {
|
23
|
+
const cells = [];
|
24
|
+
|
25
|
+
for ( const range of sortRanges( selection.getRanges() ) ) {
|
26
|
+
const element = range.getContainedElement();
|
27
|
+
|
28
|
+
if ( element && element.is( 'element', 'tableCell' ) ) {
|
29
|
+
cells.push( element );
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
return cells;
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Returns all model table cells that the provided model selection's ranges
|
38
|
+
* {@link module:engine/model/range~Range#start} inside.
|
39
|
+
*
|
40
|
+
* To obtain the cells selected from the outside, use
|
41
|
+
* {@link module:table/utils/selection~getSelectedTableCells}.
|
42
|
+
*
|
43
|
+
* @param {module:engine/model/selection~Selection} selection
|
44
|
+
* @returns {Array.<module:engine/model/element~Element>}
|
45
|
+
*/
|
46
|
+
export function getTableCellsContainingSelection( selection ) {
|
47
|
+
const cells = [];
|
48
|
+
|
49
|
+
for ( const range of selection.getRanges() ) {
|
50
|
+
const cellWithSelection = range.start.findAncestor( 'tableCell' );
|
51
|
+
|
52
|
+
if ( cellWithSelection ) {
|
53
|
+
cells.push( cellWithSelection );
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
return cells;
|
58
|
+
}
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Returns all model table cells that are either completely selected
|
62
|
+
* by selection ranges or host selection range
|
63
|
+
* {@link module:engine/model/range~Range#start start positions} inside them.
|
64
|
+
*
|
65
|
+
* Combines {@link module:table/utils/selection~getTableCellsContainingSelection} and
|
66
|
+
* {@link module:table/utils/selection~getSelectedTableCells}.
|
67
|
+
*
|
68
|
+
* @param {module:engine/model/selection~Selection} selection
|
69
|
+
* @returns {Array.<module:engine/model/element~Element>}
|
70
|
+
*/
|
71
|
+
export function getSelectionAffectedTableCells( selection ) {
|
72
|
+
const selectedCells = getSelectedTableCells( selection );
|
73
|
+
|
74
|
+
if ( selectedCells.length ) {
|
75
|
+
return selectedCells;
|
76
|
+
}
|
77
|
+
|
78
|
+
return getTableCellsContainingSelection( selection );
|
79
|
+
}
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Returns an object with the `first` and `last` row index contained in the given `tableCells`.
|
83
|
+
*
|
84
|
+
* const selectedTableCells = getSelectedTableCells( editor.model.document.selection );
|
85
|
+
*
|
86
|
+
* const { first, last } = getRowIndexes( selectedTableCells );
|
87
|
+
*
|
88
|
+
* console.log( `Selected rows: ${ first } to ${ last }` );
|
89
|
+
*
|
90
|
+
* @param {Array.<module:engine/model/element~Element>} tableCells
|
91
|
+
* @returns {Object} Returns an object with the `first` and `last` table row indexes.
|
92
|
+
*/
|
93
|
+
export function getRowIndexes( tableCells ) {
|
94
|
+
const indexes = tableCells.map( cell => cell.parent.index );
|
95
|
+
|
96
|
+
return getFirstLastIndexesObject( indexes );
|
97
|
+
}
|
98
|
+
|
99
|
+
/**
|
100
|
+
* Returns an object with the `first` and `last` column index contained in the given `tableCells`.
|
101
|
+
*
|
102
|
+
* const selectedTableCells = getSelectedTableCells( editor.model.document.selection );
|
103
|
+
*
|
104
|
+
* const { first, last } = getColumnIndexes( selectedTableCells );
|
105
|
+
*
|
106
|
+
* console.log( `Selected columns: ${ first } to ${ last }` );
|
107
|
+
*
|
108
|
+
* @param {Array.<module:engine/model/element~Element>} tableCells
|
109
|
+
* @returns {Object} Returns an object with the `first` and `last` table column indexes.
|
110
|
+
*/
|
111
|
+
export function getColumnIndexes( tableCells ) {
|
112
|
+
const table = tableCells[ 0 ].findAncestor( 'table' );
|
113
|
+
const tableMap = [ ...new TableWalker( table ) ];
|
114
|
+
|
115
|
+
const indexes = tableMap
|
116
|
+
.filter( entry => tableCells.includes( entry.cell ) )
|
117
|
+
.map( entry => entry.column );
|
118
|
+
|
119
|
+
return getFirstLastIndexesObject( indexes );
|
120
|
+
}
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Checks if the selection contains cells that do not exceed rectangular selection.
|
124
|
+
*
|
125
|
+
* In a table below:
|
126
|
+
*
|
127
|
+
* ┌───┬───┬───┬───┐
|
128
|
+
* │ a │ b │ c │ d │
|
129
|
+
* ├───┴───┼───┤ │
|
130
|
+
* │ e │ f │ │
|
131
|
+
* │ ├───┼───┤
|
132
|
+
* │ │ g │ h │
|
133
|
+
* └───────┴───┴───┘
|
134
|
+
*
|
135
|
+
* Valid selections are these which create a solid rectangle (without gaps), such as:
|
136
|
+
* - a, b (two horizontal cells)
|
137
|
+
* - c, f (two vertical cells)
|
138
|
+
* - a, b, e (cell "e" spans over four cells)
|
139
|
+
* - c, d, f (cell d spans over a cell in the row below)
|
140
|
+
*
|
141
|
+
* While an invalid selection would be:
|
142
|
+
* - a, c (the unselected cell "b" creates a gap)
|
143
|
+
* - f, g, h (cell "d" spans over a cell from the row of "f" cell - thus creates a gap)
|
144
|
+
*
|
145
|
+
* @param {Array.<module:engine/model/element~Element>} selectedTableCells
|
146
|
+
* @param {module:table/tableutils~TableUtils} tableUtils
|
147
|
+
* @returns {Boolean}
|
148
|
+
*/
|
149
|
+
export function isSelectionRectangular( selectedTableCells, tableUtils ) {
|
150
|
+
if ( selectedTableCells.length < 2 || !areCellInTheSameTableSection( selectedTableCells ) ) {
|
151
|
+
return false;
|
152
|
+
}
|
153
|
+
|
154
|
+
// A valid selection is a fully occupied rectangle composed of table cells.
|
155
|
+
// Below we will calculate the area of a selected table cells and the area of valid selection.
|
156
|
+
// The area of a valid selection is defined by top-left and bottom-right cells.
|
157
|
+
const rows = new Set();
|
158
|
+
const columns = new Set();
|
159
|
+
|
160
|
+
let areaOfSelectedCells = 0;
|
161
|
+
|
162
|
+
for ( const tableCell of selectedTableCells ) {
|
163
|
+
const { row, column } = tableUtils.getCellLocation( tableCell );
|
164
|
+
const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
|
165
|
+
const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
|
166
|
+
|
167
|
+
// Record row & column indexes of current cell.
|
168
|
+
rows.add( row );
|
169
|
+
columns.add( column );
|
170
|
+
|
171
|
+
// For cells that spans over multiple rows add also the last row that this cell spans over.
|
172
|
+
if ( rowspan > 1 ) {
|
173
|
+
rows.add( row + rowspan - 1 );
|
174
|
+
}
|
175
|
+
|
176
|
+
// For cells that spans over multiple columns add also the last column that this cell spans over.
|
177
|
+
if ( colspan > 1 ) {
|
178
|
+
columns.add( column + colspan - 1 );
|
179
|
+
}
|
180
|
+
|
181
|
+
areaOfSelectedCells += ( rowspan * colspan );
|
182
|
+
}
|
183
|
+
|
184
|
+
// We can only merge table cells that are in adjacent rows...
|
185
|
+
const areaOfValidSelection = getBiggestRectangleArea( rows, columns );
|
186
|
+
|
187
|
+
return areaOfValidSelection == areaOfSelectedCells;
|
188
|
+
}
|
189
|
+
|
190
|
+
/**
|
191
|
+
* Returns array of sorted ranges.
|
192
|
+
*
|
193
|
+
* @param {Iterable.<module:engine/model/range~Range>} ranges
|
194
|
+
* @return {Array.<module:engine/model/range~Range>}
|
195
|
+
*/
|
196
|
+
export function sortRanges( ranges ) {
|
197
|
+
return Array.from( ranges ).sort( compareRangeOrder );
|
198
|
+
}
|
199
|
+
|
200
|
+
// Helper method to get an object with `first` and `last` indexes from an unsorted array of indexes.
|
201
|
+
function getFirstLastIndexesObject( indexes ) {
|
202
|
+
const allIndexesSorted = indexes.sort( ( indexA, indexB ) => indexA - indexB );
|
203
|
+
|
204
|
+
const first = allIndexesSorted[ 0 ];
|
205
|
+
const last = allIndexesSorted[ allIndexesSorted.length - 1 ];
|
206
|
+
|
207
|
+
return { first, last };
|
208
|
+
}
|
209
|
+
|
210
|
+
function compareRangeOrder( rangeA, rangeB ) {
|
211
|
+
// Since table cell ranges are disjoint, it's enough to check their start positions.
|
212
|
+
const posA = rangeA.start;
|
213
|
+
const posB = rangeB.start;
|
214
|
+
|
215
|
+
// Checking for equal position (returning 0) is not needed because this would be either:
|
216
|
+
// a. Intersecting range (not allowed by model)
|
217
|
+
// b. Collapsed range on the same position (allowed by model but should not happen).
|
218
|
+
return posA.isBefore( posB ) ? -1 : 1;
|
219
|
+
}
|
220
|
+
|
221
|
+
// Calculates the area of a maximum rectangle that can span over the provided row & column indexes.
|
222
|
+
//
|
223
|
+
// @param {Array.<Number>} rows
|
224
|
+
// @param {Array.<Number>} columns
|
225
|
+
// @returns {Number}
|
226
|
+
function getBiggestRectangleArea( rows, columns ) {
|
227
|
+
const rowsIndexes = Array.from( rows.values() );
|
228
|
+
const columnIndexes = Array.from( columns.values() );
|
229
|
+
|
230
|
+
const lastRow = Math.max( ...rowsIndexes );
|
231
|
+
const firstRow = Math.min( ...rowsIndexes );
|
232
|
+
const lastColumn = Math.max( ...columnIndexes );
|
233
|
+
const firstColumn = Math.min( ...columnIndexes );
|
234
|
+
|
235
|
+
return ( lastRow - firstRow + 1 ) * ( lastColumn - firstColumn + 1 );
|
236
|
+
}
|
237
|
+
|
238
|
+
// Checks if the selection does not mix a header (column or row) with other cells.
|
239
|
+
//
|
240
|
+
// For instance, in the table below valid selections consist of cells with the same letter only.
|
241
|
+
// So, a-a (same heading row and column) or d-d (body cells) are valid while c-d or a-b are not.
|
242
|
+
//
|
243
|
+
// header columns
|
244
|
+
// ↓ ↓
|
245
|
+
// ┌───┬───┬───┬───┐
|
246
|
+
// │ a │ a │ b │ b │ ← header row
|
247
|
+
// ├───┼───┼───┼───┤
|
248
|
+
// │ c │ c │ d │ d │
|
249
|
+
// ├───┼───┼───┼───┤
|
250
|
+
// │ c │ c │ d │ d │
|
251
|
+
// └───┴───┴───┴───┘
|
252
|
+
function areCellInTheSameTableSection( tableCells ) {
|
253
|
+
const table = tableCells[ 0 ].findAncestor( 'table' );
|
254
|
+
|
255
|
+
const rowIndexes = getRowIndexes( tableCells );
|
256
|
+
const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
|
257
|
+
|
258
|
+
// Calculating row indexes is a bit cheaper so if this check fails we can't merge.
|
259
|
+
if ( !areIndexesInSameSection( rowIndexes, headingRows ) ) {
|
260
|
+
return false;
|
261
|
+
}
|
262
|
+
|
263
|
+
const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );
|
264
|
+
const columnIndexes = getColumnIndexes( tableCells );
|
265
|
+
|
266
|
+
// Similarly cells must be in same column section.
|
267
|
+
return areIndexesInSameSection( columnIndexes, headingColumns );
|
268
|
+
}
|
269
|
+
|
270
|
+
// Unified check if table rows/columns indexes are in the same heading/body section.
|
271
|
+
function areIndexesInSameSection( { first, last }, headingSectionSize ) {
|
272
|
+
const firstCellIsInHeading = first < headingSectionSize;
|
273
|
+
const lastCellIsInHeading = last < headingSectionSize;
|
274
|
+
|
275
|
+
return firstCellIsInHeading === lastCellIsInHeading;
|
276
|
+
}
|