Add data-table render templates; expand zn-style and query-builder#84
Open
felippe-ch wants to merge 2 commits into
Open
Add data-table render templates; expand zn-style and query-builder#84felippe-ch wants to merge 2 commits into
felippe-ch wants to merge 2 commits into
Conversation
Data-table - Add per-column render templates inspired by DataTables.net columns.render: * displayTemplates: Record<string, DisplayTemplate> on the component * header.renderTemplate: name lookup into displayTemplates * header.render: inline DisplayTemplate function (JS-property only) * <script type="zn-templates"> child compiled at connect for fully-declarative use - Add column-level cell defaults: header.cellTemplate (data wins) and header.ifEmpty (fallback when cell has no text or icon) - Accept a single Row on the data property in addition to Row[] - Plumb row + header through renderCellBody to renderCell so templates have full context zn-style - border accepts a side string (t/b/l/r combinations, plus 'a' / 'tblr' for all sides); bare <zn-style border> still renders all four for backward compatibility - size prop with xs/s/m/l/xl mapped to the existing zn-font-size tokens - muted helper class Query-builder / datepicker - QueryBuilderDateSubmitFormat = 'iso' | 'timestamp' | 'legacy' on filter items, controls how date / dateTime values are serialized at submit time - datepicker container property for shadow-DOM-friendly overlay placement - Pull air-datepicker theme rules into scss/air-datapicker.scss so the in-shadow global container picks up zinc tokens Utilities - deepQuery: cross-shadow-DOM querySelector helper Docs - New sections for render templates, column cell defaults, border sides, size, muted, and date submit format - code-previews.cjs only IIFE-wraps scripts the browser would execute as JS so data-block types like <script type="zn-templates"> survive the preview build Tests - zn-style: border side mapping, size scale, muted - data-table: single-Row data, displayTemplates surface - query: deepQuery across light DOM, single shadow, nested shadows
Jonezzyboy
requested changes
Jun 12, 2026
| hideColumn?: boolean; | ||
| secondary?: boolean; | ||
| type?: string; | ||
| renderTemplate?: string; |
Contributor
There was a problem hiding this comment.
As discussed need to remove the render template functionality and add specific DateTime formatting as an option within data tables
| } | ||
|
|
||
| .zn-muted { | ||
| opacity: 0.5; |
Contributor
There was a problem hiding this comment.
Suggested change
| opacity: 0.5; | |
| color: var(--zn-color-muted-text); |
| * - yyyy: Full year (2024) | ||
| */ | ||
| @property() format: string = 'MM/dd/yyyy'; | ||
| @property() format: string = 'dd/MM/yyyy'; |
Contributor
There was a problem hiding this comment.
We shouldn't be changing the default format, we specifically chose the American format.
Suggested change
| @property() format: string = 'dd/MM/yyyy'; | |
| @property() format: string = 'MM/dd/yyyy'; |
…e render templates - Change datepicker default format from dd/MM/yyyy to MM/dd/yyyy - Refactor data-table rendering: remove header.render and header.renderTemplate properties - Introduce header.type property for template lookup - Add defaultTemplates with built-in dateTime formatter - Rename _slotTemplates to _formatTemplates and initialize with defaultTemplates - Update zn-muted class to use CSS variable instead of opacity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Data-table
zn-style
Query-builder / datepicker
Utilities
Docs
Tests