@ids-group-ltd/ids-design-system 0.13.4 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +258 -0
- package/components.md +24 -14
- package/docs/agent/INDEX.md +1 -1
- package/docs/agent/charts/column-series-component.md +1 -1
- package/docs/agent/charts/ds-chart.md +3 -1
- package/docs/agent/charts/ds-line-chart.md +1 -1
- package/docs/agent/charts/line-series-component.md +1 -1
- package/docs/agent/forms/ds-search.md +1 -1
- package/docs/agent/forms/ds-switch.md +4 -2
- package/docs/agent/forms/ds-textarea.md +1 -0
- package/docs/agent/navigation/ds-pagination.md +2 -2
- package/docs/agent/platform/ds-config.md +2 -1
- package/docs/agent/tables/ds-cell-template.md +1 -1
- package/docs/agent/tables/ds-table.md +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +26 -19
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +13 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +27 -14
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +366 -81
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +8 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
- 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 +6 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +42 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +17 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +8 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +27 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +4 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +23 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +20 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +30 -22
- 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 +21 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +91 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +2 -3
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.12.2.json +4 -1
- package/migrations/0.13.3.json +32 -10
- package/migrations/0.13.4.json +1630 -132
- package/migrations/0.14.0.json +591 -0
- package/migrations/0.5.0.json +10 -4
- package/migrations/0.7.0.json +5 -2
- package/migrations/0.9.0.json +5 -2
- package/migrations/README.md +7 -2
- package/package.json +1 -1
- package/styles/_chart-frame.scss +4 -4
- package/styles/_chart-motion.scss +17 -10
- package/styles/_overlay-motion.scss +14 -6
- package/styles/_skeleton-shimmer.scss +4 -1
- package/styles/_tokens.scss +1 -1
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +3 -5
- package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +11 -3
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +125 -26
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +3 -5
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +4 -1
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +4 -0
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +15 -10
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +1 -4
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +7 -1
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +1 -0
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +10 -1
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +35 -24
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +13 -0
- package/types/ids-group-ltd-ids-design-system-components.d.ts +46 -3
- package/types/ids-group-ltd-ids-design-system-core.d.ts +13 -4
- package/types/ids-group-ltd-ids-design-system.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-scatter-chart.mjs","sources":["../../../src/lib/components/scatter-chart/scatter-chart.math.ts","../../../src/lib/components/scatter-chart/scatter-chart.component.ts","../../../src/lib/components/scatter-chart/scatter-chart.component.html","../../../src/lib/components/scatter-chart/ids-group-ltd-ids-design-system-components-scatter-chart.ts"],"sourcesContent":["import type { ScatterChartSeries, ScatterPoint } from './scatter-chart.types';\n\nexport const SCATTER_VIEW_WIDTH = 640;\nexport const SCATTER_VIEW_HEIGHT = 360;\nexport const SCATTER_DEFAULT_TICK_COUNT = 5;\n\n/** The drawable rectangle, in the canvas's own units. */\nexport interface ScatterPlot {\n readonly left: number;\n readonly top: number;\n readonly width: number;\n readonly height: number;\n}\n\n/** What both axes have to hold. */\nexport interface ScatterExtent {\n readonly xMin: number;\n readonly xMax: number;\n readonly yMin: number;\n readonly yMax: number;\n}\n\n/** The span of every plotted reading on both scales. A non-finite coordinate is not a position, so\n * it neither widens the plot nor lands on an edge of it.\n *\n * @internal */\nexport function scatterExtent(\n series: readonly ScatterChartSeries[],\n): ScatterExtent {\n const points = series\n .flatMap((entry) => entry.data)\n .filter((point) => Number.isFinite(point.x) && Number.isFinite(point.y));\n\n if (points.length === 0) {\n return { xMin: 0, xMax: 0, yMin: 0, yMax: 0 };\n }\n\n return {\n xMin: Math.min(...points.map((point) => point.x)),\n xMax: Math.max(...points.map((point) => point.x)),\n yMin: Math.min(...points.map((point) => point.y)),\n yMax: Math.max(...points.map((point) => point.y)),\n };\n}\n\n/** Where one reading lands, clamped into the plot. A domain pinned narrower than the data would\n * otherwise put a mark over the axis labels rather than on an edge.\n *\n * @internal */\nexport function scatterPlacement(\n point: ScatterPoint,\n extent: ScatterExtent,\n plot: ScatterPlot,\n): { cx: number; cy: number } {\n const share = (value: number, min: number, max: number): number => {\n const span = max - min;\n if (!Number.isFinite(span) || span <= 0 || !Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(1, Math.max(0, (value - min) / span));\n };\n\n return {\n cx: plot.left + share(point.x, extent.xMin, extent.xMax) * plot.width,\n cy:\n plot.top +\n plot.height -\n share(point.y, extent.yMin, extent.yMax) * plot.height,\n };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport {\n CHART_SERIES_COLORS,\n decimationTarget,\n linearScale,\n lttbDecimate,\n minMaxDecimate,\n needsDecimating,\n niceDomain,\n tickValues,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { ChartLegendComponent } from '@ids-group-ltd/ids-design-system/components/chart-legend';\nimport type { ChartLegendItem } from '@ids-group-ltd/ids-design-system/components/chart-legend';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport {\n SCATTER_DEFAULT_TICK_COUNT,\n SCATTER_VIEW_HEIGHT,\n SCATTER_VIEW_WIDTH,\n scatterExtent,\n scatterPlacement,\n} from './scatter-chart.math';\nimport type { ScatterPlot } from './scatter-chart.math';\nimport { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport type { ChartDataRow } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport { resolveChartDefaults } from '@ids-group-ltd/ids-design-system/components';\nimport type {\n ScatterChartDecimator,\n ScatterChartReading,\n ScatterChartSeries,\n ScatterPoint,\n} from './scatter-chart.types';\n\n/** Room for the axis labels outside the plot, in the canvas's own units. */\nconst AXIS_GUTTER = 52;\nconst CATEGORY_GUTTER = 34;\nconst EDGE_GUTTER = 12;\n\ninterface PlacedPoint {\n readonly key: string;\n readonly cx: number;\n readonly cy: number;\n readonly point: ScatterPoint;\n}\n\ninterface PlacedSeries {\n readonly key: string;\n readonly series: ScatterChartSeries;\n readonly color: string;\n readonly points: readonly PlacedPoint[];\n}\n\n/**\n * Two continuous quantities against each other: weight against carriage cost, distance against\n * time, volume against conversion. None of the other five charts draws this.\n *\n * It is the only chart in the family whose mark count the CALLER decides - an area has one node per\n * series, a waterfall one per step, a heat map one per cell, and all three are bounded by the\n * question itself. So it is also the only one that thins its own data before drawing: past four\n * times the plot's width in marks the series is decimated, and the chart says so on its face\n * rather than leaving the reader to count points that are not there.\n */\n@Component({\n selector: 'ds-scatter-chart',\n standalone: true,\n exportAs: 'dsScatterChart',\n imports: [\n ChartLegendComponent,\n ChartTooltipDirective,\n SkeletonComponent,\n ChartDataTableComponent,\n ],\n templateUrl: './scatter-chart.component.html',\n styleUrl: './scatter-chart.component.scss',\n host: {\n '[class.framed]': \"frameResolved() === 'auto'\",\n },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScatterChartComponent {\n /** One entry per series, each carrying its own readings. Both scales are continuous, so a\n * point holds its position on each rather than an index into a list of categories. */\n readonly data = input<readonly ScatterChartSeries[]>([]);\n\n /** Names the horizontal quantity under the plot. Without it the reader has two numbers and no\n * idea which is which - on a scatter that is the whole reading. */\n readonly xLabel = input<string | null>(null);\n\n /** Names the vertical quantity beside the plot. */\n readonly yLabel = input<string | null>(null);\n\n /** Which decimator thins a series past the budget. `'minMax'` by default, because it is the only\n * one that promises each bucket's extremum survives. */\n readonly decimator = input<ScatterChartDecimator>('minMax');\n\n /** A hint, not a count, and it applies to BOTH axes. Ticks snap to a round step. */\n readonly tickCount = input(SCATTER_DEFAULT_TICK_COUNT, {\n transform: numberAttribute,\n });\n\n /** Printed above the plot as the visible title, and reused as the annex table's caption. */\n readonly caption = input<string | null>(null);\n\n /** The accessible name. Generated when omitted, naming both axes' spans, how many readings\n * were drawn and how many were thinned out. */\n readonly summary = input<string | null>(null);\n\n /** Makes every mark a button and gives it a keyboard route. `pointClicked` fires whether or\n * not this is set. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** `'auto'` draws the bordered, padded box; `'none'` leaves it bare for a chart inside a card\n * the page has already drawn. Unset falls back to `DS_CONFIG.chart.frame`. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** The annex table under the plot. It lists EVERY reading, including the ones decimation left\n * out of the drawing, which is what keeps a thinned chart honest. */\n readonly dataTable = input<ChartDataTable | null>(null);\n\n /** A skeleton at the plot's own height, so the page does not resize when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n\n /** Separate from empty data: \"the request failed\" and \"there is nothing to show\" read the same\n * and mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** Shown when no series carries a reading. Unset falls back to `DS_CONFIG.chart.emptyText`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shown in place of the plot while `error` is set. Unset falls back to\n * `DS_CONFIG.chart.errorText`. */\n readonly errorText = input<string | null>(null);\n\n /** Formats every number the chart prints - both axes' ticks, the accessible name and the annex\n * table. Unset falls back to `DS_CONFIG.chart.valueFormat`. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n /** Whether a hovered or focused mark opens a tooltip. A scatter prints no value beside its\n * marks - there is no room - so this is where a reading is read without the annex table. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n /** Fades every mark but the one under the pointer. Off by default: on a scatter the pile-up IS\n * the reading, and dimming the neighbours takes exactly that away. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** The clicked reading, with the series it belongs to. Fires on click and on Enter or Space. */\n readonly pointClicked = output<ScatterChartReading>();\n\n private readonly defaults = resolveChartDefaults(this);\n readonly frameResolved = this.defaults.frame;\n readonly dataTableResolved = this.defaults.dataTable;\n readonly emptyTextResolved = this.defaults.emptyText;\n readonly errorTextResolved = this.defaults.errorText;\n readonly valueFormatResolved = this.defaults.valueFormat;\n\n protected readonly activeMark = chartActiveMark(() => 0);\n\n protected readonly viewBox = `0 0 ${SCATTER_VIEW_WIDTH} ${SCATTER_VIEW_HEIGHT}`;\n\n protected readonly plot: ScatterPlot = {\n left: AXIS_GUTTER,\n top: EDGE_GUTTER,\n width: SCATTER_VIEW_WIDTH - AXIS_GUTTER - EDGE_GUTTER,\n height: SCATTER_VIEW_HEIGHT - CATEGORY_GUTTER - EDGE_GUTTER,\n };\n\n protected readonly isEmpty = computed(() =>\n this.data().every((series) => series.data.length === 0),\n );\n\n /** One mark per drawn unit of plot width is the ceiling: two marks sharing a pixel are two DOM\n * nodes a reader cannot tell apart. The viewBox is one unit per pixel at a typical card width. */\n private readonly budget = computed(() => decimationTarget(this.plot.width));\n\n protected readonly drawnSeries = computed(() => {\n const mode = this.decimator();\n const budget = this.budget();\n\n return this.data().map((series) => {\n const thin =\n mode !== 'none' && needsDecimating(series.data.length, budget);\n const data = !thin\n ? series.data\n : mode === 'lttb'\n ? lttbDecimate(series.data, budget)\n : minMaxDecimate(series.data, budget);\n\n return { series, data, thinned: thin ? series.data.length : 0 };\n });\n });\n\n /** How many readings were dropped, over every series. A decimated chart that does not SAY it is\n * decimated leaves the reader counting points that were never drawn. */\n protected readonly droppedCount = computed(() =>\n this.drawnSeries().reduce(\n (total, entry) =>\n total + (entry.thinned === 0 ? 0 : entry.thinned - entry.data.length),\n 0,\n ),\n );\n\n private readonly extent = computed(() =>\n scatterExtent(\n this.drawnSeries().map((entry) => ({\n ...entry.series,\n data: entry.data,\n })),\n ),\n );\n\n private readonly domains = computed(() => {\n const measured = this.extent();\n const ticks = this.tickCount();\n const x = niceDomain(measured.xMin, measured.xMax, ticks);\n const y = niceDomain(measured.yMin, measured.yMax, ticks);\n\n return {\n xMin: x.min,\n xMax: x.max || measured.xMax,\n yMin: y.min,\n yMax: y.max || measured.yMax,\n };\n });\n\n protected readonly series = computed<readonly PlacedSeries[]>(() => {\n const extent = this.domains();\n\n return this.drawnSeries().map((entry, index) => {\n const slot = index % CHART_SERIES_COLORS.length;\n\n return {\n key: entry.series.id,\n series: entry.series,\n color: entry.series.color ?? CHART_SERIES_COLORS[slot],\n points: entry.data\n .filter(\n (point: ScatterPoint) =>\n Number.isFinite(point.x) && Number.isFinite(point.y),\n )\n .map((point: ScatterPoint, pointIndex: number) => ({\n key: `${entry.series.id}-${pointIndex}`,\n point,\n ...scatterPlacement(point, extent, this.plot),\n })),\n };\n });\n });\n\n protected readonly xTicks = computed(() => {\n const { xMin, xMax } = this.domains();\n const toX = linearScale(xMin, xMax, this.plot.width);\n const format = this.valueFormatResolved();\n\n return tickValues(xMin, xMax, this.tickCount()).map((value) => ({\n value,\n x: this.plot.left + toX(value),\n label: format(value, 'tick'),\n }));\n });\n\n protected readonly yTicks = computed(() => {\n const { yMin, yMax } = this.domains();\n const toY = linearScale(yMin, yMax, this.plot.height);\n const format = this.valueFormatResolved();\n\n return tickValues(yMin, yMax, this.tickCount()).map((value) => ({\n value,\n y: this.plot.top + this.plot.height - toY(value),\n label: format(value, 'tick'),\n }));\n });\n\n protected readonly plotBottom = this.plot.top + this.plot.height;\n protected readonly plotRight = this.plot.left + this.plot.width;\n\n protected readonly multiSeries = computed(() => this.data().length > 1);\n\n protected readonly legendItems = computed<readonly ChartLegendItem[]>(() =>\n this.series().map((entry) => ({\n id: entry.series.id,\n label: entry.series.label,\n color: entry.color,\n })),\n );\n\n protected readonly accessibleName = computed(() => {\n const given = this.summary();\n if (given) {\n return given;\n }\n const format = this.valueFormatResolved();\n const { xMin, xMax, yMin, yMax } = this.domains();\n const counted = this.series().reduce(\n (total, entry) => total + entry.points.length,\n 0,\n );\n const axes = `${this.xLabel() ?? 'x'} from ${format(xMin, 'tooltip')} to ${format(xMax, 'tooltip')}, ${this.yLabel() ?? 'y'} from ${format(yMin, 'tooltip')} to ${format(yMax, 'tooltip')}`;\n const dropped = this.droppedCount();\n\n return `${this.caption() ?? 'Scatter chart'}: ${counted} readings drawn, ${axes}.${dropped > 0 ? ` ${dropped} further readings were thinned out to keep the plot drawable; the data table lists every one.` : ''}`;\n });\n\n protected readonly dataTableColumns = computed<readonly string[]>(() => [\n 'Series',\n this.xLabel() ?? 'x',\n this.yLabel() ?? 'y',\n ]);\n\n /** Built only while the disclosure is open: a scatter carries thousands of readings, and every\n * one of them as a table row is a cost nobody pays until they ask. */\n protected readonly dataTableRows = computed<readonly ChartDataRow[]>(() =>\n this.tableIsOpen()\n ? this.tableRows().map((row) => ({\n key: row.key,\n cells: [row.series, row.x, row.y],\n }))\n : [],\n );\n\n protected readonly tableRows = computed(() => {\n const format = this.valueFormatResolved();\n\n return this.data().flatMap((series) =>\n series.data.map((point, index) => ({\n key: `${series.id}-${index}`,\n series: series.label,\n x: format(point.x, 'tooltip'),\n y: format(point.y, 'tooltip'),\n })),\n );\n });\n\n /** `<details>` keeps its children in the DOM while it is shut, so a scatter of 12 000 readings\n * parked 48 000 nodes on the page - three times what decimating the PLOT had just saved. The\n * rows are built when the disclosure opens and dropped when it shuts; every reading is still\n * one click away, which is what the table is for. */\n protected readonly tableOpen = signal(false);\n\n protected readonly tableIsOpen = computed(\n () => this.tableOpen() || this.dataTableResolved() === 'visible',\n );\n\n protected readonly skeletonHeight = `${SCATTER_VIEW_HEIGHT}`;\n\n /** Flattened so one index addresses a mark, which is what `chartActiveMark` counts. */\n private readonly flatMarks = computed(() =>\n this.series().flatMap((entry) =>\n entry.points.map((mark) => ({ entry, mark })),\n ),\n );\n\n protected markIndex(seriesKey: string, pointKey: string): number {\n return this.flatMarks().findIndex(\n (held) => held.entry.key === seriesKey && held.mark.key === pointKey,\n );\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const held = this.flatMarks()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !held) {\n return null;\n }\n const format = this.valueFormatResolved();\n\n return {\n category: `${this.xLabel() ?? 'x'} ${format(held.mark.point.x, 'tooltip')}`,\n entries: [\n {\n label: held.entry.series.label,\n value: held.mark.point.y,\n formatted: format(held.mark.point.y, 'tooltip'),\n color: held.entry.color,\n },\n ],\n };\n },\n );\n\n protected onPointClick(\n series: ScatterChartSeries,\n point: ScatterPoint,\n ): void {\n this.pointClicked.emit({ series, point });\n }\n\n protected pointLabel(\n series: ScatterChartSeries,\n point: ScatterPoint,\n ): string {\n const format = this.valueFormatResolved();\n\n return `${series.label}, ${this.xLabel() ?? 'x'} ${format(point.x, 'tooltip')}, ${this.yLabel() ?? 'y'} ${format(point.y, 'tooltip')}`;\n }\n}\n","<figure class=\"scatter-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <ds-skeleton\n class=\"skeleton\"\n width=\"100%\"\n [height]=\"skeletonHeight + 'px'\" />\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <svg\n class=\"canvas\"\n [attr.viewBox]=\"viewBox\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\">\n @for (tick of yTicks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot.left\"\n [attr.x2]=\"plotRight\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n\n <text\n class=\"axis-label\"\n text-anchor=\"end\"\n [attr.x]=\"plot.left - 8\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of xTicks(); track tick.value) {\n <text\n class=\"axis-label is-horizontal\"\n text-anchor=\"middle\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"plotBottom + 18\">\n {{ tick.label }}\n </text>\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot.left\"\n [attr.x2]=\"plotRight\"\n [attr.y1]=\"plotBottom\"\n [attr.y2]=\"plotBottom\" />\n\n @for (entry of series(); track entry.key) {\n <g [style.--_scatter-series-color]=\"entry.color\">\n @for (mark of entry.points; track mark.key) {\n <circle\n class=\"point\"\n animate.enter=\"mark-enter\"\n [class.interactive]=\"interactive()\"\n [attr.cx]=\"mark.cx\"\n [attr.cy]=\"mark.cy\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"interactive() ? 0 : null\"\n [attr.aria-label]=\"\n interactive() ? pointLabel(entry.series, mark.point) : null\n \"\n (pointerenter)=\"\n activeMark.enter(markIndex(entry.key, mark.key), $event)\n \"\n (focus)=\"activeMark.enter(markIndex(entry.key, mark.key), $event)\"\n (click)=\"onPointClick(entry.series, mark.point)\"\n (keydown.enter)=\"onPointClick(entry.series, mark.point)\"\n (keydown.space)=\"onPointClick(entry.series, mark.point)\" />\n }\n </g>\n }\n\n @if (yLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [attr.transform]=\"\n 'rotate(-90) translate(' + -(plot.top + plot.height / 2) + ', 12)'\n \">\n {{ yLabel() }}\n </text>\n }\n\n @if (xLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [attr.x]=\"plot.left + plot.width / 2\"\n [attr.y]=\"plotBottom + 32\">\n {{ xLabel() }}\n </text>\n }\n </svg>\n\n <!-- On its face, not only in the accessible name: a decimated chart that stays quiet leaves the\n reader counting points that were never drawn. -->\n @if (droppedCount() > 0) {\n <p\n class=\"thinned\"\n role=\"status\">\n {{ droppedCount() }} readings thinned out to keep the plot drawable -\n every one is in the data table.\n </p>\n }\n\n @if (multiSeries()) {\n <ds-chart-legend [items]=\"legendItems()\" />\n }\n\n @if (dataTableResolved() !== 'none') {\n <ds-chart-data-table\n [columns]=\"dataTableColumns()\"\n [rows]=\"dataTableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\"\n (toggled)=\"tableOpen.set($event)\" />\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEO,MAAM,kBAAkB,GAAG,GAAG;AAC9B,MAAM,mBAAmB,GAAG,GAAG;AAC/B,MAAM,0BAA0B,GAAG,CAAC;AAkB3C;;;AAGgB;AACV,SAAU,aAAa,CAC3B,MAAqC,EAAA;IAErC,MAAM,MAAM,GAAG;SACZ,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI;SAC7B,MAAM,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE1E,IAAA,IAAI,MAAM,CAAC,MAAM,KAA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A,wBAAA,EAAA,wBAAA,EAAA,2BAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACrB,iBAAiB,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACjB,uBAAuB,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,SAAA,EAAA,MAAA,EAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAUd,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAlBjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,UAAA,EAChB,IAAI,EAAA,QAAA,EACN,gBAAgB,EAAA,OAAA,EACjB;wBACP,oBAAoB;wBACpB,qBAAqB;wBACrB,iBAAiB;wBACjB,uBAAuB;qBACxB,EAAA,IAAA,EAGK;AACJ,wBAAA,gBAAgB,EAAE,4BAA4B;AAC/C,qBAAA,EAAA,aAAA,EACc,iBAAiB,CAAC,QAAQ,EAAA,eAAA,EACxB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,8jIAAA,EAAA,MAAA,EAAA,CAAA,21MAAA,CAAA,EAAA;;;AEpGjD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-scatter-chart.mjs","sources":["../../../src/lib/components/scatter-chart/scatter-chart.math.ts","../../../src/lib/components/scatter-chart/scatter-chart.component.ts","../../../src/lib/components/scatter-chart/scatter-chart.component.html","../../../src/lib/components/scatter-chart/ids-group-ltd-ids-design-system-components-scatter-chart.ts"],"sourcesContent":["import type { ScatterChartSeries, ScatterPoint } from './scatter-chart.types';\n\nexport const SCATTER_VIEW_WIDTH = 640;\nexport const SCATTER_VIEW_HEIGHT = 360;\nexport const SCATTER_DEFAULT_TICK_COUNT = 5;\n\n/** The drawable rectangle, in the canvas's own units. */\nexport interface ScatterPlot {\n readonly left: number;\n readonly top: number;\n readonly width: number;\n readonly height: number;\n}\n\n/** What both axes have to hold. */\nexport interface ScatterExtent {\n readonly xMin: number;\n readonly xMax: number;\n readonly yMin: number;\n readonly yMax: number;\n}\n\n/** The span of every plotted reading on both scales. A non-finite coordinate is not a position, so\n * it neither widens the plot nor lands on an edge of it.\n *\n * @internal */\nexport function scatterExtent(\n series: readonly ScatterChartSeries[],\n): ScatterExtent {\n const points = series\n .flatMap((entry) => entry.data)\n .filter((point) => Number.isFinite(point.x) && Number.isFinite(point.y));\n\n if (points.length === 0) {\n return { xMin: 0, xMax: 0, yMin: 0, yMax: 0 };\n }\n\n return {\n xMin: Math.min(...points.map((point) => point.x)),\n xMax: Math.max(...points.map((point) => point.x)),\n yMin: Math.min(...points.map((point) => point.y)),\n yMax: Math.max(...points.map((point) => point.y)),\n };\n}\n\n/** Where one reading lands, clamped into the plot. A domain pinned narrower than the data would\n * otherwise put a mark over the axis labels rather than on an edge.\n *\n * @internal */\nexport function scatterPlacement(\n point: ScatterPoint,\n extent: ScatterExtent,\n plot: ScatterPlot,\n): { cx: number; cy: number } {\n const share = (value: number, min: number, max: number): number => {\n const span = max - min;\n if (!Number.isFinite(span) || span <= 0 || !Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(1, Math.max(0, (value - min) / span));\n };\n\n return {\n cx: plot.left + share(point.x, extent.xMin, extent.xMax) * plot.width,\n cy:\n plot.top +\n plot.height -\n share(point.y, extent.yMin, extent.yMax) * plot.height,\n };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport {\n CHART_SERIES_COLORS,\n decimationTarget,\n linearScale,\n lttbDecimate,\n markOf,\n minMaxDecimate,\n needsDecimating,\n niceDomain,\n tickValues,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { ChartLegendComponent } from '@ids-group-ltd/ids-design-system/components/chart-legend';\nimport type { ChartLegendItem } from '@ids-group-ltd/ids-design-system/components/chart-legend';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport {\n SCATTER_DEFAULT_TICK_COUNT,\n SCATTER_VIEW_HEIGHT,\n SCATTER_VIEW_WIDTH,\n scatterExtent,\n scatterPlacement,\n} from './scatter-chart.math';\nimport type { ScatterPlot } from './scatter-chart.math';\nimport { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport type { ChartDataRow } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport { resolveChartDefaults } from '@ids-group-ltd/ids-design-system/components';\nimport type {\n ScatterChartDecimator,\n ScatterChartReading,\n ScatterChartSeries,\n ScatterPoint,\n} from './scatter-chart.types';\n\n/** Room for the axis labels outside the plot, in the canvas's own units. */\nconst AXIS_GUTTER = 52;\nconst CATEGORY_GUTTER = 34;\nconst EDGE_GUTTER = 12;\n\ninterface PlacedPoint {\n readonly key: string;\n readonly cx: number;\n readonly cy: number;\n readonly point: ScatterPoint;\n}\n\ninterface PlacedSeries {\n readonly key: string;\n readonly series: ScatterChartSeries;\n readonly color: string;\n readonly points: readonly PlacedPoint[];\n}\n\n/**\n * Two continuous quantities against each other: weight against carriage cost, distance against\n * time, volume against conversion. None of the other five charts draws this.\n *\n * It is the only chart in the family whose mark count the CALLER decides - an area has one node per\n * series, a waterfall one per step, a heat map one per cell, and all three are bounded by the\n * question itself. So it is also the only one that thins its own data before drawing: past four\n * times the plot's width in marks the series is decimated, and the chart says so on its face\n * rather than leaving the reader to count points that are not there.\n */\n@Component({\n selector: 'ds-scatter-chart',\n standalone: true,\n exportAs: 'dsScatterChart',\n imports: [\n ChartLegendComponent,\n ChartTooltipDirective,\n SkeletonComponent,\n ChartDataTableComponent,\n ],\n templateUrl: './scatter-chart.component.html',\n styleUrl: './scatter-chart.component.scss',\n host: {\n '[class.framed]': \"frameResolved() === 'auto'\",\n },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScatterChartComponent {\n /** One entry per series, each carrying its own readings. Both scales are continuous, so a\n * point holds its position on each rather than an index into a list of categories. */\n readonly data = input<readonly ScatterChartSeries[]>([]);\n\n /** Names the horizontal quantity under the plot. Without it the reader has two numbers and no\n * idea which is which - on a scatter that is the whole reading. */\n readonly xLabel = input<string | null>(null);\n\n /** Names the vertical quantity beside the plot. */\n readonly yLabel = input<string | null>(null);\n\n /** Which decimator thins a series past the budget. `'minMax'` by default, because it is the only\n * one that promises each bucket's extremum survives. */\n readonly decimator = input<ScatterChartDecimator>('minMax');\n\n /** A hint, not a count, and it applies to BOTH axes. Ticks snap to a round step. */\n readonly tickCount = input(SCATTER_DEFAULT_TICK_COUNT, {\n transform: numberAttribute,\n });\n\n /** Printed above the plot as the visible title, and reused as the annex table's caption. */\n readonly caption = input<string | null>(null);\n\n /** The accessible name. Generated when omitted, naming both axes' spans, how many readings\n * were drawn and how many were thinned out. */\n readonly summary = input<string | null>(null);\n\n /** Makes every mark a button and gives it a keyboard route. `pointClicked` fires whether or\n * not this is set. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** `'auto'` draws the bordered, padded box; `'none'` leaves it bare for a chart inside a card\n * the page has already drawn. Unset falls back to `DS_CONFIG.chart.frame`. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** The annex table under the plot. It lists EVERY reading, including the ones decimation left\n * out of the drawing, which is what keeps a thinned chart honest. */\n readonly dataTable = input<ChartDataTable | null>(null);\n\n /** A skeleton at the plot's own height, so the page does not resize when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n\n /** Separate from empty data: \"the request failed\" and \"there is nothing to show\" read the same\n * and mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** Shown when no series carries a reading. Unset falls back to `DS_CONFIG.chart.emptyText`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shown in place of the plot while `error` is set. Unset falls back to\n * `DS_CONFIG.chart.errorText`. */\n readonly errorText = input<string | null>(null);\n\n /** Formats every number the chart prints - both axes' ticks, the accessible name and the annex\n * table. Unset falls back to `DS_CONFIG.chart.valueFormat`. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n /** Whether a hovered or focused mark opens a tooltip. A scatter prints no value beside its\n * marks - there is no room - so this is where a reading is read without the annex table. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n /** Fades every mark but the one under the pointer. Off by default: on a scatter the pile-up IS\n * the reading, and dimming the neighbours takes exactly that away. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** The clicked reading, with the series it belongs to. Fires on click and on Enter or Space. */\n readonly pointClicked = output<ScatterChartReading>();\n\n private readonly defaults = resolveChartDefaults(this);\n readonly frameResolved = this.defaults.frame;\n readonly dataTableResolved = this.defaults.dataTable;\n readonly emptyTextResolved = this.defaults.emptyText;\n readonly errorTextResolved = this.defaults.errorText;\n readonly valueFormatResolved = this.defaults.valueFormat;\n\n protected readonly activeMark = chartActiveMark(() => 0);\n\n protected readonly viewBox = `0 0 ${SCATTER_VIEW_WIDTH} ${SCATTER_VIEW_HEIGHT}`;\n\n protected readonly plot: ScatterPlot = {\n left: AXIS_GUTTER,\n top: EDGE_GUTTER,\n width: SCATTER_VIEW_WIDTH - AXIS_GUTTER - EDGE_GUTTER,\n height: SCATTER_VIEW_HEIGHT - CATEGORY_GUTTER - EDGE_GUTTER,\n };\n\n protected readonly isEmpty = computed(() =>\n this.data().every((series) => series.data.length === 0),\n );\n\n /** One mark per drawn unit of plot width is the ceiling: two marks sharing a pixel are two DOM\n * nodes a reader cannot tell apart. The viewBox is one unit per pixel at a typical card width. */\n private readonly budget = computed(() => decimationTarget(this.plot.width));\n\n protected readonly drawnSeries = computed(() => {\n const mode = this.decimator();\n const budget = this.budget();\n\n return this.data().map((series) => {\n const thin =\n mode !== 'none' && needsDecimating(series.data.length, budget);\n const data = !thin\n ? series.data\n : mode === 'lttb'\n ? lttbDecimate(series.data, budget)\n : minMaxDecimate(series.data, budget);\n\n return { series, data, thinned: thin ? series.data.length : 0 };\n });\n });\n\n /** How many readings were dropped, over every series. A decimated chart that does not SAY it is\n * decimated leaves the reader counting points that were never drawn. */\n protected readonly droppedCount = computed(() =>\n this.drawnSeries().reduce(\n (total, entry) =>\n total + (entry.thinned === 0 ? 0 : entry.thinned - entry.data.length),\n 0,\n ),\n );\n\n private readonly extent = computed(() =>\n scatterExtent(\n this.drawnSeries().map((entry) => ({\n ...entry.series,\n data: entry.data,\n })),\n ),\n );\n\n private readonly domains = computed(() => {\n const measured = this.extent();\n const ticks = this.tickCount();\n const x = niceDomain(measured.xMin, measured.xMax, ticks);\n const y = niceDomain(measured.yMin, measured.yMax, ticks);\n\n return {\n xMin: x.min,\n xMax: x.max || measured.xMax,\n yMin: y.min,\n yMax: y.max || measured.yMax,\n };\n });\n\n protected readonly series = computed<readonly PlacedSeries[]>(() => {\n const extent = this.domains();\n\n return this.drawnSeries().map((entry, index) => {\n const slot = index % CHART_SERIES_COLORS.length;\n\n return {\n key: entry.series.id,\n series: entry.series,\n color: entry.series.color ?? CHART_SERIES_COLORS[slot],\n points: entry.data\n .filter(\n (point: ScatterPoint) =>\n Number.isFinite(point.x) && Number.isFinite(point.y),\n )\n .map((point: ScatterPoint, pointIndex: number) => ({\n key: `${entry.series.id}-${pointIndex}`,\n point,\n ...scatterPlacement(point, extent, this.plot),\n })),\n };\n });\n });\n\n protected readonly xTicks = computed(() => {\n const { xMin, xMax } = this.domains();\n const toX = linearScale(xMin, xMax, this.plot.width);\n const format = this.valueFormatResolved();\n\n return tickValues(xMin, xMax, this.tickCount()).map((value) => ({\n value,\n x: this.plot.left + toX(value),\n label: format(value, 'tick'),\n }));\n });\n\n protected readonly yTicks = computed(() => {\n const { yMin, yMax } = this.domains();\n const toY = linearScale(yMin, yMax, this.plot.height);\n const format = this.valueFormatResolved();\n\n return tickValues(yMin, yMax, this.tickCount()).map((value) => ({\n value,\n y: this.plot.top + this.plot.height - toY(value),\n label: format(value, 'tick'),\n }));\n });\n\n protected readonly plotBottom = this.plot.top + this.plot.height;\n protected readonly plotRight = this.plot.left + this.plot.width;\n\n protected readonly multiSeries = computed(() => this.data().length > 1);\n\n /** The series named in the legend under the pointer, which fades the rest. */\n protected readonly highlightedSeries = signal<string | null>(null);\n\n protected readonly legendItems = computed<readonly ChartLegendItem[]>(() =>\n this.series().map((entry) => ({\n id: entry.series.id,\n label: entry.series.label,\n color: entry.color,\n })),\n );\n\n protected readonly accessibleName = computed(() => {\n const given = this.summary();\n if (given) {\n return given;\n }\n const format = this.valueFormatResolved();\n const { xMin, xMax, yMin, yMax } = this.domains();\n const counted = this.series().reduce(\n (total, entry) => total + entry.points.length,\n 0,\n );\n const axes = `${this.xLabel() ?? 'x'} from ${format(xMin, 'tooltip')} to ${format(xMax, 'tooltip')}, ${this.yLabel() ?? 'y'} from ${format(yMin, 'tooltip')} to ${format(yMax, 'tooltip')}`;\n const dropped = this.droppedCount();\n\n return `${this.caption() ?? 'Scatter chart'}: ${counted} readings drawn, ${axes}.${dropped > 0 ? ` ${dropped} further readings were thinned out to keep the plot drawable; the data table lists every one.` : ''}`;\n });\n\n protected readonly dataTableColumns = computed<readonly string[]>(() => [\n 'Series',\n this.xLabel() ?? 'x',\n this.yLabel() ?? 'y',\n ]);\n\n /** Built only while the disclosure is open: a scatter carries thousands of readings, and every\n * one of them as a table row is a cost nobody pays until they ask. */\n protected readonly dataTableRows = computed<readonly ChartDataRow[]>(() =>\n this.tableIsOpen()\n ? this.tableRows().map((row) => ({\n key: row.key,\n cells: [row.series, row.x, row.y],\n }))\n : [],\n );\n\n protected readonly tableRows = computed(() => {\n const format = this.valueFormatResolved();\n\n return this.data().flatMap((series) =>\n series.data.map((point, index) => ({\n key: `${series.id}-${index}`,\n series: series.label,\n x: format(point.x, 'tooltip'),\n y: format(point.y, 'tooltip'),\n })),\n );\n });\n\n /** `<details>` keeps its children in the DOM while it is shut, so a scatter of 12 000 readings\n * parked 48 000 nodes on the page - three times what decimating the PLOT had just saved. The\n * rows are built when the disclosure opens and dropped when it shuts; every reading is still\n * one click away, which is what the table is for. */\n protected readonly tableOpen = signal(false);\n\n protected readonly tableIsOpen = computed(\n () => this.tableOpen() || this.dataTableResolved() === 'visible',\n );\n\n protected readonly skeletonHeight = `${SCATTER_VIEW_HEIGHT}`;\n\n /** Flattened so one index addresses a mark, which is what `chartActiveMark` counts. */\n private readonly flatMarks = computed(() =>\n this.series().flatMap((entry) =>\n entry.points.map((mark) => ({ entry, mark })),\n ),\n );\n\n /** Where each series starts in `flatMarks`, so a point carries its flat index without a search\n * and the series' one listener reads it back. */\n protected readonly seriesStart = computed(() => {\n const starts = new Map<string, number>();\n let next = 0;\n for (const entry of this.series()) {\n starts.set(entry.key, next);\n next += entry.points.length;\n }\n\n return starts;\n });\n\n protected onPointOver(event: Event): void {\n const hit = markOf(event);\n if (hit) {\n this.activeMark.enter(hit.index, event, undefined, hit.element);\n }\n }\n\n protected onPointActivate(event: Event): void {\n const held = this.flatMarks()[markOf(event)?.index ?? -1];\n if (held) {\n this.onPointClick(held.entry.series, held.mark.point);\n }\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const held = this.flatMarks()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !held) {\n return null;\n }\n const format = this.valueFormatResolved();\n\n return {\n category: `${this.xLabel() ?? 'x'} ${format(held.mark.point.x, 'tooltip')}`,\n entries: [\n {\n label: held.entry.series.label,\n value: held.mark.point.y,\n formatted: format(held.mark.point.y, 'tooltip'),\n color: held.entry.color,\n },\n ],\n };\n },\n );\n\n protected onPointClick(\n series: ScatterChartSeries,\n point: ScatterPoint,\n ): void {\n this.pointClicked.emit({ series, point });\n }\n\n protected pointLabel(\n series: ScatterChartSeries,\n point: ScatterPoint,\n ): string {\n const format = this.valueFormatResolved();\n\n return `${series.label}, ${this.xLabel() ?? 'x'} ${format(point.x, 'tooltip')}, ${this.yLabel() ?? 'y'} ${format(point.y, 'tooltip')}`;\n }\n}\n","<figure class=\"scatter-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <ds-skeleton\n class=\"skeleton\"\n width=\"100%\"\n [height]=\"skeletonHeight + 'px'\" />\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <svg\n class=\"canvas\"\n [attr.viewBox]=\"viewBox\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\">\n @for (tick of yTicks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot.left\"\n [attr.x2]=\"plotRight\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n\n <text\n class=\"axis-label\"\n text-anchor=\"end\"\n [attr.x]=\"plot.left - 8\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of xTicks(); track tick.value) {\n <text\n class=\"axis-label is-horizontal\"\n text-anchor=\"middle\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"plotBottom + 18\">\n {{ tick.label }}\n </text>\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot.left\"\n [attr.x2]=\"plotRight\"\n [attr.y1]=\"plotBottom\"\n [attr.y2]=\"plotBottom\" />\n\n @for (entry of series(); track entry.key) {\n @let start = seriesStart().get(entry.key) ?? 0;\n\n <g\n [class.is-dimmed]=\"\n highlightedSeries() !== null &&\n highlightedSeries() !== entry.series.id\n \"\n [style.--_scatter-series-color]=\"entry.color\"\n (pointerover)=\"onPointOver($event)\"\n (focusin)=\"onPointOver($event)\"\n (click)=\"onPointActivate($event)\"\n (keydown.enter)=\"onPointActivate($event)\"\n (keydown.space)=\"onPointActivate($event)\">\n @for (mark of entry.points; track mark.key; let index = $index) {\n <circle\n class=\"point\"\n [class.interactive]=\"interactive()\"\n [attr.cx]=\"mark.cx\"\n [attr.cy]=\"mark.cy\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"interactive() ? 0 : null\"\n [attr.data-mark-index]=\"start + index\"\n [attr.aria-label]=\"\n interactive() ? pointLabel(entry.series, mark.point) : null\n \" />\n }\n </g>\n }\n\n @if (yLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [attr.transform]=\"\n 'rotate(-90) translate(' + -(plot.top + plot.height / 2) + ', 12)'\n \">\n {{ yLabel() }}\n </text>\n }\n\n @if (xLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [attr.x]=\"plot.left + plot.width / 2\"\n [attr.y]=\"plotBottom + 32\">\n {{ xLabel() }}\n </text>\n }\n </svg>\n\n <!-- On its face, not only in the accessible name: a decimated chart that stays quiet leaves the\n reader counting points that were never drawn. -->\n @if (droppedCount() > 0) {\n <p\n class=\"thinned\"\n role=\"status\">\n {{ droppedCount() }} readings thinned out to keep the plot drawable -\n every one is in the data table.\n </p>\n }\n\n @if (multiSeries()) {\n <ds-chart-legend\n [items]=\"legendItems()\"\n [(highlighted)]=\"highlightedSeries\" />\n }\n\n @if (dataTableResolved() !== 'none') {\n <ds-chart-data-table\n [columns]=\"dataTableColumns()\"\n [rows]=\"dataTableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\"\n (toggled)=\"tableOpen.set($event)\" />\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEO,MAAM,kBAAkB,GAAG,GAAG;AAC9B,MAAM,mBAAmB,GAAG,GAAG;AAC/B,MAAM,0BAA0B,GAAG,CAAC;AAkB3C;;;AAGgB;AACV,SAAU,aAAa,CAC3B,MAAqC,EAAA;IAErC,MAAM,MAAM,GAAG;SACZ,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI;SAC7B,MAAM,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE1E,IAAA,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;AACvB,QAAA,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IAC/C;IAEA,OAAO;AACL,QAAA,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AACjD,QAAA,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AACjD,QAAA,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AACjD,QAAA,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAA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
81
|
+
/** Drops focus from the search input - the counterpart of `focus()`. */
|
|
82
|
+
blur() {
|
|
83
|
+
this.inputEl()?.nativeElement.blur();
|
|
84
|
+
}
|
|
81
85
|
onText(next) {
|
|
82
86
|
this.text.set(next);
|
|
83
87
|
if (this.debounce() > 0 && next !== '') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-search.mjs","sources":["../../../src/lib/components/search/search.component.ts","../../../src/lib/components/search/search.component.html","../../../src/lib/components/search/ids-group-ltd-ids-design-system-components-search.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n effect,\n forwardRef,\n input,\n model,\n numberAttribute,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport {\n FormsModule,\n NG_VALUE_ACCESSOR,\n type ControlValueAccessor,\n} from '@angular/forms';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { valueControlBridge } from '@ids-group-ltd/ids-design-system/components';\nimport { FieldClickFocusDirective } from '@ids-group-ltd/ids-design-system/components';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { inFieldGroup } from '@ids-group-ltd/ids-design-system/components/field-group';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\n\n@Component({\n selector: 'ds-search',\n standalone: true,\n imports: [FormsModule, IconComponent, FieldClickFocusDirective],\n host: {\n '[class.in-group]': 'inGroup',\n '[style.display]': 'hidden() ? \"none\" : null',\n },\n templateUrl: './search.component.html',\n styleUrl: './search.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SearchComponent),\n multi: true,\n },\n ],\n})\n/**\n * Takes the CVA bridge rather than `DsControlValueAccessor`, which also carries\n * `DsFieldBase`: a search box is a toolbar filter, not a validated field, so it has\n * no message row and no message API. Where a search needs a label or an error line,\n * that is what `ds-input` is for.\n */\nexport class SearchComponent implements ControlValueAccessor {\n /** Segment of a ds-field-group: the group owns the border, radius and focus\n * ring, so .in-group strips this control back to its bare contents. */\n protected readonly inGroup = inFieldGroup();\n\n private readonly bridge = valueControlBridge<string>(() => this.value);\n\n /** Hides the control, as every other DS control does. Inline `display`, not the\n * attribute: the host sets its own, which the weaker UA rule would lose to. */\n readonly hidden = input(false, { transform: booleanAttribute });\n\n /** Driven by the forms API — OR'd into `isDisabled` like every other control. */\n protected readonly formDisabled = this.bridge.formDisabled;\n\n /** Search text, two-way bound. */\n readonly value = model<string>('');\n /** Placeholder shown when empty. */\n readonly placeholder = input<string>('Search');\n /** Keyboard shortcut hint rendered in a trailing `<kbd>` badge. */\n readonly shortcut = input<string>('');\n /** Shows the leading search icon. */\n readonly showIcon = input(true, { transform: booleanAttribute });\n /** Show an inline clear (×) button on the right when there's a value. */\n readonly clearable = input(false, { transform: booleanAttribute });\n /** Accessible name for the input (placeholder is not a reliable label). */\n readonly ariaLabel = input<string>('');\n /** Disables the input and the clear button. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly isDisabled = computed(() => this.disabled() || this.formDisabled());\n /** Control height. `md` (default) keeps the 36px search-row height; `sm` (32px)\n * aligns search with dense toolbars beside `sm` inputs/buttons; `lg` is touch.\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 /** Fires with the current value on Enter. */\n readonly submitted = output<string>();\n /** Milliseconds to hold each keystroke back before `value` updates — 0 (default)\n * writes on every keystroke, exactly as this control always has.\n *\n * Clearing the field BYPASSES the delay, which is the part a plain\n * `debounceTime` gets wrong: emptying a search is a deliberate act, and making\n * the user wait 200ms to see the full list back reads as a hang. Enter flushes\n * for the same reason. What the input SHOWS is never delayed. */\n readonly debounce = input(0, { transform: numberAttribute });\n\n private readonly inputEl =\n viewChild<ElementRef<HTMLInputElement>>('searchInput');\n\n /** What the input shows. Separate from `value` only so typing never waits on\n * the timer; with `debounce` at 0 the two move together. */\n protected readonly text = signal(this.value());\n\n private pending: ReturnType<typeof setTimeout> | null = null;\n /** The last text this component pushed into `value`, so an update arriving from\n * the HOST can be told apart from its own echo — a host resetting the field\n * mid-typing has to win, and cancel the keystroke still in flight. */\n private pushed = this.value();\n\n constructor() {\n effect(() => {\n const incoming = this.value();\n if (incoming !== this.pushed) {\n this.cancel();\n this.pushed = incoming;\n this.text.set(incoming);\n }\n });\n }\n\n /** Move keyboard focus to the search input. Public so a host can hand focus\n * over deliberately — e.g. a Clear button that disables itself on activation\n * would otherwise blur into `<body>` and restart Tab order at the top. */\n focus(options?: FocusOptions): void {\n this.inputEl()?.nativeElement.focus(options);\n }\n\n protected onText(next: string): void {\n this.text.set(next);\n if (this.debounce() > 0 && next !== '') {\n this.cancel();\n this.pending = setTimeout(() => {\n this.pending = null;\n this.push(next);\n }, this.debounce());\n\n return;\n }\n this.cancel();\n this.push(next);\n }\n\n protected onSubmit(): void {\n this.flush();\n this.submitted.emit(this.value());\n }\n\n /** Empties the field, DROPS any armed keystroke, and publishes '' immediately.\n * Public for the same reason `focus()` is: a host-owned Clear button outside the\n * control needs it. Writing `''` into `value` is not equivalent — the effect\n * that watches `value` only cancels the timer when the incoming text DIFFERS\n * from what this control last pushed, so clearing an already-empty-looking field\n * mid-debounce left the keystroke armed. */\n clear(): void {\n this.text.set('');\n this.cancel();\n this.push('');\n // The × is removed once empty; return focus to the input so keyboard\n // users don't get dropped onto <body>.\n this.inputEl()?.nativeElement.focus();\n }\n\n /** So Enter searches what the reader can see, not what the timer last let past. */\n private flush(): void {\n if (this.pending) {\n this.cancel();\n this.push(this.text());\n }\n }\n\n private push(next: string): void {\n this.pushed = next;\n this.value.set(next);\n }\n\n writeValue(next: string): void {\n this.bridge.writeValue(next);\n }\n\n registerOnChange(fn: (next: string) => void): void {\n this.bridge.registerOnChange(fn);\n }\n\n registerOnTouched(fn: () => void): void {\n this.bridge.registerOnTouched(fn);\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.bridge.setDisabledState(isDisabled);\n }\n\n /** Reported to the forms API on blur, so a search inside a form goes `ng-touched`. */\n protected markTouched(): void {\n this.bridge.markTouched();\n }\n\n private cancel(): void {\n if (this.pending) {\n clearTimeout(this.pending);\n this.pending = null;\n }\n }\n}\n","<div\n class=\"search\"\n dsFieldClickFocus\n [class]=\"sizeResolved()\">\n @if (showIcon()) {\n <ds-icon\n name=\"search\"\n [size]=\"16\">\n </ds-icon>\n }\n\n <input\n #searchInput\n class=\"search-input\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"ariaLabel() || placeholder() || null\"\n [ngModel]=\"text()\"\n [disabled]=\"isDisabled()\"\n (ngModelChange)=\"onText($event)\"\n (keydown.enter)=\"onSubmit()\"\n (blur)=\"markTouched()\" />\n\n @if (clearable() && text()) {\n <button\n type=\"button\"\n class=\"search-clear\"\n aria-label=\"Clear search\"\n [disabled]=\"isDisabled()\"\n (click)=\"clear()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\">\n </ds-icon>\n </button>\n }\n\n @if (shortcut()) {\n <kbd class=\"kbd\">\n {{ shortcut() }}\n </kbd>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA8CA;;;;;AAKG;MACU,eAAe,CAAA;AAC1B;AACwE;IACrD,OAAO,GAAG,YAAY,EAAE;IAE1B,MAAM,GAAG,kBAAkB,CAAS,MAAM,IAAI,CAAC,KAAK,CAAC;AAEtE;AACgF;IACvE,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAG5C,IAAA,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY;;AAGjD,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;;AAEzB,IAAA,WAAW,GAAG,KAAK,CAAS,QAAQ,kFAAC;;AAErC,IAAA,QAAQ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EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,aAAa,qGAAE,wBAAwB,EAAA,QAAA,EAAA,qBAAA,EAAA,CAAA,EAAA,CAAA;;4FAsBnD,eAAe,EAAA,UAAA,EAAA,CAAA;kBAzB3B,SAAS;+BACE,WAAW,EAAA,UAAA,EACT,IAAI,EAAA,OAAA,EACP,CAAC,WAAW,EAAE,aAAa,EAAE,wBAAwB,CAAC,EAAA,IAAA,EACzD;AACJ,wBAAA,kBAAkB,EAAE,SAAS;AAC7B,wBAAA,iBAAiB,EAAE,0BAA0B;qBAC9C,EAAA,aAAA,EAGc,iBAAiB,CAAC,QAAQ,EAAA,SAAA,EAC9B;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC;AAC9C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,w4BAAA,EAAA,MAAA,EAAA,CAAA,o3JAAA,CAAA,EAAA;0nCA2DyC,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvGzD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-search.mjs","sources":["../../../src/lib/components/search/search.component.ts","../../../src/lib/components/search/search.component.html","../../../src/lib/components/search/ids-group-ltd-ids-design-system-components-search.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n effect,\n forwardRef,\n input,\n model,\n numberAttribute,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport {\n FormsModule,\n NG_VALUE_ACCESSOR,\n type ControlValueAccessor,\n} from '@angular/forms';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { valueControlBridge } from '@ids-group-ltd/ids-design-system/components';\nimport { FieldClickFocusDirective } from '@ids-group-ltd/ids-design-system/components';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { inFieldGroup } from '@ids-group-ltd/ids-design-system/components/field-group';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\n\n@Component({\n selector: 'ds-search',\n standalone: true,\n imports: [FormsModule, IconComponent, FieldClickFocusDirective],\n host: {\n '[class.in-group]': 'inGroup',\n '[style.display]': 'hidden() ? \"none\" : null',\n },\n templateUrl: './search.component.html',\n styleUrl: './search.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SearchComponent),\n multi: true,\n },\n ],\n})\n/**\n * Takes the CVA bridge rather than `DsControlValueAccessor`, which also carries\n * `DsFieldBase`: a search box is a toolbar filter, not a validated field, so it has\n * no message row and no message API. Where a search needs a label or an error line,\n * that is what `ds-input` is for.\n */\nexport class SearchComponent implements ControlValueAccessor {\n /** Segment of a ds-field-group: the group owns the border, radius and focus\n * ring, so .in-group strips this control back to its bare contents. */\n protected readonly inGroup = inFieldGroup();\n\n private readonly bridge = valueControlBridge<string>(() => this.value);\n\n /** Hides the control, as every other DS control does. Inline `display`, not the\n * attribute: the host sets its own, which the weaker UA rule would lose to. */\n readonly hidden = input(false, { transform: booleanAttribute });\n\n /** Driven by the forms API — OR'd into `isDisabled` like every other control. */\n protected readonly formDisabled = this.bridge.formDisabled;\n\n /** Search text, two-way bound. */\n readonly value = model<string>('');\n /** Placeholder shown when empty. */\n readonly placeholder = input<string>('Search');\n /** Keyboard shortcut hint rendered in a trailing `<kbd>` badge. */\n readonly shortcut = input<string>('');\n /** Shows the leading search icon. */\n readonly showIcon = input(true, { transform: booleanAttribute });\n /** Show an inline clear (×) button on the right when there's a value. */\n readonly clearable = input(false, { transform: booleanAttribute });\n /** Accessible name for the input (placeholder is not a reliable label). */\n readonly ariaLabel = input<string>('');\n /** Disables the input and the clear button. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly isDisabled = computed(() => this.disabled() || this.formDisabled());\n /** Control height. `md` (default) keeps the 36px search-row height; `sm` (32px)\n * aligns search with dense toolbars beside `sm` inputs/buttons; `lg` is touch.\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 /** Fires with the current value on Enter. */\n readonly submitted = output<string>();\n /** Milliseconds to hold each keystroke back before `value` updates — 0 (default)\n * writes on every keystroke, exactly as this control always has.\n *\n * Clearing the field BYPASSES the delay, which is the part a plain\n * `debounceTime` gets wrong: emptying a search is a deliberate act, and making\n * the user wait 200ms to see the full list back reads as a hang. Enter flushes\n * for the same reason. What the input SHOWS is never delayed. */\n readonly debounce = input(0, { transform: numberAttribute });\n\n private readonly inputEl =\n viewChild<ElementRef<HTMLInputElement>>('searchInput');\n\n /** What the input shows. Separate from `value` only so typing never waits on\n * the timer; with `debounce` at 0 the two move together. */\n protected readonly text = signal(this.value());\n\n private pending: ReturnType<typeof setTimeout> | null = null;\n /** The last text this component pushed into `value`, so an update arriving from\n * the HOST can be told apart from its own echo — a host resetting the field\n * mid-typing has to win, and cancel the keystroke still in flight. */\n private pushed = this.value();\n\n constructor() {\n effect(() => {\n const incoming = this.value();\n if (incoming !== this.pushed) {\n this.cancel();\n this.pushed = incoming;\n this.text.set(incoming);\n }\n });\n }\n\n /** Move keyboard focus to the search input. Public so a host can hand focus\n * over deliberately — e.g. a Clear button that disables itself on activation\n * would otherwise blur into `<body>` and restart Tab order at the top. */\n focus(options?: FocusOptions): void {\n this.inputEl()?.nativeElement.focus(options);\n }\n\n /** Drops focus from the search input - the counterpart of `focus()`. */\n blur(): void {\n this.inputEl()?.nativeElement.blur();\n }\n\n protected onText(next: string): void {\n this.text.set(next);\n if (this.debounce() > 0 && next !== '') {\n this.cancel();\n this.pending = setTimeout(() => {\n this.pending = null;\n this.push(next);\n }, this.debounce());\n\n return;\n }\n this.cancel();\n this.push(next);\n }\n\n protected onSubmit(): void {\n this.flush();\n this.submitted.emit(this.value());\n }\n\n /** Empties the field, DROPS any armed keystroke, and publishes '' immediately.\n * Public for the same reason `focus()` is: a host-owned Clear button outside the\n * control needs it. Writing `''` into `value` is not equivalent — the effect\n * that watches `value` only cancels the timer when the incoming text DIFFERS\n * from what this control last pushed, so clearing an already-empty-looking field\n * mid-debounce left the keystroke armed. */\n clear(): void {\n this.text.set('');\n this.cancel();\n this.push('');\n // The × is removed once empty; return focus to the input so keyboard\n // users don't get dropped onto <body>.\n this.inputEl()?.nativeElement.focus();\n }\n\n /** So Enter searches what the reader can see, not what the timer last let past. */\n private flush(): void {\n if (this.pending) {\n this.cancel();\n this.push(this.text());\n }\n }\n\n private push(next: string): void {\n this.pushed = next;\n this.value.set(next);\n }\n\n writeValue(next: string): void {\n this.bridge.writeValue(next);\n }\n\n registerOnChange(fn: (next: string) => void): void {\n this.bridge.registerOnChange(fn);\n }\n\n registerOnTouched(fn: () => void): void {\n this.bridge.registerOnTouched(fn);\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.bridge.setDisabledState(isDisabled);\n }\n\n /** Reported to the forms API on blur, so a search inside a form goes `ng-touched`. */\n protected markTouched(): void {\n this.bridge.markTouched();\n }\n\n private cancel(): void {\n if (this.pending) {\n clearTimeout(this.pending);\n this.pending = null;\n }\n }\n}\n","<div\n class=\"search\"\n dsFieldClickFocus\n [class]=\"sizeResolved()\">\n @if (showIcon()) {\n <ds-icon\n name=\"search\"\n [size]=\"16\">\n </ds-icon>\n }\n\n <input\n #searchInput\n class=\"search-input\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"ariaLabel() || placeholder() || null\"\n [ngModel]=\"text()\"\n [disabled]=\"isDisabled()\"\n (ngModelChange)=\"onText($event)\"\n (keydown.enter)=\"onSubmit()\"\n (blur)=\"markTouched()\" />\n\n @if (clearable() && text()) {\n <button\n type=\"button\"\n class=\"search-clear\"\n aria-label=\"Clear search\"\n [disabled]=\"isDisabled()\"\n (click)=\"clear()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\">\n </ds-icon>\n </button>\n }\n\n @if (shortcut()) {\n <kbd class=\"kbd\">\n {{ shortcut() }}\n </kbd>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA8CA;;;;;AAKG;MACU,eAAe,CAAA;AAC1B;AACwE;IACrD,OAAO,GAAG,YAAY,EAAE;IAE1B,MAAM,GAAG,kBAAkB,CAAS,MAAM,IAAI,CAAC,KAAK,CAAC;AAEtE;AACgF;IACvE,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAG5C,IAAA,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY;;AAGjD,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;;AAEzB,IAAA,WAAW,GAAG,KAAK,CAAS,QAAQ,kFAAC;;AAErC,IAAA,QAAQ,GAAG,KAAK,CAAS,EAAE,+EAAC;;IAE5B,QAAQ,GAAG,KAAK,CAAC,IAAI,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAEvD,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAEzD,IAAA,SAAS,GAAG,KAAK,CAAS,EAAE,gFAAC;;IAE7B,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAExD,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,YAAY,EAAE,iFAAC;AAC5E;;AAEiE;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,EA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qB,CAAC;AAC9C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,w4BAAA,EAAA,MAAA,EAAA,CAAA,o3JAAA,CAAA,EAAA;0nCA2DyC,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvGzD;;AAEG;;;;"}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, ViewEncapsulation, Component } from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, inject, DestroyRef, ElementRef, NgZone, ViewEncapsulation, Component } from '@angular/core';
|
|
3
3
|
|
|
4
|
+
// The shimmer animates `background-position`, which the browser recomputes on the main thread every
|
|
5
|
+
// frame whether or not the placeholder is on screen. One observer for every skeleton pauses the
|
|
6
|
+
// ones out of view.
|
|
7
|
+
let offscreenObserver = null;
|
|
8
|
+
function observeVisibility(host, zone) {
|
|
9
|
+
offscreenObserver ??= zone.runOutsideAngular(() => new IntersectionObserver((entries) => {
|
|
10
|
+
for (const entry of entries) {
|
|
11
|
+
entry.target.classList.toggle('is-offscreen', !entry.isIntersecting);
|
|
12
|
+
}
|
|
13
|
+
}));
|
|
14
|
+
const observer = offscreenObserver;
|
|
15
|
+
observer.observe(host);
|
|
16
|
+
return () => observer.unobserve(host);
|
|
17
|
+
}
|
|
4
18
|
class SkeletonComponent {
|
|
5
19
|
/** CSS width of the placeholder (e.g. `'120px'`, `'50%'`). */
|
|
6
20
|
width = input(undefined, ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
@@ -10,8 +24,13 @@ class SkeletonComponent {
|
|
|
10
24
|
circle = input(false, { ...(ngDevMode ? { debugName: "circle" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
11
25
|
/** `display: inline-block` instead of `block`, to sit inline with text. */
|
|
12
26
|
inline = input(false, { ...(ngDevMode ? { debugName: "inline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
27
|
+
constructor() {
|
|
28
|
+
if (typeof IntersectionObserver !== 'undefined') {
|
|
29
|
+
inject(DestroyRef).onDestroy(observeVisibility(inject(ElementRef).nativeElement, inject(NgZone)));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
13
32
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: SkeletonComponent, isStandalone: true, selector: "ds-skeleton", inputs: { width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, circle: { classPropertyName: "circle", publicName: "circle", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "style.width": "width()", "style.height": "height()", "class.circle": "circle()", "class.inline": "inline()" } }, ngImport: i0, template: '', isInline: true, styles: ["@charset \"UTF-8\";:host{--_skeleton-bg-color: var(--ds-skeleton-bg-color, var(--surface-secondary));--_skeleton-shimmer-color: var(--ds-skeleton-shimmer-color, var(--surface-muted));--_skeleton-wave-period: var(--ds-skeleton-wave-period, 56rem);--_skeleton-wave-duration: var(--ds-skeleton-wave-duration, 3.4s);--_skeleton-wave-angle: var(--ds-skeleton-wave-angle, 135deg);--_skeleton-wave-fade: rgb(from var(--_skeleton-shimmer-color) r g b / 0%);--_skeleton-wave-echo-color: var( --ds-skeleton-wave-echo-color, color-mix(in srgb, var(--_skeleton-shimmer-color) 30%, transparent) );display:block;position:relative;overflow:hidden;background:var(--_skeleton-bg-color);border-radius:var(--radius-md)}:host(.circle){border-radius:var(--radius-pill)}:host(.inline){display:inline-block;vertical-align:middle}:host:after{content:\"\";position:absolute;inset:0;pointer-events:none;background-image:repeating-linear-gradient(var(--_skeleton-wave-angle),var(--_skeleton-wave-echo-color) 0,var(--_skeleton-wave-fade) calc(var(--_skeleton-wave-period) / 4),var(--_skeleton-shimmer-color) calc(var(--_skeleton-wave-period) / 2),var(--_skeleton-wave-fade) calc(var(--_skeleton-wave-period) * .75),var(--_skeleton-wave-echo-color) var(--_skeleton-wave-period));background-size:calc(var(--_skeleton-wave-period) * 1.4142) calc(var(--_skeleton-wave-period) * 1.4142);background-attachment:fixed;animation:ds-skeleton-shimmer-loop var(--_skeleton-wave-duration)
|
|
33
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: SkeletonComponent, isStandalone: true, selector: "ds-skeleton", inputs: { width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, circle: { classPropertyName: "circle", publicName: "circle", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "style.width": "width()", "style.height": "height()", "class.circle": "circle()", "class.inline": "inline()" } }, ngImport: i0, template: '', isInline: true, styles: ["@charset \"UTF-8\";:host{--_skeleton-bg-color: var(--ds-skeleton-bg-color, var(--surface-secondary));--_skeleton-shimmer-color: var(--ds-skeleton-shimmer-color, var(--surface-muted));--_skeleton-wave-period: var(--ds-skeleton-wave-period, 56rem);--_skeleton-wave-duration: var(--ds-skeleton-wave-duration, 3.4s);--_skeleton-wave-angle: var(--ds-skeleton-wave-angle, 135deg);--_skeleton-wave-fade: rgb(from var(--_skeleton-shimmer-color) r g b / 0%);--_skeleton-wave-echo-color: var( --ds-skeleton-wave-echo-color, color-mix(in srgb, var(--_skeleton-shimmer-color) 30%, transparent) );display:block;position:relative;overflow:hidden;background:var(--_skeleton-bg-color);border-radius:var(--radius-md)}:host(.circle){border-radius:var(--radius-pill)}:host(.inline){display:inline-block;vertical-align:middle}:host:after{content:\"\";position:absolute;inset:0;pointer-events:none;background-image:repeating-linear-gradient(var(--_skeleton-wave-angle),var(--_skeleton-wave-echo-color) 0,var(--_skeleton-wave-fade) calc(var(--_skeleton-wave-period) / 4),var(--_skeleton-shimmer-color) calc(var(--_skeleton-wave-period) / 2),var(--_skeleton-wave-fade) calc(var(--_skeleton-wave-period) * .75),var(--_skeleton-wave-echo-color) var(--_skeleton-wave-period));background-size:calc(var(--_skeleton-wave-period) * 1.4142) calc(var(--_skeleton-wave-period) * 1.4142);background-attachment:fixed;animation:ds-skeleton-shimmer-loop var(--_skeleton-wave-duration) steps(68) infinite}:host(.is-offscreen):after{animation-play-state:paused}@keyframes ds-skeleton-shimmer-loop{0%{background-position:0 0}to{background-position:calc(var(--_skeleton-wave-period) / 1.4142) calc(var(--_skeleton-wave-period) / 1.4142)}}\n"] });
|
|
15
34
|
}
|
|
16
35
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SkeletonComponent, decorators: [{
|
|
17
36
|
type: Component,
|
|
@@ -21,8 +40,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
21
40
|
'[style.height]': 'height()',
|
|
22
41
|
'[class.circle]': 'circle()',
|
|
23
42
|
'[class.inline]': 'inline()',
|
|
24
|
-
}, encapsulation: ViewEncapsulation.Emulated, styles: ["@charset \"UTF-8\";:host{--_skeleton-bg-color: var(--ds-skeleton-bg-color, var(--surface-secondary));--_skeleton-shimmer-color: var(--ds-skeleton-shimmer-color, var(--surface-muted));--_skeleton-wave-period: var(--ds-skeleton-wave-period, 56rem);--_skeleton-wave-duration: var(--ds-skeleton-wave-duration, 3.4s);--_skeleton-wave-angle: var(--ds-skeleton-wave-angle, 135deg);--_skeleton-wave-fade: rgb(from var(--_skeleton-shimmer-color) r g b / 0%);--_skeleton-wave-echo-color: var( --ds-skeleton-wave-echo-color, color-mix(in srgb, var(--_skeleton-shimmer-color) 30%, transparent) );display:block;position:relative;overflow:hidden;background:var(--_skeleton-bg-color);border-radius:var(--radius-md)}:host(.circle){border-radius:var(--radius-pill)}:host(.inline){display:inline-block;vertical-align:middle}:host:after{content:\"\";position:absolute;inset:0;pointer-events:none;background-image:repeating-linear-gradient(var(--_skeleton-wave-angle),var(--_skeleton-wave-echo-color) 0,var(--_skeleton-wave-fade) calc(var(--_skeleton-wave-period) / 4),var(--_skeleton-shimmer-color) calc(var(--_skeleton-wave-period) / 2),var(--_skeleton-wave-fade) calc(var(--_skeleton-wave-period) * .75),var(--_skeleton-wave-echo-color) var(--_skeleton-wave-period));background-size:calc(var(--_skeleton-wave-period) * 1.4142) calc(var(--_skeleton-wave-period) * 1.4142);background-attachment:fixed;animation:ds-skeleton-shimmer-loop var(--_skeleton-wave-duration)
|
|
25
|
-
}], propDecorators: { width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], circle: [{ type: i0.Input, args: [{ isSignal: true, alias: "circle", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }] } });
|
|
43
|
+
}, encapsulation: ViewEncapsulation.Emulated, styles: ["@charset \"UTF-8\";:host{--_skeleton-bg-color: var(--ds-skeleton-bg-color, var(--surface-secondary));--_skeleton-shimmer-color: var(--ds-skeleton-shimmer-color, var(--surface-muted));--_skeleton-wave-period: var(--ds-skeleton-wave-period, 56rem);--_skeleton-wave-duration: var(--ds-skeleton-wave-duration, 3.4s);--_skeleton-wave-angle: var(--ds-skeleton-wave-angle, 135deg);--_skeleton-wave-fade: rgb(from var(--_skeleton-shimmer-color) r g b / 0%);--_skeleton-wave-echo-color: var( --ds-skeleton-wave-echo-color, color-mix(in srgb, var(--_skeleton-shimmer-color) 30%, transparent) );display:block;position:relative;overflow:hidden;background:var(--_skeleton-bg-color);border-radius:var(--radius-md)}:host(.circle){border-radius:var(--radius-pill)}:host(.inline){display:inline-block;vertical-align:middle}:host:after{content:\"\";position:absolute;inset:0;pointer-events:none;background-image:repeating-linear-gradient(var(--_skeleton-wave-angle),var(--_skeleton-wave-echo-color) 0,var(--_skeleton-wave-fade) calc(var(--_skeleton-wave-period) / 4),var(--_skeleton-shimmer-color) calc(var(--_skeleton-wave-period) / 2),var(--_skeleton-wave-fade) calc(var(--_skeleton-wave-period) * .75),var(--_skeleton-wave-echo-color) var(--_skeleton-wave-period));background-size:calc(var(--_skeleton-wave-period) * 1.4142) calc(var(--_skeleton-wave-period) * 1.4142);background-attachment:fixed;animation:ds-skeleton-shimmer-loop var(--_skeleton-wave-duration) steps(68) infinite}:host(.is-offscreen):after{animation-play-state:paused}@keyframes ds-skeleton-shimmer-loop{0%{background-position:0 0}to{background-position:calc(var(--_skeleton-wave-period) / 1.4142) calc(var(--_skeleton-wave-period) / 1.4142)}}\n"] }]
|
|
44
|
+
}], ctorParameters: () => [], propDecorators: { width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], circle: [{ type: i0.Input, args: [{ isSignal: true, alias: "circle", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }] } });
|
|
26
45
|
|
|
27
46
|
/**
|
|
28
47
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-skeleton.mjs","sources":["../../../src/lib/components/skeleton/skeleton.component.ts","../../../src/lib/components/skeleton/ids-group-ltd-ids-design-system-components-skeleton.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n input,\n} from '@angular/core';\n\n@Component({\n selector: 'ds-skeleton',\n standalone: true,\n template: '',\n styleUrl: './skeleton.component.scss',\n host: {\n 'aria-hidden': 'true',\n '[style.width]': 'width()',\n '[style.height]': 'height()',\n '[class.circle]': 'circle()',\n '[class.inline]': 'inline()',\n },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class SkeletonComponent {\n /** CSS width of the placeholder (e.g. `'120px'`, `'50%'`). */\n readonly width = input<string | undefined>(undefined);\n /** CSS height of the placeholder. */\n readonly height = input<string | undefined>(undefined);\n /** Pill radius, for avatar/dot-shaped placeholders. */\n readonly circle = input(false, { transform: booleanAttribute });\n /** `display: inline-block` instead of `block`, to sit inline with text. */\n readonly inline = input(false, { transform: booleanAttribute });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-skeleton.mjs","sources":["../../../src/lib/components/skeleton/skeleton.component.ts","../../../src/lib/components/skeleton/ids-group-ltd-ids-design-system-components-skeleton.ts"],"sourcesContent":["import {\n Component,\n DestroyRef,\n ElementRef,\n NgZone,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n input,\n} from '@angular/core';\n\n// The shimmer animates `background-position`, which the browser recomputes on the main thread every\n// frame whether or not the placeholder is on screen. One observer for every skeleton pauses the\n// ones out of view.\nlet offscreenObserver: IntersectionObserver | null = null;\n\nfunction observeVisibility(host: Element, zone: NgZone): () => void {\n offscreenObserver ??= zone.runOutsideAngular(\n () =>\n new IntersectionObserver((entries) => {\n for (const entry of entries) {\n entry.target.classList.toggle('is-offscreen', !entry.isIntersecting);\n }\n }),\n );\n const observer = offscreenObserver;\n observer.observe(host);\n\n return () => observer.unobserve(host);\n}\n\n@Component({\n selector: 'ds-skeleton',\n standalone: true,\n template: '',\n styleUrl: './skeleton.component.scss',\n host: {\n 'aria-hidden': 'true',\n '[style.width]': 'width()',\n '[style.height]': 'height()',\n '[class.circle]': 'circle()',\n '[class.inline]': 'inline()',\n },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class SkeletonComponent {\n /** CSS width of the placeholder (e.g. `'120px'`, `'50%'`). */\n readonly width = input<string | undefined>(undefined);\n /** CSS height of the placeholder. */\n readonly height = input<string | undefined>(undefined);\n /** Pill radius, for avatar/dot-shaped placeholders. */\n readonly circle = input(false, { transform: booleanAttribute });\n /** `display: inline-block` instead of `block`, to sit inline with text. */\n readonly inline = input(false, { transform: booleanAttribute });\n\n constructor() {\n if (typeof IntersectionObserver !== 'undefined') {\n inject(DestroyRef).onDestroy(\n observeVisibility(\n inject<ElementRef<Element>>(ElementRef).nativeElement,\n inject(NgZone),\n ),\n );\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAWA;AACA;AACA;AACA,IAAI,iBAAiB,GAAgC,IAAI;AAEzD,SAAS,iBAAiB,CAAC,IAAa,EAAE,IAAY,EAAA;AACpD,IAAA,iBAAiB,KAAK,IAAI,CAAC,iBAAiB,CAC1C,MACE,IAAI,oBAAoB,CAAC,CAAC,OAAO,KAAI;AACnC,QAAA,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;AAC3B,YAAA,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC;QACtE;IACF,CAAC,CAAC,CACL;IACD,MAAM,QAAQ,GAAG,iBAAiB;AAClC,IAAA,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;IAEtB,OAAO,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;AACvC;MAgBa,iBAAiB,CAAA;;AAEnB,IAAA,KAAK,GAAG,KAAK,CAAqB,SAAS,4EAAC;;AAE5C,IAAA,MAAM,GAAG,KAAK,CAAqB,SAAS,6EAAC;;IAE7C,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAEtD,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAE/D,IAAA,WAAA,GAAA;AACE,QAAA,IAAI,OAAO,oBAAoB,KAAK,WAAW,EAAE;YAC/C,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAC1B,iBAAiB,CACf,MAAM,CAAsB,UAAU,CAAC,CAAC,aAAa,EACrD,MAAM,CAAC,MAAM,CAAC,CACf,CACF;QACH;IACF;wGAnBW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,2uBAXlB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,qqDAAA,CAAA,EAAA,CAAA;;4FAWD,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAd7B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,UAAA,EACX,IAAI,EAAA,QAAA,EACN,EAAE,EAAA,IAAA,EAEN;AACJ,wBAAA,aAAa,EAAE,MAAM;AACrB,wBAAA,eAAe,EAAE,SAAS;AAC1B,wBAAA,gBAAgB,EAAE,UAAU;AAC5B,wBAAA,gBAAgB,EAAE,UAAU;AAC5B,wBAAA,gBAAgB,EAAE,UAAU;qBAC7B,EAAA,aAAA,EACc,iBAAiB,CAAC,QAAQ,EAAA,MAAA,EAAA,CAAA,qqDAAA,CAAA,EAAA;;;AC3C3C;;AAEG;;;;"}
|
|
@@ -180,7 +180,7 @@ class SliderComponent extends DsControlValueAccessor {
|
|
|
180
180
|
useExisting: forwardRef(() => SliderComponent),
|
|
181
181
|
multi: true,
|
|
182
182
|
},
|
|
183
|
-
], viewQueries: [{ propertyName: "track", first: true, predicate: ["track"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n #track\n class=\"track\"\n (pointerdown)=\"onTrackPointerDown($event)\"\n (pointermove)=\"onTrackPointerMove($event)\"\n (pointerup)=\"onTrackPointerUp($event)\"\n (pointercancel)=\"onTrackPointerUp($event)\">\n <span\n class=\"fill\"\n [style.left.%]=\"fill().left\"\n [style.width.%]=\"fill().width\">\n </span>\n\n @for (thumbValue of thumbValues(); track $index; let i = $index) {\n <span\n class=\"thumb\"\n role=\"slider\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [style.left.%]=\"percent(thumbValue)\"\n [attr.aria-valuemin]=\"thumbMin(i)\"\n [attr.aria-valuemax]=\"thumbMax(i)\"\n [attr.aria-valuenow]=\"thumbValue\"\n [attr.aria-orientation]=\"'horizontal'\"\n [attr.aria-label]=\"thumbAriaLabel(i)\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (keydown)=\"onThumbKeydown($event, i)\">\n </span>\n }\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n", styles: [":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{--_slider-track-height: var(--ds-slider-track-height, var(--slider-track-h));--_slider-thumb-size: var(--ds-slider-thumb-size, var(--slider-thumb-size));--_slider-thumb-
|
|
183
|
+
], viewQueries: [{ propertyName: "track", first: true, predicate: ["track"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n #track\n class=\"track\"\n (pointerdown)=\"onTrackPointerDown($event)\"\n (pointermove)=\"onTrackPointerMove($event)\"\n (pointerup)=\"onTrackPointerUp($event)\"\n (pointercancel)=\"onTrackPointerUp($event)\">\n <span\n class=\"fill\"\n [style.left.%]=\"fill().left\"\n [style.width.%]=\"fill().width\">\n </span>\n\n @for (thumbValue of thumbValues(); track $index; let i = $index) {\n <span\n class=\"thumb\"\n role=\"slider\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [style.left.%]=\"percent(thumbValue)\"\n [attr.aria-valuemin]=\"thumbMin(i)\"\n [attr.aria-valuemax]=\"thumbMax(i)\"\n [attr.aria-valuenow]=\"thumbValue\"\n [attr.aria-orientation]=\"'horizontal'\"\n [attr.aria-label]=\"thumbAriaLabel(i)\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (keydown)=\"onThumbKeydown($event, i)\">\n </span>\n }\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n", styles: [":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{--_slider-track-height: var(--ds-slider-track-height, var(--slider-track-h));--_slider-thumb-size: var(--ds-slider-thumb-size, var(--slider-thumb-size));--_slider-thumb-border-width: var(--ds-slider-thumb-border-width, var(--slider-thumb-border-width));--_slider-fill-color: var(--ds-slider-fill-color, var(--accent));--_slider-track-color: var(--ds-slider-track-color, var(--surface-muted));--_slider-thumb-color: var(--ds-slider-thumb-color, var(--surface-default));--_slider-thumb-border-color: var(--ds-slider-thumb-border-color, var(--accent));display:flex;flex-direction:column;padding-block:calc((var(--_slider-thumb-size) - var(--_slider-track-height)) / 2);gap:calc((var(--_slider-thumb-size) - var(--_slider-track-height)) / 2 + var(--space-1-5))}.track{position:relative;height:var(--_slider-track-height);background-color:var(--_slider-track-color);border-radius:var(--radius-pill);cursor:pointer;touch-action:none}.fill{position:absolute;top:0;height:100%;background-color:var(--_slider-fill-color);border-radius:var(--radius-pill)}.thumb{position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--_slider-thumb-size);height:var(--_slider-thumb-size);border-radius:var(--radius-pill);background-color:var(--_slider-thumb-color);border:var(--_slider-thumb-border-width) solid var(--_slider-thumb-border-color);box-shadow:var(--shadow-card);cursor:grab;touch-action:none}.thumb: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)}.thumb:active{cursor:grabbing}:host(.disabled) .track{cursor:not-allowed}:host(.disabled) .fill{background-color:var(--border-strong)}:host(.disabled) .thumb{border-color:var(--border-strong);cursor:not-allowed}:host(.invalid) .fill{background-color:var(--error)}:host(.invalid) .thumb{border-color:var(--error)}\n"], dependencies: [{ kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }] });
|
|
184
184
|
}
|
|
185
185
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SliderComponent, decorators: [{
|
|
186
186
|
type: Component,
|
|
@@ -194,7 +194,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
194
194
|
'[class.range]': 'range()',
|
|
195
195
|
'[class.disabled]': 'isDisabled()',
|
|
196
196
|
'[class.invalid]': 'invalidResolved()',
|
|
197
|
-
}, template: "<div\n #track\n class=\"track\"\n (pointerdown)=\"onTrackPointerDown($event)\"\n (pointermove)=\"onTrackPointerMove($event)\"\n (pointerup)=\"onTrackPointerUp($event)\"\n (pointercancel)=\"onTrackPointerUp($event)\">\n <span\n class=\"fill\"\n [style.left.%]=\"fill().left\"\n [style.width.%]=\"fill().width\">\n </span>\n\n @for (thumbValue of thumbValues(); track $index; let i = $index) {\n <span\n class=\"thumb\"\n role=\"slider\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [style.left.%]=\"percent(thumbValue)\"\n [attr.aria-valuemin]=\"thumbMin(i)\"\n [attr.aria-valuemax]=\"thumbMax(i)\"\n [attr.aria-valuenow]=\"thumbValue\"\n [attr.aria-orientation]=\"'horizontal'\"\n [attr.aria-label]=\"thumbAriaLabel(i)\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (keydown)=\"onThumbKeydown($event, i)\">\n </span>\n }\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n", styles: [":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{--_slider-track-height: var(--ds-slider-track-height, var(--slider-track-h));--_slider-thumb-size: var(--ds-slider-thumb-size, var(--slider-thumb-size));--_slider-thumb-
|
|
197
|
+
}, template: "<div\n #track\n class=\"track\"\n (pointerdown)=\"onTrackPointerDown($event)\"\n (pointermove)=\"onTrackPointerMove($event)\"\n (pointerup)=\"onTrackPointerUp($event)\"\n (pointercancel)=\"onTrackPointerUp($event)\">\n <span\n class=\"fill\"\n [style.left.%]=\"fill().left\"\n [style.width.%]=\"fill().width\">\n </span>\n\n @for (thumbValue of thumbValues(); track $index; let i = $index) {\n <span\n class=\"thumb\"\n role=\"slider\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [style.left.%]=\"percent(thumbValue)\"\n [attr.aria-valuemin]=\"thumbMin(i)\"\n [attr.aria-valuemax]=\"thumbMax(i)\"\n [attr.aria-valuenow]=\"thumbValue\"\n [attr.aria-orientation]=\"'horizontal'\"\n [attr.aria-label]=\"thumbAriaLabel(i)\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (keydown)=\"onThumbKeydown($event, i)\">\n </span>\n }\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n", styles: [":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{--_slider-track-height: var(--ds-slider-track-height, var(--slider-track-h));--_slider-thumb-size: var(--ds-slider-thumb-size, var(--slider-thumb-size));--_slider-thumb-border-width: var(--ds-slider-thumb-border-width, var(--slider-thumb-border-width));--_slider-fill-color: var(--ds-slider-fill-color, var(--accent));--_slider-track-color: var(--ds-slider-track-color, var(--surface-muted));--_slider-thumb-color: var(--ds-slider-thumb-color, var(--surface-default));--_slider-thumb-border-color: var(--ds-slider-thumb-border-color, var(--accent));display:flex;flex-direction:column;padding-block:calc((var(--_slider-thumb-size) - var(--_slider-track-height)) / 2);gap:calc((var(--_slider-thumb-size) - var(--_slider-track-height)) / 2 + var(--space-1-5))}.track{position:relative;height:var(--_slider-track-height);background-color:var(--_slider-track-color);border-radius:var(--radius-pill);cursor:pointer;touch-action:none}.fill{position:absolute;top:0;height:100%;background-color:var(--_slider-fill-color);border-radius:var(--radius-pill)}.thumb{position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--_slider-thumb-size);height:var(--_slider-thumb-size);border-radius:var(--radius-pill);background-color:var(--_slider-thumb-color);border:var(--_slider-thumb-border-width) solid var(--_slider-thumb-border-color);box-shadow:var(--shadow-card);cursor:grab;touch-action:none}.thumb: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)}.thumb:active{cursor:grabbing}:host(.disabled) .track{cursor:not-allowed}:host(.disabled) .fill{background-color:var(--border-strong)}:host(.disabled) .thumb{border-color:var(--border-strong);cursor:not-allowed}:host(.invalid) .fill{background-color:var(--error)}:host(.invalid) .thumb{border-color:var(--error)}\n"] }]
|
|
198
198
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], track: [{ type: i0.ViewChild, args: ['track', { isSignal: true }] }] } });
|
|
199
199
|
|
|
200
200
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-slider.mjs","sources":["../../../src/lib/components/slider/slider.component.ts","../../../src/lib/components/slider/slider.component.html","../../../src/lib/components/slider/ids-group-ltd-ids-design-system-components-slider.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n model,\n numberAttribute,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DsControlValueAccessor } 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';\n\ntype SliderValue = number | readonly [number, number];\n\n@Component({\n selector: 'ds-slider',\n standalone: true,\n imports: [FieldMessageComponent],\n templateUrl: './slider.component.html',\n styleUrl: './slider.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SliderComponent),\n multi: true,\n },\n ],\n host: {\n '[class.range]': 'range()',\n '[class.disabled]': 'isDisabled()',\n '[class.invalid]': 'invalidResolved()',\n },\n})\nexport class SliderComponent extends DsControlValueAccessor<SliderValue> {\n /** Current value, or `[low, high]` when `range`. Two-way bound. */\n readonly value = model<SliderValue>(0);\n /** Minimum selectable value. */\n readonly min = input(0, { transform: numberAttribute });\n /** Maximum selectable value. */\n readonly max = input(100, { transform: numberAttribute });\n /** Increment applied when dragging (snap) or nudging with arrow keys. */\n readonly step = input(1, { transform: numberAttribute });\n /** Two-thumb range mode — `value` becomes a `[low, high]` tuple. */\n readonly range = input(false, { transform: booleanAttribute });\n /** Disables the slider and blocks all interaction. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Accessible name for the thumb(s) — suffixed \"minimum\"/\"maximum\" in `range` mode. */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly track = viewChild.required<ElementRef<HTMLElement>>('track');\n private dragging = -1;\n\n protected readonly uid = nextControlId('ds-slider');\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 protected readonly invalidResolved = this.fieldMessage.invalid;\n\n protected readonly isDisabled = computed(\n () => this.disabled() || this.formDisabled(),\n );\n\n protected readonly thumbValues = computed<number[]>(() => {\n const value = this.value();\n if (this.range()) {\n const [low, high] = value as readonly [number, number];\n\n return [low, high];\n }\n\n return [value as number];\n });\n\n protected readonly fill = computed<{ left: number; width: number }>(() => {\n const values = this.thumbValues();\n if (this.range()) {\n const low = this.percent(values[0]);\n const high = this.percent(values[1]);\n\n return { left: low, width: high - low };\n }\n\n return { left: 0, width: this.percent(values[0]) };\n });\n\n protected percent(value: number): number {\n const min = this.min();\n const max = this.max();\n\n return max === min ? 0 : ((value - min) / (max - min)) * 100;\n }\n\n protected thumbMin(index: number): number {\n return this.range() && index === 1 ? this.thumbValues()[0] : this.min();\n }\n\n protected thumbMax(index: number): number {\n return this.range() && index === 0 ? this.thumbValues()[1] : this.max();\n }\n\n protected onTrackPointerDown(event: PointerEvent): void {\n if (this.isDisabled()) {\n return;\n }\n const track = this.track().nativeElement;\n track.setPointerCapture(event.pointerId);\n this.dragging = this.nearestThumb(event.clientX);\n this.updateFromClientX(event.clientX);\n track.querySelectorAll<HTMLElement>('.thumb')[this.dragging]?.focus();\n }\n\n protected onTrackPointerMove(event: PointerEvent): void {\n if (this.dragging < 0) {\n return;\n }\n this.updateFromClientX(event.clientX);\n }\n\n // Bound to both pointerup and pointercancel — touch interventions (scroll\n // takeover, stylus lift) fire pointercancel, and without it the drag state\n // would leak and keep moving the thumb with no pointer down.\n protected onTrackPointerUp(event: PointerEvent): void {\n if (this.dragging < 0) {\n return;\n }\n const track = this.track().nativeElement;\n if (track.hasPointerCapture(event.pointerId)) {\n track.releasePointerCapture(event.pointerId);\n }\n this.dragging = -1;\n this.markTouched();\n }\n\n protected thumbAriaLabel(index: number): string | null {\n const base = this.ariaLabel();\n if (!this.range()) {\n return base;\n }\n if (index === 0) {\n return base ? `${base} minimum` : 'Minimum';\n }\n\n return base ? `${base} maximum` : 'Maximum';\n }\n\n protected onThumbKeydown(event: KeyboardEvent, index: number): void {\n if (this.isDisabled()) {\n return;\n }\n const step = this.step() || 1;\n let delta = 0;\n let absolute: number | null = null;\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n delta = step;\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n delta = -step;\n break;\n case 'PageUp':\n delta = step * 10;\n break;\n case 'PageDown':\n delta = -step * 10;\n break;\n case 'Home':\n absolute = this.thumbMin(index);\n break;\n case 'End':\n absolute = this.thumbMax(index);\n break;\n default:\n return;\n }\n event.preventDefault();\n const current = this.thumbValues()[index];\n this.setThumb(index, absolute ?? this.snap(current + delta));\n }\n\n private nearestThumb(clientX: number): number {\n if (!this.range()) {\n return 0;\n }\n const value = this.valueFromClientX(clientX);\n const [low, high] = this.thumbValues();\n\n return Math.abs(value - low) <= Math.abs(value - high) ? 0 : 1;\n }\n\n private updateFromClientX(clientX: number): void {\n this.setThumb(this.dragging, this.snap(this.valueFromClientX(clientX)));\n }\n\n private valueFromClientX(clientX: number): number {\n const rect = this.track().nativeElement.getBoundingClientRect();\n if (rect.width === 0) {\n return this.min();\n }\n const ratio = Math.min(1, Math.max(0, (clientX - rect.left) / rect.width));\n\n return this.min() + ratio * (this.max() - this.min());\n }\n\n private setThumb(index: number, next: number): void {\n if (this.range()) {\n const [low, high] = this.thumbValues();\n this.value.set(\n index === 0 ? [Math.min(next, high), high] : [low, Math.max(next, low)],\n );\n } else {\n this.value.set(next);\n }\n }\n\n private snap(raw: number): number {\n const step = this.step() || 1;\n const min = this.min();\n const snapped = Math.round((raw - min) / step) * step + min;\n\n return Math.min(this.max(), Math.max(min, snapped));\n }\n}\n","<div\n #track\n class=\"track\"\n (pointerdown)=\"onTrackPointerDown($event)\"\n (pointermove)=\"onTrackPointerMove($event)\"\n (pointerup)=\"onTrackPointerUp($event)\"\n (pointercancel)=\"onTrackPointerUp($event)\">\n <span\n class=\"fill\"\n [style.left.%]=\"fill().left\"\n [style.width.%]=\"fill().width\">\n </span>\n\n @for (thumbValue of thumbValues(); track $index; let i = $index) {\n <span\n class=\"thumb\"\n role=\"slider\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [style.left.%]=\"percent(thumbValue)\"\n [attr.aria-valuemin]=\"thumbMin(i)\"\n [attr.aria-valuemax]=\"thumbMax(i)\"\n [attr.aria-valuenow]=\"thumbValue\"\n [attr.aria-orientation]=\"'horizontal'\"\n [attr.aria-label]=\"thumbAriaLabel(i)\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (keydown)=\"onThumbKeydown($event, i)\">\n </span>\n }\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAwCM,MAAO,eAAgB,SAAQ,sBAAmC,CAAA;;AAE7D,IAAA,KAAK,GAAG,KAAK,CAAc,CAAC,4EAAC;;IAE7B,GAAG,GAAG,KAAK,CAAC,CAAC,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;IAE9C,GAAG,GAAG,KAAK,CAAC,GAAG,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;IAEhD,IAAI,GAAG,KAAK,CAAC,CAAC,4EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;IAE/C,KAAK,GAAG,KAAK,CAAC,KAAK,6EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAErD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;AAE9B,IAAA,KAAK,GAAG,SAAS,CAAC,QAAQ,CAA0B,OAAO,CAAC;I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,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECjCH,isCAsCA,swFDfY,qBAAqB,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,WAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAiBpB,eAAe,EAAA,UAAA,EAAA,CAAA;kBApB3B,SAAS;+BACE,WAAW,EAAA,UAAA,EACT,IAAI,EAAA,OAAA,EACP,CAAC,qBAAqB,CAAC,EAAA,aAAA,EAGjB,iBAAiB,CAAC,QAAQ,EAAA,SAAA,EAC9B;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC;AAC9C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EAAA,IAAA,EACK;AACJ,wBAAA,eAAe,EAAE,SAAS;AAC1B,wBAAA,kBAAkB,EAAE,cAAc;AAClC,wBAAA,iBAAiB,EAAE,mBAAmB;AACvC,qBAAA,EAAA,QAAA,EAAA,isCAAA,EAAA,MAAA,EAAA,CAAA,8sFAAA,CAAA,EAAA;yuBAkBoE,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExD9E;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-slider.mjs","sources":["../../../src/lib/components/slider/slider.component.ts","../../../src/lib/components/slider/slider.component.html","../../../src/lib/components/slider/ids-group-ltd-ids-design-system-components-slider.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n model,\n numberAttribute,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DsControlValueAccessor } 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';\n\ntype SliderValue = number | readonly [number, number];\n\n@Component({\n selector: 'ds-slider',\n standalone: true,\n imports: [FieldMessageComponent],\n templateUrl: './slider.component.html',\n styleUrl: './slider.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SliderComponent),\n multi: true,\n },\n ],\n host: {\n '[class.range]': 'range()',\n '[class.disabled]': 'isDisabled()',\n '[class.invalid]': 'invalidResolved()',\n },\n})\nexport class SliderComponent extends DsControlValueAccessor<SliderValue> {\n /** Current value, or `[low, high]` when `range`. Two-way bound. */\n readonly value = model<SliderValue>(0);\n /** Minimum selectable value. */\n readonly min = input(0, { transform: numberAttribute });\n /** Maximum selectable value. */\n readonly max = input(100, { transform: numberAttribute });\n /** Increment applied when dragging (snap) or nudging with arrow keys. */\n readonly step = input(1, { transform: numberAttribute });\n /** Two-thumb range mode — `value` becomes a `[low, high]` tuple. */\n readonly range = input(false, { transform: booleanAttribute });\n /** Disables the slider and blocks all interaction. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Accessible name for the thumb(s) — suffixed \"minimum\"/\"maximum\" in `range` mode. */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly track = viewChild.required<ElementRef<HTMLElement>>('track');\n private dragging = -1;\n\n protected readonly uid = nextControlId('ds-slider');\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 protected readonly invalidResolved = this.fieldMessage.invalid;\n\n protected readonly isDisabled = computed(\n () => this.disabled() || this.formDisabled(),\n );\n\n protected readonly thumbValues = computed<number[]>(() => {\n const value = this.value();\n if (this.range()) {\n const [low, high] = value as readonly [number, number];\n\n return [low, high];\n }\n\n return [value as number];\n });\n\n protected readonly fill = computed<{ left: number; width: number }>(() => {\n const values = this.thumbValues();\n if (this.range()) {\n const low = this.percent(values[0]);\n const high = this.percent(values[1]);\n\n return { left: low, width: high - low };\n }\n\n return { left: 0, width: this.percent(values[0]) };\n });\n\n protected percent(value: number): number {\n const min = this.min();\n const max = this.max();\n\n return max === min ? 0 : ((value - min) / (max - min)) * 100;\n }\n\n protected thumbMin(index: number): number {\n return this.range() && index === 1 ? this.thumbValues()[0] : this.min();\n }\n\n protected thumbMax(index: number): number {\n return this.range() && index === 0 ? this.thumbValues()[1] : this.max();\n }\n\n protected onTrackPointerDown(event: PointerEvent): void {\n if (this.isDisabled()) {\n return;\n }\n const track = this.track().nativeElement;\n track.setPointerCapture(event.pointerId);\n this.dragging = this.nearestThumb(event.clientX);\n this.updateFromClientX(event.clientX);\n track.querySelectorAll<HTMLElement>('.thumb')[this.dragging]?.focus();\n }\n\n protected onTrackPointerMove(event: PointerEvent): void {\n if (this.dragging < 0) {\n return;\n }\n this.updateFromClientX(event.clientX);\n }\n\n // Bound to both pointerup and pointercancel — touch interventions (scroll\n // takeover, stylus lift) fire pointercancel, and without it the drag state\n // would leak and keep moving the thumb with no pointer down.\n protected onTrackPointerUp(event: PointerEvent): void {\n if (this.dragging < 0) {\n return;\n }\n const track = this.track().nativeElement;\n if (track.hasPointerCapture(event.pointerId)) {\n track.releasePointerCapture(event.pointerId);\n }\n this.dragging = -1;\n this.markTouched();\n }\n\n protected thumbAriaLabel(index: number): string | null {\n const base = this.ariaLabel();\n if (!this.range()) {\n return base;\n }\n if (index === 0) {\n return base ? `${base} minimum` : 'Minimum';\n }\n\n return base ? `${base} maximum` : 'Maximum';\n }\n\n protected onThumbKeydown(event: KeyboardEvent, index: number): void {\n if (this.isDisabled()) {\n return;\n }\n const step = this.step() || 1;\n let delta = 0;\n let absolute: number | null = null;\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n delta = step;\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n delta = -step;\n break;\n case 'PageUp':\n delta = step * 10;\n break;\n case 'PageDown':\n delta = -step * 10;\n break;\n case 'Home':\n absolute = this.thumbMin(index);\n break;\n case 'End':\n absolute = this.thumbMax(index);\n break;\n default:\n return;\n }\n event.preventDefault();\n const current = this.thumbValues()[index];\n this.setThumb(index, absolute ?? this.snap(current + delta));\n }\n\n private nearestThumb(clientX: number): number {\n if (!this.range()) {\n return 0;\n }\n const value = this.valueFromClientX(clientX);\n const [low, high] = this.thumbValues();\n\n return Math.abs(value - low) <= Math.abs(value - high) ? 0 : 1;\n }\n\n private updateFromClientX(clientX: number): void {\n this.setThumb(this.dragging, this.snap(this.valueFromClientX(clientX)));\n }\n\n private valueFromClientX(clientX: number): number {\n const rect = this.track().nativeElement.getBoundingClientRect();\n if (rect.width === 0) {\n return this.min();\n }\n const ratio = Math.min(1, Math.max(0, (clientX - rect.left) / rect.width));\n\n return this.min() + ratio * (this.max() - this.min());\n }\n\n private setThumb(index: number, next: number): void {\n if (this.range()) {\n const [low, high] = this.thumbValues();\n this.value.set(\n index === 0 ? [Math.min(next, high), high] : [low, Math.max(next, low)],\n );\n } else {\n this.value.set(next);\n }\n }\n\n private snap(raw: number): number {\n const step = this.step() || 1;\n const min = this.min();\n const snapped = Math.round((raw - min) / step) * step + min;\n\n return Math.min(this.max(), Math.max(min, snapped));\n }\n}\n","<div\n #track\n class=\"track\"\n (pointerdown)=\"onTrackPointerDown($event)\"\n (pointermove)=\"onTrackPointerMove($event)\"\n (pointerup)=\"onTrackPointerUp($event)\"\n (pointercancel)=\"onTrackPointerUp($event)\">\n <span\n class=\"fill\"\n [style.left.%]=\"fill().left\"\n [style.width.%]=\"fill().width\">\n </span>\n\n @for (thumbValue of thumbValues(); track $index; let i = $index) {\n <span\n class=\"thumb\"\n role=\"slider\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [style.left.%]=\"percent(thumbValue)\"\n [attr.aria-valuemin]=\"thumbMin(i)\"\n [attr.aria-valuemax]=\"thumbMax(i)\"\n [attr.aria-valuenow]=\"thumbValue\"\n [attr.aria-orientation]=\"'horizontal'\"\n [attr.aria-label]=\"thumbAriaLabel(i)\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n (keydown)=\"onThumbKeydown($event, i)\">\n </span>\n }\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAwCM,MAAO,eAAgB,SAAQ,sBAAmC,CAAA;;AAE7D,IAAA,KAAK,GAAG,KAAK,CAAc,CAAC,4EAAC;;IAE7B,GAAG,GAAG,KAAK,CAAC,CAAC,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;IAE9C,GAAG,GAAG,KAAK,CAAC,GAAG,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;IAEhD,IAAI,GAAG,KAAK,CAAC,CAAC,4EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;IAE/C,KAAK,GAAG,KAAK,CAAC,KAAK,6EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAErD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;AAE9B,IAAA,KAAK,GAAG,SAAS,CAAC,QAAQ,CAA0B,OAAO,CAAC;IACrE,QAAQ,GAAG,CAAC,CAAC;AAEF,IAAA,GAAG,GAAG,aAAa,CAAC,WAAW,CAAC;IAChC,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