@besaitech/ng-design-system 0.0.48 → 0.0.50
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, computed, ChangeDetectionStrategy, Component, booleanAttribute, isDevMode, effect, output, signal, forwardRef, viewChild,
|
|
2
|
+
import { inject, input, computed, ChangeDetectionStrategy, Component, booleanAttribute, isDevMode, effect, numberAttribute, output, signal, forwardRef, viewChild, viewChildren, afterRenderEffect, ElementRef, model, Injector, afterNextRender, TemplateRef, Directive, contentChild, Injectable, contentChildren, untracked, DestroyRef } from '@angular/core';
|
|
3
3
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule } from '@angular/forms';
|
|
@@ -62,7 +62,10 @@ const SDS_ICONS = {
|
|
|
62
62
|
copy: '<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',
|
|
63
63
|
type: '<polyline points="4 7 4 4 20 4 20 7"/><line x1="9" x2="15" y1="20" y2="20"/><line x1="12" x2="12" y1="4" y2="20"/>',
|
|
64
64
|
tag: '<path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"/><circle cx="7.5" cy="7.5" r=".5" fill="currentColor"/>',
|
|
65
|
+
ticket: '<path d="M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"/><path d="M13 5v2"/><path d="M13 17v2"/><path d="M13 11v2"/>',
|
|
65
66
|
square: '<rect width="18" height="18" x="3" y="3" rx="2"/>',
|
|
67
|
+
'square-check': '<rect width="18" height="18" x="3" y="3" rx="2"/><path d="m9 12 2 2 4-4"/>',
|
|
68
|
+
'circle-dot': '<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="1"/>',
|
|
66
69
|
'circle-user': '<circle cx="12" cy="12" r="10"/><circle cx="12" cy="10" r="3"/><path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662"/>',
|
|
67
70
|
'layout-grid': '<rect width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="14" y="3" rx="1"/><rect width="7" height="7" x="14" y="14" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/>',
|
|
68
71
|
'panels-top-left': '<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M9 21V9"/>',
|
|
@@ -80,6 +83,8 @@ const SDS_ICONS = {
|
|
|
80
83
|
'chevrons-up-down': '<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>',
|
|
81
84
|
filter: '<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/>',
|
|
82
85
|
table: '<path d="M12 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/>',
|
|
86
|
+
// Contactless ordering: every restaurant table gets its own QR code (Belvigo merchant nav).
|
|
87
|
+
'qr-code': '<rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/>',
|
|
83
88
|
eye: '<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>',
|
|
84
89
|
// Pairs with `eye` for password reveal. Without it a show/hide toggle has no second state to draw,
|
|
85
90
|
// and aria-pressed alone leaves sighted users with no visible change.
|
|
@@ -278,7 +283,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
278
283
|
`, styles: [".sds-spinner{width:1em;height:1em;border:2px solid currentColor;border-right-color:transparent;border-radius:9999px;animation:sds-spin .6s linear infinite}@keyframes sds-spin{to{transform:rotate(360deg)}}\n"] }]
|
|
279
284
|
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], block: [{ type: i0.Input, args: [{ isSignal: true, alias: "block", required: false }] }], iconOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOnly", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
280
285
|
|
|
281
|
-
let nextId$
|
|
286
|
+
let nextId$f = 0;
|
|
282
287
|
const SIZES$a = {
|
|
283
288
|
sm: 'h-9 text-sm',
|
|
284
289
|
md: 'h-10 text-sm',
|
|
@@ -291,7 +296,7 @@ const SIZES$a = {
|
|
|
291
296
|
* sidebar search field).
|
|
292
297
|
*/
|
|
293
298
|
class SdsInput {
|
|
294
|
-
inputId = `sds-input-${nextId$
|
|
299
|
+
inputId = `sds-input-${nextId$f++}`;
|
|
295
300
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
296
301
|
/** Accessible name used when no visible [label] is provided. */
|
|
297
302
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -319,6 +324,14 @@ class SdsInput {
|
|
|
319
324
|
shape = input('control', ...(ngDevMode ? [{ debugName: "shape" }] : []));
|
|
320
325
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
321
326
|
clearable = input(false, ...(ngDevMode ? [{ debugName: "clearable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
327
|
+
/**
|
|
328
|
+
* The native `autocomplete` token (`name`, `tel`, `email`, `new-password`, `one-time-code`…). Empty
|
|
329
|
+
* leaves the browser's default. Checkout and sign-up fields need it: browsers autofill from it, and
|
|
330
|
+
* password managers only offer a generated password for `new-password`.
|
|
331
|
+
*/
|
|
332
|
+
autocomplete = input('', ...(ngDevMode ? [{ debugName: "autocomplete" }] : []));
|
|
333
|
+
/** Hard character cap on the native field; 0 means no limit. */
|
|
334
|
+
maxLength = input(0, ...(ngDevMode ? [{ debugName: "maxLength", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
322
335
|
/**
|
|
323
336
|
* Accessible name for the clear button. French default so existing consumers are unchanged, but an
|
|
324
337
|
* app serving more than one language MUST translate it — it is an icon-only control, so this string
|
|
@@ -419,7 +432,7 @@ class SdsInput {
|
|
|
419
432
|
this.onTouched();
|
|
420
433
|
}
|
|
421
434
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
422
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsInput, isStandalone: true, selector: "sds-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null }, leadingIcon: { classPropertyName: "leadingIcon", publicName: "leadingIcon", isSignal: true, isRequired: false, transformFunction: null }, trailingIcon: { classPropertyName: "trailingIcon", publicName: "trailingIcon", isSignal: true, isRequired: false, transformFunction: null }, trailingAction: { classPropertyName: "trailingAction", publicName: "trailingAction", isSignal: true, isRequired: false, transformFunction: null }, trailingActionLabel: { classPropertyName: "trailingActionLabel", publicName: "trailingActionLabel", isSignal: true, isRequired: false, transformFunction: null }, trailingActionPressed: { classPropertyName: "trailingActionPressed", publicName: "trailingActionPressed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { trailingActionClick: "trailingActionClick" }, host: { classAttribute: "block" }, providers: [
|
|
435
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsInput, isStandalone: true, selector: "sds-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null }, leadingIcon: { classPropertyName: "leadingIcon", publicName: "leadingIcon", isSignal: true, isRequired: false, transformFunction: null }, trailingIcon: { classPropertyName: "trailingIcon", publicName: "trailingIcon", isSignal: true, isRequired: false, transformFunction: null }, trailingAction: { classPropertyName: "trailingAction", publicName: "trailingAction", isSignal: true, isRequired: false, transformFunction: null }, trailingActionLabel: { classPropertyName: "trailingActionLabel", publicName: "trailingActionLabel", isSignal: true, isRequired: false, transformFunction: null }, trailingActionPressed: { classPropertyName: "trailingActionPressed", publicName: "trailingActionPressed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { trailingActionClick: "trailingActionClick" }, host: { classAttribute: "block" }, providers: [
|
|
423
436
|
{
|
|
424
437
|
provide: NG_VALUE_ACCESSOR,
|
|
425
438
|
useExisting: forwardRef(() => SdsInput),
|
|
@@ -457,6 +470,8 @@ class SdsInput {
|
|
|
457
470
|
[placeholder]="placeholder()"
|
|
458
471
|
[disabled]="isDisabled()"
|
|
459
472
|
[value]="value()"
|
|
473
|
+
[attr.autocomplete]="autocomplete() || null"
|
|
474
|
+
[attr.maxlength]="maxLength() || null"
|
|
460
475
|
[attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
|
|
461
476
|
[attr.aria-invalid]="error() ? 'true' : null"
|
|
462
477
|
[attr.aria-describedby]="describedBy()"
|
|
@@ -554,6 +569,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
554
569
|
[placeholder]="placeholder()"
|
|
555
570
|
[disabled]="isDisabled()"
|
|
556
571
|
[value]="value()"
|
|
572
|
+
[attr.autocomplete]="autocomplete() || null"
|
|
573
|
+
[attr.maxlength]="maxLength() || null"
|
|
557
574
|
[attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
|
|
558
575
|
[attr.aria-invalid]="error() ? 'true' : null"
|
|
559
576
|
[attr.aria-describedby]="describedBy()"
|
|
@@ -610,9 +627,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
610
627
|
</p>
|
|
611
628
|
}
|
|
612
629
|
`, styles: ["input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{transition:background-color 100000s ease-in-out 0s;-webkit-text-fill-color:currentColor;caret-color:currentColor}\n"] }]
|
|
613
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], leadingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "leadingIcon", required: false }] }], trailingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingIcon", required: false }] }], trailingAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingAction", required: false }] }], trailingActionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingActionLabel", required: false }] }], trailingActionPressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingActionPressed", required: false }] }], trailingActionClick: [{ type: i0.Output, args: ["trailingActionClick"] }] } });
|
|
630
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], leadingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "leadingIcon", required: false }] }], trailingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingIcon", required: false }] }], trailingAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingAction", required: false }] }], trailingActionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingActionLabel", required: false }] }], trailingActionPressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingActionPressed", required: false }] }], trailingActionClick: [{ type: i0.Output, args: ["trailingActionClick"] }] } });
|
|
614
631
|
|
|
615
|
-
let nextId$
|
|
632
|
+
let nextId$e = 0;
|
|
616
633
|
const HEIGHTS = {
|
|
617
634
|
sm: 'h-9',
|
|
618
635
|
md: 'h-10',
|
|
@@ -635,7 +652,7 @@ const TEXT = {
|
|
|
635
652
|
* {@link min}/{@link max} on blur and on every spinner step; ArrowUp / ArrowDown also step it.
|
|
636
653
|
*/
|
|
637
654
|
class SdsInputNumber {
|
|
638
|
-
inputId = `sds-input-number-${nextId$
|
|
655
|
+
inputId = `sds-input-number-${nextId$e++}`;
|
|
639
656
|
fieldRef = viewChild('field', ...(ngDevMode ? [{ debugName: "fieldRef" }] : []));
|
|
640
657
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
641
658
|
/** Accessible name used when no visible [label] is provided. */
|
|
@@ -1342,7 +1359,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1342
1359
|
}]
|
|
1343
1360
|
}], ctorParameters: () => [], propDecorators: { fieldRef: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], currencyDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "currencyDisplay", required: false }] }], useGrouping: [{ type: i0.Input, args: [{ isSignal: true, alias: "useGrouping", required: false }] }], minFractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "minFractionDigits", required: false }] }], maxFractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFractionDigits", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], showButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtons", required: false }] }], buttonLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonLayout", required: false }] }], incrementIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "incrementIcon", required: false }] }], decrementIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "decrementIcon", required: false }] }], allowEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmpty", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], incrementLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "incrementLabel", required: false }] }], decrementLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "decrementLabel", required: false }] }] } });
|
|
1344
1361
|
|
|
1345
|
-
let nextId$
|
|
1362
|
+
let nextId$d = 0;
|
|
1346
1363
|
const SIZES$9 = {
|
|
1347
1364
|
sm: 'min-h-9 text-sm',
|
|
1348
1365
|
md: 'min-h-10 text-sm',
|
|
@@ -1362,7 +1379,7 @@ const SIZES$9 = {
|
|
|
1362
1379
|
* `<sds-localized-input [languages]="['fr','nl','en']" [(ngModel)]="title" />`.
|
|
1363
1380
|
*/
|
|
1364
1381
|
class SdsLocalizedInput {
|
|
1365
|
-
inputId = `sds-localized-input-${nextId$
|
|
1382
|
+
inputId = `sds-localized-input-${nextId$d++}`;
|
|
1366
1383
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1367
1384
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1368
1385
|
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
@@ -1618,7 +1635,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1618
1635
|
}]
|
|
1619
1636
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], languages: [{ type: i0.Input, args: [{ isSignal: true, alias: "languages", required: false }] }], currentLanguage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentLanguage", required: false }] }], multiline: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiline", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], languageSwitcherLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "languageSwitcherLabel", required: false }] }], untranslatedLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "untranslatedLabel", required: false }] }] } });
|
|
1620
1637
|
|
|
1621
|
-
let nextId$
|
|
1638
|
+
let nextId$c = 0;
|
|
1622
1639
|
const SIZES$8 = {
|
|
1623
1640
|
md: 'h-12 w-11 text-lg',
|
|
1624
1641
|
lg: 'h-14 w-12 text-xl',
|
|
@@ -1635,7 +1652,7 @@ const SIZES$8 = {
|
|
|
1635
1652
|
* first box and have it land correctly.
|
|
1636
1653
|
*/
|
|
1637
1654
|
class SdsOtpInput {
|
|
1638
|
-
groupId = `sds-otp-${nextId$
|
|
1655
|
+
groupId = `sds-otp-${nextId$c++}`;
|
|
1639
1656
|
/** How many boxes / characters the code has. */
|
|
1640
1657
|
length = input(6, ...(ngDevMode ? [{ debugName: "length", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
1641
1658
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
@@ -1935,7 +1952,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1935
1952
|
}]
|
|
1936
1953
|
}], ctorParameters: () => [], propDecorators: { length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputMode", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], cellLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellLabel", required: false }] }], completed: [{ type: i0.Output, args: ["completed"] }], cells: [{ type: i0.ViewChildren, args: ['cell', { isSignal: true }] }] } });
|
|
1937
1954
|
|
|
1938
|
-
let nextId$
|
|
1955
|
+
let nextId$b = 0;
|
|
1939
1956
|
const SIZES$7 = {
|
|
1940
1957
|
sm: 'text-sm px-3 py-2',
|
|
1941
1958
|
md: 'text-sm px-3.5 py-2.5',
|
|
@@ -1947,7 +1964,7 @@ const SIZES$7 = {
|
|
|
1947
1964
|
* [(ngModel)].
|
|
1948
1965
|
*/
|
|
1949
1966
|
class SdsTextarea {
|
|
1950
|
-
fieldId = `sds-textarea-${nextId$
|
|
1967
|
+
fieldId = `sds-textarea-${nextId$b++}`;
|
|
1951
1968
|
field = viewChild('field', ...(ngDevMode ? [{ debugName: "field" }] : []));
|
|
1952
1969
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1953
1970
|
/** Accessible name used when no visible [label] is provided. */
|
|
@@ -1956,6 +1973,11 @@ class SdsTextarea {
|
|
|
1956
1973
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1957
1974
|
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
1958
1975
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1976
|
+
/**
|
|
1977
|
+
* `filled` is a borderless field on a muted ground — the textarea counterpart of `sds-input`'s
|
|
1978
|
+
* `filled`, so a form that uses filled inputs keeps one look down to its notes field.
|
|
1979
|
+
*/
|
|
1980
|
+
appearance = input('default', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
1959
1981
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
1960
1982
|
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
1961
1983
|
required = input(false, ...(ngDevMode ? [{ debugName: "required", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
@@ -1990,14 +2012,24 @@ class SdsTextarea {
|
|
|
1990
2012
|
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : []));
|
|
1991
2013
|
fieldClasses = computed(() => {
|
|
1992
2014
|
const parts = [
|
|
1993
|
-
'block w-full rounded-control border
|
|
2015
|
+
'block w-full rounded-control border text-ink outline-none transition-colors placeholder:text-ink-faint',
|
|
1994
2016
|
SIZES$7[this.size()],
|
|
1995
2017
|
];
|
|
1996
2018
|
if (this.autoResize())
|
|
1997
2019
|
parts.push('overflow-hidden');
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2020
|
+
if (this.appearance() === 'filled') {
|
|
2021
|
+
// border-transparent, not border-0, for the same reason as sds-input's filled: one box model.
|
|
2022
|
+
parts.push('bg-muted');
|
|
2023
|
+
parts.push(this.error()
|
|
2024
|
+
? 'border-danger focus:ring-2 focus:ring-danger/30'
|
|
2025
|
+
: 'border-transparent focus:ring-2 focus:ring-brand-500/25');
|
|
2026
|
+
}
|
|
2027
|
+
else {
|
|
2028
|
+
parts.push('bg-surface');
|
|
2029
|
+
parts.push(this.error()
|
|
2030
|
+
? 'border-danger focus:border-danger focus:ring-2 focus:ring-danger/25'
|
|
2031
|
+
: 'border-border focus:border-brand-500 focus:ring-2 focus:ring-brand-500/25');
|
|
2032
|
+
}
|
|
2001
2033
|
if (this.isDisabled())
|
|
2002
2034
|
parts.push('opacity-60 cursor-not-allowed');
|
|
2003
2035
|
return parts.join(' ');
|
|
@@ -2044,7 +2076,7 @@ class SdsTextarea {
|
|
|
2044
2076
|
el.style.height = `${el.scrollHeight}px`;
|
|
2045
2077
|
}
|
|
2046
2078
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsTextarea, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2047
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsTextarea, isStandalone: true, selector: "sds-textarea", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", 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 }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, autoResize: { classPropertyName: "autoResize", publicName: "autoResize", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, showCount: { classPropertyName: "showCount", publicName: "showCount", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block" }, providers: [
|
|
2079
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsTextarea, isStandalone: true, selector: "sds-textarea", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", 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 }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, autoResize: { classPropertyName: "autoResize", publicName: "autoResize", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, showCount: { classPropertyName: "showCount", publicName: "showCount", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block" }, providers: [
|
|
2048
2080
|
{
|
|
2049
2081
|
provide: NG_VALUE_ACCESSOR,
|
|
2050
2082
|
useExisting: forwardRef(() => SdsTextarea),
|
|
@@ -2183,9 +2215,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2183
2215
|
}
|
|
2184
2216
|
`,
|
|
2185
2217
|
}]
|
|
2186
|
-
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], showCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCount", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }] } });
|
|
2218
|
+
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], showCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCount", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }] } });
|
|
2187
2219
|
|
|
2188
|
-
let nextId$
|
|
2220
|
+
let nextId$a = 0;
|
|
2189
2221
|
const SIZES$6 = {
|
|
2190
2222
|
sm: { track: 'h-5 w-9', knob: 'h-4 w-4', on: 'translate-x-4', icon: 11 },
|
|
2191
2223
|
md: { track: 'h-6 w-11', knob: 'h-5 w-5', on: 'translate-x-5', icon: 13 },
|
|
@@ -2198,7 +2230,7 @@ const SIZES$6 = {
|
|
|
2198
2230
|
* states.
|
|
2199
2231
|
*/
|
|
2200
2232
|
class SdsToggleSwitch {
|
|
2201
|
-
fieldId = `sds-toggle-switch-${nextId$
|
|
2233
|
+
fieldId = `sds-toggle-switch-${nextId$a++}`;
|
|
2202
2234
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2203
2235
|
/** Accessible name used when no visible [label] is provided. */
|
|
2204
2236
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -2234,14 +2266,21 @@ class SdsToggleSwitch {
|
|
|
2234
2266
|
return `${this.fieldId}-hint`;
|
|
2235
2267
|
return null;
|
|
2236
2268
|
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : []));
|
|
2269
|
+
/**
|
|
2270
|
+
* On/off must read at a glance in both modes. In light mode the brand track against a pale grey one does
|
|
2271
|
+
* it. In dark mode a monochrome brand's 600 step is a mid-dark grey, as dim as the off track, so there
|
|
2272
|
+
* "on" flips to a light track with a dark knob and "off" keeps a dim track with a muted knob. `ink` (not
|
|
2273
|
+
* black) tints the off track so it stays visible on dark surfaces too.
|
|
2274
|
+
*/
|
|
2237
2275
|
trackClasses = computed(() => {
|
|
2238
2276
|
const parts = [this.sizing().track];
|
|
2239
|
-
parts.push(this.checked() ? 'bg-brand-600' : 'bg-
|
|
2277
|
+
parts.push(this.checked() ? 'bg-brand-600 dark:bg-ink' : 'bg-ink/15');
|
|
2240
2278
|
return parts.join(' ');
|
|
2241
2279
|
}, ...(ngDevMode ? [{ debugName: "trackClasses" }] : []));
|
|
2242
2280
|
knobClasses = computed(() => {
|
|
2243
2281
|
const parts = [this.sizing().knob];
|
|
2244
2282
|
parts.push(this.checked() ? this.sizing().on : 'translate-x-0.5');
|
|
2283
|
+
parts.push(this.checked() ? 'bg-white dark:bg-surface' : 'bg-white dark:bg-ink-soft');
|
|
2245
2284
|
return parts.join(' ');
|
|
2246
2285
|
}, ...(ngDevMode ? [{ debugName: "knobClasses" }] : []));
|
|
2247
2286
|
constructor() {
|
|
@@ -2314,20 +2353,20 @@ class SdsToggleSwitch {
|
|
|
2314
2353
|
(keydown.space)="onSpace($event)"
|
|
2315
2354
|
>
|
|
2316
2355
|
<span
|
|
2317
|
-
class="pointer-events-none inline-flex items-center justify-center rounded-full
|
|
2356
|
+
class="pointer-events-none inline-flex items-center justify-center rounded-full shadow-sm transition-[transform,background-color]"
|
|
2318
2357
|
[class]="knobClasses()"
|
|
2319
2358
|
>
|
|
2320
2359
|
@if (checked() && onIcon()) {
|
|
2321
2360
|
<sds-icon
|
|
2322
2361
|
[name]="onIcon()!"
|
|
2323
2362
|
[size]="sizing().icon"
|
|
2324
|
-
class="text-brand-600"
|
|
2363
|
+
class="text-brand-600 dark:text-ink"
|
|
2325
2364
|
/>
|
|
2326
2365
|
} @else if (!checked() && offIcon()) {
|
|
2327
2366
|
<sds-icon
|
|
2328
2367
|
[name]="offIcon()!"
|
|
2329
2368
|
[size]="sizing().icon"
|
|
2330
|
-
class="text-ink-faint"
|
|
2369
|
+
class="text-ink-faint dark:text-surface"
|
|
2331
2370
|
/>
|
|
2332
2371
|
}
|
|
2333
2372
|
</span>
|
|
@@ -2390,20 +2429,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2390
2429
|
(keydown.space)="onSpace($event)"
|
|
2391
2430
|
>
|
|
2392
2431
|
<span
|
|
2393
|
-
class="pointer-events-none inline-flex items-center justify-center rounded-full
|
|
2432
|
+
class="pointer-events-none inline-flex items-center justify-center rounded-full shadow-sm transition-[transform,background-color]"
|
|
2394
2433
|
[class]="knobClasses()"
|
|
2395
2434
|
>
|
|
2396
2435
|
@if (checked() && onIcon()) {
|
|
2397
2436
|
<sds-icon
|
|
2398
2437
|
[name]="onIcon()!"
|
|
2399
2438
|
[size]="sizing().icon"
|
|
2400
|
-
class="text-brand-600"
|
|
2439
|
+
class="text-brand-600 dark:text-ink"
|
|
2401
2440
|
/>
|
|
2402
2441
|
} @else if (!checked() && offIcon()) {
|
|
2403
2442
|
<sds-icon
|
|
2404
2443
|
[name]="offIcon()!"
|
|
2405
2444
|
[size]="sizing().icon"
|
|
2406
|
-
class="text-ink-faint"
|
|
2445
|
+
class="text-ink-faint dark:text-surface"
|
|
2407
2446
|
/>
|
|
2408
2447
|
}
|
|
2409
2448
|
</span>
|
|
@@ -2435,17 +2474,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2435
2474
|
}]
|
|
2436
2475
|
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], trueValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "trueValue", required: false }] }], falseValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "falseValue", required: false }] }], onIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "onIcon", required: false }] }], offIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "offIcon", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }] } });
|
|
2437
2476
|
|
|
2438
|
-
let nextId$
|
|
2477
|
+
let nextId$9 = 0;
|
|
2439
2478
|
/**
|
|
2440
2479
|
* Boolean checkbox. Implements ControlValueAccessor — use with reactive forms
|
|
2441
2480
|
* or `[(ngModel)]`. Renders a styled box (brand-filled with a check when on)
|
|
2442
|
-
* and an optional inline label.
|
|
2481
|
+
* and an optional inline label. Without a visible `label` it renders no `<label>`
|
|
2482
|
+
* of its own, so it can sit inside the consumer's `<label>` (a whole clickable
|
|
2483
|
+
* row), whose text then names it.
|
|
2443
2484
|
*
|
|
2444
2485
|
* @example
|
|
2445
2486
|
* <sds-checkbox label="Fusion automatique" [(ngModel)]="autoMerge" />
|
|
2446
2487
|
*/
|
|
2447
2488
|
class SdsCheckbox {
|
|
2448
|
-
id = `sds-checkbox-${nextId$
|
|
2489
|
+
id = `sds-checkbox-${nextId$9++}`;
|
|
2449
2490
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2450
2491
|
/** Accessible name used when no visible [label] is provided. */
|
|
2451
2492
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -2455,6 +2496,7 @@ class SdsCheckbox {
|
|
|
2455
2496
|
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
2456
2497
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
2457
2498
|
iconSize = computed(() => (this.size() === 'sm' ? 11 : 13), ...(ngDevMode ? [{ debugName: "iconSize" }] : []));
|
|
2499
|
+
stateClasses = computed(() => this.isDisabled() ? 'cursor-not-allowed opacity-60' : 'cursor-pointer', ...(ngDevMode ? [{ debugName: "stateClasses" }] : []));
|
|
2458
2500
|
boxClasses = computed(() => {
|
|
2459
2501
|
const size = this.size() === 'sm' ? 'h-4 w-4' : 'h-5 w-5';
|
|
2460
2502
|
const state = this.checked()
|
|
@@ -2491,10 +2533,20 @@ class SdsCheckbox {
|
|
|
2491
2533
|
multi: true,
|
|
2492
2534
|
},
|
|
2493
2535
|
], ngImport: i0, template: `
|
|
2494
|
-
<label
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2536
|
+
<!-- With a visible label the whole thing is a <label>. Without one it is a plain span, so the box can
|
|
2537
|
+
sit inside the consumer's own <label> (a clickable row, say) without nesting labels. -->
|
|
2538
|
+
@if (label()) {
|
|
2539
|
+
<label class="inline-flex select-none items-center gap-2" [class]="stateClasses()">
|
|
2540
|
+
<ng-container [ngTemplateOutlet]="box" />
|
|
2541
|
+
<span class="text-sm text-ink">{{ label() }}</span>
|
|
2542
|
+
</label>
|
|
2543
|
+
} @else {
|
|
2544
|
+
<span class="inline-flex select-none items-center" [class]="stateClasses()">
|
|
2545
|
+
<ng-container [ngTemplateOutlet]="box" />
|
|
2546
|
+
</span>
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
<ng-template #box>
|
|
2498
2550
|
<span
|
|
2499
2551
|
class="relative inline-flex shrink-0 items-center justify-center rounded-control border transition-colors"
|
|
2500
2552
|
[class]="boxClasses()"
|
|
@@ -2513,18 +2565,15 @@ class SdsCheckbox {
|
|
|
2513
2565
|
<sds-icon name="check" [size]="iconSize()" [strokeWidth]="3" />
|
|
2514
2566
|
}
|
|
2515
2567
|
</span>
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
}
|
|
2519
|
-
</label>
|
|
2520
|
-
`, isInline: true, dependencies: [{ kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2568
|
+
</ng-template>
|
|
2569
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2521
2570
|
}
|
|
2522
2571
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsCheckbox, decorators: [{
|
|
2523
2572
|
type: Component,
|
|
2524
2573
|
args: [{
|
|
2525
2574
|
selector: 'sds-checkbox',
|
|
2526
2575
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2527
|
-
imports: [SdsIcon],
|
|
2576
|
+
imports: [SdsIcon, NgTemplateOutlet],
|
|
2528
2577
|
providers: [
|
|
2529
2578
|
{
|
|
2530
2579
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -2534,10 +2583,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2534
2583
|
],
|
|
2535
2584
|
host: { class: 'inline-flex' },
|
|
2536
2585
|
template: `
|
|
2537
|
-
<label
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2586
|
+
<!-- With a visible label the whole thing is a <label>. Without one it is a plain span, so the box can
|
|
2587
|
+
sit inside the consumer's own <label> (a clickable row, say) without nesting labels. -->
|
|
2588
|
+
@if (label()) {
|
|
2589
|
+
<label class="inline-flex select-none items-center gap-2" [class]="stateClasses()">
|
|
2590
|
+
<ng-container [ngTemplateOutlet]="box" />
|
|
2591
|
+
<span class="text-sm text-ink">{{ label() }}</span>
|
|
2592
|
+
</label>
|
|
2593
|
+
} @else {
|
|
2594
|
+
<span class="inline-flex select-none items-center" [class]="stateClasses()">
|
|
2595
|
+
<ng-container [ngTemplateOutlet]="box" />
|
|
2596
|
+
</span>
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
<ng-template #box>
|
|
2541
2600
|
<span
|
|
2542
2601
|
class="relative inline-flex shrink-0 items-center justify-center rounded-control border transition-colors"
|
|
2543
2602
|
[class]="boxClasses()"
|
|
@@ -2556,14 +2615,214 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2556
2615
|
<sds-icon name="check" [size]="iconSize()" [strokeWidth]="3" />
|
|
2557
2616
|
}
|
|
2558
2617
|
</span>
|
|
2559
|
-
|
|
2560
|
-
<span class="text-sm text-ink">{{ label() }}</span>
|
|
2561
|
-
}
|
|
2562
|
-
</label>
|
|
2618
|
+
</ng-template>
|
|
2563
2619
|
`,
|
|
2564
2620
|
}]
|
|
2565
2621
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
2566
2622
|
|
|
2623
|
+
let nextId$8 = 0;
|
|
2624
|
+
/**
|
|
2625
|
+
* Mounted radios by group name. A pick updates the rest of its group, because a native radio says
|
|
2626
|
+
* nothing when the browser unchecks it — without this a reactive form would leave the old choice drawn.
|
|
2627
|
+
*/
|
|
2628
|
+
const groups = new Map();
|
|
2629
|
+
/**
|
|
2630
|
+
* One option of a single-choice group: a styled circle (brand-filled with a dot when on) over a native
|
|
2631
|
+
* radio input, so grouping and keyboard behaviour stay the browser's — radios that share a `name`
|
|
2632
|
+
* move with the arrow keys and only one of them is on.
|
|
2633
|
+
*
|
|
2634
|
+
* Two ways to bind it:
|
|
2635
|
+
* - with forms: every radio of the group gets the same `[(ngModel)]` / `formControlName`, the same
|
|
2636
|
+
* `name` and its own `[value]`; the control holds the value of the selected radio
|
|
2637
|
+
* (ControlValueAccessor, like a native radio);
|
|
2638
|
+
* - without forms: drive `[checked]` yourself and update it from `(selected)`, which emits this radio's
|
|
2639
|
+
* value when the user picks it.
|
|
2640
|
+
*
|
|
2641
|
+
* Like `sds-checkbox`, without a visible `label` it renders no `<label>` of its own, so it can sit
|
|
2642
|
+
* inside the consumer's `<label>` (a whole clickable row), whose text then names it.
|
|
2643
|
+
*
|
|
2644
|
+
* @example
|
|
2645
|
+
* <sds-radio name="size" value="small" label="Petit" [(ngModel)]="size" />
|
|
2646
|
+
* <sds-radio name="size" value="large" label="Grand" [(ngModel)]="size" />
|
|
2647
|
+
*/
|
|
2648
|
+
class SdsRadio {
|
|
2649
|
+
id = `sds-radio-${nextId$8++}`;
|
|
2650
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2651
|
+
/** Accessible name used when no visible [label] is provided. */
|
|
2652
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
2653
|
+
/** The group's name, shared by all its radios (native grouping, arrow keys, and form syncing). */
|
|
2654
|
+
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
2655
|
+
/** What this option stands for: a form control bound to the group holds it while this radio is on. */
|
|
2656
|
+
value = input(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
2657
|
+
/** On/off when used without forms. Ignored once a form control is bound. */
|
|
2658
|
+
checked = input(false, ...(ngDevMode ? [{ debugName: "checked", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
2659
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2660
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
2661
|
+
/** Emits this radio's value when the user picks it. */
|
|
2662
|
+
selected = output();
|
|
2663
|
+
/** The group's current value, once a form control is bound (see {@link registerOnChange}). */
|
|
2664
|
+
modelValue = signal(undefined, ...(ngDevMode ? [{ debugName: "modelValue" }] : []));
|
|
2665
|
+
formBound = signal(false, ...(ngDevMode ? [{ debugName: "formBound" }] : []));
|
|
2666
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
2667
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
2668
|
+
isChecked = computed(() => this.formBound() ? Object.is(this.modelValue(), this.value()) : this.checked(), ...(ngDevMode ? [{ debugName: "isChecked" }] : []));
|
|
2669
|
+
stateClasses = computed(() => this.isDisabled() ? 'cursor-not-allowed opacity-60' : 'cursor-pointer', ...(ngDevMode ? [{ debugName: "stateClasses" }] : []));
|
|
2670
|
+
circleClasses = computed(() => {
|
|
2671
|
+
const size = this.size() === 'sm' ? 'h-4 w-4' : 'h-5 w-5';
|
|
2672
|
+
const state = this.isChecked() ? 'border-brand-600 bg-brand-600' : 'border-border bg-surface';
|
|
2673
|
+
const focus = 'focus-within:ring-2 focus-within:ring-brand-500/30 focus-within:border-brand-500';
|
|
2674
|
+
return `${size} ${state} ${focus}`;
|
|
2675
|
+
}, ...(ngDevMode ? [{ debugName: "circleClasses" }] : []));
|
|
2676
|
+
dotClasses = computed(() => this.size() === 'sm' ? 'h-1.5 w-1.5' : 'h-2 w-2', ...(ngDevMode ? [{ debugName: "dotClasses" }] : []));
|
|
2677
|
+
constructor() {
|
|
2678
|
+
effect((onCleanup) => {
|
|
2679
|
+
const name = this.name();
|
|
2680
|
+
if (!name) {
|
|
2681
|
+
return;
|
|
2682
|
+
}
|
|
2683
|
+
let group = groups.get(name);
|
|
2684
|
+
if (!group) {
|
|
2685
|
+
group = new Set();
|
|
2686
|
+
groups.set(name, group);
|
|
2687
|
+
}
|
|
2688
|
+
group.add(this);
|
|
2689
|
+
onCleanup(() => {
|
|
2690
|
+
group.delete(this);
|
|
2691
|
+
if (group.size === 0) {
|
|
2692
|
+
groups.delete(name);
|
|
2693
|
+
}
|
|
2694
|
+
});
|
|
2695
|
+
});
|
|
2696
|
+
}
|
|
2697
|
+
// --- ControlValueAccessor -------------------------------------------------
|
|
2698
|
+
onChange = () => { };
|
|
2699
|
+
onTouched = () => { };
|
|
2700
|
+
writeValue(value) {
|
|
2701
|
+
this.modelValue.set(value);
|
|
2702
|
+
}
|
|
2703
|
+
registerOnChange(fn) {
|
|
2704
|
+
this.onChange = fn;
|
|
2705
|
+
this.formBound.set(true);
|
|
2706
|
+
}
|
|
2707
|
+
registerOnTouched(fn) {
|
|
2708
|
+
this.onTouched = fn;
|
|
2709
|
+
}
|
|
2710
|
+
setDisabledState(isDisabled) {
|
|
2711
|
+
this.cvaDisabled.set(isDisabled);
|
|
2712
|
+
}
|
|
2713
|
+
/** A native radio only fires `change` when it turns on. */
|
|
2714
|
+
onPick() {
|
|
2715
|
+
const value = this.value();
|
|
2716
|
+
if (this.formBound()) {
|
|
2717
|
+
const name = this.name();
|
|
2718
|
+
for (const radio of (name && groups.get(name)) || [this]) {
|
|
2719
|
+
radio.modelValue.set(value);
|
|
2720
|
+
}
|
|
2721
|
+
this.onChange(value);
|
|
2722
|
+
}
|
|
2723
|
+
this.selected.emit(value);
|
|
2724
|
+
}
|
|
2725
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsRadio, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2726
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsRadio, isStandalone: true, selector: "sds-radio", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, host: { classAttribute: "inline-flex" }, providers: [
|
|
2727
|
+
{
|
|
2728
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2729
|
+
useExisting: forwardRef(() => SdsRadio),
|
|
2730
|
+
multi: true,
|
|
2731
|
+
},
|
|
2732
|
+
], ngImport: i0, template: `
|
|
2733
|
+
@if (label()) {
|
|
2734
|
+
<label class="inline-flex select-none items-center gap-2" [class]="stateClasses()">
|
|
2735
|
+
<ng-container [ngTemplateOutlet]="circle" />
|
|
2736
|
+
<span class="text-sm text-ink">{{ label() }}</span>
|
|
2737
|
+
</label>
|
|
2738
|
+
} @else {
|
|
2739
|
+
<span class="inline-flex select-none items-center" [class]="stateClasses()">
|
|
2740
|
+
<ng-container [ngTemplateOutlet]="circle" />
|
|
2741
|
+
</span>
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
<ng-template #circle>
|
|
2745
|
+
<span
|
|
2746
|
+
class="relative inline-flex shrink-0 items-center justify-center rounded-full border transition-colors"
|
|
2747
|
+
[class]="circleClasses()"
|
|
2748
|
+
>
|
|
2749
|
+
<input
|
|
2750
|
+
type="radio"
|
|
2751
|
+
class="absolute inset-0 m-0 cursor-[inherit] opacity-0"
|
|
2752
|
+
[id]="id"
|
|
2753
|
+
[attr.name]="name() || null"
|
|
2754
|
+
[checked]="isChecked()"
|
|
2755
|
+
[disabled]="isDisabled()"
|
|
2756
|
+
[attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
|
|
2757
|
+
(change)="onPick()"
|
|
2758
|
+
(blur)="onTouched()"
|
|
2759
|
+
/>
|
|
2760
|
+
@if (isChecked()) {
|
|
2761
|
+
<span
|
|
2762
|
+
class="pointer-events-none rounded-full bg-white"
|
|
2763
|
+
[class]="dotClasses()"
|
|
2764
|
+
aria-hidden="true"
|
|
2765
|
+
></span>
|
|
2766
|
+
}
|
|
2767
|
+
</span>
|
|
2768
|
+
</ng-template>
|
|
2769
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2770
|
+
}
|
|
2771
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsRadio, decorators: [{
|
|
2772
|
+
type: Component,
|
|
2773
|
+
args: [{
|
|
2774
|
+
selector: 'sds-radio',
|
|
2775
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2776
|
+
imports: [NgTemplateOutlet],
|
|
2777
|
+
providers: [
|
|
2778
|
+
{
|
|
2779
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2780
|
+
useExisting: forwardRef(() => SdsRadio),
|
|
2781
|
+
multi: true,
|
|
2782
|
+
},
|
|
2783
|
+
],
|
|
2784
|
+
host: { class: 'inline-flex' },
|
|
2785
|
+
template: `
|
|
2786
|
+
@if (label()) {
|
|
2787
|
+
<label class="inline-flex select-none items-center gap-2" [class]="stateClasses()">
|
|
2788
|
+
<ng-container [ngTemplateOutlet]="circle" />
|
|
2789
|
+
<span class="text-sm text-ink">{{ label() }}</span>
|
|
2790
|
+
</label>
|
|
2791
|
+
} @else {
|
|
2792
|
+
<span class="inline-flex select-none items-center" [class]="stateClasses()">
|
|
2793
|
+
<ng-container [ngTemplateOutlet]="circle" />
|
|
2794
|
+
</span>
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
<ng-template #circle>
|
|
2798
|
+
<span
|
|
2799
|
+
class="relative inline-flex shrink-0 items-center justify-center rounded-full border transition-colors"
|
|
2800
|
+
[class]="circleClasses()"
|
|
2801
|
+
>
|
|
2802
|
+
<input
|
|
2803
|
+
type="radio"
|
|
2804
|
+
class="absolute inset-0 m-0 cursor-[inherit] opacity-0"
|
|
2805
|
+
[id]="id"
|
|
2806
|
+
[attr.name]="name() || null"
|
|
2807
|
+
[checked]="isChecked()"
|
|
2808
|
+
[disabled]="isDisabled()"
|
|
2809
|
+
[attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
|
|
2810
|
+
(change)="onPick()"
|
|
2811
|
+
(blur)="onTouched()"
|
|
2812
|
+
/>
|
|
2813
|
+
@if (isChecked()) {
|
|
2814
|
+
<span
|
|
2815
|
+
class="pointer-events-none rounded-full bg-white"
|
|
2816
|
+
[class]="dotClasses()"
|
|
2817
|
+
aria-hidden="true"
|
|
2818
|
+
></span>
|
|
2819
|
+
}
|
|
2820
|
+
</span>
|
|
2821
|
+
</ng-template>
|
|
2822
|
+
`,
|
|
2823
|
+
}]
|
|
2824
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] } });
|
|
2825
|
+
|
|
2567
2826
|
const STATUS_COLOR = {
|
|
2568
2827
|
online: 'bg-success',
|
|
2569
2828
|
offline: 'bg-ink-faint',
|
|
@@ -9332,6 +9591,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
9332
9591
|
* for the slow drifting brand blobs behind the page. Both read the brand ramp, so they follow the active
|
|
9333
9592
|
* theme and dark mode, and the decorations respect prefers-reduced-motion.
|
|
9334
9593
|
*
|
|
9594
|
+
* Page overlays (drawers, dialogs) can be rendered anywhere in the page: `<main>` is not a stacking
|
|
9595
|
+
* context, so a `fixed` overlay with a z-index above the top bar's (z-30) covers the top bar too.
|
|
9596
|
+
*
|
|
9335
9597
|
* @example
|
|
9336
9598
|
* <sds-shell background="gradient" decorations>
|
|
9337
9599
|
* <sds-topbar appearance="glass" sdsTopbar … />
|
|
@@ -9343,27 +9605,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
9343
9605
|
class SdsShell {
|
|
9344
9606
|
/** `plain` flat canvas (default) or a soft brand-tinted `gradient` wash. */
|
|
9345
9607
|
background = input('plain', ...(ngDevMode ? [{ debugName: "background" }] : []));
|
|
9346
|
-
/** Add slow-drifting brand-tinted blobs behind the page content (opt-in). */
|
|
9608
|
+
/** Add slow-drifting brand-tinted blobs behind the page content (opt-in). They stay in place while the page scrolls. */
|
|
9347
9609
|
decorations = input(false, ...(ngDevMode ? [{ debugName: "decorations", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
9348
|
-
|
|
9610
|
+
areaClass = computed(() => this.background() === 'gradient'
|
|
9349
9611
|
? 'bg-linear-to-br from-brand-50/50 via-canvas to-brand-100/40'
|
|
9350
|
-
: 'bg-canvas', ...(ngDevMode ? [{ debugName: "
|
|
9612
|
+
: 'bg-canvas', ...(ngDevMode ? [{ debugName: "areaClass" }] : []));
|
|
9351
9613
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsShell, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9352
9614
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsShell, isStandalone: true, selector: "sds-shell", inputs: { background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, decorations: { classPropertyName: "decorations", publicName: "decorations", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block" }, ngImport: i0, template: `
|
|
9353
9615
|
<div class="flex h-screen flex-col overflow-hidden">
|
|
9354
9616
|
<ng-content select="[sdsTopbar]" />
|
|
9355
9617
|
<div class="flex min-h-0 flex-1">
|
|
9356
9618
|
<ng-content select="[sdsSidebar]" />
|
|
9357
|
-
|
|
9619
|
+
<!--
|
|
9620
|
+
The content area carries the background and the ambient blobs; the scrolling <main> sits on top,
|
|
9621
|
+
transparent. <main> is positioned but never a stacking context (no isolate, no z-index): one would
|
|
9622
|
+
trap a page's own overlays — drawers, dialogs, fixed popovers — under the top bar (z-30) however
|
|
9623
|
+
high their z-index. Same pattern as the top bar and sidebar decorations: the blob layer comes first
|
|
9624
|
+
with no z-index, so the positioned <main> after it paints above it.
|
|
9625
|
+
-->
|
|
9626
|
+
<div class="relative flex min-w-0 flex-1" [class]="areaClass()">
|
|
9358
9627
|
@if (decorations()) {
|
|
9359
|
-
<div class="pointer-events-none absolute inset-0
|
|
9628
|
+
<div class="pointer-events-none absolute inset-0 overflow-hidden" aria-hidden="true">
|
|
9360
9629
|
<div class="absolute -left-32 top-10 h-96 w-96 rounded-full bg-brand-300/15 blur-3xl animate-sds-ambient"></div>
|
|
9361
9630
|
<div class="absolute -right-40 top-1/3 h-[28rem] w-[28rem] rounded-full bg-brand-400/12 blur-3xl animate-sds-ambient [animation-delay:4s]"></div>
|
|
9362
9631
|
<div class="absolute bottom-10 left-1/4 h-80 w-80 rounded-full bg-brand-200/20 blur-3xl animate-sds-ambient [animation-delay:7s]"></div>
|
|
9363
9632
|
</div>
|
|
9364
9633
|
}
|
|
9365
|
-
<
|
|
9366
|
-
|
|
9634
|
+
<main class="relative min-w-0 flex-1 overflow-y-auto">
|
|
9635
|
+
<ng-content />
|
|
9636
|
+
</main>
|
|
9637
|
+
</div>
|
|
9367
9638
|
</div>
|
|
9368
9639
|
</div>
|
|
9369
9640
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -9379,16 +9650,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
9379
9650
|
<ng-content select="[sdsTopbar]" />
|
|
9380
9651
|
<div class="flex min-h-0 flex-1">
|
|
9381
9652
|
<ng-content select="[sdsSidebar]" />
|
|
9382
|
-
|
|
9653
|
+
<!--
|
|
9654
|
+
The content area carries the background and the ambient blobs; the scrolling <main> sits on top,
|
|
9655
|
+
transparent. <main> is positioned but never a stacking context (no isolate, no z-index): one would
|
|
9656
|
+
trap a page's own overlays — drawers, dialogs, fixed popovers — under the top bar (z-30) however
|
|
9657
|
+
high their z-index. Same pattern as the top bar and sidebar decorations: the blob layer comes first
|
|
9658
|
+
with no z-index, so the positioned <main> after it paints above it.
|
|
9659
|
+
-->
|
|
9660
|
+
<div class="relative flex min-w-0 flex-1" [class]="areaClass()">
|
|
9383
9661
|
@if (decorations()) {
|
|
9384
|
-
<div class="pointer-events-none absolute inset-0
|
|
9662
|
+
<div class="pointer-events-none absolute inset-0 overflow-hidden" aria-hidden="true">
|
|
9385
9663
|
<div class="absolute -left-32 top-10 h-96 w-96 rounded-full bg-brand-300/15 blur-3xl animate-sds-ambient"></div>
|
|
9386
9664
|
<div class="absolute -right-40 top-1/3 h-[28rem] w-[28rem] rounded-full bg-brand-400/12 blur-3xl animate-sds-ambient [animation-delay:4s]"></div>
|
|
9387
9665
|
<div class="absolute bottom-10 left-1/4 h-80 w-80 rounded-full bg-brand-200/20 blur-3xl animate-sds-ambient [animation-delay:7s]"></div>
|
|
9388
9666
|
</div>
|
|
9389
9667
|
}
|
|
9390
|
-
<
|
|
9391
|
-
|
|
9668
|
+
<main class="relative min-w-0 flex-1 overflow-y-auto">
|
|
9669
|
+
<ng-content />
|
|
9670
|
+
</main>
|
|
9671
|
+
</div>
|
|
9392
9672
|
</div>
|
|
9393
9673
|
</div>
|
|
9394
9674
|
`,
|
|
@@ -11257,5 +11537,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
11257
11537
|
* Generated bundle index. Do not edit.
|
|
11258
11538
|
*/
|
|
11259
11539
|
|
|
11260
|
-
export { SDS_ICONS, SDS_PHONE_COUNTRIES, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAvatar, SdsBadge, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsDatePicker, SdsIcon, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenuItem, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsSearchCommand, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsShell, SdsSidebar, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsThemeService, SdsThemeToggle, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SdsUserMenu, SidebarStore, addDays, addMonths, addMonthsKeepDay, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isoDay, pad2, sdsFormatNational, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth };
|
|
11540
|
+
export { SDS_ICONS, SDS_PHONE_COUNTRIES, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAvatar, SdsBadge, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsDatePicker, SdsIcon, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenuItem, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsRadio, SdsSearchCommand, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsShell, SdsSidebar, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsThemeService, SdsThemeToggle, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SdsUserMenu, SidebarStore, addDays, addMonths, addMonthsKeepDay, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isoDay, pad2, sdsFormatNational, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth };
|
|
11261
11541
|
//# sourceMappingURL=besaitech-ng-design-system.mjs.map
|