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

IBX-9463: Disabled field based on passed attribute #1461

Merged
merged 2 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% set is_password_input = is_password_input|default(is_password_type) %}
{% set has_search = has_search|default(false) %}
{% set is_multiline = is_multiline|default(false) %}
{% set is_disabled = is_disabled|default(false) %}
{% set extra_btn = extra_btn|default({})|merge({
label: extra_btn.label|default(''),
attr: extra_btn.attr|default({})|merge({
Expand Down Expand Up @@ -33,6 +34,7 @@
type="button"
class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text ibexa-input-text-wrapper__action-btn ibexa-input-text-wrapper__action-btn--clear"
tabindex="-1"
{{ is_disabled ? 'disabled' }}
{% if should_clear_button_send_form %}data-send-form-after-clearing{% endif %}
>
<svg class="ibexa-icon ibexa-icon--tiny-small">
Expand All @@ -44,6 +46,7 @@
type="button"
class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text ibexa-input-text-wrapper__action-btn ibexa-input-text-wrapper__action-btn--password-toggler"
tabindex="5"
{{ is_disabled ? 'disabled' }}
>
<svg class="ibexa-icon ibexa-icon--small ibexa-input-text-wrapper__password-show">
<use xlink:href="{{ ibexa_icon_path('view') }}"></use>
Expand All @@ -53,7 +56,12 @@
</svg>
</button>
{% elseif has_search %}
<button type="{{ search_button_type|default('submit') }}" class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text ibexa-input-text-wrapper__action-btn ibexa-input-text-wrapper__action-btn--search" tabindex="-1">
<button
type="{{ search_button_type|default('submit') }}"
class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text ibexa-input-text-wrapper__action-btn ibexa-input-text-wrapper__action-btn--search"
tabindex="-1"
{{ is_disabled ? 'disabled' }}
>
<svg class="ibexa-icon ibexa-icon--small">
<use xlink:href="{{ ibexa_icon_path('search') }}"></use>
</svg>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

{% set is_small = is_small|default(false) %}
{% set is_datetime_popup_inline = is_datetime_popup_inline|default(false) %}
{% set is_disabled = is_disabled|default(false) %}

{% set wrapper_attr = wrapper_attr|default({})|merge({
class: (wrapper_attr.class|default('')
Expand All @@ -17,6 +18,7 @@
readonly: 'readonly',
type: 'text',
placeholder: input_attr.placeholder|default(' '),
disabled: is_disabled
}) %}

{% embed '@ibexadesign/ui/component/input_text.html.twig' with { has_search: false } %}
Expand All @@ -30,6 +32,7 @@
<button
type="button"
class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text ibexa-input-text-wrapper__action-btn ibexa-input-text-wrapper__action-btn--calendar"
{{ is_disabled ? "disabled" }}
>
<svg class="ibexa-icon ibexa-icon--small">
<use xlink:href="{{ ibexa_icon_path('date') }}"></use>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@
{%- block date_time_picker_widget -%}
<div class="ibexa-picker">
{% include '@ibexadesign/ui/component/inputs/input_date_time_picker.html.twig' with {
input_attr: { class: 'ibexa-picker__input' }
input_attr: { class: 'ibexa-picker__input' },
is_disabled: attr.disabled|default(false)
} %}
{% set attr = attr|merge({ 'hidden': true, 'class': 'ibexa-picker__form-input' }) %}
{{ block('form_widget') }}
Expand Down
Loading