From 67dc2606310f1ff54ac262417cacda97ebe5cc33 Mon Sep 17 00:00:00 2001 From: Taufik Nurrohman Date: Wed, 7 Jul 2021 18:05:01 +0700 Subject: [PATCH] Remove 'picker.value' Property --- .github/source/index.html.pug | 2 -- .github/source/index.js.mjs | 6 ++++-- README.md | 6 +++++- index.html | 6 ++---- index.js | 11 +++++++++-- index.min.js | 2 +- index.mjs | 8 +++++--- package.json | 2 +- 8 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/source/index.html.pug b/.github/source/index.html.pug index 5fe913a..2a241fc 100644 --- a/.github/source/index.html.pug +++ b/.github/source/index.html.pug @@ -284,8 +284,6 @@ block content | }, false); h3 picker.state p Return the modified color picker states. - h3 picker.value - p Return the initial color value. h3 picker.visible p Check if color picker pane is visible. pre: code if (picker.visible) { … } diff --git a/.github/source/index.js.mjs b/.github/source/index.js.mjs index 1425d2e..22fbb77 100644 --- a/.github/source/index.js.mjs +++ b/.github/source/index.js.mjs @@ -1,4 +1,4 @@ -import {B, D, R, W, getDatum, getParent, getState, getText, letElement, setChildLast, setDatum, setElement, setState, setStyle, setText} from '@taufik-nurrohman/document'; +import {B, D, R, W, getDatum, getParent, getState, getText, letClass, letElement, setChildLast, setClass, setDatum, setElement, setState, setStyle, setText} from '@taufik-nurrohman/document'; import {offEvent, offEventDefault, offEvents, onEvent, onEvents} from '@taufik-nurrohman/event'; import {fromStates} from '@taufik-nurrohman/from'; import {hook} from '@taufik-nurrohman/hook'; @@ -120,7 +120,6 @@ function CP(source, state = {}) { } $.source = source; - $.value = getValue(); $.visible = false; // Store current instance to `CP.instances` @@ -396,6 +395,7 @@ function CP(source, state = {}) { return $; // Already ejected } delete source[name]; + letClass(source, className + '-source'); offEvents(EVENTS_DOWN, source, doClick); return doExit(), fire('pop', theColor); }; @@ -411,6 +411,8 @@ function CP(source, state = {}) { return doSetColor(), $; }; + setClass(source, className + '-source'); + } doApply(1); function doClick(e) { diff --git a/README.md b/README.md index b96758a..58c7b03 100644 --- a/README.md +++ b/README.md @@ -56,9 +56,13 @@ This project exists thanks to all the people who contribute. Release Notes ------------- +### 2.3.1 + + - Removed `picker.value` property. Initial color data can be stored manually before initialization. + ### 2.3.0 -Starting from this version, you need to have a form element to store the color data. It doesn’t have to be visible. You can use `` if you want. We no longer support storing color data via `data-color` attribute and element content. +Starting from this version, you need to have a form element to store the color data. We no longer support storing color data via `data-color` attribute and element content. - Added `picker._set()` method. - Added `picker.value` property to store the initial color data. diff --git a/index.html b/index.html index 57c32f1..91f1ae8 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ - Color Picker 2.3.0 + Color Picker 2.3.1