@ids-group-ltd/ids-design-system 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +3170 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -0
- package/package.json +46 -0
- package/styles/_dropdown-overlay.scss +117 -0
- package/styles/_fonts.scss +59 -0
- package/styles/_icon-base.scss +9 -0
- package/styles/_layout-utils.scss +14 -0
- package/styles/_link.scss +77 -0
- package/styles/_page-grid.scss +68 -0
- package/styles/_reset.scss +17 -0
- package/styles/_scrollbar.scss +17 -0
- package/styles/_skeleton-shimmer.scss +32 -0
- package/styles/_toast-overlay.scss +6 -0
- package/styles/_tokens-charts.scss +71 -0
- package/styles/_tokens.scss +614 -0
- package/styles/_typography.scss +30 -0
- package/styles/ds.scss +27 -0
- package/styles/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/styles/fonts/jetbrains-mono-latin-500-normal.woff2 +0 -0
- package/styles/fonts/jetbrains-mono-latin-600-normal.woff2 +0 -0
- package/styles/fonts/mulish-latin-400-normal.woff2 +0 -0
- package/styles/fonts/mulish-latin-500-normal.woff2 +0 -0
- package/styles/fonts/mulish-latin-600-normal.woff2 +0 -0
- package/styles/fonts/mulish-latin-700-normal.woff2 +0 -0
- package/styles/fonts/mulish-latin-800-normal.woff2 +0 -0
- package/themes/README.md +96 -0
- package/themes/default/_palette.scss +159 -0
- package/themes/default/_theme.scss +274 -0
- package/types/ids-group-ltd-ids-design-system.d.ts +1398 -0
|
@@ -0,0 +1,3170 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, computed, ViewEncapsulation, Component, booleanAttribute, output, viewChild, model, ElementRef, contentChildren, ChangeDetectionStrategy, Directive, ViewContainerRef, signal, effect, TemplateRef, Injectable, DestroyRef, HostBinding, HostListener, forwardRef, DOCUMENT as DOCUMENT$1 } from '@angular/core';
|
|
3
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
|
+
import { NgTemplateOutlet, DOCUMENT } from '@angular/common';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { FormsModule } from '@angular/forms';
|
|
7
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
8
|
+
import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
9
|
+
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
10
|
+
import * as i2 from '@angular/cdk/a11y';
|
|
11
|
+
import { A11yModule, CdkTrapFocus } from '@angular/cdk/a11y';
|
|
12
|
+
|
|
13
|
+
const DS_CONFIG = new InjectionToken('DS_CONFIG', {
|
|
14
|
+
factory: () => ({}),
|
|
15
|
+
});
|
|
16
|
+
/** Provide DS-level defaults at the app root.
|
|
17
|
+
*
|
|
18
|
+
* providers: [provideDsConfig({ card: { padding: 'sm' } })]
|
|
19
|
+
*
|
|
20
|
+
* Component inputs (e.g. `<ds-card padding="lg">`) still win over the config.
|
|
21
|
+
*/
|
|
22
|
+
function provideDsConfig(config) {
|
|
23
|
+
return { provide: DS_CONFIG, useValue: config };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** A reference to the overlay/container the projected content lives in, used to
|
|
27
|
+
* close it from the inside — e.g. a popover (and, later, a dropdown/select)
|
|
28
|
+
* closing when a menu item is selected. The container provides it via DI;
|
|
29
|
+
* content injects it with `{ optional: true }` so the same content also works
|
|
30
|
+
* standalone (outside any overlay).
|
|
31
|
+
*
|
|
32
|
+
* Same shape as Angular Material's `MatDialogRef` (content calls `close()` on a
|
|
33
|
+
* ref), generalised so any dismissible overlay can provide it. */
|
|
34
|
+
class DsOverlayCloseRef {
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const DS_ICON_REGISTRY = new InjectionToken('DS_ICON_REGISTRY', {
|
|
38
|
+
factory: () => ({}),
|
|
39
|
+
});
|
|
40
|
+
/** Register additional icons available to `<ds-icon [name]="...">` alongside the built-in DS set.
|
|
41
|
+
*
|
|
42
|
+
* providers: [
|
|
43
|
+
* provideDsIcons({
|
|
44
|
+
* 'cloud-upload': '<path d="..."/>',
|
|
45
|
+
* 'shield': '<path d="..."/>',
|
|
46
|
+
* }),
|
|
47
|
+
* ]
|
|
48
|
+
*
|
|
49
|
+
* Names take precedence as: built-in `ICONS` > consumer registry. Consumer names that clash with
|
|
50
|
+
* built-ins are ignored — to override a built-in, edit the DS source.
|
|
51
|
+
*/
|
|
52
|
+
function provideDsIcons(icons) {
|
|
53
|
+
return { provide: DS_ICON_REGISTRY, useValue: icons };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Inline SVG icon set. Ported 1:1 from CLAUDE_DESIGN_DS/ds-icons.jsx.
|
|
57
|
+
// All paths render inside <svg viewBox="0 0 24 24" fill="none" stroke="currentColor">, stroke-width 1.75.
|
|
58
|
+
const ICONS = {
|
|
59
|
+
search: '<circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" />',
|
|
60
|
+
plus: '<path d="M12 5v14M5 12h14" />',
|
|
61
|
+
minus: '<path d="M5 12h14" />',
|
|
62
|
+
check: '<path d="m4 12 5 5L20 6" />',
|
|
63
|
+
x: '<path d="M6 6l12 12M18 6L6 18" />',
|
|
64
|
+
chevronDown: '<path d="m6 9 6 6 6-6" />',
|
|
65
|
+
chevronRight: '<path d="m9 6 6 6-6 6" />',
|
|
66
|
+
chevronLeft: '<path d="m15 6-6 6 6 6" />',
|
|
67
|
+
chevronUp: '<path d="m6 15 6-6 6 6" />',
|
|
68
|
+
arrowRight: '<path d="M5 12h14M13 6l6 6-6 6" />',
|
|
69
|
+
arrowUp: '<path d="M12 19V5M6 11l6-6 6 6" />',
|
|
70
|
+
arrowDown: '<path d="M12 5v14M6 13l6 6 6-6" />',
|
|
71
|
+
info: '<circle cx="12" cy="12" r="9" /><path d="M12 8v.01M11 12h1v4h1" />',
|
|
72
|
+
warn: '<path d="M12 3 2 21h20L12 3z" /><path d="M12 10v4M12 18v.01" />',
|
|
73
|
+
error: '<circle cx="12" cy="12" r="9" /><path d="M12 8v4M12 16v.01" />',
|
|
74
|
+
success: '<circle cx="12" cy="12" r="9" /><path d="m8 12 3 3 5-6" />',
|
|
75
|
+
bell: '<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" /><path d="M10 21a2 2 0 0 0 4 0" />',
|
|
76
|
+
settings: '<circle cx="12" cy="12" r="3" /><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z" />',
|
|
77
|
+
user: '<circle cx="12" cy="8" r="4" /><path d="M4 21a8 8 0 0 1 16 0" />',
|
|
78
|
+
users: '<circle cx="9" cy="8" r="4" /><path d="M2 21a7 7 0 0 1 14 0" /><path d="M16 4a4 4 0 0 1 0 8M22 21a6 6 0 0 0-6-6" />',
|
|
79
|
+
home: '<path d="m3 11 9-8 9 8" /><path d="M5 10v10h14V10" />',
|
|
80
|
+
calendar: '<rect x="3" y="5" width="18" height="16" rx="2" /><path d="M3 10h18M8 3v4M16 3v4" />',
|
|
81
|
+
truck: '<path d="M3 16V6a1 1 0 0 1 1-1h11v11" /><path d="M15 9h4l2 3v4h-6" /><circle cx="7.5" cy="17.5" r="2" /><circle cx="17.5" cy="17.5" r="2" />',
|
|
82
|
+
box: '<path d="m21 8-9-5-9 5 9 5 9-5z" /><path d="M3 8v8l9 5 9-5V8" /><path d="m12 13 .01 8" />',
|
|
83
|
+
map: '<path d="m9 4-6 3v13l6-3 6 3 6-3V4l-6 3-6-3z" /><path d="M9 4v13M15 7v13" />',
|
|
84
|
+
activity: '<path d="M3 12h4l3-9 4 18 3-9h4" />',
|
|
85
|
+
folder: '<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />',
|
|
86
|
+
edit: '<path d="M12 20h9" /><path d="M16.5 3.5a2.1 2.1 0 1 1 3 3L7 19l-4 1 1-4z" />',
|
|
87
|
+
external: '<path d="M14 4h6v6" /><path d="M20 4 10 14" /><path d="M20 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h5" />',
|
|
88
|
+
trash: '<path d="M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />',
|
|
89
|
+
copy: '<rect x="9" y="9" width="11" height="11" rx="2" /><path d="M5 15V5a2 2 0 0 1 2-2h10" />',
|
|
90
|
+
download: '<path d="M12 4v12M6 12l6 6 6-6" /><path d="M4 20h16" />',
|
|
91
|
+
upload: '<path d="M12 20V8M6 12l6-6 6 6" /><path d="M4 4h16" />',
|
|
92
|
+
eye: '<path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z" /><circle cx="12" cy="12" r="3" />',
|
|
93
|
+
filter: '<path d="M3 5h18l-7 9v6l-4-2v-4z" />',
|
|
94
|
+
sort: '<path d="M7 4v16M3 8l4-4 4 4" /><path d="M17 20V4M21 16l-4 4-4-4" />',
|
|
95
|
+
sortAsc: '<path d="M7 18V6M3 10l4-4 4 4" />',
|
|
96
|
+
sortDesc: '<path d="M7 6v12M11 14l-4 4-4-4" />',
|
|
97
|
+
grid: '<rect x="3" y="3" width="7" height="7" /><rect x="14" y="3" width="7" height="7" /><rect x="3" y="14" width="7" height="7" /><rect x="14" y="14" width="7" height="7" />',
|
|
98
|
+
list: '<path d="M8 6h13M8 12h13M8 18h13" /><circle cx="3.5" cy="6" r="1.2" /><circle cx="3.5" cy="12" r="1.2" /><circle cx="3.5" cy="18" r="1.2" />',
|
|
99
|
+
moreH: '<circle cx="5" cy="12" r="1.5" /><circle cx="12" cy="12" r="1.5" /><circle cx="19" cy="12" r="1.5" />',
|
|
100
|
+
moreV: '<circle cx="12" cy="5" r="1.5" /><circle cx="12" cy="12" r="1.5" /><circle cx="12" cy="19" r="1.5" />',
|
|
101
|
+
link: '<path d="M10 14a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1 1" /><path d="M14 10a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1-1" />',
|
|
102
|
+
flag: '<path d="M5 21V5a14 14 0 0 1 14 0v9a14 14 0 0 1-14 0z" />',
|
|
103
|
+
star: '<path d="m12 3 2.9 6 6.6.9-4.8 4.6 1.1 6.5L12 17.8 6.2 21l1.1-6.5L2.5 9.9 9.1 9z" />',
|
|
104
|
+
inbox: '<path d="M22 12h-6l-2 3h-4l-2-3H2" /><path d="M5 4h14l3 8v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8z" />',
|
|
105
|
+
archive: '<rect x="3" y="3" width="18" height="5" rx="1" /><path d="M5 8v11a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8M10 12h4" />',
|
|
106
|
+
clock: '<circle cx="12" cy="12" r="9" /><path d="M12 7v5l3 2" />',
|
|
107
|
+
refresh: '<path d="M3 12a9 9 0 0 1 15-6.7L21 8" /><path d="M21 3v5h-5" /><path d="M21 12a9 9 0 0 1-15 6.7L3 16" /><path d="M3 21v-5h5" />',
|
|
108
|
+
play: '<path d="M6 4l14 8-14 8z" />',
|
|
109
|
+
pause: '<path d="M7 4v16M17 4v16" />',
|
|
110
|
+
cmd: '<path d="M9 9h6v6H9zM6 9V7a3 3 0 1 1 3 3H6zM6 15v2a3 3 0 1 0 3-3H6zM18 9V7a3 3 0 1 0-3 3h3zM18 15v2a3 3 0 1 1-3-3h3z" />',
|
|
111
|
+
paperclip: '<path d="m21 11-9 9a5 5 0 0 1-7-7l9-9a3 3 0 0 1 4 4l-9 9a1 1 0 0 1-1-1l8-8" />',
|
|
112
|
+
file: '<path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" /><path d="M14 3v6h6" />',
|
|
113
|
+
image: '<rect x="3" y="3" width="18" height="18" rx="2" /><circle cx="9" cy="9" r="2" /><path d="m21 15-5-5L5 21" />',
|
|
114
|
+
lock: '<rect x="4" y="11" width="16" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" />',
|
|
115
|
+
logout: '<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" /><path d="m16 17 5-5-5-5M21 12H9" />',
|
|
116
|
+
help: '<circle cx="12" cy="12" r="9" /><path d="M9.5 9a2.5 2.5 0 0 1 5 0c0 1.5-2.5 2-2.5 4M12 17v.01" />',
|
|
117
|
+
pin: '<path d="M12 22v-7" /><path d="m9 15 6 0M8 9l8 0M9 15c-2-1.5-3-4-3-7l12 0c0 3-1 5.5-3 7" />',
|
|
118
|
+
bookmark: '<path d="M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16l-7-4z" />',
|
|
119
|
+
sparkle: '<path d="M12 3v6M12 15v6M3 12h6M15 12h6M5.6 5.6l4.2 4.2M14.2 14.2l4.2 4.2M5.6 18.4l4.2-4.2M14.2 9.8l4.2-4.2" />',
|
|
120
|
+
layers: '<path d="m12 3 9 5-9 5-9-5z" /><path d="m3 13 9 5 9-5M3 18l9 5 9-5" />',
|
|
121
|
+
chart: '<path d="M3 3v18h18" /><path d="M7 14l4-4 4 4 5-5" />',
|
|
122
|
+
gauge: '<path d="M12 14l4-4" /><circle cx="12" cy="14" r="9" /><path d="M3 14a9 9 0 0 1 18 0" />',
|
|
123
|
+
package: '<path d="M3 7v10l9 4 9-4V7l-9-4z" /><path d="m3 7 9 5 9-5M12 12v9" />',
|
|
124
|
+
git: '<circle cx="6" cy="6" r="2.5" /><circle cx="6" cy="18" r="2.5" /><circle cx="18" cy="12" r="2.5" /><path d="M6 8.5v7M8.5 6h4a3 3 0 0 1 3 3v0" />',
|
|
125
|
+
sun: '<circle cx="12" cy="12" r="4" /><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" />',
|
|
126
|
+
moon: '<path d="M21 13a9 9 0 0 1-12-12 9 9 0 1 0 12 12z" />',
|
|
127
|
+
save: '<path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" /><path d="M17 21v-8H7v8M7 3v5h8" />',
|
|
128
|
+
rotate: '<path d="M3 12a9 9 0 1 0 3-6.7L3 8" /><path d="M3 3v5h5" />',
|
|
129
|
+
qr: '<rect x="3" y="3" width="7" height="7" /><rect x="14" y="3" width="7" height="7" /><rect x="3" y="14" width="7" height="7" /><path d="M14 14h3v3h-3zM18 18h3v3h-3z" />',
|
|
130
|
+
globe: '<circle cx="12" cy="12" r="9" /><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18" />',
|
|
131
|
+
phone: '<path d="M5 4h4l2 5-2 1a11 11 0 0 0 5 5l1-2 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2z" />',
|
|
132
|
+
bin: '<rect x="3" y="6" width="18" height="14" rx="2" /><path d="M7 6V4h10v2" />',
|
|
133
|
+
pen: '<path d="M3 17V21h4l11-11-4-4z" />',
|
|
134
|
+
smile: '<circle cx="12" cy="12" r="9" /><path d="M9 9v.01M15 9v.01M8 14a5 5 0 0 0 8 0" />',
|
|
135
|
+
frown: '<circle cx="12" cy="12" r="9" /><path d="M9 9v.01M15 9v.01M8 16a5 5 0 0 1 8 0" />',
|
|
136
|
+
mail: '<rect x="3" y="5" width="18" height="14" rx="2" /><path d="m3 7 9 6 9-6" />',
|
|
137
|
+
'eye-off': '<path d="M3 3l18 18" /><path d="M10.6 6.1A10 10 0 0 1 12 6c6 0 10 7 10 7a14 14 0 0 1-2.4 3.1" /><path d="M6.7 6.7A14 14 0 0 0 2 12s4 7 10 7a10 10 0 0 0 4.5-1" /><path d="M9.9 14.1A3 3 0 0 1 9 12a3 3 0 0 1 3-3 3 3 0 0 1 2.1.9" />',
|
|
138
|
+
'check-circle': '<circle cx="12" cy="12" r="9" /><path d="m8 12 3 3 5-6" />',
|
|
139
|
+
// Drag handle: 6 dots in 2 cols × 3 rows. Use 1.6 radius to read at 12-16px.
|
|
140
|
+
drag: '<circle cx="9" cy="6" r="1.6" /><circle cx="15" cy="6" r="1.6" /><circle cx="9" cy="12" r="1.6" /><circle cx="15" cy="12" r="1.6" /><circle cx="9" cy="18" r="1.6" /><circle cx="15" cy="18" r="1.6" />',
|
|
141
|
+
scan: '<path d="M4 8V5a1 1 0 0 1 1-1h3M16 4h3a1 1 0 0 1 1 1v3M20 16v3a1 1 0 0 1-1 1h-3M8 20H5a1 1 0 0 1-1-1v-3" />',
|
|
142
|
+
wifi: '<path d="M2 9.5a15 15 0 0 1 20 0" /><path d="M5 13a10 10 0 0 1 14 0" /><path d="M8.5 16.5a5 5 0 0 1 7 0" /><path d="M12 20h.01" />',
|
|
143
|
+
'wifi-off': '<path d="m3 3 18 18" /><path d="M12 20h.01" /><path d="M8.5 16.5a5 5 0 0 1 7 0" /><path d="M5 13a10 10 0 0 1 3.5-2.3" /><path d="M11 8.6A10 10 0 0 1 19 13" /><path d="M2 9.5a15 15 0 0 1 5.7-3.2" /><path d="M11.6 5.6A15 15 0 0 1 22 9.5" />',
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
class IconComponent {
|
|
147
|
+
sanitizer = inject(DomSanitizer);
|
|
148
|
+
// Consumer-supplied icons via provideDsIcons(...). Empty record by default.
|
|
149
|
+
registry = inject(DS_ICON_REGISTRY);
|
|
150
|
+
name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
151
|
+
size = input(16, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
152
|
+
stroke = input(1.75, ...(ngDevMode ? [{ debugName: "stroke" }] : /* istanbul ignore next */ []));
|
|
153
|
+
/** When set, the icon is exposed to assistive tech as an image with this
|
|
154
|
+
* name; otherwise it is decorative and hidden (`aria-hidden`). */
|
|
155
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
156
|
+
paths = computed(() => {
|
|
157
|
+
const key = this.name();
|
|
158
|
+
// Built-in DS set wins over consumer registry — see provideDsIcons() docs.
|
|
159
|
+
const body = ICONS[key] ?? this.registry[key] ?? '';
|
|
160
|
+
return this.sanitizer.bypassSecurityTrustHtml(body);
|
|
161
|
+
}, ...(ngDevMode ? [{ debugName: "paths" }] : /* istanbul ignore next */ []));
|
|
162
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
163
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: IconComponent, isStandalone: true, selector: "ds-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, stroke: { classPropertyName: "stroke", publicName: "stroke", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
164
|
+
<svg
|
|
165
|
+
class="icon"
|
|
166
|
+
[style.--ds-icon-size]="size() + 'px'"
|
|
167
|
+
[attr.width]="size()"
|
|
168
|
+
[attr.height]="size()"
|
|
169
|
+
viewBox="0 0 24 24"
|
|
170
|
+
fill="none"
|
|
171
|
+
stroke="currentColor"
|
|
172
|
+
[attr.stroke-width]="stroke()"
|
|
173
|
+
stroke-linecap="round"
|
|
174
|
+
stroke-linejoin="round"
|
|
175
|
+
[attr.role]="ariaLabel() ? 'img' : null"
|
|
176
|
+
[attr.aria-label]="ariaLabel()"
|
|
177
|
+
[attr.aria-hidden]="ariaLabel() ? null : 'true'"
|
|
178
|
+
[innerHTML]="paths()"
|
|
179
|
+
></svg>
|
|
180
|
+
`, isInline: true, styles: ["ds-icon{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:0}ds-icon>svg.icon{display:block}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
181
|
+
}
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: IconComponent, decorators: [{
|
|
183
|
+
type: Component,
|
|
184
|
+
args: [{ selector: 'ds-icon', standalone: true, encapsulation: ViewEncapsulation.None, template: `
|
|
185
|
+
<svg
|
|
186
|
+
class="icon"
|
|
187
|
+
[style.--ds-icon-size]="size() + 'px'"
|
|
188
|
+
[attr.width]="size()"
|
|
189
|
+
[attr.height]="size()"
|
|
190
|
+
viewBox="0 0 24 24"
|
|
191
|
+
fill="none"
|
|
192
|
+
stroke="currentColor"
|
|
193
|
+
[attr.stroke-width]="stroke()"
|
|
194
|
+
stroke-linecap="round"
|
|
195
|
+
stroke-linejoin="round"
|
|
196
|
+
[attr.role]="ariaLabel() ? 'img' : null"
|
|
197
|
+
[attr.aria-label]="ariaLabel()"
|
|
198
|
+
[attr.aria-hidden]="ariaLabel() ? null : 'true'"
|
|
199
|
+
[innerHTML]="paths()"
|
|
200
|
+
></svg>
|
|
201
|
+
`, styles: ["ds-icon{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:0}ds-icon>svg.icon{display:block}\n"] }]
|
|
202
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], stroke: [{ type: i0.Input, args: [{ isSignal: true, alias: "stroke", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
203
|
+
|
|
204
|
+
class ButtonComponent {
|
|
205
|
+
variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
206
|
+
size = input('l', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
207
|
+
type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
208
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
209
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
210
|
+
/** Stretch the button to fill its container — the host becomes block-level
|
|
211
|
+
and 100% wide (the inner control is already full-width). Use for mobile
|
|
212
|
+
primary CTAs and full-bleed form submit buttons. */
|
|
213
|
+
fullWidth = input(false, { ...(ngDevMode ? { debugName: "fullWidth" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
214
|
+
/** Accessible name — forwarded to the inner <button> as aria-label. Use when
|
|
215
|
+
the visible label is absent or non-descriptive. */
|
|
216
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
217
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
218
|
+
trailingIcon = input(null, ...(ngDevMode ? [{ debugName: "trailingIcon" }] : /* istanbul ignore next */ []));
|
|
219
|
+
pressed = output();
|
|
220
|
+
classes = computed(() => {
|
|
221
|
+
const variant = this.variant();
|
|
222
|
+
const parts = [
|
|
223
|
+
'button',
|
|
224
|
+
variant === 'primary' ? '' : variant,
|
|
225
|
+
this.size(),
|
|
226
|
+
this.loading() ? 'loading' : '',
|
|
227
|
+
];
|
|
228
|
+
return parts.filter(Boolean).join(' ');
|
|
229
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
230
|
+
onClick(event) {
|
|
231
|
+
if (this.disabled() || this.loading())
|
|
232
|
+
return;
|
|
233
|
+
this.pressed.emit(event);
|
|
234
|
+
}
|
|
235
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
236
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: ButtonComponent, isStandalone: true, selector: "ds-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", 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 }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, trailingIcon: { classPropertyName: "trailingIcon", publicName: "trailingIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed" }, host: { properties: { "class.full-width": "fullWidth()" } }, ngImport: i0, template: "<button\r\n [class]=\"classes()\"\r\n [type]=\"type()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n [attr.aria-busy]=\"loading() ? 'true' : null\"\r\n [disabled]=\"disabled() || loading()\"\r\n (click)=\"onClick($event)\"\r\n>\r\n <span class=\"button-main\"\r\n >@if (icon(); as name) { <ds-icon [name]=\"name\" /> }<ng-content></ng-content\r\n >@if (trailingIcon(); as name) { <ds-icon [name]=\"name\" /> }</span\r\n ><span class=\"subtext-slot\"><ng-content select=\"[dsButtonSubtext]\"></ng-content></span>\r\n</button>\r\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex;width:fit-content}:host(.full-width){display:block;width:100%}.button{--_button-bg: var(--ds-button-bg, var(--primary));--_button-bg-hover: var(--ds-button-bg-hover, color-mix(in srgb, var(--_button-bg) 88%, black));--_button-bg-active: var(--ds-button-bg-active, color-mix(in srgb, var(--_button-bg) 76%, black));--_button-fg: var(--ds-button-fg, var(--primary-on));--_button-border: var(--ds-button-border, transparent);--_button-focus-shadow: var(--ds-button-focus-shadow, var(--focus-ring));--_button-pressed-shadow: var(--ds-button-pressed-shadow, 0 0 0 3px color-mix(in srgb, var(--_button-bg-active) 35%, transparent));--_button-radius: var(--ds-button-radius, var(--radius-md));--_button-bg-disabled: var(--ds-button-bg-disabled, var(--surface-disabled));--_button-fg-disabled: var(--ds-button-fg-disabled, var(--text-disabled));display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);font:var(--font-weight-extrabold) var(--font-size-m)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-wide);color:var(--_button-fg);background:var(--_button-bg);border:var(--border-width-default) solid var(--_button-border);border-radius:var(--_button-radius);padding:0 var(--space-5);height:var(--hit-cozy);width:100%;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;position:relative;transition:background var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.button:hover{background:var(--_button-bg-hover)}.button:active{background:var(--_button-bg-active);box-shadow:var(--_button-pressed-shadow)}.button:focus-visible{outline:none;box-shadow:var(--_button-focus-shadow);z-index:var(--btn-focus-z)}.button[disabled]{background:var(--_button-bg-disabled);color:var(--_button-fg-disabled);border-color:transparent;cursor:not-allowed;pointer-events:none}.button .icon{width:var(--icon-md);height:var(--icon-md);flex-shrink:0}.button .button-main{display:contents}.button .subtext-slot:empty{display:none}.button .subtext-slot{font:var(--font-weight-medium) var(--font-size-2xs)/var(--line-height-tight) var(--font-sans);letter-spacing:normal;text-align:center}.button:has(.subtext-slot:not(:empty)){flex-direction:column;gap:var(--space-1);height:auto;min-height:var(--hit-cozy);padding-block:var(--space-2);white-space:normal}.button:has(.subtext-slot:not(:empty)) .button-main{display:inline-flex;align-items:center;gap:var(--space-2)}.button:has(.subtext-slot:not(:empty)).l,.button:has(.subtext-slot:not(:empty)).lg{height:auto;min-height:var(--field-h-lg)}.button.l{font-size:var(--font-size-m);height:var(--hit-cozy);padding:0 var(--space-5)}.button.m{font-size:var(--font-size-s);height:var(--hit-min);padding:0 var(--space-4)}.button.m .icon{width:var(--icon-sm);height:var(--icon-sm)}.button.s{font-size:var(--font-size-xs);height:var(--hit-xs);padding:0 var(--space-3)}.button.s .icon{width:var(--icon-xs);height:var(--icon-xs)}.button.lg{font-size:var(--font-size-m);height:var(--field-h-lg);padding:0 var(--space-5)}.button.md{font-size:var(--font-size-m);height:var(--hit-cozy);padding:0 var(--space-5)}.button.sm{font-size:var(--font-size-s);height:var(--hit-min);padding:0 var(--space-4)}.button.sm .icon{width:var(--icon-sm);height:var(--icon-sm)}.button.secondary{--_button-bg: var(--ds-button-bg, var(--primary-muted));--_button-fg: var(--ds-button-fg, var(--primary-strong));--_button-bg-hover: var(--ds-button-bg-hover, var(--primary-muted-strong));--_button-bg-active: var(--ds-button-bg-active, var(--primary-muted-strong))}.button.tertiary{--_button-bg: var(--ds-button-bg, transparent);--_button-fg: var(--ds-button-fg, var(--primary-strong));--_button-bg-hover: var(--ds-button-bg-hover, var(--primary-subtle));--_button-bg-active: var(--ds-button-bg-active, var(--primary-muted))}.button.outline{--_button-bg: var(--ds-button-bg, var(--surface-default));--_button-fg: var(--ds-button-fg, var(--text-primary));--_button-border: var(--ds-button-border, var(--border-default));--_button-bg-hover: var(--ds-button-bg-hover, var(--surface-secondary));--_button-bg-active: var(--ds-button-bg-active, var(--surface-secondary))}.button.error{--_button-bg: var(--ds-button-bg, var(--error));--_button-focus-shadow: var(--ds-button-focus-shadow, var(--focus-ring-error))}.button.success{--_button-bg: var(--ds-button-bg, var(--success));--_button-fg: var(--ds-button-fg, var(--text-on-success))}.button.warning{--_button-bg: var(--ds-button-bg, var(--warning));--_button-fg: var(--ds-button-fg, var(--text-on-warning))}.button.text{--_button-bg: var(--ds-button-bg, transparent);--_button-fg: var(--ds-button-fg, var(--text-link));--_button-bg-hover: var(--ds-button-bg-hover, transparent);--_button-bg-active: var(--ds-button-bg-active, transparent);padding:0;height:auto;width:auto;text-decoration:underline;text-underline-offset:var(--btn-link-uloff)}.button.text:hover{color:var(--primary-pressed)}.button.loading{color:transparent!important;pointer-events:none;background:var(--_button-bg);border-color:var(--_button-border)}.button.loading:after{content:\"\";position:absolute;width:var(--spinner-md);height:var(--spinner-md);border:var(--border-width-strong) solid var(--_button-fg);border-right-color:transparent;border-radius:var(--radius-pill);animation:spin var(--duration-loop-fast) linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.button-group{display:inline-flex}.button-group .button{border-radius:var(--radius-flat)}.button-group .button:first-child{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.button-group .button:last-child{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.button-group .button+.button{margin-left:var(--btn-group-overlap)}.button-group .button:focus-visible{z-index:var(--btn-group-focus-z)}.button-split{display:inline-flex}.button-split>.button:first-child{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:var(--space-4)}.button-split>.button:last-child{border-top-left-radius:var(--radius-flat);border-bottom-left-radius:var(--radius-flat);border-left:var(--border-width-default) solid var(--btn-split-divider);padding:0 var(--space-3);width:auto}.button-toggle{display:inline-flex;align-items:center;gap:var(--space-2);height:var(--hit-min);padding:0 var(--space-3);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);background:var(--surface-default);color:var(--text-secondary);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);cursor:pointer}.button-toggle:hover{background:var(--surface-secondary);color:var(--text-primary)}.button-toggle[aria-pressed=true]{background:var(--primary-subtle);border-color:var(--primary);color:var(--primary-strong)}.button-toggle:focus-visible{outline:none;box-shadow:var(--focus-ring)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
237
|
+
}
|
|
238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
239
|
+
type: Component,
|
|
240
|
+
args: [{ selector: 'ds-button', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, host: { '[class.full-width]': 'fullWidth()' }, template: "<button\r\n [class]=\"classes()\"\r\n [type]=\"type()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n [attr.aria-busy]=\"loading() ? 'true' : null\"\r\n [disabled]=\"disabled() || loading()\"\r\n (click)=\"onClick($event)\"\r\n>\r\n <span class=\"button-main\"\r\n >@if (icon(); as name) { <ds-icon [name]=\"name\" /> }<ng-content></ng-content\r\n >@if (trailingIcon(); as name) { <ds-icon [name]=\"name\" /> }</span\r\n ><span class=\"subtext-slot\"><ng-content select=\"[dsButtonSubtext]\"></ng-content></span>\r\n</button>\r\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex;width:fit-content}:host(.full-width){display:block;width:100%}.button{--_button-bg: var(--ds-button-bg, var(--primary));--_button-bg-hover: var(--ds-button-bg-hover, color-mix(in srgb, var(--_button-bg) 88%, black));--_button-bg-active: var(--ds-button-bg-active, color-mix(in srgb, var(--_button-bg) 76%, black));--_button-fg: var(--ds-button-fg, var(--primary-on));--_button-border: var(--ds-button-border, transparent);--_button-focus-shadow: var(--ds-button-focus-shadow, var(--focus-ring));--_button-pressed-shadow: var(--ds-button-pressed-shadow, 0 0 0 3px color-mix(in srgb, var(--_button-bg-active) 35%, transparent));--_button-radius: var(--ds-button-radius, var(--radius-md));--_button-bg-disabled: var(--ds-button-bg-disabled, var(--surface-disabled));--_button-fg-disabled: var(--ds-button-fg-disabled, var(--text-disabled));display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);font:var(--font-weight-extrabold) var(--font-size-m)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-wide);color:var(--_button-fg);background:var(--_button-bg);border:var(--border-width-default) solid var(--_button-border);border-radius:var(--_button-radius);padding:0 var(--space-5);height:var(--hit-cozy);width:100%;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;position:relative;transition:background var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.button:hover{background:var(--_button-bg-hover)}.button:active{background:var(--_button-bg-active);box-shadow:var(--_button-pressed-shadow)}.button:focus-visible{outline:none;box-shadow:var(--_button-focus-shadow);z-index:var(--btn-focus-z)}.button[disabled]{background:var(--_button-bg-disabled);color:var(--_button-fg-disabled);border-color:transparent;cursor:not-allowed;pointer-events:none}.button .icon{width:var(--icon-md);height:var(--icon-md);flex-shrink:0}.button .button-main{display:contents}.button .subtext-slot:empty{display:none}.button .subtext-slot{font:var(--font-weight-medium) var(--font-size-2xs)/var(--line-height-tight) var(--font-sans);letter-spacing:normal;text-align:center}.button:has(.subtext-slot:not(:empty)){flex-direction:column;gap:var(--space-1);height:auto;min-height:var(--hit-cozy);padding-block:var(--space-2);white-space:normal}.button:has(.subtext-slot:not(:empty)) .button-main{display:inline-flex;align-items:center;gap:var(--space-2)}.button:has(.subtext-slot:not(:empty)).l,.button:has(.subtext-slot:not(:empty)).lg{height:auto;min-height:var(--field-h-lg)}.button.l{font-size:var(--font-size-m);height:var(--hit-cozy);padding:0 var(--space-5)}.button.m{font-size:var(--font-size-s);height:var(--hit-min);padding:0 var(--space-4)}.button.m .icon{width:var(--icon-sm);height:var(--icon-sm)}.button.s{font-size:var(--font-size-xs);height:var(--hit-xs);padding:0 var(--space-3)}.button.s .icon{width:var(--icon-xs);height:var(--icon-xs)}.button.lg{font-size:var(--font-size-m);height:var(--field-h-lg);padding:0 var(--space-5)}.button.md{font-size:var(--font-size-m);height:var(--hit-cozy);padding:0 var(--space-5)}.button.sm{font-size:var(--font-size-s);height:var(--hit-min);padding:0 var(--space-4)}.button.sm .icon{width:var(--icon-sm);height:var(--icon-sm)}.button.secondary{--_button-bg: var(--ds-button-bg, var(--primary-muted));--_button-fg: var(--ds-button-fg, var(--primary-strong));--_button-bg-hover: var(--ds-button-bg-hover, var(--primary-muted-strong));--_button-bg-active: var(--ds-button-bg-active, var(--primary-muted-strong))}.button.tertiary{--_button-bg: var(--ds-button-bg, transparent);--_button-fg: var(--ds-button-fg, var(--primary-strong));--_button-bg-hover: var(--ds-button-bg-hover, var(--primary-subtle));--_button-bg-active: var(--ds-button-bg-active, var(--primary-muted))}.button.outline{--_button-bg: var(--ds-button-bg, var(--surface-default));--_button-fg: var(--ds-button-fg, var(--text-primary));--_button-border: var(--ds-button-border, var(--border-default));--_button-bg-hover: var(--ds-button-bg-hover, var(--surface-secondary));--_button-bg-active: var(--ds-button-bg-active, var(--surface-secondary))}.button.error{--_button-bg: var(--ds-button-bg, var(--error));--_button-focus-shadow: var(--ds-button-focus-shadow, var(--focus-ring-error))}.button.success{--_button-bg: var(--ds-button-bg, var(--success));--_button-fg: var(--ds-button-fg, var(--text-on-success))}.button.warning{--_button-bg: var(--ds-button-bg, var(--warning));--_button-fg: var(--ds-button-fg, var(--text-on-warning))}.button.text{--_button-bg: var(--ds-button-bg, transparent);--_button-fg: var(--ds-button-fg, var(--text-link));--_button-bg-hover: var(--ds-button-bg-hover, transparent);--_button-bg-active: var(--ds-button-bg-active, transparent);padding:0;height:auto;width:auto;text-decoration:underline;text-underline-offset:var(--btn-link-uloff)}.button.text:hover{color:var(--primary-pressed)}.button.loading{color:transparent!important;pointer-events:none;background:var(--_button-bg);border-color:var(--_button-border)}.button.loading:after{content:\"\";position:absolute;width:var(--spinner-md);height:var(--spinner-md);border:var(--border-width-strong) solid var(--_button-fg);border-right-color:transparent;border-radius:var(--radius-pill);animation:spin var(--duration-loop-fast) linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.button-group{display:inline-flex}.button-group .button{border-radius:var(--radius-flat)}.button-group .button:first-child{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.button-group .button:last-child{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.button-group .button+.button{margin-left:var(--btn-group-overlap)}.button-group .button:focus-visible{z-index:var(--btn-group-focus-z)}.button-split{display:inline-flex}.button-split>.button:first-child{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:var(--space-4)}.button-split>.button:last-child{border-top-left-radius:var(--radius-flat);border-bottom-left-radius:var(--radius-flat);border-left:var(--border-width-default) solid var(--btn-split-divider);padding:0 var(--space-3);width:auto}.button-toggle{display:inline-flex;align-items:center;gap:var(--space-2);height:var(--hit-min);padding:0 var(--space-3);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);background:var(--surface-default);color:var(--text-secondary);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);cursor:pointer}.button-toggle:hover{background:var(--surface-secondary);color:var(--text-primary)}.button-toggle[aria-pressed=true]{background:var(--primary-subtle);border-color:var(--primary);color:var(--primary-strong)}.button-toggle:focus-visible{outline:none;box-shadow:var(--focus-ring)}\n"] }]
|
|
241
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], trailingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingIcon", required: false }] }], pressed: [{ type: i0.Output, args: ["pressed"] }] } });
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Icon-only action button with its own variant taxonomy (standard / filled /
|
|
245
|
+
* tonal / outlined) + an optional toggle (`selected`) state. Distinct from
|
|
246
|
+
* `ds-button` — use this for square/round icon affordances; use `ds-button`
|
|
247
|
+
* for labelled actions. `ariaLabel` is REQUIRED (icon-only has no text label).
|
|
248
|
+
*/
|
|
249
|
+
class IconButtonComponent {
|
|
250
|
+
icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
251
|
+
ariaLabel = input.required(...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
252
|
+
variant = input('standard', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
253
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
254
|
+
type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
255
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
256
|
+
/** Toggle state — renders the pressed/active look and sets aria-pressed. */
|
|
257
|
+
selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
258
|
+
pressed = output();
|
|
259
|
+
classes = computed(() => {
|
|
260
|
+
const parts = ['icon-button', this.variant(), this.size()];
|
|
261
|
+
if (this.selected())
|
|
262
|
+
parts.push('selected');
|
|
263
|
+
return parts.join(' ');
|
|
264
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
265
|
+
iconSize = computed(() => {
|
|
266
|
+
const size = this.size();
|
|
267
|
+
if (size === 'sm')
|
|
268
|
+
return 16;
|
|
269
|
+
if (size === 'lg')
|
|
270
|
+
return 24;
|
|
271
|
+
return 20;
|
|
272
|
+
}, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
273
|
+
onClick(event) {
|
|
274
|
+
if (this.disabled())
|
|
275
|
+
return;
|
|
276
|
+
this.pressed.emit(event);
|
|
277
|
+
}
|
|
278
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
279
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: IconButtonComponent, isStandalone: true, selector: "ds-icon-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed" }, ngImport: i0, template: "<button\r\n [class]=\"classes()\"\r\n [type]=\"type()\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n [attr.aria-pressed]=\"selected() ? true : null\"\r\n (click)=\"onClick($event)\"\r\n>\r\n <ds-icon [name]=\"icon()\" [size]=\"iconSize()\" />\r\n</button>\r\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex}.icon-button{--_icon-button-bg: var(--ds-icon-button-bg, transparent);--_icon-button-fg: var(--ds-icon-button-fg, var(--text-secondary));--_icon-button-border: var(--ds-icon-button-border, transparent);--_icon-button-bg-hover: var(--ds-icon-button-bg-hover, var(--surface-muted));--_icon-button-bg-active: var(--ds-icon-button-bg-active, var(--_icon-button-bg-hover));--_icon-button-fg-hover: var(--ds-icon-button-fg-hover, var(--text-primary));--_icon-button-focus-shadow: var(--ds-icon-button-focus-shadow, var(--focus-ring));--_icon-button-radius: var(--ds-icon-button-radius, var(--radius-md));display:inline-flex;align-items:center;justify-content:center;width:var(--hit-cozy);height:var(--hit-cozy);aspect-ratio:1;padding:0;border:var(--border-width-default) solid var(--_icon-button-border);border-radius:var(--_icon-button-radius);background:var(--_icon-button-bg);color:var(--_icon-button-fg);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.icon-button:hover{background:var(--_icon-button-bg-hover);color:var(--_icon-button-fg-hover)}.icon-button:active{background:var(--_icon-button-bg-active)}.icon-button:focus-visible{outline:none;box-shadow:var(--_icon-button-focus-shadow)}.icon-button[disabled]{color:var(--text-disabled);background:transparent;border-color:transparent;cursor:not-allowed;pointer-events:none}.icon-button.sm{width:var(--hit-min);height:var(--hit-min)}.icon-button.md{width:var(--hit-cozy);height:var(--hit-cozy)}.icon-button.lg{width:var(--field-h-lg);height:var(--field-h-lg)}.icon-button.filled{--_icon-button-bg: var(--ds-icon-button-bg, var(--primary));--_icon-button-fg: var(--ds-icon-button-fg, var(--primary-on));--_icon-button-bg-hover: var(--ds-icon-button-bg-hover, color-mix(in srgb, var(--_icon-button-bg) 88%, black));--_icon-button-bg-active: var(--ds-icon-button-bg-active, color-mix(in srgb, var(--_icon-button-bg) 76%, black));--_icon-button-fg-hover: var(--ds-icon-button-fg-hover, var(--_icon-button-fg))}.icon-button.tonal{--_icon-button-bg: var(--ds-icon-button-bg, var(--primary-muted));--_icon-button-fg: var(--ds-icon-button-fg, var(--primary-strong));--_icon-button-bg-hover: var(--ds-icon-button-bg-hover, var(--primary-subtle));--_icon-button-bg-active: var(--ds-icon-button-bg-active, var(--primary-muted-strong));--_icon-button-fg-hover: var(--ds-icon-button-fg-hover, var(--primary-strong))}.icon-button.outlined{--_icon-button-bg: var(--ds-icon-button-bg, var(--surface-default));--_icon-button-fg: var(--ds-icon-button-fg, var(--text-primary));--_icon-button-border: var(--ds-icon-button-border, var(--border-default));--_icon-button-bg-hover: var(--ds-icon-button-bg-hover, var(--surface-secondary));--_icon-button-bg-active: var(--ds-icon-button-bg-active, var(--surface-muted));--_icon-button-fg-hover: var(--ds-icon-button-fg-hover, var(--text-primary))}.icon-button.selected{--_icon-button-bg: var(--ds-icon-button-bg, var(--primary));--_icon-button-fg: var(--ds-icon-button-fg, var(--primary-on));--_icon-button-border: var(--ds-icon-button-border, transparent);--_icon-button-bg-hover: var(--ds-icon-button-bg-hover, color-mix(in srgb, var(--_icon-button-bg) 88%, black));--_icon-button-bg-active: var(--ds-icon-button-bg-active, color-mix(in srgb, var(--_icon-button-bg) 76%, black));--_icon-button-fg-hover: var(--ds-icon-button-fg-hover, var(--_icon-button-fg))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
280
|
+
}
|
|
281
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: IconButtonComponent, decorators: [{
|
|
282
|
+
type: Component,
|
|
283
|
+
args: [{ selector: 'ds-icon-button', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<button\r\n [class]=\"classes()\"\r\n [type]=\"type()\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n [attr.aria-pressed]=\"selected() ? true : null\"\r\n (click)=\"onClick($event)\"\r\n>\r\n <ds-icon [name]=\"icon()\" [size]=\"iconSize()\" />\r\n</button>\r\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex}.icon-button{--_icon-button-bg: var(--ds-icon-button-bg, transparent);--_icon-button-fg: var(--ds-icon-button-fg, var(--text-secondary));--_icon-button-border: var(--ds-icon-button-border, transparent);--_icon-button-bg-hover: var(--ds-icon-button-bg-hover, var(--surface-muted));--_icon-button-bg-active: var(--ds-icon-button-bg-active, var(--_icon-button-bg-hover));--_icon-button-fg-hover: var(--ds-icon-button-fg-hover, var(--text-primary));--_icon-button-focus-shadow: var(--ds-icon-button-focus-shadow, var(--focus-ring));--_icon-button-radius: var(--ds-icon-button-radius, var(--radius-md));display:inline-flex;align-items:center;justify-content:center;width:var(--hit-cozy);height:var(--hit-cozy);aspect-ratio:1;padding:0;border:var(--border-width-default) solid var(--_icon-button-border);border-radius:var(--_icon-button-radius);background:var(--_icon-button-bg);color:var(--_icon-button-fg);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.icon-button:hover{background:var(--_icon-button-bg-hover);color:var(--_icon-button-fg-hover)}.icon-button:active{background:var(--_icon-button-bg-active)}.icon-button:focus-visible{outline:none;box-shadow:var(--_icon-button-focus-shadow)}.icon-button[disabled]{color:var(--text-disabled);background:transparent;border-color:transparent;cursor:not-allowed;pointer-events:none}.icon-button.sm{width:var(--hit-min);height:var(--hit-min)}.icon-button.md{width:var(--hit-cozy);height:var(--hit-cozy)}.icon-button.lg{width:var(--field-h-lg);height:var(--field-h-lg)}.icon-button.filled{--_icon-button-bg: var(--ds-icon-button-bg, var(--primary));--_icon-button-fg: var(--ds-icon-button-fg, var(--primary-on));--_icon-button-bg-hover: var(--ds-icon-button-bg-hover, color-mix(in srgb, var(--_icon-button-bg) 88%, black));--_icon-button-bg-active: var(--ds-icon-button-bg-active, color-mix(in srgb, var(--_icon-button-bg) 76%, black));--_icon-button-fg-hover: var(--ds-icon-button-fg-hover, var(--_icon-button-fg))}.icon-button.tonal{--_icon-button-bg: var(--ds-icon-button-bg, var(--primary-muted));--_icon-button-fg: var(--ds-icon-button-fg, var(--primary-strong));--_icon-button-bg-hover: var(--ds-icon-button-bg-hover, var(--primary-subtle));--_icon-button-bg-active: var(--ds-icon-button-bg-active, var(--primary-muted-strong));--_icon-button-fg-hover: var(--ds-icon-button-fg-hover, var(--primary-strong))}.icon-button.outlined{--_icon-button-bg: var(--ds-icon-button-bg, var(--surface-default));--_icon-button-fg: var(--ds-icon-button-fg, var(--text-primary));--_icon-button-border: var(--ds-icon-button-border, var(--border-default));--_icon-button-bg-hover: var(--ds-icon-button-bg-hover, var(--surface-secondary));--_icon-button-bg-active: var(--ds-icon-button-bg-active, var(--surface-muted));--_icon-button-fg-hover: var(--ds-icon-button-fg-hover, var(--text-primary))}.icon-button.selected{--_icon-button-bg: var(--ds-icon-button-bg, var(--primary));--_icon-button-fg: var(--ds-icon-button-fg, var(--primary-on));--_icon-button-border: var(--ds-icon-button-border, transparent);--_icon-button-bg-hover: var(--ds-icon-button-bg-hover, color-mix(in srgb, var(--_icon-button-bg) 88%, black));--_icon-button-bg-active: var(--ds-icon-button-bg-active, color-mix(in srgb, var(--_icon-button-bg) 76%, black));--_icon-button-fg-hover: var(--ds-icon-button-fg-hover, var(--_icon-button-fg))}\n"] }]
|
|
284
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: true }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], pressed: [{ type: i0.Output, args: ["pressed"] }] } });
|
|
285
|
+
|
|
286
|
+
class BadgeComponent {
|
|
287
|
+
variant = input('neutral', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
288
|
+
withDot = input(false, ...(ngDevMode ? [{ debugName: "withDot" }] : /* istanbul ignore next */ []));
|
|
289
|
+
solid = input(false, ...(ngDevMode ? [{ debugName: "solid" }] : /* istanbul ignore next */ []));
|
|
290
|
+
classes = computed(() => {
|
|
291
|
+
const parts = [
|
|
292
|
+
'badge',
|
|
293
|
+
this.variant(),
|
|
294
|
+
this.solid() ? 'solid' : '',
|
|
295
|
+
];
|
|
296
|
+
return parts.filter(Boolean).join(' ');
|
|
297
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
298
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
299
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: BadgeComponent, isStandalone: true, selector: "ds-badge", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, withDot: { classPropertyName: "withDot", publicName: "withDot", isSignal: true, isRequired: false, transformFunction: null }, solid: { classPropertyName: "solid", publicName: "solid", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<span [class]=\"classes()\">\n @if (withDot()) {\n <span class=\"dot\"></span>\n }\n <ng-content></ng-content>\n</span>\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex}.badge{--_badge-bg: var(--ds-badge-bg, var(--surface-secondary));--_badge-fg: var(--ds-badge-fg, var(--text-secondary));--_badge-radius: var(--ds-badge-radius, var(--radius-pill));--_badge-pad-x: var(--ds-badge-pad-x, var(--badge-pad-x));--_badge-pad-y: var(--ds-badge-pad-y, var(--badge-pad-y));--_badge-font-weight: var(--ds-badge-font-weight, var(--font-weight-bold));display:inline-flex;align-items:center;gap:var(--badge-gap);padding:var(--_badge-pad-y) var(--_badge-pad-x);border-radius:var(--_badge-radius);font:var(--_badge-font-weight) var(--font-size-xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wide);white-space:nowrap;background:var(--_badge-bg);color:var(--_badge-fg)}.badge .dot{width:var(--badge-dot-size);height:var(--badge-dot-size);border-radius:var(--radius-pill);background:currentColor}.badge.planning{--_badge-bg: var(--ds-badge-bg, var(--status-planning-bg));--_badge-fg: var(--ds-badge-fg, var(--status-planning-fg))}.badge.confirmed{--_badge-bg: var(--ds-badge-bg, var(--status-confirmed-bg));--_badge-fg: var(--ds-badge-fg, var(--status-confirmed-fg))}.badge.active{--_badge-bg: var(--ds-badge-bg, var(--status-active-bg));--_badge-fg: var(--ds-badge-fg, var(--status-active-fg))}.badge.completed{--_badge-bg: var(--ds-badge-bg, var(--status-completed-bg));--_badge-fg: var(--ds-badge-fg, var(--status-completed-fg))}.badge.info{--_badge-bg: var(--ds-badge-bg, var(--info-subtle));--_badge-fg: var(--ds-badge-fg, var(--info-text))}.badge.success{--_badge-bg: var(--ds-badge-bg, var(--success-subtle));--_badge-fg: var(--ds-badge-fg, var(--success-text))}.badge.warning{--_badge-bg: var(--ds-badge-bg, var(--warning-subtle));--_badge-fg: var(--ds-badge-fg, var(--warning-text))}.badge.error{--_badge-bg: var(--ds-badge-bg, var(--error-subtle));--_badge-fg: var(--ds-badge-fg, var(--error-text))}.badge.neutral{--_badge-bg: var(--ds-badge-bg, var(--surface-secondary));--_badge-fg: var(--ds-badge-fg, var(--text-secondary))}.badge.secondary{--_badge-bg: var(--ds-badge-bg, var(--secondary-subtle));--_badge-fg: var(--ds-badge-fg, var(--secondary-strong))}.badge.solid{--_badge-bg: var(--ds-badge-bg, var(--primary));--_badge-fg: var(--ds-badge-fg, var(--primary-on))}.badge.count{min-width:var(--badge-count-size);height:var(--badge-count-size);padding:0 var(--space-1-5);display:inline-grid;place-items:center;font-size:var(--font-size-2xs)}\n"] });
|
|
300
|
+
}
|
|
301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
302
|
+
type: Component,
|
|
303
|
+
args: [{ selector: 'ds-badge', standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<span [class]=\"classes()\">\n @if (withDot()) {\n <span class=\"dot\"></span>\n }\n <ng-content></ng-content>\n</span>\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex}.badge{--_badge-bg: var(--ds-badge-bg, var(--surface-secondary));--_badge-fg: var(--ds-badge-fg, var(--text-secondary));--_badge-radius: var(--ds-badge-radius, var(--radius-pill));--_badge-pad-x: var(--ds-badge-pad-x, var(--badge-pad-x));--_badge-pad-y: var(--ds-badge-pad-y, var(--badge-pad-y));--_badge-font-weight: var(--ds-badge-font-weight, var(--font-weight-bold));display:inline-flex;align-items:center;gap:var(--badge-gap);padding:var(--_badge-pad-y) var(--_badge-pad-x);border-radius:var(--_badge-radius);font:var(--_badge-font-weight) var(--font-size-xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wide);white-space:nowrap;background:var(--_badge-bg);color:var(--_badge-fg)}.badge .dot{width:var(--badge-dot-size);height:var(--badge-dot-size);border-radius:var(--radius-pill);background:currentColor}.badge.planning{--_badge-bg: var(--ds-badge-bg, var(--status-planning-bg));--_badge-fg: var(--ds-badge-fg, var(--status-planning-fg))}.badge.confirmed{--_badge-bg: var(--ds-badge-bg, var(--status-confirmed-bg));--_badge-fg: var(--ds-badge-fg, var(--status-confirmed-fg))}.badge.active{--_badge-bg: var(--ds-badge-bg, var(--status-active-bg));--_badge-fg: var(--ds-badge-fg, var(--status-active-fg))}.badge.completed{--_badge-bg: var(--ds-badge-bg, var(--status-completed-bg));--_badge-fg: var(--ds-badge-fg, var(--status-completed-fg))}.badge.info{--_badge-bg: var(--ds-badge-bg, var(--info-subtle));--_badge-fg: var(--ds-badge-fg, var(--info-text))}.badge.success{--_badge-bg: var(--ds-badge-bg, var(--success-subtle));--_badge-fg: var(--ds-badge-fg, var(--success-text))}.badge.warning{--_badge-bg: var(--ds-badge-bg, var(--warning-subtle));--_badge-fg: var(--ds-badge-fg, var(--warning-text))}.badge.error{--_badge-bg: var(--ds-badge-bg, var(--error-subtle));--_badge-fg: var(--ds-badge-fg, var(--error-text))}.badge.neutral{--_badge-bg: var(--ds-badge-bg, var(--surface-secondary));--_badge-fg: var(--ds-badge-fg, var(--text-secondary))}.badge.secondary{--_badge-bg: var(--ds-badge-bg, var(--secondary-subtle));--_badge-fg: var(--ds-badge-fg, var(--secondary-strong))}.badge.solid{--_badge-bg: var(--ds-badge-bg, var(--primary));--_badge-fg: var(--ds-badge-fg, var(--primary-on))}.badge.count{min-width:var(--badge-count-size);height:var(--badge-count-size);padding:0 var(--space-1-5);display:inline-grid;place-items:center;font-size:var(--font-size-2xs)}\n"] }]
|
|
304
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], withDot: [{ type: i0.Input, args: [{ isSignal: true, alias: "withDot", required: false }] }], solid: [{ type: i0.Input, args: [{ isSignal: true, alias: "solid", required: false }] }] } });
|
|
305
|
+
|
|
306
|
+
class StatusDotComponent {
|
|
307
|
+
status = input('planning', ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
308
|
+
/** Override the colour-only status with a human label for assistive tech. */
|
|
309
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
310
|
+
classes = computed(() => `status-dot ${this.status()}`, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
311
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: StatusDotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
312
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: StatusDotComponent, isStandalone: true, selector: "ds-status-dot", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "img" }, properties: { "attr.aria-label": "ariaLabel() || status()" } }, ngImport: i0, template: `<span [class]="classes()" aria-hidden="true"></span>`, isInline: true, styles: ["@charset \"UTF-8\";:host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;height:1em}.status-dot{--_statusdot-color: var(--ds-statusdot-color, var(--icon-muted));--_statusdot-size: var(--ds-statusdot-size, var(--status-dot-size));display:block;width:var(--_statusdot-size);height:var(--_statusdot-size);border-radius:var(--radius-pill);flex-shrink:0;background:var(--_statusdot-color)}.status-dot.planning{--_statusdot-color: var(--ds-statusdot-color, var(--icon-muted))}.status-dot.confirmed{--_statusdot-color: var(--ds-statusdot-color, var(--primary))}.status-dot.active{--_statusdot-color: var(--ds-statusdot-color, var(--success))}.status-dot.completed{--_statusdot-color: var(--ds-statusdot-color, var(--icon-strong))}.status-dot.warning{--_statusdot-color: var(--ds-statusdot-color, var(--warning-hover))}.status-dot.error{--_statusdot-color: var(--ds-statusdot-color, var(--error))}.status-dot.secondary{--_statusdot-color: var(--ds-statusdot-color, var(--secondary))}\n"] });
|
|
313
|
+
}
|
|
314
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: StatusDotComponent, decorators: [{
|
|
315
|
+
type: Component,
|
|
316
|
+
args: [{ selector: 'ds-status-dot', standalone: true, template: `<span [class]="classes()" aria-hidden="true"></span>`, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
317
|
+
role: 'img',
|
|
318
|
+
'[attr.aria-label]': 'ariaLabel() || status()',
|
|
319
|
+
}, styles: ["@charset \"UTF-8\";:host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;height:1em}.status-dot{--_statusdot-color: var(--ds-statusdot-color, var(--icon-muted));--_statusdot-size: var(--ds-statusdot-size, var(--status-dot-size));display:block;width:var(--_statusdot-size);height:var(--_statusdot-size);border-radius:var(--radius-pill);flex-shrink:0;background:var(--_statusdot-color)}.status-dot.planning{--_statusdot-color: var(--ds-statusdot-color, var(--icon-muted))}.status-dot.confirmed{--_statusdot-color: var(--ds-statusdot-color, var(--primary))}.status-dot.active{--_statusdot-color: var(--ds-statusdot-color, var(--success))}.status-dot.completed{--_statusdot-color: var(--ds-statusdot-color, var(--icon-strong))}.status-dot.warning{--_statusdot-color: var(--ds-statusdot-color, var(--warning-hover))}.status-dot.error{--_statusdot-color: var(--ds-statusdot-color, var(--error))}.status-dot.secondary{--_statusdot-color: var(--ds-statusdot-color, var(--secondary))}\n"] }]
|
|
320
|
+
}], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
321
|
+
|
|
322
|
+
class AvatarComponent {
|
|
323
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
324
|
+
initials = input('', ...(ngDevMode ? [{ debugName: "initials" }] : /* istanbul ignore next */ []));
|
|
325
|
+
imageUrl = input(null, ...(ngDevMode ? [{ debugName: "imageUrl" }] : /* istanbul ignore next */ []));
|
|
326
|
+
/** Accessible name. When omitted, the avatar is treated as decorative
|
|
327
|
+
* (hidden from AT) — correct when a visible name sits beside it. */
|
|
328
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
329
|
+
/** Off-token color tint. Accepts a `{ bg, fg }` pair for arbitrary palettes,
|
|
330
|
+
* the literal `'neutral'` for the neutral overflow-chip treatment, or null
|
|
331
|
+
* for the default brand-subtle tones from avatar.scss. */
|
|
332
|
+
tint = input(null, ...(ngDevMode ? [{ debugName: "tint" }] : /* istanbul ignore next */ []));
|
|
333
|
+
tintStyle = computed(() => {
|
|
334
|
+
const value = this.tint();
|
|
335
|
+
if (value && value !== 'neutral')
|
|
336
|
+
return { bg: value.bg, fg: value.fg };
|
|
337
|
+
return { bg: null, fg: null };
|
|
338
|
+
}, ...(ngDevMode ? [{ debugName: "tintStyle" }] : /* istanbul ignore next */ []));
|
|
339
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
340
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: AvatarComponent, isStandalone: true, selector: "ds-avatar", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "initials", isSignal: true, isRequired: false, transformFunction: null }, imageUrl: { classPropertyName: "imageUrl", publicName: "imageUrl", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, tint: { classPropertyName: "tint", publicName: "tint", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.xs": "size() === 'xs'", "class.sm": "size() === 'sm'", "class.lg": "size() === 'lg'", "class.neutral": "tint() === 'neutral'", "style.--ds-avatar-bg": "tintStyle().bg", "style.--ds-avatar-fg": "tintStyle().fg", "attr.role": "ariaLabel() ? 'img' : null", "attr.aria-label": "ariaLabel()", "attr.aria-hidden": "ariaLabel() ? null : true" } }, ngImport: i0, template: "@if (imageUrl()) {\n <img [src]=\"imageUrl()\" alt=\"\" />\n} @else {\n {{ initials() }}\n}\n", styles: ["@charset \"UTF-8\";:host{--_avatar-size: var(--ds-avatar-size, var(--avatar-md));--_avatar-bg: var(--ds-avatar-bg, var(--primary-muted));--_avatar-fg: var(--ds-avatar-fg, var(--primary-strong));--_avatar-radius: var(--ds-avatar-radius, var(--radius-pill));--_avatar-ring-width: var(--ds-avatar-ring-width, var(--avatar-bw-group));display:inline-grid;place-items:center;width:var(--_avatar-size);height:var(--_avatar-size);border-radius:var(--_avatar-radius);background:var(--_avatar-bg);color:var(--_avatar-fg);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-wide);flex-shrink:0;overflow:hidden}img{width:100%;height:100%;object-fit:cover}:host(.xs){width:var(--avatar-xs);height:var(--avatar-xs);font-size:var(--font-size-4xs)}:host(.sm){width:var(--avatar-sm);height:var(--avatar-sm);font-size:var(--font-size-3xs)}:host(.lg){width:var(--avatar-lg);height:var(--avatar-lg);font-size:var(--font-size-s)}:host(.neutral){--_avatar-bg: var(--ds-avatar-bg, var(--surface-secondary));--_avatar-fg: var(--ds-avatar-fg, var(--text-secondary))}\n"] });
|
|
341
|
+
}
|
|
342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
343
|
+
type: Component,
|
|
344
|
+
args: [{ selector: 'ds-avatar', standalone: true, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
345
|
+
'[class.xs]': "size() === 'xs'",
|
|
346
|
+
'[class.sm]': "size() === 'sm'",
|
|
347
|
+
'[class.lg]': "size() === 'lg'",
|
|
348
|
+
'[class.neutral]': "tint() === 'neutral'",
|
|
349
|
+
'[style.--ds-avatar-bg]': 'tintStyle().bg',
|
|
350
|
+
'[style.--ds-avatar-fg]': 'tintStyle().fg',
|
|
351
|
+
'[attr.role]': "ariaLabel() ? 'img' : null",
|
|
352
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
353
|
+
'[attr.aria-hidden]': 'ariaLabel() ? null : true',
|
|
354
|
+
}, template: "@if (imageUrl()) {\n <img [src]=\"imageUrl()\" alt=\"\" />\n} @else {\n {{ initials() }}\n}\n", styles: ["@charset \"UTF-8\";:host{--_avatar-size: var(--ds-avatar-size, var(--avatar-md));--_avatar-bg: var(--ds-avatar-bg, var(--primary-muted));--_avatar-fg: var(--ds-avatar-fg, var(--primary-strong));--_avatar-radius: var(--ds-avatar-radius, var(--radius-pill));--_avatar-ring-width: var(--ds-avatar-ring-width, var(--avatar-bw-group));display:inline-grid;place-items:center;width:var(--_avatar-size);height:var(--_avatar-size);border-radius:var(--_avatar-radius);background:var(--_avatar-bg);color:var(--_avatar-fg);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-wide);flex-shrink:0;overflow:hidden}img{width:100%;height:100%;object-fit:cover}:host(.xs){width:var(--avatar-xs);height:var(--avatar-xs);font-size:var(--font-size-4xs)}:host(.sm){width:var(--avatar-sm);height:var(--avatar-sm);font-size:var(--font-size-3xs)}:host(.lg){width:var(--avatar-lg);height:var(--avatar-lg);font-size:var(--font-size-s)}:host(.neutral){--_avatar-bg: var(--ds-avatar-bg, var(--surface-secondary));--_avatar-fg: var(--ds-avatar-fg, var(--text-secondary))}\n"] }]
|
|
355
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "initials", required: false }] }], imageUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUrl", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], tint: [{ type: i0.Input, args: [{ isSignal: true, alias: "tint", required: false }] }] } });
|
|
356
|
+
|
|
357
|
+
class AvatarGroupComponent {
|
|
358
|
+
max = input(4, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
359
|
+
total = input(null, ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
360
|
+
overflow = computed(() => {
|
|
361
|
+
const total = this.total();
|
|
362
|
+
const max = this.max();
|
|
363
|
+
if (total === null)
|
|
364
|
+
return null;
|
|
365
|
+
return total > max ? total - max : null;
|
|
366
|
+
}, ...(ngDevMode ? [{ debugName: "overflow" }] : /* istanbul ignore next */ []));
|
|
367
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: AvatarGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
368
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: AvatarGroupComponent, isStandalone: true, selector: "ds-avatar-group", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-content></ng-content>\n@if (overflow() !== null) {\n <span class=\"avatar-overflow\">+{{ overflow() }}</span>\n}\n", styles: ["@charset \"UTF-8\";:host{--_avatargroup-overlap: var(--ds-avatargroup-overlap, calc(-1 * var(--space-2)));--_avatargroup-ring: var(--ds-avatargroup-ring, var(--surface-default));display:inline-flex}:host ::ng-deep ds-avatar{border:var(--avatar-bw-group) solid var(--_avatargroup-ring);margin-left:var(--_avatargroup-overlap)}:host ::ng-deep ds-avatar:first-child{margin-left:0}.avatar-overflow{display:inline-grid;place-items:center;width:var(--avatar-md);height:var(--avatar-md);border-radius:var(--radius-pill);background:var(--primary-muted);color:var(--primary-strong);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-wide);flex-shrink:0;border:var(--avatar-bw-group) solid var(--_avatargroup-ring);margin-left:var(--_avatargroup-overlap)}\n"] });
|
|
369
|
+
}
|
|
370
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: AvatarGroupComponent, decorators: [{
|
|
371
|
+
type: Component,
|
|
372
|
+
args: [{ selector: 'ds-avatar-group', standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<ng-content></ng-content>\n@if (overflow() !== null) {\n <span class=\"avatar-overflow\">+{{ overflow() }}</span>\n}\n", styles: ["@charset \"UTF-8\";:host{--_avatargroup-overlap: var(--ds-avatargroup-overlap, calc(-1 * var(--space-2)));--_avatargroup-ring: var(--ds-avatargroup-ring, var(--surface-default));display:inline-flex}:host ::ng-deep ds-avatar{border:var(--avatar-bw-group) solid var(--_avatargroup-ring);margin-left:var(--_avatargroup-overlap)}:host ::ng-deep ds-avatar:first-child{margin-left:0}.avatar-overflow{display:inline-grid;place-items:center;width:var(--avatar-md);height:var(--avatar-md);border-radius:var(--radius-pill);background:var(--primary-muted);color:var(--primary-strong);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-wide);flex-shrink:0;border:var(--avatar-bw-group) solid var(--_avatargroup-ring);margin-left:var(--_avatargroup-overlap)}\n"] }]
|
|
373
|
+
}], propDecorators: { max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }] } });
|
|
374
|
+
|
|
375
|
+
class CardComponent {
|
|
376
|
+
elevation = input('flat', ...(ngDevMode ? [{ debugName: "elevation" }] : /* istanbul ignore next */ []));
|
|
377
|
+
padding = input(null, ...(ngDevMode ? [{ debugName: "padding" }] : /* istanbul ignore next */ []));
|
|
378
|
+
pressed = output();
|
|
379
|
+
classes = computed(() => {
|
|
380
|
+
const pad = this.padding();
|
|
381
|
+
return `card ${this.elevation()}${pad ? ' padding-' + pad : ''}`;
|
|
382
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
383
|
+
onClick(event) {
|
|
384
|
+
if (this.elevation() === 'interactive') {
|
|
385
|
+
this.pressed.emit(event);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
389
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: CardComponent, isStandalone: true, selector: "ds-card", inputs: { elevation: { classPropertyName: "elevation", publicName: "elevation", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed" }, ngImport: i0, template: "<article [class]=\"classes()\" (click)=\"onClick($event)\">\n <ng-content></ng-content>\n</article>\n", styles: ["@charset \"UTF-8\";:host{display:block;--_card-bg: var(--ds-card-bg, var(--surface-default));--_card-border: var(--ds-card-border, var(--border-divider));--_card-radius: var(--ds-card-radius, var(--radius-lg));--_card-pad: var(--ds-card-pad, var(--ds-container-pad));--_card-shadow: var(--ds-card-shadow, none);--_card-shadow-hover: var(--ds-card-shadow-hover, var(--shadow-1));--_card-focus-shadow: var(--ds-card-focus-shadow, var(--focus-ring));--_card-hover-lift: var(--ds-card-hover-lift, var(--card-hover-lift))}.card{background:var(--_card-bg);border:var(--border-width-default) solid var(--_card-border);border-radius:var(--_card-radius);padding:var(--_card-pad);box-shadow:var(--_card-shadow);transition:box-shadow var(--duration-base) var(--ease-standard),transform var(--duration-base) var(--ease-standard)}.card.flat{box-shadow:none}.card.raised{box-shadow:var(--_card-shadow-hover);border-color:transparent}.card.hover:hover{box-shadow:var(--_card-shadow-hover);transform:translateY(calc(var(--_card-hover-lift) * -1))}.card.interactive{cursor:pointer}.card.interactive:focus-visible{outline:none;box-shadow:var(--_card-focus-shadow)}.card.padding-none{--_card-pad: var(--ds-card-pad, 0)}.card.padding-sm{--_card-pad: var(--ds-card-pad, var(--space-4))}.card.padding-md{--_card-pad: var(--ds-card-pad, var(--space-6))}.card.padding-lg{--_card-pad: var(--ds-card-pad, var(--space-8))}\n"] });
|
|
390
|
+
}
|
|
391
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: CardComponent, decorators: [{
|
|
392
|
+
type: Component,
|
|
393
|
+
args: [{ selector: 'ds-card', standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<article [class]=\"classes()\" (click)=\"onClick($event)\">\n <ng-content></ng-content>\n</article>\n", styles: ["@charset \"UTF-8\";:host{display:block;--_card-bg: var(--ds-card-bg, var(--surface-default));--_card-border: var(--ds-card-border, var(--border-divider));--_card-radius: var(--ds-card-radius, var(--radius-lg));--_card-pad: var(--ds-card-pad, var(--ds-container-pad));--_card-shadow: var(--ds-card-shadow, none);--_card-shadow-hover: var(--ds-card-shadow-hover, var(--shadow-1));--_card-focus-shadow: var(--ds-card-focus-shadow, var(--focus-ring));--_card-hover-lift: var(--ds-card-hover-lift, var(--card-hover-lift))}.card{background:var(--_card-bg);border:var(--border-width-default) solid var(--_card-border);border-radius:var(--_card-radius);padding:var(--_card-pad);box-shadow:var(--_card-shadow);transition:box-shadow var(--duration-base) var(--ease-standard),transform var(--duration-base) var(--ease-standard)}.card.flat{box-shadow:none}.card.raised{box-shadow:var(--_card-shadow-hover);border-color:transparent}.card.hover:hover{box-shadow:var(--_card-shadow-hover);transform:translateY(calc(var(--_card-hover-lift) * -1))}.card.interactive{cursor:pointer}.card.interactive:focus-visible{outline:none;box-shadow:var(--_card-focus-shadow)}.card.padding-none{--_card-pad: var(--ds-card-pad, 0)}.card.padding-sm{--_card-pad: var(--ds-card-pad, var(--space-4))}.card.padding-md{--_card-pad: var(--ds-card-pad, var(--space-6))}.card.padding-lg{--_card-pad: var(--ds-card-pad, var(--space-8))}\n"] }]
|
|
394
|
+
}], propDecorators: { elevation: [{ type: i0.Input, args: [{ isSignal: true, alias: "elevation", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], pressed: [{ type: i0.Output, args: ["pressed"] }] } });
|
|
395
|
+
|
|
396
|
+
class StatComponent {
|
|
397
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
398
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
399
|
+
delta = input(null, ...(ngDevMode ? [{ debugName: "delta" }] : /* istanbul ignore next */ []));
|
|
400
|
+
deltaLabel = input('', ...(ngDevMode ? [{ debugName: "deltaLabel" }] : /* istanbul ignore next */ []));
|
|
401
|
+
deltaTone = input(null, ...(ngDevMode ? [{ debugName: "deltaTone" }] : /* istanbul ignore next */ []));
|
|
402
|
+
caption = input('', ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
403
|
+
unit = input('', ...(ngDevMode ? [{ debugName: "unit" }] : /* istanbul ignore next */ []));
|
|
404
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
405
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
406
|
+
deltaClasses = computed(() => {
|
|
407
|
+
const delta = this.delta();
|
|
408
|
+
if (delta === null)
|
|
409
|
+
return '';
|
|
410
|
+
const tone = this.deltaTone();
|
|
411
|
+
if (tone)
|
|
412
|
+
return `delta ${tone}`;
|
|
413
|
+
if (delta > 0)
|
|
414
|
+
return 'delta up';
|
|
415
|
+
if (delta < 0)
|
|
416
|
+
return 'delta down';
|
|
417
|
+
return 'delta';
|
|
418
|
+
}, ...(ngDevMode ? [{ debugName: "deltaClasses" }] : /* istanbul ignore next */ []));
|
|
419
|
+
deltaIcon = computed(() => {
|
|
420
|
+
const delta = this.delta();
|
|
421
|
+
if (delta === null || delta === 0)
|
|
422
|
+
return null;
|
|
423
|
+
return delta > 0 ? 'arrowUp' : 'arrowDown';
|
|
424
|
+
}, ...(ngDevMode ? [{ debugName: "deltaIcon" }] : /* istanbul ignore next */ []));
|
|
425
|
+
deltaText = computed(() => {
|
|
426
|
+
const delta = this.delta();
|
|
427
|
+
if (delta === null)
|
|
428
|
+
return '';
|
|
429
|
+
const magnitude = Math.abs(delta);
|
|
430
|
+
const suffix = this.deltaLabel() ? ` ${this.deltaLabel()}` : '';
|
|
431
|
+
return `${magnitude}${suffix}`;
|
|
432
|
+
}, ...(ngDevMode ? [{ debugName: "deltaText" }] : /* istanbul ignore next */ []));
|
|
433
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: StatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
434
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: StatComponent, isStandalone: true, selector: "ds-stat", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, delta: { classPropertyName: "delta", publicName: "delta", isSignal: true, isRequired: false, transformFunction: null }, deltaLabel: { classPropertyName: "deltaLabel", publicName: "deltaLabel", isSignal: true, isRequired: false, transformFunction: null }, deltaTone: { classPropertyName: "deltaTone", publicName: "deltaTone", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.danger": "variant() === 'danger'", "class.size-sm": "size() === 'sm'", "class.size-lg": "size() === 'lg'" } }, ngImport: i0, template: "<div class=\"stat\">\n <div class=\"label\">{{ label() }}</div>\n <div class=\"value\">{{ value() }}{{ unit() }}</div>\n @if (delta() !== null) {\n <div [class]=\"deltaClasses()\">\n @if (deltaIcon(); as icon) {\n <ds-icon [name]=\"icon\" [size]=\"12\"></ds-icon>\n }\n <ng-content select=\"[delta]\">{{ deltaText() }}</ng-content>\n </div>\n } @else if (caption()) {\n <div class=\"caption\">{{ caption() }}</div>\n }\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.danger) .value{color:var(--error-text)}:host(.size-sm) .stat .label{font-size:var(--font-size-2xs);letter-spacing:var(--letter-spacing-wide)}:host(.size-sm) .stat .value{font-size:var(--font-size-h4)}:host(.size-lg) .stat .label{font-size:var(--font-size-s)}:host(.size-lg) .stat .value{font-size:var(--font-size-h1)}.stat{--_stat-bg: var(--ds-stat-bg, var(--surface-default));--_stat-border: var(--ds-stat-border, var(--border-divider));--_stat-radius: var(--ds-stat-radius, var(--radius-lg));--_stat-pad: var(--ds-stat-pad, var(--ds-container-pad));--_stat-label-color: var(--ds-stat-label-color, var(--text-tertiary));--_stat-value-color: var(--ds-stat-value-color, var(--text-primary));--_stat-up-color: var(--ds-stat-up-color, var(--success-text));--_stat-down-color: var(--ds-stat-down-color, var(--error-text));background:var(--_stat-bg);border:var(--border-width-default) solid var(--_stat-border);border-radius:var(--_stat-radius);padding:var(--_stat-pad)}.stat .label{font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wider);text-transform:uppercase;color:var(--_stat-label-color);margin:0 0 var(--space-2)}.stat .value{font:var(--font-weight-extrabold) var(--font-size-h2)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-snug);color:var(--_stat-value-color);margin:0;white-space:nowrap}.stat .delta{display:inline-flex;align-items:center;gap:var(--space-1);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);margin-top:var(--space-2)}.stat .delta.up{color:var(--_stat-up-color)}.stat .delta.down{color:var(--_stat-down-color)}.stat .delta.neutral{color:var(--text-tertiary)}.stat .delta.secondary{color:var(--secondary-strong)}.stat .caption{font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary);margin-top:var(--space-2)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
435
|
+
}
|
|
436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: StatComponent, decorators: [{
|
|
437
|
+
type: Component,
|
|
438
|
+
args: [{ selector: 'ds-stat', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
439
|
+
'[class.danger]': "variant() === 'danger'",
|
|
440
|
+
'[class.size-sm]': "size() === 'sm'",
|
|
441
|
+
'[class.size-lg]': "size() === 'lg'",
|
|
442
|
+
}, template: "<div class=\"stat\">\n <div class=\"label\">{{ label() }}</div>\n <div class=\"value\">{{ value() }}{{ unit() }}</div>\n @if (delta() !== null) {\n <div [class]=\"deltaClasses()\">\n @if (deltaIcon(); as icon) {\n <ds-icon [name]=\"icon\" [size]=\"12\"></ds-icon>\n }\n <ng-content select=\"[delta]\">{{ deltaText() }}</ng-content>\n </div>\n } @else if (caption()) {\n <div class=\"caption\">{{ caption() }}</div>\n }\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.danger) .value{color:var(--error-text)}:host(.size-sm) .stat .label{font-size:var(--font-size-2xs);letter-spacing:var(--letter-spacing-wide)}:host(.size-sm) .stat .value{font-size:var(--font-size-h4)}:host(.size-lg) .stat .label{font-size:var(--font-size-s)}:host(.size-lg) .stat .value{font-size:var(--font-size-h1)}.stat{--_stat-bg: var(--ds-stat-bg, var(--surface-default));--_stat-border: var(--ds-stat-border, var(--border-divider));--_stat-radius: var(--ds-stat-radius, var(--radius-lg));--_stat-pad: var(--ds-stat-pad, var(--ds-container-pad));--_stat-label-color: var(--ds-stat-label-color, var(--text-tertiary));--_stat-value-color: var(--ds-stat-value-color, var(--text-primary));--_stat-up-color: var(--ds-stat-up-color, var(--success-text));--_stat-down-color: var(--ds-stat-down-color, var(--error-text));background:var(--_stat-bg);border:var(--border-width-default) solid var(--_stat-border);border-radius:var(--_stat-radius);padding:var(--_stat-pad)}.stat .label{font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wider);text-transform:uppercase;color:var(--_stat-label-color);margin:0 0 var(--space-2)}.stat .value{font:var(--font-weight-extrabold) var(--font-size-h2)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-snug);color:var(--_stat-value-color);margin:0;white-space:nowrap}.stat .delta{display:inline-flex;align-items:center;gap:var(--space-1);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);margin-top:var(--space-2)}.stat .delta.up{color:var(--_stat-up-color)}.stat .delta.down{color:var(--_stat-down-color)}.stat .delta.neutral{color:var(--text-tertiary)}.stat .delta.secondary{color:var(--secondary-strong)}.stat .caption{font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary);margin-top:var(--space-2)}\n"] }]
|
|
443
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], delta: [{ type: i0.Input, args: [{ isSignal: true, alias: "delta", required: false }] }], deltaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "deltaLabel", required: false }] }], deltaTone: [{ type: i0.Input, args: [{ isSignal: true, alias: "deltaTone", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
444
|
+
|
|
445
|
+
class TabComponent {
|
|
446
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
447
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
448
|
+
count = input(null, ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
449
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
450
|
+
content = viewChild.required('content');
|
|
451
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
452
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.14", type: TabComponent, isStandalone: true, selector: "ds-tab", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: `<ng-template #content><ng-content></ng-content></ng-template>`, isInline: true, styles: [":host{display:none}\n"] });
|
|
453
|
+
}
|
|
454
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TabComponent, decorators: [{
|
|
455
|
+
type: Component,
|
|
456
|
+
args: [{ selector: 'ds-tab', standalone: true, template: `<ng-template #content><ng-content></ng-content></ng-template>`, encapsulation: ViewEncapsulation.Emulated, styles: [":host{display:none}\n"] }]
|
|
457
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], content: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }] } });
|
|
458
|
+
|
|
459
|
+
let nextId$a = 0;
|
|
460
|
+
class TabsComponent {
|
|
461
|
+
selectedIndex = model(0, ...(ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []));
|
|
462
|
+
variant = input('line', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
463
|
+
host = inject((ElementRef));
|
|
464
|
+
uid = `ds-tabs-${++nextId$a}`;
|
|
465
|
+
tabs = contentChildren(TabComponent, ...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
466
|
+
tabId(index) {
|
|
467
|
+
return `${this.uid}-tab-${index}`;
|
|
468
|
+
}
|
|
469
|
+
panelId(index) {
|
|
470
|
+
return `${this.uid}-panel-${index}`;
|
|
471
|
+
}
|
|
472
|
+
tabsClasses = computed(() => this.variant() === 'pills' ? 'tabs pills' : 'tabs', ...(ngDevMode ? [{ debugName: "tabsClasses" }] : /* istanbul ignore next */ []));
|
|
473
|
+
selectedTemplate = computed(() => {
|
|
474
|
+
const idx = this.selectedIndex();
|
|
475
|
+
const list = this.tabs();
|
|
476
|
+
return list[idx]?.content() ?? null;
|
|
477
|
+
}, ...(ngDevMode ? [{ debugName: "selectedTemplate" }] : /* istanbul ignore next */ []));
|
|
478
|
+
tabClasses(index, disabled) {
|
|
479
|
+
const parts = ['tab'];
|
|
480
|
+
if (index === this.selectedIndex())
|
|
481
|
+
parts.push('active');
|
|
482
|
+
if (disabled)
|
|
483
|
+
parts.push('disabled');
|
|
484
|
+
return parts.join(' ');
|
|
485
|
+
}
|
|
486
|
+
select(index, disabled) {
|
|
487
|
+
if (disabled)
|
|
488
|
+
return;
|
|
489
|
+
this.selectedIndex.set(index);
|
|
490
|
+
}
|
|
491
|
+
/** Roving keyboard navigation across the tablist (APG automatic activation). */
|
|
492
|
+
onKeydown(event, index) {
|
|
493
|
+
const count = this.tabs().length;
|
|
494
|
+
if (!count)
|
|
495
|
+
return;
|
|
496
|
+
const forward = event.key === 'ArrowRight' || event.key === 'ArrowDown';
|
|
497
|
+
const backward = event.key === 'ArrowLeft' || event.key === 'ArrowUp';
|
|
498
|
+
let next;
|
|
499
|
+
if (forward)
|
|
500
|
+
next = (index + 1) % count;
|
|
501
|
+
else if (backward)
|
|
502
|
+
next = (index - 1 + count) % count;
|
|
503
|
+
else if (event.key === 'Home')
|
|
504
|
+
next = 0;
|
|
505
|
+
else if (event.key === 'End')
|
|
506
|
+
next = count - 1;
|
|
507
|
+
else
|
|
508
|
+
return;
|
|
509
|
+
event.preventDefault();
|
|
510
|
+
// Skip disabled tabs in the travel direction.
|
|
511
|
+
const step = backward || event.key === 'End' ? -1 : 1;
|
|
512
|
+
let guard = 0;
|
|
513
|
+
while (this.tabs()[next]?.disabled() && guard < count) {
|
|
514
|
+
next = (next + step + count) % count;
|
|
515
|
+
guard++;
|
|
516
|
+
}
|
|
517
|
+
this.select(next, this.tabs()[next]?.disabled() ?? false);
|
|
518
|
+
setTimeout(() => {
|
|
519
|
+
const el = this.host.nativeElement.querySelector(`#${this.tabId(next)}`);
|
|
520
|
+
el?.focus();
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
524
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: TabsComponent, isStandalone: true, selector: "ds-tabs", inputs: { selectedIndex: { classPropertyName: "selectedIndex", publicName: "selectedIndex", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIndex: "selectedIndexChange" }, queries: [{ propertyName: "tabs", predicate: TabComponent, isSignal: true }], ngImport: i0, template: "<div [class]=\"tabsClasses()\" role=\"tablist\">\r\n @for (tab of tabs(); track $index) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n [id]=\"tabId($index)\"\r\n [class]=\"tabClasses($index, tab.disabled())\"\r\n [attr.aria-selected]=\"$index === selectedIndex()\"\r\n [attr.aria-controls]=\"panelId($index)\"\r\n [attr.tabindex]=\"$index === selectedIndex() ? 0 : -1\"\r\n [disabled]=\"tab.disabled()\"\r\n (click)=\"select($index, tab.disabled())\"\r\n (keydown)=\"onKeydown($event, $index)\"\r\n >\r\n @if (tab.icon()) {\r\n <ds-icon [name]=\"tab.icon()!\" [size]=\"14\"></ds-icon>\r\n }\r\n <span>{{ tab.label() }}</span>\r\n @if (tab.count() !== null) {\r\n <span class=\"badge neutral count\">{{ tab.count() }}</span>\r\n }\r\n </button>\r\n }\r\n</div>\r\n<div\r\n class=\"panel\"\r\n role=\"tabpanel\"\r\n [id]=\"panelId(selectedIndex())\"\r\n [attr.aria-labelledby]=\"tabId(selectedIndex())\"\r\n tabindex=\"0\"\r\n>\r\n @if (selectedTemplate(); as tpl) {\r\n <ng-container *ngTemplateOutlet=\"tpl\"></ng-container>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.tabs{--_tabs-divider: var(--ds-tabs-divider, var(--border-divider));--_tab-pad-x: var(--ds-tab-pad-x, var(--space-4));--_tab-pad-y: var(--ds-tab-pad-y, var(--space-3));--_tab-fg: var(--ds-tab-fg, var(--text-secondary));--_tab-fg-hover: var(--ds-tab-fg-hover, var(--text-primary));--_tab-fg-active: var(--ds-tab-fg-active, var(--primary));--_tab-indicator-color: var(--ds-tab-indicator-color, var(--primary));--_tab-indicator-width: var(--ds-tab-indicator-width, var(--border-width-strong));--_tabs-pills-bg: var(--ds-tabs-pills-bg, var(--surface-secondary));--_tab-pill-bg-hover: var(--ds-tab-pill-bg-hover, var(--primary-subtle));--_tab-pill-bg-active: var(--ds-tab-pill-bg-active, var(--surface-default));--_tab-pill-bg-active-hover: var(--ds-tab-pill-bg-active-hover, var(--primary-subtle));--_tab-pill-fg-active: var(--ds-tab-pill-fg-active, var(--primary-strong));--_tab-pill-radius: var(--ds-tab-pill-radius, var(--radius-md));display:flex;gap:var(--space-2);border-bottom:var(--border-width-default) solid var(--_tabs-divider)}.tabs .tab{display:inline-flex;align-items:center;gap:var(--space-2);padding:var(--_tab-pad-y) var(--_tab-pad-x);border:0;background:transparent;font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_tab-fg);cursor:pointer;border-bottom:var(--_tab-indicator-width) solid transparent;margin-bottom:calc(-1 * var(--border-width-default));transition:color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.tabs .tab:hover{color:var(--_tab-fg-hover)}.tabs .tab.active{color:var(--_tab-fg-active);border-bottom-color:var(--_tab-indicator-color)}.tabs .tab .badge{min-width:var(--badge-count-size);height:var(--badge-count-size);padding:0 var(--space-1-5);display:inline-grid;place-items:center;border-radius:var(--radius-pill);font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wide);white-space:nowrap;background:var(--surface-secondary);color:var(--text-secondary);margin-left:var(--space-1)}.tabs .tab:focus-visible{outline:none;box-shadow:var(--focus-ring);border-radius:var(--radius-sm)}.tabs .tab[disabled],.tabs .tab.disabled{color:var(--text-disabled);cursor:not-allowed}.tabs.secondary .tab.active{--_tab-fg-active: var(--ds-tab-fg-active, var(--secondary-strong));--_tab-indicator-color: var(--ds-tab-indicator-color, var(--secondary))}.tabs.pills{border-bottom:0;gap:var(--space-1);padding:var(--space-1);background:var(--_tabs-pills-bg);border-radius:var(--_tab-pill-radius);display:inline-flex}.tabs.pills .tab{padding:var(--space-2) var(--space-3);border-bottom:0;margin-bottom:0;border-radius:var(--_tab-pill-radius);color:var(--_tab-fg)}.tabs.pills .tab:hover{background:var(--_tab-pill-bg-hover);color:var(--_tab-fg-hover)}.tabs.pills .tab.active{background:var(--_tab-pill-bg-active);color:var(--_tab-pill-fg-active);border-bottom:0;box-shadow:var(--shadow-1)}.tabs.pills .tab.active:hover{background:var(--_tab-pill-bg-active-hover)}.panel{padding-top:var(--space-3)}.panel:empty{display:none}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
525
|
+
}
|
|
526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TabsComponent, decorators: [{
|
|
527
|
+
type: Component,
|
|
528
|
+
args: [{ selector: 'ds-tabs', standalone: true, imports: [NgTemplateOutlet, IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<div [class]=\"tabsClasses()\" role=\"tablist\">\r\n @for (tab of tabs(); track $index) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n [id]=\"tabId($index)\"\r\n [class]=\"tabClasses($index, tab.disabled())\"\r\n [attr.aria-selected]=\"$index === selectedIndex()\"\r\n [attr.aria-controls]=\"panelId($index)\"\r\n [attr.tabindex]=\"$index === selectedIndex() ? 0 : -1\"\r\n [disabled]=\"tab.disabled()\"\r\n (click)=\"select($index, tab.disabled())\"\r\n (keydown)=\"onKeydown($event, $index)\"\r\n >\r\n @if (tab.icon()) {\r\n <ds-icon [name]=\"tab.icon()!\" [size]=\"14\"></ds-icon>\r\n }\r\n <span>{{ tab.label() }}</span>\r\n @if (tab.count() !== null) {\r\n <span class=\"badge neutral count\">{{ tab.count() }}</span>\r\n }\r\n </button>\r\n }\r\n</div>\r\n<div\r\n class=\"panel\"\r\n role=\"tabpanel\"\r\n [id]=\"panelId(selectedIndex())\"\r\n [attr.aria-labelledby]=\"tabId(selectedIndex())\"\r\n tabindex=\"0\"\r\n>\r\n @if (selectedTemplate(); as tpl) {\r\n <ng-container *ngTemplateOutlet=\"tpl\"></ng-container>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.tabs{--_tabs-divider: var(--ds-tabs-divider, var(--border-divider));--_tab-pad-x: var(--ds-tab-pad-x, var(--space-4));--_tab-pad-y: var(--ds-tab-pad-y, var(--space-3));--_tab-fg: var(--ds-tab-fg, var(--text-secondary));--_tab-fg-hover: var(--ds-tab-fg-hover, var(--text-primary));--_tab-fg-active: var(--ds-tab-fg-active, var(--primary));--_tab-indicator-color: var(--ds-tab-indicator-color, var(--primary));--_tab-indicator-width: var(--ds-tab-indicator-width, var(--border-width-strong));--_tabs-pills-bg: var(--ds-tabs-pills-bg, var(--surface-secondary));--_tab-pill-bg-hover: var(--ds-tab-pill-bg-hover, var(--primary-subtle));--_tab-pill-bg-active: var(--ds-tab-pill-bg-active, var(--surface-default));--_tab-pill-bg-active-hover: var(--ds-tab-pill-bg-active-hover, var(--primary-subtle));--_tab-pill-fg-active: var(--ds-tab-pill-fg-active, var(--primary-strong));--_tab-pill-radius: var(--ds-tab-pill-radius, var(--radius-md));display:flex;gap:var(--space-2);border-bottom:var(--border-width-default) solid var(--_tabs-divider)}.tabs .tab{display:inline-flex;align-items:center;gap:var(--space-2);padding:var(--_tab-pad-y) var(--_tab-pad-x);border:0;background:transparent;font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_tab-fg);cursor:pointer;border-bottom:var(--_tab-indicator-width) solid transparent;margin-bottom:calc(-1 * var(--border-width-default));transition:color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.tabs .tab:hover{color:var(--_tab-fg-hover)}.tabs .tab.active{color:var(--_tab-fg-active);border-bottom-color:var(--_tab-indicator-color)}.tabs .tab .badge{min-width:var(--badge-count-size);height:var(--badge-count-size);padding:0 var(--space-1-5);display:inline-grid;place-items:center;border-radius:var(--radius-pill);font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wide);white-space:nowrap;background:var(--surface-secondary);color:var(--text-secondary);margin-left:var(--space-1)}.tabs .tab:focus-visible{outline:none;box-shadow:var(--focus-ring);border-radius:var(--radius-sm)}.tabs .tab[disabled],.tabs .tab.disabled{color:var(--text-disabled);cursor:not-allowed}.tabs.secondary .tab.active{--_tab-fg-active: var(--ds-tab-fg-active, var(--secondary-strong));--_tab-indicator-color: var(--ds-tab-indicator-color, var(--secondary))}.tabs.pills{border-bottom:0;gap:var(--space-1);padding:var(--space-1);background:var(--_tabs-pills-bg);border-radius:var(--_tab-pill-radius);display:inline-flex}.tabs.pills .tab{padding:var(--space-2) var(--space-3);border-bottom:0;margin-bottom:0;border-radius:var(--_tab-pill-radius);color:var(--_tab-fg)}.tabs.pills .tab:hover{background:var(--_tab-pill-bg-hover);color:var(--_tab-fg-hover)}.tabs.pills .tab.active{background:var(--_tab-pill-bg-active);color:var(--_tab-pill-fg-active);border-bottom:0;box-shadow:var(--shadow-1)}.tabs.pills .tab.active:hover{background:var(--_tab-pill-bg-active-hover)}.panel{padding-top:var(--space-3)}.panel:empty{display:none}\n"] }]
|
|
529
|
+
}], propDecorators: { selectedIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIndex", required: false }] }, { type: i0.Output, args: ["selectedIndexChange"] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabComponent), { isSignal: true }] }] } });
|
|
530
|
+
|
|
531
|
+
/** Process-wide counter so each control gets a stable, unique id for
|
|
532
|
+
* label/hint association (no DOM dependency, SSR-safe). */
|
|
533
|
+
let nextId$9 = 0;
|
|
534
|
+
class InputComponent {
|
|
535
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
536
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
537
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
538
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
539
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
540
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
541
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
542
|
+
readOnly = input(false, { ...(ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
543
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
544
|
+
success = input(false, { ...(ngDevMode ? { debugName: "success" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
545
|
+
withAddon = input(false, { ...(ngDevMode ? { debugName: "withAddon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
546
|
+
withAddonRight = input(false, { ...(ngDevMode ? { debugName: "withAddonRight" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
547
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
548
|
+
optional = input(false, ...(ngDevMode ? [{ debugName: "optional" }] : /* istanbul ignore next */ []));
|
|
549
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
550
|
+
// Numeric constraints (applied when type="number").
|
|
551
|
+
min = input(null, ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
552
|
+
max = input(null, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
553
|
+
step = input(null, ...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
|
|
554
|
+
/** Native autocomplete token (e.g. "email", "current-password"). */
|
|
555
|
+
autocomplete = input(null, ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
556
|
+
autofocus = input(false, ...(ngDevMode ? [{ debugName: "autofocus" }] : /* istanbul ignore next */ []));
|
|
557
|
+
/** Accessible name when no visible `label` is provided (falls back to the
|
|
558
|
+
* placeholder so the control is never unnamed). */
|
|
559
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
560
|
+
/** Mobile keyboard hints — forwarded to the native input as attributes. */
|
|
561
|
+
enterKeyHint = input(null, ...(ngDevMode ? [{ debugName: "enterKeyHint" }] : /* istanbul ignore next */ []));
|
|
562
|
+
inputMode = input(null, ...(ngDevMode ? [{ debugName: "inputMode" }] : /* istanbul ignore next */ []));
|
|
563
|
+
/** Emits when the native input loses focus. */
|
|
564
|
+
blurred = output();
|
|
565
|
+
/**
|
|
566
|
+
* Show an inline clear (×) button when the input has a non-empty value.
|
|
567
|
+
* Mirrors the Material/PrimeNG pattern: explicit button (not native search
|
|
568
|
+
* cancel) so the affordance is consistent across browsers and styled with
|
|
569
|
+
* DS tokens. Defaults to true when type='search', false otherwise — pass
|
|
570
|
+
* an explicit boolean to override.
|
|
571
|
+
*/
|
|
572
|
+
clearable = input(null, ...(ngDevMode ? [{ debugName: "clearable" }] : /* istanbul ignore next */ []));
|
|
573
|
+
passwordToggle = input(false, { ...(ngDevMode ? { debugName: "passwordToggle" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
574
|
+
passwordVisible = model(false, ...(ngDevMode ? [{ debugName: "passwordVisible" }] : /* istanbul ignore next */ []));
|
|
575
|
+
canClear = computed(() => {
|
|
576
|
+
const explicit = this.clearable();
|
|
577
|
+
if (explicit !== null)
|
|
578
|
+
return explicit;
|
|
579
|
+
return this.type() === 'search';
|
|
580
|
+
}, ...(ngDevMode ? [{ debugName: "canClear" }] : /* istanbul ignore next */ []));
|
|
581
|
+
uid = `ds-input-${++nextId$9}`;
|
|
582
|
+
hintId = computed(() => (this.hint() ? `${this.uid}-hint` : null), ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
583
|
+
/** Only name via aria-label when there's no visible `<label for>`. */
|
|
584
|
+
resolvedAriaLabel = computed(() => this.label() ? null : this.ariaLabel() || this.placeholder() || null, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
585
|
+
showPasswordToggle = computed(() => this.passwordToggle() && this.type() === 'password' && !this.disabled(), ...(ngDevMode ? [{ debugName: "showPasswordToggle" }] : /* istanbul ignore next */ []));
|
|
586
|
+
effectiveType = computed(() => this.passwordToggle() && this.type() === 'password' && this.passwordVisible()
|
|
587
|
+
? 'text'
|
|
588
|
+
: this.type(), ...(ngDevMode ? [{ debugName: "effectiveType" }] : /* istanbul ignore next */ []));
|
|
589
|
+
togglePassword() {
|
|
590
|
+
this.passwordVisible.update((visible) => !visible);
|
|
591
|
+
}
|
|
592
|
+
wrapperClasses = computed(() => {
|
|
593
|
+
const parts = ['field'];
|
|
594
|
+
if (this.size() === 'sm')
|
|
595
|
+
parts.push('sm');
|
|
596
|
+
if (this.size() === 'lg')
|
|
597
|
+
parts.push('lg');
|
|
598
|
+
if (this.invalid())
|
|
599
|
+
parts.push('error');
|
|
600
|
+
else if (this.success())
|
|
601
|
+
parts.push('success');
|
|
602
|
+
if (this.disabled())
|
|
603
|
+
parts.push('disabled');
|
|
604
|
+
if (this.readOnly())
|
|
605
|
+
parts.push('read-only');
|
|
606
|
+
if (this.withAddon())
|
|
607
|
+
parts.push('with-addon');
|
|
608
|
+
if (this.withAddonRight())
|
|
609
|
+
parts.push('with-addon-right');
|
|
610
|
+
return parts.join(' ');
|
|
611
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClasses" }] : /* istanbul ignore next */ []));
|
|
612
|
+
clear() {
|
|
613
|
+
this.value.set('');
|
|
614
|
+
}
|
|
615
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
616
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: InputComponent, isStandalone: true, selector: "ds-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", 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 }, hint: { classPropertyName: "hint", publicName: "hint", 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 }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null }, withAddon: { classPropertyName: "withAddon", publicName: "withAddon", isSignal: true, isRequired: false, transformFunction: null }, withAddonRight: { classPropertyName: "withAddonRight", publicName: "withAddonRight", 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 }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, enterKeyHint: { classPropertyName: "enterKeyHint", publicName: "enterKeyHint", isSignal: true, isRequired: false, transformFunction: null }, inputMode: { classPropertyName: "inputMode", publicName: "inputMode", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, passwordToggle: { classPropertyName: "passwordToggle", publicName: "passwordToggle", isSignal: true, isRequired: false, transformFunction: null }, passwordVisible: { classPropertyName: "passwordVisible", publicName: "passwordVisible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", blurred: "blurred", passwordVisible: "passwordVisibleChange" }, ngImport: i0, template: "<div [class]=\"wrapperClasses()\">\r\n @if (label()) {\r\n <label class=\"label\" [attr.for]=\"uid\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"req\" aria-hidden=\"true\">*</span>\r\n } @else if (optional()) {\r\n <span class=\"optional-marker\" aria-hidden=\"true\">(optional)</span>\r\n }\r\n </label>\r\n }\r\n <div class=\"control\">\r\n <span class=\"addon-slot prefix\"><ng-content select=\"[dsInputPrefix]\"></ng-content></span>\r\n <input\r\n [id]=\"uid\"\r\n [type]=\"effectiveType()\"\r\n [(ngModel)]=\"value\"\r\n [attr.name]=\"name()\"\r\n [attr.min]=\"min()\"\r\n [attr.max]=\"max()\"\r\n [attr.step]=\"step()\"\r\n [attr.autocomplete]=\"autocomplete()\"\r\n [attr.autofocus]=\"autofocus() ? '' : null\"\r\n [attr.placeholder]=\"placeholder() || null\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n [attr.aria-describedby]=\"hintId()\"\r\n [attr.aria-required]=\"required() ? 'true' : null\"\r\n [attr.enterkeyhint]=\"enterKeyHint()\"\r\n [attr.inputmode]=\"inputMode()\"\r\n [disabled]=\"disabled()\"\r\n [readOnly]=\"readOnly()\"\r\n [required]=\"required()\"\r\n (blur)=\"blurred.emit()\"\r\n />\r\n @if (canClear() && value() && !disabled()) {\r\n <button type=\"button\" class=\"clear-btn\" (click)=\"clear()\" aria-label=\"Clear input\"></button>\r\n }\r\n @if (showPasswordToggle()) {\r\n <button\r\n type=\"button\"\r\n class=\"password-toggle\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"passwordVisible() ? 'Hide password' : 'Show password'\"\r\n (click)=\"togglePassword()\"\r\n >\r\n <ds-icon [name]=\"passwordVisible() ? 'eye-off' : 'eye'\" [size]=\"16\" />\r\n </button>\r\n }\r\n <span class=\"addon-slot suffix\"><ng-content select=\"[dsInputSuffix]\"></ng-content></span>\r\n </div>\r\n @if (hint()) {\r\n <span class=\"hint\" [id]=\"hintId()\" [attr.role]=\"invalid() ? 'alert' : null\">{{ hint() }}</span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{--_input-bg: var(--ds-input-bg, var(--surface-default));--_input-border: var(--ds-input-border, var(--border-default));--_input-border-hover: var(--ds-input-border-hover, var(--border-strong));--_input-border-focus: var(--ds-input-border-focus, var(--primary));--_input-fg: var(--ds-input-fg, var(--text-primary));--_input-placeholder: var(--ds-input-placeholder, var(--text-tertiary));--_input-radius: var(--ds-input-radius, var(--radius-md));--_input-pad-x: var(--ds-input-pad-x, var(--field-pad-x));--_input-pad-y: var(--ds-input-pad-y, var(--field-pad-y));--_input-focus-shadow: var(--ds-input-focus-shadow, var(--focus-field));--_input-border-error: var(--ds-input-border-error, var(--error));--_input-bg-error: var(--ds-input-bg-error, var(--error-subtle));--_input-border-success: var(--ds-input-border-success, var(--success));--_input-bg-disabled: var(--ds-input-bg-disabled, var(--surface-disabled));--_input-label-color: var(--ds-input-label-color, var(--text-secondary));--_input-label-fs: var(--ds-input-label-fs, var(--font-size-xs));--_input-label-fw: var(--ds-input-label-fw, var(--font-weight-bold));--_input-hint-color: var(--ds-input-hint-color, var(--text-tertiary));--_input-hint-fs: var(--ds-input-hint-fs, var(--font-size-xs));--_input-fs: var(--ds-input-fs, var(--font-size-s));display:block}.field{display:flex;flex-direction:column;gap:var(--space-1-5);width:100%}.field .label{font:var(--_input-label-fw) var(--_input-label-fs)/var(--line-height-base) var(--font-sans);color:var(--_input-label-color);display:flex;align-items:center;gap:var(--space-1)}.field .label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.field .label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.field .control{display:flex;align-items:center;gap:var(--space-2);background:var(--_input-bg);border:var(--border-width-default) solid var(--_input-border);border-radius:var(--_input-radius);padding:var(--_input-pad-y) var(--_input-pad-x);height:var(--hit-cozy);transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.field .control input{flex:1;min-width:0;appearance:none;-webkit-appearance:none;border:0;outline:0;background:transparent;font:var(--font-weight-regular) var(--_input-fs)/var(--line-height-base) var(--font-sans);color:var(--_input-fg)}.field .control input::placeholder{color:var(--_input-placeholder)}.field .control input[type=search]::-webkit-search-cancel-button,.field .control input[type=search]::-webkit-search-decoration{display:none;appearance:none;-webkit-appearance:none}.field .control .clear-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--icon-md);height:var(--icon-md);padding:0;border:0;background-color:var(--text-tertiary);cursor:pointer;flex-shrink:0;transition:background-color var(--duration-fast) var(--ease-standard);-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><path d='M18 6L6 18M6 6l12 12'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><path d='M18 6L6 18M6 6l12 12'/></svg>\") center/contain no-repeat}.field .control .clear-btn:hover{background-color:var(--text-primary)}.field .control .clear-btn:focus-visible{outline:none;box-shadow:var(--focus-ring);border-radius:var(--radius-sm)}.field .control .password-toggle{display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--text-tertiary);cursor:pointer;flex-shrink:0;transition:color var(--duration-fast) var(--ease-standard)}.field .control .password-toggle:hover{color:var(--text-primary)}.field .control .password-toggle:focus-visible{outline:none;box-shadow:var(--focus-ring);border-radius:var(--radius-sm)}.field .control:hover{border-color:var(--_input-border-hover)}.field .control:focus-within{border-color:var(--_input-border-focus);box-shadow:var(--_input-focus-shadow)}.field .hint{font:var(--font-weight-regular) var(--_input-hint-fs)/var(--line-height-base) var(--font-sans);color:var(--_input-hint-color);display:flex;align-items:center;gap:var(--space-1)}.field.disabled .control{background:var(--_input-bg-disabled);border-color:var(--border-disabled)}.field.disabled input{color:var(--text-disabled)}.field.read-only .control{background:var(--surface-secondary)}.field.read-only .control input{cursor:default}.field.error .control{background:var(--_input-bg-error);border-color:var(--_input-border-error)}.field.error .control:focus-within{box-shadow:var(--focus-field-error)}.field.error .hint{color:var(--error-text)}.field.success .control{border-color:var(--_input-border-success)}.field.success .hint{color:var(--success-text)}.field.sm .control{height:var(--hit-min);padding:0 var(--space-2)}.field.lg .control{height:var(--field-h-lg)}.field .addon-slot{display:inline-flex;align-items:center;align-self:stretch;color:var(--text-tertiary);flex-shrink:0}.field .addon-slot:empty{display:none}.field ::ng-deep .addon{display:inline-flex;align-items:center;padding:0 var(--space-3);margin:calc(var(--field-affix-overlap) * -1);background:var(--surface-secondary);color:var(--text-secondary);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);align-self:stretch;border-right:var(--border-width-default) solid var(--border-divider)}.field ::ng-deep .addon.right{border-right:0;border-left:var(--border-width-default) solid var(--border-divider)}.field.with-addon .control{padding-left:0}.field.with-addon-right .control{padding-right:0}.field.with-addon ::ng-deep .addon{border-top-left-radius:var(--_input-radius);border-bottom-left-radius:var(--_input-radius)}.field.with-addon-right ::ng-deep .addon.right{border-top-right-radius:var(--_input-radius);border-bottom-right-radius:var(--_input-radius)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
617
|
+
}
|
|
618
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: InputComponent, decorators: [{
|
|
619
|
+
type: Component,
|
|
620
|
+
args: [{ selector: 'ds-input', standalone: true, imports: [FormsModule, IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<div [class]=\"wrapperClasses()\">\r\n @if (label()) {\r\n <label class=\"label\" [attr.for]=\"uid\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"req\" aria-hidden=\"true\">*</span>\r\n } @else if (optional()) {\r\n <span class=\"optional-marker\" aria-hidden=\"true\">(optional)</span>\r\n }\r\n </label>\r\n }\r\n <div class=\"control\">\r\n <span class=\"addon-slot prefix\"><ng-content select=\"[dsInputPrefix]\"></ng-content></span>\r\n <input\r\n [id]=\"uid\"\r\n [type]=\"effectiveType()\"\r\n [(ngModel)]=\"value\"\r\n [attr.name]=\"name()\"\r\n [attr.min]=\"min()\"\r\n [attr.max]=\"max()\"\r\n [attr.step]=\"step()\"\r\n [attr.autocomplete]=\"autocomplete()\"\r\n [attr.autofocus]=\"autofocus() ? '' : null\"\r\n [attr.placeholder]=\"placeholder() || null\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n [attr.aria-describedby]=\"hintId()\"\r\n [attr.aria-required]=\"required() ? 'true' : null\"\r\n [attr.enterkeyhint]=\"enterKeyHint()\"\r\n [attr.inputmode]=\"inputMode()\"\r\n [disabled]=\"disabled()\"\r\n [readOnly]=\"readOnly()\"\r\n [required]=\"required()\"\r\n (blur)=\"blurred.emit()\"\r\n />\r\n @if (canClear() && value() && !disabled()) {\r\n <button type=\"button\" class=\"clear-btn\" (click)=\"clear()\" aria-label=\"Clear input\"></button>\r\n }\r\n @if (showPasswordToggle()) {\r\n <button\r\n type=\"button\"\r\n class=\"password-toggle\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"passwordVisible() ? 'Hide password' : 'Show password'\"\r\n (click)=\"togglePassword()\"\r\n >\r\n <ds-icon [name]=\"passwordVisible() ? 'eye-off' : 'eye'\" [size]=\"16\" />\r\n </button>\r\n }\r\n <span class=\"addon-slot suffix\"><ng-content select=\"[dsInputSuffix]\"></ng-content></span>\r\n </div>\r\n @if (hint()) {\r\n <span class=\"hint\" [id]=\"hintId()\" [attr.role]=\"invalid() ? 'alert' : null\">{{ hint() }}</span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{--_input-bg: var(--ds-input-bg, var(--surface-default));--_input-border: var(--ds-input-border, var(--border-default));--_input-border-hover: var(--ds-input-border-hover, var(--border-strong));--_input-border-focus: var(--ds-input-border-focus, var(--primary));--_input-fg: var(--ds-input-fg, var(--text-primary));--_input-placeholder: var(--ds-input-placeholder, var(--text-tertiary));--_input-radius: var(--ds-input-radius, var(--radius-md));--_input-pad-x: var(--ds-input-pad-x, var(--field-pad-x));--_input-pad-y: var(--ds-input-pad-y, var(--field-pad-y));--_input-focus-shadow: var(--ds-input-focus-shadow, var(--focus-field));--_input-border-error: var(--ds-input-border-error, var(--error));--_input-bg-error: var(--ds-input-bg-error, var(--error-subtle));--_input-border-success: var(--ds-input-border-success, var(--success));--_input-bg-disabled: var(--ds-input-bg-disabled, var(--surface-disabled));--_input-label-color: var(--ds-input-label-color, var(--text-secondary));--_input-label-fs: var(--ds-input-label-fs, var(--font-size-xs));--_input-label-fw: var(--ds-input-label-fw, var(--font-weight-bold));--_input-hint-color: var(--ds-input-hint-color, var(--text-tertiary));--_input-hint-fs: var(--ds-input-hint-fs, var(--font-size-xs));--_input-fs: var(--ds-input-fs, var(--font-size-s));display:block}.field{display:flex;flex-direction:column;gap:var(--space-1-5);width:100%}.field .label{font:var(--_input-label-fw) var(--_input-label-fs)/var(--line-height-base) var(--font-sans);color:var(--_input-label-color);display:flex;align-items:center;gap:var(--space-1)}.field .label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.field .label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.field .control{display:flex;align-items:center;gap:var(--space-2);background:var(--_input-bg);border:var(--border-width-default) solid var(--_input-border);border-radius:var(--_input-radius);padding:var(--_input-pad-y) var(--_input-pad-x);height:var(--hit-cozy);transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.field .control input{flex:1;min-width:0;appearance:none;-webkit-appearance:none;border:0;outline:0;background:transparent;font:var(--font-weight-regular) var(--_input-fs)/var(--line-height-base) var(--font-sans);color:var(--_input-fg)}.field .control input::placeholder{color:var(--_input-placeholder)}.field .control input[type=search]::-webkit-search-cancel-button,.field .control input[type=search]::-webkit-search-decoration{display:none;appearance:none;-webkit-appearance:none}.field .control .clear-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--icon-md);height:var(--icon-md);padding:0;border:0;background-color:var(--text-tertiary);cursor:pointer;flex-shrink:0;transition:background-color var(--duration-fast) var(--ease-standard);-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><path d='M18 6L6 18M6 6l12 12'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><path d='M18 6L6 18M6 6l12 12'/></svg>\") center/contain no-repeat}.field .control .clear-btn:hover{background-color:var(--text-primary)}.field .control .clear-btn:focus-visible{outline:none;box-shadow:var(--focus-ring);border-radius:var(--radius-sm)}.field .control .password-toggle{display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--text-tertiary);cursor:pointer;flex-shrink:0;transition:color var(--duration-fast) var(--ease-standard)}.field .control .password-toggle:hover{color:var(--text-primary)}.field .control .password-toggle:focus-visible{outline:none;box-shadow:var(--focus-ring);border-radius:var(--radius-sm)}.field .control:hover{border-color:var(--_input-border-hover)}.field .control:focus-within{border-color:var(--_input-border-focus);box-shadow:var(--_input-focus-shadow)}.field .hint{font:var(--font-weight-regular) var(--_input-hint-fs)/var(--line-height-base) var(--font-sans);color:var(--_input-hint-color);display:flex;align-items:center;gap:var(--space-1)}.field.disabled .control{background:var(--_input-bg-disabled);border-color:var(--border-disabled)}.field.disabled input{color:var(--text-disabled)}.field.read-only .control{background:var(--surface-secondary)}.field.read-only .control input{cursor:default}.field.error .control{background:var(--_input-bg-error);border-color:var(--_input-border-error)}.field.error .control:focus-within{box-shadow:var(--focus-field-error)}.field.error .hint{color:var(--error-text)}.field.success .control{border-color:var(--_input-border-success)}.field.success .hint{color:var(--success-text)}.field.sm .control{height:var(--hit-min);padding:0 var(--space-2)}.field.lg .control{height:var(--field-h-lg)}.field .addon-slot{display:inline-flex;align-items:center;align-self:stretch;color:var(--text-tertiary);flex-shrink:0}.field .addon-slot:empty{display:none}.field ::ng-deep .addon{display:inline-flex;align-items:center;padding:0 var(--space-3);margin:calc(var(--field-affix-overlap) * -1);background:var(--surface-secondary);color:var(--text-secondary);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);align-self:stretch;border-right:var(--border-width-default) solid var(--border-divider)}.field ::ng-deep .addon.right{border-right:0;border-left:var(--border-width-default) solid var(--border-divider)}.field.with-addon .control{padding-left:0}.field.with-addon-right .control{padding-right:0}.field.with-addon ::ng-deep .addon{border-top-left-radius:var(--_input-radius);border-bottom-left-radius:var(--_input-radius)}.field.with-addon-right ::ng-deep .addon.right{border-top-right-radius:var(--_input-radius);border-bottom-right-radius:var(--_input-radius)}\n"] }]
|
|
621
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], withAddon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withAddon", required: false }] }], withAddonRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "withAddonRight", 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 }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], enterKeyHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "enterKeyHint", required: false }] }], inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputMode", required: false }] }], blurred: [{ type: i0.Output, args: ["blurred"] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], passwordToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "passwordToggle", required: false }] }], passwordVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "passwordVisible", required: false }] }, { type: i0.Output, args: ["passwordVisibleChange"] }] } });
|
|
622
|
+
|
|
623
|
+
class NumberStepperComponent {
|
|
624
|
+
value = model(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
625
|
+
min = input(0, ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
626
|
+
max = input(null, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
627
|
+
step = input(1, ...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
|
|
628
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
629
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
630
|
+
atMin = computed(() => this.value() <= this.min(), ...(ngDevMode ? [{ debugName: "atMin" }] : /* istanbul ignore next */ []));
|
|
631
|
+
atMax = computed(() => {
|
|
632
|
+
const max = this.max();
|
|
633
|
+
return max != null && this.value() >= max;
|
|
634
|
+
}, ...(ngDevMode ? [{ debugName: "atMax" }] : /* istanbul ignore next */ []));
|
|
635
|
+
stepperClass = computed(() => {
|
|
636
|
+
const parts = ['stepper', `size-${this.size()}`];
|
|
637
|
+
if (this.disabled())
|
|
638
|
+
parts.push('disabled');
|
|
639
|
+
return parts.join(' ');
|
|
640
|
+
}, ...(ngDevMode ? [{ debugName: "stepperClass" }] : /* istanbul ignore next */ []));
|
|
641
|
+
inc() {
|
|
642
|
+
if (this.atMax() || this.disabled())
|
|
643
|
+
return;
|
|
644
|
+
this.value.set(this.value() + this.step());
|
|
645
|
+
}
|
|
646
|
+
dec() {
|
|
647
|
+
if (this.atMin() || this.disabled())
|
|
648
|
+
return;
|
|
649
|
+
this.value.set(this.value() - this.step());
|
|
650
|
+
}
|
|
651
|
+
setRaw(raw) {
|
|
652
|
+
const parsed = Number.parseInt(raw, 10);
|
|
653
|
+
const number = Number.isNaN(parsed) ? 0 : parsed;
|
|
654
|
+
let clamped = Math.max(this.min(), number);
|
|
655
|
+
const max = this.max();
|
|
656
|
+
if (max != null)
|
|
657
|
+
clamped = Math.min(max, clamped);
|
|
658
|
+
this.value.set(clamped);
|
|
659
|
+
}
|
|
660
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NumberStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
661
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: NumberStepperComponent, isStandalone: true, selector: "ds-number-stepper", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<div [class]=\"stepperClass()\">\r\n <button\r\n type=\"button\"\r\n class=\"step minus\"\r\n (click)=\"dec()\"\r\n [disabled]=\"atMin() || disabled()\"\r\n >\u2212</button>\r\n <input\r\n type=\"number\"\r\n class=\"qty\"\r\n [min]=\"min()\"\r\n [max]=\"max() ?? undefined\"\r\n [value]=\"value()\"\r\n [disabled]=\"disabled()\"\r\n (input)=\"setRaw($any($event.target).value)\"\r\n />\r\n <button\r\n type=\"button\"\r\n class=\"step plus\"\r\n (click)=\"inc()\"\r\n [disabled]=\"atMax() || disabled()\"\r\n >+</button>\r\n</div>\r\n", styles: [":host{display:inline-flex}.stepper{display:flex;align-items:stretch;background:var(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);overflow:hidden}.stepper:focus-within{border-color:var(--primary);box-shadow:var(--focus-field)}.stepper.size-sm{height:var(--hit-min)}.stepper.size-sm .step{width:var(--hit-min)}.stepper.size-sm .qty{width:calc(var(--hit-min) * 1.25)}.stepper.size-md{height:var(--hit-cozy)}.stepper.size-md .step{width:var(--hit-cozy)}.stepper.size-md .qty{width:calc(var(--hit-cozy) * 1.25)}.stepper.size-lg{height:var(--hit-comfy)}.stepper.size-lg .step{width:var(--hit-comfy)}.stepper.size-lg .qty{width:calc(var(--hit-comfy) * 1.25)}.stepper.disabled{background:var(--surface-disabled);border-color:var(--border-disabled)}.stepper.disabled:focus-within{border-color:var(--border-disabled);box-shadow:none}.step{flex-shrink:0;border:0;background:transparent;color:var(--text-primary);font-size:var(--font-size-l);font-weight:var(--font-weight-bold);line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;transition:background var(--duration-fast) var(--ease-standard)}.step:hover:not(:disabled){background:var(--surface-secondary)}.step:active:not(:disabled){background:var(--primary-muted)}.step:disabled{color:var(--text-disabled);cursor:not-allowed}.step.minus{border-right:var(--border-width-default) solid var(--border-default)}.step.plus{border-left:var(--border-width-default) solid var(--border-default)}.qty{flex:1;min-width:0;border:0;background:transparent;text-align:center;font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary);outline:0;padding:0;-moz-appearance:textfield}.qty:disabled{color:var(--text-disabled)}.qty::-webkit-outer-spin-button,.qty::-webkit-inner-spin-button{appearance:none;margin:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
662
|
+
}
|
|
663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NumberStepperComponent, decorators: [{
|
|
664
|
+
type: Component,
|
|
665
|
+
args: [{ selector: 'ds-number-stepper', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"stepperClass()\">\r\n <button\r\n type=\"button\"\r\n class=\"step minus\"\r\n (click)=\"dec()\"\r\n [disabled]=\"atMin() || disabled()\"\r\n >\u2212</button>\r\n <input\r\n type=\"number\"\r\n class=\"qty\"\r\n [min]=\"min()\"\r\n [max]=\"max() ?? undefined\"\r\n [value]=\"value()\"\r\n [disabled]=\"disabled()\"\r\n (input)=\"setRaw($any($event.target).value)\"\r\n />\r\n <button\r\n type=\"button\"\r\n class=\"step plus\"\r\n (click)=\"inc()\"\r\n [disabled]=\"atMax() || disabled()\"\r\n >+</button>\r\n</div>\r\n", styles: [":host{display:inline-flex}.stepper{display:flex;align-items:stretch;background:var(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);overflow:hidden}.stepper:focus-within{border-color:var(--primary);box-shadow:var(--focus-field)}.stepper.size-sm{height:var(--hit-min)}.stepper.size-sm .step{width:var(--hit-min)}.stepper.size-sm .qty{width:calc(var(--hit-min) * 1.25)}.stepper.size-md{height:var(--hit-cozy)}.stepper.size-md .step{width:var(--hit-cozy)}.stepper.size-md .qty{width:calc(var(--hit-cozy) * 1.25)}.stepper.size-lg{height:var(--hit-comfy)}.stepper.size-lg .step{width:var(--hit-comfy)}.stepper.size-lg .qty{width:calc(var(--hit-comfy) * 1.25)}.stepper.disabled{background:var(--surface-disabled);border-color:var(--border-disabled)}.stepper.disabled:focus-within{border-color:var(--border-disabled);box-shadow:none}.step{flex-shrink:0;border:0;background:transparent;color:var(--text-primary);font-size:var(--font-size-l);font-weight:var(--font-weight-bold);line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;transition:background var(--duration-fast) var(--ease-standard)}.step:hover:not(:disabled){background:var(--surface-secondary)}.step:active:not(:disabled){background:var(--primary-muted)}.step:disabled{color:var(--text-disabled);cursor:not-allowed}.step.minus{border-right:var(--border-width-default) solid var(--border-default)}.step.plus{border-left:var(--border-width-default) solid var(--border-default)}.qty{flex:1;min-width:0;border:0;background:transparent;text-align:center;font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary);outline:0;padding:0;-moz-appearance:textfield}.qty:disabled{color:var(--text-disabled)}.qty::-webkit-outer-spin-button,.qty::-webkit-inner-spin-button{appearance:none;margin:0}\n"] }]
|
|
666
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
667
|
+
|
|
668
|
+
let nextId$8 = 0;
|
|
669
|
+
class TextareaComponent {
|
|
670
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
671
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
672
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
673
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
674
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
675
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
676
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
677
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
678
|
+
optional = input(false, ...(ngDevMode ? [{ debugName: "optional" }] : /* istanbul ignore next */ []));
|
|
679
|
+
rows = input(3, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
680
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
681
|
+
autosize = input(false, { ...(ngDevMode ? { debugName: "autosize" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
682
|
+
minRows = input(null, ...(ngDevMode ? [{ debugName: "minRows" }] : /* istanbul ignore next */ []));
|
|
683
|
+
maxRows = input(null, ...(ngDevMode ? [{ debugName: "maxRows" }] : /* istanbul ignore next */ []));
|
|
684
|
+
resize = input('vertical', ...(ngDevMode ? [{ debugName: "resize" }] : /* istanbul ignore next */ []));
|
|
685
|
+
/** Accessible name when no visible `label` is provided. */
|
|
686
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
687
|
+
uid = `ds-textarea-${++nextId$8}`;
|
|
688
|
+
hintId = computed(() => (this.hint() ? `${this.uid}-hint` : null), ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
689
|
+
resolvedAriaLabel = computed(() => this.label() ? null : this.ariaLabel() || this.placeholder() || null, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
690
|
+
wrapperClasses = computed(() => {
|
|
691
|
+
const parts = ['field'];
|
|
692
|
+
if (this.size() === 'sm')
|
|
693
|
+
parts.push('sm');
|
|
694
|
+
if (this.size() === 'lg')
|
|
695
|
+
parts.push('lg');
|
|
696
|
+
if (this.invalid())
|
|
697
|
+
parts.push('error');
|
|
698
|
+
if (this.disabled())
|
|
699
|
+
parts.push('disabled');
|
|
700
|
+
if (this.autosize())
|
|
701
|
+
parts.push('autosize');
|
|
702
|
+
return parts.join(' ');
|
|
703
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClasses" }] : /* istanbul ignore next */ []));
|
|
704
|
+
autosizeMinHeight = computed(() => this.autosize() && this.minRows() ? `${this.minRows()}lh` : null, ...(ngDevMode ? [{ debugName: "autosizeMinHeight" }] : /* istanbul ignore next */ []));
|
|
705
|
+
autosizeMaxHeight = computed(() => this.autosize() && this.maxRows() ? `${this.maxRows()}lh` : null, ...(ngDevMode ? [{ debugName: "autosizeMaxHeight" }] : /* istanbul ignore next */ []));
|
|
706
|
+
// Autosize grows with content, so a manual resize handle conflicts — force none.
|
|
707
|
+
effectiveResize = computed(() => this.autosize() ? 'none' : this.resize(), ...(ngDevMode ? [{ debugName: "effectiveResize" }] : /* istanbul ignore next */ []));
|
|
708
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
709
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: TextareaComponent, isStandalone: true, selector: "ds-textarea", inputs: { value: { classPropertyName: "value", publicName: "value", 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 }, hint: { classPropertyName: "hint", publicName: "hint", 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 }, invalid: { classPropertyName: "invalid", publicName: "invalid", 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 }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, autosize: { classPropertyName: "autosize", publicName: "autosize", isSignal: true, isRequired: false, transformFunction: null }, minRows: { classPropertyName: "minRows", publicName: "minRows", isSignal: true, isRequired: false, transformFunction: null }, maxRows: { classPropertyName: "maxRows", publicName: "maxRows", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<div [class]=\"wrapperClasses()\">\r\n @if (label()) {\r\n <label class=\"label\" [attr.for]=\"uid\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"req\" aria-hidden=\"true\">*</span>\r\n } @else if (optional()) {\r\n <span class=\"optional-marker\" aria-hidden=\"true\">(optional)</span>\r\n }\r\n </label>\r\n }\r\n <div class=\"control\">\r\n <textarea\r\n [id]=\"uid\"\r\n [rows]=\"rows()\"\r\n [(ngModel)]=\"value\"\r\n [attr.name]=\"name()\"\r\n [attr.placeholder]=\"placeholder() || null\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n [attr.aria-describedby]=\"hintId()\"\r\n [attr.aria-required]=\"required() ? 'true' : null\"\r\n [disabled]=\"disabled()\"\r\n [required]=\"required()\"\r\n [style.resize]=\"effectiveResize()\"\r\n [style.min-height]=\"autosizeMinHeight()\"\r\n [style.max-height]=\"autosizeMaxHeight()\"\r\n [style.overflow-y]=\"autosize() && maxRows() ? 'auto' : null\"\r\n ></textarea>\r\n </div>\r\n @if (hint()) {\r\n <span class=\"hint\" [id]=\"hintId()\" [attr.role]=\"invalid() ? 'alert' : null\">{{ hint() }}</span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.field{--_input-bg: var(--ds-input-bg, var(--surface-default));--_input-border: var(--ds-input-border, var(--border-default));--_input-radius: var(--ds-input-radius, var(--radius-md));--_input-pad-y: var(--ds-input-pad-y, var(--space-3));--_input-pad-x: var(--ds-input-pad-x, var(--field-pad-x));--_input-fg: var(--ds-input-fg, var(--text-primary));--_input-placeholder: var(--ds-input-placeholder, var(--text-tertiary));--_input-border-hover: var(--ds-input-border-hover, var(--border-strong));--_input-border-focus: var(--ds-input-border-focus, var(--primary));--_input-focus-shadow: var(--ds-input-focus-shadow, var(--focus-field));--_input-bg-disabled: var(--ds-input-bg-disabled, var(--surface-disabled));--_input-bg-error: var(--ds-input-bg-error, var(--error-subtle));--_input-border-error: var(--ds-input-border-error, var(--error));--_input-border-success: var(--ds-input-border-success, var(--success));display:flex;flex-direction:column;gap:var(--space-1-5);width:100%}.field .label{font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-secondary);display:flex;align-items:center;gap:var(--space-1)}.field .label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.field .label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.field .control{display:flex;align-items:stretch;gap:var(--space-2);background:var(--_input-bg);border:var(--border-width-default) solid var(--_input-border);border-radius:var(--_input-radius);padding:var(--_input-pad-y) var(--_input-pad-x);height:auto;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.field .control textarea{flex:1;min-width:0;appearance:none;-webkit-appearance:none;border:0;outline:0;background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_input-fg);min-height:var(--field-textarea-rows-min, 60px)}.field .control textarea::placeholder{color:var(--_input-placeholder)}.field .control:hover{border-color:var(--_input-border-hover)}.field .control:focus-within{border-color:var(--_input-border-focus);box-shadow:var(--_input-focus-shadow)}.field .hint{font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary);display:flex;align-items:center;gap:var(--space-1)}.field.disabled .control{background:var(--_input-bg-disabled);border-color:var(--border-disabled)}.field.disabled textarea{color:var(--text-disabled)}.field.error .control{background:var(--_input-bg-error);border-color:var(--_input-border-error)}.field.error .control:focus-within{box-shadow:var(--focus-field-error)}.field.error .hint{color:var(--error-text)}.field.success .control{border-color:var(--_input-border-success)}.field.success .hint{color:var(--success-text)}.field.sm .control{padding:var(--space-2) var(--space-2)}.field.lg .control{padding:var(--space-4) var(--space-3)}.field.autosize .control textarea{field-sizing:content;overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
710
|
+
}
|
|
711
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
712
|
+
type: Component,
|
|
713
|
+
args: [{ selector: 'ds-textarea', standalone: true, imports: [FormsModule], encapsulation: ViewEncapsulation.Emulated, template: "<div [class]=\"wrapperClasses()\">\r\n @if (label()) {\r\n <label class=\"label\" [attr.for]=\"uid\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"req\" aria-hidden=\"true\">*</span>\r\n } @else if (optional()) {\r\n <span class=\"optional-marker\" aria-hidden=\"true\">(optional)</span>\r\n }\r\n </label>\r\n }\r\n <div class=\"control\">\r\n <textarea\r\n [id]=\"uid\"\r\n [rows]=\"rows()\"\r\n [(ngModel)]=\"value\"\r\n [attr.name]=\"name()\"\r\n [attr.placeholder]=\"placeholder() || null\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n [attr.aria-describedby]=\"hintId()\"\r\n [attr.aria-required]=\"required() ? 'true' : null\"\r\n [disabled]=\"disabled()\"\r\n [required]=\"required()\"\r\n [style.resize]=\"effectiveResize()\"\r\n [style.min-height]=\"autosizeMinHeight()\"\r\n [style.max-height]=\"autosizeMaxHeight()\"\r\n [style.overflow-y]=\"autosize() && maxRows() ? 'auto' : null\"\r\n ></textarea>\r\n </div>\r\n @if (hint()) {\r\n <span class=\"hint\" [id]=\"hintId()\" [attr.role]=\"invalid() ? 'alert' : null\">{{ hint() }}</span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.field{--_input-bg: var(--ds-input-bg, var(--surface-default));--_input-border: var(--ds-input-border, var(--border-default));--_input-radius: var(--ds-input-radius, var(--radius-md));--_input-pad-y: var(--ds-input-pad-y, var(--space-3));--_input-pad-x: var(--ds-input-pad-x, var(--field-pad-x));--_input-fg: var(--ds-input-fg, var(--text-primary));--_input-placeholder: var(--ds-input-placeholder, var(--text-tertiary));--_input-border-hover: var(--ds-input-border-hover, var(--border-strong));--_input-border-focus: var(--ds-input-border-focus, var(--primary));--_input-focus-shadow: var(--ds-input-focus-shadow, var(--focus-field));--_input-bg-disabled: var(--ds-input-bg-disabled, var(--surface-disabled));--_input-bg-error: var(--ds-input-bg-error, var(--error-subtle));--_input-border-error: var(--ds-input-border-error, var(--error));--_input-border-success: var(--ds-input-border-success, var(--success));display:flex;flex-direction:column;gap:var(--space-1-5);width:100%}.field .label{font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-secondary);display:flex;align-items:center;gap:var(--space-1)}.field .label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.field .label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.field .control{display:flex;align-items:stretch;gap:var(--space-2);background:var(--_input-bg);border:var(--border-width-default) solid var(--_input-border);border-radius:var(--_input-radius);padding:var(--_input-pad-y) var(--_input-pad-x);height:auto;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.field .control textarea{flex:1;min-width:0;appearance:none;-webkit-appearance:none;border:0;outline:0;background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_input-fg);min-height:var(--field-textarea-rows-min, 60px)}.field .control textarea::placeholder{color:var(--_input-placeholder)}.field .control:hover{border-color:var(--_input-border-hover)}.field .control:focus-within{border-color:var(--_input-border-focus);box-shadow:var(--_input-focus-shadow)}.field .hint{font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary);display:flex;align-items:center;gap:var(--space-1)}.field.disabled .control{background:var(--_input-bg-disabled);border-color:var(--border-disabled)}.field.disabled textarea{color:var(--text-disabled)}.field.error .control{background:var(--_input-bg-error);border-color:var(--_input-border-error)}.field.error .control:focus-within{box-shadow:var(--focus-field-error)}.field.error .hint{color:var(--error-text)}.field.success .control{border-color:var(--_input-border-success)}.field.success .hint{color:var(--success-text)}.field.sm .control{padding:var(--space-2) var(--space-2)}.field.lg .control{padding:var(--space-4) var(--space-3)}.field.autosize .control textarea{field-sizing:content;overflow:hidden}\n"] }]
|
|
714
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], autosize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autosize", required: false }] }], minRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "minRows", required: false }] }], maxRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxRows", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
715
|
+
|
|
716
|
+
class SearchComponent {
|
|
717
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
718
|
+
placeholder = input('Search', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
719
|
+
shortcut = input('', ...(ngDevMode ? [{ debugName: "shortcut" }] : /* istanbul ignore next */ []));
|
|
720
|
+
showIcon = input(true, ...(ngDevMode ? [{ debugName: "showIcon" }] : /* istanbul ignore next */ []));
|
|
721
|
+
/** Show an inline clear (×) button on the right when there's a value. */
|
|
722
|
+
clearable = input(false, ...(ngDevMode ? [{ debugName: "clearable" }] : /* istanbul ignore next */ []));
|
|
723
|
+
/** Accessible name for the input (placeholder is not a reliable label). */
|
|
724
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
725
|
+
submitted = output();
|
|
726
|
+
inputEl = viewChild('searchInput', ...(ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []));
|
|
727
|
+
onSubmit() {
|
|
728
|
+
this.submitted.emit(this.value());
|
|
729
|
+
}
|
|
730
|
+
clear() {
|
|
731
|
+
this.value.set('');
|
|
732
|
+
// The × is removed once empty; return focus to the input so keyboard
|
|
733
|
+
// users don't get dropped onto <body>.
|
|
734
|
+
this.inputEl()?.nativeElement.focus();
|
|
735
|
+
}
|
|
736
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
737
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: SearchComponent, isStandalone: true, selector: "ds-search", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, shortcut: { classPropertyName: "shortcut", publicName: "shortcut", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", submitted: "submitted" }, viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"search\">\r\n @if (showIcon()) {\r\n <ds-icon name=\"search\" [size]=\"16\"></ds-icon>\r\n }\r\n <input\r\n #searchInput\r\n class=\"input\"\r\n [(ngModel)]=\"value\"\r\n [placeholder]=\"placeholder()\"\r\n [attr.aria-label]=\"ariaLabel() || placeholder() || null\"\r\n (keydown.enter)=\"onSubmit()\"\r\n />\r\n @if (clearable() && value()) {\r\n <button type=\"button\" class=\"search-clear\" aria-label=\"Clear search\" (click)=\"clear()\">\r\n <ds-icon name=\"x\" [size]=\"14\"></ds-icon>\r\n </button>\r\n }\r\n @if (shortcut()) {\r\n <kbd class=\"kbd\">{{ shortcut() }}</kbd>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.search{--_search-height: var(--ds-search-height, var(--search-h));--_search-bg: var(--ds-search-bg, var(--surface-default));--_search-border: var(--ds-search-border, var(--border-default));--_search-radius: var(--ds-search-radius, var(--radius-md));--_search-border-hover: var(--ds-search-border-hover, var(--border-default));--_search-bg-focus: var(--ds-search-bg-focus, var(--surface-default));--_search-border-focus: var(--ds-search-border-focus, var(--primary));--_search-focus-shadow: var(--ds-search-focus-shadow, var(--focus-field));--_search-fg: var(--ds-search-fg, var(--text-primary));--_search-placeholder: var(--ds-search-placeholder, var(--text-tertiary));display:flex;align-items:center;gap:var(--space-2);background:var(--_search-bg);border:var(--border-width-default) solid var(--_search-border);border-radius:var(--_search-radius);padding:0 var(--space-3);height:var(--_search-height);width:100%;max-width:var(--search-maxw);transition:border-color var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.search:hover{border-color:var(--_search-border-hover)}.search:focus-within{background:var(--_search-bg-focus);border-color:var(--_search-border-focus);box-shadow:var(--_search-focus-shadow)}.search .icon{width:var(--icon-md);height:var(--icon-md);color:var(--icon-default)}.search .input{flex:1;min-width:0;border:0;outline:0;background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_search-fg)}.search .input::placeholder{color:var(--_search-placeholder)}.search .search-clear{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;padding:2px;border:0;background:transparent;border-radius:var(--radius-pill, 999px);color:var(--icon-default);cursor:pointer;opacity:.7;transition:opacity var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.search .search-clear .icon{width:14px;height:14px}.search .search-clear:hover{opacity:1;background:var(--surface-muted, rgba(0, 0, 0, .06))}.search .kbd{font:var(--font-weight-medium) var(--font-size-2xs)/var(--line-height-flat) var(--font-mono);padding:var(--space-px) var(--space-1-5);background:var(--surface-default);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-sm);color:var(--text-tertiary)}.search.sm{--_search-height: var(--ds-search-height, var(--hit-min))}.search.md{--_search-height: var(--ds-search-height, var(--hit-cozy))}.search.lg{--_search-height: var(--ds-search-height, var(--field-h-lg))}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
738
|
+
}
|
|
739
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SearchComponent, decorators: [{
|
|
740
|
+
type: Component,
|
|
741
|
+
args: [{ selector: 'ds-search', standalone: true, imports: [FormsModule, IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<div class=\"search\">\r\n @if (showIcon()) {\r\n <ds-icon name=\"search\" [size]=\"16\"></ds-icon>\r\n }\r\n <input\r\n #searchInput\r\n class=\"input\"\r\n [(ngModel)]=\"value\"\r\n [placeholder]=\"placeholder()\"\r\n [attr.aria-label]=\"ariaLabel() || placeholder() || null\"\r\n (keydown.enter)=\"onSubmit()\"\r\n />\r\n @if (clearable() && value()) {\r\n <button type=\"button\" class=\"search-clear\" aria-label=\"Clear search\" (click)=\"clear()\">\r\n <ds-icon name=\"x\" [size]=\"14\"></ds-icon>\r\n </button>\r\n }\r\n @if (shortcut()) {\r\n <kbd class=\"kbd\">{{ shortcut() }}</kbd>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.search{--_search-height: var(--ds-search-height, var(--search-h));--_search-bg: var(--ds-search-bg, var(--surface-default));--_search-border: var(--ds-search-border, var(--border-default));--_search-radius: var(--ds-search-radius, var(--radius-md));--_search-border-hover: var(--ds-search-border-hover, var(--border-default));--_search-bg-focus: var(--ds-search-bg-focus, var(--surface-default));--_search-border-focus: var(--ds-search-border-focus, var(--primary));--_search-focus-shadow: var(--ds-search-focus-shadow, var(--focus-field));--_search-fg: var(--ds-search-fg, var(--text-primary));--_search-placeholder: var(--ds-search-placeholder, var(--text-tertiary));display:flex;align-items:center;gap:var(--space-2);background:var(--_search-bg);border:var(--border-width-default) solid var(--_search-border);border-radius:var(--_search-radius);padding:0 var(--space-3);height:var(--_search-height);width:100%;max-width:var(--search-maxw);transition:border-color var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.search:hover{border-color:var(--_search-border-hover)}.search:focus-within{background:var(--_search-bg-focus);border-color:var(--_search-border-focus);box-shadow:var(--_search-focus-shadow)}.search .icon{width:var(--icon-md);height:var(--icon-md);color:var(--icon-default)}.search .input{flex:1;min-width:0;border:0;outline:0;background:transparent;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_search-fg)}.search .input::placeholder{color:var(--_search-placeholder)}.search .search-clear{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;padding:2px;border:0;background:transparent;border-radius:var(--radius-pill, 999px);color:var(--icon-default);cursor:pointer;opacity:.7;transition:opacity var(--duration-fast) var(--ease-standard),background var(--duration-fast) var(--ease-standard)}.search .search-clear .icon{width:14px;height:14px}.search .search-clear:hover{opacity:1;background:var(--surface-muted, rgba(0, 0, 0, .06))}.search .kbd{font:var(--font-weight-medium) var(--font-size-2xs)/var(--line-height-flat) var(--font-mono);padding:var(--space-px) var(--space-1-5);background:var(--surface-default);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-sm);color:var(--text-tertiary)}.search.sm{--_search-height: var(--ds-search-height, var(--hit-min))}.search.md{--_search-height: var(--ds-search-height, var(--hit-cozy))}.search.lg{--_search-height: var(--ds-search-height, var(--field-h-lg))}\n"] }]
|
|
742
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], shortcut: [{ type: i0.Input, args: [{ isSignal: true, alias: "shortcut", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], submitted: [{ type: i0.Output, args: ["submitted"] }], inputEl: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }] } });
|
|
743
|
+
|
|
744
|
+
/** Showcase-only: renders the component's open/overlay surface inline in normal
|
|
745
|
+
* flow instead of its real overlay mechanics (for static docs specimens).
|
|
746
|
+
* Not part of the production contract. */
|
|
747
|
+
class DsStaticPreview {
|
|
748
|
+
staticPreview = input(false, { ...(ngDevMode ? { debugName: "staticPreview" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
749
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DsStaticPreview, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
750
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: DsStaticPreview, isStandalone: true, inputs: { staticPreview: { classPropertyName: "staticPreview", publicName: "staticPreview", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
751
|
+
}
|
|
752
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DsStaticPreview, decorators: [{
|
|
753
|
+
type: Directive,
|
|
754
|
+
args: [{ standalone: true }]
|
|
755
|
+
}], propDecorators: { staticPreview: [{ type: i0.Input, args: [{ isSignal: true, alias: "staticPreview", required: false }] }] } });
|
|
756
|
+
|
|
757
|
+
function isSelectOptionGroup(item) {
|
|
758
|
+
return 'options' in item && Array.isArray(item.options);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
let nextId$7 = 0;
|
|
762
|
+
class SelectComponent {
|
|
763
|
+
overlay = inject(Overlay);
|
|
764
|
+
vcr = inject(ViewContainerRef);
|
|
765
|
+
preview = inject(DsStaticPreview);
|
|
766
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
767
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
768
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
769
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
770
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
771
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
772
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
773
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
774
|
+
optional = input(false, ...(ngDevMode ? [{ debugName: "optional" }] : /* istanbul ignore next */ []));
|
|
775
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
776
|
+
/** Accessible name when no visible `label` is provided. */
|
|
777
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
778
|
+
uid = `ds-select-${++nextId$7}`;
|
|
779
|
+
labelId = `${this.uid}-label`;
|
|
780
|
+
listboxId = `${this.uid}-listbox`;
|
|
781
|
+
optionId(flatIdx) {
|
|
782
|
+
return `${this.uid}-opt-${flatIdx}`;
|
|
783
|
+
}
|
|
784
|
+
/** Active option for `aria-activedescendant` (combobox keeps DOM focus). */
|
|
785
|
+
activeDescendant = computed(() => {
|
|
786
|
+
const idx = this.activeIndex();
|
|
787
|
+
return this.open() && idx >= 0 ? this.optionId(idx) : null;
|
|
788
|
+
}, ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
|
|
789
|
+
resolvedAriaLabel = computed(() => this.label() ? null : this.ariaLabel() || this.placeholder() || null, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
790
|
+
trigger = viewChild.required('trigger');
|
|
791
|
+
panelTpl = viewChild.required('panel');
|
|
792
|
+
panelContentTpl = viewChild.required('panelContent');
|
|
793
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
794
|
+
activeIndex = signal(-1, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
795
|
+
overlayRef = null;
|
|
796
|
+
// Flattened list of selectable options paired with the parent-group `disabled`
|
|
797
|
+
// state, so keyboard nav and selection ignore group-header labels and respect
|
|
798
|
+
// group-level disable. Index of an entry here corresponds to `activeIndex`.
|
|
799
|
+
flatOptions = computed(() => {
|
|
800
|
+
const out = [];
|
|
801
|
+
for (const item of this.options()) {
|
|
802
|
+
if (isSelectOptionGroup(item)) {
|
|
803
|
+
const groupDisabled = !!item.disabled;
|
|
804
|
+
for (const opt of item.options) {
|
|
805
|
+
out.push({ option: opt, groupDisabled });
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
out.push({ option: item, groupDisabled: false });
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
return out;
|
|
813
|
+
}, ...(ngDevMode ? [{ debugName: "flatOptions" }] : /* istanbul ignore next */ []));
|
|
814
|
+
selectedOption = computed(() => {
|
|
815
|
+
const current = this.value();
|
|
816
|
+
const found = this.flatOptions().find(({ option }) => option.value === current);
|
|
817
|
+
return found?.option ?? null;
|
|
818
|
+
}, ...(ngDevMode ? [{ debugName: "selectedOption" }] : /* istanbul ignore next */ []));
|
|
819
|
+
displayLabel = computed(() => {
|
|
820
|
+
return this.selectedOption()?.label ?? this.placeholder();
|
|
821
|
+
}, ...(ngDevMode ? [{ debugName: "displayLabel" }] : /* istanbul ignore next */ []));
|
|
822
|
+
hasValue = computed(() => !!this.selectedOption(), ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
823
|
+
triggerClasses = computed(() => {
|
|
824
|
+
const parts = ['dropdown'];
|
|
825
|
+
if (this.size() === 'sm')
|
|
826
|
+
parts.push('sm');
|
|
827
|
+
if (this.size() === 'lg')
|
|
828
|
+
parts.push('lg');
|
|
829
|
+
if (this.disabled())
|
|
830
|
+
parts.push('disabled');
|
|
831
|
+
if (this.invalid())
|
|
832
|
+
parts.push('error');
|
|
833
|
+
if (this.open() || this.preview.staticPreview())
|
|
834
|
+
parts.push('open');
|
|
835
|
+
return parts.join(' ');
|
|
836
|
+
}, ...(ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []));
|
|
837
|
+
constructor() {
|
|
838
|
+
effect(() => {
|
|
839
|
+
if (!this.open())
|
|
840
|
+
return;
|
|
841
|
+
const idx = this.flatOptions().findIndex(({ option }) => option.value === this.value());
|
|
842
|
+
this.activeIndex.set(idx >= 0 ? idx : this.firstEnabledIndex());
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
isOptionGroup(item) {
|
|
846
|
+
return isSelectOptionGroup(item);
|
|
847
|
+
}
|
|
848
|
+
// Resolve the flat-index for a given option so click/hover/selection
|
|
849
|
+
// map back to the same indices keyboard nav uses (no double bookkeeping).
|
|
850
|
+
flatIndexOf(opt) {
|
|
851
|
+
return this.flatOptions().findIndex(({ option }) => option === opt);
|
|
852
|
+
}
|
|
853
|
+
toggle() {
|
|
854
|
+
if (this.disabled() || this.preview.staticPreview())
|
|
855
|
+
return;
|
|
856
|
+
if (this.open()) {
|
|
857
|
+
this.close();
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
this.openPanel();
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
openPanel() {
|
|
864
|
+
if (this.overlayRef)
|
|
865
|
+
return;
|
|
866
|
+
const triggerEl = this.trigger().nativeElement;
|
|
867
|
+
const width = triggerEl.getBoundingClientRect().width;
|
|
868
|
+
const positionStrategy = this.overlay.position()
|
|
869
|
+
.flexibleConnectedTo(triggerEl)
|
|
870
|
+
.withPositions([
|
|
871
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
872
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
873
|
+
]);
|
|
874
|
+
const cfg = {
|
|
875
|
+
positionStrategy,
|
|
876
|
+
hasBackdrop: true,
|
|
877
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
878
|
+
// Reuse the global panel skin defined in styles/_dropdown-overlay.scss
|
|
879
|
+
// so the portaled panel actually renders styled — `:host ::ng-deep`
|
|
880
|
+
// selectors can't reach a node outside the host's DOM tree.
|
|
881
|
+
panelClass: 'ds-dropdown-panel',
|
|
882
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
883
|
+
width,
|
|
884
|
+
};
|
|
885
|
+
this.overlayRef = this.overlay.create(cfg);
|
|
886
|
+
this.overlayRef.backdropClick().subscribe(() => this.close());
|
|
887
|
+
const portal = new TemplatePortal(this.panelTpl(), this.vcr);
|
|
888
|
+
this.overlayRef.attach(portal);
|
|
889
|
+
this.open.set(true);
|
|
890
|
+
}
|
|
891
|
+
close() {
|
|
892
|
+
this.overlayRef?.dispose();
|
|
893
|
+
this.overlayRef = null;
|
|
894
|
+
this.open.set(false);
|
|
895
|
+
this.activeIndex.set(-1);
|
|
896
|
+
}
|
|
897
|
+
pick(option, groupDisabled = false) {
|
|
898
|
+
if (option.disabled || groupDisabled)
|
|
899
|
+
return;
|
|
900
|
+
this.value.set(option.value);
|
|
901
|
+
this.close();
|
|
902
|
+
this.trigger().nativeElement.focus();
|
|
903
|
+
}
|
|
904
|
+
isSelected(option) {
|
|
905
|
+
return option.value === this.value();
|
|
906
|
+
}
|
|
907
|
+
isOptionDisabled(option, groupDisabled = false) {
|
|
908
|
+
return !!option.disabled || groupDisabled;
|
|
909
|
+
}
|
|
910
|
+
onTriggerKeydown(event) {
|
|
911
|
+
if (this.disabled() || this.preview.staticPreview())
|
|
912
|
+
return;
|
|
913
|
+
const key = event.key;
|
|
914
|
+
if (!this.open()) {
|
|
915
|
+
if (key === 'ArrowDown' || key === 'ArrowUp' || key === 'Enter' || key === ' ') {
|
|
916
|
+
event.preventDefault();
|
|
917
|
+
this.openPanel();
|
|
918
|
+
}
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
if (key === 'Escape') {
|
|
922
|
+
event.preventDefault();
|
|
923
|
+
this.close();
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
if (key === 'ArrowDown') {
|
|
927
|
+
event.preventDefault();
|
|
928
|
+
this.moveActive(1);
|
|
929
|
+
return;
|
|
930
|
+
}
|
|
931
|
+
if (key === 'ArrowUp') {
|
|
932
|
+
event.preventDefault();
|
|
933
|
+
this.moveActive(-1);
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
if (key === 'Enter' || key === ' ') {
|
|
937
|
+
event.preventDefault();
|
|
938
|
+
const idx = this.activeIndex();
|
|
939
|
+
const entry = this.flatOptions()[idx];
|
|
940
|
+
if (entry)
|
|
941
|
+
this.pick(entry.option, entry.groupDisabled);
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
if (key === 'Home') {
|
|
945
|
+
event.preventDefault();
|
|
946
|
+
this.activeIndex.set(this.firstEnabledIndex());
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
if (key === 'End') {
|
|
950
|
+
event.preventDefault();
|
|
951
|
+
this.activeIndex.set(this.lastEnabledIndex());
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
isActive(index) {
|
|
955
|
+
return this.activeIndex() === index;
|
|
956
|
+
}
|
|
957
|
+
moveActive(delta) {
|
|
958
|
+
const opts = this.flatOptions();
|
|
959
|
+
if (opts.length === 0)
|
|
960
|
+
return;
|
|
961
|
+
let next = this.activeIndex();
|
|
962
|
+
for (let attempts = 0; attempts < opts.length; attempts++) {
|
|
963
|
+
next = (next + delta + opts.length) % opts.length;
|
|
964
|
+
const candidate = opts[next];
|
|
965
|
+
if (candidate && !candidate.option.disabled && !candidate.groupDisabled) {
|
|
966
|
+
this.activeIndex.set(next);
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
firstEnabledIndex() {
|
|
972
|
+
const opts = this.flatOptions();
|
|
973
|
+
for (let i = 0; i < opts.length; i++) {
|
|
974
|
+
const candidate = opts[i];
|
|
975
|
+
if (candidate && !candidate.option.disabled && !candidate.groupDisabled)
|
|
976
|
+
return i;
|
|
977
|
+
}
|
|
978
|
+
return -1;
|
|
979
|
+
}
|
|
980
|
+
lastEnabledIndex() {
|
|
981
|
+
const opts = this.flatOptions();
|
|
982
|
+
for (let i = opts.length - 1; i >= 0; i--) {
|
|
983
|
+
const candidate = opts[i];
|
|
984
|
+
if (candidate && !candidate.option.disabled && !candidate.groupDisabled)
|
|
985
|
+
return i;
|
|
986
|
+
}
|
|
987
|
+
return -1;
|
|
988
|
+
}
|
|
989
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
990
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", 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 }, 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 }, invalid: { classPropertyName: "invalid", publicName: "invalid", 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 } }, outputs: { value: "valueChange" }, 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 }], hostDirectives: [{ directive: DsStaticPreview, inputs: ["staticPreview", "staticPreview"] }], ngImport: i0, template: "@if (label()) {\r\n <span class=\"select-label\" [id]=\"labelId\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"req\" aria-hidden=\"true\">*</span>\r\n } @else if (optional()) {\r\n <span class=\"optional-marker\" aria-hidden=\"true\">(optional)</span>\r\n }\r\n </span>\r\n}\r\n\r\n<button\r\n #trigger\r\n type=\"button\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [class]=\"triggerClasses()\"\r\n [attr.name]=\"name()\"\r\n [attr.aria-expanded]=\"open() || preview.staticPreview()\"\r\n [attr.aria-controls]=\"listboxId\"\r\n [attr.aria-activedescendant]=\"activeDescendant()\"\r\n [attr.aria-labelledby]=\"label() ? labelId : null\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n [attr.aria-required]=\"required() ? 'true' : null\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <span class=\"trigger-text\" [class.is-placeholder]=\"!hasValue()\">{{ displayLabel() }}</span>\r\n <span class=\"chevron\"><ds-icon name=\"chevronDown\" [size]=\"14\" /></span>\r\n</button>\r\n\r\n@if (preview.staticPreview()) {\r\n <div class=\"ds-dropdown-panel\">\r\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\r\n </div>\r\n}\r\n\r\n<ng-template #panel>\r\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\r\n</ng-template>\r\n\r\n<ng-template #panelContent>\r\n <div class=\"dropdown-panel\">\r\n <ul class=\"dropdown-list\" role=\"listbox\" [id]=\"listboxId\" [attr.aria-labelledby]=\"label() ? labelId : null\">\r\n @for (item of options(); track item.label; let groupIdx = $index) {\r\n @if (isOptionGroup(item)) {\r\n <li class=\"optgroup\" role=\"group\" [attr.aria-label]=\"item.label\">\r\n <span class=\"optgroup-label\" [class.is-first]=\"groupIdx === 0\">{{ item.label }}</span>\r\n <ul class=\"optgroup-list\" role=\"presentation\">\r\n @for (opt of item.options; track opt.value) {\r\n <li role=\"presentation\">\r\n <button\r\n type=\"button\"\r\n role=\"option\"\r\n class=\"option\"\r\n [id]=\"optionId(flatIndexOf(opt))\"\r\n [attr.aria-selected]=\"isSelected(opt)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(opt, item.disabled) ? 'true' : null\"\r\n [class.is-selected]=\"isSelected(opt)\"\r\n [class.is-active]=\"isActive(flatIndexOf(opt))\"\r\n [class.is-disabled]=\"isOptionDisabled(opt, item.disabled)\"\r\n [disabled]=\"isOptionDisabled(opt, item.disabled)\"\r\n (click)=\"pick(opt, item.disabled)\"\r\n (mouseenter)=\"activeIndex.set(flatIndexOf(opt))\"\r\n >\r\n <span class=\"option-label\">{{ opt.label }}</span>\r\n @if (isSelected(opt)) {\r\n <ds-icon class=\"option-check\" name=\"check\" [size]=\"14\" />\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n </li>\r\n } @else {\r\n <li role=\"presentation\">\r\n <button\r\n type=\"button\"\r\n role=\"option\"\r\n class=\"option\"\r\n [id]=\"optionId(flatIndexOf(item))\"\r\n [attr.aria-selected]=\"isSelected(item)\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n [class.is-selected]=\"isSelected(item)\"\r\n [class.is-active]=\"isActive(flatIndexOf(item))\"\r\n [class.is-disabled]=\"item.disabled\"\r\n [disabled]=\"item.disabled\"\r\n (click)=\"pick(item)\"\r\n (mouseenter)=\"activeIndex.set(flatIndexOf(item))\"\r\n >\r\n <span class=\"option-label\">{{ item.label }}</span>\r\n @if (isSelected(item)) {\r\n <ds-icon class=\"option-check\" name=\"check\" [size]=\"14\" />\r\n }\r\n </button>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%}.select-label{font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-secondary);display:flex;align-items:center;gap:var(--space-1);margin-bottom:var(--space-1-5)}.select-label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.select-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(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);padding:var(--field-pad-y) var(--field-pad-x);height:var(--hit-cozy);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);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:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown .trigger-text.is-placeholder{color:var(--text-tertiary)}.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(--primary);box-shadow:var(--focus-field)}.dropdown.open{border-color:var(--primary);box-shadow:var(--focus-field)}.dropdown.open .chevron{transform:rotate(180deg)}.dropdown.error{background:var(--error-subtle);border-color:var(--error)}.dropdown.error:focus-visible{box-shadow:var(--focus-field-error)}.dropdown.disabled,.dropdown:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed;opacity:var(--opacity-muted)}.dropdown.disabled .chevron,.dropdown:disabled .chevron{color:var(--icon-muted)}.dropdown.sm{height:var(--hit-min);padding:0 var(--space-2)}.dropdown.lg{height:var(--field-h-lg)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
991
|
+
}
|
|
992
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SelectComponent, decorators: [{
|
|
993
|
+
type: Component,
|
|
994
|
+
args: [{ selector: 'ds-select', standalone: true, imports: [IconComponent, NgTemplateOutlet], encapsulation: ViewEncapsulation.Emulated, hostDirectives: [{ directive: DsStaticPreview, inputs: ['staticPreview'] }], template: "@if (label()) {\r\n <span class=\"select-label\" [id]=\"labelId\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"req\" aria-hidden=\"true\">*</span>\r\n } @else if (optional()) {\r\n <span class=\"optional-marker\" aria-hidden=\"true\">(optional)</span>\r\n }\r\n </span>\r\n}\r\n\r\n<button\r\n #trigger\r\n type=\"button\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [class]=\"triggerClasses()\"\r\n [attr.name]=\"name()\"\r\n [attr.aria-expanded]=\"open() || preview.staticPreview()\"\r\n [attr.aria-controls]=\"listboxId\"\r\n [attr.aria-activedescendant]=\"activeDescendant()\"\r\n [attr.aria-labelledby]=\"label() ? labelId : null\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n [attr.aria-required]=\"required() ? 'true' : null\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <span class=\"trigger-text\" [class.is-placeholder]=\"!hasValue()\">{{ displayLabel() }}</span>\r\n <span class=\"chevron\"><ds-icon name=\"chevronDown\" [size]=\"14\" /></span>\r\n</button>\r\n\r\n@if (preview.staticPreview()) {\r\n <div class=\"ds-dropdown-panel\">\r\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\r\n </div>\r\n}\r\n\r\n<ng-template #panel>\r\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\r\n</ng-template>\r\n\r\n<ng-template #panelContent>\r\n <div class=\"dropdown-panel\">\r\n <ul class=\"dropdown-list\" role=\"listbox\" [id]=\"listboxId\" [attr.aria-labelledby]=\"label() ? labelId : null\">\r\n @for (item of options(); track item.label; let groupIdx = $index) {\r\n @if (isOptionGroup(item)) {\r\n <li class=\"optgroup\" role=\"group\" [attr.aria-label]=\"item.label\">\r\n <span class=\"optgroup-label\" [class.is-first]=\"groupIdx === 0\">{{ item.label }}</span>\r\n <ul class=\"optgroup-list\" role=\"presentation\">\r\n @for (opt of item.options; track opt.value) {\r\n <li role=\"presentation\">\r\n <button\r\n type=\"button\"\r\n role=\"option\"\r\n class=\"option\"\r\n [id]=\"optionId(flatIndexOf(opt))\"\r\n [attr.aria-selected]=\"isSelected(opt)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(opt, item.disabled) ? 'true' : null\"\r\n [class.is-selected]=\"isSelected(opt)\"\r\n [class.is-active]=\"isActive(flatIndexOf(opt))\"\r\n [class.is-disabled]=\"isOptionDisabled(opt, item.disabled)\"\r\n [disabled]=\"isOptionDisabled(opt, item.disabled)\"\r\n (click)=\"pick(opt, item.disabled)\"\r\n (mouseenter)=\"activeIndex.set(flatIndexOf(opt))\"\r\n >\r\n <span class=\"option-label\">{{ opt.label }}</span>\r\n @if (isSelected(opt)) {\r\n <ds-icon class=\"option-check\" name=\"check\" [size]=\"14\" />\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n </li>\r\n } @else {\r\n <li role=\"presentation\">\r\n <button\r\n type=\"button\"\r\n role=\"option\"\r\n class=\"option\"\r\n [id]=\"optionId(flatIndexOf(item))\"\r\n [attr.aria-selected]=\"isSelected(item)\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n [class.is-selected]=\"isSelected(item)\"\r\n [class.is-active]=\"isActive(flatIndexOf(item))\"\r\n [class.is-disabled]=\"item.disabled\"\r\n [disabled]=\"item.disabled\"\r\n (click)=\"pick(item)\"\r\n (mouseenter)=\"activeIndex.set(flatIndexOf(item))\"\r\n >\r\n <span class=\"option-label\">{{ item.label }}</span>\r\n @if (isSelected(item)) {\r\n <ds-icon class=\"option-check\" name=\"check\" [size]=\"14\" />\r\n }\r\n </button>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%}.select-label{font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-secondary);display:flex;align-items:center;gap:var(--space-1);margin-bottom:var(--space-1-5)}.select-label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.select-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(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);padding:var(--field-pad-y) var(--field-pad-x);height:var(--hit-cozy);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);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:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown .trigger-text.is-placeholder{color:var(--text-tertiary)}.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(--primary);box-shadow:var(--focus-field)}.dropdown.open{border-color:var(--primary);box-shadow:var(--focus-field)}.dropdown.open .chevron{transform:rotate(180deg)}.dropdown.error{background:var(--error-subtle);border-color:var(--error)}.dropdown.error:focus-visible{box-shadow:var(--focus-field-error)}.dropdown.disabled,.dropdown:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed;opacity:var(--opacity-muted)}.dropdown.disabled .chevron,.dropdown:disabled .chevron{color:var(--icon-muted)}.dropdown.sm{height:var(--hit-min);padding:0 var(--space-2)}.dropdown.lg{height:var(--field-h-lg)}\n"] }]
|
|
995
|
+
}], 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 }] }], 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 }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", 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 }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], panelContentTpl: [{ type: i0.ViewChild, args: ['panelContent', { isSignal: true }] }] } });
|
|
996
|
+
|
|
997
|
+
let nextId$6 = 0;
|
|
998
|
+
class DropdownComponent {
|
|
999
|
+
overlay = inject(Overlay);
|
|
1000
|
+
vcr = inject(ViewContainerRef);
|
|
1001
|
+
preview = inject(DsStaticPreview);
|
|
1002
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1003
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
1004
|
+
placeholder = input('Select…', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
1005
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1006
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1007
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1008
|
+
readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
1009
|
+
error = input(false, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
1010
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
1011
|
+
/** Accessible name when no visible `label` is provided. */
|
|
1012
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1013
|
+
uid = `ds-dropdown-${++nextId$6}`;
|
|
1014
|
+
labelId = `${this.uid}-label`;
|
|
1015
|
+
listboxId = `${this.uid}-listbox`;
|
|
1016
|
+
optionId(index) {
|
|
1017
|
+
return `${this.uid}-opt-${index}`;
|
|
1018
|
+
}
|
|
1019
|
+
resolvedAriaLabel = computed(() => this.label() ? null : this.ariaLabel() || this.placeholder() || null, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
1020
|
+
trigger = viewChild.required('trigger');
|
|
1021
|
+
panelTpl = viewChild.required('panel');
|
|
1022
|
+
panelContentTpl = viewChild.required('panelContent');
|
|
1023
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
1024
|
+
activeIndex = signal(-1, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
1025
|
+
overlayRef = null;
|
|
1026
|
+
selectedOption = computed(() => {
|
|
1027
|
+
const current = this.value();
|
|
1028
|
+
const found = this.options().find((o) => o.value === current);
|
|
1029
|
+
return found ?? null;
|
|
1030
|
+
}, ...(ngDevMode ? [{ debugName: "selectedOption" }] : /* istanbul ignore next */ []));
|
|
1031
|
+
displayLabel = computed(() => {
|
|
1032
|
+
return this.selectedOption()?.label ?? this.placeholder();
|
|
1033
|
+
}, ...(ngDevMode ? [{ debugName: "displayLabel" }] : /* istanbul ignore next */ []));
|
|
1034
|
+
hasValue = computed(() => !!this.selectedOption(), ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
1035
|
+
activeDescendant = computed(() => {
|
|
1036
|
+
const idx = this.activeIndex();
|
|
1037
|
+
return this.open() && idx >= 0 ? this.optionId(idx) : null;
|
|
1038
|
+
}, ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
|
|
1039
|
+
wrapperClasses = computed(() => {
|
|
1040
|
+
const parts = ['dropdown'];
|
|
1041
|
+
if (this.size() === 'sm')
|
|
1042
|
+
parts.push('sm');
|
|
1043
|
+
if (this.size() === 'lg')
|
|
1044
|
+
parts.push('lg');
|
|
1045
|
+
if (this.disabled())
|
|
1046
|
+
parts.push('disabled');
|
|
1047
|
+
if (this.readOnly())
|
|
1048
|
+
parts.push('readonly');
|
|
1049
|
+
if (this.error())
|
|
1050
|
+
parts.push('error');
|
|
1051
|
+
if (this.open() || this.preview.staticPreview())
|
|
1052
|
+
parts.push('open');
|
|
1053
|
+
return parts.join(' ');
|
|
1054
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClasses" }] : /* istanbul ignore next */ []));
|
|
1055
|
+
constructor() {
|
|
1056
|
+
effect(() => {
|
|
1057
|
+
if (!this.open())
|
|
1058
|
+
return;
|
|
1059
|
+
const idx = this.options().findIndex((o) => o.value === this.value());
|
|
1060
|
+
this.activeIndex.set(idx >= 0 ? idx : this.firstEnabledIndex());
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
toggle() {
|
|
1064
|
+
if (this.disabled() || this.readOnly() || this.preview.staticPreview())
|
|
1065
|
+
return;
|
|
1066
|
+
if (this.open()) {
|
|
1067
|
+
this.close();
|
|
1068
|
+
}
|
|
1069
|
+
else {
|
|
1070
|
+
this.openPanel();
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
openPanel() {
|
|
1074
|
+
if (this.overlayRef)
|
|
1075
|
+
return;
|
|
1076
|
+
const triggerEl = this.trigger().nativeElement;
|
|
1077
|
+
const width = triggerEl.getBoundingClientRect().width;
|
|
1078
|
+
const positionStrategy = this.overlay.position()
|
|
1079
|
+
.flexibleConnectedTo(triggerEl)
|
|
1080
|
+
.withPositions([
|
|
1081
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
1082
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
1083
|
+
]);
|
|
1084
|
+
const cfg = {
|
|
1085
|
+
positionStrategy,
|
|
1086
|
+
hasBackdrop: true,
|
|
1087
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
1088
|
+
// Global panel class — the portaled pane lives outside :host, so
|
|
1089
|
+
// styles live in styles/_dropdown-overlay.scss keyed off this class.
|
|
1090
|
+
panelClass: 'ds-dropdown-panel',
|
|
1091
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
1092
|
+
width,
|
|
1093
|
+
};
|
|
1094
|
+
this.overlayRef = this.overlay.create(cfg);
|
|
1095
|
+
this.overlayRef.backdropClick().subscribe(() => this.close());
|
|
1096
|
+
const portal = new TemplatePortal(this.panelTpl(), this.vcr);
|
|
1097
|
+
this.overlayRef.attach(portal);
|
|
1098
|
+
this.open.set(true);
|
|
1099
|
+
}
|
|
1100
|
+
close() {
|
|
1101
|
+
this.overlayRef?.dispose();
|
|
1102
|
+
this.overlayRef = null;
|
|
1103
|
+
this.open.set(false);
|
|
1104
|
+
this.activeIndex.set(-1);
|
|
1105
|
+
}
|
|
1106
|
+
pick(option) {
|
|
1107
|
+
if (option.disabled)
|
|
1108
|
+
return;
|
|
1109
|
+
this.value.set(option.value);
|
|
1110
|
+
this.close();
|
|
1111
|
+
this.trigger().nativeElement.focus();
|
|
1112
|
+
}
|
|
1113
|
+
isSelected(option) {
|
|
1114
|
+
return option.value === this.value();
|
|
1115
|
+
}
|
|
1116
|
+
onTriggerKeydown(event) {
|
|
1117
|
+
if (this.disabled() || this.readOnly() || this.preview.staticPreview())
|
|
1118
|
+
return;
|
|
1119
|
+
const key = event.key;
|
|
1120
|
+
if (!this.open()) {
|
|
1121
|
+
if (key === 'ArrowDown' || key === 'ArrowUp' || key === 'Enter' || key === ' ') {
|
|
1122
|
+
event.preventDefault();
|
|
1123
|
+
this.openPanel();
|
|
1124
|
+
}
|
|
1125
|
+
return;
|
|
1126
|
+
}
|
|
1127
|
+
if (key === 'Escape') {
|
|
1128
|
+
event.preventDefault();
|
|
1129
|
+
this.close();
|
|
1130
|
+
return;
|
|
1131
|
+
}
|
|
1132
|
+
if (key === 'ArrowDown') {
|
|
1133
|
+
event.preventDefault();
|
|
1134
|
+
this.moveActive(1);
|
|
1135
|
+
return;
|
|
1136
|
+
}
|
|
1137
|
+
if (key === 'ArrowUp') {
|
|
1138
|
+
event.preventDefault();
|
|
1139
|
+
this.moveActive(-1);
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1142
|
+
if (key === 'Enter' || key === ' ') {
|
|
1143
|
+
event.preventDefault();
|
|
1144
|
+
const idx = this.activeIndex();
|
|
1145
|
+
const opt = this.options()[idx];
|
|
1146
|
+
if (opt)
|
|
1147
|
+
this.pick(opt);
|
|
1148
|
+
return;
|
|
1149
|
+
}
|
|
1150
|
+
if (key === 'Home') {
|
|
1151
|
+
event.preventDefault();
|
|
1152
|
+
this.activeIndex.set(this.firstEnabledIndex());
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
if (key === 'End') {
|
|
1156
|
+
event.preventDefault();
|
|
1157
|
+
this.activeIndex.set(this.lastEnabledIndex());
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
isActive(index) {
|
|
1161
|
+
return this.activeIndex() === index;
|
|
1162
|
+
}
|
|
1163
|
+
moveActive(delta) {
|
|
1164
|
+
const opts = this.options();
|
|
1165
|
+
if (opts.length === 0)
|
|
1166
|
+
return;
|
|
1167
|
+
let next = this.activeIndex();
|
|
1168
|
+
for (let attempts = 0; attempts < opts.length; attempts++) {
|
|
1169
|
+
next = (next + delta + opts.length) % opts.length;
|
|
1170
|
+
const candidate = opts[next];
|
|
1171
|
+
if (candidate && !candidate.disabled) {
|
|
1172
|
+
this.activeIndex.set(next);
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
firstEnabledIndex() {
|
|
1178
|
+
const opts = this.options();
|
|
1179
|
+
for (let i = 0; i < opts.length; i++) {
|
|
1180
|
+
const candidate = opts[i];
|
|
1181
|
+
if (candidate && !candidate.disabled)
|
|
1182
|
+
return i;
|
|
1183
|
+
}
|
|
1184
|
+
return -1;
|
|
1185
|
+
}
|
|
1186
|
+
lastEnabledIndex() {
|
|
1187
|
+
const opts = this.options();
|
|
1188
|
+
for (let i = opts.length - 1; i >= 0; i--) {
|
|
1189
|
+
const candidate = opts[i];
|
|
1190
|
+
if (candidate && !candidate.disabled)
|
|
1191
|
+
return i;
|
|
1192
|
+
}
|
|
1193
|
+
return -1;
|
|
1194
|
+
}
|
|
1195
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1196
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: DropdownComponent, isStandalone: true, selector: "ds-dropdown", 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 }, 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 }, error: { classPropertyName: "error", publicName: "error", 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 } }, outputs: { value: "valueChange" }, 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 }], hostDirectives: [{ directive: DsStaticPreview, inputs: ["staticPreview", "staticPreview"] }], ngImport: i0, template: "@if (label()) {\r\n <span class=\"dropdown-label\" [id]=\"labelId\">{{ label() }}</span>\r\n}\r\n\r\n<button\r\n #trigger\r\n type=\"button\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [class]=\"wrapperClasses()\"\r\n [attr.name]=\"name()\"\r\n [attr.aria-expanded]=\"open() || preview.staticPreview()\"\r\n [attr.aria-controls]=\"listboxId\"\r\n [attr.aria-activedescendant]=\"activeDescendant()\"\r\n [attr.aria-labelledby]=\"label() ? labelId : null\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [attr.aria-invalid]=\"error() ? 'true' : null\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <span class=\"trigger-text\" [class.is-placeholder]=\"!hasValue()\">{{ displayLabel() }}</span>\r\n <span class=\"chevron\"><ds-icon name=\"chevronDown\" [size]=\"14\" /></span>\r\n</button>\r\n\r\n@if (preview.staticPreview()) {\r\n <div class=\"ds-dropdown-panel\">\r\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\r\n </div>\r\n}\r\n\r\n<ng-template #panel>\r\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\r\n</ng-template>\r\n\r\n<ng-template #panelContent>\r\n <div class=\"dropdown-panel\">\r\n <ul class=\"dropdown-list\" role=\"listbox\" [id]=\"listboxId\" [attr.aria-labelledby]=\"label() ? labelId : null\">\r\n @for (opt of options(); track opt.value; let i = $index) {\r\n <li role=\"presentation\">\r\n <button\r\n type=\"button\"\r\n role=\"option\"\r\n class=\"option\"\r\n [id]=\"optionId(i)\"\r\n [attr.aria-selected]=\"isSelected(opt)\"\r\n [attr.aria-disabled]=\"opt.disabled ? 'true' : null\"\r\n [class.is-selected]=\"isSelected(opt)\"\r\n [class.is-active]=\"isActive(i)\"\r\n [class.is-disabled]=\"opt.disabled\"\r\n [disabled]=\"opt.disabled\"\r\n (click)=\"pick(opt)\"\r\n (mouseenter)=\"activeIndex.set(i)\"\r\n >\r\n @if (opt.icon) {\r\n <ds-icon class=\"option-icon\" [name]=\"opt.icon\" [size]=\"16\" />\r\n }\r\n <span class=\"option-label\">{{ opt.label }}</span>\r\n @if (isSelected(opt)) {\r\n <ds-icon class=\"option-check\" name=\"check\" [size]=\"14\" />\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%}.dropdown-label{font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-secondary);display:flex;align-items:center;gap:var(--space-1);margin-bottom:var(--space-1-5)}.dropdown{display:flex;align-items:center;gap:var(--space-2);width:100%;background:var(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);padding:var(--field-pad-y) var(--field-pad-x);height:var(--hit-cozy);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);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:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown .trigger-text.is-placeholder{color:var(--text-tertiary)}.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(--primary);box-shadow:var(--focus-field)}.dropdown.open{border-color:var(--primary);box-shadow:var(--focus-field)}.dropdown.open .chevron{transform:rotate(180deg)}.dropdown.error{background:var(--error-subtle);border-color:var(--error)}.dropdown.error:focus-visible{box-shadow:var(--focus-field-error)}.dropdown.disabled,.dropdown:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed;opacity:var(--opacity-muted)}.dropdown.disabled .chevron,.dropdown:disabled .chevron{color:var(--icon-muted)}.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.sm{height:var(--hit-min);padding:0 var(--space-2)}.dropdown.lg{height:var(--field-h-lg)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1197
|
+
}
|
|
1198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
1199
|
+
type: Component,
|
|
1200
|
+
args: [{ selector: 'ds-dropdown', standalone: true, imports: [IconComponent, NgTemplateOutlet], encapsulation: ViewEncapsulation.Emulated, hostDirectives: [{ directive: DsStaticPreview, inputs: ['staticPreview'] }], template: "@if (label()) {\r\n <span class=\"dropdown-label\" [id]=\"labelId\">{{ label() }}</span>\r\n}\r\n\r\n<button\r\n #trigger\r\n type=\"button\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [class]=\"wrapperClasses()\"\r\n [attr.name]=\"name()\"\r\n [attr.aria-expanded]=\"open() || preview.staticPreview()\"\r\n [attr.aria-controls]=\"listboxId\"\r\n [attr.aria-activedescendant]=\"activeDescendant()\"\r\n [attr.aria-labelledby]=\"label() ? labelId : null\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [attr.aria-invalid]=\"error() ? 'true' : null\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <span class=\"trigger-text\" [class.is-placeholder]=\"!hasValue()\">{{ displayLabel() }}</span>\r\n <span class=\"chevron\"><ds-icon name=\"chevronDown\" [size]=\"14\" /></span>\r\n</button>\r\n\r\n@if (preview.staticPreview()) {\r\n <div class=\"ds-dropdown-panel\">\r\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\r\n </div>\r\n}\r\n\r\n<ng-template #panel>\r\n <ng-container [ngTemplateOutlet]=\"panelContentTpl()\" />\r\n</ng-template>\r\n\r\n<ng-template #panelContent>\r\n <div class=\"dropdown-panel\">\r\n <ul class=\"dropdown-list\" role=\"listbox\" [id]=\"listboxId\" [attr.aria-labelledby]=\"label() ? labelId : null\">\r\n @for (opt of options(); track opt.value; let i = $index) {\r\n <li role=\"presentation\">\r\n <button\r\n type=\"button\"\r\n role=\"option\"\r\n class=\"option\"\r\n [id]=\"optionId(i)\"\r\n [attr.aria-selected]=\"isSelected(opt)\"\r\n [attr.aria-disabled]=\"opt.disabled ? 'true' : null\"\r\n [class.is-selected]=\"isSelected(opt)\"\r\n [class.is-active]=\"isActive(i)\"\r\n [class.is-disabled]=\"opt.disabled\"\r\n [disabled]=\"opt.disabled\"\r\n (click)=\"pick(opt)\"\r\n (mouseenter)=\"activeIndex.set(i)\"\r\n >\r\n @if (opt.icon) {\r\n <ds-icon class=\"option-icon\" [name]=\"opt.icon\" [size]=\"16\" />\r\n }\r\n <span class=\"option-label\">{{ opt.label }}</span>\r\n @if (isSelected(opt)) {\r\n <ds-icon class=\"option-check\" name=\"check\" [size]=\"14\" />\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%}.dropdown-label{font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-secondary);display:flex;align-items:center;gap:var(--space-1);margin-bottom:var(--space-1-5)}.dropdown{display:flex;align-items:center;gap:var(--space-2);width:100%;background:var(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);padding:var(--field-pad-y) var(--field-pad-x);height:var(--hit-cozy);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary);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:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown .trigger-text.is-placeholder{color:var(--text-tertiary)}.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(--primary);box-shadow:var(--focus-field)}.dropdown.open{border-color:var(--primary);box-shadow:var(--focus-field)}.dropdown.open .chevron{transform:rotate(180deg)}.dropdown.error{background:var(--error-subtle);border-color:var(--error)}.dropdown.error:focus-visible{box-shadow:var(--focus-field-error)}.dropdown.disabled,.dropdown:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed;opacity:var(--opacity-muted)}.dropdown.disabled .chevron,.dropdown:disabled .chevron{color:var(--icon-muted)}.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.sm{height:var(--hit-min);padding:0 var(--space-2)}.dropdown.lg{height:var(--field-h-lg)}\n"] }]
|
|
1201
|
+
}], 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 }] }], 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 }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], panelContentTpl: [{ type: i0.ViewChild, args: ['panelContent', { isSignal: true }] }] } });
|
|
1202
|
+
|
|
1203
|
+
class SkeletonComponent {
|
|
1204
|
+
width = input(undefined, ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
1205
|
+
height = input(undefined, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
1206
|
+
circle = input(false, ...(ngDevMode ? [{ debugName: "circle" }] : /* istanbul ignore next */ []));
|
|
1207
|
+
inline = input(false, ...(ngDevMode ? [{ debugName: "inline" }] : /* istanbul ignore next */ []));
|
|
1208
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1209
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: SkeletonComponent, isStandalone: true, selector: "ds-skeleton", inputs: { width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, circle: { classPropertyName: "circle", publicName: "circle", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "style.width": "width()", "style.height": "height()", "class.circle": "circle()", "class.inline": "inline()" } }, ngImport: i0, template: '', isInline: true, styles: ["@charset \"UTF-8\";:host{display:block;position:relative;overflow:hidden;background:var(--surface-secondary);border-radius:var(--radius-md)}:host(.circle){border-radius:var(--radius-pill)}:host(.inline){display:inline-block;vertical-align:middle}:host:after{content:\"\";position:absolute;inset:0;background:var(--surface-muted);pointer-events:none;will-change:mask-position;-webkit-mask-image:linear-gradient(90deg,transparent 30%,#000 50%,transparent 70%);mask-image:linear-gradient(90deg,transparent 30%,#000 50%,transparent 70%);-webkit-mask-size:200vw 100%;mask-size:200vw 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-attachment:fixed;mask-attachment:fixed;-webkit-mask-position:var(--skeleton-shimmer-x, 100vw) 0;mask-position:var(--skeleton-shimmer-x, 100vw) 0}\n"] });
|
|
1210
|
+
}
|
|
1211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SkeletonComponent, decorators: [{
|
|
1212
|
+
type: Component,
|
|
1213
|
+
args: [{ selector: 'ds-skeleton', standalone: true, template: '', host: {
|
|
1214
|
+
'aria-hidden': 'true',
|
|
1215
|
+
'[style.width]': 'width()',
|
|
1216
|
+
'[style.height]': 'height()',
|
|
1217
|
+
'[class.circle]': 'circle()',
|
|
1218
|
+
'[class.inline]': 'inline()',
|
|
1219
|
+
}, encapsulation: ViewEncapsulation.Emulated, styles: ["@charset \"UTF-8\";:host{display:block;position:relative;overflow:hidden;background:var(--surface-secondary);border-radius:var(--radius-md)}:host(.circle){border-radius:var(--radius-pill)}:host(.inline){display:inline-block;vertical-align:middle}:host:after{content:\"\";position:absolute;inset:0;background:var(--surface-muted);pointer-events:none;will-change:mask-position;-webkit-mask-image:linear-gradient(90deg,transparent 30%,#000 50%,transparent 70%);mask-image:linear-gradient(90deg,transparent 30%,#000 50%,transparent 70%);-webkit-mask-size:200vw 100%;mask-size:200vw 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-attachment:fixed;mask-attachment:fixed;-webkit-mask-position:var(--skeleton-shimmer-x, 100vw) 0;mask-position:var(--skeleton-shimmer-x, 100vw) 0}\n"] }]
|
|
1220
|
+
}], propDecorators: { width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], circle: [{ type: i0.Input, args: [{ isSignal: true, alias: "circle", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }] } });
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* Projects a custom cell template into <ds-table> for a specific column.
|
|
1224
|
+
*
|
|
1225
|
+
* Usage:
|
|
1226
|
+
* <ds-table [data]="rows" [columns]="cols">
|
|
1227
|
+
* <ng-template dsCellTemplate="product" let-row>
|
|
1228
|
+
* <div>{{ asRule(row).product }}</div>
|
|
1229
|
+
* </ng-template>
|
|
1230
|
+
* </ds-table>
|
|
1231
|
+
*
|
|
1232
|
+
* The template context type is `unknown` because Angular cannot propagate
|
|
1233
|
+
* the parent <ds-table>'s row type to projected templates. Consumers should
|
|
1234
|
+
* narrow the row with a typed helper method on the host component.
|
|
1235
|
+
*
|
|
1236
|
+
* Context shape:
|
|
1237
|
+
* - $implicit: the row object (typed `unknown`)
|
|
1238
|
+
* - row: alias for the row object (typed `unknown`)
|
|
1239
|
+
*/
|
|
1240
|
+
class CellTemplateDirective {
|
|
1241
|
+
dsCellTemplate = input.required(...(ngDevMode ? [{ debugName: "dsCellTemplate" }] : /* istanbul ignore next */ []));
|
|
1242
|
+
template = inject((TemplateRef));
|
|
1243
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: CellTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1244
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: CellTemplateDirective, isStandalone: true, selector: "[dsCellTemplate]", inputs: { dsCellTemplate: { classPropertyName: "dsCellTemplate", publicName: "dsCellTemplate", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
1245
|
+
}
|
|
1246
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: CellTemplateDirective, decorators: [{
|
|
1247
|
+
type: Directive,
|
|
1248
|
+
args: [{
|
|
1249
|
+
selector: '[dsCellTemplate]',
|
|
1250
|
+
standalone: true,
|
|
1251
|
+
}]
|
|
1252
|
+
}], propDecorators: { dsCellTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsCellTemplate", required: true }] }] } });
|
|
1253
|
+
|
|
1254
|
+
class TableComponent {
|
|
1255
|
+
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
1256
|
+
columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
1257
|
+
selectable = input(false, ...(ngDevMode ? [{ debugName: "selectable" }] : /* istanbul ignore next */ []));
|
|
1258
|
+
/** Opt-in outer border + radius. Off by default so tables flush inside a
|
|
1259
|
+
* `<ds-card padding="none">` (workspaces, programs-list) don't double-border.
|
|
1260
|
+
* When `true`, the scroll-wrap gets a `var(--border-default)` outline and
|
|
1261
|
+
* `var(--radius-md)` radius — useful when the table stands alone in a padded card. */
|
|
1262
|
+
bordered = input(false, ...(ngDevMode ? [{ debugName: "bordered" }] : /* istanbul ignore next */ []));
|
|
1263
|
+
/** false — no loading state.
|
|
1264
|
+
* 'skeleton' — first-load placeholder; rows are replaced with shimmer
|
|
1265
|
+
* rows that read the global --skeleton-shimmer-x driver.
|
|
1266
|
+
* 'overlay' — re-fetch indicator; existing rows stay visible behind
|
|
1267
|
+
* a translucent overlay with a centred spinner. */
|
|
1268
|
+
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
1269
|
+
stickyHeader = input(true, ...(ngDevMode ? [{ debugName: "stickyHeader" }] : /* istanbul ignore next */ []));
|
|
1270
|
+
selectedIds = model(new Set(), ...(ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []));
|
|
1271
|
+
sortKey = model(null, ...(ngDevMode ? [{ debugName: "sortKey" }] : /* istanbul ignore next */ []));
|
|
1272
|
+
sortDir = model(null, ...(ngDevMode ? [{ debugName: "sortDir" }] : /* istanbul ignore next */ []));
|
|
1273
|
+
skeletonRows = input(5, ...(ngDevMode ? [{ debugName: "skeletonRows" }] : /* istanbul ignore next */ []));
|
|
1274
|
+
/** Accessible name for the table (rendered as a visually-hidden caption).
|
|
1275
|
+
* Without it, screen-reader users get an unlabelled table. */
|
|
1276
|
+
caption = input('', ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
1277
|
+
/** When true, each row becomes a keyboard-operable control (role=button,
|
|
1278
|
+
* tabindex, Enter/Space → rowClick) with an accessible name from the first
|
|
1279
|
+
* column. Off by default so non-navigating tables don't advertise a false
|
|
1280
|
+
* click affordance. */
|
|
1281
|
+
rowInteractive = input(false, ...(ngDevMode ? [{ debugName: "rowInteractive" }] : /* istanbul ignore next */ []));
|
|
1282
|
+
rowClick = output();
|
|
1283
|
+
sortChange = output();
|
|
1284
|
+
/** Cell templates supplied as an explicit map instead of (or in addition to)
|
|
1285
|
+
* projected `dsCellTemplate` directives. Lets a wrapper component (e.g.
|
|
1286
|
+
* ids-data-table) collect the directives itself and pass them down, since
|
|
1287
|
+
* content projected through a wrapper's `<ng-content>` is not seen by this
|
|
1288
|
+
* component's content query. Entries here override projected ones. */
|
|
1289
|
+
cellTemplateMap = input({}, ...(ngDevMode ? [{ debugName: "cellTemplateMap" }] : /* istanbul ignore next */ []));
|
|
1290
|
+
/** Empty-state template, as an alternative to the `[empty]` content slot —
|
|
1291
|
+
* again for wrappers that can't rely on slot re-projection. */
|
|
1292
|
+
emptyTemplate = input(null, ...(ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []));
|
|
1293
|
+
cellTemplateDirectives = contentChildren(CellTemplateDirective, ...(ngDevMode ? [{ debugName: "cellTemplateDirectives" }] : /* istanbul ignore next */ []));
|
|
1294
|
+
cellTemplates = computed(() => {
|
|
1295
|
+
const map = {};
|
|
1296
|
+
for (const dir of this.cellTemplateDirectives()) {
|
|
1297
|
+
map[dir.dsCellTemplate()] = dir.template;
|
|
1298
|
+
}
|
|
1299
|
+
return { ...map, ...this.cellTemplateMap() };
|
|
1300
|
+
}, ...(ngDevMode ? [{ debugName: "cellTemplates" }] : /* istanbul ignore next */ []));
|
|
1301
|
+
cellTemplate(col) {
|
|
1302
|
+
return this.cellTemplates()[col.key] ?? null;
|
|
1303
|
+
}
|
|
1304
|
+
tableClasses = computed(() => {
|
|
1305
|
+
const parts = ['table'];
|
|
1306
|
+
if (this.loading() === 'skeleton')
|
|
1307
|
+
parts.push('skeleton-mode');
|
|
1308
|
+
return parts.join(' ');
|
|
1309
|
+
}, ...(ngDevMode ? [{ debugName: "tableClasses" }] : /* istanbul ignore next */ []));
|
|
1310
|
+
isSkeletonLoading = computed(() => this.loading() === 'skeleton', ...(ngDevMode ? [{ debugName: "isSkeletonLoading" }] : /* istanbul ignore next */ []));
|
|
1311
|
+
isOverlayLoading = computed(() => this.loading() === 'overlay', ...(ngDevMode ? [{ debugName: "isOverlayLoading" }] : /* istanbul ignore next */ []));
|
|
1312
|
+
allSelected = computed(() => {
|
|
1313
|
+
const data = this.data();
|
|
1314
|
+
if (data.length === 0)
|
|
1315
|
+
return false;
|
|
1316
|
+
const sel = this.selectedIds();
|
|
1317
|
+
return data.every((row) => sel.has(row.id));
|
|
1318
|
+
}, ...(ngDevMode ? [{ debugName: "allSelected" }] : /* istanbul ignore next */ []));
|
|
1319
|
+
someSelected = computed(() => {
|
|
1320
|
+
const data = this.data();
|
|
1321
|
+
const sel = this.selectedIds();
|
|
1322
|
+
return data.some((row) => sel.has(row.id)) && !this.allSelected();
|
|
1323
|
+
}, ...(ngDevMode ? [{ debugName: "someSelected" }] : /* istanbul ignore next */ []));
|
|
1324
|
+
skeletonArray = computed(() => Array(this.skeletonRows()).fill(0), ...(ngDevMode ? [{ debugName: "skeletonArray" }] : /* istanbul ignore next */ []));
|
|
1325
|
+
isSelected(row) {
|
|
1326
|
+
return this.selectedIds().has(row.id);
|
|
1327
|
+
}
|
|
1328
|
+
onToggleAll(event) {
|
|
1329
|
+
const checked = event.target.checked;
|
|
1330
|
+
const next = new Set(this.selectedIds());
|
|
1331
|
+
if (checked) {
|
|
1332
|
+
this.data().forEach((row) => next.add(row.id));
|
|
1333
|
+
}
|
|
1334
|
+
else {
|
|
1335
|
+
this.data().forEach((row) => next.delete(row.id));
|
|
1336
|
+
}
|
|
1337
|
+
this.selectedIds.set(next);
|
|
1338
|
+
}
|
|
1339
|
+
onToggleRow(row, event) {
|
|
1340
|
+
event.stopPropagation();
|
|
1341
|
+
const checked = event.target.checked;
|
|
1342
|
+
const next = new Set(this.selectedIds());
|
|
1343
|
+
if (checked) {
|
|
1344
|
+
next.add(row.id);
|
|
1345
|
+
}
|
|
1346
|
+
else {
|
|
1347
|
+
next.delete(row.id);
|
|
1348
|
+
}
|
|
1349
|
+
this.selectedIds.set(next);
|
|
1350
|
+
}
|
|
1351
|
+
onRowClick(row, event) {
|
|
1352
|
+
if (event.target.closest('input'))
|
|
1353
|
+
return;
|
|
1354
|
+
this.rowClick.emit(row);
|
|
1355
|
+
}
|
|
1356
|
+
onRowKey(row, event) {
|
|
1357
|
+
if (!this.rowInteractive())
|
|
1358
|
+
return;
|
|
1359
|
+
event.preventDefault();
|
|
1360
|
+
this.rowClick.emit(row);
|
|
1361
|
+
}
|
|
1362
|
+
/** Accessible name for an interactive row, taken from the first column. */
|
|
1363
|
+
rowAriaLabel(row) {
|
|
1364
|
+
const first = this.columns()[0];
|
|
1365
|
+
return first ? this.cellValue(row, first) : '';
|
|
1366
|
+
}
|
|
1367
|
+
/** `aria-sort` value for a header: only meaningful on sortable columns. */
|
|
1368
|
+
ariaSort(col) {
|
|
1369
|
+
if (!col.sortable)
|
|
1370
|
+
return null;
|
|
1371
|
+
if (this.sortKey() === col.key && this.sortDir()) {
|
|
1372
|
+
return this.sortDir() === 'asc' ? 'ascending' : 'descending';
|
|
1373
|
+
}
|
|
1374
|
+
return 'none';
|
|
1375
|
+
}
|
|
1376
|
+
onSort(col) {
|
|
1377
|
+
if (!col.sortable)
|
|
1378
|
+
return;
|
|
1379
|
+
const currentKey = this.sortKey();
|
|
1380
|
+
const currentDir = this.sortDir();
|
|
1381
|
+
let dir;
|
|
1382
|
+
if (currentKey !== col.key) {
|
|
1383
|
+
dir = 'asc';
|
|
1384
|
+
}
|
|
1385
|
+
else if (currentDir === 'asc') {
|
|
1386
|
+
dir = 'desc';
|
|
1387
|
+
}
|
|
1388
|
+
else if (currentDir === 'desc') {
|
|
1389
|
+
dir = null;
|
|
1390
|
+
}
|
|
1391
|
+
else {
|
|
1392
|
+
dir = 'asc';
|
|
1393
|
+
}
|
|
1394
|
+
this.sortKey.set(dir ? col.key : null);
|
|
1395
|
+
this.sortDir.set(dir);
|
|
1396
|
+
this.sortChange.emit({ key: col.key, dir });
|
|
1397
|
+
}
|
|
1398
|
+
headerClasses(col) {
|
|
1399
|
+
const parts = [];
|
|
1400
|
+
if (col.sortable)
|
|
1401
|
+
parts.push('sortable');
|
|
1402
|
+
if (this.sortKey() === col.key && this.sortDir()) {
|
|
1403
|
+
parts.push(`sorted-${this.sortDir()}`);
|
|
1404
|
+
}
|
|
1405
|
+
return parts.join(' ');
|
|
1406
|
+
}
|
|
1407
|
+
sortIcon(col) {
|
|
1408
|
+
if (this.sortKey() !== col.key || !this.sortDir())
|
|
1409
|
+
return 'sort';
|
|
1410
|
+
return this.sortDir() === 'asc' ? 'sortAsc' : 'sortDesc';
|
|
1411
|
+
}
|
|
1412
|
+
cellValue(row, col) {
|
|
1413
|
+
if (col.cell)
|
|
1414
|
+
return col.cell(row);
|
|
1415
|
+
return String(row[col.key] ?? '');
|
|
1416
|
+
}
|
|
1417
|
+
/** Deterministic per-cell width so skeleton rows look organic but stable
|
|
1418
|
+
* across re-renders. Mixes column key + row index into one of five widths. */
|
|
1419
|
+
skeletonWidth(col, rowIndex) {
|
|
1420
|
+
const seed = `${col.key}-${rowIndex}`;
|
|
1421
|
+
let hash = 0;
|
|
1422
|
+
for (let charIndex = 0; charIndex < seed.length; charIndex++) {
|
|
1423
|
+
hash = (hash + seed.charCodeAt(charIndex)) | 0;
|
|
1424
|
+
}
|
|
1425
|
+
const widths = ['45%', '55%', '65%', '75%', '85%'];
|
|
1426
|
+
return widths[Math.abs(hash) % widths.length] ?? '70%';
|
|
1427
|
+
}
|
|
1428
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1429
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: TableComponent, isStandalone: true, selector: "ds-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, 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 }, 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 }, 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 }, cellTemplateMap: { classPropertyName: "cellTemplateMap", publicName: "cellTemplateMap", isSignal: true, isRequired: false, transformFunction: null }, emptyTemplate: { classPropertyName: "emptyTemplate", publicName: "emptyTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIds: "selectedIdsChange", sortKey: "sortKeyChange", sortDir: "sortDirChange", rowClick: "rowClick", sortChange: "sortChange" }, host: { properties: { "class.bordered": "bordered()" } }, queries: [{ propertyName: "cellTemplateDirectives", predicate: CellTemplateDirective, isSignal: true }], ngImport: i0, template: "<div class=\"scroll-wrap\" [class.loading-overlay]=\"isOverlayLoading()\">\r\n @if (isOverlayLoading()) {\r\n <div class=\"overlay\" aria-hidden=\"true\">\r\n <span class=\"spinner\"></span>\r\n </div>\r\n }\r\n <div class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">\r\n @if (loading() !== false) { Loading\u2026 }\r\n </div>\r\n <table [class]=\"tableClasses()\" [attr.role]=\"rowInteractive() ? 'grid' : null\" [attr.aria-busy]=\"loading() !== false ? 'true' : null\">\r\n @if (caption()) {\r\n <caption class=\"visually-hidden\">{{ caption() }}</caption>\r\n }\r\n <thead>\r\n <tr>\r\n @if (selectable()) {\r\n <th scope=\"col\" class=\"select-col\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"check\"\r\n aria-label=\"Select all rows\"\r\n [checked]=\"allSelected()\"\r\n [indeterminate]=\"someSelected()\"\r\n (change)=\"onToggleAll($event)\"\r\n />\r\n </th>\r\n }\r\n @for (col of columns(); track col.key) {\r\n <th\r\n scope=\"col\"\r\n [class]=\"headerClasses(col)\"\r\n [class.numeric]=\"col.align === 'right'\"\r\n [attr.aria-sort]=\"ariaSort(col)\"\r\n >\r\n @if (col.sortable) {\r\n <button type=\"button\" class=\"th-label\" (click)=\"onSort(col)\">\r\n {{ col.label }}\r\n <ds-icon class=\"sort-icon\" [name]=\"sortIcon(col)\" [size]=\"12\"></ds-icon>\r\n </button>\r\n } @else {\r\n <span class=\"th-label\">{{ col.label }}</span>\r\n }\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @if (isSkeletonLoading()) {\r\n @for (_ of skeletonArray(); track $index; let rowIndex = $index) {\r\n <tr>\r\n @if (selectable()) {\r\n <td><ds-skeleton width=\"14px\" height=\"14px\" [inline]=\"true\" /></td>\r\n }\r\n @for (col of columns(); track col.key) {\r\n <td [class.numeric]=\"col.align === 'right'\">\r\n <ds-skeleton [width]=\"skeletonWidth(col, rowIndex)\" height=\"14px\" [inline]=\"true\" />\r\n </td>\r\n }\r\n </tr>\r\n }\r\n } @else if (!data().length) {\r\n <tr>\r\n <td\r\n [attr.colspan]=\"columns().length + (selectable() ? 1 : 0)\"\r\n class=\"empty\"\r\n >\r\n @if (emptyTemplate()) {\r\n <ng-container [ngTemplateOutlet]=\"emptyTemplate()!\"></ng-container>\r\n } @else {\r\n <ng-content select=\"[empty]\"></ng-content>\r\n }\r\n </td>\r\n </tr>\r\n } @else {\r\n @for (row of data(); track row.id) {\r\n <tr\r\n [class.selected]=\"isSelected(row)\"\r\n [class.clickable]=\"rowInteractive()\"\r\n [attr.tabindex]=\"rowInteractive() ? 0 : null\"\r\n [attr.aria-label]=\"rowInteractive() ? rowAriaLabel(row) : null\"\r\n (click)=\"onRowClick(row, $event)\"\r\n (keydown.enter)=\"onRowKey(row, $event)\"\r\n (keydown.space)=\"onRowKey(row, $event)\"\r\n >\r\n @if (selectable()) {\r\n <td>\r\n <input\r\n type=\"checkbox\"\r\n class=\"check\"\r\n [attr.aria-label]=\"'Select ' + rowAriaLabel(row)\"\r\n [checked]=\"isSelected(row)\"\r\n (change)=\"onToggleRow(row, $event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n />\r\n </td>\r\n }\r\n @for (col of columns(); track col.key) {\r\n <td [class.numeric]=\"col.align === 'right'\">\r\n @if (cellTemplate(col); as tpl) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"tpl\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row, row: row }\"\r\n ></ng-container>\r\n } @else {\r\n {{ cellValue(row, col) }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n</div>\r\n@if (selectable() && someSelected()) {\r\n <div class=\"bulk-bar\">\r\n <span class=\"count\">{{ selectedIds().size }} selected</span>\r\n <span class=\"sep\"></span>\r\n <ng-content select=\"[bulk-actions]\"></ng-content>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);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(--radius-md));--_table-bg: var(--ds-table-bg, var(--surface-default));width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;background:var(--surface-default);box-sizing:border-box}.scroll-wrap.loading-overlay{position:relative}.scroll-wrap .overlay{position:absolute;inset:var(--ds-table-head-h, 40px) 0 0 0;z-index:var(--layer-popover, 30);display:grid;place-items:center;background:#fff9;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);pointer-events:all}.scroll-wrap .spinner{width:var(--spinner-md, 24px);height:var(--spinner-md, 24px);border:var(--border-width-strong, 2px) solid var(--border-default);border-top-color:var(--primary);border-radius:var(--radius-pill);animation:ds-table-overlay-spin var(--duration-loop-fast, .7s) linear infinite}@keyframes ds-table-overlay-spin{to{transform:rotate(360deg)}}.table{--_table-bg: var(--ds-table-bg, var(--surface-default));--_table-row-hover-bg: var(--ds-table-row-hover-bg, var(--surface-secondary));--_table-row-selected-bg: var(--ds-table-row-selected-bg, var(--primary-subtle));--_table-head-fg: var(--ds-table-head-fg, var(--text-secondary));--_table-head-bg: var(--ds-table-head-bg, 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-fg: var(--ds-table-sort-active-fg, var(--primary));--_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));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:var(--_table-bg)}.table thead th{text-align:left;padding:var(--table-head-pad-y) var(--_table-cell-pad-x);font:var(--font-weight-bold) var(--_table-head-fs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wider);text-transform:uppercase;color:var(--_table-head-fg);background:var(--_table-head-bg);border-bottom:var(--border-width-default) solid var(--_table-divider);white-space:nowrap;position:sticky;top:0;z-index:var(--table-sticky-header-z)}.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}.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(--primary);outline-offset:2px;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:.4}.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-fg)}.table thead th.numeric{text-align:right}.table thead th.select-col{width:var(--space-10)}.table tbody td{padding:var(--_table-cell-pad-y) var(--_table-cell-pad-x);line-height:var(--line-height-flat);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:hover td{background:var(--_table-row-hover-bg)}.table tbody tr.selected td{background:var(--_table-row-selected-bg)}.table tbody tr.clickable{cursor:pointer}.table tbody tr.clickable:focus-visible{outline:var(--border-width-strong, 2px) solid var(--primary);outline-offset:-2px}.table.compact tbody td,.table.compact thead th{padding:var(--space-2) var(--space-3)}.table.skeleton-mode tbody tr:hover td{background:transparent;cursor:default}.table.skeleton-mode tbody tr.clickable{cursor:default}.table.sticky-col tbody td:first-child,.table.sticky-col thead th:first-child{position:sticky;left:0;background:inherit;z-index:var(--table-sticky-col-z)}.table.sticky-col thead th:first-child{z-index:var(--table-sticky-corner-z)}.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)}\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: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }] });
|
|
1430
|
+
}
|
|
1431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TableComponent, decorators: [{
|
|
1432
|
+
type: Component,
|
|
1433
|
+
args: [{ selector: 'ds-table', standalone: true, imports: [IconComponent, NgTemplateOutlet, SkeletonComponent], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
1434
|
+
'[class.bordered]': 'bordered()',
|
|
1435
|
+
}, template: "<div class=\"scroll-wrap\" [class.loading-overlay]=\"isOverlayLoading()\">\r\n @if (isOverlayLoading()) {\r\n <div class=\"overlay\" aria-hidden=\"true\">\r\n <span class=\"spinner\"></span>\r\n </div>\r\n }\r\n <div class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">\r\n @if (loading() !== false) { Loading\u2026 }\r\n </div>\r\n <table [class]=\"tableClasses()\" [attr.role]=\"rowInteractive() ? 'grid' : null\" [attr.aria-busy]=\"loading() !== false ? 'true' : null\">\r\n @if (caption()) {\r\n <caption class=\"visually-hidden\">{{ caption() }}</caption>\r\n }\r\n <thead>\r\n <tr>\r\n @if (selectable()) {\r\n <th scope=\"col\" class=\"select-col\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"check\"\r\n aria-label=\"Select all rows\"\r\n [checked]=\"allSelected()\"\r\n [indeterminate]=\"someSelected()\"\r\n (change)=\"onToggleAll($event)\"\r\n />\r\n </th>\r\n }\r\n @for (col of columns(); track col.key) {\r\n <th\r\n scope=\"col\"\r\n [class]=\"headerClasses(col)\"\r\n [class.numeric]=\"col.align === 'right'\"\r\n [attr.aria-sort]=\"ariaSort(col)\"\r\n >\r\n @if (col.sortable) {\r\n <button type=\"button\" class=\"th-label\" (click)=\"onSort(col)\">\r\n {{ col.label }}\r\n <ds-icon class=\"sort-icon\" [name]=\"sortIcon(col)\" [size]=\"12\"></ds-icon>\r\n </button>\r\n } @else {\r\n <span class=\"th-label\">{{ col.label }}</span>\r\n }\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @if (isSkeletonLoading()) {\r\n @for (_ of skeletonArray(); track $index; let rowIndex = $index) {\r\n <tr>\r\n @if (selectable()) {\r\n <td><ds-skeleton width=\"14px\" height=\"14px\" [inline]=\"true\" /></td>\r\n }\r\n @for (col of columns(); track col.key) {\r\n <td [class.numeric]=\"col.align === 'right'\">\r\n <ds-skeleton [width]=\"skeletonWidth(col, rowIndex)\" height=\"14px\" [inline]=\"true\" />\r\n </td>\r\n }\r\n </tr>\r\n }\r\n } @else if (!data().length) {\r\n <tr>\r\n <td\r\n [attr.colspan]=\"columns().length + (selectable() ? 1 : 0)\"\r\n class=\"empty\"\r\n >\r\n @if (emptyTemplate()) {\r\n <ng-container [ngTemplateOutlet]=\"emptyTemplate()!\"></ng-container>\r\n } @else {\r\n <ng-content select=\"[empty]\"></ng-content>\r\n }\r\n </td>\r\n </tr>\r\n } @else {\r\n @for (row of data(); track row.id) {\r\n <tr\r\n [class.selected]=\"isSelected(row)\"\r\n [class.clickable]=\"rowInteractive()\"\r\n [attr.tabindex]=\"rowInteractive() ? 0 : null\"\r\n [attr.aria-label]=\"rowInteractive() ? rowAriaLabel(row) : null\"\r\n (click)=\"onRowClick(row, $event)\"\r\n (keydown.enter)=\"onRowKey(row, $event)\"\r\n (keydown.space)=\"onRowKey(row, $event)\"\r\n >\r\n @if (selectable()) {\r\n <td>\r\n <input\r\n type=\"checkbox\"\r\n class=\"check\"\r\n [attr.aria-label]=\"'Select ' + rowAriaLabel(row)\"\r\n [checked]=\"isSelected(row)\"\r\n (change)=\"onToggleRow(row, $event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n />\r\n </td>\r\n }\r\n @for (col of columns(); track col.key) {\r\n <td [class.numeric]=\"col.align === 'right'\">\r\n @if (cellTemplate(col); as tpl) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"tpl\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row, row: row }\"\r\n ></ng-container>\r\n } @else {\r\n {{ cellValue(row, col) }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n</div>\r\n@if (selectable() && someSelected()) {\r\n <div class=\"bulk-bar\">\r\n <span class=\"count\">{{ selectedIds().size }} selected</span>\r\n <span class=\"sep\"></span>\r\n <ng-content select=\"[bulk-actions]\"></ng-content>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);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(--radius-md));--_table-bg: var(--ds-table-bg, var(--surface-default));width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;background:var(--surface-default);box-sizing:border-box}.scroll-wrap.loading-overlay{position:relative}.scroll-wrap .overlay{position:absolute;inset:var(--ds-table-head-h, 40px) 0 0 0;z-index:var(--layer-popover, 30);display:grid;place-items:center;background:#fff9;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);pointer-events:all}.scroll-wrap .spinner{width:var(--spinner-md, 24px);height:var(--spinner-md, 24px);border:var(--border-width-strong, 2px) solid var(--border-default);border-top-color:var(--primary);border-radius:var(--radius-pill);animation:ds-table-overlay-spin var(--duration-loop-fast, .7s) linear infinite}@keyframes ds-table-overlay-spin{to{transform:rotate(360deg)}}.table{--_table-bg: var(--ds-table-bg, var(--surface-default));--_table-row-hover-bg: var(--ds-table-row-hover-bg, var(--surface-secondary));--_table-row-selected-bg: var(--ds-table-row-selected-bg, var(--primary-subtle));--_table-head-fg: var(--ds-table-head-fg, var(--text-secondary));--_table-head-bg: var(--ds-table-head-bg, 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-fg: var(--ds-table-sort-active-fg, var(--primary));--_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));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:var(--_table-bg)}.table thead th{text-align:left;padding:var(--table-head-pad-y) var(--_table-cell-pad-x);font:var(--font-weight-bold) var(--_table-head-fs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wider);text-transform:uppercase;color:var(--_table-head-fg);background:var(--_table-head-bg);border-bottom:var(--border-width-default) solid var(--_table-divider);white-space:nowrap;position:sticky;top:0;z-index:var(--table-sticky-header-z)}.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}.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(--primary);outline-offset:2px;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:.4}.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-fg)}.table thead th.numeric{text-align:right}.table thead th.select-col{width:var(--space-10)}.table tbody td{padding:var(--_table-cell-pad-y) var(--_table-cell-pad-x);line-height:var(--line-height-flat);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:hover td{background:var(--_table-row-hover-bg)}.table tbody tr.selected td{background:var(--_table-row-selected-bg)}.table tbody tr.clickable{cursor:pointer}.table tbody tr.clickable:focus-visible{outline:var(--border-width-strong, 2px) solid var(--primary);outline-offset:-2px}.table.compact tbody td,.table.compact thead th{padding:var(--space-2) var(--space-3)}.table.skeleton-mode tbody tr:hover td{background:transparent;cursor:default}.table.skeleton-mode tbody tr.clickable{cursor:default}.table.sticky-col tbody td:first-child,.table.sticky-col thead th:first-child{position:sticky;left:0;background:inherit;z-index:var(--table-sticky-col-z)}.table.sticky-col thead th:first-child{z-index:var(--table-sticky-corner-z)}.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)}\n"] }]
|
|
1436
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], 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 }] }], 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 }] }, { type: i0.Output, args: ["sortKeyChange"] }], sortDir: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDir", required: false }] }, { type: i0.Output, args: ["sortDirChange"] }], 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 }] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], cellTemplateMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellTemplateMap", required: false }] }], emptyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTemplate", required: false }] }], cellTemplateDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CellTemplateDirective), { isSignal: true }] }] } });
|
|
1437
|
+
|
|
1438
|
+
class PaginationComponent {
|
|
1439
|
+
total = input.required(...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
1440
|
+
pageSize = model(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
1441
|
+
currentPage = model(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []));
|
|
1442
|
+
pageSizeOptions = input([10, 25, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : /* istanbul ignore next */ []));
|
|
1443
|
+
showLabel = input(true, ...(ngDevMode ? [{ debugName: "showLabel" }] : /* istanbul ignore next */ []));
|
|
1444
|
+
pageChange = output();
|
|
1445
|
+
pageSizeChange = output();
|
|
1446
|
+
totalPages = computed(() => Math.max(1, Math.ceil(this.total() / this.pageSize())), ...(ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []));
|
|
1447
|
+
pageItems = computed(() => {
|
|
1448
|
+
const total = this.totalPages();
|
|
1449
|
+
const current = this.currentPage();
|
|
1450
|
+
if (total <= 7) {
|
|
1451
|
+
return Array.from({ length: total }, (_, i) => i + 1);
|
|
1452
|
+
}
|
|
1453
|
+
const items = [1];
|
|
1454
|
+
if (current > 3)
|
|
1455
|
+
items.push('ellipsis');
|
|
1456
|
+
const start = Math.max(2, current - 1);
|
|
1457
|
+
const end = Math.min(total - 1, current + 1);
|
|
1458
|
+
for (let i = start; i <= end; i++)
|
|
1459
|
+
items.push(i);
|
|
1460
|
+
if (current < total - 2)
|
|
1461
|
+
items.push('ellipsis');
|
|
1462
|
+
items.push(total);
|
|
1463
|
+
return items;
|
|
1464
|
+
}, ...(ngDevMode ? [{ debugName: "pageItems" }] : /* istanbul ignore next */ []));
|
|
1465
|
+
rangeLabel = computed(() => {
|
|
1466
|
+
const start = (this.currentPage() - 1) * this.pageSize() + 1;
|
|
1467
|
+
const end = Math.min(this.currentPage() * this.pageSize(), this.total());
|
|
1468
|
+
return `Showing ${start}–${end} of ${this.total()}`;
|
|
1469
|
+
}, ...(ngDevMode ? [{ debugName: "rangeLabel" }] : /* istanbul ignore next */ []));
|
|
1470
|
+
sizeOptions = computed(() => {
|
|
1471
|
+
const presets = this.pageSizeOptions();
|
|
1472
|
+
const current = this.pageSize();
|
|
1473
|
+
const merged = presets.includes(current) ? presets : [current, ...presets].sort((a, b) => a - b);
|
|
1474
|
+
return merged.map((n) => ({ label: `${n} per page`, value: String(n) }));
|
|
1475
|
+
}, ...(ngDevMode ? [{ debugName: "sizeOptions" }] : /* istanbul ignore next */ []));
|
|
1476
|
+
pageSizeStr = computed(() => String(this.pageSize()), ...(ngDevMode ? [{ debugName: "pageSizeStr" }] : /* istanbul ignore next */ []));
|
|
1477
|
+
goTo(page) {
|
|
1478
|
+
if (page < 1 || page > this.totalPages() || page === this.currentPage())
|
|
1479
|
+
return;
|
|
1480
|
+
this.currentPage.set(page);
|
|
1481
|
+
this.pageChange.emit(page);
|
|
1482
|
+
}
|
|
1483
|
+
onSizeChange(value) {
|
|
1484
|
+
const next = Number(value);
|
|
1485
|
+
this.pageSize.set(next);
|
|
1486
|
+
this.currentPage.set(1);
|
|
1487
|
+
this.pageSizeChange.emit(next);
|
|
1488
|
+
this.pageChange.emit(1);
|
|
1489
|
+
}
|
|
1490
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1491
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", 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 } }, outputs: { pageSize: "pageSizeChange", currentPage: "currentPageChange", pageChange: "pageChange", pageSizeChange: "pageSizeChange" }, ngImport: i0, template: "<nav class=\"pagination\" aria-label=\"Pagination\">\r\n @if (showLabel()) {\r\n <span class=\"label\">{{ rangeLabel() }}</span>\r\n }\r\n <button class=\"pagination-button\" type=\"button\" aria-label=\"Previous page\" [disabled]=\"currentPage() === 1\" (click)=\"goTo(currentPage() - 1)\">\r\n <ds-icon name=\"chevronLeft\" [size]=\"14\"></ds-icon>\r\n </button>\r\n @for (item of pageItems(); track $index) {\r\n @if (item === 'ellipsis') {\r\n <span class=\"ellipsis\" aria-hidden=\"true\">\u2026</span>\r\n } @else {\r\n <button\r\n class=\"pagination-button\"\r\n type=\"button\"\r\n [class.active]=\"item === currentPage()\"\r\n [attr.aria-label]=\"'Page ' + item\"\r\n [attr.aria-current]=\"item === currentPage() ? 'page' : null\"\r\n (click)=\"goTo(item)\"\r\n >{{ item }}</button>\r\n }\r\n }\r\n <button class=\"pagination-button\" type=\"button\" aria-label=\"Next page\" [disabled]=\"currentPage() === totalPages()\" (click)=\"goTo(currentPage() + 1)\">\r\n <ds-icon name=\"chevronRight\" [size]=\"14\"></ds-icon>\r\n </button>\r\n <ds-select\r\n class=\"size\"\r\n ariaLabel=\"Rows per page\"\r\n [options]=\"sizeOptions()\"\r\n [value]=\"pageSizeStr()\"\r\n (valueChange)=\"onSizeChange($event)\"\r\n size=\"sm\"\r\n ></ds-select>\r\n</nav>\r\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex}.pagination{--_pagination-btn-bg: var(--ds-pagination-btn-bg, var(--surface-default));--_pagination-btn-bg-hover: var(--ds-pagination-btn-bg-hover, var(--surface-secondary));--_pagination-btn-fg: var(--ds-pagination-btn-fg, var(--text-secondary));--_pagination-btn-fg-hover: var(--ds-pagination-btn-fg-hover, var(--text-primary));--_pagination-btn-border: var(--ds-pagination-btn-border, var(--border-default));--_pagination-active-bg: var(--ds-pagination-active-bg, var(--primary));--_pagination-active-bg-hover: var(--ds-pagination-active-bg-hover, var(--primary-hover));--_pagination-active-fg: var(--ds-pagination-active-fg, var(--primary-on));--_pagination-radius: var(--ds-pagination-radius, var(--radius-md));display:inline-flex;gap:var(--space-1);align-items:center;flex-wrap:wrap}.pagination .label{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-secondary);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:var(--_pagination-btn-bg);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_pagination-btn-fg);border-radius:var(--_pagination-radius);cursor:pointer;display:inline-grid;place-items:center}.pagination .pagination-button:hover:not([disabled]):not(.active){background:var(--_pagination-btn-bg-hover);color:var(--_pagination-btn-fg-hover)}.pagination .pagination-button.active{background:var(--_pagination-active-bg);color:var(--_pagination-active-fg);border-color:var(--_pagination-active-bg)}.pagination .pagination-button.active:hover:not([disabled]){background:var(--_pagination-active-bg-hover);border-color:var(--_pagination-active-bg-hover)}.pagination .pagination-button[disabled]{color:var(--text-disabled);cursor:not-allowed}.pagination .pagination-button:focus-visible{outline:none;box-shadow:var(--focus-ring)}.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", "placeholder", "size", "label", "disabled", "invalid", "required", "optional", "name", "ariaLabel"], outputs: ["valueChange"] }] });
|
|
1492
|
+
}
|
|
1493
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
1494
|
+
type: Component,
|
|
1495
|
+
args: [{ selector: 'ds-pagination', standalone: true, imports: [FormsModule, IconComponent, SelectComponent], encapsulation: ViewEncapsulation.Emulated, template: "<nav class=\"pagination\" aria-label=\"Pagination\">\r\n @if (showLabel()) {\r\n <span class=\"label\">{{ rangeLabel() }}</span>\r\n }\r\n <button class=\"pagination-button\" type=\"button\" aria-label=\"Previous page\" [disabled]=\"currentPage() === 1\" (click)=\"goTo(currentPage() - 1)\">\r\n <ds-icon name=\"chevronLeft\" [size]=\"14\"></ds-icon>\r\n </button>\r\n @for (item of pageItems(); track $index) {\r\n @if (item === 'ellipsis') {\r\n <span class=\"ellipsis\" aria-hidden=\"true\">\u2026</span>\r\n } @else {\r\n <button\r\n class=\"pagination-button\"\r\n type=\"button\"\r\n [class.active]=\"item === currentPage()\"\r\n [attr.aria-label]=\"'Page ' + item\"\r\n [attr.aria-current]=\"item === currentPage() ? 'page' : null\"\r\n (click)=\"goTo(item)\"\r\n >{{ item }}</button>\r\n }\r\n }\r\n <button class=\"pagination-button\" type=\"button\" aria-label=\"Next page\" [disabled]=\"currentPage() === totalPages()\" (click)=\"goTo(currentPage() + 1)\">\r\n <ds-icon name=\"chevronRight\" [size]=\"14\"></ds-icon>\r\n </button>\r\n <ds-select\r\n class=\"size\"\r\n ariaLabel=\"Rows per page\"\r\n [options]=\"sizeOptions()\"\r\n [value]=\"pageSizeStr()\"\r\n (valueChange)=\"onSizeChange($event)\"\r\n size=\"sm\"\r\n ></ds-select>\r\n</nav>\r\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex}.pagination{--_pagination-btn-bg: var(--ds-pagination-btn-bg, var(--surface-default));--_pagination-btn-bg-hover: var(--ds-pagination-btn-bg-hover, var(--surface-secondary));--_pagination-btn-fg: var(--ds-pagination-btn-fg, var(--text-secondary));--_pagination-btn-fg-hover: var(--ds-pagination-btn-fg-hover, var(--text-primary));--_pagination-btn-border: var(--ds-pagination-btn-border, var(--border-default));--_pagination-active-bg: var(--ds-pagination-active-bg, var(--primary));--_pagination-active-bg-hover: var(--ds-pagination-active-bg-hover, var(--primary-hover));--_pagination-active-fg: var(--ds-pagination-active-fg, var(--primary-on));--_pagination-radius: var(--ds-pagination-radius, var(--radius-md));display:inline-flex;gap:var(--space-1);align-items:center;flex-wrap:wrap}.pagination .label{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-secondary);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:var(--_pagination-btn-bg);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_pagination-btn-fg);border-radius:var(--_pagination-radius);cursor:pointer;display:inline-grid;place-items:center}.pagination .pagination-button:hover:not([disabled]):not(.active){background:var(--_pagination-btn-bg-hover);color:var(--_pagination-btn-fg-hover)}.pagination .pagination-button.active{background:var(--_pagination-active-bg);color:var(--_pagination-active-fg);border-color:var(--_pagination-active-bg)}.pagination .pagination-button.active:hover:not([disabled]){background:var(--_pagination-active-bg-hover);border-color:var(--_pagination-active-bg-hover)}.pagination .pagination-button[disabled]{color:var(--text-disabled);cursor:not-allowed}.pagination .pagination-button:focus-visible{outline:none;box-shadow:var(--focus-ring)}.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"] }]
|
|
1496
|
+
}], propDecorators: { total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: true }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: false }] }, { type: i0.Output, args: ["currentPageChange"] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], pageSizeChange: [{ type: i0.Output, args: ["pageSizeChange"] }] } });
|
|
1497
|
+
|
|
1498
|
+
let nextId$5 = 0;
|
|
1499
|
+
class DatePickerComponent {
|
|
1500
|
+
overlay = inject(Overlay);
|
|
1501
|
+
vcr = inject(ViewContainerRef);
|
|
1502
|
+
mode = input('single', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
1503
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1504
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1505
|
+
placeholder = input('Select date', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
1506
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1507
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
1508
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
1509
|
+
optional = input(false, ...(ngDevMode ? [{ debugName: "optional" }] : /* istanbul ignore next */ []));
|
|
1510
|
+
/** Accessible name when no visible `label` is provided. */
|
|
1511
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1512
|
+
uid = `ds-datepicker-${++nextId$5}`;
|
|
1513
|
+
labelId = `${this.uid}-label`;
|
|
1514
|
+
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
1515
|
+
/** The day that holds keyboard focus in the open grid (roving tabindex). */
|
|
1516
|
+
gridFocus = signal(null, ...(ngDevMode ? [{ debugName: "gridFocus" }] : /* istanbul ignore next */ []));
|
|
1517
|
+
resolvedAriaLabel = computed(() => this.label() ? null : this.ariaLabel() || this.placeholder() || null, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
1518
|
+
dayKey(d) {
|
|
1519
|
+
return `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
1520
|
+
}
|
|
1521
|
+
isFocusDay(cell) {
|
|
1522
|
+
const f = this.gridFocus();
|
|
1523
|
+
return !!f && this.dayKey(f) === this.dayKey(cell.date);
|
|
1524
|
+
}
|
|
1525
|
+
/** Arrow-key roving navigation across the calendar grid (APG date grid). */
|
|
1526
|
+
onGridKeydown(event, cell) {
|
|
1527
|
+
const f = this.gridFocus() ?? cell.date;
|
|
1528
|
+
let next = null;
|
|
1529
|
+
switch (event.key) {
|
|
1530
|
+
case 'ArrowLeft':
|
|
1531
|
+
next = this.addDays(f, -1);
|
|
1532
|
+
break;
|
|
1533
|
+
case 'ArrowRight':
|
|
1534
|
+
next = this.addDays(f, 1);
|
|
1535
|
+
break;
|
|
1536
|
+
case 'ArrowUp':
|
|
1537
|
+
next = this.addDays(f, -7);
|
|
1538
|
+
break;
|
|
1539
|
+
case 'ArrowDown':
|
|
1540
|
+
next = this.addDays(f, 7);
|
|
1541
|
+
break;
|
|
1542
|
+
case 'Home':
|
|
1543
|
+
next = this.addDays(f, -((f.getDay() + 6) % 7));
|
|
1544
|
+
break;
|
|
1545
|
+
case 'End':
|
|
1546
|
+
next = this.addDays(f, 6 - ((f.getDay() + 6) % 7));
|
|
1547
|
+
break;
|
|
1548
|
+
case 'PageUp':
|
|
1549
|
+
next = this.addMonths(f, -1);
|
|
1550
|
+
break;
|
|
1551
|
+
case 'PageDown':
|
|
1552
|
+
next = this.addMonths(f, 1);
|
|
1553
|
+
break;
|
|
1554
|
+
case 'Enter':
|
|
1555
|
+
case ' ':
|
|
1556
|
+
event.preventDefault();
|
|
1557
|
+
this.selectDay(cell);
|
|
1558
|
+
return;
|
|
1559
|
+
case 'Escape':
|
|
1560
|
+
event.preventDefault();
|
|
1561
|
+
this.close();
|
|
1562
|
+
this.trigger().nativeElement.focus();
|
|
1563
|
+
return;
|
|
1564
|
+
default:
|
|
1565
|
+
return;
|
|
1566
|
+
}
|
|
1567
|
+
event.preventDefault();
|
|
1568
|
+
this.gridFocus.set(next);
|
|
1569
|
+
this.viewMonth.set(new Date(next.getFullYear(), next.getMonth(), 1));
|
|
1570
|
+
setTimeout(() => this.focusGridDay());
|
|
1571
|
+
}
|
|
1572
|
+
addDays(date, n) {
|
|
1573
|
+
const d = new Date(date);
|
|
1574
|
+
d.setDate(d.getDate() + n);
|
|
1575
|
+
return d;
|
|
1576
|
+
}
|
|
1577
|
+
addMonths(date, n) {
|
|
1578
|
+
const d = new Date(date);
|
|
1579
|
+
d.setMonth(d.getMonth() + n);
|
|
1580
|
+
return d;
|
|
1581
|
+
}
|
|
1582
|
+
focusGridDay() {
|
|
1583
|
+
const f = this.gridFocus();
|
|
1584
|
+
if (!f || !this.overlayRef)
|
|
1585
|
+
return;
|
|
1586
|
+
const el = this.overlayRef.overlayElement.querySelector(`[data-day="${this.dayKey(f)}"]`);
|
|
1587
|
+
el?.focus();
|
|
1588
|
+
}
|
|
1589
|
+
/** Full, unambiguous date for a day cell's accessible name. */
|
|
1590
|
+
dayLabel(cell) {
|
|
1591
|
+
return cell.date.toLocaleDateString(undefined, {
|
|
1592
|
+
weekday: 'long',
|
|
1593
|
+
day: 'numeric',
|
|
1594
|
+
month: 'long',
|
|
1595
|
+
year: 'numeric',
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
triggerClasses = computed(() => {
|
|
1599
|
+
const size = this.size();
|
|
1600
|
+
return size === 'md' ? 'trigger' : `trigger ${size}`;
|
|
1601
|
+
}, ...(ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []));
|
|
1602
|
+
viewMonth = signal(new Date(), ...(ngDevMode ? [{ debugName: "viewMonth" }] : /* istanbul ignore next */ []));
|
|
1603
|
+
trigger = viewChild.required('trigger');
|
|
1604
|
+
panelTpl = viewChild.required('panel');
|
|
1605
|
+
overlayRef = null;
|
|
1606
|
+
displayLabel = computed(() => {
|
|
1607
|
+
const v = this.value();
|
|
1608
|
+
if (this.mode() === 'single') {
|
|
1609
|
+
const d = v;
|
|
1610
|
+
return d ? d.toLocaleDateString() : this.placeholder();
|
|
1611
|
+
}
|
|
1612
|
+
const r = v ?? [null, null];
|
|
1613
|
+
const a = r[0];
|
|
1614
|
+
const b = r[1];
|
|
1615
|
+
if (a && b)
|
|
1616
|
+
return `${a.toLocaleDateString()} – ${b.toLocaleDateString()}`;
|
|
1617
|
+
if (a)
|
|
1618
|
+
return `${a.toLocaleDateString()} – …`;
|
|
1619
|
+
return this.placeholder();
|
|
1620
|
+
}, ...(ngDevMode ? [{ debugName: "displayLabel" }] : /* istanbul ignore next */ []));
|
|
1621
|
+
monthLabel = computed(() => {
|
|
1622
|
+
const m = this.viewMonth();
|
|
1623
|
+
return m.toLocaleDateString(undefined, { month: 'long', year: 'numeric' });
|
|
1624
|
+
}, ...(ngDevMode ? [{ debugName: "monthLabel" }] : /* istanbul ignore next */ []));
|
|
1625
|
+
daysGrid = computed(() => {
|
|
1626
|
+
const view = this.viewMonth();
|
|
1627
|
+
const year = view.getFullYear();
|
|
1628
|
+
const month = view.getMonth();
|
|
1629
|
+
const firstOfMonth = new Date(year, month, 1);
|
|
1630
|
+
const gridStart = new Date(firstOfMonth);
|
|
1631
|
+
gridStart.setDate(gridStart.getDate() - ((gridStart.getDay() + 6) % 7));
|
|
1632
|
+
const cells = [];
|
|
1633
|
+
const today = new Date();
|
|
1634
|
+
const todayKey = today.toDateString();
|
|
1635
|
+
for (let i = 0; i < 42; i++) {
|
|
1636
|
+
const d = new Date(gridStart);
|
|
1637
|
+
d.setDate(d.getDate() + i);
|
|
1638
|
+
const inMonth = d.getMonth() === month;
|
|
1639
|
+
const isToday = d.toDateString() === todayKey;
|
|
1640
|
+
const range = this.getRangeContext(d);
|
|
1641
|
+
cells.push({
|
|
1642
|
+
date: d,
|
|
1643
|
+
day: d.getDate(),
|
|
1644
|
+
inMonth,
|
|
1645
|
+
isToday,
|
|
1646
|
+
inRange: range.inRange,
|
|
1647
|
+
isRangeStart: range.isStart,
|
|
1648
|
+
isRangeEnd: range.isEnd,
|
|
1649
|
+
isSelected: range.isSelected,
|
|
1650
|
+
});
|
|
1651
|
+
}
|
|
1652
|
+
return cells;
|
|
1653
|
+
}, ...(ngDevMode ? [{ debugName: "daysGrid" }] : /* istanbul ignore next */ []));
|
|
1654
|
+
getRangeContext(d) {
|
|
1655
|
+
const v = this.value();
|
|
1656
|
+
if (this.mode() === 'single') {
|
|
1657
|
+
const sel = v;
|
|
1658
|
+
return { inRange: false, isStart: false, isEnd: false, isSelected: !!sel && sel.toDateString() === d.toDateString() };
|
|
1659
|
+
}
|
|
1660
|
+
const r = v ?? [null, null];
|
|
1661
|
+
const a = r[0];
|
|
1662
|
+
const b = r[1];
|
|
1663
|
+
if (!a)
|
|
1664
|
+
return { inRange: false, isStart: false, isEnd: false, isSelected: false };
|
|
1665
|
+
if (!b)
|
|
1666
|
+
return { inRange: false, isStart: a.toDateString() === d.toDateString(), isEnd: false, isSelected: false };
|
|
1667
|
+
const t = d.getTime();
|
|
1668
|
+
const aT = a.getTime();
|
|
1669
|
+
const bT = b.getTime();
|
|
1670
|
+
return {
|
|
1671
|
+
inRange: t > Math.min(aT, bT) && t < Math.max(aT, bT),
|
|
1672
|
+
isStart: t === Math.min(aT, bT),
|
|
1673
|
+
isEnd: t === Math.max(aT, bT),
|
|
1674
|
+
isSelected: false,
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1677
|
+
open() {
|
|
1678
|
+
if (this.overlayRef)
|
|
1679
|
+
return;
|
|
1680
|
+
const positionStrategy = this.overlay.position()
|
|
1681
|
+
.flexibleConnectedTo(this.trigger().nativeElement)
|
|
1682
|
+
.withPositions([
|
|
1683
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
1684
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
1685
|
+
]);
|
|
1686
|
+
const cfg = {
|
|
1687
|
+
positionStrategy,
|
|
1688
|
+
hasBackdrop: true,
|
|
1689
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
1690
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
1691
|
+
};
|
|
1692
|
+
this.overlayRef = this.overlay.create(cfg);
|
|
1693
|
+
this.overlayRef.backdropClick().subscribe(() => this.close());
|
|
1694
|
+
const portal = new TemplatePortal(this.panelTpl(), this.vcr);
|
|
1695
|
+
this.overlayRef.attach(portal);
|
|
1696
|
+
this.isOpen.set(true);
|
|
1697
|
+
// Seed grid focus on the selected day (or today) and move focus into it.
|
|
1698
|
+
const selected = this.mode() === 'single'
|
|
1699
|
+
? this.value()
|
|
1700
|
+
: (this.value()?.[0] ?? null);
|
|
1701
|
+
const focus = selected ?? new Date();
|
|
1702
|
+
this.gridFocus.set(focus);
|
|
1703
|
+
this.viewMonth.set(new Date(focus.getFullYear(), focus.getMonth(), 1));
|
|
1704
|
+
setTimeout(() => this.focusGridDay());
|
|
1705
|
+
}
|
|
1706
|
+
close() {
|
|
1707
|
+
this.overlayRef?.dispose();
|
|
1708
|
+
this.overlayRef = null;
|
|
1709
|
+
this.isOpen.set(false);
|
|
1710
|
+
}
|
|
1711
|
+
prevMonth() {
|
|
1712
|
+
const m = new Date(this.viewMonth());
|
|
1713
|
+
m.setMonth(m.getMonth() - 1);
|
|
1714
|
+
this.viewMonth.set(m);
|
|
1715
|
+
}
|
|
1716
|
+
nextMonth() {
|
|
1717
|
+
const m = new Date(this.viewMonth());
|
|
1718
|
+
m.setMonth(m.getMonth() + 1);
|
|
1719
|
+
this.viewMonth.set(m);
|
|
1720
|
+
}
|
|
1721
|
+
selectDay(cell) {
|
|
1722
|
+
if (this.mode() === 'single') {
|
|
1723
|
+
this.value.set(new Date(cell.date));
|
|
1724
|
+
this.close();
|
|
1725
|
+
this.trigger().nativeElement.focus();
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
const r = this.value() ?? [null, null];
|
|
1729
|
+
const a = r[0];
|
|
1730
|
+
const b = r[1];
|
|
1731
|
+
if (!a || (a && b)) {
|
|
1732
|
+
this.value.set([new Date(cell.date), null]);
|
|
1733
|
+
this.gridFocus.set(new Date(cell.date));
|
|
1734
|
+
}
|
|
1735
|
+
else {
|
|
1736
|
+
const picked = new Date(cell.date);
|
|
1737
|
+
const range = a.getTime() <= picked.getTime() ? [a, picked] : [picked, a];
|
|
1738
|
+
this.value.set(range);
|
|
1739
|
+
this.close();
|
|
1740
|
+
this.trigger().nativeElement.focus();
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
cellClasses(cell) {
|
|
1744
|
+
const parts = ['day'];
|
|
1745
|
+
if (!cell.inMonth)
|
|
1746
|
+
parts.push('muted');
|
|
1747
|
+
if (cell.isToday)
|
|
1748
|
+
parts.push('today');
|
|
1749
|
+
if (cell.inRange)
|
|
1750
|
+
parts.push('in-range');
|
|
1751
|
+
if (cell.isRangeStart)
|
|
1752
|
+
parts.push('range-start');
|
|
1753
|
+
if (cell.isRangeEnd)
|
|
1754
|
+
parts.push('range-end');
|
|
1755
|
+
if (cell.isSelected)
|
|
1756
|
+
parts.push('selected');
|
|
1757
|
+
return parts.join(' ');
|
|
1758
|
+
}
|
|
1759
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1760
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: DatePickerComponent, isStandalone: true, selector: "ds-date-picker", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", 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" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"field\">\r\n @if (label()) {\r\n <span class=\"label\" [id]=\"labelId\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"req\" aria-hidden=\"true\">*</span>\r\n } @else if (optional()) {\r\n <span class=\"optional-marker\" aria-hidden=\"true\">(optional)</span>\r\n }\r\n </span>\r\n }\r\n <button\r\n #trigger\r\n type=\"button\"\r\n aria-haspopup=\"dialog\"\r\n [class]=\"triggerClasses()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-labelledby]=\"label() ? labelId : null\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [attr.aria-required]=\"required() ? 'true' : null\"\r\n (click)=\"open()\"\r\n >\r\n <ds-icon name=\"calendar\" [size]=\"14\"></ds-icon>\r\n <span>{{ displayLabel() }}</span>\r\n </button>\r\n @if (hint()) {\r\n <small class=\"hint\">{{ hint() }}</small>\r\n }\r\n</div>\r\n\r\n<ng-template #panel>\r\n <div class=\"calendar\">\r\n <div class=\"head\">\r\n <span class=\"title\">{{ monthLabel() }}</span>\r\n <span class=\"nav\">\r\n <button type=\"button\" (click)=\"prevMonth()\">\r\n <ds-icon name=\"chevronLeft\" [size]=\"14\"></ds-icon>\r\n </button>\r\n <button type=\"button\" (click)=\"nextMonth()\">\r\n <ds-icon name=\"chevronRight\" [size]=\"14\"></ds-icon>\r\n </button>\r\n </span>\r\n </div>\r\n <div class=\"grid\">\r\n <span class=\"dow\">Mo</span>\r\n <span class=\"dow\">Tu</span>\r\n <span class=\"dow\">We</span>\r\n <span class=\"dow\">Th</span>\r\n <span class=\"dow\">Fr</span>\r\n <span class=\"dow\">Sa</span>\r\n <span class=\"dow\">Su</span>\r\n @for (cell of daysGrid(); track $index) {\r\n <button\r\n type=\"button\"\r\n [class]=\"cellClasses(cell)\"\r\n [attr.data-day]=\"dayKey(cell.date)\"\r\n [attr.tabindex]=\"isFocusDay(cell) ? 0 : -1\"\r\n [attr.aria-label]=\"dayLabel(cell)\"\r\n [attr.aria-pressed]=\"cell.isSelected\"\r\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\r\n (click)=\"selectDay(cell)\"\r\n (keydown)=\"onGridKeydown($event, cell)\"\r\n >\r\n {{ cell.day }}\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.field{display:flex;flex-direction:column;gap:var(--space-1-5);width:100%}.field .label{font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-secondary);display:flex;align-items:center;gap:var(--space-1)}.field .label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.field .label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.field .hint{font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary);display:flex;align-items:center;gap:var(--space-1)}.trigger{display:inline-flex;align-items:center;gap:var(--space-2);background:var(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);padding:0 var(--space-3);height:var(--hit-cozy);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary);cursor:pointer}.trigger:hover{border-color:var(--border-strong)}.trigger:focus-visible{outline:none;box-shadow:var(--focus-ring)}.trigger.sm{height:var(--hit-min);padding:0 var(--space-2);font-size:var(--font-size-xs)}.trigger.lg{height:var(--field-h-lg);padding:0 var(--space-4);font-size:var(--font-size-m)}.calendar{--_datepicker-bg: var(--ds-datepicker-bg, var(--surface-overlay));--_datepicker-border: var(--ds-datepicker-border, var(--border-default));--_datepicker-shadow: var(--ds-datepicker-shadow, var(--shadow-popover));--_datepicker-day-hover-bg: var(--ds-datepicker-day-hover-bg, var(--surface-secondary));--_datepicker-day-today-fg: var(--ds-datepicker-day-today-fg, var(--primary));--_datepicker-day-selected-bg: var(--ds-datepicker-day-selected-bg, var(--primary));--_datepicker-day-selected-bg-hover: var(--ds-datepicker-day-selected-bg-hover, var(--primary-selected-hover));--_datepicker-day-selected-fg: var(--ds-datepicker-day-selected-fg, var(--primary-on));--_datepicker-day-range-bg: var(--ds-datepicker-day-range-bg, var(--primary-subtle));--_datepicker-day-range-fg: var(--ds-datepicker-day-range-fg, var(--primary-strong));--_datepicker-day-disabled-fg: var(--ds-datepicker-day-disabled-fg, var(--text-disabled));--_datepicker-width: var(--ds-datepicker-width, var(--datepicker-w));background:var(--_datepicker-bg);border:var(--border-width-default) solid var(--_datepicker-border);border-radius:var(--radius-lg);box-shadow:var(--_datepicker-shadow);padding:var(--space-3);width:var(--_datepicker-width)}.calendar .head{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-2)}.calendar .title{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans)}.calendar .nav{display:flex;gap:var(--space-1)}.calendar .nav button{width:var(--datepicker-nav-size);height:var(--datepicker-nav-size);border:0;background:transparent;display:grid;place-items:center;color:var(--icon-default);cursor:pointer;border-radius:var(--radius-sm)}.calendar .nav button:hover{background:var(--_datepicker-day-hover-bg)}.calendar .grid{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--datepicker-cell-gap)}.calendar .dow{font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-flat) var(--font-sans);text-align:center;padding:var(--space-1) 0;color:var(--text-tertiary);text-transform:uppercase;letter-spacing:var(--letter-spacing-wider)}.calendar .day{width:var(--space-8);height:var(--space-8);display:grid;place-items:center;font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);border-radius:var(--radius-sm);cursor:pointer;border:0;background:transparent;color:var(--text-primary)}.calendar .day:hover{background:var(--_datepicker-day-hover-bg)}.calendar .day.muted{color:var(--text-muted)}.calendar .day.today{font-weight:var(--font-weight-bold);color:var(--_datepicker-day-today-fg)}.calendar .day.selected{background:var(--_datepicker-day-selected-bg);color:var(--_datepicker-day-selected-fg)}.calendar .day.selected:hover{background:var(--_datepicker-day-selected-bg-hover)}.calendar .day.in-range{background:var(--_datepicker-day-range-bg);color:var(--_datepicker-day-range-fg);border-radius:var(--radius-flat)}.calendar .day.range-start{border-top-left-radius:var(--radius-sm);border-bottom-left-radius:var(--radius-sm);background:var(--_datepicker-day-selected-bg);color:var(--_datepicker-day-selected-fg)}.calendar .day.range-end{border-top-right-radius:var(--radius-sm);border-bottom-right-radius:var(--radius-sm);background:var(--_datepicker-day-selected-bg);color:var(--_datepicker-day-selected-fg)}.calendar .day.range-start:hover,.calendar .day.range-end:hover{background:var(--_datepicker-day-selected-bg-hover)}.calendar .day.disabled{color:var(--_datepicker-day-disabled-fg);cursor:not-allowed}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
1761
|
+
}
|
|
1762
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DatePickerComponent, decorators: [{
|
|
1763
|
+
type: Component,
|
|
1764
|
+
args: [{ selector: 'ds-date-picker', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<div class=\"field\">\r\n @if (label()) {\r\n <span class=\"label\" [id]=\"labelId\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"req\" aria-hidden=\"true\">*</span>\r\n } @else if (optional()) {\r\n <span class=\"optional-marker\" aria-hidden=\"true\">(optional)</span>\r\n }\r\n </span>\r\n }\r\n <button\r\n #trigger\r\n type=\"button\"\r\n aria-haspopup=\"dialog\"\r\n [class]=\"triggerClasses()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-labelledby]=\"label() ? labelId : null\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [attr.aria-required]=\"required() ? 'true' : null\"\r\n (click)=\"open()\"\r\n >\r\n <ds-icon name=\"calendar\" [size]=\"14\"></ds-icon>\r\n <span>{{ displayLabel() }}</span>\r\n </button>\r\n @if (hint()) {\r\n <small class=\"hint\">{{ hint() }}</small>\r\n }\r\n</div>\r\n\r\n<ng-template #panel>\r\n <div class=\"calendar\">\r\n <div class=\"head\">\r\n <span class=\"title\">{{ monthLabel() }}</span>\r\n <span class=\"nav\">\r\n <button type=\"button\" (click)=\"prevMonth()\">\r\n <ds-icon name=\"chevronLeft\" [size]=\"14\"></ds-icon>\r\n </button>\r\n <button type=\"button\" (click)=\"nextMonth()\">\r\n <ds-icon name=\"chevronRight\" [size]=\"14\"></ds-icon>\r\n </button>\r\n </span>\r\n </div>\r\n <div class=\"grid\">\r\n <span class=\"dow\">Mo</span>\r\n <span class=\"dow\">Tu</span>\r\n <span class=\"dow\">We</span>\r\n <span class=\"dow\">Th</span>\r\n <span class=\"dow\">Fr</span>\r\n <span class=\"dow\">Sa</span>\r\n <span class=\"dow\">Su</span>\r\n @for (cell of daysGrid(); track $index) {\r\n <button\r\n type=\"button\"\r\n [class]=\"cellClasses(cell)\"\r\n [attr.data-day]=\"dayKey(cell.date)\"\r\n [attr.tabindex]=\"isFocusDay(cell) ? 0 : -1\"\r\n [attr.aria-label]=\"dayLabel(cell)\"\r\n [attr.aria-pressed]=\"cell.isSelected\"\r\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\r\n (click)=\"selectDay(cell)\"\r\n (keydown)=\"onGridKeydown($event, cell)\"\r\n >\r\n {{ cell.day }}\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.field{display:flex;flex-direction:column;gap:var(--space-1-5);width:100%}.field .label{font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-secondary);display:flex;align-items:center;gap:var(--space-1)}.field .label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.field .label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.field .hint{font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary);display:flex;align-items:center;gap:var(--space-1)}.trigger{display:inline-flex;align-items:center;gap:var(--space-2);background:var(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);padding:0 var(--space-3);height:var(--hit-cozy);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary);cursor:pointer}.trigger:hover{border-color:var(--border-strong)}.trigger:focus-visible{outline:none;box-shadow:var(--focus-ring)}.trigger.sm{height:var(--hit-min);padding:0 var(--space-2);font-size:var(--font-size-xs)}.trigger.lg{height:var(--field-h-lg);padding:0 var(--space-4);font-size:var(--font-size-m)}.calendar{--_datepicker-bg: var(--ds-datepicker-bg, var(--surface-overlay));--_datepicker-border: var(--ds-datepicker-border, var(--border-default));--_datepicker-shadow: var(--ds-datepicker-shadow, var(--shadow-popover));--_datepicker-day-hover-bg: var(--ds-datepicker-day-hover-bg, var(--surface-secondary));--_datepicker-day-today-fg: var(--ds-datepicker-day-today-fg, var(--primary));--_datepicker-day-selected-bg: var(--ds-datepicker-day-selected-bg, var(--primary));--_datepicker-day-selected-bg-hover: var(--ds-datepicker-day-selected-bg-hover, var(--primary-selected-hover));--_datepicker-day-selected-fg: var(--ds-datepicker-day-selected-fg, var(--primary-on));--_datepicker-day-range-bg: var(--ds-datepicker-day-range-bg, var(--primary-subtle));--_datepicker-day-range-fg: var(--ds-datepicker-day-range-fg, var(--primary-strong));--_datepicker-day-disabled-fg: var(--ds-datepicker-day-disabled-fg, var(--text-disabled));--_datepicker-width: var(--ds-datepicker-width, var(--datepicker-w));background:var(--_datepicker-bg);border:var(--border-width-default) solid var(--_datepicker-border);border-radius:var(--radius-lg);box-shadow:var(--_datepicker-shadow);padding:var(--space-3);width:var(--_datepicker-width)}.calendar .head{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-2)}.calendar .title{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans)}.calendar .nav{display:flex;gap:var(--space-1)}.calendar .nav button{width:var(--datepicker-nav-size);height:var(--datepicker-nav-size);border:0;background:transparent;display:grid;place-items:center;color:var(--icon-default);cursor:pointer;border-radius:var(--radius-sm)}.calendar .nav button:hover{background:var(--_datepicker-day-hover-bg)}.calendar .grid{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--datepicker-cell-gap)}.calendar .dow{font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-flat) var(--font-sans);text-align:center;padding:var(--space-1) 0;color:var(--text-tertiary);text-transform:uppercase;letter-spacing:var(--letter-spacing-wider)}.calendar .day{width:var(--space-8);height:var(--space-8);display:grid;place-items:center;font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);border-radius:var(--radius-sm);cursor:pointer;border:0;background:transparent;color:var(--text-primary)}.calendar .day:hover{background:var(--_datepicker-day-hover-bg)}.calendar .day.muted{color:var(--text-muted)}.calendar .day.today{font-weight:var(--font-weight-bold);color:var(--_datepicker-day-today-fg)}.calendar .day.selected{background:var(--_datepicker-day-selected-bg);color:var(--_datepicker-day-selected-fg)}.calendar .day.selected:hover{background:var(--_datepicker-day-selected-bg-hover)}.calendar .day.in-range{background:var(--_datepicker-day-range-bg);color:var(--_datepicker-day-range-fg);border-radius:var(--radius-flat)}.calendar .day.range-start{border-top-left-radius:var(--radius-sm);border-bottom-left-radius:var(--radius-sm);background:var(--_datepicker-day-selected-bg);color:var(--_datepicker-day-selected-fg)}.calendar .day.range-end{border-top-right-radius:var(--radius-sm);border-bottom-right-radius:var(--radius-sm);background:var(--_datepicker-day-selected-bg);color:var(--_datepicker-day-selected-fg)}.calendar .day.range-start:hover,.calendar .day.range-end:hover{background:var(--_datepicker-day-selected-bg-hover)}.calendar .day.disabled{color:var(--_datepicker-day-disabled-fg);cursor:not-allowed}\n"] }]
|
|
1765
|
+
}], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", 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 }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
1766
|
+
|
|
1767
|
+
/**
|
|
1768
|
+
* Library-level breadcrumb state. Apps push items either programmatically
|
|
1769
|
+
* (page constructor / effect) or via a router-data driver (see app docs).
|
|
1770
|
+
* `<ds-breadcrumbs>` reads from here when no `[items]` input is provided.
|
|
1771
|
+
*/
|
|
1772
|
+
class BreadcrumbsService {
|
|
1773
|
+
_items = signal([], ...(ngDevMode ? [{ debugName: "_items" }] : /* istanbul ignore next */ []));
|
|
1774
|
+
items = this._items.asReadonly();
|
|
1775
|
+
set(items) {
|
|
1776
|
+
this._items.set(items);
|
|
1777
|
+
}
|
|
1778
|
+
push(item) {
|
|
1779
|
+
this._items.update((arr) => [...arr, item]);
|
|
1780
|
+
}
|
|
1781
|
+
pop() {
|
|
1782
|
+
this._items.update((arr) => arr.slice(0, -1));
|
|
1783
|
+
}
|
|
1784
|
+
replaceLast(item) {
|
|
1785
|
+
this._items.update((arr) => (arr.length ? [...arr.slice(0, -1), item] : [item]));
|
|
1786
|
+
}
|
|
1787
|
+
clear() {
|
|
1788
|
+
this._items.set([]);
|
|
1789
|
+
}
|
|
1790
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BreadcrumbsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1791
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BreadcrumbsService, providedIn: 'root' });
|
|
1792
|
+
}
|
|
1793
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BreadcrumbsService, decorators: [{
|
|
1794
|
+
type: Injectable,
|
|
1795
|
+
args: [{ providedIn: 'root' }]
|
|
1796
|
+
}] });
|
|
1797
|
+
|
|
1798
|
+
class BreadcrumbsComponent {
|
|
1799
|
+
cfg = inject(DS_CONFIG);
|
|
1800
|
+
svc = inject(BreadcrumbsService);
|
|
1801
|
+
/**
|
|
1802
|
+
* When omitted, the component reads from `BreadcrumbsService.items`.
|
|
1803
|
+
* Pass an explicit array to opt out of the service (per-page override).
|
|
1804
|
+
*/
|
|
1805
|
+
items = input(null, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
1806
|
+
separator = input(null, ...(ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []));
|
|
1807
|
+
clickable = input(null, ...(ngDevMode ? [{ debugName: "clickable" }] : /* istanbul ignore next */ []));
|
|
1808
|
+
navigate = output();
|
|
1809
|
+
resolvedItems = computed(() => this.items() ?? this.svc.items(), ...(ngDevMode ? [{ debugName: "resolvedItems" }] : /* istanbul ignore next */ []));
|
|
1810
|
+
effectiveSeparator = computed(() => this.separator() ?? this.cfg.breadcrumbs?.separator ?? 'chevronRight', ...(ngDevMode ? [{ debugName: "effectiveSeparator" }] : /* istanbul ignore next */ []));
|
|
1811
|
+
effectiveClickable = computed(() => this.clickable() ?? this.cfg.breadcrumbs?.clickable ?? true, ...(ngDevMode ? [{ debugName: "effectiveClickable" }] : /* istanbul ignore next */ []));
|
|
1812
|
+
onNav(event, item) {
|
|
1813
|
+
if (!item.href || !this.effectiveClickable()) {
|
|
1814
|
+
event.preventDefault();
|
|
1815
|
+
return;
|
|
1816
|
+
}
|
|
1817
|
+
event.preventDefault();
|
|
1818
|
+
this.navigate.emit(item);
|
|
1819
|
+
}
|
|
1820
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BreadcrumbsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1821
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: BreadcrumbsComponent, isStandalone: true, selector: "ds-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { navigate: "navigate" }, ngImport: i0, template: "<nav class=\"breadcrumbs\" aria-label=\"Breadcrumb\" [class.is-static]=\"!effectiveClickable()\">\r\n @for (item of resolvedItems(); track $index; let last = $last) {\r\n @if (item.href && !last && effectiveClickable()) {\r\n <a [href]=\"item.href\" (click)=\"onNav($event, item)\">\r\n @if (item.icon) { <ds-icon [name]=\"item.icon\" [size]=\"14\" /> }\r\n @if (item.label) { <span class=\"label\">{{ item.label }}</span> }\r\n </a>\r\n } @else {\r\n <span [class.current]=\"last\" [attr.aria-current]=\"last ? 'page' : null\">\r\n @if (item.icon) { <ds-icon [name]=\"item.icon\" [size]=\"14\" /> }\r\n @if (item.label) { <span class=\"label\">{{ item.label }}</span> }\r\n </span>\r\n }\r\n @if (!last) { <span class=\"sep\" aria-hidden=\"true\"><ds-icon [name]=\"effectiveSeparator()\" [size]=\"12\" /></span> }\r\n }\r\n</nav>\r\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex;min-width:0;max-width:100%}.breadcrumbs{--_breadcrumbs-fg: var(--ds-breadcrumbs-fg, var(--text-tertiary));--_breadcrumbs-fg-hover: var(--ds-breadcrumbs-fg-hover, var(--primary));--_breadcrumbs-separator-fg: var(--ds-breadcrumbs-separator-fg, var(--icon-muted));--_breadcrumbs-current-fg: var(--ds-breadcrumbs-current-fg, var(--text-primary));display:inline-flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_breadcrumbs-fg);min-width:0;max-width:100%;flex-wrap:nowrap;overflow:hidden}.breadcrumbs a,.breadcrumbs .current{display:inline-flex;align-items:center;gap:var(--space-1)}.breadcrumbs a{color:var(--_breadcrumbs-fg);text-decoration:none;cursor:pointer;transition:color var(--duration-fast) var(--ease-standard)}.breadcrumbs a:hover{color:var(--_breadcrumbs-fg-hover);text-decoration:underline;text-underline-offset:2px}.breadcrumbs a:focus-visible{outline:none;box-shadow:var(--focus-ring);border-radius:var(--radius-sm)}.breadcrumbs.is-static a,.breadcrumbs.is-static .current{cursor:default}.breadcrumbs .sep{color:var(--_breadcrumbs-separator-fg);display:inline-flex;align-items:center}.breadcrumbs .current{color:var(--_breadcrumbs-current-fg);font-weight:var(--font-weight-bold)}.breadcrumbs .label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:16ch}.breadcrumbs .current .label{max-width:32ch}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
1822
|
+
}
|
|
1823
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BreadcrumbsComponent, decorators: [{
|
|
1824
|
+
type: Component,
|
|
1825
|
+
args: [{ selector: 'ds-breadcrumbs', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<nav class=\"breadcrumbs\" aria-label=\"Breadcrumb\" [class.is-static]=\"!effectiveClickable()\">\r\n @for (item of resolvedItems(); track $index; let last = $last) {\r\n @if (item.href && !last && effectiveClickable()) {\r\n <a [href]=\"item.href\" (click)=\"onNav($event, item)\">\r\n @if (item.icon) { <ds-icon [name]=\"item.icon\" [size]=\"14\" /> }\r\n @if (item.label) { <span class=\"label\">{{ item.label }}</span> }\r\n </a>\r\n } @else {\r\n <span [class.current]=\"last\" [attr.aria-current]=\"last ? 'page' : null\">\r\n @if (item.icon) { <ds-icon [name]=\"item.icon\" [size]=\"14\" /> }\r\n @if (item.label) { <span class=\"label\">{{ item.label }}</span> }\r\n </span>\r\n }\r\n @if (!last) { <span class=\"sep\" aria-hidden=\"true\"><ds-icon [name]=\"effectiveSeparator()\" [size]=\"12\" /></span> }\r\n }\r\n</nav>\r\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex;min-width:0;max-width:100%}.breadcrumbs{--_breadcrumbs-fg: var(--ds-breadcrumbs-fg, var(--text-tertiary));--_breadcrumbs-fg-hover: var(--ds-breadcrumbs-fg-hover, var(--primary));--_breadcrumbs-separator-fg: var(--ds-breadcrumbs-separator-fg, var(--icon-muted));--_breadcrumbs-current-fg: var(--ds-breadcrumbs-current-fg, var(--text-primary));display:inline-flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_breadcrumbs-fg);min-width:0;max-width:100%;flex-wrap:nowrap;overflow:hidden}.breadcrumbs a,.breadcrumbs .current{display:inline-flex;align-items:center;gap:var(--space-1)}.breadcrumbs a{color:var(--_breadcrumbs-fg);text-decoration:none;cursor:pointer;transition:color var(--duration-fast) var(--ease-standard)}.breadcrumbs a:hover{color:var(--_breadcrumbs-fg-hover);text-decoration:underline;text-underline-offset:2px}.breadcrumbs a:focus-visible{outline:none;box-shadow:var(--focus-ring);border-radius:var(--radius-sm)}.breadcrumbs.is-static a,.breadcrumbs.is-static .current{cursor:default}.breadcrumbs .sep{color:var(--_breadcrumbs-separator-fg);display:inline-flex;align-items:center}.breadcrumbs .current{color:var(--_breadcrumbs-current-fg);font-weight:var(--font-weight-bold)}.breadcrumbs .label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:16ch}.breadcrumbs .current .label{max-width:32ch}\n"] }]
|
|
1826
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], separator: [{ type: i0.Input, args: [{ isSignal: true, alias: "separator", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], navigate: [{ type: i0.Output, args: ["navigate"] }] } });
|
|
1827
|
+
|
|
1828
|
+
class SidenavComponent {
|
|
1829
|
+
collapsed = input(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
1830
|
+
brand = input('', ...(ngDevMode ? [{ debugName: "brand" }] : /* istanbul ignore next */ []));
|
|
1831
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1832
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: SidenavComponent, isStandalone: true, selector: "ds-sidenav", inputs: { collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, brand: { classPropertyName: "brand", publicName: "brand", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.sidenav": "true", "class.collapsed": "collapsed()" } }, ngImport: i0, template: "@if (brand()) {\n <div class=\"brand\">\n <span class=\"mark\">{{ brand().charAt(0) }}</span>\n <span class=\"brand-name\">{{ brand() }}</span>\n </div>\n}\n<ng-content></ng-content>\n", styles: ["@charset \"UTF-8\";:host{--_sidenav-bg: var(--ds-sidenav-bg, var(--surface-default));--_sidenav-border: var(--ds-sidenav-border, var(--border-divider));--_sidenav-width: var(--ds-sidenav-width, var(--sidenav-w));--_sidenav-width-collapsed: var(--ds-sidenav-width-collapsed, var(--sidenav-w-collapsed));--_sidenav-mark-bg: var(--ds-sidenav-mark-bg, var(--primary));--_sidenav-mark-fg: var(--ds-sidenav-mark-fg, var(--primary-on));display:flex;flex-direction:column;gap:var(--space-1);width:var(--_sidenav-width);background:var(--_sidenav-bg);border-right:var(--border-width-default) solid var(--_sidenav-border);padding:var(--space-5)}.brand{font:var(--font-weight-extrabold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-2) var(--space-6)}.mark{width:var(--sidenav-logo-size);height:var(--sidenav-logo-size);border-radius:var(--radius-md);background:var(--_sidenav-mark-bg);display:grid;place-items:center;color:var(--_sidenav-mark-fg);font-size:var(--font-size-s);flex-shrink:0}.brand-name{font:var(--font-weight-extrabold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans)}:host(.collapsed){width:var(--_sidenav-width-collapsed);padding:var(--space-3);align-items:center}:host(.collapsed) .brand{padding:var(--sidenav-pad-brand-y) 0 var(--sidenav-pad-brand-b);justify-content:center}:host(.collapsed) .brand-name{display:none}\n"] });
|
|
1833
|
+
}
|
|
1834
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SidenavComponent, decorators: [{
|
|
1835
|
+
type: Component,
|
|
1836
|
+
args: [{ selector: 'ds-sidenav', standalone: true, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
1837
|
+
'[class.sidenav]': 'true',
|
|
1838
|
+
'[class.collapsed]': 'collapsed()',
|
|
1839
|
+
}, template: "@if (brand()) {\n <div class=\"brand\">\n <span class=\"mark\">{{ brand().charAt(0) }}</span>\n <span class=\"brand-name\">{{ brand() }}</span>\n </div>\n}\n<ng-content></ng-content>\n", styles: ["@charset \"UTF-8\";:host{--_sidenav-bg: var(--ds-sidenav-bg, var(--surface-default));--_sidenav-border: var(--ds-sidenav-border, var(--border-divider));--_sidenav-width: var(--ds-sidenav-width, var(--sidenav-w));--_sidenav-width-collapsed: var(--ds-sidenav-width-collapsed, var(--sidenav-w-collapsed));--_sidenav-mark-bg: var(--ds-sidenav-mark-bg, var(--primary));--_sidenav-mark-fg: var(--ds-sidenav-mark-fg, var(--primary-on));display:flex;flex-direction:column;gap:var(--space-1);width:var(--_sidenav-width);background:var(--_sidenav-bg);border-right:var(--border-width-default) solid var(--_sidenav-border);padding:var(--space-5)}.brand{font:var(--font-weight-extrabold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-2) var(--space-6)}.mark{width:var(--sidenav-logo-size);height:var(--sidenav-logo-size);border-radius:var(--radius-md);background:var(--_sidenav-mark-bg);display:grid;place-items:center;color:var(--_sidenav-mark-fg);font-size:var(--font-size-s);flex-shrink:0}.brand-name{font:var(--font-weight-extrabold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans)}:host(.collapsed){width:var(--_sidenav-width-collapsed);padding:var(--space-3);align-items:center}:host(.collapsed) .brand{padding:var(--sidenav-pad-brand-y) 0 var(--sidenav-pad-brand-b);justify-content:center}:host(.collapsed) .brand-name{display:none}\n"] }]
|
|
1840
|
+
}], propDecorators: { collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], brand: [{ type: i0.Input, args: [{ isSignal: true, alias: "brand", required: false }] }] } });
|
|
1841
|
+
|
|
1842
|
+
class SidenavGroupComponent {
|
|
1843
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1844
|
+
// Optional group icon (DS IconName). Consumers without a DS icon can project
|
|
1845
|
+
// custom content via the `[icon]` slot.
|
|
1846
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1847
|
+
// When true the label/icon row becomes a clickable header that expands /
|
|
1848
|
+
// collapses the projected children with a caret rotation.
|
|
1849
|
+
expandable = input(false, ...(ngDevMode ? [{ debugName: "expandable" }] : /* istanbul ignore next */ []));
|
|
1850
|
+
// Two-way bindable open state. Defaults to open (true) so a non-expandable
|
|
1851
|
+
// group always shows its items.
|
|
1852
|
+
expanded = model(true, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
1853
|
+
toggle() {
|
|
1854
|
+
if (!this.expandable())
|
|
1855
|
+
return;
|
|
1856
|
+
this.expanded.update((v) => !v);
|
|
1857
|
+
}
|
|
1858
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SidenavGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1859
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: SidenavGroupComponent, isStandalone: true, selector: "ds-sidenav-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, expandable: { classPropertyName: "expandable", publicName: "expandable", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange" }, ngImport: i0, template: "<!-- Single <ng-content> outside any @if blocks. Angular accepts only one\n default slot per component; duplicate <ng-content> elements caused\n children to silently drop when control flow chose a non-matching branch. -->\n@if (expandable()) {\n <button\n type=\"button\"\n class=\"group-header\"\n (click)=\"toggle()\"\n [attr.aria-expanded]=\"expanded()\"\n >\n @if (icon()) {\n <ds-icon class=\"group-icon\" [name]=\"icon()!\" [size]=\"18\"></ds-icon>\n } @else {\n <!-- `[ds-group-icon]` is selector-distinct from `[icon]` slots used on\n sidenav-item children, so projected icons don't get swallowed when\n a consumer puts items inside the group. -->\n <span class=\"group-icon\"><ng-content select=\"[ds-group-icon]\"></ng-content></span>\n }\n @if (label()) {\n <span class=\"group-title\">{{ label() }}</span>\n }\n <ds-icon\n class=\"group-caret\"\n [class.open]=\"expanded()\"\n name=\"chevronDown\"\n [size]=\"14\"\n ></ds-icon>\n </button>\n} @else if (label()) {\n <span class=\"group-label\">{{ label() }}</span>\n}\n<div class=\"group-body\" [class.hidden]=\"expandable() && !expanded()\">\n <ng-content></ng-content>\n</div>\n", styles: ["@charset \"UTF-8\";:host{--_sidenav-group-open-bg: var(--ds-sidenav-group-open-bg, var(--surface-secondary));--_sidenav-group-child-indent: var(--ds-sidenav-group-child-indent, var(--space-3));--_sidenav-group-radius: var(--ds-sidenav-group-radius, var(--radius-md));display:flex;flex-direction:column;gap:var(--space-1);border-radius:var(--_sidenav-group-radius);transition:background var(--duration-fast) var(--ease-standard)}:host(:has(.group-header[aria-expanded=true])){background:var(--_sidenav-group-open-bg)}.group-label{--_sidenav-group-fg: var(--ds-sidenav-group-fg, var(--text-tertiary));display:block;font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-base) var(--font-sans);color:var(--_sidenav-group-fg);text-transform:uppercase;letter-spacing:var(--letter-spacing-wider);padding:var(--space-4) var(--space-3) var(--sidenav-section-pad-b)}.group-header{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:var(--space-2) var(--space-3);border:0;background:transparent;border-radius:var(--radius-md);color:var(--text-primary);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-base) var(--font-sans);text-align:left;cursor:pointer;transition:background var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.group-header:hover{background:var(--surface-secondary)}.group-header:focus-visible{outline:none;box-shadow:var(--focus-ring)}.group-icon{display:inline-flex;align-items:center;color:var(--text-secondary);flex-shrink:0}.group-title{flex:1;min-width:0}.group-caret{display:inline-flex;color:var(--text-tertiary);transition:transform var(--duration-base) var(--ease-standard)}.group-caret:not(.open){transform:rotate(-90deg)}.group-body{display:flex;flex-direction:column;gap:var(--space-1);padding-left:var(--_sidenav-group-child-indent)}.group-body.hidden{display:none}:host-context(.sidenav.collapsed) .group-label,:host-context(.sidenav.collapsed) .group-title,:host-context(.sidenav.collapsed) .group-caret{display:none}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
1860
|
+
}
|
|
1861
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SidenavGroupComponent, decorators: [{
|
|
1862
|
+
type: Component,
|
|
1863
|
+
args: [{ selector: 'ds-sidenav-group', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<!-- Single <ng-content> outside any @if blocks. Angular accepts only one\n default slot per component; duplicate <ng-content> elements caused\n children to silently drop when control flow chose a non-matching branch. -->\n@if (expandable()) {\n <button\n type=\"button\"\n class=\"group-header\"\n (click)=\"toggle()\"\n [attr.aria-expanded]=\"expanded()\"\n >\n @if (icon()) {\n <ds-icon class=\"group-icon\" [name]=\"icon()!\" [size]=\"18\"></ds-icon>\n } @else {\n <!-- `[ds-group-icon]` is selector-distinct from `[icon]` slots used on\n sidenav-item children, so projected icons don't get swallowed when\n a consumer puts items inside the group. -->\n <span class=\"group-icon\"><ng-content select=\"[ds-group-icon]\"></ng-content></span>\n }\n @if (label()) {\n <span class=\"group-title\">{{ label() }}</span>\n }\n <ds-icon\n class=\"group-caret\"\n [class.open]=\"expanded()\"\n name=\"chevronDown\"\n [size]=\"14\"\n ></ds-icon>\n </button>\n} @else if (label()) {\n <span class=\"group-label\">{{ label() }}</span>\n}\n<div class=\"group-body\" [class.hidden]=\"expandable() && !expanded()\">\n <ng-content></ng-content>\n</div>\n", styles: ["@charset \"UTF-8\";:host{--_sidenav-group-open-bg: var(--ds-sidenav-group-open-bg, var(--surface-secondary));--_sidenav-group-child-indent: var(--ds-sidenav-group-child-indent, var(--space-3));--_sidenav-group-radius: var(--ds-sidenav-group-radius, var(--radius-md));display:flex;flex-direction:column;gap:var(--space-1);border-radius:var(--_sidenav-group-radius);transition:background var(--duration-fast) var(--ease-standard)}:host(:has(.group-header[aria-expanded=true])){background:var(--_sidenav-group-open-bg)}.group-label{--_sidenav-group-fg: var(--ds-sidenav-group-fg, var(--text-tertiary));display:block;font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-base) var(--font-sans);color:var(--_sidenav-group-fg);text-transform:uppercase;letter-spacing:var(--letter-spacing-wider);padding:var(--space-4) var(--space-3) var(--sidenav-section-pad-b)}.group-header{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:var(--space-2) var(--space-3);border:0;background:transparent;border-radius:var(--radius-md);color:var(--text-primary);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-base) var(--font-sans);text-align:left;cursor:pointer;transition:background var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.group-header:hover{background:var(--surface-secondary)}.group-header:focus-visible{outline:none;box-shadow:var(--focus-ring)}.group-icon{display:inline-flex;align-items:center;color:var(--text-secondary);flex-shrink:0}.group-title{flex:1;min-width:0}.group-caret{display:inline-flex;color:var(--text-tertiary);transition:transform var(--duration-base) var(--ease-standard)}.group-caret:not(.open){transform:rotate(-90deg)}.group-body{display:flex;flex-direction:column;gap:var(--space-1);padding-left:var(--_sidenav-group-child-indent)}.group-body.hidden{display:none}:host-context(.sidenav.collapsed) .group-label,:host-context(.sidenav.collapsed) .group-title,:host-context(.sidenav.collapsed) .group-caret{display:none}\n"] }]
|
|
1864
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], expandable: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandable", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }, { type: i0.Output, args: ["expandedChange"] }] } });
|
|
1865
|
+
|
|
1866
|
+
class SidenavItemComponent {
|
|
1867
|
+
// `icon` is optional — consumers without a DS IconName can project a custom
|
|
1868
|
+
// icon via the `[icon]` content slot. When both are supplied, the input
|
|
1869
|
+
// wins (legacy DS-consumer behaviour).
|
|
1870
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1871
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1872
|
+
href = input('', ...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
|
|
1873
|
+
// Angular RouterLink accepts both string and array forms — mirror that so
|
|
1874
|
+
// consumers can pass dynamic segments (e.g. `['/programs', id, 'overview']`).
|
|
1875
|
+
routerLink = input(null, ...(ngDevMode ? [{ debugName: "routerLink" }] : /* istanbul ignore next */ []));
|
|
1876
|
+
active = input(false, ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
1877
|
+
badge = input(null, ...(ngDevMode ? [{ debugName: "badge" }] : /* istanbul ignore next */ []));
|
|
1878
|
+
hasAlert = input(false, ...(ngDevMode ? [{ debugName: "hasAlert" }] : /* istanbul ignore next */ []));
|
|
1879
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1880
|
+
linkClasses = computed(() => {
|
|
1881
|
+
const parts = ['item'];
|
|
1882
|
+
if (this.active())
|
|
1883
|
+
parts.push('active');
|
|
1884
|
+
if (this.disabled())
|
|
1885
|
+
parts.push('disabled');
|
|
1886
|
+
return parts.join(' ');
|
|
1887
|
+
}, ...(ngDevMode ? [{ debugName: "linkClasses" }] : /* istanbul ignore next */ []));
|
|
1888
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SidenavItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1889
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: SidenavItemComponent, isStandalone: true, selector: "ds-sidenav-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, hasAlert: { classPropertyName: "hasAlert", publicName: "hasAlert", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!-- Selector-scoped slots ([icon], [trailing]) coexist with no default\r\n <ng-content> here \u2014 projection goes via attributes only, so consumers\r\n can compose icon + label + arbitrary trailing content (status pill,\r\n status icon, etc.). The two <a> variants (routerLink vs href) share one\r\n #content template so the inner markup isn't duplicated. -->\r\n@if (routerLink()) {\r\n <a\r\n [routerLink]=\"disabled() ? null : routerLink()\"\r\n routerLinkActive=\"active\"\r\n #rla=\"routerLinkActive\"\r\n [class]=\"linkClasses()\"\r\n [attr.aria-label]=\"label()\"\r\n [attr.aria-current]=\"rla.isActive ? 'page' : null\"\r\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\r\n [attr.tabindex]=\"disabled() ? -1 : null\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"content\" />\r\n </a>\r\n} @else {\r\n <a\r\n [href]=\"href() || '#'\"\r\n [class]=\"linkClasses()\"\r\n [attr.aria-label]=\"label()\"\r\n [attr.aria-current]=\"active() ? 'page' : null\"\r\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\r\n [attr.tabindex]=\"disabled() ? -1 : null\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"content\" />\r\n </a>\r\n}\r\n\r\n<ng-template #content>\r\n @if (icon()) {\r\n <ds-icon class=\"icon\" [name]=\"icon()!\" [size]=\"20\"></ds-icon>\r\n } @else {\r\n <span class=\"icon\"><ng-content select=\"[icon]\"></ng-content></span>\r\n }\r\n @if (label()) {\r\n <span class=\"item-label\">{{ label() }}</span>\r\n }\r\n <span class=\"trailing\"><ng-content select=\"[trailing]\"></ng-content></span>\r\n @if (badge() !== null) {\r\n <span class=\"count\">{{ badge() }}</span>\r\n }\r\n @if (hasAlert()) {\r\n <span class=\"alert\"></span>\r\n }\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{--_sidenav-item-fg: var(--ds-sidenav-item-fg, var(--text-secondary));--_sidenav-item-fg-hover: var(--ds-sidenav-item-fg-hover, var(--text-primary));--_sidenav-item-bg-hover: var(--ds-sidenav-item-bg-hover, var(--surface-secondary));--_sidenav-item-bg-active: var(--ds-sidenav-item-bg-active, var(--primary));--_sidenav-item-fg-active: var(--ds-sidenav-item-fg-active, var(--text-on-primary));--_sidenav-item-bg-active-hover: var(--ds-sidenav-item-bg-active-hover, color-mix(in srgb, var(--_sidenav-item-bg-active) 88%, white));--_sidenav-item-rail: var(--ds-sidenav-item-rail, var(--secondary));--_sidenav-item-radius: var(--ds-sidenav-item-radius, var(--radius-md));--_sidenav-alert-color: var(--ds-sidenav-alert-color, var(--error));display:block}.item{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-3);border-radius:var(--_sidenav-item-radius);color:var(--_sidenav-item-fg);text-decoration:none;font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;transition:background var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard);position:relative}.item:hover{background:var(--_sidenav-item-bg-hover);color:var(--_sidenav-item-fg-hover)}.item:focus-visible{outline:none;box-shadow:var(--focus-ring)}.item.active{background:var(--_sidenav-item-bg-active);color:var(--_sidenav-item-fg-active);box-shadow:inset 3px 0 0 var(--_sidenav-item-rail)}.item.active:hover{background:var(--_sidenav-item-bg-active-hover)}.item .icon{width:var(--icon-lg);height:var(--icon-lg);color:currentColor;flex-shrink:0}.item .item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}.item .count{min-width:var(--badge-count-size);height:var(--badge-count-size);padding:0 var(--space-1-5);display:inline-grid;place-items:center;border-radius:var(--radius-pill);background:var(--surface-secondary);color:var(--text-secondary);font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wide);margin-left:auto}.item .alert{width:var(--badge-dot-size);height:var(--badge-dot-size);background:var(--_sidenav-alert-color);border-radius:var(--radius-pill);margin-left:auto}.item .trailing{display:inline-flex;align-items:center;margin-left:auto;color:var(--text-tertiary);flex-shrink:0}.item.active .trailing{color:currentColor}.item.disabled{color:var(--text-disabled);cursor:not-allowed}.item.disabled:hover{background:unset;color:var(--text-disabled)}:host-context(.sidenav.collapsed) .item{justify-content:center;padding:0;width:var(--sidenav-collapsed-item);height:var(--sidenav-collapsed-item);gap:0;font-size:0}:host-context(.sidenav.collapsed) .item .icon{font-size:0}:host-context(.sidenav.collapsed) .item .item-label,:host-context(.sidenav.collapsed) .item .count,:host-context(.sidenav.collapsed) .item .trailing{display:none}:host-context(.sidenav.collapsed) .item .alert{position:absolute;top:var(--space-1-5);right:var(--space-1-5);margin:0}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1890
|
+
}
|
|
1891
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SidenavItemComponent, decorators: [{
|
|
1892
|
+
type: Component,
|
|
1893
|
+
args: [{ selector: 'ds-sidenav-item', standalone: true, imports: [IconComponent, RouterLink, RouterLinkActive, NgTemplateOutlet], encapsulation: ViewEncapsulation.Emulated, template: "<!-- Selector-scoped slots ([icon], [trailing]) coexist with no default\r\n <ng-content> here \u2014 projection goes via attributes only, so consumers\r\n can compose icon + label + arbitrary trailing content (status pill,\r\n status icon, etc.). The two <a> variants (routerLink vs href) share one\r\n #content template so the inner markup isn't duplicated. -->\r\n@if (routerLink()) {\r\n <a\r\n [routerLink]=\"disabled() ? null : routerLink()\"\r\n routerLinkActive=\"active\"\r\n #rla=\"routerLinkActive\"\r\n [class]=\"linkClasses()\"\r\n [attr.aria-label]=\"label()\"\r\n [attr.aria-current]=\"rla.isActive ? 'page' : null\"\r\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\r\n [attr.tabindex]=\"disabled() ? -1 : null\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"content\" />\r\n </a>\r\n} @else {\r\n <a\r\n [href]=\"href() || '#'\"\r\n [class]=\"linkClasses()\"\r\n [attr.aria-label]=\"label()\"\r\n [attr.aria-current]=\"active() ? 'page' : null\"\r\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\r\n [attr.tabindex]=\"disabled() ? -1 : null\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"content\" />\r\n </a>\r\n}\r\n\r\n<ng-template #content>\r\n @if (icon()) {\r\n <ds-icon class=\"icon\" [name]=\"icon()!\" [size]=\"20\"></ds-icon>\r\n } @else {\r\n <span class=\"icon\"><ng-content select=\"[icon]\"></ng-content></span>\r\n }\r\n @if (label()) {\r\n <span class=\"item-label\">{{ label() }}</span>\r\n }\r\n <span class=\"trailing\"><ng-content select=\"[trailing]\"></ng-content></span>\r\n @if (badge() !== null) {\r\n <span class=\"count\">{{ badge() }}</span>\r\n }\r\n @if (hasAlert()) {\r\n <span class=\"alert\"></span>\r\n }\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{--_sidenav-item-fg: var(--ds-sidenav-item-fg, var(--text-secondary));--_sidenav-item-fg-hover: var(--ds-sidenav-item-fg-hover, var(--text-primary));--_sidenav-item-bg-hover: var(--ds-sidenav-item-bg-hover, var(--surface-secondary));--_sidenav-item-bg-active: var(--ds-sidenav-item-bg-active, var(--primary));--_sidenav-item-fg-active: var(--ds-sidenav-item-fg-active, var(--text-on-primary));--_sidenav-item-bg-active-hover: var(--ds-sidenav-item-bg-active-hover, color-mix(in srgb, var(--_sidenav-item-bg-active) 88%, white));--_sidenav-item-rail: var(--ds-sidenav-item-rail, var(--secondary));--_sidenav-item-radius: var(--ds-sidenav-item-radius, var(--radius-md));--_sidenav-alert-color: var(--ds-sidenav-alert-color, var(--error));display:block}.item{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-3);border-radius:var(--_sidenav-item-radius);color:var(--_sidenav-item-fg);text-decoration:none;font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;transition:background var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard);position:relative}.item:hover{background:var(--_sidenav-item-bg-hover);color:var(--_sidenav-item-fg-hover)}.item:focus-visible{outline:none;box-shadow:var(--focus-ring)}.item.active{background:var(--_sidenav-item-bg-active);color:var(--_sidenav-item-fg-active);box-shadow:inset 3px 0 0 var(--_sidenav-item-rail)}.item.active:hover{background:var(--_sidenav-item-bg-active-hover)}.item .icon{width:var(--icon-lg);height:var(--icon-lg);color:currentColor;flex-shrink:0}.item .item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}.item .count{min-width:var(--badge-count-size);height:var(--badge-count-size);padding:0 var(--space-1-5);display:inline-grid;place-items:center;border-radius:var(--radius-pill);background:var(--surface-secondary);color:var(--text-secondary);font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wide);margin-left:auto}.item .alert{width:var(--badge-dot-size);height:var(--badge-dot-size);background:var(--_sidenav-alert-color);border-radius:var(--radius-pill);margin-left:auto}.item .trailing{display:inline-flex;align-items:center;margin-left:auto;color:var(--text-tertiary);flex-shrink:0}.item.active .trailing{color:currentColor}.item.disabled{color:var(--text-disabled);cursor:not-allowed}.item.disabled:hover{background:unset;color:var(--text-disabled)}:host-context(.sidenav.collapsed) .item{justify-content:center;padding:0;width:var(--sidenav-collapsed-item);height:var(--sidenav-collapsed-item);gap:0;font-size:0}:host-context(.sidenav.collapsed) .item .icon{font-size:0}:host-context(.sidenav.collapsed) .item .item-label,:host-context(.sidenav.collapsed) .item .count,:host-context(.sidenav.collapsed) .item .trailing{display:none}:host-context(.sidenav.collapsed) .item .alert{position:absolute;top:var(--space-1-5);right:var(--space-1-5);margin:0}\n"] }]
|
|
1894
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], routerLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "routerLink", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], hasAlert: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasAlert", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
1895
|
+
|
|
1896
|
+
class TopBarComponent {
|
|
1897
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TopBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1898
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.14", type: TopBarComponent, isStandalone: true, selector: "ds-topbar", ngImport: i0, template: "<header class=\"topbar\">\n <div class=\"title\"><ng-content select=\"[title]\"></ng-content></div>\n <ng-content select=\"[breadcrumbs]\"></ng-content>\n <div class=\"spacer\"><ng-content select=\"[search]\"></ng-content></div>\n <div class=\"actions\"><ng-content select=\"[actions]\"></ng-content></div>\n</header>\n", styles: ["@charset \"UTF-8\";:host{display:block}.topbar{--_topbar-height: var(--ds-topbar-height, var(--topbar-h));--_topbar-bg: var(--ds-topbar-bg, var(--surface-default));--_topbar-border: var(--ds-topbar-border, var(--border-divider));--_topbar-title-fg: var(--ds-topbar-title-fg, var(--text-primary));display:flex;align-items:center;gap:var(--space-4);height:var(--_topbar-height);padding:0 var(--space-6);background:var(--_topbar-bg);border-bottom:var(--border-width-default) solid var(--_topbar-border)}.topbar .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_topbar-title-fg)}.topbar .spacer{flex:1;min-width:0}.topbar .actions{display:flex;align-items:center;gap:var(--space-2);margin-left:auto}.topbar .crumbs-trail{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-tertiary);min-width:0;max-width:100%;flex-wrap:nowrap;overflow:hidden}.topbar .crumb{color:var(--text-tertiary);text-decoration:none;display:inline-flex;align-items:center;gap:var(--space-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:24ch}.topbar .crumb:hover{color:var(--primary)}.topbar .crumb.crumb--current{color:var(--text-primary);font-weight:var(--font-weight-bold);max-width:32ch}.topbar .crumb-sep{color:var(--icon-muted);display:inline-flex;align-items:center}\n"] });
|
|
1899
|
+
}
|
|
1900
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TopBarComponent, decorators: [{
|
|
1901
|
+
type: Component,
|
|
1902
|
+
args: [{ selector: 'ds-topbar', standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<header class=\"topbar\">\n <div class=\"title\"><ng-content select=\"[title]\"></ng-content></div>\n <ng-content select=\"[breadcrumbs]\"></ng-content>\n <div class=\"spacer\"><ng-content select=\"[search]\"></ng-content></div>\n <div class=\"actions\"><ng-content select=\"[actions]\"></ng-content></div>\n</header>\n", styles: ["@charset \"UTF-8\";:host{display:block}.topbar{--_topbar-height: var(--ds-topbar-height, var(--topbar-h));--_topbar-bg: var(--ds-topbar-bg, var(--surface-default));--_topbar-border: var(--ds-topbar-border, var(--border-divider));--_topbar-title-fg: var(--ds-topbar-title-fg, var(--text-primary));display:flex;align-items:center;gap:var(--space-4);height:var(--_topbar-height);padding:0 var(--space-6);background:var(--_topbar-bg);border-bottom:var(--border-width-default) solid var(--_topbar-border)}.topbar .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_topbar-title-fg)}.topbar .spacer{flex:1;min-width:0}.topbar .actions{display:flex;align-items:center;gap:var(--space-2);margin-left:auto}.topbar .crumbs-trail{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-tertiary);min-width:0;max-width:100%;flex-wrap:nowrap;overflow:hidden}.topbar .crumb{color:var(--text-tertiary);text-decoration:none;display:inline-flex;align-items:center;gap:var(--space-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:24ch}.topbar .crumb:hover{color:var(--primary)}.topbar .crumb.crumb--current{color:var(--text-primary);font-weight:var(--font-weight-bold);max-width:32ch}.topbar .crumb-sep{color:var(--icon-muted);display:inline-flex;align-items:center}\n"] }]
|
|
1903
|
+
}] });
|
|
1904
|
+
|
|
1905
|
+
class PageHeaderComponent {
|
|
1906
|
+
eyebrow = input('', ...(ngDevMode ? [{ debugName: "eyebrow" }] : /* istanbul ignore next */ []));
|
|
1907
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1908
|
+
subtitle = input('', ...(ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
1909
|
+
compact = input(false, ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
|
|
1910
|
+
divider = input(false, ...(ngDevMode ? [{ debugName: "divider" }] : /* istanbul ignore next */ []));
|
|
1911
|
+
metaDivider = input(false, ...(ngDevMode ? [{ debugName: "metaDivider" }] : /* istanbul ignore next */ []));
|
|
1912
|
+
classes = computed(() => {
|
|
1913
|
+
const parts = ['page-header'];
|
|
1914
|
+
if (this.compact())
|
|
1915
|
+
parts.push('compact');
|
|
1916
|
+
if (this.divider())
|
|
1917
|
+
parts.push('with-divider');
|
|
1918
|
+
if (this.metaDivider())
|
|
1919
|
+
parts.push('with-meta-divider');
|
|
1920
|
+
return parts.join(' ');
|
|
1921
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
1922
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1923
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PageHeaderComponent, isStandalone: true, selector: "ds-page-header", inputs: { eyebrow: { classPropertyName: "eyebrow", publicName: "eyebrow", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, divider: { classPropertyName: "divider", publicName: "divider", isSignal: true, isRequired: false, transformFunction: null }, metaDivider: { classPropertyName: "metaDivider", publicName: "metaDivider", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<header [class]=\"classes()\">\n <ng-content select=\"[breadcrumbs]\"></ng-content>\n <div class=\"row title-row\">\n <div class=\"title-block\">\n @if (eyebrow()) { <div class=\"eyebrow\">{{ eyebrow() }}</div> }\n <div class=\"title-line\">\n <h1 class=\"title\">{{ title() }}</h1>\n <ng-content select=\"[title-badge]\"></ng-content>\n </div>\n @if (subtitle()) { <p class=\"subtitle\">{{ subtitle() }}</p> }\n <div class=\"meta\"><ng-content select=\"[meta]\"></ng-content></div>\n </div>\n <div class=\"actions\"><ng-content select=\"[actions]\"></ng-content></div>\n </div>\n <ng-content select=\"[tabs]\"></ng-content>\n</header>\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.eyebrow-secondary){--_pagehdr-eyebrow-fg: var(--ds-pagehdr-eyebrow-fg, var(--secondary-strong))}.page-header{--_pagehdr-eyebrow-fg: var(--ds-pagehdr-eyebrow-fg, var(--text-tertiary));--_pagehdr-title-fg: var(--ds-pagehdr-title-fg, var(--text-primary));--_pagehdr-subtitle-fg: var(--ds-pagehdr-subtitle-fg, var(--text-secondary));--_pagehdr-meta-fg: var(--ds-pagehdr-meta-fg, var(--text-secondary));--_pagehdr-meta-icon-fg: var(--ds-pagehdr-meta-icon-fg, var(--icon-default));--_pagehdr-divider: var(--ds-pagehdr-divider, var(--border-divider));--_pagehdr-title-fs: var(--ds-pagehdr-title-fs, var(--font-size-h3));--_pagehdr-title-gap: var(--ds-pagehdr-title-gap, var(--space-1-5));display:flex;flex-direction:column;gap:var(--space-3)}.page-header.with-divider{padding-bottom:var(--space-4);border-bottom:var(--border-width-default) solid var(--_pagehdr-divider)}.page-header:has(>[tabs]){padding-bottom:0;border-bottom:0}.page-header .row{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-4);flex-wrap:wrap}.page-header .title-block{display:flex;flex-direction:column;gap:var(--_pagehdr-title-gap);min-width:0;flex:1 1 0;align-self:flex-start}.page-header .eyebrow{font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-wide);text-transform:uppercase;color:var(--_pagehdr-eyebrow-fg)}.page-header .title{font:var(--font-weight-extrabold) var(--_pagehdr-title-fs)/var(--line-height-tight) var(--font-display);color:var(--_pagehdr-title-fg);margin:0;letter-spacing:-.02em}.page-header .title-line{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap}.page-header .crumbs-trail{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-tertiary);min-width:0;flex-wrap:nowrap;overflow:hidden;padding-bottom:var(--space-1)}.page-header .crumb{color:var(--text-tertiary);text-decoration:none;display:inline-flex;align-items:center;gap:var(--space-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:24ch}.page-header .crumb:hover{color:var(--primary)}.page-header .crumb.crumb--current{color:var(--text-primary);font-weight:var(--font-weight-bold);max-width:32ch}.page-header .crumb-sep{color:var(--icon-muted);display:inline-flex;align-items:center}.page-header .subtitle{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_pagehdr-subtitle-fg);margin:0}.page-header .actions{display:flex;align-items:flex-end;gap:var(--space-2);flex-shrink:0;align-self:flex-start}.page-header .meta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3);margin-top:var(--space-1-5)}.page-header .meta:not(:has(>*)){display:none}.page-header.with-meta-divider .meta{padding-top:var(--space-2);border-top:var(--border-width-default) solid var(--_pagehdr-divider)}.page-header .meta-item{display:inline-flex;align-items:center;gap:var(--space-1-5);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);color:var(--_pagehdr-meta-fg)}.page-header .meta-item .icon{width:var(--icon-sm);height:var(--icon-sm);color:var(--_pagehdr-meta-icon-fg)}.page-header.compact{--_pagehdr-title-fs: var(--ds-pagehdr-title-fs, var(--font-size-h4));gap:var(--space-2);padding-bottom:var(--space-3)}@media(max-width:720px){.page-header .actions{width:100%}}\n"] });
|
|
1924
|
+
}
|
|
1925
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PageHeaderComponent, decorators: [{
|
|
1926
|
+
type: Component,
|
|
1927
|
+
args: [{ selector: 'ds-page-header', standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<header [class]=\"classes()\">\n <ng-content select=\"[breadcrumbs]\"></ng-content>\n <div class=\"row title-row\">\n <div class=\"title-block\">\n @if (eyebrow()) { <div class=\"eyebrow\">{{ eyebrow() }}</div> }\n <div class=\"title-line\">\n <h1 class=\"title\">{{ title() }}</h1>\n <ng-content select=\"[title-badge]\"></ng-content>\n </div>\n @if (subtitle()) { <p class=\"subtitle\">{{ subtitle() }}</p> }\n <div class=\"meta\"><ng-content select=\"[meta]\"></ng-content></div>\n </div>\n <div class=\"actions\"><ng-content select=\"[actions]\"></ng-content></div>\n </div>\n <ng-content select=\"[tabs]\"></ng-content>\n</header>\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.eyebrow-secondary){--_pagehdr-eyebrow-fg: var(--ds-pagehdr-eyebrow-fg, var(--secondary-strong))}.page-header{--_pagehdr-eyebrow-fg: var(--ds-pagehdr-eyebrow-fg, var(--text-tertiary));--_pagehdr-title-fg: var(--ds-pagehdr-title-fg, var(--text-primary));--_pagehdr-subtitle-fg: var(--ds-pagehdr-subtitle-fg, var(--text-secondary));--_pagehdr-meta-fg: var(--ds-pagehdr-meta-fg, var(--text-secondary));--_pagehdr-meta-icon-fg: var(--ds-pagehdr-meta-icon-fg, var(--icon-default));--_pagehdr-divider: var(--ds-pagehdr-divider, var(--border-divider));--_pagehdr-title-fs: var(--ds-pagehdr-title-fs, var(--font-size-h3));--_pagehdr-title-gap: var(--ds-pagehdr-title-gap, var(--space-1-5));display:flex;flex-direction:column;gap:var(--space-3)}.page-header.with-divider{padding-bottom:var(--space-4);border-bottom:var(--border-width-default) solid var(--_pagehdr-divider)}.page-header:has(>[tabs]){padding-bottom:0;border-bottom:0}.page-header .row{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-4);flex-wrap:wrap}.page-header .title-block{display:flex;flex-direction:column;gap:var(--_pagehdr-title-gap);min-width:0;flex:1 1 0;align-self:flex-start}.page-header .eyebrow{font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-wide);text-transform:uppercase;color:var(--_pagehdr-eyebrow-fg)}.page-header .title{font:var(--font-weight-extrabold) var(--_pagehdr-title-fs)/var(--line-height-tight) var(--font-display);color:var(--_pagehdr-title-fg);margin:0;letter-spacing:-.02em}.page-header .title-line{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap}.page-header .crumbs-trail{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-tertiary);min-width:0;flex-wrap:nowrap;overflow:hidden;padding-bottom:var(--space-1)}.page-header .crumb{color:var(--text-tertiary);text-decoration:none;display:inline-flex;align-items:center;gap:var(--space-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:24ch}.page-header .crumb:hover{color:var(--primary)}.page-header .crumb.crumb--current{color:var(--text-primary);font-weight:var(--font-weight-bold);max-width:32ch}.page-header .crumb-sep{color:var(--icon-muted);display:inline-flex;align-items:center}.page-header .subtitle{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_pagehdr-subtitle-fg);margin:0}.page-header .actions{display:flex;align-items:flex-end;gap:var(--space-2);flex-shrink:0;align-self:flex-start}.page-header .meta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3);margin-top:var(--space-1-5)}.page-header .meta:not(:has(>*)){display:none}.page-header.with-meta-divider .meta{padding-top:var(--space-2);border-top:var(--border-width-default) solid var(--_pagehdr-divider)}.page-header .meta-item{display:inline-flex;align-items:center;gap:var(--space-1-5);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);color:var(--_pagehdr-meta-fg)}.page-header .meta-item .icon{width:var(--icon-sm);height:var(--icon-sm);color:var(--_pagehdr-meta-icon-fg)}.page-header.compact{--_pagehdr-title-fs: var(--ds-pagehdr-title-fs, var(--font-size-h4));gap:var(--space-2);padding-bottom:var(--space-3)}@media(max-width:720px){.page-header .actions{width:100%}}\n"] }]
|
|
1928
|
+
}], propDecorators: { eyebrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "eyebrow", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], divider: [{ type: i0.Input, args: [{ isSignal: true, alias: "divider", required: false }] }], metaDivider: [{ type: i0.Input, args: [{ isSignal: true, alias: "metaDivider", required: false }] }] } });
|
|
1929
|
+
|
|
1930
|
+
let nextId$4 = 0;
|
|
1931
|
+
class ModalCardComponent {
|
|
1932
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1933
|
+
danger = input(false, ...(ngDevMode ? [{ debugName: "danger" }] : /* istanbul ignore next */ []));
|
|
1934
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1935
|
+
showClose = input(true, ...(ngDevMode ? [{ debugName: "showClose" }] : /* istanbul ignore next */ []));
|
|
1936
|
+
closed = output();
|
|
1937
|
+
titleId = `ds-modal-title-${++nextId$4}`;
|
|
1938
|
+
classes = computed(() => {
|
|
1939
|
+
const parts = ['modal', this.size()];
|
|
1940
|
+
if (this.danger())
|
|
1941
|
+
parts.push('danger');
|
|
1942
|
+
return parts.join(' ');
|
|
1943
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
1944
|
+
onClose() {
|
|
1945
|
+
this.closed.emit();
|
|
1946
|
+
}
|
|
1947
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ModalCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1948
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: ModalCardComponent, isStandalone: true, selector: "ds-modal-card", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, danger: { classPropertyName: "danger", publicName: "danger", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, showClose: { classPropertyName: "showClose", publicName: "showClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, template: "<div\r\n [class]=\"classes()\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"titleId\"\r\n>\r\n <div class=\"header\">\r\n <h2 class=\"title\" [id]=\"titleId\">{{ title() }}</h2>\r\n @if (showClose()) {\r\n <button class=\"close\" type=\"button\" aria-label=\"Close dialog\" (click)=\"onClose()\">\r\n <ds-icon name=\"x\" [size]=\"16\"></ds-icon>\r\n </button>\r\n }\r\n </div>\r\n <div class=\"body\">\r\n <ng-content select=\"[body]\"></ng-content>\r\n <div class=\"impact\"><ng-content select=\"[impact]\"></ng-content></div>\r\n </div>\r\n <div class=\"actions\"><ng-content select=\"[actions]\"></ng-content></div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:contents}.modal{--_modal-bg: var(--ds-modal-bg, var(--surface-overlay));--_modal-radius: var(--ds-modal-radius, var(--radius-lg));--_modal-shadow: var(--ds-modal-shadow, var(--shadow-modal));--_modal-divider: var(--ds-modal-divider, var(--border-divider));--_modal-title-fg: var(--ds-modal-title-fg, var(--text-primary));--_modal-title-fg-error: var(--ds-modal-title-fg-error, var(--error-text));--_modal-close-fg: var(--ds-modal-close-fg, var(--icon-default));--_modal-close-fg-hover: var(--ds-modal-close-fg-hover, var(--icon-strong));background:var(--_modal-bg);border-radius:var(--_modal-radius);box-shadow:var(--_modal-shadow);display:flex;flex-direction:column;max-height:90vh;overflow:hidden}.modal.sm{width:var(--modal-w-sm)}.modal.md{width:var(--modal-w-md)}.modal.lg{width:var(--modal-w-lg)}.modal .header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-4) var(--space-5);border-bottom:var(--border-width-default) solid var(--_modal-divider)}.modal .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-heading);margin:0;color:var(--_modal-title-fg)}.modal .close{background:none;border:0;cursor:pointer;color:var(--_modal-close-fg);width:var(--modal-close-size);height:var(--modal-close-size);display:grid;place-items:center}.modal .close:hover{color:var(--_modal-close-fg-hover)}.modal .body{padding:var(--space-5);overflow-y:auto}.modal .actions{display:flex;gap:var(--space-3);justify-content:flex-end;padding:var(--space-4) var(--space-5);border-top:var(--border-width-default) solid var(--_modal-divider)}.modal.danger .title{color:var(--_modal-title-fg-error)}.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(--warning-text)}.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:fade-in var(--duration-base) var(--ease-decelerate)}@keyframes fade-in{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
1949
|
+
}
|
|
1950
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ModalCardComponent, decorators: [{
|
|
1951
|
+
type: Component,
|
|
1952
|
+
args: [{ selector: 'ds-modal-card', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<div\r\n [class]=\"classes()\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"titleId\"\r\n>\r\n <div class=\"header\">\r\n <h2 class=\"title\" [id]=\"titleId\">{{ title() }}</h2>\r\n @if (showClose()) {\r\n <button class=\"close\" type=\"button\" aria-label=\"Close dialog\" (click)=\"onClose()\">\r\n <ds-icon name=\"x\" [size]=\"16\"></ds-icon>\r\n </button>\r\n }\r\n </div>\r\n <div class=\"body\">\r\n <ng-content select=\"[body]\"></ng-content>\r\n <div class=\"impact\"><ng-content select=\"[impact]\"></ng-content></div>\r\n </div>\r\n <div class=\"actions\"><ng-content select=\"[actions]\"></ng-content></div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:contents}.modal{--_modal-bg: var(--ds-modal-bg, var(--surface-overlay));--_modal-radius: var(--ds-modal-radius, var(--radius-lg));--_modal-shadow: var(--ds-modal-shadow, var(--shadow-modal));--_modal-divider: var(--ds-modal-divider, var(--border-divider));--_modal-title-fg: var(--ds-modal-title-fg, var(--text-primary));--_modal-title-fg-error: var(--ds-modal-title-fg-error, var(--error-text));--_modal-close-fg: var(--ds-modal-close-fg, var(--icon-default));--_modal-close-fg-hover: var(--ds-modal-close-fg-hover, var(--icon-strong));background:var(--_modal-bg);border-radius:var(--_modal-radius);box-shadow:var(--_modal-shadow);display:flex;flex-direction:column;max-height:90vh;overflow:hidden}.modal.sm{width:var(--modal-w-sm)}.modal.md{width:var(--modal-w-md)}.modal.lg{width:var(--modal-w-lg)}.modal .header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-4) var(--space-5);border-bottom:var(--border-width-default) solid var(--_modal-divider)}.modal .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-heading);margin:0;color:var(--_modal-title-fg)}.modal .close{background:none;border:0;cursor:pointer;color:var(--_modal-close-fg);width:var(--modal-close-size);height:var(--modal-close-size);display:grid;place-items:center}.modal .close:hover{color:var(--_modal-close-fg-hover)}.modal .body{padding:var(--space-5);overflow-y:auto}.modal .actions{display:flex;gap:var(--space-3);justify-content:flex-end;padding:var(--space-4) var(--space-5);border-top:var(--border-width-default) solid var(--_modal-divider)}.modal.danger .title{color:var(--_modal-title-fg-error)}.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(--warning-text)}.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:fade-in var(--duration-base) var(--ease-decelerate)}@keyframes fade-in{0%{opacity:0}to{opacity:1}}\n"] }]
|
|
1953
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], danger: [{ type: i0.Input, args: [{ isSignal: true, alias: "danger", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], showClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClose", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
1954
|
+
|
|
1955
|
+
class ModalComponent {
|
|
1956
|
+
doc = inject(DOCUMENT);
|
|
1957
|
+
preview = inject(DsStaticPreview);
|
|
1958
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
1959
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1960
|
+
danger = input(false, ...(ngDevMode ? [{ debugName: "danger" }] : /* istanbul ignore next */ []));
|
|
1961
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1962
|
+
closed = output();
|
|
1963
|
+
confirmed = output();
|
|
1964
|
+
constructor() {
|
|
1965
|
+
// Lock background scroll while the dialog is open (skipped in preview mode).
|
|
1966
|
+
effect(() => {
|
|
1967
|
+
if (this.preview.staticPreview())
|
|
1968
|
+
return;
|
|
1969
|
+
this.doc.body.style.overflow = this.open() ? 'hidden' : '';
|
|
1970
|
+
});
|
|
1971
|
+
inject(DestroyRef).onDestroy(() => {
|
|
1972
|
+
this.doc.body.style.overflow = '';
|
|
1973
|
+
});
|
|
1974
|
+
}
|
|
1975
|
+
onClose() {
|
|
1976
|
+
if (this.preview.staticPreview())
|
|
1977
|
+
return;
|
|
1978
|
+
this.open.set(false);
|
|
1979
|
+
this.closed.emit();
|
|
1980
|
+
}
|
|
1981
|
+
onBackdrop(event) {
|
|
1982
|
+
if (event.target === event.currentTarget)
|
|
1983
|
+
this.onClose();
|
|
1984
|
+
}
|
|
1985
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1986
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: ModalComponent, isStandalone: true, selector: "ds-modal", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, danger: { classPropertyName: "danger", publicName: "danger", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "openChange", closed: "closed", confirmed: "confirmed" }, hostDirectives: [{ directive: DsStaticPreview, inputs: ["staticPreview", "staticPreview"] }], ngImport: i0, template: "@if (open() || preview.staticPreview()) {\r\n <div\r\n [class]=\"preview.staticPreview() ? 'modal-static' : 'modal-backdrop'\"\r\n (click)=\"onBackdrop($event)\"\r\n (keydown.escape)=\"onClose()\"\r\n >\r\n <ds-modal-card\r\n [cdkTrapFocus]=\"!preview.staticPreview()\"\r\n [cdkTrapFocusAutoCapture]=\"!preview.staticPreview()\"\r\n [size]=\"size()\"\r\n [danger]=\"danger()\"\r\n [title]=\"title()\"\r\n (closed)=\"onClose()\"\r\n >\r\n <ng-container body><ng-content select=\"[body]\"></ng-content></ng-container>\r\n <ng-container impact><ng-content select=\"[impact]\"></ng-content></ng-container>\r\n <ng-container actions><ng-content select=\"[actions]\"></ng-content></ng-container>\r\n </ds-modal-card>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:contents}.modal{--_modal-bg: var(--ds-modal-bg, var(--surface-overlay));--_modal-radius: var(--ds-modal-radius, var(--radius-lg));--_modal-shadow: var(--ds-modal-shadow, var(--shadow-modal));--_modal-divider: var(--ds-modal-divider, var(--border-divider));--_modal-title-fg: var(--ds-modal-title-fg, var(--text-primary));--_modal-title-fg-error: var(--ds-modal-title-fg-error, var(--error-text));--_modal-close-fg: var(--ds-modal-close-fg, var(--icon-default));--_modal-close-fg-hover: var(--ds-modal-close-fg-hover, var(--icon-strong));background:var(--_modal-bg);border-radius:var(--_modal-radius);box-shadow:var(--_modal-shadow);display:flex;flex-direction:column;max-height:90vh;overflow:hidden}.modal.sm{width:var(--modal-w-sm)}.modal.md{width:var(--modal-w-md)}.modal.lg{width:var(--modal-w-lg)}.modal .header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-4) var(--space-5);border-bottom:var(--border-width-default) solid var(--_modal-divider)}.modal .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-heading);margin:0;color:var(--_modal-title-fg)}.modal .close{background:none;border:0;cursor:pointer;color:var(--_modal-close-fg);width:var(--modal-close-size);height:var(--modal-close-size);display:grid;place-items:center}.modal .close:hover{color:var(--_modal-close-fg-hover)}.modal .body{padding:var(--space-5);overflow-y:auto}.modal .actions{display:flex;gap:var(--space-3);justify-content:flex-end;padding:var(--space-4) var(--space-5);border-top:var(--border-width-default) solid var(--_modal-divider)}.modal.danger .title{color:var(--_modal-title-fg-error)}.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(--warning-text)}.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:fade-in var(--duration-base) var(--ease-decelerate)}@keyframes fade-in{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "component", type: ModalCardComponent, selector: "ds-modal-card", inputs: ["size", "danger", "title", "showClose"], outputs: ["closed"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
1987
|
+
}
|
|
1988
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ModalComponent, decorators: [{
|
|
1989
|
+
type: Component,
|
|
1990
|
+
args: [{ selector: 'ds-modal', standalone: true, imports: [ModalCardComponent, A11yModule], encapsulation: ViewEncapsulation.Emulated, hostDirectives: [{ directive: DsStaticPreview, inputs: ['staticPreview'] }], template: "@if (open() || preview.staticPreview()) {\r\n <div\r\n [class]=\"preview.staticPreview() ? 'modal-static' : 'modal-backdrop'\"\r\n (click)=\"onBackdrop($event)\"\r\n (keydown.escape)=\"onClose()\"\r\n >\r\n <ds-modal-card\r\n [cdkTrapFocus]=\"!preview.staticPreview()\"\r\n [cdkTrapFocusAutoCapture]=\"!preview.staticPreview()\"\r\n [size]=\"size()\"\r\n [danger]=\"danger()\"\r\n [title]=\"title()\"\r\n (closed)=\"onClose()\"\r\n >\r\n <ng-container body><ng-content select=\"[body]\"></ng-content></ng-container>\r\n <ng-container impact><ng-content select=\"[impact]\"></ng-content></ng-container>\r\n <ng-container actions><ng-content select=\"[actions]\"></ng-content></ng-container>\r\n </ds-modal-card>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:contents}.modal{--_modal-bg: var(--ds-modal-bg, var(--surface-overlay));--_modal-radius: var(--ds-modal-radius, var(--radius-lg));--_modal-shadow: var(--ds-modal-shadow, var(--shadow-modal));--_modal-divider: var(--ds-modal-divider, var(--border-divider));--_modal-title-fg: var(--ds-modal-title-fg, var(--text-primary));--_modal-title-fg-error: var(--ds-modal-title-fg-error, var(--error-text));--_modal-close-fg: var(--ds-modal-close-fg, var(--icon-default));--_modal-close-fg-hover: var(--ds-modal-close-fg-hover, var(--icon-strong));background:var(--_modal-bg);border-radius:var(--_modal-radius);box-shadow:var(--_modal-shadow);display:flex;flex-direction:column;max-height:90vh;overflow:hidden}.modal.sm{width:var(--modal-w-sm)}.modal.md{width:var(--modal-w-md)}.modal.lg{width:var(--modal-w-lg)}.modal .header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-4) var(--space-5);border-bottom:var(--border-width-default) solid var(--_modal-divider)}.modal .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-heading);margin:0;color:var(--_modal-title-fg)}.modal .close{background:none;border:0;cursor:pointer;color:var(--_modal-close-fg);width:var(--modal-close-size);height:var(--modal-close-size);display:grid;place-items:center}.modal .close:hover{color:var(--_modal-close-fg-hover)}.modal .body{padding:var(--space-5);overflow-y:auto}.modal .actions{display:flex;gap:var(--space-3);justify-content:flex-end;padding:var(--space-4) var(--space-5);border-top:var(--border-width-default) solid var(--_modal-divider)}.modal.danger .title{color:var(--_modal-title-fg-error)}.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(--warning-text)}.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:fade-in var(--duration-base) var(--ease-decelerate)}@keyframes fade-in{0%{opacity:0}to{opacity:1}}\n"] }]
|
|
1991
|
+
}], 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 }] }], danger: [{ type: i0.Input, args: [{ isSignal: true, alias: "danger", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }] } });
|
|
1992
|
+
|
|
1993
|
+
class BannerComponent {
|
|
1994
|
+
variant = input('info', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1995
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1996
|
+
dismissible = input(false, ...(ngDevMode ? [{ debugName: "dismissible" }] : /* istanbul ignore next */ []));
|
|
1997
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1998
|
+
compact = input(false, ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
|
|
1999
|
+
layout = input('stacked', ...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
2000
|
+
accentRail = input(true, ...(ngDevMode ? [{ debugName: "accentRail" }] : /* istanbul ignore next */ []));
|
|
2001
|
+
dismissed = output();
|
|
2002
|
+
get noRail() {
|
|
2003
|
+
return !this.accentRail();
|
|
2004
|
+
}
|
|
2005
|
+
// Announce banners to assistive tech: errors/warnings interrupt (alert),
|
|
2006
|
+
// info/success wait their turn (status). A statically-rendered banner is
|
|
2007
|
+
// present at first paint, so a `status` region won't be re-read needlessly.
|
|
2008
|
+
get ariaRole() {
|
|
2009
|
+
const v = this.variant();
|
|
2010
|
+
return v === 'error' || v === 'warning' || v === 'severe' ? 'alert' : 'status';
|
|
2011
|
+
}
|
|
2012
|
+
get ariaLive() {
|
|
2013
|
+
return this.ariaRole === 'alert' ? 'assertive' : 'polite';
|
|
2014
|
+
}
|
|
2015
|
+
classes = computed(() => {
|
|
2016
|
+
const parts = ['banner', this.variant(), `layout-${this.layout()}`];
|
|
2017
|
+
if (this.compact())
|
|
2018
|
+
parts.push('compact');
|
|
2019
|
+
return parts.join(' ');
|
|
2020
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2021
|
+
defaultIcon = computed(() => {
|
|
2022
|
+
const variant = this.variant();
|
|
2023
|
+
if (variant === 'success')
|
|
2024
|
+
return 'success';
|
|
2025
|
+
if (variant === 'warning' || variant === 'severe')
|
|
2026
|
+
return 'warn';
|
|
2027
|
+
if (variant === 'error')
|
|
2028
|
+
return 'error';
|
|
2029
|
+
return 'info';
|
|
2030
|
+
}, ...(ngDevMode ? [{ debugName: "defaultIcon" }] : /* istanbul ignore next */ []));
|
|
2031
|
+
onDismiss() {
|
|
2032
|
+
this.dismissed.emit();
|
|
2033
|
+
}
|
|
2034
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BannerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2035
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: BannerComponent, isStandalone: true, selector: "ds-banner", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, accentRail: { classPropertyName: "accentRail", publicName: "accentRail", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismissed: "dismissed" }, host: { properties: { "class.no-rail": "this.noRail", "attr.role": "this.ariaRole", "attr.aria-live": "this.ariaLive" } }, ngImport: i0, template: "<div [class]=\"classes()\">\n <ds-icon class=\"icon\" [name]=\"icon() ?? defaultIcon()\" [size]=\"20\"></ds-icon>\n <div class=\"body\">\n @if (title()) { <div class=\"title\">{{ title() }}</div> }\n <ng-content></ng-content>\n </div>\n <div class=\"actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </div>\n @if (dismissible()) {\n <button class=\"close\" type=\"button\" (click)=\"onDismiss()\">\n <ds-icon name=\"x\" [size]=\"16\"></ds-icon>\n </button>\n }\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}.banner{--_banner-bg: var(--ds-banner-bg, var(--info-subtle));--_banner-fg: var(--ds-banner-fg, var(--info-text));--_banner-bar: var(--ds-banner-bar, var(--info));--_banner-pad-y: var(--ds-banner-pad-y, var(--space-3));--_banner-pad-x: var(--ds-banner-pad-x, var(--space-4));--_banner-radius: var(--ds-banner-radius, var(--radius-md));--_banner-bar-width: var(--ds-banner-bar-width, var(--banner-bar-w));--_banner-title-fg: var(--ds-banner-title-fg, var(--text-primary));--_banner-close-fg: var(--ds-banner-close-fg, var(--icon-default));--_banner-close-fg-hover: var(--ds-banner-close-fg-hover, var(--icon-strong));display:flex;gap:var(--space-3);padding:var(--_banner-pad-y) var(--_banner-pad-x);border-radius:var(--_banner-radius);background:var(--_banner-bg);color:var(--_banner-fg)}:host(:not(.no-rail)) .banner{border-left:var(--_banner-bar-width) solid var(--_banner-bar)}.banner.success{--_banner-bar: var(--ds-banner-bar, var(--success));--_banner-bg: var(--ds-banner-bg, var(--success-subtle));--_banner-fg: var(--ds-banner-fg, var(--success-text))}.banner.warning{--_banner-bar: var(--ds-banner-bar, var(--warning));--_banner-bg: var(--ds-banner-bg, var(--warning-subtle));--_banner-fg: var(--ds-banner-fg, var(--warning-text))}.banner.severe{--_banner-bar: var(--ds-banner-bar, var(--warning-hover));--_banner-bg: var(--ds-banner-bg, var(--warning-muted));--_banner-fg: var(--ds-banner-fg, var(--warning-text))}.banner.error{--_banner-bar: var(--ds-banner-bar, var(--error));--_banner-bg: var(--ds-banner-bg, var(--error-subtle));--_banner-fg: var(--ds-banner-fg, var(--error-text))}.banner.neutral{--_banner-bar: var(--ds-banner-bar, var(--border-strong));--_banner-bg: var(--ds-banner-bg, var(--surface-secondary));--_banner-fg: var(--ds-banner-fg, var(--text-secondary))}.banner .icon{flex-shrink:0;color:inherit;margin-top:var(--banner-ic-mt)}.banner .body{flex:1;min-width:0}.banner .title{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_banner-title-fg);margin:0 0 var(--space-1)}.banner .close{background:none;border:0;cursor:pointer;color:var(--_banner-close-fg)}.banner .close:hover{color:var(--_banner-close-fg-hover)}.banner .actions{display:flex;gap:var(--space-2)}.banner .actions:empty{display:none}.banner.layout-stacked{flex-wrap:wrap;align-items:flex-start}.banner.layout-stacked .actions{flex-basis:100%;margin-top:var(--space-2);padding-left:calc(20px + var(--space-3))}.banner.layout-row{align-items:center}.banner.layout-row .body{flex:1;min-width:0}.banner.layout-row .actions{flex-shrink:0}.banner.compact{align-items:center;--_banner-pad-y: var(--ds-banner-pad-y, var(--space-2));--_banner-pad-x: var(--ds-banner-pad-x, var(--space-3))}.banner.compact .icon{margin-top:0}.banner.compact .title{margin:0;white-space:nowrap}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
2036
|
+
}
|
|
2037
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BannerComponent, decorators: [{
|
|
2038
|
+
type: Component,
|
|
2039
|
+
args: [{ selector: 'ds-banner', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<div [class]=\"classes()\">\n <ds-icon class=\"icon\" [name]=\"icon() ?? defaultIcon()\" [size]=\"20\"></ds-icon>\n <div class=\"body\">\n @if (title()) { <div class=\"title\">{{ title() }}</div> }\n <ng-content></ng-content>\n </div>\n <div class=\"actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </div>\n @if (dismissible()) {\n <button class=\"close\" type=\"button\" (click)=\"onDismiss()\">\n <ds-icon name=\"x\" [size]=\"16\"></ds-icon>\n </button>\n }\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}.banner{--_banner-bg: var(--ds-banner-bg, var(--info-subtle));--_banner-fg: var(--ds-banner-fg, var(--info-text));--_banner-bar: var(--ds-banner-bar, var(--info));--_banner-pad-y: var(--ds-banner-pad-y, var(--space-3));--_banner-pad-x: var(--ds-banner-pad-x, var(--space-4));--_banner-radius: var(--ds-banner-radius, var(--radius-md));--_banner-bar-width: var(--ds-banner-bar-width, var(--banner-bar-w));--_banner-title-fg: var(--ds-banner-title-fg, var(--text-primary));--_banner-close-fg: var(--ds-banner-close-fg, var(--icon-default));--_banner-close-fg-hover: var(--ds-banner-close-fg-hover, var(--icon-strong));display:flex;gap:var(--space-3);padding:var(--_banner-pad-y) var(--_banner-pad-x);border-radius:var(--_banner-radius);background:var(--_banner-bg);color:var(--_banner-fg)}:host(:not(.no-rail)) .banner{border-left:var(--_banner-bar-width) solid var(--_banner-bar)}.banner.success{--_banner-bar: var(--ds-banner-bar, var(--success));--_banner-bg: var(--ds-banner-bg, var(--success-subtle));--_banner-fg: var(--ds-banner-fg, var(--success-text))}.banner.warning{--_banner-bar: var(--ds-banner-bar, var(--warning));--_banner-bg: var(--ds-banner-bg, var(--warning-subtle));--_banner-fg: var(--ds-banner-fg, var(--warning-text))}.banner.severe{--_banner-bar: var(--ds-banner-bar, var(--warning-hover));--_banner-bg: var(--ds-banner-bg, var(--warning-muted));--_banner-fg: var(--ds-banner-fg, var(--warning-text))}.banner.error{--_banner-bar: var(--ds-banner-bar, var(--error));--_banner-bg: var(--ds-banner-bg, var(--error-subtle));--_banner-fg: var(--ds-banner-fg, var(--error-text))}.banner.neutral{--_banner-bar: var(--ds-banner-bar, var(--border-strong));--_banner-bg: var(--ds-banner-bg, var(--surface-secondary));--_banner-fg: var(--ds-banner-fg, var(--text-secondary))}.banner .icon{flex-shrink:0;color:inherit;margin-top:var(--banner-ic-mt)}.banner .body{flex:1;min-width:0}.banner .title{font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_banner-title-fg);margin:0 0 var(--space-1)}.banner .close{background:none;border:0;cursor:pointer;color:var(--_banner-close-fg)}.banner .close:hover{color:var(--_banner-close-fg-hover)}.banner .actions{display:flex;gap:var(--space-2)}.banner .actions:empty{display:none}.banner.layout-stacked{flex-wrap:wrap;align-items:flex-start}.banner.layout-stacked .actions{flex-basis:100%;margin-top:var(--space-2);padding-left:calc(20px + var(--space-3))}.banner.layout-row{align-items:center}.banner.layout-row .body{flex:1;min-width:0}.banner.layout-row .actions{flex-shrink:0}.banner.compact{align-items:center;--_banner-pad-y: var(--ds-banner-pad-y, var(--space-2));--_banner-pad-x: var(--ds-banner-pad-x, var(--space-3))}.banner.compact .icon{margin-top:0}.banner.compact .title{margin:0;white-space:nowrap}\n"] }]
|
|
2040
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], accentRail: [{ type: i0.Input, args: [{ isSignal: true, alias: "accentRail", required: false }] }], dismissed: [{ type: i0.Output, args: ["dismissed"] }], noRail: [{
|
|
2041
|
+
type: HostBinding,
|
|
2042
|
+
args: ['class.no-rail']
|
|
2043
|
+
}], ariaRole: [{
|
|
2044
|
+
type: HostBinding,
|
|
2045
|
+
args: ['attr.role']
|
|
2046
|
+
}], ariaLive: [{
|
|
2047
|
+
type: HostBinding,
|
|
2048
|
+
args: ['attr.aria-live']
|
|
2049
|
+
}] } });
|
|
2050
|
+
|
|
2051
|
+
class DropzoneComponent {
|
|
2052
|
+
accept = input('', ...(ngDevMode ? [{ debugName: "accept" }] : /* istanbul ignore next */ []));
|
|
2053
|
+
multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
2054
|
+
files = model([], ...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
|
|
2055
|
+
/** Disables the dropzone: blocks all file-picking interactions and signals unavailability. */
|
|
2056
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2057
|
+
/** Restricts the dropzone to a single file; narrows the panel to `--col-cap-text`. */
|
|
2058
|
+
single = input(false, { ...(ngDevMode ? { debugName: "single" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2059
|
+
dragOver = signal(false, ...(ngDevMode ? [{ debugName: "dragOver" }] : /* istanbul ignore next */ []));
|
|
2060
|
+
filesAdded = output();
|
|
2061
|
+
fileRemoved = output();
|
|
2062
|
+
classes = computed(() => {
|
|
2063
|
+
const parts = ['dropzone'];
|
|
2064
|
+
if (this.dragOver())
|
|
2065
|
+
parts.push('active');
|
|
2066
|
+
if (this.files().length > 0)
|
|
2067
|
+
parts.push('has-files');
|
|
2068
|
+
if (this.disabled())
|
|
2069
|
+
parts.push('disabled');
|
|
2070
|
+
if (this.single())
|
|
2071
|
+
parts.push('single');
|
|
2072
|
+
return parts.join(' ');
|
|
2073
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2074
|
+
onDragOver(event) {
|
|
2075
|
+
if (this.disabled())
|
|
2076
|
+
return;
|
|
2077
|
+
event.preventDefault();
|
|
2078
|
+
this.dragOver.set(true);
|
|
2079
|
+
}
|
|
2080
|
+
onDragLeave() {
|
|
2081
|
+
this.dragOver.set(false);
|
|
2082
|
+
}
|
|
2083
|
+
onDrop(event) {
|
|
2084
|
+
event.preventDefault();
|
|
2085
|
+
this.dragOver.set(false);
|
|
2086
|
+
if (this.disabled())
|
|
2087
|
+
return;
|
|
2088
|
+
const list = event.dataTransfer?.files;
|
|
2089
|
+
if (list)
|
|
2090
|
+
this.filesAdded.emit(Array.from(list));
|
|
2091
|
+
}
|
|
2092
|
+
onPickerChange(event) {
|
|
2093
|
+
if (this.disabled())
|
|
2094
|
+
return;
|
|
2095
|
+
const list = event.target.files;
|
|
2096
|
+
if (list)
|
|
2097
|
+
this.filesAdded.emit(Array.from(list));
|
|
2098
|
+
}
|
|
2099
|
+
onRemove(file) {
|
|
2100
|
+
this.fileRemoved.emit(file);
|
|
2101
|
+
}
|
|
2102
|
+
formatSize(bytes) {
|
|
2103
|
+
if (bytes < 1024)
|
|
2104
|
+
return `${bytes} B`;
|
|
2105
|
+
if (bytes < 1024 * 1024)
|
|
2106
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
2107
|
+
return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
2108
|
+
}
|
|
2109
|
+
fileIcon(state) {
|
|
2110
|
+
if (state === 'success')
|
|
2111
|
+
return 'check';
|
|
2112
|
+
if (state === 'error')
|
|
2113
|
+
return 'error';
|
|
2114
|
+
return 'file';
|
|
2115
|
+
}
|
|
2116
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DropzoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2117
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: DropzoneComponent, isStandalone: true, selector: "ds-dropzone", inputs: { accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, single: { classPropertyName: "single", publicName: "single", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { files: "filesChange", filesAdded: "filesAdded", fileRemoved: "fileRemoved" }, ngImport: i0, template: "<label\r\n [class]=\"classes()\"\r\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave()\"\r\n (drop)=\"onDrop($event)\"\r\n>\r\n <input\r\n type=\"file\"\r\n class=\"dz-input\"\r\n aria-label=\"Upload files\"\r\n [attr.accept]=\"accept() || null\"\r\n [multiple]=\"single() ? false : multiple()\"\r\n [disabled]=\"disabled()\"\r\n (change)=\"onPickerChange($event)\"\r\n />\r\n @if (files().length === 0) {\r\n <ds-icon name=\"upload\" [size]=\"24\"></ds-icon>\r\n <div class=\"title\">Drop files here</div>\r\n <div class=\"hint\">or click to browse</div>\r\n <ng-content select=\"[hint]\"></ng-content>\r\n } @else {\r\n <div class=\"file-list\">\r\n @for (file of files(); track file.id) {\r\n <div [class]=\"'file ' + file.state\">\r\n <ds-icon class=\"icon\" [name]=\"fileIcon(file.state)\" [size]=\"20\"></ds-icon>\r\n <div class=\"main\">\r\n <div class=\"name\">{{ file.name }}</div>\r\n <div class=\"meta\">{{ formatSize(file.size) }} \u00B7 {{ file.state }}</div>\r\n @if (file.state === 'uploading') {\r\n <div class=\"progress\"><div class=\"progress-fill\" [style.width.%]=\"file.progress\"></div></div>\r\n }\r\n </div>\r\n <button class=\"remove\" type=\"button\" [attr.aria-label]=\"'Remove ' + file.name\" (click)=\"onRemove(file); $event.preventDefault(); $event.stopPropagation()\">\r\n <ds-icon name=\"x\" [size]=\"14\"></ds-icon>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n</label>\r\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;min-width:0}.dz-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.dropzone:focus-within{outline:var(--border-width-strong, 2px) solid var(--primary);outline-offset:2px}.dropzone{flex:1;--_dropzone-bg: var(--ds-dropzone-bg, var(--surface-default));--_dropzone-bg-hover: var(--ds-dropzone-bg-hover, var(--primary-subtle));--_dropzone-bg-active: var(--ds-dropzone-bg-active, var(--primary-subtle));--_dropzone-border: var(--ds-dropzone-border, var(--border-default));--_dropzone-border-hover: var(--ds-dropzone-border-hover, var(--primary));--_dropzone-border-active: var(--ds-dropzone-border-active, var(--primary));--_dropzone-fg: var(--ds-dropzone-fg, var(--text-secondary));--_dropzone-fg-active: var(--ds-dropzone-fg-active, var(--primary-strong));--_dropzone-radius: var(--ds-dropzone-radius, var(--radius-lg));--_dropzone-file-progress: var(--ds-dropzone-file-progress, var(--primary));--_dropzone-file-success: var(--ds-dropzone-file-success, var(--success));--_dropzone-file-error: var(--ds-dropzone-file-error, var(--error));display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);border:var(--border-width-strong) dashed var(--_dropzone-border);border-radius:var(--_dropzone-radius);padding:var(--space-6);text-align:center;background:var(--_dropzone-bg);cursor:pointer;min-height:160px}.dropzone:hover{border-color:var(--_dropzone-border-hover);background:var(--_dropzone-bg-hover)}.dropzone.active{border-color:var(--_dropzone-border-active);background:var(--_dropzone-bg-active)}.dropzone.has-files{align-items:stretch;text-align:left;min-height:0;cursor:default}.dropzone.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed;pointer-events:none}.dropzone.single{max-width:var(--col-cap-text)}.dropzone .title{font:var(--font-weight-bold) var(--font-size-m)/var(--line-height-snug) var(--font-heading);margin:0 0 var(--space-1)}.dropzone .hint{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_dropzone-fg)}.dropzone [hint]{margin:var(--space-3) calc(var(--space-6) * -1) 0;padding:var(--space-3) var(--space-6) 0;border-top:var(--border-width-default) solid var(--border-subtle);align-self:stretch;text-align:center;font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary);letter-spacing:var(--letter-spacing-wide)}.dropzone .file-list{width:100%;margin-top:var(--space-4);display:grid;gap:var(--space-2)}.dropzone .file{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);background:var(--surface-default)}.dropzone .file .icon{flex-shrink:0;color:var(--icon-default)}.dropzone .file .main{flex:1;min-width:0}.dropzone .file .name{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary)}.dropzone .file .meta{font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary)}.dropzone .file .progress{height:var(--border-width-strong);background:var(--surface-secondary);border-radius:var(--radius-pill);margin-top:var(--space-1)}.dropzone .file .progress-fill{height:100%;background:var(--_dropzone-file-progress);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}.dropzone .file .remove{background:none;border:0;cursor:pointer;color:var(--icon-default)}.dropzone .file .remove:hover{color:var(--icon-strong)}.dropzone .file.uploading .icon{color:var(--_dropzone-file-progress)}.dropzone .file.success{border-color:var(--_dropzone-file-success)}.dropzone .file.success .icon{color:var(--_dropzone-file-success)}.dropzone .file.error{border-color:var(--_dropzone-file-error)}.dropzone .file.error .icon{color:var(--_dropzone-file-error)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
2118
|
+
}
|
|
2119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DropzoneComponent, decorators: [{
|
|
2120
|
+
type: Component,
|
|
2121
|
+
args: [{ selector: 'ds-dropzone', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<label\r\n [class]=\"classes()\"\r\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\r\n (dragover)=\"onDragOver($event)\"\r\n (dragleave)=\"onDragLeave()\"\r\n (drop)=\"onDrop($event)\"\r\n>\r\n <input\r\n type=\"file\"\r\n class=\"dz-input\"\r\n aria-label=\"Upload files\"\r\n [attr.accept]=\"accept() || null\"\r\n [multiple]=\"single() ? false : multiple()\"\r\n [disabled]=\"disabled()\"\r\n (change)=\"onPickerChange($event)\"\r\n />\r\n @if (files().length === 0) {\r\n <ds-icon name=\"upload\" [size]=\"24\"></ds-icon>\r\n <div class=\"title\">Drop files here</div>\r\n <div class=\"hint\">or click to browse</div>\r\n <ng-content select=\"[hint]\"></ng-content>\r\n } @else {\r\n <div class=\"file-list\">\r\n @for (file of files(); track file.id) {\r\n <div [class]=\"'file ' + file.state\">\r\n <ds-icon class=\"icon\" [name]=\"fileIcon(file.state)\" [size]=\"20\"></ds-icon>\r\n <div class=\"main\">\r\n <div class=\"name\">{{ file.name }}</div>\r\n <div class=\"meta\">{{ formatSize(file.size) }} \u00B7 {{ file.state }}</div>\r\n @if (file.state === 'uploading') {\r\n <div class=\"progress\"><div class=\"progress-fill\" [style.width.%]=\"file.progress\"></div></div>\r\n }\r\n </div>\r\n <button class=\"remove\" type=\"button\" [attr.aria-label]=\"'Remove ' + file.name\" (click)=\"onRemove(file); $event.preventDefault(); $event.stopPropagation()\">\r\n <ds-icon name=\"x\" [size]=\"14\"></ds-icon>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n</label>\r\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;min-width:0}.dz-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.dropzone:focus-within{outline:var(--border-width-strong, 2px) solid var(--primary);outline-offset:2px}.dropzone{flex:1;--_dropzone-bg: var(--ds-dropzone-bg, var(--surface-default));--_dropzone-bg-hover: var(--ds-dropzone-bg-hover, var(--primary-subtle));--_dropzone-bg-active: var(--ds-dropzone-bg-active, var(--primary-subtle));--_dropzone-border: var(--ds-dropzone-border, var(--border-default));--_dropzone-border-hover: var(--ds-dropzone-border-hover, var(--primary));--_dropzone-border-active: var(--ds-dropzone-border-active, var(--primary));--_dropzone-fg: var(--ds-dropzone-fg, var(--text-secondary));--_dropzone-fg-active: var(--ds-dropzone-fg-active, var(--primary-strong));--_dropzone-radius: var(--ds-dropzone-radius, var(--radius-lg));--_dropzone-file-progress: var(--ds-dropzone-file-progress, var(--primary));--_dropzone-file-success: var(--ds-dropzone-file-success, var(--success));--_dropzone-file-error: var(--ds-dropzone-file-error, var(--error));display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);border:var(--border-width-strong) dashed var(--_dropzone-border);border-radius:var(--_dropzone-radius);padding:var(--space-6);text-align:center;background:var(--_dropzone-bg);cursor:pointer;min-height:160px}.dropzone:hover{border-color:var(--_dropzone-border-hover);background:var(--_dropzone-bg-hover)}.dropzone.active{border-color:var(--_dropzone-border-active);background:var(--_dropzone-bg-active)}.dropzone.has-files{align-items:stretch;text-align:left;min-height:0;cursor:default}.dropzone.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed;pointer-events:none}.dropzone.single{max-width:var(--col-cap-text)}.dropzone .title{font:var(--font-weight-bold) var(--font-size-m)/var(--line-height-snug) var(--font-heading);margin:0 0 var(--space-1)}.dropzone .hint{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_dropzone-fg)}.dropzone [hint]{margin:var(--space-3) calc(var(--space-6) * -1) 0;padding:var(--space-3) var(--space-6) 0;border-top:var(--border-width-default) solid var(--border-subtle);align-self:stretch;text-align:center;font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary);letter-spacing:var(--letter-spacing-wide)}.dropzone .file-list{width:100%;margin-top:var(--space-4);display:grid;gap:var(--space-2)}.dropzone .file{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);background:var(--surface-default)}.dropzone .file .icon{flex-shrink:0;color:var(--icon-default)}.dropzone .file .main{flex:1;min-width:0}.dropzone .file .name{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-primary)}.dropzone .file .meta{font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary)}.dropzone .file .progress{height:var(--border-width-strong);background:var(--surface-secondary);border-radius:var(--radius-pill);margin-top:var(--space-1)}.dropzone .file .progress-fill{height:100%;background:var(--_dropzone-file-progress);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}.dropzone .file .remove{background:none;border:0;cursor:pointer;color:var(--icon-default)}.dropzone .file .remove:hover{color:var(--icon-strong)}.dropzone .file.uploading .icon{color:var(--_dropzone-file-progress)}.dropzone .file.success{border-color:var(--_dropzone-file-success)}.dropzone .file.success .icon{color:var(--_dropzone-file-success)}.dropzone .file.error{border-color:var(--_dropzone-file-error)}.dropzone .file.error .icon{color:var(--_dropzone-file-error)}\n"] }]
|
|
2122
|
+
}], propDecorators: { accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }, { type: i0.Output, args: ["filesChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], single: [{ type: i0.Input, args: [{ isSignal: true, alias: "single", required: false }] }], filesAdded: [{ type: i0.Output, args: ["filesAdded"] }], fileRemoved: [{ type: i0.Output, args: ["fileRemoved"] }] } });
|
|
2123
|
+
|
|
2124
|
+
class MenuItemComponent {
|
|
2125
|
+
// The containing overlay (e.g. popover), if any — selecting an item closes it.
|
|
2126
|
+
// Optional, so menu-items also work standalone.
|
|
2127
|
+
closeRef = inject(DsOverlayCloseRef, { optional: true });
|
|
2128
|
+
button = viewChild.required('button');
|
|
2129
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2130
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2131
|
+
danger = input(false, ...(ngDevMode ? [{ debugName: "danger" }] : /* istanbul ignore next */ []));
|
|
2132
|
+
pressed = output();
|
|
2133
|
+
/** Roving tabindex, owned by ds-menu — exactly one item is tabbable (0), the
|
|
2134
|
+
* rest -1. Defaults true so a standalone item (outside ds-menu) stays
|
|
2135
|
+
* reachable. */
|
|
2136
|
+
tabbable = signal(true, ...(ngDevMode ? [{ debugName: "tabbable" }] : /* istanbul ignore next */ []));
|
|
2137
|
+
/** Move keyboard focus to this item's control. */
|
|
2138
|
+
focus() {
|
|
2139
|
+
this.button().nativeElement.focus();
|
|
2140
|
+
}
|
|
2141
|
+
/** Whether `node` lives inside this item's control (used by ds-menu to find
|
|
2142
|
+
* the currently focused item during keyboard nav). */
|
|
2143
|
+
contains(node) {
|
|
2144
|
+
return !!node && this.button().nativeElement.contains(node);
|
|
2145
|
+
}
|
|
2146
|
+
/** Visible label text — used by ds-menu's type-ahead. */
|
|
2147
|
+
label() {
|
|
2148
|
+
return this.button().nativeElement.textContent?.trim() ?? '';
|
|
2149
|
+
}
|
|
2150
|
+
onClick(event) {
|
|
2151
|
+
if (this.disabled())
|
|
2152
|
+
return;
|
|
2153
|
+
this.pressed.emit(event);
|
|
2154
|
+
this.closeRef?.close();
|
|
2155
|
+
}
|
|
2156
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: MenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2157
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: MenuItemComponent, isStandalone: true, selector: "ds-menu-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, danger: { classPropertyName: "danger", publicName: "danger", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed" }, host: { attributes: { "role": "none" } }, viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\r\n #button\r\n class=\"menu-item\"\r\n type=\"button\"\r\n role=\"menuitem\"\r\n [attr.tabindex]=\"tabbable() ? 0 : -1\"\r\n [disabled]=\"disabled()\"\r\n [class.danger]=\"danger()\"\r\n (click)=\"onClick($event)\"\r\n>\r\n @if (icon()) {\r\n <ds-icon [name]=\"icon()!\" [size]=\"16\"></ds-icon>\r\n } @else {\r\n <span class=\"menu-item-icon\"><ng-content select=\"[icon]\"></ng-content></span>\r\n }\r\n <span><ng-content></ng-content></span>\r\n</button>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.menu-item{--_menu-item-fg: var(--ds-menu-item-fg, var(--text-primary));display:flex;align-items:center;gap:var(--space-2-5);width:100%;padding:var(--space-2) var(--space-3);background:transparent;border:0;border-radius:var(--radius-md);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_menu-item-fg);cursor:pointer;text-align:left;transition:background var(--duration-fast) var(--ease-standard)}.menu-item:hover{background:var(--surface-secondary)}.menu-item:focus-visible{outline:none;box-shadow:inset var(--focus-ring)}.menu-item[disabled]{color:var(--text-disabled);cursor:not-allowed;opacity:var(--opacity-muted)}.menu-item[disabled]:hover{background:transparent}.menu-item.danger{color:var(--error-text)}.menu-item.danger:hover{background:var(--error-subtle)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
2158
|
+
}
|
|
2159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: MenuItemComponent, decorators: [{
|
|
2160
|
+
type: Component,
|
|
2161
|
+
args: [{ selector: 'ds-menu-item', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, host: { role: 'none' }, template: "<button\r\n #button\r\n class=\"menu-item\"\r\n type=\"button\"\r\n role=\"menuitem\"\r\n [attr.tabindex]=\"tabbable() ? 0 : -1\"\r\n [disabled]=\"disabled()\"\r\n [class.danger]=\"danger()\"\r\n (click)=\"onClick($event)\"\r\n>\r\n @if (icon()) {\r\n <ds-icon [name]=\"icon()!\" [size]=\"16\"></ds-icon>\r\n } @else {\r\n <span class=\"menu-item-icon\"><ng-content select=\"[icon]\"></ng-content></span>\r\n }\r\n <span><ng-content></ng-content></span>\r\n</button>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.menu-item{--_menu-item-fg: var(--ds-menu-item-fg, var(--text-primary));display:flex;align-items:center;gap:var(--space-2-5);width:100%;padding:var(--space-2) var(--space-3);background:transparent;border:0;border-radius:var(--radius-md);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_menu-item-fg);cursor:pointer;text-align:left;transition:background var(--duration-fast) var(--ease-standard)}.menu-item:hover{background:var(--surface-secondary)}.menu-item:focus-visible{outline:none;box-shadow:inset var(--focus-ring)}.menu-item[disabled]{color:var(--text-disabled);cursor:not-allowed;opacity:var(--opacity-muted)}.menu-item[disabled]:hover{background:transparent}.menu-item.danger{color:var(--error-text)}.menu-item.danger:hover{background:var(--error-subtle)}\n"] }]
|
|
2162
|
+
}], propDecorators: { button: [{ type: i0.ViewChild, args: ['button', { isSignal: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], danger: [{ type: i0.Input, args: [{ isSignal: true, alias: "danger", required: false }] }], pressed: [{ type: i0.Output, args: ["pressed"] }] } });
|
|
2163
|
+
|
|
2164
|
+
class MenuComponent {
|
|
2165
|
+
items = contentChildren(MenuItemComponent, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
2166
|
+
/** Index of the roving-focus item — the single item reachable via Tab. */
|
|
2167
|
+
activeIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
2168
|
+
constructor() {
|
|
2169
|
+
// Roving tabindex: exactly one enabled item is tabbable (0), the rest -1.
|
|
2170
|
+
effect(() => {
|
|
2171
|
+
const items = this.items();
|
|
2172
|
+
if (!items.length)
|
|
2173
|
+
return;
|
|
2174
|
+
let index = this.activeIndex();
|
|
2175
|
+
if (index >= items.length || items[index].disabled()) {
|
|
2176
|
+
index = items.findIndex((item) => !item.disabled());
|
|
2177
|
+
}
|
|
2178
|
+
items.forEach((item, i) => item.tabbable.set(i === index));
|
|
2179
|
+
});
|
|
2180
|
+
}
|
|
2181
|
+
onKeydown(event) {
|
|
2182
|
+
const items = this.items();
|
|
2183
|
+
if (!items.length)
|
|
2184
|
+
return;
|
|
2185
|
+
const count = items.length;
|
|
2186
|
+
const focused = items.findIndex((item) => item.contains(event.target));
|
|
2187
|
+
const from = focused >= 0 ? focused : this.activeIndex();
|
|
2188
|
+
// Single-character type-ahead: jump to the next enabled item whose label
|
|
2189
|
+
// starts with the typed character.
|
|
2190
|
+
if (event.key.length === 1 &&
|
|
2191
|
+
/\S/.test(event.key) &&
|
|
2192
|
+
!event.ctrlKey &&
|
|
2193
|
+
!event.metaKey &&
|
|
2194
|
+
!event.altKey) {
|
|
2195
|
+
this.typeAhead(event.key, from, items);
|
|
2196
|
+
event.preventDefault();
|
|
2197
|
+
return;
|
|
2198
|
+
}
|
|
2199
|
+
let next;
|
|
2200
|
+
switch (event.key) {
|
|
2201
|
+
case 'ArrowDown':
|
|
2202
|
+
next = (from + 1) % count;
|
|
2203
|
+
break;
|
|
2204
|
+
case 'ArrowUp':
|
|
2205
|
+
next = (from - 1 + count) % count;
|
|
2206
|
+
break;
|
|
2207
|
+
case 'Home':
|
|
2208
|
+
next = 0;
|
|
2209
|
+
break;
|
|
2210
|
+
case 'End':
|
|
2211
|
+
next = count - 1;
|
|
2212
|
+
break;
|
|
2213
|
+
default: return;
|
|
2214
|
+
}
|
|
2215
|
+
event.preventDefault();
|
|
2216
|
+
// Skip disabled items in the travel direction (guard against all-disabled).
|
|
2217
|
+
const step = event.key === 'ArrowUp' || event.key === 'End' ? -1 : 1;
|
|
2218
|
+
let guard = 0;
|
|
2219
|
+
while (items[next]?.disabled() && guard < count) {
|
|
2220
|
+
next = (next + step + count) % count;
|
|
2221
|
+
guard++;
|
|
2222
|
+
}
|
|
2223
|
+
if (!items[next] || items[next].disabled())
|
|
2224
|
+
return;
|
|
2225
|
+
this.focusItem(next);
|
|
2226
|
+
}
|
|
2227
|
+
typeAhead(char, from, items) {
|
|
2228
|
+
const needle = char.toLowerCase();
|
|
2229
|
+
const count = items.length;
|
|
2230
|
+
for (let offset = 1; offset <= count; offset++) {
|
|
2231
|
+
const i = (from + offset) % count;
|
|
2232
|
+
const item = items[i];
|
|
2233
|
+
if (!item.disabled() && item.label().toLowerCase().startsWith(needle)) {
|
|
2234
|
+
this.focusItem(i);
|
|
2235
|
+
return;
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
focusItem(index) {
|
|
2240
|
+
this.activeIndex.set(index);
|
|
2241
|
+
this.items()[index].focus();
|
|
2242
|
+
}
|
|
2243
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: MenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2244
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.14", type: MenuComponent, isStandalone: true, selector: "ds-menu", host: { listeners: { "keydown": "onKeydown($event)" } }, queries: [{ propertyName: "items", predicate: MenuItemComponent, isSignal: true }], ngImport: i0, template: "<ul class=\"menu\" role=\"menu\">\r\n <ng-content></ng-content>\r\n</ul>\r\n", styles: [":host{display:block;background:var(--surface-default);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-md);padding:var(--space-1)}:host-context(.popover){background:transparent;border:0;border-radius:0;padding:0}.menu{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-0-5)}\n"] });
|
|
2245
|
+
}
|
|
2246
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: MenuComponent, decorators: [{
|
|
2247
|
+
type: Component,
|
|
2248
|
+
args: [{ selector: 'ds-menu', standalone: true, encapsulation: ViewEncapsulation.Emulated, host: { '(keydown)': 'onKeydown($event)' }, template: "<ul class=\"menu\" role=\"menu\">\r\n <ng-content></ng-content>\r\n</ul>\r\n", styles: [":host{display:block;background:var(--surface-default);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-md);padding:var(--space-1)}:host-context(.popover){background:transparent;border:0;border-radius:0;padding:0}.menu{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-0-5)}\n"] }]
|
|
2249
|
+
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => MenuItemComponent), { isSignal: true }] }] } });
|
|
2250
|
+
|
|
2251
|
+
class SpinnerComponent {
|
|
2252
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2253
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2254
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: SpinnerComponent, isStandalone: true, selector: "ds-spinner", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "status", "aria-label": "Loading" }, properties: { "class.sm": "size() === 'sm'", "class.lg": "size() === 'lg'" } }, ngImport: i0, template: '', isInline: true, styles: ["@charset \"UTF-8\";:host{display:inline-block;width:var(--spinner-md);height:var(--spinner-md);border:var(--spinner-bw) solid var(--border-default);border-top-color:var(--primary);border-radius:var(--radius-pill);animation:spinner-rotate var(--duration-loop-fast) linear infinite}:host(.sm){width:var(--spinner-sm);height:var(--spinner-sm);border-width:var(--border-width-default)}:host(.lg){width:var(--spinner-lg);height:var(--spinner-lg);border-width:var(--border-width-strong)}@keyframes spinner-rotate{to{transform:rotate(360deg)}}\n"] });
|
|
2255
|
+
}
|
|
2256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SpinnerComponent, decorators: [{
|
|
2257
|
+
type: Component,
|
|
2258
|
+
args: [{ selector: 'ds-spinner', standalone: true, template: '', host: {
|
|
2259
|
+
'role': 'status',
|
|
2260
|
+
'aria-label': 'Loading',
|
|
2261
|
+
'[class.sm]': "size() === 'sm'",
|
|
2262
|
+
'[class.lg]': "size() === 'lg'",
|
|
2263
|
+
}, encapsulation: ViewEncapsulation.Emulated, styles: ["@charset \"UTF-8\";:host{display:inline-block;width:var(--spinner-md);height:var(--spinner-md);border:var(--spinner-bw) solid var(--border-default);border-top-color:var(--primary);border-radius:var(--radius-pill);animation:spinner-rotate var(--duration-loop-fast) linear infinite}:host(.sm){width:var(--spinner-sm);height:var(--spinner-sm);border-width:var(--border-width-default)}:host(.lg){width:var(--spinner-lg);height:var(--spinner-lg);border-width:var(--border-width-strong)}@keyframes spinner-rotate{to{transform:rotate(360deg)}}\n"] }]
|
|
2264
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
2265
|
+
|
|
2266
|
+
class EmptyStateComponent {
|
|
2267
|
+
variant = input('none', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2268
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2269
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2270
|
+
body = input('', ...(ngDevMode ? [{ debugName: "body" }] : /* istanbul ignore next */ []));
|
|
2271
|
+
classes = computed(() => {
|
|
2272
|
+
const variant = this.variant();
|
|
2273
|
+
return variant === 'none' ? 'empty-state' : `empty-state ${variant}`;
|
|
2274
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2275
|
+
resolvedIcon = computed(() => {
|
|
2276
|
+
const explicit = this.icon();
|
|
2277
|
+
if (explicit)
|
|
2278
|
+
return explicit;
|
|
2279
|
+
const variant = this.variant();
|
|
2280
|
+
if (variant === 'error')
|
|
2281
|
+
return 'warn';
|
|
2282
|
+
if (variant === 'locked')
|
|
2283
|
+
return 'lock';
|
|
2284
|
+
if (variant === 'success')
|
|
2285
|
+
return 'success';
|
|
2286
|
+
if (variant === 'loading')
|
|
2287
|
+
return 'package';
|
|
2288
|
+
return 'package';
|
|
2289
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedIcon" }] : /* istanbul ignore next */ []));
|
|
2290
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: EmptyStateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2291
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", 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: "<span [class]=\"classes()\">\n <span class=\"icon-tile\">\n <ds-icon [name]=\"resolvedIcon()\" [size]=\"28\"></ds-icon>\n </span>\n @if (title()) { <span class=\"title\">{{ title() }}</span> }\n @if (body()) { <span class=\"body\">{{ body() }}</span> }\n <span class=\"cta\"><ng-content select=\"[actions]\"></ng-content></span>\n @if (variant() === 'loading') {\n <span class=\"overlay-spin\"><ds-spinner size=\"lg\" /></span>\n }\n</span>\n", styles: ["@charset \"UTF-8\";:host{display:block}.empty-state{--_es-tile-bg: var(--ds-empty-state-tile-bg, var(--surface-tint));--_es-tile-fg: var(--ds-empty-state-tile-fg, var(--text-secondary));--_es-title-fg: var(--ds-empty-state-title-fg, var(--text-primary));--_es-body-fg: var(--ds-empty-state-body-fg, 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: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:var(--_es-tile-bg);color:var(--_es-tile-fg);display:grid;place-items:center;margin-bottom:var(--space-2)}.empty-state .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_es-title-fg);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-fg);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 .overlay-spin{position:absolute;inset:0;display:grid;place-items:center;z-index:1}.empty-state .overlay-spin:before{content:\"\";position:absolute;inset:0;background:#ffffff80;-webkit-backdrop-filter:blur(var(--blur-sm));backdrop-filter:blur(var(--blur-sm));border-radius:inherit}.empty-state .overlay-spin .spinner{position:relative;z-index:1}.empty-state.error{--_es-tile-bg: var(--ds-empty-state-tile-bg, var(--error-subtle));--_es-tile-fg: var(--ds-empty-state-tile-fg, var(--error-text))}.empty-state.locked{--_es-tile-bg: var(--ds-empty-state-tile-bg, var(--surface-muted));--_es-tile-fg: var(--ds-empty-state-tile-fg, var(--text-tertiary))}.empty-state.success{--_es-tile-bg: var(--ds-empty-state-tile-bg, var(--success-subtle));--_es-tile-fg: var(--ds-empty-state-tile-fg, var(--success-text))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: SpinnerComponent, selector: "ds-spinner", inputs: ["size"] }] });
|
|
2292
|
+
}
|
|
2293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: EmptyStateComponent, decorators: [{
|
|
2294
|
+
type: Component,
|
|
2295
|
+
args: [{ selector: 'ds-empty-state', standalone: true, imports: [IconComponent, SpinnerComponent], encapsulation: ViewEncapsulation.Emulated, template: "<span [class]=\"classes()\">\n <span class=\"icon-tile\">\n <ds-icon [name]=\"resolvedIcon()\" [size]=\"28\"></ds-icon>\n </span>\n @if (title()) { <span class=\"title\">{{ title() }}</span> }\n @if (body()) { <span class=\"body\">{{ body() }}</span> }\n <span class=\"cta\"><ng-content select=\"[actions]\"></ng-content></span>\n @if (variant() === 'loading') {\n <span class=\"overlay-spin\"><ds-spinner size=\"lg\" /></span>\n }\n</span>\n", styles: ["@charset \"UTF-8\";:host{display:block}.empty-state{--_es-tile-bg: var(--ds-empty-state-tile-bg, var(--surface-tint));--_es-tile-fg: var(--ds-empty-state-tile-fg, var(--text-secondary));--_es-title-fg: var(--ds-empty-state-title-fg, var(--text-primary));--_es-body-fg: var(--ds-empty-state-body-fg, 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: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:var(--_es-tile-bg);color:var(--_es-tile-fg);display:grid;place-items:center;margin-bottom:var(--space-2)}.empty-state .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);color:var(--_es-title-fg);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-fg);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 .overlay-spin{position:absolute;inset:0;display:grid;place-items:center;z-index:1}.empty-state .overlay-spin:before{content:\"\";position:absolute;inset:0;background:#ffffff80;-webkit-backdrop-filter:blur(var(--blur-sm));backdrop-filter:blur(var(--blur-sm));border-radius:inherit}.empty-state .overlay-spin .spinner{position:relative;z-index:1}.empty-state.error{--_es-tile-bg: var(--ds-empty-state-tile-bg, var(--error-subtle));--_es-tile-fg: var(--ds-empty-state-tile-fg, var(--error-text))}.empty-state.locked{--_es-tile-bg: var(--ds-empty-state-tile-bg, var(--surface-muted));--_es-tile-fg: var(--ds-empty-state-tile-fg, var(--text-tertiary))}.empty-state.success{--_es-tile-bg: var(--ds-empty-state-tile-bg, var(--success-subtle));--_es-tile-fg: var(--ds-empty-state-tile-fg, var(--success-text))}\n"] }]
|
|
2296
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], body: [{ type: i0.Input, args: [{ isSignal: true, alias: "body", required: false }] }] } });
|
|
2297
|
+
|
|
2298
|
+
class ProgressComponent {
|
|
2299
|
+
value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2300
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2301
|
+
/** Accessible name for the progress bar (e.g. "Upload progress"). */
|
|
2302
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
2303
|
+
clampedValue = computed(() => {
|
|
2304
|
+
const v = this.value();
|
|
2305
|
+
return Math.max(0, Math.min(100, v));
|
|
2306
|
+
}, ...(ngDevMode ? [{ debugName: "clampedValue" }] : /* istanbul ignore next */ []));
|
|
2307
|
+
isIndet = computed(() => this.variant() === 'indeterminate', ...(ngDevMode ? [{ debugName: "isIndet" }] : /* istanbul ignore next */ []));
|
|
2308
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2309
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: ProgressComponent, isStandalone: true, selector: "ds-progress", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar", "aria-valuemin": "0", "aria-valuemax": "100" }, properties: { "attr.aria-valuenow": "isIndet() ? null : clampedValue()", "attr.aria-label": "ariaLabel()", "class.success": "variant() === 'success'", "class.warn": "variant() === 'warn'", "class.error": "variant() === 'error'", "class.indeterminate": "isIndet()" } }, ngImport: i0, template: "@if (isIndet()) {\n <span></span>\n} @else {\n <span [style.width.%]=\"clampedValue()\"></span>\n}\n", styles: [":host{display:block;width:100%;height:var(--progress-h);background:var(--surface-muted);border-radius:var(--radius-pill);overflow:hidden}:host>span{display:block;height:100%;background:var(--primary);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}:host(.success)>span{background:var(--success)}:host(.warn)>span{background:var(--warning-hover)}:host(.error)>span{background:var(--error)}:host(.indeterminate)>span{width:30%;animation:progress-indet var(--duration-loop-slow) var(--ease-standard) infinite}@keyframes progress-indet{0%{transform:translate(-100%)}to{transform:translate(400%)}}\n"] });
|
|
2310
|
+
}
|
|
2311
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ProgressComponent, decorators: [{
|
|
2312
|
+
type: Component,
|
|
2313
|
+
args: [{ selector: 'ds-progress', standalone: true, imports: [], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
2314
|
+
role: 'progressbar',
|
|
2315
|
+
'aria-valuemin': '0',
|
|
2316
|
+
'aria-valuemax': '100',
|
|
2317
|
+
'[attr.aria-valuenow]': 'isIndet() ? null : clampedValue()',
|
|
2318
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
2319
|
+
'[class.success]': "variant() === 'success'",
|
|
2320
|
+
'[class.warn]': "variant() === 'warn'",
|
|
2321
|
+
'[class.error]': "variant() === 'error'",
|
|
2322
|
+
'[class.indeterminate]': 'isIndet()',
|
|
2323
|
+
}, template: "@if (isIndet()) {\n <span></span>\n} @else {\n <span [style.width.%]=\"clampedValue()\"></span>\n}\n", styles: [":host{display:block;width:100%;height:var(--progress-h);background:var(--surface-muted);border-radius:var(--radius-pill);overflow:hidden}:host>span{display:block;height:100%;background:var(--primary);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}:host(.success)>span{background:var(--success)}:host(.warn)>span{background:var(--warning-hover)}:host(.error)>span{background:var(--error)}:host(.indeterminate)>span{width:30%;animation:progress-indet var(--duration-loop-slow) var(--ease-standard) infinite}@keyframes progress-indet{0%{transform:translate(-100%)}to{transform:translate(400%)}}\n"] }]
|
|
2324
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
2325
|
+
|
|
2326
|
+
class AccordionComponent {
|
|
2327
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2328
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.14", type: AccordionComponent, isStandalone: true, selector: "ds-accordion", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host{display:block;border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-lg);overflow:hidden}\n"] });
|
|
2329
|
+
}
|
|
2330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: AccordionComponent, decorators: [{
|
|
2331
|
+
type: Component,
|
|
2332
|
+
args: [{ selector: 'ds-accordion', standalone: true, imports: [], template: `<ng-content></ng-content>`, encapsulation: ViewEncapsulation.Emulated, styles: [":host{display:block;border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-lg);overflow:hidden}\n"] }]
|
|
2333
|
+
}] });
|
|
2334
|
+
|
|
2335
|
+
let nextId$3 = 0;
|
|
2336
|
+
class AccordionItemComponent {
|
|
2337
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2338
|
+
expanded = model(false, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
2339
|
+
uid = `ds-accordion-${++nextId$3}`;
|
|
2340
|
+
headId = `${this.uid}-head`;
|
|
2341
|
+
bodyId = `${this.uid}-body`;
|
|
2342
|
+
toggle() {
|
|
2343
|
+
this.expanded.set(!this.expanded());
|
|
2344
|
+
}
|
|
2345
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: AccordionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2346
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: AccordionItemComponent, isStandalone: true, selector: "ds-accordion-item", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange" }, ngImport: i0, template: "<button\r\n type=\"button\"\r\n class=\"head\"\r\n [id]=\"headId\"\r\n [attr.aria-expanded]=\"expanded()\"\r\n [attr.aria-controls]=\"bodyId\"\r\n (click)=\"toggle()\"\r\n>\r\n <span>{{ title() }}</span>\r\n <ng-content select=\"[badge]\"></ng-content>\r\n <ds-icon name=\"chevronRight\" class=\"chev\" [size]=\"16\" />\r\n</button>\r\n@if (expanded()) {\r\n <div class=\"body\" role=\"region\" [id]=\"bodyId\" [attr.aria-labelledby]=\"headId\">\r\n <ng-content></ng-content>\r\n </div>\r\n}\r\n", styles: [":host{display:block}:host+:host{border-top:var(--border-width-default) solid var(--border-divider)}:host .head{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--space-3) var(--space-4);border:0;background:var(--surface-default);text-align:left;cursor:pointer;font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}:host .head:hover{background:var(--surface-secondary)}:host .head:focus-visible{outline:var(--border-width-strong, 2px) solid var(--primary);outline-offset:-2px}:host .head .chev{margin-left:auto;transition:transform var(--duration-base) var(--ease-standard);color:var(--icon-default)}:host .head[aria-expanded=true] .chev{transform:rotate(90deg)}:host .body{padding:0 var(--space-4) var(--space-4);color:var(--text-secondary);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
2347
|
+
}
|
|
2348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: AccordionItemComponent, decorators: [{
|
|
2349
|
+
type: Component,
|
|
2350
|
+
args: [{ selector: 'ds-accordion-item', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<button\r\n type=\"button\"\r\n class=\"head\"\r\n [id]=\"headId\"\r\n [attr.aria-expanded]=\"expanded()\"\r\n [attr.aria-controls]=\"bodyId\"\r\n (click)=\"toggle()\"\r\n>\r\n <span>{{ title() }}</span>\r\n <ng-content select=\"[badge]\"></ng-content>\r\n <ds-icon name=\"chevronRight\" class=\"chev\" [size]=\"16\" />\r\n</button>\r\n@if (expanded()) {\r\n <div class=\"body\" role=\"region\" [id]=\"bodyId\" [attr.aria-labelledby]=\"headId\">\r\n <ng-content></ng-content>\r\n </div>\r\n}\r\n", styles: [":host{display:block}:host+:host{border-top:var(--border-width-default) solid var(--border-divider)}:host .head{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--space-3) var(--space-4);border:0;background:var(--surface-default);text-align:left;cursor:pointer;font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}:host .head:hover{background:var(--surface-secondary)}:host .head:focus-visible{outline:var(--border-width-strong, 2px) solid var(--primary);outline-offset:-2px}:host .head .chev{margin-left:auto;transition:transform var(--duration-base) var(--ease-standard);color:var(--icon-default)}:host .head[aria-expanded=true] .chev{transform:rotate(90deg)}:host .body{padding:0 var(--space-4) var(--space-4);color:var(--text-secondary);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}\n"] }]
|
|
2351
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }, { type: i0.Output, args: ["expandedChange"] }] } });
|
|
2352
|
+
|
|
2353
|
+
class StepperComponent {
|
|
2354
|
+
steps = input([], ...(ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []));
|
|
2355
|
+
current = input(0, ...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
|
|
2356
|
+
stepState(i) {
|
|
2357
|
+
const c = this.current();
|
|
2358
|
+
if (i < c)
|
|
2359
|
+
return 'completed';
|
|
2360
|
+
if (i === c)
|
|
2361
|
+
return 'current';
|
|
2362
|
+
return 'upcoming';
|
|
2363
|
+
}
|
|
2364
|
+
nodeClass(i) {
|
|
2365
|
+
const c = this.current();
|
|
2366
|
+
if (i < c)
|
|
2367
|
+
return 'node done';
|
|
2368
|
+
if (i === c)
|
|
2369
|
+
return 'node active';
|
|
2370
|
+
return 'node';
|
|
2371
|
+
}
|
|
2372
|
+
barClass(i) {
|
|
2373
|
+
return i < this.current() ? 'bar done' : 'bar';
|
|
2374
|
+
}
|
|
2375
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: StepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2376
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: StepperComponent, isStandalone: true, selector: "ds-stepper", inputs: { steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, current: { classPropertyName: "current", publicName: "current", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "list", "aria-label": "Progress" } }, ngImport: i0, template: "@for (label of steps(); track $index; let i = $index, last = $last) {\r\n <span\r\n [class]=\"nodeClass(i)\"\r\n role=\"listitem\"\r\n [attr.aria-current]=\"i === current() ? 'step' : null\"\r\n >\r\n <span aria-hidden=\"true\">\r\n @if (i < current()) {\r\n <ds-icon name=\"check\" [size]=\"14\" />\r\n } @else {\r\n {{ i + 1 }}\r\n }\r\n </span>\r\n <span class=\"visually-hidden\">Step {{ i + 1 }}: {{ label }} ({{ stepState(i) }})</span>\r\n </span>\r\n @if (!last) {\r\n <span [class]=\"barClass(i)\" aria-hidden=\"true\"></span>\r\n }\r\n}\r\n", styles: [":host{display:inline-flex;align-items:center}:host .visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}:host .node{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(--surface-default);color:var(--text-tertiary);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans)}:host .node.done{background:var(--primary-subtle);border-color:var(--primary);color:var(--primary)}:host .node.active{background:var(--primary);border-color:var(--primary);color:var(--primary-on)}:host .bar{height:var(--stepper-bar-h);width:var(--stepper-bar-w);background:var(--border-divider)}:host .bar.done{background:var(--primary)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
2377
|
+
}
|
|
2378
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: StepperComponent, decorators: [{
|
|
2379
|
+
type: Component,
|
|
2380
|
+
args: [{ selector: 'ds-stepper', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, host: { role: 'list', 'aria-label': 'Progress' }, template: "@for (label of steps(); track $index; let i = $index, last = $last) {\r\n <span\r\n [class]=\"nodeClass(i)\"\r\n role=\"listitem\"\r\n [attr.aria-current]=\"i === current() ? 'step' : null\"\r\n >\r\n <span aria-hidden=\"true\">\r\n @if (i < current()) {\r\n <ds-icon name=\"check\" [size]=\"14\" />\r\n } @else {\r\n {{ i + 1 }}\r\n }\r\n </span>\r\n <span class=\"visually-hidden\">Step {{ i + 1 }}: {{ label }} ({{ stepState(i) }})</span>\r\n </span>\r\n @if (!last) {\r\n <span [class]=\"barClass(i)\" aria-hidden=\"true\"></span>\r\n }\r\n}\r\n", styles: [":host{display:inline-flex;align-items:center}:host .visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}:host .node{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(--surface-default);color:var(--text-tertiary);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans)}:host .node.done{background:var(--primary-subtle);border-color:var(--primary);color:var(--primary)}:host .node.active{background:var(--primary);border-color:var(--primary);color:var(--primary-on)}:host .bar{height:var(--stepper-bar-h);width:var(--stepper-bar-w);background:var(--border-divider)}:host .bar.done{background:var(--primary)}\n"] }]
|
|
2381
|
+
}], propDecorators: { steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: false }] }], current: [{ type: i0.Input, args: [{ isSignal: true, alias: "current", required: false }] }] } });
|
|
2382
|
+
|
|
2383
|
+
class TooltipPanelComponent {
|
|
2384
|
+
text = input.required(...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
2385
|
+
placement = input.required(...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
2386
|
+
panelId = input('', ...(ngDevMode ? [{ debugName: "panelId" }] : /* istanbul ignore next */ []));
|
|
2387
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TooltipPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2388
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: TooltipPanelComponent, isStandalone: true, selector: "ds-tooltip-panel", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: true, transformFunction: null }, panelId: { classPropertyName: "panelId", publicName: "panelId", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tooltip" }, properties: { "attr.id": "panelId()", "class.top": "placement() === 'top'", "class.bottom": "placement() === 'bottom'", "class.left": "placement() === 'left'", "class.right": "placement() === 'right'" } }, ngImport: i0, template: `{{ text() }}`, isInline: true, styles: ["@charset \"UTF-8\";:host{display:block;position:relative;background:var(--surface-inverted);color:var(--text-inverted);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--space-1-5) var(--space-2-5);border-radius:var(--radius-md);max-width:var(--tooltip-maxw);z-index:var(--layer-tooltip);box-shadow:var(--shadow-2)}:host:after{content:\"\";position:absolute;width:var(--space-2);height:var(--space-2);background:var(--surface-inverted);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"] });
|
|
2389
|
+
}
|
|
2390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TooltipPanelComponent, decorators: [{
|
|
2391
|
+
type: Component,
|
|
2392
|
+
args: [{ selector: 'ds-tooltip-panel', standalone: true, template: `{{ text() }}`, host: {
|
|
2393
|
+
role: 'tooltip',
|
|
2394
|
+
'[attr.id]': 'panelId()',
|
|
2395
|
+
'[class.top]': "placement() === 'top'",
|
|
2396
|
+
'[class.bottom]': "placement() === 'bottom'",
|
|
2397
|
+
'[class.left]': "placement() === 'left'",
|
|
2398
|
+
'[class.right]': "placement() === 'right'",
|
|
2399
|
+
}, encapsulation: ViewEncapsulation.Emulated, styles: ["@charset \"UTF-8\";:host{display:block;position:relative;background:var(--surface-inverted);color:var(--text-inverted);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--space-1-5) var(--space-2-5);border-radius:var(--radius-md);max-width:var(--tooltip-maxw);z-index:var(--layer-tooltip);box-shadow:var(--shadow-2)}:host:after{content:\"\";position:absolute;width:var(--space-2);height:var(--space-2);background:var(--surface-inverted);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"] }]
|
|
2400
|
+
}], 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 }] }] } });
|
|
2401
|
+
|
|
2402
|
+
let nextId$2 = 0;
|
|
2403
|
+
class TooltipDirective {
|
|
2404
|
+
overlay = inject(Overlay);
|
|
2405
|
+
host = inject((ElementRef));
|
|
2406
|
+
dsTooltip = input('', ...(ngDevMode ? [{ debugName: "dsTooltip" }] : /* istanbul ignore next */ []));
|
|
2407
|
+
dsTooltipPlacement = input('top', ...(ngDevMode ? [{ debugName: "dsTooltipPlacement" }] : /* istanbul ignore next */ []));
|
|
2408
|
+
dsTooltipDelay = input(120, ...(ngDevMode ? [{ debugName: "dsTooltipDelay" }] : /* istanbul ignore next */ []));
|
|
2409
|
+
ref = null;
|
|
2410
|
+
timer = null;
|
|
2411
|
+
tipId = `ds-tooltip-${++nextId$2}`;
|
|
2412
|
+
onOpen() {
|
|
2413
|
+
if (!this.dsTooltip())
|
|
2414
|
+
return;
|
|
2415
|
+
if (this.timer !== null)
|
|
2416
|
+
clearTimeout(this.timer);
|
|
2417
|
+
this.timer = window.setTimeout(() => this.show(), this.dsTooltipDelay());
|
|
2418
|
+
}
|
|
2419
|
+
onClose() {
|
|
2420
|
+
if (this.timer !== null) {
|
|
2421
|
+
clearTimeout(this.timer);
|
|
2422
|
+
this.timer = null;
|
|
2423
|
+
}
|
|
2424
|
+
this.ref?.dispose();
|
|
2425
|
+
this.ref = null;
|
|
2426
|
+
const host = this.host.nativeElement;
|
|
2427
|
+
const remaining = (host.getAttribute('aria-describedby') ?? '')
|
|
2428
|
+
.split(' ')
|
|
2429
|
+
.filter((id) => id && id !== this.tipId)
|
|
2430
|
+
.join(' ');
|
|
2431
|
+
if (remaining)
|
|
2432
|
+
host.setAttribute('aria-describedby', remaining);
|
|
2433
|
+
else
|
|
2434
|
+
host.removeAttribute('aria-describedby');
|
|
2435
|
+
}
|
|
2436
|
+
onEscape() {
|
|
2437
|
+
if (this.ref)
|
|
2438
|
+
this.onClose();
|
|
2439
|
+
}
|
|
2440
|
+
show() {
|
|
2441
|
+
const placement = this.dsTooltipPlacement();
|
|
2442
|
+
const positionStrategy = this.overlay.position()
|
|
2443
|
+
.flexibleConnectedTo(this.host)
|
|
2444
|
+
.withPositions([this.positionFor(placement)]);
|
|
2445
|
+
this.ref = this.overlay.create({
|
|
2446
|
+
positionStrategy,
|
|
2447
|
+
scrollStrategy: this.overlay.scrollStrategies.close(),
|
|
2448
|
+
});
|
|
2449
|
+
const cmpRef = this.ref.attach(new ComponentPortal(TooltipPanelComponent));
|
|
2450
|
+
cmpRef.setInput('text', this.dsTooltip());
|
|
2451
|
+
cmpRef.setInput('placement', placement);
|
|
2452
|
+
cmpRef.setInput('panelId', this.tipId);
|
|
2453
|
+
const host = this.host.nativeElement;
|
|
2454
|
+
const existing = host.getAttribute('aria-describedby');
|
|
2455
|
+
host.setAttribute('aria-describedby', existing ? `${existing} ${this.tipId}` : this.tipId);
|
|
2456
|
+
}
|
|
2457
|
+
positionFor(p) {
|
|
2458
|
+
switch (p) {
|
|
2459
|
+
case 'top':
|
|
2460
|
+
return { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -8 };
|
|
2461
|
+
case 'bottom':
|
|
2462
|
+
return { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 8 };
|
|
2463
|
+
case 'left':
|
|
2464
|
+
return { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -8 };
|
|
2465
|
+
case 'right':
|
|
2466
|
+
return { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 8 };
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
ngOnDestroy() {
|
|
2470
|
+
this.onClose();
|
|
2471
|
+
}
|
|
2472
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2473
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: TooltipDirective, isStandalone: true, selector: "[dsTooltip]", inputs: { dsTooltip: { classPropertyName: "dsTooltip", publicName: "dsTooltip", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipPlacement: { classPropertyName: "dsTooltipPlacement", publicName: "dsTooltipPlacement", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipDelay: { classPropertyName: "dsTooltipDelay", publicName: "dsTooltipDelay", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onOpen()", "focus": "onOpen()", "mouseleave": "onClose()", "blur": "onClose()", "keydown.escape": "onEscape()" } }, ngImport: i0 });
|
|
2474
|
+
}
|
|
2475
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
2476
|
+
type: Directive,
|
|
2477
|
+
args: [{
|
|
2478
|
+
selector: '[dsTooltip]',
|
|
2479
|
+
standalone: true,
|
|
2480
|
+
}]
|
|
2481
|
+
}], propDecorators: { dsTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltip", required: false }] }], dsTooltipPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipPlacement", required: false }] }], dsTooltipDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipDelay", required: false }] }], onOpen: [{
|
|
2482
|
+
type: HostListener,
|
|
2483
|
+
args: ['mouseenter']
|
|
2484
|
+
}, {
|
|
2485
|
+
type: HostListener,
|
|
2486
|
+
args: ['focus']
|
|
2487
|
+
}], onClose: [{
|
|
2488
|
+
type: HostListener,
|
|
2489
|
+
args: ['mouseleave']
|
|
2490
|
+
}, {
|
|
2491
|
+
type: HostListener,
|
|
2492
|
+
args: ['blur']
|
|
2493
|
+
}], onEscape: [{
|
|
2494
|
+
type: HostListener,
|
|
2495
|
+
args: ['keydown.escape']
|
|
2496
|
+
}] } });
|
|
2497
|
+
|
|
2498
|
+
class PopoverComponent {
|
|
2499
|
+
overlay = inject(Overlay);
|
|
2500
|
+
vcr = inject(ViewContainerRef);
|
|
2501
|
+
preview = inject(DsStaticPreview);
|
|
2502
|
+
panelTpl = viewChild('panel', ...(ngDevMode ? [{ debugName: "panelTpl" }] : /* istanbul ignore next */ []));
|
|
2503
|
+
ref = null;
|
|
2504
|
+
align = input('start', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
2505
|
+
/** ARIA role for the panel (e.g. 'dialog' for interactive popovers). When set,
|
|
2506
|
+
* the panel also traps focus, auto-captures it into the panel on open, and
|
|
2507
|
+
* restores it to the trigger on close (Escape or backdrop). Leave null for
|
|
2508
|
+
* plain, non-interactive text popovers. */
|
|
2509
|
+
panelRole = input(null, ...(ngDevMode ? [{ debugName: "panelRole" }] : /* istanbul ignore next */ []));
|
|
2510
|
+
/** Accessible name for the panel; pair with `panelRole`. */
|
|
2511
|
+
panelLabel = input(null, ...(ngDevMode ? [{ debugName: "panelLabel" }] : /* istanbul ignore next */ []));
|
|
2512
|
+
/** Open/closed state — for callers binding `aria-expanded` on the trigger. */
|
|
2513
|
+
opened = signal(false, ...(ngDevMode ? [{ debugName: "opened" }] : /* istanbul ignore next */ []));
|
|
2514
|
+
toggle(trigger) {
|
|
2515
|
+
if (this.preview.staticPreview())
|
|
2516
|
+
return;
|
|
2517
|
+
if (this.ref) {
|
|
2518
|
+
this.close();
|
|
2519
|
+
return;
|
|
2520
|
+
}
|
|
2521
|
+
const align = this.align();
|
|
2522
|
+
const positionStrategy = this.overlay.position()
|
|
2523
|
+
.flexibleConnectedTo(trigger)
|
|
2524
|
+
.withPositions([
|
|
2525
|
+
{ originX: align, originY: 'bottom', overlayX: align, overlayY: 'top', offsetY: 4 },
|
|
2526
|
+
{ originX: align, originY: 'top', overlayX: align, overlayY: 'bottom', offsetY: -4 },
|
|
2527
|
+
]);
|
|
2528
|
+
const cfg = {
|
|
2529
|
+
positionStrategy,
|
|
2530
|
+
hasBackdrop: true,
|
|
2531
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
2532
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
2533
|
+
};
|
|
2534
|
+
this.ref = this.overlay.create(cfg);
|
|
2535
|
+
this.ref.backdropClick().subscribe(() => this.close());
|
|
2536
|
+
this.ref.keydownEvents().subscribe((event) => {
|
|
2537
|
+
if (event.key === 'Escape') {
|
|
2538
|
+
event.preventDefault();
|
|
2539
|
+
this.close();
|
|
2540
|
+
trigger.focus();
|
|
2541
|
+
}
|
|
2542
|
+
});
|
|
2543
|
+
this.ref.attach(new TemplatePortal(this.panelTpl(), this.vcr));
|
|
2544
|
+
this.opened.set(true);
|
|
2545
|
+
}
|
|
2546
|
+
close() {
|
|
2547
|
+
this.ref?.dispose();
|
|
2548
|
+
this.ref = null;
|
|
2549
|
+
this.opened.set(false);
|
|
2550
|
+
}
|
|
2551
|
+
ngOnDestroy() {
|
|
2552
|
+
this.close();
|
|
2553
|
+
}
|
|
2554
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2555
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PopoverComponent, isStandalone: true, selector: "ds-popover", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, panelRole: { classPropertyName: "panelRole", publicName: "panelRole", isSignal: true, isRequired: false, transformFunction: null }, panelLabel: { classPropertyName: "panelLabel", publicName: "panelLabel", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: DsOverlayCloseRef, useExisting: forwardRef(() => PopoverComponent) }], viewQueries: [{ propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }], hostDirectives: [{ directive: DsStaticPreview, inputs: ["staticPreview", "staticPreview"] }], ngImport: i0, template: "<!-- Projected content is captured ONCE here and stamped into whichever render\n site is active \u2014 duplicating ng-content across branches breaks projection. -->\n<ng-template #content><ng-content /></ng-template>\n\n@if (preview.staticPreview()) {\n <div\n class=\"popover\"\n [attr.role]=\"panelRole()\"\n [attr.aria-label]=\"panelLabel()\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </div>\n}\n\n<ng-template #panel>\n <div\n class=\"popover\"\n [attr.role]=\"panelRole()\"\n [attr.aria-label]=\"panelLabel()\"\n [cdkTrapFocus]=\"!!panelRole()\"\n [cdkTrapFocusAutoCapture]=\"!!panelRole()\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:contents}.popover{background:var(--surface-overlay);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-lg);box-shadow:var(--shadow-popover);padding:var(--space-3);z-index:var(--layer-popover);max-width:var(--popover-maxw)}.popover:has(ds-menu){padding:0}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2556
|
+
}
|
|
2557
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PopoverComponent, decorators: [{
|
|
2558
|
+
type: Component,
|
|
2559
|
+
args: [{ selector: 'ds-popover', standalone: true, imports: [CdkTrapFocus, NgTemplateOutlet], encapsulation: ViewEncapsulation.Emulated, hostDirectives: [{ directive: DsStaticPreview, inputs: ['staticPreview'] }], providers: [{ provide: DsOverlayCloseRef, useExisting: forwardRef(() => PopoverComponent) }], template: "<!-- Projected content is captured ONCE here and stamped into whichever render\n site is active \u2014 duplicating ng-content across branches breaks projection. -->\n<ng-template #content><ng-content /></ng-template>\n\n@if (preview.staticPreview()) {\n <div\n class=\"popover\"\n [attr.role]=\"panelRole()\"\n [attr.aria-label]=\"panelLabel()\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </div>\n}\n\n<ng-template #panel>\n <div\n class=\"popover\"\n [attr.role]=\"panelRole()\"\n [attr.aria-label]=\"panelLabel()\"\n [cdkTrapFocus]=\"!!panelRole()\"\n [cdkTrapFocusAutoCapture]=\"!!panelRole()\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:contents}.popover{background:var(--surface-overlay);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-lg);box-shadow:var(--shadow-popover);padding:var(--space-3);z-index:var(--layer-popover);max-width:var(--popover-maxw)}.popover:has(ds-menu){padding:0}\n"] }]
|
|
2560
|
+
}], propDecorators: { panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], panelRole: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelRole", required: false }] }], panelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelLabel", required: false }] }] } });
|
|
2561
|
+
|
|
2562
|
+
/**
|
|
2563
|
+
* Single toast pill. Consumed by ToastRegion for service-driven runtime toasts
|
|
2564
|
+
* AND by static showcases that need to display a toast specimen inline.
|
|
2565
|
+
*/
|
|
2566
|
+
class ToastComponent {
|
|
2567
|
+
variant = input('info', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2568
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2569
|
+
message = input('', ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
2570
|
+
dismissible = input(false, ...(ngDevMode ? [{ debugName: "dismissible" }] : /* istanbul ignore next */ []));
|
|
2571
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2572
|
+
action = input(null, ...(ngDevMode ? [{ debugName: "action" }] : /* istanbul ignore next */ []));
|
|
2573
|
+
dismissed = output();
|
|
2574
|
+
onAction(action) {
|
|
2575
|
+
action.handler();
|
|
2576
|
+
this.dismissed.emit();
|
|
2577
|
+
}
|
|
2578
|
+
classes = computed(() => `toast ${this.variant()}`, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2579
|
+
/** Errors/warnings interrupt (assertive); info/success wait their turn. */
|
|
2580
|
+
role = computed(() => this.variant() === 'error' || this.variant() === 'warning' ? 'alert' : 'status', ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
2581
|
+
defaultIcon = computed(() => {
|
|
2582
|
+
switch (this.variant()) {
|
|
2583
|
+
case 'success': return 'success';
|
|
2584
|
+
case 'warning': return 'warn';
|
|
2585
|
+
case 'error': return 'error';
|
|
2586
|
+
default: return 'info';
|
|
2587
|
+
}
|
|
2588
|
+
}, ...(ngDevMode ? [{ debugName: "defaultIcon" }] : /* istanbul ignore next */ []));
|
|
2589
|
+
onDismiss() {
|
|
2590
|
+
this.dismissed.emit();
|
|
2591
|
+
}
|
|
2592
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2593
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: ToastComponent, isStandalone: true, selector: "ds-toast", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismissed: "dismissed" }, ngImport: i0, template: "<div\r\n [class]=\"classes()\"\r\n [attr.role]=\"role()\"\r\n [attr.aria-live]=\"role() === 'alert' ? 'assertive' : 'polite'\"\r\n aria-atomic=\"true\"\r\n>\r\n <ds-icon class=\"icon\" [name]=\"icon() ?? defaultIcon()\" [size]=\"16\" />\r\n <div class=\"body\">\r\n @if (title()) { <div class=\"title\">{{ title() }}</div> }\r\n {{ message() }}\r\n <ng-content></ng-content>\r\n </div>\r\n @if (action(); as act) {\r\n <button type=\"button\" class=\"action\" (click)=\"onAction(act)\">{{ act.label }}</button>\r\n }\r\n <span class=\"actions\"><ng-content select=\"[actions]\"></ng-content></span>\r\n @if (dismissible()) {\r\n <button type=\"button\" class=\"close\" (click)=\"onDismiss()\" aria-label=\"Dismiss\">\r\n <ds-icon name=\"x\" [size]=\"14\" />\r\n </button>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block;transition:opacity var(--duration-base) var(--ease-standard),transform var(--duration-base) var(--ease-standard)}:host(.leaving){opacity:0;transform:translateY(calc(var(--space-2) * -1));pointer-events:none}.toast{--_toast-bg: var(--ds-toast-bg, var(--surface-overlay));--_toast-border: var(--ds-toast-border, var(--border-default));display:flex;align-items:flex-start;gap:var(--space-3);background:var(--_toast-bg);border:var(--border-width-default) solid var(--_toast-border);border-left:var(--toast-bar-w) solid var(--primary);border-radius:var(--radius-lg);padding:var(--space-3) var(--space-4);box-shadow:var(--shadow-toast);min-width:var(--toast-minw);max-width:var(--toast-maxw);animation:ds-toast-in var(--duration-slow) var(--ease-decelerate)}.toast .icon{color:var(--primary);flex-shrink:0;margin-top:var(--space-0-5)}.toast .body{flex:1;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-secondary)}.toast .title{font-weight:var(--font-weight-bold);color:var(--text-primary);margin-bottom:var(--space-0-5)}.toast .close{border:0;background:transparent;color:var(--icon-default);cursor:pointer;padding:var(--space-0-5)}.toast .action{flex-shrink:0;align-self:center;border:0;background:transparent;color:var(--primary-strong);font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);cursor:pointer;padding:var(--space-1) var(--space-2);border-radius:var(--radius-sm)}.toast .action:hover{background:var(--surface-secondary)}.toast .action:focus-visible{outline:none;box-shadow:var(--focus-ring)}.toast .actions{display:inline-flex;align-items:center;gap:var(--space-2);flex-shrink:0}.toast .actions:empty{display:none}.toast.info{--_toast-bg: var(--ds-toast-bg-info, var(--ds-toast-bg, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-info, var(--ds-toast-border, var(--border-default)));border-left-color:var(--primary)}.toast.success{--_toast-bg: var(--ds-toast-bg-success, var(--ds-toast-bg, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-success, var(--ds-toast-border, var(--border-default)));border-left-color:var(--success)}.toast.success .icon{color:var(--success)}.toast.warning{--_toast-bg: var(--ds-toast-bg-warning, var(--ds-toast-bg, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-warning, var(--ds-toast-border, var(--border-default)));border-left-color:var(--warning-hover)}.toast.warning .icon{color:var(--warning-hover)}.toast.error{--_toast-bg: var(--ds-toast-bg-error, var(--ds-toast-bg, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-error, var(--ds-toast-border, var(--border-default)));border-left-color:var(--error)}.toast.error .icon{color:var(--error)}@keyframes ds-toast-in{0%{transform:translateY(calc(var(--space-2) * -1));opacity:0}to{transform:none;opacity:1}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
2594
|
+
}
|
|
2595
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ToastComponent, decorators: [{
|
|
2596
|
+
type: Component,
|
|
2597
|
+
args: [{ selector: 'ds-toast', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<div\r\n [class]=\"classes()\"\r\n [attr.role]=\"role()\"\r\n [attr.aria-live]=\"role() === 'alert' ? 'assertive' : 'polite'\"\r\n aria-atomic=\"true\"\r\n>\r\n <ds-icon class=\"icon\" [name]=\"icon() ?? defaultIcon()\" [size]=\"16\" />\r\n <div class=\"body\">\r\n @if (title()) { <div class=\"title\">{{ title() }}</div> }\r\n {{ message() }}\r\n <ng-content></ng-content>\r\n </div>\r\n @if (action(); as act) {\r\n <button type=\"button\" class=\"action\" (click)=\"onAction(act)\">{{ act.label }}</button>\r\n }\r\n <span class=\"actions\"><ng-content select=\"[actions]\"></ng-content></span>\r\n @if (dismissible()) {\r\n <button type=\"button\" class=\"close\" (click)=\"onDismiss()\" aria-label=\"Dismiss\">\r\n <ds-icon name=\"x\" [size]=\"14\" />\r\n </button>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block;transition:opacity var(--duration-base) var(--ease-standard),transform var(--duration-base) var(--ease-standard)}:host(.leaving){opacity:0;transform:translateY(calc(var(--space-2) * -1));pointer-events:none}.toast{--_toast-bg: var(--ds-toast-bg, var(--surface-overlay));--_toast-border: var(--ds-toast-border, var(--border-default));display:flex;align-items:flex-start;gap:var(--space-3);background:var(--_toast-bg);border:var(--border-width-default) solid var(--_toast-border);border-left:var(--toast-bar-w) solid var(--primary);border-radius:var(--radius-lg);padding:var(--space-3) var(--space-4);box-shadow:var(--shadow-toast);min-width:var(--toast-minw);max-width:var(--toast-maxw);animation:ds-toast-in var(--duration-slow) var(--ease-decelerate)}.toast .icon{color:var(--primary);flex-shrink:0;margin-top:var(--space-0-5)}.toast .body{flex:1;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-secondary)}.toast .title{font-weight:var(--font-weight-bold);color:var(--text-primary);margin-bottom:var(--space-0-5)}.toast .close{border:0;background:transparent;color:var(--icon-default);cursor:pointer;padding:var(--space-0-5)}.toast .action{flex-shrink:0;align-self:center;border:0;background:transparent;color:var(--primary-strong);font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);cursor:pointer;padding:var(--space-1) var(--space-2);border-radius:var(--radius-sm)}.toast .action:hover{background:var(--surface-secondary)}.toast .action:focus-visible{outline:none;box-shadow:var(--focus-ring)}.toast .actions{display:inline-flex;align-items:center;gap:var(--space-2);flex-shrink:0}.toast .actions:empty{display:none}.toast.info{--_toast-bg: var(--ds-toast-bg-info, var(--ds-toast-bg, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-info, var(--ds-toast-border, var(--border-default)));border-left-color:var(--primary)}.toast.success{--_toast-bg: var(--ds-toast-bg-success, var(--ds-toast-bg, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-success, var(--ds-toast-border, var(--border-default)));border-left-color:var(--success)}.toast.success .icon{color:var(--success)}.toast.warning{--_toast-bg: var(--ds-toast-bg-warning, var(--ds-toast-bg, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-warning, var(--ds-toast-border, var(--border-default)));border-left-color:var(--warning-hover)}.toast.warning .icon{color:var(--warning-hover)}.toast.error{--_toast-bg: var(--ds-toast-bg-error, var(--ds-toast-bg, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-error, var(--ds-toast-border, var(--border-default)));border-left-color:var(--error)}.toast.error .icon{color:var(--error)}@keyframes ds-toast-in{0%{transform:translateY(calc(var(--space-2) * -1));opacity:0}to{transform:none;opacity:1}}\n"] }]
|
|
2598
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: false }] }], dismissed: [{ type: i0.Output, args: ["dismissed"] }] } });
|
|
2599
|
+
|
|
2600
|
+
// Must match the leave transition on :host in toast.component.scss (--duration-base).
|
|
2601
|
+
const LEAVE_DURATION_MS = 180;
|
|
2602
|
+
class ToastRegionComponent {
|
|
2603
|
+
entries = signal([], ...(ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []));
|
|
2604
|
+
leaving = signal(new Set(), ...(ngDevMode ? [{ debugName: "leaving" }] : /* istanbul ignore next */ []));
|
|
2605
|
+
add(entry) {
|
|
2606
|
+
this.entries.update((existing) => [...existing, entry]);
|
|
2607
|
+
}
|
|
2608
|
+
remove(id) {
|
|
2609
|
+
if (this.leaving().has(id))
|
|
2610
|
+
return;
|
|
2611
|
+
this.leaving.update((set) => new Set(set).add(id));
|
|
2612
|
+
setTimeout(() => {
|
|
2613
|
+
this.entries.update((existing) => existing.filter((entry) => entry.id !== id));
|
|
2614
|
+
this.leaving.update((set) => {
|
|
2615
|
+
const next = new Set(set);
|
|
2616
|
+
next.delete(id);
|
|
2617
|
+
return next;
|
|
2618
|
+
});
|
|
2619
|
+
}, LEAVE_DURATION_MS);
|
|
2620
|
+
}
|
|
2621
|
+
isLeaving(id) {
|
|
2622
|
+
return this.leaving().has(id);
|
|
2623
|
+
}
|
|
2624
|
+
clear() {
|
|
2625
|
+
this.entries.set([]);
|
|
2626
|
+
this.leaving.set(new Set());
|
|
2627
|
+
}
|
|
2628
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ToastRegionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2629
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: ToastRegionComponent, isStandalone: true, selector: "ds-toast-region", host: { attributes: { "role": "region", "aria-label": "Notifications" } }, ngImport: i0, template: "@for (entry of entries(); track entry.id) {\r\n <ds-toast\r\n [variant]=\"entry.variant\"\r\n [title]=\"entry.title ?? ''\"\r\n [message]=\"entry.body\"\r\n [dismissible]=\"entry.dismissible\"\r\n [action]=\"entry.action ?? null\"\r\n [class.leaving]=\"isLeaving(entry.id)\"\r\n (dismissed)=\"remove(entry.id)\"\r\n />\r\n}\r\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: ["dismissed"] }] });
|
|
2630
|
+
}
|
|
2631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ToastRegionComponent, decorators: [{
|
|
2632
|
+
type: Component,
|
|
2633
|
+
args: [{ selector: 'ds-toast-region', standalone: true, imports: [ToastComponent], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
2634
|
+
role: 'region',
|
|
2635
|
+
'aria-label': 'Notifications',
|
|
2636
|
+
}, template: "@for (entry of entries(); track entry.id) {\r\n <ds-toast\r\n [variant]=\"entry.variant\"\r\n [title]=\"entry.title ?? ''\"\r\n [message]=\"entry.body\"\r\n [dismissible]=\"entry.dismissible\"\r\n [action]=\"entry.action ?? null\"\r\n [class.leaving]=\"isLeaving(entry.id)\"\r\n (dismissed)=\"remove(entry.id)\"\r\n />\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:var(--space-2)}\n"] }]
|
|
2637
|
+
}] });
|
|
2638
|
+
|
|
2639
|
+
const DS_TOAST_POSITION = new InjectionToken('DS_TOAST_POSITION');
|
|
2640
|
+
const DS_TOAST_POSITION_DEFAULT = {
|
|
2641
|
+
horizontalPosition: 'right',
|
|
2642
|
+
verticalPosition: 'top',
|
|
2643
|
+
offset: 'var(--space-6)',
|
|
2644
|
+
};
|
|
2645
|
+
|
|
2646
|
+
class ToastService {
|
|
2647
|
+
overlay = inject(Overlay);
|
|
2648
|
+
position = inject(DS_TOAST_POSITION, { optional: true });
|
|
2649
|
+
overlayRef = null;
|
|
2650
|
+
regionRef = null;
|
|
2651
|
+
nextId = 1;
|
|
2652
|
+
show(opts) {
|
|
2653
|
+
this.ensureRegion();
|
|
2654
|
+
const id = this.nextId++;
|
|
2655
|
+
const entry = {
|
|
2656
|
+
id,
|
|
2657
|
+
title: opts.title,
|
|
2658
|
+
body: opts.body,
|
|
2659
|
+
variant: opts.variant ?? 'info',
|
|
2660
|
+
dismissible: opts.dismissible ?? true,
|
|
2661
|
+
action: opts.action,
|
|
2662
|
+
};
|
|
2663
|
+
this.regionRef.instance.add(entry);
|
|
2664
|
+
const ref = {
|
|
2665
|
+
id,
|
|
2666
|
+
dismiss: () => this.regionRef?.instance.remove(id),
|
|
2667
|
+
};
|
|
2668
|
+
const duration = opts.durationMs ?? 5000;
|
|
2669
|
+
if (duration > 0) {
|
|
2670
|
+
window.setTimeout(() => ref.dismiss(), duration);
|
|
2671
|
+
}
|
|
2672
|
+
return ref;
|
|
2673
|
+
}
|
|
2674
|
+
dismissAll() {
|
|
2675
|
+
this.regionRef?.instance.clear();
|
|
2676
|
+
}
|
|
2677
|
+
ensureRegion() {
|
|
2678
|
+
if (this.overlayRef)
|
|
2679
|
+
return;
|
|
2680
|
+
this.overlayRef = this.overlay.create({
|
|
2681
|
+
hasBackdrop: false,
|
|
2682
|
+
panelClass: 'ds-toast-panel',
|
|
2683
|
+
positionStrategy: this.buildPositionStrategy(),
|
|
2684
|
+
});
|
|
2685
|
+
this.regionRef = this.overlayRef.attach(new ComponentPortal(ToastRegionComponent));
|
|
2686
|
+
}
|
|
2687
|
+
buildPositionStrategy() {
|
|
2688
|
+
const config = this.position ?? DS_TOAST_POSITION_DEFAULT;
|
|
2689
|
+
const strategy = this.overlay.position().global();
|
|
2690
|
+
if (config.verticalPosition === 'top')
|
|
2691
|
+
strategy.top(config.offset);
|
|
2692
|
+
else
|
|
2693
|
+
strategy.bottom(config.offset);
|
|
2694
|
+
if (config.horizontalPosition === 'left')
|
|
2695
|
+
strategy.left(config.offset);
|
|
2696
|
+
else if (config.horizontalPosition === 'right')
|
|
2697
|
+
strategy.right(config.offset);
|
|
2698
|
+
else
|
|
2699
|
+
strategy.centerHorizontally();
|
|
2700
|
+
return strategy;
|
|
2701
|
+
}
|
|
2702
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2703
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ToastService, providedIn: 'root' });
|
|
2704
|
+
}
|
|
2705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ToastService, decorators: [{
|
|
2706
|
+
type: Injectable,
|
|
2707
|
+
args: [{ providedIn: 'root' }]
|
|
2708
|
+
}] });
|
|
2709
|
+
|
|
2710
|
+
let nextId$1 = 0;
|
|
2711
|
+
class DrawerComponent {
|
|
2712
|
+
doc = inject(DOCUMENT);
|
|
2713
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
2714
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2715
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2716
|
+
closed = output();
|
|
2717
|
+
titleId = `ds-drawer-title-${++nextId$1}`;
|
|
2718
|
+
classes = computed(() => this.size() === 'lg' ? 'drawer lg' : 'drawer', ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2719
|
+
constructor() {
|
|
2720
|
+
effect(() => {
|
|
2721
|
+
this.doc.body.style.overflow = this.open() ? 'hidden' : '';
|
|
2722
|
+
});
|
|
2723
|
+
inject(DestroyRef).onDestroy(() => {
|
|
2724
|
+
this.doc.body.style.overflow = '';
|
|
2725
|
+
});
|
|
2726
|
+
}
|
|
2727
|
+
onClose() {
|
|
2728
|
+
this.open.set(false);
|
|
2729
|
+
this.closed.emit();
|
|
2730
|
+
}
|
|
2731
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2732
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", 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 }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", closed: "closed" }, ngImport: i0, template: "@if (open()) {\r\n <div class=\"drawer-scrim\" (click)=\"onClose()\"></div>\r\n <div\r\n [class]=\"classes()\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"title() ? titleId : null\"\r\n cdkTrapFocus\r\n cdkTrapFocusAutoCapture\r\n (keydown.escape)=\"onClose()\"\r\n >\r\n <header class=\"header\">\r\n <h4 class=\"title\" [id]=\"titleId\">{{ title() }}</h4>\r\n <button type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"onClose()\">\r\n <ds-icon name=\"x\" [size]=\"16\" />\r\n </button>\r\n </header>\r\n <div class=\"body\"><ng-content select=\"[drawer-body]\"></ng-content></div>\r\n <div class=\"footer\"><ng-content select=\"[drawer-footer]\"></ng-content></div>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:contents}.drawer-scrim{position:fixed;inset:0;background:var(--scrim, hsla(220, 20%, 12%, .45));z-index:var(--layer-modal);animation:drawer-scrim-in var(--duration-fast, .12s) var(--ease-decelerate, ease-out)}@keyframes drawer-scrim-in{0%{opacity:0}to{opacity:1}}.drawer{position:fixed;top:0;right:0;bottom:0;width:var(--drawer-w-md);max-width:100vw;background:var(--surface-overlay);box-shadow:var(--shadow-modal);z-index:var(--layer-modal);display:flex;flex-direction:column;animation:drawer-in var(--duration-slow) var(--ease-decelerate)}.drawer.lg{width:var(--drawer-w-lg)}.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(--border-divider)}.drawer .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);margin:0;flex:1}.drawer .close{background:transparent;border:0;width:var(--modal-close-size);height:var(--modal-close-size);color:var(--icon-default);cursor:pointer;padding:0}.drawer .close:hover{color:var(--icon-strong)}.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(--border-divider);display:flex;gap:var(--space-2);justify-content:flex-end}@keyframes drawer-in{0%{transform:translate(100%)}to{transform:none}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
2733
|
+
}
|
|
2734
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
2735
|
+
type: Component,
|
|
2736
|
+
args: [{ selector: 'ds-drawer', standalone: true, imports: [IconComponent, A11yModule], encapsulation: ViewEncapsulation.Emulated, template: "@if (open()) {\r\n <div class=\"drawer-scrim\" (click)=\"onClose()\"></div>\r\n <div\r\n [class]=\"classes()\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"title() ? titleId : null\"\r\n cdkTrapFocus\r\n cdkTrapFocusAutoCapture\r\n (keydown.escape)=\"onClose()\"\r\n >\r\n <header class=\"header\">\r\n <h4 class=\"title\" [id]=\"titleId\">{{ title() }}</h4>\r\n <button type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"onClose()\">\r\n <ds-icon name=\"x\" [size]=\"16\" />\r\n </button>\r\n </header>\r\n <div class=\"body\"><ng-content select=\"[drawer-body]\"></ng-content></div>\r\n <div class=\"footer\"><ng-content select=\"[drawer-footer]\"></ng-content></div>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:contents}.drawer-scrim{position:fixed;inset:0;background:var(--scrim, hsla(220, 20%, 12%, .45));z-index:var(--layer-modal);animation:drawer-scrim-in var(--duration-fast, .12s) var(--ease-decelerate, ease-out)}@keyframes drawer-scrim-in{0%{opacity:0}to{opacity:1}}.drawer{position:fixed;top:0;right:0;bottom:0;width:var(--drawer-w-md);max-width:100vw;background:var(--surface-overlay);box-shadow:var(--shadow-modal);z-index:var(--layer-modal);display:flex;flex-direction:column;animation:drawer-in var(--duration-slow) var(--ease-decelerate)}.drawer.lg{width:var(--drawer-w-lg)}.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(--border-divider)}.drawer .title{font:var(--font-weight-bold) var(--font-size-h5)/var(--line-height-snug) var(--font-sans);margin:0;flex:1}.drawer .close{background:transparent;border:0;width:var(--modal-close-size);height:var(--modal-close-size);color:var(--icon-default);cursor:pointer;padding:0}.drawer .close:hover{color:var(--icon-strong)}.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(--border-divider);display:flex;gap:var(--space-2);justify-content:flex-end}@keyframes drawer-in{0%{transform:translate(100%)}to{transform:none}}\n"] }]
|
|
2737
|
+
}], 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 }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
2738
|
+
|
|
2739
|
+
/** Bottom-anchored sheet — the mobile sibling of ds-drawer. Closes on scrim
|
|
2740
|
+
* tap, Escape, or a downward drag on the grab strip. While open it locks
|
|
2741
|
+
* body scroll. On wide viewports the panel is capped by
|
|
2742
|
+
* --ds-bottom-sheet-maxw and centred; prefer ds-modal / ds-drawer for
|
|
2743
|
+
* desktop-first layouts. position: fixed resolves against the nearest
|
|
2744
|
+
* ancestor containing block, so framed hosts contain the sheet. */
|
|
2745
|
+
class BottomSheetComponent {
|
|
2746
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
2747
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2748
|
+
closed = output();
|
|
2749
|
+
doc = inject(DOCUMENT$1);
|
|
2750
|
+
sheetRef = viewChild('sheet', ...(ngDevMode ? [{ debugName: "sheetRef" }] : /* istanbul ignore next */ []));
|
|
2751
|
+
dragOffset = signal(null, ...(ngDevMode ? [{ debugName: "dragOffset" }] : /* istanbul ignore next */ []));
|
|
2752
|
+
dragStartY = 0;
|
|
2753
|
+
lastMoveY = 0;
|
|
2754
|
+
lastMoveTime = 0;
|
|
2755
|
+
velocity = 0;
|
|
2756
|
+
previousBodyOverflow = null;
|
|
2757
|
+
constructor() {
|
|
2758
|
+
effect((onCleanup) => {
|
|
2759
|
+
if (!this.open())
|
|
2760
|
+
return;
|
|
2761
|
+
this.previousBodyOverflow = this.doc.body.style.overflow;
|
|
2762
|
+
this.doc.body.style.overflow = 'hidden';
|
|
2763
|
+
onCleanup(() => {
|
|
2764
|
+
this.doc.body.style.overflow = this.previousBodyOverflow ?? '';
|
|
2765
|
+
this.previousBodyOverflow = null;
|
|
2766
|
+
});
|
|
2767
|
+
});
|
|
2768
|
+
}
|
|
2769
|
+
close() {
|
|
2770
|
+
this.dragOffset.set(null);
|
|
2771
|
+
this.open.set(false);
|
|
2772
|
+
this.closed.emit();
|
|
2773
|
+
}
|
|
2774
|
+
onEscape() {
|
|
2775
|
+
if (this.open())
|
|
2776
|
+
this.close();
|
|
2777
|
+
}
|
|
2778
|
+
stop(event) {
|
|
2779
|
+
event.stopPropagation();
|
|
2780
|
+
}
|
|
2781
|
+
onGrabStart(event) {
|
|
2782
|
+
event.target.setPointerCapture(event.pointerId);
|
|
2783
|
+
this.dragStartY = event.clientY;
|
|
2784
|
+
this.lastMoveY = event.clientY;
|
|
2785
|
+
this.lastMoveTime = event.timeStamp;
|
|
2786
|
+
this.velocity = 0;
|
|
2787
|
+
this.dragOffset.set(0);
|
|
2788
|
+
}
|
|
2789
|
+
onGrabMove(event) {
|
|
2790
|
+
if (this.dragOffset() === null)
|
|
2791
|
+
return;
|
|
2792
|
+
const deltaTime = event.timeStamp - this.lastMoveTime;
|
|
2793
|
+
if (deltaTime > 0) {
|
|
2794
|
+
this.velocity = (event.clientY - this.lastMoveY) / deltaTime;
|
|
2795
|
+
}
|
|
2796
|
+
this.lastMoveY = event.clientY;
|
|
2797
|
+
this.lastMoveTime = event.timeStamp;
|
|
2798
|
+
this.dragOffset.set(Math.max(0, event.clientY - this.dragStartY));
|
|
2799
|
+
}
|
|
2800
|
+
onGrabEnd() {
|
|
2801
|
+
const offset = this.dragOffset();
|
|
2802
|
+
if (offset === null)
|
|
2803
|
+
return;
|
|
2804
|
+
const sheetHeight = this.sheetRef()?.nativeElement.offsetHeight ?? 0;
|
|
2805
|
+
const pastThreshold = sheetHeight > 0 && offset > sheetHeight * 0.3;
|
|
2806
|
+
const flicked = this.velocity > 0.5;
|
|
2807
|
+
if (pastThreshold || flicked) {
|
|
2808
|
+
this.close();
|
|
2809
|
+
}
|
|
2810
|
+
else {
|
|
2811
|
+
this.dragOffset.set(null);
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2815
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", 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: false, transformFunction: null } }, outputs: { open: "openChange", closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, viewQueries: [{ propertyName: "sheetRef", first: true, predicate: ["sheet"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (open()) {\r\n <div class=\"sheet-overlay\" (click)=\"close()\">\r\n <div\r\n #sheet\r\n class=\"sheet\"\r\n [class.dragging]=\"dragOffset() !== null\"\r\n [style.transform]=\"dragOffset() ? 'translateY(' + dragOffset() + 'px)' : null\"\r\n (click)=\"stop($event)\"\r\n >\r\n <div\r\n class=\"grab\"\r\n (pointerdown)=\"onGrabStart($event)\"\r\n (pointermove)=\"onGrabMove($event)\"\r\n (pointerup)=\"onGrabEnd()\"\r\n (pointercancel)=\"onGrabEnd()\"\r\n >\r\n <div class=\"sheet-handle\"></div>\r\n </div>\r\n @if (title()) {\r\n <h3 class=\"sheet-title\">{{ title() }}</h3>\r\n }\r\n <div class=\"sheet-body\">\r\n <ng-content />\r\n </div>\r\n <div class=\"sheet-actions\">\r\n <ng-content select=\"[actions]\" />\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";: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(--radius-lg));display:contents}.sheet-overlay{position:fixed;inset:0;z-index:var(--layer-modal);background:var(--surface-scrim);display:flex;flex-direction:column;justify-content:flex-end;animation:ds-sheet-fade-in var(--duration-fast) var(--ease-decelerate)}.sheet{position:relative;width:min(100%,var(--_bottom-sheet-maxw));margin-inline:auto;background:var(--surface-default);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));animation:ds-sheet-up var(--duration-base) var(--ease-decelerate);max-height:var(--_bottom-sheet-maxh);display:flex;flex-direction:column;transition:transform var(--duration-base) var(--ease-decelerate)}.sheet.dragging{transition:none}.grab{padding:var(--space-3) 0;margin:0 calc(var(--space-4) * -1);cursor:grab;touch-action:none}.sheet-handle{width:36px;height:4px;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(--text-primary);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)}@keyframes ds-sheet-fade-in{0%{opacity:0}to{opacity:1}}@keyframes ds-sheet-up{0%{transform:translateY(100%)}to{transform:none}}\n"] });
|
|
2816
|
+
}
|
|
2817
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BottomSheetComponent, decorators: [{
|
|
2818
|
+
type: Component,
|
|
2819
|
+
args: [{ selector: 'ds-bottom-sheet', standalone: true, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
2820
|
+
'(document:keydown.escape)': 'onEscape()',
|
|
2821
|
+
}, template: "@if (open()) {\r\n <div class=\"sheet-overlay\" (click)=\"close()\">\r\n <div\r\n #sheet\r\n class=\"sheet\"\r\n [class.dragging]=\"dragOffset() !== null\"\r\n [style.transform]=\"dragOffset() ? 'translateY(' + dragOffset() + 'px)' : null\"\r\n (click)=\"stop($event)\"\r\n >\r\n <div\r\n class=\"grab\"\r\n (pointerdown)=\"onGrabStart($event)\"\r\n (pointermove)=\"onGrabMove($event)\"\r\n (pointerup)=\"onGrabEnd()\"\r\n (pointercancel)=\"onGrabEnd()\"\r\n >\r\n <div class=\"sheet-handle\"></div>\r\n </div>\r\n @if (title()) {\r\n <h3 class=\"sheet-title\">{{ title() }}</h3>\r\n }\r\n <div class=\"sheet-body\">\r\n <ng-content />\r\n </div>\r\n <div class=\"sheet-actions\">\r\n <ng-content select=\"[actions]\" />\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";: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(--radius-lg));display:contents}.sheet-overlay{position:fixed;inset:0;z-index:var(--layer-modal);background:var(--surface-scrim);display:flex;flex-direction:column;justify-content:flex-end;animation:ds-sheet-fade-in var(--duration-fast) var(--ease-decelerate)}.sheet{position:relative;width:min(100%,var(--_bottom-sheet-maxw));margin-inline:auto;background:var(--surface-default);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));animation:ds-sheet-up var(--duration-base) var(--ease-decelerate);max-height:var(--_bottom-sheet-maxh);display:flex;flex-direction:column;transition:transform var(--duration-base) var(--ease-decelerate)}.sheet.dragging{transition:none}.grab{padding:var(--space-3) 0;margin:0 calc(var(--space-4) * -1);cursor:grab;touch-action:none}.sheet-handle{width:36px;height:4px;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(--text-primary);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)}@keyframes ds-sheet-fade-in{0%{opacity:0}to{opacity:1}}@keyframes ds-sheet-up{0%{transform:translateY(100%)}to{transform:none}}\n"] }]
|
|
2822
|
+
}], 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: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], sheetRef: [{ type: i0.ViewChild, args: ['sheet', { isSignal: true }] }] } });
|
|
2823
|
+
|
|
2824
|
+
class TagComponent {
|
|
2825
|
+
variant = input('solid', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2826
|
+
closable = input(false, { ...(ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2827
|
+
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2828
|
+
selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2829
|
+
/** Accessible label for the close button (e.g. "Remove Source filter"). */
|
|
2830
|
+
closeLabel = input('Remove', ...(ngDevMode ? [{ debugName: "closeLabel" }] : /* istanbul ignore next */ []));
|
|
2831
|
+
closed = output();
|
|
2832
|
+
toggled = output();
|
|
2833
|
+
onClick() {
|
|
2834
|
+
if (this.interactive())
|
|
2835
|
+
this.toggled.emit();
|
|
2836
|
+
}
|
|
2837
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2838
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: TagComponent, isStandalone: true, selector: "ds-tag", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed", toggled: "toggled" }, host: { listeners: { "click": "onClick()" }, properties: { "class.neutral": "variant() === 'neutral'", "class.closable": "closable()", "class.interactive": "interactive()", "class.is-active": "selected()" } }, ngImport: i0, template: "<ng-content></ng-content>\r\n@if (closable()) {\r\n <button type=\"button\" class=\"close\" [attr.aria-label]=\"closeLabel()\" (click)=\"$event.stopPropagation(); closed.emit()\">\r\n <ds-icon name=\"x\" [size]=\"12\" />\r\n </button>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{--_tag-pad-y: var(--ds-tag-pad-y, var(--tag-pad-y));--_tag-pad-x: var(--ds-tag-pad-x, var(--tag-pad-x));--_tag-radius: var(--ds-tag-radius, var(--radius-md));--_tag-bg: var(--ds-tag-bg, var(--primary));--_tag-fw: var(--ds-tag-fw, var(--font-weight-bold));--_tag-fs: var(--ds-tag-fs, var(--font-size-xs));--_tag-lh: var(--ds-tag-lh, var(--line-height-base));display:inline-flex;align-items:center;gap:var(--tag-gap);padding:var(--_tag-pad-y) var(--_tag-pad-x);border-radius:var(--_tag-radius);background:var(--_tag-bg);color:var(--primary-on);font:var(--_tag-fw) var(--_tag-fs)/var(--_tag-lh) var(--font-sans)}:host(.closable){padding-right:var(--tag-pad-x-close)}:host(.neutral){--_tag-bg: var(--ds-tag-bg, var(--surface-secondary));background:var(--_tag-bg);color:var(--text-primary);border:var(--border-width-default) solid var(--border-divider);padding:calc(var(--_tag-pad-y) - var(--border-width-default)) calc(var(--_tag-pad-x) - var(--border-width-default))}:host(.neutral.closable){padding-right:calc(var(--tag-pad-x-close) - 1px)}:host(.interactive){cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}:host(.interactive:hover):not(.is-active){--_tag-hover-bg: var(--ds-tag-hover-bg, var(--surface-muted));background:var(--_tag-hover-bg);color:var(--text-primary)}:host(.interactive.is-active){--_tag-active-bg: var(--ds-tag-active-bg, var(--primary-muted));--_tag-active-fg: var(--ds-tag-active-fg, var(--primary-strong));--_tag-active-border: var(--ds-tag-active-border, var(--primary));background:var(--_tag-active-bg);color:var(--_tag-active-fg);box-shadow:inset 0 0 0 var(--border-width-default) var(--_tag-active-border)}.close{display:inline-flex;align-items:center;justify-content:center;border:0;color:inherit;font:inherit;cursor:pointer;border-radius:var(--radius-sm);padding:var(--tag-close-pad);margin-left:var(--tag-close-pad);background:color-mix(in oklab,currentColor calc(var(--opacity-state-hover) * 100%),transparent);transition:background var(--duration-fast) var(--ease-standard)}.close:hover{background:color-mix(in oklab,currentColor calc(var(--opacity-state-pressed) * 100%),transparent)}.close:focus-visible{outline:var(--border-width-strong, 2px) solid var(--focus-ring-color, currentColor);outline-offset:1px}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
2839
|
+
}
|
|
2840
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: TagComponent, decorators: [{
|
|
2841
|
+
type: Component,
|
|
2842
|
+
args: [{ selector: 'ds-tag', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
2843
|
+
'[class.neutral]': "variant() === 'neutral'",
|
|
2844
|
+
'[class.closable]': 'closable()',
|
|
2845
|
+
'[class.interactive]': 'interactive()',
|
|
2846
|
+
'[class.is-active]': 'selected()',
|
|
2847
|
+
'(click)': 'onClick()',
|
|
2848
|
+
}, template: "<ng-content></ng-content>\r\n@if (closable()) {\r\n <button type=\"button\" class=\"close\" [attr.aria-label]=\"closeLabel()\" (click)=\"$event.stopPropagation(); closed.emit()\">\r\n <ds-icon name=\"x\" [size]=\"12\" />\r\n </button>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{--_tag-pad-y: var(--ds-tag-pad-y, var(--tag-pad-y));--_tag-pad-x: var(--ds-tag-pad-x, var(--tag-pad-x));--_tag-radius: var(--ds-tag-radius, var(--radius-md));--_tag-bg: var(--ds-tag-bg, var(--primary));--_tag-fw: var(--ds-tag-fw, var(--font-weight-bold));--_tag-fs: var(--ds-tag-fs, var(--font-size-xs));--_tag-lh: var(--ds-tag-lh, var(--line-height-base));display:inline-flex;align-items:center;gap:var(--tag-gap);padding:var(--_tag-pad-y) var(--_tag-pad-x);border-radius:var(--_tag-radius);background:var(--_tag-bg);color:var(--primary-on);font:var(--_tag-fw) var(--_tag-fs)/var(--_tag-lh) var(--font-sans)}:host(.closable){padding-right:var(--tag-pad-x-close)}:host(.neutral){--_tag-bg: var(--ds-tag-bg, var(--surface-secondary));background:var(--_tag-bg);color:var(--text-primary);border:var(--border-width-default) solid var(--border-divider);padding:calc(var(--_tag-pad-y) - var(--border-width-default)) calc(var(--_tag-pad-x) - var(--border-width-default))}:host(.neutral.closable){padding-right:calc(var(--tag-pad-x-close) - 1px)}:host(.interactive){cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}:host(.interactive:hover):not(.is-active){--_tag-hover-bg: var(--ds-tag-hover-bg, var(--surface-muted));background:var(--_tag-hover-bg);color:var(--text-primary)}:host(.interactive.is-active){--_tag-active-bg: var(--ds-tag-active-bg, var(--primary-muted));--_tag-active-fg: var(--ds-tag-active-fg, var(--primary-strong));--_tag-active-border: var(--ds-tag-active-border, var(--primary));background:var(--_tag-active-bg);color:var(--_tag-active-fg);box-shadow:inset 0 0 0 var(--border-width-default) var(--_tag-active-border)}.close{display:inline-flex;align-items:center;justify-content:center;border:0;color:inherit;font:inherit;cursor:pointer;border-radius:var(--radius-sm);padding:var(--tag-close-pad);margin-left:var(--tag-close-pad);background:color-mix(in oklab,currentColor calc(var(--opacity-state-hover) * 100%),transparent);transition:background var(--duration-fast) var(--ease-standard)}.close:hover{background:color-mix(in oklab,currentColor calc(var(--opacity-state-pressed) * 100%),transparent)}.close:focus-visible{outline:var(--border-width-strong, 2px) solid var(--focus-ring-color, currentColor);outline-offset:1px}\n"] }]
|
|
2849
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], toggled: [{ type: i0.Output, args: ["toggled"] }] } });
|
|
2850
|
+
|
|
2851
|
+
class W3wComponent {
|
|
2852
|
+
prefix = input('///', ...(ngDevMode ? [{ debugName: "prefix" }] : /* istanbul ignore next */ []));
|
|
2853
|
+
address = input.required(...(ngDevMode ? [{ debugName: "address" }] : /* istanbul ignore next */ []));
|
|
2854
|
+
copyable = input(true, ...(ngDevMode ? [{ debugName: "copyable" }] : /* istanbul ignore next */ []));
|
|
2855
|
+
copied = output();
|
|
2856
|
+
onKeyActivate(event) {
|
|
2857
|
+
event.preventDefault();
|
|
2858
|
+
this.onCopy();
|
|
2859
|
+
}
|
|
2860
|
+
onCopy() {
|
|
2861
|
+
if (!this.copyable())
|
|
2862
|
+
return;
|
|
2863
|
+
const text = `${this.prefix()}${this.address()}`;
|
|
2864
|
+
if (typeof navigator !== 'undefined' && navigator.clipboard) {
|
|
2865
|
+
void navigator.clipboard.writeText(text);
|
|
2866
|
+
}
|
|
2867
|
+
this.copied.emit(this.address());
|
|
2868
|
+
}
|
|
2869
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: W3wComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2870
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: W3wComponent, isStandalone: true, selector: "ds-w3w", inputs: { prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, address: { classPropertyName: "address", publicName: "address", isSignal: true, isRequired: true, transformFunction: null }, copyable: { classPropertyName: "copyable", publicName: "copyable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { copied: "copied" }, host: { listeners: { "click": "onCopy()", "keydown.enter": "onCopy()", "keydown.space": "onKeyActivate($event)" }, properties: { "attr.role": "copyable() ? 'button' : null", "attr.tabindex": "copyable() ? 0 : null", "attr.aria-label": "copyable() ? ('Copy what3words address ' + prefix() + address()) : null" } }, ngImport: i0, template: "<ds-icon name=\"map\" [size]=\"14\" />\n<span><span class=\"mark\">{{ prefix() }}</span>{{ address() }}</span>\n@if (copyable()) { <ds-icon name=\"copy\" [size]=\"12\" /> }\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex;align-items:center;gap:var(--space-1-5);padding:var(--space-1) var(--space-2);background:var(--primary-subtle);color:var(--primary);border-radius:var(--radius-md);font-family:var(--font-mono);font-size:var(--font-size-mono);cursor:pointer;transition:background var(--duration-fast) var(--ease-standard)}:host:hover{background:var(--primary-muted)}:host .mark{color:var(--error);font-weight:var(--font-weight-bold)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
2871
|
+
}
|
|
2872
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: W3wComponent, decorators: [{
|
|
2873
|
+
type: Component,
|
|
2874
|
+
args: [{ selector: 'ds-w3w', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
2875
|
+
'[attr.role]': "copyable() ? 'button' : null",
|
|
2876
|
+
'[attr.tabindex]': 'copyable() ? 0 : null',
|
|
2877
|
+
'[attr.aria-label]': "copyable() ? ('Copy what3words address ' + prefix() + address()) : null",
|
|
2878
|
+
'(click)': 'onCopy()',
|
|
2879
|
+
'(keydown.enter)': 'onCopy()',
|
|
2880
|
+
'(keydown.space)': 'onKeyActivate($event)',
|
|
2881
|
+
}, template: "<ds-icon name=\"map\" [size]=\"14\" />\n<span><span class=\"mark\">{{ prefix() }}</span>{{ address() }}</span>\n@if (copyable()) { <ds-icon name=\"copy\" [size]=\"12\" /> }\n", styles: ["@charset \"UTF-8\";:host{display:inline-flex;align-items:center;gap:var(--space-1-5);padding:var(--space-1) var(--space-2);background:var(--primary-subtle);color:var(--primary);border-radius:var(--radius-md);font-family:var(--font-mono);font-size:var(--font-size-mono);cursor:pointer;transition:background var(--duration-fast) var(--ease-standard)}:host:hover{background:var(--primary-muted)}:host .mark{color:var(--error);font-weight:var(--font-weight-bold)}\n"] }]
|
|
2882
|
+
}], propDecorators: { prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], address: [{ type: i0.Input, args: [{ isSignal: true, alias: "address", required: true }] }], copyable: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyable", required: false }] }], copied: [{ type: i0.Output, args: ["copied"] }] } });
|
|
2883
|
+
|
|
2884
|
+
class PageFooterComponent {
|
|
2885
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2886
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PageFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2887
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: PageFooterComponent, isStandalone: true, selector: "ds-page-footer", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.compact": "variant() === 'compact'", "class.save": "variant() === 'save'" } }, ngImport: i0, template: "<ng-content select=\"[brand]\"></ng-content>\n<ng-content select=\"[nav]\"></ng-content>\n<ng-content select=\"[actions]\"></ng-content>\n<ng-content></ng-content>\n", styles: [":host{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);padding:var(--space-4) 0;border-top:var(--border-width-default) solid var(--border-divider);flex-wrap:wrap}:host(.compact){padding:var(--space-3) var(--space-4);gap:var(--space-3);background:var(--surface-secondary);border-radius:var(--radius-lg);border:var(--border-width-default) solid var(--border-divider);border-top:var(--border-width-default) solid var(--border-divider)}:host(.save){position:relative;padding:var(--space-3) var(--space-4);background:var(--primary-subtle);border:var(--border-width-default) solid var(--primary);border-radius:var(--radius-lg)}\n"] });
|
|
2888
|
+
}
|
|
2889
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PageFooterComponent, decorators: [{
|
|
2890
|
+
type: Component,
|
|
2891
|
+
args: [{ selector: 'ds-page-footer', standalone: true, imports: [], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
2892
|
+
'[class.compact]': "variant() === 'compact'",
|
|
2893
|
+
'[class.save]': "variant() === 'save'",
|
|
2894
|
+
}, template: "<ng-content select=\"[brand]\"></ng-content>\n<ng-content select=\"[nav]\"></ng-content>\n<ng-content select=\"[actions]\"></ng-content>\n<ng-content></ng-content>\n", styles: [":host{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);padding:var(--space-4) 0;border-top:var(--border-width-default) solid var(--border-divider);flex-wrap:wrap}:host(.compact){padding:var(--space-3) var(--space-4);gap:var(--space-3);background:var(--surface-secondary);border-radius:var(--radius-lg);border:var(--border-width-default) solid var(--border-divider);border-top:var(--border-width-default) solid var(--border-divider)}:host(.save){position:relative;padding:var(--space-3) var(--space-4);background:var(--primary-subtle);border:var(--border-width-default) solid var(--primary);border-radius:var(--radius-lg)}\n"] }]
|
|
2895
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
2896
|
+
|
|
2897
|
+
let nextId = 0;
|
|
2898
|
+
class ComboboxComponent {
|
|
2899
|
+
overlay = inject(Overlay);
|
|
2900
|
+
vcr = inject(ViewContainerRef);
|
|
2901
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
2902
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2903
|
+
multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
2904
|
+
placeholder = input('Select…', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2905
|
+
/** Accessible name for the combobox input. */
|
|
2906
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
2907
|
+
query = signal('', ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
|
|
2908
|
+
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
2909
|
+
activeIndex = signal(-1, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
2910
|
+
trigger = viewChild.required('trigger');
|
|
2911
|
+
filterInput = viewChild.required('filter');
|
|
2912
|
+
panelTpl = viewChild.required('panel');
|
|
2913
|
+
overlayRef = null;
|
|
2914
|
+
uid = `ds-combobox-${++nextId}`;
|
|
2915
|
+
listboxId = `${this.uid}-listbox`;
|
|
2916
|
+
optionId(index) {
|
|
2917
|
+
return `${this.uid}-opt-${index}`;
|
|
2918
|
+
}
|
|
2919
|
+
activeDescendant = computed(() => {
|
|
2920
|
+
const idx = this.activeIndex();
|
|
2921
|
+
return this.isOpen() && idx >= 0 ? this.optionId(idx) : null;
|
|
2922
|
+
}, ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
|
|
2923
|
+
filteredOptions = computed(() => {
|
|
2924
|
+
const trimmedQuery = this.query().toLowerCase().trim();
|
|
2925
|
+
const allOptions = this.options();
|
|
2926
|
+
if (!trimmedQuery)
|
|
2927
|
+
return allOptions;
|
|
2928
|
+
return allOptions.filter((option) => option.label.toLowerCase().includes(trimmedQuery));
|
|
2929
|
+
}, ...(ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []));
|
|
2930
|
+
selectedTags = computed(() => {
|
|
2931
|
+
if (!this.multiple())
|
|
2932
|
+
return [];
|
|
2933
|
+
const selectedValues = this.value() ?? [];
|
|
2934
|
+
const selectedSet = new Set(selectedValues);
|
|
2935
|
+
return this.options().filter((option) => selectedSet.has(option.value));
|
|
2936
|
+
}, ...(ngDevMode ? [{ debugName: "selectedTags" }] : /* istanbul ignore next */ []));
|
|
2937
|
+
displayLabel = computed(() => {
|
|
2938
|
+
if (this.multiple())
|
|
2939
|
+
return '';
|
|
2940
|
+
const currentValue = this.value();
|
|
2941
|
+
if (currentValue === null)
|
|
2942
|
+
return '';
|
|
2943
|
+
return this.options().find((option) => option.value === currentValue)?.label ?? '';
|
|
2944
|
+
}, ...(ngDevMode ? [{ debugName: "displayLabel" }] : /* istanbul ignore next */ []));
|
|
2945
|
+
placeholderText = computed(() => {
|
|
2946
|
+
if (this.multiple())
|
|
2947
|
+
return '';
|
|
2948
|
+
if (this.displayLabel())
|
|
2949
|
+
return '';
|
|
2950
|
+
return this.placeholder();
|
|
2951
|
+
}, ...(ngDevMode ? [{ debugName: "placeholderText" }] : /* istanbul ignore next */ []));
|
|
2952
|
+
isSelected(option) {
|
|
2953
|
+
if (this.multiple()) {
|
|
2954
|
+
const selectedValues = this.value() ?? [];
|
|
2955
|
+
return selectedValues.includes(option.value);
|
|
2956
|
+
}
|
|
2957
|
+
return this.value() === option.value;
|
|
2958
|
+
}
|
|
2959
|
+
optionClass(option) {
|
|
2960
|
+
const parts = ['option'];
|
|
2961
|
+
if (this.multiple())
|
|
2962
|
+
parts.push('check');
|
|
2963
|
+
void option;
|
|
2964
|
+
return parts.join(' ');
|
|
2965
|
+
}
|
|
2966
|
+
onTriggerClick() {
|
|
2967
|
+
this.filterInput().nativeElement.focus();
|
|
2968
|
+
if (!this.overlayRef)
|
|
2969
|
+
this.openPanel();
|
|
2970
|
+
}
|
|
2971
|
+
togglePanel(event) {
|
|
2972
|
+
event.stopPropagation();
|
|
2973
|
+
if (this.overlayRef) {
|
|
2974
|
+
this.close();
|
|
2975
|
+
}
|
|
2976
|
+
else {
|
|
2977
|
+
this.filterInput().nativeElement.focus();
|
|
2978
|
+
this.openPanel();
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
onKeydown(event) {
|
|
2982
|
+
const opts = this.filteredOptions();
|
|
2983
|
+
switch (event.key) {
|
|
2984
|
+
case 'ArrowDown':
|
|
2985
|
+
event.preventDefault();
|
|
2986
|
+
if (!this.overlayRef) {
|
|
2987
|
+
this.openPanel();
|
|
2988
|
+
return;
|
|
2989
|
+
}
|
|
2990
|
+
this.activeIndex.set(opts.length ? (this.activeIndex() + 1) % opts.length : -1);
|
|
2991
|
+
break;
|
|
2992
|
+
case 'ArrowUp':
|
|
2993
|
+
event.preventDefault();
|
|
2994
|
+
if (!this.overlayRef) {
|
|
2995
|
+
this.openPanel();
|
|
2996
|
+
return;
|
|
2997
|
+
}
|
|
2998
|
+
this.activeIndex.set(opts.length ? (this.activeIndex() - 1 + opts.length) % opts.length : -1);
|
|
2999
|
+
break;
|
|
3000
|
+
case 'Enter': {
|
|
3001
|
+
const opt = opts[this.activeIndex()];
|
|
3002
|
+
if (opt) {
|
|
3003
|
+
event.preventDefault();
|
|
3004
|
+
this.onPick(opt);
|
|
3005
|
+
}
|
|
3006
|
+
break;
|
|
3007
|
+
}
|
|
3008
|
+
case 'Escape':
|
|
3009
|
+
if (this.overlayRef) {
|
|
3010
|
+
event.preventDefault();
|
|
3011
|
+
this.close();
|
|
3012
|
+
}
|
|
3013
|
+
break;
|
|
3014
|
+
case 'Backspace':
|
|
3015
|
+
if (this.multiple() && !this.query()) {
|
|
3016
|
+
const tags = this.selectedTags();
|
|
3017
|
+
const last = tags[tags.length - 1];
|
|
3018
|
+
if (last)
|
|
3019
|
+
this.remove(last.value);
|
|
3020
|
+
}
|
|
3021
|
+
break;
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
openPanel() {
|
|
3025
|
+
if (this.overlayRef)
|
|
3026
|
+
return;
|
|
3027
|
+
const triggerElement = this.trigger().nativeElement;
|
|
3028
|
+
const positionStrategy = this.overlay.position()
|
|
3029
|
+
.flexibleConnectedTo(triggerElement)
|
|
3030
|
+
.withPositions([
|
|
3031
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
3032
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
3033
|
+
]);
|
|
3034
|
+
const overlayConfig = {
|
|
3035
|
+
positionStrategy,
|
|
3036
|
+
hasBackdrop: true,
|
|
3037
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
3038
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
3039
|
+
width: triggerElement.getBoundingClientRect().width,
|
|
3040
|
+
};
|
|
3041
|
+
this.overlayRef = this.overlay.create(overlayConfig);
|
|
3042
|
+
this.overlayRef.backdropClick().subscribe(() => this.close());
|
|
3043
|
+
this.overlayRef.attach(new TemplatePortal(this.panelTpl(), this.vcr));
|
|
3044
|
+
this.isOpen.set(true);
|
|
3045
|
+
this.activeIndex.set(this.filteredOptions().length ? 0 : -1);
|
|
3046
|
+
}
|
|
3047
|
+
close() {
|
|
3048
|
+
this.overlayRef?.dispose();
|
|
3049
|
+
this.overlayRef = null;
|
|
3050
|
+
this.isOpen.set(false);
|
|
3051
|
+
this.activeIndex.set(-1);
|
|
3052
|
+
}
|
|
3053
|
+
onFilter(event) {
|
|
3054
|
+
this.query.set(event.target.value);
|
|
3055
|
+
}
|
|
3056
|
+
onPick(option) {
|
|
3057
|
+
if (this.multiple()) {
|
|
3058
|
+
const current = this.value() ?? [];
|
|
3059
|
+
const next = current.includes(option.value)
|
|
3060
|
+
? current.filter((existing) => existing !== option.value)
|
|
3061
|
+
: [...current, option.value];
|
|
3062
|
+
this.value.set(next);
|
|
3063
|
+
}
|
|
3064
|
+
else {
|
|
3065
|
+
this.value.set(option.value);
|
|
3066
|
+
this.close();
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
remove(target) {
|
|
3070
|
+
if (!this.multiple())
|
|
3071
|
+
return;
|
|
3072
|
+
const current = this.value() ?? [];
|
|
3073
|
+
this.value.set(current.filter((existing) => existing !== target));
|
|
3074
|
+
}
|
|
3075
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3076
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: ComboboxComponent, isStandalone: true, selector: "ds-combobox", 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, 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 }], ngImport: i0, template: "<div #trigger class=\"combo-trigger\" [class.open]=\"isOpen()\" (click)=\"onTriggerClick()\">\r\n @if (multiple()) {\r\n @for (selectedOption of selectedTags(); track selectedOption.value) {\r\n <ds-tag [closable]=\"true\" [closeLabel]=\"'Remove ' + selectedOption.label\" (closed)=\"remove(selectedOption.value)\">{{ selectedOption.label }}</ds-tag>\r\n }\r\n } @else if (displayLabel()) {\r\n <span class=\"combo-value\">{{ displayLabel() }}</span>\r\n }\r\n <input #filter type=\"text\" class=\"combo-input\"\r\n role=\"combobox\"\r\n aria-autocomplete=\"list\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"listboxId\"\r\n [attr.aria-activedescendant]=\"activeDescendant()\"\r\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\r\n [value]=\"query()\" (input)=\"onFilter($event)\" (focus)=\"openPanel()\" (keydown)=\"onKeydown($event)\"\r\n [placeholder]=\"placeholderText()\" />\r\n <ds-icon name=\"chevronDown\" [size]=\"16\" class=\"combo-chevron\" (click)=\"togglePanel($event)\" />\r\n</div>\r\n\r\n<ng-template #panel>\r\n <ul class=\"combo-list\" role=\"listbox\" [id]=\"listboxId\" [attr.aria-multiselectable]=\"multiple() ? 'true' : null\">\r\n @for (option of filteredOptions(); track option.value; let i = $index) {\r\n <li [class]=\"optionClass(option)\" role=\"option\" [id]=\"optionId(i)\"\r\n [class.is-active]=\"i === activeIndex()\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n (click)=\"onPick(option)\" (mouseenter)=\"activeIndex.set(i)\">\r\n @if (multiple()) {\r\n <input type=\"checkbox\" class=\"check\" tabindex=\"-1\" aria-hidden=\"true\" [checked]=\"isSelected(option)\" />\r\n }\r\n <span>{{ option.label }}</span>\r\n @if (!multiple() && isSelected(option)) {\r\n <ds-icon name=\"check\" class=\"icon\" [size]=\"14\" />\r\n }\r\n </li>\r\n }\r\n @if (filteredOptions().length === 0) {\r\n <li class=\"empty t-s\" role=\"option\" [attr.aria-disabled]=\"true\">No matches</li>\r\n }\r\n </ul>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:inline-block;width:100%;position:relative}.combo-trigger{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:var(--hit-cozy);padding:var(--space-1) var(--space-2);background:var(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);cursor:text;text-align:left;flex-wrap:wrap}.combo-trigger:hover{border-color:var(--border-strong)}.combo-trigger:focus-within{border-color:var(--primary);box-shadow:var(--focus-ring);outline:0}.combo-value{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}.combo-input{flex:1;min-width:80px;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)}.combo-chevron{color:var(--icon-default);margin-left:auto}.combo-list{width:100%;list-style:none;padding:0;background:var(--surface-overlay);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-lg);box-shadow:var(--shadow-popover);margin:var(--combobox-offset) 0 0;max-height:var(--combobox-maxh);overflow-y:auto;z-index:var(--layer-popover)}.combo-list .option{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer}.combo-list .option:hover,.combo-list .option.is-active,.combo-list .option[aria-selected=true]{background:var(--surface-secondary)}.combo-list .option .icon{color:var(--primary);margin-left:auto}.combo-list .option.check{padding-left:var(--space-2)}.combo-list .empty{padding:var(--space-3) var(--space-4);color:var(--text-tertiary);text-align:center}\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"] }] });
|
|
3077
|
+
}
|
|
3078
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ComboboxComponent, decorators: [{
|
|
3079
|
+
type: Component,
|
|
3080
|
+
args: [{ selector: 'ds-combobox', standalone: true, imports: [IconComponent, TagComponent], encapsulation: ViewEncapsulation.Emulated, template: "<div #trigger class=\"combo-trigger\" [class.open]=\"isOpen()\" (click)=\"onTriggerClick()\">\r\n @if (multiple()) {\r\n @for (selectedOption of selectedTags(); track selectedOption.value) {\r\n <ds-tag [closable]=\"true\" [closeLabel]=\"'Remove ' + selectedOption.label\" (closed)=\"remove(selectedOption.value)\">{{ selectedOption.label }}</ds-tag>\r\n }\r\n } @else if (displayLabel()) {\r\n <span class=\"combo-value\">{{ displayLabel() }}</span>\r\n }\r\n <input #filter type=\"text\" class=\"combo-input\"\r\n role=\"combobox\"\r\n aria-autocomplete=\"list\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"listboxId\"\r\n [attr.aria-activedescendant]=\"activeDescendant()\"\r\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\r\n [value]=\"query()\" (input)=\"onFilter($event)\" (focus)=\"openPanel()\" (keydown)=\"onKeydown($event)\"\r\n [placeholder]=\"placeholderText()\" />\r\n <ds-icon name=\"chevronDown\" [size]=\"16\" class=\"combo-chevron\" (click)=\"togglePanel($event)\" />\r\n</div>\r\n\r\n<ng-template #panel>\r\n <ul class=\"combo-list\" role=\"listbox\" [id]=\"listboxId\" [attr.aria-multiselectable]=\"multiple() ? 'true' : null\">\r\n @for (option of filteredOptions(); track option.value; let i = $index) {\r\n <li [class]=\"optionClass(option)\" role=\"option\" [id]=\"optionId(i)\"\r\n [class.is-active]=\"i === activeIndex()\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n (click)=\"onPick(option)\" (mouseenter)=\"activeIndex.set(i)\">\r\n @if (multiple()) {\r\n <input type=\"checkbox\" class=\"check\" tabindex=\"-1\" aria-hidden=\"true\" [checked]=\"isSelected(option)\" />\r\n }\r\n <span>{{ option.label }}</span>\r\n @if (!multiple() && isSelected(option)) {\r\n <ds-icon name=\"check\" class=\"icon\" [size]=\"14\" />\r\n }\r\n </li>\r\n }\r\n @if (filteredOptions().length === 0) {\r\n <li class=\"empty t-s\" role=\"option\" [attr.aria-disabled]=\"true\">No matches</li>\r\n }\r\n </ul>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:inline-block;width:100%;position:relative}.combo-trigger{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:var(--hit-cozy);padding:var(--space-1) var(--space-2);background:var(--surface-default);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-md);cursor:text;text-align:left;flex-wrap:wrap}.combo-trigger:hover{border-color:var(--border-strong)}.combo-trigger:focus-within{border-color:var(--primary);box-shadow:var(--focus-ring);outline:0}.combo-value{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-primary)}.combo-input{flex:1;min-width:80px;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)}.combo-chevron{color:var(--icon-default);margin-left:auto}.combo-list{width:100%;list-style:none;padding:0;background:var(--surface-overlay);border:var(--border-width-default) solid var(--border-default);border-radius:var(--radius-lg);box-shadow:var(--shadow-popover);margin:var(--combobox-offset) 0 0;max-height:var(--combobox-maxh);overflow-y:auto;z-index:var(--layer-popover)}.combo-list .option{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer}.combo-list .option:hover,.combo-list .option.is-active,.combo-list .option[aria-selected=true]{background:var(--surface-secondary)}.combo-list .option .icon{color:var(--primary);margin-left:auto}.combo-list .option.check{padding-left:var(--space-2)}.combo-list .empty{padding:var(--space-3) var(--space-4);color:var(--text-tertiary);text-align:center}\n"] }]
|
|
3081
|
+
}], 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 }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], filterInput: [{ type: i0.ViewChild, args: ['filter', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
3082
|
+
|
|
3083
|
+
class DividerComponent {
|
|
3084
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
3085
|
+
// Vertical margin around the divider. Defaults to `md` (8px) for parity
|
|
3086
|
+
// with menus / sidenavs; bump to `lg` for content-section separators.
|
|
3087
|
+
spacing = input('md', ...(ngDevMode ? [{ debugName: "spacing" }] : /* istanbul ignore next */ []));
|
|
3088
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3089
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: DividerComponent, isStandalone: true, selector: "ds-divider", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, spacing: { classPropertyName: "spacing", publicName: "spacing", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "separator" }, properties: { "class.strong": "variant() === 'strong'", "class.vertical": "variant() === 'vertical'", "class.label": "variant() === 'label'", "class.spacing-none": "spacing() === 'none'", "class.spacing-sm": "spacing() === 'sm'", "class.spacing-md": "spacing() === 'md'", "class.spacing-lg": "spacing() === 'lg'", "attr.aria-orientation": "variant() === 'vertical' ? 'vertical' : null" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: ["@charset \"UTF-8\";:host{display:block;height:var(--border-width-default);background:var(--border-divider);margin:var(--space-2) 0;border:0}:host(.spacing-none){margin:0}:host(.spacing-sm){margin:var(--space-1) 0}:host(.spacing-md){margin:var(--space-2) 0}:host(.spacing-lg){margin:var(--space-4) 0}:host(.strong){background:var(--border-default)}:host(.vertical){width:var(--border-width-default);height:auto;align-self:stretch;margin:0 var(--space-3)}:host(.label){display:flex;align-items:center;gap:var(--space-3);background:transparent;height:auto;font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wider);text-transform:uppercase;color:var(--text-tertiary)}:host(.label):before,:host(.label):after{content:\"\";flex:1;height:var(--border-width-default);background:var(--border-divider)}\n"] });
|
|
3090
|
+
}
|
|
3091
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: DividerComponent, decorators: [{
|
|
3092
|
+
type: Component,
|
|
3093
|
+
args: [{ selector: 'ds-divider', standalone: true, template: '<ng-content></ng-content>', host: {
|
|
3094
|
+
role: 'separator',
|
|
3095
|
+
'[class.strong]': "variant() === 'strong'",
|
|
3096
|
+
'[class.vertical]': "variant() === 'vertical'",
|
|
3097
|
+
'[class.label]': "variant() === 'label'",
|
|
3098
|
+
'[class.spacing-none]': "spacing() === 'none'",
|
|
3099
|
+
'[class.spacing-sm]': "spacing() === 'sm'",
|
|
3100
|
+
'[class.spacing-md]': "spacing() === 'md'",
|
|
3101
|
+
'[class.spacing-lg]': "spacing() === 'lg'",
|
|
3102
|
+
'[attr.aria-orientation]': "variant() === 'vertical' ? 'vertical' : null",
|
|
3103
|
+
}, encapsulation: ViewEncapsulation.Emulated, styles: ["@charset \"UTF-8\";:host{display:block;height:var(--border-width-default);background:var(--border-divider);margin:var(--space-2) 0;border:0}:host(.spacing-none){margin:0}:host(.spacing-sm){margin:var(--space-1) 0}:host(.spacing-md){margin:var(--space-2) 0}:host(.spacing-lg){margin:var(--space-4) 0}:host(.strong){background:var(--border-default)}:host(.vertical){width:var(--border-width-default);height:auto;align-self:stretch;margin:0 var(--space-3)}:host(.label){display:flex;align-items:center;gap:var(--space-3);background:transparent;height:auto;font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-base) var(--font-sans);letter-spacing:var(--letter-spacing-wider);text-transform:uppercase;color:var(--text-tertiary)}:host(.label):before,:host(.label):after{content:\"\";flex:1;height:var(--border-width-default);background:var(--border-divider)}\n"] }]
|
|
3104
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], spacing: [{ type: i0.Input, args: [{ isSignal: true, alias: "spacing", required: false }] }] } });
|
|
3105
|
+
|
|
3106
|
+
class CheckboxComponent {
|
|
3107
|
+
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
3108
|
+
indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
3109
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
3110
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
3111
|
+
inputId = input(null, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
3112
|
+
onChange(event) {
|
|
3113
|
+
this.checked.set(event.target.checked);
|
|
3114
|
+
}
|
|
3115
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3116
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: CheckboxComponent, isStandalone: true, selector: "ds-checkbox", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, ngImport: i0, template: "<input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"disabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"inputId()\"\n (change)=\"onChange($event)\"\n/>\n", styles: [":host{display:inline-flex;align-items:center}.check{appearance:none;-webkit-appearance:none;width:var(--check-size);height:var(--check-size);border:var(--check-bw) solid var(--border-strong);background:var(--surface-default);cursor:pointer;display:inline-grid;place-items:center;flex-shrink:0;margin:0;border-radius:var(--radius-sm);transition:background var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.check:hover:not(:disabled){border-color:var(--primary)}.check:focus-visible{outline:none;box-shadow:var(--focus-ring)}.check:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.check:checked{background:var(--primary);border-color:var(--primary)}.check:checked:after{content:\"\";width:var(--check-tick-size);height:var(--check-tick-size);background:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.check:indeterminate{background:var(--primary);border-color:var(--primary)}.check:indeterminate:after{content:\"\";width:var(--check-indet-w);height:var(--check-indet-h);background:var(--icon-on-primary);border-radius:var(--radius-sm)}\n"] });
|
|
3117
|
+
}
|
|
3118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
3119
|
+
type: Component,
|
|
3120
|
+
args: [{ selector: 'ds-checkbox', standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"disabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"inputId()\"\n (change)=\"onChange($event)\"\n/>\n", styles: [":host{display:inline-flex;align-items:center}.check{appearance:none;-webkit-appearance:none;width:var(--check-size);height:var(--check-size);border:var(--check-bw) solid var(--border-strong);background:var(--surface-default);cursor:pointer;display:inline-grid;place-items:center;flex-shrink:0;margin:0;border-radius:var(--radius-sm);transition:background var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.check:hover:not(:disabled){border-color:var(--primary)}.check:focus-visible{outline:none;box-shadow:var(--focus-ring)}.check:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.check:checked{background:var(--primary);border-color:var(--primary)}.check:checked:after{content:\"\";width:var(--check-tick-size);height:var(--check-tick-size);background:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.check:indeterminate{background:var(--primary);border-color:var(--primary)}.check:indeterminate:after{content:\"\";width:var(--check-indet-w);height:var(--check-indet-h);background:var(--icon-on-primary);border-radius:var(--radius-sm)}\n"] }]
|
|
3121
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }] } });
|
|
3122
|
+
|
|
3123
|
+
class RadioComponent {
|
|
3124
|
+
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
3125
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
3126
|
+
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
3127
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3128
|
+
inputId = input(null, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
3129
|
+
onChange(event) {
|
|
3130
|
+
this.checked.set(event.target.checked);
|
|
3131
|
+
}
|
|
3132
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: RadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3133
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: RadioComponent, isStandalone: true, selector: "ds-radio", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, ngImport: i0, template: "<input\n type=\"radio\"\n class=\"radio\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.name]=\"name() || null\"\n [attr.value]=\"value() || null\"\n [attr.id]=\"inputId()\"\n (change)=\"onChange($event)\"\n/>\n", styles: [":host{display:inline-flex;align-items:center}.radio{appearance:none;-webkit-appearance:none;width:var(--check-size);height:var(--check-size);border:var(--check-bw) solid var(--border-strong);background:var(--surface-default);cursor:pointer;display:inline-grid;place-items:center;flex-shrink:0;margin:0;border-radius:var(--radius-pill);transition:background var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.radio:hover:not(:disabled){border-color:var(--primary)}.radio:focus-visible{outline:none;box-shadow:var(--focus-ring)}.radio:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.radio:checked{border-color:var(--primary);border-width:var(--radio-bw-checked)}.radio:checked:after{content:\"\";width:var(--radio-dot-size);height:var(--radio-dot-size);border-radius:var(--radius-pill);background:var(--primary)}\n"] });
|
|
3134
|
+
}
|
|
3135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: RadioComponent, decorators: [{
|
|
3136
|
+
type: Component,
|
|
3137
|
+
args: [{ selector: 'ds-radio', standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<input\n type=\"radio\"\n class=\"radio\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.name]=\"name() || null\"\n [attr.value]=\"value() || null\"\n [attr.id]=\"inputId()\"\n (change)=\"onChange($event)\"\n/>\n", styles: [":host{display:inline-flex;align-items:center}.radio{appearance:none;-webkit-appearance:none;width:var(--check-size);height:var(--check-size);border:var(--check-bw) solid var(--border-strong);background:var(--surface-default);cursor:pointer;display:inline-grid;place-items:center;flex-shrink:0;margin:0;border-radius:var(--radius-pill);transition:background var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.radio:hover:not(:disabled){border-color:var(--primary)}.radio:focus-visible{outline:none;box-shadow:var(--focus-ring)}.radio:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.radio:checked{border-color:var(--primary);border-width:var(--radio-bw-checked)}.radio:checked:after{content:\"\";width:var(--radio-dot-size);height:var(--radio-dot-size);border-radius:var(--radius-pill);background:var(--primary)}\n"] }]
|
|
3138
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }] } });
|
|
3139
|
+
|
|
3140
|
+
class SwitchComponent {
|
|
3141
|
+
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
3142
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
3143
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
3144
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
3145
|
+
inputId = input(null, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
3146
|
+
classes = computed(() => {
|
|
3147
|
+
const variant = this.variant();
|
|
3148
|
+
return variant === 'default' ? 'switch' : `switch ${variant}`;
|
|
3149
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
3150
|
+
onChange(event) {
|
|
3151
|
+
this.checked.set(event.target.checked);
|
|
3152
|
+
}
|
|
3153
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3154
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: SwitchComponent, isStandalone: true, selector: "ds-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, ngImport: i0, template: "<input\n type=\"checkbox\"\n [class]=\"classes()\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"inputId()\"\n (change)=\"onChange($event)\"\n/>\n", styles: [":host{display:inline-flex;align-items:center}.switch{appearance:none;-webkit-appearance:none;width:var(--switch-track-w);height:var(--switch-track-h);background:var(--border-strong);border-radius:var(--radius-pill);position:relative;cursor:pointer;flex-shrink:0;margin:0;transition:background var(--duration-fast) var(--ease-standard)}.switch:after{content:\"\";position:absolute;top:var(--switch-thumb-pad);left:var(--switch-thumb-pad);width:var(--switch-thumb-size);height:var(--switch-thumb-size);background:var(--surface-default);border-radius:var(--radius-pill);box-shadow:var(--shadow-1);transition:transform var(--duration-base) var(--ease-standard)}.switch:checked{background:var(--primary)}.switch:checked:after{transform:translate(var(--switch-thumb-travel))}.switch:focus-visible{outline:none;box-shadow:var(--focus-ring)}.switch:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.switch.success:checked{background:var(--success)}.switch.error:checked{background:var(--error)}\n"] });
|
|
3155
|
+
}
|
|
3156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
3157
|
+
type: Component,
|
|
3158
|
+
args: [{ selector: 'ds-switch', standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<input\n type=\"checkbox\"\n [class]=\"classes()\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"inputId()\"\n (change)=\"onChange($event)\"\n/>\n", styles: [":host{display:inline-flex;align-items:center}.switch{appearance:none;-webkit-appearance:none;width:var(--switch-track-w);height:var(--switch-track-h);background:var(--border-strong);border-radius:var(--radius-pill);position:relative;cursor:pointer;flex-shrink:0;margin:0;transition:background var(--duration-fast) var(--ease-standard)}.switch:after{content:\"\";position:absolute;top:var(--switch-thumb-pad);left:var(--switch-thumb-pad);width:var(--switch-thumb-size);height:var(--switch-thumb-size);background:var(--surface-default);border-radius:var(--radius-pill);box-shadow:var(--shadow-1);transition:transform var(--duration-base) var(--ease-standard)}.switch:checked{background:var(--primary)}.switch:checked:after{transform:translate(var(--switch-thumb-travel))}.switch:focus-visible{outline:none;box-shadow:var(--focus-ring)}.switch:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.switch.success:checked{background:var(--success)}.switch.error:checked{background:var(--error)}\n"] }]
|
|
3159
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }] } });
|
|
3160
|
+
|
|
3161
|
+
/**
|
|
3162
|
+
* Public surface of @ids-group-ltd/ids-design-system.
|
|
3163
|
+
*/
|
|
3164
|
+
|
|
3165
|
+
/**
|
|
3166
|
+
* Generated bundle index. Do not edit.
|
|
3167
|
+
*/
|
|
3168
|
+
|
|
3169
|
+
export { AccordionComponent, AccordionItemComponent, AvatarComponent, AvatarGroupComponent, BadgeComponent, BannerComponent, BottomSheetComponent, BreadcrumbsComponent, BreadcrumbsService, ButtonComponent, CardComponent, CellTemplateDirective, CheckboxComponent, ComboboxComponent, DS_CONFIG, DS_ICON_REGISTRY, DS_TOAST_POSITION, DS_TOAST_POSITION_DEFAULT, DatePickerComponent, DividerComponent, DrawerComponent, DropdownComponent, DropzoneComponent, DsOverlayCloseRef, DsStaticPreview, EmptyStateComponent, ICONS, IconButtonComponent, IconComponent, InputComponent, MenuComponent, MenuItemComponent, ModalCardComponent, ModalComponent, NumberStepperComponent, PageFooterComponent, PageHeaderComponent, PaginationComponent, PopoverComponent, ProgressComponent, RadioComponent, SearchComponent, SelectComponent, SidenavComponent, SidenavGroupComponent, SidenavItemComponent, SkeletonComponent, SpinnerComponent, StatComponent, StatusDotComponent, StepperComponent, SwitchComponent, TabComponent, TableComponent, TabsComponent, TagComponent, TextareaComponent, ToastComponent, ToastRegionComponent, ToastService, TooltipDirective, TooltipPanelComponent, TopBarComponent, W3wComponent, isSelectOptionGroup, provideDsConfig, provideDsIcons };
|
|
3170
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system.mjs.map
|