Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default table properties via configuration #9219

Closed
tony opened this issue Mar 11, 2021 · 5 comments · Fixed by #9555
Closed

Default table properties via configuration #9219

tony opened this issue Mar 11, 2021 · 5 comments · Fixed by #9555
Assignees
Labels
package:table type:feature This issue reports a feature request (an idea for a new functionality or a missing option).

Comments

@tony
Copy link
Contributor

tony commented Mar 11, 2021

📝 Provide a description of the new feature

What is the expected behavior of the proposed feature?

e.g. How do we configure the default table styles? I want a 1px border with certain colors to be pre-filled.

Example:

{
  table: {
    tableProperties: {
      defaults: {
        borderColor: 'red',
        borderWidth: '1',
        borderStyle: 'solid'
      }
   }
}

Upon the user inserting a table, they should see:

image

History: To avoid confusion, this remakes #6363's original post as its topic changed and it was closed. The new topic at #6841 is speaking about something different than setting default (clearing the value vs setting none to negate?)


If you'd like to see this feature implemented, add a 👍 reaction to this post.

@tony tony added the type:feature This issue reports a feature request (an idea for a new functionality or a missing option). label Mar 11, 2021
@tony tony changed the title Default table properties when inserting new table Default table/cell properties via configuration Mar 12, 2021
@tony tony changed the title Default table/cell properties via configuration Default table and cell properties via configuration Mar 12, 2021
@Mgsy Mgsy added package:table squad:core Issue to be handled by the Core team. labels Mar 15, 2021
@Mgsy Mgsy added this to the backlog milestone Mar 15, 2021
@oleq
Copy link
Member

oleq commented Mar 15, 2021

Related to #8502.

@Reinmar
Copy link
Member

Reinmar commented Mar 24, 2021

We'll be checking whether we cannot cover all properties at once when working on #8502. However, alignment is a higher priority so if covering all props would increase the scope too much, we'll focus on alignment only.

@pomek
Copy link
Member

pomek commented Mar 26, 2021

The proposed solution is being developed/tracked in the other issue – #8502 (comment).

@tony
Copy link
Contributor Author

tony commented Mar 26, 2021

@pomek Looking good!

@pomek pomek self-assigned this Mar 31, 2021
@pomek pomek modified the milestones: backlog, iteration 42 Mar 31, 2021
@pomek pomek added squad:compat and removed squad:core Issue to be handled by the Core team. labels Mar 31, 2021
@Mgsy Mgsy modified the milestones: iteration 42, iteration 43 Apr 15, 2021
@pomek pomek removed their assignment Apr 23, 2021
@pomek pomek modified the milestones: iteration 43, nice-to-have Apr 23, 2021
@pomek pomek changed the title Default table and cell properties via configuration Default table properties via configuration Apr 23, 2021
@pomek pomek self-assigned this Apr 23, 2021
@pomek pomek modified the milestones: nice-to-have, iteration 43 Apr 23, 2021
pomek added a commit that referenced this issue Apr 29, 2021
Feature (table): Support for the default table properties. Read more about [the feature in the documentation](https://ckeditor.com/docs/ckeditor5/latest/features/table.html). Closes #8502. Closes #9219.

Fix (engine): The conversion upcast `elementToAttribute()` and `attributeToAttribute()` functions should not call the `model.value()` callback if the element will not be converted. Closes #9536.

MINOR BREAKING CHANGE (table): Clases `TableAlignmentCommand`, `TableBackgroundColorCommand`, `TableBorderColorCommand`, `TableBorderStyleCommand`, `TableBorderWidthCommand`, `TableHeightCommand`, `TablePropertyCommand`, `TableWidthCommand` requires the second argument called `defaultValue` which is the default value for the command.

MINOR BREAKING CHANGE (table): The `TablePropertiesView` class requires additional property in the object as the second constructor argument (`options.defaultTableProperties`).
@tony
Copy link
Contributor Author

tony commented Apr 30, 2021

@pomek Thank you! The team is delighted about this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:table type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
5 participants