Fix Unexpected slot that is not declared: table, caption, colgroup, header, body, footer

Created on 18 July 2023, over 1 year ago
Updated 5 September 2023, over 1 year ago

Problem/Motivation

Twig\Error\SyntaxError: An exception has been thrown during the compilation of a template ("We found an unexpected slot that is not declared: [table, caption, colgroup, header, body, footer]. Please declare them in "table.component.yml"."). in Twig\Environment->compileSource() (line 42 of modules/contrib/varbase_components/components/organisms/table/table.twig).

Proposed resolution

Bootstrap ~5.3.0 Documentation on Tables

Available properties:
  • responsive: Responsive tables allow tables to be scrolled horizontally with ease. Make any table responsive across all viewports.
  • color: Table Background Color - Set a background contextual classes to color tables.
  • striped_rows: Use to add zebra-striping to any table row within the `<tbody>`. Works with `no_striping` is false.
  • striped_columns: Use to add zebra-striping to any table column. Works with `no_striping` is false.
  • hover: Enable a hover state on table rows within a `<tbody>`.
  • bordered: Add borders on all sides of the table and cells.
  • border_color: Use the border color utility to change border colors.
  • borderless: Add `.table-borderless` for a table without borders.
  • size: Use sm for small to make any table more compact by cutting all cell padding in half.
  • caption: A localized string for the `<caption>` tag.
  • colgroups: Column groups which contains attributes
  • header: Table header cells which contains (tag, attributes, content, field, sort)
  • sticky: A flag indicating whether to use a sticky table header. ( set `responsive` to false for sticky to work)
  • rows: Table rows, which each row contains (attributes, data, no_striping, cells). Each cell contains (tag, attributes, content, active_table_sort)
  • footer: Table footer rows, in the same format as the rows variable.
  • empty: The message to display in an extra row if table does not have any rows.
  • no_striping: A boolean indicating that the row should receive no striping.
  • header_columns: The number of columns in the header.
  • utility_classes: An array of utility classes. Use to add extra Bootstrap utility classes or custom CSS classes over to the table element.
  • thead_utility_classes: An array of utility classes. Use to add extra Bootstrap utility classes or custom CSS classes over to the head of the table element.
  • tbody_utility_classes: An array of utility classes. Use to add extra Bootstrap utility classes or custom CSS classes over to the body of the table element.
  • tfoot_utility_classes: An array of utility classes. Use to add extra Bootstrap utility classes or custom CSS classes over to the footer of the table element.

Available attributes:

  • attributes: HTML attributes to apply to the `<table>` tag.
  • thead_attributes: HTML attributes to apply to the `<thead>` tag.
  • tbody_attributes: HTML attributes to apply to the `<tbody>` tag.
  • tfoot_attributes: HTML attributes to apply to the `<tfoot>` tag.

Available slots:

  • N/A

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ✅ Accessibility and Readability
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ❌ Release varbase-10.0.0-beta1, varbase_components-2.0.0-alpha21

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

Varbase Components - Bootstrap ~5.3.0 Table - Storybook

Table - Storybook - Striped rows

Table - Storybook - Striped columns

Table - Storybook - Small Table

Table - Storybook - Dark

Table - Storybook - Sticky table header

Auto-Docs - Storybook for Table

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇯🇴Jordan ahmad abbad Jordan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024