Skip to content

Commit

Permalink
extext actions support
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabowskiM committed Jan 9, 2025
1 parent c4dfa51 commit 27283f4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/bundle/Resources/public/js/scripts/admin.input.text.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
recalculateStyling();
};
const recalculateInputStyling = (inputActionsContainer) => {
const input = inputActionsContainer.closest('.ibexa-input-text-wrapper').querySelector('input');
const textWrapper = inputActionsContainer.closest('.ibexa-input-text-wrapper');
const inputType = textWrapper.classList.contains('ibexa-input-text-wrapper--multiline') ? 'textarea' : 'input';
const input = textWrapper.querySelector(inputType);

if (!input) {
return;
Expand Down
10 changes: 10 additions & 0 deletions src/bundle/Resources/public/scss/_inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,16 @@
}
}

&--multiline {
.ibexa-input-text-wrapper {
&__actions {
right: calculateRem(24px);
top: calculateRem(16px);
transform: none;
}
}
}

&:hover {
.ibexa-input {
border-color: var(--ibexa-input-hover-border-color, #{$ibexa-color-primary});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% set is_password_type = type|default('') == 'password' %}
{% 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 extra_btn = extra_btn|default({})|merge({
label: extra_btn.label|default(''),
attr: extra_btn.attr|default({})|merge({
Expand All @@ -20,6 +21,7 @@
~ (is_password_input ? ' ibexa-input-text-wrapper--password')
~ (type is defined ? " ibexa-input-text-wrapper--type-#{type}")
~ (extra_btn.label ? ' ibexa-input-text-wrapper--extra-btn')
~ (is_multiline ? ' ibexa-input-text-wrapper--multiline')
)|trim
}) %}

Expand Down
13 changes: 12 additions & 1 deletion src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,18 @@

{% block textarea_widget -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' ibexa-input ibexa-input--textarea')|trim}) %}
{{- parent() -}}
{%- set input_html -%}
{{- parent() -}}
{%- endset -%}
{%- embed '@ibexadesign/ui/component/input_text.html.twig' with { is_multiline: true } -%}
{% block content %}
{{ input_html }}
{% endblock %}

{% block actions %}
{{ extra_actions_after|default(null)}}
{% endblock %}
{%- endembed -%}
{%- endblock textarea_widget %}

{%- block richtext_widget -%}
Expand Down

0 comments on commit 27283f4

Please sign in to comment.