8
0

table.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /**
  6. * @module table/table
  7. */
  8. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  9. import TableEditing from './tableediting';
  10. import TableUI from './tableui';
  11. import TableSelection from './tableselection';
  12. import TableClipboard from './tableclipboard';
  13. import TableNavigation from './tablenavigation';
  14. import Widget from '@ckeditor/ckeditor5-widget/src/widget';
  15. import '../theme/table.css';
  16. /**
  17. * The table plugin.
  18. *
  19. * For a detailed overview, check the {@glink features/table Table feature documentation}.
  20. *
  21. * This is a "glue" plugin that loads the following table features:
  22. *
  23. * * {@link module:table/tableediting~TableEditing editing feature},
  24. * * {@link module:table/tableselection~TableSelection selection feature},
  25. * * {@link module:table/tablenavigation~TableNavigation keyboard navigation feature},
  26. * * {@link module:table/tableclipboard~TableClipboard clipboard feature},
  27. * * {@link module:table/tableui~TableUI UI feature}.
  28. *
  29. * @extends module:core/plugin~Plugin
  30. */
  31. export default class Table extends Plugin {
  32. /**
  33. * @inheritDoc
  34. */
  35. static get requires() {
  36. return [ TableEditing, TableUI, TableSelection, TableClipboard, TableNavigation, Widget ];
  37. }
  38. /**
  39. * @inheritDoc
  40. */
  41. static get pluginName() {
  42. return 'Table';
  43. }
  44. }
  45. /**
  46. * The configuration of the table feature. Used by the table feature in the `@ckeditor/ckeditor5-table` package.
  47. *
  48. * ClassicEditor
  49. * .create( editorElement, {
  50. * table: ... // Table feature options.
  51. * } )
  52. * .then( ... )
  53. * .catch( ... );
  54. *
  55. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  56. *
  57. * @interface TableConfig
  58. */
  59. /**
  60. * The configuration of the {@link module:table/table~Table} feature.
  61. *
  62. * Read more in {@link module:table/table~TableConfig}.
  63. *
  64. * @member {module:table/table~TableConfig} module:core/editor/editorconfig~EditorConfig#table
  65. */
  66. /**
  67. * An array of color definitions (either strings or objects).
  68. *
  69. * const colors = [
  70. * {
  71. * color: 'hsl(0, 0%, 60%)',
  72. * label: 'Grey'
  73. * },
  74. * 'hsl(0, 0%, 80%)',
  75. * {
  76. * color: 'hsl(0, 0%, 90%)',
  77. * label: 'Light grey'
  78. * },
  79. * {
  80. * color: 'hsl(0, 0%, 100%)',
  81. * label: 'White',
  82. * hasBorder: true
  83. * },
  84. * '#FF0000'
  85. * ]
  86. *
  87. * Usually used as a configuration parameter, for instance in
  88. * {@link module:table/table~TableConfig#tableProperties `config.table.tableProperties`}
  89. * or {@link module:table/table~TableConfig#tableCellProperties `config.table.tableCellProperties`}.
  90. *
  91. * @typedef {Array.<String|Object>} module:table/table~TableColorConfig
  92. */