@ids-group-ltd/ids-design-system 0.15.3 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -4
- package/design-system.md +24 -0
- package/eslint/deprecated-api.json +14 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +3 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +217 -18
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +17 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +13 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/migrations/0.15.1.json +4 -2
- package/migrations/0.15.3.json +14 -4
- package/migrations/1.0.0.json +41 -0
- package/migrations/1.0.1.json +36 -0
- package/package.json +1 -1
- package/schematics/check-overrides/surface.json +1 -1
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +23 -1
- package/types/ids-group-ltd-ids-design-system-components.d.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
## Unreleased
|
|
2
2
|
|
|
3
|
+
## 1.0.1 — 2026-10-22
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- **Validation errors show once a field is touched; `[dsSubmitted]` and `DS_SUBMITTED` are
|
|
8
|
+
removed.** A field bound to a form model reveals its validation errors once it is touched, and
|
|
9
|
+
the unparseable-date error of `ds-date-picker` shows on blur. `[touched]` is an input of every DS
|
|
10
|
+
field. Remove any `[dsSubmitted]` binding, `SubmittedDirective` import and `DS_SUBMITTED`
|
|
11
|
+
provider.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **A 12-hour `ds-time-picker` no longer closes before AM/PM is chosen.** Picking the hour and then
|
|
16
|
+
the minute closed the panel before the AM/PM column was reached, and the time kept the previous
|
|
17
|
+
AM or PM: from 8:45 PM, picking 9 and 00 gave 9:00 PM. In `'single'` mode on a 12-hour clock the
|
|
18
|
+
panel now stays open until the hour, the minute and AM/PM have each been picked since it opened,
|
|
19
|
+
in any order; the 24-hour clock still closes on the hour and the minute. Nothing to change in
|
|
20
|
+
your code.
|
|
21
|
+
|
|
22
|
+
## 1.0.0 — 2026-10-21
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **`dsTooltipAncestor`: a focusable card opens the clipped values inside it.** Put the attribute
|
|
27
|
+
on a focusable element that is not a control (a card, a tile with `tabindex="0"`): keyboard focus
|
|
28
|
+
on it opens the tip of its first clipped `dsTooltipWhenClipped` value, and that value takes no tab
|
|
29
|
+
stop of its own. Without the attribute such an element opens nothing, as before.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- **`ds-time-picker` scrolls to a picked value and selects by scrolling.** A click or an arrow key
|
|
34
|
+
scrolls the column smoothly to centre the cell (instantly on open, and under
|
|
35
|
+
`prefers-reduced-motion`). One wheel notch moves a column by about one row, and cells snap to the
|
|
36
|
+
centre after wheel or touch scrolling. While a wheel, touch or scrollbar scroll runs, the centred
|
|
37
|
+
enabled cell becomes the value as it passes the centre and the time picker emits `valueChange`
|
|
38
|
+
each time; the panel stays open. In single mode it closes once both the hour and the
|
|
39
|
+
minute have been picked by click or key (a scroll pick counts toward neither), or on Escape, an
|
|
40
|
+
outside click, or a page scroll. Handle `valueChange` as a value that can change several times
|
|
41
|
+
while the panel is open.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **`dsTooltipWhenClipped` no longer trips Firefox's "ResizeObserver loop completed with undelivered
|
|
46
|
+
notifications".** The `tabindex` a clipped host takes or loses after a resize is written in the
|
|
47
|
+
next animation frame instead of inside the observer callback. Firefox raised the error for hosts
|
|
48
|
+
under `content-visibility: auto`, and it reached every `error` listener on `window`.
|
|
49
|
+
|
|
50
|
+
- **`focusBoundControl()` from `@angular/forms/signals` focuses a DS field.** On every DS form
|
|
51
|
+
control, and on `ds-search`, calling `focus()` on the host element now focuses the control's own
|
|
52
|
+
input or trigger; before, signal forms focused the host itself and focus stayed where it was.
|
|
53
|
+
|
|
3
54
|
## 0.15.3 — 2026-10-20
|
|
4
55
|
|
|
5
56
|
### Added
|
|
@@ -41,10 +92,13 @@
|
|
|
41
92
|
- **`ds-table` lays columns out as 0.15.0 did by default: `layout` and `DsConfig.table.layout`
|
|
42
93
|
default to `'auto'`, where they defaulted to `'fixed'`.** Each column follows its cell content,
|
|
43
94
|
`kind` has no effect, and a numeric `width`, `width: 'content'`, `minWidth` and `truncate` size
|
|
44
|
-
the column as on 0.15.0.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
95
|
+
the column as on 0.15.0. The widths change for an app coming from 0.15.1 or 0.15.2 that sets no
|
|
96
|
+
`layout`; an app coming from 0.15.0 or earlier keeps the widths it had. `'auto'` stays deprecated
|
|
97
|
+
and will be removed, in a release not yet set, leaving `'fixed'` as the one layout: a binding or
|
|
98
|
+
config key that sets `'auto'` changes nothing now, and a development build warns once per page
|
|
99
|
+
while one does. To keep the 0.15.1 widths: `provideDsConfig({ table: { layout: 'fixed' } })`, or
|
|
100
|
+
`layout="fixed"` on one table. A table with `virtualScroll` keeps `table-layout: fixed` either
|
|
101
|
+
way.
|
|
48
102
|
|
|
49
103
|
- **A `dsTooltipWhenClipped` tip (`TooltipDirective`) also opens on text cut by lines.** A block
|
|
50
104
|
under `line-clamp`, or any host whose text overflows its height under `overflow: hidden` or
|
package/design-system.md
CHANGED
|
@@ -291,6 +291,30 @@ error cannot greet an untouched form and a half-typed address is not yet wrong.
|
|
|
291
291
|
`error` string is the deliberate exception — binding it says the consumer has already decided,
|
|
292
292
|
so it shows immediately.
|
|
293
293
|
|
|
294
|
+
### Submitting a form: the button stays enabled until the first error
|
|
295
|
+
|
|
296
|
+
The library does not decide when a form is submitted; the app does, with one flag of its own.
|
|
297
|
+
|
|
298
|
+
- **Before the first submit attempt the user is right.** The submit button is enabled and no
|
|
299
|
+
error shows. A simple required field carries `required` (the asterisk) and nothing more; a rule
|
|
300
|
+
the user cannot guess - a format, a length, a range, an order between two dates - goes in `hint`
|
|
301
|
+
up front.
|
|
302
|
+
- **The submit handler sets `submitted` first, then validates the whole form.** When it fails,
|
|
303
|
+
every invalid field shows its error at once, focus moves to the first invalid field in DOM order,
|
|
304
|
+
and nothing is sent.
|
|
305
|
+
- **From then on the form is live**: `[disabled]="submitted() && invalid()"`, so fixing a field
|
|
306
|
+
clears its error and re-enables the button at once. Reset `submitted` when the form is opened or
|
|
307
|
+
reset for new data.
|
|
308
|
+
- **In flight, `[loading]` alone.** A loading `ds-button` blocks presses and keeps focus; never put
|
|
309
|
+
the loading flag in `[disabled]`.
|
|
310
|
+
- **Drive the message with an `error` string computed from the flag**:
|
|
311
|
+
`nameError = computed(() => submitted() && !name().trim() ? 'Enter a name.' : '')`. A form
|
|
312
|
+
model's own errors follow `touched` (above) and so appear on blur; pass the text as `error` when
|
|
313
|
+
the form must stay silent until the submit.
|
|
314
|
+
- **A button tied to one picker is not a form submit.** Choose an item, then "Add" / "Link" /
|
|
315
|
+
"Move": that button stays disabled until something is chosen, and so does a button waiting on a
|
|
316
|
+
state no field can fix.
|
|
317
|
+
|
|
294
318
|
---
|
|
295
319
|
|
|
296
320
|
## 7. Overriding a component
|
|
@@ -687,6 +687,13 @@
|
|
|
687
687
|
"since": "0.7.0",
|
|
688
688
|
"itemId": "0.7.0#size-type-spinner-to-dssize"
|
|
689
689
|
},
|
|
690
|
+
{
|
|
691
|
+
"name": "SubmittedDirective",
|
|
692
|
+
"replacement": null,
|
|
693
|
+
"renamed": false,
|
|
694
|
+
"since": "1.0.1",
|
|
695
|
+
"itemId": "1.0.1#submitted-directive-removed"
|
|
696
|
+
},
|
|
690
697
|
{
|
|
691
698
|
"name": "SwitchSize",
|
|
692
699
|
"replacement": "DsSize",
|
|
@@ -878,6 +885,13 @@
|
|
|
878
885
|
"since": "0.5.1",
|
|
879
886
|
"itemId": "0.5.1#tabs-tabclose-output-rename"
|
|
880
887
|
},
|
|
888
|
+
{
|
|
889
|
+
"owner": "TimePickerComponent",
|
|
890
|
+
"name": "valueChange",
|
|
891
|
+
"replacement": null,
|
|
892
|
+
"since": "1.0.0",
|
|
893
|
+
"itemId": "1.0.0#time-picker-value-changes-while-scrolling"
|
|
894
|
+
},
|
|
881
895
|
{
|
|
882
896
|
"owner": "ToastComponent",
|
|
883
897
|
"name": "dismissed",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-empty-state.mjs","sources":["../../../src/lib/components/empty-state/empty-state.component.ts","../../../src/lib/components/empty-state/empty-state.component.html","../../../src/lib/components/empty-state/ids-group-ltd-ids-design-system-components-empty-state.ts"],"sourcesContent":["import { Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { LoadingOverlayComponent } from '@ids-group-ltd/ids-design-system/components/loading-overlay';\nimport { TooltipDirective } from '@ids-group-ltd/ids-design-system/components/tooltip';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport type {
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-empty-state.mjs","sources":["../../../src/lib/components/empty-state/empty-state.component.ts","../../../src/lib/components/empty-state/empty-state.component.html","../../../src/lib/components/empty-state/ids-group-ltd-ids-design-system-components-empty-state.ts"],"sourcesContent":["import { Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { LoadingOverlayComponent } from '@ids-group-ltd/ids-design-system/components/loading-overlay';\nimport { TooltipDirective } from '@ids-group-ltd/ids-design-system/components/tooltip';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport type {\n EmptyStateTitleOverflow,\n EmptyStateVariant,\n} from './empty-state.types';\n\n@Component({\n selector: 'ds-empty-state',\n standalone: true,\n imports: [IconComponent, LoadingOverlayComponent, TooltipDirective],\n templateUrl: './empty-state.component.html',\n styleUrl: './empty-state.component.scss',\n host: { '[attr.title]': 'null' },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class EmptyStateComponent {\n /** Drives the default icon; `'loading'` shows a loading overlay. */\n readonly variant = input<EmptyStateVariant>('none');\n /** Override the variant's default icon. */\n readonly icon = input<IconName | null>(null);\n /** Optional heading below the icon. */\n readonly title = input<string>('');\n /** `'wrap'` breaks a long title over lines; `'clip'` keeps one line, ends it with an ellipsis\n * and shows the full title in a tooltip. */\n readonly titleOverflow = input<EmptyStateTitleOverflow>('wrap');\n /** Optional supporting text below the title. */\n readonly body = input<string>('');\n\n protected readonly classes = computed(() => {\n const variant = this.variant();\n\n return variant === 'none' ? 'empty-state' : `empty-state ${variant}`;\n });\n\n protected readonly resolvedIcon = computed<IconName>(() => {\n const explicit = this.icon();\n if (explicit) {\n return explicit;\n }\n const variant = this.variant();\n if (variant === 'error') {\n return 'warn';\n }\n if (variant === 'locked') {\n return 'lock';\n }\n if (variant === 'success') {\n return 'success';\n }\n if (variant === 'loading') {\n return 'package';\n }\n\n return 'package';\n });\n}\n","<ds-loading-overlay\n spinnerSize=\"lg\"\n [loading]=\"variant() === 'loading'\"\n [blur]=\"true\">\n <span [class]=\"classes()\">\n <span class=\"icon-tile\">\n <ds-icon\n [name]=\"resolvedIcon()\"\n [size]=\"28\">\n </ds-icon>\n </span>\n\n @if (title()) {\n <span\n class=\"title\"\n [class.clip]=\"titleOverflow() === 'clip'\"\n [dsTooltipWhenClipped]=\"titleOverflow() === 'clip'\">\n {{ title() }}\n </span>\n }\n\n @if (body()) {\n <span class=\"body\">\n {{ body() }}\n </span>\n }\n\n <span class=\"cta\">\n <ng-content select=\"[actions]\"></ng-content>\n </span>\n </span>\n</ds-loading-overlay>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAmBa,mBAAmB,CAAA;;AAErB,IAAA,OAAO,GAAG,KAAK,CAAoB,MAAM,8EAAC;;AAE1C,IAAA,IAAI,GAAG,KAAK,CAAkB,IAAI,2EAAC;;AAEnC,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AAClC;AAC6C;AACpC,IAAA,aAAa,GAAG,KAAK,CAA0B,MAAM,oFAAC;;AAEtD,IAAA,IAAI,GAAG,KAAK,CAAS,EAAE,2EAAC;AAEd,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;AAE9B,QAAA,OAAO,OAAO,KAAK,MAAM,GAAG,aAAa,GAAG,CAAA,YAAA,EAAe,OAAO,EAAE;AACtE,IAAA,CAAC,8EAAC;AAEiB,IAAA,YAAY,GAAG,QAAQ,CAAW,MAAK;AACxD,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE;QAC5B,IAAI,QAAQ,EAAE;AACZ,YAAA,OAAO,QAAQ;QACjB;AACA,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;AAC9B,QAAA,IAAI,OAAO,KAAK,OAAO,EAAE;AACvB,YAAA,OAAO,MAAM;QACf;AACA,QAAA,IAAI,OAAO,KAAK,QAAQ,EAAE;AACxB,YAAA,OAAO,MAAM;QACf;AACA,QAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,YAAA,OAAO,SAAS;QAClB;AACA,QAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,YAAA,OAAO,SAAS;QAClB;AAEA,QAAA,OAAO,SAAS;AAClB,IAAA,CAAC,mFAAC;wGAvCS,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,mBAAmB,svBCnBhC,mtBAgCA,EAAA,MAAA,EAAA,CAAA,4xGAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDnBY,aAAa,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,uBAAuB,gJAAE,gBAAgB,EAAA,QAAA,EAAA,qCAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,gBAAA,EAAA,gBAAA,EAAA,sBAAA,EAAA,qBAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAMvD,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAT/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,cACd,IAAI,EAAA,OAAA,EACP,CAAC,aAAa,EAAE,uBAAuB,EAAE,gBAAgB,CAAC,EAAA,IAAA,EAG7D,EAAE,cAAc,EAAE,MAAM,EAAE,EAAA,aAAA,EACjB,iBAAiB,CAAC,QAAQ,EAAA,QAAA,EAAA,mtBAAA,EAAA,MAAA,EAAA,CAAA,4xGAAA,CAAA,EAAA;;;AEjB3C;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, booleanAttribute, model, computed, output, numberAttribute, viewChild, signal, effect, forwardRef, ViewEncapsulation, Component } from '@angular/core';
|
|
2
|
+
import { inject, input, booleanAttribute, model, computed, output, numberAttribute, viewChild, signal, ElementRef, effect, forwardRef, ViewEncapsulation, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
5
|
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
@@ -49,6 +49,8 @@ class SearchComponent {
|
|
|
49
49
|
/** The last text pushed into `value`, to tell a host update from the component's own echo: a host reset mid-typing must win. */
|
|
50
50
|
pushed = this.value();
|
|
51
51
|
constructor() {
|
|
52
|
+
// focusBoundControl() calls focus() on the host; see DsControlValueAccessor.
|
|
53
|
+
inject(ElementRef).nativeElement.focus = (options) => this.focus(options);
|
|
52
54
|
effect(() => {
|
|
53
55
|
const incoming = this.value();
|
|
54
56
|
if (incoming !== this.pushed) {
|
|
@@ -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 inject,\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 { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\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 * A toolbar filter with no message row; where a label or error line is needed, use `ds-input`.\n */\nexport class SearchComponent implements ControlValueAccessor {\n protected readonly intl = inject(DS_INTL);\n protected readonly inGroup = inFieldGroup();\n\n private readonly bridge = valueControlBridge<string>(() => this.value);\n\n /** Inline `display`, not the attribute: the host sets its own `display`, which beats the UA `[hidden]` rule. */\n readonly hidden = input(false, { transform: booleanAttribute });\n\n /** Driven by the forms API, OR'd into `isDisabled`. */\n protected readonly formDisabled = this.bridge.formDisabled;\n\n /** Search text, two-way bound. */\n readonly value = model<string>('');\n /** Placeholder when empty; falls back to `DS_INTL.search.placeholder`. */\n readonly placeholder = input<string | null>(null);\n readonly placeholderResolved = computed(\n () => this.placeholder() ?? this.intl().search.placeholder,\n );\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; 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) writes on every keystroke.\n * Clearing bypasses the delay and Enter flushes; the displayed text 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` so typing never waits on the timer. */\n protected readonly text = signal(this.value());\n\n private pending: ReturnType<typeof setTimeout> | null = null;\n /** The last text pushed into `value`, to tell a host update from the component's own echo: a host reset mid-typing must win. */\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 /** Moves focus to the search input. */\n focus(options?: FocusOptions): void {\n this.inputEl()?.nativeElement.focus(options);\n }\n\n /** Drops focus from the search input. */\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 * Writing `''` into `value` is not equivalent: the timer is cancelled only when the text differs from the last pushed value. */\n clear(): void {\n this.text.set('');\n this.cancel();\n this.push('');\n // The × is removed once empty, so focus would fall to <body>.\n this.inputEl()?.nativeElement.focus();\n }\n\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]=\"placeholderResolved()\"\n [attr.aria-label]=\"ariaLabel() || placeholderResolved() || 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 [attr.aria-label]=\"intl().search.clear\"\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":";;;;;;;;;AAgDA;;AAEG;MACU,eAAe,CAAA;AACP,IAAA,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;IACtB,OAAO,GAAG,YAAY,EAAE;IAE1B,MAAM,GAAG,kBAAkB,CAAS,MAAM,IAAI,CAAC,KAAK,CAAC;;IAG7D,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,CAAgB,IAAI,kFAAC;IACxC,mBAAmB,GAAG,QAAQ,CACrC,MAAM,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,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CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,aAAa,qGAAE,wBAAwB,EAAA,QAAA,EAAA,qBAAA,EAAA,CAAA,EAAA,CAAA;;4FAmBnD,eAAe,EAAA,UAAA,EAAA,CAAA;kBAtB3B,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,s6BAAA,EAAA,MAAA,EAAA,CAAA,8qLAAA,CAAA,EAAA;0nCAkDyC,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEhGzD;;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 inject,\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 { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\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 * A toolbar filter with no message row; where a label or error line is needed, use `ds-input`.\n */\nexport class SearchComponent implements ControlValueAccessor {\n protected readonly intl = inject(DS_INTL);\n protected readonly inGroup = inFieldGroup();\n\n private readonly bridge = valueControlBridge<string>(() => this.value);\n\n /** Inline `display`, not the attribute: the host sets its own `display`, which beats the UA `[hidden]` rule. */\n readonly hidden = input(false, { transform: booleanAttribute });\n\n /** Driven by the forms API, OR'd into `isDisabled`. */\n protected readonly formDisabled = this.bridge.formDisabled;\n\n /** Search text, two-way bound. */\n readonly value = model<string>('');\n /** Placeholder when empty; falls back to `DS_INTL.search.placeholder`. */\n readonly placeholder = input<string | null>(null);\n readonly placeholderResolved = computed(\n () => this.placeholder() ?? this.intl().search.placeholder,\n );\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; 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) writes on every keystroke.\n * Clearing bypasses the delay and Enter flushes; the displayed text 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` so typing never waits on the timer. */\n protected readonly text = signal(this.value());\n\n private pending: ReturnType<typeof setTimeout> | null = null;\n /** The last text pushed into `value`, to tell a host update from the component's own echo: a host reset mid-typing must win. */\n private pushed = this.value();\n\n constructor() {\n // focusBoundControl() calls focus() on the host; see DsControlValueAccessor.\n inject<ElementRef<HTMLElement>>(ElementRef).nativeElement.focus = (\n options?: FocusOptions,\n ) => this.focus(options);\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 /** Moves focus to the search input. */\n focus(options?: FocusOptions): void {\n this.inputEl()?.nativeElement.focus(options);\n }\n\n /** Drops focus from the search input. */\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 * Writing `''` into `value` is not equivalent: the timer is cancelled only when the text differs from the last pushed value. */\n clear(): void {\n this.text.set('');\n this.cancel();\n this.push('');\n // The × is removed once empty, so focus would fall to <body>.\n this.inputEl()?.nativeElement.focus();\n }\n\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]=\"placeholderResolved()\"\n [attr.aria-label]=\"ariaLabel() || placeholderResolved() || 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 [attr.aria-label]=\"intl().search.clear\"\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":";;;;;;;;;AAgDA;;AAEG;MACU,eAAe,CAAA;AACP,IAAA,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;IACtB,OAAO,GAAG,YAAY,EAAE;IAE1B,MAAM,GAAG,kBAAkB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