@besaitech/ng-design-system 0.0.49 → 0.0.51
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"/>',
|
|
@@ -160,12 +163,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
160
163
|
const BASE = 'inline-flex items-center justify-center gap-2 font-medium ' +
|
|
161
164
|
'transition-colors duration-150 select-none whitespace-nowrap cursor-pointer ' +
|
|
162
165
|
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 ' +
|
|
163
|
-
'focus-visible:ring-
|
|
166
|
+
'focus-visible:ring-offset-surface focus-visible:ring-brand-500 ' +
|
|
167
|
+
'disabled:opacity-50 disabled:pointer-events-none';
|
|
168
|
+
/**
|
|
169
|
+
* Dark mode has its own fills. A monochrome brand's dark 600 step is a mid-dark grey: as a primary fill
|
|
170
|
+
* it read as disabled, and at `disabled:opacity-50` the real disabled state looked the same. So the dark
|
|
171
|
+
* primary is the inverted light fill (`ink` on `surface`); tertiary and ghost swap their black/brand-50
|
|
172
|
+
* tints for white ones, which show on a dark surface.
|
|
173
|
+
*/
|
|
164
174
|
const VARIANTS$2 = {
|
|
165
|
-
primary: 'bg-brand-600 text-white shadow-sm hover:bg-brand-700 active:bg-brand-800'
|
|
175
|
+
primary: 'bg-brand-600 text-white shadow-sm hover:bg-brand-700 active:bg-brand-800 ' +
|
|
176
|
+
'dark:bg-ink dark:text-surface dark:hover:bg-ink/90 dark:active:bg-ink/80',
|
|
166
177
|
secondary: 'bg-surface text-ink border border-border shadow-sm hover:bg-muted active:bg-brand-50',
|
|
167
|
-
tertiary: 'bg-brand-50 text-brand-700 hover:bg-brand-100 active:bg-brand-200/70'
|
|
168
|
-
|
|
178
|
+
tertiary: 'bg-brand-50 text-brand-700 hover:bg-brand-100 active:bg-brand-200/70 ' +
|
|
179
|
+
'dark:bg-white/10 dark:text-ink dark:hover:bg-white/15 dark:active:bg-white/20',
|
|
180
|
+
ghost: 'bg-transparent text-ink-soft hover:bg-black/5 active:bg-black/10 ' +
|
|
181
|
+
'dark:hover:bg-white/10 dark:active:bg-white/15',
|
|
169
182
|
danger: 'bg-danger text-white shadow-sm hover:brightness-95 active:brightness-90',
|
|
170
183
|
};
|
|
171
184
|
const SIZES$b = {
|
|
@@ -280,7 +293,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
280
293
|
`, 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"] }]
|
|
281
294
|
}], 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 }] }] } });
|
|
282
295
|
|
|
283
|
-
let nextId$
|
|
296
|
+
let nextId$f = 0;
|
|
284
297
|
const SIZES$a = {
|
|
285
298
|
sm: 'h-9 text-sm',
|
|
286
299
|
md: 'h-10 text-sm',
|
|
@@ -293,7 +306,7 @@ const SIZES$a = {
|
|
|
293
306
|
* sidebar search field).
|
|
294
307
|
*/
|
|
295
308
|
class SdsInput {
|
|
296
|
-
inputId = `sds-input-${nextId$
|
|
309
|
+
inputId = `sds-input-${nextId$f++}`;
|
|
297
310
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
298
311
|
/** Accessible name used when no visible [label] is provided. */
|
|
299
312
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -321,6 +334,14 @@ class SdsInput {
|
|
|
321
334
|
shape = input('control', ...(ngDevMode ? [{ debugName: "shape" }] : []));
|
|
322
335
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
323
336
|
clearable = input(false, ...(ngDevMode ? [{ debugName: "clearable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
337
|
+
/**
|
|
338
|
+
* The native `autocomplete` token (`name`, `tel`, `email`, `new-password`, `one-time-code`…). Empty
|
|
339
|
+
* leaves the browser's default. Checkout and sign-up fields need it: browsers autofill from it, and
|
|
340
|
+
* password managers only offer a generated password for `new-password`.
|
|
341
|
+
*/
|
|
342
|
+
autocomplete = input('', ...(ngDevMode ? [{ debugName: "autocomplete" }] : []));
|
|
343
|
+
/** Hard character cap on the native field; 0 means no limit. */
|
|
344
|
+
maxLength = input(0, ...(ngDevMode ? [{ debugName: "maxLength", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
324
345
|
/**
|
|
325
346
|
* Accessible name for the clear button. French default so existing consumers are unchanged, but an
|
|
326
347
|
* app serving more than one language MUST translate it — it is an icon-only control, so this string
|
|
@@ -421,7 +442,7 @@ class SdsInput {
|
|
|
421
442
|
this.onTouched();
|
|
422
443
|
}
|
|
423
444
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
424
|
-
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: [
|
|
445
|
+
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: [
|
|
425
446
|
{
|
|
426
447
|
provide: NG_VALUE_ACCESSOR,
|
|
427
448
|
useExisting: forwardRef(() => SdsInput),
|
|
@@ -459,6 +480,8 @@ class SdsInput {
|
|
|
459
480
|
[placeholder]="placeholder()"
|
|
460
481
|
[disabled]="isDisabled()"
|
|
461
482
|
[value]="value()"
|
|
483
|
+
[attr.autocomplete]="autocomplete() || null"
|
|
484
|
+
[attr.maxlength]="maxLength() || null"
|
|
462
485
|
[attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
|
|
463
486
|
[attr.aria-invalid]="error() ? 'true' : null"
|
|
464
487
|
[attr.aria-describedby]="describedBy()"
|
|
@@ -556,6 +579,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
556
579
|
[placeholder]="placeholder()"
|
|
557
580
|
[disabled]="isDisabled()"
|
|
558
581
|
[value]="value()"
|
|
582
|
+
[attr.autocomplete]="autocomplete() || null"
|
|
583
|
+
[attr.maxlength]="maxLength() || null"
|
|
559
584
|
[attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
|
|
560
585
|
[attr.aria-invalid]="error() ? 'true' : null"
|
|
561
586
|
[attr.aria-describedby]="describedBy()"
|
|
@@ -612,9 +637,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
612
637
|
</p>
|
|
613
638
|
}
|
|
614
639
|
`, 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"] }]
|
|
615
|
-
}], 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"] }] } });
|
|
640
|
+
}], 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"] }] } });
|
|
616
641
|
|
|
617
|
-
let nextId$
|
|
642
|
+
let nextId$e = 0;
|
|
618
643
|
const HEIGHTS = {
|
|
619
644
|
sm: 'h-9',
|
|
620
645
|
md: 'h-10',
|
|
@@ -637,7 +662,7 @@ const TEXT = {
|
|
|
637
662
|
* {@link min}/{@link max} on blur and on every spinner step; ArrowUp / ArrowDown also step it.
|
|
638
663
|
*/
|
|
639
664
|
class SdsInputNumber {
|
|
640
|
-
inputId = `sds-input-number-${nextId$
|
|
665
|
+
inputId = `sds-input-number-${nextId$e++}`;
|
|
641
666
|
fieldRef = viewChild('field', ...(ngDevMode ? [{ debugName: "fieldRef" }] : []));
|
|
642
667
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
643
668
|
/** Accessible name used when no visible [label] is provided. */
|
|
@@ -1344,7 +1369,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1344
1369
|
}]
|
|
1345
1370
|
}], 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 }] }] } });
|
|
1346
1371
|
|
|
1347
|
-
let nextId$
|
|
1372
|
+
let nextId$d = 0;
|
|
1348
1373
|
const SIZES$9 = {
|
|
1349
1374
|
sm: 'min-h-9 text-sm',
|
|
1350
1375
|
md: 'min-h-10 text-sm',
|
|
@@ -1364,7 +1389,7 @@ const SIZES$9 = {
|
|
|
1364
1389
|
* `<sds-localized-input [languages]="['fr','nl','en']" [(ngModel)]="title" />`.
|
|
1365
1390
|
*/
|
|
1366
1391
|
class SdsLocalizedInput {
|
|
1367
|
-
inputId = `sds-localized-input-${nextId$
|
|
1392
|
+
inputId = `sds-localized-input-${nextId$d++}`;
|
|
1368
1393
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1369
1394
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1370
1395
|
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
@@ -1620,7 +1645,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1620
1645
|
}]
|
|
1621
1646
|
}], 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 }] }] } });
|
|
1622
1647
|
|
|
1623
|
-
let nextId$
|
|
1648
|
+
let nextId$c = 0;
|
|
1624
1649
|
const SIZES$8 = {
|
|
1625
1650
|
md: 'h-12 w-11 text-lg',
|
|
1626
1651
|
lg: 'h-14 w-12 text-xl',
|
|
@@ -1637,7 +1662,7 @@ const SIZES$8 = {
|
|
|
1637
1662
|
* first box and have it land correctly.
|
|
1638
1663
|
*/
|
|
1639
1664
|
class SdsOtpInput {
|
|
1640
|
-
groupId = `sds-otp-${nextId$
|
|
1665
|
+
groupId = `sds-otp-${nextId$c++}`;
|
|
1641
1666
|
/** How many boxes / characters the code has. */
|
|
1642
1667
|
length = input(6, ...(ngDevMode ? [{ debugName: "length", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
1643
1668
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
@@ -1937,7 +1962,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1937
1962
|
}]
|
|
1938
1963
|
}], 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 }] }] } });
|
|
1939
1964
|
|
|
1940
|
-
let nextId$
|
|
1965
|
+
let nextId$b = 0;
|
|
1941
1966
|
const SIZES$7 = {
|
|
1942
1967
|
sm: 'text-sm px-3 py-2',
|
|
1943
1968
|
md: 'text-sm px-3.5 py-2.5',
|
|
@@ -1949,7 +1974,7 @@ const SIZES$7 = {
|
|
|
1949
1974
|
* [(ngModel)].
|
|
1950
1975
|
*/
|
|
1951
1976
|
class SdsTextarea {
|
|
1952
|
-
fieldId = `sds-textarea-${nextId$
|
|
1977
|
+
fieldId = `sds-textarea-${nextId$b++}`;
|
|
1953
1978
|
field = viewChild('field', ...(ngDevMode ? [{ debugName: "field" }] : []));
|
|
1954
1979
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1955
1980
|
/** Accessible name used when no visible [label] is provided. */
|
|
@@ -1958,6 +1983,11 @@ class SdsTextarea {
|
|
|
1958
1983
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1959
1984
|
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
1960
1985
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1986
|
+
/**
|
|
1987
|
+
* `filled` is a borderless field on a muted ground — the textarea counterpart of `sds-input`'s
|
|
1988
|
+
* `filled`, so a form that uses filled inputs keeps one look down to its notes field.
|
|
1989
|
+
*/
|
|
1990
|
+
appearance = input('default', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
1961
1991
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
1962
1992
|
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
1963
1993
|
required = input(false, ...(ngDevMode ? [{ debugName: "required", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
@@ -1992,14 +2022,24 @@ class SdsTextarea {
|
|
|
1992
2022
|
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : []));
|
|
1993
2023
|
fieldClasses = computed(() => {
|
|
1994
2024
|
const parts = [
|
|
1995
|
-
'block w-full rounded-control border
|
|
2025
|
+
'block w-full rounded-control border text-ink outline-none transition-colors placeholder:text-ink-faint',
|
|
1996
2026
|
SIZES$7[this.size()],
|
|
1997
2027
|
];
|
|
1998
2028
|
if (this.autoResize())
|
|
1999
2029
|
parts.push('overflow-hidden');
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2030
|
+
if (this.appearance() === 'filled') {
|
|
2031
|
+
// border-transparent, not border-0, for the same reason as sds-input's filled: one box model.
|
|
2032
|
+
parts.push('bg-muted');
|
|
2033
|
+
parts.push(this.error()
|
|
2034
|
+
? 'border-danger focus:ring-2 focus:ring-danger/30'
|
|
2035
|
+
: 'border-transparent focus:ring-2 focus:ring-brand-500/25');
|
|
2036
|
+
}
|
|
2037
|
+
else {
|
|
2038
|
+
parts.push('bg-surface');
|
|
2039
|
+
parts.push(this.error()
|
|
2040
|
+
? 'border-danger focus:border-danger focus:ring-2 focus:ring-danger/25'
|
|
2041
|
+
: 'border-border focus:border-brand-500 focus:ring-2 focus:ring-brand-500/25');
|
|
2042
|
+
}
|
|
2003
2043
|
if (this.isDisabled())
|
|
2004
2044
|
parts.push('opacity-60 cursor-not-allowed');
|
|
2005
2045
|
return parts.join(' ');
|
|
@@ -2046,7 +2086,7 @@ class SdsTextarea {
|
|
|
2046
2086
|
el.style.height = `${el.scrollHeight}px`;
|
|
2047
2087
|
}
|
|
2048
2088
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsTextarea, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2049
|
-
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: [
|
|
2089
|
+
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: [
|
|
2050
2090
|
{
|
|
2051
2091
|
provide: NG_VALUE_ACCESSOR,
|
|
2052
2092
|
useExisting: forwardRef(() => SdsTextarea),
|
|
@@ -2185,9 +2225,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2185
2225
|
}
|
|
2186
2226
|
`,
|
|
2187
2227
|
}]
|
|
2188
|
-
}], 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 }] }] } });
|
|
2228
|
+
}], 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 }] }] } });
|
|
2189
2229
|
|
|
2190
|
-
let nextId$
|
|
2230
|
+
let nextId$a = 0;
|
|
2191
2231
|
const SIZES$6 = {
|
|
2192
2232
|
sm: { track: 'h-5 w-9', knob: 'h-4 w-4', on: 'translate-x-4', icon: 11 },
|
|
2193
2233
|
md: { track: 'h-6 w-11', knob: 'h-5 w-5', on: 'translate-x-5', icon: 13 },
|
|
@@ -2200,7 +2240,7 @@ const SIZES$6 = {
|
|
|
2200
2240
|
* states.
|
|
2201
2241
|
*/
|
|
2202
2242
|
class SdsToggleSwitch {
|
|
2203
|
-
fieldId = `sds-toggle-switch-${nextId$
|
|
2243
|
+
fieldId = `sds-toggle-switch-${nextId$a++}`;
|
|
2204
2244
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2205
2245
|
/** Accessible name used when no visible [label] is provided. */
|
|
2206
2246
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -2236,14 +2276,21 @@ class SdsToggleSwitch {
|
|
|
2236
2276
|
return `${this.fieldId}-hint`;
|
|
2237
2277
|
return null;
|
|
2238
2278
|
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : []));
|
|
2279
|
+
/**
|
|
2280
|
+
* On/off must read at a glance in both modes. In light mode the brand track against a pale grey one does
|
|
2281
|
+
* it. In dark mode a monochrome brand's 600 step is a mid-dark grey, as dim as the off track, so there
|
|
2282
|
+
* "on" flips to a light track with a dark knob and "off" keeps a dim track with a muted knob. `ink` (not
|
|
2283
|
+
* black) tints the off track so it stays visible on dark surfaces too.
|
|
2284
|
+
*/
|
|
2239
2285
|
trackClasses = computed(() => {
|
|
2240
2286
|
const parts = [this.sizing().track];
|
|
2241
|
-
parts.push(this.checked() ? 'bg-brand-600' : 'bg-
|
|
2287
|
+
parts.push(this.checked() ? 'bg-brand-600 dark:bg-ink' : 'bg-ink/15');
|
|
2242
2288
|
return parts.join(' ');
|
|
2243
2289
|
}, ...(ngDevMode ? [{ debugName: "trackClasses" }] : []));
|
|
2244
2290
|
knobClasses = computed(() => {
|
|
2245
2291
|
const parts = [this.sizing().knob];
|
|
2246
2292
|
parts.push(this.checked() ? this.sizing().on : 'translate-x-0.5');
|
|
2293
|
+
parts.push(this.checked() ? 'bg-white dark:bg-surface' : 'bg-white dark:bg-ink-soft');
|
|
2247
2294
|
return parts.join(' ');
|
|
2248
2295
|
}, ...(ngDevMode ? [{ debugName: "knobClasses" }] : []));
|
|
2249
2296
|
constructor() {
|
|
@@ -2316,20 +2363,20 @@ class SdsToggleSwitch {
|
|
|
2316
2363
|
(keydown.space)="onSpace($event)"
|
|
2317
2364
|
>
|
|
2318
2365
|
<span
|
|
2319
|
-
class="pointer-events-none inline-flex items-center justify-center rounded-full
|
|
2366
|
+
class="pointer-events-none inline-flex items-center justify-center rounded-full shadow-sm transition-[transform,background-color]"
|
|
2320
2367
|
[class]="knobClasses()"
|
|
2321
2368
|
>
|
|
2322
2369
|
@if (checked() && onIcon()) {
|
|
2323
2370
|
<sds-icon
|
|
2324
2371
|
[name]="onIcon()!"
|
|
2325
2372
|
[size]="sizing().icon"
|
|
2326
|
-
class="text-brand-600"
|
|
2373
|
+
class="text-brand-600 dark:text-ink"
|
|
2327
2374
|
/>
|
|
2328
2375
|
} @else if (!checked() && offIcon()) {
|
|
2329
2376
|
<sds-icon
|
|
2330
2377
|
[name]="offIcon()!"
|
|
2331
2378
|
[size]="sizing().icon"
|
|
2332
|
-
class="text-ink-faint"
|
|
2379
|
+
class="text-ink-faint dark:text-surface"
|
|
2333
2380
|
/>
|
|
2334
2381
|
}
|
|
2335
2382
|
</span>
|
|
@@ -2392,20 +2439,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2392
2439
|
(keydown.space)="onSpace($event)"
|
|
2393
2440
|
>
|
|
2394
2441
|
<span
|
|
2395
|
-
class="pointer-events-none inline-flex items-center justify-center rounded-full
|
|
2442
|
+
class="pointer-events-none inline-flex items-center justify-center rounded-full shadow-sm transition-[transform,background-color]"
|
|
2396
2443
|
[class]="knobClasses()"
|
|
2397
2444
|
>
|
|
2398
2445
|
@if (checked() && onIcon()) {
|
|
2399
2446
|
<sds-icon
|
|
2400
2447
|
[name]="onIcon()!"
|
|
2401
2448
|
[size]="sizing().icon"
|
|
2402
|
-
class="text-brand-600"
|
|
2449
|
+
class="text-brand-600 dark:text-ink"
|
|
2403
2450
|
/>
|
|
2404
2451
|
} @else if (!checked() && offIcon()) {
|
|
2405
2452
|
<sds-icon
|
|
2406
2453
|
[name]="offIcon()!"
|
|
2407
2454
|
[size]="sizing().icon"
|
|
2408
|
-
class="text-ink-faint"
|
|
2455
|
+
class="text-ink-faint dark:text-surface"
|
|
2409
2456
|
/>
|
|
2410
2457
|
}
|
|
2411
2458
|
</span>
|
|
@@ -2437,17 +2484,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2437
2484
|
}]
|
|
2438
2485
|
}], 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 }] }] } });
|
|
2439
2486
|
|
|
2440
|
-
let nextId$
|
|
2487
|
+
let nextId$9 = 0;
|
|
2441
2488
|
/**
|
|
2442
2489
|
* Boolean checkbox. Implements ControlValueAccessor — use with reactive forms
|
|
2443
2490
|
* or `[(ngModel)]`. Renders a styled box (brand-filled with a check when on)
|
|
2444
|
-
* and an optional inline label.
|
|
2491
|
+
* and an optional inline label. Without a visible `label` it renders no `<label>`
|
|
2492
|
+
* of its own, so it can sit inside the consumer's `<label>` (a whole clickable
|
|
2493
|
+
* row), whose text then names it.
|
|
2445
2494
|
*
|
|
2446
2495
|
* @example
|
|
2447
2496
|
* <sds-checkbox label="Fusion automatique" [(ngModel)]="autoMerge" />
|
|
2448
2497
|
*/
|
|
2449
2498
|
class SdsCheckbox {
|
|
2450
|
-
id = `sds-checkbox-${nextId$
|
|
2499
|
+
id = `sds-checkbox-${nextId$9++}`;
|
|
2451
2500
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2452
2501
|
/** Accessible name used when no visible [label] is provided. */
|
|
2453
2502
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -2457,6 +2506,7 @@ class SdsCheckbox {
|
|
|
2457
2506
|
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
2458
2507
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
2459
2508
|
iconSize = computed(() => (this.size() === 'sm' ? 11 : 13), ...(ngDevMode ? [{ debugName: "iconSize" }] : []));
|
|
2509
|
+
stateClasses = computed(() => this.isDisabled() ? 'cursor-not-allowed opacity-60' : 'cursor-pointer', ...(ngDevMode ? [{ debugName: "stateClasses" }] : []));
|
|
2460
2510
|
boxClasses = computed(() => {
|
|
2461
2511
|
const size = this.size() === 'sm' ? 'h-4 w-4' : 'h-5 w-5';
|
|
2462
2512
|
const state = this.checked()
|
|
@@ -2493,10 +2543,20 @@ class SdsCheckbox {
|
|
|
2493
2543
|
multi: true,
|
|
2494
2544
|
},
|
|
2495
2545
|
], ngImport: i0, template: `
|
|
2496
|
-
<label
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2546
|
+
<!-- With a visible label the whole thing is a <label>. Without one it is a plain span, so the box can
|
|
2547
|
+
sit inside the consumer's own <label> (a clickable row, say) without nesting labels. -->
|
|
2548
|
+
@if (label()) {
|
|
2549
|
+
<label class="inline-flex select-none items-center gap-2" [class]="stateClasses()">
|
|
2550
|
+
<ng-container [ngTemplateOutlet]="box" />
|
|
2551
|
+
<span class="text-sm text-ink">{{ label() }}</span>
|
|
2552
|
+
</label>
|
|
2553
|
+
} @else {
|
|
2554
|
+
<span class="inline-flex select-none items-center" [class]="stateClasses()">
|
|
2555
|
+
<ng-container [ngTemplateOutlet]="box" />
|
|
2556
|
+
</span>
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
<ng-template #box>
|
|
2500
2560
|
<span
|
|
2501
2561
|
class="relative inline-flex shrink-0 items-center justify-center rounded-control border transition-colors"
|
|
2502
2562
|
[class]="boxClasses()"
|
|
@@ -2515,18 +2575,15 @@ class SdsCheckbox {
|
|
|
2515
2575
|
<sds-icon name="check" [size]="iconSize()" [strokeWidth]="3" />
|
|
2516
2576
|
}
|
|
2517
2577
|
</span>
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
}
|
|
2521
|
-
</label>
|
|
2522
|
-
`, isInline: true, dependencies: [{ kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2578
|
+
</ng-template>
|
|
2579
|
+
`, 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 });
|
|
2523
2580
|
}
|
|
2524
2581
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsCheckbox, decorators: [{
|
|
2525
2582
|
type: Component,
|
|
2526
2583
|
args: [{
|
|
2527
2584
|
selector: 'sds-checkbox',
|
|
2528
2585
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2529
|
-
imports: [SdsIcon],
|
|
2586
|
+
imports: [SdsIcon, NgTemplateOutlet],
|
|
2530
2587
|
providers: [
|
|
2531
2588
|
{
|
|
2532
2589
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -2536,10 +2593,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2536
2593
|
],
|
|
2537
2594
|
host: { class: 'inline-flex' },
|
|
2538
2595
|
template: `
|
|
2539
|
-
<label
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2596
|
+
<!-- With a visible label the whole thing is a <label>. Without one it is a plain span, so the box can
|
|
2597
|
+
sit inside the consumer's own <label> (a clickable row, say) without nesting labels. -->
|
|
2598
|
+
@if (label()) {
|
|
2599
|
+
<label class="inline-flex select-none items-center gap-2" [class]="stateClasses()">
|
|
2600
|
+
<ng-container [ngTemplateOutlet]="box" />
|
|
2601
|
+
<span class="text-sm text-ink">{{ label() }}</span>
|
|
2602
|
+
</label>
|
|
2603
|
+
} @else {
|
|
2604
|
+
<span class="inline-flex select-none items-center" [class]="stateClasses()">
|
|
2605
|
+
<ng-container [ngTemplateOutlet]="box" />
|
|
2606
|
+
</span>
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
<ng-template #box>
|
|
2543
2610
|
<span
|
|
2544
2611
|
class="relative inline-flex shrink-0 items-center justify-center rounded-control border transition-colors"
|
|
2545
2612
|
[class]="boxClasses()"
|
|
@@ -2558,14 +2625,214 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2558
2625
|
<sds-icon name="check" [size]="iconSize()" [strokeWidth]="3" />
|
|
2559
2626
|
}
|
|
2560
2627
|
</span>
|
|
2561
|
-
|
|
2562
|
-
<span class="text-sm text-ink">{{ label() }}</span>
|
|
2563
|
-
}
|
|
2564
|
-
</label>
|
|
2628
|
+
</ng-template>
|
|
2565
2629
|
`,
|
|
2566
2630
|
}]
|
|
2567
2631
|
}], 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 }] }] } });
|
|
2568
2632
|
|
|
2633
|
+
let nextId$8 = 0;
|
|
2634
|
+
/**
|
|
2635
|
+
* Mounted radios by group name. A pick updates the rest of its group, because a native radio says
|
|
2636
|
+
* nothing when the browser unchecks it — without this a reactive form would leave the old choice drawn.
|
|
2637
|
+
*/
|
|
2638
|
+
const groups = new Map();
|
|
2639
|
+
/**
|
|
2640
|
+
* One option of a single-choice group: a styled circle (brand-filled with a dot when on) over a native
|
|
2641
|
+
* radio input, so grouping and keyboard behaviour stay the browser's — radios that share a `name`
|
|
2642
|
+
* move with the arrow keys and only one of them is on.
|
|
2643
|
+
*
|
|
2644
|
+
* Two ways to bind it:
|
|
2645
|
+
* - with forms: every radio of the group gets the same `[(ngModel)]` / `formControlName`, the same
|
|
2646
|
+
* `name` and its own `[value]`; the control holds the value of the selected radio
|
|
2647
|
+
* (ControlValueAccessor, like a native radio);
|
|
2648
|
+
* - without forms: drive `[checked]` yourself and update it from `(selected)`, which emits this radio's
|
|
2649
|
+
* value when the user picks it.
|
|
2650
|
+
*
|
|
2651
|
+
* Like `sds-checkbox`, without a visible `label` it renders no `<label>` of its own, so it can sit
|
|
2652
|
+
* inside the consumer's `<label>` (a whole clickable row), whose text then names it.
|
|
2653
|
+
*
|
|
2654
|
+
* @example
|
|
2655
|
+
* <sds-radio name="size" value="small" label="Petit" [(ngModel)]="size" />
|
|
2656
|
+
* <sds-radio name="size" value="large" label="Grand" [(ngModel)]="size" />
|
|
2657
|
+
*/
|
|
2658
|
+
class SdsRadio {
|
|
2659
|
+
id = `sds-radio-${nextId$8++}`;
|
|
2660
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2661
|
+
/** Accessible name used when no visible [label] is provided. */
|
|
2662
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
2663
|
+
/** The group's name, shared by all its radios (native grouping, arrow keys, and form syncing). */
|
|
2664
|
+
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
2665
|
+
/** What this option stands for: a form control bound to the group holds it while this radio is on. */
|
|
2666
|
+
value = input(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
2667
|
+
/** On/off when used without forms. Ignored once a form control is bound. */
|
|
2668
|
+
checked = input(false, ...(ngDevMode ? [{ debugName: "checked", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
2669
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2670
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
2671
|
+
/** Emits this radio's value when the user picks it. */
|
|
2672
|
+
selected = output();
|
|
2673
|
+
/** The group's current value, once a form control is bound (see {@link registerOnChange}). */
|
|
2674
|
+
modelValue = signal(undefined, ...(ngDevMode ? [{ debugName: "modelValue" }] : []));
|
|
2675
|
+
formBound = signal(false, ...(ngDevMode ? [{ debugName: "formBound" }] : []));
|
|
2676
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
2677
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
2678
|
+
isChecked = computed(() => this.formBound() ? Object.is(this.modelValue(), this.value()) : this.checked(), ...(ngDevMode ? [{ debugName: "isChecked" }] : []));
|
|
2679
|
+
stateClasses = computed(() => this.isDisabled() ? 'cursor-not-allowed opacity-60' : 'cursor-pointer', ...(ngDevMode ? [{ debugName: "stateClasses" }] : []));
|
|
2680
|
+
circleClasses = computed(() => {
|
|
2681
|
+
const size = this.size() === 'sm' ? 'h-4 w-4' : 'h-5 w-5';
|
|
2682
|
+
const state = this.isChecked() ? 'border-brand-600 bg-brand-600' : 'border-border bg-surface';
|
|
2683
|
+
const focus = 'focus-within:ring-2 focus-within:ring-brand-500/30 focus-within:border-brand-500';
|
|
2684
|
+
return `${size} ${state} ${focus}`;
|
|
2685
|
+
}, ...(ngDevMode ? [{ debugName: "circleClasses" }] : []));
|
|
2686
|
+
dotClasses = computed(() => this.size() === 'sm' ? 'h-1.5 w-1.5' : 'h-2 w-2', ...(ngDevMode ? [{ debugName: "dotClasses" }] : []));
|
|
2687
|
+
constructor() {
|
|
2688
|
+
effect((onCleanup) => {
|
|
2689
|
+
const name = this.name();
|
|
2690
|
+
if (!name) {
|
|
2691
|
+
return;
|
|
2692
|
+
}
|
|
2693
|
+
let group = groups.get(name);
|
|
2694
|
+
if (!group) {
|
|
2695
|
+
group = new Set();
|
|
2696
|
+
groups.set(name, group);
|
|
2697
|
+
}
|
|
2698
|
+
group.add(this);
|
|
2699
|
+
onCleanup(() => {
|
|
2700
|
+
group.delete(this);
|
|
2701
|
+
if (group.size === 0) {
|
|
2702
|
+
groups.delete(name);
|
|
2703
|
+
}
|
|
2704
|
+
});
|
|
2705
|
+
});
|
|
2706
|
+
}
|
|
2707
|
+
// --- ControlValueAccessor -------------------------------------------------
|
|
2708
|
+
onChange = () => { };
|
|
2709
|
+
onTouched = () => { };
|
|
2710
|
+
writeValue(value) {
|
|
2711
|
+
this.modelValue.set(value);
|
|
2712
|
+
}
|
|
2713
|
+
registerOnChange(fn) {
|
|
2714
|
+
this.onChange = fn;
|
|
2715
|
+
this.formBound.set(true);
|
|
2716
|
+
}
|
|
2717
|
+
registerOnTouched(fn) {
|
|
2718
|
+
this.onTouched = fn;
|
|
2719
|
+
}
|
|
2720
|
+
setDisabledState(isDisabled) {
|
|
2721
|
+
this.cvaDisabled.set(isDisabled);
|
|
2722
|
+
}
|
|
2723
|
+
/** A native radio only fires `change` when it turns on. */
|
|
2724
|
+
onPick() {
|
|
2725
|
+
const value = this.value();
|
|
2726
|
+
if (this.formBound()) {
|
|
2727
|
+
const name = this.name();
|
|
2728
|
+
for (const radio of (name && groups.get(name)) || [this]) {
|
|
2729
|
+
radio.modelValue.set(value);
|
|
2730
|
+
}
|
|
2731
|
+
this.onChange(value);
|
|
2732
|
+
}
|
|
2733
|
+
this.selected.emit(value);
|
|
2734
|
+
}
|
|
2735
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsRadio, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2736
|
+
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: [
|
|
2737
|
+
{
|
|
2738
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2739
|
+
useExisting: forwardRef(() => SdsRadio),
|
|
2740
|
+
multi: true,
|
|
2741
|
+
},
|
|
2742
|
+
], ngImport: i0, template: `
|
|
2743
|
+
@if (label()) {
|
|
2744
|
+
<label class="inline-flex select-none items-center gap-2" [class]="stateClasses()">
|
|
2745
|
+
<ng-container [ngTemplateOutlet]="circle" />
|
|
2746
|
+
<span class="text-sm text-ink">{{ label() }}</span>
|
|
2747
|
+
</label>
|
|
2748
|
+
} @else {
|
|
2749
|
+
<span class="inline-flex select-none items-center" [class]="stateClasses()">
|
|
2750
|
+
<ng-container [ngTemplateOutlet]="circle" />
|
|
2751
|
+
</span>
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
<ng-template #circle>
|
|
2755
|
+
<span
|
|
2756
|
+
class="relative inline-flex shrink-0 items-center justify-center rounded-full border transition-colors"
|
|
2757
|
+
[class]="circleClasses()"
|
|
2758
|
+
>
|
|
2759
|
+
<input
|
|
2760
|
+
type="radio"
|
|
2761
|
+
class="absolute inset-0 m-0 cursor-[inherit] opacity-0"
|
|
2762
|
+
[id]="id"
|
|
2763
|
+
[attr.name]="name() || null"
|
|
2764
|
+
[checked]="isChecked()"
|
|
2765
|
+
[disabled]="isDisabled()"
|
|
2766
|
+
[attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
|
|
2767
|
+
(change)="onPick()"
|
|
2768
|
+
(blur)="onTouched()"
|
|
2769
|
+
/>
|
|
2770
|
+
@if (isChecked()) {
|
|
2771
|
+
<span
|
|
2772
|
+
class="pointer-events-none rounded-full bg-white"
|
|
2773
|
+
[class]="dotClasses()"
|
|
2774
|
+
aria-hidden="true"
|
|
2775
|
+
></span>
|
|
2776
|
+
}
|
|
2777
|
+
</span>
|
|
2778
|
+
</ng-template>
|
|
2779
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2780
|
+
}
|
|
2781
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsRadio, decorators: [{
|
|
2782
|
+
type: Component,
|
|
2783
|
+
args: [{
|
|
2784
|
+
selector: 'sds-radio',
|
|
2785
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2786
|
+
imports: [NgTemplateOutlet],
|
|
2787
|
+
providers: [
|
|
2788
|
+
{
|
|
2789
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2790
|
+
useExisting: forwardRef(() => SdsRadio),
|
|
2791
|
+
multi: true,
|
|
2792
|
+
},
|
|
2793
|
+
],
|
|
2794
|
+
host: { class: 'inline-flex' },
|
|
2795
|
+
template: `
|
|
2796
|
+
@if (label()) {
|
|
2797
|
+
<label class="inline-flex select-none items-center gap-2" [class]="stateClasses()">
|
|
2798
|
+
<ng-container [ngTemplateOutlet]="circle" />
|
|
2799
|
+
<span class="text-sm text-ink">{{ label() }}</span>
|
|
2800
|
+
</label>
|
|
2801
|
+
} @else {
|
|
2802
|
+
<span class="inline-flex select-none items-center" [class]="stateClasses()">
|
|
2803
|
+
<ng-container [ngTemplateOutlet]="circle" />
|
|
2804
|
+
</span>
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
<ng-template #circle>
|
|
2808
|
+
<span
|
|
2809
|
+
class="relative inline-flex shrink-0 items-center justify-center rounded-full border transition-colors"
|
|
2810
|
+
[class]="circleClasses()"
|
|
2811
|
+
>
|
|
2812
|
+
<input
|
|
2813
|
+
type="radio"
|
|
2814
|
+
class="absolute inset-0 m-0 cursor-[inherit] opacity-0"
|
|
2815
|
+
[id]="id"
|
|
2816
|
+
[attr.name]="name() || null"
|
|
2817
|
+
[checked]="isChecked()"
|
|
2818
|
+
[disabled]="isDisabled()"
|
|
2819
|
+
[attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
|
|
2820
|
+
(change)="onPick()"
|
|
2821
|
+
(blur)="onTouched()"
|
|
2822
|
+
/>
|
|
2823
|
+
@if (isChecked()) {
|
|
2824
|
+
<span
|
|
2825
|
+
class="pointer-events-none rounded-full bg-white"
|
|
2826
|
+
[class]="dotClasses()"
|
|
2827
|
+
aria-hidden="true"
|
|
2828
|
+
></span>
|
|
2829
|
+
}
|
|
2830
|
+
</span>
|
|
2831
|
+
</ng-template>
|
|
2832
|
+
`,
|
|
2833
|
+
}]
|
|
2834
|
+
}], 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"] }] } });
|
|
2835
|
+
|
|
2569
2836
|
const STATUS_COLOR = {
|
|
2570
2837
|
online: 'bg-success',
|
|
2571
2838
|
offline: 'bg-ink-faint',
|
|
@@ -9334,6 +9601,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
9334
9601
|
* for the slow drifting brand blobs behind the page. Both read the brand ramp, so they follow the active
|
|
9335
9602
|
* theme and dark mode, and the decorations respect prefers-reduced-motion.
|
|
9336
9603
|
*
|
|
9604
|
+
* Page overlays (drawers, dialogs) can be rendered anywhere in the page: `<main>` is not a stacking
|
|
9605
|
+
* context, so a `fixed` overlay with a z-index above the top bar's (z-30) covers the top bar too.
|
|
9606
|
+
*
|
|
9337
9607
|
* @example
|
|
9338
9608
|
* <sds-shell background="gradient" decorations>
|
|
9339
9609
|
* <sds-topbar appearance="glass" sdsTopbar … />
|
|
@@ -9345,27 +9615,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
9345
9615
|
class SdsShell {
|
|
9346
9616
|
/** `plain` flat canvas (default) or a soft brand-tinted `gradient` wash. */
|
|
9347
9617
|
background = input('plain', ...(ngDevMode ? [{ debugName: "background" }] : []));
|
|
9348
|
-
/** Add slow-drifting brand-tinted blobs behind the page content (opt-in). */
|
|
9618
|
+
/** Add slow-drifting brand-tinted blobs behind the page content (opt-in). They stay in place while the page scrolls. */
|
|
9349
9619
|
decorations = input(false, ...(ngDevMode ? [{ debugName: "decorations", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
9350
|
-
|
|
9620
|
+
areaClass = computed(() => this.background() === 'gradient'
|
|
9351
9621
|
? 'bg-linear-to-br from-brand-50/50 via-canvas to-brand-100/40'
|
|
9352
|
-
: 'bg-canvas', ...(ngDevMode ? [{ debugName: "
|
|
9622
|
+
: 'bg-canvas', ...(ngDevMode ? [{ debugName: "areaClass" }] : []));
|
|
9353
9623
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsShell, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9354
9624
|
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: `
|
|
9355
9625
|
<div class="flex h-screen flex-col overflow-hidden">
|
|
9356
9626
|
<ng-content select="[sdsTopbar]" />
|
|
9357
9627
|
<div class="flex min-h-0 flex-1">
|
|
9358
9628
|
<ng-content select="[sdsSidebar]" />
|
|
9359
|
-
|
|
9629
|
+
<!--
|
|
9630
|
+
The content area carries the background and the ambient blobs; the scrolling <main> sits on top,
|
|
9631
|
+
transparent. <main> is positioned but never a stacking context (no isolate, no z-index): one would
|
|
9632
|
+
trap a page's own overlays — drawers, dialogs, fixed popovers — under the top bar (z-30) however
|
|
9633
|
+
high their z-index. Same pattern as the top bar and sidebar decorations: the blob layer comes first
|
|
9634
|
+
with no z-index, so the positioned <main> after it paints above it.
|
|
9635
|
+
-->
|
|
9636
|
+
<div class="relative flex min-w-0 flex-1" [class]="areaClass()">
|
|
9360
9637
|
@if (decorations()) {
|
|
9361
|
-
<div class="pointer-events-none absolute inset-0
|
|
9638
|
+
<div class="pointer-events-none absolute inset-0 overflow-hidden" aria-hidden="true">
|
|
9362
9639
|
<div class="absolute -left-32 top-10 h-96 w-96 rounded-full bg-brand-300/15 blur-3xl animate-sds-ambient"></div>
|
|
9363
9640
|
<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>
|
|
9364
9641
|
<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>
|
|
9365
9642
|
</div>
|
|
9366
9643
|
}
|
|
9367
|
-
<
|
|
9368
|
-
|
|
9644
|
+
<main class="relative min-w-0 flex-1 overflow-y-auto">
|
|
9645
|
+
<ng-content />
|
|
9646
|
+
</main>
|
|
9647
|
+
</div>
|
|
9369
9648
|
</div>
|
|
9370
9649
|
</div>
|
|
9371
9650
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -9381,16 +9660,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
9381
9660
|
<ng-content select="[sdsTopbar]" />
|
|
9382
9661
|
<div class="flex min-h-0 flex-1">
|
|
9383
9662
|
<ng-content select="[sdsSidebar]" />
|
|
9384
|
-
|
|
9663
|
+
<!--
|
|
9664
|
+
The content area carries the background and the ambient blobs; the scrolling <main> sits on top,
|
|
9665
|
+
transparent. <main> is positioned but never a stacking context (no isolate, no z-index): one would
|
|
9666
|
+
trap a page's own overlays — drawers, dialogs, fixed popovers — under the top bar (z-30) however
|
|
9667
|
+
high their z-index. Same pattern as the top bar and sidebar decorations: the blob layer comes first
|
|
9668
|
+
with no z-index, so the positioned <main> after it paints above it.
|
|
9669
|
+
-->
|
|
9670
|
+
<div class="relative flex min-w-0 flex-1" [class]="areaClass()">
|
|
9385
9671
|
@if (decorations()) {
|
|
9386
|
-
<div class="pointer-events-none absolute inset-0
|
|
9672
|
+
<div class="pointer-events-none absolute inset-0 overflow-hidden" aria-hidden="true">
|
|
9387
9673
|
<div class="absolute -left-32 top-10 h-96 w-96 rounded-full bg-brand-300/15 blur-3xl animate-sds-ambient"></div>
|
|
9388
9674
|
<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>
|
|
9389
9675
|
<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>
|
|
9390
9676
|
</div>
|
|
9391
9677
|
}
|
|
9392
|
-
<
|
|
9393
|
-
|
|
9678
|
+
<main class="relative min-w-0 flex-1 overflow-y-auto">
|
|
9679
|
+
<ng-content />
|
|
9680
|
+
</main>
|
|
9681
|
+
</div>
|
|
9394
9682
|
</div>
|
|
9395
9683
|
</div>
|
|
9396
9684
|
`,
|
|
@@ -11259,5 +11547,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
11259
11547
|
* Generated bundle index. Do not edit.
|
|
11260
11548
|
*/
|
|
11261
11549
|
|
|
11262
|
-
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 };
|
|
11550
|
+
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 };
|
|
11263
11551
|
//# sourceMappingURL=besaitech-ng-design-system.mjs.map
|