diff --git a/.changeset/young-penguins-perform.md b/.changeset/young-penguins-perform.md new file mode 100644 index 000000000..63109f3b1 --- /dev/null +++ b/.changeset/young-penguins-perform.md @@ -0,0 +1,5 @@ +--- +"@tabler/core": patch +--- + +Add new advanced table example diff --git a/core/scss/ui/_badges.scss b/core/scss/ui/_badges.scss index 2799be011..de465004b 100644 --- a/core/scss/ui/_badges.scss +++ b/core/scss/ui/_badges.scss @@ -28,7 +28,7 @@ line-height: var(--#{$prefix}badge-line-height); @at-root a#{&} { - color: $card-bg; + background: var(--#{$prefix}bg-surface-secondary); } .icon { diff --git a/core/scss/ui/_tables.scss b/core/scss/ui/_tables.scss index 63c8b5577..b30ed0aeb 100644 --- a/core/scss/ui/_tables.scss +++ b/core/scss/ui/_tables.scss @@ -154,8 +154,24 @@ Table sort // .table-selectable { tbody tr { + .on-checked { + display: none; + } + + .on-unchecked { + display: initial; + } + &:has(.table-selectable-check:checked) { background-color: $table-active-bg; + + .on-checked { + display: initial; + } + + .on-unchecked { + display: none; + } } } } \ No newline at end of file diff --git a/preview/pages/_data/table-properties.json b/preview/pages/_data/table-properties.json new file mode 100644 index 000000000..722a82bb0 --- /dev/null +++ b/preview/pages/_data/table-properties.json @@ -0,0 +1,30 @@ +{ + "advanced-table": { + "headers": [ + { + "data-sort": "sort-name", + "name": "Name" + }, + { + "data-sort": "sort-city", + "name": "City" + }, + { + "data-sort": "sort-status", + "name": "Status" + }, + { + "data-sort": "sort-date", + "name": "Start date" + }, + { + "data-sort": "sort-tags", + "name": "Tags" + }, + { + "data-sort": "sort-category", + "name": "Category" + } + ] + } +} \ No newline at end of file diff --git a/preview/pages/_includes/js/tabler-list.html b/preview/pages/_includes/js/tabler-list.html new file mode 100644 index 000000000..1f5b4591d --- /dev/null +++ b/preview/pages/_includes/js/tabler-list.html @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/preview/pages/_includes/ui/advanced-table.html b/preview/pages/_includes/ui/advanced-table.html new file mode 100644 index 000000000..7dfe0bcf1 --- /dev/null +++ b/preview/pages/_includes/ui/advanced-table.html @@ -0,0 +1,168 @@ +{% assign table-id = include.id | default: "advanced-table" %} +{% assign statuses = 'Active,Inactive,Requested' | split: ',' %} +{% assign per-page = '10,20,50,100' | split: "," %} +{% assign categories = 'Agencies,Individual,Event,Ticket' | split: "," %} +{% assign tags = 'QTA,Event,Tickets,TODO|Event,Tickets|QTA,Event|Tickets' | split: "|" %} + +
+ Table description. +
+| + {% assign headers = table-properties.advanced-table.headers %} + {% for header in headers %} + | + + | + {% endfor %} +|||||
|---|---|---|---|---|---|---|
| + + | ++ {% include "ui/avatar.html" person=person size="xs" class="me-2" %} + {{ person.full_name }} + | ++ {{ person.city }}, {{ person.country }} + | ++ {% assign status = forloop.index | plus: 5 | random_item: statuses %} + {% if status == "Active" %} + Active + {% elsif status == "Inactive" %} + Inactive + {% else %} + Requested + {% endif %} + | ++ {{ forloop.index | random_date | date: '%B %d, %Y' }} + | +
+ {% assign item-tags = forloop.index | plus: 5 | random_item: tags %}
+ {% assign item-tags = item-tags | split: "," %}
+
+ {% for tag in item-tags %}
+ {{ tag }}
+ {% endfor %}
+
+ |
+
+
+ {{ forloop.index | random_item: categories }}
+
+
+
+
+ {% include "ui/button.html" icon="dots" icon-only %}
+
+ |
+