habarico 7.3.0.pre.beta.6 → 7.3.0.pre.beta.8
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/VERSION +1 -1
- data/lib/habarico/definition/boxes/box.rb +3 -2
- data/lib/habarico/generators/view/box_schema_generator.rb +6 -1
- data/lib/habarico/generators/view/grid_item_box_parameters_generator.rb +12 -6
- data/lib/habarico/schema/types.rb +1 -1
- data/lib/habarico/schema/view/box_schema.rb +5 -2
- data/lib/habarico.rb +0 -1
- metadata +2 -3
- data/lib/habarico/definition/boxes/grid_item_box.rb +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 02c2b994d63392dd85fc668efee018789371f77979afc35bc8fa71b40395962d
|
|
4
|
+
data.tar.gz: 69b2d4fdb8afab87d7fa24ea3728f84ea623af3952a830ae836beafd8229fbad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a691cba026b07b3d45a19a82b834c356c36320e7580d0ce0c8419fe4fd14d10d4b9877a609d857bbfac6e250fa83a6594c14b9c7963763f1eea72678674c596e
|
|
7
|
+
data.tar.gz: 28d2e9ba64bb1bc9767b3f5f626d9838e23117858ed3e249a5f2e7772c9084af2f471b627fa255e17bee501494110d921d9c3347ea307e727a8dc010adb8bddf
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
7.3.0-beta.
|
|
1
|
+
7.3.0-beta.8
|
|
@@ -10,8 +10,9 @@ module Habarico
|
|
|
10
10
|
# Array
|
|
11
11
|
attr_accessor :target, :inline # rubocop:disable Lint/DuplicateMethods -- intentional for readability
|
|
12
12
|
|
|
13
|
-
# Grid Item
|
|
14
|
-
|
|
13
|
+
# Grid Item - placement of the box inside its parent grid box, a hash of breakpoint spans
|
|
14
|
+
# ({ md: 9 }). Accepted by every box type, so a grid cell can be a list/gallery/array box itself.
|
|
15
|
+
attr_accessor :grid_item
|
|
15
16
|
|
|
16
17
|
# List
|
|
17
18
|
attr_accessor :reference, :target, :extra_filters, :row_actions, :list_toolbar_actions, :list_actions, :filters, :default_sorting, # rubocop:disable Lint/DuplicateMethods -- intentional for readability
|
|
@@ -152,8 +152,13 @@ module Habarico
|
|
|
152
152
|
end
|
|
153
153
|
end
|
|
154
154
|
|
|
155
|
+
# Unlike the other type-specific parameters, `grid_item` is a placement rather than a box type:
|
|
156
|
+
# any box carries it, so a grid cell can be a list/gallery/array box itself (HAB-963). A box
|
|
157
|
+
# without a placement must emit no `grid_item` key at all - the frontend turns the computed spans
|
|
158
|
+
# of the whole grid off as soon as one cell carries one, so an empty object would silently switch
|
|
159
|
+
# every other cell to a full-width row.
|
|
155
160
|
def generate_grid_item(_view, box, _index, context)
|
|
156
|
-
return nil
|
|
161
|
+
return nil if box.grid_item.blank?
|
|
157
162
|
grid_item_box_parameters_generator.generate(box, context)
|
|
158
163
|
end
|
|
159
164
|
|
|
@@ -3,7 +3,7 @@ module Habarico
|
|
|
3
3
|
|
|
4
4
|
def generate(box, context)
|
|
5
5
|
# Validate arguments
|
|
6
|
-
raise Eluvia::Errors::StandardError.new('Argument `box` must be a Habarico::
|
|
6
|
+
raise Eluvia::Errors::StandardError.new('Argument `box` must be a Habarico::Box') unless box.is_a?(Habarico::Box)
|
|
7
7
|
|
|
8
8
|
# Create model
|
|
9
9
|
Habarico::GridItemBoxParameters.new(
|
|
@@ -17,28 +17,34 @@ module Habarico
|
|
|
17
17
|
|
|
18
18
|
protected
|
|
19
19
|
|
|
20
|
+
# Breakpoint spans of the box, given as a `grid_item` hash on any box type ({ md: 9 }).
|
|
21
|
+
def grid_item_spans(box)
|
|
22
|
+
spans = box.grid_item || {}
|
|
23
|
+
spans.respond_to?(:symbolize_keys) ? spans.symbolize_keys : spans
|
|
24
|
+
end
|
|
25
|
+
|
|
20
26
|
# ***********************************************************************
|
|
21
27
|
# Attribute generators
|
|
22
28
|
# ***********************************************************************
|
|
23
29
|
|
|
24
30
|
def generate_xs(box, _context)
|
|
25
|
-
box
|
|
31
|
+
grid_item_spans(box)[:xs]
|
|
26
32
|
end
|
|
27
33
|
|
|
28
34
|
def generate_sm(box, _context)
|
|
29
|
-
box
|
|
35
|
+
grid_item_spans(box)[:sm]
|
|
30
36
|
end
|
|
31
37
|
|
|
32
38
|
def generate_md(box, _context)
|
|
33
|
-
box
|
|
39
|
+
grid_item_spans(box)[:md]
|
|
34
40
|
end
|
|
35
41
|
|
|
36
42
|
def generate_lg(box, _context)
|
|
37
|
-
box
|
|
43
|
+
grid_item_spans(box)[:lg]
|
|
38
44
|
end
|
|
39
45
|
|
|
40
46
|
def generate_xl(box, _context)
|
|
41
|
-
box
|
|
47
|
+
grid_item_spans(box)[:xl]
|
|
42
48
|
end
|
|
43
49
|
end
|
|
44
50
|
end
|
|
@@ -29,7 +29,7 @@ module Habarico
|
|
|
29
29
|
ai ai-text range]
|
|
30
30
|
|
|
31
31
|
# BoxType - layout container types
|
|
32
|
-
BOX_TYPE = %i[tab tab-item wizard simple list object array grid
|
|
32
|
+
BOX_TYPE = %i[tab tab-item wizard simple list object array grid gallery] # rubocop:disable Style/MutableConstant
|
|
33
33
|
|
|
34
34
|
# ViewType - kind of the view
|
|
35
35
|
VIEW_TYPE = %i[list show create edit action].freeze
|
|
@@ -27,7 +27,7 @@ module Habarico
|
|
|
27
27
|
boolean_attr :card
|
|
28
28
|
|
|
29
29
|
# Makes the box collapsible; value sets the default state ('open' = expanded, 'closed' = collapsed).
|
|
30
|
-
#
|
|
30
|
+
# Absent means the box is not collapsible.
|
|
31
31
|
string_attr :collapsible
|
|
32
32
|
enum_attr :collapsible, %i[open closed]
|
|
33
33
|
|
|
@@ -45,7 +45,10 @@ module Habarico
|
|
|
45
45
|
# Additional parameters for box type 'wizard'
|
|
46
46
|
has_one_attr :wizard, 'Habarico::WizardBoxParameters'
|
|
47
47
|
|
|
48
|
-
#
|
|
48
|
+
# Placement of the box inside its parent 'grid' box - the column span at each breakpoint. Unlike
|
|
49
|
+
# the parameter blocks around it this one is not tied to a box type: any box carries it, so a grid
|
|
50
|
+
# cell can be a 'list'/'gallery'/'array' box itself (HAB-963). Absent when the box has no placement
|
|
51
|
+
# and the frontend computes the span from the number of cells.
|
|
49
52
|
has_one_attr :grid_item, 'Habarico::GridItemBoxParameters'
|
|
50
53
|
|
|
51
54
|
# Additional parameters for box type 'list'
|
data/lib/habarico.rb
CHANGED
|
@@ -220,7 +220,6 @@ require "habarico/definition/boxes/box"
|
|
|
220
220
|
require "habarico/definition/boxes/array_box"
|
|
221
221
|
require "habarico/definition/boxes/gallery_box"
|
|
222
222
|
require "habarico/definition/boxes/grid_box"
|
|
223
|
-
require "habarico/definition/boxes/grid_item_box"
|
|
224
223
|
require "habarico/definition/boxes/list_box"
|
|
225
224
|
require "habarico/definition/boxes/object_box"
|
|
226
225
|
require "habarico/definition/boxes/tab_box"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: habarico
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.3.0.pre.beta.
|
|
4
|
+
version: 7.3.0.pre.beta.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matěj Outlý
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -146,7 +146,6 @@ files:
|
|
|
146
146
|
- lib/habarico/definition/boxes/box.rb
|
|
147
147
|
- lib/habarico/definition/boxes/gallery_box.rb
|
|
148
148
|
- lib/habarico/definition/boxes/grid_box.rb
|
|
149
|
-
- lib/habarico/definition/boxes/grid_item_box.rb
|
|
150
149
|
- lib/habarico/definition/boxes/list_box.rb
|
|
151
150
|
- lib/habarico/definition/boxes/object_box.rb
|
|
152
151
|
- lib/habarico/definition/boxes/tab_box.rb
|