Sha256: 48f9e128a14f8e3a45f2009a8ed122f955f4245d7e6e652812aee273a38924fa

Contents?: true

Size: 522 Bytes

Versions: 7

Compression:

Stored size: 522 Bytes

Contents

import { CocoComponent } from "@assets/js/shared/coco";
import { getData } from "@helpers/alpine";

export default CocoComponent("appColorPickerButton", ({ selected }) => {
  selected = selected ? "#" + selected.replace("#", "") : "#FFFFFF";
  return {
    selectedColor: selected,

    getPicker() {
      return getData(
        this.$root.querySelector("[data-role='color-picker']").firstElementChild
      );
    },

    onDropdownMount() {
      this.getPicker().setSelectedColor(this.selectedColor);
    },
  };
});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
coveragebook_components-0.12.2 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.12.1 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.12.0 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.11.0 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.10.1.beta.2 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.10.1.beta.1 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.10.1.beta.0 app/components/coco/app/elements/color_picker_button/color_picker_button.js