csedl-stimulus-dropdown 1.0.0 → 1.1.0
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 +18 -4
- data/lib/csedl_stimulus_dropdown/view_helpers.rb +7 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 763611332510ab50822a40206ed62aa1a1a7d816c71cda283e207e255bf9fe6f
|
4
|
+
data.tar.gz: fb3fe49b9d1b901fc17c1f8b091bf2cf39b349192dce84ce41f388b407fd150c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dd6fc2558a121efdb864ea2511e7193ae40de7238edfca248a66e9ffb331353ab46bbcc54aeeef654ac8a2715a8ba4c5327334f59900e79bcf7069e85c89534
|
7
|
+
data.tar.gz: 40062ce26e670f2c7e038d0ca27f810e970854546cdb8988788dd40c998a42f653f5c30eed9da1462be582d73fd164a00c14769400f805164e9355fbf559141e
|
data/README.md
CHANGED
@@ -1,10 +1,24 @@
|
|
1
1
|
# Stimulus Dropdown
|
2
2
|
|
3
|
-
This
|
4
|
-
[@csedl/stimulus-dropdown](https://www.npmjs.com/package/@csedl/stimulus-dropdown)
|
3
|
+
This gem adds two view helpers corresponding to the npm package
|
4
|
+
[@csedl/stimulus-dropdown](https://www.npmjs.com/package/@csedl/stimulus-dropdown), to a rails app.
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
There is a [online example](https://stimulus-dropdown.sedlmair.ch/).
|
7
|
+
|
8
|
+
**Links**
|
9
|
+
* [How we are building a Rails App](https://dev.to/chmich/setup-vite-svelte-inertia-stimulus-bootstrap-foundation-on-rails-7-overview-1bk1)
|
10
|
+
|
11
|
+
### Installation
|
12
|
+
|
13
|
+
add
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'csedl-stimulus-dropdown'
|
17
|
+
```
|
18
|
+
|
19
|
+
to your Gemfile and run `bundle`
|
20
|
+
|
21
|
+
### Configuration
|
8
22
|
|
9
23
|
If you work with the helpers on this gem, you can setup a initializer for a custom close-button, like:
|
10
24
|
|
@@ -26,7 +26,7 @@ module CsedlStimulusDropdown
|
|
26
26
|
|
27
27
|
button_options = options.dup
|
28
28
|
button_options[:class] = [options[:class], 'dropdown-button'].compact.join(' ')
|
29
|
-
button_options = button_options.merge(data: { controller: 'csedl-dropdown', panel_id: id })
|
29
|
+
button_options = button_options.merge(data: { controller: 'csedl-dropdown-panel', panel_id: id })
|
30
30
|
|
31
31
|
button_content = capture(&button_content) if button_content.is_a?(Proc)
|
32
32
|
btn = content_tag(:div, button_content, button_options)
|
@@ -36,7 +36,8 @@ module CsedlStimulusDropdown
|
|
36
36
|
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
37
37
|
|
38
38
|
panel_options = options.dup
|
39
|
-
panel_options[:class] = [options[:class], 'dropdown-panel
|
39
|
+
panel_options[:class] = [options[:class], 'dropdown-panel'].compact.join(' ')
|
40
|
+
panel_options[:style] = "display: none;"
|
40
41
|
panel_options[:id] = id
|
41
42
|
panel_options['data-src'] = src if src
|
42
43
|
close_btn_proc = StimulusDropdown.close_button_proc
|
@@ -45,7 +46,7 @@ module CsedlStimulusDropdown
|
|
45
46
|
safe_join([
|
46
47
|
content_tag(:div, class: 'header') do
|
47
48
|
concat content_tag(:div, title, class: 'title')
|
48
|
-
concat content_tag(:div, class: 'buttons') { close_btn_proc.present? ? close_btn_proc.call(self) : 'X' }
|
49
|
+
concat content_tag(:div, class: 'buttons') { close_btn_proc.present? ? close_btn_proc.call(self) : content_tag(:span, 'X', class: 'close-button') }
|
49
50
|
end,
|
50
51
|
content_tag(:div, class: 'content') do
|
51
52
|
capture(&panel_content) if block_given?
|
@@ -85,7 +86,7 @@ module CsedlStimulusDropdown
|
|
85
86
|
label_options = options.dup
|
86
87
|
label_options[:id] = options.delete(:id)
|
87
88
|
label_options[:class] = [options[:class], label_class].compact.join(' ')
|
88
|
-
label_options = label_options.merge(data: { controller: 'csedl-tooltip', panel_id: id, delay: delay })
|
89
|
+
label_options = label_options.merge(data: { controller: 'csedl-tooltip-label', panel_id: id, delay: delay })
|
89
90
|
|
90
91
|
label_element = if block_given? && cont.present?
|
91
92
|
content_tag(:span, label_options) do
|
@@ -100,8 +101,9 @@ module CsedlStimulusDropdown
|
|
100
101
|
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
101
102
|
|
102
103
|
panel_options = options.dup
|
103
|
-
panel_options[:class] = [options[:class], 'tooltip-panel
|
104
|
+
panel_options[:class] = [options[:class], 'tooltip-panel'].compact.join(' ')
|
104
105
|
panel_options[:id] = id
|
106
|
+
panel_options[:style] = 'display: none;'
|
105
107
|
panel_options['data-src'] = src if src
|
106
108
|
|
107
109
|
panel_element = if block_given? && cont.present?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csedl-stimulus-dropdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Sedlmair
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: christian@sedlmair.ch
|