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.
- package/README.md +5 -1
- package/bundles/qms-angular.umd.js +6943 -219
- package/bundles/qms-angular.umd.js.map +1 -1
- 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 +6 -3
- package/esm2015/lib/components/dialog/dialog.js +2 -2
- package/esm2015/lib/components/list/list.js +2 -2
- package/esm2015/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.js +3 -3
- package/esm2015/lib/components/qms-paginator/qms-paginator.component.js +16 -7
- package/esm2015/lib/components/related/content/related-content.component.js +2 -2
- package/esm2015/lib/components/related/list-other-related/list-related.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/table/table-action.js +2 -2
- package/esm2015/lib/components/table/table.module.js +4 -4
- 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/file-upload/file-upload-multiple-selector.directive.js +3 -1
- package/esm2015/lib/directives/file-upload/file-upload-selector.directive.js +3 -1
- package/esm2015/lib/directives/file-upload/file-upload.directive.js +1 -1
- package/esm2015/lib/directives/text-truncate/text-truncate.directive.js +58 -0
- package/esm2015/lib/model/en.js +63 -2
- package/esm2015/lib/model/no.js +63 -2
- package/esm2015/lib/qms-angular.module.js +4 -1
- package/esm2015/lib/qms-ckeditor-components/common/flowchart/config/halo.function.js +87 -0
- package/esm2015/lib/qms-ckeditor-components/common/flowchart/config/inspector.function.js +3767 -0
- package/esm2015/lib/qms-ckeditor-components/common/flowchart/config/selection.function.js +56 -0
- package/esm2015/lib/qms-ckeditor-components/common/flowchart/config/stencil.function.js +1003 -0
- package/esm2015/lib/qms-ckeditor-components/common/flowchart/config/toolbar.function.js +302 -0
- package/esm2015/lib/qms-ckeditor-components/common/flowchart/models/app-shapes.js +320 -0
- package/esm2015/lib/qms-ckeditor-components/common/flowchart/service/keyboard-service.js +69 -0
- package/esm2015/lib/qms-ckeditor-components/common/flowchart/service/kitchensink-service.js +412 -0
- package/esm2015/lib/qms-ckeditor-components/common/flowchart/themes/theme-picker.js +80 -0
- package/esm2015/lib/qms-ckeditor-components/common/functions/common.function.js +34 -1
- package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-save-as-template.model.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/common/module/confirm/qms-ckeditor-confirm.component.js +3 -3
- 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-bpmn/qms-ckeditor-bpmn.component.js +2 -2
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/save-template/save-template.component.js +2 -2
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-flowchart/qms-ckeditor-flowchart.component.js +317 -0
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.js +3 -3
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/attachments/link-attachment.component.js +3 -3
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +3 -3
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.js +3 -3
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.js +3 -3
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.js +3 -3
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +3 -3
- package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +35 -3
- package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.module.js +4 -2
- package/esm2015/public-api.js +8 -1
- package/esm2015/qms-angular.js +2 -1
- package/fesm2015/qms-angular.js +6882 -213
- package/fesm2015/qms-angular.js.map +1 -1
- package/lib/components/comment/comment.d.ts +1 -0
- 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/model/en.d.ts +61 -0
- package/lib/model/no.d.ts +61 -0
- package/lib/qms-ckeditor-components/common/flowchart/config/halo.function.d.ts +37 -0
- package/lib/qms-ckeditor-components/common/flowchart/config/inspector.function.d.ts +7 -0
- package/lib/qms-ckeditor-components/common/flowchart/config/selection.function.d.ts +39 -0
- package/lib/qms-ckeditor-components/common/flowchart/config/stencil.function.d.ts +11 -0
- package/lib/qms-ckeditor-components/common/flowchart/config/toolbar.function.d.ts +224 -0
- package/lib/qms-ckeditor-components/common/flowchart/models/app-shapes.d.ts +58 -0
- package/lib/qms-ckeditor-components/common/flowchart/service/keyboard-service.d.ts +16 -0
- package/lib/qms-ckeditor-components/common/flowchart/service/kitchensink-service.d.ts +56 -0
- package/lib/qms-ckeditor-components/common/flowchart/themes/theme-picker.d.ts +35 -0
- package/lib/qms-ckeditor-components/common/functions/common.function.d.ts +12 -0
- package/lib/qms-ckeditor-components/common/models/qms-ckeditor-save-as-template.model.d.ts +2 -0
- package/lib/qms-ckeditor-components/components/qms-ckeditor-flowchart/qms-ckeditor-flowchart.component.d.ts +41 -0
- package/lib/qms-ckeditor-components/qms-ckeditor.component.d.ts +4 -0
- package/lib.theme.scss +179 -0
- package/package.json +1 -1
- package/public-api.d.ts +7 -0
- package/qms-angular.d.ts +1 -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/jointjs/images/delete-icon-modern.png +0 -0
- package/src/assets/jointjs/images/reset-icon-modern.png +0 -0
- package/src/assets/jointjs/images/save-icon-modern.png +0 -0
- package/src/assets/jointjs/images/to-front-icon-modern.png +0 -0
- package/src/assets/jointjs/images/toback-icon-modern.png +0 -0
- package/src/assets/jointjs/images/toolbar-icons-material.png +0 -0
- package/src/assets/jointjs/images/toolbar-icons-modern.png +0 -0
- package/src/assets/jointjs/scss/rappid.scss +326 -0
- package/src/assets/jointjs/scss/theme-picker.scss +22 -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 +12632 -345
- package/src/assets/qms-ckeditor-plugin/package.json +0 -2
- package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +8 -8
- package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorService.js +9 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/flowchart/flowchartdialogcommand.js +47 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/flowchart/qmsCKEditorFlowchartPlugin.js +30 -0
- 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/assets/qms-ckeditor-plugin/src/themes/icons/flowchart.svg +507 -0
- package/src/lib/components/comment/comment.scss +1 -0
- package/src/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.scss +1 -0
- package/src/lib/components/qms-paginator/qms-paginator.component.scss +4 -1
- package/src/lib/qms-ckeditor-components/common/flowchart/assets/image-icon1.svg +1 -0
- package/src/lib/qms-ckeditor-components/common/flowchart/assets/image-icon2.svg +6 -0
- package/src/lib/qms-ckeditor-components/common/flowchart/assets/image-icon3.svg +11 -0
- package/src/lib/qms-ckeditor-components/common/flowchart/assets/image-icon4.svg +8 -0
- package/src/lib/qms-ckeditor-components/common/flowchart/assets/member-female.png +0 -0
- package/src/lib/qms-ckeditor-components/common/flowchart/assets/member-male.png +0 -0
- package/src/lib/qms-ckeditor-components/common/flowchart/assets/no-color-icon.svg +72 -0
- package/src/lib/qms-ckeditor-components/common/flowchart/assets/toolbar-icons-material.png +0 -0
- package/src/lib/qms-ckeditor-components/common/flowchart/assets/toolbar-icons-modern.png +0 -0
- package/src/lib/qms-ckeditor-components/common/flowchart/assets/transparent-icon.svg +50 -0
- package/src/lib/qms-ckeditor-components/components/qms-ckeditor-flowchart/qms-ckeditor-flowchart.component.scss +68 -0
- package/src/lib/qms-ckeditor-components/styles/_modules.scss +9 -0
- package/src/themes/core/_mat-icon.scss +60 -60
- package/src/themes/core/_table.scss +72 -4
- package/src/themes/core/_typography.scss +108 -108
@@ -0,0 +1,122 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module table/commands/removecolumncommand
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Command } from 'ckeditor5/src/core';
|
11
|
+
|
12
|
+
import TableWalker from '../tablewalker';
|
13
|
+
import { getColumnIndexes, getSelectionAffectedTableCells } from '../utils/selection';
|
14
|
+
|
15
|
+
/**
|
16
|
+
* The remove column command.
|
17
|
+
*
|
18
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableColumn'` editor command.
|
19
|
+
*
|
20
|
+
* To remove the column containing the selected cell, execute the command:
|
21
|
+
*
|
22
|
+
* editor.execute( 'removeTableColumn' );
|
23
|
+
*
|
24
|
+
* @extends module:core/command~Command
|
25
|
+
*/
|
26
|
+
export default class RemoveColumnCommand extends Command {
|
27
|
+
/**
|
28
|
+
* @inheritDoc
|
29
|
+
*/
|
30
|
+
refresh() {
|
31
|
+
const selectedCells = getSelectionAffectedTableCells( this.editor.model.document.selection );
|
32
|
+
const firstCell = selectedCells[ 0 ];
|
33
|
+
|
34
|
+
if ( firstCell ) {
|
35
|
+
const table = firstCell.findAncestor( 'table' );
|
36
|
+
const tableColumnCount = this.editor.plugins.get( 'TableUtils' ).getColumns( table );
|
37
|
+
|
38
|
+
const { first, last } = getColumnIndexes( selectedCells );
|
39
|
+
|
40
|
+
this.isEnabled = last - first < ( tableColumnCount - 1 );
|
41
|
+
} else {
|
42
|
+
this.isEnabled = false;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
/**
|
47
|
+
* @inheritDoc
|
48
|
+
*/
|
49
|
+
execute() {
|
50
|
+
const [ firstCell, lastCell ] = getBoundaryCells( this.editor.model.document.selection );
|
51
|
+
const table = firstCell.parent.parent;
|
52
|
+
|
53
|
+
// Cache the table before removing or updating colspans.
|
54
|
+
const tableMap = [ ...new TableWalker( table ) ];
|
55
|
+
|
56
|
+
// Store column indexes of removed columns.
|
57
|
+
const removedColumnIndexes = {
|
58
|
+
first: tableMap.find( value => value.cell === firstCell ).column,
|
59
|
+
last: tableMap.find( value => value.cell === lastCell ).column
|
60
|
+
};
|
61
|
+
|
62
|
+
const cellToFocus = getCellToFocus( tableMap, firstCell, lastCell, removedColumnIndexes );
|
63
|
+
|
64
|
+
this.editor.model.change( writer => {
|
65
|
+
const columnsToRemove = removedColumnIndexes.last - removedColumnIndexes.first + 1;
|
66
|
+
|
67
|
+
this.editor.plugins.get( 'TableUtils' ).removeColumns( table, {
|
68
|
+
at: removedColumnIndexes.first,
|
69
|
+
columns: columnsToRemove
|
70
|
+
} );
|
71
|
+
|
72
|
+
writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );
|
73
|
+
} );
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
// Returns a proper table cell to focus after removing a column.
|
78
|
+
// - selection is on last table cell it will return previous cell.
|
79
|
+
function getCellToFocus( tableMap, firstCell, lastCell, removedColumnIndexes ) {
|
80
|
+
const colspan = parseInt( lastCell.getAttribute( 'colspan' ) || 1 );
|
81
|
+
|
82
|
+
// If the table cell is spanned over 2+ columns - it will be truncated so the selection should
|
83
|
+
// stay in that cell.
|
84
|
+
if ( colspan > 1 ) {
|
85
|
+
return lastCell;
|
86
|
+
}
|
87
|
+
// Normally, look for the cell in the same row that precedes the first cell to put selection there ("column on the left").
|
88
|
+
// If the deleted column is the first column of the table, there will be no predecessor: use the cell
|
89
|
+
// from the column that follows then (also in the same row).
|
90
|
+
else if ( firstCell.previousSibling || lastCell.nextSibling ) {
|
91
|
+
return lastCell.nextSibling || firstCell.previousSibling;
|
92
|
+
}
|
93
|
+
// It can happen that table cells have no siblings in a row, for instance, when there are row spans
|
94
|
+
// in the table (in the previous row). Then just look for the closest cell that is in a column
|
95
|
+
// that will not be removed to put the selection there.
|
96
|
+
else {
|
97
|
+
// Look for any cell in a column that precedes the first removed column.
|
98
|
+
if ( removedColumnIndexes.first ) {
|
99
|
+
return tableMap.reverse().find( ( { column } ) => {
|
100
|
+
return column < removedColumnIndexes.first;
|
101
|
+
} ).cell;
|
102
|
+
}
|
103
|
+
// If the first removed column is the first column of the table, then
|
104
|
+
// look for any cell that is in a column that follows the last removed column.
|
105
|
+
else {
|
106
|
+
return tableMap.reverse().find( ( { column } ) => {
|
107
|
+
return column > removedColumnIndexes.last;
|
108
|
+
} ).cell;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
// Returns helper object returning the first and the last cell contained in given selection, based on DOM order.
|
114
|
+
function getBoundaryCells( selection ) {
|
115
|
+
const referenceCells = getSelectionAffectedTableCells( selection );
|
116
|
+
const firstCell = referenceCells[ 0 ];
|
117
|
+
const lastCell = referenceCells.pop();
|
118
|
+
|
119
|
+
const returnValue = [ firstCell, lastCell ];
|
120
|
+
|
121
|
+
return firstCell.isBefore( lastCell ) ? returnValue : returnValue.reverse();
|
122
|
+
}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module table/commands/removerowcommand
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Command } from 'ckeditor5/src/core';
|
11
|
+
|
12
|
+
import { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection';
|
13
|
+
|
14
|
+
/**
|
15
|
+
* The remove row command.
|
16
|
+
*
|
17
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableRow'` editor command.
|
18
|
+
*
|
19
|
+
* To remove the row containing the selected cell, execute the command:
|
20
|
+
*
|
21
|
+
* editor.execute( 'removeTableRow' );
|
22
|
+
*
|
23
|
+
* @extends module:core/command~Command
|
24
|
+
*/
|
25
|
+
export default class RemoveRowCommand extends Command {
|
26
|
+
/**
|
27
|
+
* @inheritDoc
|
28
|
+
*/
|
29
|
+
refresh() {
|
30
|
+
const selectedCells = getSelectionAffectedTableCells( this.editor.model.document.selection );
|
31
|
+
const firstCell = selectedCells[ 0 ];
|
32
|
+
|
33
|
+
if ( firstCell ) {
|
34
|
+
const table = firstCell.findAncestor( 'table' );
|
35
|
+
const tableRowCount = this.editor.plugins.get( 'TableUtils' ).getRows( table );
|
36
|
+
const lastRowIndex = tableRowCount - 1;
|
37
|
+
|
38
|
+
const selectedRowIndexes = getRowIndexes( selectedCells );
|
39
|
+
|
40
|
+
const areAllRowsSelected = selectedRowIndexes.first === 0 && selectedRowIndexes.last === lastRowIndex;
|
41
|
+
|
42
|
+
// Disallow selecting whole table -> delete whole table should be used instead.
|
43
|
+
this.isEnabled = !areAllRowsSelected;
|
44
|
+
} else {
|
45
|
+
this.isEnabled = false;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
/**
|
50
|
+
* @inheritDoc
|
51
|
+
*/
|
52
|
+
execute() {
|
53
|
+
const model = this.editor.model;
|
54
|
+
const referenceCells = getSelectionAffectedTableCells( model.document.selection );
|
55
|
+
const removedRowIndexes = getRowIndexes( referenceCells );
|
56
|
+
|
57
|
+
const firstCell = referenceCells[ 0 ];
|
58
|
+
const table = firstCell.findAncestor( 'table' );
|
59
|
+
|
60
|
+
const columnIndexToFocus = this.editor.plugins.get( 'TableUtils' ).getCellLocation( firstCell ).column;
|
61
|
+
|
62
|
+
model.change( writer => {
|
63
|
+
const rowsToRemove = removedRowIndexes.last - removedRowIndexes.first + 1;
|
64
|
+
|
65
|
+
this.editor.plugins.get( 'TableUtils' ).removeRows( table, {
|
66
|
+
at: removedRowIndexes.first,
|
67
|
+
rows: rowsToRemove
|
68
|
+
} );
|
69
|
+
|
70
|
+
const cellToFocus = getCellToFocus( table, removedRowIndexes.first, columnIndexToFocus );
|
71
|
+
|
72
|
+
writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );
|
73
|
+
} );
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
// Returns a cell that should be focused before removing the row, belonging to the same column as the currently focused cell.
|
78
|
+
// * If the row was not the last one, the cell to focus will be in the row that followed it (before removal).
|
79
|
+
// * If the row was the last one, the cell to focus will be in the row that preceded it (before removal).
|
80
|
+
function getCellToFocus( table, removedRowIndex, columnToFocus ) {
|
81
|
+
const row = table.getChild( removedRowIndex ) || table.getChild( table.childCount - 1 );
|
82
|
+
|
83
|
+
// Default to first table cell.
|
84
|
+
let cellToFocus = row.getChild( 0 );
|
85
|
+
let column = 0;
|
86
|
+
|
87
|
+
for ( const tableCell of row.getChildren() ) {
|
88
|
+
if ( column > columnToFocus ) {
|
89
|
+
return cellToFocus;
|
90
|
+
}
|
91
|
+
|
92
|
+
cellToFocus = tableCell;
|
93
|
+
column += parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
|
94
|
+
}
|
95
|
+
|
96
|
+
return cellToFocus;
|
97
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module table/commands/selectcolumncommand
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Command } from 'ckeditor5/src/core';
|
11
|
+
|
12
|
+
import TableWalker from '../tablewalker';
|
13
|
+
import { getSelectionAffectedTableCells } from '../utils/selection';
|
14
|
+
|
15
|
+
/**
|
16
|
+
* The select column command.
|
17
|
+
*
|
18
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableColumn'` editor command.
|
19
|
+
*
|
20
|
+
* To select the columns containing the selected cells, execute the command:
|
21
|
+
*
|
22
|
+
* editor.execute( 'selectTableColumn' );
|
23
|
+
*
|
24
|
+
* @extends module:core/command~Command
|
25
|
+
*/
|
26
|
+
export default class SelectColumnCommand extends Command {
|
27
|
+
/**
|
28
|
+
* @inheritDoc
|
29
|
+
*/
|
30
|
+
refresh() {
|
31
|
+
const selectedCells = getSelectionAffectedTableCells( this.editor.model.document.selection );
|
32
|
+
|
33
|
+
this.isEnabled = selectedCells.length > 0;
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* @inheritDoc
|
38
|
+
*/
|
39
|
+
execute() {
|
40
|
+
const model = this.editor.model;
|
41
|
+
const referenceCells = getSelectionAffectedTableCells( model.document.selection );
|
42
|
+
const firstCell = referenceCells[ 0 ];
|
43
|
+
const lastCell = referenceCells.pop();
|
44
|
+
const table = firstCell.findAncestor( 'table' );
|
45
|
+
|
46
|
+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
47
|
+
const startLocation = tableUtils.getCellLocation( firstCell );
|
48
|
+
const endLocation = tableUtils.getCellLocation( lastCell );
|
49
|
+
|
50
|
+
const startColumn = Math.min( startLocation.column, endLocation.column );
|
51
|
+
const endColumn = Math.max( startLocation.column, endLocation.column );
|
52
|
+
|
53
|
+
const rangesToSelect = [];
|
54
|
+
|
55
|
+
for ( const cellInfo of new TableWalker( table, { startColumn, endColumn } ) ) {
|
56
|
+
rangesToSelect.push( model.createRangeOn( cellInfo.cell ) );
|
57
|
+
}
|
58
|
+
|
59
|
+
model.change( writer => {
|
60
|
+
writer.setSelection( rangesToSelect );
|
61
|
+
} );
|
62
|
+
}
|
63
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module table/commands/selectrowcommand
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Command } from 'ckeditor5/src/core';
|
11
|
+
|
12
|
+
import { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection';
|
13
|
+
|
14
|
+
/**
|
15
|
+
* The select row command.
|
16
|
+
*
|
17
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableRow'` editor command.
|
18
|
+
*
|
19
|
+
* To select the rows containing the selected cells, execute the command:
|
20
|
+
*
|
21
|
+
* editor.execute( 'selectTableRow' );
|
22
|
+
*
|
23
|
+
* @extends module:core/command~Command
|
24
|
+
*/
|
25
|
+
export default class SelectRowCommand extends Command {
|
26
|
+
/**
|
27
|
+
* @inheritDoc
|
28
|
+
*/
|
29
|
+
refresh() {
|
30
|
+
const selectedCells = getSelectionAffectedTableCells( this.editor.model.document.selection );
|
31
|
+
|
32
|
+
this.isEnabled = selectedCells.length > 0;
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* @inheritDoc
|
37
|
+
*/
|
38
|
+
execute() {
|
39
|
+
const model = this.editor.model;
|
40
|
+
const referenceCells = getSelectionAffectedTableCells( model.document.selection );
|
41
|
+
const rowIndexes = getRowIndexes( referenceCells );
|
42
|
+
|
43
|
+
const table = referenceCells[ 0 ].findAncestor( 'table' );
|
44
|
+
const rangesToSelect = [];
|
45
|
+
|
46
|
+
for ( let rowIndex = rowIndexes.first; rowIndex <= rowIndexes.last; rowIndex++ ) {
|
47
|
+
for ( const cell of table.getChild( rowIndex ).getChildren() ) {
|
48
|
+
rangesToSelect.push( model.createRangeOn( cell ) );
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
model.change( writer => {
|
53
|
+
writer.setSelection( rangesToSelect );
|
54
|
+
} );
|
55
|
+
}
|
56
|
+
}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module table/commands/setheadercolumncommand
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Command } from 'ckeditor5/src/core';
|
11
|
+
|
12
|
+
import {
|
13
|
+
isHeadingColumnCell,
|
14
|
+
updateNumericAttribute
|
15
|
+
} from '../utils/common';
|
16
|
+
import { getColumnIndexes, getSelectionAffectedTableCells } from '../utils/selection';
|
17
|
+
import { getHorizontallyOverlappingCells, splitVertically } from '../utils/structure';
|
18
|
+
|
19
|
+
/**
|
20
|
+
* The header column command.
|
21
|
+
*
|
22
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
|
23
|
+
*
|
24
|
+
* You can make the column containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element)
|
25
|
+
* by executing:
|
26
|
+
*
|
27
|
+
* editor.execute( 'setTableColumnHeader' );
|
28
|
+
*
|
29
|
+
* **Note:** All preceding columns will also become headers. If the current column is already a header, executing this command
|
30
|
+
* will make it a regular column back again (including the following columns).
|
31
|
+
*
|
32
|
+
* @extends module:core/command~Command
|
33
|
+
*/
|
34
|
+
export default class SetHeaderColumnCommand extends Command {
|
35
|
+
/**
|
36
|
+
* @inheritDoc
|
37
|
+
*/
|
38
|
+
refresh() {
|
39
|
+
const model = this.editor.model;
|
40
|
+
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
|
41
|
+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
42
|
+
const isInTable = selectedCells.length > 0;
|
43
|
+
|
44
|
+
this.isEnabled = isInTable;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Flag indicating whether the command is active. The command is active when the
|
48
|
+
* {@link module:engine/model/selection~Selection} is in a header column.
|
49
|
+
*
|
50
|
+
* @observable
|
51
|
+
* @readonly
|
52
|
+
* @member {Boolean} #value
|
53
|
+
*/
|
54
|
+
this.value = isInTable && selectedCells.every( cell => isHeadingColumnCell( tableUtils, cell ) );
|
55
|
+
}
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Executes the command.
|
59
|
+
*
|
60
|
+
* When the selection is in a non-header column, the command will set the `headingColumns` table attribute to cover that column.
|
61
|
+
*
|
62
|
+
* When the selection is already in a header column, it will set `headingColumns` so the heading section will end before that column.
|
63
|
+
*
|
64
|
+
* @fires execute
|
65
|
+
* @param {Object} [options]
|
66
|
+
* @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header columns according to
|
67
|
+
* the `forceValue` parameter instead of the current model state.
|
68
|
+
*/
|
69
|
+
execute( options = {} ) {
|
70
|
+
if ( options.forceValue === this.value ) {
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
|
74
|
+
const model = this.editor.model;
|
75
|
+
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
|
76
|
+
const table = selectedCells[ 0 ].findAncestor( 'table' );
|
77
|
+
|
78
|
+
const { first, last } = getColumnIndexes( selectedCells );
|
79
|
+
const headingColumnsToSet = this.value ? first : last + 1;
|
80
|
+
|
81
|
+
model.change( writer => {
|
82
|
+
if ( headingColumnsToSet ) {
|
83
|
+
// Changing heading columns requires to check if any of a heading cell is overlapping horizontally the table head.
|
84
|
+
// Any table cell that has a colspan attribute > 1 will not exceed the table head so we need to fix it in columns before.
|
85
|
+
const overlappingCells = getHorizontallyOverlappingCells( table, headingColumnsToSet );
|
86
|
+
|
87
|
+
for ( const { cell, column } of overlappingCells ) {
|
88
|
+
splitVertically( cell, column, headingColumnsToSet, writer );
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
updateNumericAttribute( 'headingColumns', headingColumnsToSet, table, writer, 0 );
|
93
|
+
} );
|
94
|
+
}
|
95
|
+
}
|
@@ -0,0 +1,105 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module table/commands/setheaderrowcommand
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Command } from 'ckeditor5/src/core';
|
11
|
+
|
12
|
+
import { updateNumericAttribute } from '../utils/common';
|
13
|
+
import { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection';
|
14
|
+
import { getVerticallyOverlappingCells, splitHorizontally } from '../utils/structure';
|
15
|
+
|
16
|
+
/**
|
17
|
+
* The header row command.
|
18
|
+
*
|
19
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
|
20
|
+
*
|
21
|
+
* You can make the row containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element) by executing:
|
22
|
+
*
|
23
|
+
* editor.execute( 'setTableRowHeader' );
|
24
|
+
*
|
25
|
+
* **Note:** All preceding rows will also become headers. If the current row is already a header, executing this command
|
26
|
+
* will make it a regular row back again (including the following rows).
|
27
|
+
*
|
28
|
+
* @extends module:core/command~Command
|
29
|
+
*/
|
30
|
+
export default class SetHeaderRowCommand extends Command {
|
31
|
+
/**
|
32
|
+
* @inheritDoc
|
33
|
+
*/
|
34
|
+
refresh() {
|
35
|
+
const model = this.editor.model;
|
36
|
+
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
|
37
|
+
const isInTable = selectedCells.length > 0;
|
38
|
+
|
39
|
+
this.isEnabled = isInTable;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Flag indicating whether the command is active. The command is active when the
|
43
|
+
* {@link module:engine/model/selection~Selection} is in a header row.
|
44
|
+
*
|
45
|
+
* @observable
|
46
|
+
* @readonly
|
47
|
+
* @member {Boolean} #value
|
48
|
+
*/
|
49
|
+
this.value = isInTable && selectedCells.every( cell => this._isInHeading( cell, cell.parent.parent ) );
|
50
|
+
}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Executes the command.
|
54
|
+
*
|
55
|
+
* When the selection is in a non-header row, the command will set the `headingRows` table attribute to cover that row.
|
56
|
+
*
|
57
|
+
* When the selection is already in a header row, it will set `headingRows` so the heading section will end before that row.
|
58
|
+
*
|
59
|
+
* @fires execute
|
60
|
+
* @param {Object} options
|
61
|
+
* @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header rows according to
|
62
|
+
* the `forceValue` parameter instead of the current model state.
|
63
|
+
*/
|
64
|
+
execute( options = {} ) {
|
65
|
+
if ( options.forceValue === this.value ) {
|
66
|
+
return;
|
67
|
+
}
|
68
|
+
const model = this.editor.model;
|
69
|
+
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
|
70
|
+
const table = selectedCells[ 0 ].findAncestor( 'table' );
|
71
|
+
|
72
|
+
const { first, last } = getRowIndexes( selectedCells );
|
73
|
+
const headingRowsToSet = this.value ? first : last + 1;
|
74
|
+
const currentHeadingRows = table.getAttribute( 'headingRows' ) || 0;
|
75
|
+
|
76
|
+
model.change( writer => {
|
77
|
+
if ( headingRowsToSet ) {
|
78
|
+
// Changing heading rows requires to check if any of a heading cell is overlapping vertically the table head.
|
79
|
+
// Any table cell that has a rowspan attribute > 1 will not exceed the table head so we need to fix it in rows below.
|
80
|
+
const startRow = headingRowsToSet > currentHeadingRows ? currentHeadingRows : 0;
|
81
|
+
const overlappingCells = getVerticallyOverlappingCells( table, headingRowsToSet, startRow );
|
82
|
+
|
83
|
+
for ( const { cell } of overlappingCells ) {
|
84
|
+
splitHorizontally( cell, headingRowsToSet, writer );
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
updateNumericAttribute( 'headingRows', headingRowsToSet, table, writer, 0 );
|
89
|
+
} );
|
90
|
+
}
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Checks if a table cell is in the heading section.
|
94
|
+
*
|
95
|
+
* @param {module:engine/model/element~Element} tableCell
|
96
|
+
* @param {module:engine/model/element~Element} table
|
97
|
+
* @returns {Boolean}
|
98
|
+
* @private
|
99
|
+
*/
|
100
|
+
_isInHeading( tableCell, table ) {
|
101
|
+
const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
|
102
|
+
|
103
|
+
return !!headingRows && tableCell.parent.index < headingRows;
|
104
|
+
}
|
105
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module table/commands/splitcellcommand
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Command } from 'ckeditor5/src/core';
|
11
|
+
import { getSelectionAffectedTableCells } from '../utils/selection';
|
12
|
+
|
13
|
+
/**
|
14
|
+
* The split cell command.
|
15
|
+
*
|
16
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'splitTableCellVertically'`
|
17
|
+
* and `'splitTableCellHorizontally'` editor commands.
|
18
|
+
*
|
19
|
+
* You can split any cell vertically or horizontally by executing this command. For example, to split the selected table cell vertically:
|
20
|
+
*
|
21
|
+
* editor.execute( 'splitTableCellVertically' );
|
22
|
+
*
|
23
|
+
* @extends module:core/command~Command
|
24
|
+
*/
|
25
|
+
export default class SplitCellCommand extends Command {
|
26
|
+
/**
|
27
|
+
* Creates a new `SplitCellCommand` instance.
|
28
|
+
*
|
29
|
+
* @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
|
30
|
+
* @param {Object} options
|
31
|
+
* @param {String} options.direction Indicates whether the command should split cells `'horizontally'` or `'vertically'`.
|
32
|
+
*/
|
33
|
+
constructor( editor, options = {} ) {
|
34
|
+
super( editor );
|
35
|
+
|
36
|
+
/**
|
37
|
+
* The direction that indicates which cell will be split.
|
38
|
+
*
|
39
|
+
* @readonly
|
40
|
+
* @member {String} #direction
|
41
|
+
*/
|
42
|
+
this.direction = options.direction || 'horizontally';
|
43
|
+
}
|
44
|
+
|
45
|
+
/**
|
46
|
+
* @inheritDoc
|
47
|
+
*/
|
48
|
+
refresh() {
|
49
|
+
const selectedCells = getSelectionAffectedTableCells( this.editor.model.document.selection );
|
50
|
+
|
51
|
+
this.isEnabled = selectedCells.length === 1;
|
52
|
+
}
|
53
|
+
|
54
|
+
/**
|
55
|
+
* @inheritDoc
|
56
|
+
*/
|
57
|
+
execute() {
|
58
|
+
const tableCell = getSelectionAffectedTableCells( this.editor.model.document.selection )[ 0 ];
|
59
|
+
const isHorizontal = this.direction === 'horizontally';
|
60
|
+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
61
|
+
|
62
|
+
if ( isHorizontal ) {
|
63
|
+
tableUtils.splitCellHorizontally( tableCell, 2 );
|
64
|
+
} else {
|
65
|
+
tableUtils.splitCellVertically( tableCell, 2 );
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|