@sixbell-telco/sdk 4.3.0 → 4.5.0
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/CHANGELOG.md +35 -1
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/dropdown-chevron/dropdown-chevron.component.d.ts +1 -1
- package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +10 -13
- package/components/dropdown-menu/README.md +1 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-content/dropdown-menu-bar-content.component.d.ts +5 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-sub-trigger/dropdown-menu-bar-sub-trigger.component.d.ts +2 -0
- package/components/dropdown-menu/bar/dropdown-menu-bar-trigger/dropdown-menu-bar-trigger.component.d.ts +2 -0
- package/components/dropdown-menu/context/dropdown-context-menu-trigger/dropdown-context-menu-trigger.component.d.ts +1 -0
- package/components/dropdown-menu/src/dropdown-menu-content/dropdown-menu-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-content/dropdown-menu-sub-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.component.d.ts +1 -0
- package/components/dropdown-menu/src/dropdown-menu-trigger/dropdown-menu-trigger.component.d.ts +1 -0
- package/components/forms/combobox/README.md +1 -1
- package/components/forms/combobox/src/combobox.component.d.ts +10 -11
- package/components/forms/select/README.md +1 -1
- package/components/forms/select/src/select.component.d.ts +10 -11
- package/components/overlay/README.md +6 -1
- package/components/overlay/src/overlay.component.d.ts +9 -8
- package/components/tooltip/README.md +3 -2
- package/components/tooltip/src/tooltip.component.d.ts +8 -8
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +18 -9
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs +5 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +20 -9
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +26 -55
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +35 -49
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +35 -43
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +39 -77
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +33 -52
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +35 -13
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs +186 -0
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +129 -14
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/layouts/README.md +15 -1
- package/layouts/public-api.d.ts +2 -2
- package/layouts/src/layout-account.d.ts +16 -0
- package/layouts/src/menu/menu-active.d.ts +2 -1
- package/layouts/src/menu/menu-url.d.ts +2 -0
- package/layouts/src/page-banner/page-banner.component.d.ts +13 -1
- package/layouts/src/user-menu/user-menu.component.d.ts +4 -2
- package/package.json +41 -37
- package/src/_index.css +85 -0
- package/utils/popover-motion/README.md +38 -0
- package/utils/popover-motion/index.d.ts +5 -0
- package/utils/popover-motion/public-api.d.ts +2 -0
- package/utils/popover-motion/src/popover-menu-motion.d.ts +37 -0
- package/utils/popover-motion/src/popover-motion.d.ts +31 -0
- package/utils/translation/README.md +2 -0
- package/utils/translation/src/translation.service.d.ts +24 -0
|
@@ -14,6 +14,7 @@ import { BadgeComponent } from '@sixbell-telco/sdk/components/badge';
|
|
|
14
14
|
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
15
15
|
import { IconComponent } from '@sixbell-telco/sdk/components/icon';
|
|
16
16
|
import { matSearchOutline, matKeyboardArrowDownOutline, matCheckOutline, matCloseOutline } from '@sixbell-telco/sdk/components/icon/material/outline';
|
|
17
|
+
import { popoverPlacement, isPopoverMotionAnimation } from '@sixbell-telco/sdk/utils/popover-motion';
|
|
17
18
|
import { ThemeDomService } from '@sixbell-telco/sdk/utils/theme';
|
|
18
19
|
import { injectLabelTranslator } from '@sixbell-telco/sdk/utils/translation';
|
|
19
20
|
import { Subject, switchMap, startWith, debounceTime, distinctUntilChanged } from 'rxjs';
|
|
@@ -315,6 +316,8 @@ class ComboboxComponent {
|
|
|
315
316
|
searchSubject = new Subject();
|
|
316
317
|
/** Current animation state of the overlay */
|
|
317
318
|
animationState = signal('closed');
|
|
319
|
+
/** Set when the exit animation already ran the close cleanup, so the detach that follows does not repeat it */
|
|
320
|
+
exitSettled = false;
|
|
318
321
|
/** Trigger for blur events in form validation */
|
|
319
322
|
blurTrigger = signal(0);
|
|
320
323
|
/** Active option index for keyboard navigation */
|
|
@@ -344,53 +347,21 @@ class ComboboxComponent {
|
|
|
344
347
|
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
345
348
|
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
346
349
|
];
|
|
347
|
-
/**
|
|
348
|
-
|
|
349
|
-
* Maps animation directions to complete Tailwind class names
|
|
350
|
-
* All class names are static and detectable by Tailwind at build time
|
|
351
|
-
*/
|
|
352
|
-
animationClassMap = {
|
|
353
|
-
bottom: 'data-[state=opening]:animate-fade-in-up data-[state=open]:animate-fade-in-up data-[state=closing]:animate-fade-out-down',
|
|
354
|
-
top: 'data-[state=opening]:animate-fade-in-down data-[state=open]:animate-fade-in-down data-[state=closing]:animate-fade-out-up',
|
|
355
|
-
left: 'data-[state=opening]:animate-fade-in-left data-[state=open]:animate-fade-in-left data-[state=closing]:animate-fade-out-right',
|
|
356
|
-
right: 'data-[state=opening]:animate-fade-in-right data-[state=open]:animate-fade-in-right data-[state=closing]:animate-fade-out-left',
|
|
357
|
-
};
|
|
358
|
-
/**
|
|
359
|
-
* Computed animation direction based on current overlay position
|
|
360
|
-
* Dynamically detects position and returns appropriate direction: 'top', 'bottom', 'left', or 'right'
|
|
361
|
-
*/
|
|
362
|
-
animationDirection = computed(() => {
|
|
350
|
+
/** Real placement of the open panel, bound to `data-side` / `data-align`; null until the CDK places it */
|
|
351
|
+
placement = computed(() => {
|
|
363
352
|
const position = this.currentPosition();
|
|
364
|
-
|
|
365
|
-
return 'bottom'; // default
|
|
366
|
-
// Determine direction based on overlay Y and X positions
|
|
367
|
-
const overlayY = position.overlayY;
|
|
368
|
-
const overlayX = position.overlayX;
|
|
369
|
-
// Priority: check Y first, then X
|
|
370
|
-
if (overlayY === 'top') {
|
|
371
|
-
return 'top'; // Dropdown appears above
|
|
372
|
-
}
|
|
373
|
-
else if (overlayY === 'bottom') {
|
|
374
|
-
return 'bottom'; // Dropdown appears below
|
|
375
|
-
}
|
|
376
|
-
else if (overlayX === 'end') {
|
|
377
|
-
return 'left'; // Dropdown appears to the left
|
|
378
|
-
}
|
|
379
|
-
else if (overlayX === 'start') {
|
|
380
|
-
return 'right'; // Dropdown appears to the right
|
|
381
|
-
}
|
|
382
|
-
return 'bottom'; // default
|
|
353
|
+
return position ? popoverPlacement(position) : null;
|
|
383
354
|
});
|
|
384
355
|
/**
|
|
385
|
-
*
|
|
386
|
-
*
|
|
356
|
+
* Side of the field the panel opened on (`'bottom'` until the CDK places it)
|
|
357
|
+
* @deprecated Read `data-side` on the panel instead; kept for compatibility
|
|
387
358
|
*/
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
359
|
+
animationDirection = computed(() => this.placement()?.side ?? 'bottom');
|
|
360
|
+
/**
|
|
361
|
+
* Class of the panel: the shared `popover-motion` utility driven by `data-state` and `data-side`
|
|
362
|
+
* @deprecated Kept for compatibility; the motion lives in the `popover-motion` utility
|
|
363
|
+
*/
|
|
364
|
+
animationClasses = computed(() => 'popover-motion');
|
|
394
365
|
// ==============================================================================
|
|
395
366
|
// FORM CONTROL INTEGRATION
|
|
396
367
|
// ==============================================================================
|
|
@@ -764,6 +735,8 @@ class ComboboxComponent {
|
|
|
764
735
|
this.animationState.set('opening');
|
|
765
736
|
// Focus search input after opening
|
|
766
737
|
setTimeout(() => {
|
|
738
|
+
if (this.animationState() !== 'opening' && this.animationState() !== 'open')
|
|
739
|
+
return;
|
|
767
740
|
this.searchInputRef()?.nativeElement?.focus();
|
|
768
741
|
// Set first option as active by default
|
|
769
742
|
this.setDefaultActiveOption();
|
|
@@ -801,11 +774,15 @@ class ComboboxComponent {
|
|
|
801
774
|
* @param event - The animation event
|
|
802
775
|
*/
|
|
803
776
|
onAnimationEnd(event) {
|
|
804
|
-
if (
|
|
777
|
+
if (event.target !== event.currentTarget)
|
|
778
|
+
return;
|
|
779
|
+
if (this.animationState() === 'opening' && isPopoverMotionAnimation(event, 'opening')) {
|
|
805
780
|
this.animationState.set('open');
|
|
806
781
|
}
|
|
807
|
-
else if (this.animationState() === 'closing' && event
|
|
782
|
+
else if (this.animationState() === 'closing' && isPopoverMotionAnimation(event, 'closing')) {
|
|
783
|
+
this.exitSettled = true;
|
|
808
784
|
this.animationState.set('closed');
|
|
785
|
+
this.currentPosition.set(null);
|
|
809
786
|
this.clearSearch();
|
|
810
787
|
this.triggerBlur();
|
|
811
788
|
// Return focus to trigger button for better keyboard navigation
|
|
@@ -819,7 +796,12 @@ class ComboboxComponent {
|
|
|
819
796
|
* Cleans up state and triggers blur
|
|
820
797
|
*/
|
|
821
798
|
handleDetach() {
|
|
799
|
+
if (this.exitSettled) {
|
|
800
|
+
this.exitSettled = false;
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
822
803
|
this.animationState.set('closed');
|
|
804
|
+
this.currentPosition.set(null);
|
|
823
805
|
this.clearSearch();
|
|
824
806
|
this.triggerBlur();
|
|
825
807
|
}
|
|
@@ -835,13 +817,17 @@ class ComboboxComponent {
|
|
|
835
817
|
* @param event - The mouse event
|
|
836
818
|
*/
|
|
837
819
|
handleClickOutside(event) {
|
|
838
|
-
|
|
820
|
+
const state = this.animationState();
|
|
821
|
+
if (state === 'opening' || state === 'open') {
|
|
839
822
|
this.animationState.set('closing');
|
|
840
823
|
}
|
|
841
824
|
if (this.stopPropagation()) {
|
|
842
825
|
event.stopPropagation();
|
|
843
826
|
}
|
|
844
|
-
|
|
827
|
+
// A panel that is shown blurs when its exit animation ends
|
|
828
|
+
if (state === 'closed') {
|
|
829
|
+
this.triggerBlur();
|
|
830
|
+
}
|
|
845
831
|
}
|
|
846
832
|
/**
|
|
847
833
|
* Handles search input changes
|
|
@@ -1291,7 +1277,7 @@ class ComboboxComponent {
|
|
|
1291
1277
|
useExisting: ComboboxComponent,
|
|
1292
1278
|
multi: true,
|
|
1293
1279
|
},
|
|
1294
|
-
], viewQueries: [{ propertyName: "fieldRef", first: true, predicate: ["field"], descendants: true, isSignal: true }, { propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "searchInputRef", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "optionsList", first: true, predicate: ["optionsList"], descendants: true, isSignal: true }, { propertyName: "listbox", first: true, predicate: ["listbox"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- Field chrome click is pointer-only sugar; keyboard access is the focusable trigger button inside. -->\n@let isOpen = this.isOpen(); @let triggerWidth = this.triggerWidth(); @let dataState = this.dataState();\n@let filteredOptions = this.filteredOptions(); @let displayValue = this.displayValue(); @let multipleDisplayInfo = this.multipleDisplayInfo();\n@let label = this.label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (label) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span\n\t\t\t\t>{{ label }}\n\t\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div\n\t\t#field\n\t\tcdkOverlayOrigin\n\t\t#overlayOrigin=\"cdkOverlayOrigin\"\n\t\t[class]=\"validationClass()\"\n\t\t[attr.data-open]=\"isOpen ? '' : null\"\n\t\t(click)=\"handleFieldChromeClick($event)\"\n\t>\n\t\t<button\n\t\t\t#trigger\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[attr.aria-required]=\"fieldA11y.required() || null\"\n\t\t\t[attr.aria-describedby]=\"fieldA11y.describedBy()\"\n\t\t\tclass=\"min-w-0 flex-1 grow cursor-pointer bg-transparent p-0 text-left outline-hidden\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(keydown)=\"handleTriggerKeydown($event)\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"true\"\n\t\t\trole=\"combobox\"\n\t\t\t[attr.aria-controls]=\"'combobox-list'\"\n\t\t\t[attr.aria-expanded]=\"isOpen\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t>\n\t\t\t<span class=\"block min-w-0 truncate text-left\">\n\t\t\t\t@if (selectionType() === 'multiple' && multipleDisplayInfo) {\n\t\t\t\t\t<span class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<span class=\"truncate\">{{ multipleDisplayInfo.firstItem }}</span>\n\t\t\t\t\t\t@if (multipleDisplayInfo.additionalCount > 0) {\n\t\t\t\t\t\t\t<st-badge variant=\"primary\" [soft]=\"true\" [size]=\"badgeClass()\">+{{ multipleDisplayInfo.additionalCount }}</st-badge>\n\t\t\t\t\t\t}\n\t\t\t\t\t</span>\n\t\t\t\t} @else {\n\t\t\t\t\t{{ displayValue }}\n\t\t\t\t}\n\t\t\t</span>\n\t\t</button>\n\t\t@if (showClearButton()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-clear\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t(click)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.enter)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.space)=\"handleClearSelection($event)\"\n\t\t\t\t[attr.aria-label]=\"clearSelectionLabel()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"iconClose\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t\t<span data-st-chevron class=\"pointer-events-none inline-flex size-[1em] shrink-0 items-center justify-center\" aria-hidden=\"true\">\n\t\t\t<st-icon [icon]=\"iconChevronDown\"></st-icon>\n\t\t</span>\n\t</div>\n\n\t<ng-template\n\t\tcdkConnectedOverlay\n\t\t[cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n\t\t[cdkConnectedOverlayOpen]=\"isOpen\"\n\t\t[cdkConnectedOverlayPositions]=\"overlayPositions\"\n\t\t[cdkConnectedOverlayWidth]=\"triggerWidth\"\n\t\t[cdkConnectedOverlayMinWidth]=\"triggerWidth\"\n\t\t(detach)=\"handleDetach()\"\n\t\t(overlayOutsideClick)=\"handleClickOutside($event)\"\n\t\t(positionChange)=\"onPositionChange($event)\"\n\t>\n\t\t<div class=\"contents\" [attr.data-theme]=\"themeDomService.themeOf(field)\">\n\t\t\t<div [class]=\"'rounded-box shadow-main w-full ' + animationClasses()\" (animationend)=\"onAnimationEnd($event)\" [attr.data-state]=\"dataState\">\n\t\t\t\t<div class=\"bg-base-200 rounded-box border-neutral overflow-hidden border border-solid\">\n\t\t\t\t\t<!-- Search Input -->\n\t\t\t\t\t<div class=\"border-neutral border-b\">\n\t\t\t\t\t\t@let searchInputClass = this.searchInputClass();\n\t\t\t\t\t\t<div [class]=\"searchInputClass\">\n\t\t\t\t\t\t\t<st-icon class=\"text-base-placeholder\" [icon]=\"iconSearch\"></st-icon>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t#searchInput\n\t\t\t\t\t\t\t\tclass=\"placeholder:text-base-placeholder w-full border-transparent py-0 focus-within:outline-hidden focus:border-transparent focus:outline-hidden\"\n\t\t\t\t\t\t\t\t[value]=\"currentSearchValue\"\n\t\t\t\t\t\t\t\t(input)=\"handleSearchInput($event)\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleSearchKeydown($event)\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t[placeholder]=\"translatedSearchPlaceholder()\"\n\t\t\t\t\t\t\t\t[attr.aria-label]=\"searchOptionsLabel()\"\n\t\t\t\t\t\t\t\t[disabled]=\"!isOpen\"\n\t\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Options List -->\n\t\t\t\t\t@let menuClass = this.menuClass();\n\t\t\t\t\t<ul\n\t\t\t\t\t\t[class]=\"menuClass\"\n\t\t\t\t\t\tcdkListbox\n\t\t\t\t\t\tcdkListboxUseActiveDescendant\n\t\t\t\t\t\t[cdkListboxMultiple]=\"selectionType() === 'multiple'\"\n\t\t\t\t\t\taria-labelledby=\"Combobox options\"\n\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t#optionsList\n\t\t\t\t\t\t[tabindex]=\"-1\"\n\t\t\t\t\t\t(keydown)=\"handleListboxKeydown($event)\"\n\t\t\t\t\t\t(selectionChange)=\"handleSelectionChange($event)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@for (option of filteredOptions; track $index) {\n\t\t\t\t\t\t\t<li [cdkOption]=\"option\" class=\"group\" [attr.data-option-index]=\"$index\" [class.cdk-option-active]=\"isActiveOption($index)\">\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tclass=\"group-[.cdk-option-active]:bg-base-300 font-body flex w-full items-center justify-between rounded-none px-4 py-2 text-left leading-normal font-normal text-pretty transition-colors duration-150 ease-in-out\"\n\t\t\t\t\t\t\t\t\t(click)=\"handleOptionSelect(option)\"\n\t\t\t\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span class=\"min-w-0 flex-1 wrap-break-word whitespace-normal\">{{ getDisplayValue(option) }}</span>\n\n\t\t\t\t\t\t\t\t\t@if (isOptionSelected(option)) {\n\t\t\t\t\t\t\t\t\t\t<st-icon class=\"h-4 w-4 shrink-0\" [icon]=\"iconCheck\"></st-icon>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t<!-- Empty state -->\n\t\t\t\t\t\t@if (filteredOptions.length === 0) {\n\t\t\t\t\t\t\t<li class=\"text-base-content/60 px-4 py-2 text-center\">\n\t\t\t\t\t\t\t\t<span>{{ translatedNoResultsText() }}</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t</ul>\n\n\t\t\t\t\t<!-- Clear All button for multiple selection -->\n\t\t\t\t\t@if (selectionType() === 'multiple' && allowClearAll() && value() && isArray(value()) && value().length > 0) {\n\t\t\t\t\t\t<div class=\"border-base-300 border-t p-2\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t[ghost]=\"true\"\n\t\t\t\t\t\t\t\t[block]=\"true\"\n\t\t\t\t\t\t\t\t(clicked)=\"clearSelection()\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleClearButtonKeydown($event)\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{{ clearAllLabel() }}\n\t\t\t\t\t\t\t</st-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</ng-template>\n\n\t@if (label) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ label }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content></ng-content>\n</fieldset>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: PortalModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkListbox, selector: "[cdkListbox]", inputs: ["id", "tabindex", "cdkListboxValue", "cdkListboxMultiple", "cdkListboxDisabled", "cdkListboxUseActiveDescendant", "cdkListboxOrientation", "cdkListboxCompareWith", "cdkListboxNavigationWrapDisabled", "cdkListboxNavigatesDisabledOptions"], outputs: ["cdkListboxValueChange"], exportAs: ["cdkListbox"] }, { kind: "directive", type: CdkOption, selector: "[cdkOption]", inputs: ["id", "cdkOption", "cdkOptionTypeaheadLabel", "cdkOptionDisabled", "tabindex"], exportAs: ["cdkOption"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }, { kind: "component", type: BadgeComponent, selector: "st-badge", inputs: ["variant", "size", "outline", "soft", "dash", "ghost", "icon", "iconPosition"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDescribedBy", "ariaControls"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1280
|
+
], viewQueries: [{ propertyName: "fieldRef", first: true, predicate: ["field"], descendants: true, isSignal: true }, { propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "searchInputRef", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "optionsList", first: true, predicate: ["optionsList"], descendants: true, isSignal: true }, { propertyName: "listbox", first: true, predicate: ["listbox"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- Field chrome click is pointer-only sugar; keyboard access is the focusable trigger button inside. -->\n@let isOpen = this.isOpen(); @let triggerWidth = this.triggerWidth(); @let dataState = this.dataState();\n@let filteredOptions = this.filteredOptions(); @let displayValue = this.displayValue(); @let multipleDisplayInfo = this.multipleDisplayInfo();\n@let label = this.label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (label) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span\n\t\t\t\t>{{ label }}\n\t\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div\n\t\t#field\n\t\tcdkOverlayOrigin\n\t\t#overlayOrigin=\"cdkOverlayOrigin\"\n\t\t[class]=\"validationClass()\"\n\t\t[attr.data-open]=\"isOpen ? '' : null\"\n\t\t(click)=\"handleFieldChromeClick($event)\"\n\t>\n\t\t<button\n\t\t\t#trigger\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[attr.aria-required]=\"fieldA11y.required() || null\"\n\t\t\t[attr.aria-describedby]=\"fieldA11y.describedBy()\"\n\t\t\tclass=\"min-w-0 flex-1 grow cursor-pointer bg-transparent p-0 text-left outline-hidden\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(keydown)=\"handleTriggerKeydown($event)\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"true\"\n\t\t\trole=\"combobox\"\n\t\t\t[attr.aria-controls]=\"'combobox-list'\"\n\t\t\t[attr.aria-expanded]=\"isOpen\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t>\n\t\t\t<span class=\"block min-w-0 truncate text-left\">\n\t\t\t\t@if (selectionType() === 'multiple' && multipleDisplayInfo) {\n\t\t\t\t\t<span class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<span class=\"truncate\">{{ multipleDisplayInfo.firstItem }}</span>\n\t\t\t\t\t\t@if (multipleDisplayInfo.additionalCount > 0) {\n\t\t\t\t\t\t\t<st-badge variant=\"primary\" [soft]=\"true\" [size]=\"badgeClass()\">+{{ multipleDisplayInfo.additionalCount }}</st-badge>\n\t\t\t\t\t\t}\n\t\t\t\t\t</span>\n\t\t\t\t} @else {\n\t\t\t\t\t{{ displayValue }}\n\t\t\t\t}\n\t\t\t</span>\n\t\t</button>\n\t\t@if (showClearButton()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-clear\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t(click)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.enter)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.space)=\"handleClearSelection($event)\"\n\t\t\t\t[attr.aria-label]=\"clearSelectionLabel()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"iconClose\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t\t<span data-st-chevron class=\"pointer-events-none inline-flex size-[1em] shrink-0 items-center justify-center\" aria-hidden=\"true\">\n\t\t\t<st-icon [icon]=\"iconChevronDown\"></st-icon>\n\t\t</span>\n\t</div>\n\n\t<ng-template\n\t\tcdkConnectedOverlay\n\t\t[cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n\t\t[cdkConnectedOverlayOpen]=\"isOpen\"\n\t\t[cdkConnectedOverlayPositions]=\"overlayPositions\"\n\t\t[cdkConnectedOverlayDisableClose]=\"true\"\n\t\t[cdkConnectedOverlayWidth]=\"triggerWidth\"\n\t\t[cdkConnectedOverlayMinWidth]=\"triggerWidth\"\n\t\t(detach)=\"handleDetach()\"\n\t\t(overlayOutsideClick)=\"handleClickOutside($event)\"\n\t\t(positionChange)=\"onPositionChange($event)\"\n\t>\n\t\t<div class=\"contents\" [attr.data-theme]=\"themeDomService.themeOf(field)\">\n\t\t\t<div\n\t\t\t\t[class]=\"'rounded-box shadow-main w-full ' + animationClasses()\"\n\t\t\t\t(animationend)=\"onAnimationEnd($event)\"\n\t\t\t\t[attr.data-state]=\"dataState\"\n\t\t\t\t[attr.data-side]=\"placement()?.side\"\n\t\t\t\t[attr.data-align]=\"placement()?.align\"\n\t\t\t>\n\t\t\t\t<div class=\"bg-base-200 rounded-box border-neutral overflow-hidden border border-solid\">\n\t\t\t\t\t<!-- Search Input -->\n\t\t\t\t\t<div class=\"border-neutral border-b\">\n\t\t\t\t\t\t@let searchInputClass = this.searchInputClass();\n\t\t\t\t\t\t<div [class]=\"searchInputClass\">\n\t\t\t\t\t\t\t<st-icon class=\"text-base-placeholder\" [icon]=\"iconSearch\"></st-icon>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t#searchInput\n\t\t\t\t\t\t\t\tclass=\"placeholder:text-base-placeholder w-full border-transparent py-0 focus-within:outline-hidden focus:border-transparent focus:outline-hidden\"\n\t\t\t\t\t\t\t\t[value]=\"currentSearchValue\"\n\t\t\t\t\t\t\t\t(input)=\"handleSearchInput($event)\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleSearchKeydown($event)\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t[placeholder]=\"translatedSearchPlaceholder()\"\n\t\t\t\t\t\t\t\t[attr.aria-label]=\"searchOptionsLabel()\"\n\t\t\t\t\t\t\t\t[disabled]=\"!isOpen\"\n\t\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Options List -->\n\t\t\t\t\t@let menuClass = this.menuClass();\n\t\t\t\t\t<ul\n\t\t\t\t\t\t[class]=\"menuClass\"\n\t\t\t\t\t\tcdkListbox\n\t\t\t\t\t\tcdkListboxUseActiveDescendant\n\t\t\t\t\t\t[cdkListboxMultiple]=\"selectionType() === 'multiple'\"\n\t\t\t\t\t\taria-labelledby=\"Combobox options\"\n\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t#optionsList\n\t\t\t\t\t\t[tabindex]=\"-1\"\n\t\t\t\t\t\t(keydown)=\"handleListboxKeydown($event)\"\n\t\t\t\t\t\t(selectionChange)=\"handleSelectionChange($event)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@for (option of filteredOptions; track $index) {\n\t\t\t\t\t\t\t<li [cdkOption]=\"option\" class=\"group\" [attr.data-option-index]=\"$index\" [class.cdk-option-active]=\"isActiveOption($index)\">\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tclass=\"group-[.cdk-option-active]:bg-base-300 font-body flex w-full items-center justify-between rounded-none px-4 py-2 text-left leading-normal font-normal text-pretty transition-colors duration-150 ease-in-out\"\n\t\t\t\t\t\t\t\t\t(click)=\"handleOptionSelect(option)\"\n\t\t\t\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span class=\"min-w-0 flex-1 wrap-break-word whitespace-normal\">{{ getDisplayValue(option) }}</span>\n\n\t\t\t\t\t\t\t\t\t@if (isOptionSelected(option)) {\n\t\t\t\t\t\t\t\t\t\t<st-icon class=\"h-4 w-4 shrink-0\" [icon]=\"iconCheck\"></st-icon>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t<!-- Empty state -->\n\t\t\t\t\t\t@if (filteredOptions.length === 0) {\n\t\t\t\t\t\t\t<li class=\"text-base-content/60 px-4 py-2 text-center\">\n\t\t\t\t\t\t\t\t<span>{{ translatedNoResultsText() }}</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t</ul>\n\n\t\t\t\t\t<!-- Clear All button for multiple selection -->\n\t\t\t\t\t@if (selectionType() === 'multiple' && allowClearAll() && value() && isArray(value()) && value().length > 0) {\n\t\t\t\t\t\t<div class=\"border-base-300 border-t p-2\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t[ghost]=\"true\"\n\t\t\t\t\t\t\t\t[block]=\"true\"\n\t\t\t\t\t\t\t\t(clicked)=\"clearSelection()\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleClearButtonKeydown($event)\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{{ clearAllLabel() }}\n\t\t\t\t\t\t\t</st-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</ng-template>\n\n\t@if (label) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ label }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content></ng-content>\n</fieldset>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: PortalModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkListbox, selector: "[cdkListbox]", inputs: ["id", "tabindex", "cdkListboxValue", "cdkListboxMultiple", "cdkListboxDisabled", "cdkListboxUseActiveDescendant", "cdkListboxOrientation", "cdkListboxCompareWith", "cdkListboxNavigationWrapDisabled", "cdkListboxNavigatesDisabledOptions"], outputs: ["cdkListboxValueChange"], exportAs: ["cdkListbox"] }, { kind: "directive", type: CdkOption, selector: "[cdkOption]", inputs: ["id", "cdkOption", "cdkOptionTypeaheadLabel", "cdkOptionDisabled", "tabindex"], exportAs: ["cdkOption"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }, { kind: "component", type: BadgeComponent, selector: "st-badge", inputs: ["variant", "size", "outline", "soft", "dash", "ghost", "icon", "iconPosition"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDescribedBy", "ariaControls"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1295
1281
|
}
|
|
1296
1282
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ComboboxComponent, decorators: [{
|
|
1297
1283
|
type: Component,
|
|
@@ -1312,7 +1298,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
1312
1298
|
useExisting: ComboboxComponent,
|
|
1313
1299
|
multi: true,
|
|
1314
1300
|
},
|
|
1315
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- Field chrome click is pointer-only sugar; keyboard access is the focusable trigger button inside. -->\n@let isOpen = this.isOpen(); @let triggerWidth = this.triggerWidth(); @let dataState = this.dataState();\n@let filteredOptions = this.filteredOptions(); @let displayValue = this.displayValue(); @let multipleDisplayInfo = this.multipleDisplayInfo();\n@let label = this.label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (label) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span\n\t\t\t\t>{{ label }}\n\t\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div\n\t\t#field\n\t\tcdkOverlayOrigin\n\t\t#overlayOrigin=\"cdkOverlayOrigin\"\n\t\t[class]=\"validationClass()\"\n\t\t[attr.data-open]=\"isOpen ? '' : null\"\n\t\t(click)=\"handleFieldChromeClick($event)\"\n\t>\n\t\t<button\n\t\t\t#trigger\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[attr.aria-required]=\"fieldA11y.required() || null\"\n\t\t\t[attr.aria-describedby]=\"fieldA11y.describedBy()\"\n\t\t\tclass=\"min-w-0 flex-1 grow cursor-pointer bg-transparent p-0 text-left outline-hidden\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(keydown)=\"handleTriggerKeydown($event)\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"true\"\n\t\t\trole=\"combobox\"\n\t\t\t[attr.aria-controls]=\"'combobox-list'\"\n\t\t\t[attr.aria-expanded]=\"isOpen\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t>\n\t\t\t<span class=\"block min-w-0 truncate text-left\">\n\t\t\t\t@if (selectionType() === 'multiple' && multipleDisplayInfo) {\n\t\t\t\t\t<span class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<span class=\"truncate\">{{ multipleDisplayInfo.firstItem }}</span>\n\t\t\t\t\t\t@if (multipleDisplayInfo.additionalCount > 0) {\n\t\t\t\t\t\t\t<st-badge variant=\"primary\" [soft]=\"true\" [size]=\"badgeClass()\">+{{ multipleDisplayInfo.additionalCount }}</st-badge>\n\t\t\t\t\t\t}\n\t\t\t\t\t</span>\n\t\t\t\t} @else {\n\t\t\t\t\t{{ displayValue }}\n\t\t\t\t}\n\t\t\t</span>\n\t\t</button>\n\t\t@if (showClearButton()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-clear\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t(click)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.enter)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.space)=\"handleClearSelection($event)\"\n\t\t\t\t[attr.aria-label]=\"clearSelectionLabel()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"iconClose\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t\t<span data-st-chevron class=\"pointer-events-none inline-flex size-[1em] shrink-0 items-center justify-center\" aria-hidden=\"true\">\n\t\t\t<st-icon [icon]=\"iconChevronDown\"></st-icon>\n\t\t</span>\n\t</div>\n\n\t<ng-template\n\t\tcdkConnectedOverlay\n\t\t[cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n\t\t[cdkConnectedOverlayOpen]=\"isOpen\"\n\t\t[cdkConnectedOverlayPositions]=\"overlayPositions\"\n\t\t[cdkConnectedOverlayWidth]=\"triggerWidth\"\n\t\t[cdkConnectedOverlayMinWidth]=\"triggerWidth\"\n\t\t(detach)=\"handleDetach()\"\n\t\t(overlayOutsideClick)=\"handleClickOutside($event)\"\n\t\t(positionChange)=\"onPositionChange($event)\"\n\t>\n\t\t<div class=\"contents\" [attr.data-theme]=\"themeDomService.themeOf(field)\">\n\t\t\t<div
|
|
1301
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- Field chrome click is pointer-only sugar; keyboard access is the focusable trigger button inside. -->\n@let isOpen = this.isOpen(); @let triggerWidth = this.triggerWidth(); @let dataState = this.dataState();\n@let filteredOptions = this.filteredOptions(); @let displayValue = this.displayValue(); @let multipleDisplayInfo = this.multipleDisplayInfo();\n@let label = this.label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (label) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span\n\t\t\t\t>{{ label }}\n\t\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div\n\t\t#field\n\t\tcdkOverlayOrigin\n\t\t#overlayOrigin=\"cdkOverlayOrigin\"\n\t\t[class]=\"validationClass()\"\n\t\t[attr.data-open]=\"isOpen ? '' : null\"\n\t\t(click)=\"handleFieldChromeClick($event)\"\n\t>\n\t\t<button\n\t\t\t#trigger\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[attr.aria-required]=\"fieldA11y.required() || null\"\n\t\t\t[attr.aria-describedby]=\"fieldA11y.describedBy()\"\n\t\t\tclass=\"min-w-0 flex-1 grow cursor-pointer bg-transparent p-0 text-left outline-hidden\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(keydown)=\"handleTriggerKeydown($event)\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"true\"\n\t\t\trole=\"combobox\"\n\t\t\t[attr.aria-controls]=\"'combobox-list'\"\n\t\t\t[attr.aria-expanded]=\"isOpen\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t>\n\t\t\t<span class=\"block min-w-0 truncate text-left\">\n\t\t\t\t@if (selectionType() === 'multiple' && multipleDisplayInfo) {\n\t\t\t\t\t<span class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<span class=\"truncate\">{{ multipleDisplayInfo.firstItem }}</span>\n\t\t\t\t\t\t@if (multipleDisplayInfo.additionalCount > 0) {\n\t\t\t\t\t\t\t<st-badge variant=\"primary\" [soft]=\"true\" [size]=\"badgeClass()\">+{{ multipleDisplayInfo.additionalCount }}</st-badge>\n\t\t\t\t\t\t}\n\t\t\t\t\t</span>\n\t\t\t\t} @else {\n\t\t\t\t\t{{ displayValue }}\n\t\t\t\t}\n\t\t\t</span>\n\t\t</button>\n\t\t@if (showClearButton()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-clear\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t(click)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.enter)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.space)=\"handleClearSelection($event)\"\n\t\t\t\t[attr.aria-label]=\"clearSelectionLabel()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"iconClose\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t\t<span data-st-chevron class=\"pointer-events-none inline-flex size-[1em] shrink-0 items-center justify-center\" aria-hidden=\"true\">\n\t\t\t<st-icon [icon]=\"iconChevronDown\"></st-icon>\n\t\t</span>\n\t</div>\n\n\t<ng-template\n\t\tcdkConnectedOverlay\n\t\t[cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n\t\t[cdkConnectedOverlayOpen]=\"isOpen\"\n\t\t[cdkConnectedOverlayPositions]=\"overlayPositions\"\n\t\t[cdkConnectedOverlayDisableClose]=\"true\"\n\t\t[cdkConnectedOverlayWidth]=\"triggerWidth\"\n\t\t[cdkConnectedOverlayMinWidth]=\"triggerWidth\"\n\t\t(detach)=\"handleDetach()\"\n\t\t(overlayOutsideClick)=\"handleClickOutside($event)\"\n\t\t(positionChange)=\"onPositionChange($event)\"\n\t>\n\t\t<div class=\"contents\" [attr.data-theme]=\"themeDomService.themeOf(field)\">\n\t\t\t<div\n\t\t\t\t[class]=\"'rounded-box shadow-main w-full ' + animationClasses()\"\n\t\t\t\t(animationend)=\"onAnimationEnd($event)\"\n\t\t\t\t[attr.data-state]=\"dataState\"\n\t\t\t\t[attr.data-side]=\"placement()?.side\"\n\t\t\t\t[attr.data-align]=\"placement()?.align\"\n\t\t\t>\n\t\t\t\t<div class=\"bg-base-200 rounded-box border-neutral overflow-hidden border border-solid\">\n\t\t\t\t\t<!-- Search Input -->\n\t\t\t\t\t<div class=\"border-neutral border-b\">\n\t\t\t\t\t\t@let searchInputClass = this.searchInputClass();\n\t\t\t\t\t\t<div [class]=\"searchInputClass\">\n\t\t\t\t\t\t\t<st-icon class=\"text-base-placeholder\" [icon]=\"iconSearch\"></st-icon>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t#searchInput\n\t\t\t\t\t\t\t\tclass=\"placeholder:text-base-placeholder w-full border-transparent py-0 focus-within:outline-hidden focus:border-transparent focus:outline-hidden\"\n\t\t\t\t\t\t\t\t[value]=\"currentSearchValue\"\n\t\t\t\t\t\t\t\t(input)=\"handleSearchInput($event)\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleSearchKeydown($event)\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t[placeholder]=\"translatedSearchPlaceholder()\"\n\t\t\t\t\t\t\t\t[attr.aria-label]=\"searchOptionsLabel()\"\n\t\t\t\t\t\t\t\t[disabled]=\"!isOpen\"\n\t\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Options List -->\n\t\t\t\t\t@let menuClass = this.menuClass();\n\t\t\t\t\t<ul\n\t\t\t\t\t\t[class]=\"menuClass\"\n\t\t\t\t\t\tcdkListbox\n\t\t\t\t\t\tcdkListboxUseActiveDescendant\n\t\t\t\t\t\t[cdkListboxMultiple]=\"selectionType() === 'multiple'\"\n\t\t\t\t\t\taria-labelledby=\"Combobox options\"\n\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t#optionsList\n\t\t\t\t\t\t[tabindex]=\"-1\"\n\t\t\t\t\t\t(keydown)=\"handleListboxKeydown($event)\"\n\t\t\t\t\t\t(selectionChange)=\"handleSelectionChange($event)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@for (option of filteredOptions; track $index) {\n\t\t\t\t\t\t\t<li [cdkOption]=\"option\" class=\"group\" [attr.data-option-index]=\"$index\" [class.cdk-option-active]=\"isActiveOption($index)\">\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tclass=\"group-[.cdk-option-active]:bg-base-300 font-body flex w-full items-center justify-between rounded-none px-4 py-2 text-left leading-normal font-normal text-pretty transition-colors duration-150 ease-in-out\"\n\t\t\t\t\t\t\t\t\t(click)=\"handleOptionSelect(option)\"\n\t\t\t\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span class=\"min-w-0 flex-1 wrap-break-word whitespace-normal\">{{ getDisplayValue(option) }}</span>\n\n\t\t\t\t\t\t\t\t\t@if (isOptionSelected(option)) {\n\t\t\t\t\t\t\t\t\t\t<st-icon class=\"h-4 w-4 shrink-0\" [icon]=\"iconCheck\"></st-icon>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t<!-- Empty state -->\n\t\t\t\t\t\t@if (filteredOptions.length === 0) {\n\t\t\t\t\t\t\t<li class=\"text-base-content/60 px-4 py-2 text-center\">\n\t\t\t\t\t\t\t\t<span>{{ translatedNoResultsText() }}</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t</ul>\n\n\t\t\t\t\t<!-- Clear All button for multiple selection -->\n\t\t\t\t\t@if (selectionType() === 'multiple' && allowClearAll() && value() && isArray(value()) && value().length > 0) {\n\t\t\t\t\t\t<div class=\"border-base-300 border-t p-2\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t[ghost]=\"true\"\n\t\t\t\t\t\t\t\t[block]=\"true\"\n\t\t\t\t\t\t\t\t(clicked)=\"clearSelection()\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleClearButtonKeydown($event)\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{{ clearAllLabel() }}\n\t\t\t\t\t\t\t</st-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</ng-template>\n\n\t@if (label) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ label }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content></ng-content>\n</fieldset>\n" }]
|
|
1316
1302
|
}], ctorParameters: () => [] });
|
|
1317
1303
|
|
|
1318
1304
|
/**
|