plutonium 0.15.10 → 0.15.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,6 @@
20
20
  %>
21
21
 
22
22
  <div data-controller="resource-dismiss"
23
- data-resource-dismiss-target="target"
24
23
  data-resource-dismiss-after-value="6000"
25
24
  class="flex items-center p-4 mb-4 text-<%= color %>-800 rounded-lg bg-<%= color %>-50 dark:bg-stone-300 dark:text-<%= color %>-400"
26
25
  role="alert">
@@ -45,7 +44,7 @@
45
44
  <div class="ms-3 text-sm font-normal"><%= msg %></div>
46
45
  <button type="button"
47
46
  class="ms-auto -mx-1.5 -my-1.5 bg-<%= color %>-50 text-<%= color %>-500 rounded-lg focus:ring-2 focus:ring-<%= color %>-400 p-1.5 hover:bg-<%= color %>-200 inline-flex items-center justify-center h-8 w-8 dark:bg-stone-300 dark:text-<%= color %>-400 dark:hover:bg-gray-700"
48
- data-resource-dismiss-target="trigger"
47
+ data-action="click->resource-dismiss#dismiss"
49
48
  aria-label="Close">
50
49
  <span class="sr-only">Close</span>
51
50
  <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
@@ -19,7 +19,6 @@
19
19
  %>
20
20
 
21
21
  <div data-controller="resource-dismiss"
22
- data-resource-dismiss-target="target"
23
22
  data-resource-dismiss-after-value="6000"
24
23
  class="fixed z-50 top-16 inset-x-0 mx-auto flex items-center w-full max-w-md p-4 text-gray-500 bg-<%= color %>-50 rounded-lg shadow dark:text-<%= color %>-400 dark:bg-gray-800 dark:border dark:border-gray-700 dark:shadow-none"
25
24
  role="alert">
@@ -47,7 +46,7 @@
47
46
  <div class="ms-3 text-sm font-normal"><%= msg %></div>
48
47
  <button type="button"
49
48
  class="ms-auto -mx-1.5 -my-1.5 bg-<%= color %>-50 text-<%= color %>-400 rounded-lg focus:ring-2 focus:ring-<%= color %>-400 p-1.5 hover:bg-<%= color %>-200 inline-flex items-center justify-center h-8 w-8 dark:text-<%= color %>-400 dark:bg-gray-800 dark:hover:bg-gray-700"
50
- data-resource-dismiss-target="trigger"
49
+ data-action="click->resource-dismiss#dismiss"
51
50
  aria-label="Close">
52
51
  <span class="sr-only">Close</span>
53
52
  <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
@@ -78,7 +78,7 @@ module Plutonium
78
78
  #
79
79
  # @return [void]
80
80
  def invalidate_cache
81
- flush_smart_cache
81
+ # flush_smart_cache
82
82
  end
83
83
  end
84
84
  end
@@ -12,7 +12,7 @@ module Plutonium
12
12
  end
13
13
 
14
14
  def view_template(&)
15
- turbo_frame_tag(@id, src: @src, loading: @loading, **@attributes, class: 'dyna', &)
15
+ turbo_frame_tag(@id, src: @src, loading: @loading, **@attributes, class: "dyna", refresh: "morph", &)
16
16
  end
17
17
  end
18
18
  end
@@ -1,5 +1,5 @@
1
1
  module Plutonium
2
- VERSION = "0.15.10"
2
+ VERSION = "0.15.12"
3
3
  NEXT_MAJOR_VERSION = VERSION.split(".").tap { |v|
4
4
  v[1] = v[1].to_i + 1
5
5
  v[2] = 0
@@ -1,11 +1,7 @@
1
1
  import { Controller } from "@hotwired/stimulus"
2
- import { Dismiss } from 'flowbite';
3
-
4
2
 
5
3
  // Connects to data-controller="resource-dismiss"
6
4
  export default class extends Controller {
7
- static targets = ["trigger", "target"]
8
-
9
5
  static values = {
10
6
  after: Number,
11
7
  }
@@ -13,14 +9,9 @@ export default class extends Controller {
13
9
  connect() {
14
10
  console.log(`resource-dismiss connected: ${this.element}`)
15
11
 
16
- // https://flowbite.com/docs/components/alerts/#javascript-behaviour
17
- this.dismiss = new Dismiss(this.targetTarget, this.triggerTarget);
18
-
19
- console.log(this.hasAfterValue)
20
- console.log(this.afterValue)
21
12
  if (this.hasAfterValue && this.afterValue > 0) {
22
13
  this.autoDismissTimeout = setTimeout(() => {
23
- this.hide()
14
+ this.dismiss()
24
15
  this.autoDismissTimeout = null
25
16
  }, this.afterValue);
26
17
  }
@@ -29,11 +20,10 @@ export default class extends Controller {
29
20
  disconnect() {
30
21
  if (this.autoDismissTimeout) clearTimeout(this.autoDismissTimeout)
31
22
 
32
- this.dismiss = null
33
23
  this.autoDismissTimeout = null
34
24
  }
35
25
 
36
- hide() {
37
- this.dismiss.hide()
26
+ dismiss() {
27
+ this.element.remove()
38
28
  }
39
29
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plutonium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.10
4
+ version: 0.15.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich