melloware / coloris-npm Goto Github PK
View Code? Open in Web Editor NEWA lightweight and elegant JavaScript color picker.
License: MIT License
A lightweight and elegant JavaScript color picker.
License: MIT License
I want to display the colorpicker in a custom popup without any input. I used the following options:
Coloris({
el: null,
inline: true,
parent: '#' + anchorId,
autoClose: false,
focusInput: false,
alpha: false,
})
The colorpicker opens as expected but when using the colorArea the color marker is locked to the right of the area because the x / y dimensions getting calculated are a bit off in the updatePickerPosition()
function. I fixed it by using getBoundingClientRect()
for the dimensions. I can provide the fix as a PR but it probably needs some testing on other use cases.
There is an error in updatePickerPosition()
with the latest (0.19.0) release on npm, which appears to be due to the line added in 9af0f49 not being in the actual npm 0.19.0 release.
Specifically, the release on GitHub includes the following check:
Line 351 in 9af0f49
However, the version hosted at npmjs.com, and downloaded via npm, does not:
I am trying to use the colorpicker in an Anguar 15 project but I get an error when running the project:
./node_modules/@melloware/coloris/dist/coloris.css?ngGlobalStyle:1:0 - Error: Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> .clr-picker {
| display: none;
| flex-wrap: wrap;
Yes Yes Sir! I shall be doing this I know your time is thin :)
Angular/Ivy build in this code base or a separate repo?
I have same kind of errors as #13
Just by adding
import "@melloware/coloris/dist/coloris.css";
import Coloris from "@melloware/coloris";
Coloris.init();
Coloris({el: "#coloris"});
I have the error:
Uncaught TypeError: import_coloris.default.init is not a function
Using CDN is working properly, am I missing something ?
IMPORTANT: Before reporting anything here please report it on the main project at https://github.com/mdbassit/Coloris That is the main repository where bugs should be fixed and we will port them to this project once the original Coloris project does a release.
If your issue is NPM or TypeScript related then it is OK to report that here.
Is that possible to support passing element as an input on top of query Selector for el
? In case of shadow dom, passing the query selector might not work.
Hello guys,
Thanks for the library.
I just started using the library and as soon I opened in Google Chrome I got this warning message:
coloris.js:928 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
Any idea to remove the warning?
@blutorange Do you mind looking into why the builds are failing? It doesn't look like any code was changed but they seem to be failing
.. remove other docs which might make it confusing to users. We should refer to the original repo for documentation.
Hi, after importing with npm, and adding the following to the top of the vue file
import "@melloware/coloris/dist/coloris.css";
import Coloris from "@melloware/coloris";
Coloris.init();
Coloris({el: "#coloris"});
I get the following error.
Uncaught (in promise) TypeError: _melloware_coloris__WEBPACK_IMPORTED_MODULE_1___default().init is not a function
If i add the library through the CDN, it works just fine.
@blutorange Do you have instructions on how to use this version with Vanilla JS? The reason I ask is I am working on a PF component and I need the ability to control when "init" is called like you did here so it's not on DOMReady.
Any advice would be appreciated.
When I import into scss - @import "@melloware/coloris/dist/coloris.css";
Syntax Error: Error: Package path ./dist/coloris.css is not exported from package .../node_modules/@melloware/coloris (see exports field in .../node_modules/@melloware/coloris/package.json)
formatToggle: true
is missing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.