From a5bf5d3e2db76e33f53373aa59979b9e8e815c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kuna?= <1282324+codecalm@users.noreply.github.com> Date: Mon, 27 Jan 2025 22:32:51 +0100 Subject: [PATCH] Fix icons in `form-elements.html` (#2086) --- .changeset/large-birds-teach.md | 5 +++++ src/pages/_includes/ui/button-group.html | 8 ++++---- src/pages/_includes/ui/datepicker.html | 11 +++++------ src/pages/tags.html | 4 ++-- 4 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 .changeset/large-birds-teach.md diff --git a/.changeset/large-birds-teach.md b/.changeset/large-birds-teach.md new file mode 100644 index 000000000..041f258f9 --- /dev/null +++ b/.changeset/large-birds-teach.md @@ -0,0 +1,5 @@ +--- +"@tabler/core": patch +--- + +Fix icons in `form-elements.html` diff --git a/src/pages/_includes/ui/button-group.html b/src/pages/_includes/ui/button-group.html index a690034e6..c1ecdc1de 100644 --- a/src/pages/_includes/ui/button-group.html +++ b/src/pages/_includes/ui/button-group.html @@ -1,18 +1,18 @@ -{% assign items = include.items | split: ',' %} -{% assign icons = include.icons | split: ',' %} +{% assign button-items = include.items | split: ',' %} +{% assign button-icons = include.icons | split: ',' %} {% assign id = include.id %}
- {% for item in items %} + {% for item in button-items %} {% if include.radio %} {% endif %} <{% if include.radio %}label for="btn-radio-{{ id }}-{{ forloop.index }}"{% else %}button{% endif %} type="button" class="btn{% if forloop.index == 1 %}{% unless include.radio %} active{% endunless %}{% endif %}">{{ item }} {% endfor %} - {% for icon in icons %} + {% for icon in button-icons %} {% if include.radio %} {% endif %} diff --git a/src/pages/_includes/ui/datepicker.html b/src/pages/_includes/ui/datepicker.html index fd18fbb97..132e227c2 100644 --- a/src/pages/_includes/ui/datepicker.html +++ b/src/pages/_includes/ui/datepicker.html @@ -1,16 +1,15 @@ {% assign value = include.value | default: '2020-06-20' %} {% assign placeholder = include.placeholder | default: 'Select a date' %} -{% assign id = include.id %} -{% if id %} +{% if include.id %} {% capture input %} - + {% endcapture %} {% if include.inline %} -
+
{% elsif include.layout == 'icon' %}
{{ input | replace: include.class, '' }} @@ -33,8 +32,8 @@ window.tabler_datepicker = window.tabler_datepicker || {}; {% endif %} - window.Litepicker && ({% if environment == 'development' %}window.tabler_datepicker["datepicker-{{ id }}"] = {% endif %}new Litepicker({ - element: document.getElementById('datepicker-{{ id }}'), + window.Litepicker && ({% if environment == 'development' %}window.tabler_datepicker["datepicker-{{ include.id }}"] = {% endif %}new Litepicker({ + element: document.getElementById('datepicker-{{ include.id }}'), buttonText: { previousMonth: `{% capture icon %}{% include "ui/icon.html" icon="chevron-left" %}{% endcapture %}{{ icon | strip }}`, nextMonth: `{% capture icon %}{% include "ui/icon.html" icon="chevron-right" %}{% endcapture %}{{ icon | strip }}`, diff --git a/src/pages/tags.html b/src/pages/tags.html index 392806566..b9b628905 100644 --- a/src/pages/tags.html +++ b/src/pages/tags.html @@ -6,7 +6,7 @@ layout: default permalink: tags.html --- -{% assign icons = "bold,italic,underline,copy,scissors,file-plus,file-minus,ghost,star,script,photo,dog,piano" | split: "," %} +{% assign tag-icons = "bold,italic,underline,copy,scissors,file-plus,file-minus,ghost,star,script,photo,dog,piano" | split: "," %}
@@ -41,7 +41,7 @@ permalink: tags.html

Tags with icon

- {% for icon in icons %} + {% for icon in tag-icons %} {% include "ui/tag.html" text=icon icon=icon %} {% endfor %}