@forgeroute/ui 0.5.24 → 0.5.26
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/fesm2022/forgeroute-ui-color-input.mjs +40 -6
- package/fesm2022/forgeroute-ui-color-input.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-dropdown.mjs +4 -4
- package/fesm2022/forgeroute-ui-dropdown.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui-color-input.d.ts +7 -0
- package/types/forgeroute-ui-core.d.ts +4 -4
- package/types/forgeroute-ui-dropdown.d.ts +2 -0
- package/types/forgeroute-ui-messaging.d.ts +5 -5
- package/types/forgeroute-ui-payments.d.ts +1 -1
- package/types/forgeroute-ui-quickbooks.d.ts +2 -2
- package/types/forgeroute-ui-square.d.ts +2 -2
- package/types/forgeroute-ui-stripe.d.ts +3 -3
|
@@ -23,6 +23,7 @@ var ColorInputComponent = class ColorInputComponent {
|
|
|
23
23
|
this.error = input("", ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
|
|
24
24
|
this.showErrors = input(false, ...ngDevMode ? [{ debugName: "showErrors" }] : /* istanbul ignore next */ []);
|
|
25
25
|
this.allowAlpha = input(false, ...ngDevMode ? [{ debugName: "allowAlpha" }] : /* istanbul ignore next */ []);
|
|
26
|
+
this.showText = input(true, ...ngDevMode ? [{ debugName: "showText" }] : /* istanbul ignore next */ []);
|
|
26
27
|
this.presets = input([], ...ngDevMode ? [{ debugName: "presets" }] : /* istanbul ignore next */ []);
|
|
27
28
|
this.invalidChange = output();
|
|
28
29
|
this._disabledInput = input(false, {
|
|
@@ -207,6 +208,13 @@ var ColorInputComponent = class ColorInputComponent {
|
|
|
207
208
|
isRequired: false,
|
|
208
209
|
transformFunction: null
|
|
209
210
|
},
|
|
211
|
+
showText: {
|
|
212
|
+
classPropertyName: "showText",
|
|
213
|
+
publicName: "showText",
|
|
214
|
+
isSignal: true,
|
|
215
|
+
isRequired: false,
|
|
216
|
+
transformFunction: null
|
|
217
|
+
},
|
|
210
218
|
presets: {
|
|
211
219
|
classPropertyName: "presets",
|
|
212
220
|
publicName: "presets",
|
|
@@ -244,14 +252,19 @@ var ColorInputComponent = class ColorInputComponent {
|
|
|
244
252
|
template: `
|
|
245
253
|
<div class="co-field" [class.co-error]="_activeError()" [class.co-disabled]="disabled()">
|
|
246
254
|
@if (label()) {
|
|
247
|
-
<label class="co-label" [for]="_textId">
|
|
255
|
+
<label class="co-label" [for]="showText() ? _textId : _nativeId">
|
|
248
256
|
{{ label() }}
|
|
249
257
|
@if (required()) { <span class="co-required" aria-hidden="true">*</span> }
|
|
250
258
|
</label>
|
|
251
259
|
}
|
|
252
260
|
<div class="co-row">
|
|
253
|
-
<span class="co-swatch">
|
|
261
|
+
<span class="co-swatch" [class.co-swatch-wide]="!showText()">
|
|
254
262
|
<span class="co-preview" [style.background-color]="_swatchColor()" aria-hidden="true"></span>
|
|
263
|
+
@if (!showText()) {
|
|
264
|
+
<span class="co-chip" aria-hidden="true" data-testid="color-input-chip">
|
|
265
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.3 0-1.1.9-2 2-2h2.4a3.6 3.6 0 0 0 3.6-3.6C21 6.8 17 3 12 3z"/><circle cx="7.5" cy="11.5" r="1"/><circle cx="10.5" cy="7.5" r="1"/><circle cx="15.5" cy="7.5" r="1"/></svg>
|
|
266
|
+
</span>
|
|
267
|
+
}
|
|
255
268
|
<input
|
|
256
269
|
class="co-native"
|
|
257
270
|
type="color"
|
|
@@ -259,9 +272,12 @@ var ColorInputComponent = class ColorInputComponent {
|
|
|
259
272
|
[value]="_nativeValue()"
|
|
260
273
|
[disabled]="disabled()"
|
|
261
274
|
[attr.aria-label]="labels.t('colorInput.picker', { label: label() || ariaLabel() || labels.t('colorInput.colour') })"
|
|
275
|
+
[attr.aria-describedby]="!showText() && (_activeError() || hint()) ? _descId : null"
|
|
276
|
+
[attr.aria-invalid]="!showText() && _activeError() ? 'true' : null"
|
|
262
277
|
(input)="onNativeInput($event)"
|
|
263
278
|
(blur)="onNativeBlur()" />
|
|
264
279
|
</span>
|
|
280
|
+
@if (showText()) {
|
|
265
281
|
<input
|
|
266
282
|
class="co-text"
|
|
267
283
|
type="text"
|
|
@@ -279,6 +295,7 @@ var ColorInputComponent = class ColorInputComponent {
|
|
|
279
295
|
[attr.aria-describedby]="(_activeError() || hint()) ? _descId : null"
|
|
280
296
|
(input)="onTextInput($event)"
|
|
281
297
|
(blur)="onTextBlur()" />
|
|
298
|
+
}
|
|
282
299
|
</div>
|
|
283
300
|
@if (presets().length) {
|
|
284
301
|
<div class="co-presets" role="group" [attr.aria-label]="labels.t('colorInput.presets', { label: label() || ariaLabel() || labels.t('colorInput.colour') })">
|
|
@@ -303,7 +320,7 @@ var ColorInputComponent = class ColorInputComponent {
|
|
|
303
320
|
</div>
|
|
304
321
|
`,
|
|
305
322
|
isInline: true,
|
|
306
|
-
styles: [":host{display:block}.co-field{display:flex;flex-direction:column;gap:6px}.co-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.co-required{color:#dc2626;margin-left:2px}.co-row{display:flex;align-items:center;gap:8px}.co-swatch{position:relative;flex-shrink:0;width:38px;height:38px;box-sizing:border-box;border:1px solid #7c8ba1;border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s}.co-swatch:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-preview{position:absolute;inset:0;display:block}.co-native{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;cursor:pointer;-webkit-appearance:none;appearance:none;background:transparent}.co-native::-webkit-color-swatch-wrapper{padding:0}.co-native::-webkit-color-swatch{border:0;border-radius:0}.co-native::-moz-color-swatch{border:0;border-radius:0}.co-text{flex:1;min-width:0;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.co-text::placeholder{color:#64748b;opacity:1}.co-text:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-presets{display:flex;flex-wrap:wrap;gap:8px}.co-preset{width:28px;height:28px;padding:0;box-sizing:border-box;cursor:pointer;border:1px solid #7c8ba1;border-radius:50%}.co-preset-selected{box-shadow:0 0 0 2px #fff,0 0 0 4px #3b82f6}.co-preset:focus{outline:2px solid #3b82f6;outline-offset:2px}.co-preset:focus:not(:focus-visible){outline:none}.co-error .co-text,.co-error .co-swatch{border-color:#ef4444}.co-error .co-text:focus{box-shadow:0 0 0 3px #ef44441f}.co-disabled .co-text,.co-disabled .co-swatch,.co-disabled .co-preset{opacity:.5;cursor:not-allowed}.co-disabled .co-native{cursor:not-allowed}.co-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.co-desc-error{color:#dc2626}@media(max-width:480px){.co-text{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.co-text{min-height:44px}.co-swatch
|
|
323
|
+
styles: [":host{display:block}.co-field{display:flex;flex-direction:column;gap:6px}.co-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.co-required{color:#dc2626;margin-left:2px}.co-row{display:flex;align-items:center;gap:8px}.co-swatch{position:relative;flex-shrink:0;width:38px;height:38px;box-sizing:border-box;border:1px solid #7c8ba1;border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s}.co-swatch-wide{flex:1;width:auto;min-width:0;height:40px;cursor:pointer}.co-swatch-wide:hover{border-color:#475569}.co-chip{position:absolute;top:50%;right:8px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;background:#fff;color:#334155;border:1px solid #94a3b8;pointer-events:none}.co-swatch:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-preview{position:absolute;inset:0;display:block}.co-native{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;cursor:pointer;-webkit-appearance:none;appearance:none;background:transparent}.co-native::-webkit-color-swatch-wrapper{padding:0}.co-native::-webkit-color-swatch{border:0;border-radius:0}.co-native::-moz-color-swatch{border:0;border-radius:0}.co-text{flex:1;min-width:0;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.co-text::placeholder{color:#64748b;opacity:1}.co-text:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-presets{display:flex;flex-wrap:wrap;gap:8px}.co-preset{width:28px;height:28px;padding:0;box-sizing:border-box;cursor:pointer;border:1px solid #7c8ba1;border-radius:50%}.co-preset-selected{box-shadow:0 0 0 2px #fff,0 0 0 4px #3b82f6}.co-preset:focus{outline:2px solid #3b82f6;outline-offset:2px}.co-preset:focus:not(:focus-visible){outline:none}.co-error .co-text,.co-error .co-swatch{border-color:#ef4444}.co-error .co-text:focus{box-shadow:0 0 0 3px #ef44441f}.co-disabled .co-text,.co-disabled .co-swatch,.co-disabled .co-preset{opacity:.5;cursor:not-allowed}.co-disabled .co-native{cursor:not-allowed}.co-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.co-desc-error{color:#dc2626}@media(max-width:480px){.co-text{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.co-text{min-height:44px}.co-swatch{width:44px;height:44px}.co-swatch-wide{width:auto;height:44px}.co-preset{width:44px;height:44px}}\n"],
|
|
307
324
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
308
325
|
});
|
|
309
326
|
}
|
|
@@ -338,14 +355,19 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
338
355
|
template: `
|
|
339
356
|
<div class="co-field" [class.co-error]="_activeError()" [class.co-disabled]="disabled()">
|
|
340
357
|
@if (label()) {
|
|
341
|
-
<label class="co-label" [for]="_textId">
|
|
358
|
+
<label class="co-label" [for]="showText() ? _textId : _nativeId">
|
|
342
359
|
{{ label() }}
|
|
343
360
|
@if (required()) { <span class="co-required" aria-hidden="true">*</span> }
|
|
344
361
|
</label>
|
|
345
362
|
}
|
|
346
363
|
<div class="co-row">
|
|
347
|
-
<span class="co-swatch">
|
|
364
|
+
<span class="co-swatch" [class.co-swatch-wide]="!showText()">
|
|
348
365
|
<span class="co-preview" [style.background-color]="_swatchColor()" aria-hidden="true"></span>
|
|
366
|
+
@if (!showText()) {
|
|
367
|
+
<span class="co-chip" aria-hidden="true" data-testid="color-input-chip">
|
|
368
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.3 0-1.1.9-2 2-2h2.4a3.6 3.6 0 0 0 3.6-3.6C21 6.8 17 3 12 3z"/><circle cx="7.5" cy="11.5" r="1"/><circle cx="10.5" cy="7.5" r="1"/><circle cx="15.5" cy="7.5" r="1"/></svg>
|
|
369
|
+
</span>
|
|
370
|
+
}
|
|
349
371
|
<input
|
|
350
372
|
class="co-native"
|
|
351
373
|
type="color"
|
|
@@ -353,9 +375,12 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
353
375
|
[value]="_nativeValue()"
|
|
354
376
|
[disabled]="disabled()"
|
|
355
377
|
[attr.aria-label]="labels.t('colorInput.picker', { label: label() || ariaLabel() || labels.t('colorInput.colour') })"
|
|
378
|
+
[attr.aria-describedby]="!showText() && (_activeError() || hint()) ? _descId : null"
|
|
379
|
+
[attr.aria-invalid]="!showText() && _activeError() ? 'true' : null"
|
|
356
380
|
(input)="onNativeInput($event)"
|
|
357
381
|
(blur)="onNativeBlur()" />
|
|
358
382
|
</span>
|
|
383
|
+
@if (showText()) {
|
|
359
384
|
<input
|
|
360
385
|
class="co-text"
|
|
361
386
|
type="text"
|
|
@@ -373,6 +398,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
373
398
|
[attr.aria-describedby]="(_activeError() || hint()) ? _descId : null"
|
|
374
399
|
(input)="onTextInput($event)"
|
|
375
400
|
(blur)="onTextBlur()" />
|
|
401
|
+
}
|
|
376
402
|
</div>
|
|
377
403
|
@if (presets().length) {
|
|
378
404
|
<div class="co-presets" role="group" [attr.aria-label]="labels.t('colorInput.presets', { label: label() || ariaLabel() || labels.t('colorInput.colour') })">
|
|
@@ -396,7 +422,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
396
422
|
}
|
|
397
423
|
</div>
|
|
398
424
|
`,
|
|
399
|
-
styles: [":host{display:block}.co-field{display:flex;flex-direction:column;gap:6px}.co-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.co-required{color:#dc2626;margin-left:2px}.co-row{display:flex;align-items:center;gap:8px}.co-swatch{position:relative;flex-shrink:0;width:38px;height:38px;box-sizing:border-box;border:1px solid #7c8ba1;border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s}.co-swatch:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-preview{position:absolute;inset:0;display:block}.co-native{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;cursor:pointer;-webkit-appearance:none;appearance:none;background:transparent}.co-native::-webkit-color-swatch-wrapper{padding:0}.co-native::-webkit-color-swatch{border:0;border-radius:0}.co-native::-moz-color-swatch{border:0;border-radius:0}.co-text{flex:1;min-width:0;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.co-text::placeholder{color:#64748b;opacity:1}.co-text:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-presets{display:flex;flex-wrap:wrap;gap:8px}.co-preset{width:28px;height:28px;padding:0;box-sizing:border-box;cursor:pointer;border:1px solid #7c8ba1;border-radius:50%}.co-preset-selected{box-shadow:0 0 0 2px #fff,0 0 0 4px #3b82f6}.co-preset:focus{outline:2px solid #3b82f6;outline-offset:2px}.co-preset:focus:not(:focus-visible){outline:none}.co-error .co-text,.co-error .co-swatch{border-color:#ef4444}.co-error .co-text:focus{box-shadow:0 0 0 3px #ef44441f}.co-disabled .co-text,.co-disabled .co-swatch,.co-disabled .co-preset{opacity:.5;cursor:not-allowed}.co-disabled .co-native{cursor:not-allowed}.co-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.co-desc-error{color:#dc2626}@media(max-width:480px){.co-text{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.co-text{min-height:44px}.co-swatch
|
|
425
|
+
styles: [":host{display:block}.co-field{display:flex;flex-direction:column;gap:6px}.co-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.co-required{color:#dc2626;margin-left:2px}.co-row{display:flex;align-items:center;gap:8px}.co-swatch{position:relative;flex-shrink:0;width:38px;height:38px;box-sizing:border-box;border:1px solid #7c8ba1;border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s}.co-swatch-wide{flex:1;width:auto;min-width:0;height:40px;cursor:pointer}.co-swatch-wide:hover{border-color:#475569}.co-chip{position:absolute;top:50%;right:8px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;background:#fff;color:#334155;border:1px solid #94a3b8;pointer-events:none}.co-swatch:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-preview{position:absolute;inset:0;display:block}.co-native{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;cursor:pointer;-webkit-appearance:none;appearance:none;background:transparent}.co-native::-webkit-color-swatch-wrapper{padding:0}.co-native::-webkit-color-swatch{border:0;border-radius:0}.co-native::-moz-color-swatch{border:0;border-radius:0}.co-text{flex:1;min-width:0;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.co-text::placeholder{color:#64748b;opacity:1}.co-text:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-presets{display:flex;flex-wrap:wrap;gap:8px}.co-preset{width:28px;height:28px;padding:0;box-sizing:border-box;cursor:pointer;border:1px solid #7c8ba1;border-radius:50%}.co-preset-selected{box-shadow:0 0 0 2px #fff,0 0 0 4px #3b82f6}.co-preset:focus{outline:2px solid #3b82f6;outline-offset:2px}.co-preset:focus:not(:focus-visible){outline:none}.co-error .co-text,.co-error .co-swatch{border-color:#ef4444}.co-error .co-text:focus{box-shadow:0 0 0 3px #ef44441f}.co-disabled .co-text,.co-disabled .co-swatch,.co-disabled .co-preset{opacity:.5;cursor:not-allowed}.co-disabled .co-native{cursor:not-allowed}.co-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.co-desc-error{color:#dc2626}@media(max-width:480px){.co-text{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.co-text{min-height:44px}.co-swatch{width:44px;height:44px}.co-swatch-wide{width:auto;height:44px}.co-preset{width:44px;height:44px}}\n"]
|
|
400
426
|
}]
|
|
401
427
|
}],
|
|
402
428
|
ctorParameters: () => [],
|
|
@@ -465,6 +491,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
465
491
|
required: false
|
|
466
492
|
}]
|
|
467
493
|
}],
|
|
494
|
+
showText: [{
|
|
495
|
+
type: i0.Input,
|
|
496
|
+
args: [{
|
|
497
|
+
isSignal: true,
|
|
498
|
+
alias: "showText",
|
|
499
|
+
required: false
|
|
500
|
+
}]
|
|
501
|
+
}],
|
|
468
502
|
presets: [{
|
|
469
503
|
type: i0.Input,
|
|
470
504
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgeroute-ui-color-input.mjs","names":[],"sources":["../../../projects/forgeroute-ui/color-input/src/lib/color-input/color-input.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, forwardRef, input, output, signal, inject } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, issueToErrors, requiredIssue } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\nlet nextColorId = 0;\n\n/** A preset swatch offered under the field. `label` is its accessible name. */\nexport interface ColorPreset { value: string; label: string; }\n\n/**\n * Normalises a CSS hex colour: `#fff` / `FFF` -> `#ffffff`, `#RRGGBB` -> lower case. With `allowAlpha`, `#rrggbbaa`\n * is accepted and kept at 8 digits (shorthand `#rgba` is never accepted). Returns null for anything else\n * (named colours, `rgb()`, wrong lengths, non-hex digits). The leading `#` is optional on input.\n */\nexport function normalizeHexColor(value: string | null | undefined, allowAlpha = false): string | null {\n if (typeof value !== 'string') return null;\n const m = /^#?([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(value.trim());\n if (!m) return null;\n let hex = m[1].toLowerCase();\n if (hex.length === 8 && !allowAlpha) return null;\n if (hex.length === 3) hex = hex.split('').map(c => c + c).join('');\n return '#' + hex;\n}\n\n/**\n * Colour input: ControlValueAccessor over a string holding a CSS hex colour. A swatch opens the operating system's\n * colour picker (native `<input type=\"color\">`) and a text field next to it shows / edits the hex; both stay in sync.\n *\n * <ui-color-input label=\"Brand colour\" [(ngModel)]=\"brand\" />\n * <ui-color-input label=\"Accent\" [presets]=\"presets\" [allowAlpha]=\"true\" [formControl]=\"accent\" />\n *\n * Value contract\n * - A valid colour is emitted normalised to lower-case `#rrggbb` (`#FFF` -> `#ffffff`; 8-digit `#rrggbbaa` only with\n * `allowAlpha`, kept at 8 digits). The user may type with or without the leading `#`; the control prepends it.\n * - Text the user typed that is not a valid colour is emitted as typed (with `#` prepended, `''` when cleared) so the host\n * sees what the user entered; the control is then invalid (the `colorInput.invalidHex` text, \"Enter a hex colour like #3b82f6.\" in English) and the form control gets\n * the `color` error. While typing, the text is not rewritten (`#fff` is emitted as `#ffffff` but stays `#fff` on screen)\n * and is normalised on blur.\n * - A value WRITTEN BY THE HOST (`writeValue` / `[ngModel]` / `[formControl]`) is never flagged as an invalid colour, even\n * when it is not a hex (`red`, `#fff8`, a legacy value), until the user changes it, so legacy data never blocks Save.\n * (Required is still checked for an empty value.) The native picker gets `#000000` for a non-hex value so it never throws.\n * - Picking in the native picker with an 8-digit value and `allowAlpha` keeps the existing alpha digits.\n *\n * Validity API (same as the other ui inputs): `Validator` (error keys `required`, `color`), signals `invalid` /\n * `errorMessage`, `invalidChange` output, `UiFieldValidity` token. Messages (built-in and a host `[error]`) show only after the user left the field; `[showErrors]=\"true\"` also reveals it on an untouched field. Disabled controls are never invalid.\n *\n * Cross-browser: the native swatch is styled with `-webkit-appearance` and the `::-webkit-color-swatch` / `::-moz-color-swatch`\n * pseudo-elements and sits invisibly over our own preview square, so it looks the same in Chrome, Edge, Firefox and Safari.\n * Preset swatches are real `<button>`s (Enter / Space work natively, `aria-pressed` marks the selected one).\n */\n@Component({\n selector: 'ui-color-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ColorInputComponent), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => ColorInputComponent), multi: true },\n { provide: UiFieldValidity, useExisting: forwardRef(() => ColorInputComponent) },\n ],\n template: `\n <div class=\"co-field\" [class.co-error]=\"_activeError()\" [class.co-disabled]=\"disabled()\">\n @if (label()) {\n <label class=\"co-label\" [for]=\"_textId\">\n {{ label() }}\n @if (required()) { <span class=\"co-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <div class=\"co-row\">\n <span class=\"co-swatch\">\n <span class=\"co-preview\" [style.background-color]=\"_swatchColor()\" aria-hidden=\"true\"></span>\n <input\n class=\"co-native\"\n type=\"color\"\n [id]=\"_nativeId\"\n [value]=\"_nativeValue()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"labels.t('colorInput.picker', { label: label() || ariaLabel() || labels.t('colorInput.colour') })\"\n (input)=\"onNativeInput($event)\"\n (blur)=\"onNativeBlur()\" />\n </span>\n <input\n class=\"co-text\"\n type=\"text\"\n [id]=\"_textId\"\n [value]=\"_text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [attr.maxlength]=\"allowAlpha() ? 9 : 7\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.required]=\"required() || null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-label]=\"label() ? null : (ariaLabel() || null)\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-describedby]=\"(_activeError() || hint()) ? _descId : null\"\n (input)=\"onTextInput($event)\"\n (blur)=\"onTextBlur()\" />\n </div>\n @if (presets().length) {\n <div class=\"co-presets\" role=\"group\" [attr.aria-label]=\"labels.t('colorInput.presets', { label: label() || ariaLabel() || labels.t('colorInput.colour') })\">\n @for (p of presets(); track $index) {\n <button\n type=\"button\"\n class=\"co-preset\"\n [class.co-preset-selected]=\"_isSelected(p)\"\n [style.background-color]=\"_presetColor(p)\"\n [attr.aria-label]=\"p.label\"\n [attr.aria-pressed]=\"_isSelected(p) ? 'true' : 'false'\"\n [disabled]=\"disabled()\"\n (click)=\"selectPreset(p)\"></button>\n }\n </div>\n }\n @if (_activeError()) {\n <p class=\"co-desc co-desc-error\" [id]=\"_descId\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"co-desc\" [id]=\"_descId\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n .co-field { display: flex; flex-direction: column; gap: 6px; }\n .co-label { font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .co-required { color: #dc2626; margin-left: 2px; }\n .co-row { display: flex; align-items: center; gap: 8px; }\n\n .co-swatch {\n position: relative; flex-shrink: 0; width: 38px; height: 38px; box-sizing: border-box;\n border: 1px solid #7c8ba1; border-radius: 8px; overflow: hidden; background: #fff;\n transition: border-color 0.15s, box-shadow 0.15s;\n }\n .co-swatch:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n .co-preview { position: absolute; inset: 0; display: block; }\n /* The real colour input sits invisibly over the preview so clicks and keyboard land on it. */\n .co-native {\n position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;\n opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; background: transparent;\n }\n .co-native::-webkit-color-swatch-wrapper { padding: 0; }\n .co-native::-webkit-color-swatch { border: 0; border-radius: 0; }\n .co-native::-moz-color-swatch { border: 0; border-radius: 0; }\n\n .co-text {\n flex: 1; min-width: 0; box-sizing: border-box;\n padding: 9px 12px; font-size: 0.875rem; font-family: inherit;\n color: #1e293b; background: #fff;\n border: 1px solid #7c8ba1; border-radius: 8px;\n outline: none; transition: border-color 0.15s, box-shadow 0.15s;\n }\n .co-text::placeholder { color: #64748b; opacity: 1; }\n .co-text:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n\n .co-presets { display: flex; flex-wrap: wrap; gap: 8px; }\n .co-preset {\n width: 28px; height: 28px; padding: 0; box-sizing: border-box; cursor: pointer;\n border: 1px solid #7c8ba1; border-radius: 50%;\n }\n .co-preset-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6; }\n .co-preset:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }\n .co-preset:focus:not(:focus-visible) { outline: none; }\n\n .co-error .co-text, .co-error .co-swatch { border-color: #ef4444; }\n .co-error .co-text:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n\n .co-disabled .co-text, .co-disabled .co-swatch, .co-disabled .co-preset { opacity: 0.5; cursor: not-allowed; }\n .co-disabled .co-native { cursor: not-allowed; }\n\n .co-desc { margin: 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .co-desc-error { color: #dc2626; }\n\n @media (max-width: 480px) { .co-text { font-size: 1rem; } }\n @media (pointer: coarse), (max-width: 480px) {\n .co-text { min-height: 44px; }\n .co-swatch { width: 44px; height: 44px; }\n .co-preset { width: 44px; height: 44px; }\n }\n `],\n})\nexport class ColorInputComponent implements ControlValueAccessor, Validator, UiFieldValidity {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n /** Accessible name for a field with no visible label. */\n readonly ariaLabel = input('');\n readonly placeholder = input('#3b82f6');\n readonly required = input(false);\n readonly hint = input('');\n /** Host error message; always wins over the built-in message. */\n readonly error = input('');\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */\n readonly showErrors = input(false);\n /** Accept (and keep) 8-digit `#rrggbbaa` values. */\n readonly allowAlpha = input(false);\n /** Optional row of preset swatches. */\n readonly presets = input<ColorPreset[]>([]);\n\n /** Emits whenever the field becomes invalid / valid. */\n readonly invalidChange = output<boolean>();\n\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n /** Current model value (what the form control holds). */\n private readonly _model = signal('');\n /** Text shown in the text field. */\n protected readonly _text = signal('');\n /** True once the user changed the value; host-written values are not format-checked before that. */\n private readonly _edited = signal(false);\n\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._model(), this._edited()));\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n\n private readonly _valid = computed(() => normalizeHexColor(this._model(), this.allowAlpha()));\n /** Colour of the preview square: the value when it is a usable hex, otherwise transparent. */\n protected readonly _swatchColor = computed(() => this._valid() ?? 'transparent');\n /** Value for the native picker: always `#rrggbb`. */\n protected readonly _nativeValue = computed(() => (this._valid() ?? '#000000').slice(0, 7));\n\n private readonly _uid = nextColorId++;\n protected readonly _textId = `co-text-${this._uid}`;\n protected readonly _nativeId = `co-native-${this._uid}`;\n protected readonly _descId = `co-desc-${this._uid}`;\n\n private _onChange = (_: string) => {};\n private _onTouched = () => {};\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n }\n\n /** Re-run the form control's validation when a rule input (required, allowAlpha, ...) changes. */\n ngOnChanges() { this._onValidatorChange(); }\n\n writeValue(val: string | null) {\n const text = val == null ? '' : String(val);\n this._model.set(text);\n this._text.set(text);\n this._edited.set(false);\n }\n registerOnChange(fn: (v: string) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const v = control.value;\n return issueToErrors(this._check(v == null ? '' : String(v), this._edited()));\n }\n\n protected onTextInput(event: Event) {\n const el = event.target as HTMLInputElement;\n let raw = el.value.trim();\n if (raw && !raw.startsWith('#')) raw = '#' + raw;\n if (raw === '#') raw = '';\n if (el.value !== raw) el.value = raw;\n this._text.set(raw);\n this._commit(normalizeHexColor(raw, this.allowAlpha()) ?? raw);\n }\n\n protected onNativeInput(event: Event) {\n const picked = (event.target as HTMLInputElement).value.toLowerCase();\n const current = this._valid();\n // Keep the alpha digits of an 8-digit value when the user only changes the colour.\n const next = this.allowAlpha() && current && current.length === 9 ? picked + current.slice(7) : picked;\n this._text.set(next);\n this._commit(next);\n }\n\n protected selectPreset(p: ColorPreset) {\n const next = normalizeHexColor(p.value, this.allowAlpha()) ?? p.value;\n this._text.set(next);\n this._commit(next);\n }\n\n protected _isSelected(p: ColorPreset): boolean {\n const a = normalizeHexColor(p.value, this.allowAlpha());\n return !!a && a === this._valid();\n }\n protected _presetColor(p: ColorPreset): string {\n return normalizeHexColor(p.value, this.allowAlpha()) ?? 'transparent';\n }\n\n protected onTextBlur() {\n const v = this._valid();\n if (this._edited() && v && this._text() !== v) this._text.set(v);\n this._touch();\n }\n /** Blur of the native picker only marks the field touched; it never rewrites the text. */\n protected onNativeBlur() { this._touch(); }\n\n private _touch() {\n this._onTouched();\n this._reveal.touched.set(true);\n }\n\n private _commit(value: string) {\n this._edited.set(true);\n this._model.set(value);\n this._onChange(value);\n }\n\n private _check(value: string, edited: boolean): FieldIssue | null {\n if (this.disabled()) return null;\n const text = value.trim();\n if (!text) return this.required() ? requiredIssue(this.label()) : null;\n if (!edited) return null;\n return normalizeHexColor(text, this.allowAlpha()) ? null : { key: 'color', message: this.labels.t('colorInput.invalidHex') };\n }\n}\n"],"mappings":";;;;AAKA,IAAI,cAAc;AAUlB,SAAgB,kBAAkB,OAAkC,aAAa,OAAK;CACpF,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,MAAM,IAAI,6CAA6C,KAAK,MAAM,KAAI,CAAE;CACxE,IAAI,CAAC,GAAG,OAAO;CACf,IAAI,MAAM,EAAE,EAAE,CAAC,YAAW;CAC1B,IAAI,IAAI,WAAW,KAAK,CAAC,YAAY,OAAO;CAC5C,IAAI,IAAI,WAAW,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC,CAAC,KAAI,MAAK,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;CACjE,OAAO,MAAM;AACf;AA6JA,IAAa,sBAAb,MAAa,oBAAmB;CAoD9B,cAAA;EAnDmB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,QAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAEvB,KAAA,YAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CA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AA,CAAA,ilEAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AA4DU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAjI/B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,YACd;GAAI,iBACC,wBAAwB;GAAM,WACpC;IACT;KAAE,SAAS;KAAmB,aAAa,iBAAgB,mBAAoB;KAAG,OAAO;IAAI;IAC7F;KAAE,SAAS;KAAe,aAAa,iBAAgB,mBAAoB;KAAG,OAAO;IAAI;IACzF;KAAE,SAAS;KAAiB,aAAa,iBAAgB,mBAAoB;IAAC;GAC/E;GAAA,UACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DT,QAAA,CAAA,ilEAAA;EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"forgeroute-ui-color-input.mjs","names":[],"sources":["../../../projects/forgeroute-ui/color-input/src/lib/color-input/color-input.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, forwardRef, input, output, signal, inject } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, issueToErrors, requiredIssue } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\nlet nextColorId = 0;\n\n/** A preset swatch offered under the field. `label` is its accessible name. */\nexport interface ColorPreset { value: string; label: string; }\n\n/**\n * Normalises a CSS hex colour: `#fff` / `FFF` -> `#ffffff`, `#RRGGBB` -> lower case. With `allowAlpha`, `#rrggbbaa`\n * is accepted and kept at 8 digits (shorthand `#rgba` is never accepted). Returns null for anything else\n * (named colours, `rgb()`, wrong lengths, non-hex digits). The leading `#` is optional on input.\n */\nexport function normalizeHexColor(value: string | null | undefined, allowAlpha = false): string | null {\n if (typeof value !== 'string') return null;\n const m = /^#?([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(value.trim());\n if (!m) return null;\n let hex = m[1].toLowerCase();\n if (hex.length === 8 && !allowAlpha) return null;\n if (hex.length === 3) hex = hex.split('').map(c => c + c).join('');\n return '#' + hex;\n}\n\n/**\n * Colour input: ControlValueAccessor over a string holding a CSS hex colour. A swatch opens the operating system's\n * colour picker (native `<input type=\"color\">`) and a text field next to it shows / edits the hex; both stay in sync.\n *\n * <ui-color-input label=\"Brand colour\" [(ngModel)]=\"brand\" />\n * <ui-color-input label=\"Accent\" [presets]=\"presets\" [allowAlpha]=\"true\" [formControl]=\"accent\" />\n *\n * Value contract\n * - A valid colour is emitted normalised to lower-case `#rrggbb` (`#FFF` -> `#ffffff`; 8-digit `#rrggbbaa` only with\n * `allowAlpha`, kept at 8 digits). The user may type with or without the leading `#`; the control prepends it.\n * - Text the user typed that is not a valid colour is emitted as typed (with `#` prepended, `''` when cleared) so the host\n * sees what the user entered; the control is then invalid (the `colorInput.invalidHex` text, \"Enter a hex colour like #3b82f6.\" in English) and the form control gets\n * the `color` error. While typing, the text is not rewritten (`#fff` is emitted as `#ffffff` but stays `#fff` on screen)\n * and is normalised on blur.\n * - A value WRITTEN BY THE HOST (`writeValue` / `[ngModel]` / `[formControl]`) is never flagged as an invalid colour, even\n * when it is not a hex (`red`, `#fff8`, a legacy value), until the user changes it, so legacy data never blocks Save.\n * (Required is still checked for an empty value.) The native picker gets `#000000` for a non-hex value so it never throws.\n * - Picking in the native picker with an 8-digit value and `allowAlpha` keeps the existing alpha digits.\n *\n * Validity API (same as the other ui inputs): `Validator` (error keys `required`, `color`), signals `invalid` /\n * `errorMessage`, `invalidChange` output, `UiFieldValidity` token. Messages (built-in and a host `[error]`) show only after the user left the field; `[showErrors]=\"true\"` also reveals it on an untouched field. Disabled controls are never invalid.\n *\n * Cross-browser: the native swatch is styled with `-webkit-appearance` and the `::-webkit-color-swatch` / `::-moz-color-swatch`\n * pseudo-elements and sits invisibly over our own preview square, so it looks the same in Chrome, Edge, Firefox and Safari.\n * Preset swatches are real `<button>`s (Enter / Space work natively, `aria-pressed` marks the selected one).\n */\n@Component({\n selector: 'ui-color-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ColorInputComponent), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => ColorInputComponent), multi: true },\n { provide: UiFieldValidity, useExisting: forwardRef(() => ColorInputComponent) },\n ],\n template: `\n <div class=\"co-field\" [class.co-error]=\"_activeError()\" [class.co-disabled]=\"disabled()\">\n @if (label()) {\n <label class=\"co-label\" [for]=\"showText() ? _textId : _nativeId\">\n {{ label() }}\n @if (required()) { <span class=\"co-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <div class=\"co-row\">\n <span class=\"co-swatch\" [class.co-swatch-wide]=\"!showText()\">\n <span class=\"co-preview\" [style.background-color]=\"_swatchColor()\" aria-hidden=\"true\"></span>\n @if (!showText()) {\n <span class=\"co-chip\" aria-hidden=\"true\" data-testid=\"color-input-chip\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.3 0-1.1.9-2 2-2h2.4a3.6 3.6 0 0 0 3.6-3.6C21 6.8 17 3 12 3z\"/><circle cx=\"7.5\" cy=\"11.5\" r=\"1\"/><circle cx=\"10.5\" cy=\"7.5\" r=\"1\"/><circle cx=\"15.5\" cy=\"7.5\" r=\"1\"/></svg>\n </span>\n }\n <input\n class=\"co-native\"\n type=\"color\"\n [id]=\"_nativeId\"\n [value]=\"_nativeValue()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"labels.t('colorInput.picker', { label: label() || ariaLabel() || labels.t('colorInput.colour') })\"\n [attr.aria-describedby]=\"!showText() && (_activeError() || hint()) ? _descId : null\"\n [attr.aria-invalid]=\"!showText() && _activeError() ? 'true' : null\"\n (input)=\"onNativeInput($event)\"\n (blur)=\"onNativeBlur()\" />\n </span>\n @if (showText()) {\n <input\n class=\"co-text\"\n type=\"text\"\n [id]=\"_textId\"\n [value]=\"_text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [attr.maxlength]=\"allowAlpha() ? 9 : 7\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.required]=\"required() || null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-label]=\"label() ? null : (ariaLabel() || null)\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-describedby]=\"(_activeError() || hint()) ? _descId : null\"\n (input)=\"onTextInput($event)\"\n (blur)=\"onTextBlur()\" />\n }\n </div>\n @if (presets().length) {\n <div class=\"co-presets\" role=\"group\" [attr.aria-label]=\"labels.t('colorInput.presets', { label: label() || ariaLabel() || labels.t('colorInput.colour') })\">\n @for (p of presets(); track $index) {\n <button\n type=\"button\"\n class=\"co-preset\"\n [class.co-preset-selected]=\"_isSelected(p)\"\n [style.background-color]=\"_presetColor(p)\"\n [attr.aria-label]=\"p.label\"\n [attr.aria-pressed]=\"_isSelected(p) ? 'true' : 'false'\"\n [disabled]=\"disabled()\"\n (click)=\"selectPreset(p)\"></button>\n }\n </div>\n }\n @if (_activeError()) {\n <p class=\"co-desc co-desc-error\" [id]=\"_descId\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"co-desc\" [id]=\"_descId\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n .co-field { display: flex; flex-direction: column; gap: 6px; }\n .co-label { font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .co-required { color: #dc2626; margin-left: 2px; }\n .co-row { display: flex; align-items: center; gap: 8px; }\n\n .co-swatch {\n position: relative; flex-shrink: 0; width: 38px; height: 38px; box-sizing: border-box;\n border: 1px solid #7c8ba1; border-radius: 8px; overflow: hidden; background: #fff;\n transition: border-color 0.15s, box-shadow 0.15s;\n }\n .co-swatch-wide { flex: 1; width: auto; min-width: 0; height: 40px; cursor: pointer; }\n .co-swatch-wide:hover { border-color: #475569; }\n .co-chip { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;\n width: 28px; height: 28px; border-radius: 6px; background: #fff; color: #334155; border: 1px solid #94a3b8; pointer-events: none; }\n .co-swatch:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n .co-preview { position: absolute; inset: 0; display: block; }\n /* The real colour input sits invisibly over the preview so clicks and keyboard land on it. */\n .co-native {\n position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;\n opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; background: transparent;\n }\n .co-native::-webkit-color-swatch-wrapper { padding: 0; }\n .co-native::-webkit-color-swatch { border: 0; border-radius: 0; }\n .co-native::-moz-color-swatch { border: 0; border-radius: 0; }\n\n .co-text {\n flex: 1; min-width: 0; box-sizing: border-box;\n padding: 9px 12px; font-size: 0.875rem; font-family: inherit;\n color: #1e293b; background: #fff;\n border: 1px solid #7c8ba1; border-radius: 8px;\n outline: none; transition: border-color 0.15s, box-shadow 0.15s;\n }\n .co-text::placeholder { color: #64748b; opacity: 1; }\n .co-text:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n\n .co-presets { display: flex; flex-wrap: wrap; gap: 8px; }\n .co-preset {\n width: 28px; height: 28px; padding: 0; box-sizing: border-box; cursor: pointer;\n border: 1px solid #7c8ba1; border-radius: 50%;\n }\n .co-preset-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6; }\n .co-preset:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }\n .co-preset:focus:not(:focus-visible) { outline: none; }\n\n .co-error .co-text, .co-error .co-swatch { border-color: #ef4444; }\n .co-error .co-text:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n\n .co-disabled .co-text, .co-disabled .co-swatch, .co-disabled .co-preset { opacity: 0.5; cursor: not-allowed; }\n .co-disabled .co-native { cursor: not-allowed; }\n\n .co-desc { margin: 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .co-desc-error { color: #dc2626; }\n\n @media (max-width: 480px) { .co-text { font-size: 1rem; } }\n @media (pointer: coarse), (max-width: 480px) {\n .co-text { min-height: 44px; }\n .co-swatch { width: 44px; height: 44px; }\n .co-swatch-wide { width: auto; height: 44px; }\n .co-preset { width: 44px; height: 44px; }\n }\n `],\n})\nexport class ColorInputComponent implements ControlValueAccessor, Validator, UiFieldValidity {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n /** Accessible name for a field with no visible label. */\n readonly ariaLabel = input('');\n readonly placeholder = input('#3b82f6');\n readonly required = input(false);\n readonly hint = input('');\n /** Host error message; always wins over the built-in message. */\n readonly error = input('');\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */\n readonly showErrors = input(false);\n /** Accept (and keep) 8-digit `#rrggbbaa` values. */\n readonly allowAlpha = input(false);\n /** Show the hex text box next to the swatch (default). `false` = the swatch alone, stretched to a full-width colour field with a palette icon: the user only clicks it and picks. */\n readonly showText = input(true);\n /** Optional row of preset swatches. */\n readonly presets = input<ColorPreset[]>([]);\n\n /** Emits whenever the field becomes invalid / valid. */\n readonly invalidChange = output<boolean>();\n\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n /** Current model value (what the form control holds). */\n private readonly _model = signal('');\n /** Text shown in the text field. */\n protected readonly _text = signal('');\n /** True once the user changed the value; host-written values are not format-checked before that. */\n private readonly _edited = signal(false);\n\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._model(), this._edited()));\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n\n private readonly _valid = computed(() => normalizeHexColor(this._model(), this.allowAlpha()));\n /** Colour of the preview square: the value when it is a usable hex, otherwise transparent. */\n protected readonly _swatchColor = computed(() => this._valid() ?? 'transparent');\n /** Value for the native picker: always `#rrggbb`. */\n protected readonly _nativeValue = computed(() => (this._valid() ?? '#000000').slice(0, 7));\n\n private readonly _uid = nextColorId++;\n protected readonly _textId = `co-text-${this._uid}`;\n protected readonly _nativeId = `co-native-${this._uid}`;\n protected readonly _descId = `co-desc-${this._uid}`;\n\n private _onChange = (_: string) => {};\n private _onTouched = () => {};\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n }\n\n /** Re-run the form control's validation when a rule input (required, allowAlpha, ...) changes. */\n ngOnChanges() { this._onValidatorChange(); }\n\n writeValue(val: string | null) {\n const text = val == null ? '' : String(val);\n this._model.set(text);\n this._text.set(text);\n this._edited.set(false);\n }\n registerOnChange(fn: (v: string) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const v = control.value;\n return issueToErrors(this._check(v == null ? '' : String(v), this._edited()));\n }\n\n protected onTextInput(event: Event) {\n const el = event.target as HTMLInputElement;\n let raw = el.value.trim();\n if (raw && !raw.startsWith('#')) raw = '#' + raw;\n if (raw === '#') raw = '';\n if (el.value !== raw) el.value = raw;\n this._text.set(raw);\n this._commit(normalizeHexColor(raw, this.allowAlpha()) ?? raw);\n }\n\n protected onNativeInput(event: Event) {\n const picked = (event.target as HTMLInputElement).value.toLowerCase();\n const current = this._valid();\n // Keep the alpha digits of an 8-digit value when the user only changes the colour.\n const next = this.allowAlpha() && current && current.length === 9 ? picked + current.slice(7) : picked;\n this._text.set(next);\n this._commit(next);\n }\n\n protected selectPreset(p: ColorPreset) {\n const next = normalizeHexColor(p.value, this.allowAlpha()) ?? p.value;\n this._text.set(next);\n this._commit(next);\n }\n\n protected _isSelected(p: ColorPreset): boolean {\n const a = normalizeHexColor(p.value, this.allowAlpha());\n return !!a && a === this._valid();\n }\n protected _presetColor(p: ColorPreset): string {\n return normalizeHexColor(p.value, this.allowAlpha()) ?? 'transparent';\n }\n\n protected onTextBlur() {\n const v = this._valid();\n if (this._edited() && v && this._text() !== v) this._text.set(v);\n this._touch();\n }\n /** Blur of the native picker only marks the field touched; it never rewrites the text. */\n protected onNativeBlur() { this._touch(); }\n\n private _touch() {\n this._onTouched();\n this._reveal.touched.set(true);\n }\n\n private _commit(value: string) {\n this._edited.set(true);\n this._model.set(value);\n this._onChange(value);\n }\n\n private _check(value: string, edited: boolean): FieldIssue | null {\n if (this.disabled()) return null;\n const text = value.trim();\n if (!text) return this.required() ? requiredIssue(this.label()) : null;\n if (!edited) return null;\n return normalizeHexColor(text, this.allowAlpha()) ? null : { key: 'color', message: this.labels.t('colorInput.invalidHex') };\n }\n}\n"],"mappings":";;;;AAKA,IAAI,cAAc;AAUlB,SAAgB,kBAAkB,OAAkC,aAAa,OAAK;CACpF,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,MAAM,IAAI,6CAA6C,KAAK,MAAM,KAAI,CAAE;CACxE,IAAI,CAAC,GAAG,OAAO;CACf,IAAI,MAAM,EAAE,EAAE,CAAC,YAAW;CAC1B,IAAI,IAAI,WAAW,KAAK,CAAC,YAAY,OAAO;CAC5C,IAAI,IAAI,WAAW,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC,CAAC,KAAI,MAAK,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A,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,gBAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA,EAAA,eAAA,gBAAA;GAAA,WA3InB;IACT;KAAE,SAAS;KAAmB,aAAa,iBAAiB,mBAAmB;KAAG,OAAO;IAAI;IAC7F;KAAE,SAAS;KAAe,aAAa,iBAAiB,mBAAmB;KAAG,OAAO;IAAI;IACzF;KAAE,SAAS;KAAiB,aAAa,iBAAiB,mBAAmB;IAAC;GAC/E;GAAA,eAAA;GAAA,UAAA;GAAA,UACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqET,UAAA;GAAA,QAAA,CAAA,6/EAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAiEU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EA/I/B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,YACd;GAAI,iBACC,wBAAwB;GAAM,WACpC;IACT;KAAE,SAAS;KAAmB,aAAa,iBAAgB,mBAAoB;KAAG,OAAO;IAAI;IAC7F;KAAE,SAAS;KAAe,aAAa,iBAAgB,mBAAoB;KAAG,OAAO;IAAI;IACzF;KAAE,SAAS;KAAiB,aAAa,iBAAgB,mBAAoB;IAAC;GAC/E;GAAA,UACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqET,QAAA,CAAA,6/EAAA;EAAA,CAAA"}
|
|
@@ -357,7 +357,7 @@ var DropdownComponent = class DropdownComponent {
|
|
|
357
357
|
</div>
|
|
358
358
|
} @else {
|
|
359
359
|
@for (item of displayItems(); track item.value; let i = $index) {
|
|
360
|
-
<button type="button" class="dd-item" role="menuitem" tabindex="-1" [disabled]="item.disabled === true" [class.dd-item-active]="activeValue() === item.value" [attr.aria-current]="activeValue() === item.value ? 'true' : null" [attr.aria-describedby]="item.description ? menuId + '-desc-' + i : null" (click)="select(item)">
|
|
360
|
+
<button type="button" class="dd-item" role="menuitem" tabindex="-1" [disabled]="item.disabled === true" [class.dd-item-active]="activeValue() === item.value" [class.dd-item-danger]="item.danger === true" [attr.aria-current]="activeValue() === item.value ? 'true' : null" [attr.aria-describedby]="item.description ? menuId + '-desc-' + i : null" (click)="select(item)">
|
|
361
361
|
@if (item.icon) {
|
|
362
362
|
<svg class="dd-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path [attr.d]="item.icon" /></svg>
|
|
363
363
|
}
|
|
@@ -380,7 +380,7 @@ var DropdownComponent = class DropdownComponent {
|
|
|
380
380
|
</div>
|
|
381
381
|
`,
|
|
382
382
|
isInline: true,
|
|
383
|
-
styles: [":host{display:inline-flex}.dd-wrapper{position:relative;display:inline-flex}:host(.dd-fixed){display:flex;max-width:100%}:host(.dd-fixed) .dd-wrapper{display:flex;flex:1 1 auto;min-width:0}:host(.dd-fixed) .dd-trigger{width:100%;min-width:0;justify-content:space-between}:host(.dd-fixed) .dd-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dd-trigger svg{flex-shrink:0}.dd-trigger{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-family:inherit;transition:all .15s ease}.dd-trigger:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}.dd-trigger-badge{padding:6px 14px;border-radius:999px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#64748b}.dd-trigger-badge:hover{background:#f8fafc;border-color:#94a3b8}.dd-trigger-badge.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn{padding:6px 10px;border-radius:6px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#334155;transition:background .1s,border-color .1s}.dd-trigger-btn:hover{background:#f8fafc}.dd-trigger-btn.dd-open{border-color:#1e293b;background:#f8fafc}.dd-trigger-btn.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn.dd-trigger-md{padding:10px 16px;font-size:.875rem;border-radius:8px}.dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;max-height:70vh;overflow-y:auto;overflow-x:hidden;padding:0;max-width:calc(100vw - 32px);box-sizing:border-box}.dd-menu.dd-menu-end{left:auto;right:0}.dd-menu.dd-menu-up{top:auto;bottom:calc(100% + 6px)}.dd-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 14px;border:none;background:none;font-size:.875rem;font-weight:400;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s;border-bottom:1px solid #f1f5f9;box-sizing:border-box}.dd-item:last-child{border-bottom:none}.dd-item:hover{background:#f8fafc}.dd-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.dd-item.dd-item-active{background:#eff6ff;color:#2563eb}.dd-item:disabled{opacity:.5;cursor:not-allowed;background:none}.dd-icon{flex-shrink:0;color:#64748b}.dd-label{min-width:0}.dd-text-block{display:flex;flex-direction:column;gap:2px;min-width:0}.dd-desc{font-size:.75rem;line-height:1.35;font-weight:400;color:#64748b;white-space:normal;overflow-wrap:anywhere}.dd-item.dd-item-active .dd-desc{color:#475569}@media(forced-colors:active){.dd-desc{color:GrayText}}.dd-count{font-size:.6875rem;font-weight:700;margin-left:auto;background:#f1f5f9;color:#64748b;padding:1px 7px;border-radius:999px;flex-shrink:0}.dd-loading{display:flex;align-items:center;gap:8px;padding:12px;color:#64748b;font-size:.8125rem}.dd-spinner{width:14px;height:14px;border-radius:50%;flex-shrink:0;border:2px solid #e2e8f0;border-top-color:#64748b;animation:dd-spin .6s linear infinite}@keyframes dd-spin{to{transform:rotate(360deg)}}@media(pointer:coarse),(max-width:768px){.dd-trigger-badge,.dd-trigger-btn,.dd-item{min-height:44px}}@media(prefers-reduced-motion:reduce){.dd-spinner{animation-duration:2s}}\n"],
|
|
383
|
+
styles: [":host{display:inline-flex}.dd-wrapper{position:relative;display:inline-flex}:host(.dd-fixed){display:flex;max-width:100%}:host(.dd-fixed) .dd-wrapper{display:flex;flex:1 1 auto;min-width:0}:host(.dd-fixed) .dd-trigger{width:100%;min-width:0;justify-content:space-between}:host(.dd-fixed) .dd-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dd-trigger svg{flex-shrink:0}.dd-trigger{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-family:inherit;transition:all .15s ease}.dd-trigger:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}.dd-trigger-badge{padding:6px 14px;border-radius:999px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#64748b}.dd-trigger-badge:hover{background:#f8fafc;border-color:#94a3b8}.dd-trigger-badge.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn{padding:6px 10px;border-radius:6px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#334155;transition:background .1s,border-color .1s}.dd-trigger-btn:hover{background:#f8fafc}.dd-trigger-btn.dd-open{border-color:#1e293b;background:#f8fafc}.dd-trigger-btn.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn.dd-trigger-md{padding:10px 16px;font-size:.875rem;border-radius:8px}.dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;max-height:70vh;overflow-y:auto;overflow-x:hidden;padding:0;max-width:calc(100vw - 32px);box-sizing:border-box}.dd-menu.dd-menu-end{left:auto;right:0}.dd-menu.dd-menu-up{top:auto;bottom:calc(100% + 6px)}.dd-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 14px;border:none;background:none;font-size:.875rem;font-weight:400;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s;border-bottom:1px solid #f1f5f9;box-sizing:border-box}.dd-item:last-child{border-bottom:none}.dd-item:hover{background:#f8fafc}.dd-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.dd-item.dd-item-active{background:#eff6ff;color:#2563eb}.dd-item.dd-item-danger,.dd-item.dd-item-danger .dd-icon{color:#dc2626}.dd-item.dd-item-danger:hover{background:#fef2f2}.dd-item:disabled{opacity:.5;cursor:not-allowed;background:none}.dd-icon{flex-shrink:0;color:#64748b}.dd-label{min-width:0}.dd-text-block{display:flex;flex-direction:column;gap:2px;min-width:0}.dd-desc{font-size:.75rem;line-height:1.35;font-weight:400;color:#64748b;white-space:normal;overflow-wrap:anywhere}.dd-item.dd-item-active .dd-desc{color:#475569}@media(forced-colors:active){.dd-desc{color:GrayText}}.dd-count{font-size:.6875rem;font-weight:700;margin-left:auto;background:#f1f5f9;color:#64748b;padding:1px 7px;border-radius:999px;flex-shrink:0}.dd-loading{display:flex;align-items:center;gap:8px;padding:12px;color:#64748b;font-size:.8125rem}.dd-spinner{width:14px;height:14px;border-radius:50%;flex-shrink:0;border:2px solid #e2e8f0;border-top-color:#64748b;animation:dd-spin .6s linear infinite}@keyframes dd-spin{to{transform:rotate(360deg)}}@media(pointer:coarse),(max-width:768px){.dd-trigger-badge,.dd-trigger-btn,.dd-item{min-height:44px}}@media(prefers-reduced-motion:reduce){.dd-spinner{animation-duration:2s}}\n"],
|
|
384
384
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
385
385
|
});
|
|
386
386
|
}
|
|
@@ -424,7 +424,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
424
424
|
</div>
|
|
425
425
|
} @else {
|
|
426
426
|
@for (item of displayItems(); track item.value; let i = $index) {
|
|
427
|
-
<button type="button" class="dd-item" role="menuitem" tabindex="-1" [disabled]="item.disabled === true" [class.dd-item-active]="activeValue() === item.value" [attr.aria-current]="activeValue() === item.value ? 'true' : null" [attr.aria-describedby]="item.description ? menuId + '-desc-' + i : null" (click)="select(item)">
|
|
427
|
+
<button type="button" class="dd-item" role="menuitem" tabindex="-1" [disabled]="item.disabled === true" [class.dd-item-active]="activeValue() === item.value" [class.dd-item-danger]="item.danger === true" [attr.aria-current]="activeValue() === item.value ? 'true' : null" [attr.aria-describedby]="item.description ? menuId + '-desc-' + i : null" (click)="select(item)">
|
|
428
428
|
@if (item.icon) {
|
|
429
429
|
<svg class="dd-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path [attr.d]="item.icon" /></svg>
|
|
430
430
|
}
|
|
@@ -446,7 +446,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
446
446
|
}
|
|
447
447
|
</div>
|
|
448
448
|
`,
|
|
449
|
-
styles: [":host{display:inline-flex}.dd-wrapper{position:relative;display:inline-flex}:host(.dd-fixed){display:flex;max-width:100%}:host(.dd-fixed) .dd-wrapper{display:flex;flex:1 1 auto;min-width:0}:host(.dd-fixed) .dd-trigger{width:100%;min-width:0;justify-content:space-between}:host(.dd-fixed) .dd-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dd-trigger svg{flex-shrink:0}.dd-trigger{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-family:inherit;transition:all .15s ease}.dd-trigger:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}.dd-trigger-badge{padding:6px 14px;border-radius:999px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#64748b}.dd-trigger-badge:hover{background:#f8fafc;border-color:#94a3b8}.dd-trigger-badge.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn{padding:6px 10px;border-radius:6px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#334155;transition:background .1s,border-color .1s}.dd-trigger-btn:hover{background:#f8fafc}.dd-trigger-btn.dd-open{border-color:#1e293b;background:#f8fafc}.dd-trigger-btn.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn.dd-trigger-md{padding:10px 16px;font-size:.875rem;border-radius:8px}.dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;max-height:70vh;overflow-y:auto;overflow-x:hidden;padding:0;max-width:calc(100vw - 32px);box-sizing:border-box}.dd-menu.dd-menu-end{left:auto;right:0}.dd-menu.dd-menu-up{top:auto;bottom:calc(100% + 6px)}.dd-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 14px;border:none;background:none;font-size:.875rem;font-weight:400;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s;border-bottom:1px solid #f1f5f9;box-sizing:border-box}.dd-item:last-child{border-bottom:none}.dd-item:hover{background:#f8fafc}.dd-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.dd-item.dd-item-active{background:#eff6ff;color:#2563eb}.dd-item:disabled{opacity:.5;cursor:not-allowed;background:none}.dd-icon{flex-shrink:0;color:#64748b}.dd-label{min-width:0}.dd-text-block{display:flex;flex-direction:column;gap:2px;min-width:0}.dd-desc{font-size:.75rem;line-height:1.35;font-weight:400;color:#64748b;white-space:normal;overflow-wrap:anywhere}.dd-item.dd-item-active .dd-desc{color:#475569}@media(forced-colors:active){.dd-desc{color:GrayText}}.dd-count{font-size:.6875rem;font-weight:700;margin-left:auto;background:#f1f5f9;color:#64748b;padding:1px 7px;border-radius:999px;flex-shrink:0}.dd-loading{display:flex;align-items:center;gap:8px;padding:12px;color:#64748b;font-size:.8125rem}.dd-spinner{width:14px;height:14px;border-radius:50%;flex-shrink:0;border:2px solid #e2e8f0;border-top-color:#64748b;animation:dd-spin .6s linear infinite}@keyframes dd-spin{to{transform:rotate(360deg)}}@media(pointer:coarse),(max-width:768px){.dd-trigger-badge,.dd-trigger-btn,.dd-item{min-height:44px}}@media(prefers-reduced-motion:reduce){.dd-spinner{animation-duration:2s}}\n"]
|
|
449
|
+
styles: [":host{display:inline-flex}.dd-wrapper{position:relative;display:inline-flex}:host(.dd-fixed){display:flex;max-width:100%}:host(.dd-fixed) .dd-wrapper{display:flex;flex:1 1 auto;min-width:0}:host(.dd-fixed) .dd-trigger{width:100%;min-width:0;justify-content:space-between}:host(.dd-fixed) .dd-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dd-trigger svg{flex-shrink:0}.dd-trigger{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-family:inherit;transition:all .15s ease}.dd-trigger:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}.dd-trigger-badge{padding:6px 14px;border-radius:999px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#64748b}.dd-trigger-badge:hover{background:#f8fafc;border-color:#94a3b8}.dd-trigger-badge.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn{padding:6px 10px;border-radius:6px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#334155;transition:background .1s,border-color .1s}.dd-trigger-btn:hover{background:#f8fafc}.dd-trigger-btn.dd-open{border-color:#1e293b;background:#f8fafc}.dd-trigger-btn.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn.dd-trigger-md{padding:10px 16px;font-size:.875rem;border-radius:8px}.dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;max-height:70vh;overflow-y:auto;overflow-x:hidden;padding:0;max-width:calc(100vw - 32px);box-sizing:border-box}.dd-menu.dd-menu-end{left:auto;right:0}.dd-menu.dd-menu-up{top:auto;bottom:calc(100% + 6px)}.dd-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 14px;border:none;background:none;font-size:.875rem;font-weight:400;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s;border-bottom:1px solid #f1f5f9;box-sizing:border-box}.dd-item:last-child{border-bottom:none}.dd-item:hover{background:#f8fafc}.dd-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.dd-item.dd-item-active{background:#eff6ff;color:#2563eb}.dd-item.dd-item-danger,.dd-item.dd-item-danger .dd-icon{color:#dc2626}.dd-item.dd-item-danger:hover{background:#fef2f2}.dd-item:disabled{opacity:.5;cursor:not-allowed;background:none}.dd-icon{flex-shrink:0;color:#64748b}.dd-label{min-width:0}.dd-text-block{display:flex;flex-direction:column;gap:2px;min-width:0}.dd-desc{font-size:.75rem;line-height:1.35;font-weight:400;color:#64748b;white-space:normal;overflow-wrap:anywhere}.dd-item.dd-item-active .dd-desc{color:#475569}@media(forced-colors:active){.dd-desc{color:GrayText}}.dd-count{font-size:.6875rem;font-weight:700;margin-left:auto;background:#f1f5f9;color:#64748b;padding:1px 7px;border-radius:999px;flex-shrink:0}.dd-loading{display:flex;align-items:center;gap:8px;padding:12px;color:#64748b;font-size:.8125rem}.dd-spinner{width:14px;height:14px;border-radius:50%;flex-shrink:0;border:2px solid #e2e8f0;border-top-color:#64748b;animation:dd-spin .6s linear infinite}@keyframes dd-spin{to{transform:rotate(360deg)}}@media(pointer:coarse),(max-width:768px){.dd-trigger-badge,.dd-trigger-btn,.dd-item{min-height:44px}}@media(prefers-reduced-motion:reduce){.dd-spinner{animation-duration:2s}}\n"]
|
|
450
450
|
}]
|
|
451
451
|
}],
|
|
452
452
|
ctorParameters: () => [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgeroute-ui-dropdown.mjs","names":[],"sources":["../../../projects/forgeroute-ui/dropdown/src/lib/dropdown/dropdown.component.ts"],"sourcesContent":["import { Component, input, output, signal, computed, effect, untracked, inject, ElementRef, ChangeDetectorRef, DestroyRef, Injector, afterNextRender, ChangeDetectionStrategy } from '@angular/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n// Shared across all instances — tracks which dropdown is currently open so\n// opening one automatically closes any other that is open.\nconst _activeDropdownId = signal('');\n\nexport interface DropdownItem {\n label: string;\n value: string;\n count?: number;\n /** Greyed-out, not selectable and skipped by keyboard navigation. */\n disabled?: boolean;\n /** Optional 14px icon before the label: an SVG path (the `d` value, like a toolbar action's `icon`). Decorative (hidden from assistive tech). */\n icon?: string;\n /** Optional smaller, muted second line under the label (e.g. what the choice does). Read by assistive technology as the item's description, not as part of its name. Plain text. */\n description?: string;\n}\n\n/** Which edge of the trigger the menu lines up with: `auto` (default) opens from the trigger's left edge and switches to its right edge when the menu would run off the right of the screen. */\nexport type DropdownAlign = 'auto' | 'start' | 'end';\n\n@Component({\n selector: 'ui-dropdown',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:click)': 'close()',\n // Escape closes the open menu (focus goes back to the trigger). The event is only stopped when the\n // menu was open, so an Escape with the menu closed still reaches a surrounding side panel / modal.\n '(keydown.escape)': 'onEscape($event)',\n // `width` set: the host takes that width (never wider than its container) and the trigger fills it.\n '[class.dd-fixed]': \"width() !== ''\",\n '[style.width]': \"width() || null\",\n },\n template: `\n <div class=\"dd-wrapper\">\n @if (variant() === 'badge') {\n <button type=\"button\" class=\"dd-trigger dd-trigger-badge\" [class.dd-active]=\"active()\" [class.dd-open]=\"open()\" [attr.id]=\"triggerId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-expanded]=\"open()\" aria-haspopup=\"menu\" [attr.aria-controls]=\"open() ? menuId : null\" (click)=\"toggle($event)\" (keydown)=\"onTriggerKeydown($event)\" (keyup)=\"onTriggerKeyup($event)\">\n <span class=\"dd-text\">{{ label() }}</span>\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n } @else {\n <button type=\"button\" class=\"dd-trigger dd-trigger-btn\" [class.dd-trigger-md]=\"size() === 'md'\" [class.dd-active]=\"active()\" [class.dd-open]=\"open()\" [attr.id]=\"triggerId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-expanded]=\"open()\" aria-haspopup=\"menu\" [attr.aria-controls]=\"open() ? menuId : null\" (click)=\"toggle($event)\" (keydown)=\"onTriggerKeydown($event)\" (keyup)=\"onTriggerKeyup($event)\">\n <span class=\"dd-text\">{{ label() }}</span>\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n }\n @if (open()) {\n <div class=\"dd-menu\" role=\"menu\" [attr.id]=\"menuId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-labelledby]=\"_ariaLabel() ? null : triggerId\" [style.min-width]=\"menuWidth()\" [class.dd-menu-end]=\"alignEnd()\" [class.dd-menu-up]=\"openUp()\" [style.max-height.px]=\"menuMaxHeight()\" [attr.aria-busy]=\"loading() ? 'true' : null\" (click)=\"$event.stopPropagation()\" (keydown)=\"onMenuKeydown($event)\">\n @if (loading()) {\n <div class=\"dd-loading\">\n <span class=\"dd-spinner\"></span>\n <span>{{ labels.t('common.loadingellipsis') }}</span>\n </div>\n } @else {\n @for (item of displayItems(); track item.value; let i = $index) {\n <button type=\"button\" class=\"dd-item\" role=\"menuitem\" tabindex=\"-1\" [disabled]=\"item.disabled === true\" [class.dd-item-active]=\"activeValue() === item.value\" [attr.aria-current]=\"activeValue() === item.value ? 'true' : null\" [attr.aria-describedby]=\"item.description ? menuId + '-desc-' + i : null\" (click)=\"select(item)\">\n @if (item.icon) {\n <svg class=\"dd-icon\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path [attr.d]=\"item.icon\" /></svg>\n }\n @if (item.description) {\n <span class=\"dd-text-block\">\n <span class=\"dd-label\">{{ item.label }}</span>\n <span class=\"dd-desc\" [attr.id]=\"menuId + '-desc-' + i\">{{ item.description }}</span>\n </span>\n } @else {\n <span class=\"dd-label\">{{ item.label }}</span>\n }\n @if (item.count !== undefined) {\n <span class=\"dd-count\">{{ item.count }}</span>\n }\n </button>\n }\n }\n </div>\n }\n </div>\n `,\n styles: [`\n :host { display: inline-flex; }\n\n .dd-wrapper { position: relative; display: inline-flex; }\n\n /* Fixed width (the \\`width\\` input): one width whatever the selected label, the trigger fills it. */\n :host(.dd-fixed) { display: flex; max-width: 100%; }\n :host(.dd-fixed) .dd-wrapper { display: flex; flex: 1 1 auto; min-width: 0; }\n :host(.dd-fixed) .dd-trigger { width: 100%; min-width: 0; justify-content: space-between; }\n /* A label longer than the fixed width is cut with an ellipsis on one line; the chevron is never squeezed. */\n :host(.dd-fixed) .dd-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .dd-trigger svg { flex-shrink: 0; }\n\n .dd-trigger {\n display: inline-flex; align-items: center; gap: 6px;\n cursor: pointer; font-family: inherit; transition: all 150ms ease;\n &:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }\n }\n\n .dd-trigger-badge {\n padding: 6px 14px; border-radius: 999px; border: 1px solid #e2e8f0;\n background: #fff; font-size: 0.8125rem; font-weight: 500; color: #64748b;\n &:hover { background: #f8fafc; border-color: #94a3b8; }\n &.dd-active { background: #1e293b; color: #fff; border-color: #1e293b; }\n }\n\n /* Same look as the data-table's More Actions button and menu. */\n .dd-trigger-btn {\n padding: 6px 10px; border-radius: 6px; border: 1px solid #e2e8f0;\n background: #fff; font-size: 0.8125rem; font-weight: 500; color: #334155;\n transition: background 0.1s, border-color 0.1s;\n &:hover { background: #f8fafc; }\n &.dd-open { border-color: #1e293b; background: #f8fafc; }\n &.dd-active { background: #1e293b; color: #fff; border-color: #1e293b; }\n }\n\n /* size=\"md\": the same height and type as a medium ui-button, so the two sit side by side in a toolbar or page header. */\n .dd-trigger-btn.dd-trigger-md { padding: 10px 16px; font-size: 0.875rem; border-radius: 8px; }\n\n .dd-menu {\n position: absolute; top: calc(100% + 6px); left: 0; z-index: 9999;\n background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;\n box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 12px 28px rgba(0,0,0,0.10);\n max-height: 70vh; overflow-y: auto; overflow-x: hidden; padding: 0;\n max-width: calc(100vw - 32px); box-sizing: border-box;\n }\n /* Opens toward the trigger's right edge / above the trigger when there is no room the default way (set from the measured position). */\n .dd-menu.dd-menu-end { left: auto; right: 0; }\n .dd-menu.dd-menu-up { top: auto; bottom: calc(100% + 6px); }\n\n .dd-item {\n display: flex; align-items: center; gap: 10px;\n width: 100%; padding: 10px 14px; border: none; background: none;\n font-size: 0.875rem; font-weight: 400; color: #1e293b; cursor: pointer;\n font-family: inherit; text-align: left; transition: background 0.1s;\n border-bottom: 1px solid #f1f5f9; box-sizing: border-box;\n &:last-child { border-bottom: none; }\n &:hover { background: #f8fafc; }\n &:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }\n &.dd-item-active { background: #eff6ff; color: #2563eb; }\n &:disabled { opacity: 0.5; cursor: not-allowed; background: none; }\n }\n .dd-icon { flex-shrink: 0; color: #64748b; }\n .dd-label { min-width: 0; }\n /* An item with a description: the name on top, the description under it in smaller, muted type (wraps instead of widening the menu). */\n .dd-text-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n .dd-desc { font-size: 0.75rem; line-height: 1.35; font-weight: 400; color: #64748b; white-space: normal; overflow-wrap: anywhere; }\n .dd-item.dd-item-active .dd-desc { color: #475569; }\n @media (forced-colors: active) { .dd-desc { color: GrayText; } }\n\n .dd-count {\n font-size: 0.6875rem; font-weight: 700; margin-left: auto;\n background: #f1f5f9; color: #64748b;\n padding: 1px 7px; border-radius: 999px; flex-shrink: 0;\n }\n\n .dd-loading {\n display: flex; align-items: center; gap: 8px;\n padding: 12px; color: #64748b; font-size: 0.8125rem;\n }\n .dd-spinner {\n width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;\n border: 2px solid #e2e8f0; border-top-color: #64748b;\n animation: dd-spin 0.6s linear infinite;\n }\n @keyframes dd-spin { to { transform: rotate(360deg); } }\n\n /* Touch targets: 44px on touch screens and phones. */\n @media (pointer: coarse), (max-width: 768px) {\n .dd-trigger-badge, .dd-trigger-btn { min-height: 44px; }\n .dd-item { min-height: 44px; }\n }\n\n /* Reduced motion: no entrance / shimmer animation (a loading spinner stays, slower). */\n @media (prefers-reduced-motion: reduce) {\n .dd-spinner { animation-duration: 2s; } /* a loading indicator stays, but turns slowly */\n }\n `],\n})\nexport class DropdownComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n readonly items = input<DropdownItem[]>([]);\n /** Optional async loader — called once on open, result cached until closed. */\n readonly loader = input<(() => Promise<DropdownItem[]>) | null>(null);\n readonly active = input(false);\n readonly activeValue = input('');\n readonly variant = input<'button' | 'badge'>('button');\n /** Trigger size for `variant=\"button\"`: `sm` (default, the compact toolbar look) or `md` (same padding and type as a medium `ui-button`). */\n readonly size = input<'sm' | 'md'>('sm');\n readonly menuWidth = input('200px');\n /**\n * Fixed width of the trigger as a CSS length (e.g. `'280px'`). Empty (default) = the trigger is as wide as its label. When set, the trigger keeps that\n * width whatever label is selected (never wider than its container) and its label and chevron sit at the two ends.\n */\n readonly width = input('');\n /**\n * Accessible name. Set it when the trigger has no meaningful visible text. Applied as `aria-label` on the\n * trigger and on the menu; when empty (default) no `aria-label` is rendered, the trigger is named by its\n * visible label and the menu by `aria-labelledby` pointing at the trigger. Surrounding whitespace is trimmed.\n */\n readonly ariaLabel = input('');\n\n readonly itemClick = output<DropdownItem>();\n /** Which edge of the trigger the menu lines up with (default `auto`: from the left edge, switching to the right edge when it would run off the screen). */\n readonly align = input<DropdownAlign>('auto');\n\n protected readonly open = signal(false);\n protected readonly loading = signal(false);\n /** Placement measured when the menu opens: right-aligned, above the trigger, and the height left on that side (the menu scrolls inside it). */\n protected readonly alignEnd = signal(false);\n protected readonly openUp = signal(false);\n protected readonly menuMaxHeight = signal<number | null>(null);\n private readonly _loaded = signal<DropdownItem[] | null>(null);\n private readonly _id = Math.random().toString(36).slice(2);\n private readonly _host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly _cdr = inject(ChangeDetectorRef);\n private readonly _injector = inject(Injector);\n private _pendingFocus: 'first' | 'last' | null = null;\n private _typeahead = '';\n private _typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n private _destroyed = false;\n /** Identifies the current loader request, so a late or stale answer (menu closed / reopened meanwhile) is ignored. */\n private _loadToken = 0;\n\n protected readonly triggerId = `ui-dd-trigger-${this._id}`;\n protected readonly menuId = `ui-dd-menu-${this._id}`;\n protected readonly _ariaLabel = computed(() => this.ariaLabel().trim() || null);\n\n protected readonly displayItems = computed<DropdownItem[]>(() =>\n this.open() ? (this._loaded() ?? this.items()) : []\n );\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this._destroyed = true;\n if (this._typeaheadTimer) clearTimeout(this._typeaheadTimer);\n if (_activeDropdownId() === this._id) _activeDropdownId.set('');\n });\n effect(() => {\n if (_activeDropdownId() !== this._id) {\n untracked(() => this.close()); // full close: also resets pending focus, typeahead and placement\n }\n });\n\n effect(() => {\n const isOpen = this.open();\n const loader = this.loader();\n if (!loader) return;\n if (isOpen && untracked(() => this._loaded()) === null) {\n const token = ++this._loadToken;\n this.loading.set(true);\n // A loader that throws or rejects shows an empty menu (never an endless \"Loading...\").\n const done = (items: DropdownItem[]) => {\n if (this._destroyed || token !== this._loadToken) return; // closed / reopened meanwhile: stale answer\n this._loaded.set(items);\n this.loading.set(false);\n if (this.open()) {\n afterNextRender(() => this._place(), { injector: this._injector }); // the real item list is taller than the \"Loading...\" row\n if (this._pendingFocus) this._focusPending();\n }\n };\n new Promise<DropdownItem[]>(resolve => resolve(loader())).then(done, () => done([]));\n } else if (!isOpen) {\n this._loadToken++;\n this.loading.set(false);\n this._loaded.set(null);\n }\n });\n }\n\n toggle(event: Event) {\n event.stopPropagation();\n this._setOpen(!this.open());\n // Safari / Firefox on macOS do not focus a button on click: focus the trigger so Escape and the arrow keys reach the dropdown.\n this._focusTrigger();\n }\n\n select(item: DropdownItem) {\n if (item.disabled) return;\n this._setOpen(false);\n this.itemClick.emit(item);\n this._focusTrigger();\n }\n\n close() {\n if (this.open()) this._setOpen(false);\n }\n\n /**\n * Keyboard contract (WAI-ARIA menu button).\n * Trigger: Enter / Space toggle (opening focuses the first item), ArrowDown opens + first item,\n * ArrowUp opens + last item, ArrowDown/ArrowUp while open move into the menu, Tab closes (focus moves on naturally).\n */\n protected onTriggerKeydown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey || event.altKey) return;\n switch (event.key) {\n case 'Enter':\n case ' ':\n event.preventDefault(); // no native click: we open + focus ourselves\n if (this.open()) this._setOpen(false);\n else this._openAndFocus('first');\n break;\n case 'ArrowDown':\n event.preventDefault();\n if (this.open()) { this._pendingFocus = 'first'; this._focusPending(); }\n else this._openAndFocus('first');\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.open()) { this._pendingFocus = 'last'; this._focusPending(); }\n else this._openAndFocus('last');\n break;\n case 'Tab':\n this.close();\n break;\n }\n }\n\n /** Firefox fires the button click on Space keyup even when keydown was prevented. */\n protected onTriggerKeyup(event: KeyboardEvent) {\n if (event.key === ' ') event.preventDefault();\n }\n\n /**\n * Menu keys (focus on an item): ArrowDown / ArrowUp move with wrap, Home / End jump to first / last,\n * Enter / Space activate the focused item (native button click), Tab / Shift+Tab close and let focus move on from the trigger,\n * printable characters jump to the next item whose label starts with the typed text (typeahead, reset after 500 ms).\n * Disabled items are skipped. Other keys are ignored. Escape is handled on the host.\n */\n protected onMenuKeydown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey || event.altKey) return;\n const items = this._enabledItems();\n const current = items.indexOf(document.activeElement as HTMLElement);\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (items.length) items[current < 0 ? 0 : (current + 1) % items.length].focus();\n return;\n case 'ArrowUp':\n event.preventDefault();\n if (items.length) items[current <= 0 ? items.length - 1 : current - 1].focus();\n return;\n case 'Home':\n event.preventDefault();\n items[0]?.focus();\n return;\n case 'End':\n event.preventDefault();\n items[items.length - 1]?.focus();\n return;\n case 'Tab':\n // Park focus on the trigger first: the menu is removed from the DOM, so the browser's Tab\n // then continues from the trigger (next / previous control) instead of from <body>.\n this._focusTrigger();\n this.close();\n return;\n }\n if (event.key.length === 1 && (event.key !== ' ' || this._typeahead)) {\n event.preventDefault();\n this._typeaheadFocus(event.key.toLowerCase(), items, current);\n }\n }\n\n protected onEscape(event: Event) {\n if (!this.open()) return; // closed: let a surrounding panel / modal handle Escape\n event.stopPropagation();\n this._setOpen(false);\n this._focusTrigger();\n }\n\n private _setOpen(next: boolean) {\n if (this.open() === next) return;\n this.open.set(next);\n if (next) {\n _activeDropdownId.set(this._id);\n afterNextRender(() => this._place(), { injector: this._injector });\n }\n else {\n this._pendingFocus = null;\n this._typeahead = '';\n if (_activeDropdownId() === this._id) _activeDropdownId.set('');\n this.alignEnd.set(false); this.openUp.set(false); this.menuMaxHeight.set(null);\n }\n }\n\n /**\n * Places the open menu from its measured size and the trigger's screen position: it keeps 16px clear of the screen edges, lines up with the trigger's\n * right edge instead of the left when that is the side with room (`align` = auto), opens above the trigger when there is more room there, and is capped to\n * the room left on that side (so it scrolls inside only when it truly does not fit). No layout APIs (server rendering) = the default placement.\n */\n private _place() {\n const host = this._host.nativeElement;\n const trigger = host.querySelector('.dd-trigger') as HTMLElement | null;\n const menu = host.querySelector('.dd-menu') as HTMLElement | null;\n if (!trigger || !menu || typeof window === 'undefined') return;\n const MARGIN = 16, GAP = 6;\n // Measure in the default placement\n this.alignEnd.set(false); this.openUp.set(false); this.menuMaxHeight.set(null);\n this._cdr.detectChanges();\n const t = trigger.getBoundingClientRect();\n const vw = document.documentElement.clientWidth || window.innerWidth;\n const vh = window.innerHeight;\n const width = menu.offsetWidth;\n const naturalHeight = menu.scrollHeight + 2;\n const mode = this.align();\n const fitsStart = t.left + width <= vw - MARGIN;\n const fitsEnd = t.right - width >= MARGIN;\n const end = mode === 'end' || (mode === 'auto' && !fitsStart && (fitsEnd || t.right > vw / 2));\n const below = vh - t.bottom - GAP - MARGIN;\n const above = t.top - GAP - MARGIN;\n const up = naturalHeight > below && above > below;\n this.alignEnd.set(end);\n this.openUp.set(up);\n this.menuMaxHeight.set(Math.max(160, Math.floor(up ? above : below)));\n this._cdr.markForCheck();\n }\n\n private _openAndFocus(which: 'first' | 'last') {\n this._pendingFocus = which;\n this._setOpen(true);\n this._focusPending();\n }\n\n /** Renders the menu synchronously, then focuses the pending first / last enabled item. */\n private _focusPending() {\n this._cdr.detectChanges();\n // a loader is pending (or about to start: its effect has not run yet): the focus is applied when it resolves\n if (this.loading() || (this.loader() !== null && this._loaded() === null)) return;\n const items = this._enabledItems();\n const target = this._pendingFocus === 'last' ? items[items.length - 1] : items[0];\n this._pendingFocus = null;\n target?.focus();\n }\n\n private _typeaheadFocus(char: string, items: HTMLElement[], current: number) {\n this._typeahead += char;\n if (this._typeaheadTimer) clearTimeout(this._typeaheadTimer);\n this._typeaheadTimer = setTimeout(() => { this._typeahead = ''; this._typeaheadTimer = null; }, 500);\n const single = this._typeahead.length === 1 || [...this._typeahead].every(c => c === this._typeahead[0]);\n const needle = single ? this._typeahead[0] : this._typeahead;\n const start = single ? current + 1 : Math.max(current, 0);\n for (let i = 0; i < items.length; i++) {\n const el = items[(start + i) % items.length];\n const text = (el.querySelector('span')?.textContent ?? '').trim().toLowerCase();\n if (text.startsWith(needle)) { el.focus(); return; }\n }\n }\n\n private _enabledItems(): HTMLElement[] {\n return Array.from(this._host.nativeElement.querySelectorAll<HTMLElement>('.dd-menu .dd-item:not(:disabled)'));\n }\n\n private _focusTrigger() {\n this._host.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;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,OAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,WAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,OAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA,EAAA,WAAA,YAAA;GAAA,MAAA;IAAA,WAAA;KAAA,kBAAA;KAAA,kBAAA;IAAA;IAAA,YAAA;KAAA,kBAAA;KAAA,eAAA;IAAA;GAAA;GAAA,UAAA;GAAA,UA/IlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CT,UAAA;GAAA,QAAA,CAAA,2pGAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAoGU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EA5J7B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,YACX;GAAI,iBACC,wBAAwB;GAAM,MACzC;IACJ,oBAAoB;IAGpB,oBAAoB;IAEpB,oBAAoB;IACpB,iBAAiB;GAClB;GAAA,UACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CT,QAAA,CAAA,2pGAAA;EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"forgeroute-ui-dropdown.mjs","names":[],"sources":["../../../projects/forgeroute-ui/dropdown/src/lib/dropdown/dropdown.component.ts"],"sourcesContent":["import { Component, input, output, signal, computed, effect, untracked, inject, ElementRef, ChangeDetectorRef, DestroyRef, Injector, afterNextRender, ChangeDetectionStrategy } from '@angular/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n// Shared across all instances — tracks which dropdown is currently open so\n// opening one automatically closes any other that is open.\nconst _activeDropdownId = signal('');\n\nexport interface DropdownItem {\n label: string;\n value: string;\n count?: number;\n /** Greyed-out, not selectable and skipped by keyboard navigation. */\n disabled?: boolean;\n /** Destructive choice (e.g. Delete): the label and icon are drawn in red. */\n danger?: boolean;\n /** Optional 14px icon before the label: an SVG path (the `d` value, like a toolbar action's `icon`). Decorative (hidden from assistive tech). */\n icon?: string;\n /** Optional smaller, muted second line under the label (e.g. what the choice does). Read by assistive technology as the item's description, not as part of its name. Plain text. */\n description?: string;\n}\n\n/** Which edge of the trigger the menu lines up with: `auto` (default) opens from the trigger's left edge and switches to its right edge when the menu would run off the right of the screen. */\nexport type DropdownAlign = 'auto' | 'start' | 'end';\n\n@Component({\n selector: 'ui-dropdown',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:click)': 'close()',\n // Escape closes the open menu (focus goes back to the trigger). The event is only stopped when the\n // menu was open, so an Escape with the menu closed still reaches a surrounding side panel / modal.\n '(keydown.escape)': 'onEscape($event)',\n // `width` set: the host takes that width (never wider than its container) and the trigger fills it.\n '[class.dd-fixed]': \"width() !== ''\",\n '[style.width]': \"width() || null\",\n },\n template: `\n <div class=\"dd-wrapper\">\n @if (variant() === 'badge') {\n <button type=\"button\" class=\"dd-trigger dd-trigger-badge\" [class.dd-active]=\"active()\" [class.dd-open]=\"open()\" [attr.id]=\"triggerId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-expanded]=\"open()\" aria-haspopup=\"menu\" [attr.aria-controls]=\"open() ? menuId : null\" (click)=\"toggle($event)\" (keydown)=\"onTriggerKeydown($event)\" (keyup)=\"onTriggerKeyup($event)\">\n <span class=\"dd-text\">{{ label() }}</span>\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n } @else {\n <button type=\"button\" class=\"dd-trigger dd-trigger-btn\" [class.dd-trigger-md]=\"size() === 'md'\" [class.dd-active]=\"active()\" [class.dd-open]=\"open()\" [attr.id]=\"triggerId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-expanded]=\"open()\" aria-haspopup=\"menu\" [attr.aria-controls]=\"open() ? menuId : null\" (click)=\"toggle($event)\" (keydown)=\"onTriggerKeydown($event)\" (keyup)=\"onTriggerKeyup($event)\">\n <span class=\"dd-text\">{{ label() }}</span>\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n }\n @if (open()) {\n <div class=\"dd-menu\" role=\"menu\" [attr.id]=\"menuId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-labelledby]=\"_ariaLabel() ? null : triggerId\" [style.min-width]=\"menuWidth()\" [class.dd-menu-end]=\"alignEnd()\" [class.dd-menu-up]=\"openUp()\" [style.max-height.px]=\"menuMaxHeight()\" [attr.aria-busy]=\"loading() ? 'true' : null\" (click)=\"$event.stopPropagation()\" (keydown)=\"onMenuKeydown($event)\">\n @if (loading()) {\n <div class=\"dd-loading\">\n <span class=\"dd-spinner\"></span>\n <span>{{ labels.t('common.loadingellipsis') }}</span>\n </div>\n } @else {\n @for (item of displayItems(); track item.value; let i = $index) {\n <button type=\"button\" class=\"dd-item\" role=\"menuitem\" tabindex=\"-1\" [disabled]=\"item.disabled === true\" [class.dd-item-active]=\"activeValue() === item.value\" [class.dd-item-danger]=\"item.danger === true\" [attr.aria-current]=\"activeValue() === item.value ? 'true' : null\" [attr.aria-describedby]=\"item.description ? menuId + '-desc-' + i : null\" (click)=\"select(item)\">\n @if (item.icon) {\n <svg class=\"dd-icon\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path [attr.d]=\"item.icon\" /></svg>\n }\n @if (item.description) {\n <span class=\"dd-text-block\">\n <span class=\"dd-label\">{{ item.label }}</span>\n <span class=\"dd-desc\" [attr.id]=\"menuId + '-desc-' + i\">{{ item.description }}</span>\n </span>\n } @else {\n <span class=\"dd-label\">{{ item.label }}</span>\n }\n @if (item.count !== undefined) {\n <span class=\"dd-count\">{{ item.count }}</span>\n }\n </button>\n }\n }\n </div>\n }\n </div>\n `,\n styles: [`\n :host { display: inline-flex; }\n\n .dd-wrapper { position: relative; display: inline-flex; }\n\n /* Fixed width (the \\`width\\` input): one width whatever the selected label, the trigger fills it. */\n :host(.dd-fixed) { display: flex; max-width: 100%; }\n :host(.dd-fixed) .dd-wrapper { display: flex; flex: 1 1 auto; min-width: 0; }\n :host(.dd-fixed) .dd-trigger { width: 100%; min-width: 0; justify-content: space-between; }\n /* A label longer than the fixed width is cut with an ellipsis on one line; the chevron is never squeezed. */\n :host(.dd-fixed) .dd-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .dd-trigger svg { flex-shrink: 0; }\n\n .dd-trigger {\n display: inline-flex; align-items: center; gap: 6px;\n cursor: pointer; font-family: inherit; transition: all 150ms ease;\n &:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }\n }\n\n .dd-trigger-badge {\n padding: 6px 14px; border-radius: 999px; border: 1px solid #e2e8f0;\n background: #fff; font-size: 0.8125rem; font-weight: 500; color: #64748b;\n &:hover { background: #f8fafc; border-color: #94a3b8; }\n &.dd-active { background: #1e293b; color: #fff; border-color: #1e293b; }\n }\n\n /* Same look as the data-table's More Actions button and menu. */\n .dd-trigger-btn {\n padding: 6px 10px; border-radius: 6px; border: 1px solid #e2e8f0;\n background: #fff; font-size: 0.8125rem; font-weight: 500; color: #334155;\n transition: background 0.1s, border-color 0.1s;\n &:hover { background: #f8fafc; }\n &.dd-open { border-color: #1e293b; background: #f8fafc; }\n &.dd-active { background: #1e293b; color: #fff; border-color: #1e293b; }\n }\n\n /* size=\"md\": the same height and type as a medium ui-button, so the two sit side by side in a toolbar or page header. */\n .dd-trigger-btn.dd-trigger-md { padding: 10px 16px; font-size: 0.875rem; border-radius: 8px; }\n\n .dd-menu {\n position: absolute; top: calc(100% + 6px); left: 0; z-index: 9999;\n background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;\n box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 12px 28px rgba(0,0,0,0.10);\n max-height: 70vh; overflow-y: auto; overflow-x: hidden; padding: 0;\n max-width: calc(100vw - 32px); box-sizing: border-box;\n }\n /* Opens toward the trigger's right edge / above the trigger when there is no room the default way (set from the measured position). */\n .dd-menu.dd-menu-end { left: auto; right: 0; }\n .dd-menu.dd-menu-up { top: auto; bottom: calc(100% + 6px); }\n\n .dd-item {\n display: flex; align-items: center; gap: 10px;\n width: 100%; padding: 10px 14px; border: none; background: none;\n font-size: 0.875rem; font-weight: 400; color: #1e293b; cursor: pointer;\n font-family: inherit; text-align: left; transition: background 0.1s;\n border-bottom: 1px solid #f1f5f9; box-sizing: border-box;\n &:last-child { border-bottom: none; }\n &:hover { background: #f8fafc; }\n &:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }\n &.dd-item-active { background: #eff6ff; color: #2563eb; }\n &.dd-item-danger { color: #dc2626; .dd-icon { color: #dc2626; } &:hover { background: #fef2f2; } }\n &:disabled { opacity: 0.5; cursor: not-allowed; background: none; }\n }\n .dd-icon { flex-shrink: 0; color: #64748b; }\n .dd-label { min-width: 0; }\n /* An item with a description: the name on top, the description under it in smaller, muted type (wraps instead of widening the menu). */\n .dd-text-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n .dd-desc { font-size: 0.75rem; line-height: 1.35; font-weight: 400; color: #64748b; white-space: normal; overflow-wrap: anywhere; }\n .dd-item.dd-item-active .dd-desc { color: #475569; }\n @media (forced-colors: active) { .dd-desc { color: GrayText; } }\n\n .dd-count {\n font-size: 0.6875rem; font-weight: 700; margin-left: auto;\n background: #f1f5f9; color: #64748b;\n padding: 1px 7px; border-radius: 999px; flex-shrink: 0;\n }\n\n .dd-loading {\n display: flex; align-items: center; gap: 8px;\n padding: 12px; color: #64748b; font-size: 0.8125rem;\n }\n .dd-spinner {\n width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;\n border: 2px solid #e2e8f0; border-top-color: #64748b;\n animation: dd-spin 0.6s linear infinite;\n }\n @keyframes dd-spin { to { transform: rotate(360deg); } }\n\n /* Touch targets: 44px on touch screens and phones. */\n @media (pointer: coarse), (max-width: 768px) {\n .dd-trigger-badge, .dd-trigger-btn { min-height: 44px; }\n .dd-item { min-height: 44px; }\n }\n\n /* Reduced motion: no entrance / shimmer animation (a loading spinner stays, slower). */\n @media (prefers-reduced-motion: reduce) {\n .dd-spinner { animation-duration: 2s; } /* a loading indicator stays, but turns slowly */\n }\n `],\n})\nexport class DropdownComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n readonly items = input<DropdownItem[]>([]);\n /** Optional async loader — called once on open, result cached until closed. */\n readonly loader = input<(() => Promise<DropdownItem[]>) | null>(null);\n readonly active = input(false);\n readonly activeValue = input('');\n readonly variant = input<'button' | 'badge'>('button');\n /** Trigger size for `variant=\"button\"`: `sm` (default, the compact toolbar look) or `md` (same padding and type as a medium `ui-button`). */\n readonly size = input<'sm' | 'md'>('sm');\n readonly menuWidth = input('200px');\n /**\n * Fixed width of the trigger as a CSS length (e.g. `'280px'`). Empty (default) = the trigger is as wide as its label. When set, the trigger keeps that\n * width whatever label is selected (never wider than its container) and its label and chevron sit at the two ends.\n */\n readonly width = input('');\n /**\n * Accessible name. Set it when the trigger has no meaningful visible text. Applied as `aria-label` on the\n * trigger and on the menu; when empty (default) no `aria-label` is rendered, the trigger is named by its\n * visible label and the menu by `aria-labelledby` pointing at the trigger. Surrounding whitespace is trimmed.\n */\n readonly ariaLabel = input('');\n\n readonly itemClick = output<DropdownItem>();\n /** Which edge of the trigger the menu lines up with (default `auto`: from the left edge, switching to the right edge when it would run off the screen). */\n readonly align = input<DropdownAlign>('auto');\n\n protected readonly open = signal(false);\n protected readonly loading = signal(false);\n /** Placement measured when the menu opens: right-aligned, above the trigger, and the height left on that side (the menu scrolls inside it). */\n protected readonly alignEnd = signal(false);\n protected readonly openUp = signal(false);\n protected readonly menuMaxHeight = signal<number | null>(null);\n private readonly _loaded = signal<DropdownItem[] | null>(null);\n private readonly _id = Math.random().toString(36).slice(2);\n private readonly _host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly _cdr = inject(ChangeDetectorRef);\n private readonly _injector = inject(Injector);\n private _pendingFocus: 'first' | 'last' | null = null;\n private _typeahead = '';\n private _typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n private _destroyed = false;\n /** Identifies the current loader request, so a late or stale answer (menu closed / reopened meanwhile) is ignored. */\n private _loadToken = 0;\n\n protected readonly triggerId = `ui-dd-trigger-${this._id}`;\n protected readonly menuId = `ui-dd-menu-${this._id}`;\n protected readonly _ariaLabel = computed(() => this.ariaLabel().trim() || null);\n\n protected readonly displayItems = computed<DropdownItem[]>(() =>\n this.open() ? (this._loaded() ?? this.items()) : []\n );\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this._destroyed = true;\n if (this._typeaheadTimer) clearTimeout(this._typeaheadTimer);\n if (_activeDropdownId() === this._id) _activeDropdownId.set('');\n });\n effect(() => {\n if (_activeDropdownId() !== this._id) {\n untracked(() => this.close()); // full close: also resets pending focus, typeahead and placement\n }\n });\n\n effect(() => {\n const isOpen = this.open();\n const loader = this.loader();\n if (!loader) return;\n if (isOpen && untracked(() => this._loaded()) === null) {\n const token = ++this._loadToken;\n this.loading.set(true);\n // A loader that throws or rejects shows an empty menu (never an endless \"Loading...\").\n const done = (items: DropdownItem[]) => {\n if (this._destroyed || token !== this._loadToken) return; // closed / reopened meanwhile: stale answer\n this._loaded.set(items);\n this.loading.set(false);\n if (this.open()) {\n afterNextRender(() => this._place(), { injector: this._injector }); // the real item list is taller than the \"Loading...\" row\n if (this._pendingFocus) this._focusPending();\n }\n };\n new Promise<DropdownItem[]>(resolve => resolve(loader())).then(done, () => done([]));\n } else if (!isOpen) {\n this._loadToken++;\n this.loading.set(false);\n this._loaded.set(null);\n }\n });\n }\n\n toggle(event: Event) {\n event.stopPropagation();\n this._setOpen(!this.open());\n // Safari / Firefox on macOS do not focus a button on click: focus the trigger so Escape and the arrow keys reach the dropdown.\n this._focusTrigger();\n }\n\n select(item: DropdownItem) {\n if (item.disabled) return;\n this._setOpen(false);\n this.itemClick.emit(item);\n this._focusTrigger();\n }\n\n close() {\n if (this.open()) this._setOpen(false);\n }\n\n /**\n * Keyboard contract (WAI-ARIA menu button).\n * Trigger: Enter / Space toggle (opening focuses the first item), ArrowDown opens + first item,\n * ArrowUp opens + last item, ArrowDown/ArrowUp while open move into the menu, Tab closes (focus moves on naturally).\n */\n protected onTriggerKeydown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey || event.altKey) return;\n switch (event.key) {\n case 'Enter':\n case ' ':\n event.preventDefault(); // no native click: we open + focus ourselves\n if (this.open()) this._setOpen(false);\n else this._openAndFocus('first');\n break;\n case 'ArrowDown':\n event.preventDefault();\n if (this.open()) { this._pendingFocus = 'first'; this._focusPending(); }\n else this._openAndFocus('first');\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.open()) { this._pendingFocus = 'last'; this._focusPending(); }\n else this._openAndFocus('last');\n break;\n case 'Tab':\n this.close();\n break;\n }\n }\n\n /** Firefox fires the button click on Space keyup even when keydown was prevented. */\n protected onTriggerKeyup(event: KeyboardEvent) {\n if (event.key === ' ') event.preventDefault();\n }\n\n /**\n * Menu keys (focus on an item): ArrowDown / ArrowUp move with wrap, Home / End jump to first / last,\n * Enter / Space activate the focused item (native button click), Tab / Shift+Tab close and let focus move on from the trigger,\n * printable characters jump to the next item whose label starts with the typed text (typeahead, reset after 500 ms).\n * Disabled items are skipped. Other keys are ignored. Escape is handled on the host.\n */\n protected onMenuKeydown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey || event.altKey) return;\n const items = this._enabledItems();\n const current = items.indexOf(document.activeElement as HTMLElement);\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (items.length) items[current < 0 ? 0 : (current + 1) % items.length].focus();\n return;\n case 'ArrowUp':\n event.preventDefault();\n if (items.length) items[current <= 0 ? items.length - 1 : current - 1].focus();\n return;\n case 'Home':\n event.preventDefault();\n items[0]?.focus();\n return;\n case 'End':\n event.preventDefault();\n items[items.length - 1]?.focus();\n return;\n case 'Tab':\n // Park focus on the trigger first: the menu is removed from the DOM, so the browser's Tab\n // then continues from the trigger (next / previous control) instead of from <body>.\n this._focusTrigger();\n this.close();\n return;\n }\n if (event.key.length === 1 && (event.key !== ' ' || this._typeahead)) {\n event.preventDefault();\n this._typeaheadFocus(event.key.toLowerCase(), items, current);\n }\n }\n\n protected onEscape(event: Event) {\n if (!this.open()) return; // closed: let a surrounding panel / modal handle Escape\n event.stopPropagation();\n this._setOpen(false);\n this._focusTrigger();\n }\n\n private _setOpen(next: boolean) {\n if (this.open() === next) return;\n this.open.set(next);\n if (next) {\n _activeDropdownId.set(this._id);\n afterNextRender(() => this._place(), { injector: this._injector });\n }\n else {\n this._pendingFocus = null;\n this._typeahead = '';\n if (_activeDropdownId() === this._id) _activeDropdownId.set('');\n this.alignEnd.set(false); this.openUp.set(false); this.menuMaxHeight.set(null);\n }\n }\n\n /**\n * Places the open menu from its measured size and the trigger's screen position: it keeps 16px clear of the screen edges, lines up with the trigger's\n * right edge instead of the left when that is the side with room (`align` = auto), opens above the trigger when there is more room there, and is capped to\n * the room left on that side (so it scrolls inside only when it truly does not fit). No layout APIs (server rendering) = the default placement.\n */\n private _place() {\n const host = this._host.nativeElement;\n const trigger = host.querySelector('.dd-trigger') as HTMLElement | null;\n const menu = host.querySelector('.dd-menu') as HTMLElement | null;\n if (!trigger || !menu || typeof window === 'undefined') return;\n const MARGIN = 16, GAP = 6;\n // Measure in the default placement\n this.alignEnd.set(false); this.openUp.set(false); this.menuMaxHeight.set(null);\n this._cdr.detectChanges();\n const t = trigger.getBoundingClientRect();\n const vw = document.documentElement.clientWidth || window.innerWidth;\n const vh = window.innerHeight;\n const width = menu.offsetWidth;\n const naturalHeight = menu.scrollHeight + 2;\n const mode = this.align();\n const fitsStart = t.left + width <= vw - MARGIN;\n const fitsEnd = t.right - width >= MARGIN;\n const end = mode === 'end' || (mode === 'auto' && !fitsStart && (fitsEnd || t.right > vw / 2));\n const below = vh - t.bottom - GAP - MARGIN;\n const above = t.top - GAP - MARGIN;\n const up = naturalHeight > below && above > below;\n this.alignEnd.set(end);\n this.openUp.set(up);\n this.menuMaxHeight.set(Math.max(160, Math.floor(up ? above : below)));\n this._cdr.markForCheck();\n }\n\n private _openAndFocus(which: 'first' | 'last') {\n this._pendingFocus = which;\n this._setOpen(true);\n this._focusPending();\n }\n\n /** Renders the menu synchronously, then focuses the pending first / last enabled item. */\n private _focusPending() {\n this._cdr.detectChanges();\n // a loader is pending (or about to start: its effect has not run yet): the focus is applied when it resolves\n if (this.loading() || (this.loader() !== null && this._loaded() === null)) return;\n const items = this._enabledItems();\n const target = this._pendingFocus === 'last' ? items[items.length - 1] : items[0];\n this._pendingFocus = null;\n target?.focus();\n }\n\n private _typeaheadFocus(char: string, items: HTMLElement[], current: number) {\n this._typeahead += char;\n if (this._typeaheadTimer) clearTimeout(this._typeaheadTimer);\n this._typeaheadTimer = setTimeout(() => { this._typeahead = ''; this._typeaheadTimer = null; }, 500);\n const single = this._typeahead.length === 1 || [...this._typeahead].every(c => c === this._typeahead[0]);\n const needle = single ? this._typeahead[0] : this._typeahead;\n const start = single ? current + 1 : Math.max(current, 0);\n for (let i = 0; i < items.length; i++) {\n const el = items[(start + i) % items.length];\n const text = (el.querySelector('span')?.textContent ?? '').trim().toLowerCase();\n if (text.startsWith(needle)) { el.focus(); return; }\n }\n }\n\n private _enabledItems(): HTMLElement[] {\n return Array.from(this._host.nativeElement.querySelectorAll<HTMLElement>('.dd-menu .dd-item:not(:dis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AA,WAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,OAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,WAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,OAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA,EAAA,WAAA,YAAA;GAAA,MAAA;IAAA,WAAA;KAAA,kBAAA;KAAA,kBAAA;IAAA;IAAA,YAAA;KAAA,kBAAA;KAAA,eAAA;IAAA;GAAA;GAAA,UAAA;GAAA,UAhJlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CT,UAAA;GAAA,QAAA,CAAA,mxGAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAqGU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EA7J7B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,YACX;GAAI,iBACC,wBAAwB;GAAM,MACzC;IACJ,oBAAoB;IAGpB,oBAAoB;IAEpB,oBAAoB;IACpB,iBAAiB;GAClB;GAAA,UACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CT,QAAA,CAAA,mxGAAA;EAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -52,6 +52,8 @@ export declare class ColorInputComponent implements ControlValueAccessor, Valida
|
|
|
52
52
|
readonly showErrors: import("@angular/core").InputSignal<boolean>;
|
|
53
53
|
/** Accept (and keep) 8-digit `#rrggbbaa` values. */
|
|
54
54
|
readonly allowAlpha: import("@angular/core").InputSignal<boolean>;
|
|
55
|
+
/** Show the hex text box next to the swatch (default). `false` = the swatch alone, stretched to a full-width colour field with a palette icon: the user only clicks it and picks. */
|
|
56
|
+
readonly showText: import("@angular/core").InputSignal<boolean>;
|
|
55
57
|
/** Optional row of preset swatches. */
|
|
56
58
|
readonly presets: import("@angular/core").InputSignal<ColorPreset[]>;
|
|
57
59
|
/** Emits whenever the field becomes invalid / valid. */
|
|
@@ -144,6 +146,11 @@ export declare class ColorInputComponent implements ControlValueAccessor, Valida
|
|
|
144
146
|
"required": false;
|
|
145
147
|
"isSignal": true;
|
|
146
148
|
};
|
|
149
|
+
"showText": {
|
|
150
|
+
"alias": "showText";
|
|
151
|
+
"required": false;
|
|
152
|
+
"isSignal": true;
|
|
153
|
+
};
|
|
147
154
|
"presets": {
|
|
148
155
|
"alias": "presets";
|
|
149
156
|
"required": false;
|
|
@@ -2746,7 +2746,7 @@ export declare class ButtonComponent {
|
|
|
2746
2746
|
* `ghost-start`: a ghost button for list / section toggles - a full-width row with its content aligned to the start, transparent
|
|
2747
2747
|
* background, hover tint and the normal focus ring. Pair it with `ariaExpanded` / `ariaPressed`; the label may contain a heading element.
|
|
2748
2748
|
*/
|
|
2749
|
-
readonly variant: import("@angular/core").InputSignal<"
|
|
2749
|
+
readonly variant: import("@angular/core").InputSignal<"warning" | "primary" | "secondary" | "danger" | "link" | "ghost" | "ghost-start" | "tab" | "icon" | "icon-danger">;
|
|
2750
2750
|
/** Renders an anchor to this route instead of a button (use with `variant="link"` for an inline text link). `['/settings']` or `'/settings'`. While `disabled` or `loading` it renders a non-clickable `<span role="link" aria-disabled>` with no href (like `href`). */
|
|
2751
2751
|
readonly routerLink: import("@angular/core").InputSignal<string | readonly unknown[] | null>;
|
|
2752
2752
|
/** Query params of the `routerLink` (e.g. `{ section: 'deal-defaults' }`). */
|
|
@@ -2792,7 +2792,7 @@ export declare class ButtonComponent {
|
|
|
2792
2792
|
readonly color: import("@angular/core").InputSignal<string | undefined>;
|
|
2793
2793
|
readonly active: import("@angular/core").InputSignal<boolean>;
|
|
2794
2794
|
readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | "xs">;
|
|
2795
|
-
readonly type: import("@angular/core").InputSignal<"
|
|
2795
|
+
readonly type: import("@angular/core").InputSignal<"button" | "submit" | "reset">;
|
|
2796
2796
|
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
2797
2797
|
readonly loading: import("@angular/core").InputSignal<boolean>;
|
|
2798
2798
|
readonly fullWidth: import("@angular/core").InputSignal<boolean>;
|
|
@@ -2941,7 +2941,7 @@ export declare class ModalComponent implements OnInit, OnDestroy {
|
|
|
2941
2941
|
*/
|
|
2942
2942
|
readonly describedBy: import("@angular/core").InputSignal<string | null>;
|
|
2943
2943
|
readonly maxWidth: import("@angular/core").InputSignal<string>;
|
|
2944
|
-
readonly bodyOverflow: import("@angular/core").InputSignal<"auto" | "
|
|
2944
|
+
readonly bodyOverflow: import("@angular/core").InputSignal<"auto" | "hidden" | "visible">;
|
|
2945
2945
|
/** `data-testid` of the dialog element itself (the host `<ui-modal>` is always in the page, the dialog only while open). None when empty. */
|
|
2946
2946
|
readonly dialogTestId: import("@angular/core").InputSignal<string>;
|
|
2947
2947
|
/** Hides the header X button (e.g. while a request is running). Escape and a backdrop click still close unless `closable` is false. */
|
|
@@ -3092,7 +3092,7 @@ export declare class SidePanelComponent implements OnDestroy {
|
|
|
3092
3092
|
readonly cancelLabel: import("@angular/core").Signal<string>;
|
|
3093
3093
|
/** Right-aligned primary action button label. Empty string = hidden. */
|
|
3094
3094
|
readonly primaryLabel: import("@angular/core").InputSignal<string>;
|
|
3095
|
-
readonly primaryVariant: import("@angular/core").InputSignal<"
|
|
3095
|
+
readonly primaryVariant: import("@angular/core").InputSignal<"warning" | "primary" | "danger">;
|
|
3096
3096
|
readonly primaryLoading: import("@angular/core").InputSignal<boolean>;
|
|
3097
3097
|
readonly primaryDisabled: import("@angular/core").InputSignal<boolean>;
|
|
3098
3098
|
/** `data-testid` of the Cancel button; none when empty (default). */
|
|
@@ -6,6 +6,8 @@ export interface DropdownItem {
|
|
|
6
6
|
count?: number;
|
|
7
7
|
/** Greyed-out, not selectable and skipped by keyboard navigation. */
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
/** Destructive choice (e.g. Delete): the label and icon are drawn in red. */
|
|
10
|
+
danger?: boolean;
|
|
9
11
|
/** Optional 14px icon before the label: an SVG path (the `d` value, like a toolbar action's `icon`). Decorative (hidden from assistive tech). */
|
|
10
12
|
icon?: string;
|
|
11
13
|
/** Optional smaller, muted second line under the label (e.g. what the choice does). Read by assistive technology as the item's description, not as part of its name. Plain text. */
|
|
@@ -122,7 +122,7 @@ export declare class TemplatePickerComponent {
|
|
|
122
122
|
private readonly host;
|
|
123
123
|
private readonly search$;
|
|
124
124
|
/** Filter results to a specific channel: 'email', 'text', or omit for all. */
|
|
125
|
-
readonly channel: import("@angular/core").InputSignal<"" | "
|
|
125
|
+
readonly channel: import("@angular/core").InputSignal<"" | "text" | "email">;
|
|
126
126
|
readonly selectedId: import("@angular/core").InputSignal<string | null>;
|
|
127
127
|
readonly labelInput: import("@angular/core").InputSignal<string | null>;
|
|
128
128
|
readonly label: import("@angular/core").Signal<string>;
|
|
@@ -553,7 +553,7 @@ export declare class DocumentSendOptionsComponent implements UiFieldValidity {
|
|
|
553
553
|
/** API root from FORGEROUTE_CONFIG (e.g. a cross-origin prod API); falls back to same-origin `/api`. */
|
|
554
554
|
private readonly apiBase;
|
|
555
555
|
/** `email` → purpose select + attachment allowed; `text` → link only (purpose fixed to e-signature). */
|
|
556
|
-
readonly channel: import("@angular/core").InputSignal<"
|
|
556
|
+
readonly channel: import("@angular/core").InputSignal<"text" | "email">;
|
|
557
557
|
readonly labelInput: import("@angular/core").InputSignal<string | null>;
|
|
558
558
|
readonly label: import("@angular/core").Signal<string>;
|
|
559
559
|
/** When true, at least one document must be chosen. The message forms leave it false: documents are optional there. */
|
|
@@ -629,7 +629,7 @@ export declare class DocumentSendOptionsComponent implements UiFieldValidity {
|
|
|
629
629
|
/** Roles of documents whose row had no `signerRoles` and that the host resolves (`signers().resolveRoles`). */
|
|
630
630
|
readonly roleStates: import("@angular/core").WritableSignal<Record<string, RoleState>>;
|
|
631
631
|
/** The envelope's documents: `loading` / `error` while the panel reads them (`loadDocuments`), `ready` once known. */
|
|
632
|
-
readonly envelopeStatus: import("@angular/core").WritableSignal<"
|
|
632
|
+
readonly envelopeStatus: import("@angular/core").WritableSignal<"error" | "loading" | "ready" | "idle">;
|
|
633
633
|
private envelopeSub;
|
|
634
634
|
private readonly roleSubs;
|
|
635
635
|
/** The sender opened the collapsed "Signing options" line. */
|
|
@@ -2020,7 +2020,7 @@ export declare class SendMessagePanelComponent {
|
|
|
2020
2020
|
* somebody can receive that channel; otherwise the usual default applies (email if anybody has an email, else text). null (default) = the usual default.
|
|
2021
2021
|
* `textEnabled` must already be known when the panel opens for `'text'` to take effect (bind `[recipients]` after async settings loaded, or re-open).
|
|
2022
2022
|
*/
|
|
2023
|
-
readonly initialChannel: import("@angular/core").InputSignal<"
|
|
2023
|
+
readonly initialChannel: import("@angular/core").InputSignal<"text" | "email" | null>;
|
|
2024
2024
|
/** Bulk mode: the plural noun in "To: 12 residents" (default `recipients`, localized). */
|
|
2025
2025
|
readonly recipientNoun: import("@angular/core").InputSignal<string>;
|
|
2026
2026
|
/** Bulk mode: the singular noun used when exactly one is selected; empty = the plural without a trailing "s". */
|
|
@@ -2256,7 +2256,7 @@ export declare class SendMessagePanelComponent {
|
|
|
2256
2256
|
readonly activeContact: import("@angular/core").WritableSignal<MessageContact | null>;
|
|
2257
2257
|
/** What the sender should know about the picked contact before sending (why a channel is missing, what to add). */
|
|
2258
2258
|
readonly contactNotices: import("@angular/core").Signal<string[]>;
|
|
2259
|
-
readonly channel: import("@angular/core").WritableSignal<"
|
|
2259
|
+
readonly channel: import("@angular/core").WritableSignal<"text" | "email">;
|
|
2260
2260
|
readonly valid: import("@angular/core").WritableSignal<boolean>;
|
|
2261
2261
|
/** A send is in flight in the active form: the Send button spins and stays disabled. */
|
|
2262
2262
|
readonly busy: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -751,7 +751,7 @@ export declare class PaymentSidePanelComponent {
|
|
|
751
751
|
private readonly terminalAvailable;
|
|
752
752
|
/** value -> label of every live method the rendered plugins contribute (the first plugin wins a duplicate value). */
|
|
753
753
|
private readonly liveMethods;
|
|
754
|
-
protected readonly kind: import("@angular/core").Signal<"terminal" | "
|
|
754
|
+
protected readonly kind: import("@angular/core").Signal<"terminal" | "manual" | "none" | "live">;
|
|
755
755
|
private kindOf;
|
|
756
756
|
/** The method list as shown: record-only built-ins (a plugin takes over its own values), plugin extras, and only manual ones while a split is being built. */
|
|
757
757
|
readonly methodList: import("@angular/core").Signal<PaymentMethodOption[]>;
|
|
@@ -355,7 +355,7 @@ export declare class QboPaymentComponent {
|
|
|
355
355
|
protected readonly postalFormatter: import("@angular/core").Signal<(raw: string) => string>;
|
|
356
356
|
protected readonly postalPlaceholder: import("@angular/core").Signal<"A1A 1A1" | "94086">;
|
|
357
357
|
protected readonly postalInputMode: import("@angular/core").Signal<"text" | "numeric">;
|
|
358
|
-
protected readonly postalMaxLength: import("@angular/core").Signal<
|
|
358
|
+
protected readonly postalMaxLength: import("@angular/core").Signal<10 | 7>;
|
|
359
359
|
protected readonly routingFormatter: (raw: string) => string;
|
|
360
360
|
protected readonly accountFormatter: (raw: string) => string;
|
|
361
361
|
protected readonly tabs: import("@angular/core").Signal<PillTab[]>;
|
|
@@ -792,7 +792,7 @@ export declare class QboConnectComponent {
|
|
|
792
792
|
readonly loading: import("@angular/core").ModelSignal<boolean>;
|
|
793
793
|
protected readonly awaiting: import("@angular/core").WritableSignal<boolean>;
|
|
794
794
|
protected readonly confirming: import("@angular/core").WritableSignal<boolean>;
|
|
795
|
-
protected readonly state: import("@angular/core").Signal<"
|
|
795
|
+
protected readonly state: import("@angular/core").Signal<"connected" | "none" | "reconnect">;
|
|
796
796
|
protected readonly company: import("@angular/core").Signal<string>;
|
|
797
797
|
protected readonly connectedOn: import("@angular/core").Signal<string>;
|
|
798
798
|
/** What the persistent status region says: the current state, plus "Loading." while a request runs. */
|
|
@@ -1541,7 +1541,7 @@ export declare class SquareTerminalBannerComponent {
|
|
|
1541
1541
|
private readWhenShown;
|
|
1542
1542
|
/** The answer on screen: only a CONFIRMED, latest answer in which the organization has no usable reader. */
|
|
1543
1543
|
protected readonly shown: import("@angular/core").Signal<SquareTerminalReadiness | null>;
|
|
1544
|
-
readonly shownState: import("@angular/core").Signal<import("@forgeroute/ui/square").SquareTerminalReadinessState
|
|
1544
|
+
readonly shownState: import("@angular/core").Signal<"none" | import("@forgeroute/ui/square").SquareTerminalReadinessState>;
|
|
1545
1545
|
/** A Terminal exists but is not connected (`reader_offline`, `reader_pairing`). */
|
|
1546
1546
|
protected readonly notConnected: import("@angular/core").Signal<boolean>;
|
|
1547
1547
|
/** The label key of a reason with its own no-button wording (`sandbox`, `service_disabled`, `processor_unsupported`), else null. Never for a not-connected Terminal (its message is about the Terminal). */
|
|
@@ -2390,7 +2390,7 @@ export declare class SquareTerminalPaymentComponent {
|
|
|
2390
2390
|
* The ONE message block of the idle screen, by precedence: already paid > an earlier payment still being confirmed > a cancel that timed out > the total changed > a refusal of the last start. The readiness banner and
|
|
2391
2391
|
* the "blocked" notice show only when none of these does (and never in the canceled / failed boxes).
|
|
2392
2392
|
*/
|
|
2393
|
-
protected readonly idleNotice: import("@angular/core").Signal<"paid" | "pending-other" | "cancel-timeout" | "quote-changed" |
|
|
2393
|
+
protected readonly idleNotice: import("@angular/core").Signal<"paid" | "refusal" | "pending-other" | "cancel-timeout" | "quote-changed" | null>;
|
|
2394
2394
|
protected readonly showBlocked: import("@angular/core").Signal<boolean>;
|
|
2395
2395
|
/**
|
|
2396
2396
|
* Library source 2026-11-21: this screen is showing a card reader message of its own right now (the readiness banner, a connection notice, one of the idle notices, or a payment box), so a second reader banner elsewhere
|
|
@@ -1760,7 +1760,7 @@ export declare class StripeConnectComponent {
|
|
|
1760
1760
|
readonly navigateTab: import("@angular/core").InputSignal<((url: string) => void) | null>;
|
|
1761
1761
|
protected readonly visible: import("@angular/core").Signal<boolean>;
|
|
1762
1762
|
/** Which screen the card shows. */
|
|
1763
|
-
protected readonly state: import("@angular/core").Signal<"
|
|
1763
|
+
protected readonly state: import("@angular/core").Signal<"complete" | "verifying" | "incomplete" | "none">;
|
|
1764
1764
|
/** What the persistent status region says: the current state, plus "Loading." while a request runs. Empty while nothing is shown. */
|
|
1765
1765
|
protected readonly liveText: import("@angular/core").Signal<string>;
|
|
1766
1766
|
/** The user pressed a button that started a request: when the screen then changes, focus moves to the new screen (the pressed button is gone). */
|
|
@@ -2326,7 +2326,7 @@ export declare class StripeReaderBannerComponent {
|
|
|
2326
2326
|
private readWhenShown;
|
|
2327
2327
|
/** The answer on screen: only a CONFIRMED, latest answer in which the organization has no usable reader. */
|
|
2328
2328
|
protected readonly shown: import("@angular/core").Signal<StripeReaderReadiness | null>;
|
|
2329
|
-
readonly shownState: import("@angular/core").Signal<import("@forgeroute/ui/stripe").StripeReaderReadinessState
|
|
2329
|
+
readonly shownState: import("@angular/core").Signal<"none" | import("@forgeroute/ui/stripe").StripeReaderReadinessState>;
|
|
2330
2330
|
/** A reader exists but is not connected (`reader_offline`). */
|
|
2331
2331
|
protected readonly notConnected: import("@angular/core").Signal<boolean>;
|
|
2332
2332
|
/** The label key of a reason with its own no-button wording (`sandbox`, `service_disabled`, `processor_unsupported`), else null. Never for a not-connected reader (its message is about the reader). */
|
|
@@ -3209,7 +3209,7 @@ export declare class StripeReaderPaymentComponent {
|
|
|
3209
3209
|
* The ONE message block of the idle screen, by precedence: already paid > an earlier payment still being confirmed > a cancel that timed out > the total changed > a refusal of the last start. The readiness banner and
|
|
3210
3210
|
* the "blocked" notice show only when none of these does (and never in the canceled / failed boxes).
|
|
3211
3211
|
*/
|
|
3212
|
-
protected readonly idleNotice: import("@angular/core").Signal<"paid" | "pending-other" | "cancel-timeout" | "quote-changed" |
|
|
3212
|
+
protected readonly idleNotice: import("@angular/core").Signal<"paid" | "refusal" | "pending-other" | "cancel-timeout" | "quote-changed" | null>;
|
|
3213
3213
|
protected readonly showBlocked: import("@angular/core").Signal<boolean>;
|
|
3214
3214
|
/**
|
|
3215
3215
|
* Library source 2026-11-21: this screen is showing a card reader message of its own right now (the readiness banner, a connection notice, one of the idle notices, or a payment box), so a second reader banner elsewhere
|