Sha256: a9b2f9e66d89edbb649f75fdf996c234717c49127f10d6b878012e49496f974e

Contents?: true

Size: 508 Bytes

Versions: 40

Compression:

Stored size: 508 Bytes

Contents

import { CocoComponent } from "@js/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

40 entries across 40 versions & 1 rubygems

Version Path
coveragebook_components-0.10.0 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.9.1 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.9.0 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.9 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.8 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.7 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.6 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.5 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.4 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.3 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.2 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.1 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.0 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.0.beta.3 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.0.beta.2 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.8.0.beta.1 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.7.10 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.7.9 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.7.8 app/components/coco/app/elements/color_picker_button/color_picker_button.js
coveragebook_components-0.7.7 app/components/coco/app/elements/color_picker_button/color_picker_button.js