@radioactive-labs/plutonium 0.1.2 → 0.1.4

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.
@@ -16,6 +16,7 @@ import TableToolbarController from "./table_toolbar_controller.js"
16
16
  import TableController from "./table_controller.js"
17
17
  import FormController from "./form_controller.js"
18
18
  import ResourceDropDownController from "./resource_drop_down_controller.js"
19
+ import ResourceCollapseController from "./resource_collapse_controller.js"
19
20
  import ResourceDismissController from "./resource_dismiss_controller.js"
20
21
  import FrameNavigatorController from "./frame_navigator_controller.js"
21
22
  import ColorModeController from "./color_mode_controller.js"
@@ -39,6 +40,7 @@ export default function (application) {
39
40
  application.register("table", TableController)
40
41
  application.register("form", FormController)
41
42
  application.register("resource-drop-down", ResourceDropDownController)
43
+ application.register("resource-collapse", ResourceCollapseController)
42
44
  application.register("resource-dismiss", ResourceDismissController)
43
45
  application.register("frame-navigator", FrameNavigatorController)
44
46
  application.register("color-mode", ColorModeController)
@@ -0,0 +1,30 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+ import { Collapse } from 'flowbite';
3
+
4
+
5
+ // Connects to data-controller="resource-collapse"
6
+ export default class extends Controller {
7
+ static targets = ["trigger", "menu"]
8
+
9
+ connect() {
10
+ console.log(`resource-collapse connected: ${this.element}`)
11
+
12
+ this.collapse = new Collapse(this.menuTarget, this.triggerTarget);
13
+ }
14
+
15
+ disconnect() {
16
+ this.collapse = null
17
+ }
18
+
19
+ toggle() {
20
+ this.collapse.toggle()
21
+ }
22
+
23
+ show() {
24
+ this.collapse.show()
25
+ }
26
+
27
+ hide() {
28
+ this.collapse.hide()
29
+ }
30
+ }
@@ -26,6 +26,6 @@ export default class extends Controller {
26
26
  }
27
27
 
28
28
  hide() {
29
- this.dropdown.show()
29
+ this.dropdown.hide()
30
30
  }
31
31
  }