@nanahoshi/mona-ui 0.24.5 → 0.24.7

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 (78) hide show
  1. package/README.md +2 -0
  2. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +196 -137
  3. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +14 -4
  4. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +164 -3
  5. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +124 -140
  6. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +205 -202
  7. package/fesm2022/nanahoshi-mona-ui-filter.mjs +233 -231
  8. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-BMCM0W8s.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-vXXNWmEN.mjs} +24 -12
  9. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-DDgNmgE0.mjs +208 -0
  10. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-Dzf6Vbs_.mjs +1100 -0
  11. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-C2kf5MwO.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-DAPNqnWV.mjs} +34 -21
  12. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Dh42tUui.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-B9rmDLq8.mjs} +2564 -927
  13. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  14. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +39 -8
  15. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +1 -1
  16. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +3 -6
  17. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +33 -8
  18. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +33 -8
  19. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +33 -8
  20. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +33 -8
  21. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +33 -8
  22. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +33 -8
  23. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +33 -8
  24. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +33 -8
  25. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +33 -8
  26. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +33 -8
  27. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +33 -8
  28. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +33 -8
  29. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +33 -8
  30. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +195 -122
  31. package/fesm2022/nanahoshi-mona-ui-pager.mjs +367 -463
  32. package/fesm2022/nanahoshi-mona-ui-query.mjs +317 -122
  33. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +149 -167
  34. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +182 -137
  35. package/i18n/catalogs/en-US.messages.json +36 -11
  36. package/locales/ar-sa/ar-sa.messages.json +33 -8
  37. package/locales/de-de/de-de.messages.json +33 -8
  38. package/locales/es-es/es-es.messages.json +33 -8
  39. package/locales/fr-fr/fr-fr.messages.json +33 -8
  40. package/locales/id-id/id-id.messages.json +33 -8
  41. package/locales/it-it/it-it.messages.json +33 -8
  42. package/locales/ja-jp/ja-jp.messages.json +33 -8
  43. package/locales/ko-kr/ko-kr.messages.json +33 -8
  44. package/locales/pt-br/pt-br.messages.json +33 -8
  45. package/locales/ru-ru/ru-ru.messages.json +33 -8
  46. package/locales/tr-tr/tr-tr.messages.json +33 -8
  47. package/locales/zh-cn/zh-cn.messages.json +33 -8
  48. package/locales/zh-tw/zh-tw.messages.json +33 -8
  49. package/package.json +2 -2
  50. package/types/nanahoshi-mona-ui-calendar.d.ts +30 -11
  51. package/types/nanahoshi-mona-ui-check-box.d.ts +11 -1
  52. package/types/nanahoshi-mona-ui-date-input.d.ts +74 -3
  53. package/types/nanahoshi-mona-ui-date-picker.d.ts +61 -33
  54. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +79 -38
  55. package/types/nanahoshi-mona-ui-filter.d.ts +54 -32
  56. package/types/nanahoshi-mona-ui-grid.d.ts +359 -110
  57. package/types/nanahoshi-mona-ui-i18n.d.ts +47 -6
  58. package/types/nanahoshi-mona-ui-list-view.d.ts +1 -2
  59. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +31 -6
  60. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +31 -6
  61. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +31 -6
  62. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +31 -6
  63. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +31 -6
  64. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +31 -6
  65. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +31 -6
  66. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +31 -6
  67. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +31 -6
  68. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +31 -6
  69. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +31 -6
  70. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +31 -6
  71. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +31 -6
  72. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +57 -16
  73. package/types/nanahoshi-mona-ui-pager.d.ts +159 -76
  74. package/types/nanahoshi-mona-ui-query.d.ts +45 -14
  75. package/types/nanahoshi-mona-ui-time-picker.d.ts +72 -42
  76. package/types/nanahoshi-mona-ui-time-selector.d.ts +78 -46
  77. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-BSlV8Sua.mjs +0 -176
  78. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-CTOdnH29.mjs +0 -946
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, computed, input, Directive, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { a as GridService, v as gridFooterTableCellThemeVariants, w as gridFooterTableRowThemeVariants, m as GridLockedCellDirective } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Dh42tUui.mjs';
2
+ import { inject, computed, input, Directive, Component } from '@angular/core';
3
+ import { G as GridService, w as gridFooterTableCellThemeVariants, x as gridFooterTableRowThemeVariants, a as GridLockedCellDirective, k as GridLogicalCellDirective } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-B9rmDLq8.mjs';
4
4
  import { NgTemplateOutlet } from '@angular/common';
5
5
  import { ImmutableDictionary } from '@mirei/ts-collections';
6
6
 
@@ -118,10 +118,10 @@ class GridFooterCellComponent {
118
118
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridFooterCellComponent, isStandalone: true, selector: "mona-grid-footer-cell", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, columnIndex: { classPropertyName: "columnIndex", publicName: "columnIndex", isSignal: true, isRequired: true, transformFunction: null }, groupKey: { classPropertyName: "groupKey", publicName: "groupKey", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "flex items-center h-full" }, ngImport: i0, template: `
119
119
  @if (templateRef(); as templateRef) {
120
120
  <ng-container [ngTemplateOutlet]="templateRef" [ngTemplateOutletContext]="templateContext()"></ng-container>
121
- } @else if (displayValue() != null) {
121
+ } @else if (displayValue() !== null && displayValue() !== undefined) {
122
122
  <span class="block truncate font-medium">{{ displayValue() }}</span>
123
123
  }
124
- `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
124
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
125
125
  }
126
126
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFooterCellComponent, decorators: [{
127
127
  type: Component,
@@ -130,11 +130,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
130
130
  template: `
131
131
  @if (templateRef(); as templateRef) {
132
132
  <ng-container [ngTemplateOutlet]="templateRef" [ngTemplateOutletContext]="templateContext()"></ng-container>
133
- } @else if (displayValue() != null) {
133
+ } @else if (displayValue() !== null && displayValue() !== undefined) {
134
134
  <span class="block truncate font-medium">{{ displayValue() }}</span>
135
135
  }
136
136
  `,
137
- changeDetection: ChangeDetectionStrategy.OnPush,
138
137
  imports: [NgTemplateOutlet],
139
138
  host: {
140
139
  class: "flex items-center h-full"
@@ -151,19 +150,32 @@ class GridFooterRowComponent {
151
150
  this.gridService = inject(GridService);
152
151
  this.rowClass = computed(() => gridFooterTableRowThemeVariants({ virtual: this.gridService.virtualScrollOptions().enabled }), /* @ts-ignore */
153
152
  ...(ngDevMode ? [{ debugName: "rowClass" }] : /* istanbul ignore next */ []));
153
+ /** A group footer sits one level below its group header (treegrid). */
154
+ this.ariaLevel = input(null, /* @ts-ignore */
155
+ ...(ngDevMode ? [{ debugName: "ariaLevel" }] : /* istanbul ignore next */ []));
156
+ this.ariaRowIndex = input(null, /* @ts-ignore */
157
+ ...(ngDevMode ? [{ debugName: "ariaRowIndex" }] : /* istanbul ignore next */ []));
154
158
  this.groupKey = input(null, /* @ts-ignore */
155
159
  ...(ngDevMode ? [{ debugName: "groupKey" }] : /* istanbul ignore next */ []));
160
+ /** The row's place in its section: its body index for a group footer, 0 for the grid footer. */
161
+ this.rowIndex = input(0, /* @ts-ignore */
162
+ ...(ngDevMode ? [{ debugName: "rowIndex" }] : /* istanbul ignore next */ []));
163
+ /** Group footers are body rows; the grid footer is its own section after the body. */
164
+ this.section = input("footer", /* @ts-ignore */
165
+ ...(ngDevMode ? [{ debugName: "section" }] : /* istanbul ignore next */ []));
156
166
  }
157
167
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFooterRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
158
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridFooterRowComponent, isStandalone: true, selector: "tr[monaGridFooterRow]", inputs: { groupKey: { classPropertyName: "groupKey", publicName: "groupKey", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "row" }, properties: { "class": "rowClass()" } }, ngImport: i0, template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n <td\n monaGridFooterTableCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"layoutColumn.column\">\n <mona-grid-footer-cell\n [column]=\"layoutColumn.column\"\n [columnIndex]=\"layoutColumn.columnIndex\"\n [groupKey]=\"groupKey()\" />\n </td>\n } @else {\n <td\n monaGridFooterTableCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n [footerCellWidth]=\"layoutColumn.width\"></td>\n }\n}\n", dependencies: [{ kind: "component", type: GridFooterCellComponent, selector: "mona-grid-footer-cell", inputs: ["column", "columnIndex", "groupKey"] }, { kind: "directive", type: GridFooterTableCellDirective, selector: "td[monaGridFooterTableCell]", inputs: ["footerCellMinWidth", "footerCellWidth", "footerColumn"] }, { kind: "directive", type: GridLockedCellDirective, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: ["monaGridLockedCell", "lockedCellHeader"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
168
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridFooterRowComponent, isStandalone: true, selector: "tr[monaGridFooterRow]", inputs: { ariaLevel: { classPropertyName: "ariaLevel", publicName: "ariaLevel", isSignal: true, isRequired: false, transformFunction: null }, ariaRowIndex: { classPropertyName: "ariaRowIndex", publicName: "ariaRowIndex", isSignal: true, isRequired: false, transformFunction: null }, groupKey: { classPropertyName: "groupKey", publicName: "groupKey", isSignal: true, isRequired: false, transformFunction: null }, rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: true, isRequired: false, transformFunction: null }, section: { classPropertyName: "section", publicName: "section", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "row" }, properties: { "class": "rowClass()", "attr.aria-rowindex": "ariaRowIndex()", "attr.aria-level": "ariaLevel()" } }, ngImport: i0, template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n <td\n monaGridFooterTableCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"layoutColumn.column\"\n monaGridLogicalCell\n [cellKind]=\"'footer'\"\n [columnId]=\"layoutColumn.column.id\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"rowIndex()\"\n [section]=\"section()\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\">\n <mona-grid-footer-cell\n [column]=\"layoutColumn.column\"\n [columnIndex]=\"layoutColumn.columnIndex\"\n [groupKey]=\"groupKey()\" />\n </td>\n } @else {\n <td\n monaGridFooterTableCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n [footerCellWidth]=\"layoutColumn.width\"></td>\n }\n}\n", dependencies: [{ kind: "component", type: GridFooterCellComponent, selector: "mona-grid-footer-cell", inputs: ["column", "columnIndex", "groupKey"] }, { kind: "directive", type: GridFooterTableCellDirective, selector: "td[monaGridFooterTableCell]", inputs: ["footerCellMinWidth", "footerCellWidth", "footerColumn"] }, { kind: "directive", type: GridLockedCellDirective, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: ["monaGridLockedCell", "lockedCellHeader"] }, { kind: "directive", type: GridLogicalCellDirective, selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]", inputs: ["ariaColIndex", "cellKind", "colIndex", "columnId", "editable", "expanded", "firstInRow", "groupHeader", "groupKey", "lastInRow", "readOnly", "rowIndex", "rowUid", "section"], outputs: ["edit", "menuOpen", "toggleExpand"] }] }); }
159
169
  }
160
170
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFooterRowComponent, decorators: [{
161
171
  type: Component,
162
- args: [{ selector: "tr[monaGridFooterRow]", changeDetection: ChangeDetectionStrategy.OnPush, imports: [GridFooterCellComponent, GridFooterTableCellDirective, GridLockedCellDirective], host: {
172
+ args: [{ selector: "tr[monaGridFooterRow]", imports: [GridFooterCellComponent, GridFooterTableCellDirective, GridLockedCellDirective, GridLogicalCellDirective], host: {
163
173
  "[class]": "rowClass()",
164
- role: "row"
165
- }, template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n <td\n monaGridFooterTableCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"layoutColumn.column\">\n <mona-grid-footer-cell\n [column]=\"layoutColumn.column\"\n [columnIndex]=\"layoutColumn.columnIndex\"\n [groupKey]=\"groupKey()\" />\n </td>\n } @else {\n <td\n monaGridFooterTableCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n [footerCellWidth]=\"layoutColumn.width\"></td>\n }\n}\n" }]
166
- }], propDecorators: { groupKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupKey", required: false }] }] } });
174
+ role: "row",
175
+ "[attr.aria-rowindex]": "ariaRowIndex()",
176
+ "[attr.aria-level]": "ariaLevel()"
177
+ }, template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n <td\n monaGridFooterTableCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"layoutColumn.column\"\n monaGridLogicalCell\n [cellKind]=\"'footer'\"\n [columnId]=\"layoutColumn.column.id\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"rowIndex()\"\n [section]=\"section()\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\">\n <mona-grid-footer-cell\n [column]=\"layoutColumn.column\"\n [columnIndex]=\"layoutColumn.columnIndex\"\n [groupKey]=\"groupKey()\" />\n </td>\n } @else {\n <td\n monaGridFooterTableCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n [footerCellWidth]=\"layoutColumn.width\"></td>\n }\n}\n" }]
178
+ }], propDecorators: { ariaLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLevel", required: false }] }], ariaRowIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaRowIndex", required: false }] }], groupKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupKey", required: false }] }], rowIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowIndex", required: false }] }], section: [{ type: i0.Input, args: [{ isSignal: true, alias: "section", required: false }] }] } });
167
179
 
168
180
  export { GridFooterRowComponent };
169
- //# sourceMappingURL=nanahoshi-mona-ui-grid-grid-footer-row.component-BMCM0W8s.mjs.map
181
+ //# sourceMappingURL=nanahoshi-mona-ui-grid-grid-footer-row.component-vXXNWmEN.mjs.map
@@ -0,0 +1,208 @@
1
+ import { CdkDropList, CdkDrag, CdkDragPreview } from '@angular/cdk/drag-drop';
2
+ import { LucideGripVertical } from '@lucide/angular';
3
+ import * as i0 from '@angular/core';
4
+ import { computed, inject, input, Component, DestroyRef, ElementRef, viewChild, effect, untracked, afterNextRender, afterRenderEffect } from '@angular/core';
5
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
+ import { ImmutableList } from '@mirei/ts-collections';
7
+ import { G as GridService, a as GridLockedCellDirective, g as gridListBaseThemeVariants, b as gridRowDragPreviewThemeVariants, c as gridListTableThemeVariants, d as GridColgroupComponent } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-B9rmDLq8.mjs';
8
+ import { ContextMenuComponent } from '@nanahoshi/mona-ui/contextmenu';
9
+ import { G as GridCellDirective, a as GridAddRowComponent, b as GridGroupRowComponent, c as GridRowComponent } from './nanahoshi-mona-ui-grid-grid-row.component-Dzf6Vbs_.mjs';
10
+ import { NgTemplateOutlet } from '@angular/common';
11
+ import { GridFooterRowComponent } from './nanahoshi-mona-ui-grid-grid-footer-row.component-vXXNWmEN.mjs';
12
+
13
+ /**
14
+ * The expanded master-detail row below a data row. Leading layout columns get empty indent cells,
15
+ * and the detail template spans the user columns.
16
+ */
17
+ class GridDetailRowComponent {
18
+ constructor() {
19
+ /** The detail cell follows the leading layout columns. */
20
+ this.contentColIndex = computed(() => this.gridService.layout().filter(layoutColumn => layoutColumn.kind !== "column").length + 1, /* @ts-ignore */
21
+ ...(ngDevMode ? [{ debugName: "contentColIndex" }] : /* istanbul ignore next */ []));
22
+ this.contentColspan = computed(() => Math.max(this.gridService.visibleColumns().length, 1), /* @ts-ignore */
23
+ ...(ngDevMode ? [{ debugName: "contentColspan" }] : /* istanbul ignore next */ []));
24
+ this.gridService = inject(GridService);
25
+ this.grouped = computed(() => this.gridService.groupColumns().length !== 0, /* @ts-ignore */
26
+ ...(ngDevMode ? [{ debugName: "grouped" }] : /* istanbul ignore next */ []));
27
+ this.ariaRowIndex = input(null, /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "ariaRowIndex" }] : /* istanbul ignore next */ []));
29
+ this.row = input.required(/* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "row" }] : /* istanbul ignore next */ []));
31
+ }
32
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridDetailRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
33
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridDetailRowComponent, isStandalone: true, selector: "tr[monaGridDetailRow]", inputs: { ariaRowIndex: { classPropertyName: "ariaRowIndex", publicName: "ariaRowIndex", isSignal: true, isRequired: false, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "row" }, properties: { "attr.aria-rowindex": "ariaRowIndex()", "attr.aria-level": "grouped() ? gridService.groupColumns().length + 1 : null", "style.width.px": "gridService.masterDetailRowWidth()" } }, ngImport: i0, template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"group\") {\n <td monaGridCell [monaGridLockedCell]=\"layoutColumn.key\" [lockedCellHeader]=\"true\" [groupIndent]=\"true\"></td>\n } @else if (layoutColumn.kind === \"reorder\") {\n <td monaGridCell [monaGridLockedCell]=\"layoutColumn.key\" [groupIndent]=\"grouped()\"></td>\n } @else if (layoutColumn.kind !== \"column\") {\n <td monaGridCell [monaGridLockedCell]=\"layoutColumn.key\"></td>\n }\n}\n<td monaGridCell [lastInRow]=\"true\" [attr.colspan]=\"contentColspan()\" [attr.aria-colindex]=\"contentColIndex()\">\n <ng-container\n [ngTemplateOutlet]=\"gridService.masterDetailTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: row().data }\" />\n</td>\n", dependencies: [{ kind: "directive", type: GridCellDirective, selector: "td[monaGridCell]", inputs: ["groupHeader", "groupIndent", "lastInRow"] }, { kind: "directive", type: GridLockedCellDirective, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: ["monaGridLockedCell", "lockedCellHeader"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
34
+ }
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridDetailRowComponent, decorators: [{
36
+ type: Component,
37
+ args: [{ selector: "tr[monaGridDetailRow]", imports: [GridCellDirective, GridLockedCellDirective, NgTemplateOutlet], host: {
38
+ role: "row",
39
+ "[attr.aria-rowindex]": "ariaRowIndex()",
40
+ "[attr.aria-level]": "grouped() ? gridService.groupColumns().length + 1 : null",
41
+ "[style.width.px]": "gridService.masterDetailRowWidth()"
42
+ }, template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"group\") {\n <td monaGridCell [monaGridLockedCell]=\"layoutColumn.key\" [lockedCellHeader]=\"true\" [groupIndent]=\"true\"></td>\n } @else if (layoutColumn.kind === \"reorder\") {\n <td monaGridCell [monaGridLockedCell]=\"layoutColumn.key\" [groupIndent]=\"grouped()\"></td>\n } @else if (layoutColumn.kind !== \"column\") {\n <td monaGridCell [monaGridLockedCell]=\"layoutColumn.key\"></td>\n }\n}\n<td monaGridCell [lastInRow]=\"true\" [attr.colspan]=\"contentColspan()\" [attr.aria-colindex]=\"contentColIndex()\">\n <ng-container\n [ngTemplateOutlet]=\"gridService.masterDetailTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: row().data }\" />\n</td>\n" }]
43
+ }], propDecorators: { ariaRowIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaRowIndex", required: false }] }], row: [{ type: i0.Input, args: [{ isSignal: true, alias: "row", required: true }] }] } });
44
+
45
+ const ROW_MOVE_DURATION = 200;
46
+ const ROW_MOVE_EASING = "cubic-bezier(0.2, 0, 0, 1)";
47
+ /** Data that arrives later than this after a move request is not animated, since rows may have moved for other reasons. */
48
+ const ROW_MOVE_SNAPSHOT_LIFETIME = 1000;
49
+ class GridListComponent {
50
+ #destroyRef;
51
+ #hostElementRef;
52
+ #rowMoveAnimations;
53
+ #dropping;
54
+ #rowPositionsBeforeMove;
55
+ constructor() {
56
+ this.#destroyRef = inject(DestroyRef);
57
+ this.#hostElementRef = inject((ElementRef));
58
+ this.#rowMoveAnimations = new Map();
59
+ this.#dropping = false;
60
+ this.#rowPositionsBeforeMove = null;
61
+ this.bodyTableElementRef = viewChild.required("bodyTable", /* @ts-ignore */
62
+ ...(ngDevMode ? [{ debugName: "bodyTableElementRef" }] : /* istanbul ignore next */ []));
63
+ this.ariaRows = computed(() => this.gridService.getBodyAriaRowIndices(this.bodyRows()), /* @ts-ignore */
64
+ ...(ngDevMode ? [{ debugName: "ariaRows" }] : /* istanbul ignore next */ []));
65
+ this.baseClass = gridListBaseThemeVariants({ virtual: false });
66
+ this.bodyRows = computed(() => this.gridService.createBodyRows(this.data()), /* @ts-ignore */
67
+ ...(ngDevMode ? [{ debugName: "bodyRows" }] : /* istanbul ignore next */ []));
68
+ this.dropListData = computed(() => this.data().toArray(), /* @ts-ignore */
69
+ ...(ngDevMode ? [{ debugName: "dropListData" }] : /* istanbul ignore next */ []));
70
+ this.gridService = inject(GridService);
71
+ this.rowDragPreviewClass = gridRowDragPreviewThemeVariants();
72
+ this.tableClass = gridListTableThemeVariants();
73
+ this.data = input(ImmutableList.create(), /* @ts-ignore */
74
+ ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
75
+ effect(() => {
76
+ const count = this.ariaRows().count;
77
+ untracked(() => this.gridService.renderedBodyRowCount.set(count));
78
+ });
79
+ afterNextRender({
80
+ read: () => {
81
+ const bodyTableElement = this.bodyTableElementRef().nativeElement;
82
+ const bodyScrollElement = this.#hostElementRef.nativeElement;
83
+ this.gridService.bodyTableElement.set(bodyTableElement);
84
+ this.gridService.bodyScrollElement.set(bodyScrollElement);
85
+ this.setSubscriptions();
86
+ this.#destroyRef.onDestroy(() => {
87
+ if (this.gridService.bodyTableElement() === bodyTableElement) {
88
+ this.gridService.bodyTableElement.set(null);
89
+ }
90
+ if (this.gridService.bodyScrollElement() === bodyScrollElement) {
91
+ this.gridService.bodyScrollElement.set(null);
92
+ }
93
+ });
94
+ }
95
+ });
96
+ // Rows moved from the keyboard slide from where they were drawn to their new place.
97
+ afterRenderEffect({
98
+ earlyRead: () => {
99
+ this.bodyRows();
100
+ return this.#measureRowMoves();
101
+ },
102
+ write: moves => this.#playRowMoves(moves())
103
+ });
104
+ }
105
+ onRowDragEnded(_event) {
106
+ this.gridService.draggingRowUid.set(null);
107
+ }
108
+ onRowDragStarted(event) {
109
+ this.gridService.draggingRowUid.set(event.source.data.uid);
110
+ }
111
+ onRowDrop(event) {
112
+ this.gridService.draggingRowUid.set(null);
113
+ // The drag already showed the rows in their new order, so the move must not be animated again.
114
+ this.#dropping = true;
115
+ try {
116
+ this.gridService.requestRowReorder(event.item.data, event.previousIndex, event.currentIndex);
117
+ }
118
+ finally {
119
+ this.#dropping = false;
120
+ }
121
+ }
122
+ #canAnimateRowMoves() {
123
+ const view = this.#hostElementRef.nativeElement.ownerDocument.defaultView;
124
+ if (view == null || typeof this.#hostElementRef.nativeElement.animate !== "function") {
125
+ return false;
126
+ }
127
+ return !view.matchMedia("(prefers-reduced-motion: reduce)").matches;
128
+ }
129
+ #measureRowMoves() {
130
+ const snapshot = this.#rowPositionsBeforeMove;
131
+ this.#rowPositionsBeforeMove = null;
132
+ if (snapshot == null || performance.now() - snapshot.time > ROW_MOVE_SNAPSHOT_LIFETIME) {
133
+ return [];
134
+ }
135
+ // Rows still sliding from an earlier move are measured where they finally belong.
136
+ for (const animation of this.#rowMoveAnimations.values()) {
137
+ animation.cancel();
138
+ }
139
+ this.#rowMoveAnimations.clear();
140
+ const moves = [];
141
+ for (const [uid, position] of this.#readRowPositions()) {
142
+ const previousTop = snapshot.positions.get(uid);
143
+ if (previousTop != null && Math.abs(previousTop - position.top) >= 0.5) {
144
+ moves.push({ element: position.element, offset: previousTop - position.top });
145
+ }
146
+ }
147
+ return moves;
148
+ }
149
+ #playRowMoves(moves) {
150
+ for (const { element, offset } of moves) {
151
+ const animation = element.animate([{ transform: `translateY(${offset}px)` }, { transform: "translateY(0)" }], { duration: ROW_MOVE_DURATION, easing: ROW_MOVE_EASING });
152
+ this.#rowMoveAnimations.set(element, animation);
153
+ animation.addEventListener("finish", () => {
154
+ if (this.#rowMoveAnimations.get(element) === animation) {
155
+ this.#rowMoveAnimations.delete(element);
156
+ }
157
+ });
158
+ }
159
+ }
160
+ /** Reads where each data row is drawn, relative to the top of the body table. */
161
+ #readRowPositions() {
162
+ const table = this.bodyTableElementRef().nativeElement;
163
+ const tableTop = table.getBoundingClientRect().top;
164
+ const positions = new Map();
165
+ for (const element of table.querySelectorAll(":scope > tbody > tr[data-ruid]")) {
166
+ const uid = element.dataset["ruid"];
167
+ if (uid != null) {
168
+ positions.set(uid, { element, top: element.getBoundingClientRect().top - tableTop });
169
+ }
170
+ }
171
+ return positions;
172
+ }
173
+ setSubscriptions() {
174
+ this.gridService.rowReorder$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
175
+ if (this.#dropping || !this.#canAnimateRowMoves()) {
176
+ return;
177
+ }
178
+ const positions = new Map();
179
+ for (const [uid, position] of this.#readRowPositions()) {
180
+ positions.set(uid, position.top);
181
+ }
182
+ this.#rowPositionsBeforeMove = { positions, time: performance.now() };
183
+ });
184
+ }
185
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
186
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridListComponent, isStandalone: true, selector: "mona-grid-list", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass" } }, viewQueries: [{ propertyName: "bodyTableElementRef", first: true, predicate: ["bodyTable"], descendants: true, isSignal: true }], ngImport: i0, template: "<table role=\"presentation\" #bodyTable [class]=\"tableClass\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tbody\n role=\"rowgroup\"\n #bodyElement\n cdkDropList\n [cdkDropListData]=\"dropListData()\"\n [cdkDropListDisabled]=\"!gridService.rowReorderInteractionEnabled()\"\n (cdkDropListDropped)=\"onRowDrop($event)\">\n @if (gridService.addRowVisible()) {\n <tr monaGridAddRow></tr>\n }\n @for (bodyRow of bodyRows(); track bodyRow.key; let rowIndex = $index) {\n @let ariaRowIndex = ariaRows().indices[rowIndex];\n @if (bodyRow.type === \"group\") {\n <tr monaGridGroupRow [group]=\"bodyRow\" [rowIndex]=\"rowIndex\" [ariaRowIndex]=\"ariaRowIndex\"></tr>\n } @else if (bodyRow.type === \"groupFooter\") {\n <tr\n monaGridFooterRow\n [groupKey]=\"bodyRow.groupAggregate.groupKey\"\n [rowIndex]=\"rowIndex\"\n [section]=\"'body'\"\n [ariaLevel]=\"bodyRow.depth + 2\"\n [ariaRowIndex]=\"ariaRowIndex\"></tr>\n } @else if (!gridService.rowReorderColumnVisible()) {\n <tr monaGridRow [row]=\"bodyRow.row\" [index]=\"rowIndex\" [ariaRowIndex]=\"ariaRowIndex\"></tr>\n @if (gridService.isRowExpanded(bodyRow.row)) {\n <tr monaGridDetailRow [row]=\"bodyRow.row\" [ariaRowIndex]=\"ariaRowIndex + 1\"></tr>\n }\n } @else {\n <tr\n monaGridRow\n [row]=\"bodyRow.row\"\n [index]=\"rowIndex\"\n [ariaRowIndex]=\"ariaRowIndex\"\n cdkDrag\n cdkDragLockAxis=\"y\"\n [cdkDragData]=\"bodyRow.row\"\n [cdkDragDisabled]=\"!gridService.canReorderRow(bodyRow.row)\"\n (cdkDragStarted)=\"onRowDragStarted($event)\"\n (cdkDragEnded)=\"onRowDragEnded($event)\">\n <ng-template cdkDragPreview>\n <div [class]=\"rowDragPreviewClass\">\n <svg lucideGripVertical [size]=\"16\" aria-hidden=\"true\"></svg>\n <span>{{\n gridService.getRowReorderAriaLabel(\n bodyRow.row,\n rowIndex + gridService.paginationState().skip\n )\n }}</span>\n </div>\n </ng-template>\n </tr>\n @if (gridService.isRowExpanded(bodyRow.row) && !gridService.rowDragInProgress()) {\n <tr monaGridDetailRow [row]=\"bodyRow.row\" [ariaRowIndex]=\"ariaRowIndex + 1\"></tr>\n }\n }\n }\n </tbody>\n</table>\n@if (gridService.contextMenuItems().length !== 0) {\n <mona-contextmenu [target]=\"bodyElement\" [items]=\"gridService.contextMenuItems()\" />\n}\n", dependencies: [{ kind: "component", type: ContextMenuComponent, selector: "mona-contextmenu", inputs: ["ariaLabel", "items", "minWidth", "rounded", "size", "target", "width"], outputs: ["menuClick"] }, { kind: "component", type: LucideGripVertical, selector: "svg[lucideGripVertical]" }, { kind: "component", type: GridAddRowComponent, selector: "tr[monaGridAddRow]" }, { kind: "component", type: GridColgroupComponent, selector: "colgroup[monaGridColgroup]" }, { kind: "component", type: GridDetailRowComponent, selector: "tr[monaGridDetailRow]", inputs: ["ariaRowIndex", "row"] }, { kind: "component", type: GridFooterRowComponent, selector: "tr[monaGridFooterRow]", inputs: ["ariaLevel", "ariaRowIndex", "groupKey", "rowIndex", "section"] }, { kind: "component", type: GridGroupRowComponent, selector: "tr[monaGridGroupRow]", inputs: ["ariaRowIndex", "group", "rowIndex"] }, { kind: "component", type: GridRowComponent, selector: "tr[monaGridRow]", inputs: ["ariaRowIndex", "index", "row"], exportAs: ["monaGridRow"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }] }); }
187
+ }
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridListComponent, decorators: [{
189
+ type: Component,
190
+ args: [{ selector: "mona-grid-list", imports: [
191
+ ContextMenuComponent,
192
+ LucideGripVertical,
193
+ GridAddRowComponent,
194
+ GridColgroupComponent,
195
+ GridDetailRowComponent,
196
+ GridFooterRowComponent,
197
+ GridGroupRowComponent,
198
+ GridRowComponent,
199
+ CdkDropList,
200
+ CdkDrag,
201
+ CdkDragPreview
202
+ ], host: {
203
+ "[class]": "baseClass"
204
+ }, template: "<table role=\"presentation\" #bodyTable [class]=\"tableClass\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tbody\n role=\"rowgroup\"\n #bodyElement\n cdkDropList\n [cdkDropListData]=\"dropListData()\"\n [cdkDropListDisabled]=\"!gridService.rowReorderInteractionEnabled()\"\n (cdkDropListDropped)=\"onRowDrop($event)\">\n @if (gridService.addRowVisible()) {\n <tr monaGridAddRow></tr>\n }\n @for (bodyRow of bodyRows(); track bodyRow.key; let rowIndex = $index) {\n @let ariaRowIndex = ariaRows().indices[rowIndex];\n @if (bodyRow.type === \"group\") {\n <tr monaGridGroupRow [group]=\"bodyRow\" [rowIndex]=\"rowIndex\" [ariaRowIndex]=\"ariaRowIndex\"></tr>\n } @else if (bodyRow.type === \"groupFooter\") {\n <tr\n monaGridFooterRow\n [groupKey]=\"bodyRow.groupAggregate.groupKey\"\n [rowIndex]=\"rowIndex\"\n [section]=\"'body'\"\n [ariaLevel]=\"bodyRow.depth + 2\"\n [ariaRowIndex]=\"ariaRowIndex\"></tr>\n } @else if (!gridService.rowReorderColumnVisible()) {\n <tr monaGridRow [row]=\"bodyRow.row\" [index]=\"rowIndex\" [ariaRowIndex]=\"ariaRowIndex\"></tr>\n @if (gridService.isRowExpanded(bodyRow.row)) {\n <tr monaGridDetailRow [row]=\"bodyRow.row\" [ariaRowIndex]=\"ariaRowIndex + 1\"></tr>\n }\n } @else {\n <tr\n monaGridRow\n [row]=\"bodyRow.row\"\n [index]=\"rowIndex\"\n [ariaRowIndex]=\"ariaRowIndex\"\n cdkDrag\n cdkDragLockAxis=\"y\"\n [cdkDragData]=\"bodyRow.row\"\n [cdkDragDisabled]=\"!gridService.canReorderRow(bodyRow.row)\"\n (cdkDragStarted)=\"onRowDragStarted($event)\"\n (cdkDragEnded)=\"onRowDragEnded($event)\">\n <ng-template cdkDragPreview>\n <div [class]=\"rowDragPreviewClass\">\n <svg lucideGripVertical [size]=\"16\" aria-hidden=\"true\"></svg>\n <span>{{\n gridService.getRowReorderAriaLabel(\n bodyRow.row,\n rowIndex + gridService.paginationState().skip\n )\n }}</span>\n </div>\n </ng-template>\n </tr>\n @if (gridService.isRowExpanded(bodyRow.row) && !gridService.rowDragInProgress()) {\n <tr monaGridDetailRow [row]=\"bodyRow.row\" [ariaRowIndex]=\"ariaRowIndex + 1\"></tr>\n }\n }\n }\n </tbody>\n</table>\n@if (gridService.contextMenuItems().length !== 0) {\n <mona-contextmenu [target]=\"bodyElement\" [items]=\"gridService.contextMenuItems()\" />\n}\n" }]
205
+ }], ctorParameters: () => [], propDecorators: { bodyTableElementRef: [{ type: i0.ViewChild, args: ["bodyTable", { isSignal: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
206
+
207
+ export { GridListComponent };
208
+ //# sourceMappingURL=nanahoshi-mona-ui-grid-grid-list.component-DDgNmgE0.mjs.map