ngx-color 7.2.0 → 7.3.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/alpha/alpha-picker.component.d.ts +8 -0
- package/alpha/esm2020/alpha-picker.component.mjs +116 -0
- package/alpha/{esm2015/ngx-color-alpha.js → esm2020/ngx-color-alpha.mjs} +2 -2
- package/alpha/esm2020/public_api.mjs +2 -0
- package/alpha/fesm2015/ngx-color-alpha.mjs +123 -0
- package/alpha/fesm2015/ngx-color-alpha.mjs.map +1 -0
- package/alpha/fesm2020/ngx-color-alpha.mjs +123 -0
- package/alpha/fesm2020/ngx-color-alpha.mjs.map +1 -0
- package/alpha/ngx-color-alpha.d.ts +2 -1
- package/alpha/package.json +19 -7
- package/alpha/public_api.d.ts +1 -0
- package/alpha.component.d.ts +9 -0
- package/block/block-swatches.component.d.ts +3 -0
- package/block/block.component.d.ts +9 -0
- package/block/esm2020/block-swatches.component.mjs +76 -0
- package/block/esm2020/block.component.mjs +199 -0
- package/block/esm2020/ngx-color-block.mjs +5 -0
- package/block/esm2020/public_api.mjs +3 -0
- package/block/fesm2015/ngx-color-block.mjs +277 -0
- package/block/fesm2015/ngx-color-block.mjs.map +1 -0
- package/block/fesm2020/ngx-color-block.mjs +277 -0
- package/block/fesm2020/ngx-color-block.mjs.map +1 -0
- package/block/ngx-color-block.d.ts +2 -2
- package/block/package.json +19 -7
- package/block/public_api.d.ts +2 -0
- package/checkboard.component.d.ts +7 -0
- package/chrome/chrome-fields.component.d.ts +3 -0
- package/chrome/chrome.component.d.ts +9 -0
- package/chrome/esm2020/chrome-fields.component.mjs +356 -0
- package/chrome/esm2020/chrome.component.mjs +249 -0
- package/chrome/esm2020/ngx-color-chrome.mjs +5 -0
- package/chrome/esm2020/public_api.mjs +3 -0
- package/chrome/fesm2015/ngx-color-chrome.mjs +606 -0
- package/chrome/fesm2015/ngx-color-chrome.mjs.map +1 -0
- package/chrome/fesm2020/ngx-color-chrome.mjs +606 -0
- package/chrome/fesm2020/ngx-color-chrome.mjs.map +1 -0
- package/chrome/ngx-color-chrome.d.ts +2 -2
- package/chrome/package.json +19 -7
- package/chrome/public_api.d.ts +2 -0
- package/circle/circle-swatch.component.d.ts +3 -0
- package/circle/circle.component.d.ts +9 -0
- package/circle/esm2020/circle-swatch.component.mjs +85 -0
- package/circle/esm2020/circle.component.mjs +148 -0
- package/circle/esm2020/ngx-color-circle.mjs +5 -0
- package/circle/esm2020/public_api.mjs +3 -0
- package/circle/fesm2015/ngx-color-circle.mjs +237 -0
- package/circle/fesm2015/ngx-color-circle.mjs.map +1 -0
- package/circle/fesm2020/ngx-color-circle.mjs +237 -0
- package/circle/fesm2020/ngx-color-circle.mjs.map +1 -0
- package/circle/ngx-color-circle.d.ts +2 -2
- package/circle/package.json +19 -7
- package/circle/public_api.d.ts +2 -0
- package/color-wrap.component.d.ts +7 -0
- package/compact/compact-color.component.d.ts +3 -0
- package/compact/compact-fields.component.d.ts +3 -0
- package/compact/compact.component.d.ts +10 -0
- package/compact/esm2020/compact-color.component.mjs +91 -0
- package/compact/esm2020/compact-fields.component.mjs +186 -0
- package/compact/esm2020/compact.component.mjs +177 -0
- package/compact/esm2020/ngx-color-compact.mjs +5 -0
- package/compact/esm2020/public_api.mjs +4 -0
- package/compact/fesm2015/ngx-color-compact.mjs +451 -0
- package/compact/fesm2015/ngx-color-compact.mjs.map +1 -0
- package/compact/fesm2020/ngx-color-compact.mjs +451 -0
- package/compact/fesm2020/ngx-color-compact.mjs.map +1 -0
- package/compact/ngx-color-compact.d.ts +2 -3
- package/compact/package.json +19 -7
- package/compact/public_api.d.ts +3 -0
- package/coordinates.directive.d.ts +6 -0
- package/editable-input.component.d.ts +7 -0
- package/esm2020/alpha.component.mjs +186 -0
- package/esm2020/checkboard.component.mjs +66 -0
- package/esm2020/color-wrap.component.mjs +163 -0
- package/esm2020/coordinates.directive.mjs +104 -0
- package/esm2020/editable-input.component.mjs +217 -0
- package/{esm2015/helpers/checkboard.js → esm2020/helpers/checkboard.mjs} +0 -0
- package/{esm2015/helpers/color.interfaces.js → esm2020/helpers/color.interfaces.mjs} +0 -0
- package/{esm2015/helpers/color.js → esm2020/helpers/color.mjs} +0 -0
- package/esm2020/hue.component.mjs +165 -0
- package/{esm2015/ngx-color.js → esm2020/ngx-color.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/esm2020/raised.component.mjs +89 -0
- package/esm2020/saturation.component.mjs +136 -0
- package/esm2020/shade.component.mjs +165 -0
- package/esm2020/swatch.component.mjs +125 -0
- package/fesm2015/ngx-color.mjs +1461 -0
- package/fesm2015/ngx-color.mjs.map +1 -0
- package/fesm2020/ngx-color.mjs +1466 -0
- package/fesm2020/ngx-color.mjs.map +1 -0
- package/github/esm2020/github-swatch.component.mjs +67 -0
- package/github/esm2020/github.component.mjs +179 -0
- package/github/esm2020/ngx-color-github.mjs +5 -0
- package/github/esm2020/public_api.mjs +3 -0
- package/github/fesm2015/ngx-color-github.mjs +250 -0
- package/github/fesm2015/ngx-color-github.mjs.map +1 -0
- package/github/fesm2020/ngx-color-github.mjs +250 -0
- package/github/fesm2020/ngx-color-github.mjs.map +1 -0
- package/github/github-swatch.component.d.ts +3 -0
- package/github/github.component.d.ts +9 -0
- package/github/ngx-color-github.d.ts +2 -2
- package/github/package.json +19 -7
- package/github/public_api.d.ts +2 -0
- package/helpers/checkboard.d.ts +2 -2
- package/hue/esm2020/hue-picker.component.mjs +113 -0
- package/hue/{esm2015/ngx-color-hue.js → esm2020/ngx-color-hue.mjs} +2 -2
- package/hue/esm2020/public_api.mjs +2 -0
- package/hue/fesm2015/ngx-color-hue.mjs +120 -0
- package/hue/fesm2015/ngx-color-hue.mjs.map +1 -0
- package/hue/fesm2020/ngx-color-hue.mjs +120 -0
- package/hue/fesm2020/ngx-color-hue.mjs.map +1 -0
- package/hue/hue-picker.component.d.ts +8 -0
- package/hue/ngx-color-hue.d.ts +2 -1
- package/hue/package.json +19 -7
- package/hue/public_api.d.ts +1 -0
- package/hue.component.d.ts +8 -0
- package/material/esm2020/material.component.mjs +211 -0
- package/material/{esm2015/ngx-color-material.js → esm2020/ngx-color-material.mjs} +2 -2
- package/material/esm2020/public_api.mjs +2 -0
- package/material/fesm2015/ngx-color-material.mjs +218 -0
- package/material/fesm2015/ngx-color-material.mjs.map +1 -0
- package/material/fesm2020/ngx-color-material.mjs +218 -0
- package/material/fesm2020/ngx-color-material.mjs.map +1 -0
- package/material/material.component.d.ts +8 -0
- package/material/ngx-color-material.d.ts +2 -1
- package/material/package.json +19 -7
- package/material/public_api.d.ts +1 -0
- package/ngx-color.d.ts +1 -0
- package/package.json +20 -8
- package/photoshop/esm2020/ngx-color-photoshop.mjs +5 -0
- package/photoshop/esm2020/photoshop-button.component.mjs +63 -0
- package/photoshop/esm2020/photoshop-fields.component.mjs +241 -0
- package/photoshop/esm2020/photoshop-previews.component.mjs +68 -0
- package/photoshop/esm2020/photoshop.component.mjs +258 -0
- package/photoshop/esm2020/public_api.mjs +5 -0
- package/photoshop/fesm2015/ngx-color-photoshop.mjs +626 -0
- package/photoshop/fesm2015/ngx-color-photoshop.mjs.map +1 -0
- package/photoshop/fesm2020/ngx-color-photoshop.mjs +626 -0
- package/photoshop/fesm2020/ngx-color-photoshop.mjs.map +1 -0
- package/photoshop/ngx-color-photoshop.d.ts +2 -4
- package/photoshop/package.json +19 -7
- package/photoshop/photoshop-button.component.d.ts +3 -0
- package/photoshop/photoshop-fields.component.d.ts +3 -0
- package/photoshop/photoshop-previews.component.d.ts +3 -0
- package/photoshop/photoshop.component.d.ts +11 -0
- package/photoshop/public_api.d.ts +4 -0
- package/raised.component.d.ts +7 -0
- package/saturation.component.d.ts +8 -0
- package/shade/{esm2015/ngx-color-shade.js → esm2020/ngx-color-shade.mjs} +2 -2
- package/shade/esm2020/public_api.mjs +2 -0
- package/shade/esm2020/shade-picker.component.mjs +105 -0
- package/shade/fesm2015/ngx-color-shade.mjs +112 -0
- package/shade/fesm2015/ngx-color-shade.mjs.map +1 -0
- package/shade/fesm2020/ngx-color-shade.mjs +112 -0
- package/shade/fesm2020/ngx-color-shade.mjs.map +1 -0
- package/shade/ngx-color-shade.d.ts +2 -1
- package/shade/package.json +19 -7
- package/shade/public_api.d.ts +1 -0
- package/shade/shade-picker.component.d.ts +8 -0
- package/shade.component.d.ts +8 -0
- package/sketch/esm2020/ngx-color-sketch.mjs +5 -0
- package/sketch/esm2020/public_api.mjs +4 -0
- package/sketch/esm2020/sketch-fields.component.mjs +243 -0
- package/sketch/esm2020/sketch-preset-colors.component.mjs +98 -0
- package/sketch/esm2020/sketch.component.mjs +283 -0
- package/sketch/fesm2015/ngx-color-sketch.mjs +620 -0
- package/sketch/fesm2015/ngx-color-sketch.mjs.map +1 -0
- package/sketch/fesm2020/ngx-color-sketch.mjs +620 -0
- package/sketch/fesm2020/ngx-color-sketch.mjs.map +1 -0
- package/sketch/ngx-color-sketch.d.ts +2 -3
- package/sketch/package.json +19 -7
- package/sketch/public_api.d.ts +3 -0
- package/sketch/sketch-fields.component.d.ts +3 -0
- package/sketch/sketch-preset-colors.component.d.ts +3 -0
- package/sketch/sketch.component.d.ts +10 -0
- package/slider/esm2020/ngx-color-slider.mjs +5 -0
- package/slider/esm2020/public_api.mjs +4 -0
- package/slider/esm2020/slider-swatch.component.mjs +80 -0
- package/slider/esm2020/slider-swatches.component.mjs +135 -0
- package/slider/esm2020/slider.component.mjs +116 -0
- package/slider/fesm2015/ngx-color-slider.mjs +331 -0
- package/slider/fesm2015/ngx-color-slider.mjs.map +1 -0
- package/slider/fesm2020/ngx-color-slider.mjs +331 -0
- package/slider/fesm2020/ngx-color-slider.mjs.map +1 -0
- package/slider/ngx-color-slider.d.ts +2 -3
- package/slider/package.json +19 -7
- package/slider/public_api.d.ts +3 -0
- package/slider/slider-swatch.component.d.ts +3 -0
- package/slider/slider-swatches.component.d.ts +3 -0
- package/slider/slider.component.d.ts +10 -0
- package/swatch.component.d.ts +8 -0
- package/swatches/esm2020/ngx-color-swatches.mjs +5 -0
- package/swatches/esm2020/public_api.mjs +4 -0
- package/swatches/esm2020/swatches-color.component.mjs +123 -0
- package/swatches/esm2020/swatches-group.component.mjs +64 -0
- package/swatches/esm2020/swatches.component.mjs +258 -0
- package/swatches/fesm2015/ngx-color-swatches.mjs +441 -0
- package/swatches/fesm2015/ngx-color-swatches.mjs.map +1 -0
- package/swatches/fesm2020/ngx-color-swatches.mjs +441 -0
- package/swatches/fesm2020/ngx-color-swatches.mjs.map +1 -0
- package/swatches/ngx-color-swatches.d.ts +2 -3
- package/swatches/package.json +19 -7
- package/swatches/public_api.d.ts +3 -0
- package/swatches/swatches-color.component.d.ts +3 -0
- package/swatches/swatches-group.component.d.ts +3 -0
- package/swatches/swatches.component.d.ts +10 -0
- package/twitter/{esm2015/ngx-color-twitter.js → esm2020/ngx-color-twitter.mjs} +2 -2
- package/twitter/esm2020/public_api.mjs +2 -0
- package/twitter/esm2020/twitter.component.mjs +255 -0
- package/twitter/fesm2015/ngx-color-twitter.mjs +262 -0
- package/twitter/fesm2015/ngx-color-twitter.mjs.map +1 -0
- package/twitter/fesm2020/ngx-color-twitter.mjs +262 -0
- package/twitter/fesm2020/ngx-color-twitter.mjs.map +1 -0
- package/twitter/ngx-color-twitter.d.ts +2 -1
- package/twitter/package.json +19 -7
- package/twitter/public_api.d.ts +1 -0
- package/twitter/twitter.component.d.ts +8 -0
- package/alpha/bundles/ngx-color-alpha.umd.js +0 -404
- package/alpha/bundles/ngx-color-alpha.umd.js.map +0 -1
- package/alpha/esm2015/alpha-picker.component.js +0 -84
- package/alpha/fesm2015/ngx-color-alpha.js +0 -91
- package/alpha/fesm2015/ngx-color-alpha.js.map +0 -1
- package/alpha/ngx-color-alpha.metadata.json +0 -1
- package/block/bundles/ngx-color-block.umd.js +0 -472
- package/block/bundles/ngx-color-block.umd.js.map +0 -1
- package/block/esm2015/block-swatches.component.js +0 -58
- package/block/esm2015/block.component.js +0 -151
- package/block/esm2015/ngx-color-block.js +0 -6
- package/block/fesm2015/ngx-color-block.js +0 -214
- package/block/fesm2015/ngx-color-block.js.map +0 -1
- package/block/ngx-color-block.metadata.json +0 -1
- package/bundles/ngx-color.umd.js +0 -1014
- package/bundles/ngx-color.umd.js.map +0 -1
- package/chrome/bundles/ngx-color-chrome.umd.js +0 -543
- package/chrome/bundles/ngx-color-chrome.umd.js.map +0 -1
- package/chrome/esm2015/chrome-fields.component.js +0 -255
- package/chrome/esm2015/chrome.component.js +0 -173
- package/chrome/esm2015/ngx-color-chrome.js +0 -6
- package/chrome/fesm2015/ngx-color-chrome.js +0 -432
- package/chrome/fesm2015/ngx-color-chrome.js.map +0 -1
- package/chrome/ngx-color-chrome.metadata.json +0 -1
- package/circle/bundles/ngx-color-circle.umd.js +0 -469
- package/circle/bundles/ngx-color-circle.umd.js.map +0 -1
- package/circle/esm2015/circle-swatch.component.js +0 -63
- package/circle/esm2015/circle.component.js +0 -109
- package/circle/esm2015/ngx-color-circle.js +0 -6
- package/circle/fesm2015/ngx-color-circle.js +0 -177
- package/circle/fesm2015/ngx-color-circle.js.map +0 -1
- package/circle/ngx-color-circle.metadata.json +0 -1
- package/compact/bundles/ngx-color-compact.umd.js +0 -579
- package/compact/bundles/ngx-color-compact.umd.js.map +0 -1
- package/compact/esm2015/compact-color.component.js +0 -70
- package/compact/esm2015/compact-fields.component.js +0 -142
- package/compact/esm2015/compact.component.js +0 -135
- package/compact/esm2015/ngx-color-compact.js +0 -7
- package/compact/fesm2015/ngx-color-compact.js +0 -348
- package/compact/fesm2015/ngx-color-compact.js.map +0 -1
- package/compact/ngx-color-compact.metadata.json +0 -1
- package/esm2015/alpha.component.js +0 -156
- package/esm2015/checkboard.component.js +0 -52
- package/esm2015/color-wrap.component.js +0 -145
- package/esm2015/coordinates.directive.js +0 -85
- package/esm2015/editable-input.component.js +0 -183
- package/esm2015/hue.component.js +0 -140
- package/esm2015/raised.component.js +0 -73
- package/esm2015/saturation.component.js +0 -111
- package/esm2015/shade.component.js +0 -127
- package/esm2015/swatch.component.js +0 -85
- package/fesm2015/ngx-color.js +0 -1228
- package/fesm2015/ngx-color.js.map +0 -1
- package/github/bundles/ngx-color-github.umd.js +0 -447
- package/github/bundles/ngx-color-github.umd.js.map +0 -1
- package/github/esm2015/github-swatch.component.js +0 -48
- package/github/esm2015/github.component.js +0 -146
- package/github/esm2015/ngx-color-github.js +0 -6
- package/github/fesm2015/ngx-color-github.js +0 -199
- package/github/fesm2015/ngx-color-github.js.map +0 -1
- package/github/ngx-color-github.metadata.json +0 -1
- package/hue/bundles/ngx-color-hue.umd.js +0 -407
- package/hue/bundles/ngx-color-hue.umd.js.map +0 -1
- package/hue/esm2015/hue-picker.component.js +0 -82
- package/hue/fesm2015/ngx-color-hue.js +0 -89
- package/hue/fesm2015/ngx-color-hue.js.map +0 -1
- package/hue/ngx-color-hue.metadata.json +0 -1
- package/material/bundles/ngx-color-material.umd.js +0 -455
- package/material/bundles/ngx-color-material.umd.js.map +0 -1
- package/material/esm2015/material.component.js +0 -161
- package/material/fesm2015/ngx-color-material.js +0 -168
- package/material/fesm2015/ngx-color-material.js.map +0 -1
- package/material/ngx-color-material.metadata.json +0 -1
- package/ngx-color.metadata.json +0 -1
- package/photoshop/bundles/ngx-color-photoshop.umd.js +0 -571
- package/photoshop/bundles/ngx-color-photoshop.umd.js.map +0 -1
- package/photoshop/esm2015/ngx-color-photoshop.js +0 -8
- package/photoshop/esm2015/photoshop-button.component.js +0 -50
- package/photoshop/esm2015/photoshop-fields.component.js +0 -180
- package/photoshop/esm2015/photoshop-previews.component.js +0 -53
- package/photoshop/esm2015/photoshop.component.js +0 -181
- package/photoshop/fesm2015/ngx-color-photoshop.js +0 -464
- package/photoshop/fesm2015/ngx-color-photoshop.js.map +0 -1
- package/photoshop/ngx-color-photoshop.metadata.json +0 -1
- package/shade/bundles/ngx-color-shade.umd.js +0 -399
- package/shade/bundles/ngx-color-shade.umd.js.map +0 -1
- package/shade/esm2015/shade-picker.component.js +0 -75
- package/shade/fesm2015/ngx-color-shade.js +0 -82
- package/shade/fesm2015/ngx-color-shade.js.map +0 -1
- package/shade/ngx-color-shade.metadata.json +0 -1
- package/sketch/bundles/ngx-color-sketch.umd.js +0 -585
- package/sketch/bundles/ngx-color-sketch.umd.js.map +0 -1
- package/sketch/esm2015/ngx-color-sketch.js +0 -7
- package/sketch/esm2015/sketch-fields.component.js +0 -181
- package/sketch/esm2015/sketch-preset-colors.component.js +0 -76
- package/sketch/esm2015/sketch.component.js +0 -203
- package/sketch/fesm2015/ngx-color-sketch.js +0 -462
- package/sketch/fesm2015/ngx-color-sketch.js.map +0 -1
- package/sketch/ngx-color-sketch.metadata.json +0 -1
- package/slider/bundles/ngx-color-slider.umd.js +0 -470
- package/slider/bundles/ngx-color-slider.umd.js.map +0 -1
- package/slider/esm2015/ngx-color-slider.js +0 -7
- package/slider/esm2015/slider-swatch.component.js +0 -65
- package/slider/esm2015/slider-swatches.component.js +0 -84
- package/slider/esm2015/slider.component.js +0 -81
- package/slider/fesm2015/ngx-color-slider.js +0 -233
- package/slider/fesm2015/ngx-color-slider.js.map +0 -1
- package/slider/ngx-color-slider.metadata.json +0 -1
- package/swatches/bundles/ngx-color-swatches.umd.js +0 -612
- package/swatches/bundles/ngx-color-swatches.umd.js.map +0 -1
- package/swatches/esm2015/ngx-color-swatches.js +0 -7
- package/swatches/esm2015/swatches-color.component.js +0 -90
- package/swatches/esm2015/swatches-group.component.js +0 -42
- package/swatches/esm2015/swatches.component.js +0 -217
- package/swatches/fesm2015/ngx-color-swatches.js +0 -351
- package/swatches/fesm2015/ngx-color-swatches.js.map +0 -1
- package/swatches/ngx-color-swatches.metadata.json +0 -1
- package/twitter/bundles/ngx-color-twitter.umd.js +0 -433
- package/twitter/bundles/ngx-color-twitter.umd.js.map +0 -1
- package/twitter/esm2015/twitter.component.js +0 -207
- package/twitter/fesm2015/ngx-color-twitter.js +0 -214
- package/twitter/fesm2015/ngx-color-twitter.js.map +0 -1
- package/twitter/ngx-color-twitter.metadata.json +0 -1
@@ -0,0 +1,237 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, Input, Output, forwardRef, NgModule } from '@angular/core';
|
3
|
+
import * as i1 from 'ngx-color';
|
4
|
+
import { ColorWrap, isValidHex, SwatchModule } from 'ngx-color';
|
5
|
+
import * as i1$1 from '@angular/common';
|
6
|
+
import { CommonModule } from '@angular/common';
|
7
|
+
import { red, pink, purple, deepPurple, indigo, blue, lightBlue, cyan, teal, green, lightGreen, lime, yellow, amber, orange, deepOrange, brown, blueGrey } from 'material-colors';
|
8
|
+
import { TinyColor } from '@ctrl/tinycolor';
|
9
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
10
|
+
|
11
|
+
class CircleSwatchComponent {
|
12
|
+
constructor() {
|
13
|
+
this.circleSize = 28;
|
14
|
+
this.circleSpacing = 14;
|
15
|
+
this.focus = false;
|
16
|
+
this.onClick = new EventEmitter();
|
17
|
+
this.onSwatchHover = new EventEmitter();
|
18
|
+
this.focusStyle = {};
|
19
|
+
this.swatchStyle = {
|
20
|
+
borderRadius: '50%',
|
21
|
+
background: 'transparent',
|
22
|
+
transition: '100ms box-shadow ease 0s',
|
23
|
+
};
|
24
|
+
}
|
25
|
+
ngOnChanges() {
|
26
|
+
this.swatchStyle.boxShadow = `inset 0 0 0 ${this.circleSize / 2}px ${this.color}`;
|
27
|
+
this.focusStyle.boxShadow = `inset 0 0 0 ${this.circleSize / 2}px ${this.color}, 0 0 5px ${this.color}`;
|
28
|
+
if (this.focus) {
|
29
|
+
this.focusStyle.boxShadow = `inset 0 0 0 3px ${this.color}, 0 0 5px ${this.color}`;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
handleClick({ hex, $event }) {
|
33
|
+
this.onClick.emit({ hex, $event });
|
34
|
+
}
|
35
|
+
}
|
36
|
+
CircleSwatchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CircleSwatchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
37
|
+
CircleSwatchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: CircleSwatchComponent, selector: "color-circle-swatch", inputs: { color: "color", circleSize: "circleSize", circleSpacing: "circleSpacing", focus: "focus" }, outputs: { onClick: "onClick", onSwatchHover: "onSwatchHover" }, usesOnChanges: true, ngImport: i0, template: `
|
38
|
+
<div class="circle-swatch"
|
39
|
+
[style.width.px]="circleSize" [style.height.px]="circleSize"
|
40
|
+
[style.margin-right.px]="circleSpacing" [style.margin-bottom.px]="circleSpacing"
|
41
|
+
>
|
42
|
+
<color-swatch
|
43
|
+
[color]="color" [style]="swatchStyle" [focus]="focus" [focusStyle]="focusStyle"
|
44
|
+
(onClick)="handleClick($event)" (onHover)="onSwatchHover.emit($event)">
|
45
|
+
</color-swatch>
|
46
|
+
<div class="clear"></div>
|
47
|
+
</div>
|
48
|
+
`, isInline: true, styles: [".circle-swatch{transform:scale(1);transition:transform .1s ease}.circle-swatch:hover{transform:scale(1.2)}\n"], components: [{ type: i1.SwatchComponent, selector: "color-swatch", inputs: ["color", "style", "focusStyle", "focus"], outputs: ["onClick", "onHover"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CircleSwatchComponent, decorators: [{
|
50
|
+
type: Component,
|
51
|
+
args: [{
|
52
|
+
selector: 'color-circle-swatch',
|
53
|
+
template: `
|
54
|
+
<div class="circle-swatch"
|
55
|
+
[style.width.px]="circleSize" [style.height.px]="circleSize"
|
56
|
+
[style.margin-right.px]="circleSpacing" [style.margin-bottom.px]="circleSpacing"
|
57
|
+
>
|
58
|
+
<color-swatch
|
59
|
+
[color]="color" [style]="swatchStyle" [focus]="focus" [focusStyle]="focusStyle"
|
60
|
+
(onClick)="handleClick($event)" (onHover)="onSwatchHover.emit($event)">
|
61
|
+
</color-swatch>
|
62
|
+
<div class="clear"></div>
|
63
|
+
</div>
|
64
|
+
`,
|
65
|
+
styles: [
|
66
|
+
`
|
67
|
+
.circle-swatch {
|
68
|
+
transform: scale(1);
|
69
|
+
transition: transform 100ms ease;
|
70
|
+
}
|
71
|
+
.circle-swatch:hover {
|
72
|
+
transform: scale(1.2);
|
73
|
+
}
|
74
|
+
`,
|
75
|
+
],
|
76
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
77
|
+
preserveWhitespaces: false,
|
78
|
+
}]
|
79
|
+
}], propDecorators: { color: [{
|
80
|
+
type: Input
|
81
|
+
}], circleSize: [{
|
82
|
+
type: Input
|
83
|
+
}], circleSpacing: [{
|
84
|
+
type: Input
|
85
|
+
}], focus: [{
|
86
|
+
type: Input
|
87
|
+
}], onClick: [{
|
88
|
+
type: Output
|
89
|
+
}], onSwatchHover: [{
|
90
|
+
type: Output
|
91
|
+
}] } });
|
92
|
+
|
93
|
+
class CircleComponent extends ColorWrap {
|
94
|
+
constructor() {
|
95
|
+
super();
|
96
|
+
/** Pixel value for picker width */
|
97
|
+
this.width = 252;
|
98
|
+
/** Color squares to display */
|
99
|
+
this.colors = [
|
100
|
+
red['500'],
|
101
|
+
pink['500'],
|
102
|
+
purple['500'],
|
103
|
+
deepPurple['500'],
|
104
|
+
indigo['500'],
|
105
|
+
blue['500'],
|
106
|
+
lightBlue['500'],
|
107
|
+
cyan['500'],
|
108
|
+
teal['500'],
|
109
|
+
green['500'],
|
110
|
+
lightGreen['500'],
|
111
|
+
lime['500'],
|
112
|
+
yellow['500'],
|
113
|
+
amber['500'],
|
114
|
+
orange['500'],
|
115
|
+
deepOrange['500'],
|
116
|
+
brown['500'],
|
117
|
+
blueGrey['500'],
|
118
|
+
];
|
119
|
+
/** Value for circle size */
|
120
|
+
this.circleSize = 28;
|
121
|
+
/** Value for spacing between circles */
|
122
|
+
this.circleSpacing = 14;
|
123
|
+
}
|
124
|
+
isActive(color) {
|
125
|
+
return new TinyColor(this.hex).equals(color);
|
126
|
+
}
|
127
|
+
handleBlockChange({ hex, $event }) {
|
128
|
+
if (isValidHex(hex)) {
|
129
|
+
this.handleChange({ hex, source: 'hex' }, $event);
|
130
|
+
}
|
131
|
+
}
|
132
|
+
handleValueChange({ data, $event }) {
|
133
|
+
this.handleChange(data, $event);
|
134
|
+
}
|
135
|
+
}
|
136
|
+
CircleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CircleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
137
|
+
CircleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: CircleComponent, selector: "color-circle", inputs: { width: "width", colors: "colors", circleSize: "circleSize", circleSpacing: "circleSpacing" }, providers: [
|
138
|
+
{
|
139
|
+
provide: NG_VALUE_ACCESSOR,
|
140
|
+
useExisting: forwardRef(() => CircleComponent),
|
141
|
+
multi: true,
|
142
|
+
},
|
143
|
+
{
|
144
|
+
provide: ColorWrap,
|
145
|
+
useExisting: forwardRef(() => CircleComponent),
|
146
|
+
},
|
147
|
+
], usesInheritance: true, ngImport: i0, template: `
|
148
|
+
<div
|
149
|
+
class="circle-picker {{ className }}"
|
150
|
+
[style.width.px]="width"
|
151
|
+
[style.margin-right.px]="-circleSpacing"
|
152
|
+
[style.margin-bottom.px]="-circleSpacing"
|
153
|
+
>
|
154
|
+
<color-circle-swatch
|
155
|
+
*ngFor="let color of colors"
|
156
|
+
[circleSize]="circleSize"
|
157
|
+
[circleSpacing]="circleSpacing"
|
158
|
+
[color]="color"
|
159
|
+
[focus]="isActive(color)"
|
160
|
+
(onClick)="handleBlockChange($event)"
|
161
|
+
(onSwatchHover)="onSwatchHover.emit($event)"
|
162
|
+
></color-circle-swatch>
|
163
|
+
</div>
|
164
|
+
`, isInline: true, styles: [".circle-picker{display:flex;flex-wrap:wrap}\n"], components: [{ type: i0.forwardRef(function () { return CircleSwatchComponent; }), selector: "color-circle-swatch", inputs: ["color", "circleSize", "circleSpacing", "focus"], outputs: ["onClick", "onSwatchHover"] }], directives: [{ type: i0.forwardRef(function () { return i1$1.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CircleComponent, decorators: [{
|
166
|
+
type: Component,
|
167
|
+
args: [{
|
168
|
+
selector: 'color-circle',
|
169
|
+
template: `
|
170
|
+
<div
|
171
|
+
class="circle-picker {{ className }}"
|
172
|
+
[style.width.px]="width"
|
173
|
+
[style.margin-right.px]="-circleSpacing"
|
174
|
+
[style.margin-bottom.px]="-circleSpacing"
|
175
|
+
>
|
176
|
+
<color-circle-swatch
|
177
|
+
*ngFor="let color of colors"
|
178
|
+
[circleSize]="circleSize"
|
179
|
+
[circleSpacing]="circleSpacing"
|
180
|
+
[color]="color"
|
181
|
+
[focus]="isActive(color)"
|
182
|
+
(onClick)="handleBlockChange($event)"
|
183
|
+
(onSwatchHover)="onSwatchHover.emit($event)"
|
184
|
+
></color-circle-swatch>
|
185
|
+
</div>
|
186
|
+
`,
|
187
|
+
styles: [
|
188
|
+
`
|
189
|
+
.circle-picker {
|
190
|
+
display: flex;
|
191
|
+
flex-wrap: wrap;
|
192
|
+
}
|
193
|
+
`,
|
194
|
+
],
|
195
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
196
|
+
preserveWhitespaces: false,
|
197
|
+
providers: [
|
198
|
+
{
|
199
|
+
provide: NG_VALUE_ACCESSOR,
|
200
|
+
useExisting: forwardRef(() => CircleComponent),
|
201
|
+
multi: true,
|
202
|
+
},
|
203
|
+
{
|
204
|
+
provide: ColorWrap,
|
205
|
+
useExisting: forwardRef(() => CircleComponent),
|
206
|
+
},
|
207
|
+
]
|
208
|
+
}]
|
209
|
+
}], ctorParameters: function () { return []; }, propDecorators: { width: [{
|
210
|
+
type: Input
|
211
|
+
}], colors: [{
|
212
|
+
type: Input
|
213
|
+
}], circleSize: [{
|
214
|
+
type: Input
|
215
|
+
}], circleSpacing: [{
|
216
|
+
type: Input
|
217
|
+
}] } });
|
218
|
+
class ColorCircleModule {
|
219
|
+
}
|
220
|
+
ColorCircleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorCircleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
221
|
+
ColorCircleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorCircleModule, declarations: [CircleComponent, CircleSwatchComponent], imports: [CommonModule, SwatchModule], exports: [CircleComponent, CircleSwatchComponent] });
|
222
|
+
ColorCircleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorCircleModule, imports: [[CommonModule, SwatchModule]] });
|
223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorCircleModule, decorators: [{
|
224
|
+
type: NgModule,
|
225
|
+
args: [{
|
226
|
+
declarations: [CircleComponent, CircleSwatchComponent],
|
227
|
+
exports: [CircleComponent, CircleSwatchComponent],
|
228
|
+
imports: [CommonModule, SwatchModule],
|
229
|
+
}]
|
230
|
+
}] });
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Generated bundle index. Do not edit.
|
234
|
+
*/
|
235
|
+
|
236
|
+
export { CircleComponent, CircleSwatchComponent, ColorCircleModule };
|
237
|
+
//# sourceMappingURL=ngx-color-circle.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ngx-color-circle.mjs","sources":["../../../../src/lib/components/circle/circle-swatch.component.ts","../../../../src/lib/components/circle/circle.component.ts","../../../../src/lib/components/circle/ngx-color-circle.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n} from '@angular/core';\n\n@Component({\n selector: 'color-circle-swatch',\n template: `\n <div class=\"circle-swatch\"\n [style.width.px]=\"circleSize\" [style.height.px]=\"circleSize\"\n [style.margin-right.px]=\"circleSpacing\" [style.margin-bottom.px]=\"circleSpacing\"\n >\n <color-swatch\n [color]=\"color\" [style]=\"swatchStyle\" [focus]=\"focus\" [focusStyle]=\"focusStyle\"\n (onClick)=\"handleClick($event)\" (onHover)=\"onSwatchHover.emit($event)\">\n </color-swatch>\n <div class=\"clear\"></div>\n </div>\n `,\n styles: [\n `\n .circle-swatch {\n transform: scale(1);\n transition: transform 100ms ease;\n }\n .circle-swatch:hover {\n transform: scale(1.2);\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false,\n})\nexport class CircleSwatchComponent implements OnChanges {\n @Input() color!: string;\n @Input() circleSize = 28;\n @Input() circleSpacing = 14;\n @Input() focus = false;\n @Output() onClick = new EventEmitter<any>();\n @Output() onSwatchHover = new EventEmitter<any>();\n focusStyle: Record<string, string> = {};\n swatchStyle: Record<string, string> = {\n borderRadius: '50%',\n background: 'transparent',\n transition: '100ms box-shadow ease 0s',\n };\n\n ngOnChanges() {\n this.swatchStyle.boxShadow = `inset 0 0 0 ${this.circleSize / 2}px ${this.color}`;\n this.focusStyle.boxShadow = `inset 0 0 0 ${ this.circleSize / 2 }px ${ this.color }, 0 0 5px ${ this.color }`;\n if (this.focus) {\n this.focusStyle.boxShadow = `inset 0 0 0 3px ${ this.color }, 0 0 5px ${ this.color }`;\n }\n }\n handleClick({ hex, $event }) {\n this.onClick.emit({ hex, $event });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, forwardRef, Input, NgModule } from '@angular/core';\nimport {\n amber,\n blue,\n blueGrey,\n brown,\n cyan,\n deepOrange,\n deepPurple,\n green,\n indigo,\n lightBlue,\n lightGreen,\n lime,\n orange,\n pink,\n purple,\n red,\n teal,\n yellow,\n} from 'material-colors';\nimport { TinyColor } from '@ctrl/tinycolor';\n\nimport { ColorWrap, isValidHex, SwatchModule } from 'ngx-color';\nimport { CircleSwatchComponent } from './circle-swatch.component';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'color-circle',\n template: `\n <div\n class=\"circle-picker {{ className }}\"\n [style.width.px]=\"width\"\n [style.margin-right.px]=\"-circleSpacing\"\n [style.margin-bottom.px]=\"-circleSpacing\"\n >\n <color-circle-swatch\n *ngFor=\"let color of colors\"\n [circleSize]=\"circleSize\"\n [circleSpacing]=\"circleSpacing\"\n [color]=\"color\"\n [focus]=\"isActive(color)\"\n (onClick)=\"handleBlockChange($event)\"\n (onSwatchHover)=\"onSwatchHover.emit($event)\"\n ></color-circle-swatch>\n </div>\n `,\n styles: [\n `\n .circle-picker {\n display: flex;\n flex-wrap: wrap;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CircleComponent),\n multi: true,\n },\n {\n provide: ColorWrap,\n useExisting: forwardRef(() => CircleComponent),\n },\n ]\n})\nexport class CircleComponent extends ColorWrap {\n /** Pixel value for picker width */\n @Input() width: string | number = 252;\n /** Color squares to display */\n @Input()\n colors: string[] = [\n red['500'],\n pink['500'],\n purple['500'],\n deepPurple['500'],\n indigo['500'],\n blue['500'],\n lightBlue['500'],\n cyan['500'],\n teal['500'],\n green['500'],\n lightGreen['500'],\n lime['500'],\n yellow['500'],\n amber['500'],\n orange['500'],\n deepOrange['500'],\n brown['500'],\n blueGrey['500'],\n ];\n /** Value for circle size */\n @Input() circleSize = 28;\n /** Value for spacing between circles */\n @Input() circleSpacing = 14;\n\n constructor() {\n super();\n }\n isActive(color: string) {\n return new TinyColor(this.hex).equals(color);\n }\n handleBlockChange({ hex, $event }: { hex: string, $event: Event }) {\n if (isValidHex(hex)) {\n this.handleChange({ hex, source: 'hex' }, $event);\n }\n }\n handleValueChange({ data, $event }) {\n this.handleChange(data, $event);\n }\n}\n\n@NgModule({\n declarations: [CircleComponent, CircleSwatchComponent],\n exports: [CircleComponent, CircleSwatchComponent],\n imports: [CommonModule, SwatchModule],\n})\nexport class ColorCircleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MAqCa,qBAAqB;IA5BlC;QA8BW,eAAU,GAAG,EAAE,CAAC;QAChB,kBAAa,GAAG,EAAE,CAAC;QACnB,UAAK,GAAG,KAAK,CAAC;QACb,YAAO,GAAG,IAAI,YAAY,EAAO,CAAC;QAClC,kBAAa,GAAG,IAAI,YAAY,EAAO,CAAC;QAClD,eAAU,GAA2B,EAAE,CAAC;QACxC,gBAAW,GAA2B;YACpC,YAAY,EAAE,KAAK;YACnB,UAAU,EAAE,aAAa;YACzB,UAAU,EAAE,0BAA0B;SACvC,CAAC;KAYH;IAVC,WAAW;QACT,IAAI,CAAC,WAAW,CAAC,SAAS,GAAG,eAAe,IAAI,CAAC,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QAClF,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,eAAgB,IAAI,CAAC,UAAU,GAAG,CAAE,MAAO,IAAI,CAAC,KAAM,aAAc,IAAI,CAAC,KAAM,EAAE,CAAC;QAC9G,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,mBAAoB,IAAI,CAAC,KAAM,aAAc,IAAI,CAAC,KAAM,EAAE,CAAC;SACxF;KACF;IACD,WAAW,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE;QACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;KACpC;;kHAvBU,qBAAqB;sGAArB,qBAAqB,uPA1BtB;;;;;;;;;;;GAW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EA+CM,qBAAqB,aAE3C,YAAY,EAAE,YAAY,aAjDzB,eAAe,EAgDC,qBAAqB;+GAGrC,iBAAiB,YAFnB,CAAC,YAAY,EAAE,YAAY,CAAC;2FAE1B,iBAAiB;kBAL7B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,eAAe,EAAE,qBAAqB,CAAC;oBACtD,OAAO,EAAE,CAAC,eAAe,EAAE,qBAAqB,CAAC;oBACjD,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;iBACtC;;;ACxHD;;;;;;"}
|
package/circle/package.json
CHANGED
@@ -6,15 +6,27 @@
|
|
6
6
|
"url": "git+https://github.com/scttcper/ngx-color.git"
|
7
7
|
},
|
8
8
|
"license": "MIT",
|
9
|
-
"
|
10
|
-
"
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"fesm2015": "fesm2015/ngx-color-circle.
|
9
|
+
"module": "fesm2015/ngx-color-circle.mjs",
|
10
|
+
"es2020": "fesm2020/ngx-color-circle.mjs",
|
11
|
+
"esm2020": "esm2020/ngx-color-circle.mjs",
|
12
|
+
"fesm2020": "fesm2020/ngx-color-circle.mjs",
|
13
|
+
"fesm2015": "fesm2015/ngx-color-circle.mjs",
|
14
14
|
"typings": "ngx-color-circle.d.ts",
|
15
|
-
"
|
15
|
+
"exports": {
|
16
|
+
"./package.json": {
|
17
|
+
"default": "./package.json"
|
18
|
+
},
|
19
|
+
".": {
|
20
|
+
"types": "./ngx-color-circle.d.ts",
|
21
|
+
"esm2020": "./esm2020/ngx-color-circle.mjs",
|
22
|
+
"es2020": "./fesm2020/ngx-color-circle.mjs",
|
23
|
+
"es2015": "./fesm2015/ngx-color-circle.mjs",
|
24
|
+
"node": "./fesm2015/ngx-color-circle.mjs",
|
25
|
+
"default": "./fesm2020/ngx-color-circle.mjs"
|
26
|
+
}
|
27
|
+
},
|
16
28
|
"sideEffects": false,
|
17
29
|
"dependencies": {
|
18
|
-
"tslib": "^2.
|
30
|
+
"tslib": "^2.3.0"
|
19
31
|
}
|
20
32
|
}
|
@@ -2,6 +2,8 @@ import { EventEmitter, OnChanges, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { Subscription } from 'rxjs';
|
3
3
|
import { Color, HSLA, HSVA, RGBA } from './helpers/color.interfaces';
|
4
4
|
import { ControlValueAccessor } from '@angular/forms';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
import * as i1 from "@angular/common";
|
5
7
|
export interface ColorEvent {
|
6
8
|
$event: Event;
|
7
9
|
color: Color;
|
@@ -46,6 +48,11 @@ export declare class ColorWrap implements OnInit, OnChanges, OnDestroy, ControlV
|
|
46
48
|
registerOnTouched(fn: () => void): void;
|
47
49
|
setDisabledState(isDisabled: boolean): void;
|
48
50
|
writeValue(hex: string): void;
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ColorWrap, never>;
|
52
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ColorWrap, "color-wrap", never, { "className": "className"; "mode": "mode"; "color": "color"; }, { "colorChange": "colorChange"; "onChange": "onChange"; "onChangeComplete": "onChangeComplete"; "onSwatchHover": "onSwatchHover"; }, never, never>;
|
49
53
|
}
|
50
54
|
export declare class ColorWrapModule {
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ColorWrapModule, never>;
|
56
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ColorWrapModule, [typeof ColorWrap], [typeof i1.CommonModule], [typeof ColorWrap]>;
|
57
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<ColorWrapModule>;
|
51
58
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { EventEmitter, OnChanges } from '@angular/core';
|
2
2
|
import { getContrastingColor } from 'ngx-color';
|
3
|
+
import * as i0 from "@angular/core";
|
3
4
|
export declare class CompactColorComponent implements OnChanges {
|
4
5
|
color: string;
|
5
6
|
active: boolean;
|
@@ -13,4 +14,6 @@ export declare class CompactColorComponent implements OnChanges {
|
|
13
14
|
hex: any;
|
14
15
|
$event: any;
|
15
16
|
}): void;
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CompactColorComponent, never>;
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CompactColorComponent, "color-compact-color", never, { "color": "color"; "active": "active"; }, { "onClick": "onClick"; "onSwatchHover": "onSwatchHover"; }, never, never>;
|
16
19
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
2
2
|
import { RGBA } from 'ngx-color';
|
3
|
+
import * as i0 from "@angular/core";
|
3
4
|
export declare class CompactFieldsComponent {
|
4
5
|
hex: string;
|
5
6
|
rgb: RGBA;
|
@@ -26,4 +27,6 @@ export declare class CompactFieldsComponent {
|
|
26
27
|
data: any;
|
27
28
|
$event: any;
|
28
29
|
}): void;
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CompactFieldsComponent, never>;
|
31
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CompactFieldsComponent, "color-compact-fields", never, { "hex": "hex"; "rgb": "rgb"; }, { "onChange": "onChange"; }, never, never>;
|
29
32
|
}
|
@@ -1,4 +1,9 @@
|
|
1
1
|
import { ColorWrap, zDepth } from 'ngx-color';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
import * as i1 from "./compact-color.component";
|
4
|
+
import * as i2 from "./compact-fields.component";
|
5
|
+
import * as i3 from "@angular/common";
|
6
|
+
import * as i4 from "ngx-color";
|
2
7
|
export declare class CompactComponent extends ColorWrap {
|
3
8
|
/** Color squares to display */
|
4
9
|
colors: string[];
|
@@ -15,6 +20,11 @@ export declare class CompactComponent extends ColorWrap {
|
|
15
20
|
data: any;
|
16
21
|
$event: any;
|
17
22
|
}): void;
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CompactComponent, never>;
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CompactComponent, "color-compact", never, { "colors": "colors"; "zDepth": "zDepth"; "radius": "radius"; "background": "background"; }, {}, never, never>;
|
18
25
|
}
|
19
26
|
export declare class ColorCompactModule {
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ColorCompactModule, never>;
|
28
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ColorCompactModule, [typeof CompactComponent, typeof i1.CompactColorComponent, typeof i2.CompactFieldsComponent], [typeof i3.CommonModule, typeof i4.EditableInputModule, typeof i4.SwatchModule, typeof i4.RaisedModule], [typeof CompactComponent, typeof i1.CompactColorComponent, typeof i2.CompactFieldsComponent]>;
|
29
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<ColorCompactModule>;
|
20
30
|
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, } from '@angular/core';
|
2
|
+
import { getContrastingColor } from 'ngx-color';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "ngx-color";
|
5
|
+
export class CompactColorComponent {
|
6
|
+
constructor() {
|
7
|
+
this.onClick = new EventEmitter();
|
8
|
+
this.onSwatchHover = new EventEmitter();
|
9
|
+
this.swatchStyle = {
|
10
|
+
width: '15px',
|
11
|
+
height: '15px',
|
12
|
+
float: 'left',
|
13
|
+
marginRight: '5px',
|
14
|
+
marginBottom: '5px',
|
15
|
+
position: 'relative',
|
16
|
+
cursor: 'pointer',
|
17
|
+
};
|
18
|
+
this.swatchFocus = {};
|
19
|
+
this.getContrastingColor = getContrastingColor;
|
20
|
+
}
|
21
|
+
ngOnChanges() {
|
22
|
+
this.swatchStyle.background = this.color;
|
23
|
+
this.swatchFocus.boxShadow = `0 0 4px ${this.color}`;
|
24
|
+
if (this.color.toLowerCase() === '#ffffff') {
|
25
|
+
this.swatchStyle.boxShadow = 'inset 0 0 0 1px #ddd';
|
26
|
+
}
|
27
|
+
}
|
28
|
+
handleClick({ hex, $event }) {
|
29
|
+
this.onClick.emit({ hex, $event });
|
30
|
+
}
|
31
|
+
}
|
32
|
+
CompactColorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CompactColorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
33
|
+
CompactColorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: CompactColorComponent, selector: "color-compact-color", inputs: { color: "color", active: "active" }, outputs: { onClick: "onClick", onSwatchHover: "onSwatchHover" }, usesOnChanges: true, ngImport: i0, template: `
|
34
|
+
<div class="compact-color">
|
35
|
+
<color-swatch class="swatch"
|
36
|
+
[color]="color" [style]="swatchStyle"
|
37
|
+
[focusStyle]="swatchFocus"
|
38
|
+
(onClick)="handleClick($event)" (onHover)="onSwatchHover.emit($event)"
|
39
|
+
>
|
40
|
+
<div class="compact-dot"
|
41
|
+
[class.active]="active" [style.background]="getContrastingColor(color)"
|
42
|
+
></div>
|
43
|
+
</color-swatch>
|
44
|
+
</div>
|
45
|
+
`, isInline: true, styles: [".compact-dot{position:absolute;top:5px;right:5px;bottom:5px;left:5px;border-radius:50%;opacity:0}.compact-dot.active{opacity:1}\n"], components: [{ type: i1.SwatchComponent, selector: "color-swatch", inputs: ["color", "style", "focusStyle", "focus"], outputs: ["onClick", "onHover"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CompactColorComponent, decorators: [{
|
47
|
+
type: Component,
|
48
|
+
args: [{
|
49
|
+
selector: 'color-compact-color',
|
50
|
+
template: `
|
51
|
+
<div class="compact-color">
|
52
|
+
<color-swatch class="swatch"
|
53
|
+
[color]="color" [style]="swatchStyle"
|
54
|
+
[focusStyle]="swatchFocus"
|
55
|
+
(onClick)="handleClick($event)" (onHover)="onSwatchHover.emit($event)"
|
56
|
+
>
|
57
|
+
<div class="compact-dot"
|
58
|
+
[class.active]="active" [style.background]="getContrastingColor(color)"
|
59
|
+
></div>
|
60
|
+
</color-swatch>
|
61
|
+
</div>
|
62
|
+
`,
|
63
|
+
styles: [
|
64
|
+
`
|
65
|
+
.compact-dot {
|
66
|
+
position: absolute;
|
67
|
+
top: 5px;
|
68
|
+
right: 5px;
|
69
|
+
bottom: 5px;
|
70
|
+
left: 5px;
|
71
|
+
border-radius: 50%;
|
72
|
+
opacity: 0;
|
73
|
+
}
|
74
|
+
.compact-dot.active {
|
75
|
+
opacity: 1;
|
76
|
+
}
|
77
|
+
`,
|
78
|
+
],
|
79
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
80
|
+
preserveWhitespaces: false,
|
81
|
+
}]
|
82
|
+
}], propDecorators: { color: [{
|
83
|
+
type: Input
|
84
|
+
}], active: [{
|
85
|
+
type: Input
|
86
|
+
}], onClick: [{
|
87
|
+
type: Output
|
88
|
+
}], onSwatchHover: [{
|
89
|
+
type: Output
|
90
|
+
}] } });
|
91
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGFjdC1jb2xvci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbGliL2NvbXBvbmVudHMvY29tcGFjdC9jb21wYWN0LWNvbG9yLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsdUJBQXVCLEVBQ3ZCLFNBQVMsRUFDVCxZQUFZLEVBQ1osS0FBSyxFQUVMLE1BQU0sR0FDUCxNQUFNLGVBQWUsQ0FBQztBQUV2QixPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxXQUFXLENBQUM7OztBQW9DaEQsTUFBTSxPQUFPLHFCQUFxQjtJQWxDbEM7UUFxQ1ksWUFBTyxHQUFHLElBQUksWUFBWSxFQUFPLENBQUM7UUFDbEMsa0JBQWEsR0FBRyxJQUFJLFlBQVksRUFBTyxDQUFDO1FBQ2xELGdCQUFXLEdBQTJCO1lBQ3BDLEtBQUssRUFBRSxNQ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