yukit-web 0.8.0 → 0.8.2
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/yukit-web.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import * as i1 from '@spartan-ng/brain/tooltip';
|
|
|
15
15
|
import { BrnTooltip, provideBrnTooltipDefaultOptions } from '@spartan-ng/brain/tooltip';
|
|
16
16
|
import { tooltipPositionVariants, DEFAULT_TOOLTIP_CONTENT_CLASSES, DEFAULT_TOOLTIP_SVG_CLASS } from 'yukit-web/helm/tooltip';
|
|
17
17
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
18
|
-
import { lucideX, lucideChevronRight, lucideChevronLeft, lucideUpload, lucideSearch, lucideEyeOff, lucideEye, lucideChevronsUpDown, lucideChevronUp, lucideChevronDown, lucidePencil, lucideCheck, lucideMinus, lucideCopy, lucideTrash2, lucideSave, lucideArrowLeft, lucideArchiveRestore, lucidePlus, lucideShare, lucidePrinter, lucideFileText, lucideFileSpreadsheet, lucideFileDown, lucideClipboardCopy, lucideSettings2, lucideList, lucideLayoutGrid, lucideDownload,
|
|
18
|
+
import { lucideX, lucideChevronRight, lucideChevronLeft, lucideUpload, lucideSearch, lucideEyeOff, lucideEye, lucideChevronsUpDown, lucideChevronUp, lucideChevronDown, lucidePencil, lucideCheck, lucideMinus, lucideEllipsis, lucideCopy, lucideTrash2, lucideSave, lucideArrowLeft, lucideArchiveRestore, lucidePlus, lucideShare, lucidePrinter, lucideFileText, lucideFileSpreadsheet, lucideFileDown, lucideClipboardCopy, lucideSettings2, lucideList, lucideLayoutGrid, lucideDownload, lucideStar } from '@ng-icons/lucide';
|
|
19
19
|
import * as i1$1 from 'yukit-web/helm/badge';
|
|
20
20
|
import { HlmBadge } from 'yukit-web/helm/badge';
|
|
21
21
|
import * as i1$2 from 'yukit-web/helm/breadcrumb';
|
|
@@ -1293,7 +1293,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1293
1293
|
|
|
1294
1294
|
/**
|
|
1295
1295
|
* Turns `<yuw-combobox>` into a button that opens its option list directly, with the search field
|
|
1296
|
-
* inside the list. The template is the button's content; the button itself is a `<yuw-button>`
|
|
1296
|
+
* inside the list when `searchPlaceholder` is set. The template is the button's content; the button itself is a `<yuw-button>`
|
|
1297
1297
|
* styled by the combobox `trigger*` inputs.
|
|
1298
1298
|
*
|
|
1299
1299
|
* Usage:
|
|
@@ -1356,7 +1356,9 @@ let nextUniqueId$2 = 0;
|
|
|
1356
1356
|
* - `multiple`: Enables multi-selection mode with removable tags/chips.
|
|
1357
1357
|
* - `disabled`: Disables combobox interaction.
|
|
1358
1358
|
* - `placeholder`: Placeholder text when no option is selected.
|
|
1359
|
-
* - `searchPlaceholder`: Placeholder
|
|
1359
|
+
* - `searchPlaceholder`: Placeholder of the search field inside the popover of a button-shaped control
|
|
1360
|
+
* (`readonlyTrigger` or a `yuwComboboxTrigger` template); the field renders only when set. Without it the
|
|
1361
|
+
* arrow keys only open the list, so leave it out only for short lists.
|
|
1360
1362
|
* - `emptyText`: Message text displayed when search yields no matching options.
|
|
1361
1363
|
* - `search`: Two-way search filter query string.
|
|
1362
1364
|
* - `triggerAriaLabel`: Required accessible name for the icon-only popover trigger (the chevron
|
|
@@ -1386,7 +1388,8 @@ let nextUniqueId$2 = 0;
|
|
|
1386
1388
|
* `message` of its first error under the control.
|
|
1387
1389
|
*
|
|
1388
1390
|
* Content marked `yuwComboboxFooter` is projected at the bottom of the option list, for actions
|
|
1389
|
-
* that belong with it (a "clear all", say);
|
|
1391
|
+
* that belong with it (a "clear all", say); content marked `yuwComboboxHeader` is projected at the top
|
|
1392
|
+
* of the panel, for a title. The consumer renders and styles both.
|
|
1390
1393
|
*
|
|
1391
1394
|
* `multiple` takes precedence over `readonlyTrigger`: when both are set the multi-select
|
|
1392
1395
|
* chips shape renders and `readonlyTrigger` is ignored.
|
|
@@ -1446,7 +1449,7 @@ class YuwComboboxComponent extends YuwValueAccessorBase {
|
|
|
1446
1449
|
}
|
|
1447
1450
|
return Array.isArray(value) ? value : [value];
|
|
1448
1451
|
}, ...(ngDevMode ? [{ debugName: "_multipleValue" }] : /* istanbul ignore next */ []));
|
|
1449
|
-
this._searchInPanel = computed(() => this.readonlyTrigger() || !!this.triggerTemplate(), ...(ngDevMode ? [{ debugName: "_searchInPanel" }] : /* istanbul ignore next */ []));
|
|
1452
|
+
this._searchInPanel = computed(() => this.searchPlaceholder() !== undefined && (this.readonlyTrigger() || !!this.triggerTemplate()), ...(ngDevMode ? [{ debugName: "_searchInPanel" }] : /* istanbul ignore next */ []));
|
|
1450
1453
|
this._selectedChips = computed(() => {
|
|
1451
1454
|
const labels = this._labelByValue();
|
|
1452
1455
|
return this._multipleValue().map((value) => ({ value, label: labels.get(value) ?? value }));
|
|
@@ -1517,7 +1520,7 @@ class YuwComboboxComponent extends YuwValueAccessorBase {
|
|
|
1517
1520
|
};
|
|
1518
1521
|
}
|
|
1519
1522
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1520
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwComboboxComponent, isStandalone: true, selector: "yuw-combobox", inputs: { clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, keepValueOnEscape: { classPropertyName: "keepValueOnEscape", publicName: "keepValueOnEscape", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonlyTrigger: { classPropertyName: "readonlyTrigger", publicName: "readonlyTrigger", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, triggerAriaLabel: { classPropertyName: "triggerAriaLabel", publicName: "triggerAriaLabel", isSignal: true, isRequired: true, transformFunction: null }, triggerClass: { classPropertyName: "triggerClass", publicName: "triggerClass", isSignal: true, isRequired: false, transformFunction: null }, triggerColor: { classPropertyName: "triggerColor", publicName: "triggerColor", isSignal: true, isRequired: false, transformFunction: null }, triggerSize: { classPropertyName: "triggerSize", publicName: "triggerSize", isSignal: true, isRequired: false, transformFunction: null }, triggerVariant: { classPropertyName: "triggerVariant", publicName: "triggerVariant", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { search: "searchChange", value: "valueChange" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwComboboxComponent)], queries: [{ propertyName: "itemTemplate", first: true, predicate: YuwComboboxItemDirective, descendants: true, isSignal: true }, { propertyName: "triggerTemplate", first: true, predicate: YuwComboboxTriggerDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_multipleBox", first: true, predicate: BrnComboboxMultiple, descendants: true, isSignal: true }, { propertyName: "_panel", first: true, predicate: HlmComboboxContent, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_singleBox", first: true, predicate: BrnCombobox, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #footer>\n <ng-content select=\"[yuwComboboxFooter]\" />\n</ng-template>\n\n<ng-template #itemContent let-option>\n @if (itemTemplate(); as custom) {\n <ng-container\n [ngTemplateOutlet]=\"custom.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n selected: _selectedValues().has(option.value),\n }\"\n />\n } @else {\n {{ option.label }}\n }\n</ng-template>\n\n<hlm-field\n yuwFieldFeedback\n #feedback=\"yuwFieldFeedback\"\n class=\"w-auto min-w-0 data-[matches-spartan-invalid=true]:text-inherit\"\n [invalid]=\"invalid()\"\n>\n @if (multiple()) {\n <hlm-combobox-multiple\n [disabled]=\"_disabled()\"\n [value]=\"_multipleValue()\"\n (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\"\n [itemToString]=\"_itemToString\"\n (focusout)=\"_onFocusOut($event)\"\n >\n @if (triggerTemplate(); as trigger) {\n <yuw-button\n yuwComboboxTriggerButton\n [color]=\"triggerColor()\"\n [variant]=\"triggerVariant()\"\n [size]=\"triggerSize()\"\n [class]=\"triggerClass()\"\n [ariaLabel]=\"triggerAriaLabel()\"\n [disabled]=\"_disabled()\"\n >\n <ng-container [ngTemplateOutlet]=\"trigger.templateRef\" [ngTemplateOutletContext]=\"_triggerContext()\" />\n </yuw-button>\n } @else {\n <hlm-combobox-chips [forceInvalid]=\"feedback.forcedInvalid()\" [class]=\"_chipsClass()\">\n @for (chip of _selectedChips(); track chip.value) {\n <hlm-combobox-chip [value]=\"chip.value\">{{ chip.label }}</hlm-combobox-chip>\n }\n <input hlmComboboxChipInput [id]=\"_controlId()\" [placeholder]=\"placeholder() ?? ''\" />\n </hlm-combobox-chips>\n }\n\n <hlm-combobox-content *hlmComboboxPortal [class]=\"_contentClass()\">\n @if (_searchInPanel()) {\n <hlm-combobox-input\n [placeholder]=\"searchPlaceholder() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [showTrigger]=\"false\"\n />\n }\n <div hlmComboboxList>\n @for (option of options(); track option.value) {\n <hlm-combobox-item [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">\n <ng-container [ngTemplateOutlet]=\"itemContent\" [ngTemplateOutletContext]=\"{ $implicit: option }\" />\n </hlm-combobox-item>\n }\n </div>\n <hlm-combobox-empty>{{ emptyText() ?? '' }}</hlm-combobox-empty>\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </hlm-combobox-content>\n </hlm-combobox-multiple>\n } @else {\n <hlm-combobox\n [disabled]=\"_disabled()\"\n [value]=\"_singleValue()\"\n (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\"\n [itemToString]=\"_itemToString\"\n (focusout)=\"_onFocusOut($event)\"\n >\n @if (triggerTemplate(); as trigger) {\n <yuw-button\n yuwComboboxTriggerButton\n [color]=\"triggerColor()\"\n [variant]=\"triggerVariant()\"\n [size]=\"triggerSize()\"\n [class]=\"triggerClass()\"\n [ariaLabel]=\"triggerAriaLabel()\"\n [disabled]=\"_disabled()\"\n >\n <ng-container [ngTemplateOutlet]=\"trigger.templateRef\" [ngTemplateOutletContext]=\"_triggerContext()\" />\n </yuw-button>\n } @else if (readonlyTrigger()) {\n <hlm-combobox-trigger\n [buttonId]=\"_controlId()\"\n [forceInvalid]=\"feedback.forcedInvalid()\"\n [class]=\"_triggerClass()\"\n class=\"w-full justify-between items-center\"\n >\n <hlm-combobox-value class=\"min-w-0 truncate\" [placeholder]=\"placeholder() ?? ''\" />\n </hlm-combobox-trigger>\n } @else {\n <hlm-combobox-input\n [inputId]=\"_controlId()\"\n [placeholder]=\"placeholder() ?? ''\"\n [showClear]=\"_clearVisible()\"\n [clearAriaLabel]=\"clearAriaLabel() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [forceInvalid]=\"feedback.forcedInvalid()\"\n [class]=\"_fieldClass()\"\n />\n }\n\n <hlm-combobox-content *hlmComboboxPortal [class]=\"_contentClass()\">\n @if (_searchInPanel()) {\n <hlm-combobox-input\n [placeholder]=\"searchPlaceholder() ?? ''\"\n [showClear]=\"_clearVisible()\"\n [clearAriaLabel]=\"clearAriaLabel() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [showTrigger]=\"false\"\n />\n }\n <div hlmComboboxList>\n @for (option of options(); track option.value) {\n <hlm-combobox-item [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">\n <ng-container [ngTemplateOutlet]=\"itemContent\" [ngTemplateOutletContext]=\"{ $implicit: option }\" />\n </hlm-combobox-item>\n }\n </div>\n <hlm-combobox-empty>{{ emptyText() ?? '' }}</hlm-combobox-empty>\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </hlm-combobox-content>\n </hlm-combobox>\n }\n\n @if (feedback.showError()) {\n <hlm-field-description role=\"alert\" class=\"text-destructive\">{{ feedback.errorMessage() }}</hlm-field-description>\n } @else if (helperText(); as helper) {\n <hlm-field-description>{{ helper }}</hlm-field-description>\n }\n</hlm-field>\n", dependencies: [{ kind: "directive", type: i1$4.HlmCombobox, selector: "[hlmCombobox],hlm-combobox" }, { kind: "component", type: i1$4.HlmComboboxChip, selector: "hlm-combobox-chip", inputs: ["showRemove"] }, { kind: "directive", type: i1$4.HlmComboboxChipInput, selector: "input[hlmComboboxChipInput]" }, { kind: "directive", type: i1$4.HlmComboboxChips, selector: "[hlmComboboxChips],hlm-combobox-chips", inputs: ["forceInvalid"] }, { kind: "directive", type: i1$4.HlmComboboxContent, selector: "[hlmComboboxContent],hlm-combobox-content" }, { kind: "directive", type: i1$4.HlmComboboxEmpty, selector: "[hlmComboboxEmpty],hlm-combobox-empty" }, { kind: "component", type: i1$4.HlmComboboxInput, selector: "hlm-combobox-input", inputs: ["inputId", "placeholder", "showTrigger", "showClear", "forceInvalid", "triggerAriaLabel", "clearAriaLabel", "aria-invalid"] }, { kind: "component", type: i1$4.HlmComboboxItem, selector: "hlm-combobox-item" }, { kind: "directive", type: i1$4.HlmComboboxList, selector: "[hlmComboboxList]" }, { kind: "directive", type: i1$4.HlmComboboxMultiple, selector: "[hlmComboboxMultiple],hlm-combobox-multiple" }, { kind: "directive", type: i1$4.HlmComboboxPortal, selector: "[hlmComboboxPortal]" }, { kind: "component", type: i1$4.HlmComboboxTrigger, selector: "hlm-combobox-trigger", inputs: ["class", "buttonId", "variant", "forceInvalid"] }, { kind: "directive", type: i1$4.HlmComboboxValue, selector: "[hlmComboboxValue],hlm-combobox-value" }, { kind: "directive", type: HlmField, selector: "[hlmField],hlm-field", inputs: ["orientation"] }, { kind: "directive", type: HlmFieldDescription, selector: "[hlmFieldDescription],hlm-field-description", inputs: ["id"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }, { kind: "directive", type: YuwComboboxTriggerButtonDirective, selector: "yuw-button[yuwComboboxTriggerButton]" }, { kind: "directive", type: YuwFieldFeedbackDirective, selector: "hlm-field[yuwFieldFeedback]", inputs: ["errorText", "invalid"], exportAs: ["yuwFieldFeedback"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1523
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwComboboxComponent, isStandalone: true, selector: "yuw-combobox", inputs: { clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, keepValueOnEscape: { classPropertyName: "keepValueOnEscape", publicName: "keepValueOnEscape", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonlyTrigger: { classPropertyName: "readonlyTrigger", publicName: "readonlyTrigger", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, triggerAriaLabel: { classPropertyName: "triggerAriaLabel", publicName: "triggerAriaLabel", isSignal: true, isRequired: true, transformFunction: null }, triggerClass: { classPropertyName: "triggerClass", publicName: "triggerClass", isSignal: true, isRequired: false, transformFunction: null }, triggerColor: { classPropertyName: "triggerColor", publicName: "triggerColor", isSignal: true, isRequired: false, transformFunction: null }, triggerSize: { classPropertyName: "triggerSize", publicName: "triggerSize", isSignal: true, isRequired: false, transformFunction: null }, triggerVariant: { classPropertyName: "triggerVariant", publicName: "triggerVariant", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { search: "searchChange", value: "valueChange" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwComboboxComponent)], queries: [{ propertyName: "itemTemplate", first: true, predicate: YuwComboboxItemDirective, descendants: true, isSignal: true }, { propertyName: "triggerTemplate", first: true, predicate: YuwComboboxTriggerDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_multipleBox", first: true, predicate: BrnComboboxMultiple, descendants: true, isSignal: true }, { propertyName: "_panel", first: true, predicate: HlmComboboxContent, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_singleBox", first: true, predicate: BrnCombobox, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #header>\n <ng-content select=\"[yuwComboboxHeader]\" />\n</ng-template>\n\n<ng-template #footer>\n <ng-content select=\"[yuwComboboxFooter]\" />\n</ng-template>\n\n<ng-template #itemContent let-option>\n @if (itemTemplate(); as custom) {\n <ng-container\n [ngTemplateOutlet]=\"custom.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n selected: _selectedValues().has(option.value),\n }\"\n />\n } @else {\n {{ option.label }}\n }\n</ng-template>\n\n<hlm-field\n yuwFieldFeedback\n #feedback=\"yuwFieldFeedback\"\n class=\"w-auto min-w-0 data-[matches-spartan-invalid=true]:text-inherit\"\n [invalid]=\"invalid()\"\n>\n @if (multiple()) {\n <hlm-combobox-multiple\n [disabled]=\"_disabled()\"\n [value]=\"_multipleValue()\"\n (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\"\n [itemToString]=\"_itemToString\"\n (focusout)=\"_onFocusOut($event)\"\n >\n @if (triggerTemplate(); as trigger) {\n <yuw-button\n yuwComboboxTriggerButton\n [color]=\"triggerColor()\"\n [variant]=\"triggerVariant()\"\n [size]=\"triggerSize()\"\n [class]=\"triggerClass()\"\n [ariaLabel]=\"triggerAriaLabel()\"\n [disabled]=\"_disabled()\"\n >\n <ng-container [ngTemplateOutlet]=\"trigger.templateRef\" [ngTemplateOutletContext]=\"_triggerContext()\" />\n </yuw-button>\n } @else {\n <hlm-combobox-chips [forceInvalid]=\"feedback.forcedInvalid()\" [class]=\"_chipsClass()\">\n @for (chip of _selectedChips(); track chip.value) {\n <hlm-combobox-chip [value]=\"chip.value\">{{ chip.label }}</hlm-combobox-chip>\n }\n <input hlmComboboxChipInput [id]=\"_controlId()\" [placeholder]=\"placeholder() ?? ''\" />\n </hlm-combobox-chips>\n }\n\n <hlm-combobox-content *hlmComboboxPortal [class]=\"_contentClass()\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n @if (_searchInPanel()) {\n <hlm-combobox-input\n [placeholder]=\"searchPlaceholder() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [showTrigger]=\"false\"\n />\n }\n <div hlmComboboxList>\n @for (option of options(); track option.value) {\n <hlm-combobox-item [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">\n <ng-container [ngTemplateOutlet]=\"itemContent\" [ngTemplateOutletContext]=\"{ $implicit: option }\" />\n </hlm-combobox-item>\n }\n </div>\n <hlm-combobox-empty>{{ emptyText() ?? '' }}</hlm-combobox-empty>\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </hlm-combobox-content>\n </hlm-combobox-multiple>\n } @else {\n <hlm-combobox\n [disabled]=\"_disabled()\"\n [value]=\"_singleValue()\"\n (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\"\n [itemToString]=\"_itemToString\"\n (focusout)=\"_onFocusOut($event)\"\n >\n @if (triggerTemplate(); as trigger) {\n <yuw-button\n yuwComboboxTriggerButton\n [color]=\"triggerColor()\"\n [variant]=\"triggerVariant()\"\n [size]=\"triggerSize()\"\n [class]=\"triggerClass()\"\n [ariaLabel]=\"triggerAriaLabel()\"\n [disabled]=\"_disabled()\"\n >\n <ng-container [ngTemplateOutlet]=\"trigger.templateRef\" [ngTemplateOutletContext]=\"_triggerContext()\" />\n </yuw-button>\n } @else if (readonlyTrigger()) {\n <hlm-combobox-trigger\n [buttonId]=\"_controlId()\"\n [forceInvalid]=\"feedback.forcedInvalid()\"\n [class]=\"_triggerClass()\"\n class=\"w-full justify-between items-center\"\n >\n <hlm-combobox-value class=\"min-w-0 truncate\" [placeholder]=\"placeholder() ?? ''\" />\n </hlm-combobox-trigger>\n } @else {\n <hlm-combobox-input\n [inputId]=\"_controlId()\"\n [placeholder]=\"placeholder() ?? ''\"\n [showClear]=\"_clearVisible()\"\n [clearAriaLabel]=\"clearAriaLabel() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [forceInvalid]=\"feedback.forcedInvalid()\"\n [class]=\"_fieldClass()\"\n />\n }\n\n <hlm-combobox-content *hlmComboboxPortal [class]=\"_contentClass()\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n @if (_searchInPanel()) {\n <hlm-combobox-input\n [placeholder]=\"searchPlaceholder() ?? ''\"\n [showClear]=\"_clearVisible()\"\n [clearAriaLabel]=\"clearAriaLabel() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [showTrigger]=\"false\"\n />\n }\n <div hlmComboboxList>\n @for (option of options(); track option.value) {\n <hlm-combobox-item [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">\n <ng-container [ngTemplateOutlet]=\"itemContent\" [ngTemplateOutletContext]=\"{ $implicit: option }\" />\n </hlm-combobox-item>\n }\n </div>\n <hlm-combobox-empty>{{ emptyText() ?? '' }}</hlm-combobox-empty>\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </hlm-combobox-content>\n </hlm-combobox>\n }\n\n @if (feedback.showError()) {\n <hlm-field-description role=\"alert\" class=\"text-destructive\">{{ feedback.errorMessage() }}</hlm-field-description>\n } @else if (helperText(); as helper) {\n <hlm-field-description>{{ helper }}</hlm-field-description>\n }\n</hlm-field>\n", dependencies: [{ kind: "directive", type: i1$4.HlmCombobox, selector: "[hlmCombobox],hlm-combobox" }, { kind: "component", type: i1$4.HlmComboboxChip, selector: "hlm-combobox-chip", inputs: ["showRemove"] }, { kind: "directive", type: i1$4.HlmComboboxChipInput, selector: "input[hlmComboboxChipInput]" }, { kind: "directive", type: i1$4.HlmComboboxChips, selector: "[hlmComboboxChips],hlm-combobox-chips", inputs: ["forceInvalid"] }, { kind: "directive", type: i1$4.HlmComboboxContent, selector: "[hlmComboboxContent],hlm-combobox-content" }, { kind: "directive", type: i1$4.HlmComboboxEmpty, selector: "[hlmComboboxEmpty],hlm-combobox-empty" }, { kind: "component", type: i1$4.HlmComboboxInput, selector: "hlm-combobox-input", inputs: ["inputId", "placeholder", "showTrigger", "showClear", "forceInvalid", "triggerAriaLabel", "clearAriaLabel", "aria-invalid"] }, { kind: "component", type: i1$4.HlmComboboxItem, selector: "hlm-combobox-item" }, { kind: "directive", type: i1$4.HlmComboboxList, selector: "[hlmComboboxList]" }, { kind: "directive", type: i1$4.HlmComboboxMultiple, selector: "[hlmComboboxMultiple],hlm-combobox-multiple" }, { kind: "directive", type: i1$4.HlmComboboxPortal, selector: "[hlmComboboxPortal]" }, { kind: "component", type: i1$4.HlmComboboxTrigger, selector: "hlm-combobox-trigger", inputs: ["class", "buttonId", "variant", "forceInvalid"] }, { kind: "directive", type: i1$4.HlmComboboxValue, selector: "[hlmComboboxValue],hlm-combobox-value" }, { kind: "directive", type: HlmField, selector: "[hlmField],hlm-field", inputs: ["orientation"] }, { kind: "directive", type: HlmFieldDescription, selector: "[hlmFieldDescription],hlm-field-description", inputs: ["id"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }, { kind: "directive", type: YuwComboboxTriggerButtonDirective, selector: "yuw-button[yuwComboboxTriggerButton]" }, { kind: "directive", type: YuwFieldFeedbackDirective, selector: "hlm-field[yuwFieldFeedback]", inputs: ["errorText", "invalid"], exportAs: ["yuwFieldFeedback"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1521
1524
|
}
|
|
1522
1525
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwComboboxComponent, decorators: [{
|
|
1523
1526
|
type: Component,
|
|
@@ -1531,7 +1534,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1531
1534
|
YuwFieldFeedbackDirective,
|
|
1532
1535
|
], providers: [provideValueAccessor(YuwComboboxComponent)], host: {
|
|
1533
1536
|
class: 'contents',
|
|
1534
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #footer>\n <ng-content select=\"[yuwComboboxFooter]\" />\n</ng-template>\n\n<ng-template #itemContent let-option>\n @if (itemTemplate(); as custom) {\n <ng-container\n [ngTemplateOutlet]=\"custom.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n selected: _selectedValues().has(option.value),\n }\"\n />\n } @else {\n {{ option.label }}\n }\n</ng-template>\n\n<hlm-field\n yuwFieldFeedback\n #feedback=\"yuwFieldFeedback\"\n class=\"w-auto min-w-0 data-[matches-spartan-invalid=true]:text-inherit\"\n [invalid]=\"invalid()\"\n>\n @if (multiple()) {\n <hlm-combobox-multiple\n [disabled]=\"_disabled()\"\n [value]=\"_multipleValue()\"\n (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\"\n [itemToString]=\"_itemToString\"\n (focusout)=\"_onFocusOut($event)\"\n >\n @if (triggerTemplate(); as trigger) {\n <yuw-button\n yuwComboboxTriggerButton\n [color]=\"triggerColor()\"\n [variant]=\"triggerVariant()\"\n [size]=\"triggerSize()\"\n [class]=\"triggerClass()\"\n [ariaLabel]=\"triggerAriaLabel()\"\n [disabled]=\"_disabled()\"\n >\n <ng-container [ngTemplateOutlet]=\"trigger.templateRef\" [ngTemplateOutletContext]=\"_triggerContext()\" />\n </yuw-button>\n } @else {\n <hlm-combobox-chips [forceInvalid]=\"feedback.forcedInvalid()\" [class]=\"_chipsClass()\">\n @for (chip of _selectedChips(); track chip.value) {\n <hlm-combobox-chip [value]=\"chip.value\">{{ chip.label }}</hlm-combobox-chip>\n }\n <input hlmComboboxChipInput [id]=\"_controlId()\" [placeholder]=\"placeholder() ?? ''\" />\n </hlm-combobox-chips>\n }\n\n <hlm-combobox-content *hlmComboboxPortal [class]=\"_contentClass()\">\n @if (_searchInPanel()) {\n <hlm-combobox-input\n [placeholder]=\"searchPlaceholder() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [showTrigger]=\"false\"\n />\n }\n <div hlmComboboxList>\n @for (option of options(); track option.value) {\n <hlm-combobox-item [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">\n <ng-container [ngTemplateOutlet]=\"itemContent\" [ngTemplateOutletContext]=\"{ $implicit: option }\" />\n </hlm-combobox-item>\n }\n </div>\n <hlm-combobox-empty>{{ emptyText() ?? '' }}</hlm-combobox-empty>\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </hlm-combobox-content>\n </hlm-combobox-multiple>\n } @else {\n <hlm-combobox\n [disabled]=\"_disabled()\"\n [value]=\"_singleValue()\"\n (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\"\n [itemToString]=\"_itemToString\"\n (focusout)=\"_onFocusOut($event)\"\n >\n @if (triggerTemplate(); as trigger) {\n <yuw-button\n yuwComboboxTriggerButton\n [color]=\"triggerColor()\"\n [variant]=\"triggerVariant()\"\n [size]=\"triggerSize()\"\n [class]=\"triggerClass()\"\n [ariaLabel]=\"triggerAriaLabel()\"\n [disabled]=\"_disabled()\"\n >\n <ng-container [ngTemplateOutlet]=\"trigger.templateRef\" [ngTemplateOutletContext]=\"_triggerContext()\" />\n </yuw-button>\n } @else if (readonlyTrigger()) {\n <hlm-combobox-trigger\n [buttonId]=\"_controlId()\"\n [forceInvalid]=\"feedback.forcedInvalid()\"\n [class]=\"_triggerClass()\"\n class=\"w-full justify-between items-center\"\n >\n <hlm-combobox-value class=\"min-w-0 truncate\" [placeholder]=\"placeholder() ?? ''\" />\n </hlm-combobox-trigger>\n } @else {\n <hlm-combobox-input\n [inputId]=\"_controlId()\"\n [placeholder]=\"placeholder() ?? ''\"\n [showClear]=\"_clearVisible()\"\n [clearAriaLabel]=\"clearAriaLabel() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [forceInvalid]=\"feedback.forcedInvalid()\"\n [class]=\"_fieldClass()\"\n />\n }\n\n <hlm-combobox-content *hlmComboboxPortal [class]=\"_contentClass()\">\n @if (_searchInPanel()) {\n <hlm-combobox-input\n [placeholder]=\"searchPlaceholder() ?? ''\"\n [showClear]=\"_clearVisible()\"\n [clearAriaLabel]=\"clearAriaLabel() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [showTrigger]=\"false\"\n />\n }\n <div hlmComboboxList>\n @for (option of options(); track option.value) {\n <hlm-combobox-item [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">\n <ng-container [ngTemplateOutlet]=\"itemContent\" [ngTemplateOutletContext]=\"{ $implicit: option }\" />\n </hlm-combobox-item>\n }\n </div>\n <hlm-combobox-empty>{{ emptyText() ?? '' }}</hlm-combobox-empty>\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </hlm-combobox-content>\n </hlm-combobox>\n }\n\n @if (feedback.showError()) {\n <hlm-field-description role=\"alert\" class=\"text-destructive\">{{ feedback.errorMessage() }}</hlm-field-description>\n } @else if (helperText(); as helper) {\n <hlm-field-description>{{ helper }}</hlm-field-description>\n }\n</hlm-field>\n" }]
|
|
1537
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #header>\n <ng-content select=\"[yuwComboboxHeader]\" />\n</ng-template>\n\n<ng-template #footer>\n <ng-content select=\"[yuwComboboxFooter]\" />\n</ng-template>\n\n<ng-template #itemContent let-option>\n @if (itemTemplate(); as custom) {\n <ng-container\n [ngTemplateOutlet]=\"custom.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n selected: _selectedValues().has(option.value),\n }\"\n />\n } @else {\n {{ option.label }}\n }\n</ng-template>\n\n<hlm-field\n yuwFieldFeedback\n #feedback=\"yuwFieldFeedback\"\n class=\"w-auto min-w-0 data-[matches-spartan-invalid=true]:text-inherit\"\n [invalid]=\"invalid()\"\n>\n @if (multiple()) {\n <hlm-combobox-multiple\n [disabled]=\"_disabled()\"\n [value]=\"_multipleValue()\"\n (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\"\n [itemToString]=\"_itemToString\"\n (focusout)=\"_onFocusOut($event)\"\n >\n @if (triggerTemplate(); as trigger) {\n <yuw-button\n yuwComboboxTriggerButton\n [color]=\"triggerColor()\"\n [variant]=\"triggerVariant()\"\n [size]=\"triggerSize()\"\n [class]=\"triggerClass()\"\n [ariaLabel]=\"triggerAriaLabel()\"\n [disabled]=\"_disabled()\"\n >\n <ng-container [ngTemplateOutlet]=\"trigger.templateRef\" [ngTemplateOutletContext]=\"_triggerContext()\" />\n </yuw-button>\n } @else {\n <hlm-combobox-chips [forceInvalid]=\"feedback.forcedInvalid()\" [class]=\"_chipsClass()\">\n @for (chip of _selectedChips(); track chip.value) {\n <hlm-combobox-chip [value]=\"chip.value\">{{ chip.label }}</hlm-combobox-chip>\n }\n <input hlmComboboxChipInput [id]=\"_controlId()\" [placeholder]=\"placeholder() ?? ''\" />\n </hlm-combobox-chips>\n }\n\n <hlm-combobox-content *hlmComboboxPortal [class]=\"_contentClass()\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n @if (_searchInPanel()) {\n <hlm-combobox-input\n [placeholder]=\"searchPlaceholder() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [showTrigger]=\"false\"\n />\n }\n <div hlmComboboxList>\n @for (option of options(); track option.value) {\n <hlm-combobox-item [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">\n <ng-container [ngTemplateOutlet]=\"itemContent\" [ngTemplateOutletContext]=\"{ $implicit: option }\" />\n </hlm-combobox-item>\n }\n </div>\n <hlm-combobox-empty>{{ emptyText() ?? '' }}</hlm-combobox-empty>\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </hlm-combobox-content>\n </hlm-combobox-multiple>\n } @else {\n <hlm-combobox\n [disabled]=\"_disabled()\"\n [value]=\"_singleValue()\"\n (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\"\n [itemToString]=\"_itemToString\"\n (focusout)=\"_onFocusOut($event)\"\n >\n @if (triggerTemplate(); as trigger) {\n <yuw-button\n yuwComboboxTriggerButton\n [color]=\"triggerColor()\"\n [variant]=\"triggerVariant()\"\n [size]=\"triggerSize()\"\n [class]=\"triggerClass()\"\n [ariaLabel]=\"triggerAriaLabel()\"\n [disabled]=\"_disabled()\"\n >\n <ng-container [ngTemplateOutlet]=\"trigger.templateRef\" [ngTemplateOutletContext]=\"_triggerContext()\" />\n </yuw-button>\n } @else if (readonlyTrigger()) {\n <hlm-combobox-trigger\n [buttonId]=\"_controlId()\"\n [forceInvalid]=\"feedback.forcedInvalid()\"\n [class]=\"_triggerClass()\"\n class=\"w-full justify-between items-center\"\n >\n <hlm-combobox-value class=\"min-w-0 truncate\" [placeholder]=\"placeholder() ?? ''\" />\n </hlm-combobox-trigger>\n } @else {\n <hlm-combobox-input\n [inputId]=\"_controlId()\"\n [placeholder]=\"placeholder() ?? ''\"\n [showClear]=\"_clearVisible()\"\n [clearAriaLabel]=\"clearAriaLabel() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [forceInvalid]=\"feedback.forcedInvalid()\"\n [class]=\"_fieldClass()\"\n />\n }\n\n <hlm-combobox-content *hlmComboboxPortal [class]=\"_contentClass()\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n @if (_searchInPanel()) {\n <hlm-combobox-input\n [placeholder]=\"searchPlaceholder() ?? ''\"\n [showClear]=\"_clearVisible()\"\n [clearAriaLabel]=\"clearAriaLabel() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\"\n [showTrigger]=\"false\"\n />\n }\n <div hlmComboboxList>\n @for (option of options(); track option.value) {\n <hlm-combobox-item [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">\n <ng-container [ngTemplateOutlet]=\"itemContent\" [ngTemplateOutletContext]=\"{ $implicit: option }\" />\n </hlm-combobox-item>\n }\n </div>\n <hlm-combobox-empty>{{ emptyText() ?? '' }}</hlm-combobox-empty>\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </hlm-combobox-content>\n </hlm-combobox>\n }\n\n @if (feedback.showError()) {\n <hlm-field-description role=\"alert\" class=\"text-destructive\">{{ feedback.errorMessage() }}</hlm-field-description>\n } @else if (helperText(); as helper) {\n <hlm-field-description>{{ helper }}</hlm-field-description>\n }\n</hlm-field>\n" }]
|
|
1535
1538
|
}], ctorParameters: () => [], propDecorators: { _multipleBox: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnComboboxMultiple), { isSignal: true }] }], _panel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => HlmComboboxContent), { ...{ read: ElementRef }, isSignal: true }] }], _singleBox: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnCombobox), { isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwComboboxItemDirective), { isSignal: true }] }], triggerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwComboboxTriggerDirective), { isSignal: true }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], keepValueOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepValueOnEscape", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonlyTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonlyTrigger", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }, { type: i0.Output, args: ["searchChange"] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], triggerAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerAriaLabel", required: true }] }], triggerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerClass", required: false }] }], triggerColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerColor", required: false }] }], triggerSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerSize", required: false }] }], triggerVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerVariant", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1536
1539
|
|
|
1537
1540
|
/**
|
|
@@ -4556,7 +4559,8 @@ const DATATABLE_WRAP_CONTENT_CLASS = 'whitespace-normal max-w-0';
|
|
|
4556
4559
|
* - `sorting`: Two-way sorting state (`SortingState`).
|
|
4557
4560
|
* - `columnFilters`: Two-way column filters state (`ColumnFiltersState`).
|
|
4558
4561
|
* - `columnVisibility`: Two-way column visibility state (`ColumnVisibilityState`).
|
|
4559
|
-
* - `rowSelection`: Two-way row selection state (`RowSelectionState`).
|
|
4562
|
+
* - `rowSelection`: Two-way row selection state (`RowSelectionState`). It is cleared whenever `data` changes: TanStack
|
|
4563
|
+
* keys it by row index, so a kept selection would point at whatever rows the new data put there.
|
|
4560
4564
|
* - `pagination`: Two-way pagination state (`PaginationState`). Default is `{ pageIndex: 0, pageSize: 10 }`.
|
|
4561
4565
|
* - `totalItems`: Total row count across all pages, for server-side pagination where `data` holds
|
|
4562
4566
|
* only the current page. When set, pagination becomes manual — TanStack stops slicing `data`
|
|
@@ -4594,6 +4598,24 @@ const DATATABLE_WRAP_CONTENT_CLASS = 'whitespace-normal max-w-0';
|
|
|
4594
4598
|
* ```
|
|
4595
4599
|
*/
|
|
4596
4600
|
class YuwDatatableComponent {
|
|
4601
|
+
/**
|
|
4602
|
+
* Applies the real options once, after inputs are set.
|
|
4603
|
+
*
|
|
4604
|
+
* `injectTable` constructs the table from a `queueMicrotask` that can fire before Angular has
|
|
4605
|
+
* assigned any input, so it captures `columns: []`/`data: []`. Its own options effect then
|
|
4606
|
+
* *skips its first run* (an `isMount` guard inside the library) — and that skipped run is
|
|
4607
|
+
* exactly the one carrying the real values. Without this the table stays permanently empty no
|
|
4608
|
+
* matter what is bound.
|
|
4609
|
+
*
|
|
4610
|
+
* This runs in `ngOnInit` rather than a constructor `effect` because the effect fires in the
|
|
4611
|
+
* same too-early window and re-applies the same empty options; `ngOnInit` is the first point
|
|
4612
|
+
* where inputs are guaranteed present. Later changes are handled by the library's own effect,
|
|
4613
|
+
* which by then is past its mount guard.
|
|
4614
|
+
*/
|
|
4615
|
+
ngOnInit() {
|
|
4616
|
+
const options = this._options();
|
|
4617
|
+
this.table.setOptions((previous) => ({ ...previous, ...options }));
|
|
4618
|
+
}
|
|
4597
4619
|
constructor() {
|
|
4598
4620
|
this._table = viewChild.required('tableElement');
|
|
4599
4621
|
this.customPagination = contentChild(YuwDatatablePaginationDirective, ...(ngDevMode ? [{ debugName: "customPagination" }] : /* istanbul ignore next */ []));
|
|
@@ -4697,24 +4719,10 @@ class YuwDatatableComponent {
|
|
|
4697
4719
|
this._tableClass = computed(() => cn(DATATABLE_LAYOUT_CLASS, this.tableClass()), ...(ngDevMode ? [{ debugName: "_tableClass" }] : /* istanbul ignore next */ []));
|
|
4698
4720
|
this.currentPage = linkedSignal({ ...(ngDevMode ? { debugName: "currentPage" } : /* istanbul ignore next */ {}), source: () => this.pagination().pageIndex,
|
|
4699
4721
|
computation: (pageIndex) => pageIndex + 1 });
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
* `injectTable` constructs the table from a `queueMicrotask` that can fire before Angular has
|
|
4705
|
-
* assigned any input, so it captures `columns: []`/`data: []`. Its own options effect then
|
|
4706
|
-
* *skips its first run* (an `isMount` guard inside the library) — and that skipped run is
|
|
4707
|
-
* exactly the one carrying the real values. Without this the table stays permanently empty no
|
|
4708
|
-
* matter what is bound.
|
|
4709
|
-
*
|
|
4710
|
-
* This runs in `ngOnInit` rather than a constructor `effect` because the effect fires in the
|
|
4711
|
-
* same too-early window and re-applies the same empty options; `ngOnInit` is the first point
|
|
4712
|
-
* where inputs are guaranteed present. Later changes are handled by the library's own effect,
|
|
4713
|
-
* which by then is past its mount guard.
|
|
4714
|
-
*/
|
|
4715
|
-
ngOnInit() {
|
|
4716
|
-
const options = this._options();
|
|
4717
|
-
this.table.setOptions((previous) => ({ ...previous, ...options }));
|
|
4722
|
+
effect(() => {
|
|
4723
|
+
const data = this.data();
|
|
4724
|
+
untracked(() => this._clearSelectionOnNewData(data));
|
|
4725
|
+
});
|
|
4718
4726
|
}
|
|
4719
4727
|
/** The rendered text of the current page, with no rows while loading or empty. */
|
|
4720
4728
|
snapshot() {
|
|
@@ -4734,6 +4742,12 @@ class YuwDatatableComponent {
|
|
|
4734
4742
|
event.preventDefault();
|
|
4735
4743
|
this.rowClicked.emit(row);
|
|
4736
4744
|
}
|
|
4745
|
+
_clearSelectionOnNewData(data) {
|
|
4746
|
+
if (this._selectionData !== undefined && data !== this._selectionData && Object.keys(this.rowSelection()).length) {
|
|
4747
|
+
this.rowSelection.set({});
|
|
4748
|
+
}
|
|
4749
|
+
this._selectionData = data;
|
|
4750
|
+
}
|
|
4737
4751
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwDatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4738
4752
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwDatatableComponent, isStandalone: true, selector: "yuw-datatable", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, cellClass: { classPropertyName: "cellClass", publicName: "cellClass", isSignal: true, isRequired: false, transformFunction: null }, columnFilters: { classPropertyName: "columnFilters", publicName: "columnFilters", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, columnVisibility: { classPropertyName: "columnVisibility", publicName: "columnVisibility", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingRows: { classPropertyName: "loadingRows", publicName: "loadingRows", isSignal: true, isRequired: false, transformFunction: null }, nextPageLabel: { classPropertyName: "nextPageLabel", publicName: "nextPageLabel", isSignal: true, isRequired: true, transformFunction: null }, paginated: { classPropertyName: "paginated", publicName: "paginated", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, paginationAriaLabel: { classPropertyName: "paginationAriaLabel", publicName: "paginationAriaLabel", isSignal: true, isRequired: true, transformFunction: null }, paginationEllipsisSrText: { classPropertyName: "paginationEllipsisSrText", publicName: "paginationEllipsisSrText", isSignal: true, isRequired: true, transformFunction: null }, previousPageLabel: { classPropertyName: "previousPageLabel", publicName: "previousPageLabel", isSignal: true, isRequired: true, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, rowSelection: { classPropertyName: "rowSelection", publicName: "rowSelection", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, sorting: { classPropertyName: "sorting", publicName: "sorting", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnFilters: "columnFiltersChange", columnVisibility: "columnVisibilityChange", pagination: "paginationChange", rowSelection: "rowSelectionChange", sorting: "sortingChange", rowClicked: "rowClicked", selectedRowsChange: "selectedRowsChange" }, host: { classAttribute: "contents" }, providers: [provideIcons({ lucideChevronDown, lucideChevronUp, lucideChevronsUpDown })], queries: [{ propertyName: "customPagination", first: true, predicate: YuwDatatablePaginationDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_table", first: true, predicate: ["tableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div yuwTableContainer [class]=\"_containerClass()\">\n <table #tableElement yuwTable [class]=\"_tableClass()\">\n @if (caption()) {\n <caption yuwCaption>{{ caption() }}</caption>\n }\n\n <thead yuwTHead [class]=\"_headClass()\">\n @for (headerGroup of table.getHeaderGroups(); track headerGroup.id) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (header of headerGroup.headers; track header.id) {\n @let sorted = header.column.getIsSorted();\n @let headerClasses = _cellClasses().get(header.column.id);\n <th\n yuwTh\n scope=\"col\"\n [attr.colspan]=\"header.colSpan\"\n [attr.aria-sort]=\"sorted ? _ariaSort[sorted] : null\"\n [class]=\"headerClasses?.header\"\n >\n @if (!header.isPlaceholder) {\n @if (sortable() && header.column.getCanSort()) {\n <button\n type=\"button\"\n class=\"inline-flex items-center gap-1 select-none hover:text-foreground/80\"\n (click)=\"header.column.toggleSorting()\"\n >\n <ng-container\n *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\"\n >\n {{ rendered }}\n </ng-container>\n\n <ng-icon [name]=\"_sortIcon[sorted || 'none']\" class=\"shrink-0 text-xs\" aria-hidden=\"true\" />\n </button>\n } @else {\n <ng-container *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n }\n }\n </th>\n }\n </tr>\n }\n </thead>\n\n <tbody yuwTBody>\n @if (loading()) {\n @for (row of _skeletonRows(); track row) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (column of table.getVisibleLeafColumns(); track column.id) {\n <td yuwTd [class]=\"_cellClasses().get(column.id)?.cell\">\n <span yuwSkeleton class=\"block h-4 w-full\"></span>\n </td>\n }\n </tr>\n }\n } @else if (_isEmpty()) {\n <tr yuwTr [class]=\"_rowClass()\">\n <td yuwTd [attr.colspan]=\"_columnCount()\" class=\"h-24 text-center text-muted-foreground\">\n {{ emptyText() ?? '' }}\n </td>\n </tr>\n } @else {\n @for (row of table.getRowModel().rows; track row.id) {\n <tr\n yuwTr\n [class]=\"_rowClasses().get(row.id)\"\n [attr.data-state]=\"row.getIsSelected() ? 'selected' : null\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onRowClick(row.original)\"\n (keydown)=\"onRowKeydown($event, row.original)\"\n >\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td yuwTd [class]=\"_cellClasses().get(cell.column.id)?.cell\">\n <ng-container *flexRender=\"cell.column.columnDef.cell; props: cell.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (paginated()) {\n <div class=\"flex items-center flex-wrap justify-end gap-4 py-3 px-1 max-lg:justify-center\">\n @if (customPagination()) {\n <ng-content select=\"[yuwDatatablePagination]\" />\n }\n <yuw-pagination\n [page]=\"currentPage()\"\n (pageChange)=\"onPageChange($event)\"\n [totalPages]=\"table.getPageCount() || 1\"\n [previousLabel]=\"previousPageLabel()\"\n [nextLabel]=\"nextPageLabel()\"\n [ellipsisSrText]=\"paginationEllipsisSrText()\"\n [ariaLabel]=\"paginationAriaLabel()\"\n color=\"neutral\"\n size=\"icon-sm\"\n class=\"flex\"\n />\n </div>\n}\n", dependencies: [{ kind: "directive", type: YuwTableContainerDirective, selector: "[yuwTableContainer]" }, { kind: "directive", type: YuwTableDirective, selector: "[yuwTable]" }, { kind: "directive", type: YuwTHeadDirective, selector: "[yuwTHead]" }, { kind: "directive", type: YuwTBodyDirective, selector: "[yuwTBody]" }, { kind: "directive", type: YuwTrDirective, selector: "[yuwTr]" }, { kind: "directive", type: YuwThDirective, selector: "[yuwTh]" }, { kind: "directive", type: YuwTdDirective, selector: "[yuwTd]" }, { kind: "directive", type: YuwCaptionDirective, selector: "[yuwCaption]" }, { kind: "component", type: YuwPaginationComponent, selector: "yuw-pagination", inputs: ["ariaLabel", "color", "ellipsisSrText", "nextLabel", "page", "previousLabel", "size", "totalPages"], outputs: ["pageChange"] }, { kind: "directive", type: YuwSkeletonDirective, selector: "[yuwSkeleton]" }, { kind: "directive", type: FlexRenderDirective, selector: "ng-template[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4739
4753
|
}
|
|
@@ -4742,7 +4756,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4742
4756
|
args: [{ selector: 'yuw-datatable', imports: [...YuwTableImports, YuwPaginationComponent, YuwSkeletonDirective, FlexRenderDirective, NgIcon], providers: [provideIcons({ lucideChevronDown, lucideChevronUp, lucideChevronsUpDown })], host: {
|
|
4743
4757
|
class: 'contents',
|
|
4744
4758
|
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div yuwTableContainer [class]=\"_containerClass()\">\n <table #tableElement yuwTable [class]=\"_tableClass()\">\n @if (caption()) {\n <caption yuwCaption>{{ caption() }}</caption>\n }\n\n <thead yuwTHead [class]=\"_headClass()\">\n @for (headerGroup of table.getHeaderGroups(); track headerGroup.id) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (header of headerGroup.headers; track header.id) {\n @let sorted = header.column.getIsSorted();\n @let headerClasses = _cellClasses().get(header.column.id);\n <th\n yuwTh\n scope=\"col\"\n [attr.colspan]=\"header.colSpan\"\n [attr.aria-sort]=\"sorted ? _ariaSort[sorted] : null\"\n [class]=\"headerClasses?.header\"\n >\n @if (!header.isPlaceholder) {\n @if (sortable() && header.column.getCanSort()) {\n <button\n type=\"button\"\n class=\"inline-flex items-center gap-1 select-none hover:text-foreground/80\"\n (click)=\"header.column.toggleSorting()\"\n >\n <ng-container\n *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\"\n >\n {{ rendered }}\n </ng-container>\n\n <ng-icon [name]=\"_sortIcon[sorted || 'none']\" class=\"shrink-0 text-xs\" aria-hidden=\"true\" />\n </button>\n } @else {\n <ng-container *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n }\n }\n </th>\n }\n </tr>\n }\n </thead>\n\n <tbody yuwTBody>\n @if (loading()) {\n @for (row of _skeletonRows(); track row) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (column of table.getVisibleLeafColumns(); track column.id) {\n <td yuwTd [class]=\"_cellClasses().get(column.id)?.cell\">\n <span yuwSkeleton class=\"block h-4 w-full\"></span>\n </td>\n }\n </tr>\n }\n } @else if (_isEmpty()) {\n <tr yuwTr [class]=\"_rowClass()\">\n <td yuwTd [attr.colspan]=\"_columnCount()\" class=\"h-24 text-center text-muted-foreground\">\n {{ emptyText() ?? '' }}\n </td>\n </tr>\n } @else {\n @for (row of table.getRowModel().rows; track row.id) {\n <tr\n yuwTr\n [class]=\"_rowClasses().get(row.id)\"\n [attr.data-state]=\"row.getIsSelected() ? 'selected' : null\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onRowClick(row.original)\"\n (keydown)=\"onRowKeydown($event, row.original)\"\n >\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td yuwTd [class]=\"_cellClasses().get(cell.column.id)?.cell\">\n <ng-container *flexRender=\"cell.column.columnDef.cell; props: cell.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (paginated()) {\n <div class=\"flex items-center flex-wrap justify-end gap-4 py-3 px-1 max-lg:justify-center\">\n @if (customPagination()) {\n <ng-content select=\"[yuwDatatablePagination]\" />\n }\n <yuw-pagination\n [page]=\"currentPage()\"\n (pageChange)=\"onPageChange($event)\"\n [totalPages]=\"table.getPageCount() || 1\"\n [previousLabel]=\"previousPageLabel()\"\n [nextLabel]=\"nextPageLabel()\"\n [ellipsisSrText]=\"paginationEllipsisSrText()\"\n [ariaLabel]=\"paginationAriaLabel()\"\n color=\"neutral\"\n size=\"icon-sm\"\n class=\"flex\"\n />\n </div>\n}\n" }]
|
|
4745
|
-
}], propDecorators: { _table: [{ type: i0.ViewChild, args: ['tableElement', { isSignal: true }] }], customPagination: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwDatatablePaginationDirective), { isSignal: true }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], cellClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellClass", required: false }] }], columnFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilters", required: false }] }, { type: i0.Output, args: ["columnFiltersChange"] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], columnVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnVisibility", required: false }] }, { type: i0.Output, args: ["columnVisibilityChange"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingRows", required: false }] }], nextPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextPageLabel", required: true }] }], paginated: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginated", required: false }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }, { type: i0.Output, args: ["paginationChange"] }], paginationAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginationAriaLabel", required: true }] }], paginationEllipsisSrText: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginationEllipsisSrText", required: true }] }], previousPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousPageLabel", required: true }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], rowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowSelection", required: false }] }, { type: i0.Output, args: ["rowSelectionChange"] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], sorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "sorting", required: false }] }, { type: i0.Output, args: ["sortingChange"] }], tableClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableClass", required: false }] }], totalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalItems", required: false }] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }], selectedRowsChange: [{ type: i0.Output, args: ["selectedRowsChange"] }] } });
|
|
4759
|
+
}], ctorParameters: () => [], propDecorators: { _table: [{ type: i0.ViewChild, args: ['tableElement', { isSignal: true }] }], customPagination: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwDatatablePaginationDirective), { isSignal: true }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], cellClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellClass", required: false }] }], columnFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilters", required: false }] }, { type: i0.Output, args: ["columnFiltersChange"] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], columnVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnVisibility", required: false }] }, { type: i0.Output, args: ["columnVisibilityChange"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingRows", required: false }] }], nextPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextPageLabel", required: true }] }], paginated: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginated", required: false }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }, { type: i0.Output, args: ["paginationChange"] }], paginationAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginationAriaLabel", required: true }] }], paginationEllipsisSrText: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginationEllipsisSrText", required: true }] }], previousPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousPageLabel", required: true }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], rowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowSelection", required: false }] }, { type: i0.Output, args: ["rowSelectionChange"] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], sorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "sorting", required: false }] }, { type: i0.Output, args: ["sortingChange"] }], tableClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableClass", required: false }] }], totalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalItems", required: false }] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }], selectedRowsChange: [{ type: i0.Output, args: ["selectedRowsChange"] }] } });
|
|
4746
4760
|
|
|
4747
4761
|
/**
|
|
4748
4762
|
* Selection checkbox for a datatable cell or header. The host stops the click so neither the
|
|
@@ -7546,16 +7560,27 @@ const AVATAR = {
|
|
|
7546
7560
|
md: { size: 'default', class: 'h-11.25 w-11.25' },
|
|
7547
7561
|
};
|
|
7548
7562
|
/**
|
|
7549
|
-
*
|
|
7550
|
-
*
|
|
7563
|
+
* `meta.headerClass` of a column of these cells, by avatar size: it indents the title past the avatar and the gap, so
|
|
7564
|
+
* it lines up with the name.
|
|
7565
|
+
*/
|
|
7566
|
+
const YUWS_AVATAR_NAME_HEADER_CLASS = {
|
|
7567
|
+
sm: 'indent-9',
|
|
7568
|
+
md: 'indent-14.25',
|
|
7569
|
+
};
|
|
7570
|
+
/**
|
|
7571
|
+
* Table cell with the identity of a row: avatar and name, and an optional second line below it, in a smaller size.
|
|
7572
|
+
* The name is text, not a link: the whole row is the click target. Without an image the avatar shows the initials of
|
|
7573
|
+
* `name`.
|
|
7551
7574
|
*
|
|
7552
7575
|
* Inputs:
|
|
7553
7576
|
* - `imageUrl`: Image of the row. Default is `undefined`.
|
|
7554
7577
|
* - `name` (required): Visible name; also the avatar's alternative text.
|
|
7578
|
+
* - `description`: Second line under the name; omitted when empty. Default is `undefined`.
|
|
7555
7579
|
* - `size`: Avatar size (`'sm'`, `'md'`). Default is `'sm'`.
|
|
7556
7580
|
*/
|
|
7557
7581
|
class YuwsAvatarNameCellComponent {
|
|
7558
7582
|
constructor() {
|
|
7583
|
+
this.description = input(...(ngDevMode ? [undefined, { debugName: "description" }] : /* istanbul ignore next */ []));
|
|
7559
7584
|
this.imageUrl = input(...(ngDevMode ? [undefined, { debugName: "imageUrl" }] : /* istanbul ignore next */ []));
|
|
7560
7585
|
this.name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
7561
7586
|
this.size = input('sm', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
@@ -7563,12 +7588,12 @@ class YuwsAvatarNameCellComponent {
|
|
|
7563
7588
|
this.initials = computed(() => yuwsInitialsOf(this.name()), ...(ngDevMode ? [{ debugName: "initials" }] : /* istanbul ignore next */ []));
|
|
7564
7589
|
}
|
|
7565
7590
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsAvatarNameCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7566
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
7591
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsAvatarNameCellComponent, isStandalone: true, selector: "yuws-avatar-name-cell", inputs: { description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, imageUrl: { classPropertyName: "imageUrl", publicName: "imageUrl", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<span class=\"flex items-center gap-3\">\n <yuw-avatar\n [size]=\"avatar().size\"\n [class]=\"avatar().class\"\n [src]=\"imageUrl()\"\n [alt]=\"name()\"\n [fallback]=\"initials()\"\n />\n <span class=\"flex min-w-0 flex-col\">\n <span class=\"font-medium\">{{ name() }}</span>\n @if (description()) {\n <span class=\"text-xs text-muted-foreground\">{{ description() }}</span>\n }\n </span>\n</span>\n", dependencies: [{ kind: "component", type: YuwAvatarComponent, selector: "yuw-avatar", inputs: ["alt", "badge", "fallback", "group", "groupCount", "size", "src", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7567
7592
|
}
|
|
7568
7593
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsAvatarNameCellComponent, decorators: [{
|
|
7569
7594
|
type: Component,
|
|
7570
|
-
args: [{ selector: 'yuws-avatar-name-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [YuwAvatarComponent], template: "<span class=\"flex items-center gap-
|
|
7571
|
-
}], propDecorators: { imageUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUrl", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
7595
|
+
args: [{ selector: 'yuws-avatar-name-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [YuwAvatarComponent], template: "<span class=\"flex items-center gap-3\">\n <yuw-avatar\n [size]=\"avatar().size\"\n [class]=\"avatar().class\"\n [src]=\"imageUrl()\"\n [alt]=\"name()\"\n [fallback]=\"initials()\"\n />\n <span class=\"flex min-w-0 flex-col\">\n <span class=\"font-medium\">{{ name() }}</span>\n @if (description()) {\n <span class=\"text-xs text-muted-foreground\">{{ description() }}</span>\n }\n </span>\n</span>\n" }]
|
|
7596
|
+
}], propDecorators: { description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], imageUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUrl", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
7572
7597
|
|
|
7573
7598
|
/**
|
|
7574
7599
|
* Table cell that clamps its text to two lines, breaking anywhere, for long values with no spaces such as tokens. The
|
|
@@ -7589,26 +7614,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
7589
7614
|
args: [{ selector: 'yuws-clamped-text-cell', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"line-clamp-2 break-all\" [title]=\"text()\">{{ text() }}</span>\n" }]
|
|
7590
7615
|
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: true }] }] } });
|
|
7591
7616
|
|
|
7617
|
+
const OFF_ICONS = { dash: 'lucideMinus', cross: 'lucideX' };
|
|
7592
7618
|
/**
|
|
7593
|
-
* Table cell for a boolean field: a check or a dash. The icon is never the only carrier of
|
|
7594
|
-
* `label` as its accessible name.
|
|
7619
|
+
* Table cell for a boolean field: a check, or a dash or a cross when it is off. The icon is never the only carrier of
|
|
7620
|
+
* the meaning: it takes `label` as its accessible name.
|
|
7595
7621
|
*
|
|
7596
7622
|
* Inputs:
|
|
7597
7623
|
* - `enabled` (required): Value of the field.
|
|
7598
7624
|
* - `label` (required): Accessible text of the state. The consuming app translates it.
|
|
7625
|
+
* - `offIcon`: What an off field shows, `dash` by default.
|
|
7599
7626
|
*/
|
|
7600
7627
|
class YuwsFlagCellComponent {
|
|
7601
7628
|
constructor() {
|
|
7602
7629
|
this.enabled = input.required(...(ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []));
|
|
7603
7630
|
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
7631
|
+
this.offIcon = input('dash', ...(ngDevMode ? [{ debugName: "offIcon" }] : /* istanbul ignore next */ []));
|
|
7632
|
+
this.offIconName = computed(() => OFF_ICONS[this.offIcon()], ...(ngDevMode ? [{ debugName: "offIconName" }] : /* istanbul ignore next */ []));
|
|
7604
7633
|
}
|
|
7605
7634
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsFlagCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7606
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsFlagCellComponent, isStandalone: true, selector: "yuws-flag-cell", inputs: { enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, providers: [provideIcons({ lucideCheck, lucideMinus })], ngImport: i0, template: "@if (enabled()) {\n <ng-icon name=\"lucideCheck\" size=\"16\" class=\"text-success\" role=\"img\" [attr.aria-label]=\"label()\" />\n} @else {\n <ng-icon name=\"
|
|
7635
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsFlagCellComponent, isStandalone: true, selector: "yuws-flag-cell", inputs: { enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, offIcon: { classPropertyName: "offIcon", publicName: "offIcon", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ lucideCheck, lucideMinus, lucideX })], ngImport: i0, template: "@if (enabled()) {\n <ng-icon name=\"lucideCheck\" size=\"16\" class=\"text-success\" role=\"img\" [attr.aria-label]=\"label()\" />\n} @else {\n <ng-icon [name]=\"offIconName()\" size=\"16\" class=\"text-muted-foreground\" role=\"img\" [attr.aria-label]=\"label()\" />\n}\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7607
7636
|
}
|
|
7608
7637
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsFlagCellComponent, decorators: [{
|
|
7609
7638
|
type: Component,
|
|
7610
|
-
args: [{ selector: 'yuws-flag-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIcon], providers: [provideIcons({ lucideCheck, lucideMinus })], template: "@if (enabled()) {\n <ng-icon name=\"lucideCheck\" size=\"16\" class=\"text-success\" role=\"img\" [attr.aria-label]=\"label()\" />\n} @else {\n <ng-icon name=\"
|
|
7611
|
-
}], propDecorators: { enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
|
|
7639
|
+
args: [{ selector: 'yuws-flag-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIcon], providers: [provideIcons({ lucideCheck, lucideMinus, lucideX })], template: "@if (enabled()) {\n <ng-icon name=\"lucideCheck\" size=\"16\" class=\"text-success\" role=\"img\" [attr.aria-label]=\"label()\" />\n} @else {\n <ng-icon [name]=\"offIconName()\" size=\"16\" class=\"text-muted-foreground\" role=\"img\" [attr.aria-label]=\"label()\" />\n}\n" }]
|
|
7640
|
+
}], propDecorators: { enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], offIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "offIcon", required: false }] }] } });
|
|
7612
7641
|
|
|
7613
7642
|
/**
|
|
7614
7643
|
* Icon button at the end of a row, hidden until the row is hovered or keyboard-focused like the pencil of
|
|
@@ -7686,6 +7715,131 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
7686
7715
|
args: [{ selector: 'yuws-link-cell', changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n class=\"text-primary underline\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"href()\"\n (click)=\"$event.stopPropagation()\"\n>\n {{ label() }}\n</a>\n" }]
|
|
7687
7716
|
}], propDecorators: { href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
|
|
7688
7717
|
|
|
7718
|
+
/**
|
|
7719
|
+
* Ellipsis button at the end of a row that opens its menu of actions, hidden until its row is hovered or keyboard-focused
|
|
7720
|
+
* (`yuw-reveal`) and kept visible while the menu is open. The actions are an input because
|
|
7721
|
+
* `flexRenderComponent` does not subscribe outputs; the host stops the click and the keys so a clickable row does not
|
|
7722
|
+
* open too.
|
|
7723
|
+
*
|
|
7724
|
+
* Inputs:
|
|
7725
|
+
* - `actions` (required): Entries of the menu, in order.
|
|
7726
|
+
* - `label` (required): Accessible name of the button. The consuming app translates it.
|
|
7727
|
+
*/
|
|
7728
|
+
class YuwsMenuActionsCellComponent {
|
|
7729
|
+
constructor() {
|
|
7730
|
+
this.actions = input.required(...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
7731
|
+
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
7732
|
+
}
|
|
7733
|
+
onRun(action) {
|
|
7734
|
+
action.run?.();
|
|
7735
|
+
}
|
|
7736
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsMenuActionsCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7737
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsMenuActionsCellComponent, isStandalone: true, selector: "yuws-menu-actions-cell", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()", "keydown": "$event.stopPropagation()" }, classAttribute: "yuw-reveal" }, providers: [provideIcons({ lucideEllipsis })], ngImport: i0, template: "<yuw-button\n variant=\"ghost\"\n size=\"icon\"\n yuwDropdownMenuAlign=\"end\"\n [ariaLabel]=\"label()\"\n [yuwDropdownMenuTrigger]=\"menu\"\n>\n <ng-icon name=\"lucideEllipsis\" size=\"16\" />\n</yuw-button>\n\n<ng-template #menu>\n <div yuwContextMenu>\n @for (action of actions(); track action.key) {\n @if (action.separated) {\n <div yuwContextMenuSeparator></div>\n }\n @if (action.href; as href) {\n <a yuwContextMenuItem target=\"_blank\" rel=\"noopener\" [href]=\"href\">{{ action.label }}</a>\n } @else {\n <button\n yuwContextMenuItem\n [variant]=\"action.destructive ? 'destructive' : 'default'\"\n (triggered)=\"onRun(action)\"\n >\n {{ action.label }}\n </button>\n }\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: YuwContextMenuDirective, selector: "[yuwContextMenu]" }, { kind: "directive", type: YuwContextMenuItemDirective, selector: "[yuwContextMenuItem]", outputs: ["triggered"] }, { kind: "directive", type: YuwContextMenuSeparatorDirective, selector: "[yuwContextMenuSeparator]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7738
|
+
}
|
|
7739
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsMenuActionsCellComponent, decorators: [{
|
|
7740
|
+
type: Component,
|
|
7741
|
+
args: [{ selector: 'yuws-menu-actions-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [...YuwContextMenuImports, NgIcon, YuwButtonComponent], providers: [provideIcons({ lucideEllipsis })], host: { class: 'yuw-reveal', '(click)': '$event.stopPropagation()', '(keydown)': '$event.stopPropagation()' }, template: "<yuw-button\n variant=\"ghost\"\n size=\"icon\"\n yuwDropdownMenuAlign=\"end\"\n [ariaLabel]=\"label()\"\n [yuwDropdownMenuTrigger]=\"menu\"\n>\n <ng-icon name=\"lucideEllipsis\" size=\"16\" />\n</yuw-button>\n\n<ng-template #menu>\n <div yuwContextMenu>\n @for (action of actions(); track action.key) {\n @if (action.separated) {\n <div yuwContextMenuSeparator></div>\n }\n @if (action.href; as href) {\n <a yuwContextMenuItem target=\"_blank\" rel=\"noopener\" [href]=\"href\">{{ action.label }}</a>\n } @else {\n <button\n yuwContextMenuItem\n [variant]=\"action.destructive ? 'destructive' : 'default'\"\n (triggered)=\"onRun(action)\"\n >\n {{ action.label }}\n </button>\n }\n }\n </div>\n</ng-template>\n" }]
|
|
7742
|
+
}], propDecorators: { actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
|
|
7743
|
+
|
|
7744
|
+
const HOVER_CLOSE_DELAY_MS = 150;
|
|
7745
|
+
/**
|
|
7746
|
+
* Table cell with the first of a row's `items` and a `+N` badge counting the rest. The whole cell is the trigger of a
|
|
7747
|
+
* popover centred under it that lists every item; with a single item it is plain text with no popover.
|
|
7748
|
+
*
|
|
7749
|
+
* Only a click opens it. A mouse closes it on leaving the cell and the panel, after a short delay that lets the pointer
|
|
7750
|
+
* cross between them; an outside click or Escape closes it too, which is the only way on touch. The host stops the
|
|
7751
|
+
* click and the keys so a clickable row does not open too.
|
|
7752
|
+
*
|
|
7753
|
+
* Inputs:
|
|
7754
|
+
* - `items` (required): Texts of the row, already translated; the first one is shown in the cell.
|
|
7755
|
+
*/
|
|
7756
|
+
class YuwsOverflowListCellComponent {
|
|
7757
|
+
constructor() {
|
|
7758
|
+
this.items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
7759
|
+
this.open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
7760
|
+
this.first = computed(() => this.items()[0] ?? '', ...(ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []));
|
|
7761
|
+
this.hiddenCount = computed(() => `+${this.items().length - 1}`, ...(ngDevMode ? [{ debugName: "hiddenCount" }] : /* istanbul ignore next */ []));
|
|
7762
|
+
this.overflows = computed(() => this.items().length > 1, ...(ngDevMode ? [{ debugName: "overflows" }] : /* istanbul ignore next */ []));
|
|
7763
|
+
inject(DestroyRef).onDestroy(() => this._cancelClose());
|
|
7764
|
+
}
|
|
7765
|
+
onOpenChange(open) {
|
|
7766
|
+
this._cancelClose();
|
|
7767
|
+
this.open.set(open);
|
|
7768
|
+
}
|
|
7769
|
+
onPointerEnter(event) {
|
|
7770
|
+
if (event.pointerType === 'mouse') {
|
|
7771
|
+
this._cancelClose();
|
|
7772
|
+
}
|
|
7773
|
+
}
|
|
7774
|
+
onPointerLeave(event) {
|
|
7775
|
+
if (event.pointerType === 'mouse' && this.open()) {
|
|
7776
|
+
this._cancelClose();
|
|
7777
|
+
this._closeTimer = setTimeout(() => this.open.set(false), HOVER_CLOSE_DELAY_MS);
|
|
7778
|
+
}
|
|
7779
|
+
}
|
|
7780
|
+
_cancelClose() {
|
|
7781
|
+
clearTimeout(this._closeTimer);
|
|
7782
|
+
this._closeTimer = undefined;
|
|
7783
|
+
}
|
|
7784
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsOverflowListCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7785
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsOverflowListCellComponent, isStandalone: true, selector: "yuws-overflow-list-cell", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()", "keydown": "$event.stopPropagation()" }, classAttribute: "flex min-w-0 [&_yuw-button]:w-full" }, ngImport: i0, template: "@if (overflows()) {\n <yuw-popover\n triggerTransparent\n triggerClass=\"h-auto w-full min-w-0 justify-start gap-2 px-0 py-0 font-normal\"\n panelClass=\"w-auto min-w-48 max-w-80 gap-0 p-1\"\n [open]=\"open()\"\n (openChange)=\"onOpenChange($event)\"\n (pointerenter)=\"onPointerEnter($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n <ng-container yuwPopoverTrigger>\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n <yuw-badge variant=\"outline\" color=\"neutral\" class=\"shrink-0 rounded-full px-1.5 font-normal\">\n {{ hiddenCount() }}\n </yuw-badge>\n </ng-container>\n\n <ul class=\"flex flex-col\" (pointerenter)=\"onPointerEnter($event)\" (pointerleave)=\"onPointerLeave($event)\">\n @for (item of items(); track $index) {\n <li class=\"rounded-sm px-2 py-1.5\">{{ item }}</li>\n }\n </ul>\n </yuw-popover>\n} @else {\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n}\n", dependencies: [{ kind: "component", type: YuwBadgeComponent, selector: "yuw-badge", inputs: ["color", "dot", "removeLabel", "variant"], outputs: ["removed"] }, { kind: "component", type: YuwPopoverComponent, selector: "yuw-popover", inputs: ["align", "description", "offsetX", "open", "panelClass", "showTrigger", "sideOffset", "title", "triggerClass", "triggerColor", "triggerSize", "triggerTransparent", "triggerVariant"], outputs: ["openChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7786
|
+
}
|
|
7787
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsOverflowListCellComponent, decorators: [{
|
|
7788
|
+
type: Component,
|
|
7789
|
+
args: [{ selector: 'yuws-overflow-list-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [YuwBadgeComponent, YuwPopoverComponent], host: {
|
|
7790
|
+
class: 'flex min-w-0 [&_yuw-button]:w-full',
|
|
7791
|
+
'(click)': '$event.stopPropagation()',
|
|
7792
|
+
'(keydown)': '$event.stopPropagation()',
|
|
7793
|
+
}, template: "@if (overflows()) {\n <yuw-popover\n triggerTransparent\n triggerClass=\"h-auto w-full min-w-0 justify-start gap-2 px-0 py-0 font-normal\"\n panelClass=\"w-auto min-w-48 max-w-80 gap-0 p-1\"\n [open]=\"open()\"\n (openChange)=\"onOpenChange($event)\"\n (pointerenter)=\"onPointerEnter($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n <ng-container yuwPopoverTrigger>\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n <yuw-badge variant=\"outline\" color=\"neutral\" class=\"shrink-0 rounded-full px-1.5 font-normal\">\n {{ hiddenCount() }}\n </yuw-badge>\n </ng-container>\n\n <ul class=\"flex flex-col\" (pointerenter)=\"onPointerEnter($event)\" (pointerleave)=\"onPointerLeave($event)\">\n @for (item of items(); track $index) {\n <li class=\"rounded-sm px-2 py-1.5\">{{ item }}</li>\n }\n </ul>\n </yuw-popover>\n} @else {\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n}\n" }]
|
|
7794
|
+
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }] } });
|
|
7795
|
+
|
|
7796
|
+
/**
|
|
7797
|
+
* Selection checkbox of a row, hidden until the row is hovered or keyboard-focused like the button of
|
|
7798
|
+
* `buildYuwsMenuActionsColumn`; touch devices keep it visible. Once any row is selected, `revealed` keeps every
|
|
7799
|
+
* checkbox of the table visible. Built by `buildYuwsSelectColumn`.
|
|
7800
|
+
*
|
|
7801
|
+
* Inputs:
|
|
7802
|
+
* - `checked` (required): Whether the row is selected.
|
|
7803
|
+
* - `label` (required): Accessible name of the checkbox. The consuming app translates it.
|
|
7804
|
+
* - `onToggle` (required): Callback run when the checkbox changes. An input because `flexRenderComponent` does not
|
|
7805
|
+
* subscribe outputs.
|
|
7806
|
+
* - `revealed` (required): Whether some row of the table is selected.
|
|
7807
|
+
*/
|
|
7808
|
+
class YuwsSelectCellComponent {
|
|
7809
|
+
constructor() {
|
|
7810
|
+
this.checked = input.required(...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
7811
|
+
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
7812
|
+
this.onToggle = input.required(...(ngDevMode ? [{ debugName: "onToggle" }] : /* istanbul ignore next */ []));
|
|
7813
|
+
this.revealed = input.required(...(ngDevMode ? [{ debugName: "revealed" }] : /* istanbul ignore next */ []));
|
|
7814
|
+
}
|
|
7815
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsSelectCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7816
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: YuwsSelectCellComponent, isStandalone: true, selector: "yuws-select-cell", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, onToggle: { classPropertyName: "onToggle", publicName: "onToggle", isSignal: true, isRequired: true, transformFunction: null }, revealed: { classPropertyName: "revealed", publicName: "revealed", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.yuw-reveal": "!revealed()" }, classAttribute: "inline-flex" }, ngImport: i0, template: "<yuw-datatable-row-select [checked]=\"checked()\" [label]=\"label()\" [onToggle]=\"onToggle()\" />\n", dependencies: [{ kind: "component", type: YuwDatatableRowSelect, selector: "yuw-datatable-row-select", inputs: ["checked", "indeterminate", "label", "onToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7817
|
+
}
|
|
7818
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsSelectCellComponent, decorators: [{
|
|
7819
|
+
type: Component,
|
|
7820
|
+
args: [{ selector: 'yuws-select-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [YuwDatatableRowSelect], host: { class: 'inline-flex', '[class.yuw-reveal]': '!revealed()' }, template: "<yuw-datatable-row-select [checked]=\"checked()\" [label]=\"label()\" [onToggle]=\"onToggle()\" />\n" }]
|
|
7821
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], onToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "onToggle", required: true }] }], revealed: [{ type: i0.Input, args: [{ isSignal: true, alias: "revealed", required: true }] }] } });
|
|
7822
|
+
|
|
7823
|
+
/**
|
|
7824
|
+
* Table cell with two values of a row in one column: `text` on top and `description` below it, in a smaller size.
|
|
7825
|
+
*
|
|
7826
|
+
* Inputs:
|
|
7827
|
+
* - `text` (required): Main value.
|
|
7828
|
+
* - `description`: Second line under `text`; omitted when empty. Default is `undefined`.
|
|
7829
|
+
*/
|
|
7830
|
+
class YuwsStackedTextCellComponent {
|
|
7831
|
+
constructor() {
|
|
7832
|
+
this.description = input(...(ngDevMode ? [undefined, { debugName: "description" }] : /* istanbul ignore next */ []));
|
|
7833
|
+
this.text = input.required(...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
7834
|
+
}
|
|
7835
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsStackedTextCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7836
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsStackedTextCellComponent, isStandalone: true, selector: "yuws-stacked-text-cell", inputs: { description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<span class=\"flex min-w-0 flex-col\">\n <span>{{ text() }}</span>\n @if (description()) {\n <span class=\"text-xs text-muted-foreground\">{{ description() }}</span>\n }\n</span>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7837
|
+
}
|
|
7838
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsStackedTextCellComponent, decorators: [{
|
|
7839
|
+
type: Component,
|
|
7840
|
+
args: [{ selector: 'yuws-stacked-text-cell', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"flex min-w-0 flex-col\">\n <span>{{ text() }}</span>\n @if (description()) {\n <span class=\"text-xs text-muted-foreground\">{{ description() }}</span>\n }\n</span>\n" }]
|
|
7841
|
+
}], propDecorators: { description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: true }] }] } });
|
|
7842
|
+
|
|
7689
7843
|
const TONE_CLASS = {
|
|
7690
7844
|
positive: 'border-success text-success',
|
|
7691
7845
|
negative: 'border-destructive text-destructive',
|
|
@@ -7794,6 +7948,56 @@ function buildYuwsIconActionColumn(column) {
|
|
|
7794
7948
|
: '',
|
|
7795
7949
|
};
|
|
7796
7950
|
}
|
|
7951
|
+
/** Last column, `actions`, with an ellipsis button that opens the row's menu. */
|
|
7952
|
+
function buildYuwsMenuActionsColumn(column) {
|
|
7953
|
+
return {
|
|
7954
|
+
id: 'actions',
|
|
7955
|
+
header: column.header ?? '',
|
|
7956
|
+
enableSorting: false,
|
|
7957
|
+
meta: { align: 'end', cellClass: 'w-12' },
|
|
7958
|
+
cell: ({ row }) => {
|
|
7959
|
+
const actions = column.actions(row.original);
|
|
7960
|
+
return actions.length
|
|
7961
|
+
? flexRenderComponent(YuwsMenuActionsCellComponent, {
|
|
7962
|
+
inputs: { actions, label: column.label(row.original) },
|
|
7963
|
+
})
|
|
7964
|
+
: '';
|
|
7965
|
+
},
|
|
7966
|
+
};
|
|
7967
|
+
}
|
|
7968
|
+
/**
|
|
7969
|
+
* First column, `select`, for a `selectable` table: the header selects or clears the rows on screen and shows the mixed
|
|
7970
|
+
* state while only some are, and each row's checkbox reveals on hover until any row is selected.
|
|
7971
|
+
*/
|
|
7972
|
+
function buildYuwsSelectColumn(labels) {
|
|
7973
|
+
return {
|
|
7974
|
+
id: 'select',
|
|
7975
|
+
header: ({ table }) => {
|
|
7976
|
+
const rows = table.getRowModel().rows;
|
|
7977
|
+
const selected = rows.filter((row) => row.getIsSelected()).length;
|
|
7978
|
+
const all = selected > 0 && selected === rows.length;
|
|
7979
|
+
return flexRenderComponent(YuwDatatableRowSelect, {
|
|
7980
|
+
inputs: {
|
|
7981
|
+
checked: all,
|
|
7982
|
+
indeterminate: selected > 0 && !all,
|
|
7983
|
+
label: labels.selectAll,
|
|
7984
|
+
onToggle: () => table.setRowSelection(all ? {} : Object.fromEntries(rows.map((row) => [row.id, true]))),
|
|
7985
|
+
},
|
|
7986
|
+
});
|
|
7987
|
+
},
|
|
7988
|
+
enableSorting: false,
|
|
7989
|
+
enableHiding: false,
|
|
7990
|
+
meta: { cellClass: 'w-10' },
|
|
7991
|
+
cell: ({ row, table }) => flexRenderComponent(YuwsSelectCellComponent, {
|
|
7992
|
+
inputs: {
|
|
7993
|
+
checked: row.getIsSelected(),
|
|
7994
|
+
label: labels.selectRow(row.original),
|
|
7995
|
+
onToggle: () => row.toggleSelected(),
|
|
7996
|
+
revealed: table.getRowModel().rows.some((candidate) => candidate.getIsSelected()),
|
|
7997
|
+
},
|
|
7998
|
+
}),
|
|
7999
|
+
};
|
|
8000
|
+
}
|
|
7797
8001
|
|
|
7798
8002
|
const COPIED_FEEDBACK_MS = 1500;
|
|
7799
8003
|
/**
|
|
@@ -8063,12 +8267,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
8063
8267
|
* - `list` (required): Paged list that owns pagination and sorting.
|
|
8064
8268
|
* - `loading`: Shows the loading state and locks the page size. Default is `false`.
|
|
8065
8269
|
* - `rowClass`: Class per row. Default is `undefined`.
|
|
8066
|
-
* - `selectable`: Adds row selection
|
|
8270
|
+
* - `selectable`: Adds row selection; put `buildYuwsSelectColumn` first in `columns`. Every new `data`, such as
|
|
8271
|
+
* another page, clears it. Default is `false`.
|
|
8067
8272
|
* - `total` (required): Total rows across pages.
|
|
8068
8273
|
* - `columnVisibility` (model): Hidden columns.
|
|
8069
8274
|
*
|
|
8070
8275
|
* Outputs:
|
|
8071
8276
|
* - `rowClicked`: Emits the clicked row.
|
|
8277
|
+
* - `selectedRowsChange`: Emits the selected rows on every change, `[]` once cleared.
|
|
8072
8278
|
*
|
|
8073
8279
|
* It is a `YuwTableShareSource`: bind it to `yuws-list-toolbar`'s `shareSource` to copy, print or download the page
|
|
8074
8280
|
* the user is looking at.
|
|
@@ -8087,17 +8293,18 @@ class YuwsListTableComponent {
|
|
|
8087
8293
|
this.selectable = input(false, { ...(ngDevMode ? { debugName: "selectable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8088
8294
|
this.total = input.required(...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
8089
8295
|
this.rowClicked = output();
|
|
8296
|
+
this.selectedRowsChange = output();
|
|
8090
8297
|
}
|
|
8091
8298
|
snapshot() {
|
|
8092
8299
|
return this._datatable().snapshot();
|
|
8093
8300
|
}
|
|
8094
8301
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsListTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8095
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.22", type: YuwsListTableComponent, isStandalone: true, selector: "yuws-list-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, columnVisibility: { classPropertyName: "columnVisibility", publicName: "columnVisibility", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: true, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: true, transformFunction: null }, list: { classPropertyName: "list", publicName: "list", isSignal: true, isRequired: true, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { columnVisibility: "columnVisibilityChange", rowClicked: "rowClicked" }, viewQueries: [{ propertyName: "_datatable", first: true, predicate: YuwDatatableComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<yuw-datatable\n sortable\n paginated\n appearance=\"card\"\n [nextPageLabel]=\"labels().next\"\n [previousPageLabel]=\"labels().previous\"\n [paginationEllipsisSrText]=\"labels().ellipsis\"\n [paginationAriaLabel]=\"labels().ariaLabel\"\n [emptyText]=\"emptyText()\"\n [columns]=\"columns()\"\n [data]=\"data()\"\n [totalItems]=\"total()\"\n [loading]=\"loading()\"\n [rowClass]=\"rowClass()\"\n [selectable]=\"selectable()\"\n [pagination]=\"list().pagination()\"\n [sorting]=\"list().sorting()\"\n [(columnVisibility)]=\"columnVisibility\"\n (paginationChange)=\"list().pagination.set($event)\"\n (sortingChange)=\"list().sorting.set($event)\"\n (rowClicked)=\"rowClicked.emit($event)\"\n>\n <yuws-page-size yuwDatatablePagination [list]=\"list()\" [labels]=\"labels().pageSize\" [disabled]=\"loading()\" />\n</yuw-datatable>\n", dependencies: [{ kind: "component", type: YuwDatatableComponent, selector: "yuw-datatable", inputs: ["appearance", "caption", "cellClass", "columnFilters", "columns", "columnVisibility", "data", "emptyText", "loading", "loadingRows", "nextPageLabel", "paginated", "pagination", "paginationAriaLabel", "paginationEllipsisSrText", "previousPageLabel", "rowClass", "rowSelection", "selectable", "sortable", "sorting", "tableClass", "totalItems"], outputs: ["columnFiltersChange", "columnVisibilityChange", "paginationChange", "rowSelectionChange", "sortingChange", "rowClicked", "selectedRowsChange"] }, { kind: "directive", type: YuwDatatablePaginationDirective, selector: "[yuwDatatablePagination]" }, { kind: "component", type: YuwsPageSizeComponent, selector: "yuws-page-size", inputs: ["disabled", "labels", "list"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8302
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.22", type: YuwsListTableComponent, isStandalone: true, selector: "yuws-list-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, columnVisibility: { classPropertyName: "columnVisibility", publicName: "columnVisibility", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: true, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: true, transformFunction: null }, list: { classPropertyName: "list", publicName: "list", isSignal: true, isRequired: true, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { columnVisibility: "columnVisibilityChange", rowClicked: "rowClicked", selectedRowsChange: "selectedRowsChange" }, viewQueries: [{ propertyName: "_datatable", first: true, predicate: YuwDatatableComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<yuw-datatable\n sortable\n paginated\n appearance=\"card\"\n [nextPageLabel]=\"labels().next\"\n [previousPageLabel]=\"labels().previous\"\n [paginationEllipsisSrText]=\"labels().ellipsis\"\n [paginationAriaLabel]=\"labels().ariaLabel\"\n [emptyText]=\"emptyText()\"\n [columns]=\"columns()\"\n [data]=\"data()\"\n [totalItems]=\"total()\"\n [loading]=\"loading()\"\n [rowClass]=\"rowClass()\"\n [selectable]=\"selectable()\"\n [pagination]=\"list().pagination()\"\n [sorting]=\"list().sorting()\"\n [(columnVisibility)]=\"columnVisibility\"\n (paginationChange)=\"list().pagination.set($event)\"\n (sortingChange)=\"list().sorting.set($event)\"\n (rowClicked)=\"rowClicked.emit($event)\"\n (selectedRowsChange)=\"selectedRowsChange.emit($event)\"\n>\n <yuws-page-size yuwDatatablePagination [list]=\"list()\" [labels]=\"labels().pageSize\" [disabled]=\"loading()\" />\n</yuw-datatable>\n", dependencies: [{ kind: "component", type: YuwDatatableComponent, selector: "yuw-datatable", inputs: ["appearance", "caption", "cellClass", "columnFilters", "columns", "columnVisibility", "data", "emptyText", "loading", "loadingRows", "nextPageLabel", "paginated", "pagination", "paginationAriaLabel", "paginationEllipsisSrText", "previousPageLabel", "rowClass", "rowSelection", "selectable", "sortable", "sorting", "tableClass", "totalItems"], outputs: ["columnFiltersChange", "columnVisibilityChange", "paginationChange", "rowSelectionChange", "sortingChange", "rowClicked", "selectedRowsChange"] }, { kind: "directive", type: YuwDatatablePaginationDirective, selector: "[yuwDatatablePagination]" }, { kind: "component", type: YuwsPageSizeComponent, selector: "yuws-page-size", inputs: ["disabled", "labels", "list"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8096
8303
|
}
|
|
8097
8304
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsListTableComponent, decorators: [{
|
|
8098
8305
|
type: Component,
|
|
8099
|
-
args: [{ selector: 'yuws-list-table', changeDetection: ChangeDetectionStrategy.OnPush, imports: [YuwDatatableComponent, YuwDatatablePaginationDirective, YuwsPageSizeComponent], template: "<yuw-datatable\n sortable\n paginated\n appearance=\"card\"\n [nextPageLabel]=\"labels().next\"\n [previousPageLabel]=\"labels().previous\"\n [paginationEllipsisSrText]=\"labels().ellipsis\"\n [paginationAriaLabel]=\"labels().ariaLabel\"\n [emptyText]=\"emptyText()\"\n [columns]=\"columns()\"\n [data]=\"data()\"\n [totalItems]=\"total()\"\n [loading]=\"loading()\"\n [rowClass]=\"rowClass()\"\n [selectable]=\"selectable()\"\n [pagination]=\"list().pagination()\"\n [sorting]=\"list().sorting()\"\n [(columnVisibility)]=\"columnVisibility\"\n (paginationChange)=\"list().pagination.set($event)\"\n (sortingChange)=\"list().sorting.set($event)\"\n (rowClicked)=\"rowClicked.emit($event)\"\n>\n <yuws-page-size yuwDatatablePagination [list]=\"list()\" [labels]=\"labels().pageSize\" [disabled]=\"loading()\" />\n</yuw-datatable>\n" }]
|
|
8100
|
-
}], propDecorators: { _datatable: [{ type: i0.ViewChild, args: [i0.forwardRef(() => YuwDatatableComponent), { isSignal: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], columnVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnVisibility", required: false }] }, { type: i0.Output, args: ["columnVisibilityChange"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: true }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: true }] }], list: [{ type: i0.Input, args: [{ isSignal: true, alias: "list", required: true }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: true }] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }] } });
|
|
8306
|
+
args: [{ selector: 'yuws-list-table', changeDetection: ChangeDetectionStrategy.OnPush, imports: [YuwDatatableComponent, YuwDatatablePaginationDirective, YuwsPageSizeComponent], template: "<yuw-datatable\n sortable\n paginated\n appearance=\"card\"\n [nextPageLabel]=\"labels().next\"\n [previousPageLabel]=\"labels().previous\"\n [paginationEllipsisSrText]=\"labels().ellipsis\"\n [paginationAriaLabel]=\"labels().ariaLabel\"\n [emptyText]=\"emptyText()\"\n [columns]=\"columns()\"\n [data]=\"data()\"\n [totalItems]=\"total()\"\n [loading]=\"loading()\"\n [rowClass]=\"rowClass()\"\n [selectable]=\"selectable()\"\n [pagination]=\"list().pagination()\"\n [sorting]=\"list().sorting()\"\n [(columnVisibility)]=\"columnVisibility\"\n (paginationChange)=\"list().pagination.set($event)\"\n (sortingChange)=\"list().sorting.set($event)\"\n (rowClicked)=\"rowClicked.emit($event)\"\n (selectedRowsChange)=\"selectedRowsChange.emit($event)\"\n>\n <yuws-page-size yuwDatatablePagination [list]=\"list()\" [labels]=\"labels().pageSize\" [disabled]=\"loading()\" />\n</yuw-datatable>\n" }]
|
|
8307
|
+
}], propDecorators: { _datatable: [{ type: i0.ViewChild, args: [i0.forwardRef(() => YuwDatatableComponent), { isSignal: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], columnVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnVisibility", required: false }] }, { type: i0.Output, args: ["columnVisibilityChange"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: true }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: true }] }], list: [{ type: i0.Input, args: [{ isSignal: true, alias: "list", required: true }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: true }] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }], selectedRowsChange: [{ type: i0.Output, args: ["selectedRowsChange"] }] } });
|
|
8101
8308
|
|
|
8102
8309
|
/**
|
|
8103
8310
|
* Pagination footer for lists without a datatable: the page size selector with its range message
|
|
@@ -8386,7 +8593,8 @@ const DEFAULT_VIEW_MODE_ICONS = { list: 'lucideList', block: 'lucideLayoutGrid'
|
|
|
8386
8593
|
* holding `yuwPopoverTrigger`.
|
|
8387
8594
|
*
|
|
8388
8595
|
* `hiddenColumns` is two-way: the consumer can seed it (a restored preference) and the combobox
|
|
8389
|
-
* reflects it. The
|
|
8596
|
+
* reflects it. The combobox selects the VISIBLE columns: every hideable column left unselected is
|
|
8597
|
+
* hidden, so `hiddenColumns` stays the complement of the selection. The columns button is the combobox's own trigger, so a click opens the column list
|
|
8390
8598
|
* directly. While some column is hidden the button carries a red dot.
|
|
8391
8599
|
*
|
|
8392
8600
|
* A set `viewMode` adds the list/block switch. The selected entry drops its border so both entries
|
|
@@ -8451,15 +8659,20 @@ class YuwsListToolbarActionsComponent {
|
|
|
8451
8659
|
...DEFAULT_VIEW_MODE_ICONS,
|
|
8452
8660
|
...this.viewModeIcons(),
|
|
8453
8661
|
}), ...(ngDevMode ? [{ debugName: "viewModeIconNames" }] : /* istanbul ignore next */ []));
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8662
|
+
this.visibleColumns = computed(() => {
|
|
8663
|
+
const hidden = new Set(this.hiddenColumns());
|
|
8664
|
+
return (this.hideableColumns() ?? []).map(({ value }) => value).filter((value) => !hidden.has(value));
|
|
8665
|
+
}, ...(ngDevMode ? [{ debugName: "visibleColumns" }] : /* istanbul ignore next */ []));
|
|
8457
8666
|
}
|
|
8458
8667
|
onViewModeClicked({ id }) {
|
|
8459
8668
|
this.viewMode.set(id);
|
|
8460
8669
|
}
|
|
8670
|
+
onVisibleColumnsChange(value) {
|
|
8671
|
+
const visible = new Set(Array.isArray(value) ? value : value ? [value] : []);
|
|
8672
|
+
this.hiddenColumns.set((this.hideableColumns() ?? []).map(({ value }) => value).filter((id) => !visible.has(id)));
|
|
8673
|
+
}
|
|
8461
8674
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsListToolbarActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8462
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsListToolbarActionsComponent, isStandalone: true, selector: "yuws-list-toolbar-actions", inputs: { hiddenColumns: { classPropertyName: "hiddenColumns", publicName: "hiddenColumns", isSignal: true, isRequired: false, transformFunction: null }, hideableColumns: { classPropertyName: "hideableColumns", publicName: "hideableColumns", isSignal: true, isRequired: false, transformFunction: null }, isMobile: { classPropertyName: "isMobile", publicName: "isMobile", isSignal: true, isRequired: true, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: true, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, shareSource: { classPropertyName: "shareSource", publicName: "shareSource", isSignal: true, isRequired: false, transformFunction: null }, shareTitle: { classPropertyName: "shareTitle", publicName: "shareTitle", isSignal: true, isRequired: false, transformFunction: null }, showExport: { classPropertyName: "showExport", publicName: "showExport", isSignal: true, isRequired: false, transformFunction: null }, viewMode: { classPropertyName: "viewMode", publicName: "viewMode", isSignal: true, isRequired: false, transformFunction: null }, viewModeIcons: { classPropertyName: "viewModeIcons", publicName: "viewModeIcons", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hiddenColumns: "hiddenColumnsChange", search: "searchChange", viewMode: "viewModeChange", exported: "exported", searched: "searched" }, host: { classAttribute: "flex items-center gap-2" }, providers: [provideIcons({ lucideDownload, lucideLayoutGrid, lucideList, lucideSearch, lucideSettings2 })], ngImport: i0, template: "@if (searchPlaceholder(); as placeholder) {\n @if (isMobile()) {\n <yuw-popover\n [align]=\"searchPopoverAlign()\"\n class=\"mr-5\"\n triggerVariant=\"outline\"\n triggerSize=\"icon\"\n panelClass=\"w-[min(20rem,calc(100vw-2rem))] p-2\"\n [offsetX]=\"searchPopoverOffsetX()\"\n [(open)]=\"searchOpen\"\n >\n <span yuwPopoverTrigger class=\"flex items-center\" [attr.aria-label]=\"labels().search.expand\">\n <ng-icon name=\"lucideSearch\" size=\"16\" />\n </span>\n\n <yuw-search-input\n expandedWidth=\"100%\"\n [(value)]=\"search\"\n [placeholder]=\"placeholder\"\n [clearAriaLabel]=\"labels().search.clear\"\n (searched)=\"searched.emit($event)\"\n />\n </yuw-popover>\n } @else {\n <yuw-search-input\n collapseFrom=\"right\"\n expandedWidth=\"18rem\"\n [(value)]=\"search\"\n [placeholder]=\"placeholder\"\n [clearAriaLabel]=\"labels().search.clear\"\n [expandAriaLabel]=\"labels().search.expand\"\n (searched)=\"searched.emit($event)\"\n />\n }\n}\n\n@if (showExport()) {\n <yuw-button variant=\"outline\" class=\"gap-2\" (clicked)=\"exported.emit($event)\">\n <ng-icon name=\"lucideDownload\" size=\"16\" />\n <span class=\"max-md:hidden\">\n {{ labels().export }}\n </span>\n </yuw-button>\n}\n\n@if (share(); as share) {\n <yuws-list-toolbar-share [labels]=\"share.labels\" [source]=\"share.source\" [title]=\"shareTitle()\" />\n}\n\n@if (hideableColumns(); as columns) {\n <div class=\"flex shrink-0\">\n <yuw-combobox\n multiple\n keepValueOnEscape\n triggerSize=\"icon\"\n triggerClass=\"relative\"\n [options]=\"columns\"\n [value]=\"
|
|
8675
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsListToolbarActionsComponent, isStandalone: true, selector: "yuws-list-toolbar-actions", inputs: { hiddenColumns: { classPropertyName: "hiddenColumns", publicName: "hiddenColumns", isSignal: true, isRequired: false, transformFunction: null }, hideableColumns: { classPropertyName: "hideableColumns", publicName: "hideableColumns", isSignal: true, isRequired: false, transformFunction: null }, isMobile: { classPropertyName: "isMobile", publicName: "isMobile", isSignal: true, isRequired: true, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: true, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, shareSource: { classPropertyName: "shareSource", publicName: "shareSource", isSignal: true, isRequired: false, transformFunction: null }, shareTitle: { classPropertyName: "shareTitle", publicName: "shareTitle", isSignal: true, isRequired: false, transformFunction: null }, showExport: { classPropertyName: "showExport", publicName: "showExport", isSignal: true, isRequired: false, transformFunction: null }, viewMode: { classPropertyName: "viewMode", publicName: "viewMode", isSignal: true, isRequired: false, transformFunction: null }, viewModeIcons: { classPropertyName: "viewModeIcons", publicName: "viewModeIcons", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hiddenColumns: "hiddenColumnsChange", search: "searchChange", viewMode: "viewModeChange", exported: "exported", searched: "searched" }, host: { classAttribute: "flex items-center gap-2" }, providers: [provideIcons({ lucideDownload, lucideLayoutGrid, lucideList, lucideSearch, lucideSettings2 })], ngImport: i0, template: "@if (searchPlaceholder(); as placeholder) {\n @if (isMobile()) {\n <yuw-popover\n [align]=\"searchPopoverAlign()\"\n class=\"mr-5\"\n triggerVariant=\"outline\"\n triggerSize=\"icon\"\n panelClass=\"w-[min(20rem,calc(100vw-2rem))] p-2\"\n [offsetX]=\"searchPopoverOffsetX()\"\n [(open)]=\"searchOpen\"\n >\n <span yuwPopoverTrigger class=\"flex items-center\" [attr.aria-label]=\"labels().search.expand\">\n <ng-icon name=\"lucideSearch\" size=\"16\" />\n </span>\n\n <yuw-search-input\n expandedWidth=\"100%\"\n [(value)]=\"search\"\n [placeholder]=\"placeholder\"\n [clearAriaLabel]=\"labels().search.clear\"\n (searched)=\"searched.emit($event)\"\n />\n </yuw-popover>\n } @else {\n <yuw-search-input\n collapseFrom=\"right\"\n expandedWidth=\"18rem\"\n [(value)]=\"search\"\n [placeholder]=\"placeholder\"\n [clearAriaLabel]=\"labels().search.clear\"\n [expandAriaLabel]=\"labels().search.expand\"\n (searched)=\"searched.emit($event)\"\n />\n }\n}\n\n@if (showExport()) {\n <yuw-button variant=\"outline\" class=\"gap-2\" (clicked)=\"exported.emit($event)\">\n <ng-icon name=\"lucideDownload\" size=\"16\" />\n <span class=\"max-md:hidden\">\n {{ labels().export }}\n </span>\n </yuw-button>\n}\n\n@if (share(); as share) {\n <yuws-list-toolbar-share [labels]=\"share.labels\" [source]=\"share.source\" [title]=\"shareTitle()\" />\n}\n\n@if (hideableColumns(); as columns) {\n <div class=\"flex shrink-0\">\n <yuw-combobox\n multiple\n keepValueOnEscape\n triggerSize=\"icon\"\n triggerClass=\"relative\"\n [options]=\"columns\"\n [value]=\"visibleColumns()\"\n [searchPlaceholder]=\"labels().columns.placeholder\"\n [emptyText]=\"labels().columns.empty\"\n [triggerAriaLabel]=\"labels().columns.trigger\"\n (valueChange)=\"onVisibleColumnsChange($event)\"\n >\n @if (labels().columns.title; as title) {\n <p yuwComboboxHeader class=\"px-2 pt-2 pb-1 text-sm text-muted-foreground\">{{ title }}</p>\n }\n\n <ng-template yuwComboboxTrigger>\n <ng-icon name=\"lucideSettings2\" size=\"16\" />\n\n @if (hasHiddenColumns()) {\n <yuw-badge\n dot\n color=\"destructive\"\n class=\"absolute -top-1 -right-1\"\n style=\"width: 0.5rem; height: 0.5rem\"\n data-testid=\"hidden-columns-dot\"\n />\n }\n </ng-template>\n </yuw-combobox>\n </div>\n}\n\n@if (viewMode()) {\n <yuw-button-group\n variant=\"outline\"\n selectedVariant=\"secondary\"\n selectedColor=\"secondary\"\n [buttons]=\"viewModeButtons()\"\n (buttonClicked)=\"onViewModeClicked($event)\"\n >\n <ng-template yuwButtonGroupContent=\"list\">\n <ng-icon [name]=\"viewModeIconNames().list\" size=\"16\" />\n </ng-template>\n <ng-template yuwButtonGroupContent=\"block\">\n <ng-icon [name]=\"viewModeIconNames().block\" size=\"16\" />\n </ng-template>\n </yuw-button-group>\n}\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "component", type: YuwBadgeComponent, selector: "yuw-badge", inputs: ["color", "dot", "removeLabel", "variant"], outputs: ["removed"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }, { kind: "component", type: YuwButtonGroupComponent, selector: "yuw-button-group", inputs: ["ariaLabel", "buttons", "color", "orientation", "selectedColor", "selectedVariant", "size", "variant"], outputs: ["buttonClicked"] }, { kind: "directive", type: YuwButtonGroupContentDirective, selector: "ng-template[yuwButtonGroupContent]", inputs: ["yuwButtonGroupContent"] }, { kind: "component", type: YuwComboboxComponent, selector: "yuw-combobox", inputs: ["clearAriaLabel", "emptyText", "helperText", "inputId", "invalid", "keepValueOnEscape", "multiple", "options", "placeholder", "readonlyTrigger", "search", "searchPlaceholder", "size", "triggerAriaLabel", "triggerClass", "triggerColor", "triggerSize", "triggerVariant", "value"], outputs: ["searchChange", "valueChange"] }, { kind: "directive", type: YuwComboboxTriggerDirective, selector: "ng-template[yuwComboboxTrigger]" }, { kind: "component", type: YuwPopoverComponent, selector: "yuw-popover", inputs: ["align", "description", "offsetX", "open", "panelClass", "showTrigger", "sideOffset", "title", "triggerClass", "triggerColor", "triggerSize", "triggerTransparent", "triggerVariant"], outputs: ["openChange"] }, { kind: "component", type: YuwSearchInputComponent, selector: "yuw-search-input", inputs: ["clearAriaLabel", "collapseFrom", "expandAriaLabel", "expandedWidth", "size", "transparent"], outputs: ["searched"] }, { kind: "component", type: YuwsListToolbarShareComponent, selector: "yuws-list-toolbar-share", inputs: ["labels", "source", "title"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8463
8676
|
}
|
|
8464
8677
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsListToolbarActionsComponent, decorators: [{
|
|
8465
8678
|
type: Component,
|
|
@@ -8474,7 +8687,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
8474
8687
|
YuwPopoverComponent,
|
|
8475
8688
|
YuwSearchInputComponent,
|
|
8476
8689
|
YuwsListToolbarShareComponent,
|
|
8477
|
-
], providers: [provideIcons({ lucideDownload, lucideLayoutGrid, lucideList, lucideSearch, lucideSettings2 })], host: { class: 'flex items-center gap-2' }, template: "@if (searchPlaceholder(); as placeholder) {\n @if (isMobile()) {\n <yuw-popover\n [align]=\"searchPopoverAlign()\"\n class=\"mr-5\"\n triggerVariant=\"outline\"\n triggerSize=\"icon\"\n panelClass=\"w-[min(20rem,calc(100vw-2rem))] p-2\"\n [offsetX]=\"searchPopoverOffsetX()\"\n [(open)]=\"searchOpen\"\n >\n <span yuwPopoverTrigger class=\"flex items-center\" [attr.aria-label]=\"labels().search.expand\">\n <ng-icon name=\"lucideSearch\" size=\"16\" />\n </span>\n\n <yuw-search-input\n expandedWidth=\"100%\"\n [(value)]=\"search\"\n [placeholder]=\"placeholder\"\n [clearAriaLabel]=\"labels().search.clear\"\n (searched)=\"searched.emit($event)\"\n />\n </yuw-popover>\n } @else {\n <yuw-search-input\n collapseFrom=\"right\"\n expandedWidth=\"18rem\"\n [(value)]=\"search\"\n [placeholder]=\"placeholder\"\n [clearAriaLabel]=\"labels().search.clear\"\n [expandAriaLabel]=\"labels().search.expand\"\n (searched)=\"searched.emit($event)\"\n />\n }\n}\n\n@if (showExport()) {\n <yuw-button variant=\"outline\" class=\"gap-2\" (clicked)=\"exported.emit($event)\">\n <ng-icon name=\"lucideDownload\" size=\"16\" />\n <span class=\"max-md:hidden\">\n {{ labels().export }}\n </span>\n </yuw-button>\n}\n\n@if (share(); as share) {\n <yuws-list-toolbar-share [labels]=\"share.labels\" [source]=\"share.source\" [title]=\"shareTitle()\" />\n}\n\n@if (hideableColumns(); as columns) {\n <div class=\"flex shrink-0\">\n <yuw-combobox\n multiple\n keepValueOnEscape\n triggerSize=\"icon\"\n triggerClass=\"relative\"\n [options]=\"columns\"\n [value]=\"
|
|
8690
|
+
], providers: [provideIcons({ lucideDownload, lucideLayoutGrid, lucideList, lucideSearch, lucideSettings2 })], host: { class: 'flex items-center gap-2' }, template: "@if (searchPlaceholder(); as placeholder) {\n @if (isMobile()) {\n <yuw-popover\n [align]=\"searchPopoverAlign()\"\n class=\"mr-5\"\n triggerVariant=\"outline\"\n triggerSize=\"icon\"\n panelClass=\"w-[min(20rem,calc(100vw-2rem))] p-2\"\n [offsetX]=\"searchPopoverOffsetX()\"\n [(open)]=\"searchOpen\"\n >\n <span yuwPopoverTrigger class=\"flex items-center\" [attr.aria-label]=\"labels().search.expand\">\n <ng-icon name=\"lucideSearch\" size=\"16\" />\n </span>\n\n <yuw-search-input\n expandedWidth=\"100%\"\n [(value)]=\"search\"\n [placeholder]=\"placeholder\"\n [clearAriaLabel]=\"labels().search.clear\"\n (searched)=\"searched.emit($event)\"\n />\n </yuw-popover>\n } @else {\n <yuw-search-input\n collapseFrom=\"right\"\n expandedWidth=\"18rem\"\n [(value)]=\"search\"\n [placeholder]=\"placeholder\"\n [clearAriaLabel]=\"labels().search.clear\"\n [expandAriaLabel]=\"labels().search.expand\"\n (searched)=\"searched.emit($event)\"\n />\n }\n}\n\n@if (showExport()) {\n <yuw-button variant=\"outline\" class=\"gap-2\" (clicked)=\"exported.emit($event)\">\n <ng-icon name=\"lucideDownload\" size=\"16\" />\n <span class=\"max-md:hidden\">\n {{ labels().export }}\n </span>\n </yuw-button>\n}\n\n@if (share(); as share) {\n <yuws-list-toolbar-share [labels]=\"share.labels\" [source]=\"share.source\" [title]=\"shareTitle()\" />\n}\n\n@if (hideableColumns(); as columns) {\n <div class=\"flex shrink-0\">\n <yuw-combobox\n multiple\n keepValueOnEscape\n triggerSize=\"icon\"\n triggerClass=\"relative\"\n [options]=\"columns\"\n [value]=\"visibleColumns()\"\n [searchPlaceholder]=\"labels().columns.placeholder\"\n [emptyText]=\"labels().columns.empty\"\n [triggerAriaLabel]=\"labels().columns.trigger\"\n (valueChange)=\"onVisibleColumnsChange($event)\"\n >\n @if (labels().columns.title; as title) {\n <p yuwComboboxHeader class=\"px-2 pt-2 pb-1 text-sm text-muted-foreground\">{{ title }}</p>\n }\n\n <ng-template yuwComboboxTrigger>\n <ng-icon name=\"lucideSettings2\" size=\"16\" />\n\n @if (hasHiddenColumns()) {\n <yuw-badge\n dot\n color=\"destructive\"\n class=\"absolute -top-1 -right-1\"\n style=\"width: 0.5rem; height: 0.5rem\"\n data-testid=\"hidden-columns-dot\"\n />\n }\n </ng-template>\n </yuw-combobox>\n </div>\n}\n\n@if (viewMode()) {\n <yuw-button-group\n variant=\"outline\"\n selectedVariant=\"secondary\"\n selectedColor=\"secondary\"\n [buttons]=\"viewModeButtons()\"\n (buttonClicked)=\"onViewModeClicked($event)\"\n >\n <ng-template yuwButtonGroupContent=\"list\">\n <ng-icon [name]=\"viewModeIconNames().list\" size=\"16\" />\n </ng-template>\n <ng-template yuwButtonGroupContent=\"block\">\n <ng-icon [name]=\"viewModeIconNames().block\" size=\"16\" />\n </ng-template>\n </yuw-button-group>\n}\n" }]
|
|
8478
8691
|
}], propDecorators: { hiddenColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenColumns", required: false }] }, { type: i0.Output, args: ["hiddenColumnsChange"] }], hideableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideableColumns", required: false }] }], isMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "isMobile", required: true }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: true }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }, { type: i0.Output, args: ["searchChange"] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], shareSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "shareSource", required: false }] }], shareTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "shareTitle", required: false }] }], showExport: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExport", required: false }] }], viewMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewMode", required: false }] }, { type: i0.Output, args: ["viewModeChange"] }], viewModeIcons: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewModeIcons", required: false }] }], exported: [{ type: i0.Output, args: ["exported"] }], searched: [{ type: i0.Output, args: ["searched"] }] } });
|
|
8479
8692
|
|
|
8480
8693
|
/** Number of selected values across every group, not the number of groups. */
|
|
@@ -8893,7 +9106,7 @@ class YuwsListToolbarFiltersComponent {
|
|
|
8893
9106
|
filter?.querySelector('button, input, [tabindex]')?.focus();
|
|
8894
9107
|
}
|
|
8895
9108
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsListToolbarFiltersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8896
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsListToolbarFiltersComponent, isStandalone: true, selector: "yuws-list-toolbar-filters", inputs: { contents: { classPropertyName: "contents", publicName: "contents", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: true, transformFunction: null }, idleColor: { classPropertyName: "idleColor", publicName: "idleColor", isSignal: true, isRequired: true, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: true, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, sets: { classPropertyName: "sets", publicName: "sets", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", setDeleted: "setDeleted", setRenamed: "setRenamed", setSaved: "setSaved" }, host: { classAttribute: "flex min-w-0 max-w-full flex-1 max-md:contents" }, providers: [provideIcons({ lucidePlus, lucideX })], viewQueries: [{ propertyName: "_addBox", first: true, predicate: ["addBox"], descendants: true, isSignal: true }], ngImport: i0, template: "<fieldset class=\"m-0 flex min-w-0 flex-1 items-center gap-2 border-0 p-0 max-md:contents\" [disabled]=\"disabled()\">\n <legend class=\"sr-only\">{{ labels().title }}</legend>\n\n <!-- Saved sets -->\n @if (setLabels(); as setLabels) {\n <yuws-list-toolbar-filter-set-picker\n [idleColor]=\"idleColor()\"\n [labels]=\"setLabels\"\n [sets]=\"sets() ?? []\"\n [selection]=\"selection()\"\n (selectionChange)=\"onSetApplied($event)\"\n (setDeleted)=\"setDeleted.emit($event)\"\n (setRenamed)=\"setRenamed.emit($event)\"\n (setSaved)=\"setSaved.emit($event)\"\n />\n }\n\n <!-- Add filter -->\n <yuw-combobox\n #addBox\n multiple\n keepValueOnEscape\n triggerVariant=\"default\"\n triggerColor=\"secondary\"\n triggerClass=\"shrink-0 gap-1.5\"\n [options]=\"addOptions()\"\n [value]=\"addValue()\"\n [emptyText]=\"labels().empty\"\n [triggerAriaLabel]=\"labels().add\"\n (valueChange)=\"onActiveChange($event)\"\n >\n <ng-template yuwComboboxTrigger>\n <ng-icon name=\"lucidePlus\" size=\"16\" />\n <span class=\"whitespace-nowrap max-md:hidden\">{{ labels().add }}</span>\n </ng-template>\n\n @if (activeGroups().length > 0) {\n <div yuwComboboxFooter class=\"border-t p-1\">\n <yuw-button variant=\"ghost\" size=\"sm\" class=\"w-full [&>button]:w-full\" (clicked)=\"onClearAll()\">\n <span class=\"truncate\">{{ labels().clearAll }}</span>\n </yuw-button>\n </div>\n }\n </yuw-combobox>\n\n <!-- Active filters -->\n @if (activeGroups().length > 0) {\n <div\n yuwMouseScrollX\n class=\"-my-1 flex min-w-0 flex-1 items-center gap-2 overflow-x-auto contain-inline-size px-px py-1 scroll-fade-x max-md:order-last max-md:basis-full [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n >\n @for (group of activeGroups(); track group.id) {\n <div\n class=\"flex shrink-0 items-center\"\n [class]=\"weldClass\"\n [attr.data-filter-id]=\"group.id\"\n data-testid=\"active-filter\"\n >\n @if (contentTemplates()[group.id]; as content) {\n <ng-container\n [ngTemplateOutlet]=\"content\"\n [ngTemplateOutletContext]=\"{\n $implicit: group,\n value: selection()[group.id],\n change: changers()[group.id],\n }\"\n />\n } @else if (dates()[group.id]; as date) {\n <yuw-datepicker\n #picker\n triggerVariant=\"secondary\"\n class=\"max-w-80 gap-1.5\"\n [triggerColor]=\"idleColor()\"\n [mode]=\"date.mode\"\n [value]=\"date.value\"\n [presetId]=\"date.presetId\"\n [presets]=\"group.presets ?? []\"\n [presetsLabel]=\"labels().datePresets\"\n (valueChange)=\"onDateChange(group.id, $event, picker.presetId())\"\n >\n <ng-template yuwDatepickerTrigger let-summary>\n <span class=\"whitespace-nowrap font-semibold\">{{ group.label }}</span>\n\n @if (summary) {\n <span class=\"min-w-0 truncate font-normal\">{{ summary }}</span>\n }\n </ng-template>\n </yuw-datepicker>\n } @else {\n <yuw-combobox\n keepValueOnEscape\n triggerVariant=\"secondary\"\n triggerClass=\"max-w-80 gap-1.5\"\n [triggerColor]=\"idleColor()\"\n [multiple]=\"group.mode === 'multiple'\"\n [options]=\"options()[group.id]\"\n [value]=\"values()[group.id]\"\n [emptyText]=\"labels().empty\"\n [triggerAriaLabel]=\"group.label\"\n (valueChange)=\"onValueChange(group.id, $event)\"\n >\n <ng-template yuwComboboxTrigger let-summary>\n <span class=\"whitespace-nowrap font-semibold\">{{ group.label }}</span>\n\n @if (summary) {\n <span class=\"min-w-0 truncate font-normal\">{{ summary }}</span>\n }\n </ng-template>\n </yuw-combobox>\n }\n\n <yuw-button\n variant=\"secondary\"\n size=\"icon\"\n class=\"w-8 rounded-s-none\"\n [color]=\"idleColor()\"\n [ariaLabel]=\"labels().remove\"\n (clicked)=\"onRemoved(group.id)\"\n >\n <ng-icon name=\"lucideX\" size=\"14\" />\n </yuw-button>\n </div>\n }\n </div>\n }\n</fieldset>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }, { kind: "component", type: YuwComboboxComponent, selector: "yuw-combobox", inputs: ["clearAriaLabel", "emptyText", "helperText", "inputId", "invalid", "keepValueOnEscape", "multiple", "options", "placeholder", "readonlyTrigger", "search", "searchPlaceholder", "size", "triggerAriaLabel", "triggerClass", "triggerColor", "triggerSize", "triggerVariant", "value"], outputs: ["searchChange", "valueChange"] }, { kind: "directive", type: YuwComboboxTriggerDirective, selector: "ng-template[yuwComboboxTrigger]" }, { kind: "component", type: YuwDatepickerComponent, selector: "yuw-datepicker", inputs: ["align", "buttonId", "captionLayout", "formatDate", "helperText", "invalid", "maxDate", "minDate", "mode", "placeholder", "presetId", "presets", "presetsLabel", "size", "triggerColor", "triggerVariant", "class", "value"], outputs: ["presetIdChange", "valueChange"] }, { kind: "directive", type: YuwDatepickerTriggerDirective, selector: "ng-template[yuwDatepickerTrigger]" }, { kind: "component", type: YuwsListToolbarFilterSetPickerComponent, selector: "yuws-list-toolbar-filter-set-picker", inputs: ["idleColor", "labels", "selection", "sets"], outputs: ["selectionChange", "setDeleted", "setRenamed", "setSaved"] }, { kind: "directive", type: YuwMouseScrollXDirective, selector: "[yuwMouseScrollX]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9109
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsListToolbarFiltersComponent, isStandalone: true, selector: "yuws-list-toolbar-filters", inputs: { contents: { classPropertyName: "contents", publicName: "contents", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: true, transformFunction: null }, idleColor: { classPropertyName: "idleColor", publicName: "idleColor", isSignal: true, isRequired: true, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: true, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, sets: { classPropertyName: "sets", publicName: "sets", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", setDeleted: "setDeleted", setRenamed: "setRenamed", setSaved: "setSaved" }, host: { classAttribute: "flex min-w-0 max-w-full flex-1 max-md:contents" }, providers: [provideIcons({ lucidePlus, lucideX })], viewQueries: [{ propertyName: "_addBox", first: true, predicate: ["addBox"], descendants: true, isSignal: true }], ngImport: i0, template: "<fieldset class=\"m-0 flex min-w-0 flex-1 items-center gap-2 border-0 p-0 max-md:contents\" [disabled]=\"disabled()\">\n <legend class=\"sr-only\">{{ labels().title }}</legend>\n\n <!-- Saved sets -->\n @if (setLabels(); as setLabels) {\n <yuws-list-toolbar-filter-set-picker\n [idleColor]=\"idleColor()\"\n [labels]=\"setLabels\"\n [sets]=\"sets() ?? []\"\n [selection]=\"selection()\"\n (selectionChange)=\"onSetApplied($event)\"\n (setDeleted)=\"setDeleted.emit($event)\"\n (setRenamed)=\"setRenamed.emit($event)\"\n (setSaved)=\"setSaved.emit($event)\"\n />\n }\n\n <!-- Add filter -->\n <yuw-combobox\n #addBox\n multiple\n keepValueOnEscape\n triggerVariant=\"default\"\n triggerColor=\"secondary\"\n triggerClass=\"shrink-0 gap-1.5\"\n [options]=\"addOptions()\"\n [value]=\"addValue()\"\n [searchPlaceholder]=\"labels().search\"\n [emptyText]=\"labels().empty\"\n [triggerAriaLabel]=\"labels().add\"\n (valueChange)=\"onActiveChange($event)\"\n >\n <ng-template yuwComboboxTrigger>\n <ng-icon name=\"lucidePlus\" size=\"16\" />\n <span class=\"whitespace-nowrap max-md:hidden\">{{ labels().add }}</span>\n </ng-template>\n\n @if (activeGroups().length > 0) {\n <div yuwComboboxFooter class=\"border-t p-1\">\n <yuw-button variant=\"ghost\" size=\"sm\" class=\"w-full [&>button]:w-full\" (clicked)=\"onClearAll()\">\n <span class=\"truncate\">{{ labels().clearAll }}</span>\n </yuw-button>\n </div>\n }\n </yuw-combobox>\n\n <!-- Active filters -->\n @if (activeGroups().length > 0) {\n <div\n yuwMouseScrollX\n class=\"-my-1 flex min-w-0 flex-1 items-center gap-2 overflow-x-auto contain-inline-size px-px py-1 scroll-fade-x max-md:order-last max-md:basis-full [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n >\n @for (group of activeGroups(); track group.id) {\n <div\n class=\"flex shrink-0 items-center\"\n [class]=\"weldClass\"\n [attr.data-filter-id]=\"group.id\"\n data-testid=\"active-filter\"\n >\n @if (contentTemplates()[group.id]; as content) {\n <ng-container\n [ngTemplateOutlet]=\"content\"\n [ngTemplateOutletContext]=\"{\n $implicit: group,\n value: selection()[group.id],\n change: changers()[group.id],\n }\"\n />\n } @else if (dates()[group.id]; as date) {\n <yuw-datepicker\n #picker\n triggerVariant=\"secondary\"\n class=\"max-w-80 gap-1.5\"\n [triggerColor]=\"idleColor()\"\n [mode]=\"date.mode\"\n [value]=\"date.value\"\n [presetId]=\"date.presetId\"\n [presets]=\"group.presets ?? []\"\n [presetsLabel]=\"labels().datePresets\"\n (valueChange)=\"onDateChange(group.id, $event, picker.presetId())\"\n >\n <ng-template yuwDatepickerTrigger let-summary>\n <span class=\"whitespace-nowrap font-semibold\">{{ group.label }}</span>\n\n @if (summary) {\n <span class=\"min-w-0 truncate font-normal\">{{ summary }}</span>\n }\n </ng-template>\n </yuw-datepicker>\n } @else {\n <yuw-combobox\n keepValueOnEscape\n triggerVariant=\"secondary\"\n triggerClass=\"max-w-80 gap-1.5\"\n [triggerColor]=\"idleColor()\"\n [multiple]=\"group.mode === 'multiple'\"\n [options]=\"options()[group.id]\"\n [searchPlaceholder]=\"group.label\"\n [value]=\"values()[group.id]\"\n [emptyText]=\"labels().empty\"\n [triggerAriaLabel]=\"group.label\"\n (valueChange)=\"onValueChange(group.id, $event)\"\n >\n <ng-template yuwComboboxTrigger let-summary>\n <span class=\"whitespace-nowrap font-semibold\">{{ group.label }}</span>\n\n @if (summary) {\n <span class=\"min-w-0 truncate font-normal\">{{ summary }}</span>\n }\n </ng-template>\n </yuw-combobox>\n }\n\n <yuw-button\n variant=\"secondary\"\n size=\"icon\"\n class=\"w-8 rounded-s-none\"\n [color]=\"idleColor()\"\n [ariaLabel]=\"labels().remove\"\n (clicked)=\"onRemoved(group.id)\"\n >\n <ng-icon name=\"lucideX\" size=\"14\" />\n </yuw-button>\n </div>\n }\n </div>\n }\n</fieldset>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }, { kind: "component", type: YuwComboboxComponent, selector: "yuw-combobox", inputs: ["clearAriaLabel", "emptyText", "helperText", "inputId", "invalid", "keepValueOnEscape", "multiple", "options", "placeholder", "readonlyTrigger", "search", "searchPlaceholder", "size", "triggerAriaLabel", "triggerClass", "triggerColor", "triggerSize", "triggerVariant", "value"], outputs: ["searchChange", "valueChange"] }, { kind: "directive", type: YuwComboboxTriggerDirective, selector: "ng-template[yuwComboboxTrigger]" }, { kind: "component", type: YuwDatepickerComponent, selector: "yuw-datepicker", inputs: ["align", "buttonId", "captionLayout", "formatDate", "helperText", "invalid", "maxDate", "minDate", "mode", "placeholder", "presetId", "presets", "presetsLabel", "size", "triggerColor", "triggerVariant", "class", "value"], outputs: ["presetIdChange", "valueChange"] }, { kind: "directive", type: YuwDatepickerTriggerDirective, selector: "ng-template[yuwDatepickerTrigger]" }, { kind: "component", type: YuwsListToolbarFilterSetPickerComponent, selector: "yuws-list-toolbar-filter-set-picker", inputs: ["idleColor", "labels", "selection", "sets"], outputs: ["selectionChange", "setDeleted", "setRenamed", "setSaved"] }, { kind: "directive", type: YuwMouseScrollXDirective, selector: "[yuwMouseScrollX]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8897
9110
|
}
|
|
8898
9111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsListToolbarFiltersComponent, decorators: [{
|
|
8899
9112
|
type: Component,
|
|
@@ -8907,7 +9120,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
8907
9120
|
YuwDatepickerTriggerDirective,
|
|
8908
9121
|
YuwsListToolbarFilterSetPickerComponent,
|
|
8909
9122
|
YuwMouseScrollXDirective,
|
|
8910
|
-
], providers: [provideIcons({ lucidePlus, lucideX })], host: { class: 'flex min-w-0 max-w-full flex-1 max-md:contents' }, template: "<fieldset class=\"m-0 flex min-w-0 flex-1 items-center gap-2 border-0 p-0 max-md:contents\" [disabled]=\"disabled()\">\n <legend class=\"sr-only\">{{ labels().title }}</legend>\n\n <!-- Saved sets -->\n @if (setLabels(); as setLabels) {\n <yuws-list-toolbar-filter-set-picker\n [idleColor]=\"idleColor()\"\n [labels]=\"setLabels\"\n [sets]=\"sets() ?? []\"\n [selection]=\"selection()\"\n (selectionChange)=\"onSetApplied($event)\"\n (setDeleted)=\"setDeleted.emit($event)\"\n (setRenamed)=\"setRenamed.emit($event)\"\n (setSaved)=\"setSaved.emit($event)\"\n />\n }\n\n <!-- Add filter -->\n <yuw-combobox\n #addBox\n multiple\n keepValueOnEscape\n triggerVariant=\"default\"\n triggerColor=\"secondary\"\n triggerClass=\"shrink-0 gap-1.5\"\n [options]=\"addOptions()\"\n [value]=\"addValue()\"\n [emptyText]=\"labels().empty\"\n [triggerAriaLabel]=\"labels().add\"\n (valueChange)=\"onActiveChange($event)\"\n >\n <ng-template yuwComboboxTrigger>\n <ng-icon name=\"lucidePlus\" size=\"16\" />\n <span class=\"whitespace-nowrap max-md:hidden\">{{ labels().add }}</span>\n </ng-template>\n\n @if (activeGroups().length > 0) {\n <div yuwComboboxFooter class=\"border-t p-1\">\n <yuw-button variant=\"ghost\" size=\"sm\" class=\"w-full [&>button]:w-full\" (clicked)=\"onClearAll()\">\n <span class=\"truncate\">{{ labels().clearAll }}</span>\n </yuw-button>\n </div>\n }\n </yuw-combobox>\n\n <!-- Active filters -->\n @if (activeGroups().length > 0) {\n <div\n yuwMouseScrollX\n class=\"-my-1 flex min-w-0 flex-1 items-center gap-2 overflow-x-auto contain-inline-size px-px py-1 scroll-fade-x max-md:order-last max-md:basis-full [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n >\n @for (group of activeGroups(); track group.id) {\n <div\n class=\"flex shrink-0 items-center\"\n [class]=\"weldClass\"\n [attr.data-filter-id]=\"group.id\"\n data-testid=\"active-filter\"\n >\n @if (contentTemplates()[group.id]; as content) {\n <ng-container\n [ngTemplateOutlet]=\"content\"\n [ngTemplateOutletContext]=\"{\n $implicit: group,\n value: selection()[group.id],\n change: changers()[group.id],\n }\"\n />\n } @else if (dates()[group.id]; as date) {\n <yuw-datepicker\n #picker\n triggerVariant=\"secondary\"\n class=\"max-w-80 gap-1.5\"\n [triggerColor]=\"idleColor()\"\n [mode]=\"date.mode\"\n [value]=\"date.value\"\n [presetId]=\"date.presetId\"\n [presets]=\"group.presets ?? []\"\n [presetsLabel]=\"labels().datePresets\"\n (valueChange)=\"onDateChange(group.id, $event, picker.presetId())\"\n >\n <ng-template yuwDatepickerTrigger let-summary>\n <span class=\"whitespace-nowrap font-semibold\">{{ group.label }}</span>\n\n @if (summary) {\n <span class=\"min-w-0 truncate font-normal\">{{ summary }}</span>\n }\n </ng-template>\n </yuw-datepicker>\n } @else {\n <yuw-combobox\n keepValueOnEscape\n triggerVariant=\"secondary\"\n triggerClass=\"max-w-80 gap-1.5\"\n [triggerColor]=\"idleColor()\"\n [multiple]=\"group.mode === 'multiple'\"\n [options]=\"options()[group.id]\"\n [value]=\"values()[group.id]\"\n [emptyText]=\"labels().empty\"\n [triggerAriaLabel]=\"group.label\"\n (valueChange)=\"onValueChange(group.id, $event)\"\n >\n <ng-template yuwComboboxTrigger let-summary>\n <span class=\"whitespace-nowrap font-semibold\">{{ group.label }}</span>\n\n @if (summary) {\n <span class=\"min-w-0 truncate font-normal\">{{ summary }}</span>\n }\n </ng-template>\n </yuw-combobox>\n }\n\n <yuw-button\n variant=\"secondary\"\n size=\"icon\"\n class=\"w-8 rounded-s-none\"\n [color]=\"idleColor()\"\n [ariaLabel]=\"labels().remove\"\n (clicked)=\"onRemoved(group.id)\"\n >\n <ng-icon name=\"lucideX\" size=\"14\" />\n </yuw-button>\n </div>\n }\n </div>\n }\n</fieldset>\n" }]
|
|
9123
|
+
], providers: [provideIcons({ lucidePlus, lucideX })], host: { class: 'flex min-w-0 max-w-full flex-1 max-md:contents' }, template: "<fieldset class=\"m-0 flex min-w-0 flex-1 items-center gap-2 border-0 p-0 max-md:contents\" [disabled]=\"disabled()\">\n <legend class=\"sr-only\">{{ labels().title }}</legend>\n\n <!-- Saved sets -->\n @if (setLabels(); as setLabels) {\n <yuws-list-toolbar-filter-set-picker\n [idleColor]=\"idleColor()\"\n [labels]=\"setLabels\"\n [sets]=\"sets() ?? []\"\n [selection]=\"selection()\"\n (selectionChange)=\"onSetApplied($event)\"\n (setDeleted)=\"setDeleted.emit($event)\"\n (setRenamed)=\"setRenamed.emit($event)\"\n (setSaved)=\"setSaved.emit($event)\"\n />\n }\n\n <!-- Add filter -->\n <yuw-combobox\n #addBox\n multiple\n keepValueOnEscape\n triggerVariant=\"default\"\n triggerColor=\"secondary\"\n triggerClass=\"shrink-0 gap-1.5\"\n [options]=\"addOptions()\"\n [value]=\"addValue()\"\n [searchPlaceholder]=\"labels().search\"\n [emptyText]=\"labels().empty\"\n [triggerAriaLabel]=\"labels().add\"\n (valueChange)=\"onActiveChange($event)\"\n >\n <ng-template yuwComboboxTrigger>\n <ng-icon name=\"lucidePlus\" size=\"16\" />\n <span class=\"whitespace-nowrap max-md:hidden\">{{ labels().add }}</span>\n </ng-template>\n\n @if (activeGroups().length > 0) {\n <div yuwComboboxFooter class=\"border-t p-1\">\n <yuw-button variant=\"ghost\" size=\"sm\" class=\"w-full [&>button]:w-full\" (clicked)=\"onClearAll()\">\n <span class=\"truncate\">{{ labels().clearAll }}</span>\n </yuw-button>\n </div>\n }\n </yuw-combobox>\n\n <!-- Active filters -->\n @if (activeGroups().length > 0) {\n <div\n yuwMouseScrollX\n class=\"-my-1 flex min-w-0 flex-1 items-center gap-2 overflow-x-auto contain-inline-size px-px py-1 scroll-fade-x max-md:order-last max-md:basis-full [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n >\n @for (group of activeGroups(); track group.id) {\n <div\n class=\"flex shrink-0 items-center\"\n [class]=\"weldClass\"\n [attr.data-filter-id]=\"group.id\"\n data-testid=\"active-filter\"\n >\n @if (contentTemplates()[group.id]; as content) {\n <ng-container\n [ngTemplateOutlet]=\"content\"\n [ngTemplateOutletContext]=\"{\n $implicit: group,\n value: selection()[group.id],\n change: changers()[group.id],\n }\"\n />\n } @else if (dates()[group.id]; as date) {\n <yuw-datepicker\n #picker\n triggerVariant=\"secondary\"\n class=\"max-w-80 gap-1.5\"\n [triggerColor]=\"idleColor()\"\n [mode]=\"date.mode\"\n [value]=\"date.value\"\n [presetId]=\"date.presetId\"\n [presets]=\"group.presets ?? []\"\n [presetsLabel]=\"labels().datePresets\"\n (valueChange)=\"onDateChange(group.id, $event, picker.presetId())\"\n >\n <ng-template yuwDatepickerTrigger let-summary>\n <span class=\"whitespace-nowrap font-semibold\">{{ group.label }}</span>\n\n @if (summary) {\n <span class=\"min-w-0 truncate font-normal\">{{ summary }}</span>\n }\n </ng-template>\n </yuw-datepicker>\n } @else {\n <yuw-combobox\n keepValueOnEscape\n triggerVariant=\"secondary\"\n triggerClass=\"max-w-80 gap-1.5\"\n [triggerColor]=\"idleColor()\"\n [multiple]=\"group.mode === 'multiple'\"\n [options]=\"options()[group.id]\"\n [searchPlaceholder]=\"group.label\"\n [value]=\"values()[group.id]\"\n [emptyText]=\"labels().empty\"\n [triggerAriaLabel]=\"group.label\"\n (valueChange)=\"onValueChange(group.id, $event)\"\n >\n <ng-template yuwComboboxTrigger let-summary>\n <span class=\"whitespace-nowrap font-semibold\">{{ group.label }}</span>\n\n @if (summary) {\n <span class=\"min-w-0 truncate font-normal\">{{ summary }}</span>\n }\n </ng-template>\n </yuw-combobox>\n }\n\n <yuw-button\n variant=\"secondary\"\n size=\"icon\"\n class=\"w-8 rounded-s-none\"\n [color]=\"idleColor()\"\n [ariaLabel]=\"labels().remove\"\n (clicked)=\"onRemoved(group.id)\"\n >\n <ng-icon name=\"lucideX\" size=\"14\" />\n </yuw-button>\n </div>\n }\n </div>\n }\n</fieldset>\n" }]
|
|
8911
9124
|
}], propDecorators: { _addBox: [{ type: i0.ViewChild, args: ['addBox', { isSignal: true }] }], contents: [{ type: i0.Input, args: [{ isSignal: true, alias: "contents", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], groups: [{ type: i0.Input, args: [{ isSignal: true, alias: "groups", required: true }] }], idleColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "idleColor", required: true }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: true }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], sets: [{ type: i0.Input, args: [{ isSignal: true, alias: "sets", required: false }] }], setDeleted: [{ type: i0.Output, args: ["setDeleted"] }], setRenamed: [{ type: i0.Output, args: ["setRenamed"] }], setSaved: [{ type: i0.Output, args: ["setSaved"] }] } });
|
|
8912
9125
|
|
|
8913
9126
|
/**
|
|
@@ -9078,5 +9291,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
9078
9291
|
* Generated bundle index. Do not edit.
|
|
9079
9292
|
*/
|
|
9080
9293
|
|
|
9081
|
-
export { DATATABLE_ALIGN_CLASS, DATATABLE_LAYOUT_CLASS, DATATABLE_WRAP_CONTENT_CLASS, YUWS_NO_DATA_PLACEHOLDER, YUW_DATATABLE_FEATURES, YUW_DATATABLE_WRAP_MIN_WIDTH, YUW_DATE_RANGES, YUW_PASSWORD_REVEAL_STATES, YUW_SIDEBAR_RAIL_ICON_SIZE, YUW_SIDEBAR_RAIL_PADDING, YUW_SIDEBAR_RAIL_WIDTH, YUW_TABLE_SHARE_FORMATS, YuwAccordion, YuwAccordionContentComponent, YuwAccordionImports, YuwAccordionItem, YuwAccordionTriggerComponent, YuwActionsCellComponent, YuwAlertActionDirective, YuwAlertComponent, YuwAlertDescriptionDirective, YuwAlertDialogComponent, YuwAlertDialogMediaDirective, YuwAlertDialogTriggerDirective, YuwAlertImports, YuwAlertTitleDirective, YuwAttachmentActionDirective, YuwAttachmentActionsDirective, YuwAttachmentContentDirective, YuwAttachmentDescriptionDirective, YuwAttachmentDirective, YuwAttachmentGroupDirective, YuwAttachmentMediaDirective, YuwAttachmentTitleDirective, YuwAttachmentTriggerDirective, YuwAvatarComponent, YuwBadgeComponent, YuwBreadcrumbComponent, YuwBreadcrumbTrailService, YuwButtonComponent, YuwButtonGroupComponent, YuwButtonGroupContentDirective, YuwCalendarComponent, YuwCaptionDirective, YuwCardActionDirective, YuwCardContentDirective, YuwCardDescriptionDirective, YuwCardDirective, YuwCardFooterDirective, YuwCardHeaderDirective, YuwCardImports, YuwCardTitleDirective, YuwCheckboxComponent, YuwClassDirective, YuwComboboxComponent, YuwComboboxItemDirective, YuwComboboxTriggerButtonDirective, YuwComboboxTriggerDirective, YuwCommandComponent, YuwCommandDialogComponent, YuwContextMenuCheckboxDirective, YuwContextMenuCheckboxIndicatorComponent, YuwContextMenuDirective, YuwContextMenuGroupDirective, YuwContextMenuImports, YuwContextMenuItemDirective, YuwContextMenuLabelDirective, YuwContextMenuRadioDirective, YuwContextMenuRadioIndicatorComponent, YuwContextMenuSeparatorDirective, YuwContextMenuShortcutDirective, YuwContextMenuSubDirective, YuwContextMenuSubIndicatorComponent, YuwContextMenuSubTriggerDirective, YuwContextMenuTriggerDirective, YuwDatatableComponent, YuwDatatablePaginationDirective, YuwDatatableRowSelect, YuwDatepickerComponent, YuwDatepickerTriggerDirective, YuwDialogCloseDirective, YuwDialogComponent, YuwDialogFooterDirective, YuwDialogImports, YuwDialogTriggerDirective, YuwEmptyContentDirective, YuwEmptyDescriptionDirective, YuwEmptyDirective, YuwEmptyHeaderDirective, YuwEmptyImports, YuwEmptyMediaDirective, YuwEmptyTitleDirective, YuwFieldBase, YuwInputAddonImports, YuwInputComponent, YuwInputFileComponent, YuwInputOtpComponent, YuwItemActionsDirective, YuwItemContentDirective, YuwItemDescriptionDirective, YuwItemDirective, YuwItemFooterDirective, YuwItemGroupDirective, YuwItemHeaderDirective, YuwItemImports, YuwItemMediaDirective, YuwItemSeparatorDirective, YuwItemTitleDirective, YuwLabel, YuwLeftAddonDirective, YuwMouseScrollXDirective, YuwMouseScrollYDirective, YuwPaginationComponent, YuwPasswordInputComponent, YuwPopoverComponent, YuwPopoverTriggerDirective, YuwRadioGroupComponent, YuwRightAddonDirective, YuwSearchInputComponent, YuwSheetCloseDirective, YuwSheetComponent, YuwSheetFooterDirective, YuwSheetHeaderDirective, YuwSheetImports, YuwSheetTriggerDirective, YuwSidebarComponent, YuwSidebarContentDirective, YuwSidebarContentExtraDirective, YuwSidebarFooterDirective, YuwSidebarFooterExtraDirective, YuwSidebarGroupContentDirective, YuwSidebarGroupDirective, YuwSidebarGroupLabelDirective, YuwSidebarHeaderDirective, YuwSidebarInsetDirective, YuwSidebarMenuAvatarButtonDirective, YuwSidebarMenuBadgeDirective, YuwSidebarMenuButtonDirective, YuwSidebarMenuDirective, YuwSidebarMenuItemDirective, YuwSidebarMenuSubButtonDirective, YuwSidebarMenuSubDirective, YuwSidebarMenuSubItemDirective, YuwSidebarRailDirective, YuwSidebarRailService, YuwSidebarSeparatorDirective, YuwSidebarSubmenuService, YuwSidebarTriggerComponent, YuwSidebarWrapperDirective, YuwSkeletonDirective, YuwSpinnerComponent, YuwStepIndicatorDirective, YuwStepPanelDirective, YuwStepperComponent, YuwSwitchComponent, YuwTBodyDirective, YuwTFootDirective, YuwTHeadDirective, YuwTabContentDirective, YuwTabPanelDirective, YuwTableContainerDirective, YuwTableDirective, YuwTableImports, YuwTabsComponent, YuwTdDirective, YuwTextFieldBase, YuwTextareaComponent, YuwThDirective, YuwToasterComponent, YuwTooltipDirective, YuwTrDirective, YuwValueAccessorBase, YuwsActiveStatusCellComponent, YuwsAdvanceOnEnterDirective, YuwsAvatarNameCellComponent, YuwsCardGridComponent, YuwsCardGridItemComponent, YuwsClampedTextCellComponent, YuwsConfirmDialogComponent, YuwsCopyButtonComponent, YuwsFilterComboboxComponent, YuwsFilterContentDirective, YuwsFlagCellComponent, YuwsFormSheetComponent, YuwsIconActionCellComponent, YuwsImageCellComponent, YuwsImageFieldComponent, YuwsImageUploadComponent, YuwsLinkCellComponent, YuwsListPaginationComponent, YuwsListTableComponent, YuwsListToolbarComponent, YuwsPageHeaderComponent, YuwsPageSizeComponent, YuwsStatusToggleCellComponent, YuwsTitleSkeletonDirective, buildInputOtpGroups, buildYuwActionsColumn, buildYuwsActiveStatusColumn, buildYuwsDateTimeColumn, buildYuwsIconActionColumn, buildYuwsOptionalTextColumn, buildYuwsStatusToggleColumn, cn, createPagedList, createYuwsSheetEditor, datatableCellVariants, datatableContainerVariants, datatableHeadVariants, datatableHeaderCellVariants, datatableRowVariants, getPaginationRange, provideValueAccessor, shareTable, totalInputOtpLength, yuwCommandDefaultFilter, yuwDatePresets, yuwQuarterRange, yuwsDateFilterValue, yuwsInitialsOf, yuwsMediaQuerySignal, yuwsPendingRowClass, yuwsReadFileAsDataUrl, yuwsResolveDateFilter };
|
|
9294
|
+
export { DATATABLE_ALIGN_CLASS, DATATABLE_LAYOUT_CLASS, DATATABLE_WRAP_CONTENT_CLASS, YUWS_AVATAR_NAME_HEADER_CLASS, YUWS_NO_DATA_PLACEHOLDER, YUW_DATATABLE_FEATURES, YUW_DATATABLE_WRAP_MIN_WIDTH, YUW_DATE_RANGES, YUW_PASSWORD_REVEAL_STATES, YUW_SIDEBAR_RAIL_ICON_SIZE, YUW_SIDEBAR_RAIL_PADDING, YUW_SIDEBAR_RAIL_WIDTH, YUW_TABLE_SHARE_FORMATS, YuwAccordion, YuwAccordionContentComponent, YuwAccordionImports, YuwAccordionItem, YuwAccordionTriggerComponent, YuwActionsCellComponent, YuwAlertActionDirective, YuwAlertComponent, YuwAlertDescriptionDirective, YuwAlertDialogComponent, YuwAlertDialogMediaDirective, YuwAlertDialogTriggerDirective, YuwAlertImports, YuwAlertTitleDirective, YuwAttachmentActionDirective, YuwAttachmentActionsDirective, YuwAttachmentContentDirective, YuwAttachmentDescriptionDirective, YuwAttachmentDirective, YuwAttachmentGroupDirective, YuwAttachmentMediaDirective, YuwAttachmentTitleDirective, YuwAttachmentTriggerDirective, YuwAvatarComponent, YuwBadgeComponent, YuwBreadcrumbComponent, YuwBreadcrumbTrailService, YuwButtonComponent, YuwButtonGroupComponent, YuwButtonGroupContentDirective, YuwCalendarComponent, YuwCaptionDirective, YuwCardActionDirective, YuwCardContentDirective, YuwCardDescriptionDirective, YuwCardDirective, YuwCardFooterDirective, YuwCardHeaderDirective, YuwCardImports, YuwCardTitleDirective, YuwCheckboxComponent, YuwClassDirective, YuwComboboxComponent, YuwComboboxItemDirective, YuwComboboxTriggerButtonDirective, YuwComboboxTriggerDirective, YuwCommandComponent, YuwCommandDialogComponent, YuwContextMenuCheckboxDirective, YuwContextMenuCheckboxIndicatorComponent, YuwContextMenuDirective, YuwContextMenuGroupDirective, YuwContextMenuImports, YuwContextMenuItemDirective, YuwContextMenuLabelDirective, YuwContextMenuRadioDirective, YuwContextMenuRadioIndicatorComponent, YuwContextMenuSeparatorDirective, YuwContextMenuShortcutDirective, YuwContextMenuSubDirective, YuwContextMenuSubIndicatorComponent, YuwContextMenuSubTriggerDirective, YuwContextMenuTriggerDirective, YuwDatatableComponent, YuwDatatablePaginationDirective, YuwDatatableRowSelect, YuwDatepickerComponent, YuwDatepickerTriggerDirective, YuwDialogCloseDirective, YuwDialogComponent, YuwDialogFooterDirective, YuwDialogImports, YuwDialogTriggerDirective, YuwEmptyContentDirective, YuwEmptyDescriptionDirective, YuwEmptyDirective, YuwEmptyHeaderDirective, YuwEmptyImports, YuwEmptyMediaDirective, YuwEmptyTitleDirective, YuwFieldBase, YuwInputAddonImports, YuwInputComponent, YuwInputFileComponent, YuwInputOtpComponent, YuwItemActionsDirective, YuwItemContentDirective, YuwItemDescriptionDirective, YuwItemDirective, YuwItemFooterDirective, YuwItemGroupDirective, YuwItemHeaderDirective, YuwItemImports, YuwItemMediaDirective, YuwItemSeparatorDirective, YuwItemTitleDirective, YuwLabel, YuwLeftAddonDirective, YuwMouseScrollXDirective, YuwMouseScrollYDirective, YuwPaginationComponent, YuwPasswordInputComponent, YuwPopoverComponent, YuwPopoverTriggerDirective, YuwRadioGroupComponent, YuwRightAddonDirective, YuwSearchInputComponent, YuwSheetCloseDirective, YuwSheetComponent, YuwSheetFooterDirective, YuwSheetHeaderDirective, YuwSheetImports, YuwSheetTriggerDirective, YuwSidebarComponent, YuwSidebarContentDirective, YuwSidebarContentExtraDirective, YuwSidebarFooterDirective, YuwSidebarFooterExtraDirective, YuwSidebarGroupContentDirective, YuwSidebarGroupDirective, YuwSidebarGroupLabelDirective, YuwSidebarHeaderDirective, YuwSidebarInsetDirective, YuwSidebarMenuAvatarButtonDirective, YuwSidebarMenuBadgeDirective, YuwSidebarMenuButtonDirective, YuwSidebarMenuDirective, YuwSidebarMenuItemDirective, YuwSidebarMenuSubButtonDirective, YuwSidebarMenuSubDirective, YuwSidebarMenuSubItemDirective, YuwSidebarRailDirective, YuwSidebarRailService, YuwSidebarSeparatorDirective, YuwSidebarSubmenuService, YuwSidebarTriggerComponent, YuwSidebarWrapperDirective, YuwSkeletonDirective, YuwSpinnerComponent, YuwStepIndicatorDirective, YuwStepPanelDirective, YuwStepperComponent, YuwSwitchComponent, YuwTBodyDirective, YuwTFootDirective, YuwTHeadDirective, YuwTabContentDirective, YuwTabPanelDirective, YuwTableContainerDirective, YuwTableDirective, YuwTableImports, YuwTabsComponent, YuwTdDirective, YuwTextFieldBase, YuwTextareaComponent, YuwThDirective, YuwToasterComponent, YuwTooltipDirective, YuwTrDirective, YuwValueAccessorBase, YuwsActiveStatusCellComponent, YuwsAdvanceOnEnterDirective, YuwsAvatarNameCellComponent, YuwsCardGridComponent, YuwsCardGridItemComponent, YuwsClampedTextCellComponent, YuwsConfirmDialogComponent, YuwsCopyButtonComponent, YuwsFilterComboboxComponent, YuwsFilterContentDirective, YuwsFlagCellComponent, YuwsFormSheetComponent, YuwsIconActionCellComponent, YuwsImageCellComponent, YuwsImageFieldComponent, YuwsImageUploadComponent, YuwsLinkCellComponent, YuwsListPaginationComponent, YuwsListTableComponent, YuwsListToolbarComponent, YuwsMenuActionsCellComponent, YuwsOverflowListCellComponent, YuwsPageHeaderComponent, YuwsPageSizeComponent, YuwsSelectCellComponent, YuwsStackedTextCellComponent, YuwsStatusToggleCellComponent, YuwsTitleSkeletonDirective, buildInputOtpGroups, buildYuwActionsColumn, buildYuwsActiveStatusColumn, buildYuwsDateTimeColumn, buildYuwsIconActionColumn, buildYuwsMenuActionsColumn, buildYuwsOptionalTextColumn, buildYuwsSelectColumn, buildYuwsStatusToggleColumn, cn, createPagedList, createYuwsSheetEditor, datatableCellVariants, datatableContainerVariants, datatableHeadVariants, datatableHeaderCellVariants, datatableRowVariants, getPaginationRange, provideValueAccessor, shareTable, totalInputOtpLength, yuwCommandDefaultFilter, yuwDatePresets, yuwQuarterRange, yuwsDateFilterValue, yuwsInitialsOf, yuwsMediaQuerySignal, yuwsPendingRowClass, yuwsReadFileAsDataUrl, yuwsResolveDateFilter };
|
|
9082
9295
|
//# sourceMappingURL=yukit-web.mjs.map
|