@surfnet/curve-angular 0.2.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/.postcssrc.json +7 -0
- package/.storybook/main.ts +9 -0
- package/.storybook/manager.ts +3 -0
- package/.storybook/preview.ts +28 -0
- package/.storybook/tsconfig.json +8 -0
- package/.turbo/turbo-build.log +32 -0
- package/CHANGELOG.md +29 -0
- package/angular.json +52 -0
- package/components.json +5 -0
- package/dist/fesm2022/surfnet-curve-angular.mjs +4237 -0
- package/dist/fesm2022/surfnet-curve-angular.mjs.map +1 -0
- package/dist/files/geist-cyrillic-ext-wght-italic.woff2 +0 -0
- package/dist/files/geist-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/files/geist-cyrillic-wght-italic.woff2 +0 -0
- package/dist/files/geist-cyrillic-wght-normal.woff2 +0 -0
- package/dist/files/geist-latin-ext-wght-italic.woff2 +0 -0
- package/dist/files/geist-latin-ext-wght-normal.woff2 +0 -0
- package/dist/files/geist-latin-wght-italic.woff2 +0 -0
- package/dist/files/geist-latin-wght-normal.woff2 +0 -0
- package/dist/files/geist-vietnamese-wght-italic.woff2 +0 -0
- package/dist/files/geist-vietnamese-wght-normal.woff2 +0 -0
- package/dist/styles.css +2 -0
- package/dist/types/surfnet-curve-angular.d.ts +1017 -0
- package/ng-package.json +20 -0
- package/package.json +73 -0
- package/scripts/copy-font-files.ts +15 -0
- package/scripts/rewrite-helm-imports.ts +60 -0
- package/src/foundations/design-tokens.stories.ts +198 -0
- package/src/lib/ui/avatar/src/index.ts +22 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar-badge.ts +19 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar-fallback.ts +20 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar-group-count.ts +17 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar-group.ts +17 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar-image.ts +19 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar.stories.ts +107 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar.ts +32 -0
- package/src/lib/ui/breadcrumb/src/index.ts +30 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-ellipsis.ts +36 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-item.ts +14 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-link.ts +36 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-list.ts +17 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-page.ts +17 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-separator.ts +27 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb.stories.ts +81 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb.ts +13 -0
- package/src/lib/ui/button/src/index.ts +6 -0
- package/src/lib/ui/button/src/lib/hlm-button.stories.ts +170 -0
- package/src/lib/ui/button/src/lib/hlm-button.token.ts +22 -0
- package/src/lib/ui/button/src/lib/hlm-button.ts +76 -0
- package/src/lib/ui/card/src/index.ts +25 -0
- package/src/lib/ui/card/src/lib/hlm-card-action.ts +12 -0
- package/src/lib/ui/card/src/lib/hlm-card-content.ts +12 -0
- package/src/lib/ui/card/src/lib/hlm-card-description.ts +12 -0
- package/src/lib/ui/card/src/lib/hlm-card-footer.ts +14 -0
- package/src/lib/ui/card/src/lib/hlm-card-header.ts +15 -0
- package/src/lib/ui/card/src/lib/hlm-card-title.ts +12 -0
- package/src/lib/ui/card/src/lib/hlm-card.stories.ts +105 -0
- package/src/lib/ui/card/src/lib/hlm-card.token.ts +19 -0
- package/src/lib/ui/card/src/lib/hlm-card.ts +22 -0
- package/src/lib/ui/checkbox/src/index.ts +5 -0
- package/src/lib/ui/checkbox/src/lib/hlm-checkbox.stories.ts +78 -0
- package/src/lib/ui/checkbox/src/lib/hlm-checkbox.ts +160 -0
- package/src/lib/ui/data-table/src/index.ts +14 -0
- package/src/lib/ui/data-table/src/lib/hlm-data-table-content.ts +87 -0
- package/src/lib/ui/data-table/src/lib/hlm-data-table-pagination.ts +62 -0
- package/src/lib/ui/data-table/src/lib/hlm-data-table-toolbar.ts +16 -0
- package/src/lib/ui/data-table/src/lib/hlm-data-table.stories.ts +479 -0
- package/src/lib/ui/data-table/src/lib/inject-data-table.ts +86 -0
- package/src/lib/ui/dropdown-menu/src/index.ts +45 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-checkbox-indicator.ts +20 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-checkbox.ts +36 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-group.ts +16 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-item-sub-indicator.ts +17 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-item.ts +41 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-label.ts +20 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-radio-indicator.ts +20 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-radio.ts +36 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-separator.ts +14 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-shortcut.ts +14 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-sub.ts +58 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-token.ts +26 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-trigger.ts +49 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu.stories.ts +125 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu.ts +62 -0
- package/src/lib/ui/field/src/index.ts +34 -0
- package/src/lib/ui/field/src/lib/hlm-field-content.ts +12 -0
- package/src/lib/ui/field/src/lib/hlm-field-description.ts +53 -0
- package/src/lib/ui/field/src/lib/hlm-field-error.ts +100 -0
- package/src/lib/ui/field/src/lib/hlm-field-group.ts +15 -0
- package/src/lib/ui/field/src/lib/hlm-field-label.ts +17 -0
- package/src/lib/ui/field/src/lib/hlm-field-legend.ts +17 -0
- package/src/lib/ui/field/src/lib/hlm-field-separator.ts +24 -0
- package/src/lib/ui/field/src/lib/hlm-field-set.ts +15 -0
- package/src/lib/ui/field/src/lib/hlm-field-title.ts +15 -0
- package/src/lib/ui/field/src/lib/hlm-field.stories.ts +117 -0
- package/src/lib/ui/field/src/lib/hlm-field.ts +49 -0
- package/src/lib/ui/icon/src/index.ts +7 -0
- package/src/lib/ui/icon/src/lib/hlm-icon.token.ts +20 -0
- package/src/lib/ui/icon/src/lib/hlm-icon.ts +42 -0
- package/src/lib/ui/input/src/index.ts +5 -0
- package/src/lib/ui/input/src/lib/hlm-input.stories.ts +94 -0
- package/src/lib/ui/input/src/lib/hlm-input.ts +20 -0
- package/src/lib/ui/input-group/src/index.ts +22 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group-addon.ts +40 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group-button.ts +47 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group-input.ts +17 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group-text.ts +14 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group-textarea.ts +17 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group.stories.ts +133 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group.ts +18 -0
- package/src/lib/ui/label/src/index.ts +5 -0
- package/src/lib/ui/label/src/lib/hlm-label.stories.ts +55 -0
- package/src/lib/ui/label/src/lib/hlm-label.ts +17 -0
- package/src/lib/ui/select/src/index.ts +52 -0
- package/src/lib/ui/select/src/lib/hlm-select-content.ts +44 -0
- package/src/lib/ui/select/src/lib/hlm-select-group.ts +14 -0
- package/src/lib/ui/select/src/lib/hlm-select-item.ts +36 -0
- package/src/lib/ui/select/src/lib/hlm-select-label.ts +14 -0
- package/src/lib/ui/select/src/lib/hlm-select-multiple.ts +45 -0
- package/src/lib/ui/select/src/lib/hlm-select-placeholder.ts +17 -0
- package/src/lib/ui/select/src/lib/hlm-select-portal.ts +8 -0
- package/src/lib/ui/select/src/lib/hlm-select-scroll-down.ts +22 -0
- package/src/lib/ui/select/src/lib/hlm-select-scroll-up.ts +22 -0
- package/src/lib/ui/select/src/lib/hlm-select-separator.ts +14 -0
- package/src/lib/ui/select/src/lib/hlm-select-trigger.ts +59 -0
- package/src/lib/ui/select/src/lib/hlm-select-value-template.ts +5 -0
- package/src/lib/ui/select/src/lib/hlm-select-value.ts +18 -0
- package/src/lib/ui/select/src/lib/hlm-select-values-content.ts +9 -0
- package/src/lib/ui/select/src/lib/hlm-select-values.ts +5 -0
- package/src/lib/ui/select/src/lib/hlm-select.stories.ts +105 -0
- package/src/lib/ui/select/src/lib/hlm-select.ts +45 -0
- package/src/lib/ui/separator/src/index.ts +5 -0
- package/src/lib/ui/separator/src/lib/hlm-separator.stories.ts +88 -0
- package/src/lib/ui/separator/src/lib/hlm-separator.ts +19 -0
- package/src/lib/ui/sheet/src/index.ts +34 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-close.ts +9 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-content.ts +66 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-description.ts +14 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-footer.ts +12 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-header.ts +12 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-overlay.ts +27 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-portal.ts +8 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-title.ts +14 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-trigger.ts +9 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet.ts +29 -0
- package/src/lib/ui/sidebar/src/index.ts +75 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-content.ts +18 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-footer.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-group-action.ts +18 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-group-content.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-group-label.ts +18 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-group.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-header.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-input.ts +17 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-inset.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-action.ts +24 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-badge.ts +18 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-button.ts +97 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-item.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-skeleton.ts +33 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-sub-button.ts +41 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-sub-item.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-sub.ts +18 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-rail.ts +34 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-separator.ts +17 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-trigger.ts +35 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-wrapper.ts +24 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar.service.ts +136 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar.stories.ts +177 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar.token.ts +33 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar.ts +139 -0
- package/src/lib/ui/skeleton/src/index.ts +5 -0
- package/src/lib/ui/skeleton/src/lib/hlm-skeleton.ts +14 -0
- package/src/lib/ui/table/src/index.ts +25 -0
- package/src/lib/ui/table/src/lib/hlm-table.stories.ts +70 -0
- package/src/lib/ui/table/src/lib/hlm-table.ts +129 -0
- package/src/lib/ui/textarea/src/index.ts +5 -0
- package/src/lib/ui/textarea/src/lib/hlm-textarea.stories.ts +72 -0
- package/src/lib/ui/textarea/src/lib/hlm-textarea.ts +21 -0
- package/src/lib/ui/tooltip/src/index.ts +5 -0
- package/src/lib/ui/tooltip/src/lib/hlm-tooltip.ts +44 -0
- package/src/lib/ui/utils/src/index.ts +1 -0
- package/src/lib/ui/utils/src/lib/hlm.ts +313 -0
- package/src/public-api.ts +24 -0
- package/src/styles.css +43 -0
- package/tsconfig.json +45 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.lib.prod.json +9 -0
|
@@ -0,0 +1,4237 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { runInInjectionContext, inject, Injector, ElementRef, PLATFORM_ID, DestroyRef, HostAttributeToken, effect, input, ChangeDetectionStrategy, Component, Directive, InjectionToken, computed, signal, forwardRef, booleanAttribute, linkedSignal, output, model, viewChild, numberAttribute, HOST_TAG_NAME, REQUEST, DOCUMENT, afterNextRender, Injectable, untracked, Renderer2 } from '@angular/core';
|
|
3
|
+
import * as i1 from '@spartan-ng/brain/avatar';
|
|
4
|
+
import { BrnAvatar, BrnAvatarFallback, BrnAvatarImage } from '@spartan-ng/brain/avatar';
|
|
5
|
+
import { isPlatformBrowser, isPlatformServer, NgTemplateOutlet } from '@angular/common';
|
|
6
|
+
import { clsx } from 'clsx';
|
|
7
|
+
import { twMerge } from 'tailwind-merge';
|
|
8
|
+
import * as i2$1 from '@ng-icons/core';
|
|
9
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
10
|
+
import { phosphorDotsThree, phosphorCaretRight, phosphorCheck, phosphorCircle, phosphorCaretDown, phosphorCaretUp, phosphorCaretUpDown, phosphorX, phosphorSidebarSimple } from '@ng-icons/phosphor-icons/regular';
|
|
11
|
+
import * as i1$1 from '@angular/router';
|
|
12
|
+
import { RouterLink } from '@angular/router';
|
|
13
|
+
import * as i1$2 from '@spartan-ng/brain/button';
|
|
14
|
+
import { BrnButton } from '@spartan-ng/brain/button';
|
|
15
|
+
import { cva } from 'class-variance-authority';
|
|
16
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
17
|
+
import { BrnCheckbox } from '@spartan-ng/brain/checkbox';
|
|
18
|
+
import * as i1$3 from '@spartan-ng/brain/field';
|
|
19
|
+
import { BrnFieldControlDescribedBy, BrnField, BrnFieldA11yService } from '@spartan-ng/brain/field';
|
|
20
|
+
import { FlexRenderDirective, createAngularTable, getPaginationRowModel, getFilteredRowModel, getSortedRowModel, getCoreRowModel } from '@tanstack/angular-table';
|
|
21
|
+
import * as i1$4 from '@angular/cdk/menu';
|
|
22
|
+
import { CdkMenu, CdkMenuItemCheckbox, CdkMenuGroup, CdkMenuItem, CdkMenuItemRadio, CdkMenuTrigger } from '@angular/cdk/menu';
|
|
23
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
24
|
+
import { createMenuPosition, injectCustomClassSettable, injectExposesStateProvider, injectExposedSideProvider } from '@spartan-ng/brain/core';
|
|
25
|
+
import * as i1$5 from '@spartan-ng/brain/label';
|
|
26
|
+
import { BrnLabel } from '@spartan-ng/brain/label';
|
|
27
|
+
import * as i1$6 from '@spartan-ng/brain/separator';
|
|
28
|
+
import { BrnSeparator } from '@spartan-ng/brain/separator';
|
|
29
|
+
import * as i1$7 from '@spartan-ng/brain/input';
|
|
30
|
+
import { BrnInput } from '@spartan-ng/brain/input';
|
|
31
|
+
import * as i1$8 from '@spartan-ng/brain/textarea';
|
|
32
|
+
import { BrnTextarea } from '@spartan-ng/brain/textarea';
|
|
33
|
+
import { provideBrnDialogDefaultOptions, BrnDialog } from '@spartan-ng/brain/dialog';
|
|
34
|
+
import * as i2 from '@spartan-ng/brain/popover';
|
|
35
|
+
import { provideBrnPopoverConfig, BrnPopover, BrnPopoverContent } from '@spartan-ng/brain/popover';
|
|
36
|
+
import * as i1$9 from '@spartan-ng/brain/select';
|
|
37
|
+
import { BrnSelect, BrnSelectScrollDown, BrnSelectScrollUp, BrnSelectContent, BrnSelectGroup, BrnSelectItem, BrnSelectLabel, BrnSelectMultiple, BrnSelectPlaceholder, BrnSelectSeparator, BrnSelectTrigger, BrnSelectValue, BrnSelectValueTemplate, BrnSelectValues } from '@spartan-ng/brain/select';
|
|
38
|
+
import * as i1$a from '@spartan-ng/brain/sheet';
|
|
39
|
+
import { BrnSheetOverlay, BrnSheet, BrnSheetClose, BrnSheetDescription, BrnSheetContent, BrnSheetTitle, BrnSheetTrigger } from '@spartan-ng/brain/sheet';
|
|
40
|
+
import * as i1$b from '@spartan-ng/brain/tooltip';
|
|
41
|
+
import { provideBrnTooltipDefaultOptions, BrnTooltip } from '@spartan-ng/brain/tooltip';
|
|
42
|
+
|
|
43
|
+
function hlm(...inputs) {
|
|
44
|
+
return twMerge(clsx(inputs));
|
|
45
|
+
}
|
|
46
|
+
// Global map to track class managers per element
|
|
47
|
+
const elementClassManagers = new WeakMap();
|
|
48
|
+
// Global mutation observer for all elements
|
|
49
|
+
let globalObserver = null;
|
|
50
|
+
const observedElements = new Set();
|
|
51
|
+
let sourceCounter = 0;
|
|
52
|
+
/**
|
|
53
|
+
* This function dynamically adds and removes classes for a given element without requiring
|
|
54
|
+
* the a class binding (e.g. `[class]="..."`) which may interfere with other class bindings.
|
|
55
|
+
*
|
|
56
|
+
* 1. This will merge the existing classes on the element with the new classes.
|
|
57
|
+
* 2. It will also remove any classes that were previously added by this function but are no longer present in the new classes.
|
|
58
|
+
* 3. Multiple calls to this function on the same element will be merged efficiently.
|
|
59
|
+
*/
|
|
60
|
+
function classes(computed, options = {}) {
|
|
61
|
+
runInInjectionContext(options.injector ?? inject(Injector), () => {
|
|
62
|
+
const elementRef = options.elementRef ?? inject(ElementRef);
|
|
63
|
+
const platformId = inject(PLATFORM_ID);
|
|
64
|
+
const destroyRef = inject(DestroyRef);
|
|
65
|
+
const baseClasses = inject(new HostAttributeToken('class'), { optional: true });
|
|
66
|
+
const element = elementRef.nativeElement;
|
|
67
|
+
// Create unique identifier for this source
|
|
68
|
+
const sourceId = sourceCounter++;
|
|
69
|
+
// Get or create the class manager for this element
|
|
70
|
+
let manager = elementClassManagers.get(element);
|
|
71
|
+
if (!manager) {
|
|
72
|
+
// Initialize base classes from variation (host attribute 'class')
|
|
73
|
+
const initialBaseClasses = new Set();
|
|
74
|
+
if (baseClasses) {
|
|
75
|
+
toClassList(baseClasses).forEach((cls) => initialBaseClasses.add(cls));
|
|
76
|
+
}
|
|
77
|
+
manager = {
|
|
78
|
+
element,
|
|
79
|
+
sources: new Map(),
|
|
80
|
+
baseClasses: initialBaseClasses,
|
|
81
|
+
isUpdating: false,
|
|
82
|
+
nextOrder: 0,
|
|
83
|
+
hasInitialized: false,
|
|
84
|
+
restoreRafId: null,
|
|
85
|
+
transitionsSuppressed: false,
|
|
86
|
+
previousTransition: '',
|
|
87
|
+
previousTransitionPriority: '',
|
|
88
|
+
};
|
|
89
|
+
elementClassManagers.set(element, manager);
|
|
90
|
+
// Setup global observer if needed and register this element
|
|
91
|
+
setupGlobalObserver(platformId);
|
|
92
|
+
observedElements.add(element);
|
|
93
|
+
// Suppress transitions until the first effect writes correct classes and
|
|
94
|
+
// the browser has painted them. This prevents CSS transition animations
|
|
95
|
+
// during hydration when classes change from SSR state to client state.
|
|
96
|
+
if (isPlatformBrowser(platformId)) {
|
|
97
|
+
manager.previousTransition = element.style.getPropertyValue('transition');
|
|
98
|
+
manager.previousTransitionPriority = element.style.getPropertyPriority('transition');
|
|
99
|
+
element.style.setProperty('transition', 'none', 'important');
|
|
100
|
+
manager.transitionsSuppressed = true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Assign order once at registration time
|
|
104
|
+
const sourceOrder = manager.nextOrder++;
|
|
105
|
+
function updateClasses() {
|
|
106
|
+
// Get the new classes from the computed function
|
|
107
|
+
const newClasses = toClassList(computed());
|
|
108
|
+
// Update this source's classes, keeping the original order
|
|
109
|
+
manager.sources.set(sourceId, {
|
|
110
|
+
classes: new Set(newClasses),
|
|
111
|
+
order: sourceOrder,
|
|
112
|
+
});
|
|
113
|
+
// Update the element
|
|
114
|
+
updateElement(manager);
|
|
115
|
+
// Re-enable transitions after the first effect writes correct classes.
|
|
116
|
+
// Deferred to next animation frame so the browser paints the class change
|
|
117
|
+
// with transitions disabled first, then re-enables them.
|
|
118
|
+
if (manager.transitionsSuppressed) {
|
|
119
|
+
manager.transitionsSuppressed = false;
|
|
120
|
+
manager.restoreRafId = requestAnimationFrame(() => {
|
|
121
|
+
manager.restoreRafId = null;
|
|
122
|
+
restoreTransitionSuppression(manager);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// Register cleanup with DestroyRef
|
|
127
|
+
destroyRef.onDestroy(() => {
|
|
128
|
+
if (manager.restoreRafId !== null) {
|
|
129
|
+
cancelAnimationFrame(manager.restoreRafId);
|
|
130
|
+
manager.restoreRafId = null;
|
|
131
|
+
}
|
|
132
|
+
if (manager.transitionsSuppressed) {
|
|
133
|
+
manager.transitionsSuppressed = false;
|
|
134
|
+
restoreTransitionSuppression(manager);
|
|
135
|
+
}
|
|
136
|
+
// Remove this source from the manager
|
|
137
|
+
manager.sources.delete(sourceId);
|
|
138
|
+
// If no more sources, clean up the manager
|
|
139
|
+
if (manager.sources.size === 0) {
|
|
140
|
+
cleanupManager(element);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
// Update element without this source's classes
|
|
144
|
+
updateElement(manager);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
/**
|
|
148
|
+
* We need this effect to track changes to the computed classes. Ideally, we would use
|
|
149
|
+
* afterRenderEffect here, but that doesn't run in SSR contexts, so we use a standard
|
|
150
|
+
* effect which works in both browser and SSR.
|
|
151
|
+
*/
|
|
152
|
+
effect(updateClasses);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function restoreTransitionSuppression(manager) {
|
|
156
|
+
const prev = manager.previousTransition;
|
|
157
|
+
if (prev) {
|
|
158
|
+
manager.element.style.setProperty('transition', prev, manager.previousTransitionPriority || undefined);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
manager.element.style.removeProperty('transition');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
|
|
165
|
+
function setupGlobalObserver(platformId) {
|
|
166
|
+
if (isPlatformBrowser(platformId) && !globalObserver) {
|
|
167
|
+
// Create single global observer that watches the entire document
|
|
168
|
+
globalObserver = new MutationObserver((mutations) => {
|
|
169
|
+
for (const mutation of mutations) {
|
|
170
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
171
|
+
const element = mutation.target;
|
|
172
|
+
const manager = elementClassManagers.get(element);
|
|
173
|
+
// Only process elements we're managing
|
|
174
|
+
if (manager && observedElements.has(element)) {
|
|
175
|
+
if (manager.isUpdating)
|
|
176
|
+
continue; // Ignore changes we're making
|
|
177
|
+
// Update base classes to include any externally added classes
|
|
178
|
+
const currentClasses = toClassList(element.className);
|
|
179
|
+
const allSourceClasses = new Set();
|
|
180
|
+
// Collect all classes from all sources
|
|
181
|
+
for (const source of manager.sources.values()) {
|
|
182
|
+
for (const className of source.classes) {
|
|
183
|
+
allSourceClasses.add(className);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// Any classes not from sources become new base classes
|
|
187
|
+
manager.baseClasses.clear();
|
|
188
|
+
for (const className of currentClasses) {
|
|
189
|
+
if (!allSourceClasses.has(className)) {
|
|
190
|
+
manager.baseClasses.add(className);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
updateElement(manager);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
// Start observing the entire document for class attribute changes
|
|
199
|
+
globalObserver.observe(document, {
|
|
200
|
+
attributes: true,
|
|
201
|
+
attributeFilter: ['class'],
|
|
202
|
+
subtree: true, // Watch all descendants
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function updateElement(manager) {
|
|
207
|
+
if (manager.isUpdating)
|
|
208
|
+
return; // Prevent recursive updates
|
|
209
|
+
manager.isUpdating = true;
|
|
210
|
+
// Handle initialization: capture base classes after first source registration
|
|
211
|
+
if (!manager.hasInitialized && manager.sources.size > 0) {
|
|
212
|
+
// Get current classes on element (may include SSR classes)
|
|
213
|
+
const currentClasses = toClassList(manager.element.className);
|
|
214
|
+
// Get all classes that will be applied by sources
|
|
215
|
+
const allSourceClasses = new Set();
|
|
216
|
+
for (const source of manager.sources.values()) {
|
|
217
|
+
source.classes.forEach((className) => allSourceClasses.add(className));
|
|
218
|
+
}
|
|
219
|
+
// Only consider classes as "base" if they're not produced by any source
|
|
220
|
+
// This prevents SSR-rendered classes from being preserved as base classes
|
|
221
|
+
currentClasses.forEach((className) => {
|
|
222
|
+
if (!allSourceClasses.has(className)) {
|
|
223
|
+
manager.baseClasses.add(className);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
manager.hasInitialized = true;
|
|
227
|
+
}
|
|
228
|
+
// Get classes from all sources, sorted by registration order (later takes precedence)
|
|
229
|
+
const sortedSources = Array.from(manager.sources.entries()).sort(([, a], [, b]) => a.order - b.order);
|
|
230
|
+
const allSourceClasses = [];
|
|
231
|
+
for (const [, source] of sortedSources) {
|
|
232
|
+
allSourceClasses.push(...source.classes);
|
|
233
|
+
}
|
|
234
|
+
// Combine base classes with all source classes, ensuring base classes take precedence
|
|
235
|
+
const classesToApply = allSourceClasses.length > 0 || manager.baseClasses.size > 0
|
|
236
|
+
? hlm([...allSourceClasses, ...manager.baseClasses])
|
|
237
|
+
: '';
|
|
238
|
+
// Apply the classes to the element
|
|
239
|
+
if (manager.element.className !== classesToApply) {
|
|
240
|
+
manager.element.className = classesToApply;
|
|
241
|
+
}
|
|
242
|
+
manager.isUpdating = false;
|
|
243
|
+
}
|
|
244
|
+
function cleanupManager(element) {
|
|
245
|
+
// Remove from global tracking
|
|
246
|
+
observedElements.delete(element);
|
|
247
|
+
elementClassManagers.delete(element);
|
|
248
|
+
// If no more elements being tracked, cleanup global observer
|
|
249
|
+
if (observedElements.size === 0 && globalObserver) {
|
|
250
|
+
globalObserver.disconnect();
|
|
251
|
+
globalObserver = null;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
// Cache for parsed class lists to avoid repeated string operations
|
|
255
|
+
const classListCache = new Map();
|
|
256
|
+
function toClassList(className) {
|
|
257
|
+
// For simple string inputs, use cache to avoid repeated parsing
|
|
258
|
+
if (typeof className === 'string' && classListCache.has(className)) {
|
|
259
|
+
return classListCache.get(className);
|
|
260
|
+
}
|
|
261
|
+
const result = clsx(className)
|
|
262
|
+
.split(' ')
|
|
263
|
+
.filter((c) => c.length > 0);
|
|
264
|
+
// Cache string results, but limit cache size to prevent memory growth
|
|
265
|
+
if (typeof className === 'string' && classListCache.size < 1000) {
|
|
266
|
+
classListCache.set(className, result);
|
|
267
|
+
}
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const _c0$9 = ["*", [["", "hlmAvatarImage", ""], ["", "brnAvatarImage", ""]], [["", "hlmAvatarFallback", ""], ["", "brnAvatarFallback", ""]]];
|
|
272
|
+
const _c1 = ["*", "[hlmAvatarImage],[brnAvatarImage]", "[hlmAvatarFallback],[brnAvatarFallback]"];
|
|
273
|
+
function HlmAvatar_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
274
|
+
i0.ɵɵprojection(0, 1);
|
|
275
|
+
} }
|
|
276
|
+
function HlmAvatar_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
277
|
+
i0.ɵɵprojection(0, 2);
|
|
278
|
+
} }
|
|
279
|
+
class HlmAvatar extends BrnAvatar {
|
|
280
|
+
size = input('default', /* @ts-ignore */
|
|
281
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
282
|
+
constructor() {
|
|
283
|
+
super();
|
|
284
|
+
classes(() => 'size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 group/avatar after:border-border relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten');
|
|
285
|
+
}
|
|
286
|
+
static ɵfac = function HlmAvatar_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmAvatar)(); };
|
|
287
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmAvatar, selectors: [["hlm-avatar"]], hostAttrs: ["data-slot", "avatar"], hostVars: 1, hostBindings: function HlmAvatar_HostBindings(rf, ctx) { if (rf & 2) {
|
|
288
|
+
i0.ɵɵattribute("data-size", ctx.size());
|
|
289
|
+
} }, inputs: { size: [1, "size"] }, features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c1, decls: 3, vars: 1, template: function HlmAvatar_Template(rf, ctx) { if (rf & 1) {
|
|
290
|
+
i0.ɵɵprojectionDef(_c0$9);
|
|
291
|
+
i0.ɵɵconditionalCreate(0, HlmAvatar_Conditional_0_Template, 1, 0)(1, HlmAvatar_Conditional_1_Template, 1, 0);
|
|
292
|
+
i0.ɵɵprojection(2);
|
|
293
|
+
} if (rf & 2) {
|
|
294
|
+
i0.ɵɵconditional(ctx._image()?.canShow() ? 0 : 1);
|
|
295
|
+
} }, encapsulation: 2 });
|
|
296
|
+
}
|
|
297
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmAvatar, [{
|
|
298
|
+
type: Component,
|
|
299
|
+
args: [{
|
|
300
|
+
selector: 'hlm-avatar',
|
|
301
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
302
|
+
host: {
|
|
303
|
+
'data-slot': 'avatar',
|
|
304
|
+
'[attr.data-size]': 'size()',
|
|
305
|
+
},
|
|
306
|
+
template: `
|
|
307
|
+
@if (_image()?.canShow()) {
|
|
308
|
+
<ng-content select="[hlmAvatarImage],[brnAvatarImage]" />
|
|
309
|
+
} @else {
|
|
310
|
+
<ng-content select="[hlmAvatarFallback],[brnAvatarFallback]" />
|
|
311
|
+
}
|
|
312
|
+
<ng-content />
|
|
313
|
+
`,
|
|
314
|
+
}]
|
|
315
|
+
}], () => [], { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] }); })();
|
|
316
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmAvatar, { className: "HlmAvatar", filePath: "lib/ui/avatar/src/lib/hlm-avatar.ts", lineNumber: 22 }); })();
|
|
317
|
+
|
|
318
|
+
class HlmAvatarBadge {
|
|
319
|
+
constructor() {
|
|
320
|
+
classes(() => [
|
|
321
|
+
'bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none',
|
|
322
|
+
'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>ng-icon]:hidden',
|
|
323
|
+
'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>ng-icon]:text-[calc(var(--spacing)*2)]',
|
|
324
|
+
'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>ng-icon]:text-[calc(var(--spacing)*2)]',
|
|
325
|
+
]);
|
|
326
|
+
}
|
|
327
|
+
static ɵfac = function HlmAvatarBadge_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmAvatarBadge)(); };
|
|
328
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmAvatarBadge, selectors: [["", "hlmAvatarBadge", ""], ["hlm-avatar-badge"]], hostAttrs: ["data-slot", "avatar-badge"] });
|
|
329
|
+
}
|
|
330
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmAvatarBadge, [{
|
|
331
|
+
type: Directive,
|
|
332
|
+
args: [{
|
|
333
|
+
selector: '[hlmAvatarBadge],hlm-avatar-badge',
|
|
334
|
+
host: {
|
|
335
|
+
'data-slot': 'avatar-badge',
|
|
336
|
+
},
|
|
337
|
+
}]
|
|
338
|
+
}], () => [], null); })();
|
|
339
|
+
|
|
340
|
+
class HlmAvatarFallback {
|
|
341
|
+
constructor() {
|
|
342
|
+
classes(() => 'bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs');
|
|
343
|
+
}
|
|
344
|
+
static ɵfac = function HlmAvatarFallback_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmAvatarFallback)(); };
|
|
345
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmAvatarFallback, selectors: [["", "hlmAvatarFallback", ""]], hostAttrs: ["data-slot", "avatar-fallback"], exportAs: ["avatarFallback"], features: [i0.ɵɵHostDirectivesFeature([i1.BrnAvatarFallback])] });
|
|
346
|
+
}
|
|
347
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmAvatarFallback, [{
|
|
348
|
+
type: Directive,
|
|
349
|
+
args: [{
|
|
350
|
+
selector: '[hlmAvatarFallback]',
|
|
351
|
+
exportAs: 'avatarFallback',
|
|
352
|
+
hostDirectives: [BrnAvatarFallback],
|
|
353
|
+
host: {
|
|
354
|
+
'data-slot': 'avatar-fallback',
|
|
355
|
+
},
|
|
356
|
+
}]
|
|
357
|
+
}], () => [], null); })();
|
|
358
|
+
|
|
359
|
+
class HlmAvatarGroup {
|
|
360
|
+
constructor() {
|
|
361
|
+
classes(() => '*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2');
|
|
362
|
+
}
|
|
363
|
+
static ɵfac = function HlmAvatarGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmAvatarGroup)(); };
|
|
364
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmAvatarGroup, selectors: [["", "hlmAvatarGroup", ""], ["hlm-avatar-group"]], hostAttrs: ["data-slot", "avatar-group"] });
|
|
365
|
+
}
|
|
366
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmAvatarGroup, [{
|
|
367
|
+
type: Directive,
|
|
368
|
+
args: [{
|
|
369
|
+
selector: '[hlmAvatarGroup],hlm-avatar-group',
|
|
370
|
+
host: {
|
|
371
|
+
'data-slot': 'avatar-group',
|
|
372
|
+
},
|
|
373
|
+
}]
|
|
374
|
+
}], () => [], null); })();
|
|
375
|
+
|
|
376
|
+
class HlmAvatarGroupCount {
|
|
377
|
+
constructor() {
|
|
378
|
+
classes(() => 'bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>ng-icon]:text-base group-has-data-[size=lg]/avatar-group:[&>ng-icon]:text-xl group-has-data-[size=sm]/avatar-group:[&>ng-icon]:text-xs');
|
|
379
|
+
}
|
|
380
|
+
static ɵfac = function HlmAvatarGroupCount_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmAvatarGroupCount)(); };
|
|
381
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmAvatarGroupCount, selectors: [["", "hlmAvatarGroupCount", ""], ["hlm-avatar-group-count"]], hostAttrs: ["data-slot", "avatar-group-count"] });
|
|
382
|
+
}
|
|
383
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmAvatarGroupCount, [{
|
|
384
|
+
type: Directive,
|
|
385
|
+
args: [{
|
|
386
|
+
selector: '[hlmAvatarGroupCount],hlm-avatar-group-count',
|
|
387
|
+
host: {
|
|
388
|
+
'data-slot': 'avatar-group-count',
|
|
389
|
+
},
|
|
390
|
+
}]
|
|
391
|
+
}], () => [], null); })();
|
|
392
|
+
|
|
393
|
+
class HlmAvatarImage {
|
|
394
|
+
canShow = inject(BrnAvatarImage).canShow;
|
|
395
|
+
constructor() {
|
|
396
|
+
classes(() => 'rounded-full aspect-square size-full object-cover');
|
|
397
|
+
}
|
|
398
|
+
static ɵfac = function HlmAvatarImage_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmAvatarImage)(); };
|
|
399
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmAvatarImage, selectors: [["img", "hlmAvatarImage", ""]], hostAttrs: ["data-slot", "avatar-image"], exportAs: ["avatarImage"], features: [i0.ɵɵHostDirectivesFeature([i1.BrnAvatarImage])] });
|
|
400
|
+
}
|
|
401
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmAvatarImage, [{
|
|
402
|
+
type: Directive,
|
|
403
|
+
args: [{
|
|
404
|
+
selector: 'img[hlmAvatarImage]',
|
|
405
|
+
exportAs: 'avatarImage',
|
|
406
|
+
hostDirectives: [BrnAvatarImage],
|
|
407
|
+
host: {
|
|
408
|
+
'data-slot': 'avatar-image',
|
|
409
|
+
},
|
|
410
|
+
}]
|
|
411
|
+
}], () => [], null); })();
|
|
412
|
+
|
|
413
|
+
const HlmAvatarImports = [
|
|
414
|
+
HlmAvatar,
|
|
415
|
+
HlmAvatarBadge,
|
|
416
|
+
HlmAvatarFallback,
|
|
417
|
+
HlmAvatarGroup,
|
|
418
|
+
HlmAvatarGroupCount,
|
|
419
|
+
HlmAvatarImage,
|
|
420
|
+
];
|
|
421
|
+
|
|
422
|
+
class HlmBreadcrumb {
|
|
423
|
+
ariaLabel = input('breadcrumb', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
424
|
+
static ɵfac = function HlmBreadcrumb_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmBreadcrumb)(); };
|
|
425
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmBreadcrumb, selectors: [["", "hlmBreadcrumb", ""]], hostAttrs: ["data-slot", "breadcrumb", "role", "navigation"], hostVars: 1, hostBindings: function HlmBreadcrumb_HostBindings(rf, ctx) { if (rf & 2) {
|
|
426
|
+
i0.ɵɵattribute("aria-label", ctx.ariaLabel());
|
|
427
|
+
} }, inputs: { ariaLabel: [1, "aria-label", "ariaLabel"] } });
|
|
428
|
+
}
|
|
429
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmBreadcrumb, [{
|
|
430
|
+
type: Directive,
|
|
431
|
+
args: [{
|
|
432
|
+
selector: '[hlmBreadcrumb]',
|
|
433
|
+
host: {
|
|
434
|
+
'data-slot': 'breadcrumb',
|
|
435
|
+
role: 'navigation',
|
|
436
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
437
|
+
},
|
|
438
|
+
}]
|
|
439
|
+
}], null, { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] }); })();
|
|
440
|
+
|
|
441
|
+
const defaultConfig$4 = {
|
|
442
|
+
size: 'base',
|
|
443
|
+
};
|
|
444
|
+
const HlmIconConfigToken = new InjectionToken('HlmIconConfig');
|
|
445
|
+
function provideHlmIconConfig(config) {
|
|
446
|
+
return { provide: HlmIconConfigToken, useValue: { ...defaultConfig$4, ...config } };
|
|
447
|
+
}
|
|
448
|
+
function injectHlmIconConfig() {
|
|
449
|
+
return inject(HlmIconConfigToken, { optional: true }) ?? defaultConfig$4;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
class HlmIcon {
|
|
453
|
+
_config = injectHlmIconConfig();
|
|
454
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
455
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
456
|
+
_computedSize = computed(() => {
|
|
457
|
+
const size = this.size();
|
|
458
|
+
switch (size) {
|
|
459
|
+
case 'xs':
|
|
460
|
+
return '12px';
|
|
461
|
+
case 'sm':
|
|
462
|
+
return '16px';
|
|
463
|
+
case 'base':
|
|
464
|
+
return '24px';
|
|
465
|
+
case 'lg':
|
|
466
|
+
return '32px';
|
|
467
|
+
case 'xl':
|
|
468
|
+
return '48px';
|
|
469
|
+
default: {
|
|
470
|
+
return size;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}, /* @ts-ignore */
|
|
474
|
+
...(ngDevMode ? [{ debugName: "_computedSize" }] : /* istanbul ignore next */ []));
|
|
475
|
+
static ɵfac = function HlmIcon_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmIcon)(); };
|
|
476
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmIcon, selectors: [["ng-icon", "hlmIcon", ""], ["ng-icon", "hlm", ""]], hostVars: 2, hostBindings: function HlmIcon_HostBindings(rf, ctx) { if (rf & 2) {
|
|
477
|
+
i0.ɵɵstyleProp("--ng-icon__size", ctx._computedSize());
|
|
478
|
+
} }, inputs: { size: [1, "size"] } });
|
|
479
|
+
}
|
|
480
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmIcon, [{
|
|
481
|
+
type: Directive,
|
|
482
|
+
args: [{
|
|
483
|
+
selector: 'ng-icon[hlmIcon], ng-icon[hlm]',
|
|
484
|
+
host: {
|
|
485
|
+
'[style.--ng-icon__size]': '_computedSize()',
|
|
486
|
+
},
|
|
487
|
+
}]
|
|
488
|
+
}], null, { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] }); })();
|
|
489
|
+
|
|
490
|
+
const HlmIconImports = [HlmIcon, NgIcon];
|
|
491
|
+
|
|
492
|
+
class HlmBreadcrumbEllipsis {
|
|
493
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
494
|
+
/** Screen reader only text for the ellipsis */
|
|
495
|
+
srOnlyText = input('More', /* @ts-ignore */
|
|
496
|
+
...(ngDevMode ? [{ debugName: "srOnlyText" }] : /* istanbul ignore next */ []));
|
|
497
|
+
_computedClass = computed(() => hlm('size-5 [&>ng-icon]:text-[calc(var(--spacing)*4)] flex items-center justify-center', this.userClass()), /* @ts-ignore */
|
|
498
|
+
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
499
|
+
static ɵfac = function HlmBreadcrumbEllipsis_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmBreadcrumbEllipsis)(); };
|
|
500
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmBreadcrumbEllipsis, selectors: [["hlm-breadcrumb-ellipsis"]], inputs: { userClass: [1, "class", "userClass"], srOnlyText: [1, "srOnlyText"] }, features: [i0.ɵɵProvidersFeature([provideIcons({ phosphorDotsThree })])], decls: 4, vars: 3, consts: [["data-slot", "breadcrumb-ellipsis", "role", "presentation", "aria-hidden", "true"], ["hlm", "", "size", "sm", "name", "phosphorDotsThree"], [1, "sr-only"]], template: function HlmBreadcrumbEllipsis_Template(rf, ctx) { if (rf & 1) {
|
|
501
|
+
i0.ɵɵelementStart(0, "span", 0);
|
|
502
|
+
i0.ɵɵelement(1, "ng-icon", 1);
|
|
503
|
+
i0.ɵɵelementStart(2, "span", 2);
|
|
504
|
+
i0.ɵɵtext(3);
|
|
505
|
+
i0.ɵɵelementEnd()();
|
|
506
|
+
} if (rf & 2) {
|
|
507
|
+
i0.ɵɵclassMap(ctx._computedClass());
|
|
508
|
+
i0.ɵɵadvance(3);
|
|
509
|
+
i0.ɵɵtextInterpolate(ctx.srOnlyText());
|
|
510
|
+
} }, dependencies: [NgIcon, HlmIcon], encapsulation: 2 });
|
|
511
|
+
}
|
|
512
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmBreadcrumbEllipsis, [{
|
|
513
|
+
type: Component,
|
|
514
|
+
args: [{
|
|
515
|
+
selector: 'hlm-breadcrumb-ellipsis',
|
|
516
|
+
imports: [NgIcon, HlmIcon],
|
|
517
|
+
providers: [provideIcons({ phosphorDotsThree })],
|
|
518
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
519
|
+
template: `
|
|
520
|
+
<span
|
|
521
|
+
data-slot="breadcrumb-ellipsis"
|
|
522
|
+
role="presentation"
|
|
523
|
+
aria-hidden="true"
|
|
524
|
+
[class]="_computedClass()"
|
|
525
|
+
>
|
|
526
|
+
<ng-icon hlm size="sm" name="phosphorDotsThree" />
|
|
527
|
+
<span class="sr-only">{{ srOnlyText() }}</span>
|
|
528
|
+
</span>
|
|
529
|
+
`,
|
|
530
|
+
}]
|
|
531
|
+
}], null, { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], srOnlyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "srOnlyText", required: false }] }] }); })();
|
|
532
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmBreadcrumbEllipsis, { className: "HlmBreadcrumbEllipsis", filePath: "lib/ui/breadcrumb/src/lib/hlm-breadcrumb-ellipsis.ts", lineNumber: 25 }); })();
|
|
533
|
+
|
|
534
|
+
class HlmBreadcrumbItem {
|
|
535
|
+
constructor() {
|
|
536
|
+
classes(() => 'gap-1.5 inline-flex items-center');
|
|
537
|
+
}
|
|
538
|
+
static ɵfac = function HlmBreadcrumbItem_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmBreadcrumbItem)(); };
|
|
539
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmBreadcrumbItem, selectors: [["", "hlmBreadcrumbItem", ""]], hostAttrs: ["data-slot", "breadcrumb-item"] });
|
|
540
|
+
}
|
|
541
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmBreadcrumbItem, [{
|
|
542
|
+
type: Directive,
|
|
543
|
+
args: [{
|
|
544
|
+
selector: '[hlmBreadcrumbItem]',
|
|
545
|
+
host: {
|
|
546
|
+
'data-slot': 'breadcrumb-item',
|
|
547
|
+
},
|
|
548
|
+
}]
|
|
549
|
+
}], () => [], null); })();
|
|
550
|
+
|
|
551
|
+
class HlmBreadcrumbLink {
|
|
552
|
+
/** The link to navigate to the page. */
|
|
553
|
+
link = input(/* @ts-ignore */
|
|
554
|
+
...(ngDevMode ? [undefined, { debugName: "link" }] : /* istanbul ignore next */ []));
|
|
555
|
+
constructor() {
|
|
556
|
+
classes(() => 'hover:text-foreground transition-colors');
|
|
557
|
+
}
|
|
558
|
+
static ɵfac = function HlmBreadcrumbLink_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmBreadcrumbLink)(); };
|
|
559
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmBreadcrumbLink, selectors: [["", "hlmBreadcrumbLink", ""]], hostAttrs: ["data-slot", "breadcrumb-link"], inputs: { link: [1, "link"] }, features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$1.RouterLink, inputs: ["target", "target", "queryParams", "queryParams", "fragment", "fragment", "queryParamsHandling", "queryParamsHandling", "state", "state", "info", "info", "relativeTo", "relativeTo", "preserveFragment", "preserveFragment", "skipLocationChange", "skipLocationChange", "replaceUrl", "replaceUrl", "routerLink", "link"] }])] });
|
|
560
|
+
}
|
|
561
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmBreadcrumbLink, [{
|
|
562
|
+
type: Directive,
|
|
563
|
+
args: [{
|
|
564
|
+
selector: '[hlmBreadcrumbLink]',
|
|
565
|
+
hostDirectives: [
|
|
566
|
+
{
|
|
567
|
+
directive: RouterLink,
|
|
568
|
+
inputs: [
|
|
569
|
+
'target',
|
|
570
|
+
'queryParams',
|
|
571
|
+
'fragment',
|
|
572
|
+
'queryParamsHandling',
|
|
573
|
+
'state',
|
|
574
|
+
'info',
|
|
575
|
+
'relativeTo',
|
|
576
|
+
'preserveFragment',
|
|
577
|
+
'skipLocationChange',
|
|
578
|
+
'replaceUrl',
|
|
579
|
+
'routerLink: link',
|
|
580
|
+
],
|
|
581
|
+
},
|
|
582
|
+
],
|
|
583
|
+
host: {
|
|
584
|
+
'data-slot': 'breadcrumb-link',
|
|
585
|
+
},
|
|
586
|
+
}]
|
|
587
|
+
}], () => [], { link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: false }] }] }); })();
|
|
588
|
+
|
|
589
|
+
class HlmBreadcrumbList {
|
|
590
|
+
constructor() {
|
|
591
|
+
classes(() => 'text-muted-foreground gap-1.5 text-sm sm:gap-2.5 flex flex-wrap items-center wrap-break-word');
|
|
592
|
+
}
|
|
593
|
+
static ɵfac = function HlmBreadcrumbList_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmBreadcrumbList)(); };
|
|
594
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmBreadcrumbList, selectors: [["", "hlmBreadcrumbList", ""]], hostAttrs: ["data-slot", "breadcrumb-list"] });
|
|
595
|
+
}
|
|
596
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmBreadcrumbList, [{
|
|
597
|
+
type: Directive,
|
|
598
|
+
args: [{
|
|
599
|
+
selector: '[hlmBreadcrumbList]',
|
|
600
|
+
host: {
|
|
601
|
+
'data-slot': 'breadcrumb-list',
|
|
602
|
+
},
|
|
603
|
+
}]
|
|
604
|
+
}], () => [], null); })();
|
|
605
|
+
|
|
606
|
+
class HlmBreadcrumbPage {
|
|
607
|
+
constructor() {
|
|
608
|
+
classes(() => 'text-foreground font-normal');
|
|
609
|
+
}
|
|
610
|
+
static ɵfac = function HlmBreadcrumbPage_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmBreadcrumbPage)(); };
|
|
611
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmBreadcrumbPage, selectors: [["", "hlmBreadcrumbPage", ""]], hostAttrs: ["data-slot", "breadcrumb-page", "role", "link", "aria-disabled", "true", "aria-current", "page"] });
|
|
612
|
+
}
|
|
613
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmBreadcrumbPage, [{
|
|
614
|
+
type: Directive,
|
|
615
|
+
args: [{
|
|
616
|
+
selector: '[hlmBreadcrumbPage]',
|
|
617
|
+
host: {
|
|
618
|
+
'data-slot': 'breadcrumb-page',
|
|
619
|
+
role: 'link',
|
|
620
|
+
'aria-disabled': 'true',
|
|
621
|
+
'aria-current': 'page',
|
|
622
|
+
},
|
|
623
|
+
}]
|
|
624
|
+
}], () => [], null); })();
|
|
625
|
+
|
|
626
|
+
const _c0$8 = ["*"];
|
|
627
|
+
function HlmBreadcrumbSeparator_ProjectionFallback_0_Template(rf, ctx) { if (rf & 1) {
|
|
628
|
+
i0.ɵɵelement(0, "ng-icon", 0);
|
|
629
|
+
} }
|
|
630
|
+
class HlmBreadcrumbSeparator {
|
|
631
|
+
constructor() {
|
|
632
|
+
classes(() => '[&>ng-icon]:text-[calc(var(--spacing)*3.5)] [&>ng-icon]:flex');
|
|
633
|
+
}
|
|
634
|
+
static ɵfac = function HlmBreadcrumbSeparator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmBreadcrumbSeparator)(); };
|
|
635
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmBreadcrumbSeparator, selectors: [["", "hlmBreadcrumbSeparator", ""]], hostAttrs: ["data-slot", "breadcrumb-separator", "role", "presentation", "aria-hidden", "true"], features: [i0.ɵɵProvidersFeature([provideIcons({ phosphorCaretRight })])], ngContentSelectors: _c0$8, decls: 2, vars: 0, consts: [["name", "phosphorCaretRight"]], template: function HlmBreadcrumbSeparator_Template(rf, ctx) { if (rf & 1) {
|
|
636
|
+
i0.ɵɵprojectionDef();
|
|
637
|
+
i0.ɵɵprojection(0, 0, null, HlmBreadcrumbSeparator_ProjectionFallback_0_Template, 1, 0);
|
|
638
|
+
} }, dependencies: [NgIcon], encapsulation: 2 });
|
|
639
|
+
}
|
|
640
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmBreadcrumbSeparator, [{
|
|
641
|
+
type: Component,
|
|
642
|
+
args: [{
|
|
643
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
644
|
+
selector: '[hlmBreadcrumbSeparator]',
|
|
645
|
+
imports: [NgIcon],
|
|
646
|
+
providers: [provideIcons({ phosphorCaretRight })],
|
|
647
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
648
|
+
host: {
|
|
649
|
+
'data-slot': 'breadcrumb-separator',
|
|
650
|
+
role: 'presentation',
|
|
651
|
+
'aria-hidden': 'true',
|
|
652
|
+
},
|
|
653
|
+
template: `
|
|
654
|
+
<ng-content>
|
|
655
|
+
<ng-icon name="phosphorCaretRight" />
|
|
656
|
+
</ng-content>
|
|
657
|
+
`,
|
|
658
|
+
}]
|
|
659
|
+
}], () => [], null); })();
|
|
660
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmBreadcrumbSeparator, { className: "HlmBreadcrumbSeparator", filePath: "lib/ui/breadcrumb/src/lib/hlm-breadcrumb-separator.ts", lineNumber: 23 }); })();
|
|
661
|
+
|
|
662
|
+
const HlmBreadcrumbImports = [
|
|
663
|
+
HlmBreadcrumb,
|
|
664
|
+
HlmBreadcrumbEllipsis,
|
|
665
|
+
HlmBreadcrumbSeparator,
|
|
666
|
+
HlmBreadcrumbItem,
|
|
667
|
+
HlmBreadcrumbLink,
|
|
668
|
+
HlmBreadcrumbPage,
|
|
669
|
+
HlmBreadcrumbList,
|
|
670
|
+
];
|
|
671
|
+
/**
|
|
672
|
+
* @deprecated Use `HlmBreadcrumbImports` instead.
|
|
673
|
+
*/
|
|
674
|
+
const HlmBreadCrumbImports = HlmBreadcrumbImports;
|
|
675
|
+
|
|
676
|
+
const defaultConfig$3 = {
|
|
677
|
+
variant: 'default',
|
|
678
|
+
size: 'default',
|
|
679
|
+
};
|
|
680
|
+
const BrnButtonConfigToken = new InjectionToken('BrnButtonConfig');
|
|
681
|
+
function provideBrnButtonConfig(config) {
|
|
682
|
+
return { provide: BrnButtonConfigToken, useValue: { ...defaultConfig$3, ...config } };
|
|
683
|
+
}
|
|
684
|
+
function injectBrnButtonConfig() {
|
|
685
|
+
return inject(BrnButtonConfigToken, { optional: true }) ?? defaultConfig$3;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const variantClasses = {
|
|
689
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/80',
|
|
690
|
+
outline: 'border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs',
|
|
691
|
+
secondary: 'bg-secondary text-secondary-foreground aria-expanded:bg-secondary aria-expanded:text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]',
|
|
692
|
+
ghost: 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
693
|
+
destructive: 'bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30',
|
|
694
|
+
link: 'text-link underline-offset-4 hover:underline',
|
|
695
|
+
};
|
|
696
|
+
const sizeClasses = {
|
|
697
|
+
default: 'h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
698
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_ng-icon:not([class*='text-'])]:text-[calc(var(--spacing)*3)]",
|
|
699
|
+
sm: 'h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',
|
|
700
|
+
lg: 'h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
701
|
+
icon: 'size-9',
|
|
702
|
+
'icon-xs': "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_ng-icon:not([class*='text-'])]:text-[calc(var(--spacing)*3)]",
|
|
703
|
+
'icon-sm': 'size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md',
|
|
704
|
+
'icon-lg': 'size-10',
|
|
705
|
+
};
|
|
706
|
+
const buttonVariants = cva("focus-visible:border-ring focus-visible:ring-ring/50 data-[matches-spartan-invalid=true]:ring-destructive/20 dark:data-[matches-spartan-invalid=true]:ring-destructive/40 data-[matches-spartan-invalid=true]:border-destructive dark:data-[matches-spartan-invalid=true]:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px data-[matches-spartan-invalid=true]:ring-3 [&_ng-icon:not([class*='text-'])]:text-[calc(var(--spacing)*4)] group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0", {
|
|
707
|
+
variants: {
|
|
708
|
+
variant: variantClasses,
|
|
709
|
+
size: sizeClasses,
|
|
710
|
+
},
|
|
711
|
+
defaultVariants: {
|
|
712
|
+
variant: 'default',
|
|
713
|
+
size: 'default',
|
|
714
|
+
},
|
|
715
|
+
});
|
|
716
|
+
class HlmButton {
|
|
717
|
+
_config = injectBrnButtonConfig();
|
|
718
|
+
_additionalClasses = signal('', /* @ts-ignore */
|
|
719
|
+
...(ngDevMode ? [{ debugName: "_additionalClasses" }] : /* istanbul ignore next */ []));
|
|
720
|
+
variant = input(this._config.variant, /* @ts-ignore */
|
|
721
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
722
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
723
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
724
|
+
constructor() {
|
|
725
|
+
classes(() => [
|
|
726
|
+
buttonVariants({ variant: this.variant(), size: this.size() }),
|
|
727
|
+
this._additionalClasses(),
|
|
728
|
+
]);
|
|
729
|
+
}
|
|
730
|
+
setClass(classes) {
|
|
731
|
+
this._additionalClasses.set(classes);
|
|
732
|
+
}
|
|
733
|
+
static ɵfac = function HlmButton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmButton)(); };
|
|
734
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmButton, selectors: [["button", "hlmBtn", ""], ["a", "hlmBtn", ""]], hostAttrs: ["data-slot", "button"], inputs: { variant: [1, "variant"], size: [1, "size"] }, exportAs: ["hlmBtn"], features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$2.BrnButton, inputs: ["disabled", "disabled"] }])] });
|
|
735
|
+
}
|
|
736
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmButton, [{
|
|
737
|
+
type: Directive,
|
|
738
|
+
args: [{
|
|
739
|
+
selector: 'button[hlmBtn], a[hlmBtn]',
|
|
740
|
+
exportAs: 'hlmBtn',
|
|
741
|
+
hostDirectives: [{ directive: BrnButton, inputs: ['disabled'] }],
|
|
742
|
+
host: { 'data-slot': 'button' },
|
|
743
|
+
}]
|
|
744
|
+
}], () => [], { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] }); })();
|
|
745
|
+
|
|
746
|
+
const HlmButtonImports = [HlmButton];
|
|
747
|
+
|
|
748
|
+
const defaultConfig$2 = {
|
|
749
|
+
size: 'default',
|
|
750
|
+
};
|
|
751
|
+
const HlmCardConfigToken = new InjectionToken('HlmCardConfig');
|
|
752
|
+
function provideHlmCardConfig(config) {
|
|
753
|
+
return { provide: HlmCardConfigToken, useValue: { ...defaultConfig$2, ...config } };
|
|
754
|
+
}
|
|
755
|
+
function injectHlmCardConfig() {
|
|
756
|
+
return inject(HlmCardConfigToken, { optional: true }) ?? defaultConfig$2;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
class HlmCard {
|
|
760
|
+
_defaultConfig = injectHlmCardConfig();
|
|
761
|
+
size = input(this._defaultConfig.size, /* @ts-ignore */
|
|
762
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
763
|
+
constructor() {
|
|
764
|
+
classes(() => 'ring-foreground/10 bg-card text-card-foreground gap-(--card-spacing) overflow-hidden rounded-xl py-(--card-spacing) text-sm shadow-xs ring-1 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col');
|
|
765
|
+
}
|
|
766
|
+
static ɵfac = function HlmCard_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmCard)(); };
|
|
767
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmCard, selectors: [["", "hlmCard", ""], ["hlm-card"]], hostAttrs: ["data-slot", "card"], hostVars: 1, hostBindings: function HlmCard_HostBindings(rf, ctx) { if (rf & 2) {
|
|
768
|
+
i0.ɵɵattribute("data-size", ctx.size());
|
|
769
|
+
} }, inputs: { size: [1, "size"] } });
|
|
770
|
+
}
|
|
771
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmCard, [{
|
|
772
|
+
type: Directive,
|
|
773
|
+
args: [{
|
|
774
|
+
selector: '[hlmCard],hlm-card',
|
|
775
|
+
host: {
|
|
776
|
+
'data-slot': 'card',
|
|
777
|
+
'[attr.data-size]': 'size()',
|
|
778
|
+
},
|
|
779
|
+
}]
|
|
780
|
+
}], () => [], { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] }); })();
|
|
781
|
+
|
|
782
|
+
class HlmCardAction {
|
|
783
|
+
constructor() {
|
|
784
|
+
classes(() => 'col-start-2 row-span-2 row-start-1 self-start justify-self-end');
|
|
785
|
+
}
|
|
786
|
+
static ɵfac = function HlmCardAction_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmCardAction)(); };
|
|
787
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmCardAction, selectors: [["", "hlmCardAction", ""]], hostAttrs: ["data-slot", "card-action"] });
|
|
788
|
+
}
|
|
789
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmCardAction, [{
|
|
790
|
+
type: Directive,
|
|
791
|
+
args: [{
|
|
792
|
+
selector: '[hlmCardAction]',
|
|
793
|
+
host: { 'data-slot': 'card-action' },
|
|
794
|
+
}]
|
|
795
|
+
}], () => [], null); })();
|
|
796
|
+
|
|
797
|
+
class HlmCardContent {
|
|
798
|
+
constructor() {
|
|
799
|
+
classes(() => 'px-(--card-spacing)');
|
|
800
|
+
}
|
|
801
|
+
static ɵfac = function HlmCardContent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmCardContent)(); };
|
|
802
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmCardContent, selectors: [["", "hlmCardContent", ""]], hostAttrs: ["data-slot", "card-content"] });
|
|
803
|
+
}
|
|
804
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmCardContent, [{
|
|
805
|
+
type: Directive,
|
|
806
|
+
args: [{
|
|
807
|
+
selector: '[hlmCardContent]',
|
|
808
|
+
host: { 'data-slot': 'card-content' },
|
|
809
|
+
}]
|
|
810
|
+
}], () => [], null); })();
|
|
811
|
+
|
|
812
|
+
class HlmCardDescription {
|
|
813
|
+
constructor() {
|
|
814
|
+
classes(() => 'text-muted-foreground text-sm');
|
|
815
|
+
}
|
|
816
|
+
static ɵfac = function HlmCardDescription_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmCardDescription)(); };
|
|
817
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmCardDescription, selectors: [["", "hlmCardDescription", ""]], hostAttrs: ["data-slot", "card-description"] });
|
|
818
|
+
}
|
|
819
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmCardDescription, [{
|
|
820
|
+
type: Directive,
|
|
821
|
+
args: [{
|
|
822
|
+
selector: '[hlmCardDescription]',
|
|
823
|
+
host: { 'data-slot': 'card-description' },
|
|
824
|
+
}]
|
|
825
|
+
}], () => [], null); })();
|
|
826
|
+
|
|
827
|
+
class HlmCardFooter {
|
|
828
|
+
constructor() {
|
|
829
|
+
classes(() => 'rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing) flex items-center');
|
|
830
|
+
}
|
|
831
|
+
static ɵfac = function HlmCardFooter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmCardFooter)(); };
|
|
832
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmCardFooter, selectors: [["", "hlmCardFooter", ""], ["hlm-card-footer"]], hostAttrs: ["data-slot", "card-footer"] });
|
|
833
|
+
}
|
|
834
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmCardFooter, [{
|
|
835
|
+
type: Directive,
|
|
836
|
+
args: [{
|
|
837
|
+
selector: '[hlmCardFooter],hlm-card-footer',
|
|
838
|
+
host: { 'data-slot': 'card-footer' },
|
|
839
|
+
}]
|
|
840
|
+
}], () => [], null); })();
|
|
841
|
+
|
|
842
|
+
class HlmCardHeader {
|
|
843
|
+
constructor() {
|
|
844
|
+
classes(() => 'gap-1 rounded-t-xl px-(--card-spacing) [.border-b]:pb-(--card-spacing) group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]');
|
|
845
|
+
}
|
|
846
|
+
static ɵfac = function HlmCardHeader_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmCardHeader)(); };
|
|
847
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmCardHeader, selectors: [["", "hlmCardHeader", ""], ["hlm-card-header"]], hostAttrs: ["data-slot", "card-header"] });
|
|
848
|
+
}
|
|
849
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmCardHeader, [{
|
|
850
|
+
type: Directive,
|
|
851
|
+
args: [{
|
|
852
|
+
selector: '[hlmCardHeader],hlm-card-header',
|
|
853
|
+
host: { 'data-slot': 'card-header' },
|
|
854
|
+
}]
|
|
855
|
+
}], () => [], null); })();
|
|
856
|
+
|
|
857
|
+
class HlmCardTitle {
|
|
858
|
+
constructor() {
|
|
859
|
+
classes(() => 'text-base leading-normal font-medium group-data-[size=sm]/card:text-sm');
|
|
860
|
+
}
|
|
861
|
+
static ɵfac = function HlmCardTitle_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmCardTitle)(); };
|
|
862
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmCardTitle, selectors: [["", "hlmCardTitle", ""]], hostAttrs: ["data-slot", "card-title"] });
|
|
863
|
+
}
|
|
864
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmCardTitle, [{
|
|
865
|
+
type: Directive,
|
|
866
|
+
args: [{
|
|
867
|
+
selector: '[hlmCardTitle]',
|
|
868
|
+
host: { 'data-slot': 'card-title' },
|
|
869
|
+
}]
|
|
870
|
+
}], () => [], null); })();
|
|
871
|
+
|
|
872
|
+
const HlmCardImports = [
|
|
873
|
+
HlmCard,
|
|
874
|
+
HlmCardAction,
|
|
875
|
+
HlmCardContent,
|
|
876
|
+
HlmCardDescription,
|
|
877
|
+
HlmCardFooter,
|
|
878
|
+
HlmCardHeader,
|
|
879
|
+
HlmCardTitle,
|
|
880
|
+
];
|
|
881
|
+
|
|
882
|
+
function HlmCheckbox_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
883
|
+
i0.ɵɵelementStart(0, "span", 1);
|
|
884
|
+
i0.ɵɵelement(1, "ng-icon", 2);
|
|
885
|
+
i0.ɵɵelementEnd();
|
|
886
|
+
} }
|
|
887
|
+
const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
888
|
+
provide: NG_VALUE_ACCESSOR,
|
|
889
|
+
useExisting: forwardRef(() => HlmCheckbox),
|
|
890
|
+
multi: true,
|
|
891
|
+
};
|
|
892
|
+
class HlmCheckbox {
|
|
893
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
894
|
+
_computedClass = computed(() => hlm('border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary data-[matches-spartan-invalid=true]:aria-checked:border-primary data-[matches-spartan-invalid=true]:border-destructive dark:data-[matches-spartan-invalid=true]:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 data-[matches-spartan-invalid=true]:ring-destructive/20 dark:data-[matches-spartan-invalid=true]:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border shadow-xs transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-3 data-[matches-spartan-invalid=true]:ring-3 peer shrink-0 cursor-default outline-none disabled:cursor-not-allowed disabled:opacity-50', this.userClass(), this._errorStateClass()), /* @ts-ignore */
|
|
895
|
+
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
896
|
+
/** Used to set the id on the underlying brn element. */
|
|
897
|
+
inputId = input(null, /* @ts-ignore */
|
|
898
|
+
...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
899
|
+
/** Used to set the aria-label attribute on the underlying brn element. */
|
|
900
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
901
|
+
/** Used to set the aria-labelledby attribute on the underlying brn element. */
|
|
902
|
+
ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
903
|
+
/** Used to set the aria-describedby attribute on the underlying brn element. */
|
|
904
|
+
ariaDescribedby = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
|
|
905
|
+
/** The checked state of the checkbox. */
|
|
906
|
+
checkedInput = input(false, { ...(ngDevMode ? { debugName: "checkedInput" } : /* istanbul ignore next */ {}), alias: 'checked',
|
|
907
|
+
transform: booleanAttribute });
|
|
908
|
+
checked = linkedSignal(this.checkedInput, /* @ts-ignore */
|
|
909
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
910
|
+
/** Emits when checked state changes. */
|
|
911
|
+
checkedChange = output();
|
|
912
|
+
/**
|
|
913
|
+
* The indeterminate state of the checkbox.
|
|
914
|
+
* For example, a "select all/deselect all" checkbox may be in the indeterminate state when some but not all of its sub-controls are checked.
|
|
915
|
+
*/
|
|
916
|
+
indeterminate = model(false, /* @ts-ignore */
|
|
917
|
+
...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
918
|
+
/** The name attribute of the checkbox. */
|
|
919
|
+
name = input(null, /* @ts-ignore */
|
|
920
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
921
|
+
/** Whether the checkbox is required. */
|
|
922
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
923
|
+
/** Whether the checkbox is disabled. */
|
|
924
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
925
|
+
/** Whether to force the checkbox into an invalid state. */
|
|
926
|
+
forceInvalid = input(false, { ...(ngDevMode ? { debugName: "forceInvalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
927
|
+
_disabled = linkedSignal(this.disabled, /* @ts-ignore */
|
|
928
|
+
...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
929
|
+
_brnCheckbox = viewChild.required(BrnCheckbox);
|
|
930
|
+
_spartanInvalid = computed(() => this.forceInvalid() || this._brnCheckbox().spartanInvalid?.(), /* @ts-ignore */
|
|
931
|
+
...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []));
|
|
932
|
+
_errorStateClass = computed(() => this._spartanInvalid()
|
|
933
|
+
? 'border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40'
|
|
934
|
+
: '', /* @ts-ignore */
|
|
935
|
+
...(ngDevMode ? [{ debugName: "_errorStateClass" }] : /* istanbul ignore next */ []));
|
|
936
|
+
_onChange;
|
|
937
|
+
_onTouched;
|
|
938
|
+
_handleChange(value) {
|
|
939
|
+
if (this._disabled())
|
|
940
|
+
return;
|
|
941
|
+
this.checked.set(value);
|
|
942
|
+
this.checkedChange.emit(value);
|
|
943
|
+
this._onChange?.(value);
|
|
944
|
+
}
|
|
945
|
+
/** CONTROL VALUE ACCESSOR */
|
|
946
|
+
writeValue(value) {
|
|
947
|
+
this.checked.set(value);
|
|
948
|
+
}
|
|
949
|
+
registerOnChange(fn) {
|
|
950
|
+
this._onChange = fn;
|
|
951
|
+
}
|
|
952
|
+
registerOnTouched(fn) {
|
|
953
|
+
this._onTouched = fn;
|
|
954
|
+
}
|
|
955
|
+
setDisabledState(isDisabled) {
|
|
956
|
+
this._disabled.set(isDisabled);
|
|
957
|
+
}
|
|
958
|
+
static ɵfac = function HlmCheckbox_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmCheckbox)(); };
|
|
959
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmCheckbox, selectors: [["hlm-checkbox"]], viewQuery: function HlmCheckbox_Query(rf, ctx) { if (rf & 1) {
|
|
960
|
+
i0.ɵɵviewQuerySignal(ctx._brnCheckbox, BrnCheckbox, 5);
|
|
961
|
+
} if (rf & 2) {
|
|
962
|
+
i0.ɵɵqueryAdvance();
|
|
963
|
+
} }, hostAttrs: ["data-slot", "checkbox", 1, "contents", "peer"], hostVars: 3, hostBindings: function HlmCheckbox_HostBindings(rf, ctx) { if (rf & 2) {
|
|
964
|
+
i0.ɵɵattribute("aria-label", null)("aria-labelledby", null)("data-disabled", ctx._disabled() ? "" : null);
|
|
965
|
+
} }, inputs: { userClass: [1, "class", "userClass"], inputId: [1, "inputId"], ariaLabel: [1, "aria-label", "ariaLabel"], ariaLabelledby: [1, "aria-labelledby", "ariaLabelledby"], ariaDescribedby: [1, "aria-describedby", "ariaDescribedby"], checkedInput: [1, "checked", "checkedInput"], indeterminate: [1, "indeterminate"], name: [1, "name"], required: [1, "required"], disabled: [1, "disabled"], forceInvalid: [1, "forceInvalid"] }, outputs: { checkedChange: "checkedChange", indeterminate: "indeterminateChange" }, features: [i0.ɵɵProvidersFeature([HLM_CHECKBOX_VALUE_ACCESSOR], [provideIcons({ phosphorCheck })]), i0.ɵɵHostDirectivesFeature([i1$3.BrnFieldControlDescribedBy])], decls: 2, vars: 13, consts: [[3, "indeterminateChange", "checkedChange", "touched", "id", "name", "checked", "indeterminate", "disabled", "required", "aria-label", "aria-labelledby", "aria-describedby", "forceInvalid"], [1, "flex", "items-center", "justify-center", "text-current", "transition-none"], ["hlm", "", "size", "14px", "name", "phosphorCheck"]], template: function HlmCheckbox_Template(rf, ctx) { if (rf & 1) {
|
|
966
|
+
i0.ɵɵelementStart(0, "brn-checkbox", 0);
|
|
967
|
+
i0.ɵɵtwoWayListener("indeterminateChange", function HlmCheckbox_Template_brn_checkbox_indeterminateChange_0_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.indeterminate, $event) || (ctx.indeterminate = $event); return $event; });
|
|
968
|
+
i0.ɵɵlistener("checkedChange", function HlmCheckbox_Template_brn_checkbox_checkedChange_0_listener($event) { return ctx._handleChange($event); })("touched", function HlmCheckbox_Template_brn_checkbox_touched_0_listener() { return ctx._onTouched?.(); });
|
|
969
|
+
i0.ɵɵconditionalCreate(1, HlmCheckbox_Conditional_1_Template, 2, 0, "span", 1);
|
|
970
|
+
i0.ɵɵelementEnd();
|
|
971
|
+
} if (rf & 2) {
|
|
972
|
+
i0.ɵɵclassMap(ctx._computedClass());
|
|
973
|
+
i0.ɵɵproperty("id", ctx.inputId())("name", ctx.name())("checked", ctx.checked());
|
|
974
|
+
i0.ɵɵtwoWayProperty("indeterminate", ctx.indeterminate);
|
|
975
|
+
i0.ɵɵproperty("disabled", ctx._disabled())("required", ctx.required());
|
|
976
|
+
i0.ɵɵariaProperty("aria-label", ctx.ariaLabel())("aria-labelledby", ctx.ariaLabelledby())("aria-describedby", ctx.ariaDescribedby());
|
|
977
|
+
i0.ɵɵproperty("forceInvalid", ctx.forceInvalid());
|
|
978
|
+
i0.ɵɵadvance();
|
|
979
|
+
i0.ɵɵconditional(ctx.checked() || ctx.indeterminate() ? 1 : -1);
|
|
980
|
+
} }, dependencies: [BrnCheckbox, NgIcon, HlmIcon], encapsulation: 2 });
|
|
981
|
+
}
|
|
982
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmCheckbox, [{
|
|
983
|
+
type: Component,
|
|
984
|
+
args: [{
|
|
985
|
+
selector: 'hlm-checkbox',
|
|
986
|
+
imports: [BrnCheckbox, NgIcon, HlmIcon],
|
|
987
|
+
providers: [HLM_CHECKBOX_VALUE_ACCESSOR],
|
|
988
|
+
viewProviders: [provideIcons({ phosphorCheck })],
|
|
989
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
990
|
+
hostDirectives: [BrnFieldControlDescribedBy],
|
|
991
|
+
host: {
|
|
992
|
+
class: 'contents peer',
|
|
993
|
+
'data-slot': 'checkbox',
|
|
994
|
+
'[attr.aria-label]': 'null',
|
|
995
|
+
'[attr.aria-labelledby]': 'null',
|
|
996
|
+
'[attr.data-disabled]': '_disabled() ? "" : null',
|
|
997
|
+
},
|
|
998
|
+
template: `
|
|
999
|
+
<brn-checkbox
|
|
1000
|
+
[id]="inputId()"
|
|
1001
|
+
[name]="name()"
|
|
1002
|
+
[class]="_computedClass()"
|
|
1003
|
+
[checked]="checked()"
|
|
1004
|
+
[(indeterminate)]="indeterminate"
|
|
1005
|
+
[disabled]="_disabled()"
|
|
1006
|
+
[required]="required()"
|
|
1007
|
+
[aria-label]="ariaLabel()"
|
|
1008
|
+
[aria-labelledby]="ariaLabelledby()"
|
|
1009
|
+
[aria-describedby]="ariaDescribedby()"
|
|
1010
|
+
[forceInvalid]="forceInvalid()"
|
|
1011
|
+
(checkedChange)="_handleChange($event)"
|
|
1012
|
+
(touched)="_onTouched?.()"
|
|
1013
|
+
>
|
|
1014
|
+
@if (checked() || indeterminate()) {
|
|
1015
|
+
<span class="flex items-center justify-center text-current transition-none">
|
|
1016
|
+
<ng-icon hlm size="14px" name="phosphorCheck" />
|
|
1017
|
+
</span>
|
|
1018
|
+
}
|
|
1019
|
+
</brn-checkbox>
|
|
1020
|
+
`,
|
|
1021
|
+
}]
|
|
1022
|
+
}], null, { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], checkedInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }, { type: i0.Output, args: ["indeterminateChange"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }], _brnCheckbox: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnCheckbox), { isSignal: true }] }] }); })();
|
|
1023
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmCheckbox, { className: "HlmCheckbox", filePath: "lib/ui/checkbox/src/lib/hlm-checkbox.ts", lineNumber: 68 }); })();
|
|
1024
|
+
|
|
1025
|
+
const HlmCheckboxImports = [HlmCheckbox];
|
|
1026
|
+
|
|
1027
|
+
class HlmTableContainer {
|
|
1028
|
+
constructor() {
|
|
1029
|
+
classes(() => 'relative w-full overflow-x-auto');
|
|
1030
|
+
}
|
|
1031
|
+
static ɵfac = function HlmTableContainer_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmTableContainer)(); };
|
|
1032
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmTableContainer, selectors: [["div", "hlmTableContainer", ""]], hostAttrs: ["data-slot", "table-container"] });
|
|
1033
|
+
}
|
|
1034
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmTableContainer, [{
|
|
1035
|
+
type: Directive,
|
|
1036
|
+
args: [{
|
|
1037
|
+
selector: 'div[hlmTableContainer]',
|
|
1038
|
+
host: { 'data-slot': 'table-container' },
|
|
1039
|
+
}]
|
|
1040
|
+
}], () => [], null); })();
|
|
1041
|
+
/**
|
|
1042
|
+
* Directive to apply Shadcn-like styling to a <table> element.
|
|
1043
|
+
*/
|
|
1044
|
+
class HlmTable {
|
|
1045
|
+
constructor() {
|
|
1046
|
+
classes(() => 'w-full caption-bottom text-sm');
|
|
1047
|
+
}
|
|
1048
|
+
static ɵfac = function HlmTable_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmTable)(); };
|
|
1049
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmTable, selectors: [["table", "hlmTable", ""]], hostAttrs: ["data-slot", "table"] });
|
|
1050
|
+
}
|
|
1051
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmTable, [{
|
|
1052
|
+
type: Directive,
|
|
1053
|
+
args: [{
|
|
1054
|
+
selector: 'table[hlmTable]',
|
|
1055
|
+
host: { 'data-slot': 'table' },
|
|
1056
|
+
}]
|
|
1057
|
+
}], () => [], null); })();
|
|
1058
|
+
/**
|
|
1059
|
+
* Directive to apply Shadcn-like styling to a <thead> element
|
|
1060
|
+
* within an HlmTable context.
|
|
1061
|
+
*/
|
|
1062
|
+
class HlmTHead {
|
|
1063
|
+
constructor() {
|
|
1064
|
+
classes(() => '[&_tr]:border-b');
|
|
1065
|
+
}
|
|
1066
|
+
static ɵfac = function HlmTHead_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmTHead)(); };
|
|
1067
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmTHead, selectors: [["thead", "hlmTHead", ""], ["thead", "hlmTableHeader", ""]], hostAttrs: ["data-slot", "table-header"] });
|
|
1068
|
+
}
|
|
1069
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmTHead, [{
|
|
1070
|
+
type: Directive,
|
|
1071
|
+
args: [{
|
|
1072
|
+
selector: 'thead[hlmTHead],thead[hlmTableHeader]',
|
|
1073
|
+
host: { 'data-slot': 'table-header' },
|
|
1074
|
+
}]
|
|
1075
|
+
}], () => [], null); })();
|
|
1076
|
+
/**
|
|
1077
|
+
* Directive to apply Shadcn-like styling to a <tbody> element
|
|
1078
|
+
* within an HlmTable context.
|
|
1079
|
+
*/
|
|
1080
|
+
class HlmTBody {
|
|
1081
|
+
constructor() {
|
|
1082
|
+
classes(() => '[&_tr:last-child]:border-0');
|
|
1083
|
+
}
|
|
1084
|
+
static ɵfac = function HlmTBody_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmTBody)(); };
|
|
1085
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmTBody, selectors: [["tbody", "hlmTBody", ""], ["tbody", "hlmTableBody", ""]], hostAttrs: ["data-slot", "table-body"] });
|
|
1086
|
+
}
|
|
1087
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmTBody, [{
|
|
1088
|
+
type: Directive,
|
|
1089
|
+
args: [{
|
|
1090
|
+
selector: 'tbody[hlmTBody],tbody[hlmTableBody]',
|
|
1091
|
+
host: { 'data-slot': 'table-body' },
|
|
1092
|
+
}]
|
|
1093
|
+
}], () => [], null); })();
|
|
1094
|
+
/**
|
|
1095
|
+
* Directive to apply Shadcn-like styling to a <tfoot> element
|
|
1096
|
+
* within an HlmTable context.
|
|
1097
|
+
*/
|
|
1098
|
+
class HlmTFoot {
|
|
1099
|
+
constructor() {
|
|
1100
|
+
classes(() => 'bg-muted/50 border-t font-medium [&>tr]:last:border-b-0');
|
|
1101
|
+
}
|
|
1102
|
+
static ɵfac = function HlmTFoot_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmTFoot)(); };
|
|
1103
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmTFoot, selectors: [["tfoot", "hlmTFoot", ""], ["tfoot", "hlmTableFooter", ""]], hostAttrs: ["data-slot", "table-footer"] });
|
|
1104
|
+
}
|
|
1105
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmTFoot, [{
|
|
1106
|
+
type: Directive,
|
|
1107
|
+
args: [{
|
|
1108
|
+
selector: 'tfoot[hlmTFoot],tfoot[hlmTableFooter]',
|
|
1109
|
+
host: { 'data-slot': 'table-footer' },
|
|
1110
|
+
}]
|
|
1111
|
+
}], () => [], null); })();
|
|
1112
|
+
/**
|
|
1113
|
+
* Directive to apply Shadcn-like styling to a <tr> element
|
|
1114
|
+
* within an HlmTable context.
|
|
1115
|
+
*/
|
|
1116
|
+
class HlmTr {
|
|
1117
|
+
constructor() {
|
|
1118
|
+
classes(() => 'hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors has-aria-expanded:bg-muted/50');
|
|
1119
|
+
}
|
|
1120
|
+
static ɵfac = function HlmTr_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmTr)(); };
|
|
1121
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmTr, selectors: [["tr", "hlmTr", ""], ["tr", "hlmTableRow", ""]], hostAttrs: ["data-slot", "table-row"] });
|
|
1122
|
+
}
|
|
1123
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmTr, [{
|
|
1124
|
+
type: Directive,
|
|
1125
|
+
args: [{
|
|
1126
|
+
selector: 'tr[hlmTr],tr[hlmTableRow]',
|
|
1127
|
+
host: { 'data-slot': 'table-row' },
|
|
1128
|
+
}]
|
|
1129
|
+
}], () => [], null); })();
|
|
1130
|
+
/**
|
|
1131
|
+
* Directive to apply Shadcn-like styling to a <th> element
|
|
1132
|
+
* within an HlmTable context.
|
|
1133
|
+
*/
|
|
1134
|
+
class HlmTh {
|
|
1135
|
+
constructor() {
|
|
1136
|
+
classes(() => 'text-foreground h-10 px-2 text-start align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pe-0');
|
|
1137
|
+
}
|
|
1138
|
+
static ɵfac = function HlmTh_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmTh)(); };
|
|
1139
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmTh, selectors: [["th", "hlmTh", ""], ["th", "hlmTableHead", ""]], hostAttrs: ["data-slot", "table-head"] });
|
|
1140
|
+
}
|
|
1141
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmTh, [{
|
|
1142
|
+
type: Directive,
|
|
1143
|
+
args: [{
|
|
1144
|
+
selector: 'th[hlmTh],th[hlmTableHead]',
|
|
1145
|
+
host: { 'data-slot': 'table-head' },
|
|
1146
|
+
}]
|
|
1147
|
+
}], () => [], null); })();
|
|
1148
|
+
/**
|
|
1149
|
+
* Directive to apply Shadcn-like styling to a <td> element
|
|
1150
|
+
* within an HlmTable context.
|
|
1151
|
+
*/
|
|
1152
|
+
class HlmTd {
|
|
1153
|
+
constructor() {
|
|
1154
|
+
classes(() => 'p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0');
|
|
1155
|
+
}
|
|
1156
|
+
static ɵfac = function HlmTd_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmTd)(); };
|
|
1157
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmTd, selectors: [["td", "hlmTd", ""], ["td", "hlmTableCell", ""]], hostAttrs: ["data-slot", "table-cell"] });
|
|
1158
|
+
}
|
|
1159
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmTd, [{
|
|
1160
|
+
type: Directive,
|
|
1161
|
+
args: [{
|
|
1162
|
+
selector: 'td[hlmTd],td[hlmTableCell]',
|
|
1163
|
+
host: { 'data-slot': 'table-cell' },
|
|
1164
|
+
}]
|
|
1165
|
+
}], () => [], null); })();
|
|
1166
|
+
/**
|
|
1167
|
+
* Directive to apply Shadcn-like styling to a <caption> element
|
|
1168
|
+
* within an HlmTable context.
|
|
1169
|
+
*/
|
|
1170
|
+
class HlmCaption {
|
|
1171
|
+
constructor() {
|
|
1172
|
+
classes(() => 'text-muted-foreground mt-4 text-sm');
|
|
1173
|
+
}
|
|
1174
|
+
static ɵfac = function HlmCaption_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmCaption)(); };
|
|
1175
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmCaption, selectors: [["caption", "hlmCaption", ""], ["caption", "hlmTableCaption", ""]], hostAttrs: ["data-slot", "table-caption"] });
|
|
1176
|
+
}
|
|
1177
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmCaption, [{
|
|
1178
|
+
type: Directive,
|
|
1179
|
+
args: [{
|
|
1180
|
+
selector: 'caption[hlmCaption],caption[hlmTableCaption]',
|
|
1181
|
+
host: { 'data-slot': 'table-caption' },
|
|
1182
|
+
}]
|
|
1183
|
+
}], () => [], null); })();
|
|
1184
|
+
|
|
1185
|
+
const HlmTableImports = [
|
|
1186
|
+
HlmCaption,
|
|
1187
|
+
HlmTableContainer,
|
|
1188
|
+
HlmTable,
|
|
1189
|
+
HlmTBody,
|
|
1190
|
+
HlmTd,
|
|
1191
|
+
HlmTFoot,
|
|
1192
|
+
HlmTh,
|
|
1193
|
+
HlmTHead,
|
|
1194
|
+
HlmTr,
|
|
1195
|
+
];
|
|
1196
|
+
|
|
1197
|
+
const _forTrack0 = ($index, $item) => $item.id;
|
|
1198
|
+
function HlmDataTableContent_For_4_For_2_Conditional_1_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
1199
|
+
i0.ɵɵelementContainerStart(0);
|
|
1200
|
+
i0.ɵɵtext(1);
|
|
1201
|
+
i0.ɵɵelementContainerEnd();
|
|
1202
|
+
} if (rf & 2) {
|
|
1203
|
+
const headerContent_r1 = ctx.$implicit;
|
|
1204
|
+
i0.ɵɵadvance();
|
|
1205
|
+
i0.ɵɵtextInterpolate1(" ", headerContent_r1, " ");
|
|
1206
|
+
} }
|
|
1207
|
+
function HlmDataTableContent_For_4_For_2_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
1208
|
+
i0.ɵɵtemplate(0, HlmDataTableContent_For_4_For_2_Conditional_1_ng_container_0_Template, 2, 1, "ng-container", 6);
|
|
1209
|
+
} if (rf & 2) {
|
|
1210
|
+
const header_r2 = i0.ɵɵnextContext().$implicit;
|
|
1211
|
+
i0.ɵɵproperty("flexRender", header_r2.column.columnDef.header)("flexRenderProps", header_r2.getContext());
|
|
1212
|
+
} }
|
|
1213
|
+
function HlmDataTableContent_For_4_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
1214
|
+
i0.ɵɵelementStart(0, "th", 5);
|
|
1215
|
+
i0.ɵɵconditionalCreate(1, HlmDataTableContent_For_4_For_2_Conditional_1_Template, 1, 2, "ng-container");
|
|
1216
|
+
i0.ɵɵelementEnd();
|
|
1217
|
+
} if (rf & 2) {
|
|
1218
|
+
const header_r2 = ctx.$implicit;
|
|
1219
|
+
i0.ɵɵadvance();
|
|
1220
|
+
i0.ɵɵconditional(!header_r2.isPlaceholder ? 1 : -1);
|
|
1221
|
+
} }
|
|
1222
|
+
function HlmDataTableContent_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
1223
|
+
i0.ɵɵelementStart(0, "tr", 3);
|
|
1224
|
+
i0.ɵɵrepeaterCreate(1, HlmDataTableContent_For_4_For_2_Template, 2, 1, "th", 5, _forTrack0);
|
|
1225
|
+
i0.ɵɵelementEnd();
|
|
1226
|
+
} if (rf & 2) {
|
|
1227
|
+
const headerGroup_r3 = ctx.$implicit;
|
|
1228
|
+
i0.ɵɵadvance();
|
|
1229
|
+
i0.ɵɵrepeater(headerGroup_r3.headers);
|
|
1230
|
+
} }
|
|
1231
|
+
function HlmDataTableContent_Conditional_6_For_1_For_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
1232
|
+
i0.ɵɵelementContainerStart(0);
|
|
1233
|
+
i0.ɵɵtext(1);
|
|
1234
|
+
i0.ɵɵelementContainerEnd();
|
|
1235
|
+
} if (rf & 2) {
|
|
1236
|
+
const cellContent_r4 = ctx.$implicit;
|
|
1237
|
+
i0.ɵɵadvance();
|
|
1238
|
+
i0.ɵɵtextInterpolate1(" ", cellContent_r4, " ");
|
|
1239
|
+
} }
|
|
1240
|
+
function HlmDataTableContent_Conditional_6_For_1_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
1241
|
+
i0.ɵɵelementStart(0, "td", 7);
|
|
1242
|
+
i0.ɵɵtemplate(1, HlmDataTableContent_Conditional_6_For_1_For_2_ng_container_1_Template, 2, 1, "ng-container", 6);
|
|
1243
|
+
i0.ɵɵelementEnd();
|
|
1244
|
+
} if (rf & 2) {
|
|
1245
|
+
const cell_r5 = ctx.$implicit;
|
|
1246
|
+
i0.ɵɵadvance();
|
|
1247
|
+
i0.ɵɵproperty("flexRender", cell_r5.column.columnDef.cell)("flexRenderProps", cell_r5.getContext());
|
|
1248
|
+
} }
|
|
1249
|
+
function HlmDataTableContent_Conditional_6_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
1250
|
+
i0.ɵɵelementStart(0, "tr", 3);
|
|
1251
|
+
i0.ɵɵrepeaterCreate(1, HlmDataTableContent_Conditional_6_For_1_For_2_Template, 2, 2, "td", 7, _forTrack0);
|
|
1252
|
+
i0.ɵɵelementEnd();
|
|
1253
|
+
} if (rf & 2) {
|
|
1254
|
+
const row_r6 = ctx.$implicit;
|
|
1255
|
+
i0.ɵɵattribute("data-state", row_r6.getIsSelected() ? "selected" : null);
|
|
1256
|
+
i0.ɵɵadvance();
|
|
1257
|
+
i0.ɵɵrepeater(row_r6.getVisibleCells());
|
|
1258
|
+
} }
|
|
1259
|
+
function HlmDataTableContent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
1260
|
+
i0.ɵɵrepeaterCreate(0, HlmDataTableContent_Conditional_6_For_1_Template, 3, 1, "tr", 3, _forTrack0);
|
|
1261
|
+
} if (rf & 2) {
|
|
1262
|
+
const ctx_r6 = i0.ɵɵnextContext();
|
|
1263
|
+
i0.ɵɵrepeater(ctx_r6.table().getRowModel().rows);
|
|
1264
|
+
} }
|
|
1265
|
+
function HlmDataTableContent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
1266
|
+
i0.ɵɵelementStart(0, "tr", 3)(1, "td", 8);
|
|
1267
|
+
i0.ɵɵtext(2);
|
|
1268
|
+
i0.ɵɵelementEnd()();
|
|
1269
|
+
} if (rf & 2) {
|
|
1270
|
+
const ctx_r6 = i0.ɵɵnextContext();
|
|
1271
|
+
i0.ɵɵadvance();
|
|
1272
|
+
i0.ɵɵattribute("colspan", ctx_r6.columns().length);
|
|
1273
|
+
i0.ɵɵadvance();
|
|
1274
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r6.noResultsLabel(), " ");
|
|
1275
|
+
} }
|
|
1276
|
+
/**
|
|
1277
|
+
* Renders a TanStack table instance into the styled helm `table` directives. Mirrors React's
|
|
1278
|
+
* `DataTableContent`: header groups, body rows (with `data-state="selected"` per selected
|
|
1279
|
+
* row), and an empty-state row when there are no rows.
|
|
1280
|
+
*
|
|
1281
|
+
* String / primitive header and cell defs are rendered as inert escaped text by `*flexRender`
|
|
1282
|
+
* (matching React's `flexRender` of a string node); component cell defs created with
|
|
1283
|
+
* `flexRenderComponent()` are mounted in place. To render markup, return a
|
|
1284
|
+
* `flexRenderComponent()` rather than an HTML string — raw strings are never parsed as HTML.
|
|
1285
|
+
*/
|
|
1286
|
+
class HlmDataTableContent {
|
|
1287
|
+
/** The TanStack table instance, e.g. from `injectDataTable`. */
|
|
1288
|
+
table = input.required(/* @ts-ignore */
|
|
1289
|
+
...(ngDevMode ? [{ debugName: "table" }] : /* istanbul ignore next */ []));
|
|
1290
|
+
/** The column defs — used to span the empty-state row across all columns. */
|
|
1291
|
+
columns = input.required(/* @ts-ignore */
|
|
1292
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
1293
|
+
/** Content shown in the body when there are no rows. */
|
|
1294
|
+
noResultsLabel = input('No results.', /* @ts-ignore */
|
|
1295
|
+
...(ngDevMode ? [{ debugName: "noResultsLabel" }] : /* istanbul ignore next */ []));
|
|
1296
|
+
static ɵfac = function HlmDataTableContent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDataTableContent)(); };
|
|
1297
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmDataTableContent, selectors: [["hlm-data-table-content"]], hostAttrs: ["data-slot", "data-table-content", 1, "block", "overflow-hidden", "rounded-md", "border"], inputs: { table: [1, "table"], columns: [1, "columns"], noResultsLabel: [1, "noResultsLabel"] }, decls: 8, vars: 1, consts: [["hlmTableContainer", ""], ["hlmTable", ""], ["hlmTableHeader", ""], ["hlmTableRow", ""], ["hlmTableBody", ""], ["hlmTableHead", ""], [4, "flexRender", "flexRenderProps"], ["hlmTableCell", ""], ["hlmTableCell", "", 1, "h-24", "text-center"]], template: function HlmDataTableContent_Template(rf, ctx) { if (rf & 1) {
|
|
1298
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "table", 1)(2, "thead", 2);
|
|
1299
|
+
i0.ɵɵrepeaterCreate(3, HlmDataTableContent_For_4_Template, 3, 0, "tr", 3, _forTrack0);
|
|
1300
|
+
i0.ɵɵelementEnd();
|
|
1301
|
+
i0.ɵɵelementStart(5, "tbody", 4);
|
|
1302
|
+
i0.ɵɵconditionalCreate(6, HlmDataTableContent_Conditional_6_Template, 2, 0)(7, HlmDataTableContent_Conditional_7_Template, 3, 2, "tr", 3);
|
|
1303
|
+
i0.ɵɵelementEnd()()();
|
|
1304
|
+
} if (rf & 2) {
|
|
1305
|
+
i0.ɵɵadvance(3);
|
|
1306
|
+
i0.ɵɵrepeater(ctx.table().getHeaderGroups());
|
|
1307
|
+
i0.ɵɵadvance(3);
|
|
1308
|
+
i0.ɵɵconditional(ctx.table().getRowModel().rows.length ? 6 : 7);
|
|
1309
|
+
} }, dependencies: [HlmTableContainer, HlmTable, HlmTBody, HlmTd, HlmTh, HlmTHead, HlmTr, FlexRenderDirective], encapsulation: 2 });
|
|
1310
|
+
}
|
|
1311
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDataTableContent, [{
|
|
1312
|
+
type: Component,
|
|
1313
|
+
args: [{
|
|
1314
|
+
selector: 'hlm-data-table-content',
|
|
1315
|
+
imports: [HlmTableImports, FlexRenderDirective],
|
|
1316
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1317
|
+
host: {
|
|
1318
|
+
'data-slot': 'data-table-content',
|
|
1319
|
+
class: 'block overflow-hidden rounded-md border',
|
|
1320
|
+
},
|
|
1321
|
+
template: `
|
|
1322
|
+
<div hlmTableContainer>
|
|
1323
|
+
<table hlmTable>
|
|
1324
|
+
<thead hlmTableHeader>
|
|
1325
|
+
@for (headerGroup of table().getHeaderGroups(); track headerGroup.id) {
|
|
1326
|
+
<tr hlmTableRow>
|
|
1327
|
+
@for (header of headerGroup.headers; track header.id) {
|
|
1328
|
+
<th hlmTableHead>
|
|
1329
|
+
@if (!header.isPlaceholder) {
|
|
1330
|
+
<ng-container
|
|
1331
|
+
*flexRender="
|
|
1332
|
+
header.column.columnDef.header;
|
|
1333
|
+
props: header.getContext();
|
|
1334
|
+
let headerContent
|
|
1335
|
+
"
|
|
1336
|
+
>
|
|
1337
|
+
{{ headerContent }}
|
|
1338
|
+
</ng-container>
|
|
1339
|
+
}
|
|
1340
|
+
</th>
|
|
1341
|
+
}
|
|
1342
|
+
</tr>
|
|
1343
|
+
}
|
|
1344
|
+
</thead>
|
|
1345
|
+
<tbody hlmTableBody>
|
|
1346
|
+
@if (table().getRowModel().rows.length) {
|
|
1347
|
+
@for (row of table().getRowModel().rows; track row.id) {
|
|
1348
|
+
<tr hlmTableRow [attr.data-state]="row.getIsSelected() ? 'selected' : null">
|
|
1349
|
+
@for (cell of row.getVisibleCells(); track cell.id) {
|
|
1350
|
+
<td hlmTableCell>
|
|
1351
|
+
<ng-container
|
|
1352
|
+
*flexRender="
|
|
1353
|
+
cell.column.columnDef.cell;
|
|
1354
|
+
props: cell.getContext();
|
|
1355
|
+
let cellContent
|
|
1356
|
+
"
|
|
1357
|
+
>
|
|
1358
|
+
{{ cellContent }}
|
|
1359
|
+
</ng-container>
|
|
1360
|
+
</td>
|
|
1361
|
+
}
|
|
1362
|
+
</tr>
|
|
1363
|
+
}
|
|
1364
|
+
} @else {
|
|
1365
|
+
<tr hlmTableRow>
|
|
1366
|
+
<td hlmTableCell [attr.colspan]="columns().length" class="h-24 text-center">
|
|
1367
|
+
{{ noResultsLabel() }}
|
|
1368
|
+
</td>
|
|
1369
|
+
</tr>
|
|
1370
|
+
}
|
|
1371
|
+
</tbody>
|
|
1372
|
+
</table>
|
|
1373
|
+
</div>
|
|
1374
|
+
`,
|
|
1375
|
+
}]
|
|
1376
|
+
}], null, { table: [{ type: i0.Input, args: [{ isSignal: true, alias: "table", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], noResultsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsLabel", required: false }] }] }); })();
|
|
1377
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmDataTableContent, { className: "HlmDataTableContent", filePath: "lib/ui/data-table/src/lib/hlm-data-table-content.ts", lineNumber: 78 }); })();
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Selection summary plus Previous / Next paging controls. Mirrors React's
|
|
1381
|
+
* `DataTablePagination`.
|
|
1382
|
+
*/
|
|
1383
|
+
class HlmDataTablePagination {
|
|
1384
|
+
/** The TanStack table instance, e.g. from `injectDataTable`. */
|
|
1385
|
+
table = input.required(/* @ts-ignore */
|
|
1386
|
+
...(ngDevMode ? [{ debugName: "table" }] : /* istanbul ignore next */ []));
|
|
1387
|
+
/** Label for the "previous page" button. */
|
|
1388
|
+
previousLabel = input('Previous', /* @ts-ignore */
|
|
1389
|
+
...(ngDevMode ? [{ debugName: "previousLabel" }] : /* istanbul ignore next */ []));
|
|
1390
|
+
/** Label for the "next page" button. */
|
|
1391
|
+
nextLabel = input('Next', /* @ts-ignore */
|
|
1392
|
+
...(ngDevMode ? [{ debugName: "nextLabel" }] : /* istanbul ignore next */ []));
|
|
1393
|
+
/** Builds the selection-summary text from the selected and total row counts. */
|
|
1394
|
+
selectionLabel = input((selectedCount, totalCount) => `${selectedCount} of ${totalCount} row(s) selected.`, /* @ts-ignore */
|
|
1395
|
+
...(ngDevMode ? [{ debugName: "selectionLabel" }] : /* istanbul ignore next */ []));
|
|
1396
|
+
static ɵfac = function HlmDataTablePagination_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDataTablePagination)(); };
|
|
1397
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmDataTablePagination, selectors: [["hlm-data-table-pagination"]], hostAttrs: ["data-slot", "data-table-pagination", 1, "flex", "items-center", "justify-end", "gap-2", "py-4"], inputs: { table: [1, "table"], previousLabel: [1, "previousLabel"], nextLabel: [1, "nextLabel"], selectionLabel: [1, "selectionLabel"] }, decls: 7, vars: 5, consts: [[1, "text-muted-foreground", "flex-1", "text-sm"], [1, "flex", "gap-2"], ["hlmBtn", "", "variant", "outline", "size", "sm", 3, "click", "disabled"]], template: function HlmDataTablePagination_Template(rf, ctx) { if (rf & 1) {
|
|
1398
|
+
i0.ɵɵelementStart(0, "div", 0);
|
|
1399
|
+
i0.ɵɵtext(1);
|
|
1400
|
+
i0.ɵɵelementEnd();
|
|
1401
|
+
i0.ɵɵelementStart(2, "div", 1)(3, "button", 2);
|
|
1402
|
+
i0.ɵɵlistener("click", function HlmDataTablePagination_Template_button_click_3_listener() { return ctx.table().previousPage(); });
|
|
1403
|
+
i0.ɵɵtext(4);
|
|
1404
|
+
i0.ɵɵelementEnd();
|
|
1405
|
+
i0.ɵɵelementStart(5, "button", 2);
|
|
1406
|
+
i0.ɵɵlistener("click", function HlmDataTablePagination_Template_button_click_5_listener() { return ctx.table().nextPage(); });
|
|
1407
|
+
i0.ɵɵtext(6);
|
|
1408
|
+
i0.ɵɵelementEnd()();
|
|
1409
|
+
} if (rf & 2) {
|
|
1410
|
+
i0.ɵɵadvance();
|
|
1411
|
+
i0.ɵɵtextInterpolate1(" ", ctx.selectionLabel()(ctx.table().getFilteredSelectedRowModel().rows.length, ctx.table().getFilteredRowModel().rows.length), " ");
|
|
1412
|
+
i0.ɵɵadvance(2);
|
|
1413
|
+
i0.ɵɵproperty("disabled", !ctx.table().getCanPreviousPage());
|
|
1414
|
+
i0.ɵɵadvance();
|
|
1415
|
+
i0.ɵɵtextInterpolate1(" ", ctx.previousLabel(), " ");
|
|
1416
|
+
i0.ɵɵadvance();
|
|
1417
|
+
i0.ɵɵproperty("disabled", !ctx.table().getCanNextPage());
|
|
1418
|
+
i0.ɵɵadvance();
|
|
1419
|
+
i0.ɵɵtextInterpolate1(" ", ctx.nextLabel(), " ");
|
|
1420
|
+
} }, dependencies: [HlmButton], encapsulation: 2 });
|
|
1421
|
+
}
|
|
1422
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDataTablePagination, [{
|
|
1423
|
+
type: Component,
|
|
1424
|
+
args: [{
|
|
1425
|
+
selector: 'hlm-data-table-pagination',
|
|
1426
|
+
imports: [HlmButton],
|
|
1427
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1428
|
+
host: {
|
|
1429
|
+
'data-slot': 'data-table-pagination',
|
|
1430
|
+
class: 'flex items-center justify-end gap-2 py-4',
|
|
1431
|
+
},
|
|
1432
|
+
template: `
|
|
1433
|
+
<div class="text-muted-foreground flex-1 text-sm">
|
|
1434
|
+
{{
|
|
1435
|
+
selectionLabel()(
|
|
1436
|
+
table().getFilteredSelectedRowModel().rows.length,
|
|
1437
|
+
table().getFilteredRowModel().rows.length
|
|
1438
|
+
)
|
|
1439
|
+
}}
|
|
1440
|
+
</div>
|
|
1441
|
+
<div class="flex gap-2">
|
|
1442
|
+
<button
|
|
1443
|
+
hlmBtn
|
|
1444
|
+
variant="outline"
|
|
1445
|
+
size="sm"
|
|
1446
|
+
[disabled]="!table().getCanPreviousPage()"
|
|
1447
|
+
(click)="table().previousPage()"
|
|
1448
|
+
>
|
|
1449
|
+
{{ previousLabel() }}
|
|
1450
|
+
</button>
|
|
1451
|
+
<button
|
|
1452
|
+
hlmBtn
|
|
1453
|
+
variant="outline"
|
|
1454
|
+
size="sm"
|
|
1455
|
+
[disabled]="!table().getCanNextPage()"
|
|
1456
|
+
(click)="table().nextPage()"
|
|
1457
|
+
>
|
|
1458
|
+
{{ nextLabel() }}
|
|
1459
|
+
</button>
|
|
1460
|
+
</div>
|
|
1461
|
+
`,
|
|
1462
|
+
}]
|
|
1463
|
+
}], null, { table: [{ type: i0.Input, args: [{ isSignal: true, alias: "table", required: true }] }], previousLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousLabel", required: false }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: false }] }], selectionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionLabel", required: false }] }] }); })();
|
|
1464
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmDataTablePagination, { className: "HlmDataTablePagination", filePath: "lib/ui/data-table/src/lib/hlm-data-table-pagination.ts", lineNumber: 48 }); })();
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* Layout wrapper for data-table controls (filter inputs, column toggles, actions). Mirrors
|
|
1468
|
+
* React's `DataTableToolbar` — a styled flex row above the table.
|
|
1469
|
+
*/
|
|
1470
|
+
class HlmDataTableToolbar {
|
|
1471
|
+
constructor() {
|
|
1472
|
+
classes(() => 'flex items-center gap-2 py-4');
|
|
1473
|
+
}
|
|
1474
|
+
static ɵfac = function HlmDataTableToolbar_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDataTableToolbar)(); };
|
|
1475
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDataTableToolbar, selectors: [["", "hlmDataTableToolbar", ""]], hostAttrs: ["data-slot", "data-table-toolbar"] });
|
|
1476
|
+
}
|
|
1477
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDataTableToolbar, [{
|
|
1478
|
+
type: Directive,
|
|
1479
|
+
args: [{
|
|
1480
|
+
selector: '[hlmDataTableToolbar]',
|
|
1481
|
+
host: { 'data-slot': 'data-table-toolbar' },
|
|
1482
|
+
}]
|
|
1483
|
+
}], () => [], null); })();
|
|
1484
|
+
|
|
1485
|
+
/** Apply a TanStack `Updater` (value or `(old) => new`) to a writable signal. */
|
|
1486
|
+
function applyUpdater(state) {
|
|
1487
|
+
return (updater) => state.set(typeof updater === 'function' ? updater(state()) : updater);
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Angular analog of React's `useDataTable`. Wraps `createAngularTable` with the core,
|
|
1491
|
+
* sorted, filtered and paginated row models and manages sorting, column-filter,
|
|
1492
|
+
* column-visibility, row-selection and pagination state with signals.
|
|
1493
|
+
*
|
|
1494
|
+
* Must be called from an injection context (a component constructor or field initializer),
|
|
1495
|
+
* since `createAngularTable` injects. Pass an options factory so reactive `data` re-renders
|
|
1496
|
+
* the table:
|
|
1497
|
+
*
|
|
1498
|
+
* ```ts
|
|
1499
|
+
* readonly table = injectDataTable(() => ({ data: this.data(), columns }));
|
|
1500
|
+
* ```
|
|
1501
|
+
*/
|
|
1502
|
+
function injectDataTable(options) {
|
|
1503
|
+
const initial = options();
|
|
1504
|
+
const sorting = signal(initial.initialSorting ?? [], /* @ts-ignore */
|
|
1505
|
+
...(ngDevMode ? [{ debugName: "sorting" }] : /* istanbul ignore next */ []));
|
|
1506
|
+
const columnFilters = signal(initial.initialColumnFilters ?? [], /* @ts-ignore */
|
|
1507
|
+
...(ngDevMode ? [{ debugName: "columnFilters" }] : /* istanbul ignore next */ []));
|
|
1508
|
+
const columnVisibility = signal(initial.initialColumnVisibility ?? {}, /* @ts-ignore */
|
|
1509
|
+
...(ngDevMode ? [{ debugName: "columnVisibility" }] : /* istanbul ignore next */ []));
|
|
1510
|
+
const rowSelection = signal({}, /* @ts-ignore */
|
|
1511
|
+
...(ngDevMode ? [{ debugName: "rowSelection" }] : /* istanbul ignore next */ []));
|
|
1512
|
+
const pagination = signal(initial.initialPagination ?? { pageIndex: 0, pageSize: 10 }, /* @ts-ignore */
|
|
1513
|
+
...(ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []));
|
|
1514
|
+
return createAngularTable(() => {
|
|
1515
|
+
const { data, columns, getRowId } = options();
|
|
1516
|
+
return {
|
|
1517
|
+
data,
|
|
1518
|
+
columns,
|
|
1519
|
+
getRowId,
|
|
1520
|
+
state: {
|
|
1521
|
+
sorting: sorting(),
|
|
1522
|
+
columnFilters: columnFilters(),
|
|
1523
|
+
columnVisibility: columnVisibility(),
|
|
1524
|
+
rowSelection: rowSelection(),
|
|
1525
|
+
pagination: pagination(),
|
|
1526
|
+
},
|
|
1527
|
+
onSortingChange: applyUpdater(sorting),
|
|
1528
|
+
onColumnFiltersChange: applyUpdater(columnFilters),
|
|
1529
|
+
onColumnVisibilityChange: applyUpdater(columnVisibility),
|
|
1530
|
+
onRowSelectionChange: applyUpdater(rowSelection),
|
|
1531
|
+
onPaginationChange: applyUpdater(pagination),
|
|
1532
|
+
getCoreRowModel: getCoreRowModel(),
|
|
1533
|
+
getSortedRowModel: getSortedRowModel(),
|
|
1534
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
1535
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
1536
|
+
};
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
const HlmDataTableImports = [
|
|
1541
|
+
HlmDataTableContent,
|
|
1542
|
+
HlmDataTablePagination,
|
|
1543
|
+
HlmDataTableToolbar,
|
|
1544
|
+
];
|
|
1545
|
+
|
|
1546
|
+
class HlmDropdownMenu {
|
|
1547
|
+
_host = inject(CdkMenu);
|
|
1548
|
+
_state = signal('open', /* @ts-ignore */
|
|
1549
|
+
...(ngDevMode ? [{ debugName: "_state" }] : /* istanbul ignore next */ []));
|
|
1550
|
+
_side = signal('top', /* @ts-ignore */
|
|
1551
|
+
...(ngDevMode ? [{ debugName: "_side" }] : /* istanbul ignore next */ []));
|
|
1552
|
+
sideOffset = input(1, { ...(ngDevMode ? { debugName: "sideOffset" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
1553
|
+
constructor() {
|
|
1554
|
+
classes(() => 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 my-[--spacing(var(--side-offset))] min-w-[8rem] origin-top overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md');
|
|
1555
|
+
this.setSideWithDarkMagic();
|
|
1556
|
+
// this is a best effort, but does not seem to work currently
|
|
1557
|
+
// TODO: figure out a way for us to know the host is about to be closed. might not be possible with CDK
|
|
1558
|
+
this._host.closed.pipe(takeUntilDestroyed()).subscribe(() => this._state.set('closed'));
|
|
1559
|
+
}
|
|
1560
|
+
setSideWithDarkMagic() {
|
|
1561
|
+
/**
|
|
1562
|
+
* This is an ugly workaround to at least figure out the correct side of where a submenu
|
|
1563
|
+
* will appear and set the attribute to the host accordingly
|
|
1564
|
+
*
|
|
1565
|
+
* First of all we take advantage of the menu stack not being aware of the root
|
|
1566
|
+
* object immediately after it is added. This code executes before the root element is added,
|
|
1567
|
+
* which means the stack is still empty and the peek method returns undefined.
|
|
1568
|
+
*/
|
|
1569
|
+
const isRoot = this._host.menuStack.peek() === undefined;
|
|
1570
|
+
setTimeout(() => {
|
|
1571
|
+
// our menu trigger directive leaves the last position used for use immediately after opening
|
|
1572
|
+
// we can access it here and determine the correct side.
|
|
1573
|
+
// eslint-disable-next-line
|
|
1574
|
+
const ps = this._host._parentTrigger._spartanLastPosition;
|
|
1575
|
+
if (!ps) {
|
|
1576
|
+
// if we have no last position we default to the most likely option
|
|
1577
|
+
// I hate that we have to do this and hope we can revisit soon and improve
|
|
1578
|
+
this._side.set(isRoot ? 'top' : 'left');
|
|
1579
|
+
return;
|
|
1580
|
+
}
|
|
1581
|
+
const side = isRoot ? ps.originY : ps.originX === 'end' ? 'right' : 'left';
|
|
1582
|
+
this._side.set(side);
|
|
1583
|
+
});
|
|
1584
|
+
}
|
|
1585
|
+
static ɵfac = function HlmDropdownMenu_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenu)(); };
|
|
1586
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDropdownMenu, selectors: [["", "hlmDropdownMenu", ""], ["hlm-dropdown-menu"]], hostAttrs: ["data-slot", "dropdown-menu"], hostVars: 4, hostBindings: function HlmDropdownMenu_HostBindings(rf, ctx) { if (rf & 2) {
|
|
1587
|
+
i0.ɵɵattribute("data-state", ctx._state())("data-side", ctx._side());
|
|
1588
|
+
i0.ɵɵstyleProp("--side-offset", ctx.sideOffset());
|
|
1589
|
+
} }, inputs: { sideOffset: [1, "sideOffset"] }, features: [i0.ɵɵHostDirectivesFeature([i1$4.CdkMenu])] });
|
|
1590
|
+
}
|
|
1591
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenu, [{
|
|
1592
|
+
type: Directive,
|
|
1593
|
+
args: [{
|
|
1594
|
+
selector: '[hlmDropdownMenu],hlm-dropdown-menu',
|
|
1595
|
+
hostDirectives: [CdkMenu],
|
|
1596
|
+
host: {
|
|
1597
|
+
'data-slot': 'dropdown-menu',
|
|
1598
|
+
'[attr.data-state]': '_state()',
|
|
1599
|
+
'[attr.data-side]': '_side()',
|
|
1600
|
+
'[style.--side-offset]': 'sideOffset()',
|
|
1601
|
+
},
|
|
1602
|
+
}]
|
|
1603
|
+
}], () => [], { sideOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "sideOffset", required: false }] }] }); })();
|
|
1604
|
+
|
|
1605
|
+
class HlmDropdownMenuCheckbox {
|
|
1606
|
+
_cdkMenuItem = inject(CdkMenuItemCheckbox);
|
|
1607
|
+
checked = input(this._cdkMenuItem.checked, { ...(ngDevMode ? { debugName: "checked" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1608
|
+
disabled = input(this._cdkMenuItem.disabled, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1609
|
+
constructor() {
|
|
1610
|
+
classes(() => 'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground group relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none has-[>hlm-dropdown-menu-checkbox-indicator:last-child]:ps-2 has-[>hlm-dropdown-menu-checkbox-indicator:last-child]:pe-8 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 has-[>hlm-dropdown-menu-checkbox-indicator:last-child]:[&>hlm-dropdown-menu-checkbox-indicator]:start-auto has-[>hlm-dropdown-menu-checkbox-indicator:last-child]:[&>hlm-dropdown-menu-checkbox-indicator]:end-2');
|
|
1611
|
+
}
|
|
1612
|
+
static ɵfac = function HlmDropdownMenuCheckbox_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuCheckbox)(); };
|
|
1613
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDropdownMenuCheckbox, selectors: [["", "hlmDropdownMenuCheckbox", ""]], hostAttrs: ["data-slot", "dropdown-menu-checkbox-item"], hostVars: 2, hostBindings: function HlmDropdownMenuCheckbox_HostBindings(rf, ctx) { if (rf & 2) {
|
|
1614
|
+
i0.ɵɵattribute("data-disabled", ctx.disabled() ? "" : null)("data-checked", ctx.checked() ? "" : null);
|
|
1615
|
+
} }, inputs: { checked: [1, "checked"], disabled: [1, "disabled"] }, features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$4.CdkMenuItemCheckbox, inputs: ["cdkMenuItemDisabled", "disabled", "cdkMenuItemChecked", "checked"], outputs: ["cdkMenuItemTriggered", "triggered"] }])] });
|
|
1616
|
+
}
|
|
1617
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuCheckbox, [{
|
|
1618
|
+
type: Directive,
|
|
1619
|
+
args: [{
|
|
1620
|
+
selector: '[hlmDropdownMenuCheckbox]',
|
|
1621
|
+
hostDirectives: [
|
|
1622
|
+
{
|
|
1623
|
+
directive: CdkMenuItemCheckbox,
|
|
1624
|
+
inputs: ['cdkMenuItemDisabled: disabled', 'cdkMenuItemChecked: checked'],
|
|
1625
|
+
outputs: ['cdkMenuItemTriggered: triggered'],
|
|
1626
|
+
},
|
|
1627
|
+
],
|
|
1628
|
+
host: {
|
|
1629
|
+
'data-slot': 'dropdown-menu-checkbox-item',
|
|
1630
|
+
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
1631
|
+
'[attr.data-checked]': 'checked() ? "" : null',
|
|
1632
|
+
},
|
|
1633
|
+
}]
|
|
1634
|
+
}], () => [], { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] }); })();
|
|
1635
|
+
|
|
1636
|
+
class HlmDropdownMenuCheckboxIndicator {
|
|
1637
|
+
constructor() {
|
|
1638
|
+
classes(() => 'pointer-events-none absolute left-2 flex size-3.5 items-center justify-center opacity-0 group-data-[checked]:opacity-100');
|
|
1639
|
+
}
|
|
1640
|
+
static ɵfac = function HlmDropdownMenuCheckboxIndicator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuCheckboxIndicator)(); };
|
|
1641
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmDropdownMenuCheckboxIndicator, selectors: [["hlm-dropdown-menu-checkbox-indicator"]], features: [i0.ɵɵProvidersFeature([provideIcons({ phosphorCheck })])], decls: 1, vars: 0, consts: [["name", "phosphorCheck", 1, "text-base"]], template: function HlmDropdownMenuCheckboxIndicator_Template(rf, ctx) { if (rf & 1) {
|
|
1642
|
+
i0.ɵɵelement(0, "ng-icon", 0);
|
|
1643
|
+
} }, dependencies: [NgIcon], encapsulation: 2 });
|
|
1644
|
+
}
|
|
1645
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuCheckboxIndicator, [{
|
|
1646
|
+
type: Component,
|
|
1647
|
+
args: [{
|
|
1648
|
+
selector: 'hlm-dropdown-menu-checkbox-indicator',
|
|
1649
|
+
imports: [NgIcon],
|
|
1650
|
+
providers: [provideIcons({ phosphorCheck })],
|
|
1651
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1652
|
+
template: ` <ng-icon class="text-base" name="phosphorCheck" /> `,
|
|
1653
|
+
}]
|
|
1654
|
+
}], () => [], null); })();
|
|
1655
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmDropdownMenuCheckboxIndicator, { className: "HlmDropdownMenuCheckboxIndicator", filePath: "lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-checkbox-indicator.ts", lineNumber: 13 }); })();
|
|
1656
|
+
|
|
1657
|
+
class HlmDropdownMenuGroup {
|
|
1658
|
+
constructor() {
|
|
1659
|
+
classes(() => 'block');
|
|
1660
|
+
}
|
|
1661
|
+
static ɵfac = function HlmDropdownMenuGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuGroup)(); };
|
|
1662
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDropdownMenuGroup, selectors: [["", "hlmDropdownMenuGroup", ""], ["hlm-dropdown-menu-group"]], hostAttrs: ["data-slot", "dropdown-menu-group"], features: [i0.ɵɵHostDirectivesFeature([i1$4.CdkMenuGroup])] });
|
|
1663
|
+
}
|
|
1664
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuGroup, [{
|
|
1665
|
+
type: Directive,
|
|
1666
|
+
args: [{
|
|
1667
|
+
selector: '[hlmDropdownMenuGroup],hlm-dropdown-menu-group',
|
|
1668
|
+
hostDirectives: [CdkMenuGroup],
|
|
1669
|
+
host: {
|
|
1670
|
+
'data-slot': 'dropdown-menu-group',
|
|
1671
|
+
},
|
|
1672
|
+
}]
|
|
1673
|
+
}], () => [], null); })();
|
|
1674
|
+
|
|
1675
|
+
class HlmDropdownMenuItem {
|
|
1676
|
+
_isButton = inject(HOST_TAG_NAME) === 'button';
|
|
1677
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1678
|
+
variant = input('default', /* @ts-ignore */
|
|
1679
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1680
|
+
inset = input(false, { ...(ngDevMode ? { debugName: "inset" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1681
|
+
constructor() {
|
|
1682
|
+
classes(() => "hover:bg-accent focus-visible:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[ng-icon]:!text-destructive [&_ng-icon:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0 [&_svg:not([class*='text-'])]:text-base");
|
|
1683
|
+
}
|
|
1684
|
+
static ɵfac = function HlmDropdownMenuItem_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuItem)(); };
|
|
1685
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDropdownMenuItem, selectors: [["", "hlmDropdownMenuItem", ""], ["hlm-dropdown-menu-item"]], hostAttrs: ["data-slot", "dropdown-menu-item"], hostVars: 4, hostBindings: function HlmDropdownMenuItem_HostBindings(rf, ctx) { if (rf & 2) {
|
|
1686
|
+
i0.ɵɵattribute("disabled", ctx._isButton && ctx.disabled() ? "" : null)("data-disabled", ctx.disabled() ? "" : null)("data-variant", ctx.variant())("data-inset", ctx.inset() ? "" : null);
|
|
1687
|
+
} }, inputs: { disabled: [1, "disabled"], variant: [1, "variant"], inset: [1, "inset"] }, features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$4.CdkMenuItem, inputs: ["cdkMenuItemDisabled", "disabled"], outputs: ["cdkMenuItemTriggered", "triggered"] }])] });
|
|
1688
|
+
}
|
|
1689
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuItem, [{
|
|
1690
|
+
type: Directive,
|
|
1691
|
+
args: [{
|
|
1692
|
+
selector: '[hlmDropdownMenuItem],hlm-dropdown-menu-item',
|
|
1693
|
+
hostDirectives: [
|
|
1694
|
+
{
|
|
1695
|
+
directive: CdkMenuItem,
|
|
1696
|
+
inputs: ['cdkMenuItemDisabled: disabled'],
|
|
1697
|
+
outputs: ['cdkMenuItemTriggered: triggered'],
|
|
1698
|
+
},
|
|
1699
|
+
],
|
|
1700
|
+
host: {
|
|
1701
|
+
'data-slot': 'dropdown-menu-item',
|
|
1702
|
+
'[attr.disabled]': '_isButton && disabled() ? "" : null',
|
|
1703
|
+
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
1704
|
+
'[attr.data-variant]': 'variant()',
|
|
1705
|
+
'[attr.data-inset]': 'inset() ? "" : null',
|
|
1706
|
+
},
|
|
1707
|
+
}]
|
|
1708
|
+
}], () => [], { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], inset: [{ type: i0.Input, args: [{ isSignal: true, alias: "inset", required: false }] }] }); })();
|
|
1709
|
+
|
|
1710
|
+
class HlmDropdownMenuItemSubIndicator {
|
|
1711
|
+
constructor() {
|
|
1712
|
+
classes(() => 'ms-auto size-4');
|
|
1713
|
+
}
|
|
1714
|
+
static ɵfac = function HlmDropdownMenuItemSubIndicator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuItemSubIndicator)(); };
|
|
1715
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmDropdownMenuItemSubIndicator, selectors: [["hlm-dropdown-menu-item-sub-indicator"]], features: [i0.ɵɵProvidersFeature([provideIcons({ phosphorCaretRight })])], decls: 1, vars: 0, consts: [["name", "phosphorCaretRight", 1, "text-base", "rtl:rotate-180"]], template: function HlmDropdownMenuItemSubIndicator_Template(rf, ctx) { if (rf & 1) {
|
|
1716
|
+
i0.ɵɵelement(0, "ng-icon", 0);
|
|
1717
|
+
} }, dependencies: [NgIcon], encapsulation: 2 });
|
|
1718
|
+
}
|
|
1719
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuItemSubIndicator, [{
|
|
1720
|
+
type: Component,
|
|
1721
|
+
args: [{
|
|
1722
|
+
selector: 'hlm-dropdown-menu-item-sub-indicator',
|
|
1723
|
+
imports: [NgIcon],
|
|
1724
|
+
providers: [provideIcons({ phosphorCaretRight })],
|
|
1725
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1726
|
+
template: ` <ng-icon name="phosphorCaretRight" class="text-base rtl:rotate-180" /> `,
|
|
1727
|
+
}]
|
|
1728
|
+
}], () => [], null); })();
|
|
1729
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmDropdownMenuItemSubIndicator, { className: "HlmDropdownMenuItemSubIndicator", filePath: "lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-item-sub-indicator.ts", lineNumber: 13 }); })();
|
|
1730
|
+
|
|
1731
|
+
class HlmDropdownMenuLabel {
|
|
1732
|
+
constructor() {
|
|
1733
|
+
classes(() => 'block px-2 py-1.5 text-sm font-medium data-[inset]:pl-8');
|
|
1734
|
+
}
|
|
1735
|
+
inset = input(false, { ...(ngDevMode ? { debugName: "inset" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1736
|
+
static ɵfac = function HlmDropdownMenuLabel_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuLabel)(); };
|
|
1737
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDropdownMenuLabel, selectors: [["", "hlmDropdownMenuLabel", ""], ["hlm-dropdown-menu-label"]], hostAttrs: ["data-slot", "dropdown-menu-label"], hostVars: 1, hostBindings: function HlmDropdownMenuLabel_HostBindings(rf, ctx) { if (rf & 2) {
|
|
1738
|
+
i0.ɵɵattribute("data-inset", ctx.inset() ? "" : null);
|
|
1739
|
+
} }, inputs: { inset: [1, "inset"] } });
|
|
1740
|
+
}
|
|
1741
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuLabel, [{
|
|
1742
|
+
type: Directive,
|
|
1743
|
+
args: [{
|
|
1744
|
+
selector: '[hlmDropdownMenuLabel],hlm-dropdown-menu-label',
|
|
1745
|
+
host: {
|
|
1746
|
+
'data-slot': 'dropdown-menu-label',
|
|
1747
|
+
'[attr.data-inset]': 'inset() ? "" : null',
|
|
1748
|
+
},
|
|
1749
|
+
}]
|
|
1750
|
+
}], () => [], { inset: [{ type: i0.Input, args: [{ isSignal: true, alias: "inset", required: false }] }] }); })();
|
|
1751
|
+
|
|
1752
|
+
class HlmDropdownMenuRadio {
|
|
1753
|
+
_cdkMenuItem = inject(CdkMenuItemRadio);
|
|
1754
|
+
checked = input(this._cdkMenuItem.checked, { ...(ngDevMode ? { debugName: "checked" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1755
|
+
disabled = input(this._cdkMenuItem.disabled, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1756
|
+
constructor() {
|
|
1757
|
+
classes(() => 'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground group relative flex w-full cursor-default items-center rounded-sm py-1.5 ps-8 pe-2 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50');
|
|
1758
|
+
}
|
|
1759
|
+
static ɵfac = function HlmDropdownMenuRadio_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuRadio)(); };
|
|
1760
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDropdownMenuRadio, selectors: [["", "hlmDropdownMenuRadio", ""]], hostAttrs: ["data-slot", "dropdown-menu-radio-item"], hostVars: 2, hostBindings: function HlmDropdownMenuRadio_HostBindings(rf, ctx) { if (rf & 2) {
|
|
1761
|
+
i0.ɵɵattribute("data-disabled", ctx.disabled() ? "" : null)("data-checked", ctx.checked() ? "" : null);
|
|
1762
|
+
} }, inputs: { checked: [1, "checked"], disabled: [1, "disabled"] }, features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$4.CdkMenuItemRadio, inputs: ["cdkMenuItemDisabled", "disabled", "cdkMenuItemChecked", "checked"], outputs: ["cdkMenuItemTriggered", "triggered"] }])] });
|
|
1763
|
+
}
|
|
1764
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuRadio, [{
|
|
1765
|
+
type: Directive,
|
|
1766
|
+
args: [{
|
|
1767
|
+
selector: '[hlmDropdownMenuRadio]',
|
|
1768
|
+
hostDirectives: [
|
|
1769
|
+
{
|
|
1770
|
+
directive: CdkMenuItemRadio,
|
|
1771
|
+
inputs: ['cdkMenuItemDisabled: disabled', 'cdkMenuItemChecked: checked'],
|
|
1772
|
+
outputs: ['cdkMenuItemTriggered: triggered'],
|
|
1773
|
+
},
|
|
1774
|
+
],
|
|
1775
|
+
host: {
|
|
1776
|
+
'data-slot': 'dropdown-menu-radio-item',
|
|
1777
|
+
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
1778
|
+
'[attr.data-checked]': 'checked() ? "" : null',
|
|
1779
|
+
},
|
|
1780
|
+
}]
|
|
1781
|
+
}], () => [], { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] }); })();
|
|
1782
|
+
|
|
1783
|
+
class HlmDropdownMenuRadioIndicator {
|
|
1784
|
+
constructor() {
|
|
1785
|
+
classes(() => 'pointer-events-none absolute start-2 flex size-3.5 items-center justify-center opacity-0 group-data-[checked]:opacity-100');
|
|
1786
|
+
}
|
|
1787
|
+
static ɵfac = function HlmDropdownMenuRadioIndicator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuRadioIndicator)(); };
|
|
1788
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmDropdownMenuRadioIndicator, selectors: [["hlm-dropdown-menu-radio-indicator"]], features: [i0.ɵɵProvidersFeature([provideIcons({ phosphorCircle })])], decls: 1, vars: 0, consts: [["name", "phosphorCircle", 1, "text-[0.5rem]", "*:[svg]:fill-current"]], template: function HlmDropdownMenuRadioIndicator_Template(rf, ctx) { if (rf & 1) {
|
|
1789
|
+
i0.ɵɵelement(0, "ng-icon", 0);
|
|
1790
|
+
} }, dependencies: [NgIcon], encapsulation: 2 });
|
|
1791
|
+
}
|
|
1792
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuRadioIndicator, [{
|
|
1793
|
+
type: Component,
|
|
1794
|
+
args: [{
|
|
1795
|
+
selector: 'hlm-dropdown-menu-radio-indicator',
|
|
1796
|
+
imports: [NgIcon],
|
|
1797
|
+
providers: [provideIcons({ phosphorCircle })],
|
|
1798
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1799
|
+
template: ` <ng-icon name="phosphorCircle" class="text-[0.5rem] *:[svg]:fill-current" /> `,
|
|
1800
|
+
}]
|
|
1801
|
+
}], () => [], null); })();
|
|
1802
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmDropdownMenuRadioIndicator, { className: "HlmDropdownMenuRadioIndicator", filePath: "lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-radio-indicator.ts", lineNumber: 13 }); })();
|
|
1803
|
+
|
|
1804
|
+
class HlmDropdownMenuSeparator {
|
|
1805
|
+
constructor() {
|
|
1806
|
+
classes(() => 'bg-border -mx-1 my-1 block h-px');
|
|
1807
|
+
}
|
|
1808
|
+
static ɵfac = function HlmDropdownMenuSeparator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuSeparator)(); };
|
|
1809
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDropdownMenuSeparator, selectors: [["", "hlmDropdownMenuSeparator", ""], ["hlm-dropdown-menu-separator"]], hostAttrs: ["data-slot", "dropdown-menu-separator"] });
|
|
1810
|
+
}
|
|
1811
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuSeparator, [{
|
|
1812
|
+
type: Directive,
|
|
1813
|
+
args: [{
|
|
1814
|
+
selector: '[hlmDropdownMenuSeparator],hlm-dropdown-menu-separator',
|
|
1815
|
+
host: {
|
|
1816
|
+
'data-slot': 'dropdown-menu-separator',
|
|
1817
|
+
},
|
|
1818
|
+
}]
|
|
1819
|
+
}], () => [], null); })();
|
|
1820
|
+
|
|
1821
|
+
class HlmDropdownMenuShortcut {
|
|
1822
|
+
constructor() {
|
|
1823
|
+
classes(() => 'text-muted-foreground ml-auto text-xs tracking-widest');
|
|
1824
|
+
}
|
|
1825
|
+
static ɵfac = function HlmDropdownMenuShortcut_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuShortcut)(); };
|
|
1826
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDropdownMenuShortcut, selectors: [["", "hlmDropdownMenuShortcut", ""], ["hlm-dropdown-menu-shortcut"]], hostAttrs: ["data-slot", "dropdown-menu-shortcut"] });
|
|
1827
|
+
}
|
|
1828
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuShortcut, [{
|
|
1829
|
+
type: Directive,
|
|
1830
|
+
args: [{
|
|
1831
|
+
selector: '[hlmDropdownMenuShortcut],hlm-dropdown-menu-shortcut',
|
|
1832
|
+
host: {
|
|
1833
|
+
'data-slot': 'dropdown-menu-shortcut',
|
|
1834
|
+
},
|
|
1835
|
+
}]
|
|
1836
|
+
}], () => [], null); })();
|
|
1837
|
+
|
|
1838
|
+
class HlmDropdownMenuSub {
|
|
1839
|
+
_host = inject(CdkMenu);
|
|
1840
|
+
_state = signal('open', /* @ts-ignore */
|
|
1841
|
+
...(ngDevMode ? [{ debugName: "_state" }] : /* istanbul ignore next */ []));
|
|
1842
|
+
_side = signal('top', /* @ts-ignore */
|
|
1843
|
+
...(ngDevMode ? [{ debugName: "_side" }] : /* istanbul ignore next */ []));
|
|
1844
|
+
constructor() {
|
|
1845
|
+
this.setSideWithDarkMagic();
|
|
1846
|
+
// this is a best effort, but does not seem to work currently
|
|
1847
|
+
// TODO: figure out a way for us to know the host is about to be closed. might not be possible with CDK
|
|
1848
|
+
this._host.closed.pipe(takeUntilDestroyed()).subscribe(() => this._state.set('closed'));
|
|
1849
|
+
classes(() => 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-top overflow-hidden rounded-md border p-1 shadow-lg');
|
|
1850
|
+
}
|
|
1851
|
+
setSideWithDarkMagic() {
|
|
1852
|
+
/**
|
|
1853
|
+
* This is an ugly workaround to at least figure out the correct side of where a submenu
|
|
1854
|
+
* will appear and set the attribute to the host accordingly
|
|
1855
|
+
*
|
|
1856
|
+
* First of all we take advantage of the menu stack not being aware of the root
|
|
1857
|
+
* object immediately after it is added. This code executes before the root element is added,
|
|
1858
|
+
* which means the stack is still empty and the peek method returns undefined.
|
|
1859
|
+
*/
|
|
1860
|
+
const isRoot = this._host.menuStack.peek() === undefined;
|
|
1861
|
+
setTimeout(() => {
|
|
1862
|
+
// our menu trigger directive leaves the last position used for use immediately after opening
|
|
1863
|
+
// we can access it here and determine the correct side.
|
|
1864
|
+
// eslint-disable-next-line
|
|
1865
|
+
const ps = this._host._parentTrigger._spartanLastPosition;
|
|
1866
|
+
if (!ps) {
|
|
1867
|
+
// if we have no last position we default to the most likely option
|
|
1868
|
+
// I hate that we have to do this and hope we can revisit soon and improve
|
|
1869
|
+
this._side.set(isRoot ? 'top' : 'left');
|
|
1870
|
+
return;
|
|
1871
|
+
}
|
|
1872
|
+
const side = isRoot ? ps.originY : ps.originX === 'end' ? 'right' : 'left';
|
|
1873
|
+
this._side.set(side);
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1876
|
+
static ɵfac = function HlmDropdownMenuSub_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuSub)(); };
|
|
1877
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDropdownMenuSub, selectors: [["", "hlmDropdownMenuSub", ""], ["hlm-dropdown-menu-sub"]], hostAttrs: ["data-slot", "dropdown-menu-sub"], hostVars: 2, hostBindings: function HlmDropdownMenuSub_HostBindings(rf, ctx) { if (rf & 2) {
|
|
1878
|
+
i0.ɵɵattribute("data-state", ctx._state())("data-side", ctx._side());
|
|
1879
|
+
} }, features: [i0.ɵɵHostDirectivesFeature([i1$4.CdkMenu])] });
|
|
1880
|
+
}
|
|
1881
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuSub, [{
|
|
1882
|
+
type: Directive,
|
|
1883
|
+
args: [{
|
|
1884
|
+
selector: '[hlmDropdownMenuSub],hlm-dropdown-menu-sub',
|
|
1885
|
+
hostDirectives: [CdkMenu],
|
|
1886
|
+
host: {
|
|
1887
|
+
'data-slot': 'dropdown-menu-sub',
|
|
1888
|
+
'[attr.data-state]': '_state()',
|
|
1889
|
+
'[attr.data-side]': '_side()',
|
|
1890
|
+
},
|
|
1891
|
+
}]
|
|
1892
|
+
}], () => [], null); })();
|
|
1893
|
+
|
|
1894
|
+
const defaultConfig$1 = {
|
|
1895
|
+
align: 'start',
|
|
1896
|
+
side: 'bottom',
|
|
1897
|
+
};
|
|
1898
|
+
const HlmDropdownMenuConfigToken = new InjectionToken('HlmDropdownMenuConfig');
|
|
1899
|
+
function provideHlmDropdownMenuConfig(config) {
|
|
1900
|
+
return { provide: HlmDropdownMenuConfigToken, useValue: { ...defaultConfig$1, ...config } };
|
|
1901
|
+
}
|
|
1902
|
+
function injectHlmDropdownMenuConfig() {
|
|
1903
|
+
return inject(HlmDropdownMenuConfigToken, { optional: true }) ?? defaultConfig$1;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
class HlmDropdownMenuTrigger {
|
|
1907
|
+
_cdkTrigger = inject(CdkMenuTrigger, { host: true });
|
|
1908
|
+
_config = injectHlmDropdownMenuConfig();
|
|
1909
|
+
align = input(this._config.align, /* @ts-ignore */
|
|
1910
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
1911
|
+
side = input(this._config.side, /* @ts-ignore */
|
|
1912
|
+
...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
1913
|
+
_menuPosition = computed(() => createMenuPosition(this.align(), this.side()), /* @ts-ignore */
|
|
1914
|
+
...(ngDevMode ? [{ debugName: "_menuPosition" }] : /* istanbul ignore next */ []));
|
|
1915
|
+
constructor() {
|
|
1916
|
+
// once the trigger opens we wait until the next tick and then grab the last position
|
|
1917
|
+
// used to position the menu. we store this in our trigger which the brnMenu directive has
|
|
1918
|
+
// access to through DI
|
|
1919
|
+
this._cdkTrigger.opened.pipe(takeUntilDestroyed()).subscribe(() => setTimeout(() =>
|
|
1920
|
+
// eslint-disable-next-line
|
|
1921
|
+
(this._cdkTrigger._spartanLastPosition = // eslint-disable-next-line
|
|
1922
|
+
this._cdkTrigger.overlayRef._positionStrategy._lastPosition)));
|
|
1923
|
+
effect(() => {
|
|
1924
|
+
this._cdkTrigger.menuPosition = this._menuPosition();
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
static ɵfac = function HlmDropdownMenuTrigger_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmDropdownMenuTrigger)(); };
|
|
1928
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmDropdownMenuTrigger, selectors: [["", "hlmDropdownMenuTrigger", ""]], hostAttrs: ["data-slot", "dropdown-menu-trigger"], inputs: { align: [1, "align"], side: [1, "side"] }, features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$4.CdkMenuTrigger, inputs: ["cdkMenuTriggerFor", "hlmDropdownMenuTrigger", "cdkMenuTriggerData", "hlmDropdownMenuTriggerData"], outputs: ["cdkMenuOpened", "hlmDropdownMenuOpened", "cdkMenuClosed", "hlmDropdownMenuClosed"] }])] });
|
|
1929
|
+
}
|
|
1930
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmDropdownMenuTrigger, [{
|
|
1931
|
+
type: Directive,
|
|
1932
|
+
args: [{
|
|
1933
|
+
selector: '[hlmDropdownMenuTrigger]',
|
|
1934
|
+
hostDirectives: [
|
|
1935
|
+
{
|
|
1936
|
+
directive: CdkMenuTrigger,
|
|
1937
|
+
inputs: [
|
|
1938
|
+
'cdkMenuTriggerFor: hlmDropdownMenuTrigger',
|
|
1939
|
+
'cdkMenuTriggerData: hlmDropdownMenuTriggerData',
|
|
1940
|
+
],
|
|
1941
|
+
outputs: ['cdkMenuOpened: hlmDropdownMenuOpened', 'cdkMenuClosed: hlmDropdownMenuClosed'],
|
|
1942
|
+
},
|
|
1943
|
+
],
|
|
1944
|
+
host: {
|
|
1945
|
+
'data-slot': 'dropdown-menu-trigger',
|
|
1946
|
+
},
|
|
1947
|
+
}]
|
|
1948
|
+
}], () => [], { align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }] }); })();
|
|
1949
|
+
|
|
1950
|
+
const HlmDropdownMenuImports = [
|
|
1951
|
+
HlmDropdownMenu,
|
|
1952
|
+
HlmDropdownMenuCheckbox,
|
|
1953
|
+
HlmDropdownMenuCheckboxIndicator,
|
|
1954
|
+
HlmDropdownMenuGroup,
|
|
1955
|
+
HlmDropdownMenuItem,
|
|
1956
|
+
HlmDropdownMenuItemSubIndicator,
|
|
1957
|
+
HlmDropdownMenuLabel,
|
|
1958
|
+
HlmDropdownMenuRadio,
|
|
1959
|
+
HlmDropdownMenuRadioIndicator,
|
|
1960
|
+
HlmDropdownMenuSeparator,
|
|
1961
|
+
HlmDropdownMenuShortcut,
|
|
1962
|
+
HlmDropdownMenuSub,
|
|
1963
|
+
HlmDropdownMenuTrigger,
|
|
1964
|
+
];
|
|
1965
|
+
|
|
1966
|
+
const fieldVariants = cva('data-[matches-spartan-invalid=true]:text-destructive gap-3 group/field flex w-full', {
|
|
1967
|
+
variants: {
|
|
1968
|
+
orientation: {
|
|
1969
|
+
vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',
|
|
1970
|
+
horizontal: [
|
|
1971
|
+
'flex-row items-center',
|
|
1972
|
+
'*:data-[slot=field-label]:flex-auto',
|
|
1973
|
+
'has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
1974
|
+
],
|
|
1975
|
+
responsive: [
|
|
1976
|
+
'flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto [&>.sr-only]:w-auto',
|
|
1977
|
+
'@md/field-group:*:data-[slot=field-label]:flex-auto',
|
|
1978
|
+
'@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
1979
|
+
],
|
|
1980
|
+
},
|
|
1981
|
+
},
|
|
1982
|
+
defaultVariants: {
|
|
1983
|
+
orientation: 'vertical',
|
|
1984
|
+
},
|
|
1985
|
+
});
|
|
1986
|
+
class HlmField {
|
|
1987
|
+
orientation = input('vertical', /* @ts-ignore */
|
|
1988
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
1989
|
+
constructor() {
|
|
1990
|
+
classes(() => fieldVariants({ orientation: this.orientation() }));
|
|
1991
|
+
}
|
|
1992
|
+
static ɵfac = function HlmField_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmField)(); };
|
|
1993
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmField, selectors: [["", "hlmField", ""], ["hlm-field"]], hostAttrs: ["role", "group", "data-slot", "field"], hostVars: 1, hostBindings: function HlmField_HostBindings(rf, ctx) { if (rf & 2) {
|
|
1994
|
+
i0.ɵɵattribute("data-orientation", ctx.orientation());
|
|
1995
|
+
} }, inputs: { orientation: [1, "orientation"] }, features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$3.BrnField, inputs: ["data-invalid", "data-invalid", "forceInvalid", "forceInvalid"] }])] });
|
|
1996
|
+
}
|
|
1997
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmField, [{
|
|
1998
|
+
type: Directive,
|
|
1999
|
+
args: [{
|
|
2000
|
+
selector: '[hlmField],hlm-field',
|
|
2001
|
+
hostDirectives: [{ directive: BrnField, inputs: ['data-invalid', 'forceInvalid'] }],
|
|
2002
|
+
host: {
|
|
2003
|
+
role: 'group',
|
|
2004
|
+
'data-slot': 'field',
|
|
2005
|
+
'[attr.data-orientation]': 'orientation()',
|
|
2006
|
+
},
|
|
2007
|
+
}]
|
|
2008
|
+
}], () => [], { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }] }); })();
|
|
2009
|
+
|
|
2010
|
+
class HlmFieldContent {
|
|
2011
|
+
constructor() {
|
|
2012
|
+
classes(() => 'gap-1 group/field-content flex flex-1 flex-col leading-snug');
|
|
2013
|
+
}
|
|
2014
|
+
static ɵfac = function HlmFieldContent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmFieldContent)(); };
|
|
2015
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmFieldContent, selectors: [["", "hlmFieldContent", ""], ["hlm-field-content"]], hostAttrs: ["data-slot", "field-content"] });
|
|
2016
|
+
}
|
|
2017
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmFieldContent, [{
|
|
2018
|
+
type: Directive,
|
|
2019
|
+
args: [{
|
|
2020
|
+
selector: '[hlmFieldContent],hlm-field-content',
|
|
2021
|
+
host: { 'data-slot': 'field-content' },
|
|
2022
|
+
}]
|
|
2023
|
+
}], () => [], null); })();
|
|
2024
|
+
|
|
2025
|
+
class HlmFieldDescription {
|
|
2026
|
+
static _id = 0;
|
|
2027
|
+
_a11y = inject(BrnFieldA11yService, { optional: true, host: true });
|
|
2028
|
+
id = input(`hlm-field-description-${HlmFieldDescription._id++}`, /* @ts-ignore */
|
|
2029
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
2030
|
+
_registeredId;
|
|
2031
|
+
_cleanup = this._a11y
|
|
2032
|
+
? effect(() => {
|
|
2033
|
+
const a11y = this._a11y;
|
|
2034
|
+
if (!a11y)
|
|
2035
|
+
return;
|
|
2036
|
+
const id = this.id();
|
|
2037
|
+
if (this._registeredId && this._registeredId !== id) {
|
|
2038
|
+
a11y.unregisterDescription(this._registeredId);
|
|
2039
|
+
}
|
|
2040
|
+
if (this._registeredId !== id) {
|
|
2041
|
+
a11y.registerDescription(id);
|
|
2042
|
+
this._registeredId = id;
|
|
2043
|
+
}
|
|
2044
|
+
})
|
|
2045
|
+
: null;
|
|
2046
|
+
constructor() {
|
|
2047
|
+
classes(() => [
|
|
2048
|
+
'text-muted-foreground text-start text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance',
|
|
2049
|
+
'last:mt-0 nth-last-2:-mt-1',
|
|
2050
|
+
'[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
|
|
2051
|
+
]);
|
|
2052
|
+
}
|
|
2053
|
+
ngOnDestroy() {
|
|
2054
|
+
this._cleanup?.destroy();
|
|
2055
|
+
if (this._registeredId) {
|
|
2056
|
+
this._a11y?.unregisterDescription(this._registeredId);
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
static ɵfac = function HlmFieldDescription_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmFieldDescription)(); };
|
|
2060
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmFieldDescription, selectors: [["", "hlmFieldDescription", ""], ["hlm-field-description"]], hostAttrs: ["data-slot", "field-description"], hostVars: 1, hostBindings: function HlmFieldDescription_HostBindings(rf, ctx) { if (rf & 2) {
|
|
2061
|
+
i0.ɵɵattribute("id", ctx.id());
|
|
2062
|
+
} }, inputs: { id: [1, "id"] } });
|
|
2063
|
+
}
|
|
2064
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmFieldDescription, [{
|
|
2065
|
+
type: Directive,
|
|
2066
|
+
args: [{
|
|
2067
|
+
selector: '[hlmFieldDescription],hlm-field-description',
|
|
2068
|
+
host: {
|
|
2069
|
+
'data-slot': 'field-description',
|
|
2070
|
+
'[attr.id]': 'id()',
|
|
2071
|
+
},
|
|
2072
|
+
}]
|
|
2073
|
+
}], () => [], { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] }); })();
|
|
2074
|
+
|
|
2075
|
+
const _c0$7 = ["*"];
|
|
2076
|
+
function HlmFieldError_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
2077
|
+
i0.ɵɵprojection(0);
|
|
2078
|
+
} }
|
|
2079
|
+
class HlmFieldError {
|
|
2080
|
+
static _id = 0;
|
|
2081
|
+
_field = inject(BrnField, { optional: true });
|
|
2082
|
+
_a11y = inject(BrnFieldA11yService, { optional: true, host: true });
|
|
2083
|
+
_registeredId;
|
|
2084
|
+
_hasParentField = !!this._field;
|
|
2085
|
+
/** The unique ID for the field error. If none is supplied, it will be auto-generated. */
|
|
2086
|
+
id = input(`hlm-field-error-${HlmFieldError._id++}`, /* @ts-ignore */
|
|
2087
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
2088
|
+
/**
|
|
2089
|
+
* The name of the specific validator error key to match (e.g. 'required').
|
|
2090
|
+
* When omitted, the error is shown if any validation error is present.
|
|
2091
|
+
*/
|
|
2092
|
+
validator = input(/* @ts-ignore */
|
|
2093
|
+
...(ngDevMode ? [undefined, { debugName: "validator" }] : /* istanbul ignore next */ []));
|
|
2094
|
+
/** Forces the error message to be visible regardless of the control's validation state. */
|
|
2095
|
+
forceShow = input(false, { ...(ngDevMode ? { debugName: "forceShow" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2096
|
+
_display = computed(() => !this._hasParentField || this.forceShow() || this._hasError(), /* @ts-ignore */
|
|
2097
|
+
...(ngDevMode ? [{ debugName: "_display" }] : /* istanbul ignore next */ []));
|
|
2098
|
+
_hasError = computed(() => {
|
|
2099
|
+
const errors = this._field?.errors();
|
|
2100
|
+
if (!errors)
|
|
2101
|
+
return false;
|
|
2102
|
+
const validator = this.validator();
|
|
2103
|
+
const spartanInvalid = this._field?.controlState()?.spartanInvalid;
|
|
2104
|
+
if (!spartanInvalid)
|
|
2105
|
+
return false;
|
|
2106
|
+
return validator ? validator in errors : Object.keys(errors).length > 0;
|
|
2107
|
+
}, /* @ts-ignore */
|
|
2108
|
+
...(ngDevMode ? [{ debugName: "_hasError" }] : /* istanbul ignore next */ []));
|
|
2109
|
+
_cleanup = this._a11y
|
|
2110
|
+
? effect(() => {
|
|
2111
|
+
const a11y = this._a11y;
|
|
2112
|
+
if (!a11y)
|
|
2113
|
+
return;
|
|
2114
|
+
const id = this.id();
|
|
2115
|
+
const hasError = this._hasError();
|
|
2116
|
+
if (this._registeredId && (this._registeredId !== id || !hasError)) {
|
|
2117
|
+
a11y.unregisterError(this._registeredId);
|
|
2118
|
+
this._registeredId = undefined;
|
|
2119
|
+
}
|
|
2120
|
+
if (hasError && this._registeredId !== id) {
|
|
2121
|
+
a11y.registerError(id);
|
|
2122
|
+
this._registeredId = id;
|
|
2123
|
+
}
|
|
2124
|
+
})
|
|
2125
|
+
: null;
|
|
2126
|
+
constructor() {
|
|
2127
|
+
classes(() => 'text-destructive text-sm font-normal');
|
|
2128
|
+
}
|
|
2129
|
+
ngOnDestroy() {
|
|
2130
|
+
this._cleanup?.destroy();
|
|
2131
|
+
if (this._registeredId) {
|
|
2132
|
+
this._a11y?.unregisterError(this._registeredId);
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
static ɵfac = function HlmFieldError_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmFieldError)(); };
|
|
2136
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmFieldError, selectors: [["hlm-field-error"]], hostAttrs: ["role", "alert", "data-slot", "field-error"], hostVars: 2, hostBindings: function HlmFieldError_HostBindings(rf, ctx) { if (rf & 2) {
|
|
2137
|
+
i0.ɵɵdomProperty("hidden", !ctx._display());
|
|
2138
|
+
i0.ɵɵattribute("id", ctx.id());
|
|
2139
|
+
} }, inputs: { id: [1, "id"], validator: [1, "validator"], forceShow: [1, "forceShow"] }, ngContentSelectors: _c0$7, decls: 1, vars: 1, template: function HlmFieldError_Template(rf, ctx) { if (rf & 1) {
|
|
2140
|
+
i0.ɵɵprojectionDef();
|
|
2141
|
+
i0.ɵɵconditionalCreate(0, HlmFieldError_Conditional_0_Template, 1, 0);
|
|
2142
|
+
} if (rf & 2) {
|
|
2143
|
+
i0.ɵɵconditional(ctx._display() ? 0 : -1);
|
|
2144
|
+
} }, encapsulation: 2 });
|
|
2145
|
+
}
|
|
2146
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmFieldError, [{
|
|
2147
|
+
type: Component,
|
|
2148
|
+
args: [{
|
|
2149
|
+
selector: 'hlm-field-error',
|
|
2150
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2151
|
+
host: {
|
|
2152
|
+
role: 'alert',
|
|
2153
|
+
'data-slot': 'field-error',
|
|
2154
|
+
'[attr.id]': 'id()',
|
|
2155
|
+
'[hidden]': '!_display()',
|
|
2156
|
+
},
|
|
2157
|
+
template: `
|
|
2158
|
+
@if (_display()) {
|
|
2159
|
+
<ng-content />
|
|
2160
|
+
}
|
|
2161
|
+
`,
|
|
2162
|
+
}]
|
|
2163
|
+
}], () => [], { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], validator: [{ type: i0.Input, args: [{ isSignal: true, alias: "validator", required: false }] }], forceShow: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceShow", required: false }] }] }); })();
|
|
2164
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmFieldError, { className: "HlmFieldError", filePath: "lib/ui/field/src/lib/hlm-field-error.ts", lineNumber: 31 }); })();
|
|
2165
|
+
|
|
2166
|
+
class HlmFieldGroup {
|
|
2167
|
+
constructor() {
|
|
2168
|
+
classes(() => 'gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col');
|
|
2169
|
+
}
|
|
2170
|
+
static ɵfac = function HlmFieldGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmFieldGroup)(); };
|
|
2171
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmFieldGroup, selectors: [["", "hlmFieldGroup", ""], ["hlm-field-group"]], hostAttrs: ["data-slot", "field-group"] });
|
|
2172
|
+
}
|
|
2173
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmFieldGroup, [{
|
|
2174
|
+
type: Directive,
|
|
2175
|
+
args: [{
|
|
2176
|
+
selector: '[hlmFieldGroup],hlm-field-group',
|
|
2177
|
+
host: { 'data-slot': 'field-group' },
|
|
2178
|
+
}]
|
|
2179
|
+
}], () => [], null); })();
|
|
2180
|
+
|
|
2181
|
+
class HlmLabel {
|
|
2182
|
+
constructor() {
|
|
2183
|
+
classes(() => 'gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed');
|
|
2184
|
+
}
|
|
2185
|
+
static ɵfac = function HlmLabel_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmLabel)(); };
|
|
2186
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmLabel, selectors: [["", "hlmLabel", ""]], hostAttrs: ["data-slot", "label"], features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$5.BrnLabel, inputs: ["id", "id", "for", "for"] }])] });
|
|
2187
|
+
}
|
|
2188
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmLabel, [{
|
|
2189
|
+
type: Directive,
|
|
2190
|
+
args: [{
|
|
2191
|
+
selector: '[hlmLabel]',
|
|
2192
|
+
hostDirectives: [{ directive: BrnLabel, inputs: ['id', 'for'] }],
|
|
2193
|
+
host: { 'data-slot': 'label' },
|
|
2194
|
+
}]
|
|
2195
|
+
}], () => [], null); })();
|
|
2196
|
+
|
|
2197
|
+
const HlmLabelImports = [HlmLabel];
|
|
2198
|
+
|
|
2199
|
+
class HlmFieldLabel {
|
|
2200
|
+
constructor() {
|
|
2201
|
+
classes(() => [
|
|
2202
|
+
'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 group/field-label peer/field-label flex w-fit',
|
|
2203
|
+
'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',
|
|
2204
|
+
]);
|
|
2205
|
+
}
|
|
2206
|
+
static ɵfac = function HlmFieldLabel_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmFieldLabel)(); };
|
|
2207
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmFieldLabel, selectors: [["", "hlmFieldLabel", ""], ["hlm-field-label"]], hostAttrs: ["data-slot", "field-label"], features: [i0.ɵɵHostDirectivesFeature([HlmLabel])] });
|
|
2208
|
+
}
|
|
2209
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmFieldLabel, [{
|
|
2210
|
+
type: Directive,
|
|
2211
|
+
args: [{
|
|
2212
|
+
selector: '[hlmFieldLabel],hlm-field-label',
|
|
2213
|
+
hostDirectives: [HlmLabel],
|
|
2214
|
+
host: { 'data-slot': 'field-label' },
|
|
2215
|
+
}]
|
|
2216
|
+
}], () => [], null); })();
|
|
2217
|
+
|
|
2218
|
+
class HlmFieldLegend {
|
|
2219
|
+
variant = input('legend', /* @ts-ignore */
|
|
2220
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2221
|
+
constructor() {
|
|
2222
|
+
classes(() => 'mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base');
|
|
2223
|
+
}
|
|
2224
|
+
static ɵfac = function HlmFieldLegend_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmFieldLegend)(); };
|
|
2225
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmFieldLegend, selectors: [["legend", "hlmFieldLegend", ""]], hostAttrs: ["data-slot", "field-legend"], hostVars: 1, hostBindings: function HlmFieldLegend_HostBindings(rf, ctx) { if (rf & 2) {
|
|
2226
|
+
i0.ɵɵattribute("data-variant", ctx.variant());
|
|
2227
|
+
} }, inputs: { variant: [1, "variant"] } });
|
|
2228
|
+
}
|
|
2229
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmFieldLegend, [{
|
|
2230
|
+
type: Directive,
|
|
2231
|
+
args: [{
|
|
2232
|
+
selector: 'legend[hlmFieldLegend]',
|
|
2233
|
+
host: {
|
|
2234
|
+
'data-slot': 'field-legend',
|
|
2235
|
+
'[attr.data-variant]': 'variant()',
|
|
2236
|
+
},
|
|
2237
|
+
}]
|
|
2238
|
+
}], () => [], { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] }); })();
|
|
2239
|
+
|
|
2240
|
+
const hlmSeparatorClass = 'inline-flex shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch';
|
|
2241
|
+
class HlmSeparator {
|
|
2242
|
+
constructor() {
|
|
2243
|
+
classes(() => hlmSeparatorClass);
|
|
2244
|
+
}
|
|
2245
|
+
static ɵfac = function HlmSeparator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSeparator)(); };
|
|
2246
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSeparator, selectors: [["", "hlmSeparator", ""], ["hlm-separator"]], hostAttrs: ["data-slot", "separator"], features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$6.BrnSeparator, inputs: ["orientation", "orientation", "decorative", "decorative"] }])] });
|
|
2247
|
+
}
|
|
2248
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSeparator, [{
|
|
2249
|
+
type: Directive,
|
|
2250
|
+
args: [{
|
|
2251
|
+
selector: '[hlmSeparator],hlm-separator',
|
|
2252
|
+
hostDirectives: [{ directive: BrnSeparator, inputs: ['orientation', 'decorative'] }],
|
|
2253
|
+
host: {
|
|
2254
|
+
'data-slot': 'separator',
|
|
2255
|
+
},
|
|
2256
|
+
}]
|
|
2257
|
+
}], () => [], null); })();
|
|
2258
|
+
|
|
2259
|
+
const HlmSeparatorImports = [HlmSeparator];
|
|
2260
|
+
|
|
2261
|
+
const _c0$6 = ["*"];
|
|
2262
|
+
class HlmFieldSeparator {
|
|
2263
|
+
constructor() {
|
|
2264
|
+
classes(() => '-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative');
|
|
2265
|
+
}
|
|
2266
|
+
static ɵfac = function HlmFieldSeparator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmFieldSeparator)(); };
|
|
2267
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmFieldSeparator, selectors: [["hlm-field-separator"]], hostAttrs: ["data-slot", "field-separator"], ngContentSelectors: _c0$6, decls: 3, vars: 0, consts: [[1, "absolute", "inset-0", "top-1/2"], ["data-slot", "field-separator-content", 1, "text-muted-foreground", "px-2", "bg-background", "relative", "mx-auto", "block", "w-fit"]], template: function HlmFieldSeparator_Template(rf, ctx) { if (rf & 1) {
|
|
2268
|
+
i0.ɵɵprojectionDef();
|
|
2269
|
+
i0.ɵɵelement(0, "hlm-separator", 0);
|
|
2270
|
+
i0.ɵɵelementStart(1, "span", 1);
|
|
2271
|
+
i0.ɵɵprojection(2);
|
|
2272
|
+
i0.ɵɵelementEnd();
|
|
2273
|
+
} }, dependencies: [HlmSeparator], encapsulation: 2 });
|
|
2274
|
+
}
|
|
2275
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmFieldSeparator, [{
|
|
2276
|
+
type: Component,
|
|
2277
|
+
args: [{
|
|
2278
|
+
selector: 'hlm-field-separator',
|
|
2279
|
+
imports: [HlmSeparator],
|
|
2280
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2281
|
+
host: { 'data-slot': 'field-separator' },
|
|
2282
|
+
template: `
|
|
2283
|
+
<hlm-separator class="absolute inset-0 top-1/2" />
|
|
2284
|
+
<span
|
|
2285
|
+
data-slot="field-separator-content"
|
|
2286
|
+
class="text-muted-foreground px-2 bg-background relative mx-auto block w-fit"
|
|
2287
|
+
>
|
|
2288
|
+
<ng-content />
|
|
2289
|
+
</span>
|
|
2290
|
+
`,
|
|
2291
|
+
}]
|
|
2292
|
+
}], () => [], null); })();
|
|
2293
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmFieldSeparator, { className: "HlmFieldSeparator", filePath: "lib/ui/field/src/lib/hlm-field-separator.ts", lineNumber: 20 }); })();
|
|
2294
|
+
|
|
2295
|
+
class HlmFieldSet {
|
|
2296
|
+
constructor() {
|
|
2297
|
+
classes(() => 'gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col');
|
|
2298
|
+
}
|
|
2299
|
+
static ɵfac = function HlmFieldSet_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmFieldSet)(); };
|
|
2300
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmFieldSet, selectors: [["fieldset", "hlmFieldSet", ""]], hostAttrs: ["data-slot", "field-set"] });
|
|
2301
|
+
}
|
|
2302
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmFieldSet, [{
|
|
2303
|
+
type: Directive,
|
|
2304
|
+
args: [{
|
|
2305
|
+
selector: 'fieldset[hlmFieldSet]',
|
|
2306
|
+
host: { 'data-slot': 'field-set' },
|
|
2307
|
+
}]
|
|
2308
|
+
}], () => [], null); })();
|
|
2309
|
+
|
|
2310
|
+
class HlmFieldTitle {
|
|
2311
|
+
constructor() {
|
|
2312
|
+
classes(() => 'gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center');
|
|
2313
|
+
}
|
|
2314
|
+
static ɵfac = function HlmFieldTitle_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmFieldTitle)(); };
|
|
2315
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmFieldTitle, selectors: [["", "hlmFieldTitle", ""], ["hlm-field-title"]], hostAttrs: ["data-slot", "field-label"] });
|
|
2316
|
+
}
|
|
2317
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmFieldTitle, [{
|
|
2318
|
+
type: Directive,
|
|
2319
|
+
args: [{
|
|
2320
|
+
selector: '[hlmFieldTitle],hlm-field-title',
|
|
2321
|
+
host: { 'data-slot': 'field-label' },
|
|
2322
|
+
}]
|
|
2323
|
+
}], () => [], null); })();
|
|
2324
|
+
|
|
2325
|
+
const HlmFieldImports = [
|
|
2326
|
+
HlmField,
|
|
2327
|
+
HlmFieldContent,
|
|
2328
|
+
HlmFieldDescription,
|
|
2329
|
+
HlmFieldError,
|
|
2330
|
+
HlmFieldGroup,
|
|
2331
|
+
HlmFieldLabel,
|
|
2332
|
+
HlmFieldLegend,
|
|
2333
|
+
HlmFieldSeparator,
|
|
2334
|
+
HlmFieldSet,
|
|
2335
|
+
HlmFieldTitle,
|
|
2336
|
+
];
|
|
2337
|
+
|
|
2338
|
+
class HlmInput {
|
|
2339
|
+
constructor() {
|
|
2340
|
+
classes(() => 'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 data-[matches-spartan-invalid=true]:ring-destructive/20 dark:data-[matches-spartan-invalid=true]:ring-destructive/40 data-[matches-spartan-invalid=true]:border-destructive dark:data-[matches-spartan-invalid=true]:border-destructive/50 h-9 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-3 data-[matches-spartan-invalid=true]:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50');
|
|
2341
|
+
}
|
|
2342
|
+
static ɵfac = function HlmInput_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmInput)(); };
|
|
2343
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmInput, selectors: [["", "hlmInput", ""]], features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$7.BrnInput, inputs: ["id", "id", "forceInvalid", "forceInvalid"] }, i1$3.BrnFieldControlDescribedBy])] });
|
|
2344
|
+
}
|
|
2345
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmInput, [{
|
|
2346
|
+
type: Directive,
|
|
2347
|
+
args: [{
|
|
2348
|
+
selector: '[hlmInput]',
|
|
2349
|
+
hostDirectives: [
|
|
2350
|
+
{ directive: BrnInput, inputs: ['id', 'forceInvalid'] },
|
|
2351
|
+
BrnFieldControlDescribedBy,
|
|
2352
|
+
],
|
|
2353
|
+
}]
|
|
2354
|
+
}], () => [], null); })();
|
|
2355
|
+
|
|
2356
|
+
const HlmInputImports = [HlmInput];
|
|
2357
|
+
|
|
2358
|
+
class HlmInputGroup {
|
|
2359
|
+
constructor() {
|
|
2360
|
+
classes(() => 'border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][data-matches-spartan-invalid=true]]:ring-destructive/20 has-[[data-slot][data-matches-spartan-invalid=true]]:border-destructive dark:has-[[data-slot][data-matches-spartan-invalid=true]]:ring-destructive/40 h-9 rounded-md border shadow-xs transition-[color,box-shadow] in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][data-matches-spartan-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto');
|
|
2361
|
+
}
|
|
2362
|
+
static ɵfac = function HlmInputGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmInputGroup)(); };
|
|
2363
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmInputGroup, selectors: [["", "hlmInputGroup", ""], ["hlm-input-group"]], hostAttrs: ["data-slot", "input-group", "role", "group"] });
|
|
2364
|
+
}
|
|
2365
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmInputGroup, [{
|
|
2366
|
+
type: Directive,
|
|
2367
|
+
args: [{
|
|
2368
|
+
selector: '[hlmInputGroup],hlm-input-group',
|
|
2369
|
+
host: {
|
|
2370
|
+
'data-slot': 'input-group',
|
|
2371
|
+
role: 'group',
|
|
2372
|
+
},
|
|
2373
|
+
}]
|
|
2374
|
+
}], () => [], null); })();
|
|
2375
|
+
|
|
2376
|
+
const inputGroupAddonVariants$1 = cva("text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>ng-icon:not([class*='text-'])]:text-[calc(var(--spacing)*4)] flex cursor-text items-center justify-center select-none", {
|
|
2377
|
+
variants: {
|
|
2378
|
+
align: {
|
|
2379
|
+
'inline-start': 'ps-2 has-[>button]:-ms-1 has-[>kbd]:ms-[-0.15rem] order-first',
|
|
2380
|
+
'inline-end': 'pe-2 has-[>button]:-me-1 has-[>kbd]:me-[-0.15rem] order-last',
|
|
2381
|
+
'block-start': 'px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start',
|
|
2382
|
+
'block-end': 'px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start',
|
|
2383
|
+
},
|
|
2384
|
+
},
|
|
2385
|
+
defaultVariants: {
|
|
2386
|
+
align: 'inline-start',
|
|
2387
|
+
},
|
|
2388
|
+
});
|
|
2389
|
+
class HlmInputGroupAddon {
|
|
2390
|
+
align = input('inline-start', /* @ts-ignore */
|
|
2391
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
2392
|
+
constructor() {
|
|
2393
|
+
classes(() => inputGroupAddonVariants$1({ align: this.align() }));
|
|
2394
|
+
}
|
|
2395
|
+
static ɵfac = function HlmInputGroupAddon_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmInputGroupAddon)(); };
|
|
2396
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmInputGroupAddon, selectors: [["", "hlmInputGroupAddon", ""], ["hlm-input-group-addon"]], hostAttrs: ["role", "group", "data-slot", "input-group-addon"], hostVars: 1, hostBindings: function HlmInputGroupAddon_HostBindings(rf, ctx) { if (rf & 2) {
|
|
2397
|
+
i0.ɵɵattribute("data-align", ctx.align());
|
|
2398
|
+
} }, inputs: { align: [1, "align"] } });
|
|
2399
|
+
}
|
|
2400
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmInputGroupAddon, [{
|
|
2401
|
+
type: Directive,
|
|
2402
|
+
args: [{
|
|
2403
|
+
selector: '[hlmInputGroupAddon],hlm-input-group-addon',
|
|
2404
|
+
host: {
|
|
2405
|
+
role: 'group',
|
|
2406
|
+
'data-slot': 'input-group-addon',
|
|
2407
|
+
'[attr.data-align]': 'align()',
|
|
2408
|
+
},
|
|
2409
|
+
}]
|
|
2410
|
+
}], () => [], { align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }] }); })();
|
|
2411
|
+
|
|
2412
|
+
const inputGroupAddonVariants = cva('gap-2 text-sm flex items-center shadow-none', {
|
|
2413
|
+
variants: {
|
|
2414
|
+
size: {
|
|
2415
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>ng-icon:not([class*='text-'])]:text-[calc(var(--spacing)*3.5)]",
|
|
2416
|
+
sm: '',
|
|
2417
|
+
'icon-xs': 'size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>ng-icon]:p-0',
|
|
2418
|
+
'icon-sm': 'size-8 p-0 has-[>ng-icon]:p-0',
|
|
2419
|
+
},
|
|
2420
|
+
},
|
|
2421
|
+
defaultVariants: {
|
|
2422
|
+
size: 'xs',
|
|
2423
|
+
},
|
|
2424
|
+
});
|
|
2425
|
+
class HlmInputGroupButton {
|
|
2426
|
+
size = input('xs', /* @ts-ignore */
|
|
2427
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2428
|
+
type = input('button', /* @ts-ignore */
|
|
2429
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
2430
|
+
constructor() {
|
|
2431
|
+
classes(() => inputGroupAddonVariants({ size: this.size() }));
|
|
2432
|
+
}
|
|
2433
|
+
static ɵfac = function HlmInputGroupButton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmInputGroupButton)(); };
|
|
2434
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmInputGroupButton, selectors: [["button", "hlmInputGroupButton", ""]], hostVars: 2, hostBindings: function HlmInputGroupButton_HostBindings(rf, ctx) { if (rf & 2) {
|
|
2435
|
+
i0.ɵɵdomProperty("type", ctx.type());
|
|
2436
|
+
i0.ɵɵattribute("data-size", ctx.size());
|
|
2437
|
+
} }, inputs: { size: [1, "size"], type: [1, "type"] }, features: [i0.ɵɵProvidersFeature([
|
|
2438
|
+
provideBrnButtonConfig({
|
|
2439
|
+
variant: 'ghost',
|
|
2440
|
+
}),
|
|
2441
|
+
]), i0.ɵɵHostDirectivesFeature([{ directive: HlmButton, inputs: ["variant", "variant"] }])] });
|
|
2442
|
+
}
|
|
2443
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmInputGroupButton, [{
|
|
2444
|
+
type: Directive,
|
|
2445
|
+
args: [{
|
|
2446
|
+
selector: 'button[hlmInputGroupButton]',
|
|
2447
|
+
providers: [
|
|
2448
|
+
provideBrnButtonConfig({
|
|
2449
|
+
variant: 'ghost',
|
|
2450
|
+
}),
|
|
2451
|
+
],
|
|
2452
|
+
hostDirectives: [
|
|
2453
|
+
{
|
|
2454
|
+
directive: HlmButton,
|
|
2455
|
+
inputs: ['variant'],
|
|
2456
|
+
},
|
|
2457
|
+
],
|
|
2458
|
+
host: {
|
|
2459
|
+
'[attr.data-size]': 'size()',
|
|
2460
|
+
'[type]': 'type()',
|
|
2461
|
+
},
|
|
2462
|
+
}]
|
|
2463
|
+
}], () => [], { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] }); })();
|
|
2464
|
+
|
|
2465
|
+
class HlmInputGroupInput {
|
|
2466
|
+
constructor() {
|
|
2467
|
+
classes(() => `rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 data-[matches-spartan-invalid=true]:ring-0 dark:bg-transparent flex-1`);
|
|
2468
|
+
}
|
|
2469
|
+
static ɵfac = function HlmInputGroupInput_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmInputGroupInput)(); };
|
|
2470
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmInputGroupInput, selectors: [["input", "hlmInputGroupInput", ""]], hostAttrs: ["data-slot", "input-group-control"], features: [i0.ɵɵHostDirectivesFeature([HlmInput])] });
|
|
2471
|
+
}
|
|
2472
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmInputGroupInput, [{
|
|
2473
|
+
type: Directive,
|
|
2474
|
+
args: [{
|
|
2475
|
+
selector: 'input[hlmInputGroupInput]',
|
|
2476
|
+
hostDirectives: [HlmInput],
|
|
2477
|
+
host: { 'data-slot': 'input-group-control' },
|
|
2478
|
+
}]
|
|
2479
|
+
}], () => [], null); })();
|
|
2480
|
+
|
|
2481
|
+
class HlmInputGroupText {
|
|
2482
|
+
constructor() {
|
|
2483
|
+
classes(() => "text-muted-foreground gap-2 text-sm [&_ng-icon:not([class*='text-'])]:text-[calc(var(--spacing)*4)] flex items-center [&_ng-icon]:pointer-events-none");
|
|
2484
|
+
}
|
|
2485
|
+
static ɵfac = function HlmInputGroupText_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmInputGroupText)(); };
|
|
2486
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmInputGroupText, selectors: [["", "hlmInputGroupText", ""], ["hlm-input-group-text"]] });
|
|
2487
|
+
}
|
|
2488
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmInputGroupText, [{
|
|
2489
|
+
type: Directive,
|
|
2490
|
+
args: [{
|
|
2491
|
+
selector: '[hlmInputGroupText],hlm-input-group-text',
|
|
2492
|
+
}]
|
|
2493
|
+
}], () => [], null); })();
|
|
2494
|
+
|
|
2495
|
+
class HlmTextarea {
|
|
2496
|
+
constructor() {
|
|
2497
|
+
classes(() => 'border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 data-[matches-spartan-invalid=true]:ring-destructive/20 dark:data-[matches-spartan-invalid=true]:ring-destructive/40 data-[matches-spartan-invalid=true]:border-destructive dark:data-[matches-spartan-invalid=true]:border-destructive/50 rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-3 data-[matches-spartan-invalid=true]:ring-3 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50');
|
|
2498
|
+
}
|
|
2499
|
+
static ɵfac = function HlmTextarea_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmTextarea)(); };
|
|
2500
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmTextarea, selectors: [["", "hlmTextarea", ""]], hostAttrs: ["data-slot", "textarea"], features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$8.BrnTextarea, inputs: ["id", "id", "forceInvalid", "forceInvalid"] }, i1$3.BrnFieldControlDescribedBy])] });
|
|
2501
|
+
}
|
|
2502
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmTextarea, [{
|
|
2503
|
+
type: Directive,
|
|
2504
|
+
args: [{
|
|
2505
|
+
selector: '[hlmTextarea]',
|
|
2506
|
+
hostDirectives: [
|
|
2507
|
+
{ directive: BrnTextarea, inputs: ['id', 'forceInvalid'] },
|
|
2508
|
+
BrnFieldControlDescribedBy,
|
|
2509
|
+
],
|
|
2510
|
+
host: { 'data-slot': 'textarea' },
|
|
2511
|
+
}]
|
|
2512
|
+
}], () => [], null); })();
|
|
2513
|
+
|
|
2514
|
+
const HlmTextareaImports = [HlmTextarea];
|
|
2515
|
+
|
|
2516
|
+
class HlmInputGroupTextarea {
|
|
2517
|
+
constructor() {
|
|
2518
|
+
classes(() => 'rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 data-[matches-spartan-invalid=true]:ring-0 dark:bg-transparent flex-1 resize-none');
|
|
2519
|
+
}
|
|
2520
|
+
static ɵfac = function HlmInputGroupTextarea_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmInputGroupTextarea)(); };
|
|
2521
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmInputGroupTextarea, selectors: [["textarea", "hlmInputGroupTextarea", ""]], hostAttrs: ["data-slot", "input-group-control"], features: [i0.ɵɵHostDirectivesFeature([HlmTextarea])] });
|
|
2522
|
+
}
|
|
2523
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmInputGroupTextarea, [{
|
|
2524
|
+
type: Directive,
|
|
2525
|
+
args: [{
|
|
2526
|
+
selector: 'textarea[hlmInputGroupTextarea]',
|
|
2527
|
+
hostDirectives: [HlmTextarea],
|
|
2528
|
+
host: { 'data-slot': 'input-group-control' },
|
|
2529
|
+
}]
|
|
2530
|
+
}], () => [], null); })();
|
|
2531
|
+
|
|
2532
|
+
const HlmInputGroupImports = [
|
|
2533
|
+
HlmInputGroup,
|
|
2534
|
+
HlmInputGroupAddon,
|
|
2535
|
+
HlmInputGroupButton,
|
|
2536
|
+
HlmInputGroupInput,
|
|
2537
|
+
HlmInputGroupText,
|
|
2538
|
+
HlmInputGroupTextarea,
|
|
2539
|
+
];
|
|
2540
|
+
|
|
2541
|
+
class HlmSelect {
|
|
2542
|
+
constructor() {
|
|
2543
|
+
classes(() => 'block');
|
|
2544
|
+
}
|
|
2545
|
+
static ɵfac = function HlmSelect_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelect)(); };
|
|
2546
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelect, selectors: [["", "hlmSelect", ""], ["hlm-select"]], hostAttrs: ["data-slot", "select"], features: [i0.ɵɵProvidersFeature([
|
|
2547
|
+
provideBrnPopoverConfig({
|
|
2548
|
+
align: 'start',
|
|
2549
|
+
sideOffset: 6,
|
|
2550
|
+
}),
|
|
2551
|
+
provideBrnDialogDefaultOptions({
|
|
2552
|
+
autoFocus: 'first-heading',
|
|
2553
|
+
}),
|
|
2554
|
+
]), i0.ɵɵHostDirectivesFeature([{ directive: i1$9.BrnSelect, inputs: ["disabled", "disabled", "value", "value", "isItemEqualToValue", "isItemEqualToValue", "itemToString", "itemToString"], outputs: ["valueChange", "valueChange"] }, { directive: i2.BrnPopover, inputs: ["align", "align", "autoFocus", "autoFocus", "closeDelay", "closeDelay", "closeOnOutsidePointerEvents", "closeOnOutsidePointerEvents", "sideOffset", "sideOffset", "state", "state", "offsetX", "offsetX", "restoreFocus", "restoreFocus"], outputs: ["stateChanged", "stateChanged", "closed", "closed"] }])] });
|
|
2555
|
+
}
|
|
2556
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelect, [{
|
|
2557
|
+
type: Directive,
|
|
2558
|
+
args: [{
|
|
2559
|
+
selector: '[hlmSelect],hlm-select',
|
|
2560
|
+
providers: [
|
|
2561
|
+
provideBrnPopoverConfig({
|
|
2562
|
+
align: 'start',
|
|
2563
|
+
sideOffset: 6,
|
|
2564
|
+
}),
|
|
2565
|
+
provideBrnDialogDefaultOptions({
|
|
2566
|
+
autoFocus: 'first-heading',
|
|
2567
|
+
}),
|
|
2568
|
+
],
|
|
2569
|
+
hostDirectives: [
|
|
2570
|
+
{
|
|
2571
|
+
directive: BrnSelect,
|
|
2572
|
+
inputs: ['disabled', 'value', 'isItemEqualToValue', 'itemToString'],
|
|
2573
|
+
outputs: ['valueChange'],
|
|
2574
|
+
},
|
|
2575
|
+
{
|
|
2576
|
+
directive: BrnPopover,
|
|
2577
|
+
inputs: [
|
|
2578
|
+
'align',
|
|
2579
|
+
'autoFocus',
|
|
2580
|
+
'closeDelay',
|
|
2581
|
+
'closeOnOutsidePointerEvents',
|
|
2582
|
+
'sideOffset',
|
|
2583
|
+
'state',
|
|
2584
|
+
'offsetX',
|
|
2585
|
+
'restoreFocus',
|
|
2586
|
+
],
|
|
2587
|
+
outputs: ['stateChanged', 'closed'],
|
|
2588
|
+
},
|
|
2589
|
+
],
|
|
2590
|
+
host: { 'data-slot': 'select' },
|
|
2591
|
+
}]
|
|
2592
|
+
}], () => [], null); })();
|
|
2593
|
+
|
|
2594
|
+
class HlmSelectScrollDown {
|
|
2595
|
+
constructor() {
|
|
2596
|
+
classes(() => "bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_ng-icon:not([class*='text-'])]:text-[calc(var(--spacing)*4)] sticky bottom-0 w-full data-hidden:hidden");
|
|
2597
|
+
}
|
|
2598
|
+
static ɵfac = function HlmSelectScrollDown_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectScrollDown)(); };
|
|
2599
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmSelectScrollDown, selectors: [["hlm-select-scroll-down"]], features: [i0.ɵɵProvidersFeature([provideIcons({ phosphorCaretDown })]), i0.ɵɵHostDirectivesFeature([i1$9.BrnSelectScrollDown])], decls: 1, vars: 0, consts: [["name", "phosphorCaretDown"]], template: function HlmSelectScrollDown_Template(rf, ctx) { if (rf & 1) {
|
|
2600
|
+
i0.ɵɵelement(0, "ng-icon", 0);
|
|
2601
|
+
} }, dependencies: [NgIcon], encapsulation: 2 });
|
|
2602
|
+
}
|
|
2603
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectScrollDown, [{
|
|
2604
|
+
type: Component,
|
|
2605
|
+
args: [{
|
|
2606
|
+
selector: 'hlm-select-scroll-down',
|
|
2607
|
+
imports: [NgIcon],
|
|
2608
|
+
providers: [provideIcons({ phosphorCaretDown })],
|
|
2609
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2610
|
+
hostDirectives: [BrnSelectScrollDown],
|
|
2611
|
+
template: ` <ng-icon name="phosphorCaretDown" /> `,
|
|
2612
|
+
}]
|
|
2613
|
+
}], () => [], null); })();
|
|
2614
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmSelectScrollDown, { className: "HlmSelectScrollDown", filePath: "lib/ui/select/src/lib/hlm-select-scroll-down.ts", lineNumber: 15 }); })();
|
|
2615
|
+
|
|
2616
|
+
class HlmSelectScrollUp {
|
|
2617
|
+
constructor() {
|
|
2618
|
+
classes(() => "bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_ng-icon:not([class*='text-'])]:text-[calc(var(--spacing)*4)] sticky top-0 w-full data-hidden:hidden");
|
|
2619
|
+
}
|
|
2620
|
+
static ɵfac = function HlmSelectScrollUp_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectScrollUp)(); };
|
|
2621
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmSelectScrollUp, selectors: [["hlm-select-scroll-up"]], features: [i0.ɵɵProvidersFeature([provideIcons({ phosphorCaretUp })]), i0.ɵɵHostDirectivesFeature([i1$9.BrnSelectScrollUp])], decls: 1, vars: 0, consts: [["name", "phosphorCaretUp"]], template: function HlmSelectScrollUp_Template(rf, ctx) { if (rf & 1) {
|
|
2622
|
+
i0.ɵɵelement(0, "ng-icon", 0);
|
|
2623
|
+
} }, dependencies: [NgIcon], encapsulation: 2 });
|
|
2624
|
+
}
|
|
2625
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectScrollUp, [{
|
|
2626
|
+
type: Component,
|
|
2627
|
+
args: [{
|
|
2628
|
+
selector: 'hlm-select-scroll-up',
|
|
2629
|
+
imports: [NgIcon],
|
|
2630
|
+
providers: [provideIcons({ phosphorCaretUp })],
|
|
2631
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2632
|
+
hostDirectives: [BrnSelectScrollUp],
|
|
2633
|
+
template: ` <ng-icon name="phosphorCaretUp" /> `,
|
|
2634
|
+
}]
|
|
2635
|
+
}], () => [], null); })();
|
|
2636
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmSelectScrollUp, { className: "HlmSelectScrollUp", filePath: "lib/ui/select/src/lib/hlm-select-scroll-up.ts", lineNumber: 15 }); })();
|
|
2637
|
+
|
|
2638
|
+
const _c0$5 = ["*"];
|
|
2639
|
+
function HlmSelectContent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
2640
|
+
i0.ɵɵelement(0, "hlm-select-scroll-up");
|
|
2641
|
+
} }
|
|
2642
|
+
function HlmSelectContent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
2643
|
+
i0.ɵɵelement(0, "hlm-select-scroll-down");
|
|
2644
|
+
} }
|
|
2645
|
+
class HlmSelectContent {
|
|
2646
|
+
_computedListboxClasses = computed(() => hlm('flex flex-col'), /* @ts-ignore */
|
|
2647
|
+
...(ngDevMode ? [{ debugName: "_computedListboxClasses" }] : /* istanbul ignore next */ []));
|
|
2648
|
+
showScroll = input(false, { ...(ngDevMode ? { debugName: "showScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2649
|
+
constructor() {
|
|
2650
|
+
classes(() => 'bg-popover no-scrollbar text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 max-h-72 min-w-36 flex-col rounded-md shadow-md ring-1 duration-100 relative flex w-(--brn-select-width) overflow-x-hidden overflow-y-auto');
|
|
2651
|
+
}
|
|
2652
|
+
static ɵfac = function HlmSelectContent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectContent)(); };
|
|
2653
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmSelectContent, selectors: [["hlm-select-content"]], inputs: { showScroll: [1, "showScroll"] }, features: [i0.ɵɵHostDirectivesFeature([i1$9.BrnSelectContent])], ngContentSelectors: _c0$5, decls: 4, vars: 4, consts: [["role", "listbox"]], template: function HlmSelectContent_Template(rf, ctx) { if (rf & 1) {
|
|
2654
|
+
i0.ɵɵprojectionDef();
|
|
2655
|
+
i0.ɵɵconditionalCreate(0, HlmSelectContent_Conditional_0_Template, 1, 0, "hlm-select-scroll-up");
|
|
2656
|
+
i0.ɵɵelementStart(1, "div", 0);
|
|
2657
|
+
i0.ɵɵprojection(2);
|
|
2658
|
+
i0.ɵɵelementEnd();
|
|
2659
|
+
i0.ɵɵconditionalCreate(3, HlmSelectContent_Conditional_3_Template, 1, 0, "hlm-select-scroll-down");
|
|
2660
|
+
} if (rf & 2) {
|
|
2661
|
+
i0.ɵɵconditional(ctx.showScroll() ? 0 : -1);
|
|
2662
|
+
i0.ɵɵadvance();
|
|
2663
|
+
i0.ɵɵclassMap(ctx._computedListboxClasses());
|
|
2664
|
+
i0.ɵɵadvance(2);
|
|
2665
|
+
i0.ɵɵconditional(ctx.showScroll() ? 3 : -1);
|
|
2666
|
+
} }, dependencies: [HlmSelectScrollUp, HlmSelectScrollDown], encapsulation: 2 });
|
|
2667
|
+
}
|
|
2668
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectContent, [{
|
|
2669
|
+
type: Component,
|
|
2670
|
+
args: [{
|
|
2671
|
+
selector: 'hlm-select-content',
|
|
2672
|
+
imports: [HlmSelectScrollUp, HlmSelectScrollDown],
|
|
2673
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2674
|
+
hostDirectives: [BrnSelectContent],
|
|
2675
|
+
template: `
|
|
2676
|
+
@if (showScroll()) {
|
|
2677
|
+
<hlm-select-scroll-up />
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
<div role="listbox" [class]="_computedListboxClasses()">
|
|
2681
|
+
<ng-content />
|
|
2682
|
+
</div>
|
|
2683
|
+
|
|
2684
|
+
@if (showScroll()) {
|
|
2685
|
+
<hlm-select-scroll-down />
|
|
2686
|
+
}
|
|
2687
|
+
`,
|
|
2688
|
+
}]
|
|
2689
|
+
}], () => [], { showScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showScroll", required: false }] }] }); })();
|
|
2690
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmSelectContent, { className: "HlmSelectContent", filePath: "lib/ui/select/src/lib/hlm-select-content.ts", lineNumber: 33 }); })();
|
|
2691
|
+
|
|
2692
|
+
class HlmSelectGroup {
|
|
2693
|
+
constructor() {
|
|
2694
|
+
classes(() => 'scroll-my-1 p-1');
|
|
2695
|
+
}
|
|
2696
|
+
static ɵfac = function HlmSelectGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectGroup)(); };
|
|
2697
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelectGroup, selectors: [["", "hlmSelectGroup", ""], ["hlm-select-group"]], hostAttrs: ["data-slot", "select-group"], features: [i0.ɵɵHostDirectivesFeature([i1$9.BrnSelectGroup])] });
|
|
2698
|
+
}
|
|
2699
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectGroup, [{
|
|
2700
|
+
type: Directive,
|
|
2701
|
+
args: [{
|
|
2702
|
+
selector: '[hlmSelectGroup],hlm-select-group',
|
|
2703
|
+
hostDirectives: [{ directive: BrnSelectGroup }],
|
|
2704
|
+
host: { 'data-slot': 'select-group' },
|
|
2705
|
+
}]
|
|
2706
|
+
}], () => [], null); })();
|
|
2707
|
+
|
|
2708
|
+
const _c0$4 = ["*"];
|
|
2709
|
+
function HlmSelectItem_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
2710
|
+
i0.ɵɵelement(0, "ng-icon", 0);
|
|
2711
|
+
} }
|
|
2712
|
+
class HlmSelectItem {
|
|
2713
|
+
_brnSelectItem = inject(BrnSelectItem);
|
|
2714
|
+
_active = this._brnSelectItem.active;
|
|
2715
|
+
constructor() {
|
|
2716
|
+
classes(() => 'data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0');
|
|
2717
|
+
}
|
|
2718
|
+
static ɵfac = function HlmSelectItem_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectItem)(); };
|
|
2719
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmSelectItem, selectors: [["hlm-select-item"]], hostAttrs: ["data-slot", "select-item"], features: [i0.ɵɵProvidersFeature([provideIcons({ phosphorCheck })]), i0.ɵɵHostDirectivesFeature([{ directive: i1$9.BrnSelectItem, inputs: ["id", "id", "disabled", "disabled", "value", "value"] }])], ngContentSelectors: _c0$4, decls: 2, vars: 1, consts: [["name", "phosphorCheck", "aria-hidden", "true", 1, "absolute", "end-2", "flex", "items-center", "justify-center", "text-[calc(var(--spacing)*4)]"]], template: function HlmSelectItem_Template(rf, ctx) { if (rf & 1) {
|
|
2720
|
+
i0.ɵɵprojectionDef();
|
|
2721
|
+
i0.ɵɵprojection(0);
|
|
2722
|
+
i0.ɵɵconditionalCreate(1, HlmSelectItem_Conditional_1_Template, 1, 0, "ng-icon", 0);
|
|
2723
|
+
} if (rf & 2) {
|
|
2724
|
+
i0.ɵɵadvance();
|
|
2725
|
+
i0.ɵɵconditional(ctx._active() ? 1 : -1);
|
|
2726
|
+
} }, dependencies: [NgIcon], encapsulation: 2 });
|
|
2727
|
+
}
|
|
2728
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectItem, [{
|
|
2729
|
+
type: Component,
|
|
2730
|
+
args: [{
|
|
2731
|
+
selector: 'hlm-select-item',
|
|
2732
|
+
imports: [NgIcon],
|
|
2733
|
+
providers: [provideIcons({ phosphorCheck })],
|
|
2734
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2735
|
+
hostDirectives: [{ directive: BrnSelectItem, inputs: ['id', 'disabled', 'value'] }],
|
|
2736
|
+
host: { 'data-slot': 'select-item' },
|
|
2737
|
+
template: `
|
|
2738
|
+
<ng-content />
|
|
2739
|
+
@if (_active()) {
|
|
2740
|
+
<ng-icon
|
|
2741
|
+
name="phosphorCheck"
|
|
2742
|
+
class="absolute end-2 flex items-center justify-center text-[calc(var(--spacing)*4)]"
|
|
2743
|
+
aria-hidden="true"
|
|
2744
|
+
/>
|
|
2745
|
+
}
|
|
2746
|
+
`,
|
|
2747
|
+
}]
|
|
2748
|
+
}], () => [], null); })();
|
|
2749
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmSelectItem, { className: "HlmSelectItem", filePath: "lib/ui/select/src/lib/hlm-select-item.ts", lineNumber: 25 }); })();
|
|
2750
|
+
|
|
2751
|
+
class HlmSelectLabel {
|
|
2752
|
+
constructor() {
|
|
2753
|
+
classes(() => 'text-muted-foreground px-2 py-1.5 text-xs flex');
|
|
2754
|
+
}
|
|
2755
|
+
static ɵfac = function HlmSelectLabel_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectLabel)(); };
|
|
2756
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelectLabel, selectors: [["", "hlmSelectLabel", ""], ["hlm-select-label"]], hostAttrs: ["data-slot", "select-label"], features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$9.BrnSelectLabel, inputs: ["id", "id"] }])] });
|
|
2757
|
+
}
|
|
2758
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectLabel, [{
|
|
2759
|
+
type: Directive,
|
|
2760
|
+
args: [{
|
|
2761
|
+
selector: '[hlmSelectLabel],hlm-select-label',
|
|
2762
|
+
hostDirectives: [{ directive: BrnSelectLabel, inputs: ['id'] }],
|
|
2763
|
+
host: { 'data-slot': 'select-label' },
|
|
2764
|
+
}]
|
|
2765
|
+
}], () => [], null); })();
|
|
2766
|
+
|
|
2767
|
+
class HlmSelectMultiple {
|
|
2768
|
+
constructor() {
|
|
2769
|
+
classes(() => 'block');
|
|
2770
|
+
}
|
|
2771
|
+
static ɵfac = function HlmSelectMultiple_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectMultiple)(); };
|
|
2772
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelectMultiple, selectors: [["", "hlmSelectMultiple", ""], ["hlm-select-multiple"]], hostAttrs: ["data-slot", "select"], features: [i0.ɵɵProvidersFeature([
|
|
2773
|
+
provideBrnPopoverConfig({
|
|
2774
|
+
align: 'start',
|
|
2775
|
+
sideOffset: 6,
|
|
2776
|
+
}),
|
|
2777
|
+
provideBrnDialogDefaultOptions({
|
|
2778
|
+
autoFocus: 'first-heading',
|
|
2779
|
+
}),
|
|
2780
|
+
]), i0.ɵɵHostDirectivesFeature([{ directive: i1$9.BrnSelectMultiple, inputs: ["disabled", "disabled", "value", "value", "isItemEqualToValue", "isItemEqualToValue", "itemToString", "itemToString"], outputs: ["valueChange", "valueChange"] }, { directive: i2.BrnPopover, inputs: ["align", "align", "autoFocus", "autoFocus", "closeDelay", "closeDelay", "closeOnOutsidePointerEvents", "closeOnOutsidePointerEvents", "sideOffset", "sideOffset", "state", "state", "offsetX", "offsetX", "restoreFocus", "restoreFocus"], outputs: ["stateChanged", "stateChanged", "closed", "closed"] }])] });
|
|
2781
|
+
}
|
|
2782
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectMultiple, [{
|
|
2783
|
+
type: Directive,
|
|
2784
|
+
args: [{
|
|
2785
|
+
selector: '[hlmSelectMultiple],hlm-select-multiple',
|
|
2786
|
+
providers: [
|
|
2787
|
+
provideBrnPopoverConfig({
|
|
2788
|
+
align: 'start',
|
|
2789
|
+
sideOffset: 6,
|
|
2790
|
+
}),
|
|
2791
|
+
provideBrnDialogDefaultOptions({
|
|
2792
|
+
autoFocus: 'first-heading',
|
|
2793
|
+
}),
|
|
2794
|
+
],
|
|
2795
|
+
hostDirectives: [
|
|
2796
|
+
{
|
|
2797
|
+
directive: BrnSelectMultiple,
|
|
2798
|
+
inputs: ['disabled', 'value', 'isItemEqualToValue', 'itemToString'],
|
|
2799
|
+
outputs: ['valueChange'],
|
|
2800
|
+
},
|
|
2801
|
+
{
|
|
2802
|
+
directive: BrnPopover,
|
|
2803
|
+
inputs: [
|
|
2804
|
+
'align',
|
|
2805
|
+
'autoFocus',
|
|
2806
|
+
'closeDelay',
|
|
2807
|
+
'closeOnOutsidePointerEvents',
|
|
2808
|
+
'sideOffset',
|
|
2809
|
+
'state',
|
|
2810
|
+
'offsetX',
|
|
2811
|
+
'restoreFocus',
|
|
2812
|
+
],
|
|
2813
|
+
outputs: ['stateChanged', 'closed'],
|
|
2814
|
+
},
|
|
2815
|
+
],
|
|
2816
|
+
host: { 'data-slot': 'select' },
|
|
2817
|
+
}]
|
|
2818
|
+
}], () => [], null); })();
|
|
2819
|
+
|
|
2820
|
+
class HlmSelectPlaceholder {
|
|
2821
|
+
constructor() {
|
|
2822
|
+
classes(() => "gap-2 [&_ng-icon:not([class*='text-'])]:text-[calc(var(--spacing)*4)] flex items-center data-hidden:hidden [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0");
|
|
2823
|
+
}
|
|
2824
|
+
static ɵfac = function HlmSelectPlaceholder_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectPlaceholder)(); };
|
|
2825
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelectPlaceholder, selectors: [["", "hlmSelectPlaceholder", ""], ["hlm-select-placeholder"]], hostAttrs: ["data-slot", "select-placeholder"], features: [i0.ɵɵHostDirectivesFeature([i1$9.BrnSelectPlaceholder])] });
|
|
2826
|
+
}
|
|
2827
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectPlaceholder, [{
|
|
2828
|
+
type: Directive,
|
|
2829
|
+
args: [{
|
|
2830
|
+
selector: '[hlmSelectPlaceholder],hlm-select-placeholder',
|
|
2831
|
+
hostDirectives: [BrnSelectPlaceholder],
|
|
2832
|
+
host: { 'data-slot': 'select-placeholder' },
|
|
2833
|
+
}]
|
|
2834
|
+
}], () => [], null); })();
|
|
2835
|
+
|
|
2836
|
+
class HlmSelectPortal {
|
|
2837
|
+
static ɵfac = function HlmSelectPortal_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectPortal)(); };
|
|
2838
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelectPortal, selectors: [["", "hlmSelectPortal", ""]], features: [i0.ɵɵHostDirectivesFeature([{ directive: i2.BrnPopoverContent, inputs: ["context", "context", "class", "class"] }])] });
|
|
2839
|
+
}
|
|
2840
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectPortal, [{
|
|
2841
|
+
type: Directive,
|
|
2842
|
+
args: [{
|
|
2843
|
+
selector: '[hlmSelectPortal]',
|
|
2844
|
+
hostDirectives: [{ directive: BrnPopoverContent, inputs: ['context', 'class'] }],
|
|
2845
|
+
}]
|
|
2846
|
+
}], null, null); })();
|
|
2847
|
+
|
|
2848
|
+
class HlmSelectSeparator {
|
|
2849
|
+
constructor() {
|
|
2850
|
+
classes(() => 'bg-border -mx-1 my-1 h-px pointer-events-none');
|
|
2851
|
+
}
|
|
2852
|
+
static ɵfac = function HlmSelectSeparator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectSeparator)(); };
|
|
2853
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelectSeparator, selectors: [["", "hlmSelectSeparator", ""], ["hlm-select-separator"]], hostAttrs: ["data-slot", "select-separator"], features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$9.BrnSelectSeparator, inputs: ["orientation", "orientation"] }])] });
|
|
2854
|
+
}
|
|
2855
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectSeparator, [{
|
|
2856
|
+
type: Directive,
|
|
2857
|
+
args: [{
|
|
2858
|
+
selector: '[hlmSelectSeparator],hlm-select-separator',
|
|
2859
|
+
hostDirectives: [{ directive: BrnSelectSeparator, inputs: ['orientation'] }],
|
|
2860
|
+
host: { 'data-slot': 'select-separator' },
|
|
2861
|
+
}]
|
|
2862
|
+
}], () => [], null); })();
|
|
2863
|
+
|
|
2864
|
+
const _c0$3 = ["*"];
|
|
2865
|
+
class HlmSelectTrigger {
|
|
2866
|
+
static _id = 0;
|
|
2867
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2868
|
+
_computedClass = computed(() => hlm('border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 data-[matches-spartan-invalid=true]:ring-destructive/20 dark:data-[matches-spartan-invalid=true]:ring-destructive/40 data-[matches-spartan-invalid=true]:border-destructive dark:data-[matches-spartan-invalid=true]:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 ps-2.5 pe-2 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-3 data-[matches-spartan-invalid=true]:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:gap-1.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0', this.userClass()), /* @ts-ignore */
|
|
2869
|
+
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
2870
|
+
buttonId = input(`hlm-select-trigger-${HlmSelectTrigger._id++}`, /* @ts-ignore */
|
|
2871
|
+
...(ngDevMode ? [{ debugName: "buttonId" }] : /* istanbul ignore next */ []));
|
|
2872
|
+
size = input('default', /* @ts-ignore */
|
|
2873
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2874
|
+
/** Whether to force the trigger into an invalid state. */
|
|
2875
|
+
forceInvalid = input(false, { ...(ngDevMode ? { debugName: "forceInvalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2876
|
+
static ɵfac = function HlmSelectTrigger_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectTrigger)(); };
|
|
2877
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmSelectTrigger, selectors: [["hlm-select-trigger"]], inputs: { userClass: [1, "class", "userClass"], buttonId: [1, "buttonId"], size: [1, "size"], forceInvalid: [1, "forceInvalid"] }, features: [i0.ɵɵProvidersFeature([provideIcons({ phosphorCaretUpDown })])], ngContentSelectors: _c0$3, decls: 3, vars: 5, consts: [["brnSelectTrigger", "", "brnFieldControlDescribedBy", "", "data-slot", "select-trigger", 3, "forceInvalid", "id"], ["name", "phosphorCaretUpDown", 1, "text-muted-foreground", "text-[calc(var(--spacing)*4)]", "ms-auto"]], template: function HlmSelectTrigger_Template(rf, ctx) { if (rf & 1) {
|
|
2878
|
+
i0.ɵɵprojectionDef();
|
|
2879
|
+
i0.ɵɵelementStart(0, "button", 0);
|
|
2880
|
+
i0.ɵɵprojection(1);
|
|
2881
|
+
i0.ɵɵelement(2, "ng-icon", 1);
|
|
2882
|
+
i0.ɵɵelementEnd();
|
|
2883
|
+
} if (rf & 2) {
|
|
2884
|
+
i0.ɵɵclassMap(ctx._computedClass());
|
|
2885
|
+
i0.ɵɵproperty("forceInvalid", ctx.forceInvalid())("id", ctx.buttonId());
|
|
2886
|
+
i0.ɵɵattribute("data-size", ctx.size());
|
|
2887
|
+
} }, dependencies: [NgIcon, BrnSelectTrigger, BrnFieldControlDescribedBy], encapsulation: 2 });
|
|
2888
|
+
}
|
|
2889
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectTrigger, [{
|
|
2890
|
+
type: Component,
|
|
2891
|
+
args: [{
|
|
2892
|
+
selector: 'hlm-select-trigger',
|
|
2893
|
+
imports: [NgIcon, BrnSelectTrigger, BrnFieldControlDescribedBy],
|
|
2894
|
+
providers: [provideIcons({ phosphorCaretUpDown })],
|
|
2895
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2896
|
+
template: `
|
|
2897
|
+
<button
|
|
2898
|
+
brnSelectTrigger
|
|
2899
|
+
brnFieldControlDescribedBy
|
|
2900
|
+
[forceInvalid]="forceInvalid()"
|
|
2901
|
+
[id]="buttonId()"
|
|
2902
|
+
[class]="_computedClass()"
|
|
2903
|
+
[attr.data-size]="size()"
|
|
2904
|
+
data-slot="select-trigger"
|
|
2905
|
+
>
|
|
2906
|
+
<ng-content />
|
|
2907
|
+
<ng-icon
|
|
2908
|
+
name="phosphorCaretUpDown"
|
|
2909
|
+
class="text-muted-foreground text-[calc(var(--spacing)*4)] ms-auto"
|
|
2910
|
+
/>
|
|
2911
|
+
</button>
|
|
2912
|
+
`,
|
|
2913
|
+
}]
|
|
2914
|
+
}], null, { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], buttonId: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonId", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }] }); })();
|
|
2915
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmSelectTrigger, { className: "HlmSelectTrigger", filePath: "lib/ui/select/src/lib/hlm-select-trigger.ts", lineNumber: 40 }); })();
|
|
2916
|
+
|
|
2917
|
+
class HlmSelectValue {
|
|
2918
|
+
_brnSelectValue = inject(BrnSelectValue);
|
|
2919
|
+
_hidden = this._brnSelectValue.hidden;
|
|
2920
|
+
constructor() {
|
|
2921
|
+
classes(() => 'data-hidden:hidden');
|
|
2922
|
+
}
|
|
2923
|
+
static ɵfac = function HlmSelectValue_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectValue)(); };
|
|
2924
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelectValue, selectors: [["", "hlmSelectValue", ""], ["hlm-select-value"]], hostVars: 1, hostBindings: function HlmSelectValue_HostBindings(rf, ctx) { if (rf & 2) {
|
|
2925
|
+
i0.ɵɵattribute("data-slot", !ctx._hidden() ? "select-value" : null);
|
|
2926
|
+
} }, features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$9.BrnSelectValue, inputs: ["placeholder", "placeholder"] }])] });
|
|
2927
|
+
}
|
|
2928
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectValue, [{
|
|
2929
|
+
type: Directive,
|
|
2930
|
+
args: [{
|
|
2931
|
+
selector: '[hlmSelectValue],hlm-select-value',
|
|
2932
|
+
hostDirectives: [{ directive: BrnSelectValue, inputs: ['placeholder'] }],
|
|
2933
|
+
host: { '[attr.data-slot]': '!_hidden() ? "select-value" : null' },
|
|
2934
|
+
}]
|
|
2935
|
+
}], () => [], null); })();
|
|
2936
|
+
|
|
2937
|
+
class HlmSelectValueTemplate {
|
|
2938
|
+
static ɵfac = function HlmSelectValueTemplate_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectValueTemplate)(); };
|
|
2939
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelectValueTemplate, selectors: [["", "hlmSelectValueTemplate", ""]], features: [i0.ɵɵHostDirectivesFeature([i1$9.BrnSelectValueTemplate])] });
|
|
2940
|
+
}
|
|
2941
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectValueTemplate, [{
|
|
2942
|
+
type: Directive,
|
|
2943
|
+
args: [{ selector: '[hlmSelectValueTemplate]', hostDirectives: [BrnSelectValueTemplate] }]
|
|
2944
|
+
}], null, null); })();
|
|
2945
|
+
|
|
2946
|
+
class HlmSelectValues {
|
|
2947
|
+
static ɵfac = function HlmSelectValues_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectValues)(); };
|
|
2948
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelectValues, selectors: [["", "hlmSelectValues", ""]], features: [i0.ɵɵHostDirectivesFeature([i1$9.BrnSelectValues])] });
|
|
2949
|
+
}
|
|
2950
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectValues, [{
|
|
2951
|
+
type: Directive,
|
|
2952
|
+
args: [{ selector: '[hlmSelectValues]', hostDirectives: [BrnSelectValues] }]
|
|
2953
|
+
}], null, null); })();
|
|
2954
|
+
|
|
2955
|
+
class HlmSelectValuesContent {
|
|
2956
|
+
constructor() {
|
|
2957
|
+
classes(() => 'gap-2 flex');
|
|
2958
|
+
}
|
|
2959
|
+
static ɵfac = function HlmSelectValuesContent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSelectValuesContent)(); };
|
|
2960
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSelectValuesContent, selectors: [["", "hlmSelectValuesContent", ""], ["hlm-select-values-content"]] });
|
|
2961
|
+
}
|
|
2962
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSelectValuesContent, [{
|
|
2963
|
+
type: Directive,
|
|
2964
|
+
args: [{ selector: '[hlmSelectValuesContent],hlm-select-values-content' }]
|
|
2965
|
+
}], () => [], null); })();
|
|
2966
|
+
|
|
2967
|
+
const HlmSelectImports = [
|
|
2968
|
+
HlmSelect,
|
|
2969
|
+
HlmSelectContent,
|
|
2970
|
+
HlmSelectGroup,
|
|
2971
|
+
HlmSelectItem,
|
|
2972
|
+
HlmSelectLabel,
|
|
2973
|
+
HlmSelectMultiple,
|
|
2974
|
+
HlmSelectPlaceholder,
|
|
2975
|
+
HlmSelectPortal,
|
|
2976
|
+
HlmSelectScrollDown,
|
|
2977
|
+
HlmSelectScrollUp,
|
|
2978
|
+
HlmSelectSeparator,
|
|
2979
|
+
HlmSelectTrigger,
|
|
2980
|
+
HlmSelectValue,
|
|
2981
|
+
HlmSelectValues,
|
|
2982
|
+
HlmSelectValuesContent,
|
|
2983
|
+
HlmSelectValueTemplate,
|
|
2984
|
+
];
|
|
2985
|
+
|
|
2986
|
+
const defaultConfig = {
|
|
2987
|
+
sidebarWidth: '16rem',
|
|
2988
|
+
sidebarWidthMobile: '18rem',
|
|
2989
|
+
sidebarWidthIcon: '3rem',
|
|
2990
|
+
sidebarCookieName: 'sidebar_state',
|
|
2991
|
+
sidebarCookieMaxAge: 60 * 60 * 24 * 7, // 7 days in seconds
|
|
2992
|
+
sidebarKeyboardShortcut: 'b',
|
|
2993
|
+
mobileBreakpoint: '768px',
|
|
2994
|
+
closeMobileSidebarOnMenuButtonClick: false,
|
|
2995
|
+
};
|
|
2996
|
+
const HlmSidebarConfigToken = new InjectionToken('HlmSidebarConfig');
|
|
2997
|
+
function provideHlmSidebarConfig(config) {
|
|
2998
|
+
return { provide: HlmSidebarConfigToken, useValue: { ...defaultConfig, ...config } };
|
|
2999
|
+
}
|
|
3000
|
+
function injectHlmSidebarConfig() {
|
|
3001
|
+
return inject(HlmSidebarConfigToken, { optional: true }) ?? defaultConfig;
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
class HlmSidebarService {
|
|
3005
|
+
_platformId = inject(PLATFORM_ID);
|
|
3006
|
+
_request = inject(REQUEST, { optional: true });
|
|
3007
|
+
_config = injectHlmSidebarConfig();
|
|
3008
|
+
_document = inject(DOCUMENT);
|
|
3009
|
+
_window = this._document.defaultView;
|
|
3010
|
+
_open = signal(true, /* @ts-ignore */
|
|
3011
|
+
...(ngDevMode ? [{ debugName: "_open" }] : /* istanbul ignore next */ []));
|
|
3012
|
+
_openMobile = signal(false, /* @ts-ignore */
|
|
3013
|
+
...(ngDevMode ? [{ debugName: "_openMobile" }] : /* istanbul ignore next */ []));
|
|
3014
|
+
_isMobile = signal(false, /* @ts-ignore */
|
|
3015
|
+
...(ngDevMode ? [{ debugName: "_isMobile" }] : /* istanbul ignore next */ []));
|
|
3016
|
+
_variant = signal('sidebar', /* @ts-ignore */
|
|
3017
|
+
...(ngDevMode ? [{ debugName: "_variant" }] : /* istanbul ignore next */ []));
|
|
3018
|
+
_mediaQuery = null;
|
|
3019
|
+
open = this._open.asReadonly();
|
|
3020
|
+
openMobile = this._openMobile.asReadonly();
|
|
3021
|
+
isMobile = this._isMobile.asReadonly();
|
|
3022
|
+
variant = this._variant.asReadonly();
|
|
3023
|
+
state = computed(() => this._open() ? 'expanded' : 'collapsed', /* @ts-ignore */
|
|
3024
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
3025
|
+
constructor() {
|
|
3026
|
+
const destroyRef = inject(DestroyRef);
|
|
3027
|
+
this.restoreStateFromCookie();
|
|
3028
|
+
afterNextRender(() => {
|
|
3029
|
+
if (!this._window)
|
|
3030
|
+
return;
|
|
3031
|
+
// Initialize MediaQueryList
|
|
3032
|
+
this._mediaQuery = this._window.matchMedia(`(max-width: ${this._config.mobileBreakpoint})`);
|
|
3033
|
+
this._isMobile.set(this._mediaQuery.matches);
|
|
3034
|
+
// Add media query listener
|
|
3035
|
+
const mediaQueryHandler = (e) => {
|
|
3036
|
+
this._isMobile.set(e.matches);
|
|
3037
|
+
// If switching from mobile to desktop, close mobile sidebar
|
|
3038
|
+
if (!e.matches)
|
|
3039
|
+
this._openMobile.set(false);
|
|
3040
|
+
};
|
|
3041
|
+
this._mediaQuery.addEventListener('change', mediaQueryHandler);
|
|
3042
|
+
// Add keyboard shortcut listener
|
|
3043
|
+
const keydownHandler = (event) => {
|
|
3044
|
+
if (event.key === this._config.sidebarKeyboardShortcut &&
|
|
3045
|
+
(event.ctrlKey || event.metaKey)) {
|
|
3046
|
+
event.preventDefault();
|
|
3047
|
+
this.toggleSidebar();
|
|
3048
|
+
}
|
|
3049
|
+
};
|
|
3050
|
+
this._window.addEventListener('keydown', keydownHandler);
|
|
3051
|
+
// Add resize listener with debounce
|
|
3052
|
+
let resizeTimeout;
|
|
3053
|
+
const resizeHandler = () => {
|
|
3054
|
+
if (!this._window)
|
|
3055
|
+
return;
|
|
3056
|
+
if (resizeTimeout)
|
|
3057
|
+
this._window.clearTimeout(resizeTimeout);
|
|
3058
|
+
resizeTimeout = this._window.setTimeout(() => {
|
|
3059
|
+
if (this._mediaQuery)
|
|
3060
|
+
this._isMobile.set(this._mediaQuery.matches);
|
|
3061
|
+
}, 100);
|
|
3062
|
+
};
|
|
3063
|
+
this._window.addEventListener('resize', resizeHandler);
|
|
3064
|
+
// Cleanup listeners on destroy
|
|
3065
|
+
destroyRef.onDestroy(() => {
|
|
3066
|
+
if (!this._window)
|
|
3067
|
+
return;
|
|
3068
|
+
if (this._mediaQuery)
|
|
3069
|
+
this._mediaQuery.removeEventListener('change', mediaQueryHandler);
|
|
3070
|
+
this._window.removeEventListener('keydown', keydownHandler);
|
|
3071
|
+
this._window.removeEventListener('resize', resizeHandler);
|
|
3072
|
+
if (resizeTimeout)
|
|
3073
|
+
this._window.clearTimeout(resizeTimeout);
|
|
3074
|
+
});
|
|
3075
|
+
});
|
|
3076
|
+
}
|
|
3077
|
+
setOpen(open) {
|
|
3078
|
+
this._open.set(open);
|
|
3079
|
+
this._document.cookie = `${this._config.sidebarCookieName}=${open}; path=/; max-age=${this._config.sidebarCookieMaxAge}`;
|
|
3080
|
+
}
|
|
3081
|
+
setOpenMobile(open) {
|
|
3082
|
+
if (this._isMobile()) {
|
|
3083
|
+
this._openMobile.set(open);
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
setVariant(variant) {
|
|
3087
|
+
this._variant.set(variant);
|
|
3088
|
+
}
|
|
3089
|
+
toggleSidebar() {
|
|
3090
|
+
if (this._isMobile()) {
|
|
3091
|
+
this._openMobile.update((value) => !value);
|
|
3092
|
+
}
|
|
3093
|
+
else {
|
|
3094
|
+
this.setOpen(!this._open());
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
restoreStateFromCookie() {
|
|
3098
|
+
const cookieString = isPlatformServer(this._platformId)
|
|
3099
|
+
? this._request?.headers.get('cookie')
|
|
3100
|
+
: this._document.cookie;
|
|
3101
|
+
if (!cookieString)
|
|
3102
|
+
return;
|
|
3103
|
+
const prefix = `${this._config.sidebarCookieName}=`;
|
|
3104
|
+
const cookieValue = cookieString
|
|
3105
|
+
.split(';')
|
|
3106
|
+
.map((c) => c.trim())
|
|
3107
|
+
.find((c) => c.startsWith(prefix))
|
|
3108
|
+
?.slice(prefix.length);
|
|
3109
|
+
if (cookieValue !== undefined) {
|
|
3110
|
+
this._open.set(cookieValue === 'true');
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
static ɵfac = function HlmSidebarService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarService)(); };
|
|
3114
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: HlmSidebarService, factory: HlmSidebarService.ɵfac, providedIn: 'root' });
|
|
3115
|
+
}
|
|
3116
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarService, [{
|
|
3117
|
+
type: Injectable,
|
|
3118
|
+
args: [{ providedIn: 'root' }]
|
|
3119
|
+
}], () => [], null); })();
|
|
3120
|
+
|
|
3121
|
+
class HlmSheetOverlay {
|
|
3122
|
+
_classSettable = injectCustomClassSettable({ optional: true, host: true });
|
|
3123
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
3124
|
+
_computedClass = computed(() => hlm('bg-black/10 supports-backdrop-filter:backdrop-blur-xs transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0', this.userClass()), /* @ts-ignore */
|
|
3125
|
+
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
3126
|
+
constructor() {
|
|
3127
|
+
effect(() => {
|
|
3128
|
+
const classValue = this._computedClass();
|
|
3129
|
+
untracked(() => this._classSettable?.setClassToCustomElement(classValue));
|
|
3130
|
+
});
|
|
3131
|
+
}
|
|
3132
|
+
static ɵfac = function HlmSheetOverlay_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSheetOverlay)(); };
|
|
3133
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSheetOverlay, selectors: [["", "hlmSheetOverlay", ""], ["hlm-sheet-overlay"]], inputs: { userClass: [1, "class", "userClass"] }, features: [i0.ɵɵHostDirectivesFeature([i1$a.BrnSheetOverlay])] });
|
|
3134
|
+
}
|
|
3135
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSheetOverlay, [{
|
|
3136
|
+
type: Directive,
|
|
3137
|
+
args: [{
|
|
3138
|
+
selector: '[hlmSheetOverlay],hlm-sheet-overlay',
|
|
3139
|
+
hostDirectives: [BrnSheetOverlay],
|
|
3140
|
+
}]
|
|
3141
|
+
}], () => [], { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] }); })();
|
|
3142
|
+
|
|
3143
|
+
const _c0$2 = ["*"];
|
|
3144
|
+
class HlmSheet extends BrnSheet {
|
|
3145
|
+
static ɵfac = /*@__PURE__*/ (() => { let ɵHlmSheet_BaseFactory; return function HlmSheet_Factory(__ngFactoryType__) { return (ɵHlmSheet_BaseFactory || (ɵHlmSheet_BaseFactory = i0.ɵɵgetInheritedFactory(HlmSheet)))(__ngFactoryType__ || HlmSheet); }; })();
|
|
3146
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmSheet, selectors: [["hlm-sheet"]], exportAs: ["hlmSheet"], features: [i0.ɵɵProvidersFeature([
|
|
3147
|
+
{
|
|
3148
|
+
provide: BrnDialog,
|
|
3149
|
+
useExisting: forwardRef(() => BrnSheet),
|
|
3150
|
+
},
|
|
3151
|
+
{
|
|
3152
|
+
provide: BrnSheet,
|
|
3153
|
+
useExisting: forwardRef(() => HlmSheet),
|
|
3154
|
+
},
|
|
3155
|
+
provideBrnDialogDefaultOptions({
|
|
3156
|
+
// add custom options here
|
|
3157
|
+
}),
|
|
3158
|
+
]), i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c0$2, decls: 2, vars: 0, template: function HlmSheet_Template(rf, ctx) { if (rf & 1) {
|
|
3159
|
+
i0.ɵɵprojectionDef();
|
|
3160
|
+
i0.ɵɵelement(0, "hlm-sheet-overlay");
|
|
3161
|
+
i0.ɵɵprojection(1);
|
|
3162
|
+
} }, dependencies: [HlmSheetOverlay], encapsulation: 2 });
|
|
3163
|
+
}
|
|
3164
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSheet, [{
|
|
3165
|
+
type: Component,
|
|
3166
|
+
args: [{
|
|
3167
|
+
selector: 'hlm-sheet',
|
|
3168
|
+
exportAs: 'hlmSheet',
|
|
3169
|
+
imports: [HlmSheetOverlay],
|
|
3170
|
+
providers: [
|
|
3171
|
+
{
|
|
3172
|
+
provide: BrnDialog,
|
|
3173
|
+
useExisting: forwardRef(() => BrnSheet),
|
|
3174
|
+
},
|
|
3175
|
+
{
|
|
3176
|
+
provide: BrnSheet,
|
|
3177
|
+
useExisting: forwardRef(() => HlmSheet),
|
|
3178
|
+
},
|
|
3179
|
+
provideBrnDialogDefaultOptions({
|
|
3180
|
+
// add custom options here
|
|
3181
|
+
}),
|
|
3182
|
+
],
|
|
3183
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3184
|
+
template: `
|
|
3185
|
+
<hlm-sheet-overlay />
|
|
3186
|
+
<ng-content />
|
|
3187
|
+
`,
|
|
3188
|
+
}]
|
|
3189
|
+
}], null, null); })();
|
|
3190
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmSheet, { className: "HlmSheet", filePath: "lib/ui/sheet/src/lib/hlm-sheet.ts", lineNumber: 29 }); })();
|
|
3191
|
+
|
|
3192
|
+
class HlmSheetClose {
|
|
3193
|
+
static ɵfac = function HlmSheetClose_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSheetClose)(); };
|
|
3194
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSheetClose, selectors: [["button", "hlmSheetClose", ""]], hostAttrs: ["data-slot", "sheet-close"], features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$a.BrnSheetClose, inputs: ["delay", "delay"] }])] });
|
|
3195
|
+
}
|
|
3196
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSheetClose, [{
|
|
3197
|
+
type: Directive,
|
|
3198
|
+
args: [{
|
|
3199
|
+
selector: 'button[hlmSheetClose]',
|
|
3200
|
+
hostDirectives: [{ directive: BrnSheetClose, inputs: ['delay'] }],
|
|
3201
|
+
host: { 'data-slot': 'sheet-close' },
|
|
3202
|
+
}]
|
|
3203
|
+
}], null, null); })();
|
|
3204
|
+
|
|
3205
|
+
const _c0$1 = ["*"];
|
|
3206
|
+
function HlmSheetContent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
3207
|
+
i0.ɵɵelementStart(0, "button", 0)(1, "span", 1);
|
|
3208
|
+
i0.ɵɵtext(2, "Close");
|
|
3209
|
+
i0.ɵɵelementEnd();
|
|
3210
|
+
i0.ɵɵelement(3, "ng-icon", 2);
|
|
3211
|
+
i0.ɵɵelementEnd();
|
|
3212
|
+
} }
|
|
3213
|
+
class HlmSheetContent {
|
|
3214
|
+
_stateProvider = injectExposesStateProvider({ host: true });
|
|
3215
|
+
_sideProvider = injectExposedSideProvider({ host: true });
|
|
3216
|
+
state = this._stateProvider.state ?? signal('closed');
|
|
3217
|
+
_renderer = inject(Renderer2);
|
|
3218
|
+
_element = inject(ElementRef);
|
|
3219
|
+
showCloseButton = input(true, { ...(ngDevMode ? { debugName: "showCloseButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3220
|
+
constructor() {
|
|
3221
|
+
classes(() => [
|
|
3222
|
+
'bg-popover text-popover-foreground fixed flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm',
|
|
3223
|
+
'data-open:animate-in data-closed:animate-out',
|
|
3224
|
+
'data-[side=top]:data-closed:slide-out-to-top data-[side=top]:data-open:slide-in-from-top',
|
|
3225
|
+
'data-[side=bottom]:data-closed:slide-out-to-bottom data-[side=bottom]:data-open:slide-in-from-bottom',
|
|
3226
|
+
'data-[side=left]:data-closed:slide-out-to-left data-[side=left]:data-open:slide-in-from-left',
|
|
3227
|
+
'data-[side=right]:data-closed:slide-out-to-right data-[side=right]:data-open:slide-in-from-right',
|
|
3228
|
+
]);
|
|
3229
|
+
effect(() => {
|
|
3230
|
+
this._renderer.setAttribute(this._element.nativeElement, 'data-state', this.state());
|
|
3231
|
+
});
|
|
3232
|
+
}
|
|
3233
|
+
static ɵfac = function HlmSheetContent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSheetContent)(); };
|
|
3234
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmSheetContent, selectors: [["hlm-sheet-content"]], hostAttrs: ["data-slot", "sheet-content"], hostVars: 2, hostBindings: function HlmSheetContent_HostBindings(rf, ctx) { if (rf & 2) {
|
|
3235
|
+
i0.ɵɵattribute("data-side", ctx._sideProvider.side())("data-state", ctx.state());
|
|
3236
|
+
} }, inputs: { showCloseButton: [1, "showCloseButton"] }, features: [i0.ɵɵProvidersFeature([provideIcons({ phosphorX })])], ngContentSelectors: _c0$1, decls: 2, vars: 1, consts: [["hlmBtn", "", "variant", "ghost", "size", "icon-sm", "hlmSheetClose", "", 1, "absolute", "end-4", "top-4"], [1, "sr-only"], ["hlm", "", "size", "sm", "name", "phosphorX"]], template: function HlmSheetContent_Template(rf, ctx) { if (rf & 1) {
|
|
3237
|
+
i0.ɵɵprojectionDef();
|
|
3238
|
+
i0.ɵɵprojection(0);
|
|
3239
|
+
i0.ɵɵconditionalCreate(1, HlmSheetContent_Conditional_1_Template, 4, 0, "button", 0);
|
|
3240
|
+
} if (rf & 2) {
|
|
3241
|
+
i0.ɵɵadvance();
|
|
3242
|
+
i0.ɵɵconditional(ctx.showCloseButton() ? 1 : -1);
|
|
3243
|
+
} }, dependencies: [HlmIcon, i2$1.NgIcon, HlmButton, HlmSheetClose], encapsulation: 2 });
|
|
3244
|
+
}
|
|
3245
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSheetContent, [{
|
|
3246
|
+
type: Component,
|
|
3247
|
+
args: [{
|
|
3248
|
+
selector: 'hlm-sheet-content',
|
|
3249
|
+
imports: [HlmIconImports, HlmButton, HlmSheetClose],
|
|
3250
|
+
providers: [provideIcons({ phosphorX })],
|
|
3251
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3252
|
+
host: {
|
|
3253
|
+
'data-slot': 'sheet-content',
|
|
3254
|
+
'[attr.data-side]': '_sideProvider.side()',
|
|
3255
|
+
'[attr.data-state]': 'state()',
|
|
3256
|
+
},
|
|
3257
|
+
template: `
|
|
3258
|
+
<ng-content />
|
|
3259
|
+
|
|
3260
|
+
@if (showCloseButton()) {
|
|
3261
|
+
<button hlmBtn variant="ghost" size="icon-sm" class="absolute end-4 top-4" hlmSheetClose>
|
|
3262
|
+
<span class="sr-only">Close</span>
|
|
3263
|
+
<ng-icon hlm size="sm" name="phosphorX" />
|
|
3264
|
+
</button>
|
|
3265
|
+
}
|
|
3266
|
+
`,
|
|
3267
|
+
}]
|
|
3268
|
+
}], () => [], { showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }] }); })();
|
|
3269
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmSheetContent, { className: "HlmSheetContent", filePath: "lib/ui/sheet/src/lib/hlm-sheet-content.ts", lineNumber: 42 }); })();
|
|
3270
|
+
|
|
3271
|
+
class HlmSheetDescription {
|
|
3272
|
+
constructor() {
|
|
3273
|
+
classes(() => 'text-muted-foreground text-sm');
|
|
3274
|
+
}
|
|
3275
|
+
static ɵfac = function HlmSheetDescription_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSheetDescription)(); };
|
|
3276
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSheetDescription, selectors: [["", "hlmSheetDescription", ""]], hostAttrs: ["data-slot", "sheet-description"], features: [i0.ɵɵHostDirectivesFeature([i1$a.BrnSheetDescription])] });
|
|
3277
|
+
}
|
|
3278
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSheetDescription, [{
|
|
3279
|
+
type: Directive,
|
|
3280
|
+
args: [{
|
|
3281
|
+
selector: '[hlmSheetDescription]',
|
|
3282
|
+
hostDirectives: [BrnSheetDescription],
|
|
3283
|
+
host: { 'data-slot': 'sheet-description' },
|
|
3284
|
+
}]
|
|
3285
|
+
}], () => [], null); })();
|
|
3286
|
+
|
|
3287
|
+
class HlmSheetFooter {
|
|
3288
|
+
constructor() {
|
|
3289
|
+
classes(() => 'gap-2 p-4 mt-auto flex flex-col');
|
|
3290
|
+
}
|
|
3291
|
+
static ɵfac = function HlmSheetFooter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSheetFooter)(); };
|
|
3292
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSheetFooter, selectors: [["", "hlmSheetFooter", ""], ["hlm-sheet-footer"]], hostAttrs: ["data-slot", "sheet-footer"] });
|
|
3293
|
+
}
|
|
3294
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSheetFooter, [{
|
|
3295
|
+
type: Directive,
|
|
3296
|
+
args: [{
|
|
3297
|
+
selector: '[hlmSheetFooter],hlm-sheet-footer',
|
|
3298
|
+
host: { 'data-slot': 'sheet-footer' },
|
|
3299
|
+
}]
|
|
3300
|
+
}], () => [], null); })();
|
|
3301
|
+
|
|
3302
|
+
class HlmSheetHeader {
|
|
3303
|
+
constructor() {
|
|
3304
|
+
classes(() => 'gap-1.5 p-4 flex flex-col');
|
|
3305
|
+
}
|
|
3306
|
+
static ɵfac = function HlmSheetHeader_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSheetHeader)(); };
|
|
3307
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSheetHeader, selectors: [["", "hlmSheetHeader", ""], ["hlm-sheet-header"]], hostAttrs: ["data-slot", "sheet-header"] });
|
|
3308
|
+
}
|
|
3309
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSheetHeader, [{
|
|
3310
|
+
type: Directive,
|
|
3311
|
+
args: [{
|
|
3312
|
+
selector: '[hlmSheetHeader],hlm-sheet-header',
|
|
3313
|
+
host: { 'data-slot': 'sheet-header' },
|
|
3314
|
+
}]
|
|
3315
|
+
}], () => [], null); })();
|
|
3316
|
+
|
|
3317
|
+
class HlmSheetPortal {
|
|
3318
|
+
static ɵfac = function HlmSheetPortal_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSheetPortal)(); };
|
|
3319
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSheetPortal, selectors: [["", "hlmSheetPortal", ""]], features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$a.BrnSheetContent, inputs: ["context", "context", "class", "class"] }])] });
|
|
3320
|
+
}
|
|
3321
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSheetPortal, [{
|
|
3322
|
+
type: Directive,
|
|
3323
|
+
args: [{
|
|
3324
|
+
selector: '[hlmSheetPortal]',
|
|
3325
|
+
hostDirectives: [{ directive: BrnSheetContent, inputs: ['context', 'class'] }],
|
|
3326
|
+
}]
|
|
3327
|
+
}], null, null); })();
|
|
3328
|
+
|
|
3329
|
+
class HlmSheetTitle {
|
|
3330
|
+
constructor() {
|
|
3331
|
+
classes(() => 'text-foreground font-medium');
|
|
3332
|
+
}
|
|
3333
|
+
static ɵfac = function HlmSheetTitle_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSheetTitle)(); };
|
|
3334
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSheetTitle, selectors: [["", "hlmSheetTitle", ""]], hostAttrs: ["data-slot", "sheet-title"], features: [i0.ɵɵHostDirectivesFeature([i1$a.BrnSheetTitle])] });
|
|
3335
|
+
}
|
|
3336
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSheetTitle, [{
|
|
3337
|
+
type: Directive,
|
|
3338
|
+
args: [{
|
|
3339
|
+
selector: '[hlmSheetTitle]',
|
|
3340
|
+
hostDirectives: [BrnSheetTitle],
|
|
3341
|
+
host: { 'data-slot': 'sheet-title' },
|
|
3342
|
+
}]
|
|
3343
|
+
}], () => [], null); })();
|
|
3344
|
+
|
|
3345
|
+
class HlmSheetTrigger {
|
|
3346
|
+
static ɵfac = function HlmSheetTrigger_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSheetTrigger)(); };
|
|
3347
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSheetTrigger, selectors: [["button", "hlmSheetTrigger", ""]], hostAttrs: ["data-slot", "sheet-trigger"], features: [i0.ɵɵHostDirectivesFeature([{ directive: i1$a.BrnSheetTrigger, inputs: ["id", "id", "side", "side", "type", "type"] }])] });
|
|
3348
|
+
}
|
|
3349
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSheetTrigger, [{
|
|
3350
|
+
type: Directive,
|
|
3351
|
+
args: [{
|
|
3352
|
+
selector: 'button[hlmSheetTrigger]',
|
|
3353
|
+
hostDirectives: [{ directive: BrnSheetTrigger, inputs: ['id', 'side', 'type'] }],
|
|
3354
|
+
host: { 'data-slot': 'sheet-trigger' },
|
|
3355
|
+
}]
|
|
3356
|
+
}], null, null); })();
|
|
3357
|
+
|
|
3358
|
+
const HlmSheetImports = [
|
|
3359
|
+
HlmSheet,
|
|
3360
|
+
HlmSheetClose,
|
|
3361
|
+
HlmSheetContent,
|
|
3362
|
+
HlmSheetDescription,
|
|
3363
|
+
HlmSheetFooter,
|
|
3364
|
+
HlmSheetHeader,
|
|
3365
|
+
HlmSheetOverlay,
|
|
3366
|
+
HlmSheetPortal,
|
|
3367
|
+
HlmSheetTitle,
|
|
3368
|
+
HlmSheetTrigger,
|
|
3369
|
+
];
|
|
3370
|
+
|
|
3371
|
+
const _c0 = ["*"];
|
|
3372
|
+
function HlmSidebar_ng_template_0_Template(rf, ctx) { if (rf & 1) {
|
|
3373
|
+
i0.ɵɵprojection(0);
|
|
3374
|
+
} }
|
|
3375
|
+
function HlmSidebar_Conditional_2_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
3376
|
+
i0.ɵɵelementContainer(0);
|
|
3377
|
+
} }
|
|
3378
|
+
function HlmSidebar_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
3379
|
+
i0.ɵɵtemplate(0, HlmSidebar_Conditional_2_ng_container_0_Template, 1, 0, "ng-container", 2);
|
|
3380
|
+
} if (rf & 2) {
|
|
3381
|
+
i0.ɵɵnextContext();
|
|
3382
|
+
const contentContainer_r1 = i0.ɵɵreference(1);
|
|
3383
|
+
i0.ɵɵproperty("ngTemplateOutlet", contentContainer_r1);
|
|
3384
|
+
} }
|
|
3385
|
+
function HlmSidebar_Conditional_3_hlm_sheet_content_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
|
|
3386
|
+
i0.ɵɵelementContainer(0);
|
|
3387
|
+
} }
|
|
3388
|
+
function HlmSidebar_Conditional_3_hlm_sheet_content_1_Template(rf, ctx) { if (rf & 1) {
|
|
3389
|
+
i0.ɵɵelementStart(0, "hlm-sheet-content", 5)(1, "div", 6);
|
|
3390
|
+
i0.ɵɵtemplate(2, HlmSidebar_Conditional_3_hlm_sheet_content_1_ng_container_2_Template, 1, 0, "ng-container", 2);
|
|
3391
|
+
i0.ɵɵelementEnd()();
|
|
3392
|
+
} if (rf & 2) {
|
|
3393
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
3394
|
+
const contentContainer_r1 = i0.ɵɵreference(1);
|
|
3395
|
+
i0.ɵɵstyleProp("--sidebar-width", ctx_r2.sidebarWidthMobile());
|
|
3396
|
+
i0.ɵɵadvance(2);
|
|
3397
|
+
i0.ɵɵproperty("ngTemplateOutlet", contentContainer_r1);
|
|
3398
|
+
} }
|
|
3399
|
+
function HlmSidebar_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
3400
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
3401
|
+
i0.ɵɵelementStart(0, "hlm-sheet", 3);
|
|
3402
|
+
i0.ɵɵlistener("stateChanged", function HlmSidebar_Conditional_3_Template_hlm_sheet_stateChanged_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2._sidebarService.setOpenMobile($event === "open")); });
|
|
3403
|
+
i0.ɵɵtemplate(1, HlmSidebar_Conditional_3_hlm_sheet_content_1_Template, 3, 3, "hlm-sheet-content", 4);
|
|
3404
|
+
i0.ɵɵelementEnd();
|
|
3405
|
+
} if (rf & 2) {
|
|
3406
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
3407
|
+
i0.ɵɵproperty("side", ctx_r2.side())("state", ctx_r2._sidebarService.openMobile() ? "open" : "closed");
|
|
3408
|
+
} }
|
|
3409
|
+
function HlmSidebar_Conditional_4_ng_container_3_Template(rf, ctx) { if (rf & 1) {
|
|
3410
|
+
i0.ɵɵelementContainer(0);
|
|
3411
|
+
} }
|
|
3412
|
+
function HlmSidebar_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
3413
|
+
i0.ɵɵelement(0, "div", 7);
|
|
3414
|
+
i0.ɵɵelementStart(1, "div", 8)(2, "div", 9);
|
|
3415
|
+
i0.ɵɵtemplate(3, HlmSidebar_Conditional_4_ng_container_3_Template, 1, 0, "ng-container", 2);
|
|
3416
|
+
i0.ɵɵelementEnd()();
|
|
3417
|
+
} if (rf & 2) {
|
|
3418
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
3419
|
+
const contentContainer_r1 = i0.ɵɵreference(1);
|
|
3420
|
+
i0.ɵɵclassMap(ctx_r2._sidebarGapComputedClass());
|
|
3421
|
+
i0.ɵɵadvance();
|
|
3422
|
+
i0.ɵɵclassMap(ctx_r2._sidebarContainerComputedClass());
|
|
3423
|
+
i0.ɵɵattribute("data-side", ctx_r2._dataSide());
|
|
3424
|
+
i0.ɵɵadvance(2);
|
|
3425
|
+
i0.ɵɵproperty("ngTemplateOutlet", contentContainer_r1);
|
|
3426
|
+
} }
|
|
3427
|
+
class HlmSidebar {
|
|
3428
|
+
_sidebarService = inject(HlmSidebarService);
|
|
3429
|
+
_config = injectHlmSidebarConfig();
|
|
3430
|
+
sidebarWidthMobile = input(this._config.sidebarWidthMobile, /* @ts-ignore */
|
|
3431
|
+
...(ngDevMode ? [{ debugName: "sidebarWidthMobile" }] : /* istanbul ignore next */ []));
|
|
3432
|
+
side = input('left', /* @ts-ignore */
|
|
3433
|
+
...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
3434
|
+
variant = input(this._sidebarService.variant(), /* @ts-ignore */
|
|
3435
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
3436
|
+
collapsible = input('offcanvas', /* @ts-ignore */
|
|
3437
|
+
...(ngDevMode ? [{ debugName: "collapsible" }] : /* istanbul ignore next */ []));
|
|
3438
|
+
_sidebarGapComputedClass = computed(() => hlm('transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent', 'group-data-[collapsible=offcanvas]:w-0', 'group-data-[side=right]:rotate-180', this.variant() === 'floating' || this.variant() === 'inset'
|
|
3439
|
+
? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'
|
|
3440
|
+
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)'), /* @ts-ignore */
|
|
3441
|
+
...(ngDevMode ? [{ debugName: "_sidebarGapComputedClass" }] : /* istanbul ignore next */ []));
|
|
3442
|
+
sidebarContainerClass = input('', /* @ts-ignore */
|
|
3443
|
+
...(ngDevMode ? [{ debugName: "sidebarContainerClass" }] : /* istanbul ignore next */ []));
|
|
3444
|
+
_sidebarContainerComputedClass = computed(() => hlm('fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex', this.variant() === 'floating' || this.variant() === 'inset'
|
|
3445
|
+
? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'
|
|
3446
|
+
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l', this.sidebarContainerClass()), /* @ts-ignore */
|
|
3447
|
+
...(ngDevMode ? [{ debugName: "_sidebarContainerComputedClass" }] : /* istanbul ignore next */ []));
|
|
3448
|
+
_dataSlot = computed(() => {
|
|
3449
|
+
return !this._sidebarService.isMobile() ? 'sidebar' : undefined;
|
|
3450
|
+
}, /* @ts-ignore */
|
|
3451
|
+
...(ngDevMode ? [{ debugName: "_dataSlot" }] : /* istanbul ignore next */ []));
|
|
3452
|
+
_collapsibleAndNonMobile = computed(() => {
|
|
3453
|
+
return this.collapsible() !== 'none' && !this._sidebarService.isMobile();
|
|
3454
|
+
}, /* @ts-ignore */
|
|
3455
|
+
...(ngDevMode ? [{ debugName: "_collapsibleAndNonMobile" }] : /* istanbul ignore next */ []));
|
|
3456
|
+
_dataState = computed(() => {
|
|
3457
|
+
return this._collapsibleAndNonMobile() ? this._sidebarService.state() : undefined;
|
|
3458
|
+
}, /* @ts-ignore */
|
|
3459
|
+
...(ngDevMode ? [{ debugName: "_dataState" }] : /* istanbul ignore next */ []));
|
|
3460
|
+
_dataCollapsible = computed(() => {
|
|
3461
|
+
if (this._collapsibleAndNonMobile()) {
|
|
3462
|
+
return this._sidebarService.state() === 'collapsed' ? this.collapsible() : '';
|
|
3463
|
+
}
|
|
3464
|
+
return undefined;
|
|
3465
|
+
}, /* @ts-ignore */
|
|
3466
|
+
...(ngDevMode ? [{ debugName: "_dataCollapsible" }] : /* istanbul ignore next */ []));
|
|
3467
|
+
_dataVariant = computed(() => {
|
|
3468
|
+
return this._collapsibleAndNonMobile() ? this.variant() : undefined;
|
|
3469
|
+
}, /* @ts-ignore */
|
|
3470
|
+
...(ngDevMode ? [{ debugName: "_dataVariant" }] : /* istanbul ignore next */ []));
|
|
3471
|
+
_dataSide = computed(() => {
|
|
3472
|
+
return this._collapsibleAndNonMobile() ? this.side() : undefined;
|
|
3473
|
+
}, /* @ts-ignore */
|
|
3474
|
+
...(ngDevMode ? [{ debugName: "_dataSide" }] : /* istanbul ignore next */ []));
|
|
3475
|
+
constructor() {
|
|
3476
|
+
// Sync variant input with service
|
|
3477
|
+
effect(() => {
|
|
3478
|
+
this._sidebarService.setVariant(this.variant());
|
|
3479
|
+
});
|
|
3480
|
+
classes(() => {
|
|
3481
|
+
if (this.collapsible() === 'none') {
|
|
3482
|
+
return hlm('bg-sidebar text-sidebar-foreground flex h-svh w-(--sidebar-width) flex-col');
|
|
3483
|
+
}
|
|
3484
|
+
else if (this._sidebarService.isMobile()) {
|
|
3485
|
+
return '';
|
|
3486
|
+
}
|
|
3487
|
+
else {
|
|
3488
|
+
return hlm('group peer text-sidebar-foreground hidden md:block');
|
|
3489
|
+
}
|
|
3490
|
+
});
|
|
3491
|
+
}
|
|
3492
|
+
static ɵfac = function HlmSidebar_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebar)(); };
|
|
3493
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmSidebar, selectors: [["hlm-sidebar"]], hostVars: 5, hostBindings: function HlmSidebar_HostBindings(rf, ctx) { if (rf & 2) {
|
|
3494
|
+
i0.ɵɵattribute("data-slot", ctx._dataSlot())("data-state", ctx._dataState())("data-collapsible", ctx._dataCollapsible())("data-variant", ctx._dataVariant())("data-side", ctx._dataSide());
|
|
3495
|
+
} }, inputs: { sidebarWidthMobile: [1, "sidebarWidthMobile"], side: [1, "side"], variant: [1, "variant"], collapsible: [1, "collapsible"], sidebarContainerClass: [1, "sidebarContainerClass"] }, ngContentSelectors: _c0, decls: 5, vars: 1, consts: [["contentContainer", ""], [3, "side", "state"], [4, "ngTemplateOutlet"], [3, "stateChanged", "side", "state"], ["data-slot", "sidebar", "data-sidebar", "sidebar", "data-mobile", "true", "class", "bg-sidebar text-sidebar-foreground h-svh w-(--sidebar-width) p-0 [&>button]:hidden", 3, "--sidebar-width", 4, "hlmSheetPortal"], ["data-slot", "sidebar", "data-sidebar", "sidebar", "data-mobile", "true", 1, "bg-sidebar", "text-sidebar-foreground", "h-svh", "w-(--sidebar-width)", "p-0", "[&>button]:hidden"], [1, "flex", "h-full", "w-full", "flex-col"], ["data-slot", "sidebar-gap"], ["data-slot", "sidebar-container"], ["data-sidebar", "sidebar", "data-slot", "sidebar-inner", 1, "bg-sidebar", "group-data-[variant=floating]:ring-sidebar-border", "group-data-[variant=floating]:rounded-lg", "group-data-[variant=floating]:shadow-sm", "group-data-[variant=floating]:ring-1", "flex", "size-full", "flex-col"]], template: function HlmSidebar_Template(rf, ctx) { if (rf & 1) {
|
|
3496
|
+
i0.ɵɵprojectionDef();
|
|
3497
|
+
i0.ɵɵtemplate(0, HlmSidebar_ng_template_0_Template, 1, 0, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
|
|
3498
|
+
i0.ɵɵconditionalCreate(2, HlmSidebar_Conditional_2_Template, 1, 1, "ng-container")(3, HlmSidebar_Conditional_3_Template, 2, 2, "hlm-sheet", 1)(4, HlmSidebar_Conditional_4_Template, 4, 6);
|
|
3499
|
+
} if (rf & 2) {
|
|
3500
|
+
i0.ɵɵadvance(2);
|
|
3501
|
+
i0.ɵɵconditional(ctx.collapsible() === "none" ? 2 : ctx._sidebarService.isMobile() ? 3 : 4);
|
|
3502
|
+
} }, dependencies: [NgTemplateOutlet, HlmSheet, HlmSheetContent, HlmSheetPortal], encapsulation: 2 });
|
|
3503
|
+
}
|
|
3504
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebar, [{
|
|
3505
|
+
type: Component,
|
|
3506
|
+
args: [{
|
|
3507
|
+
selector: 'hlm-sidebar',
|
|
3508
|
+
imports: [NgTemplateOutlet, HlmSheetImports],
|
|
3509
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3510
|
+
host: {
|
|
3511
|
+
'[attr.data-slot]': '_dataSlot()',
|
|
3512
|
+
'[attr.data-state]': '_dataState()',
|
|
3513
|
+
'[attr.data-collapsible]': '_dataCollapsible()',
|
|
3514
|
+
'[attr.data-variant]': '_dataVariant()',
|
|
3515
|
+
'[attr.data-side]': '_dataSide()',
|
|
3516
|
+
},
|
|
3517
|
+
template: `
|
|
3518
|
+
<ng-template #contentContainer>
|
|
3519
|
+
<ng-content />
|
|
3520
|
+
</ng-template>
|
|
3521
|
+
|
|
3522
|
+
@if (collapsible() === 'none') {
|
|
3523
|
+
<ng-container *ngTemplateOutlet="contentContainer"></ng-container>
|
|
3524
|
+
} @else if (_sidebarService.isMobile()) {
|
|
3525
|
+
<hlm-sheet
|
|
3526
|
+
[side]="side()"
|
|
3527
|
+
[state]="_sidebarService.openMobile() ? 'open' : 'closed'"
|
|
3528
|
+
(stateChanged)="_sidebarService.setOpenMobile($event === 'open')"
|
|
3529
|
+
>
|
|
3530
|
+
<hlm-sheet-content
|
|
3531
|
+
*hlmSheetPortal="let ctx"
|
|
3532
|
+
data-slot="sidebar"
|
|
3533
|
+
data-sidebar="sidebar"
|
|
3534
|
+
data-mobile="true"
|
|
3535
|
+
class="bg-sidebar text-sidebar-foreground h-svh w-(--sidebar-width) p-0 [&>button]:hidden"
|
|
3536
|
+
[style.--sidebar-width]="sidebarWidthMobile()"
|
|
3537
|
+
>
|
|
3538
|
+
<div class="flex h-full w-full flex-col">
|
|
3539
|
+
<ng-container *ngTemplateOutlet="contentContainer" />
|
|
3540
|
+
</div>
|
|
3541
|
+
</hlm-sheet-content>
|
|
3542
|
+
</hlm-sheet>
|
|
3543
|
+
} @else {
|
|
3544
|
+
<!-- Sidebar gap on desktop -->
|
|
3545
|
+
<div data-slot="sidebar-gap" [class]="_sidebarGapComputedClass()"></div>
|
|
3546
|
+
<div
|
|
3547
|
+
data-slot="sidebar-container"
|
|
3548
|
+
[attr.data-side]="_dataSide()"
|
|
3549
|
+
[class]="_sidebarContainerComputedClass()"
|
|
3550
|
+
>
|
|
3551
|
+
<div
|
|
3552
|
+
data-sidebar="sidebar"
|
|
3553
|
+
data-slot="sidebar-inner"
|
|
3554
|
+
class="bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col"
|
|
3555
|
+
>
|
|
3556
|
+
<ng-container *ngTemplateOutlet="contentContainer" />
|
|
3557
|
+
</div>
|
|
3558
|
+
</div>
|
|
3559
|
+
}
|
|
3560
|
+
`,
|
|
3561
|
+
}]
|
|
3562
|
+
}], () => [], { sidebarWidthMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarWidthMobile", required: false }] }], 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 }] }], sidebarContainerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarContainerClass", required: false }] }] }); })();
|
|
3563
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmSidebar, { className: "HlmSidebar", filePath: "lib/ui/sidebar/src/lib/hlm-sidebar.ts", lineNumber: 65 }); })();
|
|
3564
|
+
|
|
3565
|
+
class HlmSidebarContent {
|
|
3566
|
+
constructor() {
|
|
3567
|
+
classes(() => 'no-scrollbar gap-2 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden');
|
|
3568
|
+
}
|
|
3569
|
+
static ɵfac = function HlmSidebarContent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarContent)(); };
|
|
3570
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarContent, selectors: [["", "hlmSidebarContent", ""], ["hlm-sidebar-content"]], hostAttrs: ["data-slot", "sidebar-content", "data-sidebar", "content"] });
|
|
3571
|
+
}
|
|
3572
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarContent, [{
|
|
3573
|
+
type: Directive,
|
|
3574
|
+
args: [{
|
|
3575
|
+
selector: '[hlmSidebarContent],hlm-sidebar-content',
|
|
3576
|
+
host: {
|
|
3577
|
+
'data-slot': 'sidebar-content',
|
|
3578
|
+
'data-sidebar': 'content',
|
|
3579
|
+
},
|
|
3580
|
+
}]
|
|
3581
|
+
}], () => [], null); })();
|
|
3582
|
+
|
|
3583
|
+
class HlmSidebarFooter {
|
|
3584
|
+
constructor() {
|
|
3585
|
+
classes(() => 'gap-2 p-2 flex flex-col');
|
|
3586
|
+
}
|
|
3587
|
+
static ɵfac = function HlmSidebarFooter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarFooter)(); };
|
|
3588
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarFooter, selectors: [["", "hlmSidebarFooter", ""], ["hlm-sidebar-footer"]], hostAttrs: ["data-slot", "sidebar-footer", "data-sidebar", "footer"] });
|
|
3589
|
+
}
|
|
3590
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarFooter, [{
|
|
3591
|
+
type: Directive,
|
|
3592
|
+
args: [{
|
|
3593
|
+
selector: '[hlmSidebarFooter],hlm-sidebar-footer',
|
|
3594
|
+
host: {
|
|
3595
|
+
'data-slot': 'sidebar-footer',
|
|
3596
|
+
'data-sidebar': 'footer',
|
|
3597
|
+
},
|
|
3598
|
+
}]
|
|
3599
|
+
}], () => [], null); })();
|
|
3600
|
+
|
|
3601
|
+
class HlmSidebarGroup {
|
|
3602
|
+
constructor() {
|
|
3603
|
+
classes(() => 'p-2 relative flex w-full min-w-0 flex-col');
|
|
3604
|
+
}
|
|
3605
|
+
static ɵfac = function HlmSidebarGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarGroup)(); };
|
|
3606
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarGroup, selectors: [["", "hlmSidebarGroup", ""], ["hlm-sidebar-group"]], hostAttrs: ["data-slot", "sidebar-group", "data-sidebar", "group"] });
|
|
3607
|
+
}
|
|
3608
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarGroup, [{
|
|
3609
|
+
type: Directive,
|
|
3610
|
+
args: [{
|
|
3611
|
+
selector: '[hlmSidebarGroup],hlm-sidebar-group',
|
|
3612
|
+
host: {
|
|
3613
|
+
'data-slot': 'sidebar-group',
|
|
3614
|
+
'data-sidebar': 'group',
|
|
3615
|
+
},
|
|
3616
|
+
}]
|
|
3617
|
+
}], () => [], null); })();
|
|
3618
|
+
|
|
3619
|
+
class HlmSidebarGroupAction {
|
|
3620
|
+
constructor() {
|
|
3621
|
+
classes(() => 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute end-3 top-3.5 w-5 rounded-md p-0 focus-visible:ring-2 [&>ng-icon]:text-[calc(var(--spacing)*4)] flex aspect-square items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>ng-icon]:shrink-0');
|
|
3622
|
+
}
|
|
3623
|
+
static ɵfac = function HlmSidebarGroupAction_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarGroupAction)(); };
|
|
3624
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarGroupAction, selectors: [["button", "hlmSidebarGroupAction", ""]], hostAttrs: ["data-slot", "sidebar-group-action", "data-sidebar", "group-action"] });
|
|
3625
|
+
}
|
|
3626
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarGroupAction, [{
|
|
3627
|
+
type: Directive,
|
|
3628
|
+
args: [{
|
|
3629
|
+
selector: 'button[hlmSidebarGroupAction]',
|
|
3630
|
+
host: {
|
|
3631
|
+
'data-slot': 'sidebar-group-action',
|
|
3632
|
+
'data-sidebar': 'group-action',
|
|
3633
|
+
},
|
|
3634
|
+
}]
|
|
3635
|
+
}], () => [], null); })();
|
|
3636
|
+
|
|
3637
|
+
class HlmSidebarGroupContent {
|
|
3638
|
+
constructor() {
|
|
3639
|
+
classes(() => 'text-sm w-full');
|
|
3640
|
+
}
|
|
3641
|
+
static ɵfac = function HlmSidebarGroupContent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarGroupContent)(); };
|
|
3642
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarGroupContent, selectors: [["div", "hlmSidebarGroupContent", ""]], hostAttrs: ["data-slot", "sidebar-group-content", "data-sidebar", "group-content"] });
|
|
3643
|
+
}
|
|
3644
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarGroupContent, [{
|
|
3645
|
+
type: Directive,
|
|
3646
|
+
args: [{
|
|
3647
|
+
selector: 'div[hlmSidebarGroupContent]',
|
|
3648
|
+
host: {
|
|
3649
|
+
'data-slot': 'sidebar-group-content',
|
|
3650
|
+
'data-sidebar': 'group-content',
|
|
3651
|
+
},
|
|
3652
|
+
}]
|
|
3653
|
+
}], () => [], null); })();
|
|
3654
|
+
|
|
3655
|
+
class HlmSidebarGroupLabel {
|
|
3656
|
+
constructor() {
|
|
3657
|
+
classes(() => 'text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>ng-icon]:text-[calc(var(--spacing)*4)] flex shrink-0 items-center outline-hidden [&>ng-icon]:shrink-0');
|
|
3658
|
+
}
|
|
3659
|
+
static ɵfac = function HlmSidebarGroupLabel_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarGroupLabel)(); };
|
|
3660
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarGroupLabel, selectors: [["div", "hlmSidebarGroupLabel", ""], ["button", "hlmSidebarGroupLabel", ""]], hostAttrs: ["data-slot", "sidebar-group-label", "data-sidebar", "group-label"] });
|
|
3661
|
+
}
|
|
3662
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarGroupLabel, [{
|
|
3663
|
+
type: Directive,
|
|
3664
|
+
args: [{
|
|
3665
|
+
selector: 'div[hlmSidebarGroupLabel], button[hlmSidebarGroupLabel]',
|
|
3666
|
+
host: {
|
|
3667
|
+
'data-slot': 'sidebar-group-label',
|
|
3668
|
+
'data-sidebar': 'group-label',
|
|
3669
|
+
},
|
|
3670
|
+
}]
|
|
3671
|
+
}], () => [], null); })();
|
|
3672
|
+
|
|
3673
|
+
class HlmSidebarHeader {
|
|
3674
|
+
constructor() {
|
|
3675
|
+
classes(() => 'gap-2 p-2 flex flex-col');
|
|
3676
|
+
}
|
|
3677
|
+
static ɵfac = function HlmSidebarHeader_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarHeader)(); };
|
|
3678
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarHeader, selectors: [["", "hlmSidebarHeader", ""], ["hlm-sidebar-header"]], hostAttrs: ["data-slot", "sidebar-header", "data-sidebar", "header"] });
|
|
3679
|
+
}
|
|
3680
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarHeader, [{
|
|
3681
|
+
type: Directive,
|
|
3682
|
+
args: [{
|
|
3683
|
+
selector: '[hlmSidebarHeader],hlm-sidebar-header',
|
|
3684
|
+
host: {
|
|
3685
|
+
'data-slot': 'sidebar-header',
|
|
3686
|
+
'data-sidebar': 'header',
|
|
3687
|
+
},
|
|
3688
|
+
}]
|
|
3689
|
+
}], () => [], null); })();
|
|
3690
|
+
|
|
3691
|
+
class HlmSidebarInput {
|
|
3692
|
+
constructor() {
|
|
3693
|
+
classes(() => 'bg-background h-8 w-full shadow-none');
|
|
3694
|
+
}
|
|
3695
|
+
static ɵfac = function HlmSidebarInput_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarInput)(); };
|
|
3696
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarInput, selectors: [["input", "hlmSidebarInput", ""]], hostAttrs: ["data-slot", "sidebar-input", "data-sidebar", "input"], features: [i0.ɵɵHostDirectivesFeature([HlmInput])] });
|
|
3697
|
+
}
|
|
3698
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarInput, [{
|
|
3699
|
+
type: Directive,
|
|
3700
|
+
args: [{
|
|
3701
|
+
selector: 'input[hlmSidebarInput]',
|
|
3702
|
+
hostDirectives: [HlmInput],
|
|
3703
|
+
host: {
|
|
3704
|
+
'data-slot': 'sidebar-input',
|
|
3705
|
+
'data-sidebar': 'input',
|
|
3706
|
+
},
|
|
3707
|
+
}]
|
|
3708
|
+
}], () => [], null); })();
|
|
3709
|
+
|
|
3710
|
+
class HlmSidebarInset {
|
|
3711
|
+
constructor() {
|
|
3712
|
+
classes(() => 'bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2 relative flex w-full flex-1 flex-col');
|
|
3713
|
+
}
|
|
3714
|
+
static ɵfac = function HlmSidebarInset_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarInset)(); };
|
|
3715
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarInset, selectors: [["main", "hlmSidebarInset", ""]], hostAttrs: ["data-slot", "sidebar-inset"] });
|
|
3716
|
+
}
|
|
3717
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarInset, [{
|
|
3718
|
+
type: Directive,
|
|
3719
|
+
args: [{
|
|
3720
|
+
selector: 'main[hlmSidebarInset]',
|
|
3721
|
+
host: { 'data-slot': 'sidebar-inset' },
|
|
3722
|
+
}]
|
|
3723
|
+
}], () => [], null); })();
|
|
3724
|
+
|
|
3725
|
+
class HlmSidebarMenu {
|
|
3726
|
+
constructor() {
|
|
3727
|
+
classes(() => 'gap-1 flex w-full min-w-0 flex-col');
|
|
3728
|
+
}
|
|
3729
|
+
static ɵfac = function HlmSidebarMenu_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarMenu)(); };
|
|
3730
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarMenu, selectors: [["ul", "hlmSidebarMenu", ""]], hostAttrs: ["data-slot", "sidebar-menu", "data-sidebar", "menu"] });
|
|
3731
|
+
}
|
|
3732
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarMenu, [{
|
|
3733
|
+
type: Directive,
|
|
3734
|
+
args: [{
|
|
3735
|
+
selector: 'ul[hlmSidebarMenu]',
|
|
3736
|
+
host: {
|
|
3737
|
+
'data-slot': 'sidebar-menu',
|
|
3738
|
+
'data-sidebar': 'menu',
|
|
3739
|
+
},
|
|
3740
|
+
}]
|
|
3741
|
+
}], () => [], null); })();
|
|
3742
|
+
|
|
3743
|
+
class HlmSidebarMenuAction {
|
|
3744
|
+
showOnHover = input(false, { ...(ngDevMode ? { debugName: "showOnHover" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3745
|
+
constructor() {
|
|
3746
|
+
classes(() => [
|
|
3747
|
+
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute end-1 top-1.5 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>ng-icon]:text-[calc(var(--spacing)*4)] flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>ng-icon]:shrink-0',
|
|
3748
|
+
this.showOnHover() &&
|
|
3749
|
+
'peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0',
|
|
3750
|
+
]);
|
|
3751
|
+
}
|
|
3752
|
+
static ɵfac = function HlmSidebarMenuAction_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarMenuAction)(); };
|
|
3753
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarMenuAction, selectors: [["button", "hlmSidebarMenuAction", ""]], hostAttrs: ["data-slot", "sidebar-menu-action", "data-sidebar", "menu-action"], inputs: { showOnHover: [1, "showOnHover"] } });
|
|
3754
|
+
}
|
|
3755
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarMenuAction, [{
|
|
3756
|
+
type: Directive,
|
|
3757
|
+
args: [{
|
|
3758
|
+
selector: 'button[hlmSidebarMenuAction]',
|
|
3759
|
+
host: {
|
|
3760
|
+
'data-slot': 'sidebar-menu-action',
|
|
3761
|
+
'data-sidebar': 'menu-action',
|
|
3762
|
+
},
|
|
3763
|
+
}]
|
|
3764
|
+
}], () => [], { showOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOnHover", required: false }] }] }); })();
|
|
3765
|
+
|
|
3766
|
+
class HlmSidebarMenuBadge {
|
|
3767
|
+
constructor() {
|
|
3768
|
+
classes(() => 'text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute end-1 h-5 min-w-5 rounded-md px-1 text-xs font-medium peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 flex items-center justify-center tabular-nums select-none group-data-[collapsible=icon]:hidden');
|
|
3769
|
+
}
|
|
3770
|
+
static ɵfac = function HlmSidebarMenuBadge_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarMenuBadge)(); };
|
|
3771
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarMenuBadge, selectors: [["", "hlmSidebarMenuBadge", ""], ["hlm-sidebar-menu-badge"]], hostAttrs: ["data-slot", "sidebar-menu-badge", "data-sidebar", "menu-badge"] });
|
|
3772
|
+
}
|
|
3773
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarMenuBadge, [{
|
|
3774
|
+
type: Directive,
|
|
3775
|
+
args: [{
|
|
3776
|
+
selector: '[hlmSidebarMenuBadge],hlm-sidebar-menu-badge',
|
|
3777
|
+
host: {
|
|
3778
|
+
'data-slot': 'sidebar-menu-badge',
|
|
3779
|
+
'data-sidebar': 'menu-badge',
|
|
3780
|
+
},
|
|
3781
|
+
}]
|
|
3782
|
+
}], () => [], null); })();
|
|
3783
|
+
|
|
3784
|
+
const DEFAULT_TOOLTIP_SVG_CLASS = 'bg-foreground fill-foreground z-50 block size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]';
|
|
3785
|
+
const DEFAULT_TOOLTIP_CONTENT_CLASSES = hlm('data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) text-balance');
|
|
3786
|
+
const tooltipPositionVariants = cva('absolute', {
|
|
3787
|
+
variants: {
|
|
3788
|
+
position: {
|
|
3789
|
+
top: 'bottom-0 left-[calc(50%-5px)] translate-y-full',
|
|
3790
|
+
bottom: '-top-2.5 left-[calc(50%-5px)] translate-y-0 rotate-180',
|
|
3791
|
+
left: '-end-2.5 top-[calc(50%-5px)] translate-y-0 rotate-270 rtl:-rotate-270',
|
|
3792
|
+
right: '-start-2.5 top-[calc(50%-5px)] translate-y-0 rotate-90 rtl:-rotate-90',
|
|
3793
|
+
},
|
|
3794
|
+
},
|
|
3795
|
+
});
|
|
3796
|
+
class HlmTooltip {
|
|
3797
|
+
static ɵfac = function HlmTooltip_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmTooltip)(); };
|
|
3798
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmTooltip, selectors: [["", "hlmTooltip", ""]], features: [i0.ɵɵProvidersFeature([
|
|
3799
|
+
provideBrnTooltipDefaultOptions({
|
|
3800
|
+
svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
|
|
3801
|
+
tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
|
|
3802
|
+
arrowClasses: (position) => hlm(tooltipPositionVariants({ position })),
|
|
3803
|
+
}),
|
|
3804
|
+
]), i0.ɵɵHostDirectivesFeature([{ directive: i1$b.BrnTooltip, inputs: ["brnTooltip", "hlmTooltip", "position", "position", "hideDelay", "hideDelay", "showDelay", "showDelay", "tooltipDisabled", "tooltipDisabled"] }])] });
|
|
3805
|
+
}
|
|
3806
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmTooltip, [{
|
|
3807
|
+
type: Directive,
|
|
3808
|
+
args: [{
|
|
3809
|
+
selector: '[hlmTooltip]',
|
|
3810
|
+
providers: [
|
|
3811
|
+
provideBrnTooltipDefaultOptions({
|
|
3812
|
+
svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
|
|
3813
|
+
tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
|
|
3814
|
+
arrowClasses: (position) => hlm(tooltipPositionVariants({ position })),
|
|
3815
|
+
}),
|
|
3816
|
+
],
|
|
3817
|
+
hostDirectives: [
|
|
3818
|
+
{
|
|
3819
|
+
directive: BrnTooltip,
|
|
3820
|
+
inputs: ['brnTooltip: hlmTooltip', 'position', 'hideDelay', 'showDelay', 'tooltipDisabled'],
|
|
3821
|
+
},
|
|
3822
|
+
],
|
|
3823
|
+
}]
|
|
3824
|
+
}], null, null); })();
|
|
3825
|
+
|
|
3826
|
+
const HlmTooltipImports = [HlmTooltip];
|
|
3827
|
+
|
|
3828
|
+
const sidebarMenuButtonVariants = cva('ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-start text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button group/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_ng-icon]:shrink-0 [&_ng-icon]:text-[calc(var(--spacing)*4)] [&>span:last-child]:truncate', {
|
|
3829
|
+
variants: {
|
|
3830
|
+
variant: {
|
|
3831
|
+
default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
|
3832
|
+
outline: 'bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]',
|
|
3833
|
+
},
|
|
3834
|
+
size: {
|
|
3835
|
+
default: 'h-8 text-sm',
|
|
3836
|
+
sm: 'h-7 text-xs',
|
|
3837
|
+
lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!',
|
|
3838
|
+
},
|
|
3839
|
+
},
|
|
3840
|
+
defaultVariants: {
|
|
3841
|
+
variant: 'default',
|
|
3842
|
+
size: 'default',
|
|
3843
|
+
},
|
|
3844
|
+
});
|
|
3845
|
+
class HlmSidebarMenuButton {
|
|
3846
|
+
_config = injectHlmSidebarConfig();
|
|
3847
|
+
_sidebarService = inject(HlmSidebarService);
|
|
3848
|
+
_brnTooltip = inject(BrnTooltip);
|
|
3849
|
+
variant = input('default', /* @ts-ignore */
|
|
3850
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
3851
|
+
size = input('default', /* @ts-ignore */
|
|
3852
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3853
|
+
isActive = input(false, { ...(ngDevMode ? { debugName: "isActive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3854
|
+
closeMobileSidebarOnClick = input(this._config.closeMobileSidebarOnMenuButtonClick, { ...(ngDevMode ? { debugName: "closeMobileSidebarOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3855
|
+
_isTooltipHidden = computed(() => this._sidebarService.state() !== 'collapsed' || this._sidebarService.isMobile(), /* @ts-ignore */
|
|
3856
|
+
...(ngDevMode ? [{ debugName: "_isTooltipHidden" }] : /* istanbul ignore next */ []));
|
|
3857
|
+
constructor() {
|
|
3858
|
+
classes(() => sidebarMenuButtonVariants({ variant: this.variant(), size: this.size() }));
|
|
3859
|
+
effect(() => this._brnTooltip.mutableTooltipDisabled.set(this._isTooltipHidden()));
|
|
3860
|
+
}
|
|
3861
|
+
onClick() {
|
|
3862
|
+
if (this.closeMobileSidebarOnClick()) {
|
|
3863
|
+
this._sidebarService.setOpenMobile(false);
|
|
3864
|
+
}
|
|
3865
|
+
}
|
|
3866
|
+
static ɵfac = function HlmSidebarMenuButton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarMenuButton)(); };
|
|
3867
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarMenuButton, selectors: [["button", "hlmSidebarMenuButton", ""], ["a", "hlmSidebarMenuButton", ""]], hostAttrs: ["data-slot", "sidebar-menu-button", "data-sidebar", "menu-button"], hostVars: 2, hostBindings: function HlmSidebarMenuButton_HostBindings(rf, ctx) { if (rf & 1) {
|
|
3868
|
+
i0.ɵɵlistener("click", function HlmSidebarMenuButton_click_HostBindingHandler() { return ctx.onClick(); });
|
|
3869
|
+
} if (rf & 2) {
|
|
3870
|
+
i0.ɵɵattribute("data-size", ctx.size())("data-active", ctx.isActive());
|
|
3871
|
+
} }, inputs: { variant: [1, "variant"], size: [1, "size"], isActive: [1, "isActive"], closeMobileSidebarOnClick: [1, "closeMobileSidebarOnClick"] }, features: [i0.ɵɵProvidersFeature([
|
|
3872
|
+
provideBrnTooltipDefaultOptions({
|
|
3873
|
+
showDelay: 150,
|
|
3874
|
+
hideDelay: 0,
|
|
3875
|
+
tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
|
|
3876
|
+
svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
|
|
3877
|
+
arrowClasses: (position) => hlm(tooltipPositionVariants({ position })),
|
|
3878
|
+
position: 'right',
|
|
3879
|
+
}),
|
|
3880
|
+
]), i0.ɵɵHostDirectivesFeature([{ directive: i1$b.BrnTooltip, inputs: ["brnTooltip", "tooltip"] }])] });
|
|
3881
|
+
}
|
|
3882
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarMenuButton, [{
|
|
3883
|
+
type: Directive,
|
|
3884
|
+
args: [{
|
|
3885
|
+
selector: 'button[hlmSidebarMenuButton], a[hlmSidebarMenuButton]',
|
|
3886
|
+
providers: [
|
|
3887
|
+
provideBrnTooltipDefaultOptions({
|
|
3888
|
+
showDelay: 150,
|
|
3889
|
+
hideDelay: 0,
|
|
3890
|
+
tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
|
|
3891
|
+
svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
|
|
3892
|
+
arrowClasses: (position) => hlm(tooltipPositionVariants({ position })),
|
|
3893
|
+
position: 'right',
|
|
3894
|
+
}),
|
|
3895
|
+
],
|
|
3896
|
+
hostDirectives: [
|
|
3897
|
+
{
|
|
3898
|
+
directive: BrnTooltip,
|
|
3899
|
+
inputs: ['brnTooltip: tooltip'],
|
|
3900
|
+
},
|
|
3901
|
+
],
|
|
3902
|
+
host: {
|
|
3903
|
+
'data-slot': 'sidebar-menu-button',
|
|
3904
|
+
'data-sidebar': 'menu-button',
|
|
3905
|
+
'[attr.data-size]': 'size()',
|
|
3906
|
+
'[attr.data-active]': 'isActive()',
|
|
3907
|
+
'(click)': 'onClick()',
|
|
3908
|
+
},
|
|
3909
|
+
}]
|
|
3910
|
+
}], () => [], { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }], closeMobileSidebarOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeMobileSidebarOnClick", required: false }] }] }); })();
|
|
3911
|
+
|
|
3912
|
+
class HlmSidebarMenuItem {
|
|
3913
|
+
constructor() {
|
|
3914
|
+
classes(() => 'group/menu-item relative');
|
|
3915
|
+
}
|
|
3916
|
+
static ɵfac = function HlmSidebarMenuItem_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarMenuItem)(); };
|
|
3917
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarMenuItem, selectors: [["li", "hlmSidebarMenuItem", ""]], hostAttrs: ["data-slot", "sidebar-menu-item", "data-sidebar", "menu-item"] });
|
|
3918
|
+
}
|
|
3919
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarMenuItem, [{
|
|
3920
|
+
type: Directive,
|
|
3921
|
+
args: [{
|
|
3922
|
+
selector: 'li[hlmSidebarMenuItem]',
|
|
3923
|
+
host: {
|
|
3924
|
+
'data-slot': 'sidebar-menu-item',
|
|
3925
|
+
'data-sidebar': 'menu-item',
|
|
3926
|
+
},
|
|
3927
|
+
}]
|
|
3928
|
+
}], () => [], null); })();
|
|
3929
|
+
|
|
3930
|
+
class HlmSkeleton {
|
|
3931
|
+
constructor() {
|
|
3932
|
+
classes(() => 'bg-muted rounded-md block motion-safe:animate-pulse');
|
|
3933
|
+
}
|
|
3934
|
+
static ɵfac = function HlmSkeleton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSkeleton)(); };
|
|
3935
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSkeleton, selectors: [["", "hlmSkeleton", ""], ["hlm-skeleton"]], hostAttrs: ["data-slot", "skeleton"] });
|
|
3936
|
+
}
|
|
3937
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSkeleton, [{
|
|
3938
|
+
type: Directive,
|
|
3939
|
+
args: [{
|
|
3940
|
+
selector: '[hlmSkeleton],hlm-skeleton',
|
|
3941
|
+
host: {
|
|
3942
|
+
'data-slot': 'skeleton',
|
|
3943
|
+
},
|
|
3944
|
+
}]
|
|
3945
|
+
}], () => [], null); })();
|
|
3946
|
+
|
|
3947
|
+
const HlmSkeletonImports = [HlmSkeleton];
|
|
3948
|
+
|
|
3949
|
+
function HlmSidebarMenuSkeleton_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
3950
|
+
i0.ɵɵelement(0, "hlm-skeleton", 0);
|
|
3951
|
+
} }
|
|
3952
|
+
function HlmSidebarMenuSkeleton_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
3953
|
+
i0.ɵɵelement(0, "hlm-skeleton", 2);
|
|
3954
|
+
} if (rf & 2) {
|
|
3955
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
3956
|
+
i0.ɵɵstyleProp("--skeleton-width", ctx_r0._width);
|
|
3957
|
+
} }
|
|
3958
|
+
class HlmSidebarMenuSkeleton {
|
|
3959
|
+
showIcon = input(false, { ...(ngDevMode ? { debugName: "showIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3960
|
+
_width = `${Math.floor(Math.random() * 40) + 50}%`;
|
|
3961
|
+
constructor() {
|
|
3962
|
+
classes(() => 'h-8 gap-2 rounded-md px-2 flex items-center');
|
|
3963
|
+
}
|
|
3964
|
+
static ɵfac = function HlmSidebarMenuSkeleton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarMenuSkeleton)(); };
|
|
3965
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmSidebarMenuSkeleton, selectors: [["hlm-sidebar-menu-skeleton"], ["div", "hlmSidebarMenuSkeleton", ""]], hostAttrs: ["data-slot", "sidebar-menu-skeleton", "data-sidebar", "menu-skeleton"], inputs: { showIcon: [1, "showIcon"] }, decls: 2, vars: 1, consts: [["data-sidebar", "menu-skeleton-icon", 1, "size-4", "rounded-md"], ["data-sidebar", "menu-skeleton-text", 1, "h-4", "max-w-(--skeleton-width)", "flex-1", 3, "--skeleton-width"], ["data-sidebar", "menu-skeleton-text", 1, "h-4", "max-w-(--skeleton-width)", "flex-1"]], template: function HlmSidebarMenuSkeleton_Template(rf, ctx) { if (rf & 1) {
|
|
3966
|
+
i0.ɵɵconditionalCreate(0, HlmSidebarMenuSkeleton_Conditional_0_Template, 1, 0, "hlm-skeleton", 0)(1, HlmSidebarMenuSkeleton_Conditional_1_Template, 1, 2, "hlm-skeleton", 1);
|
|
3967
|
+
} if (rf & 2) {
|
|
3968
|
+
i0.ɵɵconditional(ctx.showIcon() ? 0 : 1);
|
|
3969
|
+
} }, dependencies: [HlmSkeleton], encapsulation: 2 });
|
|
3970
|
+
}
|
|
3971
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarMenuSkeleton, [{
|
|
3972
|
+
type: Component,
|
|
3973
|
+
args: [{
|
|
3974
|
+
selector: 'hlm-sidebar-menu-skeleton,div[hlmSidebarMenuSkeleton]',
|
|
3975
|
+
imports: [HlmSkeletonImports],
|
|
3976
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3977
|
+
host: {
|
|
3978
|
+
'data-slot': 'sidebar-menu-skeleton',
|
|
3979
|
+
'data-sidebar': 'menu-skeleton',
|
|
3980
|
+
},
|
|
3981
|
+
template: `
|
|
3982
|
+
@if (showIcon()) {
|
|
3983
|
+
<hlm-skeleton data-sidebar="menu-skeleton-icon" class="size-4 rounded-md" />
|
|
3984
|
+
} @else {
|
|
3985
|
+
<hlm-skeleton
|
|
3986
|
+
data-sidebar="menu-skeleton-text"
|
|
3987
|
+
class="h-4 max-w-(--skeleton-width) flex-1"
|
|
3988
|
+
[style.--skeleton-width]="_width"
|
|
3989
|
+
/>
|
|
3990
|
+
}
|
|
3991
|
+
`,
|
|
3992
|
+
}]
|
|
3993
|
+
}], () => [], { showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }] }); })();
|
|
3994
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmSidebarMenuSkeleton, { className: "HlmSidebarMenuSkeleton", filePath: "lib/ui/sidebar/src/lib/hlm-sidebar-menu-skeleton.ts", lineNumber: 26 }); })();
|
|
3995
|
+
|
|
3996
|
+
class HlmSidebarMenuSub {
|
|
3997
|
+
constructor() {
|
|
3998
|
+
classes(() => 'border-sidebar-border mx-3.5 translate-x-px gap-1 border-s px-2.5 py-0.5 group-data-[collapsible=icon]:hidden rtl:-translate-x-px flex min-w-0 flex-col');
|
|
3999
|
+
}
|
|
4000
|
+
static ɵfac = function HlmSidebarMenuSub_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarMenuSub)(); };
|
|
4001
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarMenuSub, selectors: [["ul", "hlmSidebarMenuSub", ""]], hostAttrs: ["data-slot", "sidebar-menu-sub", "data-sidebar", "menu-sub"] });
|
|
4002
|
+
}
|
|
4003
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarMenuSub, [{
|
|
4004
|
+
type: Directive,
|
|
4005
|
+
args: [{
|
|
4006
|
+
selector: 'ul[hlmSidebarMenuSub]',
|
|
4007
|
+
host: {
|
|
4008
|
+
'data-slot': 'sidebar-menu-sub',
|
|
4009
|
+
'data-sidebar': 'menu-sub',
|
|
4010
|
+
},
|
|
4011
|
+
}]
|
|
4012
|
+
}], () => [], null); })();
|
|
4013
|
+
|
|
4014
|
+
class HlmSidebarMenuSubButton {
|
|
4015
|
+
_sidebarService = inject(HlmSidebarService);
|
|
4016
|
+
_config = injectHlmSidebarConfig();
|
|
4017
|
+
closeMobileSidebarOnClick = input(this._config.closeMobileSidebarOnMenuButtonClick, { ...(ngDevMode ? { debugName: "closeMobileSidebarOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4018
|
+
size = input('md', /* @ts-ignore */
|
|
4019
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4020
|
+
isActive = input(false, { ...(ngDevMode ? { debugName: "isActive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4021
|
+
constructor() {
|
|
4022
|
+
classes(() => 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>ng-icon]:text-[calc(var(--spacing)*4)] flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>ng-icon]:shrink-0 [&>span:last-child]:truncate');
|
|
4023
|
+
}
|
|
4024
|
+
onClick() {
|
|
4025
|
+
if (this.closeMobileSidebarOnClick()) {
|
|
4026
|
+
this._sidebarService.setOpenMobile(false);
|
|
4027
|
+
}
|
|
4028
|
+
}
|
|
4029
|
+
static ɵfac = function HlmSidebarMenuSubButton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarMenuSubButton)(); };
|
|
4030
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarMenuSubButton, selectors: [["a", "hlmSidebarMenuSubButton", ""], ["button", "hlmSidebarMenuSubButton", ""]], hostAttrs: ["data-slot", "sidebar-menu-sub-button", "data-sidebar", "menu-sub-button"], hostVars: 2, hostBindings: function HlmSidebarMenuSubButton_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4031
|
+
i0.ɵɵlistener("click", function HlmSidebarMenuSubButton_click_HostBindingHandler() { return ctx.onClick(); });
|
|
4032
|
+
} if (rf & 2) {
|
|
4033
|
+
i0.ɵɵattribute("data-active", ctx.isActive())("data-size", ctx.size());
|
|
4034
|
+
} }, inputs: { closeMobileSidebarOnClick: [1, "closeMobileSidebarOnClick"], size: [1, "size"], isActive: [1, "isActive"] } });
|
|
4035
|
+
}
|
|
4036
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarMenuSubButton, [{
|
|
4037
|
+
type: Directive,
|
|
4038
|
+
args: [{
|
|
4039
|
+
selector: 'a[hlmSidebarMenuSubButton], button[hlmSidebarMenuSubButton]',
|
|
4040
|
+
host: {
|
|
4041
|
+
'data-slot': 'sidebar-menu-sub-button',
|
|
4042
|
+
'data-sidebar': 'menu-sub-button',
|
|
4043
|
+
'[attr.data-active]': 'isActive()',
|
|
4044
|
+
'[attr.data-size]': 'size()',
|
|
4045
|
+
'(click)': 'onClick()',
|
|
4046
|
+
},
|
|
4047
|
+
}]
|
|
4048
|
+
}], () => [], { closeMobileSidebarOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeMobileSidebarOnClick", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }] }); })();
|
|
4049
|
+
|
|
4050
|
+
class HlmSidebarMenuSubItem {
|
|
4051
|
+
constructor() {
|
|
4052
|
+
classes(() => 'group/menu-sub-item relative');
|
|
4053
|
+
}
|
|
4054
|
+
static ɵfac = function HlmSidebarMenuSubItem_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarMenuSubItem)(); };
|
|
4055
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarMenuSubItem, selectors: [["li", "hlmSidebarMenuSubItem", ""]], hostAttrs: ["data-slot", "sidebar-menu-sub-item", "data-sidebar", "menu-sub-item"] });
|
|
4056
|
+
}
|
|
4057
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarMenuSubItem, [{
|
|
4058
|
+
type: Directive,
|
|
4059
|
+
args: [{
|
|
4060
|
+
selector: 'li[hlmSidebarMenuSubItem]',
|
|
4061
|
+
host: {
|
|
4062
|
+
'data-slot': 'sidebar-menu-sub-item',
|
|
4063
|
+
'data-sidebar': 'menu-sub-item',
|
|
4064
|
+
},
|
|
4065
|
+
}]
|
|
4066
|
+
}], () => [], null); })();
|
|
4067
|
+
|
|
4068
|
+
class HlmSidebarRail {
|
|
4069
|
+
_sidebarService = inject(HlmSidebarService);
|
|
4070
|
+
ariaLabel = input('Toggle Sidebar', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
4071
|
+
constructor() {
|
|
4072
|
+
classes(() => [
|
|
4073
|
+
'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2',
|
|
4074
|
+
'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
|
|
4075
|
+
'[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
|
|
4076
|
+
'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',
|
|
4077
|
+
'[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
|
|
4078
|
+
'[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
|
|
4079
|
+
]);
|
|
4080
|
+
}
|
|
4081
|
+
onClick() {
|
|
4082
|
+
this._sidebarService.toggleSidebar();
|
|
4083
|
+
}
|
|
4084
|
+
static ɵfac = function HlmSidebarRail_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarRail)(); };
|
|
4085
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarRail, selectors: [["button", "hlmSidebarRail", ""]], hostAttrs: ["data-sidebar", "rail", "data-slot", "sidebar-rail", "tabindex", "-1"], hostVars: 1, hostBindings: function HlmSidebarRail_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4086
|
+
i0.ɵɵlistener("click", function HlmSidebarRail_click_HostBindingHandler() { return ctx.onClick(); });
|
|
4087
|
+
} if (rf & 2) {
|
|
4088
|
+
i0.ɵɵattribute("aria-label", ctx.ariaLabel());
|
|
4089
|
+
} }, inputs: { ariaLabel: [1, "aria-label", "ariaLabel"] } });
|
|
4090
|
+
}
|
|
4091
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarRail, [{
|
|
4092
|
+
type: Directive,
|
|
4093
|
+
args: [{
|
|
4094
|
+
selector: 'button[hlmSidebarRail]',
|
|
4095
|
+
host: {
|
|
4096
|
+
'data-sidebar': 'rail',
|
|
4097
|
+
'data-slot': 'sidebar-rail',
|
|
4098
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
4099
|
+
tabindex: '-1',
|
|
4100
|
+
'(click)': 'onClick()',
|
|
4101
|
+
},
|
|
4102
|
+
}]
|
|
4103
|
+
}], () => [], { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] }); })();
|
|
4104
|
+
|
|
4105
|
+
class HlmSidebarSeparator {
|
|
4106
|
+
constructor() {
|
|
4107
|
+
classes(() => 'bg-sidebar-border mx-2 w-auto');
|
|
4108
|
+
}
|
|
4109
|
+
static ɵfac = function HlmSidebarSeparator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarSeparator)(); };
|
|
4110
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarSeparator, selectors: [["", "hlmSidebarSeparator", ""], ["hlm-sidebar-separator"]], hostAttrs: ["data-slot", "sidebar-separator", "data-sidebar", "separator"], features: [i0.ɵɵHostDirectivesFeature([HlmSeparator])] });
|
|
4111
|
+
}
|
|
4112
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarSeparator, [{
|
|
4113
|
+
type: Directive,
|
|
4114
|
+
args: [{
|
|
4115
|
+
selector: '[hlmSidebarSeparator],hlm-sidebar-separator',
|
|
4116
|
+
hostDirectives: [HlmSeparator],
|
|
4117
|
+
host: {
|
|
4118
|
+
'data-slot': 'sidebar-separator',
|
|
4119
|
+
'data-sidebar': 'separator',
|
|
4120
|
+
},
|
|
4121
|
+
}]
|
|
4122
|
+
}], () => [], null); })();
|
|
4123
|
+
|
|
4124
|
+
class HlmSidebarTrigger {
|
|
4125
|
+
_sidebarService = inject(HlmSidebarService);
|
|
4126
|
+
srOnlyText = input('Toggle Sidebar', /* @ts-ignore */
|
|
4127
|
+
...(ngDevMode ? [{ debugName: "srOnlyText" }] : /* istanbul ignore next */ []));
|
|
4128
|
+
_onClick() {
|
|
4129
|
+
this._sidebarService.toggleSidebar();
|
|
4130
|
+
}
|
|
4131
|
+
static ɵfac = function HlmSidebarTrigger_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarTrigger)(); };
|
|
4132
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HlmSidebarTrigger, selectors: [["button", "hlmSidebarTrigger", ""]], hostAttrs: ["data-slot", "sidebar-trigger", "data-sidebar", "trigger"], hostBindings: function HlmSidebarTrigger_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4133
|
+
i0.ɵɵlistener("click", function HlmSidebarTrigger_click_HostBindingHandler() { return ctx._onClick(); });
|
|
4134
|
+
} }, inputs: { srOnlyText: [1, "srOnlyText"] }, features: [i0.ɵɵProvidersFeature([
|
|
4135
|
+
provideIcons({ phosphorSidebarSimple }),
|
|
4136
|
+
provideBrnButtonConfig({ variant: 'ghost', size: 'icon-sm' }),
|
|
4137
|
+
]), i0.ɵɵHostDirectivesFeature([{ directive: HlmButton, inputs: ["variant", "variant", "size", "size"] }])], decls: 3, vars: 1, consts: [["name", "phosphorSidebarSimple"], [1, "sr-only"]], template: function HlmSidebarTrigger_Template(rf, ctx) { if (rf & 1) {
|
|
4138
|
+
i0.ɵɵelement(0, "ng-icon", 0);
|
|
4139
|
+
i0.ɵɵelementStart(1, "span", 1);
|
|
4140
|
+
i0.ɵɵtext(2);
|
|
4141
|
+
i0.ɵɵelementEnd();
|
|
4142
|
+
} if (rf & 2) {
|
|
4143
|
+
i0.ɵɵadvance(2);
|
|
4144
|
+
i0.ɵɵtextInterpolate(ctx.srOnlyText());
|
|
4145
|
+
} }, dependencies: [NgIcon], encapsulation: 2 });
|
|
4146
|
+
}
|
|
4147
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarTrigger, [{
|
|
4148
|
+
type: Component,
|
|
4149
|
+
args: [{
|
|
4150
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
4151
|
+
selector: 'button[hlmSidebarTrigger]',
|
|
4152
|
+
imports: [NgIcon],
|
|
4153
|
+
providers: [
|
|
4154
|
+
provideIcons({ phosphorSidebarSimple }),
|
|
4155
|
+
provideBrnButtonConfig({ variant: 'ghost', size: 'icon-sm' }),
|
|
4156
|
+
],
|
|
4157
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4158
|
+
hostDirectives: [{ directive: HlmButton, inputs: ['variant', 'size'] }],
|
|
4159
|
+
host: {
|
|
4160
|
+
'data-slot': 'sidebar-trigger',
|
|
4161
|
+
'data-sidebar': 'trigger',
|
|
4162
|
+
'(click)': '_onClick()',
|
|
4163
|
+
},
|
|
4164
|
+
template: `
|
|
4165
|
+
<ng-icon name="phosphorSidebarSimple" />
|
|
4166
|
+
<span class="sr-only">{{ srOnlyText() }}</span>
|
|
4167
|
+
`,
|
|
4168
|
+
}]
|
|
4169
|
+
}], null, { srOnlyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "srOnlyText", required: false }] }] }); })();
|
|
4170
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HlmSidebarTrigger, { className: "HlmSidebarTrigger", filePath: "lib/ui/sidebar/src/lib/hlm-sidebar-trigger.ts", lineNumber: 27 }); })();
|
|
4171
|
+
|
|
4172
|
+
class HlmSidebarWrapper {
|
|
4173
|
+
_config = injectHlmSidebarConfig();
|
|
4174
|
+
sidebarWidth = input(this._config.sidebarWidth, /* @ts-ignore */
|
|
4175
|
+
...(ngDevMode ? [{ debugName: "sidebarWidth" }] : /* istanbul ignore next */ []));
|
|
4176
|
+
sidebarWidthIcon = input(this._config.sidebarWidthIcon, /* @ts-ignore */
|
|
4177
|
+
...(ngDevMode ? [{ debugName: "sidebarWidthIcon" }] : /* istanbul ignore next */ []));
|
|
4178
|
+
constructor() {
|
|
4179
|
+
classes(() => 'group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full');
|
|
4180
|
+
}
|
|
4181
|
+
static ɵfac = function HlmSidebarWrapper_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HlmSidebarWrapper)(); };
|
|
4182
|
+
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: HlmSidebarWrapper, selectors: [["", "hlmSidebarWrapper", ""], ["hlm-sidebar-wrapper"]], hostAttrs: ["data-slot", "sidebar-wrapper"], hostVars: 4, hostBindings: function HlmSidebarWrapper_HostBindings(rf, ctx) { if (rf & 2) {
|
|
4183
|
+
i0.ɵɵstyleProp("--sidebar-width", ctx.sidebarWidth())("--sidebar-width-icon", ctx.sidebarWidthIcon());
|
|
4184
|
+
} }, inputs: { sidebarWidth: [1, "sidebarWidth"], sidebarWidthIcon: [1, "sidebarWidthIcon"] } });
|
|
4185
|
+
}
|
|
4186
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HlmSidebarWrapper, [{
|
|
4187
|
+
type: Directive,
|
|
4188
|
+
args: [{
|
|
4189
|
+
selector: '[hlmSidebarWrapper],hlm-sidebar-wrapper',
|
|
4190
|
+
host: {
|
|
4191
|
+
'data-slot': 'sidebar-wrapper',
|
|
4192
|
+
'[style.--sidebar-width]': 'sidebarWidth()',
|
|
4193
|
+
'[style.--sidebar-width-icon]': 'sidebarWidthIcon()',
|
|
4194
|
+
},
|
|
4195
|
+
}]
|
|
4196
|
+
}], () => [], { sidebarWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarWidth", required: false }] }], sidebarWidthIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarWidthIcon", required: false }] }] }); })();
|
|
4197
|
+
|
|
4198
|
+
const HlmSidebarImports = [
|
|
4199
|
+
HlmSidebar,
|
|
4200
|
+
HlmSidebarContent,
|
|
4201
|
+
HlmSidebarFooter,
|
|
4202
|
+
HlmSidebarGroup,
|
|
4203
|
+
HlmSidebarGroupAction,
|
|
4204
|
+
HlmSidebarGroupContent,
|
|
4205
|
+
HlmSidebarGroupLabel,
|
|
4206
|
+
HlmSidebarHeader,
|
|
4207
|
+
HlmSidebarInput,
|
|
4208
|
+
HlmSidebarInset,
|
|
4209
|
+
HlmSidebarMenu,
|
|
4210
|
+
HlmSidebarMenuSkeleton,
|
|
4211
|
+
HlmSidebarMenuAction,
|
|
4212
|
+
HlmSidebarMenuBadge,
|
|
4213
|
+
HlmSidebarMenuButton,
|
|
4214
|
+
HlmSidebarMenuItem,
|
|
4215
|
+
HlmSidebarMenuSub,
|
|
4216
|
+
HlmSidebarMenuSubButton,
|
|
4217
|
+
HlmSidebarRail,
|
|
4218
|
+
HlmSidebarSeparator,
|
|
4219
|
+
HlmSidebarTrigger,
|
|
4220
|
+
HlmSidebarWrapper,
|
|
4221
|
+
HlmSidebarMenuSubItem,
|
|
4222
|
+
];
|
|
4223
|
+
|
|
4224
|
+
/*
|
|
4225
|
+
* Public API surface of @surfnet/curve-angular.
|
|
4226
|
+
* Re-export each helm component (and the shared utils) added via the Spartan CLI.
|
|
4227
|
+
* NOTE: there are a few components that we don't export: [icon, sheet, skeleton, tooltip],
|
|
4228
|
+
* because these are out of scope for now. They are included in the code because the
|
|
4229
|
+
* components that we do export depend on them (and they can't be consumed from a package).
|
|
4230
|
+
*/
|
|
4231
|
+
|
|
4232
|
+
/**
|
|
4233
|
+
* Generated bundle index. Do not edit.
|
|
4234
|
+
*/
|
|
4235
|
+
|
|
4236
|
+
export { HLM_CHECKBOX_VALUE_ACCESSOR, HlmAvatar, HlmAvatarBadge, HlmAvatarFallback, HlmAvatarGroup, HlmAvatarGroupCount, HlmAvatarImage, HlmAvatarImports, HlmBreadCrumbImports, HlmBreadcrumb, HlmBreadcrumbEllipsis, HlmBreadcrumbImports, HlmBreadcrumbItem, HlmBreadcrumbLink, HlmBreadcrumbList, HlmBreadcrumbPage, HlmBreadcrumbSeparator, HlmButton, HlmButtonImports, HlmCaption, HlmCard, HlmCardAction, HlmCardContent, HlmCardDescription, HlmCardFooter, HlmCardHeader, HlmCardImports, HlmCardTitle, HlmCheckbox, HlmCheckboxImports, HlmDataTableContent, HlmDataTableImports, HlmDataTablePagination, HlmDataTableToolbar, HlmDropdownMenu, HlmDropdownMenuCheckbox, HlmDropdownMenuCheckboxIndicator, HlmDropdownMenuGroup, HlmDropdownMenuImports, HlmDropdownMenuItem, HlmDropdownMenuItemSubIndicator, HlmDropdownMenuLabel, HlmDropdownMenuRadio, HlmDropdownMenuRadioIndicator, HlmDropdownMenuSeparator, HlmDropdownMenuShortcut, HlmDropdownMenuSub, HlmDropdownMenuTrigger, HlmField, HlmFieldContent, HlmFieldDescription, HlmFieldError, HlmFieldGroup, HlmFieldImports, HlmFieldLabel, HlmFieldLegend, HlmFieldSeparator, HlmFieldSet, HlmFieldTitle, HlmInput, HlmInputGroup, HlmInputGroupAddon, HlmInputGroupButton, HlmInputGroupImports, HlmInputGroupInput, HlmInputGroupText, HlmInputGroupTextarea, HlmInputImports, HlmLabel, HlmLabelImports, HlmSelect, HlmSelectContent, HlmSelectGroup, HlmSelectImports, HlmSelectItem, HlmSelectLabel, HlmSelectMultiple, HlmSelectPlaceholder, HlmSelectPortal, HlmSelectScrollDown, HlmSelectScrollUp, HlmSelectSeparator, HlmSelectTrigger, HlmSelectValue, HlmSelectValueTemplate, HlmSelectValues, HlmSelectValuesContent, HlmSeparator, HlmSeparatorImports, HlmSidebar, HlmSidebarContent, HlmSidebarFooter, HlmSidebarGroup, HlmSidebarGroupAction, HlmSidebarGroupContent, HlmSidebarGroupLabel, HlmSidebarHeader, HlmSidebarImports, HlmSidebarInput, HlmSidebarInset, HlmSidebarMenu, HlmSidebarMenuAction, HlmSidebarMenuBadge, HlmSidebarMenuButton, HlmSidebarMenuItem, HlmSidebarMenuSkeleton, HlmSidebarMenuSub, HlmSidebarMenuSubButton, HlmSidebarMenuSubItem, HlmSidebarRail, HlmSidebarSeparator, HlmSidebarService, HlmSidebarTrigger, HlmSidebarWrapper, HlmTBody, HlmTFoot, HlmTHead, HlmTable, HlmTableContainer, HlmTableImports, HlmTd, HlmTextarea, HlmTextareaImports, HlmTh, HlmTr, buttonVariants, classes, hlm, hlmSeparatorClass, injectBrnButtonConfig, injectDataTable, injectHlmDropdownMenuConfig, injectHlmSidebarConfig, provideBrnButtonConfig, provideHlmDropdownMenuConfig, provideHlmSidebarConfig };
|
|
4237
|
+
//# sourceMappingURL=surfnet-curve-angular.mjs.map
|