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,160 @@
|
|
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/tableediting
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Plugin } from 'ckeditor5/src/core';
|
11
|
+
|
12
|
+
import upcastTable, { ensureParagraphInTableCell, skipEmptyTableRow } from './converters/upcasttable';
|
13
|
+
import {
|
14
|
+
convertParagraphInTableCell,
|
15
|
+
downcastInsertCell,
|
16
|
+
downcastInsertRow,
|
17
|
+
downcastInsertTable,
|
18
|
+
downcastRemoveRow,
|
19
|
+
downcastTableHeadingColumnsChange
|
20
|
+
} from './converters/downcast';
|
21
|
+
|
22
|
+
import InsertTableCommand from './commands/inserttablecommand';
|
23
|
+
import InsertRowCommand from './commands/insertrowcommand';
|
24
|
+
import InsertColumnCommand from './commands/insertcolumncommand';
|
25
|
+
import SplitCellCommand from './commands/splitcellcommand';
|
26
|
+
import MergeCellCommand from './commands/mergecellcommand';
|
27
|
+
import RemoveRowCommand from './commands/removerowcommand';
|
28
|
+
import RemoveColumnCommand from './commands/removecolumncommand';
|
29
|
+
import SetHeaderRowCommand from './commands/setheaderrowcommand';
|
30
|
+
import SetHeaderColumnCommand from './commands/setheadercolumncommand';
|
31
|
+
import MergeCellsCommand from './commands/mergecellscommand';
|
32
|
+
import SelectRowCommand from './commands/selectrowcommand';
|
33
|
+
import SelectColumnCommand from './commands/selectcolumncommand';
|
34
|
+
import TableUtils from '../table/tableutils';
|
35
|
+
|
36
|
+
import injectTableLayoutPostFixer from './converters/table-layout-post-fixer';
|
37
|
+
import injectTableCellParagraphPostFixer from './converters/table-cell-paragraph-post-fixer';
|
38
|
+
import injectTableCellRefreshPostFixer from './converters/table-cell-refresh-post-fixer';
|
39
|
+
import injectTableHeadingRowsRefreshPostFixer from './converters/table-heading-rows-refresh-post-fixer';
|
40
|
+
|
41
|
+
import './theme/tableediting.css';
|
42
|
+
|
43
|
+
/**
|
44
|
+
* The table editing feature.
|
45
|
+
*
|
46
|
+
* @extends module:core/plugin~Plugin
|
47
|
+
*/
|
48
|
+
export default class TableEditing extends Plugin {
|
49
|
+
/**
|
50
|
+
* @inheritDoc
|
51
|
+
*/
|
52
|
+
static get pluginName() {
|
53
|
+
return 'TableEditing';
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* @inheritDoc
|
58
|
+
*/
|
59
|
+
init() {
|
60
|
+
const editor = this.editor;
|
61
|
+
const model = editor.model;
|
62
|
+
const schema = model.schema;
|
63
|
+
const conversion = editor.conversion;
|
64
|
+
|
65
|
+
schema.register( 'table', {
|
66
|
+
allowWhere: '$block',
|
67
|
+
allowAttributes: [ 'headingRows', 'headingColumns' ],
|
68
|
+
isObject: true,
|
69
|
+
isBlock: true
|
70
|
+
} );
|
71
|
+
|
72
|
+
schema.register( 'tableRow', {
|
73
|
+
allowIn: 'table',
|
74
|
+
isLimit: true
|
75
|
+
} );
|
76
|
+
|
77
|
+
schema.register( 'tableCell', {
|
78
|
+
allowIn: 'tableRow',
|
79
|
+
allowAttributes: [ 'colspan', 'rowspan' ],
|
80
|
+
isLimit: true,
|
81
|
+
isSelectable: true
|
82
|
+
} );
|
83
|
+
|
84
|
+
// Allow all $block content inside a table cell.
|
85
|
+
schema.extend( '$block', { allowIn: 'tableCell' } );
|
86
|
+
|
87
|
+
// Table conversion.
|
88
|
+
conversion.for( 'upcast' ).add( upcastTable() );
|
89
|
+
|
90
|
+
conversion.for( 'editingDowncast' ).add( downcastInsertTable( { asWidget: true } ) );
|
91
|
+
conversion.for( 'dataDowncast' ).add( downcastInsertTable() );
|
92
|
+
|
93
|
+
// Table row conversion.
|
94
|
+
conversion.for( 'upcast' ).elementToElement( { model: 'tableRow', view: 'tr' } );
|
95
|
+
conversion.for( 'upcast' ).add( skipEmptyTableRow() );
|
96
|
+
|
97
|
+
conversion.for( 'editingDowncast' ).add( downcastInsertRow() );
|
98
|
+
conversion.for( 'editingDowncast' ).add( downcastRemoveRow() );
|
99
|
+
|
100
|
+
// Table cell conversion.
|
101
|
+
conversion.for( 'upcast' ).elementToElement( { model: 'tableCell', view: 'td' } );
|
102
|
+
conversion.for( 'upcast' ).elementToElement( { model: 'tableCell', view: 'th' } );
|
103
|
+
conversion.for( 'upcast' ).add( ensureParagraphInTableCell( 'td' ) );
|
104
|
+
conversion.for( 'upcast' ).add( ensureParagraphInTableCell( 'th' ) );
|
105
|
+
|
106
|
+
conversion.for( 'editingDowncast' ).add( downcastInsertCell() );
|
107
|
+
|
108
|
+
// Duplicates code - needed to properly refresh paragraph inside a table cell.
|
109
|
+
editor.conversion.for( 'editingDowncast' ).elementToElement( {
|
110
|
+
model: 'paragraph',
|
111
|
+
view: convertParagraphInTableCell,
|
112
|
+
converterPriority: 'high'
|
113
|
+
} );
|
114
|
+
|
115
|
+
// Table attributes conversion.
|
116
|
+
conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
|
117
|
+
conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
|
118
|
+
|
119
|
+
// Table heading columns conversion (a change of heading rows requires a reconversion of the whole table).
|
120
|
+
conversion.for( 'editingDowncast' ).add( downcastTableHeadingColumnsChange() );
|
121
|
+
|
122
|
+
// Define all the commands.
|
123
|
+
editor.commands.add( 'insertTable', new InsertTableCommand( editor ) );
|
124
|
+
editor.commands.add( 'insertTableRowAbove', new InsertRowCommand( editor, { order: 'above' } ) );
|
125
|
+
editor.commands.add( 'insertTableRowBelow', new InsertRowCommand( editor, { order: 'below' } ) );
|
126
|
+
editor.commands.add( 'insertTableColumnLeft', new InsertColumnCommand( editor, { order: 'left' } ) );
|
127
|
+
editor.commands.add( 'insertTableColumnRight', new InsertColumnCommand( editor, { order: 'right' } ) );
|
128
|
+
|
129
|
+
editor.commands.add( 'removeTableRow', new RemoveRowCommand( editor ) );
|
130
|
+
editor.commands.add( 'removeTableColumn', new RemoveColumnCommand( editor ) );
|
131
|
+
|
132
|
+
editor.commands.add( 'splitTableCellVertically', new SplitCellCommand( editor, { direction: 'vertically' } ) );
|
133
|
+
editor.commands.add( 'splitTableCellHorizontally', new SplitCellCommand( editor, { direction: 'horizontally' } ) );
|
134
|
+
|
135
|
+
editor.commands.add( 'mergeTableCells', new MergeCellsCommand( editor ) );
|
136
|
+
|
137
|
+
editor.commands.add( 'mergeTableCellRight', new MergeCellCommand( editor, { direction: 'right' } ) );
|
138
|
+
editor.commands.add( 'mergeTableCellLeft', new MergeCellCommand( editor, { direction: 'left' } ) );
|
139
|
+
editor.commands.add( 'mergeTableCellDown', new MergeCellCommand( editor, { direction: 'down' } ) );
|
140
|
+
editor.commands.add( 'mergeTableCellUp', new MergeCellCommand( editor, { direction: 'up' } ) );
|
141
|
+
|
142
|
+
editor.commands.add( 'setTableColumnHeader', new SetHeaderColumnCommand( editor ) );
|
143
|
+
editor.commands.add( 'setTableRowHeader', new SetHeaderRowCommand( editor ) );
|
144
|
+
|
145
|
+
editor.commands.add( 'selectTableRow', new SelectRowCommand( editor ) );
|
146
|
+
editor.commands.add( 'selectTableColumn', new SelectColumnCommand( editor ) );
|
147
|
+
|
148
|
+
injectTableHeadingRowsRefreshPostFixer( model );
|
149
|
+
injectTableLayoutPostFixer( model );
|
150
|
+
injectTableCellRefreshPostFixer( model, editor.editing.mapper );
|
151
|
+
injectTableCellParagraphPostFixer( model );
|
152
|
+
}
|
153
|
+
|
154
|
+
/**
|
155
|
+
* @inheritDoc
|
156
|
+
*/
|
157
|
+
static get requires() {
|
158
|
+
return [ TableUtils ];
|
159
|
+
}
|
160
|
+
}
|
@@ -0,0 +1,343 @@
|
|
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/tablekeyboard
|
8
|
+
*/
|
9
|
+
|
10
|
+
import TableSelection from './tableselection';
|
11
|
+
import TableWalker from './tablewalker';
|
12
|
+
|
13
|
+
import { Plugin } from 'ckeditor5/src/core';
|
14
|
+
import { getLocalizedArrowKeyCodeDirection } from 'ckeditor5/src/utils';
|
15
|
+
import { getSelectedTableCells, getTableCellsContainingSelection } from './utils/selection';
|
16
|
+
|
17
|
+
/**
|
18
|
+
* This plugin enables keyboard navigation for tables.
|
19
|
+
* It is loaded automatically by the {@link module:table/table~Table} plugin.
|
20
|
+
*
|
21
|
+
* @extends module:core/plugin~Plugin
|
22
|
+
*/
|
23
|
+
export default class TableKeyboard extends Plugin {
|
24
|
+
/**
|
25
|
+
* @inheritDoc
|
26
|
+
*/
|
27
|
+
static get pluginName() {
|
28
|
+
return 'TableKeyboard';
|
29
|
+
}
|
30
|
+
|
31
|
+
/**
|
32
|
+
* @inheritDoc
|
33
|
+
*/
|
34
|
+
static get requires() {
|
35
|
+
return [ TableSelection ];
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* @inheritDoc
|
40
|
+
*/
|
41
|
+
init() {
|
42
|
+
const view = this.editor.editing.view;
|
43
|
+
const viewDocument = view.document;
|
44
|
+
|
45
|
+
// Handle Tab key navigation.
|
46
|
+
this.editor.keystrokes.set( 'Tab', ( ...args ) => this._handleTabOnSelectedTable( ...args ), { priority: 'low' } );
|
47
|
+
this.editor.keystrokes.set( 'Tab', this._getTabHandler( true ), { priority: 'low' } );
|
48
|
+
this.editor.keystrokes.set( 'Shift+Tab', this._getTabHandler( false ), { priority: 'low' } );
|
49
|
+
|
50
|
+
this.listenTo( viewDocument, 'arrowKey', ( ...args ) => this._onArrowKey( ...args ), { context: 'table' } );
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Handles {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
|
55
|
+
* when the table widget is selected.
|
56
|
+
*
|
57
|
+
* @private
|
58
|
+
* @param {module:engine/view/observer/keyobserver~KeyEventData} data Key event data.
|
59
|
+
* @param {Function} cancel The stop/stopPropagation/preventDefault function.
|
60
|
+
*/
|
61
|
+
_handleTabOnSelectedTable( data, cancel ) {
|
62
|
+
const editor = this.editor;
|
63
|
+
const selection = editor.model.document.selection;
|
64
|
+
const selectedElement = selection.getSelectedElement();
|
65
|
+
|
66
|
+
if ( !selectedElement || !selectedElement.is( 'element', 'table' ) ) {
|
67
|
+
return;
|
68
|
+
}
|
69
|
+
|
70
|
+
cancel();
|
71
|
+
|
72
|
+
editor.model.change( writer => {
|
73
|
+
writer.setSelection( writer.createRangeIn( selectedElement.getChild( 0 ).getChild( 0 ) ) );
|
74
|
+
} );
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Returns a handler for {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
|
79
|
+
* inside table cells.
|
80
|
+
*
|
81
|
+
* @private
|
82
|
+
* @param {Boolean} isForward Whether this handler will move the selection to the next or the previous cell.
|
83
|
+
*/
|
84
|
+
_getTabHandler( isForward ) {
|
85
|
+
const editor = this.editor;
|
86
|
+
|
87
|
+
return ( domEventData, cancel ) => {
|
88
|
+
const selection = editor.model.document.selection;
|
89
|
+
let tableCell = getTableCellsContainingSelection( selection )[ 0 ];
|
90
|
+
|
91
|
+
if ( !tableCell ) {
|
92
|
+
tableCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
|
93
|
+
}
|
94
|
+
|
95
|
+
if ( !tableCell ) {
|
96
|
+
return;
|
97
|
+
}
|
98
|
+
|
99
|
+
cancel();
|
100
|
+
|
101
|
+
const tableRow = tableCell.parent;
|
102
|
+
const table = tableRow.parent;
|
103
|
+
|
104
|
+
const currentRowIndex = table.getChildIndex( tableRow );
|
105
|
+
const currentCellIndex = tableRow.getChildIndex( tableCell );
|
106
|
+
|
107
|
+
const isFirstCellInRow = currentCellIndex === 0;
|
108
|
+
|
109
|
+
if ( !isForward && isFirstCellInRow && currentRowIndex === 0 ) {
|
110
|
+
// Set the selection over the whole table if the selection was in the first table cell.
|
111
|
+
editor.model.change( writer => {
|
112
|
+
writer.setSelection( writer.createRangeOn( table ) );
|
113
|
+
} );
|
114
|
+
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
|
118
|
+
const isLastCellInRow = currentCellIndex === tableRow.childCount - 1;
|
119
|
+
const isLastRow = currentRowIndex === table.childCount - 1;
|
120
|
+
|
121
|
+
if ( isForward && isLastRow && isLastCellInRow ) {
|
122
|
+
editor.execute( 'insertTableRowBelow' );
|
123
|
+
|
124
|
+
// Check if the command actually added a row. If `insertTableRowBelow` execution didn't add a row (because it was disabled
|
125
|
+
// or it got overwritten) set the selection over the whole table to mirror the first cell case.
|
126
|
+
if ( currentRowIndex === table.childCount - 1 ) {
|
127
|
+
editor.model.change( writer => {
|
128
|
+
writer.setSelection( writer.createRangeOn( table ) );
|
129
|
+
} );
|
130
|
+
|
131
|
+
return;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
let cellToFocus;
|
136
|
+
|
137
|
+
// Move to the first cell in the next row.
|
138
|
+
if ( isForward && isLastCellInRow ) {
|
139
|
+
const nextRow = table.getChild( currentRowIndex + 1 );
|
140
|
+
|
141
|
+
cellToFocus = nextRow.getChild( 0 );
|
142
|
+
}
|
143
|
+
// Move to the last cell in the previous row.
|
144
|
+
else if ( !isForward && isFirstCellInRow ) {
|
145
|
+
const previousRow = table.getChild( currentRowIndex - 1 );
|
146
|
+
|
147
|
+
cellToFocus = previousRow.getChild( previousRow.childCount - 1 );
|
148
|
+
}
|
149
|
+
// Move to the next/previous cell.
|
150
|
+
else {
|
151
|
+
cellToFocus = tableRow.getChild( currentCellIndex + ( isForward ? 1 : -1 ) );
|
152
|
+
}
|
153
|
+
|
154
|
+
editor.model.change( writer => {
|
155
|
+
writer.setSelection( writer.createRangeIn( cellToFocus ) );
|
156
|
+
} );
|
157
|
+
};
|
158
|
+
}
|
159
|
+
|
160
|
+
/**
|
161
|
+
* Handles {@link module:engine/view/document~Document#event:keydown keydown} events.
|
162
|
+
*
|
163
|
+
* @private
|
164
|
+
* @param {module:utils/eventinfo~EventInfo} eventInfo
|
165
|
+
* @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
|
166
|
+
*/
|
167
|
+
_onArrowKey( eventInfo, domEventData ) {
|
168
|
+
const editor = this.editor;
|
169
|
+
const keyCode = domEventData.keyCode;
|
170
|
+
|
171
|
+
const direction = getLocalizedArrowKeyCodeDirection( keyCode, editor.locale.contentLanguageDirection );
|
172
|
+
const wasHandled = this._handleArrowKeys( direction, domEventData.shiftKey );
|
173
|
+
|
174
|
+
if ( wasHandled ) {
|
175
|
+
domEventData.preventDefault();
|
176
|
+
domEventData.stopPropagation();
|
177
|
+
eventInfo.stop();
|
178
|
+
}
|
179
|
+
}
|
180
|
+
|
181
|
+
/**
|
182
|
+
* Handles arrow keys to move the selection around the table.
|
183
|
+
*
|
184
|
+
* @private
|
185
|
+
* @param {'left'|'up'|'right'|'down'} direction The direction of the arrow key.
|
186
|
+
* @param {Boolean} expandSelection If the current selection should be expanded.
|
187
|
+
* @returns {Boolean} Returns `true` if key was handled.
|
188
|
+
*/
|
189
|
+
_handleArrowKeys( direction, expandSelection ) {
|
190
|
+
const model = this.editor.model;
|
191
|
+
const selection = model.document.selection;
|
192
|
+
const isForward = [ 'right', 'down' ].includes( direction );
|
193
|
+
|
194
|
+
// In case one or more table cells are selected (from outside),
|
195
|
+
// move the selection to a cell adjacent to the selected table fragment.
|
196
|
+
const selectedCells = getSelectedTableCells( selection );
|
197
|
+
|
198
|
+
if ( selectedCells.length ) {
|
199
|
+
let focusCell;
|
200
|
+
|
201
|
+
if ( expandSelection ) {
|
202
|
+
focusCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
|
203
|
+
} else {
|
204
|
+
focusCell = isForward ? selectedCells[ selectedCells.length - 1 ] : selectedCells[ 0 ];
|
205
|
+
}
|
206
|
+
|
207
|
+
this._navigateFromCellInDirection( focusCell, direction, expandSelection );
|
208
|
+
|
209
|
+
return true;
|
210
|
+
}
|
211
|
+
|
212
|
+
// Abort if we're not in a table cell.
|
213
|
+
const tableCell = selection.focus.findAncestor( 'tableCell' );
|
214
|
+
|
215
|
+
/* istanbul ignore if: paranoid check */
|
216
|
+
if ( !tableCell ) {
|
217
|
+
return false;
|
218
|
+
}
|
219
|
+
|
220
|
+
// Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.
|
221
|
+
// Selection for sure will not approach cell edge.
|
222
|
+
if ( expandSelection && !selection.isCollapsed && selection.isBackward == isForward ) {
|
223
|
+
return false;
|
224
|
+
}
|
225
|
+
|
226
|
+
// Let's check if the selection is at the beginning/end of the cell.
|
227
|
+
if ( this._isSelectionAtCellEdge( selection, tableCell, isForward ) ) {
|
228
|
+
this._navigateFromCellInDirection( tableCell, direction, expandSelection );
|
229
|
+
|
230
|
+
return true;
|
231
|
+
}
|
232
|
+
|
233
|
+
return false;
|
234
|
+
}
|
235
|
+
|
236
|
+
/**
|
237
|
+
* Returns `true` if the selection is at the boundary of a table cell according to the navigation direction.
|
238
|
+
*
|
239
|
+
* @private
|
240
|
+
* @param {module:engine/model/selection~Selection} selection The current selection.
|
241
|
+
* @param {module:engine/model/element~Element} tableCell The current table cell element.
|
242
|
+
* @param {Boolean} isForward The expected navigation direction.
|
243
|
+
* @returns {Boolean}
|
244
|
+
*/
|
245
|
+
_isSelectionAtCellEdge( selection, tableCell, isForward ) {
|
246
|
+
const model = this.editor.model;
|
247
|
+
const schema = this.editor.model.schema;
|
248
|
+
|
249
|
+
const focus = isForward ? selection.getLastPosition() : selection.getFirstPosition();
|
250
|
+
|
251
|
+
// If the current limit element is not table cell we are for sure not at the cell edge.
|
252
|
+
// Also `modifySelection` will not let us out of it.
|
253
|
+
if ( !schema.getLimitElement( focus ).is( 'element', 'tableCell' ) ) {
|
254
|
+
const boundaryPosition = model.createPositionAt( tableCell, isForward ? 'end' : 0 );
|
255
|
+
|
256
|
+
return boundaryPosition.isTouching( focus );
|
257
|
+
}
|
258
|
+
|
259
|
+
const probe = model.createSelection( focus );
|
260
|
+
|
261
|
+
model.modifySelection( probe, { direction: isForward ? 'forward' : 'backward' } );
|
262
|
+
|
263
|
+
// If there was no change in the focus position, then it's not possible to move the selection there.
|
264
|
+
return focus.isEqual( probe.focus );
|
265
|
+
}
|
266
|
+
|
267
|
+
/**
|
268
|
+
* Moves the selection from the given table cell in the specified direction.
|
269
|
+
*
|
270
|
+
* @protected
|
271
|
+
* @param {module:engine/model/element~Element} focusCell The table cell that is current multi-cell selection focus.
|
272
|
+
* @param {'left'|'up'|'right'|'down'} direction Direction in which selection should move.
|
273
|
+
* @param {Boolean} [expandSelection=false] If the current selection should be expanded.
|
274
|
+
*/
|
275
|
+
_navigateFromCellInDirection( focusCell, direction, expandSelection = false ) {
|
276
|
+
const model = this.editor.model;
|
277
|
+
|
278
|
+
const table = focusCell.findAncestor( 'table' );
|
279
|
+
const tableMap = [ ...new TableWalker( table, { includeAllSlots: true } ) ];
|
280
|
+
const { row: lastRow, column: lastColumn } = tableMap[ tableMap.length - 1 ];
|
281
|
+
|
282
|
+
const currentCellInfo = tableMap.find( ( { cell } ) => cell == focusCell );
|
283
|
+
let { row, column } = currentCellInfo;
|
284
|
+
|
285
|
+
switch ( direction ) {
|
286
|
+
case 'left':
|
287
|
+
column--;
|
288
|
+
break;
|
289
|
+
|
290
|
+
case 'up':
|
291
|
+
row--;
|
292
|
+
break;
|
293
|
+
|
294
|
+
case 'right':
|
295
|
+
column += currentCellInfo.cellWidth;
|
296
|
+
break;
|
297
|
+
|
298
|
+
case 'down':
|
299
|
+
row += currentCellInfo.cellHeight;
|
300
|
+
break;
|
301
|
+
}
|
302
|
+
|
303
|
+
const isOutsideVertically = row < 0 || row > lastRow;
|
304
|
+
const isBeforeFirstCell = column < 0 && row <= 0;
|
305
|
+
const isAfterLastCell = column > lastColumn && row >= lastRow;
|
306
|
+
|
307
|
+
// Note that if the table cell at the end of a row is row-spanned then isAfterLastCell will never be true.
|
308
|
+
// However, we don't know if user was navigating on the last row or not, so let's stay in the table.
|
309
|
+
|
310
|
+
if ( isOutsideVertically || isBeforeFirstCell || isAfterLastCell ) {
|
311
|
+
model.change( writer => {
|
312
|
+
writer.setSelection( writer.createRangeOn( table ) );
|
313
|
+
} );
|
314
|
+
|
315
|
+
return;
|
316
|
+
}
|
317
|
+
|
318
|
+
if ( column < 0 ) {
|
319
|
+
column = expandSelection ? 0 : lastColumn;
|
320
|
+
row--;
|
321
|
+
} else if ( column > lastColumn ) {
|
322
|
+
column = expandSelection ? lastColumn : 0;
|
323
|
+
row++;
|
324
|
+
}
|
325
|
+
|
326
|
+
const cellToSelect = tableMap.find( cellInfo => cellInfo.row == row && cellInfo.column == column ).cell;
|
327
|
+
const isForward = [ 'right', 'down' ].includes( direction );
|
328
|
+
const tableSelection = this.editor.plugins.get( 'TableSelection' );
|
329
|
+
|
330
|
+
if ( expandSelection && tableSelection.isEnabled ) {
|
331
|
+
const anchorCell = tableSelection.getAnchorCell() || focusCell;
|
332
|
+
|
333
|
+
tableSelection.setCellSelection( anchorCell, cellToSelect );
|
334
|
+
} else {
|
335
|
+
const positionToSelect = model.createPositionAt( cellToSelect, isForward ? 0 : 'end' );
|
336
|
+
|
337
|
+
model.change( writer => {
|
338
|
+
writer.setSelection( positionToSelect );
|
339
|
+
} );
|
340
|
+
}
|
341
|
+
}
|
342
|
+
}
|
343
|
+
|
@@ -0,0 +1,72 @@
|
|
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/tableselection/mouseeventsobserver
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { DomEventObserver } from 'ckeditor5/src/engine';
|
11
|
+
|
12
|
+
/**
|
13
|
+
* The mouse selection event observer.
|
14
|
+
*
|
15
|
+
* It registers listeners for the following DOM events:
|
16
|
+
*
|
17
|
+
* - `'mousemove'`
|
18
|
+
* - `'mouseup'`
|
19
|
+
* - `'mouseleave'`
|
20
|
+
*
|
21
|
+
* Note that this observer is disabled by default. To enable this observer, it needs to be added to
|
22
|
+
* {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
|
23
|
+
*
|
24
|
+
* The observer is registered by the {@link module:table/tableselection~TableSelection} plugin.
|
25
|
+
*
|
26
|
+
* @extends module:engine/view/observer/domeventobserver~DomEventObserver
|
27
|
+
*/
|
28
|
+
export default class MouseEventsObserver extends DomEventObserver {
|
29
|
+
/**
|
30
|
+
* @inheritDoc
|
31
|
+
*/
|
32
|
+
constructor( view ) {
|
33
|
+
super( view );
|
34
|
+
|
35
|
+
this.domEventType = [ 'mousemove', 'mouseleave' ];
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* @inheritDoc
|
40
|
+
*/
|
41
|
+
onDomEvent( domEvent ) {
|
42
|
+
this.fire( domEvent.type, domEvent );
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Fired when the mouse is moved over one of the editables.
|
48
|
+
*
|
49
|
+
* Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
|
50
|
+
*
|
51
|
+
* Note that this event is not available by default. To make it available,
|
52
|
+
* {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
|
53
|
+
* to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
|
54
|
+
*
|
55
|
+
* @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
|
56
|
+
* @event module:engine/view/document~Document#event:mousemove
|
57
|
+
* @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
|
58
|
+
*/
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Fired when the mouse is moved out of one of the editables.
|
62
|
+
*
|
63
|
+
* Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
|
64
|
+
*
|
65
|
+
* Note that this event is not available by default. To make it available,
|
66
|
+
* {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
|
67
|
+
* to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
|
68
|
+
*
|
69
|
+
* @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
|
70
|
+
* @event module:engine/view/document~Document#event:mouseleave
|
71
|
+
* @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
|
72
|
+
*/
|