@ids-group-ltd/ids-design-system 0.12.3 → 0.13.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.
- package/CHANGELOG.md +895 -6
- package/components.md +94 -2
- package/docs/agent/INDEX.md +12 -1
- package/docs/agent/charts/chart-colour-which-palette-a-chart-takes.md +9 -0
- package/docs/agent/charts/chart-frame-the-box-a-chart-draws-around-itself.md +12 -0
- package/docs/agent/charts/ds-bar-chart.md +15 -0
- package/docs/agent/charts/ds-column-chart.md +14 -0
- package/docs/agent/charts/ds-config.md +12 -0
- package/docs/agent/charts/ds-donut-chart.md +17 -0
- package/docs/agent/charts/ds-funnel-chart.md +16 -0
- package/docs/agent/charts/ds-line-chart.md +15 -0
- package/docs/agent/forms/ds-button.md +4 -2
- package/docs/agent/forms/ds-number-stepper.md +1 -0
- package/docs/agent/navigation/ds-sidenav-item.md +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +25 -18
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +177 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +58 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +43 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +212 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +10 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +196 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +18 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +311 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +2 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +69 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +388 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +10 -14
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +672 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +5 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +10 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +2 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +18 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +18 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +30 -71
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +10 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +31 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +448 -12
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +17 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +3 -0
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +10 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.13.0.json +530 -0
- package/migrations/0.13.1.json +236 -0
- package/package.json +57 -1
- package/styles/_chart-data-table.scss +95 -0
- package/styles/_chart-frame.scss +68 -0
- package/styles/_chart-interactive.scss +51 -0
- package/styles/_chart-motion.scss +88 -0
- package/styles/_dropdown-overlay.scss +9 -3
- package/styles/_focus.scss +11 -2
- package/styles/_overlay-motion.scss +10 -1
- package/styles/_tokens-charts.scss +154 -39
- package/styles/_tokens.scss +17 -4
- package/themes/dark/_theme.scss +37 -29
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +17 -10
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +119 -0
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +37 -4
- package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +34 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +84 -0
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +125 -0
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +10 -2
- package/types/ids-group-ltd-ids-design-system-components-donut-chart.d.ts +127 -0
- package/types/ids-group-ltd-ids-design-system-components-field-group.d.ts +52 -11
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +128 -0
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +5 -7
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +268 -0
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +11 -3
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +16 -4
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +13 -28
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +11 -1
- package/types/ids-group-ltd-ids-design-system-components.d.ts +171 -5
- package/types/ids-group-ltd-ids-design-system-core.d.ts +36 -2
- package/types/ids-group-ltd-ids-design-system.d.ts +9 -2
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, ChangeDetectionStrategy, ViewEncapsulation, Component, inject, ViewContainerRef, effect, DestroyRef, Directive, signal } from '@angular/core';
|
|
3
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
4
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
5
|
+
import { closeOnScroll } from '@ids-group-ltd/ids-design-system/components';
|
|
6
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
7
|
+
|
|
8
|
+
class ChartTooltipPanelComponent {
|
|
9
|
+
/** The category and the readings the panel prints. */
|
|
10
|
+
context = input.required(...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
|
|
11
|
+
/** The chart's projected `#dsChartTooltip` template. Null renders the built-in rows. */
|
|
12
|
+
template = input(null, ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
|
|
13
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartTooltipPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartTooltipPanelComponent, isStandalone: true, selector: "ds-chart-tooltip-panel", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" } }, ngImport: i0, template: "@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul class=\"entries\">\n @for (entry of context().entries; track entry.label) {\n <li class=\"entry\">\n <span\n class=\"swatch\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n", styles: [":host{--_chart-tooltip-bg-color: var(--ds-chart-tooltip-bg-color);--_chart-tooltip-text-color: var(--ds-chart-tooltip-text-color);--_chart-tooltip-border-color: var(--ds-chart-tooltip-border-color);display:block;background:var(--_chart-tooltip-bg-color);color:var(--_chart-tooltip-text-color);border:var(--border-width-default) solid var(--_chart-tooltip-border-color);border-radius:var(--ds-radius-control);box-shadow:var(--ds-elevation-overlay);padding:var(--space-2) var(--space-2-5);max-width:var(--tooltip-maxw);z-index:var(--layer-tooltip);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);pointer-events:none}.category{margin:0 0 var(--space-1-5);font-weight:var(--font-weight-medium)}.entries{display:grid;gap:var(--space-1);margin:0;padding:0;list-style:none}.entry{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--space-2)}.detail{grid-column:2/-1;margin-block-start:calc(var(--space-1) * -1);color:var(--_chart-tooltip-text-color);opacity:.7;font-size:var(--font-size-2xs)}.swatch{inline-size:var(--space-2);block-size:var(--space-2);border-radius:var(--radius-pill)}.value{font-variant-numeric:tabular-nums;font-weight:var(--font-weight-medium)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
15
|
+
}
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartTooltipPanelComponent, decorators: [{
|
|
17
|
+
type: Component,
|
|
18
|
+
args: [{ selector: 'ds-chart-tooltip-panel', standalone: true, imports: [NgTemplateOutlet], host: {
|
|
19
|
+
// Hidden from assistive technology on purpose: every interactive mark already
|
|
20
|
+
// carries the same label and value in its `aria-label`, so exposing the panel
|
|
21
|
+
// makes a screen reader read each reading twice.
|
|
22
|
+
'aria-hidden': 'true',
|
|
23
|
+
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul class=\"entries\">\n @for (entry of context().entries; track entry.label) {\n <li class=\"entry\">\n <span\n class=\"swatch\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n", styles: [":host{--_chart-tooltip-bg-color: var(--ds-chart-tooltip-bg-color);--_chart-tooltip-text-color: var(--ds-chart-tooltip-text-color);--_chart-tooltip-border-color: var(--ds-chart-tooltip-border-color);display:block;background:var(--_chart-tooltip-bg-color);color:var(--_chart-tooltip-text-color);border:var(--border-width-default) solid var(--_chart-tooltip-border-color);border-radius:var(--ds-radius-control);box-shadow:var(--ds-elevation-overlay);padding:var(--space-2) var(--space-2-5);max-width:var(--tooltip-maxw);z-index:var(--layer-tooltip);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);pointer-events:none}.category{margin:0 0 var(--space-1-5);font-weight:var(--font-weight-medium)}.entries{display:grid;gap:var(--space-1);margin:0;padding:0;list-style:none}.entry{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--space-2)}.detail{grid-column:2/-1;margin-block-start:calc(var(--space-1) * -1);color:var(--_chart-tooltip-text-color);opacity:.7;font-size:var(--font-size-2xs)}.swatch{inline-size:var(--space-2);block-size:var(--space-2);border-radius:var(--radius-pill)}.value{font-variant-numeric:tabular-nums;font-weight:var(--font-weight-medium)}\n"] }]
|
|
24
|
+
}], propDecorators: { context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }] } });
|
|
25
|
+
|
|
26
|
+
const POINTER_GAP_PX = 12;
|
|
27
|
+
// A fingertip covers roughly 40 CSS px, so a touch-opened panel has to clear the tap
|
|
28
|
+
// point by more than a pointer-opened one does.
|
|
29
|
+
const TOUCH_GAP_PX = 48;
|
|
30
|
+
// Above first, then below, then either side: four fallbacks are what make the panel flip
|
|
31
|
+
// out of a small dashboard card rather than be clipped by it.
|
|
32
|
+
function positionsFor(gap) {
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
originX: 'center',
|
|
36
|
+
originY: 'top',
|
|
37
|
+
overlayX: 'center',
|
|
38
|
+
overlayY: 'bottom',
|
|
39
|
+
offsetY: -gap,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
originX: 'center',
|
|
43
|
+
originY: 'bottom',
|
|
44
|
+
overlayX: 'center',
|
|
45
|
+
overlayY: 'top',
|
|
46
|
+
offsetY: gap,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
originX: 'end',
|
|
50
|
+
originY: 'center',
|
|
51
|
+
overlayX: 'start',
|
|
52
|
+
overlayY: 'center',
|
|
53
|
+
offsetX: gap,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
originX: 'start',
|
|
57
|
+
originY: 'center',
|
|
58
|
+
overlayX: 'end',
|
|
59
|
+
overlayY: 'center',
|
|
60
|
+
offsetX: -gap,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The chart tooltip, driven entirely by the context a chart hands it: non-null opens the
|
|
66
|
+
* panel, null closes it. Pointer and keyboard therefore share one path — a chart that
|
|
67
|
+
* sets the context on `focus` gets the panel with no pointer involved.
|
|
68
|
+
*
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
class ChartTooltipDirective {
|
|
72
|
+
overlay = inject(Overlay);
|
|
73
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
74
|
+
dsChartTooltip = input(null, ...(ngDevMode ? [{ debugName: "dsChartTooltip" }] : /* istanbul ignore next */ []));
|
|
75
|
+
dsChartTooltipOrigin = input(null, ...(ngDevMode ? [{ debugName: "dsChartTooltipOrigin" }] : /* istanbul ignore next */ []));
|
|
76
|
+
dsChartTooltipTemplate = input(null, ...(ngDevMode ? [{ debugName: "dsChartTooltipTemplate" }] : /* istanbul ignore next */ []));
|
|
77
|
+
overlayRef = null;
|
|
78
|
+
panelRef = null;
|
|
79
|
+
detachScrollClose = null;
|
|
80
|
+
constructor() {
|
|
81
|
+
effect(() => {
|
|
82
|
+
const context = this.dsChartTooltip();
|
|
83
|
+
const origin = this.dsChartTooltipOrigin();
|
|
84
|
+
if (!context?.entries.length || !origin) {
|
|
85
|
+
this.close();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
this.open(context, origin);
|
|
89
|
+
});
|
|
90
|
+
inject(DestroyRef).onDestroy(() => this.close());
|
|
91
|
+
}
|
|
92
|
+
open(context, origin) {
|
|
93
|
+
// Reposition rather than re-create while the pointer moves between marks: a fresh
|
|
94
|
+
// OverlayRef per mark restarts the enter transition on every band it crosses.
|
|
95
|
+
if (!this.overlayRef) {
|
|
96
|
+
this.overlayRef = this.overlay.create({
|
|
97
|
+
positionStrategy: this.strategyFor(origin),
|
|
98
|
+
panelClass: ['ds-overlay-pane', 'ds-chart-tooltip-pane'],
|
|
99
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
100
|
+
});
|
|
101
|
+
this.panelRef = this.overlayRef.attach(new ComponentPortal(ChartTooltipPanelComponent, this.viewContainerRef));
|
|
102
|
+
// CDK's reposition strategy watches `window` and registered `cdkScrollable`s only, so it
|
|
103
|
+
// misses an app's own `overflow: auto` container — and a panel that stays put while the
|
|
104
|
+
// chart scrolls away points at nothing.
|
|
105
|
+
// Nothing re-opens it: the effect re-runs on a CHANGE to the context or the origin, and a
|
|
106
|
+
// scroll changes neither. The next pointer move does both.
|
|
107
|
+
this.detachScrollClose = closeOnScroll(this.overlayRef, () => this.close());
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
this.overlayRef.updatePositionStrategy(this.strategyFor(origin));
|
|
111
|
+
}
|
|
112
|
+
this.panelRef?.setInput('context', context);
|
|
113
|
+
this.panelRef?.setInput('template', this.dsChartTooltipTemplate());
|
|
114
|
+
}
|
|
115
|
+
strategyFor(origin) {
|
|
116
|
+
const gap = coarsePointer() ? TOUCH_GAP_PX : POINTER_GAP_PX;
|
|
117
|
+
return this.overlay
|
|
118
|
+
.position()
|
|
119
|
+
.flexibleConnectedTo(origin)
|
|
120
|
+
.withFlexibleDimensions(false)
|
|
121
|
+
.withPush(true)
|
|
122
|
+
.withPositions(positionsFor(gap));
|
|
123
|
+
}
|
|
124
|
+
close() {
|
|
125
|
+
this.detachScrollClose?.();
|
|
126
|
+
this.detachScrollClose = null;
|
|
127
|
+
this.overlayRef?.dispose();
|
|
128
|
+
this.overlayRef = null;
|
|
129
|
+
this.panelRef = null;
|
|
130
|
+
}
|
|
131
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
132
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: ChartTooltipDirective, isStandalone: true, selector: "[dsChartTooltip]", inputs: { dsChartTooltip: { classPropertyName: "dsChartTooltip", publicName: "dsChartTooltip", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipOrigin: { classPropertyName: "dsChartTooltipOrigin", publicName: "dsChartTooltipOrigin", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipTemplate: { classPropertyName: "dsChartTooltipTemplate", publicName: "dsChartTooltipTemplate", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
133
|
+
}
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartTooltipDirective, decorators: [{
|
|
135
|
+
type: Directive,
|
|
136
|
+
args: [{
|
|
137
|
+
selector: '[dsChartTooltip]',
|
|
138
|
+
standalone: true,
|
|
139
|
+
}]
|
|
140
|
+
}], ctorParameters: () => [], propDecorators: { dsChartTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltip", required: false }] }], dsChartTooltipOrigin: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipOrigin", required: false }] }], dsChartTooltipTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipTemplate", required: false }] }] } });
|
|
141
|
+
function coarsePointer() {
|
|
142
|
+
return (typeof window !== 'undefined' &&
|
|
143
|
+
window.matchMedia('(pointer: coarse)').matches);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The pointer-and-focus target the tooltip reads, for a chart whose marks are elements.
|
|
148
|
+
* Pointer and keyboard write the same pair, so a chart wires `pointerenter` and `focus` to
|
|
149
|
+
* `enter` and gets one code path rather than two.
|
|
150
|
+
*
|
|
151
|
+
* A TAP LATCHES. A touch fires `pointerleave` the moment the finger lifts, so without this the
|
|
152
|
+
* panel would flash and vanish; latched, it stays until the next tap lands outside the mark. Call
|
|
153
|
+
* from an injection context — the release listener is torn down with the component.
|
|
154
|
+
*
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
function chartActiveMark() {
|
|
158
|
+
const index = signal(-1, ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
159
|
+
const origin = signal(null, ...(ngDevMode ? [{ debugName: "origin" }] : /* istanbul ignore next */ []));
|
|
160
|
+
let latched = false;
|
|
161
|
+
const clear = () => {
|
|
162
|
+
latched = false;
|
|
163
|
+
index.set(-1);
|
|
164
|
+
origin.set(null);
|
|
165
|
+
document.removeEventListener('pointerdown', release, true);
|
|
166
|
+
};
|
|
167
|
+
const release = (event) => {
|
|
168
|
+
const mark = origin();
|
|
169
|
+
if (mark && event.target instanceof Node && mark.contains(event.target)) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
clear();
|
|
173
|
+
};
|
|
174
|
+
if (typeof document !== 'undefined') {
|
|
175
|
+
inject(DestroyRef).onDestroy(() => document.removeEventListener('pointerdown', release, true));
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
index: index.asReadonly(),
|
|
179
|
+
origin: origin.asReadonly(),
|
|
180
|
+
enter(at, event, anchorWithin) {
|
|
181
|
+
const host = event.currentTarget;
|
|
182
|
+
if (host instanceof Element) {
|
|
183
|
+
// The tooltip anchors to the MARK, not to the box that catches the pointer: a column's
|
|
184
|
+
// cell is the full plot height, so anchoring to it opens the panel at the top of the
|
|
185
|
+
// chart rather than over the column it is about.
|
|
186
|
+
const anchor = anchorWithin ? host.querySelector(anchorWithin) : null;
|
|
187
|
+
origin.set(anchor ?? host);
|
|
188
|
+
}
|
|
189
|
+
index.set(at);
|
|
190
|
+
if (typeof document !== 'undefined' &&
|
|
191
|
+
event instanceof PointerEvent &&
|
|
192
|
+
event.pointerType === 'touch') {
|
|
193
|
+
latched = true;
|
|
194
|
+
document.addEventListener('pointerdown', release, true);
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
leave() {
|
|
198
|
+
if (latched) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
index.set(-1);
|
|
202
|
+
origin.set(null);
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Generated bundle index. Do not edit.
|
|
209
|
+
*/
|
|
210
|
+
|
|
211
|
+
export { ChartTooltipDirective, chartActiveMark };
|
|
212
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-chart-tooltip.mjs","sources":["../../../src/lib/components/chart-tooltip/chart-tooltip-panel.component.ts","../../../src/lib/components/chart-tooltip/chart-tooltip-panel.component.html","../../../src/lib/components/chart-tooltip/chart-tooltip.directive.ts","../../../src/lib/components/chart-tooltip/chart-active-mark.ts","../../../src/lib/components/chart-tooltip/ids-group-ltd-ids-design-system-components-chart-tooltip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n input,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport type { ChartTooltipContext } from './chart-tooltip.types';\n\n@Component({\n selector: 'ds-chart-tooltip-panel',\n standalone: true,\n imports: [NgTemplateOutlet],\n templateUrl: './chart-tooltip-panel.component.html',\n styleUrl: './chart-tooltip-panel.component.scss',\n host: {\n // Hidden from assistive technology on purpose: every interactive mark already\n // carries the same label and value in its `aria-label`, so exposing the panel\n // makes a screen reader read each reading twice.\n 'aria-hidden': 'true',\n },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ChartTooltipPanelComponent {\n /** The category and the readings the panel prints. */\n readonly context = input.required<ChartTooltipContext>();\n /** The chart's projected `#dsChartTooltip` template. Null renders the built-in rows. */\n readonly template = input<TemplateRef<{\n $implicit: ChartTooltipContext;\n }> | null>(null);\n}\n","@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul class=\"entries\">\n @for (entry of context().entries; track entry.label) {\n <li class=\"entry\">\n <span\n class=\"swatch\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n","import {\n ComponentRef,\n DestroyRef,\n Directive,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n} from '@angular/core';\nimport {\n ConnectedPosition,\n Overlay,\n OverlayRef,\n type FlexibleConnectedPositionStrategyOrigin,\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { closeOnScroll } from '@ids-group-ltd/ids-design-system/components';\nimport { ChartTooltipPanelComponent } from './chart-tooltip-panel.component';\nimport type {\n ChartTooltipContext,\n ChartTooltipOrigin,\n} from './chart-tooltip.types';\n\nconst POINTER_GAP_PX = 12;\n// A fingertip covers roughly 40 CSS px, so a touch-opened panel has to clear the tap\n// point by more than a pointer-opened one does.\nconst TOUCH_GAP_PX = 48;\n\n// Above first, then below, then either side: four fallbacks are what make the panel flip\n// out of a small dashboard card rather than be clipped by it.\nfunction positionsFor(gap: number): ConnectedPosition[] {\n return [\n {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -gap,\n },\n {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: gap,\n },\n {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: gap,\n },\n {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -gap,\n },\n ];\n}\n\n/**\n * The chart tooltip, driven entirely by the context a chart hands it: non-null opens the\n * panel, null closes it. Pointer and keyboard therefore share one path — a chart that\n * sets the context on `focus` gets the panel with no pointer involved.\n *\n * @internal\n */\n@Directive({\n selector: '[dsChartTooltip]',\n standalone: true,\n})\nexport class ChartTooltipDirective {\n private readonly overlay = inject(Overlay);\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n readonly dsChartTooltip = input<ChartTooltipContext | null>(null);\n readonly dsChartTooltipOrigin = input<ChartTooltipOrigin | null>(null);\n readonly dsChartTooltipTemplate = input<TemplateRef<{\n $implicit: ChartTooltipContext;\n }> | null>(null);\n\n private overlayRef: OverlayRef | null = null;\n private panelRef: ComponentRef<ChartTooltipPanelComponent> | null = null;\n private detachScrollClose: (() => void) | null = null;\n\n constructor() {\n effect(() => {\n const context = this.dsChartTooltip();\n const origin = this.dsChartTooltipOrigin();\n if (!context?.entries.length || !origin) {\n this.close();\n\n return;\n }\n this.open(context, origin);\n });\n inject(DestroyRef).onDestroy(() => this.close());\n }\n\n private open(context: ChartTooltipContext, origin: ChartTooltipOrigin): void {\n // Reposition rather than re-create while the pointer moves between marks: a fresh\n // OverlayRef per mark restarts the enter transition on every band it crosses.\n if (!this.overlayRef) {\n this.overlayRef = this.overlay.create({\n positionStrategy: this.strategyFor(origin),\n panelClass: ['ds-overlay-pane', 'ds-chart-tooltip-pane'],\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n });\n this.panelRef = this.overlayRef.attach(\n new ComponentPortal(ChartTooltipPanelComponent, this.viewContainerRef),\n );\n // CDK's reposition strategy watches `window` and registered `cdkScrollable`s only, so it\n // misses an app's own `overflow: auto` container — and a panel that stays put while the\n // chart scrolls away points at nothing.\n // Nothing re-opens it: the effect re-runs on a CHANGE to the context or the origin, and a\n // scroll changes neither. The next pointer move does both.\n this.detachScrollClose = closeOnScroll(this.overlayRef, () =>\n this.close(),\n );\n } else {\n this.overlayRef.updatePositionStrategy(this.strategyFor(origin));\n }\n this.panelRef?.setInput('context', context);\n this.panelRef?.setInput('template', this.dsChartTooltipTemplate());\n }\n\n private strategyFor(origin: ChartTooltipOrigin) {\n const gap = coarsePointer() ? TOUCH_GAP_PX : POINTER_GAP_PX;\n\n return this.overlay\n .position()\n .flexibleConnectedTo(origin as FlexibleConnectedPositionStrategyOrigin)\n .withFlexibleDimensions(false)\n .withPush(true)\n .withPositions(positionsFor(gap));\n }\n\n private close(): void {\n this.detachScrollClose?.();\n this.detachScrollClose = null;\n this.overlayRef?.dispose();\n this.overlayRef = null;\n this.panelRef = null;\n }\n}\n\nfunction coarsePointer(): boolean {\n return (\n typeof window !== 'undefined' &&\n window.matchMedia('(pointer: coarse)').matches\n );\n}\n","import { DestroyRef, Signal, inject, signal } from '@angular/core';\n\n/** @internal */\nexport interface ChartActiveMark {\n /** Index of the mark under the pointer or holding focus; `-1` when none is. */\n readonly index: Signal<number>;\n /** The mark's own element, which is what the tooltip anchors to. */\n readonly origin: Signal<Element | null>;\n enter(index: number, event: Event, anchorWithin?: string): void;\n leave(): void;\n}\n\n/**\n * The pointer-and-focus target the tooltip reads, for a chart whose marks are elements.\n * Pointer and keyboard write the same pair, so a chart wires `pointerenter` and `focus` to\n * `enter` and gets one code path rather than two.\n *\n * A TAP LATCHES. A touch fires `pointerleave` the moment the finger lifts, so without this the\n * panel would flash and vanish; latched, it stays until the next tap lands outside the mark. Call\n * from an injection context — the release listener is torn down with the component.\n *\n * @internal\n */\nexport function chartActiveMark(): ChartActiveMark {\n const index = signal(-1);\n const origin = signal<Element | null>(null);\n let latched = false;\n\n const clear = (): void => {\n latched = false;\n index.set(-1);\n origin.set(null);\n document.removeEventListener('pointerdown', release, true);\n };\n\n const release = (event: PointerEvent): void => {\n const mark = origin();\n if (mark && event.target instanceof Node && mark.contains(event.target)) {\n return;\n }\n clear();\n };\n\n if (typeof document !== 'undefined') {\n inject(DestroyRef).onDestroy(() =>\n document.removeEventListener('pointerdown', release, true),\n );\n }\n\n return {\n index: index.asReadonly(),\n origin: origin.asReadonly(),\n enter(at, event, anchorWithin) {\n const host = event.currentTarget;\n if (host instanceof Element) {\n // The tooltip anchors to the MARK, not to the box that catches the pointer: a column's\n // cell is the full plot height, so anchoring to it opens the panel at the top of the\n // chart rather than over the column it is about.\n const anchor = anchorWithin ? host.querySelector(anchorWithin) : null;\n origin.set(anchor ?? host);\n }\n index.set(at);\n if (\n typeof document !== 'undefined' &&\n event instanceof PointerEvent &&\n event.pointerType === 'touch'\n ) {\n latched = true;\n document.addEventListener('pointerdown', release, true);\n }\n },\n leave() {\n if (latched) {\n return;\n }\n index.set(-1);\n origin.set(null);\n },\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAyBa,0BAA0B,CAAA;;AAE5B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAuB;;AAE/C,IAAA,QAAQ,GAAG,KAAK,CAEd,IAAI,+EAAC;wGANL,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,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Y,CAAC,GAAG,IAAI;AACrE,gBAAA,MAAM,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC;YAC5B;AACA,YAAA,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACb,IACE,OAAO,QAAQ,KAAK,WAAW;AAC/B,gBAAA,KAAK,YAAY,YAAY;AAC7B,gBAAA,KAAK,CAAC,WAAW,KAAK,OAAO,EAC7B;gBACA,OAAO,GAAG,IAAI;gBACd,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;YACzD;QACF,CAAC;QACD,KAAK,GAAA;YACH,IAAI,OAAO,EAAE;gBACX;YACF;AACA,YAAA,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACb,YAAA,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;QAClB,CAAC;KACF;AACH;;AC/EA;;AAEG;;;;"}
|
|
@@ -33,6 +33,7 @@ class CheckboxComponent extends DsBooleanControlValueAccessor {
|
|
|
33
33
|
controlId = computed(() => this.inputId() ?? this.uid, ...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
34
34
|
hintId = computed(() => this.message().text ? `${this.uid}-hint` : null, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
35
35
|
fieldMessage = resolveFieldMessage({
|
|
36
|
+
disabled: () => this.isDisabled(),
|
|
36
37
|
hint: this.hint,
|
|
37
38
|
warning: this.warning,
|
|
38
39
|
error: this.error,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-checkbox.mjs","sources":["../../../src/lib/components/checkbox/checkbox.component.ts","../../../src/lib/components/checkbox/checkbox.component.html","../../../src/lib/components/checkbox/ids-group-ltd-ids-design-system-components-checkbox.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n model,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DsBooleanControlValueAccessor } from '@ids-group-ltd/ids-design-system/components';\nimport { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';\nimport { resolveFieldMessage } from '@ids-group-ltd/ids-design-system/components';\nimport { nextControlId } from '@ids-group-ltd/ids-design-system/components';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\n\n@Component({\n selector: 'ds-checkbox',\n standalone: true,\n imports: [FieldMessageComponent],\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: { '[attr.data-field-state]': 'controlState()' },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckboxComponent),\n multi: true,\n },\n ],\n})\nexport class CheckboxComponent extends DsBooleanControlValueAccessor {\n /** Checked state, two-way bound. */\n readonly checked = model<boolean>(false);\n /** Shows the partial/mixed visual state — independent of `checked`. */\n readonly indeterminate = input(false, { transform: booleanAttribute });\n /** Disables the checkbox and blocks all interaction. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Native `name` attribute. */\n readonly name = input<string | null>(null);\n /** Overrides the generated id used by the native `<input>` and its `<label for>`. */\n readonly inputId = input<string | null>(null);\n /** Checkbox size — sm/md/lg.\n * Unset falls back to `DS_CONFIG.control.size`, then `'md'`. */\n readonly size = input<DsSize | null>(null);\n readonly sizeResolved = resolveWithConfig(\n this.size,\n (config) => config.control?.size,\n 'md' as DsSize,\n );\n /** Marks the field required — shows an asterisk and sets `aria-required`. */\n readonly required = input(false, { transform: booleanAttribute });\n /** Inline label rendered beside the box and wired via for/id. Omit to\n * bring your own <label>. */\n readonly label = input<string>('');\n /** Accessible name for a control with no visible label — the row's `<label>` collapses when it\n * is empty, leaving nothing to name it. Set beside a label it OVERRIDES the label, per ARIA. */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly isDisabled = computed(\n () => this.disabled() || this.formDisabled(),\n );\n\n protected readonly uid = nextControlId('ds-checkbox');\n protected readonly controlId = computed(() => this.inputId() ?? this.uid);\n protected readonly hintId = computed(() =>\n this.message().text ? `${this.uid}-hint` : null,\n );\n private readonly fieldMessage = resolveFieldMessage({\n hint: this.hint,\n warning: this.warning,\n error: this.error,\n errors: this.errors,\n invalid: this.invalid,\n touchedSelf: this.touchedSelf,\n touched: this.touched,\n });\n protected readonly message = this.fieldMessage.message;\n /** Only name via aria-label when there is no visible `<label for>` to do it. */\n protected readonly resolvedAriaLabel = computed(() =>\n this.label() ? null : this.ariaLabel() || null,\n );\n protected readonly invalidResolved = this.fieldMessage.invalid;\n protected readonly controlState = this.fieldMessage.controlState;\n\n protected readonly fieldClass = computed(\n () => `checkbox-field size-${this.sizeResolved()}`,\n );\n\n protected onCheckedChange(event: Event): void {\n this.checked.set((event.target as HTMLInputElement).checked);\n }\n}\n","<div [class]=\"fieldClass()\">\n <span\n class=\"control-line\"\n [class.is-disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n (change)=\"onCheckedChange($event)\"\n (blur)=\"markTouched()\" />\n\n <label\n class=\"control-text\"\n [attr.for]=\"controlId()\">\n @if (label()) {\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n }\n } @else {\n <ng-content></ng-content>\n }\n </label>\n </span>\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n</div>\n","/**\n * Generated bundle index.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EAAA,QAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAChD;IACgB,YAAY,GAAG,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-checkbox.mjs","sources":["../../../src/lib/components/checkbox/checkbox.component.ts","../../../src/lib/components/checkbox/checkbox.component.html","../../../src/lib/components/checkbox/ids-group-ltd-ids-design-system-components-checkbox.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n model,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DsBooleanControlValueAccessor } from '@ids-group-ltd/ids-design-system/components';\nimport { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';\nimport { resolveFieldMessage } from '@ids-group-ltd/ids-design-system/components';\nimport { nextControlId } from '@ids-group-ltd/ids-design-system/components';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\n\n@Component({\n selector: 'ds-checkbox',\n standalone: true,\n imports: [FieldMessageComponent],\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: { '[attr.data-field-state]': 'controlState()' },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckboxComponent),\n multi: true,\n },\n ],\n})\nexport class CheckboxComponent extends DsBooleanControlValueAccessor {\n /** Checked state, two-way bound. */\n readonly checked = model<boolean>(false);\n /** Shows the partial/mixed visual state — independent of `checked`. */\n readonly indeterminate = input(false, { transform: booleanAttribute });\n /** Disables the checkbox and blocks all interaction. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Native `name` attribute. */\n readonly name = input<string | null>(null);\n /** Overrides the generated id used by the native `<input>` and its `<label for>`. */\n readonly inputId = input<string | null>(null);\n /** Checkbox size — sm/md/lg.\n * Unset falls back to `DS_CONFIG.control.size`, then `'md'`. */\n readonly size = input<DsSize | null>(null);\n readonly sizeResolved = resolveWithConfig(\n this.size,\n (config) => config.control?.size,\n 'md' as DsSize,\n );\n /** Marks the field required — shows an asterisk and sets `aria-required`. */\n readonly required = input(false, { transform: booleanAttribute });\n /** Inline label rendered beside the box and wired via for/id. Omit to\n * bring your own <label>. */\n readonly label = input<string>('');\n /** Accessible name for a control with no visible label — the row's `<label>` collapses when it\n * is empty, leaving nothing to name it. Set beside a label it OVERRIDES the label, per ARIA. */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly isDisabled = computed(\n () => this.disabled() || this.formDisabled(),\n );\n\n protected readonly uid = nextControlId('ds-checkbox');\n protected readonly controlId = computed(() => this.inputId() ?? this.uid);\n protected readonly hintId = computed(() =>\n this.message().text ? `${this.uid}-hint` : null,\n );\n private readonly fieldMessage = resolveFieldMessage({\n disabled: () => this.isDisabled(),\n hint: this.hint,\n warning: this.warning,\n error: this.error,\n errors: this.errors,\n invalid: this.invalid,\n touchedSelf: this.touchedSelf,\n touched: this.touched,\n });\n protected readonly message = this.fieldMessage.message;\n /** Only name via aria-label when there is no visible `<label for>` to do it. */\n protected readonly resolvedAriaLabel = computed(() =>\n this.label() ? null : this.ariaLabel() || null,\n );\n protected readonly invalidResolved = this.fieldMessage.invalid;\n protected readonly controlState = this.fieldMessage.controlState;\n\n protected readonly fieldClass = computed(\n () => `checkbox-field size-${this.sizeResolved()}`,\n );\n\n protected onCheckedChange(event: Event): void {\n this.checked.set((event.target as HTMLInputElement).checked);\n }\n}\n","<div [class]=\"fieldClass()\">\n <span\n class=\"control-line\"\n [class.is-disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n (change)=\"onCheckedChange($event)\"\n (blur)=\"markTouched()\" />\n\n <label\n class=\"control-text\"\n [attr.for]=\"controlId()\">\n @if (label()) {\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n }\n } @else {\n <ng-content></ng-content>\n }\n </label>\n </span>\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAiCM,MAAO,iBAAkB,SAAQ,6BAA6B,CAAA;;AAEzD,IAAA,OAAO,GAAG,KAAK,CAAU,KAAK,8EAAC;;IAE/B,aAAa,GAAG,KAAK,CAAC,KAAK,qFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAE7D,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,IAAA,IAAI,GAAG,KAAK,CAAgB,IAAI,2EAAC;;AAEjC,IAAA,OAAO,GAAG,KAAK,CAAgB,IAAI,8EAAC;AAC7C;AACiE;AACxD,IAAA,IAAI,GAAG,KAAK,CAAgB,IAAI,2EAAC;IACjC,YAAY,GAAG,iBAAiB,CACvC,IAAI,CAAC,IAAI,EACT,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,EAAE,IAAI,EAChC,IAAc,CACf;;IAEQ,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AACjE;AAC8B;AACrB,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AAClC;AACiG;AACxF,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;AAE5B,IAAA,UAAU,GAAG,QAAQ,CACtC,MAAM,IAAI,CAAC,QAAQ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AAA,aAAA,EAGjB,iBAAiB,CAAC,QAAQ,QACnC,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,EAAA,SAAA,EAC1C;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,uBAAuB,CAAC;AAChD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,urCAAA,EAAA,MAAA,EAAA,CAAA,03MAAA,CAAA,EAAA;;;AE/BH;;AAEG;;;;"}
|
|
@@ -5,7 +5,7 @@ import { Overlay } from '@angular/cdk/overlay';
|
|
|
5
5
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
6
6
|
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
7
7
|
import { DsOverlayCloseRef } from '@ids-group-ltd/ids-design-system/overlay';
|
|
8
|
-
import { DsControlValueAccessor, trimmedText, nextControlId, resolveFieldMessage, dropdownOverlay, prepareOverlayEnter, forwardOverlayTokens, closeOnOutsidePointer, closeOnScroll, clearOnDetach, focusIsInside, disposeWithLeave } from '@ids-group-ltd/ids-design-system/components';
|
|
8
|
+
import { DsControlValueAccessor, trimmedText, nextControlId, resolveFieldMessage, dropdownOverlay, panelClassesOf, prepareOverlayEnter, forwardOverlayTokens, closeOnOutsidePointer, closeOnScroll, clearOnDetach, focusIsInside, disposeWithLeave } from '@ids-group-ltd/ids-design-system/components';
|
|
9
9
|
import { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';
|
|
10
10
|
|
|
11
11
|
function normalizeHex(hex) {
|
|
@@ -123,6 +123,11 @@ class ColorPickerComponent extends DsControlValueAccessor {
|
|
|
123
123
|
value = model('#2F54FF', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
124
124
|
/** Swatches shown in the panel — defaults to a built-in palette. */
|
|
125
125
|
presets = input(DEFAULT_PRESETS, ...(ngDevMode ? [{ debugName: "presets" }] : /* istanbul ignore next */ []));
|
|
126
|
+
/** Extra classes for the portaled panel, beside `ds-dropdown-panel`,
|
|
127
|
+
* `ds-overlay-pane` and this component's own `ds-color-picker-panel`. The panel
|
|
128
|
+
* is portaled out of the host, so a class on the pane is the only way a consumer
|
|
129
|
+
* stylesheet reaches ONE instance of it. */
|
|
130
|
+
panelClass = input([], ...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
|
|
126
131
|
/** Disables the trigger and blocks all interaction. */
|
|
127
132
|
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
128
133
|
/** Accessible name for the trigger button and panel. */
|
|
@@ -148,6 +153,7 @@ class ColorPickerComponent extends DsControlValueAccessor {
|
|
|
148
153
|
uid = nextControlId('ds-color-picker');
|
|
149
154
|
hintId = computed(() => this.message().text ? `${this.uid}-hint` : null, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
150
155
|
fieldMessage = resolveFieldMessage({
|
|
156
|
+
disabled: () => this.isDisabled(),
|
|
151
157
|
hint: this.hint,
|
|
152
158
|
warning: this.warning,
|
|
153
159
|
error: this.error,
|
|
@@ -290,7 +296,7 @@ class ColorPickerComponent extends DsControlValueAccessor {
|
|
|
290
296
|
if (parsed) {
|
|
291
297
|
this.hsv.set(parsed);
|
|
292
298
|
}
|
|
293
|
-
const { positionStrategy, config } = dropdownOverlay(this.overlay, this.host.nativeElement);
|
|
299
|
+
const { positionStrategy, config } = dropdownOverlay(this.overlay, this.host.nativeElement, ['ds-color-picker-panel', ...panelClassesOf(this.panelClass())]);
|
|
294
300
|
this.overlayRef = this.overlay.create(config);
|
|
295
301
|
prepareOverlayEnter(this.overlayRef, this.host.nativeElement, positionStrategy);
|
|
296
302
|
forwardOverlayTokens(this.overlayRef, this.host.nativeElement, this.panelTokens);
|
|
@@ -361,7 +367,7 @@ class ColorPickerComponent extends DsControlValueAccessor {
|
|
|
361
367
|
return Math.min(100, Math.max(0, value));
|
|
362
368
|
}
|
|
363
369
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ColorPickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
364
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ColorPickerComponent, isStandalone: true, selector: "ds-color-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, presets: { classPropertyName: "presets", publicName: "presets", 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 }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-field-state": "controlState()", "class.open": "open()", "class.disabled": "isDisabled()" } }, providers: [
|
|
370
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ColorPickerComponent, isStandalone: true, selector: "ds-color-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, presets: { classPropertyName: "presets", publicName: "presets", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", 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 }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-field-state": "controlState()", "class.open": "open()", "class.disabled": "isDisabled()" } }, providers: [
|
|
365
371
|
{
|
|
366
372
|
provide: NG_VALUE_ACCESSOR,
|
|
367
373
|
useExisting: forwardRef(() => ColorPickerComponent),
|
|
@@ -390,7 +396,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
390
396
|
'[class.open]': 'open()',
|
|
391
397
|
'[class.disabled]': 'isDisabled()',
|
|
392
398
|
}, template: "<button\n #trigger\n type=\"button\"\n class=\"trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggle()\">\n <span\n class=\"swatch\"\n [style.background-color]=\"displayHex()\">\n </span>\n\n <span class=\"hex\">\n {{ displayHex() }}\n </span>\n\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"16\" />\n</button>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n\n<ng-template #panel>\n <div\n class=\"panel\"\n role=\"dialog\"\n [attr.aria-label]=\"ariaLabel()\">\n <div\n class=\"sv-plane\"\n tabindex=\"0\"\n aria-label=\"Saturation and brightness \u2014 use arrow keys to adjust\"\n [style.background-color]=\"hueColor()\"\n (pointerdown)=\"onSvPointerDown($event)\"\n (pointermove)=\"onSvPointerMove($event)\"\n (pointerup)=\"onSvPointerUp($event)\"\n (pointercancel)=\"onSvPointerUp($event)\"\n (keydown)=\"onSvKeydown($event)\">\n <span\n class=\"sv-thumb\"\n [style.left.%]=\"svThumb().left\"\n [style.top.%]=\"svThumb().top\">\n </span>\n </div>\n\n <div\n class=\"hue-track\"\n role=\"slider\"\n tabindex=\"0\"\n aria-label=\"Hue\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"360\"\n [attr.aria-valuenow]=\"hsv().h\"\n (pointerdown)=\"onHuePointerDown($event)\"\n (pointermove)=\"onHuePointerMove($event)\"\n (pointerup)=\"onHuePointerUp($event)\"\n (pointercancel)=\"onHuePointerUp($event)\"\n (keydown)=\"onHueKeydown($event)\">\n <span\n class=\"hue-thumb\"\n [style.left.%]=\"huePercent()\">\n </span>\n </div>\n\n <div class=\"fields\">\n <span\n class=\"preview\"\n [style.background-color]=\"displayHex()\">\n </span>\n\n <input\n type=\"text\"\n class=\"hex-input\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n aria-label=\"Hex colour value\"\n [value]=\"displayHex()\"\n (input)=\"onHexInput($event)\" />\n </div>\n\n <div\n class=\"presets\"\n role=\"group\"\n aria-label=\"Preset colours\">\n @for (preset of presets(); track preset) {\n <button\n type=\"button\"\n class=\"preset\"\n [class.selected]=\"isSelected(preset)\"\n [style.background-color]=\"preset\"\n [attr.aria-label]=\"preset\"\n [attr.aria-pressed]=\"isSelected(preset)\"\n (click)=\"selectPreset(preset)\">\n </button>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host,.panel{--_cp-swatch: var(--ds-color-picker-swatch, var(--color-picker-swatch));--_cp-preview: var(--ds-color-picker-preview, var(--color-picker-preview));--_cp-panel-w: var(--ds-color-picker-panel-w, var(--color-picker-panel-w));--_cp-sv-h: var(--ds-color-picker-sv-h, var(--color-picker-sv-h));--_cp-hue-h: var(--ds-color-picker-hue-h, var(--color-picker-hue-h));--_cp-thumb: var(--ds-color-picker-thumb, var(--color-picker-thumb));--_cp-trigger-border-color: var(--ds-color-picker-trigger-border-color, var(--border-default))}:host{display:inline-flex;flex-direction:column;align-items:flex-start;gap:var(--field-label-gap)}.trigger{display:inline-flex;align-items:center;gap:var(--space-2);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height);padding:0 var(--field-pad-x);background-color:var(--surface-default);border:var(--border-width-default) solid var(--_cp-trigger-border-color);border-radius:var(--radius-md);color:var(--text-primary);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.trigger:hover:not(:disabled){border-color:var(--border-strong)}.trigger:active:not(:disabled){background-color:var(--surface-secondary)}@media not (forced-colors:active){.trigger:focus-visible{outline:none}}.trigger:focus-visible{border-color:var(--accent);box-shadow:var(--accent-focus-field)}.trigger:disabled{background-color:var(--surface-muted);color:var(--text-disabled);cursor:not-allowed}.trigger .swatch{width:var(--_cp-swatch);height:var(--_cp-swatch);border-radius:var(--ds-radius-inner);border:var(--border-width-default) solid var(--border-default);flex:none}.trigger .hex{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-mono);text-transform:uppercase}.trigger .chevron{margin-left:var(--space-1);color:var(--text-tertiary);transition:transform var(--duration-fast) var(--ease-standard)}:host(.open) .trigger .chevron{transform:rotate(180deg)}.panel{display:flex;flex-direction:column;gap:var(--space-3);width:var(--_cp-panel-w);padding:var(--space-4);background-color:var(--surface-overlay);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);box-shadow:var(--shadow-popover)}.sv-plane{position:relative;width:100%;height:var(--_cp-sv-h);border-radius:var(--radius-md);cursor:crosshair;touch-action:none;overflow:hidden}.sv-plane:before{content:\"\";position:absolute;inset:0;background:linear-gradient(to right,#fff,#fff0)}.sv-plane:after{content:\"\";position:absolute;inset:0;background:linear-gradient(to top,#000,#0000)}.sv-plane:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.sv-thumb{position:absolute;z-index:1;width:var(--_cp-thumb);height:var(--_cp-thumb);transform:translate(-50%,-50%);border-radius:var(--radius-pill);border:var(--border-width-strong) solid #fff;box-shadow:0 0 0 var(--border-width-default) #00000059,var(--shadow-card);pointer-events:none}.hue-track{position:relative;width:100%;height:var(--_cp-hue-h);border-radius:var(--radius-pill);cursor:pointer;touch-action:none;background:linear-gradient(to right,red,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.hue-track:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.hue-thumb{position:absolute;top:50%;width:var(--_cp-thumb);height:var(--_cp-thumb);transform:translate(-50%,-50%);border-radius:var(--radius-pill);background-color:var(--surface-default);border:var(--border-width-strong) solid #fff;box-shadow:0 0 0 var(--border-width-default) #00000059,var(--shadow-card);pointer-events:none}.fields{display:flex;align-items:center;gap:var(--space-3)}.preview{flex:none;width:var(--_cp-preview);height:var(--_cp-preview);border-radius:var(--radius-md);border:var(--border-width-default) solid var(--border-default)}.hex-input{flex:1;min-width:0;height:var(--hit-sm);padding:0 var(--space-2);background-color:var(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--ds-radius-inner);color:var(--text-primary);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-mono);text-transform:uppercase}@media not (forced-colors:active){.hex-input:focus{outline:none}}.hex-input:focus{border-color:var(--accent);box-shadow:var(--accent-focus-field)}.presets{display:flex;flex-wrap:wrap;gap:var(--space-2)}.preset{width:var(--_cp-swatch);height:var(--_cp-swatch);padding:0;border-radius:var(--ds-radius-inner);border:var(--border-width-default) solid var(--border-default);cursor:pointer}.preset.selected{box-shadow:0 0 0 var(--border-width-default) var(--surface-overlay),0 0 0 var(--border-width-strong) var(--accent)}.preset:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}:host([data-field-state=error]:not(.in-group)) .trigger:not(.disabled):not(:disabled){border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .trigger:not(.disabled):not(:disabled):focus-within,:host([data-field-state=error]:not(.in-group)) .trigger:not(.disabled):not(:disabled):focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .trigger:not(.disabled):not(:disabled){border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .trigger:not(.disabled):not(:disabled){border-color:var(--success)}\n"] }]
|
|
393
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], presets: [{ type: i0.Input, args: [{ isSignal: true, alias: "presets", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
399
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], presets: [{ type: i0.Input, args: [{ isSignal: true, alias: "presets", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
394
400
|
|
|
395
401
|
/**
|
|
396
402
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-color-picker.mjs","sources":["../../../src/lib/components/color-picker/color-picker.utils.ts","../../../src/lib/components/color-picker/color-picker.component.ts","../../../src/lib/components/color-picker/color-picker.component.html","../../../src/lib/components/color-picker/ids-group-ltd-ids-design-system-components-color-picker.ts"],"sourcesContent":["/** Hue 0–360, saturation/value 0–100 — the model the Photoshop-style picker\n * manipulates. Hex is the public value; these convert between the two. */\nexport interface Hsv {\n h: number;\n s: number;\n v: number;\n}\n\nexport function normalizeHex(hex: string): string | null {\n const match = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());\n if (!match) {\n return null;\n }\n const body = match[1];\n const full =\n body.length === 3\n ? `${body[0]}${body[0]}${body[1]}${body[1]}${body[2]}${body[2]}`\n : body;\n\n return `#${full.toLowerCase()}`;\n}\n\nexport function hexToHsv(hex: string): Hsv | null {\n const normalized = normalizeHex(hex);\n if (!normalized) {\n return null;\n }\n const red = parseInt(normalized.slice(1, 3), 16) / 255;\n const green = parseInt(normalized.slice(3, 5), 16) / 255;\n const blue = parseInt(normalized.slice(5, 7), 16) / 255;\n\n const max = Math.max(red, green, blue);\n const min = Math.min(red, green, blue);\n const delta = max - min;\n\n let hue = 0;\n if (delta !== 0) {\n if (max === red) {\n hue = ((green - blue) / delta) % 6;\n } else if (max === green) {\n hue = (blue - red) / delta + 2;\n } else {\n hue = (red - green) / delta + 4;\n }\n hue = Math.round(hue * 60);\n if (hue < 0) {\n hue += 360;\n }\n }\n const saturation = max === 0 ? 0 : delta / max;\n\n return {\n h: hue,\n s: Math.round(saturation * 100),\n v: Math.round(max * 100),\n };\n}\n\nexport function hsvToHex({ h, s, v }: Hsv): string {\n const saturation = s / 100;\n const value = v / 100;\n const chroma = value * saturation;\n const second = chroma * (1 - Math.abs(((h / 60) % 2) - 1));\n const matchLightness = value - chroma;\n\n let red = 0;\n let green = 0;\n let blue = 0;\n if (h < 60) {\n red = chroma;\n green = second;\n } else if (h < 120) {\n red = second;\n green = chroma;\n } else if (h < 180) {\n green = chroma;\n blue = second;\n } else if (h < 240) {\n green = second;\n blue = chroma;\n } else if (h < 300) {\n red = second;\n blue = chroma;\n } else {\n red = chroma;\n blue = second;\n }\n\n const toHex = (channel: number): string =>\n Math.round((channel + matchLightness) * 255)\n .toString(16)\n .padStart(2, '0');\n\n return `#${toHex(red)}${toHex(green)}${toHex(blue)}`;\n}\n","import {\n Component,\n ElementRef,\n type OnDestroy,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { DsOverlayCloseRef } from '@ids-group-ltd/ids-design-system/overlay';\nimport { DsControlValueAccessor } from '@ids-group-ltd/ids-design-system/components';\nimport { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';\nimport {\n resolveFieldMessage,\n trimmedText,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { nextControlId } from '@ids-group-ltd/ids-design-system/components';\nimport {\n clearOnDetach,\n closeOnOutsidePointer,\n closeOnScroll,\n disposeWithLeave,\n type DsOverlayCloseCause,\n focusIsInside,\n forwardOverlayTokens,\n dropdownOverlay,\n prepareOverlayEnter,\n} from '@ids-group-ltd/ids-design-system/components';\nimport {\n type Hsv,\n hexToHsv,\n hsvToHex,\n normalizeHex,\n} from './color-picker.utils';\n\nconst DEFAULT_PRESETS: readonly string[] = [\n '#2F54FF',\n '#0EA5E9',\n '#16A34A',\n '#EAB308',\n '#F97316',\n '#EF4444',\n '#EC4899',\n '#8B5CF6',\n '#6B7280',\n '#111827',\n '#FFFFFF',\n];\n\n@Component({\n selector: 'ds-color-picker',\n standalone: true,\n imports: [IconComponent, FieldMessageComponent],\n templateUrl: './color-picker.component.html',\n styleUrl: './color-picker.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ColorPickerComponent),\n multi: true,\n },\n {\n provide: DsOverlayCloseRef,\n useExisting: forwardRef(() => ColorPickerComponent),\n },\n ],\n host: {\n '[attr.data-field-state]': 'controlState()',\n '[class.open]': 'open()',\n '[class.disabled]': 'isDisabled()',\n },\n})\nexport class ColorPickerComponent\n extends DsControlValueAccessor<string>\n implements DsOverlayCloseRef, OnDestroy\n{\n private readonly overlay = inject(Overlay);\n private readonly vcr = inject(ViewContainerRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n /** Public panel tokens forwarded onto the portaled overlay pane on open so\n * a consumer's `ds-color-picker { --ds-color-picker-panel-*: … }` reaches it. */\n private readonly panelTokens = [\n '--ds-color-picker-swatch',\n '--ds-color-picker-preview',\n '--ds-color-picker-panel-w',\n '--ds-color-picker-sv-h',\n '--ds-color-picker-hue-h',\n '--ds-color-picker-thumb',\n ];\n\n /** Selected colour as a hex string, two-way bound. */\n readonly value = model<string>('#2F54FF');\n /** Swatches shown in the panel — defaults to a built-in palette. */\n readonly presets = input<readonly string[]>(DEFAULT_PRESETS);\n /** Disables the trigger and blocks all interaction. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Accessible name for the trigger button and panel. */\n readonly ariaLabel = input<string>('Choose colour');\n /** Confirmation text, shown when there is no error or warning — and it paints\n * the field's success border. A string like `warning`: the text IS the state. */\n readonly success = input<string, string | null | undefined>('', {\n transform: trimmedText,\n });\n\n protected readonly trigger =\n viewChild.required<ElementRef<HTMLButtonElement>>('trigger');\n protected readonly panelTpl =\n viewChild.required<TemplateRef<unknown>>('panel');\n protected readonly open = signal(false);\n\n // Working HSV state while the panel is open — the saturation/value plane and\n // the hue slider both manipulate this; the hex `value` is derived from it.\n protected readonly hsv = signal<Hsv>(\n hexToHsv('#2F54FF') ?? { h: 0, s: 0, v: 0 },\n );\n\n private overlayRef: OverlayRef | null = null;\n private svDragging = false;\n private hueDragging = false;\n\n ngOnDestroy(): void {\n // Host torn down while open → close() never runs. Dispose the overlay so\n // its pane and event subscriptions don't leak.\n this.overlayRef?.dispose();\n this.overlayRef = null;\n }\n\n protected readonly uid = nextControlId('ds-color-picker');\n protected readonly hintId = computed(() =>\n this.message().text ? `${this.uid}-hint` : null,\n );\n private readonly fieldMessage = resolveFieldMessage({\n hint: this.hint,\n warning: this.warning,\n error: this.error,\n errors: this.errors,\n invalid: this.invalid,\n success: this.success,\n touchedSelf: this.touchedSelf,\n touched: this.touched,\n });\n protected readonly message = this.fieldMessage.message;\n protected readonly controlState = this.fieldMessage.controlState;\n protected readonly invalidResolved = this.fieldMessage.invalid;\n\n protected readonly isDisabled = computed(\n () => this.disabled() || this.formDisabled(),\n );\n\n // Normalised hex for the trigger swatch + hex field.\n protected readonly displayHex = computed(\n () => normalizeHex(this.value()) ?? '#000000',\n );\n\n // Pure-hue fill behind the saturation/value plane.\n protected readonly hueColor = computed(() =>\n hsvToHex({ h: this.hsv().h, s: 100, v: 100 }),\n );\n\n protected readonly svThumb = computed(() => {\n const { s: saturation, v: value } = this.hsv();\n\n return { left: saturation, top: 100 - value };\n });\n\n protected readonly huePercent = computed(() => (this.hsv().h / 360) * 100);\n\n protected toggle(): void {\n if (this.isDisabled()) {\n return;\n }\n if (this.open()) {\n this.close();\n } else {\n this.openPanel();\n }\n }\n\n protected selectPreset(hex: string): void {\n this.commitHex(hex);\n this.close();\n }\n\n protected isSelected(hex: string): boolean {\n return normalizeHex(hex) === this.displayHex();\n }\n\n protected onHexInput(event: Event): void {\n const parsed = hexToHsv((event.target as HTMLInputElement).value);\n if (parsed) {\n this.hsv.set(parsed);\n this.value.set(hsvToHex(parsed));\n }\n }\n\n protected onSvPointerDown(event: PointerEvent): void {\n const plane = event.currentTarget as HTMLElement;\n plane.setPointerCapture(event.pointerId);\n this.svDragging = true;\n this.updateSv(event, plane);\n }\n\n protected onSvPointerMove(event: PointerEvent): void {\n if (this.svDragging) {\n this.updateSv(event, event.currentTarget as HTMLElement);\n }\n }\n\n protected onSvPointerUp(event: PointerEvent): void {\n if (!this.svDragging) {\n return;\n }\n const plane = event.currentTarget as HTMLElement;\n if (plane.hasPointerCapture(event.pointerId)) {\n plane.releasePointerCapture(event.pointerId);\n }\n this.svDragging = false;\n }\n\n protected onSvKeydown(event: KeyboardEvent): void {\n const { s: saturation, v: value } = this.hsv();\n const step = event.shiftKey ? 10 : 1;\n let nextSaturation = saturation;\n let nextValue = value;\n switch (event.key) {\n case 'ArrowRight':\n nextSaturation = saturation + step;\n break;\n case 'ArrowLeft':\n nextSaturation = saturation - step;\n break;\n case 'ArrowUp':\n nextValue = value + step;\n break;\n case 'ArrowDown':\n nextValue = value - step;\n break;\n default:\n return;\n }\n event.preventDefault();\n this.setHsv({\n s: this.clampPct(nextSaturation),\n v: this.clampPct(nextValue),\n });\n }\n\n protected onHuePointerDown(event: PointerEvent): void {\n const track = event.currentTarget as HTMLElement;\n track.setPointerCapture(event.pointerId);\n this.hueDragging = true;\n this.updateHue(event, track);\n }\n\n protected onHuePointerMove(event: PointerEvent): void {\n if (this.hueDragging) {\n this.updateHue(event, event.currentTarget as HTMLElement);\n }\n }\n\n protected onHuePointerUp(event: PointerEvent): void {\n if (!this.hueDragging) {\n return;\n }\n const track = event.currentTarget as HTMLElement;\n if (track.hasPointerCapture(event.pointerId)) {\n track.releasePointerCapture(event.pointerId);\n }\n this.hueDragging = false;\n }\n\n protected onHueKeydown(event: KeyboardEvent): void {\n const step = event.shiftKey ? 10 : 1;\n let next = this.hsv().h;\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n next += step;\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n next -= step;\n break;\n default:\n return;\n }\n event.preventDefault();\n this.setHsv({ h: (next + 360) % 360 });\n }\n\n private openPanel(): void {\n if (this.overlayRef) {\n return;\n }\n const parsed = hexToHsv(this.value());\n if (parsed) {\n this.hsv.set(parsed);\n }\n const { positionStrategy, config } = dropdownOverlay(\n this.overlay,\n this.host.nativeElement,\n );\n this.overlayRef = this.overlay.create(config);\n prepareOverlayEnter(\n this.overlayRef,\n this.host.nativeElement,\n positionStrategy,\n );\n forwardOverlayTokens(\n this.overlayRef,\n this.host.nativeElement,\n this.panelTokens,\n );\n closeOnOutsidePointer(\n this.overlayRef,\n (target) => this.trigger().nativeElement.contains(target),\n () => this.close('dismiss'),\n );\n // No backdrop catches a page scroll and CDK's scroll strategies miss a plain\n // overflow container, so close on any outside scroll ourselves.\n const removeScrollClose = closeOnScroll(this.overlayRef, () =>\n this.close('dismiss'),\n );\n clearOnDetach(this.overlayRef, {\n current: () => this.overlayRef,\n always: removeScrollClose,\n clear: () => {\n this.overlayRef = null;\n this.open.set(false);\n },\n });\n this.overlayRef.keydownEvents().subscribe((event) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close('dismiss');\n }\n });\n this.overlayRef.attach(new TemplatePortal(this.panelTpl(), this.vcr));\n this.open.set(true);\n }\n\n close(cause: DsOverlayCloseCause = 'select'): void {\n if (!this.overlayRef) {\n return;\n }\n const focusWasInPanel = focusIsInside(this.overlayRef);\n disposeWithLeave(this.overlayRef, cause);\n this.overlayRef = null;\n this.open.set(false);\n this.markTouched();\n if (focusWasInPanel) {\n this.trigger().nativeElement.focus({ preventScroll: true });\n }\n }\n\n private setHsv(partial: Partial<Hsv>): void {\n const next = { ...this.hsv(), ...partial };\n this.hsv.set(next);\n this.value.set(hsvToHex(next));\n }\n\n private commitHex(hex: string): void {\n const parsed = hexToHsv(hex);\n if (parsed) {\n this.hsv.set(parsed);\n this.value.set(hsvToHex(parsed));\n }\n }\n\n private updateSv(event: PointerEvent, plane: HTMLElement): void {\n const rect = plane.getBoundingClientRect();\n if (rect.width === 0 || rect.height === 0) {\n return;\n }\n const saturation = this.clampPct(\n ((event.clientX - rect.left) / rect.width) * 100,\n );\n const value = this.clampPct(\n 100 - ((event.clientY - rect.top) / rect.height) * 100,\n );\n this.setHsv({ s: Math.round(saturation), v: Math.round(value) });\n }\n\n private updateHue(event: PointerEvent, track: HTMLElement): void {\n const rect = track.getBoundingClientRect();\n if (rect.width === 0) {\n return;\n }\n const ratio = Math.min(\n 1,\n Math.max(0, (event.clientX - rect.left) / rect.width),\n );\n this.setHsv({ h: Math.round(ratio * 360) });\n }\n\n private clampPct(value: number): number {\n return Math.min(100, Math.max(0, value));\n }\n}\n","<button\n #trigger\n type=\"button\"\n class=\"trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggle()\">\n <span\n class=\"swatch\"\n [style.background-color]=\"displayHex()\">\n </span>\n\n <span class=\"hex\">\n {{ displayHex() }}\n </span>\n\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"16\" />\n</button>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n\n<ng-template #panel>\n <div\n class=\"panel\"\n role=\"dialog\"\n [attr.aria-label]=\"ariaLabel()\">\n <div\n class=\"sv-plane\"\n tabindex=\"0\"\n aria-label=\"Saturation and brightness — use arrow keys to adjust\"\n [style.background-color]=\"hueColor()\"\n (pointerdown)=\"onSvPointerDown($event)\"\n (pointermove)=\"onSvPointerMove($event)\"\n (pointerup)=\"onSvPointerUp($event)\"\n (pointercancel)=\"onSvPointerUp($event)\"\n (keydown)=\"onSvKeydown($event)\">\n <span\n class=\"sv-thumb\"\n [style.left.%]=\"svThumb().left\"\n [style.top.%]=\"svThumb().top\">\n </span>\n </div>\n\n <div\n class=\"hue-track\"\n role=\"slider\"\n tabindex=\"0\"\n aria-label=\"Hue\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"360\"\n [attr.aria-valuenow]=\"hsv().h\"\n (pointerdown)=\"onHuePointerDown($event)\"\n (pointermove)=\"onHuePointerMove($event)\"\n (pointerup)=\"onHuePointerUp($event)\"\n (pointercancel)=\"onHuePointerUp($event)\"\n (keydown)=\"onHueKeydown($event)\">\n <span\n class=\"hue-thumb\"\n [style.left.%]=\"huePercent()\">\n </span>\n </div>\n\n <div class=\"fields\">\n <span\n class=\"preview\"\n [style.background-color]=\"displayHex()\">\n </span>\n\n <input\n type=\"text\"\n class=\"hex-input\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n aria-label=\"Hex colour value\"\n [value]=\"displayHex()\"\n (input)=\"onHexInput($event)\" />\n </div>\n\n <div\n class=\"presets\"\n role=\"group\"\n aria-label=\"Preset colours\">\n @for (preset of presets(); track preset) {\n <button\n type=\"button\"\n class=\"preset\"\n [class.selected]=\"isSelected(preset)\"\n [style.background-color]=\"preset\"\n [attr.aria-label]=\"preset\"\n [attr.aria-pressed]=\"isSelected(preset)\"\n (click)=\"selectPreset(preset)\">\n </button>\n }\n </div>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAQM,SAAU,YAAY,CAAC,GAAW,EAAA;IACtC,MAAM,KAAK,GAAG,gCAAgC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAC/D,IAAI,CAAC,KAAK,E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IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,SAAS,kEAElB,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvHpD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-color-picker.mjs","sources":["../../../src/lib/components/color-picker/color-picker.utils.ts","../../../src/lib/components/color-picker/color-picker.component.ts","../../../src/lib/components/color-picker/color-picker.component.html","../../../src/lib/components/color-picker/ids-group-ltd-ids-design-system-components-color-picker.ts"],"sourcesContent":["/** Hue 0–360, saturation/value 0–100 — the model the Photoshop-style picker\n * manipulates. Hex is the public value; these convert between the two. */\nexport interface Hsv {\n h: number;\n s: number;\n v: number;\n}\n\nexport function normalizeHex(hex: string): string | null {\n const match = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());\n if (!match) {\n return null;\n }\n const body = match[1];\n const full =\n body.length === 3\n ? `${body[0]}${body[0]}${body[1]}${body[1]}${body[2]}${body[2]}`\n : body;\n\n return `#${full.toLowerCase()}`;\n}\n\nexport function hexToHsv(hex: string): Hsv | null {\n const normalized = normalizeHex(hex);\n if (!normalized) {\n return null;\n }\n const red = parseInt(normalized.slice(1, 3), 16) / 255;\n const green = parseInt(normalized.slice(3, 5), 16) / 255;\n const blue = parseInt(normalized.slice(5, 7), 16) / 255;\n\n const max = Math.max(red, green, blue);\n const min = Math.min(red, green, blue);\n const delta = max - min;\n\n let hue = 0;\n if (delta !== 0) {\n if (max === red) {\n hue = ((green - blue) / delta) % 6;\n } else if (max === green) {\n hue = (blue - red) / delta + 2;\n } else {\n hue = (red - green) / delta + 4;\n }\n hue = Math.round(hue * 60);\n if (hue < 0) {\n hue += 360;\n }\n }\n const saturation = max === 0 ? 0 : delta / max;\n\n return {\n h: hue,\n s: Math.round(saturation * 100),\n v: Math.round(max * 100),\n };\n}\n\nexport function hsvToHex({ h, s, v }: Hsv): string {\n const saturation = s / 100;\n const value = v / 100;\n const chroma = value * saturation;\n const second = chroma * (1 - Math.abs(((h / 60) % 2) - 1));\n const matchLightness = value - chroma;\n\n let red = 0;\n let green = 0;\n let blue = 0;\n if (h < 60) {\n red = chroma;\n green = second;\n } else if (h < 120) {\n red = second;\n green = chroma;\n } else if (h < 180) {\n green = chroma;\n blue = second;\n } else if (h < 240) {\n green = second;\n blue = chroma;\n } else if (h < 300) {\n red = second;\n blue = chroma;\n } else {\n red = chroma;\n blue = second;\n }\n\n const toHex = (channel: number): string =>\n Math.round((channel + matchLightness) * 255)\n .toString(16)\n .padStart(2, '0');\n\n return `#${toHex(red)}${toHex(green)}${toHex(blue)}`;\n}\n","import {\n Component,\n ElementRef,\n type OnDestroy,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { DsOverlayCloseRef } from '@ids-group-ltd/ids-design-system/overlay';\nimport { DsControlValueAccessor } from '@ids-group-ltd/ids-design-system/components';\nimport { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';\nimport {\n resolveFieldMessage,\n trimmedText,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { nextControlId } from '@ids-group-ltd/ids-design-system/components';\nimport {\n clearOnDetach,\n closeOnOutsidePointer,\n closeOnScroll,\n disposeWithLeave,\n type DsOverlayCloseCause,\n focusIsInside,\n forwardOverlayTokens,\n dropdownOverlay,\n panelClassesOf,\n prepareOverlayEnter,\n} from '@ids-group-ltd/ids-design-system/components';\nimport {\n type Hsv,\n hexToHsv,\n hsvToHex,\n normalizeHex,\n} from './color-picker.utils';\n\nconst DEFAULT_PRESETS: readonly string[] = [\n '#2F54FF',\n '#0EA5E9',\n '#16A34A',\n '#EAB308',\n '#F97316',\n '#EF4444',\n '#EC4899',\n '#8B5CF6',\n '#6B7280',\n '#111827',\n '#FFFFFF',\n];\n\n@Component({\n selector: 'ds-color-picker',\n standalone: true,\n imports: [IconComponent, FieldMessageComponent],\n templateUrl: './color-picker.component.html',\n styleUrl: './color-picker.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ColorPickerComponent),\n multi: true,\n },\n {\n provide: DsOverlayCloseRef,\n useExisting: forwardRef(() => ColorPickerComponent),\n },\n ],\n host: {\n '[attr.data-field-state]': 'controlState()',\n '[class.open]': 'open()',\n '[class.disabled]': 'isDisabled()',\n },\n})\nexport class ColorPickerComponent\n extends DsControlValueAccessor<string>\n implements DsOverlayCloseRef, OnDestroy\n{\n private readonly overlay = inject(Overlay);\n private readonly vcr = inject(ViewContainerRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n /** Public panel tokens forwarded onto the portaled overlay pane on open so\n * a consumer's `ds-color-picker { --ds-color-picker-panel-*: … }` reaches it. */\n private readonly panelTokens = [\n '--ds-color-picker-swatch',\n '--ds-color-picker-preview',\n '--ds-color-picker-panel-w',\n '--ds-color-picker-sv-h',\n '--ds-color-picker-hue-h',\n '--ds-color-picker-thumb',\n ];\n\n /** Selected colour as a hex string, two-way bound. */\n readonly value = model<string>('#2F54FF');\n /** Swatches shown in the panel — defaults to a built-in palette. */\n readonly presets = input<readonly string[]>(DEFAULT_PRESETS);\n /** Extra classes for the portaled panel, beside `ds-dropdown-panel`,\n * `ds-overlay-pane` and this component's own `ds-color-picker-panel`. The panel\n * is portaled out of the host, so a class on the pane is the only way a consumer\n * stylesheet reaches ONE instance of it. */\n readonly panelClass = input<string | readonly string[]>([]);\n /** Disables the trigger and blocks all interaction. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Accessible name for the trigger button and panel. */\n readonly ariaLabel = input<string>('Choose colour');\n /** Confirmation text, shown when there is no error or warning — and it paints\n * the field's success border. A string like `warning`: the text IS the state. */\n readonly success = input<string, string | null | undefined>('', {\n transform: trimmedText,\n });\n\n protected readonly trigger =\n viewChild.required<ElementRef<HTMLButtonElement>>('trigger');\n protected readonly panelTpl =\n viewChild.required<TemplateRef<unknown>>('panel');\n protected readonly open = signal(false);\n\n // Working HSV state while the panel is open — the saturation/value plane and\n // the hue slider both manipulate this; the hex `value` is derived from it.\n protected readonly hsv = signal<Hsv>(\n hexToHsv('#2F54FF') ?? { h: 0, s: 0, v: 0 },\n );\n\n private overlayRef: OverlayRef | null = null;\n private svDragging = false;\n private hueDragging = false;\n\n ngOnDestroy(): void {\n // Host torn down while open → close() never runs. Dispose the overlay so\n // its pane and event subscriptions don't leak.\n this.overlayRef?.dispose();\n this.overlayRef = null;\n }\n\n protected readonly uid = nextControlId('ds-color-picker');\n protected readonly hintId = computed(() =>\n this.message().text ? `${this.uid}-hint` : null,\n );\n private readonly fieldMessage = resolveFieldMessage({\n disabled: () => this.isDisabled(),\n hint: this.hint,\n warning: this.warning,\n error: this.error,\n errors: this.errors,\n invalid: this.invalid,\n success: this.success,\n touchedSelf: this.touchedSelf,\n touched: this.touched,\n });\n protected readonly message = this.fieldMessage.message;\n protected readonly controlState = this.fieldMessage.controlState;\n protected readonly invalidResolved = this.fieldMessage.invalid;\n\n protected readonly isDisabled = computed(\n () => this.disabled() || this.formDisabled(),\n );\n\n // Normalised hex for the trigger swatch + hex field.\n protected readonly displayHex = computed(\n () => normalizeHex(this.value()) ?? '#000000',\n );\n\n // Pure-hue fill behind the saturation/value plane.\n protected readonly hueColor = computed(() =>\n hsvToHex({ h: this.hsv().h, s: 100, v: 100 }),\n );\n\n protected readonly svThumb = computed(() => {\n const { s: saturation, v: value } = this.hsv();\n\n return { left: saturation, top: 100 - value };\n });\n\n protected readonly huePercent = computed(() => (this.hsv().h / 360) * 100);\n\n protected toggle(): void {\n if (this.isDisabled()) {\n return;\n }\n if (this.open()) {\n this.close();\n } else {\n this.openPanel();\n }\n }\n\n protected selectPreset(hex: string): void {\n this.commitHex(hex);\n this.close();\n }\n\n protected isSelected(hex: string): boolean {\n return normalizeHex(hex) === this.displayHex();\n }\n\n protected onHexInput(event: Event): void {\n const parsed = hexToHsv((event.target as HTMLInputElement).value);\n if (parsed) {\n this.hsv.set(parsed);\n this.value.set(hsvToHex(parsed));\n }\n }\n\n protected onSvPointerDown(event: PointerEvent): void {\n const plane = event.currentTarget as HTMLElement;\n plane.setPointerCapture(event.pointerId);\n this.svDragging = true;\n this.updateSv(event, plane);\n }\n\n protected onSvPointerMove(event: PointerEvent): void {\n if (this.svDragging) {\n this.updateSv(event, event.currentTarget as HTMLElement);\n }\n }\n\n protected onSvPointerUp(event: PointerEvent): void {\n if (!this.svDragging) {\n return;\n }\n const plane = event.currentTarget as HTMLElement;\n if (plane.hasPointerCapture(event.pointerId)) {\n plane.releasePointerCapture(event.pointerId);\n }\n this.svDragging = false;\n }\n\n protected onSvKeydown(event: KeyboardEvent): void {\n const { s: saturation, v: value } = this.hsv();\n const step = event.shiftKey ? 10 : 1;\n let nextSaturation = saturation;\n let nextValue = value;\n switch (event.key) {\n case 'ArrowRight':\n nextSaturation = saturation + step;\n break;\n case 'ArrowLeft':\n nextSaturation = saturation - step;\n break;\n case 'ArrowUp':\n nextValue = value + step;\n break;\n case 'ArrowDown':\n nextValue = value - step;\n break;\n default:\n return;\n }\n event.preventDefault();\n this.setHsv({\n s: this.clampPct(nextSaturation),\n v: this.clampPct(nextValue),\n });\n }\n\n protected onHuePointerDown(event: PointerEvent): void {\n const track = event.currentTarget as HTMLElement;\n track.setPointerCapture(event.pointerId);\n this.hueDragging = true;\n this.updateHue(event, track);\n }\n\n protected onHuePointerMove(event: PointerEvent): void {\n if (this.hueDragging) {\n this.updateHue(event, event.currentTarget as HTMLElement);\n }\n }\n\n protected onHuePointerUp(event: PointerEvent): void {\n if (!this.hueDragging) {\n return;\n }\n const track = event.currentTarget as HTMLElement;\n if (track.hasPointerCapture(event.pointerId)) {\n track.releasePointerCapture(event.pointerId);\n }\n this.hueDragging = false;\n }\n\n protected onHueKeydown(event: KeyboardEvent): void {\n const step = event.shiftKey ? 10 : 1;\n let next = this.hsv().h;\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n next += step;\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n next -= step;\n break;\n default:\n return;\n }\n event.preventDefault();\n this.setHsv({ h: (next + 360) % 360 });\n }\n\n private openPanel(): void {\n if (this.overlayRef) {\n return;\n }\n const parsed = hexToHsv(this.value());\n if (parsed) {\n this.hsv.set(parsed);\n }\n const { positionStrategy, config } = dropdownOverlay(\n this.overlay,\n this.host.nativeElement,\n ['ds-color-picker-panel', ...panelClassesOf(this.panelClass())],\n );\n this.overlayRef = this.overlay.create(config);\n prepareOverlayEnter(\n this.overlayRef,\n this.host.nativeElement,\n positionStrategy,\n );\n forwardOverlayTokens(\n this.overlayRef,\n this.host.nativeElement,\n this.panelTokens,\n );\n closeOnOutsidePointer(\n this.overlayRef,\n (target) => this.trigger().nativeElement.contains(target),\n () => this.close('dismiss'),\n );\n // No backdrop catches a page scroll and CDK's scroll strategies miss a plain\n // overflow container, so close on any outside scroll ourselves.\n const removeScrollClose = closeOnScroll(this.overlayRef, () =>\n this.close('dismiss'),\n );\n clearOnDetach(this.overlayRef, {\n current: () => this.overlayRef,\n always: removeScrollClose,\n clear: () => {\n this.overlayRef = null;\n this.open.set(false);\n },\n });\n this.overlayRef.keydownEvents().subscribe((event) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close('dismiss');\n }\n });\n this.overlayRef.attach(new TemplatePortal(this.panelTpl(), this.vcr));\n this.open.set(true);\n }\n\n close(cause: DsOverlayCloseCause = 'select'): void {\n if (!this.overlayRef) {\n return;\n }\n const focusWasInPanel = focusIsInside(this.overlayRef);\n disposeWithLeave(this.overlayRef, cause);\n this.overlayRef = null;\n this.open.set(false);\n this.markTouched();\n if (focusWasInPanel) {\n this.trigger().nativeElement.focus({ preventScroll: true });\n }\n }\n\n private setHsv(partial: Partial<Hsv>): void {\n const next = { ...this.hsv(), ...partial };\n this.hsv.set(next);\n this.value.set(hsvToHex(next));\n }\n\n private commitHex(hex: string): void {\n const parsed = hexToHsv(hex);\n if (parsed) {\n this.hsv.set(parsed);\n this.value.set(hsvToHex(parsed));\n }\n }\n\n private updateSv(event: PointerEvent, plane: HTMLElement): void {\n const rect = plane.getBoundingClientRect();\n if (rect.width === 0 || rect.height === 0) {\n return;\n }\n const saturation = this.clampPct(\n ((event.clientX - rect.left) / rect.width) * 100,\n );\n const value = this.clampPct(\n 100 - ((event.clientY - rect.top) / rect.height) * 100,\n );\n this.setHsv({ s: Math.round(saturation), v: Math.round(value) });\n }\n\n private updateHue(event: PointerEvent, track: HTMLElement): void {\n const rect = track.getBoundingClientRect();\n if (rect.width === 0) {\n return;\n }\n const ratio = Math.min(\n 1,\n Math.max(0, (event.clientX - rect.left) / rect.width),\n );\n this.setHsv({ h: Math.round(ratio * 360) });\n }\n\n private clampPct(value: number): number {\n return Math.min(100, Math.max(0, value));\n }\n}\n","<button\n #trigger\n type=\"button\"\n class=\"trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggle()\">\n <span\n class=\"swatch\"\n [style.background-color]=\"displayHex()\">\n </span>\n\n <span class=\"hex\">\n {{ displayHex() }}\n </span>\n\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"16\" />\n</button>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n\n<ng-template #panel>\n <div\n class=\"panel\"\n role=\"dialog\"\n [attr.aria-label]=\"ariaLabel()\">\n <div\n class=\"sv-plane\"\n tabindex=\"0\"\n aria-label=\"Saturation and brightness — use arrow keys to adjust\"\n [style.background-color]=\"hueColor()\"\n (pointerdown)=\"onSvPointerDown($event)\"\n (pointermove)=\"onSvPointerMove($event)\"\n (pointerup)=\"onSvPointerUp($event)\"\n (pointercancel)=\"onSvPointerUp($event)\"\n (keydown)=\"onSvKeydown($event)\">\n <span\n class=\"sv-thumb\"\n [style.left.%]=\"svThumb().left\"\n [style.top.%]=\"svThumb().top\">\n </span>\n </div>\n\n <div\n class=\"hue-track\"\n role=\"slider\"\n tabindex=\"0\"\n aria-label=\"Hue\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"360\"\n [attr.aria-valuenow]=\"hsv().h\"\n (pointerdown)=\"onHuePointerDown($event)\"\n (pointermove)=\"onHuePointerMove($event)\"\n (pointerup)=\"onHuePointerUp($event)\"\n (pointercancel)=\"onHuePointerUp($event)\"\n (keydown)=\"onHueKeydown($event)\">\n <span\n class=\"hue-thumb\"\n [style.left.%]=\"huePercent()\">\n </span>\n </div>\n\n <div class=\"fields\">\n <span\n class=\"preview\"\n [style.background-color]=\"displayHex()\">\n </span>\n\n <input\n type=\"text\"\n class=\"hex-input\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n aria-label=\"Hex colour value\"\n [value]=\"displayHex()\"\n (input)=\"onHexInput($event)\" />\n </div>\n\n <div\n class=\"presets\"\n role=\"group\"\n aria-label=\"Preset colours\">\n @for (preset of presets(); track preset) {\n <button\n type=\"button\"\n class=\"preset\"\n [class.selected]=\"isSelected(preset)\"\n [style.background-color]=\"preset\"\n [attr.aria-label]=\"preset\"\n [attr.aria-pressed]=\"isSelected(preset)\"\n (click)=\"selectPreset(preset)\">\n </button>\n }\n </div>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAQM,SAAU,YAAY,CAAC,GAAW,EAAA;IACtC,MAAM,KAAK,GAAG,gCAAgC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAC/D,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,IAAI;IACb;AACA,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;AACrB,IAAA,MAAM,IAAI,GACR,IAAI,CAAC,MAAM,KAAK;AACd,UAAE,CAAA,EAAG,IAAI,CAAC,CAAC,CAAC,CAAA,EAAG,IAAI,CAAC,CAAC,CAAC,CAAA,EAAG,IAAI,CAAC,CAAC,CAAC,CAAA,EAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA,EAAG,IAAI,CAAC,CAAC,CAAC,CAAA;UAC5D,IAAI;AAEV,IAAA,OAAO,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