@mintplayer/ng-bootstrap 16.5.0 → 16.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/color-picker/color-picker.module.d.ts +15 -0
  2. package/color-picker/components/alpha-strip/alpha-strip.component.d.ts +23 -0
  3. package/color-picker/components/color-picker/color-picker.component.d.ts +24 -0
  4. package/color-picker/components/color-wheel/color-wheel.component.d.ts +53 -0
  5. package/color-picker/components/index.d.ts +5 -0
  6. package/color-picker/components/luminosity-strip/luminosity-strip.component.d.ts +20 -0
  7. package/color-picker/components/slider/slider.component.d.ts +35 -0
  8. package/color-picker/directives/color-picker-value-accessor/color-picker-value-accessor.directive.d.ts +28 -0
  9. package/color-picker/directives/index.d.ts +1 -0
  10. package/color-picker/index.d.ts +5 -0
  11. package/color-picker/interfaces/hs.d.ts +4 -0
  12. package/color-picker/interfaces/hsl-color.d.ts +5 -0
  13. package/color-picker/interfaces/index.d.ts +3 -0
  14. package/color-picker/interfaces/rgb-color.d.ts +5 -0
  15. package/color-picker/types/html-color.d.ts +1 -0
  16. package/color-picker/types/index.d.ts +1 -0
  17. package/container/index.d.ts +1 -0
  18. package/container/src/container/container.component.d.ts +5 -0
  19. package/container/src/container.module.d.ts +8 -0
  20. package/container/src/index.d.ts +2 -0
  21. package/datatable/src/datatable/datatable.component.d.ts +1 -1
  22. package/datatable/src/datatable-column/datatable-column.directive.d.ts +3 -3
  23. package/datatable/src/index.d.ts +1 -1
  24. package/esm2022/accordion/src/accordion/accordion.component.mjs +5 -6
  25. package/esm2022/accordion/src/accordion-tab/accordion-tab.component.mjs +5 -6
  26. package/esm2022/accordion/src/accordion-tab-header/accordion-tab-header.component.mjs +5 -6
  27. package/esm2022/accordion/src/accordion.module.mjs +6 -7
  28. package/esm2022/alert/src/alert/alert.component.mjs +5 -6
  29. package/esm2022/alert/src/alert-close/alert-close.component.mjs +5 -6
  30. package/esm2022/alert/src/alert.module.mjs +6 -7
  31. package/esm2022/async-host-binding/src/async-host-binding.module.mjs +6 -7
  32. package/esm2022/badge/src/badge.component.mjs +5 -6
  33. package/esm2022/badge/src/badge.module.mjs +6 -7
  34. package/esm2022/breadcrumb/src/breadcrumb/breadcrumb.component.mjs +5 -6
  35. package/esm2022/breadcrumb/src/breadcrumb-item/breadcrumb-item.component.mjs +5 -6
  36. package/esm2022/breadcrumb/src/breadcrumb.module.mjs +6 -7
  37. package/esm2022/button-group/src/button-group/button-group.component.mjs +5 -6
  38. package/esm2022/button-group/src/button-group.module.mjs +6 -7
  39. package/esm2022/button-type/src/button-type/button-type.directive.mjs +5 -6
  40. package/esm2022/button-type/src/button-type/button-type.module.mjs +6 -7
  41. package/esm2022/calendar/src/calendar.component.mjs +5 -6
  42. package/esm2022/calendar/src/calendar.module.mjs +6 -7
  43. package/esm2022/calendar-month/src/pipes/month-name/month-name.module.mjs +6 -7
  44. package/esm2022/calendar-month/src/pipes/month-name/month-name.pipe.mjs +5 -6
  45. package/esm2022/calendar-month/src/pipes/weekday-name/weekday-name.module.mjs +6 -7
  46. package/esm2022/calendar-month/src/pipes/weekday-name/weekday-name.pipe.mjs +5 -6
  47. package/esm2022/calendar-month/src/service/calendar-month.service.mjs +5 -6
  48. package/esm2022/card/src/card/card.component.mjs +5 -6
  49. package/esm2022/card/src/card-header/card-header.component.mjs +5 -6
  50. package/esm2022/card/src/card.module.mjs +6 -7
  51. package/esm2022/carousel/src/carousel/carousel.component.mjs +5 -6
  52. package/esm2022/carousel/src/carousel-image/carousel-image.directive.mjs +5 -6
  53. package/esm2022/carousel/src/carousel.module.mjs +6 -7
  54. package/esm2022/close/src/close.component.mjs +5 -6
  55. package/esm2022/close/src/close.module.mjs +6 -7
  56. package/esm2022/code-snippet/src/code-snippet.component.mjs +5 -6
  57. package/esm2022/code-snippet/src/code-snippet.module.mjs +6 -7
  58. package/esm2022/color-picker/color-picker.module.mjs +65 -0
  59. package/esm2022/color-picker/components/alpha-strip/alpha-strip.component.mjs +80 -0
  60. package/esm2022/color-picker/components/color-picker/color-picker.component.mjs +60 -0
  61. package/esm2022/color-picker/components/color-wheel/color-wheel.component.mjs +321 -0
  62. package/esm2022/color-picker/components/index.mjs +6 -0
  63. package/esm2022/color-picker/components/luminosity-strip/luminosity-strip.component.mjs +72 -0
  64. package/esm2022/color-picker/components/slider/slider.component.mjs +125 -0
  65. package/esm2022/color-picker/directives/color-picker-value-accessor/color-picker-value-accessor.directive.mjs +130 -0
  66. package/esm2022/color-picker/directives/index.mjs +2 -0
  67. package/esm2022/color-picker/index.mjs +6 -0
  68. package/esm2022/color-picker/interfaces/hs.mjs +2 -0
  69. package/esm2022/color-picker/interfaces/hsl-color.mjs +2 -0
  70. package/esm2022/color-picker/interfaces/index.mjs +4 -0
  71. package/esm2022/color-picker/interfaces/rgb-color.mjs +2 -0
  72. package/esm2022/color-picker/mintplayer-ng-bootstrap-color-picker.mjs +5 -0
  73. package/esm2022/color-picker/types/html-color.mjs +2 -0
  74. package/esm2022/color-picker/types/index.mjs +2 -0
  75. package/esm2022/container/index.mjs +2 -0
  76. package/esm2022/container/mintplayer-ng-bootstrap-container.mjs +5 -0
  77. package/esm2022/container/src/container/container.component.mjs +11 -0
  78. package/esm2022/container/src/container.module.mjs +18 -0
  79. package/esm2022/container/src/index.mjs +3 -0
  80. package/esm2022/context-menu/src/context-menu.directive.mjs +5 -6
  81. package/esm2022/context-menu/src/context-menu.module.mjs +6 -7
  82. package/esm2022/copy/src/copy.directive.mjs +5 -6
  83. package/esm2022/copy/src/copy.module.mjs +6 -7
  84. package/esm2022/datatable/src/datatable/datatable.component.mjs +10 -11
  85. package/esm2022/datatable/src/datatable-column/datatable-column.directive.mjs +13 -9
  86. package/esm2022/datatable/src/datatable.module.mjs +7 -8
  87. package/esm2022/datatable/src/index.mjs +2 -2
  88. package/esm2022/datatable/src/row-template/row-template.directive.mjs +5 -6
  89. package/esm2022/datepicker/src/datepicker.component.mjs +5 -6
  90. package/esm2022/datepicker/src/datepicker.module.mjs +6 -7
  91. package/esm2022/dock/src/dock/dock.component.mjs +5 -6
  92. package/esm2022/dock/src/dock-pane-renderer/dock-pane-renderer.component.mjs +5 -6
  93. package/esm2022/dock/src/dock-panel/dock-panel.component.mjs +5 -6
  94. package/esm2022/dock/src/dock-panel-header/dock-panel-header.component.mjs +5 -6
  95. package/esm2022/dock/src/dock.module.mjs +6 -7
  96. package/esm2022/dock/src/services/dock/dock.service.mjs +5 -6
  97. package/esm2022/dropdown/src/dropdown/dropdown.directive.mjs +5 -6
  98. package/esm2022/dropdown/src/dropdown-menu/dropdown-menu.directive.mjs +5 -6
  99. package/esm2022/dropdown/src/dropdown-toggle/dropdown-toggle.directive.mjs +5 -6
  100. package/esm2022/dropdown/src/dropdown.module.mjs +6 -7
  101. package/esm2022/dropdown-divider/src/dropdown-divider.directive.mjs +5 -6
  102. package/esm2022/dropdown-divider/src/dropdown-divider.module.mjs +6 -7
  103. package/esm2022/dropdown-menu/src/dropdown-item/dropdown-item.component.mjs +5 -6
  104. package/esm2022/dropdown-menu/src/dropdown-menu/dropdown-menu.component.mjs +5 -6
  105. package/esm2022/dropdown-menu/src/dropdown-menu.module.mjs +6 -7
  106. package/esm2022/enhanced-paste/src/directive/enhanced-paste.directive.mjs +5 -6
  107. package/esm2022/enhanced-paste/src/enhanced-paste.module.mjs +6 -7
  108. package/esm2022/enum/src/service/enum.service.mjs +5 -6
  109. package/esm2022/file-upload/src/component/file-upload.component.mjs +5 -6
  110. package/esm2022/file-upload/src/directive/file-upload-template.directive.mjs +5 -6
  111. package/esm2022/file-upload/src/file-upload.module.mjs +6 -7
  112. package/esm2022/file-upload/src/pipes/format-bytes/format-bytes.pipe.mjs +5 -6
  113. package/esm2022/floating-labels/src/floating-labels/floating-label/floating-label.component.mjs +5 -6
  114. package/esm2022/floating-labels/src/floating-labels/floating-labels.module.mjs +6 -7
  115. package/esm2022/for/src/for.directive.mjs +5 -6
  116. package/esm2022/for/src/for.module.mjs +6 -7
  117. package/esm2022/form/src/form/form.component.mjs +5 -6
  118. package/esm2022/form/src/form-control/form-control.directive.mjs +5 -6
  119. package/esm2022/form/src/form-group/form-group.directive.mjs +5 -6
  120. package/esm2022/form/src/form.module.mjs +6 -7
  121. package/esm2022/grid/src/component/grid.component.mjs +8 -8
  122. package/esm2022/grid/src/directives/col-form-label/col-form-label.directive.mjs +5 -6
  123. package/esm2022/grid/src/directives/column/column.directive.mjs +5 -6
  124. package/esm2022/grid/src/directives/row/row.directive.mjs +5 -6
  125. package/esm2022/grid/src/grid.module.mjs +8 -8
  126. package/esm2022/has-overlay/src/has-overlay/has-overlay.component.mjs +5 -6
  127. package/esm2022/has-overlay/src/has-overlay/has-overlay.module.mjs +6 -7
  128. package/esm2022/icon/src/icon.component.mjs +5 -6
  129. package/esm2022/icon/src/icon.module.mjs +6 -7
  130. package/esm2022/input-group/src/input-group/input-group.component.mjs +5 -6
  131. package/esm2022/input-group/src/input-group.module.mjs +6 -7
  132. package/esm2022/instance-of/src/directives/instanceof-case.directive.mjs +5 -6
  133. package/esm2022/instance-of/src/directives/instanceof-default.directive.mjs +5 -6
  134. package/esm2022/instance-of/src/directives/instanceof.directive.mjs +5 -6
  135. package/esm2022/instance-of/src/instance-of.module.mjs +6 -7
  136. package/esm2022/instance-of/src/pipes/instance-of.pipe.mjs +5 -6
  137. package/esm2022/lazy-loading/src/lazy-load/lazy-load.directive.mjs +5 -6
  138. package/esm2022/lazy-loading/src/lazy-loading.module.mjs +6 -7
  139. package/esm2022/let/directive/let.directive.mjs +5 -6
  140. package/esm2022/let/let.module.mjs +6 -7
  141. package/esm2022/lib/pipes/font-color/font-color.module.mjs +6 -7
  142. package/esm2022/lib/pipes/font-color/font-color.pipe.mjs +5 -6
  143. package/esm2022/lib/pipes/in-list/in-list.module.mjs +6 -7
  144. package/esm2022/lib/pipes/in-list/in-list.pipe.mjs +5 -6
  145. package/esm2022/lib/pipes/uc-first/uc-first.module.mjs +6 -7
  146. package/esm2022/lib/pipes/uc-first/uc-first.pipe.mjs +5 -6
  147. package/esm2022/list-group/src/list-group/list-group.component.mjs +5 -6
  148. package/esm2022/list-group/src/list-group-item/list-group-item.component.mjs +5 -6
  149. package/esm2022/list-group/src/list-group.module.mjs +6 -7
  150. package/esm2022/markdown/src/bold/bold.pipe.mjs +5 -6
  151. package/esm2022/markdown/src/italic/italic.pipe.mjs +5 -6
  152. package/esm2022/markdown/src/markdown.module.mjs +6 -7
  153. package/esm2022/markdown/src/strikethrough/strikethrough.pipe.mjs +5 -6
  154. package/esm2022/markdown/src/underline/underline.pipe.mjs +5 -6
  155. package/esm2022/modal/src/components/modal/modal.component.mjs +5 -6
  156. package/esm2022/modal/src/components/modal-host/modal-host.component.mjs +5 -6
  157. package/esm2022/modal/src/directives/modal/modal.directive.mjs +5 -6
  158. package/esm2022/modal/src/directives/modal-body/modal-body.directive.mjs +5 -6
  159. package/esm2022/modal/src/directives/modal-close/modal-close.directive.mjs +5 -6
  160. package/esm2022/modal/src/directives/modal-footer/modal-footer.directive.mjs +5 -6
  161. package/esm2022/modal/src/directives/modal-header/modal-header.directive.mjs +5 -6
  162. package/esm2022/modal/src/modal.module.mjs +6 -7
  163. package/esm2022/multiselect/src/component/multiselect.component.mjs +5 -6
  164. package/esm2022/multiselect/src/directives/button-template/button-template.directive.mjs +5 -6
  165. package/esm2022/multiselect/src/directives/footer-template/footer-template.directive.mjs +5 -6
  166. package/esm2022/multiselect/src/directives/header-template/header-template.directive.mjs +5 -6
  167. package/esm2022/multiselect/src/multiselect.module.mjs +6 -7
  168. package/esm2022/navbar/src/dropdown-toggle/dropdown-toggle.directive.mjs +5 -6
  169. package/esm2022/navbar/src/expand-button/expand-button.directive.mjs +5 -6
  170. package/esm2022/navbar/src/nav-link/nav-link.directive.mjs +5 -6
  171. package/esm2022/navbar/src/navbar/navbar.component.mjs +9 -9
  172. package/esm2022/navbar/src/navbar-brand/navbar-brand.component.mjs +5 -6
  173. package/esm2022/navbar/src/navbar-content/navbar-content.directive.mjs +5 -6
  174. package/esm2022/navbar/src/navbar-dropdown/navbar-dropdown.component.mjs +5 -6
  175. package/esm2022/navbar/src/navbar-item/navbar-item.component.mjs +5 -6
  176. package/esm2022/navbar/src/navbar-nav/navbar-nav.component.mjs +5 -6
  177. package/esm2022/navbar/src/navbar-toggler/navbar-toggler.component.mjs +5 -6
  178. package/esm2022/navbar/src/navbar.module.mjs +11 -8
  179. package/esm2022/navigation-lock/src/directive/navigation-lock.directive.mjs +5 -6
  180. package/esm2022/navigation-lock/src/guard/navigation-lock.guard.mjs +5 -6
  181. package/esm2022/navigation-lock/src/navigation-lock.module.mjs +6 -7
  182. package/esm2022/no-noscript/src/no-noscript/no-noscript.directive.mjs +5 -6
  183. package/esm2022/no-noscript/src/no-noscript.module.mjs +6 -7
  184. package/esm2022/offcanvas/src/components/offcanvas/offcanvas.component.mjs +5 -6
  185. package/esm2022/offcanvas/src/components/offcanvas-body/offcanvas-body.component.mjs +5 -6
  186. package/esm2022/offcanvas/src/components/offcanvas-header/offcanvas-header.component.mjs +5 -6
  187. package/esm2022/offcanvas/src/components/offcanvas-host/offcanvas-host.component.mjs +5 -6
  188. package/esm2022/offcanvas/src/directives/offcanvas-close/offcanvas-close.directive.mjs +5 -6
  189. package/esm2022/offcanvas/src/directives/offcanvas-content/offcanvas-content.directive.mjs +5 -6
  190. package/esm2022/offcanvas/src/directives/offcanvas-push/offcanvas-push.directive.mjs +5 -6
  191. package/esm2022/offcanvas/src/offcanvas.module.mjs +6 -7
  192. package/esm2022/ordinal-number/src/ordinal-number/ordinal-number.pipe.mjs +5 -6
  193. package/esm2022/ordinal-number/src/ordinal-number.module.mjs +6 -7
  194. package/esm2022/pagination/src/component/pagination/pagination.component.mjs +5 -6
  195. package/esm2022/pagination/src/pagination.module.mjs +6 -7
  196. package/esm2022/placeholder/src/placeholder/placeholder.component.mjs +5 -6
  197. package/esm2022/placeholder/src/placeholder-field/placeholder-field.directive.mjs +5 -6
  198. package/esm2022/placeholder/src/placeholder.module.mjs +6 -7
  199. package/esm2022/popover/src/component/popover.component.mjs +5 -6
  200. package/esm2022/popover/src/directives/popover/popover.directive.mjs +5 -6
  201. package/esm2022/popover/src/directives/popover-body/popover-body.directive.mjs +5 -6
  202. package/esm2022/popover/src/directives/popover-header/popover-header.directive.mjs +5 -6
  203. package/esm2022/popover/src/popover.module.mjs +6 -7
  204. package/esm2022/progress-bar/src/progress/progress.component.mjs +5 -6
  205. package/esm2022/progress-bar/src/progress-bar/progress-bar.component.mjs +5 -6
  206. package/esm2022/progress-bar/src/progress-bar.module.mjs +6 -7
  207. package/esm2022/range/src/component/range.component.mjs +5 -6
  208. package/esm2022/range/src/range.module.mjs +6 -7
  209. package/esm2022/range/src/value-accessor/range-value-accessor.mjs +5 -6
  210. package/esm2022/rating/src/component/rating.component.mjs +5 -6
  211. package/esm2022/rating/src/rating.module.mjs +6 -7
  212. package/esm2022/resizable/src/resizable/resizable.component.mjs +5 -6
  213. package/esm2022/resizable/src/resizable.module.mjs +6 -7
  214. package/esm2022/resizable/src/resize-glyph/resize-glyph.directive.mjs +5 -6
  215. package/esm2022/scheduler/src/components/resource-group-presenter/resource-group-presenter.component.mjs +5 -6
  216. package/esm2022/scheduler/src/components/scheduler/scheduler.component.mjs +5 -6
  217. package/esm2022/scheduler/src/pipes/bs-seconds-timespan.pipe/bs-seconds-timespan.pipe.mjs +5 -6
  218. package/esm2022/scheduler/src/pipes/bs-seconds-today-offset/bs-seconds-today-offset.pipe.mjs +5 -6
  219. package/esm2022/scheduler/src/pipes/date-offset/date-offset.pipe.mjs +5 -6
  220. package/esm2022/scheduler/src/pipes/day-of-week/day-of-week.pipe.mjs +5 -6
  221. package/esm2022/scheduler/src/scheduler.module.mjs +6 -7
  222. package/esm2022/scheduler/src/services/timeline/timeline.service.mjs +5 -6
  223. package/esm2022/scrollspy/src/component/scrollspy.component.mjs +5 -6
  224. package/esm2022/scrollspy/src/directives/scrollspy.directive.mjs +5 -6
  225. package/esm2022/scrollspy/src/scrollspy.module.mjs +6 -7
  226. package/esm2022/scrollspy/src/services/scroll-offset/scroll-offset.service.mjs +5 -6
  227. package/esm2022/select/src/component/select.component.mjs +5 -6
  228. package/esm2022/select/src/select.module.mjs +6 -7
  229. package/esm2022/select/src/value-accessors/select-value-accessor.mjs +9 -11
  230. package/esm2022/select2/src/component/select2.component.mjs +6 -7
  231. package/esm2022/select2/src/directive/index.mjs +3 -0
  232. package/esm2022/select2/src/directive/item-template/item-template.directive.mjs +28 -0
  233. package/esm2022/select2/src/directive/suggestion-template/suggestion-template.directive.mjs +28 -0
  234. package/esm2022/select2/src/index.mjs +3 -2
  235. package/esm2022/select2/src/interfaces/has-id.mjs +2 -0
  236. package/esm2022/select2/src/interfaces/index.mjs +2 -0
  237. package/esm2022/select2/src/select2.module.mjs +19 -15
  238. package/esm2022/signature-pad/src/component/signature-pad.component.mjs +5 -6
  239. package/esm2022/signature-pad/src/signature-pad.module.mjs +6 -7
  240. package/esm2022/spinner/src/spinner.component.mjs +5 -6
  241. package/esm2022/spinner/src/spinner.module.mjs +6 -7
  242. package/esm2022/splitter/src/element-at/element-at.pipe.mjs +5 -6
  243. package/esm2022/splitter/src/split-panel/split-panel.component.mjs +5 -6
  244. package/esm2022/splitter/src/splitter/splitter.component.mjs +5 -6
  245. package/esm2022/splitter/src/splitter.module.mjs +6 -7
  246. package/esm2022/tab-control/src/tab-control/tab-control.component.mjs +5 -6
  247. package/esm2022/tab-control/src/tab-control.module.mjs +6 -7
  248. package/esm2022/tab-control/src/tab-page/tab-page.component.mjs +5 -6
  249. package/esm2022/tab-control/src/tab-page-header/tab-page-header.directive.mjs +5 -6
  250. package/esm2022/table/src/component/table.component.mjs +5 -6
  251. package/esm2022/table/src/table.module.mjs +6 -7
  252. package/esm2022/timepicker/src/timepicker.component.mjs +5 -6
  253. package/esm2022/timepicker/src/timepicker.module.mjs +6 -7
  254. package/esm2022/toast/src/components/toast/toast.component.mjs +5 -6
  255. package/esm2022/toast/src/components/toast-body/toast-body.component.mjs +5 -6
  256. package/esm2022/toast/src/components/toast-container/toast-container.component.mjs +5 -6
  257. package/esm2022/toast/src/components/toast-header/toast-header.component.mjs +5 -6
  258. package/esm2022/toast/src/directives/toast-close/toast-close.directive.mjs +5 -6
  259. package/esm2022/toast/src/pipes/add-properties.pipe.mjs +5 -6
  260. package/esm2022/toast/src/services/toast/toast.service.mjs +5 -6
  261. package/esm2022/toast/src/toast.module.mjs +6 -7
  262. package/esm2022/toggle-button/src/component/toggle-button.component.mjs +5 -6
  263. package/esm2022/toggle-button/src/directives/toggle-button-group/toggle-button-group.directive.mjs +5 -6
  264. package/esm2022/toggle-button/src/toggle-button.module.mjs +6 -7
  265. package/esm2022/toggle-button/src/value-accessor/toggle-button-value-accessor.mjs +5 -6
  266. package/esm2022/tooltip/src/component/tooltip.component.mjs +5 -6
  267. package/esm2022/tooltip/src/directive/tooltip.directive.mjs +5 -6
  268. package/esm2022/tooltip/src/tooltip.module.mjs +6 -7
  269. package/esm2022/treeview/src/treeview/treeview.component.mjs +5 -6
  270. package/esm2022/treeview/src/treeview-item/treeview-item.component.mjs +5 -6
  271. package/esm2022/treeview/src/treeview.module.mjs +6 -7
  272. package/esm2022/typeahead/src/typeahead.component.mjs +5 -6
  273. package/esm2022/typeahead/src/typeahead.module.mjs +6 -7
  274. package/esm2022/user-agent/src/directive/user-agent.directive.mjs +5 -6
  275. package/esm2022/user-agent/src/user-agent.module.mjs +6 -7
  276. package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +13 -13
  277. package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
  278. package/fesm2022/mintplayer-ng-bootstrap-alert.mjs +10 -10
  279. package/fesm2022/mintplayer-ng-bootstrap-alert.mjs.map +1 -1
  280. package/fesm2022/mintplayer-ng-bootstrap-async-host-binding.mjs +4 -4
  281. package/fesm2022/mintplayer-ng-bootstrap-async-host-binding.mjs.map +1 -1
  282. package/fesm2022/mintplayer-ng-bootstrap-badge.mjs +7 -7
  283. package/fesm2022/mintplayer-ng-bootstrap-badge.mjs.map +1 -1
  284. package/fesm2022/mintplayer-ng-bootstrap-breadcrumb.mjs +10 -10
  285. package/fesm2022/mintplayer-ng-bootstrap-breadcrumb.mjs.map +1 -1
  286. package/fesm2022/mintplayer-ng-bootstrap-button-group.mjs +7 -7
  287. package/fesm2022/mintplayer-ng-bootstrap-button-group.mjs.map +1 -1
  288. package/fesm2022/mintplayer-ng-bootstrap-button-type.mjs +7 -7
  289. package/fesm2022/mintplayer-ng-bootstrap-button-type.mjs.map +1 -1
  290. package/fesm2022/mintplayer-ng-bootstrap-calendar-month.mjs +17 -17
  291. package/fesm2022/mintplayer-ng-bootstrap-calendar-month.mjs.map +1 -1
  292. package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +7 -7
  293. package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
  294. package/fesm2022/mintplayer-ng-bootstrap-card.mjs +10 -10
  295. package/fesm2022/mintplayer-ng-bootstrap-card.mjs.map +1 -1
  296. package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +10 -10
  297. package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
  298. package/fesm2022/mintplayer-ng-bootstrap-close.mjs +7 -7
  299. package/fesm2022/mintplayer-ng-bootstrap-close.mjs.map +1 -1
  300. package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +7 -7
  301. package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
  302. package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +819 -0
  303. package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -0
  304. package/fesm2022/mintplayer-ng-bootstrap-container.mjs +33 -0
  305. package/fesm2022/mintplayer-ng-bootstrap-container.mjs.map +1 -0
  306. package/fesm2022/mintplayer-ng-bootstrap-context-menu.mjs +7 -7
  307. package/fesm2022/mintplayer-ng-bootstrap-context-menu.mjs.map +1 -1
  308. package/fesm2022/mintplayer-ng-bootstrap-copy.mjs +7 -7
  309. package/fesm2022/mintplayer-ng-bootstrap-copy.mjs.map +1 -1
  310. package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +25 -20
  311. package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
  312. package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +7 -7
  313. package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
  314. package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +19 -19
  315. package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
  316. package/fesm2022/mintplayer-ng-bootstrap-dropdown-divider.mjs +7 -7
  317. package/fesm2022/mintplayer-ng-bootstrap-dropdown-divider.mjs.map +1 -1
  318. package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +10 -10
  319. package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
  320. package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs +13 -13
  321. package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs.map +1 -1
  322. package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs +7 -7
  323. package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs.map +1 -1
  324. package/fesm2022/mintplayer-ng-bootstrap-enum.mjs +3 -3
  325. package/fesm2022/mintplayer-ng-bootstrap-enum.mjs.map +1 -1
  326. package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs +13 -13
  327. package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs.map +1 -1
  328. package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs +7 -7
  329. package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs.map +1 -1
  330. package/fesm2022/mintplayer-ng-bootstrap-for.mjs +7 -7
  331. package/fesm2022/mintplayer-ng-bootstrap-for.mjs.map +1 -1
  332. package/fesm2022/mintplayer-ng-bootstrap-form.mjs +13 -13
  333. package/fesm2022/mintplayer-ng-bootstrap-form.mjs.map +1 -1
  334. package/fesm2022/mintplayer-ng-bootstrap-grid.mjs +21 -19
  335. package/fesm2022/mintplayer-ng-bootstrap-grid.mjs.map +1 -1
  336. package/fesm2022/mintplayer-ng-bootstrap-has-overlay.mjs +7 -7
  337. package/fesm2022/mintplayer-ng-bootstrap-has-overlay.mjs.map +1 -1
  338. package/fesm2022/mintplayer-ng-bootstrap-icon.mjs +7 -7
  339. package/fesm2022/mintplayer-ng-bootstrap-icon.mjs.map +1 -1
  340. package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs +7 -7
  341. package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs.map +1 -1
  342. package/fesm2022/mintplayer-ng-bootstrap-instance-of.mjs +16 -16
  343. package/fesm2022/mintplayer-ng-bootstrap-instance-of.mjs.map +1 -1
  344. package/fesm2022/mintplayer-ng-bootstrap-lazy-loading.mjs +7 -7
  345. package/fesm2022/mintplayer-ng-bootstrap-lazy-loading.mjs.map +1 -1
  346. package/fesm2022/mintplayer-ng-bootstrap-let.mjs +7 -7
  347. package/fesm2022/mintplayer-ng-bootstrap-let.mjs.map +1 -1
  348. package/fesm2022/mintplayer-ng-bootstrap-list-group.mjs +10 -10
  349. package/fesm2022/mintplayer-ng-bootstrap-list-group.mjs.map +1 -1
  350. package/fesm2022/mintplayer-ng-bootstrap-markdown.mjs +16 -16
  351. package/fesm2022/mintplayer-ng-bootstrap-markdown.mjs.map +1 -1
  352. package/fesm2022/mintplayer-ng-bootstrap-modal.mjs +25 -25
  353. package/fesm2022/mintplayer-ng-bootstrap-modal.mjs.map +1 -1
  354. package/fesm2022/mintplayer-ng-bootstrap-multiselect.mjs +16 -16
  355. package/fesm2022/mintplayer-ng-bootstrap-multiselect.mjs.map +1 -1
  356. package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +44 -39
  357. package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
  358. package/fesm2022/mintplayer-ng-bootstrap-navigation-lock.mjs +10 -10
  359. package/fesm2022/mintplayer-ng-bootstrap-navigation-lock.mjs.map +1 -1
  360. package/fesm2022/mintplayer-ng-bootstrap-no-noscript.mjs +7 -7
  361. package/fesm2022/mintplayer-ng-bootstrap-no-noscript.mjs.map +1 -1
  362. package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs +25 -25
  363. package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs.map +1 -1
  364. package/fesm2022/mintplayer-ng-bootstrap-ordinal-number.mjs +7 -7
  365. package/fesm2022/mintplayer-ng-bootstrap-ordinal-number.mjs.map +1 -1
  366. package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +7 -7
  367. package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
  368. package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs +10 -10
  369. package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs.map +1 -1
  370. package/fesm2022/mintplayer-ng-bootstrap-popover.mjs +16 -16
  371. package/fesm2022/mintplayer-ng-bootstrap-popover.mjs.map +1 -1
  372. package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs +10 -10
  373. package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs.map +1 -1
  374. package/fesm2022/mintplayer-ng-bootstrap-range.mjs +10 -10
  375. package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
  376. package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +7 -7
  377. package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
  378. package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs +10 -10
  379. package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs.map +1 -1
  380. package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +25 -25
  381. package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
  382. package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs +13 -13
  383. package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs.map +1 -1
  384. package/fesm2022/mintplayer-ng-bootstrap-select.mjs +13 -13
  385. package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
  386. package/fesm2022/mintplayer-ng-bootstrap-select2.mjs +55 -18
  387. package/fesm2022/mintplayer-ng-bootstrap-select2.mjs.map +1 -1
  388. package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +7 -7
  389. package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
  390. package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs +7 -7
  391. package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs.map +1 -1
  392. package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +13 -13
  393. package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
  394. package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +13 -13
  395. package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
  396. package/fesm2022/mintplayer-ng-bootstrap-table.mjs +7 -7
  397. package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
  398. package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +7 -7
  399. package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
  400. package/fesm2022/mintplayer-ng-bootstrap-toast.mjs +25 -25
  401. package/fesm2022/mintplayer-ng-bootstrap-toast.mjs.map +1 -1
  402. package/fesm2022/mintplayer-ng-bootstrap-toggle-button.mjs +13 -13
  403. package/fesm2022/mintplayer-ng-bootstrap-toggle-button.mjs.map +1 -1
  404. package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs +10 -10
  405. package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs.map +1 -1
  406. package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +10 -10
  407. package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
  408. package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +7 -7
  409. package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
  410. package/fesm2022/mintplayer-ng-bootstrap-user-agent.mjs +7 -7
  411. package/fesm2022/mintplayer-ng-bootstrap-user-agent.mjs.map +1 -1
  412. package/fesm2022/mintplayer-ng-bootstrap.mjs +21 -21
  413. package/fesm2022/mintplayer-ng-bootstrap.mjs.map +1 -1
  414. package/grid/src/grid.module.d.ts +2 -1
  415. package/navbar/src/navbar.module.d.ts +6 -5
  416. package/package.json +13 -1
  417. package/select2/src/component/select2.component.d.ts +9 -7
  418. package/select2/src/directive/index.d.ts +2 -0
  419. package/select2/src/directive/item-template/item-template.directive.d.ts +15 -0
  420. package/select2/src/directive/suggestion-template/suggestion-template.directive.d.ts +15 -0
  421. package/select2/src/index.d.ts +2 -1
  422. package/select2/src/interfaces/has-id.d.ts +3 -0
  423. package/select2/src/interfaces/index.d.ts +1 -0
  424. package/select2/src/select2.module.d.ts +9 -8
  425. package/datatable/src/datatable-column/datatable-column-metadata.d.ts +0 -4
  426. package/datatable/src/datatable-column/index.d.ts +0 -2
  427. package/esm2022/datatable/src/datatable-column/datatable-column-metadata.mjs +0 -2
  428. package/esm2022/datatable/src/datatable-column/index.mjs +0 -3
  429. package/esm2022/select2/src/directive/item-template.directive.mjs +0 -20
  430. package/select2/src/directive/item-template.directive.d.ts +0 -9
@@ -0,0 +1,819 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Component, HostBinding, Input, ViewChild, Output, HostListener, Directive, forwardRef, Inject, NgModule } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
4
+ import * as i1 from '@angular/common';
5
+ import { CommonModule } from '@angular/common';
6
+ import * as i2 from '@mintplayer/ng-bootstrap/let';
7
+ import { BsLetModule } from '@mintplayer/ng-bootstrap/let';
8
+ import { BehaviorSubject, combineLatest, map, debounceTime, switchMap, take } from 'rxjs';
9
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
10
+
11
+ class BsColorWheelComponent {
12
+ constructor(element) {
13
+ // this.resizeObserver = new ResizeObserver((entries) => {
14
+ // for (const entry of entries) {
15
+ // if (entry.target === this.element.nativeElement) {
16
+ // console.log(entry.contentRect);
17
+ // this.width$.next(entry.contentRect.width);
18
+ // this.height$.next(entry.contentRect.height);
19
+ // break;
20
+ // }
21
+ // }
22
+ // });
23
+ this.element = element;
24
+ this.positionRelative = true;
25
+ //#region Hue/Luminosity
26
+ this.hs$ = new BehaviorSubject({ hue: 0, saturation: 0 });
27
+ this.hsChange = new EventEmitter();
28
+ //#endregion
29
+ //#region Luminosity
30
+ this.luminosity$ = new BehaviorSubject(0);
31
+ //#endregion
32
+ // private resizeObserver: ResizeObserver;
33
+ this.canvasContext = null;
34
+ this.isPointerDown = false;
35
+ this.width$ = new BehaviorSubject(150);
36
+ this.height$ = new BehaviorSubject(150);
37
+ this.diameterRatio$ = new BehaviorSubject(0);
38
+ this.disabled$ = new BehaviorSubject(false);
39
+ this.viewInited$ = new BehaviorSubject(false);
40
+ this.squareSize$ = combineLatest([this.width$, this.height$])
41
+ .pipe(map(([width, height]) => {
42
+ if ((width === null) || (height === null)) {
43
+ return null;
44
+ }
45
+ const squareSize = Math.min(width, height);
46
+ return squareSize;
47
+ }));
48
+ this.shiftX$ = combineLatest([this.width$, this.height$])
49
+ .pipe(map(([width, height]) => {
50
+ if ((width === null) || (height === null)) {
51
+ return null;
52
+ }
53
+ else if (width < height) {
54
+ return 0;
55
+ }
56
+ else {
57
+ return (width - height) / 2;
58
+ }
59
+ }));
60
+ this.shiftY$ = combineLatest([this.width$, this.height$])
61
+ .pipe(map(([width, height]) => {
62
+ if ((width === null) || (height === null)) {
63
+ return null;
64
+ }
65
+ else if (width < height) {
66
+ return (height - width) / 2;
67
+ }
68
+ else {
69
+ return 0;
70
+ }
71
+ }));
72
+ this.innerRadius$ = combineLatest([this.squareSize$, this.diameterRatio$])
73
+ .pipe(map(([squareSize, diameterRatio]) => {
74
+ if (squareSize) {
75
+ return squareSize / 2 * diameterRatio;
76
+ }
77
+ else {
78
+ return 0;
79
+ }
80
+ }));
81
+ this.outerRadius$ = combineLatest([this.squareSize$, this.diameterRatio$])
82
+ .pipe(map(([squareSize, diameterRatio]) => {
83
+ if (squareSize) {
84
+ return squareSize / 2;
85
+ }
86
+ else {
87
+ return 150;
88
+ }
89
+ }));
90
+ combineLatest([this.innerRadius$, this.outerRadius$, this.shiftX$, this.shiftY$])
91
+ .pipe(debounceTime(20), takeUntilDestroyed())
92
+ .subscribe(([innerRadius, outerRadius, shiftX, shiftY]) => {
93
+ if (this.canvasContext && (innerRadius !== null) && (outerRadius !== null) && (shiftX !== null) && (shiftY !== null)) {
94
+ this.canvasContext.clearRect(0, 0, this.canvas.nativeElement.width, this.canvas.nativeElement.height);
95
+ this.canvasContext.save();
96
+ this.canvasContext.translate(shiftX + outerRadius, shiftY + outerRadius);
97
+ for (let x = 0; x < 360; x++) {
98
+ this.canvasContext.rotate(1 * Math.PI / 180);
99
+ const gradient = this.canvasContext.createLinearGradient(innerRadius, 0, outerRadius, 0);
100
+ gradient.addColorStop(0, `hsl(${x}, 0%, 50%)`);
101
+ gradient.addColorStop(1, `hsl(${x}, 100%, 50%)`);
102
+ this.canvasContext.fillStyle = gradient;
103
+ this.canvasContext.fillRect(innerRadius, 0, outerRadius - innerRadius, outerRadius / 50);
104
+ }
105
+ this.canvasContext.restore();
106
+ }
107
+ });
108
+ this.markerPosition$ = combineLatest([this.hs$, this.shiftX$, this.shiftY$])
109
+ .pipe(switchMap(([hs, shiftX, shiftY]) => {
110
+ return this.color2position(hs)
111
+ .pipe(map((position) => ({ position, shiftX: (shiftX ?? 0), shiftY: (shiftY ?? 0) })));
112
+ }))
113
+ .pipe(map(({ position, shiftX, shiftY }) => {
114
+ return {
115
+ x: position.x + shiftX,
116
+ y: position.y + shiftY,
117
+ };
118
+ }));
119
+ this.hs$.pipe(takeUntilDestroyed())
120
+ .subscribe((hs) => this.hsChange.emit(hs));
121
+ }
122
+ set diameterRatio(value) {
123
+ this.diameterRatio$.next(value);
124
+ }
125
+ set width(value) {
126
+ this.width$.next(value);
127
+ }
128
+ set height(value) {
129
+ this.height$.next(value);
130
+ }
131
+ get hs() {
132
+ return this.hs$.value;
133
+ }
134
+ set hs(value) {
135
+ this.hs$.next(value);
136
+ }
137
+ get luminosity() {
138
+ return this.luminosity$.value;
139
+ }
140
+ set luminosity(value) {
141
+ this.luminosity$.next(value);
142
+ }
143
+ ngAfterViewInit() {
144
+ // this.resizeObserver.observe(this.element.nativeElement);
145
+ this.viewInited$.next(true);
146
+ this.canvasContext = this.canvas.nativeElement.getContext('2d', { willReadFrequently: true });
147
+ }
148
+ onPointerDown(ev) {
149
+ if (!this.disabled$.value) {
150
+ ev.preventDefault();
151
+ this.isPointerDown = true;
152
+ this.updateColor(ev, !('touches' in ev));
153
+ }
154
+ }
155
+ onPointerMove(ev) {
156
+ if (this.isPointerDown) {
157
+ ev.preventDefault();
158
+ ev.stopPropagation();
159
+ this.updateColor(ev, !('touches' in ev));
160
+ }
161
+ }
162
+ onMouseMove(ev) {
163
+ this.onPointerMove(ev);
164
+ }
165
+ onPointerUp(ev) {
166
+ this.isPointerDown = false;
167
+ }
168
+ updateColor(ev, subtract) {
169
+ let co;
170
+ const rect = this.canvas.nativeElement.getBoundingClientRect();
171
+ if ('touches' in ev) {
172
+ co = {
173
+ x: ev.touches[0].clientX - rect.left,
174
+ y: ev.touches[0].clientY - rect.top,
175
+ };
176
+ }
177
+ else {
178
+ co = {
179
+ x: ev.clientX - (subtract ? rect.left : 0),
180
+ y: ev.clientY - (subtract ? rect.top : 0),
181
+ };
182
+ }
183
+ this.position2color(co.x, co.y).pipe(take(1)).subscribe((color) => {
184
+ if (color) {
185
+ this.hs$.next({ hue: color.hue, saturation: color.saturation });
186
+ }
187
+ else {
188
+ console.warn('Color is null');
189
+ }
190
+ });
191
+ }
192
+ isInsideCircle(x, y) {
193
+ return combineLatest([this.squareSize$, this.shiftX$, this.shiftY$])
194
+ .pipe(map(([squareSize, shiftX, shiftY]) => {
195
+ // Position to the square
196
+ const sx = x - (shiftX ?? 0);
197
+ const sy = y - (shiftY ?? 0);
198
+ // Square radius
199
+ const sr = (squareSize ?? 0) / 2;
200
+ const radius = Math.sqrt(Math.pow(sx - sr, 2) + Math.pow(sy - sr, 2));
201
+ const angle = (Math.atan2(sr - sy, sr - sx) + Math.PI) % 360;
202
+ return {
203
+ inside: radius <= sr,
204
+ angle
205
+ };
206
+ }));
207
+ }
208
+ position2color(x, y) {
209
+ return this.isInsideCircle(x, y).pipe(map((result) => {
210
+ if (!this.canvasContext) {
211
+ return null;
212
+ }
213
+ if (result.inside) {
214
+ const imageData = this.canvasContext.getImageData(x, y, 1, 1).data;
215
+ const hsl = this.rgb2Hsl({ r: imageData[0], g: imageData[1], b: imageData[2] });
216
+ return hsl;
217
+ }
218
+ return { hue: result.angle * 180 / Math.PI, saturation: 1, luminosity: 0.5 };
219
+ }));
220
+ }
221
+ color2position(hs) {
222
+ return combineLatest([this.innerRadius$, this.outerRadius$])
223
+ .pipe(map(([innerRadius, outerRadius]) => {
224
+ if (innerRadius === null) {
225
+ innerRadius = 0;
226
+ }
227
+ if (!outerRadius) {
228
+ outerRadius = 100;
229
+ }
230
+ const theta = hs.hue * Math.PI / 180;
231
+ const c = {
232
+ x: -outerRadius * Math.cos(theta),
233
+ y: -outerRadius * Math.sin(theta)
234
+ };
235
+ const d = hs.saturation * (outerRadius - innerRadius) + innerRadius;
236
+ const o = { x: outerRadius, y: outerRadius };
237
+ return {
238
+ x: o.x - d * (c.x / outerRadius),
239
+ y: o.y - d * (c.y / outerRadius),
240
+ };
241
+ }));
242
+ }
243
+ rgb2Hsl(color) {
244
+ const r01 = this.bound01(color.r, 255);
245
+ const g01 = this.bound01(color.g, 255);
246
+ const b01 = this.bound01(color.b, 255);
247
+ const max = Math.max(r01, g01, b01);
248
+ const min = Math.min(r01, g01, b01);
249
+ let h, s;
250
+ const l = (max + min) / 2;
251
+ if (max === min) {
252
+ h = s = 0;
253
+ }
254
+ else {
255
+ const d = max - min;
256
+ s = (l > 0.5) ? (d / (2 - max - min)) : (d / (max + min));
257
+ switch (max) {
258
+ case r01:
259
+ {
260
+ h = (g01 - b01) / d + ((g01 < b01) ? 6 : 0);
261
+ }
262
+ break;
263
+ case g01:
264
+ {
265
+ h = (b01 - r01) / d + 2;
266
+ }
267
+ break;
268
+ case b01:
269
+ {
270
+ h = (r01 - g01) / d + 4;
271
+ }
272
+ break;
273
+ default: {
274
+ throw 'Invalid operation';
275
+ }
276
+ }
277
+ h /= 6;
278
+ }
279
+ h *= 360;
280
+ return { hue: h, saturation: s, luminosity: l };
281
+ }
282
+ /**
283
+ * Divide 1 to n, handling floating point errors.
284
+ * Ensures that the value is in between 0 and 1.
285
+ **/
286
+ bound01(n, max) {
287
+ n = Math.min(max, Math.max(0, n));
288
+ if ((Math.abs(n - max) < 0.000001)) {
289
+ return 1;
290
+ }
291
+ else {
292
+ return (n % max) / max;
293
+ }
294
+ }
295
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsColorWheelComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
296
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: BsColorWheelComponent, selector: "bs-color-wheel", inputs: { diameterRatio: "diameterRatio", width: "width", height: "height", hs: "hs", luminosity: "luminosity" }, outputs: { hsChange: "hsChange" }, host: { listeners: { "document:mousemove": "onMouseMove($event)", "document:mouseup": "onPointerUp($event)" }, properties: { "class.position-relative": "this.positionRelative" } }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true }], ngImport: i0, template: "<canvas\n class=\"d-block\"\n [width]=\"width$ | async\"\n [height]=\"height$ | async\"\n (mousedown)=\"onPointerDown($event)\"\n (touchstart)=\"onPointerDown($event)\"\n (touchmove)=\"onPointerMove($event)\"\n (touchend)=\"onPointerUp($event)\"\n #canvas></canvas>\n\n<ng-container *ngIf=\"(markerPosition$ | async) as markerPosition\">\n <div class=\"thumb position-absolute pe-none\" [style.left.px]=\"markerPosition.x\" [style.top.px]=\"markerPosition.y\"></div>\n</ng-container>", styles: [".thumb{width:30px;height:30px;border-radius:15px;margin-top:-15px;margin-left:-15px;box-sizing:border-box;border:2px solid white;box-shadow:#0000001a 0 0 10px 5px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
297
+ }
298
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsColorWheelComponent, decorators: [{
299
+ type: Component,
300
+ args: [{ selector: 'bs-color-wheel', template: "<canvas\n class=\"d-block\"\n [width]=\"width$ | async\"\n [height]=\"height$ | async\"\n (mousedown)=\"onPointerDown($event)\"\n (touchstart)=\"onPointerDown($event)\"\n (touchmove)=\"onPointerMove($event)\"\n (touchend)=\"onPointerUp($event)\"\n #canvas></canvas>\n\n<ng-container *ngIf=\"(markerPosition$ | async) as markerPosition\">\n <div class=\"thumb position-absolute pe-none\" [style.left.px]=\"markerPosition.x\" [style.top.px]=\"markerPosition.y\"></div>\n</ng-container>", styles: [".thumb{width:30px;height:30px;border-radius:15px;margin-top:-15px;margin-left:-15px;box-sizing:border-box;border:2px solid white;box-shadow:#0000001a 0 0 10px 5px}\n"] }]
301
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { positionRelative: [{
302
+ type: HostBinding,
303
+ args: ['class.position-relative']
304
+ }], diameterRatio: [{
305
+ type: Input
306
+ }], width: [{
307
+ type: Input
308
+ }], height: [{
309
+ type: Input
310
+ }], canvas: [{
311
+ type: ViewChild,
312
+ args: ['canvas']
313
+ }], hsChange: [{
314
+ type: Output
315
+ }], hs: [{
316
+ type: Input
317
+ }], luminosity: [{
318
+ type: Input
319
+ }], onMouseMove: [{
320
+ type: HostListener,
321
+ args: ['document:mousemove', ['$event']]
322
+ }], onPointerUp: [{
323
+ type: HostListener,
324
+ args: ['document:mouseup', ['$event']]
325
+ }] } });
326
+
327
+ class BsSliderComponent {
328
+ constructor(element, zone) {
329
+ this.element = element;
330
+ this.zone = zone;
331
+ this.dBlock = true;
332
+ this.positionRelative = true;
333
+ //#region Value
334
+ this.value$ = new BehaviorSubject(0.5);
335
+ this.valueChange = new EventEmitter();
336
+ //#endregion
337
+ this.isPointerDown$ = new BehaviorSubject(false);
338
+ this.value$.pipe(takeUntilDestroyed())
339
+ .subscribe((value) => this.valueChange.emit(value));
340
+ this.thumbMarginLeft$ = this.value$.pipe(map((value) => {
341
+ const res = value * element.nativeElement.clientWidth - 12;
342
+ return res;
343
+ }));
344
+ this.cursorClass$ = this.isPointerDown$.pipe(map((isPointerDown) => {
345
+ return isPointerDown ? 'cursor-grabbing' : 'cursor-grab';
346
+ }));
347
+ }
348
+ get value() {
349
+ return this.value$.value;
350
+ }
351
+ set value(value) {
352
+ this.value$.next(value);
353
+ }
354
+ onPointerDown(ev) {
355
+ ev.preventDefault();
356
+ this.zone.run(() => this.isPointerDown$.next(true));
357
+ this.updateColor(ev);
358
+ }
359
+ onPointerMove(ev) {
360
+ if (this.isPointerDown$.value) {
361
+ ev.preventDefault();
362
+ ev.stopPropagation();
363
+ this.updateColor(ev);
364
+ }
365
+ }
366
+ onPointerUp(ev) {
367
+ this.isPointerDown$.next(false);
368
+ }
369
+ updateColor(ev) {
370
+ let co;
371
+ const rect = this.track.nativeElement.getBoundingClientRect();
372
+ if ('touches' in ev) {
373
+ co = {
374
+ x: ev.touches[0].clientX - rect.left,
375
+ };
376
+ }
377
+ else {
378
+ co = {
379
+ x: ev.clientX - rect.left,
380
+ };
381
+ }
382
+ const percent = co.x / this.track.nativeElement.clientWidth;
383
+ const limited = Math.max(0, Math.min(1, percent));
384
+ this.value$.next(limited);
385
+ }
386
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsSliderComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
387
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: BsSliderComponent, selector: "bs-slider", inputs: { value: "value" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "document:mousemove": "onPointerMove($event)", "document:mouseup": "onPointerUp($event)" }, properties: { "class.d-block": "this.dBlock", "class.position-relative": "this.positionRelative" } }, viewQueries: [{ propertyName: "track", first: true, predicate: ["track"], descendants: true }, { propertyName: "thumb", first: true, predicate: ["thumb"], descendants: true }], ngImport: i0, template: "<div class=\"wrapper d-block position-relative\">\n <div #track class=\"track2\"\n (mousedown)=\"onPointerDown($event)\"\n (touchstart)=\"onPointerDown($event)\"\n (touchmove)=\"onPointerMove($event)\"\n (touchend)=\"onPointerUp($event)\">\n <ng-content select=\"[bsTrack]\"></ng-content>\n </div>\n <div #thumb\n (mousedown)=\"onPointerDown($event)\"\n (touchstart)=\"onPointerDown($event)\"\n (touchmove)=\"onPointerMove($event)\"\n (touchend)=\"onPointerUp($event)\"\n [class]=\"cursorClass$ | async\"\n [style.margin-left.px]=\"thumbMarginLeft$ | async\">\n <ng-content select=\"[bsThumb]\"></ng-content>\n </div>\n</div>", styles: [".track2{height:8px}.wrapper{padding-top:8px;padding-bottom:8px}::ng-deep .thumb{width:24px;height:24px;top:0;border-radius:50%;box-shadow:0 0 0 .1rem #646b7240}::ng-deep .track{height:8px;border-radius:8px}\n"], dependencies: [{ kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
388
+ }
389
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsSliderComponent, decorators: [{
390
+ type: Component,
391
+ args: [{ selector: 'bs-slider', template: "<div class=\"wrapper d-block position-relative\">\n <div #track class=\"track2\"\n (mousedown)=\"onPointerDown($event)\"\n (touchstart)=\"onPointerDown($event)\"\n (touchmove)=\"onPointerMove($event)\"\n (touchend)=\"onPointerUp($event)\">\n <ng-content select=\"[bsTrack]\"></ng-content>\n </div>\n <div #thumb\n (mousedown)=\"onPointerDown($event)\"\n (touchstart)=\"onPointerDown($event)\"\n (touchmove)=\"onPointerMove($event)\"\n (touchend)=\"onPointerUp($event)\"\n [class]=\"cursorClass$ | async\"\n [style.margin-left.px]=\"thumbMarginLeft$ | async\">\n <ng-content select=\"[bsThumb]\"></ng-content>\n </div>\n</div>", styles: [".track2{height:8px}.wrapper{padding-top:8px;padding-bottom:8px}::ng-deep .thumb{width:24px;height:24px;top:0;border-radius:50%;box-shadow:0 0 0 .1rem #646b7240}::ng-deep .track{height:8px;border-radius:8px}\n"] }]
392
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { dBlock: [{
393
+ type: HostBinding,
394
+ args: ['class.d-block']
395
+ }], positionRelative: [{
396
+ type: HostBinding,
397
+ args: ['class.position-relative']
398
+ }], track: [{
399
+ type: ViewChild,
400
+ args: ['track']
401
+ }], thumb: [{
402
+ type: ViewChild,
403
+ args: ['thumb']
404
+ }], valueChange: [{
405
+ type: Output
406
+ }], value: [{
407
+ type: Input
408
+ }], onPointerMove: [{
409
+ type: HostListener,
410
+ args: ['document:mousemove', ['$event']]
411
+ }], onPointerUp: [{
412
+ type: HostListener,
413
+ args: ['document:mouseup', ['$event']]
414
+ }] } });
415
+ class BsThumbDirective {
416
+ constructor() {
417
+ this.thumbClass = true;
418
+ }
419
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsThumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
420
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.2", type: BsThumbDirective, selector: "[bsThumb]", host: { properties: { "class.thumb": "this.thumbClass", "class.position-absolute": "this.thumbClass" } }, ngImport: i0 }); }
421
+ }
422
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsThumbDirective, decorators: [{
423
+ type: Directive,
424
+ args: [{ selector: '[bsThumb]' }]
425
+ }], propDecorators: { thumbClass: [{
426
+ type: HostBinding,
427
+ args: ['class.thumb']
428
+ }, {
429
+ type: HostBinding,
430
+ args: ['class.position-absolute']
431
+ }] } });
432
+ class BsTrackDirective {
433
+ constructor() {
434
+ this.trackClass = true;
435
+ }
436
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsTrackDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
437
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.2", type: BsTrackDirective, selector: "[bsTrack]", host: { properties: { "class.track": "this.trackClass" } }, ngImport: i0 }); }
438
+ }
439
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsTrackDirective, decorators: [{
440
+ type: Directive,
441
+ args: [{ selector: '[bsTrack]' }]
442
+ }], propDecorators: { trackClass: [{
443
+ type: HostBinding,
444
+ args: ['class.track']
445
+ }] } });
446
+
447
+ class BsLuminosityStripComponent {
448
+ constructor() {
449
+ //#region HS
450
+ this.hs$ = new BehaviorSubject({ hue: 0, saturation: 0 });
451
+ //#endregion
452
+ //#region Luminosity
453
+ this.luminosity$ = new BehaviorSubject(0.5);
454
+ this.luminosityChange = new EventEmitter();
455
+ //#endregion
456
+ this.canvasContext = null;
457
+ this.hs$.pipe(takeUntilDestroyed()).subscribe((hs) => {
458
+ if (this.canvasContext) {
459
+ const width = this.canvas.nativeElement.width, height = this.canvas.nativeElement.height;
460
+ this.canvasContext.clearRect(0, 0, width, height);
461
+ this.canvasContext.save();
462
+ // HSL
463
+ // - H: 0 - 359
464
+ // - S: "0%" - "100%"
465
+ // - L: "0%" - "50%" - "100%"
466
+ const gradient = this.canvasContext.createLinearGradient(0, 0, width, 0);
467
+ gradient.addColorStop(0, `hsl(${hs.hue}, ${hs.saturation * 100}%, 0%)`);
468
+ gradient.addColorStop(0.5, `hsl(${hs.hue}, ${hs.saturation * 100}%, 50%)`);
469
+ gradient.addColorStop(1, `hsl(${hs.hue}, ${hs.saturation * 100}%, 100%)`);
470
+ this.canvasContext.fillStyle = gradient;
471
+ this.canvasContext.fillRect(0, 0, width, height);
472
+ }
473
+ });
474
+ this.resultBackground$ = combineLatest([this.hs$, this.luminosity$])
475
+ .pipe(map(([hs, luminosity]) => {
476
+ return `hsl(${hs.hue}, ${hs.saturation * 100}%, ${luminosity * 100}%)`;
477
+ }));
478
+ this.luminosity$.pipe(takeUntilDestroyed())
479
+ .subscribe(luminosity => this.luminosityChange.emit(luminosity));
480
+ }
481
+ get hs() {
482
+ return this.hs$.value;
483
+ }
484
+ set hs(value) {
485
+ this.hs$.next(value);
486
+ }
487
+ get luminosity() {
488
+ return this.luminosity$.value;
489
+ }
490
+ set luminosity(value) {
491
+ this.luminosity$.next(value);
492
+ }
493
+ ngAfterViewInit() {
494
+ this.canvasContext = this.canvas.nativeElement.getContext('2d', { willReadFrequently: true });
495
+ }
496
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsLuminosityStripComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
497
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: BsLuminosityStripComponent, selector: "bs-luminosity-strip", inputs: { hs: "hs", luminosity: "luminosity" }, outputs: { luminosityChange: "luminosityChange" }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true }], ngImport: i0, template: "<bs-slider [value]=\"(luminosity$ | async)!\" (valueChange)=\"luminosityChange.emit($event)\">\n <canvas bsTrack class=\"position-absolute w-100\" #canvas></canvas>\n <div bsThumb [style.background]=\"resultBackground$ | async\"></div>\n</bs-slider>", styles: [""], dependencies: [{ kind: "component", type: BsSliderComponent, selector: "bs-slider", inputs: ["value"], outputs: ["valueChange"] }, { kind: "directive", type: BsThumbDirective, selector: "[bsThumb]" }, { kind: "directive", type: BsTrackDirective, selector: "[bsTrack]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
498
+ }
499
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsLuminosityStripComponent, decorators: [{
500
+ type: Component,
501
+ args: [{ selector: 'bs-luminosity-strip', template: "<bs-slider [value]=\"(luminosity$ | async)!\" (valueChange)=\"luminosityChange.emit($event)\">\n <canvas bsTrack class=\"position-absolute w-100\" #canvas></canvas>\n <div bsThumb [style.background]=\"resultBackground$ | async\"></div>\n</bs-slider>" }]
502
+ }], ctorParameters: function () { return []; }, propDecorators: { hs: [{
503
+ type: Input
504
+ }], luminosityChange: [{
505
+ type: Output
506
+ }], luminosity: [{
507
+ type: Input
508
+ }], canvas: [{
509
+ type: ViewChild,
510
+ args: ['canvas']
511
+ }] } });
512
+
513
+ class BsAlphaStripComponent {
514
+ constructor() {
515
+ //#region HS
516
+ this.hs$ = new BehaviorSubject({ hue: 0, saturation: 0 });
517
+ //#endregion
518
+ //#region Luminosity
519
+ this.luminosity$ = new BehaviorSubject(0.5);
520
+ //#endregion
521
+ //#region Alpha
522
+ this.alpha$ = new BehaviorSubject(1);
523
+ this.alphaChange = new EventEmitter();
524
+ //#endregion
525
+ this.canvasContext = null;
526
+ combineLatest([this.hs$, this.luminosity$]).pipe(takeUntilDestroyed()).subscribe(([hs, luminosity]) => {
527
+ setTimeout(() => {
528
+ if (this.canvasContext) {
529
+ const width = this.canvas.nativeElement.width, height = this.canvas.nativeElement.height;
530
+ this.canvasContext.clearRect(0, 0, width, height);
531
+ this.canvasContext.save();
532
+ const gradient = this.canvasContext.createLinearGradient(0, 0, width, 0);
533
+ gradient.addColorStop(0, `hsla(${hs.hue}, ${hs.saturation * 100}%, ${luminosity * 100}%, 0)`);
534
+ gradient.addColorStop(1, `hsla(${hs.hue}, ${hs.saturation * 100}%, ${luminosity * 100}%, 1)`);
535
+ this.canvasContext.fillStyle = gradient;
536
+ this.canvasContext.fillRect(0, 0, width, height);
537
+ }
538
+ });
539
+ });
540
+ this.resultBackground$ = combineLatest([this.hs$, this.luminosity$, this.alpha$])
541
+ .pipe(map(([hs, luminosity, alpha]) => {
542
+ return `hsla(${hs.hue}, ${hs.saturation * 100}%, ${luminosity * 100}%, ${alpha})`;
543
+ }));
544
+ this.alpha$.pipe(takeUntilDestroyed())
545
+ .subscribe((alpha) => this.alphaChange.emit(alpha));
546
+ }
547
+ get hs() {
548
+ return this.hs$.value;
549
+ }
550
+ set hs(value) {
551
+ this.hs$.next(value);
552
+ }
553
+ get luminosity() {
554
+ return this.luminosity$.value;
555
+ }
556
+ set luminosity(value) {
557
+ this.luminosity$.next(value);
558
+ }
559
+ get alpha() {
560
+ return this.alpha$.value;
561
+ }
562
+ set alpha(value) {
563
+ this.alpha$.next(value);
564
+ }
565
+ ngAfterViewInit() {
566
+ this.canvasContext = this.canvas.nativeElement.getContext('2d', { willReadFrequently: true });
567
+ }
568
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsAlphaStripComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
569
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: BsAlphaStripComponent, selector: "bs-alpha-strip", inputs: { hs: "hs", luminosity: "luminosity", alpha: "alpha" }, outputs: { alphaChange: "alphaChange" }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["track"], descendants: true }], ngImport: i0, template: "<bs-slider [value]=\"(alpha$ | async)!\" (valueChange)=\"alphaChange.emit($event)\">\n <canvas bsTrack class=\" track position-absolute w-100\" #track></canvas>\n\n <!-- [style.background]=\"resultBackground$ | async\" -->\n <div bsThumb [style.background]=\"resultBackground$ | async\"></div>\n</bs-slider>", styles: [".track{background-image:linear-gradient(45deg,#C0C0C0 25%,transparent 25%),linear-gradient(-45deg,#C0C0C0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#C0C0C0 75%),linear-gradient(-45deg,transparent 75%,#C0C0C0 75%);background-size:10px 10px;background-position:0 0,0 5px,5px -5px,-5px 0px}\n"], dependencies: [{ kind: "component", type: BsSliderComponent, selector: "bs-slider", inputs: ["value"], outputs: ["valueChange"] }, { kind: "directive", type: BsThumbDirective, selector: "[bsThumb]" }, { kind: "directive", type: BsTrackDirective, selector: "[bsTrack]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
570
+ }
571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsAlphaStripComponent, decorators: [{
572
+ type: Component,
573
+ args: [{ selector: 'bs-alpha-strip', template: "<bs-slider [value]=\"(alpha$ | async)!\" (valueChange)=\"alphaChange.emit($event)\">\n <canvas bsTrack class=\" track position-absolute w-100\" #track></canvas>\n\n <!-- [style.background]=\"resultBackground$ | async\" -->\n <div bsThumb [style.background]=\"resultBackground$ | async\"></div>\n</bs-slider>", styles: [".track{background-image:linear-gradient(45deg,#C0C0C0 25%,transparent 25%),linear-gradient(-45deg,#C0C0C0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#C0C0C0 75%),linear-gradient(-45deg,transparent 75%,#C0C0C0 75%);background-size:10px 10px;background-position:0 0,0 5px,5px -5px,-5px 0px}\n"] }]
574
+ }], ctorParameters: function () { return []; }, propDecorators: { hs: [{
575
+ type: Input
576
+ }], luminosity: [{
577
+ type: Input
578
+ }], alphaChange: [{
579
+ type: Output
580
+ }], alpha: [{
581
+ type: Input
582
+ }], canvas: [{
583
+ type: ViewChild,
584
+ args: ['track']
585
+ }] } });
586
+
587
+ class BsColorPickerComponent {
588
+ constructor() {
589
+ this.width$ = new BehaviorSubject(150);
590
+ this.height$ = new BehaviorSubject(150);
591
+ this.disabled$ = new BehaviorSubject(false);
592
+ this.allowAlpha$ = new BehaviorSubject(true);
593
+ this.hs$ = new BehaviorSubject({ hue: 0, saturation: 0 });
594
+ this.luminosity$ = new BehaviorSubject(0);
595
+ //#region Alpha
596
+ this.alpha$ = new BehaviorSubject(1);
597
+ this.alphaChange = new EventEmitter();
598
+ this.alpha$.pipe(takeUntilDestroyed())
599
+ .subscribe((alpha) => this.alphaChange.emit(alpha));
600
+ }
601
+ set width(value) {
602
+ this.width$.next(value);
603
+ }
604
+ set height(value) {
605
+ this.height$.next(value);
606
+ }
607
+ set allowAlpha(value) {
608
+ this.allowAlpha$.next(value);
609
+ }
610
+ get alpha() {
611
+ return this.alpha$.value;
612
+ }
613
+ set alpha(value) {
614
+ this.alpha$.next(value);
615
+ }
616
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsColorPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
617
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: BsColorPickerComponent, selector: "bs-color-picker", inputs: { width: "width", height: "height", allowAlpha: "allowAlpha", alpha: "alpha" }, outputs: { alphaChange: "alphaChange" }, viewQueries: [{ propertyName: "colorWheel", first: true, predicate: ["wheel"], descendants: true }], ngImport: i0, template: "<ng-container *bsLet=\"(disabled$ | async)!; let letDisabled\">\n <ng-container *bsLet=\"(hs$ | async)!; let letHS\">\n <ng-container *bsLet=\"(luminosity$ | async)!; let letLuminosity\">\n <ng-container *bsLet=\"(alpha$ | async)!; let letAlpha\">\n <bs-color-wheel [hs]=\"letHS\" (hsChange)=\"hs$.next($event)\" [luminosity]=\"letLuminosity\" #wheel></bs-color-wheel>\n <bs-luminosity-strip [hs]=\"letHS\" [luminosity]=\"letLuminosity\" (luminosityChange)=\"luminosity$.next($event)\" class=\"d-block mt-2\" #strip></bs-luminosity-strip>\n <bs-alpha-strip *ngIf=\"allowAlpha$ | async\" [hs]=\"letHS\" [luminosity]=\"letLuminosity\" [alpha]=\"letAlpha\" (alphaChange)=\"alpha$.next($event)\" class=\"d-block mt-2\" #alpha></bs-alpha-strip>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-container>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.BsLetDirective, selector: "[bsLet]", inputs: ["bsLet"] }, { kind: "component", type: BsColorWheelComponent, selector: "bs-color-wheel", inputs: ["diameterRatio", "width", "height", "hs", "luminosity"], outputs: ["hsChange"] }, { kind: "component", type: BsLuminosityStripComponent, selector: "bs-luminosity-strip", inputs: ["hs", "luminosity"], outputs: ["luminosityChange"] }, { kind: "component", type: BsAlphaStripComponent, selector: "bs-alpha-strip", inputs: ["hs", "luminosity", "alpha"], outputs: ["alphaChange"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
618
+ }
619
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsColorPickerComponent, decorators: [{
620
+ type: Component,
621
+ args: [{ selector: 'bs-color-picker', template: "<ng-container *bsLet=\"(disabled$ | async)!; let letDisabled\">\n <ng-container *bsLet=\"(hs$ | async)!; let letHS\">\n <ng-container *bsLet=\"(luminosity$ | async)!; let letLuminosity\">\n <ng-container *bsLet=\"(alpha$ | async)!; let letAlpha\">\n <bs-color-wheel [hs]=\"letHS\" (hsChange)=\"hs$.next($event)\" [luminosity]=\"letLuminosity\" #wheel></bs-color-wheel>\n <bs-luminosity-strip [hs]=\"letHS\" [luminosity]=\"letLuminosity\" (luminosityChange)=\"luminosity$.next($event)\" class=\"d-block mt-2\" #strip></bs-luminosity-strip>\n <bs-alpha-strip *ngIf=\"allowAlpha$ | async\" [hs]=\"letHS\" [luminosity]=\"letLuminosity\" [alpha]=\"letAlpha\" (alphaChange)=\"alpha$.next($event)\" class=\"d-block mt-2\" #alpha></bs-alpha-strip>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-container>" }]
622
+ }], ctorParameters: function () { return []; }, propDecorators: { colorWheel: [{
623
+ type: ViewChild,
624
+ args: ['wheel']
625
+ }], width: [{
626
+ type: Input
627
+ }], height: [{
628
+ type: Input
629
+ }], allowAlpha: [{
630
+ type: Input
631
+ }], alphaChange: [{
632
+ type: Output
633
+ }], alpha: [{
634
+ type: Input
635
+ }] } });
636
+
637
+ class BsColorPickerValueAccessor {
638
+ constructor(host, destroy) {
639
+ this.host = host;
640
+ this.destroy = destroy;
641
+ }
642
+ ngAfterViewInit() {
643
+ combineLatest([this.host.hs$, this.host.luminosity$])
644
+ .pipe(takeUntilDestroyed(this.destroy))
645
+ .subscribe(([hs, luminosity]) => {
646
+ const rgb = this.hsl2rgb(hs.hue, hs.saturation, luminosity);
647
+ const hex = this.rgb2hex(rgb);
648
+ setTimeout(() => this.onValueChange && this.onValueChange(hex), 10);
649
+ });
650
+ }
651
+ hsl2rgb(h, s, l) {
652
+ const k = (n) => (n + h / 30) % 12;
653
+ const a = s * Math.min(l, 1 - l);
654
+ const f = (n) => l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
655
+ const retValue = { r: 255 * f(0), g: 255 * f(8), b: 255 * f(4) };
656
+ return retValue;
657
+ }
658
+ //#region ControlValueAccessor implementation
659
+ registerOnChange(fn) {
660
+ this.onValueChange = fn;
661
+ }
662
+ registerOnTouched(fn) {
663
+ this.onTouched = fn;
664
+ }
665
+ writeValue(value) {
666
+ if (this.host && this.host.colorWheel) {
667
+ if (value) {
668
+ const rgb = this.hex2rgb(value);
669
+ const hsl = this.rgb2Hsl(rgb);
670
+ this.host.hs$.next({ hue: hsl.h, saturation: hsl.s });
671
+ this.host.luminosity$.next(hsl.l);
672
+ }
673
+ }
674
+ }
675
+ setDisabledState(isDisabled) {
676
+ if (this.host && this.host.colorWheel) {
677
+ this.host.colorWheel.disabled$.next(isDisabled);
678
+ }
679
+ }
680
+ //#endregion
681
+ //#region Color Conversion
682
+ rgb2hex(rgb) {
683
+ return '#' + (Math.round((rgb.r << 16) + (rgb.g << 8) + rgb.b)).toString(16).padStart(6, '0');
684
+ }
685
+ hex2rgb(hex) {
686
+ const r = parseInt(hex.slice(1, 3), 16), g = parseInt(hex.slice(3, 5), 16), b = parseInt(hex.slice(5, 7), 16);
687
+ return { r, g, b };
688
+ }
689
+ /**
690
+ * Divide 1 to n, handling floating point errors.
691
+ * Ensures that the value is in between 0 and 1.
692
+ **/
693
+ bound01(n, max) {
694
+ n = Math.min(max, Math.max(0, n));
695
+ if (Math.abs(n - max) < 0.000001) {
696
+ return 1;
697
+ }
698
+ else {
699
+ return (n % max) / max;
700
+ }
701
+ }
702
+ rgb2Hsl(color) {
703
+ const r01 = this.bound01(color.r, 255);
704
+ const g01 = this.bound01(color.g, 255);
705
+ const b01 = this.bound01(color.b, 255);
706
+ const max = Math.max(r01, g01, b01);
707
+ const min = Math.min(r01, g01, b01);
708
+ let h, s;
709
+ const l = (max + min) / 2;
710
+ if (max === min) {
711
+ h = s = 0;
712
+ }
713
+ else {
714
+ const d = max - min;
715
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
716
+ switch (max) {
717
+ case r01:
718
+ h = (g01 - b01) / d + (g01 < b01 ? 6 : 0);
719
+ break;
720
+ case g01:
721
+ h = (b01 - r01) / d + 2;
722
+ break;
723
+ case b01:
724
+ h = (r01 - g01) / d + 4;
725
+ break;
726
+ default: {
727
+ throw 'Invalid operation';
728
+ }
729
+ }
730
+ h /= 6;
731
+ }
732
+ h *= 360;
733
+ return { h, s, l };
734
+ }
735
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsColorPickerValueAccessor, deps: [{ token: forwardRef(() => BsColorPickerComponent) }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Directive }); }
736
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.2", type: BsColorPickerValueAccessor, selector: "bs-color-picker", providers: [{
737
+ provide: NG_VALUE_ACCESSOR,
738
+ // useExisting: BsColorPickerValueAccessor,
739
+ useExisting: forwardRef(() => BsColorPickerValueAccessor),
740
+ multi: true
741
+ }], exportAs: ["bsColorPicker"], ngImport: i0 }); }
742
+ }
743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsColorPickerValueAccessor, decorators: [{
744
+ type: Directive,
745
+ args: [{
746
+ selector: 'bs-color-picker',
747
+ providers: [{
748
+ provide: NG_VALUE_ACCESSOR,
749
+ // useExisting: BsColorPickerValueAccessor,
750
+ useExisting: forwardRef(() => BsColorPickerValueAccessor),
751
+ multi: true
752
+ }],
753
+ exportAs: 'bsColorPicker'
754
+ }]
755
+ }], ctorParameters: function () { return [{ type: BsColorPickerComponent, decorators: [{
756
+ type: Inject,
757
+ args: [forwardRef(() => BsColorPickerComponent)]
758
+ }] }, { type: i0.DestroyRef }]; } });
759
+
760
+ class BsColorPickerModule {
761
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsColorPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
762
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.2", ngImport: i0, type: BsColorPickerModule, declarations: [BsColorPickerComponent,
763
+ BsColorPickerValueAccessor,
764
+ BsColorWheelComponent,
765
+ BsLuminosityStripComponent,
766
+ BsSliderComponent,
767
+ BsThumbDirective,
768
+ BsTrackDirective,
769
+ BsAlphaStripComponent], imports: [CommonModule,
770
+ FormsModule,
771
+ BsLetModule], exports: [BsColorPickerComponent,
772
+ BsColorPickerValueAccessor,
773
+ BsColorWheelComponent,
774
+ BsLuminosityStripComponent,
775
+ BsSliderComponent,
776
+ BsThumbDirective,
777
+ BsTrackDirective,
778
+ BsAlphaStripComponent] }); }
779
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsColorPickerModule, imports: [CommonModule,
780
+ FormsModule,
781
+ BsLetModule] }); }
782
+ }
783
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsColorPickerModule, decorators: [{
784
+ type: NgModule,
785
+ args: [{
786
+ declarations: [
787
+ BsColorPickerComponent,
788
+ BsColorPickerValueAccessor,
789
+ BsColorWheelComponent,
790
+ BsLuminosityStripComponent,
791
+ BsSliderComponent,
792
+ BsThumbDirective,
793
+ BsTrackDirective,
794
+ BsAlphaStripComponent
795
+ ],
796
+ imports: [
797
+ CommonModule,
798
+ FormsModule,
799
+ BsLetModule
800
+ ],
801
+ exports: [
802
+ BsColorPickerComponent,
803
+ BsColorPickerValueAccessor,
804
+ BsColorWheelComponent,
805
+ BsLuminosityStripComponent,
806
+ BsSliderComponent,
807
+ BsThumbDirective,
808
+ BsTrackDirective,
809
+ BsAlphaStripComponent
810
+ ]
811
+ }]
812
+ }] });
813
+
814
+ /**
815
+ * Generated bundle index. Do not edit.
816
+ */
817
+
818
+ export { BsAlphaStripComponent, BsColorPickerComponent, BsColorPickerModule, BsColorPickerValueAccessor, BsColorWheelComponent, BsLuminosityStripComponent, BsSliderComponent, BsThumbDirective, BsTrackDirective };
819
+ //# sourceMappingURL=mintplayer-ng-bootstrap-color-picker.mjs.map