@nanahoshi/mona-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +590 -0
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +168 -0
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +220 -0
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +225 -0
- package/fesm2022/nanahoshi-mona-ui-button.mjs +497 -0
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +1569 -0
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +339 -0
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +453 -0
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +200 -0
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +853 -0
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +923 -0
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +495 -0
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +686 -0
- package/fesm2022/nanahoshi-mona-ui-common.mjs +642 -0
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +485 -0
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +132 -0
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +460 -0
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +659 -0
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +828 -0
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +523 -0
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +615 -0
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +701 -0
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +1400 -0
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +245 -0
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +170 -0
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +680 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs +105 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs +42 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +130 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs +773 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +240 -0
- package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs +5374 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +87 -0
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +154 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1356 -0
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2263 -0
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +379 -0
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +630 -0
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +527 -0
- package/fesm2022/nanahoshi-mona-ui-list.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +966 -0
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +641 -0
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +536 -0
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +597 -0
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +790 -0
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +83 -0
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +325 -0
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +1559 -0
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +1321 -0
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +294 -0
- package/fesm2022/nanahoshi-mona-ui-query.mjs +175 -0
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +339 -0
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +565 -0
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +1049 -0
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +636 -0
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +843 -0
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +537 -0
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +308 -0
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +664 -0
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +111 -0
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +369 -0
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +314 -0
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +450 -0
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +723 -0
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +716 -0
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +733 -0
- package/fesm2022/nanahoshi-mona-ui-window.mjs +1329 -0
- package/fesm2022/nanahoshi-mona-ui.mjs +9 -0
- package/package.json +289 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +223 -0
- package/types/nanahoshi-mona-ui-avatar.d.ts +642 -0
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +70 -0
- package/types/nanahoshi-mona-ui-button-group.d.ts +77 -0
- package/types/nanahoshi-mona-ui-button.d.ts +111 -0
- package/types/nanahoshi-mona-ui-calendar.d.ts +262 -0
- package/types/nanahoshi-mona-ui-check-box.d.ts +133 -0
- package/types/nanahoshi-mona-ui-chip.d.ts +130 -0
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +113 -0
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +201 -0
- package/types/nanahoshi-mona-ui-color-palette.d.ts +102 -0
- package/types/nanahoshi-mona-ui-color-picker.d.ts +156 -0
- package/types/nanahoshi-mona-ui-combo-box.d.ts +232 -0
- package/types/nanahoshi-mona-ui-common.d.ts +386 -0
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +129 -0
- package/types/nanahoshi-mona-ui-date-input.d.ts +60 -0
- package/types/nanahoshi-mona-ui-date-picker.d.ts +177 -0
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +199 -0
- package/types/nanahoshi-mona-ui-dialog.d.ts +261 -0
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +159 -0
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +219 -0
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +176 -0
- package/types/nanahoshi-mona-ui-editor.d.ts +113 -0
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +87 -0
- package/types/nanahoshi-mona-ui-fieldset.d.ts +68 -0
- package/types/nanahoshi-mona-ui-filter.d.ts +115 -0
- package/types/nanahoshi-mona-ui-grid.d.ts +1114 -0
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +25 -0
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +28 -0
- package/types/nanahoshi-mona-ui-internal-list.d.ts +269 -0
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +391 -0
- package/types/nanahoshi-mona-ui-internal.d.ts +136 -0
- package/types/nanahoshi-mona-ui-list-box.d.ts +225 -0
- package/types/nanahoshi-mona-ui-list-view.d.ts +188 -0
- package/types/nanahoshi-mona-ui-list.d.ts +1 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +198 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +247 -0
- package/types/nanahoshi-mona-ui-notification.d.ts +106 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +161 -0
- package/types/nanahoshi-mona-ui-pager.d.ts +238 -0
- package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -0
- package/types/nanahoshi-mona-ui-popover.d.ts +130 -0
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +412 -0
- package/types/nanahoshi-mona-ui-popup.d.ts +485 -0
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +139 -0
- package/types/nanahoshi-mona-ui-query.d.ts +89 -0
- package/types/nanahoshi-mona-ui-radio-button.d.ts +128 -0
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +166 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +305 -0
- package/types/nanahoshi-mona-ui-split-button.d.ts +182 -0
- package/types/nanahoshi-mona-ui-splitter.d.ts +70 -0
- package/types/nanahoshi-mona-ui-stepper.d.ts +173 -0
- package/types/nanahoshi-mona-ui-switch.d.ts +125 -0
- package/types/nanahoshi-mona-ui-tabs.d.ts +158 -0
- package/types/nanahoshi-mona-ui-text-area.d.ts +42 -0
- package/types/nanahoshi-mona-ui-text-box.d.ts +164 -0
- package/types/nanahoshi-mona-ui-theme.d.ts +23 -0
- package/types/nanahoshi-mona-ui-time-picker.d.ts +184 -0
- package/types/nanahoshi-mona-ui-time-selector.d.ts +143 -0
- package/types/nanahoshi-mona-ui-tooltip.d.ts +130 -0
- package/types/nanahoshi-mona-ui-tree-view.d.ts +274 -0
- package/types/nanahoshi-mona-ui-window.d.ts +295 -0
- package/types/nanahoshi-mona-ui.d.ts +2 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { C as CellEditEvent, w as GridAddCommandDirective, x as GridAddEvent, y as GridCancelCommandDirective, z as GridCancelEvent, A as GridCellTemplateDirective, B as GridColumnComponent, D as GridColumnTitleTemplateDirective, E as GridCommandColumnComponent, F as GridComponent, H as GridContextMenuDirective, I as GridDetailTemplateDirective, J as GridEditCommandDirective, K as GridEditEvent, L as GridEditTemplateDirective, M as GridEditableDirective, N as GridExportDirective, O as GridFilterableDirective, P as GridFooterTemplateDirective, Q as GridGroupFooterTemplateDirective, R as GridGroupableDirective, S as GridHeaderTemplateDirective, T as GridNoDataTemplateDirective, U as GridRemoveCommandDirective, V as GridRemoveEvent, W as GridReorderableDirective, X as GridResizableDirective, Y as GridSaveCommandDirective, Z as GridSaveEvent, _ as GridSelectableDirective, $ as GridSortableDirective, a0 as GridStatePersistenceDirective, a1 as GridToolbarTemplateDirective, a2 as GridVirtualScrollDirective, a3 as RowEditEvent } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs';
|
|
2
|
+
//# sourceMappingURL=nanahoshi-mona-ui-grid.mjs.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, DestroyRef, ElementRef, signal, input, output, effect, untracked, afterNextRender, Component } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
5
|
+
import { FormsModule } from '@angular/forms';
|
|
6
|
+
import { FilterChangeEvent } from '@nanahoshi/mona-ui/common';
|
|
7
|
+
import { TextBoxComponent, TextBoxPrefixTemplateDirective } from '@nanahoshi/mona-ui/text-box';
|
|
8
|
+
import { Subject, fromEvent, debounceTime } from 'rxjs';
|
|
9
|
+
|
|
10
|
+
class FilterInputComponent {
|
|
11
|
+
#destroyRef;
|
|
12
|
+
#hostElementRef;
|
|
13
|
+
constructor() {
|
|
14
|
+
this.#destroyRef = inject(DestroyRef);
|
|
15
|
+
this.#hostElementRef = inject((ElementRef));
|
|
16
|
+
this.filter$ = new Subject();
|
|
17
|
+
this.filterText = signal("", /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "filterText" }] : /* istanbul ignore next */ []));
|
|
19
|
+
this.debounce = input(0, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "debounce" }] : /* istanbul ignore next */ []));
|
|
21
|
+
this.filter = input("", /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
23
|
+
this.filterChange = output();
|
|
24
|
+
this.inputBlur = output();
|
|
25
|
+
this.inputFocus = output();
|
|
26
|
+
this.placeholder = input("", /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.size = input("medium", /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
30
|
+
effect(() => {
|
|
31
|
+
const filter = this.filter();
|
|
32
|
+
untracked(() => this.filterText.set(filter));
|
|
33
|
+
});
|
|
34
|
+
afterNextRender({
|
|
35
|
+
read: () => {
|
|
36
|
+
const input = this.#hostElementRef.nativeElement.querySelector("input");
|
|
37
|
+
input.focus();
|
|
38
|
+
fromEvent(input, "keydown")
|
|
39
|
+
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
40
|
+
.subscribe((event) => {
|
|
41
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
const input = event.target;
|
|
44
|
+
input.selectionStart = input.selectionEnd = input.value.length;
|
|
45
|
+
}
|
|
46
|
+
else if (event.key !== "Escape" && event.key !== "Enter") {
|
|
47
|
+
event.stopPropagation();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
focus() {
|
|
54
|
+
const input = this.#hostElementRef.nativeElement.querySelector("input");
|
|
55
|
+
input.focus();
|
|
56
|
+
}
|
|
57
|
+
ngOnInit() {
|
|
58
|
+
this.setSubscriptions();
|
|
59
|
+
}
|
|
60
|
+
setSubscriptions() {
|
|
61
|
+
this.filter$.pipe(debounceTime(this.debounce()), takeUntilDestroyed(this.#destroyRef)).subscribe(value => {
|
|
62
|
+
const event = new FilterChangeEvent(value);
|
|
63
|
+
this.filterChange.emit(event);
|
|
64
|
+
if (!event.isDefaultPrevented()) {
|
|
65
|
+
this.filterText.set(value);
|
|
66
|
+
}
|
|
67
|
+
this.focus();
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FilterInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
71
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: FilterInputComponent, isStandalone: true, selector: "mona-filter-input", inputs: { debounce: { classPropertyName: "debounce", publicName: "debounce", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange", inputBlur: "inputBlur", inputFocus: "inputFocus" }, ngImport: i0, template: "<mona-text-box\n [ngModel]=\"filterText()\"\n [clearButton]=\"true\"\n [placeholder]=\"placeholder()\"\n (inputFocus)=\"inputFocus.emit($event)\"\n (inputBlur)=\"inputBlur.emit($event)\"\n [tabindex]=\"0\"\n [size]=\"size()\"\n class=\"outline-none shadow-none focus-within:ring-1 focus-within:ring-primary/40\"\n (ngModelChange)=\"filter$.next($event)\">\n <ng-template monaTextBoxPrefixTemplate>\n <div class=\"h-full flex items-center justify-center ps-2\">\n <i class=\"ri-search-line\"></i>\n </div>\n </ng-template>\n</mona-text-box>\n", dependencies: [{ kind: "component", type: TextBoxComponent, selector: "mona-text-box", inputs: ["clearButton", "disabled", "inputAttributes", "inputClass", "inputStyle", "invalid", "placeholder", "readonly", "required", "rounded", "size", "touched", "type", "class", "value"], outputs: ["inputBlur", "inputFocus", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TextBoxPrefixTemplateDirective, selector: "ng-template[monaTextBoxPrefixTemplate]" }] }); }
|
|
72
|
+
}
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FilterInputComponent, decorators: [{
|
|
74
|
+
type: Component,
|
|
75
|
+
args: [{ selector: "mona-filter-input", imports: [TextBoxComponent, FormsModule, TextBoxPrefixTemplateDirective], template: "<mona-text-box\n [ngModel]=\"filterText()\"\n [clearButton]=\"true\"\n [placeholder]=\"placeholder()\"\n (inputFocus)=\"inputFocus.emit($event)\"\n (inputBlur)=\"inputBlur.emit($event)\"\n [tabindex]=\"0\"\n [size]=\"size()\"\n class=\"outline-none shadow-none focus-within:ring-1 focus-within:ring-primary/40\"\n (ngModelChange)=\"filter$.next($event)\">\n <ng-template monaTextBoxPrefixTemplate>\n <div class=\"h-full flex items-center justify-center ps-2\">\n <i class=\"ri-search-line\"></i>\n </div>\n </ng-template>\n</mona-text-box>\n" }]
|
|
76
|
+
}], ctorParameters: () => [], propDecorators: { debounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounce", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
* Public API Surface of @nanahoshi/mona-ui/filter-input
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Generated bundle index. Do not edit.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
export { FilterInputComponent };
|
|
87
|
+
//# sourceMappingURL=nanahoshi-mona-ui-internal-filter-input.mjs.map
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, computed, signal, viewChild, output, input, afterRenderEffect, untracked, Component } from '@angular/core';
|
|
3
|
+
import { LucideLoader, LucideChevronDown, LucideX, LucideDynamicIcon } from '@lucide/angular';
|
|
4
|
+
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { cva } from 'class-variance-authority';
|
|
7
|
+
|
|
8
|
+
const indicatorIconHostVariants = cva(`h-full aspect-square flex-none inline-flex items-center justify-center self-stretch`, {
|
|
9
|
+
variants: {
|
|
10
|
+
interactive: {
|
|
11
|
+
true: "opacity-50 hover:opacity-90 focus:ring-1 focus:ring-primary/40 focus:outline-none",
|
|
12
|
+
false: ""
|
|
13
|
+
},
|
|
14
|
+
preset: {
|
|
15
|
+
clear: "",
|
|
16
|
+
dropdown: "opacity-50",
|
|
17
|
+
loading: ""
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
interactive: false
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const indicatorIconSvgVariants = cva(``, {
|
|
25
|
+
variants: {
|
|
26
|
+
loading: {
|
|
27
|
+
true: "animate-[spin_2s_linear_infinite]",
|
|
28
|
+
false: ""
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
loading: false
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const indicatorIconHostThemeVariants = (theme) => {
|
|
37
|
+
switch (theme) {
|
|
38
|
+
case "mona":
|
|
39
|
+
return indicatorIconHostVariants;
|
|
40
|
+
default:
|
|
41
|
+
return indicatorIconHostVariants;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const indicatorIconSvgThemeVariants = (theme) => {
|
|
45
|
+
switch (theme) {
|
|
46
|
+
case "mona":
|
|
47
|
+
return indicatorIconSvgVariants;
|
|
48
|
+
default:
|
|
49
|
+
return indicatorIconSvgVariants;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
class IndicatorIconComponent {
|
|
54
|
+
#themeService;
|
|
55
|
+
constructor() {
|
|
56
|
+
this.#themeService = inject(ThemeService);
|
|
57
|
+
this.baseClass = computed(() => {
|
|
58
|
+
const theme = this.#themeService.theme();
|
|
59
|
+
const interactive = this.interactive();
|
|
60
|
+
const preset = this.preset();
|
|
61
|
+
return twMerge(indicatorIconHostThemeVariants(theme)({ interactive, preset }), this.userClass());
|
|
62
|
+
}, /* @ts-ignore */
|
|
63
|
+
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
64
|
+
this.hasProjectedContent = signal(false, /* @ts-ignore */
|
|
65
|
+
...(ngDevMode ? [{ debugName: "hasProjectedContent" }] : /* istanbul ignore next */ []));
|
|
66
|
+
this.iconClass = computed(() => {
|
|
67
|
+
const theme = this.#themeService.theme();
|
|
68
|
+
const loading = this.preset() === "loading";
|
|
69
|
+
return indicatorIconSvgThemeVariants(theme)({ loading });
|
|
70
|
+
}, /* @ts-ignore */
|
|
71
|
+
...(ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []));
|
|
72
|
+
this.iconToRender = computed(() => {
|
|
73
|
+
switch (this.preset()) {
|
|
74
|
+
case "clear":
|
|
75
|
+
return LucideX;
|
|
76
|
+
case "dropdown":
|
|
77
|
+
return LucideChevronDown;
|
|
78
|
+
case "loading":
|
|
79
|
+
return LucideLoader;
|
|
80
|
+
default:
|
|
81
|
+
return this.icon();
|
|
82
|
+
}
|
|
83
|
+
}, /* @ts-ignore */
|
|
84
|
+
...(ngDevMode ? [{ debugName: "iconToRender" }] : /* istanbul ignore next */ []));
|
|
85
|
+
this.projectedContent = viewChild("projectedContent", /* @ts-ignore */
|
|
86
|
+
...(ngDevMode ? [{ debugName: "projectedContent" }] : /* istanbul ignore next */ []));
|
|
87
|
+
this.activate = output();
|
|
88
|
+
this.icon = input(null, /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
90
|
+
this.interactive = input(false, /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "interactive" }] : /* istanbul ignore next */ []));
|
|
92
|
+
this.label = input("", /* @ts-ignore */
|
|
93
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
94
|
+
this.preset = input(null, /* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [{ debugName: "preset" }] : /* istanbul ignore next */ []));
|
|
96
|
+
this.size = input(16, /* @ts-ignore */
|
|
97
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
98
|
+
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
99
|
+
afterRenderEffect({
|
|
100
|
+
read: () => {
|
|
101
|
+
const element = this.projectedContent();
|
|
102
|
+
const hasContent = element ? this.hasContent(element.nativeElement) : false;
|
|
103
|
+
untracked(() => {
|
|
104
|
+
if (this.hasProjectedContent() !== hasContent) {
|
|
105
|
+
this.hasProjectedContent.set(hasContent);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
onActivate(event) {
|
|
112
|
+
if (!this.interactive()) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
event.stopImmediatePropagation();
|
|
117
|
+
this.activate.emit(event);
|
|
118
|
+
}
|
|
119
|
+
hasContent(element) {
|
|
120
|
+
return Array.from(element.childNodes).some(node => {
|
|
121
|
+
if (node.nodeType === Node.COMMENT_NODE) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
return node.nodeType !== Node.TEXT_NODE || !!node.textContent?.trim();
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: IndicatorIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
128
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: IndicatorIconComponent, isStandalone: true, selector: "mona-indicator-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, preset: { classPropertyName: "preset", publicName: "preset", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activate: "activate" }, host: { listeners: { "click": "onActivate($event)", "keydown.enter": "onActivate($event)", "keydown.space": "onActivate($event)" }, properties: { "attr.aria-hidden": "interactive() ? null : true", "attr.aria-label": "interactive() ? label() || null : null", "attr.role": "interactive() ? 'button' : null", "attr.tabindex": "interactive() ? 0 : null", "attr.title": "interactive() ? label() || null : null", "class": "baseClass()" } }, viewQueries: [{ propertyName: "projectedContent", first: true, predicate: ["projectedContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<span #projectedContent class=\"contents\">\n <ng-content></ng-content>\n</span>\n\n@let renderedIcon = iconToRender();\n@if (!hasProjectedContent() && renderedIcon) {\n <svg [lucideIcon]=\"renderedIcon\" [size]=\"size()\" [class]=\"iconClass()\"></svg>\n}\n", dependencies: [{ kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }] }); }
|
|
129
|
+
}
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: IndicatorIconComponent, decorators: [{
|
|
131
|
+
type: Component,
|
|
132
|
+
args: [{ selector: "mona-indicator-icon", imports: [LucideDynamicIcon], host: {
|
|
133
|
+
"[attr.aria-hidden]": "interactive() ? null : true",
|
|
134
|
+
"[attr.aria-label]": "interactive() ? label() || null : null",
|
|
135
|
+
"[attr.role]": "interactive() ? 'button' : null",
|
|
136
|
+
"[attr.tabindex]": "interactive() ? 0 : null",
|
|
137
|
+
"[attr.title]": "interactive() ? label() || null : null",
|
|
138
|
+
"[class]": "baseClass()",
|
|
139
|
+
"(click)": "onActivate($event)",
|
|
140
|
+
"(keydown.enter)": "onActivate($event)",
|
|
141
|
+
"(keydown.space)": "onActivate($event)"
|
|
142
|
+
}, template: "<span #projectedContent class=\"contents\">\n <ng-content></ng-content>\n</span>\n\n@let renderedIcon = iconToRender();\n@if (!hasProjectedContent() && renderedIcon) {\n <svg [lucideIcon]=\"renderedIcon\" [size]=\"size()\" [class]=\"iconClass()\"></svg>\n}\n" }]
|
|
143
|
+
}], ctorParameters: () => [], propDecorators: { projectedContent: [{ type: i0.ViewChild, args: ["projectedContent", { isSignal: true }] }], activate: [{ type: i0.Output, args: ["activate"] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], preset: [{ type: i0.Input, args: [{ isSignal: true, alias: "preset", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
144
|
+
|
|
145
|
+
/*
|
|
146
|
+
* Public API Surface of @nanahoshi/mona-ui/indicator-icon
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Generated bundle index. Do not edit.
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
export { IndicatorIconComponent };
|
|
154
|
+
//# sourceMappingURL=nanahoshi-mona-ui-internal-indicator-icon.mjs.map
|