playbook_ui 16.0.0.pre.alpha.PLAY267213608 → 16.0.0.pre.alpha.PLAY267213609
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_input_options.html.erb +14 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_input_options.md +3 -1
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +1 -6
- data/app/pb_kits/playbook/pb_textarea/textarea.rb +26 -0
- data/lib/playbook/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb35019a1dc4a0f44e2ddb2686b53ca34b1af7a59146043718cf92ce68941f30
|
|
4
|
+
data.tar.gz: cff5eb2f7f9ef4613eec3398ba610776159b36324eb1a532ae0a702582aab542
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c03880f75090837ed00af9495ff4550bdc9a4a18d5faaff5c4623c1e49ae7f57c251e532d06b6b54e88517c7408abef1d3dd923de96cb14a3eb23664acd9b0a7
|
|
7
|
+
data.tar.gz: c0f9684544d8e1d892861cc9135d3bf3e020d46faa9117e938bee503dbe008c847108ef6b6bae0a501f47c1228b4a3451bad309c02fcc55e55202c078b11de27
|
|
@@ -23,3 +23,17 @@
|
|
|
23
23
|
name: "comment",
|
|
24
24
|
rows: 4
|
|
25
25
|
}) %>
|
|
26
|
+
|
|
27
|
+
<br/>
|
|
28
|
+
|
|
29
|
+
<%= pb_rails("textarea", props: {
|
|
30
|
+
label: "Data and ARIA Attributes",
|
|
31
|
+
name: "description",
|
|
32
|
+
rows: 4,
|
|
33
|
+
input_options: {
|
|
34
|
+
'aria-label': "Enter description",
|
|
35
|
+
'aria-describedby': "help-text",
|
|
36
|
+
data: { controller: "textarea", action: "focus->handleFocus" },
|
|
37
|
+
id: "description-textarea"
|
|
38
|
+
}
|
|
39
|
+
}) %>
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
Use the `
|
|
1
|
+
Use the `input_options` / `inputOptions` prop to pass additional attributes directly to the underlying `<textarea>` element instead of the outer wrapper. This is useful for applying data attributes, custom IDs, ARIA attributes, or other HTML attributes that need to be on the textarea element itself.
|
|
2
|
+
|
|
3
|
+
Additional HTML attributes (e.g. data or ARIA attributes) can also be passed directly to the `<textarea>` via `input_options`.
|
|
@@ -11,12 +11,7 @@
|
|
|
11
11
|
<%= text_area_tag(
|
|
12
12
|
object.name,
|
|
13
13
|
object.value,
|
|
14
|
-
|
|
15
|
-
:id => object.input_options[:id],
|
|
16
|
-
:max_characters => object.max_characters,
|
|
17
|
-
:onkeyup => object.onkeyup,
|
|
18
|
-
:placeholder => object.placeholder,
|
|
19
|
-
:rows => object.rows) %>
|
|
14
|
+
object.all_textarea_attributes) %>
|
|
20
15
|
<% if object.error %>
|
|
21
16
|
<% if object.character_count %>
|
|
22
17
|
<%= pb_rails("flex", props: { spacing: "between", vertical: "center" }) do %>
|
|
@@ -38,6 +38,32 @@ module Playbook
|
|
|
38
38
|
}
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
def all_textarea_attributes
|
|
42
|
+
# Merge data attributes: emoji_mask data + input_options data
|
|
43
|
+
data_attrs = textarea_options[:data] || {}
|
|
44
|
+
input_data = input_options[:data] || {}
|
|
45
|
+
merged_data = data_attrs.merge(input_data)
|
|
46
|
+
|
|
47
|
+
base_attributes = {
|
|
48
|
+
id: input_options[:id] || "object_method",
|
|
49
|
+
max_characters: max_characters,
|
|
50
|
+
name: name,
|
|
51
|
+
onkeyup: onkeyup,
|
|
52
|
+
placeholder: placeholder,
|
|
53
|
+
rows: rows,
|
|
54
|
+
value: value,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
# Merge input_options (excluding data to handle separately)
|
|
58
|
+
input_options_without_data = input_options.except(:data)
|
|
59
|
+
result = base_attributes.merge(input_options_without_data)
|
|
60
|
+
|
|
61
|
+
# Add merged data if present (input_options data takes precedence over emoji_mask data)
|
|
62
|
+
result[:data] = merged_data unless merged_data.empty?
|
|
63
|
+
|
|
64
|
+
result
|
|
65
|
+
end
|
|
66
|
+
|
|
41
67
|
private
|
|
42
68
|
|
|
43
69
|
def error_class
|
data/lib/playbook/version.rb
CHANGED