@nanahoshi/mona-ui 0.27.2 → 0.28.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 (208) hide show
  1. package/docs/api/chart.md +2 -2
  2. package/docs/api/popup.md +1 -1
  3. package/docs/api/theme.md +2 -2
  4. package/docs/chart.md +14 -0
  5. package/docs/editor.md +2 -0
  6. package/docs/installation.md +147 -15
  7. package/docs/introduction.md +37 -15
  8. package/docs/theming-built-in-themes.md +67 -0
  9. package/docs/theming-custom-colors.md +274 -0
  10. package/docs/theming-custom-themes.md +168 -0
  11. package/docs/theming.md +164 -248
  12. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  13. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  14. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  15. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  16. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  17. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
  18. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  19. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  20. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  21. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  22. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  23. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
  24. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  25. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  26. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  27. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  28. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  29. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
  30. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  31. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
  32. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  33. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  34. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  35. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  36. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  37. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
  38. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  39. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  40. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  41. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  42. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  43. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  44. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  45. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  46. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  47. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  48. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  49. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  50. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
  51. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  52. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  53. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  54. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  55. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  56. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  57. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  58. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  59. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  60. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  61. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  62. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  63. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  64. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  65. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  66. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  67. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  68. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  69. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  70. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  71. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  72. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  73. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  74. package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
  75. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  76. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  77. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  78. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  79. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  80. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  81. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  82. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  83. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  84. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  85. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  86. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  87. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  88. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  89. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  90. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  91. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  92. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  93. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  94. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  95. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  96. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  97. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  98. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  99. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  100. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  101. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  102. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  103. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  104. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  105. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  106. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  107. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  108. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  109. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  110. package/llms.txt +6 -2
  111. package/package.json +62 -23
  112. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  113. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  114. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  115. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  116. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  117. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  118. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  119. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  120. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  121. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  122. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  123. package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
  124. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  125. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  126. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  127. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  128. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  129. package/types/nanahoshi-mona-ui-common.d.ts +354 -385
  130. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  131. package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
  132. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  133. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  134. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  135. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  136. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  137. package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
  138. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  139. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  140. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  141. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  142. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  143. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  144. package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
  145. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  146. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  147. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  148. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  149. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  150. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  151. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  152. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  153. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  154. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  155. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  156. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  157. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  158. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  159. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  160. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  161. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  162. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  163. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  164. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  165. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  166. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  167. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  168. package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
  169. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  170. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  171. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  172. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  173. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  174. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  175. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  176. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  177. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  178. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  179. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  180. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  181. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  182. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  183. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  184. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  185. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  186. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  187. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  188. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  189. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  190. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  191. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  192. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  193. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  194. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  195. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  196. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  197. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  198. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  199. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  200. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  201. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  202. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  203. package/types/nanahoshi-mona-ui.d.ts +1 -2
  204. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  205. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  206. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  207. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  208. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,2 +1 @@
1
-
2
- export { };
1
+ export {}
@@ -1,181 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, computed, input, Directive, Component } from '@angular/core';
3
- import { G as GridService, x as gridFooterTableCellThemeVariants, y as gridFooterTableRowThemeVariants, a as GridLockedCellDirective, k as GridLogicalCellDirective } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs';
4
- import { NgTemplateOutlet } from '@angular/common';
5
- import { ImmutableDictionary } from '@mirei/ts-collections';
6
-
7
- class GridFooterTableCellDirective {
8
- constructor() {
9
- this.#gridService = inject(GridService, { optional: true });
10
- this.className = computed(() => {
11
- return (gridFooterTableCellThemeVariants() +
12
- (this.#gridService?.virtualScrollOptions().enabled
13
- ? " h-(--mona-grid-row-height) max-h-(--mona-grid-row-height) overflow-hidden py-0! align-middle"
14
- : ""));
15
- }, /* @ts-ignore */
16
- ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
17
- this.minWidth = computed(() => this.footerColumn()?.minWidth ?? this.footerCellMinWidth(), /* @ts-ignore */
18
- ...(ngDevMode ? [{ debugName: "minWidth" }] : /* istanbul ignore next */ []));
19
- this.width = computed(() => this.footerColumn()?.calculatedWidth ?? this.footerCellWidth(), /* @ts-ignore */
20
- ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
21
- this.footerCellMinWidth = input(null, /* @ts-ignore */
22
- ...(ngDevMode ? [{ debugName: "footerCellMinWidth" }] : /* istanbul ignore next */ []));
23
- this.footerCellWidth = input(null, /* @ts-ignore */
24
- ...(ngDevMode ? [{ debugName: "footerCellWidth" }] : /* istanbul ignore next */ []));
25
- this.footerColumn = input(null, /* @ts-ignore */
26
- ...(ngDevMode ? [{ debugName: "footerColumn" }] : /* istanbul ignore next */ []));
27
- }
28
- #gridService;
29
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFooterTableCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
30
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridFooterTableCellDirective, isStandalone: true, selector: "td[monaGridFooterTableCell]", inputs: { footerCellMinWidth: { classPropertyName: "footerCellMinWidth", publicName: "footerCellMinWidth", isSignal: true, isRequired: false, transformFunction: null }, footerCellWidth: { classPropertyName: "footerCellWidth", publicName: "footerCellWidth", isSignal: true, isRequired: false, transformFunction: null }, footerColumn: { classPropertyName: "footerColumn", publicName: "footerColumn", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "gridcell" }, properties: { "class": "className()", "style.width.px": "width()", "style.min-width.px": "minWidth()" } }, ngImport: i0 }); }
31
- }
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFooterTableCellDirective, decorators: [{
33
- type: Directive,
34
- args: [{
35
- selector: "td[monaGridFooterTableCell]",
36
- host: {
37
- "[class]": "className()",
38
- "[style.width.px]": "width()",
39
- "[style.min-width.px]": "minWidth()",
40
- role: "gridcell"
41
- }
42
- }]
43
- }], propDecorators: { footerCellMinWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerCellMinWidth", required: false }] }], footerCellWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerCellWidth", required: false }] }], footerColumn: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerColumn", required: false }] }] } });
44
-
45
- class GridFooterCellComponent {
46
- constructor() {
47
- this.#gridService = inject(GridService);
48
- this.aggregate = computed(() => {
49
- const field = this.column().field;
50
- const groupKey = this.groupKey();
51
- if (groupKey == null) {
52
- return this.aggregateMap().get(field) ?? null;
53
- }
54
- return this.#gridService.groupAggregateMap().get(groupKey)?.aggregates.get(field) ?? null;
55
- }, /* @ts-ignore */
56
- ...(ngDevMode ? [{ debugName: "aggregate" }] : /* istanbul ignore next */ []));
57
- this.aggregateMap = computed(() => {
58
- const groupKey = this.groupKey();
59
- if (groupKey == null) {
60
- return this.#gridService.aggregateMap();
61
- }
62
- return (this.#gridService.groupAggregateMap().get(groupKey)?.aggregates ??
63
- ImmutableDictionary.create());
64
- }, /* @ts-ignore */
65
- ...(ngDevMode ? [{ debugName: "aggregateMap" }] : /* istanbul ignore next */ []));
66
- this.displayValue = computed(() => {
67
- return this.#gridService.resolveAggregateValue(this.aggregate(), this.column().aggregate);
68
- }, /* @ts-ignore */
69
- ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
70
- this.templateContext = computed(() => {
71
- const column = this.column();
72
- const columnIndex = this.columnIndex();
73
- const aggregate = this.aggregate();
74
- const aggregates = this.aggregateMap().toObject(e => e.key, e => e.value);
75
- const value = this.displayValue();
76
- const groupKey = this.groupKey();
77
- if (groupKey == null) {
78
- return {
79
- $implicit: value,
80
- aggregate,
81
- aggregates,
82
- column,
83
- columnIndex,
84
- rows: this.#gridService.aggregateRows()
85
- };
86
- }
87
- const groupFooterAggregate = this.#gridService.groupAggregateMap().get(groupKey);
88
- return {
89
- $implicit: value,
90
- aggregate,
91
- aggregates,
92
- column,
93
- columnIndex,
94
- count: groupFooterAggregate?.count ?? 0,
95
- depth: groupFooterAggregate?.depth ?? 0,
96
- groupKey,
97
- groupValue: groupFooterAggregate?.groupValue,
98
- rows: groupFooterAggregate?.rows ?? []
99
- };
100
- }, /* @ts-ignore */
101
- ...(ngDevMode ? [{ debugName: "templateContext" }] : /* istanbul ignore next */ []));
102
- this.templateRef = computed(() => {
103
- if (this.groupKey() != null) {
104
- return this.column().groupFooterTemplate;
105
- }
106
- return this.column().footerTemplate;
107
- }, /* @ts-ignore */
108
- ...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
109
- this.column = input.required(/* @ts-ignore */
110
- ...(ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []));
111
- this.columnIndex = input.required(/* @ts-ignore */
112
- ...(ngDevMode ? [{ debugName: "columnIndex" }] : /* istanbul ignore next */ []));
113
- this.groupKey = input(null, /* @ts-ignore */
114
- ...(ngDevMode ? [{ debugName: "groupKey" }] : /* istanbul ignore next */ []));
115
- }
116
- #gridService;
117
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFooterCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
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
- @if (templateRef(); as templateRef) {
120
- <ng-container [ngTemplateOutlet]="templateRef" [ngTemplateOutletContext]="templateContext()"></ng-container>
121
- } @else if (displayValue() !== null && displayValue() !== undefined) {
122
- <span class="block truncate font-medium">{{ displayValue() }}</span>
123
- }
124
- `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
125
- }
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFooterCellComponent, decorators: [{
127
- type: Component,
128
- args: [{
129
- selector: "mona-grid-footer-cell",
130
- template: `
131
- @if (templateRef(); as templateRef) {
132
- <ng-container [ngTemplateOutlet]="templateRef" [ngTemplateOutletContext]="templateContext()"></ng-container>
133
- } @else if (displayValue() !== null && displayValue() !== undefined) {
134
- <span class="block truncate font-medium">{{ displayValue() }}</span>
135
- }
136
- `,
137
- imports: [NgTemplateOutlet],
138
- host: {
139
- class: "flex items-center h-full"
140
- }
141
- }]
142
- }], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], columnIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnIndex", required: true }] }], groupKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupKey", required: false }] }] } });
143
-
144
- /**
145
- * An aggregate footer row. Without a group key it shows the grid-wide aggregates,
146
- * otherwise the aggregates of that group.
147
- */
148
- class GridFooterRowComponent {
149
- constructor() {
150
- this.gridService = inject(GridService);
151
- this.rowClass = computed(() => gridFooterTableRowThemeVariants({ virtual: this.gridService.virtualScrollOptions().enabled }), /* @ts-ignore */
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 */ []));
158
- this.groupKey = input(null, /* @ts-ignore */
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 */ []));
166
- }
167
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFooterRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
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"] }] }); }
169
- }
170
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFooterRowComponent, decorators: [{
171
- type: Component,
172
- args: [{ selector: "tr[monaGridFooterRow]", imports: [GridFooterCellComponent, GridFooterTableCellDirective, GridLockedCellDirective, GridLogicalCellDirective], host: {
173
- "[class]": "rowClass()",
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 }] }] } });
179
-
180
- export { GridFooterRowComponent };
181
- //# sourceMappingURL=nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs.map
@@ -1,208 +0,0 @@
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-LCzfCYd3.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-BpnybNcs.mjs';
10
- import { NgTemplateOutlet } from '@angular/common';
11
- import { GridFooterRowComponent } from './nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.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: ["aria-label", "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-ihQIKeP-.mjs.map