daisyui 2.0.0 → 2.0.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/CHANGELOG.md +3 -0
- data/lib/daisy_ui/button.rb +12 -0
- data/lib/daisy_ui/updated_at.rb +1 -1
- data/lib/daisy_ui/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: d30cb25a7b084c35be2de937df6e73bb3700a2f5acfb4c985c5e7cb4824cdda0
|
|
4
|
+
data.tar.gz: e5527dde4ac27befb95a4073a1facbfe9a19a1552390d0236ba40a7495efbb02
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4db77994d5bf816005c30bcac72f43b9e0a699b47d5c58963fca047d63a0d51618df468db7e07e09961efffbdb7f8656da5490765180c59424534f87953b74ff
|
|
7
|
+
data.tar.gz: 27c490791fa5006f8670df8f69159c978bad805a93a30dd65740ca6ab6202b76cd92af02ce03599eb1398a9465e66c744172f30de6ad6ff429265935bf2f103e
|
data/CHANGELOG.md
CHANGED
|
@@ -75,6 +75,9 @@ wins. `Button(:sm, class: "btn-lg")` renders `btn btn-lg` (1.x rendered
|
|
|
75
75
|
### Fixed
|
|
76
76
|
|
|
77
77
|
- Popover tooltips no longer clip arrows that extend beyond the tooltip card.
|
|
78
|
+
- Button renders the `disabled` attribute on `button`/`input` elements when given
|
|
79
|
+
`:disabled` or `disabled: true`, so a disabled submit button no longer submits
|
|
80
|
+
its form from the keyboard (#52).
|
|
78
81
|
|
|
79
82
|
## [0.1.0] - 2024-08-02
|
|
80
83
|
|
data/lib/daisy_ui/button.rb
CHANGED
|
@@ -6,6 +6,8 @@ module DaisyUI
|
|
|
6
6
|
class Button < Base
|
|
7
7
|
self.component_class = :btn
|
|
8
8
|
|
|
9
|
+
FORM_CONTROLS = %i[button input].freeze
|
|
10
|
+
|
|
9
11
|
def initialize(*, as: :button, modal: nil, **)
|
|
10
12
|
super(*, as:, **)
|
|
11
13
|
@modal = modal
|
|
@@ -29,6 +31,16 @@ module DaisyUI
|
|
|
29
31
|
|
|
30
32
|
attr_reader :modal
|
|
31
33
|
|
|
34
|
+
# `disabled` is consumed as a modifier (btn-disabled), which only blocks
|
|
35
|
+
# pointer events. Form controls also need the attribute so keyboard
|
|
36
|
+
# activation and implicit form submission are blocked too.
|
|
37
|
+
def attributes
|
|
38
|
+
attrs = super
|
|
39
|
+
return attrs unless FORM_CONTROLS.include?(as.to_sym) && modifiers.include?(:disabled)
|
|
40
|
+
|
|
41
|
+
attrs.merge(disabled: true)
|
|
42
|
+
end
|
|
43
|
+
|
|
32
44
|
register_modifiers(
|
|
33
45
|
style: {
|
|
34
46
|
# "sm:btn-ghost"
|
data/lib/daisy_ui/updated_at.rb
CHANGED
data/lib/daisy_ui/version.rb
CHANGED