csedl-stimulus-dropdown 0.0.5 → 1.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/README.md +18 -4
- data/lib/csedl_stimulus_dropdown/view_helpers.rb +3 -3
- 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: 4c6d16af2a096678f41f52cb50b970f1f199028d369deb1fc4ff4b4efbc919d2
|
4
|
+
data.tar.gz: 5ae7c50ebdb13730fe997e6573833dca6839fa9bf1f49bf27622e4aa296fcdde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8d1705e12bc2e7439315f473f76b006affb85f3fb758c3475bbd0feb6b58501798d5a3eacf9433045edc52cb12fe19d014d602764c54d00336aea6bb41b6dd1
|
7
|
+
data.tar.gz: 720b23ae543c985d4342f9521bd096265edfb77730719903637577e36d1575022ee9b565996d62009c2830cd1ac00eb773485639cd823d82b30cdfc1c41fc07f
|
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',
|
29
|
+
button_options = button_options.merge(data: { controller: 'csedl-dropdown', 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)
|
@@ -45,7 +45,7 @@ module CsedlStimulusDropdown
|
|
45
45
|
safe_join([
|
46
46
|
content_tag(:div, class: 'header') do
|
47
47
|
concat content_tag(:div, title, class: 'title')
|
48
|
-
concat content_tag(:div, class: 'buttons') { close_btn_proc.present? ? close_btn_proc.call(self) : 'X' }
|
48
|
+
concat content_tag(:div, class: 'buttons') { close_btn_proc.present? ? close_btn_proc.call(self) : content_tag(:span, 'X', class: 'close-button') }
|
49
49
|
end,
|
50
50
|
content_tag(:div, class: 'content') do
|
51
51
|
capture(&panel_content) if block_given?
|
@@ -85,7 +85,7 @@ module CsedlStimulusDropdown
|
|
85
85
|
label_options = options.dup
|
86
86
|
label_options[:id] = options.delete(:id)
|
87
87
|
label_options[:class] = [options[:class], label_class].compact.join(' ')
|
88
|
-
label_options = label_options.merge(data: { controller: 'csedl-tooltip',
|
88
|
+
label_options = label_options.merge(data: { controller: 'csedl-tooltip', panel_id: id, delay: delay })
|
89
89
|
|
90
90
|
label_element = if block_given? && cont.present?
|
91
91
|
content_tag(:span, label_options) do
|
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:
|
4
|
+
version: 1.0.1
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: christian@sedlmair.ch
|