qms-angular 1.0.85 → 1.0.88
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 +6917 -229
- 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 +29 -12
- package/esm2015/lib/directives/dialog/dialog.content.directive.js +2 -3
- 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 +54 -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 +3 -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 +2 -2
- 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 +2 -2
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/attachments/link-attachment.component.js +2 -2
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +2 -2
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.js +2 -2
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.js +2 -2
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.js +2 -2
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +2 -2
- package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +32 -2
- 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 +6852 -219
- 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/dialog/dialog.content.directive.d.ts +1 -1
- package/lib/directives/text-truncate/text-truncate.directive.d.ts +14 -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/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/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/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/es.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/et.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/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/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/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/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 +12633 -345
- package/src/assets/qms-ckeditor-plugin/package.json +0 -1
- package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +7 -7
- 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/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/themes/core/_dialog.scss +8 -0
- package/src/themes/core/_mat-icon.scss +60 -60
- package/src/themes/core/_table.scss +55 -2
- package/src/themes/core/_typography.scss +108 -108
package/src/assets/qms-ckeditor-plugin/src/plugins/table/tableproperties/tablepropertiesediting.js
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module table/tableproperties/tablepropertiesediting
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Plugin } from 'ckeditor5/src/core';
|
11
|
+
import { addBackgroundRules, addBorderRules } from 'ckeditor5/src/engine';
|
12
|
+
|
13
|
+
import TableEditing from '../tableediting';
|
14
|
+
import {
|
15
|
+
downcastAttributeToStyle,
|
16
|
+
downcastTableAttribute,
|
17
|
+
upcastBorderStyles,
|
18
|
+
upcastStyleToAttribute
|
19
|
+
} from '../converters/tableproperties';
|
20
|
+
import TableBackgroundColorCommand from './commands/tablebackgroundcolorcommand';
|
21
|
+
import TableBorderColorCommand from './commands/tablebordercolorcommand';
|
22
|
+
import TableBorderStyleCommand from './commands/tableborderstylecommand';
|
23
|
+
import TableBorderWidthCommand from './commands/tableborderwidthcommand';
|
24
|
+
import TableWidthCommand from './commands/tablewidthcommand';
|
25
|
+
import TableHeightCommand from './commands/tableheightcommand';
|
26
|
+
import TableAlignmentCommand from './commands/tablealignmentcommand';
|
27
|
+
|
28
|
+
const ALIGN_VALUES_REG_EXP = /^(left|right)$/;
|
29
|
+
|
30
|
+
/**
|
31
|
+
* The table properties editing feature.
|
32
|
+
*
|
33
|
+
* Introduces table's model attributes and their conversion:
|
34
|
+
*
|
35
|
+
* - border: `borderStyle`, `borderColor` and `borderWidth`
|
36
|
+
* - background color: `backgroundColor`
|
37
|
+
* - horizontal alignment: `alignment`
|
38
|
+
* - width & height: `width` & `height`
|
39
|
+
*
|
40
|
+
* It also registers commands used to manipulate the above attributes:
|
41
|
+
*
|
42
|
+
* - border: `'tableBorderStyle'`, `'tableBorderColor'` and `'tableBorderWidth'` commands
|
43
|
+
* - background color: `'tableBackgroundColor'`
|
44
|
+
* - horizontal alignment: `'tableAlignment'`
|
45
|
+
* - width & height: `'tableWidth'` & `'tableHeight'`
|
46
|
+
*
|
47
|
+
* @extends module:core/plugin~Plugin
|
48
|
+
*/
|
49
|
+
export default class TablePropertiesEditing extends Plugin {
|
50
|
+
/**
|
51
|
+
* @inheritDoc
|
52
|
+
*/
|
53
|
+
static get pluginName() {
|
54
|
+
return 'TablePropertiesEditing';
|
55
|
+
}
|
56
|
+
|
57
|
+
/**
|
58
|
+
* @inheritDoc
|
59
|
+
*/
|
60
|
+
static get requires() {
|
61
|
+
return [ TableEditing ];
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* @inheritDoc
|
66
|
+
*/
|
67
|
+
init() {
|
68
|
+
const editor = this.editor;
|
69
|
+
const schema = editor.model.schema;
|
70
|
+
const conversion = editor.conversion;
|
71
|
+
|
72
|
+
editor.data.addStyleProcessorRules( addBorderRules );
|
73
|
+
enableBorderProperties( schema, conversion );
|
74
|
+
editor.commands.add( 'tableBorderColor', new TableBorderColorCommand( editor ) );
|
75
|
+
editor.commands.add( 'tableBorderStyle', new TableBorderStyleCommand( editor ) );
|
76
|
+
editor.commands.add( 'tableBorderWidth', new TableBorderWidthCommand( editor ) );
|
77
|
+
|
78
|
+
enableAlignmentProperty( schema, conversion );
|
79
|
+
editor.commands.add( 'tableAlignment', new TableAlignmentCommand( editor ) );
|
80
|
+
|
81
|
+
enableTableToFigureProperty( schema, conversion, 'width', 'width' );
|
82
|
+
editor.commands.add( 'tableWidth', new TableWidthCommand( editor ) );
|
83
|
+
|
84
|
+
enableTableToFigureProperty( schema, conversion, 'height', 'height' );
|
85
|
+
editor.commands.add( 'tableHeight', new TableHeightCommand( editor ) );
|
86
|
+
|
87
|
+
editor.data.addStyleProcessorRules( addBackgroundRules );
|
88
|
+
enableProperty( schema, conversion, 'backgroundColor', 'background-color' );
|
89
|
+
editor.commands.add( 'tableBackgroundColor', new TableBackgroundColorCommand( editor ) );
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
// Enables `'borderStyle'`, `'borderColor'` and `'borderWidth'` attributes for table.
|
94
|
+
//
|
95
|
+
// @param {module:engine/model/schema~Schema} schema
|
96
|
+
// @param {module:engine/conversion/conversion~Conversion} conversion
|
97
|
+
function enableBorderProperties( schema, conversion ) {
|
98
|
+
schema.extend( 'table', {
|
99
|
+
allowAttributes: [ 'borderWidth', 'borderColor', 'borderStyle' ]
|
100
|
+
} );
|
101
|
+
upcastBorderStyles( conversion, 'table' );
|
102
|
+
downcastTableAttribute( conversion, 'borderColor', 'border-color' );
|
103
|
+
downcastTableAttribute( conversion, 'borderStyle', 'border-style' );
|
104
|
+
downcastTableAttribute( conversion, 'borderWidth', 'border-width' );
|
105
|
+
}
|
106
|
+
|
107
|
+
// Enables the `'alignment'` attribute for table.
|
108
|
+
//
|
109
|
+
// @param {module:engine/model/schema~Schema} schema
|
110
|
+
// @param {module:engine/conversion/conversion~Conversion} conversion
|
111
|
+
function enableAlignmentProperty( schema, conversion ) {
|
112
|
+
schema.extend( 'table', {
|
113
|
+
allowAttributes: [ 'alignment' ]
|
114
|
+
} );
|
115
|
+
|
116
|
+
conversion
|
117
|
+
.attributeToAttribute( {
|
118
|
+
model: {
|
119
|
+
name: 'table',
|
120
|
+
key: 'alignment',
|
121
|
+
values: [ 'left', 'right' ]
|
122
|
+
},
|
123
|
+
view: {
|
124
|
+
left: {
|
125
|
+
key: 'style',
|
126
|
+
value: {
|
127
|
+
float: 'left'
|
128
|
+
}
|
129
|
+
},
|
130
|
+
right: {
|
131
|
+
key: 'style',
|
132
|
+
value: {
|
133
|
+
float: 'right'
|
134
|
+
}
|
135
|
+
}
|
136
|
+
},
|
137
|
+
converterPriority: 'high'
|
138
|
+
} );
|
139
|
+
|
140
|
+
conversion.for( 'upcast' )
|
141
|
+
// Support for backwards compatibility and pasting from other sources.
|
142
|
+
.attributeToAttribute( {
|
143
|
+
view: {
|
144
|
+
attributes: {
|
145
|
+
align: ALIGN_VALUES_REG_EXP
|
146
|
+
}
|
147
|
+
},
|
148
|
+
model: {
|
149
|
+
name: 'table',
|
150
|
+
key: 'alignment',
|
151
|
+
value: viewElement => viewElement.getAttribute( 'align' )
|
152
|
+
}
|
153
|
+
} );
|
154
|
+
}
|
155
|
+
|
156
|
+
// Enables conversion for an attribute for simple view-model mappings.
|
157
|
+
//
|
158
|
+
// @param {String} modelAttribute
|
159
|
+
// @param {String} styleName
|
160
|
+
// @param {module:engine/model/schema~Schema} schema
|
161
|
+
// @param {module:engine/conversion/conversion~Conversion} conversion
|
162
|
+
function enableProperty( schema, conversion, modelAttribute, styleName ) {
|
163
|
+
schema.extend( 'table', {
|
164
|
+
allowAttributes: [ modelAttribute ]
|
165
|
+
} );
|
166
|
+
upcastStyleToAttribute( conversion, 'table', modelAttribute, styleName );
|
167
|
+
downcastTableAttribute( conversion, modelAttribute, styleName );
|
168
|
+
}
|
169
|
+
|
170
|
+
// Enables conversion for an attribute for simple view (figure) to model (table) mappings.
|
171
|
+
//
|
172
|
+
// @param {String} modelAttribute
|
173
|
+
// @param {String} styleName
|
174
|
+
// @param {module:engine/model/schema~Schema} schema
|
175
|
+
// @param {module:engine/conversion/conversion~Conversion} conversion
|
176
|
+
function enableTableToFigureProperty( schema, conversion, modelAttribute, styleName ) {
|
177
|
+
schema.extend( 'table', {
|
178
|
+
allowAttributes: [ modelAttribute ]
|
179
|
+
} );
|
180
|
+
upcastStyleToAttribute( conversion, 'table', modelAttribute, styleName );
|
181
|
+
downcastAttributeToStyle( conversion, 'table', modelAttribute, styleName );
|
182
|
+
}
|
@@ -0,0 +1,397 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module table/tableproperties/tablepropertiesui
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Plugin } from 'ckeditor5/src/core';
|
11
|
+
import { ButtonView, ContextualBalloon, clickOutsideHandler, getLocalizedColorOptions, normalizeColorOptions } from 'ckeditor5/src/ui';
|
12
|
+
|
13
|
+
import { debounce } from 'lodash-es';
|
14
|
+
|
15
|
+
import TablePropertiesView from './ui/tablepropertiesview';
|
16
|
+
import tableProperties from './../theme/icons/table-properties.svg';
|
17
|
+
import {
|
18
|
+
colorFieldValidator,
|
19
|
+
getLocalizedColorErrorText,
|
20
|
+
getLocalizedLengthErrorText,
|
21
|
+
lengthFieldValidator,
|
22
|
+
lineWidthFieldValidator,
|
23
|
+
defaultColors
|
24
|
+
} from '../utils/ui/table-properties';
|
25
|
+
import { getTableWidgetAncestor } from '../utils/ui/widget';
|
26
|
+
import { getBalloonTablePositionData, repositionContextualBalloon } from '../utils/ui/contextualballoon';
|
27
|
+
|
28
|
+
const ERROR_TEXT_TIMEOUT = 500;
|
29
|
+
|
30
|
+
// Map of view properties and related commands.
|
31
|
+
const propertyToCommandMap = {
|
32
|
+
borderStyle: 'tableBorderStyle',
|
33
|
+
borderColor: 'tableBorderColor',
|
34
|
+
borderWidth: 'tableBorderWidth',
|
35
|
+
backgroundColor: 'tableBackgroundColor',
|
36
|
+
width: 'tableWidth',
|
37
|
+
height: 'tableHeight',
|
38
|
+
alignment: 'tableAlignment'
|
39
|
+
};
|
40
|
+
|
41
|
+
/**
|
42
|
+
* The table properties UI plugin. It introduces the `'tableProperties'` button
|
43
|
+
* that opens a form allowing to specify visual styling of an entire table.
|
44
|
+
*
|
45
|
+
* It uses the
|
46
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
|
47
|
+
*
|
48
|
+
* @extends module:core/plugin~Plugin
|
49
|
+
*/
|
50
|
+
export default class TablePropertiesUI extends Plugin {
|
51
|
+
/**
|
52
|
+
* @inheritDoc
|
53
|
+
*/
|
54
|
+
static get requires() {
|
55
|
+
return [ ContextualBalloon ];
|
56
|
+
}
|
57
|
+
|
58
|
+
/**
|
59
|
+
* @inheritDoc
|
60
|
+
*/
|
61
|
+
static get pluginName() {
|
62
|
+
return 'TablePropertiesUI';
|
63
|
+
}
|
64
|
+
|
65
|
+
/**
|
66
|
+
* @inheritDoc
|
67
|
+
*/
|
68
|
+
constructor( editor ) {
|
69
|
+
super( editor );
|
70
|
+
|
71
|
+
editor.config.define( 'table.tableProperties', {
|
72
|
+
borderColors: defaultColors,
|
73
|
+
backgroundColors: defaultColors
|
74
|
+
} );
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* @inheritDoc
|
79
|
+
*/
|
80
|
+
init() {
|
81
|
+
const editor = this.editor;
|
82
|
+
const t = editor.t;
|
83
|
+
|
84
|
+
/**
|
85
|
+
* The contextual balloon plugin instance.
|
86
|
+
*
|
87
|
+
* @private
|
88
|
+
* @member {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
|
89
|
+
*/
|
90
|
+
this._balloon = editor.plugins.get( ContextualBalloon );
|
91
|
+
|
92
|
+
/**
|
93
|
+
* The properties form view displayed inside the balloon.
|
94
|
+
*
|
95
|
+
* @member {module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView}
|
96
|
+
*/
|
97
|
+
this.view = this._createPropertiesView();
|
98
|
+
|
99
|
+
/**
|
100
|
+
* The batch used to undo all changes made by the form (which are live, as the user types)
|
101
|
+
* when "Cancel" was pressed. Each time the view is shown, a new batch is created.
|
102
|
+
*
|
103
|
+
* @protected
|
104
|
+
* @member {module:engine/model/batch~Batch}
|
105
|
+
*/
|
106
|
+
this._undoStepBatch = null;
|
107
|
+
|
108
|
+
editor.ui.componentFactory.add( 'tableProperties', locale => {
|
109
|
+
const view = new ButtonView( locale );
|
110
|
+
|
111
|
+
view.set( {
|
112
|
+
label: t( 'Table properties' ),
|
113
|
+
icon: tableProperties,
|
114
|
+
tooltip: true
|
115
|
+
} );
|
116
|
+
|
117
|
+
this.listenTo( view, 'execute', () => this._showView() );
|
118
|
+
|
119
|
+
const commands = Object.values( propertyToCommandMap )
|
120
|
+
.map( commandName => editor.commands.get( commandName ) );
|
121
|
+
|
122
|
+
view.bind( 'isEnabled' ).toMany( commands, 'isEnabled', ( ...areEnabled ) => (
|
123
|
+
areEnabled.some( isCommandEnabled => isCommandEnabled )
|
124
|
+
) );
|
125
|
+
|
126
|
+
return view;
|
127
|
+
} );
|
128
|
+
}
|
129
|
+
|
130
|
+
/**
|
131
|
+
* @inheritDoc
|
132
|
+
*/
|
133
|
+
destroy() {
|
134
|
+
super.destroy();
|
135
|
+
|
136
|
+
// Destroy created UI components as they are not automatically destroyed.
|
137
|
+
// See https://github.com/ckeditor/ckeditor5/issues/1341.
|
138
|
+
this.view.destroy();
|
139
|
+
}
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Creates the {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView} instance.
|
143
|
+
*
|
144
|
+
* @private
|
145
|
+
* @returns {module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView} The table
|
146
|
+
* properties form view instance.
|
147
|
+
*/
|
148
|
+
_createPropertiesView() {
|
149
|
+
const editor = this.editor;
|
150
|
+
const config = editor.config.get( 'table.tableProperties' );
|
151
|
+
const borderColorsConfig = normalizeColorOptions( config.borderColors );
|
152
|
+
const localizedBorderColors = getLocalizedColorOptions( editor.locale, borderColorsConfig );
|
153
|
+
const backgroundColorsConfig = normalizeColorOptions( config.backgroundColors );
|
154
|
+
const localizedBackgroundColors = getLocalizedColorOptions( editor.locale, backgroundColorsConfig );
|
155
|
+
const view = new TablePropertiesView( editor.locale, {
|
156
|
+
borderColors: localizedBorderColors,
|
157
|
+
backgroundColors: localizedBackgroundColors
|
158
|
+
} );
|
159
|
+
const t = editor.t;
|
160
|
+
|
161
|
+
// Render the view so its #element is available for the clickOutsideHandler.
|
162
|
+
view.render();
|
163
|
+
|
164
|
+
this.listenTo( view, 'submit', () => {
|
165
|
+
this._hideView();
|
166
|
+
} );
|
167
|
+
|
168
|
+
this.listenTo( view, 'cancel', () => {
|
169
|
+
// https://github.com/ckeditor/ckeditor5/issues/6180
|
170
|
+
if ( this._undoStepBatch.operations.length ) {
|
171
|
+
editor.execute( 'undo', this._undoStepBatch );
|
172
|
+
}
|
173
|
+
|
174
|
+
this._hideView();
|
175
|
+
} );
|
176
|
+
|
177
|
+
// Close the balloon on Esc key press.
|
178
|
+
view.keystrokes.set( 'Esc', ( data, cancel ) => {
|
179
|
+
this._hideView();
|
180
|
+
cancel();
|
181
|
+
} );
|
182
|
+
|
183
|
+
// Close on click outside of balloon panel element.
|
184
|
+
clickOutsideHandler( {
|
185
|
+
emitter: view,
|
186
|
+
activator: () => this._isViewInBalloon,
|
187
|
+
contextElements: [ this._balloon.view.element ],
|
188
|
+
callback: () => this._hideView()
|
189
|
+
} );
|
190
|
+
|
191
|
+
const colorErrorText = getLocalizedColorErrorText( t );
|
192
|
+
const lengthErrorText = getLocalizedLengthErrorText( t );
|
193
|
+
|
194
|
+
// Create the "UI -> editor data" binding.
|
195
|
+
// These listeners update the editor data (via table commands) when any observable
|
196
|
+
// property of the view has changed. They also validate the value and display errors in the UI
|
197
|
+
// when necessary. This makes the view live, which means the changes are
|
198
|
+
// visible in the editing as soon as the user types or changes fields' values.
|
199
|
+
view.on( 'change:borderStyle', this._getPropertyChangeCallback( 'tableBorderStyle' ) );
|
200
|
+
|
201
|
+
view.on( 'change:borderColor', this._getValidatedPropertyChangeCallback( {
|
202
|
+
viewField: view.borderColorInput,
|
203
|
+
commandName: 'tableBorderColor',
|
204
|
+
errorText: colorErrorText,
|
205
|
+
validator: colorFieldValidator
|
206
|
+
} ) );
|
207
|
+
|
208
|
+
view.on( 'change:borderWidth', this._getValidatedPropertyChangeCallback( {
|
209
|
+
viewField: view.borderWidthInput,
|
210
|
+
commandName: 'tableBorderWidth',
|
211
|
+
errorText: lengthErrorText,
|
212
|
+
validator: lineWidthFieldValidator
|
213
|
+
} ) );
|
214
|
+
|
215
|
+
view.on( 'change:backgroundColor', this._getValidatedPropertyChangeCallback( {
|
216
|
+
viewField: view.backgroundInput,
|
217
|
+
commandName: 'tableBackgroundColor',
|
218
|
+
errorText: colorErrorText,
|
219
|
+
validator: colorFieldValidator
|
220
|
+
} ) );
|
221
|
+
|
222
|
+
view.on( 'change:width', this._getValidatedPropertyChangeCallback( {
|
223
|
+
viewField: view.widthInput,
|
224
|
+
commandName: 'tableWidth',
|
225
|
+
errorText: lengthErrorText,
|
226
|
+
validator: lengthFieldValidator
|
227
|
+
} ) );
|
228
|
+
|
229
|
+
view.on( 'change:height', this._getValidatedPropertyChangeCallback( {
|
230
|
+
viewField: view.heightInput,
|
231
|
+
commandName: 'tableHeight',
|
232
|
+
errorText: lengthErrorText,
|
233
|
+
validator: lengthFieldValidator
|
234
|
+
} ) );
|
235
|
+
|
236
|
+
view.on( 'change:alignment', this._getPropertyChangeCallback( 'tableAlignment' ) );
|
237
|
+
|
238
|
+
return view;
|
239
|
+
}
|
240
|
+
|
241
|
+
/**
|
242
|
+
* In this method the "editor data -> UI" binding is happening.
|
243
|
+
*
|
244
|
+
* When executed, this method obtains selected table property values from various table commands
|
245
|
+
* and passes them to the {@link #view}.
|
246
|
+
*
|
247
|
+
* This way, the UI stays up–to–date with the editor data.
|
248
|
+
*
|
249
|
+
* @private
|
250
|
+
*/
|
251
|
+
_fillViewFormFromCommandValues() {
|
252
|
+
const commands = this.editor.commands;
|
253
|
+
|
254
|
+
Object.entries( propertyToCommandMap )
|
255
|
+
.map( ( [ property, commandName ] ) => [ property, commands.get( commandName ).value || '' ] )
|
256
|
+
.forEach( ( [ property, value ] ) => this.view.set( property, value ) );
|
257
|
+
}
|
258
|
+
|
259
|
+
/**
|
260
|
+
* Shows the {@link #view} in the {@link #_balloon}.
|
261
|
+
*
|
262
|
+
* **Note**: Each time a view is shown, the new {@link #_undoStepBatch} is created that contains
|
263
|
+
* all changes made to the document when the view is visible, allowing a single undo step
|
264
|
+
* for all of them.
|
265
|
+
*
|
266
|
+
* @protected
|
267
|
+
*/
|
268
|
+
_showView() {
|
269
|
+
const editor = this.editor;
|
270
|
+
|
271
|
+
this.listenTo( editor.ui, 'update', () => {
|
272
|
+
this._updateView();
|
273
|
+
} );
|
274
|
+
|
275
|
+
// Update the view with the model values.
|
276
|
+
this._fillViewFormFromCommandValues();
|
277
|
+
|
278
|
+
this._balloon.add( {
|
279
|
+
view: this.view,
|
280
|
+
position: getBalloonTablePositionData( editor )
|
281
|
+
} );
|
282
|
+
|
283
|
+
// Create a new batch. Clicking "Cancel" will undo this batch.
|
284
|
+
this._undoStepBatch = editor.model.createBatch();
|
285
|
+
|
286
|
+
// Basic a11y.
|
287
|
+
this.view.focus();
|
288
|
+
}
|
289
|
+
|
290
|
+
/**
|
291
|
+
* Removes the {@link #view} from the {@link #_balloon}.
|
292
|
+
*
|
293
|
+
* @protected
|
294
|
+
*/
|
295
|
+
_hideView() {
|
296
|
+
const editor = this.editor;
|
297
|
+
|
298
|
+
this.stopListening( editor.ui, 'update' );
|
299
|
+
|
300
|
+
// Blur any input element before removing it from DOM to prevent issues in some browsers.
|
301
|
+
// See https://github.com/ckeditor/ckeditor5/issues/1501.
|
302
|
+
this.view.saveButtonView.focus();
|
303
|
+
|
304
|
+
this._balloon.remove( this.view );
|
305
|
+
|
306
|
+
// Make sure the focus is not lost in the process by putting it directly
|
307
|
+
// into the editing view.
|
308
|
+
this.editor.editing.view.focus();
|
309
|
+
}
|
310
|
+
|
311
|
+
/**
|
312
|
+
* Repositions the {@link #_balloon} or hides the {@link #view} if a table is no longer selected.
|
313
|
+
*
|
314
|
+
* @protected
|
315
|
+
*/
|
316
|
+
_updateView() {
|
317
|
+
const editor = this.editor;
|
318
|
+
const viewDocument = editor.editing.view.document;
|
319
|
+
|
320
|
+
if ( !getTableWidgetAncestor( viewDocument.selection ) ) {
|
321
|
+
this._hideView();
|
322
|
+
} else if ( this._isViewVisible ) {
|
323
|
+
repositionContextualBalloon( editor, 'table' );
|
324
|
+
}
|
325
|
+
}
|
326
|
+
|
327
|
+
/**
|
328
|
+
* Returns `true` when the {@link #view} is the visible in the {@link #_balloon}.
|
329
|
+
*
|
330
|
+
* @private
|
331
|
+
* @type {Boolean}
|
332
|
+
*/
|
333
|
+
get _isViewVisible() {
|
334
|
+
return this._balloon.visibleView === this.view;
|
335
|
+
}
|
336
|
+
|
337
|
+
/**
|
338
|
+
* Returns `true` when the {@link #view} is in the {@link #_balloon}.
|
339
|
+
*
|
340
|
+
* @private
|
341
|
+
* @type {Boolean}
|
342
|
+
*/
|
343
|
+
get _isViewInBalloon() {
|
344
|
+
return this._balloon.hasView( this.view );
|
345
|
+
}
|
346
|
+
|
347
|
+
/**
|
348
|
+
* Creates a callback that when executed upon {@link #view view's} property change
|
349
|
+
* executes a related editor command with the new property value.
|
350
|
+
*
|
351
|
+
* @private
|
352
|
+
* @param {String} commandName
|
353
|
+
* @returns {Function}
|
354
|
+
*/
|
355
|
+
_getPropertyChangeCallback( commandName ) {
|
356
|
+
return ( evt, propertyName, newValue ) => {
|
357
|
+
this.editor.execute( commandName, {
|
358
|
+
value: newValue,
|
359
|
+
batch: this._undoStepBatch
|
360
|
+
} );
|
361
|
+
};
|
362
|
+
}
|
363
|
+
|
364
|
+
/**
|
365
|
+
* Creates a callback that when executed upon {@link #view view's} property change:
|
366
|
+
* * executes a related editor command with the new property value if the value is valid,
|
367
|
+
* * or sets the error text next to the invalid field, if the value did not pass the validation.
|
368
|
+
*
|
369
|
+
* @private
|
370
|
+
* @param {Object} options
|
371
|
+
* @param {String} options.commandName
|
372
|
+
* @param {module:ui/view~View} options.viewField
|
373
|
+
* @param {Function} options.validator
|
374
|
+
* @param {String} options.errorText
|
375
|
+
* @returns {Function}
|
376
|
+
*/
|
377
|
+
_getValidatedPropertyChangeCallback( { commandName, viewField, validator, errorText } ) {
|
378
|
+
const setErrorTextDebounced = debounce( () => {
|
379
|
+
viewField.errorText = errorText;
|
380
|
+
}, ERROR_TEXT_TIMEOUT );
|
381
|
+
|
382
|
+
return ( evt, propertyName, newValue ) => {
|
383
|
+
setErrorTextDebounced.cancel();
|
384
|
+
|
385
|
+
if ( validator( newValue ) ) {
|
386
|
+
this.editor.execute( commandName, {
|
387
|
+
value: newValue,
|
388
|
+
batch: this._undoStepBatch
|
389
|
+
} );
|
390
|
+
|
391
|
+
viewField.errorText = null;
|
392
|
+
} else {
|
393
|
+
setErrorTextDebounced();
|
394
|
+
}
|
395
|
+
};
|
396
|
+
}
|
397
|
+
}
|