8
0

tablecellproperties.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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/tablecellproperties
  7. */
  8. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  9. import TableCellPropertiesUI from './tablecellproperties/tablecellpropertiesui';
  10. import TableCellPropertiesEditing from './tablecellproperties/tablecellpropertiesediting';
  11. /**
  12. * The table cell properties feature.
  13. *
  14. * This is a "glue" plugin that loads the
  15. * {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing table cell properties editing feature} and
  16. * the {@link module:table/tablecellproperties/tablecellpropertiesui~TableCellPropertiesUI table cell properties UI feature}.
  17. *
  18. * @extends module:core/plugin~Plugin
  19. */
  20. export default class TableCellProperties extends Plugin {
  21. /**
  22. * @inheritDoc
  23. */
  24. static get pluginName() {
  25. return 'TableCellProperties';
  26. }
  27. /**
  28. * @inheritDoc
  29. */
  30. static get requires() {
  31. return [ TableCellPropertiesEditing, TableCellPropertiesUI ];
  32. }
  33. }
  34. /**
  35. * The configuration of the table cell properties user interface (balloon). It allows to define:
  36. *
  37. * * The color palette for the cell border color style field (`tableCellProperties.borderColors`),
  38. * * The color palette for the cell background style field (`tableCellProperties.backgroundColors`).
  39. *
  40. * const tableConfig = {
  41. * tableCellProperties: {
  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 cell background and the cell 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#tableCellProperties
  72. */