@atelier-ui/angular 0.3.7 → 0.3.9
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.
|
@@ -304,10 +304,16 @@ const ATL_ICON_GEOMETRY = {
|
|
|
304
304
|
* ```
|
|
305
305
|
*/
|
|
306
306
|
class AtlIcon {
|
|
307
|
+
/** The icon to render. Required. */
|
|
307
308
|
name = input.required(/* @ts-ignore */
|
|
308
309
|
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
310
|
+
/** Icon size: `sm` 16px, `md` 20px, `lg` 24px. The same 24-unit geometry is scaled. */
|
|
309
311
|
size = input('md', /* @ts-ignore */
|
|
310
312
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
313
|
+
/**
|
|
314
|
+
* Accessible label. When provided, the icon is announced as an image with
|
|
315
|
+
* this label. When omitted, the icon is hidden from assistive tech.
|
|
316
|
+
*/
|
|
311
317
|
label = input(/* @ts-ignore */
|
|
312
318
|
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
313
319
|
viewBox = ATL_ICON_VIEWBOX;
|
|
@@ -414,6 +420,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
414
420
|
}, styles: [".atl-badge,.atl-badge *{box-sizing:border-box}.atl-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--ui-radius-full);font-family:var(--ui-font-family);font-weight:var(--ui-font-weight-semibold);line-height:var(--ui-line-height-tight);white-space:nowrap;letter-spacing:var(--ui-letter-spacing-wide)}.atl-badge.size-sm{padding:.1875rem var(--ui-spacing-2);font-size:var(--ui-font-size-xs)}.atl-badge.size-md{padding:.3125rem var(--ui-spacing-3);font-size:var(--ui-font-size-sm)}.atl-badge.variant-default{background-color:var(--ui-color-surface-sunken);color:var(--ui-color-text-muted);border:var(--ui-border-width) solid var(--ui-color-border)}.atl-badge.variant-success{background-color:var(--ui-color-success-bg);color:var(--ui-color-success-text);border:var(--ui-border-width) solid color-mix(in srgb,var(--ui-color-success-text) 25%,transparent)}.atl-badge.variant-warning{background-color:var(--ui-color-warning-bg);color:var(--ui-color-warning-text);border:var(--ui-border-width) solid color-mix(in srgb,var(--ui-color-warning-text) 25%,transparent)}.atl-badge.variant-danger{background-color:var(--ui-color-danger-bg);color:var(--ui-color-danger-text);border:var(--ui-border-width) solid color-mix(in srgb,var(--ui-color-danger-text) 25%,transparent)}.atl-badge.variant-info{background-color:var(--ui-color-info-bg);color:var(--ui-color-info-text);border:var(--ui-border-width) solid color-mix(in srgb,var(--ui-color-info-text) 25%,transparent)}.atl-badge>.variant-icon{font-weight:var(--ui-font-weight-bold);margin-right:.3em;line-height:1}\n"] }]
|
|
415
421
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
416
422
|
|
|
423
|
+
/** True in dev builds only; the dev-mode a11y warnings are tree-shaken from production. */
|
|
424
|
+
function isNgDevMode() {
|
|
425
|
+
return typeof ngDevMode !== 'undefined' && !!ngDevMode;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Dev-mode check for a form control that renders a native labelable element.
|
|
429
|
+
* Angular's `<ng-content>` / signal inputs mean the missing name can't be
|
|
430
|
+
* rejected at the type level, so — like AtlButton — it is checked once after
|
|
431
|
+
* first render, when every input (including bound ones) has settled.
|
|
432
|
+
* Must be called from an injection context (a constructor).
|
|
433
|
+
*/
|
|
434
|
+
function warnIfUnnamedControl(host, component, controlSelector, fix) {
|
|
435
|
+
if (!isNgDevMode())
|
|
436
|
+
return;
|
|
437
|
+
afterNextRender(() => {
|
|
438
|
+
const control = host.querySelector(controlSelector);
|
|
439
|
+
if (!control)
|
|
440
|
+
return;
|
|
441
|
+
const named = (control.getAttribute('aria-label') ?? '').trim().length > 0 ||
|
|
442
|
+
control.hasAttribute('aria-labelledby') ||
|
|
443
|
+
(control.labels?.length ?? 0) > 0;
|
|
444
|
+
if (!named) {
|
|
445
|
+
console.warn(`[${component}] no accessible name — ${fix} so screen readers announce its purpose.`, host);
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
|
|
417
450
|
let nextId$d = 0;
|
|
418
451
|
/**
|
|
419
452
|
* Accessible text input component for use with Angular Signal Forms.
|
|
@@ -531,6 +564,10 @@ class AtlInput {
|
|
|
531
564
|
return classes.join(' ');
|
|
532
565
|
}, /* @ts-ignore */
|
|
533
566
|
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
567
|
+
host = inject(ElementRef);
|
|
568
|
+
constructor() {
|
|
569
|
+
warnIfUnnamedControl(this.host.nativeElement, 'AtlInput', 'input', 'set [label] or [aria-label], or associate a <label for> with the input id');
|
|
570
|
+
}
|
|
534
571
|
/** @internal */
|
|
535
572
|
onInput(event) {
|
|
536
573
|
const target = event.target;
|
|
@@ -623,7 +660,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
623
660
|
// input — the thing that actually needs the accessible name — has none.
|
|
624
661
|
'[attr.aria-label]': 'null',
|
|
625
662
|
}, styles: [".atl-input,.atl-input *{box-sizing:border-box}.atl-input{display:block;font-family:var(--ui-font-family);line-height:var(--ui-line-height-tight);font-size:var(--ui-font-size-md)}.atl-input input{display:block;width:100%;min-height:var(--ui-control-height-md);padding:calc((var(--ui-control-height-md) - var(--ui-line-height-tight) * var(--ui-font-size-md)) / 2 - var(--ui-border-width)) var(--ui-spacing-4);font-size:inherit;font-family:inherit;line-height:var(--ui-line-height-tight);color:var(--ui-color-text);background-color:var(--ui-color-input-bg);border:var(--ui-border-width) solid var(--ui-color-input-border);border-radius:var(--ui-radius-md);transition:border-color var(--ui-transition-fast),box-shadow var(--ui-transition-fast),background-color var(--ui-transition-fast);outline:none;box-sizing:border-box}.atl-input input::placeholder{color:var(--ui-color-placeholder)}.atl-input input:hover:not(:disabled):not(:read-only){border-color:var(--ui-color-input-border-hover)}.atl-input input:focus{border-color:var(--ui-color-input-border-focus);background-color:var(--ui-color-input-bg-focus);box-shadow:var(--ui-focus-ring)}.atl-input>.input-field{position:relative}.atl-input.is-invalid input{border-color:var(--ui-color-input-border-invalid);padding-right:2.25rem}.atl-input.is-invalid input:focus{border-color:var(--ui-color-input-border-invalid);box-shadow:var(--ui-focus-ring-danger)}.atl-input.is-invalid>.input-field>.invalid-icon{position:absolute;top:50%;transform:translateY(-50%);right:.875rem;color:var(--ui-color-danger);pointer-events:none}.atl-input.is-disabled{opacity:var(--ui-opacity-disabled);cursor:not-allowed}.atl-input.is-disabled input{cursor:not-allowed}.atl-input.is-readonly input{background-color:var(--ui-color-surface-sunken);border-color:transparent;cursor:default}.atl-input>.errors{margin-top:var(--ui-spacing-2)}.atl-input>.errors>.error-message{margin:0;font-size:var(--ui-font-size-sm);color:var(--ui-color-error-text);line-height:var(--ui-line-height-normal)}\n"] }]
|
|
626
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
|
|
663
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
|
|
627
664
|
|
|
628
665
|
let nextId$c = 0;
|
|
629
666
|
/**
|
|
@@ -732,6 +769,10 @@ class AtlTextarea {
|
|
|
732
769
|
return classes.join(' ');
|
|
733
770
|
}, /* @ts-ignore */
|
|
734
771
|
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
772
|
+
host = inject(ElementRef);
|
|
773
|
+
constructor() {
|
|
774
|
+
warnIfUnnamedControl(this.host.nativeElement, 'AtlTextarea', 'textarea', 'set [label] or [aria-label], or associate a <label for> with the textarea id');
|
|
775
|
+
}
|
|
735
776
|
/** @internal */
|
|
736
777
|
onInput(event) {
|
|
737
778
|
const target = event.target;
|
|
@@ -821,7 +862,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
821
862
|
// Same reasoning, same fix, for `aria-label` — see atl-input.ts.
|
|
822
863
|
'[attr.aria-label]': 'null',
|
|
823
864
|
}, styles: [".atl-textarea,.atl-textarea *{box-sizing:border-box}.atl-textarea{display:block;font:var(--ui-type-body-md)}.atl-textarea textarea{display:block;width:100%;padding:.625rem var(--ui-spacing-4);font-size:inherit;font-family:inherit;line-height:var(--ui-line-height-normal);color:var(--ui-color-text);background-color:var(--ui-color-input-bg);border:var(--ui-border-width) solid var(--ui-color-input-border);border-radius:var(--ui-radius-md);transition:border-color var(--ui-transition-fast),box-shadow var(--ui-transition-fast),background-color var(--ui-transition-fast);outline:none;box-sizing:border-box;resize:vertical;min-height:5rem}.atl-textarea textarea::placeholder{color:var(--ui-color-placeholder)}.atl-textarea textarea:hover:not(:disabled):not(:read-only){border-color:var(--ui-color-input-border-hover)}.atl-textarea textarea:focus{border-color:var(--ui-color-input-border-focus);background-color:var(--ui-color-input-bg-focus);box-shadow:var(--ui-focus-ring)}.atl-textarea>.textarea-field{position:relative}.atl-textarea.is-invalid textarea{border-color:var(--ui-color-input-border-invalid);padding-right:2.25rem}.atl-textarea.is-invalid textarea:focus{border-color:var(--ui-color-input-border-invalid);box-shadow:var(--ui-focus-ring-danger)}.atl-textarea.is-invalid>.textarea-field>.invalid-icon{position:absolute;top:50%;transform:translateY(-50%);right:.875rem;color:var(--ui-color-danger);pointer-events:none}.atl-textarea.is-disabled{opacity:var(--ui-opacity-disabled);cursor:not-allowed}.atl-textarea.is-disabled textarea{cursor:not-allowed}.atl-textarea.is-readonly textarea{background-color:var(--ui-color-surface-sunken);border-color:transparent;cursor:default}.atl-textarea.is-auto-resize textarea{resize:none;overflow:hidden}.atl-textarea>.errors{margin-top:var(--ui-spacing-2)}.atl-textarea>.errors>.error-message{margin:0;font-size:var(--ui-font-size-sm);color:var(--ui-color-error-text);line-height:var(--ui-line-height-normal)}\n"] }]
|
|
824
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }] } });
|
|
865
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }] } });
|
|
825
866
|
|
|
826
867
|
let nextId$b = 0;
|
|
827
868
|
/**
|
|
@@ -1601,6 +1642,9 @@ class AtlSelect {
|
|
|
1601
1642
|
outsideClickHandler = null;
|
|
1602
1643
|
elementRef = inject(ElementRef);
|
|
1603
1644
|
injector = inject(Injector);
|
|
1645
|
+
constructor() {
|
|
1646
|
+
warnIfUnnamedControl(this.elementRef.nativeElement, 'AtlSelect', 'button.trigger', 'set [label] or [aria-label], or wrap it in a <label>');
|
|
1647
|
+
}
|
|
1604
1648
|
/** @internal — called by AtlOption on init */
|
|
1605
1649
|
registerOption(id, value, labelText, disabled) {
|
|
1606
1650
|
this.optionsList.update((list) => [
|
|
@@ -1898,7 +1942,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
1898
1942
|
// name lands.
|
|
1899
1943
|
'[attr.aria-label]': 'null',
|
|
1900
1944
|
}, providers: [{ provide: ATL_SELECT, useExisting: AtlSelect }], styles: [".atl-select,.atl-select *{box-sizing:border-box}.atl-select{display:inline-block;position:relative;font-family:var(--ui-font-family);line-height:var(--ui-line-height-tight);font-size:var(--ui-font-size-md)}.atl-select>label{display:block;margin-bottom:var(--ui-spacing-2);font-size:var(--ui-font-size-sm);color:var(--ui-color-text);font-weight:var(--ui-font-weight-medium)}.atl-select>.errors{margin-top:var(--ui-spacing-2)}.atl-select>.errors>.error-message{margin:0;font-size:var(--ui-font-size-sm);color:var(--ui-color-error-text)}\n", ":is(.atl-option,.atl-select-panel),:is(.atl-option,.atl-select-panel) *{box-sizing:border-box}.atl-select>.trigger{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:var(--ui-control-height-md);box-sizing:border-box;line-height:var(--ui-line-height-tight);padding:calc((var(--ui-control-height-md) - var(--ui-line-height-tight) * var(--ui-font-size-md)) / 2 - var(--ui-border-width)) var(--ui-spacing-4);font-family:inherit;font-size:inherit;color:var(--ui-color-text);background-color:var(--ui-color-input-bg);border:var(--ui-border-width) solid var(--ui-color-input-border);border-radius:var(--ui-radius-md);outline:none;cursor:pointer;transition:border-color var(--ui-transition-fast),box-shadow var(--ui-transition-fast),background-color var(--ui-transition-fast)}.atl-select>.trigger:hover:not(:disabled){border-color:var(--ui-color-input-border-hover)}.atl-select>.trigger:focus-visible,.atl-select.is-open>.trigger,.atl-select.is-open>.trigger:hover:not(:disabled){border-color:var(--ui-color-input-border-focus);box-shadow:var(--ui-focus-ring)}.atl-select>.trigger:disabled{opacity:var(--ui-opacity-disabled);cursor:not-allowed}.atl-select.is-invalid>.trigger,.atl-select.is-invalid>.trigger:hover:not(:disabled){border-color:var(--ui-color-input-border-invalid)}.atl-select.is-disabled{opacity:var(--ui-opacity-disabled);cursor:not-allowed}.atl-select>.trigger>.trigger-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.atl-select>.trigger>.trigger-icon{flex-shrink:0;margin-left:var(--ui-spacing-1);color:var(--ui-color-text-muted);transition:transform var(--ui-transition-fast)}.atl-select.is-open>.trigger>.trigger-icon{transform:rotate(180deg)}.atl-select-panel{position:absolute;left:0;top:calc(100% + var(--ui-spacing-2));width:100%;max-height:16rem;overflow-y:auto;margin:0;padding:var(--ui-spacing-2) 0;background-color:var(--ui-color-surface-raised);border:var(--ui-border-width) solid var(--ui-color-border);border-radius:var(--ui-radius-md);box-shadow:var(--ui-shadow-lg);z-index:var(--ui-z-dropdown);display:none}.atl-select-panel.is-open{display:block}.atl-select>.trigger>.invalid-slot{flex-shrink:0;width:1rem;height:1rem;margin-left:var(--ui-spacing-2)}.atl-select.is-invalid>.trigger>.invalid-slot>.invalid-icon{color:var(--ui-color-danger);pointer-events:none}.atl-option{display:block;font-family:var(--ui-font-family);line-height:var(--ui-line-height-tight)}.atl-option>[role=option]{display:flex;align-items:center;justify-content:space-between;min-height:var(--ui-row-height-sm);padding-block:0;padding-inline:var(--ui-spacing-4);line-height:var(--ui-line-height-tight);cursor:pointer;color:var(--ui-color-text);font-size:var(--ui-font-size-md);transition:background-color var(--ui-transition-fast)}.atl-option>[role=option]:hover:not(.is-disabled){background-color:var(--ui-color-surface-sunken)}.atl-option>[role=option].is-active{background-color:var(--ui-color-primary-light);color:var(--ui-color-primary)}.atl-option>[role=option].is-selected{font-weight:var(--ui-font-weight-semibold)}.atl-option>[role=option].is-disabled{opacity:var(--ui-opacity-disabled);cursor:not-allowed}\n"] }]
|
|
1901
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
1945
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
1902
1946
|
|
|
1903
1947
|
let nextOptionId = 0;
|
|
1904
1948
|
/**
|
|
@@ -2429,6 +2473,8 @@ class AtlDialog {
|
|
|
2429
2473
|
...(ngDevMode ? [{ debugName: "dialogRef" }] : /* istanbul ignore next */ []));
|
|
2430
2474
|
triggerEl = signal(null, /* @ts-ignore */
|
|
2431
2475
|
...(ngDevMode ? [{ debugName: "triggerEl" }] : /* istanbul ignore next */ []));
|
|
2476
|
+
injector = inject(Injector);
|
|
2477
|
+
warnedUnnamed = false;
|
|
2432
2478
|
panelClass = computed(() => `panel size-${this.size()}`, /* @ts-ignore */
|
|
2433
2479
|
...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
|
|
2434
2480
|
hostClasses = computed(() => this.open() ? 'is-open' : '', /* @ts-ignore */
|
|
@@ -2441,6 +2487,7 @@ class AtlDialog {
|
|
|
2441
2487
|
if (this.open()) {
|
|
2442
2488
|
this.triggerEl.set(document.activeElement);
|
|
2443
2489
|
dialog.showModal();
|
|
2490
|
+
this.warnIfUnnamed(dialog);
|
|
2444
2491
|
}
|
|
2445
2492
|
else {
|
|
2446
2493
|
if (dialog.open)
|
|
@@ -2450,6 +2497,25 @@ class AtlDialog {
|
|
|
2450
2497
|
}
|
|
2451
2498
|
});
|
|
2452
2499
|
}
|
|
2500
|
+
/**
|
|
2501
|
+
* Dev-mode warning, once per instance, when the dialog opens with nothing
|
|
2502
|
+
* naming it. Checked after render so a header projected later (or an
|
|
2503
|
+
* `aria-label` bound dynamically) has settled by then.
|
|
2504
|
+
*/
|
|
2505
|
+
warnIfUnnamed(dialog) {
|
|
2506
|
+
if (!isNgDevMode() || this.warnedUnnamed)
|
|
2507
|
+
return;
|
|
2508
|
+
this.warnedUnnamed = true;
|
|
2509
|
+
afterNextRender(() => {
|
|
2510
|
+
const named = this.ariaLabel() !== '' ||
|
|
2511
|
+
this.ariaLabelledby() !== '' ||
|
|
2512
|
+
dialog.querySelector(`[id="${this.headerId}"]`) !== null;
|
|
2513
|
+
if (!named) {
|
|
2514
|
+
console.warn('[AtlDialog] opened with no accessible name — ' +
|
|
2515
|
+
'add an <atl-dialog-header> or set [aria-label] / [aria-labelledby] so screen readers announce its purpose.', dialog);
|
|
2516
|
+
}
|
|
2517
|
+
}, { injector: this.injector });
|
|
2518
|
+
}
|
|
2453
2519
|
onCancel(event) {
|
|
2454
2520
|
event.preventDefault();
|
|
2455
2521
|
this.open.set(false);
|
|
@@ -3895,6 +3961,7 @@ const ATL_BREADCRUMBS = new InjectionToken('ATL_BREADCRUMBS');
|
|
|
3895
3961
|
* ```
|
|
3896
3962
|
*/
|
|
3897
3963
|
class AtlBreadcrumbs {
|
|
3964
|
+
/** Separator character shown between breadcrumb items. Default `/`. */
|
|
3898
3965
|
separator = input('/', /* @ts-ignore */
|
|
3899
3966
|
...(ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []));
|
|
3900
3967
|
separatorCssVar = computed(() => `'${this.separator()}'`, /* @ts-ignore */
|
|
@@ -4285,6 +4352,8 @@ class AtlDrawer {
|
|
|
4285
4352
|
...(ngDevMode ? [{ debugName: "dialogRef" }] : /* istanbul ignore next */ []));
|
|
4286
4353
|
triggerEl = signal(null, /* @ts-ignore */
|
|
4287
4354
|
...(ngDevMode ? [{ debugName: "triggerEl" }] : /* istanbul ignore next */ []));
|
|
4355
|
+
injector = inject(Injector);
|
|
4356
|
+
warnedUnnamed = false;
|
|
4288
4357
|
hostClasses = computed(() => `position-${this.position()} size-${this.size()}${this.open() ? ' is-open' : ''}`, /* @ts-ignore */
|
|
4289
4358
|
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
4290
4359
|
constructor() {
|
|
@@ -4295,6 +4364,7 @@ class AtlDrawer {
|
|
|
4295
4364
|
if (this.open()) {
|
|
4296
4365
|
this.triggerEl.set(document.activeElement);
|
|
4297
4366
|
dialog.showModal();
|
|
4367
|
+
this.warnIfUnnamed(dialog);
|
|
4298
4368
|
}
|
|
4299
4369
|
else {
|
|
4300
4370
|
if (dialog.open)
|
|
@@ -4304,6 +4374,23 @@ class AtlDrawer {
|
|
|
4304
4374
|
}
|
|
4305
4375
|
});
|
|
4306
4376
|
}
|
|
4377
|
+
/**
|
|
4378
|
+
* Dev-mode warning, once per instance, when the dialog opens with nothing
|
|
4379
|
+
* naming it. Checked after render so a header projected later (or an
|
|
4380
|
+
* `aria-label` bound dynamically) has settled by then.
|
|
4381
|
+
*/
|
|
4382
|
+
warnIfUnnamed(dialog) {
|
|
4383
|
+
if (!isNgDevMode() || this.warnedUnnamed)
|
|
4384
|
+
return;
|
|
4385
|
+
this.warnedUnnamed = true;
|
|
4386
|
+
afterNextRender(() => {
|
|
4387
|
+
const named = dialog.querySelector(`[id="${this.headerId}"]`) !== null;
|
|
4388
|
+
if (!named) {
|
|
4389
|
+
console.warn('[AtlDrawer] opened with no accessible name — ' +
|
|
4390
|
+
'add an <atl-drawer-header> so screen readers announce its purpose.', dialog);
|
|
4391
|
+
}
|
|
4392
|
+
}, { injector: this.injector });
|
|
4393
|
+
}
|
|
4307
4394
|
onCancel(event) {
|
|
4308
4395
|
event.preventDefault();
|
|
4309
4396
|
this.open.set(false);
|