@nanahoshi/mona-ui 0.39.1 → 0.41.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.
Files changed (76) hide show
  1. package/docs/api/common.md +1 -1
  2. package/docs/api/grid.md +214 -17
  3. package/docs/api/i18n.md +36 -0
  4. package/docs/api/kanban.md +222 -0
  5. package/docs/api/locales.md +14 -14
  6. package/docs/api/sortable.md +189 -0
  7. package/docs/api/tabs.md +20 -0
  8. package/docs/grid-selection.md +134 -9
  9. package/docs/grid-state-export.md +56 -6
  10. package/docs/grid-tree.md +279 -0
  11. package/docs/kanban.md +293 -0
  12. package/docs/sortable.md +320 -0
  13. package/docs/tabs.md +59 -10
  14. package/fesm2022/{nanahoshi-mona-ui-grid-grid-colgroup.component-Lv3GunpV.mjs → nanahoshi-mona-ui-grid-grid-colgroup.component-DpszxgFY.mjs} +2 -2
  15. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-BYH9XbCV.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-CpvzAcX8.mjs} +4 -3
  16. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BoSXXLKQ.mjs → nanahoshi-mona-ui-grid-grid-list.component-tRmEWiQR.mjs} +5 -5
  17. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-Df2gfS0X.mjs → nanahoshi-mona-ui-grid-grid-row.component-eET6dh2Q.mjs} +52 -35
  18. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-xjrcCXXF.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-8h2EMexB.mjs} +5 -5
  19. package/fesm2022/{nanahoshi-mona-ui-grid-grid.styles-aPD3c2A6.mjs → nanahoshi-mona-ui-grid-grid.styles-wAf6jsT9.mjs} +646 -20
  20. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1663 -22
  21. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +56 -0
  22. package/fesm2022/nanahoshi-mona-ui-kanban.mjs +660 -0
  23. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +11 -0
  24. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +17 -0
  25. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +17 -0
  26. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +17 -0
  27. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +11 -0
  28. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +17 -0
  29. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +11 -0
  30. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +11 -0
  31. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +21 -0
  32. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +17 -0
  33. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +21 -0
  34. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +11 -0
  35. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +11 -0
  36. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +11 -0
  37. package/fesm2022/nanahoshi-mona-ui-sortable.mjs +733 -0
  38. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +112 -5
  39. package/i18n/catalogs/en-US.messages.json +11 -0
  40. package/kanban/package.json +4 -0
  41. package/llms.txt +10 -5
  42. package/locales/ar-sa/ar-sa.messages.json +11 -0
  43. package/locales/de-de/de-de.messages.json +11 -0
  44. package/locales/es-es/es-es.messages.json +11 -0
  45. package/locales/fr-fr/fr-fr.messages.json +11 -0
  46. package/locales/id-id/id-id.messages.json +11 -0
  47. package/locales/it-it/it-it.messages.json +11 -0
  48. package/locales/ja-jp/ja-jp.messages.json +11 -0
  49. package/locales/ko-kr/ko-kr.messages.json +11 -0
  50. package/locales/pl-pl/pl-pl.messages.json +11 -0
  51. package/locales/pt-br/pt-br.messages.json +11 -0
  52. package/locales/ru-ru/ru-ru.messages.json +11 -0
  53. package/locales/tr-tr/tr-tr.messages.json +11 -0
  54. package/locales/zh-cn/zh-cn.messages.json +11 -0
  55. package/locales/zh-tw/zh-tw.messages.json +11 -0
  56. package/package.json +9 -1
  57. package/sortable/package.json +4 -0
  58. package/types/nanahoshi-mona-ui-grid.d.ts +305 -3
  59. package/types/nanahoshi-mona-ui-i18n.d.ts +23 -0
  60. package/types/nanahoshi-mona-ui-kanban.d.ts +270 -0
  61. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +11 -0
  62. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +11 -0
  63. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +11 -0
  64. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +11 -0
  65. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +11 -0
  66. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +11 -0
  67. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +11 -0
  68. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +11 -0
  69. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +11 -0
  70. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +11 -0
  71. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +11 -0
  72. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +11 -0
  73. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +11 -0
  74. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +11 -0
  75. package/types/nanahoshi-mona-ui-sortable.d.ts +245 -0
  76. package/types/nanahoshi-mona-ui-tabs.d.ts +46 -0
@@ -1,11 +1,11 @@
1
- import { B as GridLogicalCellDirective, G as GridService, L as gridRowReorderHandleThemeVariants, M as gridListTableCellThemeVariants, N as gridListTableRowThemeVariants, V as GRID_CELL_FOCUSABLE_SELECTOR, W as GridLockedCellDirective, Z as GridNavigationService, a as gridCellEditorBaseThemeVariants, b as gridGroupRowThemeVariants, i as gridCellDirtyIndicatorThemeVariants, n as gridCellBaseThemeVariants, o as gridCellEditorInputThemeVariants, r as gridCellContainerThemeVariants, s as gridCellTextThemeVariants, z as gridSelectionCellThemeVariants } from "./nanahoshi-mona-ui-grid-grid.styles-aPD3c2A6.mjs";
2
- import { n as removeGridRow } from "./nanahoshi-mona-ui-grid-grid-colgroup.component-Lv3GunpV.mjs";
1
+ import { B as gridTreeLeafSpacerThemeVariants, H as GridLogicalCellDirective, K as GridLockedCellDirective, L as gridRowReorderHandleThemeVariants, M as gridListTableCellThemeVariants, N as gridListTableRowThemeVariants, Q as formatGridCellValue, U as GRID_CELL_FOCUSABLE_SELECTOR, V as gridTreeToggleThemeVariants, a as gridCellEditorBaseThemeVariants, b as gridGroupRowThemeVariants, i as gridCellDirtyIndicatorThemeVariants, n as gridCellBaseThemeVariants, o as gridCellEditorInputThemeVariants, q as GridService, r as gridCellContainerThemeVariants, s as gridCellTextThemeVariants, tt as GridNavigationService, z as gridSelectionCellThemeVariants } from "./nanahoshi-mona-ui-grid-grid.styles-wAf6jsT9.mjs";
2
+ import { n as removeGridRow } from "./nanahoshi-mona-ui-grid-grid-colgroup.component-DpszxgFY.mjs";
3
3
  import * as i0 from "@angular/core";
4
4
  import { Component, Directive, ElementRef, Injector, LOCALE_ID, afterNextRender, computed, effect, inject, input, isDevMode, model, output, signal, untracked, viewChild } from "@angular/core";
5
5
  import { DialogService } from "@nanahoshi/mona-ui/dialog";
6
- import { MonaI18nService, formatGregorianDateToLocaleString, parseLocalizedNumber } from "@nanahoshi/mona-ui/i18n";
6
+ import { MonaI18nService, parseLocalizedNumber } from "@nanahoshi/mona-ui/i18n";
7
7
  import { v4 } from "uuid";
8
- import { NgTemplateOutlet, formatDate } from "@angular/common";
8
+ import { NgTemplateOutlet } from "@angular/common";
9
9
  import { FormField } from "@angular/forms/signals";
10
10
  import { injectLiveAnnouncer } from "@nanahoshi/mona-ui/internal/live-announcer";
11
11
  import { CdkDragHandle } from "@angular/cdk/drag-drop";
@@ -1024,7 +1024,8 @@ var GridAddRowComponent = class GridAddRowComponent {
1024
1024
  "readOnly",
1025
1025
  "rowIndex",
1026
1026
  "rowUid",
1027
- "section"
1027
+ "section",
1028
+ "treeCell"
1028
1029
  ],
1029
1030
  outputs: [
1030
1031
  "edit",
@@ -1296,7 +1297,8 @@ var GridGroupRowComponent = class GridGroupRowComponent {
1296
1297
  "readOnly",
1297
1298
  "rowIndex",
1298
1299
  "rowUid",
1299
- "section"
1300
+ "section",
1301
+ "treeCell"
1300
1302
  ],
1301
1303
  outputs: [
1302
1304
  "edit",
@@ -1403,19 +1405,10 @@ var GridCellComponent = class GridCellComponent {
1403
1405
  return (editedRowData ?? rowData)[this.column().field];
1404
1406
  }, ...ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []);
1405
1407
  this.editContextIsCellMode = computed(() => this.gridService.editContext()?.mode === "cell", ...ngDevMode ? [{ debugName: "editContextIsCellMode" }] : /* istanbul ignore next */ []);
1406
- this.formattedDisplayValue = computed(() => {
1407
- const column = this.column();
1408
- const value = this.displayValue();
1409
- const format = column.format;
1410
- if (format == null) return column.dataType === "date" && value instanceof Date && !Number.isNaN(value.getTime()) ? formatGregorianDateToLocaleString(value, this.#i18n.localeId(), {
1411
- day: "2-digit",
1412
- month: "2-digit",
1413
- year: "numeric"
1414
- }) : value;
1415
- if (typeof format === "function") return format(value, this.row().data, column);
1416
- if (column.dataType === "date") return this.formatDateValue(value, format);
1417
- return value;
1418
- }, ...ngDevMode ? [{ debugName: "formattedDisplayValue" }] : /* istanbul ignore next */ []);
1408
+ this.formattedDisplayValue = computed(() => formatGridCellValue(this.displayValue(), this.row().data, this.column(), {
1409
+ angularLocale: this.#locale,
1410
+ localeId: this.#i18n.localeId()
1411
+ }), ...ngDevMode ? [{ debugName: "formattedDisplayValue" }] : /* istanbul ignore next */ []);
1419
1412
  this.gridService = inject(GridService);
1420
1413
  this.isCellPristine = computed(() => {
1421
1414
  const row = this.row();
@@ -1437,6 +1430,10 @@ var GridCellComponent = class GridCellComponent {
1437
1430
  if (context.focusColumnId != null) return context.focusColumnId === this.column().id;
1438
1431
  return this.gridService.visibleColumns().firstOrDefault((column) => column.kind === "data" && column.editable) === this.column();
1439
1432
  }, ...ngDevMode ? [{ debugName: "shouldAutoFocusEditor" }] : /* istanbul ignore next */ []);
1433
+ this.treeIndent = 1.25;
1434
+ this.treeInfo = computed(() => this.column().id === this.gridService.treeColumnId() ? this.gridService.getTreeRowInfo(this.row()) : null, ...ngDevMode ? [{ debugName: "treeInfo" }] : /* istanbul ignore next */ []);
1435
+ this.treeLeafSpacerClass = gridTreeLeafSpacerThemeVariants();
1436
+ this.treeToggleClass = gridTreeToggleThemeVariants();
1440
1437
  this.column = input.required(...ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []);
1441
1438
  this.row = input.required(...ngDevMode ? [{ debugName: "row" }] : /* istanbul ignore next */ []);
1442
1439
  }
@@ -1485,21 +1482,16 @@ var GridCellComponent = class GridCellComponent {
1485
1482
  if (!this.#logicalCell?.leaveGrid(direction === "previous")) this.focusHostCell();
1486
1483
  } }, { injector: this.#injector });
1487
1484
  }
1485
+ onTreeToggleClick(event) {
1486
+ event.stopPropagation();
1487
+ this.gridService.toggleTreeRow(this.row());
1488
+ }
1488
1489
  focusHostCell() {
1489
1490
  this.#elementRef.nativeElement.closest("td")?.focus();
1490
1491
  }
1491
1492
  focusInnerEditor() {
1492
1493
  this.#elementRef.nativeElement.querySelector(GRID_CELL_FOCUSABLE_SELECTOR)?.focus();
1493
1494
  }
1494
- formatDateValue(value, format) {
1495
- if (value == null) return value;
1496
- if (value instanceof Date || typeof value === "number" || typeof value === "string") try {
1497
- return formatDate(value, format, this.#locale);
1498
- } catch {
1499
- return value;
1500
- }
1501
- return value;
1502
- }
1503
1495
  startEdit(originalEvent) {
1504
1496
  if (!this.gridService.editableOptions().enabled || !this.column().editable || this.column().kind !== "data") return;
1505
1497
  this.gridService.startCellEdit(this.cellUid(), this.row(), this.column(), originalEvent);
@@ -1539,7 +1531,7 @@ var GridCellComponent = class GridCellComponent {
1539
1531
  },
1540
1532
  host: { properties: { "class": "baseClass()" } },
1541
1533
  ngImport: i0,
1542
- template: "@let dataItem = row().data;\n@let dataKey = column().field;\n\n@if (column().kind === \"command\") {\n <mona-grid-command-cell [column]=\"column()\" [row]=\"row()\"></mona-grid-command-cell>\n} @else {\n <div\n [class]=\"cellContainerClass()\"\n [attr.data-uid]=\"cellUid()\"\n [attr.data-ruid]=\"row().uid\"\n [attr.data-field]=\"dataKey\"\n [attr.data-col-index]=\"column().index\"\n (dblclick)=\"onCellDoubleClick($event)\">\n @if (isEditing() && gridService.editSession(); as session) {\n <mona-grid-editor\n [column]=\"column()\"\n [autoFocus]=\"shouldAutoFocusEditor()\"\n [session]=\"session\"\n [tabNavigationEnabled]=\"editContextIsCellMode()\"\n (commit)=\"onEditCommit($event)\"\n (cancelEdit)=\"onEditCancel()\"\n (tabNavigate)=\"onEditTabNavigate($event)\"></mona-grid-editor>\n } @else if (column().cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, column: column().field }\"></ng-container>\n } @else {\n <span [class]=\"cellTextClass()\">{{ formattedDisplayValue() }}</span>\n }\n @if (!isCellPristine()) {\n <span\n aria-hidden=\"true\"\n [class]=\"cellDirtyIndicatorClass()\"\n [title]=\"gridService.messages().modified\"></span>\n }\n </div>\n}\n",
1534
+ template: "@let dataItem = row().data;\n@let dataKey = column().field;\n\n@if (column().kind === \"command\") {\n <mona-grid-command-cell [column]=\"column()\" [row]=\"row()\"></mona-grid-command-cell>\n} @else {\n <div\n [class]=\"cellContainerClass()\"\n [attr.data-uid]=\"cellUid()\"\n [attr.data-ruid]=\"row().uid\"\n [attr.data-field]=\"dataKey\"\n [attr.data-col-index]=\"column().index\"\n (dblclick)=\"onCellDoubleClick($event)\">\n @if (treeInfo(); as tree) {\n <!-- The row carries aria-expanded and aria-level; the arrows expand and collapse it. -->\n <span aria-hidden=\"true\" class=\"shrink-0\" [style.width.rem]=\"(tree.level - 1) * treeIndent\"></span>\n @if (tree.hasChildren) {\n <span\n aria-hidden=\"true\"\n data-grid-tree-toggle\n [class]=\"treeToggleClass\"\n (click)=\"onTreeToggleClick($event)\"\n (dblclick)=\"$event.stopPropagation()\">\n @if (tree.expanded) {\n <svg lucideChevronDown [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronRight class=\"rtl:-scale-x-100\" [size]=\"16\"></svg>\n }\n </span>\n } @else {\n <span aria-hidden=\"true\" [class]=\"treeLeafSpacerClass\"></span>\n }\n }\n @if (isEditing() && gridService.editSession(); as session) {\n <mona-grid-editor\n [column]=\"column()\"\n [autoFocus]=\"shouldAutoFocusEditor()\"\n [session]=\"session\"\n [tabNavigationEnabled]=\"editContextIsCellMode()\"\n (commit)=\"onEditCommit($event)\"\n (cancelEdit)=\"onEditCancel()\"\n (tabNavigate)=\"onEditTabNavigate($event)\"></mona-grid-editor>\n } @else if (column().cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, column: column().field }\"></ng-container>\n } @else {\n <span [class]=\"cellTextClass()\">{{ formattedDisplayValue() }}</span>\n }\n @if (!isCellPristine()) {\n <span\n aria-hidden=\"true\"\n [class]=\"cellDirtyIndicatorClass()\"\n [title]=\"gridService.messages().modified\"></span>\n }\n </div>\n}\n",
1543
1535
  dependencies: [
1544
1536
  {
1545
1537
  kind: "component",
@@ -1568,6 +1560,16 @@ var GridCellComponent = class GridCellComponent {
1568
1560
  "tabNavigate"
1569
1561
  ]
1570
1562
  },
1563
+ {
1564
+ kind: "component",
1565
+ type: LucideChevronDown,
1566
+ selector: "svg[lucideChevronDown]"
1567
+ },
1568
+ {
1569
+ kind: "component",
1570
+ type: LucideChevronRight,
1571
+ selector: "svg[lucideChevronRight]"
1572
+ },
1571
1573
  {
1572
1574
  kind: "directive",
1573
1575
  type: NgTemplateOutlet,
@@ -1594,10 +1596,12 @@ i0.ɵɵngDeclareClassMetadata({
1594
1596
  imports: [
1595
1597
  GridCommandCellComponent,
1596
1598
  GridEditorComponent,
1599
+ LucideChevronDown,
1600
+ LucideChevronRight,
1597
1601
  NgTemplateOutlet
1598
1602
  ],
1599
1603
  host: { "[class]": "baseClass()" },
1600
- template: "@let dataItem = row().data;\n@let dataKey = column().field;\n\n@if (column().kind === \"command\") {\n <mona-grid-command-cell [column]=\"column()\" [row]=\"row()\"></mona-grid-command-cell>\n} @else {\n <div\n [class]=\"cellContainerClass()\"\n [attr.data-uid]=\"cellUid()\"\n [attr.data-ruid]=\"row().uid\"\n [attr.data-field]=\"dataKey\"\n [attr.data-col-index]=\"column().index\"\n (dblclick)=\"onCellDoubleClick($event)\">\n @if (isEditing() && gridService.editSession(); as session) {\n <mona-grid-editor\n [column]=\"column()\"\n [autoFocus]=\"shouldAutoFocusEditor()\"\n [session]=\"session\"\n [tabNavigationEnabled]=\"editContextIsCellMode()\"\n (commit)=\"onEditCommit($event)\"\n (cancelEdit)=\"onEditCancel()\"\n (tabNavigate)=\"onEditTabNavigate($event)\"></mona-grid-editor>\n } @else if (column().cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, column: column().field }\"></ng-container>\n } @else {\n <span [class]=\"cellTextClass()\">{{ formattedDisplayValue() }}</span>\n }\n @if (!isCellPristine()) {\n <span\n aria-hidden=\"true\"\n [class]=\"cellDirtyIndicatorClass()\"\n [title]=\"gridService.messages().modified\"></span>\n }\n </div>\n}\n"
1604
+ template: "@let dataItem = row().data;\n@let dataKey = column().field;\n\n@if (column().kind === \"command\") {\n <mona-grid-command-cell [column]=\"column()\" [row]=\"row()\"></mona-grid-command-cell>\n} @else {\n <div\n [class]=\"cellContainerClass()\"\n [attr.data-uid]=\"cellUid()\"\n [attr.data-ruid]=\"row().uid\"\n [attr.data-field]=\"dataKey\"\n [attr.data-col-index]=\"column().index\"\n (dblclick)=\"onCellDoubleClick($event)\">\n @if (treeInfo(); as tree) {\n <!-- The row carries aria-expanded and aria-level; the arrows expand and collapse it. -->\n <span aria-hidden=\"true\" class=\"shrink-0\" [style.width.rem]=\"(tree.level - 1) * treeIndent\"></span>\n @if (tree.hasChildren) {\n <span\n aria-hidden=\"true\"\n data-grid-tree-toggle\n [class]=\"treeToggleClass\"\n (click)=\"onTreeToggleClick($event)\"\n (dblclick)=\"$event.stopPropagation()\">\n @if (tree.expanded) {\n <svg lucideChevronDown [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronRight class=\"rtl:-scale-x-100\" [size]=\"16\"></svg>\n }\n </span>\n } @else {\n <span aria-hidden=\"true\" [class]=\"treeLeafSpacerClass\"></span>\n }\n }\n @if (isEditing() && gridService.editSession(); as session) {\n <mona-grid-editor\n [column]=\"column()\"\n [autoFocus]=\"shouldAutoFocusEditor()\"\n [session]=\"session\"\n [tabNavigationEnabled]=\"editContextIsCellMode()\"\n (commit)=\"onEditCommit($event)\"\n (cancelEdit)=\"onEditCancel()\"\n (tabNavigate)=\"onEditTabNavigate($event)\"></mona-grid-editor>\n } @else if (column().cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, column: column().field }\"></ng-container>\n } @else {\n <span [class]=\"cellTextClass()\">{{ formattedDisplayValue() }}</span>\n }\n @if (!isCellPristine()) {\n <span\n aria-hidden=\"true\"\n [class]=\"cellDirtyIndicatorClass()\"\n [title]=\"gridService.messages().modified\"></span>\n }\n </div>\n}\n"
1601
1605
  }]
1602
1606
  }],
1603
1607
  propDecorators: {
@@ -1895,6 +1899,8 @@ i0.ɵɵngDeclareClassMetadata({
1895
1899
  var GridRowComponent = class GridRowComponent {
1896
1900
  constructor() {
1897
1901
  this.ariaLevel = computed(() => {
1902
+ const treeLevel = this.treeInfo()?.level;
1903
+ if (treeLevel != null) return treeLevel;
1898
1904
  const groupCount = this.gridService.groupColumns().length;
1899
1905
  return groupCount === 0 ? null : groupCount + 1;
1900
1906
  }, ...ngDevMode ? [{ debugName: "ariaLevel" }] : /* istanbul ignore next */ []);
@@ -1919,6 +1925,7 @@ var GridRowComponent = class GridRowComponent {
1919
1925
  this.editingEnabled = computed(() => this.gridService.editableOptions().enabled === true, ...ngDevMode ? [{ debugName: "editingEnabled" }] : /* istanbul ignore next */ []);
1920
1926
  this.gridService = inject(GridService);
1921
1927
  this.selectable = computed(() => this.gridService.selectableOptions().enabled, ...ngDevMode ? [{ debugName: "selectable" }] : /* istanbul ignore next */ []);
1928
+ this.treeInfo = computed(() => this.gridService.getTreeRowInfo(this.row()), ...ngDevMode ? [{ debugName: "treeInfo" }] : /* istanbul ignore next */ []);
1922
1929
  this.ariaRowIndex = input(null, ...ngDevMode ? [{ debugName: "ariaRowIndex" }] : /* istanbul ignore next */ []);
1923
1930
  this.expanded = computed(() => this.gridService.isRowExpanded(this.row()), ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
1924
1931
  this.index = input.required(...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
@@ -1931,6 +1938,9 @@ var GridRowComponent = class GridRowComponent {
1931
1938
  toggleDetail() {
1932
1939
  this.gridService.setRowExpanded(this.row(), !this.expanded());
1933
1940
  }
1941
+ toggleTree() {
1942
+ this.gridService.toggleTreeRow(this.row());
1943
+ }
1934
1944
  static {
1935
1945
  this.ɵfac = i0.ɵɵngDeclareFactory({
1936
1946
  minVersion: "12.0.0",
@@ -1980,12 +1990,15 @@ var GridRowComponent = class GridRowComponent {
1980
1990
  "attr.data-row-view-index": "index()",
1981
1991
  "attr.aria-selected": "selectable() ? selected() : null",
1982
1992
  "attr.aria-rowindex": "ariaRowIndex()",
1983
- "attr.aria-level": "ariaLevel()"
1993
+ "attr.aria-level": "ariaLevel()",
1994
+ "attr.aria-expanded": "treeInfo()?.hasChildren ? treeInfo()!.expanded : null",
1995
+ "attr.aria-posinset": "treeInfo()?.posInSet ?? null",
1996
+ "attr.aria-setsize": "treeInfo()?.setSize ?? null"
1984
1997
  }
1985
1998
  },
1986
1999
  exportAs: ["monaGridRow"],
1987
2000
  ngImport: i0,
1988
- template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"layoutColumn.column.kind\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [columnId]=\"layoutColumn.column.id\"\n [editable]=\"cellEditMode() && layoutColumn.column.kind === 'data' && layoutColumn.column.editable === true\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n [readOnly]=\"editingEnabled() && layoutColumn.column.kind === 'data' ? !layoutColumn.column.editable : null\"\n (edit)=\"gridCell.handleLogicalCellEnter()\">\n <mona-grid-cell #gridCell [column]=\"layoutColumn.column\" [row]=\"row()\" />\n </td>\n } @else if (layoutColumn.kind === \"group\") {\n <td monaGridCell [monaGridLockedCell]=\"layoutColumn.key\" [lockedCellHeader]=\"true\" [groupIndent]=\"true\"></td>\n } @else if (layoutColumn.kind === \"reorder\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\">\n <mona-grid-row-reorder-handle [row]=\"row()\" [pageIndex]=\"index()\" />\n </td>\n } @else if (layoutColumn.kind === \"detail\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'detail'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n (toggleExpand)=\"toggleDetail()\">\n <span [class]=\"detailToggleClass()\">\n <mona-grid-toggle\n [expanded]=\"expanded()\"\n [label]=\"detailToggleLabel()\"\n [type]=\"'detail'\"\n [width]=\"gridService.detailColumnWidth\"\n (expandedChange)=\"toggleDetail()\" />\n </span>\n </td>\n } @else if (layoutColumn.kind === \"selection\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\">\n <mona-grid-selection-checkbox [row]=\"row()\" [rowIndex]=\"index()\" />\n </td>\n }\n}\n",
2001
+ template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"layoutColumn.column.kind\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [columnId]=\"layoutColumn.column.id\"\n [editable]=\"cellEditMode() && layoutColumn.column.kind === 'data' && layoutColumn.column.editable === true\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n [readOnly]=\"editingEnabled() && layoutColumn.column.kind === 'data' ? !layoutColumn.column.editable : null\"\n [treeCell]=\"layoutColumn.column.id === gridService.treeColumnId()\"\n [expanded]=\"\n layoutColumn.column.id === gridService.treeColumnId() && treeInfo()?.hasChildren\n ? treeInfo()!.expanded\n : null\n \"\n (edit)=\"gridCell.handleLogicalCellEnter()\"\n (toggleExpand)=\"toggleTree()\">\n <mona-grid-cell #gridCell [column]=\"layoutColumn.column\" [row]=\"row()\" />\n </td>\n } @else if (layoutColumn.kind === \"group\") {\n <td monaGridCell [monaGridLockedCell]=\"layoutColumn.key\" [lockedCellHeader]=\"true\" [groupIndent]=\"true\"></td>\n } @else if (layoutColumn.kind === \"reorder\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\">\n <mona-grid-row-reorder-handle [row]=\"row()\" [pageIndex]=\"index()\" />\n </td>\n } @else if (layoutColumn.kind === \"detail\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'detail'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n (toggleExpand)=\"toggleDetail()\">\n <span [class]=\"detailToggleClass()\">\n <mona-grid-toggle\n [expanded]=\"expanded()\"\n [label]=\"detailToggleLabel()\"\n [type]=\"'detail'\"\n [width]=\"gridService.detailColumnWidth\"\n (expandedChange)=\"toggleDetail()\" />\n </span>\n </td>\n } @else if (layoutColumn.kind === \"selection\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\">\n <mona-grid-selection-checkbox [row]=\"row()\" [rowIndex]=\"index()\" />\n </td>\n }\n}\n",
1989
2002
  dependencies: [
1990
2003
  {
1991
2004
  kind: "component",
@@ -2032,7 +2045,8 @@ var GridRowComponent = class GridRowComponent {
2032
2045
  "readOnly",
2033
2046
  "rowIndex",
2034
2047
  "rowUid",
2035
- "section"
2048
+ "section",
2049
+ "treeCell"
2036
2050
  ],
2037
2051
  outputs: [
2038
2052
  "edit",
@@ -2095,9 +2109,12 @@ i0.ɵɵngDeclareClassMetadata({
2095
2109
  "[attr.aria-selected]": "selectable() ? selected() : null",
2096
2110
  "[attr.aria-rowindex]": "ariaRowIndex()",
2097
2111
  "[attr.aria-level]": "ariaLevel()",
2112
+ "[attr.aria-expanded]": "treeInfo()?.hasChildren ? treeInfo()!.expanded : null",
2113
+ "[attr.aria-posinset]": "treeInfo()?.posInSet ?? null",
2114
+ "[attr.aria-setsize]": "treeInfo()?.setSize ?? null",
2098
2115
  "(click)": "onClick($event)"
2099
2116
  },
2100
- template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"layoutColumn.column.kind\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [columnId]=\"layoutColumn.column.id\"\n [editable]=\"cellEditMode() && layoutColumn.column.kind === 'data' && layoutColumn.column.editable === true\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n [readOnly]=\"editingEnabled() && layoutColumn.column.kind === 'data' ? !layoutColumn.column.editable : null\"\n (edit)=\"gridCell.handleLogicalCellEnter()\">\n <mona-grid-cell #gridCell [column]=\"layoutColumn.column\" [row]=\"row()\" />\n </td>\n } @else if (layoutColumn.kind === \"group\") {\n <td monaGridCell [monaGridLockedCell]=\"layoutColumn.key\" [lockedCellHeader]=\"true\" [groupIndent]=\"true\"></td>\n } @else if (layoutColumn.kind === \"reorder\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\">\n <mona-grid-row-reorder-handle [row]=\"row()\" [pageIndex]=\"index()\" />\n </td>\n } @else if (layoutColumn.kind === \"detail\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'detail'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n (toggleExpand)=\"toggleDetail()\">\n <span [class]=\"detailToggleClass()\">\n <mona-grid-toggle\n [expanded]=\"expanded()\"\n [label]=\"detailToggleLabel()\"\n [type]=\"'detail'\"\n [width]=\"gridService.detailColumnWidth\"\n (expandedChange)=\"toggleDetail()\" />\n </span>\n </td>\n } @else if (layoutColumn.kind === \"selection\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\">\n <mona-grid-selection-checkbox [row]=\"row()\" [rowIndex]=\"index()\" />\n </td>\n }\n}\n"
2117
+ template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"layoutColumn.column.kind\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [columnId]=\"layoutColumn.column.id\"\n [editable]=\"cellEditMode() && layoutColumn.column.kind === 'data' && layoutColumn.column.editable === true\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n [readOnly]=\"editingEnabled() && layoutColumn.column.kind === 'data' ? !layoutColumn.column.editable : null\"\n [treeCell]=\"layoutColumn.column.id === gridService.treeColumnId()\"\n [expanded]=\"\n layoutColumn.column.id === gridService.treeColumnId() && treeInfo()?.hasChildren\n ? treeInfo()!.expanded\n : null\n \"\n (edit)=\"gridCell.handleLogicalCellEnter()\"\n (toggleExpand)=\"toggleTree()\">\n <mona-grid-cell #gridCell [column]=\"layoutColumn.column\" [row]=\"row()\" />\n </td>\n } @else if (layoutColumn.kind === \"group\") {\n <td monaGridCell [monaGridLockedCell]=\"layoutColumn.key\" [lockedCellHeader]=\"true\" [groupIndent]=\"true\"></td>\n } @else if (layoutColumn.kind === \"reorder\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\">\n <mona-grid-row-reorder-handle [row]=\"row()\" [pageIndex]=\"index()\" />\n </td>\n } @else if (layoutColumn.kind === \"detail\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'detail'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n (toggleExpand)=\"toggleDetail()\">\n <span [class]=\"detailToggleClass()\">\n <mona-grid-toggle\n [expanded]=\"expanded()\"\n [label]=\"detailToggleLabel()\"\n [type]=\"'detail'\"\n [width]=\"gridService.detailColumnWidth\"\n (expandedChange)=\"toggleDetail()\" />\n </span>\n </td>\n } @else if (layoutColumn.kind === \"selection\") {\n <td\n monaGridCell\n [monaGridLockedCell]=\"layoutColumn.key\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [rowIndex]=\"index()\"\n [rowUid]=\"row().uid\"\n [section]=\"'body'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\">\n <mona-grid-selection-checkbox [row]=\"row()\" [rowIndex]=\"index()\" />\n </td>\n }\n}\n"
2101
2118
  }]
2102
2119
  }],
2103
2120
  propDecorators: {
@@ -2129,4 +2146,4 @@ i0.ɵɵngDeclareClassMetadata({
2129
2146
  });
2130
2147
  export { GridCellDirective as i, GridGroupRowComponent as n, GridAddRowComponent as r, GridRowComponent as t };
2131
2148
 
2132
- //# sourceMappingURL=nanahoshi-mona-ui-grid-grid-row.component-Df2gfS0X.mjs.map
2149
+ //# sourceMappingURL=nanahoshi-mona-ui-grid-grid-row.component-eET6dh2Q.mjs.map
@@ -1,7 +1,7 @@
1
- import { G as GridService, P as gridListTableThemeVariants, Z as GridNavigationService, _ as gridFooterThemeVariants, g as gridFooterTableThemeVariants, j as gridListBaseThemeVariants } from "./nanahoshi-mona-ui-grid-grid.styles-aPD3c2A6.mjs";
2
- import { n as GridGroupRowComponent, r as GridAddRowComponent, t as GridRowComponent } from "./nanahoshi-mona-ui-grid-grid-row.component-Df2gfS0X.mjs";
3
- import { t as GridColgroupComponent } from "./nanahoshi-mona-ui-grid-grid-colgroup.component-Lv3GunpV.mjs";
4
- import { GridFooterRowComponent } from "./nanahoshi-mona-ui-grid-grid-footer-row.component-BYH9XbCV.mjs";
1
+ import { P as gridListTableThemeVariants, _ as gridFooterThemeVariants, g as gridFooterTableThemeVariants, j as gridListBaseThemeVariants, q as GridService, tt as GridNavigationService } from "./nanahoshi-mona-ui-grid-grid.styles-wAf6jsT9.mjs";
2
+ import { n as GridGroupRowComponent, r as GridAddRowComponent, t as GridRowComponent } from "./nanahoshi-mona-ui-grid-grid-row.component-eET6dh2Q.mjs";
3
+ import { t as GridColgroupComponent } from "./nanahoshi-mona-ui-grid-grid-colgroup.component-DpszxgFY.mjs";
4
+ import { GridFooterRowComponent } from "./nanahoshi-mona-ui-grid-grid-footer-row.component-CpvzAcX8.mjs";
5
5
  import * as i0 from "@angular/core";
6
6
  import { Component, DestroyRef, ElementRef, Injector, afterNextRender, computed, effect, inject, input, untracked, viewChild } from "@angular/core";
7
7
  import { ImmutableList } from "@mirei/ts-collections";
@@ -327,4 +327,4 @@ i0.ɵɵngDeclareClassMetadata({
327
327
  });
328
328
  export { GridVirtualListComponent };
329
329
 
330
- //# sourceMappingURL=nanahoshi-mona-ui-grid-grid-virtual-list.component-xjrcCXXF.mjs.map
330
+ //# sourceMappingURL=nanahoshi-mona-ui-grid-grid-virtual-list.component-8h2EMexB.mjs.map