@ids-group-ltd/ids-design-system 0.11.1 → 0.11.2
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 +225 -31
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +1336 -595
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.11.0.json +0 -45
- package/migrations/0.11.1.json +9 -35
- package/migrations/0.11.2.json +158 -0
- package/migrations/0.2.0.json +17 -5
- package/migrations/0.4.0.json +1 -1
- package/migrations/0.7.1.json +3 -3
- package/migrations/0.9.0.json +2 -2
- package/package.json +1 -1
- package/styles/_dropdown-overlay.scss +29 -10
- package/styles/_tokens.scss +1 -1
- package/themes/README.md +3 -3
- package/types/ids-group-ltd-ids-design-system.d.ts +339 -28
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, makeEnvironmentProviders, provideEnvironmentInitializer, PLATFORM_ID, Injectable, computed, input, numberAttribute, isDevMode, ViewEncapsulation, Component, Directive, effect, Injector, DestroyRef, signal, afterNextRender, booleanAttribute, output, viewChild, model, ChangeDetectionStrategy, contentChild, ViewContainerRef, ElementRef, forwardRef, TemplateRef, contentChildren, linkedSignal, viewChildren, HostListener, HostBinding,
|
|
2
|
+
import { InjectionToken, inject, makeEnvironmentProviders, provideEnvironmentInitializer, PLATFORM_ID, Injectable, computed, input, numberAttribute, isDevMode, ViewEncapsulation, Component, Directive, effect, Injector, DestroyRef, signal, afterNextRender, booleanAttribute, output, viewChild, model, ChangeDetectionStrategy, contentChild, ViewContainerRef, ElementRef, forwardRef, TemplateRef, contentChildren, DOCUMENT as DOCUMENT$1, afterRenderEffect, linkedSignal, viewChildren, HostListener, HostBinding, untracked } from '@angular/core';
|
|
3
3
|
import { isPlatformBrowser, DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -882,16 +882,18 @@ class ButtonComponent extends DsMessageBase {
|
|
|
882
882
|
message = this.fieldMessage.message;
|
|
883
883
|
constructor() {
|
|
884
884
|
super();
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
885
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
886
|
+
devWarn(() => {
|
|
887
|
+
const variant = this.variant();
|
|
888
|
+
if (variant === 'text') {
|
|
889
|
+
return '[ds-button] variant="text" is discouraged — prefer the global `.link` class for link-styled actions. It renders, but `.link` is the canonical link affordance.';
|
|
890
|
+
}
|
|
891
|
+
const reason = DISCOURAGED_COMBOS.get(`${this.color()}|${variant}`);
|
|
892
|
+
return reason
|
|
893
|
+
? `[ds-button] color="${this.color()}" variant="${variant}" is a UX-discouraged combination — it renders, but ${reason}.`
|
|
894
|
+
: null;
|
|
895
|
+
});
|
|
896
|
+
}
|
|
895
897
|
}
|
|
896
898
|
onClick(event) {
|
|
897
899
|
// A soft-disabled button is only `aria-disabled`, so the browser still
|
|
@@ -1794,8 +1796,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1794
1796
|
args: [{ selector: 'ds-auth-layout', standalone: true, imports: [CardComponent], encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"auth\">\n <header class=\"masthead\">\n <div class=\"brand\">\n <ng-content select=\"[brand]\"></ng-content>\n\n @if (letterGlyph() || brandName()) {\n <span\n class=\"mark\"\n aria-hidden=\"true\"\n >\n {{ markGlyph() }}\n </span>\n }\n\n @if (brandName() || hasBrandName()) {\n <span class=\"brand-name\">\n @if (hasBrandName()) {\n <ng-content select=\"[dsBrandName]\"></ng-content>\n } @else {\n {{ brandName() }}\n }\n </span>\n }\n </div>\n\n @if (taglineText()) {\n <p class=\"tagline\">\n {{ taglineText() }}\n </p>\n }\n </header>\n\n <ds-card\n class=\"card\"\n [attr.role]=\"landmark() === 'main' ? 'main' : null\"\n [elevation]=\"cardElevation()\"\n [padding]=\"cardPadding()\"\n >\n <ng-content></ng-content>\n </ds-card>\n\n <footer class=\"support\">\n <ng-content select=\"[dsAuthSupport]\"></ng-content>\n </footer>\n</div>\n", styles: ["@charset \"UTF-8\";:host{--_auth-min-height: var(--ds-auth-layout-min-height, 100dvh);--_auth-bg-color: var(--ds-auth-layout-bg-color, var(--surface-canvas));--_auth-gap: var(--ds-auth-layout-gap, clamp(var(--space-4), 4svh, var(--space-8)));--_auth-pad-block: var(--ds-auth-layout-pad-block, clamp(var(--space-4), 5svh, var(--space-10)));--_auth-mark-size: var(--ds-auth-layout-mark-size, clamp(var(--space-6), 4svh, var(--space-8)));--_auth-mark-radius: var(--ds-auth-layout-mark-radius, var(--ds-radius-control));--_auth-card-max-width: var(--ds-auth-layout-card-max-width, var(--auth-card-w));--_auth-mark-bg-color: var(--ds-auth-layout-mark-bg-color, var(--accent));--_auth-mark-label-color: var(--ds-auth-layout-mark-label-color, var(--accent-on));box-sizing:border-box;display:flex;min-height:var(--_auth-min-height);background-color:var(--_auth-bg-color);padding-block:calc(var(--_auth-pad-block) + env(safe-area-inset-top,0px)) calc(var(--_auth-pad-block) + env(safe-area-inset-bottom,0px));padding-left:calc(var(--space-4) + env(safe-area-inset-left,0px));padding-right:calc(var(--space-4) + env(safe-area-inset-right,0px))}.auth{display:flex;flex-direction:column;align-items:center;gap:var(--_auth-gap);margin:auto;width:100%;max-width:var(--_auth-card-max-width)}.masthead{display:flex;flex-direction:column;align-items:center;gap:clamp(var(--space-1),1svh,var(--space-2))}.masthead:has(>.brand:not(:has(*))):not(:has(>.tagline)){display:none}.brand{display:inline-flex;align-items:center;gap:var(--space-2)}.brand:not(:has(*)){display:none}.brand ::ng-deep>[brand]{max-height:var(--ds-auth-layout-brand-max-height, none)}.mark{display:grid;place-items:center;width:var(--_auth-mark-size);height:var(--_auth-mark-size);flex-shrink:0;border-radius:var(--_auth-mark-radius);background-color:var(--_auth-mark-bg-color);color:var(--_auth-mark-label-color);font:var(--font-weight-bold) var(--font-size-m)/1 var(--font-sans)}.brand-name{font:var(--font-weight-extrabold) var(--font-size-h4)/var(--line-height-snug) var(--font-sans);color:var(--text-primary)}.tagline{margin:0;color:var(--text-secondary);font-size:var(--font-size-s);text-align:center}.card{width:100%}.support{color:var(--text-tertiary);font-size:var(--font-size-xs);text-align:center}.support:empty{display:none}\n"] }]
|
|
1795
1797
|
}], propDecorators: { brand: [{ type: i0.Input, args: [{ isSignal: true, alias: "brand", required: false }] }], logoLetter: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoLetter", required: false }] }], tagline: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagline", required: false }] }], cardElevation: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardElevation", required: false }] }], cardPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardPadding", required: false }] }], landmark: [{ type: i0.Input, args: [{ isSignal: true, alias: "landmark", required: false }] }], brandNameRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrandNameDirective), { isSignal: true }] }] } });
|
|
1796
1798
|
|
|
1797
|
-
/** Public enter-motion tokens read by every `ds-overlay-pane`
|
|
1798
|
-
* (styles/_overlay-motion.scss). */
|
|
1799
1799
|
/**
|
|
1800
1800
|
* The theme's role layer, forwarded onto every portaled pane alongside whatever
|
|
1801
1801
|
* tokens the component names for itself.
|
|
@@ -1816,6 +1816,8 @@ const ROLE_TOKENS = [
|
|
|
1816
1816
|
'--ds-elevation-floating',
|
|
1817
1817
|
'--ds-elevation-modal',
|
|
1818
1818
|
];
|
|
1819
|
+
/** Public enter-motion tokens read by every `ds-overlay-pane`
|
|
1820
|
+
* (styles/_overlay-motion.scss). */
|
|
1819
1821
|
const OVERLAY_MOTION_TOKENS = [
|
|
1820
1822
|
'--ds-overlay-enter-keyframes',
|
|
1821
1823
|
'--ds-overlay-enter-duration',
|
|
@@ -2284,21 +2286,23 @@ function buildPositions(placement, align, offsetPx) {
|
|
|
2284
2286
|
}
|
|
2285
2287
|
|
|
2286
2288
|
/**
|
|
2287
|
-
* Dev-only guard for a component
|
|
2288
|
-
*
|
|
2289
|
-
*
|
|
2290
|
-
*
|
|
2291
|
-
* renders no extra node:
|
|
2289
|
+
* Dev-only guard for a component that DROPS whatever is projected into it, so the
|
|
2290
|
+
* author gets a warning instead of silence — there is no compile-time signal for
|
|
2291
|
+
* content a component chooses to ignore. Put it on a probe around the
|
|
2292
|
+
* `<ng-content>`, gated on dev mode so production renders no extra node:
|
|
2292
2293
|
*
|
|
2293
2294
|
* ```html
|
|
2294
2295
|
* @if (devMode) {
|
|
2295
|
-
* <span dsProjectionDropped="ds-
|
|
2296
|
+
* <span dsProjectionDropped="ds-filter-bar"><ng-content></ng-content></span>
|
|
2296
2297
|
* }
|
|
2297
2298
|
* ```
|
|
2298
2299
|
*
|
|
2299
|
-
* NOT projection support: the probe exists
|
|
2300
|
-
* content
|
|
2301
|
-
*
|
|
2300
|
+
* It is NOT projection support: the probe exists so the warning can see that
|
|
2301
|
+
* content arrived, and then hides it.
|
|
2302
|
+
*
|
|
2303
|
+
* `ds-filter-bar` is the only host today. The field family used to be the reason
|
|
2304
|
+
* this exists, and is not any more — `ds-checkbox`, `ds-radio` and `ds-switch`
|
|
2305
|
+
* render a projected caption since 0.8.0 and dropped the probe with that release.
|
|
2302
2306
|
*
|
|
2303
2307
|
* `reason` replaces the default `[label]` wording for a host that drops content
|
|
2304
2308
|
* for a different reason — `ds-filter-bar` drops anything that carries neither of
|
|
@@ -2746,9 +2750,11 @@ class StatComponent {
|
|
|
2746
2750
|
// `unit` concatenates onto the INPUT value, so a projected value silently
|
|
2747
2751
|
// drops it — and "kg" quietly missing from a tile is the kind of thing that
|
|
2748
2752
|
// reads as fine until someone checks the number against the source.
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2753
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
2754
|
+
devWarn(() => this.unit() && !this.value()
|
|
2755
|
+
? `[ds-stat] unit="${this.unit()}" is set but there is no \`value\` input — a projected [dsStatValue] owns the whole line, so the unit is not rendered. Put it inside the projected content, or drop the input.`
|
|
2756
|
+
: null);
|
|
2757
|
+
}
|
|
2752
2758
|
}
|
|
2753
2759
|
/** Metric name shown above the value. */
|
|
2754
2760
|
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -4160,6 +4166,217 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
4160
4166
|
}]
|
|
4161
4167
|
}] });
|
|
4162
4168
|
|
|
4169
|
+
/**
|
|
4170
|
+
* Fills a strip above a picker panel's option list — "3 of 40 selected", a
|
|
4171
|
+
* "clear all" button, a hint, a link to a fuller search.
|
|
4172
|
+
*
|
|
4173
|
+
* Context: `count` is how many options are visible after filtering, `total` how
|
|
4174
|
+
* many were given, and `query` the text that narrowed them.
|
|
4175
|
+
*
|
|
4176
|
+
* It sits OUTSIDE the `listbox`, so whatever you put here is not counted as an
|
|
4177
|
+
* option and does not break a screen reader's "N of M" position reporting. It
|
|
4178
|
+
* also stays put while the list scrolls under it — the panel clips and the list
|
|
4179
|
+
* is the scroller.
|
|
4180
|
+
*/
|
|
4181
|
+
class DsPanelHeaderTemplateDirective {
|
|
4182
|
+
template = inject(TemplateRef);
|
|
4183
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DsPanelHeaderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4184
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: DsPanelHeaderTemplateDirective, isStandalone: true, selector: "[dsPanelHeaderTemplate]", ngImport: i0 });
|
|
4185
|
+
}
|
|
4186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DsPanelHeaderTemplateDirective, decorators: [{
|
|
4187
|
+
type: Directive,
|
|
4188
|
+
args: [{
|
|
4189
|
+
selector: '[dsPanelHeaderTemplate]',
|
|
4190
|
+
standalone: true,
|
|
4191
|
+
}]
|
|
4192
|
+
}] });
|
|
4193
|
+
|
|
4194
|
+
/**
|
|
4195
|
+
* Fills a strip below a picker panel's option list — a "create new" affordance
|
|
4196
|
+
* of your own, a count, a link, an apply button for a panel the user batches
|
|
4197
|
+
* choices in.
|
|
4198
|
+
*
|
|
4199
|
+
* Context: the same as the header slot — `count`, `total`, `query`.
|
|
4200
|
+
*
|
|
4201
|
+
* Like the header it sits OUTSIDE the `listbox` and does not scroll with the
|
|
4202
|
+
* options. Anything focusable you put here is reached by Tab from the panel, so
|
|
4203
|
+
* give it an accessible name.
|
|
4204
|
+
*/
|
|
4205
|
+
class DsPanelFooterTemplateDirective {
|
|
4206
|
+
template = inject(TemplateRef);
|
|
4207
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DsPanelFooterTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4208
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: DsPanelFooterTemplateDirective, isStandalone: true, selector: "[dsPanelFooterTemplate]", ngImport: i0 });
|
|
4209
|
+
}
|
|
4210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DsPanelFooterTemplateDirective, decorators: [{
|
|
4211
|
+
type: Directive,
|
|
4212
|
+
args: [{
|
|
4213
|
+
selector: '[dsPanelFooterTemplate]',
|
|
4214
|
+
standalone: true,
|
|
4215
|
+
}]
|
|
4216
|
+
}] });
|
|
4217
|
+
|
|
4218
|
+
/**
|
|
4219
|
+
* Fills an option group's heading — a count beside the name, a team glyph, a
|
|
4220
|
+
* secondary line.
|
|
4221
|
+
*
|
|
4222
|
+
* Context: `$implicit` and `group` are the group itself, `count` how many of its
|
|
4223
|
+
* options survived the filter.
|
|
4224
|
+
*
|
|
4225
|
+
* The heading element stays the library's: it keeps the id that the group's
|
|
4226
|
+
* `aria-labelledby` points at, so replacing the text cannot detach a group from
|
|
4227
|
+
* its name.
|
|
4228
|
+
*/
|
|
4229
|
+
class DsGroupLabelTemplateDirective {
|
|
4230
|
+
template = inject(TemplateRef);
|
|
4231
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DsGroupLabelTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4232
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: DsGroupLabelTemplateDirective, isStandalone: true, selector: "[dsGroupLabelTemplate]", ngImport: i0 });
|
|
4233
|
+
}
|
|
4234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DsGroupLabelTemplateDirective, decorators: [{
|
|
4235
|
+
type: Directive,
|
|
4236
|
+
args: [{
|
|
4237
|
+
selector: '[dsGroupLabelTemplate]',
|
|
4238
|
+
standalone: true,
|
|
4239
|
+
}]
|
|
4240
|
+
}] });
|
|
4241
|
+
|
|
4242
|
+
/** Where the cursor lands, or -1 when nothing in the list can take it. */
|
|
4243
|
+
function firstEnabledIndex(list) {
|
|
4244
|
+
for (let index = 0; index < list.length; index += 1) {
|
|
4245
|
+
if (list.isEnabled(index)) {
|
|
4246
|
+
return index;
|
|
4247
|
+
}
|
|
4248
|
+
}
|
|
4249
|
+
return -1;
|
|
4250
|
+
}
|
|
4251
|
+
function lastEnabledIndex(list) {
|
|
4252
|
+
for (let index = list.length - 1; index >= 0; index -= 1) {
|
|
4253
|
+
if (list.isEnabled(index)) {
|
|
4254
|
+
return index;
|
|
4255
|
+
}
|
|
4256
|
+
}
|
|
4257
|
+
return -1;
|
|
4258
|
+
}
|
|
4259
|
+
/**
|
|
4260
|
+
* The next enabled index `step` away from `from`, wrapping at both ends.
|
|
4261
|
+
*
|
|
4262
|
+
* `from` of -1 means "no cursor yet": stepping forward lands on the first
|
|
4263
|
+
* enabled entry and stepping back on the last, which is what a reader expects
|
|
4264
|
+
* from a freshly opened panel.
|
|
4265
|
+
*/
|
|
4266
|
+
function nextEnabledIndex(list, from, step) {
|
|
4267
|
+
if (list.length === 0) {
|
|
4268
|
+
return -1;
|
|
4269
|
+
}
|
|
4270
|
+
if (from < 0) {
|
|
4271
|
+
return step > 0 ? firstEnabledIndex(list) : lastEnabledIndex(list);
|
|
4272
|
+
}
|
|
4273
|
+
let index = from;
|
|
4274
|
+
// eslint-disable-next-line @typescript-eslint/prefer-for-of -- walks from `from` with modulo wraparound; `attempts` only bounds the walk, it is not a sequential index
|
|
4275
|
+
for (let attempts = 0; attempts < list.length; attempts += 1) {
|
|
4276
|
+
index = (index + step + list.length) % list.length;
|
|
4277
|
+
if (list.isEnabled(index)) {
|
|
4278
|
+
return index;
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
return from;
|
|
4282
|
+
}
|
|
4283
|
+
|
|
4284
|
+
/**
|
|
4285
|
+
* Keeps the keyboard cursor's row visible inside a scrolling panel.
|
|
4286
|
+
*
|
|
4287
|
+
* KEYBOARD ONLY, and that is the load-bearing part. The option rows also set the
|
|
4288
|
+
* active index on `mouseenter`, so a version that reacted to every change pulled
|
|
4289
|
+
* a partially visible row up under the pointer while the user was reading with
|
|
4290
|
+
* the mouse.
|
|
4291
|
+
*
|
|
4292
|
+
* Rows are looked up by id rather than through a `viewChildren` query because they
|
|
4293
|
+
* live in a portaled template — and the id is the one `aria-activedescendant`
|
|
4294
|
+
* already points at, so a failed lookup means that reference is broken too.
|
|
4295
|
+
*/
|
|
4296
|
+
function scrollActiveOptionIntoView(activeDescendantId, enabled, armed) {
|
|
4297
|
+
const documentRef = inject(DOCUMENT$1);
|
|
4298
|
+
afterRenderEffect(() => {
|
|
4299
|
+
const id = activeDescendantId();
|
|
4300
|
+
if (!enabled() || !armed() || !id) {
|
|
4301
|
+
return;
|
|
4302
|
+
}
|
|
4303
|
+
documentRef
|
|
4304
|
+
.getElementById(id)
|
|
4305
|
+
?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
4306
|
+
});
|
|
4307
|
+
}
|
|
4308
|
+
|
|
4309
|
+
/**
|
|
4310
|
+
* Announces how many options survived the filter.
|
|
4311
|
+
*
|
|
4312
|
+
* Deliberately NOT a row inside the listbox. A live region there is an invalid
|
|
4313
|
+
* child and, worse, a region created together with its text is the case screen
|
|
4314
|
+
* readers reliably do not announce — there is no content CHANGE to fire on. The
|
|
4315
|
+
* node here is created once, empty, and only its text changes.
|
|
4316
|
+
*
|
|
4317
|
+
* The text is English, which is the same debt every other library-invented string
|
|
4318
|
+
* in this package carries (see the localization item in `docs/todo.md`). It is a
|
|
4319
|
+
* count, so it is the cheapest of them to swap once a provider lands.
|
|
4320
|
+
*/
|
|
4321
|
+
function announceOptionCount(count, active) {
|
|
4322
|
+
const documentRef = inject(DOCUMENT$1);
|
|
4323
|
+
const region = documentRef.createElement('div');
|
|
4324
|
+
region.setAttribute('aria-live', 'polite');
|
|
4325
|
+
region.setAttribute('aria-atomic', 'true');
|
|
4326
|
+
// Off-screen rather than `display: none`, which would take it out of the
|
|
4327
|
+
// accessibility tree and announce nothing at all.
|
|
4328
|
+
region.style.cssText =
|
|
4329
|
+
'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;margin:-1px;padding:0';
|
|
4330
|
+
documentRef.body.appendChild(region);
|
|
4331
|
+
effect((onCleanup) => {
|
|
4332
|
+
onCleanup(() => region.remove());
|
|
4333
|
+
if (!active()) {
|
|
4334
|
+
region.textContent = '';
|
|
4335
|
+
return;
|
|
4336
|
+
}
|
|
4337
|
+
const total = count();
|
|
4338
|
+
region.textContent =
|
|
4339
|
+
total === 0 ? 'No results' : total === 1 ? '1 result' : `${total} results`;
|
|
4340
|
+
});
|
|
4341
|
+
}
|
|
4342
|
+
|
|
4343
|
+
/**
|
|
4344
|
+
* The jump-to-option-by-typing that a native `<select>` has and ours did not.
|
|
4345
|
+
*
|
|
4346
|
+
* Typing "ba" on a closed control moves to the first option starting with "ba",
|
|
4347
|
+
* and keeps extending the buffer while the user keeps typing. The timeout is what
|
|
4348
|
+
* separates "ba" from two separate "b" and "a" presses; 500ms is the interval
|
|
4349
|
+
* every native control and APG example uses.
|
|
4350
|
+
*/
|
|
4351
|
+
const RESET_AFTER_MS = 500;
|
|
4352
|
+
function createTypeAhead() {
|
|
4353
|
+
let buffer = '';
|
|
4354
|
+
let last = 0;
|
|
4355
|
+
return {
|
|
4356
|
+
match(key, labels, from) {
|
|
4357
|
+
// A modifier combination and any named key ("Enter", "ArrowDown") are not
|
|
4358
|
+
// text; only a single printable character extends the buffer.
|
|
4359
|
+
if (key.length !== 1 || !/\S/.test(key)) {
|
|
4360
|
+
return -1;
|
|
4361
|
+
}
|
|
4362
|
+
const now = Date.now();
|
|
4363
|
+
buffer = now - last > RESET_AFTER_MS ? key : buffer + key;
|
|
4364
|
+
last = now;
|
|
4365
|
+
const query = buffer.toLowerCase();
|
|
4366
|
+
const cycling = buffer.length > 1 && [...buffer].every((character) => character === buffer[0]);
|
|
4367
|
+
const needle = cycling ? buffer[0].toLowerCase() : query;
|
|
4368
|
+
const start = cycling || buffer.length === 1 ? from + 1 : 0;
|
|
4369
|
+
for (let offset = 0; offset < labels.length; offset += 1) {
|
|
4370
|
+
const index = (start + offset + labels.length) % labels.length;
|
|
4371
|
+
if (labels[index].toLowerCase().startsWith(needle)) {
|
|
4372
|
+
return index;
|
|
4373
|
+
}
|
|
4374
|
+
}
|
|
4375
|
+
return -1;
|
|
4376
|
+
},
|
|
4377
|
+
};
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4163
4380
|
class SelectComponent extends DsControlValueAccessor {
|
|
4164
4381
|
overlay = inject(Overlay);
|
|
4165
4382
|
/** Segment of a ds-field-group: the group owns the border, radius and focus
|
|
@@ -4198,6 +4415,19 @@ class SelectComponent extends DsControlValueAccessor {
|
|
|
4198
4415
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
4199
4416
|
/** Disables the trigger and blocks all interaction. */
|
|
4200
4417
|
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4418
|
+
/** Options are still being fetched. The panel shows a spinner instead of the
|
|
4419
|
+
* empty row — which would otherwise claim there are no matches — and the list
|
|
4420
|
+
* reports `aria-busy`. */
|
|
4421
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4422
|
+
/** The panel opened. The moment to fetch options for a picker whose list is
|
|
4423
|
+
* loaded on demand. */
|
|
4424
|
+
opened = output();
|
|
4425
|
+
/** The panel closed, for any reason — a pick, Escape, an outside click, a scroll. */
|
|
4426
|
+
closed = output();
|
|
4427
|
+
/** Scrolls the keyboard cursor's row into view. On by default: a list longer
|
|
4428
|
+
* than the panel otherwise walks the cursor out of sight. Set `false` only if
|
|
4429
|
+
* you are driving the scroll position yourself. */
|
|
4430
|
+
scrollActiveIntoView = input(true, { ...(ngDevMode ? { debugName: "scrollActiveIntoView" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4201
4431
|
/** Prevents opening the dropdown while still allowing focus. */
|
|
4202
4432
|
readOnly = input(false, { ...(ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4203
4433
|
/**
|
|
@@ -4226,6 +4456,9 @@ class SelectComponent extends DsControlValueAccessor {
|
|
|
4226
4456
|
clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4227
4457
|
optionTemplate = contentChild(DsOptionTemplateDirective, { ...(ngDevMode ? { debugName: "optionTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
4228
4458
|
pickerTrigger = contentChild(DsPickerTriggerDirective, { ...(ngDevMode ? { debugName: "pickerTrigger" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
4459
|
+
panelHeaderTemplate = contentChild(DsPanelHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "panelHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
4460
|
+
panelFooterTemplate = contentChild(DsPanelFooterTemplateDirective, { ...(ngDevMode ? { debugName: "panelFooterTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
4461
|
+
groupLabelTemplate = contentChild(DsGroupLabelTemplateDirective, { ...(ngDevMode ? { debugName: "groupLabelTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
4229
4462
|
emptyTemplate = contentChild(DsEmptyTemplateDirective, { ...(ngDevMode ? { debugName: "emptyTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
4230
4463
|
uid = nextControlId('ds-select');
|
|
4231
4464
|
labelId = `${this.uid}-label`;
|
|
@@ -4312,6 +4545,8 @@ class SelectComponent extends DsControlValueAccessor {
|
|
|
4312
4545
|
}, ...(ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []));
|
|
4313
4546
|
constructor() {
|
|
4314
4547
|
super();
|
|
4548
|
+
scrollActiveOptionIntoView(this.activeDescendant, this.scrollActiveIntoView, this.cursorFromKeyboard);
|
|
4549
|
+
announceOptionCount(computed(() => this.flatOptions().length), this.open);
|
|
4315
4550
|
effect(() => {
|
|
4316
4551
|
if (!this.open()) {
|
|
4317
4552
|
return;
|
|
@@ -4370,16 +4605,16 @@ class SelectComponent extends DsControlValueAccessor {
|
|
|
4370
4605
|
return;
|
|
4371
4606
|
}
|
|
4372
4607
|
this.overlayRef = null;
|
|
4373
|
-
this.
|
|
4608
|
+
this.setOpen(false);
|
|
4374
4609
|
});
|
|
4375
4610
|
const portal = new TemplatePortal(this.panelTpl(), this.vcr);
|
|
4376
4611
|
this.overlayRef.attach(portal);
|
|
4377
|
-
this.
|
|
4612
|
+
this.setOpen(true);
|
|
4378
4613
|
}
|
|
4379
4614
|
close(cause = 'select') {
|
|
4380
4615
|
disposeWithLeave(this.overlayRef, cause);
|
|
4381
4616
|
this.overlayRef = null;
|
|
4382
|
-
this.
|
|
4617
|
+
this.setOpen(false);
|
|
4383
4618
|
this.activeIndex.set(-1);
|
|
4384
4619
|
this.markTouched();
|
|
4385
4620
|
}
|
|
@@ -4399,9 +4634,24 @@ class SelectComponent extends DsControlValueAccessor {
|
|
|
4399
4634
|
}
|
|
4400
4635
|
clearValue(event) {
|
|
4401
4636
|
event.stopPropagation();
|
|
4402
|
-
this.
|
|
4637
|
+
this.clear();
|
|
4403
4638
|
this.markTouched();
|
|
4404
4639
|
}
|
|
4640
|
+
/**
|
|
4641
|
+
* Empties the selection from outside — a "reset filters" button, a form the app
|
|
4642
|
+
* clears itself. `ds-autocomplete` has had this; the other two had only the
|
|
4643
|
+
* in-trigger button, so an app with its own reset had to write the empty value
|
|
4644
|
+
* by hand and guess what "empty" is for this control.
|
|
4645
|
+
*
|
|
4646
|
+
* Deliberately does NOT move focus: the caller may be navigating away, and
|
|
4647
|
+
* stealing focus back into a field they just left is worse than leaving it.
|
|
4648
|
+
*/
|
|
4649
|
+
clear() {
|
|
4650
|
+
this.value.set('');
|
|
4651
|
+
if (this.open()) {
|
|
4652
|
+
this.close('dismiss');
|
|
4653
|
+
}
|
|
4654
|
+
}
|
|
4405
4655
|
isSelected(option) {
|
|
4406
4656
|
return option.value === this.value();
|
|
4407
4657
|
}
|
|
@@ -4409,6 +4659,7 @@ class SelectComponent extends DsControlValueAccessor {
|
|
|
4409
4659
|
return !!option.disabled || groupDisabled;
|
|
4410
4660
|
}
|
|
4411
4661
|
onTriggerKeydown(event) {
|
|
4662
|
+
this.cursorFromKeyboard.set(true);
|
|
4412
4663
|
if (this.isDisabled() ||
|
|
4413
4664
|
this.isReadOnly() ||
|
|
4414
4665
|
this.preview.staticPreview()) {
|
|
@@ -4461,6 +4712,16 @@ class SelectComponent extends DsControlValueAccessor {
|
|
|
4461
4712
|
}
|
|
4462
4713
|
return;
|
|
4463
4714
|
}
|
|
4715
|
+
if (key === 'PageDown') {
|
|
4716
|
+
event.preventDefault();
|
|
4717
|
+
this.moveActive(SelectComponent.pageStep);
|
|
4718
|
+
return;
|
|
4719
|
+
}
|
|
4720
|
+
if (key === 'PageUp') {
|
|
4721
|
+
event.preventDefault();
|
|
4722
|
+
this.moveActive(-SelectComponent.pageStep);
|
|
4723
|
+
return;
|
|
4724
|
+
}
|
|
4464
4725
|
if (key === 'Home') {
|
|
4465
4726
|
event.preventDefault();
|
|
4466
4727
|
this.activeIndex.set(this.firstEnabledIndex());
|
|
@@ -4469,59 +4730,76 @@ class SelectComponent extends DsControlValueAccessor {
|
|
|
4469
4730
|
if (key === 'End') {
|
|
4470
4731
|
event.preventDefault();
|
|
4471
4732
|
this.activeIndex.set(this.lastEnabledIndex());
|
|
4733
|
+
return;
|
|
4734
|
+
}
|
|
4735
|
+
if (this.handleTypeAhead(key)) {
|
|
4736
|
+
event.preventDefault();
|
|
4737
|
+
if (!this.open()) {
|
|
4738
|
+
this.pickActive();
|
|
4739
|
+
}
|
|
4740
|
+
}
|
|
4741
|
+
}
|
|
4742
|
+
pickActive() {
|
|
4743
|
+
const entry = this.flatOptions()[this.activeIndex()];
|
|
4744
|
+
if (entry) {
|
|
4745
|
+
this.pick(entry.option, entry.groupDisabled);
|
|
4472
4746
|
}
|
|
4473
4747
|
}
|
|
4474
4748
|
isActive(index) {
|
|
4475
4749
|
return this.activeIndex() === index;
|
|
4476
4750
|
}
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
let next = this.activeIndex();
|
|
4483
|
-
// eslint-disable-next-line @typescript-eslint/prefer-for-of -- walks from activeIndex with modulo wraparound; `attempts` only bounds the walk, it isn't a sequential index
|
|
4484
|
-
for (let attempts = 0; attempts < opts.length; attempts++) {
|
|
4485
|
-
next = (next + delta + opts.length) % opts.length;
|
|
4486
|
-
const candidate = opts[next];
|
|
4487
|
-
if (candidate && !candidate.option.disabled && !candidate.groupDisabled) {
|
|
4488
|
-
this.activeIndex.set(next);
|
|
4489
|
-
return;
|
|
4490
|
-
}
|
|
4751
|
+
typeAhead = createTypeAhead();
|
|
4752
|
+
handleTypeAhead(key) {
|
|
4753
|
+
const index = this.typeAhead.match(key, this.flatOptions().map((entry) => entry.option.label), this.activeIndex());
|
|
4754
|
+
if (index < 0) {
|
|
4755
|
+
return false;
|
|
4491
4756
|
}
|
|
4757
|
+
this.activeIndex.set(index);
|
|
4758
|
+
return true;
|
|
4492
4759
|
}
|
|
4493
|
-
|
|
4760
|
+
cursorFromKeyboard = signal(false, ...(ngDevMode ? [{ debugName: "cursorFromKeyboard" }] : /* istanbul ignore next */ []));
|
|
4761
|
+
cursorList() {
|
|
4494
4762
|
const opts = this.flatOptions();
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4763
|
+
return {
|
|
4764
|
+
length: opts.length,
|
|
4765
|
+
isEnabled: (index) => !opts[index].option.disabled && !opts[index].groupDisabled,
|
|
4766
|
+
};
|
|
4767
|
+
}
|
|
4768
|
+
/** How far PageUp and PageDown move. Ten rows is the native `<select>` step and
|
|
4769
|
+
* the APG listbox example's — a fixed number rather than a measured screenful,
|
|
4770
|
+
* so the jump is the same wherever the panel happens to be clipped. */
|
|
4771
|
+
static pageStep = 10;
|
|
4772
|
+
moveActive(delta) {
|
|
4773
|
+
const next = nextEnabledIndex(this.cursorList(), this.activeIndex(), delta);
|
|
4774
|
+
if (next >= 0) {
|
|
4775
|
+
this.activeIndex.set(next);
|
|
4500
4776
|
}
|
|
4501
|
-
return -1;
|
|
4502
4777
|
}
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
const candidate = opts[i];
|
|
4507
|
-
if (candidate && !candidate.option.disabled && !candidate.groupDisabled) {
|
|
4508
|
-
return i;
|
|
4509
|
-
}
|
|
4778
|
+
setOpen(next) {
|
|
4779
|
+
if (this.open() === next) {
|
|
4780
|
+
return;
|
|
4510
4781
|
}
|
|
4511
|
-
|
|
4782
|
+
this.open.set(next);
|
|
4783
|
+
(next ? this.opened : this.closed).emit();
|
|
4784
|
+
}
|
|
4785
|
+
lastEnabledIndex() {
|
|
4786
|
+
return lastEnabledIndex(this.cursorList());
|
|
4787
|
+
}
|
|
4788
|
+
firstEnabledIndex() {
|
|
4789
|
+
return firstEnabledIndex(this.cursorList());
|
|
4512
4790
|
}
|
|
4513
4791
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4514
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SelectComponent, isStandalone: true, selector: "ds-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, readonlyBinding: { classPropertyName: "readonlyBinding", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-field-state": "controlState()", "class.in-group": "inGroup", "class.content-width": "width() === 'content'" } }, providers: [
|
|
4792
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SelectComponent, isStandalone: true, selector: "ds-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, scrollActiveIntoView: { classPropertyName: "scrollActiveIntoView", publicName: "scrollActiveIntoView", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, readonlyBinding: { classPropertyName: "readonlyBinding", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", opened: "opened", closed: "closed" }, host: { properties: { "attr.data-field-state": "controlState()", "class.in-group": "inGroup", "class.content-width": "width() === 'content'" } }, providers: [
|
|
4515
4793
|
{
|
|
4516
4794
|
provide: NG_VALUE_ACCESSOR,
|
|
4517
4795
|
useExisting: forwardRef(() => SelectComponent),
|
|
4518
4796
|
multi: true,
|
|
4519
4797
|
},
|
|
4520
|
-
], queries: [{ propertyName: "optionTemplate", first: true, predicate: DsOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pickerTrigger", first: true, predicate: DsPickerTriggerDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: DsEmptyTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "panelContentTpl", first: true, predicate: ["panelContent"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: DsStaticPreview, inputs: ["staticPreview", "staticPreview"] }], ngImport: i0, template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<div\n #trigger\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [class]=\"triggerClasses()\"\n [attr.name]=\"name()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"open() || preview.staticPreview()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n>\n @if (selectedOption()?.icon) {\n <ds-icon\n class=\"trigger-icon\"\n [name]=\"selectedOption()!.icon!\"\n [size]=\"16\"\n />\n }\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption(),\n selected: selectedOption(),\n count: hasValue() ? 1 : 0,\n open: open(),\n disabled: isDisabled(),\n }\"\n />\n } @else {\n <span\n class=\"trigger-text\"\n [class.is-placeholder]=\"!hasValue()\"\n >\n {{ displayLabel() }}\n </span>\n }\n\n @if (\n clearable() &&\n hasValue() &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n />\n </button>\n }\n\n <span class=\"chevron\">\n <ds-icon\n name=\"chevronDown\"\n [size]=\"14\"\n />\n </span>\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\n@if (preview.staticPreview()) {\n <div class=\"ds-dropdown-panel\">\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\n </div>\n}\n\n<ng-template #panel>\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\n</ng-template>\n\n<ng-template #panelContent>\n <div class=\"dropdown-panel\">\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [id]=\"listboxId\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n >\n @for (item of options(); track $index; let groupIdx = $index) {\n @if (isOptionGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"groupIdx === 0\"\n >\n {{ item.label }}\n </span>\n\n <ul\n class=\"optgroup-list\"\n role=\"presentation\"\n >\n @for (opt of item.options; track opt.value) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(opt))\"\n [attr.aria-selected]=\"isSelected(opt)\"\n [attr.aria-disabled]=\"\n isOptionDisabled(opt, item.disabled) ? 'true' : null\n \"\n [class.is-selected]=\"isSelected(opt)\"\n [class.is-active]=\"isActive(flatIndexOf(opt))\"\n [class.is-disabled]=\"isOptionDisabled(opt, item.disabled)\"\n [disabled]=\"isOptionDisabled(opt, item.disabled)\"\n (click)=\"pick(opt, item.disabled)\"\n (mouseenter)=\"activeIndex.set(flatIndexOf(opt))\"\n >\n @if (opt.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"opt.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: opt,\n option: opt,\n }\"\n />\n } @else {\n {{ opt.label }}\n }\n </span>\n\n @if (isSelected(opt)) {\n <ds-icon\n class=\"option-check\"\n name=\"check\"\n [size]=\"14\"\n />\n }\n </button>\n </li>\n }\n </ul>\n </li>\n } @else {\n <li role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(item))\"\n [attr.aria-selected]=\"isSelected(item)\"\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\n [class.is-selected]=\"isSelected(item)\"\n [class.is-active]=\"isActive(flatIndexOf(item))\"\n [class.is-disabled]=\"item.disabled\"\n [disabled]=\"item.disabled\"\n (click)=\"pick(item)\"\n (mouseenter)=\"activeIndex.set(flatIndexOf(item))\"\n >\n @if (item.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"item.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n option: item,\n }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @if (isSelected(item)) {\n <ds-icon\n class=\"option-check\"\n name=\"check\"\n [size]=\"14\"\n />\n }\n </button>\n </li>\n }\n }\n\n @if (options().length === 0) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n No options\n }\n </li>\n }\n </ul>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{--_select-focus-shadow: var(--ds-select-focus-shadow, var(--ds-field-focus-shadow));--_select-focus-shadow-error: var(--ds-select-focus-shadow-error, var(--ds-field-focus-shadow-error));--_select-bg-color: var(--ds-select-bg-color, var(--surface-default));--_select-border-color: var(--ds-select-border-color, var(--border-default));--_select-text-color: var(--ds-select-text-color, var(--text-primary));--_select-radius: var(--ds-select-radius, var(--ds-radius-control));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%}:host(.content-width){width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.dropdown{display:flex;align-items:center;gap:var(--space-2);width:100%;background:var(--_select-bg-color);border:var(--border-width-default) solid var(--_select-border-color);border-radius:var(--_select-radius);padding:var(--field-pad-y) var(--field-pad-x);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_select-text-color);text-align:left;cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.dropdown .trigger-text{flex:1;min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.dropdown .trigger-text.is-placeholder{color:var(--text-tertiary)}.dropdown .trigger-icon{color:var(--icon-default);flex:0 0 auto}.dropdown .clear-btn{border:0;background:transparent;display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);border-radius:var(--ds-radius-inner);padding:var(--space-0-5);cursor:pointer;flex:0 0 auto}.dropdown .clear-btn:hover{color:var(--text-primary);background:var(--surface-secondary)}.dropdown .clear-btn:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.dropdown .chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);transition:transform var(--duration-fast) var(--ease-standard)}.dropdown:hover:not(:disabled){border-color:var(--border-strong)}.dropdown:focus-visible{outline:none;border-color:var(--accent);box-shadow:var(--_select-focus-shadow)}.dropdown.open{border-color:var(--accent);box-shadow:var(--_select-focus-shadow)}.dropdown.open .chevron{transform:rotate(180deg)}.dropdown.readonly{background:var(--surface-secondary);border-color:var(--border-divider);color:var(--text-secondary);cursor:default}.dropdown.readonly:hover{border-color:var(--border-divider)}.dropdown.readonly .chevron{display:none}.dropdown.disabled,.dropdown:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.dropdown.disabled .chevron,.dropdown:disabled .chevron{color:var(--icon-muted)}.dropdown.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));height:var(--_field-box-height);padding:0 var(--space-2)}.dropdown.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));height:var(--_field-box-height)}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .dropdown{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .dropdown:hover,:host(.in-group) .dropdown:focus,:host(.in-group) .dropdown:focus-visible,:host(.in-group) .dropdown:focus-within{border:0;box-shadow:none;outline:0}:host([data-field-state=error]:not(.in-group)) .dropdown{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .dropdown:focus-within,:host([data-field-state=error]:not(.in-group)) .dropdown:focus-visible{box-shadow:var(--_select-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .dropdown{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .dropdown{border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }] });
|
|
4798
|
+
], queries: [{ propertyName: "optionTemplate", first: true, predicate: DsOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pickerTrigger", first: true, predicate: DsPickerTriggerDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelHeaderTemplate", first: true, predicate: DsPanelHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelFooterTemplate", first: true, predicate: DsPanelFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupLabelTemplate", first: true, predicate: DsGroupLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: DsEmptyTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "panelContentTpl", first: true, predicate: ["panelContent"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: DsStaticPreview, inputs: ["staticPreview", "staticPreview"] }], ngImport: i0, template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<div\n #trigger\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [class]=\"triggerClasses()\"\n [attr.name]=\"name()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"open() || preview.staticPreview()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n>\n @if (selectedOption()?.icon) {\n <ds-icon\n class=\"trigger-icon\"\n [name]=\"selectedOption()!.icon!\"\n [size]=\"16\"\n />\n }\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption(),\n selected: selectedOption(),\n count: hasValue() ? 1 : 0,\n open: open(),\n disabled: isDisabled(),\n }\"\n />\n } @else {\n <span\n class=\"trigger-text\"\n [class.is-placeholder]=\"!hasValue()\"\n >\n {{ displayLabel() }}\n </span>\n }\n\n @if (\n clearable() &&\n hasValue() &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n />\n </button>\n }\n\n <span class=\"chevron\">\n <ds-icon\n name=\"chevronDown\"\n [size]=\"14\"\n />\n </span>\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\n@if (preview.staticPreview()) {\n <div class=\"ds-dropdown-panel\">\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\n </div>\n}\n\n<ng-template #panel>\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\n</ng-template>\n\n<ng-template #panelContent>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: options().length,\n total: options().length,\n query: '',\n }\"\n />\n </div>\n }\n\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n >\n @for (item of options(); track $index; let groupIdx = $index) {\n @if (isOptionGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"groupIdx === 0\"\n >\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n\n <ul\n class=\"optgroup-list\"\n role=\"presentation\"\n >\n @for (opt of item.options; track opt.value) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(opt))\"\n [attr.aria-selected]=\"isSelected(opt)\"\n [attr.aria-disabled]=\"\n isOptionDisabled(opt, item.disabled) ? 'true' : null\n \"\n [attr.aria-describedby]=\"\n opt.disabled && opt.disabledReason\n ? optionId(flatIndexOf(opt)) + '-reason'\n : null\n \"\n [class.is-selected]=\"isSelected(opt)\"\n [class.is-active]=\"isActive(flatIndexOf(opt))\"\n [class.is-disabled]=\"isOptionDisabled(opt, item.disabled)\"\n [disabled]=\"isOptionDisabled(opt, item.disabled)\"\n (click)=\"pick(opt, item.disabled)\"\n (mouseenter)=\"cursorFromKeyboard.set(false); activeIndex.set(flatIndexOf(opt))\"\n >\n @if (opt.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"opt.icon\"\n [size]=\"16\"\n />\n }\n\n @if (opt.disabled && opt.disabledReason) {\n <span\n class=\"option-reason\"\n [id]=\"optionId(flatIndexOf(opt)) + '-reason'\"\n >\n {{ opt.disabledReason }}\n </span>\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: opt,\n option: opt,\n }\"\n />\n } @else {\n {{ opt.label }}\n }\n </span>\n\n @if (isSelected(opt)) {\n <ds-icon\n class=\"option-check\"\n name=\"check\"\n [size]=\"14\"\n />\n }\n </button>\n </li>\n }\n </ul>\n </li>\n } @else {\n <li role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(item))\"\n [attr.aria-selected]=\"isSelected(item)\"\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\n [class.is-selected]=\"isSelected(item)\"\n [class.is-active]=\"isActive(flatIndexOf(item))\"\n [class.is-disabled]=\"item.disabled\"\n [disabled]=\"item.disabled\"\n (click)=\"pick(item)\"\n (mouseenter)=\"cursorFromKeyboard.set(false); activeIndex.set(flatIndexOf(item))\"\n >\n @if (item.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"item.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n option: item,\n }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @if (isSelected(item)) {\n <ds-icon\n class=\"option-check\"\n name=\"check\"\n [size]=\"14\"\n />\n }\n </button>\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (options().length === 0) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n No options\n }\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: options().length,\n total: options().length,\n query: '',\n }\"\n />\n </div>\n }\n\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{--_select-focus-shadow: var(--ds-select-focus-shadow, var(--ds-field-focus-shadow));--_select-focus-shadow-error: var(--ds-select-focus-shadow-error, var(--ds-field-focus-shadow-error));--_select-bg-color: var(--ds-select-bg-color, var(--surface-default));--_select-border-color: var(--ds-select-border-color, var(--border-default));--_select-text-color: var(--ds-select-text-color, var(--text-primary));--_select-radius: var(--ds-select-radius, var(--ds-radius-control));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%}:host(.content-width){width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.dropdown{display:flex;align-items:center;gap:var(--space-2);width:100%;background:var(--_select-bg-color);border:var(--border-width-default) solid var(--_select-border-color);border-radius:var(--_select-radius);padding:var(--field-pad-y) var(--field-pad-x);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_select-text-color);text-align:left;cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.dropdown .trigger-text{flex:1;min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.dropdown .trigger-text.is-placeholder{color:var(--text-tertiary)}.dropdown .trigger-icon{color:var(--icon-default);flex:0 0 auto}.dropdown .clear-btn{border:0;background:transparent;display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);border-radius:var(--ds-radius-inner);padding:var(--space-0-5);cursor:pointer;flex:0 0 auto}.dropdown .clear-btn:hover{color:var(--text-primary);background:var(--surface-secondary)}.dropdown .clear-btn:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.dropdown .chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);transition:transform var(--duration-fast) var(--ease-standard)}.dropdown:hover:not(:disabled){border-color:var(--border-strong)}.dropdown:focus-visible{outline:none;border-color:var(--accent);box-shadow:var(--_select-focus-shadow)}.dropdown.open{border-color:var(--accent);box-shadow:var(--_select-focus-shadow)}.dropdown.open .chevron{transform:rotate(180deg)}.dropdown.readonly{background:var(--surface-secondary);border-color:var(--border-divider);color:var(--text-secondary);cursor:default}.dropdown.readonly:hover{border-color:var(--border-divider)}.dropdown.readonly .chevron{display:none}.dropdown.disabled,.dropdown:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.dropdown.disabled .chevron,.dropdown:disabled .chevron{color:var(--icon-muted)}.dropdown.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));height:var(--_field-box-height);padding:0 var(--space-2)}.dropdown.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));height:var(--_field-box-height)}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .dropdown{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .dropdown:hover,:host(.in-group) .dropdown:focus,:host(.in-group) .dropdown:focus-visible,:host(.in-group) .dropdown:focus-within{border:0;box-shadow:none;outline:0}:host([data-field-state=error]:not(.in-group)) .dropdown{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .dropdown:focus-within,:host([data-field-state=error]:not(.in-group)) .dropdown:focus-visible{box-shadow:var(--_select-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .dropdown{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .dropdown{border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: SpinnerComponent, selector: "ds-spinner", inputs: ["size"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }] });
|
|
4521
4799
|
}
|
|
4522
4800
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SelectComponent, decorators: [{
|
|
4523
4801
|
type: Component,
|
|
4524
|
-
args: [{ selector: 'ds-select', standalone: true, imports: [IconComponent, NgTemplateOutlet, FieldMessageComponent], host: {
|
|
4802
|
+
args: [{ selector: 'ds-select', standalone: true, imports: [SpinnerComponent, IconComponent, NgTemplateOutlet, FieldMessageComponent], host: {
|
|
4525
4803
|
'[attr.data-field-state]': 'controlState()',
|
|
4526
4804
|
'[class.in-group]': 'inGroup',
|
|
4527
4805
|
'[class.content-width]': "width() === 'content'",
|
|
@@ -4531,12 +4809,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
4531
4809
|
useExisting: forwardRef(() => SelectComponent),
|
|
4532
4810
|
multi: true,
|
|
4533
4811
|
},
|
|
4534
|
-
], template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<div\n #trigger\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [class]=\"triggerClasses()\"\n [attr.name]=\"name()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"open() || preview.staticPreview()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n>\n @if (selectedOption()?.icon) {\n <ds-icon\n class=\"trigger-icon\"\n [name]=\"selectedOption()!.icon!\"\n [size]=\"16\"\n />\n }\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption(),\n selected: selectedOption(),\n count: hasValue() ? 1 : 0,\n open: open(),\n disabled: isDisabled(),\n }\"\n />\n } @else {\n <span\n class=\"trigger-text\"\n [class.is-placeholder]=\"!hasValue()\"\n >\n {{ displayLabel() }}\n </span>\n }\n\n @if (\n clearable() &&\n hasValue() &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n />\n </button>\n }\n\n <span class=\"chevron\">\n <ds-icon\n name=\"chevronDown\"\n [size]=\"14\"\n />\n </span>\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\n@if (preview.staticPreview()) {\n <div class=\"ds-dropdown-panel\">\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\n </div>\n}\n\n<ng-template #panel>\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\n</ng-template>\n\n<ng-template #panelContent>\n <div class=\"dropdown-panel\">\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [id]=\"listboxId\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n >\n @for (item of options(); track $index; let groupIdx = $index) {\n @if (isOptionGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"groupIdx === 0\"\n >\n {{ item.label }}\n </span>\n\n <ul\n class=\"optgroup-list\"\n role=\"presentation\"\n >\n @for (opt of item.options; track opt.value) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(opt))\"\n [attr.aria-selected]=\"isSelected(opt)\"\n [attr.aria-disabled]=\"\n isOptionDisabled(opt, item.disabled) ? 'true' : null\n \"\n [class.is-selected]=\"isSelected(opt)\"\n [class.is-active]=\"isActive(flatIndexOf(opt))\"\n [class.is-disabled]=\"isOptionDisabled(opt, item.disabled)\"\n [disabled]=\"isOptionDisabled(opt, item.disabled)\"\n (click)=\"pick(opt, item.disabled)\"\n (mouseenter)=\"activeIndex.set(flatIndexOf(opt))\"\n >\n @if (opt.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"opt.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: opt,\n option: opt,\n }\"\n />\n } @else {\n {{ opt.label }}\n }\n </span>\n\n @if (isSelected(opt)) {\n <ds-icon\n class=\"option-check\"\n name=\"check\"\n [size]=\"14\"\n />\n }\n </button>\n </li>\n }\n </ul>\n </li>\n } @else {\n <li role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(item))\"\n [attr.aria-selected]=\"isSelected(item)\"\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\n [class.is-selected]=\"isSelected(item)\"\n [class.is-active]=\"isActive(flatIndexOf(item))\"\n [class.is-disabled]=\"item.disabled\"\n [disabled]=\"item.disabled\"\n (click)=\"pick(item)\"\n (mouseenter)=\"activeIndex.set(flatIndexOf(item))\"\n >\n @if (item.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"item.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n option: item,\n }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @if (isSelected(item)) {\n <ds-icon\n class=\"option-check\"\n name=\"check\"\n [size]=\"14\"\n />\n }\n </button>\n </li>\n }\n }\n\n @if (options().length === 0) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n No options\n }\n </li>\n }\n </ul>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{--_select-focus-shadow: var(--ds-select-focus-shadow, var(--ds-field-focus-shadow));--_select-focus-shadow-error: var(--ds-select-focus-shadow-error, var(--ds-field-focus-shadow-error));--_select-bg-color: var(--ds-select-bg-color, var(--surface-default));--_select-border-color: var(--ds-select-border-color, var(--border-default));--_select-text-color: var(--ds-select-text-color, var(--text-primary));--_select-radius: var(--ds-select-radius, var(--ds-radius-control));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%}:host(.content-width){width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.dropdown{display:flex;align-items:center;gap:var(--space-2);width:100%;background:var(--_select-bg-color);border:var(--border-width-default) solid var(--_select-border-color);border-radius:var(--_select-radius);padding:var(--field-pad-y) var(--field-pad-x);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_select-text-color);text-align:left;cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.dropdown .trigger-text{flex:1;min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.dropdown .trigger-text.is-placeholder{color:var(--text-tertiary)}.dropdown .trigger-icon{color:var(--icon-default);flex:0 0 auto}.dropdown .clear-btn{border:0;background:transparent;display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);border-radius:var(--ds-radius-inner);padding:var(--space-0-5);cursor:pointer;flex:0 0 auto}.dropdown .clear-btn:hover{color:var(--text-primary);background:var(--surface-secondary)}.dropdown .clear-btn:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.dropdown .chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);transition:transform var(--duration-fast) var(--ease-standard)}.dropdown:hover:not(:disabled){border-color:var(--border-strong)}.dropdown:focus-visible{outline:none;border-color:var(--accent);box-shadow:var(--_select-focus-shadow)}.dropdown.open{border-color:var(--accent);box-shadow:var(--_select-focus-shadow)}.dropdown.open .chevron{transform:rotate(180deg)}.dropdown.readonly{background:var(--surface-secondary);border-color:var(--border-divider);color:var(--text-secondary);cursor:default}.dropdown.readonly:hover{border-color:var(--border-divider)}.dropdown.readonly .chevron{display:none}.dropdown.disabled,.dropdown:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.dropdown.disabled .chevron,.dropdown:disabled .chevron{color:var(--icon-muted)}.dropdown.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));height:var(--_field-box-height);padding:0 var(--space-2)}.dropdown.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));height:var(--_field-box-height)}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .dropdown{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .dropdown:hover,:host(.in-group) .dropdown:focus,:host(.in-group) .dropdown:focus-visible,:host(.in-group) .dropdown:focus-within{border:0;box-shadow:none;outline:0}:host([data-field-state=error]:not(.in-group)) .dropdown{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .dropdown:focus-within,:host([data-field-state=error]:not(.in-group)) .dropdown:focus-visible{box-shadow:var(--_select-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .dropdown{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .dropdown{border-color:var(--success)}\n"] }]
|
|
4535
|
-
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], readonlyBinding: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsOptionTemplateDirective), { ...{
|
|
4812
|
+
], template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<div\n #trigger\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [class]=\"triggerClasses()\"\n [attr.name]=\"name()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"open() || preview.staticPreview()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n>\n @if (selectedOption()?.icon) {\n <ds-icon\n class=\"trigger-icon\"\n [name]=\"selectedOption()!.icon!\"\n [size]=\"16\"\n />\n }\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption(),\n selected: selectedOption(),\n count: hasValue() ? 1 : 0,\n open: open(),\n disabled: isDisabled(),\n }\"\n />\n } @else {\n <span\n class=\"trigger-text\"\n [class.is-placeholder]=\"!hasValue()\"\n >\n {{ displayLabel() }}\n </span>\n }\n\n @if (\n clearable() &&\n hasValue() &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n />\n </button>\n }\n\n <span class=\"chevron\">\n <ds-icon\n name=\"chevronDown\"\n [size]=\"14\"\n />\n </span>\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\n@if (preview.staticPreview()) {\n <div class=\"ds-dropdown-panel\">\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\n </div>\n}\n\n<ng-template #panel>\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\n</ng-template>\n\n<ng-template #panelContent>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: options().length,\n total: options().length,\n query: '',\n }\"\n />\n </div>\n }\n\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n >\n @for (item of options(); track $index; let groupIdx = $index) {\n @if (isOptionGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"groupIdx === 0\"\n >\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n\n <ul\n class=\"optgroup-list\"\n role=\"presentation\"\n >\n @for (opt of item.options; track opt.value) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(opt))\"\n [attr.aria-selected]=\"isSelected(opt)\"\n [attr.aria-disabled]=\"\n isOptionDisabled(opt, item.disabled) ? 'true' : null\n \"\n [attr.aria-describedby]=\"\n opt.disabled && opt.disabledReason\n ? optionId(flatIndexOf(opt)) + '-reason'\n : null\n \"\n [class.is-selected]=\"isSelected(opt)\"\n [class.is-active]=\"isActive(flatIndexOf(opt))\"\n [class.is-disabled]=\"isOptionDisabled(opt, item.disabled)\"\n [disabled]=\"isOptionDisabled(opt, item.disabled)\"\n (click)=\"pick(opt, item.disabled)\"\n (mouseenter)=\"cursorFromKeyboard.set(false); activeIndex.set(flatIndexOf(opt))\"\n >\n @if (opt.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"opt.icon\"\n [size]=\"16\"\n />\n }\n\n @if (opt.disabled && opt.disabledReason) {\n <span\n class=\"option-reason\"\n [id]=\"optionId(flatIndexOf(opt)) + '-reason'\"\n >\n {{ opt.disabledReason }}\n </span>\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: opt,\n option: opt,\n }\"\n />\n } @else {\n {{ opt.label }}\n }\n </span>\n\n @if (isSelected(opt)) {\n <ds-icon\n class=\"option-check\"\n name=\"check\"\n [size]=\"14\"\n />\n }\n </button>\n </li>\n }\n </ul>\n </li>\n } @else {\n <li role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(item))\"\n [attr.aria-selected]=\"isSelected(item)\"\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\n [class.is-selected]=\"isSelected(item)\"\n [class.is-active]=\"isActive(flatIndexOf(item))\"\n [class.is-disabled]=\"item.disabled\"\n [disabled]=\"item.disabled\"\n (click)=\"pick(item)\"\n (mouseenter)=\"cursorFromKeyboard.set(false); activeIndex.set(flatIndexOf(item))\"\n >\n @if (item.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"item.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n option: item,\n }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @if (isSelected(item)) {\n <ds-icon\n class=\"option-check\"\n name=\"check\"\n [size]=\"14\"\n />\n }\n </button>\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (options().length === 0) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n No options\n }\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: options().length,\n total: options().length,\n query: '',\n }\"\n />\n </div>\n }\n\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{--_select-focus-shadow: var(--ds-select-focus-shadow, var(--ds-field-focus-shadow));--_select-focus-shadow-error: var(--ds-select-focus-shadow-error, var(--ds-field-focus-shadow-error));--_select-bg-color: var(--ds-select-bg-color, var(--surface-default));--_select-border-color: var(--ds-select-border-color, var(--border-default));--_select-text-color: var(--ds-select-text-color, var(--text-primary));--_select-radius: var(--ds-select-radius, var(--ds-radius-control));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%}:host(.content-width){width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.dropdown{display:flex;align-items:center;gap:var(--space-2);width:100%;background:var(--_select-bg-color);border:var(--border-width-default) solid var(--_select-border-color);border-radius:var(--_select-radius);padding:var(--field-pad-y) var(--field-pad-x);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_select-text-color);text-align:left;cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.dropdown .trigger-text{flex:1;min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.dropdown .trigger-text.is-placeholder{color:var(--text-tertiary)}.dropdown .trigger-icon{color:var(--icon-default);flex:0 0 auto}.dropdown .clear-btn{border:0;background:transparent;display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);border-radius:var(--ds-radius-inner);padding:var(--space-0-5);cursor:pointer;flex:0 0 auto}.dropdown .clear-btn:hover{color:var(--text-primary);background:var(--surface-secondary)}.dropdown .clear-btn:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.dropdown .chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--icon-default);transition:transform var(--duration-fast) var(--ease-standard)}.dropdown:hover:not(:disabled){border-color:var(--border-strong)}.dropdown:focus-visible{outline:none;border-color:var(--accent);box-shadow:var(--_select-focus-shadow)}.dropdown.open{border-color:var(--accent);box-shadow:var(--_select-focus-shadow)}.dropdown.open .chevron{transform:rotate(180deg)}.dropdown.readonly{background:var(--surface-secondary);border-color:var(--border-divider);color:var(--text-secondary);cursor:default}.dropdown.readonly:hover{border-color:var(--border-divider)}.dropdown.readonly .chevron{display:none}.dropdown.disabled,.dropdown:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.dropdown.disabled .chevron,.dropdown:disabled .chevron{color:var(--icon-muted)}.dropdown.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));height:var(--_field-box-height);padding:0 var(--space-2)}.dropdown.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));height:var(--_field-box-height)}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .dropdown{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .dropdown:hover,:host(.in-group) .dropdown:focus,:host(.in-group) .dropdown:focus-visible,:host(.in-group) .dropdown:focus-within{border:0;box-shadow:none;outline:0}:host([data-field-state=error]:not(.in-group)) .dropdown{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .dropdown:focus-within,:host([data-field-state=error]:not(.in-group)) .dropdown:focus-visible{box-shadow:var(--_select-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .dropdown{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .dropdown{border-color:var(--success)}\n"] }]
|
|
4813
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], scrollActiveIntoView: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollActiveIntoView", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], readonlyBinding: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsOptionTemplateDirective), { ...{
|
|
4536
4814
|
read: TemplateRef,
|
|
4537
4815
|
}, isSignal: true }] }], pickerTrigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPickerTriggerDirective), { ...{
|
|
4538
4816
|
read: TemplateRef,
|
|
4539
|
-
}, isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsEmptyTemplateDirective), { ...{
|
|
4817
|
+
}, isSignal: true }] }], panelHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPanelHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], panelFooterTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPanelFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupLabelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsGroupLabelTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsEmptyTemplateDirective), { ...{
|
|
4540
4818
|
read: TemplateRef,
|
|
4541
4819
|
}, isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], panelContentTpl: [{ type: i0.ViewChild, args: ['panelContent', { isSignal: true }] }] } });
|
|
4542
4820
|
|
|
@@ -4629,7 +4907,7 @@ class PaginationComponent {
|
|
|
4629
4907
|
this.currentPage.set(1);
|
|
4630
4908
|
}
|
|
4631
4909
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4632
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: PaginationComponent, isStandalone: true, selector: "ds-pagination", inputs: { total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: true, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageSize: "pageSizeChange", currentPage: "currentPageChange" }, ngImport: i0, template: "<nav\n class=\"pagination\"\n aria-label=\"Pagination\"\n>\n @if (showLabel()) {\n <span class=\"label\">\n {{ rangeLabel() }}\n </span>\n }\n\n <button\n class=\"pagination-button\"\n type=\"button\"\n aria-label=\"Previous page\"\n [disabled]=\"currentPage() === 1\"\n (click)=\"goTo(currentPage() - 1)\"\n >\n <ds-icon\n name=\"chevronLeft\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n\n @for (item of pageItems(); track $index) {\n @if (item === 'ellipsis') {\n <span\n class=\"ellipsis\"\n aria-hidden=\"true\"\n >\n \u2026\n </span>\n } @else {\n <button\n class=\"pagination-button\"\n type=\"button\"\n [class.active]=\"item === currentPage()\"\n [attr.aria-label]=\"'Page ' + item\"\n [attr.aria-current]=\"item === currentPage() ? 'page' : null\"\n (click)=\"goTo(item)\"\n >\n {{ item }}\n </button>\n }\n }\n\n <button\n class=\"pagination-button\"\n type=\"button\"\n aria-label=\"Next page\"\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"goTo(currentPage() + 1)\"\n >\n <ds-icon\n name=\"chevronRight\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n\n @if (showPageSize()) {\n <!-- reserveMessage pinned off: a page-size dropdown shows neither hint nor\n error, so there is nothing to reserve, and inheriting the app-level\n default would push the control off the page buttons' baseline. -->\n <ds-select\n class=\"size\"\n ariaLabel=\"Rows per page\"\n size=\"sm\"\n [reserveMessage]=\"false\"\n [options]=\"sizeOptions()\"\n [value]=\"pageSizeStr()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n </ds-select>\n }\n</nav>\n", styles: [":host{--_pagination-btn-bg-color: var(--ds-pagination-btn-bg-color, var(--surface-default));--_pagination-btn-bg-color-hover: var(--ds-pagination-btn-bg-color-hover, var(--surface-secondary));--_pagination-btn-label-color: var(--ds-pagination-btn-label-color, var(--text-secondary));--_pagination-btn-label-color-hover: var(--ds-pagination-btn-label-color-hover, var(--text-primary));--_pagination-btn-border: var(--ds-pagination-btn-border, var(--border-default));--_pagination-active-bg-color: var(--ds-pagination-active-bg-color, var(--accent));--_pagination-active-bg-color-hover: var(--ds-pagination-active-bg-color-hover, var(--accent-hover));--_pagination-active-label-color: var(--ds-pagination-active-label-color, var(--accent-on));--_pagination-radius: var(--ds-pagination-radius, var(--ds-radius-control));--_pagination-focus-shadow: var(--ds-pagination-focus-shadow, var(--ds-control-focus-shadow));--_pagination-label-font-size: var(--ds-pagination-label-font-size, var(--font-size-s));--_pagination-label-weight: var(--ds-pagination-label-weight, var(--font-weight-regular));--_pagination-label-color: var(--ds-pagination-label-color, var(--text-secondary));display:inline-flex}.pagination{display:inline-flex;gap:var(--space-1);align-items:center;flex-wrap:wrap}.pagination .label{font:var(--_pagination-label-weight) var(--_pagination-label-font-size)/var(--line-height-flat) var(--font-sans);color:var(--_pagination-label-color);margin-right:var(--space-2)}.pagination .pagination-button{min-width:var(--hit-min);height:var(--hit-min);padding:0 var(--space-2);border:var(--border-width-default) solid var(--_pagination-btn-border);background-color:var(--_pagination-btn-bg-color);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_pagination-btn-label-color);border-radius:var(--_pagination-radius);cursor:pointer;display:inline-grid;place-items:center;transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.pagination .pagination-button:hover:not([disabled],.active){background-color:var(--_pagination-btn-bg-color-hover);color:var(--_pagination-btn-label-color-hover)}.pagination .pagination-button.active{background-color:var(--_pagination-active-bg-color);color:var(--_pagination-active-label-color);border-color:var(--_pagination-active-bg-color)}.pagination .pagination-button.active:hover:not([disabled]){background-color:var(--_pagination-active-bg-color-hover);border-color:var(--_pagination-active-bg-color-hover)}.pagination .pagination-button[disabled]{color:var(--text-disabled);cursor:not-allowed}.pagination .pagination-button:focus-visible{outline:none;box-shadow:var(--_pagination-focus-shadow)}.pagination .pagination-button:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.pagination .ellipsis{padding:0 var(--space-2);color:var(--text-tertiary)}.pagination .size{margin-left:var(--space-2);width:auto;flex:0 0 auto}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: SelectComponent, selector: "ds-select", inputs: ["value", "options", "width", "placeholder", "size", "label", "disabled", "readOnly", "readonly", "success", "required", "optional", "name", "ariaLabel", "clearable"], outputs: ["valueChange"] }] });
|
|
4910
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: PaginationComponent, isStandalone: true, selector: "ds-pagination", inputs: { total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: true, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageSize: "pageSizeChange", currentPage: "currentPageChange" }, ngImport: i0, template: "<nav\n class=\"pagination\"\n aria-label=\"Pagination\"\n>\n @if (showLabel()) {\n <span class=\"label\">\n {{ rangeLabel() }}\n </span>\n }\n\n <button\n class=\"pagination-button\"\n type=\"button\"\n aria-label=\"Previous page\"\n [disabled]=\"currentPage() === 1\"\n (click)=\"goTo(currentPage() - 1)\"\n >\n <ds-icon\n name=\"chevronLeft\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n\n @for (item of pageItems(); track $index) {\n @if (item === 'ellipsis') {\n <span\n class=\"ellipsis\"\n aria-hidden=\"true\"\n >\n \u2026\n </span>\n } @else {\n <button\n class=\"pagination-button\"\n type=\"button\"\n [class.active]=\"item === currentPage()\"\n [attr.aria-label]=\"'Page ' + item\"\n [attr.aria-current]=\"item === currentPage() ? 'page' : null\"\n (click)=\"goTo(item)\"\n >\n {{ item }}\n </button>\n }\n }\n\n <button\n class=\"pagination-button\"\n type=\"button\"\n aria-label=\"Next page\"\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"goTo(currentPage() + 1)\"\n >\n <ds-icon\n name=\"chevronRight\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n\n @if (showPageSize()) {\n <!-- reserveMessage pinned off: a page-size dropdown shows neither hint nor\n error, so there is nothing to reserve, and inheriting the app-level\n default would push the control off the page buttons' baseline. -->\n <ds-select\n class=\"size\"\n ariaLabel=\"Rows per page\"\n size=\"sm\"\n [reserveMessage]=\"false\"\n [options]=\"sizeOptions()\"\n [value]=\"pageSizeStr()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n </ds-select>\n }\n</nav>\n", styles: [":host{--_pagination-btn-bg-color: var(--ds-pagination-btn-bg-color, var(--surface-default));--_pagination-btn-bg-color-hover: var(--ds-pagination-btn-bg-color-hover, var(--surface-secondary));--_pagination-btn-label-color: var(--ds-pagination-btn-label-color, var(--text-secondary));--_pagination-btn-label-color-hover: var(--ds-pagination-btn-label-color-hover, var(--text-primary));--_pagination-btn-border: var(--ds-pagination-btn-border, var(--border-default));--_pagination-active-bg-color: var(--ds-pagination-active-bg-color, var(--accent));--_pagination-active-bg-color-hover: var(--ds-pagination-active-bg-color-hover, var(--accent-hover));--_pagination-active-label-color: var(--ds-pagination-active-label-color, var(--accent-on));--_pagination-radius: var(--ds-pagination-radius, var(--ds-radius-control));--_pagination-focus-shadow: var(--ds-pagination-focus-shadow, var(--ds-control-focus-shadow));--_pagination-label-font-size: var(--ds-pagination-label-font-size, var(--font-size-s));--_pagination-label-weight: var(--ds-pagination-label-weight, var(--font-weight-regular));--_pagination-label-color: var(--ds-pagination-label-color, var(--text-secondary));display:inline-flex}.pagination{display:inline-flex;gap:var(--space-1);align-items:center;flex-wrap:wrap}.pagination .label{font:var(--_pagination-label-weight) var(--_pagination-label-font-size)/var(--line-height-flat) var(--font-sans);color:var(--_pagination-label-color);margin-right:var(--space-2)}.pagination .pagination-button{min-width:var(--hit-min);height:var(--hit-min);padding:0 var(--space-2);border:var(--border-width-default) solid var(--_pagination-btn-border);background-color:var(--_pagination-btn-bg-color);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_pagination-btn-label-color);border-radius:var(--_pagination-radius);cursor:pointer;display:inline-grid;place-items:center;transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.pagination .pagination-button:hover:not([disabled],.active){background-color:var(--_pagination-btn-bg-color-hover);color:var(--_pagination-btn-label-color-hover)}.pagination .pagination-button.active{background-color:var(--_pagination-active-bg-color);color:var(--_pagination-active-label-color);border-color:var(--_pagination-active-bg-color)}.pagination .pagination-button.active:hover:not([disabled]){background-color:var(--_pagination-active-bg-color-hover);border-color:var(--_pagination-active-bg-color-hover)}.pagination .pagination-button[disabled]{color:var(--text-disabled);cursor:not-allowed}.pagination .pagination-button:focus-visible{outline:none;box-shadow:var(--_pagination-focus-shadow)}.pagination .pagination-button:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.pagination .ellipsis{padding:0 var(--space-2);color:var(--text-tertiary)}.pagination .size{margin-left:var(--space-2);width:auto;flex:0 0 auto}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: SelectComponent, selector: "ds-select", inputs: ["value", "options", "width", "placeholder", "size", "label", "disabled", "loading", "scrollActiveIntoView", "readOnly", "readonly", "success", "required", "optional", "name", "ariaLabel", "clearable"], outputs: ["valueChange", "opened", "closed"] }] });
|
|
4633
4911
|
}
|
|
4634
4912
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
4635
4913
|
type: Component,
|
|
@@ -4647,116 +4925,346 @@ class LoadingOverlayComponent {
|
|
|
4647
4925
|
spinnerSize = input('md', ...(ngDevMode ? [{ debugName: "spinnerSize" }] : /* istanbul ignore next */ []));
|
|
4648
4926
|
/** Offset the scrim top edge — useful when a sticky header should stay uncovered. */
|
|
4649
4927
|
insetTop = input('0', ...(ngDevMode ? [{ debugName: "insetTop" }] : /* istanbul ignore next */ []));
|
|
4928
|
+
/**
|
|
4929
|
+
* Whether the projected content goes `inert` while the scrim is up. On by
|
|
4930
|
+
* default, because a scrim that only stops the POINTER is the bug this exists
|
|
4931
|
+
* to prevent: focus walks straight under it, and a keyboard user activates a
|
|
4932
|
+
* control the mouse cannot even reach.
|
|
4933
|
+
*
|
|
4934
|
+
* Turn it off only when the scrim covers part of the content (`insetTop`), and
|
|
4935
|
+
* then mark the covered subtree `inert` yourself — a blanket flag would take
|
|
4936
|
+
* the uncovered part with it. `ds-table` does exactly that: the scrim starts
|
|
4937
|
+
* below the header, so sorting during a refresh stays possible.
|
|
4938
|
+
*/
|
|
4939
|
+
inertContent = input(true, { ...(ngDevMode ? { debugName: "inertContent" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4650
4940
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoadingOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4651
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoadingOverlayComponent, isStandalone: true, selector: "ds-loading-overlay", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, blur: { classPropertyName: "blur", publicName: "blur", isSignal: true, isRequired: false, transformFunction: null }, spinnerSize: { classPropertyName: "spinnerSize", publicName: "spinnerSize", isSignal: true, isRequired: false, transformFunction: null }, insetTop: { classPropertyName: "insetTop", publicName: "insetTop", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-busy": "loading() ? \"true\" : null" } }, ngImport: i0, template: "<ng-content></ng-content>\n\n@if (loading()) {\n <div\n class=\"scrim\"\n [class.blur]=\"blur()\"\n [style.top]=\"insetTop()\"\n >\n <ds-spinner [size]=\"spinnerSize()\" />\n\n @if (label()) {\n <span class=\"label\">\n {{ label() }}\n </span>\n }\n </div>\n}\n", styles: ["
|
|
4941
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoadingOverlayComponent, isStandalone: true, selector: "ds-loading-overlay", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, blur: { classPropertyName: "blur", publicName: "blur", isSignal: true, isRequired: false, transformFunction: null }, spinnerSize: { classPropertyName: "spinnerSize", publicName: "spinnerSize", isSignal: true, isRequired: false, transformFunction: null }, insetTop: { classPropertyName: "insetTop", publicName: "insetTop", isSignal: true, isRequired: false, transformFunction: null }, inertContent: { classPropertyName: "inertContent", publicName: "inertContent", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-busy": "loading() ? \"true\" : null" } }, ngImport: i0, template: "<div\n class=\"content\"\n [attr.inert]=\"loading() && inertContent() ? '' : null\"\n>\n <ng-content></ng-content>\n</div>\n\n@if (loading()) {\n <div\n class=\"scrim\"\n [class.blur]=\"blur()\"\n [style.top]=\"insetTop()\"\n >\n <ds-spinner [size]=\"spinnerSize()\" />\n\n @if (label()) {\n <span class=\"label\">\n {{ label() }}\n </span>\n }\n </div>\n}\n", styles: ["@charset \"UTF-8\";:host{display:block;position:relative;--_scrim-color: var(--ds-loading-overlay-scrim-color, color-mix( in srgb, var(--surface-canvas) calc(var(--opacity-scrim) * 100%), transparent ));--_label-color: var(--ds-loading-overlay-label-color, var(--text-secondary));--_enter-keyframes: var(--ds-loading-overlay-enter-keyframes, ds-fade-in);--_enter-duration: var(--ds-loading-overlay-enter-duration, var(--duration-fast));--_enter-easing: var(--ds-loading-overlay-enter-easing, var(--ease-standard));--_ds-enter-scale: var(--ds-loading-overlay-enter-scale, .96)}@media(prefers-reduced-motion:reduce){:host{--_enter-duration: 0ms}}.content{display:contents}.scrim{position:absolute;inset:0;z-index:var(--layer-raised);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-3);background-color:var(--_scrim-color);animation-name:var(--_enter-keyframes);animation-duration:var(--_enter-duration);animation-timing-function:var(--_enter-easing)}.scrim.blur{-webkit-backdrop-filter:blur(var(--blur-sm));backdrop-filter:blur(var(--blur-sm))}.label{color:var(--_label-color);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-base) var(--font-sans)}\n"], dependencies: [{ kind: "component", type: SpinnerComponent, selector: "ds-spinner", inputs: ["size"] }] });
|
|
4652
4942
|
}
|
|
4653
4943
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoadingOverlayComponent, decorators: [{
|
|
4654
4944
|
type: Component,
|
|
4655
4945
|
args: [{ selector: 'ds-loading-overlay', standalone: true, imports: [SpinnerComponent], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
4656
4946
|
'[attr.aria-busy]': 'loading() ? "true" : null',
|
|
4657
|
-
}, template: "<ng-content></ng-content>\n\n@if (loading()) {\n <div\n class=\"scrim\"\n [class.blur]=\"blur()\"\n [style.top]=\"insetTop()\"\n >\n <ds-spinner [size]=\"spinnerSize()\" />\n\n @if (label()) {\n <span class=\"label\">\n {{ label() }}\n </span>\n }\n </div>\n}\n", styles: ["
|
|
4658
|
-
}], propDecorators: { loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], blur: [{ type: i0.Input, args: [{ isSignal: true, alias: "blur", required: false }] }], spinnerSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "spinnerSize", required: false }] }], insetTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "insetTop", required: false }] }] } });
|
|
4947
|
+
}, template: "<div\n class=\"content\"\n [attr.inert]=\"loading() && inertContent() ? '' : null\"\n>\n <ng-content></ng-content>\n</div>\n\n@if (loading()) {\n <div\n class=\"scrim\"\n [class.blur]=\"blur()\"\n [style.top]=\"insetTop()\"\n >\n <ds-spinner [size]=\"spinnerSize()\" />\n\n @if (label()) {\n <span class=\"label\">\n {{ label() }}\n </span>\n }\n </div>\n}\n", styles: ["@charset \"UTF-8\";:host{display:block;position:relative;--_scrim-color: var(--ds-loading-overlay-scrim-color, color-mix( in srgb, var(--surface-canvas) calc(var(--opacity-scrim) * 100%), transparent ));--_label-color: var(--ds-loading-overlay-label-color, var(--text-secondary));--_enter-keyframes: var(--ds-loading-overlay-enter-keyframes, ds-fade-in);--_enter-duration: var(--ds-loading-overlay-enter-duration, var(--duration-fast));--_enter-easing: var(--ds-loading-overlay-enter-easing, var(--ease-standard));--_ds-enter-scale: var(--ds-loading-overlay-enter-scale, .96)}@media(prefers-reduced-motion:reduce){:host{--_enter-duration: 0ms}}.content{display:contents}.scrim{position:absolute;inset:0;z-index:var(--layer-raised);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-3);background-color:var(--_scrim-color);animation-name:var(--_enter-keyframes);animation-duration:var(--_enter-duration);animation-timing-function:var(--_enter-easing)}.scrim.blur{-webkit-backdrop-filter:blur(var(--blur-sm));backdrop-filter:blur(var(--blur-sm))}.label{color:var(--_label-color);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-base) var(--font-sans)}\n"] }]
|
|
4948
|
+
}], propDecorators: { loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], blur: [{ type: i0.Input, args: [{ isSignal: true, alias: "blur", required: false }] }], spinnerSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "spinnerSize", required: false }] }], insetTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "insetTop", required: false }] }], inertContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "inertContent", required: false }] }] } });
|
|
4659
4949
|
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
*
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
}
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
return;
|
|
4724
|
-
}
|
|
4725
|
-
this.
|
|
4726
|
-
|
|
4727
|
-
}
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4950
|
+
/**
|
|
4951
|
+
* Dismiss-on-backdrop for a backdrop that WRAPS its dialog.
|
|
4952
|
+
*
|
|
4953
|
+
* `click` cannot be trusted there: the browser fires it at the nearest common
|
|
4954
|
+
* ancestor of the press and the release, so a drag that starts inside the dialog and
|
|
4955
|
+
* ends on the backdrop fires `click` ON THE BACKDROP, and a
|
|
4956
|
+
* `target === currentTarget` check waves it through. Hence tracking the press:
|
|
4957
|
+
* dismiss only when press AND release both land on the backdrop itself. `ds-drawer` needs none of this because its scrim
|
|
4958
|
+
* is a SIBLING of the panel, which makes their common ancestor a third element.
|
|
4959
|
+
*/
|
|
4960
|
+
function backdropDismiss() {
|
|
4961
|
+
let pressedOnBackdrop = false;
|
|
4962
|
+
return {
|
|
4963
|
+
down(event) {
|
|
4964
|
+
pressedOnBackdrop =
|
|
4965
|
+
event.button === 0 && event.target === event.currentTarget;
|
|
4966
|
+
},
|
|
4967
|
+
shouldDismiss(event) {
|
|
4968
|
+
const dismiss = pressedOnBackdrop &&
|
|
4969
|
+
event.button === 0 &&
|
|
4970
|
+
event.target === event.currentTarget;
|
|
4971
|
+
pressedOnBackdrop = false;
|
|
4972
|
+
return dismiss;
|
|
4973
|
+
},
|
|
4974
|
+
};
|
|
4975
|
+
}
|
|
4976
|
+
|
|
4977
|
+
let nextId$8 = 0;
|
|
4978
|
+
/** Bottom-anchored sheet — the mobile sibling of ds-drawer. Closes on scrim
|
|
4979
|
+
* tap, Escape, or a downward drag on the grab strip. While open it locks
|
|
4980
|
+
* body scroll. On wide viewports the panel is capped by
|
|
4981
|
+
* --ds-bottom-sheet-maxw and centred; prefer ds-modal / ds-drawer for
|
|
4982
|
+
* desktop-first layouts. position: fixed resolves against the nearest
|
|
4983
|
+
* ancestor containing block, so framed hosts contain the sheet. */
|
|
4984
|
+
class BottomSheetComponent {
|
|
4985
|
+
/** Open state, two-way bound. */
|
|
4986
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
4987
|
+
/** Sheet title, shown in the header and used for `aria-labelledby`. */
|
|
4988
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
4989
|
+
/** Fires once the close (leave) animation finishes. */
|
|
4990
|
+
closed = output();
|
|
4991
|
+
titleId = `ds-bottom-sheet-title-${++nextId$8}`;
|
|
4992
|
+
/**
|
|
4993
|
+
* Snap-point heights as fractions of viewport height (0–1), ascending.
|
|
4994
|
+
* e.g. [0.4, 0.9]. When provided the sheet opens at the first snap point;
|
|
4995
|
+
* dragging snaps to the nearest point; dragging below the lowest closes.
|
|
4996
|
+
* When empty (default) the original single-height behavior is preserved.
|
|
4997
|
+
*/
|
|
4998
|
+
snapPoints = input([], ...(ngDevMode ? [{ debugName: "snapPoints" }] : /* istanbul ignore next */ []));
|
|
4999
|
+
doc = inject(DOCUMENT$1);
|
|
5000
|
+
scrollLock = inject(BodyScrollLockService);
|
|
5001
|
+
sheetRef = viewChild('sheet', ...(ngDevMode ? [{ debugName: "sheetRef" }] : /* istanbul ignore next */ []));
|
|
5002
|
+
dragOffset = signal(null, ...(ngDevMode ? [{ debugName: "dragOffset" }] : /* istanbul ignore next */ []));
|
|
5003
|
+
/** Sheet is in the DOM (kept true through the leave animation). */
|
|
5004
|
+
rendered = signal(false, ...(ngDevMode ? [{ debugName: "rendered" }] : /* istanbul ignore next */ []));
|
|
5005
|
+
/** Playing the slide-down + scrim-fade leave animation. */
|
|
5006
|
+
closing = signal(false, ...(ngDevMode ? [{ debugName: "closing" }] : /* istanbul ignore next */ []));
|
|
5007
|
+
/** Index of the currently active snap point (only used when snapPoints is non-empty). */
|
|
5008
|
+
activeSnapIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeSnapIndex" }] : /* istanbul ignore next */ []));
|
|
5009
|
+
/** CSS height string derived from the active snap point, or null when snapPoints is empty. */
|
|
5010
|
+
snapHeight = computed(() => {
|
|
5011
|
+
const points = this.snapPoints();
|
|
5012
|
+
if (points.length === 0) {
|
|
5013
|
+
return null;
|
|
5014
|
+
}
|
|
5015
|
+
const index = Math.min(this.activeSnapIndex(), points.length - 1);
|
|
5016
|
+
return `${points[index] * 100}vh`;
|
|
5017
|
+
}, ...(ngDevMode ? [{ debugName: "snapHeight" }] : /* istanbul ignore next */ []));
|
|
5018
|
+
dragStartY = 0;
|
|
5019
|
+
lastMoveY = 0;
|
|
5020
|
+
lastMoveTime = 0;
|
|
5021
|
+
velocity = 0;
|
|
5022
|
+
wasOpen = false;
|
|
5023
|
+
closeFallbackTimer = null;
|
|
5024
|
+
constructor() {
|
|
5025
|
+
// open → DOM lifecycle. Opening renders immediately; closing keeps the
|
|
5026
|
+
// sheet mounted and flips `closing` so the leave animation can play —
|
|
5027
|
+
// teardown happens in onLeaveEnd() once animationend fires.
|
|
5028
|
+
effect(() => {
|
|
5029
|
+
const isOpen = this.open();
|
|
5030
|
+
if (isOpen) {
|
|
5031
|
+
this.closing.set(false);
|
|
5032
|
+
this.rendered.set(true);
|
|
5033
|
+
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
5034
|
+
this.closeFallbackTimer = null;
|
|
5035
|
+
if (this.snapPoints().length > 0) {
|
|
5036
|
+
this.activeSnapIndex.set(0);
|
|
5037
|
+
}
|
|
5038
|
+
}
|
|
5039
|
+
else if (this.wasOpen) {
|
|
5040
|
+
this.closing.set(true);
|
|
5041
|
+
// Chrome freezes CSS animations on a backgrounded tab, so animationend
|
|
5042
|
+
// may never fire — this synthetic fallback guarantees teardown anyway.
|
|
5043
|
+
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
5044
|
+
this.closeFallbackTimer = setTimeout(() => this.finishClose(), 300);
|
|
5045
|
+
}
|
|
5046
|
+
this.wasOpen = isOpen;
|
|
5047
|
+
});
|
|
5048
|
+
// Ref-counted body-scroll lock, shared with modal/drawer so stacked
|
|
5049
|
+
// overlays don't unlock each other. The cleanup fires on the rendered→false
|
|
5050
|
+
// transition and on destroy, keeping lock/unlock paired.
|
|
5051
|
+
effect((onCleanup) => {
|
|
5052
|
+
if (!this.rendered()) {
|
|
5053
|
+
return;
|
|
5054
|
+
}
|
|
5055
|
+
this.scrollLock.lock();
|
|
5056
|
+
onCleanup(() => this.scrollLock.unlock());
|
|
5057
|
+
});
|
|
5058
|
+
}
|
|
5059
|
+
ngOnDestroy() {
|
|
5060
|
+
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
5061
|
+
this.closeFallbackTimer = null;
|
|
5062
|
+
}
|
|
5063
|
+
close() {
|
|
5064
|
+
this.dragOffset.set(null);
|
|
5065
|
+
this.open.set(false);
|
|
5066
|
+
}
|
|
5067
|
+
onLeaveEnd(event) {
|
|
5068
|
+
// The animated element is the one with the handler, so its OWN animationend is
|
|
5069
|
+
// the signal; anything bubbling from inside is not. This replaces matching the
|
|
5070
|
+
// keyframes NAME, which is what made the exit un-overridable.
|
|
5071
|
+
if (event.target !== event.currentTarget) {
|
|
5072
|
+
return;
|
|
5073
|
+
}
|
|
5074
|
+
this.finishClose();
|
|
5075
|
+
}
|
|
5076
|
+
finishClose() {
|
|
5077
|
+
if (!this.closing()) {
|
|
5078
|
+
return;
|
|
5079
|
+
}
|
|
5080
|
+
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
5081
|
+
this.closeFallbackTimer = null;
|
|
5082
|
+
this.closing.set(false);
|
|
5083
|
+
this.rendered.set(false);
|
|
5084
|
+
this.closed.emit();
|
|
5085
|
+
}
|
|
5086
|
+
onEscape() {
|
|
5087
|
+
if (this.open()) {
|
|
5088
|
+
this.close();
|
|
5089
|
+
}
|
|
5090
|
+
}
|
|
5091
|
+
backdropPress = backdropDismiss();
|
|
5092
|
+
onBackdropRelease(event) {
|
|
5093
|
+
if (this.backdropPress.shouldDismiss(event)) {
|
|
5094
|
+
this.close();
|
|
5095
|
+
}
|
|
5096
|
+
}
|
|
5097
|
+
onGrabStart(event) {
|
|
5098
|
+
event.target.setPointerCapture(event.pointerId);
|
|
5099
|
+
this.dragStartY = event.clientY;
|
|
5100
|
+
this.lastMoveY = event.clientY;
|
|
5101
|
+
this.lastMoveTime = event.timeStamp;
|
|
5102
|
+
this.velocity = 0;
|
|
5103
|
+
this.dragOffset.set(0);
|
|
5104
|
+
}
|
|
5105
|
+
onGrabMove(event) {
|
|
5106
|
+
if (this.dragOffset() === null) {
|
|
5107
|
+
return;
|
|
5108
|
+
}
|
|
5109
|
+
const deltaTime = event.timeStamp - this.lastMoveTime;
|
|
5110
|
+
if (deltaTime > 0) {
|
|
5111
|
+
this.velocity = (event.clientY - this.lastMoveY) / deltaTime;
|
|
5112
|
+
}
|
|
5113
|
+
this.lastMoveY = event.clientY;
|
|
5114
|
+
this.lastMoveTime = event.timeStamp;
|
|
5115
|
+
this.dragOffset.set(Math.max(0, event.clientY - this.dragStartY));
|
|
5116
|
+
}
|
|
5117
|
+
onGrabEnd() {
|
|
5118
|
+
const offset = this.dragOffset();
|
|
5119
|
+
if (offset === null) {
|
|
5120
|
+
return;
|
|
5121
|
+
}
|
|
5122
|
+
const points = this.snapPoints();
|
|
5123
|
+
if (points.length === 0) {
|
|
5124
|
+
// Original single-height behavior.
|
|
5125
|
+
const sheetHeight = this.sheetRef()?.nativeElement.offsetHeight ?? 0;
|
|
5126
|
+
const pastThreshold = sheetHeight > 0 && offset > sheetHeight * 0.3;
|
|
5127
|
+
const flicked = this.velocity > 0.5;
|
|
5128
|
+
if (pastThreshold || flicked) {
|
|
5129
|
+
this.close();
|
|
5130
|
+
}
|
|
5131
|
+
else {
|
|
5132
|
+
this.dragOffset.set(null);
|
|
5133
|
+
}
|
|
5134
|
+
return;
|
|
5135
|
+
}
|
|
5136
|
+
// Snap-point behavior: determine which snap point to land on.
|
|
5137
|
+
const viewportHeight = this.doc.defaultView?.innerHeight ?? window.innerHeight;
|
|
5138
|
+
const currentIndex = this.activeSnapIndex();
|
|
5139
|
+
const currentHeightPx = points[currentIndex] * viewportHeight;
|
|
5140
|
+
// Positive offset = dragged downward.
|
|
5141
|
+
const targetHeightPx = currentHeightPx - offset;
|
|
5142
|
+
const flicked = this.velocity > 0.5;
|
|
5143
|
+
if (flicked || targetHeightPx < points[0] * viewportHeight * 0.7) {
|
|
5144
|
+
// Dragged below lowest snap point or flicked down → close.
|
|
5145
|
+
this.close();
|
|
5146
|
+
return;
|
|
5147
|
+
}
|
|
5148
|
+
let nearestIndex = 0;
|
|
5149
|
+
let smallestDelta = Infinity;
|
|
5150
|
+
for (let pointIndex = 0; pointIndex < points.length; pointIndex++) {
|
|
5151
|
+
const delta = Math.abs(points[pointIndex] * viewportHeight - targetHeightPx);
|
|
5152
|
+
if (delta < smallestDelta) {
|
|
5153
|
+
smallestDelta = delta;
|
|
5154
|
+
nearestIndex = pointIndex;
|
|
5155
|
+
}
|
|
5156
|
+
}
|
|
5157
|
+
this.dragOffset.set(null);
|
|
5158
|
+
this.activeSnapIndex.set(nearestIndex);
|
|
5159
|
+
}
|
|
5160
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: BottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5161
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: BottomSheetComponent, isStandalone: true, selector: "ds-bottom-sheet", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, snapPoints: { classPropertyName: "snapPoints", publicName: "snapPoints", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", closed: "closed" }, viewQueries: [{ propertyName: "sheetRef", first: true, predicate: ["sheet"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (rendered()) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- backdrop; keyboard dismissal is (keydown.escape) on this element, a backdrop isn't a tabbable control -->\n <div\n class=\"sheet-overlay\"\n [class.closing]=\"closing()\"\n (pointerdown)=\"backdropPress.down($event)\"\n (pointerup)=\"onBackdropRelease($event)\"\n (keydown.escape)=\"onEscape()\"\n >\n <div\n #sheet\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n class=\"sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n [class.dragging]=\"dragOffset() !== null\"\n [class.closing]=\"closing()\"\n [class.snapping]=\"snapPoints().length > 0 && dragOffset() === null\"\n [style.transform]=\"\n dragOffset() ? 'translateY(' + dragOffset() + 'px)' : null\n \"\n [style.height]=\"snapHeight()\"\n [style.maxHeight]=\"snapHeight() ? snapHeight() : null\"\n (animationend)=\"onLeaveEnd($event)\"\n >\n <div\n class=\"grab\"\n (pointerdown)=\"onGrabStart($event)\"\n (pointermove)=\"onGrabMove($event)\"\n (pointerup)=\"onGrabEnd()\"\n (pointercancel)=\"onGrabEnd()\"\n >\n <div class=\"sheet-handle\"></div>\n </div>\n\n @if (title()) {\n <h3\n class=\"sheet-title\"\n [id]=\"titleId\"\n >\n {{ title() }}\n </h3>\n }\n\n <div class=\"sheet-body\">\n <ng-content />\n </div>\n\n <div class=\"sheet-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n </div>\n}\n", styles: [":host{--_bottom-sheet-maxw: var(--ds-bottom-sheet-maxw, 480px);--_bottom-sheet-maxh: var(--ds-bottom-sheet-maxh, 80%);--_bottom-sheet-radius: var(--ds-bottom-sheet-radius, var(--ds-radius-panel));--_bottom-sheet-bg-color: var(--ds-bottom-sheet-bg-color, var(--surface-default));--_bottom-sheet-scrim-color: var(--ds-bottom-sheet-scrim-color, var(--surface-scrim));--_bottom-sheet-title-text-color: var(--ds-bottom-sheet-title-text-color, var(--text-primary));--_bottom-sheet-enter-keyframes: var(--ds-bottom-sheet-enter-keyframes, ds-slide-edge-in);--_bottom-sheet-leave-keyframes: var(--ds-bottom-sheet-leave-keyframes, ds-slide-edge-out);--_bottom-sheet-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-surface-duration));--_bottom-sheet-enter-easing: var(--ds-bottom-sheet-enter-easing, var(--ds-motion-enter-surface-easing));--_bottom-sheet-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-large-duration));--_bottom-sheet-leave-easing: var(--ds-bottom-sheet-leave-easing, var(--ds-motion-exit-large-easing));--_bottom-sheet-scrim-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-panel-duration));--_bottom-sheet-scrim-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-bottom-sheet-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_bottom-sheet-enter-duration: 0ms;--_bottom-sheet-leave-duration: 0ms;--_bottom-sheet-scrim-enter-duration: 0ms;--_bottom-sheet-scrim-leave-duration: 0ms}}.sheet-overlay{position:fixed;inset:0;z-index:var(--layer-modal);background:var(--_bottom-sheet-scrim-color);display:flex;flex-direction:column;justify-content:flex-end;overflow:clip;animation-name:ds-fade-in;animation-duration:var(--_bottom-sheet-scrim-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing)}.sheet-overlay.closing{animation-name:ds-fade-out;animation-duration:var(--_bottom-sheet-scrim-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards}.sheet{--_ds-enter-y: 100%;position:relative;width:min(100%,var(--_bottom-sheet-maxw));margin-inline:auto;background:var(--_bottom-sheet-bg-color);border-radius:var(--_bottom-sheet-radius) var(--_bottom-sheet-radius) 0 0;padding:0 var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom,0px));animation-name:var(--_bottom-sheet-enter-keyframes);animation-duration:var(--_bottom-sheet-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing);max-height:var(--_bottom-sheet-maxh);display:flex;flex-direction:column;transition:transform var(--duration-base) var(--ease-decelerate)}.sheet.dragging{transition:none}.sheet.snapping{transition:transform var(--duration-base) var(--ease-decelerate),height var(--duration-base) var(--ease-decelerate)}@media(prefers-reduced-motion:reduce){.sheet.snapping{transition:none}}.sheet.closing{animation-name:var(--_bottom-sheet-leave-keyframes);animation-duration:var(--_bottom-sheet-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards}.grab{padding:var(--space-3) 0;margin:0 calc(var(--space-4) * -1);cursor:grab;touch-action:none}.sheet-handle{width:var(--bottom-sheet-handle-w);height:var(--bottom-sheet-handle-h);background:var(--border-strong);border-radius:var(--radius-pill);margin:0 auto}.sheet-title{font:var(--font-weight-semibold) var(--font-size-l)/var(--line-height-snug) var(--font-sans);color:var(--_bottom-sheet-title-text-color);margin:0 0 var(--space-3)}.sheet-body{display:flex;flex-direction:column;gap:var(--space-2);overflow-y:auto;min-height:0;padding:var(--space-1);margin:calc(var(--space-1) * -1)}.sheet-actions{display:flex;flex-direction:column;gap:var(--space-2)}.sheet-actions:not(:empty){margin-top:var(--space-3)}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
5162
|
+
}
|
|
5163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: BottomSheetComponent, decorators: [{
|
|
5164
|
+
type: Component,
|
|
5165
|
+
args: [{ selector: 'ds-bottom-sheet', standalone: true, imports: [A11yModule], encapsulation: ViewEncapsulation.Emulated, template: "@if (rendered()) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- backdrop; keyboard dismissal is (keydown.escape) on this element, a backdrop isn't a tabbable control -->\n <div\n class=\"sheet-overlay\"\n [class.closing]=\"closing()\"\n (pointerdown)=\"backdropPress.down($event)\"\n (pointerup)=\"onBackdropRelease($event)\"\n (keydown.escape)=\"onEscape()\"\n >\n <div\n #sheet\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n class=\"sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n [class.dragging]=\"dragOffset() !== null\"\n [class.closing]=\"closing()\"\n [class.snapping]=\"snapPoints().length > 0 && dragOffset() === null\"\n [style.transform]=\"\n dragOffset() ? 'translateY(' + dragOffset() + 'px)' : null\n \"\n [style.height]=\"snapHeight()\"\n [style.maxHeight]=\"snapHeight() ? snapHeight() : null\"\n (animationend)=\"onLeaveEnd($event)\"\n >\n <div\n class=\"grab\"\n (pointerdown)=\"onGrabStart($event)\"\n (pointermove)=\"onGrabMove($event)\"\n (pointerup)=\"onGrabEnd()\"\n (pointercancel)=\"onGrabEnd()\"\n >\n <div class=\"sheet-handle\"></div>\n </div>\n\n @if (title()) {\n <h3\n class=\"sheet-title\"\n [id]=\"titleId\"\n >\n {{ title() }}\n </h3>\n }\n\n <div class=\"sheet-body\">\n <ng-content />\n </div>\n\n <div class=\"sheet-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n </div>\n}\n", styles: [":host{--_bottom-sheet-maxw: var(--ds-bottom-sheet-maxw, 480px);--_bottom-sheet-maxh: var(--ds-bottom-sheet-maxh, 80%);--_bottom-sheet-radius: var(--ds-bottom-sheet-radius, var(--ds-radius-panel));--_bottom-sheet-bg-color: var(--ds-bottom-sheet-bg-color, var(--surface-default));--_bottom-sheet-scrim-color: var(--ds-bottom-sheet-scrim-color, var(--surface-scrim));--_bottom-sheet-title-text-color: var(--ds-bottom-sheet-title-text-color, var(--text-primary));--_bottom-sheet-enter-keyframes: var(--ds-bottom-sheet-enter-keyframes, ds-slide-edge-in);--_bottom-sheet-leave-keyframes: var(--ds-bottom-sheet-leave-keyframes, ds-slide-edge-out);--_bottom-sheet-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-surface-duration));--_bottom-sheet-enter-easing: var(--ds-bottom-sheet-enter-easing, var(--ds-motion-enter-surface-easing));--_bottom-sheet-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-large-duration));--_bottom-sheet-leave-easing: var(--ds-bottom-sheet-leave-easing, var(--ds-motion-exit-large-easing));--_bottom-sheet-scrim-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-panel-duration));--_bottom-sheet-scrim-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-bottom-sheet-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_bottom-sheet-enter-duration: 0ms;--_bottom-sheet-leave-duration: 0ms;--_bottom-sheet-scrim-enter-duration: 0ms;--_bottom-sheet-scrim-leave-duration: 0ms}}.sheet-overlay{position:fixed;inset:0;z-index:var(--layer-modal);background:var(--_bottom-sheet-scrim-color);display:flex;flex-direction:column;justify-content:flex-end;overflow:clip;animation-name:ds-fade-in;animation-duration:var(--_bottom-sheet-scrim-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing)}.sheet-overlay.closing{animation-name:ds-fade-out;animation-duration:var(--_bottom-sheet-scrim-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards}.sheet{--_ds-enter-y: 100%;position:relative;width:min(100%,var(--_bottom-sheet-maxw));margin-inline:auto;background:var(--_bottom-sheet-bg-color);border-radius:var(--_bottom-sheet-radius) var(--_bottom-sheet-radius) 0 0;padding:0 var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom,0px));animation-name:var(--_bottom-sheet-enter-keyframes);animation-duration:var(--_bottom-sheet-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing);max-height:var(--_bottom-sheet-maxh);display:flex;flex-direction:column;transition:transform var(--duration-base) var(--ease-decelerate)}.sheet.dragging{transition:none}.sheet.snapping{transition:transform var(--duration-base) var(--ease-decelerate),height var(--duration-base) var(--ease-decelerate)}@media(prefers-reduced-motion:reduce){.sheet.snapping{transition:none}}.sheet.closing{animation-name:var(--_bottom-sheet-leave-keyframes);animation-duration:var(--_bottom-sheet-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards}.grab{padding:var(--space-3) 0;margin:0 calc(var(--space-4) * -1);cursor:grab;touch-action:none}.sheet-handle{width:var(--bottom-sheet-handle-w);height:var(--bottom-sheet-handle-h);background:var(--border-strong);border-radius:var(--radius-pill);margin:0 auto}.sheet-title{font:var(--font-weight-semibold) var(--font-size-l)/var(--line-height-snug) var(--font-sans);color:var(--_bottom-sheet-title-text-color);margin:0 0 var(--space-3)}.sheet-body{display:flex;flex-direction:column;gap:var(--space-2);overflow-y:auto;min-height:0;padding:var(--space-1);margin:calc(var(--space-1) * -1)}.sheet-actions{display:flex;flex-direction:column;gap:var(--space-2)}.sheet-actions:not(:empty){margin-top:var(--space-3)}\n"] }]
|
|
5166
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }], snapPoints: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapPoints", required: false }] }], sheetRef: [{ type: i0.ViewChild, args: ['sheet', { isSignal: true }] }] } });
|
|
5167
|
+
|
|
5168
|
+
class MenuItemComponent {
|
|
5169
|
+
// The containing overlay (e.g. popover), if any — selecting an item closes it.
|
|
5170
|
+
// Optional, so menu-items also work standalone.
|
|
5171
|
+
closeRef = inject(DsOverlayCloseRef, { optional: true });
|
|
5172
|
+
overlay = inject(Overlay);
|
|
5173
|
+
vcr = inject(ViewContainerRef);
|
|
5174
|
+
hostElement = inject((ElementRef));
|
|
5175
|
+
button = viewChild.required('button');
|
|
5176
|
+
/** Leading icon shown before the projected label. */
|
|
5177
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
5178
|
+
/** Blocks activation and styles the item as inactive. It stays
|
|
5179
|
+
* keyboard-focusable (`aria-disabled`, ARIA menu practice) and in `ds-menu`'s
|
|
5180
|
+
* roving order, so a `[dsTooltip]` explaining why can be reached and shown. */
|
|
5181
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
5182
|
+
/** Renders the item in an error/destructive style. */
|
|
5183
|
+
error = input(false, { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
5184
|
+
/** Renders the item muted — a secondary row like "Sign out" under a divider,
|
|
5185
|
+
* still actionable but not competing with the items above it. */
|
|
5186
|
+
quiet = input(false, { ...(ngDevMode ? { debugName: "quiet" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
5187
|
+
/** A standing second line under the label — a limitation the action carries
|
|
5188
|
+
* ("will not be saved", "read-only in this workspace"). Visible without hover
|
|
5189
|
+
* or focus, which is what separates it from a `[dsTooltip]`.
|
|
5190
|
+
*
|
|
5191
|
+
* Reaches assistive tech as `aria-describedby`, NOT as part of the item's name:
|
|
5192
|
+
* the projected label names the action, and a caveat is a description of it.
|
|
5193
|
+
* That is why the line is `aria-hidden` in the DOM and referenced by id — inside
|
|
5194
|
+
* the button and visible, it would otherwise be concatenated into the name. */
|
|
5195
|
+
description = input('', ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
5196
|
+
/** Optional submenu template — renders a nested `ds-menu` on hover / ArrowRight. */
|
|
5197
|
+
submenu = input(null, ...(ngDevMode ? [{ debugName: "submenu" }] : /* istanbul ignore next */ []));
|
|
5198
|
+
/** Fires on click, unless the item is disabled or opens a submenu. */
|
|
5199
|
+
pressed = output();
|
|
5200
|
+
descriptionId = nextControlId('ds-menu-item-desc');
|
|
5201
|
+
/** Roving tabindex, owned by ds-menu — exactly one item is tabbable (0), the
|
|
5202
|
+
* rest -1. Defaults true so a standalone item (outside ds-menu) stays
|
|
5203
|
+
* reachable. */
|
|
5204
|
+
tabbable = signal(true, ...(ngDevMode ? [{ debugName: "tabbable" }] : /* istanbul ignore next */ []));
|
|
5205
|
+
submenuOpen = signal(false, ...(ngDevMode ? [{ debugName: "submenuOpen" }] : /* istanbul ignore next */ []));
|
|
5206
|
+
submenuRef = null;
|
|
5207
|
+
openTimer = null;
|
|
5208
|
+
closeTimer = null;
|
|
5209
|
+
/** Move keyboard focus to this item's control. */
|
|
5210
|
+
focus() {
|
|
5211
|
+
this.button().nativeElement.focus();
|
|
5212
|
+
}
|
|
5213
|
+
/** Whether `node` lives inside this item's control (used by ds-menu to find
|
|
5214
|
+
* the currently focused item during keyboard nav). */
|
|
5215
|
+
contains(node) {
|
|
5216
|
+
return !!node && this.button().nativeElement.contains(node);
|
|
5217
|
+
}
|
|
5218
|
+
/** Visible label text — used by ds-menu's type-ahead. */
|
|
5219
|
+
label() {
|
|
5220
|
+
return this.button().nativeElement.textContent?.trim() ?? '';
|
|
5221
|
+
}
|
|
5222
|
+
hasSubmenu() {
|
|
5223
|
+
return this.submenu() !== null;
|
|
5224
|
+
}
|
|
5225
|
+
onClick(event) {
|
|
5226
|
+
if (this.disabled()) {
|
|
5227
|
+
return;
|
|
5228
|
+
}
|
|
5229
|
+
if (this.hasSubmenu()) {
|
|
5230
|
+
this.openSubmenu();
|
|
5231
|
+
return;
|
|
5232
|
+
}
|
|
5233
|
+
this.pressed.emit(event);
|
|
5234
|
+
this.closeRef?.close();
|
|
5235
|
+
}
|
|
5236
|
+
onKeydown(event) {
|
|
5237
|
+
if (this.disabled() || !this.hasSubmenu()) {
|
|
5238
|
+
return;
|
|
5239
|
+
}
|
|
5240
|
+
if (event.key === 'ArrowRight') {
|
|
5241
|
+
event.preventDefault();
|
|
5242
|
+
event.stopPropagation();
|
|
5243
|
+
this.openSubmenu();
|
|
5244
|
+
}
|
|
5245
|
+
}
|
|
5246
|
+
onMouseEnter() {
|
|
5247
|
+
if (!this.hasSubmenu() || this.disabled()) {
|
|
5248
|
+
return;
|
|
5249
|
+
}
|
|
5250
|
+
this.clearCloseTimer();
|
|
5251
|
+
this.openTimer = setTimeout(() => this.openSubmenu(), 120);
|
|
5252
|
+
}
|
|
5253
|
+
onMouseLeave(event) {
|
|
5254
|
+
if (!this.hasSubmenu()) {
|
|
5255
|
+
return;
|
|
5256
|
+
}
|
|
5257
|
+
this.clearOpenTimer();
|
|
5258
|
+
// Delay close so moving into the submenu panel doesn't close it immediately.
|
|
5259
|
+
this.closeTimer = setTimeout(() => {
|
|
5260
|
+
// If focus/mouse is now inside the submenu panel, keep it open.
|
|
5261
|
+
const submenuElement = this.submenuRef?.overlayElement;
|
|
5262
|
+
if (submenuElement &&
|
|
5263
|
+
submenuElement.contains(event.relatedTarget)) {
|
|
5264
|
+
return;
|
|
5265
|
+
}
|
|
5266
|
+
this.closeSubmenu();
|
|
5267
|
+
}, 150);
|
|
4760
5268
|
}
|
|
4761
5269
|
openSubmenu() {
|
|
4762
5270
|
if (this.disabled() || this.submenuRef || !this.submenu()) {
|
|
@@ -5033,9 +5541,8 @@ const VIRTUAL_FALLBACK_HEIGHT = 720;
|
|
|
5033
5541
|
// Rows kept rendered past each edge of the viewport, so a flick does not expose
|
|
5034
5542
|
// blank space before the next range lands.
|
|
5035
5543
|
const VIRTUAL_OVERSCAN = 6;
|
|
5036
|
-
/** Rendered values that read as "no data", matched case-insensitively.
|
|
5037
|
-
*
|
|
5038
|
-
* are the ones a consumer had to enumerate before `sortValue` existed. */
|
|
5544
|
+
/** Rendered values that read as "no data", matched case-insensitively. Wider
|
|
5545
|
+
* than the empty string because consumers render placeholders. */
|
|
5039
5546
|
const BLANK_CELL = new Set(['', '—', '-', '–', 'n/a', 'never', 'none']);
|
|
5040
5547
|
/** Normalises "no data" to a single `null`, so the comparator has one blank
|
|
5041
5548
|
* case to test and TypeScript narrows the rest without a cast. */
|
|
@@ -5064,9 +5571,8 @@ function compareSortValues(first, second) {
|
|
|
5064
5571
|
return Number(firstText) - Number(secondText);
|
|
5065
5572
|
}
|
|
5066
5573
|
// `sensitivity: 'base'` so "Ångström" sorts next to "Angstrom" and casing does
|
|
5067
|
-
// not split a column into two runs
|
|
5068
|
-
//
|
|
5069
|
-
// strings reorders when an app moves off its own comparator onto this one.
|
|
5574
|
+
// not split a column into two runs — without it a string `sortValue` column
|
|
5575
|
+
// reorders when an app moves off its own comparator onto this one.
|
|
5070
5576
|
return firstText.localeCompare(secondText, undefined, {
|
|
5071
5577
|
numeric: true,
|
|
5072
5578
|
sensitivity: 'base',
|
|
@@ -5338,6 +5844,23 @@ class TableComponent {
|
|
|
5338
5844
|
expandableRows = input(false, { ...(ngDevMode ? { debugName: "expandableRows" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
5339
5845
|
/** Two-way set of currently expanded row ids. */
|
|
5340
5846
|
expandedIds = model(new Set(), ...(ngDevMode ? [{ debugName: "expandedIds" }] : /* istanbul ignore next */ []));
|
|
5847
|
+
/** `'single'` collapses the open row when another expander is clicked.
|
|
5848
|
+
* Enforced on interaction only: a set seeded with several ids is left alone
|
|
5849
|
+
* (and warned about in dev) rather than silently rewritten under the host. */
|
|
5850
|
+
expandMode = input('multiple', ...(ngDevMode ? [{ debugName: "expandMode" }] : /* istanbul ignore next */ []));
|
|
5851
|
+
/** Renders an expand-all/collapse-all chevron in the expander column header,
|
|
5852
|
+
* page-scoped when paginating, like select-all. Suppressed under
|
|
5853
|
+
* `expandMode="single"`, which it would contradict. */
|
|
5854
|
+
expandAllToggle = input(false, { ...(ngDevMode ? { debugName: "expandAllToggle" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
5855
|
+
/** Fires with the row when an expander opens it — including each row opened
|
|
5856
|
+
* by expand-all, so a host lazy-loading panel content sees every one. */
|
|
5857
|
+
rowExpanded = output();
|
|
5858
|
+
/** Fires with the row when an expander closes it, the row auto-closed by
|
|
5859
|
+
* `expandMode="single"` included. It carries a row, so it cannot speak for an
|
|
5860
|
+
* id whose row is no longer in `data()` — under server-side paging that id is
|
|
5861
|
+
* cleared silently. `expandedIds` is the complete signal; this one is the
|
|
5862
|
+
* convenient one. */
|
|
5863
|
+
rowCollapsed = output();
|
|
5341
5864
|
/** Template rendered inside an expanded row's panel.
|
|
5342
5865
|
* Context: `$implicit` = row, `row` = row. */
|
|
5343
5866
|
rowExpandTemplate = input(null, ...(ngDevMode ? [{ debugName: "rowExpandTemplate" }] : /* istanbul ignore next */ []));
|
|
@@ -5354,9 +5877,6 @@ class TableComponent {
|
|
|
5354
5877
|
}
|
|
5355
5878
|
tableClasses = computed(() => {
|
|
5356
5879
|
const parts = ['table'];
|
|
5357
|
-
if (this.loadingMode() === 'skeleton') {
|
|
5358
|
-
parts.push('skeleton-mode');
|
|
5359
|
-
}
|
|
5360
5880
|
if (this.stickyHeader()) {
|
|
5361
5881
|
parts.push('sticky-header');
|
|
5362
5882
|
}
|
|
@@ -5580,6 +6100,7 @@ class TableComponent {
|
|
|
5580
6100
|
this.columnFilters.set(next);
|
|
5581
6101
|
}
|
|
5582
6102
|
injector = inject(Injector);
|
|
6103
|
+
destroyRef = inject(DestroyRef);
|
|
5583
6104
|
editInput = viewChild('editInput', ...(ngDevMode ? [{ debugName: "editInput" }] : /* istanbul ignore next */ []));
|
|
5584
6105
|
editingCell = signal(null, ...(ngDevMode ? [{ debugName: "editingCell" }] : /* istanbul ignore next */ []));
|
|
5585
6106
|
editDraft = signal('', ...(ngDevMode ? [{ debugName: "editDraft" }] : /* istanbul ignore next */ []));
|
|
@@ -5696,7 +6217,7 @@ class TableComponent {
|
|
|
5696
6217
|
if (!this.resizeState) {
|
|
5697
6218
|
return;
|
|
5698
6219
|
}
|
|
5699
|
-
const width =
|
|
6220
|
+
const width = this.clampColumnWidth(this.resizeState.startWidth + (event.clientX - this.resizeState.startX));
|
|
5700
6221
|
const next = new Map(this.columnWidths());
|
|
5701
6222
|
next.set(this.resizeState.key, Math.round(width));
|
|
5702
6223
|
this.columnWidths.set(next);
|
|
@@ -5704,9 +6225,57 @@ class TableComponent {
|
|
|
5704
6225
|
onResizeEnd() {
|
|
5705
6226
|
this.resizeState = null;
|
|
5706
6227
|
}
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
*
|
|
6228
|
+
resizeFocus = signal(null, ...(ngDevMode ? [{ debugName: "resizeFocus" }] : /* istanbul ignore next */ []));
|
|
6229
|
+
/**
|
|
6230
|
+
* The widest a single column may be dragged: the scroll viewport.
|
|
6231
|
+
*
|
|
6232
|
+
* A column wider than the viewport can never be seen whole, and long text has
|
|
6233
|
+
* its own affordance here — `truncate` clips it and the clip popover shows the
|
|
6234
|
+
* rest — so nothing is lost by stopping at the edge. The ceiling exists at all
|
|
6235
|
+
* because `aria-valuemax` has to be TRUE: a focusable `role="separator"` is a
|
|
6236
|
+
* range widget, and announcing a bound that neither resize path applies is
|
|
6237
|
+
* worse than announcing none.
|
|
6238
|
+
*/
|
|
6239
|
+
columnWidthCeiling() {
|
|
6240
|
+
return Math.max(TableComponent.MIN_COLUMN_WIDTH, this.scrollWrap().nativeElement.clientWidth);
|
|
6241
|
+
}
|
|
6242
|
+
clampColumnWidth(width) {
|
|
6243
|
+
return Math.min(this.columnWidthCeiling(), Math.max(TableComponent.MIN_COLUMN_WIDTH, width));
|
|
6244
|
+
}
|
|
6245
|
+
onResizeFocus(col, event) {
|
|
6246
|
+
const target = event.target;
|
|
6247
|
+
this.resizeFocus.set({
|
|
6248
|
+
key: col.key,
|
|
6249
|
+
measured: this.resolvedColumnWidth(col, target),
|
|
6250
|
+
max: this.columnWidthCeiling(),
|
|
6251
|
+
});
|
|
6252
|
+
}
|
|
6253
|
+
onResizeBlur() {
|
|
6254
|
+
this.resizeFocus.set(null);
|
|
6255
|
+
}
|
|
6256
|
+
/**
|
|
6257
|
+
* The separator's range, and only while it holds focus — that is when a range
|
|
6258
|
+
* widget is announced, and an auto-sized column has no width to report until
|
|
6259
|
+
* something measures one. Measuring on every change detection to fill an
|
|
6260
|
+
* attribute nothing is reading would force layout once per resizable column.
|
|
6261
|
+
*
|
|
6262
|
+
* `now` prefers `columnWidth`, which the first arrow key makes known and keeps
|
|
6263
|
+
* live; the focus measurement only covers the moment before that.
|
|
6264
|
+
*/
|
|
6265
|
+
resizeRange(col) {
|
|
6266
|
+
const focused = this.resizeFocus();
|
|
6267
|
+
if (focused?.key !== col.key) {
|
|
6268
|
+
return null;
|
|
6269
|
+
}
|
|
6270
|
+
return {
|
|
6271
|
+
now: this.columnWidth(col) ?? focused.measured,
|
|
6272
|
+
min: TableComponent.MIN_COLUMN_WIDTH,
|
|
6273
|
+
max: focused.max,
|
|
6274
|
+
};
|
|
6275
|
+
}
|
|
6276
|
+
/** Current rendered width for the keyboard resize path. Falls back to the DOM
|
|
6277
|
+
* when the column was auto-sized and has neither an override nor a declared
|
|
6278
|
+
* width. */
|
|
5710
6279
|
resolvedColumnWidth(col, from) {
|
|
5711
6280
|
const known = this.columnWidth(col);
|
|
5712
6281
|
if (known !== null) {
|
|
@@ -5722,41 +6291,56 @@ class TableComponent {
|
|
|
5722
6291
|
*/
|
|
5723
6292
|
onResizeKey(col, event) {
|
|
5724
6293
|
const target = event.target;
|
|
5725
|
-
const
|
|
6294
|
+
const step = TableComponent.RESIZE_STEP;
|
|
6295
|
+
const page = TableComponent.RESIZE_PAGE;
|
|
6296
|
+
const delta = event.key === 'ArrowLeft'
|
|
6297
|
+
? -step
|
|
6298
|
+
: event.key === 'ArrowRight'
|
|
6299
|
+
? step
|
|
6300
|
+
: event.key === 'PageDown'
|
|
6301
|
+
? -page
|
|
6302
|
+
: event.key === 'PageUp'
|
|
6303
|
+
? page
|
|
6304
|
+
: event.key === 'Home'
|
|
6305
|
+
? 'auto'
|
|
6306
|
+
: null;
|
|
6307
|
+
if (delta === null) {
|
|
6308
|
+
return;
|
|
6309
|
+
}
|
|
6310
|
+
event.preventDefault();
|
|
6311
|
+
this.stepColumnWidth(col, delta, target.closest('th'));
|
|
6312
|
+
}
|
|
6313
|
+
/**
|
|
6314
|
+
* One column-width step, from wherever it was asked for: the handle's own
|
|
6315
|
+
* keyboard, or the width controls in the column panel.
|
|
6316
|
+
*
|
|
6317
|
+
* `'auto'` hands the column back to automatic sizing. The header cell is
|
|
6318
|
+
* passed when the caller has it — the panel does not, so it is looked up by
|
|
6319
|
+
* `data-col-key`, and the measurement matters: stepping an auto-sized column
|
|
6320
|
+
* has to start from what it currently RENDERS, not from the minimum.
|
|
6321
|
+
*/
|
|
6322
|
+
stepColumnWidth(col, delta, from) {
|
|
6323
|
+
const header = from ?? this.headerCellFor(col);
|
|
5726
6324
|
if (header) {
|
|
5727
6325
|
this.lockMeasuredWidths(header);
|
|
5728
6326
|
}
|
|
5729
|
-
const current = this.resolvedColumnWidth(col, target);
|
|
5730
|
-
let next = current;
|
|
5731
|
-
switch (event.key) {
|
|
5732
|
-
case 'ArrowLeft':
|
|
5733
|
-
next = current - TableComponent.RESIZE_STEP;
|
|
5734
|
-
break;
|
|
5735
|
-
case 'ArrowRight':
|
|
5736
|
-
next = current + TableComponent.RESIZE_STEP;
|
|
5737
|
-
break;
|
|
5738
|
-
case 'PageDown':
|
|
5739
|
-
next = current - TableComponent.RESIZE_PAGE;
|
|
5740
|
-
break;
|
|
5741
|
-
case 'PageUp':
|
|
5742
|
-
next = current + TableComponent.RESIZE_PAGE;
|
|
5743
|
-
break;
|
|
5744
|
-
case 'Home':
|
|
5745
|
-
next = null;
|
|
5746
|
-
break;
|
|
5747
|
-
default:
|
|
5748
|
-
return;
|
|
5749
|
-
}
|
|
5750
|
-
event.preventDefault();
|
|
5751
6327
|
const widths = new Map(this.columnWidths());
|
|
5752
|
-
if (
|
|
6328
|
+
if (delta === 'auto') {
|
|
5753
6329
|
widths.delete(col.key);
|
|
5754
6330
|
}
|
|
5755
6331
|
else {
|
|
5756
|
-
|
|
6332
|
+
const current = this.resolvedColumnWidth(col, header ?? undefined);
|
|
6333
|
+
widths.set(col.key, this.clampColumnWidth(Math.round(current + delta)));
|
|
5757
6334
|
}
|
|
5758
6335
|
this.columnWidths.set(widths);
|
|
5759
6336
|
}
|
|
6337
|
+
headerCellFor(col) {
|
|
6338
|
+
return this.scrollWrap().nativeElement.querySelector(`th[data-col-key="${CSS.escape(col.key)}"]`);
|
|
6339
|
+
}
|
|
6340
|
+
onColumnWidthStep(col, delta) {
|
|
6341
|
+
this.stepColumnWidth(col, delta, null);
|
|
6342
|
+
}
|
|
6343
|
+
resizeStep = TableComponent.RESIZE_STEP;
|
|
5760
6344
|
/** Client-side filter over the full data set — combines the `filterQuery`
|
|
5761
6345
|
* substring search with any per-column set filters. Sorting and pagination
|
|
5762
6346
|
* run on the filtered rows. */
|
|
@@ -5830,7 +6414,8 @@ class TableComponent {
|
|
|
5830
6414
|
const start = (this.page() - 1) * size;
|
|
5831
6415
|
return this.sortedData().slice(start, start + size);
|
|
5832
6416
|
}, ...(ngDevMode ? [{ debugName: "pagedData" }] : /* istanbul ignore next */ []));
|
|
5833
|
-
/**
|
|
6417
|
+
/** The full display set — paged when paginating, else sorted/raw data.
|
|
6418
|
+
* Virtual mode windows this further; `rowSlots` is what the loop walks. */
|
|
5834
6419
|
displayData = computed(() => this.pageSize() !== null ? this.pagedData() : this.sortedData(), ...(ngDevMode ? [{ debugName: "displayData" }] : /* istanbul ignore next */ []));
|
|
5835
6420
|
/**
|
|
5836
6421
|
* The single live-region line. Loading wins while it lasts — a sort
|
|
@@ -5850,9 +6435,23 @@ class TableComponent {
|
|
|
5850
6435
|
if (exportState) {
|
|
5851
6436
|
return exportState;
|
|
5852
6437
|
}
|
|
5853
|
-
const parts = [
|
|
6438
|
+
const parts = [
|
|
6439
|
+
this.sortMessage(),
|
|
6440
|
+
this.rangeMessage(),
|
|
6441
|
+
this.expansionMessage(),
|
|
6442
|
+
].filter(Boolean);
|
|
5854
6443
|
return parts.join('. ');
|
|
5855
6444
|
}, ...(ngDevMode ? [{ debugName: "statusMessage" }] : /* istanbul ignore next */ []));
|
|
6445
|
+
/** Only from two rows up: a single expander announces itself through its own
|
|
6446
|
+
* `aria-expanded`, and repeating that here would say everything twice. */
|
|
6447
|
+
expansionMessage = computed(() => {
|
|
6448
|
+
const open = this.expandedIds();
|
|
6449
|
+
if (open.size < 2) {
|
|
6450
|
+
return '';
|
|
6451
|
+
}
|
|
6452
|
+
const onPage = this.displayData().filter((row) => open.has(this.rowKey(row))).length;
|
|
6453
|
+
return onPage < 2 ? '' : `${onPage} rows expanded`;
|
|
6454
|
+
}, ...(ngDevMode ? [{ debugName: "expansionMessage" }] : /* istanbul ignore next */ []));
|
|
5856
6455
|
sortMessage = computed(() => {
|
|
5857
6456
|
const key = this.activeSortKey();
|
|
5858
6457
|
const dir = this.activeSortDir();
|
|
@@ -5904,12 +6503,6 @@ class TableComponent {
|
|
|
5904
6503
|
padBottom: Math.max(0, count - end) * rowSize,
|
|
5905
6504
|
};
|
|
5906
6505
|
}, ...(ngDevMode ? [{ debugName: "virtualWindow" }] : /* istanbul ignore next */ []));
|
|
5907
|
-
/** The rows the template actually renders. */
|
|
5908
|
-
windowData = computed(() => {
|
|
5909
|
-
const window = this.virtualWindow();
|
|
5910
|
-
const data = this.displayData();
|
|
5911
|
-
return window ? data.slice(window.start, window.end) : data;
|
|
5912
|
-
}, ...(ngDevMode ? [{ debugName: "windowData" }] : /* istanbul ignore next */ []));
|
|
5913
6506
|
/**
|
|
5914
6507
|
* What the row loop walks: each slot carries its ABSOLUTE index, and a `null`
|
|
5915
6508
|
* row is a gap the host has not filled yet.
|
|
@@ -5953,8 +6546,24 @@ class TableComponent {
|
|
|
5953
6546
|
selectAllLabel = computed(() => this.pageSize() !== null
|
|
5954
6547
|
? 'Select all rows on this page'
|
|
5955
6548
|
: 'Select all rows', ...(ngDevMode ? [{ debugName: "selectAllLabel" }] : /* istanbul ignore next */ []));
|
|
6549
|
+
allExpanded = computed(() => {
|
|
6550
|
+
const data = this.displayData();
|
|
6551
|
+
if (data.length === 0) {
|
|
6552
|
+
return false;
|
|
6553
|
+
}
|
|
6554
|
+
const open = this.expandedIds();
|
|
6555
|
+
return data.every((row) => open.has(this.rowKey(row)));
|
|
6556
|
+
}, ...(ngDevMode ? [{ debugName: "allExpanded" }] : /* istanbul ignore next */ []));
|
|
6557
|
+
expandAllVisible = computed(() => this.expandAllToggle() && this.expandMode() !== 'single', ...(ngDevMode ? [{ debugName: "expandAllVisible" }] : /* istanbul ignore next */ []));
|
|
6558
|
+
expandAllLabel = computed(() => {
|
|
6559
|
+
const scope = this.pageSize() !== null ? ' on this page' : '';
|
|
6560
|
+
return this.allExpanded()
|
|
6561
|
+
? `Collapse all rows${scope}`
|
|
6562
|
+
: `Expand all rows${scope}`;
|
|
6563
|
+
}, ...(ngDevMode ? [{ debugName: "expandAllLabel" }] : /* istanbul ignore next */ []));
|
|
5956
6564
|
skeletonArray = computed(() => Array(this.skeletonRows()).fill(0), ...(ngDevMode ? [{ debugName: "skeletonArray" }] : /* istanbul ignore next */ []));
|
|
5957
|
-
/**
|
|
6565
|
+
/** Colspan of a full-width row (expansion panel, empty state): data cols +
|
|
6566
|
+
* optional select/expand/actions cols. */
|
|
5958
6567
|
expandedColspan = computed(() => {
|
|
5959
6568
|
let count = this.visibleColumns().length;
|
|
5960
6569
|
if (this.selectable()) {
|
|
@@ -5973,8 +6582,19 @@ class TableComponent {
|
|
|
5973
6582
|
menuRow = signal(null, ...(ngDevMode ? [{ debugName: "menuRow" }] : /* istanbul ignore next */ []));
|
|
5974
6583
|
rowMenuPopover = viewChild('rowMenuPopover', ...(ngDevMode ? [{ debugName: "rowMenuPopover" }] : /* istanbul ignore next */ []));
|
|
5975
6584
|
columnPickerPopover = viewChild('columnPickerPopover', ...(ngDevMode ? [{ debugName: "columnPickerPopover" }] : /* istanbul ignore next */ []));
|
|
5976
|
-
|
|
6585
|
+
columnSheetOpen = signal(false, ...(ngDevMode ? [{ debugName: "columnSheetOpen" }] : /* istanbul ignore next */ []));
|
|
6586
|
+
coarsePointerState = signal(false, ...(ngDevMode ? [{ debugName: "coarsePointerState" }] : /* istanbul ignore next */ []));
|
|
6587
|
+
/** Whether the column panel opens as a sheet and the drag handle stands down.
|
|
6588
|
+
* Keyed on the pointer, not the viewport — see `_table.scss`'s matching query. */
|
|
6589
|
+
coarsePointer = this.coarsePointerState.asReadonly();
|
|
6590
|
+
columnPickerOpened = computed(() => this.coarsePointer()
|
|
6591
|
+
? this.columnSheetOpen()
|
|
6592
|
+
: (this.columnPickerPopover()?.opened() ?? false), ...(ngDevMode ? [{ debugName: "columnPickerOpened" }] : /* istanbul ignore next */ []));
|
|
5977
6593
|
onColumnPickerClick(event) {
|
|
6594
|
+
if (this.coarsePointer()) {
|
|
6595
|
+
this.columnSheetOpen.set(true);
|
|
6596
|
+
return;
|
|
6597
|
+
}
|
|
5978
6598
|
this.columnPickerPopover()?.toggle(event.currentTarget);
|
|
5979
6599
|
}
|
|
5980
6600
|
hasTruncate = computed(() => this.columns().some((col) => col.truncate), ...(ngDevMode ? [{ debugName: "hasTruncate" }] : /* istanbul ignore next */ []));
|
|
@@ -6021,9 +6641,9 @@ class TableComponent {
|
|
|
6021
6641
|
hscrollNeeded = signal(false, ...(ngDevMode ? [{ debugName: "hscrollNeeded" }] : /* istanbul ignore next */ []));
|
|
6022
6642
|
scrollTop = signal(0, ...(ngDevMode ? [{ debugName: "scrollTop" }] : /* istanbul ignore next */ []));
|
|
6023
6643
|
viewportHeight = signal(0, ...(ngDevMode ? [{ debugName: "viewportHeight" }] : /* istanbul ignore next */ []));
|
|
6024
|
-
// Range last handed to (lazyLoad), so an unanswered request is not re-sent.
|
|
6025
6644
|
lastLazyRequest = null;
|
|
6026
6645
|
constructor() {
|
|
6646
|
+
this.watchPointer();
|
|
6027
6647
|
// One effect for both halves, because the restore CANNOT run in the
|
|
6028
6648
|
// constructor: input signals are not set yet there, so storageKey() is still
|
|
6029
6649
|
// '' and the restore silently no-ops. The first run with a usable key
|
|
@@ -6047,18 +6667,20 @@ class TableComponent {
|
|
|
6047
6667
|
// most of them. A table holding ALL its rows is the exception, and `total`
|
|
6048
6668
|
// unbound is how it says so — so that is where the reminder goes. Only when
|
|
6049
6669
|
// the mode was never DECLARED.
|
|
6050
|
-
|
|
6051
|
-
this.
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
this.
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6670
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
6671
|
+
devWarn(() => this.sortMode() === null &&
|
|
6672
|
+
this.total() === null &&
|
|
6673
|
+
this.columns().some((col) => col.sortable)
|
|
6674
|
+
? '[ds-table] sortable columns default to sortMode="server", so a header click only emits (sortChange) and the table reorders nothing itself. This table binds no `total`, which usually means it holds every row — declare sortMode="client" to sort them in place.'
|
|
6675
|
+
: null);
|
|
6676
|
+
// Same trap one column over: a header filter defaults to the server too, so
|
|
6677
|
+
// the checklist tracks a selection and runs no local pass.
|
|
6678
|
+
devWarn(() => this.filterMode() === null &&
|
|
6679
|
+
this.total() === null &&
|
|
6680
|
+
this.columns().some((col) => col.filter === 'set')
|
|
6681
|
+
? '[ds-table] a header filter defaults to filterMode="server", so ticking a value only updates `columnFilters` and filters nothing locally. This table binds no `total`, which usually means it holds every row — declare filterMode="client" to filter them in place.'
|
|
6682
|
+
: null);
|
|
6683
|
+
}
|
|
6062
6684
|
// Virtual mode's two measurements. Only wired while virtualizing, so a
|
|
6063
6685
|
// normal table pays for neither the scroll listener nor the observer.
|
|
6064
6686
|
effect((onCleanup) => {
|
|
@@ -6104,24 +6726,35 @@ class TableComponent {
|
|
|
6104
6726
|
this.lastLazyRequest = { first, rows };
|
|
6105
6727
|
this.lazyLoad.emit({ first, rows });
|
|
6106
6728
|
});
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6729
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
6730
|
+
devWarn(() => this.lazy() && !this.virtualScroll()
|
|
6731
|
+
? '[ds-table] lazy needs virtualScroll: without a window there is no range to fetch, so every gap in `data` renders a skeleton row and (lazyLoad) never narrows. Set virtualScroll (and maxHeight), or hand the table its rows outright.'
|
|
6732
|
+
: null);
|
|
6733
|
+
devWarn(() => this.lazy() && this.total() === null
|
|
6734
|
+
? '[ds-table] lazy needs `total`: the scroller is sized from the rows that EXIST, and without it the spacers collapse to the slice that has arrived — the scrollbar then lies about the length of the list.'
|
|
6735
|
+
: null);
|
|
6736
|
+
devWarn(() => this.lazy() && this.sortMode() === 'client'
|
|
6737
|
+
? '[ds-table] lazy with sortMode="client" sorts only the rows that happen to have arrived, which is a different order every time a window loads. The server owns the order here — drop sortMode or declare "server".'
|
|
6738
|
+
: null);
|
|
6739
|
+
devWarn(() => this.virtualScroll() && !this.maxHeight()
|
|
6740
|
+
? '[ds-table] virtualScroll needs maxHeight — without a bounded scroller there is no viewport to window against, so every row renders and nothing is virtualized. Set maxHeight (e.g. "480px").'
|
|
6741
|
+
: null);
|
|
6742
|
+
devWarn(() => this.virtualScroll() && this.expandableRows()
|
|
6743
|
+
? '[ds-table] virtualScroll and expandableRows do not combine: an expanded row is taller than virtualRowSize, and every offset after it would be wrong. The expander renders but the panel is suppressed — move the detail into a modal or a drawer, or drop virtualScroll.'
|
|
6744
|
+
: null);
|
|
6745
|
+
devWarn(() => this.expandAllToggle() && this.expandMode() === 'single'
|
|
6746
|
+
? '[ds-table] expandAllToggle contradicts expandMode="single" — expanding every row is the one thing single mode exists to prevent. The header toggle is suppressed; drop one of the two.'
|
|
6747
|
+
: null);
|
|
6748
|
+
devWarn(() => this.expandAllToggle() && !this.expandableRows()
|
|
6749
|
+
? '[ds-table] expandAllToggle needs expandableRows — without it there is no expander column to put the toggle in, so it renders nothing. Set expandableRows.'
|
|
6750
|
+
: null);
|
|
6751
|
+
devWarn(() => this.expandMode() === 'single' && this.expandedIds().size > 1
|
|
6752
|
+
? '[ds-table] expandMode="single" was given expandedIds holding several rows. A two-way model is the host\'s to write, so it is left as passed rather than rewritten — the next expander click collapses back to one.'
|
|
6753
|
+
: null);
|
|
6754
|
+
devWarn(() => this.virtualScroll() && this.pageSize() !== null
|
|
6755
|
+
? '[ds-table] virtualScroll with pageSize paginates a window of a page. Virtual scrolling is what pagination was for on a long list — pick one.'
|
|
6756
|
+
: null);
|
|
6757
|
+
}
|
|
6125
6758
|
// Wire the proxy whenever it exists (stickyScrollbar on). Assigning an
|
|
6126
6759
|
// equal scrollLeft fires no scroll event, so the two mirrors can't loop.
|
|
6127
6760
|
effect((onCleanup) => {
|
|
@@ -6294,14 +6927,51 @@ class TableComponent {
|
|
|
6294
6927
|
}
|
|
6295
6928
|
onToggleExpand(row, event) {
|
|
6296
6929
|
event.stopPropagation();
|
|
6297
|
-
const
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6930
|
+
const key = this.rowKey(row);
|
|
6931
|
+
const open = this.expandedIds();
|
|
6932
|
+
if (open.has(key)) {
|
|
6933
|
+
const next = new Set(open);
|
|
6934
|
+
next.delete(key);
|
|
6935
|
+
this.expandedIds.set(next);
|
|
6936
|
+
this.rowCollapsed.emit(row);
|
|
6937
|
+
return;
|
|
6938
|
+
}
|
|
6939
|
+
if (this.expandMode() === 'single') {
|
|
6940
|
+
// `data()` rather than `displayData()` so a row left open on another page
|
|
6941
|
+
// is reported too — but an event carries a row, so an id whose row is not
|
|
6942
|
+
// loaded at all is dropped without one. Documented on `rowCollapsed`.
|
|
6943
|
+
const closing = open.size > 0
|
|
6944
|
+
? this.data().filter((other) => open.has(this.rowKey(other)))
|
|
6945
|
+
: [];
|
|
6946
|
+
this.expandedIds.set(new Set([key]));
|
|
6947
|
+
closing.forEach((other) => this.rowCollapsed.emit(other));
|
|
6948
|
+
this.rowExpanded.emit(row);
|
|
6949
|
+
return;
|
|
6950
|
+
}
|
|
6951
|
+
const next = new Set(open);
|
|
6952
|
+
next.add(key);
|
|
6953
|
+
this.expandedIds.set(next);
|
|
6954
|
+
this.rowExpanded.emit(row);
|
|
6955
|
+
}
|
|
6956
|
+
onToggleExpandAll() {
|
|
6957
|
+
const rows = this.displayData();
|
|
6958
|
+
const open = this.expandedIds();
|
|
6959
|
+
const collapsing = this.allExpanded();
|
|
6960
|
+
const changed = rows.filter((row) => open.has(this.rowKey(row)) === collapsing);
|
|
6961
|
+
if (changed.length === 0) {
|
|
6962
|
+
return;
|
|
6303
6963
|
}
|
|
6964
|
+
const next = new Set(open);
|
|
6965
|
+
rows.forEach((row) => {
|
|
6966
|
+
if (collapsing) {
|
|
6967
|
+
next.delete(this.rowKey(row));
|
|
6968
|
+
}
|
|
6969
|
+
else {
|
|
6970
|
+
next.add(this.rowKey(row));
|
|
6971
|
+
}
|
|
6972
|
+
});
|
|
6304
6973
|
this.expandedIds.set(next);
|
|
6974
|
+
changed.forEach((row) => collapsing ? this.rowCollapsed.emit(row) : this.rowExpanded.emit(row));
|
|
6305
6975
|
}
|
|
6306
6976
|
isSelected(row) {
|
|
6307
6977
|
return this.selectedIds().has(this.rowKey(row));
|
|
@@ -6359,7 +7029,6 @@ class TableComponent {
|
|
|
6359
7029
|
const first = this.visibleColumns()[0];
|
|
6360
7030
|
return first ? this.cellValue(row, first) : '';
|
|
6361
7031
|
}
|
|
6362
|
-
/** `aria-sort` value for a header: only meaningful on sortable columns. */
|
|
6363
7032
|
/** Row identity — the `rowId` accessor when given, else `row.id`. Public so a
|
|
6364
7033
|
* host reading `selectedIds`/`expandedIds` can compute the same keys. */
|
|
6365
7034
|
rowKey(row) {
|
|
@@ -6373,6 +7042,7 @@ class TableComponent {
|
|
|
6373
7042
|
sortableCol(col) {
|
|
6374
7043
|
return !!col.sortable && this.sortModeResolved() !== 'none';
|
|
6375
7044
|
}
|
|
7045
|
+
/** `aria-sort` value for a header: only meaningful on sortable columns. */
|
|
6376
7046
|
ariaSort(col) {
|
|
6377
7047
|
if (!this.sortableCol(col)) {
|
|
6378
7048
|
return null;
|
|
@@ -6551,8 +7221,18 @@ class TableComponent {
|
|
|
6551
7221
|
const widths = ['45%', '55%', '65%', '75%', '85%'];
|
|
6552
7222
|
return widths[Math.abs(hash) % widths.length] ?? '70%';
|
|
6553
7223
|
}
|
|
7224
|
+
watchPointer() {
|
|
7225
|
+
if (typeof window === 'undefined' || !window.matchMedia) {
|
|
7226
|
+
return;
|
|
7227
|
+
}
|
|
7228
|
+
const coarse = window.matchMedia('(hover: none) and (pointer: coarse)');
|
|
7229
|
+
const sync = () => this.coarsePointerState.set(coarse.matches);
|
|
7230
|
+
sync();
|
|
7231
|
+
coarse.addEventListener('change', sync);
|
|
7232
|
+
this.destroyRef.onDestroy(() => coarse.removeEventListener('change', sync));
|
|
7233
|
+
}
|
|
6554
7234
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6555
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TableComponent, isStandalone: true, selector: "ds-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, rowId: { classPropertyName: "rowId", publicName: "rowId", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, stickyHeader: { classPropertyName: "stickyHeader", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, zebra: { classPropertyName: "zebra", publicName: "zebra", isSignal: true, isRequired: false, transformFunction: null }, animateHeight: { classPropertyName: "animateHeight", publicName: "animateHeight", isSignal: true, isRequired: false, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, sortKey: { classPropertyName: "sortKey", publicName: "sortKey", isSignal: true, isRequired: false, transformFunction: null }, sortDir: { classPropertyName: "sortDir", publicName: "sortDir", isSignal: true, isRequired: false, transformFunction: null }, sortingOrder: { classPropertyName: "sortingOrder", publicName: "sortingOrder", isSignal: true, isRequired: false, transformFunction: null }, sortAnnouncement: { classPropertyName: "sortAnnouncement", publicName: "sortAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, rangeAnnouncement: { classPropertyName: "rangeAnnouncement", publicName: "rangeAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, skeletonRows: { classPropertyName: "skeletonRows", publicName: "skeletonRows", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, rowInteractive: { classPropertyName: "rowInteractive", publicName: "rowInteractive", isSignal: true, isRequired: false, transformFunction: null }, activeRowId: { classPropertyName: "activeRowId", publicName: "activeRowId", isSignal: true, isRequired: false, transformFunction: null }, filterQuery: { classPropertyName: "filterQuery", publicName: "filterQuery", isSignal: true, isRequired: false, transformFunction: null }, columnFilters: { classPropertyName: "columnFilters", publicName: "columnFilters", isSignal: true, isRequired: false, transformFunction: null }, hiddenKeys: { classPropertyName: "hiddenKeys", publicName: "hiddenKeys", isSignal: true, isRequired: false, transformFunction: null }, resizableColumns: { classPropertyName: "resizableColumns", publicName: "resizableColumns", isSignal: true, isRequired: false, transformFunction: null }, columnWidths: { classPropertyName: "columnWidths", publicName: "columnWidths", isSignal: true, isRequired: false, transformFunction: null }, reorderableColumns: { classPropertyName: "reorderableColumns", publicName: "reorderableColumns", isSignal: true, isRequired: false, transformFunction: null }, columnOrder: { classPropertyName: "columnOrder", publicName: "columnOrder", isSignal: true, isRequired: false, transformFunction: null }, persistLayout: { classPropertyName: "persistLayout", publicName: "persistLayout", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, exportButton: { classPropertyName: "exportButton", publicName: "exportButton", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, exportFetcher: { classPropertyName: "exportFetcher", publicName: "exportFetcher", isSignal: true, isRequired: false, transformFunction: null }, stickyScrollbar: { classPropertyName: "stickyScrollbar", publicName: "stickyScrollbar", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, scrollToTopOnPageChange: { classPropertyName: "scrollToTopOnPageChange", publicName: "scrollToTopOnPageChange", isSignal: true, isRequired: false, transformFunction: null }, sortMode: { classPropertyName: "sortMode", publicName: "sortMode", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, columnFilterOptions: { classPropertyName: "columnFilterOptions", publicName: "columnFilterOptions", isSignal: true, isRequired: false, transformFunction: null }, stickyFirstColumn: { classPropertyName: "stickyFirstColumn", publicName: "stickyFirstColumn", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualRowSize: { classPropertyName: "virtualRowSize", publicName: "virtualRowSize", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, cellTemplateMap: { classPropertyName: "cellTemplateMap", publicName: "cellTemplateMap", isSignal: true, isRequired: false, transformFunction: null }, emptyTemplate: { classPropertyName: "emptyTemplate", publicName: "emptyTemplate", isSignal: true, isRequired: false, transformFunction: null }, expandableRows: { classPropertyName: "expandableRows", publicName: "expandableRows", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null }, rowExpandTemplate: { classPropertyName: "rowExpandTemplate", publicName: "rowExpandTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIds: "selectedIdsChange", sortKeyChange: "sortKeyChange", sortDirChange: "sortDirChange", columnFilters: "columnFiltersChange", hiddenKeys: "hiddenKeysChange", columnWidths: "columnWidthsChange", columnOrder: "columnOrderChange", exportFailed: "exportFailed", pageSize: "pageSizeChange", page: "pageChange", lazyLoad: "lazyLoad", rowClicked: "rowClicked", sortChange: "sortChange", rowActionSelected: "rowActionSelected", cellEdited: "cellEdited", expandedIds: "expandedIdsChange" }, host: { properties: { "class.bordered": "borderedResolved()", "class.selectable": "selectable()", "class.pinned": "stickyFirstColumn()", "class.expandable": "expandableRows()", "class.sticky-scrollbar": "stickyScrollbarResolved()", "class.resizable": "resizableColumns()" } }, queries: [{ propertyName: "cellTemplateDirectives", predicate: CellTemplateDirective, isSignal: true }, { propertyName: "headerFilters", predicate: HeaderFilterDirective, isSignal: true }], viewQueries: [{ propertyName: "columnFilterPopover", first: true, predicate: ["columnFilterPopover"], descendants: true, isSignal: true }, { propertyName: "editInput", first: true, predicate: ["editInput"], descendants: true, isSignal: true }, { propertyName: "rowMenuPopover", first: true, predicate: ["rowMenuPopover"], descendants: true, isSignal: true }, { propertyName: "columnPickerPopover", first: true, predicate: ["columnPickerPopover"], descendants: true, isSignal: true }, { propertyName: "cellTextPopover", first: true, predicate: ["cellTextPopover"], descendants: true, isSignal: true }, { propertyName: "scrollWrap", first: true, predicate: ["scrollWrap"], descendants: true, isSignal: true }, { propertyName: "hscrollProxy", first: true, predicate: ["hscrollProxy"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"table-toolbar\">\n <div class=\"toolbar-slot\">\n <ng-content select=\"[toolbar]\"></ng-content>\n </div>\n\n @if (exportButton()) {\n <ds-button\n color=\"neutral\"\n variant=\"outline\"\n size=\"sm\"\n [disabled]=\"exporting()\"\n (pressed)=\"runExport()\"\n >\n {{ exporting() ? 'Preparing\u2026' : 'Export CSV' }}\n </ds-button>\n }\n</div>\n\n<div\n #scrollWrap\n class=\"scroll-wrap\"\n [class.scroll-y]=\"maxHeight()\"\n [style.max-height]=\"maxHeight()\"\n>\n <div\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n >\n {{ statusMessage() }}\n </div>\n\n <ds-loading-overlay\n [loading]=\"isOverlayLoading()\"\n [blur]=\"true\"\n [insetTop]=\"'var(--ds-table-head-h, 40px)'\"\n >\n <table\n [class]=\"tableClasses()\"\n [style.--_table-virtual-row-h]=\"virtualRowHeight()\"\n [attr.role]=\"rowInteractive() ? 'grid' : null\"\n [attr.aria-busy]=\"loading() !== false ? 'true' : null\"\n >\n @if (caption()) {\n <caption class=\"visually-hidden\">\n {{\n caption()\n }}\n </caption>\n }\n\n <thead>\n <tr>\n @if (selectable()) {\n <th\n scope=\"col\"\n class=\"select-col pin-select\"\n >\n <input\n type=\"checkbox\"\n class=\"check\"\n [attr.aria-label]=\"selectAllLabel()\"\n [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (change)=\"onToggleAll($event)\"\n />\n </th>\n }\n\n @if (expandableRows()) {\n <th\n scope=\"col\"\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n </th>\n }\n\n @for (col of visibleColumns(); track col.key; let first = $first) {\n <th\n scope=\"col\"\n [class]=\"headerClasses(col)\"\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n [class.fit-content]=\"fitsContent(col)\"\n [style.width.px]=\"columnWidth(col)\"\n [style.min-width.px]=\"columnWidth(col)\"\n [style.max-width.px]=\"columnWidth(col)\"\n [attr.aria-sort]=\"ariaSort(col)\"\n [attr.data-col-key]=\"col.key\"\n (pointerenter)=\"onHeaderEnter($event, col)\"\n >\n @if (sortableCol(col)) {\n <button\n type=\"button\"\n class=\"th-label\"\n (click)=\"onSort(col)\"\n >\n @if (col.label) {\n {{ col.label }}\n } @else if (col.srLabel) {\n <span class=\"visually-hidden\">\n {{ col.srLabel }}\n </span>\n }\n\n <ds-icon\n class=\"sort-icon\"\n [name]=\"sortIcon(col)\"\n [size]=\"12\"\n >\n </ds-icon>\n </button>\n } @else {\n <span class=\"th-label\">\n @if (col.label) {\n {{ col.label }}\n } @else if (col.srLabel) {\n <span class=\"visually-hidden\">\n {{ col.srLabel }}\n </span>\n }\n </span>\n }\n\n @if (hasColumnFilter(col)) {\n <button\n type=\"button\"\n class=\"col-filter-btn\"\n aria-haspopup=\"dialog\"\n [class.active]=\"isColumnFiltered(col)\"\n [attr.aria-label]=\"'Filter ' + col.label\"\n (click)=\"onColumnFilterClick(col, $event)\"\n >\n <ds-icon\n name=\"filter\"\n [size]=\"12\"\n />\n </button>\n }\n\n @if (resizableColumns()) {\n <span\n class=\"col-resize\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + col.label\"\n [attr.aria-valuenow]=\"columnWidth(col)\"\n (pointerdown)=\"onResizeStart(col, $event)\"\n (pointermove)=\"onResizeMove($event)\"\n (pointerup)=\"onResizeEnd()\"\n (pointercancel)=\"onResizeEnd()\"\n (keydown)=\"onResizeKey(col, $event)\"\n >\n </span>\n }\n </th>\n }\n\n @if (hasUtilityColumn()) {\n <th\n scope=\"col\"\n class=\"actions-col\"\n >\n @if (hasColumnPicker()) {\n <button\n type=\"button\"\n class=\"col-picker-btn\"\n aria-haspopup=\"dialog\"\n aria-label=\"Choose columns\"\n [attr.aria-expanded]=\"columnPickerOpened()\"\n (click)=\"onColumnPickerClick($event)\"\n >\n <ds-icon\n name=\"grid\"\n [size]=\"14\"\n />\n </button>\n } @else {\n <span class=\"visually-hidden\">\n Actions\n </span>\n }\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @if (isSkeletonLoading()) {\n @for (_ of skeletonArray(); track $index; let rowIndex = $index) {\n <ng-container\n [ngTemplateOutlet]=\"skeletonRow\"\n [ngTemplateOutletContext]=\"{ $implicit: rowIndex }\"\n >\n </ng-container>\n }\n } @else if (showsEmptyRow()) {\n <tr>\n <td\n class=\"empty\"\n [attr.colspan]=\"expandedColspan()\"\n >\n @if (emptyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplate()!\">\n </ng-container>\n } @else {\n <ng-content select=\"[empty]\"></ng-content>\n }\n </td>\n </tr>\n } @else {\n @if (virtualWindow(); as window) {\n <tr\n class=\"spacer\"\n aria-hidden=\"true\"\n [style.height.px]=\"window.padTop\"\n >\n </tr>\n }\n\n @for (slot of rowSlots(); track slot.index) {\n @if (slot.row; as row) {\n <tr\n [class.selected]=\"isSelected(row)\"\n [class.expanded]=\"isExpanded(row)\"\n [class.clickable]=\"rowInteractive()\"\n [class.stripe]=\"isStriped(slot.index)\"\n [class.active]=\"rowKey(row) === activeRowId()\"\n [attr.aria-current]=\"\n rowKey(row) === activeRowId() ? 'true' : null\n \"\n [attr.tabindex]=\"rowInteractive() ? 0 : null\"\n [attr.aria-label]=\"rowInteractive() ? rowAriaLabel(row) : null\"\n (mousedown)=\"onRowMousedown()\"\n (click)=\"onRowClick(row, $event)\"\n (keydown.enter)=\"onRowKey(row, $event)\"\n (keydown.space)=\"onRowKey(row, $event)\"\n >\n @if (selectable()) {\n <td class=\"select-col pin-select\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [attr.aria-label]=\"'Select ' + rowAriaLabel(row)\"\n [checked]=\"isSelected(row)\"\n (change)=\"onToggleRow(row, $event)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n }\n\n @if (expandableRows()) {\n <td\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n <button\n type=\"button\"\n class=\"expand-btn\"\n [attr.aria-expanded]=\"isExpanded(row)\"\n [attr.aria-label]=\"\n isExpanded(row) ? 'Collapse row' : 'Expand row'\n \"\n (click)=\"onToggleExpand(row, $event)\"\n >\n <ds-icon\n class=\"expand-chev\"\n name=\"chevronRight\"\n [class.is-expanded]=\"isExpanded(row)\"\n [size]=\"16\"\n />\n </button>\n </td>\n }\n\n @for (\n col of visibleColumns();\n track col.key;\n let first = $first\n ) {\n <td\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n [class.editable-cell]=\"col.editable\"\n [class.interactive-cell]=\"col.interactive\"\n [class.fit-content]=\"fitsContent(col)\"\n (dblclick)=\"startEdit(row, col, $event)\"\n >\n @if (isEditing(row, col)) {\n <input\n #editInput\n type=\"text\"\n class=\"cell-edit\"\n [value]=\"editDraft()\"\n (input)=\"onEditInput($event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown.enter)=\"commitEdit(row, col)\"\n (keydown.escape)=\"cancelEdit()\"\n (blur)=\"commitEdit(row, col)\"\n />\n } @else if (cellTemplate(col); as tpl) {\n @if (col.truncate) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- same pointer-only enhancement as the plain truncate branch below; the value stays in the DOM for AT -->\n <span\n class=\"cell-clip\"\n [style.max-width.px]=\"clipWidth(col)\"\n [attr.title]=\"cellValue(row, col)\"\n (click)=\"onCellClipClick(row, col, $event)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row,\n row: row,\n }\"\n >\n </ng-container>\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row,\n row: row,\n }\"\n >\n </ng-container>\n }\n } @else if (col.truncate) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- pointer-only enhancement: the clip is visual (CSS ellipsis), keyboard/AT users already get the full DOM text + title; a tab stop per cell would wreck keyboard traversal -->\n <span\n class=\"cell-clip\"\n [style.max-width.px]=\"clipWidth(col)\"\n [attr.title]=\"cellValue(row, col)\"\n (click)=\"onCellClipClick(row, col, $event)\"\n >\n @if (cellLink(row, col); as target) {\n <a\n class=\"cell-link\"\n [routerLink]=\"target\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ cellValue(row, col) }}\n </a>\n } @else {\n {{ cellValue(row, col) }}\n }\n </span>\n } @else if (cellLink(row, col); as target) {\n <a\n class=\"cell-link\"\n [routerLink]=\"target\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ cellValue(row, col) }}\n </a>\n } @else {\n {{ cellValue(row, col) }}\n }\n </td>\n }\n\n @if (hasUtilityColumn()) {\n <td class=\"actions-col\">\n @if (hasRowActions() && hasActionsFor(row)) {\n <button\n type=\"button\"\n class=\"row-actions-btn\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"isMenuOpenFor(row)\"\n [attr.aria-label]=\"'Actions for ' + rowAriaLabel(row)\"\n (click)=\"onRowMenuClick(row, $event)\"\n (keydown.enter)=\"$event.stopPropagation()\"\n (keydown.space)=\"$event.stopPropagation()\"\n >\n <ds-icon\n name=\"moreV\"\n [size]=\"16\"\n />\n </button>\n }\n </td>\n }\n </tr>\n\n @if (\n expandableRows() &&\n isExpanded(row) &&\n rowExpandTemplate() &&\n !virtualizing()\n ) {\n <tr class=\"expand-panel-row\">\n <td\n class=\"expand-panel-cell\"\n [attr.colspan]=\"expandedColspan()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"rowExpandTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: row, row: row }\"\n >\n </ng-container>\n </td>\n </tr>\n }\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"skeletonRow\"\n [ngTemplateOutletContext]=\"{ $implicit: slot.index }\"\n >\n </ng-container>\n }\n }\n\n @if (virtualWindow(); as window) {\n <tr\n class=\"spacer\"\n aria-hidden=\"true\"\n [style.height.px]=\"window.padBottom\"\n >\n </tr>\n }\n }\n </tbody>\n </table>\n </ds-loading-overlay>\n</div>\n\n@if (stickyScrollbarResolved()) {\n <div\n #hscrollProxy\n class=\"hscroll-proxy\"\n aria-hidden=\"true\"\n [class.hscroll-hidden]=\"!hscrollNeeded()\"\n >\n <div\n class=\"hscroll-spacer\"\n [style.width.px]=\"hscrollContentWidth()\"\n >\n </div>\n </div>\n}\n\n@if (pageSize(); as size) {\n <div class=\"pagination-footer\">\n <ds-pagination\n [total]=\"total() ?? filteredData().length\"\n [pageSize]=\"size\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [showPageSize]=\"showPageSize()\"\n [showLabel]=\"showLabel()\"\n [(currentPage)]=\"page\"\n (pageSizeChange)=\"pageSize.set($event)\"\n />\n </div>\n}\n\n@if (hasTruncate()) {\n <ds-popover #cellTextPopover>\n <div class=\"cell-text-pop\">\n {{ cellPopoverText() }}\n </div>\n </ds-popover>\n}\n\n@if (filterColumn()) {\n <ds-popover\n #columnFilterPopover\n align=\"start\"\n panelRole=\"dialog\"\n panelLabel=\"Filter values\"\n >\n @if (headerFilterFor(filterColumn()!); as projected) {\n <div class=\"col-filter col-filter-custom\">\n <ng-container\n [ngTemplateOutlet]=\"projected.template\"\n [ngTemplateOutletContext]=\"headerFilterContext(filterColumn()!)\"\n />\n </div>\n } @else {\n <div class=\"col-filter\">\n <input\n type=\"text\"\n class=\"col-filter-search\"\n placeholder=\"Search\u2026\"\n [value]=\"filterSearch()\"\n (input)=\"onFilterSearch($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n\n <div class=\"col-filter-list\">\n @for (value of filterValues(); track value) {\n <label class=\"col-filter-option\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"isFilterValueChecked(value)\"\n (change)=\"toggleFilterValue(value)\"\n />\n {{ value || '(empty)' }}\n </label>\n } @empty {\n <div class=\"col-filter-empty\">\n No matches\n </div>\n }\n </div>\n\n <div class=\"col-filter-footer\">\n <span class=\"col-filter-count\">\n {{ filterSelectedCount() }} selected\n </span>\n\n <button\n type=\"button\"\n class=\"col-reset\"\n (click)=\"clearColumnFilter()\"\n >\n Clear\n </button>\n </div>\n </div>\n }\n </ds-popover>\n}\n\n@if (hasColumnPicker()) {\n <ds-popover\n #columnPickerPopover\n align=\"end\"\n panelRole=\"dialog\"\n panelLabel=\"Column visibility\"\n >\n <div\n class=\"col-picker\"\n cdkDropList\n (cdkDropListDropped)=\"onColumnDrop($event)\"\n >\n @for (\n col of orderedColumns();\n track col.key;\n let first = $first;\n let last = $last\n ) {\n <div\n class=\"col-picker-row\"\n cdkDrag\n [cdkDragDisabled]=\"!reorderableColumns()\"\n >\n @if (reorderableColumns()) {\n <span\n class=\"col-drag\"\n cdkDragHandle\n aria-hidden=\"true\"\n >\n <ds-icon\n name=\"drag\"\n [size]=\"14\"\n />\n </span>\n }\n\n <label class=\"col-picker-option\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"isColumnVisible(col)\"\n [disabled]=\"!col.hideable || isColumnLocked(col)\"\n (change)=\"toggleColumn(col)\"\n />\n {{ col.label }}\n </label>\n\n @if (reorderableColumns()) {\n <span class=\"col-move\">\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move up\"\n [disabled]=\"first\"\n (click)=\"moveColumn(col, -1)\"\n >\n <ds-icon\n name=\"chevronUp\"\n [size]=\"14\"\n />\n </button>\n\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move down\"\n [disabled]=\"last\"\n (click)=\"moveColumn(col, 1)\"\n >\n <ds-icon\n name=\"chevronDown\"\n [size]=\"14\"\n />\n </button>\n </span>\n }\n </div>\n }\n\n <button\n type=\"button\"\n class=\"col-reset\"\n (click)=\"resetColumns()\"\n >\n Reset to default\n </button>\n </div>\n </ds-popover>\n}\n\n@if (hasRowActions()) {\n <ds-popover\n #rowMenuPopover\n align=\"end\"\n >\n <ds-menu>\n @for (action of visibleRowActions(); track action.id) {\n <ds-menu-item\n [icon]=\"action.icon ?? null\"\n [error]=\"action.error ?? false\"\n [disabled]=\"isActionDisabled(action)\"\n [description]=\"actionReason(action)\"\n (pressed)=\"onRowAction(action)\"\n >\n {{ action.label }}\n </ds-menu-item>\n }\n </ds-menu>\n </ds-popover>\n}\n\n@if (selectable() && someSelected()) {\n <div class=\"bulk-bar\">\n <span class=\"count\">\n {{ selectedIds().size }} selected\n </span>\n\n <span class=\"sep\"></span>\n\n <ng-content select=\"[bulk-actions]\"></ng-content>\n </div>\n}\n\n<!-- One skeleton row, shared by loading=\"skeleton\" and the gaps a lazy\n window has not filled yet. `$implicit` is the row's index: skeletonWidth\n varies the bar lengths from it, so a block of them does not read as a grid. -->\n<ng-template\n #skeletonRow\n let-rowIndex\n>\n <tr>\n @if (selectable()) {\n <td class=\"select-col pin-select\">\n <ds-skeleton\n width=\"14px\"\n height=\"14px\"\n [inline]=\"true\"\n />\n </td>\n }\n\n @if (expandableRows()) {\n <td\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n </td>\n }\n\n @for (col of visibleColumns(); track col.key; let first = $first) {\n <td\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n >\n <ds-skeleton\n height=\"14px\"\n [width]=\"skeletonWidth(col, rowIndex)\"\n [inline]=\"true\"\n />\n </td>\n }\n\n @if (hasUtilityColumn()) {\n <td class=\"actions-col\"></td>\n }\n </tr>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:block;position:relative}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.bordered) .scroll-wrap{border:var(--border-width-default) solid var(--_table-border);border-radius:var(--_table-radius)}.scroll-wrap{--_table-border: var(--ds-table-border, var(--border-default));--_table-radius: var(--ds-table-radius, var(--ds-radius-control));--_table-bg-color: var(--ds-table-bg-color, var(--surface-default));width:100%;overflow:auto hidden;-webkit-overflow-scrolling:touch;background:var(--surface-default);box-sizing:border-box}.scroll-wrap.scroll-y{overflow-y:auto}:host(.sticky-scrollbar) .scroll-wrap{scrollbar-width:none}:host(.sticky-scrollbar) .scroll-wrap::-webkit-scrollbar{display:none}:host(.resizable) thead th{position:relative;overflow:hidden}.col-resize{position:absolute;inset-block:0;right:0;width:var(--space-2);cursor:col-resize;touch-action:none;-webkit-user-select:none;user-select:none}.col-resize:after{content:\"\";position:absolute;inset-block:var(--space-2);right:0;width:var(--border-width-default);background-color:transparent;transition:background-color var(--duration-fast) var(--ease-standard)}.col-resize:hover:after,.col-resize:active:after,.col-resize:focus-visible:after{background-color:var(--_table-sort-active-icon-color)}.col-resize:focus-visible{outline:none}.col-resize:focus-visible:after{width:var(--border-width-strong)}.hscroll-proxy{position:sticky;bottom:var(--ds-table-hscroll-bottom, 0);overflow:auto hidden}.hscroll-spacer{height:1px}.hscroll-hidden{display:none}.table{--_table-min-width: var(--ds-table-min-width, 0);--_table-bg-color: var(--ds-table-bg-color, var(--surface-default));--_table-row-hover-bg-color: var(--ds-table-row-hover-bg-color, var(--surface-secondary));--_table-row-selected-bg-color: var(--ds-table-row-selected-bg-color, var(--accent-subtitle));--_table-row-pressed-bg-color: var(--ds-table-row-pressed-bg-color, var(--surface-muted));--_table-row-active-bg-color: var(--ds-table-row-active-bg-color, var(--accent-subtitle));--_table-row-stripe-bg-color: var(--ds-table-row-stripe-bg-color, var(--surface-secondary));--_table-cell-link-color: var(--ds-table-cell-link-color, var(--accent));--_table-cell-link-decoration: var(--ds-table-cell-link-decoration, underline);--_table-head-text-color: var(--ds-table-head-text-color, var(--text-secondary));--_table-head-bg-color: var(--ds-table-head-bg-color, var(--surface-secondary));--_table-head-fs: var(--ds-table-head-fs, var(--font-size-xs));--_table-divider: var(--ds-table-divider, var(--border-divider));--_table-sort-active-icon-color: var(--ds-table-sort-active-icon-color, var(--accent));--_table-icon-btn-color: var(--ds-table-icon-btn-color, var(--icon-default));--_table-icon-btn-color-hover: var(--ds-table-icon-btn-color-hover, var(--icon-strong));--_table-icon-btn-focus-color: var(--ds-table-icon-btn-focus-color, var(--accent));--_table-cell-pad-x: var(--ds-table-cell-pad-x, var(--table-cell-pad-x));--_table-cell-pad-y: var(--ds-table-cell-pad-y, var(--table-cell-pad-y));--_table-cell-pad-top: var(--ds-table-cell-pad-top, var(--_table-cell-pad-y));--_table-cell-pad-right: var(--ds-table-cell-pad-right, var(--_table-cell-pad-x));--_table-cell-pad-bottom: var(--ds-table-cell-pad-bottom, var(--_table-cell-pad-y));--_table-cell-pad-left: var(--ds-table-cell-pad-left, var(--_table-cell-pad-x));--_table-head-pad-top: var(--ds-table-head-pad-top, var(--table-head-pad-y));--_table-head-pad-bottom: var(--ds-table-head-pad-bottom, var(--table-head-pad-y));--_table-head-border-color: var(--ds-table-head-border-color, var(--_table-divider));--_table-head-weight: var(--ds-table-head-weight, var(--font-weight-bold));--_table-head-tracking: var(--ds-table-head-tracking, var(--letter-spacing-wider));width:100%;border-collapse:collapse;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--_table-bg-color)}.table th.fit-content,.table td.fit-content{width:1%;white-space:nowrap}.table thead th{text-align:left;padding:var(--_table-head-pad-top) var(--_table-cell-pad-right) var(--_table-head-pad-bottom) var(--_table-cell-pad-left);font:var(--_table-head-weight) var(--_table-head-fs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--_table-head-tracking);text-transform:uppercase;color:var(--_table-head-text-color);background-color:var(--_table-head-bg-color);border-bottom:var(--border-width-default) solid var(--_table-head-border-color);white-space:nowrap}.table thead th .th-label{display:inline-flex;align-items:center;vertical-align:middle;appearance:none;background:none;border:0;margin:0;padding:0;font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;text-align:left}.table thead th button.th-label{cursor:pointer;-webkit-user-select:none;user-select:none;transition:color var(--duration-fast) var(--ease-standard)}.table thead th button.th-label:hover{color:var(--text-secondary)}.table thead th button.th-label:focus-visible{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:var(--focus-ring-offset);border-radius:var(--radius-sm)}.table thead th .sort-icon{display:inline-block;width:var(--sort-ic-size);height:var(--sort-ic-size);margin-left:var(--sort-ic-gap);vertical-align:middle;transform:translateY(-1px);color:var(--icon-default);opacity:var(--sort-ic-opacity-idle);transition:opacity var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.table thead th .sort-icon .icon{width:var(--sort-ic-size);height:var(--sort-ic-size);display:block}.table thead th.sorted-asc .sort-icon,.table thead th.sorted-desc .sort-icon{opacity:1;color:var(--_table-sort-active-icon-color)}.table thead th.numeric{text-align:right}.table thead th.select-col,.table thead th.expand-col,.table thead th.actions-col{width:var(--space-10)}.table.sticky-header thead th{position:sticky;top:0}.table.sticky-header thead th:not(.pin-select,.pin-first,.pin-expand){z-index:var(--table-sticky-header-z)}.table tbody td{padding:var(--_table-cell-pad-top) var(--_table-cell-pad-right) var(--_table-cell-pad-bottom) var(--_table-cell-pad-left);line-height:var(--line-height-flat);transition:background-color var(--duration-fast) var(--ease-standard);box-shadow:inset 0 calc(-1 * var(--border-width-default)) 0 var(--_table-divider);vertical-align:middle}.table tbody td.numeric{text-align:right}.table tbody td.empty{text-align:center;color:var(--text-tertiary);padding:var(--space-4)}.table tbody tr:last-child td{box-shadow:none}.table tbody tr.clickable:not(.active):hover td{background-color:var(--_table-row-hover-bg-color)}.table tbody tr.clickable:hover td.interactive-cell,.table tbody tr td .cell-link{color:var(--_table-cell-link-color);text-decoration:var(--_table-cell-link-decoration)}.table tbody tr.selected td{background-color:var(--_table-row-selected-bg-color)}.table tbody tr.active td{background-color:var(--_table-row-active-bg-color)}.table tbody tr.clickable:active td{background-color:var(--_table-row-pressed-bg-color)}.table tbody tr.clickable{cursor:pointer}.table tbody tr.clickable:focus-visible{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:-2px}.table tbody .expand-col,.table tbody .actions-col{width:var(--space-10)}.table tbody .expand-chev{display:block;transition:transform var(--duration-base) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.table tbody .expand-chev{transition:none}}.table tbody .expand-chev.is-expanded{transform:rotate(90deg)}.table tbody .expand-panel-cell{padding:var(--_table-cell-pad-top) var(--_table-cell-pad-right) var(--_table-cell-pad-bottom) var(--_table-cell-pad-left)}.table tbody .cell-clip{display:block;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.table .expand-btn,.table .row-actions-btn,.table .col-picker-btn{display:flex;align-items:center;justify-content:center;width:var(--space-6);height:var(--space-6);padding:0;border:0;background:none;cursor:pointer;color:var(--_table-icon-btn-color);border-radius:var(--ds-radius-inner);transition:color var(--duration-fast) var(--ease-standard)}.table .expand-btn:hover,.table .row-actions-btn:hover,.table .col-picker-btn:hover{color:var(--_table-icon-btn-color-hover)}.table .expand-btn:focus-visible,.table .row-actions-btn:focus-visible,.table .col-picker-btn:focus-visible{outline:var(--border-width-strong, 2px) solid var(--_table-icon-btn-focus-color);outline-offset:var(--focus-ring-offset)}.table.compact{--table-cell-pad-x: var(--space-3);--table-cell-pad-y: var(--space-2);--table-head-pad-y: var(--space-2)}.table{min-width:var(--_table-min-width)}.table.zebra:not(.virtual) tbody tr:nth-child(odd) td{background-color:var(--_table-row-stripe-bg-color)}.table.zebra.virtual tbody tr.stripe td{background-color:var(--_table-row-stripe-bg-color)}.table.virtual{table-layout:fixed}.table.virtual tbody tr:not(.spacer){height:var(--_table-virtual-row-h)}.table.virtual tbody td{overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.table tbody tr.spacer{padding:0;border:0;background:none}.table tbody tr.spacer:hover td{background-color:transparent}.col-picker{display:grid;gap:var(--space-2);min-width:160px}.col-picker-row{display:flex;align-items:center;gap:var(--space-2)}.col-picker-row.cdk-drag-preview{background-color:var(--surface-default);border-radius:var(--ds-radius-inner);box-shadow:var(--shadow-popover);padding:var(--space-1) var(--space-2)}.col-picker-row.cdk-drag-placeholder{opacity:.4}.col-picker.cdk-drop-list-dragging .col-picker-row:not(.cdk-drag-placeholder){transition:transform var(--duration-fast) var(--ease-standard)}.col-drag{display:inline-flex;color:var(--icon-default);cursor:grab}.col-drag:active{cursor:grabbing}.col-picker-option{display:flex;align-items:center;gap:var(--space-2);flex:1;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);cursor:pointer}.col-picker-option:has(input:disabled){color:var(--text-tertiary);cursor:default}.col-move{display:inline-flex;gap:var(--space-1)}.col-move-btn{display:inline-flex;padding:0;border:0;background:none;color:var(--icon-default);cursor:pointer}.col-move-btn:hover:not(:disabled){color:var(--icon-strong)}.col-move-btn:disabled{color:var(--text-disabled);cursor:default}.col-reset{margin-top:var(--space-1);padding:0;border:0;background:none;color:var(--accent);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;text-align:left}.col-reset:hover{text-decoration:underline}.col-filter-btn{display:inline-flex;margin-left:var(--space-1);padding:0;border:0;background:none;color:var(--icon-default);opacity:.5;cursor:pointer;vertical-align:middle;transition:color var(--duration-fast) var(--ease-standard),opacity var(--duration-fast) var(--ease-standard)}.col-filter-btn:hover{opacity:1;color:var(--icon-strong)}.col-filter-btn.active{opacity:1;color:var(--_table-sort-active-icon-color)}.col-filter{display:grid;gap:var(--space-2);min-width:180px}.col-filter-search{width:100%;box-sizing:border-box;padding:var(--space-1) var(--space-2);border:var(--border-width-default) solid var(--border-default);border-radius:var(--ds-radius-inner);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--surface-default)}.col-filter-search:focus-visible{outline:0;border-color:var(--accent)}.col-filter-list{display:grid;gap:var(--space-1);max-height:240px;overflow-y:auto}.col-filter-option{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);cursor:pointer}.col-filter-empty{color:var(--text-tertiary);font-size:var(--font-size-s);padding:var(--space-1) 0}.col-filter-footer{display:flex;align-items:center;justify-content:space-between;padding-top:var(--space-1);border-top:var(--border-width-default) solid var(--border-divider)}.col-filter-count{color:var(--text-tertiary);font-size:var(--font-size-xs)}.col-filter-footer .col-reset{margin-top:0}.editable-cell{cursor:text}.cell-edit{width:100%;box-sizing:border-box;margin:calc(-1 * var(--space-1)) 0;padding:var(--space-1) var(--space-2);border:var(--border-width-default) solid var(--accent);border-radius:var(--ds-radius-inner);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--surface-default)}.cell-edit:focus-visible{outline:0}.cell-text-pop{max-width:360px;overflow-wrap:anywhere;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary)}:host(.pinned){--_table-select-w: var(--ds-table-select-col-w, var(--space-10))}:host(.pinned) .table{border-collapse:separate;border-spacing:0}:host(.pinned) .table tbody td{box-shadow:none;border-bottom:var(--border-width-default) solid var(--_table-divider)}:host(.pinned) .table tbody tr:last-child td{border-bottom:0}:host(.pinned) .pin-select,:host(.pinned) .pin-first{position:sticky;left:0;z-index:var(--table-sticky-col-z);background-color:var(--_table-bg-color)}:host(.pinned) thead .pin-select,:host(.pinned) thead .pin-first{z-index:var(--table-sticky-corner-z);background-color:var(--_table-head-bg-color)}:host(.pinned) tbody tr.clickable:not(.active):hover .pin-first,:host(.pinned) tbody tr.clickable:not(.active):hover .pin-select{background-color:var(--_table-row-hover-bg-color)}:host(.pinned) tbody tr.selected .pin-first,:host(.pinned) tbody tr.selected .pin-select{background-color:var(--_table-row-selected-bg-color)}:host(.pinned) tbody tr.active .pin-first,:host(.pinned) tbody tr.active .pin-select{background-color:var(--_table-row-active-bg-color)}:host(.pinned) tbody tr.clickable:active .pin-first,:host(.pinned) tbody tr.clickable:active .pin-select{background-color:var(--_table-row-pressed-bg-color)}:host(.pinned.selectable) .pin-first{left:var(--_table-select-w)}:host(.pinned.expandable){--_table-expand-w: var(--ds-table-expand-col-w, var(--space-10))}:host(.pinned.expandable) .pin-expand{position:sticky;left:0;z-index:var(--table-sticky-col-z);background-color:var(--_table-bg-color)}:host(.pinned.expandable) thead .pin-expand{z-index:var(--table-sticky-corner-z);background-color:var(--_table-head-bg-color)}:host(.pinned.expandable) tbody tr.clickable:not(.active):hover .pin-expand{background-color:var(--_table-row-hover-bg-color)}:host(.pinned.expandable) tbody tr.selected .pin-expand{background-color:var(--_table-row-selected-bg-color)}:host(.pinned.expandable) tbody tr.active .pin-expand{background-color:var(--_table-row-active-bg-color)}:host(.pinned.expandable) tbody tr.clickable:active .pin-expand{background-color:var(--_table-row-pressed-bg-color)}:host(.pinned.expandable) .pin-first{left:var(--_table-expand-w)}:host(.pinned.selectable.expandable) .pin-expand{left:var(--_table-select-w)}:host(.pinned.selectable.expandable) .pin-first{left:calc(var(--_table-select-w) + var(--_table-expand-w))}.pagination-footer{padding:var(--space-3) var(--ds-table-cell-pad-x, var(--table-cell-pad-x)) var(--space-3);border-top:var(--border-width-default) solid var(--ds-table-divider, var(--border-divider))}.bulk-bar{position:sticky;bottom:var(--bulk-bar-offset);display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-4);background:var(--surface-inverted);color:var(--text-inverted);border-radius:var(--radius-lg);box-shadow:var(--shadow-toast);margin:var(--space-4) auto 0;width:fit-content}.bulk-bar .count{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans)}.bulk-bar .sep{width:var(--border-width-default);height:var(--space-4);background:var(--border-inverted)}.bulk-bar .button{background:transparent;color:var(--text-inverted)}.bulk-bar .button:hover{background:var(--surface-inverted-hover)}.table-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2);margin-bottom:var(--space-2)}.table-toolbar:not(:has(.toolbar-slot>*,>ds-button)){display:none}.toolbar-slot{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;gap:var(--space-2);min-width:0}.toolbar-slot ::ng-deep>:only-child{flex:1 1 auto;min-width:0}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ds-button", inputs: ["color", "variant", "size", "type", "disabled", "loading", "fullWidth", "ariaLabel", "icon", "trailingIcon", "ariaHasPopup", "ariaExpanded", "ariaControls", "disabledReason", "ariaDescribedBy"], outputs: ["pressed"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "component", type: PaginationComponent, selector: "ds-pagination", inputs: ["total", "pageSize", "currentPage", "pageSizeOptions", "showLabel", "showPageSize"], outputs: ["pageSizeChange", "currentPageChange"] }, { kind: "component", type: LoadingOverlayComponent, selector: "ds-loading-overlay", inputs: ["loading", "label", "blur", "spinnerSize", "insetTop"] }, { kind: "component", type: PopoverComponent, selector: "ds-popover", inputs: ["align", "placement", "arrow", "panelRole", "panelLabel"] }, { kind: "component", type: MenuComponent, selector: "ds-menu" }, { kind: "component", type: MenuItemComponent, selector: "ds-menu-item", inputs: ["icon", "disabled", "error", "quiet", "description", "submenu"], outputs: ["pressed"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type:
|
|
7235
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TableComponent, isStandalone: true, selector: "ds-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, rowId: { classPropertyName: "rowId", publicName: "rowId", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, stickyHeader: { classPropertyName: "stickyHeader", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, zebra: { classPropertyName: "zebra", publicName: "zebra", isSignal: true, isRequired: false, transformFunction: null }, animateHeight: { classPropertyName: "animateHeight", publicName: "animateHeight", isSignal: true, isRequired: false, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, sortKey: { classPropertyName: "sortKey", publicName: "sortKey", isSignal: true, isRequired: false, transformFunction: null }, sortDir: { classPropertyName: "sortDir", publicName: "sortDir", isSignal: true, isRequired: false, transformFunction: null }, sortingOrder: { classPropertyName: "sortingOrder", publicName: "sortingOrder", isSignal: true, isRequired: false, transformFunction: null }, sortAnnouncement: { classPropertyName: "sortAnnouncement", publicName: "sortAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, rangeAnnouncement: { classPropertyName: "rangeAnnouncement", publicName: "rangeAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, skeletonRows: { classPropertyName: "skeletonRows", publicName: "skeletonRows", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, rowInteractive: { classPropertyName: "rowInteractive", publicName: "rowInteractive", isSignal: true, isRequired: false, transformFunction: null }, activeRowId: { classPropertyName: "activeRowId", publicName: "activeRowId", isSignal: true, isRequired: false, transformFunction: null }, filterQuery: { classPropertyName: "filterQuery", publicName: "filterQuery", isSignal: true, isRequired: false, transformFunction: null }, columnFilters: { classPropertyName: "columnFilters", publicName: "columnFilters", isSignal: true, isRequired: false, transformFunction: null }, hiddenKeys: { classPropertyName: "hiddenKeys", publicName: "hiddenKeys", isSignal: true, isRequired: false, transformFunction: null }, resizableColumns: { classPropertyName: "resizableColumns", publicName: "resizableColumns", isSignal: true, isRequired: false, transformFunction: null }, columnWidths: { classPropertyName: "columnWidths", publicName: "columnWidths", isSignal: true, isRequired: false, transformFunction: null }, reorderableColumns: { classPropertyName: "reorderableColumns", publicName: "reorderableColumns", isSignal: true, isRequired: false, transformFunction: null }, columnOrder: { classPropertyName: "columnOrder", publicName: "columnOrder", isSignal: true, isRequired: false, transformFunction: null }, persistLayout: { classPropertyName: "persistLayout", publicName: "persistLayout", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, exportButton: { classPropertyName: "exportButton", publicName: "exportButton", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, exportFetcher: { classPropertyName: "exportFetcher", publicName: "exportFetcher", isSignal: true, isRequired: false, transformFunction: null }, stickyScrollbar: { classPropertyName: "stickyScrollbar", publicName: "stickyScrollbar", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, scrollToTopOnPageChange: { classPropertyName: "scrollToTopOnPageChange", publicName: "scrollToTopOnPageChange", isSignal: true, isRequired: false, transformFunction: null }, sortMode: { classPropertyName: "sortMode", publicName: "sortMode", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, columnFilterOptions: { classPropertyName: "columnFilterOptions", publicName: "columnFilterOptions", isSignal: true, isRequired: false, transformFunction: null }, stickyFirstColumn: { classPropertyName: "stickyFirstColumn", publicName: "stickyFirstColumn", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualRowSize: { classPropertyName: "virtualRowSize", publicName: "virtualRowSize", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, cellTemplateMap: { classPropertyName: "cellTemplateMap", publicName: "cellTemplateMap", isSignal: true, isRequired: false, transformFunction: null }, emptyTemplate: { classPropertyName: "emptyTemplate", publicName: "emptyTemplate", isSignal: true, isRequired: false, transformFunction: null }, expandableRows: { classPropertyName: "expandableRows", publicName: "expandableRows", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null }, expandMode: { classPropertyName: "expandMode", publicName: "expandMode", isSignal: true, isRequired: false, transformFunction: null }, expandAllToggle: { classPropertyName: "expandAllToggle", publicName: "expandAllToggle", isSignal: true, isRequired: false, transformFunction: null }, rowExpandTemplate: { classPropertyName: "rowExpandTemplate", publicName: "rowExpandTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIds: "selectedIdsChange", sortKeyChange: "sortKeyChange", sortDirChange: "sortDirChange", columnFilters: "columnFiltersChange", hiddenKeys: "hiddenKeysChange", columnWidths: "columnWidthsChange", columnOrder: "columnOrderChange", exportFailed: "exportFailed", pageSize: "pageSizeChange", page: "pageChange", lazyLoad: "lazyLoad", rowClicked: "rowClicked", sortChange: "sortChange", rowActionSelected: "rowActionSelected", cellEdited: "cellEdited", expandedIds: "expandedIdsChange", rowExpanded: "rowExpanded", rowCollapsed: "rowCollapsed" }, host: { properties: { "class.bordered": "borderedResolved()", "class.selectable": "selectable()", "class.pinned": "stickyFirstColumn()", "class.expandable": "expandableRows()", "class.sticky-scrollbar": "stickyScrollbarResolved()", "class.resizable": "resizableColumns()" } }, queries: [{ propertyName: "cellTemplateDirectives", predicate: CellTemplateDirective, isSignal: true }, { propertyName: "headerFilters", predicate: HeaderFilterDirective, isSignal: true }], viewQueries: [{ propertyName: "columnFilterPopover", first: true, predicate: ["columnFilterPopover"], descendants: true, isSignal: true }, { propertyName: "editInput", first: true, predicate: ["editInput"], descendants: true, isSignal: true }, { propertyName: "rowMenuPopover", first: true, predicate: ["rowMenuPopover"], descendants: true, isSignal: true }, { propertyName: "columnPickerPopover", first: true, predicate: ["columnPickerPopover"], descendants: true, isSignal: true }, { propertyName: "cellTextPopover", first: true, predicate: ["cellTextPopover"], descendants: true, isSignal: true }, { propertyName: "scrollWrap", first: true, predicate: ["scrollWrap"], descendants: true, isSignal: true }, { propertyName: "hscrollProxy", first: true, predicate: ["hscrollProxy"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"table-toolbar\">\n <div class=\"toolbar-slot\">\n <ng-content select=\"[toolbar]\"></ng-content>\n </div>\n\n @if (exportButton()) {\n <ds-button\n color=\"neutral\"\n variant=\"outline\"\n size=\"sm\"\n [disabled]=\"exporting()\"\n (pressed)=\"runExport()\"\n >\n {{ exporting() ? 'Preparing\u2026' : 'Export CSV' }}\n </ds-button>\n }\n</div>\n\n<!-- Wraps the SCROLL CONTAINER, not the table inside it: the scrim is\n `position: absolute; inset: 0`, so from in there it is sized to one viewport of\n the table and scrolls away with the content. -->\n<ds-loading-overlay\n [loading]=\"isOverlayLoading()\"\n [blur]=\"true\"\n [insetTop]=\"'var(--ds-table-head-h, 40px)'\"\n [inertContent]=\"false\"\n>\n <div\n #scrollWrap\n class=\"scroll-wrap\"\n [class.scroll-y]=\"maxHeight()\"\n [style.max-height]=\"maxHeight()\"\n >\n <div\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n >\n {{ statusMessage() }}\n </div>\n\n <table\n [class]=\"tableClasses()\"\n [style.--_table-virtual-row-h]=\"virtualRowHeight()\"\n [attr.role]=\"rowInteractive() ? 'grid' : null\"\n [attr.aria-busy]=\"loading() !== false ? 'true' : null\"\n >\n @if (caption()) {\n <caption class=\"visually-hidden\">\n {{\n caption()\n }}\n </caption>\n }\n\n <thead>\n <tr>\n @if (selectable()) {\n <th\n scope=\"col\"\n class=\"select-col pin-select\"\n >\n <input\n type=\"checkbox\"\n class=\"check\"\n [attr.aria-label]=\"selectAllLabel()\"\n [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (change)=\"onToggleAll($event)\"\n />\n </th>\n }\n\n @if (expandableRows()) {\n <th\n scope=\"col\"\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n @if (expandAllVisible()) {\n <button\n type=\"button\"\n class=\"expand-btn\"\n [attr.aria-label]=\"expandAllLabel()\"\n (click)=\"onToggleExpandAll()\"\n >\n <ds-icon\n class=\"expand-chev\"\n name=\"chevronRight\"\n [class.is-expanded]=\"allExpanded()\"\n [size]=\"16\"\n />\n </button>\n }\n </th>\n }\n\n @for (col of visibleColumns(); track col.key; let first = $first) {\n <th\n scope=\"col\"\n [class]=\"headerClasses(col)\"\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n [class.fit-content]=\"fitsContent(col)\"\n [style.width.px]=\"columnWidth(col)\"\n [style.min-width.px]=\"columnWidth(col)\"\n [style.max-width.px]=\"columnWidth(col)\"\n [attr.aria-sort]=\"ariaSort(col)\"\n [attr.data-col-key]=\"col.key\"\n (pointerenter)=\"onHeaderEnter($event, col)\"\n >\n @if (sortableCol(col)) {\n <button\n type=\"button\"\n class=\"th-label\"\n (click)=\"onSort(col)\"\n >\n @if (col.label) {\n {{ col.label }}\n } @else if (col.srLabel) {\n <span class=\"visually-hidden\">\n {{ col.srLabel }}\n </span>\n }\n\n <ds-icon\n class=\"sort-icon\"\n [name]=\"sortIcon(col)\"\n [size]=\"12\"\n >\n </ds-icon>\n </button>\n } @else {\n <span class=\"th-label\">\n @if (col.label) {\n {{ col.label }}\n } @else if (col.srLabel) {\n <span class=\"visually-hidden\">\n {{ col.srLabel }}\n </span>\n }\n </span>\n }\n\n @if (hasColumnFilter(col)) {\n <button\n type=\"button\"\n class=\"col-filter-btn\"\n aria-haspopup=\"dialog\"\n [class.active]=\"isColumnFiltered(col)\"\n [attr.aria-label]=\"'Filter ' + col.label\"\n (click)=\"onColumnFilterClick(col, $event)\"\n >\n <ds-icon\n name=\"filter\"\n [size]=\"12\"\n />\n </button>\n }\n\n @if (resizableColumns()) {\n @let range = resizeRange(col);\n\n <span\n class=\"col-resize\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + col.label\"\n [attr.aria-valuenow]=\"range?.now ?? null\"\n [attr.aria-valuemin]=\"range?.min ?? null\"\n [attr.aria-valuemax]=\"range?.max ?? null\"\n (focus)=\"onResizeFocus(col, $event)\"\n (blur)=\"onResizeBlur()\"\n (pointerdown)=\"onResizeStart(col, $event)\"\n (pointermove)=\"onResizeMove($event)\"\n (pointerup)=\"onResizeEnd()\"\n (pointercancel)=\"onResizeEnd()\"\n (keydown)=\"onResizeKey(col, $event)\"\n >\n </span>\n }\n </th>\n }\n\n @if (hasUtilityColumn()) {\n <th\n scope=\"col\"\n class=\"actions-col\"\n >\n @if (hasColumnPicker()) {\n <button\n type=\"button\"\n class=\"col-picker-btn\"\n aria-haspopup=\"dialog\"\n aria-label=\"Choose columns\"\n [attr.aria-expanded]=\"columnPickerOpened()\"\n (click)=\"onColumnPickerClick($event)\"\n >\n <ds-icon\n name=\"grid\"\n [size]=\"14\"\n />\n </button>\n } @else {\n <span class=\"visually-hidden\">\n Actions\n </span>\n }\n </th>\n }\n </tr>\n </thead>\n\n <!-- Matches what the scrim covers, which is everything below the header:\n a row keeps its tabindex and its Enter handler otherwise, so a keyboard\n user could open a row whose data is mid-replacement while the pointer\n was stopped by the scrim. The header stays live on purpose \u2014 re-sorting\n is what puts the scrim up in the first place. -->\n <tbody [attr.inert]=\"isOverlayLoading() ? '' : null\">\n @if (isSkeletonLoading()) {\n @for (_ of skeletonArray(); track $index; let rowIndex = $index) {\n <ng-container\n [ngTemplateOutlet]=\"skeletonRow\"\n [ngTemplateOutletContext]=\"{ $implicit: rowIndex }\"\n >\n </ng-container>\n }\n } @else if (showsEmptyRow()) {\n <tr>\n <td\n class=\"empty\"\n [attr.colspan]=\"expandedColspan()\"\n >\n @if (emptyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplate()!\">\n </ng-container>\n } @else {\n <ng-content select=\"[empty]\"></ng-content>\n }\n </td>\n </tr>\n } @else {\n @if (virtualWindow(); as window) {\n <tr\n class=\"spacer\"\n aria-hidden=\"true\"\n [style.height.px]=\"window.padTop\"\n >\n </tr>\n }\n\n @for (slot of rowSlots(); track slot.index) {\n @if (slot.row; as row) {\n <tr\n [class.selected]=\"isSelected(row)\"\n [class.expanded]=\"isExpanded(row)\"\n [class.clickable]=\"rowInteractive()\"\n [class.stripe]=\"isStriped(slot.index)\"\n [class.active]=\"rowKey(row) === activeRowId()\"\n [attr.aria-current]=\"\n rowKey(row) === activeRowId() ? 'true' : null\n \"\n [attr.tabindex]=\"rowInteractive() ? 0 : null\"\n [attr.aria-label]=\"rowInteractive() ? rowAriaLabel(row) : null\"\n (mousedown)=\"onRowMousedown()\"\n (click)=\"onRowClick(row, $event)\"\n (keydown.enter)=\"onRowKey(row, $event)\"\n (keydown.space)=\"onRowKey(row, $event)\"\n >\n @if (selectable()) {\n <td class=\"select-col pin-select\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [attr.aria-label]=\"'Select ' + rowAriaLabel(row)\"\n [checked]=\"isSelected(row)\"\n (change)=\"onToggleRow(row, $event)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n }\n\n @if (expandableRows()) {\n <td\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n <button\n type=\"button\"\n class=\"expand-btn\"\n [attr.aria-expanded]=\"isExpanded(row)\"\n [attr.aria-label]=\"\n isExpanded(row) ? 'Collapse row' : 'Expand row'\n \"\n (click)=\"onToggleExpand(row, $event)\"\n >\n <ds-icon\n class=\"expand-chev\"\n name=\"chevronRight\"\n [class.is-expanded]=\"isExpanded(row)\"\n [size]=\"16\"\n />\n </button>\n </td>\n }\n\n @for (\n col of visibleColumns();\n track col.key;\n let first = $first\n ) {\n <td\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n [class.editable-cell]=\"col.editable\"\n [class.interactive-cell]=\"col.interactive\"\n [class.fit-content]=\"fitsContent(col)\"\n (dblclick)=\"startEdit(row, col, $event)\"\n >\n @if (isEditing(row, col)) {\n <input\n #editInput\n type=\"text\"\n class=\"cell-edit\"\n [value]=\"editDraft()\"\n (input)=\"onEditInput($event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown.enter)=\"commitEdit(row, col)\"\n (keydown.escape)=\"cancelEdit()\"\n (blur)=\"commitEdit(row, col)\"\n />\n } @else if (cellTemplate(col); as tpl) {\n @if (col.truncate) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- same pointer-only enhancement as the plain truncate branch below; the value stays in the DOM for AT -->\n <span\n class=\"cell-clip\"\n [style.max-width.px]=\"clipWidth(col)\"\n [attr.title]=\"cellValue(row, col)\"\n (click)=\"onCellClipClick(row, col, $event)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row,\n row: row,\n }\"\n >\n </ng-container>\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row,\n row: row,\n }\"\n >\n </ng-container>\n }\n } @else if (col.truncate) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- pointer-only enhancement: the clip is visual (CSS ellipsis), keyboard/AT users already get the full DOM text + title; a tab stop per cell would wreck keyboard traversal -->\n <span\n class=\"cell-clip\"\n [style.max-width.px]=\"clipWidth(col)\"\n [attr.title]=\"cellValue(row, col)\"\n (click)=\"onCellClipClick(row, col, $event)\"\n >\n @if (cellLink(row, col); as target) {\n <a\n class=\"cell-link\"\n [routerLink]=\"target\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ cellValue(row, col) }}\n </a>\n } @else {\n {{ cellValue(row, col) }}\n }\n </span>\n } @else if (cellLink(row, col); as target) {\n <a\n class=\"cell-link\"\n [routerLink]=\"target\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ cellValue(row, col) }}\n </a>\n } @else {\n {{ cellValue(row, col) }}\n }\n </td>\n }\n\n @if (hasUtilityColumn()) {\n <td class=\"actions-col\">\n @if (hasRowActions() && hasActionsFor(row)) {\n <button\n type=\"button\"\n class=\"row-actions-btn\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"isMenuOpenFor(row)\"\n [attr.aria-label]=\"'Actions for ' + rowAriaLabel(row)\"\n (click)=\"onRowMenuClick(row, $event)\"\n (keydown.enter)=\"$event.stopPropagation()\"\n (keydown.space)=\"$event.stopPropagation()\"\n >\n <ds-icon\n name=\"moreV\"\n [size]=\"16\"\n />\n </button>\n }\n </td>\n }\n </tr>\n\n @if (\n expandableRows() &&\n isExpanded(row) &&\n rowExpandTemplate() &&\n !virtualizing()\n ) {\n <tr class=\"expand-panel-row\">\n <td\n class=\"expand-panel-cell\"\n [attr.colspan]=\"expandedColspan()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"rowExpandTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: row, row: row }\"\n >\n </ng-container>\n </td>\n </tr>\n }\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"skeletonRow\"\n [ngTemplateOutletContext]=\"{ $implicit: slot.index }\"\n >\n </ng-container>\n }\n }\n\n @if (virtualWindow(); as window) {\n <tr\n class=\"spacer\"\n aria-hidden=\"true\"\n [style.height.px]=\"window.padBottom\"\n >\n </tr>\n }\n }\n </tbody>\n </table>\n </div>\n</ds-loading-overlay>\n\n@if (stickyScrollbarResolved()) {\n <div\n #hscrollProxy\n class=\"hscroll-proxy\"\n aria-hidden=\"true\"\n [class.hscroll-hidden]=\"!hscrollNeeded()\"\n >\n <div\n class=\"hscroll-spacer\"\n [style.width.px]=\"hscrollContentWidth()\"\n >\n </div>\n </div>\n}\n\n@if (pageSize(); as size) {\n <div class=\"pagination-footer\">\n <ds-pagination\n [total]=\"total() ?? filteredData().length\"\n [pageSize]=\"size\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [showPageSize]=\"showPageSize()\"\n [showLabel]=\"showLabel()\"\n [(currentPage)]=\"page\"\n (pageSizeChange)=\"pageSize.set($event)\"\n />\n </div>\n}\n\n@if (hasTruncate()) {\n <ds-popover #cellTextPopover>\n <div class=\"cell-text-pop\">\n {{ cellPopoverText() }}\n </div>\n </ds-popover>\n}\n\n@if (filterColumn()) {\n <ds-popover\n #columnFilterPopover\n align=\"start\"\n panelRole=\"dialog\"\n panelLabel=\"Filter values\"\n >\n @if (headerFilterFor(filterColumn()!); as projected) {\n <div class=\"col-filter col-filter-custom\">\n <ng-container\n [ngTemplateOutlet]=\"projected.template\"\n [ngTemplateOutletContext]=\"headerFilterContext(filterColumn()!)\"\n />\n </div>\n } @else {\n <div class=\"col-filter\">\n <input\n type=\"text\"\n class=\"col-filter-search\"\n placeholder=\"Search\u2026\"\n [value]=\"filterSearch()\"\n (input)=\"onFilterSearch($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n\n <div class=\"col-filter-list\">\n @for (value of filterValues(); track value) {\n <label class=\"col-filter-option\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"isFilterValueChecked(value)\"\n (change)=\"toggleFilterValue(value)\"\n />\n {{ value || '(empty)' }}\n </label>\n } @empty {\n <div class=\"col-filter-empty\">\n No matches\n </div>\n }\n </div>\n\n <div class=\"col-filter-footer\">\n <span class=\"col-filter-count\">\n {{ filterSelectedCount() }} selected\n </span>\n\n <button\n type=\"button\"\n class=\"col-reset\"\n (click)=\"clearColumnFilter()\"\n >\n Clear\n </button>\n </div>\n </div>\n }\n </ds-popover>\n}\n\n@if (hasColumnPicker()) {\n <ds-popover\n #columnPickerPopover\n align=\"end\"\n panelRole=\"dialog\"\n panelLabel=\"Column visibility\"\n >\n <ng-container [ngTemplateOutlet]=\"columnPanel\"></ng-container>\n </ds-popover>\n\n <ds-bottom-sheet\n title=\"Columns\"\n [(open)]=\"columnSheetOpen\"\n >\n <ng-container [ngTemplateOutlet]=\"columnPanel\"></ng-container>\n </ds-bottom-sheet>\n\n <ng-template #columnPanel>\n <div\n class=\"col-picker\"\n cdkDropList\n (cdkDropListDropped)=\"onColumnDrop($event)\"\n >\n @for (\n col of orderedColumns();\n track col.key;\n let first = $first;\n let last = $last\n ) {\n <div\n class=\"col-picker-row\"\n cdkDrag\n [cdkDragDisabled]=\"!reorderableColumns()\"\n >\n @if (reorderableColumns()) {\n <span\n class=\"col-drag\"\n cdkDragHandle\n aria-hidden=\"true\"\n >\n <ds-icon\n name=\"drag\"\n [size]=\"14\"\n />\n </span>\n }\n\n <label class=\"col-picker-option\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"isColumnVisible(col)\"\n [disabled]=\"!col.hideable || isColumnLocked(col)\"\n (change)=\"toggleColumn(col)\"\n />\n {{ col.label }}\n </label>\n\n @if (resizableColumns()) {\n <span class=\"col-width\">\n <button\n type=\"button\"\n class=\"col-width-btn\"\n [attr.aria-label]=\"'Narrow ' + col.label\"\n (click)=\"onColumnWidthStep(col, -resizeStep)\"\n >\n <ds-icon\n name=\"minus\"\n [size]=\"14\"\n />\n </button>\n\n <button\n type=\"button\"\n class=\"col-width-btn\"\n [attr.aria-label]=\"'Widen ' + col.label\"\n (click)=\"onColumnWidthStep(col, resizeStep)\"\n >\n <ds-icon\n name=\"plus\"\n [size]=\"14\"\n />\n </button>\n\n <button\n type=\"button\"\n class=\"col-width-btn col-width-auto\"\n [attr.aria-label]=\"'Fit ' + col.label + ' to its content'\"\n (click)=\"onColumnWidthStep(col, 'auto')\"\n >\n Fit\n </button>\n </span>\n }\n\n @if (reorderableColumns()) {\n <span class=\"col-move\">\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move up\"\n [disabled]=\"first\"\n (click)=\"moveColumn(col, -1)\"\n >\n <ds-icon\n name=\"chevronUp\"\n [size]=\"14\"\n />\n </button>\n\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move down\"\n [disabled]=\"last\"\n (click)=\"moveColumn(col, 1)\"\n >\n <ds-icon\n name=\"chevronDown\"\n [size]=\"14\"\n />\n </button>\n </span>\n }\n </div>\n }\n\n <button\n type=\"button\"\n class=\"col-reset\"\n (click)=\"resetColumns()\"\n >\n Reset to default\n </button>\n </div>\n </ng-template>\n}\n\n@if (hasRowActions()) {\n <ds-popover\n #rowMenuPopover\n align=\"end\"\n >\n <ds-menu>\n @for (action of visibleRowActions(); track action.id) {\n <ds-menu-item\n [icon]=\"action.icon ?? null\"\n [error]=\"action.error ?? false\"\n [disabled]=\"isActionDisabled(action)\"\n [description]=\"actionReason(action)\"\n (pressed)=\"onRowAction(action)\"\n >\n {{ action.label }}\n </ds-menu-item>\n }\n </ds-menu>\n </ds-popover>\n}\n\n@if (selectable() && someSelected()) {\n <div class=\"bulk-bar\">\n <span class=\"count\">\n {{ selectedIds().size }} selected\n </span>\n\n <span class=\"sep\"></span>\n\n <ng-content select=\"[bulk-actions]\"></ng-content>\n </div>\n}\n\n<!-- One skeleton row, shared by loading=\"skeleton\" and the gaps a lazy\n window has not filled yet. `$implicit` is the row's index: skeletonWidth\n varies the bar lengths from it, so a block of them does not read as a grid. -->\n<ng-template\n #skeletonRow\n let-rowIndex\n>\n <tr>\n @if (selectable()) {\n <td class=\"select-col pin-select\">\n <ds-skeleton\n width=\"14px\"\n height=\"14px\"\n [inline]=\"true\"\n />\n </td>\n }\n\n @if (expandableRows()) {\n <td\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n </td>\n }\n\n @for (col of visibleColumns(); track col.key; let first = $first) {\n <td\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n >\n <ds-skeleton\n height=\"14px\"\n [width]=\"skeletonWidth(col, rowIndex)\"\n [inline]=\"true\"\n />\n </td>\n }\n\n @if (hasUtilityColumn()) {\n <td class=\"actions-col\"></td>\n }\n </tr>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:block;position:relative}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.bordered) .scroll-wrap{border:var(--border-width-default) solid var(--_table-border);border-radius:var(--_table-radius)}.scroll-wrap{--_table-border: var(--ds-table-border, var(--border-default));--_table-radius: var(--ds-table-radius, var(--ds-radius-control));--_table-bg-color: var(--ds-table-bg-color, var(--surface-default));width:100%;overflow:auto hidden;-webkit-overflow-scrolling:touch;background:var(--surface-default);box-sizing:border-box}.scroll-wrap.scroll-y{overflow-y:auto}:host(.sticky-scrollbar) .scroll-wrap{scrollbar-width:none}:host(.sticky-scrollbar) .scroll-wrap::-webkit-scrollbar{display:none}:host(.resizable) thead th{position:relative;overflow:hidden}@media(hover:none)and (pointer:coarse){.col-resize{display:none}}.col-resize{position:absolute;inset-block:0;right:0;width:var(--space-2);cursor:col-resize;touch-action:none;-webkit-user-select:none;user-select:none}.col-resize:after{content:\"\";position:absolute;inset-block:var(--space-2);right:0;width:var(--border-width-default);background-color:transparent;transition:background-color var(--duration-fast) var(--ease-standard)}.col-resize:hover:after,.col-resize:active:after,.col-resize:focus-visible:after{background-color:var(--_table-sort-active-icon-color)}.col-resize:focus-visible{outline:none}.col-resize:focus-visible:after{width:var(--border-width-strong)}.hscroll-proxy{position:sticky;bottom:var(--ds-table-hscroll-bottom, 0);overflow:auto hidden}.hscroll-spacer{height:1px}.hscroll-hidden{display:none}.table{--_table-min-width: var(--ds-table-min-width, 0);--_table-bg-color: var(--ds-table-bg-color, var(--surface-default));--_table-row-hover-bg-color: var(--ds-table-row-hover-bg-color, var(--surface-secondary));--_table-row-selected-bg-color: var(--ds-table-row-selected-bg-color, var(--accent-subtitle));--_table-row-pressed-bg-color: var(--ds-table-row-pressed-bg-color, var(--surface-muted));--_table-row-active-bg-color: var(--ds-table-row-active-bg-color, var(--accent-subtitle));--_table-row-stripe-bg-color: var(--ds-table-row-stripe-bg-color, var(--surface-secondary));--_table-cell-link-color: var(--ds-table-cell-link-color, var(--accent));--_table-cell-link-decoration: var(--ds-table-cell-link-decoration, underline);--_table-head-text-color: var(--ds-table-head-text-color, var(--text-secondary));--_table-head-bg-color: var(--ds-table-head-bg-color, var(--surface-secondary));--_table-head-fs: var(--ds-table-head-fs, var(--font-size-xs));--_table-divider: var(--ds-table-divider, var(--border-divider));--_table-sort-active-icon-color: var(--ds-table-sort-active-icon-color, var(--accent));--_table-icon-btn-color: var(--ds-table-icon-btn-color, var(--icon-default));--_table-icon-btn-color-hover: var(--ds-table-icon-btn-color-hover, var(--icon-strong));--_table-icon-btn-focus-color: var(--ds-table-icon-btn-focus-color, var(--accent));--_table-cell-pad-x: var(--ds-table-cell-pad-x, var(--table-cell-pad-x));--_table-cell-pad-y: var(--ds-table-cell-pad-y, var(--table-cell-pad-y));--_table-cell-pad-top: var(--ds-table-cell-pad-top, var(--_table-cell-pad-y));--_table-cell-pad-right: var(--ds-table-cell-pad-right, var(--_table-cell-pad-x));--_table-cell-pad-bottom: var(--ds-table-cell-pad-bottom, var(--_table-cell-pad-y));--_table-cell-pad-left: var(--ds-table-cell-pad-left, var(--_table-cell-pad-x));--_table-head-pad-top: var(--ds-table-head-pad-top, var(--table-head-pad-y));--_table-head-pad-bottom: var(--ds-table-head-pad-bottom, var(--table-head-pad-y));--_table-head-border-color: var(--ds-table-head-border-color, var(--_table-divider));--_table-head-weight: var(--ds-table-head-weight, var(--font-weight-bold));--_table-head-tracking: var(--ds-table-head-tracking, var(--letter-spacing-wider));width:100%;border-collapse:collapse;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--_table-bg-color)}.table th.fit-content,.table td.fit-content{width:1%;white-space:nowrap}.table thead th{text-align:left;padding:var(--_table-head-pad-top) var(--_table-cell-pad-right) var(--_table-head-pad-bottom) var(--_table-cell-pad-left);font:var(--_table-head-weight) var(--_table-head-fs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--_table-head-tracking);text-transform:uppercase;color:var(--_table-head-text-color);background-color:var(--_table-head-bg-color);border-bottom:var(--border-width-default) solid var(--_table-head-border-color);white-space:nowrap}.table thead th .th-label{display:inline-flex;align-items:center;vertical-align:middle;appearance:none;background:none;border:0;margin:0;padding:0;font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;text-align:left}.table thead th button.th-label{cursor:pointer;-webkit-user-select:none;user-select:none;transition:color var(--duration-fast) var(--ease-standard)}.table thead th button.th-label:hover{color:var(--text-secondary)}.table thead th button.th-label:focus-visible{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:var(--focus-ring-offset);border-radius:var(--radius-sm)}.table thead th .sort-icon{display:inline-block;width:var(--sort-ic-size);height:var(--sort-ic-size);margin-left:var(--sort-ic-gap);vertical-align:middle;transform:translateY(-1px);color:var(--icon-default);opacity:var(--sort-ic-opacity-idle);transition:opacity var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.table thead th .sort-icon .icon{width:var(--sort-ic-size);height:var(--sort-ic-size);display:block}.table thead th.sorted-asc .sort-icon,.table thead th.sorted-desc .sort-icon{opacity:1;color:var(--_table-sort-active-icon-color)}.table thead th.numeric{text-align:right}.table thead th.select-col,.table thead th.expand-col,.table thead th.actions-col{width:var(--space-10)}.table.sticky-header thead th{position:sticky;top:0}.table.sticky-header thead th:not(.pin-select,.pin-first,.pin-expand){z-index:var(--table-sticky-header-z)}.table tbody td{padding:var(--_table-cell-pad-top) var(--_table-cell-pad-right) var(--_table-cell-pad-bottom) var(--_table-cell-pad-left);line-height:var(--line-height-flat);transition:background-color var(--duration-fast) var(--ease-standard);box-shadow:inset 0 calc(-1 * var(--border-width-default)) 0 var(--_table-divider);vertical-align:middle}.table tbody td.numeric{text-align:right}.table tbody td.empty{text-align:center;color:var(--text-tertiary);padding:var(--space-4)}.table tbody tr:last-child td{box-shadow:none}.table tbody tr.clickable:not(.active):hover td{background-color:var(--_table-row-hover-bg-color)}.table tbody tr.clickable:hover td.interactive-cell,.table tbody tr td .cell-link{color:var(--_table-cell-link-color);text-decoration:var(--_table-cell-link-decoration)}.table tbody tr.selected td{background-color:var(--_table-row-selected-bg-color)}.table tbody tr.active td{background-color:var(--_table-row-active-bg-color)}.table tbody tr.clickable:active td{background-color:var(--_table-row-pressed-bg-color)}.table tbody tr.clickable{cursor:pointer}.table tbody tr.clickable:focus-visible{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:-2px}.table tbody .expand-col,.table tbody .actions-col{width:var(--space-10)}.table tbody .expand-panel-cell{padding:var(--_table-cell-pad-top) var(--_table-cell-pad-right) var(--_table-cell-pad-bottom) var(--_table-cell-pad-left)}.table tbody .cell-clip{display:block;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.table .expand-chev{display:block;transition:transform var(--duration-base) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.table .expand-chev{transition:none}}.table .expand-chev.is-expanded{transform:rotate(90deg)}.table .expand-btn,.table .row-actions-btn,.table .col-picker-btn{display:flex;align-items:center;justify-content:center;width:var(--space-6);height:var(--space-6);padding:0;border:0;background:none;cursor:pointer;color:var(--_table-icon-btn-color);border-radius:var(--ds-radius-inner);transition:color var(--duration-fast) var(--ease-standard)}.table .expand-btn:hover,.table .row-actions-btn:hover,.table .col-picker-btn:hover{color:var(--_table-icon-btn-color-hover)}.table .expand-btn:focus-visible,.table .row-actions-btn:focus-visible,.table .col-picker-btn:focus-visible{outline:var(--border-width-strong, 2px) solid var(--_table-icon-btn-focus-color);outline-offset:var(--focus-ring-offset)}.table.compact{--table-cell-pad-x: var(--space-3);--table-cell-pad-y: var(--space-2);--table-head-pad-y: var(--space-2)}.table{min-width:var(--_table-min-width)}.table.zebra:not(.virtual) tbody tr:nth-child(odd) td{background-color:var(--_table-row-stripe-bg-color)}.table.zebra.virtual tbody tr.stripe td{background-color:var(--_table-row-stripe-bg-color)}.table.virtual{table-layout:fixed}.table.virtual tbody tr:not(.spacer){height:var(--_table-virtual-row-h)}.table.virtual tbody td{overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.table tbody tr.spacer{padding:0;border:0;background:none}.table tbody tr.spacer:hover td{background-color:transparent}.col-picker{display:grid;gap:var(--space-2);min-width:160px}.col-picker-row{display:flex;align-items:center;gap:var(--space-2)}.col-picker-row.cdk-drag-preview{background-color:var(--surface-default);border-radius:var(--ds-radius-inner);box-shadow:var(--shadow-popover);padding:var(--space-1) var(--space-2)}.col-picker-row.cdk-drag-placeholder{opacity:.4}.col-picker.cdk-drop-list-dragging .col-picker-row:not(.cdk-drag-placeholder){transition:transform var(--duration-fast) var(--ease-standard)}.col-drag{display:inline-flex;color:var(--icon-default);cursor:grab}.col-drag:active{cursor:grabbing}.col-picker-option{display:flex;align-items:center;gap:var(--space-2);flex:1;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);cursor:pointer}.col-picker-option:has(input:disabled){color:var(--text-tertiary);cursor:default}.col-width{display:inline-flex;gap:var(--space-1);align-items:center;margin-left:auto}.col-width-auto{width:auto;padding-inline:var(--space-2);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans)}.col-move{display:inline-flex;gap:var(--space-1)}.col-width-btn,.col-move-btn{display:inline-flex;padding:0;border:0;background:none;color:var(--icon-default);cursor:pointer}.col-width-btn:hover:not(:disabled),.col-move-btn:hover:not(:disabled){color:var(--icon-strong)}.col-width-btn:disabled,.col-move-btn:disabled{color:var(--text-disabled);cursor:default}.col-reset{margin-top:var(--space-1);padding:0;border:0;background:none;color:var(--accent);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;text-align:left}.col-reset:hover{text-decoration:underline}.col-filter-btn{display:inline-flex;margin-left:var(--space-1);padding:0;border:0;background:none;color:var(--icon-default);opacity:.5;cursor:pointer;vertical-align:middle;transition:color var(--duration-fast) var(--ease-standard),opacity var(--duration-fast) var(--ease-standard)}.col-filter-btn:hover{opacity:1;color:var(--icon-strong)}.col-filter-btn.active{opacity:1;color:var(--_table-sort-active-icon-color)}.col-filter{display:grid;gap:var(--space-2);min-width:180px}.col-filter-search{width:100%;box-sizing:border-box;padding:var(--space-1) var(--space-2);border:var(--border-width-default) solid var(--border-default);border-radius:var(--ds-radius-inner);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--surface-default)}.col-filter-search:focus-visible{outline:0;border-color:var(--accent)}.col-filter-list{display:grid;gap:var(--space-1);max-height:240px;overflow-y:auto}.col-filter-option{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);cursor:pointer}.col-filter-empty{color:var(--text-tertiary);font-size:var(--font-size-s);padding:var(--space-1) 0}.col-filter-footer{display:flex;align-items:center;justify-content:space-between;padding-top:var(--space-1);border-top:var(--border-width-default) solid var(--border-divider)}.col-filter-count{color:var(--text-tertiary);font-size:var(--font-size-xs)}.col-filter-footer .col-reset{margin-top:0}.editable-cell{cursor:text}.cell-edit{width:100%;box-sizing:border-box;margin:calc(-1 * var(--space-1)) 0;padding:var(--space-1) var(--space-2);border:var(--border-width-default) solid var(--accent);border-radius:var(--ds-radius-inner);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--surface-default)}.cell-edit:focus-visible{outline:0}.cell-text-pop{max-width:360px;overflow-wrap:anywhere;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary)}:host(.pinned){--_table-select-w: var(--ds-table-select-col-w, var(--space-10))}:host(.pinned) .table{border-collapse:separate;border-spacing:0}:host(.pinned) .table tbody td{box-shadow:none;border-bottom:var(--border-width-default) solid var(--_table-divider)}:host(.pinned) .table tbody tr:last-child td{border-bottom:0}:host(.pinned) .pin-select,:host(.pinned) .pin-first{position:sticky;left:0;z-index:var(--table-sticky-col-z);background-color:var(--_table-bg-color)}:host(.pinned) thead .pin-select,:host(.pinned) thead .pin-first{z-index:var(--table-sticky-corner-z);background-color:var(--_table-head-bg-color)}:host(.pinned) tbody tr.clickable:not(.active):hover .pin-first,:host(.pinned) tbody tr.clickable:not(.active):hover .pin-select{background-color:var(--_table-row-hover-bg-color)}:host(.pinned) tbody tr.selected .pin-first,:host(.pinned) tbody tr.selected .pin-select{background-color:var(--_table-row-selected-bg-color)}:host(.pinned) tbody tr.active .pin-first,:host(.pinned) tbody tr.active .pin-select{background-color:var(--_table-row-active-bg-color)}:host(.pinned) tbody tr.clickable:active .pin-first,:host(.pinned) tbody tr.clickable:active .pin-select{background-color:var(--_table-row-pressed-bg-color)}:host(.pinned.selectable) .pin-first{left:var(--_table-select-w)}:host(.pinned.expandable){--_table-expand-w: var(--ds-table-expand-col-w, var(--space-10))}:host(.pinned.expandable) .pin-expand{position:sticky;left:0;z-index:var(--table-sticky-col-z);background-color:var(--_table-bg-color)}:host(.pinned.expandable) thead .pin-expand{z-index:var(--table-sticky-corner-z);background-color:var(--_table-head-bg-color)}:host(.pinned.expandable) tbody tr.clickable:not(.active):hover .pin-expand{background-color:var(--_table-row-hover-bg-color)}:host(.pinned.expandable) tbody tr.selected .pin-expand{background-color:var(--_table-row-selected-bg-color)}:host(.pinned.expandable) tbody tr.active .pin-expand{background-color:var(--_table-row-active-bg-color)}:host(.pinned.expandable) tbody tr.clickable:active .pin-expand{background-color:var(--_table-row-pressed-bg-color)}:host(.pinned.expandable) .pin-first{left:var(--_table-expand-w)}:host(.pinned.selectable.expandable) .pin-expand{left:var(--_table-select-w)}:host(.pinned.selectable.expandable) .pin-first{left:calc(var(--_table-select-w) + var(--_table-expand-w))}.pagination-footer{padding:var(--space-3) var(--ds-table-cell-pad-x, var(--table-cell-pad-x)) var(--space-3);border-top:var(--border-width-default) solid var(--ds-table-divider, var(--border-divider))}.bulk-bar{position:sticky;bottom:var(--bulk-bar-offset);display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-4);background:var(--surface-inverted);color:var(--text-inverted);border-radius:var(--radius-lg);box-shadow:var(--shadow-toast);margin:var(--space-4) auto 0;width:fit-content}.bulk-bar .count{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans)}.bulk-bar .sep{width:var(--border-width-default);height:var(--space-4);background:var(--border-inverted)}.bulk-bar .button{background:transparent;color:var(--text-inverted)}.bulk-bar .button:hover{background:var(--surface-inverted-hover)}.table-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2);margin-bottom:var(--space-2)}.table-toolbar:not(:has(.toolbar-slot>*,>ds-button)){display:none}.toolbar-slot{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;gap:var(--space-2);min-width:0}.toolbar-slot ::ng-deep>:only-child{flex:1 1 auto;min-width:0}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ds-button", inputs: ["color", "variant", "size", "type", "disabled", "loading", "fullWidth", "ariaLabel", "icon", "trailingIcon", "ariaHasPopup", "ariaExpanded", "ariaControls", "disabledReason", "ariaDescribedBy"], outputs: ["pressed"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "component", type: PaginationComponent, selector: "ds-pagination", inputs: ["total", "pageSize", "currentPage", "pageSizeOptions", "showLabel", "showPageSize"], outputs: ["pageSizeChange", "currentPageChange"] }, { kind: "component", type: LoadingOverlayComponent, selector: "ds-loading-overlay", inputs: ["loading", "label", "blur", "spinnerSize", "insetTop", "inertContent"] }, { kind: "component", type: PopoverComponent, selector: "ds-popover", inputs: ["align", "placement", "arrow", "panelRole", "panelLabel"] }, { kind: "component", type: BottomSheetComponent, selector: "ds-bottom-sheet", inputs: ["open", "title", "snapPoints"], outputs: ["openChange", "closed"] }, { kind: "component", type: MenuComponent, selector: "ds-menu" }, { kind: "component", type: MenuItemComponent, selector: "ds-menu-item", inputs: ["icon", "disabled", "error", "quiet", "description", "submenu"], outputs: ["pressed"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type:
|
|
6556
7236
|
// Only instantiated when a column sets `link`, so a consumer app with no router
|
|
6557
7237
|
// provided still renders the table — the directive is never constructed.
|
|
6558
7238
|
RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
@@ -6567,6 +7247,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
6567
7247
|
PaginationComponent,
|
|
6568
7248
|
LoadingOverlayComponent,
|
|
6569
7249
|
PopoverComponent,
|
|
7250
|
+
BottomSheetComponent,
|
|
6570
7251
|
MenuComponent,
|
|
6571
7252
|
MenuItemComponent,
|
|
6572
7253
|
CdkDropList,
|
|
@@ -6582,8 +7263,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
6582
7263
|
'[class.expandable]': 'expandableRows()',
|
|
6583
7264
|
'[class.sticky-scrollbar]': 'stickyScrollbarResolved()',
|
|
6584
7265
|
'[class.resizable]': 'resizableColumns()',
|
|
6585
|
-
}, template: "<div class=\"table-toolbar\">\n <div class=\"toolbar-slot\">\n <ng-content select=\"[toolbar]\"></ng-content>\n </div>\n\n @if (exportButton()) {\n <ds-button\n color=\"neutral\"\n variant=\"outline\"\n size=\"sm\"\n [disabled]=\"exporting()\"\n (pressed)=\"runExport()\"\n >\n {{ exporting() ? 'Preparing\u2026' : 'Export CSV' }}\n </ds-button>\n }\n</div>\n\n<div\n #scrollWrap\n class=\"scroll-wrap\"\n [class.scroll-y]=\"maxHeight()\"\n [style.max-height]=\"maxHeight()\"\n>\n <div\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n >\n {{ statusMessage() }}\n </div>\n\n <ds-loading-overlay\n [loading]=\"isOverlayLoading()\"\n [blur]=\"true\"\n [insetTop]=\"'var(--ds-table-head-h, 40px)'\"\n >\n <table\n [class]=\"tableClasses()\"\n [style.--_table-virtual-row-h]=\"virtualRowHeight()\"\n [attr.role]=\"rowInteractive() ? 'grid' : null\"\n [attr.aria-busy]=\"loading() !== false ? 'true' : null\"\n >\n @if (caption()) {\n <caption class=\"visually-hidden\">\n {{\n caption()\n }}\n </caption>\n }\n\n <thead>\n <tr>\n @if (selectable()) {\n <th\n scope=\"col\"\n class=\"select-col pin-select\"\n >\n <input\n type=\"checkbox\"\n class=\"check\"\n [attr.aria-label]=\"selectAllLabel()\"\n [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (change)=\"onToggleAll($event)\"\n />\n </th>\n }\n\n @if (expandableRows()) {\n <th\n scope=\"col\"\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n </th>\n }\n\n @for (col of visibleColumns(); track col.key; let first = $first) {\n <th\n scope=\"col\"\n [class]=\"headerClasses(col)\"\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n [class.fit-content]=\"fitsContent(col)\"\n [style.width.px]=\"columnWidth(col)\"\n [style.min-width.px]=\"columnWidth(col)\"\n [style.max-width.px]=\"columnWidth(col)\"\n [attr.aria-sort]=\"ariaSort(col)\"\n [attr.data-col-key]=\"col.key\"\n (pointerenter)=\"onHeaderEnter($event, col)\"\n >\n @if (sortableCol(col)) {\n <button\n type=\"button\"\n class=\"th-label\"\n (click)=\"onSort(col)\"\n >\n @if (col.label) {\n {{ col.label }}\n } @else if (col.srLabel) {\n <span class=\"visually-hidden\">\n {{ col.srLabel }}\n </span>\n }\n\n <ds-icon\n class=\"sort-icon\"\n [name]=\"sortIcon(col)\"\n [size]=\"12\"\n >\n </ds-icon>\n </button>\n } @else {\n <span class=\"th-label\">\n @if (col.label) {\n {{ col.label }}\n } @else if (col.srLabel) {\n <span class=\"visually-hidden\">\n {{ col.srLabel }}\n </span>\n }\n </span>\n }\n\n @if (hasColumnFilter(col)) {\n <button\n type=\"button\"\n class=\"col-filter-btn\"\n aria-haspopup=\"dialog\"\n [class.active]=\"isColumnFiltered(col)\"\n [attr.aria-label]=\"'Filter ' + col.label\"\n (click)=\"onColumnFilterClick(col, $event)\"\n >\n <ds-icon\n name=\"filter\"\n [size]=\"12\"\n />\n </button>\n }\n\n @if (resizableColumns()) {\n <span\n class=\"col-resize\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + col.label\"\n [attr.aria-valuenow]=\"columnWidth(col)\"\n (pointerdown)=\"onResizeStart(col, $event)\"\n (pointermove)=\"onResizeMove($event)\"\n (pointerup)=\"onResizeEnd()\"\n (pointercancel)=\"onResizeEnd()\"\n (keydown)=\"onResizeKey(col, $event)\"\n >\n </span>\n }\n </th>\n }\n\n @if (hasUtilityColumn()) {\n <th\n scope=\"col\"\n class=\"actions-col\"\n >\n @if (hasColumnPicker()) {\n <button\n type=\"button\"\n class=\"col-picker-btn\"\n aria-haspopup=\"dialog\"\n aria-label=\"Choose columns\"\n [attr.aria-expanded]=\"columnPickerOpened()\"\n (click)=\"onColumnPickerClick($event)\"\n >\n <ds-icon\n name=\"grid\"\n [size]=\"14\"\n />\n </button>\n } @else {\n <span class=\"visually-hidden\">\n Actions\n </span>\n }\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @if (isSkeletonLoading()) {\n @for (_ of skeletonArray(); track $index; let rowIndex = $index) {\n <ng-container\n [ngTemplateOutlet]=\"skeletonRow\"\n [ngTemplateOutletContext]=\"{ $implicit: rowIndex }\"\n >\n </ng-container>\n }\n } @else if (showsEmptyRow()) {\n <tr>\n <td\n class=\"empty\"\n [attr.colspan]=\"expandedColspan()\"\n >\n @if (emptyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplate()!\">\n </ng-container>\n } @else {\n <ng-content select=\"[empty]\"></ng-content>\n }\n </td>\n </tr>\n } @else {\n @if (virtualWindow(); as window) {\n <tr\n class=\"spacer\"\n aria-hidden=\"true\"\n [style.height.px]=\"window.padTop\"\n >\n </tr>\n }\n\n @for (slot of rowSlots(); track slot.index) {\n @if (slot.row; as row) {\n <tr\n [class.selected]=\"isSelected(row)\"\n [class.expanded]=\"isExpanded(row)\"\n [class.clickable]=\"rowInteractive()\"\n [class.stripe]=\"isStriped(slot.index)\"\n [class.active]=\"rowKey(row) === activeRowId()\"\n [attr.aria-current]=\"\n rowKey(row) === activeRowId() ? 'true' : null\n \"\n [attr.tabindex]=\"rowInteractive() ? 0 : null\"\n [attr.aria-label]=\"rowInteractive() ? rowAriaLabel(row) : null\"\n (mousedown)=\"onRowMousedown()\"\n (click)=\"onRowClick(row, $event)\"\n (keydown.enter)=\"onRowKey(row, $event)\"\n (keydown.space)=\"onRowKey(row, $event)\"\n >\n @if (selectable()) {\n <td class=\"select-col pin-select\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [attr.aria-label]=\"'Select ' + rowAriaLabel(row)\"\n [checked]=\"isSelected(row)\"\n (change)=\"onToggleRow(row, $event)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n }\n\n @if (expandableRows()) {\n <td\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n <button\n type=\"button\"\n class=\"expand-btn\"\n [attr.aria-expanded]=\"isExpanded(row)\"\n [attr.aria-label]=\"\n isExpanded(row) ? 'Collapse row' : 'Expand row'\n \"\n (click)=\"onToggleExpand(row, $event)\"\n >\n <ds-icon\n class=\"expand-chev\"\n name=\"chevronRight\"\n [class.is-expanded]=\"isExpanded(row)\"\n [size]=\"16\"\n />\n </button>\n </td>\n }\n\n @for (\n col of visibleColumns();\n track col.key;\n let first = $first\n ) {\n <td\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n [class.editable-cell]=\"col.editable\"\n [class.interactive-cell]=\"col.interactive\"\n [class.fit-content]=\"fitsContent(col)\"\n (dblclick)=\"startEdit(row, col, $event)\"\n >\n @if (isEditing(row, col)) {\n <input\n #editInput\n type=\"text\"\n class=\"cell-edit\"\n [value]=\"editDraft()\"\n (input)=\"onEditInput($event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown.enter)=\"commitEdit(row, col)\"\n (keydown.escape)=\"cancelEdit()\"\n (blur)=\"commitEdit(row, col)\"\n />\n } @else if (cellTemplate(col); as tpl) {\n @if (col.truncate) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- same pointer-only enhancement as the plain truncate branch below; the value stays in the DOM for AT -->\n <span\n class=\"cell-clip\"\n [style.max-width.px]=\"clipWidth(col)\"\n [attr.title]=\"cellValue(row, col)\"\n (click)=\"onCellClipClick(row, col, $event)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row,\n row: row,\n }\"\n >\n </ng-container>\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row,\n row: row,\n }\"\n >\n </ng-container>\n }\n } @else if (col.truncate) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- pointer-only enhancement: the clip is visual (CSS ellipsis), keyboard/AT users already get the full DOM text + title; a tab stop per cell would wreck keyboard traversal -->\n <span\n class=\"cell-clip\"\n [style.max-width.px]=\"clipWidth(col)\"\n [attr.title]=\"cellValue(row, col)\"\n (click)=\"onCellClipClick(row, col, $event)\"\n >\n @if (cellLink(row, col); as target) {\n <a\n class=\"cell-link\"\n [routerLink]=\"target\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ cellValue(row, col) }}\n </a>\n } @else {\n {{ cellValue(row, col) }}\n }\n </span>\n } @else if (cellLink(row, col); as target) {\n <a\n class=\"cell-link\"\n [routerLink]=\"target\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ cellValue(row, col) }}\n </a>\n } @else {\n {{ cellValue(row, col) }}\n }\n </td>\n }\n\n @if (hasUtilityColumn()) {\n <td class=\"actions-col\">\n @if (hasRowActions() && hasActionsFor(row)) {\n <button\n type=\"button\"\n class=\"row-actions-btn\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"isMenuOpenFor(row)\"\n [attr.aria-label]=\"'Actions for ' + rowAriaLabel(row)\"\n (click)=\"onRowMenuClick(row, $event)\"\n (keydown.enter)=\"$event.stopPropagation()\"\n (keydown.space)=\"$event.stopPropagation()\"\n >\n <ds-icon\n name=\"moreV\"\n [size]=\"16\"\n />\n </button>\n }\n </td>\n }\n </tr>\n\n @if (\n expandableRows() &&\n isExpanded(row) &&\n rowExpandTemplate() &&\n !virtualizing()\n ) {\n <tr class=\"expand-panel-row\">\n <td\n class=\"expand-panel-cell\"\n [attr.colspan]=\"expandedColspan()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"rowExpandTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: row, row: row }\"\n >\n </ng-container>\n </td>\n </tr>\n }\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"skeletonRow\"\n [ngTemplateOutletContext]=\"{ $implicit: slot.index }\"\n >\n </ng-container>\n }\n }\n\n @if (virtualWindow(); as window) {\n <tr\n class=\"spacer\"\n aria-hidden=\"true\"\n [style.height.px]=\"window.padBottom\"\n >\n </tr>\n }\n }\n </tbody>\n </table>\n </ds-loading-overlay>\n</div>\n\n@if (stickyScrollbarResolved()) {\n <div\n #hscrollProxy\n class=\"hscroll-proxy\"\n aria-hidden=\"true\"\n [class.hscroll-hidden]=\"!hscrollNeeded()\"\n >\n <div\n class=\"hscroll-spacer\"\n [style.width.px]=\"hscrollContentWidth()\"\n >\n </div>\n </div>\n}\n\n@if (pageSize(); as size) {\n <div class=\"pagination-footer\">\n <ds-pagination\n [total]=\"total() ?? filteredData().length\"\n [pageSize]=\"size\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [showPageSize]=\"showPageSize()\"\n [showLabel]=\"showLabel()\"\n [(currentPage)]=\"page\"\n (pageSizeChange)=\"pageSize.set($event)\"\n />\n </div>\n}\n\n@if (hasTruncate()) {\n <ds-popover #cellTextPopover>\n <div class=\"cell-text-pop\">\n {{ cellPopoverText() }}\n </div>\n </ds-popover>\n}\n\n@if (filterColumn()) {\n <ds-popover\n #columnFilterPopover\n align=\"start\"\n panelRole=\"dialog\"\n panelLabel=\"Filter values\"\n >\n @if (headerFilterFor(filterColumn()!); as projected) {\n <div class=\"col-filter col-filter-custom\">\n <ng-container\n [ngTemplateOutlet]=\"projected.template\"\n [ngTemplateOutletContext]=\"headerFilterContext(filterColumn()!)\"\n />\n </div>\n } @else {\n <div class=\"col-filter\">\n <input\n type=\"text\"\n class=\"col-filter-search\"\n placeholder=\"Search\u2026\"\n [value]=\"filterSearch()\"\n (input)=\"onFilterSearch($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n\n <div class=\"col-filter-list\">\n @for (value of filterValues(); track value) {\n <label class=\"col-filter-option\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"isFilterValueChecked(value)\"\n (change)=\"toggleFilterValue(value)\"\n />\n {{ value || '(empty)' }}\n </label>\n } @empty {\n <div class=\"col-filter-empty\">\n No matches\n </div>\n }\n </div>\n\n <div class=\"col-filter-footer\">\n <span class=\"col-filter-count\">\n {{ filterSelectedCount() }} selected\n </span>\n\n <button\n type=\"button\"\n class=\"col-reset\"\n (click)=\"clearColumnFilter()\"\n >\n Clear\n </button>\n </div>\n </div>\n }\n </ds-popover>\n}\n\n@if (hasColumnPicker()) {\n <ds-popover\n #columnPickerPopover\n align=\"end\"\n panelRole=\"dialog\"\n panelLabel=\"Column visibility\"\n >\n <div\n class=\"col-picker\"\n cdkDropList\n (cdkDropListDropped)=\"onColumnDrop($event)\"\n >\n @for (\n col of orderedColumns();\n track col.key;\n let first = $first;\n let last = $last\n ) {\n <div\n class=\"col-picker-row\"\n cdkDrag\n [cdkDragDisabled]=\"!reorderableColumns()\"\n >\n @if (reorderableColumns()) {\n <span\n class=\"col-drag\"\n cdkDragHandle\n aria-hidden=\"true\"\n >\n <ds-icon\n name=\"drag\"\n [size]=\"14\"\n />\n </span>\n }\n\n <label class=\"col-picker-option\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"isColumnVisible(col)\"\n [disabled]=\"!col.hideable || isColumnLocked(col)\"\n (change)=\"toggleColumn(col)\"\n />\n {{ col.label }}\n </label>\n\n @if (reorderableColumns()) {\n <span class=\"col-move\">\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move up\"\n [disabled]=\"first\"\n (click)=\"moveColumn(col, -1)\"\n >\n <ds-icon\n name=\"chevronUp\"\n [size]=\"14\"\n />\n </button>\n\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move down\"\n [disabled]=\"last\"\n (click)=\"moveColumn(col, 1)\"\n >\n <ds-icon\n name=\"chevronDown\"\n [size]=\"14\"\n />\n </button>\n </span>\n }\n </div>\n }\n\n <button\n type=\"button\"\n class=\"col-reset\"\n (click)=\"resetColumns()\"\n >\n Reset to default\n </button>\n </div>\n </ds-popover>\n}\n\n@if (hasRowActions()) {\n <ds-popover\n #rowMenuPopover\n align=\"end\"\n >\n <ds-menu>\n @for (action of visibleRowActions(); track action.id) {\n <ds-menu-item\n [icon]=\"action.icon ?? null\"\n [error]=\"action.error ?? false\"\n [disabled]=\"isActionDisabled(action)\"\n [description]=\"actionReason(action)\"\n (pressed)=\"onRowAction(action)\"\n >\n {{ action.label }}\n </ds-menu-item>\n }\n </ds-menu>\n </ds-popover>\n}\n\n@if (selectable() && someSelected()) {\n <div class=\"bulk-bar\">\n <span class=\"count\">\n {{ selectedIds().size }} selected\n </span>\n\n <span class=\"sep\"></span>\n\n <ng-content select=\"[bulk-actions]\"></ng-content>\n </div>\n}\n\n<!-- One skeleton row, shared by loading=\"skeleton\" and the gaps a lazy\n window has not filled yet. `$implicit` is the row's index: skeletonWidth\n varies the bar lengths from it, so a block of them does not read as a grid. -->\n<ng-template\n #skeletonRow\n let-rowIndex\n>\n <tr>\n @if (selectable()) {\n <td class=\"select-col pin-select\">\n <ds-skeleton\n width=\"14px\"\n height=\"14px\"\n [inline]=\"true\"\n />\n </td>\n }\n\n @if (expandableRows()) {\n <td\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n </td>\n }\n\n @for (col of visibleColumns(); track col.key; let first = $first) {\n <td\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n >\n <ds-skeleton\n height=\"14px\"\n [width]=\"skeletonWidth(col, rowIndex)\"\n [inline]=\"true\"\n />\n </td>\n }\n\n @if (hasUtilityColumn()) {\n <td class=\"actions-col\"></td>\n }\n </tr>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:block;position:relative}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.bordered) .scroll-wrap{border:var(--border-width-default) solid var(--_table-border);border-radius:var(--_table-radius)}.scroll-wrap{--_table-border: var(--ds-table-border, var(--border-default));--_table-radius: var(--ds-table-radius, var(--ds-radius-control));--_table-bg-color: var(--ds-table-bg-color, var(--surface-default));width:100%;overflow:auto hidden;-webkit-overflow-scrolling:touch;background:var(--surface-default);box-sizing:border-box}.scroll-wrap.scroll-y{overflow-y:auto}:host(.sticky-scrollbar) .scroll-wrap{scrollbar-width:none}:host(.sticky-scrollbar) .scroll-wrap::-webkit-scrollbar{display:none}:host(.resizable) thead th{position:relative;overflow:hidden}.col-resize{position:absolute;inset-block:0;right:0;width:var(--space-2);cursor:col-resize;touch-action:none;-webkit-user-select:none;user-select:none}.col-resize:after{content:\"\";position:absolute;inset-block:var(--space-2);right:0;width:var(--border-width-default);background-color:transparent;transition:background-color var(--duration-fast) var(--ease-standard)}.col-resize:hover:after,.col-resize:active:after,.col-resize:focus-visible:after{background-color:var(--_table-sort-active-icon-color)}.col-resize:focus-visible{outline:none}.col-resize:focus-visible:after{width:var(--border-width-strong)}.hscroll-proxy{position:sticky;bottom:var(--ds-table-hscroll-bottom, 0);overflow:auto hidden}.hscroll-spacer{height:1px}.hscroll-hidden{display:none}.table{--_table-min-width: var(--ds-table-min-width, 0);--_table-bg-color: var(--ds-table-bg-color, var(--surface-default));--_table-row-hover-bg-color: var(--ds-table-row-hover-bg-color, var(--surface-secondary));--_table-row-selected-bg-color: var(--ds-table-row-selected-bg-color, var(--accent-subtitle));--_table-row-pressed-bg-color: var(--ds-table-row-pressed-bg-color, var(--surface-muted));--_table-row-active-bg-color: var(--ds-table-row-active-bg-color, var(--accent-subtitle));--_table-row-stripe-bg-color: var(--ds-table-row-stripe-bg-color, var(--surface-secondary));--_table-cell-link-color: var(--ds-table-cell-link-color, var(--accent));--_table-cell-link-decoration: var(--ds-table-cell-link-decoration, underline);--_table-head-text-color: var(--ds-table-head-text-color, var(--text-secondary));--_table-head-bg-color: var(--ds-table-head-bg-color, var(--surface-secondary));--_table-head-fs: var(--ds-table-head-fs, var(--font-size-xs));--_table-divider: var(--ds-table-divider, var(--border-divider));--_table-sort-active-icon-color: var(--ds-table-sort-active-icon-color, var(--accent));--_table-icon-btn-color: var(--ds-table-icon-btn-color, var(--icon-default));--_table-icon-btn-color-hover: var(--ds-table-icon-btn-color-hover, var(--icon-strong));--_table-icon-btn-focus-color: var(--ds-table-icon-btn-focus-color, var(--accent));--_table-cell-pad-x: var(--ds-table-cell-pad-x, var(--table-cell-pad-x));--_table-cell-pad-y: var(--ds-table-cell-pad-y, var(--table-cell-pad-y));--_table-cell-pad-top: var(--ds-table-cell-pad-top, var(--_table-cell-pad-y));--_table-cell-pad-right: var(--ds-table-cell-pad-right, var(--_table-cell-pad-x));--_table-cell-pad-bottom: var(--ds-table-cell-pad-bottom, var(--_table-cell-pad-y));--_table-cell-pad-left: var(--ds-table-cell-pad-left, var(--_table-cell-pad-x));--_table-head-pad-top: var(--ds-table-head-pad-top, var(--table-head-pad-y));--_table-head-pad-bottom: var(--ds-table-head-pad-bottom, var(--table-head-pad-y));--_table-head-border-color: var(--ds-table-head-border-color, var(--_table-divider));--_table-head-weight: var(--ds-table-head-weight, var(--font-weight-bold));--_table-head-tracking: var(--ds-table-head-tracking, var(--letter-spacing-wider));width:100%;border-collapse:collapse;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--_table-bg-color)}.table th.fit-content,.table td.fit-content{width:1%;white-space:nowrap}.table thead th{text-align:left;padding:var(--_table-head-pad-top) var(--_table-cell-pad-right) var(--_table-head-pad-bottom) var(--_table-cell-pad-left);font:var(--_table-head-weight) var(--_table-head-fs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--_table-head-tracking);text-transform:uppercase;color:var(--_table-head-text-color);background-color:var(--_table-head-bg-color);border-bottom:var(--border-width-default) solid var(--_table-head-border-color);white-space:nowrap}.table thead th .th-label{display:inline-flex;align-items:center;vertical-align:middle;appearance:none;background:none;border:0;margin:0;padding:0;font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;text-align:left}.table thead th button.th-label{cursor:pointer;-webkit-user-select:none;user-select:none;transition:color var(--duration-fast) var(--ease-standard)}.table thead th button.th-label:hover{color:var(--text-secondary)}.table thead th button.th-label:focus-visible{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:var(--focus-ring-offset);border-radius:var(--radius-sm)}.table thead th .sort-icon{display:inline-block;width:var(--sort-ic-size);height:var(--sort-ic-size);margin-left:var(--sort-ic-gap);vertical-align:middle;transform:translateY(-1px);color:var(--icon-default);opacity:var(--sort-ic-opacity-idle);transition:opacity var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.table thead th .sort-icon .icon{width:var(--sort-ic-size);height:var(--sort-ic-size);display:block}.table thead th.sorted-asc .sort-icon,.table thead th.sorted-desc .sort-icon{opacity:1;color:var(--_table-sort-active-icon-color)}.table thead th.numeric{text-align:right}.table thead th.select-col,.table thead th.expand-col,.table thead th.actions-col{width:var(--space-10)}.table.sticky-header thead th{position:sticky;top:0}.table.sticky-header thead th:not(.pin-select,.pin-first,.pin-expand){z-index:var(--table-sticky-header-z)}.table tbody td{padding:var(--_table-cell-pad-top) var(--_table-cell-pad-right) var(--_table-cell-pad-bottom) var(--_table-cell-pad-left);line-height:var(--line-height-flat);transition:background-color var(--duration-fast) var(--ease-standard);box-shadow:inset 0 calc(-1 * var(--border-width-default)) 0 var(--_table-divider);vertical-align:middle}.table tbody td.numeric{text-align:right}.table tbody td.empty{text-align:center;color:var(--text-tertiary);padding:var(--space-4)}.table tbody tr:last-child td{box-shadow:none}.table tbody tr.clickable:not(.active):hover td{background-color:var(--_table-row-hover-bg-color)}.table tbody tr.clickable:hover td.interactive-cell,.table tbody tr td .cell-link{color:var(--_table-cell-link-color);text-decoration:var(--_table-cell-link-decoration)}.table tbody tr.selected td{background-color:var(--_table-row-selected-bg-color)}.table tbody tr.active td{background-color:var(--_table-row-active-bg-color)}.table tbody tr.clickable:active td{background-color:var(--_table-row-pressed-bg-color)}.table tbody tr.clickable{cursor:pointer}.table tbody tr.clickable:focus-visible{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:-2px}.table tbody .expand-col,.table tbody .actions-col{width:var(--space-10)}.table tbody .expand-chev{display:block;transition:transform var(--duration-base) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.table tbody .expand-chev{transition:none}}.table tbody .expand-chev.is-expanded{transform:rotate(90deg)}.table tbody .expand-panel-cell{padding:var(--_table-cell-pad-top) var(--_table-cell-pad-right) var(--_table-cell-pad-bottom) var(--_table-cell-pad-left)}.table tbody .cell-clip{display:block;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.table .expand-btn,.table .row-actions-btn,.table .col-picker-btn{display:flex;align-items:center;justify-content:center;width:var(--space-6);height:var(--space-6);padding:0;border:0;background:none;cursor:pointer;color:var(--_table-icon-btn-color);border-radius:var(--ds-radius-inner);transition:color var(--duration-fast) var(--ease-standard)}.table .expand-btn:hover,.table .row-actions-btn:hover,.table .col-picker-btn:hover{color:var(--_table-icon-btn-color-hover)}.table .expand-btn:focus-visible,.table .row-actions-btn:focus-visible,.table .col-picker-btn:focus-visible{outline:var(--border-width-strong, 2px) solid var(--_table-icon-btn-focus-color);outline-offset:var(--focus-ring-offset)}.table.compact{--table-cell-pad-x: var(--space-3);--table-cell-pad-y: var(--space-2);--table-head-pad-y: var(--space-2)}.table{min-width:var(--_table-min-width)}.table.zebra:not(.virtual) tbody tr:nth-child(odd) td{background-color:var(--_table-row-stripe-bg-color)}.table.zebra.virtual tbody tr.stripe td{background-color:var(--_table-row-stripe-bg-color)}.table.virtual{table-layout:fixed}.table.virtual tbody tr:not(.spacer){height:var(--_table-virtual-row-h)}.table.virtual tbody td{overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.table tbody tr.spacer{padding:0;border:0;background:none}.table tbody tr.spacer:hover td{background-color:transparent}.col-picker{display:grid;gap:var(--space-2);min-width:160px}.col-picker-row{display:flex;align-items:center;gap:var(--space-2)}.col-picker-row.cdk-drag-preview{background-color:var(--surface-default);border-radius:var(--ds-radius-inner);box-shadow:var(--shadow-popover);padding:var(--space-1) var(--space-2)}.col-picker-row.cdk-drag-placeholder{opacity:.4}.col-picker.cdk-drop-list-dragging .col-picker-row:not(.cdk-drag-placeholder){transition:transform var(--duration-fast) var(--ease-standard)}.col-drag{display:inline-flex;color:var(--icon-default);cursor:grab}.col-drag:active{cursor:grabbing}.col-picker-option{display:flex;align-items:center;gap:var(--space-2);flex:1;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);cursor:pointer}.col-picker-option:has(input:disabled){color:var(--text-tertiary);cursor:default}.col-move{display:inline-flex;gap:var(--space-1)}.col-move-btn{display:inline-flex;padding:0;border:0;background:none;color:var(--icon-default);cursor:pointer}.col-move-btn:hover:not(:disabled){color:var(--icon-strong)}.col-move-btn:disabled{color:var(--text-disabled);cursor:default}.col-reset{margin-top:var(--space-1);padding:0;border:0;background:none;color:var(--accent);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;text-align:left}.col-reset:hover{text-decoration:underline}.col-filter-btn{display:inline-flex;margin-left:var(--space-1);padding:0;border:0;background:none;color:var(--icon-default);opacity:.5;cursor:pointer;vertical-align:middle;transition:color var(--duration-fast) var(--ease-standard),opacity var(--duration-fast) var(--ease-standard)}.col-filter-btn:hover{opacity:1;color:var(--icon-strong)}.col-filter-btn.active{opacity:1;color:var(--_table-sort-active-icon-color)}.col-filter{display:grid;gap:var(--space-2);min-width:180px}.col-filter-search{width:100%;box-sizing:border-box;padding:var(--space-1) var(--space-2);border:var(--border-width-default) solid var(--border-default);border-radius:var(--ds-radius-inner);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--surface-default)}.col-filter-search:focus-visible{outline:0;border-color:var(--accent)}.col-filter-list{display:grid;gap:var(--space-1);max-height:240px;overflow-y:auto}.col-filter-option{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);cursor:pointer}.col-filter-empty{color:var(--text-tertiary);font-size:var(--font-size-s);padding:var(--space-1) 0}.col-filter-footer{display:flex;align-items:center;justify-content:space-between;padding-top:var(--space-1);border-top:var(--border-width-default) solid var(--border-divider)}.col-filter-count{color:var(--text-tertiary);font-size:var(--font-size-xs)}.col-filter-footer .col-reset{margin-top:0}.editable-cell{cursor:text}.cell-edit{width:100%;box-sizing:border-box;margin:calc(-1 * var(--space-1)) 0;padding:var(--space-1) var(--space-2);border:var(--border-width-default) solid var(--accent);border-radius:var(--ds-radius-inner);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--surface-default)}.cell-edit:focus-visible{outline:0}.cell-text-pop{max-width:360px;overflow-wrap:anywhere;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary)}:host(.pinned){--_table-select-w: var(--ds-table-select-col-w, var(--space-10))}:host(.pinned) .table{border-collapse:separate;border-spacing:0}:host(.pinned) .table tbody td{box-shadow:none;border-bottom:var(--border-width-default) solid var(--_table-divider)}:host(.pinned) .table tbody tr:last-child td{border-bottom:0}:host(.pinned) .pin-select,:host(.pinned) .pin-first{position:sticky;left:0;z-index:var(--table-sticky-col-z);background-color:var(--_table-bg-color)}:host(.pinned) thead .pin-select,:host(.pinned) thead .pin-first{z-index:var(--table-sticky-corner-z);background-color:var(--_table-head-bg-color)}:host(.pinned) tbody tr.clickable:not(.active):hover .pin-first,:host(.pinned) tbody tr.clickable:not(.active):hover .pin-select{background-color:var(--_table-row-hover-bg-color)}:host(.pinned) tbody tr.selected .pin-first,:host(.pinned) tbody tr.selected .pin-select{background-color:var(--_table-row-selected-bg-color)}:host(.pinned) tbody tr.active .pin-first,:host(.pinned) tbody tr.active .pin-select{background-color:var(--_table-row-active-bg-color)}:host(.pinned) tbody tr.clickable:active .pin-first,:host(.pinned) tbody tr.clickable:active .pin-select{background-color:var(--_table-row-pressed-bg-color)}:host(.pinned.selectable) .pin-first{left:var(--_table-select-w)}:host(.pinned.expandable){--_table-expand-w: var(--ds-table-expand-col-w, var(--space-10))}:host(.pinned.expandable) .pin-expand{position:sticky;left:0;z-index:var(--table-sticky-col-z);background-color:var(--_table-bg-color)}:host(.pinned.expandable) thead .pin-expand{z-index:var(--table-sticky-corner-z);background-color:var(--_table-head-bg-color)}:host(.pinned.expandable) tbody tr.clickable:not(.active):hover .pin-expand{background-color:var(--_table-row-hover-bg-color)}:host(.pinned.expandable) tbody tr.selected .pin-expand{background-color:var(--_table-row-selected-bg-color)}:host(.pinned.expandable) tbody tr.active .pin-expand{background-color:var(--_table-row-active-bg-color)}:host(.pinned.expandable) tbody tr.clickable:active .pin-expand{background-color:var(--_table-row-pressed-bg-color)}:host(.pinned.expandable) .pin-first{left:var(--_table-expand-w)}:host(.pinned.selectable.expandable) .pin-expand{left:var(--_table-select-w)}:host(.pinned.selectable.expandable) .pin-first{left:calc(var(--_table-select-w) + var(--_table-expand-w))}.pagination-footer{padding:var(--space-3) var(--ds-table-cell-pad-x, var(--table-cell-pad-x)) var(--space-3);border-top:var(--border-width-default) solid var(--ds-table-divider, var(--border-divider))}.bulk-bar{position:sticky;bottom:var(--bulk-bar-offset);display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-4);background:var(--surface-inverted);color:var(--text-inverted);border-radius:var(--radius-lg);box-shadow:var(--shadow-toast);margin:var(--space-4) auto 0;width:fit-content}.bulk-bar .count{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans)}.bulk-bar .sep{width:var(--border-width-default);height:var(--space-4);background:var(--border-inverted)}.bulk-bar .button{background:transparent;color:var(--text-inverted)}.bulk-bar .button:hover{background:var(--surface-inverted-hover)}.table-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2);margin-bottom:var(--space-2)}.table-toolbar:not(:has(.toolbar-slot>*,>ds-button)){display:none}.toolbar-slot{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;gap:var(--space-2);min-width:0}.toolbar-slot ::ng-deep>:only-child{flex:1 1 auto;min-width:0}\n"] }]
|
|
6586
|
-
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], rowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowId", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], bordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "bordered", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], stickyHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyHeader", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], zebra: [{ type: i0.Input, args: [{ isSignal: true, alias: "zebra", required: false }] }], animateHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "animateHeight", required: false }] }], selectedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIds", required: false }] }, { type: i0.Output, args: ["selectedIdsChange"] }], sortKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortKey", required: false }] }], sortKeyChange: [{ type: i0.Output, args: ["sortKeyChange"] }], sortDir: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDir", required: false }] }], sortDirChange: [{ type: i0.Output, args: ["sortDirChange"] }], sortingOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortingOrder", required: false }] }], sortAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortAnnouncement", required: false }] }], rangeAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeAnnouncement", required: false }] }], skeletonRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonRows", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], rowInteractive: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowInteractive", required: false }] }], activeRowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeRowId", required: false }] }], filterQuery: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterQuery", required: false }] }], columnFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilters", required: false }] }, { type: i0.Output, args: ["columnFiltersChange"] }], hiddenKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenKeys", required: false }] }, { type: i0.Output, args: ["hiddenKeysChange"] }], resizableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizableColumns", required: false }] }], columnWidths: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnWidths", required: false }] }, { type: i0.Output, args: ["columnWidthsChange"] }], reorderableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderableColumns", required: false }] }], columnOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnOrder", required: false }] }, { type: i0.Output, args: ["columnOrderChange"] }], persistLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "persistLayout", required: false }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], exportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButton", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], exportFetcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFetcher", required: false }] }], exportFailed: [{ type: i0.Output, args: ["exportFailed"] }], stickyScrollbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyScrollbar", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSize", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], scrollToTopOnPageChange: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollToTopOnPageChange", required: false }] }], sortMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortMode", required: false }] }], filterMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMode", required: false }] }], columnFilterOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilterOptions", required: false }] }], stickyFirstColumn: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyFirstColumn", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], virtualRowSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualRowSize", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], rowActionSelected: [{ type: i0.Output, args: ["rowActionSelected"] }], cellEdited: [{ type: i0.Output, args: ["cellEdited"] }], cellTemplateMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellTemplateMap", required: false }] }], emptyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTemplate", required: false }] }], expandableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandableRows", required: false }] }], expandedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIds", required: false }] }, { type: i0.Output, args: ["expandedIdsChange"] }], rowExpandTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowExpandTemplate", required: false }] }], cellTemplateDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CellTemplateDirective), { isSignal: true }] }], columnFilterPopover: [{ type: i0.ViewChild, args: ['columnFilterPopover', { isSignal: true }] }], headerFilters: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => HeaderFilterDirective), { isSignal: true }] }], editInput: [{ type: i0.ViewChild, args: ['editInput', { isSignal: true }] }], rowMenuPopover: [{ type: i0.ViewChild, args: ['rowMenuPopover', { isSignal: true }] }], columnPickerPopover: [{ type: i0.ViewChild, args: ['columnPickerPopover', { isSignal: true }] }], cellTextPopover: [{ type: i0.ViewChild, args: ['cellTextPopover', { isSignal: true }] }], scrollWrap: [{ type: i0.ViewChild, args: ['scrollWrap', { isSignal: true }] }], hscrollProxy: [{ type: i0.ViewChild, args: ['hscrollProxy', { isSignal: true }] }] } });
|
|
7266
|
+
}, template: "<div class=\"table-toolbar\">\n <div class=\"toolbar-slot\">\n <ng-content select=\"[toolbar]\"></ng-content>\n </div>\n\n @if (exportButton()) {\n <ds-button\n color=\"neutral\"\n variant=\"outline\"\n size=\"sm\"\n [disabled]=\"exporting()\"\n (pressed)=\"runExport()\"\n >\n {{ exporting() ? 'Preparing\u2026' : 'Export CSV' }}\n </ds-button>\n }\n</div>\n\n<!-- Wraps the SCROLL CONTAINER, not the table inside it: the scrim is\n `position: absolute; inset: 0`, so from in there it is sized to one viewport of\n the table and scrolls away with the content. -->\n<ds-loading-overlay\n [loading]=\"isOverlayLoading()\"\n [blur]=\"true\"\n [insetTop]=\"'var(--ds-table-head-h, 40px)'\"\n [inertContent]=\"false\"\n>\n <div\n #scrollWrap\n class=\"scroll-wrap\"\n [class.scroll-y]=\"maxHeight()\"\n [style.max-height]=\"maxHeight()\"\n >\n <div\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n >\n {{ statusMessage() }}\n </div>\n\n <table\n [class]=\"tableClasses()\"\n [style.--_table-virtual-row-h]=\"virtualRowHeight()\"\n [attr.role]=\"rowInteractive() ? 'grid' : null\"\n [attr.aria-busy]=\"loading() !== false ? 'true' : null\"\n >\n @if (caption()) {\n <caption class=\"visually-hidden\">\n {{\n caption()\n }}\n </caption>\n }\n\n <thead>\n <tr>\n @if (selectable()) {\n <th\n scope=\"col\"\n class=\"select-col pin-select\"\n >\n <input\n type=\"checkbox\"\n class=\"check\"\n [attr.aria-label]=\"selectAllLabel()\"\n [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (change)=\"onToggleAll($event)\"\n />\n </th>\n }\n\n @if (expandableRows()) {\n <th\n scope=\"col\"\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n @if (expandAllVisible()) {\n <button\n type=\"button\"\n class=\"expand-btn\"\n [attr.aria-label]=\"expandAllLabel()\"\n (click)=\"onToggleExpandAll()\"\n >\n <ds-icon\n class=\"expand-chev\"\n name=\"chevronRight\"\n [class.is-expanded]=\"allExpanded()\"\n [size]=\"16\"\n />\n </button>\n }\n </th>\n }\n\n @for (col of visibleColumns(); track col.key; let first = $first) {\n <th\n scope=\"col\"\n [class]=\"headerClasses(col)\"\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n [class.fit-content]=\"fitsContent(col)\"\n [style.width.px]=\"columnWidth(col)\"\n [style.min-width.px]=\"columnWidth(col)\"\n [style.max-width.px]=\"columnWidth(col)\"\n [attr.aria-sort]=\"ariaSort(col)\"\n [attr.data-col-key]=\"col.key\"\n (pointerenter)=\"onHeaderEnter($event, col)\"\n >\n @if (sortableCol(col)) {\n <button\n type=\"button\"\n class=\"th-label\"\n (click)=\"onSort(col)\"\n >\n @if (col.label) {\n {{ col.label }}\n } @else if (col.srLabel) {\n <span class=\"visually-hidden\">\n {{ col.srLabel }}\n </span>\n }\n\n <ds-icon\n class=\"sort-icon\"\n [name]=\"sortIcon(col)\"\n [size]=\"12\"\n >\n </ds-icon>\n </button>\n } @else {\n <span class=\"th-label\">\n @if (col.label) {\n {{ col.label }}\n } @else if (col.srLabel) {\n <span class=\"visually-hidden\">\n {{ col.srLabel }}\n </span>\n }\n </span>\n }\n\n @if (hasColumnFilter(col)) {\n <button\n type=\"button\"\n class=\"col-filter-btn\"\n aria-haspopup=\"dialog\"\n [class.active]=\"isColumnFiltered(col)\"\n [attr.aria-label]=\"'Filter ' + col.label\"\n (click)=\"onColumnFilterClick(col, $event)\"\n >\n <ds-icon\n name=\"filter\"\n [size]=\"12\"\n />\n </button>\n }\n\n @if (resizableColumns()) {\n @let range = resizeRange(col);\n\n <span\n class=\"col-resize\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + col.label\"\n [attr.aria-valuenow]=\"range?.now ?? null\"\n [attr.aria-valuemin]=\"range?.min ?? null\"\n [attr.aria-valuemax]=\"range?.max ?? null\"\n (focus)=\"onResizeFocus(col, $event)\"\n (blur)=\"onResizeBlur()\"\n (pointerdown)=\"onResizeStart(col, $event)\"\n (pointermove)=\"onResizeMove($event)\"\n (pointerup)=\"onResizeEnd()\"\n (pointercancel)=\"onResizeEnd()\"\n (keydown)=\"onResizeKey(col, $event)\"\n >\n </span>\n }\n </th>\n }\n\n @if (hasUtilityColumn()) {\n <th\n scope=\"col\"\n class=\"actions-col\"\n >\n @if (hasColumnPicker()) {\n <button\n type=\"button\"\n class=\"col-picker-btn\"\n aria-haspopup=\"dialog\"\n aria-label=\"Choose columns\"\n [attr.aria-expanded]=\"columnPickerOpened()\"\n (click)=\"onColumnPickerClick($event)\"\n >\n <ds-icon\n name=\"grid\"\n [size]=\"14\"\n />\n </button>\n } @else {\n <span class=\"visually-hidden\">\n Actions\n </span>\n }\n </th>\n }\n </tr>\n </thead>\n\n <!-- Matches what the scrim covers, which is everything below the header:\n a row keeps its tabindex and its Enter handler otherwise, so a keyboard\n user could open a row whose data is mid-replacement while the pointer\n was stopped by the scrim. The header stays live on purpose \u2014 re-sorting\n is what puts the scrim up in the first place. -->\n <tbody [attr.inert]=\"isOverlayLoading() ? '' : null\">\n @if (isSkeletonLoading()) {\n @for (_ of skeletonArray(); track $index; let rowIndex = $index) {\n <ng-container\n [ngTemplateOutlet]=\"skeletonRow\"\n [ngTemplateOutletContext]=\"{ $implicit: rowIndex }\"\n >\n </ng-container>\n }\n } @else if (showsEmptyRow()) {\n <tr>\n <td\n class=\"empty\"\n [attr.colspan]=\"expandedColspan()\"\n >\n @if (emptyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplate()!\">\n </ng-container>\n } @else {\n <ng-content select=\"[empty]\"></ng-content>\n }\n </td>\n </tr>\n } @else {\n @if (virtualWindow(); as window) {\n <tr\n class=\"spacer\"\n aria-hidden=\"true\"\n [style.height.px]=\"window.padTop\"\n >\n </tr>\n }\n\n @for (slot of rowSlots(); track slot.index) {\n @if (slot.row; as row) {\n <tr\n [class.selected]=\"isSelected(row)\"\n [class.expanded]=\"isExpanded(row)\"\n [class.clickable]=\"rowInteractive()\"\n [class.stripe]=\"isStriped(slot.index)\"\n [class.active]=\"rowKey(row) === activeRowId()\"\n [attr.aria-current]=\"\n rowKey(row) === activeRowId() ? 'true' : null\n \"\n [attr.tabindex]=\"rowInteractive() ? 0 : null\"\n [attr.aria-label]=\"rowInteractive() ? rowAriaLabel(row) : null\"\n (mousedown)=\"onRowMousedown()\"\n (click)=\"onRowClick(row, $event)\"\n (keydown.enter)=\"onRowKey(row, $event)\"\n (keydown.space)=\"onRowKey(row, $event)\"\n >\n @if (selectable()) {\n <td class=\"select-col pin-select\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [attr.aria-label]=\"'Select ' + rowAriaLabel(row)\"\n [checked]=\"isSelected(row)\"\n (change)=\"onToggleRow(row, $event)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n }\n\n @if (expandableRows()) {\n <td\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n <button\n type=\"button\"\n class=\"expand-btn\"\n [attr.aria-expanded]=\"isExpanded(row)\"\n [attr.aria-label]=\"\n isExpanded(row) ? 'Collapse row' : 'Expand row'\n \"\n (click)=\"onToggleExpand(row, $event)\"\n >\n <ds-icon\n class=\"expand-chev\"\n name=\"chevronRight\"\n [class.is-expanded]=\"isExpanded(row)\"\n [size]=\"16\"\n />\n </button>\n </td>\n }\n\n @for (\n col of visibleColumns();\n track col.key;\n let first = $first\n ) {\n <td\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n [class.editable-cell]=\"col.editable\"\n [class.interactive-cell]=\"col.interactive\"\n [class.fit-content]=\"fitsContent(col)\"\n (dblclick)=\"startEdit(row, col, $event)\"\n >\n @if (isEditing(row, col)) {\n <input\n #editInput\n type=\"text\"\n class=\"cell-edit\"\n [value]=\"editDraft()\"\n (input)=\"onEditInput($event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown.enter)=\"commitEdit(row, col)\"\n (keydown.escape)=\"cancelEdit()\"\n (blur)=\"commitEdit(row, col)\"\n />\n } @else if (cellTemplate(col); as tpl) {\n @if (col.truncate) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- same pointer-only enhancement as the plain truncate branch below; the value stays in the DOM for AT -->\n <span\n class=\"cell-clip\"\n [style.max-width.px]=\"clipWidth(col)\"\n [attr.title]=\"cellValue(row, col)\"\n (click)=\"onCellClipClick(row, col, $event)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row,\n row: row,\n }\"\n >\n </ng-container>\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row,\n row: row,\n }\"\n >\n </ng-container>\n }\n } @else if (col.truncate) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- pointer-only enhancement: the clip is visual (CSS ellipsis), keyboard/AT users already get the full DOM text + title; a tab stop per cell would wreck keyboard traversal -->\n <span\n class=\"cell-clip\"\n [style.max-width.px]=\"clipWidth(col)\"\n [attr.title]=\"cellValue(row, col)\"\n (click)=\"onCellClipClick(row, col, $event)\"\n >\n @if (cellLink(row, col); as target) {\n <a\n class=\"cell-link\"\n [routerLink]=\"target\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ cellValue(row, col) }}\n </a>\n } @else {\n {{ cellValue(row, col) }}\n }\n </span>\n } @else if (cellLink(row, col); as target) {\n <a\n class=\"cell-link\"\n [routerLink]=\"target\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ cellValue(row, col) }}\n </a>\n } @else {\n {{ cellValue(row, col) }}\n }\n </td>\n }\n\n @if (hasUtilityColumn()) {\n <td class=\"actions-col\">\n @if (hasRowActions() && hasActionsFor(row)) {\n <button\n type=\"button\"\n class=\"row-actions-btn\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"isMenuOpenFor(row)\"\n [attr.aria-label]=\"'Actions for ' + rowAriaLabel(row)\"\n (click)=\"onRowMenuClick(row, $event)\"\n (keydown.enter)=\"$event.stopPropagation()\"\n (keydown.space)=\"$event.stopPropagation()\"\n >\n <ds-icon\n name=\"moreV\"\n [size]=\"16\"\n />\n </button>\n }\n </td>\n }\n </tr>\n\n @if (\n expandableRows() &&\n isExpanded(row) &&\n rowExpandTemplate() &&\n !virtualizing()\n ) {\n <tr class=\"expand-panel-row\">\n <td\n class=\"expand-panel-cell\"\n [attr.colspan]=\"expandedColspan()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"rowExpandTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: row, row: row }\"\n >\n </ng-container>\n </td>\n </tr>\n }\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"skeletonRow\"\n [ngTemplateOutletContext]=\"{ $implicit: slot.index }\"\n >\n </ng-container>\n }\n }\n\n @if (virtualWindow(); as window) {\n <tr\n class=\"spacer\"\n aria-hidden=\"true\"\n [style.height.px]=\"window.padBottom\"\n >\n </tr>\n }\n }\n </tbody>\n </table>\n </div>\n</ds-loading-overlay>\n\n@if (stickyScrollbarResolved()) {\n <div\n #hscrollProxy\n class=\"hscroll-proxy\"\n aria-hidden=\"true\"\n [class.hscroll-hidden]=\"!hscrollNeeded()\"\n >\n <div\n class=\"hscroll-spacer\"\n [style.width.px]=\"hscrollContentWidth()\"\n >\n </div>\n </div>\n}\n\n@if (pageSize(); as size) {\n <div class=\"pagination-footer\">\n <ds-pagination\n [total]=\"total() ?? filteredData().length\"\n [pageSize]=\"size\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [showPageSize]=\"showPageSize()\"\n [showLabel]=\"showLabel()\"\n [(currentPage)]=\"page\"\n (pageSizeChange)=\"pageSize.set($event)\"\n />\n </div>\n}\n\n@if (hasTruncate()) {\n <ds-popover #cellTextPopover>\n <div class=\"cell-text-pop\">\n {{ cellPopoverText() }}\n </div>\n </ds-popover>\n}\n\n@if (filterColumn()) {\n <ds-popover\n #columnFilterPopover\n align=\"start\"\n panelRole=\"dialog\"\n panelLabel=\"Filter values\"\n >\n @if (headerFilterFor(filterColumn()!); as projected) {\n <div class=\"col-filter col-filter-custom\">\n <ng-container\n [ngTemplateOutlet]=\"projected.template\"\n [ngTemplateOutletContext]=\"headerFilterContext(filterColumn()!)\"\n />\n </div>\n } @else {\n <div class=\"col-filter\">\n <input\n type=\"text\"\n class=\"col-filter-search\"\n placeholder=\"Search\u2026\"\n [value]=\"filterSearch()\"\n (input)=\"onFilterSearch($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n\n <div class=\"col-filter-list\">\n @for (value of filterValues(); track value) {\n <label class=\"col-filter-option\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"isFilterValueChecked(value)\"\n (change)=\"toggleFilterValue(value)\"\n />\n {{ value || '(empty)' }}\n </label>\n } @empty {\n <div class=\"col-filter-empty\">\n No matches\n </div>\n }\n </div>\n\n <div class=\"col-filter-footer\">\n <span class=\"col-filter-count\">\n {{ filterSelectedCount() }} selected\n </span>\n\n <button\n type=\"button\"\n class=\"col-reset\"\n (click)=\"clearColumnFilter()\"\n >\n Clear\n </button>\n </div>\n </div>\n }\n </ds-popover>\n}\n\n@if (hasColumnPicker()) {\n <ds-popover\n #columnPickerPopover\n align=\"end\"\n panelRole=\"dialog\"\n panelLabel=\"Column visibility\"\n >\n <ng-container [ngTemplateOutlet]=\"columnPanel\"></ng-container>\n </ds-popover>\n\n <ds-bottom-sheet\n title=\"Columns\"\n [(open)]=\"columnSheetOpen\"\n >\n <ng-container [ngTemplateOutlet]=\"columnPanel\"></ng-container>\n </ds-bottom-sheet>\n\n <ng-template #columnPanel>\n <div\n class=\"col-picker\"\n cdkDropList\n (cdkDropListDropped)=\"onColumnDrop($event)\"\n >\n @for (\n col of orderedColumns();\n track col.key;\n let first = $first;\n let last = $last\n ) {\n <div\n class=\"col-picker-row\"\n cdkDrag\n [cdkDragDisabled]=\"!reorderableColumns()\"\n >\n @if (reorderableColumns()) {\n <span\n class=\"col-drag\"\n cdkDragHandle\n aria-hidden=\"true\"\n >\n <ds-icon\n name=\"drag\"\n [size]=\"14\"\n />\n </span>\n }\n\n <label class=\"col-picker-option\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"isColumnVisible(col)\"\n [disabled]=\"!col.hideable || isColumnLocked(col)\"\n (change)=\"toggleColumn(col)\"\n />\n {{ col.label }}\n </label>\n\n @if (resizableColumns()) {\n <span class=\"col-width\">\n <button\n type=\"button\"\n class=\"col-width-btn\"\n [attr.aria-label]=\"'Narrow ' + col.label\"\n (click)=\"onColumnWidthStep(col, -resizeStep)\"\n >\n <ds-icon\n name=\"minus\"\n [size]=\"14\"\n />\n </button>\n\n <button\n type=\"button\"\n class=\"col-width-btn\"\n [attr.aria-label]=\"'Widen ' + col.label\"\n (click)=\"onColumnWidthStep(col, resizeStep)\"\n >\n <ds-icon\n name=\"plus\"\n [size]=\"14\"\n />\n </button>\n\n <button\n type=\"button\"\n class=\"col-width-btn col-width-auto\"\n [attr.aria-label]=\"'Fit ' + col.label + ' to its content'\"\n (click)=\"onColumnWidthStep(col, 'auto')\"\n >\n Fit\n </button>\n </span>\n }\n\n @if (reorderableColumns()) {\n <span class=\"col-move\">\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move up\"\n [disabled]=\"first\"\n (click)=\"moveColumn(col, -1)\"\n >\n <ds-icon\n name=\"chevronUp\"\n [size]=\"14\"\n />\n </button>\n\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move down\"\n [disabled]=\"last\"\n (click)=\"moveColumn(col, 1)\"\n >\n <ds-icon\n name=\"chevronDown\"\n [size]=\"14\"\n />\n </button>\n </span>\n }\n </div>\n }\n\n <button\n type=\"button\"\n class=\"col-reset\"\n (click)=\"resetColumns()\"\n >\n Reset to default\n </button>\n </div>\n </ng-template>\n}\n\n@if (hasRowActions()) {\n <ds-popover\n #rowMenuPopover\n align=\"end\"\n >\n <ds-menu>\n @for (action of visibleRowActions(); track action.id) {\n <ds-menu-item\n [icon]=\"action.icon ?? null\"\n [error]=\"action.error ?? false\"\n [disabled]=\"isActionDisabled(action)\"\n [description]=\"actionReason(action)\"\n (pressed)=\"onRowAction(action)\"\n >\n {{ action.label }}\n </ds-menu-item>\n }\n </ds-menu>\n </ds-popover>\n}\n\n@if (selectable() && someSelected()) {\n <div class=\"bulk-bar\">\n <span class=\"count\">\n {{ selectedIds().size }} selected\n </span>\n\n <span class=\"sep\"></span>\n\n <ng-content select=\"[bulk-actions]\"></ng-content>\n </div>\n}\n\n<!-- One skeleton row, shared by loading=\"skeleton\" and the gaps a lazy\n window has not filled yet. `$implicit` is the row's index: skeletonWidth\n varies the bar lengths from it, so a block of them does not read as a grid. -->\n<ng-template\n #skeletonRow\n let-rowIndex\n>\n <tr>\n @if (selectable()) {\n <td class=\"select-col pin-select\">\n <ds-skeleton\n width=\"14px\"\n height=\"14px\"\n [inline]=\"true\"\n />\n </td>\n }\n\n @if (expandableRows()) {\n <td\n class=\"expand-col\"\n [class.pin-expand]=\"stickyFirstColumn()\"\n >\n </td>\n }\n\n @for (col of visibleColumns(); track col.key; let first = $first) {\n <td\n [class.numeric]=\"col.align === 'right'\"\n [class.pin-first]=\"first && stickyFirstColumn()\"\n >\n <ds-skeleton\n height=\"14px\"\n [width]=\"skeletonWidth(col, rowIndex)\"\n [inline]=\"true\"\n />\n </td>\n }\n\n @if (hasUtilityColumn()) {\n <td class=\"actions-col\"></td>\n }\n </tr>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:block;position:relative}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.bordered) .scroll-wrap{border:var(--border-width-default) solid var(--_table-border);border-radius:var(--_table-radius)}.scroll-wrap{--_table-border: var(--ds-table-border, var(--border-default));--_table-radius: var(--ds-table-radius, var(--ds-radius-control));--_table-bg-color: var(--ds-table-bg-color, var(--surface-default));width:100%;overflow:auto hidden;-webkit-overflow-scrolling:touch;background:var(--surface-default);box-sizing:border-box}.scroll-wrap.scroll-y{overflow-y:auto}:host(.sticky-scrollbar) .scroll-wrap{scrollbar-width:none}:host(.sticky-scrollbar) .scroll-wrap::-webkit-scrollbar{display:none}:host(.resizable) thead th{position:relative;overflow:hidden}@media(hover:none)and (pointer:coarse){.col-resize{display:none}}.col-resize{position:absolute;inset-block:0;right:0;width:var(--space-2);cursor:col-resize;touch-action:none;-webkit-user-select:none;user-select:none}.col-resize:after{content:\"\";position:absolute;inset-block:var(--space-2);right:0;width:var(--border-width-default);background-color:transparent;transition:background-color var(--duration-fast) var(--ease-standard)}.col-resize:hover:after,.col-resize:active:after,.col-resize:focus-visible:after{background-color:var(--_table-sort-active-icon-color)}.col-resize:focus-visible{outline:none}.col-resize:focus-visible:after{width:var(--border-width-strong)}.hscroll-proxy{position:sticky;bottom:var(--ds-table-hscroll-bottom, 0);overflow:auto hidden}.hscroll-spacer{height:1px}.hscroll-hidden{display:none}.table{--_table-min-width: var(--ds-table-min-width, 0);--_table-bg-color: var(--ds-table-bg-color, var(--surface-default));--_table-row-hover-bg-color: var(--ds-table-row-hover-bg-color, var(--surface-secondary));--_table-row-selected-bg-color: var(--ds-table-row-selected-bg-color, var(--accent-subtitle));--_table-row-pressed-bg-color: var(--ds-table-row-pressed-bg-color, var(--surface-muted));--_table-row-active-bg-color: var(--ds-table-row-active-bg-color, var(--accent-subtitle));--_table-row-stripe-bg-color: var(--ds-table-row-stripe-bg-color, var(--surface-secondary));--_table-cell-link-color: var(--ds-table-cell-link-color, var(--accent));--_table-cell-link-decoration: var(--ds-table-cell-link-decoration, underline);--_table-head-text-color: var(--ds-table-head-text-color, var(--text-secondary));--_table-head-bg-color: var(--ds-table-head-bg-color, var(--surface-secondary));--_table-head-fs: var(--ds-table-head-fs, var(--font-size-xs));--_table-divider: var(--ds-table-divider, var(--border-divider));--_table-sort-active-icon-color: var(--ds-table-sort-active-icon-color, var(--accent));--_table-icon-btn-color: var(--ds-table-icon-btn-color, var(--icon-default));--_table-icon-btn-color-hover: var(--ds-table-icon-btn-color-hover, var(--icon-strong));--_table-icon-btn-focus-color: var(--ds-table-icon-btn-focus-color, var(--accent));--_table-cell-pad-x: var(--ds-table-cell-pad-x, var(--table-cell-pad-x));--_table-cell-pad-y: var(--ds-table-cell-pad-y, var(--table-cell-pad-y));--_table-cell-pad-top: var(--ds-table-cell-pad-top, var(--_table-cell-pad-y));--_table-cell-pad-right: var(--ds-table-cell-pad-right, var(--_table-cell-pad-x));--_table-cell-pad-bottom: var(--ds-table-cell-pad-bottom, var(--_table-cell-pad-y));--_table-cell-pad-left: var(--ds-table-cell-pad-left, var(--_table-cell-pad-x));--_table-head-pad-top: var(--ds-table-head-pad-top, var(--table-head-pad-y));--_table-head-pad-bottom: var(--ds-table-head-pad-bottom, var(--table-head-pad-y));--_table-head-border-color: var(--ds-table-head-border-color, var(--_table-divider));--_table-head-weight: var(--ds-table-head-weight, var(--font-weight-bold));--_table-head-tracking: var(--ds-table-head-tracking, var(--letter-spacing-wider));width:100%;border-collapse:collapse;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--_table-bg-color)}.table th.fit-content,.table td.fit-content{width:1%;white-space:nowrap}.table thead th{text-align:left;padding:var(--_table-head-pad-top) var(--_table-cell-pad-right) var(--_table-head-pad-bottom) var(--_table-cell-pad-left);font:var(--_table-head-weight) var(--_table-head-fs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--_table-head-tracking);text-transform:uppercase;color:var(--_table-head-text-color);background-color:var(--_table-head-bg-color);border-bottom:var(--border-width-default) solid var(--_table-head-border-color);white-space:nowrap}.table thead th .th-label{display:inline-flex;align-items:center;vertical-align:middle;appearance:none;background:none;border:0;margin:0;padding:0;font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;text-align:left}.table thead th button.th-label{cursor:pointer;-webkit-user-select:none;user-select:none;transition:color var(--duration-fast) var(--ease-standard)}.table thead th button.th-label:hover{color:var(--text-secondary)}.table thead th button.th-label:focus-visible{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:var(--focus-ring-offset);border-radius:var(--radius-sm)}.table thead th .sort-icon{display:inline-block;width:var(--sort-ic-size);height:var(--sort-ic-size);margin-left:var(--sort-ic-gap);vertical-align:middle;transform:translateY(-1px);color:var(--icon-default);opacity:var(--sort-ic-opacity-idle);transition:opacity var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.table thead th .sort-icon .icon{width:var(--sort-ic-size);height:var(--sort-ic-size);display:block}.table thead th.sorted-asc .sort-icon,.table thead th.sorted-desc .sort-icon{opacity:1;color:var(--_table-sort-active-icon-color)}.table thead th.numeric{text-align:right}.table thead th.select-col,.table thead th.expand-col,.table thead th.actions-col{width:var(--space-10)}.table.sticky-header thead th{position:sticky;top:0}.table.sticky-header thead th:not(.pin-select,.pin-first,.pin-expand){z-index:var(--table-sticky-header-z)}.table tbody td{padding:var(--_table-cell-pad-top) var(--_table-cell-pad-right) var(--_table-cell-pad-bottom) var(--_table-cell-pad-left);line-height:var(--line-height-flat);transition:background-color var(--duration-fast) var(--ease-standard);box-shadow:inset 0 calc(-1 * var(--border-width-default)) 0 var(--_table-divider);vertical-align:middle}.table tbody td.numeric{text-align:right}.table tbody td.empty{text-align:center;color:var(--text-tertiary);padding:var(--space-4)}.table tbody tr:last-child td{box-shadow:none}.table tbody tr.clickable:not(.active):hover td{background-color:var(--_table-row-hover-bg-color)}.table tbody tr.clickable:hover td.interactive-cell,.table tbody tr td .cell-link{color:var(--_table-cell-link-color);text-decoration:var(--_table-cell-link-decoration)}.table tbody tr.selected td{background-color:var(--_table-row-selected-bg-color)}.table tbody tr.active td{background-color:var(--_table-row-active-bg-color)}.table tbody tr.clickable:active td{background-color:var(--_table-row-pressed-bg-color)}.table tbody tr.clickable{cursor:pointer}.table tbody tr.clickable:focus-visible{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:-2px}.table tbody .expand-col,.table tbody .actions-col{width:var(--space-10)}.table tbody .expand-panel-cell{padding:var(--_table-cell-pad-top) var(--_table-cell-pad-right) var(--_table-cell-pad-bottom) var(--_table-cell-pad-left)}.table tbody .cell-clip{display:block;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.table .expand-chev{display:block;transition:transform var(--duration-base) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.table .expand-chev{transition:none}}.table .expand-chev.is-expanded{transform:rotate(90deg)}.table .expand-btn,.table .row-actions-btn,.table .col-picker-btn{display:flex;align-items:center;justify-content:center;width:var(--space-6);height:var(--space-6);padding:0;border:0;background:none;cursor:pointer;color:var(--_table-icon-btn-color);border-radius:var(--ds-radius-inner);transition:color var(--duration-fast) var(--ease-standard)}.table .expand-btn:hover,.table .row-actions-btn:hover,.table .col-picker-btn:hover{color:var(--_table-icon-btn-color-hover)}.table .expand-btn:focus-visible,.table .row-actions-btn:focus-visible,.table .col-picker-btn:focus-visible{outline:var(--border-width-strong, 2px) solid var(--_table-icon-btn-focus-color);outline-offset:var(--focus-ring-offset)}.table.compact{--table-cell-pad-x: var(--space-3);--table-cell-pad-y: var(--space-2);--table-head-pad-y: var(--space-2)}.table{min-width:var(--_table-min-width)}.table.zebra:not(.virtual) tbody tr:nth-child(odd) td{background-color:var(--_table-row-stripe-bg-color)}.table.zebra.virtual tbody tr.stripe td{background-color:var(--_table-row-stripe-bg-color)}.table.virtual{table-layout:fixed}.table.virtual tbody tr:not(.spacer){height:var(--_table-virtual-row-h)}.table.virtual tbody td{overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.table tbody tr.spacer{padding:0;border:0;background:none}.table tbody tr.spacer:hover td{background-color:transparent}.col-picker{display:grid;gap:var(--space-2);min-width:160px}.col-picker-row{display:flex;align-items:center;gap:var(--space-2)}.col-picker-row.cdk-drag-preview{background-color:var(--surface-default);border-radius:var(--ds-radius-inner);box-shadow:var(--shadow-popover);padding:var(--space-1) var(--space-2)}.col-picker-row.cdk-drag-placeholder{opacity:.4}.col-picker.cdk-drop-list-dragging .col-picker-row:not(.cdk-drag-placeholder){transition:transform var(--duration-fast) var(--ease-standard)}.col-drag{display:inline-flex;color:var(--icon-default);cursor:grab}.col-drag:active{cursor:grabbing}.col-picker-option{display:flex;align-items:center;gap:var(--space-2);flex:1;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);cursor:pointer}.col-picker-option:has(input:disabled){color:var(--text-tertiary);cursor:default}.col-width{display:inline-flex;gap:var(--space-1);align-items:center;margin-left:auto}.col-width-auto{width:auto;padding-inline:var(--space-2);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans)}.col-move{display:inline-flex;gap:var(--space-1)}.col-width-btn,.col-move-btn{display:inline-flex;padding:0;border:0;background:none;color:var(--icon-default);cursor:pointer}.col-width-btn:hover:not(:disabled),.col-move-btn:hover:not(:disabled){color:var(--icon-strong)}.col-width-btn:disabled,.col-move-btn:disabled{color:var(--text-disabled);cursor:default}.col-reset{margin-top:var(--space-1);padding:0;border:0;background:none;color:var(--accent);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;text-align:left}.col-reset:hover{text-decoration:underline}.col-filter-btn{display:inline-flex;margin-left:var(--space-1);padding:0;border:0;background:none;color:var(--icon-default);opacity:.5;cursor:pointer;vertical-align:middle;transition:color var(--duration-fast) var(--ease-standard),opacity var(--duration-fast) var(--ease-standard)}.col-filter-btn:hover{opacity:1;color:var(--icon-strong)}.col-filter-btn.active{opacity:1;color:var(--_table-sort-active-icon-color)}.col-filter{display:grid;gap:var(--space-2);min-width:180px}.col-filter-search{width:100%;box-sizing:border-box;padding:var(--space-1) var(--space-2);border:var(--border-width-default) solid var(--border-default);border-radius:var(--ds-radius-inner);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--surface-default)}.col-filter-search:focus-visible{outline:0;border-color:var(--accent)}.col-filter-list{display:grid;gap:var(--space-1);max-height:240px;overflow-y:auto}.col-filter-option{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);cursor:pointer}.col-filter-empty{color:var(--text-tertiary);font-size:var(--font-size-s);padding:var(--space-1) 0}.col-filter-footer{display:flex;align-items:center;justify-content:space-between;padding-top:var(--space-1);border-top:var(--border-width-default) solid var(--border-divider)}.col-filter-count{color:var(--text-tertiary);font-size:var(--font-size-xs)}.col-filter-footer .col-reset{margin-top:0}.editable-cell{cursor:text}.cell-edit{width:100%;box-sizing:border-box;margin:calc(-1 * var(--space-1)) 0;padding:var(--space-1) var(--space-2);border:var(--border-width-default) solid var(--accent);border-radius:var(--ds-radius-inner);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);background-color:var(--surface-default)}.cell-edit:focus-visible{outline:0}.cell-text-pop{max-width:360px;overflow-wrap:anywhere;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary)}:host(.pinned){--_table-select-w: var(--ds-table-select-col-w, var(--space-10))}:host(.pinned) .table{border-collapse:separate;border-spacing:0}:host(.pinned) .table tbody td{box-shadow:none;border-bottom:var(--border-width-default) solid var(--_table-divider)}:host(.pinned) .table tbody tr:last-child td{border-bottom:0}:host(.pinned) .pin-select,:host(.pinned) .pin-first{position:sticky;left:0;z-index:var(--table-sticky-col-z);background-color:var(--_table-bg-color)}:host(.pinned) thead .pin-select,:host(.pinned) thead .pin-first{z-index:var(--table-sticky-corner-z);background-color:var(--_table-head-bg-color)}:host(.pinned) tbody tr.clickable:not(.active):hover .pin-first,:host(.pinned) tbody tr.clickable:not(.active):hover .pin-select{background-color:var(--_table-row-hover-bg-color)}:host(.pinned) tbody tr.selected .pin-first,:host(.pinned) tbody tr.selected .pin-select{background-color:var(--_table-row-selected-bg-color)}:host(.pinned) tbody tr.active .pin-first,:host(.pinned) tbody tr.active .pin-select{background-color:var(--_table-row-active-bg-color)}:host(.pinned) tbody tr.clickable:active .pin-first,:host(.pinned) tbody tr.clickable:active .pin-select{background-color:var(--_table-row-pressed-bg-color)}:host(.pinned.selectable) .pin-first{left:var(--_table-select-w)}:host(.pinned.expandable){--_table-expand-w: var(--ds-table-expand-col-w, var(--space-10))}:host(.pinned.expandable) .pin-expand{position:sticky;left:0;z-index:var(--table-sticky-col-z);background-color:var(--_table-bg-color)}:host(.pinned.expandable) thead .pin-expand{z-index:var(--table-sticky-corner-z);background-color:var(--_table-head-bg-color)}:host(.pinned.expandable) tbody tr.clickable:not(.active):hover .pin-expand{background-color:var(--_table-row-hover-bg-color)}:host(.pinned.expandable) tbody tr.selected .pin-expand{background-color:var(--_table-row-selected-bg-color)}:host(.pinned.expandable) tbody tr.active .pin-expand{background-color:var(--_table-row-active-bg-color)}:host(.pinned.expandable) tbody tr.clickable:active .pin-expand{background-color:var(--_table-row-pressed-bg-color)}:host(.pinned.expandable) .pin-first{left:var(--_table-expand-w)}:host(.pinned.selectable.expandable) .pin-expand{left:var(--_table-select-w)}:host(.pinned.selectable.expandable) .pin-first{left:calc(var(--_table-select-w) + var(--_table-expand-w))}.pagination-footer{padding:var(--space-3) var(--ds-table-cell-pad-x, var(--table-cell-pad-x)) var(--space-3);border-top:var(--border-width-default) solid var(--ds-table-divider, var(--border-divider))}.bulk-bar{position:sticky;bottom:var(--bulk-bar-offset);display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-4);background:var(--surface-inverted);color:var(--text-inverted);border-radius:var(--radius-lg);box-shadow:var(--shadow-toast);margin:var(--space-4) auto 0;width:fit-content}.bulk-bar .count{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans)}.bulk-bar .sep{width:var(--border-width-default);height:var(--space-4);background:var(--border-inverted)}.bulk-bar .button{background:transparent;color:var(--text-inverted)}.bulk-bar .button:hover{background:var(--surface-inverted-hover)}.table-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2);margin-bottom:var(--space-2)}.table-toolbar:not(:has(.toolbar-slot>*,>ds-button)){display:none}.toolbar-slot{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;gap:var(--space-2);min-width:0}.toolbar-slot ::ng-deep>:only-child{flex:1 1 auto;min-width:0}\n"] }]
|
|
7267
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], rowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowId", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], bordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "bordered", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], stickyHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyHeader", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], zebra: [{ type: i0.Input, args: [{ isSignal: true, alias: "zebra", required: false }] }], animateHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "animateHeight", required: false }] }], selectedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIds", required: false }] }, { type: i0.Output, args: ["selectedIdsChange"] }], sortKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortKey", required: false }] }], sortKeyChange: [{ type: i0.Output, args: ["sortKeyChange"] }], sortDir: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDir", required: false }] }], sortDirChange: [{ type: i0.Output, args: ["sortDirChange"] }], sortingOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortingOrder", required: false }] }], sortAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortAnnouncement", required: false }] }], rangeAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeAnnouncement", required: false }] }], skeletonRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonRows", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], rowInteractive: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowInteractive", required: false }] }], activeRowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeRowId", required: false }] }], filterQuery: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterQuery", required: false }] }], columnFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilters", required: false }] }, { type: i0.Output, args: ["columnFiltersChange"] }], hiddenKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenKeys", required: false }] }, { type: i0.Output, args: ["hiddenKeysChange"] }], resizableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizableColumns", required: false }] }], columnWidths: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnWidths", required: false }] }, { type: i0.Output, args: ["columnWidthsChange"] }], reorderableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderableColumns", required: false }] }], columnOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnOrder", required: false }] }, { type: i0.Output, args: ["columnOrderChange"] }], persistLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "persistLayout", required: false }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], exportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButton", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], exportFetcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFetcher", required: false }] }], exportFailed: [{ type: i0.Output, args: ["exportFailed"] }], stickyScrollbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyScrollbar", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSize", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], scrollToTopOnPageChange: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollToTopOnPageChange", required: false }] }], sortMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortMode", required: false }] }], filterMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMode", required: false }] }], columnFilterOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilterOptions", required: false }] }], stickyFirstColumn: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyFirstColumn", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], virtualRowSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualRowSize", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], rowActionSelected: [{ type: i0.Output, args: ["rowActionSelected"] }], cellEdited: [{ type: i0.Output, args: ["cellEdited"] }], cellTemplateMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellTemplateMap", required: false }] }], emptyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTemplate", required: false }] }], expandableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandableRows", required: false }] }], expandedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIds", required: false }] }, { type: i0.Output, args: ["expandedIdsChange"] }], expandMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandMode", required: false }] }], expandAllToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandAllToggle", required: false }] }], rowExpanded: [{ type: i0.Output, args: ["rowExpanded"] }], rowCollapsed: [{ type: i0.Output, args: ["rowCollapsed"] }], rowExpandTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowExpandTemplate", required: false }] }], cellTemplateDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CellTemplateDirective), { isSignal: true }] }], columnFilterPopover: [{ type: i0.ViewChild, args: ['columnFilterPopover', { isSignal: true }] }], headerFilters: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => HeaderFilterDirective), { isSignal: true }] }], editInput: [{ type: i0.ViewChild, args: ['editInput', { isSignal: true }] }], rowMenuPopover: [{ type: i0.ViewChild, args: ['rowMenuPopover', { isSignal: true }] }], columnPickerPopover: [{ type: i0.ViewChild, args: ['columnPickerPopover', { isSignal: true }] }], cellTextPopover: [{ type: i0.ViewChild, args: ['cellTextPopover', { isSignal: true }] }], scrollWrap: [{ type: i0.ViewChild, args: ['scrollWrap', { isSignal: true }] }], hscrollProxy: [{ type: i0.ViewChild, args: ['hscrollProxy', { isSignal: true }] }] } });
|
|
6587
7268
|
|
|
6588
7269
|
// Screen-reader wording per state. The glyph is a decorative SVG with no
|
|
6589
7270
|
// accessible name, so without these a screen reader hears the rule text and
|
|
@@ -7047,7 +7728,7 @@ function fullDateLabel(date, locale) {
|
|
|
7047
7728
|
});
|
|
7048
7729
|
}
|
|
7049
7730
|
|
|
7050
|
-
let nextId$
|
|
7731
|
+
let nextId$7 = 0;
|
|
7051
7732
|
const YEAR_PAGE_SIZE = 12;
|
|
7052
7733
|
class DatePickerComponent extends DsControlValueAccessor {
|
|
7053
7734
|
/** Segment of a ds-field-group: the group owns the border, radius and focus
|
|
@@ -7217,7 +7898,7 @@ class DatePickerComponent extends DsControlValueAccessor {
|
|
|
7217
7898
|
weekdaysFull = computed(() => weekdayLabels(this.resolvedLocale(), this.resolvedFirstDay(), 'long'), ...(ngDevMode ? [{ debugName: "weekdaysFull" }] : /* istanbul ignore next */ []));
|
|
7218
7899
|
/** Localized "Month YYYY" caption — the grid's accessible name + live label. */
|
|
7219
7900
|
monthYearLabel = computed(() => `${this.monthNames()[this.viewMonthIndex()]} ${this.viewYear()}`, ...(ngDevMode ? [{ debugName: "monthYearLabel" }] : /* istanbul ignore next */ []));
|
|
7220
|
-
uid = `ds-datepicker-${++nextId$
|
|
7901
|
+
uid = `ds-datepicker-${++nextId$7}`;
|
|
7221
7902
|
labelId = `${this.uid}-label`;
|
|
7222
7903
|
panelId = `${this.uid}-panel`;
|
|
7223
7904
|
captionId = `${this.uid}-caption`;
|
|
@@ -8322,7 +9003,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
8322
9003
|
}, template: "<div\n class=\"col\"\n role=\"listbox\"\n aria-label=\"Hours\"\n>\n @for (cell of hourCells(); track cell.value; let i = $index) {\n <button\n #hourOpt\n type=\"button\"\n role=\"option\"\n class=\"opt\"\n [class.is-selected]=\"cell.selected\"\n [attr.aria-selected]=\"cell.selected\"\n [attr.tabindex]=\"i === hourEntry() ? 0 : -1\"\n [disabled]=\"cell.disabled\"\n (click)=\"selectHour(cell)\"\n (keydown)=\"onKey($event, 'hours', i)\"\n >\n {{ cell.label }}\n </button>\n }\n</div>\n\n<div\n class=\"col\"\n role=\"listbox\"\n aria-label=\"Minutes\"\n>\n @for (cell of minuteCells(); track cell.value; let i = $index) {\n <button\n #minOpt\n type=\"button\"\n role=\"option\"\n class=\"opt\"\n [class.is-selected]=\"cell.selected\"\n [attr.aria-selected]=\"cell.selected\"\n [attr.tabindex]=\"i === minuteEntry() ? 0 : -1\"\n [disabled]=\"cell.disabled\"\n (click)=\"selectMinute(cell)\"\n (keydown)=\"onKey($event, 'minutes', i)\"\n >\n {{ cell.label }}\n </button>\n }\n</div>\n\n@if (is12h()) {\n <div\n class=\"col\"\n role=\"listbox\"\n aria-label=\"AM/PM\"\n >\n @for (cell of periodCells(); track cell.value; let i = $index) {\n <button\n #periodOpt\n type=\"button\"\n role=\"option\"\n class=\"opt\"\n [class.is-selected]=\"cell.selected\"\n [attr.aria-selected]=\"cell.selected\"\n [attr.tabindex]=\"i === periodEntry() ? 0 : -1\"\n [disabled]=\"cell.disabled\"\n (click)=\"selectPeriod(cell)\"\n (keydown)=\"onKey($event, 'period', i)\"\n >\n {{ cell.label }}\n </button>\n }\n </div>\n}\n", styles: [":host{--_time-picker-option-bg-color-selected: var( --ds-time-picker-option-bg-color-selected, var(--accent) );--_time-picker-option-text-color-selected: var( --ds-time-picker-option-text-color-selected, var(--accent-on) );--_time-picker-option-bg-color-hover: var( --ds-time-picker-option-bg-color-hover, var(--surface-secondary) );display:flex;gap:var(--space-1);align-items:stretch}.col{display:flex;flex-direction:column;gap:var(--space-0-5);min-width:var(--ds-time-picker-column-width, 3rem);max-height:var(--ds-time-picker-column-height, 13.5rem);overflow-y:auto;scrollbar-width:thin;padding-inline:var(--space-0-5)}.col:not(:last-child){border-right:var(--border-width-default) solid var(--border-subtitle);padding-right:var(--space-1)}.opt{flex:none;appearance:none;border:0;cursor:pointer;width:100%;padding:var(--space-1-5) var(--space-3);border-radius:var(--ds-radius-inner);background-color:transparent;color:var(--text-primary);font:inherit;font-variant-numeric:tabular-nums;text-align:center;transition:background-color var(--duration-fast) var(--ease-standard)}.opt:hover:not(:disabled,.is-selected){background-color:var(--_time-picker-option-bg-color-hover)}.opt.is-selected{background-color:var(--_time-picker-option-bg-color-selected);color:var(--_time-picker-option-text-color-selected)}.opt:focus-visible{outline:none;box-shadow:var(--ds-time-picker-focus-shadow, var(--ds-control-focus-shadow, var(--focus-ring)))}.opt:disabled{color:var(--text-disabled);cursor:default}\n"] }]
|
|
8323
9004
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], minTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "minTime", required: false }] }], maxTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTime", required: false }] }], disabledTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledTime", required: false }] }], timeChange: [{ type: i0.Output, args: ["timeChange"] }], partPicked: [{ type: i0.Output, args: ["partPicked"] }], hourButtons: [{ type: i0.ViewChildren, args: ['hourOpt', { isSignal: true }] }], minuteButtons: [{ type: i0.ViewChildren, args: ['minOpt', { isSignal: true }] }], periodButtons: [{ type: i0.ViewChildren, args: ['periodOpt', { isSignal: true }] }] } });
|
|
8324
9005
|
|
|
8325
|
-
let nextId$
|
|
9006
|
+
let nextId$6 = 0;
|
|
8326
9007
|
class TimePickerComponent extends DsControlValueAccessor {
|
|
8327
9008
|
constructor() {
|
|
8328
9009
|
super();
|
|
@@ -8379,7 +9060,7 @@ class TimePickerComponent extends DsControlValueAccessor {
|
|
|
8379
9060
|
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
8380
9061
|
/** Override the DS-config format for this instance. */
|
|
8381
9062
|
format = input(null, ...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
8382
|
-
uid = `ds-timepicker-${++nextId$
|
|
9063
|
+
uid = `ds-timepicker-${++nextId$6}`;
|
|
8383
9064
|
labelId = `${this.uid}-label`;
|
|
8384
9065
|
openSegment = signal(null, ...(ngDevMode ? [{ debugName: "openSegment" }] : /* istanbul ignore next */ []));
|
|
8385
9066
|
// Which columns the user has been through since THIS opening. In single mode
|
|
@@ -8815,7 +9496,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
8815
9496
|
}, encapsulation: ViewEncapsulation.Emulated, styles: ["@charset \"UTF-8\";:host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--surface-inverted));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--text-inverted));--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host:after{content:\"\";position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);transform:rotate(45deg)}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2);left:50%;margin-left:calc(var(--tooltip-arrow) / -2)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2);left:50%;margin-left:calc(var(--tooltip-arrow) / -2)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2);top:50%;margin-top:calc(var(--tooltip-arrow) / -2)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2);top:50%;margin-top:calc(var(--tooltip-arrow) / -2)}\n"] }]
|
|
8816
9497
|
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: true }] }], panelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelId", required: false }] }] } });
|
|
8817
9498
|
|
|
8818
|
-
let nextId$
|
|
9499
|
+
let nextId$5 = 0;
|
|
8819
9500
|
class TooltipDirective {
|
|
8820
9501
|
overlay = inject(Overlay);
|
|
8821
9502
|
host = inject((ElementRef));
|
|
@@ -8824,7 +9505,7 @@ class TooltipDirective {
|
|
|
8824
9505
|
dsTooltipDelay = input(120, ...(ngDevMode ? [{ debugName: "dsTooltipDelay" }] : /* istanbul ignore next */ []));
|
|
8825
9506
|
ref = null;
|
|
8826
9507
|
timer = null;
|
|
8827
|
-
tipId = `ds-tooltip-${++nextId$
|
|
9508
|
+
tipId = `ds-tooltip-${++nextId$5}`;
|
|
8828
9509
|
/**
|
|
8829
9510
|
* Where `aria-describedby` belongs, when focus is involved. A host that is not
|
|
8830
9511
|
* focusable itself never reaches a screen reader — `ds-menu-item` carries
|
|
@@ -9219,7 +9900,7 @@ function resolveDividers(dividers) {
|
|
|
9219
9900
|
return computed(() => dividers() ?? config.modal?.dividers ?? true);
|
|
9220
9901
|
}
|
|
9221
9902
|
|
|
9222
|
-
let nextId$
|
|
9903
|
+
let nextId$4 = 0;
|
|
9223
9904
|
class ModalCardComponent {
|
|
9224
9905
|
/** Card width — sm/md/lg/xl/fullscreen. */
|
|
9225
9906
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
@@ -9250,7 +9931,7 @@ class ModalCardComponent {
|
|
|
9250
9931
|
dialogRole = input(null, ...(ngDevMode ? [{ debugName: "dialogRole" }] : /* istanbul ignore next */ []));
|
|
9251
9932
|
/** Fires when the header close button is clicked. */
|
|
9252
9933
|
closed = output();
|
|
9253
|
-
titleId = `ds-modal-title-${++nextId$
|
|
9934
|
+
titleId = `ds-modal-title-${++nextId$4}`;
|
|
9254
9935
|
/** Status picks the glyph so a severity is never carried by colour alone. */
|
|
9255
9936
|
resolvedIcon = computed(() => {
|
|
9256
9937
|
const explicit = this.icon();
|
|
@@ -9302,33 +9983,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
9302
9983
|
args: [{ selector: 'ds-modal-card', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<div\n aria-modal=\"true\"\n [attr.role]=\"resolvedRole()\"\n [class]=\"classes()\"\n [attr.aria-labelledby]=\"titleId\"\n>\n <div class=\"header\">\n @if (resolvedIcon(); as iconName) {\n <span [class]=\"status() ? 'icon-badge ' + status() : 'icon-badge'\">\n <ds-icon\n [name]=\"iconName\"\n [size]=\"20\"\n />\n </span>\n }\n\n <div class=\"heading\">\n <div class=\"eyebrow\">\n <ng-content select=\"[eyebrow]\"></ng-content>\n </div>\n\n <div class=\"title-line\">\n <h2\n class=\"title\"\n [id]=\"titleId\"\n >\n {{ title() }}\n </h2>\n\n <ng-content select=\"[title-badge]\"></ng-content>\n </div>\n\n @if (subtitle()) {\n <p class=\"subtitle\">\n {{ subtitle() }}\n </p>\n }\n </div>\n\n @if (showClose()) {\n <button\n class=\"close\"\n type=\"button\"\n aria-label=\"Close dialog\"\n (click)=\"onClose()\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"16\"\n >\n </ds-icon>\n </button>\n }\n </div>\n\n <div class=\"body\">\n <ng-content select=\"[body]\"></ng-content>\n\n <div class=\"impact\">\n <ng-content select=\"[impact]\"></ng-content>\n </div>\n </div>\n\n <div class=\"actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{--_modal-bg-color: var(--ds-modal-bg-color, var(--surface-overlay));--_modal-radius: var(--ds-modal-radius, var(--ds-radius-panel));--_modal-shadow: var(--ds-modal-shadow, var(--ds-elevation-modal));--_modal-divider: var(--ds-modal-divider, var(--border-divider));--_modal-title-text-color: var(--ds-modal-title-text-color, var(--text-primary));--_modal-title-text-color-error: var(--ds-modal-title-text-color-error, var(--error-text));--_modal-title-text-color-warning: var(--ds-modal-title-text-color-warning, var(--warning-text));--_modal-title-text-color-success: var(--ds-modal-title-text-color-success, var(--success-text));--_modal-title-text-color-info: var(--ds-modal-title-text-color-info, var(--info-text));--_modal-title-weight: var(--ds-modal-title-weight, var(--font-weight-bold));--_modal-title-font-size: var(--ds-modal-title-font-size, var(--font-size-h5));--_modal-subtitle-text-color: var(--ds-modal-subtitle-text-color, var(--text-secondary));--_modal-subtitle-font-size: var(--ds-modal-subtitle-font-size, var(--font-size-s));--_modal-eyebrow-text-color: var(--ds-modal-eyebrow-text-color, var(--text-tertiary));--_modal-eyebrow-font-size: var(--ds-modal-eyebrow-font-size, var(--font-size-xs));--_modal-eyebrow-weight: var(--ds-modal-eyebrow-weight, var(--font-weight-bold));--_modal-eyebrow-tracking: var(--ds-modal-eyebrow-tracking, var(--letter-spacing-wide));--_modal-eyebrow-transform: var(--ds-modal-eyebrow-transform, uppercase);--_modal-close-icon-color: var(--ds-modal-close-icon-color, var(--icon-default));--_modal-close-icon-color-hover: var(--ds-modal-close-icon-color-hover, var(--icon-strong));--_modal-icon-badge-bg-color: var(--ds-modal-icon-badge-bg-color, var(--accent-subtitle));--_modal-icon-badge-icon-color: var(--ds-modal-icon-badge-icon-color, var(--accent));--_modal-impact-text-color: var(--ds-modal-impact-text-color, var(--warning-text));--_modal-enter-keyframes: var(--ds-modal-enter-keyframes, ds-scale-in);--_modal-enter-duration: var(--ds-modal-enter-duration, var(--ds-motion-enter-surface-duration));--_modal-enter-easing: var(--ds-modal-enter-easing, var(--ds-motion-enter-surface-easing));--_modal-leave-duration: var(--ds-modal-leave-duration, var(--ds-motion-exit-duration));--_modal-leave-keyframes: var(--ds-modal-leave-keyframes, ds-fade-out);--_modal-leave-easing: var(--ds-modal-leave-easing, var(--ds-motion-exit-easing));--_modal-pad-x: var(--ds-modal-pad-x, var(--space-5));--_modal-header-pad-y: var(--ds-modal-header-pad-y, var(--space-4));--_modal-body-pad-y: var(--ds-modal-body-pad-y, var(--space-5));--_modal-actions-pad-y: var(--ds-modal-actions-pad-y, var(--space-4));--_modal-header-pad-top: var(--ds-modal-header-pad-top, var(--_modal-header-pad-y));--_modal-header-pad-bottom: var(--ds-modal-header-pad-bottom, var(--_modal-header-pad-y));--_modal-body-pad-top: var(--ds-modal-body-pad-top, var(--_modal-body-pad-y));--_modal-body-pad-bottom: var(--ds-modal-body-pad-bottom, var(--_modal-body-pad-y));--_modal-actions-pad-top: var(--ds-modal-actions-pad-top, var(--_modal-actions-pad-y));--_modal-actions-pad-bottom: var(--ds-modal-actions-pad-bottom, var(--_modal-actions-pad-y));--_ds-enter-scale: var(--ds-modal-enter-scale, .97);display:contents}@media(prefers-reduced-motion:reduce){:host{--_modal-enter-duration: 0ms;--_modal-leave-duration: 0ms}}.modal{background-color:var(--_modal-bg-color);border-radius:var(--_modal-radius);box-shadow:var(--_modal-shadow);display:flex;flex-direction:column;max-width:calc(100vw - var(--space-6));max-height:90vh;max-height:90dvh;overflow:hidden;animation-name:var(--_modal-enter-keyframes);animation-duration:var(--_modal-enter-duration);animation-timing-function:var(--_modal-enter-easing)}.modal.sm{width:var(--modal-w-sm)}.modal.md{width:var(--modal-w-md)}.modal.lg{width:var(--modal-w-lg)}.modal.xl{width:var(--modal-w-xl)}.modal.fullscreen{width:var(--modal-w-fullscreen);max-height:var(--modal-h-fullscreen)}.modal .header{display:flex;align-items:center;gap:var(--space-3);justify-content:space-between;padding:var(--_modal-header-pad-top) var(--_modal-pad-x) var(--_modal-header-pad-bottom);border-bottom:var(--border-width-default) solid var(--_modal-divider)}.modal .icon-badge{display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--space-10);height:var(--space-10);border-radius:var(--radius-pill);background-color:var(--_modal-icon-badge-bg-color);color:var(--_modal-icon-badge-icon-color)}.modal .icon-badge.error{background-color:var(--error-subtitle);color:var(--error)}.modal .icon-badge.warning{background-color:var(--warning-subtitle);color:var(--warning)}.modal .icon-badge.success{background-color:var(--success-subtitle);color:var(--success)}.modal .icon-badge.info{background-color:var(--info-subtitle);color:var(--info)}.modal .heading{flex:1;min-width:0}.modal .eyebrow{font:var(--_modal-eyebrow-weight) var(--_modal-eyebrow-font-size)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--_modal-eyebrow-tracking);text-transform:var(--_modal-eyebrow-transform);color:var(--_modal-eyebrow-text-color);margin-bottom:var(--space-0-5)}.modal .eyebrow:empty{display:none}.modal .title-line{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap;min-width:0}.modal .title{font:var(--_modal-title-weight) var(--_modal-title-font-size)/var(--line-height-snug) var(--font-heading);margin:0;min-width:0;color:var(--_modal-title-text-color)}.modal .subtitle{font:var(--font-weight-regular) var(--_modal-subtitle-font-size)/var(--line-height-snug) var(--font-sans);color:var(--_modal-subtitle-text-color);margin:var(--space-0-5) 0 0}.modal .close{background:none;border:0;cursor:pointer;color:var(--_modal-close-icon-color);width:var(--modal-close-size);height:var(--modal-close-size);display:grid;place-items:center}.modal .close:hover{color:var(--_modal-close-icon-color-hover)}.modal .close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.modal .body{padding:var(--_modal-body-pad-top) var(--_modal-pad-x) var(--_modal-body-pad-bottom);overflow-y:auto}.modal .actions{display:flex;gap:var(--space-3);justify-content:flex-end;padding:var(--_modal-actions-pad-top) var(--_modal-pad-x) var(--_modal-actions-pad-bottom);border-top:var(--border-width-default) solid var(--_modal-divider)}.modal .actions:empty{display:none}.modal.no-dividers{--_modal-body-pad-y: var(--ds-modal-body-pad-y, 0)}.modal.no-dividers .header{border-bottom-width:0}.modal.no-dividers .actions{border-top-width:0}.modal.error .title{color:var(--_modal-title-text-color-error)}.modal.warning .title{color:var(--_modal-title-text-color-warning)}.modal.success .title{color:var(--_modal-title-text-color-success)}.modal.info .title{color:var(--_modal-title-text-color-info)}.modal .impact{margin-top:var(--space-3)}.modal .impact:empty{display:none}.modal .impact .list{margin:var(--space-1) 0 0;padding-left:var(--space-4);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--_modal-impact-text-color)}.modal-static{display:contents}.modal-backdrop{--_modal-backdrop: var(--ds-modal-backdrop, var(--surface-scrim));position:fixed;inset:0;background:var(--_modal-backdrop);z-index:var(--layer-modal);display:grid;place-items:center;animation-name:ds-fade-in;animation-duration:var(--_modal-enter-duration);animation-timing-function:var(--_modal-enter-easing)}.modal-backdrop.closing{animation-name:var(--_modal-leave-keyframes);animation-duration:var(--_modal-leave-duration);animation-timing-function:var(--_modal-leave-easing);animation-fill-mode:forwards}\n"] }]
|
|
9303
9984
|
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], showClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClose", required: false }] }], dividers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dividers", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], dialogRole: [{ type: i0.Input, args: [{ isSignal: true, alias: "dialogRole", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
9304
9985
|
|
|
9305
|
-
/**
|
|
9306
|
-
* Dismiss-on-backdrop for a backdrop that WRAPS its dialog.
|
|
9307
|
-
*
|
|
9308
|
-
* `click` cannot be trusted there: the browser fires it at the nearest common
|
|
9309
|
-
* ancestor of the press and the release, so a drag that starts inside the dialog and
|
|
9310
|
-
* ends on the backdrop fires `click` ON THE BACKDROP, and a
|
|
9311
|
-
* `target === currentTarget` check waves it through. Hence tracking the press:
|
|
9312
|
-
* dismiss only when press AND release both land on the backdrop itself. `ds-drawer` needs none of this because its scrim
|
|
9313
|
-
* is a SIBLING of the panel, which makes their common ancestor a third element.
|
|
9314
|
-
*/
|
|
9315
|
-
function backdropDismiss() {
|
|
9316
|
-
let pressedOnBackdrop = false;
|
|
9317
|
-
return {
|
|
9318
|
-
down(event) {
|
|
9319
|
-
pressedOnBackdrop =
|
|
9320
|
-
event.button === 0 && event.target === event.currentTarget;
|
|
9321
|
-
},
|
|
9322
|
-
shouldDismiss(event) {
|
|
9323
|
-
const dismiss = pressedOnBackdrop &&
|
|
9324
|
-
event.button === 0 &&
|
|
9325
|
-
event.target === event.currentTarget;
|
|
9326
|
-
pressedOnBackdrop = false;
|
|
9327
|
-
return dismiss;
|
|
9328
|
-
},
|
|
9329
|
-
};
|
|
9330
|
-
}
|
|
9331
|
-
|
|
9332
9986
|
class ModalComponent {
|
|
9333
9987
|
scrollLock = inject(BodyScrollLockService);
|
|
9334
9988
|
preview = inject(DsStaticPreview);
|
|
@@ -9455,13 +10109,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
9455
10109
|
|
|
9456
10110
|
const MODAL_CONFIRM_DATA = new InjectionToken('MODAL_CONFIRM_DATA');
|
|
9457
10111
|
|
|
9458
|
-
let nextId$
|
|
10112
|
+
let nextId$3 = 0;
|
|
9459
10113
|
class ModalConfirmComponent {
|
|
9460
10114
|
context = inject(MODAL_CONFIRM_DATA);
|
|
9461
10115
|
options = this.context.options;
|
|
9462
10116
|
tone = this.options.tone ?? 'default';
|
|
9463
10117
|
confirmColor = this.tone === 'error' ? 'error' : 'primary';
|
|
9464
|
-
uid = `ds-modal-confirm-${++nextId$
|
|
10118
|
+
uid = `ds-modal-confirm-${++nextId$3}`;
|
|
9465
10119
|
messageId = `${this.uid}-message`;
|
|
9466
10120
|
typed = signal('', ...(ngDevMode ? [{ debugName: "typed" }] : /* istanbul ignore next */ []));
|
|
9467
10121
|
confirmDisabled = computed(() => {
|
|
@@ -9800,7 +10454,7 @@ class EmptyStateComponent {
|
|
|
9800
10454
|
return 'package';
|
|
9801
10455
|
}, ...(ngDevMode ? [{ debugName: "resolvedIcon" }] : /* istanbul ignore next */ []));
|
|
9802
10456
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EmptyStateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9803
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: EmptyStateComponent, isStandalone: true, selector: "ds-empty-state", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, body: { classPropertyName: "body", publicName: "body", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ds-loading-overlay\n spinnerSize=\"lg\"\n [loading]=\"variant() === 'loading'\"\n [blur]=\"true\"\n>\n <span [class]=\"classes()\">\n <span class=\"icon-tile\">\n <ds-icon\n [name]=\"resolvedIcon()\"\n [size]=\"28\"\n >\n </ds-icon>\n </span>\n\n @if (title()) {\n <span class=\"title\">\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", styles: [":host{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--accent-surface-tint));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--text-secondary));--_es-title-text-color: var(--ds-empty-state-title-text-color, var(--text-primary));--_es-title-fs: var(--ds-empty-state-title-fs, var(--font-size-h5));--_es-body-text-color: var(--ds-empty-state-body-text-color, var(--text-secondary));--_es-body-maxw: var(--ds-empty-state-body-maxw, var(--empty-body-maxw));--_es-pad: var(--ds-empty-state-pad, var(--space-12) var(--space-6));display:block}.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--_es-pad);gap:var(--space-3);position:relative}.empty-state .icon-tile{width:var(--empty-icon-size);height:var(--empty-icon-size);border-radius:var(--radius-lg);background-color:var(--_es-tile-bg-color);color:var(--_es-tile-icon-color);display:grid;place-items:center;margin-bottom:var(--space-2)}.empty-state .title{font:var(--font-weight-bold) var(--_es-title-fs)/var(--line-height-snug) var(--font-sans);color:var(--_es-title-text-color);margin:0}.empty-state .body{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_es-body-text-color);max-width:var(--_es-body-maxw);margin:0}.empty-state .cta{margin-top:var(--space-3);display:inline-flex;gap:var(--space-2);align-items:center;flex-wrap:wrap;justify-content:center}.empty-state .cta:empty{display:none;margin-top:0}.empty-state.error{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--error-subtitle));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--error-text))}.empty-state.locked{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--surface-muted));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--text-tertiary))}.empty-state.success{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--success-subtitle));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--success-text))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: LoadingOverlayComponent, selector: "ds-loading-overlay", inputs: ["loading", "label", "blur", "spinnerSize", "insetTop"] }] });
|
|
10457
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: EmptyStateComponent, isStandalone: true, selector: "ds-empty-state", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, body: { classPropertyName: "body", publicName: "body", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ds-loading-overlay\n spinnerSize=\"lg\"\n [loading]=\"variant() === 'loading'\"\n [blur]=\"true\"\n>\n <span [class]=\"classes()\">\n <span class=\"icon-tile\">\n <ds-icon\n [name]=\"resolvedIcon()\"\n [size]=\"28\"\n >\n </ds-icon>\n </span>\n\n @if (title()) {\n <span class=\"title\">\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", styles: [":host{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--accent-surface-tint));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--text-secondary));--_es-title-text-color: var(--ds-empty-state-title-text-color, var(--text-primary));--_es-title-fs: var(--ds-empty-state-title-fs, var(--font-size-h5));--_es-body-text-color: var(--ds-empty-state-body-text-color, var(--text-secondary));--_es-body-maxw: var(--ds-empty-state-body-maxw, var(--empty-body-maxw));--_es-pad: var(--ds-empty-state-pad, var(--space-12) var(--space-6));display:block}.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--_es-pad);gap:var(--space-3);position:relative}.empty-state .icon-tile{width:var(--empty-icon-size);height:var(--empty-icon-size);border-radius:var(--radius-lg);background-color:var(--_es-tile-bg-color);color:var(--_es-tile-icon-color);display:grid;place-items:center;margin-bottom:var(--space-2)}.empty-state .title{font:var(--font-weight-bold) var(--_es-title-fs)/var(--line-height-snug) var(--font-sans);color:var(--_es-title-text-color);margin:0}.empty-state .body{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_es-body-text-color);max-width:var(--_es-body-maxw);margin:0}.empty-state .cta{margin-top:var(--space-3);display:inline-flex;gap:var(--space-2);align-items:center;flex-wrap:wrap;justify-content:center}.empty-state .cta:empty{display:none;margin-top:0}.empty-state.error{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--error-subtitle));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--error-text))}.empty-state.locked{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--surface-muted));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--text-tertiary))}.empty-state.success{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--success-subtitle));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--success-text))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: LoadingOverlayComponent, selector: "ds-loading-overlay", inputs: ["loading", "label", "blur", "spinnerSize", "insetTop", "inertContent"] }] });
|
|
9804
10458
|
}
|
|
9805
10459
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EmptyStateComponent, decorators: [{
|
|
9806
10460
|
type: Component,
|
|
@@ -9841,7 +10495,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
9841
10495
|
|
|
9842
10496
|
const ACCORDION = new InjectionToken('ACCORDION');
|
|
9843
10497
|
|
|
9844
|
-
let nextId$
|
|
10498
|
+
let nextId$2 = 0;
|
|
9845
10499
|
class AccordionItemComponent {
|
|
9846
10500
|
/** Header text shown in the toggle button. */
|
|
9847
10501
|
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
@@ -9849,7 +10503,7 @@ class AccordionItemComponent {
|
|
|
9849
10503
|
expanded = model(false, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
9850
10504
|
/** Disables the toggle button; state stays as-is. */
|
|
9851
10505
|
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
9852
|
-
uid = `ds-accordion-${++nextId$
|
|
10506
|
+
uid = `ds-accordion-${++nextId$2}`;
|
|
9853
10507
|
headId = `${this.uid}-head`;
|
|
9854
10508
|
bodyId = `${this.uid}-body`;
|
|
9855
10509
|
accordion = inject(ACCORDION, { optional: true });
|
|
@@ -9978,6 +10632,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
9978
10632
|
}, template: "@for (label of steps(); track $index; let i = $index, last = $last) {\n <span\n role=\"listitem\"\n class=\"step\"\n [class.is-current]=\"i === current()\"\n [attr.aria-current]=\"i === current() ? 'step' : null\"\n >\n @if (clickable()) {\n <button\n type=\"button\"\n aria-hidden=\"true\"\n [class]=\"nodeClass(i)\"\n (click)=\"onStepClick(i)\"\n >\n @if (stepState(i) === 'completed') {\n <ds-icon\n name=\"check\"\n [size]=\"14\"\n />\n } @else if (stepState(i) === 'error') {\n <ds-icon\n name=\"error\"\n [size]=\"14\"\n />\n } @else {\n {{ i + 1 }}\n }\n </button>\n } @else {\n <span\n aria-hidden=\"true\"\n [class]=\"nodeClass(i)\"\n >\n @if (stepState(i) === 'completed') {\n <ds-icon\n name=\"check\"\n [size]=\"14\"\n />\n } @else if (stepState(i) === 'error') {\n <ds-icon\n name=\"error\"\n [size]=\"14\"\n />\n } @else {\n {{ i + 1 }}\n }\n </span>\n }\n\n <span\n aria-hidden=\"true\"\n class=\"step-label\"\n >\n {{ label }}\n </span>\n\n @if (!last) {\n <span\n aria-hidden=\"true\"\n [class]=\"connectorClass(i)\"\n >\n </span>\n }\n\n <span class=\"visually-hidden\">\n Step {{ i + 1 }}: {{ label }} ({{ stepState(i) }})\n </span>\n </span>\n}\n", styles: [":host{display:flex;align-items:flex-start;--_stepper-label-color: var(--ds-stepper-label-color, var(--text-tertiary));--_stepper-label-color-current: var(--ds-stepper-label-color-current, var(--text-primary));--_stepper-label-font-size: var(--ds-stepper-label-font-size, var(--font-size-xs));--_stepper-node-bg-color: var(--ds-stepper-node-bg-color, var(--surface-default));--_stepper-node-active-bg-color: var(--ds-stepper-node-active-bg-color, var(--accent));--_stepper-node-active-text-color: var(--ds-stepper-node-active-text-color, var(--accent-on));--_stepper-node-done-text-color: var(--ds-stepper-node-done-text-color, var(--accent));--_stepper-connector-color: var(--ds-stepper-connector-color, var(--border-divider));--_stepper-connector-done-color: var(--ds-stepper-connector-done-color, var(--accent))}:host .visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host .step{position:relative;flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;text-align:center}:host .node{position:relative;z-index:1;width:var(--stepper-node-size);height:var(--stepper-node-size);border-radius:var(--radius-pill);display:grid;place-items:center;border:var(--border-width-default) solid var(--border-strong);background:var(--_stepper-node-bg-color);color:var(--text-tertiary);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);transition:background-color var(--duration-base) var(--ease-standard),border-color var(--duration-base) var(--ease-standard),color var(--duration-base) var(--ease-standard)}:host .node.done{background:var(--accent-subtitle);border-color:var(--accent);color:var(--_stepper-node-done-text-color)}:host .node.active{background:var(--_stepper-node-active-bg-color);border-color:var(--accent);color:var(--_stepper-node-active-text-color)}:host .node.error{background:var(--error-subtitle);border-color:var(--error);color:var(--error)}:host button.node{padding:0;appearance:none;cursor:pointer}:host button.node:focus-visible{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:var(--focus-ring-offset)}:host .connector{position:absolute;z-index:0;top:calc((var(--stepper-node-size) - var(--stepper-bar-h)) / 2);left:50%;width:100%;height:var(--stepper-bar-h);background:var(--_stepper-connector-color);transition:background-color var(--duration-base) var(--ease-standard)}:host .connector.done{background:var(--_stepper-connector-done-color)}:host .step-label{max-width:14ch;margin-top:var(--space-2);font-size:var(--_stepper-label-font-size);font-weight:var(--font-weight-medium);line-height:var(--line-height-snug);color:var(--_stepper-label-color);overflow-wrap:anywhere;transition:color var(--duration-base) var(--ease-standard)}:host .step.is-current .step-label{font-weight:var(--font-weight-bold);color:var(--_stepper-label-color-current)}:host(.labels-inline){display:inline-flex;align-items:center;gap:var(--space-2)}:host(.labels-inline) .step{flex:0 0 auto;flex-direction:row;gap:var(--space-2)}:host(.labels-inline) .step-label{max-width:none;margin-top:0;white-space:nowrap}:host(.labels-inline) .connector{position:static;flex:0 0 auto;width:var(--stepper-bar-w)}:host(.is-vertical){flex-direction:column;align-items:stretch}:host(.is-vertical) .step{flex:0 0 auto;flex-direction:row;align-items:flex-start;text-align:left;gap:var(--space-3);padding-bottom:var(--space-4)}:host(.is-vertical) .step:last-child{padding-bottom:0}:host(.is-vertical) .step-label{max-width:none;margin-top:0;align-self:center}:host(.is-vertical) .connector{position:absolute;top:var(--stepper-node-size);left:calc((var(--stepper-node-size) - var(--stepper-bar-h)) / 2);width:var(--stepper-bar-h);height:calc(100% - var(--stepper-node-size))}\n"] }]
|
|
9979
10633
|
}], propDecorators: { steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: false }] }], current: [{ type: i0.Input, args: [{ isSignal: true, alias: "current", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], errorSteps: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorSteps", required: false }] }], stepClicked: [{ type: i0.Output, args: ["stepClicked"] }] } });
|
|
9980
10634
|
|
|
10635
|
+
const DS_TOAST_POSITION = new InjectionToken('DS_TOAST_POSITION');
|
|
10636
|
+
const DS_TOAST_POSITION_DEFAULT = {
|
|
10637
|
+
horizontalPosition: 'right',
|
|
10638
|
+
verticalPosition: 'top',
|
|
10639
|
+
offset: 'var(--space-6)',
|
|
10640
|
+
};
|
|
10641
|
+
const DS_TOAST_CONFIG = new InjectionToken('DS_TOAST_CONFIG');
|
|
10642
|
+
|
|
9981
10643
|
/**
|
|
9982
10644
|
* Single toast pill. Consumed by ToastRegion for service-driven runtime toasts
|
|
9983
10645
|
* AND by static showcases that need to display a toast specimen inline.
|
|
@@ -10039,13 +10701,35 @@ class ToastRegionComponent {
|
|
|
10039
10701
|
visibleEntries = signal([], ...(ngDevMode ? [{ debugName: "visibleEntries" }] : /* istanbul ignore next */ []));
|
|
10040
10702
|
leaving = signal(new Set(), ...(ngDevMode ? [{ debugName: "leaving" }] : /* istanbul ignore next */ []));
|
|
10041
10703
|
pendingQueue = [];
|
|
10704
|
+
timers = new Map();
|
|
10705
|
+
position = inject(DS_TOAST_POSITION, { optional: true });
|
|
10706
|
+
/** Newest goes NEAREST the anchor, so the toast that just fired appears where the
|
|
10707
|
+
* stack is pinned rather than at the far end of a list the reader has to hunt
|
|
10708
|
+
* down. DOM order is the visual order, so this also keeps the reading order. */
|
|
10709
|
+
newestFirst = (this.position ?? DS_TOAST_POSITION_DEFAULT).verticalPosition === 'top';
|
|
10042
10710
|
add(entry) {
|
|
10043
10711
|
const limit = this.maxVisible();
|
|
10044
10712
|
if (limit > 0 && this.visibleEntries().length >= limit) {
|
|
10045
10713
|
this.pendingQueue.push(entry);
|
|
10714
|
+
return;
|
|
10046
10715
|
}
|
|
10047
|
-
|
|
10048
|
-
|
|
10716
|
+
this.show(entry);
|
|
10717
|
+
}
|
|
10718
|
+
show(entry) {
|
|
10719
|
+
this.visibleEntries.update((existing) => this.newestFirst ? [entry, ...existing] : [...existing, entry]);
|
|
10720
|
+
this.startCountdown(entry);
|
|
10721
|
+
}
|
|
10722
|
+
startCountdown(entry) {
|
|
10723
|
+
if (entry.durationMs <= 0) {
|
|
10724
|
+
return;
|
|
10725
|
+
}
|
|
10726
|
+
this.timers.set(entry.id, window.setTimeout(() => this.remove(entry.id), entry.durationMs));
|
|
10727
|
+
}
|
|
10728
|
+
clearCountdown(id) {
|
|
10729
|
+
const timer = this.timers.get(id);
|
|
10730
|
+
if (timer !== undefined) {
|
|
10731
|
+
window.clearTimeout(timer);
|
|
10732
|
+
this.timers.delete(id);
|
|
10049
10733
|
}
|
|
10050
10734
|
}
|
|
10051
10735
|
/** Replace fields of an already-visible or queued toast in place. */
|
|
@@ -10064,6 +10748,12 @@ class ToastRegionComponent {
|
|
|
10064
10748
|
}
|
|
10065
10749
|
}
|
|
10066
10750
|
remove(id) {
|
|
10751
|
+
this.clearCountdown(id);
|
|
10752
|
+
const queueIndex = this.pendingQueue.findIndex((entry) => entry.id === id);
|
|
10753
|
+
if (queueIndex !== -1) {
|
|
10754
|
+
this.pendingQueue.splice(queueIndex, 1);
|
|
10755
|
+
return;
|
|
10756
|
+
}
|
|
10067
10757
|
if (this.leaving().has(id)) {
|
|
10068
10758
|
return;
|
|
10069
10759
|
}
|
|
@@ -10082,6 +10772,8 @@ class ToastRegionComponent {
|
|
|
10082
10772
|
return this.leaving().has(id);
|
|
10083
10773
|
}
|
|
10084
10774
|
clear() {
|
|
10775
|
+
this.timers.forEach((timer) => window.clearTimeout(timer));
|
|
10776
|
+
this.timers.clear();
|
|
10085
10777
|
this.visibleEntries.set([]);
|
|
10086
10778
|
this.leaving.set(new Set());
|
|
10087
10779
|
this.pendingQueue.length = 0;
|
|
@@ -10094,8 +10786,7 @@ class ToastRegionComponent {
|
|
|
10094
10786
|
if (limit > 0 && this.visibleEntries().length >= limit) {
|
|
10095
10787
|
return;
|
|
10096
10788
|
}
|
|
10097
|
-
|
|
10098
|
-
this.visibleEntries.update((existing) => [...existing, next]);
|
|
10789
|
+
this.show(this.pendingQueue.shift());
|
|
10099
10790
|
}
|
|
10100
10791
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ToastRegionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10101
10792
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: ToastRegionComponent, isStandalone: true, selector: "ds-toast-region", inputs: { maxVisible: { classPropertyName: "maxVisible", publicName: "maxVisible", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "region", "aria-label": "Notifications" } }, ngImport: i0, template: "@for (entry of visibleEntries(); track entry.id) {\n <ds-toast\n [variant]=\"entry.variant\"\n [title]=\"entry.title ?? ''\"\n [message]=\"entry.body\"\n [dismissible]=\"entry.dismissible\"\n [action]=\"entry.action ?? null\"\n [class.leaving]=\"isLeaving(entry.id)\"\n (closed)=\"remove(entry.id)\"\n />\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:var(--space-2)}\n"], dependencies: [{ kind: "component", type: ToastComponent, selector: "ds-toast", inputs: ["variant", "title", "message", "dismissible", "icon", "action"], outputs: ["closed"] }] });
|
|
@@ -10108,14 +10799,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
10108
10799
|
}, template: "@for (entry of visibleEntries(); track entry.id) {\n <ds-toast\n [variant]=\"entry.variant\"\n [title]=\"entry.title ?? ''\"\n [message]=\"entry.body\"\n [dismissible]=\"entry.dismissible\"\n [action]=\"entry.action ?? null\"\n [class.leaving]=\"isLeaving(entry.id)\"\n (closed)=\"remove(entry.id)\"\n />\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:var(--space-2)}\n"] }]
|
|
10109
10800
|
}], propDecorators: { maxVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisible", required: false }] }] } });
|
|
10110
10801
|
|
|
10111
|
-
const DS_TOAST_POSITION = new InjectionToken('DS_TOAST_POSITION');
|
|
10112
|
-
const DS_TOAST_POSITION_DEFAULT = {
|
|
10113
|
-
horizontalPosition: 'right',
|
|
10114
|
-
verticalPosition: 'top',
|
|
10115
|
-
offset: 'var(--space-6)',
|
|
10116
|
-
};
|
|
10117
|
-
const DS_TOAST_CONFIG = new InjectionToken('DS_TOAST_CONFIG');
|
|
10118
|
-
|
|
10119
10802
|
class ToastService {
|
|
10120
10803
|
overlay = inject(Overlay);
|
|
10121
10804
|
position = inject(DS_TOAST_POSITION, { optional: true });
|
|
@@ -10126,25 +10809,25 @@ class ToastService {
|
|
|
10126
10809
|
show(opts) {
|
|
10127
10810
|
this.ensureRegion();
|
|
10128
10811
|
const id = this.nextId++;
|
|
10812
|
+
const variant = opts.variant ?? 'info';
|
|
10813
|
+
// Loading toasts never auto-dismiss (0 = indefinite).
|
|
10814
|
+
const durationMs = variant === 'loading' ? 0 : (opts.durationMs ?? 5000);
|
|
10129
10815
|
const entry = {
|
|
10130
10816
|
id,
|
|
10131
10817
|
title: opts.title,
|
|
10132
10818
|
body: opts.body,
|
|
10133
|
-
variant
|
|
10819
|
+
variant,
|
|
10134
10820
|
dismissible: opts.dismissible ?? true,
|
|
10135
10821
|
action: opts.action,
|
|
10822
|
+
durationMs,
|
|
10136
10823
|
};
|
|
10824
|
+
// The region runs the countdown, because only it knows when the toast became
|
|
10825
|
+
// visible — started here, one queued behind `maxVisible` expires unseen.
|
|
10137
10826
|
this.regionRef.instance.add(entry);
|
|
10138
|
-
|
|
10827
|
+
return {
|
|
10139
10828
|
id,
|
|
10140
10829
|
dismiss: () => this.regionRef?.instance.remove(id),
|
|
10141
10830
|
};
|
|
10142
|
-
const duration = opts.durationMs ?? 5000;
|
|
10143
|
-
// Loading toasts never auto-dismiss (duration 0 means indefinite).
|
|
10144
|
-
if (duration > 0 && opts.variant !== 'loading') {
|
|
10145
|
-
window.setTimeout(() => ref.dismiss(), duration);
|
|
10146
|
-
}
|
|
10147
|
-
return ref;
|
|
10148
10831
|
}
|
|
10149
10832
|
/** Show a loading toast for the duration of `promise`. Resolves/rejects are
|
|
10150
10833
|
* reflected in-place (same toast, no stack-up) as success/error variants. */
|
|
@@ -10224,153 +10907,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
10224
10907
|
args: [{ providedIn: 'root' }]
|
|
10225
10908
|
}] });
|
|
10226
10909
|
|
|
10227
|
-
let nextId$2 = 0;
|
|
10228
|
-
class DrawerComponent {
|
|
10229
|
-
scrollLock = inject(BodyScrollLockService);
|
|
10230
|
-
/** Open state, two-way bound. */
|
|
10231
|
-
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
10232
|
-
/** Panel size — sm/md/lg. */
|
|
10233
|
-
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
10234
|
-
/** Edge the panel slides in from. */
|
|
10235
|
-
placement = input('right', ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
10236
|
-
/** Drawer title, shown in the header and used for `aria-labelledby`. */
|
|
10237
|
-
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
10238
|
-
/** Fires once the close (slide-out) animation finishes. */
|
|
10239
|
-
closed = output();
|
|
10240
|
-
titleId = `ds-drawer-title-${++nextId$2}`;
|
|
10241
|
-
/** Panel is in the DOM (kept true through the slide-out). */
|
|
10242
|
-
rendered = signal(false, ...(ngDevMode ? [{ debugName: "rendered" }] : /* istanbul ignore next */ []));
|
|
10243
|
-
/** Playing the slide-out + scrim-fade leave animation. */
|
|
10244
|
-
closing = signal(false, ...(ngDevMode ? [{ debugName: "closing" }] : /* istanbul ignore next */ []));
|
|
10245
|
-
wasOpen = false;
|
|
10246
|
-
closeFallbackTimer = null;
|
|
10247
|
-
classes = computed(() => {
|
|
10248
|
-
const parts = ['drawer', this.placement(), this.size()];
|
|
10249
|
-
return parts.join(' ');
|
|
10250
|
-
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
10251
|
-
constructor() {
|
|
10252
|
-
// open → DOM lifecycle: opening renders now; closing keeps the panel mounted
|
|
10253
|
-
// and flips `closing` so the slide-out can play (teardown in onLeaveEnd).
|
|
10254
|
-
effect(() => {
|
|
10255
|
-
const isOpen = this.open();
|
|
10256
|
-
if (isOpen) {
|
|
10257
|
-
this.closing.set(false);
|
|
10258
|
-
this.rendered.set(true);
|
|
10259
|
-
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
10260
|
-
this.closeFallbackTimer = null;
|
|
10261
|
-
}
|
|
10262
|
-
else if (this.wasOpen) {
|
|
10263
|
-
this.closing.set(true);
|
|
10264
|
-
// Chrome freezes CSS animations on a backgrounded tab, so animationend
|
|
10265
|
-
// may never fire — this synthetic fallback guarantees teardown anyway.
|
|
10266
|
-
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
10267
|
-
this.closeFallbackTimer = setTimeout(() => this.finishClose(), 300);
|
|
10268
|
-
}
|
|
10269
|
-
this.wasOpen = isOpen;
|
|
10270
|
-
});
|
|
10271
|
-
// Ref-counted body-scroll lock, shared with modal/bottom-sheet so stacked
|
|
10272
|
-
// overlays don't unlock each other. The effect's cleanup fires on the
|
|
10273
|
-
// rendered→false transition and on destroy, keeping lock/unlock paired.
|
|
10274
|
-
effect((onCleanup) => {
|
|
10275
|
-
if (!this.rendered()) {
|
|
10276
|
-
return;
|
|
10277
|
-
}
|
|
10278
|
-
this.scrollLock.lock();
|
|
10279
|
-
onCleanup(() => this.scrollLock.unlock());
|
|
10280
|
-
});
|
|
10281
|
-
}
|
|
10282
|
-
ngOnDestroy() {
|
|
10283
|
-
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
10284
|
-
this.closeFallbackTimer = null;
|
|
10285
|
-
}
|
|
10286
|
-
onClose() {
|
|
10287
|
-
this.open.set(false);
|
|
10288
|
-
}
|
|
10289
|
-
onLeaveEnd(event) {
|
|
10290
|
-
// The panel is the element with the handler, so its OWN animationend is the
|
|
10291
|
-
// signal; the scrim is a sibling and anything else is inside. This replaces
|
|
10292
|
-
// matching four keyframes NAMES, which is what made the exit un-overridable.
|
|
10293
|
-
if (event.target !== event.currentTarget) {
|
|
10294
|
-
return;
|
|
10295
|
-
}
|
|
10296
|
-
this.finishClose();
|
|
10297
|
-
}
|
|
10298
|
-
finishClose() {
|
|
10299
|
-
if (!this.closing()) {
|
|
10300
|
-
return;
|
|
10301
|
-
}
|
|
10302
|
-
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
10303
|
-
this.closeFallbackTimer = null;
|
|
10304
|
-
this.closing.set(false);
|
|
10305
|
-
this.rendered.set(false);
|
|
10306
|
-
this.closed.emit();
|
|
10307
|
-
}
|
|
10308
|
-
onEscape() {
|
|
10309
|
-
if (this.open()) {
|
|
10310
|
-
this.onClose();
|
|
10311
|
-
}
|
|
10312
|
-
}
|
|
10313
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10314
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: DrawerComponent, isStandalone: true, selector: "ds-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "openChange", closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: "@if (rendered()) {\n <div class=\"drawer-root\">\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- scrim; click dismisses, keyboard dismisses via Escape (host document:keydown.escape) -->\n <div\n class=\"drawer-scrim\"\n [class.closing]=\"closing()\"\n (click)=\"onClose()\"\n >\n </div>\n\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n [class]=\"classes()\"\n [class.closing]=\"closing()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n (keydown.escape)=\"onClose()\"\n (animationend)=\"onLeaveEnd($event)\"\n >\n <header class=\"header\">\n <h4\n class=\"title\"\n [id]=\"titleId\"\n >\n {{ title() }}\n </h4>\n\n <button\n type=\"button\"\n class=\"close\"\n aria-label=\"Close\"\n (click)=\"onClose()\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"16\"\n />\n </button>\n </header>\n\n <div class=\"body\">\n <ng-content select=\"[drawer-body]\"></ng-content>\n </div>\n\n <div class=\"footer\">\n <ng-content select=\"[drawer-footer]\"></ng-content>\n </div>\n </div>\n </div>\n}\n", styles: ["@charset \"UTF-8\";:host{--_drawer-bg-color: var(--ds-drawer-bg-color, var(--surface-overlay));--_drawer-scrim-color: var(--ds-drawer-scrim-color, var(--scrim, hsl(220deg 20% 12% / 45%)));--_drawer-shadow: var(--ds-drawer-shadow, var(--ds-elevation-modal));--_drawer-divider: var(--ds-drawer-divider, var(--border-divider));--_drawer-close-icon-color: var(--ds-drawer-close-icon-color, var(--icon-default));--_drawer-close-icon-color-hover: var(--ds-drawer-close-icon-color-hover, var(--icon-strong));--_drawer-radius: var(--ds-drawer-radius, 0);--_drawer-title-color: var(--ds-drawer-title-color, inherit);--_drawer-width-sm: var(--ds-drawer-width, var(--drawer-w-sm));--_drawer-width-md: var(--ds-drawer-width, var(--drawer-w-md));--_drawer-width-lg: var(--ds-drawer-width, var(--drawer-w-lg));--_drawer-enter-keyframes: var(--ds-drawer-enter-keyframes, ds-slide-edge-in);--_drawer-leave-keyframes: var(--ds-drawer-leave-keyframes, ds-slide-edge-out);--_drawer-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-large-duration));--_drawer-enter-easing: var(--ds-drawer-enter-easing, var(--ds-motion-enter-large-easing));--_drawer-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-large-duration));--_drawer-leave-easing: var(--ds-drawer-leave-easing, var(--ds-motion-exit-large-easing));--_drawer-scrim-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-panel-duration));--_drawer-scrim-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-drawer-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_drawer-enter-duration: 0ms;--_drawer-leave-duration: 0ms;--_drawer-scrim-enter-duration: 0ms;--_drawer-scrim-leave-duration: 0ms}}.drawer-root{position:fixed;inset:0;z-index:var(--layer-modal);overflow:clip}.drawer-scrim{position:absolute;inset:0;background:var(--_drawer-scrim-color);animation-name:ds-fade-in;animation-duration:var(--_drawer-scrim-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer-scrim.closing{animation-name:ds-fade-out;animation-duration:var(--_drawer-scrim-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer{position:absolute;background:var(--_drawer-bg-color);box-shadow:var(--_drawer-shadow);border-radius:var(--_drawer-radius);display:flex;flex-direction:column;isolation:isolate;animation-name:var(--_drawer-enter-keyframes);animation-duration:var(--_drawer-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer.closing{animation-duration:var(--_drawer-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer.sm{width:var(--_drawer-width-sm)}.drawer.md{width:var(--_drawer-width-md)}.drawer.lg{width:var(--_drawer-width-lg)}.drawer.right{--_ds-enter-x: 100%;top:0;right:0;bottom:0;max-width:100vw}.drawer.right.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.left{--_ds-enter-x: -100%;top:0;left:0;bottom:0;max-width:100vw}.drawer.left.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.top{--_ds-enter-y: -100%;top:0;left:0;right:0;width:auto;max-height:80vh}.drawer.top.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.bottom{--_ds-enter-y: 100%;bottom:0;left:0;right:0;width:auto;max-height:80vh}.drawer.bottom.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer .header{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-6);border-bottom:var(--border-width-default) solid var(--_drawer-divider)}.drawer .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_drawer-title-color);margin:0;flex:1}.drawer .close{background:transparent;border:0;width:var(--modal-close-size);height:var(--modal-close-size);color:var(--_drawer-close-icon-color);cursor:pointer;padding:0}.drawer .close:hover{color:var(--_drawer-close-icon-color-hover)}.drawer .close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.drawer .body{flex:1;padding:var(--space-6);overflow-y:auto}.drawer .footer{padding:var(--space-4) var(--space-6);border-top:var(--border-width-default) solid var(--_drawer-divider);display:flex;gap:var(--space-2);justify-content:flex-end}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
10315
|
-
}
|
|
10316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
10317
|
-
type: Component,
|
|
10318
|
-
args: [{ selector: 'ds-drawer', standalone: true, imports: [IconComponent, A11yModule], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
10319
|
-
'(document:keydown.escape)': 'onEscape()',
|
|
10320
|
-
}, template: "@if (rendered()) {\n <div class=\"drawer-root\">\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- scrim; click dismisses, keyboard dismisses via Escape (host document:keydown.escape) -->\n <div\n class=\"drawer-scrim\"\n [class.closing]=\"closing()\"\n (click)=\"onClose()\"\n >\n </div>\n\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n [class]=\"classes()\"\n [class.closing]=\"closing()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n (keydown.escape)=\"onClose()\"\n (animationend)=\"onLeaveEnd($event)\"\n >\n <header class=\"header\">\n <h4\n class=\"title\"\n [id]=\"titleId\"\n >\n {{ title() }}\n </h4>\n\n <button\n type=\"button\"\n class=\"close\"\n aria-label=\"Close\"\n (click)=\"onClose()\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"16\"\n />\n </button>\n </header>\n\n <div class=\"body\">\n <ng-content select=\"[drawer-body]\"></ng-content>\n </div>\n\n <div class=\"footer\">\n <ng-content select=\"[drawer-footer]\"></ng-content>\n </div>\n </div>\n </div>\n}\n", styles: ["@charset \"UTF-8\";:host{--_drawer-bg-color: var(--ds-drawer-bg-color, var(--surface-overlay));--_drawer-scrim-color: var(--ds-drawer-scrim-color, var(--scrim, hsl(220deg 20% 12% / 45%)));--_drawer-shadow: var(--ds-drawer-shadow, var(--ds-elevation-modal));--_drawer-divider: var(--ds-drawer-divider, var(--border-divider));--_drawer-close-icon-color: var(--ds-drawer-close-icon-color, var(--icon-default));--_drawer-close-icon-color-hover: var(--ds-drawer-close-icon-color-hover, var(--icon-strong));--_drawer-radius: var(--ds-drawer-radius, 0);--_drawer-title-color: var(--ds-drawer-title-color, inherit);--_drawer-width-sm: var(--ds-drawer-width, var(--drawer-w-sm));--_drawer-width-md: var(--ds-drawer-width, var(--drawer-w-md));--_drawer-width-lg: var(--ds-drawer-width, var(--drawer-w-lg));--_drawer-enter-keyframes: var(--ds-drawer-enter-keyframes, ds-slide-edge-in);--_drawer-leave-keyframes: var(--ds-drawer-leave-keyframes, ds-slide-edge-out);--_drawer-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-large-duration));--_drawer-enter-easing: var(--ds-drawer-enter-easing, var(--ds-motion-enter-large-easing));--_drawer-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-large-duration));--_drawer-leave-easing: var(--ds-drawer-leave-easing, var(--ds-motion-exit-large-easing));--_drawer-scrim-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-panel-duration));--_drawer-scrim-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-drawer-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_drawer-enter-duration: 0ms;--_drawer-leave-duration: 0ms;--_drawer-scrim-enter-duration: 0ms;--_drawer-scrim-leave-duration: 0ms}}.drawer-root{position:fixed;inset:0;z-index:var(--layer-modal);overflow:clip}.drawer-scrim{position:absolute;inset:0;background:var(--_drawer-scrim-color);animation-name:ds-fade-in;animation-duration:var(--_drawer-scrim-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer-scrim.closing{animation-name:ds-fade-out;animation-duration:var(--_drawer-scrim-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer{position:absolute;background:var(--_drawer-bg-color);box-shadow:var(--_drawer-shadow);border-radius:var(--_drawer-radius);display:flex;flex-direction:column;isolation:isolate;animation-name:var(--_drawer-enter-keyframes);animation-duration:var(--_drawer-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer.closing{animation-duration:var(--_drawer-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer.sm{width:var(--_drawer-width-sm)}.drawer.md{width:var(--_drawer-width-md)}.drawer.lg{width:var(--_drawer-width-lg)}.drawer.right{--_ds-enter-x: 100%;top:0;right:0;bottom:0;max-width:100vw}.drawer.right.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.left{--_ds-enter-x: -100%;top:0;left:0;bottom:0;max-width:100vw}.drawer.left.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.top{--_ds-enter-y: -100%;top:0;left:0;right:0;width:auto;max-height:80vh}.drawer.top.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.bottom{--_ds-enter-y: 100%;bottom:0;left:0;right:0;width:auto;max-height:80vh}.drawer.bottom.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer .header{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-6);border-bottom:var(--border-width-default) solid var(--_drawer-divider)}.drawer .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_drawer-title-color);margin:0;flex:1}.drawer .close{background:transparent;border:0;width:var(--modal-close-size);height:var(--modal-close-size);color:var(--_drawer-close-icon-color);cursor:pointer;padding:0}.drawer .close:hover{color:var(--_drawer-close-icon-color-hover)}.drawer .close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.drawer .body{flex:1;padding:var(--space-6);overflow-y:auto}.drawer .footer{padding:var(--space-4) var(--space-6);border-top:var(--border-width-default) solid var(--_drawer-divider);display:flex;gap:var(--space-2);justify-content:flex-end}\n"] }]
|
|
10321
|
-
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
10322
|
-
|
|
10323
10910
|
let nextId$1 = 0;
|
|
10324
|
-
|
|
10325
|
-
* tap, Escape, or a downward drag on the grab strip. While open it locks
|
|
10326
|
-
* body scroll. On wide viewports the panel is capped by
|
|
10327
|
-
* --ds-bottom-sheet-maxw and centred; prefer ds-modal / ds-drawer for
|
|
10328
|
-
* desktop-first layouts. position: fixed resolves against the nearest
|
|
10329
|
-
* ancestor containing block, so framed hosts contain the sheet. */
|
|
10330
|
-
class BottomSheetComponent {
|
|
10331
|
-
/** Open state, two-way bound. */
|
|
10332
|
-
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
10333
|
-
/** Sheet title, shown in the header and used for `aria-labelledby`. */
|
|
10334
|
-
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
10335
|
-
/** Fires once the close (leave) animation finishes. */
|
|
10336
|
-
closed = output();
|
|
10337
|
-
titleId = `ds-bottom-sheet-title-${++nextId$1}`;
|
|
10338
|
-
/**
|
|
10339
|
-
* Snap-point heights as fractions of viewport height (0–1), ascending.
|
|
10340
|
-
* e.g. [0.4, 0.9]. When provided the sheet opens at the first snap point;
|
|
10341
|
-
* dragging snaps to the nearest point; dragging below the lowest closes.
|
|
10342
|
-
* When empty (default) the original single-height behavior is preserved.
|
|
10343
|
-
*/
|
|
10344
|
-
snapPoints = input([], ...(ngDevMode ? [{ debugName: "snapPoints" }] : /* istanbul ignore next */ []));
|
|
10345
|
-
doc = inject(DOCUMENT$1);
|
|
10911
|
+
class DrawerComponent {
|
|
10346
10912
|
scrollLock = inject(BodyScrollLockService);
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
/**
|
|
10350
|
-
|
|
10351
|
-
/**
|
|
10352
|
-
|
|
10353
|
-
/**
|
|
10354
|
-
|
|
10355
|
-
/**
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
return `${points[index] * 100}vh`;
|
|
10363
|
-
}, ...(ngDevMode ? [{ debugName: "snapHeight" }] : /* istanbul ignore next */ []));
|
|
10364
|
-
dragStartY = 0;
|
|
10365
|
-
lastMoveY = 0;
|
|
10366
|
-
lastMoveTime = 0;
|
|
10367
|
-
velocity = 0;
|
|
10913
|
+
/** Open state, two-way bound. */
|
|
10914
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
10915
|
+
/** Panel size — sm/md/lg. */
|
|
10916
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
10917
|
+
/** Edge the panel slides in from. */
|
|
10918
|
+
placement = input('right', ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
10919
|
+
/** Drawer title, shown in the header and used for `aria-labelledby`. */
|
|
10920
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
10921
|
+
/** Fires once the close (slide-out) animation finishes. */
|
|
10922
|
+
closed = output();
|
|
10923
|
+
titleId = `ds-drawer-title-${++nextId$1}`;
|
|
10924
|
+
/** Panel is in the DOM (kept true through the slide-out). */
|
|
10925
|
+
rendered = signal(false, ...(ngDevMode ? [{ debugName: "rendered" }] : /* istanbul ignore next */ []));
|
|
10926
|
+
/** Playing the slide-out + scrim-fade leave animation. */
|
|
10927
|
+
closing = signal(false, ...(ngDevMode ? [{ debugName: "closing" }] : /* istanbul ignore next */ []));
|
|
10368
10928
|
wasOpen = false;
|
|
10369
10929
|
closeFallbackTimer = null;
|
|
10930
|
+
classes = computed(() => {
|
|
10931
|
+
const parts = ['drawer', this.placement(), this.size()];
|
|
10932
|
+
return parts.join(' ');
|
|
10933
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
10370
10934
|
constructor() {
|
|
10371
|
-
// open → DOM lifecycle
|
|
10372
|
-
//
|
|
10373
|
-
// teardown happens in onLeaveEnd() once animationend fires.
|
|
10935
|
+
// open → DOM lifecycle: opening renders now; closing keeps the panel mounted
|
|
10936
|
+
// and flips `closing` so the slide-out can play (teardown in onLeaveEnd).
|
|
10374
10937
|
effect(() => {
|
|
10375
10938
|
const isOpen = this.open();
|
|
10376
10939
|
if (isOpen) {
|
|
@@ -10378,9 +10941,6 @@ class BottomSheetComponent {
|
|
|
10378
10941
|
this.rendered.set(true);
|
|
10379
10942
|
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
10380
10943
|
this.closeFallbackTimer = null;
|
|
10381
|
-
if (this.snapPoints().length > 0) {
|
|
10382
|
-
this.activeSnapIndex.set(0);
|
|
10383
|
-
}
|
|
10384
10944
|
}
|
|
10385
10945
|
else if (this.wasOpen) {
|
|
10386
10946
|
this.closing.set(true);
|
|
@@ -10391,9 +10951,9 @@ class BottomSheetComponent {
|
|
|
10391
10951
|
}
|
|
10392
10952
|
this.wasOpen = isOpen;
|
|
10393
10953
|
});
|
|
10394
|
-
// Ref-counted body-scroll lock, shared with modal/
|
|
10395
|
-
// overlays don't unlock each other. The cleanup fires on the
|
|
10396
|
-
// transition and on destroy, keeping lock/unlock paired.
|
|
10954
|
+
// Ref-counted body-scroll lock, shared with modal/bottom-sheet so stacked
|
|
10955
|
+
// overlays don't unlock each other. The effect's cleanup fires on the
|
|
10956
|
+
// rendered→false transition and on destroy, keeping lock/unlock paired.
|
|
10397
10957
|
effect((onCleanup) => {
|
|
10398
10958
|
if (!this.rendered()) {
|
|
10399
10959
|
return;
|
|
@@ -10406,14 +10966,13 @@ class BottomSheetComponent {
|
|
|
10406
10966
|
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
10407
10967
|
this.closeFallbackTimer = null;
|
|
10408
10968
|
}
|
|
10409
|
-
|
|
10410
|
-
this.dragOffset.set(null);
|
|
10969
|
+
onClose() {
|
|
10411
10970
|
this.open.set(false);
|
|
10412
10971
|
}
|
|
10413
10972
|
onLeaveEnd(event) {
|
|
10414
|
-
// The
|
|
10415
|
-
//
|
|
10416
|
-
// keyframes
|
|
10973
|
+
// The panel is the element with the handler, so its OWN animationend is the
|
|
10974
|
+
// signal; the scrim is a sibling and anything else is inside. This replaces
|
|
10975
|
+
// matching four keyframes NAMES, which is what made the exit un-overridable.
|
|
10417
10976
|
if (event.target !== event.currentTarget) {
|
|
10418
10977
|
return;
|
|
10419
10978
|
}
|
|
@@ -10431,85 +10990,18 @@ class BottomSheetComponent {
|
|
|
10431
10990
|
}
|
|
10432
10991
|
onEscape() {
|
|
10433
10992
|
if (this.open()) {
|
|
10434
|
-
this.
|
|
10435
|
-
}
|
|
10436
|
-
}
|
|
10437
|
-
backdropPress = backdropDismiss();
|
|
10438
|
-
onBackdropRelease(event) {
|
|
10439
|
-
if (this.backdropPress.shouldDismiss(event)) {
|
|
10440
|
-
this.close();
|
|
10441
|
-
}
|
|
10442
|
-
}
|
|
10443
|
-
onGrabStart(event) {
|
|
10444
|
-
event.target.setPointerCapture(event.pointerId);
|
|
10445
|
-
this.dragStartY = event.clientY;
|
|
10446
|
-
this.lastMoveY = event.clientY;
|
|
10447
|
-
this.lastMoveTime = event.timeStamp;
|
|
10448
|
-
this.velocity = 0;
|
|
10449
|
-
this.dragOffset.set(0);
|
|
10450
|
-
}
|
|
10451
|
-
onGrabMove(event) {
|
|
10452
|
-
if (this.dragOffset() === null) {
|
|
10453
|
-
return;
|
|
10454
|
-
}
|
|
10455
|
-
const deltaTime = event.timeStamp - this.lastMoveTime;
|
|
10456
|
-
if (deltaTime > 0) {
|
|
10457
|
-
this.velocity = (event.clientY - this.lastMoveY) / deltaTime;
|
|
10458
|
-
}
|
|
10459
|
-
this.lastMoveY = event.clientY;
|
|
10460
|
-
this.lastMoveTime = event.timeStamp;
|
|
10461
|
-
this.dragOffset.set(Math.max(0, event.clientY - this.dragStartY));
|
|
10462
|
-
}
|
|
10463
|
-
onGrabEnd() {
|
|
10464
|
-
const offset = this.dragOffset();
|
|
10465
|
-
if (offset === null) {
|
|
10466
|
-
return;
|
|
10467
|
-
}
|
|
10468
|
-
const points = this.snapPoints();
|
|
10469
|
-
if (points.length === 0) {
|
|
10470
|
-
// Original single-height behavior.
|
|
10471
|
-
const sheetHeight = this.sheetRef()?.nativeElement.offsetHeight ?? 0;
|
|
10472
|
-
const pastThreshold = sheetHeight > 0 && offset > sheetHeight * 0.3;
|
|
10473
|
-
const flicked = this.velocity > 0.5;
|
|
10474
|
-
if (pastThreshold || flicked) {
|
|
10475
|
-
this.close();
|
|
10476
|
-
}
|
|
10477
|
-
else {
|
|
10478
|
-
this.dragOffset.set(null);
|
|
10479
|
-
}
|
|
10480
|
-
return;
|
|
10481
|
-
}
|
|
10482
|
-
// Snap-point behavior: determine which snap point to land on.
|
|
10483
|
-
const viewportHeight = this.doc.defaultView?.innerHeight ?? window.innerHeight;
|
|
10484
|
-
const currentIndex = this.activeSnapIndex();
|
|
10485
|
-
const currentHeightPx = points[currentIndex] * viewportHeight;
|
|
10486
|
-
// Positive offset = dragged downward.
|
|
10487
|
-
const targetHeightPx = currentHeightPx - offset;
|
|
10488
|
-
const flicked = this.velocity > 0.5;
|
|
10489
|
-
if (flicked || targetHeightPx < points[0] * viewportHeight * 0.7) {
|
|
10490
|
-
// Dragged below lowest snap point or flicked down → close.
|
|
10491
|
-
this.close();
|
|
10492
|
-
return;
|
|
10493
|
-
}
|
|
10494
|
-
let nearestIndex = 0;
|
|
10495
|
-
let smallestDelta = Infinity;
|
|
10496
|
-
for (let pointIndex = 0; pointIndex < points.length; pointIndex++) {
|
|
10497
|
-
const delta = Math.abs(points[pointIndex] * viewportHeight - targetHeightPx);
|
|
10498
|
-
if (delta < smallestDelta) {
|
|
10499
|
-
smallestDelta = delta;
|
|
10500
|
-
nearestIndex = pointIndex;
|
|
10501
|
-
}
|
|
10993
|
+
this.onClose();
|
|
10502
10994
|
}
|
|
10503
|
-
this.dragOffset.set(null);
|
|
10504
|
-
this.activeSnapIndex.set(nearestIndex);
|
|
10505
10995
|
}
|
|
10506
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type:
|
|
10507
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type:
|
|
10996
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10997
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: DrawerComponent, isStandalone: true, selector: "ds-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "openChange", closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: "@if (rendered()) {\n <div class=\"drawer-root\">\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- scrim; click dismisses, keyboard dismisses via Escape (host document:keydown.escape) -->\n <div\n class=\"drawer-scrim\"\n [class.closing]=\"closing()\"\n (click)=\"onClose()\"\n >\n </div>\n\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n [class]=\"classes()\"\n [class.closing]=\"closing()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n (keydown.escape)=\"onClose()\"\n (animationend)=\"onLeaveEnd($event)\"\n >\n <header class=\"header\">\n <h4\n class=\"title\"\n [id]=\"titleId\"\n >\n {{ title() }}\n </h4>\n\n <button\n type=\"button\"\n class=\"close\"\n aria-label=\"Close\"\n (click)=\"onClose()\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"16\"\n />\n </button>\n </header>\n\n <div class=\"body\">\n <ng-content select=\"[drawer-body]\"></ng-content>\n </div>\n\n <div class=\"footer\">\n <ng-content select=\"[drawer-footer]\"></ng-content>\n </div>\n </div>\n </div>\n}\n", styles: ["@charset \"UTF-8\";:host{--_drawer-bg-color: var(--ds-drawer-bg-color, var(--surface-overlay));--_drawer-scrim-color: var(--ds-drawer-scrim-color, var(--scrim, hsl(220deg 20% 12% / 45%)));--_drawer-shadow: var(--ds-drawer-shadow, var(--ds-elevation-modal));--_drawer-divider: var(--ds-drawer-divider, var(--border-divider));--_drawer-close-icon-color: var(--ds-drawer-close-icon-color, var(--icon-default));--_drawer-close-icon-color-hover: var(--ds-drawer-close-icon-color-hover, var(--icon-strong));--_drawer-radius: var(--ds-drawer-radius, 0);--_drawer-title-color: var(--ds-drawer-title-color, inherit);--_drawer-width-sm: var(--ds-drawer-width, var(--drawer-w-sm));--_drawer-width-md: var(--ds-drawer-width, var(--drawer-w-md));--_drawer-width-lg: var(--ds-drawer-width, var(--drawer-w-lg));--_drawer-enter-keyframes: var(--ds-drawer-enter-keyframes, ds-slide-edge-in);--_drawer-leave-keyframes: var(--ds-drawer-leave-keyframes, ds-slide-edge-out);--_drawer-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-large-duration));--_drawer-enter-easing: var(--ds-drawer-enter-easing, var(--ds-motion-enter-large-easing));--_drawer-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-large-duration));--_drawer-leave-easing: var(--ds-drawer-leave-easing, var(--ds-motion-exit-large-easing));--_drawer-scrim-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-panel-duration));--_drawer-scrim-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-drawer-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_drawer-enter-duration: 0ms;--_drawer-leave-duration: 0ms;--_drawer-scrim-enter-duration: 0ms;--_drawer-scrim-leave-duration: 0ms}}.drawer-root{position:fixed;inset:0;z-index:var(--layer-modal);overflow:clip}.drawer-scrim{position:absolute;inset:0;background:var(--_drawer-scrim-color);animation-name:ds-fade-in;animation-duration:var(--_drawer-scrim-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer-scrim.closing{animation-name:ds-fade-out;animation-duration:var(--_drawer-scrim-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer{position:absolute;background:var(--_drawer-bg-color);box-shadow:var(--_drawer-shadow);border-radius:var(--_drawer-radius);display:flex;flex-direction:column;isolation:isolate;animation-name:var(--_drawer-enter-keyframes);animation-duration:var(--_drawer-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer.closing{animation-duration:var(--_drawer-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer.sm{width:var(--_drawer-width-sm)}.drawer.md{width:var(--_drawer-width-md)}.drawer.lg{width:var(--_drawer-width-lg)}.drawer.right{--_ds-enter-x: 100%;top:0;right:0;bottom:0;max-width:100vw}.drawer.right.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.left{--_ds-enter-x: -100%;top:0;left:0;bottom:0;max-width:100vw}.drawer.left.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.top{--_ds-enter-y: -100%;top:0;left:0;right:0;width:auto;max-height:80vh}.drawer.top.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.bottom{--_ds-enter-y: 100%;bottom:0;left:0;right:0;width:auto;max-height:80vh}.drawer.bottom.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer .header{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-6);border-bottom:var(--border-width-default) solid var(--_drawer-divider)}.drawer .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_drawer-title-color);margin:0;flex:1}.drawer .close{background:transparent;border:0;width:var(--modal-close-size);height:var(--modal-close-size);color:var(--_drawer-close-icon-color);cursor:pointer;padding:0}.drawer .close:hover{color:var(--_drawer-close-icon-color-hover)}.drawer .close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.drawer .body{flex:1;padding:var(--space-6);overflow-y:auto}.drawer .footer{padding:var(--space-4) var(--space-6);border-top:var(--border-width-default) solid var(--_drawer-divider);display:flex;gap:var(--space-2);justify-content:flex-end}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
10508
10998
|
}
|
|
10509
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type:
|
|
10999
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
10510
11000
|
type: Component,
|
|
10511
|
-
args: [{ selector: 'ds-
|
|
10512
|
-
|
|
11001
|
+
args: [{ selector: 'ds-drawer', standalone: true, imports: [IconComponent, A11yModule], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
11002
|
+
'(document:keydown.escape)': 'onEscape()',
|
|
11003
|
+
}, template: "@if (rendered()) {\n <div class=\"drawer-root\">\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- scrim; click dismisses, keyboard dismisses via Escape (host document:keydown.escape) -->\n <div\n class=\"drawer-scrim\"\n [class.closing]=\"closing()\"\n (click)=\"onClose()\"\n >\n </div>\n\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n [class]=\"classes()\"\n [class.closing]=\"closing()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n (keydown.escape)=\"onClose()\"\n (animationend)=\"onLeaveEnd($event)\"\n >\n <header class=\"header\">\n <h4\n class=\"title\"\n [id]=\"titleId\"\n >\n {{ title() }}\n </h4>\n\n <button\n type=\"button\"\n class=\"close\"\n aria-label=\"Close\"\n (click)=\"onClose()\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"16\"\n />\n </button>\n </header>\n\n <div class=\"body\">\n <ng-content select=\"[drawer-body]\"></ng-content>\n </div>\n\n <div class=\"footer\">\n <ng-content select=\"[drawer-footer]\"></ng-content>\n </div>\n </div>\n </div>\n}\n", styles: ["@charset \"UTF-8\";:host{--_drawer-bg-color: var(--ds-drawer-bg-color, var(--surface-overlay));--_drawer-scrim-color: var(--ds-drawer-scrim-color, var(--scrim, hsl(220deg 20% 12% / 45%)));--_drawer-shadow: var(--ds-drawer-shadow, var(--ds-elevation-modal));--_drawer-divider: var(--ds-drawer-divider, var(--border-divider));--_drawer-close-icon-color: var(--ds-drawer-close-icon-color, var(--icon-default));--_drawer-close-icon-color-hover: var(--ds-drawer-close-icon-color-hover, var(--icon-strong));--_drawer-radius: var(--ds-drawer-radius, 0);--_drawer-title-color: var(--ds-drawer-title-color, inherit);--_drawer-width-sm: var(--ds-drawer-width, var(--drawer-w-sm));--_drawer-width-md: var(--ds-drawer-width, var(--drawer-w-md));--_drawer-width-lg: var(--ds-drawer-width, var(--drawer-w-lg));--_drawer-enter-keyframes: var(--ds-drawer-enter-keyframes, ds-slide-edge-in);--_drawer-leave-keyframes: var(--ds-drawer-leave-keyframes, ds-slide-edge-out);--_drawer-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-large-duration));--_drawer-enter-easing: var(--ds-drawer-enter-easing, var(--ds-motion-enter-large-easing));--_drawer-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-large-duration));--_drawer-leave-easing: var(--ds-drawer-leave-easing, var(--ds-motion-exit-large-easing));--_drawer-scrim-enter-duration: var(--ds-drawer-enter-duration, var(--ds-motion-enter-panel-duration));--_drawer-scrim-leave-duration: var(--ds-drawer-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-drawer-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_drawer-enter-duration: 0ms;--_drawer-leave-duration: 0ms;--_drawer-scrim-enter-duration: 0ms;--_drawer-scrim-leave-duration: 0ms}}.drawer-root{position:fixed;inset:0;z-index:var(--layer-modal);overflow:clip}.drawer-scrim{position:absolute;inset:0;background:var(--_drawer-scrim-color);animation-name:ds-fade-in;animation-duration:var(--_drawer-scrim-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer-scrim.closing{animation-name:ds-fade-out;animation-duration:var(--_drawer-scrim-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer{position:absolute;background:var(--_drawer-bg-color);box-shadow:var(--_drawer-shadow);border-radius:var(--_drawer-radius);display:flex;flex-direction:column;isolation:isolate;animation-name:var(--_drawer-enter-keyframes);animation-duration:var(--_drawer-enter-duration);animation-timing-function:var(--_drawer-enter-easing)}.drawer.closing{animation-duration:var(--_drawer-leave-duration);animation-timing-function:var(--_drawer-leave-easing);animation-fill-mode:forwards}.drawer.sm{width:var(--_drawer-width-sm)}.drawer.md{width:var(--_drawer-width-md)}.drawer.lg{width:var(--_drawer-width-lg)}.drawer.right{--_ds-enter-x: 100%;top:0;right:0;bottom:0;max-width:100vw}.drawer.right.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.left{--_ds-enter-x: -100%;top:0;left:0;bottom:0;max-width:100vw}.drawer.left.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.top{--_ds-enter-y: -100%;top:0;left:0;right:0;width:auto;max-height:80vh}.drawer.top.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer.bottom{--_ds-enter-y: 100%;bottom:0;left:0;right:0;width:auto;max-height:80vh}.drawer.bottom.closing{animation-name:var(--_drawer-leave-keyframes)}.drawer .header{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-6);border-bottom:var(--border-width-default) solid var(--_drawer-divider)}.drawer .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_drawer-title-color);margin:0;flex:1}.drawer .close{background:transparent;border:0;width:var(--modal-close-size);height:var(--modal-close-size);color:var(--_drawer-close-icon-color);cursor:pointer;padding:0}.drawer .close:hover{color:var(--_drawer-close-icon-color-hover)}.drawer .close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.drawer .body{flex:1;padding:var(--space-6);overflow-y:auto}.drawer .footer{padding:var(--space-4) var(--space-6);border-top:var(--border-width-default) solid var(--_drawer-divider);display:flex;gap:var(--space-2);justify-content:flex-end}\n"] }]
|
|
11004
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
10513
11005
|
|
|
10514
11006
|
class TagComponent {
|
|
10515
11007
|
/** Fill style — `solid` for high-emphasis, `neutral` for low-emphasis chips. */
|
|
@@ -10598,7 +11090,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
10598
11090
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
10599
11091
|
|
|
10600
11092
|
/**
|
|
10601
|
-
* How many chips fit one line of a trigger, measured rather than
|
|
11093
|
+
* @fileoverview How many chips fit one line of a trigger, measured rather than
|
|
11094
|
+
* guessed.
|
|
10602
11095
|
*
|
|
10603
11096
|
* INVARIANT: nothing here may measure something the cut itself changes, or the
|
|
10604
11097
|
* measurement feeds back into its own input and the split never settles — a hung
|
|
@@ -10609,6 +11102,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
10609
11102
|
* carry `data-chip`, and they sit in a row of their own that is a direct child of
|
|
10610
11103
|
* the trigger. `enabled` gates the whole thing because measuring forces layout.
|
|
10611
11104
|
*/
|
|
11105
|
+
/**
|
|
11106
|
+
* The content width of the element the trigger sits in, or null when there is no
|
|
11107
|
+
* usable one — a detached node, or a parent that hugs its content too, in which
|
|
11108
|
+
* case it carries the same feedback and measuring it would buy nothing.
|
|
11109
|
+
*/
|
|
11110
|
+
function hostContentWidth(host) {
|
|
11111
|
+
if (!host || host.clientWidth === 0) {
|
|
11112
|
+
return null;
|
|
11113
|
+
}
|
|
11114
|
+
const styles = getComputedStyle(host);
|
|
11115
|
+
if (styles.width === 'fit-content' || styles.display === 'inline') {
|
|
11116
|
+
return null;
|
|
11117
|
+
}
|
|
11118
|
+
return (host.clientWidth -
|
|
11119
|
+
parseFloat(styles.paddingLeft) -
|
|
11120
|
+
parseFloat(styles.paddingRight));
|
|
11121
|
+
}
|
|
10612
11122
|
/** Room held for "+N more", in em so a retuned type scale carries. Measured at
|
|
10613
11123
|
* 4.5em wide with three digits; 5em keeps a chip from being dropped for a pixel. */
|
|
10614
11124
|
const MARKER_RESERVE_EM = 5;
|
|
@@ -10644,7 +11154,15 @@ selectionSize = count) {
|
|
|
10644
11154
|
if (!trigger) {
|
|
10645
11155
|
return;
|
|
10646
11156
|
}
|
|
10647
|
-
|
|
11157
|
+
// The INVARIANT at the top of this file, made concrete: a trigger that hugs
|
|
11158
|
+
// its content (`width: fit-content`, which both compact modes set) has a width
|
|
11159
|
+
// decided by the chips this cut removes, so reading it feeds the result back
|
|
11160
|
+
// into its own input. The parent's content box is the space actually
|
|
11161
|
+
// available and does not move when the chips do. For a `fill` trigger the two
|
|
11162
|
+
// are the same number, so nothing changes there.
|
|
11163
|
+
const host = trigger.parentElement;
|
|
11164
|
+
const budget = hostContentWidth(host) ?? trigger.clientWidth;
|
|
11165
|
+
const width = budget;
|
|
10648
11166
|
const currentCount = untracked(count);
|
|
10649
11167
|
const cacheIsCurrent = untracked(measuredFor) === currentCount;
|
|
10650
11168
|
if (width === lastWidth && currentCount === lastCount && cacheIsCurrent) {
|
|
@@ -10654,9 +11172,11 @@ selectionSize = count) {
|
|
|
10654
11172
|
lastCount = currentCount;
|
|
10655
11173
|
const triggerStyles = getComputedStyle(trigger);
|
|
10656
11174
|
const columnGap = parseFloat(triggerStyles.columnGap) || 0;
|
|
10657
|
-
let free =
|
|
11175
|
+
let free = budget -
|
|
10658
11176
|
parseFloat(triggerStyles.paddingLeft) -
|
|
10659
|
-
parseFloat(triggerStyles.paddingRight)
|
|
11177
|
+
parseFloat(triggerStyles.paddingRight) -
|
|
11178
|
+
parseFloat(triggerStyles.borderLeftWidth) -
|
|
11179
|
+
parseFloat(triggerStyles.borderRightWidth);
|
|
10660
11180
|
for (const sibling of trigger.children) {
|
|
10661
11181
|
if (sibling !== row) {
|
|
10662
11182
|
free -= reservedWidth(sibling) + columnGap;
|
|
@@ -10833,6 +11353,54 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
10833
11353
|
allowCreate = input(false, { ...(ngDevMode ? { debugName: "allowCreate" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
10834
11354
|
/** Field label above the control — the same meaning it has on the other two pickers. */
|
|
10835
11355
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
11356
|
+
/** How two values are decided to be the same one. The default is `===`, which
|
|
11357
|
+
* is reference identity — so with object values a re-fetch that returns equal
|
|
11358
|
+
* data as NEW objects loses the selection. Pass a comparator keyed on whatever
|
|
11359
|
+
* identifies the value: `(a, b) => a?.id === b?.id`. */
|
|
11360
|
+
compareWith = input((a, b) => a === b, ...(ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []));
|
|
11361
|
+
/** Native `name` attribute forwarded to the trigger. */
|
|
11362
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
11363
|
+
/** Prevents opening the panel while still allowing focus. */
|
|
11364
|
+
readOnly = input(false, { ...(ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
11365
|
+
/**
|
|
11366
|
+
* The contract spelling of `readOnly`, a second input because signal forms binds
|
|
11367
|
+
* by NAME — a `readonly()` rule was reaching nothing before this existed.
|
|
11368
|
+
*/
|
|
11369
|
+
readonlyBinding = input(false, { ...(ngDevMode ? { debugName: "readonlyBinding" } : /* istanbul ignore next */ {}),
|
|
11370
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
11371
|
+
alias: 'readonly',
|
|
11372
|
+
transform: booleanAttribute });
|
|
11373
|
+
/** Shows a clear affordance once there is something to clear. */
|
|
11374
|
+
clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
11375
|
+
/** Placeholder while the field is being typed in, when a value is already
|
|
11376
|
+
* settled — `placeholder` is the empty-field caption and cannot be both.
|
|
11377
|
+
* Empty (the default) keeps `placeholder` doing both jobs, as before. */
|
|
11378
|
+
searchPlaceholder = input('', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
11379
|
+
/** How the typed query narrows the list.
|
|
11380
|
+
*
|
|
11381
|
+
* The default matches a case-insensitive substring of `label`. Pass a predicate
|
|
11382
|
+
* to match on anything else — a second field, ignoring diacritics, a fuzzy score.
|
|
11383
|
+
* Pass `'none'` when the list arrives already filtered, which is what a
|
|
11384
|
+
* server-side search needs: the query is reported through `filterChange` and
|
|
11385
|
+
* every option given is rendered.
|
|
11386
|
+
*/
|
|
11387
|
+
filterWith = input((option, query) => option.label.toLowerCase().includes(query), ...(ngDevMode ? [{ debugName: "filterWith" }] : /* istanbul ignore next */ []));
|
|
11388
|
+
/** The query the user typed, on every change. The input for a server-side search;
|
|
11389
|
+
* pair it with `filterWith="none"` so the list is not narrowed twice. */
|
|
11390
|
+
filterChange = output();
|
|
11391
|
+
/** Options are still being fetched. The panel shows a spinner instead of the
|
|
11392
|
+
* empty row — which would otherwise claim there are no matches — and the list
|
|
11393
|
+
* reports `aria-busy`. */
|
|
11394
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
11395
|
+
/** The panel opened. The moment to fetch options for a picker whose list is
|
|
11396
|
+
* loaded on demand. */
|
|
11397
|
+
opened = output();
|
|
11398
|
+
/** The panel closed, for any reason — a pick, Escape, an outside click, a scroll. */
|
|
11399
|
+
closed = output();
|
|
11400
|
+
/** Scrolls the keyboard cursor's row into view. On by default: a list longer
|
|
11401
|
+
* than the panel otherwise walks the cursor out of sight. Set `false` only if
|
|
11402
|
+
* you are driving the scroll position yourself. */
|
|
11403
|
+
scrollActiveIntoView = input(true, { ...(ngDevMode ? { debugName: "scrollActiveIntoView" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
10836
11404
|
/** Marks the field required: a `*` beside the label and `aria-required` on the input. */
|
|
10837
11405
|
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
10838
11406
|
/** Marks the field optional in words, for a form where most fields are required. */
|
|
@@ -10859,6 +11427,9 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
10859
11427
|
optionTemplate = contentChild(DsOptionTemplateDirective, { ...(ngDevMode ? { debugName: "optionTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
10860
11428
|
chipTemplate = contentChild(DsChipTemplateDirective, { ...(ngDevMode ? { debugName: "chipTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
10861
11429
|
pickerTrigger = contentChild(DsPickerTriggerDirective, { ...(ngDevMode ? { debugName: "pickerTrigger" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
11430
|
+
panelHeaderTemplate = contentChild(DsPanelHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "panelHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
11431
|
+
panelFooterTemplate = contentChild(DsPanelFooterTemplateDirective, { ...(ngDevMode ? { debugName: "panelFooterTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
11432
|
+
groupLabelTemplate = contentChild(DsGroupLabelTemplateDirective, { ...(ngDevMode ? { debugName: "groupLabelTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
10862
11433
|
emptyTemplate = contentChild(DsEmptyTemplateDirective, { ...(ngDevMode ? { debugName: "emptyTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
10863
11434
|
createTemplate = contentChild(DsCreateTemplateDirective, { ...(ngDevMode ? { debugName: "createTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
10864
11435
|
query = signal('', ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
|
|
@@ -10882,7 +11453,8 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
10882
11453
|
allOptions = computed(() => flattenDsOptions(this.options()), ...(ngDevMode ? [{ debugName: "allOptions" }] : /* istanbul ignore next */ []));
|
|
10883
11454
|
filteredItems = computed(() => {
|
|
10884
11455
|
const query = this.query().toLowerCase().trim();
|
|
10885
|
-
const
|
|
11456
|
+
const filter = this.filterWith();
|
|
11457
|
+
const matches = (option) => !query || filter === 'none' || filter(option, query);
|
|
10886
11458
|
const kept = [];
|
|
10887
11459
|
for (const item of this.options()) {
|
|
10888
11460
|
if (!isDsOptionGroup(item)) {
|
|
@@ -10929,8 +11501,8 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
10929
11501
|
return [];
|
|
10930
11502
|
}
|
|
10931
11503
|
const selectedValues = this.value() ?? [];
|
|
10932
|
-
const
|
|
10933
|
-
return this.allOptions().filter((option) =>
|
|
11504
|
+
const same = this.compareWith();
|
|
11505
|
+
return this.allOptions().filter((option) => selectedValues.some((selected) => same(selected, option.value)));
|
|
10934
11506
|
}, ...(ngDevMode ? [{ debugName: "selectedTags" }] : /* istanbul ignore next */ []));
|
|
10935
11507
|
chipsMode = computed(() => this.maxVisibleChips() ?? 'fit', ...(ngDevMode ? [{ debugName: "chipsMode" }] : /* istanbul ignore next */ []));
|
|
10936
11508
|
showsEveryChip = computed(() => this.chipsMode() === 'all', ...(ngDevMode ? [{ debugName: "showsEveryChip" }] : /* istanbul ignore next */ []));
|
|
@@ -10964,8 +11536,7 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
10964
11536
|
if (currentValue === null) {
|
|
10965
11537
|
return null;
|
|
10966
11538
|
}
|
|
10967
|
-
return (this.allOptions().find((option) => option.value
|
|
10968
|
-
null);
|
|
11539
|
+
return (this.allOptions().find((option) => this.compareWith()(option.value, currentValue)) ?? null);
|
|
10969
11540
|
}, ...(ngDevMode ? [{ debugName: "selectedOption" }] : /* istanbul ignore next */ []));
|
|
10970
11541
|
displayLabel = computed(() => this.selectedOption()?.label ?? '', ...(ngDevMode ? [{ debugName: "displayLabel" }] : /* istanbul ignore next */ []));
|
|
10971
11542
|
hasSingleValue = computed(() => this.selectedOption() !== null, ...(ngDevMode ? [{ debugName: "hasSingleValue" }] : /* istanbul ignore next */ []));
|
|
@@ -10975,16 +11546,17 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
10975
11546
|
return '';
|
|
10976
11547
|
}
|
|
10977
11548
|
if (this.displayLabel()) {
|
|
10978
|
-
return
|
|
11549
|
+
return this.searchPlaceholder();
|
|
10979
11550
|
}
|
|
10980
11551
|
return this.placeholder();
|
|
10981
11552
|
}, ...(ngDevMode ? [{ debugName: "placeholderText" }] : /* istanbul ignore next */ []));
|
|
10982
11553
|
isSelected(option) {
|
|
10983
11554
|
if (this.multiple()) {
|
|
10984
11555
|
const selectedValues = this.value() ?? [];
|
|
10985
|
-
|
|
11556
|
+
const same = this.compareWith();
|
|
11557
|
+
return selectedValues.some((selected) => same(selected, option.value));
|
|
10986
11558
|
}
|
|
10987
|
-
return this.value()
|
|
11559
|
+
return this.compareWith()(this.value(), option.value);
|
|
10988
11560
|
}
|
|
10989
11561
|
optionClass(option) {
|
|
10990
11562
|
const parts = ['option'];
|
|
@@ -11035,6 +11607,31 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
11035
11607
|
flatIndexOf(option) {
|
|
11036
11608
|
return this.visibleOptions().findIndex((opt) => opt === option);
|
|
11037
11609
|
}
|
|
11610
|
+
constructor() {
|
|
11611
|
+
super();
|
|
11612
|
+
scrollActiveOptionIntoView(this.activeDescendant, this.scrollActiveIntoView, this.cursorFromKeyboard);
|
|
11613
|
+
announceOptionCount(computed(() => this.filteredOptions().length), this.isOpen);
|
|
11614
|
+
}
|
|
11615
|
+
setOpen(next) {
|
|
11616
|
+
if (this.isOpen() === next) {
|
|
11617
|
+
return;
|
|
11618
|
+
}
|
|
11619
|
+
this.isOpen.set(next);
|
|
11620
|
+
(next ? this.opened : this.closed).emit();
|
|
11621
|
+
}
|
|
11622
|
+
isReadOnly = computed(() => this.readOnly() || this.readonlyBinding(), ...(ngDevMode ? [{ debugName: "isReadOnly" }] : /* istanbul ignore next */ []));
|
|
11623
|
+
cursorFromKeyboard = signal(false, ...(ngDevMode ? [{ debugName: "cursorFromKeyboard" }] : /* istanbul ignore next */ []));
|
|
11624
|
+
/** How far PageUp and PageDown move. Ten rows is the native `<select>` step and
|
|
11625
|
+
* the APG listbox example's — a fixed number rather than a measured screenful,
|
|
11626
|
+
* so the jump is the same wherever the panel happens to be clipped. */
|
|
11627
|
+
static pageStep = 10;
|
|
11628
|
+
cursorList() {
|
|
11629
|
+
const options = this.visibleOptions();
|
|
11630
|
+
return {
|
|
11631
|
+
length: options.length,
|
|
11632
|
+
isEnabled: (index) => !options[index].disabled,
|
|
11633
|
+
};
|
|
11634
|
+
}
|
|
11038
11635
|
onTriggerClick() {
|
|
11039
11636
|
if (this.isDisabled()) {
|
|
11040
11637
|
return;
|
|
@@ -11058,6 +11655,7 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
11058
11655
|
}
|
|
11059
11656
|
}
|
|
11060
11657
|
onKeydown(event) {
|
|
11658
|
+
this.cursorFromKeyboard.set(true);
|
|
11061
11659
|
if (this.isDisabled()) {
|
|
11062
11660
|
return;
|
|
11063
11661
|
}
|
|
@@ -11095,6 +11693,22 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
11095
11693
|
}
|
|
11096
11694
|
break;
|
|
11097
11695
|
}
|
|
11696
|
+
case 'PageDown':
|
|
11697
|
+
event.preventDefault();
|
|
11698
|
+
this.activeIndex.set(nextEnabledIndex(this.cursorList(), this.activeIndex(), AutocompleteComponent.pageStep));
|
|
11699
|
+
break;
|
|
11700
|
+
case 'PageUp':
|
|
11701
|
+
event.preventDefault();
|
|
11702
|
+
this.activeIndex.set(nextEnabledIndex(this.cursorList(), this.activeIndex(), -AutocompleteComponent.pageStep));
|
|
11703
|
+
break;
|
|
11704
|
+
case 'Home':
|
|
11705
|
+
event.preventDefault();
|
|
11706
|
+
this.activeIndex.set(firstEnabledIndex(this.cursorList()));
|
|
11707
|
+
break;
|
|
11708
|
+
case 'End':
|
|
11709
|
+
event.preventDefault();
|
|
11710
|
+
this.activeIndex.set(lastEnabledIndex(this.cursorList()));
|
|
11711
|
+
break;
|
|
11098
11712
|
case 'Escape':
|
|
11099
11713
|
if (this.overlayRef) {
|
|
11100
11714
|
event.preventDefault();
|
|
@@ -11120,6 +11734,9 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
11120
11734
|
}
|
|
11121
11735
|
}
|
|
11122
11736
|
openPanel() {
|
|
11737
|
+
if (this.isReadOnly()) {
|
|
11738
|
+
return;
|
|
11739
|
+
}
|
|
11123
11740
|
if (this.overlayRef) {
|
|
11124
11741
|
return;
|
|
11125
11742
|
}
|
|
@@ -11150,16 +11767,16 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
11150
11767
|
return;
|
|
11151
11768
|
}
|
|
11152
11769
|
this.overlayRef = null;
|
|
11153
|
-
this.
|
|
11770
|
+
this.setOpen(false);
|
|
11154
11771
|
});
|
|
11155
11772
|
this.overlayRef.attach(new TemplatePortal(this.panelTpl(), this.vcr));
|
|
11156
|
-
this.
|
|
11773
|
+
this.setOpen(true);
|
|
11157
11774
|
this.activeIndex.set(this.firstEnabledIndex());
|
|
11158
11775
|
}
|
|
11159
11776
|
close(cause = 'select') {
|
|
11160
11777
|
disposeWithLeave(this.overlayRef, cause);
|
|
11161
11778
|
this.overlayRef = null;
|
|
11162
|
-
this.
|
|
11779
|
+
this.setOpen(false);
|
|
11163
11780
|
this.activeIndex.set(-1);
|
|
11164
11781
|
// Here rather than in onPick, which is only half the paths: dismissing after
|
|
11165
11782
|
// typing over a settled value strands the text the same way. The input
|
|
@@ -11171,6 +11788,11 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
11171
11788
|
}
|
|
11172
11789
|
this.markTouched();
|
|
11173
11790
|
}
|
|
11791
|
+
clearValue(event) {
|
|
11792
|
+
event.stopPropagation();
|
|
11793
|
+
this.clear();
|
|
11794
|
+
this.markTouched();
|
|
11795
|
+
}
|
|
11174
11796
|
/**
|
|
11175
11797
|
* Empties the field — both the selected value and the text the user typed.
|
|
11176
11798
|
*
|
|
@@ -11197,7 +11819,9 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
11197
11819
|
this.overlayRef = null;
|
|
11198
11820
|
}
|
|
11199
11821
|
onFilter(event) {
|
|
11200
|
-
|
|
11822
|
+
const typed = event.target.value;
|
|
11823
|
+
this.query.set(typed);
|
|
11824
|
+
this.filterChange.emit(typed);
|
|
11201
11825
|
this.activeIndex.set(this.firstEnabledIndex());
|
|
11202
11826
|
}
|
|
11203
11827
|
onPick(option) {
|
|
@@ -11206,7 +11830,8 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
11206
11830
|
}
|
|
11207
11831
|
if (this.multiple()) {
|
|
11208
11832
|
const current = this.value() ?? [];
|
|
11209
|
-
const
|
|
11833
|
+
const same = this.compareWith();
|
|
11834
|
+
const next = current.some((entry) => same(entry, option.value))
|
|
11210
11835
|
? current.filter((existing) => existing !== option.value)
|
|
11211
11836
|
: [...current, option.value];
|
|
11212
11837
|
this.value.set(next);
|
|
@@ -11232,19 +11857,20 @@ class AutocompleteComponent extends DsControlValueAccessor {
|
|
|
11232
11857
|
const current = this.value() ?? [];
|
|
11233
11858
|
this.value.set(current.filter((existing) => existing !== target));
|
|
11234
11859
|
}
|
|
11235
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: AutocompleteComponent, deps:
|
|
11236
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: AutocompleteComponent, isStandalone: true, selector: "ds-autocomplete", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showChevron: { classPropertyName: "showChevron", publicName: "showChevron", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleChips: { classPropertyName: "maxVisibleChips", publicName: "maxVisibleChips", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, valueOverflow: { classPropertyName: "valueOverflow", publicName: "valueOverflow", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null }, allowCreate: { classPropertyName: "allowCreate", publicName: "allowCreate", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", create: "create" }, host: { properties: { "attr.data-field-state": "controlState()", "class.in-group": "inGroup", "class.content-width": "width() === 'content'", "class.value-wraps": "valueOverflow() === 'wrap'" } }, providers: [
|
|
11860
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11861
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: AutocompleteComponent, isStandalone: true, selector: "ds-autocomplete", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showChevron: { classPropertyName: "showChevron", publicName: "showChevron", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleChips: { classPropertyName: "maxVisibleChips", publicName: "maxVisibleChips", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, valueOverflow: { classPropertyName: "valueOverflow", publicName: "valueOverflow", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null }, allowCreate: { classPropertyName: "allowCreate", publicName: "allowCreate", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, readonlyBinding: { classPropertyName: "readonlyBinding", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, filterWith: { classPropertyName: "filterWith", publicName: "filterWith", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, scrollActiveIntoView: { classPropertyName: "scrollActiveIntoView", publicName: "scrollActiveIntoView", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", filterChange: "filterChange", opened: "opened", closed: "closed", create: "create" }, host: { properties: { "attr.data-field-state": "controlState()", "class.in-group": "inGroup", "class.content-width": "width() === 'content'", "class.value-wraps": "valueOverflow() === 'wrap'" } }, providers: [
|
|
11237
11862
|
{
|
|
11238
11863
|
provide: NG_VALUE_ACCESSOR,
|
|
11239
11864
|
useExisting: forwardRef(() => AutocompleteComponent),
|
|
11240
11865
|
multi: true,
|
|
11241
11866
|
},
|
|
11242
|
-
], queries: [{ propertyName: "optionTemplate", first: true, predicate: DsOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "chipTemplate", first: true, predicate: DsChipTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pickerTrigger", first: true, predicate: DsPickerTriggerDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: DsEmptyTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "createTemplate", first: true, predicate: DsCreateTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "filterInput", first: true, predicate: ["filter"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "chipRow", first: true, predicate: ["chipRow"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- click opens/focuses; keyboard runs through the inner <input role=\"combobox\"> (type/arrows/Enter/Esc) -->\n<div\n #trigger\n class=\"autocomplete-trigger\"\n [class]=\"sizeResolved()\"\n [class.open]=\"isOpen()\"\n [class.disabled]=\"isDisabled()\"\n [class.error]=\"invalidResolved()\"\n (click)=\"onTriggerClick()\"\n>\n <span class=\"addon-slot prefix\">\n <ng-content select=\"[dsAutocompletePrefix]\"></ng-content>\n </span>\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: triggerSelection(),\n selected: triggerSelection(),\n count: multiple() ? selectedTags().length : hasSingleValue() ? 1 : 0,\n open: isOpen(),\n disabled: isDisabled(),\n }\"\n />\n } @else if (multiple()) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (selectedOption of visibleTags(); track selectedOption.value) {\n <ds-tag\n data-chip\n [closable]=\"true\"\n [closeLabel]=\"'Remove ' + selectedOption.label\"\n (closed)=\"remove(selectedOption.value)\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption,\n option: selectedOption,\n }\"\n />\n } @else {\n {{ selectedOption.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n } @else if (displayLabel()) {\n <span\n class=\"autocomplete-value\"\n [attr.title]=\"valueOverflow() === 'ellipsis' ? displayLabel() : null\"\n >\n {{ displayLabel() }}\n </span>\n }\n\n <input\n #filter\n type=\"text\"\n class=\"autocomplete-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [class.collapsed]=\"displayLabel() && !isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n [value]=\"query()\"\n [placeholder]=\"placeholderText()\"\n (input)=\"onFilter($event)\"\n (focus)=\"openPanel()\"\n (blur)=\"markTouched()\"\n (keydown)=\"onKeydown($event)\"\n />\n\n <span class=\"addon-slot suffix\">\n <ng-content select=\"[dsAutocompleteSuffix]\"></ng-content>\n </span>\n\n @if (showChevron()) {\n <ds-icon\n name=\"chevronDown\"\n class=\"autocomplete-chevron\"\n aria-hidden=\"true\"\n [size]=\"16\"\n (click)=\"togglePanel($event)\"\n />\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\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [id]=\"listboxId\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n >\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\"\n >\n {{ item.label }}\n </span>\n\n @for (option of item.options; track option.value) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <div\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n option.disabled || activeIndex.set(flatIndexOf(option))\n \"\n >\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\"\n >\n @if (isSelected(option)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple() && isSelected(option)) {\n <ds-icon\n name=\"check\"\n class=\"option-check\"\n [size]=\"14\"\n />\n }\n </div>\n }\n </li>\n } @else {\n @let option = item;\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n option.disabled || activeIndex.set(flatIndexOf(option))\n \"\n >\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\"\n >\n @if (isSelected(option)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple() && isSelected(option)) {\n <ds-icon\n name=\"check\"\n class=\"option-check\"\n [size]=\"14\"\n />\n }\n </li>\n }\n }\n\n @if (filteredOptions().length === 0 && !showCreateRow()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: query(), query: query() }\"\n />\n } @else {\n No matches\n }\n </li>\n }\n\n @if (showCreateRow()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n class=\"option create-row\"\n role=\"option\"\n [id]=\"optionId(visibleOptions().length)\"\n [class.is-active]=\"activeIndex() === visibleOptions().length\"\n [attr.aria-selected]=\"false\"\n (click)=\"onCreateNew()\"\n (mouseenter)=\"activeIndex.set(visibleOptions().length)\"\n >\n <ds-icon\n name=\"plus\"\n class=\"create-icon\"\n [size]=\"16\"\n />\n\n <span class=\"option-label\">\n @if (createTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query().trim(),\n query: query().trim(),\n }\"\n />\n } @else {\n Create \u00AB{{ query().trim() }}\u00BB\n }\n </span>\n </li>\n }\n </ul>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:none;box-shadow:var(--ds-control-focus-shadow)}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=field]{--ds-control-focus-shadow: var(--focus-field);--ds-control-focus-shadow-error: var(--focus-field-error)}:root[data-focus=edge]{--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);--ds-control-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-control-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error);--ds-control-focus-shadow: var(--focus-ring-inset);--ds-control-focus-shadow-error: var(--focus-ring-inset-error)}:root[data-focus=outline]{--ds-field-focus-shadow: none;--ds-field-focus-shadow-error: none;--ds-control-focus-shadow: none;--ds-control-focus-shadow-error: none}:root[data-focus=outline] :where(:focus-visible){outline:var(--border-width-strong) solid var(--primary);outline-offset:var(--focus-ring-offset)}@media(forced-colors:active){:where(:focus-visible){outline:var(--border-width-strong) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--ds-dropdown-panel-bg-color: var( --ds-autocomplete-panel-bg-color, var(--surface-overlay) );--ds-dropdown-panel-radius: var( --ds-autocomplete-panel-radius, var(--ds-radius-panel) );--ds-dropdown-panel-maxh: var(--ds-autocomplete-panel-maxh, var(--picker-maxh));--_autocomplete-focus-shadow: var(--ds-autocomplete-focus-shadow, var(--ds-field-focus-shadow));--_autocomplete-maxw: var(--ds-autocomplete-maxw, none);--_autocomplete-input-minw: var(--ds-autocomplete-input-minw, 80px);--_autocomplete-bg-color: var(--ds-autocomplete-bg-color, var(--surface-default));--_autocomplete-border-color: var(--ds-autocomplete-border-color, var(--border-default));--_autocomplete-radius: var(--ds-autocomplete-radius, var(--ds-radius-control));--_autocomplete-border-color-focus: var(--ds-autocomplete-border-color-focus, var(--accent));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%;max-width:var(--_autocomplete-maxw);position:relative}:host(.content-width){--_autocomplete-maxw: var(--ds-autocomplete-maxw, 100%);width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.autocomplete-trigger{display:flex;align-items:center;gap:var(--space-2);width:100%;--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height);padding:var(--space-1) var(--space-2);background:var(--_autocomplete-bg-color);border:var(--border-width-default) solid var(--_autocomplete-border-color);border-radius:var(--_autocomplete-radius);cursor:text;text-align:left;flex-wrap:wrap}.autocomplete-trigger:has(>.chip-row.fit){flex-wrap:nowrap}:host(:not(.value-wraps)) .autocomplete-trigger{flex-wrap:nowrap}.autocomplete-trigger{transition:border-color var(--duration-fast) var(--ease-standard)}.autocomplete-trigger .addon-slot{display:inline-flex;align-items:center;align-self:stretch;color:var(--text-tertiary);flex-shrink:0}.autocomplete-trigger .addon-slot:empty{display:none}.autocomplete-trigger:hover:not(.disabled){border-color:var(--border-strong)}.autocomplete-trigger .autocomplete-input:where(:focus-visible){box-shadow:none}.autocomplete-trigger:focus-within:not(.disabled){border-color:var(--_autocomplete-border-color-focus);box-shadow:var(--_autocomplete-focus-shadow);outline:0}.autocomplete-trigger.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.autocomplete-trigger.disabled .autocomplete-input{cursor:not-allowed;color:var(--text-disabled)}.autocomplete-trigger.disabled .autocomplete-value,.autocomplete-trigger.disabled .autocomplete-chevron{color:var(--text-disabled)}.autocomplete-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.autocomplete-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.autocomplete-value{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}:host(:not(.value-wraps)) .autocomplete-value{min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.autocomplete-input{flex:1;min-width:var(--_autocomplete-input-minw)}.autocomplete-input.collapsed{flex:0 0 0;min-width:0;width:0;padding:0}.autocomplete-input{border:0;outline:0;background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}.autocomplete-chevron{color:var(--icon-default);margin-left:auto}.dropdown-panel .option.multi{padding-left:var(--space-2)}.dropdown-panel .check-box{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--check-size);height:var(--check-size);border:var(--border-width-strong) solid var(--border-strong);border-radius:var(--ds-radius-inner);color:var(--text-on-primary)}.dropdown-panel .check-box.checked{background-color:var(--accent);border-color:var(--accent)}.dropdown-panel .create-row{color:var(--accent)}.dropdown-panel .create-row .create-icon{flex:0 0 auto}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .autocomplete-trigger{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{border:0;box-shadow:none;outline:0}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .autocomplete-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .autocomplete-trigger{border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: TagComponent, selector: "ds-tag", inputs: ["variant", "closable", "interactive", "selected", "closeLabel"], outputs: ["closed", "toggled"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
11867
|
+
], queries: [{ propertyName: "optionTemplate", first: true, predicate: DsOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "chipTemplate", first: true, predicate: DsChipTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pickerTrigger", first: true, predicate: DsPickerTriggerDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelHeaderTemplate", first: true, predicate: DsPanelHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelFooterTemplate", first: true, predicate: DsPanelFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupLabelTemplate", first: true, predicate: DsGroupLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: DsEmptyTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "createTemplate", first: true, predicate: DsCreateTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "filterInput", first: true, predicate: ["filter"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "chipRow", first: true, predicate: ["chipRow"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- click opens/focuses; keyboard runs through the inner <input role=\"combobox\"> (type/arrows/Enter/Esc) -->\n<div\n #trigger\n class=\"autocomplete-trigger\"\n [class]=\"sizeResolved()\"\n [class.open]=\"isOpen()\"\n [class.disabled]=\"isDisabled()\"\n [class.error]=\"invalidResolved()\"\n (click)=\"onTriggerClick()\"\n>\n <span class=\"addon-slot prefix\">\n <ng-content select=\"[dsAutocompletePrefix]\"></ng-content>\n </span>\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: triggerSelection(),\n selected: triggerSelection(),\n count: multiple() ? selectedTags().length : hasSingleValue() ? 1 : 0,\n open: isOpen(),\n disabled: isDisabled(),\n }\"\n />\n } @else if (multiple()) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (selectedOption of visibleTags(); track selectedOption.value) {\n <ds-tag\n data-chip\n [closable]=\"true\"\n [closeLabel]=\"'Remove ' + selectedOption.label\"\n (closed)=\"remove(selectedOption.value)\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption,\n option: selectedOption,\n }\"\n />\n } @else {\n {{ selectedOption.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n } @else if (displayLabel()) {\n <span\n class=\"autocomplete-value\"\n [attr.title]=\"valueOverflow() === 'ellipsis' ? displayLabel() : null\"\n >\n {{ displayLabel() }}\n </span>\n }\n\n <input\n #filter\n type=\"text\"\n class=\"autocomplete-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [class.collapsed]=\"displayLabel() && !isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"isReadOnly() ? 'true' : null\"\n [attr.name]=\"name()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n [value]=\"query()\"\n [placeholder]=\"placeholderText()\"\n (input)=\"onFilter($event)\"\n (focus)=\"openPanel()\"\n (blur)=\"markTouched()\"\n (keydown)=\"onKeydown($event)\"\n />\n\n <span class=\"addon-slot suffix\">\n <ng-content select=\"[dsAutocompleteSuffix]\"></ng-content>\n </span>\n\n @if (\n clearable() &&\n hasSingleValue() &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n />\n </button>\n }\n\n @if (showChevron()) {\n <ds-icon\n name=\"chevronDown\"\n class=\"autocomplete-chevron\"\n aria-hidden=\"true\"\n [size]=\"16\"\n (click)=\"togglePanel($event)\"\n />\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\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\"\n />\n </div>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n >\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\"\n >\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @for (option of item.options; track option.value) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <div\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \"\n >\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\"\n >\n @if (isSelected(option)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple() && isSelected(option)) {\n <ds-icon\n name=\"check\"\n class=\"option-check\"\n [size]=\"14\"\n />\n }\n </div>\n }\n </li>\n } @else {\n @let option = item;\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \"\n >\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\"\n >\n @if (isSelected(option)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple() && isSelected(option)) {\n <ds-icon\n name=\"check\"\n class=\"option-check\"\n [size]=\"14\"\n />\n }\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (filteredOptions().length === 0 && !showCreateRow()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: query(), query: query() }\"\n />\n } @else {\n No matches\n }\n </li>\n }\n\n @if (showCreateRow()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n class=\"option create-row\"\n role=\"option\"\n [id]=\"optionId(visibleOptions().length)\"\n [class.is-active]=\"activeIndex() === visibleOptions().length\"\n [attr.aria-selected]=\"false\"\n (click)=\"onCreateNew()\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n activeIndex.set(visibleOptions().length)\n \"\n >\n <ds-icon\n name=\"plus\"\n class=\"create-icon\"\n [size]=\"16\"\n />\n\n <span class=\"option-label\">\n @if (createTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query().trim(),\n query: query().trim(),\n }\"\n />\n } @else {\n Create \u00AB{{ query().trim() }}\u00BB\n }\n </span>\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\"\n />\n </div>\n }\n\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:none;box-shadow:var(--ds-control-focus-shadow)}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=field]{--ds-control-focus-shadow: var(--focus-field);--ds-control-focus-shadow-error: var(--focus-field-error)}:root[data-focus=edge]{--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);--ds-control-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-control-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error);--ds-control-focus-shadow: var(--focus-ring-inset);--ds-control-focus-shadow-error: var(--focus-ring-inset-error)}:root[data-focus=outline]{--ds-field-focus-shadow: none;--ds-field-focus-shadow-error: none;--ds-control-focus-shadow: none;--ds-control-focus-shadow-error: none}:root[data-focus=outline] :where(:focus-visible){outline:var(--border-width-strong) solid var(--primary);outline-offset:var(--focus-ring-offset)}@media(forced-colors:active){:where(:focus-visible){outline:var(--border-width-strong) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--ds-dropdown-panel-bg-color: var( --ds-autocomplete-panel-bg-color, var(--surface-overlay) );--ds-dropdown-panel-radius: var( --ds-autocomplete-panel-radius, var(--ds-radius-panel) );--ds-dropdown-panel-maxh: var(--ds-autocomplete-panel-maxh, var(--picker-maxh));--_autocomplete-focus-shadow: var(--ds-autocomplete-focus-shadow, var(--ds-field-focus-shadow));--_autocomplete-maxw: var(--ds-autocomplete-maxw, none);--_autocomplete-input-minw: var(--ds-autocomplete-input-minw, 80px);--_autocomplete-bg-color: var(--ds-autocomplete-bg-color, var(--surface-default));--_autocomplete-border-color: var(--ds-autocomplete-border-color, var(--border-default));--_autocomplete-radius: var(--ds-autocomplete-radius, var(--ds-radius-control));--_autocomplete-border-color-focus: var(--ds-autocomplete-border-color-focus, var(--accent));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%;max-width:var(--_autocomplete-maxw);position:relative}:host(.content-width){--_autocomplete-maxw: var(--ds-autocomplete-maxw, 100%);width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.autocomplete-trigger{display:flex;align-items:center;gap:var(--space-2);width:100%;--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height);padding:var(--space-1) var(--space-2);background:var(--_autocomplete-bg-color);border:var(--border-width-default) solid var(--_autocomplete-border-color);border-radius:var(--_autocomplete-radius);cursor:text;text-align:left;flex-wrap:wrap}.autocomplete-trigger:has(>.chip-row.fit){flex-wrap:nowrap}:host(:not(.value-wraps)) .autocomplete-trigger{flex-wrap:nowrap}.autocomplete-trigger{transition:border-color var(--duration-fast) var(--ease-standard)}.autocomplete-trigger .addon-slot{display:inline-flex;align-items:center;align-self:stretch;color:var(--text-tertiary);flex-shrink:0}.autocomplete-trigger .addon-slot:empty{display:none}.autocomplete-trigger:hover:not(.disabled){border-color:var(--border-strong)}.autocomplete-trigger .autocomplete-input:where(:focus-visible){box-shadow:none}.autocomplete-trigger:focus-within:not(.disabled){border-color:var(--_autocomplete-border-color-focus);box-shadow:var(--_autocomplete-focus-shadow);outline:0}.autocomplete-trigger.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.autocomplete-trigger.disabled .autocomplete-input{cursor:not-allowed;color:var(--text-disabled)}.autocomplete-trigger.disabled .autocomplete-value,.autocomplete-trigger.disabled .autocomplete-chevron{color:var(--text-disabled)}.autocomplete-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.autocomplete-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.autocomplete-value{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}:host(:not(.value-wraps)) .autocomplete-value{min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.autocomplete-input{flex:1;min-width:var(--_autocomplete-input-minw)}.autocomplete-input.collapsed{flex:0 0 0;min-width:0;width:0;padding:0}.autocomplete-input{border:0;outline:0;background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}.autocomplete-chevron{color:var(--icon-default);margin-left:auto}.dropdown-panel .option.multi{padding-left:var(--space-2)}.dropdown-panel .check-box{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--check-size);height:var(--check-size);border:var(--border-width-strong) solid var(--border-strong);border-radius:var(--ds-radius-inner);color:var(--text-on-primary)}.dropdown-panel .check-box.checked{background-color:var(--accent);border-color:var(--accent)}.dropdown-panel .create-row{color:var(--accent)}.dropdown-panel .create-row .create-icon{flex:0 0 auto}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .autocomplete-trigger{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{border:0;box-shadow:none;outline:0}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .autocomplete-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .autocomplete-trigger{border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: SpinnerComponent, selector: "ds-spinner", inputs: ["size"] }, { kind: "component", type: TagComponent, selector: "ds-tag", inputs: ["variant", "closable", "interactive", "selected", "closeLabel"], outputs: ["closed", "toggled"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
11243
11868
|
}
|
|
11244
11869
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
11245
11870
|
type: Component,
|
|
11246
11871
|
args: [{ selector: 'ds-autocomplete', standalone: true, imports: [
|
|
11247
11872
|
IconComponent,
|
|
11873
|
+
SpinnerComponent,
|
|
11248
11874
|
TagComponent,
|
|
11249
11875
|
FieldMessageComponent,
|
|
11250
11876
|
NgTemplateOutlet,
|
|
@@ -11259,14 +11885,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
11259
11885
|
useExisting: forwardRef(() => AutocompleteComponent),
|
|
11260
11886
|
multi: true,
|
|
11261
11887
|
},
|
|
11262
|
-
], template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- click opens/focuses; keyboard runs through the inner <input role=\"combobox\"> (type/arrows/Enter/Esc) -->\n<div\n #trigger\n class=\"autocomplete-trigger\"\n [class]=\"sizeResolved()\"\n [class.open]=\"isOpen()\"\n [class.disabled]=\"isDisabled()\"\n [class.error]=\"invalidResolved()\"\n (click)=\"onTriggerClick()\"\n>\n <span class=\"addon-slot prefix\">\n <ng-content select=\"[dsAutocompletePrefix]\"></ng-content>\n </span>\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: triggerSelection(),\n selected: triggerSelection(),\n count: multiple() ? selectedTags().length : hasSingleValue() ? 1 : 0,\n open: isOpen(),\n disabled: isDisabled(),\n }\"\n />\n } @else if (multiple()) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (selectedOption of visibleTags(); track selectedOption.value) {\n <ds-tag\n data-chip\n [closable]=\"true\"\n [closeLabel]=\"'Remove ' + selectedOption.label\"\n (closed)=\"remove(selectedOption.value)\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption,\n option: selectedOption,\n }\"\n />\n } @else {\n {{ selectedOption.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n } @else if (displayLabel()) {\n <span\n class=\"autocomplete-value\"\n [attr.title]=\"valueOverflow() === 'ellipsis' ? displayLabel() : null\"\n >\n {{ displayLabel() }}\n </span>\n }\n\n <input\n #filter\n type=\"text\"\n class=\"autocomplete-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [class.collapsed]=\"displayLabel() && !isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n [value]=\"query()\"\n [placeholder]=\"placeholderText()\"\n (input)=\"onFilter($event)\"\n (focus)=\"openPanel()\"\n (blur)=\"markTouched()\"\n (keydown)=\"onKeydown($event)\"\n />\n\n <span class=\"addon-slot suffix\">\n <ng-content select=\"[dsAutocompleteSuffix]\"></ng-content>\n </span>\n\n @if (showChevron()) {\n <ds-icon\n name=\"chevronDown\"\n class=\"autocomplete-chevron\"\n aria-hidden=\"true\"\n [size]=\"16\"\n (click)=\"togglePanel($event)\"\n />\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\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [id]=\"listboxId\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n >\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\"\n >\n {{ item.label }}\n </span>\n\n @for (option of item.options; track option.value) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <div\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n option.disabled || activeIndex.set(flatIndexOf(option))\n \"\n >\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\"\n >\n @if (isSelected(option)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple() && isSelected(option)) {\n <ds-icon\n name=\"check\"\n class=\"option-check\"\n [size]=\"14\"\n />\n }\n </div>\n }\n </li>\n } @else {\n @let option = item;\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n option.disabled || activeIndex.set(flatIndexOf(option))\n \"\n >\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\"\n >\n @if (isSelected(option)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple() && isSelected(option)) {\n <ds-icon\n name=\"check\"\n class=\"option-check\"\n [size]=\"14\"\n />\n }\n </li>\n }\n }\n\n @if (filteredOptions().length === 0 && !showCreateRow()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: query(), query: query() }\"\n />\n } @else {\n No matches\n }\n </li>\n }\n\n @if (showCreateRow()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n class=\"option create-row\"\n role=\"option\"\n [id]=\"optionId(visibleOptions().length)\"\n [class.is-active]=\"activeIndex() === visibleOptions().length\"\n [attr.aria-selected]=\"false\"\n (click)=\"onCreateNew()\"\n (mouseenter)=\"activeIndex.set(visibleOptions().length)\"\n >\n <ds-icon\n name=\"plus\"\n class=\"create-icon\"\n [size]=\"16\"\n />\n\n <span class=\"option-label\">\n @if (createTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query().trim(),\n query: query().trim(),\n }\"\n />\n } @else {\n Create \u00AB{{ query().trim() }}\u00BB\n }\n </span>\n </li>\n }\n </ul>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:none;box-shadow:var(--ds-control-focus-shadow)}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=field]{--ds-control-focus-shadow: var(--focus-field);--ds-control-focus-shadow-error: var(--focus-field-error)}:root[data-focus=edge]{--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);--ds-control-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-control-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error);--ds-control-focus-shadow: var(--focus-ring-inset);--ds-control-focus-shadow-error: var(--focus-ring-inset-error)}:root[data-focus=outline]{--ds-field-focus-shadow: none;--ds-field-focus-shadow-error: none;--ds-control-focus-shadow: none;--ds-control-focus-shadow-error: none}:root[data-focus=outline] :where(:focus-visible){outline:var(--border-width-strong) solid var(--primary);outline-offset:var(--focus-ring-offset)}@media(forced-colors:active){:where(:focus-visible){outline:var(--border-width-strong) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--ds-dropdown-panel-bg-color: var( --ds-autocomplete-panel-bg-color, var(--surface-overlay) );--ds-dropdown-panel-radius: var( --ds-autocomplete-panel-radius, var(--ds-radius-panel) );--ds-dropdown-panel-maxh: var(--ds-autocomplete-panel-maxh, var(--picker-maxh));--_autocomplete-focus-shadow: var(--ds-autocomplete-focus-shadow, var(--ds-field-focus-shadow));--_autocomplete-maxw: var(--ds-autocomplete-maxw, none);--_autocomplete-input-minw: var(--ds-autocomplete-input-minw, 80px);--_autocomplete-bg-color: var(--ds-autocomplete-bg-color, var(--surface-default));--_autocomplete-border-color: var(--ds-autocomplete-border-color, var(--border-default));--_autocomplete-radius: var(--ds-autocomplete-radius, var(--ds-radius-control));--_autocomplete-border-color-focus: var(--ds-autocomplete-border-color-focus, var(--accent));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%;max-width:var(--_autocomplete-maxw);position:relative}:host(.content-width){--_autocomplete-maxw: var(--ds-autocomplete-maxw, 100%);width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.autocomplete-trigger{display:flex;align-items:center;gap:var(--space-2);width:100%;--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height);padding:var(--space-1) var(--space-2);background:var(--_autocomplete-bg-color);border:var(--border-width-default) solid var(--_autocomplete-border-color);border-radius:var(--_autocomplete-radius);cursor:text;text-align:left;flex-wrap:wrap}.autocomplete-trigger:has(>.chip-row.fit){flex-wrap:nowrap}:host(:not(.value-wraps)) .autocomplete-trigger{flex-wrap:nowrap}.autocomplete-trigger{transition:border-color var(--duration-fast) var(--ease-standard)}.autocomplete-trigger .addon-slot{display:inline-flex;align-items:center;align-self:stretch;color:var(--text-tertiary);flex-shrink:0}.autocomplete-trigger .addon-slot:empty{display:none}.autocomplete-trigger:hover:not(.disabled){border-color:var(--border-strong)}.autocomplete-trigger .autocomplete-input:where(:focus-visible){box-shadow:none}.autocomplete-trigger:focus-within:not(.disabled){border-color:var(--_autocomplete-border-color-focus);box-shadow:var(--_autocomplete-focus-shadow);outline:0}.autocomplete-trigger.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.autocomplete-trigger.disabled .autocomplete-input{cursor:not-allowed;color:var(--text-disabled)}.autocomplete-trigger.disabled .autocomplete-value,.autocomplete-trigger.disabled .autocomplete-chevron{color:var(--text-disabled)}.autocomplete-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.autocomplete-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.autocomplete-value{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}:host(:not(.value-wraps)) .autocomplete-value{min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.autocomplete-input{flex:1;min-width:var(--_autocomplete-input-minw)}.autocomplete-input.collapsed{flex:0 0 0;min-width:0;width:0;padding:0}.autocomplete-input{border:0;outline:0;background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}.autocomplete-chevron{color:var(--icon-default);margin-left:auto}.dropdown-panel .option.multi{padding-left:var(--space-2)}.dropdown-panel .check-box{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--check-size);height:var(--check-size);border:var(--border-width-strong) solid var(--border-strong);border-radius:var(--ds-radius-inner);color:var(--text-on-primary)}.dropdown-panel .check-box.checked{background-color:var(--accent);border-color:var(--accent)}.dropdown-panel .create-row{color:var(--accent)}.dropdown-panel .create-row .create-icon{flex:0 0 auto}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .autocomplete-trigger{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{border:0;box-shadow:none;outline:0}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .autocomplete-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .autocomplete-trigger{border-color:var(--success)}\n"] }]
|
|
11263
|
-
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showChevron: [{ type: i0.Input, args: [{ isSignal: true, alias: "showChevron", required: false }] }], maxVisibleChips: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleChips", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], valueOverflow: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueOverflow", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], allowCreate: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowCreate", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], create: [{ type: i0.Output, args: ["create"] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsOptionTemplateDirective), { ...{
|
|
11888
|
+
], template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- click opens/focuses; keyboard runs through the inner <input role=\"combobox\"> (type/arrows/Enter/Esc) -->\n<div\n #trigger\n class=\"autocomplete-trigger\"\n [class]=\"sizeResolved()\"\n [class.open]=\"isOpen()\"\n [class.disabled]=\"isDisabled()\"\n [class.error]=\"invalidResolved()\"\n (click)=\"onTriggerClick()\"\n>\n <span class=\"addon-slot prefix\">\n <ng-content select=\"[dsAutocompletePrefix]\"></ng-content>\n </span>\n\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: triggerSelection(),\n selected: triggerSelection(),\n count: multiple() ? selectedTags().length : hasSingleValue() ? 1 : 0,\n open: isOpen(),\n disabled: isDisabled(),\n }\"\n />\n } @else if (multiple()) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (selectedOption of visibleTags(); track selectedOption.value) {\n <ds-tag\n data-chip\n [closable]=\"true\"\n [closeLabel]=\"'Remove ' + selectedOption.label\"\n (closed)=\"remove(selectedOption.value)\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOption,\n option: selectedOption,\n }\"\n />\n } @else {\n {{ selectedOption.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n } @else if (displayLabel()) {\n <span\n class=\"autocomplete-value\"\n [attr.title]=\"valueOverflow() === 'ellipsis' ? displayLabel() : null\"\n >\n {{ displayLabel() }}\n </span>\n }\n\n <input\n #filter\n type=\"text\"\n class=\"autocomplete-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [class.collapsed]=\"displayLabel() && !isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"isReadOnly() ? 'true' : null\"\n [attr.name]=\"name()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [disabled]=\"isDisabled()\"\n [value]=\"query()\"\n [placeholder]=\"placeholderText()\"\n (input)=\"onFilter($event)\"\n (focus)=\"openPanel()\"\n (blur)=\"markTouched()\"\n (keydown)=\"onKeydown($event)\"\n />\n\n <span class=\"addon-slot suffix\">\n <ng-content select=\"[dsAutocompleteSuffix]\"></ng-content>\n </span>\n\n @if (\n clearable() &&\n hasSingleValue() &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n />\n </button>\n }\n\n @if (showChevron()) {\n <ds-icon\n name=\"chevronDown\"\n class=\"autocomplete-chevron\"\n aria-hidden=\"true\"\n [size]=\"16\"\n (click)=\"togglePanel($event)\"\n />\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\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\"\n />\n </div>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n >\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\"\n >\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @for (option of item.options; track option.value) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <div\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \"\n >\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\"\n >\n @if (isSelected(option)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple() && isSelected(option)) {\n <ds-icon\n name=\"check\"\n class=\"option-check\"\n [size]=\"14\"\n />\n }\n </div>\n }\n </li>\n } @else {\n @let option = item;\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n role=\"option\"\n [class]=\"optionClass(option)\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"flatIndexOf(option) === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"onPick(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n option.disabled || activeIndex.set(flatIndexOf(option))\n \"\n >\n @if (multiple()) {\n <span\n class=\"check-box\"\n [class.checked]=\"isSelected(option)\"\n >\n @if (isSelected(option)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n }\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n\n @if (!multiple() && isSelected(option)) {\n <ds-icon\n name=\"check\"\n class=\"option-check\"\n [size]=\"14\"\n />\n }\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (filteredOptions().length === 0 && !showCreateRow()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: query(), query: query() }\"\n />\n } @else {\n No matches\n }\n </li>\n }\n\n @if (showCreateRow()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- listbox option; activated via the combobox input + aria-activedescendant, options aren't individually focusable -->\n <li\n class=\"option create-row\"\n role=\"option\"\n [id]=\"optionId(visibleOptions().length)\"\n [class.is-active]=\"activeIndex() === visibleOptions().length\"\n [attr.aria-selected]=\"false\"\n (click)=\"onCreateNew()\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n activeIndex.set(visibleOptions().length)\n \"\n >\n <ds-icon\n name=\"plus\"\n class=\"create-icon\"\n [size]=\"16\"\n />\n\n <span class=\"option-label\">\n @if (createTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: query().trim(),\n query: query().trim(),\n }\"\n />\n } @else {\n Create \u00AB{{ query().trim() }}\u00BB\n }\n </span>\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: query(),\n }\"\n />\n </div>\n }\n\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:none;box-shadow:var(--ds-control-focus-shadow)}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=field]{--ds-control-focus-shadow: var(--focus-field);--ds-control-focus-shadow-error: var(--focus-field-error)}:root[data-focus=edge]{--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);--ds-control-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-control-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error);--ds-control-focus-shadow: var(--focus-ring-inset);--ds-control-focus-shadow-error: var(--focus-ring-inset-error)}:root[data-focus=outline]{--ds-field-focus-shadow: none;--ds-field-focus-shadow-error: none;--ds-control-focus-shadow: none;--ds-control-focus-shadow-error: none}:root[data-focus=outline] :where(:focus-visible){outline:var(--border-width-strong) solid var(--primary);outline-offset:var(--focus-ring-offset)}@media(forced-colors:active){:where(:focus-visible){outline:var(--border-width-strong) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--ds-dropdown-panel-bg-color: var( --ds-autocomplete-panel-bg-color, var(--surface-overlay) );--ds-dropdown-panel-radius: var( --ds-autocomplete-panel-radius, var(--ds-radius-panel) );--ds-dropdown-panel-maxh: var(--ds-autocomplete-panel-maxh, var(--picker-maxh));--_autocomplete-focus-shadow: var(--ds-autocomplete-focus-shadow, var(--ds-field-focus-shadow));--_autocomplete-maxw: var(--ds-autocomplete-maxw, none);--_autocomplete-input-minw: var(--ds-autocomplete-input-minw, 80px);--_autocomplete-bg-color: var(--ds-autocomplete-bg-color, var(--surface-default));--_autocomplete-border-color: var(--ds-autocomplete-border-color, var(--border-default));--_autocomplete-radius: var(--ds-autocomplete-radius, var(--ds-radius-control));--_autocomplete-border-color-focus: var(--ds-autocomplete-border-color-focus, var(--accent));display:flex;flex-direction:column;gap:var(--field-label-gap);width:100%;max-width:var(--_autocomplete-maxw);position:relative}:host(.content-width){--_autocomplete-maxw: var(--ds-autocomplete-maxw, 100%);width:fit-content}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.autocomplete-trigger{display:flex;align-items:center;gap:var(--space-2);width:100%;--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height);padding:var(--space-1) var(--space-2);background:var(--_autocomplete-bg-color);border:var(--border-width-default) solid var(--_autocomplete-border-color);border-radius:var(--_autocomplete-radius);cursor:text;text-align:left;flex-wrap:wrap}.autocomplete-trigger:has(>.chip-row.fit){flex-wrap:nowrap}:host(:not(.value-wraps)) .autocomplete-trigger{flex-wrap:nowrap}.autocomplete-trigger{transition:border-color var(--duration-fast) var(--ease-standard)}.autocomplete-trigger .addon-slot{display:inline-flex;align-items:center;align-self:stretch;color:var(--text-tertiary);flex-shrink:0}.autocomplete-trigger .addon-slot:empty{display:none}.autocomplete-trigger:hover:not(.disabled){border-color:var(--border-strong)}.autocomplete-trigger .autocomplete-input:where(:focus-visible){box-shadow:none}.autocomplete-trigger:focus-within:not(.disabled){border-color:var(--_autocomplete-border-color-focus);box-shadow:var(--_autocomplete-focus-shadow);outline:0}.autocomplete-trigger.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed}.autocomplete-trigger.disabled .autocomplete-input{cursor:not-allowed;color:var(--text-disabled)}.autocomplete-trigger.disabled .autocomplete-value,.autocomplete-trigger.disabled .autocomplete-chevron{color:var(--text-disabled)}.autocomplete-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.autocomplete-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.autocomplete-value{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}:host(:not(.value-wraps)) .autocomplete-value{min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.autocomplete-input{flex:1;min-width:var(--_autocomplete-input-minw)}.autocomplete-input.collapsed{flex:0 0 0;min-width:0;width:0;padding:0}.autocomplete-input{border:0;outline:0;background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}.autocomplete-chevron{color:var(--icon-default);margin-left:auto}.dropdown-panel .option.multi{padding-left:var(--space-2)}.dropdown-panel .check-box{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--check-size);height:var(--check-size);border:var(--border-width-strong) solid var(--border-strong);border-radius:var(--ds-radius-inner);color:var(--text-on-primary)}.dropdown-panel .check-box.checked{background-color:var(--accent);border-color:var(--accent)}.dropdown-panel .create-row{color:var(--accent)}.dropdown-panel .create-row .create-icon{flex:0 0 auto}:host(.in-group){width:auto;display:flex}:host(.in-group) .label,:host(.in-group) ds-field-message{display:none}:host(.in-group) .autocomplete-trigger{border:0;border-radius:0;background:transparent;flex:1;height:auto}:host(.in-group) .autocomplete-trigger:hover,:host(.in-group) .autocomplete-trigger:focus,:host(.in-group) .autocomplete-trigger:focus-visible,:host(.in-group) .autocomplete-trigger:focus-within{border:0;box-shadow:none;outline:0}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .autocomplete-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .autocomplete-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .autocomplete-trigger{border-color:var(--success)}\n"] }]
|
|
11889
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showChevron: [{ type: i0.Input, args: [{ isSignal: true, alias: "showChevron", required: false }] }], maxVisibleChips: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleChips", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], valueOverflow: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueOverflow", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], allowCreate: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowCreate", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], readonlyBinding: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], filterWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterWith", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], scrollActiveIntoView: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollActiveIntoView", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], create: [{ type: i0.Output, args: ["create"] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsOptionTemplateDirective), { ...{
|
|
11264
11890
|
read: TemplateRef,
|
|
11265
11891
|
}, isSignal: true }] }], chipTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsChipTemplateDirective), { ...{
|
|
11266
11892
|
read: TemplateRef,
|
|
11267
11893
|
}, isSignal: true }] }], pickerTrigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPickerTriggerDirective), { ...{
|
|
11268
11894
|
read: TemplateRef,
|
|
11269
|
-
}, isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsEmptyTemplateDirective), { ...{
|
|
11895
|
+
}, isSignal: true }] }], panelHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPanelHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], panelFooterTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPanelFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupLabelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsGroupLabelTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsEmptyTemplateDirective), { ...{
|
|
11270
11896
|
read: TemplateRef,
|
|
11271
11897
|
}, isSignal: true }] }], createTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsCreateTemplateDirective), { ...{
|
|
11272
11898
|
read: TemplateRef,
|
|
@@ -12579,6 +13205,45 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12579
13205
|
return Number.isFinite(asNumber) ? asNumber : raw !== 'false';
|
|
12580
13206
|
} });
|
|
12581
13207
|
searchableResolved = resolveWithConfig(this.searchable, (config) => config.picker?.searchable, true);
|
|
13208
|
+
/** Native `name` attribute forwarded to the trigger. */
|
|
13209
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
13210
|
+
/** Prevents opening the panel while still allowing focus. */
|
|
13211
|
+
readOnly = input(false, { ...(ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
13212
|
+
/**
|
|
13213
|
+
* The contract spelling of `readOnly`, a second input because signal forms binds
|
|
13214
|
+
* by NAME — a `readonly()` rule was reaching nothing before this existed.
|
|
13215
|
+
*/
|
|
13216
|
+
readonlyBinding = input(false, { ...(ngDevMode ? { debugName: "readonlyBinding" } : /* istanbul ignore next */ {}),
|
|
13217
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
13218
|
+
alias: 'readonly',
|
|
13219
|
+
transform: booleanAttribute });
|
|
13220
|
+
/** Shows a clear affordance once there is something to clear. */
|
|
13221
|
+
clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
13222
|
+
/** How the typed query narrows the list.
|
|
13223
|
+
*
|
|
13224
|
+
* The default matches a case-insensitive substring of `label`. Pass a predicate
|
|
13225
|
+
* to match on anything else — a second field, ignoring diacritics, a fuzzy score.
|
|
13226
|
+
* Pass `'none'` when the list arrives already filtered, which is what a
|
|
13227
|
+
* server-side search needs: the query is reported through `filterChange` and
|
|
13228
|
+
* every option given is rendered.
|
|
13229
|
+
*/
|
|
13230
|
+
filterWith = input((option, query) => option.label.toLowerCase().includes(query), ...(ngDevMode ? [{ debugName: "filterWith" }] : /* istanbul ignore next */ []));
|
|
13231
|
+
/** The query the user typed, on every change. The input for a server-side search;
|
|
13232
|
+
* pair it with `filterWith="none"` so the list is not narrowed twice. */
|
|
13233
|
+
filterChange = output();
|
|
13234
|
+
/** Options are still being fetched. The panel shows a spinner instead of the
|
|
13235
|
+
* empty row — which would otherwise claim there are no matches — and the list
|
|
13236
|
+
* reports `aria-busy`. */
|
|
13237
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
13238
|
+
/** The panel opened. The moment to fetch options for a picker whose list is
|
|
13239
|
+
* loaded on demand. */
|
|
13240
|
+
opened = output();
|
|
13241
|
+
/** The panel closed, for any reason — a pick, Escape, an outside click, a scroll. */
|
|
13242
|
+
closed = output();
|
|
13243
|
+
/** Scrolls the keyboard cursor's row into view. On by default: a list longer
|
|
13244
|
+
* than the panel otherwise walks the cursor out of sight. Set `false` only if
|
|
13245
|
+
* you are driving the scroll position yourself. */
|
|
13246
|
+
scrollActiveIntoView = input(true, { ...(ngDevMode ? { debugName: "scrollActiveIntoView" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
12582
13247
|
/** How the chips collapse when they outgrow one line. `"fit"` (the default)
|
|
12583
13248
|
* measures and shows as many as the trigger is wide, the rest behind "+N more".
|
|
12584
13249
|
* A NUMBER is a CEILING, not a promise: the row still measures, so you get at
|
|
@@ -12627,6 +13292,9 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12627
13292
|
optionTemplate = contentChild(DsOptionTemplateDirective, { ...(ngDevMode ? { debugName: "optionTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
12628
13293
|
chipTemplate = contentChild(DsChipTemplateDirective, { ...(ngDevMode ? { debugName: "chipTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
12629
13294
|
pickerTrigger = contentChild(DsPickerTriggerDirective, { ...(ngDevMode ? { debugName: "pickerTrigger" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
13295
|
+
panelHeaderTemplate = contentChild(DsPanelHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "panelHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
13296
|
+
panelFooterTemplate = contentChild(DsPanelFooterTemplateDirective, { ...(ngDevMode ? { debugName: "panelFooterTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
13297
|
+
groupLabelTemplate = contentChild(DsGroupLabelTemplateDirective, { ...(ngDevMode ? { debugName: "groupLabelTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
12630
13298
|
emptyTemplate = contentChild(DsEmptyTemplateDirective, { ...(ngDevMode ? { debugName: "emptyTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
12631
13299
|
uid = nextControlId('ds-multi-select');
|
|
12632
13300
|
listboxId = `${this.uid}-listbox`;
|
|
@@ -12694,7 +13362,8 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12694
13362
|
overflowCount = computed(() => this.selectedOptions().length - this.visibleChips().length, ...(ngDevMode ? [{ debugName: "overflowCount" }] : /* istanbul ignore next */ []));
|
|
12695
13363
|
filteredItems = computed(() => {
|
|
12696
13364
|
const query = this.filter().trim().toLowerCase();
|
|
12697
|
-
const
|
|
13365
|
+
const filter = this.filterWith();
|
|
13366
|
+
const matches = (option) => !query || filter === 'none' || filter(option, query);
|
|
12698
13367
|
const kept = [];
|
|
12699
13368
|
for (const item of this.options()) {
|
|
12700
13369
|
if (!isDsOptionGroup(item)) {
|
|
@@ -12814,20 +13483,76 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12814
13483
|
? current.filter((value) => value !== option.value)
|
|
12815
13484
|
: [...current, option.value]);
|
|
12816
13485
|
}
|
|
13486
|
+
clearValue(event) {
|
|
13487
|
+
event.stopPropagation();
|
|
13488
|
+
this.clear();
|
|
13489
|
+
this.markTouched();
|
|
13490
|
+
// The button that ran this is being destroyed with the chips, so focus would
|
|
13491
|
+
// fall to <body>. The public clear() below leaves focus alone on purpose.
|
|
13492
|
+
this.trigger().nativeElement.focus();
|
|
13493
|
+
}
|
|
13494
|
+
/**
|
|
13495
|
+
* Empties the selection from outside — a "reset filters" button, a form the app
|
|
13496
|
+
* clears itself. `ds-autocomplete` has had this; the other two had only the
|
|
13497
|
+
* in-trigger button.
|
|
13498
|
+
*
|
|
13499
|
+
* Deliberately does NOT move focus: the caller may be navigating away, and
|
|
13500
|
+
* stealing focus back into a field they just left is worse than leaving it.
|
|
13501
|
+
*/
|
|
13502
|
+
clear() {
|
|
13503
|
+
this.value.set([]);
|
|
13504
|
+
this.filter.set('');
|
|
13505
|
+
if (this.open()) {
|
|
13506
|
+
this.close('dismiss');
|
|
13507
|
+
}
|
|
13508
|
+
}
|
|
12817
13509
|
removeValue(value) {
|
|
12818
13510
|
this.value.set(this.value().filter((entry) => entry !== value));
|
|
12819
13511
|
// The close button that ran this is being destroyed with its chip, so focus
|
|
12820
13512
|
// would land on <body> and the next removal would need a tab from the top.
|
|
12821
13513
|
this.trigger().nativeElement.focus();
|
|
12822
13514
|
}
|
|
13515
|
+
constructor() {
|
|
13516
|
+
super();
|
|
13517
|
+
scrollActiveOptionIntoView(this.activeDescendant, this.scrollActiveIntoView, this.cursorFromKeyboard);
|
|
13518
|
+
announceOptionCount(computed(() => this.filteredOptions().length), this.open);
|
|
13519
|
+
}
|
|
12823
13520
|
onFilter(event) {
|
|
12824
|
-
|
|
13521
|
+
const typed = event.target.value;
|
|
13522
|
+
this.filter.set(typed);
|
|
13523
|
+
this.filterChange.emit(typed);
|
|
12825
13524
|
this.activeIndex.set(this.firstEnabledIndex());
|
|
12826
13525
|
}
|
|
13526
|
+
setOpen(next) {
|
|
13527
|
+
if (this.open() === next) {
|
|
13528
|
+
return;
|
|
13529
|
+
}
|
|
13530
|
+
this.open.set(next);
|
|
13531
|
+
(next ? this.opened : this.closed).emit();
|
|
13532
|
+
}
|
|
13533
|
+
isReadOnly = computed(() => this.readOnly() || this.readonlyBinding(), ...(ngDevMode ? [{ debugName: "isReadOnly" }] : /* istanbul ignore next */ []));
|
|
13534
|
+
typeAhead = createTypeAhead();
|
|
13535
|
+
handleTypeAhead(key) {
|
|
13536
|
+
const index = this.typeAhead.match(key, this.filteredOptions().map((option) => option.label), this.activeIndex());
|
|
13537
|
+
if (index < 0) {
|
|
13538
|
+
return false;
|
|
13539
|
+
}
|
|
13540
|
+
this.activeIndex.set(index);
|
|
13541
|
+
return true;
|
|
13542
|
+
}
|
|
13543
|
+
cursorFromKeyboard = signal(false, ...(ngDevMode ? [{ debugName: "cursorFromKeyboard" }] : /* istanbul ignore next */ []));
|
|
13544
|
+
cursorList() {
|
|
13545
|
+
const options = this.filteredOptions();
|
|
13546
|
+
return {
|
|
13547
|
+
length: options.length,
|
|
13548
|
+
isEnabled: (index) => !options[index].disabled,
|
|
13549
|
+
};
|
|
13550
|
+
}
|
|
12827
13551
|
firstEnabledIndex() {
|
|
12828
|
-
return this.
|
|
13552
|
+
return firstEnabledIndex(this.cursorList());
|
|
12829
13553
|
}
|
|
12830
13554
|
onTriggerKeydown(event) {
|
|
13555
|
+
this.cursorFromKeyboard.set(true);
|
|
12831
13556
|
if (this.isDisabled()) {
|
|
12832
13557
|
return;
|
|
12833
13558
|
}
|
|
@@ -12847,9 +13572,14 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12847
13572
|
if (event.key === 'ArrowDown' && !this.open()) {
|
|
12848
13573
|
event.preventDefault();
|
|
12849
13574
|
this.openPanel();
|
|
13575
|
+
return;
|
|
13576
|
+
}
|
|
13577
|
+
if (!this.open() && this.handleTypeAhead(event.key)) {
|
|
13578
|
+
event.preventDefault();
|
|
12850
13579
|
}
|
|
12851
13580
|
}
|
|
12852
13581
|
onSearchKeydown(event) {
|
|
13582
|
+
this.cursorFromKeyboard.set(true);
|
|
12853
13583
|
switch (event.key) {
|
|
12854
13584
|
case 'ArrowDown':
|
|
12855
13585
|
event.preventDefault();
|
|
@@ -12871,6 +13601,22 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12871
13601
|
event.preventDefault();
|
|
12872
13602
|
this.close('dismiss');
|
|
12873
13603
|
break;
|
|
13604
|
+
case 'PageDown':
|
|
13605
|
+
event.preventDefault();
|
|
13606
|
+
this.moveActive(MultiSelectComponent.pageStep);
|
|
13607
|
+
break;
|
|
13608
|
+
case 'PageUp':
|
|
13609
|
+
event.preventDefault();
|
|
13610
|
+
this.moveActive(-MultiSelectComponent.pageStep);
|
|
13611
|
+
break;
|
|
13612
|
+
case 'Home':
|
|
13613
|
+
event.preventDefault();
|
|
13614
|
+
this.activeIndex.set(this.firstEnabledIndex());
|
|
13615
|
+
break;
|
|
13616
|
+
case 'End':
|
|
13617
|
+
event.preventDefault();
|
|
13618
|
+
this.activeIndex.set(lastEnabledIndex(this.cursorList()));
|
|
13619
|
+
break;
|
|
12874
13620
|
case 'Tab':
|
|
12875
13621
|
this.close('dismiss');
|
|
12876
13622
|
break;
|
|
@@ -12887,7 +13633,7 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12887
13633
|
}
|
|
12888
13634
|
}
|
|
12889
13635
|
openPanel() {
|
|
12890
|
-
if (this.overlayRef || this.isDisabled()) {
|
|
13636
|
+
if (this.overlayRef || this.isDisabled() || this.isReadOnly()) {
|
|
12891
13637
|
return;
|
|
12892
13638
|
}
|
|
12893
13639
|
const triggerElement = this.trigger().nativeElement;
|
|
@@ -12918,7 +13664,7 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12918
13664
|
return;
|
|
12919
13665
|
}
|
|
12920
13666
|
this.overlayRef = null;
|
|
12921
|
-
this.
|
|
13667
|
+
this.setOpen(false);
|
|
12922
13668
|
});
|
|
12923
13669
|
this.overlayRef.keydownEvents().subscribe((event) => {
|
|
12924
13670
|
if (event.key === 'Escape') {
|
|
@@ -12927,7 +13673,7 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12927
13673
|
}
|
|
12928
13674
|
});
|
|
12929
13675
|
this.overlayRef.attach(new TemplatePortal(this.panelTpl(), this.vcr));
|
|
12930
|
-
this.
|
|
13676
|
+
this.setOpen(true);
|
|
12931
13677
|
this.activeIndex.set(this.firstEnabledIndex());
|
|
12932
13678
|
if (this.showsSearch()) {
|
|
12933
13679
|
this.focusTimer = setTimeout(() => {
|
|
@@ -12955,7 +13701,7 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12955
13701
|
const focusWasInPanel = focusIsInside(this.overlayRef);
|
|
12956
13702
|
disposeWithLeave(this.overlayRef, cause);
|
|
12957
13703
|
this.overlayRef = null;
|
|
12958
|
-
this.
|
|
13704
|
+
this.setOpen(false);
|
|
12959
13705
|
this.filter.set('');
|
|
12960
13706
|
this.activeIndex.set(-1);
|
|
12961
13707
|
this.markTouched();
|
|
@@ -12963,35 +13709,30 @@ class MultiSelectComponent extends DsControlValueAccessor {
|
|
|
12963
13709
|
this.trigger().nativeElement.focus({ preventScroll: true });
|
|
12964
13710
|
}
|
|
12965
13711
|
}
|
|
13712
|
+
/** How far PageUp and PageDown move. Ten rows is the native `<select>` step and
|
|
13713
|
+
* the APG listbox example's — a fixed number rather than a measured screenful,
|
|
13714
|
+
* so the jump is the same wherever the panel happens to be clipped. */
|
|
13715
|
+
static pageStep = 10;
|
|
12966
13716
|
moveActive(delta) {
|
|
12967
|
-
const
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
return;
|
|
12971
|
-
}
|
|
12972
|
-
let next = this.activeIndex();
|
|
12973
|
-
let remaining = count;
|
|
12974
|
-
while (remaining-- > 0) {
|
|
12975
|
-
next = (next + delta + count) % count;
|
|
12976
|
-
if (!options[next].disabled) {
|
|
12977
|
-
this.activeIndex.set(next);
|
|
12978
|
-
return;
|
|
12979
|
-
}
|
|
13717
|
+
const next = nextEnabledIndex(this.cursorList(), this.activeIndex(), delta);
|
|
13718
|
+
if (next >= 0) {
|
|
13719
|
+
this.activeIndex.set(next);
|
|
12980
13720
|
}
|
|
12981
13721
|
}
|
|
12982
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: MultiSelectComponent, deps:
|
|
12983
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: MultiSelectComponent, isStandalone: true, selector: "ds-multi-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleChips: { classPropertyName: "maxVisibleChips", publicName: "maxVisibleChips", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, triggerDisplay: { classPropertyName: "triggerDisplay", publicName: "triggerDisplay", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, selectAll: { classPropertyName: "selectAll", publicName: "selectAll", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-field-state": "controlState()", "class.content-width": "width() === 'content'", "class.compact-trigger": "showsCompactTrigger()" } }, providers: [
|
|
13722
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: MultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13723
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: MultiSelectComponent, isStandalone: true, selector: "ds-multi-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, readonlyBinding: { classPropertyName: "readonlyBinding", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, filterWith: { classPropertyName: "filterWith", publicName: "filterWith", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, scrollActiveIntoView: { classPropertyName: "scrollActiveIntoView", publicName: "scrollActiveIntoView", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleChips: { classPropertyName: "maxVisibleChips", publicName: "maxVisibleChips", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, triggerDisplay: { classPropertyName: "triggerDisplay", publicName: "triggerDisplay", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, selectAll: { classPropertyName: "selectAll", publicName: "selectAll", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", filterChange: "filterChange", opened: "opened", closed: "closed" }, host: { properties: { "attr.data-field-state": "controlState()", "class.content-width": "width() === 'content'", "class.compact-trigger": "showsCompactTrigger()" } }, providers: [
|
|
12984
13724
|
{
|
|
12985
13725
|
provide: NG_VALUE_ACCESSOR,
|
|
12986
13726
|
useExisting: forwardRef(() => MultiSelectComponent),
|
|
12987
13727
|
multi: true,
|
|
12988
13728
|
},
|
|
12989
|
-
], queries: [{ propertyName: "optionTemplate", first: true, predicate: DsOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "chipTemplate", first: true, predicate: DsChipTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pickerTrigger", first: true, predicate: DsPickerTriggerDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: DsEmptyTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["search"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "chipRow", first: true, predicate: ["chipRow"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<div\n #trigger\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n [class]=\"'field-trigger ' + sizeResolved()\"\n [class.open]=\"open()\"\n [class.disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-activedescendant]=\"triggerActiveDescendant()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\"\n>\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOptions(),\n selected: selectedOptions(),\n count: selectedOptions().length,\n open: open(),\n disabled: isDisabled(),\n }\"\n />\n } @else if (showsCompactTrigger()) {\n <span class=\"trigger-caption\">\n {{ triggerCaption() }}\n </span>\n\n @if (triggerDisplay() === 'labels' && selectedOptions().length > 0) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (option of visibleChips(); track option.value) {\n <span\n data-chip\n class=\"trigger-label\"\n >\n {{ option.label }}\n </span>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }}\n </span>\n }\n </span>\n } @else if (selectedOptions().length > 0) {\n <ds-badge\n [count]=\"selectedOptions().length\"\n [countLabel]=\"'selected'\"\n />\n }\n } @else if (selectedOptions().length === 0) {\n <span class=\"placeholder\">\n {{ placeholder() }}\n </span>\n } @else {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (option of visibleChips(); track option.value) {\n <ds-tag\n data-chip\n variant=\"neutral\"\n closable\n [closeLabel]=\"'Remove ' + option.label\"\n (closed)=\"removeValue(option.value)\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: option, option: option }\"\n />\n } @else {\n {{ option.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n }\n\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\"\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\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (showsSearch()) {\n <div class=\"search-row\">\n <ds-icon\n class=\"search-icon\"\n name=\"search\"\n [size]=\"16\"\n />\n\n <input\n #search\n type=\"text\"\n class=\"search-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [placeholder]=\"searchPlaceholder()\"\n [value]=\"filter()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n (input)=\"onFilter($event)\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n </div>\n }\n\n @if (showsPanelSelectAll() && filteredOptions().length) {\n <button\n type=\"button\"\n class=\"select-all\"\n role=\"checkbox\"\n [attr.aria-checked]=\"\n allFilteredSelected()\n ? 'true'\n : someFilteredSelected()\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleSelectAll()\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"allFilteredSelected()\"\n [class.indeterminate]=\"someFilteredSelected()\"\n >\n @if (allFilteredSelected()) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n } @else if (someFilteredSelected()) {\n <span class=\"dash\"></span>\n }\n </span>\n\n <span class=\"select-all-label\">\n Select all\n </span>\n </button>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n >\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\"\n >\n {{ item.label }}\n </span>\n\n @if (showsGroupSelectAll()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"select-all group\"\n role=\"option\"\n [disabled]=\"item.disabled\"\n [attr.aria-selected]=\"groupAllSelected(item)\"\n [attr.aria-checked]=\"\n groupAllSelected(item)\n ? 'true'\n : groupSomeSelected(item)\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleGroup(item)\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"groupAllSelected(item)\"\n [class.indeterminate]=\"groupSomeSelected(item)\"\n >\n @if (groupAllSelected(item)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n } @else if (groupSomeSelected(item)) {\n <span class=\"dash\"></span>\n }\n </span>\n\n All of {{ item.label }}\n </button>\n }\n\n <ul\n class=\"optgroup-list\"\n role=\"presentation\"\n >\n @for (option of item.options; track option.value) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"activeIndex.set(flatIndexOf(option))\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\"\n >\n @if (isSelected(option.value)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n </ul>\n </li>\n } @else {\n @let option = item;\n\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"activeIndex.set(flatIndexOf(option))\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\"\n >\n @if (isSelected(option.value)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n }\n\n @if (filteredOptions().length === 0) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: filter(),\n query: filter(),\n }\"\n />\n } @else {\n No matches\n }\n </li>\n }\n </ul>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:var(--field-label-gap);--ds-dropdown-panel-bg-color: var( --ds-multi-select-panel-bg-color, var(--surface-overlay) );--_trigger-bg-color: var(--ds-multi-select-bg-color, var(--surface-default));--_trigger-border-color: var( --ds-multi-select-border-color, var(--border-default) );--_trigger-radius: var(--ds-multi-select-radius, var(--ds-radius-control));--_trigger-text-color: var(--ds-multi-select-text-color, var(--text-primary));--_trigger-border-color-focus: var( --ds-multi-select-border-color-focus, var(--accent) )}:host(.content-width){width:fit-content}:host(.compact-trigger){width:fit-content}:host(.compact-trigger) .field-trigger{padding:var(--space-1) var(--space-2-5);gap:var(--space-1-5)}:host(.compact-trigger) .trigger-caption{font-weight:var(--font-weight-medium);white-space:nowrap}:host(.compact-trigger):has(ds-badge) .field-trigger,:host(.compact-trigger):has(.trigger-label) .field-trigger{border-color:var(--accent)}:host(.compact-trigger) .trigger-label{color:var(--text-secondary);white-space:nowrap}:host(.compact-trigger) .trigger-label:not(:last-child):after{content:\",\"}.field-trigger{display:flex;flex-wrap:wrap}.field-trigger:has(>.chip-row.fit){flex-wrap:nowrap}.field-trigger{align-items:center;gap:var(--space-1-5);--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height)}.field-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.field-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.field-trigger{padding:var(--space-1-5) var(--field-pad-x);background-color:var(--_trigger-bg-color);border:var(--border-width-default) solid var(--_trigger-border-color);border-radius:var(--_trigger-radius);color:var(--_trigger-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.field-trigger:hover:not(.disabled){border-color:var(--border-strong)}.field-trigger.open,.field-trigger:focus-visible{outline:none;border-color:var(--_trigger-border-color-focus);box-shadow:var(--accent-focus-field)}.field-trigger.disabled{background-color:var(--surface-muted);color:var(--text-disabled);cursor:not-allowed}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.placeholder{color:var(--text-tertiary)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.chevron{margin-left:auto;color:var(--text-tertiary)}.dropdown-panel{--_option-bg-color-active: var(--ds-multi-select-option-bg-color-active, var(--surface-secondary));--_check-bg-color: var(--ds-multi-select-check-bg-color, var(--accent))}.dropdown-panel .option.is-active:not(:disabled){background-color:var(--_option-bg-color-active)}.dropdown-panel .option:disabled{color:var(--text-disabled);cursor:not-allowed}.dropdown-panel .dropdown-list{max-height:var(--picker-maxh)}.search-row{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-bottom:var(--border-width-default) solid var(--border-divider)}.search-icon{color:var(--text-tertiary);flex:none}.search-input{flex:1;min-width:0;border:0;background:transparent;color:var(--text-primary);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}.search-input:focus{outline:none}.select-all{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:var(--space-2) var(--space-2-5);border:0;border-bottom:var(--border-width-default) solid var(--border-divider);border-radius:var(--ds-radius-inner) var(--ds-radius-inner) 0 0;background:transparent;color:var(--text-secondary);font:var(--font-weight-semibold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);text-transform:uppercase;letter-spacing:var(--letter-spacing-wide);text-align:left;cursor:pointer}.select-all:hover:not(:disabled){background-color:var(--surface-secondary)}.select-all:disabled{color:var(--text-disabled);cursor:not-allowed}.checkbox{display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--check-size);height:var(--check-size);border-radius:var(--ds-radius-inner);border:var(--border-width-strong) solid var(--border-strong);color:var(--text-on-primary)}.checkbox.checked,.checkbox.indeterminate{background-color:var(--_check-bg-color);border-color:var(--_check-bg-color)}.checkbox .dash{width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);background-color:var(--text-on-primary)}:host([data-field-state=error]:not(.in-group)) .field-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .field-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .field-trigger{border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: TagComponent, selector: "ds-tag", inputs: ["variant", "closable", "interactive", "selected", "closeLabel"], outputs: ["closed", "toggled"] }, { kind: "component", type: BadgeComponent, selector: "ds-badge", inputs: ["status", "withDot", "solid", "count", "max", "countLabel"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
13729
|
+
], queries: [{ propertyName: "optionTemplate", first: true, predicate: DsOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "chipTemplate", first: true, predicate: DsChipTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pickerTrigger", first: true, predicate: DsPickerTriggerDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelHeaderTemplate", first: true, predicate: DsPanelHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelFooterTemplate", first: true, predicate: DsPanelFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupLabelTemplate", first: true, predicate: DsGroupLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: DsEmptyTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["search"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "chipRow", first: true, predicate: ["chipRow"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<div\n #trigger\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n [class]=\"'field-trigger ' + sizeResolved()\"\n [class.open]=\"open()\"\n [class.disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"isReadOnly() ? 'true' : null\"\n [attr.name]=\"name()\"\n [class.readonly]=\"isReadOnly()\"\n [attr.aria-activedescendant]=\"triggerActiveDescendant()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\"\n>\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOptions(),\n selected: selectedOptions(),\n count: selectedOptions().length,\n open: open(),\n disabled: isDisabled(),\n }\"\n />\n } @else if (showsCompactTrigger()) {\n <span class=\"trigger-caption\">\n {{ triggerCaption() }}\n </span>\n\n @if (triggerDisplay() === 'labels' && selectedOptions().length > 0) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (option of visibleChips(); track option.value) {\n <span\n data-chip\n class=\"trigger-label\"\n >\n {{ option.label }}\n </span>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }}\n </span>\n }\n </span>\n } @else if (selectedOptions().length > 0) {\n <ds-badge\n [count]=\"selectedOptions().length\"\n [countLabel]=\"'selected'\"\n />\n }\n } @else if (selectedOptions().length === 0) {\n <span class=\"placeholder\">\n {{ placeholder() }}\n </span>\n } @else {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (option of visibleChips(); track option.value) {\n <ds-tag\n data-chip\n variant=\"neutral\"\n closable\n [closeLabel]=\"'Remove ' + option.label\"\n (closed)=\"removeValue(option.value)\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: option, option: option }\"\n />\n } @else {\n {{ option.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n }\n\n @if (\n clearable() &&\n selectedOptions().length > 0 &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n />\n </button>\n }\n\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\"\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\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: filter(),\n }\"\n />\n </div>\n }\n\n @if (showsSearch()) {\n <div class=\"search-row\">\n <ds-icon\n class=\"search-icon\"\n name=\"search\"\n [size]=\"16\"\n />\n\n <input\n #search\n type=\"text\"\n class=\"search-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [placeholder]=\"searchPlaceholder()\"\n [value]=\"filter()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n (input)=\"onFilter($event)\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n </div>\n }\n\n @if (showsPanelSelectAll() && filteredOptions().length) {\n <button\n type=\"button\"\n class=\"select-all\"\n role=\"checkbox\"\n [attr.aria-checked]=\"\n allFilteredSelected()\n ? 'true'\n : someFilteredSelected()\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleSelectAll()\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"allFilteredSelected()\"\n [class.indeterminate]=\"someFilteredSelected()\"\n >\n @if (allFilteredSelected()) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n } @else if (someFilteredSelected()) {\n <span class=\"dash\"></span>\n }\n </span>\n\n <span class=\"select-all-label\">\n Select all\n </span>\n </button>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\"\n >\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\"\n >\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @if (showsGroupSelectAll()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"select-all group\"\n role=\"option\"\n [disabled]=\"item.disabled\"\n [attr.aria-selected]=\"groupAllSelected(item)\"\n [attr.aria-checked]=\"\n groupAllSelected(item)\n ? 'true'\n : groupSomeSelected(item)\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleGroup(item)\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"groupAllSelected(item)\"\n [class.indeterminate]=\"groupSomeSelected(item)\"\n >\n @if (groupAllSelected(item)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n } @else if (groupSomeSelected(item)) {\n <span class=\"dash\"></span>\n }\n </span>\n\n All of {{ item.label }}\n </button>\n }\n\n <ul\n class=\"optgroup-list\"\n role=\"presentation\"\n >\n @for (option of item.options; track option.value) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"cursorFromKeyboard.set(false); activeIndex.set(flatIndexOf(option))\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\"\n >\n @if (isSelected(option.value)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n </ul>\n </li>\n } @else {\n @let option = item;\n\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"cursorFromKeyboard.set(false); activeIndex.set(flatIndexOf(option))\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\"\n >\n @if (isSelected(option.value)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (filteredOptions().length === 0) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: filter(),\n query: filter(),\n }\"\n />\n } @else {\n No matches\n }\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: filter(),\n }\"\n />\n </div>\n }\n\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:var(--field-label-gap);--ds-dropdown-panel-bg-color: var( --ds-multi-select-panel-bg-color, var(--surface-overlay) );--_trigger-bg-color: var(--ds-multi-select-bg-color, var(--surface-default));--_trigger-border-color: var( --ds-multi-select-border-color, var(--border-default) );--_trigger-radius: var(--ds-multi-select-radius, var(--ds-radius-control));--_trigger-text-color: var(--ds-multi-select-text-color, var(--text-primary));--_trigger-border-color-focus: var( --ds-multi-select-border-color-focus, var(--accent) )}:host(.content-width){width:fit-content}:host(.compact-trigger){width:fit-content}:host(.compact-trigger) .field-trigger{padding:var(--space-1) var(--space-2-5);gap:var(--space-1-5)}:host(.compact-trigger) .trigger-caption{font-weight:var(--font-weight-medium);white-space:nowrap}:host(.compact-trigger):has(ds-badge) .field-trigger,:host(.compact-trigger):has(.trigger-label) .field-trigger{border-color:var(--accent)}:host(.compact-trigger) .trigger-label{color:var(--text-secondary);white-space:nowrap}:host(.compact-trigger) .trigger-label:not(:last-child):after{content:\",\"}.field-trigger{display:flex;flex-wrap:wrap}.field-trigger:has(>.chip-row.fit){flex-wrap:nowrap}.field-trigger{align-items:center;gap:var(--space-1-5);--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height)}.field-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.field-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.field-trigger{padding:var(--space-1-5) var(--field-pad-x);background-color:var(--_trigger-bg-color);border:var(--border-width-default) solid var(--_trigger-border-color);border-radius:var(--_trigger-radius);color:var(--_trigger-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.field-trigger:hover:not(.disabled){border-color:var(--border-strong)}.field-trigger.open,.field-trigger:focus-visible{outline:none;border-color:var(--_trigger-border-color-focus);box-shadow:var(--accent-focus-field)}.field-trigger.disabled{background-color:var(--surface-muted);color:var(--text-disabled);cursor:not-allowed}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.placeholder{color:var(--text-tertiary)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.chevron{margin-left:auto;color:var(--text-tertiary)}.dropdown-panel{--ds-option-bg-color-active: var( --ds-multi-select-option-bg-color-active, var(--surface-secondary) );--_check-bg-color: var(--ds-multi-select-check-bg-color, var(--accent))}.search-row{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-bottom:var(--border-width-default) solid var(--border-divider)}.search-icon{color:var(--text-tertiary);flex:none}.search-input{flex:1;min-width:0;border:0;background:transparent;color:var(--text-primary);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}.search-input:focus{outline:none}.select-all{display:flex;align-items:center;gap:var(--ds-option-gap, var(--space-2));width:100%;padding:var(--ds-option-padding, var(--space-2) var(--space-2-5));border:0;border-bottom:var(--border-width-default) solid var(--border-divider);border-radius:var(--ds-radius-inner) var(--ds-radius-inner) 0 0;background:transparent;color:var(--text-secondary);font:var(--font-weight-semibold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);text-transform:uppercase;letter-spacing:var(--letter-spacing-wide);text-align:left;cursor:pointer}.select-all:hover:not(:disabled){background-color:var(--surface-secondary)}.select-all:disabled{color:var(--text-disabled);cursor:not-allowed}.checkbox{display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--check-size);height:var(--check-size);border-radius:var(--ds-radius-inner);border:var(--border-width-strong) solid var(--border-strong);color:var(--text-on-primary)}.checkbox.checked,.checkbox.indeterminate{background-color:var(--_check-bg-color);border-color:var(--_check-bg-color)}.checkbox .dash{width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);background-color:var(--text-on-primary)}:host([data-field-state=error]:not(.in-group)) .field-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .field-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .field-trigger{border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: SpinnerComponent, selector: "ds-spinner", inputs: ["size"] }, { kind: "component", type: TagComponent, selector: "ds-tag", inputs: ["variant", "closable", "interactive", "selected", "closeLabel"], outputs: ["closed", "toggled"] }, { kind: "component", type: BadgeComponent, selector: "ds-badge", inputs: ["status", "withDot", "solid", "count", "max", "countLabel"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
12990
13730
|
}
|
|
12991
13731
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
12992
13732
|
type: Component,
|
|
12993
13733
|
args: [{ selector: 'ds-multi-select', standalone: true, imports: [
|
|
12994
13734
|
IconComponent,
|
|
13735
|
+
SpinnerComponent,
|
|
12995
13736
|
TagComponent,
|
|
12996
13737
|
BadgeComponent,
|
|
12997
13738
|
FieldMessageComponent,
|
|
@@ -13006,14 +13747,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
13006
13747
|
useExisting: forwardRef(() => MultiSelectComponent),
|
|
13007
13748
|
multi: true,
|
|
13008
13749
|
},
|
|
13009
|
-
], template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<div\n #trigger\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n [class]=\"'field-trigger ' + sizeResolved()\"\n [class.open]=\"open()\"\n [class.disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-activedescendant]=\"triggerActiveDescendant()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\"\n>\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOptions(),\n selected: selectedOptions(),\n count: selectedOptions().length,\n open: open(),\n disabled: isDisabled(),\n }\"\n />\n } @else if (showsCompactTrigger()) {\n <span class=\"trigger-caption\">\n {{ triggerCaption() }}\n </span>\n\n @if (triggerDisplay() === 'labels' && selectedOptions().length > 0) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (option of visibleChips(); track option.value) {\n <span\n data-chip\n class=\"trigger-label\"\n >\n {{ option.label }}\n </span>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }}\n </span>\n }\n </span>\n } @else if (selectedOptions().length > 0) {\n <ds-badge\n [count]=\"selectedOptions().length\"\n [countLabel]=\"'selected'\"\n />\n }\n } @else if (selectedOptions().length === 0) {\n <span class=\"placeholder\">\n {{ placeholder() }}\n </span>\n } @else {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (option of visibleChips(); track option.value) {\n <ds-tag\n data-chip\n variant=\"neutral\"\n closable\n [closeLabel]=\"'Remove ' + option.label\"\n (closed)=\"removeValue(option.value)\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: option, option: option }\"\n />\n } @else {\n {{ option.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n }\n\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\"\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\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (showsSearch()) {\n <div class=\"search-row\">\n <ds-icon\n class=\"search-icon\"\n name=\"search\"\n [size]=\"16\"\n />\n\n <input\n #search\n type=\"text\"\n class=\"search-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [placeholder]=\"searchPlaceholder()\"\n [value]=\"filter()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n (input)=\"onFilter($event)\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n </div>\n }\n\n @if (showsPanelSelectAll() && filteredOptions().length) {\n <button\n type=\"button\"\n class=\"select-all\"\n role=\"checkbox\"\n [attr.aria-checked]=\"\n allFilteredSelected()\n ? 'true'\n : someFilteredSelected()\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleSelectAll()\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"allFilteredSelected()\"\n [class.indeterminate]=\"someFilteredSelected()\"\n >\n @if (allFilteredSelected()) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n } @else if (someFilteredSelected()) {\n <span class=\"dash\"></span>\n }\n </span>\n\n <span class=\"select-all-label\">\n Select all\n </span>\n </button>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n >\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\"\n >\n {{ item.label }}\n </span>\n\n @if (showsGroupSelectAll()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"select-all group\"\n role=\"option\"\n [disabled]=\"item.disabled\"\n [attr.aria-selected]=\"groupAllSelected(item)\"\n [attr.aria-checked]=\"\n groupAllSelected(item)\n ? 'true'\n : groupSomeSelected(item)\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleGroup(item)\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"groupAllSelected(item)\"\n [class.indeterminate]=\"groupSomeSelected(item)\"\n >\n @if (groupAllSelected(item)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n } @else if (groupSomeSelected(item)) {\n <span class=\"dash\"></span>\n }\n </span>\n\n All of {{ item.label }}\n </button>\n }\n\n <ul\n class=\"optgroup-list\"\n role=\"presentation\"\n >\n @for (option of item.options; track option.value) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"activeIndex.set(flatIndexOf(option))\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\"\n >\n @if (isSelected(option.value)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n </ul>\n </li>\n } @else {\n @let option = item;\n\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"activeIndex.set(flatIndexOf(option))\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\"\n >\n @if (isSelected(option.value)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n }\n\n @if (filteredOptions().length === 0) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: filter(),\n query: filter(),\n }\"\n />\n } @else {\n No matches\n }\n </li>\n }\n </ul>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:var(--field-label-gap);--ds-dropdown-panel-bg-color: var( --ds-multi-select-panel-bg-color, var(--surface-overlay) );--_trigger-bg-color: var(--ds-multi-select-bg-color, var(--surface-default));--_trigger-border-color: var( --ds-multi-select-border-color, var(--border-default) );--_trigger-radius: var(--ds-multi-select-radius, var(--ds-radius-control));--_trigger-text-color: var(--ds-multi-select-text-color, var(--text-primary));--_trigger-border-color-focus: var( --ds-multi-select-border-color-focus, var(--accent) )}:host(.content-width){width:fit-content}:host(.compact-trigger){width:fit-content}:host(.compact-trigger) .field-trigger{padding:var(--space-1) var(--space-2-5);gap:var(--space-1-5)}:host(.compact-trigger) .trigger-caption{font-weight:var(--font-weight-medium);white-space:nowrap}:host(.compact-trigger):has(ds-badge) .field-trigger,:host(.compact-trigger):has(.trigger-label) .field-trigger{border-color:var(--accent)}:host(.compact-trigger) .trigger-label{color:var(--text-secondary);white-space:nowrap}:host(.compact-trigger) .trigger-label:not(:last-child):after{content:\",\"}.field-trigger{display:flex;flex-wrap:wrap}.field-trigger:has(>.chip-row.fit){flex-wrap:nowrap}.field-trigger{align-items:center;gap:var(--space-1-5);--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height)}.field-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.field-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.field-trigger{padding:var(--space-1-5) var(--field-pad-x);background-color:var(--_trigger-bg-color);border:var(--border-width-default) solid var(--_trigger-border-color);border-radius:var(--_trigger-radius);color:var(--_trigger-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.field-trigger:hover:not(.disabled){border-color:var(--border-strong)}.field-trigger.open,.field-trigger:focus-visible{outline:none;border-color:var(--_trigger-border-color-focus);box-shadow:var(--accent-focus-field)}.field-trigger.disabled{background-color:var(--surface-muted);color:var(--text-disabled);cursor:not-allowed}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.placeholder{color:var(--text-tertiary)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.chevron{margin-left:auto;color:var(--text-tertiary)}.dropdown-panel{--_option-bg-color-active: var(--ds-multi-select-option-bg-color-active, var(--surface-secondary));--_check-bg-color: var(--ds-multi-select-check-bg-color, var(--accent))}.dropdown-panel .option.is-active:not(:disabled){background-color:var(--_option-bg-color-active)}.dropdown-panel .option:disabled{color:var(--text-disabled);cursor:not-allowed}.dropdown-panel .dropdown-list{max-height:var(--picker-maxh)}.search-row{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-bottom:var(--border-width-default) solid var(--border-divider)}.search-icon{color:var(--text-tertiary);flex:none}.search-input{flex:1;min-width:0;border:0;background:transparent;color:var(--text-primary);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}.search-input:focus{outline:none}.select-all{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:var(--space-2) var(--space-2-5);border:0;border-bottom:var(--border-width-default) solid var(--border-divider);border-radius:var(--ds-radius-inner) var(--ds-radius-inner) 0 0;background:transparent;color:var(--text-secondary);font:var(--font-weight-semibold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);text-transform:uppercase;letter-spacing:var(--letter-spacing-wide);text-align:left;cursor:pointer}.select-all:hover:not(:disabled){background-color:var(--surface-secondary)}.select-all:disabled{color:var(--text-disabled);cursor:not-allowed}.checkbox{display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--check-size);height:var(--check-size);border-radius:var(--ds-radius-inner);border:var(--border-width-strong) solid var(--border-strong);color:var(--text-on-primary)}.checkbox.checked,.checkbox.indeterminate{background-color:var(--_check-bg-color);border-color:var(--_check-bg-color)}.checkbox .dash{width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);background-color:var(--text-on-primary)}:host([data-field-state=error]:not(.in-group)) .field-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .field-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .field-trigger{border-color:var(--success)}\n"] }]
|
|
13010
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], maxVisibleChips: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleChips", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], triggerDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerDisplay", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], selectAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAll", required: false }] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsOptionTemplateDirective), { ...{
|
|
13750
|
+
], template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\"\n >\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\"\n >\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\"\n >\n (optional)\n </span>\n }\n </span>\n}\n\n<div\n #trigger\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n [class]=\"'field-trigger ' + sizeResolved()\"\n [class.open]=\"open()\"\n [class.disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"isReadOnly() ? 'true' : null\"\n [attr.name]=\"name()\"\n [class.readonly]=\"isReadOnly()\"\n [attr.aria-activedescendant]=\"triggerActiveDescendant()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\"\n>\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOptions(),\n selected: selectedOptions(),\n count: selectedOptions().length,\n open: open(),\n disabled: isDisabled(),\n }\"\n />\n } @else if (showsCompactTrigger()) {\n <span class=\"trigger-caption\">\n {{ triggerCaption() }}\n </span>\n\n @if (triggerDisplay() === 'labels' && selectedOptions().length > 0) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (option of visibleChips(); track option.value) {\n <span\n data-chip\n class=\"trigger-label\"\n >\n {{ option.label }}\n </span>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }}\n </span>\n }\n </span>\n } @else if (selectedOptions().length > 0) {\n <ds-badge\n [count]=\"selectedOptions().length\"\n [countLabel]=\"'selected'\"\n />\n }\n } @else if (selectedOptions().length === 0) {\n <span class=\"placeholder\">\n {{ placeholder() }}\n </span>\n } @else {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\"\n >\n @for (option of visibleChips(); track option.value) {\n <ds-tag\n data-chip\n variant=\"neutral\"\n closable\n [closeLabel]=\"'Remove ' + option.label\"\n (closed)=\"removeValue(option.value)\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: option, option: option }\"\n />\n } @else {\n {{ option.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow\n >\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n }\n\n @if (\n clearable() &&\n selectedOptions().length > 0 &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n />\n </button>\n }\n\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\"\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\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: filter(),\n }\"\n />\n </div>\n }\n\n @if (showsSearch()) {\n <div class=\"search-row\">\n <ds-icon\n class=\"search-icon\"\n name=\"search\"\n [size]=\"16\"\n />\n\n <input\n #search\n type=\"text\"\n class=\"search-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [placeholder]=\"searchPlaceholder()\"\n [value]=\"filter()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n (input)=\"onFilter($event)\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n </div>\n }\n\n @if (showsPanelSelectAll() && filteredOptions().length) {\n <button\n type=\"button\"\n class=\"select-all\"\n role=\"checkbox\"\n [attr.aria-checked]=\"\n allFilteredSelected()\n ? 'true'\n : someFilteredSelected()\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleSelectAll()\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"allFilteredSelected()\"\n [class.indeterminate]=\"someFilteredSelected()\"\n >\n @if (allFilteredSelected()) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n } @else if (someFilteredSelected()) {\n <span class=\"dash\"></span>\n }\n </span>\n\n <span class=\"select-all-label\">\n Select all\n </span>\n </button>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\"\n >\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\"\n >\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\"\n >\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\"\n />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @if (showsGroupSelectAll()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"select-all group\"\n role=\"option\"\n [disabled]=\"item.disabled\"\n [attr.aria-selected]=\"groupAllSelected(item)\"\n [attr.aria-checked]=\"\n groupAllSelected(item)\n ? 'true'\n : groupSomeSelected(item)\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleGroup(item)\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"groupAllSelected(item)\"\n [class.indeterminate]=\"groupSomeSelected(item)\"\n >\n @if (groupAllSelected(item)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n } @else if (groupSomeSelected(item)) {\n <span class=\"dash\"></span>\n }\n </span>\n\n All of {{ item.label }}\n </button>\n }\n\n <ul\n class=\"optgroup-list\"\n role=\"presentation\"\n >\n @for (option of item.options; track option.value) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"cursorFromKeyboard.set(false); activeIndex.set(flatIndexOf(option))\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\"\n >\n @if (isSelected(option.value)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n </ul>\n </li>\n } @else {\n @let option = item;\n\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"cursorFromKeyboard.set(false); activeIndex.set(flatIndexOf(option))\"\n >\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\"\n >\n @if (isSelected(option.value)) {\n <ds-icon\n name=\"check\"\n [size]=\"13\"\n />\n }\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\"\n />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\"\n />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (filteredOptions().length === 0) {\n <li\n class=\"empty t-s\"\n role=\"presentation\"\n >\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: filter(),\n query: filter(),\n }\"\n />\n } @else {\n No matches\n }\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: filter(),\n }\"\n />\n </div>\n }\n\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:var(--field-label-gap);--ds-dropdown-panel-bg-color: var( --ds-multi-select-panel-bg-color, var(--surface-overlay) );--_trigger-bg-color: var(--ds-multi-select-bg-color, var(--surface-default));--_trigger-border-color: var( --ds-multi-select-border-color, var(--border-default) );--_trigger-radius: var(--ds-multi-select-radius, var(--ds-radius-control));--_trigger-text-color: var(--ds-multi-select-text-color, var(--text-primary));--_trigger-border-color-focus: var( --ds-multi-select-border-color-focus, var(--accent) )}:host(.content-width){width:fit-content}:host(.compact-trigger){width:fit-content}:host(.compact-trigger) .field-trigger{padding:var(--space-1) var(--space-2-5);gap:var(--space-1-5)}:host(.compact-trigger) .trigger-caption{font-weight:var(--font-weight-medium);white-space:nowrap}:host(.compact-trigger):has(ds-badge) .field-trigger,:host(.compact-trigger):has(.trigger-label) .field-trigger{border-color:var(--accent)}:host(.compact-trigger) .trigger-label{color:var(--text-secondary);white-space:nowrap}:host(.compact-trigger) .trigger-label:not(:last-child):after{content:\",\"}.field-trigger{display:flex;flex-wrap:wrap}.field-trigger:has(>.chip-row.fit){flex-wrap:nowrap}.field-trigger{align-items:center;gap:var(--space-1-5);--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height)}.field-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.field-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.field-trigger{padding:var(--space-1-5) var(--field-pad-x);background-color:var(--_trigger-bg-color);border:var(--border-width-default) solid var(--_trigger-border-color);border-radius:var(--_trigger-radius);color:var(--_trigger-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.field-trigger:hover:not(.disabled){border-color:var(--border-strong)}.field-trigger.open,.field-trigger:focus-visible{outline:none;border-color:var(--_trigger-border-color-focus);box-shadow:var(--accent-focus-field)}.field-trigger.disabled{background-color:var(--surface-muted);color:var(--text-disabled);cursor:not-allowed}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.placeholder{color:var(--text-tertiary)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.chevron{margin-left:auto;color:var(--text-tertiary)}.dropdown-panel{--ds-option-bg-color-active: var( --ds-multi-select-option-bg-color-active, var(--surface-secondary) );--_check-bg-color: var(--ds-multi-select-check-bg-color, var(--accent))}.search-row{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-bottom:var(--border-width-default) solid var(--border-divider)}.search-icon{color:var(--text-tertiary);flex:none}.search-input{flex:1;min-width:0;border:0;background:transparent;color:var(--text-primary);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}.search-input:focus{outline:none}.select-all{display:flex;align-items:center;gap:var(--ds-option-gap, var(--space-2));width:100%;padding:var(--ds-option-padding, var(--space-2) var(--space-2-5));border:0;border-bottom:var(--border-width-default) solid var(--border-divider);border-radius:var(--ds-radius-inner) var(--ds-radius-inner) 0 0;background:transparent;color:var(--text-secondary);font:var(--font-weight-semibold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);text-transform:uppercase;letter-spacing:var(--letter-spacing-wide);text-align:left;cursor:pointer}.select-all:hover:not(:disabled){background-color:var(--surface-secondary)}.select-all:disabled{color:var(--text-disabled);cursor:not-allowed}.checkbox{display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--check-size);height:var(--check-size);border-radius:var(--ds-radius-inner);border:var(--border-width-strong) solid var(--border-strong);color:var(--text-on-primary)}.checkbox.checked,.checkbox.indeterminate{background-color:var(--_check-bg-color);border-color:var(--_check-bg-color)}.checkbox .dash{width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);background-color:var(--text-on-primary)}:host([data-field-state=error]:not(.in-group)) .field-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .field-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .field-trigger{border-color:var(--success)}\n"] }]
|
|
13751
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], readonlyBinding: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], filterWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterWith", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], scrollActiveIntoView: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollActiveIntoView", required: false }] }], maxVisibleChips: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleChips", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], triggerDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerDisplay", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], selectAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAll", required: false }] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsOptionTemplateDirective), { ...{
|
|
13011
13752
|
read: TemplateRef,
|
|
13012
13753
|
}, isSignal: true }] }], chipTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsChipTemplateDirective), { ...{
|
|
13013
13754
|
read: TemplateRef,
|
|
13014
13755
|
}, isSignal: true }] }], pickerTrigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPickerTriggerDirective), { ...{
|
|
13015
13756
|
read: TemplateRef,
|
|
13016
|
-
}, isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsEmptyTemplateDirective), { ...{
|
|
13757
|
+
}, isSignal: true }] }], panelHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPanelHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], panelFooterTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPanelFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupLabelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsGroupLabelTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsEmptyTemplateDirective), { ...{
|
|
13017
13758
|
read: TemplateRef,
|
|
13018
13759
|
}, isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], searchInput: [{ type: i0.ViewChild, args: ['search', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], chipRow: [{ type: i0.ViewChild, args: ['chipRow', { isSignal: true }] }] } });
|
|
13019
13760
|
|
|
@@ -13366,5 +14107,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
13366
14107
|
* Generated bundle index. Do not edit.
|
|
13367
14108
|
*/
|
|
13368
14109
|
|
|
13369
|
-
export { ACCORDION, AccordionComponent, AccordionItemComponent, AlertComponent, AppLayoutComponent, AuthLayoutComponent, AutocompleteComponent, AvatarComponent, AvatarGroupComponent, BadgeComponent, BannerComponent, BodyScrollLockService, BottomSheetComponent, BrandNameDirective, BreadcrumbsComponent, BreadcrumbsService, ButtonComponent, ButtonGroupComponent, CardComponent, CellTemplateDirective, CheckboxComponent, ColorPickerComponent, ContainerComponent, DS_CONFIG, DS_FIELD_GROUP, DS_FIELD_WARNING_KIND, DS_ICON_REGISTRY, DS_TOAST_CONFIG, DS_TOAST_POSITION, DS_TOAST_POSITION_DEFAULT, DatePickerComponent, DescriptionItemComponent, DescriptionListComponent, DividerComponent, DrawerComponent, DropzoneComponent, DsChipTemplateDirective, DsCreateTemplateDirective, DsEmptyTemplateDirective, DsOptionTemplateDirective, DsOverlayCloseRef, DsPickerTriggerDirective, DsStaticPreview, EmptyStateComponent, FieldClickFocusDirective, FieldGroupComponent, FilterBarComponent, FilterItemDirective, HeaderFilterDirective, ICONS, IconButtonComponent, IconComponent, InlineComponent, InputComponent, LayoutNavigationService, LayoutScrollService, ListComponent, ListItemComponent, LoadingOverlayComponent, MenuComponent, MenuDividerComponent, MenuItemComponent, ModalCardComponent, ModalComponent, ModalService, MultiSelectComponent, NumberStepperComponent, OtpInputComponent, PageFooterComponent, PageHeaderComponent, PaginationComponent, PasswordRulesComponent, PopoverComponent, ProgressComponent, RADIO_GROUP, RadioComponent, RadioGroupComponent, RailTriggerDirective, ReserveMessagesDirective, SIDENAV, SearchComponent, SegmentedComponent, SelectComponent, SidenavComponent, SidenavFooterComponent, SidenavGroupComponent, SidenavItemComponent, SkeletonComponent, SliderComponent, SpinnerComponent, SplitButtonComponent, StackComponent, StatComponent, StatusDotComponent, StepperComponent, SwitchComponent, TabComponent, TableComponent, TabsComponent, TagComponent, TextareaComponent, TimePickerComponent, TimelineComponent, TimelineItemComponent, ToastComponent, ToastRegionComponent, ToastService, ToggleButtonComponent, TooltipDirective, TooltipPanelComponent, TopBarComponent, TreeComponent, W3wComponent, avatarTint, flattenDsOptions, inheritDsConfig, initialsFrom, isDsOptionGroup, isSelectOptionGroup, passwordRulesMet, provideDsConfig, provideDsIcons, provideDsTheme };
|
|
14110
|
+
export { ACCORDION, AccordionComponent, AccordionItemComponent, AlertComponent, AppLayoutComponent, AuthLayoutComponent, AutocompleteComponent, AvatarComponent, AvatarGroupComponent, BadgeComponent, BannerComponent, BodyScrollLockService, BottomSheetComponent, BrandNameDirective, BreadcrumbsComponent, BreadcrumbsService, ButtonComponent, ButtonGroupComponent, CardComponent, CellTemplateDirective, CheckboxComponent, ColorPickerComponent, ContainerComponent, DS_CONFIG, DS_FIELD_GROUP, DS_FIELD_WARNING_KIND, DS_ICON_REGISTRY, DS_TOAST_CONFIG, DS_TOAST_POSITION, DS_TOAST_POSITION_DEFAULT, DatePickerComponent, DescriptionItemComponent, DescriptionListComponent, DividerComponent, DrawerComponent, DropzoneComponent, DsChipTemplateDirective, DsCreateTemplateDirective, DsEmptyTemplateDirective, DsGroupLabelTemplateDirective, DsOptionTemplateDirective, DsOverlayCloseRef, DsPanelFooterTemplateDirective, DsPanelHeaderTemplateDirective, DsPickerTriggerDirective, DsStaticPreview, EmptyStateComponent, FieldClickFocusDirective, FieldGroupComponent, FilterBarComponent, FilterItemDirective, HeaderFilterDirective, ICONS, IconButtonComponent, IconComponent, InlineComponent, InputComponent, LayoutNavigationService, LayoutScrollService, ListComponent, ListItemComponent, LoadingOverlayComponent, MenuComponent, MenuDividerComponent, MenuItemComponent, ModalCardComponent, ModalComponent, ModalService, MultiSelectComponent, NumberStepperComponent, OtpInputComponent, PageFooterComponent, PageHeaderComponent, PaginationComponent, PasswordRulesComponent, PopoverComponent, ProgressComponent, RADIO_GROUP, RadioComponent, RadioGroupComponent, RailTriggerDirective, ReserveMessagesDirective, SIDENAV, SearchComponent, SegmentedComponent, SelectComponent, SidenavComponent, SidenavFooterComponent, SidenavGroupComponent, SidenavItemComponent, SkeletonComponent, SliderComponent, SpinnerComponent, SplitButtonComponent, StackComponent, StatComponent, StatusDotComponent, StepperComponent, SwitchComponent, TabComponent, TableComponent, TabsComponent, TagComponent, TextareaComponent, TimePickerComponent, TimelineComponent, TimelineItemComponent, ToastComponent, ToastRegionComponent, ToastService, ToggleButtonComponent, TooltipDirective, TooltipPanelComponent, TopBarComponent, TreeComponent, W3wComponent, avatarTint, flattenDsOptions, inheritDsConfig, initialsFrom, isDsOptionGroup, isSelectOptionGroup, passwordRulesMet, provideDsConfig, provideDsIcons, provideDsTheme };
|
|
13370
14111
|
//# sourceMappingURL=ids-group-ltd-ids-design-system.mjs.map
|