Sha256: c3f69947f9d6ea55543db7c6de4dd2580d168008b04931b211bd441adc5ba590

Contents?: true

Size: 818 Bytes

Versions: 22

Compression:

Stored size: 818 Bytes

Contents

import { CocoComponent } from "@assets/js/coco/component.js";
import { getComponent } from "@helpers/alpine";

export default CocoComponent("buttonDropdown", () => {
  return {
    dropdown: null,
    button: null,

    init() {
      this.$nextTick(() => {
        this.button = getComponent(this.$el.querySelector(".coco-button"));
      });
    },

    hideDropdown() {
      if (this.dropdown) {
        this.dropdown.hide();
      }
    },

    showDropdown() {
      if (this.dropdown) {
        this.dropdown.show();
      }
    },

    /* bindings */

    root: {
      "@dropdown:show": "button.setState('active')",
      "@dropdown:hide": "button.resetState()",
      "@confirmation:confirm": "button.approveAndRun($event)",
      "@confirmation:cancel": "button.cancelConfirmation($event)",
    },
  };
});

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
coveragebook_components-0.19.8 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.19.7 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.19.6 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.19.5 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.19.4 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.19.3 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.19.2 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.19.1 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.19.0 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.18.8 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.18.7 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.18.0 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.17.7 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.17.6 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.17.5 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.17.4 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.17.3 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.17.2 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.17.1 app/components/coco/buttons/button/button_dropdown.js
coveragebook_components-0.17.0 app/components/coco/buttons/button/button_dropdown.js