@masterteam/data-table 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2578 @@
1
+ import { mtEntityExportValue, mtEntityColumn, mtEntityCellValues } from '@masterteam/data-table';
2
+ export * from '@masterteam/data-table';
3
+ import * as i0 from '@angular/core';
4
+ import { InjectionToken, inject, computed, Injectable, input, ChangeDetectionStrategy, Component, viewChild, effect, untracked, makeEnvironmentProviders, output, Injector, ElementRef, DestroyRef, signal, afterNextRender } from '@angular/core';
5
+ import { TableValueResolver, MT_TABLE_RENDERER, TableExportService } from '@masterteam/components/table';
6
+ import { NgTemplateOutlet } from '@angular/common';
7
+ import { CHART_TYPES, parseGridViewState, MtDataGridComponent, AUTO_GROUP_COLUMN_ID, applyGridViewState, captureGridViewState } from '@masterteam/data-grid';
8
+ import { toSignal } from '@angular/core/rxjs-interop';
9
+ import { TranslocoService } from '@jsverse/transloco';
10
+ import { CdkTrapFocus } from '@angular/cdk/a11y';
11
+ import * as i1 from '@angular/forms';
12
+ import { FormsModule } from '@angular/forms';
13
+ import { Button } from '@masterteam/components/button';
14
+ import { TextField } from '@masterteam/components/text-field';
15
+ import { Menu } from '@masterteam/components/menu';
16
+ import { Popover } from 'primeng/popover';
17
+ import { ConfirmationService } from '@masterteam/components/confirmation';
18
+
19
+ const MT_DATA_TABLE_CONFIGURATION = new InjectionToken('MT_DATA_TABLE_CONFIGURATION', {
20
+ providedIn: 'root',
21
+ factory: () => ({ identity: () => null }),
22
+ });
23
+
24
+ const axisLabels = {
25
+ 'line enabled': 'إظهار الخط',
26
+ 'line width': 'سُمك الخط',
27
+ 'line colour': 'لون الخط',
28
+ 'ticks enabled': 'إظهار التدريجات',
29
+ 'tick width': 'سُمك التدريج',
30
+ 'tick size': 'حجم التدريج',
31
+ 'labels enabled': 'إظهار التسميات',
32
+ 'label font size': 'حجم خط التسمية',
33
+ 'label colour': 'لون التسمية',
34
+ 'label rotation': 'زاوية التسمية',
35
+ 'gridlines enabled': 'إظهار خطوط الشبكة',
36
+ 'gridline width': 'سُمك خطوط الشبكة',
37
+ 'gridline colour': 'لون خطوط الشبكة',
38
+ };
39
+ /** Package defaults; products override source-message keys in components.dataGrid. */
40
+ const MT_TABLE_GRID_AR = {
41
+ 'Data grid': 'جدول البيانات',
42
+ 'No Rows To Show': 'لا توجد سجلات للعرض',
43
+ 'Loading…': 'جارٍ التحميل…',
44
+ 'Loading...': 'جارٍ التحميل…',
45
+ '(Default)': '(افتراضي)',
46
+ '(Blanks)': '(فارغ)',
47
+ '(Select All)': '(تحديد الكل)',
48
+ '(Select All Search Results)': '(تحديد كل نتائج البحث)',
49
+ 'Row Groups': 'مجموعات الصفوف',
50
+ 'Column Labels': 'تسميات الأعمدة',
51
+ Values: 'القيم',
52
+ Columns: 'الأعمدة',
53
+ Column: 'عمودي',
54
+ 'Column Group': 'مجموعة أعمدة',
55
+ Filters: 'عوامل التصفية',
56
+ visible: 'ظاهر',
57
+ hidden: 'مخفي',
58
+ true: 'نعم',
59
+ false: 'لا',
60
+ hex: 'رمز اللون',
61
+ 'Column Menu': 'قائمة العمود',
62
+ 'Context Menu': 'قائمة السياق',
63
+ 'Column Filter': 'تصفية العمود',
64
+ 'Choose Columns': 'اختيار الأعمدة',
65
+ 'Pivot Mode': 'الوضع المحوري',
66
+ 'Drag here to set row groups': 'اسحب هنا لتجميع الصفوف',
67
+ 'Drag here to set column labels': 'اسحب هنا لتعيين تسميات الأعمدة',
68
+ 'Drag here to aggregate': 'اسحب هنا لتجميع القيم',
69
+ "Pivot columns — a dropped column's values become column headers": 'أعمدة محورية — تصبح قيم العمود المسحوب رؤوس أعمدة',
70
+ 'Filter Columns Input': 'بحث الأعمدة',
71
+ 'Column with Header Selection': 'عمود مع تحديد الرأس',
72
+ 'Toggle All Columns Visibility': 'تبديل ظهور كل الأعمدة',
73
+ 'Column List': 'قائمة الأعمدة',
74
+ 'Press SPACE to toggle visibility (': 'اضغط مسافة لتبديل الظهور (',
75
+ 'Search columns': 'بحث الأعمدة',
76
+ 'Search columns...': 'بحث الأعمدة…',
77
+ 'Search filters': 'بحث عوامل التصفية',
78
+ 'Search filters...': 'بحث عوامل التصفية…',
79
+ 'Search filter values': 'بحث قيم التصفية',
80
+ 'Search...': 'بحث…',
81
+ 'No columns': 'لا توجد أعمدة',
82
+ 'No matches.': 'لا توجد نتائج مطابقة.',
83
+ 'Quick filter': 'بحث سريع',
84
+ 'Add Filter': 'إضافة تصفية',
85
+ 'Add Filter Field': 'إضافة شرط تصفية',
86
+ 'Delete Filter': 'حذف التصفية',
87
+ 'Open Filter Menu': 'فتح قائمة التصفية',
88
+ 'Filter List': 'قائمة التصفية',
89
+ 'Filtering operator': 'معامل التصفية',
90
+ 'Filter join operator': 'معامل ربط الشروط',
91
+ 'Filter...': 'تصفية…',
92
+ 'Filter Value': 'قيمة التصفية',
93
+ 'Filter from value': 'قيمة بداية التصفية',
94
+ 'Filter to Value': 'قيمة نهاية التصفية',
95
+ From: 'من',
96
+ To: 'إلى',
97
+ 'Text Filter': 'تصفية نصية',
98
+ 'Number Filter': 'تصفية رقمية',
99
+ 'Date Filter': 'تصفية تاريخ',
100
+ 'Set Filter': 'تصفية قيم',
101
+ 'Date Filter Input': 'حقل تصفية التاريخ',
102
+ '{column} Filter Input': 'حقل تصفية {column}',
103
+ Contains: 'يحتوي على',
104
+ 'Does not contain': 'لا يحتوي على',
105
+ Equals: 'يساوي',
106
+ 'Does not equal': 'لا يساوي',
107
+ 'Begins with': 'يبدأ بـ',
108
+ 'Ends with': 'ينتهي بـ',
109
+ 'Greater than': 'أكبر من',
110
+ 'Greater than or equal to': 'أكبر من أو يساوي',
111
+ 'Less than': 'أقل من',
112
+ 'Less than or equal to': 'أقل من أو يساوي',
113
+ Between: 'بين',
114
+ Blank: 'فارغ',
115
+ 'Not blank': 'غير فارغ',
116
+ Before: 'قبل',
117
+ After: 'بعد',
118
+ AND: 'و',
119
+ OR: 'أو',
120
+ Apply: 'تطبيق',
121
+ Reset: 'إعادة ضبط',
122
+ Cancel: 'إلغاء',
123
+ Clear: 'مسح',
124
+ Close: 'إغلاق',
125
+ 'Select Field': 'اختيار حقل',
126
+ 'Sort Ascending': 'ترتيب تصاعدي',
127
+ 'Sort Descending': 'ترتيب تنازلي',
128
+ 'Clear Sort': 'مسح الترتيب',
129
+ 'Pin Column': 'تثبيت العمود',
130
+ 'No Pin': 'إلغاء التثبيت',
131
+ 'Pin Left': 'تثبيت يسارًا',
132
+ 'Pin Right': 'تثبيت يمينًا',
133
+ 'Autosize This Column': 'ضبط عرض العمود تلقائيًا',
134
+ 'Autosize All Columns': 'ضبط عرض كل الأعمدة تلقائيًا',
135
+ 'Reset Columns': 'إعادة ضبط الأعمدة',
136
+ 'Group by {column}': 'تجميع حسب {column}',
137
+ 'Un-Group by {column}': 'إلغاء التجميع حسب {column}',
138
+ 'Remove from Values': 'إزالة من القيم',
139
+ 'Add to Values': 'إضافة إلى القيم',
140
+ 'Remove from Labels': 'إزالة من التسميات',
141
+ 'Add to Labels': 'إضافة إلى التسميات',
142
+ 'Expand All': 'توسيع الكل',
143
+ 'Collapse All': 'طي الكل',
144
+ 'Expand All Column Groups': 'توسيع كل مجموعات الأعمدة',
145
+ 'Collapse All Column Groups': 'طي كل مجموعات الأعمدة',
146
+ Expand: 'توسيع',
147
+ Collapse: 'طي',
148
+ Remove: 'إزالة',
149
+ Reorder: 'إعادة ترتيب',
150
+ Resize: 'تغيير حجم',
151
+ Cut: 'قص',
152
+ Copy: 'نسخ',
153
+ 'Copy with Headers': 'نسخ مع الرؤوس',
154
+ 'Copy with Group Headers': 'نسخ مع رؤوس المجموعات',
155
+ Paste: 'لصق',
156
+ Export: 'تصدير',
157
+ 'CSV Export': 'تصدير CSV',
158
+ 'Excel Export (.xlsx)': 'تصدير Excel (.xlsx)',
159
+ 'PDF Export': 'تصدير PDF',
160
+ Pagination: 'ترقيم الصفحات',
161
+ Page: 'صفحة',
162
+ 'Page number,': 'رقم الصفحة،',
163
+ 'Page Size': 'حجم الصفحة',
164
+ 'Page Size:': 'حجم الصفحة:',
165
+ 'First Page': 'الصفحة الأولى',
166
+ 'Last Page': 'الصفحة الأخيرة',
167
+ 'Next Page': 'الصفحة التالية',
168
+ 'Previous Page': 'الصفحة السابقة',
169
+ of: 'من',
170
+ to: 'إلى',
171
+ Rows: 'الصفوف',
172
+ 'Total Rows': 'إجمالي الصفوف',
173
+ 'Filtered Rows': 'الصفوف المصفاة',
174
+ Selected: 'المحدد',
175
+ 'Row Number': 'رقم الصف',
176
+ Count: 'العدد',
177
+ Sum: 'المجموع',
178
+ Min: 'الأدنى',
179
+ Max: 'الأعلى',
180
+ Avg: 'المتوسط',
181
+ Average: 'المتوسط',
182
+ Total: 'الإجمالي',
183
+ First: 'الأول',
184
+ Last: 'الأخير',
185
+ None: 'بدون',
186
+ count: 'العدد',
187
+ sum: 'المجموع',
188
+ min: 'الأدنى',
189
+ max: 'الأعلى',
190
+ avg: 'المتوسط',
191
+ first: 'الأول',
192
+ last: 'الأخير',
193
+ Chart: 'الرسم البياني',
194
+ Data: 'البيانات',
195
+ Format: 'التنسيق',
196
+ 'Advanced settings': 'إعدادات متقدمة',
197
+ 'Choose at least two series in Data.': 'اختر سلسلتين على الأقل من البيانات.',
198
+ 'Choose three series in Data: X, Y and bubble size.': 'اختر ثلاث سلاسل من البيانات: س وص وحجم الفقاعة.',
199
+ 'Choose series': 'اختيار السلاسل',
200
+ 'Category axis': 'محور الفئات',
201
+ 'Value axis': 'محور القيم',
202
+ 'Chart Range': 'رسم النطاق',
203
+ 'Range Chart': 'رسم النطاق',
204
+ 'Horizontal chart scroll': 'تمرير المخطط أفقياً',
205
+ 'Vertical chart scroll': 'تمرير المخطط عمودياً',
206
+ '{series} by {category}': '{series} حسب {category}',
207
+ 'Chart Menu': 'قائمة الرسم البياني',
208
+ 'Chart legend': 'مفتاح الرسم البياني',
209
+ 'Chart toolbar': 'شريط أدوات الرسم',
210
+ 'Chart settings': 'إعدادات الرسم',
211
+ 'Chart type': 'نوع الرسم',
212
+ 'Chart tool panel width': 'عرض لوحة الرسم',
213
+ 'Close chart tool panel': 'إغلاق لوحة الرسم',
214
+ 'No data available to be charted.': 'لا توجد بيانات متاحة للرسم.',
215
+ 'Edit Chart': 'تحرير الرسم',
216
+ 'Advanced Settings': 'إعدادات متقدمة',
217
+ 'Link to Grid': 'ربط بالجدول',
218
+ 'Unlink from Grid': 'فصل عن الجدول',
219
+ 'Download Chart': 'تنزيل الرسم',
220
+ Maximize: 'تكبير',
221
+ Restore: 'استعادة الحجم',
222
+ 'Next legend page': 'الصفحة التالية من المفتاح',
223
+ 'Previous legend page': 'الصفحة السابقة من المفتاح',
224
+ Categories: 'الفئات',
225
+ Category: 'الفئة',
226
+ Series: 'السلاسل',
227
+ Aggregation: 'التجميع',
228
+ 'Aggregation Function': 'دالة التجميع',
229
+ 'Switch Category / Series': 'تبديل الفئة والسلسلة',
230
+ Themes: 'السمات',
231
+ Range: 'النطاق',
232
+ 'Select range': 'اختيار نطاق',
233
+ 'Used as category': 'مستخدم كفئة',
234
+ Records: 'السجلات',
235
+ Measures: 'المقاييس',
236
+ Measure: 'المقياس',
237
+ Analysis: 'التحليل',
238
+ 'Count of records': 'عدد السجلات',
239
+ 'Non-empty {column}': '{column} غير الفارغة',
240
+ 'Distinct {column}': 'القيم المميزة في {column}',
241
+ Unassigned: 'غير محدد',
242
+ Recommended: 'موصى به',
243
+ 'multi-value': 'متعدد القيم',
244
+ 'Needs a numeric series': 'يتطلب سلسلة رقمية',
245
+ 'Shares of a multi-value category overlap': 'حصص الفئة متعددة القيم متداخلة ولا تصلح للرسم النسبي',
246
+ 'Each record counts once in every category it belongs to; totals can exceed the number of records.': 'يُحتسب كل سجل مرة واحدة في كل فئة ينتمي إليها، وقد تتجاوز المجاميع عدد السجلات.',
247
+ 'Measures count records per category; numeric series use the aggregation below.': 'تحسب المقاييس السجلات في كل فئة، أما السلاسل الرقمية فتستخدم التجميع أدناه.',
248
+ 'No numeric columns in this range.': 'لا توجد أعمدة رقمية في هذا النطاق.',
249
+ 'Additional columns are unused by this type': 'هذا النوع لا يستخدم الأعمدة الإضافية',
250
+ ', Alt+Up or Alt+Down to reorder': '، Alt+أعلى أو Alt+أسفل لإعادة الترتيب',
251
+ 'Secondary axis': 'محور ثانوي',
252
+ 'Rows {start}–{end}': 'الصفوف {start}–{end}',
253
+ 'Columns {columns}': 'الأعمدة {columns}',
254
+ 'All matching rows': 'كل الصفوف المطابقة',
255
+ 'Selected rows: {count}': 'الصفوف المحددة: {count}',
256
+ Bar: 'شريطي',
257
+ 'Stacked Column': 'أعمدة مكدسة',
258
+ '100% Stacked Column': 'أعمدة مكدسة بنسبة ١٠٠٪',
259
+ 'Stacked Bar': 'أشرطة مكدسة',
260
+ '100% Stacked Bar': 'أشرطة مكدسة بنسبة ١٠٠٪',
261
+ Pie: 'دائري',
262
+ Donut: 'حلقي',
263
+ Line: 'خطي',
264
+ 'Stacked Line': 'خطوط مكدسة',
265
+ '100% Stacked Line': 'خطوط مكدسة بنسبة ١٠٠٪',
266
+ Area: 'مساحي',
267
+ 'Stacked Area': 'مساحات مكدسة',
268
+ '100% Stacked Area': 'مساحات مكدسة بنسبة ١٠٠٪',
269
+ Scatter: 'مبعثر',
270
+ Bubble: 'فقاعي',
271
+ Polar: 'قطبي',
272
+ 'Radar Line': 'راداري خطي',
273
+ 'Radar Area': 'راداري مساحي',
274
+ Nightingale: 'وردة قطبية',
275
+ 'Radial Column': 'أعمدة شعاعية',
276
+ 'Radial Bar': 'أشرطة شعاعية',
277
+ Statistical: 'إحصائي',
278
+ 'Box Plot': 'صندوقي',
279
+ Histogram: 'مدرج تكراري',
280
+ 'Range Bar': 'أشرطة نطاق',
281
+ 'Range Area': 'مساحة نطاق',
282
+ Hierarchical: 'هرمي',
283
+ Treemap: 'خريطة شجرية',
284
+ Sunburst: 'حلقات شجرية',
285
+ Specialized: 'متخصص',
286
+ Heatmap: 'خريطة حرارية',
287
+ Waterfall: 'شلالي',
288
+ Funnel: 'قمعي',
289
+ 'Cone Funnel': 'قمع مخروطي',
290
+ Pyramid: 'هرمي متدرج',
291
+ Combination: 'مركب',
292
+ 'Column & Line': 'أعمدة وخط',
293
+ 'Area & Column': 'مساحة وأعمدة',
294
+ 'Custom Combo': 'رسم مركب مخصص',
295
+ Titles: 'العناوين',
296
+ Title: 'العنوان',
297
+ Subtitle: 'العنوان الفرعي',
298
+ Legend: 'المفتاح',
299
+ Axes: 'المحاور',
300
+ Tooltip: 'التلميحات',
301
+ Navigator: 'المستكشف',
302
+ Position: 'الموضع',
303
+ Spacing: 'التباعد',
304
+ Number: 'الرقم',
305
+ 'Title enabled': 'إظهار العنوان',
306
+ 'Subtitle enabled': 'إظهار العنوان الفرعي',
307
+ 'Title text': 'نص العنوان',
308
+ 'Subtitle text': 'نص العنوان الفرعي',
309
+ 'Padding top': 'الهامش العلوي',
310
+ 'Padding right': 'الهامش الأيمن',
311
+ 'Padding bottom': 'الهامش السفلي',
312
+ 'Padding left': 'الهامش الأيسر',
313
+ 'Background enabled': 'إظهار الخلفية',
314
+ 'Background colour': 'لون الخلفية',
315
+ 'Legend enabled': 'إظهار المفتاح',
316
+ 'Item font size': 'حجم خط العنصر',
317
+ 'Marker size': 'حجم العلامة',
318
+ 'Marker shape': 'شكل العلامة',
319
+ 'Number format': 'تنسيق الرقم',
320
+ 'Labels enabled': 'إظهار التسميات',
321
+ 'Label font size': 'حجم خط التسمية',
322
+ 'Label placement': 'موضع التسمية',
323
+ 'Fill opacity': 'عتامة التعبئة',
324
+ 'Stroke width': 'سُمك الحد',
325
+ 'Stroke opacity': 'عتامة الحد',
326
+ 'Line width': 'سُمك الخط',
327
+ 'Line dash': 'نمط الخط',
328
+ 'Markers enabled': 'إظهار العلامات',
329
+ 'Sector stroke width': 'سُمك حدود القطاعات',
330
+ 'Callout labels enabled': 'إظهار تسميات الشرح',
331
+ 'Callout length': 'طول خط الشرح',
332
+ 'Callout font size': 'حجم خط الشرح',
333
+ 'Inner radius': 'نصف القطر الداخلي',
334
+ 'Start angle': 'زاوية البداية',
335
+ 'Min bubble size': 'أصغر حجم فقاعة',
336
+ 'Max bubble size': 'أكبر حجم فقاعة',
337
+ 'Corner radius': 'استدارة الزوايا',
338
+ 'Shadow enabled': 'إظهار الظل',
339
+ 'Shadow blur': 'تمويه الظل',
340
+ 'Shadow offset': 'إزاحة الظل',
341
+ 'Radar area opacity': 'عتامة المساحة الرادارية',
342
+ 'Rose type': 'نوع الوردة',
343
+ 'Bar width': 'عرض الشريط',
344
+ 'Node gap': 'تباعد العقد',
345
+ 'Square ratio': 'نسبة التربيع',
346
+ Gap: 'التباعد',
347
+ Sort: 'الترتيب',
348
+ 'Minimum width': 'أقل عرض',
349
+ 'Box width': 'عرض الصندوق',
350
+ 'Border style': 'نمط الحد',
351
+ 'Bin count': 'عدد الفئات',
352
+ 'Bar gap': 'تباعد الأشرطة',
353
+ 'Range width': 'عرض النطاق',
354
+ 'Column width': 'عرض العمود',
355
+ 'Tooltip enabled': 'إظهار التلميحات',
356
+ 'Snap to nearest': 'محاذاة إلى الأقرب',
357
+ 'Navigator enabled': 'إظهار المستكشف',
358
+ 'Navigator height': 'ارتفاع المستكشف',
359
+ Top: 'أعلى',
360
+ Right: 'يمين',
361
+ Bottom: 'أسفل',
362
+ Left: 'يسار',
363
+ Circle: 'دائرة',
364
+ Square: 'مربع',
365
+ Diamond: 'معين',
366
+ Triangle: 'مثلث',
367
+ Inside: 'داخل',
368
+ Outside: 'خارج',
369
+ Solid: 'متصل',
370
+ Dashed: 'متقطع',
371
+ Dotted: 'منقط',
372
+ Radius: 'نصف القطر',
373
+ Ascending: 'تصاعدي',
374
+ Descending: 'تنازلي',
375
+ List: 'قائمة',
376
+ 'font size': 'حجم الخط',
377
+ bold: 'عريض',
378
+ italic: 'مائل',
379
+ colour: 'اللون',
380
+ slider: 'شريط التمرير',
381
+ type: 'النوع',
382
+ settings: 'الإعدادات',
383
+ data: 'البيانات',
384
+ format: 'التنسيق',
385
+ 'tool panel': 'لوحة الأدوات',
386
+ ...Object.fromEntries(['Category', 'Number'].flatMap((axis) => Object.entries(axisLabels).map(([suffix, label]) => [
387
+ `${axis} ${suffix}`,
388
+ `${label} (${axis === 'Category' ? 'الفئة' : 'القيمة'})`,
389
+ ]))),
390
+ };
391
+
392
+ const TEXT = {
393
+ selectRow: ['Select row', 'تحديد الصف'],
394
+ selectAll: ['Select all rows on this page', 'تحديد كل الصفوف في هذه الصفحة'],
395
+ search: ['Search', 'بحث'],
396
+ columns: ['Columns', 'الأعمدة'],
397
+ rowActions: ['Row actions', 'إجراءات السجل'],
398
+ actions: ['Actions', 'الإجراءات'],
399
+ groupBy: ['Group by', 'تجميع حسب'],
400
+ noGrouping: ['No grouping', 'بدون تجميع'],
401
+ analysis: ['Analysis', 'التحليل'],
402
+ export: ['Export', 'تصدير'],
403
+ csv: ['CSV', 'CSV'],
404
+ excel: ['Excel', 'Excel'],
405
+ pdf: ['PDF', 'PDF'],
406
+ print: ['Print', 'طباعة'],
407
+ focus: ['Focus table', 'توسيع الجدول'],
408
+ closeFocus: ['Close focus view', 'إغلاق العرض الموسع'],
409
+ retry: ['Try again', 'إعادة المحاولة'],
410
+ failed: ['Unable to load this table.', 'تعذر تحميل هذا الجدول.'],
411
+ exportFailed: ['Export failed. Try again.', 'تعذر التصدير. حاول مرة أخرى.'],
412
+ noRows: ['No records', 'لا توجد سجلات'],
413
+ loading: ['Loading…', 'جارٍ التحميل…'],
414
+ reset: ['Reset view', 'إعادة ضبط العرض'],
415
+ rows: ['records', 'سجل'],
416
+ previous: ['Previous page', 'الصفحة السابقة'],
417
+ next: ['Next page', 'الصفحة التالية'],
418
+ pageSize: ['Rows per page', 'عدد الصفوف في الصفحة'],
419
+ page: ['Page', 'الصفحة'],
420
+ compare: ['Compare selected records', 'مقارنة السجلات المحددة'],
421
+ close: ['Close', 'إغلاق'],
422
+ incomplete: [
423
+ 'Whole-table analysis is unavailable until the complete result is loaded.',
424
+ 'يتاح تحليل الجدول بعد تحميل جميع النتائج.',
425
+ ],
426
+ chart: ['Chart table', 'رسم بياني للجدول'],
427
+ chartSelection: ['Chart selection', 'رسم بياني للتحديد'],
428
+ };
429
+ /** Product translations override package defaults. Language changes remain reactive. */
430
+ class MtTableText {
431
+ transloco = inject(TranslocoService);
432
+ language = toSignal(this.transloco.langChanges$, {
433
+ initialValue: this.transloco.getActiveLang(),
434
+ equal: () => false,
435
+ });
436
+ translationEvents = toSignal(this.transloco.events$);
437
+ gridLocale = computed(() => {
438
+ this.translationEvents();
439
+ const language = this.language();
440
+ const translation = this.transloco.getTranslation(language);
441
+ const prefix = 'components.dataGrid.';
442
+ const overrides = Object.fromEntries(Object.entries(translation)
443
+ .filter(([key, value]) => key.startsWith(prefix) && typeof value === 'string')
444
+ .map(([key, value]) => [key.slice(prefix.length), value]));
445
+ return {
446
+ ...(language.startsWith('ar') ? MT_TABLE_GRID_AR : {}),
447
+ ...overrides,
448
+ };
449
+ }, ...(ngDevMode ? [{ debugName: "gridLocale" }] : /* istanbul ignore next */ []));
450
+ text(key) {
451
+ this.translationEvents();
452
+ const language = this.language();
453
+ const path = `components.dataTable.${key}`;
454
+ const translation = this.transloco.getTranslation(language);
455
+ const override = translation['components']?.dataTable?.[key] ?? translation[path];
456
+ return typeof override === 'string'
457
+ ? override
458
+ : TEXT[key][language.startsWith('ar') ? 1 : 0];
459
+ }
460
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTableText, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
461
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTableText, providedIn: 'root' });
462
+ }
463
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTableText, decorators: [{
464
+ type: Injectable,
465
+ args: [{ providedIn: 'root' }]
466
+ }] });
467
+
468
+ function captureMtTableChart(model, api, wholeTable = false) {
469
+ const rows = [];
470
+ api.forEachNodeAfterFilterAndSort((node) => rows.push(node.id));
471
+ return {
472
+ options: {
473
+ chartType: model.chartType,
474
+ title: model.chart.title,
475
+ chartContext: model.chartContext,
476
+ chartThemeName: model.chartThemeName,
477
+ chartThemeOverrides: model.chartThemeOverrides,
478
+ categoryId: model.categoryId,
479
+ seriesIds: model.seriesIds,
480
+ aggFunc: model.aggFunc,
481
+ seriesChartTypes: model.seriesChartTypes,
482
+ switchCategorySeries: model.switchCategorySeries,
483
+ },
484
+ ranges: model.cellRanges.map((range) => {
485
+ if (wholeTable || range.rowIds === null)
486
+ return { columns: range.columns, rowIds: null };
487
+ if (range.rowIds !== undefined)
488
+ return { columns: range.columns, rowIds: range.rowIds };
489
+ if (range.rowStartIndex == null && range.rowEndIndex == null)
490
+ return { columns: range.columns, rowIds: null };
491
+ const rowIds = [];
492
+ for (let index = range.rowStartIndex ?? 0; index <= (range.rowEndIndex ?? rows.length - 1); index++) {
493
+ const id = rows[index];
494
+ if (id !== undefined)
495
+ rowIds.push(id);
496
+ }
497
+ return { columns: range.columns, rowIds };
498
+ }),
499
+ };
500
+ }
501
+ function restoreMtTableChart(saved, api) {
502
+ const fields = new Set([
503
+ ...api.getColumnState().map((column) => column.colId),
504
+ ...api.getPivotResultColumns(),
505
+ ]);
506
+ const ranges = saved.ranges.flatMap((range) => {
507
+ const columns = range.columns.filter((column) => fields.has(column));
508
+ if (!columns.length)
509
+ return [];
510
+ return [{ columns, rowIds: range.rowIds }];
511
+ });
512
+ return ranges.length
513
+ ? {
514
+ ...saved.options,
515
+ categoryId: fields.has(saved.options.categoryId ?? '')
516
+ ? saved.options.categoryId
517
+ : undefined,
518
+ seriesIds: saved.options.seriesIds?.filter((id) => fields.has(id)),
519
+ cellRange: ranges[0],
520
+ cellRanges: ranges.slice(1),
521
+ }
522
+ : null;
523
+ }
524
+ function parseMtTableCharts(value) {
525
+ if (!Array.isArray(value) || value.length > 10)
526
+ return [];
527
+ const strings = (values) => Array.isArray(values) &&
528
+ values.length <= 1000 &&
529
+ values.every((value) => typeof value === 'string' && value.length <= 512);
530
+ return value.flatMap((chart) => {
531
+ if (!chart ||
532
+ typeof chart !== 'object' ||
533
+ !chart.options ||
534
+ !CHART_TYPES.includes(chart.options.chartType) ||
535
+ !Array.isArray(chart.ranges) ||
536
+ chart.ranges.length > 1000 ||
537
+ !chart.ranges.every((range) => range &&
538
+ strings(range.columns) &&
539
+ (range.rowIds === null || strings(range.rowIds))))
540
+ return [];
541
+ const options = chart.options;
542
+ if (options.title !== undefined && typeof options.title !== 'string')
543
+ return [];
544
+ if (options.chartContext !== undefined &&
545
+ typeof options.chartContext !== 'string')
546
+ return [];
547
+ if (options.seriesIds !== undefined && !strings(options.seriesIds))
548
+ return [];
549
+ if (options.categoryId !== undefined &&
550
+ typeof options.categoryId !== 'string')
551
+ return [];
552
+ return [
553
+ {
554
+ options: {
555
+ chartType: options.chartType,
556
+ title: options.title?.slice(0, 500),
557
+ chartContext: options.chartContext?.slice(0, 1000),
558
+ categoryId: options.categoryId,
559
+ seriesIds: options.seriesIds,
560
+ aggFunc: [
561
+ 'sum',
562
+ 'avg',
563
+ 'count',
564
+ 'min',
565
+ 'max',
566
+ 'first',
567
+ 'last',
568
+ ].includes(options.aggFunc ?? '')
569
+ ? options.aggFunc
570
+ : undefined,
571
+ chartThemeName: typeof options.chartThemeName === 'string'
572
+ ? options.chartThemeName
573
+ : undefined,
574
+ chartThemeOverrides: options.chartThemeOverrides &&
575
+ typeof options.chartThemeOverrides === 'object'
576
+ ? options.chartThemeOverrides
577
+ : undefined,
578
+ switchCategorySeries: options.switchCategorySeries === true,
579
+ seriesChartTypes: Array.isArray(options.seriesChartTypes)
580
+ ? options.seriesChartTypes
581
+ .filter((series) => series &&
582
+ typeof series.colId === 'string' &&
583
+ CHART_TYPES.includes(series.chartType))
584
+ .map((series) => ({
585
+ colId: series.colId,
586
+ chartType: series.chartType,
587
+ secondaryAxis: series.secondaryAxis === true,
588
+ }))
589
+ : undefined,
590
+ },
591
+ ranges: chart.ranges.map((range) => ({
592
+ columns: range.columns,
593
+ rowIds: range.rowIds,
594
+ })),
595
+ },
596
+ ];
597
+ });
598
+ }
599
+
600
+ function mtTablePreferenceKey(identity, view) {
601
+ return `mt-table:v1:${JSON.stringify([identity.application, identity.tenant, identity.user, identity.actor, identity.template ?? null, view.level, view.module ?? null, view.role])}`;
602
+ }
603
+ /** Local storage is optional (private browsing/quota/security errors must not break a table). */
604
+ class MtTablePreferences {
605
+ configuration = inject(MT_DATA_TABLE_CONFIGURATION);
606
+ key(view) {
607
+ const identity = this.configuration.identity();
608
+ return identity ? mtTablePreferenceKey(identity, view) : null;
609
+ }
610
+ read(view) {
611
+ const key = this.key(view);
612
+ if (!key || typeof localStorage === 'undefined')
613
+ return null;
614
+ try {
615
+ const text = localStorage.getItem(key);
616
+ if (!text || text.length > 131072)
617
+ return null;
618
+ return parseGridViewState(JSON.parse(text));
619
+ }
620
+ catch {
621
+ return null;
622
+ }
623
+ }
624
+ write(view, state) {
625
+ const key = this.key(view);
626
+ if (!key || typeof localStorage === 'undefined')
627
+ return;
628
+ // Construct the document explicitly: never persist an API/row/query response object.
629
+ const document = {
630
+ version: 1,
631
+ columns: state.columns,
632
+ sort: state.sort,
633
+ filters: state.filters,
634
+ rowGroups: state.rowGroups,
635
+ values: state.values,
636
+ pivot: state.pivot,
637
+ };
638
+ try {
639
+ localStorage.setItem(key, JSON.stringify(document));
640
+ }
641
+ catch {
642
+ /* In-memory layout remains usable. */
643
+ }
644
+ }
645
+ clear(view) {
646
+ const key = this.key(view);
647
+ try {
648
+ if (key && typeof localStorage !== 'undefined')
649
+ localStorage.removeItem(key);
650
+ }
651
+ catch {
652
+ /* Optional storage. */
653
+ }
654
+ }
655
+ readCharts(view, scope) {
656
+ const key = this.key(view);
657
+ if (!key)
658
+ return [];
659
+ try {
660
+ const text = localStorage.getItem(`${key}:charts:${scope}`);
661
+ return text && text.length <= 131072
662
+ ? parseMtTableCharts(JSON.parse(text))
663
+ : [];
664
+ }
665
+ catch {
666
+ return [];
667
+ }
668
+ }
669
+ writeCharts(view, scope, charts) {
670
+ const key = this.key(view);
671
+ if (!key)
672
+ return;
673
+ try {
674
+ const text = JSON.stringify(parseMtTableCharts(charts));
675
+ if (text.length <= 131072)
676
+ localStorage.setItem(`${key}:charts:${scope}`, text);
677
+ }
678
+ catch {
679
+ /* Optional browser preferences. */
680
+ }
681
+ }
682
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTablePreferences, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
683
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTablePreferences, providedIn: 'root' });
684
+ }
685
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTablePreferences, decorators: [{
686
+ type: Injectable,
687
+ args: [{ providedIn: 'root' }]
688
+ }] });
689
+
690
+ /** Fit-grid sizing uses relative initial widths; retain the host's percentage proportions. */
691
+ function legacyColumnWidth(column) {
692
+ const width = column.width?.trim();
693
+ const value = width?.endsWith('%')
694
+ ? Number.parseFloat(width) * 10
695
+ : width?.endsWith('px')
696
+ ? Number.parseFloat(width)
697
+ : NaN;
698
+ return Number.isFinite(value) && value > 0
699
+ ? value
700
+ : column.shrink
701
+ ? 150
702
+ : 220;
703
+ }
704
+ /** Project the owning table's templates: entity drawers, actions and form controls keep their context. */
705
+ class MtTableTemplateCell {
706
+ params = input.required(...(ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []));
707
+ text = inject(MtTableText);
708
+ table = computed(() => this.params()['table'], ...(ngDevMode ? [{ debugName: "table" }] : /* istanbul ignore next */ []));
709
+ checked = computed(() => this.table().isSelected(this.params().data), ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
710
+ template = computed(() => this.params()['template'], ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
711
+ row = computed(() => this.params().node.group
712
+ ? this.params().node.allLeafChildren?.[0]?.data
713
+ : this.params().data, ...(ngDevMode ? [{ debugName: "row" }] : /* istanbul ignore next */ []));
714
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTableTemplateCell, deps: [], target: i0.ɵɵFactoryTarget.Component });
715
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: MtTableTemplateCell, isStandalone: true, selector: "mt-table-template-cell", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `@if (
716
+ (params()['native'] || params()['actions']) &&
717
+ (params().node.group || params().node.footer || params().node.detail)
718
+ ) {
719
+ @if (!params()['actions']) {
720
+ {{ params().valueFormatted }}
721
+ }
722
+ } @else if (params()['selection']) {
723
+ <input
724
+ type="checkbox"
725
+ class="mt-grid-checkbox"
726
+ [checked]="checked()"
727
+ [attr.aria-label]="text.text('selectRow')"
728
+ (click)="$event.stopPropagation()"
729
+ (change)="table().toggleSelection(params().data)"
730
+ />
731
+ } @else {
732
+ <ng-container
733
+ *ngTemplateOutlet="
734
+ template();
735
+ context: {
736
+ row: row(),
737
+ col: params()['legacyColumn'],
738
+ $implicit: row(),
739
+ }
740
+ "
741
+ />
742
+ }`, isInline: true, styles: [":host{display:block;min-width:0;width:100%}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
743
+ }
744
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTableTemplateCell, decorators: [{
745
+ type: Component,
746
+ args: [{ selector: 'mt-table-template-cell', imports: [NgTemplateOutlet], template: `@if (
747
+ (params()['native'] || params()['actions']) &&
748
+ (params().node.group || params().node.footer || params().node.detail)
749
+ ) {
750
+ @if (!params()['actions']) {
751
+ {{ params().valueFormatted }}
752
+ }
753
+ } @else if (params()['selection']) {
754
+ <input
755
+ type="checkbox"
756
+ class="mt-grid-checkbox"
757
+ [checked]="checked()"
758
+ [attr.aria-label]="text.text('selectRow')"
759
+ (click)="$event.stopPropagation()"
760
+ (change)="table().toggleSelection(params().data)"
761
+ />
762
+ } @else {
763
+ <ng-container
764
+ *ngTemplateOutlet="
765
+ template();
766
+ context: {
767
+ row: row(),
768
+ col: params()['legacyColumn'],
769
+ $implicit: row(),
770
+ }
771
+ "
772
+ />
773
+ }`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;min-width:0;width:100%}\n"] }]
774
+ }], propDecorators: { params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: true }] }] } });
775
+ class MtTableTemplateHeader {
776
+ params = input.required(...(ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []));
777
+ text = inject(MtTableText);
778
+ table = computed(() => this.extras()['table'], ...(ngDevMode ? [{ debugName: "table" }] : /* istanbul ignore next */ []));
779
+ extras = computed(() => this.params()['extras'], ...(ngDevMode ? [{ debugName: "extras" }] : /* istanbul ignore next */ []));
780
+ template = computed(() => this.extras()['template'], ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
781
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTableTemplateHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
782
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: MtTableTemplateHeader, isStandalone: true, selector: "mt-table-template-header", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `@if (extras()['selection']) {
783
+ <input
784
+ type="checkbox"
785
+ class="mt-grid-checkbox"
786
+ [checked]="table().allSelectedOnPage"
787
+ [attr.aria-label]="text.text('selectAll')"
788
+ (click)="$event.stopPropagation()"
789
+ (change)="table().toggleAllOnPage()"
790
+ />
791
+ } @else {
792
+ <ng-container
793
+ *ngTemplateOutlet="
794
+ template();
795
+ context: {
796
+ col: extras()['legacyColumn'],
797
+ $implicit: extras()['legacyColumn'],
798
+ }
799
+ "
800
+ />
801
+ }`, isInline: true, styles: [":host{display:flex;flex:1;min-width:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
802
+ }
803
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTableTemplateHeader, decorators: [{
804
+ type: Component,
805
+ args: [{ selector: 'mt-table-template-header', imports: [NgTemplateOutlet], template: `@if (extras()['selection']) {
806
+ <input
807
+ type="checkbox"
808
+ class="mt-grid-checkbox"
809
+ [checked]="table().allSelectedOnPage"
810
+ [attr.aria-label]="text.text('selectAll')"
811
+ (click)="$event.stopPropagation()"
812
+ (change)="table().toggleAllOnPage()"
813
+ />
814
+ } @else {
815
+ <ng-container
816
+ *ngTemplateOutlet="
817
+ template();
818
+ context: {
819
+ col: extras()['legacyColumn'],
820
+ $implicit: extras()['legacyColumn'],
821
+ }
822
+ "
823
+ />
824
+ }`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:flex;flex:1;min-width:0}\n"] }]
825
+ }], propDecorators: { params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: true }] }] } });
826
+ /** Passive renderer: mt-table still owns the complete dataset/query and all consumer events. */
827
+ class MtTableCompatibilityRenderer {
828
+ fitStrategy = { type: 'fitGridWidth' };
829
+ context = input.required(...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
830
+ grid = viewChild((MtDataGridComponent), ...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
831
+ templateCell = MtTableTemplateCell;
832
+ canReorder = computed(() => this.context().reorderableRows &&
833
+ !this.context().sortField &&
834
+ !this.context().groupBy, ...(ngDevMode ? [{ debugName: "canReorder" }] : /* istanbul ignore next */ []));
835
+ identities = new WeakMap();
836
+ nextIdentity = 0;
837
+ configuration = inject(MT_DATA_TABLE_CONFIGURATION);
838
+ text = inject(MtTableText);
839
+ preferences = inject(MtTablePreferences);
840
+ restored = null;
841
+ reset = -1;
842
+ synchronizing = false;
843
+ groupInput;
844
+ groupGrid;
845
+ clientPage = computed(() => {
846
+ const page = this.context().client ?? this.context().owned;
847
+ return page ? Math.floor(page.first / page.pageSize) : undefined;
848
+ }, ...(ngDevMode ? [{ debugName: "clientPage" }] : /* istanbul ignore next */ []));
849
+ exportParams = computed(() => {
850
+ const api = this.grid()?.api;
851
+ const pivot = api?.getPivotResultColumns() ?? [];
852
+ const data = pivot.length
853
+ ? pivot
854
+ : (api
855
+ ?.getColumnState()
856
+ .filter((state) => !state.hide &&
857
+ this.context().columns.some((column) => column.key === state.colId &&
858
+ (column.type !== 'custom' ||
859
+ column.exportable ||
860
+ column.exportValue)))
861
+ .map((column) => column.colId) ?? []);
862
+ return {
863
+ fileName: this.context().client?.exportName ?? this.context().owned?.exportName,
864
+ columnKeys: [
865
+ ...(api?.getRowGroupColumns().length ? [AUTO_GROUP_COLUMN_ID] : []),
866
+ ...data,
867
+ ],
868
+ processCellCallback: (params) => {
869
+ const column = this.context().columns.find((column) => column.key === (params.column.colId ?? params.column.field));
870
+ if (!this.context().client &&
871
+ column &&
872
+ !params.node.group &&
873
+ !params.node.footer)
874
+ return this.context().owned?.resolveExport(params.node.data, column);
875
+ return !params.node.group && !params.node.footer && column?.exportValue
876
+ ? this.context().client?.resolveExport(params.node.data, column)
877
+ : mtEntityExportValue(params);
878
+ },
879
+ };
880
+ }, ...(ngDevMode ? [{ debugName: "exportParams" }] : /* istanbul ignore next */ []));
881
+ constructor() {
882
+ effect(() => {
883
+ const grid = this.grid(), context = this.context();
884
+ if (!grid)
885
+ return;
886
+ if (this.groupGrid !== grid || this.groupInput !== context.groupBy) {
887
+ this.groupGrid = grid;
888
+ this.groupInput = context.groupBy;
889
+ untracked(() => grid.api.setRowGroupColumns(context.groupBy ? [context.groupBy] : []));
890
+ }
891
+ });
892
+ effect(() => {
893
+ const grid = this.grid(), context = this.context();
894
+ if (!grid || context.client)
895
+ return;
896
+ untracked(() => grid.api.setSortModel(context.sortField && context.owned?.sortDirection
897
+ ? [{ colId: context.sortField, sort: context.owned.sortDirection }]
898
+ : []));
899
+ });
900
+ effect(() => {
901
+ const grid = this.grid(), key = this.context().viewKey;
902
+ const identity = key ? { level: key, role: 'compatibility' } : null;
903
+ const preferenceKey = identity ? this.preferences.key(identity) : null;
904
+ if (!grid || !identity || !preferenceKey)
905
+ return;
906
+ if (this.restored !== preferenceKey) {
907
+ untracked(() => {
908
+ const saved = this.preferences.read(identity);
909
+ if (saved && this.context().client)
910
+ applyGridViewState(grid.api, saved);
911
+ else if (saved)
912
+ grid.api.applyColumnState({
913
+ state: saved.columns.map(({ colId, width, hide, pinned }) => ({
914
+ colId,
915
+ width,
916
+ hide,
917
+ pinned,
918
+ })),
919
+ applyOrder: true,
920
+ });
921
+ });
922
+ this.restored = preferenceKey;
923
+ }
924
+ const state = captureGridViewState(grid.api);
925
+ untracked(() => this.preferences.write(identity, state));
926
+ });
927
+ effect(() => {
928
+ const grid = this.grid(), client = this.context().client;
929
+ if (!grid || !client)
930
+ return;
931
+ if (this.reset !== client.reset) {
932
+ const previous = this.reset;
933
+ this.reset = client.reset;
934
+ if (previous !== -1)
935
+ untracked(() => grid.api.setFilterModel(null));
936
+ }
937
+ untracked(() => this.changed());
938
+ });
939
+ }
940
+ rowId = (row) => {
941
+ const key = this.context().dataKey;
942
+ const value = key ? TableValueResolver.getProperty(row, key) : undefined;
943
+ if (value !== null && value !== undefined)
944
+ return String(value);
945
+ let identity = this.identities.get(row);
946
+ if (!identity) {
947
+ identity = `row-${++this.nextIdentity}`;
948
+ this.identities.set(row, identity);
949
+ }
950
+ return identity;
951
+ };
952
+ direction = computed(() => this.configuration.direction?.() ??
953
+ (this.text.language().startsWith('ar') ? 'rtl' : 'ltr'), ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
954
+ columns = computed(() => {
955
+ const context = this.context();
956
+ const columns = context.columns.map((column, index) => ({
957
+ colId: column.key,
958
+ headerName: column.label,
959
+ sortable: column.sortable === true,
960
+ filter: false,
961
+ initialWidth: legacyColumnWidth(column),
962
+ minWidth: 90,
963
+ resizable: true,
964
+ suppressMovable: !context.reorderableColumns,
965
+ rowDrag: this.canReorder() && index === 0,
966
+ enableRowGroup: context.owned?.groupableColumns.includes(column.key) ?? false,
967
+ rowGroup: context.groupBy === column.key,
968
+ hide: context.groupBy === column.key && context.columns.length > 1,
969
+ valueGetter: ({ data }) => context.groupBy === column.key
970
+ ? context.groupKey(data)
971
+ : TableValueResolver.getProperty(data, column.key),
972
+ headerRenderer: MtTableTemplateHeader,
973
+ headerRendererParams: {
974
+ template: context.headerTemplate,
975
+ legacyColumn: column,
976
+ },
977
+ cellRenderer: MtTableTemplateCell,
978
+ cellRendererParams: {
979
+ template: context.cellTemplate,
980
+ legacyColumn: column,
981
+ },
982
+ cellClass: column.align === 'end' || column.type === 'number'
983
+ ? 'mt-grid-right-aligned-cell'
984
+ : undefined,
985
+ }));
986
+ if (context.client) {
987
+ columns.splice(0, columns.length, ...context.columns
988
+ .filter((column) => !column.filterOnly)
989
+ .map((column) => this.nativeColumn(column, context)));
990
+ }
991
+ if (context.selectableRows)
992
+ columns.unshift({
993
+ colId: '__mt_selection',
994
+ headerName: '',
995
+ width: 48,
996
+ minWidth: 48,
997
+ maxWidth: 48,
998
+ sortable: false,
999
+ resizable: false,
1000
+ lockVisible: true,
1001
+ suppressMovable: true,
1002
+ headerRenderer: MtTableTemplateHeader,
1003
+ headerRendererParams: { selection: true, table: context },
1004
+ cellRenderer: MtTableTemplateCell,
1005
+ cellRendererParams: { selection: true, table: context },
1006
+ });
1007
+ if (context.rowActions.length)
1008
+ columns.push({
1009
+ colId: '__mt_actions',
1010
+ headerName: context.actionsLabel,
1011
+ width: context.actionShape === 'popover'
1012
+ ? 104
1013
+ : Math.max(104, Math.min(240, context.rowActions.length * 36 + 24)),
1014
+ minWidth: 80,
1015
+ suppressSizeToFit: true,
1016
+ sortable: false,
1017
+ resizable: false,
1018
+ lockVisible: true,
1019
+ lockPosition: context.freezeActions ? 'right' : undefined,
1020
+ pinned: context.freezeActions ? 'right' : null,
1021
+ suppressMovable: true,
1022
+ cellRenderer: MtTableTemplateCell,
1023
+ cellRendererParams: {
1024
+ template: context.actionsTemplate,
1025
+ actions: true,
1026
+ },
1027
+ excludeFromQuickFilter: true,
1028
+ });
1029
+ return columns;
1030
+ }, ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
1031
+ nativeColumn(column, context) {
1032
+ const client = context.client;
1033
+ const sample = client.rows
1034
+ .map((row) => client.resolveEntity(row, column))
1035
+ .find((entity) => entity !== null);
1036
+ const common = {
1037
+ colId: column.key,
1038
+ headerName: column.label,
1039
+ initialWidth: legacyColumnWidth(column),
1040
+ minWidth: 90,
1041
+ sortable: column.sortable !== false,
1042
+ filter: column.filterable === false
1043
+ ? false
1044
+ : column.type === 'number'
1045
+ ? 'number'
1046
+ : column.type === 'date' || column.type === 'dateTime'
1047
+ ? 'date'
1048
+ : column.type === 'boolean'
1049
+ ? 'set'
1050
+ : 'text',
1051
+ enableRowGroup: column.groupable !== false,
1052
+ enableValue: column.type === 'number',
1053
+ enablePivot: column.type !== 'number',
1054
+ chartDataType: column.type === 'number' ? 'series' : 'category',
1055
+ initialHide: context.groupBy === column.key,
1056
+ cellRenderer: MtTableTemplateCell,
1057
+ cellRendererParams: {
1058
+ template: context.cellTemplate,
1059
+ legacyColumn: column,
1060
+ native: true,
1061
+ },
1062
+ headerRenderer: column.customHeaderTpl
1063
+ ? MtTableTemplateHeader
1064
+ : undefined,
1065
+ headerRendererParams: {
1066
+ template: column.customHeaderTpl,
1067
+ legacyColumn: column,
1068
+ },
1069
+ valueGetter: ({ data }) => {
1070
+ const value = client.resolveExport(data, column);
1071
+ if (column.type === 'number') {
1072
+ const raw = TableValueResolver.getProperty(data, column.key);
1073
+ return (typeof raw === 'number' ||
1074
+ (typeof raw === 'string' && raw.trim() !== '')) &&
1075
+ Number.isFinite(Number(raw))
1076
+ ? Number(raw)
1077
+ : null;
1078
+ }
1079
+ if (column.type === 'date' || column.type === 'dateTime') {
1080
+ const raw = TableValueResolver.getProperty(data, column.key);
1081
+ const date = raw instanceof Date
1082
+ ? raw
1083
+ : typeof raw === 'string'
1084
+ ? new Date(column.type === 'date'
1085
+ ? `${raw.slice(0, 10)}T00:00:00`
1086
+ : raw)
1087
+ : null;
1088
+ return date && Number.isFinite(date.getTime()) ? date : null;
1089
+ }
1090
+ return typeof value === 'string' ||
1091
+ typeof value === 'number' ||
1092
+ typeof value === 'boolean' ||
1093
+ value instanceof Date
1094
+ ? value
1095
+ : null;
1096
+ },
1097
+ valueFormatter: ({ value }) => value == null
1098
+ ? ''
1099
+ : value instanceof Date
1100
+ ? value.toLocaleDateString()
1101
+ : String(value),
1102
+ };
1103
+ if (!sample)
1104
+ return common;
1105
+ const entityColumn = mtEntityColumn({
1106
+ key: column.key,
1107
+ label: column.label,
1108
+ viewType: sample.viewType,
1109
+ entity: (row) => client.resolveEntity(row, column),
1110
+ initialWidth: common.initialWidth,
1111
+ minWidth: common.minWidth,
1112
+ rowGroup: common.rowGroup,
1113
+ initialHide: common.initialHide,
1114
+ headerRenderer: common.headerRenderer,
1115
+ headerRendererParams: common.headerRendererParams,
1116
+ ...(column.sortable === false ? { sortable: false } : {}),
1117
+ ...(column.filterable === false ? { filter: false } : {}),
1118
+ ...(column.groupable === false ? { enableRowGroup: false } : {}),
1119
+ ...(column.customCellTpl
1120
+ ? {
1121
+ cellRenderer: MtTableTemplateCell,
1122
+ cellRendererParams: common.cellRendererParams,
1123
+ }
1124
+ : {}),
1125
+ });
1126
+ return entityColumn;
1127
+ }
1128
+ changed() {
1129
+ if (this.synchronizing)
1130
+ return;
1131
+ const grid = this.grid(), client = this.context().client;
1132
+ if (!grid)
1133
+ return;
1134
+ if (!client) {
1135
+ const owned = this.context().owned;
1136
+ const search = grid.api.getQuickFilter() ?? '';
1137
+ if (owned && search !== owned.search)
1138
+ owned.onSearch(search);
1139
+ return;
1140
+ }
1141
+ this.synchronizing = true;
1142
+ try {
1143
+ const rows = new Map();
1144
+ grid.api.forEachNodeAfterFilterAndSort((node) => {
1145
+ if (node.detail || node.footer)
1146
+ return;
1147
+ for (const leaf of node.group ? (node.allLeafChildren ?? []) : [node])
1148
+ if (leaf.data)
1149
+ rows.set(leaf.id, leaf.data);
1150
+ });
1151
+ client.onView([...rows.values()], grid.api
1152
+ .getColumnState()
1153
+ .filter((column) => !column.hide)
1154
+ .map((column) => column.colId));
1155
+ const search = grid.api.getQuickFilter() ?? '';
1156
+ if (search !== client.search)
1157
+ client.onSearch(search);
1158
+ }
1159
+ finally {
1160
+ this.synchronizing = false;
1161
+ }
1162
+ }
1163
+ menu = (params) => [
1164
+ ...params.defaultItems,
1165
+ ...(this.context().owned?.printable
1166
+ ? [
1167
+ {
1168
+ name: this.text.text('print'),
1169
+ action: () => this.context().owned?.onPrint(),
1170
+ },
1171
+ ]
1172
+ : []),
1173
+ ];
1174
+ sorted() {
1175
+ if (this.context().client)
1176
+ return;
1177
+ const sort = this.grid()?.api.getSortModel()[0];
1178
+ const context = this.context();
1179
+ if ((sort?.colId ?? null) !== context.sortField ||
1180
+ (sort?.sort ?? null) !== context.owned?.sortDirection)
1181
+ context.owned?.onSort(sort?.colId ?? null, sort?.sort ?? null);
1182
+ }
1183
+ grouped() {
1184
+ if (this.context().client)
1185
+ return;
1186
+ const groups = this.grid()?.api.getRowGroupColumns() ?? [];
1187
+ const context = this.context();
1188
+ // Existing lazy contracts accept one grouping field. Adding another replaces it.
1189
+ const next = groups.find((key) => key !== context.groupBy) ?? groups[0] ?? null;
1190
+ if (next !== context.groupBy)
1191
+ context.owned?.onGroup(next);
1192
+ }
1193
+ page(event) {
1194
+ (this.context().client ?? this.context().owned)?.onPage(event.currentPage * event.pageSize, event.pageSize);
1195
+ this.changed();
1196
+ }
1197
+ clicked(event) {
1198
+ if (!event.node.group &&
1199
+ !event.node.footer &&
1200
+ !event.node.detail &&
1201
+ event.node.data)
1202
+ this.context().onClick(event.event, event.node.data);
1203
+ }
1204
+ reordered(event) {
1205
+ if (!this.canReorder())
1206
+ return;
1207
+ const rows = [];
1208
+ this.grid()?.api.forEachNode((node) => {
1209
+ if (!node.group)
1210
+ rows.push(node.data);
1211
+ });
1212
+ this.context().onReorder(rows, event.node.sourceIndex, event.overIndex);
1213
+ }
1214
+ columnsMoved(event) {
1215
+ if (event.source === 'api' ||
1216
+ !event.finished ||
1217
+ !this.context().reorderableColumns)
1218
+ return;
1219
+ const columns = new Map(this.context().columns.map((column) => [column.key, column]));
1220
+ this.context().onColumnReorder(this.grid()
1221
+ ?.api.getColumnState()
1222
+ .flatMap((state) => {
1223
+ const column = columns.get(state.colId);
1224
+ return column ? [column] : [];
1225
+ }) ?? []);
1226
+ }
1227
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTableCompatibilityRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component });
1228
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: MtTableCompatibilityRenderer, isStandalone: true, selector: "mt-table-grid-renderer", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "grid", first: true, predicate: (MtDataGridComponent), descendants: true, isSignal: true }], ngImport: i0, template: `
1229
+ <mt-data-grid
1230
+ [class.mt-table-striped]="context().stripedRows"
1231
+ [class.mt-table-gridlines]="context().showGridlines"
1232
+ [class.mt-table-no-header]="!context().showHeader"
1233
+ [rowData]="context().client?.rows ?? context().rows"
1234
+ [columnDefs]="columns()"
1235
+ [autoSizeStrategy]="fitStrategy"
1236
+ [getRowId]="rowId"
1237
+ [dataProcessing]="context().client ? 'client' : 'external'"
1238
+ [showQuickFilter]="!!(context().client?.tools ?? context().owned?.tools)"
1239
+ [quickFilterText]="
1240
+ context().client?.search ?? context().owned?.search ?? ''
1241
+ "
1242
+ [rowGroupPanelShow]="
1243
+ (context().client?.tools ?? context().owned?.tools) ? 'always' : 'never'
1244
+ "
1245
+ pivotPanelShow="never"
1246
+ paginationPanelShow="whenNeeded"
1247
+ [pagination]="
1248
+ context().client?.pagination ?? context().owned?.pagination ?? false
1249
+ "
1250
+ [paginationPageSize]="
1251
+ context().client?.pageSize ?? context().owned?.pageSize ?? 10
1252
+ "
1253
+ [paginationCurrentPage]="clientPage()"
1254
+ [paginationTotalRows]="
1255
+ context().client ? undefined : context().owned?.total
1256
+ "
1257
+ [paginationPageSizeSelector]="
1258
+ context().client?.pageSizes ??
1259
+ context().owned?.pageSizes ?? [5, 10, 20, 50, 100]
1260
+ "
1261
+ [height]="context().height"
1262
+ [rowHeight]="context().rowHeight"
1263
+ [headerHeight]="context().showHeader ? 48 : 1"
1264
+ [loading]="context().loading"
1265
+ [noRowsTemplate]="context().emptyTemplate ?? undefined"
1266
+ [direction]="direction()"
1267
+ [localeText]="text.gridLocale()"
1268
+ [sideBar]="{
1269
+ toolPanels: ['columns', 'filters'],
1270
+ position: direction() === 'rtl' ? 'left' : 'right',
1271
+ }"
1272
+ [columnMenu]="true"
1273
+ [getContextMenuItems]="menu"
1274
+ [cellSelection]="true"
1275
+ [enableCharts]="!!context().client"
1276
+ [suppressCsvExport]="
1277
+ !(context().client?.exportable ?? context().owned?.exportable)
1278
+ "
1279
+ [suppressExcelExport]="
1280
+ !(context().client?.exportable ?? context().owned?.exportable)
1281
+ "
1282
+ [suppressPdfExport]="true"
1283
+ [defaultCsvExportParams]="exportParams()"
1284
+ [defaultExcelExportParams]="exportParams()"
1285
+ [suppressCutToClipboard]="true"
1286
+ [rowDragManaged]="canReorder()"
1287
+ [groupDefaultExpanded]="-1"
1288
+ [groupMaintainOrder]="true"
1289
+ groupDisplayType="groupRows"
1290
+ [groupRowRenderer]="context().client ? undefined : templateCell"
1291
+ [groupRowRendererParams]="{ template: context().groupTemplate }"
1292
+ (rowClicked)="clicked($event)"
1293
+ (rowDragEnd)="reordered($event)"
1294
+ (columnMoved)="columnsMoved($event); changed()"
1295
+ (columnResized)="$event.finished && changed()"
1296
+ (gridReady)="changed()"
1297
+ (filterChanged)="changed()"
1298
+ (sortChanged)="sorted(); changed()"
1299
+ (columnVisible)="changed()"
1300
+ (columnPinned)="changed()"
1301
+ (columnRowGroupChanged)="grouped(); changed()"
1302
+ (columnValueChanged)="changed()"
1303
+ (columnPivotChanged)="changed()"
1304
+ (paginationChanged)="page($event)"
1305
+ />
1306
+ @if (context().updating) {
1307
+ <div
1308
+ role="progressbar"
1309
+ [attr.aria-label]="text.text('loading')"
1310
+ class="mt-table-updating"
1311
+ ></div>
1312
+ }
1313
+ `, isInline: true, styles: [":host{display:block;position:relative}:host ::ng-deep .mt-grid-full-width-group>mt-grid-cell-renderer{width:100%}:host ::ng-deep .mt-table-striped .mt-grid-row:nth-child(2n){background:var( --p-datatable-row-striped-background, var(--p-surface-50, #f8fafc) )}:host ::ng-deep .mt-table-gridlines .mt-grid-cell{border-inline-end:1px solid var(--p-content-border-color, #ddd)}:host ::ng-deep .mt-table-no-header .mt-grid-header{display:none}.mt-table-updating{position:absolute;inset-inline:0;inset-block-start:48px;height:3px;background:var(--p-primary-color, #2aaec0);opacity:.7}\n"], dependencies: [{ kind: "component", type: MtDataGridComponent, selector: "mt-data-grid", inputs: ["rowData", "dataProcessing", "columnDefs", "getRowId", "height", "autoHeight", "autoHeightMaxRows", "autoHeightMinRows", "rowHeight", "animateRows", "headerHeight", "groupHeaderHeight", "direction", "localeText", "localeTextResolver", "ariaLabel", "loading", "noRowsText", "loadingText", "noRowsTemplate", "autoSizeStrategy", "columnMenu", "mainMenuItems", "autoSizePadding", "quickFilterText", "showQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "cacheQuickFilter", "applyQuickFilterBeforePivotOrAgg", "filtersToolPanelDef", "isExternalFilterPresent", "doesExternalFilterPass", "floatingFiltersHeight", "rowSelection", "selectionColumnDef", "rowNumbers", "rowDragManaged", "rowDragEntireRow", "rowDragMultiRow", "suppressMoveWhenRowDragging", "cellSelection", "statusBar", "suppressContextMenu", "allowContextMenuWithControlKey", "preventDefaultOnContextMenu", "getContextMenuItems", "suppressCsvExport", "suppressExcelExport", "suppressPdfExport", "defaultPdfExportParams", "excelStyles", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "copySelectedRows", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressCutToClipboard", "defaultCsvExportParams", "defaultExcelExportParams", "groupDisplayType", "groupRowRenderer", "groupRowRendererParams", "suppressGroupRowsSticky", "groupHideOpenParents", "groupHideParentOfSingleChild", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "showOpenedGroup", "groupAggFiltering", "suppressAggFilteredOnly", "aggregateOnlyChangedColumns", "suppressColumnMoveAnimation", "pivotRowTotals", "pivotColumnGroupTotals", "pivotMaxGeneratedColumns", "pivotDefaultExpanded", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "processPivotResultColDef", "processPivotResultColGroupDef", "processUnpinnedColumns", "rowGroupPanelShow", "pivotPanelShow", "pivotPanelHint", "groupDefaultExpanded", "autoGroupColumnDef", "groupTotalRow", "grandTotalRow", "aggFuncs", "suppressRowGroupHidesColumns", "suppressMakeColumnVisibleAfterUnGroup", "sideBar", "pivotMode", "suppressAggFuncInHeader", "enableCharts", "chartThemes", "customChartThemes", "chartToolPanelsDef", "chartThemeOverrides", "chartContext", "chartRecordsLabel", "getChartToolbarItems", "groupMaintainOrder", "treeData", "getDataPath", "masterDetail", "isRowMaster", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "singleClickEdit", "suppressClickEdit", "stopEditingWhenCellsLoseFocus", "undoRedoCellEditing", "undoRedoCellEditingLimit", "pagination", "paginationPanelShow", "paginationPageSize", "paginationTotalRows", "paginationCurrentPage", "paginationPageSizeSelector", "rowGroupPanelSuppressSort"], outputs: ["displayedColumnsChanged", "columnEverythingChanged", "pivotMaxColumnsExceeded", "gridReady", "sortChanged", "cellFocused", "columnResized", "columnMoved", "columnPinned", "columnVisible", "columnGroupOpened", "filterChanged", "filterModified", "filterOpened", "rowSelected", "selectionChanged", "rowClicked", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "cellSelectionChanged", "contextMenuVisibleChanged", "rowGroupOpened", "columnRowGroupChanged", "expandOrCollapseAll", "cellEditingStarted", "cellEditingStopped", "cellValueChanged", "pasteStart", "pasteEnd", "fillStart", "fillEnd", "paginationChanged", "toolPanelVisibleChanged", "toolPanelSizeChanged", "columnValueChanged", "columnPivotChanged", "columnPivotModeChanged", "chartCreated", "chartDestroyed", "chartRangeSelectionChanged", "chartOptionsChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1314
+ }
1315
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtTableCompatibilityRenderer, decorators: [{
1316
+ type: Component,
1317
+ args: [{ selector: 'mt-table-grid-renderer', imports: [MtDataGridComponent, NgTemplateOutlet], template: `
1318
+ <mt-data-grid
1319
+ [class.mt-table-striped]="context().stripedRows"
1320
+ [class.mt-table-gridlines]="context().showGridlines"
1321
+ [class.mt-table-no-header]="!context().showHeader"
1322
+ [rowData]="context().client?.rows ?? context().rows"
1323
+ [columnDefs]="columns()"
1324
+ [autoSizeStrategy]="fitStrategy"
1325
+ [getRowId]="rowId"
1326
+ [dataProcessing]="context().client ? 'client' : 'external'"
1327
+ [showQuickFilter]="!!(context().client?.tools ?? context().owned?.tools)"
1328
+ [quickFilterText]="
1329
+ context().client?.search ?? context().owned?.search ?? ''
1330
+ "
1331
+ [rowGroupPanelShow]="
1332
+ (context().client?.tools ?? context().owned?.tools) ? 'always' : 'never'
1333
+ "
1334
+ pivotPanelShow="never"
1335
+ paginationPanelShow="whenNeeded"
1336
+ [pagination]="
1337
+ context().client?.pagination ?? context().owned?.pagination ?? false
1338
+ "
1339
+ [paginationPageSize]="
1340
+ context().client?.pageSize ?? context().owned?.pageSize ?? 10
1341
+ "
1342
+ [paginationCurrentPage]="clientPage()"
1343
+ [paginationTotalRows]="
1344
+ context().client ? undefined : context().owned?.total
1345
+ "
1346
+ [paginationPageSizeSelector]="
1347
+ context().client?.pageSizes ??
1348
+ context().owned?.pageSizes ?? [5, 10, 20, 50, 100]
1349
+ "
1350
+ [height]="context().height"
1351
+ [rowHeight]="context().rowHeight"
1352
+ [headerHeight]="context().showHeader ? 48 : 1"
1353
+ [loading]="context().loading"
1354
+ [noRowsTemplate]="context().emptyTemplate ?? undefined"
1355
+ [direction]="direction()"
1356
+ [localeText]="text.gridLocale()"
1357
+ [sideBar]="{
1358
+ toolPanels: ['columns', 'filters'],
1359
+ position: direction() === 'rtl' ? 'left' : 'right',
1360
+ }"
1361
+ [columnMenu]="true"
1362
+ [getContextMenuItems]="menu"
1363
+ [cellSelection]="true"
1364
+ [enableCharts]="!!context().client"
1365
+ [suppressCsvExport]="
1366
+ !(context().client?.exportable ?? context().owned?.exportable)
1367
+ "
1368
+ [suppressExcelExport]="
1369
+ !(context().client?.exportable ?? context().owned?.exportable)
1370
+ "
1371
+ [suppressPdfExport]="true"
1372
+ [defaultCsvExportParams]="exportParams()"
1373
+ [defaultExcelExportParams]="exportParams()"
1374
+ [suppressCutToClipboard]="true"
1375
+ [rowDragManaged]="canReorder()"
1376
+ [groupDefaultExpanded]="-1"
1377
+ [groupMaintainOrder]="true"
1378
+ groupDisplayType="groupRows"
1379
+ [groupRowRenderer]="context().client ? undefined : templateCell"
1380
+ [groupRowRendererParams]="{ template: context().groupTemplate }"
1381
+ (rowClicked)="clicked($event)"
1382
+ (rowDragEnd)="reordered($event)"
1383
+ (columnMoved)="columnsMoved($event); changed()"
1384
+ (columnResized)="$event.finished && changed()"
1385
+ (gridReady)="changed()"
1386
+ (filterChanged)="changed()"
1387
+ (sortChanged)="sorted(); changed()"
1388
+ (columnVisible)="changed()"
1389
+ (columnPinned)="changed()"
1390
+ (columnRowGroupChanged)="grouped(); changed()"
1391
+ (columnValueChanged)="changed()"
1392
+ (columnPivotChanged)="changed()"
1393
+ (paginationChanged)="page($event)"
1394
+ />
1395
+ @if (context().updating) {
1396
+ <div
1397
+ role="progressbar"
1398
+ [attr.aria-label]="text.text('loading')"
1399
+ class="mt-table-updating"
1400
+ ></div>
1401
+ }
1402
+ `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;position:relative}:host ::ng-deep .mt-grid-full-width-group>mt-grid-cell-renderer{width:100%}:host ::ng-deep .mt-table-striped .mt-grid-row:nth-child(2n){background:var( --p-datatable-row-striped-background, var(--p-surface-50, #f8fafc) )}:host ::ng-deep .mt-table-gridlines .mt-grid-cell{border-inline-end:1px solid var(--p-content-border-color, #ddd)}:host ::ng-deep .mt-table-no-header .mt-grid-header{display:none}.mt-table-updating{position:absolute;inset-inline:0;inset-block-start:48px;height:3px;background:var(--p-primary-color, #2aaec0);opacity:.7}\n"] }]
1403
+ }], ctorParameters: () => [], propDecorators: { context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }], grid: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MtDataGridComponent), { isSignal: true }] }] } });
1404
+
1405
+ /** Root installation includes root-created dialogs. Omit the provider to retain the legacy renderer. */
1406
+ function provideMTDataTables(configuration) {
1407
+ return makeEnvironmentProviders([
1408
+ MtTablePreferences,
1409
+ typeof configuration === 'function'
1410
+ ? { provide: MT_DATA_TABLE_CONFIGURATION, useFactory: configuration }
1411
+ : { provide: MT_DATA_TABLE_CONFIGURATION, useValue: configuration },
1412
+ {
1413
+ provide: MT_TABLE_RENDERER,
1414
+ useFactory: () => inject(MT_DATA_TABLE_CONFIGURATION).renderer === 'legacy'
1415
+ ? null
1416
+ : MtTableCompatibilityRenderer,
1417
+ },
1418
+ ]);
1419
+ }
1420
+ /** Component-scoped opt-in, for example control-panel audit logs. */
1421
+ function provideMTTableRenderer() {
1422
+ return [
1423
+ { provide: MT_TABLE_RENDERER, useValue: MtTableCompatibilityRenderer },
1424
+ ];
1425
+ }
1426
+
1427
+ /** A shared, cancellable FIFO scheduler. Collapsing one record never cancels another. */
1428
+ class MtDatasetScheduler {
1429
+ concurrency;
1430
+ active = 0;
1431
+ queue = [];
1432
+ constructor(concurrency = 4) {
1433
+ this.concurrency = concurrency;
1434
+ if (!Number.isInteger(concurrency) || concurrency < 1)
1435
+ throw new Error('Invalid concurrency');
1436
+ }
1437
+ run(work, signal) {
1438
+ return new Promise((resolve, reject) => {
1439
+ const abort = () => {
1440
+ const index = this.queue.indexOf(start);
1441
+ if (index >= 0)
1442
+ this.queue.splice(index, 1);
1443
+ reject(signal.reason ?? new DOMException('Aborted', 'AbortError'));
1444
+ };
1445
+ const start = () => {
1446
+ if (signal.aborted) {
1447
+ signal.removeEventListener('abort', abort);
1448
+ return;
1449
+ }
1450
+ this.active++;
1451
+ Promise.resolve()
1452
+ .then(work)
1453
+ .then(resolve, reject)
1454
+ .finally(() => {
1455
+ signal.removeEventListener('abort', abort);
1456
+ this.active--;
1457
+ this.drain();
1458
+ });
1459
+ };
1460
+ if (signal.aborted) {
1461
+ abort();
1462
+ return;
1463
+ }
1464
+ signal.addEventListener('abort', abort, { once: true });
1465
+ this.queue.push(start);
1466
+ this.drain();
1467
+ });
1468
+ }
1469
+ drain() {
1470
+ while (this.active < this.concurrency && this.queue.length)
1471
+ this.queue.shift()();
1472
+ }
1473
+ }
1474
+ /** Values are scoped by the caller's complete authenticated query identity. */
1475
+ class MtDatasetCache {
1476
+ capacity;
1477
+ entries = new Map();
1478
+ constructor(capacity = 20) {
1479
+ this.capacity = capacity;
1480
+ if (!Number.isInteger(capacity) || capacity < 1)
1481
+ throw new Error('Invalid cache capacity');
1482
+ }
1483
+ get(key) {
1484
+ const value = this.entries.get(key);
1485
+ if (value !== undefined) {
1486
+ this.entries.delete(key);
1487
+ this.entries.set(key, value);
1488
+ }
1489
+ return value;
1490
+ }
1491
+ set(key, value) {
1492
+ this.entries.delete(key);
1493
+ this.entries.set(key, value);
1494
+ while (this.entries.size > this.capacity)
1495
+ this.entries.delete(this.entries.keys().next().value);
1496
+ }
1497
+ clear() {
1498
+ this.entries.clear();
1499
+ }
1500
+ get size() {
1501
+ return this.entries.size;
1502
+ }
1503
+ }
1504
+
1505
+ class MtIncompleteTableError extends Error {
1506
+ constructor() {
1507
+ super('The table response did not contain the complete requested result.');
1508
+ }
1509
+ }
1510
+ function uniqueRows(rows, getRowId) {
1511
+ const ids = rows.map(getRowId);
1512
+ return (ids.every((id) => typeof id === 'string' && id.length > 0) &&
1513
+ new Set(ids).size === ids.length);
1514
+ }
1515
+ /** Load every page of a small result before permitting client aggregation. A threshold is never a truncation limit. */
1516
+ async function loadMtTableResult(source, query, signal, getRowId, clientAnalysisThreshold = 1000) {
1517
+ if (!Number.isSafeInteger(query.offset) ||
1518
+ query.offset < 0 ||
1519
+ !Number.isSafeInteger(query.limit) ||
1520
+ query.limit <= 0)
1521
+ throw new Error('Invalid table page');
1522
+ const first = await source.load(query, signal);
1523
+ signal.throwIfAborted();
1524
+ if (!Number.isSafeInteger(first.totalCount) ||
1525
+ first.totalCount < 0 ||
1526
+ first.rows.length > first.totalCount ||
1527
+ !uniqueRows(first.rows, getRowId))
1528
+ throw new MtIncompleteTableError();
1529
+ if (source.processing === 'client') {
1530
+ if (!first.complete ||
1531
+ first.rows.length !== first.totalCount ||
1532
+ !uniqueRows(first.rows, getRowId))
1533
+ throw new MtIncompleteTableError();
1534
+ return first;
1535
+ }
1536
+ if (first.totalCount > clientAnalysisThreshold) {
1537
+ const expected = Math.max(0, Math.min(query.limit, first.totalCount - query.offset));
1538
+ if (first.rows.length !== expected)
1539
+ throw new MtIncompleteTableError();
1540
+ return { ...first, complete: false };
1541
+ }
1542
+ const pages = [];
1543
+ // A non-zero initial page cannot prove that earlier rows were loaded.
1544
+ let offset = 0;
1545
+ while (offset < first.totalCount) {
1546
+ signal.throwIfAborted();
1547
+ const page = offset === query.offset
1548
+ ? first
1549
+ : await source.load({ ...query, offset }, signal);
1550
+ signal.throwIfAborted();
1551
+ if (page.totalCount !== first.totalCount ||
1552
+ page.rows.length === 0 ||
1553
+ page.rows.length > query.limit)
1554
+ throw new MtIncompleteTableError();
1555
+ pages.push(...page.rows);
1556
+ offset += page.rows.length;
1557
+ }
1558
+ if (pages.length !== first.totalCount || !uniqueRows(pages, getRowId))
1559
+ throw new MtIncompleteTableError();
1560
+ return { ...first, rows: pages, complete: true };
1561
+ }
1562
+ function mtClientTableSource(key, rows) {
1563
+ return {
1564
+ key,
1565
+ scopeKey: key,
1566
+ processing: 'client',
1567
+ capabilities: {
1568
+ sort: true,
1569
+ filter: true,
1570
+ group: true,
1571
+ pivot: true,
1572
+ charts: true,
1573
+ exportAll: true,
1574
+ },
1575
+ load: async (_query, signal) => {
1576
+ signal.throwIfAborted();
1577
+ return { rows, totalCount: rows.length, complete: true };
1578
+ },
1579
+ };
1580
+ }
1581
+
1582
+ /** Saved roles are configuration, never authority to enable a now-unavailable operation. */
1583
+ function reconcileMtTableView(state, columns, policy) {
1584
+ const definitions = new Map(columns.map((column, index) => [
1585
+ column.colId ?? column.field ?? String(index),
1586
+ column,
1587
+ ]));
1588
+ const groups = new Set(columns
1589
+ .filter((column) => column.enableRowGroup || column.rowGroup)
1590
+ .map((column) => column.colId ?? column.field));
1591
+ const values = new Set(columns
1592
+ .filter((column) => column.enableValue || column.aggFunc)
1593
+ .map((column) => column.colId ?? column.field));
1594
+ const pivots = new Set(columns
1595
+ .filter((column) => column.enablePivot || column.pivot)
1596
+ .map((column) => column.colId ?? column.field));
1597
+ return {
1598
+ ...state,
1599
+ sort: state.sort.filter((sort) => definitions.has(sort.colId) &&
1600
+ definitions.get(sort.colId)?.sortable !== false),
1601
+ filters: Object.fromEntries(Object.entries(state.filters).filter(([id]) => definitions.has(id) && definitions.get(id)?.filter !== false)),
1602
+ rowGroups: policy.grouping
1603
+ ? state.rowGroups.filter((id) => groups.has(id))
1604
+ : [],
1605
+ values: policy.values
1606
+ ? state.values.filter((value) => values.has(value.colId) &&
1607
+ (!definitions.get(value.colId)?.allowedAggFuncs ||
1608
+ definitions
1609
+ .get(value.colId)
1610
+ .allowedAggFuncs.includes(value.aggFunc)))
1611
+ : [],
1612
+ pivot: {
1613
+ enabled: policy.pivot && state.pivot.enabled,
1614
+ columns: policy.pivot
1615
+ ? state.pivot.columns.filter((id) => pivots.has(id))
1616
+ : [],
1617
+ },
1618
+ };
1619
+ }
1620
+
1621
+ const MT_TABLE_ACTIONS_COLUMN = '__mt_table_actions__';
1622
+ class MtDataTableRowActions {
1623
+ params = input.required(...(ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []));
1624
+ text = inject(MtTableText);
1625
+ confirmation = inject(ConfirmationService);
1626
+ anchor = null;
1627
+ visible = computed(() => {
1628
+ const { data, node } = this.params();
1629
+ if (!data || node.group || node.footer)
1630
+ return [];
1631
+ return this.params()['actions'].filter((action) => !action.hidden?.(data));
1632
+ }, ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
1633
+ inline = computed(() => this.visible().filter((action) => action.placement === 'inline'), ...(ngDevMode ? [{ debugName: "inline" }] : /* istanbul ignore next */ []));
1634
+ menuItems = computed(() => {
1635
+ const actions = this.visible().filter((action) => action.placement !== 'inline');
1636
+ const ordered = [
1637
+ ...actions.filter((action) => action.color !== 'danger'),
1638
+ ...actions.filter((action) => action.color === 'danger'),
1639
+ ];
1640
+ return ordered.flatMap((action, index) => [
1641
+ ...(index > 0 &&
1642
+ action.color === 'danger' &&
1643
+ ordered[index - 1].color !== 'danger'
1644
+ ? [{ separator: true }]
1645
+ : []),
1646
+ {
1647
+ label: this.label(action),
1648
+ icon: action.icon,
1649
+ severity: action.color,
1650
+ disabled: this.disabled(action) || this.busy(action),
1651
+ command: () => this.run(action),
1652
+ },
1653
+ ]);
1654
+ }, ...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
1655
+ label(action) {
1656
+ return action.label ?? action.tooltip ?? this.text.text('rowActions');
1657
+ }
1658
+ busy(action) {
1659
+ return typeof action.loading === 'function'
1660
+ ? action.loading(this.params().data)
1661
+ : !!action.loading;
1662
+ }
1663
+ disabled(action) {
1664
+ return typeof action.disabled === 'function'
1665
+ ? action.disabled(this.params().data)
1666
+ : !!action.disabled;
1667
+ }
1668
+ toggle(event, menu) {
1669
+ this.anchor =
1670
+ event.target.closest('button') ?? event.target;
1671
+ menu.toggle(event);
1672
+ }
1673
+ run(action, event) {
1674
+ const row = this.params().data;
1675
+ if (action.hidden?.(row) || this.disabled(action) || this.busy(action))
1676
+ return;
1677
+ const accept = () => {
1678
+ if (!action.hidden?.(row) && !this.disabled(action) && !this.busy(action))
1679
+ action.action(row);
1680
+ };
1681
+ if (!action.confirmation) {
1682
+ accept();
1683
+ return;
1684
+ }
1685
+ const configuration = {
1686
+ ...action.confirmation,
1687
+ event: event ??
1688
+ {
1689
+ target: this.anchor,
1690
+ currentTarget: this.anchor,
1691
+ },
1692
+ accept,
1693
+ };
1694
+ if (action.confirmation.confirmationType === 'delete')
1695
+ this.confirmation.confirmDelete(configuration);
1696
+ else
1697
+ this.confirmation.confirm(configuration);
1698
+ }
1699
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtDataTableRowActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
1700
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: MtDataTableRowActions, isStandalone: true, selector: "mt-data-table-row-actions", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()", "pointerdown": "$event.stopPropagation()" } }, ngImport: i0, template: `
1701
+ @for (action of inline(); track $index) {
1702
+ <mt-button
1703
+ [icon]="action.icon"
1704
+ [tooltip]="label(action)"
1705
+ [ariaLabel]="label(action)"
1706
+ [severity]="action.color ?? 'secondary'"
1707
+ variant="text"
1708
+ size="small"
1709
+ [loading]="busy(action)"
1710
+ [disabled]="disabled(action)"
1711
+ (click)="run(action, $event)"
1712
+ />
1713
+ }
1714
+ @if (menuItems().length) {
1715
+ <mt-button
1716
+ icon="general.dots-vertical"
1717
+ severity="secondary"
1718
+ variant="text"
1719
+ size="small"
1720
+ [ariaLabel]="text.text('rowActions')"
1721
+ [tooltip]="text.text('rowActions')"
1722
+ (click)="toggle($event, menu)"
1723
+ />
1724
+ <mt-menu
1725
+ #menu
1726
+ [model]="menuItems()"
1727
+ [ariaLabel]="text.text('rowActions')"
1728
+ />
1729
+ }
1730
+ `, isInline: true, styles: [":host{display:flex;align-items:center;justify-content:center;gap:2px;height:100%}\n"], dependencies: [{ kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Menu, selector: "mt-menu", inputs: ["model", "popup", "appendTo", "style", "styleClass", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex", "activeItemId"], outputs: ["activeItemIdChange", "onShow", "onHide", "onBlur", "onFocus", "onItemSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1731
+ }
1732
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtDataTableRowActions, decorators: [{
1733
+ type: Component,
1734
+ args: [{ selector: 'mt-data-table-row-actions', imports: [Button, Menu], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1735
+ '(click)': '$event.stopPropagation()',
1736
+ '(pointerdown)': '$event.stopPropagation()',
1737
+ }, template: `
1738
+ @for (action of inline(); track $index) {
1739
+ <mt-button
1740
+ [icon]="action.icon"
1741
+ [tooltip]="label(action)"
1742
+ [ariaLabel]="label(action)"
1743
+ [severity]="action.color ?? 'secondary'"
1744
+ variant="text"
1745
+ size="small"
1746
+ [loading]="busy(action)"
1747
+ [disabled]="disabled(action)"
1748
+ (click)="run(action, $event)"
1749
+ />
1750
+ }
1751
+ @if (menuItems().length) {
1752
+ <mt-button
1753
+ icon="general.dots-vertical"
1754
+ severity="secondary"
1755
+ variant="text"
1756
+ size="small"
1757
+ [ariaLabel]="text.text('rowActions')"
1758
+ [tooltip]="text.text('rowActions')"
1759
+ (click)="toggle($event, menu)"
1760
+ />
1761
+ <mt-menu
1762
+ #menu
1763
+ [model]="menuItems()"
1764
+ [ariaLabel]="text.text('rowActions')"
1765
+ />
1766
+ }
1767
+ `, styles: [":host{display:flex;align-items:center;justify-content:center;gap:2px;height:100%}\n"] }]
1768
+ }], propDecorators: { params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: true }] }] } });
1769
+
1770
+ /** Distribute available width without violating minimums or stretching fixed action columns. */
1771
+ function fitMtTableColumns(columns, available) {
1772
+ const minimum = columns.reduce((sum, column) => sum + column.min, 0);
1773
+ const widths = columns.map((column) => column.min);
1774
+ let remaining = Math.max(0, Math.floor(available) - minimum);
1775
+ let open = columns
1776
+ .map((_, index) => index)
1777
+ .filter((index) => (columns[index].max ?? Infinity) > widths[index]);
1778
+ while (remaining > 0 && open.length) {
1779
+ const weight = open.reduce((sum, index) => sum + Math.max(1, columns[index].width - columns[index].min), 0);
1780
+ let assigned = 0;
1781
+ for (const index of open) {
1782
+ const part = Math.max(1, Math.floor((remaining * Math.max(1, columns[index].width - columns[index].min)) /
1783
+ weight));
1784
+ const addition = Math.min(part, remaining - assigned, (columns[index].max ?? Infinity) - widths[index]);
1785
+ widths[index] += addition;
1786
+ assigned += addition;
1787
+ }
1788
+ remaining -= assigned;
1789
+ open = open.filter((index) => widths[index] < (columns[index].max ?? Infinity));
1790
+ if (!assigned)
1791
+ break;
1792
+ }
1793
+ return columns.map((column, index) => ({
1794
+ colId: column.colId,
1795
+ width: widths[index],
1796
+ }));
1797
+ }
1798
+
1799
+ /** Reuse the existing Arabic-safe product print path with the entire matching result. */
1800
+ function mtTablePrintConfiguration(api, definitions, title) {
1801
+ const state = api.getColumnState().filter((column) => !column.hide);
1802
+ const columns = state.flatMap((column) => definitions.filter((definition) => (definition.colId ?? definition.field) === column.colId));
1803
+ const rows = new Map();
1804
+ api.forEachNodeAfterFilterAndSort((node) => {
1805
+ if (node.detail || node.footer)
1806
+ return;
1807
+ for (const leaf of node.group ? (node.allLeafChildren ?? []) : [node])
1808
+ if (leaf.data)
1809
+ rows.set(leaf.id, leaf.data);
1810
+ });
1811
+ return {
1812
+ title,
1813
+ filename: title || 'table',
1814
+ rows: [...rows.values()],
1815
+ columns: columns.map((column) => ({
1816
+ key: column.colId ?? column.field,
1817
+ label: column.headerName ?? column.colId ?? column.field,
1818
+ type: 'custom',
1819
+ exportable: true,
1820
+ })),
1821
+ resolveValue: (row, column) => {
1822
+ const definition = columns.find((definition) => (definition.colId ?? definition.field) === column.key);
1823
+ const entity = definition.cellRendererParams?.['entity'];
1824
+ if (entity) {
1825
+ const value = entity(row);
1826
+ const exported = value ? mtEntityCellValues(value).export : null;
1827
+ return exported instanceof Date
1828
+ ? exported.toLocaleDateString()
1829
+ : exported;
1830
+ }
1831
+ const value = definition.valueGetter
1832
+ ? definition.valueGetter({
1833
+ data: row,
1834
+ column: definition,
1835
+ rowIndex: 0,
1836
+ })
1837
+ : row[definition.field ?? column.key];
1838
+ if (definition.valueFormatter)
1839
+ return definition.valueFormatter({
1840
+ data: row,
1841
+ column: definition,
1842
+ rowIndex: 0,
1843
+ value,
1844
+ });
1845
+ return typeof value === 'number' ||
1846
+ typeof value === 'boolean' ||
1847
+ typeof value === 'string'
1848
+ ? value
1849
+ : null;
1850
+ },
1851
+ };
1852
+ }
1853
+
1854
+ const EMPTY_QUERY = {
1855
+ offset: 0,
1856
+ limit: 1000,
1857
+ sort: [],
1858
+ filters: {},
1859
+ search: '',
1860
+ groupColumns: [],
1861
+ groupKeys: [],
1862
+ valueColumns: [],
1863
+ pivotColumns: [],
1864
+ };
1865
+ /** Masterteam chrome around the independent engine. Business operations remain in the owning feature. */
1866
+ class MtDataTableComponent {
1867
+ rows = input([], ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
1868
+ columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
1869
+ getRowId = input.required(...(ngDevMode ? [{ debugName: "getRowId" }] : /* istanbul ignore next */ []));
1870
+ source = input(null, ...(ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []));
1871
+ profile = input('compact', ...(ngDevMode ? [{ debugName: "profile" }] : /* istanbul ignore next */ []));
1872
+ title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
1873
+ showHeading = input(true, ...(ngDevMode ? [{ debugName: "showHeading" }] : /* istanbul ignore next */ []));
1874
+ height = input(420, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
1875
+ rowHeight = input(52, ...(ngDevMode ? [{ debugName: "rowHeight" }] : /* istanbul ignore next */ []));
1876
+ fitColumns = input(false, ...(ngDevMode ? [{ debugName: "fitColumns" }] : /* istanbul ignore next */ []));
1877
+ rowActions = input([], ...(ngDevMode ? [{ debugName: "rowActions" }] : /* istanbul ignore next */ []));
1878
+ loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
1879
+ masterDetail = input(false, ...(ngDevMode ? [{ debugName: "masterDetail" }] : /* istanbul ignore next */ []));
1880
+ detailRenderer = input(...(ngDevMode ? [undefined, { debugName: "detailRenderer" }] : /* istanbul ignore next */ []));
1881
+ detailRendererParams = input({}, ...(ngDevMode ? [{ debugName: "detailRendererParams" }] : /* istanbul ignore next */ []));
1882
+ isRowMaster = input(...(ngDevMode ? [undefined, { debugName: "isRowMaster" }] : /* istanbul ignore next */ []));
1883
+ detailAutoHeight = input(true, ...(ngDevMode ? [{ debugName: "detailAutoHeight" }] : /* istanbul ignore next */ []));
1884
+ detailHeight = input(500, ...(ngDevMode ? [{ debugName: "detailHeight" }] : /* istanbul ignore next */ []));
1885
+ selectable = input(false, ...(ngDevMode ? [{ debugName: "selectable" }] : /* istanbul ignore next */ []));
1886
+ groupable = input(false, ...(ngDevMode ? [{ debugName: "groupable" }] : /* istanbul ignore next */ []));
1887
+ readOnly = input(true, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
1888
+ viewIdentity = input(null, ...(ngDevMode ? [{ debugName: "viewIdentity" }] : /* istanbul ignore next */ []));
1889
+ exporter = input(null, ...(ngDevMode ? [{ debugName: "exporter" }] : /* istanbul ignore next */ []));
1890
+ exportFormats = input([
1891
+ 'csv',
1892
+ 'excel',
1893
+ ], ...(ngDevMode ? [{ debugName: "exportFormats" }] : /* istanbul ignore next */ []));
1894
+ columnLoadRequested = output();
1895
+ rowClick = output();
1896
+ selectionChange = output();
1897
+ focusChange = output();
1898
+ viewStateChange = output();
1899
+ text = inject(MtTableText);
1900
+ configuration = inject(MT_DATA_TABLE_CONFIGURATION);
1901
+ injector = inject(Injector);
1902
+ preferences = inject(MtTablePreferences);
1903
+ printService = inject(TableExportService);
1904
+ host = inject(ElementRef);
1905
+ destroyRef = inject(DestroyRef);
1906
+ grid = viewChild((MtDataGridComponent), ...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
1907
+ chartDock = viewChild('chartDock', ...(ngDevMode ? [{ debugName: "chartDock" }] : /* istanbul ignore next */ []));
1908
+ query = signal(EMPTY_QUERY, ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
1909
+ loadedRows = signal([], ...(ngDevMode ? [{ debugName: "loadedRows" }] : /* istanbul ignore next */ []));
1910
+ complete = signal(true, ...(ngDevMode ? [{ debugName: "complete" }] : /* istanbul ignore next */ []));
1911
+ total = signal(0, ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
1912
+ fetching = signal(false, ...(ngDevMode ? [{ debugName: "fetching" }] : /* istanbul ignore next */ []));
1913
+ error = signal(false, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
1914
+ focused = signal(false, ...(ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []));
1915
+ exporting = signal(false, ...(ngDevMode ? [{ debugName: "exporting" }] : /* istanbul ignore next */ []));
1916
+ exportFailed = signal(false, ...(ngDevMode ? [{ debugName: "exportFailed" }] : /* istanbul ignore next */ []));
1917
+ chartOpen = computed(() => !!this.grid()?.api.getChartModels().length, ...(ngDevMode ? [{ debugName: "chartOpen" }] : /* istanbul ignore next */ []));
1918
+ search = signal('', ...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
1919
+ reload = signal(0, ...(ngDevMode ? [{ debugName: "reload" }] : /* istanbul ignore next */ []));
1920
+ hydrated = signal(null, ...(ngDevMode ? [{ debugName: "hydrated" }] : /* istanbul ignore next */ []));
1921
+ focusHeight = signal(600, ...(ngDevMode ? [{ debugName: "focusHeight" }] : /* istanbul ignore next */ []));
1922
+ normalHeight = signal(0, ...(ngDevMode ? [{ debugName: "normalHeight" }] : /* istanbul ignore next */ []));
1923
+ focusOrigin = null;
1924
+ exportController = null;
1925
+ activeScope = null;
1926
+ preferenceKey = null;
1927
+ chartsHydrated = null;
1928
+ direction = computed(() => this.configuration.direction?.() ??
1929
+ (this.text.language().startsWith('ar') ? 'rtl' : 'ltr'), ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
1930
+ displayedRows = computed(() => this.source() ? this.loadedRows() : this.rows(), ...(ngDevMode ? [{ debugName: "displayedRows" }] : /* istanbul ignore next */ []));
1931
+ busy = computed(() => this.loading() || this.fetching(), ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
1932
+ analysisEnabled = computed(() => this.profile() === 'studio' && this.complete(), ...(ngDevMode ? [{ debugName: "analysisEnabled" }] : /* istanbul ignore next */ []));
1933
+ chartsEnabled = computed(() => this.analysisEnabled() && (this.source()?.capabilities.charts ?? true), ...(ngDevMode ? [{ debugName: "chartsEnabled" }] : /* istanbul ignore next */ []));
1934
+ exportAllowed = computed(() => this.source()?.capabilities.exportAll ?? true, ...(ngDevMode ? [{ debugName: "exportAllowed" }] : /* istanbul ignore next */ []));
1935
+ sideBar = computed(() => ({
1936
+ toolPanels: ['columns', 'filters'],
1937
+ position: this.direction() === 'rtl' ? 'left' : 'right',
1938
+ }), ...(ngDevMode ? [{ debugName: "sideBar" }] : /* istanbul ignore next */ []));
1939
+ count = computed(() => {
1940
+ if (!this.complete())
1941
+ return this.total();
1942
+ const api = this.grid()?.api;
1943
+ if (!api)
1944
+ return this.displayedRows().length;
1945
+ const ids = new Set();
1946
+ api.forEachNodeAfterFilterAndSort((node) => {
1947
+ if (node.detail || node.footer)
1948
+ return;
1949
+ if (node.group)
1950
+ for (const leaf of node.allLeafChildren ?? []) {
1951
+ if (!leaf.detail && !leaf.footer)
1952
+ ids.add(leaf.id);
1953
+ }
1954
+ else
1955
+ ids.add(node.id);
1956
+ });
1957
+ return ids.size;
1958
+ }, ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
1959
+ clientPaging = computed(() => {
1960
+ const api = this.grid()?.api;
1961
+ return (this.complete() &&
1962
+ !this.masterDetail() &&
1963
+ !api?.getRowGroupColumns().length &&
1964
+ !api?.isPivotMode() &&
1965
+ (this.profile() !== 'embedded' || this.displayedRows().length > 100));
1966
+ }, ...(ngDevMode ? [{ debugName: "clientPaging" }] : /* istanbul ignore next */ []));
1967
+ pagingInfo = computed(() => {
1968
+ if (this.complete() && !this.clientPaging())
1969
+ return null;
1970
+ const api = this.grid()?.api, size = this.complete()
1971
+ ? (api?.paginationGetPageSize() ?? 100)
1972
+ : this.query().limit;
1973
+ const page = this.complete()
1974
+ ? (api?.paginationGetCurrentPage() ?? 0)
1975
+ : Math.floor(this.query().offset / size);
1976
+ const total = this.count(), pages = Math.max(1, Math.ceil(total / size));
1977
+ return {
1978
+ size,
1979
+ page,
1980
+ total,
1981
+ pages,
1982
+ first: total ? page * size + 1 : 0,
1983
+ last: Math.min((page + 1) * size, total),
1984
+ };
1985
+ }, ...(ngDevMode ? [{ debugName: "pagingInfo" }] : /* istanbul ignore next */ []));
1986
+ selection = computed(() => this.selectable() || this.profile() === 'studio'
1987
+ ? { mode: 'multiRow', enableClickSelection: false }
1988
+ : undefined, ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
1989
+ resolvedColumns = computed(() => {
1990
+ const map = (column) => 'children' in column
1991
+ ? { ...column, children: column.children.map(map) }
1992
+ : {
1993
+ ...column,
1994
+ sortable: this.source()?.capabilities.sort === false
1995
+ ? false
1996
+ : column.sortable,
1997
+ filter: this.source()?.capabilities.filter === false
1998
+ ? false
1999
+ : column.filter,
2000
+ editable: this.profile() === 'studio' || this.readOnly()
2001
+ ? false
2002
+ : column.editable,
2003
+ suppressPaste: this.profile() === 'studio' || this.readOnly()
2004
+ ? true
2005
+ : column.suppressPaste,
2006
+ suppressFillHandle: this.profile() === 'studio' || this.readOnly()
2007
+ ? true
2008
+ : column.suppressFillHandle,
2009
+ enableRowGroup: (this.analysisEnabled() || this.groupable()) &&
2010
+ (this.source()?.capabilities.group ?? true) &&
2011
+ this.complete() &&
2012
+ column.enableRowGroup,
2013
+ enableValue: this.analysisEnabled() && column.enableValue,
2014
+ enablePivot: this.analysisEnabled() &&
2015
+ (this.source()?.capabilities.pivot ?? true) &&
2016
+ column.enablePivot,
2017
+ // Saved/default analysis roles cannot turn themselves on in compact or partial-result tables.
2018
+ rowGroup: (this.analysisEnabled() || this.groupable()) &&
2019
+ this.complete() &&
2020
+ (this.source()?.capabilities.group ?? true)
2021
+ ? column.rowGroup
2022
+ : false,
2023
+ aggFunc: this.analysisEnabled() ? column.aggFunc : null,
2024
+ pivot: this.analysisEnabled() &&
2025
+ (this.source()?.capabilities.pivot ?? true)
2026
+ ? column.pivot
2027
+ : false,
2028
+ };
2029
+ const columns = this.columns().map(map);
2030
+ if (this.rowActions().length && this.profile() !== 'studio')
2031
+ columns.push({
2032
+ colId: MT_TABLE_ACTIONS_COLUMN,
2033
+ headerName: this.text.text('actions'),
2034
+ initialWidth: 88,
2035
+ minWidth: 88,
2036
+ maxWidth: 88,
2037
+ resizable: false,
2038
+ pinned: this.direction() === 'rtl' ? 'left' : 'right',
2039
+ sortable: false,
2040
+ filter: false,
2041
+ lockVisible: true,
2042
+ lockPosition: true,
2043
+ suppressHeaderMenuButton: true,
2044
+ cellRenderer: (MtDataTableRowActions),
2045
+ cellRendererParams: { actions: this.rowActions() },
2046
+ });
2047
+ return columns;
2048
+ }, ...(ngDevMode ? [{ debugName: "resolvedColumns" }] : /* istanbul ignore next */ []));
2049
+ policyColumns = computed(() => {
2050
+ const flatten = (columns) => columns.flatMap((column) => 'children' in column ? flatten(column.children) : [column]);
2051
+ return flatten(this.resolvedColumns());
2052
+ }, ...(ngDevMode ? [{ debugName: "policyColumns" }] : /* istanbul ignore next */ []));
2053
+ viewStamp = computed(() => {
2054
+ const view = this.viewIdentity(), key = view ? this.preferences.key(view) : null;
2055
+ return key
2056
+ ? JSON.stringify([
2057
+ key,
2058
+ this.profile(),
2059
+ this.complete(),
2060
+ this.groupable(),
2061
+ this.policyColumns().map((column) => [
2062
+ column.colId ?? column.field,
2063
+ column.sortable,
2064
+ column.filter !== false,
2065
+ column.enableRowGroup,
2066
+ column.enableValue,
2067
+ column.enablePivot,
2068
+ column.allowedAggFuncs,
2069
+ ]),
2070
+ ])
2071
+ : null;
2072
+ }, ...(ngDevMode ? [{ debugName: "viewStamp" }] : /* istanbul ignore next */ []));
2073
+ columnChoices = computed(() => {
2074
+ const state = new Map(this.grid()
2075
+ ?.api.getColumnState()
2076
+ .map((column) => [column.colId, column]) ?? []);
2077
+ const flatten = (columns) => columns.flatMap((column) => 'children' in column ? flatten(column.children) : [column]);
2078
+ return flatten(this.columns()).map((column, index) => {
2079
+ const id = column.colId ?? column.field ?? String(index);
2080
+ return {
2081
+ id,
2082
+ label: column.headerName ?? id,
2083
+ visible: !(state.get(id)?.hide ?? column.hide ?? column.initialHide),
2084
+ locked: column.lockVisible,
2085
+ };
2086
+ });
2087
+ }, ...(ngDevMode ? [{ debugName: "columnChoices" }] : /* istanbul ignore next */ []));
2088
+ groupingItems = computed(() => [
2089
+ {
2090
+ label: this.text.text('noGrouping'),
2091
+ command: () => this.grid()?.api.setRowGroupColumns([]),
2092
+ },
2093
+ ...this.policyColumns()
2094
+ .filter((column) => column.enableRowGroup && column.colId !== MT_TABLE_ACTIONS_COLUMN)
2095
+ .map((column) => ({
2096
+ label: column.headerName ?? column.colId ?? column.field,
2097
+ command: () => this.grid()?.api.setRowGroupColumns([column.colId ?? column.field]),
2098
+ })),
2099
+ ], ...(ngDevMode ? [{ debugName: "groupingItems" }] : /* istanbul ignore next */ []));
2100
+ exportItems = computed(() => this.exportFormats().map((format) => ({
2101
+ label: this.text.text(format),
2102
+ disabled: this.exporting() ||
2103
+ this.busy() ||
2104
+ (!this.complete() && !this.exporter()),
2105
+ command: () => {
2106
+ void this.export(format);
2107
+ },
2108
+ })), ...(ngDevMode ? [{ debugName: "exportItems" }] : /* istanbul ignore next */ []));
2109
+ fitWidth() {
2110
+ const api = this.grid()?.api;
2111
+ if (!api || !this.fitColumns() || this.focused())
2112
+ return;
2113
+ const definitions = new Map(this.policyColumns().map((column) => [
2114
+ column.colId ?? column.field,
2115
+ column,
2116
+ ]));
2117
+ const state = api.getColumnState().filter((column) => !column.hide);
2118
+ const width = this.host.nativeElement.querySelector('mt-data-grid')
2119
+ ?.clientWidth ?? this.host.nativeElement.clientWidth;
2120
+ if (!width)
2121
+ return;
2122
+ const widths = fitMtTableColumns(state.map((column) => ({
2123
+ colId: column.colId,
2124
+ width: column.width ?? 180,
2125
+ min: definitions.get(column.colId)?.minWidth ?? 100,
2126
+ max: definitions.get(column.colId)?.maxWidth,
2127
+ })), width);
2128
+ if (widths.some((column) => Math.abs(column.width -
2129
+ (state.find((entry) => entry.colId === column.colId)?.width ?? 0)) > 1))
2130
+ api.setColumnWidths(widths);
2131
+ }
2132
+ constructor() {
2133
+ afterNextRender(() => {
2134
+ const body = this.host.nativeElement.querySelector('.mt-data-table-body');
2135
+ if (!body)
2136
+ return;
2137
+ const observer = new ResizeObserver(() => {
2138
+ this.fitWidth();
2139
+ if (this.focused())
2140
+ this.focusHeight.set(Math.max(120, body.clientHeight -
2141
+ (this.chartDock()?.nativeElement.clientHeight ?? 0)));
2142
+ });
2143
+ observer.observe(body);
2144
+ const dock = this.chartDock()?.nativeElement;
2145
+ if (dock)
2146
+ observer.observe(dock);
2147
+ this.destroyRef.onDestroy(() => observer.disconnect());
2148
+ });
2149
+ effect((onCleanup) => {
2150
+ const source = this.source(), query = this.query();
2151
+ this.reload();
2152
+ const identity = this.configuration.identity();
2153
+ const scope = JSON.stringify([identity, source?.scopeKey ?? null]);
2154
+ if (scope !== this.activeScope) {
2155
+ this.activeScope = scope;
2156
+ this.chartsHydrated = null;
2157
+ this.loadedRows.set([]);
2158
+ this.total.set(0);
2159
+ this.selectionChange.emit([]);
2160
+ if (source)
2161
+ this.complete.set(false);
2162
+ this.error.set(false);
2163
+ this.exportController?.abort();
2164
+ this.exporting.set(false);
2165
+ untracked(() => {
2166
+ const api = this.grid()?.api;
2167
+ api?.deselectAll();
2168
+ api?.clearCellSelection();
2169
+ api
2170
+ ?.getChartModels()
2171
+ .forEach((chart) => api.destroyChart(chart.chartId));
2172
+ });
2173
+ }
2174
+ if (!source) {
2175
+ this.complete.set(true);
2176
+ this.fetching.set(false);
2177
+ return;
2178
+ }
2179
+ const controller = new AbortController();
2180
+ onCleanup(() => controller.abort());
2181
+ this.fetching.set(true);
2182
+ this.error.set(false);
2183
+ const getRowId = this.getRowId();
2184
+ void loadMtTableResult(source, query, controller.signal, getRowId).then((result) => {
2185
+ if (controller.signal.aborted)
2186
+ return;
2187
+ this.loadedRows.set(result.rows);
2188
+ this.total.set(result.totalCount);
2189
+ this.complete.set(result.complete);
2190
+ this.fetching.set(false);
2191
+ }, () => {
2192
+ if (controller.signal.aborted)
2193
+ return;
2194
+ this.error.set(true);
2195
+ this.complete.set(false);
2196
+ this.fetching.set(false);
2197
+ });
2198
+ });
2199
+ effect(() => {
2200
+ const grid = this.grid(), view = this.viewIdentity();
2201
+ const key = view ? this.preferences.key(view) : null;
2202
+ const complete = this.complete();
2203
+ const stamp = this.viewStamp();
2204
+ if (!grid || !view || !key || stamp === this.hydrated())
2205
+ return;
2206
+ untracked(() => {
2207
+ if (this.preferenceKey !== null && this.preferenceKey !== key) {
2208
+ grid.api.setPivotMode(false);
2209
+ grid.api.setRowGroupColumns([]);
2210
+ grid.api.setValueColumns([]);
2211
+ grid.api.setPivotColumns([]);
2212
+ grid.api.setFilterModel({});
2213
+ grid.api.setSortModel([]);
2214
+ grid.api.resetColumnState();
2215
+ grid.api.deselectAll();
2216
+ grid.api.clearCellSelection();
2217
+ this.setSearch('');
2218
+ }
2219
+ this.preferenceKey = key;
2220
+ const saved = this.preferences.read(view);
2221
+ if (saved)
2222
+ applyGridViewState(grid.api, reconcileMtTableView(saved, this.policyColumns(), {
2223
+ grouping: complete &&
2224
+ (this.profile() === 'studio' || this.groupable()) &&
2225
+ (this.source()?.capabilities.group ?? true),
2226
+ values: this.profile() === 'studio' && complete,
2227
+ pivot: this.profile() === 'studio' &&
2228
+ complete &&
2229
+ (this.source()?.capabilities.pivot ?? true),
2230
+ }));
2231
+ });
2232
+ this.hydrated.set(stamp);
2233
+ });
2234
+ effect(() => {
2235
+ const grid = this.grid(), view = this.viewIdentity();
2236
+ if (!grid || !view || this.hydrated() !== this.viewStamp())
2237
+ return;
2238
+ const state = captureGridViewState(grid.api);
2239
+ untracked(() => {
2240
+ const saved = this.preferences.read(view);
2241
+ this.preferences.write(view, !this.complete() && saved
2242
+ ? {
2243
+ ...state,
2244
+ rowGroups: saved.rowGroups,
2245
+ values: saved.values,
2246
+ pivot: saved.pivot,
2247
+ }
2248
+ : state);
2249
+ this.viewStateChange.emit(state);
2250
+ });
2251
+ });
2252
+ this.destroyRef.onDestroy(() => {
2253
+ this.exportController?.abort();
2254
+ this.focusOrigin = null;
2255
+ });
2256
+ effect(() => {
2257
+ const api = this.grid()?.api, view = this.viewIdentity(), dock = this.chartDock()?.nativeElement;
2258
+ const scope = this.source()?.viewScopeKey ?? this.source()?.scopeKey ?? 'client';
2259
+ const preference = view ? this.preferences.key(view) : null;
2260
+ if (!api ||
2261
+ !view ||
2262
+ !dock ||
2263
+ !preference ||
2264
+ this.busy() ||
2265
+ !this.chartsEnabled())
2266
+ return;
2267
+ const key = `${preference}:${scope}`;
2268
+ if (this.chartsHydrated !== key) {
2269
+ untracked(() => {
2270
+ for (const saved of this.preferences.readCharts(view, scope)) {
2271
+ const options = restoreMtTableChart(saved, api);
2272
+ if (options) {
2273
+ api.createRangeChart({
2274
+ ...options,
2275
+ chartContainer: dock,
2276
+ });
2277
+ }
2278
+ }
2279
+ });
2280
+ this.chartsHydrated = key;
2281
+ }
2282
+ const charts = api
2283
+ .getChartModels()
2284
+ .map((model) => captureMtTableChart(model, api));
2285
+ untracked(() => this.preferences.writeCharts(view, scope, charts));
2286
+ });
2287
+ }
2288
+ setSearch(value) {
2289
+ this.search.set(value);
2290
+ if (this.source()?.processing === 'server')
2291
+ this.query.update((query) => ({ ...query, search: value, offset: 0 }));
2292
+ }
2293
+ /** Complete query scope for record/level exports and cross-record analysis. Never derived from loaded rows. */
2294
+ getQuery() {
2295
+ const api = this.grid()?.api;
2296
+ return {
2297
+ ...this.query(),
2298
+ sort: api?.getSortModel() ?? [],
2299
+ filters: api?.getFilterModel() ?? {},
2300
+ search: this.search(),
2301
+ groupColumns: api?.getRowGroupColumns() ?? [],
2302
+ valueColumns: api?.getValueColumnState() ?? [],
2303
+ pivotColumns: api?.getPivotColumns() ?? [],
2304
+ };
2305
+ }
2306
+ sorted(sort) {
2307
+ for (const column of sort)
2308
+ this.columnLoadRequested.emit(column.colId);
2309
+ if (this.source()?.processing === 'server')
2310
+ this.query.update((query) => ({ ...query, sort, offset: 0 }));
2311
+ }
2312
+ filtered() {
2313
+ for (const column of Object.keys(this.grid()?.api.getFilterModel() ?? {}))
2314
+ this.columnLoadRequested.emit(column);
2315
+ if (this.source()?.processing === 'server')
2316
+ this.query.update((query) => ({
2317
+ ...query,
2318
+ filters: this.grid()?.api.getFilterModel() ?? {},
2319
+ offset: 0,
2320
+ }));
2321
+ }
2322
+ selected() {
2323
+ this.selectionChange.emit(this.grid()?.api.getSelectedRows() ?? []);
2324
+ }
2325
+ changeColumn(id, visible) {
2326
+ if (visible)
2327
+ this.columnLoadRequested.emit(id);
2328
+ this.grid()?.api.setColumnsVisible([id], visible);
2329
+ this.fitWidth();
2330
+ }
2331
+ columnsVisible(ids) {
2332
+ const visible = new Set(this.grid()
2333
+ ?.api.getColumnState()
2334
+ .filter((column) => !column.hide)
2335
+ .map((column) => column.colId));
2336
+ for (const id of ids)
2337
+ if (visible.has(id))
2338
+ this.columnLoadRequested.emit(id);
2339
+ }
2340
+ analysisFieldsChanged() {
2341
+ const api = this.grid()?.api;
2342
+ for (const id of new Set([
2343
+ ...(api?.getRowGroupColumns() ?? []),
2344
+ ...(api?.getValueColumns() ?? []),
2345
+ ...(api?.getPivotColumns() ?? []),
2346
+ ]))
2347
+ this.columnLoadRequested.emit(id);
2348
+ }
2349
+ retry() {
2350
+ this.reload.update((value) => value + 1);
2351
+ }
2352
+ page(direction) {
2353
+ if (this.complete()) {
2354
+ const api = this.grid()?.api;
2355
+ api?.paginationGoToPage(api.paginationGetCurrentPage() + direction);
2356
+ return;
2357
+ }
2358
+ this.query.update((query) => ({
2359
+ ...query,
2360
+ offset: Math.max(0, query.offset + direction * query.limit),
2361
+ }));
2362
+ }
2363
+ pageSize(size) {
2364
+ if (Number.isSafeInteger(size) && size > 0)
2365
+ this.grid()?.api.paginationSetPageSize(size);
2366
+ }
2367
+ pageNumber(page) {
2368
+ const info = this.pagingInfo();
2369
+ if (!info || !Number.isSafeInteger(page))
2370
+ return;
2371
+ const target = Math.max(0, Math.min(info.pages - 1, page - 1));
2372
+ if (this.complete())
2373
+ this.grid()?.api.paginationGoToPage(target);
2374
+ else
2375
+ this.query.update((query) => ({ ...query, offset: target * info.size }));
2376
+ }
2377
+ number(value) {
2378
+ return new Intl.NumberFormat(this.text.language()).format(value);
2379
+ }
2380
+ openAnalysis() {
2381
+ const api = this.grid()?.api;
2382
+ if (api?.isToolPanelShowing()) {
2383
+ api.closeToolPanel();
2384
+ api.setSideBarVisible(false);
2385
+ }
2386
+ else {
2387
+ api?.setSideBarVisible(true);
2388
+ api?.openToolPanel('columns');
2389
+ }
2390
+ }
2391
+ focus(event) {
2392
+ this.focusOrigin = event.currentTarget;
2393
+ this.normalHeight.set(this.host.nativeElement.getBoundingClientRect().height);
2394
+ this.focusHeight.set(Math.max(240, window.innerHeight - 200));
2395
+ this.focused.set(true);
2396
+ this.focusChange.emit(true);
2397
+ }
2398
+ closeFocus() {
2399
+ if (!this.focused())
2400
+ return;
2401
+ this.focused.set(false);
2402
+ this.focusChange.emit(false);
2403
+ afterNextRender(() => this.focusOrigin?.focus(), {
2404
+ injector: this.injector,
2405
+ });
2406
+ }
2407
+ escape(event) {
2408
+ const menus = this.host.nativeElement.querySelectorAll('details[open]');
2409
+ if (menus.length) {
2410
+ for (const menu of menus)
2411
+ menu.open = false;
2412
+ event.stopPropagation();
2413
+ }
2414
+ else
2415
+ this.closeFocus();
2416
+ }
2417
+ chartTable() {
2418
+ const grid = this.grid(), dock = this.chartDock()?.nativeElement;
2419
+ if (!grid || !dock || !this.chartsEnabled())
2420
+ return;
2421
+ grid.api.createRangeChart({
2422
+ cellRange: {
2423
+ columns: grid.api.isPivotMode()
2424
+ ? [
2425
+ ...grid.api.getRowGroupColumns(),
2426
+ ...(grid.api.getPivotResultColumns().length
2427
+ ? grid.api.getPivotResultColumns()
2428
+ : grid.api.getValueColumns()),
2429
+ ]
2430
+ : [
2431
+ ...grid.api.getRowGroupColumns(),
2432
+ ...this.columnChoices()
2433
+ .filter((column) => column.visible)
2434
+ .map((column) => column.id),
2435
+ ],
2436
+ rowIds: null,
2437
+ },
2438
+ chartContainer: dock,
2439
+ title: this.title(),
2440
+ });
2441
+ }
2442
+ chartSelection() {
2443
+ const api = this.grid()?.api, dock = this.chartDock()?.nativeElement;
2444
+ if (!api || !dock || !this.chartsEnabled())
2445
+ return;
2446
+ const offset = this.clientPaging()
2447
+ ? api.paginationGetCurrentPage() * api.paginationGetPageSize()
2448
+ : 0;
2449
+ const ids = [];
2450
+ api.forEachNodeAfterFilterAndSort((node) => ids.push(node.id));
2451
+ const ranges = api.getCellRanges().map((range) => ({
2452
+ columns: range.columns,
2453
+ rowStartIndex: offset + Math.min(range.startRow, range.endRow),
2454
+ rowEndIndex: offset + Math.max(range.startRow, range.endRow),
2455
+ rowIds: ids.slice(offset + Math.min(range.startRow, range.endRow), offset + Math.max(range.startRow, range.endRow) + 1),
2456
+ }));
2457
+ if (!ranges.length)
2458
+ return;
2459
+ api.createRangeChart({
2460
+ cellRange: ranges[0],
2461
+ cellRanges: ranges.slice(1),
2462
+ chartContainer: dock,
2463
+ title: `${this.title()} · ${this.text.text('chartSelection')}`,
2464
+ });
2465
+ }
2466
+ contextMenu = () => [
2467
+ 'copy',
2468
+ 'copyWithHeaders',
2469
+ ...(this.chartsEnabled()
2470
+ ? [
2471
+ {
2472
+ name: this.text.text('chartSelection'),
2473
+ disabled: !this.grid()?.api.getCellRanges().length,
2474
+ action: () => this.chartSelection(),
2475
+ },
2476
+ ]
2477
+ : []),
2478
+ ];
2479
+ resetView() {
2480
+ const view = this.viewIdentity(), api = this.grid()?.api;
2481
+ if (view)
2482
+ this.preferences.clear(view);
2483
+ if (view)
2484
+ this.preferences.writeCharts(view, this.source()?.viewScopeKey ?? this.source()?.scopeKey ?? 'client', []);
2485
+ api?.getChartModels().forEach((chart) => api.destroyChart(chart.chartId));
2486
+ api?.setPivotMode(false);
2487
+ api?.setRowGroupColumns([]);
2488
+ api?.setValueColumns([]);
2489
+ api?.setPivotColumns([]);
2490
+ api?.setFilterModel({});
2491
+ api?.setSortModel([]);
2492
+ api?.resetColumnState();
2493
+ this.setSearch('');
2494
+ }
2495
+ async export(format) {
2496
+ const api = this.grid()?.api;
2497
+ if (!api || this.exporting())
2498
+ return;
2499
+ const exporter = this.exporter();
2500
+ if (!this.complete() && !exporter)
2501
+ return;
2502
+ this.exportController?.abort();
2503
+ const controller = new AbortController();
2504
+ this.exportController = controller;
2505
+ this.exportFailed.set(false);
2506
+ this.exporting.set(true);
2507
+ try {
2508
+ if (exporter)
2509
+ await exporter.export({
2510
+ format,
2511
+ title: this.title(),
2512
+ query: {
2513
+ ...this.query(),
2514
+ sort: api.getSortModel(),
2515
+ filters: api.getFilterModel(),
2516
+ search: this.search(),
2517
+ },
2518
+ rows: this.displayedRows(),
2519
+ complete: this.complete(),
2520
+ visibleColumns: this.columnChoices()
2521
+ .filter((column) => column.visible)
2522
+ .map((column) => column.id),
2523
+ }, controller.signal);
2524
+ else if (format === 'csv')
2525
+ api.exportDataAsCsv({
2526
+ fileName: this.title() || 'table',
2527
+ columnKeys: this.columnChoices()
2528
+ .filter((column) => column.visible)
2529
+ .map((column) => column.id),
2530
+ });
2531
+ else if (format === 'excel')
2532
+ await api.exportDataAsExcel({
2533
+ fileName: this.title() || 'table',
2534
+ columnKeys: this.columnChoices()
2535
+ .filter((column) => column.visible)
2536
+ .map((column) => column.id),
2537
+ });
2538
+ else
2539
+ this.printService.printPdf(mtTablePrintConfiguration(api, this.policyColumns().filter((column) => column.colId !== MT_TABLE_ACTIONS_COLUMN), this.title()));
2540
+ }
2541
+ catch {
2542
+ if (!controller.signal.aborted)
2543
+ this.exportFailed.set(true);
2544
+ }
2545
+ finally {
2546
+ if (this.exportController === controller)
2547
+ this.exporting.set(false);
2548
+ }
2549
+ }
2550
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtDataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2551
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: MtDataTableComponent, isStandalone: true, selector: "mt-data-table", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, getRowId: { classPropertyName: "getRowId", publicName: "getRowId", isSignal: true, isRequired: true, transformFunction: null }, source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: false, transformFunction: null }, profile: { classPropertyName: "profile", publicName: "profile", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, showHeading: { classPropertyName: "showHeading", publicName: "showHeading", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, rowHeight: { classPropertyName: "rowHeight", publicName: "rowHeight", isSignal: true, isRequired: false, transformFunction: null }, fitColumns: { classPropertyName: "fitColumns", publicName: "fitColumns", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, masterDetail: { classPropertyName: "masterDetail", publicName: "masterDetail", isSignal: true, isRequired: false, transformFunction: null }, detailRenderer: { classPropertyName: "detailRenderer", publicName: "detailRenderer", isSignal: true, isRequired: false, transformFunction: null }, detailRendererParams: { classPropertyName: "detailRendererParams", publicName: "detailRendererParams", isSignal: true, isRequired: false, transformFunction: null }, isRowMaster: { classPropertyName: "isRowMaster", publicName: "isRowMaster", isSignal: true, isRequired: false, transformFunction: null }, detailAutoHeight: { classPropertyName: "detailAutoHeight", publicName: "detailAutoHeight", isSignal: true, isRequired: false, transformFunction: null }, detailHeight: { classPropertyName: "detailHeight", publicName: "detailHeight", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, groupable: { classPropertyName: "groupable", publicName: "groupable", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, viewIdentity: { classPropertyName: "viewIdentity", publicName: "viewIdentity", isSignal: true, isRequired: false, transformFunction: null }, exporter: { classPropertyName: "exporter", publicName: "exporter", isSignal: true, isRequired: false, transformFunction: null }, exportFormats: { classPropertyName: "exportFormats", publicName: "exportFormats", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnLoadRequested: "columnLoadRequested", rowClick: "rowClick", selectionChange: "selectionChange", focusChange: "focusChange", viewStateChange: "viewStateChange" }, host: { listeners: { "keydown.escape": "escape($event)" }, properties: { "attr.dir": "direction()", "class.mt-data-table-focused": "focused()", "style.min-height.px": "focused() ? normalHeight() : null" } }, viewQueries: [{ propertyName: "grid", first: true, predicate: (MtDataGridComponent), descendants: true, isSignal: true }, { propertyName: "chartDock", first: true, predicate: ["chartDock"], descendants: true, isSignal: true }], ngImport: i0, template: "<section\r\n class=\"mt-data-table-surface\"\r\n [attr.role]=\"focused() ? 'dialog' : null\"\r\n [attr.aria-modal]=\"focused() ? true : null\"\r\n [attr.aria-label]=\"title()\"\r\n [cdkTrapFocus]=\"focused()\"\r\n [cdkTrapFocusAutoCapture]=\"focused()\"\r\n>\r\n @if (profile() !== \"embedded\" || focused()) {\r\n <div class=\"mt-data-table-toolbar\">\r\n @if (showHeading() && title()) {\r\n <div class=\"mt-data-table-heading\">\r\n <strong>{{ title() }}</strong\r\n ><span>{{ count() }} {{ text.text(\"rows\") }}</span>\r\n </div>\r\n }\r\n <label class=\"mt-data-table-search\">\r\n <span class=\"mt-data-table-sr-only\">{{ text.text(\"search\") }}</span>\r\n <mt-text-field\r\n icon=\"general.search-md\"\r\n [placeholder]=\"text.text('search')\"\r\n [ngModel]=\"search()\"\r\n [readonly]=\"source()?.capabilities?.filter === false\"\r\n (ngModelChange)=\"setSearch($event)\"\r\n />\r\n </label>\r\n <div\r\n class=\"mt-data-table-tools\"\r\n role=\"group\"\r\n [attr.aria-label]=\"text.text('actions')\"\r\n >\r\n <mt-button\r\n [label]=\"text.text('columns')\"\r\n icon=\"layout.columns-03\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (click)=\"columnsPopup.toggle($event)\"\r\n />\r\n <p-popover #columnsPopup appendTo=\"body\">\r\n <div\r\n class=\"mt-data-table-menu-content\"\r\n role=\"group\"\r\n [attr.aria-label]=\"text.text('columns')\"\r\n >\r\n @for (column of columnChoices(); track column.id) {\r\n <label\r\n ><input\r\n type=\"checkbox\"\r\n [checked]=\"column.visible\"\r\n [disabled]=\"column.locked\"\r\n (change)=\"\r\n changeColumn(column.id, $any($event.target).checked)\r\n \"\r\n />{{ column.label }}</label\r\n >\r\n }\r\n <mt-button\r\n [label]=\"text.text('reset')\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n (click)=\"resetView()\"\r\n />\r\n </div>\r\n </p-popover>\r\n @if (groupable() && complete()) {\r\n <mt-button\r\n [label]=\"text.text('groupBy')\"\r\n icon=\"layout.columns-03\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (click)=\"groupMenu.toggle($event)\"\r\n />\r\n <mt-menu\r\n #groupMenu\r\n [model]=\"groupingItems()\"\r\n [ariaLabel]=\"text.text('groupBy')\"\r\n />\r\n }\r\n @if (analysisEnabled()) {\r\n <mt-button\r\n [label]=\"text.text('analysis')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (click)=\"openAnalysis()\"\r\n />\r\n <mt-button\r\n [label]=\"text.text('chart')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [disabled]=\"!chartsEnabled()\"\r\n (click)=\"chartTable()\"\r\n />\r\n }\r\n @if (exportFormats().length && exportAllowed()) {\r\n <mt-button\r\n [label]=\"text.text('export')\"\r\n icon=\"general.download-01\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [loading]=\"exporting()\"\r\n (click)=\"exportMenu.toggle($event)\"\r\n />\r\n <mt-menu\r\n #exportMenu\r\n [model]=\"exportItems()\"\r\n [ariaLabel]=\"text.text('export')\"\r\n />\r\n }\r\n @if (profile() === \"studio\") {\r\n <mt-button\r\n [label]=\"text.text('closeFocus')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [hidden]=\"!focused()\"\r\n (click)=\"closeFocus()\"\r\n />\r\n <mt-button\r\n [label]=\"text.text('focus')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [hidden]=\"focused()\"\r\n (click)=\"focus($event)\"\r\n />\r\n }\r\n <ng-content select=\"[tableActions]\" />\r\n </div>\r\n </div>\r\n }\r\n @if (error() || exportFailed()) {\r\n <div class=\"mt-data-table-error\" role=\"alert\">\r\n {{ text.text(error() ? \"failed\" : \"exportFailed\") }}\r\n @if (error()) {\r\n <mt-button\r\n [label]=\"text.text('retry')\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n (click)=\"retry()\"\r\n />\r\n }\r\n </div>\r\n }\r\n @if (profile() === \"studio\" && !complete()) {\r\n <p class=\"mt-data-table-hint\">{{ text.text(\"incomplete\") }}</p>\r\n }\r\n <div class=\"mt-data-table-body\">\r\n <mt-data-grid\r\n [rowData]=\"displayedRows()\"\r\n [columnDefs]=\"resolvedColumns()\"\r\n [getRowId]=\"getRowId()\"\r\n [height]=\"focused() ? focusHeight() : height()\"\r\n [rowHeight]=\"rowHeight()\"\r\n [direction]=\"direction()\"\r\n [localeText]=\"text.gridLocale()\"\r\n [ariaLabel]=\"title()\"\r\n [loading]=\"busy()\"\r\n [loadingText]=\"text.text('loading')\"\r\n [noRowsText]=\"text.text('noRows')\"\r\n [dataProcessing]=\"complete() ? 'client' : 'external'\"\r\n [quickFilterText]=\"source()?.processing === 'server' ? '' : search()\"\r\n [rowSelection]=\"selection()\"\r\n [cellSelection]=\"profile() === 'studio'\"\r\n [suppressCutToClipboard]=\"true\"\r\n [getContextMenuItems]=\"contextMenu\"\r\n [sideBar]=\"sideBar()\"\r\n [rowGroupPanelShow]=\"analysisEnabled() ? 'onlyWhenGrouping' : 'never'\"\r\n [pivotPanelShow]=\"analysisEnabled() ? 'onlyWhenPivoting' : 'never'\"\r\n [enableCharts]=\"chartsEnabled()\"\r\n [masterDetail]=\"masterDetail()\"\r\n [detailCellRenderer]=\"detailRenderer()\"\r\n [detailCellRendererParams]=\"detailRendererParams()\"\r\n [isRowMaster]=\"isRowMaster()\"\r\n [detailRowAutoHeight]=\"detailAutoHeight()\"\r\n [detailRowHeight]=\"detailHeight()\"\r\n [pagination]=\"clientPaging()\"\r\n [paginationPageSize]=\"100\"\r\n [suppressPdfExport]=\"true\"\r\n [suppressCsvExport]=\"!complete() || !!exporter()\"\r\n [suppressExcelExport]=\"!complete() || !!exporter()\"\r\n (sortChanged)=\"sorted($event)\"\r\n (filterChanged)=\"filtered()\"\r\n (rowClicked)=\"$event.node.data && rowClick.emit($event.node.data)\"\r\n (selectionChanged)=\"selected()\"\r\n (columnVisible)=\"columnsVisible($event.columns)\"\r\n (columnRowGroupChanged)=\"analysisFieldsChanged()\"\r\n (columnValueChanged)=\"analysisFieldsChanged()\"\r\n (columnPivotChanged)=\"analysisFieldsChanged()\"\r\n />\r\n <div\r\n #chartDock\r\n class=\"mt-data-table-chart-dock\"\r\n [class.mt-data-table-chart-open]=\"chartOpen() && chartsEnabled()\"\r\n ></div>\r\n </div>\r\n @if (pagingInfo(); as paging) {\r\n <div class=\"mt-data-table-pagination\">\r\n @if (complete()) {\r\n <label\r\n >{{ text.text(\"pageSize\") }}\r\n <select\r\n [value]=\"paging.size\"\r\n (change)=\"pageSize(+$any($event.target).value)\"\r\n >\r\n @for (size of [20, 50, 100]; track size) {\r\n <option [value]=\"size\">{{ number(size) }}</option>\r\n }\r\n </select></label\r\n >\r\n }\r\n <mt-button\r\n [label]=\"text.text('previous')\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n [disabled]=\"busy() || paging.page === 0\"\r\n (click)=\"page(-1)\"\r\n />\r\n <bdi\r\n >{{ number(paging.first) }}\u2013{{ number(paging.last) }} /\r\n {{ number(paging.total) }}</bdi\r\n >\r\n <label\r\n >{{ text.text(\"page\") }}\r\n <input\r\n type=\"number\"\r\n min=\"1\"\r\n [max]=\"paging.pages\"\r\n [value]=\"paging.page + 1\"\r\n [disabled]=\"busy()\"\r\n (change)=\"pageNumber(+$any($event.target).value)\"\r\n /></label>\r\n <mt-button\r\n class=\"mt-data-table-next\"\r\n [label]=\"text.text('next')\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n [disabled]=\"busy() || paging.page + 1 >= paging.pages\"\r\n (click)=\"page(1)\"\r\n />\r\n </div>\r\n }\r\n</section>\r\n", styles: [":host{display:block;min-width:0;color:var(--p-text-color, #25354a);font:inherit}.mt-data-table-surface{min-width:0;background:var(--p-content-background, #fff);border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:var(--p-content-border-radius, 10px);overflow:hidden}.mt-data-table-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:16px;min-height:68px;box-sizing:border-box;border-bottom:1px solid var(--p-content-border-color, #e4e7ec)}.mt-data-table-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-inline-start:auto}.mt-data-table-search{display:block;flex:1 1 200px;max-width:300px;min-width:160px}.mt-data-table-search mt-text-field{min-width:0}:host ::ng-deep mt-data-grid{padding:0;border:0;border-radius:0}.mt-data-table-heading{display:flex;align-items:baseline;gap:8px;margin-inline-end:auto}.mt-data-table-heading span,.mt-data-table-hint{color:var(--p-text-muted-color, #667085);font-size:12px}.mt-data-table-search input,button,summary{min-height:34px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;background:var(--p-content-background, #fff);color:inherit;font:inherit;padding:6px 10px}button,summary{cursor:pointer;list-style:none;font-size:13px}button:hover,summary:hover{background:var(--p-content-hover-background, #f3f6f8)}button:disabled{opacity:.5;cursor:default}input:focus-visible,button:focus-visible,summary:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}.mt-data-table-menu{position:relative}.mt-data-table-menu-content{display:flex;flex-direction:column;min-width:210px;max-height:320px;overflow:auto;padding:2px}.mt-data-table-menu-content label{display:flex;align-items:center;gap:8px;padding:6px;font-size:13px}.mt-data-table-menu-content button{border:0;text-align:start}.mt-data-table-hint,.mt-data-table-error{margin:0;padding:8px 12px}.mt-data-table-error{display:flex;align-items:center;justify-content:space-between;color:var(--p-red-600, #b42318)}.mt-data-table-body{min-width:0}.mt-data-table-chart-dock{display:none;min-height:300px}.mt-data-table-chart-open{display:block}.mt-data-table-pagination{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:16px;padding:10px 12px;font-size:13px;border-top:1px solid var(--p-content-border-color, #e4e7ec)}.mt-data-table-pagination label{display:flex;align-items:center;gap:6px}.mt-data-table-pagination input{width:4.5em}.mt-data-table-pagination input,.mt-data-table-pagination select{box-sizing:border-box;padding:6px;min-height:34px;border:1px solid var(--p-content-border-color, #ddd);border-radius:6px;background:var(--p-content-background, white);color:inherit;font:inherit}:host ::ng-deep mt-data-grid>.mt-grid-main>mt-grid-pager{display:none}.mt-data-table-sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host.mt-data-table-focused>.mt-data-table-surface{position:fixed;inset:var(--mt-data-table-focus-inset, 16px);z-index:var(--mt-data-table-focus-z-index, 1000);overflow:auto;box-shadow:0 12px 60px #0005;border-radius:var(--p-content-border-radius, 6px);display:flex;flex-direction:column}:host.mt-data-table-focused .mt-data-table-body{display:flex;flex-direction:column;flex:1;min-height:120px;overflow:auto}:host.mt-data-table-focused .mt-data-table-chart-open{height:max(300px,45%);flex:0 0 max(300px,45%);overflow:auto}:host.mt-data-table-focused .mt-data-table-toolbar,:host.mt-data-table-focused .mt-data-table-pagination{flex-shrink:0}@media(max-width:640px){.mt-data-table-menu-content{min-width:0;max-width:calc(100vw - 64px);max-height:60dvh}.mt-data-table-search{width:100%;max-width:none;flex-basis:100%}.mt-data-table-search input{box-sizing:border-box;width:100%}:host.mt-data-table-focused>.mt-data-table-surface{inset:4px}}\n"], dependencies: [{ kind: "component", type: MtDataGridComponent, selector: "mt-data-grid", inputs: ["rowData", "dataProcessing", "columnDefs", "getRowId", "height", "autoHeight", "autoHeightMaxRows", "autoHeightMinRows", "rowHeight", "animateRows", "headerHeight", "groupHeaderHeight", "direction", "localeText", "localeTextResolver", "ariaLabel", "loading", "noRowsText", "loadingText", "noRowsTemplate", "autoSizeStrategy", "columnMenu", "mainMenuItems", "autoSizePadding", "quickFilterText", "showQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "cacheQuickFilter", "applyQuickFilterBeforePivotOrAgg", "filtersToolPanelDef", "isExternalFilterPresent", "doesExternalFilterPass", "floatingFiltersHeight", "rowSelection", "selectionColumnDef", "rowNumbers", "rowDragManaged", "rowDragEntireRow", "rowDragMultiRow", "suppressMoveWhenRowDragging", "cellSelection", "statusBar", "suppressContextMenu", "allowContextMenuWithControlKey", "preventDefaultOnContextMenu", "getContextMenuItems", "suppressCsvExport", "suppressExcelExport", "suppressPdfExport", "defaultPdfExportParams", "excelStyles", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "copySelectedRows", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressCutToClipboard", "defaultCsvExportParams", "defaultExcelExportParams", "groupDisplayType", "groupRowRenderer", "groupRowRendererParams", "suppressGroupRowsSticky", "groupHideOpenParents", "groupHideParentOfSingleChild", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "showOpenedGroup", "groupAggFiltering", "suppressAggFilteredOnly", "aggregateOnlyChangedColumns", "suppressColumnMoveAnimation", "pivotRowTotals", "pivotColumnGroupTotals", "pivotMaxGeneratedColumns", "pivotDefaultExpanded", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "processPivotResultColDef", "processPivotResultColGroupDef", "processUnpinnedColumns", "rowGroupPanelShow", "pivotPanelShow", "pivotPanelHint", "groupDefaultExpanded", "autoGroupColumnDef", "groupTotalRow", "grandTotalRow", "aggFuncs", "suppressRowGroupHidesColumns", "suppressMakeColumnVisibleAfterUnGroup", "sideBar", "pivotMode", "suppressAggFuncInHeader", "enableCharts", "chartThemes", "customChartThemes", "chartToolPanelsDef", "chartThemeOverrides", "chartContext", "chartRecordsLabel", "getChartToolbarItems", "groupMaintainOrder", "treeData", "getDataPath", "masterDetail", "isRowMaster", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "singleClickEdit", "suppressClickEdit", "stopEditingWhenCellsLoseFocus", "undoRedoCellEditing", "undoRedoCellEditingLimit", "pagination", "paginationPanelShow", "paginationPageSize", "paginationTotalRows", "paginationCurrentPage", "paginationPageSizeSelector", "rowGroupPanelSuppressSort"], outputs: ["displayedColumnsChanged", "columnEverythingChanged", "pivotMaxColumnsExceeded", "gridReady", "sortChanged", "cellFocused", "columnResized", "columnMoved", "columnPinned", "columnVisible", "columnGroupOpened", "filterChanged", "filterModified", "filterOpened", "rowSelected", "selectionChanged", "rowClicked", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "cellSelectionChanged", "contextMenuVisibleChanged", "rowGroupOpened", "columnRowGroupChanged", "expandOrCollapseAll", "cellEditingStarted", "cellEditingStopped", "cellValueChanged", "pasteStart", "pasteEnd", "fillStart", "fillEnd", "paginationChanged", "toolPanelVisibleChanged", "toolPanelSizeChanged", "columnValueChanged", "columnPivotChanged", "columnPivotModeChanged", "chartCreated", "chartDestroyed", "chartRangeSelectionChanged", "chartOptionsChanged"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Menu, selector: "mt-menu", inputs: ["model", "popup", "appendTo", "style", "styleClass", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex", "activeItemId"], outputs: ["activeItemIdChange", "onShow", "onHide", "onBlur", "onFocus", "onItemSelect"] }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2552
+ }
2553
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MtDataTableComponent, decorators: [{
2554
+ type: Component,
2555
+ args: [{ selector: 'mt-data-table', imports: [
2556
+ MtDataGridComponent,
2557
+ CdkTrapFocus,
2558
+ FormsModule,
2559
+ Button,
2560
+ TextField,
2561
+ Menu,
2562
+ Popover,
2563
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
2564
+ '[attr.dir]': 'direction()',
2565
+ '[class.mt-data-table-focused]': 'focused()',
2566
+ '[style.min-height.px]': 'focused() ? normalHeight() : null',
2567
+ '(keydown.escape)': 'escape($event)',
2568
+ }, template: "<section\r\n class=\"mt-data-table-surface\"\r\n [attr.role]=\"focused() ? 'dialog' : null\"\r\n [attr.aria-modal]=\"focused() ? true : null\"\r\n [attr.aria-label]=\"title()\"\r\n [cdkTrapFocus]=\"focused()\"\r\n [cdkTrapFocusAutoCapture]=\"focused()\"\r\n>\r\n @if (profile() !== \"embedded\" || focused()) {\r\n <div class=\"mt-data-table-toolbar\">\r\n @if (showHeading() && title()) {\r\n <div class=\"mt-data-table-heading\">\r\n <strong>{{ title() }}</strong\r\n ><span>{{ count() }} {{ text.text(\"rows\") }}</span>\r\n </div>\r\n }\r\n <label class=\"mt-data-table-search\">\r\n <span class=\"mt-data-table-sr-only\">{{ text.text(\"search\") }}</span>\r\n <mt-text-field\r\n icon=\"general.search-md\"\r\n [placeholder]=\"text.text('search')\"\r\n [ngModel]=\"search()\"\r\n [readonly]=\"source()?.capabilities?.filter === false\"\r\n (ngModelChange)=\"setSearch($event)\"\r\n />\r\n </label>\r\n <div\r\n class=\"mt-data-table-tools\"\r\n role=\"group\"\r\n [attr.aria-label]=\"text.text('actions')\"\r\n >\r\n <mt-button\r\n [label]=\"text.text('columns')\"\r\n icon=\"layout.columns-03\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (click)=\"columnsPopup.toggle($event)\"\r\n />\r\n <p-popover #columnsPopup appendTo=\"body\">\r\n <div\r\n class=\"mt-data-table-menu-content\"\r\n role=\"group\"\r\n [attr.aria-label]=\"text.text('columns')\"\r\n >\r\n @for (column of columnChoices(); track column.id) {\r\n <label\r\n ><input\r\n type=\"checkbox\"\r\n [checked]=\"column.visible\"\r\n [disabled]=\"column.locked\"\r\n (change)=\"\r\n changeColumn(column.id, $any($event.target).checked)\r\n \"\r\n />{{ column.label }}</label\r\n >\r\n }\r\n <mt-button\r\n [label]=\"text.text('reset')\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n (click)=\"resetView()\"\r\n />\r\n </div>\r\n </p-popover>\r\n @if (groupable() && complete()) {\r\n <mt-button\r\n [label]=\"text.text('groupBy')\"\r\n icon=\"layout.columns-03\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (click)=\"groupMenu.toggle($event)\"\r\n />\r\n <mt-menu\r\n #groupMenu\r\n [model]=\"groupingItems()\"\r\n [ariaLabel]=\"text.text('groupBy')\"\r\n />\r\n }\r\n @if (analysisEnabled()) {\r\n <mt-button\r\n [label]=\"text.text('analysis')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (click)=\"openAnalysis()\"\r\n />\r\n <mt-button\r\n [label]=\"text.text('chart')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [disabled]=\"!chartsEnabled()\"\r\n (click)=\"chartTable()\"\r\n />\r\n }\r\n @if (exportFormats().length && exportAllowed()) {\r\n <mt-button\r\n [label]=\"text.text('export')\"\r\n icon=\"general.download-01\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [loading]=\"exporting()\"\r\n (click)=\"exportMenu.toggle($event)\"\r\n />\r\n <mt-menu\r\n #exportMenu\r\n [model]=\"exportItems()\"\r\n [ariaLabel]=\"text.text('export')\"\r\n />\r\n }\r\n @if (profile() === \"studio\") {\r\n <mt-button\r\n [label]=\"text.text('closeFocus')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [hidden]=\"!focused()\"\r\n (click)=\"closeFocus()\"\r\n />\r\n <mt-button\r\n [label]=\"text.text('focus')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [hidden]=\"focused()\"\r\n (click)=\"focus($event)\"\r\n />\r\n }\r\n <ng-content select=\"[tableActions]\" />\r\n </div>\r\n </div>\r\n }\r\n @if (error() || exportFailed()) {\r\n <div class=\"mt-data-table-error\" role=\"alert\">\r\n {{ text.text(error() ? \"failed\" : \"exportFailed\") }}\r\n @if (error()) {\r\n <mt-button\r\n [label]=\"text.text('retry')\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n (click)=\"retry()\"\r\n />\r\n }\r\n </div>\r\n }\r\n @if (profile() === \"studio\" && !complete()) {\r\n <p class=\"mt-data-table-hint\">{{ text.text(\"incomplete\") }}</p>\r\n }\r\n <div class=\"mt-data-table-body\">\r\n <mt-data-grid\r\n [rowData]=\"displayedRows()\"\r\n [columnDefs]=\"resolvedColumns()\"\r\n [getRowId]=\"getRowId()\"\r\n [height]=\"focused() ? focusHeight() : height()\"\r\n [rowHeight]=\"rowHeight()\"\r\n [direction]=\"direction()\"\r\n [localeText]=\"text.gridLocale()\"\r\n [ariaLabel]=\"title()\"\r\n [loading]=\"busy()\"\r\n [loadingText]=\"text.text('loading')\"\r\n [noRowsText]=\"text.text('noRows')\"\r\n [dataProcessing]=\"complete() ? 'client' : 'external'\"\r\n [quickFilterText]=\"source()?.processing === 'server' ? '' : search()\"\r\n [rowSelection]=\"selection()\"\r\n [cellSelection]=\"profile() === 'studio'\"\r\n [suppressCutToClipboard]=\"true\"\r\n [getContextMenuItems]=\"contextMenu\"\r\n [sideBar]=\"sideBar()\"\r\n [rowGroupPanelShow]=\"analysisEnabled() ? 'onlyWhenGrouping' : 'never'\"\r\n [pivotPanelShow]=\"analysisEnabled() ? 'onlyWhenPivoting' : 'never'\"\r\n [enableCharts]=\"chartsEnabled()\"\r\n [masterDetail]=\"masterDetail()\"\r\n [detailCellRenderer]=\"detailRenderer()\"\r\n [detailCellRendererParams]=\"detailRendererParams()\"\r\n [isRowMaster]=\"isRowMaster()\"\r\n [detailRowAutoHeight]=\"detailAutoHeight()\"\r\n [detailRowHeight]=\"detailHeight()\"\r\n [pagination]=\"clientPaging()\"\r\n [paginationPageSize]=\"100\"\r\n [suppressPdfExport]=\"true\"\r\n [suppressCsvExport]=\"!complete() || !!exporter()\"\r\n [suppressExcelExport]=\"!complete() || !!exporter()\"\r\n (sortChanged)=\"sorted($event)\"\r\n (filterChanged)=\"filtered()\"\r\n (rowClicked)=\"$event.node.data && rowClick.emit($event.node.data)\"\r\n (selectionChanged)=\"selected()\"\r\n (columnVisible)=\"columnsVisible($event.columns)\"\r\n (columnRowGroupChanged)=\"analysisFieldsChanged()\"\r\n (columnValueChanged)=\"analysisFieldsChanged()\"\r\n (columnPivotChanged)=\"analysisFieldsChanged()\"\r\n />\r\n <div\r\n #chartDock\r\n class=\"mt-data-table-chart-dock\"\r\n [class.mt-data-table-chart-open]=\"chartOpen() && chartsEnabled()\"\r\n ></div>\r\n </div>\r\n @if (pagingInfo(); as paging) {\r\n <div class=\"mt-data-table-pagination\">\r\n @if (complete()) {\r\n <label\r\n >{{ text.text(\"pageSize\") }}\r\n <select\r\n [value]=\"paging.size\"\r\n (change)=\"pageSize(+$any($event.target).value)\"\r\n >\r\n @for (size of [20, 50, 100]; track size) {\r\n <option [value]=\"size\">{{ number(size) }}</option>\r\n }\r\n </select></label\r\n >\r\n }\r\n <mt-button\r\n [label]=\"text.text('previous')\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n [disabled]=\"busy() || paging.page === 0\"\r\n (click)=\"page(-1)\"\r\n />\r\n <bdi\r\n >{{ number(paging.first) }}\u2013{{ number(paging.last) }} /\r\n {{ number(paging.total) }}</bdi\r\n >\r\n <label\r\n >{{ text.text(\"page\") }}\r\n <input\r\n type=\"number\"\r\n min=\"1\"\r\n [max]=\"paging.pages\"\r\n [value]=\"paging.page + 1\"\r\n [disabled]=\"busy()\"\r\n (change)=\"pageNumber(+$any($event.target).value)\"\r\n /></label>\r\n <mt-button\r\n class=\"mt-data-table-next\"\r\n [label]=\"text.text('next')\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n [disabled]=\"busy() || paging.page + 1 >= paging.pages\"\r\n (click)=\"page(1)\"\r\n />\r\n </div>\r\n }\r\n</section>\r\n", styles: [":host{display:block;min-width:0;color:var(--p-text-color, #25354a);font:inherit}.mt-data-table-surface{min-width:0;background:var(--p-content-background, #fff);border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:var(--p-content-border-radius, 10px);overflow:hidden}.mt-data-table-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:16px;min-height:68px;box-sizing:border-box;border-bottom:1px solid var(--p-content-border-color, #e4e7ec)}.mt-data-table-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-inline-start:auto}.mt-data-table-search{display:block;flex:1 1 200px;max-width:300px;min-width:160px}.mt-data-table-search mt-text-field{min-width:0}:host ::ng-deep mt-data-grid{padding:0;border:0;border-radius:0}.mt-data-table-heading{display:flex;align-items:baseline;gap:8px;margin-inline-end:auto}.mt-data-table-heading span,.mt-data-table-hint{color:var(--p-text-muted-color, #667085);font-size:12px}.mt-data-table-search input,button,summary{min-height:34px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;background:var(--p-content-background, #fff);color:inherit;font:inherit;padding:6px 10px}button,summary{cursor:pointer;list-style:none;font-size:13px}button:hover,summary:hover{background:var(--p-content-hover-background, #f3f6f8)}button:disabled{opacity:.5;cursor:default}input:focus-visible,button:focus-visible,summary:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}.mt-data-table-menu{position:relative}.mt-data-table-menu-content{display:flex;flex-direction:column;min-width:210px;max-height:320px;overflow:auto;padding:2px}.mt-data-table-menu-content label{display:flex;align-items:center;gap:8px;padding:6px;font-size:13px}.mt-data-table-menu-content button{border:0;text-align:start}.mt-data-table-hint,.mt-data-table-error{margin:0;padding:8px 12px}.mt-data-table-error{display:flex;align-items:center;justify-content:space-between;color:var(--p-red-600, #b42318)}.mt-data-table-body{min-width:0}.mt-data-table-chart-dock{display:none;min-height:300px}.mt-data-table-chart-open{display:block}.mt-data-table-pagination{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:16px;padding:10px 12px;font-size:13px;border-top:1px solid var(--p-content-border-color, #e4e7ec)}.mt-data-table-pagination label{display:flex;align-items:center;gap:6px}.mt-data-table-pagination input{width:4.5em}.mt-data-table-pagination input,.mt-data-table-pagination select{box-sizing:border-box;padding:6px;min-height:34px;border:1px solid var(--p-content-border-color, #ddd);border-radius:6px;background:var(--p-content-background, white);color:inherit;font:inherit}:host ::ng-deep mt-data-grid>.mt-grid-main>mt-grid-pager{display:none}.mt-data-table-sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host.mt-data-table-focused>.mt-data-table-surface{position:fixed;inset:var(--mt-data-table-focus-inset, 16px);z-index:var(--mt-data-table-focus-z-index, 1000);overflow:auto;box-shadow:0 12px 60px #0005;border-radius:var(--p-content-border-radius, 6px);display:flex;flex-direction:column}:host.mt-data-table-focused .mt-data-table-body{display:flex;flex-direction:column;flex:1;min-height:120px;overflow:auto}:host.mt-data-table-focused .mt-data-table-chart-open{height:max(300px,45%);flex:0 0 max(300px,45%);overflow:auto}:host.mt-data-table-focused .mt-data-table-toolbar,:host.mt-data-table-focused .mt-data-table-pagination{flex-shrink:0}@media(max-width:640px){.mt-data-table-menu-content{min-width:0;max-width:calc(100vw - 64px);max-height:60dvh}.mt-data-table-search{width:100%;max-width:none;flex-basis:100%}.mt-data-table-search input{box-sizing:border-box;width:100%}:host.mt-data-table-focused>.mt-data-table-surface{inset:4px}}\n"] }]
2569
+ }], ctorParameters: () => [], propDecorators: { rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], getRowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "getRowId", required: true }] }], source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: false }] }], profile: [{ type: i0.Input, args: [{ isSignal: true, alias: "profile", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], showHeading: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHeading", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], rowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHeight", required: false }] }], fitColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitColumns", required: false }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], masterDetail: [{ type: i0.Input, args: [{ isSignal: true, alias: "masterDetail", required: false }] }], detailRenderer: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailRenderer", required: false }] }], detailRendererParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailRendererParams", required: false }] }], isRowMaster: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRowMaster", required: false }] }], detailAutoHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailAutoHeight", required: false }] }], detailHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailHeight", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], groupable: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupable", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], viewIdentity: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewIdentity", required: false }] }], exporter: [{ type: i0.Input, args: [{ isSignal: true, alias: "exporter", required: false }] }], exportFormats: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFormats", required: false }] }], columnLoadRequested: [{ type: i0.Output, args: ["columnLoadRequested"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], focusChange: [{ type: i0.Output, args: ["focusChange"] }], viewStateChange: [{ type: i0.Output, args: ["viewStateChange"] }], grid: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MtDataGridComponent), { isSignal: true }] }], chartDock: [{ type: i0.ViewChild, args: ['chartDock', { isSignal: true }] }] } });
2570
+
2571
+ /** Transitional orchestration for existing portal/Studio consumers. New grids use the primary entity API. */
2572
+
2573
+ /**
2574
+ * Generated bundle index. Do not edit.
2575
+ */
2576
+
2577
+ export { MT_DATA_TABLE_CONFIGURATION, MtDataTableComponent, MtDatasetCache, MtDatasetScheduler, MtIncompleteTableError, MtTableCompatibilityRenderer, MtTablePreferences, MtTableTemplateCell, MtTableTemplateHeader, MtTableText, captureMtTableChart, loadMtTableResult, mtClientTableSource, mtTablePreferenceKey, mtTablePrintConfiguration, parseMtTableCharts, provideMTDataTables, provideMTTableRenderer, reconcileMtTableView, restoreMtTableChart };
2578
+ //# sourceMappingURL=masterteam-data-table-legacy.mjs.map