@besaitech/ng-design-system 0.0.45 → 0.0.47
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/fesm2022/besaitech-ng-design-system.mjs +436 -29
- package/fesm2022/besaitech-ng-design-system.mjs.map +1 -1
- package/index.d.ts +108 -2
- package/package.json +1 -1
- package/themes/base.css +32 -0
|
@@ -278,7 +278,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
278
278
|
`, styles: [".sds-spinner{width:1em;height:1em;border:2px solid currentColor;border-right-color:transparent;border-radius:9999px;animation:sds-spin .6s linear infinite}@keyframes sds-spin{to{transform:rotate(360deg)}}\n"] }]
|
|
279
279
|
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], block: [{ type: i0.Input, args: [{ isSignal: true, alias: "block", required: false }] }], iconOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOnly", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
280
280
|
|
|
281
|
-
let nextId$
|
|
281
|
+
let nextId$e = 0;
|
|
282
282
|
const SIZES$a = {
|
|
283
283
|
sm: 'h-9 text-sm',
|
|
284
284
|
md: 'h-10 text-sm',
|
|
@@ -291,7 +291,7 @@ const SIZES$a = {
|
|
|
291
291
|
* sidebar search field).
|
|
292
292
|
*/
|
|
293
293
|
class SdsInput {
|
|
294
|
-
inputId = `sds-input-${nextId$
|
|
294
|
+
inputId = `sds-input-${nextId$e++}`;
|
|
295
295
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
296
296
|
/** Accessible name used when no visible [label] is provided. */
|
|
297
297
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -612,7 +612,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
612
612
|
`, styles: ["input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{transition:background-color 100000s ease-in-out 0s;-webkit-text-fill-color:currentColor;caret-color:currentColor}\n"] }]
|
|
613
613
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], leadingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "leadingIcon", required: false }] }], trailingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingIcon", required: false }] }], trailingAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingAction", required: false }] }], trailingActionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingActionLabel", required: false }] }], trailingActionPressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingActionPressed", required: false }] }], trailingActionClick: [{ type: i0.Output, args: ["trailingActionClick"] }] } });
|
|
614
614
|
|
|
615
|
-
let nextId$
|
|
615
|
+
let nextId$d = 0;
|
|
616
616
|
const HEIGHTS = {
|
|
617
617
|
sm: 'h-9',
|
|
618
618
|
md: 'h-10',
|
|
@@ -635,7 +635,7 @@ const TEXT = {
|
|
|
635
635
|
* {@link min}/{@link max} on blur and on every spinner step; ArrowUp / ArrowDown also step it.
|
|
636
636
|
*/
|
|
637
637
|
class SdsInputNumber {
|
|
638
|
-
inputId = `sds-input-number-${nextId$
|
|
638
|
+
inputId = `sds-input-number-${nextId$d++}`;
|
|
639
639
|
fieldRef = viewChild('field', ...(ngDevMode ? [{ debugName: "fieldRef" }] : []));
|
|
640
640
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
641
641
|
/** Accessible name used when no visible [label] is provided. */
|
|
@@ -1342,7 +1342,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1342
1342
|
}]
|
|
1343
1343
|
}], ctorParameters: () => [], propDecorators: { fieldRef: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], currencyDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "currencyDisplay", required: false }] }], useGrouping: [{ type: i0.Input, args: [{ isSignal: true, alias: "useGrouping", required: false }] }], minFractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "minFractionDigits", required: false }] }], maxFractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFractionDigits", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], showButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtons", required: false }] }], buttonLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonLayout", required: false }] }], incrementIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "incrementIcon", required: false }] }], decrementIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "decrementIcon", required: false }] }], allowEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmpty", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], incrementLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "incrementLabel", required: false }] }], decrementLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "decrementLabel", required: false }] }] } });
|
|
1344
1344
|
|
|
1345
|
-
let nextId$
|
|
1345
|
+
let nextId$c = 0;
|
|
1346
1346
|
const SIZES$9 = {
|
|
1347
1347
|
sm: 'min-h-9 text-sm',
|
|
1348
1348
|
md: 'min-h-10 text-sm',
|
|
@@ -1362,7 +1362,7 @@ const SIZES$9 = {
|
|
|
1362
1362
|
* `<sds-localized-input [languages]="['fr','nl','en']" [(ngModel)]="title" />`.
|
|
1363
1363
|
*/
|
|
1364
1364
|
class SdsLocalizedInput {
|
|
1365
|
-
inputId = `sds-localized-input-${nextId$
|
|
1365
|
+
inputId = `sds-localized-input-${nextId$c++}`;
|
|
1366
1366
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1367
1367
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1368
1368
|
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
@@ -1618,7 +1618,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1618
1618
|
}]
|
|
1619
1619
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], languages: [{ type: i0.Input, args: [{ isSignal: true, alias: "languages", required: false }] }], currentLanguage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentLanguage", required: false }] }], multiline: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiline", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], languageSwitcherLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "languageSwitcherLabel", required: false }] }], untranslatedLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "untranslatedLabel", required: false }] }] } });
|
|
1620
1620
|
|
|
1621
|
-
let nextId$
|
|
1621
|
+
let nextId$b = 0;
|
|
1622
1622
|
const SIZES$8 = {
|
|
1623
1623
|
md: 'h-12 w-11 text-lg',
|
|
1624
1624
|
lg: 'h-14 w-12 text-xl',
|
|
@@ -1635,7 +1635,7 @@ const SIZES$8 = {
|
|
|
1635
1635
|
* first box and have it land correctly.
|
|
1636
1636
|
*/
|
|
1637
1637
|
class SdsOtpInput {
|
|
1638
|
-
groupId = `sds-otp-${nextId$
|
|
1638
|
+
groupId = `sds-otp-${nextId$b++}`;
|
|
1639
1639
|
/** How many boxes / characters the code has. */
|
|
1640
1640
|
length = input(6, ...(ngDevMode ? [{ debugName: "length", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
1641
1641
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
@@ -1935,7 +1935,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1935
1935
|
}]
|
|
1936
1936
|
}], ctorParameters: () => [], propDecorators: { length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputMode", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], cellLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellLabel", required: false }] }], completed: [{ type: i0.Output, args: ["completed"] }], cells: [{ type: i0.ViewChildren, args: ['cell', { isSignal: true }] }] } });
|
|
1937
1937
|
|
|
1938
|
-
let nextId$
|
|
1938
|
+
let nextId$a = 0;
|
|
1939
1939
|
const SIZES$7 = {
|
|
1940
1940
|
sm: 'text-sm px-3 py-2',
|
|
1941
1941
|
md: 'text-sm px-3.5 py-2.5',
|
|
@@ -1947,7 +1947,7 @@ const SIZES$7 = {
|
|
|
1947
1947
|
* [(ngModel)].
|
|
1948
1948
|
*/
|
|
1949
1949
|
class SdsTextarea {
|
|
1950
|
-
fieldId = `sds-textarea-${nextId$
|
|
1950
|
+
fieldId = `sds-textarea-${nextId$a++}`;
|
|
1951
1951
|
field = viewChild('field', ...(ngDevMode ? [{ debugName: "field" }] : []));
|
|
1952
1952
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1953
1953
|
/** Accessible name used when no visible [label] is provided. */
|
|
@@ -2185,7 +2185,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2185
2185
|
}]
|
|
2186
2186
|
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], showCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCount", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }] } });
|
|
2187
2187
|
|
|
2188
|
-
let nextId$
|
|
2188
|
+
let nextId$9 = 0;
|
|
2189
2189
|
const SIZES$6 = {
|
|
2190
2190
|
sm: { track: 'h-5 w-9', knob: 'h-4 w-4', on: 'translate-x-4', icon: 11 },
|
|
2191
2191
|
md: { track: 'h-6 w-11', knob: 'h-5 w-5', on: 'translate-x-5', icon: 13 },
|
|
@@ -2198,7 +2198,7 @@ const SIZES$6 = {
|
|
|
2198
2198
|
* states.
|
|
2199
2199
|
*/
|
|
2200
2200
|
class SdsToggleSwitch {
|
|
2201
|
-
fieldId = `sds-toggle-switch-${nextId$
|
|
2201
|
+
fieldId = `sds-toggle-switch-${nextId$9++}`;
|
|
2202
2202
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2203
2203
|
/** Accessible name used when no visible [label] is provided. */
|
|
2204
2204
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -2435,7 +2435,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2435
2435
|
}]
|
|
2436
2436
|
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], trueValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "trueValue", required: false }] }], falseValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "falseValue", required: false }] }], onIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "onIcon", required: false }] }], offIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "offIcon", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }] } });
|
|
2437
2437
|
|
|
2438
|
-
let nextId$
|
|
2438
|
+
let nextId$8 = 0;
|
|
2439
2439
|
/**
|
|
2440
2440
|
* Boolean checkbox. Implements ControlValueAccessor — use with reactive forms
|
|
2441
2441
|
* or `[(ngModel)]`. Renders a styled box (brand-filled with a check when on)
|
|
@@ -2445,7 +2445,7 @@ let nextId$7 = 0;
|
|
|
2445
2445
|
* <sds-checkbox label="Fusion automatique" [(ngModel)]="autoMerge" />
|
|
2446
2446
|
*/
|
|
2447
2447
|
class SdsCheckbox {
|
|
2448
|
-
id = `sds-checkbox-${nextId$
|
|
2448
|
+
id = `sds-checkbox-${nextId$8++}`;
|
|
2449
2449
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2450
2450
|
/** Accessible name used when no visible [label] is provided. */
|
|
2451
2451
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -3619,7 +3619,7 @@ const SIZES$5 = {
|
|
|
3619
3619
|
class SdsDatePicker {
|
|
3620
3620
|
host = inject(ElementRef);
|
|
3621
3621
|
injector = inject(Injector);
|
|
3622
|
-
fieldId = `sds-date-${nextId$
|
|
3622
|
+
fieldId = `sds-date-${nextId$7++}`;
|
|
3623
3623
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
3624
3624
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
3625
3625
|
placeholder = input('jj/mm/aaaa', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
@@ -4134,7 +4134,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4134
4134
|
`,
|
|
4135
4135
|
}]
|
|
4136
4136
|
}], 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 }] }] } });
|
|
4137
|
-
let nextId$
|
|
4137
|
+
let nextId$7 = 0;
|
|
4138
4138
|
|
|
4139
4139
|
/**
|
|
4140
4140
|
* Supplies a custom template for each option row (and the selected value shown
|
|
@@ -4218,7 +4218,7 @@ const SIZES$4 = {
|
|
|
4218
4218
|
md: 'h-10 text-sm',
|
|
4219
4219
|
lg: 'h-12 text-base',
|
|
4220
4220
|
};
|
|
4221
|
-
let nextId$
|
|
4221
|
+
let nextId$6 = 0;
|
|
4222
4222
|
/**
|
|
4223
4223
|
* Single-select dropdown. Options may be primitives or objects (configure via
|
|
4224
4224
|
* [optionLabel]/[optionValue]/[optionDisabled]). The overlay is appended to
|
|
@@ -4252,7 +4252,7 @@ let nextId$5 = 0;
|
|
|
4252
4252
|
class SdsSelect {
|
|
4253
4253
|
host = inject(ElementRef);
|
|
4254
4254
|
injector = inject(Injector);
|
|
4255
|
-
selectId = `sds-select-${nextId$
|
|
4255
|
+
selectId = `sds-select-${nextId$6++}`;
|
|
4256
4256
|
listId = `${this.selectId}-list`;
|
|
4257
4257
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
4258
4258
|
optionLabel = input('label', ...(ngDevMode ? [{ debugName: "optionLabel" }] : []));
|
|
@@ -4935,7 +4935,7 @@ const SIZES$3 = {
|
|
|
4935
4935
|
md: 'min-h-10 text-sm',
|
|
4936
4936
|
lg: 'min-h-12 text-base',
|
|
4937
4937
|
};
|
|
4938
|
-
let nextId$
|
|
4938
|
+
let nextId$5 = 0;
|
|
4939
4939
|
/**
|
|
4940
4940
|
* Multi-select dropdown (value is an array). Options may be primitives or
|
|
4941
4941
|
* objects (configure via [optionLabel]/[optionValue]/[optionDisabled]). The
|
|
@@ -4968,7 +4968,7 @@ let nextId$4 = 0;
|
|
|
4968
4968
|
class SdsMultiSelect {
|
|
4969
4969
|
host = inject(ElementRef);
|
|
4970
4970
|
injector = inject(Injector);
|
|
4971
|
-
selectId = `sds-multiselect-${nextId$
|
|
4971
|
+
selectId = `sds-multiselect-${nextId$5++}`;
|
|
4972
4972
|
listId = `${this.selectId}-list`;
|
|
4973
4973
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
4974
4974
|
optionLabel = input('label', ...(ngDevMode ? [{ debugName: "optionLabel" }] : []));
|
|
@@ -5830,7 +5830,7 @@ const SIZES$2 = {
|
|
|
5830
5830
|
md: 'h-10 text-sm',
|
|
5831
5831
|
lg: 'h-12 text-base',
|
|
5832
5832
|
};
|
|
5833
|
-
let nextId$
|
|
5833
|
+
let nextId$4 = 0;
|
|
5834
5834
|
/**
|
|
5835
5835
|
* International phone number input: a country selector (ISO chip + dial code)
|
|
5836
5836
|
* with a searchable, body-appended dropdown, plus a formatted national-number
|
|
@@ -5845,7 +5845,7 @@ let nextId$3 = 0;
|
|
|
5845
5845
|
class SdsPhoneInput {
|
|
5846
5846
|
host = inject(ElementRef);
|
|
5847
5847
|
injector = inject(Injector);
|
|
5848
|
-
fieldId = `sds-phone-${nextId$
|
|
5848
|
+
fieldId = `sds-phone-${nextId$4++}`;
|
|
5849
5849
|
listId = `${this.fieldId}-list`;
|
|
5850
5850
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
5851
5851
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
@@ -6927,7 +6927,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
6927
6927
|
}]
|
|
6928
6928
|
}], propDecorators: { totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], first: [{ type: i0.Input, args: [{ isSignal: true, alias: "first", required: false }] }, { type: i0.Output, args: ["firstChange"] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }, { type: i0.Output, args: ["rowsChange"] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], pageLinkSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageLinkSize", required: false }] }], showFirstLastIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstLastIcon", required: false }] }], showPageLinks: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageLinks", required: false }] }], showCurrentPageReport: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCurrentPageReport", required: false }] }], currentPageReportTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPageReportTemplate", required: false }] }], showJumpToPageInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "showJumpToPageInput", required: false }] }], rowsPerPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageLabel", required: false }] }], jumpToPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "jumpToPageLabel", required: false }] }], paginationLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginationLabel", required: false }] }], firstPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstPageLabel", required: false }] }], previousPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousPageLabel", required: false }] }], nextPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextPageLabel", required: false }] }], lastPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastPageLabel", required: false }] }], pageLinkLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageLinkLabel", required: false }] }], jumpToPageAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "jumpToPageAriaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }] } });
|
|
6929
6929
|
|
|
6930
|
-
let nextId$
|
|
6930
|
+
let nextId$3 = 0;
|
|
6931
6931
|
/**
|
|
6932
6932
|
* Coordinates a single <sds-tabs> instance: holds the active value (shared from
|
|
6933
6933
|
* the host's two-way model), tracks registered tabs for default selection and
|
|
@@ -6937,7 +6937,7 @@ let nextId$2 = 0;
|
|
|
6937
6937
|
*/
|
|
6938
6938
|
class SdsTabsStore {
|
|
6939
6939
|
/** Unique base id used to link tabs and panels via ARIA. */
|
|
6940
|
-
id = `sds-tabs-${nextId$
|
|
6940
|
+
id = `sds-tabs-${nextId$3++}`;
|
|
6941
6941
|
/** Whether the tab list scrolls horizontally (mirrors [scrollable]). */
|
|
6942
6942
|
scrollable = signal(false, ...(ngDevMode ? [{ debugName: "scrollable" }] : []));
|
|
6943
6943
|
value;
|
|
@@ -7219,7 +7219,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
7219
7219
|
}]
|
|
7220
7220
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
7221
7221
|
|
|
7222
|
-
let nextId$
|
|
7222
|
+
let nextId$2 = 0;
|
|
7223
7223
|
/**
|
|
7224
7224
|
* Coordinates a single <sds-accordion>: holds the open value(s) (shared from the
|
|
7225
7225
|
* host's two-way model), the multiple-open flag, and generates the ARIA ids that
|
|
@@ -7229,7 +7229,7 @@ let nextId$1 = 0;
|
|
|
7229
7229
|
*/
|
|
7230
7230
|
class SdsAccordionStore {
|
|
7231
7231
|
/** Unique base id used to link headers and content regions via ARIA. */
|
|
7232
|
-
id = `sds-accordion-${nextId$
|
|
7232
|
+
id = `sds-accordion-${nextId$2++}`;
|
|
7233
7233
|
/** Whether more than one panel may be open at a time (mirrors [multiple]). */
|
|
7234
7234
|
multiple = signal(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
7235
7235
|
value;
|
|
@@ -7567,7 +7567,7 @@ const ALIGN = {
|
|
|
7567
7567
|
center: 'text-center',
|
|
7568
7568
|
right: 'text-right',
|
|
7569
7569
|
};
|
|
7570
|
-
let nextId = 0;
|
|
7570
|
+
let nextId$1 = 0;
|
|
7571
7571
|
/**
|
|
7572
7572
|
* Client-side data table mirroring PrimeNG's table, scoped to a strong local
|
|
7573
7573
|
* feature set: sorting, pagination (reuses {@link SdsPaginator}), global filter,
|
|
@@ -7596,7 +7596,7 @@ let nextId = 0;
|
|
|
7596
7596
|
* </sds-table>
|
|
7597
7597
|
*/
|
|
7598
7598
|
class SdsTable {
|
|
7599
|
-
tableId = `sds-table-${nextId++}`;
|
|
7599
|
+
tableId = `sds-table-${nextId$1++}`;
|
|
7600
7600
|
// --- inputs ---------------------------------------------------------------
|
|
7601
7601
|
value = input([], ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
7602
7602
|
columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
@@ -10805,6 +10805,413 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
10805
10805
|
`, styles: [".animate-sds-cmd{animation:sds-cmd-in .16s ease-out}@keyframes sds-cmd-in{0%{opacity:0;transform:translateY(-10px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.animate-sds-cmd{animation:none}}\n"] }]
|
|
10806
10806
|
}], ctorParameters: () => [], propDecorators: { searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], overlay: [{ type: i0.ViewChild, args: ['overlay', { isSignal: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], showTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTrigger", required: false }] }], hotkey: [{ type: i0.Input, args: [{ isSignal: true, alias: "hotkey", required: false }] }], triggerMinWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerMinWidth", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }], emptyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyLabel", required: false }] }], selectHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectHint", required: false }] }], navigateHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "navigateHint", required: false }] }], closeHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeHint", required: false }] }], select: [{ type: i0.Output, args: ["select"] }], openChange: [{ type: i0.Output, args: ["openChange"] }] } });
|
|
10807
10807
|
|
|
10808
|
+
let nextId = 0;
|
|
10809
|
+
/**
|
|
10810
|
+
* The language picker for the top bar: a compact pill (globe icon + the active code) that opens a panel
|
|
10811
|
+
* listing exactly the languages the app supports, each row marked selected for the current one.
|
|
10812
|
+
*
|
|
10813
|
+
* The library owns no i18n engine — every app uses a different one (ngx-translate, Transloco, per-locale
|
|
10814
|
+
* URLs). So this is a pure, controlled control: the app passes the supported [languages] and the [current]
|
|
10815
|
+
* code, and reacts to the choice. `current` is a two-way `model`, so bind `[(current)]="lang"` for optimistic
|
|
10816
|
+
* echo, or just listen to `(currentChange)` and call your own `translate.use($event)`. Rows show each
|
|
10817
|
+
* language's human label (pass it in the option, or let it default to the uppercased code).
|
|
10818
|
+
*
|
|
10819
|
+
* It is a sibling of sds-user-menu / sds-theme-toggle / sds-search-command and shares their chrome: the same
|
|
10820
|
+
* two appearances (`surface` default for a light/glass bar, `on-brand` for the dark brand bar), the same
|
|
10821
|
+
* disclosure mechanics (closes on outside click, on Escape, and on selection, restoring focus to the trigger),
|
|
10822
|
+
* and the same panel styling and open animation — so the three top-bar controls read as one set.
|
|
10823
|
+
*
|
|
10824
|
+
* The panel is appended to `document.body` while open and positioned against the trigger (like sds-select),
|
|
10825
|
+
* so a clipping ancestor — a bar with `overflow:hidden`, or a `glass` bar whose `backdrop-filter` is a
|
|
10826
|
+
* containing block — can never cut it off or paint over it. It repositions on scroll/resize and is removed
|
|
10827
|
+
* on close. Accessibility follows the APG select-only combobox: focus stays on the trigger, and Arrow/Home/
|
|
10828
|
+
* End/Enter/Escape drive a highlighted option surfaced via `aria-activedescendant` (works even though the
|
|
10829
|
+
* listbox lives in `<body>`).
|
|
10830
|
+
*
|
|
10831
|
+
* @example
|
|
10832
|
+
* <sds-language-switcher
|
|
10833
|
+
* [languages]="[{ code: 'fr', label: 'Français' }, { code: 'de', label: 'Deutsch' }, { code: 'en', label: 'English' }]"
|
|
10834
|
+
* [current]="lang()"
|
|
10835
|
+
* menuLabel="Changer de langue"
|
|
10836
|
+
* (currentChange)="translate.use($event)"
|
|
10837
|
+
* />
|
|
10838
|
+
*
|
|
10839
|
+
* @example
|
|
10840
|
+
* <!-- Bare codes are fine; rows fall back to the uppercased code. -->
|
|
10841
|
+
* <sds-language-switcher [languages]="['fr', 'de', 'en']" [(current)]="lang" />
|
|
10842
|
+
*/
|
|
10843
|
+
class SdsLanguageSwitcher {
|
|
10844
|
+
el = inject(ElementRef);
|
|
10845
|
+
injector = inject(Injector);
|
|
10846
|
+
trigger = viewChild('trigger', ...(ngDevMode ? [{ debugName: "trigger" }] : []));
|
|
10847
|
+
panelId = `sds-language-panel-${nextId++}`;
|
|
10848
|
+
/** The supported languages — either `{ code, label }` options or bare code strings. */
|
|
10849
|
+
languages = input([], ...(ngDevMode ? [{ debugName: "languages" }] : []));
|
|
10850
|
+
/** The active language code. Two-way: `[(current)]` echoes the choice, or listen to `(currentChange)`. */
|
|
10851
|
+
current = model('', ...(ngDevMode ? [{ debugName: "current" }] : []));
|
|
10852
|
+
/** `surface` (default) for a light / glass bar; `on-brand` for the dark brand bar. */
|
|
10853
|
+
appearance = input('surface', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
10854
|
+
/** Which edge the panel aligns to. `end` (default) hangs it from the right of the trigger. */
|
|
10855
|
+
align = input('end', ...(ngDevMode ? [{ debugName: "align" }] : []));
|
|
10856
|
+
/** `up` prefers opening the panel above the trigger — for a switcher near the bottom of the page. */
|
|
10857
|
+
direction = input('down', ...(ngDevMode ? [{ debugName: "direction" }] : []));
|
|
10858
|
+
/** Accessible name for the trigger and panel. */
|
|
10859
|
+
menuLabel = input('Choisir la langue', ...(ngDevMode ? [{ debugName: "menuLabel" }] : []));
|
|
10860
|
+
/** Optional visible header above the list (e.g. "Langue"). Omitted when empty. */
|
|
10861
|
+
heading = input('', ...(ngDevMode ? [{ debugName: "heading" }] : []));
|
|
10862
|
+
openChange = output();
|
|
10863
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
10864
|
+
highlightedIndex = signal(-1, ...(ngDevMode ? [{ debugName: "highlightedIndex" }] : []));
|
|
10865
|
+
panelEl = null;
|
|
10866
|
+
/** Normalise the mixed `languages` input to `{ code, label }`, defaulting the label to the code. */
|
|
10867
|
+
options = computed(() => this.languages().map((l) => typeof l === 'string'
|
|
10868
|
+
? { code: l, label: l.toUpperCase() }
|
|
10869
|
+
: { code: l.code, label: l.label ?? l.code.toUpperCase() }), ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
10870
|
+
/**
|
|
10871
|
+
* The code treated as active everywhere — trigger label AND the selected row. Falls back to the first
|
|
10872
|
+
* option when `current` is unset, so the pill and the checked row can never disagree.
|
|
10873
|
+
*/
|
|
10874
|
+
effectiveCode = computed(() => this.current() || this.options()[0]?.code || '', ...(ngDevMode ? [{ debugName: "effectiveCode" }] : []));
|
|
10875
|
+
/** Uppercased code shown in the trigger. */
|
|
10876
|
+
currentCode = computed(() => this.effectiveCode().toUpperCase(), ...(ngDevMode ? [{ debugName: "currentCode" }] : []));
|
|
10877
|
+
activeOptionId = computed(() => this.highlightedIndex() >= 0 ? this.optionId(this.highlightedIndex()) : null, ...(ngDevMode ? [{ debugName: "activeOptionId" }] : []));
|
|
10878
|
+
optionId(i) {
|
|
10879
|
+
return `${this.panelId}-opt-${i}`;
|
|
10880
|
+
}
|
|
10881
|
+
toggle() {
|
|
10882
|
+
this.open() ? this.close(true) : this.openPanel();
|
|
10883
|
+
}
|
|
10884
|
+
openPanel() {
|
|
10885
|
+
this.open.set(true);
|
|
10886
|
+
this.openChange.emit(true);
|
|
10887
|
+
this.initHighlight();
|
|
10888
|
+
// After the panel renders inside the host, portal it to <body> and anchor it to the trigger, so no
|
|
10889
|
+
// clipping/stacking ancestor (an overflow:hidden bar, a backdrop-filter glass bar) can cut it off.
|
|
10890
|
+
// Focus stays on the trigger (combobox model); the active row is surfaced via aria-activedescendant.
|
|
10891
|
+
afterNextRender(() => {
|
|
10892
|
+
this.panelEl = this.el.nativeElement.querySelector('[data-sds-language-panel]');
|
|
10893
|
+
this.positionPanel();
|
|
10894
|
+
this.addReflowListeners();
|
|
10895
|
+
this.trigger()?.nativeElement.focus();
|
|
10896
|
+
this.scrollHighlightedIntoView();
|
|
10897
|
+
}, { injector: this.injector });
|
|
10898
|
+
}
|
|
10899
|
+
close(returnFocus = false) {
|
|
10900
|
+
if (!this.open())
|
|
10901
|
+
return;
|
|
10902
|
+
this.removeReflowListeners();
|
|
10903
|
+
// Remove the portalled node ourselves before Angular tears the view down (it lives in <body> now).
|
|
10904
|
+
this.panelEl?.remove();
|
|
10905
|
+
this.panelEl = null;
|
|
10906
|
+
this.open.set(false);
|
|
10907
|
+
this.openChange.emit(false);
|
|
10908
|
+
if (returnFocus)
|
|
10909
|
+
this.trigger()?.nativeElement.focus();
|
|
10910
|
+
}
|
|
10911
|
+
choose(code) {
|
|
10912
|
+
this.current.set(code);
|
|
10913
|
+
// Pointer/keyboard selection returns focus to the trigger, like the other top-bar disclosures.
|
|
10914
|
+
this.close(true);
|
|
10915
|
+
}
|
|
10916
|
+
onDocumentClick(event) {
|
|
10917
|
+
if (!this.open())
|
|
10918
|
+
return;
|
|
10919
|
+
const target = event.target;
|
|
10920
|
+
const inHost = this.el.nativeElement.contains(target);
|
|
10921
|
+
const inPanel = !!this.panelEl && this.panelEl.contains(target);
|
|
10922
|
+
if (!inHost && !inPanel)
|
|
10923
|
+
this.close();
|
|
10924
|
+
}
|
|
10925
|
+
onEscape() {
|
|
10926
|
+
if (!this.open())
|
|
10927
|
+
return;
|
|
10928
|
+
this.close(true);
|
|
10929
|
+
}
|
|
10930
|
+
// --- keyboard (APG select-only combobox: focus stays on the trigger) ---
|
|
10931
|
+
onTriggerKeydown(event) {
|
|
10932
|
+
if (!this.open()) {
|
|
10933
|
+
if (['ArrowDown', 'ArrowUp', 'Enter', ' '].includes(event.key)) {
|
|
10934
|
+
event.preventDefault();
|
|
10935
|
+
this.openPanel();
|
|
10936
|
+
}
|
|
10937
|
+
return;
|
|
10938
|
+
}
|
|
10939
|
+
switch (event.key) {
|
|
10940
|
+
case 'ArrowDown':
|
|
10941
|
+
event.preventDefault();
|
|
10942
|
+
this.move(1);
|
|
10943
|
+
break;
|
|
10944
|
+
case 'ArrowUp':
|
|
10945
|
+
event.preventDefault();
|
|
10946
|
+
this.move(-1);
|
|
10947
|
+
break;
|
|
10948
|
+
case 'Home':
|
|
10949
|
+
event.preventDefault();
|
|
10950
|
+
this.highlight(0);
|
|
10951
|
+
break;
|
|
10952
|
+
case 'End':
|
|
10953
|
+
event.preventDefault();
|
|
10954
|
+
this.highlight(this.options().length - 1);
|
|
10955
|
+
break;
|
|
10956
|
+
case 'Enter':
|
|
10957
|
+
case ' ':
|
|
10958
|
+
event.preventDefault();
|
|
10959
|
+
this.chooseHighlighted();
|
|
10960
|
+
break;
|
|
10961
|
+
case 'Escape':
|
|
10962
|
+
event.preventDefault();
|
|
10963
|
+
this.close(true);
|
|
10964
|
+
break;
|
|
10965
|
+
case 'Tab':
|
|
10966
|
+
this.close(false);
|
|
10967
|
+
break;
|
|
10968
|
+
default: break;
|
|
10969
|
+
}
|
|
10970
|
+
}
|
|
10971
|
+
initHighlight() {
|
|
10972
|
+
const idx = this.options().findIndex((o) => o.code === this.effectiveCode());
|
|
10973
|
+
this.highlightedIndex.set(idx >= 0 ? idx : this.options().length ? 0 : -1);
|
|
10974
|
+
}
|
|
10975
|
+
move(delta) {
|
|
10976
|
+
const n = this.options().length;
|
|
10977
|
+
if (!n)
|
|
10978
|
+
return;
|
|
10979
|
+
const from = this.highlightedIndex();
|
|
10980
|
+
this.highlight(((from < 0 ? 0 : from) + delta + n) % n);
|
|
10981
|
+
}
|
|
10982
|
+
highlight(i) {
|
|
10983
|
+
if (i < 0 || i >= this.options().length)
|
|
10984
|
+
return;
|
|
10985
|
+
this.highlightedIndex.set(i);
|
|
10986
|
+
this.scrollHighlightedIntoView();
|
|
10987
|
+
}
|
|
10988
|
+
chooseHighlighted() {
|
|
10989
|
+
const opt = this.options()[this.highlightedIndex()];
|
|
10990
|
+
if (opt)
|
|
10991
|
+
this.choose(opt.code);
|
|
10992
|
+
}
|
|
10993
|
+
scrollHighlightedIntoView() {
|
|
10994
|
+
setTimeout(() => {
|
|
10995
|
+
this.panelEl
|
|
10996
|
+
?.querySelector(`[data-index="${this.highlightedIndex()}"]`)
|
|
10997
|
+
?.scrollIntoView({ block: 'nearest' });
|
|
10998
|
+
});
|
|
10999
|
+
}
|
|
11000
|
+
// --- body-appended overlay positioning (mirrors sds-select / sds-date-picker) ---
|
|
11001
|
+
reflow = () => this.positionPanel();
|
|
11002
|
+
listening = false;
|
|
11003
|
+
addReflowListeners() {
|
|
11004
|
+
if (this.listening)
|
|
11005
|
+
return;
|
|
11006
|
+
window.addEventListener('scroll', this.reflow, true);
|
|
11007
|
+
window.addEventListener('resize', this.reflow);
|
|
11008
|
+
this.listening = true;
|
|
11009
|
+
}
|
|
11010
|
+
removeReflowListeners() {
|
|
11011
|
+
if (!this.listening)
|
|
11012
|
+
return;
|
|
11013
|
+
window.removeEventListener('scroll', this.reflow, true);
|
|
11014
|
+
window.removeEventListener('resize', this.reflow);
|
|
11015
|
+
this.listening = false;
|
|
11016
|
+
}
|
|
11017
|
+
positionPanel() {
|
|
11018
|
+
const triggerEl = this.trigger()?.nativeElement;
|
|
11019
|
+
const panelEl = this.panelEl;
|
|
11020
|
+
if (!triggerEl || !panelEl)
|
|
11021
|
+
return;
|
|
11022
|
+
if (panelEl.parentElement !== document.body)
|
|
11023
|
+
document.body.appendChild(panelEl);
|
|
11024
|
+
const r = triggerEl.getBoundingClientRect();
|
|
11025
|
+
const gap = 8;
|
|
11026
|
+
const margin = 8;
|
|
11027
|
+
const pw = panelEl.offsetWidth || 176;
|
|
11028
|
+
const ph = panelEl.offsetHeight || 200;
|
|
11029
|
+
// Vertical: below by default; open above when asked (direction='up') and there is room, or when there
|
|
11030
|
+
// isn't room below but there is above. The panel height is bounded by the list's max-h, but clamp
|
|
11031
|
+
// defensively so top can never be pushed off the top edge.
|
|
11032
|
+
const roomBelow = window.innerHeight - r.bottom - gap;
|
|
11033
|
+
const roomAbove = r.top - gap;
|
|
11034
|
+
let top = (this.direction() === 'up' && roomAbove >= ph) || (roomBelow < ph && roomAbove > roomBelow)
|
|
11035
|
+
? r.top - gap - ph
|
|
11036
|
+
: r.bottom + gap;
|
|
11037
|
+
if (top + ph > window.innerHeight - margin)
|
|
11038
|
+
top = window.innerHeight - margin - ph;
|
|
11039
|
+
if (top < margin)
|
|
11040
|
+
top = margin;
|
|
11041
|
+
// Horizontal: align the panel's end (right) or start (left) edge to the trigger, then clamp.
|
|
11042
|
+
let left = this.align() === 'end' ? r.right - pw : r.left;
|
|
11043
|
+
left = Math.min(left, window.innerWidth - margin - pw);
|
|
11044
|
+
left = Math.max(margin, left);
|
|
11045
|
+
panelEl.style.top = `${Math.round(top)}px`;
|
|
11046
|
+
panelEl.style.left = `${Math.round(left)}px`;
|
|
11047
|
+
}
|
|
11048
|
+
ngOnDestroy() {
|
|
11049
|
+
this.removeReflowListeners();
|
|
11050
|
+
this.panelEl?.remove();
|
|
11051
|
+
}
|
|
11052
|
+
onBrand = computed(() => this.appearance() === 'on-brand', ...(ngDevMode ? [{ debugName: "onBrand" }] : []));
|
|
11053
|
+
triggerClass = computed(() => this.onBrand()
|
|
11054
|
+
? 'text-white/85 hover:bg-white/10 hover:text-white focus-visible:ring-white/40'
|
|
11055
|
+
: 'bg-muted text-ink-soft hover:bg-brand-50 hover:text-brand-600 focus-visible:ring-brand-500/40', ...(ngDevMode ? [{ debugName: "triggerClass" }] : []));
|
|
11056
|
+
chevronClass = computed(() => (this.onBrand() ? 'text-white/70' : 'text-ink-faint'), ...(ngDevMode ? [{ debugName: "chevronClass" }] : []));
|
|
11057
|
+
rowClass(index, selected) {
|
|
11058
|
+
const base = 'flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 text-sm font-medium transition-colors';
|
|
11059
|
+
const highlighted = this.highlightedIndex() === index;
|
|
11060
|
+
let state;
|
|
11061
|
+
if (selected) {
|
|
11062
|
+
state = highlighted ? 'bg-brand-500/25 text-ink' : 'bg-brand-500/15 text-ink';
|
|
11063
|
+
}
|
|
11064
|
+
else {
|
|
11065
|
+
state = highlighted ? 'bg-muted text-ink' : 'text-ink-soft';
|
|
11066
|
+
}
|
|
11067
|
+
return `${base} ${state}`;
|
|
11068
|
+
}
|
|
11069
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsLanguageSwitcher, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11070
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsLanguageSwitcher, isStandalone: true, selector: "sds-language-switcher", inputs: { languages: { classPropertyName: "languages", publicName: "languages", isSignal: true, isRequired: false, transformFunction: null }, current: { classPropertyName: "current", publicName: "current", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, menuLabel: { classPropertyName: "menuLabel", publicName: "menuLabel", isSignal: true, isRequired: false, transformFunction: null }, heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { current: "currentChange", openChange: "openChange" }, host: { listeners: { "document:click": "onDocumentClick($event)", "document:keydown.escape": "onEscape()" }, classAttribute: "relative inline-block" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
11071
|
+
<button
|
|
11072
|
+
#trigger
|
|
11073
|
+
type="button"
|
|
11074
|
+
role="combobox"
|
|
11075
|
+
class="flex h-10 items-center gap-1.5 rounded-control px-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2"
|
|
11076
|
+
[class]="triggerClass()"
|
|
11077
|
+
[attr.aria-label]="menuLabel()"
|
|
11078
|
+
aria-haspopup="listbox"
|
|
11079
|
+
[attr.aria-expanded]="open()"
|
|
11080
|
+
[attr.aria-controls]="open() ? panelId : null"
|
|
11081
|
+
[attr.aria-activedescendant]="open() ? activeOptionId() : null"
|
|
11082
|
+
(click)="toggle()"
|
|
11083
|
+
(keydown)="onTriggerKeydown($event)"
|
|
11084
|
+
>
|
|
11085
|
+
<sds-icon name="languages" [size]="16" class="shrink-0" />
|
|
11086
|
+
<span>{{ currentCode() }}</span>
|
|
11087
|
+
<sds-icon
|
|
11088
|
+
name="chevron-down"
|
|
11089
|
+
[size]="14"
|
|
11090
|
+
class="shrink-0 transition-transform"
|
|
11091
|
+
[class]="chevronClass()"
|
|
11092
|
+
[class.rotate-180]="open()"
|
|
11093
|
+
/>
|
|
11094
|
+
</button>
|
|
11095
|
+
|
|
11096
|
+
@if (open()) {
|
|
11097
|
+
<!-- Appended to document.body on open (see positionPanel) so no ancestor can clip it. -->
|
|
11098
|
+
<div
|
|
11099
|
+
data-sds-language-panel
|
|
11100
|
+
[id]="panelId"
|
|
11101
|
+
role="listbox"
|
|
11102
|
+
[attr.aria-label]="menuLabel()"
|
|
11103
|
+
class="fixed z-[1000] min-w-44 overflow-hidden rounded-card border border-border bg-surface shadow-xl animate-sds-menu"
|
|
11104
|
+
>
|
|
11105
|
+
@if (heading(); as h) {
|
|
11106
|
+
<p class="border-b border-border px-4 pb-2 pt-3 text-[0.68rem] font-semibold uppercase tracking-wider text-ink-faint">
|
|
11107
|
+
{{ h }}
|
|
11108
|
+
</p>
|
|
11109
|
+
}
|
|
11110
|
+
<div class="max-h-[60vh] overflow-auto py-1.5">
|
|
11111
|
+
@for (opt of options(); track opt.code; let i = $index) {
|
|
11112
|
+
<div
|
|
11113
|
+
[id]="optionId(i)"
|
|
11114
|
+
role="option"
|
|
11115
|
+
[attr.data-index]="i"
|
|
11116
|
+
[attr.aria-selected]="opt.code === effectiveCode()"
|
|
11117
|
+
[class]="rowClass(i, opt.code === effectiveCode())"
|
|
11118
|
+
(click)="choose(opt.code)"
|
|
11119
|
+
(mouseenter)="highlightedIndex.set(i)"
|
|
11120
|
+
>
|
|
11121
|
+
<span class="flex-1 truncate text-left">{{ opt.label }}</span>
|
|
11122
|
+
<span
|
|
11123
|
+
class="shrink-0 text-[0.7rem] font-semibold uppercase tracking-wide"
|
|
11124
|
+
[class]="opt.code === effectiveCode() ? 'text-brand-600' : 'text-ink-faint'"
|
|
11125
|
+
>{{ opt.code }}</span
|
|
11126
|
+
>
|
|
11127
|
+
@if (opt.code === effectiveCode()) {
|
|
11128
|
+
<sds-icon name="check" [size]="16" class="shrink-0 text-brand-600" />
|
|
11129
|
+
} @else {
|
|
11130
|
+
<span class="w-4 shrink-0" aria-hidden="true"></span>
|
|
11131
|
+
}
|
|
11132
|
+
</div>
|
|
11133
|
+
}
|
|
11134
|
+
</div>
|
|
11135
|
+
</div>
|
|
11136
|
+
}
|
|
11137
|
+
`, isInline: true, styles: [".animate-sds-menu{animation:sds-menu-in .14s ease-out}@keyframes sds-menu-in{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.animate-sds-menu{animation:none}}\n"], dependencies: [{ kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11138
|
+
}
|
|
11139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsLanguageSwitcher, decorators: [{
|
|
11140
|
+
type: Component,
|
|
11141
|
+
args: [{ selector: 'sds-language-switcher', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdsIcon], host: {
|
|
11142
|
+
class: 'relative inline-block',
|
|
11143
|
+
'(document:click)': 'onDocumentClick($event)',
|
|
11144
|
+
'(document:keydown.escape)': 'onEscape()',
|
|
11145
|
+
}, template: `
|
|
11146
|
+
<button
|
|
11147
|
+
#trigger
|
|
11148
|
+
type="button"
|
|
11149
|
+
role="combobox"
|
|
11150
|
+
class="flex h-10 items-center gap-1.5 rounded-control px-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2"
|
|
11151
|
+
[class]="triggerClass()"
|
|
11152
|
+
[attr.aria-label]="menuLabel()"
|
|
11153
|
+
aria-haspopup="listbox"
|
|
11154
|
+
[attr.aria-expanded]="open()"
|
|
11155
|
+
[attr.aria-controls]="open() ? panelId : null"
|
|
11156
|
+
[attr.aria-activedescendant]="open() ? activeOptionId() : null"
|
|
11157
|
+
(click)="toggle()"
|
|
11158
|
+
(keydown)="onTriggerKeydown($event)"
|
|
11159
|
+
>
|
|
11160
|
+
<sds-icon name="languages" [size]="16" class="shrink-0" />
|
|
11161
|
+
<span>{{ currentCode() }}</span>
|
|
11162
|
+
<sds-icon
|
|
11163
|
+
name="chevron-down"
|
|
11164
|
+
[size]="14"
|
|
11165
|
+
class="shrink-0 transition-transform"
|
|
11166
|
+
[class]="chevronClass()"
|
|
11167
|
+
[class.rotate-180]="open()"
|
|
11168
|
+
/>
|
|
11169
|
+
</button>
|
|
11170
|
+
|
|
11171
|
+
@if (open()) {
|
|
11172
|
+
<!-- Appended to document.body on open (see positionPanel) so no ancestor can clip it. -->
|
|
11173
|
+
<div
|
|
11174
|
+
data-sds-language-panel
|
|
11175
|
+
[id]="panelId"
|
|
11176
|
+
role="listbox"
|
|
11177
|
+
[attr.aria-label]="menuLabel()"
|
|
11178
|
+
class="fixed z-[1000] min-w-44 overflow-hidden rounded-card border border-border bg-surface shadow-xl animate-sds-menu"
|
|
11179
|
+
>
|
|
11180
|
+
@if (heading(); as h) {
|
|
11181
|
+
<p class="border-b border-border px-4 pb-2 pt-3 text-[0.68rem] font-semibold uppercase tracking-wider text-ink-faint">
|
|
11182
|
+
{{ h }}
|
|
11183
|
+
</p>
|
|
11184
|
+
}
|
|
11185
|
+
<div class="max-h-[60vh] overflow-auto py-1.5">
|
|
11186
|
+
@for (opt of options(); track opt.code; let i = $index) {
|
|
11187
|
+
<div
|
|
11188
|
+
[id]="optionId(i)"
|
|
11189
|
+
role="option"
|
|
11190
|
+
[attr.data-index]="i"
|
|
11191
|
+
[attr.aria-selected]="opt.code === effectiveCode()"
|
|
11192
|
+
[class]="rowClass(i, opt.code === effectiveCode())"
|
|
11193
|
+
(click)="choose(opt.code)"
|
|
11194
|
+
(mouseenter)="highlightedIndex.set(i)"
|
|
11195
|
+
>
|
|
11196
|
+
<span class="flex-1 truncate text-left">{{ opt.label }}</span>
|
|
11197
|
+
<span
|
|
11198
|
+
class="shrink-0 text-[0.7rem] font-semibold uppercase tracking-wide"
|
|
11199
|
+
[class]="opt.code === effectiveCode() ? 'text-brand-600' : 'text-ink-faint'"
|
|
11200
|
+
>{{ opt.code }}</span
|
|
11201
|
+
>
|
|
11202
|
+
@if (opt.code === effectiveCode()) {
|
|
11203
|
+
<sds-icon name="check" [size]="16" class="shrink-0 text-brand-600" />
|
|
11204
|
+
} @else {
|
|
11205
|
+
<span class="w-4 shrink-0" aria-hidden="true"></span>
|
|
11206
|
+
}
|
|
11207
|
+
</div>
|
|
11208
|
+
}
|
|
11209
|
+
</div>
|
|
11210
|
+
</div>
|
|
11211
|
+
}
|
|
11212
|
+
`, styles: [".animate-sds-menu{animation:sds-menu-in .14s ease-out}@keyframes sds-menu-in{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.animate-sds-menu{animation:none}}\n"] }]
|
|
11213
|
+
}], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], languages: [{ type: i0.Input, args: [{ isSignal: true, alias: "languages", required: false }] }], current: [{ type: i0.Input, args: [{ isSignal: true, alias: "current", required: false }] }, { type: i0.Output, args: ["currentChange"] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], menuLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuLabel", required: false }] }], heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], openChange: [{ type: i0.Output, args: ["openChange"] }] } });
|
|
11214
|
+
|
|
10808
11215
|
/*
|
|
10809
11216
|
* Public API Surface of saitech-design-system — the Saitech / App design system.
|
|
10810
11217
|
*/
|
|
@@ -10814,5 +11221,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
10814
11221
|
* Generated bundle index. Do not edit.
|
|
10815
11222
|
*/
|
|
10816
11223
|
|
|
10817
|
-
export { SDS_ICONS, SDS_PHONE_COUNTRIES, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAvatar, SdsBadge, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsDatePicker, SdsIcon, SdsInput, SdsInputNumber, SdsLocalizedInput, SdsMenuItem, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsSearchCommand, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsShell, SdsSidebar, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsThemeService, SdsThemeToggle, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SdsUserMenu, SidebarStore, addDays, addMonths, addMonthsKeepDay, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isoDay, pad2, sdsFormatNational, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth };
|
|
11224
|
+
export { SDS_ICONS, SDS_PHONE_COUNTRIES, SdsAccordion, SdsAccordionContent, SdsAccordionHeader, SdsAccordionPanel, SdsAccordionStore, SdsAvatar, SdsBadge, SdsButton, SdsCalendar, SdsCard, SdsCheckbox, SdsDatePicker, SdsIcon, SdsInput, SdsInputNumber, SdsLanguageSwitcher, SdsLocalizedInput, SdsMenuItem, SdsMultiSelect, SdsNavGroup, SdsNavItem, SdsOtpInput, SdsPaginator, SdsPhoneInput, SdsSearchCommand, SdsSelect, SdsSelectEmpty, SdsSelectFooter, SdsSelectOption, SdsShell, SdsSidebar, SdsTab, SdsTabList, SdsTabPanel, SdsTabPanels, SdsTable, SdsTableCell, SdsTableRowExpansion, SdsTabs, SdsTabsStore, SdsTextarea, SdsThemeService, SdsThemeToggle, SdsToastHost, SdsToastService, SdsToggleSwitch, SdsTopbar, SdsUserMenu, SidebarStore, addDays, addMonths, addMonthsKeepDay, formatDdMmYyyy, formatHhMm, isOutOfRange, isSameDay, isoDay, pad2, sdsFormatNational, sdsMatchDialCode, sdsNormalizeSignificant, startOfDay, startOfMonth };
|
|
10818
11225
|
//# sourceMappingURL=besaitech-ng-design-system.mjs.map
|