@openeuropa/bcl-textarea 1.10.8 → 1.10.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/textarea.html.twig +44 -47
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-textarea",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "1.10.
|
|
5
|
+
"version": "1.10.10",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"design-system",
|
|
22
22
|
"twig"
|
|
23
23
|
],
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "9f7c4a046e8f8f325e4de7e998f1c2a654f6eed1"
|
|
25
25
|
}
|
package/textarea.html.twig
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
{% apply spaceless %}
|
|
2
|
-
|
|
3
1
|
{#
|
|
4
2
|
Parameters:
|
|
5
3
|
- id (string) (default: '')
|
|
@@ -23,7 +21,7 @@
|
|
|
23
21
|
- attributes (drupal attrs)
|
|
24
22
|
#}
|
|
25
23
|
|
|
26
|
-
{
|
|
24
|
+
{%- set _id = id|default('') %}
|
|
27
25
|
{% set _label = label|default('') %}
|
|
28
26
|
{% set _required = required ?? false %}
|
|
29
27
|
{% set _disabled = disabled ?? false %}
|
|
@@ -42,60 +40,60 @@
|
|
|
42
40
|
{% set _horizontal_class = horizontal_class|default('col-sm-10') %}
|
|
43
41
|
{% set _horizontal_label_class = horizontal_label_class|default('col-sm-2') %}
|
|
44
42
|
|
|
45
|
-
{
|
|
43
|
+
{%- set _label_block = false %}
|
|
46
44
|
{% set _label_class = 'form-label' %}
|
|
47
45
|
{% set _classes = ['form-control'] %}
|
|
48
46
|
|
|
49
|
-
{
|
|
50
|
-
{
|
|
47
|
+
{%- if _invalid is not empty %}
|
|
48
|
+
{%- set _classes = _classes|merge(['is-invalid']) %}
|
|
51
49
|
{% endif %}
|
|
52
50
|
{% if _valid is not empty %}
|
|
53
|
-
{
|
|
51
|
+
{%- set _classes = _classes|merge(['is-valid']) %}
|
|
54
52
|
{% endif %}
|
|
55
53
|
{% set _placeholder = placeholder|default('') %}
|
|
56
54
|
{% if _horizontal %}
|
|
57
|
-
{
|
|
55
|
+
{%- set _label_class = 'col-form-label ' ~ _horizontal_label_class %}
|
|
58
56
|
{% endif %}
|
|
59
57
|
{% if _hidden_label %}
|
|
60
|
-
{
|
|
58
|
+
{%- set _label_class = _label_class ~ ' visually-hidden' %}
|
|
61
59
|
{% endif %}
|
|
62
60
|
|
|
63
|
-
{
|
|
64
|
-
{
|
|
61
|
+
{%- if attributes is empty %}
|
|
62
|
+
{%- set attributes = create_attribute() %}
|
|
65
63
|
{% endif %}
|
|
66
64
|
|
|
67
|
-
{
|
|
65
|
+
{%- set attributes = attributes.addClass(_classes).setAttribute('rows', _rows) %}
|
|
68
66
|
|
|
69
|
-
{
|
|
70
|
-
{
|
|
67
|
+
{%- if _id %}
|
|
68
|
+
{%- set attributes = attributes.setAttribute('id', _id) %}
|
|
71
69
|
{% endif %}
|
|
72
70
|
|
|
73
|
-
{
|
|
74
|
-
{
|
|
71
|
+
{%- if _required %}
|
|
72
|
+
{%- set attributes = attributes.setAttribute('required', true) %}
|
|
75
73
|
{% endif %}
|
|
76
74
|
|
|
77
|
-
{
|
|
78
|
-
{
|
|
75
|
+
{%- if _disabled %}
|
|
76
|
+
{%- set attributes = attributes.setAttribute('disabled', true) %}
|
|
79
77
|
{% endif %}
|
|
80
78
|
|
|
81
|
-
{
|
|
82
|
-
{
|
|
79
|
+
{%- if _readonly %}
|
|
80
|
+
{%- set attributes = attributes.setAttribute('readonly', true) %}
|
|
83
81
|
{% endif %}
|
|
84
82
|
|
|
85
|
-
{
|
|
86
|
-
{
|
|
83
|
+
{%- if _placeholder is not empty %}
|
|
84
|
+
{%- set attributes = attributes.setAttribute('placeholder', _placeholder) %}
|
|
87
85
|
{% endif %}
|
|
88
86
|
|
|
89
|
-
{
|
|
90
|
-
{
|
|
87
|
+
{%- if _helper_text_id is not empty %}
|
|
88
|
+
{%- set attributes = attributes.setAttribute('aria-describedby', _helper_text_id) %}
|
|
91
89
|
{% endif %}
|
|
92
90
|
|
|
93
|
-
{
|
|
94
|
-
{% set _wrapper_class = _floating ? 'form-floating' : 'row'
|
|
91
|
+
{%- if _floating or _horizontal %}
|
|
92
|
+
{% set _wrapper_class = _floating ? 'form-floating' : 'row' -%}
|
|
95
93
|
<div class="{{ _wrapper_class }}">
|
|
96
|
-
{
|
|
94
|
+
{%- endif %}
|
|
97
95
|
{% if _label is not empty %}
|
|
98
|
-
{
|
|
96
|
+
{%- set _label_block -%}
|
|
99
97
|
<label
|
|
100
98
|
{% if _id %}
|
|
101
99
|
for="{{ _id|e('html_attr') }}"
|
|
@@ -104,37 +102,37 @@
|
|
|
104
102
|
>
|
|
105
103
|
{{- label -}}
|
|
106
104
|
</label>
|
|
107
|
-
{
|
|
105
|
+
{%- endset %}
|
|
108
106
|
{% endif %}
|
|
109
107
|
|
|
110
|
-
{
|
|
111
|
-
{{ _label_block|raw }}
|
|
112
|
-
{
|
|
113
|
-
{% if _horizontal and floating == false
|
|
108
|
+
{%- if _label_block and _floating == false %}
|
|
109
|
+
{{- _label_block|raw }}
|
|
110
|
+
{%- endif %}
|
|
111
|
+
{% if _horizontal and floating == false -%}
|
|
114
112
|
<div class="{{ _horizontal_class }}">
|
|
115
|
-
{
|
|
113
|
+
{%- endif -%}
|
|
116
114
|
<textarea
|
|
117
115
|
{{ attributes }}
|
|
118
116
|
>
|
|
119
117
|
{{- _text -}}
|
|
120
118
|
</textarea>
|
|
121
|
-
{
|
|
119
|
+
{%- if _horizontal and floating == false -%}
|
|
122
120
|
</div>
|
|
123
|
-
{
|
|
121
|
+
{%- endif %}
|
|
124
122
|
{% if _label_block and _floating %}
|
|
125
|
-
{{ _label_block|raw }}
|
|
126
|
-
{
|
|
127
|
-
{% if _invalid_feedback is not empty
|
|
123
|
+
{{- _label_block|raw }}
|
|
124
|
+
{%- endif %}
|
|
125
|
+
{% if _invalid_feedback is not empty -%}
|
|
128
126
|
<div class="invalid-feedback">
|
|
129
127
|
{{- _invalid_feedback -}}
|
|
130
128
|
</div>
|
|
131
|
-
{
|
|
132
|
-
{% if _valid_feedback is not empty
|
|
129
|
+
{%- endif %}
|
|
130
|
+
{% if _valid_feedback is not empty -%}
|
|
133
131
|
<div class="valid-feedback">
|
|
134
132
|
{{- _valid_feedback -}}
|
|
135
133
|
</div>
|
|
136
|
-
{
|
|
137
|
-
{% if _helper_text is not empty
|
|
134
|
+
{%- endif %}
|
|
135
|
+
{% if _helper_text is not empty -%}
|
|
138
136
|
<div
|
|
139
137
|
class="form-text"
|
|
140
138
|
{%- if _helper_text_id is not empty -%}
|
|
@@ -142,8 +140,7 @@
|
|
|
142
140
|
{%- endif -%}>
|
|
143
141
|
{{- _helper_text -}}
|
|
144
142
|
</div>
|
|
145
|
-
{
|
|
146
|
-
{% if _floating or _horizontal
|
|
143
|
+
{%- endif %}
|
|
144
|
+
{% if _floating or _horizontal -%}
|
|
147
145
|
</div>
|
|
148
|
-
{
|
|
149
|
-
{% endapply %}
|
|
146
|
+
{%- endif -%}
|