nfg_ui 6.16.3 → 6.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nfg_ui/ui/base.rb +15 -0
- data/lib/nfg_ui/version.rb +1 -1
- metadata +47 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 385311e03c88b1813a4d5cb015f61528e2870aa02b01ababb7dbbce6a850fc00
|
4
|
+
data.tar.gz: 387165bb290837d4442aaba42f43c47c49ac6f8e726926f34de2cc1f24734643
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 060b64c7715f2d59c808fa5f14a129bc51f4541541ae34de9e27370c5722f5d245173020d6bcaf0eb3a2efeed4a6d5a0b04edcef90cc510ef27df45e8838b116
|
7
|
+
data.tar.gz: d791e570e06323873eef9188055f50a5dc7d062e25d6b4f9e08505b86a2fb78bc3927eda391e889021b7b26d8f48bd28a55ab46f352fc5adec1960b51a3bbb90
|
data/lib/nfg_ui/ui/base.rb
CHANGED
@@ -12,10 +12,12 @@ module NfgUi
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def bootstrap(component_name = nil, *traits, **options, &block)
|
15
|
+
traits, options = process_traits_and_options(*traits, **options)
|
15
16
|
NfgUi::UI::Bootstrap.new(view_context, component_name, *traits, **options, &block).render_component
|
16
17
|
end
|
17
18
|
|
18
19
|
def nfg(component_name = nil, *traits, **options, &block)
|
20
|
+
traits, options = process_traits_and_options(*traits, **options)
|
19
21
|
return unless render_nfg_component?(options)
|
20
22
|
NfgUi::UI::NetworkForGood.new(view_context, component_name, *traits, **options, &block).render_component
|
21
23
|
end
|
@@ -30,6 +32,19 @@ module NfgUi
|
|
30
32
|
!options[:render_unless]
|
31
33
|
end
|
32
34
|
end
|
35
|
+
|
36
|
+
def process_traits_and_options(*traits, **options)
|
37
|
+
# In ruby 3 keyword arguments are separated from positional arguments
|
38
|
+
# Ensure traits is an array and default to an empty array if no elements are passed
|
39
|
+
traits = traits.empty? ? [] : traits
|
40
|
+
|
41
|
+
# Check if the last element of traits is a hash and merge it with options
|
42
|
+
if traits.last.is_a?(Hash)
|
43
|
+
options = traits.pop.merge(options)
|
44
|
+
end
|
45
|
+
|
46
|
+
[traits, options]
|
47
|
+
end
|
33
48
|
end
|
34
49
|
end
|
35
50
|
end
|
data/lib/nfg_ui/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nfg_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Roehm
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bootstrap
|
@@ -337,14 +337,56 @@ dependencies:
|
|
337
337
|
requirements:
|
338
338
|
- - "~>"
|
339
339
|
- !ruby/object:Gem::Version
|
340
|
-
version: '1.
|
340
|
+
version: '1.7'
|
341
341
|
type: :development
|
342
342
|
prerelease: false
|
343
343
|
version_requirements: !ruby/object:Gem::Requirement
|
344
344
|
requirements:
|
345
345
|
- - "~>"
|
346
346
|
- !ruby/object:Gem::Version
|
347
|
-
version: '1.
|
347
|
+
version: '1.7'
|
348
|
+
- !ruby/object:Gem::Dependency
|
349
|
+
name: rubocop
|
350
|
+
requirement: !ruby/object:Gem::Requirement
|
351
|
+
requirements:
|
352
|
+
- - ">="
|
353
|
+
- !ruby/object:Gem::Version
|
354
|
+
version: '0'
|
355
|
+
type: :development
|
356
|
+
prerelease: false
|
357
|
+
version_requirements: !ruby/object:Gem::Requirement
|
358
|
+
requirements:
|
359
|
+
- - ">="
|
360
|
+
- !ruby/object:Gem::Version
|
361
|
+
version: '0'
|
362
|
+
- !ruby/object:Gem::Dependency
|
363
|
+
name: pry
|
364
|
+
requirement: !ruby/object:Gem::Requirement
|
365
|
+
requirements:
|
366
|
+
- - ">="
|
367
|
+
- !ruby/object:Gem::Version
|
368
|
+
version: '0'
|
369
|
+
type: :development
|
370
|
+
prerelease: false
|
371
|
+
version_requirements: !ruby/object:Gem::Requirement
|
372
|
+
requirements:
|
373
|
+
- - ">="
|
374
|
+
- !ruby/object:Gem::Version
|
375
|
+
version: '0'
|
376
|
+
- !ruby/object:Gem::Dependency
|
377
|
+
name: pry-byebug
|
378
|
+
requirement: !ruby/object:Gem::Requirement
|
379
|
+
requirements:
|
380
|
+
- - ">="
|
381
|
+
- !ruby/object:Gem::Version
|
382
|
+
version: '0'
|
383
|
+
type: :development
|
384
|
+
prerelease: false
|
385
|
+
version_requirements: !ruby/object:Gem::Requirement
|
386
|
+
requirements:
|
387
|
+
- - ">="
|
388
|
+
- !ruby/object:Gem::Version
|
389
|
+
version: '0'
|
348
390
|
description: The embodied design system for Network for Good.
|
349
391
|
email:
|
350
392
|
- jonathan.roehm@networkforgood.com
|
@@ -859,7 +901,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
859
901
|
- !ruby/object:Gem::Version
|
860
902
|
version: '0'
|
861
903
|
requirements: []
|
862
|
-
rubygems_version: 3.
|
904
|
+
rubygems_version: 3.5.18
|
863
905
|
signing_key:
|
864
906
|
specification_version: 4
|
865
907
|
summary: NFG UI front-end design system code for rapid product building
|