@egose/shadcn-theme-ng 0.0.26 → 0.0.28
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/LICENSE +201 -0
- package/README.md +107 -2
- package/accordion/fesm2022/accordion.mjs +42 -37
- package/accordion/fesm2022/accordion.mjs.map +1 -1
- package/accordion/package.json +25 -0
- package/accordion/{index.d.ts → types/accordion.d.ts} +1 -1
- package/alert/fesm2022/alert.mjs +32 -27
- package/alert/fesm2022/alert.mjs.map +1 -1
- package/alert/package.json +25 -0
- package/alert-dialog/README.md +11 -0
- package/alert-dialog/fesm2022/alert-dialog.mjs +287 -0
- package/alert-dialog/fesm2022/alert-dialog.mjs.map +1 -0
- package/alert-dialog/package.json +25 -0
- package/alert-dialog/types/alert-dialog.d.ts +90 -0
- package/aspect-ratio/README.md +11 -0
- package/aspect-ratio/fesm2022/aspect-ratio.mjs +62 -0
- package/aspect-ratio/fesm2022/aspect-ratio.mjs.map +1 -0
- package/aspect-ratio/package.json +25 -0
- package/aspect-ratio/types/aspect-ratio.d.ts +21 -0
- package/autocomplete/fesm2022/autocomplete.mjs +323 -457
- package/autocomplete/fesm2022/autocomplete.mjs.map +1 -1
- package/autocomplete/package.json +24 -0
- package/autocomplete/types/autocomplete.d.ts +96 -0
- package/avatar/README.md +11 -0
- package/avatar/fesm2022/avatar.mjs +178 -0
- package/avatar/fesm2022/avatar.mjs.map +1 -0
- package/avatar/package.json +25 -0
- package/avatar/types/avatar.d.ts +50 -0
- package/badge/fesm2022/badge.mjs +16 -10
- package/badge/fesm2022/badge.mjs.map +1 -1
- package/badge/package.json +25 -0
- package/basic-alert/fesm2022/basic-alert.mjs +12 -8
- package/basic-alert/fesm2022/basic-alert.mjs.map +1 -1
- package/basic-alert/package.json +24 -0
- package/breadcrumb/README.md +11 -0
- package/breadcrumb/fesm2022/breadcrumb.mjs +224 -0
- package/breadcrumb/fesm2022/breadcrumb.mjs.map +1 -0
- package/breadcrumb/package.json +25 -0
- package/breadcrumb/types/breadcrumb.d.ts +57 -0
- package/button/fesm2022/button.mjs +100 -26
- package/button/fesm2022/button.mjs.map +1 -1
- package/button/package.json +25 -0
- package/button/{index.d.ts → types/button.d.ts} +30 -9
- package/button-group/README.md +11 -0
- package/button-group/fesm2022/button-group.mjs +102 -0
- package/button-group/fesm2022/button-group.mjs.map +1 -0
- package/button-group/package.json +25 -0
- package/button-group/types/button-group.d.ts +30 -0
- package/calendar/fesm2022/calendar.mjs +868 -546
- package/calendar/fesm2022/calendar.mjs.map +1 -1
- package/calendar/package.json +24 -0
- package/calendar/types/calendar.d.ts +94 -0
- package/card/README.md +11 -0
- package/card/fesm2022/card.mjs +169 -0
- package/card/fesm2022/card.mjs.map +1 -0
- package/card/package.json +25 -0
- package/card/types/card.d.ts +54 -0
- package/carousel/README.md +11 -0
- package/carousel/fesm2022/carousel.mjs +309 -0
- package/carousel/fesm2022/carousel.mjs.map +1 -0
- package/carousel/package.json +25 -0
- package/carousel/types/carousel.d.ts +84 -0
- package/checkbox/fesm2022/checkbox.mjs +25 -20
- package/checkbox/fesm2022/checkbox.mjs.map +1 -1
- package/checkbox/package.json +24 -0
- package/collapsible/README.md +11 -0
- package/collapsible/fesm2022/collapsible.mjs +77 -0
- package/collapsible/fesm2022/collapsible.mjs.map +1 -0
- package/collapsible/package.json +25 -0
- package/collapsible/types/collapsible.d.ts +27 -0
- package/combobox/README.md +11 -0
- package/combobox/fesm2022/combobox.mjs +683 -0
- package/combobox/fesm2022/combobox.mjs.map +1 -0
- package/combobox/package.json +25 -0
- package/combobox/types/combobox.d.ts +151 -0
- package/command/README.md +11 -0
- package/command/fesm2022/command.mjs +361 -0
- package/command/fesm2022/command.mjs.map +1 -0
- package/command/package.json +25 -0
- package/command/types/command.d.ts +89 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +19 -8
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +1 -1
- package/confirmation-dialog/package.json +24 -0
- package/context-menu/README.md +11 -0
- package/context-menu/fesm2022/context-menu.mjs +89 -0
- package/context-menu/fesm2022/context-menu.mjs.map +1 -0
- package/context-menu/package.json +25 -0
- package/context-menu/types/context-menu.d.ts +34 -0
- package/date-picker/fesm2022/date-picker.mjs +1262 -307
- package/date-picker/fesm2022/date-picker.mjs.map +1 -1
- package/date-picker/package.json +24 -0
- package/date-picker/types/date-picker.d.ts +551 -0
- package/dialog/fesm2022/dialog.mjs +137 -108
- package/dialog/fesm2022/dialog.mjs.map +1 -1
- package/dialog/package.json +24 -0
- package/dialog/types/dialog.d.ts +95 -0
- package/drawer/README.md +11 -0
- package/drawer/fesm2022/drawer.mjs +271 -0
- package/drawer/fesm2022/drawer.mjs.map +1 -0
- package/drawer/package.json +25 -0
- package/drawer/types/drawer.d.ts +76 -0
- package/dropdown-menu/README.md +11 -0
- package/dropdown-menu/fesm2022/dropdown-menu.mjs +542 -0
- package/dropdown-menu/fesm2022/dropdown-menu.mjs.map +1 -0
- package/dropdown-menu/package.json +25 -0
- package/dropdown-menu/types/dropdown-menu.d.ts +176 -0
- package/empty/README.md +11 -0
- package/empty/fesm2022/empty.mjs +151 -0
- package/empty/fesm2022/empty.mjs.map +1 -0
- package/empty/package.json +25 -0
- package/empty/types/empty.d.ts +54 -0
- package/field/README.md +11 -0
- package/field/fesm2022/field.mjs +367 -0
- package/field/fesm2022/field.mjs.map +1 -0
- package/field/package.json +25 -0
- package/field/types/field.d.ts +107 -0
- package/form-checkbox/fesm2022/form-checkbox.mjs +39 -22
- package/form-checkbox/fesm2022/form-checkbox.mjs.map +1 -1
- package/form-checkbox/package.json +24 -0
- package/form-date-picker/fesm2022/form-date-picker.mjs +58 -51
- package/form-date-picker/fesm2022/form-date-picker.mjs.map +1 -1
- package/form-date-picker/package.json +24 -0
- package/form-field/fesm2022/form-field.mjs +39 -27
- package/form-field/fesm2022/form-field.mjs.map +1 -1
- package/form-field/package.json +25 -0
- package/form-field/{index.d.ts → types/form-field.d.ts} +4 -3
- package/form-field-simple/fesm2022/form-field-simple.mjs +15 -10
- package/form-field-simple/fesm2022/form-field-simple.mjs.map +1 -1
- package/form-field-simple/package.json +24 -0
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +44 -25
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +1 -1
- package/form-searchable-multiselect/package.json +24 -0
- package/form-select/fesm2022/form-select.mjs +132 -71
- package/form-select/fesm2022/form-select.mjs.map +1 -1
- package/form-select/package.json +24 -0
- package/form-text-input/fesm2022/form-text-input.mjs +68 -39
- package/form-text-input/fesm2022/form-text-input.mjs.map +1 -1
- package/form-text-input/package.json +24 -0
- package/form-textarea/fesm2022/form-textarea.mjs +54 -30
- package/form-textarea/fesm2022/form-textarea.mjs.map +1 -1
- package/form-textarea/package.json +24 -0
- package/hover-card/README.md +11 -0
- package/hover-card/fesm2022/hover-card.mjs +123 -0
- package/hover-card/fesm2022/hover-card.mjs.map +1 -0
- package/hover-card/package.json +25 -0
- package/hover-card/types/hover-card.d.ts +36 -0
- package/icon/fesm2022/icon.mjs +12 -10
- package/icon/fesm2022/icon.mjs.map +1 -1
- package/icon/package.json +25 -0
- package/input/fesm2022/input.mjs +20 -70
- package/input/fesm2022/input.mjs.map +1 -1
- package/input/package.json +25 -0
- package/input/types/input.d.ts +18 -0
- package/input-group/README.md +11 -0
- package/input-group/fesm2022/input-group.mjs +199 -0
- package/input-group/fesm2022/input-group.mjs.map +1 -0
- package/input-group/package.json +25 -0
- package/input-group/types/input-group.d.ts +52 -0
- package/input-otp/README.md +11 -0
- package/input-otp/fesm2022/input-otp.mjs +141 -0
- package/input-otp/fesm2022/input-otp.mjs.map +1 -0
- package/input-otp/package.json +25 -0
- package/input-otp/types/input-otp.d.ts +43 -0
- package/item/README.md +11 -0
- package/item/fesm2022/item.mjs +278 -0
- package/item/fesm2022/item.mjs.map +1 -0
- package/item/package.json +25 -0
- package/item/types/item.d.ts +101 -0
- package/kbd/README.md +11 -0
- package/kbd/fesm2022/kbd.mjs +61 -0
- package/kbd/fesm2022/kbd.mjs.map +1 -0
- package/kbd/package.json +25 -0
- package/kbd/types/kbd.d.ts +22 -0
- package/label/fesm2022/label.mjs +11 -10
- package/label/fesm2022/label.mjs.map +1 -1
- package/label/package.json +25 -0
- package/layout-simple/fesm2022/layout-simple.mjs +438 -325
- package/layout-simple/fesm2022/layout-simple.mjs.map +1 -1
- package/layout-simple/package.json +24 -0
- package/layout-simple/{index.d.ts → types/layout-simple.d.ts} +28 -17
- package/menubar/README.md +11 -0
- package/menubar/fesm2022/menubar.mjs +108 -0
- package/menubar/fesm2022/menubar.mjs.map +1 -0
- package/menubar/package.json +25 -0
- package/menubar/types/menubar.d.ts +40 -0
- package/native-select/README.md +11 -0
- package/native-select/fesm2022/native-select.mjs +207 -0
- package/native-select/fesm2022/native-select.mjs.map +1 -0
- package/native-select/package.json +25 -0
- package/native-select/types/native-select.d.ts +70 -0
- package/navigation-menu/README.md +11 -0
- package/navigation-menu/fesm2022/navigation-menu.mjs +206 -0
- package/navigation-menu/fesm2022/navigation-menu.mjs.map +1 -0
- package/navigation-menu/package.json +25 -0
- package/navigation-menu/types/navigation-menu.d.ts +54 -0
- package/package.json +223 -81
- package/pagination/README.md +11 -0
- package/pagination/fesm2022/pagination.mjs +808 -0
- package/pagination/fesm2022/pagination.mjs.map +1 -0
- package/pagination/package.json +25 -0
- package/pagination/types/pagination.d.ts +192 -0
- package/popover/fesm2022/popover.mjs +121 -27
- package/popover/fesm2022/popover.mjs.map +1 -1
- package/popover/package.json +24 -0
- package/popover/types/popover.d.ts +54 -0
- package/progress/README.md +11 -0
- package/progress/fesm2022/progress.mjs +77 -0
- package/progress/fesm2022/progress.mjs.map +1 -0
- package/progress/package.json +25 -0
- package/progress/types/progress.d.ts +27 -0
- package/radio-group/fesm2022/radio-group.mjs +96 -62
- package/radio-group/fesm2022/radio-group.mjs.map +1 -1
- package/radio-group/package.json +25 -0
- package/radio-group/{index.d.ts → types/radio-group.d.ts} +22 -14
- package/resizable/README.md +11 -0
- package/resizable/fesm2022/resizable.mjs +111 -0
- package/resizable/fesm2022/resizable.mjs.map +1 -0
- package/resizable/package.json +25 -0
- package/resizable/types/resizable.d.ts +32 -0
- package/scroll-area/README.md +11 -0
- package/scroll-area/fesm2022/scroll-area.mjs +51 -0
- package/scroll-area/fesm2022/scroll-area.mjs.map +1 -0
- package/scroll-area/package.json +25 -0
- package/scroll-area/types/scroll-area.d.ts +16 -0
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +92 -88
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs.map +1 -1
- package/searchable-multiselect/package.json +24 -0
- package/searchable-multiselect/{index.d.ts → types/searchable-multiselect.d.ts} +13 -24
- package/select/fesm2022/select.mjs +371 -189
- package/select/fesm2022/select.mjs.map +1 -1
- package/select/package.json +25 -0
- package/select/types/select.d.ts +119 -0
- package/separator/fesm2022/separator.mjs +16 -14
- package/separator/fesm2022/separator.mjs.map +1 -1
- package/separator/package.json +24 -0
- package/separator/{index.d.ts → types/separator.d.ts} +4 -5
- package/sheet/fesm2022/sheet.mjs +57 -51
- package/sheet/fesm2022/sheet.mjs.map +1 -1
- package/sheet/package.json +24 -0
- package/sidebar/README.md +11 -0
- package/sidebar/fesm2022/sidebar.mjs +948 -0
- package/sidebar/fesm2022/sidebar.mjs.map +1 -0
- package/sidebar/package.json +25 -0
- package/sidebar/types/sidebar.d.ts +237 -0
- package/skeleton/README.md +11 -0
- package/skeleton/fesm2022/skeleton.mjs +44 -0
- package/skeleton/fesm2022/skeleton.mjs.map +1 -0
- package/skeleton/package.json +25 -0
- package/skeleton/types/skeleton.d.ts +16 -0
- package/slider/README.md +11 -0
- package/slider/fesm2022/slider.mjs +144 -0
- package/slider/fesm2022/slider.mjs.map +1 -0
- package/slider/package.json +25 -0
- package/slider/types/slider.d.ts +19 -0
- package/sonner/fesm2022/sonner.mjs +30 -35
- package/sonner/fesm2022/sonner.mjs.map +1 -1
- package/sonner/package.json +25 -0
- package/spinner/fesm2022/spinner.mjs +18 -14
- package/spinner/fesm2022/spinner.mjs.map +1 -1
- package/spinner/package.json +25 -0
- package/switch/fesm2022/switch.mjs +29 -26
- package/switch/fesm2022/switch.mjs.map +1 -1
- package/switch/package.json +25 -0
- package/table/README.md +11 -0
- package/table/fesm2022/table.mjs +211 -0
- package/table/fesm2022/table.mjs.map +1 -0
- package/table/package.json +25 -0
- package/table/types/table.d.ts +87 -0
- package/tabs/fesm2022/tabs.mjs +131 -103
- package/tabs/fesm2022/tabs.mjs.map +1 -1
- package/tabs/package.json +25 -0
- package/tabs/types/tabs.d.ts +71 -0
- package/textarea/README.md +11 -0
- package/textarea/fesm2022/textarea.mjs +47 -0
- package/textarea/fesm2022/textarea.mjs.map +1 -0
- package/textarea/package.json +25 -0
- package/textarea/types/textarea.d.ts +18 -0
- package/toggle/README.md +11 -0
- package/toggle/fesm2022/toggle.mjs +78 -0
- package/toggle/fesm2022/toggle.mjs.map +1 -0
- package/toggle/package.json +25 -0
- package/toggle/types/toggle.d.ts +27 -0
- package/toggle-group/README.md +11 -0
- package/toggle-group/fesm2022/toggle-group.mjs +117 -0
- package/toggle-group/fesm2022/toggle-group.mjs.map +1 -0
- package/toggle-group/package.json +25 -0
- package/toggle-group/types/toggle-group.d.ts +39 -0
- package/tooltip/fesm2022/tooltip.mjs +33 -54
- package/tooltip/fesm2022/tooltip.mjs.map +1 -1
- package/tooltip/package.json +25 -0
- package/tooltip/types/tooltip.d.ts +22 -0
- package/typography/README.md +11 -0
- package/typography/fesm2022/typography.mjs +242 -0
- package/typography/fesm2022/typography.mjs.map +1 -0
- package/typography/package.json +25 -0
- package/typography/types/typography.d.ts +94 -0
- package/utils/fesm2022/utils.mjs +184 -1
- package/utils/fesm2022/utils.mjs.map +1 -1
- package/utils/package.json +25 -0
- package/utils/types/utils.d.ts +13 -0
- package/autocomplete/index.d.ts +0 -162
- package/calendar/index.d.ts +0 -111
- package/date-picker/index.d.ts +0 -227
- package/dialog/index.d.ts +0 -89
- package/exports.json +0 -1
- package/input/index.d.ts +0 -41
- package/menu/README.md +0 -64
- package/menu/fesm2022/menu.mjs +0 -449
- package/menu/fesm2022/menu.mjs.map +0 -1
- package/menu/index.d.ts +0 -137
- package/popover/index.d.ts +0 -30
- package/select/index.d.ts +0 -92
- package/tabs/index.d.ts +0 -71
- package/tooltip/index.d.ts +0 -21
- package/utils/index.d.ts +0 -5
- /package/alert/{index.d.ts → types/alert.d.ts} +0 -0
- /package/badge/{index.d.ts → types/badge.d.ts} +0 -0
- /package/basic-alert/{index.d.ts → types/basic-alert.d.ts} +0 -0
- /package/checkbox/{index.d.ts → types/checkbox.d.ts} +0 -0
- /package/confirmation-dialog/{index.d.ts → types/confirmation-dialog.d.ts} +0 -0
- /package/form-checkbox/{index.d.ts → types/form-checkbox.d.ts} +0 -0
- /package/form-date-picker/{index.d.ts → types/form-date-picker.d.ts} +0 -0
- /package/form-field-simple/{index.d.ts → types/form-field-simple.d.ts} +0 -0
- /package/form-searchable-multiselect/{index.d.ts → types/form-searchable-multiselect.d.ts} +0 -0
- /package/form-select/{index.d.ts → types/form-select.d.ts} +0 -0
- /package/form-text-input/{index.d.ts → types/form-text-input.d.ts} +0 -0
- /package/form-textarea/{index.d.ts → types/form-textarea.d.ts} +0 -0
- /package/icon/{index.d.ts → types/icon.d.ts} +0 -0
- /package/label/{index.d.ts → types/label.d.ts} +0 -0
- /package/sheet/{index.d.ts → types/sheet.d.ts} +0 -0
- /package/sonner/{index.d.ts → types/sonner.d.ts} +0 -0
- /package/spinner/{index.d.ts → types/spinner.d.ts} +0 -0
- /package/switch/{index.d.ts → types/switch.d.ts} +0 -0
package/utils/fesm2022/utils.mjs
CHANGED
|
@@ -1,9 +1,192 @@
|
|
|
1
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
2
|
+
import { runInInjectionContext, inject, Injector, ElementRef, PLATFORM_ID, DestroyRef, HostAttributeToken, effect, makeEnvironmentProviders } from '@angular/core';
|
|
1
3
|
import { clsx } from 'clsx';
|
|
2
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { OVERLAY_DEFAULT_CONFIG } from '@angular/cdk/overlay';
|
|
3
6
|
|
|
4
7
|
function hlm(...inputs) {
|
|
5
8
|
return twMerge(clsx(inputs));
|
|
6
9
|
}
|
|
10
|
+
const elementClassManagers = new WeakMap();
|
|
11
|
+
let globalObserver = null;
|
|
12
|
+
const observedElements = new Set();
|
|
13
|
+
let sourceCounter = 0;
|
|
14
|
+
function classes(computed, options = {}) {
|
|
15
|
+
runInInjectionContext(options.injector ?? inject(Injector), () => {
|
|
16
|
+
const elementRef = options.elementRef ?? inject(ElementRef);
|
|
17
|
+
const platformId = inject(PLATFORM_ID);
|
|
18
|
+
const destroyRef = inject(DestroyRef);
|
|
19
|
+
const baseClasses = inject(new HostAttributeToken('class'), { optional: true });
|
|
20
|
+
const element = elementRef.nativeElement;
|
|
21
|
+
const sourceId = sourceCounter++;
|
|
22
|
+
let manager = elementClassManagers.get(element);
|
|
23
|
+
if (!manager) {
|
|
24
|
+
const initialBaseClasses = new Set();
|
|
25
|
+
if (baseClasses) {
|
|
26
|
+
toClassList(baseClasses).forEach((cls) => initialBaseClasses.add(cls));
|
|
27
|
+
}
|
|
28
|
+
manager = {
|
|
29
|
+
element,
|
|
30
|
+
sources: new Map(),
|
|
31
|
+
baseClasses: initialBaseClasses,
|
|
32
|
+
isUpdating: false,
|
|
33
|
+
nextOrder: 0,
|
|
34
|
+
hasInitialized: false,
|
|
35
|
+
restoreRafId: null,
|
|
36
|
+
transitionsSuppressed: false,
|
|
37
|
+
previousTransition: '',
|
|
38
|
+
previousTransitionPriority: '',
|
|
39
|
+
};
|
|
40
|
+
elementClassManagers.set(element, manager);
|
|
41
|
+
setupGlobalObserver(platformId);
|
|
42
|
+
observedElements.add(element);
|
|
43
|
+
if (isPlatformBrowser(platformId)) {
|
|
44
|
+
manager.previousTransition = element.style.getPropertyValue('transition');
|
|
45
|
+
manager.previousTransitionPriority = element.style.getPropertyPriority('transition');
|
|
46
|
+
element.style.setProperty('transition', 'none', 'important');
|
|
47
|
+
manager.transitionsSuppressed = true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const sourceOrder = manager.nextOrder++;
|
|
51
|
+
function updateClasses() {
|
|
52
|
+
const newClasses = toClassList(computed());
|
|
53
|
+
manager.sources.set(sourceId, {
|
|
54
|
+
classes: new Set(newClasses),
|
|
55
|
+
order: sourceOrder,
|
|
56
|
+
});
|
|
57
|
+
updateElement(manager);
|
|
58
|
+
if (manager.transitionsSuppressed) {
|
|
59
|
+
manager.transitionsSuppressed = false;
|
|
60
|
+
manager.restoreRafId = requestAnimationFrame(() => {
|
|
61
|
+
manager.restoreRafId = null;
|
|
62
|
+
restoreTransitionSuppression(manager);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
destroyRef.onDestroy(() => {
|
|
67
|
+
if (manager.restoreRafId !== null) {
|
|
68
|
+
cancelAnimationFrame(manager.restoreRafId);
|
|
69
|
+
manager.restoreRafId = null;
|
|
70
|
+
}
|
|
71
|
+
if (manager.transitionsSuppressed) {
|
|
72
|
+
manager.transitionsSuppressed = false;
|
|
73
|
+
restoreTransitionSuppression(manager);
|
|
74
|
+
}
|
|
75
|
+
manager.sources.delete(sourceId);
|
|
76
|
+
if (manager.sources.size === 0) {
|
|
77
|
+
cleanupManager(element);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
updateElement(manager);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
effect(updateClasses);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function restoreTransitionSuppression(manager) {
|
|
87
|
+
const prev = manager.previousTransition;
|
|
88
|
+
if (prev) {
|
|
89
|
+
manager.element.style.setProperty('transition', prev, manager.previousTransitionPriority || undefined);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
manager.element.style.removeProperty('transition');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function setupGlobalObserver(platformId) {
|
|
96
|
+
if (isPlatformBrowser(platformId) && !globalObserver) {
|
|
97
|
+
globalObserver = new MutationObserver((mutations) => {
|
|
98
|
+
for (const mutation of mutations) {
|
|
99
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
100
|
+
const element = mutation.target;
|
|
101
|
+
const manager = elementClassManagers.get(element);
|
|
102
|
+
if (manager && observedElements.has(element)) {
|
|
103
|
+
if (manager.isUpdating)
|
|
104
|
+
continue;
|
|
105
|
+
const currentClasses = toClassList(element.className);
|
|
106
|
+
const allSourceClasses = new Set();
|
|
107
|
+
for (const source of manager.sources.values()) {
|
|
108
|
+
for (const className of source.classes) {
|
|
109
|
+
allSourceClasses.add(className);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
manager.baseClasses.clear();
|
|
113
|
+
for (const className of currentClasses) {
|
|
114
|
+
if (!allSourceClasses.has(className)) {
|
|
115
|
+
manager.baseClasses.add(className);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
updateElement(manager);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
globalObserver.observe(document, {
|
|
124
|
+
attributes: true,
|
|
125
|
+
attributeFilter: ['class'],
|
|
126
|
+
subtree: true,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function updateElement(manager) {
|
|
131
|
+
if (manager.isUpdating)
|
|
132
|
+
return;
|
|
133
|
+
manager.isUpdating = true;
|
|
134
|
+
if (!manager.hasInitialized && manager.sources.size > 0) {
|
|
135
|
+
const currentClasses = toClassList(manager.element.className);
|
|
136
|
+
const allSourceClasses = new Set();
|
|
137
|
+
for (const source of manager.sources.values()) {
|
|
138
|
+
source.classes.forEach((className) => allSourceClasses.add(className));
|
|
139
|
+
}
|
|
140
|
+
currentClasses.forEach((className) => {
|
|
141
|
+
if (!allSourceClasses.has(className)) {
|
|
142
|
+
manager.baseClasses.add(className);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
manager.hasInitialized = true;
|
|
146
|
+
}
|
|
147
|
+
const sortedSources = Array.from(manager.sources.entries()).sort(([, a], [, b]) => a.order - b.order);
|
|
148
|
+
const allSourceClasses = [];
|
|
149
|
+
for (const [, source] of sortedSources) {
|
|
150
|
+
allSourceClasses.push(...source.classes);
|
|
151
|
+
}
|
|
152
|
+
const classesToApply = allSourceClasses.length > 0 || manager.baseClasses.size > 0
|
|
153
|
+
? hlm([...allSourceClasses, ...manager.baseClasses])
|
|
154
|
+
: '';
|
|
155
|
+
if (manager.element.className !== classesToApply) {
|
|
156
|
+
manager.element.className = classesToApply;
|
|
157
|
+
}
|
|
158
|
+
manager.isUpdating = false;
|
|
159
|
+
}
|
|
160
|
+
function cleanupManager(element) {
|
|
161
|
+
observedElements.delete(element);
|
|
162
|
+
elementClassManagers.delete(element);
|
|
163
|
+
if (observedElements.size === 0 && globalObserver) {
|
|
164
|
+
globalObserver.disconnect();
|
|
165
|
+
globalObserver = null;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const classListCache = new Map();
|
|
169
|
+
function toClassList(className) {
|
|
170
|
+
if (typeof className === 'string' && classListCache.has(className)) {
|
|
171
|
+
return classListCache.get(className);
|
|
172
|
+
}
|
|
173
|
+
const result = clsx(className)
|
|
174
|
+
.split(' ')
|
|
175
|
+
.filter((cls) => cls.length > 0);
|
|
176
|
+
if (typeof className === 'string' && classListCache.size < 1000) {
|
|
177
|
+
classListCache.set(className, result);
|
|
178
|
+
}
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function provideSpartanHlm() {
|
|
183
|
+
return makeEnvironmentProviders([
|
|
184
|
+
{
|
|
185
|
+
provide: OVERLAY_DEFAULT_CONFIG,
|
|
186
|
+
useValue: { usePopover: false },
|
|
187
|
+
},
|
|
188
|
+
]);
|
|
189
|
+
}
|
|
7
190
|
|
|
8
191
|
/*
|
|
9
192
|
* Public API Surface of utils
|
|
@@ -13,5 +196,5 @@ function hlm(...inputs) {
|
|
|
13
196
|
* Generated bundle index. Do not edit.
|
|
14
197
|
*/
|
|
15
198
|
|
|
16
|
-
export { hlm };
|
|
199
|
+
export { classes, hlm, provideSpartanHlm };
|
|
17
200
|
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../../projects/utils/src/lib/utils.ts","../../../projects/utils/src/public-api.ts","../../../projects/utils/src/utils.ts"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function hlm(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","/*\n * Public API Surface of utils\n */\n\nexport * from './lib/utils';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAGM,SAAU,GAAG,CAAC,GAAG,MAAoB,EAAA;AACzC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B;;ACLA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../../projects/utils/src/lib/utils.ts","../../../projects/utils/src/lib/provide-spartan-hlm.ts","../../../projects/utils/src/public-api.ts","../../../projects/utils/src/utils.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n DestroyRef,\n effect,\n ElementRef,\n HostAttributeToken,\n inject,\n Injector,\n PLATFORM_ID,\n runInInjectionContext,\n} from '@angular/core';\nimport { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function hlm(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nconst elementClassManagers = new WeakMap<HTMLElement, ElementClassManager>();\nlet globalObserver: MutationObserver | null = null;\nconst observedElements = new Set<HTMLElement>();\n\ninterface ElementClassManager {\n element: HTMLElement;\n sources: Map<number, { classes: Set<string>; order: number }>;\n baseClasses: Set<string>;\n isUpdating: boolean;\n nextOrder: number;\n hasInitialized: boolean;\n restoreRafId: number | null;\n transitionsSuppressed: boolean;\n previousTransition: string;\n previousTransitionPriority: string;\n}\n\nlet sourceCounter = 0;\n\nexport function classes(computed: () => ClassValue[] | string, options: ClassesOptions = {}) {\n runInInjectionContext(options.injector ?? inject(Injector), () => {\n const elementRef = options.elementRef ?? inject(ElementRef);\n const platformId = inject(PLATFORM_ID);\n const destroyRef = inject(DestroyRef);\n const baseClasses = inject(new HostAttributeToken('class'), { optional: true });\n\n const element = elementRef.nativeElement;\n const sourceId = sourceCounter++;\n let manager = elementClassManagers.get(element);\n\n if (!manager) {\n const initialBaseClasses = new Set<string>();\n\n if (baseClasses) {\n toClassList(baseClasses).forEach((cls) => initialBaseClasses.add(cls));\n }\n\n manager = {\n element,\n sources: new Map(),\n baseClasses: initialBaseClasses,\n isUpdating: false,\n nextOrder: 0,\n hasInitialized: false,\n restoreRafId: null,\n transitionsSuppressed: false,\n previousTransition: '',\n previousTransitionPriority: '',\n };\n elementClassManagers.set(element, manager);\n\n setupGlobalObserver(platformId);\n observedElements.add(element);\n\n if (isPlatformBrowser(platformId)) {\n manager.previousTransition = element.style.getPropertyValue('transition');\n manager.previousTransitionPriority = element.style.getPropertyPriority('transition');\n element.style.setProperty('transition', 'none', 'important');\n manager.transitionsSuppressed = true;\n }\n }\n\n const sourceOrder = manager.nextOrder++;\n\n function updateClasses(): void {\n const newClasses = toClassList(computed());\n\n manager!.sources.set(sourceId, {\n classes: new Set(newClasses),\n order: sourceOrder,\n });\n\n updateElement(manager!);\n\n if (manager!.transitionsSuppressed) {\n manager!.transitionsSuppressed = false;\n manager!.restoreRafId = requestAnimationFrame(() => {\n manager!.restoreRafId = null;\n restoreTransitionSuppression(manager!);\n });\n }\n }\n\n destroyRef.onDestroy(() => {\n if (manager!.restoreRafId !== null) {\n cancelAnimationFrame(manager!.restoreRafId);\n manager!.restoreRafId = null;\n }\n\n if (manager!.transitionsSuppressed) {\n manager!.transitionsSuppressed = false;\n restoreTransitionSuppression(manager!);\n }\n\n manager!.sources.delete(sourceId);\n\n if (manager!.sources.size === 0) {\n cleanupManager(element);\n } else {\n updateElement(manager!);\n }\n });\n\n effect(updateClasses);\n });\n}\n\nfunction restoreTransitionSuppression(manager: ElementClassManager): void {\n const prev = manager.previousTransition;\n if (prev) {\n manager.element.style.setProperty('transition', prev, manager.previousTransitionPriority || undefined);\n } else {\n manager.element.style.removeProperty('transition');\n }\n}\n\nfunction setupGlobalObserver(platformId: object): void {\n if (isPlatformBrowser(platformId) && !globalObserver) {\n globalObserver = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n const element = mutation.target as HTMLElement;\n const manager = elementClassManagers.get(element);\n\n if (manager && observedElements.has(element)) {\n if (manager.isUpdating) continue;\n\n const currentClasses = toClassList(element.className);\n const allSourceClasses = new Set<string>();\n\n for (const source of manager.sources.values()) {\n for (const className of source.classes) {\n allSourceClasses.add(className);\n }\n }\n\n manager.baseClasses.clear();\n\n for (const className of currentClasses) {\n if (!allSourceClasses.has(className)) {\n manager.baseClasses.add(className);\n }\n }\n\n updateElement(manager);\n }\n }\n }\n });\n\n globalObserver.observe(document, {\n attributes: true,\n attributeFilter: ['class'],\n subtree: true,\n });\n }\n}\n\nfunction updateElement(manager: ElementClassManager): void {\n if (manager.isUpdating) return;\n\n manager.isUpdating = true;\n\n if (!manager.hasInitialized && manager.sources.size > 0) {\n const currentClasses = toClassList(manager.element.className);\n const allSourceClasses = new Set<string>();\n\n for (const source of manager.sources.values()) {\n source.classes.forEach((className) => allSourceClasses.add(className));\n }\n\n currentClasses.forEach((className) => {\n if (!allSourceClasses.has(className)) {\n manager.baseClasses.add(className);\n }\n });\n\n manager.hasInitialized = true;\n }\n\n const sortedSources = Array.from(manager.sources.entries()).sort(([, a], [, b]) => a.order - b.order);\n const allSourceClasses: string[] = [];\n\n for (const [, source] of sortedSources) {\n allSourceClasses.push(...source.classes);\n }\n\n const classesToApply =\n allSourceClasses.length > 0 || manager.baseClasses.size > 0\n ? hlm([...allSourceClasses, ...manager.baseClasses])\n : '';\n\n if (manager.element.className !== classesToApply) {\n manager.element.className = classesToApply;\n }\n\n manager.isUpdating = false;\n}\n\nfunction cleanupManager(element: HTMLElement): void {\n observedElements.delete(element);\n elementClassManagers.delete(element);\n\n if (observedElements.size === 0 && globalObserver) {\n globalObserver.disconnect();\n globalObserver = null;\n }\n}\n\ninterface ClassesOptions {\n elementRef?: ElementRef<HTMLElement>;\n injector?: Injector;\n}\n\nconst classListCache = new Map<string, string[]>();\n\nfunction toClassList(className: string | ClassValue[]): string[] {\n if (typeof className === 'string' && classListCache.has(className)) {\n return classListCache.get(className)!;\n }\n\n const result = clsx(className)\n .split(' ')\n .filter((cls) => cls.length > 0);\n\n if (typeof className === 'string' && classListCache.size < 1000) {\n classListCache.set(className, result);\n }\n\n return result;\n}\n","import { OVERLAY_DEFAULT_CONFIG } from '@angular/cdk/overlay';\nimport { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nexport function provideSpartanHlm(): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: OVERLAY_DEFAULT_CONFIG,\n useValue: { usePopover: false },\n },\n ]);\n}\n","/*\n * Public API Surface of utils\n */\n\nexport * from './lib/utils';\nexport * from './lib/provide-spartan-hlm';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAcM,SAAU,GAAG,CAAC,GAAG,MAAoB,EAAA;AACzC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B;AAEA,MAAM,oBAAoB,GAAG,IAAI,OAAO,EAAoC;AAC5E,IAAI,cAAc,GAA4B,IAAI;AAClD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAe;AAe/C,IAAI,aAAa,GAAG,CAAC;SAEL,OAAO,CAAC,QAAqC,EAAE,UAA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ies": {
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"module": "fesm2022/utils.mjs",
|
|
14
|
+
"typings": "types/utils.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": {
|
|
17
|
+
"default": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./types/utils.d.ts",
|
|
21
|
+
"default": "./fesm2022/utils.mjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"type": "module"
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElementRef, Injector, EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { ClassValue } from 'clsx';
|
|
3
|
+
|
|
4
|
+
declare function hlm(...inputs: ClassValue[]): string;
|
|
5
|
+
declare function classes(computed: () => ClassValue[] | string, options?: ClassesOptions): void;
|
|
6
|
+
interface ClassesOptions {
|
|
7
|
+
elementRef?: ElementRef<HTMLElement>;
|
|
8
|
+
injector?: Injector;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare function provideSpartanHlm(): EnvironmentProviders;
|
|
12
|
+
|
|
13
|
+
export { classes, hlm, provideSpartanHlm };
|
package/autocomplete/index.d.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ElementRef, TemplateRef, ValueProvider } from '@angular/core';
|
|
3
|
-
import { BooleanInput } from '@angular/cdk/coercion';
|
|
4
|
-
import { ControlValueAccessor } from '@angular/forms';
|
|
5
|
-
import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
6
|
-
import { ClassValue } from 'clsx';
|
|
7
|
-
import * as i1 from '@spartan-ng/brain/autocomplete';
|
|
8
|
-
|
|
9
|
-
declare const HLM_AUTOCOMPLETE_VALUE_ACCESSOR: {
|
|
10
|
-
provide: _angular_core.InjectionToken<readonly ControlValueAccessor[]>;
|
|
11
|
-
useExisting: _angular_core.Type<any>;
|
|
12
|
-
multi: boolean;
|
|
13
|
-
};
|
|
14
|
-
declare class HlmAutocomplete<T> implements ControlValueAccessor {
|
|
15
|
-
private static _id;
|
|
16
|
-
private readonly _config;
|
|
17
|
-
private readonly _brnPopover;
|
|
18
|
-
private readonly _inputRef;
|
|
19
|
-
protected readonly _elementRef: ElementRef<any>;
|
|
20
|
-
readonly onSelect: _angular_core.InputSignal<((option: string) => void) | undefined>;
|
|
21
|
-
/** The user defined class */
|
|
22
|
-
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
23
|
-
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
24
|
-
/** Custom class for the autocomplete list. */
|
|
25
|
-
readonly autocompleteListClass: _angular_core.InputSignal<ClassValue>;
|
|
26
|
-
protected readonly _computedAutocompleteListClass: _angular_core.Signal<string>;
|
|
27
|
-
/** Custom class for the empty and loading state container. */
|
|
28
|
-
readonly autocompleteEmptyClass: _angular_core.InputSignal<ClassValue>;
|
|
29
|
-
protected readonly _computedAutocompleteEmptyClass: _angular_core.Signal<string>;
|
|
30
|
-
/** The list of filtered options to display in the autocomplete. */
|
|
31
|
-
readonly filteredOptions: _angular_core.InputSignal<T[]>;
|
|
32
|
-
/** The selected value. */
|
|
33
|
-
readonly value: _angular_core.InputSignal<T | undefined>;
|
|
34
|
-
protected readonly _value: _angular_core.WritableSignal<T | undefined>;
|
|
35
|
-
/** The search query. */
|
|
36
|
-
readonly search: _angular_core.InputSignal<string | undefined>;
|
|
37
|
-
protected readonly _search: _angular_core.WritableSignal<string>;
|
|
38
|
-
/** Function to transform an option value to a search string. Defaults to identity function for strings. */
|
|
39
|
-
readonly transformValueToSearch: _angular_core.InputSignal<(value: T, inputId: string) => string>;
|
|
40
|
-
/** Optional template for rendering each option. */
|
|
41
|
-
readonly optionTemplate: _angular_core.InputSignal<TemplateRef<HlmAutocompleteOption<T>> | undefined>;
|
|
42
|
-
/** Whether the autocomplete is in a loading state. */
|
|
43
|
-
readonly loading: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
44
|
-
/** Placeholder text for the input field. */
|
|
45
|
-
readonly searchPlaceholderText: _angular_core.InputSignal<string>;
|
|
46
|
-
/** Text to display when loading options. */
|
|
47
|
-
readonly loadingText: _angular_core.InputSignal<string>;
|
|
48
|
-
/** Text to display when no options are found. */
|
|
49
|
-
readonly emptyText: _angular_core.InputSignal<string>;
|
|
50
|
-
/** Aria label for the toggle button. */
|
|
51
|
-
readonly ariaLabelToggleButton: _angular_core.InputSignal<string>;
|
|
52
|
-
/** The id of the input field. */
|
|
53
|
-
readonly inputId: _angular_core.InputSignal<string>;
|
|
54
|
-
/** Whether the autocomplete is disabled. */
|
|
55
|
-
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
56
|
-
protected readonly _disabled: _angular_core.WritableSignal<boolean>;
|
|
57
|
-
/** Emitted when the selected value changes. */
|
|
58
|
-
readonly valueChange: _angular_core.OutputEmitterRef<T | null>;
|
|
59
|
-
/** Emitted when the search query changes. */
|
|
60
|
-
readonly searchChange: _angular_core.OutputEmitterRef<string>;
|
|
61
|
-
protected _onChange?: ChangeFn<T | null>;
|
|
62
|
-
protected _onTouched?: TouchFn;
|
|
63
|
-
protected _setPopoverState(state: 'open' | 'closed'): void;
|
|
64
|
-
protected _click(): void;
|
|
65
|
-
protected _openPopover(): void;
|
|
66
|
-
protected _toggleOptions(): void;
|
|
67
|
-
protected _onSearchChanged(event: Event): void;
|
|
68
|
-
protected _clearOption(): void;
|
|
69
|
-
protected _optionSelected(option: T): void;
|
|
70
|
-
clearText(): void;
|
|
71
|
-
setPopoverState(state: 'open' | 'closed'): void;
|
|
72
|
-
/** CONTROL VALUE ACCESSOR */
|
|
73
|
-
writeValue(value: T | null): void;
|
|
74
|
-
registerOnChange(fn: ChangeFn<T | null>): void;
|
|
75
|
-
registerOnTouched(fn: TouchFn): void;
|
|
76
|
-
setDisabledState(isDisabled: boolean): void;
|
|
77
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocomplete<any>, never>;
|
|
78
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocomplete<any>, "hlm-autocomplete", never, { "onSelect": { "alias": "onSelect"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "autocompleteListClass": { "alias": "autocompleteListClass"; "required": false; "isSignal": true; }; "autocompleteEmptyClass": { "alias": "autocompleteEmptyClass"; "required": false; "isSignal": true; }; "filteredOptions": { "alias": "filteredOptions"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "search": { "alias": "search"; "required": false; "isSignal": true; }; "transformValueToSearch": { "alias": "transformValueToSearch"; "required": false; "isSignal": true; }; "optionTemplate": { "alias": "optionTemplate"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "searchPlaceholderText": { "alias": "searchPlaceholderText"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "ariaLabelToggleButton": { "alias": "ariaLabelToggleButton"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "searchChange": "searchChange"; }, never, ["[loading]", "[empty]"], true, never>;
|
|
79
|
-
}
|
|
80
|
-
interface HlmAutocompleteOption<T> {
|
|
81
|
-
$implicit: T;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
declare class HlmAutocompleteEmpty {
|
|
85
|
-
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
86
|
-
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
87
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteEmpty, never>;
|
|
88
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HlmAutocompleteEmpty, "[hlmAutocompleteEmpty]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
declare class HlmAutocompleteGroup {
|
|
92
|
-
/** The user defined class */
|
|
93
|
-
readonly userClass: _angular_core.InputSignal<string>;
|
|
94
|
-
/** The styles to apply */
|
|
95
|
-
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
96
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteGroup, never>;
|
|
97
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocompleteGroup, "hlm-autocomplete-group", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnAutocompleteGroup; inputs: { "id": "id"; }; outputs: {}; }]>;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
declare class HlmAutocompleteItem {
|
|
101
|
-
/** The user defined class */
|
|
102
|
-
readonly userClass: _angular_core.InputSignal<string>;
|
|
103
|
-
/** The styles to apply */
|
|
104
|
-
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
105
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteItem, never>;
|
|
106
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocompleteItem, "button[hlm-autocomplete-item]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnAutocompleteItem; inputs: { "value": "value"; "disabled": "disabled"; "id": "id"; }; outputs: { "selected": "selected"; }; }]>;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
declare class HlmAutocompleteList {
|
|
110
|
-
/** The user defined class */
|
|
111
|
-
readonly userClass: _angular_core.InputSignal<string>;
|
|
112
|
-
/** The styles to apply */
|
|
113
|
-
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
114
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteList, never>;
|
|
115
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocompleteList, "hlm-autocomplete-list", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnAutocompleteList; inputs: { "id": "id"; }; outputs: {}; }]>;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
declare class HlmAutocompleteSearch {
|
|
119
|
-
/** The user defined class */
|
|
120
|
-
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
121
|
-
/** The styles to apply */
|
|
122
|
-
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
123
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteSearch, never>;
|
|
124
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocompleteSearch, "hlm-autocomplete-search", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
declare class HlmAutocompleteSearchInput {
|
|
128
|
-
/** The user defined class */
|
|
129
|
-
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
130
|
-
/** The styles to apply */
|
|
131
|
-
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
132
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteSearchInput, never>;
|
|
133
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocompleteSearchInput, "input[hlm-autocomplete-search-input]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.BrnAutocompleteSearchInput; inputs: { "value": "value"; }; outputs: {}; }]>;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
declare class HlmAutocompleteTrigger {
|
|
137
|
-
private readonly _host;
|
|
138
|
-
private readonly _brnDialog;
|
|
139
|
-
/** Whether the trigger is disabled. */
|
|
140
|
-
readonly disabledTrigger: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
141
|
-
constructor();
|
|
142
|
-
open(): void;
|
|
143
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteTrigger, never>;
|
|
144
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HlmAutocompleteTrigger, "[hlmAutocompleteTrigger]", never, { "disabledTrigger": { "alias": "disabledTrigger"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
type TransformValueToString<T> = (value: T, inputId: string) => string;
|
|
148
|
-
interface HlmAutocompleteConfig<T> {
|
|
149
|
-
transformValueToSearch: TransformValueToString<T>;
|
|
150
|
-
}
|
|
151
|
-
declare function provideHlmAutocompleteConfig<T>(config: Partial<HlmAutocompleteConfig<T>>): ValueProvider;
|
|
152
|
-
declare function injectHlmAutocompleteConfig<T>(): HlmAutocompleteConfig<T>;
|
|
153
|
-
|
|
154
|
-
declare const HlmAutocompleteImports: readonly [typeof HlmAutocomplete, typeof HlmAutocompleteEmpty, typeof HlmAutocompleteGroup, typeof HlmAutocompleteItem, typeof HlmAutocompleteList, typeof HlmAutocompleteSearch, typeof HlmAutocompleteSearchInput, typeof HlmAutocompleteTrigger];
|
|
155
|
-
declare class HlmAutocompleteModule {
|
|
156
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteModule, never>;
|
|
157
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmAutocompleteModule, never, [typeof HlmAutocomplete, typeof HlmAutocompleteEmpty, typeof HlmAutocompleteGroup, typeof HlmAutocompleteItem, typeof HlmAutocompleteList, typeof HlmAutocompleteSearch, typeof HlmAutocompleteSearchInput, typeof HlmAutocompleteTrigger], [typeof HlmAutocomplete, typeof HlmAutocompleteEmpty, typeof HlmAutocompleteGroup, typeof HlmAutocompleteItem, typeof HlmAutocompleteList, typeof HlmAutocompleteSearch, typeof HlmAutocompleteSearchInput, typeof HlmAutocompleteTrigger]>;
|
|
158
|
-
static ɵinj: _angular_core.ɵɵInjectorDeclaration<HlmAutocompleteModule>;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export { HLM_AUTOCOMPLETE_VALUE_ACCESSOR, HlmAutocomplete, HlmAutocompleteEmpty, HlmAutocompleteGroup, HlmAutocompleteImports, HlmAutocompleteItem, HlmAutocompleteList, HlmAutocompleteModule, HlmAutocompleteSearch, HlmAutocompleteSearchInput, HlmAutocompleteTrigger, injectHlmAutocompleteConfig, provideHlmAutocompleteConfig };
|
|
162
|
-
export type { HlmAutocompleteConfig, HlmAutocompleteOption, TransformValueToString };
|
package/calendar/index.d.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import * as _spartan_ng_brain_date_time from '@spartan-ng/brain/date-time';
|
|
2
|
-
import * as _spartan_ng_brain_calendar from '@spartan-ng/brain/calendar';
|
|
3
|
-
import { Weekday } from '@spartan-ng/brain/calendar';
|
|
4
|
-
import * as _angular_core from '@angular/core';
|
|
5
|
-
import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
|
|
6
|
-
import { ClassValue } from 'clsx';
|
|
7
|
-
|
|
8
|
-
declare class HlmCalendar<T> {
|
|
9
|
-
readonly calendarClass: _angular_core.InputSignal<ClassValue>;
|
|
10
|
-
protected readonly _computedCalenderClass: _angular_core.Signal<string>;
|
|
11
|
-
/** Access the calendar i18n */
|
|
12
|
-
protected readonly _i18n: _spartan_ng_brain_calendar.BrnCalendarI18nService;
|
|
13
|
-
/** Access the date time adapter */
|
|
14
|
-
protected readonly _dateAdapter: _spartan_ng_brain_date_time.BrnDateAdapter<T>;
|
|
15
|
-
/** The minimum date that can be selected.*/
|
|
16
|
-
readonly min: _angular_core.InputSignal<T | undefined>;
|
|
17
|
-
/** The maximum date that can be selected. */
|
|
18
|
-
readonly max: _angular_core.InputSignal<T | undefined>;
|
|
19
|
-
/** Determine if the date picker is disabled. */
|
|
20
|
-
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
21
|
-
/** The selected value. */
|
|
22
|
-
readonly date: _angular_core.ModelSignal<T | undefined>;
|
|
23
|
-
/** Whether a specific date is disabled. */
|
|
24
|
-
readonly dateDisabled: _angular_core.InputSignal<(date: T) => boolean>;
|
|
25
|
-
/** The day the week starts on */
|
|
26
|
-
readonly weekStartsOn: _angular_core.InputSignalWithTransform<Weekday | undefined, NumberInput>;
|
|
27
|
-
/** The default focused date. */
|
|
28
|
-
readonly defaultFocusedDate: _angular_core.InputSignal<T | undefined>;
|
|
29
|
-
/** Access the calendar directive */
|
|
30
|
-
private readonly _calendar;
|
|
31
|
-
/** Get the heading for the current month and year */
|
|
32
|
-
protected readonly _heading: _angular_core.Signal<string>;
|
|
33
|
-
protected readonly _btnClass: string;
|
|
34
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmCalendar<any>, never>;
|
|
35
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmCalendar<any>, "hlm-calendar", never, { "calendarClass": { "alias": "calendarClass"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "date": { "alias": "date"; "required": false; "isSignal": true; }; "dateDisabled": { "alias": "dateDisabled"; "required": false; "isSignal": true; }; "weekStartsOn": { "alias": "weekStartsOn"; "required": false; "isSignal": true; }; "defaultFocusedDate": { "alias": "defaultFocusedDate"; "required": false; "isSignal": true; }; }, { "date": "dateChange"; }, never, never, true, never>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
declare class HlmCalendarMulti<T> {
|
|
39
|
-
readonly calendarClass: _angular_core.InputSignal<ClassValue>;
|
|
40
|
-
protected readonly _computedCalenderClass: _angular_core.Signal<string>;
|
|
41
|
-
/** Access the calendar i18n */
|
|
42
|
-
protected readonly _i18n: _spartan_ng_brain_calendar.BrnCalendarI18nService;
|
|
43
|
-
/** Access the date time adapter */
|
|
44
|
-
protected readonly _dateAdapter: _spartan_ng_brain_date_time.BrnDateAdapter<T>;
|
|
45
|
-
/** The minimum date that can be selected.*/
|
|
46
|
-
readonly min: _angular_core.InputSignal<T | undefined>;
|
|
47
|
-
/** The maximum date that can be selected. */
|
|
48
|
-
readonly max: _angular_core.InputSignal<T | undefined>;
|
|
49
|
-
/** The minimum selectable dates. */
|
|
50
|
-
readonly minSelection: _angular_core.InputSignalWithTransform<number | undefined, NumberInput>;
|
|
51
|
-
/** The maximum selectable dates. */
|
|
52
|
-
readonly maxSelection: _angular_core.InputSignalWithTransform<number | undefined, NumberInput>;
|
|
53
|
-
/** Determine if the date picker is disabled. */
|
|
54
|
-
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
55
|
-
/** The selected value. */
|
|
56
|
-
readonly date: _angular_core.ModelSignal<T[] | undefined>;
|
|
57
|
-
/** Whether a specific date is disabled. */
|
|
58
|
-
readonly dateDisabled: _angular_core.InputSignal<(date: T) => boolean>;
|
|
59
|
-
/** The day the week starts on */
|
|
60
|
-
readonly weekStartsOn: _angular_core.InputSignalWithTransform<Weekday | undefined, NumberInput>;
|
|
61
|
-
/** The default focused date. */
|
|
62
|
-
readonly defaultFocusedDate: _angular_core.InputSignal<T | undefined>;
|
|
63
|
-
/** Access the calendar directive */
|
|
64
|
-
private readonly _calendar;
|
|
65
|
-
/** Get the heading for the current month and year */
|
|
66
|
-
protected readonly _heading: _angular_core.Signal<string>;
|
|
67
|
-
protected readonly _btnClass: string;
|
|
68
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmCalendarMulti<any>, never>;
|
|
69
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmCalendarMulti<any>, "hlm-calendar-multi", never, { "calendarClass": { "alias": "calendarClass"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "minSelection": { "alias": "minSelection"; "required": false; "isSignal": true; }; "maxSelection": { "alias": "maxSelection"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "date": { "alias": "date"; "required": false; "isSignal": true; }; "dateDisabled": { "alias": "dateDisabled"; "required": false; "isSignal": true; }; "weekStartsOn": { "alias": "weekStartsOn"; "required": false; "isSignal": true; }; "defaultFocusedDate": { "alias": "defaultFocusedDate"; "required": false; "isSignal": true; }; }, { "date": "dateChange"; }, never, never, true, never>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
declare class HlmCalendarRange<T> {
|
|
73
|
-
readonly calendarClass: _angular_core.InputSignal<ClassValue>;
|
|
74
|
-
protected readonly _computedCalenderClass: _angular_core.Signal<string>;
|
|
75
|
-
/** Access the calendar i18n */
|
|
76
|
-
protected readonly _i18n: _spartan_ng_brain_calendar.BrnCalendarI18nService;
|
|
77
|
-
/** Access the date time adapter */
|
|
78
|
-
protected readonly _dateAdapter: _spartan_ng_brain_date_time.BrnDateAdapter<T>;
|
|
79
|
-
/** The minimum date that can be selected.*/
|
|
80
|
-
readonly min: _angular_core.InputSignal<T | undefined>;
|
|
81
|
-
/** The maximum date that can be selected. */
|
|
82
|
-
readonly max: _angular_core.InputSignal<T | undefined>;
|
|
83
|
-
/** Determine if the date picker is disabled. */
|
|
84
|
-
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
85
|
-
/** The start date of the range. */
|
|
86
|
-
readonly startDate: _angular_core.ModelSignal<T | undefined>;
|
|
87
|
-
/** The end date of the range. */
|
|
88
|
-
readonly endDate: _angular_core.ModelSignal<T | undefined>;
|
|
89
|
-
/** Whether a specific date is disabled. */
|
|
90
|
-
readonly dateDisabled: _angular_core.InputSignal<(date: T) => boolean>;
|
|
91
|
-
/** The day the week starts on */
|
|
92
|
-
readonly weekStartsOn: _angular_core.InputSignalWithTransform<Weekday | undefined, NumberInput>;
|
|
93
|
-
/** The default focused date. */
|
|
94
|
-
readonly defaultFocusedDate: _angular_core.InputSignal<T | undefined>;
|
|
95
|
-
/** Access the calendar directive */
|
|
96
|
-
private readonly _calendar;
|
|
97
|
-
/** Get the heading for the current month and year */
|
|
98
|
-
protected readonly _heading: _angular_core.Signal<string>;
|
|
99
|
-
protected readonly _btnClass: string;
|
|
100
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmCalendarRange<any>, never>;
|
|
101
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmCalendarRange<any>, "hlm-calendar-range", never, { "calendarClass": { "alias": "calendarClass"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "startDate": { "alias": "startDate"; "required": false; "isSignal": true; }; "endDate": { "alias": "endDate"; "required": false; "isSignal": true; }; "dateDisabled": { "alias": "dateDisabled"; "required": false; "isSignal": true; }; "weekStartsOn": { "alias": "weekStartsOn"; "required": false; "isSignal": true; }; "defaultFocusedDate": { "alias": "defaultFocusedDate"; "required": false; "isSignal": true; }; }, { "startDate": "startDateChange"; "endDate": "endDateChange"; }, never, never, true, never>;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
declare const HlmCalendarImports: readonly [typeof HlmCalendar, typeof HlmCalendarMulti, typeof HlmCalendarRange];
|
|
105
|
-
declare class HlmCalendarModule {
|
|
106
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmCalendarModule, never>;
|
|
107
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmCalendarModule, never, [typeof HlmCalendar, typeof HlmCalendarMulti, typeof HlmCalendarRange], [typeof HlmCalendar, typeof HlmCalendarMulti, typeof HlmCalendarRange]>;
|
|
108
|
-
static ɵinj: _angular_core.ɵɵInjectorDeclaration<HlmCalendarModule>;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export { HlmCalendar, HlmCalendarImports, HlmCalendarModule, HlmCalendarMulti, HlmCalendarRange };
|