openproject-primer_view_components 0.41.0 → 0.41.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/primer/forms/text_area.rb +7 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/alpha/text_area_preview.rb +5 -2
- data/previews/primer/forms_preview/custom_width_fields_form.html.erb +34 -2
- metadata +2 -3
- data/app/forms/custom_width_fields_form.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a378c7a5a9aa4f33d427d21fddb301b0dbe46e538447ee4376907a43a0c8a235
|
4
|
+
data.tar.gz: 13380df59b216e1a5cb953ef4c68e4101e03d1b99f3f2b81c0f0d727e90db3b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 420aa7dd1d778a2769be9ca66c2741b736154d55b1d8ebdddc3d1dac2f58e3285d78ad8593397de3d405a3adf714390c48392732176ee5165585db1ab1bfc73f
|
7
|
+
data.tar.gz: 176fb4d46710b64a9fcef77cb53cb7d3934267298b9a2219c38a84f9d16d11717a43b9efb96344a0f2db3225811faf3853edda2a427d7e34648e5b280507d330
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.41.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#159](https://github.com/opf/primer_view_components/pull/159) [`f2517d6`](https://github.com/opf/primer_view_components/commit/f2517d65708cff07bef5714e1af28c15fc49915e) Thanks [@oliverguenther](https://github.com/oliverguenther)! - Allow input_width on text_area
|
8
|
+
|
3
9
|
## 0.41.0
|
4
10
|
|
5
11
|
### Minor Changes
|
@@ -10,8 +10,14 @@ module Primer
|
|
10
10
|
@input = input
|
11
11
|
@input.add_input_classes("FormControl-input", "FormControl-textarea")
|
12
12
|
|
13
|
+
wrap_classes = [
|
14
|
+
"FormControl-input-wrap",
|
15
|
+
]
|
16
|
+
|
17
|
+
wrap_classes << Primer::Forms::Dsl::Input::INPUT_WIDTH_MAPPINGS[@input.input_width] if @input.input_width
|
18
|
+
|
13
19
|
@field_wrap_arguments = {
|
14
|
-
class: class_names(
|
20
|
+
class: class_names(wrap_classes),
|
15
21
|
hidden: @input.hidden?
|
16
22
|
}
|
17
23
|
end
|
@@ -16,6 +16,7 @@ module Primer
|
|
16
16
|
# @param disabled toggle
|
17
17
|
# @param invalid toggle
|
18
18
|
# @param validation_message text
|
19
|
+
# @param input_width [Symbol] select [auto, small, medium, large, xlarge, xxlarge]
|
19
20
|
def playground(
|
20
21
|
name: "my-text-area",
|
21
22
|
id: "my-text-area",
|
@@ -26,7 +27,8 @@ module Primer
|
|
26
27
|
full_width: true,
|
27
28
|
disabled: false,
|
28
29
|
invalid: false,
|
29
|
-
validation_message: nil
|
30
|
+
validation_message: nil,
|
31
|
+
input_width: nil
|
30
32
|
)
|
31
33
|
system_arguments = {
|
32
34
|
name: name,
|
@@ -38,7 +40,8 @@ module Primer
|
|
38
40
|
full_width: full_width,
|
39
41
|
disabled: disabled,
|
40
42
|
invalid: invalid,
|
41
|
-
validation_message: validation_message
|
43
|
+
validation_message: validation_message,
|
44
|
+
input_width: input_width
|
42
45
|
}
|
43
46
|
|
44
47
|
render(Primer::Alpha::TextArea.new(**system_arguments))
|
@@ -1,5 +1,37 @@
|
|
1
|
-
|
1
|
+
<%
|
2
|
+
custom_width_form = Class.new(ApplicationForm) do
|
3
|
+
form do |f|
|
4
|
+
f.text_field(
|
5
|
+
name: :ultimate_answer,
|
6
|
+
label: "Ultimate answer",
|
7
|
+
required: true,
|
8
|
+
caption: "The answer to life, the universe, and everything",
|
9
|
+
input_width: :medium
|
10
|
+
)
|
11
|
+
|
12
|
+
f.select_list(
|
13
|
+
name: "cities",
|
14
|
+
label: "Cool cities",
|
15
|
+
caption: "Select your favorite!",
|
16
|
+
include_blank: true,
|
17
|
+
input_width: :small
|
18
|
+
) do |city_list|
|
19
|
+
city_list.option(label: "Lopez Island", value: "lopez_island")
|
20
|
+
city_list.option(label: "Bellevue", value: "bellevue")
|
21
|
+
city_list.option(label: "Seattle", value: "seattle")
|
22
|
+
end
|
23
|
+
|
24
|
+
f.text_field(
|
25
|
+
name: :lots_of_text,
|
26
|
+
label: "Lots of text",
|
27
|
+
required: true,
|
28
|
+
caption: "What else do you need?",
|
29
|
+
input_width: :small
|
30
|
+
)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
%>
|
2
34
|
|
3
35
|
<%= primer_form_with(url: "/foo") do |f| %>
|
4
|
-
<%= render(
|
36
|
+
<%= render(custom_width_form.new(f)) %>
|
5
37
|
<% end %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openproject-primer_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.41.
|
4
|
+
version: 0.41.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-08-
|
12
|
+
date: 2024-08-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionview
|
@@ -568,7 +568,6 @@ files:
|
|
568
568
|
- app/forms/check_box_group_form.rb
|
569
569
|
- app/forms/check_box_with_nested_form.rb
|
570
570
|
- app/forms/composed_form.rb
|
571
|
-
- app/forms/custom_width_fields_form.rb
|
572
571
|
- app/forms/example_toggle_switch_form.rb
|
573
572
|
- app/forms/example_toggle_switch_form/example_field_caption.html.erb
|
574
573
|
- app/forms/first_name_form.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# :nodoc:
|
4
|
-
class CustomWidthFieldsForm < ApplicationForm
|
5
|
-
form do |f|
|
6
|
-
f.text_field(
|
7
|
-
name: :ultimate_answer,
|
8
|
-
label: "Ultimate answer",
|
9
|
-
required: true,
|
10
|
-
caption: "The answer to life, the universe, and everything",
|
11
|
-
input_width: :medium
|
12
|
-
)
|
13
|
-
|
14
|
-
f.select_list(
|
15
|
-
name: "cities",
|
16
|
-
label: "Cool cities",
|
17
|
-
caption: "Select your favorite!",
|
18
|
-
include_blank: true,
|
19
|
-
input_width: :small
|
20
|
-
) do |city_list|
|
21
|
-
city_list.option(label: "Lopez Island", value: "lopez_island")
|
22
|
-
city_list.option(label: "Bellevue", value: "bellevue")
|
23
|
-
city_list.option(label: "Seattle", value: "seattle")
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|