ngx-color 7.2.0 → 7.3.3
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/ngx-color-alpha.d.ts +2 -1
- package/alpha/package.json +6 -10
- package/alpha/public_api.d.ts +1 -0
- package/alpha.component.d.ts +9 -0
- package/block/block-swatches.component.d.ts +13 -8
- package/block/block.component.d.ts +9 -0
- package/block/ngx-color-block.d.ts +2 -2
- package/block/package.json +6 -10
- 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/ngx-color-chrome.d.ts +2 -2
- package/chrome/package.json +6 -10
- 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/ngx-color-circle.d.ts +2 -2
- package/circle/package.json +9 -10
- 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/ngx-color-compact.d.ts +2 -3
- package/compact/package.json +6 -10
- 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/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 +186 -0
- package/esm2020/block/block-swatches.component.mjs +74 -0
- package/esm2020/block/block.component.mjs +199 -0
- package/esm2020/block/ngx-color-block.mjs +5 -0
- package/esm2020/block/public_api.mjs +3 -0
- package/esm2020/checkboard.component.mjs +66 -0
- package/esm2020/chrome/chrome-fields.component.mjs +356 -0
- package/{chrome/esm2015/chrome.component.js → esm2020/chrome/chrome.component.mjs} +116 -40
- 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 +163 -0
- package/esm2020/compact/compact-color.component.mjs +91 -0
- package/esm2020/compact/compact-fields.component.mjs +186 -0
- package/esm2020/compact/compact.component.mjs +177 -0
- package/esm2020/compact/ngx-color-compact.mjs +5 -0
- package/esm2020/compact/public_api.mjs +4 -0
- package/esm2020/coordinates.directive.mjs +104 -0
- package/esm2020/editable-input.component.mjs +217 -0
- package/esm2020/github/github-swatch.component.mjs +67 -0
- package/esm2020/github/github.component.mjs +179 -0
- package/esm2020/github/ngx-color-github.mjs +5 -0
- package/esm2020/github/public_api.mjs +3 -0
- package/esm2020/helpers/checkboard.mjs +33 -0
- package/esm2020/helpers/color.interfaces.mjs +2 -0
- package/esm2020/helpers/color.mjs +60 -0
- 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 +165 -0
- 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 +5 -0
- package/esm2020/photoshop/ngx-color-photoshop.mjs +5 -0
- package/esm2020/photoshop/photoshop-button.component.mjs +63 -0
- package/esm2020/photoshop/photoshop-fields.component.mjs +241 -0
- package/esm2020/photoshop/photoshop-previews.component.mjs +68 -0
- package/esm2020/photoshop/photoshop.component.mjs +258 -0
- package/esm2020/photoshop/public_api.mjs +5 -0
- package/esm2020/public_api.mjs +14 -0
- package/esm2020/raised.component.mjs +89 -0
- package/esm2020/saturation.component.mjs +136 -0
- 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 +165 -0
- 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/esm2020/sketch/sketch-preset-colors.component.mjs +98 -0
- package/esm2020/sketch/sketch.component.mjs +283 -0
- 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/esm2020/slider/slider-swatches.component.mjs +135 -0
- package/esm2020/slider/slider.component.mjs +116 -0
- package/esm2020/swatch.component.mjs +125 -0
- 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/esm2020/swatches/swatches-group.component.mjs +64 -0
- 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/esm2015/twitter.component.js → esm2020/twitter/twitter.component.mjs} +83 -35
- package/fesm2015/ngx-color-alpha.mjs +123 -0
- package/fesm2015/ngx-color-alpha.mjs.map +1 -0
- package/fesm2015/ngx-color-block.mjs +275 -0
- package/fesm2015/ngx-color-block.mjs.map +1 -0
- package/fesm2015/ngx-color-chrome.mjs +606 -0
- package/fesm2015/ngx-color-chrome.mjs.map +1 -0
- package/fesm2015/ngx-color-circle.mjs +237 -0
- package/fesm2015/ngx-color-circle.mjs.map +1 -0
- package/fesm2015/ngx-color-compact.mjs +451 -0
- package/fesm2015/ngx-color-compact.mjs.map +1 -0
- package/fesm2015/ngx-color-github.mjs +250 -0
- package/fesm2015/ngx-color-github.mjs.map +1 -0
- package/fesm2015/ngx-color-hue.mjs +120 -0
- package/fesm2015/ngx-color-hue.mjs.map +1 -0
- package/fesm2015/ngx-color-material.mjs +218 -0
- package/fesm2015/ngx-color-material.mjs.map +1 -0
- package/fesm2015/ngx-color-photoshop.mjs +626 -0
- package/fesm2015/ngx-color-photoshop.mjs.map +1 -0
- package/fesm2015/ngx-color-shade.mjs +112 -0
- package/fesm2015/ngx-color-shade.mjs.map +1 -0
- package/fesm2015/ngx-color-sketch.mjs +620 -0
- package/fesm2015/ngx-color-sketch.mjs.map +1 -0
- package/fesm2015/ngx-color-slider.mjs +331 -0
- package/fesm2015/ngx-color-slider.mjs.map +1 -0
- package/fesm2015/ngx-color-swatches.mjs +441 -0
- package/fesm2015/ngx-color-swatches.mjs.map +1 -0
- package/fesm2015/ngx-color-twitter.mjs +262 -0
- package/fesm2015/ngx-color-twitter.mjs.map +1 -0
- package/fesm2015/ngx-color.mjs +1461 -0
- package/fesm2015/ngx-color.mjs.map +1 -0
- package/fesm2020/ngx-color-alpha.mjs +123 -0
- package/fesm2020/ngx-color-alpha.mjs.map +1 -0
- package/fesm2020/ngx-color-block.mjs +275 -0
- package/fesm2020/ngx-color-block.mjs.map +1 -0
- package/fesm2020/ngx-color-chrome.mjs +606 -0
- package/fesm2020/ngx-color-chrome.mjs.map +1 -0
- package/fesm2020/ngx-color-circle.mjs +237 -0
- package/fesm2020/ngx-color-circle.mjs.map +1 -0
- package/fesm2020/ngx-color-compact.mjs +451 -0
- package/fesm2020/ngx-color-compact.mjs.map +1 -0
- package/fesm2020/ngx-color-github.mjs +250 -0
- package/fesm2020/ngx-color-github.mjs.map +1 -0
- package/fesm2020/ngx-color-hue.mjs +120 -0
- package/fesm2020/ngx-color-hue.mjs.map +1 -0
- package/fesm2020/ngx-color-material.mjs +218 -0
- package/fesm2020/ngx-color-material.mjs.map +1 -0
- package/fesm2020/ngx-color-photoshop.mjs +626 -0
- package/fesm2020/ngx-color-photoshop.mjs.map +1 -0
- package/fesm2020/ngx-color-shade.mjs +112 -0
- package/fesm2020/ngx-color-shade.mjs.map +1 -0
- package/fesm2020/ngx-color-sketch.mjs +620 -0
- package/fesm2020/ngx-color-sketch.mjs.map +1 -0
- package/fesm2020/ngx-color-slider.mjs +331 -0
- package/fesm2020/ngx-color-slider.mjs.map +1 -0
- package/fesm2020/ngx-color-swatches.mjs +441 -0
- package/fesm2020/ngx-color-swatches.mjs.map +1 -0
- package/fesm2020/ngx-color-twitter.mjs +262 -0
- package/fesm2020/ngx-color-twitter.mjs.map +1 -0
- package/fesm2020/ngx-color.mjs +1466 -0
- package/fesm2020/ngx-color.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 +6 -10
- package/github/public_api.d.ts +2 -0
- package/hue/hue-picker.component.d.ts +8 -0
- package/hue/ngx-color-hue.d.ts +2 -1
- package/hue/package.json +6 -10
- package/hue/public_api.d.ts +1 -0
- package/hue.component.d.ts +8 -0
- package/material/material.component.d.ts +8 -0
- package/material/ngx-color-material.d.ts +2 -1
- package/material/package.json +6 -10
- package/material/public_api.d.ts +1 -0
- package/ngx-color.d.ts +1 -0
- package/package.json +133 -9
- package/photoshop/ngx-color-photoshop.d.ts +2 -4
- package/photoshop/package.json +6 -10
- 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/ngx-color-shade.d.ts +2 -1
- package/shade/package.json +6 -10
- 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/ngx-color-sketch.d.ts +2 -3
- package/sketch/package.json +6 -10
- 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/ngx-color-slider.d.ts +2 -3
- package/slider/package.json +6 -10
- 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/ngx-color-swatches.d.ts +2 -3
- package/swatches/package.json +9 -10
- 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/ngx-color-twitter.d.ts +2 -1
- package/twitter/package.json +6 -10
- 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/esm2015/ngx-color-alpha.js +0 -5
- 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/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/helpers/checkboard.js +0 -33
- package/esm2015/helpers/color.interfaces.js +0 -2
- package/esm2015/helpers/color.js +0 -60
- package/esm2015/hue.component.js +0 -140
- package/esm2015/ngx-color.js +0 -5
- package/esm2015/public_api.js +0 -14
- 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/esm2015/ngx-color-hue.js +0 -5
- 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/esm2015/ngx-color-material.js +0 -5
- 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/ngx-color-shade.js +0 -5
- 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/ngx-color-twitter.js +0 -5
- 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,262 @@
|
|
1
|
+
import * as i2 from '@angular/common';
|
2
|
+
import { CommonModule } from '@angular/common';
|
3
|
+
import * as i0 from '@angular/core';
|
4
|
+
import { forwardRef, Component, ChangeDetectionStrategy, Input, NgModule } from '@angular/core';
|
5
|
+
import * as i1 from 'ngx-color';
|
6
|
+
import { ColorWrap, isValidHex, SwatchModule, EditableInputModule } from 'ngx-color';
|
7
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
8
|
+
|
9
|
+
class TwitterComponent extends ColorWrap {
|
10
|
+
constructor() {
|
11
|
+
super();
|
12
|
+
/** Pixel value for picker width */
|
13
|
+
this.width = 276;
|
14
|
+
/** Color squares to display */
|
15
|
+
this.colors = [
|
16
|
+
'#FF6900',
|
17
|
+
'#FCB900',
|
18
|
+
'#7BDCB5',
|
19
|
+
'#00D084',
|
20
|
+
'#8ED1FC',
|
21
|
+
'#0693E3',
|
22
|
+
'#ABB8C3',
|
23
|
+
'#EB144C',
|
24
|
+
'#F78DA7',
|
25
|
+
'#9900EF',
|
26
|
+
];
|
27
|
+
this.triangle = 'top-left';
|
28
|
+
this.swatchStyle = {
|
29
|
+
width: '30px',
|
30
|
+
height: '30px',
|
31
|
+
borderRadius: '4px',
|
32
|
+
fontSize: '0',
|
33
|
+
};
|
34
|
+
this.input = {
|
35
|
+
borderRadius: '4px',
|
36
|
+
borderBottomLeftRadius: '0',
|
37
|
+
borderTopLeftRadius: '0',
|
38
|
+
border: '1px solid #e6ecf0',
|
39
|
+
boxSizing: 'border-box',
|
40
|
+
display: 'inline',
|
41
|
+
fontSize: '14px',
|
42
|
+
height: '30px',
|
43
|
+
padding: '0',
|
44
|
+
paddingLeft: '6px',
|
45
|
+
width: '100%',
|
46
|
+
color: '#657786',
|
47
|
+
};
|
48
|
+
this.disableAlpha = true;
|
49
|
+
}
|
50
|
+
focus(color) {
|
51
|
+
return { boxShadow: `0 0 4px ${color}` };
|
52
|
+
}
|
53
|
+
handleBlockChange({ hex, $event }) {
|
54
|
+
if (isValidHex(hex)) {
|
55
|
+
// this.hex = hex;
|
56
|
+
this.handleChange({ hex, source: 'hex' }, $event);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
handleValueChange({ data, $event }) {
|
60
|
+
this.handleBlockChange({ hex: data, $event });
|
61
|
+
}
|
62
|
+
}
|
63
|
+
TwitterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TwitterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
64
|
+
TwitterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: TwitterComponent, selector: "color-twitter", inputs: { width: "width", colors: "colors", triangle: "triangle" }, providers: [
|
65
|
+
{
|
66
|
+
provide: NG_VALUE_ACCESSOR,
|
67
|
+
useExisting: forwardRef(() => TwitterComponent),
|
68
|
+
multi: true,
|
69
|
+
},
|
70
|
+
{
|
71
|
+
provide: ColorWrap,
|
72
|
+
useExisting: forwardRef(() => TwitterComponent),
|
73
|
+
},
|
74
|
+
], usesInheritance: true, ngImport: i0, template: `
|
75
|
+
<div class="twitter-picker {{ triangle }}-triangle {{ className }}" [style.width.px]="width">
|
76
|
+
<div class="triangleShadow"></div>
|
77
|
+
<div class="triangle"></div>
|
78
|
+
<div class="twitter-body">
|
79
|
+
<div class="twitter-swatch" *ngFor="let color of colors">
|
80
|
+
<color-swatch
|
81
|
+
[color]="color"
|
82
|
+
[style]="swatchStyle"
|
83
|
+
[focusStyle]="focus(color)"
|
84
|
+
(onClick)="handleBlockChange($event)"
|
85
|
+
(onHover)="onSwatchHover.emit($event)"
|
86
|
+
></color-swatch>
|
87
|
+
</div>
|
88
|
+
<div class="twitter-hash">
|
89
|
+
<div>#</div>
|
90
|
+
</div>
|
91
|
+
<div class="twitter-input">
|
92
|
+
<color-editable-input
|
93
|
+
[style]="{ input: input }"
|
94
|
+
[value]="hex.replace('#', '')"
|
95
|
+
(onChange)="handleValueChange($event)"
|
96
|
+
></color-editable-input>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
`, isInline: true, styles: [".twitter-picker{background:rgb(255,255,255);border:0px solid rgba(0,0,0,.25);box-shadow:#00000040 0 1px 4px;border-radius:4px;position:relative;box-sizing:border-box}.triangleShadow{width:0px;height:0px;border-style:solid;border-width:0px 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);position:absolute}.triangle{width:0px;height:0px;border-style:solid;border-width:0px 9px 10px;border-color:transparent transparent rgb(255,255,255);position:absolute}.hide-triangle>.triangle{display:none}.hide-triangle>.triangleShadow{display:none}.top-left-triangle>.triangle{top:-10px;left:12px}.top-left-triangle>.triangleShadow{top:-11px;left:12px}.top-right-triangle>.triangle{top:-10px;right:12px}.top-right-triangle>.triangleShadow{top:-11px;right:12px}.twitter-body{padding:15px 9px 9px 15px}.twitter-swatch{width:30px;height:30px;display:inline-block;margin:0 6px 0 0}.twitter-hash{background:rgb(240,240,240);height:30px;width:30px;border-radius:4px 0 0 4px;color:#98a1a4;margin-left:-3px;display:inline-block}.twitter-hash>div{position:absolute;align-items:center;justify-content:center;height:30px;width:30px;display:flex}.twitter-input{display:inline-block;margin-top:-6px;font-size:10px;height:27px;padding:0;position:relative;top:6px;vertical-align:top;width:108px;margin-left:-4px}\n"], components: [{ type: i1.SwatchComponent, selector: "color-swatch", inputs: ["color", "style", "focusStyle", "focus"], outputs: ["onClick", "onHover"] }, { type: i1.EditableInputComponent, selector: "color-editable-input", inputs: ["style", "label", "value", "arrowOffset", "dragLabel", "dragMax", "placeholder"], outputs: ["onChange"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TwitterComponent, decorators: [{
|
102
|
+
type: Component,
|
103
|
+
args: [{
|
104
|
+
selector: 'color-twitter',
|
105
|
+
template: `
|
106
|
+
<div class="twitter-picker {{ triangle }}-triangle {{ className }}" [style.width.px]="width">
|
107
|
+
<div class="triangleShadow"></div>
|
108
|
+
<div class="triangle"></div>
|
109
|
+
<div class="twitter-body">
|
110
|
+
<div class="twitter-swatch" *ngFor="let color of colors">
|
111
|
+
<color-swatch
|
112
|
+
[color]="color"
|
113
|
+
[style]="swatchStyle"
|
114
|
+
[focusStyle]="focus(color)"
|
115
|
+
(onClick)="handleBlockChange($event)"
|
116
|
+
(onHover)="onSwatchHover.emit($event)"
|
117
|
+
></color-swatch>
|
118
|
+
</div>
|
119
|
+
<div class="twitter-hash">
|
120
|
+
<div>#</div>
|
121
|
+
</div>
|
122
|
+
<div class="twitter-input">
|
123
|
+
<color-editable-input
|
124
|
+
[style]="{ input: input }"
|
125
|
+
[value]="hex.replace('#', '')"
|
126
|
+
(onChange)="handleValueChange($event)"
|
127
|
+
></color-editable-input>
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
`,
|
132
|
+
styles: [
|
133
|
+
`
|
134
|
+
.twitter-picker {
|
135
|
+
background: rgb(255, 255, 255);
|
136
|
+
border: 0px solid rgba(0, 0, 0, 0.25);
|
137
|
+
box-shadow: rgba(0, 0, 0, 0.25) 0px 1px 4px;
|
138
|
+
border-radius: 4px;
|
139
|
+
position: relative;
|
140
|
+
box-sizing: border-box;
|
141
|
+
}
|
142
|
+
.triangleShadow {
|
143
|
+
width: 0px;
|
144
|
+
height: 0px;
|
145
|
+
border-style: solid;
|
146
|
+
border-width: 0px 9px 10px;
|
147
|
+
border-color: transparent transparent rgba(0, 0, 0, 0.1);
|
148
|
+
position: absolute;
|
149
|
+
}
|
150
|
+
.triangle {
|
151
|
+
width: 0px;
|
152
|
+
height: 0px;
|
153
|
+
border-style: solid;
|
154
|
+
border-width: 0px 9px 10px;
|
155
|
+
border-color: transparent transparent rgb(255, 255, 255);
|
156
|
+
position: absolute;
|
157
|
+
}
|
158
|
+
.hide-triangle > .triangle {
|
159
|
+
display: none;
|
160
|
+
}
|
161
|
+
.hide-triangle > .triangleShadow {
|
162
|
+
display: none;
|
163
|
+
}
|
164
|
+
.top-left-triangle > .triangle {
|
165
|
+
top: -10px;
|
166
|
+
left: 12px;
|
167
|
+
}
|
168
|
+
.top-left-triangle > .triangleShadow {
|
169
|
+
top: -11px;
|
170
|
+
left: 12px;
|
171
|
+
}
|
172
|
+
.top-right-triangle > .triangle {
|
173
|
+
top: -10px;
|
174
|
+
right: 12px;
|
175
|
+
}
|
176
|
+
.top-right-triangle > .triangleShadow {
|
177
|
+
top: -11px;
|
178
|
+
right: 12px;
|
179
|
+
}
|
180
|
+
.twitter-body {
|
181
|
+
padding: 15px 9px 9px 15px;
|
182
|
+
}
|
183
|
+
.twitter-swatch {
|
184
|
+
width: 30px;
|
185
|
+
height: 30px;
|
186
|
+
display: inline-block;
|
187
|
+
margin: 0 6px 0 0;
|
188
|
+
}
|
189
|
+
.twitter-hash {
|
190
|
+
background: rgb(240, 240, 240);
|
191
|
+
height: 30px;
|
192
|
+
width: 30px;
|
193
|
+
border-radius: 4px 0px 0px 4px;
|
194
|
+
color: rgb(152, 161, 164);
|
195
|
+
margin-left: -3px;
|
196
|
+
display: inline-block;
|
197
|
+
|
198
|
+
}
|
199
|
+
.twitter-hash > div {
|
200
|
+
position: absolute;
|
201
|
+
align-items: center;
|
202
|
+
justify-content: center;
|
203
|
+
height: 30px;
|
204
|
+
width: 30px;
|
205
|
+
display: flex;
|
206
|
+
}
|
207
|
+
.twitter-input {
|
208
|
+
position: relative;
|
209
|
+
display: inline-block;
|
210
|
+
margin-top: -6px;
|
211
|
+
font-size: 10px;
|
212
|
+
height: 27px;
|
213
|
+
padding: 0;
|
214
|
+
position: relative;
|
215
|
+
top: 6px;
|
216
|
+
vertical-align: top;
|
217
|
+
width: 108px;
|
218
|
+
margin-left: -4px;
|
219
|
+
}
|
220
|
+
`,
|
221
|
+
],
|
222
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
223
|
+
preserveWhitespaces: false,
|
224
|
+
providers: [
|
225
|
+
{
|
226
|
+
provide: NG_VALUE_ACCESSOR,
|
227
|
+
useExisting: forwardRef(() => TwitterComponent),
|
228
|
+
multi: true,
|
229
|
+
},
|
230
|
+
{
|
231
|
+
provide: ColorWrap,
|
232
|
+
useExisting: forwardRef(() => TwitterComponent),
|
233
|
+
},
|
234
|
+
]
|
235
|
+
}]
|
236
|
+
}], ctorParameters: function () { return []; }, propDecorators: { width: [{
|
237
|
+
type: Input
|
238
|
+
}], colors: [{
|
239
|
+
type: Input
|
240
|
+
}], triangle: [{
|
241
|
+
type: Input
|
242
|
+
}] } });
|
243
|
+
class ColorTwitterModule {
|
244
|
+
}
|
245
|
+
ColorTwitterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorTwitterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
246
|
+
ColorTwitterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorTwitterModule, declarations: [TwitterComponent], imports: [CommonModule, SwatchModule, EditableInputModule], exports: [TwitterComponent] });
|
247
|
+
ColorTwitterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorTwitterModule, imports: [[CommonModule, SwatchModule, EditableInputModule]] });
|
248
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ColorTwitterModule, decorators: [{
|
249
|
+
type: NgModule,
|
250
|
+
args: [{
|
251
|
+
declarations: [TwitterComponent],
|
252
|
+
exports: [TwitterComponent],
|
253
|
+
imports: [CommonModule, SwatchModule, EditableInputModule],
|
254
|
+
}]
|
255
|
+
}] });
|
256
|
+
|
257
|
+
/**
|
258
|
+
* Generated bundle index. Do not edit.
|
259
|
+
*/
|
260
|
+
|
261
|
+
export { ColorTwitterModule, TwitterComponent };
|
262
|
+
//# sourceMappingURL=ngx-color-twitter.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ngx-color-twitter.mjs","sources":["../../src/lib/twitter/twitter.component.ts","../../src/lib/twitter/ngx-color-twitter.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, forwardRef, Input, NgModule } from '@angular/core';\n\nimport { ColorWrap, EditableInputModule, isValidHex, SwatchModule } from 'ngx-color';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'color-twitter',\n template: `\n <div class=\"twitter-picker {{ triangle }}-triangle {{ className }}\" [style.width.px]=\"width\">\n <div class=\"triangleShadow\"></div>\n <div class=\"triangle\"></div>\n <div class=\"twitter-body\">\n <div class=\"twitter-swatch\" *ngFor=\"let color of colors\">\n <color-swatch\n [color]=\"color\"\n [style]=\"swatchStyle\"\n [focusStyle]=\"focus(color)\"\n (onClick)=\"handleBlockChange($event)\"\n (onHover)=\"onSwatchHover.emit($event)\"\n ></color-swatch>\n </div>\n <div class=\"twitter-hash\">\n <div>#</div>\n </div>\n <div class=\"twitter-input\">\n <color-editable-input\n [style]=\"{ input: input }\"\n [value]=\"hex.replace('#', '')\"\n (onChange)=\"handleValueChange($event)\"\n ></color-editable-input>\n </div>\n </div>\n </div>\n `,\n styles: [\n `\n .twitter-picker {\n background: rgb(255, 255, 255);\n border: 0px solid rgba(0, 0, 0, 0.25);\n box-shadow: rgba(0, 0, 0, 0.25) 0px 1px 4px;\n border-radius: 4px;\n position: relative;\n box-sizing: border-box;\n }\n .triangleShadow {\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 0px 9px 10px;\n border-color: transparent transparent rgba(0, 0, 0, 0.1);\n position: absolute;\n }\n .triangle {\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 0px 9px 10px;\n border-color: transparent transparent rgb(255, 255, 255);\n position: absolute;\n }\n .hide-triangle > .triangle {\n display: none;\n }\n .hide-triangle > .triangleShadow {\n display: none;\n }\n .top-left-triangle > .triangle {\n top: -10px;\n left: 12px;\n }\n .top-left-triangle > .triangleShadow {\n top: -11px;\n left: 12px;\n }\n .top-right-triangle > .triangle {\n top: -10px;\n right: 12px;\n }\n .top-right-triangle > .triangleShadow {\n top: -11px;\n right: 12px;\n }\n .twitter-body {\n padding: 15px 9px 9px 15px;\n }\n .twitter-swatch {\n width: 30px;\n height: 30px;\n display: inline-block;\n margin: 0 6px 0 0;\n }\n .twitter-hash {\n background: rgb(240, 240, 240);\n height: 30px;\n width: 30px;\n border-radius: 4px 0px 0px 4px;\n color: rgb(152, 161, 164);\n margin-left: -3px;\n display: inline-block;\n\n }\n .twitter-hash > div {\n position: absolute;\n align-items: center;\n justify-content: center;\n height: 30px;\n width: 30px;\n display: flex;\n }\n .twitter-input {\n position: relative;\n display: inline-block;\n margin-top: -6px;\n font-size: 10px;\n height: 27px;\n padding: 0;\n position: relative;\n top: 6px;\n vertical-align: top;\n width: 108px;\n margin-left: -4px;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TwitterComponent),\n multi: true,\n },\n {\n provide: ColorWrap,\n useExisting: forwardRef(() => TwitterComponent),\n },\n ]\n})\nexport class TwitterComponent extends ColorWrap {\n /** Pixel value for picker width */\n @Input() width: string | number = 276;\n /** Color squares to display */\n @Input() colors = [\n '#FF6900',\n '#FCB900',\n '#7BDCB5',\n '#00D084',\n '#8ED1FC',\n '#0693E3',\n '#ABB8C3',\n '#EB144C',\n '#F78DA7',\n '#9900EF',\n ];\n @Input() triangle: 'hide' | 'top-left' | 'top-right' | 'bottom-right' = 'top-left';\n\n swatchStyle: {[key: string]: string} = {\n width: '30px',\n height: '30px',\n borderRadius: '4px',\n fontSize: '0',\n };\n input: {[key: string]: string} = {\n borderRadius: '4px',\n borderBottomLeftRadius: '0',\n borderTopLeftRadius: '0',\n border: '1px solid #e6ecf0',\n boxSizing: 'border-box',\n display: 'inline',\n fontSize: '14px',\n height: '30px',\n padding: '0',\n paddingLeft: '6px',\n width: '100%',\n color: '#657786',\n };\n disableAlpha = true;\n\n constructor() {\n super();\n }\n\n focus(color: string) {\n return { boxShadow: `0 0 4px ${color}` };\n }\n\n handleBlockChange({ hex, $event }: any) {\n if (isValidHex(hex)) {\n // this.hex = hex;\n this.handleChange({ hex, source: 'hex' }, $event);\n }\n }\n\n handleValueChange({ data, $event }: any) {\n this.handleBlockChange({ hex: data, $event });\n }\n}\n\n@NgModule({\n declarations: [TwitterComponent],\n exports: [TwitterComponent],\n imports: [CommonModule, SwatchModule, EditableInputModule],\n})\nexport class ColorTwitterModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MA2Ia,gBAAiB,SAAQ,SAAS;IAwC7C;QACE,KAAK,EAAE,CAAC;;QAvCD,UAAK,GAAoB,GAAG,CAAC;;QAE7B,WAAM,GAAG;YAChB,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;SACV,CAAC;QACO,aAAQ,GAAuD,UAAU,CAAC;QAEnF,gBAAW,GAA4B;YACrC,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;YACd,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,GAAG;SACd,CAAC;QACF,UAAK,GAA4B;YAC/B,YAAY,EAAE,KAAK;YACnB,sBAAsB,EAAE,GAAG;YAC3B,mBAAmB,EAAE,GAAG;YACxB,MAAM,EAAE,mBAAmB;YAC3B,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,QAAQ;YACjB,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,GAAG;YACZ,WAAW,EAAE,KAAK;YAClB,KAAK,EAAE,MAAM;YACb,KAAK,EAAE,SAAS;SACjB,CAAC;QACF,iBAAY,GAAG,IAAI,CAAC;KAInB;IAED,KAAK,CAAC,KAAa;QACjB,OAAO,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,EAAE,CAAC;KAC1C;IAED,iBAAiB,CAAC,EAAE,GAAG,EAAE,MAAM,EAAO;QACpC,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE;;YAEnB,IAAI,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;SACnD;KACF;IAED,iBAAiB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAO;QACrC,IAAI,CAAC,iBAAiB,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;KAC/C;;6GAzDU,gBAAgB;iGAAhB,gBAAgB,4GAZhB;QACT;YACE,OAAO,EAAE,iBAAiB;YAC1B,WAAW,EAAE,UAAU,CAAC,MAAM,gBAAgB,CAAC;YAC/C,KAAK,EAAE,IAAI;SACZ;QACD;YACE,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,UAAU,CAAC,MAAM,gBAAgB,CAAC;SAChD;KACF,iDAjIS;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BT;2FAyGU,gBAAgB;kBArI5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,eAAe;oBACzB,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BT;oBACD,MAAM,EAAE;wBACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuFD;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,sBAAsB,CAAC;4BAC/C,KAAK,EAAE,IAAI;yBACZ;wBACD;4BACE,OAAO,EAAE,SAAS;4BAClB,WAAW,EAAE,UAAU,CAAC,sBAAsB,CAAC;yBAChD;qBACF;iBACF;0EAGU,KAAK;sBAAb,KAAK;gBAEG,MAAM;sBAAd,KAAK;gBAYG,QAAQ;sBAAhB,KAAK;;MAiDK,kBAAkB;;+GAAlB,kBAAkB;gHAAlB,kBAAkB,iBAjElB,gBAAgB,aA+DjB,YAAY,EAAE,YAAY,EAAE,mBAAmB,aA/D9C,gBAAgB;gHAiEhB,kBAAkB,YAFpB,CAAC,YAAY,EAAE,YAAY,EAAE,mBAAmB,CAAC;2FAE/C,kBAAkB;kBAL9B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;oBAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,mBAAmB,CAAC;iBAC3D;;;AC3MD;;;;;;"}
|