@besaitech/ng-design-system 0.0.32 → 0.0.34
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,
|
|
2
|
+
import { inject, input, computed, ChangeDetectionStrategy, Component, booleanAttribute, isDevMode, effect, output, signal, forwardRef, numberAttribute, viewChildren, afterRenderEffect, viewChild, ElementRef, model, Injector, afterNextRender, Injectable, TemplateRef, Directive, contentChildren, contentChild } 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';
|
|
@@ -152,7 +152,7 @@ const VARIANTS$2 = {
|
|
|
152
152
|
ghost: 'bg-transparent text-ink-soft hover:bg-black/5 active:bg-black/10',
|
|
153
153
|
danger: 'bg-danger text-white shadow-sm hover:brightness-95 active:brightness-90',
|
|
154
154
|
};
|
|
155
|
-
const SIZES$
|
|
155
|
+
const SIZES$a = {
|
|
156
156
|
sm: 'h-8 px-3 text-sm',
|
|
157
157
|
md: 'h-10 px-4 text-sm',
|
|
158
158
|
lg: 'h-12 px-5 text-base',
|
|
@@ -212,7 +212,7 @@ class SdsButton {
|
|
|
212
212
|
BASE,
|
|
213
213
|
this.shape() === 'pill' ? 'rounded-full' : 'rounded-control',
|
|
214
214
|
VARIANTS$2[this.variant()],
|
|
215
|
-
SIZES$
|
|
215
|
+
SIZES$a[size],
|
|
216
216
|
this.iconOnly() ? ICON_ONLY[size] : '',
|
|
217
217
|
this.block() ? 'w-full' : '',
|
|
218
218
|
]
|
|
@@ -264,8 +264,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
264
264
|
`, 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"] }]
|
|
265
265
|
}], 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 }] }] } });
|
|
266
266
|
|
|
267
|
-
let nextId$
|
|
268
|
-
const SIZES$
|
|
267
|
+
let nextId$b = 0;
|
|
268
|
+
const SIZES$9 = {
|
|
269
269
|
sm: 'h-9 text-sm',
|
|
270
270
|
md: 'h-10 text-sm',
|
|
271
271
|
lg: 'h-12 text-base',
|
|
@@ -277,7 +277,7 @@ const SIZES$8 = {
|
|
|
277
277
|
* sidebar search field).
|
|
278
278
|
*/
|
|
279
279
|
class SdsInput {
|
|
280
|
-
inputId = `sds-input-${nextId$
|
|
280
|
+
inputId = `sds-input-${nextId$b++}`;
|
|
281
281
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
282
282
|
/** Accessible name used when no visible [label] is provided. */
|
|
283
283
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -354,7 +354,7 @@ class SdsInput {
|
|
|
354
354
|
return `${left} ${right}`;
|
|
355
355
|
}, ...(ngDevMode ? [{ debugName: "fieldPadding" }] : []));
|
|
356
356
|
wrapperClasses = computed(() => {
|
|
357
|
-
const parts = [SIZES$
|
|
357
|
+
const parts = [SIZES$9[this.size()], this.pill() ? 'rounded-full' : 'rounded-control'];
|
|
358
358
|
if (this.isDisabled())
|
|
359
359
|
parts.push('opacity-60 cursor-not-allowed');
|
|
360
360
|
if (this.filled()) {
|
|
@@ -598,6 +598,323 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
598
598
|
`, 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"] }]
|
|
599
599
|
}], 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"] }] } });
|
|
600
600
|
|
|
601
|
+
let nextId$a = 0;
|
|
602
|
+
const SIZES$8 = {
|
|
603
|
+
md: 'h-12 w-11 text-lg',
|
|
604
|
+
lg: 'h-14 w-12 text-xl',
|
|
605
|
+
};
|
|
606
|
+
/**
|
|
607
|
+
* A segmented one-time-code field: one box per character, for the short numeric codes emailed or
|
|
608
|
+
* texted for sign-in and verification. Implements ControlValueAccessor — bind
|
|
609
|
+
* `formControlName`/`[(ngModel)]`; the value is the concatenated string (e.g. `"483920"`), and
|
|
610
|
+
* {@link completed} fires the moment every box is filled.
|
|
611
|
+
*
|
|
612
|
+
* <p>Only digits are accepted (`inputMode` is `numeric` by default). Typing auto-advances,
|
|
613
|
+
* Backspace steps back and clears, the arrow keys move between boxes, and pasting a whole code
|
|
614
|
+
* distributes it across the boxes from the focused one — so a user can paste `483920` into the
|
|
615
|
+
* first box and have it land correctly.
|
|
616
|
+
*/
|
|
617
|
+
class SdsOtpInput {
|
|
618
|
+
groupId = `sds-otp-${nextId$a++}`;
|
|
619
|
+
/** How many boxes / characters the code has. */
|
|
620
|
+
length = input(6, ...(ngDevMode ? [{ debugName: "length", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
621
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
622
|
+
/** Accessible name for the whole group when no visible [label] is provided. */
|
|
623
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
624
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
625
|
+
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
626
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
627
|
+
/** `numeric` for digit codes (the default); `text` for alphanumeric codes. */
|
|
628
|
+
inputMode = input('numeric', ...(ngDevMode ? [{ debugName: "inputMode" }] : []));
|
|
629
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
630
|
+
/** Focus the first box on first render. */
|
|
631
|
+
autoFocus = input(false, ...(ngDevMode ? [{ debugName: "autoFocus", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
632
|
+
/**
|
|
633
|
+
* Accessible name for an individual box, suffixed with its 1-based position ("Digit 1", "Digit
|
|
634
|
+
* 2", …). French default so existing consumers are unchanged; translate it in an app serving more
|
|
635
|
+
* than one language, since each box is an icon-less control whose only name this is.
|
|
636
|
+
*/
|
|
637
|
+
cellLabel = input('Chiffre', ...(ngDevMode ? [{ debugName: "cellLabel" }] : []));
|
|
638
|
+
/** Emitted with the full value the moment the last box is filled. */
|
|
639
|
+
completed = output();
|
|
640
|
+
cells = viewChildren('cell', ...(ngDevMode ? [{ debugName: "cells" }] : []));
|
|
641
|
+
/** One entry per box; the source of truth, kept exactly {@link length} long. */
|
|
642
|
+
chars = signal([], ...(ngDevMode ? [{ debugName: "chars" }] : []));
|
|
643
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
644
|
+
indexes = computed(() => Array.from({ length: this.length() }, (_, i) => i), ...(ngDevMode ? [{ debugName: "indexes" }] : []));
|
|
645
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
646
|
+
describedBy = computed(() => {
|
|
647
|
+
if (this.error())
|
|
648
|
+
return `${this.groupId}-err`;
|
|
649
|
+
if (this.hint())
|
|
650
|
+
return `${this.groupId}-hint`;
|
|
651
|
+
return null;
|
|
652
|
+
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : []));
|
|
653
|
+
cellClasses = computed(() => {
|
|
654
|
+
const parts = ['rounded-control border', SIZES$8[this.size()]];
|
|
655
|
+
parts.push(this.error()
|
|
656
|
+
? 'border-danger focus:border-danger focus:ring-2 focus:ring-danger/25'
|
|
657
|
+
: 'border-border text-ink focus:border-brand-500 focus:ring-2 focus:ring-brand-500/25');
|
|
658
|
+
if (this.isDisabled())
|
|
659
|
+
parts.push('opacity-60');
|
|
660
|
+
return parts.join(' ');
|
|
661
|
+
}, ...(ngDevMode ? [{ debugName: "cellClasses" }] : []));
|
|
662
|
+
constructor() {
|
|
663
|
+
// Autofocus once the boxes are in the DOM. afterRenderEffect re-runs on signal reads, but the
|
|
664
|
+
// guard keeps it to the first paint — refocusing on every value change would fight the user.
|
|
665
|
+
let focused = false;
|
|
666
|
+
afterRenderEffect(() => {
|
|
667
|
+
if (this.autoFocus() && !focused && !this.isDisabled()) {
|
|
668
|
+
this.cells()[0]?.nativeElement.focus();
|
|
669
|
+
focused = true;
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
// --- ControlValueAccessor -------------------------------------------------
|
|
674
|
+
onChange = () => { };
|
|
675
|
+
onTouched = () => { };
|
|
676
|
+
writeValue(value) {
|
|
677
|
+
// Programmatic set never emits — CVA writeValue must not call onChange.
|
|
678
|
+
this.chars.set(this.spread(value ?? ''));
|
|
679
|
+
}
|
|
680
|
+
registerOnChange(fn) {
|
|
681
|
+
this.onChange = fn;
|
|
682
|
+
}
|
|
683
|
+
registerOnTouched(fn) {
|
|
684
|
+
this.onTouched = fn;
|
|
685
|
+
}
|
|
686
|
+
setDisabledState(isDisabled) {
|
|
687
|
+
this.cvaDisabled.set(isDisabled);
|
|
688
|
+
}
|
|
689
|
+
// --- events ---------------------------------------------------------------
|
|
690
|
+
charAt(index) {
|
|
691
|
+
return this.chars()[index] ?? '';
|
|
692
|
+
}
|
|
693
|
+
onInput(event, index) {
|
|
694
|
+
const el = event.target;
|
|
695
|
+
const raw = el.value;
|
|
696
|
+
const digits = this.sanitize(raw);
|
|
697
|
+
if (digits.length === 0) {
|
|
698
|
+
if (raw.length === 0) {
|
|
699
|
+
// Genuinely emptied (cut, or a deletion the keydown handler did not catch) — clear the box.
|
|
700
|
+
this.setChar(index, '');
|
|
701
|
+
}
|
|
702
|
+
else {
|
|
703
|
+
// A rejected character (letter, symbol) — reassert the box's real content, since the
|
|
704
|
+
// [value] binding will not repaint an unchanged signal.
|
|
705
|
+
el.value = this.charAt(index);
|
|
706
|
+
}
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
if (digits.length > 1) {
|
|
710
|
+
// Fast typing or an autofill dropped several characters into one box — spread them.
|
|
711
|
+
this.fill(digits, index);
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
this.setChar(index, digits);
|
|
715
|
+
this.focusIndex(index + 1);
|
|
716
|
+
}
|
|
717
|
+
onKeydown(event, index) {
|
|
718
|
+
switch (event.key) {
|
|
719
|
+
case 'Backspace':
|
|
720
|
+
event.preventDefault();
|
|
721
|
+
if (this.charAt(index)) {
|
|
722
|
+
this.setChar(index, '');
|
|
723
|
+
}
|
|
724
|
+
else if (index > 0) {
|
|
725
|
+
this.setChar(index - 1, '');
|
|
726
|
+
this.focusIndex(index - 1);
|
|
727
|
+
}
|
|
728
|
+
break;
|
|
729
|
+
case 'ArrowLeft':
|
|
730
|
+
event.preventDefault();
|
|
731
|
+
this.focusIndex(index - 1);
|
|
732
|
+
break;
|
|
733
|
+
case 'ArrowRight':
|
|
734
|
+
event.preventDefault();
|
|
735
|
+
this.focusIndex(index + 1);
|
|
736
|
+
break;
|
|
737
|
+
case 'Delete':
|
|
738
|
+
event.preventDefault();
|
|
739
|
+
this.setChar(index, '');
|
|
740
|
+
break;
|
|
741
|
+
default:
|
|
742
|
+
break;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
onPaste(event, index) {
|
|
746
|
+
const digits = this.sanitize(event.clipboardData?.getData('text') ?? '');
|
|
747
|
+
if (!digits)
|
|
748
|
+
return;
|
|
749
|
+
event.preventDefault();
|
|
750
|
+
this.fill(digits, index);
|
|
751
|
+
}
|
|
752
|
+
onFocus(event) {
|
|
753
|
+
// Select the box's content so a keystroke overwrites rather than being rejected by maxlength.
|
|
754
|
+
event.target.select();
|
|
755
|
+
}
|
|
756
|
+
// --- internals ------------------------------------------------------------
|
|
757
|
+
sanitize(raw) {
|
|
758
|
+
return this.inputMode() === 'numeric'
|
|
759
|
+
? raw.replace(/\D/g, '')
|
|
760
|
+
: raw.replace(/[^A-Za-z0-9]/g, '');
|
|
761
|
+
}
|
|
762
|
+
/** Normalize any input string into an array exactly {@link length} long. */
|
|
763
|
+
spread(raw) {
|
|
764
|
+
const cleaned = this.sanitize(raw).slice(0, this.length());
|
|
765
|
+
return Array.from({ length: this.length() }, (_, i) => cleaned[i] ?? '');
|
|
766
|
+
}
|
|
767
|
+
setChar(index, value) {
|
|
768
|
+
const next = this.normalized();
|
|
769
|
+
next[index] = value;
|
|
770
|
+
this.commit(next);
|
|
771
|
+
}
|
|
772
|
+
/** Write `digits` across the boxes starting at `start`, then focus the next empty box. */
|
|
773
|
+
fill(digits, start) {
|
|
774
|
+
const next = this.normalized();
|
|
775
|
+
let cursor = start;
|
|
776
|
+
for (const ch of digits) {
|
|
777
|
+
if (cursor >= this.length())
|
|
778
|
+
break;
|
|
779
|
+
next[cursor] = ch;
|
|
780
|
+
cursor += 1;
|
|
781
|
+
}
|
|
782
|
+
this.commit(next);
|
|
783
|
+
this.focusIndex(Math.min(cursor, this.length() - 1));
|
|
784
|
+
}
|
|
785
|
+
commit(next) {
|
|
786
|
+
this.chars.set(next);
|
|
787
|
+
const value = next.join('');
|
|
788
|
+
this.onChange(value);
|
|
789
|
+
if (next.every((c) => c !== '')) {
|
|
790
|
+
this.completed.emit(value);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
/** The current boxes as a fresh, correctly-sized array to mutate. */
|
|
794
|
+
normalized() {
|
|
795
|
+
const current = this.chars();
|
|
796
|
+
return Array.from({ length: this.length() }, (_, i) => current[i] ?? '');
|
|
797
|
+
}
|
|
798
|
+
focusIndex(index) {
|
|
799
|
+
const clamped = Math.max(0, Math.min(index, this.length() - 1));
|
|
800
|
+
const cell = this.cells()[clamped]?.nativeElement;
|
|
801
|
+
if (cell) {
|
|
802
|
+
cell.focus();
|
|
803
|
+
cell.select();
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsOtpInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
807
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsOtpInput, isStandalone: true, selector: "sds-otp-input", inputs: { length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", 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 }, inputMode: { classPropertyName: "inputMode", publicName: "inputMode", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, cellLabel: { classPropertyName: "cellLabel", publicName: "cellLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { completed: "completed" }, host: { classAttribute: "block" }, providers: [
|
|
808
|
+
{
|
|
809
|
+
provide: NG_VALUE_ACCESSOR,
|
|
810
|
+
useExisting: forwardRef(() => SdsOtpInput),
|
|
811
|
+
multi: true,
|
|
812
|
+
},
|
|
813
|
+
], viewQueries: [{ propertyName: "cells", predicate: ["cell"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
814
|
+
@if (label()) {
|
|
815
|
+
<label [id]="groupId + '-label'" class="mb-1.5 block text-sm font-medium text-ink">
|
|
816
|
+
{{ label() }}
|
|
817
|
+
</label>
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
<div
|
|
821
|
+
class="flex items-center gap-2"
|
|
822
|
+
role="group"
|
|
823
|
+
[attr.aria-labelledby]="label() ? groupId + '-label' : null"
|
|
824
|
+
[attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
|
|
825
|
+
[attr.aria-describedby]="describedBy()"
|
|
826
|
+
>
|
|
827
|
+
@for (i of indexes(); track i) {
|
|
828
|
+
<input
|
|
829
|
+
#cell
|
|
830
|
+
type="text"
|
|
831
|
+
[attr.data-index]="i"
|
|
832
|
+
[inputMode]="inputMode()"
|
|
833
|
+
autocomplete="one-time-code"
|
|
834
|
+
maxlength="1"
|
|
835
|
+
[value]="charAt(i)"
|
|
836
|
+
[disabled]="isDisabled()"
|
|
837
|
+
[attr.aria-label]="cellLabel() + ' ' + (i + 1)"
|
|
838
|
+
[attr.aria-invalid]="error() ? 'true' : null"
|
|
839
|
+
class="bg-white text-center font-semibold tabular-nums outline-none transition-colors
|
|
840
|
+
disabled:cursor-not-allowed"
|
|
841
|
+
[class]="cellClasses()"
|
|
842
|
+
(input)="onInput($event, i)"
|
|
843
|
+
(keydown)="onKeydown($event, i)"
|
|
844
|
+
(paste)="onPaste($event, i)"
|
|
845
|
+
(focus)="onFocus($event)"
|
|
846
|
+
(blur)="onTouched()"
|
|
847
|
+
/>
|
|
848
|
+
}
|
|
849
|
+
</div>
|
|
850
|
+
|
|
851
|
+
@if (error()) {
|
|
852
|
+
<p [id]="groupId + '-err'" class="mt-1.5 text-xs font-medium text-danger">{{ error() }}</p>
|
|
853
|
+
} @else if (hint()) {
|
|
854
|
+
<p [id]="groupId + '-hint'" class="mt-1.5 text-xs text-ink-faint">{{ hint() }}</p>
|
|
855
|
+
}
|
|
856
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
857
|
+
}
|
|
858
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsOtpInput, decorators: [{
|
|
859
|
+
type: Component,
|
|
860
|
+
args: [{
|
|
861
|
+
selector: 'sds-otp-input',
|
|
862
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
863
|
+
providers: [
|
|
864
|
+
{
|
|
865
|
+
provide: NG_VALUE_ACCESSOR,
|
|
866
|
+
useExisting: forwardRef(() => SdsOtpInput),
|
|
867
|
+
multi: true,
|
|
868
|
+
},
|
|
869
|
+
],
|
|
870
|
+
host: { class: 'block' },
|
|
871
|
+
template: `
|
|
872
|
+
@if (label()) {
|
|
873
|
+
<label [id]="groupId + '-label'" class="mb-1.5 block text-sm font-medium text-ink">
|
|
874
|
+
{{ label() }}
|
|
875
|
+
</label>
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
<div
|
|
879
|
+
class="flex items-center gap-2"
|
|
880
|
+
role="group"
|
|
881
|
+
[attr.aria-labelledby]="label() ? groupId + '-label' : null"
|
|
882
|
+
[attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
|
|
883
|
+
[attr.aria-describedby]="describedBy()"
|
|
884
|
+
>
|
|
885
|
+
@for (i of indexes(); track i) {
|
|
886
|
+
<input
|
|
887
|
+
#cell
|
|
888
|
+
type="text"
|
|
889
|
+
[attr.data-index]="i"
|
|
890
|
+
[inputMode]="inputMode()"
|
|
891
|
+
autocomplete="one-time-code"
|
|
892
|
+
maxlength="1"
|
|
893
|
+
[value]="charAt(i)"
|
|
894
|
+
[disabled]="isDisabled()"
|
|
895
|
+
[attr.aria-label]="cellLabel() + ' ' + (i + 1)"
|
|
896
|
+
[attr.aria-invalid]="error() ? 'true' : null"
|
|
897
|
+
class="bg-white text-center font-semibold tabular-nums outline-none transition-colors
|
|
898
|
+
disabled:cursor-not-allowed"
|
|
899
|
+
[class]="cellClasses()"
|
|
900
|
+
(input)="onInput($event, i)"
|
|
901
|
+
(keydown)="onKeydown($event, i)"
|
|
902
|
+
(paste)="onPaste($event, i)"
|
|
903
|
+
(focus)="onFocus($event)"
|
|
904
|
+
(blur)="onTouched()"
|
|
905
|
+
/>
|
|
906
|
+
}
|
|
907
|
+
</div>
|
|
908
|
+
|
|
909
|
+
@if (error()) {
|
|
910
|
+
<p [id]="groupId + '-err'" class="mt-1.5 text-xs font-medium text-danger">{{ error() }}</p>
|
|
911
|
+
} @else if (hint()) {
|
|
912
|
+
<p [id]="groupId + '-hint'" class="mt-1.5 text-xs text-ink-faint">{{ hint() }}</p>
|
|
913
|
+
}
|
|
914
|
+
`,
|
|
915
|
+
}]
|
|
916
|
+
}], 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 }] }] } });
|
|
917
|
+
|
|
601
918
|
let nextId$9 = 0;
|
|
602
919
|
const SIZES$7 = {
|
|
603
920
|
sm: 'text-sm px-3 py-2',
|
|
@@ -1474,6 +1791,26 @@ class SdsCalendar {
|
|
|
1474
1791
|
firstDayOfWeek = input(1, ...(ngDevMode ? [{ debugName: "firstDayOfWeek" }] : []));
|
|
1475
1792
|
locale = input('fr-FR', ...(ngDevMode ? [{ debugName: "locale" }] : []));
|
|
1476
1793
|
showActions = input(true, ...(ngDevMode ? [{ debugName: "showActions" }] : []));
|
|
1794
|
+
/**
|
|
1795
|
+
* Accessible name for the calendar container. French default so existing consumers are unchanged,
|
|
1796
|
+
* but an app serving more than one language MUST translate it.
|
|
1797
|
+
*/
|
|
1798
|
+
calendarLabel = input('Calendrier', ...(ngDevMode ? [{ debugName: "calendarLabel" }] : []));
|
|
1799
|
+
/**
|
|
1800
|
+
* Accessible name for the "previous" nav button. It is icon-only, so this string is its ONLY
|
|
1801
|
+
* accessible name — a hardcoded French one is simply wrong in every other locale. Translate it in
|
|
1802
|
+
* the consuming app.
|
|
1803
|
+
*/
|
|
1804
|
+
previousLabel = input('Précédent', ...(ngDevMode ? [{ debugName: "previousLabel" }] : []));
|
|
1805
|
+
/** Accessible name for the icon-only "next" nav button. See {@link previousLabel}. */
|
|
1806
|
+
nextLabel = input('Suivant', ...(ngDevMode ? [{ debugName: "nextLabel" }] : []));
|
|
1807
|
+
/**
|
|
1808
|
+
* Visible text of the "today" action (shown when {@link showActions} is true). Translate it in the
|
|
1809
|
+
* consuming app — the library ships no i18n of its own.
|
|
1810
|
+
*/
|
|
1811
|
+
todayActionLabel = input("Aujourd'hui", ...(ngDevMode ? [{ debugName: "todayActionLabel" }] : []));
|
|
1812
|
+
/** Visible text of the "clear" action. See {@link todayActionLabel}. */
|
|
1813
|
+
clearActionLabel = input('Effacer', ...(ngDevMode ? [{ debugName: "clearActionLabel" }] : []));
|
|
1477
1814
|
/** Emitted when a concrete date is picked (day click or "Aujourd'hui"). */
|
|
1478
1815
|
dateSelect = output();
|
|
1479
1816
|
view = signal('day', ...(ngDevMode ? [{ debugName: "view" }] : []));
|
|
@@ -1707,15 +2044,15 @@ class SdsCalendar {
|
|
|
1707
2044
|
return cls;
|
|
1708
2045
|
}
|
|
1709
2046
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1710
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsCalendar, isStandalone: true, selector: "sds-calendar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", dateSelect: "dateSelect" }, host: { classAttribute: "block" }, ngImport: i0, template: `
|
|
2047
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsCalendar, isStandalone: true, selector: "sds-calendar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, calendarLabel: { classPropertyName: "calendarLabel", publicName: "calendarLabel", isSignal: true, isRequired: false, transformFunction: null }, previousLabel: { classPropertyName: "previousLabel", publicName: "previousLabel", isSignal: true, isRequired: false, transformFunction: null }, nextLabel: { classPropertyName: "nextLabel", publicName: "nextLabel", isSignal: true, isRequired: false, transformFunction: null }, todayActionLabel: { classPropertyName: "todayActionLabel", publicName: "todayActionLabel", isSignal: true, isRequired: false, transformFunction: null }, clearActionLabel: { classPropertyName: "clearActionLabel", publicName: "clearActionLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", dateSelect: "dateSelect" }, host: { classAttribute: "block" }, ngImport: i0, template: `
|
|
1711
2048
|
<div
|
|
1712
2049
|
class="w-[20rem] select-none rounded-card border border-border bg-surface p-3 shadow-lg"
|
|
1713
2050
|
role="group"
|
|
1714
|
-
aria-label="
|
|
2051
|
+
[attr.aria-label]="calendarLabel()"
|
|
1715
2052
|
>
|
|
1716
2053
|
<!-- Header -->
|
|
1717
2054
|
<div class="mb-2 flex items-center justify-between">
|
|
1718
|
-
<button type="button" [class]="navBtn" aria-label="
|
|
2055
|
+
<button type="button" [class]="navBtn" [attr.aria-label]="previousLabel()" (click)="prev()">
|
|
1719
2056
|
<sds-icon name="chevron-left" [size]="18" />
|
|
1720
2057
|
</button>
|
|
1721
2058
|
|
|
@@ -1740,7 +2077,7 @@ class SdsCalendar {
|
|
|
1740
2077
|
}
|
|
1741
2078
|
</div>
|
|
1742
2079
|
|
|
1743
|
-
<button type="button" [class]="navBtn" aria-label="
|
|
2080
|
+
<button type="button" [class]="navBtn" [attr.aria-label]="nextLabel()" (click)="next()">
|
|
1744
2081
|
<sds-icon name="chevron-right" [size]="18" />
|
|
1745
2082
|
</button>
|
|
1746
2083
|
</div>
|
|
@@ -1824,9 +2161,9 @@ class SdsCalendar {
|
|
|
1824
2161
|
[disabled]="todayDisabled()"
|
|
1825
2162
|
(click)="goToday()"
|
|
1826
2163
|
>
|
|
1827
|
-
|
|
2164
|
+
{{ todayActionLabel() }}
|
|
1828
2165
|
</button>
|
|
1829
|
-
<button type="button" [class]="actionBtn" (click)="clear()">
|
|
2166
|
+
<button type="button" [class]="actionBtn" (click)="clear()">{{ clearActionLabel() }}</button>
|
|
1830
2167
|
</div>
|
|
1831
2168
|
}
|
|
1832
2169
|
</div>
|
|
@@ -1843,11 +2180,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1843
2180
|
<div
|
|
1844
2181
|
class="w-[20rem] select-none rounded-card border border-border bg-surface p-3 shadow-lg"
|
|
1845
2182
|
role="group"
|
|
1846
|
-
aria-label="
|
|
2183
|
+
[attr.aria-label]="calendarLabel()"
|
|
1847
2184
|
>
|
|
1848
2185
|
<!-- Header -->
|
|
1849
2186
|
<div class="mb-2 flex items-center justify-between">
|
|
1850
|
-
<button type="button" [class]="navBtn" aria-label="
|
|
2187
|
+
<button type="button" [class]="navBtn" [attr.aria-label]="previousLabel()" (click)="prev()">
|
|
1851
2188
|
<sds-icon name="chevron-left" [size]="18" />
|
|
1852
2189
|
</button>
|
|
1853
2190
|
|
|
@@ -1872,7 +2209,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1872
2209
|
}
|
|
1873
2210
|
</div>
|
|
1874
2211
|
|
|
1875
|
-
<button type="button" [class]="navBtn" aria-label="
|
|
2212
|
+
<button type="button" [class]="navBtn" [attr.aria-label]="nextLabel()" (click)="next()">
|
|
1876
2213
|
<sds-icon name="chevron-right" [size]="18" />
|
|
1877
2214
|
</button>
|
|
1878
2215
|
</div>
|
|
@@ -1956,15 +2293,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1956
2293
|
[disabled]="todayDisabled()"
|
|
1957
2294
|
(click)="goToday()"
|
|
1958
2295
|
>
|
|
1959
|
-
|
|
2296
|
+
{{ todayActionLabel() }}
|
|
1960
2297
|
</button>
|
|
1961
|
-
<button type="button" [class]="actionBtn" (click)="clear()">
|
|
2298
|
+
<button type="button" [class]="actionBtn" (click)="clear()">{{ clearActionLabel() }}</button>
|
|
1962
2299
|
</div>
|
|
1963
2300
|
}
|
|
1964
2301
|
</div>
|
|
1965
2302
|
`,
|
|
1966
2303
|
}]
|
|
1967
|
-
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], showActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showActions", required: false }] }], dateSelect: [{ type: i0.Output, args: ["dateSelect"] }] } });
|
|
2304
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], showActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showActions", required: false }] }], calendarLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarLabel", required: false }] }], previousLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousLabel", required: false }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: false }] }], todayActionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayActionLabel", required: false }] }], clearActionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearActionLabel", required: false }] }], dateSelect: [{ type: i0.Output, args: ["dateSelect"] }] } });
|
|
1968
2305
|
|
|
1969
2306
|
const SIZES$5 = {
|
|
1970
2307
|
sm: 'h-9 text-sm',
|
|
@@ -1999,6 +2336,31 @@ class SdsDatePicker {
|
|
|
1999
2336
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
2000
2337
|
/** Custom display formatter (default dd/MM/yyyy). */
|
|
2001
2338
|
format = input(formatDdMmYyyy, ...(ngDevMode ? [{ debugName: "format" }] : []));
|
|
2339
|
+
/**
|
|
2340
|
+
* Accessible name for the clear button. French default so existing consumers are unchanged, but an
|
|
2341
|
+
* app serving more than one language MUST translate it — it is an icon-only control, so this string
|
|
2342
|
+
* is its only name.
|
|
2343
|
+
*/
|
|
2344
|
+
clearLabel = input('Effacer la date', ...(ngDevMode ? [{ debugName: "clearLabel" }] : []));
|
|
2345
|
+
/**
|
|
2346
|
+
* Accessible name for the icon-only calendar toggle while the panel is CLOSED. See
|
|
2347
|
+
* {@link clearLabel} for why this has to be translatable.
|
|
2348
|
+
*/
|
|
2349
|
+
openCalendarLabel = input('Ouvrir le calendrier', ...(ngDevMode ? [{ debugName: "openCalendarLabel" }] : []));
|
|
2350
|
+
/** Accessible name for the calendar toggle while the panel is OPEN. See {@link openCalendarLabel}. */
|
|
2351
|
+
closeCalendarLabel = input('Fermer le calendrier', ...(ngDevMode ? [{ debugName: "closeCalendarLabel" }] : []));
|
|
2352
|
+
/** Accessible name for the overlay dialog that holds the calendar. */
|
|
2353
|
+
panelLabel = input('Sélection de date', ...(ngDevMode ? [{ debugName: "panelLabel" }] : []));
|
|
2354
|
+
/**
|
|
2355
|
+
* Labels forwarded to the embedded <sds-calendar>. They live here because the picker is how the
|
|
2356
|
+
* calendar is normally reached — without forwarding, a consumer could translate the field but not
|
|
2357
|
+
* the panel it opens. Defaults match SdsCalendar's own, so nothing changes for existing consumers.
|
|
2358
|
+
*/
|
|
2359
|
+
calendarLabel = input('Calendrier', ...(ngDevMode ? [{ debugName: "calendarLabel" }] : []));
|
|
2360
|
+
previousLabel = input('Précédent', ...(ngDevMode ? [{ debugName: "previousLabel" }] : []));
|
|
2361
|
+
nextLabel = input('Suivant', ...(ngDevMode ? [{ debugName: "nextLabel" }] : []));
|
|
2362
|
+
todayActionLabel = input("Aujourd'hui", ...(ngDevMode ? [{ debugName: "todayActionLabel" }] : []));
|
|
2363
|
+
clearActionLabel = input('Effacer', ...(ngDevMode ? [{ debugName: "clearActionLabel" }] : []));
|
|
2002
2364
|
value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
2003
2365
|
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
2004
2366
|
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
@@ -2146,7 +2508,7 @@ class SdsDatePicker {
|
|
|
2146
2508
|
this.cvaDisabled.set(isDisabled);
|
|
2147
2509
|
}
|
|
2148
2510
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2149
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsDatePicker, isStandalone: true, selector: "sds-date-picker", 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 }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "onDocumentClick($event)", "keydown.escape": "close(true)" }, classAttribute: "block" }, providers: [
|
|
2511
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsDatePicker, isStandalone: true, selector: "sds-date-picker", 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 }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null }, openCalendarLabel: { classPropertyName: "openCalendarLabel", publicName: "openCalendarLabel", isSignal: true, isRequired: false, transformFunction: null }, closeCalendarLabel: { classPropertyName: "closeCalendarLabel", publicName: "closeCalendarLabel", isSignal: true, isRequired: false, transformFunction: null }, panelLabel: { classPropertyName: "panelLabel", publicName: "panelLabel", isSignal: true, isRequired: false, transformFunction: null }, calendarLabel: { classPropertyName: "calendarLabel", publicName: "calendarLabel", isSignal: true, isRequired: false, transformFunction: null }, previousLabel: { classPropertyName: "previousLabel", publicName: "previousLabel", isSignal: true, isRequired: false, transformFunction: null }, nextLabel: { classPropertyName: "nextLabel", publicName: "nextLabel", isSignal: true, isRequired: false, transformFunction: null }, todayActionLabel: { classPropertyName: "todayActionLabel", publicName: "todayActionLabel", isSignal: true, isRequired: false, transformFunction: null }, clearActionLabel: { classPropertyName: "clearActionLabel", publicName: "clearActionLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "onDocumentClick($event)", "keydown.escape": "close(true)" }, classAttribute: "block" }, providers: [
|
|
2150
2512
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SdsDatePicker), multi: true },
|
|
2151
2513
|
], viewQueries: [{ propertyName: "calendar", first: true, predicate: SdsCalendar, descendants: true, isSignal: true }, { propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2152
2514
|
@if (label()) {
|
|
@@ -2163,6 +2525,11 @@ class SdsDatePicker {
|
|
|
2163
2525
|
[firstDayOfWeek]="firstDayOfWeek()"
|
|
2164
2526
|
[locale]="locale()"
|
|
2165
2527
|
[showActions]="showActions()"
|
|
2528
|
+
[calendarLabel]="calendarLabel()"
|
|
2529
|
+
[previousLabel]="previousLabel()"
|
|
2530
|
+
[nextLabel]="nextLabel()"
|
|
2531
|
+
[todayActionLabel]="todayActionLabel()"
|
|
2532
|
+
[clearActionLabel]="clearActionLabel()"
|
|
2166
2533
|
(valueChange)="onCalendarValue($event)"
|
|
2167
2534
|
/>
|
|
2168
2535
|
} @else {
|
|
@@ -2192,7 +2559,7 @@ class SdsDatePicker {
|
|
|
2192
2559
|
<button
|
|
2193
2560
|
type="button"
|
|
2194
2561
|
tabindex="-1"
|
|
2195
|
-
aria-label="
|
|
2562
|
+
[attr.aria-label]="clearLabel()"
|
|
2196
2563
|
class="absolute right-10 inline-flex h-6 w-6 items-center justify-center rounded-full text-ink-faint hover:bg-black/5 hover:text-ink-soft"
|
|
2197
2564
|
(click)="clear($event)"
|
|
2198
2565
|
>
|
|
@@ -2203,7 +2570,7 @@ class SdsDatePicker {
|
|
|
2203
2570
|
<button
|
|
2204
2571
|
type="button"
|
|
2205
2572
|
tabindex="-1"
|
|
2206
|
-
[attr.aria-label]="open() ?
|
|
2573
|
+
[attr.aria-label]="open() ? closeCalendarLabel() : openCalendarLabel()"
|
|
2207
2574
|
class="absolute right-2 inline-flex h-7 w-7 items-center justify-center rounded-control text-ink-soft hover:bg-muted"
|
|
2208
2575
|
(click)="toggle($event)"
|
|
2209
2576
|
>
|
|
@@ -2218,7 +2585,7 @@ class SdsDatePicker {
|
|
|
2218
2585
|
class="fixed z-[1000]"
|
|
2219
2586
|
role="dialog"
|
|
2220
2587
|
aria-modal="false"
|
|
2221
|
-
aria-label="
|
|
2588
|
+
[attr.aria-label]="panelLabel()"
|
|
2222
2589
|
(keydown.escape)="close(true)"
|
|
2223
2590
|
>
|
|
2224
2591
|
<sds-calendar
|
|
@@ -2228,6 +2595,11 @@ class SdsDatePicker {
|
|
|
2228
2595
|
[firstDayOfWeek]="firstDayOfWeek()"
|
|
2229
2596
|
[locale]="locale()"
|
|
2230
2597
|
[showActions]="showActions()"
|
|
2598
|
+
[calendarLabel]="calendarLabel()"
|
|
2599
|
+
[previousLabel]="previousLabel()"
|
|
2600
|
+
[nextLabel]="nextLabel()"
|
|
2601
|
+
[todayActionLabel]="todayActionLabel()"
|
|
2602
|
+
[clearActionLabel]="clearActionLabel()"
|
|
2231
2603
|
(valueChange)="onCalendarValue($event)"
|
|
2232
2604
|
(dateSelect)="close(true)"
|
|
2233
2605
|
/>
|
|
@@ -2242,7 +2614,7 @@ class SdsDatePicker {
|
|
|
2242
2614
|
@if (error()) {
|
|
2243
2615
|
<p class="mt-1.5 text-xs font-medium text-danger">{{ error() }}</p>
|
|
2244
2616
|
}
|
|
2245
|
-
`, isInline: true, dependencies: [{ kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth"] }, { kind: "component", type: SdsCalendar, selector: "sds-calendar", inputs: ["value", "min", "max", "firstDayOfWeek", "locale", "showActions"], outputs: ["valueChange", "dateSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2617
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth"] }, { kind: "component", type: SdsCalendar, selector: "sds-calendar", inputs: ["value", "min", "max", "firstDayOfWeek", "locale", "showActions", "calendarLabel", "previousLabel", "nextLabel", "todayActionLabel", "clearActionLabel"], outputs: ["valueChange", "dateSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2246
2618
|
}
|
|
2247
2619
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsDatePicker, decorators: [{
|
|
2248
2620
|
type: Component,
|
|
@@ -2273,6 +2645,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2273
2645
|
[firstDayOfWeek]="firstDayOfWeek()"
|
|
2274
2646
|
[locale]="locale()"
|
|
2275
2647
|
[showActions]="showActions()"
|
|
2648
|
+
[calendarLabel]="calendarLabel()"
|
|
2649
|
+
[previousLabel]="previousLabel()"
|
|
2650
|
+
[nextLabel]="nextLabel()"
|
|
2651
|
+
[todayActionLabel]="todayActionLabel()"
|
|
2652
|
+
[clearActionLabel]="clearActionLabel()"
|
|
2276
2653
|
(valueChange)="onCalendarValue($event)"
|
|
2277
2654
|
/>
|
|
2278
2655
|
} @else {
|
|
@@ -2302,7 +2679,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2302
2679
|
<button
|
|
2303
2680
|
type="button"
|
|
2304
2681
|
tabindex="-1"
|
|
2305
|
-
aria-label="
|
|
2682
|
+
[attr.aria-label]="clearLabel()"
|
|
2306
2683
|
class="absolute right-10 inline-flex h-6 w-6 items-center justify-center rounded-full text-ink-faint hover:bg-black/5 hover:text-ink-soft"
|
|
2307
2684
|
(click)="clear($event)"
|
|
2308
2685
|
>
|
|
@@ -2313,7 +2690,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2313
2690
|
<button
|
|
2314
2691
|
type="button"
|
|
2315
2692
|
tabindex="-1"
|
|
2316
|
-
[attr.aria-label]="open() ?
|
|
2693
|
+
[attr.aria-label]="open() ? closeCalendarLabel() : openCalendarLabel()"
|
|
2317
2694
|
class="absolute right-2 inline-flex h-7 w-7 items-center justify-center rounded-control text-ink-soft hover:bg-muted"
|
|
2318
2695
|
(click)="toggle($event)"
|
|
2319
2696
|
>
|
|
@@ -2328,7 +2705,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2328
2705
|
class="fixed z-[1000]"
|
|
2329
2706
|
role="dialog"
|
|
2330
2707
|
aria-modal="false"
|
|
2331
|
-
aria-label="
|
|
2708
|
+
[attr.aria-label]="panelLabel()"
|
|
2332
2709
|
(keydown.escape)="close(true)"
|
|
2333
2710
|
>
|
|
2334
2711
|
<sds-calendar
|
|
@@ -2338,6 +2715,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2338
2715
|
[firstDayOfWeek]="firstDayOfWeek()"
|
|
2339
2716
|
[locale]="locale()"
|
|
2340
2717
|
[showActions]="showActions()"
|
|
2718
|
+
[calendarLabel]="calendarLabel()"
|
|
2719
|
+
[previousLabel]="previousLabel()"
|
|
2720
|
+
[nextLabel]="nextLabel()"
|
|
2721
|
+
[todayActionLabel]="todayActionLabel()"
|
|
2722
|
+
[clearActionLabel]="clearActionLabel()"
|
|
2341
2723
|
(valueChange)="onCalendarValue($event)"
|
|
2342
2724
|
(dateSelect)="close(true)"
|
|
2343
2725
|
/>
|
|
@@ -2354,7 +2736,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2354
2736
|
}
|
|
2355
2737
|
`,
|
|
2356
2738
|
}]
|
|
2357
|
-
}], 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 }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], showActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showActions", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], calendar: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdsCalendar), { isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
2739
|
+
}], 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 }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], showActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showActions", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], openCalendarLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "openCalendarLabel", required: false }] }], closeCalendarLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeCalendarLabel", required: false }] }], panelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelLabel", required: false }] }], calendarLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarLabel", required: false }] }], previousLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousLabel", required: false }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: false }] }], todayActionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayActionLabel", required: false }] }], clearActionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearActionLabel", required: false }] }], calendar: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdsCalendar), { isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
2358
2740
|
let nextId$6 = 0;
|
|
2359
2741
|
|
|
2360
2742
|
const SIZES$4 = {
|
|
@@ -3782,6 +4164,40 @@ class SdsPhoneInput {
|
|
|
3782
4164
|
/** Show an example number as a hint when no [hint] is provided. */
|
|
3783
4165
|
showExampleHint = input(true, ...(ngDevMode ? [{ debugName: "showExampleHint", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
3784
4166
|
requiredMessage = input('Numéro de téléphone requis', ...(ngDevMode ? [{ debugName: "requiredMessage" }] : []));
|
|
4167
|
+
/**
|
|
4168
|
+
* Accessible name of the country selector. `{country}` is replaced with the selected country's
|
|
4169
|
+
* name. A token rather than a prefix because word order differs per language. French default so
|
|
4170
|
+
* existing consumers are unchanged; translate it in any app serving more than one language.
|
|
4171
|
+
*
|
|
4172
|
+
* Note the interpolated country NAME still comes from the library's built-in country table, which
|
|
4173
|
+
* is French-only — translating this template fixes the wrapper, not the name inside it.
|
|
4174
|
+
*/
|
|
4175
|
+
countryLabel = input('Indicatif pays : {country}', ...(ngDevMode ? [{ debugName: "countryLabel" }] : []));
|
|
4176
|
+
/**
|
|
4177
|
+
* Accessible name for the clear button. It is icon-only, so this string is its ONLY accessible
|
|
4178
|
+
* name — a hardcoded French one is simply wrong in every other locale.
|
|
4179
|
+
*/
|
|
4180
|
+
clearLabel = input('Effacer', ...(ngDevMode ? [{ debugName: "clearLabel" }] : []));
|
|
4181
|
+
/** Accessible name for the country-search field inside the dropdown. */
|
|
4182
|
+
searchLabel = input('Rechercher un pays', ...(ngDevMode ? [{ debugName: "searchLabel" }] : []));
|
|
4183
|
+
/** Placeholder text of the country-search field. */
|
|
4184
|
+
searchPlaceholder = input('Rechercher un pays…', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : []));
|
|
4185
|
+
/** Shown in place of the list when no country matches the filter. */
|
|
4186
|
+
noResultsLabel = input('Aucun pays', ...(ngDevMode ? [{ debugName: "noResultsLabel" }] : []));
|
|
4187
|
+
/**
|
|
4188
|
+
* Built-in validation messages. `{lengths}` is replaced with the country's accepted national
|
|
4189
|
+
* lengths, joined with {@link lengthSeparator}. Siblings of {@link requiredMessage}, which was
|
|
4190
|
+
* already translatable — these two were not, so an English or Dutch app showed French errors.
|
|
4191
|
+
*/
|
|
4192
|
+
incompleteMessage = input('Numéro incomplet — {lengths} chiffres attendus', ...(ngDevMode ? [{ debugName: "incompleteMessage" }] : []));
|
|
4193
|
+
invalidMessage = input('Numéro invalide — {lengths} chiffres attendus', ...(ngDevMode ? [{ debugName: "invalidMessage" }] : []));
|
|
4194
|
+
/** Joins the accepted lengths when a country allows more than one (e.g. "8 ou 9"). */
|
|
4195
|
+
lengthSeparator = input(' ou ', ...(ngDevMode ? [{ debugName: "lengthSeparator" }] : []));
|
|
4196
|
+
/**
|
|
4197
|
+
* Auto-generated example hint (see {@link showExampleHint}). `{number}` is replaced with the
|
|
4198
|
+
* formatted international example number.
|
|
4199
|
+
*/
|
|
4200
|
+
exampleHintTemplate = input('Ex. {number}', ...(ngDevMode ? [{ debugName: "exampleHintTemplate" }] : []));
|
|
3785
4201
|
/** Emitted with the parsed parts whenever the number or country changes. */
|
|
3786
4202
|
phoneChange = output();
|
|
3787
4203
|
national = signal('', ...(ngDevMode ? [{ debugName: "national" }] : []));
|
|
@@ -3832,8 +4248,10 @@ class SdsPhoneInput {
|
|
|
3832
4248
|
if (!this.showExampleHint())
|
|
3833
4249
|
return '';
|
|
3834
4250
|
const c = this.country();
|
|
3835
|
-
|
|
4251
|
+
const number = `+${c.dialCode} ${sdsFormatNational(c.example, c.format)}`;
|
|
4252
|
+
return this.exampleHintTemplate().replace('{number}', number);
|
|
3836
4253
|
}, ...(ngDevMode ? [{ debugName: "autoHint" }] : []));
|
|
4254
|
+
countryAriaLabel = computed(() => this.countryLabel().replace('{country}', this.country().name), ...(ngDevMode ? [{ debugName: "countryAriaLabel" }] : []));
|
|
3837
4255
|
e164 = computed(() => {
|
|
3838
4256
|
const d = this.national();
|
|
3839
4257
|
return d ? `+${this.country().dialCode}${d}` : '';
|
|
@@ -3861,12 +4279,12 @@ class SdsPhoneInput {
|
|
|
3861
4279
|
if (this.required() && !this.national())
|
|
3862
4280
|
return this.requiredMessage();
|
|
3863
4281
|
const lengths = this.country().lengths;
|
|
3864
|
-
const expected = lengths.join(
|
|
4282
|
+
const expected = lengths.join(this.lengthSeparator());
|
|
3865
4283
|
const len = this.national().length;
|
|
3866
4284
|
const min = Math.min(...lengths);
|
|
3867
4285
|
if (len < min)
|
|
3868
|
-
return
|
|
3869
|
-
return
|
|
4286
|
+
return this.incompleteMessage().replace('{lengths}', expected);
|
|
4287
|
+
return this.invalidMessage().replace('{lengths}', expected);
|
|
3870
4288
|
}, ...(ngDevMode ? [{ debugName: "errorMessage" }] : []));
|
|
3871
4289
|
describedBy = computed(() => {
|
|
3872
4290
|
if (this.showError())
|
|
@@ -4149,7 +4567,7 @@ class SdsPhoneInput {
|
|
|
4149
4567
|
this.onValidatorChange = fn;
|
|
4150
4568
|
}
|
|
4151
4569
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsPhoneInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4152
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsPhoneInput, isStandalone: true, selector: "sds-phone-input", inputs: { label: { classPropertyName: "label", publicName: "label", 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 }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, defaultCountry: { classPropertyName: "defaultCountry", publicName: "defaultCountry", isSignal: true, isRequired: false, transformFunction: null }, preferredCountries: { classPropertyName: "preferredCountries", publicName: "preferredCountries", isSignal: true, isRequired: false, transformFunction: null }, onlyCountries: { classPropertyName: "onlyCountries", publicName: "onlyCountries", isSignal: true, isRequired: false, transformFunction: null }, showExampleHint: { classPropertyName: "showExampleHint", publicName: "showExampleHint", isSignal: true, isRequired: false, transformFunction: null }, requiredMessage: { classPropertyName: "requiredMessage", publicName: "requiredMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { phoneChange: "phoneChange" }, host: { listeners: { "document:click": "onDocumentClick($event)" }, classAttribute: "block" }, providers: [
|
|
4570
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsPhoneInput, isStandalone: true, selector: "sds-phone-input", inputs: { label: { classPropertyName: "label", publicName: "label", 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 }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, defaultCountry: { classPropertyName: "defaultCountry", publicName: "defaultCountry", isSignal: true, isRequired: false, transformFunction: null }, preferredCountries: { classPropertyName: "preferredCountries", publicName: "preferredCountries", isSignal: true, isRequired: false, transformFunction: null }, onlyCountries: { classPropertyName: "onlyCountries", publicName: "onlyCountries", isSignal: true, isRequired: false, transformFunction: null }, showExampleHint: { classPropertyName: "showExampleHint", publicName: "showExampleHint", isSignal: true, isRequired: false, transformFunction: null }, requiredMessage: { classPropertyName: "requiredMessage", publicName: "requiredMessage", isSignal: true, isRequired: false, transformFunction: null }, countryLabel: { classPropertyName: "countryLabel", publicName: "countryLabel", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, noResultsLabel: { classPropertyName: "noResultsLabel", publicName: "noResultsLabel", isSignal: true, isRequired: false, transformFunction: null }, incompleteMessage: { classPropertyName: "incompleteMessage", publicName: "incompleteMessage", isSignal: true, isRequired: false, transformFunction: null }, invalidMessage: { classPropertyName: "invalidMessage", publicName: "invalidMessage", isSignal: true, isRequired: false, transformFunction: null }, lengthSeparator: { classPropertyName: "lengthSeparator", publicName: "lengthSeparator", isSignal: true, isRequired: false, transformFunction: null }, exampleHintTemplate: { classPropertyName: "exampleHintTemplate", publicName: "exampleHintTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { phoneChange: "phoneChange" }, host: { listeners: { "document:click": "onDocumentClick($event)" }, classAttribute: "block" }, providers: [
|
|
4153
4571
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SdsPhoneInput), multi: true },
|
|
4154
4572
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => SdsPhoneInput), multi: true },
|
|
4155
4573
|
], viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true, isSignal: true }, { propertyName: "field", first: true, predicate: ["field"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
@@ -4172,7 +4590,7 @@ class SdsPhoneInput {
|
|
|
4172
4590
|
[attr.aria-expanded]="open()"
|
|
4173
4591
|
[attr.aria-controls]="listId"
|
|
4174
4592
|
aria-haspopup="listbox"
|
|
4175
|
-
[attr.aria-label]="
|
|
4593
|
+
[attr.aria-label]="countryAriaLabel()"
|
|
4176
4594
|
class="flex shrink-0 items-center gap-1.5 rounded-l-control pl-2.5 pr-2 focus:outline-none"
|
|
4177
4595
|
[class.cursor-not-allowed]="isDisabled()"
|
|
4178
4596
|
(click)="toggle()"
|
|
@@ -4213,7 +4631,7 @@ class SdsPhoneInput {
|
|
|
4213
4631
|
<button
|
|
4214
4632
|
type="button"
|
|
4215
4633
|
tabindex="-1"
|
|
4216
|
-
aria-label="
|
|
4634
|
+
[attr.aria-label]="clearLabel()"
|
|
4217
4635
|
class="mr-1.5 inline-flex w-7 shrink-0 items-center justify-center rounded-full text-ink-faint hover:bg-black/5 hover:text-ink-soft"
|
|
4218
4636
|
(click)="clear()"
|
|
4219
4637
|
>
|
|
@@ -4235,8 +4653,8 @@ class SdsPhoneInput {
|
|
|
4235
4653
|
type="text"
|
|
4236
4654
|
[attr.aria-controls]="listId"
|
|
4237
4655
|
[value]="filterText()"
|
|
4238
|
-
placeholder="
|
|
4239
|
-
aria-label="
|
|
4656
|
+
[placeholder]="searchPlaceholder()"
|
|
4657
|
+
[attr.aria-label]="searchLabel()"
|
|
4240
4658
|
class="h-9 w-full bg-transparent pl-8 pr-2 text-sm text-ink outline-none placeholder:text-ink-faint"
|
|
4241
4659
|
(input)="onFilter($event)"
|
|
4242
4660
|
(keydown)="onFilterKeydown($event)"
|
|
@@ -4262,7 +4680,7 @@ class SdsPhoneInput {
|
|
|
4262
4680
|
<span class="text-ink-faint">+{{ c.dialCode }}</span>
|
|
4263
4681
|
</li>
|
|
4264
4682
|
} @empty {
|
|
4265
|
-
<li class="px-3 py-2 text-sm text-ink-faint">
|
|
4683
|
+
<li class="px-3 py-2 text-sm text-ink-faint">{{ noResultsLabel() }}</li>
|
|
4266
4684
|
}
|
|
4267
4685
|
</ul>
|
|
4268
4686
|
</div>
|
|
@@ -4313,7 +4731,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4313
4731
|
[attr.aria-expanded]="open()"
|
|
4314
4732
|
[attr.aria-controls]="listId"
|
|
4315
4733
|
aria-haspopup="listbox"
|
|
4316
|
-
[attr.aria-label]="
|
|
4734
|
+
[attr.aria-label]="countryAriaLabel()"
|
|
4317
4735
|
class="flex shrink-0 items-center gap-1.5 rounded-l-control pl-2.5 pr-2 focus:outline-none"
|
|
4318
4736
|
[class.cursor-not-allowed]="isDisabled()"
|
|
4319
4737
|
(click)="toggle()"
|
|
@@ -4354,7 +4772,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4354
4772
|
<button
|
|
4355
4773
|
type="button"
|
|
4356
4774
|
tabindex="-1"
|
|
4357
|
-
aria-label="
|
|
4775
|
+
[attr.aria-label]="clearLabel()"
|
|
4358
4776
|
class="mr-1.5 inline-flex w-7 shrink-0 items-center justify-center rounded-full text-ink-faint hover:bg-black/5 hover:text-ink-soft"
|
|
4359
4777
|
(click)="clear()"
|
|
4360
4778
|
>
|
|
@@ -4376,8 +4794,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4376
4794
|
type="text"
|
|
4377
4795
|
[attr.aria-controls]="listId"
|
|
4378
4796
|
[value]="filterText()"
|
|
4379
|
-
placeholder="
|
|
4380
|
-
aria-label="
|
|
4797
|
+
[placeholder]="searchPlaceholder()"
|
|
4798
|
+
[attr.aria-label]="searchLabel()"
|
|
4381
4799
|
class="h-9 w-full bg-transparent pl-8 pr-2 text-sm text-ink outline-none placeholder:text-ink-faint"
|
|
4382
4800
|
(input)="onFilter($event)"
|
|
4383
4801
|
(keydown)="onFilterKeydown($event)"
|
|
@@ -4403,7 +4821,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4403
4821
|
<span class="text-ink-faint">+{{ c.dialCode }}</span>
|
|
4404
4822
|
</li>
|
|
4405
4823
|
} @empty {
|
|
4406
|
-
<li class="px-3 py-2 text-sm text-ink-faint">
|
|
4824
|
+
<li class="px-3 py-2 text-sm text-ink-faint">{{ noResultsLabel() }}</li>
|
|
4407
4825
|
}
|
|
4408
4826
|
</ul>
|
|
4409
4827
|
</div>
|
|
@@ -4420,7 +4838,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4420
4838
|
}
|
|
4421
4839
|
`,
|
|
4422
4840
|
}]
|
|
4423
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", 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 }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], defaultCountry: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultCountry", required: false }] }], preferredCountries: [{ type: i0.Input, args: [{ isSignal: true, alias: "preferredCountries", required: false }] }], onlyCountries: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlyCountries", required: false }] }], showExampleHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExampleHint", required: false }] }], requiredMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredMessage", required: false }] }], phoneChange: [{ type: i0.Output, args: ["phoneChange"] }], anchor: [{ type: i0.ViewChild, args: ['anchor', { isSignal: true }] }], field: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }] } });
|
|
4841
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", 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 }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], defaultCountry: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultCountry", required: false }] }], preferredCountries: [{ type: i0.Input, args: [{ isSignal: true, alias: "preferredCountries", required: false }] }], onlyCountries: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlyCountries", required: false }] }], showExampleHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExampleHint", required: false }] }], requiredMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredMessage", required: false }] }], countryLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "countryLabel", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], noResultsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsLabel", required: false }] }], incompleteMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "incompleteMessage", required: false }] }], invalidMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidMessage", required: false }] }], lengthSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "lengthSeparator", required: false }] }], exampleHintTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "exampleHintTemplate", required: false }] }], phoneChange: [{ type: i0.Output, args: ["phoneChange"] }], anchor: [{ type: i0.ViewChild, args: ['anchor', { isSignal: true }] }], field: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }] } });
|
|
4424
4842
|
|
|
4425
4843
|
const SIZES$1 = {
|
|
4426
4844
|
sm: 'h-8 min-w-8 text-xs',
|
|
@@ -4469,6 +4887,28 @@ class SdsPaginator {
|
|
|
4469
4887
|
showJumpToPageInput = input(false, ...(ngDevMode ? [{ debugName: "showJumpToPageInput", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
4470
4888
|
rowsPerPageLabel = input('Lignes par page', ...(ngDevMode ? [{ debugName: "rowsPerPageLabel" }] : []));
|
|
4471
4889
|
jumpToPageLabel = input('Aller à', ...(ngDevMode ? [{ debugName: "jumpToPageLabel" }] : []));
|
|
4890
|
+
/**
|
|
4891
|
+
* Accessible name for the <nav> wrapping the page controls, and for the four icon-only
|
|
4892
|
+
* first/prev/next/last buttons. Those buttons have no text, so these strings are their ONLY
|
|
4893
|
+
* accessible names — the French defaults keep existing consumers unchanged, but an app serving more
|
|
4894
|
+
* than one language MUST pass translated values.
|
|
4895
|
+
*/
|
|
4896
|
+
paginationLabel = input('Pagination', ...(ngDevMode ? [{ debugName: "paginationLabel" }] : []));
|
|
4897
|
+
firstPageLabel = input('Première page', ...(ngDevMode ? [{ debugName: "firstPageLabel" }] : []));
|
|
4898
|
+
previousPageLabel = input('Page précédente', ...(ngDevMode ? [{ debugName: "previousPageLabel" }] : []));
|
|
4899
|
+
nextPageLabel = input('Page suivante', ...(ngDevMode ? [{ debugName: "nextPageLabel" }] : []));
|
|
4900
|
+
lastPageLabel = input('Dernière page', ...(ngDevMode ? [{ debugName: "lastPageLabel" }] : []));
|
|
4901
|
+
/**
|
|
4902
|
+
* Accessible name of a numbered page link. `{page}` is replaced with the 1-based page number —
|
|
4903
|
+
* a token rather than a prefix because word order is not the same in every language.
|
|
4904
|
+
*/
|
|
4905
|
+
pageLinkLabel = input('Page {page}', ...(ngDevMode ? [{ debugName: "pageLinkLabel" }] : []));
|
|
4906
|
+
/**
|
|
4907
|
+
* Accessible name of the jump-to-page field. Separate from the visible {@link jumpToPageLabel}
|
|
4908
|
+
* ("Aller à") on purpose: the visible text is terse because it sits next to the field, while the
|
|
4909
|
+
* accessible name has to stand alone.
|
|
4910
|
+
*/
|
|
4911
|
+
jumpToPageAriaLabel = input('Aller à la page', ...(ngDevMode ? [{ debugName: "jumpToPageAriaLabel" }] : []));
|
|
4472
4912
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
4473
4913
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
4474
4914
|
/** Fires after any page or page-size change with the full paginator state. */
|
|
@@ -4504,6 +4944,9 @@ class SdsPaginator {
|
|
|
4504
4944
|
const justify = this.showCurrentPageReport() ? 'justify-between' : 'justify-center';
|
|
4505
4945
|
return `${base} ${justify}`;
|
|
4506
4946
|
}, ...(ngDevMode ? [{ debugName: "hostClass" }] : []));
|
|
4947
|
+
pageLinkAriaLabel(page) {
|
|
4948
|
+
return this.pageLinkLabel().replace('{page}', String(page + 1));
|
|
4949
|
+
}
|
|
4507
4950
|
navClass(isDisabled) {
|
|
4508
4951
|
const cls = `${BTN_BASE} ${SIZES$1[this.size()]} px-0`;
|
|
4509
4952
|
return isDisabled
|
|
@@ -4571,20 +5014,20 @@ class SdsPaginator {
|
|
|
4571
5014
|
});
|
|
4572
5015
|
}
|
|
4573
5016
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsPaginator, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4574
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsPaginator, isStandalone: true, selector: "sds-paginator", inputs: { totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, pageLinkSize: { classPropertyName: "pageLinkSize", publicName: "pageLinkSize", isSignal: true, isRequired: false, transformFunction: null }, showFirstLastIcon: { classPropertyName: "showFirstLastIcon", publicName: "showFirstLastIcon", isSignal: true, isRequired: false, transformFunction: null }, showPageLinks: { classPropertyName: "showPageLinks", publicName: "showPageLinks", isSignal: true, isRequired: false, transformFunction: null }, showCurrentPageReport: { classPropertyName: "showCurrentPageReport", publicName: "showCurrentPageReport", isSignal: true, isRequired: false, transformFunction: null }, currentPageReportTemplate: { classPropertyName: "currentPageReportTemplate", publicName: "currentPageReportTemplate", isSignal: true, isRequired: false, transformFunction: null }, showJumpToPageInput: { classPropertyName: "showJumpToPageInput", publicName: "showJumpToPageInput", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageLabel: { classPropertyName: "rowsPerPageLabel", publicName: "rowsPerPageLabel", isSignal: true, isRequired: false, transformFunction: null }, jumpToPageLabel: { classPropertyName: "jumpToPageLabel", publicName: "jumpToPageLabel", 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: { first: "firstChange", rows: "rowsChange", pageChange: "pageChange" }, host: { properties: { "class": "hostClass()" } }, ngImport: i0, template: `
|
|
5017
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsPaginator, isStandalone: true, selector: "sds-paginator", inputs: { totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, pageLinkSize: { classPropertyName: "pageLinkSize", publicName: "pageLinkSize", isSignal: true, isRequired: false, transformFunction: null }, showFirstLastIcon: { classPropertyName: "showFirstLastIcon", publicName: "showFirstLastIcon", isSignal: true, isRequired: false, transformFunction: null }, showPageLinks: { classPropertyName: "showPageLinks", publicName: "showPageLinks", isSignal: true, isRequired: false, transformFunction: null }, showCurrentPageReport: { classPropertyName: "showCurrentPageReport", publicName: "showCurrentPageReport", isSignal: true, isRequired: false, transformFunction: null }, currentPageReportTemplate: { classPropertyName: "currentPageReportTemplate", publicName: "currentPageReportTemplate", isSignal: true, isRequired: false, transformFunction: null }, showJumpToPageInput: { classPropertyName: "showJumpToPageInput", publicName: "showJumpToPageInput", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageLabel: { classPropertyName: "rowsPerPageLabel", publicName: "rowsPerPageLabel", isSignal: true, isRequired: false, transformFunction: null }, jumpToPageLabel: { classPropertyName: "jumpToPageLabel", publicName: "jumpToPageLabel", isSignal: true, isRequired: false, transformFunction: null }, paginationLabel: { classPropertyName: "paginationLabel", publicName: "paginationLabel", isSignal: true, isRequired: false, transformFunction: null }, firstPageLabel: { classPropertyName: "firstPageLabel", publicName: "firstPageLabel", isSignal: true, isRequired: false, transformFunction: null }, previousPageLabel: { classPropertyName: "previousPageLabel", publicName: "previousPageLabel", isSignal: true, isRequired: false, transformFunction: null }, nextPageLabel: { classPropertyName: "nextPageLabel", publicName: "nextPageLabel", isSignal: true, isRequired: false, transformFunction: null }, lastPageLabel: { classPropertyName: "lastPageLabel", publicName: "lastPageLabel", isSignal: true, isRequired: false, transformFunction: null }, pageLinkLabel: { classPropertyName: "pageLinkLabel", publicName: "pageLinkLabel", isSignal: true, isRequired: false, transformFunction: null }, jumpToPageAriaLabel: { classPropertyName: "jumpToPageAriaLabel", publicName: "jumpToPageAriaLabel", 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: { first: "firstChange", rows: "rowsChange", pageChange: "pageChange" }, host: { properties: { "class": "hostClass()" } }, ngImport: i0, template: `
|
|
4575
5018
|
@if (showCurrentPageReport()) {
|
|
4576
5019
|
<span class="text-sm text-ink-soft">{{ reportText() }}</span>
|
|
4577
5020
|
}
|
|
4578
5021
|
|
|
4579
5022
|
<div class="flex flex-wrap items-center gap-x-4 gap-y-2">
|
|
4580
5023
|
<!-- page navigation -->
|
|
4581
|
-
<nav class="flex items-center gap-1" aria-label="
|
|
5024
|
+
<nav class="flex items-center gap-1" [attr.aria-label]="paginationLabel()">
|
|
4582
5025
|
@if (showFirstLastIcon()) {
|
|
4583
5026
|
<button
|
|
4584
5027
|
type="button"
|
|
4585
5028
|
[class]="navClass(firstDisabled())"
|
|
4586
5029
|
[disabled]="firstDisabled()"
|
|
4587
|
-
aria-label="
|
|
5030
|
+
[attr.aria-label]="firstPageLabel()"
|
|
4588
5031
|
(click)="firstPage()"
|
|
4589
5032
|
>
|
|
4590
5033
|
<sds-icon name="chevrons-left" [size]="iconSize()" />
|
|
@@ -4594,7 +5037,7 @@ class SdsPaginator {
|
|
|
4594
5037
|
type="button"
|
|
4595
5038
|
[class]="navClass(firstDisabled())"
|
|
4596
5039
|
[disabled]="firstDisabled()"
|
|
4597
|
-
aria-label="
|
|
5040
|
+
[attr.aria-label]="previousPageLabel()"
|
|
4598
5041
|
(click)="prevPage()"
|
|
4599
5042
|
>
|
|
4600
5043
|
<sds-icon name="chevron-left" [size]="iconSize()" />
|
|
@@ -4605,7 +5048,7 @@ class SdsPaginator {
|
|
|
4605
5048
|
<button
|
|
4606
5049
|
type="button"
|
|
4607
5050
|
[class]="linkClass(p === page())"
|
|
4608
|
-
[attr.aria-label]="
|
|
5051
|
+
[attr.aria-label]="pageLinkAriaLabel(p)"
|
|
4609
5052
|
[attr.aria-current]="p === page() ? 'page' : null"
|
|
4610
5053
|
[disabled]="disabled()"
|
|
4611
5054
|
(click)="changePage(p)"
|
|
@@ -4619,7 +5062,7 @@ class SdsPaginator {
|
|
|
4619
5062
|
type="button"
|
|
4620
5063
|
[class]="navClass(lastDisabled())"
|
|
4621
5064
|
[disabled]="lastDisabled()"
|
|
4622
|
-
aria-label="
|
|
5065
|
+
[attr.aria-label]="nextPageLabel()"
|
|
4623
5066
|
(click)="nextPage()"
|
|
4624
5067
|
>
|
|
4625
5068
|
<sds-icon name="chevron-right" [size]="iconSize()" />
|
|
@@ -4629,7 +5072,7 @@ class SdsPaginator {
|
|
|
4629
5072
|
type="button"
|
|
4630
5073
|
[class]="navClass(lastDisabled())"
|
|
4631
5074
|
[disabled]="lastDisabled()"
|
|
4632
|
-
aria-label="
|
|
5075
|
+
[attr.aria-label]="lastPageLabel()"
|
|
4633
5076
|
(click)="lastPage()"
|
|
4634
5077
|
>
|
|
4635
5078
|
<sds-icon name="chevrons-right" [size]="iconSize()" />
|
|
@@ -4644,7 +5087,7 @@ class SdsPaginator {
|
|
|
4644
5087
|
<span class="w-20">
|
|
4645
5088
|
<sds-select
|
|
4646
5089
|
size="sm"
|
|
4647
|
-
ariaLabel="
|
|
5090
|
+
[ariaLabel]="rowsPerPageLabel()"
|
|
4648
5091
|
[options]="rowsPerPageOptions()"
|
|
4649
5092
|
[ngModel]="rows()"
|
|
4650
5093
|
(ngModelChange)="onRowsChange($event)"
|
|
@@ -4664,7 +5107,7 @@ class SdsPaginator {
|
|
|
4664
5107
|
[max]="pageCount()"
|
|
4665
5108
|
[value]="page() + 1"
|
|
4666
5109
|
[disabled]="disabled()"
|
|
4667
|
-
aria-label="
|
|
5110
|
+
[attr.aria-label]="jumpToPageAriaLabel()"
|
|
4668
5111
|
(change)="onJump($event)"
|
|
4669
5112
|
class="h-9 w-16 rounded-control border border-border bg-white px-2 text-center text-sm text-ink outline-none transition-colors focus:border-brand-500 focus:ring-2 focus:ring-brand-500/25 disabled:opacity-60"
|
|
4670
5113
|
/>
|
|
@@ -4687,13 +5130,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4687
5130
|
|
|
4688
5131
|
<div class="flex flex-wrap items-center gap-x-4 gap-y-2">
|
|
4689
5132
|
<!-- page navigation -->
|
|
4690
|
-
<nav class="flex items-center gap-1" aria-label="
|
|
5133
|
+
<nav class="flex items-center gap-1" [attr.aria-label]="paginationLabel()">
|
|
4691
5134
|
@if (showFirstLastIcon()) {
|
|
4692
5135
|
<button
|
|
4693
5136
|
type="button"
|
|
4694
5137
|
[class]="navClass(firstDisabled())"
|
|
4695
5138
|
[disabled]="firstDisabled()"
|
|
4696
|
-
aria-label="
|
|
5139
|
+
[attr.aria-label]="firstPageLabel()"
|
|
4697
5140
|
(click)="firstPage()"
|
|
4698
5141
|
>
|
|
4699
5142
|
<sds-icon name="chevrons-left" [size]="iconSize()" />
|
|
@@ -4703,7 +5146,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4703
5146
|
type="button"
|
|
4704
5147
|
[class]="navClass(firstDisabled())"
|
|
4705
5148
|
[disabled]="firstDisabled()"
|
|
4706
|
-
aria-label="
|
|
5149
|
+
[attr.aria-label]="previousPageLabel()"
|
|
4707
5150
|
(click)="prevPage()"
|
|
4708
5151
|
>
|
|
4709
5152
|
<sds-icon name="chevron-left" [size]="iconSize()" />
|
|
@@ -4714,7 +5157,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4714
5157
|
<button
|
|
4715
5158
|
type="button"
|
|
4716
5159
|
[class]="linkClass(p === page())"
|
|
4717
|
-
[attr.aria-label]="
|
|
5160
|
+
[attr.aria-label]="pageLinkAriaLabel(p)"
|
|
4718
5161
|
[attr.aria-current]="p === page() ? 'page' : null"
|
|
4719
5162
|
[disabled]="disabled()"
|
|
4720
5163
|
(click)="changePage(p)"
|
|
@@ -4728,7 +5171,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4728
5171
|
type="button"
|
|
4729
5172
|
[class]="navClass(lastDisabled())"
|
|
4730
5173
|
[disabled]="lastDisabled()"
|
|
4731
|
-
aria-label="
|
|
5174
|
+
[attr.aria-label]="nextPageLabel()"
|
|
4732
5175
|
(click)="nextPage()"
|
|
4733
5176
|
>
|
|
4734
5177
|
<sds-icon name="chevron-right" [size]="iconSize()" />
|
|
@@ -4738,7 +5181,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4738
5181
|
type="button"
|
|
4739
5182
|
[class]="navClass(lastDisabled())"
|
|
4740
5183
|
[disabled]="lastDisabled()"
|
|
4741
|
-
aria-label="
|
|
5184
|
+
[attr.aria-label]="lastPageLabel()"
|
|
4742
5185
|
(click)="lastPage()"
|
|
4743
5186
|
>
|
|
4744
5187
|
<sds-icon name="chevrons-right" [size]="iconSize()" />
|
|
@@ -4753,7 +5196,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4753
5196
|
<span class="w-20">
|
|
4754
5197
|
<sds-select
|
|
4755
5198
|
size="sm"
|
|
4756
|
-
ariaLabel="
|
|
5199
|
+
[ariaLabel]="rowsPerPageLabel()"
|
|
4757
5200
|
[options]="rowsPerPageOptions()"
|
|
4758
5201
|
[ngModel]="rows()"
|
|
4759
5202
|
(ngModelChange)="onRowsChange($event)"
|
|
@@ -4773,7 +5216,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4773
5216
|
[max]="pageCount()"
|
|
4774
5217
|
[value]="page() + 1"
|
|
4775
5218
|
[disabled]="disabled()"
|
|
4776
|
-
aria-label="
|
|
5219
|
+
[attr.aria-label]="jumpToPageAriaLabel()"
|
|
4777
5220
|
(change)="onJump($event)"
|
|
4778
5221
|
class="h-9 w-16 rounded-control border border-border bg-white px-2 text-center text-sm text-ink outline-none transition-colors focus:border-brand-500 focus:ring-2 focus:ring-brand-500/25 disabled:opacity-60"
|
|
4779
5222
|
/>
|
|
@@ -4782,7 +5225,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4782
5225
|
</div>
|
|
4783
5226
|
`,
|
|
4784
5227
|
}]
|
|
4785
|
-
}], propDecorators: { totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], first: [{ type: i0.Input, args: [{ isSignal: true, alias: "first", required: false }] }, { type: i0.Output, args: ["firstChange"] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }, { type: i0.Output, args: ["rowsChange"] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], pageLinkSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageLinkSize", required: false }] }], showFirstLastIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstLastIcon", required: false }] }], showPageLinks: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageLinks", required: false }] }], showCurrentPageReport: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCurrentPageReport", required: false }] }], currentPageReportTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPageReportTemplate", required: false }] }], showJumpToPageInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "showJumpToPageInput", required: false }] }], rowsPerPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageLabel", required: false }] }], jumpToPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "jumpToPageLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }] } });
|
|
5228
|
+
}], propDecorators: { totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], first: [{ type: i0.Input, args: [{ isSignal: true, alias: "first", required: false }] }, { type: i0.Output, args: ["firstChange"] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }, { type: i0.Output, args: ["rowsChange"] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], pageLinkSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageLinkSize", required: false }] }], showFirstLastIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstLastIcon", required: false }] }], showPageLinks: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageLinks", required: false }] }], showCurrentPageReport: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCurrentPageReport", required: false }] }], currentPageReportTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPageReportTemplate", required: false }] }], showJumpToPageInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "showJumpToPageInput", required: false }] }], rowsPerPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageLabel", required: false }] }], jumpToPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "jumpToPageLabel", required: false }] }], paginationLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginationLabel", required: false }] }], firstPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstPageLabel", required: false }] }], previousPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousPageLabel", required: false }] }], nextPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextPageLabel", required: false }] }], lastPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastPageLabel", required: false }] }], pageLinkLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageLinkLabel", required: false }] }], jumpToPageAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "jumpToPageAriaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }] } });
|
|
4786
5229
|
|
|
4787
5230
|
let nextId$2 = 0;
|
|
4788
5231
|
/**
|
|
@@ -6226,7 +6669,7 @@ class SdsTable {
|
|
|
6226
6669
|
</div>
|
|
6227
6670
|
}
|
|
6228
6671
|
</div>
|
|
6229
|
-
`, isInline: true, dependencies: [{ kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth"] }, { kind: "component", type: SdsPaginator, selector: "sds-paginator", inputs: ["totalRecords", "first", "rows", "rowsPerPageOptions", "pageLinkSize", "showFirstLastIcon", "showPageLinks", "showCurrentPageReport", "currentPageReportTemplate", "showJumpToPageInput", "rowsPerPageLabel", "jumpToPageLabel", "size", "disabled"], outputs: ["firstChange", "rowsChange", "pageChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6672
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth"] }, { kind: "component", type: SdsPaginator, selector: "sds-paginator", inputs: ["totalRecords", "first", "rows", "rowsPerPageOptions", "pageLinkSize", "showFirstLastIcon", "showPageLinks", "showCurrentPageReport", "currentPageReportTemplate", "showJumpToPageInput", "rowsPerPageLabel", "jumpToPageLabel", "paginationLabel", "firstPageLabel", "previousPageLabel", "nextPageLabel", "lastPageLabel", "pageLinkLabel", "jumpToPageAriaLabel", "size", "disabled"], outputs: ["firstChange", "rowsChange", "pageChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6230
6673
|
}
|
|
6231
6674
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsTable, decorators: [{
|
|
6232
6675
|
type: Component,
|
|
@@ -7341,5 +7784,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
7341
7784
|
* Generated bundle index. Do not edit.
|
|
7342
7785
|
*/
|
|
7343
7786
|
|
|
7344
|
-
export { SDS_ICONS, SDS_PHONE_COUNTRIES, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAvatar, SdsBadge, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsDatePicker, SdsIcon, SdsInput, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsPaginator, SdsPhoneInput, SdsSelect, SdsShell, SdsSidebar, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsToggleSwitch, SdsTopbar, SidebarStore, addDays, addMonths, addMonthsKeepDay, formatDdMmYyyy, isOutOfRange, isSameDay, isoDay, sdsFormatNational, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth };
|
|
7787
|
+
export { SDS_ICONS, SDS_PHONE_COUNTRIES, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAvatar, SdsBadge, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsDatePicker, SdsIcon, SdsInput, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsSelect, SdsShell, SdsSidebar, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsToggleSwitch, SdsTopbar, SidebarStore, addDays, addMonths, addMonthsKeepDay, formatDdMmYyyy, isOutOfRange, isSameDay, isoDay, sdsFormatNational, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth };
|
|
7345
7788
|
//# sourceMappingURL=besaitech-ng-design-system.mjs.map
|