@tailng-ui/components 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/package.json +14 -0
- package/src/index.d.ts +7 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +7 -0
- package/src/index.js.map +1 -0
- package/src/lib/feedback/empty/tng-empty.component.d.ts +14 -0
- package/src/lib/feedback/empty/tng-empty.component.d.ts.map +1 -0
- package/src/lib/feedback/empty/tng-empty.component.js +60 -0
- package/src/lib/feedback/empty/tng-empty.component.js.map +1 -0
- package/src/lib/feedback/index.d.ts +11 -0
- package/src/lib/feedback/index.d.ts.map +1 -0
- package/src/lib/feedback/index.js +11 -0
- package/src/lib/feedback/index.js.map +1 -0
- package/src/lib/feedback/progress-bar/tng-progress-bar.component.d.ts +10 -0
- package/src/lib/feedback/progress-bar/tng-progress-bar.component.d.ts.map +1 -0
- package/src/lib/feedback/progress-bar/tng-progress-bar.component.js +37 -0
- package/src/lib/feedback/progress-bar/tng-progress-bar.component.js.map +1 -0
- package/src/lib/feedback/progress-spinner/tng-progress-spinner.component.d.ts +14 -0
- package/src/lib/feedback/progress-spinner/tng-progress-spinner.component.d.ts.map +1 -0
- package/src/lib/feedback/progress-spinner/tng-progress-spinner.component.js +55 -0
- package/src/lib/feedback/progress-spinner/tng-progress-spinner.component.js.map +1 -0
- package/src/lib/feedback/skeleton/tng-skeleton.component.d.ts +10 -0
- package/src/lib/feedback/skeleton/tng-skeleton.component.d.ts.map +1 -0
- package/src/lib/feedback/skeleton/tng-skeleton.component.js +33 -0
- package/src/lib/feedback/skeleton/tng-skeleton.component.js.map +1 -0
- package/src/lib/feedback/toast/tng-toast.component.d.ts +40 -0
- package/src/lib/feedback/toast/tng-toast.component.d.ts.map +1 -0
- package/src/lib/feedback/toast/tng-toast.component.js +111 -0
- package/src/lib/feedback/toast/tng-toast.component.js.map +1 -0
- package/src/lib/form/autocomplete/tng-autocomplete.component.d.ts +26 -0
- package/src/lib/form/autocomplete/tng-autocomplete.component.d.ts.map +1 -0
- package/src/lib/form/autocomplete/tng-autocomplete.component.js +104 -0
- package/src/lib/form/autocomplete/tng-autocomplete.component.js.map +1 -0
- package/src/lib/form/button-toggle/tng-button-toggle-group.component.d.ts +44 -0
- package/src/lib/form/button-toggle/tng-button-toggle-group.component.d.ts.map +1 -0
- package/src/lib/form/button-toggle/tng-button-toggle-group.component.js +123 -0
- package/src/lib/form/button-toggle/tng-button-toggle-group.component.js.map +1 -0
- package/src/lib/form/button-toggle/tng-button-toggle.component.d.ts +14 -0
- package/src/lib/form/button-toggle/tng-button-toggle.component.d.ts.map +1 -0
- package/src/lib/form/button-toggle/tng-button-toggle.component.js +65 -0
- package/src/lib/form/button-toggle/tng-button-toggle.component.js.map +1 -0
- package/src/lib/form/checkbox/tng-checkbox.component.d.ts +38 -0
- package/src/lib/form/checkbox/tng-checkbox.component.d.ts.map +1 -0
- package/src/lib/form/checkbox/tng-checkbox.component.js +138 -0
- package/src/lib/form/checkbox/tng-checkbox.component.js.map +1 -0
- package/src/lib/form/chips/tng-chips.component.d.ts +4 -0
- package/src/lib/form/chips/tng-chips.component.d.ts.map +1 -0
- package/src/lib/form/chips/tng-chips.component.js +16 -0
- package/src/lib/form/chips/tng-chips.component.js.map +1 -0
- package/src/lib/form/combobox/tng-combobox.component.d.ts +4 -0
- package/src/lib/form/combobox/tng-combobox.component.d.ts.map +1 -0
- package/src/lib/form/combobox/tng-combobox.component.js +16 -0
- package/src/lib/form/combobox/tng-combobox.component.js.map +1 -0
- package/src/lib/form/index.d.ts +37 -0
- package/src/lib/form/index.d.ts.map +1 -0
- package/src/lib/form/index.js +37 -0
- package/src/lib/form/index.js.map +1 -0
- package/src/lib/form/input/tng-input.component.d.ts +16 -0
- package/src/lib/form/input/tng-input.component.d.ts.map +1 -0
- package/src/lib/form/input/tng-input.component.js +52 -0
- package/src/lib/form/input/tng-input.component.js.map +1 -0
- package/src/lib/form/input-otp/tng-input-otp.component.d.ts +13 -0
- package/src/lib/form/input-otp/tng-input-otp.component.d.ts.map +1 -0
- package/src/lib/form/input-otp/tng-input-otp.component.js +138 -0
- package/src/lib/form/input-otp/tng-input-otp.component.js.map +1 -0
- package/src/lib/form/label/tng-label.component.d.ts +8 -0
- package/src/lib/form/label/tng-label.component.d.ts.map +1 -0
- package/src/lib/form/label/tng-label.component.js +29 -0
- package/src/lib/form/label/tng-label.component.js.map +1 -0
- package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.component.d.ts +55 -0
- package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.component.d.ts.map +1 -0
- package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.component.js +126 -0
- package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.component.js.map +1 -0
- package/src/lib/form/multiselect/tng-multiselect.component.d.ts +49 -0
- package/src/lib/form/multiselect/tng-multiselect.component.d.ts.map +1 -0
- package/src/lib/form/multiselect/tng-multiselect.component.js +112 -0
- package/src/lib/form/multiselect/tng-multiselect.component.js.map +1 -0
- package/src/lib/form/radio/tng-radio.component.d.ts +12 -0
- package/src/lib/form/radio/tng-radio.component.d.ts.map +1 -0
- package/src/lib/form/radio/tng-radio.component.js +45 -0
- package/src/lib/form/radio/tng-radio.component.js.map +1 -0
- package/src/lib/form/select/tng-select.component.d.ts +40 -0
- package/src/lib/form/select/tng-select.component.d.ts.map +1 -0
- package/src/lib/form/select/tng-select.component.js +98 -0
- package/src/lib/form/select/tng-select.component.js.map +1 -0
- package/src/lib/form/select/tng-select.slots.d.ts +25 -0
- package/src/lib/form/select/tng-select.slots.d.ts.map +1 -0
- package/src/lib/form/select/tng-select.slots.js +23 -0
- package/src/lib/form/select/tng-select.slots.js.map +1 -0
- package/src/lib/form/slider/tng-slider.component.d.ts +11 -0
- package/src/lib/form/slider/tng-slider.component.d.ts.map +1 -0
- package/src/lib/form/slider/tng-slider.component.js +48 -0
- package/src/lib/form/slider/tng-slider.component.js.map +1 -0
- package/src/lib/form/switch/tng-switch.component.d.ts +18 -0
- package/src/lib/form/switch/tng-switch.component.d.ts.map +1 -0
- package/src/lib/form/switch/tng-switch.component.js +57 -0
- package/src/lib/form/switch/tng-switch.component.js.map +1 -0
- package/src/lib/form/textarea/tng-textarea.component.d.ts +17 -0
- package/src/lib/form/textarea/tng-textarea.component.d.ts.map +1 -0
- package/src/lib/form/textarea/tng-textarea.component.js +54 -0
- package/src/lib/form/textarea/tng-textarea.component.js.map +1 -0
- package/src/lib/form/toggle/tng-toggle.component.d.ts +39 -0
- package/src/lib/form/toggle/tng-toggle.component.d.ts.map +1 -0
- package/src/lib/form/toggle/tng-toggle.component.js +152 -0
- package/src/lib/form/toggle/tng-toggle.component.js.map +1 -0
- package/src/lib/form/toggle-group/tng-toggle-group.component.d.ts +3 -0
- package/src/lib/form/toggle-group/tng-toggle-group.component.d.ts.map +1 -0
- package/src/lib/form/toggle-group/tng-toggle-group.component.js +34 -0
- package/src/lib/form/toggle-group/tng-toggle-group.component.js.map +1 -0
- package/src/lib/layout/accordion/tng-accordion.component.d.ts +11 -0
- package/src/lib/layout/accordion/tng-accordion.component.d.ts.map +1 -0
- package/src/lib/layout/accordion/tng-accordion.component.js +158 -0
- package/src/lib/layout/accordion/tng-accordion.component.js.map +1 -0
- package/src/lib/layout/bottom-sheet/tng-bottom-sheet.component.d.ts +4 -0
- package/src/lib/layout/bottom-sheet/tng-bottom-sheet.component.d.ts.map +1 -0
- package/src/lib/layout/bottom-sheet/tng-bottom-sheet.component.js +16 -0
- package/src/lib/layout/bottom-sheet/tng-bottom-sheet.component.js.map +1 -0
- package/src/lib/layout/card/tng-card.component.d.ts +42 -0
- package/src/lib/layout/card/tng-card.component.d.ts.map +1 -0
- package/src/lib/layout/card/tng-card.component.js +186 -0
- package/src/lib/layout/card/tng-card.component.js.map +1 -0
- package/src/lib/layout/collapsible/tng-collapsible.component.d.ts +11 -0
- package/src/lib/layout/collapsible/tng-collapsible.component.d.ts.map +1 -0
- package/src/lib/layout/collapsible/tng-collapsible.component.js +40 -0
- package/src/lib/layout/collapsible/tng-collapsible.component.js.map +1 -0
- package/src/lib/layout/drawer/tng-drawer.component.d.ts +12 -0
- package/src/lib/layout/drawer/tng-drawer.component.d.ts.map +1 -0
- package/src/lib/layout/drawer/tng-drawer.component.js +77 -0
- package/src/lib/layout/drawer/tng-drawer.component.js.map +1 -0
- package/src/lib/layout/grid/tng-grid.component.d.ts +4 -0
- package/src/lib/layout/grid/tng-grid.component.d.ts.map +1 -0
- package/src/lib/layout/grid/tng-grid.component.js +16 -0
- package/src/lib/layout/grid/tng-grid.component.js.map +1 -0
- package/src/lib/layout/index.d.ts +16 -0
- package/src/lib/layout/index.d.ts.map +1 -0
- package/src/lib/layout/index.js +16 -0
- package/src/lib/layout/index.js.map +1 -0
- package/src/lib/layout/separator/tng-separator.component.d.ts +6 -0
- package/src/lib/layout/separator/tng-separator.component.d.ts.map +1 -0
- package/src/lib/layout/separator/tng-separator.component.js +19 -0
- package/src/lib/layout/separator/tng-separator.component.js.map +1 -0
- package/src/lib/layout/stepper/tng-stepper.component.d.ts +4 -0
- package/src/lib/layout/stepper/tng-stepper.component.d.ts.map +1 -0
- package/src/lib/layout/stepper/tng-stepper.component.js +16 -0
- package/src/lib/layout/stepper/tng-stepper.component.js.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-item.component.d.ts +28 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-item.component.d.ts.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-item.component.js +86 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-item.component.js.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-link.component.d.ts +10 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-link.component.d.ts.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-link.component.js +29 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-link.component.js.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-list.component.d.ts +3 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-list.component.d.ts.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-list.component.js +15 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-list.component.js.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-separator-template.directive.d.ts +6 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-separator-template.directive.d.ts.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-separator-template.directive.js +16 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-separator-template.directive.js.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-separator.component.d.ts +6 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-separator.component.d.ts.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-separator.component.js +18 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb-separator.component.js.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb.component.d.ts +23 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb.component.d.ts.map +1 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb.component.js +155 -0
- package/src/lib/navigation/breadcrumb/tng-breadcrumb.component.js.map +1 -0
- package/src/lib/navigation/context-menu/tng-context-menu.component.d.ts +4 -0
- package/src/lib/navigation/context-menu/tng-context-menu.component.d.ts.map +1 -0
- package/src/lib/navigation/context-menu/tng-context-menu.component.js +16 -0
- package/src/lib/navigation/context-menu/tng-context-menu.component.js.map +1 -0
- package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.component.d.ts +10 -0
- package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.component.d.ts.map +1 -0
- package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.component.js +54 -0
- package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.component.js.map +1 -0
- package/src/lib/navigation/index.d.ts +27 -0
- package/src/lib/navigation/index.d.ts.map +1 -0
- package/src/lib/navigation/index.js +27 -0
- package/src/lib/navigation/index.js.map +1 -0
- package/src/lib/navigation/menu/tng-menu-trigger-for.directive.d.ts +15 -0
- package/src/lib/navigation/menu/tng-menu-trigger-for.directive.d.ts.map +1 -0
- package/src/lib/navigation/menu/tng-menu-trigger-for.directive.js +85 -0
- package/src/lib/navigation/menu/tng-menu-trigger-for.directive.js.map +1 -0
- package/src/lib/navigation/menu/tng-menu.component.d.ts +13 -0
- package/src/lib/navigation/menu/tng-menu.component.d.ts.map +1 -0
- package/src/lib/navigation/menu/tng-menu.component.js +92 -0
- package/src/lib/navigation/menu/tng-menu.component.js.map +1 -0
- package/src/lib/navigation/menubar/tng-menubar.component.d.ts +5 -0
- package/src/lib/navigation/menubar/tng-menubar.component.d.ts.map +1 -0
- package/src/lib/navigation/menubar/tng-menubar.component.js +29 -0
- package/src/lib/navigation/menubar/tng-menubar.component.js.map +1 -0
- package/src/lib/navigation/navigation-menu/tng-navigation-menu.component.d.ts +4 -0
- package/src/lib/navigation/navigation-menu/tng-navigation-menu.component.d.ts.map +1 -0
- package/src/lib/navigation/navigation-menu/tng-navigation-menu.component.js +16 -0
- package/src/lib/navigation/navigation-menu/tng-navigation-menu.component.js.map +1 -0
- package/src/lib/navigation/tabs/tng-tabs.component.d.ts +5 -0
- package/src/lib/navigation/tabs/tng-tabs.component.d.ts.map +1 -0
- package/src/lib/navigation/tabs/tng-tabs.component.js +41 -0
- package/src/lib/navigation/tabs/tng-tabs.component.js.map +1 -0
- package/src/lib/navigation/toolbar/tng-toolbar.component.d.ts +4 -0
- package/src/lib/navigation/toolbar/tng-toolbar.component.d.ts.map +1 -0
- package/src/lib/navigation/toolbar/tng-toolbar.component.js +16 -0
- package/src/lib/navigation/toolbar/tng-toolbar.component.js.map +1 -0
- package/src/lib/overlay/dialog/tng-dialog.component.d.ts +43 -0
- package/src/lib/overlay/dialog/tng-dialog.component.d.ts.map +1 -0
- package/src/lib/overlay/dialog/tng-dialog.component.js +286 -0
- package/src/lib/overlay/dialog/tng-dialog.component.js.map +1 -0
- package/src/lib/overlay/index.d.ts +7 -0
- package/src/lib/overlay/index.d.ts.map +1 -0
- package/src/lib/overlay/index.js +7 -0
- package/src/lib/overlay/index.js.map +1 -0
- package/src/lib/overlay/popover/tng-popover.component.d.ts +28 -0
- package/src/lib/overlay/popover/tng-popover.component.d.ts.map +1 -0
- package/src/lib/overlay/popover/tng-popover.component.js +133 -0
- package/src/lib/overlay/popover/tng-popover.component.js.map +1 -0
- package/src/lib/overlay/tng-overlay-runtime.d.ts +11 -0
- package/src/lib/overlay/tng-overlay-runtime.d.ts.map +1 -0
- package/src/lib/overlay/tng-overlay-runtime.js +11 -0
- package/src/lib/overlay/tng-overlay-runtime.js.map +1 -0
- package/src/lib/overlay/tooltip/tng-tooltip.component.d.ts +31 -0
- package/src/lib/overlay/tooltip/tng-tooltip.component.d.ts.map +1 -0
- package/src/lib/overlay/tooltip/tng-tooltip.component.js +111 -0
- package/src/lib/overlay/tooltip/tng-tooltip.component.js.map +1 -0
- package/src/lib/utility/avatar/tng-avatar.component.d.ts +19 -0
- package/src/lib/utility/avatar/tng-avatar.component.d.ts.map +1 -0
- package/src/lib/utility/avatar/tng-avatar.component.js +66 -0
- package/src/lib/utility/avatar/tng-avatar.component.js.map +1 -0
- package/src/lib/utility/badge/tng-badge.component.d.ts +4 -0
- package/src/lib/utility/badge/tng-badge.component.d.ts.map +1 -0
- package/src/lib/utility/badge/tng-badge.component.js +13 -0
- package/src/lib/utility/badge/tng-badge.component.js.map +1 -0
- package/src/lib/utility/button/tng-button.component.d.ts +18 -0
- package/src/lib/utility/button/tng-button.component.d.ts.map +1 -0
- package/src/lib/utility/button/tng-button.component.js +32 -0
- package/src/lib/utility/button/tng-button.component.js.map +1 -0
- package/src/lib/utility/code-block/highlighting.d.ts +96 -0
- package/src/lib/utility/code-block/highlighting.d.ts.map +1 -0
- package/src/lib/utility/code-block/highlighting.js +220 -0
- package/src/lib/utility/code-block/highlighting.js.map +1 -0
- package/src/lib/utility/code-block/tng-code-block.component.d.ts +118 -0
- package/src/lib/utility/code-block/tng-code-block.component.d.ts.map +1 -0
- package/src/lib/utility/code-block/tng-code-block.component.js +586 -0
- package/src/lib/utility/code-block/tng-code-block.component.js.map +1 -0
- package/src/lib/utility/copy-button/tng-copy-button.component.d.ts +39 -0
- package/src/lib/utility/copy-button/tng-copy-button.component.d.ts.map +1 -0
- package/src/lib/utility/copy-button/tng-copy-button.component.js +127 -0
- package/src/lib/utility/copy-button/tng-copy-button.component.js.map +1 -0
- package/src/lib/utility/index.d.ts +17 -0
- package/src/lib/utility/index.d.ts.map +1 -0
- package/src/lib/utility/index.js +16 -0
- package/src/lib/utility/index.js.map +1 -0
- package/src/lib/utility/tag/tng-tag.component.d.ts +10 -0
- package/src/lib/utility/tag/tng-tag.component.d.ts.map +1 -0
- package/src/lib/utility/tag/tng-tag.component.js +18 -0
- package/src/lib/utility/tag/tng-tag.component.js.map +1 -0
- package/src/lib/utility/tree/tng-tree.component.d.ts +72 -0
- package/src/lib/utility/tree/tng-tree.component.d.ts.map +1 -0
- package/src/lib/utility/tree/tng-tree.component.js +336 -0
- package/src/lib/utility/tree/tng-tree.component.js.map +1 -0
- package/src/test-setup.d.ts +3 -0
- package/src/test-setup.d.ts.map +1 -0
- package/src/test-setup.js +10 -0
- package/src/test-setup.js.map +1 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
3
|
+
import { booleanAttribute, Component, input, signal } from '@angular/core';
|
|
4
|
+
import { RouterLink } from '@angular/router';
|
|
5
|
+
import { TngBreadcrumbItem as TngBreadcrumbItemPrimitive, TngBreadcrumbLink as TngBreadcrumbLinkPrimitive, } from '@tailng-ui/primitives';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import { TngBreadcrumbSeparatorComponent } from './tng-breadcrumb-separator.component';
|
|
8
|
+
let TngBreadcrumbItemComponent = class TngBreadcrumbItemComponent {
|
|
9
|
+
stateChanges = new Subject();
|
|
10
|
+
current = input(false, { transform: booleanAttribute });
|
|
11
|
+
currentAsLink = input(false, { transform: booleanAttribute });
|
|
12
|
+
disabled = input(false, { transform: booleanAttribute });
|
|
13
|
+
href = input(null);
|
|
14
|
+
routerLink = input(null);
|
|
15
|
+
displayMode = signal('visible');
|
|
16
|
+
collapseLabel = signal('More');
|
|
17
|
+
isResolvedCurrent = signal(false);
|
|
18
|
+
separator = signal('/');
|
|
19
|
+
separatorTemplate = signal(null);
|
|
20
|
+
showSeparator = signal(false);
|
|
21
|
+
constructor() {
|
|
22
|
+
this.current();
|
|
23
|
+
this.currentAsLink();
|
|
24
|
+
this.disabled();
|
|
25
|
+
this.href();
|
|
26
|
+
this.routerLink();
|
|
27
|
+
queueMicrotask(() => this.stateChanges.next());
|
|
28
|
+
}
|
|
29
|
+
ngOnChanges() {
|
|
30
|
+
this.stateChanges.next();
|
|
31
|
+
}
|
|
32
|
+
ngOnDestroy() {
|
|
33
|
+
this.stateChanges.complete();
|
|
34
|
+
}
|
|
35
|
+
setDisplayMode(mode, collapseLabel) {
|
|
36
|
+
this.displayMode.set(mode);
|
|
37
|
+
this.collapseLabel.set(collapseLabel);
|
|
38
|
+
}
|
|
39
|
+
setResolvedCurrent(value) {
|
|
40
|
+
this.isResolvedCurrent.set(value);
|
|
41
|
+
}
|
|
42
|
+
setSeparator(separator, showSeparator, separatorTemplate) {
|
|
43
|
+
this.separator.set(separator);
|
|
44
|
+
this.showSeparator.set(showSeparator);
|
|
45
|
+
this.separatorTemplate.set(separatorTemplate);
|
|
46
|
+
}
|
|
47
|
+
shouldRenderLink() {
|
|
48
|
+
const hasExplicitTarget = this.hasHrefLink() || this.hasRouterLink();
|
|
49
|
+
if (!hasExplicitTarget) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
if (!this.isResolvedCurrent()) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
return this.currentAsLink();
|
|
56
|
+
}
|
|
57
|
+
hasHrefLink() {
|
|
58
|
+
return this.href() !== null;
|
|
59
|
+
}
|
|
60
|
+
hasRouterLink() {
|
|
61
|
+
return this.routerLink() !== null;
|
|
62
|
+
}
|
|
63
|
+
onLinkClick(event) {
|
|
64
|
+
if (!this.disabled()) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
event.stopImmediatePropagation();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
TngBreadcrumbItemComponent = __decorate([
|
|
72
|
+
Component({
|
|
73
|
+
selector: 'tng-breadcrumb-item',
|
|
74
|
+
imports: [
|
|
75
|
+
RouterLink,
|
|
76
|
+
NgTemplateOutlet,
|
|
77
|
+
TngBreadcrumbItemPrimitive,
|
|
78
|
+
TngBreadcrumbLinkPrimitive,
|
|
79
|
+
TngBreadcrumbSeparatorComponent,
|
|
80
|
+
],
|
|
81
|
+
templateUrl: './tng-breadcrumb-item.component.html',
|
|
82
|
+
styleUrl: './tng-breadcrumb-item.component.css',
|
|
83
|
+
})
|
|
84
|
+
], TngBreadcrumbItemComponent);
|
|
85
|
+
export { TngBreadcrumbItemComponent };
|
|
86
|
+
//# sourceMappingURL=tng-breadcrumb-item.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb-item.component.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb-item.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAoB,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,iBAAiB,IAAI,0BAA0B,EAC/C,iBAAiB,IAAI,0BA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,CAAC,wBAAwB,EAAE,CAAC;IACnC,CAAC;CACF,CAAA;AAhFY,0BAA0B;IAZtC,SAAS,CAAC;QACT,QAAQ,EAAE,qBAAqB;QAC/B,OAAO,EAAE;YACP,UAAU;YACV,gBAAgB;YAChB,0BAA0B;YAC1B,0BAA0B;YAC1B,+BAA+B;SAChC;QACD,WAAW,EAAE,sCAAsC;QACnD,QAAQ,EAAE,qCAAqC;KAChD,CAAC;GACW,0BAA0B,CAgFtC","sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport { booleanAttribute, Component, input, signal, type TemplateRef } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport {\n TngBreadcrumbItem as TngBreadcrumbItemPrimitive,\n TngBreadcrumbLink as TngBreadcrumbLinkPrimitive,\n} from '@tailng-ui/primitives';\nimport { Subject } from 'rxjs';\nimport { TngBreadcrumbSeparatorComponent } from './tng-breadcrumb-separator.component';\n\nexport type TngBreadcrumbItemDisplayMode = 'ellipsis' | 'hidden' | 'visible';\n\n@Component({\n selector: 'tng-breadcrumb-item',\n imports: [\n RouterLink,\n NgTemplateOutlet,\n TngBreadcrumbItemPrimitive,\n TngBreadcrumbLinkPrimitive,\n TngBreadcrumbSeparatorComponent,\n ],\n templateUrl: './tng-breadcrumb-item.component.html',\n styleUrl: './tng-breadcrumb-item.component.css',\n})\nexport class TngBreadcrumbItemComponent {\n public readonly stateChanges = new Subject<void>();\n public readonly current = input(false, { transform: booleanAttribute });\n public readonly currentAsLink = input(false, { transform: booleanAttribute });\n public readonly disabled = input(false, { transform: booleanAttribute });\n public readonly href = input<string | null>(null);\n public readonly routerLink = input<string | readonly (number | string)[] | null>(null);\n\n protected readonly displayMode = signal<TngBreadcrumbItemDisplayMode>('visible');\n protected readonly collapseLabel = signal('More');\n protected readonly isResolvedCurrent = signal(false);\n protected readonly separator = signal('/');\n protected readonly separatorTemplate = signal<TemplateRef<unknown> | null>(null);\n protected readonly showSeparator = signal(false);\n\n public constructor() {\n this.current();\n this.currentAsLink();\n this.disabled();\n this.href();\n this.routerLink();\n queueMicrotask(() => this.stateChanges.next());\n }\n\n public ngOnChanges(): void {\n this.stateChanges.next();\n }\n\n public ngOnDestroy(): void {\n this.stateChanges.complete();\n }\n\n public setDisplayMode(mode: TngBreadcrumbItemDisplayMode, collapseLabel: string): void {\n this.displayMode.set(mode);\n this.collapseLabel.set(collapseLabel);\n }\n\n public setResolvedCurrent(value: boolean): void {\n this.isResolvedCurrent.set(value);\n }\n\n public setSeparator(\n separator: string,\n showSeparator: boolean,\n separatorTemplate: TemplateRef<unknown> | null,\n ): void {\n this.separator.set(separator);\n this.showSeparator.set(showSeparator);\n this.separatorTemplate.set(separatorTemplate);\n }\n\n protected shouldRenderLink(): boolean {\n const hasExplicitTarget = this.hasHrefLink() || this.hasRouterLink();\n if (!hasExplicitTarget) {\n return false;\n }\n\n if (!this.isResolvedCurrent()) {\n return true;\n }\n\n return this.currentAsLink();\n }\n\n protected hasHrefLink(): boolean {\n return this.href() !== null;\n }\n\n protected hasRouterLink(): boolean {\n return this.routerLink() !== null;\n }\n\n protected onLinkClick(event: MouseEvent): void {\n if (!this.disabled()) {\n return;\n }\n\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class TngBreadcrumbLinkComponent {
|
|
2
|
+
readonly current: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
3
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
4
|
+
readonly href: import("@angular/core").InputSignal<string | null>;
|
|
5
|
+
readonly rel: import("@angular/core").InputSignal<string | null>;
|
|
6
|
+
readonly routerLink: import("@angular/core").InputSignal<string | readonly (string | number)[] | null>;
|
|
7
|
+
readonly target: import("@angular/core").InputSignal<string | null>;
|
|
8
|
+
protected onClick(event: MouseEvent): void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=tng-breadcrumb-link.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb-link.component.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb-link.component.ts"],"names":[],"mappings":"AAIA,qBAMa,0BAA0B;IACrC,SAAgB,OAAO,qEAAiD;IACxE,SAAgB,QAAQ,qEAAiD;IACzE,SAAgB,IAAI,qDAA8B;IAClD,SAAgB,GAAG,qDAA8B;IACjD,SAAgB,UAAU,oFAA6D;IACvF,SAAgB,MAAM,qDAA8B;IAEpD,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;CAQ3C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { booleanAttribute, Component, input } from '@angular/core';
|
|
3
|
+
import { RouterLink } from '@angular/router';
|
|
4
|
+
import { TngBreadcrumbLink as TngBreadcrumbLinkPrimitive } from '@tailng-ui/primitives';
|
|
5
|
+
let TngBreadcrumbLinkComponent = class TngBreadcrumbLinkComponent {
|
|
6
|
+
current = input(false, { transform: booleanAttribute });
|
|
7
|
+
disabled = input(false, { transform: booleanAttribute });
|
|
8
|
+
href = input(null);
|
|
9
|
+
rel = input(null);
|
|
10
|
+
routerLink = input(null);
|
|
11
|
+
target = input(null);
|
|
12
|
+
onClick(event) {
|
|
13
|
+
if (!this.disabled()) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
event.preventDefault();
|
|
17
|
+
event.stopImmediatePropagation();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
TngBreadcrumbLinkComponent = __decorate([
|
|
21
|
+
Component({
|
|
22
|
+
selector: 'tng-breadcrumb-link',
|
|
23
|
+
imports: [RouterLink, TngBreadcrumbLinkPrimitive],
|
|
24
|
+
templateUrl: './tng-breadcrumb-link.component.html',
|
|
25
|
+
styleUrl: './tng-breadcrumb-link.component.css',
|
|
26
|
+
})
|
|
27
|
+
], TngBreadcrumbLinkComponent);
|
|
28
|
+
export { TngBreadcrumbLinkComponent };
|
|
29
|
+
//# sourceMappingURL=tng-breadcrumb-link.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb-link.component.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb-link.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,IAAI,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAQjF,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrB,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACxD,QAAQ,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACzD,IAAI,GAAG,KAAK,CAAgB,IAAI,CAAC,CAAC;IAClC,GAAG,GAAG,KAAK,CAAgB,IAAI,CAAC,CAAC;IACjC,UAAU,GAAG,KAAK,CAA+C,IAAI,CAAC,CAAC;IACvE,MAAM,GAAG,KAAK,CAAgB,IAAI,CAAC,CAAC;IAE1C,OAAO,CAAC,KAAiB;QACjC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;YACrB,OAAO;QACT,CAAC;QAED,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,wBAAwB,EAAE,CAAC;IACnC,CAAC;CACF,CAAA;AAhBY,0BAA0B;IANtC,SAAS,CAAC;QACT,QAAQ,EAAE,qBAAqB;QAC/B,OAAO,EAAE,CAAC,UAAU,EAAE,0BAA0B,CAAC;QACjD,WAAW,EAAE,sCAAsC;QACnD,QAAQ,EAAE,qCAAqC;KAChD,CAAC;GACW,0BAA0B,CAgBtC","sourcesContent":["import { booleanAttribute, Component, input } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { TngBreadcrumbLink as TngBreadcrumbLinkPrimitive } from '@tailng-ui/primitives';\n\n@Component({\n selector: 'tng-breadcrumb-link',\n imports: [RouterLink, TngBreadcrumbLinkPrimitive],\n templateUrl: './tng-breadcrumb-link.component.html',\n styleUrl: './tng-breadcrumb-link.component.css',\n})\nexport class TngBreadcrumbLinkComponent {\n public readonly current = input(false, { transform: booleanAttribute });\n public readonly disabled = input(false, { transform: booleanAttribute });\n public readonly href = input<string | null>(null);\n public readonly rel = input<string | null>(null);\n public readonly routerLink = input<string | readonly (number | string)[] | null>(null);\n public readonly target = input<string | null>(null);\n\n protected onClick(event: MouseEvent): void {\n if (!this.disabled()) {\n return;\n }\n\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb-list.component.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb-list.component.ts"],"names":[],"mappings":"AAGA,qBAMa,0BAA0B;CAAG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
import { TngBreadcrumbList as TngBreadcrumbListPrimitive } from '@tailng-ui/primitives';
|
|
4
|
+
let TngBreadcrumbListComponent = class TngBreadcrumbListComponent {
|
|
5
|
+
};
|
|
6
|
+
TngBreadcrumbListComponent = __decorate([
|
|
7
|
+
Component({
|
|
8
|
+
selector: 'tng-breadcrumb-list',
|
|
9
|
+
imports: [TngBreadcrumbListPrimitive],
|
|
10
|
+
templateUrl: './tng-breadcrumb-list.component.html',
|
|
11
|
+
styleUrl: './tng-breadcrumb-list.component.css',
|
|
12
|
+
})
|
|
13
|
+
], TngBreadcrumbListComponent);
|
|
14
|
+
export { TngBreadcrumbListComponent };
|
|
15
|
+
//# sourceMappingURL=tng-breadcrumb-list.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb-list.component.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb-list.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,iBAAiB,IAAI,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAQjF,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;CAAG,CAAA;AAA7B,0BAA0B;IANtC,SAAS,CAAC;QACT,QAAQ,EAAE,qBAAqB;QAC/B,OAAO,EAAE,CAAC,0BAA0B,CAAC;QACrC,WAAW,EAAE,sCAAsC;QACnD,QAAQ,EAAE,qCAAqC;KAChD,CAAC;GACW,0BAA0B,CAAG","sourcesContent":["import { Component } from '@angular/core';\nimport { TngBreadcrumbList as TngBreadcrumbListPrimitive } from '@tailng-ui/primitives';\n\n@Component({\n selector: 'tng-breadcrumb-list',\n imports: [TngBreadcrumbListPrimitive],\n templateUrl: './tng-breadcrumb-list.component.html',\n styleUrl: './tng-breadcrumb-list.component.css',\n})\nexport class TngBreadcrumbListComponent {}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
export declare class TngBreadcrumbSeparatorTemplateDirective {
|
|
3
|
+
readonly templateRef: TemplateRef<unknown>;
|
|
4
|
+
constructor(templateRef: TemplateRef<unknown>);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=tng-breadcrumb-separator-template.directive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb-separator-template.directive.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb-separator-template.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,eAAe,CAAC;AAEvD,qBAIa,uCAAuC;aACf,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC;gBAAjC,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC;CACrE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Directive } from '@angular/core';
|
|
3
|
+
let TngBreadcrumbSeparatorTemplateDirective = class TngBreadcrumbSeparatorTemplateDirective {
|
|
4
|
+
templateRef;
|
|
5
|
+
constructor(templateRef) {
|
|
6
|
+
this.templateRef = templateRef;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
TngBreadcrumbSeparatorTemplateDirective = __decorate([
|
|
10
|
+
Directive({
|
|
11
|
+
selector: 'ng-template[tngBreadcrumbSeparatorTemplate]',
|
|
12
|
+
exportAs: 'tngBreadcrumbSeparatorTemplate',
|
|
13
|
+
})
|
|
14
|
+
], TngBreadcrumbSeparatorTemplateDirective);
|
|
15
|
+
export { TngBreadcrumbSeparatorTemplateDirective };
|
|
16
|
+
//# sourceMappingURL=tng-breadcrumb-separator-template.directive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb-separator-template.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb-separator-template.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,eAAe,CAAC;AAMhD,IAAM,uCAAuC,GAA7C,MAAM,uCAAuC;IACf;IAAnC,YAAmC,WAAiC;QAAjC,gBAAW,GAAX,WAAW,CAAsB;IAAG,CAAC;CACzE,CAAA;AAFY,uCAAuC;IAJnD,SAAS,CAAC;QACT,QAAQ,EAAE,6CAA6C;QACvD,QAAQ,EAAE,gCAAgC;KAC3C,CAAC;GACW,uCAAuC,CAEnD","sourcesContent":["import { Directive, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: 'ng-template[tngBreadcrumbSeparatorTemplate]',\n exportAs: 'tngBreadcrumbSeparatorTemplate',\n})\nexport class TngBreadcrumbSeparatorTemplateDirective {\n public constructor(public readonly templateRef: TemplateRef<unknown>) {}\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type TemplateRef } from '@angular/core';
|
|
2
|
+
export declare class TngBreadcrumbSeparatorComponent {
|
|
3
|
+
readonly symbol: import("@angular/core").InputSignal<string>;
|
|
4
|
+
readonly template: import("@angular/core").InputSignal<TemplateRef<unknown> | null>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=tng-breadcrumb-separator.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb-separator.component.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb-separator.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAGnE,qBAMa,+BAA+B;IAC1C,SAAgB,MAAM,8CAAc;IACpC,SAAgB,QAAQ,mEAA4C;CACrE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
3
|
+
import { Component, input } from '@angular/core';
|
|
4
|
+
import { TngBreadcrumbSeparator as TngBreadcrumbSeparatorPrimitive } from '@tailng-ui/primitives';
|
|
5
|
+
let TngBreadcrumbSeparatorComponent = class TngBreadcrumbSeparatorComponent {
|
|
6
|
+
symbol = input('/');
|
|
7
|
+
template = input(null);
|
|
8
|
+
};
|
|
9
|
+
TngBreadcrumbSeparatorComponent = __decorate([
|
|
10
|
+
Component({
|
|
11
|
+
selector: 'tng-breadcrumb-separator',
|
|
12
|
+
imports: [NgTemplateOutlet, TngBreadcrumbSeparatorPrimitive],
|
|
13
|
+
templateUrl: './tng-breadcrumb-separator.component.html',
|
|
14
|
+
styleUrl: './tng-breadcrumb-separator.component.css',
|
|
15
|
+
})
|
|
16
|
+
], TngBreadcrumbSeparatorComponent);
|
|
17
|
+
export { TngBreadcrumbSeparatorComponent };
|
|
18
|
+
//# sourceMappingURL=tng-breadcrumb-separator.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb-separator.component.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb-separator.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAoB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,sBAAsB,IAAI,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAQ3F,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAC1B,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IACpB,QAAQ,GAAG,KAAK,CAA8B,IAAI,CAAC,CAAC;CACrE,CAAA;AAHY,+BAA+B;IAN3C,SAAS,CAAC;QACT,QAAQ,EAAE,0BAA0B;QACpC,OAAO,EAAE,CAAC,gBAAgB,EAAE,+BAA+B,CAAC;QAC5D,WAAW,EAAE,2CAA2C;QACxD,QAAQ,EAAE,0CAA0C;KACrD,CAAC;GACW,+BAA+B,CAG3C","sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport { Component, input, type TemplateRef } from '@angular/core';\nimport { TngBreadcrumbSeparator as TngBreadcrumbSeparatorPrimitive } from '@tailng-ui/primitives';\n\n@Component({\n selector: 'tng-breadcrumb-separator',\n imports: [NgTemplateOutlet, TngBreadcrumbSeparatorPrimitive],\n templateUrl: './tng-breadcrumb-separator.component.html',\n styleUrl: './tng-breadcrumb-separator.component.css',\n})\nexport class TngBreadcrumbSeparatorComponent {\n public readonly symbol = input('/');\n public readonly template = input<TemplateRef<unknown> | null>(null);\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AfterContentInit } from '@angular/core';
|
|
2
|
+
export declare class TngBreadcrumbComponent implements AfterContentInit {
|
|
3
|
+
private readonly breadcrumbItems?;
|
|
4
|
+
private readonly separatorTemplate?;
|
|
5
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
6
|
+
readonly separator: import("@angular/core").InputSignal<string>;
|
|
7
|
+
readonly maxItems: import("@angular/core").InputSignal<number | null>;
|
|
8
|
+
readonly itemsBeforeCollapse: import("@angular/core").InputSignal<number>;
|
|
9
|
+
readonly itemsAfterCollapse: import("@angular/core").InputSignal<number>;
|
|
10
|
+
readonly collapseLabel: import("@angular/core").InputSignal<string>;
|
|
11
|
+
protected readonly resolvedAriaLabel: import("@angular/core").Signal<string>;
|
|
12
|
+
private itemStateSubscriptions;
|
|
13
|
+
private readonly queryListSubscriptions;
|
|
14
|
+
constructor();
|
|
15
|
+
ngAfterContentInit(): void;
|
|
16
|
+
ngOnDestroy(): void;
|
|
17
|
+
private rebindItemStateSubscriptions;
|
|
18
|
+
private syncItems;
|
|
19
|
+
private resolveCurrentIndex;
|
|
20
|
+
private resolveDisplayModes;
|
|
21
|
+
private resolveVisibleIndices;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=tng-breadcrumb.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb.component.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,gBAAgB,EAEtB,MAAM,eAAe,CAAC;AAOvB,qBAMa,sBAAuB,YAAW,gBAAgB;IAE7D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAwC;IAGzE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAuB;IAE1D,SAAgB,SAAS,qDAAsC;IAC/D,SAAgB,SAAS,8CAAc;IACvC,SAAgB,QAAQ,qDAA8B;IACtD,SAAgB,mBAAmB,8CAAY;IAC/C,SAAgB,kBAAkB,8CAAY;IAC9C,SAAgB,aAAa,8CAAiB;IAE9C,SAAS,CAAC,QAAQ,CAAC,iBAAiB,yCAQjC;IAEH,OAAO,CAAC,sBAAsB,CAAsB;IACpD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAsB;;IAatD,kBAAkB,IAAI,IAAI;IAa1B,WAAW,IAAI,IAAI;IAK1B,OAAO,CAAC,4BAA4B;IAgBpC,OAAO,CAAC,SAAS;IAqBjB,OAAO,CAAC,mBAAmB;IAoB3B,OAAO,CAAC,mBAAmB;IAuD3B,OAAO,CAAC,qBAAqB;CAS9B"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Component, ContentChild, ContentChildren, computed, effect, input, TemplateRef, } from '@angular/core';
|
|
3
|
+
import { TngBreadcrumb as TngBreadcrumbPrimitive } from '@tailng-ui/primitives';
|
|
4
|
+
import { merge, Subscription } from 'rxjs';
|
|
5
|
+
import { TngBreadcrumbItemComponent } from './tng-breadcrumb-item.component';
|
|
6
|
+
import { TngBreadcrumbListComponent } from './tng-breadcrumb-list.component';
|
|
7
|
+
import { TngBreadcrumbSeparatorTemplateDirective } from './tng-breadcrumb-separator-template.directive';
|
|
8
|
+
let TngBreadcrumbComponent = class TngBreadcrumbComponent {
|
|
9
|
+
breadcrumbItems;
|
|
10
|
+
separatorTemplate;
|
|
11
|
+
ariaLabel = input('Breadcrumb');
|
|
12
|
+
separator = input('/');
|
|
13
|
+
maxItems = input(null);
|
|
14
|
+
itemsBeforeCollapse = input(1);
|
|
15
|
+
itemsAfterCollapse = input(2);
|
|
16
|
+
collapseLabel = input('More');
|
|
17
|
+
resolvedAriaLabel = computed(() => {
|
|
18
|
+
const ariaLabel = this.ariaLabel();
|
|
19
|
+
if (ariaLabel === null) {
|
|
20
|
+
return 'Breadcrumb';
|
|
21
|
+
}
|
|
22
|
+
const trimmedAriaLabel = ariaLabel.trim();
|
|
23
|
+
return trimmedAriaLabel.length > 0 ? trimmedAriaLabel : 'Breadcrumb';
|
|
24
|
+
});
|
|
25
|
+
itemStateSubscriptions = Subscription.EMPTY;
|
|
26
|
+
queryListSubscriptions = new Subscription();
|
|
27
|
+
constructor() {
|
|
28
|
+
effect(() => {
|
|
29
|
+
this.separator();
|
|
30
|
+
this.maxItems();
|
|
31
|
+
this.itemsBeforeCollapse();
|
|
32
|
+
this.itemsAfterCollapse();
|
|
33
|
+
this.collapseLabel();
|
|
34
|
+
this.syncItems();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
ngAfterContentInit() {
|
|
38
|
+
this.rebindItemStateSubscriptions();
|
|
39
|
+
if (this.breadcrumbItems === undefined) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.queryListSubscriptions.add(this.breadcrumbItems.changes.subscribe(() => {
|
|
43
|
+
this.rebindItemStateSubscriptions();
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
ngOnDestroy() {
|
|
47
|
+
this.itemStateSubscriptions.unsubscribe();
|
|
48
|
+
this.queryListSubscriptions.unsubscribe();
|
|
49
|
+
}
|
|
50
|
+
rebindItemStateSubscriptions() {
|
|
51
|
+
this.itemStateSubscriptions.unsubscribe();
|
|
52
|
+
const items = this.breadcrumbItems?.toArray() ?? [];
|
|
53
|
+
if (items.length === 0) {
|
|
54
|
+
this.syncItems();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.itemStateSubscriptions = merge(...items.map((item) => item.stateChanges)).subscribe(() => {
|
|
58
|
+
this.syncItems();
|
|
59
|
+
});
|
|
60
|
+
this.syncItems();
|
|
61
|
+
}
|
|
62
|
+
syncItems() {
|
|
63
|
+
const items = this.breadcrumbItems?.toArray() ?? [];
|
|
64
|
+
if (items.length === 0) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const currentIndex = this.resolveCurrentIndex(items);
|
|
68
|
+
const displayModes = this.resolveDisplayModes(items, currentIndex);
|
|
69
|
+
const visibleIndices = this.resolveVisibleIndices(displayModes);
|
|
70
|
+
for (let index = 0; index < items.length; index += 1) {
|
|
71
|
+
const item = items[index];
|
|
72
|
+
const isVisible = displayModes[index] !== 'hidden';
|
|
73
|
+
const isLastVisibleItem = !visibleIndices.some((visibleIndex) => visibleIndex > index);
|
|
74
|
+
item.setResolvedCurrent(index === currentIndex);
|
|
75
|
+
item.setDisplayMode(displayModes[index], this.collapseLabel());
|
|
76
|
+
item.setSeparator(this.separator(), isVisible && !isLastVisibleItem, this.separatorTemplate ?? null);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
resolveCurrentIndex(items) {
|
|
80
|
+
const explicitlyCurrentIndices = items.reduce((accumulator, item, index) => {
|
|
81
|
+
if (item.current()) {
|
|
82
|
+
accumulator.push(index);
|
|
83
|
+
}
|
|
84
|
+
return accumulator;
|
|
85
|
+
}, []);
|
|
86
|
+
if (explicitlyCurrentIndices.length > 0) {
|
|
87
|
+
return explicitlyCurrentIndices[explicitlyCurrentIndices.length - 1];
|
|
88
|
+
}
|
|
89
|
+
if (items.length === 1) {
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
return -1;
|
|
93
|
+
}
|
|
94
|
+
// eslint-disable-next-line complexity,max-lines-per-function
|
|
95
|
+
resolveDisplayModes(items, currentIndex) {
|
|
96
|
+
const itemCount = items.length;
|
|
97
|
+
const maxItems = this.maxItems();
|
|
98
|
+
if (maxItems === null || maxItems < 1 || itemCount <= maxItems) {
|
|
99
|
+
return Array.from({ length: itemCount }, () => 'visible');
|
|
100
|
+
}
|
|
101
|
+
const itemsBeforeCollapse = Math.max(1, Math.floor(this.itemsBeforeCollapse()));
|
|
102
|
+
const itemsAfterCollapse = Math.max(1, Math.floor(this.itemsAfterCollapse()));
|
|
103
|
+
const visibleIndices = new Set();
|
|
104
|
+
for (let index = 0; index < Math.min(itemsBeforeCollapse, itemCount); index += 1) {
|
|
105
|
+
visibleIndices.add(index);
|
|
106
|
+
}
|
|
107
|
+
for (let index = Math.max(itemCount - itemsAfterCollapse, 0); index < itemCount; index += 1) {
|
|
108
|
+
visibleIndices.add(index);
|
|
109
|
+
}
|
|
110
|
+
if (currentIndex >= 0) {
|
|
111
|
+
visibleIndices.add(currentIndex);
|
|
112
|
+
}
|
|
113
|
+
const hiddenIndices = [];
|
|
114
|
+
for (let index = 0; index < itemCount; index += 1) {
|
|
115
|
+
if (!visibleIndices.has(index)) {
|
|
116
|
+
hiddenIndices.push(index);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (hiddenIndices.length === 0) {
|
|
120
|
+
return Array.from({ length: itemCount }, () => 'visible');
|
|
121
|
+
}
|
|
122
|
+
const displayModes = Array.from({ length: itemCount }, () => 'visible');
|
|
123
|
+
for (const hiddenIndex of hiddenIndices) {
|
|
124
|
+
displayModes[hiddenIndex] = 'hidden';
|
|
125
|
+
}
|
|
126
|
+
// The first hidden item becomes the collapse marker so we avoid introducing a separate focusable node.
|
|
127
|
+
displayModes[hiddenIndices[0]] = 'ellipsis';
|
|
128
|
+
return displayModes;
|
|
129
|
+
}
|
|
130
|
+
resolveVisibleIndices(displayModes) {
|
|
131
|
+
const visibleIndices = [];
|
|
132
|
+
for (let index = 0; index < displayModes.length; index += 1) {
|
|
133
|
+
if (displayModes[index] !== 'hidden') {
|
|
134
|
+
visibleIndices.push(index);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return visibleIndices;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
__decorate([
|
|
141
|
+
ContentChildren(TngBreadcrumbItemComponent, { descendants: true })
|
|
142
|
+
], TngBreadcrumbComponent.prototype, "breadcrumbItems", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
ContentChild(TngBreadcrumbSeparatorTemplateDirective, { read: TemplateRef })
|
|
145
|
+
], TngBreadcrumbComponent.prototype, "separatorTemplate", void 0);
|
|
146
|
+
TngBreadcrumbComponent = __decorate([
|
|
147
|
+
Component({
|
|
148
|
+
selector: 'tng-breadcrumb',
|
|
149
|
+
imports: [TngBreadcrumbPrimitive, TngBreadcrumbListComponent],
|
|
150
|
+
templateUrl: './tng-breadcrumb.component.html',
|
|
151
|
+
styleUrl: './tng-breadcrumb.component.css',
|
|
152
|
+
})
|
|
153
|
+
], TngBreadcrumbComponent);
|
|
154
|
+
export { TngBreadcrumbComponent };
|
|
155
|
+
//# sourceMappingURL=tng-breadcrumb.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-breadcrumb.component.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/breadcrumb/tng-breadcrumb.component.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,MAAM,EACN,KAAK,EACL,WAAW,GAGZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAqC,MAAM,iCAAiC,CAAC;AAChH,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,uCAAuC,EAAE,MAAM,+CAA+C,CAAC;AAQjG,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAEhB,eAAe,CAAyC;IAGxD,iBAAiB,CAAwB;IAE1C,SAAS,GAAG,KAAK,CAAgB,YAAY,CAAC,CAAC;IAC/C,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IACvB,QAAQ,GAAG,KAAK,CAAgB,IAAI,CAAC,CAAC;IACtC,mBAAmB,GAAG,KAAK,CAAC,CAAC,CAAC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CAiLlC","sourcesContent":["import {\n Component,\n ContentChild,\n ContentChildren,\n computed,\n effect,\n input,\n TemplateRef,\n type AfterContentInit,\n type QueryList,\n} from '@angular/core';\nimport { TngBreadcrumb as TngBreadcrumbPrimitive } from '@tailng-ui/primitives';\nimport { merge, Subscription } from 'rxjs';\nimport { TngBreadcrumbItemComponent, type TngBreadcrumbItemDisplayMode } from './tng-breadcrumb-item.component';\nimport { TngBreadcrumbListComponent } from './tng-breadcrumb-list.component';\nimport { TngBreadcrumbSeparatorTemplateDirective } from './tng-breadcrumb-separator-template.directive';\n\n@Component({\n selector: 'tng-breadcrumb',\n imports: [TngBreadcrumbPrimitive, TngBreadcrumbListComponent],\n templateUrl: './tng-breadcrumb.component.html',\n styleUrl: './tng-breadcrumb.component.css',\n})\nexport class TngBreadcrumbComponent implements AfterContentInit {\n @ContentChildren(TngBreadcrumbItemComponent, { descendants: true })\n private readonly breadcrumbItems?: QueryList<TngBreadcrumbItemComponent>;\n\n @ContentChild(TngBreadcrumbSeparatorTemplateDirective, { read: TemplateRef })\n private readonly separatorTemplate?: TemplateRef<unknown>;\n\n public readonly ariaLabel = input<string | null>('Breadcrumb');\n public readonly separator = input('/');\n public readonly maxItems = input<number | null>(null);\n public readonly itemsBeforeCollapse = input(1);\n public readonly itemsAfterCollapse = input(2);\n public readonly collapseLabel = input('More');\n\n protected readonly resolvedAriaLabel = computed(() => {\n const ariaLabel = this.ariaLabel();\n if (ariaLabel === null) {\n return 'Breadcrumb';\n }\n\n const trimmedAriaLabel = ariaLabel.trim();\n return trimmedAriaLabel.length > 0 ? trimmedAriaLabel : 'Breadcrumb';\n });\n\n private itemStateSubscriptions = Subscription.EMPTY;\n private readonly queryListSubscriptions = new Subscription();\n\n public constructor() {\n effect(() => {\n this.separator();\n this.maxItems();\n this.itemsBeforeCollapse();\n this.itemsAfterCollapse();\n this.collapseLabel();\n this.syncItems();\n });\n }\n\n public ngAfterContentInit(): void {\n this.rebindItemStateSubscriptions();\n if (this.breadcrumbItems === undefined) {\n return;\n }\n\n this.queryListSubscriptions.add(\n this.breadcrumbItems.changes.subscribe(() => {\n this.rebindItemStateSubscriptions();\n }),\n );\n }\n\n public ngOnDestroy(): void {\n this.itemStateSubscriptions.unsubscribe();\n this.queryListSubscriptions.unsubscribe();\n }\n\n private rebindItemStateSubscriptions(): void {\n this.itemStateSubscriptions.unsubscribe();\n\n const items = this.breadcrumbItems?.toArray() ?? [];\n if (items.length === 0) {\n this.syncItems();\n return;\n }\n\n this.itemStateSubscriptions = merge(...items.map((item) => item.stateChanges)).subscribe(() => {\n this.syncItems();\n });\n\n this.syncItems();\n }\n\n private syncItems(): void {\n const items = this.breadcrumbItems?.toArray() ?? [];\n if (items.length === 0) {\n return;\n }\n\n const currentIndex = this.resolveCurrentIndex(items);\n const displayModes = this.resolveDisplayModes(items, currentIndex);\n const visibleIndices = this.resolveVisibleIndices(displayModes);\n\n for (let index = 0; index < items.length; index += 1) {\n const item = items[index];\n const isVisible = displayModes[index] !== 'hidden';\n const isLastVisibleItem = !visibleIndices.some((visibleIndex) => visibleIndex > index);\n\n item.setResolvedCurrent(index === currentIndex);\n item.setDisplayMode(displayModes[index], this.collapseLabel());\n item.setSeparator(this.separator(), isVisible && !isLastVisibleItem, this.separatorTemplate ?? null);\n }\n }\n\n private resolveCurrentIndex(items: readonly TngBreadcrumbItemComponent[]): number {\n const explicitlyCurrentIndices = items.reduce<number[]>((accumulator, item, index) => {\n if (item.current()) {\n accumulator.push(index);\n }\n return accumulator;\n }, []);\n\n if (explicitlyCurrentIndices.length > 0) {\n return explicitlyCurrentIndices[explicitlyCurrentIndices.length - 1];\n }\n\n if (items.length === 1) {\n return 0;\n }\n\n return -1;\n }\n\n // eslint-disable-next-line complexity,max-lines-per-function\n private resolveDisplayModes(\n items: readonly TngBreadcrumbItemComponent[],\n currentIndex: number,\n ): readonly TngBreadcrumbItemDisplayMode[] {\n const itemCount = items.length;\n const maxItems = this.maxItems();\n if (maxItems === null || maxItems < 1 || itemCount <= maxItems) {\n return Array.from({ length: itemCount }, () => 'visible' as const);\n }\n\n const itemsBeforeCollapse = Math.max(1, Math.floor(this.itemsBeforeCollapse()));\n const itemsAfterCollapse = Math.max(1, Math.floor(this.itemsAfterCollapse()));\n const visibleIndices = new Set<number>();\n\n for (let index = 0; index < Math.min(itemsBeforeCollapse, itemCount); index += 1) {\n visibleIndices.add(index);\n }\n\n for (\n let index = Math.max(itemCount - itemsAfterCollapse, 0);\n index < itemCount;\n index += 1\n ) {\n visibleIndices.add(index);\n }\n\n if (currentIndex >= 0) {\n visibleIndices.add(currentIndex);\n }\n\n const hiddenIndices: number[] = [];\n for (let index = 0; index < itemCount; index += 1) {\n if (!visibleIndices.has(index)) {\n hiddenIndices.push(index);\n }\n }\n\n if (hiddenIndices.length === 0) {\n return Array.from({ length: itemCount }, () => 'visible' as const);\n }\n\n const displayModes: TngBreadcrumbItemDisplayMode[] = Array.from(\n { length: itemCount },\n () => 'visible' as const,\n );\n\n for (const hiddenIndex of hiddenIndices) {\n displayModes[hiddenIndex] = 'hidden';\n }\n\n // The first hidden item becomes the collapse marker so we avoid introducing a separate focusable node.\n displayModes[hiddenIndices[0]] = 'ellipsis';\n return displayModes;\n }\n\n private resolveVisibleIndices(displayModes: readonly TngBreadcrumbItemDisplayMode[]): readonly number[] {\n const visibleIndices: number[] = [];\n for (let index = 0; index < displayModes.length; index += 1) {\n if (displayModes[index] !== 'hidden') {\n visibleIndices.push(index);\n }\n }\n return visibleIndices;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-context-menu.component.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/context-menu/tng-context-menu.component.ts"],"names":[],"mappings":"AAGA,qBAMa,uBAAuB;IAClC,SAAgB,SAAS,8CAAiC;CAC3D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Component, input } from '@angular/core';
|
|
3
|
+
import { TngContextMenu as TngContextMenuPrimitive } from '@tailng-ui/primitives';
|
|
4
|
+
let TngContextMenuComponent = class TngContextMenuComponent {
|
|
5
|
+
ariaLabel = input('Context Menu');
|
|
6
|
+
};
|
|
7
|
+
TngContextMenuComponent = __decorate([
|
|
8
|
+
Component({
|
|
9
|
+
selector: 'tng-context-menu',
|
|
10
|
+
imports: [TngContextMenuPrimitive],
|
|
11
|
+
templateUrl: './tng-context-menu.component.html',
|
|
12
|
+
styleUrl: './tng-context-menu.component.css',
|
|
13
|
+
})
|
|
14
|
+
], TngContextMenuComponent);
|
|
15
|
+
export { TngContextMenuComponent };
|
|
16
|
+
//# sourceMappingURL=tng-context-menu.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-context-menu.component.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/context-menu/tng-context-menu.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAQ3E,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClB,SAAS,GAAG,KAAK,CAAS,cAAc,CAAC,CAAC;CAC3D,CAAA;AAFY,uBAAuB;IANnC,SAAS,CAAC;QACT,QAAQ,EAAE,kBAAkB;QAC5B,OAAO,EAAE,CAAC,uBAAuB,CAAC;QAClC,WAAW,EAAE,mCAAmC;QAChD,QAAQ,EAAE,kCAAkC;KAC7C,CAAC;GACW,uBAAuB,CAEnC","sourcesContent":["import { Component, input } from '@angular/core';\nimport { TngContextMenu as TngContextMenuPrimitive } from '@tailng-ui/primitives';\n\n@Component({\n selector: 'tng-context-menu',\n imports: [TngContextMenuPrimitive],\n templateUrl: './tng-context-menu.component.html',\n styleUrl: './tng-context-menu.component.css',\n})\nexport class TngContextMenuComponent {\n public readonly ariaLabel = input<string>('Context Menu');\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class TngDropdownMenuComponent {
|
|
2
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, string | boolean>;
|
|
3
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
4
|
+
protected readonly open: import("@angular/core").WritableSignal<boolean>;
|
|
5
|
+
private readonly hostRef;
|
|
6
|
+
protected onDocumentClick(event: unknown): void;
|
|
7
|
+
protected onEscapeKeydown(): void;
|
|
8
|
+
protected toggleOpen(): void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=tng-dropdown-menu.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-dropdown-menu.component.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/dropdown-menu/tng-dropdown-menu.component.ts"],"names":[],"mappings":"AAWA,qBAMa,wBAAwB;IACnC,SAAgB,QAAQ,8EAErB;IACH,SAAgB,KAAK,8CAA4B;IAEjD,SAAS,CAAC,QAAQ,CAAC,IAAI,kDAAiB;IAExC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+C;IAGvE,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAoB/C,SAAS,CAAC,eAAe,IAAI,IAAI;IAQjC,SAAS,CAAC,UAAU,IAAI,IAAI;CAO7B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Component, ElementRef, HostListener, booleanAttribute, inject, input, signal, } from '@angular/core';
|
|
3
|
+
import { TngDropdownMenu as TngDropdownMenuPrimitive } from '@tailng-ui/primitives';
|
|
4
|
+
let TngDropdownMenuComponent = class TngDropdownMenuComponent {
|
|
5
|
+
disabled = input(false, {
|
|
6
|
+
transform: booleanAttribute,
|
|
7
|
+
});
|
|
8
|
+
label = input('Actions');
|
|
9
|
+
open = signal(false);
|
|
10
|
+
hostRef = inject(ElementRef);
|
|
11
|
+
onDocumentClick(event) {
|
|
12
|
+
if (!(event instanceof Event)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (!this.open()) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const target = event.target;
|
|
19
|
+
if (!(target instanceof Node)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (!this.hostRef.nativeElement.contains(target)) {
|
|
23
|
+
this.open.set(false);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
onEscapeKeydown() {
|
|
27
|
+
if (!this.open()) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.open.set(false);
|
|
31
|
+
}
|
|
32
|
+
toggleOpen() {
|
|
33
|
+
if (this.disabled()) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this.open.set(!this.open());
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
__decorate([
|
|
40
|
+
HostListener('document:click', ['$event'])
|
|
41
|
+
], TngDropdownMenuComponent.prototype, "onDocumentClick", null);
|
|
42
|
+
__decorate([
|
|
43
|
+
HostListener('document:keydown.escape')
|
|
44
|
+
], TngDropdownMenuComponent.prototype, "onEscapeKeydown", null);
|
|
45
|
+
TngDropdownMenuComponent = __decorate([
|
|
46
|
+
Component({
|
|
47
|
+
selector: 'tng-dropdown-menu',
|
|
48
|
+
imports: [TngDropdownMenuPrimitive],
|
|
49
|
+
templateUrl: './tng-dropdown-menu.component.html',
|
|
50
|
+
styleUrl: './tng-dropdown-menu.component.css',
|
|
51
|
+
})
|
|
52
|
+
], TngDropdownMenuComponent);
|
|
53
|
+
export { TngDropdownMenuComponent };
|
|
54
|
+
//# sourceMappingURL=tng-dropdown-menu.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tng-dropdown-menu.component.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/components/src/lib/navigation/dropdown-menu/tng-dropdown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CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF,CAAA;AAnCW;IADT,YAAY,CAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,CAAC;+DAkB1C;AAGS;IADT,YAAY,CAAC,yBAAyB,CAAC;+DAOvC;AArCU,wBAAwB;IANpC,SAAS,CAAC;QACT,QAAQ,EAAE,mBAAmB;QAC7B,OAAO,EAAE,CAAC,wBAAwB,CAAC;QACnC,WAAW,EAAE,oCAAoC;QACjD,QAAQ,EAAE,mCAAmC;KAC9C,CAAC;GACW,wBAAwB,CA8CpC","sourcesContent":["import {\n Component,\n ElementRef,\n HostListener,\n booleanAttribute,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { TngDropdownMenu as TngDropdownMenuPrimitive } from '@tailng-ui/primitives';\n\n@Component({\n selector: 'tng-dropdown-menu',\n imports: [TngDropdownMenuPrimitive],\n templateUrl: './tng-dropdown-menu.component.html',\n styleUrl: './tng-dropdown-menu.component.css',\n})\nexport class TngDropdownMenuComponent {\n public readonly disabled = input<boolean, boolean | string>(false, {\n transform: booleanAttribute,\n });\n public readonly label = input<string>('Actions');\n\n protected readonly open = signal(false);\n\n private readonly hostRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n @HostListener('document:click', ['$event'])\n protected onDocumentClick(event: unknown): void {\n if (!(event instanceof Event)) {\n return;\n }\n\n if (!this.open()) {\n return;\n }\n\n const target = event.target;\n if (!(target instanceof Node)) {\n return;\n }\n\n if (!this.hostRef.nativeElement.contains(target)) {\n this.open.set(false);\n }\n }\n\n @HostListener('document:keydown.escape')\n protected onEscapeKeydown(): void {\n if (!this.open()) {\n return;\n }\n\n this.open.set(false);\n }\n\n protected toggleOpen(): void {\n if (this.disabled()) {\n return;\n }\n\n this.open.set(!this.open());\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './breadcrumb/tng-breadcrumb.component';
|
|
2
|
+
export { TngBreadcrumbComponent as TngBreadcrumb } from './breadcrumb/tng-breadcrumb.component';
|
|
3
|
+
export * from './breadcrumb/tng-breadcrumb-item.component';
|
|
4
|
+
export { TngBreadcrumbItemComponent as TngBreadcrumbItem } from './breadcrumb/tng-breadcrumb-item.component';
|
|
5
|
+
export * from './breadcrumb/tng-breadcrumb-link.component';
|
|
6
|
+
export { TngBreadcrumbLinkComponent as TngBreadcrumbLink } from './breadcrumb/tng-breadcrumb-link.component';
|
|
7
|
+
export * from './breadcrumb/tng-breadcrumb-list.component';
|
|
8
|
+
export { TngBreadcrumbListComponent as TngBreadcrumbList } from './breadcrumb/tng-breadcrumb-list.component';
|
|
9
|
+
export * from './breadcrumb/tng-breadcrumb-separator.component';
|
|
10
|
+
export { TngBreadcrumbSeparatorComponent as TngBreadcrumbSeparator, } from './breadcrumb/tng-breadcrumb-separator.component';
|
|
11
|
+
export * from './breadcrumb/tng-breadcrumb-separator-template.directive';
|
|
12
|
+
export * from './context-menu/tng-context-menu.component';
|
|
13
|
+
export { TngContextMenuComponent as TngContextMenu } from './context-menu/tng-context-menu.component';
|
|
14
|
+
export * from './dropdown-menu/tng-dropdown-menu.component';
|
|
15
|
+
export { TngDropdownMenuComponent as TngDropdownMenu } from './dropdown-menu/tng-dropdown-menu.component';
|
|
16
|
+
export * from './menu/tng-menu.component';
|
|
17
|
+
export { TngMenuComponent as TngMenu } from './menu/tng-menu.component';
|
|
18
|
+
export * from './menu/tng-menu-trigger-for.directive';
|
|
19
|
+
export * from './menubar/tng-menubar.component';
|
|
20
|
+
export { TngMenubarComponent as TngMenubar } from './menubar/tng-menubar.component';
|
|
21
|
+
export * from './navigation-menu/tng-navigation-menu.component';
|
|
22
|
+
export { TngNavigationMenuComponent as TngNavigationMenu } from './navigation-menu/tng-navigation-menu.component';
|
|
23
|
+
export * from './tabs/tng-tabs.component';
|
|
24
|
+
export { TngTabsComponent as TngTabs } from './tabs/tng-tabs.component';
|
|
25
|
+
export * from './toolbar/tng-toolbar.component';
|
|
26
|
+
export { TngToolbarComponent as TngToolbar } from './toolbar/tng-toolbar.component';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../libs/tailng-ui/components/src/lib/navigation/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,OAAO,EAAE,sBAAsB,IAAI,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAChG,cAAc,4CAA4C,CAAC;AAC3D,OAAO,EAAE,0BAA0B,IAAI,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC7G,cAAc,4CAA4C,CAAC;AAC3D,OAAO,EAAE,0BAA0B,IAAI,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC7G,cAAc,4CAA4C,CAAC;AAC3D,OAAO,EAAE,0BAA0B,IAAI,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC7G,cAAc,iDAAiD,CAAC;AAChE,OAAO,EACL,+BAA+B,IAAI,sBAAsB,GAC1D,MAAM,iDAAiD,CAAC;AACzD,cAAc,0DAA0D,CAAC;AACzE,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,uBAAuB,IAAI,cAAc,EAAE,MAAM,2CAA2C,CAAC;AACtG,cAAc,6CAA6C,CAAC;AAC5D,OAAO,EAAE,wBAAwB,IAAI,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC1G,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACxE,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,mBAAmB,IAAI,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACpF,cAAc,iDAAiD,CAAC;AAChE,OAAO,EAAE,0BAA0B,IAAI,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAClH,cAA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