coveragebook_components 0.7.8 → 0.7.9
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/app/assets/build/coco/app.css +1 -0
- data/app/assets/build/coco/app.js +1 -1
- data/app/assets/build/coco/book.css +1 -0
- data/app/components/coco/app/elements/button/button.rb +19 -0
- data/app/components/coco/app/elements/link/link.rb +18 -0
- data/app/components/coco/base/button/button.css +1 -1
- data/app/helpers/coco/app_helper.rb +2 -28
- data/lib/coco.rb +1 -1
- 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: 31bbd1799565d0f84bf3d62af71b1f2cbc37a453c11a09e8200c7e2890f33c51
|
4
|
+
data.tar.gz: 11ca8a08fd0d79303fc36f2890077b6a2434c993072db0398f9d2add5e1851a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec7f80ac30d78d925e55458d74dc30db60554916d1674165a7d8472ab02abdafc379fe39bfbfac9d0de86d8abd24e9be9c7ddad904c6a2e8cbea89bad39e3b26
|
7
|
+
data.tar.gz: '0990d12fdc937564c846ea839082d6de415ad41b7cba05515f737092da8455605f0f0d1c30bbb4246700c51cfb0710a635fd49e7db1f16367544d09cf5e33da5'
|
@@ -14032,7 +14032,7 @@
|
|
14032
14032
|
var package_default = {
|
14033
14033
|
name: "coveragebook-components",
|
14034
14034
|
type: "module",
|
14035
|
-
version: "0.7.
|
14035
|
+
version: "0.7.9",
|
14036
14036
|
main: "index.js",
|
14037
14037
|
repository: "git@github.com:coveragebook/coco.git",
|
14038
14038
|
author: "Mark Perkins <mark@coveragebook.com>",
|
@@ -44,6 +44,21 @@ module Coco
|
|
44
44
|
end
|
45
45
|
}
|
46
46
|
|
47
|
+
before_initialize do |kwargs|
|
48
|
+
kwargs[:button_element] ||= {}
|
49
|
+
if kwargs.key?(:modal)
|
50
|
+
modal_name = (kwargs[:modal] == true) ? "default" : kwargs[:modal]
|
51
|
+
kwargs[:button_element][:data] = kwargs[:button_element].fetch(:data, {}).merge(coco_modal_data_attributes(modal_name))
|
52
|
+
kwargs.delete(:modal)
|
53
|
+
end
|
54
|
+
if kwargs.key?(:frame)
|
55
|
+
turbo_data = {turbo: true, turbo_frame: kwargs[:frame]}
|
56
|
+
kwargs[:button_element][:data] = kwargs[:button_element].fetch(:data, {}).merge(turbo_data)
|
57
|
+
kwargs.delete(:frame)
|
58
|
+
end
|
59
|
+
kwargs
|
60
|
+
end
|
61
|
+
|
47
62
|
before_render do
|
48
63
|
if confirm? && !dropdown?
|
49
64
|
with_confirmation do |confirm|
|
@@ -60,6 +75,10 @@ module Coco
|
|
60
75
|
def with_confirmation(...)
|
61
76
|
with_dropdown_confirmation(...)
|
62
77
|
end
|
78
|
+
|
79
|
+
class << self
|
80
|
+
include Coco::BaseHelper
|
81
|
+
end
|
63
82
|
end
|
64
83
|
end
|
65
84
|
end
|
@@ -9,6 +9,24 @@ module Coco
|
|
9
9
|
|
10
10
|
accepts_option :theme, from: THEMES
|
11
11
|
accepts_option :underline, from: [true, false]
|
12
|
+
|
13
|
+
before_initialize do |kwargs|
|
14
|
+
if kwargs.key?(:modal)
|
15
|
+
modal_name = (kwargs[:modal] == true) ? "default" : kwargs[:modal]
|
16
|
+
kwargs[:data] = kwargs.fetch(:data, {}).merge(coco_modal_data_attributes(modal_name))
|
17
|
+
kwargs.delete(:modal)
|
18
|
+
end
|
19
|
+
if kwargs.key?(:frame)
|
20
|
+
turbo_data = {turbo: true, turbo_frame: kwargs[:frame]}
|
21
|
+
kwargs[:data] = kwargs.fetch(:data, {}).merge(turbo_data)
|
22
|
+
kwargs.delete(:frame)
|
23
|
+
end
|
24
|
+
kwargs
|
25
|
+
end
|
26
|
+
|
27
|
+
class << self
|
28
|
+
include Coco::BaseHelper
|
29
|
+
end
|
12
30
|
end
|
13
31
|
end
|
14
32
|
end
|
@@ -1,21 +1,9 @@
|
|
1
1
|
module Coco
|
2
2
|
module AppHelper
|
3
|
-
def coco_link(*args,
|
3
|
+
def coco_link(*args, **, &block)
|
4
4
|
href, content = args[0..2].reverse!
|
5
5
|
|
6
|
-
|
7
|
-
modal_name = (kwargs[:modal] == true) ? "default" : kwargs[:modal]
|
8
|
-
kwargs[:data] = kwargs.fetch(:data, {}).merge(coco_modal_data_attributes(modal_name))
|
9
|
-
kwargs.delete(:modal)
|
10
|
-
end
|
11
|
-
|
12
|
-
if kwargs.key?(:frame)
|
13
|
-
turbo_data = {turbo: true, turbo_frame: kwargs[:frame]}
|
14
|
-
kwargs[:data] = kwargs.fetch(:data, {}).merge(turbo_data)
|
15
|
-
kwargs.delete(:frame)
|
16
|
-
end
|
17
|
-
|
18
|
-
link = Coco::App::Elements::Link.new(href: href, **kwargs)
|
6
|
+
link = Coco::App::Elements::Link.new(href: href, **)
|
19
7
|
link = link.with_content(content) if !block && content.present?
|
20
8
|
|
21
9
|
render(link, &block)
|
@@ -30,20 +18,6 @@ module Coco
|
|
30
18
|
"Button"
|
31
19
|
end
|
32
20
|
|
33
|
-
kwargs[:button_element] ||= {}
|
34
|
-
|
35
|
-
if kwargs.key?(:modal)
|
36
|
-
modal_name = (kwargs[:modal] == true) ? "default" : kwargs[:modal]
|
37
|
-
kwargs[:button_element][:data] = kwargs[:button_element].fetch(:data, {}).merge(coco_modal_data_attributes(modal_name))
|
38
|
-
kwargs.delete(:modal)
|
39
|
-
end
|
40
|
-
|
41
|
-
if kwargs.key?(:frame)
|
42
|
-
turbo_data = {turbo: true, turbo_frame: kwargs[:frame]}
|
43
|
-
kwargs[:button_element][:data] = kwargs[:button_element].fetch(:data, {}).merge(turbo_data)
|
44
|
-
kwargs.delete(:frame)
|
45
|
-
end
|
46
|
-
|
47
21
|
component = "Coco::App::Elements::#{button}".constantize.new(href: href, **kwargs)
|
48
22
|
component = component.with_content(content) if !block && content.present?
|
49
23
|
|
data/lib/coco.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coveragebook_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Perkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|