yukit-web 0.0.1
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/.npm/_logs/2026-08-20T08_40_55_706Z-debug-0.log +38 -0
- package/.npm/_logs/2026-08-20T08_40_56_280Z-debug-0.log +14 -0
- package/README.md +1465 -0
- package/fesm2022/yukit-web-helm-accordion.mjs +141 -0
- package/fesm2022/yukit-web-helm-accordion.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-alert-dialog.mjs +250 -0
- package/fesm2022/yukit-web-helm-alert-dialog.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-alert.mjs +94 -0
- package/fesm2022/yukit-web-helm-alert.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-aspect-ratio.mjs +47 -0
- package/fesm2022/yukit-web-helm-aspect-ratio.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-attachment.mjs +211 -0
- package/fesm2022/yukit-web-helm-attachment.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-autocomplete.mjs +361 -0
- package/fesm2022/yukit-web-helm-autocomplete.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-avatar.mjs +152 -0
- package/fesm2022/yukit-web-helm-avatar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-badge.mjs +47 -0
- package/fesm2022/yukit-web-helm-badge.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-breadcrumb.mjs +196 -0
- package/fesm2022/yukit-web-helm-breadcrumb.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-bubble.mjs +121 -0
- package/fesm2022/yukit-web-helm-bubble.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-button-group.mjs +86 -0
- package/fesm2022/yukit-web-helm-button-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-button.mjs +77 -0
- package/fesm2022/yukit-web-helm-button.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-calendar.mjs +937 -0
- package/fesm2022/yukit-web-helm-calendar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-card.mjs +141 -0
- package/fesm2022/yukit-web-helm-card.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-carousel.mjs +270 -0
- package/fesm2022/yukit-web-helm-carousel.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-checkbox.mjs +147 -0
- package/fesm2022/yukit-web-helm-checkbox.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-collapsible.mjs +62 -0
- package/fesm2022/yukit-web-helm-collapsible.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-combobox.mjs +624 -0
- package/fesm2022/yukit-web-helm-combobox.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-command.mjs +315 -0
- package/fesm2022/yukit-web-helm-command.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-context-menu.mjs +71 -0
- package/fesm2022/yukit-web-helm-context-menu.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-date-picker.mjs +1517 -0
- package/fesm2022/yukit-web-helm-date-picker.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-dialog.mjs +271 -0
- package/fesm2022/yukit-web-helm-dialog.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-drawer.mjs +233 -0
- package/fesm2022/yukit-web-helm-drawer.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-dropdown-menu.mjs +508 -0
- package/fesm2022/yukit-web-helm-dropdown-menu.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-empty.mjs +125 -0
- package/fesm2022/yukit-web-helm-empty.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-field.mjs +325 -0
- package/fesm2022/yukit-web-helm-field.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-hover-card.mjs +102 -0
- package/fesm2022/yukit-web-helm-hover-card.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-input-group.mjs +171 -0
- package/fesm2022/yukit-web-helm-input-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-input-otp.mjs +127 -0
- package/fesm2022/yukit-web-helm-input-otp.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-input.mjs +32 -0
- package/fesm2022/yukit-web-helm-input.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-item.mjs +242 -0
- package/fesm2022/yukit-web-helm-item.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-kbd.mjs +46 -0
- package/fesm2022/yukit-web-helm-kbd.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-label.mjs +30 -0
- package/fesm2022/yukit-web-helm-label.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-marker.mjs +77 -0
- package/fesm2022/yukit-web-helm-marker.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-menubar.mjs +90 -0
- package/fesm2022/yukit-web-helm-menubar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-message.mjs +115 -0
- package/fesm2022/yukit-web-helm-message.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-native-select.mjs +180 -0
- package/fesm2022/yukit-web-helm-native-select.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-navigation-menu.mjs +173 -0
- package/fesm2022/yukit-web-helm-navigation-menu.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-pagination.mjs +745 -0
- package/fesm2022/yukit-web-helm-pagination.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-popover.mjs +136 -0
- package/fesm2022/yukit-web-helm-popover.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-progress.mjs +60 -0
- package/fesm2022/yukit-web-helm-progress.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-radio-group.mjs +185 -0
- package/fesm2022/yukit-web-helm-radio-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-resizable.mjs +98 -0
- package/fesm2022/yukit-web-helm-resizable.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-scroll-area.mjs +36 -0
- package/fesm2022/yukit-web-helm-scroll-area.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-select.mjs +412 -0
- package/fesm2022/yukit-web-helm-select.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-separator.mjs +33 -0
- package/fesm2022/yukit-web-helm-separator.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-sheet.mjs +254 -0
- package/fesm2022/yukit-web-helm-sheet.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-sidebar.mjs +857 -0
- package/fesm2022/yukit-web-helm-sidebar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-skeleton.mjs +29 -0
- package/fesm2022/yukit-web-helm-skeleton.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-slider.mjs +123 -0
- package/fesm2022/yukit-web-helm-slider.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-sonner.mjs +126 -0
- package/fesm2022/yukit-web-helm-sonner.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-spinner.mjs +48 -0
- package/fesm2022/yukit-web-helm-spinner.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-switch.mjs +126 -0
- package/fesm2022/yukit-web-helm-switch.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-table.mjs +180 -0
- package/fesm2022/yukit-web-helm-table.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-tabs.mjs +251 -0
- package/fesm2022/yukit-web-helm-tabs.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-textarea.mjs +32 -0
- package/fesm2022/yukit-web-helm-textarea.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-toggle-group.mjs +95 -0
- package/fesm2022/yukit-web-helm-toggle-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-toggle.mjs +61 -0
- package/fesm2022/yukit-web-helm-toggle.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-tooltip.mjs +57 -0
- package/fesm2022/yukit-web-helm-tooltip.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-typography.mjs +205 -0
- package/fesm2022/yukit-web-helm-typography.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-utils.mjs +272 -0
- package/fesm2022/yukit-web-helm-utils.mjs.map +1 -0
- package/fesm2022/yukit-web.mjs +3592 -0
- package/fesm2022/yukit-web.mjs.map +1 -0
- package/package.json +291 -0
- package/src/lib/theme/spartan-overwrites/accordion.css +4 -0
- package/src/lib/theme/theme.css +161 -0
- package/src/lib/theme/tokens/color.css +356 -0
- package/src/lib/theme/tokens/component-colors.css +167 -0
- package/src/lib/theme/tokens/radius.css +18 -0
- package/src/lib/theme/tokens/typography.css +201 -0
- package/types/yukit-web-helm-accordion.d.ts +32 -0
- package/types/yukit-web-helm-alert-dialog.d.ts +85 -0
- package/types/yukit-web-helm-alert.d.ts +37 -0
- package/types/yukit-web-helm-aspect-ratio.d.ts +16 -0
- package/types/yukit-web-helm-attachment.d.ts +80 -0
- package/types/yukit-web-helm-autocomplete.d.ts +91 -0
- package/types/yukit-web-helm-avatar.d.ts +45 -0
- package/types/yukit-web-helm-badge.d.ts +19 -0
- package/types/yukit-web-helm-breadcrumb.d.ts +52 -0
- package/types/yukit-web-helm-bubble.d.ts +46 -0
- package/types/yukit-web-helm-button-group.d.ts +25 -0
- package/types/yukit-web-helm-button.d.ts +33 -0
- package/types/yukit-web-helm-calendar.d.ts +89 -0
- package/types/yukit-web-helm-card.d.ts +49 -0
- package/types/yukit-web-helm-carousel.d.ts +79 -0
- package/types/yukit-web-helm-checkbox.d.ts +60 -0
- package/types/yukit-web-helm-collapsible.d.ts +22 -0
- package/types/yukit-web-helm-combobox.d.ts +150 -0
- package/types/yukit-web-helm-command.d.ts +84 -0
- package/types/yukit-web-helm-context-menu.d.ts +29 -0
- package/types/yukit-web-helm-date-picker.d.ts +574 -0
- package/types/yukit-web-helm-dialog.d.ts +90 -0
- package/types/yukit-web-helm-drawer.d.ts +71 -0
- package/types/yukit-web-helm-dropdown-menu.d.ts +171 -0
- package/types/yukit-web-helm-empty.d.ts +49 -0
- package/types/yukit-web-helm-field.d.ts +102 -0
- package/types/yukit-web-helm-hover-card.d.ts +31 -0
- package/types/yukit-web-helm-input-group.d.ts +47 -0
- package/types/yukit-web-helm-input-otp.d.ts +40 -0
- package/types/yukit-web-helm-input.d.ts +13 -0
- package/types/yukit-web-helm-item.d.ts +96 -0
- package/types/yukit-web-helm-kbd.d.ts +17 -0
- package/types/yukit-web-helm-label.d.ts +12 -0
- package/types/yukit-web-helm-marker.d.ts +31 -0
- package/types/yukit-web-helm-menubar.d.ts +35 -0
- package/types/yukit-web-helm-message.d.ts +44 -0
- package/types/yukit-web-helm-native-select.d.ts +65 -0
- package/types/yukit-web-helm-navigation-menu.d.ts +49 -0
- package/types/yukit-web-helm-pagination.d.ts +187 -0
- package/types/yukit-web-helm-popover.d.ts +49 -0
- package/types/yukit-web-helm-progress.d.ts +22 -0
- package/types/yukit-web-helm-radio-group.d.ts +66 -0
- package/types/yukit-web-helm-resizable.d.ts +27 -0
- package/types/yukit-web-helm-scroll-area.d.ts +11 -0
- package/types/yukit-web-helm-select.d.ts +114 -0
- package/types/yukit-web-helm-separator.d.ts +13 -0
- package/types/yukit-web-helm-sheet.d.ts +75 -0
- package/types/yukit-web-helm-sidebar.d.ts +232 -0
- package/types/yukit-web-helm-skeleton.d.ts +11 -0
- package/types/yukit-web-helm-slider.d.ts +14 -0
- package/types/yukit-web-helm-sonner.d.ts +52 -0
- package/types/yukit-web-helm-spinner.d.ts +18 -0
- package/types/yukit-web-helm-switch.d.ts +54 -0
- package/types/yukit-web-helm-table.d.ts +82 -0
- package/types/yukit-web-helm-tabs.d.ts +66 -0
- package/types/yukit-web-helm-textarea.d.ts +13 -0
- package/types/yukit-web-helm-toggle-group.d.ts +34 -0
- package/types/yukit-web-helm-toggle.d.ts +22 -0
- package/types/yukit-web-helm-tooltip.d.ts +17 -0
- package/types/yukit-web-helm-typography.d.ts +89 -0
- package/types/yukit-web-helm-utils.d.ts +44 -0
- package/types/yukit-web.d.ts +2426 -0
|
@@ -0,0 +1,3592 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { forwardRef, signal, Directive, input, booleanAttribute, output, computed, ChangeDetectionStrategy, Component, model, inject, TemplateRef, contentChild, viewChild, ElementRef, contentChildren, effect, numberAttribute } from '@angular/core';
|
|
5
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
|
+
import { HlmButton, provideBrnButtonConfig } from 'yukit-web/helm/button';
|
|
7
|
+
import { HlmButtonGroup } from 'yukit-web/helm/button-group';
|
|
8
|
+
import * as i2 from 'yukit-web/helm/dropdown-menu';
|
|
9
|
+
import { HlmDropdownMenuTrigger, HlmDropdownMenuCheckboxIndicator, HlmDropdownMenuRadioIndicator, HlmDropdownMenuItemSubIndicator, HlmDropdownMenu, HlmDropdownMenuItem, HlmDropdownMenuCheckbox, HlmDropdownMenuRadio, HlmDropdownMenuLabel, HlmDropdownMenuGroup, HlmDropdownMenuSeparator, HlmDropdownMenuShortcut, HlmDropdownMenuSub, HlmDropdownMenuSubTrigger } from 'yukit-web/helm/dropdown-menu';
|
|
10
|
+
import { cva } from 'class-variance-authority';
|
|
11
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
12
|
+
import { lucideX, lucideChevronRight, lucideChevronLeft, lucideSearch, lucideEyeOff, lucideEye } from '@ng-icons/lucide';
|
|
13
|
+
import * as i1 from 'yukit-web/helm/badge';
|
|
14
|
+
import { HlmBadge } from 'yukit-web/helm/badge';
|
|
15
|
+
import * as i1$1 from 'yukit-web/helm/breadcrumb';
|
|
16
|
+
import { HlmBreadcrumbImports } from 'yukit-web/helm/breadcrumb';
|
|
17
|
+
import { HlmPagination, HlmPaginationContent, HlmPaginationItem, HlmPaginationLink, HlmPaginationEllipsis } from 'yukit-web/helm/pagination';
|
|
18
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
19
|
+
import * as i1$2 from 'yukit-web/helm/combobox';
|
|
20
|
+
import { HlmComboboxContent, HlmComboboxImports } from 'yukit-web/helm/combobox';
|
|
21
|
+
import { HlmAccordion, HlmAccordionItem, HlmAccordionTrigger, HlmAccordionContent } from 'yukit-web/helm/accordion';
|
|
22
|
+
import { HlmInput } from 'yukit-web/helm/input';
|
|
23
|
+
import * as i1$3 from 'yukit-web/helm/input-group';
|
|
24
|
+
import { HlmInputGroup, HlmInputGroupInput, HlmInputGroupAddon, HlmInputGroupTextarea, HlmInputGroupImports } from 'yukit-web/helm/input-group';
|
|
25
|
+
import { HlmTextarea } from 'yukit-web/helm/textarea';
|
|
26
|
+
import { BrnInputOtp } from '@spartan-ng/brain/input-otp';
|
|
27
|
+
import * as i1$4 from 'yukit-web/helm/input-otp';
|
|
28
|
+
import { HlmInputOtpImports } from 'yukit-web/helm/input-otp';
|
|
29
|
+
import { HlmLabel } from 'yukit-web/helm/label';
|
|
30
|
+
import { HlmCheckbox } from 'yukit-web/helm/checkbox';
|
|
31
|
+
import * as i1$5 from 'yukit-web/helm/switch';
|
|
32
|
+
import { HlmSwitchImports } from 'yukit-web/helm/switch';
|
|
33
|
+
import * as i1$6 from 'yukit-web/helm/radio-group';
|
|
34
|
+
import { HlmRadioGroupImports } from 'yukit-web/helm/radio-group';
|
|
35
|
+
import * as i1$7 from 'yukit-web/helm/skeleton';
|
|
36
|
+
import { HlmSkeleton } from 'yukit-web/helm/skeleton';
|
|
37
|
+
import * as i1$8 from 'yukit-web/helm/card';
|
|
38
|
+
import { HlmCard, HlmCardHeader, HlmCardTitle, HlmCardDescription, HlmCardAction, HlmCardContent, HlmCardFooter } from 'yukit-web/helm/card';
|
|
39
|
+
import * as i1$9 from 'yukit-web/helm/empty';
|
|
40
|
+
import { HlmEmpty, HlmEmptyHeader, HlmEmptyMedia, HlmEmptyTitle, HlmEmptyDescription, HlmEmptyContent } from 'yukit-web/helm/empty';
|
|
41
|
+
import { CdkContextMenuTrigger, CdkMenuItem, CdkMenuItemCheckbox, CdkMenuItemRadio, CdkMenuTrigger } from '@angular/cdk/menu';
|
|
42
|
+
import { outputFromObservable, toObservable } from '@angular/core/rxjs-interop';
|
|
43
|
+
import * as i1$a from 'yukit-web/helm/context-menu';
|
|
44
|
+
import { HlmContextMenuTrigger } from 'yukit-web/helm/context-menu';
|
|
45
|
+
import * as i1$b from 'yukit-web/helm/date-picker';
|
|
46
|
+
import { injectHlmDatePickerConfig, injectHlmDateRangePickerConfig, injectHlmDatePickerMultiConfig, injectHlmMonthYearPickerConfig, HlmDatePickerImports } from 'yukit-web/helm/date-picker';
|
|
47
|
+
import * as i1$c from 'yukit-web/helm/table';
|
|
48
|
+
import { HlmTableContainer, HlmTable, HlmTHead, HlmTBody, HlmTFoot, HlmTr, HlmTh, HlmTd, HlmCaption } from 'yukit-web/helm/table';
|
|
49
|
+
import { injectTable, FlexRenderDirective } from '@tanstack/angular-table';
|
|
50
|
+
import { rowSortingFeature, rowSelectionFeature, rowPaginationFeature, columnVisibilityFeature, columnFilteringFeature, sortFns, createPaginatedRowModel, createSortedRowModel, createFilteredRowModel, createCoreRowModel } from '@tanstack/table-core';
|
|
51
|
+
import { skip } from 'rxjs';
|
|
52
|
+
import * as i1$d from 'yukit-web/helm/avatar';
|
|
53
|
+
import { HlmAvatarImports } from 'yukit-web/helm/avatar';
|
|
54
|
+
import * as i1$e from 'yukit-web/helm/item';
|
|
55
|
+
import { HlmItem, HlmItemHeader, HlmItemMedia, HlmItemContent, HlmItemTitle, HlmItemDescription, HlmItemActions, HlmItemFooter, HlmItemGroup, HlmItemSeparator } from 'yukit-web/helm/item';
|
|
56
|
+
import * as i1$f from 'yukit-web/helm/sheet';
|
|
57
|
+
import { HlmSheetImports } from 'yukit-web/helm/sheet';
|
|
58
|
+
import * as i1$g from 'yukit-web/helm/popover';
|
|
59
|
+
import { HlmPopoverImports } from 'yukit-web/helm/popover';
|
|
60
|
+
import * as i1$h from '@spartan-ng/brain/tooltip';
|
|
61
|
+
import { provideBrnTooltipDefaultOptions, BrnTooltip } from '@spartan-ng/brain/tooltip';
|
|
62
|
+
import { tooltipPositionVariants, DEFAULT_TOOLTIP_CONTENT_CLASSES, DEFAULT_TOOLTIP_SVG_CLASS } from 'yukit-web/helm/tooltip';
|
|
63
|
+
import { hlm } from 'yukit-web/helm/utils';
|
|
64
|
+
import { HlmSpinner } from 'yukit-web/helm/spinner';
|
|
65
|
+
import { HlmToaster } from 'yukit-web/helm/sonner';
|
|
66
|
+
export { toast as yuwToast } from '@spartan-ng/brain/sonner';
|
|
67
|
+
import { HlmAlert, HlmAlertTitle, HlmAlertDescription, HlmAlertAction } from 'yukit-web/helm/alert';
|
|
68
|
+
import * as i1$i from 'yukit-web/helm/dialog';
|
|
69
|
+
import { HlmDialogImports } from 'yukit-web/helm/dialog';
|
|
70
|
+
import * as i1$j from 'yukit-web/helm/alert-dialog';
|
|
71
|
+
import { HlmAlertDialogImports } from 'yukit-web/helm/alert-dialog';
|
|
72
|
+
import * as i1$k from 'yukit-web/helm/tabs';
|
|
73
|
+
import { HlmTabsImports } from 'yukit-web/helm/tabs';
|
|
74
|
+
import * as i1$l from 'yukit-web/helm/attachment';
|
|
75
|
+
import { HlmAttachment, HlmAttachmentGroup, HlmAttachmentMedia, HlmAttachmentContent, HlmAttachmentTitle, HlmAttachmentDescription, HlmAttachmentActions, HlmAttachmentAction, HlmAttachmentTrigger } from 'yukit-web/helm/attachment';
|
|
76
|
+
import * as i1$m from 'yukit-web/helm/sidebar';
|
|
77
|
+
import { injectHlmSidebarConfig, HlmSidebar, HlmSidebarTrigger, HlmSidebarWrapper, HlmSidebarHeader, HlmSidebarContent, HlmSidebarFooter, HlmSidebarGroup, HlmSidebarGroupLabel, HlmSidebarGroupContent, HlmSidebarMenu, HlmSidebarMenuItem, HlmSidebarMenuButton, HlmSidebarMenuBadge, HlmSidebarMenuSub, HlmSidebarMenuSubItem, HlmSidebarMenuSubButton, HlmSidebarSeparator, HlmSidebarRail, HlmSidebarInset } from 'yukit-web/helm/sidebar';
|
|
78
|
+
export { HlmSidebarService as YuwSidebarService, provideHlmSidebarConfig as provideYuwSidebarConfig } from 'yukit-web/helm/sidebar';
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Merges class lists the shadcn/Spartan way: `clsx` resolves conditionals/arrays, `twMerge`
|
|
82
|
+
* then drops earlier Tailwind classes that a later one overrides (e.g. `px-3 ... px-4` keeps
|
|
83
|
+
* only `px-4`) instead of shipping both to the DOM.
|
|
84
|
+
*
|
|
85
|
+
* Every yukit-web component's variant classes are combined through this, so a consumer's own
|
|
86
|
+
* `class` input always wins over the component's defaults without fighting specificity.
|
|
87
|
+
*/
|
|
88
|
+
function cn(...inputs) {
|
|
89
|
+
return twMerge(clsx(inputs));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Registers a component as a form control, so `formControlName`/`formControl`/`ngModel` bind to it.
|
|
94
|
+
*
|
|
95
|
+
* Spartan's own controls mostly don't need this: `hlmInput` and `hlmTextarea` are *directives on a
|
|
96
|
+
* native element*, so Angular's built-in `DefaultValueAccessor` already applies to the same host.
|
|
97
|
+
* The moment we wrap that native element inside a component template, the host a consumer writes
|
|
98
|
+
* `formControlName` on is no longer the `<input>` — Angular finds no accessor there and throws
|
|
99
|
+
* `NG01203`. This restores what the wrapping cost us.
|
|
100
|
+
*
|
|
101
|
+
* Kept as a `useExisting` + `forwardRef` provider because the class is referenced in its own
|
|
102
|
+
* decorator metadata, before the class binding is initialized.
|
|
103
|
+
*/
|
|
104
|
+
function provideValueAccessor(component) {
|
|
105
|
+
return {
|
|
106
|
+
provide: NG_VALUE_ACCESSOR,
|
|
107
|
+
useExisting: forwardRef(() => component),
|
|
108
|
+
multi: true,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Shared `ControlValueAccessor` for the library's text-entry controls.
|
|
113
|
+
*
|
|
114
|
+
* Exists so the five text components don't each carry a near-identical copy of the same CVA
|
|
115
|
+
* plumbing — the single-responsibility and DRY concerns in `agents.md`. Subclasses supply nothing;
|
|
116
|
+
* they just extend it, add the provider, and bind `value`/`_onBlur()` in their template.
|
|
117
|
+
*
|
|
118
|
+
* ## Why `disabled` needs care
|
|
119
|
+
*
|
|
120
|
+
* `disabled` has two sources that don't know about each other: our own `disabled` input, and the
|
|
121
|
+
* forms API calling `setDisabledState()` (which is what `new FormControl({value, disabled: true})`
|
|
122
|
+
* and `control.disable()` go through). Letting either one own a single signal means the last
|
|
123
|
+
* writer wins and the other is silently ignored — the classic bug in hand-rolled accessors.
|
|
124
|
+
*
|
|
125
|
+
* They're kept as two separate signals and OR'd together in `disabledState`: disabled by *either*
|
|
126
|
+
* source means disabled. That's the only combination that never drops a caller's intent.
|
|
127
|
+
*/
|
|
128
|
+
class YuwValueAccessorBase {
|
|
129
|
+
constructor() {
|
|
130
|
+
this._formDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_formDisabled" }] : /* istanbul ignore next */ []));
|
|
131
|
+
this._onChange = () => undefined;
|
|
132
|
+
this._onTouched = () => undefined;
|
|
133
|
+
}
|
|
134
|
+
_isDisabled(ownDisabled) {
|
|
135
|
+
return ownDisabled || this._formDisabled();
|
|
136
|
+
}
|
|
137
|
+
_commit(next) {
|
|
138
|
+
this.value.set(next);
|
|
139
|
+
this._onChange(next);
|
|
140
|
+
}
|
|
141
|
+
_onBlur() {
|
|
142
|
+
this._onTouched();
|
|
143
|
+
}
|
|
144
|
+
writeValue(value) {
|
|
145
|
+
this.value.set(value ?? this._emptyValue());
|
|
146
|
+
}
|
|
147
|
+
registerOnChange(fn) {
|
|
148
|
+
this._onChange = fn;
|
|
149
|
+
}
|
|
150
|
+
registerOnTouched(fn) {
|
|
151
|
+
this._onTouched = fn;
|
|
152
|
+
}
|
|
153
|
+
setDisabledState(isDisabled) {
|
|
154
|
+
this._formDisabled.set(isDisabled);
|
|
155
|
+
}
|
|
156
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwValueAccessorBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
157
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwValueAccessorBase, isStandalone: true, ngImport: i0 }); }
|
|
158
|
+
}
|
|
159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwValueAccessorBase, decorators: [{
|
|
160
|
+
type: Directive,
|
|
161
|
+
args: [{}]
|
|
162
|
+
}] });
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* yukit-web's own class layer for `<yuw-button>`, applied on top of the helm `buttonVariants()`
|
|
166
|
+
* output. The result lands on the `[class]` binding of the inner `[hlmBtn]` element; the helm
|
|
167
|
+
* `classes()` utility registers it as base classes and merges it last through `twMerge`, so every
|
|
168
|
+
* class here beats the helm default of the same Tailwind group *and* modifier stack without
|
|
169
|
+
* needing `!important`.
|
|
170
|
+
*/
|
|
171
|
+
const yuwButtonVariants = cva('', {
|
|
172
|
+
variants: {
|
|
173
|
+
/**
|
|
174
|
+
* Mirrors the helm `variant` input. Only `outline` needs correcting: helm paints it with
|
|
175
|
+
* `bg-background` (+ `dark:bg-input/30`) and a muted text color, while ours is transparent at
|
|
176
|
+
* rest and uses the foreground color (which `[data-yuw-color]` remaps to the accent). The
|
|
177
|
+
* helm `hover:`/`aria-expanded:` backgrounds are intentionally left in place.
|
|
178
|
+
*/
|
|
179
|
+
variant: {
|
|
180
|
+
default: '',
|
|
181
|
+
secondary: '',
|
|
182
|
+
outline: 'bg-transparent text-foreground dark:bg-transparent',
|
|
183
|
+
ghost: '',
|
|
184
|
+
destructive: '',
|
|
185
|
+
link: '',
|
|
186
|
+
},
|
|
187
|
+
/**
|
|
188
|
+
* Strips every background/border the helm variants set, covering each modifier stack they
|
|
189
|
+
* use (`hover:`, `aria-expanded:`, `dark:`, `dark:hover:`, `[a]:hover:`) so `twMerge` drops
|
|
190
|
+
* the helm counterpart in every state. The `component-colors.css` gradients key off the
|
|
191
|
+
* `.bg-primary` class, which this merge removes from the element, so they never match a
|
|
192
|
+
* transparent button and no `!important` is needed here either.
|
|
193
|
+
*/
|
|
194
|
+
transparent: {
|
|
195
|
+
true: 'border-transparent bg-transparent text-foreground hover:bg-transparent aria-expanded:bg-transparent aria-expanded:text-foreground dark:border-transparent dark:bg-transparent dark:hover:bg-transparent [a]:hover:bg-transparent',
|
|
196
|
+
false: '',
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
defaultVariants: {
|
|
200
|
+
variant: 'default',
|
|
201
|
+
transparent: false,
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Button component supporting single action button or grouped button options.
|
|
207
|
+
*
|
|
208
|
+
* Inputs:
|
|
209
|
+
* - `variant`: Button style variant (`'default'`, `'secondary'`, `'outline'`, `'destructive'`, `'ghost'`, `'link'`). Default is `'default'`.
|
|
210
|
+
* - `size`: Button size (`'default'`, `'sm'`, `'lg'`, `'icon'`, etc.). Default is `'default'`.
|
|
211
|
+
* - `color`: Brand color theme (any `YuwColorDto` value). Default is `'secondary'`.
|
|
212
|
+
* - `disabled`: Disables button interactions.
|
|
213
|
+
* - `type`: HTML button type (`'button'`, `'submit'`, `'reset'`). Default is `'button'`.
|
|
214
|
+
* - `href`: Renders button as an anchor tag navigating to specified URL.
|
|
215
|
+
* - `target`: Target attribute for link button (e.g. `'_blank'`).
|
|
216
|
+
* - `transparent`: Removes background and border styling.
|
|
217
|
+
* - `class`: Extra CSS classes merged onto the inner button/anchor (single and link mode); merged last, so they win over the component's own classes.
|
|
218
|
+
* - `yuwDropdownMenuTrigger`: Optional dropdown menu template reference to trigger.
|
|
219
|
+
* - `ariaLabel`: Accessible label for screen readers.
|
|
220
|
+
* - `buttons`: Array of button items (`YuwButtonGroupItemDto[]`) to render as a welded button group.
|
|
221
|
+
* - `orientation`: Group layout orientation (`'horizontal'` or `'vertical'`). Default is `'horizontal'`.
|
|
222
|
+
* - `groupAriaLabel`: Accessible name for button group container.
|
|
223
|
+
*
|
|
224
|
+
* Outputs:
|
|
225
|
+
* - `clicked`: Emits MouseEvent on single button click.
|
|
226
|
+
* - `buttonClicked`: Emits object containing clicked button `id` and `event` in group mode.
|
|
227
|
+
*
|
|
228
|
+
* Single Button Usage:
|
|
229
|
+
* ```html
|
|
230
|
+
* <yuw-button variant="outline" color="primary" (clicked)="onSave()">Save</yuw-button>
|
|
231
|
+
* <yuw-button href="/dashboard">Navigate</yuw-button>
|
|
232
|
+
* ```
|
|
233
|
+
*
|
|
234
|
+
* Button Group Usage:
|
|
235
|
+
* ```html
|
|
236
|
+
* <yuw-button [buttons]="actionList" (buttonClicked)="onAction($event)" />
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
class YuwButtonComponent {
|
|
240
|
+
constructor() {
|
|
241
|
+
this.variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
242
|
+
this.size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
243
|
+
this.color = input('secondary', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
244
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
245
|
+
this.type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
246
|
+
this.href = input(undefined, ...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
|
|
247
|
+
this.target = input(undefined, ...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
|
|
248
|
+
this.transparent = input(false, { ...(ngDevMode ? { debugName: "transparent" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
249
|
+
this.yuwDropdownMenuTrigger = input(undefined, ...(ngDevMode ? [{ debugName: "yuwDropdownMenuTrigger" }] : /* istanbul ignore next */ []));
|
|
250
|
+
this.ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
251
|
+
this.buttons = input(undefined, ...(ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []));
|
|
252
|
+
this.orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
253
|
+
this.groupAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "groupAriaLabel" }] : /* istanbul ignore next */ []));
|
|
254
|
+
/**
|
|
255
|
+
* Consumer CSS classes for the inner button/anchor (single and link mode). Merged last with
|
|
256
|
+
* `cn`, so they win over the component's own variant/transparent classes.
|
|
257
|
+
*/
|
|
258
|
+
this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
259
|
+
this.clicked = output();
|
|
260
|
+
this.buttonClicked = output();
|
|
261
|
+
this._isGroup = computed(() => (this.buttons()?.length ?? 0) > 0, ...(ngDevMode ? [{ debugName: "_isGroup" }] : /* istanbul ignore next */ []));
|
|
262
|
+
/** Classes for the single-mode button/anchor: our variant layer + the consumer's `class`, which goes last so it wins. */
|
|
263
|
+
this._btnClass = computed(() => cn(yuwButtonVariants({ variant: this.variant(), transparent: this.transparent() }), this.userClass()), ...(ngDevMode ? [{ debugName: "_btnClass" }] : /* istanbul ignore next */ []));
|
|
264
|
+
this._resolved = computed(() => (this.buttons() ?? []).map((button) => {
|
|
265
|
+
const variant = button.variant ?? this.variant();
|
|
266
|
+
return {
|
|
267
|
+
...button,
|
|
268
|
+
variant,
|
|
269
|
+
size: button.size ?? this.size(),
|
|
270
|
+
color: button.color ?? this.color(),
|
|
271
|
+
disabled: button.disabled ?? false,
|
|
272
|
+
type: button.type ?? 'button',
|
|
273
|
+
class: yuwButtonVariants({ variant, transparent: button.transparent ?? false }),
|
|
274
|
+
};
|
|
275
|
+
}), ...(ngDevMode ? [{ debugName: "_resolved" }] : /* istanbul ignore next */ []));
|
|
276
|
+
}
|
|
277
|
+
onClick(event) {
|
|
278
|
+
if (this.disabled()) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this.clicked.emit(event);
|
|
282
|
+
}
|
|
283
|
+
onGroupClick(button, event) {
|
|
284
|
+
if (button.disabled) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
this.buttonClicked.emit({ id: button.id, event });
|
|
288
|
+
}
|
|
289
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
290
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwButtonComponent, isStandalone: true, selector: "yuw-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, transparent: { classPropertyName: "transparent", publicName: "transparent", isSignal: true, isRequired: false, transformFunction: null }, yuwDropdownMenuTrigger: { classPropertyName: "yuwDropdownMenuTrigger", publicName: "yuwDropdownMenuTrigger", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, buttons: { classPropertyName: "buttons", publicName: "buttons", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, groupAriaLabel: { classPropertyName: "groupAriaLabel", publicName: "groupAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked", buttonClicked: "buttonClicked" }, host: { properties: { "class.cursor-not-allowed": "disabled()", "attr.data-yuw-color": "color()" } }, ngImport: i0, template: "@if (_isGroup()) {\n <div hlmButtonGroup [orientation]=\"orientation()\" [attr.aria-label]=\"groupAriaLabel()\">\n @for (button of _resolved(); track button.id) {\n @if (button.href && !button.disabled) {\n <a hlmBtn [variant]=\"button.variant\" [size]=\"button.size\" [href]=\"button.href\" [target]=\"button.target\"\n [attr.data-yuw-color]=\"button.color\" [attr.aria-label]=\"button.ariaLabel\"\n (click)=\"onGroupClick(button, $event)\" [hlmDropdownMenuTrigger]=\"button.yuwDropdownMenuTrigger\"\n [class]=\"button.class\">\n {{ button.label }}\n </a>\n } @else {\n <button hlmBtn [variant]=\"button.variant\" [size]=\"button.size\" [type]=\"button.type\" [disabled]=\"button.disabled\"\n [attr.data-yuw-color]=\"button.color\" [attr.aria-label]=\"button.ariaLabel\"\n (click)=\"onGroupClick(button, $event)\" [hlmDropdownMenuTrigger]=\"button.yuwDropdownMenuTrigger\"\n [class]=\"button.class\">\n {{ button.label }}\n </button>\n }\n }\n </div>\n} @else if (href(); as hrefValue) {\n <a hlmBtn [variant]=\"variant()\" [size]=\"size()\" [disabled]=\"disabled()\" [href]=\"disabled() ? null : hrefValue\"\n [target]=\"target()\" [attr.aria-label]=\"ariaLabel()\" (click)=\"onClick($event)\"\n [hlmDropdownMenuTrigger]=\"yuwDropdownMenuTrigger()\" [class]=\"_btnClass()\">\n <ng-content select=\"[yuwButtonIcon]\"/>\n <ng-content/>\n </a>\n} @else {\n <button hlmBtn [variant]=\"variant()\" [size]=\"size()\" [type]=\"type()\" [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\" (click)=\"onClick($event)\" [hlmDropdownMenuTrigger]=\"yuwDropdownMenuTrigger()\"\n [class]=\"_btnClass()\">\n <ng-content select=\"[yuwButtonIcon]\"/>\n <ng-content/>\n </button>\n}\n", dependencies: [{ kind: "directive", type: HlmButton, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size"], exportAs: ["hlmBtn"] }, { kind: "directive", type: HlmButtonGroup, selector: "[hlmButtonGroup],hlm-button-group", inputs: ["orientation"] }, { kind: "directive", type: HlmDropdownMenuTrigger, selector: "[hlmDropdownMenuTrigger]", inputs: ["align", "side"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
291
|
+
}
|
|
292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwButtonComponent, decorators: [{
|
|
293
|
+
type: Component,
|
|
294
|
+
args: [{ selector: 'yuw-button', imports: [HlmButton, HlmButtonGroup, HlmDropdownMenuTrigger], host: {
|
|
295
|
+
'[class.cursor-not-allowed]': 'disabled()',
|
|
296
|
+
'[attr.data-yuw-color]': 'color()',
|
|
297
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (_isGroup()) {\n <div hlmButtonGroup [orientation]=\"orientation()\" [attr.aria-label]=\"groupAriaLabel()\">\n @for (button of _resolved(); track button.id) {\n @if (button.href && !button.disabled) {\n <a hlmBtn [variant]=\"button.variant\" [size]=\"button.size\" [href]=\"button.href\" [target]=\"button.target\"\n [attr.data-yuw-color]=\"button.color\" [attr.aria-label]=\"button.ariaLabel\"\n (click)=\"onGroupClick(button, $event)\" [hlmDropdownMenuTrigger]=\"button.yuwDropdownMenuTrigger\"\n [class]=\"button.class\">\n {{ button.label }}\n </a>\n } @else {\n <button hlmBtn [variant]=\"button.variant\" [size]=\"button.size\" [type]=\"button.type\" [disabled]=\"button.disabled\"\n [attr.data-yuw-color]=\"button.color\" [attr.aria-label]=\"button.ariaLabel\"\n (click)=\"onGroupClick(button, $event)\" [hlmDropdownMenuTrigger]=\"button.yuwDropdownMenuTrigger\"\n [class]=\"button.class\">\n {{ button.label }}\n </button>\n }\n }\n </div>\n} @else if (href(); as hrefValue) {\n <a hlmBtn [variant]=\"variant()\" [size]=\"size()\" [disabled]=\"disabled()\" [href]=\"disabled() ? null : hrefValue\"\n [target]=\"target()\" [attr.aria-label]=\"ariaLabel()\" (click)=\"onClick($event)\"\n [hlmDropdownMenuTrigger]=\"yuwDropdownMenuTrigger()\" [class]=\"_btnClass()\">\n <ng-content select=\"[yuwButtonIcon]\"/>\n <ng-content/>\n </a>\n} @else {\n <button hlmBtn [variant]=\"variant()\" [size]=\"size()\" [type]=\"type()\" [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\" (click)=\"onClick($event)\" [hlmDropdownMenuTrigger]=\"yuwDropdownMenuTrigger()\"\n [class]=\"_btnClass()\">\n <ng-content select=\"[yuwButtonIcon]\"/>\n <ng-content/>\n </button>\n}\n" }]
|
|
298
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], transparent: [{ type: i0.Input, args: [{ isSignal: true, alias: "transparent", required: false }] }], yuwDropdownMenuTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "yuwDropdownMenuTrigger", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], buttons: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttons", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], groupAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupAriaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }], buttonClicked: [{ type: i0.Output, args: ["buttonClicked"] }] } });
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Renders a small badge or tag component for status indicators, counts, and category labels.
|
|
302
|
+
*
|
|
303
|
+
* Supports the shared color vocabulary (`color`, any `YuwColorDto` value), variant styles
|
|
304
|
+
* (`variant`), dismissible action (`removeLabel` / `removed`), and a compact dot mode (`dot`)
|
|
305
|
+
* that renders no content at all.
|
|
306
|
+
*
|
|
307
|
+
* Usage:
|
|
308
|
+
* ```html
|
|
309
|
+
* <yuw-badge color="primary">New</yuw-badge>
|
|
310
|
+
* <yuw-badge removeLabel="Remove tag" (removed)="onRemove()">Category</yuw-badge>
|
|
311
|
+
* <yuw-badge dot color="success" />
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
314
|
+
class YuwBadgeComponent {
|
|
315
|
+
constructor() {
|
|
316
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
317
|
+
this.removeLabel = input(undefined, ...(ngDevMode ? [{ debugName: "removeLabel" }] : /* istanbul ignore next */ []));
|
|
318
|
+
this.dot = input(false, { ...(ngDevMode ? { debugName: "dot" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
319
|
+
this.removed = output();
|
|
320
|
+
this.dotClass = computed(() => (this.dot() ? 'size-4 p-0' : ''), ...(ngDevMode ? [{ debugName: "dotClass" }] : /* istanbul ignore next */ []));
|
|
321
|
+
}
|
|
322
|
+
onRemoveClick(event) {
|
|
323
|
+
event.stopPropagation();
|
|
324
|
+
this.removed.emit();
|
|
325
|
+
}
|
|
326
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwBadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
327
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwBadgeComponent, isStandalone: true, selector: "yuw-badge", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null }, dot: { classPropertyName: "dot", publicName: "dot", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { removed: "removed" }, host: { properties: { "class": "dotClass()", "attr.data-yuw-color": "color()" } }, providers: [provideIcons({ lucideX })], hostDirectives: [{ directive: i1.HlmBadge, inputs: ["variant", "variant"] }], ngImport: i0, template: "@if (!dot()) {\n <ng-content select=\"[yuwBadgeIcon]\"/>\n <span class=\"truncate\"><ng-content/></span>\n\n @if (removeLabel()) {\n <button type=\"button\" hlmBtn variant=\"ghost\" size=\"icon-xs\" [attr.aria-label]=\"removeLabel()\"\n (click)=\"onRemoveClick($event)\">\n <ng-icon name=\"lucideX\"/>\n </button>\n }\n}\n", dependencies: [{ kind: "directive", type: HlmButton, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size"], exportAs: ["hlmBtn"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
328
|
+
}
|
|
329
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwBadgeComponent, decorators: [{
|
|
330
|
+
type: Component,
|
|
331
|
+
args: [{ selector: 'yuw-badge', hostDirectives: [{ directive: HlmBadge, inputs: ['variant'] }], imports: [HlmButton, NgIcon], providers: [provideIcons({ lucideX })], host: {
|
|
332
|
+
'[class]': 'dotClass()',
|
|
333
|
+
'[attr.data-yuw-color]': 'color()',
|
|
334
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!dot()) {\n <ng-content select=\"[yuwBadgeIcon]\"/>\n <span class=\"truncate\"><ng-content/></span>\n\n @if (removeLabel()) {\n <button type=\"button\" hlmBtn variant=\"ghost\" size=\"icon-xs\" [attr.aria-label]=\"removeLabel()\"\n (click)=\"onRemoveClick($event)\">\n <ng-icon name=\"lucideX\"/>\n </button>\n }\n}\n" }]
|
|
335
|
+
}], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], dot: [{ type: i0.Input, args: [{ isSignal: true, alias: "dot", required: false }] }], removed: [{ type: i0.Output, args: ["removed"] }] } });
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Navigation breadcrumb bar displaying page hierarchy and links.
|
|
339
|
+
*
|
|
340
|
+
* Accepts an array of item objects (`items`), custom separator text (`separator`), and a required
|
|
341
|
+
* accessible label (`ariaLabel`). The last item is announced as the current page
|
|
342
|
+
* (`aria-current="page"`); intermediate items render as links when they have an `href` and as
|
|
343
|
+
* plain text otherwise.
|
|
344
|
+
*
|
|
345
|
+
* Usage:
|
|
346
|
+
* ```html
|
|
347
|
+
* <yuw-breadcrumb
|
|
348
|
+
* [items]="[{ label: 'Inicio', href: '/' }, { label: 'Ajustes' }]"
|
|
349
|
+
* ariaLabel="Ruta de navegación"
|
|
350
|
+
* />
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
class YuwBreadcrumbComponent {
|
|
354
|
+
constructor() {
|
|
355
|
+
this.items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
356
|
+
this.separator = input('/', ...(ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []));
|
|
357
|
+
this.ariaLabel = input.required(...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
358
|
+
}
|
|
359
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwBreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
360
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwBreadcrumbComponent, isStandalone: true, selector: "yuw-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<nav hlmBreadcrumb [aria-label]=\"ariaLabel()\">\n <ol hlmBreadcrumbList>\n @for (item of items(); track $index; let last = $last) {\n <li hlmBreadcrumbItem>\n @if (last) {\n <span hlmBreadcrumbPage>{{ item.label }}</span>\n } @else if (item.href) {\n <a hlmBreadcrumbLink [link]=\"item.href\">{{ item.label }}</a>\n } @else {\n <span class=\"text-foreground font-normal\">{{ item.label }}</span>\n }\n </li>\n @if (!last) {\n <li hlmBreadcrumbSeparator>{{ separator() }}</li>\n }\n }\n </ol>\n</nav>\n", dependencies: [{ kind: "directive", type: i1$1.HlmBreadcrumb, selector: "[hlmBreadcrumb]", inputs: ["aria-label"] }, { kind: "component", type: i1$1.HlmBreadcrumbSeparator, selector: "[hlmBreadcrumbSeparator]" }, { kind: "directive", type: i1$1.HlmBreadcrumbItem, selector: "[hlmBreadcrumbItem]" }, { kind: "directive", type: i1$1.HlmBreadcrumbLink, selector: "[hlmBreadcrumbLink]", inputs: ["link"] }, { kind: "directive", type: i1$1.HlmBreadcrumbPage, selector: "[hlmBreadcrumbPage]" }, { kind: "directive", type: i1$1.HlmBreadcrumbList, selector: "[hlmBreadcrumbList]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
361
|
+
}
|
|
362
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwBreadcrumbComponent, decorators: [{
|
|
363
|
+
type: Component,
|
|
364
|
+
args: [{ selector: 'yuw-breadcrumb', imports: [...HlmBreadcrumbImports], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav hlmBreadcrumb [aria-label]=\"ariaLabel()\">\n <ol hlmBreadcrumbList>\n @for (item of items(); track $index; let last = $last) {\n <li hlmBreadcrumbItem>\n @if (last) {\n <span hlmBreadcrumbPage>{{ item.label }}</span>\n } @else if (item.href) {\n <a hlmBreadcrumbLink [link]=\"item.href\">{{ item.label }}</a>\n } @else {\n <span class=\"text-foreground font-normal\">{{ item.label }}</span>\n }\n </li>\n @if (!last) {\n <li hlmBreadcrumbSeparator>{{ separator() }}</li>\n }\n }\n </ol>\n</nav>\n" }]
|
|
365
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], separator: [{ type: i0.Input, args: [{ isSignal: true, alias: "separator", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: true }] }] } });
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Pure function on purpose: the page-range math has nothing to do with Angular, so it's testable
|
|
369
|
+
* in isolation and keeps `pagination.component.ts` limited to wiring inputs/outputs.
|
|
370
|
+
*
|
|
371
|
+
* Always shows page 1 and the last page, plus the current page and its immediate neighbors,
|
|
372
|
+
* collapsing any gap into a single `'ellipsis'` entry.
|
|
373
|
+
*/
|
|
374
|
+
function getPaginationRange(page, totalPages) {
|
|
375
|
+
if (totalPages <= 7) {
|
|
376
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
377
|
+
}
|
|
378
|
+
const range = [1];
|
|
379
|
+
const start = Math.max(2, page - 1);
|
|
380
|
+
const end = Math.min(totalPages - 1, page + 1);
|
|
381
|
+
if (start > 2) {
|
|
382
|
+
range.push('ellipsis');
|
|
383
|
+
}
|
|
384
|
+
for (let i = start; i <= end; i++) {
|
|
385
|
+
range.push(i);
|
|
386
|
+
}
|
|
387
|
+
if (end < totalPages - 1) {
|
|
388
|
+
range.push('ellipsis');
|
|
389
|
+
}
|
|
390
|
+
range.push(totalPages);
|
|
391
|
+
return range;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Pagination navigation bar for navigating multi-page content datasets.
|
|
396
|
+
*
|
|
397
|
+
* Controls two-way active page state `[(page)]`, accepts total pages (`totalPages`), accessible
|
|
398
|
+
* previous/next/ellipsis labels, size and color theme.
|
|
399
|
+
*
|
|
400
|
+
* Usage:
|
|
401
|
+
* ```html
|
|
402
|
+
* <yuw-pagination
|
|
403
|
+
* [(page)]="currentPage"
|
|
404
|
+
* [totalPages]="10"
|
|
405
|
+
* previousLabel="Página anterior"
|
|
406
|
+
* nextLabel="Página siguiente"
|
|
407
|
+
* ellipsisSrText="Más páginas"
|
|
408
|
+
* />
|
|
409
|
+
* ```
|
|
410
|
+
*/
|
|
411
|
+
class YuwPaginationComponent {
|
|
412
|
+
constructor() {
|
|
413
|
+
this.page = model.required(...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
414
|
+
this.totalPages = input.required(...(ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []));
|
|
415
|
+
this.previousLabel = input.required(...(ngDevMode ? [{ debugName: "previousLabel" }] : /* istanbul ignore next */ []));
|
|
416
|
+
this.nextLabel = input.required(...(ngDevMode ? [{ debugName: "nextLabel" }] : /* istanbul ignore next */ []));
|
|
417
|
+
this.ellipsisSrText = input.required(...(ngDevMode ? [{ debugName: "ellipsisSrText" }] : /* istanbul ignore next */ []));
|
|
418
|
+
this.size = input('icon', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
419
|
+
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
420
|
+
this.ariaLabel = input.required(...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
421
|
+
this.range = computed(() => getPaginationRange(this.page(), this.totalPages()), ...(ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []));
|
|
422
|
+
}
|
|
423
|
+
goTo(target) {
|
|
424
|
+
if (target < 1 || target > this.totalPages() || target === this.page()) {
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
this.page.set(target);
|
|
428
|
+
}
|
|
429
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
430
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwPaginationComponent, isStandalone: true, selector: "yuw-pagination", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: true, transformFunction: null }, totalPages: { classPropertyName: "totalPages", publicName: "totalPages", isSignal: true, isRequired: true, transformFunction: null }, previousLabel: { classPropertyName: "previousLabel", publicName: "previousLabel", isSignal: true, isRequired: true, transformFunction: null }, nextLabel: { classPropertyName: "nextLabel", publicName: "nextLabel", isSignal: true, isRequired: true, transformFunction: null }, ellipsisSrText: { classPropertyName: "ellipsisSrText", publicName: "ellipsisSrText", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { page: "pageChange" }, host: { properties: { "attr.data-yuw-color": "color()" }, classAttribute: "contents" }, providers: [provideIcons({ lucideChevronLeft, lucideChevronRight })], ngImport: i0, template: "<nav hlmPagination [aria-label]=\"ariaLabel()\">\n <ul hlmPaginationContent>\n <li hlmPaginationItem>\n <button\n type=\"button\"\n hlmPaginationLink\n [size]=\"size()\"\n [disabled]=\"page() <= 1\"\n [attr.aria-label]=\"previousLabel()\"\n (click)=\"goTo(page() - 1)\"\n >\n <ng-icon name=\"lucideChevronLeft\" class=\"rtl:rotate-180\"/>\n </button>\n </li>\n\n @for (entry of range(); track $index) {\n <li hlmPaginationItem>\n @if (entry === 'ellipsis') {\n <hlm-pagination-ellipsis [srOnlyText]=\"ellipsisSrText()\"/>\n\n } @else if (entry === page()) {\n <button\n type=\"button\"\n hlmPaginationLink\n isActive\n [size]=\"size()\"\n class=\"border-transparent bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground dark:border-transparent dark:bg-primary dark:hover:bg-primary\"\n (click)=\"goTo(entry)\"\n >\n {{ entry }}\n </button>\n } @else {\n <button type=\"button\" hlmPaginationLink [size]=\"size()\" (click)=\"goTo(entry)\">\n {{ entry }}\n </button>\n }\n </li>\n }\n\n <li hlmPaginationItem>\n <button\n type=\"button\"\n hlmPaginationLink\n [size]=\"size()\"\n [disabled]=\"page() >= totalPages()\"\n [attr.aria-label]=\"nextLabel()\"\n (click)=\"goTo(page() + 1)\"\n >\n <ng-icon name=\"lucideChevronRight\" class=\"rtl:rotate-180\"/>\n </button>\n </li>\n </ul>\n</nav>\n", dependencies: [{ kind: "directive", type: HlmPagination, selector: "[hlmPagination],hlm-pagination", inputs: ["aria-label"] }, { kind: "directive", type: HlmPaginationContent, selector: "ul[hlmPaginationContent]" }, { kind: "directive", type: HlmPaginationItem, selector: "li[hlmPaginationItem]" }, { kind: "directive", type: HlmPaginationLink, selector: "[hlmPaginationLink]", inputs: ["isActive", "size", "link"] }, { kind: "component", type: HlmPaginationEllipsis, selector: "hlm-pagination-ellipsis", inputs: ["srOnlyText"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
431
|
+
}
|
|
432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwPaginationComponent, decorators: [{
|
|
433
|
+
type: Component,
|
|
434
|
+
args: [{ selector: 'yuw-pagination', imports: [HlmPagination, HlmPaginationContent, HlmPaginationItem, HlmPaginationLink, HlmPaginationEllipsis, NgIcon], providers: [provideIcons({ lucideChevronLeft, lucideChevronRight })], host: {
|
|
435
|
+
class: 'contents',
|
|
436
|
+
'[attr.data-yuw-color]': 'color()',
|
|
437
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav hlmPagination [aria-label]=\"ariaLabel()\">\n <ul hlmPaginationContent>\n <li hlmPaginationItem>\n <button\n type=\"button\"\n hlmPaginationLink\n [size]=\"size()\"\n [disabled]=\"page() <= 1\"\n [attr.aria-label]=\"previousLabel()\"\n (click)=\"goTo(page() - 1)\"\n >\n <ng-icon name=\"lucideChevronLeft\" class=\"rtl:rotate-180\"/>\n </button>\n </li>\n\n @for (entry of range(); track $index) {\n <li hlmPaginationItem>\n @if (entry === 'ellipsis') {\n <hlm-pagination-ellipsis [srOnlyText]=\"ellipsisSrText()\"/>\n\n } @else if (entry === page()) {\n <button\n type=\"button\"\n hlmPaginationLink\n isActive\n [size]=\"size()\"\n class=\"border-transparent bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground dark:border-transparent dark:bg-primary dark:hover:bg-primary\"\n (click)=\"goTo(entry)\"\n >\n {{ entry }}\n </button>\n } @else {\n <button type=\"button\" hlmPaginationLink [size]=\"size()\" (click)=\"goTo(entry)\">\n {{ entry }}\n </button>\n }\n </li>\n }\n\n <li hlmPaginationItem>\n <button\n type=\"button\"\n hlmPaginationLink\n [size]=\"size()\"\n [disabled]=\"page() >= totalPages()\"\n [attr.aria-label]=\"nextLabel()\"\n (click)=\"goTo(page() + 1)\"\n >\n <ng-icon name=\"lucideChevronRight\" class=\"rtl:rotate-180\"/>\n </button>\n </li>\n </ul>\n</nav>\n" }]
|
|
438
|
+
}], propDecorators: { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: true }] }, { type: i0.Output, args: ["pageChange"] }], totalPages: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalPages", required: true }] }], previousLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousLabel", required: true }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: true }] }], ellipsisSrText: [{ type: i0.Input, args: [{ isSignal: true, alias: "ellipsisSrText", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: true }] }] } });
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Structural directive for custom option item templates in `yuw-combobox`.
|
|
442
|
+
*
|
|
443
|
+
* Exposes the option object (`let-option`) and selection state (`let-selected="selected"`).
|
|
444
|
+
*
|
|
445
|
+
* Usage:
|
|
446
|
+
* ```html
|
|
447
|
+
* <yuw-combobox [options]="users" [(value)]="userId">
|
|
448
|
+
* <ng-template yuwComboboxItem let-option let-selected="selected">
|
|
449
|
+
* <img [src]="option.data.avatar" /> {{ option.label }}
|
|
450
|
+
* </ng-template>
|
|
451
|
+
* </yuw-combobox>
|
|
452
|
+
* ```
|
|
453
|
+
*/
|
|
454
|
+
class YuwComboboxItemDirective {
|
|
455
|
+
constructor() {
|
|
456
|
+
this.templateRef = inject(TemplateRef);
|
|
457
|
+
this.typeOf = input(undefined, { ...(ngDevMode ? { debugName: "typeOf" } : /* istanbul ignore next */ {}), alias: 'yuwComboboxItemTypeOf' });
|
|
458
|
+
}
|
|
459
|
+
static ngTemplateContextGuard(_directive, _context) {
|
|
460
|
+
return true;
|
|
461
|
+
}
|
|
462
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwComboboxItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
463
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: YuwComboboxItemDirective, isStandalone: true, selector: "[yuwComboboxItem]", inputs: { typeOf: { classPropertyName: "typeOf", publicName: "yuwComboboxItemTypeOf", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
464
|
+
}
|
|
465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwComboboxItemDirective, decorators: [{
|
|
466
|
+
type: Directive,
|
|
467
|
+
args: [{
|
|
468
|
+
selector: '[yuwComboboxItem]',
|
|
469
|
+
}]
|
|
470
|
+
}], propDecorators: { typeOf: [{ type: i0.Input, args: [{ isSignal: true, alias: "yuwComboboxItemTypeOf", required: false }] }] } });
|
|
471
|
+
|
|
472
|
+
/** Module-level counter for the fallback control id, so external labels always have a stable,
|
|
473
|
+
* unique target even when the consumer doesn't pass `inputId`. */
|
|
474
|
+
let nextUniqueId$2 = 0;
|
|
475
|
+
/**
|
|
476
|
+
* Searchable select combobox component supporting single or multiple selections, search filtering, and custom option rendering.
|
|
477
|
+
*
|
|
478
|
+
* Inputs / Models:
|
|
479
|
+
* - `options`: Required array of option items (`YuwComboboxOptionDto<TData>[]`).
|
|
480
|
+
* - `value`: Two-way selected value(s) (`string` for single mode, `string[]` for multiple mode).
|
|
481
|
+
* Emits `valueChange` on every selection change.
|
|
482
|
+
* - `multiple`: Enables multi-selection mode with removable tags/chips.
|
|
483
|
+
* - `disabled`: Disables combobox interaction.
|
|
484
|
+
* - `placeholder`: Placeholder text when no option is selected.
|
|
485
|
+
* - `searchPlaceholder`: Placeholder text inside the search field popover.
|
|
486
|
+
* - `emptyText`: Message text displayed when search yields no matching options.
|
|
487
|
+
* - `search`: Two-way search filter query string.
|
|
488
|
+
* - `triggerAriaLabel`: Required accessible name for the icon-only popover trigger (the chevron
|
|
489
|
+
* button). User-facing text — the consuming app is responsible for providing it translated.
|
|
490
|
+
* Only rendered by the single-select input shape, but required in every mode so switching
|
|
491
|
+
* modes never silently drops the label.
|
|
492
|
+
* - `clearAriaLabel`: When set, the clear button is shown on the single-selection control and
|
|
493
|
+
* this is its accessible name; when absent, there is no clear button. One input, one source of
|
|
494
|
+
* truth. User-facing text — the consuming app is responsible for providing it translated.
|
|
495
|
+
* - `inputId`: HTML `id` for the focusable control (the search input, or the trigger button when
|
|
496
|
+
* `readonlyTrigger` is set), enabling external `<label for="...">` association.
|
|
497
|
+
* - `readonlyTrigger`: Renders control as a button showing selected label, placing search input inside popover.
|
|
498
|
+
* - `invalid`: Forces invalid styling.
|
|
499
|
+
*
|
|
500
|
+
* `multiple` takes precedence over `readonlyTrigger`: when both are set the multi-select
|
|
501
|
+
* chips shape renders and `readonlyTrigger` is ignored.
|
|
502
|
+
*
|
|
503
|
+
* Usage:
|
|
504
|
+
* ```html
|
|
505
|
+
* <yuw-combobox [options]="userOptions" [(value)]="selectedUser" placeholder="Select user..."
|
|
506
|
+
* triggerAriaLabel="Toggle options" clearAriaLabel="Clear selection" />
|
|
507
|
+
* <yuw-combobox [options]="categoryOptions" [(value)]="selectedCategories" multiple
|
|
508
|
+
* triggerAriaLabel="Toggle options" />
|
|
509
|
+
* ```
|
|
510
|
+
*/
|
|
511
|
+
class YuwComboboxComponent extends YuwValueAccessorBase {
|
|
512
|
+
constructor() {
|
|
513
|
+
super(...arguments);
|
|
514
|
+
this.options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
515
|
+
this.value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
516
|
+
this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
517
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
518
|
+
this.placeholder = input(undefined, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
519
|
+
this.searchPlaceholder = input(undefined, ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
520
|
+
this.emptyText = input(undefined, ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
521
|
+
this.search = model('', ...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
|
|
522
|
+
this.triggerAriaLabel = input.required(...(ngDevMode ? [{ debugName: "triggerAriaLabel" }] : /* istanbul ignore next */ []));
|
|
523
|
+
this.clearAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "clearAriaLabel" }] : /* istanbul ignore next */ []));
|
|
524
|
+
this.inputId = input(undefined, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
525
|
+
this.readonlyTrigger = input(false, { ...(ngDevMode ? { debugName: "readonlyTrigger" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
526
|
+
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
527
|
+
this.itemTemplate = contentChild(YuwComboboxItemDirective, ...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
528
|
+
this._panel = viewChild(HlmComboboxContent, { ...(ngDevMode ? { debugName: "_panel" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
529
|
+
this._disabled = computed(() => this._isDisabled(this.disabled()), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
530
|
+
this._clearVisible = computed(() => this.clearAriaLabel() !== undefined, ...(ngDevMode ? [{ debugName: "_clearVisible" }] : /* istanbul ignore next */ []));
|
|
531
|
+
this._generatedId = `yuw-combobox-${++nextUniqueId$2}`;
|
|
532
|
+
this._controlId = computed(() => this.inputId() ?? this._generatedId, ...(ngDevMode ? [{ debugName: "_controlId" }] : /* istanbul ignore next */ []));
|
|
533
|
+
this._singleValue = computed(() => {
|
|
534
|
+
const value = this.value();
|
|
535
|
+
return Array.isArray(value) ? value[0] : value;
|
|
536
|
+
}, ...(ngDevMode ? [{ debugName: "_singleValue" }] : /* istanbul ignore next */ []));
|
|
537
|
+
this._multipleValue = computed(() => {
|
|
538
|
+
const value = this.value();
|
|
539
|
+
if (value === undefined) {
|
|
540
|
+
return [];
|
|
541
|
+
}
|
|
542
|
+
return Array.isArray(value) ? value : [value];
|
|
543
|
+
}, ...(ngDevMode ? [{ debugName: "_multipleValue" }] : /* istanbul ignore next */ []));
|
|
544
|
+
this._labelByValue = computed(() => new Map(this.options().map((option) => [option.value, option.label])), ...(ngDevMode ? [{ debugName: "_labelByValue" }] : /* istanbul ignore next */ []));
|
|
545
|
+
this._selectedChips = computed(() => {
|
|
546
|
+
const labels = this._labelByValue();
|
|
547
|
+
return this._multipleValue().map((value) => ({ value, label: labels.get(value) ?? value }));
|
|
548
|
+
}, ...(ngDevMode ? [{ debugName: "_selectedChips" }] : /* istanbul ignore next */ []));
|
|
549
|
+
this._selectedValues = computed(() => new Set(this._multipleValue()), ...(ngDevMode ? [{ debugName: "_selectedValues" }] : /* istanbul ignore next */ []));
|
|
550
|
+
this._itemToString = (value) => this._labelByValue().get(value) ?? value;
|
|
551
|
+
}
|
|
552
|
+
_emptyValue() {
|
|
553
|
+
return this.multiple() ? [] : undefined;
|
|
554
|
+
}
|
|
555
|
+
onValueChange(next) {
|
|
556
|
+
this._commit(next ?? this._emptyValue());
|
|
557
|
+
}
|
|
558
|
+
_onFocusOut(event) {
|
|
559
|
+
const next = event.relatedTarget;
|
|
560
|
+
if (next instanceof Node) {
|
|
561
|
+
if (event.currentTarget instanceof Node && event.currentTarget.contains(next)) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
const panel = this._panel()?.nativeElement;
|
|
565
|
+
if (panel?.contains(next)) {
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
this._onBlur();
|
|
570
|
+
}
|
|
571
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwComboboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
572
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwComboboxComponent, isStandalone: true, selector: "yuw-combobox", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, triggerAriaLabel: { classPropertyName: "triggerAriaLabel", publicName: "triggerAriaLabel", isSignal: true, isRequired: true, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, readonlyTrigger: { classPropertyName: "readonlyTrigger", publicName: "readonlyTrigger", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", search: "searchChange" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwComboboxComponent)], queries: [{ propertyName: "itemTemplate", first: true, predicate: YuwComboboxItemDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_panel", first: true, predicate: HlmComboboxContent, descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<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@if (multiple()) {\n <hlm-combobox-multiple [disabled]=\"_disabled()\" [value]=\"_multipleValue()\" (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\" [itemToString]=\"_itemToString\" (focusout)=\"_onFocusOut($event)\">\n <hlm-combobox-chips [forceInvalid]=\"invalid()\">\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 <hlm-combobox-content *hlmComboboxPortal>\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 </hlm-combobox-content>\n </hlm-combobox-multiple>\n} @else {\n <hlm-combobox [disabled]=\"_disabled()\" [value]=\"_singleValue()\" (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\" [itemToString]=\"_itemToString\" (focusout)=\"_onFocusOut($event)\">\n @if (readonlyTrigger()) {\n <hlm-combobox-trigger [buttonId]=\"_controlId()\" [forceInvalid]=\"invalid()\">\n <hlm-combobox-value [placeholder]=\"placeholder() ?? ''\"/>\n </hlm-combobox-trigger>\n } @else {\n <hlm-combobox-input [inputId]=\"_controlId()\" [placeholder]=\"placeholder() ?? ''\"\n [showClear]=\"_clearVisible()\" [clearAriaLabel]=\"clearAriaLabel() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\" [forceInvalid]=\"invalid()\"/>\n }\n\n <hlm-combobox-content *hlmComboboxPortal>\n @if (readonlyTrigger()) {\n <hlm-combobox-input [placeholder]=\"searchPlaceholder() ?? ''\" [showClear]=\"_clearVisible()\"\n [clearAriaLabel]=\"clearAriaLabel() ?? ''\" [triggerAriaLabel]=\"triggerAriaLabel()\"\n [showTrigger]=\"false\"/>\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 </hlm-combobox-content>\n </hlm-combobox>\n}\n", dependencies: [{ kind: "directive", type: i1$2.HlmCombobox, selector: "[hlmCombobox],hlm-combobox" }, { kind: "component", type: i1$2.HlmComboboxChip, selector: "hlm-combobox-chip", inputs: ["showRemove"] }, { kind: "directive", type: i1$2.HlmComboboxChipInput, selector: "input[hlmComboboxChipInput]" }, { kind: "directive", type: i1$2.HlmComboboxChips, selector: "[hlmComboboxChips],hlm-combobox-chips", inputs: ["forceInvalid"] }, { kind: "directive", type: i1$2.HlmComboboxContent, selector: "[hlmComboboxContent],hlm-combobox-content" }, { kind: "directive", type: i1$2.HlmComboboxEmpty, selector: "[hlmComboboxEmpty],hlm-combobox-empty" }, { kind: "component", type: i1$2.HlmComboboxInput, selector: "hlm-combobox-input", inputs: ["inputId", "placeholder", "showTrigger", "showClear", "forceInvalid", "triggerAriaLabel", "clearAriaLabel", "aria-invalid"] }, { kind: "component", type: i1$2.HlmComboboxItem, selector: "hlm-combobox-item" }, { kind: "directive", type: i1$2.HlmComboboxList, selector: "[hlmComboboxList]" }, { kind: "directive", type: i1$2.HlmComboboxMultiple, selector: "[hlmComboboxMultiple],hlm-combobox-multiple" }, { kind: "directive", type: i1$2.HlmComboboxPortal, selector: "[hlmComboboxPortal]" }, { kind: "component", type: i1$2.HlmComboboxTrigger, selector: "hlm-combobox-trigger", inputs: ["class", "buttonId", "variant", "forceInvalid"] }, { kind: "directive", type: i1$2.HlmComboboxValue, selector: "[hlmComboboxValue],hlm-combobox-value" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
573
|
+
}
|
|
574
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwComboboxComponent, decorators: [{
|
|
575
|
+
type: Component,
|
|
576
|
+
args: [{ selector: 'yuw-combobox', imports: [...HlmComboboxImports, NgTemplateOutlet], providers: [provideValueAccessor(YuwComboboxComponent)], host: {
|
|
577
|
+
class: 'contents',
|
|
578
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<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@if (multiple()) {\n <hlm-combobox-multiple [disabled]=\"_disabled()\" [value]=\"_multipleValue()\" (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\" [itemToString]=\"_itemToString\" (focusout)=\"_onFocusOut($event)\">\n <hlm-combobox-chips [forceInvalid]=\"invalid()\">\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 <hlm-combobox-content *hlmComboboxPortal>\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 </hlm-combobox-content>\n </hlm-combobox-multiple>\n} @else {\n <hlm-combobox [disabled]=\"_disabled()\" [value]=\"_singleValue()\" (valueChange)=\"onValueChange($event)\"\n [(search)]=\"search\" [itemToString]=\"_itemToString\" (focusout)=\"_onFocusOut($event)\">\n @if (readonlyTrigger()) {\n <hlm-combobox-trigger [buttonId]=\"_controlId()\" [forceInvalid]=\"invalid()\">\n <hlm-combobox-value [placeholder]=\"placeholder() ?? ''\"/>\n </hlm-combobox-trigger>\n } @else {\n <hlm-combobox-input [inputId]=\"_controlId()\" [placeholder]=\"placeholder() ?? ''\"\n [showClear]=\"_clearVisible()\" [clearAriaLabel]=\"clearAriaLabel() ?? ''\"\n [triggerAriaLabel]=\"triggerAriaLabel()\" [forceInvalid]=\"invalid()\"/>\n }\n\n <hlm-combobox-content *hlmComboboxPortal>\n @if (readonlyTrigger()) {\n <hlm-combobox-input [placeholder]=\"searchPlaceholder() ?? ''\" [showClear]=\"_clearVisible()\"\n [clearAriaLabel]=\"clearAriaLabel() ?? ''\" [triggerAriaLabel]=\"triggerAriaLabel()\"\n [showTrigger]=\"false\"/>\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 </hlm-combobox-content>\n </hlm-combobox>\n}\n" }]
|
|
579
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }, { type: i0.Output, args: ["searchChange"] }], triggerAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerAriaLabel", required: true }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], readonlyTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonlyTrigger", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwComboboxItemDirective), { isSignal: true }] }], _panel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => HlmComboboxContent), { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Container directive for collapsible accordion items.
|
|
583
|
+
*
|
|
584
|
+
* Renders a full-width flexible vertical container for `yuw-accordion-item` elements.
|
|
585
|
+
* Supports single (`type="single"`) or multiple (`type="multiple"`) expandable items,
|
|
586
|
+
* as well as vertical or horizontal orientation (`orientation`).
|
|
587
|
+
*
|
|
588
|
+
* Direct child items (`yuw-accordion-item`) can be declared statically or rendered dynamically
|
|
589
|
+
* using `@for`.
|
|
590
|
+
*
|
|
591
|
+
* Extends `HlmAccordion` (instead of re-applying `BrnAccordion` and copying the helm's classes
|
|
592
|
+
* by hand) so the helm's `data-slot`, classes and its `BrnAccordion` host directive — including
|
|
593
|
+
* the forwarded `type`/`orientation` inputs — are all inherited. Forwarding those inputs through
|
|
594
|
+
* a `hostDirectives` entry on `HlmAccordion` is not possible: Angular only allows exposing
|
|
595
|
+
* inputs a host directive declares itself, and the helm exposes them transitively from
|
|
596
|
+
* `BrnAccordion`.
|
|
597
|
+
*/
|
|
598
|
+
class YuwAccordion extends HlmAccordion {
|
|
599
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAccordion, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
600
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAccordion, isStandalone: true, selector: "yuw-accordion", usesInheritance: true, ngImport: i0 }); }
|
|
601
|
+
}
|
|
602
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAccordion, decorators: [{
|
|
603
|
+
type: Directive,
|
|
604
|
+
args: [{
|
|
605
|
+
selector: 'yuw-accordion',
|
|
606
|
+
}]
|
|
607
|
+
}] });
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Directive representing an individual section/item within a `yuw-accordion`.
|
|
611
|
+
*
|
|
612
|
+
* Encloses a `yuw-accordion-trigger` button and a `yuw-accordion-content` panel.
|
|
613
|
+
* Accepts `isOpened` (boolean) to control open state and `disabled` (boolean) to disable
|
|
614
|
+
* interaction. Emits `openedChange` when the item is expanded or collapsed.
|
|
615
|
+
*
|
|
616
|
+
* Extends `HlmAccordionItem` (instead of re-applying `BrnAccordionItem` and copying the helm's
|
|
617
|
+
* classes by hand) so the helm's `data-slot`, classes and its `BrnAccordionItem` host directive —
|
|
618
|
+
* including the forwarded `isOpened`/`disabled` inputs and `openedChange` output — are all
|
|
619
|
+
* inherited. Forwarding those through a `hostDirectives` entry on `HlmAccordionItem` is not
|
|
620
|
+
* possible: Angular only allows exposing inputs/outputs a host directive declares itself, and
|
|
621
|
+
* the helm exposes them transitively from `BrnAccordionItem`.
|
|
622
|
+
*/
|
|
623
|
+
class YuwAccordionItem extends HlmAccordionItem {
|
|
624
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAccordionItem, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
625
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAccordionItem, isStandalone: true, selector: "yuw-accordion-item", usesInheritance: true, ngImport: i0 }); }
|
|
626
|
+
}
|
|
627
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAccordionItem, decorators: [{
|
|
628
|
+
type: Directive,
|
|
629
|
+
args: [{
|
|
630
|
+
selector: 'yuw-accordion-item',
|
|
631
|
+
}]
|
|
632
|
+
}] });
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Interactive header button for expanding or collapsing a `yuw-accordion-item`.
|
|
636
|
+
*
|
|
637
|
+
* Project content inside to serve as the trigger label (text, icons, badges, or custom markup).
|
|
638
|
+
*
|
|
639
|
+
* Inputs:
|
|
640
|
+
* - `triggerClass`: Extra classes for the inner trigger `<button>`; the helm merges them last
|
|
641
|
+
* (via tailwind-merge), so they win over its defaults.
|
|
642
|
+
*/
|
|
643
|
+
class YuwAccordionTriggerComponent {
|
|
644
|
+
constructor() {
|
|
645
|
+
this.triggerClass = input('', ...(ngDevMode ? [{ debugName: "triggerClass" }] : /* istanbul ignore next */ []));
|
|
646
|
+
}
|
|
647
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAccordionTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
648
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: YuwAccordionTriggerComponent, isStandalone: true, selector: "yuw-accordion-trigger", inputs: { triggerClass: { classPropertyName: "triggerClass", publicName: "triggerClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "<hlm-accordion-trigger [triggerClass]=\"triggerClass()\">\n <ng-content/>\n</hlm-accordion-trigger>\n", dependencies: [{ kind: "component", type: HlmAccordionTrigger, selector: "hlm-accordion-trigger", inputs: ["triggerClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
649
|
+
}
|
|
650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAccordionTriggerComponent, decorators: [{
|
|
651
|
+
type: Component,
|
|
652
|
+
args: [{ selector: 'yuw-accordion-trigger', imports: [HlmAccordionTrigger], host: {
|
|
653
|
+
class: 'contents',
|
|
654
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-accordion-trigger [triggerClass]=\"triggerClass()\">\n <ng-content/>\n</hlm-accordion-trigger>\n" }]
|
|
655
|
+
}], propDecorators: { triggerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerClass", required: false }] }] } });
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Collapsible panel container for a `yuw-accordion-item`.
|
|
659
|
+
*
|
|
660
|
+
* Projects body content revealed when the item is expanded (supports text, custom markup, or nested components).
|
|
661
|
+
*/
|
|
662
|
+
class YuwAccordionContentComponent {
|
|
663
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAccordionContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
664
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: YuwAccordionContentComponent, isStandalone: true, selector: "yuw-accordion-content", host: { classAttribute: "contents" }, ngImport: i0, template: "<hlm-accordion-content>\n <ng-content/>\n</hlm-accordion-content>\n", dependencies: [{ kind: "component", type: HlmAccordionContent, selector: "hlm-accordion-content" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
665
|
+
}
|
|
666
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAccordionContentComponent, decorators: [{
|
|
667
|
+
type: Component,
|
|
668
|
+
args: [{ selector: 'yuw-accordion-content', imports: [HlmAccordionContent], host: {
|
|
669
|
+
class: 'contents',
|
|
670
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-accordion-content>\n <ng-content/>\n</hlm-accordion-content>\n" }]
|
|
671
|
+
}] });
|
|
672
|
+
|
|
673
|
+
/** Bundle for consumers who want every `yuw-accordion-*` piece in one `imports: [...]` entry —
|
|
674
|
+
* same shape as Spartan's own `HlmAccordionImports`. Each piece is still exported and importable
|
|
675
|
+
* on its own for consumers who only need a subset. */
|
|
676
|
+
const YuwAccordionImports = [
|
|
677
|
+
YuwAccordion,
|
|
678
|
+
YuwAccordionItem,
|
|
679
|
+
YuwAccordionTriggerComponent,
|
|
680
|
+
YuwAccordionContentComponent,
|
|
681
|
+
];
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Slot directive for adding content (icons, text prefixes) on the left side of a `yuw-input` or `yuw-textarea`.
|
|
685
|
+
*/
|
|
686
|
+
class YuwLeftAddonDirective {
|
|
687
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwLeftAddonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
688
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwLeftAddonDirective, isStandalone: true, selector: "yuw-left-addon", ngImport: i0 }); }
|
|
689
|
+
}
|
|
690
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwLeftAddonDirective, decorators: [{
|
|
691
|
+
type: Directive,
|
|
692
|
+
args: [{
|
|
693
|
+
selector: 'yuw-left-addon',
|
|
694
|
+
}]
|
|
695
|
+
}] });
|
|
696
|
+
/**
|
|
697
|
+
* Slot directive for adding content (icons, text suffixes, action buttons) on the right side of a `yuw-input` or `yuw-textarea`.
|
|
698
|
+
*/
|
|
699
|
+
class YuwRightAddonDirective {
|
|
700
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwRightAddonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
701
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwRightAddonDirective, isStandalone: true, selector: "yuw-right-addon", ngImport: i0 }); }
|
|
702
|
+
}
|
|
703
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwRightAddonDirective, decorators: [{
|
|
704
|
+
type: Directive,
|
|
705
|
+
args: [{
|
|
706
|
+
selector: 'yuw-right-addon',
|
|
707
|
+
}]
|
|
708
|
+
}] });
|
|
709
|
+
const YuwInputAddonImports = [YuwLeftAddonDirective, YuwRightAddonDirective];
|
|
710
|
+
|
|
711
|
+
/** Module-level counter backing each instance's stable fallback `id`. */
|
|
712
|
+
let nextYuwInputId = 0;
|
|
713
|
+
/**
|
|
714
|
+
* Single-line text input control supporting two-way value binding, form controls (`formControlName`, `ngModel`),
|
|
715
|
+
* validation styling, and left/right addon slots.
|
|
716
|
+
*
|
|
717
|
+
* Inputs / Models:
|
|
718
|
+
* - `value`: Two-way text string.
|
|
719
|
+
* - `inputId`: `id` applied to the native input, for external `<label for>` association.
|
|
720
|
+
* - `type`: HTML input type (`'text'`, `'email'`, `'number'`, etc.). Default is `'text'`.
|
|
721
|
+
* - `inputmode`: Virtual keyboard hint (e.g. `'numeric'`).
|
|
722
|
+
* - `disabled`: Disables input interaction.
|
|
723
|
+
* - `readonly`: Makes the field read-only.
|
|
724
|
+
* - `required`: Marks the field as required.
|
|
725
|
+
* - `invalid`: Forces invalid styling.
|
|
726
|
+
* - `name`: HTML `name` attribute.
|
|
727
|
+
* - `autocomplete`: Native `autocomplete` attribute.
|
|
728
|
+
* - `maxlength`: Hard cap on character count, enforced natively by the browser.
|
|
729
|
+
* - `placeholder`: Hint text shown inside the empty field.
|
|
730
|
+
* - `class`: Extra classes merged onto the visual root (the input, or the input group when addons are present).
|
|
731
|
+
*
|
|
732
|
+
* Outputs:
|
|
733
|
+
* - `committed`: Emits the current value on the native `change` event (blur/enter).
|
|
734
|
+
*
|
|
735
|
+
* Usage:
|
|
736
|
+
* ```html
|
|
737
|
+
* <yuw-input [(value)]="username" placeholder="Enter username..." />
|
|
738
|
+
*
|
|
739
|
+
* <yuw-input formControlName="email" type="email">
|
|
740
|
+
* <yuw-left-addon><ng-icon name="lucideMail" /></yuw-left-addon>
|
|
741
|
+
* </yuw-input>
|
|
742
|
+
* ```
|
|
743
|
+
*/
|
|
744
|
+
class YuwInputComponent extends YuwValueAccessorBase {
|
|
745
|
+
constructor() {
|
|
746
|
+
super(...arguments);
|
|
747
|
+
this.value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
748
|
+
this.inputId = input(undefined, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
749
|
+
this.type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
750
|
+
this.inputmode = input(undefined, ...(ngDevMode ? [{ debugName: "inputmode" }] : /* istanbul ignore next */ []));
|
|
751
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
752
|
+
this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
753
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
754
|
+
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
755
|
+
this.name = input(undefined, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
756
|
+
this.autocomplete = input(undefined, ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
757
|
+
this.maxlength = input(undefined, ...(ngDevMode ? [{ debugName: "maxlength" }] : /* istanbul ignore next */ []));
|
|
758
|
+
this.placeholder = input(undefined, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
759
|
+
this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
760
|
+
this.committed = output();
|
|
761
|
+
this._autoId = `yuw-input-${++nextYuwInputId}`;
|
|
762
|
+
this._inputId = computed(() => this.inputId() ?? this._autoId, ...(ngDevMode ? [{ debugName: "_inputId" }] : /* istanbul ignore next */ []));
|
|
763
|
+
this._classes = computed(() => cn(this.userClass()), ...(ngDevMode ? [{ debugName: "_classes" }] : /* istanbul ignore next */ []));
|
|
764
|
+
this._disabled = computed(() => this._isDisabled(this.disabled()), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
765
|
+
this._leftAddons = contentChildren(YuwLeftAddonDirective, ...(ngDevMode ? [{ debugName: "_leftAddons" }] : /* istanbul ignore next */ []));
|
|
766
|
+
this._rightAddons = contentChildren(YuwRightAddonDirective, ...(ngDevMode ? [{ debugName: "_rightAddons" }] : /* istanbul ignore next */ []));
|
|
767
|
+
this._hasLeftAddon = computed(() => this._leftAddons().length > 0, ...(ngDevMode ? [{ debugName: "_hasLeftAddon" }] : /* istanbul ignore next */ []));
|
|
768
|
+
this._hasRightAddon = computed(() => this._rightAddons().length > 0, ...(ngDevMode ? [{ debugName: "_hasRightAddon" }] : /* istanbul ignore next */ []));
|
|
769
|
+
this._hasAddons = computed(() => this._hasLeftAddon() || this._hasRightAddon(), ...(ngDevMode ? [{ debugName: "_hasAddons" }] : /* istanbul ignore next */ []));
|
|
770
|
+
}
|
|
771
|
+
onInput(event) {
|
|
772
|
+
this._commit(event.target.value);
|
|
773
|
+
}
|
|
774
|
+
_emptyValue() {
|
|
775
|
+
return '';
|
|
776
|
+
}
|
|
777
|
+
onChange() {
|
|
778
|
+
this.committed.emit(this.value());
|
|
779
|
+
}
|
|
780
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
781
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwInputComponent, isStandalone: true, selector: "yuw-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, inputmode: { classPropertyName: "inputmode", publicName: "inputmode", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", committed: "committed" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwInputComponent)], queries: [{ propertyName: "_leftAddons", predicate: YuwLeftAddonDirective, isSignal: true }, { propertyName: "_rightAddons", predicate: YuwRightAddonDirective, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (_hasAddons()) {\n <hlm-input-group [class]=\"_classes()\">\n @if (_hasLeftAddon()) {\n <hlm-input-group-addon align=\"inline-start\">\n <ng-content select=\"yuw-left-addon\"/>\n </hlm-input-group-addon>\n }\n\n <input hlmInputGroupInput [id]=\"_inputId()\" [type]=\"type()\" [attr.inputmode]=\"inputmode()\" [value]=\"value()\"\n [disabled]=\"_disabled()\"\n [readOnly]=\"readonly()\" [required]=\"required()\" [forceInvalid]=\"invalid()\" [attr.name]=\"name()\"\n [attr.autocomplete]=\"autocomplete()\" [attr.maxlength]=\"maxlength()\" [attr.placeholder]=\"placeholder()\"\n (input)=\"onInput($event)\"\n (change)=\"onChange()\" (blur)=\"_onBlur()\"/>\n\n @if (_hasRightAddon()) {\n <hlm-input-group-addon align=\"inline-end\">\n <ng-content select=\"yuw-right-addon\"/>\n </hlm-input-group-addon>\n }\n </hlm-input-group>\n} @else {\n <input hlmInput [class]=\"_classes()\" [id]=\"_inputId()\" [type]=\"type()\" [attr.inputmode]=\"inputmode()\"\n [value]=\"value()\" [disabled]=\"_disabled()\"\n [readOnly]=\"readonly()\" [required]=\"required()\" [forceInvalid]=\"invalid()\" [attr.name]=\"name()\"\n [attr.autocomplete]=\"autocomplete()\" [attr.maxlength]=\"maxlength()\" [attr.placeholder]=\"placeholder()\"\n (input)=\"onInput($event)\"\n (change)=\"onChange()\" (blur)=\"_onBlur()\"/>\n}\n", dependencies: [{ kind: "directive", type: HlmInput, selector: "[hlmInput]" }, { kind: "directive", type: HlmInputGroup, selector: "[hlmInputGroup],hlm-input-group" }, { kind: "directive", type: HlmInputGroupInput, selector: "input[hlmInputGroupInput]" }, { kind: "directive", type: HlmInputGroupAddon, selector: "[hlmInputGroupAddon],hlm-input-group-addon", inputs: ["align"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
782
|
+
}
|
|
783
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwInputComponent, decorators: [{
|
|
784
|
+
type: Component,
|
|
785
|
+
args: [{ selector: 'yuw-input', imports: [HlmInput, HlmInputGroup, HlmInputGroupInput, HlmInputGroupAddon], providers: [provideValueAccessor(YuwInputComponent)], host: {
|
|
786
|
+
class: 'contents',
|
|
787
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (_hasAddons()) {\n <hlm-input-group [class]=\"_classes()\">\n @if (_hasLeftAddon()) {\n <hlm-input-group-addon align=\"inline-start\">\n <ng-content select=\"yuw-left-addon\"/>\n </hlm-input-group-addon>\n }\n\n <input hlmInputGroupInput [id]=\"_inputId()\" [type]=\"type()\" [attr.inputmode]=\"inputmode()\" [value]=\"value()\"\n [disabled]=\"_disabled()\"\n [readOnly]=\"readonly()\" [required]=\"required()\" [forceInvalid]=\"invalid()\" [attr.name]=\"name()\"\n [attr.autocomplete]=\"autocomplete()\" [attr.maxlength]=\"maxlength()\" [attr.placeholder]=\"placeholder()\"\n (input)=\"onInput($event)\"\n (change)=\"onChange()\" (blur)=\"_onBlur()\"/>\n\n @if (_hasRightAddon()) {\n <hlm-input-group-addon align=\"inline-end\">\n <ng-content select=\"yuw-right-addon\"/>\n </hlm-input-group-addon>\n }\n </hlm-input-group>\n} @else {\n <input hlmInput [class]=\"_classes()\" [id]=\"_inputId()\" [type]=\"type()\" [attr.inputmode]=\"inputmode()\"\n [value]=\"value()\" [disabled]=\"_disabled()\"\n [readOnly]=\"readonly()\" [required]=\"required()\" [forceInvalid]=\"invalid()\" [attr.name]=\"name()\"\n [attr.autocomplete]=\"autocomplete()\" [attr.maxlength]=\"maxlength()\" [attr.placeholder]=\"placeholder()\"\n (input)=\"onInput($event)\"\n (change)=\"onChange()\" (blur)=\"_onBlur()\"/>\n}\n" }]
|
|
788
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], inputmode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputmode", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], committed: [{ type: i0.Output, args: ["committed"] }], _leftAddons: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => YuwLeftAddonDirective), { isSignal: true }] }], _rightAddons: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => YuwRightAddonDirective), { isSignal: true }] }] } });
|
|
789
|
+
|
|
790
|
+
let nextYuwTextareaId = 0;
|
|
791
|
+
/**
|
|
792
|
+
* Multi-line text input control supporting auto-growing content, character limits, row count, and form integration (`ngModel`, `formControlName`).
|
|
793
|
+
*
|
|
794
|
+
* Inputs / Models:
|
|
795
|
+
* - `value`: Two-way text string.
|
|
796
|
+
* - `inputId`: `id` applied to the native textarea, for external `<label for>` association.
|
|
797
|
+
* - `disabled`: Disables input interaction.
|
|
798
|
+
* - `readonly`: Makes the field read-only.
|
|
799
|
+
* - `required`: Marks the field as required.
|
|
800
|
+
* - `invalid`: Forces invalid styling.
|
|
801
|
+
* - `name`: HTML `name` attribute.
|
|
802
|
+
* - `autocomplete`: Native `autocomplete` attribute.
|
|
803
|
+
* - `rows`: Fallback visible height in lines where `field-sizing` is unsupported; ignored otherwise.
|
|
804
|
+
* - `maxlength`: Hard cap on character count, enforced natively by the browser.
|
|
805
|
+
* - `placeholder`: Hint text shown inside the empty field.
|
|
806
|
+
* - `class`: Extra classes merged onto the visual root (the textarea, or the input group when addons are present).
|
|
807
|
+
*
|
|
808
|
+
* Outputs:
|
|
809
|
+
* - `committed`: Emits the current value on the native `change` event (blur/enter).
|
|
810
|
+
*
|
|
811
|
+
* Usage:
|
|
812
|
+
* ```html
|
|
813
|
+
* <yuw-textarea [(value)]="bio" placeholder="Write your biography..." [rows]="4" />
|
|
814
|
+
* <yuw-textarea formControlName="comments" [maxlength]="500" />
|
|
815
|
+
* ```
|
|
816
|
+
*/
|
|
817
|
+
class YuwTextareaComponent extends YuwValueAccessorBase {
|
|
818
|
+
constructor() {
|
|
819
|
+
super(...arguments);
|
|
820
|
+
this.value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
821
|
+
this.inputId = input(undefined, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
822
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
823
|
+
this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
824
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
825
|
+
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
826
|
+
this.name = input(undefined, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
827
|
+
this.autocomplete = input(undefined, ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
828
|
+
this.rows = input(undefined, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
829
|
+
this.maxlength = input(undefined, ...(ngDevMode ? [{ debugName: "maxlength" }] : /* istanbul ignore next */ []));
|
|
830
|
+
this.placeholder = input(undefined, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
831
|
+
this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
832
|
+
this.committed = output();
|
|
833
|
+
this._autoId = `yuw-textarea-${++nextYuwTextareaId}`;
|
|
834
|
+
this._inputId = computed(() => this.inputId() ?? this._autoId, ...(ngDevMode ? [{ debugName: "_inputId" }] : /* istanbul ignore next */ []));
|
|
835
|
+
this._classes = computed(() => cn(this.userClass()), ...(ngDevMode ? [{ debugName: "_classes" }] : /* istanbul ignore next */ []));
|
|
836
|
+
this._disabled = computed(() => this._isDisabled(this.disabled()), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
837
|
+
this._leftAddons = contentChildren(YuwLeftAddonDirective, ...(ngDevMode ? [{ debugName: "_leftAddons" }] : /* istanbul ignore next */ []));
|
|
838
|
+
this._rightAddons = contentChildren(YuwRightAddonDirective, ...(ngDevMode ? [{ debugName: "_rightAddons" }] : /* istanbul ignore next */ []));
|
|
839
|
+
this._hasLeftAddon = computed(() => this._leftAddons().length > 0, ...(ngDevMode ? [{ debugName: "_hasLeftAddon" }] : /* istanbul ignore next */ []));
|
|
840
|
+
this._hasRightAddon = computed(() => this._rightAddons().length > 0, ...(ngDevMode ? [{ debugName: "_hasRightAddon" }] : /* istanbul ignore next */ []));
|
|
841
|
+
this._hasAddons = computed(() => this._hasLeftAddon() || this._hasRightAddon(), ...(ngDevMode ? [{ debugName: "_hasAddons" }] : /* istanbul ignore next */ []));
|
|
842
|
+
}
|
|
843
|
+
onInput(event) {
|
|
844
|
+
this._commit(event.target.value);
|
|
845
|
+
}
|
|
846
|
+
_emptyValue() {
|
|
847
|
+
return '';
|
|
848
|
+
}
|
|
849
|
+
onChange() {
|
|
850
|
+
this.committed.emit(this.value());
|
|
851
|
+
}
|
|
852
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
853
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwTextareaComponent, isStandalone: true, selector: "yuw-textarea", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", committed: "committed" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwTextareaComponent)], queries: [{ propertyName: "_leftAddons", predicate: YuwLeftAddonDirective, isSignal: true }, { propertyName: "_rightAddons", predicate: YuwRightAddonDirective, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!-- The control is repeated in both branches on purpose: a shared ng-template cannot express it,\n because the two variants differ in a statically-matched directive (hlmInputGroupTextarea vs\n hlmTextarea) and Angular resolves directives at compile time \u2014 a single template would drag the\n group's reset classes into the bare case (or vice versa). Keep the binding lists in sync. -->\n@if (_hasAddons()) {\n<hlm-input-group [class]=\"_classes()\">\n @if (_hasLeftAddon()) {\n <hlm-input-group-addon align=\"block-start\">\n <ng-content select=\"yuw-left-addon\" />\n </hlm-input-group-addon>\n }\n\n <textarea hlmInputGroupTextarea [id]=\"_inputId()\" [value]=\"value()\" [disabled]=\"_disabled()\" [readOnly]=\"readonly()\"\n [required]=\"required()\" [forceInvalid]=\"invalid()\" [attr.rows]=\"rows()\" [attr.maxlength]=\"maxlength()\"\n [attr.name]=\"name()\" [attr.autocomplete]=\"autocomplete()\" [attr.placeholder]=\"placeholder()\"\n (input)=\"onInput($event)\" (change)=\"onChange()\" (blur)=\"_onBlur()\"></textarea>\n\n @if (_hasRightAddon()) {\n <hlm-input-group-addon align=\"block-end\">\n <ng-content select=\"yuw-right-addon\" />\n </hlm-input-group-addon>\n }\n</hlm-input-group>\n} @else {\n<textarea hlmTextarea [class]=\"_classes()\" [id]=\"_inputId()\" [value]=\"value()\" [disabled]=\"_disabled()\" [readOnly]=\"readonly()\" [required]=\"required()\"\n [forceInvalid]=\"invalid()\" [attr.rows]=\"rows()\" [attr.maxlength]=\"maxlength()\" [attr.name]=\"name()\"\n [attr.autocomplete]=\"autocomplete()\" [attr.placeholder]=\"placeholder()\" (input)=\"onInput($event)\"\n (change)=\"onChange()\" (blur)=\"_onBlur()\"></textarea>\n}", dependencies: [{ kind: "directive", type: HlmTextarea, selector: "[hlmTextarea]" }, { kind: "directive", type: HlmInputGroup, selector: "[hlmInputGroup],hlm-input-group" }, { kind: "directive", type: HlmInputGroupTextarea, selector: "textarea[hlmInputGroupTextarea]" }, { kind: "directive", type: HlmInputGroupAddon, selector: "[hlmInputGroupAddon],hlm-input-group-addon", inputs: ["align"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
854
|
+
}
|
|
855
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTextareaComponent, decorators: [{
|
|
856
|
+
type: Component,
|
|
857
|
+
args: [{ selector: 'yuw-textarea', imports: [HlmTextarea, HlmInputGroup, HlmInputGroupTextarea, HlmInputGroupAddon], providers: [provideValueAccessor(YuwTextareaComponent)], host: {
|
|
858
|
+
class: 'contents',
|
|
859
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- The control is repeated in both branches on purpose: a shared ng-template cannot express it,\n because the two variants differ in a statically-matched directive (hlmInputGroupTextarea vs\n hlmTextarea) and Angular resolves directives at compile time \u2014 a single template would drag the\n group's reset classes into the bare case (or vice versa). Keep the binding lists in sync. -->\n@if (_hasAddons()) {\n<hlm-input-group [class]=\"_classes()\">\n @if (_hasLeftAddon()) {\n <hlm-input-group-addon align=\"block-start\">\n <ng-content select=\"yuw-left-addon\" />\n </hlm-input-group-addon>\n }\n\n <textarea hlmInputGroupTextarea [id]=\"_inputId()\" [value]=\"value()\" [disabled]=\"_disabled()\" [readOnly]=\"readonly()\"\n [required]=\"required()\" [forceInvalid]=\"invalid()\" [attr.rows]=\"rows()\" [attr.maxlength]=\"maxlength()\"\n [attr.name]=\"name()\" [attr.autocomplete]=\"autocomplete()\" [attr.placeholder]=\"placeholder()\"\n (input)=\"onInput($event)\" (change)=\"onChange()\" (blur)=\"_onBlur()\"></textarea>\n\n @if (_hasRightAddon()) {\n <hlm-input-group-addon align=\"block-end\">\n <ng-content select=\"yuw-right-addon\" />\n </hlm-input-group-addon>\n }\n</hlm-input-group>\n} @else {\n<textarea hlmTextarea [class]=\"_classes()\" [id]=\"_inputId()\" [value]=\"value()\" [disabled]=\"_disabled()\" [readOnly]=\"readonly()\" [required]=\"required()\"\n [forceInvalid]=\"invalid()\" [attr.rows]=\"rows()\" [attr.maxlength]=\"maxlength()\" [attr.name]=\"name()\"\n [attr.autocomplete]=\"autocomplete()\" [attr.placeholder]=\"placeholder()\" (input)=\"onInput($event)\"\n (change)=\"onChange()\" (blur)=\"_onBlur()\"></textarea>\n}" }]
|
|
860
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], committed: [{ type: i0.Output, args: ["committed"] }], _leftAddons: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => YuwLeftAddonDirective), { isSignal: true }] }], _rightAddons: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => YuwRightAddonDirective), { isSignal: true }] }] } });
|
|
861
|
+
|
|
862
|
+
/** Module-level counter backing each instance's stable fallback `id`. */
|
|
863
|
+
let nextYuwSearchInputId = 0;
|
|
864
|
+
/**
|
|
865
|
+
* Search input control featuring a leading search icon, optional clear button, and form integration (`ngModel`, `formControlName`).
|
|
866
|
+
*
|
|
867
|
+
* Inputs / Models:
|
|
868
|
+
* - `value`: Two-way search query string.
|
|
869
|
+
* - `inputId`: `id` applied to the native input, for external `<label for>` association.
|
|
870
|
+
* - `disabled`: Disables input interaction.
|
|
871
|
+
* - `readonly`: Makes the field read-only.
|
|
872
|
+
* - `required`: Marks the field as required.
|
|
873
|
+
* - `invalid`: Forces invalid styling.
|
|
874
|
+
* - `name`: HTML `name` attribute.
|
|
875
|
+
* - `autocomplete`: Native `autocomplete` attribute.
|
|
876
|
+
* - `placeholder`: Hint text shown inside the empty field.
|
|
877
|
+
* - `clearAriaLabel`: Accessible name for the clear button. Supplying it enables the clear button; omit to hide it.
|
|
878
|
+
* - `class`: Extra classes merged onto the input group.
|
|
879
|
+
*
|
|
880
|
+
* Outputs:
|
|
881
|
+
* - `searched`: Emits the current query string on every keystroke.
|
|
882
|
+
* - `committed`: Emits the current query string when the user presses Enter — for searches that
|
|
883
|
+
* hit a server on explicit submit rather than on every keystroke.
|
|
884
|
+
*
|
|
885
|
+
* Usage:
|
|
886
|
+
* ```html
|
|
887
|
+
* <yuw-search-input [(value)]="query" placeholder="Search items..." clearAriaLabel="Clear search" (searched)="onSearch($event)" />
|
|
888
|
+
* ```
|
|
889
|
+
*/
|
|
890
|
+
class YuwSearchInputComponent extends YuwValueAccessorBase {
|
|
891
|
+
constructor() {
|
|
892
|
+
super(...arguments);
|
|
893
|
+
this.value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
894
|
+
this.inputId = input(undefined, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
895
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
896
|
+
this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
897
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
898
|
+
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
899
|
+
this.name = input(undefined, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
900
|
+
this.autocomplete = input(undefined, ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
901
|
+
this.placeholder = input(undefined, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
902
|
+
this.clearAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "clearAriaLabel" }] : /* istanbul ignore next */ []));
|
|
903
|
+
this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
904
|
+
this.searched = output();
|
|
905
|
+
this.committed = output();
|
|
906
|
+
this._autoId = `yuw-search-input-${++nextYuwSearchInputId}`;
|
|
907
|
+
this._inputId = computed(() => this.inputId() ?? this._autoId, ...(ngDevMode ? [{ debugName: "_inputId" }] : /* istanbul ignore next */ []));
|
|
908
|
+
this._classes = computed(() => cn(this.userClass()), ...(ngDevMode ? [{ debugName: "_classes" }] : /* istanbul ignore next */ []));
|
|
909
|
+
this._disabled = computed(() => this._isDisabled(this.disabled()), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
910
|
+
this._showClear = computed(() => this.clearAriaLabel() !== undefined && this.value().length > 0 && !this._disabled() && !this.readonly(), ...(ngDevMode ? [{ debugName: "_showClear" }] : /* istanbul ignore next */ []));
|
|
911
|
+
this._input = viewChild.required('searchInput');
|
|
912
|
+
}
|
|
913
|
+
_emptyValue() {
|
|
914
|
+
return '';
|
|
915
|
+
}
|
|
916
|
+
onInput(event) {
|
|
917
|
+
const next = event.target.value;
|
|
918
|
+
this._commit(next);
|
|
919
|
+
this.searched.emit(next);
|
|
920
|
+
}
|
|
921
|
+
onEnter() {
|
|
922
|
+
this.committed.emit(this.value());
|
|
923
|
+
}
|
|
924
|
+
onClear() {
|
|
925
|
+
this._commit('');
|
|
926
|
+
this.searched.emit('');
|
|
927
|
+
this._input().nativeElement.focus();
|
|
928
|
+
}
|
|
929
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSearchInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
930
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwSearchInputComponent, isStandalone: true, selector: "yuw-search-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", searched: "searched", committed: "committed" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwSearchInputComponent), provideIcons({ lucideSearch, lucideX })], viewQueries: [{ propertyName: "_input", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<hlm-input-group [class]=\"_classes()\">\n <hlm-input-group-addon align=\"inline-start\">\n <ng-icon name=\"lucideSearch\"/>\n </hlm-input-group-addon>\n\n <input\n #searchInput\n hlmInputGroupInput\n [id]=\"_inputId()\"\n type=\"text\"\n inputmode=\"search\"\n [value]=\"value()\"\n [disabled]=\"_disabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [forceInvalid]=\"invalid()\"\n [attr.name]=\"name()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.placeholder]=\"placeholder()\"\n (input)=\"onInput($event)\"\n (keydown.enter)=\"onEnter()\"\n (blur)=\"_onBlur()\"\n />\n\n @if (_showClear()) {\n <hlm-input-group-addon align=\"inline-end\">\n <button hlmInputGroupButton size=\"icon-xs\" [attr.aria-label]=\"clearAriaLabel()\" (click)=\"onClear()\">\n <ng-icon name=\"lucideX\"/>\n </button>\n </hlm-input-group-addon>\n }\n</hlm-input-group>\n", dependencies: [{ kind: "directive", type: i1$3.HlmInputGroup, selector: "[hlmInputGroup],hlm-input-group" }, { kind: "directive", type: i1$3.HlmInputGroupAddon, selector: "[hlmInputGroupAddon],hlm-input-group-addon", inputs: ["align"] }, { kind: "directive", type: i1$3.HlmInputGroupButton, selector: "button[hlmInputGroupButton]", inputs: ["size", "type"] }, { kind: "directive", type: i1$3.HlmInputGroupInput, selector: "input[hlmInputGroupInput]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
931
|
+
}
|
|
932
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSearchInputComponent, decorators: [{
|
|
933
|
+
type: Component,
|
|
934
|
+
args: [{ selector: 'yuw-search-input', imports: [...HlmInputGroupImports, NgIcon], providers: [provideValueAccessor(YuwSearchInputComponent), provideIcons({ lucideSearch, lucideX })], host: {
|
|
935
|
+
class: 'contents',
|
|
936
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-input-group [class]=\"_classes()\">\n <hlm-input-group-addon align=\"inline-start\">\n <ng-icon name=\"lucideSearch\"/>\n </hlm-input-group-addon>\n\n <input\n #searchInput\n hlmInputGroupInput\n [id]=\"_inputId()\"\n type=\"text\"\n inputmode=\"search\"\n [value]=\"value()\"\n [disabled]=\"_disabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [forceInvalid]=\"invalid()\"\n [attr.name]=\"name()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.placeholder]=\"placeholder()\"\n (input)=\"onInput($event)\"\n (keydown.enter)=\"onEnter()\"\n (blur)=\"_onBlur()\"\n />\n\n @if (_showClear()) {\n <hlm-input-group-addon align=\"inline-end\">\n <button hlmInputGroupButton size=\"icon-xs\" [attr.aria-label]=\"clearAriaLabel()\" (click)=\"onClear()\">\n <ng-icon name=\"lucideX\"/>\n </button>\n </hlm-input-group-addon>\n }\n</hlm-input-group>\n" }]
|
|
937
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], searched: [{ type: i0.Output, args: ["searched"] }], committed: [{ type: i0.Output, args: ["committed"] }], _input: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }] } });
|
|
938
|
+
|
|
939
|
+
/** Lookup replacing the branch, keyed by `` `${boolean}` `` so a boolean signal indexes it
|
|
940
|
+
* directly (`STATES[`${masked()}`]`) with no ternary. Adding a third state (a "peek while held"
|
|
941
|
+
* mode, say) means adding an entry here — open for extension, closed for modification. */
|
|
942
|
+
const YUW_PASSWORD_REVEAL_STATES = {
|
|
943
|
+
true: { inputType: 'password', icon: 'lucideEyeOff', struck: true },
|
|
944
|
+
false: { inputType: 'text', icon: 'lucideEye', struck: false },
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
/** Module-level counter backing each instance's stable fallback `id`. */
|
|
948
|
+
let nextYuwPasswordInputId = 0;
|
|
949
|
+
/**
|
|
950
|
+
* Password input field with optional visibility toggle button and form integration (`ngModel`, `formControlName`).
|
|
951
|
+
*
|
|
952
|
+
* Inputs / Models:
|
|
953
|
+
* - `value`: Two-way password string.
|
|
954
|
+
* - `inputId`: `id` applied to the native input, for external `<label for>` association.
|
|
955
|
+
* - `disabled`: Disables input interaction.
|
|
956
|
+
* - `readonly`: Makes the field read-only.
|
|
957
|
+
* - `required`: Marks the field as required.
|
|
958
|
+
* - `invalid`: Forces invalid styling.
|
|
959
|
+
* - `name`: HTML `name` attribute.
|
|
960
|
+
* - `autocomplete`: Native `autocomplete` attribute (e.g. `'current-password'`, `'new-password'`).
|
|
961
|
+
* - `placeholder`: Hint text shown inside the empty field.
|
|
962
|
+
* - `revealAriaLabel`: Accessible name for the reveal toggle button. Supplying it enables the toggle; omit to hide it.
|
|
963
|
+
* - `masked`: Two-way boolean controlling whether the value is masked. Default is `true` (masked). A parent can reset it (e.g. re-mask after a failed submit).
|
|
964
|
+
* - `class`: Extra classes merged onto the input group.
|
|
965
|
+
*
|
|
966
|
+
* Outputs:
|
|
967
|
+
* - `committed`: Emits the current value on the native `change` event (blur/enter).
|
|
968
|
+
*
|
|
969
|
+
* Usage:
|
|
970
|
+
* ```html
|
|
971
|
+
* <yuw-password-input [(value)]="password" revealAriaLabel="Toggle password visibility" />
|
|
972
|
+
* <yuw-password-input formControlName="password" autocomplete="current-password" />
|
|
973
|
+
* ```
|
|
974
|
+
*/
|
|
975
|
+
class YuwPasswordInputComponent extends YuwValueAccessorBase {
|
|
976
|
+
constructor() {
|
|
977
|
+
super(...arguments);
|
|
978
|
+
this.value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
979
|
+
this.inputId = input(undefined, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
980
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
981
|
+
this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
982
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
983
|
+
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
984
|
+
this.name = input(undefined, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
985
|
+
this.autocomplete = input(undefined, ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
986
|
+
this.placeholder = input(undefined, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
987
|
+
this.revealAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "revealAriaLabel" }] : /* istanbul ignore next */ []));
|
|
988
|
+
this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
989
|
+
this.committed = output();
|
|
990
|
+
this.masked = model(true, ...(ngDevMode ? [{ debugName: "masked" }] : /* istanbul ignore next */ []));
|
|
991
|
+
this._autoId = `yuw-password-input-${++nextYuwPasswordInputId}`;
|
|
992
|
+
this._inputId = computed(() => this.inputId() ?? this._autoId, ...(ngDevMode ? [{ debugName: "_inputId" }] : /* istanbul ignore next */ []));
|
|
993
|
+
this._classes = computed(() => cn(this.userClass()), ...(ngDevMode ? [{ debugName: "_classes" }] : /* istanbul ignore next */ []));
|
|
994
|
+
this._disabled = computed(() => this._isDisabled(this.disabled()), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
995
|
+
this._reveal = computed(() => YUW_PASSWORD_REVEAL_STATES[`${this.masked()}`], ...(ngDevMode ? [{ debugName: "_reveal" }] : /* istanbul ignore next */ []));
|
|
996
|
+
}
|
|
997
|
+
_emptyValue() {
|
|
998
|
+
return '';
|
|
999
|
+
}
|
|
1000
|
+
onInput(event) {
|
|
1001
|
+
this._commit(event.target.value);
|
|
1002
|
+
}
|
|
1003
|
+
onChange() {
|
|
1004
|
+
this.committed.emit(this.value());
|
|
1005
|
+
}
|
|
1006
|
+
onToggleReveal() {
|
|
1007
|
+
this.masked.update((masked) => !masked);
|
|
1008
|
+
}
|
|
1009
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwPasswordInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1010
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwPasswordInputComponent, isStandalone: true, selector: "yuw-password-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, revealAriaLabel: { classPropertyName: "revealAriaLabel", publicName: "revealAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, masked: { classPropertyName: "masked", publicName: "masked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", committed: "committed", masked: "maskedChange" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwPasswordInputComponent), provideIcons({ lucideEye, lucideEyeOff })], usesInheritance: true, ngImport: i0, template: "<hlm-input-group [class]=\"_classes()\">\n <input\n hlmInputGroupInput\n [id]=\"_inputId()\"\n [type]=\"_reveal().inputType\"\n [value]=\"value()\"\n [disabled]=\"_disabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [forceInvalid]=\"invalid()\"\n [attr.name]=\"name()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.placeholder]=\"placeholder()\"\n (input)=\"onInput($event)\"\n (change)=\"onChange()\"\n (blur)=\"_onBlur()\"\n />\n\n @if (revealAriaLabel(); as label) {\n <hlm-input-group-addon align=\"inline-end\">\n <button\n hlmInputGroupButton\n size=\"icon-xs\"\n [disabled]=\"_disabled()\"\n [attr.aria-label]=\"label\"\n [attr.aria-pressed]=\"!_reveal().struck\"\n (click)=\"onToggleReveal()\"\n >\n <ng-icon [name]=\"_reveal().icon\"/>\n </button>\n </hlm-input-group-addon>\n }\n</hlm-input-group>\n", dependencies: [{ kind: "directive", type: i1$3.HlmInputGroup, selector: "[hlmInputGroup],hlm-input-group" }, { kind: "directive", type: i1$3.HlmInputGroupAddon, selector: "[hlmInputGroupAddon],hlm-input-group-addon", inputs: ["align"] }, { kind: "directive", type: i1$3.HlmInputGroupButton, selector: "button[hlmInputGroupButton]", inputs: ["size", "type"] }, { kind: "directive", type: i1$3.HlmInputGroupInput, selector: "input[hlmInputGroupInput]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1011
|
+
}
|
|
1012
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwPasswordInputComponent, decorators: [{
|
|
1013
|
+
type: Component,
|
|
1014
|
+
args: [{ selector: 'yuw-password-input', imports: [...HlmInputGroupImports, NgIcon], providers: [provideValueAccessor(YuwPasswordInputComponent), provideIcons({ lucideEye, lucideEyeOff })], host: {
|
|
1015
|
+
class: 'contents',
|
|
1016
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-input-group [class]=\"_classes()\">\n <input\n hlmInputGroupInput\n [id]=\"_inputId()\"\n [type]=\"_reveal().inputType\"\n [value]=\"value()\"\n [disabled]=\"_disabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [forceInvalid]=\"invalid()\"\n [attr.name]=\"name()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.placeholder]=\"placeholder()\"\n (input)=\"onInput($event)\"\n (change)=\"onChange()\"\n (blur)=\"_onBlur()\"\n />\n\n @if (revealAriaLabel(); as label) {\n <hlm-input-group-addon align=\"inline-end\">\n <button\n hlmInputGroupButton\n size=\"icon-xs\"\n [disabled]=\"_disabled()\"\n [attr.aria-label]=\"label\"\n [attr.aria-pressed]=\"!_reveal().struck\"\n (click)=\"onToggleReveal()\"\n >\n <ng-icon [name]=\"_reveal().icon\"/>\n </button>\n </hlm-input-group-addon>\n }\n</hlm-input-group>\n" }]
|
|
1017
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], revealAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "revealAriaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], committed: [{ type: i0.Output, args: ["committed"] }], masked: [{ type: i0.Input, args: [{ isSignal: true, alias: "masked", required: false }] }, { type: i0.Output, args: ["maskedChange"] }] } });
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Expands a list of group sizes (`[3, 3]`) into the groups the template renders, assigning
|
|
1021
|
+
* absolute indices as it goes.
|
|
1022
|
+
*
|
|
1023
|
+
* Lives in its own file rather than inline in the component because `agents.md` wants the
|
|
1024
|
+
* component file to read as inputs, outputs, a couple of `computed()`s, done — and because this
|
|
1025
|
+
* is the one piece of real logic here, so it's the piece worth being able to test on its own.
|
|
1026
|
+
*
|
|
1027
|
+
* Sizes that are zero or negative are dropped: they'd contribute no slots but would still emit a
|
|
1028
|
+
* stray separator, so a typo like `[3, 0, 3]` would render a dangling dash between two groups.
|
|
1029
|
+
*/
|
|
1030
|
+
function buildInputOtpGroups(groupSizes) {
|
|
1031
|
+
let nextIndex = 0;
|
|
1032
|
+
return groupSizes
|
|
1033
|
+
.filter((size) => size > 0)
|
|
1034
|
+
.map((size, groupPosition) => {
|
|
1035
|
+
const indices = Array.from({ length: size }, (_, offset) => nextIndex + offset);
|
|
1036
|
+
nextIndex += size;
|
|
1037
|
+
return { indices, precededBySeparator: groupPosition > 0 };
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
/** Total slot count across every group — what `BrnInputOtp`'s own `length` input expects. Derived
|
|
1041
|
+
* from the same source as the groups so the two can never disagree, which is the bug you get from
|
|
1042
|
+
* accepting `length` and `groupSizes` as two independent inputs. */
|
|
1043
|
+
function totalInputOtpLength(groupSizes) {
|
|
1044
|
+
return groupSizes.filter((size) => size > 0).reduce((total, size) => total + size, 0);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
/** Module-level counter backing each instance's stable fallback `id`. */
|
|
1048
|
+
let nextYuwInputOtpId = 0;
|
|
1049
|
+
/**
|
|
1050
|
+
* One-time password / verification code input component rendering grouped digit or text slots.
|
|
1051
|
+
*
|
|
1052
|
+
* Inputs / Models:
|
|
1053
|
+
* - `value`: Two-way OTP code string.
|
|
1054
|
+
* - `inputId`: `id` applied to the hidden native input, for external `<label for>` association.
|
|
1055
|
+
* - `groupSizes`: Slot counts per visual group (`number[]`). A separator renders between groups, e.g. `[3, 3]` gives `000-000`. Default is `[6]`.
|
|
1056
|
+
* - `mode`: Virtual-keyboard hint (`'numeric'`, `'text'`). Default is `'numeric'`.
|
|
1057
|
+
* - `disabled`: Disables input interaction.
|
|
1058
|
+
* - `invalid`: Forces invalid styling.
|
|
1059
|
+
* - `autofocus`: Focuses the field on init. Appropriate on dedicated verification screens.
|
|
1060
|
+
* - `transformPaste`: Normalizes pasted text before it fills the slots.
|
|
1061
|
+
* - `class`: Extra classes merged onto the OTP container.
|
|
1062
|
+
*
|
|
1063
|
+
* Outputs:
|
|
1064
|
+
* - `completed`: Emits the full code string once the final slot is filled (by typing or paste).
|
|
1065
|
+
*
|
|
1066
|
+
* Usage:
|
|
1067
|
+
* ```html
|
|
1068
|
+
* <yuw-input-otp [(value)]="code" [groupSizes]="[3, 3]" (completed)="verifyCode($event)" />
|
|
1069
|
+
* <yuw-input-otp formControlName="otpCode" [groupSizes]="[6]" mode="numeric" />
|
|
1070
|
+
* ```
|
|
1071
|
+
*/
|
|
1072
|
+
class YuwInputOtpComponent extends YuwValueAccessorBase {
|
|
1073
|
+
constructor() {
|
|
1074
|
+
super(...arguments);
|
|
1075
|
+
this.value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1076
|
+
this.inputId = input(undefined, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
1077
|
+
this.groupSizes = input([6], ...(ngDevMode ? [{ debugName: "groupSizes" }] : /* istanbul ignore next */ []));
|
|
1078
|
+
this.mode = input('numeric', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
1079
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1080
|
+
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1081
|
+
this.autofocus = input(false, { ...(ngDevMode ? { debugName: "autofocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1082
|
+
this.transformPaste = input((pastedText) => pastedText, ...(ngDevMode ? [{ debugName: "transformPaste" }] : /* istanbul ignore next */ []));
|
|
1083
|
+
this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1084
|
+
this.completed = output();
|
|
1085
|
+
this._autoId = `yuw-input-otp-${++nextYuwInputOtpId}`;
|
|
1086
|
+
this._inputId = computed(() => this.inputId() ?? this._autoId, ...(ngDevMode ? [{ debugName: "_inputId" }] : /* istanbul ignore next */ []));
|
|
1087
|
+
this._classes = computed(() => cn(this.userClass()), ...(ngDevMode ? [{ debugName: "_classes" }] : /* istanbul ignore next */ []));
|
|
1088
|
+
this._groups = computed(() => buildInputOtpGroups(this.groupSizes()), ...(ngDevMode ? [{ debugName: "_groups" }] : /* istanbul ignore next */ []));
|
|
1089
|
+
this._length = computed(() => totalInputOtpLength(this.groupSizes()), ...(ngDevMode ? [{ debugName: "_length" }] : /* istanbul ignore next */ []));
|
|
1090
|
+
this._disabled = computed(() => this._isDisabled(this.disabled()), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
1091
|
+
}
|
|
1092
|
+
_emptyValue() {
|
|
1093
|
+
return '';
|
|
1094
|
+
}
|
|
1095
|
+
onValueChange(next) {
|
|
1096
|
+
this._commit(next);
|
|
1097
|
+
}
|
|
1098
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwInputOtpComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1099
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwInputOtpComponent, isStandalone: true, selector: "yuw-input-otp", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, groupSizes: { classPropertyName: "groupSizes", publicName: "groupSizes", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, transformPaste: { classPropertyName: "transformPaste", publicName: "transformPaste", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", completed: "completed" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwInputOtpComponent)], usesInheritance: true, ngImport: i0, template: "<brn-input-otp\n hlmInputOtp\n [class]=\"_classes()\"\n [inputId]=\"_inputId()\"\n [length]=\"_length()\"\n [value]=\"value()\"\n [inputMode]=\"mode()\"\n [disabled]=\"_disabled()\"\n [autofocus]=\"autofocus()\"\n [transformPaste]=\"transformPaste()\"\n inputAutocomplete=\"one-time-code\"\n (valueChange)=\"onValueChange($event)\"\n (focusout)=\"_onBlur()\"\n (completed)=\"completed.emit($event)\"\n>\n @for (group of _groups(); track $index) {\n @if (group.precededBySeparator) {\n <hlm-input-otp-separator/>\n }\n\n <hlm-input-otp-group>\n @for (index of group.indices; track index) {\n <hlm-input-otp-slot [index]=\"index\" [forceInvalid]=\"invalid()\"/>\n }\n </hlm-input-otp-group>\n }\n</brn-input-otp>\n", dependencies: [{ kind: "component", type: BrnInputOtp, selector: "brn-input-otp", inputs: ["hostStyles", "inputId", "inputAutocomplete", "inputStyles", "containerStyles", "disabled", "length", "inputMode", "inputClass", "autofocus", "transformPaste", "value"], outputs: ["valueChange", "completed"] }, { kind: "directive", type: i1$4.HlmInputOtp, selector: "brn-input-otp[hlmInputOtp], brn-input-otp[hlm]" }, { kind: "directive", type: i1$4.HlmInputOtpGroup, selector: "[hlmInputOtpGroup],hlm-input-otp-group" }, { kind: "component", type: i1$4.HlmInputOtpSeparator, selector: "hlm-input-otp-separator" }, { kind: "component", type: i1$4.HlmInputOtpSlot, selector: "hlm-input-otp-slot", inputs: ["index", "forceInvalid"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1100
|
+
}
|
|
1101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwInputOtpComponent, decorators: [{
|
|
1102
|
+
type: Component,
|
|
1103
|
+
args: [{ selector: 'yuw-input-otp', imports: [BrnInputOtp, ...HlmInputOtpImports], providers: [provideValueAccessor(YuwInputOtpComponent)], host: {
|
|
1104
|
+
class: 'contents',
|
|
1105
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<brn-input-otp\n hlmInputOtp\n [class]=\"_classes()\"\n [inputId]=\"_inputId()\"\n [length]=\"_length()\"\n [value]=\"value()\"\n [inputMode]=\"mode()\"\n [disabled]=\"_disabled()\"\n [autofocus]=\"autofocus()\"\n [transformPaste]=\"transformPaste()\"\n inputAutocomplete=\"one-time-code\"\n (valueChange)=\"onValueChange($event)\"\n (focusout)=\"_onBlur()\"\n (completed)=\"completed.emit($event)\"\n>\n @for (group of _groups(); track $index) {\n @if (group.precededBySeparator) {\n <hlm-input-otp-separator/>\n }\n\n <hlm-input-otp-group>\n @for (index of group.indices; track index) {\n <hlm-input-otp-slot [index]=\"index\" [forceInvalid]=\"invalid()\"/>\n }\n </hlm-input-otp-group>\n }\n</brn-input-otp>\n" }]
|
|
1106
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], groupSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupSizes", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], transformPaste: [{ type: i0.Input, args: [{ isSignal: true, alias: "transformPaste", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], completed: [{ type: i0.Output, args: ["completed"] }] } });
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* Form label directive applied directly to a native `<label>` element.
|
|
1110
|
+
*
|
|
1111
|
+
* Provides label styling and pairs with form controls using standard `for` attribute.
|
|
1112
|
+
*
|
|
1113
|
+
* Extends `HlmLabel` (instead of composing it via `hostDirectives`) because `id`/`for` are
|
|
1114
|
+
* inputs `HlmLabel` itself re-exposes from `BrnLabel` through its own `hostDirectives`, and
|
|
1115
|
+
* Angular's host-directive forwarding is not transitive (NG2017) — they can't be re-listed at
|
|
1116
|
+
* this level. Class inheritance carries the whole surface over unchanged: a static `for`/`id`
|
|
1117
|
+
* on the `<label>` reaches `BrnLabel` as an initial input, whose `[attr.for]` host binding then
|
|
1118
|
+
* re-writes the same value.
|
|
1119
|
+
*
|
|
1120
|
+
* Usage:
|
|
1121
|
+
* ```html
|
|
1122
|
+
* <label yuwLabel for="username">Username</label>
|
|
1123
|
+
* <yuw-input inputId="username" [(value)]="username" />
|
|
1124
|
+
* ```
|
|
1125
|
+
*/
|
|
1126
|
+
class YuwLabel extends HlmLabel {
|
|
1127
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwLabel, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1128
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwLabel, isStandalone: true, selector: "label[yuwLabel]", usesInheritance: true, ngImport: i0 }); }
|
|
1129
|
+
}
|
|
1130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwLabel, decorators: [{
|
|
1131
|
+
type: Directive,
|
|
1132
|
+
args: [{
|
|
1133
|
+
selector: 'label[yuwLabel]',
|
|
1134
|
+
}]
|
|
1135
|
+
}] });
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Class map for `yuw-checkbox`, layered on top of `HlmCheckbox`'s own classes.
|
|
1139
|
+
*
|
|
1140
|
+
* The base indeterminate treatment is unconditional — it's how *every* `yuw-checkbox` renders
|
|
1141
|
+
* that state, not a variant — so it lives in the cva base, while `secondary` is an opt-in
|
|
1142
|
+
* boolean variant layered on top.
|
|
1143
|
+
*
|
|
1144
|
+
* Order is load-bearing: the secondary classes override the base's `bg-primary`/`border-primary`,
|
|
1145
|
+
* and cva emits base classes before variant classes, so the component must pass the result
|
|
1146
|
+
* through `cn()` for `tailwind-merge` to keep the later (secondary) ones instead of shipping both
|
|
1147
|
+
* to the DOM and leaving it to specificity.
|
|
1148
|
+
*/
|
|
1149
|
+
const checkboxVariants = cva([
|
|
1150
|
+
'data-[state=indeterminate]:bg-primary',
|
|
1151
|
+
'dark:data-[state=indeterminate]:bg-primary',
|
|
1152
|
+
'data-[state=indeterminate]:text-primary-foreground',
|
|
1153
|
+
'data-[state=indeterminate]:[&>span]:hidden',
|
|
1154
|
+
'data-[state=indeterminate]:after:h-0.5',
|
|
1155
|
+
'data-[state=indeterminate]:after:w-2.5',
|
|
1156
|
+
'data-[state=indeterminate]:after:rounded-full',
|
|
1157
|
+
'data-[state=indeterminate]:after:bg-current',
|
|
1158
|
+
], {
|
|
1159
|
+
variants: {
|
|
1160
|
+
secondary: {
|
|
1161
|
+
true: [
|
|
1162
|
+
'data-[state=checked]:bg-(color:--neutrals-element-high)',
|
|
1163
|
+
'data-[state=checked]:bg-(image:--neutrals-element-high-gradient)',
|
|
1164
|
+
'data-[state=checked]:text-(--neutrals-overlay)',
|
|
1165
|
+
'data-[state=checked]:border-(--neutrals-element-high)',
|
|
1166
|
+
'data-[state=indeterminate]:bg-(color:--neutrals-element-high)',
|
|
1167
|
+
'data-[state=indeterminate]:bg-(image:--neutrals-element-high-gradient)',
|
|
1168
|
+
'data-[state=indeterminate]:text-(--neutrals-white)',
|
|
1169
|
+
'data-[state=indeterminate]:border-(--neutrals-element-high)',
|
|
1170
|
+
'dark:data-[state=indeterminate]:text-(--neutrals-black)',
|
|
1171
|
+
],
|
|
1172
|
+
false: 'data-[state=indeterminate]:border-primary',
|
|
1173
|
+
},
|
|
1174
|
+
},
|
|
1175
|
+
defaultVariants: {
|
|
1176
|
+
secondary: false,
|
|
1177
|
+
},
|
|
1178
|
+
});
|
|
1179
|
+
|
|
1180
|
+
/**
|
|
1181
|
+
* Checkbox control supporting two-way boolean binding, form integration (`ngModel`, `formControlName`),
|
|
1182
|
+
* indeterminate state, and secondary styling variant.
|
|
1183
|
+
*
|
|
1184
|
+
* Projected content becomes the checkbox's clickable label: the control is wrapped in a `<label>`,
|
|
1185
|
+
* so clicking the text toggles it and the text is announced as the accessible name. Without
|
|
1186
|
+
* projected content, pair it with an external `<label [for]>` via `inputId` or set `ariaLabel`.
|
|
1187
|
+
*
|
|
1188
|
+
* Inputs / Models:
|
|
1189
|
+
* - `value` / `checked`: Two-way boolean state of the checkbox. Default is `false`.
|
|
1190
|
+
* - `indeterminate`: Two-way boolean state for mixed/indeterminate checkbox appearance. Default is `false`.
|
|
1191
|
+
* - `disabled`: Disables checkbox interaction.
|
|
1192
|
+
* - `required`: Marks checkbox as required.
|
|
1193
|
+
* - `invalid`: Forces invalid styling.
|
|
1194
|
+
* - `name`: Form input name attribute.
|
|
1195
|
+
* - `inputId`: ID set on the native input element for `<label [for]>` matching.
|
|
1196
|
+
* - `ariaLabel`: Accessible name for screen readers when there's no visible label.
|
|
1197
|
+
* - `ariaLabelledby`: ID of an external element that labels the checkbox.
|
|
1198
|
+
* - `ariaDescribedby`: ID of an external element that describes the checkbox (hints, errors).
|
|
1199
|
+
* - `secondary`: Enables secondary color variant styling.
|
|
1200
|
+
*
|
|
1201
|
+
* Usage:
|
|
1202
|
+
* ```html
|
|
1203
|
+
* <yuw-checkbox [(checked)]="acceptedTerms">Accept terms</yuw-checkbox>
|
|
1204
|
+
* <yuw-checkbox [(indeterminate)]="isMixed" [(checked)]="allSelected" />
|
|
1205
|
+
* <yuw-checkbox formControlName="rememberMe" />
|
|
1206
|
+
* ```
|
|
1207
|
+
*/
|
|
1208
|
+
class YuwCheckboxComponent extends YuwValueAccessorBase {
|
|
1209
|
+
constructor() {
|
|
1210
|
+
super(...arguments);
|
|
1211
|
+
this.value = model(false, { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), alias: 'checked' });
|
|
1212
|
+
this.indeterminate = model(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
1213
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1214
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1215
|
+
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1216
|
+
this.name = input(undefined, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
1217
|
+
this.inputId = input(undefined, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
1218
|
+
this.ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1219
|
+
this.ariaLabelledby = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
1220
|
+
this.ariaDescribedby = input(undefined, ...(ngDevMode ? [{ debugName: "ariaDescribedby" }] : /* istanbul ignore next */ []));
|
|
1221
|
+
this.secondary = input(false, { ...(ngDevMode ? { debugName: "secondary" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1222
|
+
this._disabled = computed(() => this._isDisabled(this.disabled()), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
1223
|
+
this._class = computed(() => cn(checkboxVariants({ secondary: this.secondary() })), ...(ngDevMode ? [{ debugName: "_class" }] : /* istanbul ignore next */ []));
|
|
1224
|
+
}
|
|
1225
|
+
_emptyValue() {
|
|
1226
|
+
return false;
|
|
1227
|
+
}
|
|
1228
|
+
onCheckedChange(checked) {
|
|
1229
|
+
this._commit(checked);
|
|
1230
|
+
}
|
|
1231
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1232
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: YuwCheckboxComponent, isStandalone: true, selector: "yuw-checkbox", inputs: { value: { classPropertyName: "value", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "ariaDescribedby", isSignal: true, isRequired: false, transformFunction: null }, secondary: { classPropertyName: "secondary", publicName: "secondary", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "checkedChange", indeterminate: "indeterminateChange" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwCheckboxComponent)], usesInheritance: true, ngImport: i0, template: "<label yuwLabel class=\"gap-3\" (focusout)=\"_onBlur()\">\n <hlm-checkbox [class]=\"_class()\" [checked]=\"value()\" [(indeterminate)]=\"indeterminate\" [disabled]=\"_disabled()\"\n [required]=\"required()\" [forceInvalid]=\"invalid()\" [name]=\"name() ?? null\" [inputId]=\"inputId() ?? null\"\n [aria-label]=\"ariaLabel() ?? null\" [aria-labelledby]=\"ariaLabelledby() ?? null\"\n [aria-describedby]=\"ariaDescribedby() ?? null\" (checkedChange)=\"onCheckedChange($event)\"/>\n <ng-content/>\n</label>\n", dependencies: [{ kind: "component", type: HlmCheckbox, selector: "hlm-checkbox", inputs: ["class", "inputId", "aria-label", "aria-labelledby", "aria-describedby", "checked", "indeterminate", "name", "required", "disabled", "forceInvalid"], outputs: ["checkedChange", "indeterminateChange"] }, { kind: "directive", type: YuwLabel, selector: "label[yuwLabel]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1233
|
+
}
|
|
1234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCheckboxComponent, decorators: [{
|
|
1235
|
+
type: Component,
|
|
1236
|
+
args: [{ selector: 'yuw-checkbox', imports: [HlmCheckbox, YuwLabel], providers: [provideValueAccessor(YuwCheckboxComponent)], host: {
|
|
1237
|
+
class: 'contents',
|
|
1238
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<label yuwLabel class=\"gap-3\" (focusout)=\"_onBlur()\">\n <hlm-checkbox [class]=\"_class()\" [checked]=\"value()\" [(indeterminate)]=\"indeterminate\" [disabled]=\"_disabled()\"\n [required]=\"required()\" [forceInvalid]=\"invalid()\" [name]=\"name() ?? null\" [inputId]=\"inputId() ?? null\"\n [aria-label]=\"ariaLabel() ?? null\" [aria-labelledby]=\"ariaLabelledby() ?? null\"\n [aria-describedby]=\"ariaDescribedby() ?? null\" (checkedChange)=\"onCheckedChange($event)\"/>\n <ng-content/>\n</label>\n" }]
|
|
1239
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }, { type: i0.Output, args: ["indeterminateChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedby", required: false }] }], secondary: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondary", required: false }] }] } });
|
|
1240
|
+
|
|
1241
|
+
/**
|
|
1242
|
+
* Toggle switch control for binary settings and immediate state changes.
|
|
1243
|
+
*
|
|
1244
|
+
* Projected content becomes the switch's clickable label: the control is wrapped in a `<label>`,
|
|
1245
|
+
* so clicking the text toggles it and the text is announced as the accessible name. Without
|
|
1246
|
+
* projected content, pair it with an external `<label [for]>` via `inputId` or set `ariaLabel`.
|
|
1247
|
+
*
|
|
1248
|
+
* Inputs / Models:
|
|
1249
|
+
* - `checked` (alias for `value`): Two-way boolean on/off state. Bind as `[(checked)]`.
|
|
1250
|
+
* - `size`: Track size variant (`'default'`, `'sm'`). Default is `'default'`.
|
|
1251
|
+
* - `disabled`: Disables switch interaction.
|
|
1252
|
+
* - `inputId`: HTML `id` for the underlying control, enabling external `<label for="...">` association.
|
|
1253
|
+
* - `ariaLabel`: Accessible name for switches with no visible adjacent label.
|
|
1254
|
+
*
|
|
1255
|
+
* Usage:
|
|
1256
|
+
* ```html
|
|
1257
|
+
* <yuw-switch [(checked)]="notificationsEnabled">Enable Notifications</yuw-switch>
|
|
1258
|
+
* <yuw-switch formControlName="darkMode" size="sm" />
|
|
1259
|
+
* ```
|
|
1260
|
+
*/
|
|
1261
|
+
class YuwSwitchComponent extends YuwValueAccessorBase {
|
|
1262
|
+
constructor() {
|
|
1263
|
+
super(...arguments);
|
|
1264
|
+
this.value = model(false, { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), alias: 'checked' });
|
|
1265
|
+
this.size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1266
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1267
|
+
this.inputId = input(undefined, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
1268
|
+
this.ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1269
|
+
this.ariaLabelledby = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
1270
|
+
this.ariaDescribedby = input(undefined, ...(ngDevMode ? [{ debugName: "ariaDescribedby" }] : /* istanbul ignore next */ []));
|
|
1271
|
+
this._disabled = computed(() => this._isDisabled(this.disabled()), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
1272
|
+
}
|
|
1273
|
+
_emptyValue() {
|
|
1274
|
+
return false;
|
|
1275
|
+
}
|
|
1276
|
+
onCheckedChange(checked) {
|
|
1277
|
+
this._commit(checked);
|
|
1278
|
+
}
|
|
1279
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSwitchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1280
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: YuwSwitchComponent, isStandalone: true, selector: "yuw-switch", inputs: { value: { classPropertyName: "value", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "ariaDescribedby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "checkedChange" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwSwitchComponent)], usesInheritance: true, ngImport: i0, template: "<label yuwLabel class=\"gap-3\" (focusout)=\"_onBlur()\">\n <hlm-switch\n [checked]=\"value()\"\n [size]=\"size()\"\n [disabled]=\"_disabled()\"\n [inputId]=\"inputId() ?? null\"\n [aria-label]=\"ariaLabel() ?? null\"\n [aria-labelledby]=\"ariaLabelledby() ?? null\"\n [aria-describedby]=\"ariaDescribedby() ?? null\"\n (checkedChange)=\"onCheckedChange($event)\"\n />\n <ng-content/>\n</label>\n", dependencies: [{ kind: "component", type: i1$5.HlmSwitch, selector: "hlm-switch", inputs: ["class", "checked", "disabled", "size", "inputId", "aria-label", "aria-labelledby", "aria-describedby"], outputs: ["checkedChange"] }, { kind: "directive", type: YuwLabel, selector: "label[yuwLabel]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1281
|
+
}
|
|
1282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSwitchComponent, decorators: [{
|
|
1283
|
+
type: Component,
|
|
1284
|
+
args: [{ selector: 'yuw-switch', imports: [...HlmSwitchImports, YuwLabel], providers: [provideValueAccessor(YuwSwitchComponent)], host: {
|
|
1285
|
+
class: 'contents',
|
|
1286
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<label yuwLabel class=\"gap-3\" (focusout)=\"_onBlur()\">\n <hlm-switch\n [checked]=\"value()\"\n [size]=\"size()\"\n [disabled]=\"_disabled()\"\n [inputId]=\"inputId() ?? null\"\n [aria-label]=\"ariaLabel() ?? null\"\n [aria-labelledby]=\"ariaLabelledby() ?? null\"\n [aria-describedby]=\"ariaDescribedby() ?? null\"\n (checkedChange)=\"onCheckedChange($event)\"\n />\n <ng-content/>\n</label>\n" }]
|
|
1287
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedby", required: false }] }] } });
|
|
1288
|
+
|
|
1289
|
+
/** Module-level counter so every unnamed group gets its own radio `name`. Binding `[name]`
|
|
1290
|
+
* unconditionally overrides Brain's autogenerated unique name, and an empty-string fallback
|
|
1291
|
+
* would make two unnamed groups on the same page share `name=""` — i.e. act as one group. */
|
|
1292
|
+
let nextUniqueId$1 = 0;
|
|
1293
|
+
/**
|
|
1294
|
+
* Radio button group component for selecting a single option from a list.
|
|
1295
|
+
*
|
|
1296
|
+
* Inputs / Models:
|
|
1297
|
+
* - `value`: Two-way selected option value (`string | undefined`). `undefined` means nothing is selected.
|
|
1298
|
+
* - `options`: Required array of radio options (`YuwRadioOptionDto[]`).
|
|
1299
|
+
* - `disabled`: Disables all radio options.
|
|
1300
|
+
* - `required`: Marks the group as required.
|
|
1301
|
+
* - `name`: Shared HTML `name` attribute for all radios, making them mutually exclusive in native
|
|
1302
|
+
* form submission. When omitted, a unique per-instance name is generated.
|
|
1303
|
+
* - `ariaLabel`: Accessible name for the `role="radiogroup"` element. User-facing text — the
|
|
1304
|
+
* consuming app is responsible for providing it translated.
|
|
1305
|
+
* - `ariaLabelledby`: ID of an external element (e.g. a visible heading) that labels the group.
|
|
1306
|
+
* - `class`: Extra classes merged onto the group container (layout tweaks like
|
|
1307
|
+
* `grid-cols-2` or `flex-row`). The `gap-3` base stays unless overridden.
|
|
1308
|
+
*
|
|
1309
|
+
* Usage:
|
|
1310
|
+
* ```html
|
|
1311
|
+
* <yuw-radio-group [options]="planOptions" [(value)]="selectedPlan" ariaLabel="Plan" />
|
|
1312
|
+
* <yuw-radio-group [options]="genderOptions" formControlName="gender" ariaLabelledby="gender-heading" />
|
|
1313
|
+
* ```
|
|
1314
|
+
*/
|
|
1315
|
+
class YuwRadioGroupComponent extends YuwValueAccessorBase {
|
|
1316
|
+
constructor() {
|
|
1317
|
+
super(...arguments);
|
|
1318
|
+
this.value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1319
|
+
this.options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
1320
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1321
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1322
|
+
this.name = input(undefined, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
1323
|
+
this.ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1324
|
+
this.ariaLabelledby = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
1325
|
+
this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1326
|
+
this._disabled = computed(() => this._isDisabled(this.disabled()), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
1327
|
+
this._generatedName = `yuw-radio-group-${++nextUniqueId$1}`;
|
|
1328
|
+
this._name = computed(() => this.name() ?? this._generatedName, ...(ngDevMode ? [{ debugName: "_name" }] : /* istanbul ignore next */ []));
|
|
1329
|
+
this._groupClass = computed(() => cn('gap-3', this.userClass()), ...(ngDevMode ? [{ debugName: "_groupClass" }] : /* istanbul ignore next */ []));
|
|
1330
|
+
}
|
|
1331
|
+
_emptyValue() {
|
|
1332
|
+
return undefined;
|
|
1333
|
+
}
|
|
1334
|
+
onValueChange(next) {
|
|
1335
|
+
this._commit(next);
|
|
1336
|
+
}
|
|
1337
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwRadioGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1338
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwRadioGroupComponent, isStandalone: true, selector: "yuw-radio-group", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwRadioGroupComponent)], usesInheritance: true, ngImport: i0, template: "<hlm-radio-group\n [class]=\"_groupClass()\"\n [value]=\"value() ?? ''\"\n [disabled]=\"_disabled()\"\n [required]=\"required()\"\n [name]=\"_name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n (valueChange)=\"onValueChange($event)\"\n (focusout)=\"_onBlur()\"\n>\n @for (option of options(); track option.value) {\n <label yuwLabel class=\"gap-3\">\n <hlm-radio [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">\n <hlm-radio-indicator indicator/>\n </hlm-radio>\n\n {{ option.label }}\n </label>\n }\n</hlm-radio-group>\n", dependencies: [{ kind: "directive", type: i1$6.HlmRadioGroup, selector: "[hlmRadioGroup],hlm-radio-group", inputs: ["class"] }, { kind: "component", type: i1$6.HlmRadio, selector: "hlm-radio", inputs: ["class", "inputId", "aria-label", "aria-labelledby", "aria-describedby", "value", "required", "disabled"], outputs: ["change"] }, { kind: "component", type: i1$6.HlmRadioIndicator, selector: "hlm-radio-indicator" }, { kind: "directive", type: YuwLabel, selector: "label[yuwLabel]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1339
|
+
}
|
|
1340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwRadioGroupComponent, decorators: [{
|
|
1341
|
+
type: Component,
|
|
1342
|
+
args: [{ selector: 'yuw-radio-group', imports: [...HlmRadioGroupImports, YuwLabel], providers: [provideValueAccessor(YuwRadioGroupComponent)], host: {
|
|
1343
|
+
class: 'contents',
|
|
1344
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-radio-group\n [class]=\"_groupClass()\"\n [value]=\"value() ?? ''\"\n [disabled]=\"_disabled()\"\n [required]=\"required()\"\n [name]=\"_name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n (valueChange)=\"onValueChange($event)\"\n (focusout)=\"_onBlur()\"\n>\n @for (option of options(); track option.value) {\n <label yuwLabel class=\"gap-3\">\n <hlm-radio [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">\n <hlm-radio-indicator indicator/>\n </hlm-radio>\n\n {{ option.label }}\n </label>\n }\n</hlm-radio-group>\n" }]
|
|
1345
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
1346
|
+
|
|
1347
|
+
/**
|
|
1348
|
+
* Loading skeleton placeholder directive with pulse animation effect.
|
|
1349
|
+
*
|
|
1350
|
+
* Sized using standard CSS height and width classes on the host element.
|
|
1351
|
+
*
|
|
1352
|
+
* Usage:
|
|
1353
|
+
* ```html
|
|
1354
|
+
* <div yuwSkeleton class="h-4 w-32 rounded"></div>
|
|
1355
|
+
* <div yuwSkeleton class="size-10 rounded-full"></div>
|
|
1356
|
+
* ```
|
|
1357
|
+
*/
|
|
1358
|
+
class YuwSkeletonDirective {
|
|
1359
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSkeletonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1360
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSkeletonDirective, isStandalone: true, selector: "[yuwSkeleton]", host: { attributes: { "aria-hidden": "true" } }, hostDirectives: [{ directive: i1$7.HlmSkeleton }], ngImport: i0 }); }
|
|
1361
|
+
}
|
|
1362
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSkeletonDirective, decorators: [{
|
|
1363
|
+
type: Directive,
|
|
1364
|
+
args: [{
|
|
1365
|
+
selector: '[yuwSkeleton]',
|
|
1366
|
+
hostDirectives: [HlmSkeleton],
|
|
1367
|
+
host: {
|
|
1368
|
+
'aria-hidden': 'true',
|
|
1369
|
+
},
|
|
1370
|
+
}]
|
|
1371
|
+
}] });
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* Container directive for card components.
|
|
1375
|
+
* Accepts optional `size` input (e.g. `'default'` or `'sm'`).
|
|
1376
|
+
*
|
|
1377
|
+
* Usage:
|
|
1378
|
+
* ```html
|
|
1379
|
+
* <div yuwCard>
|
|
1380
|
+
* <div yuwCardHeader>
|
|
1381
|
+
* <h3 yuwCardTitle>Title</h3>
|
|
1382
|
+
* <p yuwCardDescription>Description text</p>
|
|
1383
|
+
* </div>
|
|
1384
|
+
* <div yuwCardContent>Main content</div>
|
|
1385
|
+
* <div yuwCardFooter>Footer content</div>
|
|
1386
|
+
* </div>
|
|
1387
|
+
* ```
|
|
1388
|
+
*/
|
|
1389
|
+
class YuwCardDirective {
|
|
1390
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1391
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwCardDirective, isStandalone: true, selector: "[yuwCard]", hostDirectives: [{ directive: i1$8.HlmCard, inputs: ["size", "size"] }], ngImport: i0 }); }
|
|
1392
|
+
}
|
|
1393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardDirective, decorators: [{
|
|
1394
|
+
type: Directive,
|
|
1395
|
+
args: [{
|
|
1396
|
+
selector: '[yuwCard]',
|
|
1397
|
+
hostDirectives: [{ directive: HlmCard, inputs: ['size'] }],
|
|
1398
|
+
}]
|
|
1399
|
+
}] });
|
|
1400
|
+
/** Header container directive for a card. */
|
|
1401
|
+
class YuwCardHeaderDirective {
|
|
1402
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1403
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwCardHeaderDirective, isStandalone: true, selector: "[yuwCardHeader]", hostDirectives: [{ directive: i1$8.HlmCardHeader }], ngImport: i0 }); }
|
|
1404
|
+
}
|
|
1405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardHeaderDirective, decorators: [{
|
|
1406
|
+
type: Directive,
|
|
1407
|
+
args: [{
|
|
1408
|
+
selector: '[yuwCardHeader]',
|
|
1409
|
+
hostDirectives: [HlmCardHeader],
|
|
1410
|
+
}]
|
|
1411
|
+
}] });
|
|
1412
|
+
/** Heading directive for card title text. */
|
|
1413
|
+
class YuwCardTitleDirective {
|
|
1414
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1415
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwCardTitleDirective, isStandalone: true, selector: "[yuwCardTitle]", hostDirectives: [{ directive: i1$8.HlmCardTitle }], ngImport: i0 }); }
|
|
1416
|
+
}
|
|
1417
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardTitleDirective, decorators: [{
|
|
1418
|
+
type: Directive,
|
|
1419
|
+
args: [{
|
|
1420
|
+
selector: '[yuwCardTitle]',
|
|
1421
|
+
hostDirectives: [HlmCardTitle],
|
|
1422
|
+
}]
|
|
1423
|
+
}] });
|
|
1424
|
+
/** Subtitle or description directive for card text. */
|
|
1425
|
+
class YuwCardDescriptionDirective {
|
|
1426
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1427
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwCardDescriptionDirective, isStandalone: true, selector: "[yuwCardDescription]", hostDirectives: [{ directive: i1$8.HlmCardDescription }], ngImport: i0 }); }
|
|
1428
|
+
}
|
|
1429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardDescriptionDirective, decorators: [{
|
|
1430
|
+
type: Directive,
|
|
1431
|
+
args: [{
|
|
1432
|
+
selector: '[yuwCardDescription]',
|
|
1433
|
+
hostDirectives: [HlmCardDescription],
|
|
1434
|
+
}]
|
|
1435
|
+
}] });
|
|
1436
|
+
/** Header action directive for placing top-right controls (e.g. menu button or status badge). */
|
|
1437
|
+
class YuwCardActionDirective {
|
|
1438
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardActionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1439
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwCardActionDirective, isStandalone: true, selector: "[yuwCardAction]", hostDirectives: [{ directive: i1$8.HlmCardAction }], ngImport: i0 }); }
|
|
1440
|
+
}
|
|
1441
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardActionDirective, decorators: [{
|
|
1442
|
+
type: Directive,
|
|
1443
|
+
args: [{
|
|
1444
|
+
selector: '[yuwCardAction]',
|
|
1445
|
+
hostDirectives: [HlmCardAction],
|
|
1446
|
+
}]
|
|
1447
|
+
}] });
|
|
1448
|
+
/** Main body container directive for card content. */
|
|
1449
|
+
class YuwCardContentDirective {
|
|
1450
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1451
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwCardContentDirective, isStandalone: true, selector: "[yuwCardContent]", hostDirectives: [{ directive: i1$8.HlmCardContent }], ngImport: i0 }); }
|
|
1452
|
+
}
|
|
1453
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardContentDirective, decorators: [{
|
|
1454
|
+
type: Directive,
|
|
1455
|
+
args: [{
|
|
1456
|
+
selector: '[yuwCardContent]',
|
|
1457
|
+
hostDirectives: [HlmCardContent],
|
|
1458
|
+
}]
|
|
1459
|
+
}] });
|
|
1460
|
+
/** Footer container directive for card action buttons or summary info. */
|
|
1461
|
+
class YuwCardFooterDirective {
|
|
1462
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1463
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwCardFooterDirective, isStandalone: true, selector: "[yuwCardFooter]", hostDirectives: [{ directive: i1$8.HlmCardFooter }], ngImport: i0 }); }
|
|
1464
|
+
}
|
|
1465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCardFooterDirective, decorators: [{
|
|
1466
|
+
type: Directive,
|
|
1467
|
+
args: [{
|
|
1468
|
+
selector: '[yuwCardFooter]',
|
|
1469
|
+
hostDirectives: [HlmCardFooter],
|
|
1470
|
+
}]
|
|
1471
|
+
}] });
|
|
1472
|
+
/** Every card part, for a consumer's `imports`. */
|
|
1473
|
+
const YuwCardImports = [
|
|
1474
|
+
YuwCardDirective,
|
|
1475
|
+
YuwCardHeaderDirective,
|
|
1476
|
+
YuwCardTitleDirective,
|
|
1477
|
+
YuwCardDescriptionDirective,
|
|
1478
|
+
YuwCardActionDirective,
|
|
1479
|
+
YuwCardContentDirective,
|
|
1480
|
+
YuwCardFooterDirective,
|
|
1481
|
+
];
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* Container directive for empty-state layout panels (e.g., "No search results", "Inbox empty").
|
|
1485
|
+
*
|
|
1486
|
+
* Usage:
|
|
1487
|
+
* ```html
|
|
1488
|
+
* <div yuwEmpty>
|
|
1489
|
+
* <div yuwEmptyHeader>
|
|
1490
|
+
* <div yuwEmptyMedia>
|
|
1491
|
+
* <ng-icon name="lucideFolderOpen" />
|
|
1492
|
+
* </div>
|
|
1493
|
+
* <h3 yuwEmptyTitle>No files found</h3>
|
|
1494
|
+
* <p yuwEmptyDescription>Try uploading a file or changing your query.</p>
|
|
1495
|
+
* </div>
|
|
1496
|
+
* <div yuwEmptyContent>
|
|
1497
|
+
* <yuw-button>Upload File</yuw-button>
|
|
1498
|
+
* </div>
|
|
1499
|
+
* </div>
|
|
1500
|
+
* ```
|
|
1501
|
+
*/
|
|
1502
|
+
class YuwEmptyDirective {
|
|
1503
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1504
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwEmptyDirective, isStandalone: true, selector: "[yuwEmpty]", hostDirectives: [{ directive: i1$9.HlmEmpty }], ngImport: i0 }); }
|
|
1505
|
+
}
|
|
1506
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyDirective, decorators: [{
|
|
1507
|
+
type: Directive,
|
|
1508
|
+
args: [{
|
|
1509
|
+
selector: '[yuwEmpty]',
|
|
1510
|
+
hostDirectives: [HlmEmpty],
|
|
1511
|
+
}]
|
|
1512
|
+
}] });
|
|
1513
|
+
/** Header container directive for empty-state title and media. */
|
|
1514
|
+
class YuwEmptyHeaderDirective {
|
|
1515
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1516
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwEmptyHeaderDirective, isStandalone: true, selector: "[yuwEmptyHeader]", hostDirectives: [{ directive: i1$9.HlmEmptyHeader }], ngImport: i0 }); }
|
|
1517
|
+
}
|
|
1518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyHeaderDirective, decorators: [{
|
|
1519
|
+
type: Directive,
|
|
1520
|
+
args: [{
|
|
1521
|
+
selector: '[yuwEmptyHeader]',
|
|
1522
|
+
hostDirectives: [HlmEmptyHeader],
|
|
1523
|
+
}]
|
|
1524
|
+
}] });
|
|
1525
|
+
/** Slot directive for empty-state icons or illustrations. Supports `variant` input. */
|
|
1526
|
+
class YuwEmptyMediaDirective {
|
|
1527
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyMediaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1528
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwEmptyMediaDirective, isStandalone: true, selector: "[yuwEmptyMedia]", hostDirectives: [{ directive: i1$9.HlmEmptyMedia, inputs: ["variant", "variant"] }], ngImport: i0 }); }
|
|
1529
|
+
}
|
|
1530
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyMediaDirective, decorators: [{
|
|
1531
|
+
type: Directive,
|
|
1532
|
+
args: [{
|
|
1533
|
+
selector: '[yuwEmptyMedia]',
|
|
1534
|
+
hostDirectives: [{ directive: HlmEmptyMedia, inputs: ['variant'] }],
|
|
1535
|
+
}]
|
|
1536
|
+
}] });
|
|
1537
|
+
/** Title heading directive for empty state message. */
|
|
1538
|
+
class YuwEmptyTitleDirective {
|
|
1539
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1540
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwEmptyTitleDirective, isStandalone: true, selector: "[yuwEmptyTitle]", hostDirectives: [{ directive: i1$9.HlmEmptyTitle }], ngImport: i0 }); }
|
|
1541
|
+
}
|
|
1542
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyTitleDirective, decorators: [{
|
|
1543
|
+
type: Directive,
|
|
1544
|
+
args: [{
|
|
1545
|
+
selector: '[yuwEmptyTitle]',
|
|
1546
|
+
hostDirectives: [HlmEmptyTitle],
|
|
1547
|
+
}]
|
|
1548
|
+
}] });
|
|
1549
|
+
/** Description paragraph directive explaining the empty state. */
|
|
1550
|
+
class YuwEmptyDescriptionDirective {
|
|
1551
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1552
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwEmptyDescriptionDirective, isStandalone: true, selector: "[yuwEmptyDescription]", hostDirectives: [{ directive: i1$9.HlmEmptyDescription }], ngImport: i0 }); }
|
|
1553
|
+
}
|
|
1554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyDescriptionDirective, decorators: [{
|
|
1555
|
+
type: Directive,
|
|
1556
|
+
args: [{
|
|
1557
|
+
selector: '[yuwEmptyDescription]',
|
|
1558
|
+
hostDirectives: [HlmEmptyDescription],
|
|
1559
|
+
}]
|
|
1560
|
+
}] });
|
|
1561
|
+
/** Content slot directive for action buttons or call-to-action controls in an empty state. */
|
|
1562
|
+
class YuwEmptyContentDirective {
|
|
1563
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1564
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwEmptyContentDirective, isStandalone: true, selector: "[yuwEmptyContent]", hostDirectives: [{ directive: i1$9.HlmEmptyContent }], ngImport: i0 }); }
|
|
1565
|
+
}
|
|
1566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwEmptyContentDirective, decorators: [{
|
|
1567
|
+
type: Directive,
|
|
1568
|
+
args: [{
|
|
1569
|
+
selector: '[yuwEmptyContent]',
|
|
1570
|
+
hostDirectives: [HlmEmptyContent],
|
|
1571
|
+
}]
|
|
1572
|
+
}] });
|
|
1573
|
+
/** Every empty-state part, for a consumer's `imports`. */
|
|
1574
|
+
const YuwEmptyImports = [
|
|
1575
|
+
YuwEmptyDirective,
|
|
1576
|
+
YuwEmptyHeaderDirective,
|
|
1577
|
+
YuwEmptyMediaDirective,
|
|
1578
|
+
YuwEmptyTitleDirective,
|
|
1579
|
+
YuwEmptyDescriptionDirective,
|
|
1580
|
+
YuwEmptyContentDirective,
|
|
1581
|
+
];
|
|
1582
|
+
|
|
1583
|
+
/**
|
|
1584
|
+
* Checkmark shown at the trailing edge of a `[yuwContextMenuCheckbox]` item while it is checked.
|
|
1585
|
+
*
|
|
1586
|
+
* Place it inside the checkbox item; the helm indicator positions itself absolutely against the
|
|
1587
|
+
* item and only becomes visible when the item carries `data-checked`.
|
|
1588
|
+
*
|
|
1589
|
+
* Usage:
|
|
1590
|
+
* ```html
|
|
1591
|
+
* <button yuwContextMenuCheckbox [checked]="showArchived()" (triggered)="toggleArchived()">
|
|
1592
|
+
* Show archived
|
|
1593
|
+
* <yuw-context-menu-checkbox-indicator />
|
|
1594
|
+
* </button>
|
|
1595
|
+
* ```
|
|
1596
|
+
*/
|
|
1597
|
+
class YuwContextMenuCheckboxIndicatorComponent {
|
|
1598
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuCheckboxIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1599
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: YuwContextMenuCheckboxIndicatorComponent, isStandalone: true, selector: "yuw-context-menu-checkbox-indicator", host: { classAttribute: "contents" }, ngImport: i0, template: "<hlm-dropdown-menu-checkbox-indicator/>\n", dependencies: [{ kind: "component", type: HlmDropdownMenuCheckboxIndicator, selector: "hlm-dropdown-menu-checkbox-indicator" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1600
|
+
}
|
|
1601
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuCheckboxIndicatorComponent, decorators: [{
|
|
1602
|
+
type: Component,
|
|
1603
|
+
args: [{ selector: 'yuw-context-menu-checkbox-indicator', imports: [HlmDropdownMenuCheckboxIndicator], host: {
|
|
1604
|
+
class: 'contents',
|
|
1605
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-dropdown-menu-checkbox-indicator/>\n" }]
|
|
1606
|
+
}] });
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* Mark shown at the trailing edge of a `[yuwContextMenuRadio]` item while it is selected.
|
|
1610
|
+
*
|
|
1611
|
+
* Place it inside the radio item; the helm indicator positions itself absolutely against the
|
|
1612
|
+
* item and only becomes visible when the item carries `data-checked`.
|
|
1613
|
+
*
|
|
1614
|
+
* Usage:
|
|
1615
|
+
* ```html
|
|
1616
|
+
* <button yuwContextMenuRadio [checked]="order() === 'asc'" (triggered)="setOrder('asc')">
|
|
1617
|
+
* Ascending
|
|
1618
|
+
* <yuw-context-menu-radio-indicator />
|
|
1619
|
+
* </button>
|
|
1620
|
+
* ```
|
|
1621
|
+
*/
|
|
1622
|
+
class YuwContextMenuRadioIndicatorComponent {
|
|
1623
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuRadioIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1624
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: YuwContextMenuRadioIndicatorComponent, isStandalone: true, selector: "yuw-context-menu-radio-indicator", host: { classAttribute: "contents" }, ngImport: i0, template: "<hlm-dropdown-menu-radio-indicator/>\n", dependencies: [{ kind: "component", type: HlmDropdownMenuRadioIndicator, selector: "hlm-dropdown-menu-radio-indicator" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1625
|
+
}
|
|
1626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuRadioIndicatorComponent, decorators: [{
|
|
1627
|
+
type: Component,
|
|
1628
|
+
args: [{ selector: 'yuw-context-menu-radio-indicator', imports: [HlmDropdownMenuRadioIndicator], host: {
|
|
1629
|
+
class: 'contents',
|
|
1630
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-dropdown-menu-radio-indicator/>\n" }]
|
|
1631
|
+
}] });
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* Trailing chevron for a `[yuwContextMenuSubTrigger]` item, signalling that it opens a nested
|
|
1635
|
+
* sub-menu. Flips automatically in RTL layouts.
|
|
1636
|
+
*
|
|
1637
|
+
* Usage:
|
|
1638
|
+
* ```html
|
|
1639
|
+
* <button [yuwContextMenuSubTrigger]="subMenu">
|
|
1640
|
+
* More tools
|
|
1641
|
+
* <yuw-context-menu-sub-indicator />
|
|
1642
|
+
* </button>
|
|
1643
|
+
* ```
|
|
1644
|
+
*/
|
|
1645
|
+
class YuwContextMenuSubIndicatorComponent {
|
|
1646
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuSubIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1647
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: YuwContextMenuSubIndicatorComponent, isStandalone: true, selector: "yuw-context-menu-sub-indicator", host: { classAttribute: "contents" }, ngImport: i0, template: "<hlm-dropdown-menu-item-sub-indicator/>\n", dependencies: [{ kind: "component", type: HlmDropdownMenuItemSubIndicator, selector: "hlm-dropdown-menu-item-sub-indicator" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1648
|
+
}
|
|
1649
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuSubIndicatorComponent, decorators: [{
|
|
1650
|
+
type: Component,
|
|
1651
|
+
args: [{ selector: 'yuw-context-menu-sub-indicator', imports: [HlmDropdownMenuItemSubIndicator], host: {
|
|
1652
|
+
class: 'contents',
|
|
1653
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-dropdown-menu-item-sub-indicator/>\n" }]
|
|
1654
|
+
}] });
|
|
1655
|
+
|
|
1656
|
+
/**
|
|
1657
|
+
* Context menu directives suite based on right-click actions and panel controls.
|
|
1658
|
+
*
|
|
1659
|
+
* Why some inputs/outputs below are bridged imperatively instead of forwarded via
|
|
1660
|
+
* `hostDirectives`: Angular only lets a wrapper re-expose a host directive's *own* (or
|
|
1661
|
+
* class-inherited) inputs/outputs. Names the helm layer itself only *exposes* from its own host
|
|
1662
|
+
* directives (`hlmContextMenuTrigger`, `hlmContextMenuOpened`/`hlmContextMenuClosed`, the items'
|
|
1663
|
+
* `checked`/`disabled`/`keepOpen`/`triggered`) are not re-exposable one level further — the
|
|
1664
|
+
* compiler rejects the mapping with NG2017 ("does not have an input with a public name of …"),
|
|
1665
|
+
* and the runtime's `validateMappings` enforces the same rule. Verified against Angular 21.2
|
|
1666
|
+
* (`validateHostDirectiveMappings` in the compiler, `validateMappings` in core) and reproduced
|
|
1667
|
+
* with an isolated `ngc` compile. Own inputs of the helm classes (`disabled`/`align`/`side` on
|
|
1668
|
+
* the trigger, `inset`/`variant` on items, `sideOffset` on the panel) *are* forwarded
|
|
1669
|
+
* declaratively.
|
|
1670
|
+
*/
|
|
1671
|
+
/**
|
|
1672
|
+
* Attach to an element to open a context menu upon right-clicking.
|
|
1673
|
+
*
|
|
1674
|
+
* Usage:
|
|
1675
|
+
* ```html
|
|
1676
|
+
* <div [yuwContextMenuTrigger]="menu">Right-click me</div>
|
|
1677
|
+
*
|
|
1678
|
+
* <ng-template #menu>
|
|
1679
|
+
* <div yuwContextMenu>
|
|
1680
|
+
* <button yuwContextMenuItem (triggered)="onEdit()">Edit</button>
|
|
1681
|
+
* <button yuwContextMenuItem variant="destructive" (triggered)="onDelete()">Delete</button>
|
|
1682
|
+
* </div>
|
|
1683
|
+
* </ng-template>
|
|
1684
|
+
* ```
|
|
1685
|
+
*/
|
|
1686
|
+
class YuwContextMenuTriggerDirective {
|
|
1687
|
+
constructor() {
|
|
1688
|
+
this._trigger = inject(CdkContextMenuTrigger, { host: true });
|
|
1689
|
+
this.menu = input.required({ ...(ngDevMode ? { debugName: "menu" } : /* istanbul ignore next */ {}), alias: 'yuwContextMenuTrigger' });
|
|
1690
|
+
this.menuData = input(undefined, { ...(ngDevMode ? { debugName: "menuData" } : /* istanbul ignore next */ {}), alias: 'yuwContextMenuTriggerData' });
|
|
1691
|
+
this.opened = outputFromObservable(this._trigger.opened);
|
|
1692
|
+
this.closed = outputFromObservable(this._trigger.closed);
|
|
1693
|
+
effect(() => {
|
|
1694
|
+
this._trigger.menuTemplateRef = this.menu();
|
|
1695
|
+
this._trigger.menuData = this.menuData();
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1699
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: YuwContextMenuTriggerDirective, isStandalone: true, selector: "[yuwContextMenuTrigger]", inputs: { menu: { classPropertyName: "menu", publicName: "yuwContextMenuTrigger", isSignal: true, isRequired: true, transformFunction: null }, menuData: { classPropertyName: "menuData", publicName: "yuwContextMenuTriggerData", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, hostDirectives: [{ directive: i1$a.HlmContextMenuTrigger, inputs: ["disabled", "disabled", "align", "align", "side", "side"] }], ngImport: i0 }); }
|
|
1700
|
+
}
|
|
1701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuTriggerDirective, decorators: [{
|
|
1702
|
+
type: Directive,
|
|
1703
|
+
args: [{
|
|
1704
|
+
selector: '[yuwContextMenuTrigger]',
|
|
1705
|
+
hostDirectives: [
|
|
1706
|
+
{
|
|
1707
|
+
directive: HlmContextMenuTrigger,
|
|
1708
|
+
inputs: ['disabled', 'align', 'side'],
|
|
1709
|
+
},
|
|
1710
|
+
],
|
|
1711
|
+
}]
|
|
1712
|
+
}], ctorParameters: () => [], propDecorators: { menu: [{ type: i0.Input, args: [{ isSignal: true, alias: "yuwContextMenuTrigger", required: true }] }], menuData: [{ type: i0.Input, args: [{ isSignal: true, alias: "yuwContextMenuTriggerData", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
1713
|
+
/** Container directive for context menu options, placed inside the context menu template. */
|
|
1714
|
+
class YuwContextMenuDirective {
|
|
1715
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1716
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwContextMenuDirective, isStandalone: true, selector: "[yuwContextMenu]", hostDirectives: [{ directive: i2.HlmDropdownMenu, inputs: ["sideOffset", "sideOffset"] }], ngImport: i0 }); }
|
|
1717
|
+
}
|
|
1718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuDirective, decorators: [{
|
|
1719
|
+
type: Directive,
|
|
1720
|
+
args: [{
|
|
1721
|
+
selector: '[yuwContextMenu]',
|
|
1722
|
+
hostDirectives: [{ directive: HlmDropdownMenu, inputs: ['sideOffset'] }],
|
|
1723
|
+
}]
|
|
1724
|
+
}] });
|
|
1725
|
+
/** Interactive action item within a context menu. Place on a `<button>` element. */
|
|
1726
|
+
class YuwContextMenuItemDirective {
|
|
1727
|
+
constructor() {
|
|
1728
|
+
this._item = inject(CdkMenuItem, { host: true });
|
|
1729
|
+
this.triggered = outputFromObservable(this._item.triggered);
|
|
1730
|
+
}
|
|
1731
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1732
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwContextMenuItemDirective, isStandalone: true, selector: "[yuwContextMenuItem]", outputs: { triggered: "triggered" }, hostDirectives: [{ directive: i2.HlmDropdownMenuItem, inputs: ["disabled", "disabled", "variant", "variant", "inset", "inset"] }], ngImport: i0 }); }
|
|
1733
|
+
}
|
|
1734
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuItemDirective, decorators: [{
|
|
1735
|
+
type: Directive,
|
|
1736
|
+
args: [{
|
|
1737
|
+
selector: '[yuwContextMenuItem]',
|
|
1738
|
+
hostDirectives: [{ directive: HlmDropdownMenuItem, inputs: ['disabled', 'variant', 'inset'] }],
|
|
1739
|
+
}]
|
|
1740
|
+
}], propDecorators: { triggered: [{ type: i0.Output, args: ["triggered"] }] } });
|
|
1741
|
+
/**
|
|
1742
|
+
* Checkable action item within a context menu. Place on a `<button>` element and project a
|
|
1743
|
+
* `<yuw-context-menu-checkbox-indicator />` to show the checkmark while checked.
|
|
1744
|
+
*
|
|
1745
|
+
* Toggling keeps the menu open (the helm default). The `checked` input drives the state; listen
|
|
1746
|
+
* to `triggered` to flip it in the consumer.
|
|
1747
|
+
*
|
|
1748
|
+
* Usage:
|
|
1749
|
+
* ```html
|
|
1750
|
+
* <button yuwContextMenuCheckbox [checked]="showArchived()" (triggered)="toggleArchived()">
|
|
1751
|
+
* Show archived
|
|
1752
|
+
* <yuw-context-menu-checkbox-indicator />
|
|
1753
|
+
* </button>
|
|
1754
|
+
* ```
|
|
1755
|
+
*/
|
|
1756
|
+
class YuwContextMenuCheckboxDirective {
|
|
1757
|
+
constructor() {
|
|
1758
|
+
this._item = inject(CdkMenuItemCheckbox, { host: true });
|
|
1759
|
+
this.checked = input(false, { ...(ngDevMode ? { debugName: "checked" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1760
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1761
|
+
this.triggered = outputFromObservable(this._item.triggered);
|
|
1762
|
+
effect(() => {
|
|
1763
|
+
this._item.checked = this.checked();
|
|
1764
|
+
this._item.disabled = this.disabled();
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuCheckboxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1768
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: YuwContextMenuCheckboxDirective, isStandalone: true, selector: "[yuwContextMenuCheckbox]", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { triggered: "triggered" }, hostDirectives: [{ directive: i2.HlmDropdownMenuCheckbox, inputs: ["inset", "inset"] }], ngImport: i0 }); }
|
|
1769
|
+
}
|
|
1770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuCheckboxDirective, decorators: [{
|
|
1771
|
+
type: Directive,
|
|
1772
|
+
args: [{
|
|
1773
|
+
selector: '[yuwContextMenuCheckbox]',
|
|
1774
|
+
hostDirectives: [{ directive: HlmDropdownMenuCheckbox, inputs: ['inset'] }],
|
|
1775
|
+
}]
|
|
1776
|
+
}], ctorParameters: () => [], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], triggered: [{ type: i0.Output, args: ["triggered"] }] } });
|
|
1777
|
+
/**
|
|
1778
|
+
* Single-select (radio) item within a context menu. Place on a `<button>` element inside a
|
|
1779
|
+
* `[yuwContextMenuGroup]` and project a `<yuw-context-menu-radio-indicator />` to show the mark
|
|
1780
|
+
* while selected.
|
|
1781
|
+
*
|
|
1782
|
+
* Selecting keeps the menu open (the helm default). The `checked` input drives the state; listen
|
|
1783
|
+
* to `triggered` to set it in the consumer.
|
|
1784
|
+
*
|
|
1785
|
+
* Usage:
|
|
1786
|
+
* ```html
|
|
1787
|
+
* <div yuwContextMenuGroup>
|
|
1788
|
+
* <button yuwContextMenuRadio [checked]="order() === 'asc'" (triggered)="setOrder('asc')">
|
|
1789
|
+
* Ascending
|
|
1790
|
+
* <yuw-context-menu-radio-indicator />
|
|
1791
|
+
* </button>
|
|
1792
|
+
* </div>
|
|
1793
|
+
* ```
|
|
1794
|
+
*/
|
|
1795
|
+
class YuwContextMenuRadioDirective {
|
|
1796
|
+
constructor() {
|
|
1797
|
+
this._item = inject(CdkMenuItemRadio, { host: true });
|
|
1798
|
+
this.checked = input(false, { ...(ngDevMode ? { debugName: "checked" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1799
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1800
|
+
this.triggered = outputFromObservable(this._item.triggered);
|
|
1801
|
+
effect(() => {
|
|
1802
|
+
this._item.checked = this.checked();
|
|
1803
|
+
this._item.disabled = this.disabled();
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuRadioDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1807
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: YuwContextMenuRadioDirective, isStandalone: true, selector: "[yuwContextMenuRadio]", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { triggered: "triggered" }, hostDirectives: [{ directive: i2.HlmDropdownMenuRadio }], ngImport: i0 }); }
|
|
1808
|
+
}
|
|
1809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuRadioDirective, decorators: [{
|
|
1810
|
+
type: Directive,
|
|
1811
|
+
args: [{
|
|
1812
|
+
selector: '[yuwContextMenuRadio]',
|
|
1813
|
+
hostDirectives: [HlmDropdownMenuRadio],
|
|
1814
|
+
}]
|
|
1815
|
+
}], ctorParameters: () => [], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], triggered: [{ type: i0.Output, args: ["triggered"] }] } });
|
|
1816
|
+
/** Section heading/label within a context menu. */
|
|
1817
|
+
class YuwContextMenuLabelDirective {
|
|
1818
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1819
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwContextMenuLabelDirective, isStandalone: true, selector: "[yuwContextMenuLabel]", hostDirectives: [{ directive: i2.HlmDropdownMenuLabel, inputs: ["inset", "inset"] }], ngImport: i0 }); }
|
|
1820
|
+
}
|
|
1821
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuLabelDirective, decorators: [{
|
|
1822
|
+
type: Directive,
|
|
1823
|
+
args: [{
|
|
1824
|
+
selector: '[yuwContextMenuLabel]',
|
|
1825
|
+
hostDirectives: [{ directive: HlmDropdownMenuLabel, inputs: ['inset'] }],
|
|
1826
|
+
}]
|
|
1827
|
+
}] });
|
|
1828
|
+
/** Group container for grouping context menu items (required around `[yuwContextMenuRadio]` sets). */
|
|
1829
|
+
class YuwContextMenuGroupDirective {
|
|
1830
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1831
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwContextMenuGroupDirective, isStandalone: true, selector: "[yuwContextMenuGroup]", hostDirectives: [{ directive: i2.HlmDropdownMenuGroup }], ngImport: i0 }); }
|
|
1832
|
+
}
|
|
1833
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuGroupDirective, decorators: [{
|
|
1834
|
+
type: Directive,
|
|
1835
|
+
args: [{
|
|
1836
|
+
selector: '[yuwContextMenuGroup]',
|
|
1837
|
+
hostDirectives: [HlmDropdownMenuGroup],
|
|
1838
|
+
}]
|
|
1839
|
+
}] });
|
|
1840
|
+
/** Visual divider line between context menu items. */
|
|
1841
|
+
class YuwContextMenuSeparatorDirective {
|
|
1842
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuSeparatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1843
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwContextMenuSeparatorDirective, isStandalone: true, selector: "[yuwContextMenuSeparator]", hostDirectives: [{ directive: i2.HlmDropdownMenuSeparator }], ngImport: i0 }); }
|
|
1844
|
+
}
|
|
1845
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuSeparatorDirective, decorators: [{
|
|
1846
|
+
type: Directive,
|
|
1847
|
+
args: [{
|
|
1848
|
+
selector: '[yuwContextMenuSeparator]',
|
|
1849
|
+
hostDirectives: [HlmDropdownMenuSeparator],
|
|
1850
|
+
}]
|
|
1851
|
+
}] });
|
|
1852
|
+
/** Text hint for a keyboard shortcut displayed alongside a context menu item. */
|
|
1853
|
+
class YuwContextMenuShortcutDirective {
|
|
1854
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuShortcutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1855
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwContextMenuShortcutDirective, isStandalone: true, selector: "[yuwContextMenuShortcut]", hostDirectives: [{ directive: i2.HlmDropdownMenuShortcut }], ngImport: i0 }); }
|
|
1856
|
+
}
|
|
1857
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuShortcutDirective, decorators: [{
|
|
1858
|
+
type: Directive,
|
|
1859
|
+
args: [{
|
|
1860
|
+
selector: '[yuwContextMenuShortcut]',
|
|
1861
|
+
hostDirectives: [HlmDropdownMenuShortcut],
|
|
1862
|
+
}]
|
|
1863
|
+
}] });
|
|
1864
|
+
/** Container directive for nesting a sub-level context menu. */
|
|
1865
|
+
class YuwContextMenuSubDirective {
|
|
1866
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuSubDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1867
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwContextMenuSubDirective, isStandalone: true, selector: "[yuwContextMenuSub]", hostDirectives: [{ directive: i2.HlmDropdownMenuSub }], ngImport: i0 }); }
|
|
1868
|
+
}
|
|
1869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuSubDirective, decorators: [{
|
|
1870
|
+
type: Directive,
|
|
1871
|
+
args: [{
|
|
1872
|
+
selector: '[yuwContextMenuSub]',
|
|
1873
|
+
hostDirectives: [HlmDropdownMenuSub],
|
|
1874
|
+
}]
|
|
1875
|
+
}] });
|
|
1876
|
+
/**
|
|
1877
|
+
* Trigger item for expanding a nested sub-context menu.
|
|
1878
|
+
*
|
|
1879
|
+
* Usage:
|
|
1880
|
+
* ```html
|
|
1881
|
+
* <button [yuwContextMenuSubTrigger]="subMenu">
|
|
1882
|
+
* More tools
|
|
1883
|
+
* <yuw-context-menu-sub-indicator />
|
|
1884
|
+
* </button>
|
|
1885
|
+
* ```
|
|
1886
|
+
*/
|
|
1887
|
+
class YuwContextMenuSubTriggerDirective {
|
|
1888
|
+
constructor() {
|
|
1889
|
+
this._trigger = inject(CdkMenuTrigger, { host: true });
|
|
1890
|
+
this.menu = input.required({ ...(ngDevMode ? { debugName: "menu" } : /* istanbul ignore next */ {}), alias: 'yuwContextMenuSubTrigger' });
|
|
1891
|
+
effect(() => {
|
|
1892
|
+
this._trigger.menuTemplateRef = this.menu();
|
|
1893
|
+
});
|
|
1894
|
+
}
|
|
1895
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuSubTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1896
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: YuwContextMenuSubTriggerDirective, isStandalone: true, selector: "[yuwContextMenuSubTrigger]", inputs: { menu: { classPropertyName: "menu", publicName: "yuwContextMenuSubTrigger", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: i2.HlmDropdownMenuSubTrigger, inputs: ["align", "align", "side", "side"] }], ngImport: i0 }); }
|
|
1897
|
+
}
|
|
1898
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwContextMenuSubTriggerDirective, decorators: [{
|
|
1899
|
+
type: Directive,
|
|
1900
|
+
args: [{
|
|
1901
|
+
selector: '[yuwContextMenuSubTrigger]',
|
|
1902
|
+
hostDirectives: [{ directive: HlmDropdownMenuSubTrigger, inputs: ['align', 'side'] }],
|
|
1903
|
+
}]
|
|
1904
|
+
}], ctorParameters: () => [], propDecorators: { menu: [{ type: i0.Input, args: [{ isSignal: true, alias: "yuwContextMenuSubTrigger", required: true }] }] } });
|
|
1905
|
+
/** Every context-menu part, for a consumer's `imports`. */
|
|
1906
|
+
const YuwContextMenuImports = [
|
|
1907
|
+
YuwContextMenuTriggerDirective,
|
|
1908
|
+
YuwContextMenuDirective,
|
|
1909
|
+
YuwContextMenuItemDirective,
|
|
1910
|
+
YuwContextMenuCheckboxDirective,
|
|
1911
|
+
YuwContextMenuCheckboxIndicatorComponent,
|
|
1912
|
+
YuwContextMenuRadioDirective,
|
|
1913
|
+
YuwContextMenuRadioIndicatorComponent,
|
|
1914
|
+
YuwContextMenuLabelDirective,
|
|
1915
|
+
YuwContextMenuGroupDirective,
|
|
1916
|
+
YuwContextMenuSeparatorDirective,
|
|
1917
|
+
YuwContextMenuShortcutDirective,
|
|
1918
|
+
YuwContextMenuSubDirective,
|
|
1919
|
+
YuwContextMenuSubTriggerDirective,
|
|
1920
|
+
YuwContextMenuSubIndicatorComponent,
|
|
1921
|
+
];
|
|
1922
|
+
|
|
1923
|
+
/** Module-level counter for the fallback trigger id, so external labels always have a stable,
|
|
1924
|
+
* unique target even when the consumer doesn't pass `buttonId`. */
|
|
1925
|
+
let nextUniqueId = 0;
|
|
1926
|
+
/**
|
|
1927
|
+
* Date picker control supporting single date, date range, multiple dates, or month/year pick modes.
|
|
1928
|
+
*
|
|
1929
|
+
* Inputs / Models:
|
|
1930
|
+
* - `mode`: Selection mode (`'single'`, `'range'`, `'multiple'`, `'monthYear'`). Default is `'single'`.
|
|
1931
|
+
* - `value`: Two-way selected date(s) (`YuwDatepickerValue`). Shape follows `mode`. Emits
|
|
1932
|
+
* `valueChange` on every selection change.
|
|
1933
|
+
* - `disabled`: Disables the control.
|
|
1934
|
+
* - `placeholder`: Text shown on the trigger while nothing is selected.
|
|
1935
|
+
* - `minDate`: Earliest selectable date.
|
|
1936
|
+
* - `maxDate`: Latest selectable date.
|
|
1937
|
+
* - `captionLayout`: Calendar caption mode — `'dropdown'` adds month/year dropdowns for faster year navigation. Default is `'label'`.
|
|
1938
|
+
* Ignored in `monthYear` mode: that picker renders its own month/year grid and has no calendar caption.
|
|
1939
|
+
* - `align`: Popover alignment relative to trigger (`'start'`, `'center'`, `'end'`). Default is `'start'`.
|
|
1940
|
+
* - `buttonId`: HTML `id` for the trigger button, enabling external `<label for="...">`
|
|
1941
|
+
* association. When omitted, a unique per-instance id is generated.
|
|
1942
|
+
* - `class`: Extra classes merged onto the trigger button (e.g. a width), consumer classes win.
|
|
1943
|
+
* - `invalid`: Forces invalid styling.
|
|
1944
|
+
* - `formatDate`: Custom date formatter function `(date: Date) => string` for the trigger label.
|
|
1945
|
+
* In `range`/`multiple` modes it formats each date, joined with `' - '` / `', '`.
|
|
1946
|
+
*
|
|
1947
|
+
* Usage:
|
|
1948
|
+
* ```html
|
|
1949
|
+
* <yuw-datepicker [(value)]="selectedDate" placeholder="Select date..." />
|
|
1950
|
+
* <yuw-datepicker mode="range" [(value)]="dateRange" />
|
|
1951
|
+
* <yuw-datepicker mode="monthYear" [(value)]="selectedMonth" />
|
|
1952
|
+
* ```
|
|
1953
|
+
*/
|
|
1954
|
+
class YuwDatepickerComponent extends YuwValueAccessorBase {
|
|
1955
|
+
constructor() {
|
|
1956
|
+
super(...arguments);
|
|
1957
|
+
this.mode = input('single', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
1958
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1959
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1960
|
+
this.placeholder = input(undefined, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
1961
|
+
this.minDate = input(undefined, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
1962
|
+
this.maxDate = input(undefined, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
1963
|
+
this.captionLayout = input('label', ...(ngDevMode ? [{ debugName: "captionLayout" }] : /* istanbul ignore next */ []));
|
|
1964
|
+
this.align = input('start', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
1965
|
+
this.buttonId = input(undefined, ...(ngDevMode ? [{ debugName: "buttonId" }] : /* istanbul ignore next */ []));
|
|
1966
|
+
this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1967
|
+
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1968
|
+
this.formatDate = input(undefined, ...(ngDevMode ? [{ debugName: "formatDate" }] : /* istanbul ignore next */ []));
|
|
1969
|
+
this._disabled = computed(() => this._isDisabled(this.disabled()), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
1970
|
+
this._generatedButtonId = `yuw-datepicker-${++nextUniqueId}`;
|
|
1971
|
+
this._buttonId = computed(() => this.buttonId() ?? this._generatedButtonId, ...(ngDevMode ? [{ debugName: "_buttonId" }] : /* istanbul ignore next */ []));
|
|
1972
|
+
this._singleConfig = injectHlmDatePickerConfig();
|
|
1973
|
+
this._rangeConfig = injectHlmDateRangePickerConfig();
|
|
1974
|
+
this._multiConfig = injectHlmDatePickerMultiConfig();
|
|
1975
|
+
this._monthYearConfig = injectHlmMonthYearPickerConfig();
|
|
1976
|
+
this._formatSingle = computed(() => this.formatDate() ?? this._singleConfig.formatDate, ...(ngDevMode ? [{ debugName: "_formatSingle" }] : /* istanbul ignore next */ []));
|
|
1977
|
+
this._formatMonthYear = computed(() => this.formatDate() ?? this._monthYearConfig.formatDate, ...(ngDevMode ? [{ debugName: "_formatMonthYear" }] : /* istanbul ignore next */ []));
|
|
1978
|
+
this._formatRange = computed(() => {
|
|
1979
|
+
const format = this.formatDate();
|
|
1980
|
+
if (!format) {
|
|
1981
|
+
return this._rangeConfig.formatDates;
|
|
1982
|
+
}
|
|
1983
|
+
return ([start, end]) => [start, end]
|
|
1984
|
+
.filter((date) => date !== null)
|
|
1985
|
+
.map(format)
|
|
1986
|
+
.join(' - ');
|
|
1987
|
+
}, ...(ngDevMode ? [{ debugName: "_formatRange" }] : /* istanbul ignore next */ []));
|
|
1988
|
+
this._formatMulti = computed(() => {
|
|
1989
|
+
const format = this.formatDate();
|
|
1990
|
+
if (!format) {
|
|
1991
|
+
return this._multiConfig.formatDates;
|
|
1992
|
+
}
|
|
1993
|
+
return (dates) => dates.map(format).join(', ');
|
|
1994
|
+
}, ...(ngDevMode ? [{ debugName: "_formatMulti" }] : /* istanbul ignore next */ []));
|
|
1995
|
+
this._singleValue = computed(() => {
|
|
1996
|
+
const value = this.value();
|
|
1997
|
+
return Array.isArray(value) ? undefined : (value ?? undefined);
|
|
1998
|
+
}, ...(ngDevMode ? [{ debugName: "_singleValue" }] : /* istanbul ignore next */ []));
|
|
1999
|
+
this._rangeValue = computed(() => {
|
|
2000
|
+
const value = this.value();
|
|
2001
|
+
return Array.isArray(value) && value.length === 2 ? value : undefined;
|
|
2002
|
+
}, ...(ngDevMode ? [{ debugName: "_rangeValue" }] : /* istanbul ignore next */ []));
|
|
2003
|
+
this._multipleValue = computed(() => {
|
|
2004
|
+
const value = this.value();
|
|
2005
|
+
if (!value) {
|
|
2006
|
+
return [];
|
|
2007
|
+
}
|
|
2008
|
+
return Array.isArray(value) ? value : [value];
|
|
2009
|
+
}, ...(ngDevMode ? [{ debugName: "_multipleValue" }] : /* istanbul ignore next */ []));
|
|
2010
|
+
}
|
|
2011
|
+
_emptyValue() {
|
|
2012
|
+
return this.mode() === 'multiple' ? [] : null;
|
|
2013
|
+
}
|
|
2014
|
+
onValueChange(next) {
|
|
2015
|
+
this._commit(next);
|
|
2016
|
+
}
|
|
2017
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwDatepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2018
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwDatepickerComponent, isStandalone: true, selector: "yuw-datepicker", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, buttonId: { classPropertyName: "buttonId", publicName: "buttonId", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, formatDate: { classPropertyName: "formatDate", publicName: "formatDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { classAttribute: "contents" }, providers: [provideValueAccessor(YuwDatepickerComponent)], usesInheritance: true, ngImport: i0, template: "@switch (mode()) {\n @case ('range') {\n <hlm-date-range-picker [date]=\"_rangeValue()\" [disabled]=\"_disabled()\" [minDate]=\"minDate()\" [maxDate]=\"maxDate()\"\n [captionLayout]=\"captionLayout()\" [align]=\"align()\" [formatDates]=\"_formatRange()\"\n (dateChange)=\"onValueChange($event)\" (focusout)=\"_onBlur()\">\n <hlm-date-picker-trigger [buttonId]=\"_buttonId()\" [class]=\"userClass()\"\n [forceInvalid]=\"invalid()\">{{ placeholder() ?? '' }}\n </hlm-date-picker-trigger>\n </hlm-date-range-picker>\n }\n @case ('multiple') {\n <hlm-date-picker-multi [date]=\"_multipleValue()\" [disabled]=\"_disabled()\" [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [captionLayout]=\"captionLayout()\" [align]=\"align()\" [formatDates]=\"_formatMulti()\"\n (dateChange)=\"onValueChange($event)\" (focusout)=\"_onBlur()\">\n <hlm-date-picker-trigger [buttonId]=\"_buttonId()\" [class]=\"userClass()\"\n [forceInvalid]=\"invalid()\">{{ placeholder() ?? '' }}\n </hlm-date-picker-trigger>\n </hlm-date-picker-multi>\n }\n @case ('monthYear') {\n <hlm-month-year-picker [date]=\"_singleValue()\" [disabled]=\"_disabled()\" [minDate]=\"minDate()\" [maxDate]=\"maxDate()\"\n [align]=\"align()\" [formatDate]=\"_formatMonthYear()\" (dateChange)=\"onValueChange($event)\"\n (focusout)=\"_onBlur()\">\n <hlm-date-picker-trigger [buttonId]=\"_buttonId()\" [class]=\"userClass()\"\n [forceInvalid]=\"invalid()\">{{ placeholder() ?? '' }}\n </hlm-date-picker-trigger>\n </hlm-month-year-picker>\n }\n @default {\n <hlm-date-picker [date]=\"_singleValue()\" [disabled]=\"_disabled()\" [minDate]=\"minDate()\" [maxDate]=\"maxDate()\"\n [captionLayout]=\"captionLayout()\" [align]=\"align()\" [formatDate]=\"_formatSingle()\"\n (dateChange)=\"onValueChange($event)\" (focusout)=\"_onBlur()\">\n <hlm-date-picker-trigger [buttonId]=\"_buttonId()\" [class]=\"userClass()\"\n [forceInvalid]=\"invalid()\">{{ placeholder() ?? '' }}\n </hlm-date-picker-trigger>\n </hlm-date-picker>\n }\n}\n", dependencies: [{ kind: "component", type: i1$b.HlmDatePicker, selector: "hlm-date-picker", inputs: ["align", "captionLayout", "minDate", "maxDate", "disabled", "date", "defaultFocusedDate", "autoCloseOnSelect", "formatDate", "transformDate"], outputs: ["dateChange"] }, { kind: "component", type: i1$b.HlmDatePickerMulti, selector: "hlm-date-picker-multi", inputs: ["align", "captionLayout", "minDate", "maxDate", "minSelection", "maxSelection", "disabled", "date", "autoCloseOnMaxSelection", "formatDates", "transformDates"], outputs: ["dateChange"] }, { kind: "component", type: i1$b.HlmDateRangePicker, selector: "hlm-date-range-picker", inputs: ["align", "captionLayout", "minDate", "maxDate", "disabled", "date", "autoCloseOnEndSelection", "formatDates", "transformDates"], outputs: ["dateChange"] }, { kind: "component", type: i1$b.HlmDatePickerTrigger, selector: "hlm-date-picker-trigger", inputs: ["class", "buttonId", "forceInvalid", "variant", "showTrigger"] }, { kind: "component", type: i1$b.HlmMonthYearPicker, selector: "hlm-month-year-picker", inputs: ["align", "minDate", "maxDate", "disabled", "date", "defaultFocusedDate", "autoCloseOnSelect", "formatDate", "transformDate"], outputs: ["dateChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2019
|
+
}
|
|
2020
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwDatepickerComponent, decorators: [{
|
|
2021
|
+
type: Component,
|
|
2022
|
+
args: [{ selector: 'yuw-datepicker', imports: [...HlmDatePickerImports], providers: [provideValueAccessor(YuwDatepickerComponent)], host: {
|
|
2023
|
+
class: 'contents',
|
|
2024
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "@switch (mode()) {\n @case ('range') {\n <hlm-date-range-picker [date]=\"_rangeValue()\" [disabled]=\"_disabled()\" [minDate]=\"minDate()\" [maxDate]=\"maxDate()\"\n [captionLayout]=\"captionLayout()\" [align]=\"align()\" [formatDates]=\"_formatRange()\"\n (dateChange)=\"onValueChange($event)\" (focusout)=\"_onBlur()\">\n <hlm-date-picker-trigger [buttonId]=\"_buttonId()\" [class]=\"userClass()\"\n [forceInvalid]=\"invalid()\">{{ placeholder() ?? '' }}\n </hlm-date-picker-trigger>\n </hlm-date-range-picker>\n }\n @case ('multiple') {\n <hlm-date-picker-multi [date]=\"_multipleValue()\" [disabled]=\"_disabled()\" [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [captionLayout]=\"captionLayout()\" [align]=\"align()\" [formatDates]=\"_formatMulti()\"\n (dateChange)=\"onValueChange($event)\" (focusout)=\"_onBlur()\">\n <hlm-date-picker-trigger [buttonId]=\"_buttonId()\" [class]=\"userClass()\"\n [forceInvalid]=\"invalid()\">{{ placeholder() ?? '' }}\n </hlm-date-picker-trigger>\n </hlm-date-picker-multi>\n }\n @case ('monthYear') {\n <hlm-month-year-picker [date]=\"_singleValue()\" [disabled]=\"_disabled()\" [minDate]=\"minDate()\" [maxDate]=\"maxDate()\"\n [align]=\"align()\" [formatDate]=\"_formatMonthYear()\" (dateChange)=\"onValueChange($event)\"\n (focusout)=\"_onBlur()\">\n <hlm-date-picker-trigger [buttonId]=\"_buttonId()\" [class]=\"userClass()\"\n [forceInvalid]=\"invalid()\">{{ placeholder() ?? '' }}\n </hlm-date-picker-trigger>\n </hlm-month-year-picker>\n }\n @default {\n <hlm-date-picker [date]=\"_singleValue()\" [disabled]=\"_disabled()\" [minDate]=\"minDate()\" [maxDate]=\"maxDate()\"\n [captionLayout]=\"captionLayout()\" [align]=\"align()\" [formatDate]=\"_formatSingle()\"\n (dateChange)=\"onValueChange($event)\" (focusout)=\"_onBlur()\">\n <hlm-date-picker-trigger [buttonId]=\"_buttonId()\" [class]=\"userClass()\"\n [forceInvalid]=\"invalid()\">{{ placeholder() ?? '' }}\n </hlm-date-picker-trigger>\n </hlm-date-picker>\n }\n}\n" }]
|
|
2025
|
+
}], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], buttonId: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonId", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], formatDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatDate", required: false }] }] } });
|
|
2026
|
+
|
|
2027
|
+
/**
|
|
2028
|
+
* Outer wrapper container directive for responsive HTML table scroll container.
|
|
2029
|
+
*
|
|
2030
|
+
* Usage:
|
|
2031
|
+
* ```html
|
|
2032
|
+
* <div yuwTableContainer>
|
|
2033
|
+
* <table yuwTable>
|
|
2034
|
+
* <thead yuwTHead>
|
|
2035
|
+
* <tr yuwTr><th yuwTh>Header</th></tr>
|
|
2036
|
+
* </thead>
|
|
2037
|
+
* <tbody yuwTBody>
|
|
2038
|
+
* <tr yuwTr><td yuwTd>Data cell</td></tr>
|
|
2039
|
+
* </tbody>
|
|
2040
|
+
* </table>
|
|
2041
|
+
* </div>
|
|
2042
|
+
* ```
|
|
2043
|
+
*/
|
|
2044
|
+
class YuwTableContainerDirective {
|
|
2045
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTableContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2046
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwTableContainerDirective, isStandalone: true, selector: "[yuwTableContainer]", hostDirectives: [{ directive: i1$c.HlmTableContainer }], ngImport: i0 }); }
|
|
2047
|
+
}
|
|
2048
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTableContainerDirective, decorators: [{
|
|
2049
|
+
type: Directive,
|
|
2050
|
+
args: [{
|
|
2051
|
+
selector: '[yuwTableContainer]',
|
|
2052
|
+
hostDirectives: [HlmTableContainer],
|
|
2053
|
+
}]
|
|
2054
|
+
}] });
|
|
2055
|
+
/** Table element styling directive applied to native `<table>`. */
|
|
2056
|
+
class YuwTableDirective {
|
|
2057
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2058
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwTableDirective, isStandalone: true, selector: "[yuwTable]", hostDirectives: [{ directive: i1$c.HlmTable }], ngImport: i0 }); }
|
|
2059
|
+
}
|
|
2060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTableDirective, decorators: [{
|
|
2061
|
+
type: Directive,
|
|
2062
|
+
args: [{
|
|
2063
|
+
selector: '[yuwTable]',
|
|
2064
|
+
hostDirectives: [HlmTable],
|
|
2065
|
+
}]
|
|
2066
|
+
}] });
|
|
2067
|
+
/** Table header container directive applied to native `<thead>`. */
|
|
2068
|
+
class YuwTHeadDirective {
|
|
2069
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTHeadDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2070
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwTHeadDirective, isStandalone: true, selector: "[yuwTHead]", hostDirectives: [{ directive: i1$c.HlmTHead }], ngImport: i0 }); }
|
|
2071
|
+
}
|
|
2072
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTHeadDirective, decorators: [{
|
|
2073
|
+
type: Directive,
|
|
2074
|
+
args: [{
|
|
2075
|
+
selector: '[yuwTHead]',
|
|
2076
|
+
hostDirectives: [HlmTHead],
|
|
2077
|
+
}]
|
|
2078
|
+
}] });
|
|
2079
|
+
/** Table body container directive applied to native `<tbody>`. */
|
|
2080
|
+
class YuwTBodyDirective {
|
|
2081
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTBodyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2082
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwTBodyDirective, isStandalone: true, selector: "[yuwTBody]", hostDirectives: [{ directive: i1$c.HlmTBody }], ngImport: i0 }); }
|
|
2083
|
+
}
|
|
2084
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTBodyDirective, decorators: [{
|
|
2085
|
+
type: Directive,
|
|
2086
|
+
args: [{
|
|
2087
|
+
selector: '[yuwTBody]',
|
|
2088
|
+
hostDirectives: [HlmTBody],
|
|
2089
|
+
}]
|
|
2090
|
+
}] });
|
|
2091
|
+
/** Table footer container directive applied to native `<tfoot>`. */
|
|
2092
|
+
class YuwTFootDirective {
|
|
2093
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTFootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2094
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwTFootDirective, isStandalone: true, selector: "[yuwTFoot]", hostDirectives: [{ directive: i1$c.HlmTFoot }], ngImport: i0 }); }
|
|
2095
|
+
}
|
|
2096
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTFootDirective, decorators: [{
|
|
2097
|
+
type: Directive,
|
|
2098
|
+
args: [{
|
|
2099
|
+
selector: '[yuwTFoot]',
|
|
2100
|
+
hostDirectives: [HlmTFoot],
|
|
2101
|
+
}]
|
|
2102
|
+
}] });
|
|
2103
|
+
/** Table row directive applied to native `<tr>`. */
|
|
2104
|
+
class YuwTrDirective {
|
|
2105
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTrDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2106
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwTrDirective, isStandalone: true, selector: "[yuwTr]", hostDirectives: [{ directive: i1$c.HlmTr }], ngImport: i0 }); }
|
|
2107
|
+
}
|
|
2108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTrDirective, decorators: [{
|
|
2109
|
+
type: Directive,
|
|
2110
|
+
args: [{
|
|
2111
|
+
selector: '[yuwTr]',
|
|
2112
|
+
hostDirectives: [HlmTr],
|
|
2113
|
+
}]
|
|
2114
|
+
}] });
|
|
2115
|
+
/** Table header cell directive applied to native `<th>`. */
|
|
2116
|
+
class YuwThDirective {
|
|
2117
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwThDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2118
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwThDirective, isStandalone: true, selector: "[yuwTh]", hostDirectives: [{ directive: i1$c.HlmTh }], ngImport: i0 }); }
|
|
2119
|
+
}
|
|
2120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwThDirective, decorators: [{
|
|
2121
|
+
type: Directive,
|
|
2122
|
+
args: [{
|
|
2123
|
+
selector: '[yuwTh]',
|
|
2124
|
+
hostDirectives: [HlmTh],
|
|
2125
|
+
}]
|
|
2126
|
+
}] });
|
|
2127
|
+
/** Table data cell directive applied to native `<td>`. */
|
|
2128
|
+
class YuwTdDirective {
|
|
2129
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTdDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2130
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwTdDirective, isStandalone: true, selector: "[yuwTd]", hostDirectives: [{ directive: i1$c.HlmTd }], ngImport: i0 }); }
|
|
2131
|
+
}
|
|
2132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTdDirective, decorators: [{
|
|
2133
|
+
type: Directive,
|
|
2134
|
+
args: [{
|
|
2135
|
+
selector: '[yuwTd]',
|
|
2136
|
+
hostDirectives: [HlmTd],
|
|
2137
|
+
}]
|
|
2138
|
+
}] });
|
|
2139
|
+
/** Table caption directive applied to native `<caption>`. */
|
|
2140
|
+
class YuwCaptionDirective {
|
|
2141
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCaptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2142
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwCaptionDirective, isStandalone: true, selector: "[yuwCaption]", hostDirectives: [{ directive: i1$c.HlmCaption }], ngImport: i0 }); }
|
|
2143
|
+
}
|
|
2144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwCaptionDirective, decorators: [{
|
|
2145
|
+
type: Directive,
|
|
2146
|
+
args: [{
|
|
2147
|
+
selector: '[yuwCaption]',
|
|
2148
|
+
hostDirectives: [HlmCaption],
|
|
2149
|
+
}]
|
|
2150
|
+
}] });
|
|
2151
|
+
/** Every table part, for a consumer's `imports`. */
|
|
2152
|
+
const YuwTableImports = [
|
|
2153
|
+
YuwTableContainerDirective,
|
|
2154
|
+
YuwTableDirective,
|
|
2155
|
+
YuwTHeadDirective,
|
|
2156
|
+
YuwTBodyDirective,
|
|
2157
|
+
YuwTFootDirective,
|
|
2158
|
+
YuwTrDirective,
|
|
2159
|
+
YuwThDirective,
|
|
2160
|
+
YuwTdDirective,
|
|
2161
|
+
YuwCaptionDirective,
|
|
2162
|
+
];
|
|
2163
|
+
|
|
2164
|
+
const YUW_DATATABLE_FEATURES = {
|
|
2165
|
+
columnFilteringFeature,
|
|
2166
|
+
columnVisibilityFeature,
|
|
2167
|
+
rowPaginationFeature,
|
|
2168
|
+
rowSelectionFeature,
|
|
2169
|
+
rowSortingFeature,
|
|
2170
|
+
};
|
|
2171
|
+
/**
|
|
2172
|
+
* Full-featured data table component supporting sorting, filtering, pagination, row selection,
|
|
2173
|
+
* loading skeleton state, and column visibility.
|
|
2174
|
+
*
|
|
2175
|
+
* Inputs / Models:
|
|
2176
|
+
* - `columns`: Column definitions array (`YuwDatatableColumnDef<TData>[]`). Default is `[]`.
|
|
2177
|
+
* - `data`: Row data array (`TData[]`). Default is `[]`.
|
|
2178
|
+
* - `sortable`: Enables click-to-sort on headers whose column allows it.
|
|
2179
|
+
* - `paginated`: Enables the pagination row model and renders footer controls.
|
|
2180
|
+
* - `selectable`: Enables the row-selection state. The checkbox column itself is *not* rendered
|
|
2181
|
+
* by the datatable — the consumer provides it as a display column (`id: 'select'`,
|
|
2182
|
+
* `flexRenderComponent(...)` header/cell that call TanStack's own toggle handlers), as in the
|
|
2183
|
+
* demo's data page.
|
|
2184
|
+
* - `emptyText`: Message shown when data is empty or filtered to nothing. User-facing text the
|
|
2185
|
+
* consuming app is responsible for translating.
|
|
2186
|
+
* - `loading`: Renders skeleton rows instead of data. The pagination footer stays visible (with
|
|
2187
|
+
* its buttons disabled) so the layout doesn't jump.
|
|
2188
|
+
* - `loadingRows`: Number of skeleton rows to show while `loading`. Default is `5`.
|
|
2189
|
+
* - `previousPageLabel` (required): Accessible name for the footer's previous-page button.
|
|
2190
|
+
* User-facing text the consuming app is responsible for translating.
|
|
2191
|
+
* - `nextPageLabel` (required): Accessible name for the footer's next-page button. User-facing
|
|
2192
|
+
* text the consuming app is responsible for translating.
|
|
2193
|
+
* - `caption`: Optional `<caption>` text for the table. User-facing text the consuming app is
|
|
2194
|
+
* responsible for translating; when absent, no caption is rendered.
|
|
2195
|
+
* - `tableClass`: Extra classes merged onto the inner `<table>` element. The host is
|
|
2196
|
+
* `display: contents`, so a plain `class` on `<yuw-datatable>` would never reach the table.
|
|
2197
|
+
* - `sorting`: Two-way sorting state (`SortingState`).
|
|
2198
|
+
* - `columnFilters`: Two-way column filters state (`ColumnFiltersState`).
|
|
2199
|
+
* - `columnVisibility`: Two-way column visibility state (`ColumnVisibilityState`).
|
|
2200
|
+
* - `rowSelection`: Two-way row selection state (`RowSelectionState`).
|
|
2201
|
+
* - `pagination`: Two-way pagination state (`PaginationState`). Default is `{ pageIndex: 0, pageSize: 10 }`.
|
|
2202
|
+
*
|
|
2203
|
+
* Outputs:
|
|
2204
|
+
* - `selectedRowsChange`: Emits the selected row objects (`TData[]`) on selection changes. The
|
|
2205
|
+
* initial state does not emit — only actual changes after mount.
|
|
2206
|
+
*
|
|
2207
|
+
* Usage:
|
|
2208
|
+
* ```html
|
|
2209
|
+
* <yuw-datatable
|
|
2210
|
+
* [columns]="columns"
|
|
2211
|
+
* [data]="users"
|
|
2212
|
+
* [(sorting)]="sorting"
|
|
2213
|
+
* paginated
|
|
2214
|
+
* selectable
|
|
2215
|
+
* previousPageLabel="Página anterior"
|
|
2216
|
+
* nextPageLabel="Página siguiente"
|
|
2217
|
+
* (selectedRowsChange)="onSelect($event)"
|
|
2218
|
+
* />
|
|
2219
|
+
* ```
|
|
2220
|
+
*/
|
|
2221
|
+
class YuwDatatableComponent {
|
|
2222
|
+
constructor() {
|
|
2223
|
+
this.columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
2224
|
+
this.data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
2225
|
+
this.sortable = input(false, { ...(ngDevMode ? { debugName: "sortable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2226
|
+
this.paginated = input(false, { ...(ngDevMode ? { debugName: "paginated" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2227
|
+
this.selectable = input(false, { ...(ngDevMode ? { debugName: "selectable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2228
|
+
this.emptyText = input(undefined, ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
2229
|
+
this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2230
|
+
this.loadingRows = input(5, { ...(ngDevMode ? { debugName: "loadingRows" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
2231
|
+
this.previousPageLabel = input.required(...(ngDevMode ? [{ debugName: "previousPageLabel" }] : /* istanbul ignore next */ []));
|
|
2232
|
+
this.nextPageLabel = input.required(...(ngDevMode ? [{ debugName: "nextPageLabel" }] : /* istanbul ignore next */ []));
|
|
2233
|
+
this.caption = input(undefined, ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
2234
|
+
this.tableClass = input(undefined, ...(ngDevMode ? [{ debugName: "tableClass" }] : /* istanbul ignore next */ []));
|
|
2235
|
+
this.sorting = model([], ...(ngDevMode ? [{ debugName: "sorting" }] : /* istanbul ignore next */ []));
|
|
2236
|
+
this.columnFilters = model([], ...(ngDevMode ? [{ debugName: "columnFilters" }] : /* istanbul ignore next */ []));
|
|
2237
|
+
this.columnVisibility = model({}, ...(ngDevMode ? [{ debugName: "columnVisibility" }] : /* istanbul ignore next */ []));
|
|
2238
|
+
this.rowSelection = model({}, ...(ngDevMode ? [{ debugName: "rowSelection" }] : /* istanbul ignore next */ []));
|
|
2239
|
+
this.pagination = model({ pageIndex: 0, pageSize: 10 }, ...(ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []));
|
|
2240
|
+
this._options = () => ({
|
|
2241
|
+
features: {
|
|
2242
|
+
...YUW_DATATABLE_FEATURES,
|
|
2243
|
+
coreRowModel: createCoreRowModel(),
|
|
2244
|
+
filteredRowModel: createFilteredRowModel(),
|
|
2245
|
+
...(this.sortable()
|
|
2246
|
+
? { sortedRowModel: createSortedRowModel(), sortFns }
|
|
2247
|
+
: {}),
|
|
2248
|
+
...(this.paginated() ? { paginatedRowModel: createPaginatedRowModel() } : {}),
|
|
2249
|
+
},
|
|
2250
|
+
data: this.data(),
|
|
2251
|
+
columns: this.columns(),
|
|
2252
|
+
enableRowSelection: this.selectable(),
|
|
2253
|
+
state: {
|
|
2254
|
+
sorting: this.sorting(),
|
|
2255
|
+
columnFilters: this.columnFilters(),
|
|
2256
|
+
columnVisibility: this.columnVisibility(),
|
|
2257
|
+
rowSelection: this.rowSelection(),
|
|
2258
|
+
pagination: this.pagination(),
|
|
2259
|
+
},
|
|
2260
|
+
onSortingChange: (updater) => this.sorting.update((current) => (typeof updater === 'function' ? updater(current) : updater)),
|
|
2261
|
+
onColumnFiltersChange: (updater) => this.columnFilters.update((current) => (typeof updater === 'function' ? updater(current) : updater)),
|
|
2262
|
+
onColumnVisibilityChange: (updater) => this.columnVisibility.update((current) => (typeof updater === 'function' ? updater(current) : updater)),
|
|
2263
|
+
onPaginationChange: (updater) => this.pagination.update((current) => (typeof updater === 'function' ? updater(current) : updater)),
|
|
2264
|
+
onRowSelectionChange: (updater) => this.rowSelection.update((current) => (typeof updater === 'function' ? updater(current) : updater)),
|
|
2265
|
+
});
|
|
2266
|
+
this.table = injectTable(this._options);
|
|
2267
|
+
this._selectedRows = computed(() => {
|
|
2268
|
+
this.rowSelection();
|
|
2269
|
+
return this.table.getSelectedRowModel().rows.map((row) => row.original);
|
|
2270
|
+
}, ...(ngDevMode ? [{ debugName: "_selectedRows" }] : /* istanbul ignore next */ []));
|
|
2271
|
+
this.selectedRowsChange = outputFromObservable(toObservable(this._selectedRows).pipe(skip(1)));
|
|
2272
|
+
this._isEmpty = computed(() => !this.loading() && this.table.getRowModel().rows.length === 0, ...(ngDevMode ? [{ debugName: "_isEmpty" }] : /* istanbul ignore next */ []));
|
|
2273
|
+
this._columnCount = computed(() => this.table.getVisibleLeafColumns().length, ...(ngDevMode ? [{ debugName: "_columnCount" }] : /* istanbul ignore next */ []));
|
|
2274
|
+
this._skeletonRows = computed(() => Array.from({ length: this.loadingRows() }, (_, i) => i), ...(ngDevMode ? [{ debugName: "_skeletonRows" }] : /* istanbul ignore next */ []));
|
|
2275
|
+
this._tableClass = computed(() => cn(this.tableClass()), ...(ngDevMode ? [{ debugName: "_tableClass" }] : /* istanbul ignore next */ []));
|
|
2276
|
+
this._ariaSort = {
|
|
2277
|
+
asc: 'ascending',
|
|
2278
|
+
desc: 'descending',
|
|
2279
|
+
};
|
|
2280
|
+
}
|
|
2281
|
+
/**
|
|
2282
|
+
* Applies the real options once, after inputs are set.
|
|
2283
|
+
*
|
|
2284
|
+
* `injectTable` constructs the table from a `queueMicrotask` that can fire before Angular has
|
|
2285
|
+
* assigned any input, so it captures `columns: []`/`data: []`. Its own options effect then
|
|
2286
|
+
* *skips its first run* (an `isMount` guard inside the library) — and that skipped run is
|
|
2287
|
+
* exactly the one carrying the real values. Without this the table stays permanently empty no
|
|
2288
|
+
* matter what is bound.
|
|
2289
|
+
*
|
|
2290
|
+
* This runs in `ngOnInit` rather than a constructor `effect` because the effect fires in the
|
|
2291
|
+
* same too-early window and re-applies the same empty options; `ngOnInit` is the first point
|
|
2292
|
+
* where inputs are guaranteed present. Later changes are handled by the library's own effect,
|
|
2293
|
+
* which by then is past its mount guard.
|
|
2294
|
+
*/
|
|
2295
|
+
ngOnInit() {
|
|
2296
|
+
const options = this._options();
|
|
2297
|
+
this.table.setOptions((previous) => ({ ...previous, ...options }));
|
|
2298
|
+
}
|
|
2299
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwDatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2300
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwDatatableComponent, isStandalone: true, selector: "yuw-datatable", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, paginated: { classPropertyName: "paginated", publicName: "paginated", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", 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 }, previousPageLabel: { classPropertyName: "previousPageLabel", publicName: "previousPageLabel", isSignal: true, isRequired: true, transformFunction: null }, nextPageLabel: { classPropertyName: "nextPageLabel", publicName: "nextPageLabel", isSignal: true, isRequired: true, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, sorting: { classPropertyName: "sorting", publicName: "sorting", isSignal: true, isRequired: false, transformFunction: null }, columnFilters: { classPropertyName: "columnFilters", publicName: "columnFilters", isSignal: true, isRequired: false, transformFunction: null }, columnVisibility: { classPropertyName: "columnVisibility", publicName: "columnVisibility", isSignal: true, isRequired: false, transformFunction: null }, rowSelection: { classPropertyName: "rowSelection", publicName: "rowSelection", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sorting: "sortingChange", columnFilters: "columnFiltersChange", columnVisibility: "columnVisibilityChange", rowSelection: "rowSelectionChange", pagination: "paginationChange", selectedRowsChange: "selectedRowsChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div yuwTableContainer>\n <table yuwTable [class]=\"_tableClass()\">\n @if (caption()) {\n <caption yuwCaption>{{ caption() }}</caption>\n }\n\n <thead yuwTHead>\n @for (headerGroup of table.getHeaderGroups(); track headerGroup.id) {\n <tr yuwTr>\n @for (header of headerGroup.headers; track header.id) {\n @let sorted = header.column.getIsSorted();\n <th yuwTh scope=\"col\" [attr.colspan]=\"header.colSpan\" [attr.aria-sort]=\"sorted ? _ariaSort[sorted] : null\">\n @if (!header.isPlaceholder) {\n @if (sortable() && header.column.getCanSort()) {\n <button type=\"button\" class=\"inline-flex items-center gap-1 select-none hover:text-foreground/80\"\n (click)=\"header.column.toggleSorting()\">\n <ng-container\n *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n\n @if (sorted === 'asc') {\n <span aria-hidden=\"true\">\u2191</span>\n } @else if (sorted === 'desc') {\n <span aria-hidden=\"true\">\u2193</span>\n } @else {\n <span aria-hidden=\"true\">\u2195</span>\n }\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>\n @for (column of table.getVisibleLeafColumns(); track column.id) {\n <td yuwTd><span yuwSkeleton class=\"block h-4 w-full\"></span></td>\n }\n </tr>\n }\n } @else if (_isEmpty()) {\n <tr yuwTr>\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 yuwTr [attr.data-state]=\"row.getIsSelected() ? 'selected' : null\">\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td yuwTd>\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 justify-between gap-4 py-3\">\n @if (selectable()) {\n <p class=\"text-sm text-muted-foreground\">\n {{ table.getSelectedRowModel().rows.length }} / {{ table.getFilteredRowModel().rows.length }}\n </p>\n } @else {\n <span></span>\n }\n\n <div class=\"flex items-center gap-2\">\n <yuw-button variant=\"ghost\" size=\"sm\" [disabled]=\"loading() || !table.getCanPreviousPage()\"\n [ariaLabel]=\"previousPageLabel()\" (clicked)=\"table.previousPage()\">\n <span aria-hidden=\"true\">←</span>\n </yuw-button>\n <span class=\"text-sm text-muted-foreground\">\n {{ pagination().pageIndex + 1 }} / {{ table.getPageCount() || 1 }}\n </span>\n <yuw-button variant=\"ghost\" size=\"sm\" [disabled]=\"loading() || !table.getCanNextPage()\"\n [ariaLabel]=\"nextPageLabel()\" (clicked)=\"table.nextPage()\">\n <span aria-hidden=\"true\">→</span>\n </yuw-button>\n </div>\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: YuwButtonComponent, selector: "yuw-button", inputs: ["variant", "size", "color", "disabled", "type", "href", "target", "transparent", "yuwDropdownMenuTrigger", "ariaLabel", "buttons", "orientation", "groupAriaLabel", "class"], outputs: ["clicked", "buttonClicked"] }, { kind: "directive", type: YuwSkeletonDirective, selector: "[yuwSkeleton]" }, { kind: "directive", type: FlexRenderDirective, selector: "ng-template[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2301
|
+
}
|
|
2302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwDatatableComponent, decorators: [{
|
|
2303
|
+
type: Component,
|
|
2304
|
+
args: [{ selector: 'yuw-datatable', imports: [...YuwTableImports, YuwButtonComponent, YuwSkeletonDirective, FlexRenderDirective], host: {
|
|
2305
|
+
class: 'contents',
|
|
2306
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div yuwTableContainer>\n <table yuwTable [class]=\"_tableClass()\">\n @if (caption()) {\n <caption yuwCaption>{{ caption() }}</caption>\n }\n\n <thead yuwTHead>\n @for (headerGroup of table.getHeaderGroups(); track headerGroup.id) {\n <tr yuwTr>\n @for (header of headerGroup.headers; track header.id) {\n @let sorted = header.column.getIsSorted();\n <th yuwTh scope=\"col\" [attr.colspan]=\"header.colSpan\" [attr.aria-sort]=\"sorted ? _ariaSort[sorted] : null\">\n @if (!header.isPlaceholder) {\n @if (sortable() && header.column.getCanSort()) {\n <button type=\"button\" class=\"inline-flex items-center gap-1 select-none hover:text-foreground/80\"\n (click)=\"header.column.toggleSorting()\">\n <ng-container\n *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n\n @if (sorted === 'asc') {\n <span aria-hidden=\"true\">\u2191</span>\n } @else if (sorted === 'desc') {\n <span aria-hidden=\"true\">\u2193</span>\n } @else {\n <span aria-hidden=\"true\">\u2195</span>\n }\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>\n @for (column of table.getVisibleLeafColumns(); track column.id) {\n <td yuwTd><span yuwSkeleton class=\"block h-4 w-full\"></span></td>\n }\n </tr>\n }\n } @else if (_isEmpty()) {\n <tr yuwTr>\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 yuwTr [attr.data-state]=\"row.getIsSelected() ? 'selected' : null\">\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td yuwTd>\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 justify-between gap-4 py-3\">\n @if (selectable()) {\n <p class=\"text-sm text-muted-foreground\">\n {{ table.getSelectedRowModel().rows.length }} / {{ table.getFilteredRowModel().rows.length }}\n </p>\n } @else {\n <span></span>\n }\n\n <div class=\"flex items-center gap-2\">\n <yuw-button variant=\"ghost\" size=\"sm\" [disabled]=\"loading() || !table.getCanPreviousPage()\"\n [ariaLabel]=\"previousPageLabel()\" (clicked)=\"table.previousPage()\">\n <span aria-hidden=\"true\">←</span>\n </yuw-button>\n <span class=\"text-sm text-muted-foreground\">\n {{ pagination().pageIndex + 1 }} / {{ table.getPageCount() || 1 }}\n </span>\n <yuw-button variant=\"ghost\" size=\"sm\" [disabled]=\"loading() || !table.getCanNextPage()\"\n [ariaLabel]=\"nextPageLabel()\" (clicked)=\"table.nextPage()\">\n <span aria-hidden=\"true\">→</span>\n </yuw-button>\n </div>\n </div>\n}\n" }]
|
|
2307
|
+
}], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], paginated: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginated", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", 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 }] }], previousPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousPageLabel", required: true }] }], nextPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextPageLabel", required: true }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], tableClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableClass", required: false }] }], sorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "sorting", required: false }] }, { type: i0.Output, args: ["sortingChange"] }], columnFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilters", required: false }] }, { type: i0.Output, args: ["columnFiltersChange"] }], columnVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnVisibility", required: false }] }, { type: i0.Output, args: ["columnVisibilityChange"] }], rowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowSelection", required: false }] }, { type: i0.Output, args: ["rowSelectionChange"] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }, { type: i0.Output, args: ["paginationChange"] }], selectedRowsChange: [{ type: i0.Output, args: ["selectedRowsChange"] }] } });
|
|
2308
|
+
|
|
2309
|
+
/**
|
|
2310
|
+
* Displays a user or entity avatar with optional image, fallback text/initials, status badge, or overlapping group layout.
|
|
2311
|
+
*
|
|
2312
|
+
* Inputs:
|
|
2313
|
+
* - `size`: Avatar size (`'default'`, `'sm'`, `'lg'`). Default is `'default'`.
|
|
2314
|
+
* - `src`: Image URL for single-avatar mode. Omit to display fallback text.
|
|
2315
|
+
* - `alt`: Required. Accessible label for single-avatar mode and fallback text. User-facing text —
|
|
2316
|
+
* the consuming app is responsible for providing (and translating) it.
|
|
2317
|
+
* - `fallback`: Fallback text or initials shown when image is loading, unprovided, or fails to load.
|
|
2318
|
+
* - `badge`: Renders a status badge marker on the bottom-right corner (single-avatar mode).
|
|
2319
|
+
* - `group`: Array of item DTOs (`YuwAvatarGroupItemDto[]`) to render as an overlapping avatar group stack.
|
|
2320
|
+
* - `groupCount`: Overflow label string (e.g. `"+5"`) displayed at the end of an avatar group stack.
|
|
2321
|
+
* - `class`: Extra CSS classes merged onto the inner `hlm-avatar` element(s); merged last, so they win.
|
|
2322
|
+
*
|
|
2323
|
+
* Single Avatar Usage:
|
|
2324
|
+
* ```html
|
|
2325
|
+
* <yuw-avatar src="/path/to/user.png" alt="Jane Doe" fallback="JD" />
|
|
2326
|
+
* <yuw-avatar alt="Jane Doe" fallback="JD" badge />
|
|
2327
|
+
* ```
|
|
2328
|
+
*
|
|
2329
|
+
* Avatar Group Usage:
|
|
2330
|
+
* ```html
|
|
2331
|
+
* <yuw-avatar [group]="teamMembers" alt="Team" groupCount="+5" />
|
|
2332
|
+
* ```
|
|
2333
|
+
*/
|
|
2334
|
+
class YuwAvatarComponent {
|
|
2335
|
+
constructor() {
|
|
2336
|
+
this.size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2337
|
+
this.src = input(undefined, ...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
2338
|
+
this.alt = input.required(...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
|
|
2339
|
+
this.fallback = input(undefined, ...(ngDevMode ? [{ debugName: "fallback" }] : /* istanbul ignore next */ []));
|
|
2340
|
+
this.badge = input(false, { ...(ngDevMode ? { debugName: "badge" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2341
|
+
this.group = input(undefined, ...(ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []));
|
|
2342
|
+
this.groupCount = input(undefined, ...(ngDevMode ? [{ debugName: "groupCount" }] : /* istanbul ignore next */ []));
|
|
2343
|
+
this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2344
|
+
this._isGroup = computed(() => (this.group()?.length ?? 0) > 0, ...(ngDevMode ? [{ debugName: "_isGroup" }] : /* istanbul ignore next */ []));
|
|
2345
|
+
}
|
|
2346
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2347
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwAvatarComponent, isStandalone: true, selector: "yuw-avatar", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: true, transformFunction: null }, fallback: { classPropertyName: "fallback", publicName: "fallback", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: false, transformFunction: null }, groupCount: { classPropertyName: "groupCount", publicName: "groupCount", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "<ng-template #avatarBox let-src=\"src\" let-alt=\"alt\" let-fallback=\"fallback\" let-showBadge=\"showBadge\">\n <hlm-avatar [size]=\"size()\" [class]=\"userClass()\">\n @if (src) {\n <img hlmAvatarImage [src]=\"src\" [alt]=\"alt ?? ''\"/>\n }\n <span hlmAvatarFallback>{{ fallback }}</span>\n\n @if (showBadge) {\n <span hlmAvatarBadge>\n <ng-content select=\"[yuwAvatarBadgeIcon]\"/>\n </span>\n }\n </hlm-avatar>\n</ng-template>\n\n@if (_isGroup()) {\n <div hlmAvatarGroup>\n @for (entry of group(); track entry.alt + '|' + (entry.src ?? '')) {\n <ng-container [ngTemplateOutlet]=\"avatarBox\"\n [ngTemplateOutletContext]=\"{ src: entry.src, alt: entry.alt, fallback: entry.fallback, showBadge: false }\"/>\n }\n\n @if (groupCount()) {\n <span hlmAvatarGroupCount>{{ groupCount() }}</span>\n }\n </div>\n} @else {\n <ng-container [ngTemplateOutlet]=\"avatarBox\"\n [ngTemplateOutletContext]=\"{ src: src(), alt: alt(), fallback: fallback(), showBadge: badge() }\"/>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i1$d.HlmAvatar, selector: "hlm-avatar", inputs: ["size"] }, { kind: "directive", type: i1$d.HlmAvatarBadge, selector: "[hlmAvatarBadge],hlm-avatar-badge" }, { kind: "directive", type: i1$d.HlmAvatarFallback, selector: "[hlmAvatarFallback]", exportAs: ["hlmAvatarFallback"] }, { kind: "directive", type: i1$d.HlmAvatarGroup, selector: "[hlmAvatarGroup],hlm-avatar-group" }, { kind: "directive", type: i1$d.HlmAvatarGroupCount, selector: "[hlmAvatarGroupCount],hlm-avatar-group-count" }, { kind: "directive", type: i1$d.HlmAvatarImage, selector: "img[hlmAvatarImage]", exportAs: ["hlmAvatarImage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2348
|
+
}
|
|
2349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAvatarComponent, decorators: [{
|
|
2350
|
+
type: Component,
|
|
2351
|
+
args: [{ selector: 'yuw-avatar', imports: [NgTemplateOutlet, ...HlmAvatarImports], host: {
|
|
2352
|
+
class: 'contents',
|
|
2353
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #avatarBox let-src=\"src\" let-alt=\"alt\" let-fallback=\"fallback\" let-showBadge=\"showBadge\">\n <hlm-avatar [size]=\"size()\" [class]=\"userClass()\">\n @if (src) {\n <img hlmAvatarImage [src]=\"src\" [alt]=\"alt ?? ''\"/>\n }\n <span hlmAvatarFallback>{{ fallback }}</span>\n\n @if (showBadge) {\n <span hlmAvatarBadge>\n <ng-content select=\"[yuwAvatarBadgeIcon]\"/>\n </span>\n }\n </hlm-avatar>\n</ng-template>\n\n@if (_isGroup()) {\n <div hlmAvatarGroup>\n @for (entry of group(); track entry.alt + '|' + (entry.src ?? '')) {\n <ng-container [ngTemplateOutlet]=\"avatarBox\"\n [ngTemplateOutletContext]=\"{ src: entry.src, alt: entry.alt, fallback: entry.fallback, showBadge: false }\"/>\n }\n\n @if (groupCount()) {\n <span hlmAvatarGroupCount>{{ groupCount() }}</span>\n }\n </div>\n} @else {\n <ng-container [ngTemplateOutlet]=\"avatarBox\"\n [ngTemplateOutletContext]=\"{ src: src(), alt: alt(), fallback: fallback(), showBadge: badge() }\"/>\n}\n" }]
|
|
2354
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: true }] }], fallback: [{ type: i0.Input, args: [{ isSignal: true, alias: "fallback", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: false }] }], groupCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupCount", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2355
|
+
|
|
2356
|
+
/**
|
|
2357
|
+
* Container directive for list/row item layout structures.
|
|
2358
|
+
* Accepts optional `variant` and `size` inputs.
|
|
2359
|
+
*
|
|
2360
|
+
* Usage:
|
|
2361
|
+
* ```html
|
|
2362
|
+
* <div yuwItem>
|
|
2363
|
+
* <div yuwItemMedia><yuw-avatar fallback="JD" alt="John Doe" /></div>
|
|
2364
|
+
* <div yuwItemContent>
|
|
2365
|
+
* <h4 yuwItemTitle>John Doe</h4>
|
|
2366
|
+
* <p yuwItemDescription>Software Engineer</p>
|
|
2367
|
+
* </div>
|
|
2368
|
+
* <div yuwItemActions><yuw-button size="sm">Follow</yuw-button></div>
|
|
2369
|
+
* </div>
|
|
2370
|
+
* ```
|
|
2371
|
+
*/
|
|
2372
|
+
class YuwItemDirective {
|
|
2373
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2374
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwItemDirective, isStandalone: true, selector: "[yuwItem], yuw-item", hostDirectives: [{ directive: i1$e.HlmItem, inputs: ["variant", "variant", "size", "size"] }], ngImport: i0 }); }
|
|
2375
|
+
}
|
|
2376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemDirective, decorators: [{
|
|
2377
|
+
type: Directive,
|
|
2378
|
+
args: [{
|
|
2379
|
+
selector: '[yuwItem], yuw-item',
|
|
2380
|
+
hostDirectives: [{ directive: HlmItem, inputs: ['variant', 'size'] }],
|
|
2381
|
+
}]
|
|
2382
|
+
}] });
|
|
2383
|
+
/** Header slot directive for an item container. */
|
|
2384
|
+
class YuwItemHeaderDirective {
|
|
2385
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2386
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwItemHeaderDirective, isStandalone: true, selector: "[yuwItemHeader], yuw-item-header", hostDirectives: [{ directive: i1$e.HlmItemHeader }], ngImport: i0 }); }
|
|
2387
|
+
}
|
|
2388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemHeaderDirective, decorators: [{
|
|
2389
|
+
type: Directive,
|
|
2390
|
+
args: [{
|
|
2391
|
+
selector: '[yuwItemHeader], yuw-item-header',
|
|
2392
|
+
hostDirectives: [HlmItemHeader],
|
|
2393
|
+
}]
|
|
2394
|
+
}] });
|
|
2395
|
+
/** Leading media slot directive (for icons, avatars, or images) at the start of an item. Supports `variant` (`'default'`, `'icon'`, `'image'`). */
|
|
2396
|
+
class YuwItemMediaDirective {
|
|
2397
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemMediaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2398
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwItemMediaDirective, isStandalone: true, selector: "[yuwItemMedia], yuw-item-media", hostDirectives: [{ directive: i1$e.HlmItemMedia, inputs: ["variant", "variant"] }], ngImport: i0 }); }
|
|
2399
|
+
}
|
|
2400
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemMediaDirective, decorators: [{
|
|
2401
|
+
type: Directive,
|
|
2402
|
+
args: [{
|
|
2403
|
+
selector: '[yuwItemMedia], yuw-item-media',
|
|
2404
|
+
hostDirectives: [{ directive: HlmItemMedia, inputs: ['variant'] }],
|
|
2405
|
+
}]
|
|
2406
|
+
}] });
|
|
2407
|
+
/** Main text content container directive for an item. */
|
|
2408
|
+
class YuwItemContentDirective {
|
|
2409
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2410
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwItemContentDirective, isStandalone: true, selector: "[yuwItemContent], yuw-item-content", hostDirectives: [{ directive: i1$e.HlmItemContent }], ngImport: i0 }); }
|
|
2411
|
+
}
|
|
2412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemContentDirective, decorators: [{
|
|
2413
|
+
type: Directive,
|
|
2414
|
+
args: [{
|
|
2415
|
+
selector: '[yuwItemContent], yuw-item-content',
|
|
2416
|
+
hostDirectives: [HlmItemContent],
|
|
2417
|
+
}]
|
|
2418
|
+
}] });
|
|
2419
|
+
/** Title heading directive for an item. */
|
|
2420
|
+
class YuwItemTitleDirective {
|
|
2421
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2422
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwItemTitleDirective, isStandalone: true, selector: "[yuwItemTitle], yuw-item-title", hostDirectives: [{ directive: i1$e.HlmItemTitle }], ngImport: i0 }); }
|
|
2423
|
+
}
|
|
2424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemTitleDirective, decorators: [{
|
|
2425
|
+
type: Directive,
|
|
2426
|
+
args: [{
|
|
2427
|
+
selector: '[yuwItemTitle], yuw-item-title',
|
|
2428
|
+
hostDirectives: [HlmItemTitle],
|
|
2429
|
+
}]
|
|
2430
|
+
}] });
|
|
2431
|
+
/** Subtitle or description paragraph directive for an item. */
|
|
2432
|
+
class YuwItemDescriptionDirective {
|
|
2433
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2434
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwItemDescriptionDirective, isStandalone: true, selector: "[yuwItemDescription], yuw-item-description", hostDirectives: [{ directive: i1$e.HlmItemDescription }], ngImport: i0 }); }
|
|
2435
|
+
}
|
|
2436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemDescriptionDirective, decorators: [{
|
|
2437
|
+
type: Directive,
|
|
2438
|
+
args: [{
|
|
2439
|
+
selector: '[yuwItemDescription], yuw-item-description',
|
|
2440
|
+
hostDirectives: [HlmItemDescription],
|
|
2441
|
+
}]
|
|
2442
|
+
}] });
|
|
2443
|
+
/** Trailing action controls slot directive (for buttons, switches, or menu triggers) at the end of an item. */
|
|
2444
|
+
class YuwItemActionsDirective {
|
|
2445
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2446
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwItemActionsDirective, isStandalone: true, selector: "[yuwItemActions], yuw-item-actions", hostDirectives: [{ directive: i1$e.HlmItemActions }], ngImport: i0 }); }
|
|
2447
|
+
}
|
|
2448
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemActionsDirective, decorators: [{
|
|
2449
|
+
type: Directive,
|
|
2450
|
+
args: [{
|
|
2451
|
+
selector: '[yuwItemActions], yuw-item-actions',
|
|
2452
|
+
hostDirectives: [HlmItemActions],
|
|
2453
|
+
}]
|
|
2454
|
+
}] });
|
|
2455
|
+
/** Footer slot directive for an item. */
|
|
2456
|
+
class YuwItemFooterDirective {
|
|
2457
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2458
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwItemFooterDirective, isStandalone: true, selector: "[yuwItemFooter], yuw-item-footer", hostDirectives: [{ directive: i1$e.HlmItemFooter }], ngImport: i0 }); }
|
|
2459
|
+
}
|
|
2460
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemFooterDirective, decorators: [{
|
|
2461
|
+
type: Directive,
|
|
2462
|
+
args: [{
|
|
2463
|
+
selector: '[yuwItemFooter], yuw-item-footer',
|
|
2464
|
+
hostDirectives: [HlmItemFooter],
|
|
2465
|
+
}]
|
|
2466
|
+
}] });
|
|
2467
|
+
/** Container directive for grouping multiple item rows together into a list card or bordered group. */
|
|
2468
|
+
class YuwItemGroupDirective {
|
|
2469
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2470
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwItemGroupDirective, isStandalone: true, selector: "[yuwItemGroup], yuw-item-group", hostDirectives: [{ directive: i1$e.HlmItemGroup }], ngImport: i0 }); }
|
|
2471
|
+
}
|
|
2472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemGroupDirective, decorators: [{
|
|
2473
|
+
type: Directive,
|
|
2474
|
+
args: [{
|
|
2475
|
+
selector: '[yuwItemGroup], yuw-item-group',
|
|
2476
|
+
hostDirectives: [HlmItemGroup],
|
|
2477
|
+
}]
|
|
2478
|
+
}] });
|
|
2479
|
+
/**
|
|
2480
|
+
* Visual separator line between items inside a group. Accepts `orientation` (`'horizontal'` or
|
|
2481
|
+
* `'vertical'`), reaching the underlying `BrnSeparator`, which owns the `role`,
|
|
2482
|
+
* `aria-orientation` and `data-orientation` attributes. Extends `HlmItemSeparator` (instead of
|
|
2483
|
+
* composing it via `hostDirectives`) because `orientation` is re-exposed by the helm from
|
|
2484
|
+
* `BrnSeparator` through its own `hostDirectives`, and host-directive forwarding is not
|
|
2485
|
+
* transitive (NG2017).
|
|
2486
|
+
*/
|
|
2487
|
+
class YuwItemSeparatorDirective extends HlmItemSeparator {
|
|
2488
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemSeparatorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2489
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwItemSeparatorDirective, isStandalone: true, selector: "[yuwItemSeparator], yuw-item-separator", usesInheritance: true, ngImport: i0 }); }
|
|
2490
|
+
}
|
|
2491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwItemSeparatorDirective, decorators: [{
|
|
2492
|
+
type: Directive,
|
|
2493
|
+
args: [{
|
|
2494
|
+
selector: '[yuwItemSeparator], yuw-item-separator',
|
|
2495
|
+
}]
|
|
2496
|
+
}] });
|
|
2497
|
+
/** Every item part, for a consumer's `imports`. */
|
|
2498
|
+
const YuwItemImports = [
|
|
2499
|
+
YuwItemDirective,
|
|
2500
|
+
YuwItemHeaderDirective,
|
|
2501
|
+
YuwItemMediaDirective,
|
|
2502
|
+
YuwItemContentDirective,
|
|
2503
|
+
YuwItemTitleDirective,
|
|
2504
|
+
YuwItemDescriptionDirective,
|
|
2505
|
+
YuwItemActionsDirective,
|
|
2506
|
+
YuwItemFooterDirective,
|
|
2507
|
+
YuwItemGroupDirective,
|
|
2508
|
+
YuwItemSeparatorDirective,
|
|
2509
|
+
];
|
|
2510
|
+
|
|
2511
|
+
/**
|
|
2512
|
+
* Marks an element as the sheet's footer content, projected into the footer slot.
|
|
2513
|
+
* Its presence is also what makes the footer render at all — without it the sheet
|
|
2514
|
+
* shows no empty footer strip.
|
|
2515
|
+
*/
|
|
2516
|
+
class YuwSheetFooterDirective {
|
|
2517
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSheetFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2518
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSheetFooterDirective, isStandalone: true, selector: "[yuwSheetFooter]", ngImport: i0 }); }
|
|
2519
|
+
}
|
|
2520
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSheetFooterDirective, decorators: [{
|
|
2521
|
+
type: Directive,
|
|
2522
|
+
args: [{
|
|
2523
|
+
selector: '[yuwSheetFooter]',
|
|
2524
|
+
}]
|
|
2525
|
+
}] });
|
|
2526
|
+
|
|
2527
|
+
/**
|
|
2528
|
+
* Slide-in sheet overlay panel component for side drawers, dialogs, and detail views.
|
|
2529
|
+
*
|
|
2530
|
+
* Accessibility: provide either `title` or `ariaLabel` — a modal panel without an accessible name
|
|
2531
|
+
* is announced as an anonymous dialog by screen readers.
|
|
2532
|
+
*
|
|
2533
|
+
* Inputs / Models:
|
|
2534
|
+
* - `open`: Two-way open/closed state (`boolean`). Drive directly via `[(open)]` to open/close programmatically.
|
|
2535
|
+
* - `showTrigger`: Whether to render the trigger button. Set `false` when opening only via `[(open)]`.
|
|
2536
|
+
* - `side`: Edge of the screen the panel slides in from (`'top'`, `'bottom'`, `'left'`, `'right'`). Default is `'right'`.
|
|
2537
|
+
* - `title`: Optional header title text. User-facing text the consuming app is responsible for translating.
|
|
2538
|
+
* - `description`: Optional header description text. User-facing text the consuming app is responsible for translating.
|
|
2539
|
+
* - `ariaLabel`: Accessible name for the sheet when no visible `title` is rendered. User-facing
|
|
2540
|
+
* text the consuming app is responsible for translating.
|
|
2541
|
+
* - `closeLabel`: Accessible label of the corner close (×) button. When set, the close button
|
|
2542
|
+
* renders and screen readers read this label; when absent there is no close button. User-facing
|
|
2543
|
+
* text the consuming app is responsible for translating.
|
|
2544
|
+
* - `panelClass`: Extra classes merged onto the sheet panel (e.g. `sm:max-w-lg` to widen it).
|
|
2545
|
+
* They win over the library defaults via `twMerge`.
|
|
2546
|
+
* - `triggerVariant`: Button style variant for the trigger button.
|
|
2547
|
+
* - `triggerSize`: Button size for the trigger button.
|
|
2548
|
+
*
|
|
2549
|
+
* Usage:
|
|
2550
|
+
* ```html
|
|
2551
|
+
* <yuw-sheet [(open)]="isOpen" side="right" title="Edit Profile" description="Update your account details." closeLabel="Close">
|
|
2552
|
+
* <ng-container yuwSheetTrigger>Edit Profile</ng-container>
|
|
2553
|
+
*
|
|
2554
|
+
* <p>Sheet form content goes here.</p>
|
|
2555
|
+
*
|
|
2556
|
+
* <div yuwSheetFooter>
|
|
2557
|
+
* <yuw-button (clicked)="save()">Save Changes</yuw-button>
|
|
2558
|
+
* </div>
|
|
2559
|
+
* </yuw-sheet>
|
|
2560
|
+
* ```
|
|
2561
|
+
*/
|
|
2562
|
+
class YuwSheetComponent {
|
|
2563
|
+
constructor() {
|
|
2564
|
+
this.open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
2565
|
+
this.showTrigger = input(true, { ...(ngDevMode ? { debugName: "showTrigger" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2566
|
+
this.side = input('right', ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
2567
|
+
this.title = input(undefined, ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2568
|
+
this.description = input(undefined, ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
2569
|
+
this.ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
2570
|
+
this.closeLabel = input(undefined, ...(ngDevMode ? [{ debugName: "closeLabel" }] : /* istanbul ignore next */ []));
|
|
2571
|
+
this.panelClass = input(undefined, ...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
|
|
2572
|
+
this.triggerVariant = input('outline', ...(ngDevMode ? [{ debugName: "triggerVariant" }] : /* istanbul ignore next */ []));
|
|
2573
|
+
this.triggerSize = input('default', ...(ngDevMode ? [{ debugName: "triggerSize" }] : /* istanbul ignore next */ []));
|
|
2574
|
+
this.hasFooter = contentChild(YuwSheetFooterDirective, ...(ngDevMode ? [{ debugName: "hasFooter" }] : /* istanbul ignore next */ []));
|
|
2575
|
+
this._sheetState = computed(() => (this.open() ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "_sheetState" }] : /* istanbul ignore next */ []));
|
|
2576
|
+
}
|
|
2577
|
+
onStateChanged(state) {
|
|
2578
|
+
this.open.set(state === 'open');
|
|
2579
|
+
}
|
|
2580
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2581
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwSheetComponent, isStandalone: true, selector: "yuw-sheet", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, showTrigger: { classPropertyName: "showTrigger", publicName: "showTrigger", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, triggerVariant: { classPropertyName: "triggerVariant", publicName: "triggerVariant", isSignal: true, isRequired: false, transformFunction: null }, triggerSize: { classPropertyName: "triggerSize", publicName: "triggerSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { classAttribute: "contents" }, providers: [provideIcons({ lucideX })], queries: [{ propertyName: "hasFooter", first: true, predicate: YuwSheetFooterDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<hlm-sheet [side]=\"side()\" [state]=\"_sheetState()\" [aria-label]=\"ariaLabel()\" (stateChanged)=\"onStateChanged($event)\">\n @if (showTrigger()) {\n <button hlmSheetTrigger hlmBtn [variant]=\"triggerVariant()\" [size]=\"triggerSize()\">\n <ng-content select=\"[yuwSheetTrigger]\"/>\n </button>\n }\n\n <hlm-sheet-content *hlmSheetPortal [showCloseButton]=\"false\" [class]=\"panelClass()\">\n @if (title() || description()) {\n <div hlmSheetHeader>\n @if (title()) {\n <h2 hlmSheetTitle>{{ title() }}</h2>\n }\n @if (description()) {\n <p hlmSheetDescription>{{ description() }}</p>\n }\n </div>\n }\n\n <div class=\"flex-1 overflow-y-auto px-4\">\n <ng-content/>\n </div>\n\n @if (hasFooter()) {\n <div hlmSheetFooter>\n <ng-content select=\"[yuwSheetFooter]\"/>\n </div>\n }\n\n @if (closeLabel()) {\n <button hlmBtn variant=\"ghost\" size=\"icon-sm\" class=\"absolute inset-e-3 top-3\" hlmSheetClose>\n <ng-icon name=\"lucideX\"/>\n <span class=\"sr-only\">{{ closeLabel() }}</span>\n </button>\n }\n </hlm-sheet-content>\n</hlm-sheet>\n", dependencies: [{ kind: "component", type: i1$f.HlmSheet, selector: "hlm-sheet", exportAs: ["hlmSheet"] }, { kind: "directive", type: i1$f.HlmSheetClose, selector: "button[hlmSheetClose]" }, { kind: "component", type: i1$f.HlmSheetContent, selector: "hlm-sheet-content", inputs: ["showCloseButton"] }, { kind: "directive", type: i1$f.HlmSheetDescription, selector: "[hlmSheetDescription]" }, { kind: "directive", type: i1$f.HlmSheetFooter, selector: "[hlmSheetFooter],hlm-sheet-footer" }, { kind: "directive", type: i1$f.HlmSheetHeader, selector: "[hlmSheetHeader],hlm-sheet-header" }, { kind: "directive", type: i1$f.HlmSheetPortal, selector: "[hlmSheetPortal]" }, { kind: "directive", type: i1$f.HlmSheetTitle, selector: "[hlmSheetTitle]" }, { kind: "directive", type: i1$f.HlmSheetTrigger, selector: "button[hlmSheetTrigger]" }, { kind: "directive", type: HlmButton, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size"], exportAs: ["hlmBtn"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2582
|
+
}
|
|
2583
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSheetComponent, decorators: [{
|
|
2584
|
+
type: Component,
|
|
2585
|
+
args: [{ selector: 'yuw-sheet', imports: [...HlmSheetImports, HlmButton, NgIcon], providers: [provideIcons({ lucideX })], host: {
|
|
2586
|
+
class: 'contents',
|
|
2587
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-sheet [side]=\"side()\" [state]=\"_sheetState()\" [aria-label]=\"ariaLabel()\" (stateChanged)=\"onStateChanged($event)\">\n @if (showTrigger()) {\n <button hlmSheetTrigger hlmBtn [variant]=\"triggerVariant()\" [size]=\"triggerSize()\">\n <ng-content select=\"[yuwSheetTrigger]\"/>\n </button>\n }\n\n <hlm-sheet-content *hlmSheetPortal [showCloseButton]=\"false\" [class]=\"panelClass()\">\n @if (title() || description()) {\n <div hlmSheetHeader>\n @if (title()) {\n <h2 hlmSheetTitle>{{ title() }}</h2>\n }\n @if (description()) {\n <p hlmSheetDescription>{{ description() }}</p>\n }\n </div>\n }\n\n <div class=\"flex-1 overflow-y-auto px-4\">\n <ng-content/>\n </div>\n\n @if (hasFooter()) {\n <div hlmSheetFooter>\n <ng-content select=\"[yuwSheetFooter]\"/>\n </div>\n }\n\n @if (closeLabel()) {\n <button hlmBtn variant=\"ghost\" size=\"icon-sm\" class=\"absolute inset-e-3 top-3\" hlmSheetClose>\n <ng-icon name=\"lucideX\"/>\n <span class=\"sr-only\">{{ closeLabel() }}</span>\n </button>\n }\n </hlm-sheet-content>\n</hlm-sheet>\n" }]
|
|
2588
|
+
}], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], showTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTrigger", required: false }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], triggerVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerVariant", required: false }] }], triggerSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerSize", required: false }] }], hasFooter: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwSheetFooterDirective), { isSignal: true }] }] } });
|
|
2589
|
+
const YuwSheetImports = [YuwSheetComponent, YuwSheetFooterDirective];
|
|
2590
|
+
|
|
2591
|
+
/**
|
|
2592
|
+
* Popover component for displaying anchored floating overlay panels.
|
|
2593
|
+
*
|
|
2594
|
+
* Inputs / Models:
|
|
2595
|
+
* - `open`: Two-way open/closed state (`boolean`). Drive directly via `[(open)]` to open/close programmatically.
|
|
2596
|
+
* - `showTrigger`: Whether to render the trigger button. Set `false` when opening only via `[(open)]`.
|
|
2597
|
+
* - `align`: Panel alignment relative to trigger (`'start'`, `'center'`, `'end'`). Default is `'center'`.
|
|
2598
|
+
* - `sideOffset`: Pixel offset between the trigger and the panel. Default is `4`.
|
|
2599
|
+
* - `title`: Optional header title text. User-facing text the consuming app is responsible for translating.
|
|
2600
|
+
* - `description`: Optional header description text. User-facing text the consuming app is responsible for translating.
|
|
2601
|
+
* - `panelClass`: Extra classes merged onto the popover panel (e.g. `w-80` to widen it). They win
|
|
2602
|
+
* over the library defaults via `twMerge`.
|
|
2603
|
+
* - `triggerVariant`: Button style variant for the trigger button.
|
|
2604
|
+
* - `triggerSize`: Button size for the trigger button.
|
|
2605
|
+
*
|
|
2606
|
+
* Usage:
|
|
2607
|
+
* ```html
|
|
2608
|
+
* <yuw-popover [(open)]="isOpen" title="Notifications" description="You're all caught up.">
|
|
2609
|
+
* <ng-container yuwPopoverTrigger>View Notifications</ng-container>
|
|
2610
|
+
*
|
|
2611
|
+
* <p>Popover content body goes here.</p>
|
|
2612
|
+
* </yuw-popover>
|
|
2613
|
+
* ```
|
|
2614
|
+
*/
|
|
2615
|
+
class YuwPopoverComponent {
|
|
2616
|
+
constructor() {
|
|
2617
|
+
this.open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
2618
|
+
this.showTrigger = input(true, { ...(ngDevMode ? { debugName: "showTrigger" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2619
|
+
this.align = input('center', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
2620
|
+
this.sideOffset = input(4, ...(ngDevMode ? [{ debugName: "sideOffset" }] : /* istanbul ignore next */ []));
|
|
2621
|
+
this.title = input(undefined, ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2622
|
+
this.description = input(undefined, ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
2623
|
+
this.panelClass = input(undefined, ...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
|
|
2624
|
+
this.triggerVariant = input('outline', ...(ngDevMode ? [{ debugName: "triggerVariant" }] : /* istanbul ignore next */ []));
|
|
2625
|
+
this.triggerSize = input('default', ...(ngDevMode ? [{ debugName: "triggerSize" }] : /* istanbul ignore next */ []));
|
|
2626
|
+
this._popoverState = computed(() => (this.open() ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "_popoverState" }] : /* istanbul ignore next */ []));
|
|
2627
|
+
}
|
|
2628
|
+
onOpenChange(state) {
|
|
2629
|
+
this.open.set(state === 'open');
|
|
2630
|
+
}
|
|
2631
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2632
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwPopoverComponent, isStandalone: true, selector: "yuw-popover", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, showTrigger: { classPropertyName: "showTrigger", publicName: "showTrigger", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, triggerVariant: { classPropertyName: "triggerVariant", publicName: "triggerVariant", isSignal: true, isRequired: false, transformFunction: null }, triggerSize: { classPropertyName: "triggerSize", publicName: "triggerSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div hlmPopover [state]=\"_popoverState()\" [align]=\"align()\" [sideOffset]=\"sideOffset()\"\n (stateChanged)=\"onOpenChange($event)\">\n @if (showTrigger()) {\n <button hlmBtn hlmPopoverTrigger [variant]=\"triggerVariant()\" [size]=\"triggerSize()\">\n <ng-content select=\"[yuwPopoverTrigger]\"/>\n </button>\n }\n\n <hlm-popover-content *hlmPopoverPortal [class]=\"panelClass()\">\n @if (title() || description()) {\n <div hlmPopoverHeader>\n @if (title()) {\n <p hlmPopoverTitle>{{ title() }}</p>\n }\n @if (description()) {\n <p hlmPopoverDescription>{{ description() }}</p>\n }\n </div>\n }\n\n <ng-content/>\n </hlm-popover-content>\n</div>\n", dependencies: [{ kind: "directive", type: i1$g.HlmPopover, selector: "[hlmPopover],hlm-popover" }, { kind: "directive", type: i1$g.HlmPopoverContent, selector: "[hlmPopoverContent],hlm-popover-content" }, { kind: "directive", type: i1$g.HlmPopoverDescription, selector: "[hlmPopoverDescription]" }, { kind: "directive", type: i1$g.HlmPopoverHeader, selector: "[hlmPopoverHeader],hlm-popover-header" }, { kind: "directive", type: i1$g.HlmPopoverPortal, selector: "[hlmPopoverPortal]" }, { kind: "directive", type: i1$g.HlmPopoverTitle, selector: "[hlmPopoverTitle]" }, { kind: "directive", type: i1$g.HlmPopoverTrigger, selector: "button[hlmPopoverTrigger],button[hlmPopoverTriggerFor]" }, { kind: "directive", type: HlmButton, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size"], exportAs: ["hlmBtn"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2633
|
+
}
|
|
2634
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwPopoverComponent, decorators: [{
|
|
2635
|
+
type: Component,
|
|
2636
|
+
args: [{ selector: 'yuw-popover', imports: [...HlmPopoverImports, HlmButton], host: {
|
|
2637
|
+
class: 'contents',
|
|
2638
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div hlmPopover [state]=\"_popoverState()\" [align]=\"align()\" [sideOffset]=\"sideOffset()\"\n (stateChanged)=\"onOpenChange($event)\">\n @if (showTrigger()) {\n <button hlmBtn hlmPopoverTrigger [variant]=\"triggerVariant()\" [size]=\"triggerSize()\">\n <ng-content select=\"[yuwPopoverTrigger]\"/>\n </button>\n }\n\n <hlm-popover-content *hlmPopoverPortal [class]=\"panelClass()\">\n @if (title() || description()) {\n <div hlmPopoverHeader>\n @if (title()) {\n <p hlmPopoverTitle>{{ title() }}</p>\n }\n @if (description()) {\n <p hlmPopoverDescription>{{ description() }}</p>\n }\n </div>\n }\n\n <ng-content/>\n </hlm-popover-content>\n</div>\n" }]
|
|
2639
|
+
}], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], showTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTrigger", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], sideOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "sideOffset", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], triggerVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerVariant", required: false }] }], triggerSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerSize", required: false }] }] } });
|
|
2640
|
+
|
|
2641
|
+
/**
|
|
2642
|
+
* Tooltip directive applied directly to the element that should show a hint on hover/focus.
|
|
2643
|
+
*
|
|
2644
|
+
* Inputs:
|
|
2645
|
+
* - `yuwTooltip`: Tooltip text (or `TemplateRef`) to display. User-facing text the consuming app
|
|
2646
|
+
* is responsible for translating.
|
|
2647
|
+
* - `position`: Side the tooltip opens on (`'top'`, `'bottom'`, `'left'`, `'right'`). Default is `'top'`.
|
|
2648
|
+
* - `showDelay`: Milliseconds before the tooltip opens on hover. Defaults to the Brain tooltip
|
|
2649
|
+
* config default (`150`).
|
|
2650
|
+
* - `hideDelay`: Milliseconds before the tooltip closes after the pointer leaves. Defaults to the
|
|
2651
|
+
* Brain tooltip config default (`100`).
|
|
2652
|
+
* - `tooltipDisabled`: Disables the tooltip entirely.
|
|
2653
|
+
*
|
|
2654
|
+
* Usage:
|
|
2655
|
+
* ```html
|
|
2656
|
+
* <button yuwTooltip="Save changes" hlmBtn>Save</button>
|
|
2657
|
+
* <yuw-button [yuwTooltip]="helpText" position="right">Help</yuw-button>
|
|
2658
|
+
* ```
|
|
2659
|
+
*/
|
|
2660
|
+
class YuwTooltipDirective {
|
|
2661
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2662
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwTooltipDirective, isStandalone: true, selector: "[yuwTooltip]", providers: [
|
|
2663
|
+
provideBrnTooltipDefaultOptions({
|
|
2664
|
+
svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
|
|
2665
|
+
tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
|
|
2666
|
+
arrowClasses: (position) => hlm(tooltipPositionVariants({ position })),
|
|
2667
|
+
}),
|
|
2668
|
+
], hostDirectives: [{ directive: i1$h.BrnTooltip, inputs: ["brnTooltip", "yuwTooltip", "position", "position", "hideDelay", "hideDelay", "showDelay", "showDelay", "tooltipDisabled", "tooltipDisabled"] }], ngImport: i0 }); }
|
|
2669
|
+
}
|
|
2670
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTooltipDirective, decorators: [{
|
|
2671
|
+
type: Directive,
|
|
2672
|
+
args: [{
|
|
2673
|
+
selector: '[yuwTooltip]',
|
|
2674
|
+
providers: [
|
|
2675
|
+
provideBrnTooltipDefaultOptions({
|
|
2676
|
+
svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
|
|
2677
|
+
tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
|
|
2678
|
+
arrowClasses: (position) => hlm(tooltipPositionVariants({ position })),
|
|
2679
|
+
}),
|
|
2680
|
+
],
|
|
2681
|
+
hostDirectives: [
|
|
2682
|
+
{
|
|
2683
|
+
directive: BrnTooltip,
|
|
2684
|
+
inputs: ['brnTooltip: yuwTooltip', 'position', 'hideDelay', 'showDelay', 'tooltipDisabled'],
|
|
2685
|
+
},
|
|
2686
|
+
],
|
|
2687
|
+
}]
|
|
2688
|
+
}] });
|
|
2689
|
+
|
|
2690
|
+
/**
|
|
2691
|
+
* Indeterminate loading spinner.
|
|
2692
|
+
*
|
|
2693
|
+
* Inputs:
|
|
2694
|
+
* - `label`: Accessible label announced by screen readers. User-facing text the consuming app is
|
|
2695
|
+
* responsible for translating.
|
|
2696
|
+
* - `icon`: Name of a registered icon to spin instead of the default loader.
|
|
2697
|
+
*
|
|
2698
|
+
* Usage:
|
|
2699
|
+
* ```html
|
|
2700
|
+
* <yuw-spinner label="Cargando" />
|
|
2701
|
+
* ```
|
|
2702
|
+
*/
|
|
2703
|
+
class YuwSpinnerComponent {
|
|
2704
|
+
constructor() {
|
|
2705
|
+
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2706
|
+
this.icon = input('lucideLoader2', ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2707
|
+
}
|
|
2708
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2709
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: YuwSpinnerComponent, isStandalone: true, selector: "yuw-spinner", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "<hlm-spinner [icon]=\"icon()\" [aria-label]=\"label()\"/>\n", dependencies: [{ kind: "component", type: HlmSpinner, selector: "hlm-spinner", inputs: ["icon", "aria-label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2710
|
+
}
|
|
2711
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSpinnerComponent, decorators: [{
|
|
2712
|
+
type: Component,
|
|
2713
|
+
args: [{ selector: 'yuw-spinner', imports: [HlmSpinner], host: {
|
|
2714
|
+
class: 'contents',
|
|
2715
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-spinner [icon]=\"icon()\" [aria-label]=\"label()\"/>\n" }]
|
|
2716
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }] } });
|
|
2717
|
+
|
|
2718
|
+
/**
|
|
2719
|
+
* Global toast host. Mount once near the application root; individual toasts are dispatched
|
|
2720
|
+
* through the `toast` API from `@spartan-ng/brain/sonner`.
|
|
2721
|
+
*
|
|
2722
|
+
* Inputs:
|
|
2723
|
+
* - `richColors`: Enables per-type colored toasts (success, error, warning, info). Enabled by
|
|
2724
|
+
* default — a deliberate deviation from the spartan default (`false`).
|
|
2725
|
+
* - `theme`: Toast color theme (`'light'`, `'dark'`, `'system'`). Default is `'light'` (the helm
|
|
2726
|
+
* default) — apps rendering in dark mode must pass `'dark'` (or `'system'`) explicitly.
|
|
2727
|
+
* - `toastOptions`: Default options applied to every toast (classes, styles, etc.), passed
|
|
2728
|
+
* through to the underlying sonner toaster.
|
|
2729
|
+
* - `position`: Screen corner the stack renders in. Default is `'bottom-right'`.
|
|
2730
|
+
* - `duration`: Milliseconds a toast stays visible. Default is `4000`.
|
|
2731
|
+
* - `visibleToasts`: Maximum simultaneously visible toasts. Default is `3`.
|
|
2732
|
+
* - `closeButton`: Renders a dismiss button on each toast.
|
|
2733
|
+
* - `expand`: Keeps the stack expanded instead of collapsed.
|
|
2734
|
+
*
|
|
2735
|
+
* Usage:
|
|
2736
|
+
* ```html
|
|
2737
|
+
* <yuw-toaster />
|
|
2738
|
+
* ```
|
|
2739
|
+
*/
|
|
2740
|
+
class YuwToasterComponent {
|
|
2741
|
+
constructor() {
|
|
2742
|
+
this.richColors = input(true, { ...(ngDevMode ? { debugName: "richColors" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2743
|
+
this.theme = input('light', ...(ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []));
|
|
2744
|
+
this.toastOptions = input({}, ...(ngDevMode ? [{ debugName: "toastOptions" }] : /* istanbul ignore next */ []));
|
|
2745
|
+
this.position = input('bottom-right', ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
2746
|
+
this.duration = input(4000, { ...(ngDevMode ? { debugName: "duration" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
2747
|
+
this.visibleToasts = input(3, { ...(ngDevMode ? { debugName: "visibleToasts" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
2748
|
+
this.closeButton = input(false, { ...(ngDevMode ? { debugName: "closeButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2749
|
+
this.expand = input(false, { ...(ngDevMode ? { debugName: "expand" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2750
|
+
}
|
|
2751
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwToasterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2752
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: YuwToasterComponent, isStandalone: true, selector: "yuw-toaster", inputs: { richColors: { classPropertyName: "richColors", publicName: "richColors", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, toastOptions: { classPropertyName: "toastOptions", publicName: "toastOptions", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null }, visibleToasts: { classPropertyName: "visibleToasts", publicName: "visibleToasts", isSignal: true, isRequired: false, transformFunction: null }, closeButton: { classPropertyName: "closeButton", publicName: "closeButton", isSignal: true, isRequired: false, transformFunction: null }, expand: { classPropertyName: "expand", publicName: "expand", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "<hlm-toaster\n [richColors]=\"richColors()\"\n [theme]=\"theme()\"\n [toastOptions]=\"toastOptions()\"\n [position]=\"position()\"\n [duration]=\"duration()\"\n [visibleToasts]=\"visibleToasts()\"\n [closeButton]=\"closeButton()\"\n [expand]=\"expand()\"/>\n", dependencies: [{ kind: "component", type: HlmToaster, selector: "hlm-toaster", inputs: ["invert", "theme", "position", "hotKey", "richColors", "expand", "duration", "visibleToasts", "closeButton", "toastOptions", "offset", "class", "style"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2753
|
+
}
|
|
2754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwToasterComponent, decorators: [{
|
|
2755
|
+
type: Component,
|
|
2756
|
+
args: [{ selector: 'yuw-toaster', imports: [HlmToaster], host: {
|
|
2757
|
+
class: 'contents',
|
|
2758
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-toaster\n [richColors]=\"richColors()\"\n [theme]=\"theme()\"\n [toastOptions]=\"toastOptions()\"\n [position]=\"position()\"\n [duration]=\"duration()\"\n [visibleToasts]=\"visibleToasts()\"\n [closeButton]=\"closeButton()\"\n [expand]=\"expand()\"/>\n" }]
|
|
2759
|
+
}], propDecorators: { richColors: [{ type: i0.Input, args: [{ isSignal: true, alias: "richColors", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], toastOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastOptions", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], duration: [{ type: i0.Input, args: [{ isSignal: true, alias: "duration", required: false }] }], visibleToasts: [{ type: i0.Input, args: [{ isSignal: true, alias: "visibleToasts", required: false }] }], closeButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeButton", required: false }] }], expand: [{ type: i0.Input, args: [{ isSignal: true, alias: "expand", required: false }] }] } });
|
|
2760
|
+
|
|
2761
|
+
/**
|
|
2762
|
+
* Marks a projected element as the trailing action of a `<yuw-alert>`, which pins it to the
|
|
2763
|
+
* top-right corner of the alert.
|
|
2764
|
+
*/
|
|
2765
|
+
class YuwAlertActionDirective {
|
|
2766
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertActionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2767
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAlertActionDirective, isStandalone: true, selector: "[yuwAlertAction]", ngImport: i0 }); }
|
|
2768
|
+
}
|
|
2769
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertActionDirective, decorators: [{
|
|
2770
|
+
type: Directive,
|
|
2771
|
+
args: [{
|
|
2772
|
+
selector: '[yuwAlertAction]',
|
|
2773
|
+
}]
|
|
2774
|
+
}] });
|
|
2775
|
+
|
|
2776
|
+
/**
|
|
2777
|
+
* Marks projected rich content (links, `<strong>`, …) as the description of a `<yuw-alert>`.
|
|
2778
|
+
*
|
|
2779
|
+
* When present, the alert projects this content into its description slot instead of rendering
|
|
2780
|
+
* the `description` string input. The content lands inside the element carrying the helm
|
|
2781
|
+
* `alert-description` data-slot, so the alert's grid keeps positioning it correctly.
|
|
2782
|
+
*/
|
|
2783
|
+
class YuwAlertDescriptionDirective {
|
|
2784
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2785
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAlertDescriptionDirective, isStandalone: true, selector: "[yuwAlertDescription]", ngImport: i0 }); }
|
|
2786
|
+
}
|
|
2787
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertDescriptionDirective, decorators: [{
|
|
2788
|
+
type: Directive,
|
|
2789
|
+
args: [{
|
|
2790
|
+
selector: '[yuwAlertDescription]',
|
|
2791
|
+
}]
|
|
2792
|
+
}] });
|
|
2793
|
+
|
|
2794
|
+
/**
|
|
2795
|
+
* Marks projected rich content (links, `<strong>`, …) as the title of a `<yuw-alert>`.
|
|
2796
|
+
*
|
|
2797
|
+
* When present, the alert projects this content into its title slot instead of rendering the
|
|
2798
|
+
* `title` string input. The content lands inside the element carrying the helm `alert-title`
|
|
2799
|
+
* data-slot, so the alert's grid keeps positioning it correctly.
|
|
2800
|
+
*/
|
|
2801
|
+
class YuwAlertTitleDirective {
|
|
2802
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2803
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAlertTitleDirective, isStandalone: true, selector: "[yuwAlertTitle]", ngImport: i0 }); }
|
|
2804
|
+
}
|
|
2805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertTitleDirective, decorators: [{
|
|
2806
|
+
type: Directive,
|
|
2807
|
+
args: [{
|
|
2808
|
+
selector: '[yuwAlertTitle]',
|
|
2809
|
+
}]
|
|
2810
|
+
}] });
|
|
2811
|
+
|
|
2812
|
+
/**
|
|
2813
|
+
* Inline, non-blocking message panel for status and validation feedback.
|
|
2814
|
+
*
|
|
2815
|
+
* Inputs:
|
|
2816
|
+
* - `variant`: Visual tone (`'default'`, `'destructive'`). Default is `'default'`.
|
|
2817
|
+
* - `title`: Heading text. User-facing text the consuming app is responsible for translating.
|
|
2818
|
+
* Ignored when a `[yuwAlertTitle]` slot is projected.
|
|
2819
|
+
* - `description`: Body text. User-facing text the consuming app is responsible for translating.
|
|
2820
|
+
* Ignored when a `[yuwAlertDescription]` slot is projected.
|
|
2821
|
+
* - `class`: Classes forwarded to the inner `hlm-alert` panel (the host is `display: contents`,
|
|
2822
|
+
* so they would otherwise never reach the rendered element). The consumer's classes win over
|
|
2823
|
+
* the alert's own styling.
|
|
2824
|
+
*
|
|
2825
|
+
* Content slots:
|
|
2826
|
+
* - `[yuwAlertIcon]`: Leading icon.
|
|
2827
|
+
* - `[yuwAlertTitle]`: Rich title content (links, `<strong>`, …). Replaces the `title` input.
|
|
2828
|
+
* - `[yuwAlertDescription]`: Rich description content. Replaces the `description` input.
|
|
2829
|
+
* - `[yuwAlertAction]`: Trailing action control, pinned to the top-right corner.
|
|
2830
|
+
*
|
|
2831
|
+
* Usage:
|
|
2832
|
+
* ```html
|
|
2833
|
+
* <yuw-alert variant="destructive" title="Pago rechazado" description="Revisa los datos de la tarjeta.">
|
|
2834
|
+
* <ng-icon yuwAlertIcon name="lucideTriangleAlert" />
|
|
2835
|
+
* <yuw-button yuwAlertAction size="sm" variant="ghost">Reintentar</yuw-button>
|
|
2836
|
+
* </yuw-alert>
|
|
2837
|
+
*
|
|
2838
|
+
* <yuw-alert>
|
|
2839
|
+
* <span yuwAlertTitle>Condiciones <strong>actualizadas</strong></span>
|
|
2840
|
+
* <span yuwAlertDescription>Consulta los <a href="/cambios">cambios</a> antes de continuar.</span>
|
|
2841
|
+
* </yuw-alert>
|
|
2842
|
+
* ```
|
|
2843
|
+
*/
|
|
2844
|
+
class YuwAlertComponent {
|
|
2845
|
+
constructor() {
|
|
2846
|
+
this.variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2847
|
+
this.title = input(undefined, ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2848
|
+
this.description = input(undefined, ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
2849
|
+
this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2850
|
+
this.hasAction = contentChild(YuwAlertActionDirective, ...(ngDevMode ? [{ debugName: "hasAction" }] : /* istanbul ignore next */ []));
|
|
2851
|
+
this.titleSlot = contentChild(YuwAlertTitleDirective, ...(ngDevMode ? [{ debugName: "titleSlot" }] : /* istanbul ignore next */ []));
|
|
2852
|
+
this.descriptionSlot = contentChild(YuwAlertDescriptionDirective, ...(ngDevMode ? [{ debugName: "descriptionSlot" }] : /* istanbul ignore next */ []));
|
|
2853
|
+
}
|
|
2854
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2855
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwAlertComponent, isStandalone: true, selector: "yuw-alert", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, queries: [{ propertyName: "hasAction", first: true, predicate: YuwAlertActionDirective, descendants: true, isSignal: true }, { propertyName: "titleSlot", first: true, predicate: YuwAlertTitleDirective, descendants: true, isSignal: true }, { propertyName: "descriptionSlot", first: true, predicate: YuwAlertDescriptionDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<hlm-alert [variant]=\"variant()\" [class]=\"userClass()\">\n <ng-content select=\"[yuwAlertIcon]\"/>\n\n @if (titleSlot()) {\n <div hlmAlertTitle>\n <ng-content select=\"[yuwAlertTitle]\"/>\n </div>\n } @else if (title()) {\n <div hlmAlertTitle>{{ title() }}</div>\n }\n\n @if (descriptionSlot()) {\n <div hlmAlertDescription>\n <ng-content select=\"[yuwAlertDescription]\"/>\n </div>\n } @else if (description()) {\n <div hlmAlertDescription>{{ description() }}</div>\n }\n\n <ng-content/>\n\n @if (hasAction()) {\n <div hlmAlertAction>\n <ng-content select=\"[yuwAlertAction]\"/>\n </div>\n }\n</hlm-alert>\n", dependencies: [{ kind: "directive", type: HlmAlert, selector: "hlm-alert,[hlmAlert]", inputs: ["variant"] }, { kind: "directive", type: HlmAlertTitle, selector: "[hlmAlertTitle]" }, { kind: "directive", type: HlmAlertDescription, selector: "[hlmAlertDescription]" }, { kind: "directive", type: HlmAlertAction, selector: "[hlmAlertAction]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2856
|
+
}
|
|
2857
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertComponent, decorators: [{
|
|
2858
|
+
type: Component,
|
|
2859
|
+
args: [{ selector: 'yuw-alert', imports: [HlmAlert, HlmAlertTitle, HlmAlertDescription, HlmAlertAction], host: {
|
|
2860
|
+
class: 'contents',
|
|
2861
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-alert [variant]=\"variant()\" [class]=\"userClass()\">\n <ng-content select=\"[yuwAlertIcon]\"/>\n\n @if (titleSlot()) {\n <div hlmAlertTitle>\n <ng-content select=\"[yuwAlertTitle]\"/>\n </div>\n } @else if (title()) {\n <div hlmAlertTitle>{{ title() }}</div>\n }\n\n @if (descriptionSlot()) {\n <div hlmAlertDescription>\n <ng-content select=\"[yuwAlertDescription]\"/>\n </div>\n } @else if (description()) {\n <div hlmAlertDescription>{{ description() }}</div>\n }\n\n <ng-content/>\n\n @if (hasAction()) {\n <div hlmAlertAction>\n <ng-content select=\"[yuwAlertAction]\"/>\n </div>\n }\n</hlm-alert>\n" }]
|
|
2862
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], hasAction: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwAlertActionDirective), { isSignal: true }] }], titleSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwAlertTitleDirective), { isSignal: true }] }], descriptionSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwAlertDescriptionDirective), { isSignal: true }] }] } });
|
|
2863
|
+
const YuwAlertImports = [
|
|
2864
|
+
YuwAlertComponent,
|
|
2865
|
+
YuwAlertActionDirective,
|
|
2866
|
+
YuwAlertTitleDirective,
|
|
2867
|
+
YuwAlertDescriptionDirective,
|
|
2868
|
+
];
|
|
2869
|
+
|
|
2870
|
+
/**
|
|
2871
|
+
* Marks an element as the dialog's footer content, projected into the footer slot.
|
|
2872
|
+
* Its presence is also what makes the footer render at all — without it the dialog
|
|
2873
|
+
* shows no empty footer strip.
|
|
2874
|
+
*/
|
|
2875
|
+
class YuwDialogFooterDirective {
|
|
2876
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwDialogFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2877
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwDialogFooterDirective, isStandalone: true, selector: "[yuwDialogFooter]", ngImport: i0 }); }
|
|
2878
|
+
}
|
|
2879
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwDialogFooterDirective, decorators: [{
|
|
2880
|
+
type: Directive,
|
|
2881
|
+
args: [{
|
|
2882
|
+
selector: '[yuwDialogFooter]',
|
|
2883
|
+
}]
|
|
2884
|
+
}] });
|
|
2885
|
+
|
|
2886
|
+
/**
|
|
2887
|
+
* Modal dialog overlay for focused tasks and forms.
|
|
2888
|
+
*
|
|
2889
|
+
* Accessibility: provide either `title` or `ariaLabel` — a modal without an accessible name is
|
|
2890
|
+
* announced as an anonymous dialog by screen readers.
|
|
2891
|
+
*
|
|
2892
|
+
* Inputs / Models:
|
|
2893
|
+
* - `open`: Two-way open/closed state. Drive via `[(open)]` to control it programmatically.
|
|
2894
|
+
* - `showTrigger`: Whether to render the trigger button. Set `false` when opening only via `[(open)]`.
|
|
2895
|
+
* - `title`: Header title text. User-facing text the consuming app is responsible for translating.
|
|
2896
|
+
* - `description`: Header description text. User-facing text the consuming app is responsible for translating.
|
|
2897
|
+
* - `ariaLabel`: Accessible name for the dialog when no visible `title` is rendered. User-facing
|
|
2898
|
+
* text the consuming app is responsible for translating.
|
|
2899
|
+
* - `closeLabel`: Accessible label of the corner close (×) button. When set, the close button
|
|
2900
|
+
* renders and screen readers read this label; when absent there is no close button. User-facing
|
|
2901
|
+
* text the consuming app is responsible for translating.
|
|
2902
|
+
* - `panelClass`: Extra classes merged onto the dialog panel (e.g. `sm:max-w-lg` to widen it).
|
|
2903
|
+
* They win over the library defaults via `twMerge`.
|
|
2904
|
+
* - `triggerVariant`: Button style variant for the trigger button. Default is `'outline'`.
|
|
2905
|
+
* - `triggerSize`: Button size for the trigger button.
|
|
2906
|
+
*
|
|
2907
|
+
* Content slots:
|
|
2908
|
+
* - `[yuwDialogTrigger]`: Trigger button content.
|
|
2909
|
+
* - `[yuwDialogFooter]`: Footer actions (`YuwDialogFooterDirective`). The footer only renders when
|
|
2910
|
+
* this slot is filled.
|
|
2911
|
+
*
|
|
2912
|
+
* The projected body scrolls internally when it is taller than the viewport, like `<yuw-sheet>`.
|
|
2913
|
+
*
|
|
2914
|
+
* Usage:
|
|
2915
|
+
* ```html
|
|
2916
|
+
* <yuw-dialog [(open)]="isOpen" title="Crear proyecto" description="Asigna un nombre para empezar." closeLabel="Cerrar">
|
|
2917
|
+
* <ng-container yuwDialogTrigger>Crear proyecto</ng-container>
|
|
2918
|
+
*
|
|
2919
|
+
* <yuw-input [(value)]="name" label="Nombre" />
|
|
2920
|
+
*
|
|
2921
|
+
* <div yuwDialogFooter>
|
|
2922
|
+
* <yuw-button (clicked)="save()">Guardar</yuw-button>
|
|
2923
|
+
* </div>
|
|
2924
|
+
* </yuw-dialog>
|
|
2925
|
+
* ```
|
|
2926
|
+
*/
|
|
2927
|
+
class YuwDialogComponent {
|
|
2928
|
+
constructor() {
|
|
2929
|
+
this.open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
2930
|
+
this.showTrigger = input(true, { ...(ngDevMode ? { debugName: "showTrigger" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2931
|
+
this.title = input(undefined, ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2932
|
+
this.description = input(undefined, ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
2933
|
+
this.ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
2934
|
+
this.closeLabel = input(undefined, ...(ngDevMode ? [{ debugName: "closeLabel" }] : /* istanbul ignore next */ []));
|
|
2935
|
+
this.panelClass = input(undefined, ...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
|
|
2936
|
+
this.triggerVariant = input('outline', ...(ngDevMode ? [{ debugName: "triggerVariant" }] : /* istanbul ignore next */ []));
|
|
2937
|
+
this.triggerSize = input('default', ...(ngDevMode ? [{ debugName: "triggerSize" }] : /* istanbul ignore next */ []));
|
|
2938
|
+
this.hasFooter = contentChild(YuwDialogFooterDirective, ...(ngDevMode ? [{ debugName: "hasFooter" }] : /* istanbul ignore next */ []));
|
|
2939
|
+
this._dialogState = computed(() => (this.open() ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "_dialogState" }] : /* istanbul ignore next */ []));
|
|
2940
|
+
}
|
|
2941
|
+
onStateChanged(state) {
|
|
2942
|
+
this.open.set(state === 'open');
|
|
2943
|
+
}
|
|
2944
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2945
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwDialogComponent, isStandalone: true, selector: "yuw-dialog", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, showTrigger: { classPropertyName: "showTrigger", publicName: "showTrigger", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, triggerVariant: { classPropertyName: "triggerVariant", publicName: "triggerVariant", isSignal: true, isRequired: false, transformFunction: null }, triggerSize: { classPropertyName: "triggerSize", publicName: "triggerSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { classAttribute: "contents" }, providers: [provideIcons({ lucideX })], queries: [{ propertyName: "hasFooter", first: true, predicate: YuwDialogFooterDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<hlm-dialog [state]=\"_dialogState()\" [aria-label]=\"ariaLabel()\" (stateChanged)=\"onStateChanged($event)\">\n @if (showTrigger()) {\n <button hlmDialogTrigger hlmBtn [variant]=\"triggerVariant()\" [size]=\"triggerSize()\">\n <ng-content select=\"[yuwDialogTrigger]\"/>\n </button>\n }\n\n <hlm-dialog-content *hlmDialogPortal [showCloseButton]=\"false\" class=\"flex max-h-[calc(100dvh-2rem)] flex-col\"\n [class]=\"panelClass()\">\n @if (title() || description()) {\n <div hlmDialogHeader>\n @if (title()) {\n <h2 hlmDialogTitle>{{ title() }}</h2>\n }\n @if (description()) {\n <p hlmDialogDescription>{{ description() }}</p>\n }\n </div>\n }\n\n <div class=\"flex-1 overflow-y-auto\">\n <ng-content/>\n </div>\n\n @if (hasFooter()) {\n <div hlmDialogFooter>\n <ng-content select=\"[yuwDialogFooter]\"/>\n </div>\n }\n\n @if (closeLabel()) {\n <button hlmBtn variant=\"ghost\" size=\"icon-sm\" class=\"absolute inset-e-2 inset-t-2\" hlmDialogClose>\n <ng-icon name=\"lucideX\"/>\n <span class=\"sr-only\">{{ closeLabel() }}</span>\n </button>\n }\n </hlm-dialog-content>\n</hlm-dialog>\n", dependencies: [{ kind: "component", type: i1$i.HlmDialog, selector: "hlm-dialog", exportAs: ["hlmDialog"] }, { kind: "component", type: i1$i.HlmDialogContent, selector: "hlm-dialog-content", inputs: ["showCloseButton"] }, { kind: "directive", type: i1$i.HlmDialogDescription, selector: "[hlmDialogDescription]" }, { kind: "directive", type: i1$i.HlmDialogFooter, selector: "[hlmDialogFooter],hlm-dialog-footer" }, { kind: "directive", type: i1$i.HlmDialogHeader, selector: "[hlmDialogHeader],hlm-dialog-header" }, { kind: "directive", type: i1$i.HlmDialogPortal, selector: "[hlmDialogPortal]" }, { kind: "directive", type: i1$i.HlmDialogTitle, selector: "[hlmDialogTitle]" }, { kind: "directive", type: i1$i.HlmDialogTrigger, selector: "button[hlmDialogTrigger],button[hlmDialogTriggerFor]" }, { kind: "directive", type: i1$i.HlmDialogClose, selector: "button[hlmDialogClose]" }, { kind: "directive", type: HlmButton, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size"], exportAs: ["hlmBtn"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2946
|
+
}
|
|
2947
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwDialogComponent, decorators: [{
|
|
2948
|
+
type: Component,
|
|
2949
|
+
args: [{ selector: 'yuw-dialog', imports: [...HlmDialogImports, HlmButton, NgIcon], providers: [provideIcons({ lucideX })], host: {
|
|
2950
|
+
class: 'contents',
|
|
2951
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-dialog [state]=\"_dialogState()\" [aria-label]=\"ariaLabel()\" (stateChanged)=\"onStateChanged($event)\">\n @if (showTrigger()) {\n <button hlmDialogTrigger hlmBtn [variant]=\"triggerVariant()\" [size]=\"triggerSize()\">\n <ng-content select=\"[yuwDialogTrigger]\"/>\n </button>\n }\n\n <hlm-dialog-content *hlmDialogPortal [showCloseButton]=\"false\" class=\"flex max-h-[calc(100dvh-2rem)] flex-col\"\n [class]=\"panelClass()\">\n @if (title() || description()) {\n <div hlmDialogHeader>\n @if (title()) {\n <h2 hlmDialogTitle>{{ title() }}</h2>\n }\n @if (description()) {\n <p hlmDialogDescription>{{ description() }}</p>\n }\n </div>\n }\n\n <div class=\"flex-1 overflow-y-auto\">\n <ng-content/>\n </div>\n\n @if (hasFooter()) {\n <div hlmDialogFooter>\n <ng-content select=\"[yuwDialogFooter]\"/>\n </div>\n }\n\n @if (closeLabel()) {\n <button hlmBtn variant=\"ghost\" size=\"icon-sm\" class=\"absolute inset-e-2 inset-t-2\" hlmDialogClose>\n <ng-icon name=\"lucideX\"/>\n <span class=\"sr-only\">{{ closeLabel() }}</span>\n </button>\n }\n </hlm-dialog-content>\n</hlm-dialog>\n" }]
|
|
2952
|
+
}], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], showTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTrigger", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], triggerVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerVariant", required: false }] }], triggerSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerSize", required: false }] }], hasFooter: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwDialogFooterDirective), { isSignal: true }] }] } });
|
|
2953
|
+
const YuwDialogImports = [YuwDialogComponent, YuwDialogFooterDirective];
|
|
2954
|
+
|
|
2955
|
+
/**
|
|
2956
|
+
* Marks a projected element as the leading media of a `<yuw-alert-dialog>`, rendered in a
|
|
2957
|
+
* highlighted square above or beside the title.
|
|
2958
|
+
*/
|
|
2959
|
+
class YuwAlertDialogMediaDirective {
|
|
2960
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertDialogMediaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2961
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAlertDialogMediaDirective, isStandalone: true, selector: "[yuwAlertDialogMedia]", ngImport: i0 }); }
|
|
2962
|
+
}
|
|
2963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertDialogMediaDirective, decorators: [{
|
|
2964
|
+
type: Directive,
|
|
2965
|
+
args: [{
|
|
2966
|
+
selector: '[yuwAlertDialogMedia]',
|
|
2967
|
+
}]
|
|
2968
|
+
}] });
|
|
2969
|
+
|
|
2970
|
+
/**
|
|
2971
|
+
* Blocking confirmation dialog for destructive or irreversible actions. Unlike `<yuw-dialog>` it
|
|
2972
|
+
* cannot be dismissed by clicking the backdrop, so the user must pick one of the two actions.
|
|
2973
|
+
*
|
|
2974
|
+
* Inputs / Models:
|
|
2975
|
+
* - `open`: Two-way open/closed state. Drive via `[(open)]` to control it programmatically.
|
|
2976
|
+
* - `showTrigger`: Whether to render the trigger button. Set `false` when opening only via `[(open)]`.
|
|
2977
|
+
* - `title`: Header title text. User-facing text the consuming app is responsible for translating.
|
|
2978
|
+
* - `description`: Header description text. User-facing text the consuming app is responsible for translating.
|
|
2979
|
+
* - `confirmLabel`: Label of the confirm action. User-facing text the consuming app is responsible for translating.
|
|
2980
|
+
* - `cancelLabel`: Label of the cancel action. User-facing text the consuming app is responsible for translating.
|
|
2981
|
+
* - `confirmVariant`: Button style variant for the confirm action. Use `'destructive'` for deletions.
|
|
2982
|
+
* - `size`: Content width (`'sm'`, `'default'`). Default is `'default'`.
|
|
2983
|
+
* - `triggerVariant`: Button style variant for the trigger button.
|
|
2984
|
+
* - `triggerSize`: Button size for the trigger button.
|
|
2985
|
+
*
|
|
2986
|
+
* Outputs:
|
|
2987
|
+
* - `confirmed`: Emitted when the confirm action is activated.
|
|
2988
|
+
* - `cancelled`: Emitted only when the cancel button is activated — programmatic closes (setting
|
|
2989
|
+
* `open` to `false`) do not emit it.
|
|
2990
|
+
*
|
|
2991
|
+
* Content slots:
|
|
2992
|
+
* - `[yuwAlertDialogTrigger]`: Trigger button content.
|
|
2993
|
+
* - `[yuwAlertDialogMedia]`: Leading media/icon shown above or beside the title.
|
|
2994
|
+
*
|
|
2995
|
+
* Usage:
|
|
2996
|
+
* ```html
|
|
2997
|
+
* <yuw-alert-dialog
|
|
2998
|
+
* [(open)]="isOpen"
|
|
2999
|
+
* title="¿Eliminar factura?"
|
|
3000
|
+
* description="Esta acción no se puede deshacer."
|
|
3001
|
+
* confirmLabel="Eliminar"
|
|
3002
|
+
* cancelLabel="Cancelar"
|
|
3003
|
+
* confirmVariant="destructive"
|
|
3004
|
+
* (confirmed)="delete()" />
|
|
3005
|
+
* ```
|
|
3006
|
+
*/
|
|
3007
|
+
class YuwAlertDialogComponent {
|
|
3008
|
+
constructor() {
|
|
3009
|
+
this.open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
3010
|
+
this.showTrigger = input(true, { ...(ngDevMode ? { debugName: "showTrigger" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3011
|
+
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
3012
|
+
this.description = input(undefined, ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
3013
|
+
this.confirmLabel = input.required(...(ngDevMode ? [{ debugName: "confirmLabel" }] : /* istanbul ignore next */ []));
|
|
3014
|
+
this.cancelLabel = input.required(...(ngDevMode ? [{ debugName: "cancelLabel" }] : /* istanbul ignore next */ []));
|
|
3015
|
+
this.confirmVariant = input('default', ...(ngDevMode ? [{ debugName: "confirmVariant" }] : /* istanbul ignore next */ []));
|
|
3016
|
+
this.size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3017
|
+
this.triggerVariant = input('outline', ...(ngDevMode ? [{ debugName: "triggerVariant" }] : /* istanbul ignore next */ []));
|
|
3018
|
+
this.triggerSize = input('default', ...(ngDevMode ? [{ debugName: "triggerSize" }] : /* istanbul ignore next */ []));
|
|
3019
|
+
this.confirmed = output();
|
|
3020
|
+
this.cancelled = output();
|
|
3021
|
+
this.hasMedia = contentChild(YuwAlertDialogMediaDirective, ...(ngDevMode ? [{ debugName: "hasMedia" }] : /* istanbul ignore next */ []));
|
|
3022
|
+
this._dialogState = computed(() => (this.open() ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "_dialogState" }] : /* istanbul ignore next */ []));
|
|
3023
|
+
}
|
|
3024
|
+
onStateChanged(state) {
|
|
3025
|
+
this.open.set(state === 'open');
|
|
3026
|
+
}
|
|
3027
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3028
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwAlertDialogComponent, isStandalone: true, selector: "yuw-alert-dialog", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, showTrigger: { classPropertyName: "showTrigger", publicName: "showTrigger", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, confirmLabel: { classPropertyName: "confirmLabel", publicName: "confirmLabel", isSignal: true, isRequired: true, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: true, transformFunction: null }, confirmVariant: { classPropertyName: "confirmVariant", publicName: "confirmVariant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, triggerVariant: { classPropertyName: "triggerVariant", publicName: "triggerVariant", isSignal: true, isRequired: false, transformFunction: null }, triggerSize: { classPropertyName: "triggerSize", publicName: "triggerSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", confirmed: "confirmed", cancelled: "cancelled" }, host: { classAttribute: "contents" }, queries: [{ propertyName: "hasMedia", first: true, predicate: YuwAlertDialogMediaDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<hlm-alert-dialog [state]=\"_dialogState()\" (stateChanged)=\"onStateChanged($event)\">\n @if (showTrigger()) {\n <button hlmAlertDialogTrigger hlmBtn [variant]=\"triggerVariant()\" [size]=\"triggerSize()\">\n <ng-content select=\"[yuwAlertDialogTrigger]\"/>\n </button>\n }\n\n <hlm-alert-dialog-content *hlmAlertDialogPortal [size]=\"size()\">\n <div hlmAlertDialogHeader>\n @if (hasMedia()) {\n <div hlmAlertDialogMedia>\n <ng-content select=\"[yuwAlertDialogMedia]\"/>\n </div>\n }\n\n <h2 hlmAlertDialogTitle>{{ title() }}</h2>\n\n @if (description()) {\n <p hlmAlertDialogDescription>{{ description() }}</p>\n }\n </div>\n\n <ng-content/>\n\n <div hlmAlertDialogFooter>\n <button hlmAlertDialogCancel (click)=\"cancelled.emit()\">{{ cancelLabel() }}</button>\n <button hlmAlertDialogAction [variant]=\"confirmVariant()\" (click)=\"confirmed.emit()\">\n {{ confirmLabel() }}\n </button>\n </div>\n </hlm-alert-dialog-content>\n</hlm-alert-dialog>\n", dependencies: [{ kind: "component", type: i1$j.HlmAlertDialog, selector: "hlm-alert-dialog", exportAs: ["hlmAlertDialog"] }, { kind: "directive", type: i1$j.HlmAlertDialogAction, selector: "button[hlmAlertDialogAction]", inputs: ["type"] }, { kind: "directive", type: i1$j.HlmAlertDialogCancel, selector: "button[hlmAlertDialogCancel]", inputs: ["type"] }, { kind: "directive", type: i1$j.HlmAlertDialogContent, selector: "[hlmAlertDialogContent],hlm-alert-dialog-content", inputs: ["size"] }, { kind: "directive", type: i1$j.HlmAlertDialogDescription, selector: "[hlmAlertDialogDescription]" }, { kind: "directive", type: i1$j.HlmAlertDialogFooter, selector: "[hlmAlertDialogFooter],hlm-alert-dialog-footer" }, { kind: "directive", type: i1$j.HlmAlertDialogHeader, selector: "[hlmAlertDialogHeader],hlm-alert-dialog-header" }, { kind: "directive", type: i1$j.HlmAlertDialogMedia, selector: "[hlmAlertDialogMedia],hlm-alert-dialog-media" }, { kind: "directive", type: i1$j.HlmAlertDialogPortal, selector: "[hlmAlertDialogPortal]" }, { kind: "directive", type: i1$j.HlmAlertDialogTitle, selector: "[hlmAlertDialogTitle]" }, { kind: "directive", type: i1$j.HlmAlertDialogTrigger, selector: "button[hlmAlertDialogTrigger],button[hlmAlertDialogTriggerFor]" }, { kind: "directive", type: HlmButton, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size"], exportAs: ["hlmBtn"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3029
|
+
}
|
|
3030
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAlertDialogComponent, decorators: [{
|
|
3031
|
+
type: Component,
|
|
3032
|
+
args: [{ selector: 'yuw-alert-dialog', imports: [...HlmAlertDialogImports, HlmButton], host: {
|
|
3033
|
+
class: 'contents',
|
|
3034
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-alert-dialog [state]=\"_dialogState()\" (stateChanged)=\"onStateChanged($event)\">\n @if (showTrigger()) {\n <button hlmAlertDialogTrigger hlmBtn [variant]=\"triggerVariant()\" [size]=\"triggerSize()\">\n <ng-content select=\"[yuwAlertDialogTrigger]\"/>\n </button>\n }\n\n <hlm-alert-dialog-content *hlmAlertDialogPortal [size]=\"size()\">\n <div hlmAlertDialogHeader>\n @if (hasMedia()) {\n <div hlmAlertDialogMedia>\n <ng-content select=\"[yuwAlertDialogMedia]\"/>\n </div>\n }\n\n <h2 hlmAlertDialogTitle>{{ title() }}</h2>\n\n @if (description()) {\n <p hlmAlertDialogDescription>{{ description() }}</p>\n }\n </div>\n\n <ng-content/>\n\n <div hlmAlertDialogFooter>\n <button hlmAlertDialogCancel (click)=\"cancelled.emit()\">{{ cancelLabel() }}</button>\n <button hlmAlertDialogAction [variant]=\"confirmVariant()\" (click)=\"confirmed.emit()\">\n {{ confirmLabel() }}\n </button>\n </div>\n </hlm-alert-dialog-content>\n</hlm-alert-dialog>\n" }]
|
|
3035
|
+
}], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], showTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTrigger", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], confirmLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmLabel", required: true }] }], cancelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelLabel", required: true }] }], confirmVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmVariant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], triggerVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerVariant", required: false }] }], triggerSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerSize", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }], hasMedia: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwAlertDialogMediaDirective), { isSignal: true }] }] } });
|
|
3036
|
+
|
|
3037
|
+
/**
|
|
3038
|
+
* Declares the content of a single `<yuw-tabs>` panel. Apply it to an `<ng-template>` and pass the
|
|
3039
|
+
* id of the tab it belongs to, matching an entry in the `tabs` input.
|
|
3040
|
+
*
|
|
3041
|
+
* Usage:
|
|
3042
|
+
* ```html
|
|
3043
|
+
* <ng-template yuwTabPanel="billing">Contenido de facturación</ng-template>
|
|
3044
|
+
* ```
|
|
3045
|
+
*/
|
|
3046
|
+
class YuwTabPanelDirective {
|
|
3047
|
+
constructor() {
|
|
3048
|
+
this.tabId = input.required({ ...(ngDevMode ? { debugName: "tabId" } : /* istanbul ignore next */ {}), alias: 'yuwTabPanel' });
|
|
3049
|
+
this.templateRef = inject(TemplateRef);
|
|
3050
|
+
}
|
|
3051
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTabPanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3052
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: YuwTabPanelDirective, isStandalone: true, selector: "ng-template[yuwTabPanel]", inputs: { tabId: { classPropertyName: "tabId", publicName: "yuwTabPanel", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
3053
|
+
}
|
|
3054
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTabPanelDirective, decorators: [{
|
|
3055
|
+
type: Directive,
|
|
3056
|
+
args: [{
|
|
3057
|
+
selector: 'ng-template[yuwTabPanel]',
|
|
3058
|
+
}]
|
|
3059
|
+
}], propDecorators: { tabId: [{ type: i0.Input, args: [{ isSignal: true, alias: "yuwTabPanel", required: true }] }] } });
|
|
3060
|
+
|
|
3061
|
+
/**
|
|
3062
|
+
* Tabbed navigation between sibling panels.
|
|
3063
|
+
*
|
|
3064
|
+
* Triggers come from the `tabs` input; each panel's content is declared by the consumer as an
|
|
3065
|
+
* `<ng-template yuwTabPanel="<id>">` whose id matches a tab. Panels are lazy: a panel's content
|
|
3066
|
+
* is only instantiated the first time its tab becomes active (and stays alive, hidden, after
|
|
3067
|
+
* switching away).
|
|
3068
|
+
*
|
|
3069
|
+
* Inputs / Models:
|
|
3070
|
+
* - `tabs`: The tab definitions (`YuwTabItemDto[]`) rendered as triggers, in order.
|
|
3071
|
+
* - `activeTab`: Two-way id of the selected tab. Drive via `[(activeTab)]` to control it
|
|
3072
|
+
* programmatically; listen to `activeTabChange` to react to activations.
|
|
3073
|
+
* - `variant`: Trigger list style (`'default'` filled, `'line'` underlined). Default is `'default'`.
|
|
3074
|
+
* - `orientation`: Layout direction (`'horizontal'`, `'vertical'`). Default is `'horizontal'`.
|
|
3075
|
+
* - `activationMode`: How keyboard focus activates tabs (`'automatic'` activates on focus,
|
|
3076
|
+
* `'manual'` requires Enter/Space). Default is `'automatic'`.
|
|
3077
|
+
*
|
|
3078
|
+
* Usage:
|
|
3079
|
+
* ```html
|
|
3080
|
+
* <yuw-tabs [tabs]="tabs" [(activeTab)]="selected">
|
|
3081
|
+
* <ng-template yuwTabPanel="general">Contenido general</ng-template>
|
|
3082
|
+
* <ng-template yuwTabPanel="billing">Contenido de facturación</ng-template>
|
|
3083
|
+
* </yuw-tabs>
|
|
3084
|
+
* ```
|
|
3085
|
+
*/
|
|
3086
|
+
class YuwTabsComponent {
|
|
3087
|
+
constructor() {
|
|
3088
|
+
this.tabs = input.required(...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
3089
|
+
this.activeTab = model.required(...(ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []));
|
|
3090
|
+
this.variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
3091
|
+
this.orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
3092
|
+
this.activationMode = input('automatic', ...(ngDevMode ? [{ debugName: "activationMode" }] : /* istanbul ignore next */ []));
|
|
3093
|
+
this.panels = contentChildren(YuwTabPanelDirective, ...(ngDevMode ? [{ debugName: "panels" }] : /* istanbul ignore next */ []));
|
|
3094
|
+
}
|
|
3095
|
+
onTabActivated(tabId) {
|
|
3096
|
+
this.activeTab.set(tabId);
|
|
3097
|
+
}
|
|
3098
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3099
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: YuwTabsComponent, isStandalone: true, selector: "yuw-tabs", inputs: { tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: true, transformFunction: null }, activeTab: { classPropertyName: "activeTab", publicName: "activeTab", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, activationMode: { classPropertyName: "activationMode", publicName: "activationMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeTab: "activeTabChange" }, host: { classAttribute: "contents" }, queries: [{ propertyName: "panels", predicate: YuwTabPanelDirective, isSignal: true }], ngImport: i0, template: "<hlm-tabs\n [tab]=\"activeTab()\"\n [orientation]=\"orientation()\"\n [activationMode]=\"activationMode()\"\n (tabActivated)=\"onTabActivated($event)\"\n>\n <hlm-tabs-list [variant]=\"variant()\">\n @for (tab of tabs(); track tab.id) {\n <button [hlmTabsTrigger]=\"tab.id\" [disabled]=\"tab.disabled ?? false\">{{ tab.label }}</button>\n }\n </hlm-tabs-list>\n\n @for (panel of panels(); track panel.tabId()) {\n <div [hlmTabsContent]=\"panel.tabId()\">\n <ng-template hlmTabsContentLazy>\n <ng-container [ngTemplateOutlet]=\"panel.templateRef\"/>\n </ng-template>\n </div>\n }\n</hlm-tabs>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$k.HlmTabs, selector: "[hlmTabs],hlm-tabs", inputs: ["tab"] }, { kind: "directive", type: i1$k.HlmTabsList, selector: "[hlmTabsList],hlm-tabs-list", inputs: ["variant"] }, { kind: "directive", type: i1$k.HlmTabsTrigger, selector: "[hlmTabsTrigger]", inputs: ["hlmTabsTrigger"] }, { kind: "directive", type: i1$k.HlmTabsContent, selector: "[hlmTabsContent]", inputs: ["hlmTabsContent"] }, { kind: "directive", type: i1$k.HlmTabsContentLazy, selector: "ng-template[hlmTabsContentLazy]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3100
|
+
}
|
|
3101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwTabsComponent, decorators: [{
|
|
3102
|
+
type: Component,
|
|
3103
|
+
args: [{ selector: 'yuw-tabs', imports: [NgTemplateOutlet, ...HlmTabsImports], host: {
|
|
3104
|
+
class: 'contents',
|
|
3105
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-tabs\n [tab]=\"activeTab()\"\n [orientation]=\"orientation()\"\n [activationMode]=\"activationMode()\"\n (tabActivated)=\"onTabActivated($event)\"\n>\n <hlm-tabs-list [variant]=\"variant()\">\n @for (tab of tabs(); track tab.id) {\n <button [hlmTabsTrigger]=\"tab.id\" [disabled]=\"tab.disabled ?? false\">{{ tab.label }}</button>\n }\n </hlm-tabs-list>\n\n @for (panel of panels(); track panel.tabId()) {\n <div [hlmTabsContent]=\"panel.tabId()\">\n <ng-template hlmTabsContentLazy>\n <ng-container [ngTemplateOutlet]=\"panel.templateRef\"/>\n </ng-template>\n </div>\n }\n</hlm-tabs>\n" }]
|
|
3106
|
+
}], propDecorators: { tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: true }] }], activeTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTab", required: true }] }, { type: i0.Output, args: ["activeTabChange"] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], activationMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "activationMode", required: false }] }], panels: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => YuwTabPanelDirective), { isSignal: true }] }] } });
|
|
3107
|
+
|
|
3108
|
+
/**
|
|
3109
|
+
* Container directive for a single file attachment card.
|
|
3110
|
+
*
|
|
3111
|
+
* Accepts `state` (`'idle'`, `'uploading'`, `'processing'`, `'error'`, `'done'`), `size`
|
|
3112
|
+
* (`'default'`, `'sm'`, `'xs'`) and `orientation` (`'horizontal'`, `'vertical'`), which drive the
|
|
3113
|
+
* styling of every nested slot.
|
|
3114
|
+
*
|
|
3115
|
+
* Usage:
|
|
3116
|
+
* ```html
|
|
3117
|
+
* <div yuwAttachment state="uploading">
|
|
3118
|
+
* <div yuwAttachmentMedia><ng-icon name="lucideFileText" /></div>
|
|
3119
|
+
* <div yuwAttachmentContent>
|
|
3120
|
+
* <span yuwAttachmentTitle>informe.pdf</span>
|
|
3121
|
+
* <span yuwAttachmentDescription>2,4 MB</span>
|
|
3122
|
+
* </div>
|
|
3123
|
+
* <div yuwAttachmentActions>
|
|
3124
|
+
* <button yuwAttachmentAction><ng-icon name="lucideX" /></button>
|
|
3125
|
+
* </div>
|
|
3126
|
+
* </div>
|
|
3127
|
+
* ```
|
|
3128
|
+
*/
|
|
3129
|
+
class YuwAttachmentDirective {
|
|
3130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3131
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAttachmentDirective, isStandalone: true, selector: "[yuwAttachment], yuw-attachment", hostDirectives: [{ directive: i1$l.HlmAttachment, inputs: ["state", "state", "size", "size", "orientation", "orientation"] }], ngImport: i0 }); }
|
|
3132
|
+
}
|
|
3133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentDirective, decorators: [{
|
|
3134
|
+
type: Directive,
|
|
3135
|
+
args: [{
|
|
3136
|
+
selector: '[yuwAttachment], yuw-attachment',
|
|
3137
|
+
hostDirectives: [{ directive: HlmAttachment, inputs: ['state', 'size', 'orientation'] }],
|
|
3138
|
+
}]
|
|
3139
|
+
}] });
|
|
3140
|
+
/** Scrollable, snapping row that lays out several attachment cards. */
|
|
3141
|
+
class YuwAttachmentGroupDirective {
|
|
3142
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3143
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAttachmentGroupDirective, isStandalone: true, selector: "[yuwAttachmentGroup], yuw-attachment-group", hostDirectives: [{ directive: i1$l.HlmAttachmentGroup }], ngImport: i0 }); }
|
|
3144
|
+
}
|
|
3145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentGroupDirective, decorators: [{
|
|
3146
|
+
type: Directive,
|
|
3147
|
+
args: [{
|
|
3148
|
+
selector: '[yuwAttachmentGroup], yuw-attachment-group',
|
|
3149
|
+
hostDirectives: [HlmAttachmentGroup],
|
|
3150
|
+
}]
|
|
3151
|
+
}] });
|
|
3152
|
+
/** Leading media slot of an attachment, for a file-type icon or an image preview. Supports `variant` (`'icon'`, `'image'`). */
|
|
3153
|
+
class YuwAttachmentMediaDirective {
|
|
3154
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentMediaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3155
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAttachmentMediaDirective, isStandalone: true, selector: "[yuwAttachmentMedia], yuw-attachment-media", hostDirectives: [{ directive: i1$l.HlmAttachmentMedia, inputs: ["variant", "variant"] }], ngImport: i0 }); }
|
|
3156
|
+
}
|
|
3157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentMediaDirective, decorators: [{
|
|
3158
|
+
type: Directive,
|
|
3159
|
+
args: [{
|
|
3160
|
+
selector: '[yuwAttachmentMedia], yuw-attachment-media',
|
|
3161
|
+
hostDirectives: [{ directive: HlmAttachmentMedia, inputs: ['variant'] }],
|
|
3162
|
+
}]
|
|
3163
|
+
}] });
|
|
3164
|
+
/** Text content container of an attachment, holding its title and description. */
|
|
3165
|
+
class YuwAttachmentContentDirective {
|
|
3166
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3167
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAttachmentContentDirective, isStandalone: true, selector: "[yuwAttachmentContent], yuw-attachment-content", hostDirectives: [{ directive: i1$l.HlmAttachmentContent }], ngImport: i0 }); }
|
|
3168
|
+
}
|
|
3169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentContentDirective, decorators: [{
|
|
3170
|
+
type: Directive,
|
|
3171
|
+
args: [{
|
|
3172
|
+
selector: '[yuwAttachmentContent], yuw-attachment-content',
|
|
3173
|
+
hostDirectives: [HlmAttachmentContent],
|
|
3174
|
+
}]
|
|
3175
|
+
}] });
|
|
3176
|
+
/** File name of an attachment. Truncates and shimmers while the attachment is uploading or processing. */
|
|
3177
|
+
class YuwAttachmentTitleDirective {
|
|
3178
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3179
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAttachmentTitleDirective, isStandalone: true, selector: "[yuwAttachmentTitle], yuw-attachment-title", hostDirectives: [{ directive: i1$l.HlmAttachmentTitle }], ngImport: i0 }); }
|
|
3180
|
+
}
|
|
3181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentTitleDirective, decorators: [{
|
|
3182
|
+
type: Directive,
|
|
3183
|
+
args: [{
|
|
3184
|
+
selector: '[yuwAttachmentTitle], yuw-attachment-title',
|
|
3185
|
+
hostDirectives: [HlmAttachmentTitle],
|
|
3186
|
+
}]
|
|
3187
|
+
}] });
|
|
3188
|
+
/** Secondary line of an attachment, for file size, progress, or an error message. */
|
|
3189
|
+
class YuwAttachmentDescriptionDirective {
|
|
3190
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3191
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAttachmentDescriptionDirective, isStandalone: true, selector: "[yuwAttachmentDescription], yuw-attachment-description", hostDirectives: [{ directive: i1$l.HlmAttachmentDescription }], ngImport: i0 }); }
|
|
3192
|
+
}
|
|
3193
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentDescriptionDirective, decorators: [{
|
|
3194
|
+
type: Directive,
|
|
3195
|
+
args: [{
|
|
3196
|
+
selector: '[yuwAttachmentDescription], yuw-attachment-description',
|
|
3197
|
+
hostDirectives: [HlmAttachmentDescription],
|
|
3198
|
+
}]
|
|
3199
|
+
}] });
|
|
3200
|
+
/** Trailing container for an attachment's action buttons. */
|
|
3201
|
+
class YuwAttachmentActionsDirective {
|
|
3202
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3203
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAttachmentActionsDirective, isStandalone: true, selector: "[yuwAttachmentActions], yuw-attachment-actions", hostDirectives: [{ directive: i1$l.HlmAttachmentActions }], ngImport: i0 }); }
|
|
3204
|
+
}
|
|
3205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentActionsDirective, decorators: [{
|
|
3206
|
+
type: Directive,
|
|
3207
|
+
args: [{
|
|
3208
|
+
selector: '[yuwAttachmentActions], yuw-attachment-actions',
|
|
3209
|
+
hostDirectives: [HlmAttachmentActions],
|
|
3210
|
+
}]
|
|
3211
|
+
}] });
|
|
3212
|
+
/**
|
|
3213
|
+
* Icon-sized action button inside an attachment, such as remove or retry.
|
|
3214
|
+
*
|
|
3215
|
+
* Besides `type`, accepts the button `variant` and `size` (defaults `'ghost'` / `'icon-xs'`).
|
|
3216
|
+
* Extends `HlmAttachmentAction` (instead of composing it via `hostDirectives`) because
|
|
3217
|
+
* `variant`/`size` are inputs the helm only exposes from its own `HlmButton` host directive, and
|
|
3218
|
+
* host-directive forwarding is not transitive (NG2017) — inheritance carries the whole surface
|
|
3219
|
+
* over as real `HlmButton` inputs, so the cva variants resolve natively instead of being layered
|
|
3220
|
+
* on top of the defaults. Angular does not inherit `providers`, so the helm's
|
|
3221
|
+
* `provideBrnButtonConfig` defaults are mirrored here; keep them in sync with
|
|
3222
|
+
* `helm/attachment/src/lib/hlm-attachment-action.ts` if the helm is regenerated.
|
|
3223
|
+
*/
|
|
3224
|
+
class YuwAttachmentActionDirective extends HlmAttachmentAction {
|
|
3225
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentActionDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3226
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAttachmentActionDirective, isStandalone: true, selector: "button[yuwAttachmentAction]", providers: [provideBrnButtonConfig({ variant: 'ghost', size: 'icon-xs' })], usesInheritance: true, ngImport: i0 }); }
|
|
3227
|
+
}
|
|
3228
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentActionDirective, decorators: [{
|
|
3229
|
+
type: Directive,
|
|
3230
|
+
args: [{
|
|
3231
|
+
selector: 'button[yuwAttachmentAction]',
|
|
3232
|
+
providers: [provideBrnButtonConfig({ variant: 'ghost', size: 'icon-xs' })],
|
|
3233
|
+
}]
|
|
3234
|
+
}] });
|
|
3235
|
+
/** Turns the whole attachment card into a single clickable target, layered under its actions. */
|
|
3236
|
+
class YuwAttachmentTriggerDirective {
|
|
3237
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3238
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwAttachmentTriggerDirective, isStandalone: true, selector: "button[yuwAttachmentTrigger], a[yuwAttachmentTrigger]", hostDirectives: [{ directive: i1$l.HlmAttachmentTrigger, inputs: ["type", "type"] }], ngImport: i0 }); }
|
|
3239
|
+
}
|
|
3240
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwAttachmentTriggerDirective, decorators: [{
|
|
3241
|
+
type: Directive,
|
|
3242
|
+
args: [{
|
|
3243
|
+
selector: 'button[yuwAttachmentTrigger], a[yuwAttachmentTrigger]',
|
|
3244
|
+
hostDirectives: [{ directive: HlmAttachmentTrigger, inputs: ['type'] }],
|
|
3245
|
+
}]
|
|
3246
|
+
}] });
|
|
3247
|
+
|
|
3248
|
+
/**
|
|
3249
|
+
* Collapsible navigation sidebar. Renders as a fixed panel on desktop and as a slide-in sheet on
|
|
3250
|
+
* mobile, and reads its colors from the `--sidebar-*` theme tokens.
|
|
3251
|
+
*
|
|
3252
|
+
* Place it inside a `[yuwSidebarWrapper]` alongside a `<main yuwSidebarInset>`, and compose its
|
|
3253
|
+
* inner structure with the `yuwSidebar*` directives. Open state is shared through
|
|
3254
|
+
* `YuwSidebarService`, so `<yuw-sidebar-trigger>` works from anywhere in the page.
|
|
3255
|
+
*
|
|
3256
|
+
* Inputs:
|
|
3257
|
+
* - `side`: Edge the sidebar is docked to (`'left'`, `'right'`). Default is `'left'`.
|
|
3258
|
+
* - `variant`: Panel treatment (`'sidebar'` flush, `'floating'` card, `'inset'` inset page). Default is `'sidebar'`.
|
|
3259
|
+
* - `collapsible`: Collapse behaviour (`'offcanvas'` slides away, `'icon'` shrinks to icons, `'none'` always open). Default is `'offcanvas'`.
|
|
3260
|
+
* - `sidebarWidthMobile`: Width of the mobile slide-in sheet (any CSS length). Defaults to the helm sidebar config (`18rem`).
|
|
3261
|
+
* - `sidebarContainerClass`: Extra classes merged onto the desktop fixed container (the helm merges them last, so they win).
|
|
3262
|
+
*
|
|
3263
|
+
* Deliberately not exposed from the helm sidebar (add a wrapper only when a real consumer needs
|
|
3264
|
+
* them): `HlmSidebarMenuAction`, `HlmSidebarMenuSkeleton`, `HlmSidebarInput` and
|
|
3265
|
+
* `HlmSidebarGroupAction`.
|
|
3266
|
+
*
|
|
3267
|
+
* Usage:
|
|
3268
|
+
* ```html
|
|
3269
|
+
* <yuw-sidebar collapsible="icon">
|
|
3270
|
+
* <div yuwSidebarHeader>Yurest</div>
|
|
3271
|
+
* <div yuwSidebarContent>
|
|
3272
|
+
* <ul yuwSidebarMenu>
|
|
3273
|
+
* <li yuwSidebarMenuItem><a yuwSidebarMenuButton isActive tooltip="Pedidos">Pedidos</a></li>
|
|
3274
|
+
* </ul>
|
|
3275
|
+
* </div>
|
|
3276
|
+
* </yuw-sidebar>
|
|
3277
|
+
* ```
|
|
3278
|
+
*/
|
|
3279
|
+
class YuwSidebarComponent {
|
|
3280
|
+
constructor() {
|
|
3281
|
+
this.config = injectHlmSidebarConfig();
|
|
3282
|
+
this.side = input('left', ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
3283
|
+
this.variant = input('sidebar', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
3284
|
+
this.collapsible = input('offcanvas', ...(ngDevMode ? [{ debugName: "collapsible" }] : /* istanbul ignore next */ []));
|
|
3285
|
+
this.sidebarWidthMobile = input(this.config.sidebarWidthMobile, ...(ngDevMode ? [{ debugName: "sidebarWidthMobile" }] : /* istanbul ignore next */ []));
|
|
3286
|
+
this.sidebarContainerClass = input('', ...(ngDevMode ? [{ debugName: "sidebarContainerClass" }] : /* istanbul ignore next */ []));
|
|
3287
|
+
}
|
|
3288
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3289
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: YuwSidebarComponent, isStandalone: true, selector: "yuw-sidebar", inputs: { side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, sidebarWidthMobile: { classPropertyName: "sidebarWidthMobile", publicName: "sidebarWidthMobile", isSignal: true, isRequired: false, transformFunction: null }, sidebarContainerClass: { classPropertyName: "sidebarContainerClass", publicName: "sidebarContainerClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "<hlm-sidebar\n [side]=\"side()\"\n [variant]=\"variant()\"\n [collapsible]=\"collapsible()\"\n [sidebarWidthMobile]=\"sidebarWidthMobile()\"\n [sidebarContainerClass]=\"sidebarContainerClass()\"\n>\n <ng-content/>\n</hlm-sidebar>\n", dependencies: [{ kind: "component", type: HlmSidebar, selector: "hlm-sidebar", inputs: ["sidebarWidthMobile", "side", "variant", "collapsible", "sidebarContainerClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3290
|
+
}
|
|
3291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarComponent, decorators: [{
|
|
3292
|
+
type: Component,
|
|
3293
|
+
args: [{ selector: 'yuw-sidebar', imports: [HlmSidebar], host: {
|
|
3294
|
+
class: 'contents',
|
|
3295
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-sidebar\n [side]=\"side()\"\n [variant]=\"variant()\"\n [collapsible]=\"collapsible()\"\n [sidebarWidthMobile]=\"sidebarWidthMobile()\"\n [sidebarContainerClass]=\"sidebarContainerClass()\"\n>\n <ng-content/>\n</hlm-sidebar>\n" }]
|
|
3296
|
+
}], propDecorators: { side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], sidebarWidthMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarWidthMobile", required: false }] }], sidebarContainerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarContainerClass", required: false }] }] } });
|
|
3297
|
+
|
|
3298
|
+
/**
|
|
3299
|
+
* Icon button that toggles the sidebar open or collapsed. Works anywhere on the page, including
|
|
3300
|
+
* inside `<main yuwSidebarInset>`, since the open state lives in `YuwSidebarService`.
|
|
3301
|
+
*
|
|
3302
|
+
* Inputs:
|
|
3303
|
+
* - `label`: Screen-reader-only label for the button. User-facing text the consuming app is
|
|
3304
|
+
* responsible for translating.
|
|
3305
|
+
*
|
|
3306
|
+
* Usage:
|
|
3307
|
+
* ```html
|
|
3308
|
+
* <yuw-sidebar-trigger label="Alternar menú" />
|
|
3309
|
+
* ```
|
|
3310
|
+
*/
|
|
3311
|
+
class YuwSidebarTriggerComponent {
|
|
3312
|
+
constructor() {
|
|
3313
|
+
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
3314
|
+
}
|
|
3315
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3316
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: YuwSidebarTriggerComponent, isStandalone: true, selector: "yuw-sidebar-trigger", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "<button hlmSidebarTrigger [srOnlyText]=\"label()\"></button>\n", dependencies: [{ kind: "component", type: HlmSidebarTrigger, selector: "button[hlmSidebarTrigger]", inputs: ["srOnlyText"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3317
|
+
}
|
|
3318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarTriggerComponent, decorators: [{
|
|
3319
|
+
type: Component,
|
|
3320
|
+
args: [{ selector: 'yuw-sidebar-trigger', imports: [HlmSidebarTrigger], host: {
|
|
3321
|
+
class: 'contents',
|
|
3322
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button hlmSidebarTrigger [srOnlyText]=\"label()\"></button>\n" }]
|
|
3323
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
|
|
3324
|
+
|
|
3325
|
+
/**
|
|
3326
|
+
* Outermost layout directive for a sidebar page. Wraps the sidebar and the main content, and owns
|
|
3327
|
+
* the `--sidebar-width` / `--sidebar-width-icon` custom properties via its `sidebarWidth` and
|
|
3328
|
+
* `sidebarWidthIcon` inputs.
|
|
3329
|
+
*
|
|
3330
|
+
* Usage:
|
|
3331
|
+
* ```html
|
|
3332
|
+
* <div yuwSidebarWrapper>
|
|
3333
|
+
* <yuw-sidebar collapsible="icon">
|
|
3334
|
+
* <div yuwSidebarHeader>Yurest</div>
|
|
3335
|
+
* <div yuwSidebarContent>
|
|
3336
|
+
* <div yuwSidebarGroup>
|
|
3337
|
+
* <div yuwSidebarGroupLabel>Gestión</div>
|
|
3338
|
+
* <div yuwSidebarGroupContent>
|
|
3339
|
+
* <ul yuwSidebarMenu>
|
|
3340
|
+
* <li yuwSidebarMenuItem>
|
|
3341
|
+
* <a yuwSidebarMenuButton isActive tooltip="Pedidos">Pedidos</a>
|
|
3342
|
+
* </li>
|
|
3343
|
+
* </ul>
|
|
3344
|
+
* </div>
|
|
3345
|
+
* </div>
|
|
3346
|
+
* </div>
|
|
3347
|
+
* </yuw-sidebar>
|
|
3348
|
+
*
|
|
3349
|
+
* <main yuwSidebarInset>
|
|
3350
|
+
* <button yuw-sidebar-trigger></button>
|
|
3351
|
+
* </main>
|
|
3352
|
+
* </div>
|
|
3353
|
+
* ```
|
|
3354
|
+
*/
|
|
3355
|
+
class YuwSidebarWrapperDirective {
|
|
3356
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarWrapperDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3357
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarWrapperDirective, isStandalone: true, selector: "[yuwSidebarWrapper], yuw-sidebar-wrapper", hostDirectives: [{ directive: i1$m.HlmSidebarWrapper, inputs: ["sidebarWidth", "sidebarWidth", "sidebarWidthIcon", "sidebarWidthIcon"] }], ngImport: i0 }); }
|
|
3358
|
+
}
|
|
3359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarWrapperDirective, decorators: [{
|
|
3360
|
+
type: Directive,
|
|
3361
|
+
args: [{
|
|
3362
|
+
selector: '[yuwSidebarWrapper], yuw-sidebar-wrapper',
|
|
3363
|
+
hostDirectives: [{ directive: HlmSidebarWrapper, inputs: ['sidebarWidth', 'sidebarWidthIcon'] }],
|
|
3364
|
+
}]
|
|
3365
|
+
}] });
|
|
3366
|
+
/** Top area of the sidebar, above the scrollable content. */
|
|
3367
|
+
class YuwSidebarHeaderDirective {
|
|
3368
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3369
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarHeaderDirective, isStandalone: true, selector: "[yuwSidebarHeader], yuw-sidebar-header", hostDirectives: [{ directive: i1$m.HlmSidebarHeader }], ngImport: i0 }); }
|
|
3370
|
+
}
|
|
3371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarHeaderDirective, decorators: [{
|
|
3372
|
+
type: Directive,
|
|
3373
|
+
args: [{
|
|
3374
|
+
selector: '[yuwSidebarHeader], yuw-sidebar-header',
|
|
3375
|
+
hostDirectives: [HlmSidebarHeader],
|
|
3376
|
+
}]
|
|
3377
|
+
}] });
|
|
3378
|
+
/** Scrollable middle area of the sidebar that holds the navigation groups. */
|
|
3379
|
+
class YuwSidebarContentDirective {
|
|
3380
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3381
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarContentDirective, isStandalone: true, selector: "[yuwSidebarContent], yuw-sidebar-content", hostDirectives: [{ directive: i1$m.HlmSidebarContent }], ngImport: i0 }); }
|
|
3382
|
+
}
|
|
3383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarContentDirective, decorators: [{
|
|
3384
|
+
type: Directive,
|
|
3385
|
+
args: [{
|
|
3386
|
+
selector: '[yuwSidebarContent], yuw-sidebar-content',
|
|
3387
|
+
hostDirectives: [HlmSidebarContent],
|
|
3388
|
+
}]
|
|
3389
|
+
}] });
|
|
3390
|
+
/** Bottom area of the sidebar, below the scrollable content. */
|
|
3391
|
+
class YuwSidebarFooterDirective {
|
|
3392
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3393
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarFooterDirective, isStandalone: true, selector: "[yuwSidebarFooter], yuw-sidebar-footer", hostDirectives: [{ directive: i1$m.HlmSidebarFooter }], ngImport: i0 }); }
|
|
3394
|
+
}
|
|
3395
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarFooterDirective, decorators: [{
|
|
3396
|
+
type: Directive,
|
|
3397
|
+
args: [{
|
|
3398
|
+
selector: '[yuwSidebarFooter], yuw-sidebar-footer',
|
|
3399
|
+
hostDirectives: [HlmSidebarFooter],
|
|
3400
|
+
}]
|
|
3401
|
+
}] });
|
|
3402
|
+
/** A titled section of the sidebar. */
|
|
3403
|
+
class YuwSidebarGroupDirective {
|
|
3404
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3405
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarGroupDirective, isStandalone: true, selector: "[yuwSidebarGroup], yuw-sidebar-group", hostDirectives: [{ directive: i1$m.HlmSidebarGroup }], ngImport: i0 }); }
|
|
3406
|
+
}
|
|
3407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarGroupDirective, decorators: [{
|
|
3408
|
+
type: Directive,
|
|
3409
|
+
args: [{
|
|
3410
|
+
selector: '[yuwSidebarGroup], yuw-sidebar-group',
|
|
3411
|
+
hostDirectives: [HlmSidebarGroup],
|
|
3412
|
+
}]
|
|
3413
|
+
}] });
|
|
3414
|
+
/** Heading of a sidebar group. Fades out when the sidebar collapses to icons. */
|
|
3415
|
+
class YuwSidebarGroupLabelDirective {
|
|
3416
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarGroupLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3417
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarGroupLabelDirective, isStandalone: true, selector: "div[yuwSidebarGroupLabel], button[yuwSidebarGroupLabel]", hostDirectives: [{ directive: i1$m.HlmSidebarGroupLabel }], ngImport: i0 }); }
|
|
3418
|
+
}
|
|
3419
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarGroupLabelDirective, decorators: [{
|
|
3420
|
+
type: Directive,
|
|
3421
|
+
args: [{
|
|
3422
|
+
selector: 'div[yuwSidebarGroupLabel], button[yuwSidebarGroupLabel]',
|
|
3423
|
+
hostDirectives: [HlmSidebarGroupLabel],
|
|
3424
|
+
}]
|
|
3425
|
+
}] });
|
|
3426
|
+
/** Body of a sidebar group, wrapping its menu. */
|
|
3427
|
+
class YuwSidebarGroupContentDirective {
|
|
3428
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarGroupContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3429
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarGroupContentDirective, isStandalone: true, selector: "div[yuwSidebarGroupContent]", hostDirectives: [{ directive: i1$m.HlmSidebarGroupContent }], ngImport: i0 }); }
|
|
3430
|
+
}
|
|
3431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarGroupContentDirective, decorators: [{
|
|
3432
|
+
type: Directive,
|
|
3433
|
+
args: [{
|
|
3434
|
+
selector: 'div[yuwSidebarGroupContent]',
|
|
3435
|
+
hostDirectives: [HlmSidebarGroupContent],
|
|
3436
|
+
}]
|
|
3437
|
+
}] });
|
|
3438
|
+
/** Navigation list of a sidebar group. Apply to a `<ul>`. */
|
|
3439
|
+
class YuwSidebarMenuDirective {
|
|
3440
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3441
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarMenuDirective, isStandalone: true, selector: "ul[yuwSidebarMenu]", hostDirectives: [{ directive: i1$m.HlmSidebarMenu }], ngImport: i0 }); }
|
|
3442
|
+
}
|
|
3443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuDirective, decorators: [{
|
|
3444
|
+
type: Directive,
|
|
3445
|
+
args: [{
|
|
3446
|
+
selector: 'ul[yuwSidebarMenu]',
|
|
3447
|
+
hostDirectives: [HlmSidebarMenu],
|
|
3448
|
+
}]
|
|
3449
|
+
}] });
|
|
3450
|
+
/** A single entry of a sidebar menu. Apply to an `<li>`. */
|
|
3451
|
+
class YuwSidebarMenuItemDirective {
|
|
3452
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3453
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarMenuItemDirective, isStandalone: true, selector: "li[yuwSidebarMenuItem]", hostDirectives: [{ directive: i1$m.HlmSidebarMenuItem }], ngImport: i0 }); }
|
|
3454
|
+
}
|
|
3455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuItemDirective, decorators: [{
|
|
3456
|
+
type: Directive,
|
|
3457
|
+
args: [{
|
|
3458
|
+
selector: 'li[yuwSidebarMenuItem]',
|
|
3459
|
+
hostDirectives: [HlmSidebarMenuItem],
|
|
3460
|
+
}]
|
|
3461
|
+
}] });
|
|
3462
|
+
/**
|
|
3463
|
+
* Interactive control of a sidebar menu item. Accepts `variant` (`'default'`, `'outline'`), `size`
|
|
3464
|
+
* (`'default'`, `'sm'`, `'lg'`) and `isActive`.
|
|
3465
|
+
*
|
|
3466
|
+
* To label the item while the sidebar is collapsed to icons, add Spartan's `tooltip` input
|
|
3467
|
+
* alongside this directive — it comes from the underlying menu-button primitive and is only shown
|
|
3468
|
+
* in the collapsed state.
|
|
3469
|
+
*/
|
|
3470
|
+
class YuwSidebarMenuButtonDirective {
|
|
3471
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3472
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarMenuButtonDirective, isStandalone: true, selector: "button[yuwSidebarMenuButton], a[yuwSidebarMenuButton]", hostDirectives: [{ directive: i1$m.HlmSidebarMenuButton, inputs: ["variant", "variant", "size", "size", "isActive", "isActive", "closeMobileSidebarOnClick", "closeMobileSidebarOnClick"] }], ngImport: i0 }); }
|
|
3473
|
+
}
|
|
3474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuButtonDirective, decorators: [{
|
|
3475
|
+
type: Directive,
|
|
3476
|
+
args: [{
|
|
3477
|
+
selector: 'button[yuwSidebarMenuButton], a[yuwSidebarMenuButton]',
|
|
3478
|
+
hostDirectives: [
|
|
3479
|
+
{
|
|
3480
|
+
directive: HlmSidebarMenuButton,
|
|
3481
|
+
inputs: ['variant', 'size', 'isActive', 'closeMobileSidebarOnClick'],
|
|
3482
|
+
},
|
|
3483
|
+
],
|
|
3484
|
+
}]
|
|
3485
|
+
}] });
|
|
3486
|
+
/** Trailing count or status badge of a sidebar menu item. */
|
|
3487
|
+
class YuwSidebarMenuBadgeDirective {
|
|
3488
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuBadgeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3489
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarMenuBadgeDirective, isStandalone: true, selector: "[yuwSidebarMenuBadge], yuw-sidebar-menu-badge", hostDirectives: [{ directive: i1$m.HlmSidebarMenuBadge }], ngImport: i0 }); }
|
|
3490
|
+
}
|
|
3491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuBadgeDirective, decorators: [{
|
|
3492
|
+
type: Directive,
|
|
3493
|
+
args: [{
|
|
3494
|
+
selector: '[yuwSidebarMenuBadge], yuw-sidebar-menu-badge',
|
|
3495
|
+
hostDirectives: [HlmSidebarMenuBadge],
|
|
3496
|
+
}]
|
|
3497
|
+
}] });
|
|
3498
|
+
/** Nested submenu list of a sidebar menu item. Apply to a `<ul>`. */
|
|
3499
|
+
class YuwSidebarMenuSubDirective {
|
|
3500
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuSubDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3501
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarMenuSubDirective, isStandalone: true, selector: "ul[yuwSidebarMenuSub]", hostDirectives: [{ directive: i1$m.HlmSidebarMenuSub }], ngImport: i0 }); }
|
|
3502
|
+
}
|
|
3503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuSubDirective, decorators: [{
|
|
3504
|
+
type: Directive,
|
|
3505
|
+
args: [{
|
|
3506
|
+
selector: 'ul[yuwSidebarMenuSub]',
|
|
3507
|
+
hostDirectives: [HlmSidebarMenuSub],
|
|
3508
|
+
}]
|
|
3509
|
+
}] });
|
|
3510
|
+
/** A single entry of a sidebar submenu. Apply to an `<li>`. */
|
|
3511
|
+
class YuwSidebarMenuSubItemDirective {
|
|
3512
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuSubItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3513
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarMenuSubItemDirective, isStandalone: true, selector: "li[yuwSidebarMenuSubItem]", hostDirectives: [{ directive: i1$m.HlmSidebarMenuSubItem }], ngImport: i0 }); }
|
|
3514
|
+
}
|
|
3515
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuSubItemDirective, decorators: [{
|
|
3516
|
+
type: Directive,
|
|
3517
|
+
args: [{
|
|
3518
|
+
selector: 'li[yuwSidebarMenuSubItem]',
|
|
3519
|
+
hostDirectives: [HlmSidebarMenuSubItem],
|
|
3520
|
+
}]
|
|
3521
|
+
}] });
|
|
3522
|
+
/** Interactive control of a sidebar submenu item. Accepts `size` (`'sm'`, `'md'`) and `isActive`. */
|
|
3523
|
+
class YuwSidebarMenuSubButtonDirective {
|
|
3524
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuSubButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3525
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarMenuSubButtonDirective, isStandalone: true, selector: "a[yuwSidebarMenuSubButton], button[yuwSidebarMenuSubButton]", hostDirectives: [{ directive: i1$m.HlmSidebarMenuSubButton, inputs: ["size", "size", "isActive", "isActive", "closeMobileSidebarOnClick", "closeMobileSidebarOnClick"] }], ngImport: i0 }); }
|
|
3526
|
+
}
|
|
3527
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarMenuSubButtonDirective, decorators: [{
|
|
3528
|
+
type: Directive,
|
|
3529
|
+
args: [{
|
|
3530
|
+
selector: 'a[yuwSidebarMenuSubButton], button[yuwSidebarMenuSubButton]',
|
|
3531
|
+
hostDirectives: [
|
|
3532
|
+
{ directive: HlmSidebarMenuSubButton, inputs: ['size', 'isActive', 'closeMobileSidebarOnClick'] },
|
|
3533
|
+
],
|
|
3534
|
+
}]
|
|
3535
|
+
}] });
|
|
3536
|
+
/** Divider between sidebar sections. */
|
|
3537
|
+
class YuwSidebarSeparatorDirective {
|
|
3538
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarSeparatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3539
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarSeparatorDirective, isStandalone: true, selector: "[yuwSidebarSeparator], yuw-sidebar-separator", hostDirectives: [{ directive: i1$m.HlmSidebarSeparator }], ngImport: i0 }); }
|
|
3540
|
+
}
|
|
3541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarSeparatorDirective, decorators: [{
|
|
3542
|
+
type: Directive,
|
|
3543
|
+
args: [{
|
|
3544
|
+
selector: '[yuwSidebarSeparator], yuw-sidebar-separator',
|
|
3545
|
+
hostDirectives: [HlmSidebarSeparator],
|
|
3546
|
+
}]
|
|
3547
|
+
}] });
|
|
3548
|
+
/** Thin draggable edge that toggles the sidebar. Apply to a `<button>`. */
|
|
3549
|
+
class YuwSidebarRailDirective {
|
|
3550
|
+
constructor() {
|
|
3551
|
+
/**
|
|
3552
|
+
* Accessible label of the rail button (it has no visible text). User-facing text — the
|
|
3553
|
+
* consuming app is responsible for providing it already translated.
|
|
3554
|
+
*/
|
|
3555
|
+
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
3556
|
+
}
|
|
3557
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarRailDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3558
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: YuwSidebarRailDirective, isStandalone: true, selector: "button[yuwSidebarRail]", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "attr.aria-label": "label()" } }, hostDirectives: [{ directive: i1$m.HlmSidebarRail }], ngImport: i0 }); }
|
|
3559
|
+
}
|
|
3560
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarRailDirective, decorators: [{
|
|
3561
|
+
type: Directive,
|
|
3562
|
+
args: [{
|
|
3563
|
+
selector: 'button[yuwSidebarRail]',
|
|
3564
|
+
hostDirectives: [HlmSidebarRail],
|
|
3565
|
+
host: {
|
|
3566
|
+
'[attr.aria-label]': 'label()',
|
|
3567
|
+
},
|
|
3568
|
+
}]
|
|
3569
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
|
|
3570
|
+
/** Main content region beside the sidebar. Apply to a `<main>`. */
|
|
3571
|
+
class YuwSidebarInsetDirective {
|
|
3572
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarInsetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3573
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: YuwSidebarInsetDirective, isStandalone: true, selector: "main[yuwSidebarInset]", hostDirectives: [{ directive: i1$m.HlmSidebarInset }], ngImport: i0 }); }
|
|
3574
|
+
}
|
|
3575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: YuwSidebarInsetDirective, decorators: [{
|
|
3576
|
+
type: Directive,
|
|
3577
|
+
args: [{
|
|
3578
|
+
selector: 'main[yuwSidebarInset]',
|
|
3579
|
+
hostDirectives: [HlmSidebarInset],
|
|
3580
|
+
}]
|
|
3581
|
+
}] });
|
|
3582
|
+
|
|
3583
|
+
/*
|
|
3584
|
+
* Public API Surface of yukit-web
|
|
3585
|
+
*/
|
|
3586
|
+
|
|
3587
|
+
/**
|
|
3588
|
+
* Generated bundle index. Do not edit.
|
|
3589
|
+
*/
|
|
3590
|
+
|
|
3591
|
+
export { YUW_DATATABLE_FEATURES, YUW_PASSWORD_REVEAL_STATES, YuwAccordion, YuwAccordionContentComponent, YuwAccordionImports, YuwAccordionItem, YuwAccordionTriggerComponent, YuwAlertActionDirective, YuwAlertComponent, YuwAlertDescriptionDirective, YuwAlertDialogComponent, YuwAlertDialogMediaDirective, YuwAlertImports, YuwAlertTitleDirective, YuwAttachmentActionDirective, YuwAttachmentActionsDirective, YuwAttachmentContentDirective, YuwAttachmentDescriptionDirective, YuwAttachmentDirective, YuwAttachmentGroupDirective, YuwAttachmentMediaDirective, YuwAttachmentTitleDirective, YuwAttachmentTriggerDirective, YuwAvatarComponent, YuwBadgeComponent, YuwBreadcrumbComponent, YuwButtonComponent, YuwCaptionDirective, YuwCardActionDirective, YuwCardContentDirective, YuwCardDescriptionDirective, YuwCardDirective, YuwCardFooterDirective, YuwCardHeaderDirective, YuwCardImports, YuwCardTitleDirective, YuwCheckboxComponent, YuwComboboxComponent, YuwComboboxItemDirective, YuwContextMenuCheckboxDirective, YuwContextMenuCheckboxIndicatorComponent, YuwContextMenuDirective, YuwContextMenuGroupDirective, YuwContextMenuImports, YuwContextMenuItemDirective, YuwContextMenuLabelDirective, YuwContextMenuRadioDirective, YuwContextMenuRadioIndicatorComponent, YuwContextMenuSeparatorDirective, YuwContextMenuShortcutDirective, YuwContextMenuSubDirective, YuwContextMenuSubIndicatorComponent, YuwContextMenuSubTriggerDirective, YuwContextMenuTriggerDirective, YuwDatatableComponent, YuwDatepickerComponent, YuwDialogComponent, YuwDialogFooterDirective, YuwDialogImports, YuwEmptyContentDirective, YuwEmptyDescriptionDirective, YuwEmptyDirective, YuwEmptyHeaderDirective, YuwEmptyImports, YuwEmptyMediaDirective, YuwEmptyTitleDirective, YuwInputAddonImports, YuwInputComponent, YuwInputOtpComponent, YuwItemActionsDirective, YuwItemContentDirective, YuwItemDescriptionDirective, YuwItemDirective, YuwItemFooterDirective, YuwItemGroupDirective, YuwItemHeaderDirective, YuwItemImports, YuwItemMediaDirective, YuwItemSeparatorDirective, YuwItemTitleDirective, YuwLabel, YuwLeftAddonDirective, YuwPaginationComponent, YuwPasswordInputComponent, YuwPopoverComponent, YuwRadioGroupComponent, YuwRightAddonDirective, YuwSearchInputComponent, YuwSheetComponent, YuwSheetFooterDirective, YuwSheetImports, YuwSidebarComponent, YuwSidebarContentDirective, YuwSidebarFooterDirective, YuwSidebarGroupContentDirective, YuwSidebarGroupDirective, YuwSidebarGroupLabelDirective, YuwSidebarHeaderDirective, YuwSidebarInsetDirective, YuwSidebarMenuBadgeDirective, YuwSidebarMenuButtonDirective, YuwSidebarMenuDirective, YuwSidebarMenuItemDirective, YuwSidebarMenuSubButtonDirective, YuwSidebarMenuSubDirective, YuwSidebarMenuSubItemDirective, YuwSidebarRailDirective, YuwSidebarSeparatorDirective, YuwSidebarTriggerComponent, YuwSidebarWrapperDirective, YuwSkeletonDirective, YuwSpinnerComponent, YuwSwitchComponent, YuwTBodyDirective, YuwTFootDirective, YuwTHeadDirective, YuwTabPanelDirective, YuwTableContainerDirective, YuwTableDirective, YuwTableImports, YuwTabsComponent, YuwTdDirective, YuwTextareaComponent, YuwThDirective, YuwToasterComponent, YuwTooltipDirective, YuwTrDirective, YuwValueAccessorBase, buildInputOtpGroups, cn, getPaginationRange, provideValueAccessor, totalInputOtpLength };
|
|
3592
|
+
//# sourceMappingURL=yukit-web.mjs.map
|