@mintplayer/ng-bootstrap 22.32.0 → 22.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs +3 -166
- package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +71 -140
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs +33 -63
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-badge.mjs +23 -30
- package/fesm2022/mintplayer-ng-bootstrap-badge.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-breadcrumb.mjs +37 -22
- package/fesm2022/mintplayer-ng-bootstrap-breadcrumb.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-button-group.mjs +25 -9
- package/fesm2022/mintplayer-ng-bootstrap-button-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +4 -8
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-card.mjs +157 -219
- package/fesm2022/mintplayer-ng-bootstrap-card.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +6 -8
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs +6 -8
- package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs +31 -40
- package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs +313 -212
- package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-close.mjs +25 -15
- package/fesm2022/mintplayer-ng-bootstrap-close.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +87 -676
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-context-menu.mjs +52 -119
- package/fesm2022/mintplayer-ng-bootstrap-context-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +12 -24
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +5 -9
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs +5 -7
- package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +5 -7
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs +201 -197
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs +9 -19
- package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs +64 -123
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs +18 -32
- package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-form.mjs +52 -38
- package/fesm2022/mintplayer-ng-bootstrap-form.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-grid.mjs +64 -119
- package/fesm2022/mintplayer-ng-bootstrap-grid.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs +23 -38
- package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-list-group.mjs +44 -44
- package/fesm2022/mintplayer-ng-bootstrap-list-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-machine.mjs +199 -16
- package/fesm2022/mintplayer-ng-bootstrap-machine.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-marquee.mjs +27 -12
- package/fesm2022/mintplayer-ng-bootstrap-marquee.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs +61 -261
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs +9 -11
- package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-nav.mjs +3 -4
- package/fesm2022/mintplayer-ng-bootstrap-nav.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs +30 -18
- package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +20 -90
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs +52 -401
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs +7 -7
- package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +27 -50
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-parallax.mjs +21 -12
- package/fesm2022/mintplayer-ng-bootstrap-parallax.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs +8 -10
- package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs +26 -54
- package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs +29 -15
- package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-popover.mjs +56 -267
- package/fesm2022/mintplayer-ng-bootstrap-popover.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-priority-nav.mjs +60 -335
- package/fesm2022/mintplayer-ng-bootstrap-priority-nav.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs +47 -63
- package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs +7 -15
- package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-radio.mjs +232 -169
- package/fesm2022/mintplayer-ng-bootstrap-radio.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs +85 -47
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +80 -137
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs +29 -326
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs +47 -63
- package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +14 -22
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs +48 -181
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs +8 -8
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +52 -108
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +5 -7
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +6 -6
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs +35 -40
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +61 -101
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs +29 -23
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-theming.mjs +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-theming.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tile-manager.mjs +67 -306
- package/fesm2022/mintplayer-ng-bootstrap-tile-manager.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs +7 -9
- package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +9 -13
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-toast.mjs +103 -152
- package/fesm2022/mintplayer-ng-bootstrap-toast.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs +50 -157
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs +9 -11
- package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +11 -13
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +159 -234
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
- package/package.json +2 -22
- package/types/mintplayer-ng-bootstrap-a11y.d.ts +2 -81
- package/types/mintplayer-ng-bootstrap-accordion.d.ts +51 -86
- package/types/mintplayer-ng-bootstrap-alert.d.ts +20 -28
- package/types/mintplayer-ng-bootstrap-badge.d.ts +12 -12
- package/types/mintplayer-ng-bootstrap-breadcrumb.d.ts +29 -8
- package/types/mintplayer-ng-bootstrap-button-group.d.ts +14 -4
- package/types/mintplayer-ng-bootstrap-calendar.d.ts +1 -5
- package/types/mintplayer-ng-bootstrap-card.d.ts +93 -78
- package/types/mintplayer-ng-bootstrap-carousel.d.ts +4 -6
- package/types/mintplayer-ng-bootstrap-charts-hierarchy.d.ts +4 -6
- package/types/mintplayer-ng-bootstrap-charts-sparkline.d.ts +24 -17
- package/types/mintplayer-ng-bootstrap-charts-trend.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-checkbox.d.ts +143 -91
- package/types/mintplayer-ng-bootstrap-close.d.ts +16 -5
- package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-color-picker.d.ts +42 -226
- package/types/mintplayer-ng-bootstrap-context-menu.d.ts +35 -17
- package/types/mintplayer-ng-bootstrap-datatable.d.ts +23 -35
- package/types/mintplayer-ng-bootstrap-datepicker.d.ts +2 -6
- package/types/mintplayer-ng-bootstrap-datetime-picker.d.ts +2 -4
- package/types/mintplayer-ng-bootstrap-dock.d.ts +6 -8
- package/types/mintplayer-ng-bootstrap-dropdown.d.ts +122 -54
- package/types/mintplayer-ng-bootstrap-file-manager.d.ts +10 -20
- package/types/mintplayer-ng-bootstrap-file-upload.d.ts +62 -44
- package/types/mintplayer-ng-bootstrap-floating-labels.d.ts +12 -15
- package/types/mintplayer-ng-bootstrap-form.d.ts +32 -11
- package/types/mintplayer-ng-bootstrap-grid.d.ts +38 -31
- package/types/mintplayer-ng-bootstrap-input-group.d.ts +11 -22
- package/types/mintplayer-ng-bootstrap-list-group.d.ts +28 -14
- package/types/mintplayer-ng-bootstrap-machine.d.ts +95 -4
- package/types/mintplayer-ng-bootstrap-marquee.d.ts +18 -5
- package/types/mintplayer-ng-bootstrap-modal.d.ts +43 -86
- package/types/mintplayer-ng-bootstrap-multi-range.d.ts +4 -6
- package/types/mintplayer-ng-bootstrap-nav.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-navbar-toggler.d.ts +21 -6
- package/types/mintplayer-ng-bootstrap-navbar.d.ts +15 -42
- package/types/mintplayer-ng-bootstrap-offcanvas.d.ts +35 -112
- package/types/mintplayer-ng-bootstrap-otp-input.d.ts +4 -3
- package/types/mintplayer-ng-bootstrap-pagination.d.ts +22 -35
- package/types/mintplayer-ng-bootstrap-parallax.d.ts +14 -4
- package/types/mintplayer-ng-bootstrap-phone-input.d.ts +5 -6
- package/types/mintplayer-ng-bootstrap-placeholder.d.ts +17 -16
- package/types/mintplayer-ng-bootstrap-playlist-toggler.d.ts +22 -6
- package/types/mintplayer-ng-bootstrap-popover.d.ts +35 -61
- package/types/mintplayer-ng-bootstrap-priority-nav.d.ts +80 -68
- package/types/mintplayer-ng-bootstrap-progress-bar.d.ts +34 -19
- package/types/mintplayer-ng-bootstrap-query-builder.d.ts +12 -20
- package/types/mintplayer-ng-bootstrap-radio.d.ts +112 -84
- package/types/mintplayer-ng-bootstrap-range.d.ts +35 -13
- package/types/mintplayer-ng-bootstrap-rating.d.ts +33 -42
- package/types/mintplayer-ng-bootstrap-resizable.d.ts +24 -114
- package/types/mintplayer-ng-bootstrap-ribbon.d.ts +21 -37
- package/types/mintplayer-ng-bootstrap-scheduler.d.ts +19 -27
- package/types/mintplayer-ng-bootstrap-scrollspy.d.ts +26 -51
- package/types/mintplayer-ng-bootstrap-select.d.ts +8 -7
- package/types/mintplayer-ng-bootstrap-shell.d.ts +40 -63
- package/types/mintplayer-ng-bootstrap-signature-pad.d.ts +4 -6
- package/types/mintplayer-ng-bootstrap-splitter.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-sticky-footer.d.ts +23 -19
- package/types/mintplayer-ng-bootstrap-tab-control.d.ts +61 -57
- package/types/mintplayer-ng-bootstrap-table.d.ts +21 -12
- package/types/mintplayer-ng-bootstrap-tile-manager.d.ts +94 -154
- package/types/mintplayer-ng-bootstrap-timeline.d.ts +23 -25
- package/types/mintplayer-ng-bootstrap-timepicker.d.ts +3 -7
- package/types/mintplayer-ng-bootstrap-toast.d.ts +92 -55
- package/types/mintplayer-ng-bootstrap-tooltip.d.ts +34 -33
- package/types/mintplayer-ng-bootstrap-tree-select.d.ts +14 -16
- package/types/mintplayer-ng-bootstrap-treeview.d.ts +12 -13
- package/types/mintplayer-ng-bootstrap-typeahead.d.ts +109 -133
- package/calendar-month/package.json +0 -4
- package/dropdown-divider/package.json +0 -4
- package/dropdown-menu/package.json +0 -4
- package/fesm2022/mintplayer-ng-bootstrap-calendar-month.mjs +0 -136
- package/fesm2022/mintplayer-ng-bootstrap-calendar-month.mjs.map +0 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-divider.mjs +0 -30
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-divider.mjs.map +0 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +0 -169
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +0 -1
- package/fesm2022/mintplayer-ng-bootstrap-has-overlay.mjs +0 -32
- package/fesm2022/mintplayer-ng-bootstrap-has-overlay.mjs.map +0 -1
- package/fesm2022/mintplayer-ng-bootstrap-no-noscript.mjs +0 -31
- package/fesm2022/mintplayer-ng-bootstrap-no-noscript.mjs.map +0 -1
- package/has-overlay/package.json +0 -4
- package/no-noscript/package.json +0 -4
- package/types/mintplayer-ng-bootstrap-calendar-month.d.ts +0 -54
- package/types/mintplayer-ng-bootstrap-dropdown-divider.d.ts +0 -9
- package/types/mintplayer-ng-bootstrap-dropdown-menu.d.ts +0 -94
- package/types/mintplayer-ng-bootstrap-has-overlay.d.ts +0 -22
- package/types/mintplayer-ng-bootstrap-no-noscript.d.ts +0 -11
|
@@ -1,718 +1,129 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
2
|
+
import { inject, Injector, DestroyRef, signal, forwardRef, Directive, computed, ElementRef, model, input, numberAttribute, booleanAttribute, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { useCore, useScopedStyles, MpPropsDirective } from '@mintplayer/ng-bootstrap/machine';
|
|
4
|
+
import { normalizeHex, colorPickerCore, colorPickerScopedStyles } from '@mintplayer/ui-core/color-picker';
|
|
5
|
+
import { bootstrapForms } from '@mintplayer/ui-core/bootstrap/forms';
|
|
6
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - saturation, lightness, value, alpha are in [0, 1]
|
|
15
|
-
* - r, g, b are in [0, 255] (integer on the way out, real-valued internally)
|
|
16
|
-
* - hex is "#RRGGBB" — three-digit "#RGB" is accepted on parse only
|
|
9
|
+
* The `ControlValueAccessor` of `bs-color-picker` (a host directive of the generated component,
|
|
10
|
+
* see `color-picker.angular.ts`). The value is the hex `#rrggbb`. A bound form control drives it
|
|
11
|
+
* through `viewValue`; what the user picks (on the wheel or a slider) reaches the form through
|
|
12
|
+
* the component's `valuechange`, which a form write never echoes.
|
|
17
13
|
*/
|
|
18
|
-
|
|
19
|
-
const clamp01 = (n) => Math.max(0, Math.min(1, n));
|
|
20
|
-
const clamp255 = (n) => Math.max(0, Math.min(255, Math.round(n)));
|
|
21
|
-
const HEX6_RE = /^[0-9a-fA-F]{6}$/;
|
|
22
|
-
const BLACK = { r: 0, g: 0, b: 0 };
|
|
23
|
-
function hex2rgb(hex) {
|
|
24
|
-
const stripped = hex.startsWith('#') ? hex.slice(1) : hex;
|
|
25
|
-
const expanded = stripped.length === 3
|
|
26
|
-
? stripped.split('').map(c => c + c).join('')
|
|
27
|
-
: stripped;
|
|
28
|
-
if (!HEX6_RE.test(expanded))
|
|
29
|
-
return { ...BLACK };
|
|
30
|
-
return {
|
|
31
|
-
r: parseInt(expanded.slice(0, 2), 16),
|
|
32
|
-
g: parseInt(expanded.slice(2, 4), 16),
|
|
33
|
-
b: parseInt(expanded.slice(4, 6), 16),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function rgb2hex(rgb) {
|
|
37
|
-
const r = clamp255(rgb.r);
|
|
38
|
-
const g = clamp255(rgb.g);
|
|
39
|
-
const b = clamp255(rgb.b);
|
|
40
|
-
return '#' + ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
|
|
41
|
-
}
|
|
42
|
-
function rgb2hsv(rgb) {
|
|
43
|
-
const r = rgb.r / 255;
|
|
44
|
-
const g = rgb.g / 255;
|
|
45
|
-
const b = rgb.b / 255;
|
|
46
|
-
const max = Math.max(r, g, b);
|
|
47
|
-
const min = Math.min(r, g, b);
|
|
48
|
-
const d = max - min;
|
|
49
|
-
const value = max;
|
|
50
|
-
const saturation = max === 0 ? 0 : d / max;
|
|
51
|
-
const hue = d === 0 ? 0 : hueFromRgb(r, g, b, max, d);
|
|
52
|
-
return { hue, saturation, value };
|
|
53
|
-
}
|
|
54
|
-
function hsv2rgb(hsv) {
|
|
55
|
-
const s = clamp01(hsv.saturation);
|
|
56
|
-
const v = clamp01(hsv.value);
|
|
57
|
-
const h = ((hsv.hue % 360) + 360) % 360;
|
|
58
|
-
const c = v * s;
|
|
59
|
-
const hp = h / 60;
|
|
60
|
-
const x = c * (1 - Math.abs((hp % 2) - 1));
|
|
61
|
-
const m = v - c;
|
|
62
|
-
let r1 = 0, g1 = 0, b1 = 0;
|
|
63
|
-
if (hp < 1) {
|
|
64
|
-
r1 = c;
|
|
65
|
-
g1 = x;
|
|
66
|
-
}
|
|
67
|
-
else if (hp < 2) {
|
|
68
|
-
r1 = x;
|
|
69
|
-
g1 = c;
|
|
70
|
-
}
|
|
71
|
-
else if (hp < 3) {
|
|
72
|
-
g1 = c;
|
|
73
|
-
b1 = x;
|
|
74
|
-
}
|
|
75
|
-
else if (hp < 4) {
|
|
76
|
-
g1 = x;
|
|
77
|
-
b1 = c;
|
|
78
|
-
}
|
|
79
|
-
else if (hp < 5) {
|
|
80
|
-
r1 = x;
|
|
81
|
-
b1 = c;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
r1 = c;
|
|
85
|
-
b1 = x;
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
r: (r1 + m) * 255,
|
|
89
|
-
g: (g1 + m) * 255,
|
|
90
|
-
b: (b1 + m) * 255,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function rgb2hsl(rgb) {
|
|
94
|
-
const r = rgb.r / 255;
|
|
95
|
-
const g = rgb.g / 255;
|
|
96
|
-
const b = rgb.b / 255;
|
|
97
|
-
const max = Math.max(r, g, b);
|
|
98
|
-
const min = Math.min(r, g, b);
|
|
99
|
-
const d = max - min;
|
|
100
|
-
const luminosity = (max + min) / 2;
|
|
101
|
-
const saturation = d === 0
|
|
102
|
-
? 0
|
|
103
|
-
: d / (1 - Math.abs(2 * luminosity - 1));
|
|
104
|
-
const hue = d === 0 ? 0 : hueFromRgb(r, g, b, max, d);
|
|
105
|
-
return { hue, saturation, luminosity };
|
|
106
|
-
}
|
|
107
|
-
function hsl2rgb(hsl) {
|
|
108
|
-
return hsv2rgb(hsl2hsv(hsl));
|
|
109
|
-
}
|
|
110
|
-
function hsv2hsl(hsv) {
|
|
111
|
-
const v = clamp01(hsv.value);
|
|
112
|
-
const s = clamp01(hsv.saturation);
|
|
113
|
-
const luminosity = v * (1 - s / 2);
|
|
114
|
-
const denom = Math.min(luminosity, 1 - luminosity);
|
|
115
|
-
const saturation = denom === 0 ? 0 : (v - luminosity) / denom;
|
|
116
|
-
return { hue: hsv.hue, saturation, luminosity };
|
|
117
|
-
}
|
|
118
|
-
function hsl2hsv(hsl) {
|
|
119
|
-
const l = clamp01(hsl.luminosity);
|
|
120
|
-
const s = clamp01(hsl.saturation);
|
|
121
|
-
const value = l + s * Math.min(l, 1 - l);
|
|
122
|
-
const saturation = value === 0 ? 0 : 2 * (1 - l / value);
|
|
123
|
-
return { hue: hsl.hue, saturation, value };
|
|
124
|
-
}
|
|
125
|
-
function hex2hsv(hex) {
|
|
126
|
-
return rgb2hsv(hex2rgb(hex));
|
|
127
|
-
}
|
|
128
|
-
function hsv2hex(hsv) {
|
|
129
|
-
return rgb2hex(hsv2rgb(hsv));
|
|
130
|
-
}
|
|
131
|
-
/** Polar position (cx, cy) on a disc of radius R → HSV (hue, saturation). */
|
|
132
|
-
function polar2hs(dx, dy, radius) {
|
|
133
|
-
const r = Math.sqrt(dx * dx + dy * dy);
|
|
134
|
-
const saturation = clamp01(r / radius);
|
|
135
|
-
let hue = (Math.atan2(dy, dx) * 360) / TWO_PI;
|
|
136
|
-
if (hue < 0)
|
|
137
|
-
hue += 360;
|
|
138
|
-
return { hue, saturation };
|
|
139
|
-
}
|
|
140
|
-
/** Inverse of polar2hs. Hue in degrees, saturation in [0, 1] → (dx, dy) on a disc of given radius. */
|
|
141
|
-
function hs2polar(hue, saturation, radius) {
|
|
142
|
-
const theta = (hue * TWO_PI) / 360;
|
|
143
|
-
const r = clamp01(saturation) * radius;
|
|
144
|
-
return { dx: r * Math.cos(theta), dy: r * Math.sin(theta) };
|
|
145
|
-
}
|
|
146
|
-
function hueFromRgb(r, g, b, max, d) {
|
|
147
|
-
let h;
|
|
148
|
-
switch (max) {
|
|
149
|
-
case r:
|
|
150
|
-
h = ((g - b) / d) % 6;
|
|
151
|
-
break;
|
|
152
|
-
case g:
|
|
153
|
-
h = (b - r) / d + 2;
|
|
154
|
-
break;
|
|
155
|
-
default:
|
|
156
|
-
h = (r - g) / d + 4;
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
h *= 60;
|
|
160
|
-
if (h < 0)
|
|
161
|
-
h += 360;
|
|
162
|
-
return h;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
class BsSliderComponent {
|
|
14
|
+
class BsColorPickerValueAccessor {
|
|
166
15
|
constructor() {
|
|
167
|
-
this.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
16
|
+
this.injector = inject(Injector);
|
|
17
|
+
this.destroyRef = inject(DestroyRef);
|
|
18
|
+
/** A form control drives the color: its `viewValue` wins over the `value` input. */
|
|
19
|
+
this.bound = signal(false, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "bound" }] : /* istanbul ignore next */ []));
|
|
21
|
+
this.viewValue = signal('#ffffff', /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "viewValue" }] : /* istanbul ignore next */ []));
|
|
23
|
+
this.disabled = signal(false, /* @ts-ignore */
|
|
172
24
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
173
|
-
this.
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
/** Suffix appended to aria-valuetext after the scaled number. Defaults to "%". Use "°" for hue, "" for unitless. */
|
|
182
|
-
this.valueUnit = input('%', /* @ts-ignore */
|
|
183
|
-
...(ngDevMode ? [{ debugName: "valueUnit" }] : /* istanbul ignore next */ []));
|
|
184
|
-
this.isPointerDown = signal(false, /* @ts-ignore */
|
|
185
|
-
...(ngDevMode ? [{ debugName: "isPointerDown" }] : /* istanbul ignore next */ []));
|
|
186
|
-
this.thumbLeft = computed(() => `${this.value() * 100}%`, /* @ts-ignore */
|
|
187
|
-
...(ngDevMode ? [{ debugName: "thumbLeft" }] : /* istanbul ignore next */ []));
|
|
188
|
-
this.cursorClass = computed(() => 'position-absolute top-0 ' + (this.isPointerDown() ? 'cursor-grabbing' : 'cursor-grab'), /* @ts-ignore */
|
|
189
|
-
...(ngDevMode ? [{ debugName: "cursorClass" }] : /* istanbul ignore next */ []));
|
|
190
|
-
/** Scaled current value for aria-valuenow (e.g. 0..100 for percent, 0..360 for hue). */
|
|
191
|
-
this.ariaValueNow = computed(() => Math.round(this.value() * this.valueScale()), /* @ts-ignore */
|
|
192
|
-
...(ngDevMode ? [{ debugName: "ariaValueNow" }] : /* istanbul ignore next */ []));
|
|
193
|
-
/** Human-readable value for SR with the configured unit. */
|
|
194
|
-
this.ariaValueText = computed(() => `${this.ariaValueNow()}${this.valueUnit()}`, /* @ts-ignore */
|
|
195
|
-
...(ngDevMode ? [{ debugName: "ariaValueText" }] : /* istanbul ignore next */ []));
|
|
196
|
-
}
|
|
197
|
-
onPointerDown(ev) {
|
|
198
|
-
if (this.disabled())
|
|
199
|
-
return;
|
|
200
|
-
ev.preventDefault();
|
|
201
|
-
ev.stopPropagation();
|
|
202
|
-
this.isPointerDown.set(true);
|
|
203
|
-
this.updateColor(ev);
|
|
204
|
-
}
|
|
205
|
-
onPointerMove(ev) {
|
|
206
|
-
if (this.isPointerDown()) {
|
|
207
|
-
ev.preventDefault();
|
|
208
|
-
ev.stopPropagation();
|
|
209
|
-
this.updateColor(ev);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
onPointerUp(_ev) {
|
|
213
|
-
this.isPointerDown.set(false);
|
|
214
|
-
}
|
|
215
|
-
onKeydown(ev) {
|
|
216
|
-
if (this.disabled())
|
|
217
|
-
return;
|
|
218
|
-
const cur = this.value();
|
|
219
|
-
const step = ev.shiftKey ? 0.001 : 0.01; // 1% default, 0.1% with Shift
|
|
220
|
-
const pageStep = 0.1; // 10% with PageUp/PageDown
|
|
221
|
-
let next = null;
|
|
222
|
-
switch (ev.key) {
|
|
223
|
-
case 'ArrowRight':
|
|
224
|
-
case 'ArrowUp':
|
|
225
|
-
next = Math.min(1, cur + step);
|
|
226
|
-
break;
|
|
227
|
-
case 'ArrowLeft':
|
|
228
|
-
case 'ArrowDown':
|
|
229
|
-
next = Math.max(0, cur - step);
|
|
230
|
-
break;
|
|
231
|
-
case 'PageUp':
|
|
232
|
-
next = Math.min(1, cur + pageStep);
|
|
233
|
-
break;
|
|
234
|
-
case 'PageDown':
|
|
235
|
-
next = Math.max(0, cur - pageStep);
|
|
236
|
-
break;
|
|
237
|
-
case 'Home':
|
|
238
|
-
next = 0;
|
|
239
|
-
break;
|
|
240
|
-
case 'End':
|
|
241
|
-
next = 1;
|
|
242
|
-
break;
|
|
243
|
-
default:
|
|
25
|
+
this.onChange = () => undefined;
|
|
26
|
+
this.onTouched = () => undefined;
|
|
27
|
+
}
|
|
28
|
+
ngOnInit() {
|
|
29
|
+
// The component is created after its host directives, so it is looked up here.
|
|
30
|
+
const component = this.injector.get(BsColorPickerComponent);
|
|
31
|
+
const sub = component.value.subscribe((value) => {
|
|
32
|
+
if (!this.bound() || value === this.viewValue())
|
|
244
33
|
return;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
updateColor(ev) {
|
|
251
|
-
const track = this.track().nativeElement;
|
|
252
|
-
const clientX = 'touches' in ev ? ev.touches[0].clientX : ev.clientX;
|
|
253
|
-
const fraction = trackFraction(clientX, track.getBoundingClientRect().left, track.clientWidth);
|
|
254
|
-
if (fraction !== null)
|
|
255
|
-
this.value.set(fraction);
|
|
256
|
-
}
|
|
257
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
258
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: BsSliderComponent, isStandalone: true, selector: "bs-slider", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, valueScale: { classPropertyName: "valueScale", publicName: "valueScale", isSignal: true, isRequired: false, transformFunction: null }, valueUnit: { classPropertyName: "valueUnit", publicName: "valueUnit", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "role": "slider", "aria-valuemin": "0", "aria-orientation": "horizontal" }, listeners: { "document:mousemove": "onPointerMove($event)", "document:mouseup": "onPointerUp($event)", "keydown": "onKeydown($event)" }, properties: { "attr.aria-valuemax": "valueScale()", "attr.aria-valuenow": "ariaValueNow()", "attr.aria-valuetext": "ariaValueText()", "attr.aria-label": "ariaLabel()", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.tabindex": "disabled() ? -1 : 0" }, classAttribute: "d-block position-relative" }, viewQueries: [{ propertyName: "track", first: true, predicate: ["track"], descendants: true, isSignal: true }, { propertyName: "thumb", first: true, predicate: ["thumb"], descendants: true, isSignal: 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()\"\n [style.left]=\"thumbLeft()\">\n <ng-content select=\"[bsThumb]\"></ng-content>\n </div>\n</div>\n", styles: [".track2{height:8px}.wrapper{padding-top:8px;padding-bottom:8px}:host ::ng-deep .track{height:8px;border-radius:8px}:host ::ng-deep .thumb{width:24px;height:24px;top:0;transform:translate(-50%);border-radius:50%;box-shadow:0 0 0 .1rem #646b7240}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
259
|
-
}
|
|
260
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsSliderComponent, decorators: [{
|
|
261
|
-
type: Component,
|
|
262
|
-
args: [{ selector: 'bs-slider', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
263
|
-
'class': 'd-block position-relative',
|
|
264
|
-
'role': 'slider',
|
|
265
|
-
'aria-valuemin': '0',
|
|
266
|
-
'aria-orientation': 'horizontal',
|
|
267
|
-
'[attr.aria-valuemax]': 'valueScale()',
|
|
268
|
-
'[attr.aria-valuenow]': 'ariaValueNow()',
|
|
269
|
-
'[attr.aria-valuetext]': 'ariaValueText()',
|
|
270
|
-
'[attr.aria-label]': 'ariaLabel()',
|
|
271
|
-
'[attr.aria-disabled]': 'disabled() ? "true" : null',
|
|
272
|
-
'[attr.tabindex]': 'disabled() ? -1 : 0',
|
|
273
|
-
'(document:mousemove)': 'onPointerMove($event)',
|
|
274
|
-
'(document:mouseup)': 'onPointerUp($event)',
|
|
275
|
-
'(keydown)': 'onKeydown($event)',
|
|
276
|
-
}, 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()\"\n [style.left]=\"thumbLeft()\">\n <ng-content select=\"[bsThumb]\"></ng-content>\n </div>\n</div>\n", styles: [".track2{height:8px}.wrapper{padding-top:8px;padding-bottom:8px}:host ::ng-deep .track{height:8px;border-radius:8px}:host ::ng-deep .thumb{width:24px;height:24px;top:0;transform:translate(-50%);border-radius:50%;box-shadow:0 0 0 .1rem #646b7240}\n"] }]
|
|
277
|
-
}], propDecorators: { track: [{ type: i0.ViewChild, args: ['track', { isSignal: true }] }], thumb: [{ type: i0.ViewChild, args: ['thumb', { isSignal: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], valueScale: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueScale", required: false }] }], valueUnit: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueUnit", required: false }] }] } });
|
|
278
|
-
/**
|
|
279
|
-
* Where `clientX` falls along a track starting at `left` and `width` px wide, clamped to 0..1.
|
|
280
|
-
* A track with no width (not laid out yet, or display:none) has no position to report: null,
|
|
281
|
-
* rather than the NaN or Infinity the division would produce.
|
|
282
|
-
*/
|
|
283
|
-
function trackFraction(clientX, left, width) {
|
|
284
|
-
if (!(width > 0))
|
|
285
|
-
return null;
|
|
286
|
-
return Math.max(0, Math.min(1, (clientX - left) / width));
|
|
287
|
-
}
|
|
288
|
-
class BsThumbDirective {
|
|
289
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsThumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
290
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsThumbDirective, isStandalone: true, selector: "[bsThumb]", host: { classAttribute: "thumb position-absolute" }, ngImport: i0 }); }
|
|
291
|
-
}
|
|
292
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsThumbDirective, decorators: [{
|
|
293
|
-
type: Directive,
|
|
294
|
-
args: [{
|
|
295
|
-
selector: '[bsThumb]',
|
|
296
|
-
host: {
|
|
297
|
-
'class': 'thumb position-absolute',
|
|
298
|
-
},
|
|
299
|
-
}]
|
|
300
|
-
}] });
|
|
301
|
-
class BsTrackDirective {
|
|
302
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTrackDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
303
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsTrackDirective, isStandalone: true, selector: "[bsTrack]", host: { classAttribute: "track" }, ngImport: i0 }); }
|
|
304
|
-
}
|
|
305
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTrackDirective, decorators: [{
|
|
306
|
-
type: Directive,
|
|
307
|
-
args: [{
|
|
308
|
-
selector: '[bsTrack]',
|
|
309
|
-
host: {
|
|
310
|
-
'class': 'track',
|
|
311
|
-
},
|
|
312
|
-
}]
|
|
313
|
-
}] });
|
|
314
|
-
|
|
315
|
-
class BsAlphaStripComponent {
|
|
316
|
-
constructor() {
|
|
317
|
-
this.disabled = input(false, /* @ts-ignore */
|
|
318
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
319
|
-
this.hs = model({ hue: 0, saturation: 0 }, /* @ts-ignore */
|
|
320
|
-
...(ngDevMode ? [{ debugName: "hs" }] : /* istanbul ignore next */ []));
|
|
321
|
-
this.brightness = model(1, /* @ts-ignore */
|
|
322
|
-
...(ngDevMode ? [{ debugName: "brightness" }] : /* istanbul ignore next */ []));
|
|
323
|
-
this.alpha = model(1, /* @ts-ignore */
|
|
324
|
-
...(ngDevMode ? [{ debugName: "alpha" }] : /* istanbul ignore next */ []));
|
|
325
|
-
this.trackGradient = computed(() => {
|
|
326
|
-
const hs = this.hs();
|
|
327
|
-
const brightness = this.brightness();
|
|
328
|
-
const rgb = hsv2rgb({ hue: hs.hue, saturation: hs.saturation, value: brightness });
|
|
329
|
-
const r = Math.round(rgb.r), g = Math.round(rgb.g), b = Math.round(rgb.b);
|
|
330
|
-
return `linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0), rgba(${r}, ${g}, ${b}, 1))`;
|
|
331
|
-
}, /* @ts-ignore */
|
|
332
|
-
...(ngDevMode ? [{ debugName: "trackGradient" }] : /* istanbul ignore next */ []));
|
|
333
|
-
this.resultBackground = computed(() => {
|
|
334
|
-
const hs = this.hs();
|
|
335
|
-
const brightness = this.brightness();
|
|
336
|
-
const alpha = this.alpha();
|
|
337
|
-
const rgb = hsv2rgb({ hue: hs.hue, saturation: hs.saturation, value: brightness });
|
|
338
|
-
return `rgba(${Math.round(rgb.r)}, ${Math.round(rgb.g)}, ${Math.round(rgb.b)}, ${alpha})`;
|
|
339
|
-
}, /* @ts-ignore */
|
|
340
|
-
...(ngDevMode ? [{ debugName: "resultBackground" }] : /* istanbul ignore next */ []));
|
|
341
|
-
}
|
|
342
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsAlphaStripComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
343
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: BsAlphaStripComponent, isStandalone: true, selector: "bs-alpha-strip", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, hs: { classPropertyName: "hs", publicName: "hs", isSignal: true, isRequired: false, transformFunction: null }, brightness: { classPropertyName: "brightness", publicName: "brightness", isSignal: true, isRequired: false, transformFunction: null }, alpha: { classPropertyName: "alpha", publicName: "alpha", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hs: "hsChange", brightness: "brightnessChange", alpha: "alphaChange" }, ngImport: i0, template: "<bs-slider [disabled]=\"disabled()\" [value]=\"alpha()\" (valueChange)=\"alpha.set($event)\" ariaLabel=\"Alpha\">\n <div bsTrack class=\"position-absolute w-100\" [style.background]=\"trackGradient()\"></div>\n <div bsThumb [style.background]=\"resultBackground()\"></div>\n</bs-slider>\n", 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: ["disabled", "value", "ariaLabel", "valueScale", "valueUnit"], outputs: ["valueChange"] }, { kind: "directive", type: BsThumbDirective, selector: "[bsThumb]" }, { kind: "directive", type: BsTrackDirective, selector: "[bsTrack]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
344
|
-
}
|
|
345
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsAlphaStripComponent, decorators: [{
|
|
346
|
-
type: Component,
|
|
347
|
-
args: [{ selector: 'bs-alpha-strip', imports: [BsSliderComponent, BsThumbDirective, BsTrackDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<bs-slider [disabled]=\"disabled()\" [value]=\"alpha()\" (valueChange)=\"alpha.set($event)\" ariaLabel=\"Alpha\">\n <div bsTrack class=\"position-absolute w-100\" [style.background]=\"trackGradient()\"></div>\n <div bsThumb [style.background]=\"resultBackground()\"></div>\n</bs-slider>\n", 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"] }]
|
|
348
|
-
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], hs: [{ type: i0.Input, args: [{ isSignal: true, alias: "hs", required: false }] }, { type: i0.Output, args: ["hsChange"] }], brightness: [{ type: i0.Input, args: [{ isSignal: true, alias: "brightness", required: false }] }, { type: i0.Output, args: ["brightnessChange"] }], alpha: [{ type: i0.Input, args: [{ isSignal: true, alias: "alpha", required: false }] }, { type: i0.Output, args: ["alphaChange"] }] } });
|
|
349
|
-
|
|
350
|
-
class BsBrightnessStripComponent {
|
|
351
|
-
constructor() {
|
|
352
|
-
this.disabled = input(false, /* @ts-ignore */
|
|
353
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
354
|
-
this.hs = model({ hue: 0, saturation: 0 }, /* @ts-ignore */
|
|
355
|
-
...(ngDevMode ? [{ debugName: "hs" }] : /* istanbul ignore next */ []));
|
|
356
|
-
this.brightness = model(1, /* @ts-ignore */
|
|
357
|
-
...(ngDevMode ? [{ debugName: "brightness" }] : /* istanbul ignore next */ []));
|
|
358
|
-
this.trackGradient = computed(() => {
|
|
359
|
-
const hs = this.hs();
|
|
360
|
-
const peak = hsv2rgb({ hue: hs.hue, saturation: hs.saturation, value: 1 });
|
|
361
|
-
return `linear-gradient(to right, #000, rgb(${Math.round(peak.r)}, ${Math.round(peak.g)}, ${Math.round(peak.b)}))`;
|
|
362
|
-
}, /* @ts-ignore */
|
|
363
|
-
...(ngDevMode ? [{ debugName: "trackGradient" }] : /* istanbul ignore next */ []));
|
|
364
|
-
this.resultBackground = computed(() => {
|
|
365
|
-
const hs = this.hs();
|
|
366
|
-
const brightness = this.brightness();
|
|
367
|
-
const rgb = hsv2rgb({ hue: hs.hue, saturation: hs.saturation, value: brightness });
|
|
368
|
-
return `rgb(${Math.round(rgb.r)}, ${Math.round(rgb.g)}, ${Math.round(rgb.b)})`;
|
|
369
|
-
}, /* @ts-ignore */
|
|
370
|
-
...(ngDevMode ? [{ debugName: "resultBackground" }] : /* istanbul ignore next */ []));
|
|
371
|
-
}
|
|
372
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsBrightnessStripComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
373
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: BsBrightnessStripComponent, isStandalone: true, selector: "bs-brightness-strip", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, hs: { classPropertyName: "hs", publicName: "hs", isSignal: true, isRequired: false, transformFunction: null }, brightness: { classPropertyName: "brightness", publicName: "brightness", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hs: "hsChange", brightness: "brightnessChange" }, ngImport: i0, template: "<bs-slider [disabled]=\"disabled()\" [value]=\"brightness()\" (valueChange)=\"brightness.set($event)\" ariaLabel=\"Brightness\">\n <div bsTrack class=\"position-absolute w-100\" [style.background]=\"trackGradient()\"></div>\n <div bsThumb [style.background]=\"resultBackground()\"></div>\n</bs-slider>\n", styles: [""], dependencies: [{ kind: "component", type: BsSliderComponent, selector: "bs-slider", inputs: ["disabled", "value", "ariaLabel", "valueScale", "valueUnit"], outputs: ["valueChange"] }, { kind: "directive", type: BsThumbDirective, selector: "[bsThumb]" }, { kind: "directive", type: BsTrackDirective, selector: "[bsTrack]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
374
|
-
}
|
|
375
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsBrightnessStripComponent, decorators: [{
|
|
376
|
-
type: Component,
|
|
377
|
-
args: [{ selector: 'bs-brightness-strip', imports: [BsSliderComponent, BsThumbDirective, BsTrackDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<bs-slider [disabled]=\"disabled()\" [value]=\"brightness()\" (valueChange)=\"brightness.set($event)\" ariaLabel=\"Brightness\">\n <div bsTrack class=\"position-absolute w-100\" [style.background]=\"trackGradient()\"></div>\n <div bsThumb [style.background]=\"resultBackground()\"></div>\n</bs-slider>\n" }]
|
|
378
|
-
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], hs: [{ type: i0.Input, args: [{ isSignal: true, alias: "hs", required: false }] }, { type: i0.Output, args: ["hsChange"] }], brightness: [{ type: i0.Input, args: [{ isSignal: true, alias: "brightness", required: false }] }, { type: i0.Output, args: ["brightnessChange"] }] } });
|
|
379
|
-
|
|
380
|
-
class BsColorPickerValueAccessor {
|
|
381
|
-
constructor() {
|
|
382
|
-
this.host = inject(BsColorPickerComponent);
|
|
383
|
-
this.host.userChanged.pipe(takeUntilDestroyed()).subscribe(() => this.emit());
|
|
384
|
-
}
|
|
385
|
-
emit() {
|
|
386
|
-
this.onTouched?.();
|
|
387
|
-
if (!this.onValueChange)
|
|
388
|
-
return;
|
|
389
|
-
const hs = this.host.hs();
|
|
390
|
-
const brightness = this.host.brightness();
|
|
391
|
-
const rgb = hsv2rgb({ hue: hs.hue, saturation: hs.saturation, value: brightness });
|
|
392
|
-
this.onValueChange(rgb2hex(rgb));
|
|
34
|
+
this.viewValue.set(value);
|
|
35
|
+
this.onChange(value);
|
|
36
|
+
});
|
|
37
|
+
this.destroyRef.onDestroy(() => sub.unsubscribe());
|
|
393
38
|
}
|
|
394
39
|
registerOnChange(fn) {
|
|
395
|
-
this.
|
|
40
|
+
this.bound.set(true);
|
|
41
|
+
this.onChange = fn;
|
|
396
42
|
}
|
|
397
43
|
registerOnTouched(fn) {
|
|
398
44
|
this.onTouched = fn;
|
|
399
45
|
}
|
|
400
46
|
writeValue(value) {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
this.host.hs.set({ hue: hsv.hue, saturation: hsv.saturation });
|
|
405
|
-
this.host.brightness.set(hsv.value);
|
|
47
|
+
// An empty control keeps the color the picker shows.
|
|
48
|
+
if (value)
|
|
49
|
+
this.viewValue.set(normalizeHex(value));
|
|
406
50
|
}
|
|
407
51
|
setDisabledState(isDisabled) {
|
|
408
|
-
this.
|
|
52
|
+
this.disabled.set(isDisabled);
|
|
409
53
|
}
|
|
410
54
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsColorPickerValueAccessor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
411
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsColorPickerValueAccessor, isStandalone: true,
|
|
412
|
-
provide: NG_VALUE_ACCESSOR,
|
|
413
|
-
useExisting: forwardRef(() => BsColorPickerValueAccessor),
|
|
414
|
-
multi: true
|
|
415
|
-
}], exportAs: ["bsColorPicker"], ngImport: i0 }); }
|
|
55
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsColorPickerValueAccessor, isStandalone: true, host: { listeners: { "focusout": "onTouched()" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsColorPickerValueAccessor), multi: true }], ngImport: i0 }); }
|
|
416
56
|
}
|
|
417
57
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsColorPickerValueAccessor, decorators: [{
|
|
418
58
|
type: Directive,
|
|
419
59
|
args: [{
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
multi: true
|
|
425
|
-
}],
|
|
426
|
-
exportAs: 'bsColorPicker'
|
|
60
|
+
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsColorPickerValueAccessor), multi: true }],
|
|
61
|
+
host: {
|
|
62
|
+
'(focusout)': 'onTouched()',
|
|
63
|
+
},
|
|
427
64
|
}]
|
|
428
|
-
}]
|
|
429
|
-
|
|
430
|
-
class BsColorWheelComponent {
|
|
431
|
-
constructor() {
|
|
432
|
-
this.surface = viewChild.required('surface', /* @ts-ignore */
|
|
433
|
-
...(ngDevMode ? [{ debugName: "surface" }] : /* istanbul ignore next */ []));
|
|
434
|
-
this.width = model(150, /* @ts-ignore */
|
|
435
|
-
...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
436
|
-
this.height = model(150, /* @ts-ignore */
|
|
437
|
-
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
438
|
-
this.brightness = model(1, /* @ts-ignore */
|
|
439
|
-
...(ngDevMode ? [{ debugName: "brightness" }] : /* istanbul ignore next */ []));
|
|
440
|
-
// `model()` exposes a `hsChange` output for [(hs)] / (hsChange) consumers;
|
|
441
|
-
// declaring it explicitly collides in Angular 22 (NG1054). Every `hs.set()`
|
|
442
|
-
// below drives that auto-output, so no manual emit/effect is needed.
|
|
443
|
-
this.hs = model({ hue: 0, saturation: 0 }, /* @ts-ignore */
|
|
444
|
-
...(ngDevMode ? [{ debugName: "hs" }] : /* istanbul ignore next */ []));
|
|
445
|
-
this.disabled = input(false, /* @ts-ignore */
|
|
446
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
447
|
-
this.ariaLabel = input('Color wheel: arrow left and right adjust hue, arrow up and down adjust saturation', /* @ts-ignore */
|
|
448
|
-
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
449
|
-
this.isPointerDown = signal(false, /* @ts-ignore */
|
|
450
|
-
...(ngDevMode ? [{ debugName: "isPointerDown" }] : /* istanbul ignore next */ []));
|
|
451
|
-
this.squareSize = computed(() => Math.min(this.width(), this.height()), /* @ts-ignore */
|
|
452
|
-
...(ngDevMode ? [{ debugName: "squareSize" }] : /* istanbul ignore next */ []));
|
|
453
|
-
this.shiftX = computed(() => Math.max(0, (this.width() - this.height()) / 2), /* @ts-ignore */
|
|
454
|
-
...(ngDevMode ? [{ debugName: "shiftX" }] : /* istanbul ignore next */ []));
|
|
455
|
-
this.shiftY = computed(() => Math.max(0, (this.height() - this.width()) / 2), /* @ts-ignore */
|
|
456
|
-
...(ngDevMode ? [{ debugName: "shiftY" }] : /* istanbul ignore next */ []));
|
|
457
|
-
this.outerRadius = computed(() => this.squareSize() / 2, /* @ts-ignore */
|
|
458
|
-
...(ngDevMode ? [{ debugName: "outerRadius" }] : /* istanbul ignore next */ []));
|
|
459
|
-
this.overlayOpacity = computed(() => 1 - this.brightness(), /* @ts-ignore */
|
|
460
|
-
...(ngDevMode ? [{ debugName: "overlayOpacity" }] : /* istanbul ignore next */ []));
|
|
461
|
-
this.ariaValueText = computed(() => {
|
|
462
|
-
const hs = this.hs();
|
|
463
|
-
return `Hue ${Math.round(hs.hue)}°, saturation ${Math.round(hs.saturation * 100)}%`;
|
|
464
|
-
}, /* @ts-ignore */
|
|
465
|
-
...(ngDevMode ? [{ debugName: "ariaValueText" }] : /* istanbul ignore next */ []));
|
|
466
|
-
this.markerPosition = computed(() => {
|
|
467
|
-
const hs = this.hs();
|
|
468
|
-
const radius = this.outerRadius();
|
|
469
|
-
const cx = this.shiftX() + radius;
|
|
470
|
-
const cy = this.shiftY() + radius;
|
|
471
|
-
const { dx, dy } = hs2polar(hs.hue, hs.saturation, radius);
|
|
472
|
-
return { x: cx + dx, y: cy + dy };
|
|
473
|
-
}, /* @ts-ignore */
|
|
474
|
-
...(ngDevMode ? [{ debugName: "markerPosition" }] : /* istanbul ignore next */ []));
|
|
475
|
-
}
|
|
476
|
-
onPointerDown(ev) {
|
|
477
|
-
if (this.disabled())
|
|
478
|
-
return;
|
|
479
|
-
if (!('touches' in ev))
|
|
480
|
-
ev.preventDefault();
|
|
481
|
-
ev.stopPropagation();
|
|
482
|
-
this.isPointerDown.set(true);
|
|
483
|
-
this.updateColor(ev);
|
|
484
|
-
}
|
|
485
|
-
onPointerMove(ev) {
|
|
486
|
-
if (!this.isPointerDown())
|
|
487
|
-
return;
|
|
488
|
-
if (!('touches' in ev))
|
|
489
|
-
ev.preventDefault();
|
|
490
|
-
ev.stopPropagation();
|
|
491
|
-
this.updateColor(ev);
|
|
492
|
-
}
|
|
493
|
-
onPointerUp(_ev) {
|
|
494
|
-
this.isPointerDown.set(false);
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Keyboard model for the 2-D wheel:
|
|
498
|
-
* ArrowLeft / ArrowRight → -5° / +5° hue (Shift: 1° for "fine")
|
|
499
|
-
* ArrowDown / ArrowUp → -5% / +5% saturation (Shift: 1% for "fine")
|
|
500
|
-
* PageDown / PageUp → -30° / +30° hue
|
|
501
|
-
* Home / End → saturation 100% / 0%
|
|
502
|
-
*
|
|
503
|
-
* Hue wraps around; saturation clamps. Sighted-keyboard users get the same
|
|
504
|
-
* wheel as mouse users; blind users typically prefer the channel sliders
|
|
505
|
-
* (toggleable in bs-color-picker), since aria-valuetext on a 2-D widget is
|
|
506
|
-
* harder to spatialise than two 1-D sliders.
|
|
507
|
-
*/
|
|
508
|
-
onKeydown(ev) {
|
|
509
|
-
if (this.disabled())
|
|
510
|
-
return;
|
|
511
|
-
const cur = this.hs();
|
|
512
|
-
const hueStep = ev.shiftKey ? 1 : 5;
|
|
513
|
-
const satStep = ev.shiftKey ? 0.01 : 0.05;
|
|
514
|
-
let nextHue = cur.hue;
|
|
515
|
-
let nextSat = cur.saturation;
|
|
516
|
-
switch (ev.key) {
|
|
517
|
-
case 'ArrowRight':
|
|
518
|
-
nextHue = (cur.hue + hueStep) % 360;
|
|
519
|
-
break;
|
|
520
|
-
case 'ArrowLeft':
|
|
521
|
-
nextHue = (cur.hue - hueStep + 360) % 360;
|
|
522
|
-
break;
|
|
523
|
-
case 'ArrowUp':
|
|
524
|
-
nextSat = Math.min(1, cur.saturation + satStep);
|
|
525
|
-
break;
|
|
526
|
-
case 'ArrowDown':
|
|
527
|
-
nextSat = Math.max(0, cur.saturation - satStep);
|
|
528
|
-
break;
|
|
529
|
-
case 'PageUp':
|
|
530
|
-
nextHue = (cur.hue + 30) % 360;
|
|
531
|
-
break;
|
|
532
|
-
case 'PageDown':
|
|
533
|
-
nextHue = (cur.hue - 30 + 360) % 360;
|
|
534
|
-
break;
|
|
535
|
-
case 'Home':
|
|
536
|
-
nextSat = 1;
|
|
537
|
-
break;
|
|
538
|
-
case 'End':
|
|
539
|
-
nextSat = 0;
|
|
540
|
-
break;
|
|
541
|
-
default:
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
|
-
ev.preventDefault();
|
|
545
|
-
if (nextHue !== cur.hue || nextSat !== cur.saturation) {
|
|
546
|
-
this.hs.set({ hue: nextHue, saturation: nextSat });
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
updateColor(ev) {
|
|
550
|
-
const rect = this.surface().nativeElement.getBoundingClientRect();
|
|
551
|
-
const clientX = 'touches' in ev ? ev.touches[0].clientX : ev.clientX;
|
|
552
|
-
const clientY = 'touches' in ev ? ev.touches[0].clientY : ev.clientY;
|
|
553
|
-
const radius = this.outerRadius();
|
|
554
|
-
const dx = clientX - rect.left - radius;
|
|
555
|
-
const dy = clientY - rect.top - radius;
|
|
556
|
-
const hs = polar2hs(dx, dy, radius);
|
|
557
|
-
this.hs.set(hs);
|
|
558
|
-
}
|
|
559
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsColorWheelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
560
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsColorWheelComponent, isStandalone: true, selector: "bs-color-wheel", inputs: { width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, brightness: { classPropertyName: "brightness", publicName: "brightness", isSignal: true, isRequired: false, transformFunction: null }, hs: { classPropertyName: "hs", publicName: "hs", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { width: "widthChange", height: "heightChange", brightness: "brightnessChange", hs: "hsChange" }, host: { attributes: { "role": "application" }, listeners: { "document:mousemove": "onPointerMove($event)", "document:mouseup": "onPointerUp($event)", "keydown": "onKeydown($event)" }, properties: { "attr.aria-label": "ariaLabel()", "attr.aria-valuetext": "ariaValueText()", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.tabindex": "disabled() ? -1 : 0" }, classAttribute: "position-relative" }, viewQueries: [{ propertyName: "surface", first: true, predicate: ["surface"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [style.width.px]=\"width()\" [style.height.px]=\"height()\" class=\"position-relative\">\n <div class=\"wheel-surface position-absolute\"\n [style.left.px]=\"shiftX()\"\n [style.top.px]=\"shiftY()\"\n [style.width.px]=\"squareSize()\"\n [style.height.px]=\"squareSize()\"\n (mousedown)=\"onPointerDown($event)\"\n (touchstart)=\"onPointerDown($event)\"\n (touchmove)=\"onPointerMove($event)\"\n (touchend)=\"onPointerUp($event)\"\n #surface></div>\n\n <div class=\"brightness-overlay position-absolute pe-none\"\n [style.opacity]=\"overlayOpacity()\"\n [style.left.px]=\"shiftX()\"\n [style.top.px]=\"shiftY()\"\n [style.width.px]=\"squareSize()\"\n [style.height.px]=\"squareSize()\"></div>\n\n @if (markerPosition(); as markerPosition) {\n <div class=\"marker position-absolute pe-none\" [style.left.px]=\"markerPosition.x\" [style.top.px]=\"markerPosition.y\"></div>\n }\n</div>\n", styles: [".wheel-surface{border-radius:50%;background:radial-gradient(circle closest-side,#fff,transparent),conic-gradient(from 90deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red);touch-action:none;cursor:crosshair}.brightness-overlay{background:#000;border-radius:50%;transition:opacity 60ms linear}.marker{width:30px;height:30px;border-radius:15px;margin-top:-15px;margin-left:-15px;box-sizing:border-box;border:2px solid var(--bs-body-bg);box-shadow:#0000001a 0 0 10px 5px;pointer-events:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
561
|
-
}
|
|
562
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsColorWheelComponent, decorators: [{
|
|
563
|
-
type: Component,
|
|
564
|
-
args: [{ selector: 'bs-color-wheel', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
565
|
-
'class': 'position-relative',
|
|
566
|
-
'role': 'application',
|
|
567
|
-
'[attr.aria-label]': 'ariaLabel()',
|
|
568
|
-
'[attr.aria-valuetext]': 'ariaValueText()',
|
|
569
|
-
'[attr.aria-disabled]': 'disabled() ? "true" : null',
|
|
570
|
-
'[attr.tabindex]': 'disabled() ? -1 : 0',
|
|
571
|
-
'(document:mousemove)': 'onPointerMove($event)',
|
|
572
|
-
'(document:mouseup)': 'onPointerUp($event)',
|
|
573
|
-
'(keydown)': 'onKeydown($event)',
|
|
574
|
-
}, template: "<div [style.width.px]=\"width()\" [style.height.px]=\"height()\" class=\"position-relative\">\n <div class=\"wheel-surface position-absolute\"\n [style.left.px]=\"shiftX()\"\n [style.top.px]=\"shiftY()\"\n [style.width.px]=\"squareSize()\"\n [style.height.px]=\"squareSize()\"\n (mousedown)=\"onPointerDown($event)\"\n (touchstart)=\"onPointerDown($event)\"\n (touchmove)=\"onPointerMove($event)\"\n (touchend)=\"onPointerUp($event)\"\n #surface></div>\n\n <div class=\"brightness-overlay position-absolute pe-none\"\n [style.opacity]=\"overlayOpacity()\"\n [style.left.px]=\"shiftX()\"\n [style.top.px]=\"shiftY()\"\n [style.width.px]=\"squareSize()\"\n [style.height.px]=\"squareSize()\"></div>\n\n @if (markerPosition(); as markerPosition) {\n <div class=\"marker position-absolute pe-none\" [style.left.px]=\"markerPosition.x\" [style.top.px]=\"markerPosition.y\"></div>\n }\n</div>\n", styles: [".wheel-surface{border-radius:50%;background:radial-gradient(circle closest-side,#fff,transparent),conic-gradient(from 90deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red);touch-action:none;cursor:crosshair}.brightness-overlay{background:#000;border-radius:50%;transition:opacity 60ms linear}.marker{width:30px;height:30px;border-radius:15px;margin-top:-15px;margin-left:-15px;box-sizing:border-box;border:2px solid var(--bs-body-bg);box-shadow:#0000001a 0 0 10px 5px;pointer-events:none}\n"] }]
|
|
575
|
-
}], propDecorators: { surface: [{ type: i0.ViewChild, args: ['surface', { isSignal: true }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }, { type: i0.Output, args: ["widthChange"] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }, { type: i0.Output, args: ["heightChange"] }], brightness: [{ type: i0.Input, args: [{ isSignal: true, alias: "brightness", required: false }] }, { type: i0.Output, args: ["brightnessChange"] }], hs: [{ type: i0.Input, args: [{ isSignal: true, alias: "hs", required: false }] }, { type: i0.Output, args: ["hsChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
* Hue picker — a horizontal rainbow strip backed by `bs-slider`. Two-way
|
|
579
|
-
* `[(hs)]` keeps the saturation untouched; only `hs.hue` (0–360°) changes.
|
|
580
|
-
* Inherits the slider's APG keyboard model (Arrow keys, Home/End, PageUp/Down).
|
|
581
|
-
*/
|
|
582
|
-
class BsHueStripComponent {
|
|
583
|
-
constructor() {
|
|
584
|
-
this.disabled = input(false, /* @ts-ignore */
|
|
585
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
586
|
-
this.hs = model({ hue: 0, saturation: 0 }, /* @ts-ignore */
|
|
587
|
-
...(ngDevMode ? [{ debugName: "hs" }] : /* istanbul ignore next */ []));
|
|
588
|
-
/** Hue normalized to 0..1 for the underlying bs-slider (which works in 0..1). */
|
|
589
|
-
this.normalizedHue = computed(() => this.hs().hue / 360, /* @ts-ignore */
|
|
590
|
-
...(ngDevMode ? [{ debugName: "normalizedHue" }] : /* istanbul ignore next */ []));
|
|
591
|
-
/** Rainbow gradient — every hue at full saturation/lightness. */
|
|
592
|
-
this.trackGradient = 'linear-gradient(to right,' +
|
|
593
|
-
' hsl(0, 100%, 50%),' +
|
|
594
|
-
' hsl(60, 100%, 50%),' +
|
|
595
|
-
' hsl(120, 100%, 50%),' +
|
|
596
|
-
' hsl(180, 100%, 50%),' +
|
|
597
|
-
' hsl(240, 100%, 50%),' +
|
|
598
|
-
' hsl(300, 100%, 50%),' +
|
|
599
|
-
' hsl(360, 100%, 50%))';
|
|
600
|
-
this.thumbBackground = computed(() => `hsl(${Math.round(this.hs().hue)}, 100%, 50%)`, /* @ts-ignore */
|
|
601
|
-
...(ngDevMode ? [{ debugName: "thumbBackground" }] : /* istanbul ignore next */ []));
|
|
602
|
-
}
|
|
603
|
-
onValueChange(v) {
|
|
604
|
-
this.hs.set({ ...this.hs(), hue: v * 360 });
|
|
605
|
-
}
|
|
606
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsHueStripComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
607
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: BsHueStripComponent, isStandalone: true, selector: "bs-hue-strip", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, hs: { classPropertyName: "hs", publicName: "hs", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hs: "hsChange" }, ngImport: i0, template: "<bs-slider [disabled]=\"disabled()\" [value]=\"normalizedHue()\" (valueChange)=\"onValueChange($event)\" ariaLabel=\"Hue\" [valueScale]=\"360\" valueUnit=\"\u00B0\">\n <div bsTrack class=\"position-absolute w-100\" [style.background]=\"trackGradient\"></div>\n <div bsThumb [style.background]=\"thumbBackground()\"></div>\n</bs-slider>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: BsSliderComponent, selector: "bs-slider", inputs: ["disabled", "value", "ariaLabel", "valueScale", "valueUnit"], outputs: ["valueChange"] }, { kind: "directive", type: BsThumbDirective, selector: "[bsThumb]" }, { kind: "directive", type: BsTrackDirective, selector: "[bsTrack]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
608
|
-
}
|
|
609
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsHueStripComponent, decorators: [{
|
|
610
|
-
type: Component,
|
|
611
|
-
args: [{ selector: 'bs-hue-strip', imports: [BsSliderComponent, BsThumbDirective, BsTrackDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<bs-slider [disabled]=\"disabled()\" [value]=\"normalizedHue()\" (valueChange)=\"onValueChange($event)\" ariaLabel=\"Hue\" [valueScale]=\"360\" valueUnit=\"\u00B0\">\n <div bsTrack class=\"position-absolute w-100\" [style.background]=\"trackGradient\"></div>\n <div bsThumb [style.background]=\"thumbBackground()\"></div>\n</bs-slider>\n", styles: [":host{display:block}\n"] }]
|
|
612
|
-
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], hs: [{ type: i0.Input, args: [{ isSignal: true, alias: "hs", required: false }] }, { type: i0.Output, args: ["hsChange"] }] } });
|
|
65
|
+
}] });
|
|
613
66
|
|
|
614
|
-
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
* (0–1) changes. The track gradient re-derives from the current hue so the
|
|
618
|
-
* preview always matches what the user is about to pick.
|
|
67
|
+
/*
|
|
68
|
+
* The Angular extension of the generated `bs-color-picker` (#458 D10 escape hatch): Angular
|
|
69
|
+
* forms. A bound form control drives the color, and a disabled control disables the picker.
|
|
619
70
|
*/
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
this.thumbBackground = computed(() => {
|
|
632
|
-
const hue = Math.round(this.hs().hue);
|
|
633
|
-
const sat = Math.round(this.hs().saturation * 100);
|
|
634
|
-
return `hsl(${hue}, ${sat}%, 50%)`;
|
|
635
|
-
}, /* @ts-ignore */
|
|
636
|
-
...(ngDevMode ? [{ debugName: "thumbBackground" }] : /* istanbul ignore next */ []));
|
|
637
|
-
}
|
|
638
|
-
onValueChange(v) {
|
|
639
|
-
this.hs.set({ ...this.hs(), saturation: v });
|
|
640
|
-
}
|
|
641
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsSaturationStripComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
642
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: BsSaturationStripComponent, isStandalone: true, selector: "bs-saturation-strip", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, hs: { classPropertyName: "hs", publicName: "hs", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hs: "hsChange" }, ngImport: i0, template: "<bs-slider [disabled]=\"disabled()\" [value]=\"hs().saturation\" (valueChange)=\"onValueChange($event)\" ariaLabel=\"Saturation\">\n <div bsTrack class=\"position-absolute w-100\" [style.background]=\"trackGradient()\"></div>\n <div bsThumb [style.background]=\"thumbBackground()\"></div>\n</bs-slider>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: BsSliderComponent, selector: "bs-slider", inputs: ["disabled", "value", "ariaLabel", "valueScale", "valueUnit"], outputs: ["valueChange"] }, { kind: "directive", type: BsThumbDirective, selector: "[bsThumb]" }, { kind: "directive", type: BsTrackDirective, selector: "[bsTrack]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
71
|
+
const hostDirectives = [BsColorPickerValueAccessor];
|
|
72
|
+
function extendInputs(inputs) {
|
|
73
|
+
const accessor = inject(BsColorPickerValueAccessor, { self: true });
|
|
74
|
+
return computed(() => {
|
|
75
|
+
const value = inputs();
|
|
76
|
+
return {
|
|
77
|
+
...value,
|
|
78
|
+
value: accessor.bound() ? accessor.viewValue() : value.value,
|
|
79
|
+
disabled: value.disabled || accessor.disabled(),
|
|
80
|
+
};
|
|
81
|
+
});
|
|
643
82
|
}
|
|
644
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsSaturationStripComponent, decorators: [{
|
|
645
|
-
type: Component,
|
|
646
|
-
args: [{ selector: 'bs-saturation-strip', imports: [BsSliderComponent, BsThumbDirective, BsTrackDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<bs-slider [disabled]=\"disabled()\" [value]=\"hs().saturation\" (valueChange)=\"onValueChange($event)\" ariaLabel=\"Saturation\">\n <div bsTrack class=\"position-absolute w-100\" [style.background]=\"trackGradient()\"></div>\n <div bsThumb [style.background]=\"thumbBackground()\"></div>\n</bs-slider>\n", styles: [":host{display:block}\n"] }]
|
|
647
|
-
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], hs: [{ type: i0.Input, args: [{ isSignal: true, alias: "hs", required: false }] }, { type: i0.Output, args: ["hsChange"] }] } });
|
|
648
83
|
|
|
84
|
+
// GENERATED from the color-picker manifest (color-picker) by @mintplayer/nx-component-compiler. Do not edit.
|
|
85
|
+
/** A hue/saturation wheel over brightness and alpha sliders, with an optional pair of hue and saturation sliders. `value` (hex), `alpha` and `channelSlidersVisible` are two-way. */
|
|
649
86
|
class BsColorPickerComponent {
|
|
87
|
+
#core;
|
|
650
88
|
constructor() {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
this.
|
|
654
|
-
...(ngDevMode ? [{ debugName: "
|
|
655
|
-
this.disabled = signal(false, /* @ts-ignore */
|
|
656
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
657
|
-
this.allowAlpha = input(true, /* @ts-ignore */
|
|
658
|
-
...(ngDevMode ? [{ debugName: "allowAlpha" }] : /* istanbul ignore next */ []));
|
|
659
|
-
/**
|
|
660
|
-
* When true (default), a "Show hue + saturation sliders" toggle is rendered
|
|
661
|
-
* below the picker. Toggling it reveals dedicated 1-D sliders for hue and
|
|
662
|
-
* saturation alongside the existing brightness/alpha strips, giving keyboard
|
|
663
|
-
* and screen-reader users a 1-D path for every channel without having to
|
|
664
|
-
* spatialise the 2-D wheel. Set to false to hide both the toggle and the
|
|
665
|
-
* channel sliders entirely (e.g. when the consuming app provides its own
|
|
666
|
-
* accessibility settings UI).
|
|
667
|
-
*/
|
|
668
|
-
this.showAccessibilityToggle = input(true, /* @ts-ignore */
|
|
669
|
-
...(ngDevMode ? [{ debugName: "showAccessibilityToggle" }] : /* istanbul ignore next */ []));
|
|
670
|
-
this.channelSlidersVisible = model(false, /* @ts-ignore */
|
|
671
|
-
...(ngDevMode ? [{ debugName: "channelSlidersVisible" }] : /* istanbul ignore next */ []));
|
|
672
|
-
this.hs = signal({ hue: 0, saturation: 0 }, /* @ts-ignore */
|
|
673
|
-
...(ngDevMode ? [{ debugName: "hs" }] : /* istanbul ignore next */ []));
|
|
674
|
-
this.brightness = signal(1, /* @ts-ignore */
|
|
675
|
-
...(ngDevMode ? [{ debugName: "brightness" }] : /* istanbul ignore next */ []));
|
|
89
|
+
/** The host element. */
|
|
90
|
+
this.elementRef = inject(ElementRef);
|
|
91
|
+
this.value = model('#ffffff', /* @ts-ignore */
|
|
92
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
676
93
|
this.alpha = model(1, /* @ts-ignore */
|
|
677
94
|
...(ngDevMode ? [{ debugName: "alpha" }] : /* istanbul ignore next */ []));
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
this.
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
this.
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
this.alpha.set(alpha);
|
|
695
|
-
this.userChanged.next();
|
|
95
|
+
this.channelSlidersVisible = model(false, /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "channelSlidersVisible" }] : /* istanbul ignore next */ []));
|
|
97
|
+
/** The wheel's diameter and the sliders' width, in pixels. */
|
|
98
|
+
this.size = input(150, { ...(ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {}), transform: (v) => numberAttribute(v) });
|
|
99
|
+
this.allowAlpha = input(true, { ...(ngDevMode ? { debugName: "allowAlpha" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
100
|
+
/** Renders the switch that reveals the hue and saturation sliders. */
|
|
101
|
+
this.showAccessibilityToggle = input(true, { ...(ngDevMode ? { debugName: "showAccessibilityToggle" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
102
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
103
|
+
/** Localized accessible names; missing keys keep the English defaults. */
|
|
104
|
+
this.labels = input(null, /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
106
|
+
this.#core = useCore(colorPickerCore, { inputs: extendInputs(() => ({ value: this.value(), alpha: this.alpha(), channelSlidersVisible: this.channelSlidersVisible(), size: this.size(), allowAlpha: this.allowAlpha(), showAccessibilityToggle: this.showAccessibilityToggle(), disabled: this.disabled(), labels: this.labels() })), idPrefix: 'bs-color-picker', hostBag: (props) => ({ ...props.view.root, 'data-mps': 'color-picker' }), models: { value: this.value, alpha: this.alpha, channelSlidersVisible: this.channelSlidersVisible } });
|
|
107
|
+
/** The template's props. */
|
|
108
|
+
this.props = this.#core.props;
|
|
109
|
+
useScopedStyles(bootstrapForms.key, bootstrapForms.css, { order: bootstrapForms.order });
|
|
110
|
+
useScopedStyles('color-picker', colorPickerScopedStyles);
|
|
696
111
|
}
|
|
697
112
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsColorPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
698
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsColorPickerComponent, isStandalone: true, selector: "bs-color-picker", inputs: {
|
|
113
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsColorPickerComponent, isStandalone: true, selector: "bs-color-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, alpha: { classPropertyName: "alpha", publicName: "alpha", isSignal: true, isRequired: false, transformFunction: null }, channelSlidersVisible: { classPropertyName: "channelSlidersVisible", publicName: "channelSlidersVisible", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, allowAlpha: { classPropertyName: "allowAlpha", publicName: "allowAlpha", isSignal: true, isRequired: false, transformFunction: null }, showAccessibilityToggle: { classPropertyName: "showAccessibilityToggle", publicName: "showAccessibilityToggle", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", alpha: "alphaChange", channelSlidersVisible: "channelSlidersVisibleChange" }, hostDirectives: [{ directive: BsColorPickerValueAccessor }], ngImport: i0, template: "<!-- GENERATED from libs/mintplayer-ui-core/color-picker/src/templates/color-picker.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"color-picker\" [mpProps]=\"p_view.frame\" [style]=\"p_view.frameStyle\">\n <div data-mps=\"color-picker\" [mpProps]=\"p_view.wheel\">\n <div data-mps=\"color-picker\" class=\"color-picker-darken\"></div>\n <div data-mps=\"color-picker\" class=\"color-picker-marker\"></div>\n </div>\n <input data-mps=\"color-picker\" [mpProps]=\"p_view.brightness.attrs\" [value]=\"p_view.brightness.value\">\n @if (p_view.alpha) {\n <input data-mps=\"color-picker\" [mpProps]=\"p_view.alpha.attrs\" [value]=\"p_view.alpha.value\">\n }\n @if (p_view.toggle) {\n <div data-mps=\"color-picker\" [mpProps]=\"p_view.toggle.wrapper\">\n <input data-mps=\"color-picker\" [mpProps]=\"p_view.toggle.input\" [checked]=\"p_view.toggle.checked\">\n <label data-mps=\"color-picker\" [mpProps]=\"p_view.toggle.label\">\n {{ p_view.toggle.text }}\n </label>\n </div>\n }\n @if (p_view.hue) {\n <input data-mps=\"color-picker\" [mpProps]=\"p_view.hue.attrs\" [value]=\"p_view.hue.value\">\n }\n @if (p_view.saturation) {\n <input data-mps=\"color-picker\" [mpProps]=\"p_view.saturation.attrs\" [value]=\"p_view.saturation.value\">\n }\n</div>\n", dependencies: [{ kind: "directive", type: MpPropsDirective, selector: "[mpProps],[mpHostAttrs]", inputs: ["mpProps", "mpHostAttrs"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
699
114
|
}
|
|
700
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsColorPickerComponent, decorators: [{
|
|
701
116
|
type: Component,
|
|
702
|
-
args: [{ selector: 'bs-color-picker', imports: [
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
BsCheckboxComponent,
|
|
709
|
-
FormsModule,
|
|
710
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [BsColorPickerValueAccessor], template: "@let letDisabled = disabled();\n@let letHS = hs();\n@let letBrightness = brightness();\n@let letAlpha = alpha();\n\n<bs-color-wheel [disabled]=\"letDisabled\" [hs]=\"letHS\" (hsChange)=\"onUserHsChange($event)\" [brightness]=\"letBrightness\" [width]=\"size()\" [height]=\"size()\" #wheel></bs-color-wheel>\n<bs-brightness-strip [disabled]=\"letDisabled\" [hs]=\"letHS\" [brightness]=\"letBrightness\" (brightnessChange)=\"onUserBrightnessChange($event)\" class=\"d-block mt-2\" [style.width.px]=\"size()\" #strip></bs-brightness-strip>\n@if (allowAlpha()) {\n <bs-alpha-strip [disabled]=\"letDisabled\" [hs]=\"letHS\" [brightness]=\"letBrightness\" [alpha]=\"letAlpha\" (alphaChange)=\"onUserAlphaChange($event)\" class=\"d-block mt-2\" [style.width.px]=\"size()\" #alphaStrip></bs-alpha-strip>\n}\n@if (showAccessibilityToggle()) {\n <bs-checkbox class=\"mt-2 d-block\" type=\"switch\" [(ngModel)]=\"channelSlidersVisible\" [style.width.px]=\"size()\">Show hue + saturation sliders</bs-checkbox>\n @if (channelSlidersVisible()) {\n <bs-hue-strip [disabled]=\"letDisabled\" [hs]=\"letHS\" (hsChange)=\"onUserHsChange($event)\" class=\"d-block mt-2\" [style.width.px]=\"size()\"></bs-hue-strip>\n <bs-saturation-strip [disabled]=\"letDisabled\" [hs]=\"letHS\" (hsChange)=\"onUserHsChange($event)\" class=\"d-block mt-2\" [style.width.px]=\"size()\"></bs-saturation-strip>\n }\n}\n" }]
|
|
711
|
-
}], propDecorators: { colorWheel: [{ type: i0.ViewChild, args: ['wheel', { isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], allowAlpha: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowAlpha", required: false }] }], showAccessibilityToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAccessibilityToggle", required: false }] }], channelSlidersVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "channelSlidersVisible", required: false }] }, { type: i0.Output, args: ["channelSlidersVisibleChange"] }], alpha: [{ type: i0.Input, args: [{ isSignal: true, alias: "alpha", required: false }] }, { type: i0.Output, args: ["alphaChange"] }] } });
|
|
117
|
+
args: [{ selector: 'bs-color-picker', imports: [MpPropsDirective], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: hostDirectives, template: "<!-- GENERATED from libs/mintplayer-ui-core/color-picker/src/templates/color-picker.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"color-picker\" [mpProps]=\"p_view.frame\" [style]=\"p_view.frameStyle\">\n <div data-mps=\"color-picker\" [mpProps]=\"p_view.wheel\">\n <div data-mps=\"color-picker\" class=\"color-picker-darken\"></div>\n <div data-mps=\"color-picker\" class=\"color-picker-marker\"></div>\n </div>\n <input data-mps=\"color-picker\" [mpProps]=\"p_view.brightness.attrs\" [value]=\"p_view.brightness.value\">\n @if (p_view.alpha) {\n <input data-mps=\"color-picker\" [mpProps]=\"p_view.alpha.attrs\" [value]=\"p_view.alpha.value\">\n }\n @if (p_view.toggle) {\n <div data-mps=\"color-picker\" [mpProps]=\"p_view.toggle.wrapper\">\n <input data-mps=\"color-picker\" [mpProps]=\"p_view.toggle.input\" [checked]=\"p_view.toggle.checked\">\n <label data-mps=\"color-picker\" [mpProps]=\"p_view.toggle.label\">\n {{ p_view.toggle.text }}\n </label>\n </div>\n }\n @if (p_view.hue) {\n <input data-mps=\"color-picker\" [mpProps]=\"p_view.hue.attrs\" [value]=\"p_view.hue.value\">\n }\n @if (p_view.saturation) {\n <input data-mps=\"color-picker\" [mpProps]=\"p_view.saturation.attrs\" [value]=\"p_view.saturation.value\">\n }\n</div>\n" }]
|
|
118
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], alpha: [{ type: i0.Input, args: [{ isSignal: true, alias: "alpha", required: false }] }, { type: i0.Output, args: ["alphaChange"] }], channelSlidersVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "channelSlidersVisible", required: false }] }, { type: i0.Output, args: ["channelSlidersVisibleChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], allowAlpha: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowAlpha", required: false }] }], showAccessibilityToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAccessibilityToggle", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }] } });
|
|
119
|
+
|
|
120
|
+
// GENERATED from the color-picker manifest by @mintplayer/nx-component-compiler. Do not edit.
|
|
121
|
+
|
|
122
|
+
// Generated from @mintplayer/ui-core/color-picker (#458 D10), plus the Angular forms accessor.
|
|
712
123
|
|
|
713
124
|
/**
|
|
714
125
|
* Generated bundle index. Do not edit.
|
|
715
126
|
*/
|
|
716
127
|
|
|
717
|
-
export {
|
|
128
|
+
export { BsColorPickerComponent, BsColorPickerValueAccessor };
|
|
718
129
|
//# sourceMappingURL=mintplayer-ng-bootstrap-color-picker.mjs.map
|