Sha256: 921ab74dc1a08c448e7d27c3cd2c36c825ad0b6cf1bedab5c3f4481ca3e1caab

Contents?: true

Size: 522 Bytes

Versions: 22

Compression:

Stored size: 522 Bytes

Contents

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

export default CocoComponent("colorPickerButton", ({ 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

22 entries across 22 versions & 1 rubygems

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