@nanahoshi/mona-ui 0.22.1 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1 -1
  2. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-CIMXz60d.mjs +169 -0
  3. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-CpeheGXU.mjs +176 -0
  4. package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DZDeYdqc.mjs → nanahoshi-mona-ui-grid-grid-row.component-B_5ay_Nz.mjs} +201 -192
  5. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-BzKywU5b.mjs +173 -0
  6. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C_mj53LF.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-IewqeT4m.mjs} +554 -667
  7. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  8. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +47 -7
  9. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +386 -180
  10. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +266 -99
  11. package/fesm2022/nanahoshi-mona-ui-internal.mjs +35 -32
  12. package/fesm2022/nanahoshi-mona-ui-locales.mjs +13 -0
  13. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +1 -1
  14. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1 -1
  15. package/package.json +1 -1
  16. package/types/nanahoshi-mona-ui-grid.d.ts +126 -26
  17. package/types/nanahoshi-mona-ui-i18n.d.ts +1 -0
  18. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +35 -1
  19. package/types/nanahoshi-mona-ui-internal-list.d.ts +82 -16
  20. package/types/nanahoshi-mona-ui-internal-tree.d.ts +50 -3
  21. package/types/nanahoshi-mona-ui-internal.d.ts +18 -4
  22. package/types/nanahoshi-mona-ui-locales.d.ts +13 -0
  23. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-cell.component-blRlw0Ie.mjs +0 -108
  24. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-Cviex3cR.mjs +0 -44
  25. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-H38ZTj-_.mjs +0 -164
  26. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-b1W7r45p.mjs +0 -239
@@ -1,2 +1,2 @@
1
- export { C as CellEditEvent, B as GRID_DEFAULT_MESSAGES, D as GridAddCommandDirective, E as GridAddEvent, F as GridCancelCommandDirective, H as GridCancelEvent, I as GridCellTemplateDirective, J as GridColumnComponent, K as GridColumnTitleTemplateDirective, L as GridCommandColumnComponent, M as GridComponent, N as GridContextMenuDirective, O as GridDetailTemplateDirective, P as GridEditCommandDirective, Q as GridEditEvent, R as GridEditTemplateDirective, S as GridEditableDirective, T as GridExportDirective, U as GridFilterableDirective, V as GridFooterTemplateDirective, W as GridGroupFooterTemplateDirective, X as GridGroupableDirective, Y as GridHeaderTemplateDirective, Z as GridNoDataTemplateDirective, _ as GridRemoveCommandDirective, $ as GridRemoveEvent, a0 as GridReorderableDirective, a1 as GridResizableDirective, a2 as GridRowReorderableDirective, a3 as GridSaveCommandDirective, a4 as GridSaveEvent, a5 as GridSelectableDirective, a6 as GridServerBindingDirective, a7 as GridSortableDirective, a8 as GridStatePersistenceDirective, a9 as GridToolbarTemplateDirective, aa as GridVirtualScrollDirective, ab as RowEditEvent, ac as RowReorderEvent } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C_mj53LF.mjs';
1
+ export { C as CellEditEvent, x as GRID_DEFAULT_MESSAGES, y as GridAddCommandDirective, z as GridAddEvent, A as GridCancelCommandDirective, B as GridCancelEvent, D as GridCellTemplateDirective, E as GridColumnComponent, F as GridColumnTitleTemplateDirective, H as GridCommandColumnComponent, I as GridComponent, J as GridContextMenuDirective, K as GridDetailTemplateDirective, L as GridEditCommandDirective, M as GridEditEvent, N as GridEditTemplateDirective, O as GridEditableDirective, P as GridExportDirective, Q as GridFilterableDirective, R as GridFooterTemplateDirective, S as GridGroupFooterTemplateDirective, T as GridGroupableDirective, U as GridHeaderTemplateDirective, V as GridNoDataTemplateDirective, W as GridRemoveCommandDirective, X as GridRemoveEvent, Y as GridReorderableDirective, Z as GridResizableDirective, _ as GridRowReorderableDirective, $ as GridSaveCommandDirective, a0 as GridSaveEvent, a1 as GridSelectableDirective, a2 as GridServerBindingDirective, a3 as GridSortableDirective, a4 as GridStatePersistenceDirective, a5 as GridToolbarTemplateDirective, a6 as GridVirtualScrollDirective, a7 as RowEditEvent, a8 as RowReorderEvent } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-IewqeT4m.mjs';
2
2
  //# sourceMappingURL=nanahoshi-mona-ui-grid.mjs.map
@@ -1,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, DestroyRef, ElementRef, signal, input, output, effect, untracked, afterNextRender, Component } from '@angular/core';
3
- import { LucideSearch } from '@lucide/angular';
2
+ import { inject, DestroyRef, ElementRef, signal, computed, input, output, effect, untracked, afterNextRender, Component } from '@angular/core';
4
3
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
4
  import * as i1 from '@angular/forms';
6
5
  import { FormsModule } from '@angular/forms';
6
+ import { LucideSearch } from '@lucide/angular';
7
7
  import { FilterChangeEvent } from '@nanahoshi/mona-ui/common';
8
8
  import { TextBoxComponent, TextBoxPrefixTemplateDirective } from '@nanahoshi/mona-ui/text-box';
9
- import { Subject, fromEvent, debounceTime } from 'rxjs';
9
+ import { Subject, fromEvent, debounce, timer } from 'rxjs';
10
10
 
11
11
  class FilterInputComponent {
12
12
  #destroyRef;
@@ -17,6 +17,44 @@ class FilterInputComponent {
17
17
  this.filter$ = new Subject();
18
18
  this.filterText = signal("", /* @ts-ignore */
19
19
  ...(ngDevMode ? [{ debugName: "filterText" }] : /* istanbul ignore next */ []));
20
+ /**
21
+ * When the input controls a list, it acts as a combobox (WAI-ARIA APG): focus stays in the input
22
+ * and the highlighted option is exposed through `aria-activedescendant`.
23
+ */
24
+ this.inputAttributes = computed(() => {
25
+ const controls = this.controls();
26
+ const ariaLabel = this.ariaLabel() || null;
27
+ if (!controls) {
28
+ return { "aria-label": ariaLabel };
29
+ }
30
+ return {
31
+ role: "combobox",
32
+ "aria-label": ariaLabel,
33
+ "aria-activedescendant": this.activeDescendant() || null,
34
+ "aria-autocomplete": "list",
35
+ "aria-controls": controls,
36
+ "aria-expanded": true
37
+ };
38
+ }, /* @ts-ignore */
39
+ ...(ngDevMode ? [{ debugName: "inputAttributes" }] : /* istanbul ignore next */ []));
40
+ /**
41
+ * @description Id of the highlighted option in the controlled list, exposed as `aria-activedescendant`.
42
+ * @default ""
43
+ */
44
+ this.activeDescendant = input("", /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
46
+ /**
47
+ * @description Accessible name of the input. The placeholder is not a reliable label, so set this whenever possible.
48
+ * @default ""
49
+ */
50
+ this.ariaLabel = input("", /* @ts-ignore */
51
+ ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
52
+ /**
53
+ * @description Id of the list this input filters. When set, the input is exposed as a combobox controlling it.
54
+ * @default ""
55
+ */
56
+ this.controls = input("", /* @ts-ignore */
57
+ ...(ngDevMode ? [{ debugName: "controls" }] : /* istanbul ignore next */ []));
20
58
  this.debounce = input(0, /* @ts-ignore */
21
59
  ...(ngDevMode ? [{ debugName: "debounce" }] : /* istanbul ignore next */ []));
22
60
  this.filter = input("", /* @ts-ignore */
@@ -59,7 +97,9 @@ class FilterInputComponent {
59
97
  this.setSubscriptions();
60
98
  }
61
99
  setSubscriptions() {
62
- this.filter$.pipe(debounceTime(this.debounce()), takeUntilDestroyed(this.#destroyRef)).subscribe(value => {
100
+ this.filter$
101
+ .pipe(debounce(() => timer(this.debounce())), takeUntilDestroyed(this.#destroyRef))
102
+ .subscribe(value => {
63
103
  const event = new FilterChangeEvent(value);
64
104
  this.filterChange.emit(event);
65
105
  if (!event.isDefaultPrevented()) {
@@ -69,12 +109,12 @@ class FilterInputComponent {
69
109
  });
70
110
  }
71
111
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FilterInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
72
- 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 <svg lucideSearch [size]=\"16\" aria-hidden=\"true\"></svg>\n </div>\n </ng-template>\n</mona-text-box>\n", dependencies: [{ kind: "component", type: LucideSearch, selector: "svg[lucideSearch]" }, { 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]" }] }); }
112
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: FilterInputComponent, isStandalone: true, selector: "mona-filter-input", inputs: { activeDescendant: { classPropertyName: "activeDescendant", publicName: "activeDescendant", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, 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 [inputAttributes]=\"inputAttributes()\"\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 <svg lucideSearch [size]=\"16\" aria-hidden=\"true\"></svg>\n </div>\n </ng-template>\n</mona-text-box>\n", dependencies: [{ kind: "component", type: LucideSearch, selector: "svg[lucideSearch]" }, { 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]" }] }); }
73
113
  }
74
114
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FilterInputComponent, decorators: [{
75
115
  type: Component,
76
- args: [{ selector: "mona-filter-input", imports: [LucideSearch, 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 <svg lucideSearch [size]=\"16\" aria-hidden=\"true\"></svg>\n </div>\n </ng-template>\n</mona-text-box>\n" }]
77
- }], 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 }] }] } });
116
+ args: [{ selector: "mona-filter-input", imports: [LucideSearch, 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 [inputAttributes]=\"inputAttributes()\"\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 <svg lucideSearch [size]=\"16\" aria-hidden=\"true\"></svg>\n </div>\n </ng-template>\n</mona-text-box>\n" }]
117
+ }], ctorParameters: () => [], propDecorators: { activeDescendant: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeDescendant", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], 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 }] }] } });
78
118
 
79
119
  /*
80
120
  * Public API Surface of @nanahoshi/mona-ui/filter-input