@besaitech/ng-design-system 0.0.78 → 0.0.79
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.
- package/calendar/index.d.ts +73 -3
- package/fesm2022/besaitech-ng-design-system-calendar.mjs +268 -8
- package/fesm2022/besaitech-ng-design-system-calendar.mjs.map +1 -1
- package/fesm2022/besaitech-ng-design-system.mjs +779 -41
- package/fesm2022/besaitech-ng-design-system.mjs.map +1 -1
- package/index.d.ts +173 -23
- package/package.json +1 -1
|
@@ -438,7 +438,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
438
438
|
`, 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"] }]
|
|
439
439
|
}], 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 }] }] } });
|
|
440
440
|
|
|
441
|
-
let nextId$
|
|
441
|
+
let nextId$r = 0;
|
|
442
442
|
const SIZES$d = {
|
|
443
443
|
sm: 'h-9 text-sm',
|
|
444
444
|
md: 'h-10 text-sm',
|
|
@@ -451,7 +451,7 @@ const SIZES$d = {
|
|
|
451
451
|
* sidebar search field).
|
|
452
452
|
*/
|
|
453
453
|
class SdsInput {
|
|
454
|
-
autoId = `sds-input-${nextId$
|
|
454
|
+
autoId = `sds-input-${nextId$r++}`;
|
|
455
455
|
/**
|
|
456
456
|
* `id` of the native `<input>` — for a `<label for>` outside the component, or to focus the field with
|
|
457
457
|
* `document.getElementById(id).focus()` (after adding a row, say). Empty (default) generates one. Set it
|
|
@@ -811,7 +811,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
811
811
|
`, 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"] }]
|
|
812
812
|
}], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], 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 }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], leadingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "leadingIcon", required: false }] }], trailingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingIcon", required: false }] }], trailingAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingAction", required: false }] }], trailingActionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingActionLabel", required: false }] }], trailingActionPressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingActionPressed", required: false }] }], trailingActionClick: [{ type: i0.Output, args: ["trailingActionClick"] }] } });
|
|
813
813
|
|
|
814
|
-
let nextId$
|
|
814
|
+
let nextId$q = 0;
|
|
815
815
|
const HEIGHTS = {
|
|
816
816
|
sm: 'h-9',
|
|
817
817
|
md: 'h-10',
|
|
@@ -839,7 +839,7 @@ const TEXT = {
|
|
|
839
839
|
* with "." ("1.234" in nl-BE) stays a thousands separator.
|
|
840
840
|
*/
|
|
841
841
|
class SdsInputNumber {
|
|
842
|
-
inputId = `sds-input-number-${nextId$
|
|
842
|
+
inputId = `sds-input-number-${nextId$q++}`;
|
|
843
843
|
fieldRef = viewChild('field', ...(ngDevMode ? [{ debugName: "fieldRef" }] : []));
|
|
844
844
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
845
845
|
/** Accessible name used when no visible [label] is provided. */
|
|
@@ -1623,7 +1623,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1623
1623
|
}]
|
|
1624
1624
|
}], ctorParameters: () => [], propDecorators: { fieldRef: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedby", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], currencyDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "currencyDisplay", required: false }] }], useGrouping: [{ type: i0.Input, args: [{ isSignal: true, alias: "useGrouping", required: false }] }], minFractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "minFractionDigits", required: false }] }], maxFractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFractionDigits", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], showButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtons", required: false }] }], buttonLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonLayout", required: false }] }], incrementIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "incrementIcon", required: false }] }], decrementIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "decrementIcon", required: false }] }], allowEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmpty", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], incrementLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "incrementLabel", required: false }] }], decrementLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "decrementLabel", required: false }] }] } });
|
|
1625
1625
|
|
|
1626
|
-
let nextId$
|
|
1626
|
+
let nextId$p = 0;
|
|
1627
1627
|
const SIZES$c = {
|
|
1628
1628
|
sm: 'h-9 text-sm',
|
|
1629
1629
|
md: 'h-10 text-sm',
|
|
@@ -1664,7 +1664,7 @@ function parseTime(value) {
|
|
|
1664
1664
|
* <sds-time-input [ariaLabel]="'Closes at'" [ngModel]="end()" (ngModelChange)="end.set($event)" clearable />
|
|
1665
1665
|
*/
|
|
1666
1666
|
class SdsTimeInput {
|
|
1667
|
-
fieldId = `sds-time-input-${nextId$
|
|
1667
|
+
fieldId = `sds-time-input-${nextId$p++}`;
|
|
1668
1668
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1669
1669
|
/** Accessible name of the field when there is no visible [label]. */
|
|
1670
1670
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -2193,7 +2193,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2193
2193
|
}]
|
|
2194
2194
|
}], propDecorators: { 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 }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], withSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "withSeconds", required: false }] }], placeholderText: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholderText", required: false }] }], hoursLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoursLabel", required: false }] }], minutesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "minutesLabel", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], hoursEl: [{ type: i0.ViewChild, args: ['hoursEl', { isSignal: true }] }], minutesEl: [{ type: i0.ViewChild, args: ['minutesEl', { isSignal: true }] }] } });
|
|
2195
2195
|
|
|
2196
|
-
let nextId$
|
|
2196
|
+
let nextId$o = 0;
|
|
2197
2197
|
const SIZES$b = {
|
|
2198
2198
|
sm: 'min-h-9 text-sm',
|
|
2199
2199
|
md: 'min-h-10 text-sm',
|
|
@@ -2216,7 +2216,7 @@ const SIZES$b = {
|
|
|
2216
2216
|
* `<sds-localized-input [languages]="['fr','nl','en']" [(ngModel)]="title" />`.
|
|
2217
2217
|
*/
|
|
2218
2218
|
class SdsLocalizedInput {
|
|
2219
|
-
autoId = `sds-localized-input-${nextId$
|
|
2219
|
+
autoId = `sds-localized-input-${nextId$o++}`;
|
|
2220
2220
|
/** The native field's id; a generated one when empty (set it to pair an external `<label for>`). */
|
|
2221
2221
|
inputId = input('', ...(ngDevMode ? [{ debugName: "inputId" }] : []));
|
|
2222
2222
|
/** The native field's id: {@link inputId} or the generated one. */
|
|
@@ -2576,7 +2576,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2576
2576
|
}]
|
|
2577
2577
|
}], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", 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 }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], requiredLanguages: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredLanguages", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], showCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCount", required: false }] }], languages: [{ type: i0.Input, args: [{ isSignal: true, alias: "languages", required: false }] }], currentLanguage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentLanguage", required: false }] }], multiline: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiline", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], languageSwitcherLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "languageSwitcherLabel", required: false }] }], untranslatedLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "untranslatedLabel", required: false }] }], requiredLanguageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredLanguageLabel", required: false }] }] } });
|
|
2578
2578
|
|
|
2579
|
-
let nextId$
|
|
2579
|
+
let nextId$n = 0;
|
|
2580
2580
|
const SIZES$a = {
|
|
2581
2581
|
md: 'h-12 w-11 text-lg',
|
|
2582
2582
|
lg: 'h-14 w-12 text-xl',
|
|
@@ -2593,7 +2593,7 @@ const SIZES$a = {
|
|
|
2593
2593
|
* first box and have it land correctly.
|
|
2594
2594
|
*/
|
|
2595
2595
|
class SdsOtpInput {
|
|
2596
|
-
groupId = `sds-otp-${nextId$
|
|
2596
|
+
groupId = `sds-otp-${nextId$n++}`;
|
|
2597
2597
|
/** How many boxes / characters the code has. */
|
|
2598
2598
|
length = input(6, ...(ngDevMode ? [{ debugName: "length", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
2599
2599
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
@@ -2893,7 +2893,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2893
2893
|
}]
|
|
2894
2894
|
}], 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 }] }] } });
|
|
2895
2895
|
|
|
2896
|
-
let nextId$
|
|
2896
|
+
let nextId$m = 0;
|
|
2897
2897
|
const SIZES$9 = {
|
|
2898
2898
|
sm: 'text-sm px-3 py-2',
|
|
2899
2899
|
md: 'text-sm px-3.5 py-2.5',
|
|
@@ -2905,7 +2905,7 @@ const SIZES$9 = {
|
|
|
2905
2905
|
* [(ngModel)].
|
|
2906
2906
|
*/
|
|
2907
2907
|
class SdsTextarea {
|
|
2908
|
-
fieldId = `sds-textarea-${nextId$
|
|
2908
|
+
fieldId = `sds-textarea-${nextId$m++}`;
|
|
2909
2909
|
field = viewChild('field', ...(ngDevMode ? [{ debugName: "field" }] : []));
|
|
2910
2910
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2911
2911
|
/** Accessible name used when no visible [label] is provided. */
|
|
@@ -3172,7 +3172,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
3172
3172
|
}]
|
|
3173
3173
|
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], showCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCount", required: false }] }], countLimitLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "countLimitLabel", required: false }] }], countLabelTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "countLabelTemplate", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }] } });
|
|
3174
3174
|
|
|
3175
|
-
let nextId$
|
|
3175
|
+
let nextId$l = 0;
|
|
3176
3176
|
const SIZES$8 = {
|
|
3177
3177
|
sm: { track: 'h-5 w-9', knob: 'h-4 w-4', on: 'translate-x-4', icon: 11 },
|
|
3178
3178
|
md: { track: 'h-6 w-11', knob: 'h-5 w-5', on: 'translate-x-5', icon: 13 },
|
|
@@ -3185,7 +3185,7 @@ const SIZES$8 = {
|
|
|
3185
3185
|
* states.
|
|
3186
3186
|
*/
|
|
3187
3187
|
class SdsToggleSwitch {
|
|
3188
|
-
fieldId = `sds-toggle-switch-${nextId$
|
|
3188
|
+
fieldId = `sds-toggle-switch-${nextId$l++}`;
|
|
3189
3189
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
3190
3190
|
/** Accessible name used when no visible [label] is provided. */
|
|
3191
3191
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -3432,7 +3432,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
3432
3432
|
}]
|
|
3433
3433
|
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], trueValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "trueValue", required: false }] }], falseValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "falseValue", required: false }] }], onIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "onIcon", required: false }] }], offIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "offIcon", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }] } });
|
|
3434
3434
|
|
|
3435
|
-
let nextId$
|
|
3435
|
+
let nextId$k = 0;
|
|
3436
3436
|
/**
|
|
3437
3437
|
* Boolean checkbox. Implements ControlValueAccessor — use with reactive forms
|
|
3438
3438
|
* or `[(ngModel)]`. Renders a styled box (brand-filled with a check when on)
|
|
@@ -3447,7 +3447,7 @@ let nextId$j = 0;
|
|
|
3447
3447
|
* <sds-checkbox label="Auto-merge" [(ngModel)]="autoMerge" />
|
|
3448
3448
|
*/
|
|
3449
3449
|
class SdsCheckbox {
|
|
3450
|
-
id = `sds-checkbox-${nextId$
|
|
3450
|
+
id = `sds-checkbox-${nextId$k++}`;
|
|
3451
3451
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
3452
3452
|
/** Accessible name used when no visible [label] is provided. */
|
|
3453
3453
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -3595,7 +3595,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
3595
3595
|
}]
|
|
3596
3596
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }] } });
|
|
3597
3597
|
|
|
3598
|
-
let nextId$
|
|
3598
|
+
let nextId$j = 0;
|
|
3599
3599
|
/**
|
|
3600
3600
|
* Mounted radios by group name. A pick updates the rest of its group, because a native radio says
|
|
3601
3601
|
* nothing when the browser unchecks it — without this a reactive form would leave the old choice drawn.
|
|
@@ -3621,7 +3621,7 @@ const groups = new Map();
|
|
|
3621
3621
|
* <sds-radio name="size" value="large" label="Grand" [(ngModel)]="size" />
|
|
3622
3622
|
*/
|
|
3623
3623
|
class SdsRadio {
|
|
3624
|
-
id = `sds-radio-${nextId$
|
|
3624
|
+
id = `sds-radio-${nextId$j++}`;
|
|
3625
3625
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
3626
3626
|
/** Accessible name used when no visible [label] is provided. */
|
|
3627
3627
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -4197,7 +4197,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4197
4197
|
|
|
4198
4198
|
/** Activation order: none → contains → may-contain → none. */
|
|
4199
4199
|
const ORDER = ['none', 'contains', 'may-contain'];
|
|
4200
|
-
let nextId$
|
|
4200
|
+
let nextId$i = 0;
|
|
4201
4201
|
/**
|
|
4202
4202
|
* A chip that cycles through three states — `none`, `contains`, `may-contain` — built for the 14-tile
|
|
4203
4203
|
* allergen declaration grid, but generic (any "no / yes / maybe" declaration).
|
|
@@ -4217,7 +4217,7 @@ let nextId$h = 0;
|
|
|
4217
4217
|
* containsLabel="Contains" mayContainLabel="May contain" noneLabel="Not present" />
|
|
4218
4218
|
*/
|
|
4219
4219
|
class SdsTriStateChip {
|
|
4220
|
-
chipId = `sds-tri-state-chip-${nextId$
|
|
4220
|
+
chipId = `sds-tri-state-chip-${nextId$i++}`;
|
|
4221
4221
|
/** Current state. Two-way: `[(value)]`. */
|
|
4222
4222
|
value = model('none', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
4223
4223
|
/** Visible name (e.g. the allergen). Required — the chip has no other accessible name. */
|
|
@@ -4442,7 +4442,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4442
4442
|
}]
|
|
4443
4443
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], showState: [{ type: i0.Input, args: [{ isSignal: true, alias: "showState", required: false }] }], noneLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noneLabel", required: false }] }], containsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "containsLabel", required: false }] }], mayContainLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "mayContainLabel", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }] } });
|
|
4444
4444
|
|
|
4445
|
-
let nextId$
|
|
4445
|
+
let nextId$h = 0;
|
|
4446
4446
|
/**
|
|
4447
4447
|
* Segmented control: a small set of mutually exclusive options shown side by side (e.g. "Pick exactly /
|
|
4448
4448
|
* at least / up to"). Radio-group semantics: `role="radiogroup"` with `role="radio"` segments, one tab
|
|
@@ -4458,7 +4458,7 @@ let nextId$g = 0;
|
|
|
4458
4458
|
*/
|
|
4459
4459
|
class SdsSegmented {
|
|
4460
4460
|
host = inject(ElementRef);
|
|
4461
|
-
baseId = `sds-segmented-${nextId$
|
|
4461
|
+
baseId = `sds-segmented-${nextId$h++}`;
|
|
4462
4462
|
/** Options: `{ value, label, icon?, disabled? }` objects, or bare strings/numbers. */
|
|
4463
4463
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
4464
4464
|
/** Selected value. Two-way: `[(value)]`. */
|
|
@@ -4736,7 +4736,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4736
4736
|
`,
|
|
4737
4737
|
}]
|
|
4738
4738
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], showCheck: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCheck", required: false }] }] } });
|
|
4739
|
-
let nextId$
|
|
4739
|
+
let nextId$g = 0;
|
|
4740
4740
|
/**
|
|
4741
4741
|
* A set of chips: pick ONE (a filter row such as "All · Missing photo · Hidden", VAT presets, a date
|
|
4742
4742
|
* range) or, with `multiple`, SEVERAL (categories of an item, days of the week, dietary tags). Unlike
|
|
@@ -4759,7 +4759,7 @@ let nextId$f = 0;
|
|
|
4759
4759
|
*/
|
|
4760
4760
|
class SdsChipGroup {
|
|
4761
4761
|
host = inject(ElementRef);
|
|
4762
|
-
baseId = `sds-chip-group-${nextId$
|
|
4762
|
+
baseId = `sds-chip-group-${nextId$g++}`;
|
|
4763
4763
|
/** Options: `{ value, label, icon?, count?, disabled? }` objects, or bare strings/numbers. */
|
|
4764
4764
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
4765
4765
|
/** Picked value (single) or values (multiple). Two-way: `[(value)]`. */
|
|
@@ -5826,7 +5826,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
5826
5826
|
}]
|
|
5827
5827
|
}], propDecorators: { level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
5828
5828
|
|
|
5829
|
-
let nextId$
|
|
5829
|
+
let nextId$f = 0;
|
|
5830
5830
|
/**
|
|
5831
5831
|
* Marks the element inside `<sds-menu>` that opens it. It may be a native button or a component that
|
|
5832
5832
|
* renders one (e.g. `<sds-button sdsMenuTrigger>`): the menu wires `aria-haspopup`, `aria-expanded` and
|
|
@@ -5874,7 +5874,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
5874
5874
|
class SdsMenu {
|
|
5875
5875
|
host = inject(ElementRef);
|
|
5876
5876
|
injector = inject(Injector);
|
|
5877
|
-
menuId = `sds-menu-${nextId$
|
|
5877
|
+
menuId = `sds-menu-${nextId$f++}`;
|
|
5878
5878
|
triggerId = `${this.menuId}-trigger`;
|
|
5879
5879
|
/** Actions and separators, in order. */
|
|
5880
5880
|
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
@@ -6537,7 +6537,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
6537
6537
|
standalone: true,
|
|
6538
6538
|
}]
|
|
6539
6539
|
}] });
|
|
6540
|
-
let nextId$
|
|
6540
|
+
let nextId$e = 0;
|
|
6541
6541
|
/** Fastest auto-scroll step, in px per animation frame (reached at the very edge). */
|
|
6542
6542
|
const AUTO_SCROLL_MAX_STEP = 18;
|
|
6543
6543
|
/** The nearest ancestor that scrolls vertically (below the document, which is handled as the window). */
|
|
@@ -6606,7 +6606,7 @@ function moveItem(list, from, to) {
|
|
|
6606
6606
|
class SdsSortableList {
|
|
6607
6607
|
host = inject(ElementRef);
|
|
6608
6608
|
injector = inject(Injector);
|
|
6609
|
-
instructionsId = `sds-sortable-${nextId$
|
|
6609
|
+
instructionsId = `sds-sortable-${nextId$e++}-help`;
|
|
6610
6610
|
/** The items, in order. Two-way: `[(items)]` receives the new order on drop. */
|
|
6611
6611
|
items = model([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
6612
6612
|
/** Property used as a stable identity for rows (strongly recommended). */
|
|
@@ -7198,7 +7198,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
7198
7198
|
}]
|
|
7199
7199
|
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }, { type: i0.Output, args: ["itemsChange"] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], labelField: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelField", required: false }] }], itemLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemLabel", required: false }] }], itemDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemDisabled", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], autoScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoScroll", required: false }] }], autoScrollEdge: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoScrollEdge", required: false }] }], handleLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "handleLabel", required: false }] }], instructions: [{ type: i0.Input, args: [{ isSignal: true, alias: "instructions", required: false }] }], pickedUpMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "pickedUpMessage", required: false }] }], movedMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "movedMessage", required: false }] }], droppedMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "droppedMessage", required: false }] }], cancelledMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelledMessage", required: false }] }], reorder: [{ type: i0.Output, args: ["reorder"] }], itemTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdsSortableItem), { isSignal: true }] }], handleTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdsSortableHandle), { isSignal: true }] }] } });
|
|
7200
7200
|
|
|
7201
|
-
let nextId$
|
|
7201
|
+
let nextId$d = 0;
|
|
7202
7202
|
/** "1.5 MB" style size (decimal units, like file managers show them), for messages. */
|
|
7203
7203
|
function sdsFormatBytes(bytes) {
|
|
7204
7204
|
if (!Number.isFinite(bytes) || bytes < 0)
|
|
@@ -7255,7 +7255,7 @@ function sdsFileMatchesAccept(file, accept) {
|
|
|
7255
7255
|
* (files)="upload($event)" (rejected)="onRejected($event)" />
|
|
7256
7256
|
*/
|
|
7257
7257
|
class SdsFileDrop {
|
|
7258
|
-
zoneId = `sds-file-drop-${nextId$
|
|
7258
|
+
zoneId = `sds-file-drop-${nextId$d++}`;
|
|
7259
7259
|
fileInput = viewChild('fileInput', ...(ngDevMode ? [{ debugName: "fileInput" }] : []));
|
|
7260
7260
|
/** Accepted types, native `accept` syntax. Empty = anything. */
|
|
7261
7261
|
accept = input('', ...(ngDevMode ? [{ debugName: "accept" }] : []));
|
|
@@ -7637,7 +7637,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
7637
7637
|
}]
|
|
7638
7638
|
}], propDecorators: { fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }], maxFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFiles", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], dropLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropLabel", required: false }] }], browseLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "browseLabel", required: false }] }], loadingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingLabel", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], wrongTypeMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrongTypeMessage", required: false }] }], tooLargeMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooLargeMessage", required: false }] }], tooManyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooManyMessage", required: false }] }], files: [{ type: i0.Output, args: ["files"] }], rejected: [{ type: i0.Output, args: ["rejected"] }] } });
|
|
7639
7639
|
|
|
7640
|
-
let nextId$
|
|
7640
|
+
let nextId$c = 0;
|
|
7641
7641
|
/**
|
|
7642
7642
|
* Crops an image to a FIXED aspect ratio (e.g. the shop's card ratio): the frame is fixed and the image
|
|
7643
7643
|
* moves and zooms behind it, always covering the frame, so every crop is valid.
|
|
@@ -7655,7 +7655,7 @@ let nextId$b = 0;
|
|
|
7655
7655
|
* <sds-button (click)="upload(await cropper.toBlob({ width: 1600 }))">Save</sds-button>
|
|
7656
7656
|
*/
|
|
7657
7657
|
class SdsImageCropper {
|
|
7658
|
-
helpId = `sds-image-cropper-${nextId$
|
|
7658
|
+
helpId = `sds-image-cropper-${nextId$c++}-help`;
|
|
7659
7659
|
viewport = viewChild('viewport', ...(ngDevMode ? [{ debugName: "viewport" }] : []));
|
|
7660
7660
|
/** Image to crop: a URL, or a Blob/File. */
|
|
7661
7661
|
src = input(null, ...(ngDevMode ? [{ debugName: "src" }] : []));
|
|
@@ -9041,7 +9041,7 @@ const SIZES$7 = {
|
|
|
9041
9041
|
class SdsDatePicker {
|
|
9042
9042
|
host = inject(ElementRef);
|
|
9043
9043
|
injector = inject(Injector);
|
|
9044
|
-
fieldId = `sds-date-${nextId$
|
|
9044
|
+
fieldId = `sds-date-${nextId$b++}`;
|
|
9045
9045
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
9046
9046
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
9047
9047
|
placeholder = input('dd/mm/yyyy', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
@@ -9559,7 +9559,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
9559
9559
|
`,
|
|
9560
9560
|
}]
|
|
9561
9561
|
}], 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 }] }], showTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTime", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], timeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeLabel", required: false }] }], hoursLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoursLabel", required: false }] }], minutesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "minutesLabel", required: false }] }], doneLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "doneLabel", 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 }] }] } });
|
|
9562
|
-
let nextId$
|
|
9562
|
+
let nextId$b = 0;
|
|
9563
9563
|
|
|
9564
9564
|
/** Same first and last day (time-of-day ignored). `null` only equals `null`. */
|
|
9565
9565
|
function isSameRange(a, b) {
|
|
@@ -10164,7 +10164,7 @@ const SIZES$6 = {
|
|
|
10164
10164
|
class SdsDateRangePicker {
|
|
10165
10165
|
host = inject(ElementRef);
|
|
10166
10166
|
injector = inject(Injector);
|
|
10167
|
-
uid = nextId$
|
|
10167
|
+
uid = nextId$a++;
|
|
10168
10168
|
fieldId = `sds-date-range-${this.uid}`;
|
|
10169
10169
|
labelId = `${this.fieldId}-label`;
|
|
10170
10170
|
valueId = `${this.fieldId}-value`;
|
|
@@ -10680,7 +10680,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
10680
10680
|
`,
|
|
10681
10681
|
}]
|
|
10682
10682
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], presets: [{ type: i0.Input, args: [{ isSignal: true, alias: "presets", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], maxDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDays", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], months: [{ type: i0.Input, args: [{ isSignal: true, alias: "months", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], 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 }] }], panelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelLabel", required: false }] }], presetsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "presetsLabel", required: false }] }], startLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "startLabel", required: false }] }], endLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "endLabel", required: false }] }], applyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "applyLabel", required: false }] }], cancelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelLabel", 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 }] }], presetSelect: [{ type: i0.Output, args: ["presetSelect"] }], calendar: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdsRangeCalendar), { isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
10683
|
-
let nextId$
|
|
10683
|
+
let nextId$a = 0;
|
|
10684
10684
|
|
|
10685
10685
|
/**
|
|
10686
10686
|
* Supplies a custom template for each option row (and the selected value shown
|
|
@@ -10764,7 +10764,7 @@ const SIZES$5 = {
|
|
|
10764
10764
|
md: 'h-10 text-sm',
|
|
10765
10765
|
lg: 'h-12 text-base',
|
|
10766
10766
|
};
|
|
10767
|
-
let nextId$
|
|
10767
|
+
let nextId$9 = 0;
|
|
10768
10768
|
/**
|
|
10769
10769
|
* Single-select dropdown. Options may be primitives or objects (configure via
|
|
10770
10770
|
* [optionLabel]/[optionValue]/[optionDisabled]). The overlay is appended to
|
|
@@ -10798,7 +10798,7 @@ let nextId$8 = 0;
|
|
|
10798
10798
|
class SdsSelect {
|
|
10799
10799
|
host = inject(ElementRef);
|
|
10800
10800
|
injector = inject(Injector);
|
|
10801
|
-
selectId = `sds-select-${nextId$
|
|
10801
|
+
selectId = `sds-select-${nextId$9++}`;
|
|
10802
10802
|
listId = `${this.selectId}-list`;
|
|
10803
10803
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
10804
10804
|
optionLabel = input('label', ...(ngDevMode ? [{ debugName: "optionLabel" }] : []));
|
|
@@ -11508,7 +11508,7 @@ const SIZES$4 = {
|
|
|
11508
11508
|
md: 'min-h-10 text-sm',
|
|
11509
11509
|
lg: 'min-h-12 text-base',
|
|
11510
11510
|
};
|
|
11511
|
-
let nextId$
|
|
11511
|
+
let nextId$8 = 0;
|
|
11512
11512
|
/**
|
|
11513
11513
|
* Multi-select dropdown (value is an array). Options may be primitives or
|
|
11514
11514
|
* objects (configure via [optionLabel]/[optionValue]/[optionDisabled]). The
|
|
@@ -11541,7 +11541,7 @@ let nextId$7 = 0;
|
|
|
11541
11541
|
class SdsMultiSelect {
|
|
11542
11542
|
host = inject(ElementRef);
|
|
11543
11543
|
injector = inject(Injector);
|
|
11544
|
-
selectId = `sds-multiselect-${nextId$
|
|
11544
|
+
selectId = `sds-multiselect-${nextId$8++}`;
|
|
11545
11545
|
listId = `${this.selectId}-list`;
|
|
11546
11546
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
11547
11547
|
optionLabel = input('label', ...(ngDevMode ? [{ debugName: "optionLabel" }] : []));
|
|
@@ -12357,6 +12357,744 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
12357
12357
|
}]
|
|
12358
12358
|
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "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 }] }], display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], maxSelectedLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelectedLabels", required: false }] }], selectedItemsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItemsLabel", required: false }] }], showToggleAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToggleAll", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], filterLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterLabel", required: false }] }], selectAllLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllLabel", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], optionTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdsSelectOption), { isSignal: true }] }], emptyTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdsSelectEmpty), { isSignal: true }] }], footerTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdsSelectFooter), { isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
12359
12359
|
|
|
12360
|
+
let nextId$7 = 0;
|
|
12361
|
+
/**
|
|
12362
|
+
* A select whose options come from the server as you type.
|
|
12363
|
+
*
|
|
12364
|
+
* <p><b>Why this is not `[filter]` on `sds-select`.</b> That filter narrows an array the host has
|
|
12365
|
+
* already fetched, which is right for a few dozen services and wrong for every patient a practice
|
|
12366
|
+
* has ever seen: you cannot ship the list to narrow it. Here the query goes to the provider and the
|
|
12367
|
+
* panel shows what comes back.
|
|
12368
|
+
*
|
|
12369
|
+
* <p><b>The dropdown button loads the first page.</b> Opening with an empty query calls
|
|
12370
|
+
* `search('', pageSize)`, so the control is useful before anybody types — a plain select for the
|
|
12371
|
+
* common case, a search for the rest. Set {@link minChars} above 0 if the backing query is too
|
|
12372
|
+
* expensive to run unprompted.
|
|
12373
|
+
*
|
|
12374
|
+
* <p><b>Only the latest response is applied.</b> Each search takes a sequence number and a slower
|
|
12375
|
+
* earlier request is dropped when it lands — otherwise typing fast leaves the panel showing results
|
|
12376
|
+
* for a query that is no longer in the box. Same guard `sds-address-autocomplete` makes.
|
|
12377
|
+
*
|
|
12378
|
+
* <p><b>A value you were given needs its option.</b> The component can only label what it has seen,
|
|
12379
|
+
* so a form that loads with `patientId = 42` shows nothing useful until something fetches 42. Pass
|
|
12380
|
+
* the objects you already hold to {@link selectedOptions} and it labels them without a round trip.
|
|
12381
|
+
* This is the one thing an async select cannot do for you, and silently showing a raw id instead is
|
|
12382
|
+
* how these controls usually get it wrong.
|
|
12383
|
+
*
|
|
12384
|
+
* <p>Takes the same template directives as `sds-select`, so a projected option row works in both:
|
|
12385
|
+
* `sdsSelectOption`, `sdsSelectEmpty`, `sdsSelectFooter`.
|
|
12386
|
+
*
|
|
12387
|
+
* @example
|
|
12388
|
+
* <sds-autocomplete
|
|
12389
|
+
* [search]="findPatients"
|
|
12390
|
+
* optionLabel="fullName"
|
|
12391
|
+
* optionValue="id"
|
|
12392
|
+
* [(ngModel)]="patientId"
|
|
12393
|
+
* [selectedOptions]="known()" />
|
|
12394
|
+
*/
|
|
12395
|
+
class SdsAutocomplete {
|
|
12396
|
+
host = inject(ElementRef);
|
|
12397
|
+
injector = inject(Injector);
|
|
12398
|
+
baseId = `sds-autocomplete-${nextId$7++}`;
|
|
12399
|
+
inputId = `${this.baseId}-input`;
|
|
12400
|
+
panelId = `${this.baseId}-panel`;
|
|
12401
|
+
/** Where options come from. Required — this control has no local list to fall back on. */
|
|
12402
|
+
search = input.required(...(ngDevMode ? [{ debugName: "search" }] : []));
|
|
12403
|
+
/** How many to ask for. The "first X" the dropdown shows before anybody types. */
|
|
12404
|
+
pageSize = input(20, ...(ngDevMode ? [{ debugName: "pageSize", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
12405
|
+
/** Characters before a search runs. 0 means opening the panel fetches the first page. */
|
|
12406
|
+
minChars = input(0, ...(ngDevMode ? [{ debugName: "minChars", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
12407
|
+
debounceMs = input(250, ...(ngDevMode ? [{ debugName: "debounceMs", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
12408
|
+
multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
12409
|
+
display = input('chip', ...(ngDevMode ? [{ debugName: "display" }] : []));
|
|
12410
|
+
optionLabel = input('label', ...(ngDevMode ? [{ debugName: "optionLabel" }] : []));
|
|
12411
|
+
optionValue = input('', ...(ngDevMode ? [{ debugName: "optionValue" }] : []));
|
|
12412
|
+
optionDisabled = input('disabled', ...(ngDevMode ? [{ debugName: "optionDisabled" }] : []));
|
|
12413
|
+
/**
|
|
12414
|
+
* Options for values the control was handed rather than picked — a form loading an existing
|
|
12415
|
+
* record. Without them a written value has no label and the field would show an id.
|
|
12416
|
+
*/
|
|
12417
|
+
selectedOptions = input([], ...(ngDevMode ? [{ debugName: "selectedOptions" }] : []));
|
|
12418
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
12419
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
12420
|
+
placeholder = input('Search…', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
12421
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
12422
|
+
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
12423
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
12424
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
12425
|
+
clearable = input(false, ...(ngDevMode ? [{ debugName: "clearable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
12426
|
+
/** English defaults; an app serving more than one language passes every one of these. */
|
|
12427
|
+
searchingText = input('Searching…', ...(ngDevMode ? [{ debugName: "searchingText" }] : []));
|
|
12428
|
+
emptyMessage = input('No results', ...(ngDevMode ? [{ debugName: "emptyMessage" }] : []));
|
|
12429
|
+
searchErrorText = input("Couldn't search right now. Try again.", ...(ngDevMode ? [{ debugName: "searchErrorText" }] : []));
|
|
12430
|
+
minCharsText = input('Type at least {count} characters', ...(ngDevMode ? [{ debugName: "minCharsText" }] : []));
|
|
12431
|
+
clearLabel = input('Clear selection', ...(ngDevMode ? [{ debugName: "clearLabel" }] : []));
|
|
12432
|
+
removeLabel = input('Remove {label}', ...(ngDevMode ? [{ debugName: "removeLabel" }] : []));
|
|
12433
|
+
openLabel = input('Show options', ...(ngDevMode ? [{ debugName: "openLabel" }] : []));
|
|
12434
|
+
selected = output();
|
|
12435
|
+
opened = output();
|
|
12436
|
+
closed = output();
|
|
12437
|
+
triggerEl = viewChild('trigger', ...(ngDevMode ? [{ debugName: "triggerEl" }] : []));
|
|
12438
|
+
fieldEl = viewChild('field', ...(ngDevMode ? [{ debugName: "fieldEl" }] : []));
|
|
12439
|
+
panelRef = viewChild('panel', ...(ngDevMode ? [{ debugName: "panelRef" }] : []));
|
|
12440
|
+
optionTemplate = contentChild(SdsSelectOption, ...(ngDevMode ? [{ debugName: "optionTemplate" }] : []));
|
|
12441
|
+
emptyTemplate = contentChild(SdsSelectEmpty, ...(ngDevMode ? [{ debugName: "emptyTemplate" }] : []));
|
|
12442
|
+
footerTemplate = contentChild(SdsSelectFooter, ...(ngDevMode ? [{ debugName: "footerTemplate" }] : []));
|
|
12443
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
12444
|
+
query = signal('', ...(ngDevMode ? [{ debugName: "query" }] : []));
|
|
12445
|
+
results = signal([], ...(ngDevMode ? [{ debugName: "results" }] : []));
|
|
12446
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
12447
|
+
failed = signal(false, ...(ngDevMode ? [{ debugName: "failed" }] : []));
|
|
12448
|
+
active = signal(-1, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
12449
|
+
value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
12450
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
12451
|
+
/** Every option this control has seen, by value — how a chip keeps its label after a new search. */
|
|
12452
|
+
seen = new Map();
|
|
12453
|
+
timer;
|
|
12454
|
+
seq = 0;
|
|
12455
|
+
destroyed = false;
|
|
12456
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
12457
|
+
tooShort = computed(() => this.minChars() > 0 && this.query().trim().length < this.minChars(), ...(ngDevMode ? [{ debugName: "tooShort" }] : []));
|
|
12458
|
+
/** The chosen options, resolved to objects where we have them. */
|
|
12459
|
+
chosen = computed(() => {
|
|
12460
|
+
for (const option of this.selectedOptions()) {
|
|
12461
|
+
this.seen.set(this.valueOf(option), option);
|
|
12462
|
+
}
|
|
12463
|
+
const current = this.value();
|
|
12464
|
+
const values = this.multiple()
|
|
12465
|
+
? Array.isArray(current)
|
|
12466
|
+
? current
|
|
12467
|
+
: []
|
|
12468
|
+
: current === null || current === undefined
|
|
12469
|
+
? []
|
|
12470
|
+
: [current];
|
|
12471
|
+
return values.map((v) => this.seen.get(v) ?? v);
|
|
12472
|
+
}, ...(ngDevMode ? [{ debugName: "chosen" }] : []));
|
|
12473
|
+
hasValue = computed(() => this.chosen().length > 0, ...(ngDevMode ? [{ debugName: "hasValue" }] : []));
|
|
12474
|
+
/** Closed and single: the field shows the choice. Open or multi: it shows what you typed. */
|
|
12475
|
+
triggerPlaceholder = computed(() => {
|
|
12476
|
+
if (this.multiple() || this.open()) {
|
|
12477
|
+
return this.placeholder();
|
|
12478
|
+
}
|
|
12479
|
+
const [one] = this.chosen();
|
|
12480
|
+
return one === undefined ? this.placeholder() : this.labelOf(one);
|
|
12481
|
+
}, ...(ngDevMode ? [{ debugName: "triggerPlaceholder" }] : []));
|
|
12482
|
+
closeFn = () => this.close();
|
|
12483
|
+
constructor() {
|
|
12484
|
+
afterNextRender(() => this.position(), { injector: this.injector });
|
|
12485
|
+
}
|
|
12486
|
+
// ------------------------------------------------------------------ options
|
|
12487
|
+
labelOf(option) {
|
|
12488
|
+
if (option === null || option === undefined)
|
|
12489
|
+
return '';
|
|
12490
|
+
if (typeof option !== 'object')
|
|
12491
|
+
return String(option);
|
|
12492
|
+
const key = this.optionLabel();
|
|
12493
|
+
const raw = option[key];
|
|
12494
|
+
return raw === undefined || raw === null ? '' : String(raw);
|
|
12495
|
+
}
|
|
12496
|
+
valueOf(option) {
|
|
12497
|
+
const key = this.optionValue();
|
|
12498
|
+
if (!key || option === null || typeof option !== 'object')
|
|
12499
|
+
return option;
|
|
12500
|
+
return option[key];
|
|
12501
|
+
}
|
|
12502
|
+
trackValue(option) {
|
|
12503
|
+
const v = this.valueOf(option);
|
|
12504
|
+
return v === undefined ? option : v;
|
|
12505
|
+
}
|
|
12506
|
+
isOptionDisabled(option) {
|
|
12507
|
+
return (typeof option === 'object' &&
|
|
12508
|
+
option !== null &&
|
|
12509
|
+
!!option[this.optionDisabled()]);
|
|
12510
|
+
}
|
|
12511
|
+
isChosen(option) {
|
|
12512
|
+
const v = this.valueOf(option);
|
|
12513
|
+
const current = this.value();
|
|
12514
|
+
return this.multiple() ? Array.isArray(current) && current.includes(v) : current === v;
|
|
12515
|
+
}
|
|
12516
|
+
optionId(index) {
|
|
12517
|
+
return `${this.baseId}-option-${index}`;
|
|
12518
|
+
}
|
|
12519
|
+
fieldClass() {
|
|
12520
|
+
const h = this.size() === 'sm' ? 'min-h-8' : this.size() === 'lg' ? 'min-h-11' : 'min-h-10';
|
|
12521
|
+
return ('flex w-full flex-wrap items-center gap-1.5 rounded-control border bg-surface px-2.5 py-1 ' +
|
|
12522
|
+
'focus-within:ring-2 focus-within:ring-brand-500 ' +
|
|
12523
|
+
h +
|
|
12524
|
+
(this.error() ? ' border-danger' : ' border-border') +
|
|
12525
|
+
(this.isDisabled() ? ' cursor-not-allowed opacity-60' : ' cursor-text'));
|
|
12526
|
+
}
|
|
12527
|
+
optionClass(index, option) {
|
|
12528
|
+
return ('flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm ' +
|
|
12529
|
+
(this.isOptionDisabled(option)
|
|
12530
|
+
? 'cursor-not-allowed text-ink-faint'
|
|
12531
|
+
: index === this.active()
|
|
12532
|
+
? 'bg-muted text-ink'
|
|
12533
|
+
: 'text-ink hover:bg-muted'));
|
|
12534
|
+
}
|
|
12535
|
+
// ------------------------------------------------------------------ searching
|
|
12536
|
+
onType(event) {
|
|
12537
|
+
this.query.set(event.target.value);
|
|
12538
|
+
this.open.set(true);
|
|
12539
|
+
this.schedule();
|
|
12540
|
+
}
|
|
12541
|
+
openPanel() {
|
|
12542
|
+
if (this.isDisabled() || this.open())
|
|
12543
|
+
return;
|
|
12544
|
+
this.open.set(true);
|
|
12545
|
+
this.opened.emit();
|
|
12546
|
+
this.schedule(0);
|
|
12547
|
+
setTimeout(() => this.position());
|
|
12548
|
+
this.addReflow();
|
|
12549
|
+
}
|
|
12550
|
+
toggle(event) {
|
|
12551
|
+
event.stopPropagation();
|
|
12552
|
+
if (this.open()) {
|
|
12553
|
+
this.close();
|
|
12554
|
+
}
|
|
12555
|
+
else {
|
|
12556
|
+
this.fieldEl()?.nativeElement.focus();
|
|
12557
|
+
this.openPanel();
|
|
12558
|
+
}
|
|
12559
|
+
}
|
|
12560
|
+
schedule(delay = this.debounceMs()) {
|
|
12561
|
+
clearTimeout(this.timer);
|
|
12562
|
+
if (this.tooShort()) {
|
|
12563
|
+
this.results.set([]);
|
|
12564
|
+
this.loading.set(false);
|
|
12565
|
+
return;
|
|
12566
|
+
}
|
|
12567
|
+
this.timer = setTimeout(() => void this.run(), delay);
|
|
12568
|
+
}
|
|
12569
|
+
async run() {
|
|
12570
|
+
const seq = ++this.seq;
|
|
12571
|
+
const query = this.query().trim();
|
|
12572
|
+
this.loading.set(true);
|
|
12573
|
+
this.failed.set(false);
|
|
12574
|
+
try {
|
|
12575
|
+
const rows = await this.search()(query, this.pageSize());
|
|
12576
|
+
if (seq !== this.seq || this.destroyed)
|
|
12577
|
+
return; // a newer search already won
|
|
12578
|
+
for (const row of rows)
|
|
12579
|
+
this.seen.set(this.valueOf(row), row);
|
|
12580
|
+
this.results.set(rows);
|
|
12581
|
+
this.active.set(rows.length ? 0 : -1);
|
|
12582
|
+
}
|
|
12583
|
+
catch {
|
|
12584
|
+
if (seq !== this.seq || this.destroyed)
|
|
12585
|
+
return;
|
|
12586
|
+
this.results.set([]);
|
|
12587
|
+
this.failed.set(true);
|
|
12588
|
+
}
|
|
12589
|
+
finally {
|
|
12590
|
+
if (seq === this.seq && !this.destroyed) {
|
|
12591
|
+
this.loading.set(false);
|
|
12592
|
+
setTimeout(() => this.position());
|
|
12593
|
+
}
|
|
12594
|
+
}
|
|
12595
|
+
}
|
|
12596
|
+
// ------------------------------------------------------------------ choosing
|
|
12597
|
+
pick(option, event) {
|
|
12598
|
+
event?.stopPropagation();
|
|
12599
|
+
if (this.isOptionDisabled(option))
|
|
12600
|
+
return;
|
|
12601
|
+
const v = this.valueOf(option);
|
|
12602
|
+
this.seen.set(v, option);
|
|
12603
|
+
if (!this.multiple()) {
|
|
12604
|
+
this.setValue(v);
|
|
12605
|
+
this.selected.emit(option);
|
|
12606
|
+
this.query.set('');
|
|
12607
|
+
this.close();
|
|
12608
|
+
return;
|
|
12609
|
+
}
|
|
12610
|
+
const current = Array.isArray(this.value()) ? [...this.value()] : [];
|
|
12611
|
+
const at = current.indexOf(v);
|
|
12612
|
+
if (at >= 0) {
|
|
12613
|
+
current.splice(at, 1);
|
|
12614
|
+
}
|
|
12615
|
+
else {
|
|
12616
|
+
current.push(v);
|
|
12617
|
+
this.selected.emit(option);
|
|
12618
|
+
}
|
|
12619
|
+
this.setValue(current);
|
|
12620
|
+
}
|
|
12621
|
+
remove(option, event) {
|
|
12622
|
+
event.stopPropagation();
|
|
12623
|
+
const v = this.valueOf(option);
|
|
12624
|
+
const current = Array.isArray(this.value()) ? [...this.value()] : [];
|
|
12625
|
+
this.setValue(current.filter((x) => x !== v));
|
|
12626
|
+
}
|
|
12627
|
+
clear(event) {
|
|
12628
|
+
event.stopPropagation();
|
|
12629
|
+
this.setValue(this.multiple() ? [] : null);
|
|
12630
|
+
this.query.set('');
|
|
12631
|
+
}
|
|
12632
|
+
onKeydown(event) {
|
|
12633
|
+
switch (event.key) {
|
|
12634
|
+
case 'ArrowDown':
|
|
12635
|
+
event.preventDefault();
|
|
12636
|
+
if (!this.open())
|
|
12637
|
+
return this.openPanel();
|
|
12638
|
+
this.active.set(Math.min(this.results().length - 1, this.active() + 1));
|
|
12639
|
+
return;
|
|
12640
|
+
case 'ArrowUp':
|
|
12641
|
+
event.preventDefault();
|
|
12642
|
+
this.active.set(Math.max(0, this.active() - 1));
|
|
12643
|
+
return;
|
|
12644
|
+
case 'Enter': {
|
|
12645
|
+
const option = this.results()[this.active()];
|
|
12646
|
+
if (this.open() && option !== undefined) {
|
|
12647
|
+
event.preventDefault();
|
|
12648
|
+
this.pick(option);
|
|
12649
|
+
}
|
|
12650
|
+
return;
|
|
12651
|
+
}
|
|
12652
|
+
case 'Escape':
|
|
12653
|
+
if (this.open()) {
|
|
12654
|
+
event.stopPropagation();
|
|
12655
|
+
this.close();
|
|
12656
|
+
}
|
|
12657
|
+
return;
|
|
12658
|
+
case 'Backspace': {
|
|
12659
|
+
// Emptying the box removes the last chip, the way every tag field does.
|
|
12660
|
+
if (this.multiple() && !this.query() && this.chosen().length) {
|
|
12661
|
+
const last = this.chosen()[this.chosen().length - 1];
|
|
12662
|
+
this.setValue(this.value().filter((x) => x !== this.valueOf(last)));
|
|
12663
|
+
}
|
|
12664
|
+
return;
|
|
12665
|
+
}
|
|
12666
|
+
default:
|
|
12667
|
+
return;
|
|
12668
|
+
}
|
|
12669
|
+
}
|
|
12670
|
+
close() {
|
|
12671
|
+
if (!this.open())
|
|
12672
|
+
return;
|
|
12673
|
+
this.open.set(false);
|
|
12674
|
+
this.active.set(-1);
|
|
12675
|
+
this.removeReflow();
|
|
12676
|
+
this.panelRef()?.nativeElement.remove();
|
|
12677
|
+
this.closed.emit(this.value());
|
|
12678
|
+
}
|
|
12679
|
+
onDocumentClick(event) {
|
|
12680
|
+
if (!this.open())
|
|
12681
|
+
return;
|
|
12682
|
+
const target = event.target;
|
|
12683
|
+
const panel = this.panelRef()?.nativeElement;
|
|
12684
|
+
if (!this.host.nativeElement.contains(target) && !panel?.contains(target)) {
|
|
12685
|
+
this.close();
|
|
12686
|
+
}
|
|
12687
|
+
}
|
|
12688
|
+
// --- body-appended overlay positioning (mirrors sds-select) ---
|
|
12689
|
+
reflow = () => this.position();
|
|
12690
|
+
listening = false;
|
|
12691
|
+
addReflow() {
|
|
12692
|
+
if (this.listening)
|
|
12693
|
+
return;
|
|
12694
|
+
window.addEventListener('scroll', this.reflow, true);
|
|
12695
|
+
window.addEventListener('resize', this.reflow);
|
|
12696
|
+
this.listening = true;
|
|
12697
|
+
}
|
|
12698
|
+
removeReflow() {
|
|
12699
|
+
if (!this.listening)
|
|
12700
|
+
return;
|
|
12701
|
+
window.removeEventListener('scroll', this.reflow, true);
|
|
12702
|
+
window.removeEventListener('resize', this.reflow);
|
|
12703
|
+
this.listening = false;
|
|
12704
|
+
}
|
|
12705
|
+
position() {
|
|
12706
|
+
const trigger = this.triggerEl()?.nativeElement;
|
|
12707
|
+
const panel = this.panelRef()?.nativeElement;
|
|
12708
|
+
if (!trigger || !panel)
|
|
12709
|
+
return;
|
|
12710
|
+
if (panel.parentElement !== document.body)
|
|
12711
|
+
document.body.appendChild(panel);
|
|
12712
|
+
const r = trigger.getBoundingClientRect();
|
|
12713
|
+
panel.style.minWidth = `${Math.round(r.width)}px`;
|
|
12714
|
+
const ph = panel.offsetHeight || 240;
|
|
12715
|
+
const gap = 4;
|
|
12716
|
+
const margin = 8;
|
|
12717
|
+
let top = r.bottom + gap;
|
|
12718
|
+
if (top + ph > window.innerHeight - margin && r.top - gap - ph > margin) {
|
|
12719
|
+
top = r.top - gap - ph;
|
|
12720
|
+
}
|
|
12721
|
+
let left = r.left;
|
|
12722
|
+
const pw = panel.offsetWidth || r.width;
|
|
12723
|
+
if (left + pw > window.innerWidth - margin) {
|
|
12724
|
+
left = Math.max(margin, window.innerWidth - margin - pw);
|
|
12725
|
+
}
|
|
12726
|
+
panel.style.top = `${Math.round(top)}px`;
|
|
12727
|
+
panel.style.left = `${Math.round(left)}px`;
|
|
12728
|
+
}
|
|
12729
|
+
ngOnDestroy() {
|
|
12730
|
+
this.destroyed = true;
|
|
12731
|
+
clearTimeout(this.timer);
|
|
12732
|
+
this.removeReflow();
|
|
12733
|
+
this.panelRef()?.nativeElement.remove();
|
|
12734
|
+
}
|
|
12735
|
+
setValue(v) {
|
|
12736
|
+
this.value.set(v);
|
|
12737
|
+
this.onChange(v);
|
|
12738
|
+
this.onTouched();
|
|
12739
|
+
}
|
|
12740
|
+
// --- ControlValueAccessor ---
|
|
12741
|
+
onChange = () => { };
|
|
12742
|
+
onTouched = () => { };
|
|
12743
|
+
writeValue(value) {
|
|
12744
|
+
this.value.set(value ?? (this.multiple() ? [] : null));
|
|
12745
|
+
}
|
|
12746
|
+
registerOnChange(fn) {
|
|
12747
|
+
this.onChange = fn;
|
|
12748
|
+
}
|
|
12749
|
+
registerOnTouched(fn) {
|
|
12750
|
+
this.onTouched = fn;
|
|
12751
|
+
}
|
|
12752
|
+
setDisabledState(isDisabled) {
|
|
12753
|
+
this.cvaDisabled.set(isDisabled);
|
|
12754
|
+
if (isDisabled)
|
|
12755
|
+
this.close();
|
|
12756
|
+
}
|
|
12757
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsAutocomplete, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12758
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsAutocomplete, isStandalone: true, selector: "sds-autocomplete", inputs: { search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: true, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, minChars: { classPropertyName: "minChars", publicName: "minChars", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, selectedOptions: { classPropertyName: "selectedOptions", publicName: "selectedOptions", 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, searchingText: { classPropertyName: "searchingText", publicName: "searchingText", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, searchErrorText: { classPropertyName: "searchErrorText", publicName: "searchErrorText", isSignal: true, isRequired: false, transformFunction: null }, minCharsText: { classPropertyName: "minCharsText", publicName: "minCharsText", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null }, openLabel: { classPropertyName: "openLabel", publicName: "openLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected", opened: "opened", closed: "closed" }, host: { listeners: { "document:click": "onDocumentClick($event)" }, classAttribute: "block" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SdsAutocomplete, multi: true }], queries: [{ propertyName: "optionTemplate", first: true, predicate: SdsSelectOption, descendants: true, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: SdsSelectEmpty, descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: SdsSelectFooter, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "triggerEl", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "fieldEl", first: true, predicate: ["field"], descendants: true, isSignal: true }, { propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
12759
|
+
@if (label()) {
|
|
12760
|
+
<label class="mb-1 block text-sm font-medium text-ink" [attr.for]="inputId">
|
|
12761
|
+
{{ label() }}
|
|
12762
|
+
</label>
|
|
12763
|
+
}
|
|
12764
|
+
|
|
12765
|
+
<div #trigger [class]="fieldClass()" (click)="openPanel()">
|
|
12766
|
+
@if (multiple() && display() === 'chip' && chosen().length) {
|
|
12767
|
+
<span class="flex flex-wrap items-center gap-1">
|
|
12768
|
+
@for (item of chosen(); track trackValue(item)) {
|
|
12769
|
+
<span
|
|
12770
|
+
class="inline-flex max-w-full items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-ink"
|
|
12771
|
+
>
|
|
12772
|
+
<span class="truncate">{{ labelOf(item) }}</span>
|
|
12773
|
+
<button
|
|
12774
|
+
type="button"
|
|
12775
|
+
class="shrink-0 text-ink-faint hover:text-ink"
|
|
12776
|
+
[attr.aria-label]="removeLabel().replace('{label}', labelOf(item))"
|
|
12777
|
+
(click)="remove(item, $event)"
|
|
12778
|
+
>
|
|
12779
|
+
<sds-icon name="x" [size]="12" />
|
|
12780
|
+
</button>
|
|
12781
|
+
</span>
|
|
12782
|
+
}
|
|
12783
|
+
</span>
|
|
12784
|
+
}
|
|
12785
|
+
|
|
12786
|
+
<input
|
|
12787
|
+
#field
|
|
12788
|
+
[id]="inputId"
|
|
12789
|
+
type="text"
|
|
12790
|
+
role="combobox"
|
|
12791
|
+
autocomplete="off"
|
|
12792
|
+
class="min-w-0 flex-1 bg-transparent text-sm text-ink outline-none placeholder:text-ink-faint"
|
|
12793
|
+
[attr.aria-expanded]="open()"
|
|
12794
|
+
[attr.aria-controls]="panelId"
|
|
12795
|
+
[attr.aria-activedescendant]="open() && active() >= 0 ? optionId(active()) : null"
|
|
12796
|
+
[attr.aria-label]="label() ? null : ariaLabel() || null"
|
|
12797
|
+
[placeholder]="triggerPlaceholder()"
|
|
12798
|
+
[disabled]="isDisabled()"
|
|
12799
|
+
[value]="query()"
|
|
12800
|
+
(input)="onType($event)"
|
|
12801
|
+
(keydown)="onKeydown($event)"
|
|
12802
|
+
(focus)="openPanel()"
|
|
12803
|
+
/>
|
|
12804
|
+
|
|
12805
|
+
@if (clearable() && hasValue() && !isDisabled()) {
|
|
12806
|
+
<button
|
|
12807
|
+
type="button"
|
|
12808
|
+
class="shrink-0 rounded text-ink-faint hover:text-ink"
|
|
12809
|
+
[attr.aria-label]="clearLabel()"
|
|
12810
|
+
(click)="clear($event)"
|
|
12811
|
+
>
|
|
12812
|
+
<sds-icon name="x" [size]="14" />
|
|
12813
|
+
</button>
|
|
12814
|
+
}
|
|
12815
|
+
<button
|
|
12816
|
+
type="button"
|
|
12817
|
+
class="shrink-0 rounded text-ink-faint hover:text-ink"
|
|
12818
|
+
[attr.aria-label]="openLabel()"
|
|
12819
|
+
[disabled]="isDisabled()"
|
|
12820
|
+
(click)="toggle($event)"
|
|
12821
|
+
>
|
|
12822
|
+
<sds-icon [name]="open() ? 'chevron-up' : 'chevron-down'" [size]="16" />
|
|
12823
|
+
</button>
|
|
12824
|
+
</div>
|
|
12825
|
+
|
|
12826
|
+
@if (hint() && !error()) {
|
|
12827
|
+
<p class="mt-1 text-xs text-ink-soft">{{ hint() }}</p>
|
|
12828
|
+
}
|
|
12829
|
+
@if (error()) {
|
|
12830
|
+
<p class="mt-1 text-xs text-danger">{{ error() }}</p>
|
|
12831
|
+
}
|
|
12832
|
+
|
|
12833
|
+
@if (open()) {
|
|
12834
|
+
<div
|
|
12835
|
+
#panel
|
|
12836
|
+
[id]="panelId"
|
|
12837
|
+
role="listbox"
|
|
12838
|
+
[attr.aria-multiselectable]="multiple() ? 'true' : null"
|
|
12839
|
+
class="fixed z-50 max-h-72 overflow-auto rounded-control border border-border bg-surface py-1 shadow-lg"
|
|
12840
|
+
>
|
|
12841
|
+
@if (loading()) {
|
|
12842
|
+
<p class="px-3 py-2 text-sm text-ink-soft">{{ searchingText() }}</p>
|
|
12843
|
+
} @else if (failed()) {
|
|
12844
|
+
<p class="px-3 py-2 text-sm text-danger">{{ searchErrorText() }}</p>
|
|
12845
|
+
} @else if (!results().length) {
|
|
12846
|
+
@if (tooShort()) {
|
|
12847
|
+
<p class="px-3 py-2 text-sm text-ink-soft">
|
|
12848
|
+
{{ minCharsText().replace('{count}', '' + minChars()) }}
|
|
12849
|
+
</p>
|
|
12850
|
+
} @else if (emptyTemplate()) {
|
|
12851
|
+
<div class="px-3 py-2 text-sm">
|
|
12852
|
+
<ng-container
|
|
12853
|
+
[ngTemplateOutlet]="emptyTemplate()!.template"
|
|
12854
|
+
[ngTemplateOutletContext]="{ $implicit: query(), filterText: query() }"
|
|
12855
|
+
/>
|
|
12856
|
+
</div>
|
|
12857
|
+
} @else {
|
|
12858
|
+
<p class="px-3 py-2 text-sm text-ink-soft">{{ emptyMessage() }}</p>
|
|
12859
|
+
}
|
|
12860
|
+
} @else {
|
|
12861
|
+
@for (option of results(); track trackValue(option); let i = $index) {
|
|
12862
|
+
<button
|
|
12863
|
+
type="button"
|
|
12864
|
+
role="option"
|
|
12865
|
+
[id]="optionId(i)"
|
|
12866
|
+
[attr.aria-selected]="isChosen(option)"
|
|
12867
|
+
[disabled]="isOptionDisabled(option)"
|
|
12868
|
+
[class]="optionClass(i, option)"
|
|
12869
|
+
(click)="pick(option, $event)"
|
|
12870
|
+
(mouseenter)="active.set(i)"
|
|
12871
|
+
>
|
|
12872
|
+
@if (multiple()) {
|
|
12873
|
+
<span
|
|
12874
|
+
class="flex size-4 shrink-0 items-center justify-center rounded border"
|
|
12875
|
+
[class]="
|
|
12876
|
+
isChosen(option)
|
|
12877
|
+
? 'border-brand-500 bg-brand-500 text-white'
|
|
12878
|
+
: 'border-border bg-surface'
|
|
12879
|
+
"
|
|
12880
|
+
aria-hidden="true"
|
|
12881
|
+
>
|
|
12882
|
+
@if (isChosen(option)) {
|
|
12883
|
+
<sds-icon name="check" [size]="11" />
|
|
12884
|
+
}
|
|
12885
|
+
</span>
|
|
12886
|
+
}
|
|
12887
|
+
@if (optionTemplate()) {
|
|
12888
|
+
<ng-container
|
|
12889
|
+
[ngTemplateOutlet]="optionTemplate()!.template"
|
|
12890
|
+
[ngTemplateOutletContext]="{
|
|
12891
|
+
$implicit: option,
|
|
12892
|
+
option: option,
|
|
12893
|
+
label: labelOf(option),
|
|
12894
|
+
value: valueOf(option),
|
|
12895
|
+
selected: isChosen(option),
|
|
12896
|
+
disabled: isOptionDisabled(option),
|
|
12897
|
+
index: i,
|
|
12898
|
+
}"
|
|
12899
|
+
/>
|
|
12900
|
+
} @else {
|
|
12901
|
+
<span class="truncate">{{ labelOf(option) }}</span>
|
|
12902
|
+
}
|
|
12903
|
+
</button>
|
|
12904
|
+
}
|
|
12905
|
+
}
|
|
12906
|
+
|
|
12907
|
+
@if (footerTemplate()) {
|
|
12908
|
+
<div class="sticky bottom-0 border-t border-border bg-surface">
|
|
12909
|
+
<ng-container
|
|
12910
|
+
[ngTemplateOutlet]="footerTemplate()!.template"
|
|
12911
|
+
[ngTemplateOutletContext]="{
|
|
12912
|
+
$implicit: query(),
|
|
12913
|
+
filterText: query(),
|
|
12914
|
+
close: closeFn,
|
|
12915
|
+
}"
|
|
12916
|
+
/>
|
|
12917
|
+
</div>
|
|
12918
|
+
}
|
|
12919
|
+
</div>
|
|
12920
|
+
}
|
|
12921
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth", "filled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12922
|
+
}
|
|
12923
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsAutocomplete, decorators: [{
|
|
12924
|
+
type: Component,
|
|
12925
|
+
args: [{
|
|
12926
|
+
selector: 'sds-autocomplete',
|
|
12927
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12928
|
+
imports: [NgTemplateOutlet, SdsIcon],
|
|
12929
|
+
host: { class: 'block', '(document:click)': 'onDocumentClick($event)' },
|
|
12930
|
+
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SdsAutocomplete, multi: true }],
|
|
12931
|
+
template: `
|
|
12932
|
+
@if (label()) {
|
|
12933
|
+
<label class="mb-1 block text-sm font-medium text-ink" [attr.for]="inputId">
|
|
12934
|
+
{{ label() }}
|
|
12935
|
+
</label>
|
|
12936
|
+
}
|
|
12937
|
+
|
|
12938
|
+
<div #trigger [class]="fieldClass()" (click)="openPanel()">
|
|
12939
|
+
@if (multiple() && display() === 'chip' && chosen().length) {
|
|
12940
|
+
<span class="flex flex-wrap items-center gap-1">
|
|
12941
|
+
@for (item of chosen(); track trackValue(item)) {
|
|
12942
|
+
<span
|
|
12943
|
+
class="inline-flex max-w-full items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-ink"
|
|
12944
|
+
>
|
|
12945
|
+
<span class="truncate">{{ labelOf(item) }}</span>
|
|
12946
|
+
<button
|
|
12947
|
+
type="button"
|
|
12948
|
+
class="shrink-0 text-ink-faint hover:text-ink"
|
|
12949
|
+
[attr.aria-label]="removeLabel().replace('{label}', labelOf(item))"
|
|
12950
|
+
(click)="remove(item, $event)"
|
|
12951
|
+
>
|
|
12952
|
+
<sds-icon name="x" [size]="12" />
|
|
12953
|
+
</button>
|
|
12954
|
+
</span>
|
|
12955
|
+
}
|
|
12956
|
+
</span>
|
|
12957
|
+
}
|
|
12958
|
+
|
|
12959
|
+
<input
|
|
12960
|
+
#field
|
|
12961
|
+
[id]="inputId"
|
|
12962
|
+
type="text"
|
|
12963
|
+
role="combobox"
|
|
12964
|
+
autocomplete="off"
|
|
12965
|
+
class="min-w-0 flex-1 bg-transparent text-sm text-ink outline-none placeholder:text-ink-faint"
|
|
12966
|
+
[attr.aria-expanded]="open()"
|
|
12967
|
+
[attr.aria-controls]="panelId"
|
|
12968
|
+
[attr.aria-activedescendant]="open() && active() >= 0 ? optionId(active()) : null"
|
|
12969
|
+
[attr.aria-label]="label() ? null : ariaLabel() || null"
|
|
12970
|
+
[placeholder]="triggerPlaceholder()"
|
|
12971
|
+
[disabled]="isDisabled()"
|
|
12972
|
+
[value]="query()"
|
|
12973
|
+
(input)="onType($event)"
|
|
12974
|
+
(keydown)="onKeydown($event)"
|
|
12975
|
+
(focus)="openPanel()"
|
|
12976
|
+
/>
|
|
12977
|
+
|
|
12978
|
+
@if (clearable() && hasValue() && !isDisabled()) {
|
|
12979
|
+
<button
|
|
12980
|
+
type="button"
|
|
12981
|
+
class="shrink-0 rounded text-ink-faint hover:text-ink"
|
|
12982
|
+
[attr.aria-label]="clearLabel()"
|
|
12983
|
+
(click)="clear($event)"
|
|
12984
|
+
>
|
|
12985
|
+
<sds-icon name="x" [size]="14" />
|
|
12986
|
+
</button>
|
|
12987
|
+
}
|
|
12988
|
+
<button
|
|
12989
|
+
type="button"
|
|
12990
|
+
class="shrink-0 rounded text-ink-faint hover:text-ink"
|
|
12991
|
+
[attr.aria-label]="openLabel()"
|
|
12992
|
+
[disabled]="isDisabled()"
|
|
12993
|
+
(click)="toggle($event)"
|
|
12994
|
+
>
|
|
12995
|
+
<sds-icon [name]="open() ? 'chevron-up' : 'chevron-down'" [size]="16" />
|
|
12996
|
+
</button>
|
|
12997
|
+
</div>
|
|
12998
|
+
|
|
12999
|
+
@if (hint() && !error()) {
|
|
13000
|
+
<p class="mt-1 text-xs text-ink-soft">{{ hint() }}</p>
|
|
13001
|
+
}
|
|
13002
|
+
@if (error()) {
|
|
13003
|
+
<p class="mt-1 text-xs text-danger">{{ error() }}</p>
|
|
13004
|
+
}
|
|
13005
|
+
|
|
13006
|
+
@if (open()) {
|
|
13007
|
+
<div
|
|
13008
|
+
#panel
|
|
13009
|
+
[id]="panelId"
|
|
13010
|
+
role="listbox"
|
|
13011
|
+
[attr.aria-multiselectable]="multiple() ? 'true' : null"
|
|
13012
|
+
class="fixed z-50 max-h-72 overflow-auto rounded-control border border-border bg-surface py-1 shadow-lg"
|
|
13013
|
+
>
|
|
13014
|
+
@if (loading()) {
|
|
13015
|
+
<p class="px-3 py-2 text-sm text-ink-soft">{{ searchingText() }}</p>
|
|
13016
|
+
} @else if (failed()) {
|
|
13017
|
+
<p class="px-3 py-2 text-sm text-danger">{{ searchErrorText() }}</p>
|
|
13018
|
+
} @else if (!results().length) {
|
|
13019
|
+
@if (tooShort()) {
|
|
13020
|
+
<p class="px-3 py-2 text-sm text-ink-soft">
|
|
13021
|
+
{{ minCharsText().replace('{count}', '' + minChars()) }}
|
|
13022
|
+
</p>
|
|
13023
|
+
} @else if (emptyTemplate()) {
|
|
13024
|
+
<div class="px-3 py-2 text-sm">
|
|
13025
|
+
<ng-container
|
|
13026
|
+
[ngTemplateOutlet]="emptyTemplate()!.template"
|
|
13027
|
+
[ngTemplateOutletContext]="{ $implicit: query(), filterText: query() }"
|
|
13028
|
+
/>
|
|
13029
|
+
</div>
|
|
13030
|
+
} @else {
|
|
13031
|
+
<p class="px-3 py-2 text-sm text-ink-soft">{{ emptyMessage() }}</p>
|
|
13032
|
+
}
|
|
13033
|
+
} @else {
|
|
13034
|
+
@for (option of results(); track trackValue(option); let i = $index) {
|
|
13035
|
+
<button
|
|
13036
|
+
type="button"
|
|
13037
|
+
role="option"
|
|
13038
|
+
[id]="optionId(i)"
|
|
13039
|
+
[attr.aria-selected]="isChosen(option)"
|
|
13040
|
+
[disabled]="isOptionDisabled(option)"
|
|
13041
|
+
[class]="optionClass(i, option)"
|
|
13042
|
+
(click)="pick(option, $event)"
|
|
13043
|
+
(mouseenter)="active.set(i)"
|
|
13044
|
+
>
|
|
13045
|
+
@if (multiple()) {
|
|
13046
|
+
<span
|
|
13047
|
+
class="flex size-4 shrink-0 items-center justify-center rounded border"
|
|
13048
|
+
[class]="
|
|
13049
|
+
isChosen(option)
|
|
13050
|
+
? 'border-brand-500 bg-brand-500 text-white'
|
|
13051
|
+
: 'border-border bg-surface'
|
|
13052
|
+
"
|
|
13053
|
+
aria-hidden="true"
|
|
13054
|
+
>
|
|
13055
|
+
@if (isChosen(option)) {
|
|
13056
|
+
<sds-icon name="check" [size]="11" />
|
|
13057
|
+
}
|
|
13058
|
+
</span>
|
|
13059
|
+
}
|
|
13060
|
+
@if (optionTemplate()) {
|
|
13061
|
+
<ng-container
|
|
13062
|
+
[ngTemplateOutlet]="optionTemplate()!.template"
|
|
13063
|
+
[ngTemplateOutletContext]="{
|
|
13064
|
+
$implicit: option,
|
|
13065
|
+
option: option,
|
|
13066
|
+
label: labelOf(option),
|
|
13067
|
+
value: valueOf(option),
|
|
13068
|
+
selected: isChosen(option),
|
|
13069
|
+
disabled: isOptionDisabled(option),
|
|
13070
|
+
index: i,
|
|
13071
|
+
}"
|
|
13072
|
+
/>
|
|
13073
|
+
} @else {
|
|
13074
|
+
<span class="truncate">{{ labelOf(option) }}</span>
|
|
13075
|
+
}
|
|
13076
|
+
</button>
|
|
13077
|
+
}
|
|
13078
|
+
}
|
|
13079
|
+
|
|
13080
|
+
@if (footerTemplate()) {
|
|
13081
|
+
<div class="sticky bottom-0 border-t border-border bg-surface">
|
|
13082
|
+
<ng-container
|
|
13083
|
+
[ngTemplateOutlet]="footerTemplate()!.template"
|
|
13084
|
+
[ngTemplateOutletContext]="{
|
|
13085
|
+
$implicit: query(),
|
|
13086
|
+
filterText: query(),
|
|
13087
|
+
close: closeFn,
|
|
13088
|
+
}"
|
|
13089
|
+
/>
|
|
13090
|
+
</div>
|
|
13091
|
+
}
|
|
13092
|
+
</div>
|
|
13093
|
+
}
|
|
13094
|
+
`,
|
|
13095
|
+
}]
|
|
13096
|
+
}], ctorParameters: () => [], propDecorators: { search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: true }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], minChars: [{ type: i0.Input, args: [{ isSignal: true, alias: "minChars", required: false }] }], debounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceMs", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], selectedOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedOptions", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], searchingText: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchingText", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], searchErrorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchErrorText", required: false }] }], minCharsText: [{ type: i0.Input, args: [{ isSignal: true, alias: "minCharsText", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], openLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "openLabel", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], triggerEl: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], fieldEl: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdsSelectOption), { isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdsSelectEmpty), { isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdsSelectFooter), { isSignal: true }] }] } });
|
|
13097
|
+
|
|
12360
13098
|
const SDS_PHONE_COUNTRIES = [
|
|
12361
13099
|
{ iso2: 'BE', name: 'Belgium', dialCode: '32', lengths: [9], format: '### ## ## ##', example: '470123456' },
|
|
12362
13100
|
{ iso2: 'FR', name: 'France', dialCode: '33', lengths: [9], format: '# ## ## ## ##', example: '612345678' },
|
|
@@ -20899,5 +21637,5 @@ function provideSdsCharts(config) {
|
|
|
20899
21637
|
* Generated bundle index. Do not edit.
|
|
20900
21638
|
*/
|
|
20901
21639
|
|
|
20902
|
-
export { SDS_ALLERGENS, SDS_ALLERGEN_ICONS, SDS_ALLERGEN_LABELS_EN, SDS_CHART_CONFIG, SDS_CHART_LABELS_EN, SDS_ICONS, SDS_PHONE_COUNTRIES, SDS_THEME_STORAGE_KEY, SDS_UI_PREF_LANG_PARAM, SDS_UI_PREF_THEME_PARAM, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAddressAutocomplete, SdsAddressExtra, SdsAllergenIcon, SdsAvatar, SdsBadge, SdsBulkBar, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsChecklistRow, SdsChip, SdsChipGroup, SdsDatePicker, SdsDateRangePicker, SdsEnvBanner, SdsFileDrop, SdsFormActions, SdsIcon, SdsImageCropper, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenu, SdsMenuItem, SdsMenuTrigger, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsRadio, SdsRangeCalendar, SdsScore, SdsSearchCommand, SdsSegmented, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsSeverity, SdsShell, SdsSidebar, SdsSortableHandle, SdsSortableItem, SdsSortableList, SdsStatusTile, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableEmpty, SdsTableHeader, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsThemeService, SdsThemeToggle, SdsTimeInput, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SdsTriStateChip, SdsUserMenu, SidebarStore, addDays, addMonths, addMonthsKeepDay, appendUiPrefs, diffInDays, formatDateRange, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isSameRange, isSdsThemeMode, isoDay, pad2, provideSdsCharts, readUiPrefs, sdsFileMatchesAccept, sdsFormatBytes, sdsFormatNational, sdsLastDays, sdsLastMonths, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth, stripUiPrefs };
|
|
21640
|
+
export { SDS_ALLERGENS, SDS_ALLERGEN_ICONS, SDS_ALLERGEN_LABELS_EN, SDS_CHART_CONFIG, SDS_CHART_LABELS_EN, SDS_ICONS, SDS_PHONE_COUNTRIES, SDS_THEME_STORAGE_KEY, SDS_UI_PREF_LANG_PARAM, SDS_UI_PREF_THEME_PARAM, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAddressAutocomplete, SdsAddressExtra, SdsAllergenIcon, SdsAutocomplete, SdsAvatar, SdsBadge, SdsBulkBar, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsChecklistRow, SdsChip, SdsChipGroup, SdsDatePicker, SdsDateRangePicker, SdsEnvBanner, SdsFileDrop, SdsFormActions, SdsIcon, SdsImageCropper, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenu, SdsMenuItem, SdsMenuTrigger, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsRadio, SdsRangeCalendar, SdsScore, SdsSearchCommand, SdsSegmented, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsSeverity, SdsShell, SdsSidebar, SdsSortableHandle, SdsSortableItem, SdsSortableList, SdsStatusTile, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableEmpty, SdsTableHeader, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsThemeService, SdsThemeToggle, SdsTimeInput, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SdsTriStateChip, SdsUserMenu, SidebarStore, addDays, addMonths, addMonthsKeepDay, appendUiPrefs, diffInDays, formatDateRange, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isSameRange, isSdsThemeMode, isoDay, pad2, provideSdsCharts, readUiPrefs, sdsFileMatchesAccept, sdsFormatBytes, sdsFormatNational, sdsLastDays, sdsLastMonths, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth, stripUiPrefs };
|
|
20903
21641
|
//# sourceMappingURL=besaitech-ng-design-system.mjs.map
|