@atelier-ui/angular 0.4.3 → 0.4.5
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.
|
@@ -34,7 +34,10 @@ class AtlButton {
|
|
|
34
34
|
/** Disables the button, preventing interaction. */
|
|
35
35
|
disabled = input(false, /* @ts-ignore */
|
|
36
36
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Shows a loading spinner, announces `aria-busy` and ignores activation.
|
|
39
|
+
* The button stays focusable (ADR-0171).
|
|
40
|
+
*/
|
|
38
41
|
loading = input(false, /* @ts-ignore */
|
|
39
42
|
...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
40
43
|
/** Native `type` attribute of the button. */
|
|
@@ -47,6 +50,15 @@ class AtlButton {
|
|
|
47
50
|
/** @internal — host element ref for the dev-mode a11y check. */
|
|
48
51
|
el = inject(ElementRef);
|
|
49
52
|
constructor() {
|
|
53
|
+
// Block activation while loading. Registered here, in the capture phase,
|
|
54
|
+
// so it runs before any `(click)` the consumer binds on the same element,
|
|
55
|
+
// and `preventDefault` also stops a `type="submit"` from submitting.
|
|
56
|
+
this.el.nativeElement.addEventListener('click', (event) => {
|
|
57
|
+
if (this.loading()) {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
event.stopImmediatePropagation();
|
|
60
|
+
}
|
|
61
|
+
}, { capture: true });
|
|
50
62
|
// Dev-mode warning when a button has no accessible name. Angular's
|
|
51
63
|
// <ng-content> projection means we can't enforce this at the type
|
|
52
64
|
// level (unlike the React adapter), so we check after first render.
|
|
@@ -64,12 +76,12 @@ class AtlButton {
|
|
|
64
76
|
}
|
|
65
77
|
}
|
|
66
78
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: AtlButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
67
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: AtlButton, isStandalone: true, selector: "button[atl-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.type": "type()", "disabled": "
|
|
79
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: AtlButton, isStandalone: true, selector: "button[atl-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.type": "type()", "disabled": "disabled()", "attr.aria-disabled": "isDisabled() || null", "attr.aria-busy": "loading() || null" }, classAttribute: "atl-button" }, ngImport: i0, template: `
|
|
68
80
|
@if (loading()) {
|
|
69
81
|
<span class="spinner" aria-hidden="true"></span>
|
|
70
82
|
}
|
|
71
83
|
<ng-content />
|
|
72
|
-
`, isInline: true, styles: [".atl-button,.atl-button *{box-sizing:border-box}.atl-button{display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-spacing-2);border:var(--ui-border-width) solid transparent;border-radius:var(--ui-radius-md);font-family:var(--ui-font-family);font-size:var(--ui-font-size-md);font-weight:var(--ui-font-weight-semibold);line-height:var(--ui-line-height-tight);letter-spacing:var(--ui-letter-spacing-tight);cursor:pointer;transition:background-color var(--ui-transition-fast),border-color var(--ui-transition-fast),color var(--ui-transition-fast),box-shadow var(--ui-transition-fast);white-space:nowrap;text-decoration:none;-webkit-user-select:none;user-select:none}.atl-button:focus-visible{outline:none;box-shadow:var(--ui-focus-ring)}.atl-button.variant-primary{background-color:var(--ui-color-primary);color:var(--ui-color-text-on-primary);border-color:var(--ui-color-primary)}.atl-button.variant-primary:hover:not(.is-disabled){background-color:var(--ui-color-primary-hover);border-color:var(--ui-color-primary-hover)}.atl-button.variant-primary:active:not(.is-disabled){background-color:var(--ui-color-primary-active);border-color:var(--ui-color-primary-active)}.atl-button.variant-secondary{background-color:var(--ui-color-secondary);color:var(--ui-color-text-on-secondary);border-color:var(--ui-color-secondary)}.atl-button.variant-secondary:hover:not(.is-disabled){background-color:var(--ui-color-secondary-hover);border-color:var(--ui-color-secondary-hover)}.atl-button.variant-secondary:active:not(.is-disabled){background-color:var(--ui-color-secondary-active);border-color:var(--ui-color-secondary-active)}.atl-button.variant-outline{background-color:var(--ui-color-surface-raised);color:var(--ui-color-primary);border-color:var(--ui-color-border-strong)}.atl-button.variant-outline:hover:not(.is-disabled){background-color:var(--ui-color-surface-sunken);border-color:var(--ui-color-primary)}.atl-button.variant-outline:active:not(.is-disabled){background-color:var(--ui-color-surface-sunken);border-color:var(--ui-color-primary-active)}.atl-button.variant-danger{background-color:var(--ui-color-danger);color:var(--ui-color-text-on-danger);border-color:var(--ui-color-danger);box-shadow:inset 0 0 0 1px #0000002e}.atl-button.variant-danger:hover:not(.is-disabled){background-color:var(--ui-color-danger-hover);border-color:var(--ui-color-danger-hover);box-shadow:inset 0 0 0 1px #0000002e}.atl-button.variant-danger:active:not(.is-disabled){background-color:var(--ui-color-danger-active);border-color:var(--ui-color-danger-active);box-shadow:inset 0 0 0 1px #0000002e}.atl-button.size-sm{padding:calc((var(--ui-control-height-sm) - var(--ui-line-height-tight) * var(--ui-font-size-sm)) / 2 - 1px) .875rem;font-size:var(--ui-font-size-sm);min-height:var(--ui-control-height-sm)}.atl-button.size-md{padding:calc((var(--ui-control-height-md) - var(--ui-line-height-tight) * var(--ui-font-size-md)) / 2 - 1px) 1.125rem;font-size:var(--ui-font-size-md);min-height:var(--ui-control-height-md)}.atl-button.size-lg{padding:calc((var(--ui-control-height-lg) - var(--ui-line-height-tight) * var(--ui-font-size-lg)) / 2 - 1px) 1.5rem;font-size:var(--ui-font-size-lg);min-height:var(--ui-control-height-lg)}.atl-button.is-disabled{background-color:var(--ui-color-disabled-bg);border-color:var(--ui-color-disabled-border);color:var(--ui-color-disabled-text);box-shadow:none;cursor:not-allowed;pointer-events:none}.atl-button.variant-outline.is-disabled{background-color:transparent}.atl-button>.spinner{display:inline-block;width:1em;height:1em;border:var(--ui-border-width-thick) solid currentColor;border-top-color:transparent;border-radius:var(--ui-radius-full);animation:atl-spin .7s linear infinite;flex-shrink:0}@keyframes atl-spin{to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
84
|
+
`, isInline: true, styles: [".atl-button,.atl-button *{box-sizing:border-box}.atl-button{display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-spacing-2);border:var(--ui-border-width) solid transparent;border-radius:var(--ui-radius-md);font-family:var(--ui-font-family);font-size:var(--ui-font-size-md);font-weight:var(--ui-font-weight-semibold);line-height:var(--ui-line-height-tight);letter-spacing:var(--ui-letter-spacing-tight);cursor:pointer;transition:background-color var(--ui-transition-fast),border-color var(--ui-transition-fast),color var(--ui-transition-fast),box-shadow var(--ui-transition-fast);white-space:nowrap;text-decoration:none;-webkit-user-select:none;user-select:none}.atl-button:focus-visible{outline:none;box-shadow:var(--ui-focus-ring)}.atl-button.variant-primary{background-color:var(--ui-color-primary);color:var(--ui-color-text-on-primary);border-color:var(--ui-color-primary)}.atl-button.variant-primary:hover:not(.is-disabled){background-color:var(--ui-color-primary-hover);border-color:var(--ui-color-primary-hover)}.atl-button.variant-primary:active:not(.is-disabled){background-color:var(--ui-color-primary-active);border-color:var(--ui-color-primary-active)}.atl-button.variant-secondary{background-color:var(--ui-color-secondary);color:var(--ui-color-text-on-secondary);border-color:var(--ui-color-secondary)}.atl-button.variant-secondary:hover:not(.is-disabled){background-color:var(--ui-color-secondary-hover);border-color:var(--ui-color-secondary-hover)}.atl-button.variant-secondary:active:not(.is-disabled){background-color:var(--ui-color-secondary-active);border-color:var(--ui-color-secondary-active)}.atl-button.variant-outline{background-color:var(--ui-color-surface-raised);color:var(--ui-color-primary);border-color:var(--ui-color-border-strong)}.atl-button.variant-outline:hover:not(.is-disabled){background-color:var(--ui-color-surface-sunken);border-color:var(--ui-color-primary)}.atl-button.variant-outline:active:not(.is-disabled){background-color:var(--ui-color-surface-sunken);border-color:var(--ui-color-primary-active)}.atl-button.variant-danger{background-color:var(--ui-color-danger);color:var(--ui-color-text-on-danger);border-color:var(--ui-color-danger);box-shadow:inset 0 0 0 1px #0000002e}.atl-button.variant-danger:hover:not(.is-disabled){background-color:var(--ui-color-danger-hover);border-color:var(--ui-color-danger-hover);box-shadow:inset 0 0 0 1px #0000002e}.atl-button.variant-danger:active:not(.is-disabled){background-color:var(--ui-color-danger-active);border-color:var(--ui-color-danger-active);box-shadow:inset 0 0 0 1px #0000002e}.atl-button.variant-danger:focus-visible:not(.is-disabled){box-shadow:var(--ui-focus-ring),inset 0 0 0 1px #0000002e}.atl-button.size-sm{padding:calc((var(--ui-control-height-sm) - var(--ui-line-height-tight) * var(--ui-font-size-sm)) / 2 - 1px) .875rem;font-size:var(--ui-font-size-sm);min-height:var(--ui-control-height-sm)}.atl-button.size-md{padding:calc((var(--ui-control-height-md) - var(--ui-line-height-tight) * var(--ui-font-size-md)) / 2 - 1px) 1.125rem;font-size:var(--ui-font-size-md);min-height:var(--ui-control-height-md)}.atl-button.size-lg{padding:calc((var(--ui-control-height-lg) - var(--ui-line-height-tight) * var(--ui-font-size-lg)) / 2 - 1px) 1.5rem;font-size:var(--ui-font-size-lg);min-height:var(--ui-control-height-lg)}.atl-button.is-disabled{background-color:var(--ui-color-disabled-bg);border-color:var(--ui-color-disabled-border);color:var(--ui-color-disabled-text);box-shadow:none;cursor:not-allowed;pointer-events:none}.atl-button.variant-outline.is-disabled{background-color:transparent}.atl-button.is-loading:focus-visible{box-shadow:var(--ui-focus-ring)}.atl-button>.spinner{display:inline-block;width:1em;height:1em;border:var(--ui-border-width-thick) solid currentColor;border-top-color:transparent;border-radius:var(--ui-radius-full);animation:atl-spin .7s linear infinite;flex-shrink:0}@keyframes atl-spin{to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
73
85
|
}
|
|
74
86
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: AtlButton, decorators: [{
|
|
75
87
|
type: Component,
|
|
@@ -82,9 +94,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
82
94
|
class: 'atl-button',
|
|
83
95
|
'[class]': 'hostClasses()',
|
|
84
96
|
'[attr.type]': 'type()',
|
|
85
|
-
|
|
97
|
+
// Native `disabled` only for the `disabled` input. Loading is announced
|
|
98
|
+
// (aria-disabled + aria-busy) and blocked in the constructor's capture
|
|
99
|
+
// listener, but the button stays focusable so focus survives the state
|
|
100
|
+
// change (ADR-0171).
|
|
101
|
+
'[disabled]': 'disabled()',
|
|
86
102
|
'[attr.aria-disabled]': 'isDisabled() || null',
|
|
87
|
-
|
|
103
|
+
'[attr.aria-busy]': 'loading() || null',
|
|
104
|
+
}, styles: [".atl-button,.atl-button *{box-sizing:border-box}.atl-button{display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-spacing-2);border:var(--ui-border-width) solid transparent;border-radius:var(--ui-radius-md);font-family:var(--ui-font-family);font-size:var(--ui-font-size-md);font-weight:var(--ui-font-weight-semibold);line-height:var(--ui-line-height-tight);letter-spacing:var(--ui-letter-spacing-tight);cursor:pointer;transition:background-color var(--ui-transition-fast),border-color var(--ui-transition-fast),color var(--ui-transition-fast),box-shadow var(--ui-transition-fast);white-space:nowrap;text-decoration:none;-webkit-user-select:none;user-select:none}.atl-button:focus-visible{outline:none;box-shadow:var(--ui-focus-ring)}.atl-button.variant-primary{background-color:var(--ui-color-primary);color:var(--ui-color-text-on-primary);border-color:var(--ui-color-primary)}.atl-button.variant-primary:hover:not(.is-disabled){background-color:var(--ui-color-primary-hover);border-color:var(--ui-color-primary-hover)}.atl-button.variant-primary:active:not(.is-disabled){background-color:var(--ui-color-primary-active);border-color:var(--ui-color-primary-active)}.atl-button.variant-secondary{background-color:var(--ui-color-secondary);color:var(--ui-color-text-on-secondary);border-color:var(--ui-color-secondary)}.atl-button.variant-secondary:hover:not(.is-disabled){background-color:var(--ui-color-secondary-hover);border-color:var(--ui-color-secondary-hover)}.atl-button.variant-secondary:active:not(.is-disabled){background-color:var(--ui-color-secondary-active);border-color:var(--ui-color-secondary-active)}.atl-button.variant-outline{background-color:var(--ui-color-surface-raised);color:var(--ui-color-primary);border-color:var(--ui-color-border-strong)}.atl-button.variant-outline:hover:not(.is-disabled){background-color:var(--ui-color-surface-sunken);border-color:var(--ui-color-primary)}.atl-button.variant-outline:active:not(.is-disabled){background-color:var(--ui-color-surface-sunken);border-color:var(--ui-color-primary-active)}.atl-button.variant-danger{background-color:var(--ui-color-danger);color:var(--ui-color-text-on-danger);border-color:var(--ui-color-danger);box-shadow:inset 0 0 0 1px #0000002e}.atl-button.variant-danger:hover:not(.is-disabled){background-color:var(--ui-color-danger-hover);border-color:var(--ui-color-danger-hover);box-shadow:inset 0 0 0 1px #0000002e}.atl-button.variant-danger:active:not(.is-disabled){background-color:var(--ui-color-danger-active);border-color:var(--ui-color-danger-active);box-shadow:inset 0 0 0 1px #0000002e}.atl-button.variant-danger:focus-visible:not(.is-disabled){box-shadow:var(--ui-focus-ring),inset 0 0 0 1px #0000002e}.atl-button.size-sm{padding:calc((var(--ui-control-height-sm) - var(--ui-line-height-tight) * var(--ui-font-size-sm)) / 2 - 1px) .875rem;font-size:var(--ui-font-size-sm);min-height:var(--ui-control-height-sm)}.atl-button.size-md{padding:calc((var(--ui-control-height-md) - var(--ui-line-height-tight) * var(--ui-font-size-md)) / 2 - 1px) 1.125rem;font-size:var(--ui-font-size-md);min-height:var(--ui-control-height-md)}.atl-button.size-lg{padding:calc((var(--ui-control-height-lg) - var(--ui-line-height-tight) * var(--ui-font-size-lg)) / 2 - 1px) 1.5rem;font-size:var(--ui-font-size-lg);min-height:var(--ui-control-height-lg)}.atl-button.is-disabled{background-color:var(--ui-color-disabled-bg);border-color:var(--ui-color-disabled-border);color:var(--ui-color-disabled-text);box-shadow:none;cursor:not-allowed;pointer-events:none}.atl-button.variant-outline.is-disabled{background-color:transparent}.atl-button.is-loading:focus-visible{box-shadow:var(--ui-focus-ring)}.atl-button>.spinner{display:inline-block;width:1em;height:1em;border:var(--ui-border-width-thick) solid currentColor;border-top-color:transparent;border-radius:var(--ui-radius-full);animation:atl-spin .7s linear infinite;flex-shrink:0}@keyframes atl-spin{to{transform:rotate(360deg)}}\n"] }]
|
|
88
105
|
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
89
106
|
|
|
90
107
|
/**
|
|
@@ -435,6 +452,24 @@ function warnIfUnnamedControl(host, component, controlSelector, fix) {
|
|
|
435
452
|
}
|
|
436
453
|
});
|
|
437
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* Dev-mode check for a component whose HOST carries a role that needs a name
|
|
457
|
+
* (`role="radiogroup"`) and which has no native control to be labelled through
|
|
458
|
+
* `<label for>`: the name has to arrive as `aria-label` or `aria-labelledby` on
|
|
459
|
+
* the host. Checked once after first render. Must be called from an injection
|
|
460
|
+
* context (a constructor).
|
|
461
|
+
*/
|
|
462
|
+
function warnIfUnnamedHost(host, component, fix) {
|
|
463
|
+
if (!isNgDevMode())
|
|
464
|
+
return;
|
|
465
|
+
afterNextRender(() => {
|
|
466
|
+
const named = (host.getAttribute('aria-label') ?? '').trim().length > 0 ||
|
|
467
|
+
(host.getAttribute('aria-labelledby') ?? '').trim().length > 0;
|
|
468
|
+
if (!named) {
|
|
469
|
+
console.warn(`[${component}] no accessible name — ${fix} so screen readers announce its purpose.`, host);
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
}
|
|
438
473
|
|
|
439
474
|
let nextId$d = 0;
|
|
440
475
|
/**
|
|
@@ -1137,6 +1172,11 @@ let nextId$9 = 0;
|
|
|
1137
1172
|
* <atl-radio radioValue="lg">Large</atl-radio>
|
|
1138
1173
|
* </atl-radio-group>
|
|
1139
1174
|
*
|
|
1175
|
+
* <!-- Accessible name: a group has no <label for>, so pass `aria-label` or
|
|
1176
|
+
* `aria-labelledby` (static or bound with [aria-label]); dev mode warns
|
|
1177
|
+
* when both are missing (ADR-0171). -->
|
|
1178
|
+
* <atl-radio-group aria-label="Plan size" [(value)]="size"> … </atl-radio-group>
|
|
1179
|
+
*
|
|
1140
1180
|
* <!-- With Signal Forms -->
|
|
1141
1181
|
* <atl-radio-group [formField]="form.size">
|
|
1142
1182
|
* <atl-radio radioValue="sm">Small</atl-radio>
|
|
@@ -1172,6 +1212,24 @@ class AtlRadioGroup {
|
|
|
1172
1212
|
/** Validation errors from the form system. Bound by [formField] directive. */
|
|
1173
1213
|
errors = input([], /* @ts-ignore */
|
|
1174
1214
|
...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
1215
|
+
/**
|
|
1216
|
+
* Accessible name of the group, written as `aria-label` on the host, which
|
|
1217
|
+
* carries `role="radiogroup"`. A `<label for>` cannot name a group, so a group
|
|
1218
|
+
* needs this or `aria-labelledby`. An aliased input rather than a plain host
|
|
1219
|
+
* attribute, so it is declared, bindable (`[aria-label]`) and in the spec
|
|
1220
|
+
* contract; see `atl-input.ts`'s identical `ariaLabel`.
|
|
1221
|
+
*/
|
|
1222
|
+
// host-attr-guard exists for hosts that are NOT the labelled element, where a
|
|
1223
|
+
// static attribute would be a decoy. This host carries the role and the input is
|
|
1224
|
+
// written back onto it above, so the static attribute and the input agree.
|
|
1225
|
+
// eslint-disable-next-line atelier/host-attr-guard
|
|
1226
|
+
ariaLabel = input('', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
1227
|
+
/**
|
|
1228
|
+
* Id of the visible caption that names the group. Use instead of `aria-label`
|
|
1229
|
+
* when the text is on screen.
|
|
1230
|
+
*/
|
|
1231
|
+
// eslint-disable-next-line atelier/host-attr-guard -- same as `ariaLabel`
|
|
1232
|
+
ariaLabelledby = input('', { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
1175
1233
|
/** @internal */
|
|
1176
1234
|
errorId = `atl-radio-group-errors-${nextId$9++}`;
|
|
1177
1235
|
/** @internal */
|
|
@@ -1203,6 +1261,9 @@ class AtlRadioGroup {
|
|
|
1203
1261
|
return classes.join(' ');
|
|
1204
1262
|
}, /* @ts-ignore */
|
|
1205
1263
|
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1264
|
+
constructor() {
|
|
1265
|
+
warnIfUnnamedHost(inject(ElementRef).nativeElement, 'AtlRadioGroup', 'set aria-label, or aria-labelledby pointing at a visible caption');
|
|
1266
|
+
}
|
|
1206
1267
|
/** @internal — called by AtlRadio on change */
|
|
1207
1268
|
select(v) {
|
|
1208
1269
|
if (!this.disabled() && !this.readonly()) {
|
|
@@ -1242,7 +1303,7 @@ class AtlRadioGroup {
|
|
|
1242
1303
|
}
|
|
1243
1304
|
}
|
|
1244
1305
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: AtlRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1245
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: AtlRadioGroup, isStandalone: true, selector: "atl-radio-group", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, host: { attributes: { "role": "radiogroup" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "hostClasses()", "attr.aria-invalid": "invalid() || null", "attr.aria-required": "required() || null", "attr.aria-describedby": "showErrors() ? errorId : null" }, classAttribute: "atl-radio-group" }, providers: [{ provide: ATL_RADIO_GROUP, useExisting: AtlRadioGroup }], ngImport: i0, template: `
|
|
1306
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: AtlRadioGroup, isStandalone: true, selector: "atl-radio-group", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, host: { attributes: { "role": "radiogroup" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "hostClasses()", "attr.aria-label": "ariaLabel() || null", "attr.aria-labelledby": "ariaLabelledby() || null", "attr.aria-invalid": "invalid() || null", "attr.aria-required": "required() || null", "attr.aria-describedby": "showErrors() ? errorId : null" }, classAttribute: "atl-radio-group" }, providers: [{ provide: ATL_RADIO_GROUP, useExisting: AtlRadioGroup }], ngImport: i0, template: `
|
|
1246
1307
|
<ng-content />
|
|
1247
1308
|
@if (showErrors()) {
|
|
1248
1309
|
<div class="errors" [id]="errorId" aria-live="polite">
|
|
@@ -1268,12 +1329,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
1268
1329
|
class: 'atl-radio-group',
|
|
1269
1330
|
role: 'radiogroup',
|
|
1270
1331
|
'[class]': 'hostClasses()',
|
|
1332
|
+
'[attr.aria-label]': 'ariaLabel() || null',
|
|
1333
|
+
'[attr.aria-labelledby]': 'ariaLabelledby() || null',
|
|
1271
1334
|
'[attr.aria-invalid]': 'invalid() || null',
|
|
1272
1335
|
'[attr.aria-required]': 'required() || null',
|
|
1273
1336
|
'[attr.aria-describedby]': 'showErrors() ? errorId : null',
|
|
1274
1337
|
'(keydown)': 'onKeydown($event)',
|
|
1275
1338
|
}, providers: [{ provide: ATL_RADIO_GROUP, useExisting: AtlRadioGroup }], styles: [".atl-radio-group,.atl-radio-group *{box-sizing:border-box}.atl-radio-group{display:flex;font-family:var(--ui-font-family);line-height:var(--ui-line-height-tight);gap:var(--ui-spacing-3)}.atl-radio-group.orientation-vertical{flex-direction:column}.atl-radio-group.orientation-horizontal{flex-direction:row;flex-wrap:wrap}.atl-radio-group.is-disabled{opacity:var(--ui-opacity-disabled);cursor:not-allowed}.atl-radio-group>.errors{margin-top:var(--ui-spacing-2)}.atl-radio-group>.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"] }]
|
|
1276
|
-
}], 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"] }], 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 }] }], 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 }] }] } });
|
|
1339
|
+
}], 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"] }], 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 }] }], 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 }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }] } });
|
|
1277
1340
|
|
|
1278
1341
|
let nextId$8 = 0;
|
|
1279
1342
|
/**
|