coveragebook_components 0.5.1 → 0.5.2

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.
@@ -31,11 +31,8 @@ export default CocoComponent("button", (data = {}) => {
31
31
  return;
32
32
  }
33
33
 
34
- this.setTooltipText();
35
34
  this.$root.setAttribute("data-collapsed", collapsed ? "true" : "false");
36
35
  });
37
-
38
- this.$watch("$options.state", () => this.setTooltipText());
39
36
  },
40
37
 
41
38
  setTooltipText() {
@@ -178,6 +175,7 @@ export default CocoComponent("button", (data = {}) => {
178
175
  root: {
179
176
  "x-options": "options",
180
177
  "x-tooltip": "tooltipText",
178
+ "x-effect": "setTooltipText",
181
179
  "@confirmation:confirm": "approveAndRun",
182
180
  "@confirmation:cancel": "cancelConfirmation",
183
181
  "@dropdown:show": "setState('active')",
@@ -2,6 +2,7 @@ module Coco
2
2
  class Component < ViewComponent::Base
3
3
  include Concerns::AcceptsTagAttributes
4
4
  include Concerns::HasName
5
+ include Concerns::Translatable
5
6
  include Coco::ComponentHelper
6
7
  include Coco::AlpineHelper
7
8
 
@@ -19,7 +19,7 @@ module Coco
19
19
  end
20
20
  end
21
21
 
22
- private
22
+ protected
23
23
 
24
24
  def component_group
25
25
  @_component_group ||= component_path.split("::").first.underscore.tr("_", "-")
@@ -0,0 +1,18 @@
1
+ module Coco
2
+ module Concerns
3
+ module Translatable
4
+ extend ActiveSupport::Concern
5
+
6
+ def tt(key)
7
+ t("coco.#{self.class.i18n_path}.#{key}")
8
+ end
9
+
10
+ class_methods do
11
+ def i18n_path(path = nil)
12
+ @_i18n_path = path unless path.nil?
13
+ @_i18n_path ||= component_path.underscore.tr("/", ".")
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1 @@
1
+ 265f649a303f0c2cbbfc9cfece75a181
@@ -0,0 +1 @@
1
+ j8VyKMx4mwRZArG1zS/oqUw1F6/UD0hQQ5sujzeTTBlNAuCTkLiuoiyAXnJV9FtR90T765ll/50wFbw0MFtk8nAzPJg=--TOqZsXP2UCs2CSMx--xYL00fHdXoCd+/xpGro01g==