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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d300fed697f5a7f4c6efc0d61957f3cd3e4f89cf10907fc89ca8f1964f8d92bd
4
- data.tar.gz: dce48e1edfc753eee953bcf11dc66a960f0ba0a56f1728a488b92f65701a1744
3
+ metadata.gz: 31bbd1799565d0f84bf3d62af71b1f2cbc37a453c11a09e8200c7e2890f33c51
4
+ data.tar.gz: 11ca8a08fd0d79303fc36f2890077b6a2434c993072db0398f9d2add5e1851a9
5
5
  SHA512:
6
- metadata.gz: 9a32d872cd51dad95415230b33b3b38ba962229b0d292bc13d9a7847ead8cc71f793ea721c24910b92ecd229781cde7c3f395aa542dc98be2313da32bb104d1e
7
- data.tar.gz: 525b96dced44fda522bd3ecd7562f84608e2172c85372b705a170af1c42e1e01bf2309ff209470da33a2bbdcf84afd6e7b26958e518f17fb9fe82de873445b93
6
+ metadata.gz: ec7f80ac30d78d925e55458d74dc30db60554916d1674165a7d8472ab02abdafc379fe39bfbfac9d0de86d8abd24e9be9c7ddad904c6a2e8cbea89bad39e3b26
7
+ data.tar.gz: '0990d12fdc937564c846ea839082d6de415ad41b7cba05515f737092da8455605f0f0d1c30bbb4246700c51cfb0710a635fd49e7db1f16367544d09cf5e33da5'
@@ -767,6 +767,7 @@ select{
767
767
  order: 3}
768
768
  /* disabled */
769
769
  [data-coco].coco-button[data-disabled="true"] .button-element{
770
+ pointer-events: none;
770
771
  cursor: not-allowed}
771
772
  /* loading */
772
773
  @keyframes spin{
@@ -14032,7 +14032,7 @@
14032
14032
  var package_default = {
14033
14033
  name: "coveragebook-components",
14034
14034
  type: "module",
14035
- version: "0.7.8",
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>",
@@ -797,6 +797,7 @@ select {
797
797
  }
798
798
  /* disabled */
799
799
  [data-coco].coco-button[data-disabled="true"] .button-element {
800
+ pointer-events: none;
800
801
  cursor: not-allowed;
801
802
  }
802
803
  /* loading */
@@ -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
@@ -35,7 +35,7 @@
35
35
  /* disabled */
36
36
 
37
37
  &[data-disabled="true"] .button-element {
38
- @apply cursor-not-allowed;
38
+ @apply cursor-not-allowed pointer-events-none;
39
39
  }
40
40
 
41
41
  /* loading */
@@ -1,21 +1,9 @@
1
1
  module Coco
2
2
  module AppHelper
3
- def coco_link(*args, **kwargs, &block)
3
+ def coco_link(*args, **, &block)
4
4
  href, content = args[0..2].reverse!
5
5
 
6
- if kwargs.key?(:modal)
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
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.7.8"
2
+ VERSION = "0.7.9"
3
3
  end
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.8
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-13 00:00:00.000000000 Z
11
+ date: 2023-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails