bulma-phlex-rails 0.8.0 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9253ea8d5532711f770a418078fd328d321b358fa2d57c6fed60a40dd3be4deb
4
- data.tar.gz: ee904d48aee8548ffa3279a669fcec8a91ceea1b99757328cebf21512edb84aa
3
+ metadata.gz: 3ecf21b7c5baf0037e1086f9fd57f51c92edcc74a2231d83962c820b42b663d9
4
+ data.tar.gz: 0cce4f028ed6a77136ee08bb771286de0f6d2af73fabbe45bd577a58d1c683c0
5
5
  SHA512:
6
- metadata.gz: 0e01714b8cf5c80d65c7227e82c38ea229f4f386a8b9a72e9b6a1f5981ef9840717dd00308c4d1d637830d831a658a63d0ad14415004fc3e9f1547da31bbd4d9
7
- data.tar.gz: edd4fbbabf11e065cd9c458fe2a77529058772d1e298ea22876df69ebed2193d561709fef2ccb8c0e4f4f1e89ee4a5e7134bdd94c951ddcf9b0c895b4a48ebeb
6
+ metadata.gz: ede213395bf3ba70cb63d61e0c24e7f21aa8a24a97900b388eb475f506da82fdc0e9dad55deba42e8f840ef1168c935974b541d96b1dcb66542cff3139af7d76
7
+ data.tar.gz: 6321f17a5e6f2fa4b260f77777785a6676c6d3a7ff5bcc4989ca42096ced34d013b166198799af10ce3059fb8e26fd0979e40babb04a043a0eb5ec18b6476656
@@ -0,0 +1,33 @@
1
+ import { Controller } from "@hotwired/stimulus";
2
+
3
+ export default class extends Controller {
4
+ isOpen() {
5
+ return this.element.classList.contains("is-active")
6
+ }
7
+
8
+ open() {
9
+ if (!this.isOpen()) {
10
+ this.element.classList.add("is-active")
11
+ document.documentElement.classList.add("is-clipped")
12
+ }
13
+ }
14
+
15
+ close() {
16
+ if (this.isOpen()) {
17
+ this.element.classList.remove("is-active")
18
+ document.documentElement.classList.remove("is-clipped")
19
+ }
20
+ }
21
+
22
+ openOrCloseByCommand(event) {
23
+ switch (event.command) {
24
+ case "--open":
25
+ this.open()
26
+ break
27
+
28
+ case "--close":
29
+ this.close()
30
+ break
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BulmaPhlex
4
+ module Rails
5
+ # This module provides configurable icons for Bulma Phlex components in a Rails application. It is prepended
6
+ # to the BulmaPhlex::Configuration::Icons module to allow customization of icon classes, such as the
7
+ # turbo_frame_pending icon.
8
+ module ConfigurableIcons
9
+ attr_accessor :turbo_frame_pending
10
+
11
+ def initialize(...)
12
+ super
13
+ @turbo_frame_pending = "fa-solid fa-spinner fa-pulse"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -182,16 +182,20 @@ module BulmaPhlex
182
182
  # to set responsive gap sizes.
183
183
  # - `centered`: (Boolean, optional) If true, centers the columns.
184
184
  # - `vcentered`: (Boolean, optional) If true, vertically centers the columns.
185
- def columns(minimum_breakpoint: nil,
185
+ #
186
+ # Any additional HTML attributes passed to the `columns` method will be applied to the outer columns container.
187
+ def columns(minimum_breakpoint: nil, # rubocop:disable Metrics/ParameterLists
186
188
  multiline: false,
187
189
  gap: nil,
188
190
  centered: false,
189
- vcentered: false, &)
191
+ vcentered: false,
192
+ **html_attributes,
193
+ &)
190
194
  @columns_flag = true
191
195
  columns = @template.capture(&)
192
196
  @columns_flag = false
193
197
 
194
- BulmaPhlex::Columns.new(minimum_breakpoint:, multiline:, gap:, centered:, vcentered:) do
198
+ BulmaPhlex::Columns.new(minimum_breakpoint:, multiline:, gap:, centered:, vcentered:, **html_attributes) do
195
199
  @template.concat(columns)
196
200
  end.render_in(@template)
197
201
  end
@@ -208,18 +212,22 @@ module BulmaPhlex
208
212
  # - `gap`: (optional) Sets the gap size between grid items from 1-8 with 0.5 increments.
209
213
  # - `column_gap`: (optional) Sets the column gap size between grid items from 1-8 with 0.5 increments.
210
214
  # - `row_gap`: (optional) Sets the row gap size between grid items from 1-8 with 0.5 increments.
215
+ #
216
+ # Any additional HTML attributes passed to the `grid` method will be applied to the outer grid container.
211
217
  def grid(fixed_columns: nil, # rubocop:disable Metrics/ParameterLists
212
218
  auto_count: false,
213
219
  minimum_column_width: nil,
214
220
  gap: nil,
215
221
  column_gap: nil,
216
222
  row_gap: nil,
223
+ **html_attributes,
217
224
  &)
218
225
  @grid_flag = true
219
226
  cells = @template.capture(&)
220
227
  @grid_flag = false
221
228
 
222
- BulmaPhlex::Grid.new(fixed_columns:, auto_count:, minimum_column_width:, gap:, column_gap:, row_gap:) do
229
+ BulmaPhlex::Grid.new(fixed_columns:, auto_count:, minimum_column_width:, gap:, column_gap:, row_gap:,
230
+ **html_attributes) do
223
231
  @template.concat(cells)
224
232
  end.render_in(@template)
225
233
  end
@@ -17,10 +17,10 @@ module BulmaPhlex
17
17
  #
18
18
  # The two pending attributes have the following defaults:
19
19
  # - pending_message: "Loading..."
20
- # - pending_icon: "fas fa-spinner fa-pulse"
20
+ # - pending_icon: configured Turbo Frame pending icon
21
21
  def turbo_frame_content(*ids, src: nil, target: nil, **attributes)
22
22
  pending_message = attributes.delete(:pending_message) || "Loading..."
23
- pending_icon = attributes.delete(:pending_icon) || "fas fa-spinner fa-pulse"
23
+ pending_icon = attributes.delete(:pending_icon) || BulmaPhlex.config.icons.turbo_frame_pending
24
24
 
25
25
  content do
26
26
  turbo_frame_tag ids, src: src, target: target, **attributes do
@@ -2,6 +2,6 @@
2
2
 
3
3
  module BulmaPhlex
4
4
  module Rails
5
- VERSION = "0.8.0"
5
+ VERSION = "0.9.0"
6
6
  end
7
7
  end
@@ -21,6 +21,8 @@ loader.setup
21
21
 
22
22
  require "bulma_phlex/rails/engine"
23
23
 
24
+ BulmaPhlex::Configuration::Icons.prepend(BulmaPhlex::Rails::ConfigurableIcons)
25
+
24
26
  # Rails-specific extensions to BulmaPhlex components
25
27
  BulmaPhlex::Card.include(BulmaPhlex::Rails::CardHelper) if defined?(Turbo)
26
28
  BulmaPhlex::Table.include(BulmaPhlex::Rails::TableHelper)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulma-phlex-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Kummer
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-04-16 00:00:00.000000000 Z
10
+ date: 2026-09-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: actionpack
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.15.0
32
+ version: 0.18.0
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 0.15.0
39
+ version: 0.18.0
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: phlex-rails
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -73,6 +73,7 @@ extra_rdoc_files: []
73
73
  files:
74
74
  - app/javascript/controllers/bulma_phlex/dropdown_controller.js
75
75
  - app/javascript/controllers/bulma_phlex/file_input_display_controller.js
76
+ - app/javascript/controllers/bulma_phlex/modal_controller.js
76
77
  - app/javascript/controllers/bulma_phlex/navigation_bar_controller.js
77
78
  - app/javascript/controllers/bulma_phlex/nested_forms_add_row_controller.js
78
79
  - app/javascript/controllers/bulma_phlex/nested_forms_delete_row_controller.js
@@ -92,6 +93,7 @@ files:
92
93
  - lib/bulma_phlex/rails/concerns/displayable_block_options.rb
93
94
  - lib/bulma_phlex/rails/concerns/displayable_form_fields.rb
94
95
  - lib/bulma_phlex/rails/concerns/nested_forms.rb
96
+ - lib/bulma_phlex/rails/configurable_icons.rb
95
97
  - lib/bulma_phlex/rails/engine.rb
96
98
  - lib/bulma_phlex/rails/form_builder.rb
97
99
  - lib/bulma_phlex/rails/helpers/card_helper.rb