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-9332: Add refine text support to eztext fields #1416

Open
wants to merge 1 commit into
base: 4.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
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
Loading