8
0

tableproperties.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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/tableproperties
  7. */
  8. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  9. import TablePropertiesEditing from './tableproperties/tablepropertiesediting';
  10. import TablePropertiesUI from './tableproperties/tablepropertiesui';
  11. /**
  12. * The table properties feature.
  13. *
  14. * This is a "glue" plugin that loads the
  15. * {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing table editing feature} and
  16. * the {@link module:table/tableproperties/tablepropertiesui~TablePropertiesUI table properties UI feature}.
  17. *
  18. * @extends module:core/plugin~Plugin
  19. */
  20. export default class TableProperties extends Plugin {
  21. /**
  22. * @inheritDoc
  23. */
  24. static get pluginName() {
  25. return 'TableProperties';
  26. }
  27. /**
  28. * @inheritDoc
  29. */
  30. static get requires() {
  31. return [ TablePropertiesEditing, TablePropertiesUI ];
  32. }
  33. }
  34. /**
  35. * The configuration of the table properties user interface (balloon). It allows to define:
  36. *
  37. * * The color palette for the table border color style field (`tableProperties.borderColors`),
  38. * * The color palette for the table background style field (`tableProperties.backgroundColors`).
  39. *
  40. * const tableConfig = {
  41. * tableProperties: {
  42. * borderColors: [
  43. * {
  44. * color: 'hsl(0, 0%, 90%)',
  45. * label: 'Light grey'
  46. * },
  47. * // ...
  48. * ],
  49. * backgroundColors: [
  50. * {
  51. * color: 'hsl(120, 75%, 60%)',
  52. * label: 'Green'
  53. * },
  54. * // ...
  55. * ]
  56. * }
  57. * };
  58. *
  59. * **Note**: The configurations do not impact the data loaded into the editor,
  60. * i.e. they do not limit or filter the colors in the data. They are used only in the user interface
  61. * allowing users to pick colors in a more convenient way.
  62. *
  63. * The default color palettes for the table background and the table border are the same
  64. * ({@link module:table/ui/utils~defaultColors check out their content}).
  65. *
  66. * Both color palette configurations must follow the
  67. * {@link module:table/table~TableColorConfig table color configuration format}.
  68. *
  69. * Read more about configuring the table feature in {@link module:table/table~TableConfig}.
  70. *
  71. * @member {Object} module:table/table~TableConfig#tableProperties
  72. */