ngx-color 7.3.0 → 7.3.1
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/alpha/package.json +6 -22
- package/block/block-swatches.component.d.ts +10 -8
- package/block/package.json +6 -22
- package/chrome/package.json +6 -22
- package/circle/package.json +9 -22
- package/compact/package.json +6 -22
- package/esm2020/alpha/alpha-picker.component.mjs +116 -0
- package/esm2020/alpha/ngx-color-alpha.mjs +5 -0
- package/esm2020/alpha/public_api.mjs +2 -0
- package/esm2020/alpha.component.mjs +1 -1
- package/{block/esm2020 → esm2020/block}/block-swatches.component.mjs +2 -4
- package/{block/esm2020 → esm2020/block}/block.component.mjs +1 -1
- package/esm2020/block/ngx-color-block.mjs +5 -0
- package/esm2020/block/public_api.mjs +3 -0
- package/esm2020/checkboard.component.mjs +1 -1
- package/esm2020/chrome/chrome-fields.component.mjs +356 -0
- package/{chrome/esm2020 → esm2020/chrome}/chrome.component.mjs +1 -1
- package/esm2020/chrome/ngx-color-chrome.mjs +5 -0
- package/esm2020/chrome/public_api.mjs +3 -0
- package/esm2020/circle/circle-swatch.component.mjs +85 -0
- package/esm2020/circle/circle.component.mjs +148 -0
- package/esm2020/circle/ngx-color-circle.mjs +5 -0
- package/esm2020/circle/public_api.mjs +3 -0
- package/esm2020/color-wrap.component.mjs +1 -1
- package/esm2020/compact/compact-color.component.mjs +91 -0
- package/esm2020/compact/compact-fields.component.mjs +186 -0
- package/{compact/esm2020 → esm2020/compact}/compact.component.mjs +1 -1
- package/esm2020/compact/ngx-color-compact.mjs +5 -0
- package/esm2020/compact/public_api.mjs +4 -0
- package/esm2020/coordinates.directive.mjs +1 -1
- package/esm2020/editable-input.component.mjs +1 -1
- package/{github/esm2020 → esm2020/github}/github-swatch.component.mjs +1 -1
- package/{github/esm2020 → esm2020/github}/github.component.mjs +1 -1
- package/esm2020/github/ngx-color-github.mjs +5 -0
- package/esm2020/github/public_api.mjs +3 -0
- package/esm2020/helpers/checkboard.mjs +1 -1
- package/esm2020/helpers/color.interfaces.mjs +1 -1
- package/esm2020/helpers/color.mjs +1 -1
- package/esm2020/hue/hue-picker.component.mjs +113 -0
- package/esm2020/hue/ngx-color-hue.mjs +5 -0
- package/esm2020/hue/public_api.mjs +2 -0
- package/esm2020/hue.component.mjs +1 -1
- package/esm2020/material/material.component.mjs +211 -0
- package/esm2020/material/ngx-color-material.mjs +5 -0
- package/esm2020/material/public_api.mjs +2 -0
- package/esm2020/ngx-color.mjs +1 -1
- package/esm2020/photoshop/ngx-color-photoshop.mjs +5 -0
- package/{photoshop/esm2020 → esm2020/photoshop}/photoshop-button.component.mjs +1 -1
- package/esm2020/photoshop/photoshop-fields.component.mjs +241 -0
- package/{photoshop/esm2020 → esm2020/photoshop}/photoshop-previews.component.mjs +1 -1
- package/{photoshop/esm2020 → esm2020/photoshop}/photoshop.component.mjs +1 -1
- package/esm2020/photoshop/public_api.mjs +5 -0
- package/esm2020/public_api.mjs +1 -1
- package/esm2020/raised.component.mjs +1 -1
- package/esm2020/saturation.component.mjs +1 -1
- package/esm2020/shade/ngx-color-shade.mjs +5 -0
- package/esm2020/shade/public_api.mjs +2 -0
- package/esm2020/shade/shade-picker.component.mjs +105 -0
- package/esm2020/shade.component.mjs +1 -1
- package/esm2020/sketch/ngx-color-sketch.mjs +5 -0
- package/esm2020/sketch/public_api.mjs +4 -0
- package/esm2020/sketch/sketch-fields.component.mjs +243 -0
- package/{sketch/esm2020 → esm2020/sketch}/sketch-preset-colors.component.mjs +1 -1
- package/{sketch/esm2020 → esm2020/sketch}/sketch.component.mjs +1 -1
- package/esm2020/slider/ngx-color-slider.mjs +5 -0
- package/esm2020/slider/public_api.mjs +4 -0
- package/esm2020/slider/slider-swatch.component.mjs +80 -0
- package/{slider/esm2020 → esm2020/slider}/slider-swatches.component.mjs +1 -1
- package/{slider/esm2020 → esm2020/slider}/slider.component.mjs +1 -1
- package/esm2020/swatch.component.mjs +1 -1
- package/esm2020/swatches/ngx-color-swatches.mjs +5 -0
- package/esm2020/swatches/public_api.mjs +4 -0
- package/esm2020/swatches/swatches-color.component.mjs +123 -0
- package/{swatches/esm2020 → esm2020/swatches}/swatches-group.component.mjs +1 -1
- package/esm2020/swatches/swatches.component.mjs +258 -0
- package/esm2020/twitter/ngx-color-twitter.mjs +5 -0
- package/esm2020/twitter/public_api.mjs +2 -0
- package/{twitter/esm2020 → esm2020/twitter}/twitter.component.mjs +1 -1
- package/{alpha/fesm2015 → fesm2015}/ngx-color-alpha.mjs +0 -0
- package/fesm2015/ngx-color-alpha.mjs.map +1 -0
- package/{block/fesm2015 → fesm2015}/ngx-color-block.mjs +1 -3
- package/fesm2015/ngx-color-block.mjs.map +1 -0
- package/{chrome/fesm2015 → fesm2015}/ngx-color-chrome.mjs +0 -0
- package/fesm2015/ngx-color-chrome.mjs.map +1 -0
- package/{circle/fesm2015 → fesm2015}/ngx-color-circle.mjs +0 -0
- package/fesm2015/ngx-color-circle.mjs.map +1 -0
- package/{compact/fesm2015 → fesm2015}/ngx-color-compact.mjs +0 -0
- package/fesm2015/ngx-color-compact.mjs.map +1 -0
- package/{github/fesm2015 → fesm2015}/ngx-color-github.mjs +0 -0
- package/fesm2015/ngx-color-github.mjs.map +1 -0
- package/{hue/fesm2015 → fesm2015}/ngx-color-hue.mjs +0 -0
- package/fesm2015/ngx-color-hue.mjs.map +1 -0
- package/{material/fesm2015 → fesm2015}/ngx-color-material.mjs +0 -0
- package/fesm2015/ngx-color-material.mjs.map +1 -0
- package/{photoshop/fesm2015 → fesm2015}/ngx-color-photoshop.mjs +0 -0
- package/fesm2015/ngx-color-photoshop.mjs.map +1 -0
- package/{shade/fesm2015 → fesm2015}/ngx-color-shade.mjs +0 -0
- package/fesm2015/ngx-color-shade.mjs.map +1 -0
- package/{sketch/fesm2015 → fesm2015}/ngx-color-sketch.mjs +0 -0
- package/fesm2015/ngx-color-sketch.mjs.map +1 -0
- package/{slider/fesm2015 → fesm2015}/ngx-color-slider.mjs +0 -0
- package/fesm2015/ngx-color-slider.mjs.map +1 -0
- package/{swatches/fesm2015 → fesm2015}/ngx-color-swatches.mjs +0 -0
- package/fesm2015/ngx-color-swatches.mjs.map +1 -0
- package/{twitter/fesm2015 → fesm2015}/ngx-color-twitter.mjs +0 -0
- package/fesm2015/ngx-color-twitter.mjs.map +1 -0
- package/fesm2015/ngx-color.mjs.map +1 -1
- package/{alpha/fesm2020 → fesm2020}/ngx-color-alpha.mjs +0 -0
- package/fesm2020/ngx-color-alpha.mjs.map +1 -0
- package/{block/fesm2020 → fesm2020}/ngx-color-block.mjs +1 -3
- package/fesm2020/ngx-color-block.mjs.map +1 -0
- package/{chrome/fesm2020 → fesm2020}/ngx-color-chrome.mjs +0 -0
- package/fesm2020/ngx-color-chrome.mjs.map +1 -0
- package/{circle/fesm2020 → fesm2020}/ngx-color-circle.mjs +0 -0
- package/fesm2020/ngx-color-circle.mjs.map +1 -0
- package/{compact/fesm2020 → fesm2020}/ngx-color-compact.mjs +0 -0
- package/fesm2020/ngx-color-compact.mjs.map +1 -0
- package/{github/fesm2020 → fesm2020}/ngx-color-github.mjs +0 -0
- package/fesm2020/ngx-color-github.mjs.map +1 -0
- package/{hue/fesm2020 → fesm2020}/ngx-color-hue.mjs +0 -0
- package/fesm2020/ngx-color-hue.mjs.map +1 -0
- package/{material/fesm2020 → fesm2020}/ngx-color-material.mjs +0 -0
- package/fesm2020/ngx-color-material.mjs.map +1 -0
- package/{photoshop/fesm2020 → fesm2020}/ngx-color-photoshop.mjs +0 -0
- package/fesm2020/ngx-color-photoshop.mjs.map +1 -0
- package/{shade/fesm2020 → fesm2020}/ngx-color-shade.mjs +0 -0
- package/fesm2020/ngx-color-shade.mjs.map +1 -0
- package/{sketch/fesm2020 → fesm2020}/ngx-color-sketch.mjs +0 -0
- package/fesm2020/ngx-color-sketch.mjs.map +1 -0
- package/{slider/fesm2020 → fesm2020}/ngx-color-slider.mjs +0 -0
- package/fesm2020/ngx-color-slider.mjs.map +1 -0
- package/{swatches/fesm2020 → fesm2020}/ngx-color-swatches.mjs +0 -0
- package/fesm2020/ngx-color-swatches.mjs.map +1 -0
- package/{twitter/fesm2020 → fesm2020}/ngx-color-twitter.mjs +0 -0
- package/fesm2020/ngx-color-twitter.mjs.map +1 -0
- package/fesm2020/ngx-color.mjs.map +1 -1
- package/github/package.json +6 -22
- package/helpers/checkboard.d.ts +2 -2
- package/hue/package.json +6 -22
- package/material/package.json +6 -22
- package/package.json +119 -8
- package/photoshop/package.json +6 -22
- package/shade/package.json +6 -22
- package/sketch/package.json +6 -22
- package/slider/package.json +6 -22
- package/swatches/package.json +9 -22
- package/twitter/package.json +6 -22
- package/LICENSE +0 -21
- package/README.md +0 -280
- package/alpha/esm2020/alpha-picker.component.mjs +0 -116
- package/alpha/esm2020/ngx-color-alpha.mjs +0 -5
- package/alpha/esm2020/public_api.mjs +0 -2
- package/alpha/fesm2015/ngx-color-alpha.mjs.map +0 -1
- package/alpha/fesm2020/ngx-color-alpha.mjs.map +0 -1
- package/block/esm2020/ngx-color-block.mjs +0 -5
- package/block/esm2020/public_api.mjs +0 -3
- package/block/fesm2015/ngx-color-block.mjs.map +0 -1
- package/block/fesm2020/ngx-color-block.mjs.map +0 -1
- package/chrome/esm2020/chrome-fields.component.mjs +0 -356
- package/chrome/esm2020/ngx-color-chrome.mjs +0 -5
- package/chrome/esm2020/public_api.mjs +0 -3
- package/chrome/fesm2015/ngx-color-chrome.mjs.map +0 -1
- package/chrome/fesm2020/ngx-color-chrome.mjs.map +0 -1
- package/circle/esm2020/circle-swatch.component.mjs +0 -85
- package/circle/esm2020/circle.component.mjs +0 -148
- package/circle/esm2020/ngx-color-circle.mjs +0 -5
- package/circle/esm2020/public_api.mjs +0 -3
- package/circle/fesm2015/ngx-color-circle.mjs.map +0 -1
- package/circle/fesm2020/ngx-color-circle.mjs.map +0 -1
- package/compact/esm2020/compact-color.component.mjs +0 -91
- package/compact/esm2020/compact-fields.component.mjs +0 -186
- package/compact/esm2020/ngx-color-compact.mjs +0 -5
- package/compact/esm2020/public_api.mjs +0 -4
- package/compact/fesm2015/ngx-color-compact.mjs.map +0 -1
- package/compact/fesm2020/ngx-color-compact.mjs.map +0 -1
- package/github/esm2020/ngx-color-github.mjs +0 -5
- package/github/esm2020/public_api.mjs +0 -3
- package/github/fesm2015/ngx-color-github.mjs.map +0 -1
- package/github/fesm2020/ngx-color-github.mjs.map +0 -1
- package/hue/esm2020/hue-picker.component.mjs +0 -113
- package/hue/esm2020/ngx-color-hue.mjs +0 -5
- package/hue/esm2020/public_api.mjs +0 -2
- package/hue/fesm2015/ngx-color-hue.mjs.map +0 -1
- package/hue/fesm2020/ngx-color-hue.mjs.map +0 -1
- package/material/esm2020/material.component.mjs +0 -211
- package/material/esm2020/ngx-color-material.mjs +0 -5
- package/material/esm2020/public_api.mjs +0 -2
- package/material/fesm2015/ngx-color-material.mjs.map +0 -1
- package/material/fesm2020/ngx-color-material.mjs.map +0 -1
- package/photoshop/esm2020/ngx-color-photoshop.mjs +0 -5
- package/photoshop/esm2020/photoshop-fields.component.mjs +0 -241
- package/photoshop/esm2020/public_api.mjs +0 -5
- package/photoshop/fesm2015/ngx-color-photoshop.mjs.map +0 -1
- package/photoshop/fesm2020/ngx-color-photoshop.mjs.map +0 -1
- package/shade/esm2020/ngx-color-shade.mjs +0 -5
- package/shade/esm2020/public_api.mjs +0 -2
- package/shade/esm2020/shade-picker.component.mjs +0 -105
- package/shade/fesm2015/ngx-color-shade.mjs.map +0 -1
- package/shade/fesm2020/ngx-color-shade.mjs.map +0 -1
- package/sketch/esm2020/ngx-color-sketch.mjs +0 -5
- package/sketch/esm2020/public_api.mjs +0 -4
- package/sketch/esm2020/sketch-fields.component.mjs +0 -243
- package/sketch/fesm2015/ngx-color-sketch.mjs.map +0 -1
- package/sketch/fesm2020/ngx-color-sketch.mjs.map +0 -1
- package/slider/esm2020/ngx-color-slider.mjs +0 -5
- package/slider/esm2020/public_api.mjs +0 -4
- package/slider/esm2020/slider-swatch.component.mjs +0 -80
- package/slider/fesm2015/ngx-color-slider.mjs.map +0 -1
- package/slider/fesm2020/ngx-color-slider.mjs.map +0 -1
- package/swatches/esm2020/ngx-color-swatches.mjs +0 -5
- package/swatches/esm2020/public_api.mjs +0 -4
- package/swatches/esm2020/swatches-color.component.mjs +0 -123
- package/swatches/esm2020/swatches.component.mjs +0 -258
- package/swatches/fesm2015/ngx-color-swatches.mjs.map +0 -1
- package/swatches/fesm2020/ngx-color-swatches.mjs.map +0 -1
- package/twitter/esm2020/ngx-color-twitter.mjs +0 -5
- package/twitter/esm2020/public_api.mjs +0 -2
- package/twitter/fesm2015/ngx-color-twitter.mjs.map +0 -1
- package/twitter/fesm2020/ngx-color-twitter.mjs.map +0 -1
package/README.md
DELETED
@@ -1,280 +0,0 @@
|
|
1
|
-
<div align="center">
|
2
|
-
<img src="https://raw.githubusercontent.com/scttcper/ngx-color/master/misc/sketch-example.png" width="225" alt="Angular color sketch preview">
|
3
|
-
<br>
|
4
|
-
<h1>Angular Color</h1>
|
5
|
-
<br>
|
6
|
-
<a href="https://www.npmjs.org/package/ngx-color">
|
7
|
-
<img src="https://badge.fury.io/js/ngx-color.svg" alt="npm">
|
8
|
-
</a>
|
9
|
-
<a href="https://circleci.com/gh/scttcper/ngx-color">
|
10
|
-
<img src="https://circleci.com/gh/scttcper/ngx-color.svg?style=svg" alt="circleci"></a>
|
11
|
-
<a href="https://codecov.io/github/scttcper/ngx-color">
|
12
|
-
<img src="https://img.shields.io/codecov/c/github/scttcper/ngx-color.svg" alt="codecov">
|
13
|
-
</a>
|
14
|
-
</div>
|
15
|
-
|
16
|
-
<br>
|
17
|
-
<br>
|
18
|
-
|
19
|
-
DEMO: https://ngx-color.vercel.app
|
20
|
-
|
21
|
-
- [Component API](#component-api)
|
22
|
-
- [Color](#color)
|
23
|
-
- [onChange](#onchange)
|
24
|
-
- [onChangeComplete](#onchangecomplete)
|
25
|
-
- [Individual APIs](#individual-apis)
|
26
|
-
- [Alpha](#alpha)
|
27
|
-
- [Block](#block)
|
28
|
-
- [Chrome](#chrome)
|
29
|
-
- [Circle](#circle)
|
30
|
-
- [Compact](#compact)
|
31
|
-
- [Github](#github)
|
32
|
-
- [Hue](#hue)
|
33
|
-
- [Material](#material)
|
34
|
-
- [Photoshop](#photoshop)
|
35
|
-
- [Sketch](#sketch)
|
36
|
-
- [Slider](#slider)
|
37
|
-
- [Swatches](#swatches)
|
38
|
-
- [Twitter](#twitter)
|
39
|
-
- [Shade](#shade)
|
40
|
-
|
41
|
-
## About
|
42
|
-
|
43
|
-
- **13 Different Pickers** - Sketch, Photoshop, Chrome, Twitter and many more
|
44
|
-
|
45
|
-
- **Make Your Own** - Use the building block components to make your own
|
46
|
-
|
47
|
-
- This is a port of [react-color](https://github.com/casesandberg/react-color)
|
48
|
-
by casesandberg
|
49
|
-
|
50
|
-
## Getting Started
|
51
|
-
|
52
|
-
## Dependencies
|
53
|
-
|
54
|
-
Latest version available for each version of Angular
|
55
|
-
|
56
|
-
| ngx-color | Angular |
|
57
|
-
| --------- | --------- |
|
58
|
-
| 3.0.3 | 6.x 7.x |
|
59
|
-
| 4.1.1 | 8.x |
|
60
|
-
| 5.1.4 | 9.x |
|
61
|
-
| 6.2.0 | 10.x 11.x |
|
62
|
-
| current | >= 12.x |
|
63
|
-
|
64
|
-
### Install
|
65
|
-
|
66
|
-
```sh
|
67
|
-
npm install ngx-color --save
|
68
|
-
```
|
69
|
-
|
70
|
-
### Include Component
|
71
|
-
|
72
|
-
##### import
|
73
|
-
|
74
|
-
```ts
|
75
|
-
import { ColorSketchModule } from 'ngx-color/sketch';
|
76
|
-
|
77
|
-
@NgModule({
|
78
|
-
imports: [
|
79
|
-
ColorSketchModule, // added to imports
|
80
|
-
],
|
81
|
-
})
|
82
|
-
class YourModule {}
|
83
|
-
```
|
84
|
-
|
85
|
-
##### use
|
86
|
-
|
87
|
-
```html
|
88
|
-
<color-sketch [color]="state" (onChangeComplete)="changeComplete($event)"></color-sketch>
|
89
|
-
```
|
90
|
-
|
91
|
-
### Others available
|
92
|
-
|
93
|
-
```ts
|
94
|
-
import { ColorAlphaModule } from 'ngx-color/alpha'; // <color-alpha-picker></color-alpha-picker>
|
95
|
-
import { ColorBlockModule } from 'ngx-color/block'; // <color-block></color-block>
|
96
|
-
import { ColorChromeModule } from 'ngx-color/chrome'; // <color-chrome></color-chrome>
|
97
|
-
import { ColorCircleModule } from 'ngx-color/circle'; // <color-circle></color-circle>
|
98
|
-
import { ColorCompactModule } from 'ngx-color/compact'; // <color-compact></color-compact>
|
99
|
-
import { ColorGithubModule } from 'ngx-color/github'; // <color-github></color-github>
|
100
|
-
import { ColorHueModule } from 'ngx-color/hue'; // <color-hue-picker></color-hue-picker>
|
101
|
-
import { ColorMaterialModule } from 'ngx-color/material'; // <color-material></color-material>
|
102
|
-
import { ColorPhotoshopModule } from 'ngx-color/photoshop'; // <color-photoshop></color-photoshop>
|
103
|
-
import { ColorSketchModule } from 'ngx-color/sketch'; // <color-sketch></color-sketch>
|
104
|
-
import { ColorSliderModule } from 'ngx-color/slider'; // <color-slider></color-slider>
|
105
|
-
import { ColorSwatchesModule } from 'ngx-color/swatches'; // <color-swatches></color-swatches>
|
106
|
-
import { ColorTwitterModule } from 'ngx-color/twitter'; // <color-twitter></color-twitter>
|
107
|
-
import { ColorShadeModule } from 'ngx-color/shade'; // <color-shade-picker></color-shade-picker>
|
108
|
-
```
|
109
|
-
|
110
|
-
# Component API
|
111
|
-
|
112
|
-
## Color
|
113
|
-
|
114
|
-
Color controls what color is active on the color picker. You can use this to
|
115
|
-
initialize the color picker with a particular color, or to keep it in sync with
|
116
|
-
the state of a parent component.
|
117
|
-
|
118
|
-
Color accepts either a string of a hex color `'#333'` or a object of rgb or hsl
|
119
|
-
values `{ r: 51, g: 51, b: 51 }` or `{ h: 0, s: 0, l: .10 }`. Both rgb and hsl
|
120
|
-
will also take a `a: 1` value for alpha. You can also use `transparent`.
|
121
|
-
|
122
|
-
```html
|
123
|
-
<color-sketch color="#fff" (onChangeComplete)="handleChangeComplete($event)"></color-sketch>
|
124
|
-
```
|
125
|
-
|
126
|
-
In this case, the color picker will initialize with the color `#fff`. When the
|
127
|
-
color is changed, `handleChangeComplete` will fire and set the new color to
|
128
|
-
state.
|
129
|
-
|
130
|
-
## onChange
|
131
|
-
|
132
|
-
Pass a function to call every time the color is changed. Use this to store the
|
133
|
-
color in the state of a parent component or to make other transformations.
|
134
|
-
|
135
|
-
Keep in mind this is called on drag events that can happen quite frequently. If
|
136
|
-
you just need to get the color once use `onChangeComplete`.
|
137
|
-
|
138
|
-
```ts
|
139
|
-
import { Component } from '@angular/core';
|
140
|
-
import { ColorEvent } from 'ngx-color';
|
141
|
-
|
142
|
-
@Component({
|
143
|
-
selector: 'selector-name',
|
144
|
-
template: ` <color-sketch (onChange)="handleChange($event)"></color-sketch> `,
|
145
|
-
})
|
146
|
-
export class NameComponent {
|
147
|
-
constructor() {}
|
148
|
-
|
149
|
-
handleChange($event: ColorEvent) {
|
150
|
-
console.log($event.color);
|
151
|
-
// color = {
|
152
|
-
// hex: '#333',
|
153
|
-
// rgb: {
|
154
|
-
// r: 51,
|
155
|
-
// g: 51,
|
156
|
-
// b: 51,
|
157
|
-
// a: 1,
|
158
|
-
// },
|
159
|
-
// hsl: {
|
160
|
-
// h: 0,
|
161
|
-
// s: 0,
|
162
|
-
// l: .20,
|
163
|
-
// a: 1,
|
164
|
-
// },
|
165
|
-
// }
|
166
|
-
}
|
167
|
-
}
|
168
|
-
```
|
169
|
-
|
170
|
-
## onChangeComplete
|
171
|
-
|
172
|
-
Pass a function to call once a color change is complete.
|
173
|
-
|
174
|
-
## Individual APIs
|
175
|
-
|
176
|
-
Some pickers have specific APIs that are unique to themselves:
|
177
|
-
|
178
|
-
### Alpha
|
179
|
-
|
180
|
-
- **width** - String | Number, Pixel value for picker width. Default `316px`
|
181
|
-
- **height** - String | Number, Pixel value for picker height. Default `16px`
|
182
|
-
- **direction** - String, `horizontal` or `vertical`. Default `horizontal`
|
183
|
-
|
184
|
-
### Block
|
185
|
-
|
186
|
-
- **width** - string | number, Pixel value for picker width. Default `170px`
|
187
|
-
- **colors** - Array of Strings, Color squares to display. Default `['#D9E3F0', '#F47373', '#697689', '#37D67A', '#2CCCE4', '#555555', '#dce775', '#ff8a65', '#ba68c8']`
|
188
|
-
- **triangle** - String, Either `hide` or `top`. Default `top`
|
189
|
-
- **onSwatchHover** - (Output) An event handler for `onMouseOver` on the
|
190
|
-
`<Swatch>`s within this component. Gives the args `(color, event)`
|
191
|
-
|
192
|
-
### Chrome
|
193
|
-
|
194
|
-
- **disableAlpha** - Bool, Remove alpha slider and options from picker. Default
|
195
|
-
`false`
|
196
|
-
|
197
|
-
### Circle
|
198
|
-
|
199
|
-
- **width** - String | number, Pixel value for picker width. Default `252px`
|
200
|
-
- **colors** - Array of Strings, Color squares to display. Default `["#f44336", "#e91e63", "#9c27b0", "#673ab7", "#3f51b5", "#2196f3", "#03a9f4", "#00bcd4", "#009688", "#4caf50", "#8bc34a", "#cddc39", "#ffeb3b", "#ffc107", "#ff9800", "#ff5722", "#795548", "#607d8b"]`
|
201
|
-
- **circleSize** - Number, Value for circle size. Default `28`
|
202
|
-
- **circleSpacing** - Number, Value for spacing between circles. Default `14`
|
203
|
-
- **onSwatchHover** - (Output) An event handler for `onMouseOver` on the
|
204
|
-
`<Swatch>`s within this component. Gives the args `(color, event)`
|
205
|
-
|
206
|
-
### Compact
|
207
|
-
|
208
|
-
- **colors** - Array of Strings, Color squares to display. Default `['#4D4D4D', '#999999', '#FFFFFF', '#F44E3B', '#FE9200', '#FCDC00', '#DBDF00', '#A4DD00', '#68CCCA', '#73D8FF', '#AEA1FF', '#FDA1FF', '#333333', '#808080', '#cccccc', '#D33115', '#E27300', '#FCC400', '#B0BC00', '#68BC00', '#16A5A5', '#009CE0', '#7B64FF', '#FA28FF', '#000000', '#666666', '#B3B3B3', '#9F0500', '#C45100', '#FB9E00', '#808900', '#194D33', '#0C797D', '#0062B1', '#653294', '#AB149E']`
|
209
|
-
- **onSwatchHover** - (Output) An event handler for `onMouseOver` on the
|
210
|
-
`<Swatch>`s within this component. Gives the args `(color, event)`
|
211
|
-
|
212
|
-
### Github
|
213
|
-
|
214
|
-
- **width** - string | number, Pixel value for picker width. Default `212px`
|
215
|
-
- **colors** - Array of Strings, Color squares to display. Default `['#B80000', '#DB3E00', '#FCCB00', '#008B02', '#006B76', '#1273DE', '#004DCF', '#5300EB', '#EB9694', '#FAD0C3', '#FEF3BD', '#C1E1C5', '#BEDADC', '#C4DEF6', '#BED3F3', '#D4C4FB']`
|
216
|
-
- **triangle** - String, Either `hide`, `top-left` or `top-right`. Default
|
217
|
-
`top-left`
|
218
|
-
- **onSwatchHover** - (Output) An event handler for `onMouseOver` on the
|
219
|
-
`<Swatch>`s within this component. Gives the args `(color, event)`
|
220
|
-
|
221
|
-
### Hue
|
222
|
-
|
223
|
-
- **width** - string | number, Pixel value for picker width. Default `316px`
|
224
|
-
- **height** - string | number, Pixel value for picker height. Default `16px`
|
225
|
-
- **direction** - String Enum, `horizontal` or `vertical`. Default `horizontal`
|
226
|
-
|
227
|
-
### Material
|
228
|
-
|
229
|
-
None
|
230
|
-
|
231
|
-
### Photoshop
|
232
|
-
|
233
|
-
- **header** - String, Title text. Default `Color Picker`
|
234
|
-
- **onAccept** - (Output), Callback for when accept is clicked.
|
235
|
-
- **onCancel** - (Output), Callback for when cancel is clicked.
|
236
|
-
|
237
|
-
### Sketch
|
238
|
-
|
239
|
-
- **disableAlpha** - Bool, Remove alpha slider and options from picker. Default
|
240
|
-
`false`
|
241
|
-
- **presetColors** - Array of Strings or Objects, Hex strings for default colors
|
242
|
-
at bottom of picker. Default `['#D0021B', '#F5A623', '#F8E71C', '#8B572A', '#7ED321', '#417505', '#BD10E0', '#9013FE', '#4A90E2', '#50E3C2', '#B8E986', '#000000', '#4A4A4A', '#9B9B9B', '#FFFFFF']`
|
243
|
-
> **presetColors** may also be described as an array of objects with `color`
|
244
|
-
> and `title` properties: `[{ color: '#f00', title: 'red' }]` or a combination
|
245
|
-
> of both
|
246
|
-
- **width** - Number, Width of picker. Default `200`
|
247
|
-
- **onSwatchHover** - An event handler for `onMouseOver` on the `<Swatch>`s
|
248
|
-
within this component. Gives the args `(color, event)`
|
249
|
-
|
250
|
-
### Slider
|
251
|
-
|
252
|
-
- **pointer** - React Component, Custom pointer component
|
253
|
-
|
254
|
-
### Swatches
|
255
|
-
|
256
|
-
- **width** - string | number, Pixel value for picker width. Default `320`
|
257
|
-
- **height** - string | number, Pixel value for picker height. Default `240`
|
258
|
-
- **colors** - Array of Arrays of Strings, An array of color groups, each with
|
259
|
-
an array of colors
|
260
|
-
- **onSwatchHover** - (Output) An event handler for `onMouseOver` on the
|
261
|
-
`<Swatch>`s within this component. Gives the args `(color, event)`
|
262
|
-
|
263
|
-
### Twitter
|
264
|
-
|
265
|
-
- **width** - string | number, Pixel value for picker width. Default `276px`
|
266
|
-
- **colors** - Array of Strings, Color squares to display. Default `['#FF6900', '#FCB900', '#7BDCB5', '#00D084', '#8ED1FC', '#0693E3', '#ABB8C3', '#EB144C', '#F78DA7', '#9900EF']`
|
267
|
-
- **triangle** - String, Either `hide`, `top-left` or `top-right`. Default
|
268
|
-
`top-left`
|
269
|
-
- **onSwatchHover** - (Output) An event handler for `onMouseOver` on the
|
270
|
-
`<Swatch>`s within this component. Gives the args `(color, event)`
|
271
|
-
|
272
|
-
### Shade
|
273
|
-
|
274
|
-
- **width** - String | Number, Pixel value for picker width. Default `316px`
|
275
|
-
- **height** - String | Number, Pixel value for picker height. Default `16px`
|
276
|
-
|
277
|
-
---
|
278
|
-
|
279
|
-
> GitHub [@scttcper](https://github.com/scttcper) ·
|
280
|
-
> Twitter [@scttcper](https://twitter.com/scttcper)
|
@@ -1,116 +0,0 @@
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
2
|
-
import { ChangeDetectionStrategy, Component, forwardRef, Input, NgModule } from '@angular/core';
|
3
|
-
import { AlphaModule, CheckboardModule, ColorWrap, toState } from 'ngx-color';
|
4
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
5
|
-
import * as i0 from "@angular/core";
|
6
|
-
import * as i1 from "ngx-color";
|
7
|
-
export class AlphaPickerComponent extends ColorWrap {
|
8
|
-
constructor() {
|
9
|
-
super();
|
10
|
-
/** Pixel value for picker width */
|
11
|
-
this.width = 316;
|
12
|
-
/** Pixel value for picker height */
|
13
|
-
this.height = 16;
|
14
|
-
this.direction = 'horizontal';
|
15
|
-
this.pointer = {
|
16
|
-
width: '18px',
|
17
|
-
height: '18px',
|
18
|
-
borderRadius: '50%',
|
19
|
-
transform: 'translate(-9px, -2px)',
|
20
|
-
boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)',
|
21
|
-
};
|
22
|
-
}
|
23
|
-
ngOnChanges() {
|
24
|
-
if (this.direction === 'vertical') {
|
25
|
-
this.pointer.transform = 'translate(-3px, -9px)';
|
26
|
-
}
|
27
|
-
this.setState(toState(this.color, this.oldHue));
|
28
|
-
}
|
29
|
-
handlePickerChange({ data, $event }) {
|
30
|
-
this.handleChange(data, $event);
|
31
|
-
}
|
32
|
-
}
|
33
|
-
AlphaPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: AlphaPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
34
|
-
AlphaPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: AlphaPickerComponent, selector: "color-alpha-picker", inputs: { width: "width", height: "height", direction: "direction" }, providers: [
|
35
|
-
{
|
36
|
-
provide: NG_VALUE_ACCESSOR,
|
37
|
-
useExisting: forwardRef(() => AlphaPickerComponent),
|
38
|
-
multi: true,
|
39
|
-
},
|
40
|
-
{
|
41
|
-
provide: ColorWrap,
|
42
|
-
useExisting: forwardRef(() => AlphaPickerComponent)
|
43
|
-
}
|
44
|
-
], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
45
|
-
<div class="alpha-picker {{ className }}"
|
46
|
-
[style.width.px]="width" [style.height.px]="height">
|
47
|
-
<color-alpha
|
48
|
-
[hsl]="hsl"
|
49
|
-
[rgb]="rgb"
|
50
|
-
[pointer]="pointer"
|
51
|
-
[direction]="direction"
|
52
|
-
(onChange)="handlePickerChange($event)"
|
53
|
-
></color-alpha>
|
54
|
-
</div>
|
55
|
-
`, isInline: true, styles: [".alpha-picker{position:relative}.color-alpha{radius:2px}\n"], components: [{ type: i1.AlphaComponent, selector: "color-alpha", inputs: ["hsl", "rgb", "pointer", "shadow", "radius", "direction"], outputs: ["onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: AlphaPickerComponent, decorators: [{
|
57
|
-
type: Component,
|
58
|
-
args: [{
|
59
|
-
selector: 'color-alpha-picker',
|
60
|
-
template: `
|
61
|
-
<div class="alpha-picker {{ className }}"
|
62
|
-
[style.width.px]="width" [style.height.px]="height">
|
63
|
-
<color-alpha
|
64
|
-
[hsl]="hsl"
|
65
|
-
[rgb]="rgb"
|
66
|
-
[pointer]="pointer"
|
67
|
-
[direction]="direction"
|
68
|
-
(onChange)="handlePickerChange($event)"
|
69
|
-
></color-alpha>
|
70
|
-
</div>
|
71
|
-
`,
|
72
|
-
styles: [
|
73
|
-
`
|
74
|
-
.alpha-picker {
|
75
|
-
position: relative;
|
76
|
-
}
|
77
|
-
.color-alpha {
|
78
|
-
radius: 2px;
|
79
|
-
}
|
80
|
-
`,
|
81
|
-
],
|
82
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
83
|
-
preserveWhitespaces: false,
|
84
|
-
providers: [
|
85
|
-
{
|
86
|
-
provide: NG_VALUE_ACCESSOR,
|
87
|
-
useExisting: forwardRef(() => AlphaPickerComponent),
|
88
|
-
multi: true,
|
89
|
-
},
|
90
|
-
{
|
91
|
-
provide: ColorWrap,
|
92
|
-
useExisting: forwardRef(() => AlphaPickerComponent)
|
93
|
-
}
|
94
|
-
]
|
95
|
-
}]
|
96
|
-
}], ctorParameters: function () { return []; }, propDecorators: { width: [{
|
97
|
-
type: Input
|
98
|
-
}], height: [{
|
99
|
-
type: Input
|
100
|
-
}], direction: [{
|
101
|
-
type: Input
|
102
|
-
}] } });
|
103
|
-
export class ColorAlphaModule {
|
104
|
-
}
|
105
|
-
ColorAlphaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorAlphaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
106
|
-
ColorAlphaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorAlphaModule, declarations: [AlphaPickerComponent], imports: [CommonModule, AlphaModule, CheckboardModule], exports: [AlphaPickerComponent] });
|
107
|
-
ColorAlphaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorAlphaModule, imports: [[CommonModule, AlphaModule, CheckboardModule]] });
|
108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorAlphaModule, decorators: [{
|
109
|
-
type: NgModule,
|
110
|
-
args: [{
|
111
|
-
declarations: [AlphaPickerComponent],
|
112
|
-
exports: [AlphaPickerComponent],
|
113
|
-
imports: [CommonModule, AlphaModule, CheckboardModule],
|
114
|
-
}]
|
115
|
-
}] });
|
116
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxwaGEtcGlja2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvY29tcG9uZW50cy9hbHBoYS9hbHBoYS1waWNrZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBL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BvbmVudF0sXG4gIGV4cG9ydHM6IFtBbHBoYVBpY2tlckNvbXBvbmVudF0sXG4gIGltcG9ydHM6IFtDb21tb25Nb2R1bGUsIEFscGhhTW9kdWxlLCBDaGVja2JvYXJkTW9kdWxlXSxcbn0pXG5leHBvcnQgY2xhc3MgQ29sb3JBbHBoYU1vZHVsZSB7fVxuIl19
|
@@ -1,5 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Generated bundle index. Do not edit.
|
3
|
-
*/
|
4
|
-
export * from './public_api';
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWNvbG9yLWFscGhhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xpYi9jb21wb25lbnRzL2FscGhhL25neC1jb2xvci1hbHBoYS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
|
@@ -1,2 +0,0 @@
|
|
1
|
-
export { AlphaPickerComponent, ColorAlphaModule } from './alpha-picker.component';
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvY29tcG9uZW50cy9hbHBoYS9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLDBCQUEwQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgQWxwaGFQaWNrZXJDb21wb25lbnQsIENvbG9yQWxwaGFNb2R1bGUgfSBmcm9tICcuL2FscGhhLXBpY2tlci5jb21wb25lbnQnO1xuIl19
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ngx-color-alpha.mjs","sources":["../../../../src/lib/components/alpha/alpha-picker.component.ts","../../../../src/lib/components/alpha/ngx-color-alpha.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, forwardRef, Input, NgModule, OnChanges } from '@angular/core';\n\nimport { AlphaModule, CheckboardModule, ColorWrap, toState } from 'ngx-color';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'color-alpha-picker',\n template: `\n <div class=\"alpha-picker {{ className }}\"\n [style.width.px]=\"width\" [style.height.px]=\"height\">\n <color-alpha\n [hsl]=\"hsl\"\n [rgb]=\"rgb\"\n [pointer]=\"pointer\"\n [direction]=\"direction\"\n (onChange)=\"handlePickerChange($event)\"\n ></color-alpha>\n </div>\n `,\n styles: [\n `\n .alpha-picker {\n position: relative;\n }\n .color-alpha {\n radius: 2px;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AlphaPickerComponent),\n multi: true,\n },\n {\n provide: ColorWrap,\n useExisting: forwardRef(() => AlphaPickerComponent)\n }\n ]\n})\nexport class AlphaPickerComponent extends ColorWrap implements OnChanges {\n /** Pixel value for picker width */\n @Input() width: string | number = 316;\n /** Pixel value for picker height */\n @Input() height: string | number = 16;\n @Input() direction: 'horizontal' | 'vertical' = 'horizontal';\n pointer: {[key: string]: string} = {\n width: '18px',\n height: '18px',\n borderRadius: '50%',\n transform: 'translate(-9px, -2px)',\n boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)',\n };\n\n constructor() {\n super();\n }\n ngOnChanges() {\n if (this.direction === 'vertical') {\n this.pointer.transform = 'translate(-3px, -9px)';\n }\n this.setState(toState(this.color, this.oldHue));\n }\n handlePickerChange({ data, $event }) {\n this.handleChange(data, $event);\n }\n}\n\n@NgModule({\n declarations: [AlphaPickerComponent],\n exports: [AlphaPickerComponent],\n imports: [CommonModule, AlphaModule, CheckboardModule],\n})\nexport class ColorAlphaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MA4Ca,6BAA6B,SAAS;IAcjD;QACE,KAAK,EAAE,CAAC;;QAbD,UAAK,GAAoB,GAAG,CAAC;;QAE7B,WAAM,GAAoB,EAAE,CAAC;QAC7B,cAAS,GAA8B,YAAY,CAAC;QAC7D,YAAO,GAA4B;YACjC,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;YACd,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,uBAAuB;YAClC,SAAS,EAAE,iCAAiC;SAC7C,CAAC;KAID;IACD,WAAW;QACT,IAAI,IAAI,CAAC,SAAS,KAAK,UAAU,EAAE;YACjC,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,uBAAuB,CAAC;SAClD;QACD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;KACjD;IACD,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;QACjC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KACjC;;iHAzBU,oBAAoB;qGAApB,oBAAoB,mHAZpB;QACT;YACE,OAAO,EAAE,iBAAiB;YAC1B,WAAW,EAAE,UAAU,CAAC,MAAM,oBAAoB,CAAC;YACnD,KAAK,EAAE,IAAI;SACZ;QACD;YACE,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,UAAU,CAAC,MAAM,oBAAoB,CAAC;SACpD;KACF,sEAlCS;;;;;;;;;;;GAWT;2FAyBU,oBAAoB;kBAtChC,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,QAAQ,EAAE;;;;;;;;;;;GAWT;oBACD,MAAM,EAAE;wBACN;;;;;;;GAOD;qBACA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,mBAAmB,EAAE,KAAK;oBAC1B,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,0BAA0B,CAAC;4BACnD,KAAK,EAAE,IAAI;yBACZ;wBACD;4BACE,OAAO,EAAE,SAAS;4BAClB,WAAW,EAAE,UAAU,CAAC,0BAA0B,CAAC;yBACpD;qBACF;iBACF;0EAGU,KAAK;sBAAb,KAAK;gBAEG,MAAM;sBAAd,KAAK;gBACG,SAAS;sBAAjB,KAAK;;MA4BK,gBAAgB;;6GAAhB,gBAAgB;8GAAhB,gBAAgB,iBAjChB,oBAAoB,aA+BrB,YAAY,EAAE,WAAW,EAAE,gBAAgB,aA/B1C,oBAAoB;8GAiCpB,gBAAgB,YAFlB,CAAC,YAAY,EAAE,WAAW,EAAE,gBAAgB,CAAC;2FAE3C,gBAAgB;kBAL5B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,gBAAgB,CAAC;iBACvD;;;AC5ED;;;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ngx-color-alpha.mjs","sources":["../../../../src/lib/components/alpha/alpha-picker.component.ts","../../../../src/lib/components/alpha/ngx-color-alpha.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, forwardRef, Input, NgModule, OnChanges } from '@angular/core';\n\nimport { AlphaModule, CheckboardModule, ColorWrap, toState } from 'ngx-color';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'color-alpha-picker',\n template: `\n <div class=\"alpha-picker {{ className }}\"\n [style.width.px]=\"width\" [style.height.px]=\"height\">\n <color-alpha\n [hsl]=\"hsl\"\n [rgb]=\"rgb\"\n [pointer]=\"pointer\"\n [direction]=\"direction\"\n (onChange)=\"handlePickerChange($event)\"\n ></color-alpha>\n </div>\n `,\n styles: [\n `\n .alpha-picker {\n position: relative;\n }\n .color-alpha {\n radius: 2px;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AlphaPickerComponent),\n multi: true,\n },\n {\n provide: ColorWrap,\n useExisting: forwardRef(() => AlphaPickerComponent)\n }\n ]\n})\nexport class AlphaPickerComponent extends ColorWrap implements OnChanges {\n /** Pixel value for picker width */\n @Input() width: string | number = 316;\n /** Pixel value for picker height */\n @Input() height: string | number = 16;\n @Input() direction: 'horizontal' | 'vertical' = 'horizontal';\n pointer: {[key: string]: string} = {\n width: '18px',\n height: '18px',\n borderRadius: '50%',\n transform: 'translate(-9px, -2px)',\n boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)',\n };\n\n constructor() {\n super();\n }\n ngOnChanges() {\n if (this.direction === 'vertical') {\n this.pointer.transform = 'translate(-3px, -9px)';\n }\n this.setState(toState(this.color, this.oldHue));\n }\n handlePickerChange({ data, $event }) {\n this.handleChange(data, $event);\n }\n}\n\n@NgModule({\n declarations: [AlphaPickerComponent],\n exports: [AlphaPickerComponent],\n imports: [CommonModule, AlphaModule, CheckboardModule],\n})\nexport class ColorAlphaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MA4Ca,oBAAqB,SAAQ,SAAS;IAcjD;QACE,KAAK,EAAE,CAAC;;QAbD,UAAK,GAAoB,GAAG,CAAC;;QAE7B,WAAM,GAAoB,EAAE,CAAC;QAC7B,cAAS,G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BACF;0EAGU,KAAK;sBAAb,KAAK;gBAEG,MAAM;sBAAd,KAAK;gBACG,SAAS;sBAAjB,KAAK;;MA4BK,gBAAgB;;6GAAhB,gBAAgB;8GAAhB,gBAAgB,iBAjChB,oBAAoB,aA+BrB,YAAY,EAAE,WAAW,EAAE,gBAAgB,aA/B1C,oBAAoB;8GAiCpB,gBAAgB,YAFlB,CAAC,YAAY,EAAE,WAAW,EAAE,gBAAgB,CAAC;2FAE3C,gBAAgB;kBAL5B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,gBAAgB,CAAC;iBACvD;;;AC5ED;;;;;;"}
|
@@ -1,5 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Generated bundle index. Do not edit.
|
3
|
-
*/
|
4
|
-
export * from './public_api';
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWNvbG9yLWJsb2NrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xpYi9jb21wb25lbnRzL2Jsb2NrL25neC1jb2xvci1ibG9jay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
|
@@ -1,3 +0,0 @@
|
|
1
|
-
export { BlockSwatchesComponent } from './block-swatches.component';
|
2
|
-
export { BlockComponent, ColorBlockModule } from './block.component';
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvY29tcG9uZW50cy9ibG9jay9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ3BFLE9BQU8sRUFBRSxjQUFjLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IEJsb2NrU3dhdGNoZXNDb21wb25lbnQgfSBmcm9tICcuL2Jsb2NrLXN3YXRjaGVzLmNvbXBvbmVudCc7XG5leHBvcnQgeyBCbG9ja0NvbXBvbmVudCwgQ29sb3JCbG9ja01vZHVsZSB9IGZyb20gJy4vYmxvY2suY29tcG9uZW50JztcbiJdfQ==
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ngx-color-block.mjs","sources":["../../../../src/lib/components/block/block-swatches.component.ts","../../../../src/lib/components/block/block.component.ts","../../../../src/lib/components/block/ngx-color-block.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\n\nimport { Shape } from 'ngx-color';\n\n@Component({\n selector: 'color-block-swatches',\n template: `\n <div class=\"block-swatches\">\n <color-swatch\n *ngFor=\"let c of colors\"\n [color]=\"c\"\n [style]=\"swatchStyle\"\n [focusStyle]=\"focusStyle(c)\"\n (onClick)=\"handleClick($event)\"\n (onHover)=\"onSwatchHover.emit($event)\"\n ></color-swatch>\n <div class=\"clear\"></div>\n </div>\n `,\n styles: [`\n .block-swatches {\n margin-right: -10px;\n }\n .clear {\n clear: both;\n }\n `],\n})\nexport class BlockSwatchesComponent implements OnInit {\n @Input() colors!: string[] | Shape[];\n @Output() onClick = new EventEmitter<any>();\n @Output() onSwatchHover = new EventEmitter<any>();\n swatchStyle?: {[key: string]: string};\n\n constructor() { }\n\n ngOnInit() {\n this.swatchStyle = {\n width: '22px',\n height: '22px',\n float: 'left',\n marginRight: '10px',\n marginBottom: '10px',\n borderRadius: '4px',\n };\n }\n handleClick({hex, $event}) {\n this.onClick.emit({hex, $event});\n }\n focusStyle(c) {\n return {\n boxShadow: `${ c } 0 0 4px`,\n };\n }\n\n}\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, forwardRef, Input, NgModule } from '@angular/core';\n\nimport {\n CheckboardModule,\n ColorWrap,\n EditableInputModule,\n getContrastingColor,\n isValidHex,\n SwatchModule,\n} from 'ngx-color';\nimport { BlockSwatchesComponent } from './block-swatches.component';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'color-block',\n template: `\n <div class=\"block-card block-picker {{ className }}\">\n <div class=\"block-triangle\" *ngIf=\"triangle !== 'hide'\"\n [style.border-color]=\"'transparent transparent ' + this.hex + ' transparent'\"\n ></div>\n\n <div class=\"block-head\" [style.background]=\"hex\">\n <color-checkboard *ngIf=\"hex === 'transparent'\"\n borderRadius=\"6px 6px 0 0\"\n ></color-checkboard>\n <div class=\"block-label\" [style.color]=\"getContrastingColor(hex)\">\n {{ hex }}\n </div>\n </div>\n\n <div class=\"block-body\">\n <color-block-swatches [colors]=\"colors\"\n (onClick)=\"handleBlockChange($event)\"\n (onSwatchHover)=\"onSwatchHover.emit($event)\"\n ></color-block-swatches>\n <color-editable-input [value]=\"hex\"\n (onChange)=\"handleValueChange($event)\"\n [style]=\"{input: input, wrap: wrap}\"\n ></color-editable-input>\n </div>\n </div>\n `,\n styles: [\n `\n .block-card {\n background: #fff;\n border-radius: 6px;\n box-shadow: 0 1px rgba(0, 0, 0, .1);\n position: relative;\n }\n .block-head {\n align-items: center;\n border-radius: 6px 6px 0 0;\n display: flex;\n height: 110px;\n justify-content: center;\n position: relative;\n }\n .block-body {\n padding: 10px;\n }\n .block-label {\n font-size: 18px;\n position: relative;\n }\n .block-triangle {\n border-style: solid;\n border-width: 0 10px 10px 10px;\n height: 0;\n left: 50%;\n margin-left: -10px;\n position: absolute;\n top: -10px;\n width: 0;\n }\n `,\n ],\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => BlockComponent),\n multi: true,\n },\n {\n provide: ColorWrap,\n useExisting: forwardRef(() => BlockComponent),\n },\n ]\n})\nexport class BlockComponent extends ColorWrap {\n /** Pixel value for picker width */\n @Input() width: string | number = 170;\n /** Color squares to display */\n @Input() colors = [\n '#D9E3F0',\n '#F47373',\n '#697689',\n '#37D67A',\n '#2CCCE4',\n '#555555',\n '#dce775',\n '#ff8a65',\n '#ba68c8',\n ];\n @Input() triangle: 'top' | 'hide' = 'top';\n input: {[key: string]: string} = {\n width: '100%',\n fontSize: '12px',\n color: '#666',\n border: '0px',\n outline: 'none',\n height: '22px',\n boxShadow: 'inset 0 0 0 1px #ddd',\n borderRadius: '4px',\n padding: '0 7px',\n boxSizing: 'border-box',\n };\n wrap: {[key: string]: string} = {\n position: 'relative',\n width: '100%',\n };\n disableAlpha = true;\n\n constructor() {\n super();\n }\n\n handleValueChange({ data, $event }) {\n this.handleBlockChange({ hex: data, $event });\n }\n getContrastingColor(hex) {\n return getContrastingColor(hex);\n }\n handleBlockChange({ hex, $event }) {\n if (isValidHex(hex)) {\n // this.hex = hex;\n this.handleChange(\n {\n hex,\n source: 'hex',\n },\n $event,\n );\n }\n }\n}\n\n@NgModule({\n declarations: [BlockComponent, BlockSwatchesComponent],\n exports: [BlockComponent, BlockSwatchesComponent],\n imports: [CommonModule, CheckboardModule, SwatchModule, EditableInputModule],\n})\nexport class ColorBlockModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MA4Ba,sBAAsB;IAMjC;QAJU,YAAO,GAAG,IAAI,YAAY,EAAO,CAAC;QAClC,kBAAa,GAAG,I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AAC;4BAC7C,KAAK,EAAE,IAAI;yBACZ;wBACD;4BACE,OAAO,EAAE,SAAS;4BAClB,WAAW,EAAE,UAAU,CAAC,oBAAoB,CAAC;yBAC9C;qBACF;iBACF;0EAGU,KAAK;sBAAb,KAAK;gBAEG,MAAM;sBAAd,KAAK;gBAWG,QAAQ;sBAAhB,KAAK;;MAgDK,gBAAgB;;6GAAhB,gBAAgB;8GAAhB,gBAAgB,iBA/DhB,cAAc,EA2DM,sBAAsB,aAE3C,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,mBAAmB,aA7DhE,cAAc,EA4DC,sBAAsB;8GAGrC,gBAAgB,YAFlB,CAAC,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,mBAAmB,CAAC;2FAEjE,gBAAgB;kBAL5B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,cAAc,EAAE,sBAAsB,CAAC;oBACtD,OAAO,EAAE,CAAC,cAAc,EAAE,sBAAsB,CAAC;oBACjD,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,mBAAmB,CAAC;iBAC7E;;;AC1JD;;;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ngx-color-block.mjs","sources":["../../../../src/lib/components/block/block-swatches.component.ts","../../../../src/lib/components/block/block.component.ts","../../../../src/lib/components/block/ngx-color-block.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\n\nimport { Shape } from 'ngx-color';\n\n@Component({\n selector: 'color-block-swatches',\n template: `\n <div class=\"block-swatches\">\n <color-swatch\n *ngFor=\"let c of colors\"\n [color]=\"c\"\n [style]=\"swatchStyle\"\n [focusStyle]=\"focusStyle(c)\"\n (onClick)=\"handleClick($event)\"\n (onHover)=\"onSwatchHover.emit($event)\"\n ></color-swatch>\n <div class=\"clear\"></div>\n </div>\n `,\n styles: [`\n .block-swatches {\n margin-right: -10px;\n }\n .clear {\n clear: both;\n }\n `],\n})\nexport class BlockSwatchesComponent implements OnInit {\n @Input() colors!: string[] | Shape[];\n @Output() onClick = new EventEmitter<any>();\n @Output() onSwatchHover = new EventEmitter<any>();\n swatchStyle?: {[key: string]: string};\n\n constructor() { }\n\n ngOnInit() {\n this.swatchStyle = {\n width: '22px',\n height: '22px',\n float: 'left',\n marginRight: '10px',\n marginBottom: '10px',\n borderRadius: '4px',\n };\n }\n handleClick({hex, $event}) {\n this.onClick.emit({hex, $event});\n }\n focusStyle(c) {\n return {\n boxShadow: `${ c } 0 0 4px`,\n };\n }\n\n}\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, forwardRef, Input, NgModule } from '@angular/core';\n\nimport {\n CheckboardModule,\n ColorWrap,\n EditableInputModule,\n getContrastingColor,\n isValidHex,\n SwatchModule,\n} from 'ngx-color';\nimport { BlockSwatchesComponent } from './block-swatches.component';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'color-block',\n template: `\n <div class=\"block-card block-picker {{ className }}\">\n <div class=\"block-triangle\" *ngIf=\"triangle !== 'hide'\"\n [style.border-color]=\"'transparent transparent ' + this.hex + ' transparent'\"\n ></div>\n\n <div class=\"block-head\" [style.background]=\"hex\">\n <color-checkboard *ngIf=\"hex === 'transparent'\"\n borderRadius=\"6px 6px 0 0\"\n ></color-checkboard>\n <div class=\"block-label\" [style.color]=\"getContrastingColor(hex)\">\n {{ hex }}\n </div>\n </div>\n\n <div class=\"block-body\">\n <color-block-swatches [colors]=\"colors\"\n (onClick)=\"handleBlockChange($event)\"\n (onSwatchHover)=\"onSwatchHover.emit($event)\"\n ></color-block-swatches>\n <color-editable-input [value]=\"hex\"\n (onChange)=\"handleValueChange($event)\"\n [style]=\"{input: input, wrap: wrap}\"\n ></color-editable-input>\n </div>\n </div>\n `,\n styles: [\n `\n .block-card {\n background: #fff;\n border-radius: 6px;\n box-shadow: 0 1px rgba(0, 0, 0, .1);\n position: relative;\n }\n .block-head {\n align-items: center;\n border-radius: 6px 6px 0 0;\n display: flex;\n height: 110px;\n justify-content: center;\n position: relative;\n }\n .block-body {\n padding: 10px;\n }\n .block-label {\n font-size: 18px;\n position: relative;\n }\n .block-triangle {\n border-style: solid;\n border-width: 0 10px 10px 10px;\n height: 0;\n left: 50%;\n margin-left: -10px;\n position: absolute;\n top: -10px;\n width: 0;\n }\n `,\n ],\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => BlockComponent),\n multi: true,\n },\n {\n provide: ColorWrap,\n useExisting: forwardRef(() => BlockComponent),\n },\n ]\n})\nexport class BlockComponent extends ColorWrap {\n /** Pixel value for picker width */\n @Input() width: string | number = 170;\n /** Color squares to display */\n @Input() colors = [\n '#D9E3F0',\n '#F47373',\n '#697689',\n '#37D67A',\n '#2CCCE4',\n '#555555',\n '#dce775',\n '#ff8a65',\n '#ba68c8',\n ];\n @Input() triangle: 'top' | 'hide' = 'top';\n input: {[key: string]: string} = {\n width: '100%',\n fontSize: '12px',\n color: '#666',\n border: '0px',\n outline: 'none',\n height: '22px',\n boxShadow: 'inset 0 0 0 1px #ddd',\n borderRadius: '4px',\n padding: '0 7px',\n boxSizing: 'border-box',\n };\n wrap: {[key: string]: string} = {\n position: 'relative',\n width: '100%',\n };\n disableAlpha = true;\n\n constructor() {\n super();\n }\n\n handleValueChange({ data, $event }) {\n this.handleBlockChange({ hex: data, $event });\n }\n getContrastingColor(hex) {\n return getContrastingColor(hex);\n }\n handleBlockChange({ hex, $event }) {\n if (isValidHex(hex)) {\n // this.hex = hex;\n this.handleChange(\n {\n hex,\n source: 'hex',\n },\n $event,\n );\n }\n }\n}\n\n@NgModule({\n declarations: [BlockComponent, BlockSwatchesComponent],\n exports: [BlockComponent, BlockSwatchesComponent],\n imports: [CommonModule, CheckboardModule, SwatchModule, EditableInputModule],\n})\nexport class ColorBlockModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\n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