ngx-color 7.1.0 → 7.3.2

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.
Files changed (348) hide show
  1. package/alpha/alpha-picker.component.d.ts +8 -0
  2. package/alpha/ngx-color-alpha.d.ts +2 -1
  3. package/alpha/package.json +6 -10
  4. package/alpha/public_api.d.ts +1 -0
  5. package/alpha.component.d.ts +9 -0
  6. package/block/block-swatches.component.d.ts +13 -8
  7. package/block/block.component.d.ts +9 -0
  8. package/block/ngx-color-block.d.ts +2 -2
  9. package/block/package.json +6 -10
  10. package/block/public_api.d.ts +2 -0
  11. package/checkboard.component.d.ts +7 -0
  12. package/chrome/chrome-fields.component.d.ts +3 -0
  13. package/chrome/chrome.component.d.ts +9 -0
  14. package/chrome/ngx-color-chrome.d.ts +2 -2
  15. package/chrome/package.json +6 -10
  16. package/chrome/public_api.d.ts +2 -0
  17. package/circle/circle-swatch.component.d.ts +3 -0
  18. package/circle/circle.component.d.ts +9 -0
  19. package/circle/ngx-color-circle.d.ts +2 -2
  20. package/circle/package.json +9 -10
  21. package/circle/public_api.d.ts +2 -0
  22. package/color-wrap.component.d.ts +7 -0
  23. package/compact/compact-color.component.d.ts +3 -0
  24. package/compact/compact-fields.component.d.ts +3 -0
  25. package/compact/compact.component.d.ts +10 -0
  26. package/compact/ngx-color-compact.d.ts +2 -3
  27. package/compact/package.json +6 -10
  28. package/compact/public_api.d.ts +3 -0
  29. package/coordinates.directive.d.ts +6 -0
  30. package/editable-input.component.d.ts +7 -0
  31. package/esm2020/alpha/alpha-picker.component.mjs +116 -0
  32. package/esm2020/alpha/ngx-color-alpha.mjs +5 -0
  33. package/esm2020/alpha/public_api.mjs +2 -0
  34. package/esm2020/alpha.component.mjs +186 -0
  35. package/esm2020/block/block-swatches.component.mjs +74 -0
  36. package/esm2020/block/block.component.mjs +199 -0
  37. package/esm2020/block/ngx-color-block.mjs +5 -0
  38. package/esm2020/block/public_api.mjs +3 -0
  39. package/esm2020/checkboard.component.mjs +66 -0
  40. package/esm2020/chrome/chrome-fields.component.mjs +356 -0
  41. package/esm2020/chrome/chrome.component.mjs +249 -0
  42. package/esm2020/chrome/ngx-color-chrome.mjs +5 -0
  43. package/esm2020/chrome/public_api.mjs +3 -0
  44. package/esm2020/circle/circle-swatch.component.mjs +85 -0
  45. package/esm2020/circle/circle.component.mjs +148 -0
  46. package/esm2020/circle/ngx-color-circle.mjs +5 -0
  47. package/esm2020/circle/public_api.mjs +3 -0
  48. package/esm2020/color-wrap.component.mjs +163 -0
  49. package/esm2020/compact/compact-color.component.mjs +91 -0
  50. package/esm2020/compact/compact-fields.component.mjs +186 -0
  51. package/esm2020/compact/compact.component.mjs +177 -0
  52. package/esm2020/compact/ngx-color-compact.mjs +5 -0
  53. package/esm2020/compact/public_api.mjs +4 -0
  54. package/esm2020/coordinates.directive.mjs +104 -0
  55. package/esm2020/editable-input.component.mjs +217 -0
  56. package/esm2020/github/github-swatch.component.mjs +67 -0
  57. package/esm2020/github/github.component.mjs +179 -0
  58. package/esm2020/github/ngx-color-github.mjs +5 -0
  59. package/esm2020/github/public_api.mjs +3 -0
  60. package/esm2020/helpers/checkboard.mjs +33 -0
  61. package/esm2020/helpers/color.interfaces.mjs +2 -0
  62. package/esm2020/helpers/color.mjs +60 -0
  63. package/esm2020/hue/hue-picker.component.mjs +113 -0
  64. package/esm2020/hue/ngx-color-hue.mjs +5 -0
  65. package/esm2020/hue/public_api.mjs +2 -0
  66. package/esm2020/hue.component.mjs +165 -0
  67. package/esm2020/material/material.component.mjs +211 -0
  68. package/esm2020/material/ngx-color-material.mjs +5 -0
  69. package/esm2020/material/public_api.mjs +2 -0
  70. package/esm2020/ngx-color.mjs +5 -0
  71. package/esm2020/photoshop/ngx-color-photoshop.mjs +5 -0
  72. package/esm2020/photoshop/photoshop-button.component.mjs +63 -0
  73. package/esm2020/photoshop/photoshop-fields.component.mjs +241 -0
  74. package/esm2020/photoshop/photoshop-previews.component.mjs +68 -0
  75. package/esm2020/photoshop/photoshop.component.mjs +258 -0
  76. package/esm2020/photoshop/public_api.mjs +5 -0
  77. package/esm2020/public_api.mjs +14 -0
  78. package/esm2020/raised.component.mjs +89 -0
  79. package/esm2020/saturation.component.mjs +136 -0
  80. package/esm2020/shade/ngx-color-shade.mjs +5 -0
  81. package/esm2020/shade/public_api.mjs +2 -0
  82. package/esm2020/shade/shade-picker.component.mjs +105 -0
  83. package/esm2020/shade.component.mjs +165 -0
  84. package/esm2020/sketch/ngx-color-sketch.mjs +5 -0
  85. package/esm2020/sketch/public_api.mjs +4 -0
  86. package/esm2020/sketch/sketch-fields.component.mjs +243 -0
  87. package/esm2020/sketch/sketch-preset-colors.component.mjs +98 -0
  88. package/esm2020/sketch/sketch.component.mjs +283 -0
  89. package/esm2020/slider/ngx-color-slider.mjs +5 -0
  90. package/esm2020/slider/public_api.mjs +4 -0
  91. package/esm2020/slider/slider-swatch.component.mjs +80 -0
  92. package/esm2020/slider/slider-swatches.component.mjs +135 -0
  93. package/esm2020/slider/slider.component.mjs +116 -0
  94. package/esm2020/swatch.component.mjs +125 -0
  95. package/esm2020/swatches/ngx-color-swatches.mjs +5 -0
  96. package/esm2020/swatches/public_api.mjs +4 -0
  97. package/esm2020/swatches/swatches-color.component.mjs +123 -0
  98. package/esm2020/swatches/swatches-group.component.mjs +64 -0
  99. package/esm2020/swatches/swatches.component.mjs +258 -0
  100. package/esm2020/twitter/ngx-color-twitter.mjs +5 -0
  101. package/esm2020/twitter/public_api.mjs +2 -0
  102. package/esm2020/twitter/twitter.component.mjs +255 -0
  103. package/fesm2015/ngx-color-alpha.mjs +123 -0
  104. package/fesm2015/ngx-color-alpha.mjs.map +1 -0
  105. package/fesm2015/ngx-color-block.mjs +275 -0
  106. package/fesm2015/ngx-color-block.mjs.map +1 -0
  107. package/fesm2015/ngx-color-chrome.mjs +606 -0
  108. package/fesm2015/ngx-color-chrome.mjs.map +1 -0
  109. package/fesm2015/ngx-color-circle.mjs +237 -0
  110. package/fesm2015/ngx-color-circle.mjs.map +1 -0
  111. package/fesm2015/ngx-color-compact.mjs +451 -0
  112. package/fesm2015/ngx-color-compact.mjs.map +1 -0
  113. package/fesm2015/ngx-color-github.mjs +250 -0
  114. package/fesm2015/ngx-color-github.mjs.map +1 -0
  115. package/fesm2015/ngx-color-hue.mjs +120 -0
  116. package/fesm2015/ngx-color-hue.mjs.map +1 -0
  117. package/fesm2015/ngx-color-material.mjs +218 -0
  118. package/fesm2015/ngx-color-material.mjs.map +1 -0
  119. package/fesm2015/ngx-color-photoshop.mjs +626 -0
  120. package/fesm2015/ngx-color-photoshop.mjs.map +1 -0
  121. package/fesm2015/ngx-color-shade.mjs +112 -0
  122. package/fesm2015/ngx-color-shade.mjs.map +1 -0
  123. package/fesm2015/ngx-color-sketch.mjs +620 -0
  124. package/fesm2015/ngx-color-sketch.mjs.map +1 -0
  125. package/fesm2015/ngx-color-slider.mjs +331 -0
  126. package/fesm2015/ngx-color-slider.mjs.map +1 -0
  127. package/fesm2015/ngx-color-swatches.mjs +441 -0
  128. package/fesm2015/ngx-color-swatches.mjs.map +1 -0
  129. package/fesm2015/ngx-color-twitter.mjs +262 -0
  130. package/fesm2015/ngx-color-twitter.mjs.map +1 -0
  131. package/fesm2015/ngx-color.mjs +1461 -0
  132. package/fesm2015/ngx-color.mjs.map +1 -0
  133. package/fesm2020/ngx-color-alpha.mjs +123 -0
  134. package/fesm2020/ngx-color-alpha.mjs.map +1 -0
  135. package/fesm2020/ngx-color-block.mjs +275 -0
  136. package/fesm2020/ngx-color-block.mjs.map +1 -0
  137. package/fesm2020/ngx-color-chrome.mjs +606 -0
  138. package/fesm2020/ngx-color-chrome.mjs.map +1 -0
  139. package/fesm2020/ngx-color-circle.mjs +237 -0
  140. package/fesm2020/ngx-color-circle.mjs.map +1 -0
  141. package/fesm2020/ngx-color-compact.mjs +451 -0
  142. package/fesm2020/ngx-color-compact.mjs.map +1 -0
  143. package/fesm2020/ngx-color-github.mjs +250 -0
  144. package/fesm2020/ngx-color-github.mjs.map +1 -0
  145. package/fesm2020/ngx-color-hue.mjs +120 -0
  146. package/fesm2020/ngx-color-hue.mjs.map +1 -0
  147. package/fesm2020/ngx-color-material.mjs +218 -0
  148. package/fesm2020/ngx-color-material.mjs.map +1 -0
  149. package/fesm2020/ngx-color-photoshop.mjs +626 -0
  150. package/fesm2020/ngx-color-photoshop.mjs.map +1 -0
  151. package/fesm2020/ngx-color-shade.mjs +112 -0
  152. package/fesm2020/ngx-color-shade.mjs.map +1 -0
  153. package/fesm2020/ngx-color-sketch.mjs +620 -0
  154. package/fesm2020/ngx-color-sketch.mjs.map +1 -0
  155. package/fesm2020/ngx-color-slider.mjs +331 -0
  156. package/fesm2020/ngx-color-slider.mjs.map +1 -0
  157. package/fesm2020/ngx-color-swatches.mjs +441 -0
  158. package/fesm2020/ngx-color-swatches.mjs.map +1 -0
  159. package/fesm2020/ngx-color-twitter.mjs +262 -0
  160. package/fesm2020/ngx-color-twitter.mjs.map +1 -0
  161. package/fesm2020/ngx-color.mjs +1466 -0
  162. package/fesm2020/ngx-color.mjs.map +1 -0
  163. package/github/github-swatch.component.d.ts +3 -0
  164. package/github/github.component.d.ts +9 -0
  165. package/github/ngx-color-github.d.ts +2 -2
  166. package/github/package.json +6 -10
  167. package/github/public_api.d.ts +2 -0
  168. package/hue/hue-picker.component.d.ts +8 -0
  169. package/hue/ngx-color-hue.d.ts +2 -1
  170. package/hue/package.json +6 -10
  171. package/hue/public_api.d.ts +1 -0
  172. package/hue.component.d.ts +8 -0
  173. package/material/material.component.d.ts +8 -0
  174. package/material/ngx-color-material.d.ts +2 -1
  175. package/material/package.json +6 -10
  176. package/material/public_api.d.ts +1 -0
  177. package/ngx-color.d.ts +1 -0
  178. package/package.json +132 -9
  179. package/photoshop/ngx-color-photoshop.d.ts +2 -4
  180. package/photoshop/package.json +6 -10
  181. package/photoshop/photoshop-button.component.d.ts +3 -0
  182. package/photoshop/photoshop-fields.component.d.ts +3 -0
  183. package/photoshop/photoshop-previews.component.d.ts +3 -0
  184. package/photoshop/photoshop.component.d.ts +11 -0
  185. package/photoshop/public_api.d.ts +4 -0
  186. package/raised.component.d.ts +7 -0
  187. package/saturation.component.d.ts +8 -0
  188. package/shade/ngx-color-shade.d.ts +2 -1
  189. package/shade/package.json +6 -10
  190. package/shade/public_api.d.ts +1 -0
  191. package/shade/shade-picker.component.d.ts +8 -0
  192. package/shade.component.d.ts +8 -0
  193. package/sketch/ngx-color-sketch.d.ts +2 -3
  194. package/sketch/package.json +6 -10
  195. package/sketch/public_api.d.ts +3 -0
  196. package/sketch/sketch-fields.component.d.ts +3 -0
  197. package/sketch/sketch-preset-colors.component.d.ts +3 -0
  198. package/sketch/sketch.component.d.ts +10 -0
  199. package/slider/ngx-color-slider.d.ts +2 -3
  200. package/slider/package.json +6 -10
  201. package/slider/public_api.d.ts +3 -0
  202. package/slider/slider-swatch.component.d.ts +3 -0
  203. package/slider/slider-swatches.component.d.ts +3 -0
  204. package/slider/slider.component.d.ts +10 -0
  205. package/swatch.component.d.ts +8 -0
  206. package/swatches/ngx-color-swatches.d.ts +2 -3
  207. package/swatches/package.json +9 -10
  208. package/swatches/public_api.d.ts +3 -0
  209. package/swatches/swatches-color.component.d.ts +3 -0
  210. package/swatches/swatches-group.component.d.ts +3 -0
  211. package/swatches/swatches.component.d.ts +10 -0
  212. package/twitter/ngx-color-twitter.d.ts +2 -1
  213. package/twitter/package.json +6 -10
  214. package/twitter/public_api.d.ts +1 -0
  215. package/twitter/twitter.component.d.ts +8 -0
  216. package/alpha/bundles/ngx-color-alpha.umd.js +0 -400
  217. package/alpha/bundles/ngx-color-alpha.umd.js.map +0 -1
  218. package/alpha/esm2015/alpha-picker.component.js +0 -80
  219. package/alpha/esm2015/ngx-color-alpha.js +0 -5
  220. package/alpha/fesm2015/ngx-color-alpha.js +0 -87
  221. package/alpha/fesm2015/ngx-color-alpha.js.map +0 -1
  222. package/alpha/ngx-color-alpha.metadata.json +0 -1
  223. package/block/bundles/ngx-color-block.umd.js +0 -468
  224. package/block/bundles/ngx-color-block.umd.js.map +0 -1
  225. package/block/esm2015/block-swatches.component.js +0 -58
  226. package/block/esm2015/block.component.js +0 -147
  227. package/block/esm2015/ngx-color-block.js +0 -6
  228. package/block/fesm2015/ngx-color-block.js +0 -210
  229. package/block/fesm2015/ngx-color-block.js.map +0 -1
  230. package/block/ngx-color-block.metadata.json +0 -1
  231. package/bundles/ngx-color.umd.js +0 -1014
  232. package/bundles/ngx-color.umd.js.map +0 -1
  233. package/chrome/bundles/ngx-color-chrome.umd.js +0 -539
  234. package/chrome/bundles/ngx-color-chrome.umd.js.map +0 -1
  235. package/chrome/esm2015/chrome-fields.component.js +0 -255
  236. package/chrome/esm2015/chrome.component.js +0 -169
  237. package/chrome/esm2015/ngx-color-chrome.js +0 -6
  238. package/chrome/fesm2015/ngx-color-chrome.js +0 -428
  239. package/chrome/fesm2015/ngx-color-chrome.js.map +0 -1
  240. package/chrome/ngx-color-chrome.metadata.json +0 -1
  241. package/circle/bundles/ngx-color-circle.umd.js +0 -465
  242. package/circle/bundles/ngx-color-circle.umd.js.map +0 -1
  243. package/circle/esm2015/circle-swatch.component.js +0 -63
  244. package/circle/esm2015/circle.component.js +0 -105
  245. package/circle/esm2015/ngx-color-circle.js +0 -6
  246. package/circle/fesm2015/ngx-color-circle.js +0 -173
  247. package/circle/fesm2015/ngx-color-circle.js.map +0 -1
  248. package/circle/ngx-color-circle.metadata.json +0 -1
  249. package/compact/bundles/ngx-color-compact.umd.js +0 -575
  250. package/compact/bundles/ngx-color-compact.umd.js.map +0 -1
  251. package/compact/esm2015/compact-color.component.js +0 -70
  252. package/compact/esm2015/compact-fields.component.js +0 -142
  253. package/compact/esm2015/compact.component.js +0 -131
  254. package/compact/esm2015/ngx-color-compact.js +0 -7
  255. package/compact/fesm2015/ngx-color-compact.js +0 -344
  256. package/compact/fesm2015/ngx-color-compact.js.map +0 -1
  257. package/compact/ngx-color-compact.metadata.json +0 -1
  258. package/esm2015/alpha.component.js +0 -156
  259. package/esm2015/checkboard.component.js +0 -52
  260. package/esm2015/color-wrap.component.js +0 -145
  261. package/esm2015/coordinates.directive.js +0 -85
  262. package/esm2015/editable-input.component.js +0 -183
  263. package/esm2015/helpers/checkboard.js +0 -33
  264. package/esm2015/helpers/color.interfaces.js +0 -2
  265. package/esm2015/helpers/color.js +0 -60
  266. package/esm2015/hue.component.js +0 -140
  267. package/esm2015/ngx-color.js +0 -5
  268. package/esm2015/public_api.js +0 -14
  269. package/esm2015/raised.component.js +0 -73
  270. package/esm2015/saturation.component.js +0 -111
  271. package/esm2015/shade.component.js +0 -127
  272. package/esm2015/swatch.component.js +0 -85
  273. package/fesm2015/ngx-color.js +0 -1228
  274. package/fesm2015/ngx-color.js.map +0 -1
  275. package/github/bundles/ngx-color-github.umd.js +0 -443
  276. package/github/bundles/ngx-color-github.umd.js.map +0 -1
  277. package/github/esm2015/github-swatch.component.js +0 -48
  278. package/github/esm2015/github.component.js +0 -142
  279. package/github/esm2015/ngx-color-github.js +0 -6
  280. package/github/fesm2015/ngx-color-github.js +0 -195
  281. package/github/fesm2015/ngx-color-github.js.map +0 -1
  282. package/github/ngx-color-github.metadata.json +0 -1
  283. package/hue/bundles/ngx-color-hue.umd.js +0 -403
  284. package/hue/bundles/ngx-color-hue.umd.js.map +0 -1
  285. package/hue/esm2015/hue-picker.component.js +0 -78
  286. package/hue/esm2015/ngx-color-hue.js +0 -5
  287. package/hue/fesm2015/ngx-color-hue.js +0 -85
  288. package/hue/fesm2015/ngx-color-hue.js.map +0 -1
  289. package/hue/ngx-color-hue.metadata.json +0 -1
  290. package/material/bundles/ngx-color-material.umd.js +0 -451
  291. package/material/bundles/ngx-color-material.umd.js.map +0 -1
  292. package/material/esm2015/material.component.js +0 -157
  293. package/material/esm2015/ngx-color-material.js +0 -5
  294. package/material/fesm2015/ngx-color-material.js +0 -164
  295. package/material/fesm2015/ngx-color-material.js.map +0 -1
  296. package/material/ngx-color-material.metadata.json +0 -1
  297. package/ngx-color.metadata.json +0 -1
  298. package/photoshop/bundles/ngx-color-photoshop.umd.js +0 -567
  299. package/photoshop/bundles/ngx-color-photoshop.umd.js.map +0 -1
  300. package/photoshop/esm2015/ngx-color-photoshop.js +0 -8
  301. package/photoshop/esm2015/photoshop-button.component.js +0 -50
  302. package/photoshop/esm2015/photoshop-fields.component.js +0 -180
  303. package/photoshop/esm2015/photoshop-previews.component.js +0 -53
  304. package/photoshop/esm2015/photoshop.component.js +0 -177
  305. package/photoshop/fesm2015/ngx-color-photoshop.js +0 -460
  306. package/photoshop/fesm2015/ngx-color-photoshop.js.map +0 -1
  307. package/photoshop/ngx-color-photoshop.metadata.json +0 -1
  308. package/shade/bundles/ngx-color-shade.umd.js +0 -395
  309. package/shade/bundles/ngx-color-shade.umd.js.map +0 -1
  310. package/shade/esm2015/ngx-color-shade.js +0 -5
  311. package/shade/esm2015/shade-picker.component.js +0 -71
  312. package/shade/fesm2015/ngx-color-shade.js +0 -78
  313. package/shade/fesm2015/ngx-color-shade.js.map +0 -1
  314. package/shade/ngx-color-shade.metadata.json +0 -1
  315. package/sketch/bundles/ngx-color-sketch.umd.js +0 -581
  316. package/sketch/bundles/ngx-color-sketch.umd.js.map +0 -1
  317. package/sketch/esm2015/ngx-color-sketch.js +0 -7
  318. package/sketch/esm2015/sketch-fields.component.js +0 -181
  319. package/sketch/esm2015/sketch-preset-colors.component.js +0 -76
  320. package/sketch/esm2015/sketch.component.js +0 -199
  321. package/sketch/fesm2015/ngx-color-sketch.js +0 -458
  322. package/sketch/fesm2015/ngx-color-sketch.js.map +0 -1
  323. package/sketch/ngx-color-sketch.metadata.json +0 -1
  324. package/slider/bundles/ngx-color-slider.umd.js +0 -466
  325. package/slider/bundles/ngx-color-slider.umd.js.map +0 -1
  326. package/slider/esm2015/ngx-color-slider.js +0 -7
  327. package/slider/esm2015/slider-swatch.component.js +0 -65
  328. package/slider/esm2015/slider-swatches.component.js +0 -84
  329. package/slider/esm2015/slider.component.js +0 -77
  330. package/slider/fesm2015/ngx-color-slider.js +0 -229
  331. package/slider/fesm2015/ngx-color-slider.js.map +0 -1
  332. package/slider/ngx-color-slider.metadata.json +0 -1
  333. package/swatches/bundles/ngx-color-swatches.umd.js +0 -608
  334. package/swatches/bundles/ngx-color-swatches.umd.js.map +0 -1
  335. package/swatches/esm2015/ngx-color-swatches.js +0 -7
  336. package/swatches/esm2015/swatches-color.component.js +0 -90
  337. package/swatches/esm2015/swatches-group.component.js +0 -42
  338. package/swatches/esm2015/swatches.component.js +0 -213
  339. package/swatches/fesm2015/ngx-color-swatches.js +0 -347
  340. package/swatches/fesm2015/ngx-color-swatches.js.map +0 -1
  341. package/swatches/ngx-color-swatches.metadata.json +0 -1
  342. package/twitter/bundles/ngx-color-twitter.umd.js +0 -429
  343. package/twitter/bundles/ngx-color-twitter.umd.js.map +0 -1
  344. package/twitter/esm2015/ngx-color-twitter.js +0 -5
  345. package/twitter/esm2015/twitter.component.js +0 -203
  346. package/twitter/fesm2015/ngx-color-twitter.js +0 -210
  347. package/twitter/fesm2015/ngx-color-twitter.js.map +0 -1
  348. 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/circle/circle-swatch.component.ts","../../src/lib/circle/circle.component.ts","../../src/lib/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,EA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