aloha-vue 2.86.0 → 2.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/aloha-vue.css +21 -0
- package/dist/aloha-vue.css.map +1 -1
- package/dist/aloha-vue.es.js +2428 -2361
- package/dist/aloha-vue.umd.js +102 -102
- package/package.json +1 -1
- package/scss/components/ui/AColorPicker.scss +20 -0
- package/src/ui/AColorPicker/AColorPicker.js +70 -24
- package/src/ui/AColorPicker/__tests__/AColorPicker.test.js +66 -1
- package/src/ui/AColorPicker/__tests__/colorUtils.test.js +12 -0
- package/src/ui/AColorPicker/compositionAPI/ColorStateAPI.js +28 -3
- package/src/ui/AColorPicker/compositionAPI/FormatAPI.js +59 -0
- package/src/ui/AColorPicker/compositionAPI/PopoverAPI.js +20 -3
- package/src/ui/AColorPicker/i18n/ar.json +2 -1
- package/src/ui/AColorPicker/i18n/de.json +2 -1
- package/src/ui/AColorPicker/i18n/en.json +2 -1
- package/src/ui/AColorPicker/i18n/es.json +2 -1
- package/src/ui/AColorPicker/i18n/fr.json +2 -1
- package/src/ui/AColorPicker/i18n/hr.json +2 -1
- package/src/ui/AColorPicker/i18n/it.json +2 -1
- package/src/ui/AColorPicker/i18n/nl.json +2 -1
- package/src/ui/AColorPicker/i18n/pl.json +2 -1
- package/src/ui/AColorPicker/i18n/ru.json +2 -1
- package/src/ui/AColorPicker/i18n/uk.json +2 -1
- package/src/ui/AColorPicker/utils/colorUtils.js +15 -0
|
@@ -188,6 +188,21 @@ function parseFunction(text) {
|
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Format of a color value: "hex", "rgb", "hsl", "hsv" or undefined.
|
|
193
|
+
*/
|
|
194
|
+
export function detectColorFormat(value) {
|
|
195
|
+
if (!isString(value)) {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
const TEXT = value.trim().toLowerCase();
|
|
199
|
+
const MATCH = /^(rgb|hsl|hsv)a?\(/.exec(TEXT);
|
|
200
|
+
if (MATCH) {
|
|
201
|
+
return MATCH[1];
|
|
202
|
+
}
|
|
203
|
+
return parseHex(TEXT) ? "hex" : undefined;
|
|
204
|
+
}
|
|
205
|
+
|
|
191
206
|
/**
|
|
192
207
|
* Parses hex (#rgb, #rgba, #rrggbb, #rrggbbaa), rgb(a), hsl(a) and hsv(a).
|
|
193
208
|
* Returns { r, g, b, a } or undefined for an invalid value.
|