coveragebook_components 0.18.0 → 0.18.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9024fd2b1372e1c28286a54173750921c33b6f9cee10cce9e2ca5d1fd982d9e
4
- data.tar.gz: f6e89d2b38167d6198b967af281344146e3f131964457e9c2dff2ea11f2e2737
3
+ metadata.gz: a6e884ae365d700946ff6b8fcaba45157c23dd63f1c99eb9bfe479d8ffee61c1
4
+ data.tar.gz: 74c0748337f4a09bea38d496e71c7c62f39282fdb457bb8bc443507171f58ba2
5
5
  SHA512:
6
- metadata.gz: 131b0f18bf5b4462ba4be9c5cfc55f76aaceeac1b4c671f5144589aee73ae79742bbe01f9b0b8f2846fd1b89fc10b2fb07a453061d95f3a606e64ee9ff5c9546
7
- data.tar.gz: 16115cf26b19813e8e44639956d10de3ac45ec39fea45bbd008dbc53aab8a86cbb3eea1ddd5955f9d06f10d9e15af348463d7b962ef758548be873e6455cc32c
6
+ metadata.gz: 7213a41ac90c6eb3288873ca5f82f36a6dd816cb98e865fe9089a7962c8efc5b8052926ac67d709b4c87a2c06af34cb2b8a61af8a07bb2fd2abcbfd70994fb11
7
+ data.tar.gz: 248c6c5d9c9d17a8aef5de3c352cb0148c0574dd516272344fdbb01633afe3673279f1357a66c10d1c74ce46640cfbcaf6297dbddcdcafd206ce0911457535eb
@@ -5784,10 +5784,6 @@ select{
5784
5784
  position: fixed
5785
5785
  }
5786
5786
 
5787
- .\!block{
5788
- display: block !important
5789
- }
5790
-
5791
5787
  .block{
5792
5788
  display: block
5793
5789
  }
@@ -15260,7 +15260,7 @@ function dropdown_default(Alpine3) {
15260
15260
  const settings = tippyModifiers(modifiers);
15261
15261
  const result = expression ? evaluate(expression) : {};
15262
15262
  const directiveConfig = isObject(result) ? result : {};
15263
- let { triggerTarget, contentTarget, anchorTarget, ...config } = directiveConfig;
15263
+ let { triggerTarget, contentTarget, anchorTarget, flip, ...config } = directiveConfig;
15264
15264
  contentTarget = contentTarget || el.querySelector("[x-dropdown\\:content]");
15265
15265
  const content = isNode(contentTarget) ? contentTarget.firstElementChild : contentTarget;
15266
15266
  triggerTarget = triggerTarget || el.querySelector("[x-dropdown\\:trigger]") || el;
@@ -15288,6 +15288,9 @@ function dropdown_default(Alpine3) {
15288
15288
  interactive: true,
15289
15289
  animation: false,
15290
15290
  maxWidth: 380,
15291
+ popperOptions: {
15292
+ modifiers: [{ name: "flip", enabled: flip !== false }]
15293
+ },
15291
15294
  triggerTarget,
15292
15295
  content,
15293
15296
  onShow: (...args) => {
@@ -15441,7 +15444,7 @@ var alpine_default = import_alpinejs.default;
15441
15444
  // ../../../package.json
15442
15445
  var package_default = {
15443
15446
  name: "coveragebook-components",
15444
- version: "0.18.0",
15447
+ version: "0.18.1",
15445
15448
  repository: "git@github.com:coveragebook/coco.git",
15446
15449
  license: "NO LICENSE",
15447
15450
  author: "Mark Perkins <mark@coveragebook.com>",
@@ -16,7 +16,7 @@ export default function (Alpine) {
16
16
  const settings = buildConfig(modifiers);
17
17
  const result = expression ? evaluate(expression) : {};
18
18
  const directiveConfig = isObject(result) ? result : {};
19
- let { triggerTarget, contentTarget, anchorTarget, ...config } =
19
+ let { triggerTarget, contentTarget, anchorTarget, flip, ...config } =
20
20
  directiveConfig;
21
21
 
22
22
  contentTarget =
@@ -61,6 +61,9 @@ export default function (Alpine) {
61
61
  interactive: true,
62
62
  animation: false,
63
63
  maxWidth: 380,
64
+ popperOptions: {
65
+ modifiers: [{ name: "flip", enabled: flip !== false }],
66
+ },
64
67
 
65
68
  triggerTarget,
66
69
  content,
@@ -55,6 +55,7 @@ module Coco
55
55
  dd.accepts_option :placement,
56
56
  from: %w[top top-start top-end right right-start right-end bottom bottom-start bottom-end left left-start left-end auto auto-start auto-end],
57
57
  private: true
58
+ dd.accepts_option :flip, from: [true, false], default: true, private: true
58
59
  end
59
60
 
60
61
  renders_one :text, Coco::Content
@@ -154,7 +155,7 @@ module Coco
154
155
  if dropdown? || confirm?
155
156
  {
156
157
  data: x_data("buttonDropdown"),
157
- dropdown: jsify_data({placement: get_option_value(:dropdown, :placement)}.compact),
158
+ dropdown: jsify_data({placement: get_option_value(:dropdown, :placement), flip: get_option_value(:dropdown, :flip)}.compact),
158
159
  bind: "root"
159
160
  }
160
161
  end
@@ -16,21 +16,17 @@ module Coco
16
16
  divider: ->(**kwargs) { tag.div(class: "divider") },
17
17
  html: ->(&block) { block.call },
18
18
  button: ->(*args, **kwargs, &block) { coco_button(*args, **button_kwargs(kwargs, :button), &block) },
19
- menu_button: ->(*args, **kwargs, &block) { instantiate_button(:menu, *args, **kwargs, &block) },
20
- color_picker_button: ->(*args, **kwargs, &block) { instantiate_button(:color_picker, *args, **kwargs, &block) },
21
- image_picker_button: ->(*args, **kwargs, &block) { instantiate_button(:image_picker, *args, **kwargs, &block) },
22
- layout_picker_button: ->(*args, **kwargs, &block) { instantiate_button(:layout_picker, *args, **kwargs, &block) }
19
+ menu_button: ->(*args, **kwargs, &block) { instantiate_button(:menu, args.first, nil, **kwargs, &block) },
20
+ color_picker_button: ->(*args, **kwargs, &block) { instantiate_button(:color_picker, args.first, nil, **kwargs, &block) },
21
+ image_picker_button: ->(*args, **kwargs, &block) { instantiate_button(:image_picker, args.first, nil, **kwargs, &block) },
22
+ layout_picker_button: ->(*args, **kwargs, &block) { instantiate_button(:layout_picker, args.first, nil, **kwargs, &block) }
23
23
  }
24
24
  end
25
25
 
26
26
  def instantiate_button(type, *args, **kwargs, &block)
27
- href, content = if block
28
- [args.first, nil]
29
- else
30
- (args.size == 1) ? [nil, args.first] : args[0..2].reverse!
31
- end
32
- component = BUTTON_TYPES[type].constantize.new(href: href, **button_kwargs(kwargs, type))
33
- component.with_content(content) if !block && content.present?
27
+ href, content = (args.size == 1) ? [nil, args.first] : args[0..2].reverse!
28
+ component = BUTTON_TYPES[type].constantize.new(text: content, href: href, **button_kwargs(kwargs, type))
29
+ component.with_text(content) if content.present?
34
30
  component
35
31
  end
36
32
 
@@ -27,8 +27,8 @@ module Coco
27
27
  render(Coco::ButtonGroup.new(**), &)
28
28
  end
29
29
 
30
- def coco_menu_button(**, &)
31
- render(Coco::MenuButton.new(**), &)
30
+ def coco_menu_button(text = nil, **, &)
31
+ render(Coco::MenuButton.new(text: text, **), &)
32
32
  end
33
33
 
34
34
  def coco_menu_item(type, **, &)
data/lib/coco.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.18.0"
2
+ VERSION = "0.18.1"
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.18.0
4
+ version: 0.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Perkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-24 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails