tramway 3.1.2 → 3.1.2.1
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/README.md +3 -0
- data/app/components/tramway/form/date_field_component.html.haml +1 -1
- data/app/components/tramway/form/date_field_component.rb +7 -0
- data/app/components/tramway/form/datetime_field_component.html.haml +1 -1
- data/app/components/tramway/form/datetime_field_component.rb +7 -0
- data/app/components/tramway/native_text_component.html.haml +1 -1
- data/config/tailwind.config.js +1 -1
- data/lib/tramway/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: 3132f9d101d25cd7cb9cacf33921c0d10b70bce3fed987b4d50ade050611d40c
|
|
4
|
+
data.tar.gz: d6a2e0b3b9b5548d3ddb393ea3b29e005571dbfbe64a62d0920d17e206e6323f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c630a5d57c0ef7e1c4a1d656975dffd3aa51637439cc16a816198b15d90385b129c7c8b4178fb83e4c1fb1fdaaa46e9de2f77e57835f70994dfc13cf6ee7896
|
|
7
|
+
data.tar.gz: bfc68e7d6f29b8a5060dd2235a3d7d18afe7bcf33330882d8b8104fd3d2dbb65f2d9880e94e66fff003f66706f37d2a659d1cfb6c3b858e6ab7e18f7771f67da
|
data/README.md
CHANGED
|
@@ -921,6 +921,8 @@ choose when it appears. Supported events are `:hover` and `:onclick`; hover is t
|
|
|
921
921
|
`tramway_chat` renders the chat experience bundled with Tramway. Provide a chat ID, a list of message hashes, and the URL
|
|
922
922
|
that receives new messages. Each message must include an `:id` and a `:type` (either `:sent` or `:received`). Additional
|
|
923
923
|
message fields like `text`, `data`, or `sent_at` are forwarded to `tramway/chats/message_component`.
|
|
924
|
+
Message text preserves normal word wrapping and only breaks oversized words or links when needed to keep content inside the
|
|
925
|
+
message bubble.
|
|
924
926
|
|
|
925
927
|
Use `send_messages_enabled:` to control whether users can send new messages from the rendered form. It defaults to `true`.
|
|
926
928
|
When set to `false`, the text field is disabled and the waiting placeholder is shown.
|
|
@@ -1215,6 +1217,7 @@ will render [this](https://play.tailwindcss.com/xho3LfjKkK)
|
|
|
1215
1217
|
|
|
1216
1218
|
Use `size:` to control the input sizing (`:small`, `:medium`, or `:large`). The default is `:medium`, and supported inputs
|
|
1217
1219
|
rendered within the form will use the same size value.
|
|
1220
|
+
Date and datetime fields open the browser's native picker when clicking anywhere in the input, not only the picker icon.
|
|
1218
1221
|
|
|
1219
1222
|
```erb
|
|
1220
1223
|
<%= tramway_form_for @user, size: :large do |f| %>
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
= component('tramway/form/label', for: @for, class: 'mb-0') do
|
|
4
4
|
= @label
|
|
5
5
|
- classes = "#{size_class(:text_input)} #{text_input_base_classes}"
|
|
6
|
-
= @input.call @attribute,
|
|
6
|
+
= @input.call @attribute, **picker_options(classes), value: @value
|
|
@@ -4,6 +4,13 @@ module Tramway
|
|
|
4
4
|
module Form
|
|
5
5
|
# Tailwind-styled date field
|
|
6
6
|
class DateFieldComponent < TailwindComponent
|
|
7
|
+
PICKER_ONCLICK = 'try { this.showPicker && this.showPicker() } catch (error) {}'
|
|
8
|
+
|
|
9
|
+
private
|
|
10
|
+
|
|
11
|
+
def picker_options(classes)
|
|
12
|
+
@options.merge(class: classes, onclick: [@options[:onclick], PICKER_ONCLICK].compact.join('; '))
|
|
13
|
+
end
|
|
7
14
|
end
|
|
8
15
|
end
|
|
9
16
|
end
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
= component('tramway/form/label', for: @for, class: 'mb-0') do
|
|
4
4
|
= @label
|
|
5
5
|
- classes = "#{size_class(:text_input)} #{text_input_base_classes}"
|
|
6
|
-
= @input.call @attribute,
|
|
6
|
+
= @input.call @attribute, **picker_options(classes), value: @value
|
|
@@ -4,6 +4,13 @@ module Tramway
|
|
|
4
4
|
module Form
|
|
5
5
|
# Tailwind-styled datetime field
|
|
6
6
|
class DatetimeFieldComponent < TailwindComponent
|
|
7
|
+
PICKER_ONCLICK = 'try { this.showPicker && this.showPicker() } catch (error) {}'
|
|
8
|
+
|
|
9
|
+
private
|
|
10
|
+
|
|
11
|
+
def picker_options(classes)
|
|
12
|
+
@options.merge(class: classes, onclick: [@options[:onclick], PICKER_ONCLICK].compact.join('; '))
|
|
13
|
+
end
|
|
7
14
|
end
|
|
8
15
|
end
|
|
9
16
|
end
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
%div.max-w-full.min-w-0.break-
|
|
1
|
+
%div.max-w-full.min-w-0.break-words
|
|
2
2
|
= rendered_html
|
data/config/tailwind.config.js
CHANGED
data/lib/tramway/version.rb
CHANGED