@masterteam/work-center 0.0.99 → 0.0.101

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.
@@ -1,7 +1,7 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule, NgComponentOutlet } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, viewChild, input, computed, signal, Component, Injectable, DestroyRef, effect, untracked, InjectionToken, linkedSignal, Injector, output, runInInjectionContext } from '@angular/core';
4
+ import { inject, viewChild, input, computed, signal, Component, ChangeDetectionStrategy, output, effect, untracked, Injectable, DestroyRef, InjectionToken, linkedSignal, Injector, runInInjectionContext } from '@angular/core';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
6
  import { TranslocoService, TranslocoDirective } from '@jsverse/transloco';
7
7
  import { Button } from '@masterteam/components/button';
@@ -9,21 +9,24 @@ import { ClientPage } from '@masterteam/components/client-page';
9
9
  import { ModalService } from '@masterteam/components/modal';
10
10
  import { PropertyFilterBuilder } from '@masterteam/components/property-filter-builder';
11
11
  import { StatisticCard } from '@masterteam/components/statistic-card';
12
- import { Table } from '@masterteam/components/table';
13
12
  import * as i1$1 from 'primeng/skeleton';
14
13
  import { SkeletonModule } from 'primeng/skeleton';
15
- import { catchError, EMPTY, map, take, firstValueFrom, of, isObservable } from 'rxjs';
14
+ import { take, firstValueFrom, catchError, of, isObservable, map } from 'rxjs';
16
15
  import { ModalRef } from '@masterteam/components/dialog';
17
16
  import { DrawerController } from '@masterteam/components/dynamic-drawer';
18
17
  import { ClientForm, ClientFormWarningsDialog } from '@masterteam/forms/client-form';
18
+ import { EntityPreview, EntitiesPreview, EntityPreviewBody } from '@masterteam/components/entities';
19
+ import { TableValueResolver } from '@masterteam/components/table';
20
+ import { captureGridViewState } from '@masterteam/data-grid';
21
+ import { mtEntityCellValues, mtEntityColumn, MtStandardGridComponent } from '@masterteam/data-table';
22
+ import { MtTablePreferences } from '@masterteam/data-table/legacy';
19
23
  import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http';
20
24
  import { Router, ActivatedRoute } from '@angular/router';
21
25
  import { Drawer } from '@masterteam/components/drawer';
22
26
  import { RuntimeActionContextStore, RuntimeActionRunner, RUNTIME_ACTION_CONFIRM_DIALOG, hasActionFormFields, buildActionPayload, resolveActionLabel, hasActionInputFields } from '@masterteam/components/runtime-action';
23
- import { Action, Selector, State, Store, select } from '@ngxs/store';
24
- import { handleApiRequest } from '@masterteam/components';
27
+ import { WorkCenterFacade, decodeWorkCenterRouteContextKey, WORK_CENTER_LEVEL_NAME_KEY } from '@masterteam/work-center/state';
28
+ export * from '@masterteam/work-center/state';
25
29
  import { ClientInstancePreview } from '@masterteam/client-components/client-instance-preview';
26
- import { EntitiesPreview, EntityPreviewBody } from '@masterteam/components/entities';
27
30
  import { Tabs } from '@masterteam/components/tabs';
28
31
  import { StructureBuilder } from '@masterteam/structure-builder';
29
32
  import { ToastService } from '@masterteam/components/toast';
@@ -121,1225 +124,333 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
121
124
  args: [{ selector: 'mt-work-center-client-form-modal', standalone: true, imports: [Button, TranslocoDirective, ClientForm], template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\r\n <div [class]=\"modal.contentClass + ' p-5 flex flex-col gap-4'\">\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [operationKey]=\"operationKey()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [recordId]=\"recordId()\"\r\n [formMode]=\"formMode()\"\r\n [autoLoad]=\"true\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"lookups()\"\r\n [submitRequestMapper]=\"submitRequestMapper\"\r\n (submitted)=\"onSubmitted($event)\"\r\n (errored)=\"onErrored($event)\"\r\n />\r\n\r\n @if (isSubmitting()) {\r\n <div class=\"text-sm text-muted-color\">{{ t(\"modal.submitting\") }}</div>\r\n }\r\n\r\n @if (validationMessage()) {\r\n <div\r\n class=\"mt-2 rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-700\"\r\n role=\"alert\"\r\n >\r\n {{ validationMessage() }}\r\n </div>\r\n }\r\n\r\n @if (submitError()) {\r\n <div\r\n class=\"mt-2 rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\r\n role=\"alert\"\r\n >\r\n {{ submitError() }}\r\n </div>\r\n }\r\n\r\n @if (submitStatus(); as status) {\r\n <div\r\n class=\"mt-2 rounded-lg border p-3 text-sm\"\r\n [class]=\"\r\n status === 'pending'\r\n ? 'border-amber-200 bg-amber-50 text-amber-700'\r\n : 'border-emerald-200 bg-emerald-50 text-emerald-700'\r\n \"\r\n >\r\n @if (status === \"pending\") {\r\n {{ t(\"modal.requestSubmitted\") }}\r\n } @else {\r\n {{ t(\"modal.operationExecuted\") }}\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div [class]=\"modal.footerClass\">\r\n <mt-button\r\n [label]=\"t('modal.cancel')\"\r\n variant=\"outlined\"\r\n [disabled]=\"isSubmitting()\"\r\n (onClick)=\"ref.close(false)\"\r\n />\r\n <mt-button\r\n [label]=\"t('modal.submit')\"\r\n icon=\"general.check\"\r\n [disabled]=\"\r\n isSubmitting() || processForm().hasBlockingGovernanceFailure()\r\n \"\r\n (onClick)=\"onSubmit()\"\r\n />\r\n </div>\r\n</ng-container>\r\n" }]
122
125
  }], propDecorators: { processForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ClientForm), { isSignal: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], operationKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "operationKey", required: false }] }], closeOnPendingApproval: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnPendingApproval", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], submitPayloadTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitPayloadTemplate", required: false }] }] } });
123
126
 
124
- class EnterArea {
125
- area;
126
- static type = '[WorkCenter] Enter Area';
127
- constructor(area) {
128
- this.area = area;
129
- }
130
- }
131
- class HydrateFromContext {
132
- area;
133
- patch;
134
- static type = '[WorkCenter] Hydrate From Context';
135
- constructor(area, patch) {
136
- this.area = area;
137
- this.patch = patch;
138
- }
139
- }
140
- class SetParams {
141
- area;
142
- inputs;
143
- static type = '[WorkCenter] Set Params';
144
- constructor(area, inputs) {
145
- this.area = area;
146
- this.inputs = inputs;
147
- }
148
- }
149
- class SetLookups {
150
- lookups;
151
- static type = '[WorkCenter] Set Lookups';
152
- constructor(lookups) {
153
- this.lookups = lookups;
154
- }
155
- }
156
- class LoadRuntime {
157
- area;
158
- reason;
159
- static type = '[WorkCenter] Load Runtime';
160
- constructor(area, reason = 'manual') {
161
- this.area = area;
162
- this.reason = reason;
163
- }
164
- }
165
- /**
166
- * Replaces the header filter slice (rules from
167
- * `mt-property-filter-builder`). Resets `page` to 1 and triggers a
168
- * BE reload with the merged `headerFilters` + `columnFilters` payload.
169
- */
170
- class ApplyHeaderFilters {
171
- area;
172
- filters;
173
- static type = '[WorkCenter] Apply Header Filters';
174
- constructor(area, filters) {
175
- this.area = area;
176
- this.filters = filters;
177
- }
178
- }
179
- /**
180
- * Replaces the in-table column filter slice (rules translated from the
181
- * `mt-table` filters map). Resets `page` to 1 and triggers a BE reload
182
- * with the merged `headerFilters` + `columnFilters` payload.
183
- */
184
- class ApplyColumnFilters {
185
- area;
186
- filters;
187
- static type = '[WorkCenter] Apply Column Filters';
188
- constructor(area, filters) {
189
- this.area = area;
190
- this.filters = filters;
191
- }
192
- }
193
- /**
194
- * Switches the selected card and drops everything that was scoped to the
195
- * previous one: advanced filters, in-table column filters, grouping and the
196
- * sort that grouping implied. Each card brings its own columns and filter
197
- * schema, so carrying those over would filter on fields the new card doesn't
198
- * have and group by a column it doesn't show.
199
- */
200
- class SelectCard {
201
- area;
202
- selectedCardKey;
203
- static type = '[WorkCenter] Select Card';
204
- constructor(area, selectedCardKey) {
205
- this.area = area;
206
- this.selectedCardKey = selectedCardKey;
207
- }
208
- }
209
- /**
210
- * Sets the grouped column. Grouping is expressed to the backend as a single
211
- * sort on the same field, so this also rewrites `context.sort` and resets
212
- * `page` to 1 before reloading. `groupBy: null` clears both.
213
- */
214
- class SetGroupBy {
215
- area;
216
- groupBy;
217
- dir;
218
- static type = '[WorkCenter] Set Group By';
219
- constructor(area, groupBy, dir = 'asc') {
220
- this.area = area;
221
- this.groupBy = groupBy;
222
- this.dir = dir;
223
- }
224
- }
225
- /**
226
- * Clears both the header filter slice and the column filter slice in one
227
- * state update, triggering a single BE reload.
228
- */
229
- class ClearAllFilters {
230
- area;
231
- static type = '[WorkCenter] Clear All Filters';
232
- constructor(area) {
233
- this.area = area;
234
- }
235
- }
236
-
237
- var WorkCenterActionKey;
238
- (function (WorkCenterActionKey) {
239
- WorkCenterActionKey["LoadRuntime"] = "loadRuntime";
240
- })(WorkCenterActionKey || (WorkCenterActionKey = {}));
241
- const WORK_CENTER_QUERY_VERSION = 1;
242
- const WORK_CENTER_MAX_PAGE_SIZE = 100;
243
- const WORK_CENTER_MAX_FILTERS = 20;
244
- const WORK_CENTER_MAX_SORT = 5;
245
- /**
246
- * Backend column key carrying the row's LevelData display label
247
- * (`extra.levelDataName`). Grouping by it maps to a single backend sort on the
248
- * same key — see `WORK_CENTER_LEVEL_GROUP_FIELD` for the grouping identity.
249
- */
250
- const WORK_CENTER_LEVEL_NAME_KEY = 'levelDataName';
251
- /**
252
- * Synthetic per-row field holding the *identity* behind the Level Name column.
253
- * The visible label is ambiguous (two LevelData records may share a name), so
254
- * rows are bucketed by `context.levelDataId` instead — except rows with no
255
- * visible label, which get an empty identity so they all collapse into the one
256
- * shared "—" group the backend contract requires.
257
- */
258
- const WORK_CENTER_LEVEL_GROUP_FIELD = '__mtLevelGroup';
259
- /** Rendered in place of a missing / restricted LevelData label. */
260
- const WORK_CENTER_EMPTY_LABEL = '—';
261
- /**
262
- * Bootstrap `group` value meaning "the user turned grouping off". Needed
263
- * because an absent `group` means "not chosen yet" and falls back to the
264
- * default grouping — without a distinct value, clearing the group would be
265
- * undone by the next navigation.
266
- */
267
- const WORK_CENTER_GROUP_NONE = 'none';
268
-
269
- const AREA_COLORS = ['violet', 'blue', 'emerald', 'amber', 'teal'];
270
- /** Fallback accent rotation used only when the backend sends no stat color. */
271
- const KPI_COLORS = ['violet', 'blue', 'emerald', 'amber', 'teal'];
272
- /**
273
- * Default page size when bootstrapping a work-center area. Matches the table
274
- * paginator default so the first BE request asks for exactly one rendered
275
- * page.
276
- */
277
- const WORK_CENTER_DEFAULT_PAGE_SIZE = 20;
278
- const WORK_CENTER_LOCAL_FETCH_SIZE = WORK_CENTER_DEFAULT_PAGE_SIZE;
279
- const FILTER_OPERATORS = new Set([
280
- 'Eq',
281
- 'Neq',
282
- 'In',
283
- 'Contains',
284
- 'StartsWith',
285
- 'Gt',
286
- 'Gte',
287
- 'Lt',
288
- 'Lte',
289
- 'Between',
290
- 'IsNull',
291
- 'IsNotNull',
292
- ]);
293
- function clampPage(value, fallback = 1) {
294
- if (!Number.isFinite(value))
295
- return fallback;
296
- return Math.max(1, Math.floor(value));
297
- }
298
- function clampPageSize(value, fallback = WORK_CENTER_LOCAL_FETCH_SIZE) {
299
- if (!Number.isFinite(value))
300
- return fallback;
301
- const parsed = Math.floor(value);
302
- return Math.min(WORK_CENTER_MAX_PAGE_SIZE, Math.max(1, parsed));
303
- }
304
- function sanitizeSort(rules) {
305
- if (!Array.isArray(rules))
306
- return [];
307
- return rules
308
- .filter((rule) => typeof rule?.field === 'string' &&
309
- rule.field.length > 0 &&
310
- (rule.dir === 'asc' || rule.dir === 'desc'))
311
- .slice(0, WORK_CENTER_MAX_SORT);
312
- }
313
- function sanitizeFilters(filters) {
314
- if (!Array.isArray(filters))
315
- return [];
316
- return filters
317
- .filter((filter) => typeof filter?.field === 'string' &&
318
- filter.field.length > 0 &&
319
- typeof filter?.op === 'string' &&
320
- FILTER_OPERATORS.has(filter.op))
321
- .slice(0, WORK_CENTER_MAX_FILTERS);
322
- }
323
- function parseJson(value) {
324
- if (typeof value !== 'string')
325
- return value;
326
- if (!value.trim())
327
- return null;
328
- try {
329
- return JSON.parse(value);
330
- }
331
- catch {
332
- return null;
333
- }
334
- }
335
- function toOptionalInt(value) {
336
- if (value === null || value === undefined || value === '')
337
- return null;
338
- const parsed = Number(value);
339
- return Number.isFinite(parsed) ? Math.floor(parsed) : null;
340
- }
341
- function toSelectedCardKey(value) {
342
- if (typeof value !== 'string')
343
- return null;
344
- const parsed = value.trim();
345
- return parsed.length ? parsed : null;
346
- }
347
- function parseSortInput(value) {
348
- const parsed = parseJson(value);
349
- return Array.isArray(parsed)
350
- ? sanitizeSort(parsed)
351
- : [];
352
- }
353
- /**
354
- * Resolves the grouped column key from bootstrap inputs.
355
- *
356
- * A missing `group` keeps whatever state already has, so an unrelated
357
- * navigation doesn't drop the user's grouping. `WORK_CENTER_GROUP_NONE` is the
358
- * only way to express "turn it off" — a bare `null` can't, because it is also
359
- * what a host passes for an absent query param.
360
- */
361
- function resolveGroupByFromInputs(current, group) {
362
- if (!hasParamValue(group) || typeof group !== 'string') {
363
- return current;
364
- }
365
- const parsed = group.trim();
366
- if (!parsed || parsed === WORK_CENTER_GROUP_NONE) {
367
- return null;
368
- }
369
- return parsed;
370
- }
371
- /**
372
- * The card these inputs resolve to — the same rule `buildContextFromInputs`
373
- * applies, exposed so callers can detect a card switch before building the
374
- * context (what survives the switch depends on it).
375
- */
376
- function resolveSelectedCardKeyFromInputs(currentContext, inputs = {}) {
377
- return toSelectedCardKey(inputs.card) ?? currentContext.selectedCardKey;
378
- }
379
- function parseFiltersInput(value) {
380
- const parsed = parseJson(value);
381
- return Array.isArray(parsed)
382
- ? sanitizeFilters(parsed)
383
- : [];
384
- }
385
- function hasParamValue(value) {
386
- return value !== null && value !== undefined && value !== '';
387
- }
388
- function toLabel$1(value) {
389
- const segment = value.split('.').pop() ?? value;
390
- return segment
391
- .replace(/[_-]/g, ' ')
392
- .replace(/([a-z])([A-Z])/g, '$1 $2')
393
- .replace(/\s+/g, ' ')
394
- .trim()
395
- .replace(/\b\w/g, (char) => char.toUpperCase());
396
- }
397
- function toViewType(viewType, key) {
398
- if (viewType?.trim()) {
399
- return viewType;
400
- }
401
- return key.toLowerCase().includes('date') ? 'Date' : 'Text';
402
- }
403
- function normalizeColumnKey(key) {
404
- return key
405
- .trim()
406
- .toLowerCase()
407
- .replace(/[\s._-]+/g, '');
408
- }
409
- function resolveColumnWeight(key) {
410
- const normalizedKey = normalizeColumnKey(key);
411
- if (normalizedKey.includes('title'))
412
- return 26;
413
- if (normalizedKey.includes('subtitle') ||
414
- normalizedKey.includes('description')) {
415
- return 20;
416
- }
417
- if (normalizedKey.includes('status'))
418
- return 14;
419
- if (normalizedKey.includes('progress'))
420
- return 17;
421
- if (normalizedKey.includes('createdby') ||
422
- normalizedKey.includes('assignedto') ||
423
- normalizedKey.includes('owner') ||
424
- normalizedKey.includes('user')) {
425
- return 20;
426
- }
427
- if (normalizedKey.includes('duedate') ||
428
- normalizedKey.includes('createdat') ||
429
- normalizedKey.includes('updatedat') ||
430
- normalizedKey.endsWith('date')) {
431
- return 15;
432
- }
433
- if (normalizedKey.includes('priority'))
434
- return 12;
435
- return 16;
436
- }
437
- function applySmartColumnWidths(columns) {
438
- const dynamicWeightTotal = columns.reduce((total, column) => {
439
- return column.width?.trim()
440
- ? total
441
- : total + resolveColumnWeight(column.key);
442
- }, 0);
443
- if (!dynamicWeightTotal) {
444
- return columns;
445
- }
446
- return columns.map((column) => {
447
- if (column.width?.trim()) {
448
- return column;
449
- }
450
- const width = ((resolveColumnWeight(column.key) / dynamicWeightTotal) *
451
- 100).toFixed(2);
452
- return {
453
- ...column,
454
- width: `${width}%`,
455
- };
456
- });
457
- }
458
- function getValue(record, key) {
459
- return key.split('.').reduce((current, part) => {
460
- if (!current || typeof current !== 'object') {
461
- return undefined;
462
- }
463
- return current[part];
464
- }, record);
465
- }
466
- function flattenRuntimeRow(row) {
467
- const extra = row['extra'];
468
- if (!extra || typeof extra !== 'object' || Array.isArray(extra)) {
469
- return row;
470
- }
471
- return {
472
- ...extra,
473
- ...row,
474
- };
475
- }
476
- function toDisplayValue(value, column) {
477
- if (column.viewType !== 'Text') {
478
- return value;
479
- }
480
- if (!value || typeof value !== 'object') {
481
- return value;
482
- }
483
- const display = value['display'];
484
- return typeof display === 'string' ? display : value;
485
- }
486
- function buildColumnsFromProperties(properties) {
487
- return properties
488
- .filter((property) => typeof property?.key === 'string' && property.key.length > 0)
489
- .map((property) => ({
490
- ...property,
491
- key: property.key,
492
- label: property.name?.display ||
493
- property.name?.en ||
494
- property.name?.ar ||
495
- toLabel$1(property.key),
496
- type: 'entity',
497
- viewType: toViewType(property.viewType, property.key),
498
- ...withLevelNameGrouping(property.key),
499
- }));
500
- }
501
- /**
502
- * Level Name is a free-text column, so the table's cardinality heuristic would
503
- * never offer it in the group picker. The backend orders the whole result set
504
- * by that label before paging, which makes its groups contiguous and therefore
505
- * groupable — so opt it in explicitly and point the table at the identity
506
- * field instead of the ambiguous label.
507
- */
508
- function withLevelNameGrouping(key) {
509
- return key === WORK_CENTER_LEVEL_NAME_KEY
510
- ? { groupable: true, groupKey: WORK_CENTER_LEVEL_GROUP_FIELD }
511
- : {};
512
- }
513
- function buildColumns(columnsConfig) {
514
- const propertyColumns = buildColumnsFromProperties(columnsConfig?.properties ?? []);
515
- if (propertyColumns.length) {
516
- return applySmartColumnWidths(propertyColumns);
517
- }
518
- const keys = columnsConfig?.columns?.length ? columnsConfig.columns : [];
519
- return applySmartColumnWidths(keys.map((key) => ({
520
- key,
521
- label: toLabel$1(key),
522
- type: 'entity',
523
- viewType: toViewType(undefined, key),
524
- ...withLevelNameGrouping(key),
525
- })));
526
- }
527
- function toDisplayRows(rows, columns) {
528
- const hasLevelName = columns.some((column) => column.key === WORK_CENTER_LEVEL_NAME_KEY);
529
- return rows.map((row) => {
530
- const sourceRow = flattenRuntimeRow(row);
531
- const displayRow = { ...sourceRow };
532
- for (const column of columns) {
533
- const value = getValue(sourceRow, column.key);
534
- displayRow[column.key] = {
535
- ...column,
536
- value: toDisplayValue(value, column),
537
- };
538
- }
539
- if (hasLevelName) {
540
- applyLevelNameGrouping(displayRow, sourceRow);
541
- }
542
- return displayRow;
543
- });
544
- }
545
- /**
546
- * Adds the Level Name grouping identity to a display row and normalizes a
547
- * missing / restricted label to `—`.
548
- *
549
- * The backend omits `extra.levelDataName` when the record is missing, deleted,
550
- * or the user can't see it — those rows must share one group and must never
551
- * expose the numeric id as a label. Rows that do have a label are keyed by
552
- * `context.levelDataId` so two records with the same name stay separate.
553
- */
554
- function applyLevelNameGrouping(displayRow, sourceRow) {
555
- const cell = displayRow[WORK_CENTER_LEVEL_NAME_KEY];
556
- const label = typeof cell?.value === 'string' ? cell.value.trim() : '';
557
- if (!label) {
558
- displayRow[WORK_CENTER_LEVEL_NAME_KEY] = {
559
- ...cell,
560
- value: WORK_CENTER_EMPTY_LABEL,
561
- };
562
- displayRow[WORK_CENTER_LEVEL_GROUP_FIELD] = '';
563
- return;
564
- }
565
- const levelDataId = getValue(sourceRow, 'context.levelDataId');
566
- const hasId = levelDataId !== null && levelDataId !== undefined && levelDataId !== '';
567
- displayRow[WORK_CENTER_LEVEL_GROUP_FIELD] = hasId
568
- ? `id:${String(levelDataId)}`
569
- : `name:${label}`;
570
- }
571
- function buildMenuItems(cards) {
572
- const mapped = cards.map((card, index) => ({
573
- key: card.key,
574
- title: card.name?.display || card.name?.en || card.name?.ar || toLabel$1(card.key),
575
- subtitle: undefined,
576
- count: card.count ?? 0,
577
- color: AREA_COLORS[index % AREA_COLORS.length],
578
- icon: card.icon ?? 'custom.task',
579
- isAvailable: card.isAvailable !== false,
580
- }));
581
- const available = mapped.filter((card) => card.isAvailable);
582
- const source = available.length ? available : mapped;
583
- return source.map((card) => ({
584
- key: card.key,
585
- title: card.title,
586
- subtitle: undefined,
587
- count: card.count ?? 0,
588
- color: card.color,
589
- icon: card.icon ?? 'custom.task',
590
- }));
591
- }
592
- /**
593
- * KPI accent colors are owned by the backend (`stats[].color`) and used
594
- * verbatim. Only when the backend sends no color do we fall back to the
595
- * previous `KPI_COLORS` rotation by card position — never map a color from
596
- * the stat key or label.
597
- */
598
- function buildKpis(stats, fallbackIcon) {
599
- return stats.map((stat, index) => ({
600
- title: String(stat.count ?? 0),
601
- subTitle: stat.label.display,
602
- icon: (fallbackIcon ?? 'custom.task'),
603
- color: stat.color?.trim() || KPI_COLORS[index % KPI_COLORS.length],
604
- }));
605
- }
606
- /** The backend sort that renders a grouped column as contiguous rows. */
607
- function sortForGroup(groupBy) {
608
- return groupBy ? [{ field: groupBy, dir: 'asc' }] : [];
609
- }
610
- function createDefaultContext(area) {
611
- return {
612
- area,
613
- templateId: null,
614
- levelDataId: null,
615
- selectedCardKey: null,
616
- page: 1,
617
- pageSize: WORK_CENTER_LOCAL_FETCH_SIZE,
618
- sort: [],
619
- runtimeFilters: [],
620
- includeStats: true,
621
- };
622
- }
623
- function createDefaultAreaState(area) {
624
- return {
625
- context: createDefaultContext(area),
626
- headerFilters: [],
627
- columnFilters: [],
628
- groupBy: null,
629
- menuItems: [],
630
- rows: [],
631
- columns: [],
632
- kpis: [],
633
- runtimeFilterSchema: null,
634
- totalCount: 0,
635
- warnings: [],
636
- lastLoadedAt: null,
637
- };
638
- }
639
- /**
640
- * Combines header (property-filter-builder) and column (in-table) rules into
641
- * the single `runtimeFilters` payload the BE expects. Header rules come
642
- * first; a column rule with the same `(field, op)` pair replaces the matching
643
- * header rule.
644
- */
645
- function mergeRuntimeFilters(headerFilters, columnFilters) {
646
- const seen = new Map();
647
- const ordered = [];
648
- const push = (rule) => {
649
- const key = `${rule.field}::${rule.op}`;
650
- if (!seen.has(key))
651
- ordered.push(key);
652
- seen.set(key, rule);
653
- };
654
- (headerFilters ?? []).forEach(push);
655
- (columnFilters ?? []).forEach(push);
656
- return sanitizeFilters(ordered.map((key) => seen.get(key)));
657
- }
658
- const WORK_CENTER_DEFAULT_STATE = {
659
- activeArea: 'MyInbox',
660
- byArea: {
661
- MyInbox: createDefaultAreaState('MyInbox'),
662
- TasksCenter: createDefaultAreaState('TasksCenter'),
663
- Workspace: createDefaultAreaState('Workspace'),
664
- },
665
- lookups: [],
666
- loadingActive: [],
667
- errors: {},
127
+ const OPERATORS = {
128
+ equals: 'Eq',
129
+ notEqual: 'Neq',
130
+ contains: 'Contains',
131
+ startsWith: 'StartsWith',
132
+ greaterThan: 'Gt',
133
+ greaterThanOrEqual: 'Gte',
134
+ lessThan: 'Lt',
135
+ lessThanOrEqual: 'Lte',
136
+ inRange: 'Between',
137
+ blank: 'IsNull',
138
+ notBlank: 'IsNotNull',
668
139
  };
669
- function normalizeContext(context) {
140
+ function workCenterFilterOptions(schema, type) {
141
+ const allowed = schema
142
+ ? new Set(schema.allowedOperators.map((op) => typeof op === 'string' ? op : op.value))
143
+ : null;
144
+ const options = Object.keys(OPERATORS).filter((key) => (type === 'text'
145
+ ? ![
146
+ 'greaterThan',
147
+ 'greaterThanOrEqual',
148
+ 'lessThan',
149
+ 'lessThanOrEqual',
150
+ 'inRange',
151
+ ].includes(key)
152
+ : !['contains', 'startsWith'].includes(key)) &&
153
+ (!allowed || allowed.has(OPERATORS[key])));
670
154
  return {
671
- ...context,
672
- page: clampPage(context.page, 1),
673
- pageSize: clampPageSize(context.pageSize, WORK_CENTER_LOCAL_FETCH_SIZE),
674
- sort: sanitizeSort(context.sort),
675
- runtimeFilters: sanitizeFilters(context.runtimeFilters),
155
+ maxNumConditions: 1,
156
+ filterOptions: options,
157
+ defaultOption: type === 'text' && options.includes('contains') ? 'contains' : options[0],
158
+ inRangeInclusive: true,
159
+ buttons: ['apply', 'reset'],
160
+ closeOnApply: true,
676
161
  };
677
162
  }
678
- function buildContextFromInputs(currentContext, area, inputs = {},
679
- /**
680
- * Already-resolved grouped column. Grouping is executed as a backend sort,
681
- * so when the host supplies no explicit `sort` the grouped column defines
682
- * it — that is what makes the default grouping reach the very first request
683
- * instead of costing a second round trip.
684
- */
685
- groupBy = null) {
686
- const parsedCardKey = toSelectedCardKey(inputs.card);
687
- const parsedTemplateId = toOptionalInt(inputs.templateId);
688
- const parsedLevelDataId = toOptionalInt(inputs.levelDataId);
689
- const hasPageInput = hasParamValue(inputs.page);
690
- const parsedPage = hasPageInput ? toOptionalInt(inputs.page) : null;
691
- const parsedPageSize = toOptionalInt(inputs.pageSize);
692
- return normalizeContext({
693
- ...currentContext,
694
- area,
695
- selectedCardKey: parsedCardKey ?? currentContext.selectedCardKey,
696
- page: hasPageInput ? (parsedPage ?? 1) : 1,
697
- pageSize: parsedPageSize ?? currentContext.pageSize,
698
- templateId: parsedTemplateId ?? currentContext.templateId,
699
- levelDataId: parsedLevelDataId ?? currentContext.levelDataId,
700
- sort: hasParamValue(inputs.sort)
701
- ? parseSortInput(inputs.sort)
702
- : groupBy
703
- ? sortForGroup(groupBy)
704
- : inputs.sort === null
705
- ? []
706
- : currentContext.sort,
707
- runtimeFilters: hasParamValue(inputs.filters)
708
- ? parseFiltersInput(inputs.filters)
709
- : inputs.filters === null
710
- ? []
711
- : currentContext.runtimeFilters,
712
- });
713
- }
714
- function isSameContext(left, right) {
715
- return (left.area === right.area &&
716
- left.templateId === right.templateId &&
717
- left.levelDataId === right.levelDataId &&
718
- left.selectedCardKey === right.selectedCardKey &&
719
- left.page === right.page &&
720
- left.pageSize === right.pageSize &&
721
- left.includeStats === right.includeStats &&
722
- JSON.stringify(left.sort) === JSON.stringify(right.sort) &&
723
- JSON.stringify(left.runtimeFilters) === JSON.stringify(right.runtimeFilters));
724
- }
725
- function mapRuntimeResponse(current, response) {
726
- const selectedCard = response.selectedCard;
727
- const menuItems = buildMenuItems(response.cards);
728
- const requestedCardKey = selectedCard?.key ?? current.context.selectedCardKey ?? null;
729
- const selectedCardKey = requestedCardKey &&
730
- response.cards.some((card) => card.key === requestedCardKey)
731
- ? requestedCardKey
732
- : (menuItems[0]?.key ?? response.cards[0]?.key ?? null);
733
- const selectedCardFromList = selectedCardKey
734
- ? (response.cards.find((card) => card.key === selectedCardKey) ?? null)
735
- : null;
736
- const selectedMenuItem = menuItems.find((item) => item.key === selectedCardKey);
737
- const columns = buildColumns(selectedCard?.columnsConfig ?? selectedCardFromList?.columnsConfig);
738
- const rows = toDisplayRows(selectedCard?.items ?? [], columns);
739
- const kpis = buildKpis(selectedCard?.stats ?? [], selectedMenuItem?.icon ?? null);
740
- // A card that doesn't advertise the grouped column can't be grouped by it —
741
- // drop it here rather than letting the table discover the stale column and
742
- // bounce a second request. The sort goes with it when it was the one the
743
- // grouping asked for.
744
- const groupBy = current.groupBy && columns.some((column) => column.key === current.groupBy)
745
- ? current.groupBy
163
+ /** Work Center accepts a flat AND of rules, never arbitrary grid OR expressions. */
164
+ function workCenterGridFilters(model, schema) {
165
+ const fields = schema?.properties?.length
166
+ ? schema.properties.map((p) => p.key)
167
+ : schema?.allowedFields;
168
+ const allowed = fields?.length ? new Set(fields) : null;
169
+ const operators = schema
170
+ ? new Set(schema.allowedOperators.map((op) => typeof op === 'string' ? op : op.value))
746
171
  : null;
747
- const droppedGroup = !groupBy && current.groupBy;
748
- const sort = droppedGroup && isSortForGroup(current.context.sort, current.groupBy)
749
- ? []
750
- : current.context.sort;
751
- return {
752
- ...current,
753
- groupBy,
754
- menuItems,
755
- rows,
756
- columns,
757
- kpis,
758
- runtimeFilterSchema: selectedCard?.runtimeFilterSchema ??
759
- selectedCardFromList?.runtimeFilterSchema ??
760
- null,
761
- totalCount: selectedCard?.pagination.totalCount ?? 0,
762
- warnings: response.warnings ?? [],
763
- lastLoadedAt: new Date().toISOString(),
764
- context: {
765
- ...current.context,
766
- selectedCardKey,
767
- sort,
768
- page: selectedCard?.pagination.page ?? current.context.page,
769
- pageSize: selectedCard?.pagination.pageSize ?? current.context.pageSize,
770
- },
771
- };
172
+ return Object.entries(model).flatMap(([field, filter]) => {
173
+ if (allowed && !allowed.has(field))
174
+ return [];
175
+ return toRule(field, filter).filter((rule) => !operators || operators.has(rule.op));
176
+ });
772
177
  }
773
- /** True when `sort` is exactly the single rule a grouping would produce. */
774
- function isSortForGroup(sort, groupBy) {
775
- return !!groupBy && sort.length === 1 && sort[0].field === groupBy;
178
+ function toRule(field, filter) {
179
+ if (filter.filterType === 'multi' || 'conditions' in filter)
180
+ return [];
181
+ if (filter.filterType === 'set')
182
+ return [{ field, op: 'In', values: [...filter.values] }];
183
+ const op = OPERATORS[filter.type];
184
+ if (!op)
185
+ return [];
186
+ if (op === 'IsNull' || op === 'IsNotNull')
187
+ return [{ field, op }];
188
+ const value = filter.filterType === 'date' ? filter.dateFrom : filter.filter;
189
+ const end = filter.filterType === 'date' ? filter.dateTo : filter.filterTo;
190
+ return op === 'Between'
191
+ ? [{ field, op, from: value, to: end }]
192
+ : [{ field, op, value }];
776
193
  }
777
194
 
778
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
779
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
780
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
781
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
782
- return c > 3 && r && Object.defineProperty(target, key, r), r;
783
- };
784
- let WorkCenterState = class WorkCenterState {
785
- http = inject(HttpClient);
786
- static getState(state) {
787
- return state;
788
- }
789
- static activeArea(state) {
790
- return state.activeArea;
791
- }
792
- static activeSnapshot(activeArea, state) {
793
- return state.byArea[activeArea];
794
- }
795
- static context(snapshot) {
796
- return snapshot.context;
797
- }
798
- static menuItems(snapshot) {
799
- return snapshot.menuItems;
800
- }
801
- static rows(snapshot) {
802
- return snapshot.rows;
803
- }
804
- static columns(snapshot) {
805
- return snapshot.columns;
806
- }
807
- static kpis(snapshot) {
808
- return snapshot.kpis;
809
- }
810
- static runtimeFilterSchema(snapshot) {
811
- return snapshot.runtimeFilterSchema;
812
- }
813
- static headerFilters(snapshot) {
814
- return snapshot.headerFilters;
815
- }
816
- static columnFilters(snapshot) {
817
- return snapshot.columnFilters;
818
- }
819
- static groupBy(snapshot) {
820
- return snapshot.groupBy;
821
- }
822
- static totalCount(snapshot) {
823
- return snapshot.totalCount;
824
- }
825
- static warnings(snapshot) {
826
- return snapshot.warnings;
827
- }
828
- static lookups(state) {
829
- return state.lookups;
830
- }
831
- static getLoadingActive(state) {
832
- return state.loadingActive;
833
- }
834
- static getErrors(state) {
835
- return state.errors;
836
- }
837
- enterArea(ctx, action) {
838
- if (ctx.getState().activeArea === action.area)
839
- return;
840
- ctx.patchState({ activeArea: action.area });
841
- }
842
- hydrateFromContext(ctx, action) {
843
- const state = ctx.getState();
844
- const current = state.byArea[action.area];
845
- const nextContext = normalizeContext({
846
- ...current.context,
847
- ...action.patch,
848
- area: action.area,
195
+ class WorkCenterGroupValue {
196
+ params = input.required(...(ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []));
197
+ first = computed(() => this.params().node.allLeafChildren?.[0]?.data, ...(ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []));
198
+ entity = computed(() => {
199
+ const read = this.params().column.cellRendererParams?.['entity'];
200
+ return this.first() ? read(this.first()) : null;
201
+ }, ...(ngDevMode ? [{ debugName: "entity" }] : /* istanbul ignore next */ []));
202
+ count = computed(() => {
203
+ const counts = this.params().column.cellRendererParams?.['counts'];
204
+ const label = this.entity()
205
+ ? mtEntityCellValues(this.entity()).display
206
+ : '';
207
+ return (counts?.get(label) ?? this.params().node.allLeafChildren?.length ?? 0);
208
+ }, ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
209
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterGroupValue, deps: [], target: i0.ɵɵFactoryTarget.Component });
210
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterGroupValue, isStandalone: true, selector: "ng-component", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: true, transformFunction: null } }, host: { styleAttribute: "display:inline-flex;align-items:center;gap:6px" }, ngImport: i0, template: `@if (entity(); as value) {
211
+ <mt-entity-preview [data]="value" />
212
+ }
213
+ <span>({{ count() }})</span>`, isInline: true, dependencies: [{ kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
214
+ }
215
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterGroupValue, decorators: [{
216
+ type: Component,
217
+ args: [{
218
+ imports: [EntityPreview],
219
+ template: `@if (entity(); as value) {
220
+ <mt-entity-preview [data]="value" />
221
+ }
222
+ <span>({{ count() }})</span>`,
223
+ host: { style: 'display:inline-flex;align-items:center;gap:6px' },
224
+ changeDetection: ChangeDetectionStrategy.OnPush,
225
+ }]
226
+ }], propDecorators: { params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: true }] }] } });
227
+ /** Work Center owns its server query; presentation is the one standard grid. */
228
+ class WorkCenterGrid {
229
+ rows = input.required(...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
230
+ columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
231
+ context = input.required(...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
232
+ schema = input(null, ...(ngDevMode ? [{ debugName: "schema" }] : /* istanbul ignore next */ []));
233
+ group = input(null, ...(ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []));
234
+ total = input(0, ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
235
+ loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
236
+ filterRules = input([], ...(ngDevMode ? [{ debugName: "filterRules" }] : /* istanbul ignore next */ []));
237
+ groupCounts = input(null, ...(ngDevMode ? [{ debugName: "groupCounts" }] : /* istanbul ignore next */ []));
238
+ label = input('Work Center', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
239
+ viewKey = input.required(...(ngDevMode ? [{ debugName: "viewKey" }] : /* istanbul ignore next */ []));
240
+ rowClick = output();
241
+ filtersChange = output();
242
+ groupChange = output();
243
+ queryChange = output();
244
+ preferences = inject(MtTablePreferences);
245
+ ready = signal(null, ...(ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []));
246
+ search = signal('', ...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
247
+ serverPage = computed(() => ({
248
+ total: this.total(),
249
+ page: this.context().page - 1,
250
+ pageSize: this.context().pageSize,
251
+ }), ...(ngDevMode ? [{ debugName: "serverPage" }] : /* istanbul ignore next */ []));
252
+ synchronizing = false;
253
+ restored = null;
254
+ identity = computed(() => ({
255
+ level: this.viewKey(),
256
+ role: 'work-center',
257
+ }), ...(ngDevMode ? [{ debugName: "identity" }] : /* istanbul ignore next */ []));
258
+ rowId = (row) => String(row['contextKey'] ?? row['id']);
259
+ visibleRows = computed(() => {
260
+ const words = this.search()
261
+ .trim()
262
+ .toLocaleLowerCase()
263
+ .split(/\s+/)
264
+ .filter(Boolean);
265
+ if (!words.length)
266
+ return this.rows();
267
+ // Retain Work Center's existing lazyLocalSearch contract; server column filters stay separate.
268
+ return this.rows().filter((row) => {
269
+ const value = this.columns()
270
+ .map((col) => mtEntityCellValues(this.entity(row, col)).display)
271
+ .join(' ')
272
+ .toLocaleLowerCase();
273
+ return words.every((word) => value.includes(word));
849
274
  });
850
- if (state.activeArea === action.area &&
851
- isSameContext(current.context, nextContext)) {
852
- return;
853
- }
854
- // External `runtimeFilters` writes are treated as header-slice writes so
855
- // the in-table column filter slice doesn't get stranded out of sync.
856
- const filtersChanged = action.patch.runtimeFilters !== undefined;
857
- const nextHeaderFilters = filtersChanged
858
- ? nextContext.runtimeFilters
859
- : current.headerFilters;
860
- const nextColumnFilters = filtersChanged ? [] : current.columnFilters;
861
- ctx.patchState({
862
- activeArea: action.area,
863
- byArea: {
864
- ...state.byArea,
865
- [action.area]: {
866
- ...current,
867
- headerFilters: nextHeaderFilters,
868
- columnFilters: nextColumnFilters,
869
- context: nextContext,
870
- },
275
+ }, ...(ngDevMode ? [{ debugName: "visibleRows" }] : /* istanbul ignore next */ []));
276
+ definitions = computed(() => this.columns().map((column) => {
277
+ const viewType = (column
278
+ .viewType ?? 'Text');
279
+ const scalar = ['Number', 'Percentage', 'Currency'].includes(viewType)
280
+ ? 'number'
281
+ : ['Date', 'DateTime'].includes(viewType)
282
+ ? 'date'
283
+ : 'text';
284
+ const fields = this.schema()?.properties?.length
285
+ ? this.schema().properties.map((p) => p.key)
286
+ : this.schema()?.allowedFields;
287
+ const filterable = column.filterable !== false &&
288
+ (!fields?.length || fields.includes(column.key));
289
+ // Runtime filters compare displayed values (WorkCenterRuntimeService.CompareValues), including lookup labels.
290
+ // Use the native scalar editor so values outside the loaded server page remain searchable.
291
+ const options = workCenterFilterOptions(this.schema(), scalar);
292
+ const definition = mtEntityColumn({
293
+ key: column.key,
294
+ label: column.label,
295
+ viewType,
296
+ entity: (row) => this.entity(row, column),
297
+ initialWidth: column.width?.endsWith('%')
298
+ ? Number.parseFloat(column.width) * 12
299
+ : 200,
300
+ minWidth: 90,
301
+ filter: filterable && options.filterOptions?.length ? scalar : false,
302
+ filterParams: options,
303
+ enablePivot: false,
304
+ enableValue: false,
305
+ enableRowGroup: column.groupable !== false,
306
+ groupValueRenderer: WorkCenterGroupValue,
307
+ cellRendererParams: {
308
+ counts: column.groupKey ? null : this.groupCounts(),
871
309
  },
310
+ ...(column.groupKey
311
+ ? {
312
+ valueGetter: ({ data }) => String(data[column.groupKey] ?? ''),
313
+ }
314
+ : {}),
872
315
  });
873
- }
874
- setParams(ctx, action) {
875
- const state = ctx.getState();
876
- const current = state.byArea[action.area];
877
- // A card switch invalidates everything scoped to the previous card. The
878
- // host usually drops those query params too, but a stale URL must not be
879
- // able to re-apply a filter on a field the new card doesn't have.
880
- const cardChanged = resolveSelectedCardKeyFromInputs(current.context, action.inputs) !==
881
- current.context.selectedCardKey;
882
- // Resolve grouping first: with no explicit `sort` input it is what defines
883
- // the backend sort.
884
- const nextGroupBy = resolveGroupByFromInputs(cardChanged ? null : current.groupBy, action.inputs?.group);
885
- const builtContext = buildContextFromInputs(current.context, action.area, action.inputs, nextGroupBy);
886
- const filtersFromInputs = action.inputs?.filters !== undefined;
887
- const nextContext = cardChanged && !filtersFromInputs
888
- ? { ...builtContext, runtimeFilters: [] }
889
- : builtContext;
890
- const areaChanged = state.activeArea !== action.area;
891
- const contextChanged = !isSameContext(current.context, nextContext);
892
- const groupChanged = nextGroupBy !== current.groupBy;
893
- const runtimeLoading = state.loadingActive.includes(WorkCenterActionKey.LoadRuntime);
894
- const shouldLoad = areaChanged || contextChanged || !runtimeLoading;
895
- if (areaChanged || contextChanged || groupChanged) {
896
- // URL-derived filters land on the header slice. Anything previously
897
- // applied via the in-table column filters is dropped so the BE payload
898
- // matches what the user sees on the page header.
899
- const nextHeaderFilters = filtersFromInputs
900
- ? nextContext.runtimeFilters
901
- : cardChanged
902
- ? []
903
- : current.headerFilters;
904
- const nextColumnFilters = filtersFromInputs || cardChanged ? [] : current.columnFilters;
905
- ctx.patchState({
906
- activeArea: action.area,
907
- byArea: {
908
- ...state.byArea,
909
- [action.area]: {
910
- ...current,
911
- headerFilters: nextHeaderFilters,
912
- columnFilters: nextColumnFilters,
913
- groupBy: nextGroupBy,
914
- context: nextContext,
915
- },
916
- },
316
+ return definition;
317
+ }), ...(ngDevMode ? [{ debugName: "definitions" }] : /* istanbul ignore next */ []));
318
+ constructor() {
319
+ effect(() => {
320
+ const key = this.viewKey();
321
+ untracked(() => {
322
+ this.search.set('');
323
+ this.ready()?.setFilterModel(null);
917
324
  });
918
- }
919
- if (!shouldLoad)
920
- return;
921
- return ctx.dispatch(new LoadRuntime(action.area, 'route-enter'));
922
- }
923
- setLookups(ctx, action) {
924
- if (ctx.getState().lookups === action.lookups) {
925
- return;
926
- }
927
- ctx.patchState({
928
- lookups: Array.isArray(action.lookups) ? action.lookups : [],
325
+ this.restored = null;
326
+ void key;
929
327
  });
930
- }
931
- applyHeaderFilters(ctx, action) {
932
- return this.applyFilterSlice(ctx, action.area, {
933
- headerFilters: action.filters,
328
+ effect(() => {
329
+ const rules = this.filterRules(), api = this.ready();
330
+ if (!api || rules.length)
331
+ return;
332
+ untracked(() => {
333
+ this.synchronizing = true;
334
+ try {
335
+ api.setFilterModel(null);
336
+ }
337
+ finally {
338
+ this.synchronizing = false;
339
+ }
340
+ });
934
341
  });
935
- }
936
- applyColumnFilters(ctx, action) {
937
- return this.applyFilterSlice(ctx, action.area, {
938
- columnFilters: action.filters,
342
+ effect(() => {
343
+ const api = this.ready(), context = this.context(), group = this.group();
344
+ if (!api)
345
+ return;
346
+ untracked(() => {
347
+ this.synchronizing = true;
348
+ try {
349
+ const key = this.preferences.key(this.identity());
350
+ if (key && key !== this.restored) {
351
+ const state = this.preferences.read(this.identity());
352
+ if (state)
353
+ api.applyColumnState({
354
+ state: state.columns.map(({ colId, width, hide, pinned }) => ({
355
+ colId,
356
+ width,
357
+ hide,
358
+ pinned,
359
+ })),
360
+ applyOrder: true,
361
+ });
362
+ this.restored = key;
363
+ }
364
+ api.setRowGroupColumns(group ? [group] : []);
365
+ api.setSortModel(context.sort.map((rule) => ({ colId: rule.field, sort: rule.dir })));
366
+ }
367
+ finally {
368
+ this.synchronizing = false;
369
+ }
370
+ });
939
371
  });
940
372
  }
941
- selectCard(ctx, action) {
942
- const state = ctx.getState();
943
- const current = state.byArea[action.area];
944
- if (current.context.selectedCardKey === action.selectedCardKey) {
945
- return;
946
- }
947
- ctx.patchState({
948
- activeArea: action.area,
949
- byArea: {
950
- ...state.byArea,
951
- [action.area]: {
952
- ...current,
953
- headerFilters: [],
954
- columnFilters: [],
955
- groupBy: null,
956
- context: {
957
- ...current.context,
958
- selectedCardKey: action.selectedCardKey,
959
- runtimeFilters: [],
960
- sort: [],
961
- page: 1,
962
- },
963
- },
964
- },
965
- });
966
- return ctx.dispatch(new LoadRuntime(action.area, 'menu-change'));
373
+ onReady(api) {
374
+ this.ready.set(api);
967
375
  }
968
- /**
969
- * Grouping is a backend concern: the table only renders contiguous rows, so
970
- * the grouped column is pushed down as the single `context.sort` entry and
971
- * pagination restarts at page 1. Clearing the group sends `sort: []`.
972
- */
973
- setGroupBy(ctx, action) {
974
- const state = ctx.getState();
975
- const current = state.byArea[action.area];
976
- const nextGroupBy = action.groupBy?.trim() ? action.groupBy : null;
977
- const nextSort = nextGroupBy
978
- ? [{ field: nextGroupBy, dir: action.dir }]
979
- : [];
980
- const sameGroup = current.groupBy === nextGroupBy;
981
- const sameSort = JSON.stringify(current.context.sort) === JSON.stringify(nextSort);
982
- if (sameGroup && sameSort)
376
+ filters(event) {
377
+ if (this.synchronizing || this.loading())
983
378
  return;
984
- ctx.patchState({
985
- activeArea: action.area,
986
- byArea: {
987
- ...state.byArea,
988
- [action.area]: {
989
- ...current,
990
- groupBy: nextGroupBy,
991
- context: sameSort
992
- ? current.context
993
- : { ...current.context, sort: nextSort, page: 1 },
994
- },
995
- },
996
- });
997
- // A group change that doesn't move the backend order (already sorted by
998
- // that field) is a pure render concern — no refetch.
999
- if (sameSort)
379
+ const api = this.ready();
380
+ if (!api)
1000
381
  return;
1001
- return ctx.dispatch(new LoadRuntime(action.area, 'group-change'));
382
+ if (event.source === 'quickFilter')
383
+ this.search.set(api.getQuickFilter() ?? '');
384
+ else
385
+ this.filtersChange.emit(workCenterGridFilters(api.getFilterModel(), this.schema()));
1002
386
  }
1003
- clearAllFilters(ctx, action) {
1004
- return this.applyFilterSlice(ctx, action.area, {
1005
- headerFilters: [],
1006
- columnFilters: [],
1007
- });
1008
- }
1009
- applyFilterSlice(ctx, area, patch) {
1010
- const state = ctx.getState();
1011
- const current = state.byArea[area];
1012
- const headerFilters = patch.headerFilters ?? current.headerFilters;
1013
- const columnFilters = patch.columnFilters ?? current.columnFilters;
1014
- const runtimeFilters = mergeRuntimeFilters(headerFilters, columnFilters);
1015
- const sameHeader = JSON.stringify(headerFilters) === JSON.stringify(current.headerFilters);
1016
- const sameColumn = JSON.stringify(columnFilters) === JSON.stringify(current.columnFilters);
1017
- const sameMerged = JSON.stringify(runtimeFilters) ===
1018
- JSON.stringify(current.context.runtimeFilters);
1019
- if (sameHeader && sameColumn && sameMerged) {
387
+ sorted(sort) {
388
+ if (this.synchronizing || this.loading())
1020
389
  return;
1021
- }
1022
- ctx.patchState({
1023
- activeArea: area,
1024
- byArea: {
1025
- ...state.byArea,
1026
- [area]: {
1027
- ...current,
1028
- headerFilters,
1029
- columnFilters,
1030
- context: {
1031
- ...current.context,
1032
- runtimeFilters,
1033
- page: 1,
1034
- },
1035
- },
1036
- },
390
+ const first = sort[0];
391
+ this.queryChange.emit({
392
+ currentPage: 1,
393
+ pageSize: this.context().pageSize,
394
+ sortField: first?.colId ?? null,
395
+ sortOrder: first?.sort === 'desc' ? -1 : 1,
1037
396
  });
1038
- return ctx.dispatch(new LoadRuntime(area, 'filters-change'));
1039
- }
1040
- loadRuntime(ctx, action) {
1041
- const state = ctx.getState();
1042
- const areaState = state.byArea[action.area];
1043
- const request = normalizeContext(areaState.context);
1044
- const nextAreaState = {
1045
- ...areaState,
1046
- rows: [],
1047
- kpis: [],
1048
- totalCount: 0,
1049
- };
1050
- ctx.patchState({
1051
- byArea: {
1052
- ...state.byArea,
1053
- [action.area]: nextAreaState,
1054
- },
1055
- });
1056
- return handleApiRequest({
1057
- ctx,
1058
- key: WorkCenterActionKey.LoadRuntime,
1059
- request$: this.getRuntime(request),
1060
- onSuccess: (response, latestState) => {
1061
- const current = latestState.byArea[action.area];
1062
- return {
1063
- byArea: {
1064
- ...latestState.byArea,
1065
- [action.area]: mapRuntimeResponse(current, response),
1066
- },
1067
- };
1068
- },
1069
- errorMessage: 'Failed to load Work Center runtime.',
1070
- }).pipe(catchError(() => EMPTY));
1071
- }
1072
- getRuntime(request) {
1073
- return this.http
1074
- .post('workcenter/runtime', request)
1075
- .pipe(map((response) => {
1076
- if (response.code === 1)
1077
- return response.data;
1078
- const fallbackError = 'Failed to load Work Center runtime.';
1079
- const message = response.errors?.message ??
1080
- response.message ??
1081
- fallbackError;
1082
- throw new Error(message);
1083
- }));
1084
- }
1085
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1086
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterState });
1087
- };
1088
- __decorate([
1089
- Action(EnterArea)
1090
- ], WorkCenterState.prototype, "enterArea", null);
1091
- __decorate([
1092
- Action(HydrateFromContext)
1093
- ], WorkCenterState.prototype, "hydrateFromContext", null);
1094
- __decorate([
1095
- Action(SetParams)
1096
- ], WorkCenterState.prototype, "setParams", null);
1097
- __decorate([
1098
- Action(SetLookups)
1099
- ], WorkCenterState.prototype, "setLookups", null);
1100
- __decorate([
1101
- Action(ApplyHeaderFilters)
1102
- ], WorkCenterState.prototype, "applyHeaderFilters", null);
1103
- __decorate([
1104
- Action(ApplyColumnFilters)
1105
- ], WorkCenterState.prototype, "applyColumnFilters", null);
1106
- __decorate([
1107
- Action(SelectCard)
1108
- ], WorkCenterState.prototype, "selectCard", null);
1109
- __decorate([
1110
- Action(SetGroupBy)
1111
- ], WorkCenterState.prototype, "setGroupBy", null);
1112
- __decorate([
1113
- Action(ClearAllFilters)
1114
- ], WorkCenterState.prototype, "clearAllFilters", null);
1115
- __decorate([
1116
- Action(LoadRuntime)
1117
- ], WorkCenterState.prototype, "loadRuntime", null);
1118
- __decorate([
1119
- Selector()
1120
- ], WorkCenterState, "getState", null);
1121
- __decorate([
1122
- Selector()
1123
- ], WorkCenterState, "activeArea", null);
1124
- __decorate([
1125
- Selector([WorkCenterState.activeArea, WorkCenterState.getState])
1126
- ], WorkCenterState, "activeSnapshot", null);
1127
- __decorate([
1128
- Selector([WorkCenterState.activeSnapshot])
1129
- ], WorkCenterState, "context", null);
1130
- __decorate([
1131
- Selector([WorkCenterState.activeSnapshot])
1132
- ], WorkCenterState, "menuItems", null);
1133
- __decorate([
1134
- Selector([WorkCenterState.activeSnapshot])
1135
- ], WorkCenterState, "rows", null);
1136
- __decorate([
1137
- Selector([WorkCenterState.activeSnapshot])
1138
- ], WorkCenterState, "columns", null);
1139
- __decorate([
1140
- Selector([WorkCenterState.activeSnapshot])
1141
- ], WorkCenterState, "kpis", null);
1142
- __decorate([
1143
- Selector([WorkCenterState.activeSnapshot])
1144
- ], WorkCenterState, "runtimeFilterSchema", null);
1145
- __decorate([
1146
- Selector([WorkCenterState.activeSnapshot])
1147
- ], WorkCenterState, "headerFilters", null);
1148
- __decorate([
1149
- Selector([WorkCenterState.activeSnapshot])
1150
- ], WorkCenterState, "columnFilters", null);
1151
- __decorate([
1152
- Selector([WorkCenterState.activeSnapshot])
1153
- ], WorkCenterState, "groupBy", null);
1154
- __decorate([
1155
- Selector([WorkCenterState.activeSnapshot])
1156
- ], WorkCenterState, "totalCount", null);
1157
- __decorate([
1158
- Selector([WorkCenterState.activeSnapshot])
1159
- ], WorkCenterState, "warnings", null);
1160
- __decorate([
1161
- Selector()
1162
- ], WorkCenterState, "lookups", null);
1163
- __decorate([
1164
- Selector()
1165
- ], WorkCenterState, "getLoadingActive", null);
1166
- __decorate([
1167
- Selector()
1168
- ], WorkCenterState, "getErrors", null);
1169
- WorkCenterState = __decorate([
1170
- State({
1171
- name: 'workCenter',
1172
- defaults: WORK_CENTER_DEFAULT_STATE,
1173
- })
1174
- ], WorkCenterState);
1175
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterState, decorators: [{
1176
- type: Injectable
1177
- }], propDecorators: { enterArea: [], hydrateFromContext: [], setParams: [], setLookups: [], applyHeaderFilters: [], applyColumnFilters: [], selectCard: [], setGroupBy: [], clearAllFilters: [], loadRuntime: [] } });
1178
-
1179
- class WorkCenterFacade {
1180
- store = inject(Store);
1181
- activeArea = select(WorkCenterState.activeArea);
1182
- context = select(WorkCenterState.context);
1183
- menuItems = select(WorkCenterState.menuItems);
1184
- rows = select(WorkCenterState.rows);
1185
- columns = select(WorkCenterState.columns);
1186
- kpis = select(WorkCenterState.kpis);
1187
- lookups = select(WorkCenterState.lookups);
1188
- runtimeFilterSchema = select(WorkCenterState.runtimeFilterSchema);
1189
- headerFilters = select(WorkCenterState.headerFilters);
1190
- columnFilters = select(WorkCenterState.columnFilters);
1191
- groupBy = select(WorkCenterState.groupBy);
1192
- totalCount = select(WorkCenterState.totalCount);
1193
- warnings = select(WorkCenterState.warnings);
1194
- loadingActive = select(WorkCenterState.getLoadingActive);
1195
- errors = select(WorkCenterState.getErrors);
1196
- loading = computed(() => this.loadingActive().includes(WorkCenterActionKey.LoadRuntime), ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
1197
- error = computed(() => this.errors()[WorkCenterActionKey.LoadRuntime] ?? null, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
1198
- /**
1199
- * Snapshot reads for callers that must observe state *immediately* after a
1200
- * dispatch — e.g. an output handler mirroring the runtime query into the URL.
1201
- * The `select()` signals above are the right choice everywhere else.
1202
- */
1203
- snapshotContext() {
1204
- return this.store.selectSnapshot(WorkCenterState.context);
1205
- }
1206
- snapshotGroupBy() {
1207
- return this.store.selectSnapshot(WorkCenterState.groupBy);
1208
397
  }
1209
- enterArea(area) {
1210
- return this.store.dispatch(new EnterArea(area));
398
+ /** Any view change: report a new grouping to the owner and persist the column layout. */
399
+ viewChanged() {
400
+ this.grouped();
401
+ this.save();
1211
402
  }
1212
- hydrateContext(area, patch) {
1213
- return this.store.dispatch(new HydrateFromContext(area, patch));
1214
- }
1215
- setParams(area, inputs) {
1216
- return this.store.dispatch(new SetParams(area, inputs));
1217
- }
1218
- setLookups(lookups) {
1219
- return this.store.dispatch(new SetLookups(lookups));
1220
- }
1221
- /**
1222
- * Switches card and drops the previous card's filters, grouping and sort —
1223
- * each card has its own columns and filter schema.
1224
- */
1225
- selectCardAndLoad(area, selectedCardKey) {
1226
- return this.store.dispatch(new SelectCard(area, selectedCardKey));
1227
- }
1228
- applyTableLazyLoadAndLoad(area, event) {
1229
- const context = this.store.selectSnapshot(WorkCenterState.context);
1230
- const patch = {};
1231
- let changed = false;
1232
- const page = this.toPositiveInt(event?.currentPage);
1233
- if (page !== null && page !== context.page) {
1234
- patch.page = page;
1235
- changed = true;
1236
- }
1237
- const pageSize = this.toPositiveInt(event?.pageSize);
1238
- if (pageSize !== null) {
1239
- const normalizedPageSize = Math.min(WORK_CENTER_MAX_PAGE_SIZE, Math.max(1, pageSize));
1240
- if (normalizedPageSize !== context.pageSize) {
1241
- patch.pageSize = normalizedPageSize;
1242
- changed = true;
1243
- }
1244
- }
1245
- const sort = this.toSortFromLazyEvent(event);
1246
- if (sort && !this.isSameSort(sort, context.sort)) {
1247
- patch.sort = sort;
1248
- changed = true;
1249
- }
1250
- if (!changed) {
403
+ grouped() {
404
+ if (this.synchronizing || this.loading())
1251
405
  return;
1252
- }
1253
- return this.store.dispatch([
1254
- new HydrateFromContext(area, patch),
1255
- new LoadRuntime(area, 'table-lazy'),
1256
- ]);
1257
- }
1258
- applyRuntimeFiltersAndLoad(area, runtimeFilters) {
1259
- // Back-compat: any caller that previously set the entire `runtimeFilters`
1260
- // array now lands on the header slice. The in-table column filter slice is
1261
- // cleared so the merged payload matches what callers expect.
1262
- return this.store.dispatch(new ApplyHeaderFilters(area, runtimeFilters));
1263
- }
1264
- /**
1265
- * Replaces the property-filter-builder slice. Resets pagination to page 1
1266
- * and reloads with merged `headerFilters` + `columnFilters`.
1267
- */
1268
- applyHeaderFiltersAndLoad(area, runtimeFilters) {
1269
- return this.store.dispatch(new ApplyHeaderFilters(area, runtimeFilters));
1270
- }
1271
- /**
1272
- * Replaces the in-table column filter slice. Resets pagination to page 1
1273
- * and reloads with merged `headerFilters` + `columnFilters`.
1274
- */
1275
- applyColumnFiltersAndLoad(area, runtimeFilters) {
1276
- return this.store.dispatch(new ApplyColumnFilters(area, runtimeFilters));
1277
- }
1278
- /**
1279
- * Groups the table by `groupBy` (or clears grouping with `null`). Pushes the
1280
- * grouped column down as the single backend sort, resets to page 1 and
1281
- * reloads. Safe to call from the table's `groupByChange` — the lazy event
1282
- * that follows carries the same sort and is absorbed as a no-op.
1283
- */
1284
- setGroupByAndLoad(area, groupBy, dir = 'asc') {
1285
- return this.store.dispatch(new SetGroupBy(area, groupBy, dir));
406
+ const groups = this.ready()?.getRowGroupColumns() ?? [];
407
+ const next = groups.at(-1) ?? null;
408
+ if (next !== this.group())
409
+ this.groupChange.emit(next);
1286
410
  }
1287
- /**
1288
- * Clears both header and column filter slices in one state update,
1289
- * triggering a single BE reload.
1290
- */
1291
- clearAllFiltersAndLoad(area) {
1292
- return this.store.dispatch(new ClearAllFilters(area));
1293
- }
1294
- loadRuntime(area, reason = 'manual') {
1295
- return this.store.dispatch(new LoadRuntime(area, reason));
1296
- }
1297
- toPositiveInt(value) {
1298
- const parsed = Number(value);
1299
- if (!Number.isFinite(parsed)) {
1300
- return null;
1301
- }
1302
- return Math.max(1, Math.floor(parsed));
411
+ paged(event) {
412
+ if (!event.newPage && !event.newPageSize)
413
+ return;
414
+ const sort = this.context().sort[0];
415
+ this.queryChange.emit({
416
+ currentPage: event.currentPage + 1,
417
+ pageSize: event.pageSize,
418
+ sortField: sort?.field ?? null,
419
+ sortOrder: sort?.dir === 'desc' ? -1 : 1,
420
+ });
1303
421
  }
1304
- /**
1305
- * `mt-table` always reports its sort on a lazy event, so a `null` field is an
1306
- * explicit "no sort" and must clear `context.sort` (the BE contract asks for
1307
- * `sort: []`). Only an event with no `sortField` key at all — nothing the
1308
- * current table emits — leaves the existing sort alone.
1309
- */
1310
- toSortFromLazyEvent(event) {
1311
- if (!event || !('sortField' in event)) {
1312
- return null;
1313
- }
1314
- const sortField = event.sortField;
1315
- if (typeof sortField !== 'string' || !sortField.length) {
1316
- return [];
1317
- }
1318
- return [
1319
- {
1320
- field: sortField,
1321
- dir: event.sortOrder === -1 ? 'desc' : 'asc',
422
+ save() {
423
+ if (this.synchronizing || !this.ready())
424
+ return;
425
+ this.preferences.write(this.identity(), captureGridViewState(this.ready()));
426
+ }
427
+ entity(row, column) {
428
+ const entity = row[column.key];
429
+ const raw = entity.rawValue ??
430
+ (['Number', 'Percentage', 'Currency'].includes(entity.viewType)
431
+ ? TableValueResolver.getEntityValueByType(entity, 'sort')
432
+ : ['Date', 'DateTime'].includes(entity.viewType)
433
+ ? TableValueResolver.resolveDateValue(entity.value)
434
+ : null);
435
+ return {
436
+ ...entity,
437
+ ...(raw != null ? { rawValue: String(raw) } : {}),
438
+ configuration: {
439
+ ...entity.configuration,
440
+ hideName: true,
441
+ showDisplayName: true,
442
+ showEmail: false,
443
+ showPhoneNumber: false,
1322
444
  },
1323
- ];
1324
- }
1325
- isSameSort(left, right) {
1326
- const leftValue = left ?? [];
1327
- const rightValue = right ?? [];
1328
- if (leftValue.length !== rightValue.length) {
1329
- return false;
1330
- }
1331
- return leftValue.every((rule, index) => rule.field === rightValue[index]?.field &&
1332
- rule.dir === rightValue[index]?.dir);
445
+ };
1333
446
  }
1334
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1335
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterFacade, providedIn: 'root' });
447
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterGrid, deps: [], target: i0.ɵɵFactoryTarget.Component });
448
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: WorkCenterGrid, isStandalone: true, selector: "mt-work-center-grid", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, schema: { classPropertyName: "schema", publicName: "schema", isSignal: true, isRequired: false, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, filterRules: { classPropertyName: "filterRules", publicName: "filterRules", isSignal: true, isRequired: false, transformFunction: null }, groupCounts: { classPropertyName: "groupCounts", publicName: "groupCounts", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, viewKey: { classPropertyName: "viewKey", publicName: "viewKey", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { rowClick: "rowClick", filtersChange: "filtersChange", groupChange: "groupChange", queryChange: "queryChange" }, ngImport: i0, template: "<mt-standard-grid\n [rows]=\"visibleRows()\"\n [columns]=\"definitions()\"\n [rowId]=\"rowId\"\n [label]=\"label()\"\n [loading]=\"loading()\"\n height=\"auto\"\n [search]=\"search()\"\n [server]=\"serverPage()\"\n [exportName]=\"label()\"\n (gridReady)=\"onReady($event.api)\"\n (filterChanged)=\"filters($event)\"\n (sortChanged)=\"sorted($event)\"\n (paginationChanged)=\"paged($event)\"\n (viewChanged)=\"viewChanged()\"\n (rowClicked)=\"rowClick.emit($event)\"\n/>\n", dependencies: [{ kind: "component", type: MtStandardGridComponent, selector: "mt-standard-grid", inputs: ["rows", "columns", "rowId", "label", "loading", "height", "selection", "exportable", "exportName", "exportFormats", "exporter", "rowMenuItems", "server", "paged", "detail", "chartContext", "search", "emptyTitle", "emptyDescription", "view"], outputs: ["gridReady", "rowClicked", "selectionChanged", "sortChanged", "filterChanged", "paginationChanged", "rowGroupOpened", "viewChanged", "chartsChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1336
449
  }
1337
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterFacade, decorators: [{
1338
- type: Injectable,
1339
- args: [{
1340
- providedIn: 'root',
1341
- }]
1342
- }] });
450
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterGrid, decorators: [{
451
+ type: Component,
452
+ args: [{ selector: 'mt-work-center-grid', imports: [MtStandardGridComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mt-standard-grid\n [rows]=\"visibleRows()\"\n [columns]=\"definitions()\"\n [rowId]=\"rowId\"\n [label]=\"label()\"\n [loading]=\"loading()\"\n height=\"auto\"\n [search]=\"search()\"\n [server]=\"serverPage()\"\n [exportName]=\"label()\"\n (gridReady)=\"onReady($event.api)\"\n (filterChanged)=\"filters($event)\"\n (sortChanged)=\"sorted($event)\"\n (paginationChanged)=\"paged($event)\"\n (viewChanged)=\"viewChanged()\"\n (rowClicked)=\"rowClick.emit($event)\"\n/>\n" }]
453
+ }], ctorParameters: () => [], propDecorators: { rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }], schema: [{ type: i0.Input, args: [{ isSignal: true, alias: "schema", required: false }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], filterRules: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterRules", required: false }] }], groupCounts: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupCounts", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], viewKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewKey", required: true }] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], filtersChange: [{ type: i0.Output, args: ["filtersChange"] }], groupChange: [{ type: i0.Output, args: ["groupChange"] }], queryChange: [{ type: i0.Output, args: ["queryChange"] }] } });
1343
454
 
1344
455
  /**
1345
456
  * Route-scoped channel for whether the modal body has content ready to commit
@@ -2040,9 +1151,9 @@ class WorkCenterProcessRequestType {
2040
1151
  this.formStore?.setIncomplete(false);
2041
1152
  }
2042
1153
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, deps: [], target: i0.ɵɵFactoryTarget.Component });
2043
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessRequestType, isStandalone: true, selector: "mt-work-center-process-request-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'requestDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <!-- Host sub-tabs of the form (WORK_CENTER_EXTRA_TABS, placement\r\n 'form'). The form stays mounted on them: it's the footer\r\n actions' form source. -->\r\n @if (formTabOptions().length) {\r\n <div class=\"mb-4\">\r\n <mt-tabs\r\n [(active)]=\"formTab\"\r\n [options]=\"formTabOptions()\"\r\n size=\"large\"\r\n fluid\r\n />\r\n </div>\r\n }\r\n\r\n <div [hidden]=\"formTab() !== 'form'\">\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [requestSchemaId]=\"requestSchemaId()\"\r\n [draftProcessId]=\"draftProcessId()\"\r\n [requestCommitted]=\"requestCommitted()\"\r\n [readonly]=\"isReadonly()\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"formLookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n @for (tab of formTabs(); track tab.key) {\r\n @defer (when formTab() === tab.key) {\r\n <div [hidden]=\"formTab() !== tab.key\">\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Host tabs (WORK_CENTER_EXTRA_TABS): mounted on first open, then kept\r\n like the built-in tabs. -->\r\n @for (tab of extraTabs(); track tab.key) {\r\n @defer (when activeTab() === tab.key) {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== tab.key\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @defer (when activeTab() === \"schema\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!readOnly()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"discussionRecordId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "recordId", "requestSchemaId", "draftProcessId", "requestCommitted", "templateId", "returnRecord", "preview", "forceOriginalForm", "returnUrl", "defaultValues", "submitRequestMapper", "submitTransport", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "silentMessages", "hostMessages", "readonlyFieldDisplayMode", "lookups", "statuses", "ignoredFieldKeys", "disabledFieldKeys", "allowedFieldKeys", "requiredFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }], deferBlockDependencies: [() => [i1.NgComponentOutlet], () => [i1.NgComponentOutlet], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
1154
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessRequestType, isStandalone: true, selector: "mt-work-center-process-request-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'requestDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <!-- Host sub-tabs of the form (WORK_CENTER_EXTRA_TABS, placement\r\n 'form'). The form stays mounted on them: it's the footer\r\n actions' form source. -->\r\n @if (formTabOptions().length) {\r\n <div class=\"mb-4\">\r\n <mt-tabs\r\n [(active)]=\"formTab\"\r\n [options]=\"formTabOptions()\"\r\n size=\"large\"\r\n fluid\r\n />\r\n </div>\r\n }\r\n\r\n <div [hidden]=\"formTab() !== 'form'\">\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [requestSchemaId]=\"requestSchemaId()\"\r\n [draftProcessId]=\"draftProcessId()\"\r\n [requestCommitted]=\"requestCommitted()\"\r\n [readonly]=\"isReadonly()\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"formLookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n @for (tab of formTabs(); track tab.key) {\r\n @defer (when formTab() === tab.key) {\r\n <div [hidden]=\"formTab() !== tab.key\">\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Host tabs (WORK_CENTER_EXTRA_TABS): mounted on first open, then kept\r\n like the built-in tabs. -->\r\n @for (tab of extraTabs(); track tab.key) {\r\n @defer (when activeTab() === tab.key) {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== tab.key\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @defer (when activeTab() === \"schema\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!readOnly()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"discussionRecordId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.requestDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "recordId", "requestSchemaId", "draftProcessId", "requestCommitted", "templateId", "returnRecord", "preview", "forceOriginalForm", "returnUrl", "defaultValues", "submitRequestMapper", "submitTransport", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "silentMessages", "hostMessages", "readonlyFieldDisplayMode", "lookups", "statuses", "ignoredFieldKeys", "disabledFieldKeys", "allowedFieldKeys", "requiredFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }], deferBlockDependencies: [() => [i1.NgComponentOutlet], () => [i1.NgComponentOutlet], () => [import('./masterteam-work-center-work-center-process-preview-BOWFfPh5.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-BOWFfPh5.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
2044
1155
  }
2045
- i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
1156
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-BOWFfPh5.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
2046
1157
  type: Component,
2047
1158
  args: [{ selector: 'mt-work-center-process-request-type', standalone: true, imports: [
2048
1159
  CommonModule,
@@ -2227,9 +1338,9 @@ class WorkCenterProcessStepType {
2227
1338
  this.formStore?.setIncomplete(false);
2228
1339
  }
2229
1340
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, deps: [], target: i0.ɵɵFactoryTarget.Component });
2230
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessStepType, isStandalone: true, selector: "mt-work-center-process-step-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }, { propertyName: "levelPreview", first: true, predicate: ClientInstancePreview, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'form'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <!-- Host sub-tabs of the form (WORK_CENTER_EXTRA_TABS, placement\r\n 'form'). The form stays mounted on them: it's the footer\r\n actions' form source. -->\r\n @if (formTabOptions().length) {\r\n <div class=\"mb-4\">\r\n <mt-tabs\r\n [(active)]=\"formTab\"\r\n [options]=\"formTabOptions()\"\r\n size=\"large\"\r\n fluid\r\n />\r\n </div>\r\n }\r\n\r\n <div [hidden]=\"formTab() !== 'form'\">\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [requestSchemaId]=\"requestSchemaId()\"\r\n [draftProcessId]=\"draftProcessId()\"\r\n [readonly]=\"readOnly()\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"formLookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n @for (tab of formTabs(); track tab.key) {\r\n @defer (when formTab() === tab.key) {\r\n <div [hidden]=\"formTab() !== tab.key\">\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'levelDetails'\"\r\n >\r\n @if (levelDetailsConfig(); as levelDetailsConfig) {\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-client-instance-preview [config]=\"levelDetailsConfig\" />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Host tabs (WORK_CENTER_EXTRA_TABS): mounted on first open, then kept\r\n like the built-in tabs. -->\r\n @for (tab of extraTabs(); track tab.key) {\r\n @defer (when activeTab() === tab.key) {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== tab.key\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @defer (when activeTab() === \"schema\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!readOnly()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"discussionRecordId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "recordId", "requestSchemaId", "draftProcessId", "requestCommitted", "templateId", "returnRecord", "preview", "forceOriginalForm", "returnUrl", "defaultValues", "submitRequestMapper", "submitTransport", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "silentMessages", "hostMessages", "readonlyFieldDisplayMode", "lookups", "statuses", "ignoredFieldKeys", "disabledFieldKeys", "allowedFieldKeys", "requiredFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }, { kind: "component", type: ClientInstancePreview, selector: "mt-client-instance-preview", inputs: ["config", "hideEmptyState", "stackOnNarrow"] }], deferBlockDependencies: [() => [i1.NgComponentOutlet], () => [i1.NgComponentOutlet], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
1341
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessStepType, isStandalone: true, selector: "mt-work-center-process-step-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "clientForm", first: true, predicate: ClientForm, descendants: true, isSignal: true }, { propertyName: "levelPreview", first: true, predicate: ClientInstancePreview, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'form'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <!-- Host sub-tabs of the form (WORK_CENTER_EXTRA_TABS, placement\r\n 'form'). The form stays mounted on them: it's the footer\r\n actions' form source. -->\r\n @if (formTabOptions().length) {\r\n <div class=\"mb-4\">\r\n <mt-tabs\r\n [(active)]=\"formTab\"\r\n [options]=\"formTabOptions()\"\r\n size=\"large\"\r\n fluid\r\n />\r\n </div>\r\n }\r\n\r\n <div [hidden]=\"formTab() !== 'form'\">\r\n @if (canRenderForm()) {\r\n <mt-client-form\r\n [moduleKey]=\"moduleKey()\"\r\n [operationKey]=\"operationKey()\"\r\n [moduleId]=\"moduleId()\"\r\n [levelId]=\"levelId()\"\r\n [levelDataId]=\"levelDataId()\"\r\n [moduleDataId]=\"moduleDataId()\"\r\n [requestSchemaId]=\"requestSchemaId()\"\r\n [draftProcessId]=\"draftProcessId()\"\r\n [readonly]=\"readOnly()\"\r\n [renderMode]=\"'sections'\"\r\n [lookups]=\"formLookups()\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processFormUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n\r\n @for (tab of formTabs(); track tab.key) {\r\n @defer (when formTab() === tab.key) {\r\n <div [hidden]=\"formTab() !== tab.key\">\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'levelDetails'\"\r\n >\r\n @if (levelDetailsConfig(); as levelDetailsConfig) {\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-client-instance-preview [config]=\"levelDetailsConfig\" />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Host tabs (WORK_CENTER_EXTRA_TABS): mounted on first open, then kept\r\n like the built-in tabs. -->\r\n @for (tab of extraTabs(); track tab.key) {\r\n @defer (when activeTab() === tab.key) {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== tab.key\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"tab.component; inputs: extraTabInputs()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @defer (when activeTab() === \"schema\") {\r\n <div\r\n class=\"flex-1 min-h-0 overflow-auto\"\r\n [hidden]=\"activeTab() !== 'schema'\"\r\n >\r\n @if (canRenderPreview()) {\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processPreviewUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!readOnly()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n @if (canRenderDiscussion()) {\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"discussionRecordId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"context.processDiscussionUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: ClientForm, selector: "mt-client-form", inputs: ["moduleKey", "operationKey", "moduleId", "levelId", "levelDataId", "moduleDataId", "recordId", "requestSchemaId", "draftProcessId", "requestCommitted", "templateId", "returnRecord", "preview", "forceOriginalForm", "returnUrl", "defaultValues", "submitRequestMapper", "submitTransport", "readonly", "autoLoad", "formMode", "renderMode", "showInternalStepActions", "confirmWarningsOnSubmit", "confirmWarningsOnStepChange", "silentMessages", "hostMessages", "readonlyFieldDisplayMode", "lookups", "statuses", "ignoredFieldKeys", "disabledFieldKeys", "allowedFieldKeys", "requiredFieldKeys"], outputs: ["loaded", "submitted", "errored", "modeDetected", "formSourceDetected", "footerStateChanged"] }, { kind: "component", type: ClientInstancePreview, selector: "mt-client-instance-preview", inputs: ["config", "hideEmptyState", "stackOnNarrow"] }], deferBlockDependencies: [() => [i1.NgComponentOutlet], () => [i1.NgComponentOutlet], () => [import('./masterteam-work-center-work-center-process-preview-BOWFfPh5.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-BOWFfPh5.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
2231
1342
  }
2232
- i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
1343
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-BOWFfPh5.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
2233
1344
  type: Component,
2234
1345
  args: [{ selector: 'mt-work-center-process-step-type', standalone: true, imports: [
2235
1346
  CommonModule,
@@ -2694,9 +1805,9 @@ class WorkCenterSchedulePublishType {
2694
1805
  });
2695
1806
  }
2696
1807
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, deps: [], target: i0.ɵɵFactoryTarget.Component });
2697
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterSchedulePublishType, isStandalone: true, selector: "mt-work-center-schedule-publish-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <!-- Comparison -->\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'comparison'\"\r\n >\r\n <div\r\n class=\"flex h-full min-h-0 min-w-0 flex-col gap-3 lg:overflow-hidden\"\r\n >\r\n @if (loading()) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"loading.schedulePublish\") }}\r\n </p>\r\n </div>\r\n } @else if (error(); as loadError) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-red-300 bg-red-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-red-600\">\r\n {{ loadError }}\r\n </p>\r\n </div>\r\n } @else if (!summary().hasSnapshot) {\r\n <!-- Never published: nothing has been announced, so nothing can\r\n differ from it. That is a different statement from \"no changes\". -->\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"publish.neverPublished\") }}\r\n </p>\r\n </div>\r\n } @else if (!summary().needsAttention) {\r\n <!-- Not `isEmpty`: a request whose only rows are zero-diff conflict\r\n convergences is publish-empty but must still show its conflicts\r\n section rather than claim there is nothing here. -->\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"publish.nothingToPublish\") }}\r\n </p>\r\n </div>\r\n } @else {\r\n <!-- Counts stay visible while searching, so a filtered view never\r\n reads as the whole request. -->\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @if (summary().conflictCount > 0) {\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('conflict')\"\r\n >{{\r\n t(\"publish.conflictCount\", {\r\n count: summary().conflictCount,\r\n })\r\n }}</span\r\n >\r\n }\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('added')\"\r\n >{{\r\n t(\"publish.addedCount\", { count: summary().addedCount })\r\n }}</span\r\n >\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('changed')\"\r\n >{{\r\n t(\"publish.changedCount\", { count: summary().changedCount })\r\n }}</span\r\n >\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('removed')\"\r\n >{{\r\n t(\"publish.removedCount\", { count: summary().removedCount })\r\n }}</span\r\n >\r\n </div>\r\n\r\n <input\r\n type=\"search\"\r\n class=\"w-full rounded-md border border-surface-300 bg-surface-0 px-3 py-2 text-sm outline-none focus:border-primary-400\"\r\n [placeholder]=\"t('publish.searchPlaceholder')\"\r\n [value]=\"searchText()\"\r\n (input)=\"onSearch($any($event.target).value)\"\r\n />\r\n\r\n <div\r\n class=\"min-h-0 flex-1 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (searchFoundNothing()) {\r\n <div\r\n class=\"flex min-h-[12rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"text-sm text-surface-500\">\r\n {{ t(\"publish.noSearchResults\") }}\r\n </p>\r\n </div>\r\n }\r\n\r\n @for (group of groups(); track group.state) {\r\n <section class=\"mb-4\">\r\n <header class=\"mb-2 flex items-center gap-2\">\r\n <h4 class=\"text-sm font-semibold text-surface-700\">\r\n {{ groupLabel(group.state) }}\r\n </h4>\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass(group.state)\"\r\n >{{ group.totalCount }}</span\r\n >\r\n </header>\r\n\r\n @if (group.state === \"conflict\") {\r\n <!-- Informational only: unlike the planner's drawer there is\r\n no keep-mine / use-published control here. The frozen\r\n plan under approval was captured while the live plan had\r\n moved on these rows. -->\r\n <p class=\"mb-2 text-xs text-surface-500\">\r\n {{ t(\"publish.conflictHint\") }}\r\n </p>\r\n }\r\n\r\n <ul class=\"flex flex-col gap-1\">\r\n @for (row of visibleRows(group); track rowKey(row)) {\r\n <li\r\n class=\"rounded-md border border-surface-200 bg-surface-0\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full items-center gap-2 px-3 py-2 text-start\"\r\n [class.cursor-default]=\"!isExpandable(row)\"\r\n [attr.aria-expanded]=\"\r\n isExpandable(row) ? isExpanded(row) : null\r\n \"\r\n [disabled]=\"!isExpandable(row)\"\r\n (click)=\"toggleRow(row)\"\r\n >\r\n @if (isExpandable(row)) {\r\n <span\r\n class=\"shrink-0 text-xs text-surface-500\"\r\n aria-hidden=\"true\"\r\n >{{ isExpanded(row) ? \"\u25BE\" : \"\u25B8\" }}</span\r\n >\r\n } @else {\r\n <span\r\n class=\"w-3 shrink-0\"\r\n aria-hidden=\"true\"\r\n ></span>\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm text-surface-800\"\r\n >{{ row.name }}</span\r\n >\r\n @if (row.type) {\r\n <span class=\"shrink-0 text-xs text-surface-500\">{{\r\n row.type\r\n }}</span>\r\n }\r\n </button>\r\n\r\n @if (\r\n group.state === \"conflict\" &&\r\n publishedMovedFields(row).length > 0\r\n ) {\r\n <p\r\n class=\"border-t border-surface-200 px-3 py-1.5 text-xs text-orange-700\"\r\n >\r\n {{ t(\"publish.publishedSideMoved\") }}:\r\n {{ publishedMovedFields(row).join(\", \") }}\r\n </p>\r\n }\r\n\r\n @if (isExpandable(row) && isExpanded(row)) {\r\n <div\r\n class=\"flex flex-col gap-3 border-t border-surface-200 px-3 py-3\"\r\n >\r\n @for (\r\n change of changesFor(row);\r\n track change.field\r\n ) {\r\n <div class=\"flex min-w-0 flex-col gap-1\">\r\n <span\r\n class=\"text-xs font-medium text-surface-600\"\r\n >{{ fieldLabel(change.field) }}</span\r\n >\r\n <!-- Before -> After rendered locally rather than\r\n via mt-comparison-value, whose Before/After\r\n labels are hardcoded English. Each side still\r\n goes through mt-entity-preview-body, so a date\r\n renders as a date and a user as an avatar. -->\r\n <div\r\n class=\"flex w-full min-w-0 items-stretch gap-3\"\r\n >\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\r\n >{{ t(\"publish.before\") }}</span\r\n >\r\n <mt-entity-preview-body\r\n [data]=\"sideEntity(change, 'published')\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex shrink-0 items-center text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n &rarr;\r\n </div>\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\r\n >{{ t(\"publish.after\") }}</span\r\n >\r\n <mt-entity-preview-body\r\n [data]=\"sideEntity(change, 'current')\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </li>\r\n }\r\n </ul>\r\n\r\n @if (hiddenCount(group) > 0) {\r\n <!-- Said out loud: a silently truncated comparison reads as a\r\n complete one to whoever is approving it. -->\r\n <p class=\"mt-2 text-xs text-surface-500\">\r\n {{\r\n t(\"publish.hiddenRows\", { count: hiddenCount(group) })\r\n }}\r\n </p>\r\n }\r\n </section>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Project record preview. Loaded only when opened; it is a current\r\n record view, while Comparison is the frozen submitted schedule. -->\r\n @if (projectDetailsConfig(); as projectDetailsConfig) {\r\n @defer (when activeTab() === \"projectDetails\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'projectDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <p class=\"mb-3 text-xs text-surface-500\">\r\n {{ t(\"publish.projectDetailsLiveNote\") }}\r\n </p>\r\n <mt-client-instance-preview [config]=\"projectDetailsConfig\" />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Approval history -->\r\n @if (canRenderPreview()) {\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Workflow -->\r\n @if (canRenderPreview()) {\r\n @defer (when activeTab() === \"workflow\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'workflow'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Discussion -->\r\n @if (!readOnly() && canRenderDiscussion()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"resolvedRequestId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: EntityPreviewBody, selector: "mt-entity-preview-body", inputs: ["data", "attachmentShape"] }], deferBlockDependencies: [() => [ClientInstancePreview], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
1808
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterSchedulePublishType, isStandalone: true, selector: "mt-work-center-schedule-publish-type", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\n *transloco=\"let t; prefix: 'workCenter'\"\n>\n <div\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\n >\n @if (tabOptions().length > 1) {\n <mt-tabs\n [(active)]=\"activeTab\"\n [options]=\"tabOptions()\"\n mode=\"vertical\"\n size=\"small\"\n />\n }\n\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\n <!-- Comparison -->\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'comparison'\"\n >\n <div\n class=\"flex h-full min-h-0 min-w-0 flex-col gap-3 lg:overflow-hidden\"\n >\n @if (loading()) {\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"loading.schedulePublish\") }}\n </p>\n </div>\n } @else if (error(); as loadError) {\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-red-300 bg-red-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-red-600\">\n {{ loadError }}\n </p>\n </div>\n } @else if (!summary().hasSnapshot) {\n <!-- Never published: nothing has been announced, so nothing can\n differ from it. That is a different statement from \"no changes\". -->\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"publish.neverPublished\") }}\n </p>\n </div>\n } @else if (!summary().needsAttention) {\n <!-- Not `isEmpty`: a request whose only rows are zero-diff conflict\n convergences is publish-empty but must still show its conflicts\n section rather than claim there is nothing here. -->\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"publish.nothingToPublish\") }}\n </p>\n </div>\n } @else {\n <!-- Counts stay visible while searching, so a filtered view never\n reads as the whole request. -->\n <div class=\"flex flex-wrap items-center gap-2\">\n @if (summary().conflictCount > 0) {\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('conflict')\"\n >{{\n t(\"publish.conflictCount\", {\n count: summary().conflictCount,\n })\n }}</span\n >\n }\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('added')\"\n >{{\n t(\"publish.addedCount\", { count: summary().addedCount })\n }}</span\n >\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('changed')\"\n >{{\n t(\"publish.changedCount\", { count: summary().changedCount })\n }}</span\n >\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('removed')\"\n >{{\n t(\"publish.removedCount\", { count: summary().removedCount })\n }}</span\n >\n </div>\n\n <input\n type=\"search\"\n class=\"w-full rounded-md border border-surface-300 bg-surface-0 px-3 py-2 text-sm outline-none focus:border-primary-400\"\n [placeholder]=\"t('publish.searchPlaceholder')\"\n [value]=\"searchText()\"\n (input)=\"onSearch($any($event.target).value)\"\n />\n\n <div\n class=\"min-h-0 flex-1 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n @if (searchFoundNothing()) {\n <div\n class=\"flex min-h-[12rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"text-sm text-surface-500\">\n {{ t(\"publish.noSearchResults\") }}\n </p>\n </div>\n }\n\n @for (group of groups(); track group.state) {\n <section class=\"mb-4\">\n <header class=\"mb-2 flex items-center gap-2\">\n <h4 class=\"text-sm font-semibold text-surface-700\">\n {{ groupLabel(group.state) }}\n </h4>\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass(group.state)\"\n >{{ group.totalCount }}</span\n >\n </header>\n\n @if (group.state === \"conflict\") {\n <!-- Informational only: unlike the planner's drawer there is\n no keep-mine / use-published control here. The frozen\n plan under approval was captured while the live plan had\n moved on these rows. -->\n <p class=\"mb-2 text-xs text-surface-500\">\n {{ t(\"publish.conflictHint\") }}\n </p>\n }\n\n <ul class=\"flex flex-col gap-1\">\n @for (row of visibleRows(group); track rowKey(row)) {\n <li\n class=\"rounded-md border border-surface-200 bg-surface-0\"\n >\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-2 px-3 py-2 text-start\"\n [class.cursor-default]=\"!isExpandable(row)\"\n [attr.aria-expanded]=\"\n isExpandable(row) ? isExpanded(row) : null\n \"\n [disabled]=\"!isExpandable(row)\"\n (click)=\"toggleRow(row)\"\n >\n @if (isExpandable(row)) {\n <span\n class=\"shrink-0 text-xs text-surface-500\"\n aria-hidden=\"true\"\n >{{ isExpanded(row) ? \"\u25BE\" : \"\u25B8\" }}</span\n >\n } @else {\n <span\n class=\"w-3 shrink-0\"\n aria-hidden=\"true\"\n ></span>\n }\n <span\n class=\"min-w-0 flex-1 truncate text-sm text-surface-800\"\n >{{ row.name }}</span\n >\n @if (row.type) {\n <span class=\"shrink-0 text-xs text-surface-500\">{{\n row.type\n }}</span>\n }\n </button>\n\n @if (\n group.state === \"conflict\" &&\n publishedMovedFields(row).length > 0\n ) {\n <p\n class=\"border-t border-surface-200 px-3 py-1.5 text-xs text-orange-700\"\n >\n {{ t(\"publish.publishedSideMoved\") }}:\n {{ publishedMovedFields(row).join(\", \") }}\n </p>\n }\n\n @if (isExpandable(row) && isExpanded(row)) {\n <div\n class=\"flex flex-col gap-3 border-t border-surface-200 px-3 py-3\"\n >\n @for (\n change of changesFor(row);\n track change.field\n ) {\n <div class=\"flex min-w-0 flex-col gap-1\">\n <span\n class=\"text-xs font-medium text-surface-600\"\n >{{ fieldLabel(change.field) }}</span\n >\n <!-- Before -> After rendered locally rather than\n via mt-comparison-value, whose Before/After\n labels are hardcoded English. Each side still\n goes through mt-entity-preview-body, so a date\n renders as a date and a user as an avatar. -->\n <div\n class=\"flex w-full min-w-0 items-stretch gap-3\"\n >\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span\n class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\n >{{ t(\"publish.before\") }}</span\n >\n <mt-entity-preview-body\n [data]=\"sideEntity(change, 'published')\"\n />\n </div>\n <div\n class=\"flex shrink-0 items-center text-muted-color\"\n aria-hidden=\"true\"\n >\n &rarr;\n </div>\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\n >\n <span\n class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\n >{{ t(\"publish.after\") }}</span\n >\n <mt-entity-preview-body\n [data]=\"sideEntity(change, 'current')\"\n />\n </div>\n </div>\n </div>\n }\n </div>\n }\n </li>\n }\n </ul>\n\n @if (hiddenCount(group) > 0) {\n <!-- Said out loud: a silently truncated comparison reads as a\n complete one to whoever is approving it. -->\n <p class=\"mt-2 text-xs text-surface-500\">\n {{\n t(\"publish.hiddenRows\", { count: hiddenCount(group) })\n }}\n </p>\n }\n </section>\n }\n </div>\n }\n </div>\n </div>\n\n <!-- Project record preview. Loaded only when opened; it is a current\n record view, while Comparison is the frozen submitted schedule. -->\n @if (projectDetailsConfig(); as projectDetailsConfig) {\n @defer (when activeTab() === \"projectDetails\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'projectDetails'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <p class=\"mb-3 text-xs text-surface-500\">\n {{ t(\"publish.projectDetailsLiveNote\") }}\n </p>\n <mt-client-instance-preview [config]=\"projectDetailsConfig\" />\n </div>\n </div>\n }\n }\n\n <!-- Approval history -->\n @if (canRenderPreview()) {\n @defer (when activeTab() === \"approvals\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'approvals'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'approvals'\"\n />\n </div>\n </div>\n }\n }\n\n <!-- Workflow -->\n @if (canRenderPreview()) {\n @defer (when activeTab() === \"workflow\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'workflow'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'schema'\"\n />\n </div>\n </div>\n }\n }\n\n <!-- Discussion -->\n @if (!readOnly() && canRenderDiscussion()) {\n @defer (when activeTab() === \"discussion\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'discussion'\"\n >\n <div\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\n >\n <mt-discussion-thread\n [moduleType]=\"'ProcessRequest'\"\n [recordId]=\"resolvedRequestId()\"\n [mentionSearchEndpoint]=\"'Identity/users'\"\n [mentionSearchParam]=\"'query'\"\n [mentionSearchDataPath]=\"'data'\"\n [uploadEndpoint]=\"'uploader'\"\n [attachmentDownloadEndpoint]=\"'uploader'\"\n [showParticipants]=\"true\"\n [autoMarkRead]=\"true\"\n [refreshIntervalMs]=\"0\"\n [styleClass]=\"'h-full'\"\n />\n </div>\n </div>\n }\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: EntityPreviewBody, selector: "mt-entity-preview-body", inputs: ["data", "attachmentShape"] }], deferBlockDependencies: [() => [ClientInstancePreview], () => [import('./masterteam-work-center-work-center-process-preview-BOWFfPh5.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-BOWFfPh5.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
2698
1809
  }
2699
- i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
1810
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-BOWFfPh5.mjs').then(m => m.WorkCenterProcessPreview), import('@masterteam/discussion').then(m => m.DiscussionThread)], resolveMetadata: (WorkCenterProcessPreview, DiscussionThread) => ({ decorators: [{
2700
1811
  type: Component,
2701
1812
  args: [{ selector: 'mt-work-center-schedule-publish-type', standalone: true, imports: [
2702
1813
  CommonModule,
@@ -2706,7 +1817,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ng
2706
1817
  DiscussionThread,
2707
1818
  EntityPreviewBody,
2708
1819
  WorkCenterProcessPreview,
2709
- ], template: "<div\r\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\r\n *transloco=\"let t; prefix: 'workCenter'\"\r\n>\r\n <div\r\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\r\n >\r\n @if (tabOptions().length > 1) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n mode=\"vertical\"\r\n size=\"small\"\r\n />\r\n }\r\n\r\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\r\n <!-- Comparison -->\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'comparison'\"\r\n >\r\n <div\r\n class=\"flex h-full min-h-0 min-w-0 flex-col gap-3 lg:overflow-hidden\"\r\n >\r\n @if (loading()) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"loading.schedulePublish\") }}\r\n </p>\r\n </div>\r\n } @else if (error(); as loadError) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-red-300 bg-red-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-red-600\">\r\n {{ loadError }}\r\n </p>\r\n </div>\r\n } @else if (!summary().hasSnapshot) {\r\n <!-- Never published: nothing has been announced, so nothing can\r\n differ from it. That is a different statement from \"no changes\". -->\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"publish.neverPublished\") }}\r\n </p>\r\n </div>\r\n } @else if (!summary().needsAttention) {\r\n <!-- Not `isEmpty`: a request whose only rows are zero-diff conflict\r\n convergences is publish-empty but must still show its conflicts\r\n section rather than claim there is nothing here. -->\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ t(\"publish.nothingToPublish\") }}\r\n </p>\r\n </div>\r\n } @else {\r\n <!-- Counts stay visible while searching, so a filtered view never\r\n reads as the whole request. -->\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @if (summary().conflictCount > 0) {\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('conflict')\"\r\n >{{\r\n t(\"publish.conflictCount\", {\r\n count: summary().conflictCount,\r\n })\r\n }}</span\r\n >\r\n }\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('added')\"\r\n >{{\r\n t(\"publish.addedCount\", { count: summary().addedCount })\r\n }}</span\r\n >\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('changed')\"\r\n >{{\r\n t(\"publish.changedCount\", { count: summary().changedCount })\r\n }}</span\r\n >\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass('removed')\"\r\n >{{\r\n t(\"publish.removedCount\", { count: summary().removedCount })\r\n }}</span\r\n >\r\n </div>\r\n\r\n <input\r\n type=\"search\"\r\n class=\"w-full rounded-md border border-surface-300 bg-surface-0 px-3 py-2 text-sm outline-none focus:border-primary-400\"\r\n [placeholder]=\"t('publish.searchPlaceholder')\"\r\n [value]=\"searchText()\"\r\n (input)=\"onSearch($any($event.target).value)\"\r\n />\r\n\r\n <div\r\n class=\"min-h-0 flex-1 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n @if (searchFoundNothing()) {\r\n <div\r\n class=\"flex min-h-[12rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"text-sm text-surface-500\">\r\n {{ t(\"publish.noSearchResults\") }}\r\n </p>\r\n </div>\r\n }\r\n\r\n @for (group of groups(); track group.state) {\r\n <section class=\"mb-4\">\r\n <header class=\"mb-2 flex items-center gap-2\">\r\n <h4 class=\"text-sm font-semibold text-surface-700\">\r\n {{ groupLabel(group.state) }}\r\n </h4>\r\n <span\r\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"groupBadgeClass(group.state)\"\r\n >{{ group.totalCount }}</span\r\n >\r\n </header>\r\n\r\n @if (group.state === \"conflict\") {\r\n <!-- Informational only: unlike the planner's drawer there is\r\n no keep-mine / use-published control here. The frozen\r\n plan under approval was captured while the live plan had\r\n moved on these rows. -->\r\n <p class=\"mb-2 text-xs text-surface-500\">\r\n {{ t(\"publish.conflictHint\") }}\r\n </p>\r\n }\r\n\r\n <ul class=\"flex flex-col gap-1\">\r\n @for (row of visibleRows(group); track rowKey(row)) {\r\n <li\r\n class=\"rounded-md border border-surface-200 bg-surface-0\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full items-center gap-2 px-3 py-2 text-start\"\r\n [class.cursor-default]=\"!isExpandable(row)\"\r\n [attr.aria-expanded]=\"\r\n isExpandable(row) ? isExpanded(row) : null\r\n \"\r\n [disabled]=\"!isExpandable(row)\"\r\n (click)=\"toggleRow(row)\"\r\n >\r\n @if (isExpandable(row)) {\r\n <span\r\n class=\"shrink-0 text-xs text-surface-500\"\r\n aria-hidden=\"true\"\r\n >{{ isExpanded(row) ? \"\u25BE\" : \"\u25B8\" }}</span\r\n >\r\n } @else {\r\n <span\r\n class=\"w-3 shrink-0\"\r\n aria-hidden=\"true\"\r\n ></span>\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm text-surface-800\"\r\n >{{ row.name }}</span\r\n >\r\n @if (row.type) {\r\n <span class=\"shrink-0 text-xs text-surface-500\">{{\r\n row.type\r\n }}</span>\r\n }\r\n </button>\r\n\r\n @if (\r\n group.state === \"conflict\" &&\r\n publishedMovedFields(row).length > 0\r\n ) {\r\n <p\r\n class=\"border-t border-surface-200 px-3 py-1.5 text-xs text-orange-700\"\r\n >\r\n {{ t(\"publish.publishedSideMoved\") }}:\r\n {{ publishedMovedFields(row).join(\", \") }}\r\n </p>\r\n }\r\n\r\n @if (isExpandable(row) && isExpanded(row)) {\r\n <div\r\n class=\"flex flex-col gap-3 border-t border-surface-200 px-3 py-3\"\r\n >\r\n @for (\r\n change of changesFor(row);\r\n track change.field\r\n ) {\r\n <div class=\"flex min-w-0 flex-col gap-1\">\r\n <span\r\n class=\"text-xs font-medium text-surface-600\"\r\n >{{ fieldLabel(change.field) }}</span\r\n >\r\n <!-- Before -> After rendered locally rather than\r\n via mt-comparison-value, whose Before/After\r\n labels are hardcoded English. Each side still\r\n goes through mt-entity-preview-body, so a date\r\n renders as a date and a user as an avatar. -->\r\n <div\r\n class=\"flex w-full min-w-0 items-stretch gap-3\"\r\n >\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\r\n >{{ t(\"publish.before\") }}</span\r\n >\r\n <mt-entity-preview-body\r\n [data]=\"sideEntity(change, 'published')\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex shrink-0 items-center text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n &rarr;\r\n </div>\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\r\n >{{ t(\"publish.after\") }}</span\r\n >\r\n <mt-entity-preview-body\r\n [data]=\"sideEntity(change, 'current')\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </li>\r\n }\r\n </ul>\r\n\r\n @if (hiddenCount(group) > 0) {\r\n <!-- Said out loud: a silently truncated comparison reads as a\r\n complete one to whoever is approving it. -->\r\n <p class=\"mt-2 text-xs text-surface-500\">\r\n {{\r\n t(\"publish.hiddenRows\", { count: hiddenCount(group) })\r\n }}\r\n </p>\r\n }\r\n </section>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Project record preview. Loaded only when opened; it is a current\r\n record view, while Comparison is the frozen submitted schedule. -->\r\n @if (projectDetailsConfig(); as projectDetailsConfig) {\r\n @defer (when activeTab() === \"projectDetails\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'projectDetails'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <p class=\"mb-3 text-xs text-surface-500\">\r\n {{ t(\"publish.projectDetailsLiveNote\") }}\r\n </p>\r\n <mt-client-instance-preview [config]=\"projectDetailsConfig\" />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Approval history -->\r\n @if (canRenderPreview()) {\r\n @defer (when activeTab() === \"approvals\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'approvals'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'approvals'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Workflow -->\r\n @if (canRenderPreview()) {\r\n @defer (when activeTab() === \"workflow\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'workflow'\"\r\n >\r\n <div\r\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\r\n >\r\n <mt-work-center-process-preview\r\n [requestId]=\"requestId()\"\r\n [view]=\"'schema'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Discussion -->\r\n @if (!readOnly() && canRenderDiscussion()) {\r\n @defer (when activeTab() === \"discussion\") {\r\n <div\r\n class=\"h-full min-h-0 lg:overflow-hidden\"\r\n [hidden]=\"activeTab() !== 'discussion'\"\r\n >\r\n <div\r\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\r\n >\r\n <mt-discussion-thread\r\n [moduleType]=\"'ProcessRequest'\"\r\n [recordId]=\"resolvedRequestId()\"\r\n [mentionSearchEndpoint]=\"'Identity/users'\"\r\n [mentionSearchParam]=\"'query'\"\r\n [mentionSearchDataPath]=\"'data'\"\r\n [uploadEndpoint]=\"'uploader'\"\r\n [attachmentDownloadEndpoint]=\"'uploader'\"\r\n [showParticipants]=\"true\"\r\n [autoMarkRead]=\"true\"\r\n [refreshIntervalMs]=\"0\"\r\n [styleClass]=\"'h-full'\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
1820
+ ], template: "<div\n class=\"mt-modal-content flex h-full min-h-0 flex-col gap-4 p-4 lg:overflow-hidden\"\n *transloco=\"let t; prefix: 'workCenter'\"\n>\n <div\n class=\"flex flex-1 min-h-0 flex-col gap-4 lg:grid lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-6\"\n >\n @if (tabOptions().length > 1) {\n <mt-tabs\n [(active)]=\"activeTab\"\n [options]=\"tabOptions()\"\n mode=\"vertical\"\n size=\"small\"\n />\n }\n\n <div class=\"min-w-0 flex-1 min-h-0 lg:overflow-hidden\">\n <!-- Comparison -->\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'comparison'\"\n >\n <div\n class=\"flex h-full min-h-0 min-w-0 flex-col gap-3 lg:overflow-hidden\"\n >\n @if (loading()) {\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"loading.schedulePublish\") }}\n </p>\n </div>\n } @else if (error(); as loadError) {\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-red-300 bg-red-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-red-600\">\n {{ loadError }}\n </p>\n </div>\n } @else if (!summary().hasSnapshot) {\n <!-- Never published: nothing has been announced, so nothing can\n differ from it. That is a different statement from \"no changes\". -->\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"publish.neverPublished\") }}\n </p>\n </div>\n } @else if (!summary().needsAttention) {\n <!-- Not `isEmpty`: a request whose only rows are zero-diff conflict\n convergences is publish-empty but must still show its conflicts\n section rather than claim there is nothing here. -->\n <div\n class=\"flex min-h-[22rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"max-w-md text-center text-sm text-surface-500\">\n {{ t(\"publish.nothingToPublish\") }}\n </p>\n </div>\n } @else {\n <!-- Counts stay visible while searching, so a filtered view never\n reads as the whole request. -->\n <div class=\"flex flex-wrap items-center gap-2\">\n @if (summary().conflictCount > 0) {\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('conflict')\"\n >{{\n t(\"publish.conflictCount\", {\n count: summary().conflictCount,\n })\n }}</span\n >\n }\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('added')\"\n >{{\n t(\"publish.addedCount\", { count: summary().addedCount })\n }}</span\n >\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('changed')\"\n >{{\n t(\"publish.changedCount\", { count: summary().changedCount })\n }}</span\n >\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass('removed')\"\n >{{\n t(\"publish.removedCount\", { count: summary().removedCount })\n }}</span\n >\n </div>\n\n <input\n type=\"search\"\n class=\"w-full rounded-md border border-surface-300 bg-surface-0 px-3 py-2 text-sm outline-none focus:border-primary-400\"\n [placeholder]=\"t('publish.searchPlaceholder')\"\n [value]=\"searchText()\"\n (input)=\"onSearch($any($event.target).value)\"\n />\n\n <div\n class=\"min-h-0 flex-1 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n @if (searchFoundNothing()) {\n <div\n class=\"flex min-h-[12rem] items-center justify-center rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6\"\n >\n <p class=\"text-sm text-surface-500\">\n {{ t(\"publish.noSearchResults\") }}\n </p>\n </div>\n }\n\n @for (group of groups(); track group.state) {\n <section class=\"mb-4\">\n <header class=\"mb-2 flex items-center gap-2\">\n <h4 class=\"text-sm font-semibold text-surface-700\">\n {{ groupLabel(group.state) }}\n </h4>\n <span\n class=\"rounded-full px-2 py-0.5 text-xs font-medium\"\n [class]=\"groupBadgeClass(group.state)\"\n >{{ group.totalCount }}</span\n >\n </header>\n\n @if (group.state === \"conflict\") {\n <!-- Informational only: unlike the planner's drawer there is\n no keep-mine / use-published control here. The frozen\n plan under approval was captured while the live plan had\n moved on these rows. -->\n <p class=\"mb-2 text-xs text-surface-500\">\n {{ t(\"publish.conflictHint\") }}\n </p>\n }\n\n <ul class=\"flex flex-col gap-1\">\n @for (row of visibleRows(group); track rowKey(row)) {\n <li\n class=\"rounded-md border border-surface-200 bg-surface-0\"\n >\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-2 px-3 py-2 text-start\"\n [class.cursor-default]=\"!isExpandable(row)\"\n [attr.aria-expanded]=\"\n isExpandable(row) ? isExpanded(row) : null\n \"\n [disabled]=\"!isExpandable(row)\"\n (click)=\"toggleRow(row)\"\n >\n @if (isExpandable(row)) {\n <span\n class=\"shrink-0 text-xs text-surface-500\"\n aria-hidden=\"true\"\n >{{ isExpanded(row) ? \"\u25BE\" : \"\u25B8\" }}</span\n >\n } @else {\n <span\n class=\"w-3 shrink-0\"\n aria-hidden=\"true\"\n ></span>\n }\n <span\n class=\"min-w-0 flex-1 truncate text-sm text-surface-800\"\n >{{ row.name }}</span\n >\n @if (row.type) {\n <span class=\"shrink-0 text-xs text-surface-500\">{{\n row.type\n }}</span>\n }\n </button>\n\n @if (\n group.state === \"conflict\" &&\n publishedMovedFields(row).length > 0\n ) {\n <p\n class=\"border-t border-surface-200 px-3 py-1.5 text-xs text-orange-700\"\n >\n {{ t(\"publish.publishedSideMoved\") }}:\n {{ publishedMovedFields(row).join(\", \") }}\n </p>\n }\n\n @if (isExpandable(row) && isExpanded(row)) {\n <div\n class=\"flex flex-col gap-3 border-t border-surface-200 px-3 py-3\"\n >\n @for (\n change of changesFor(row);\n track change.field\n ) {\n <div class=\"flex min-w-0 flex-col gap-1\">\n <span\n class=\"text-xs font-medium text-surface-600\"\n >{{ fieldLabel(change.field) }}</span\n >\n <!-- Before -> After rendered locally rather than\n via mt-comparison-value, whose Before/After\n labels are hardcoded English. Each side still\n goes through mt-entity-preview-body, so a date\n renders as a date and a user as an avatar. -->\n <div\n class=\"flex w-full min-w-0 items-stretch gap-3\"\n >\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span\n class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\n >{{ t(\"publish.before\") }}</span\n >\n <mt-entity-preview-body\n [data]=\"sideEntity(change, 'published')\"\n />\n </div>\n <div\n class=\"flex shrink-0 items-center text-muted-color\"\n aria-hidden=\"true\"\n >\n &rarr;\n </div>\n <div\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\n >\n <span\n class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\n >{{ t(\"publish.after\") }}</span\n >\n <mt-entity-preview-body\n [data]=\"sideEntity(change, 'current')\"\n />\n </div>\n </div>\n </div>\n }\n </div>\n }\n </li>\n }\n </ul>\n\n @if (hiddenCount(group) > 0) {\n <!-- Said out loud: a silently truncated comparison reads as a\n complete one to whoever is approving it. -->\n <p class=\"mt-2 text-xs text-surface-500\">\n {{\n t(\"publish.hiddenRows\", { count: hiddenCount(group) })\n }}\n </p>\n }\n </section>\n }\n </div>\n }\n </div>\n </div>\n\n <!-- Project record preview. Loaded only when opened; it is a current\n record view, while Comparison is the frozen submitted schedule. -->\n @if (projectDetailsConfig(); as projectDetailsConfig) {\n @defer (when activeTab() === \"projectDetails\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'projectDetails'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <p class=\"mb-3 text-xs text-surface-500\">\n {{ t(\"publish.projectDetailsLiveNote\") }}\n </p>\n <mt-client-instance-preview [config]=\"projectDetailsConfig\" />\n </div>\n </div>\n }\n }\n\n <!-- Approval history -->\n @if (canRenderPreview()) {\n @defer (when activeTab() === \"approvals\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'approvals'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'approvals'\"\n />\n </div>\n </div>\n }\n }\n\n <!-- Workflow -->\n @if (canRenderPreview()) {\n @defer (when activeTab() === \"workflow\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'workflow'\"\n >\n <div\n class=\"min-w-0 h-full min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pr-2\"\n >\n <mt-work-center-process-preview\n [requestId]=\"requestId()\"\n [view]=\"'schema'\"\n />\n </div>\n </div>\n }\n }\n\n <!-- Discussion -->\n @if (!readOnly() && canRenderDiscussion()) {\n @defer (when activeTab() === \"discussion\") {\n <div\n class=\"h-full min-h-0 lg:overflow-hidden\"\n [hidden]=\"activeTab() !== 'discussion'\"\n >\n <div\n class=\"h-[32rem] min-h-[22rem] overflow-hidden rounded-lg border border-surface-200 bg-surface-50 lg:h-full lg:min-h-0\"\n >\n <mt-discussion-thread\n [moduleType]=\"'ProcessRequest'\"\n [recordId]=\"resolvedRequestId()\"\n [mentionSearchEndpoint]=\"'Identity/users'\"\n [mentionSearchParam]=\"'query'\"\n [mentionSearchDataPath]=\"'data'\"\n [uploadEndpoint]=\"'uploader'\"\n [attachmentDownloadEndpoint]=\"'uploader'\"\n [showParticipants]=\"true\"\n [autoMarkRead]=\"true\"\n [refreshIntervalMs]=\"0\"\n [styleClass]=\"'h-full'\"\n />\n </div>\n </div>\n }\n }\n </div>\n </div>\n</div>\n" }]
2710
1821
  }], ctorParameters: () => [], propDecorators: { details: [{ type: i0.Input, args: [{ isSignal: true, alias: "details", required: true }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }] } }) });
2711
1822
  /**
2712
1823
  * The comparison arrives on the response root, but several runtime endpoints
@@ -3706,13 +2817,13 @@ class WorkCenterItemModalFooterActions {
3706
2817
  };
3707
2818
  }
3708
2819
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalFooterActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
3709
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterItemModalFooterActions, isStandalone: true, selector: "mt-work-center-item-modal-footer-actions", inputs: { contextKey: { classPropertyName: "contextKey", publicName: "contextKey", isSignal: true, isRequired: false, transformFunction: null }, previewLevelTarget: { classPropertyName: "previewLevelTarget", publicName: "previewLevelTarget", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionExecuted: "actionExecuted", itemUnavailable: "itemUnavailable", previewLevelSelected: "previewLevelSelected", visibilityChange: "visibilityChange" }, host: { classAttribute: "flex w-full flex-1 flex-wrap items-center justify-end gap-2" }, providers: [WorkCenterActionFormValidator, WorkCenterRuntimeActionExecutor], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\r\n @if (shouldRender()) {\r\n @if (loading() && !displayActions().length) {\r\n <span class=\"me-auto text-sm text-surface-500\">{{\r\n t(\"modal.loadingActions\")\r\n }}</span>\r\n }\r\n\r\n @if (previewLevelTarget(); as previewLevelTarget) {\r\n <mt-button\r\n [label]=\"previewLevelLabel(previewLevelTarget, t)\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n [disabled]=\"loading() || !!pendingActionKey()\"\r\n (onClick)=\"previewLevelSelected.emit(previewLevelTarget)\"\r\n />\r\n }\r\n\r\n @for (action of displayActions(); track action.actionKey + action.url) {\r\n <mt-button\r\n [label]=\"action.label\"\r\n [severity]=\"action.severity\"\r\n [variant]=\"action.variant\"\r\n [disabled]=\"\r\n loading() || !!pendingActionKey() || action.blockedByContent\r\n \"\r\n [tooltip]=\"\r\n action.blockedByContent\r\n ? (incompleteReason() ?? t('actions.completeRequiredFields'))\r\n : ''\r\n \"\r\n [loading]=\"pendingActionKey() === action.actionKey\"\r\n (onClick)=\"executeAction(action)\"\r\n />\r\n }\r\n }\r\n</ng-container>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { 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"] }] });
2820
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterItemModalFooterActions, isStandalone: true, selector: "mt-work-center-item-modal-footer-actions", inputs: { contextKey: { classPropertyName: "contextKey", publicName: "contextKey", isSignal: true, isRequired: false, transformFunction: null }, previewLevelTarget: { classPropertyName: "previewLevelTarget", publicName: "previewLevelTarget", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionExecuted: "actionExecuted", itemUnavailable: "itemUnavailable", previewLevelSelected: "previewLevelSelected", visibilityChange: "visibilityChange" }, host: { classAttribute: "flex w-full flex-1 flex-wrap items-center justify-end gap-2" }, providers: [WorkCenterActionFormValidator, WorkCenterRuntimeActionExecutor], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\n @if (shouldRender()) {\n @if (loading() && !displayActions().length) {\n <span class=\"me-auto text-sm text-surface-500\">{{\n t(\"modal.loadingActions\")\n }}</span>\n }\n\n @if (previewLevelTarget(); as previewLevelTarget) {\n <mt-button\n [label]=\"previewLevelLabel(previewLevelTarget, t)\"\n severity=\"secondary\"\n variant=\"outlined\"\n [disabled]=\"loading() || !!pendingActionKey()\"\n (onClick)=\"previewLevelSelected.emit(previewLevelTarget)\"\n />\n }\n\n @for (action of displayActions(); track action.actionKey + action.url) {\n <mt-button\n [label]=\"action.label\"\n [severity]=\"action.severity\"\n [variant]=\"action.variant\"\n [disabled]=\"\n loading() || !!pendingActionKey() || action.blockedByContent\n \"\n [tooltip]=\"\n action.blockedByContent\n ? (incompleteReason() ?? t('actions.completeRequiredFields'))\n : ''\n \"\n [loading]=\"pendingActionKey() === action.actionKey\"\n (onClick)=\"executeAction(action)\"\n />\n }\n }\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { 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"] }] });
3710
2821
  }
3711
2822
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterItemModalFooterActions, decorators: [{
3712
2823
  type: Component,
3713
2824
  args: [{ selector: 'mt-work-center-item-modal-footer-actions', standalone: true, imports: [CommonModule, TranslocoDirective, Button], host: {
3714
2825
  class: 'flex w-full flex-1 flex-wrap items-center justify-end gap-2',
3715
- }, providers: [WorkCenterActionFormValidator, WorkCenterRuntimeActionExecutor], template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\r\n @if (shouldRender()) {\r\n @if (loading() && !displayActions().length) {\r\n <span class=\"me-auto text-sm text-surface-500\">{{\r\n t(\"modal.loadingActions\")\r\n }}</span>\r\n }\r\n\r\n @if (previewLevelTarget(); as previewLevelTarget) {\r\n <mt-button\r\n [label]=\"previewLevelLabel(previewLevelTarget, t)\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n [disabled]=\"loading() || !!pendingActionKey()\"\r\n (onClick)=\"previewLevelSelected.emit(previewLevelTarget)\"\r\n />\r\n }\r\n\r\n @for (action of displayActions(); track action.actionKey + action.url) {\r\n <mt-button\r\n [label]=\"action.label\"\r\n [severity]=\"action.severity\"\r\n [variant]=\"action.variant\"\r\n [disabled]=\"\r\n loading() || !!pendingActionKey() || action.blockedByContent\r\n \"\r\n [tooltip]=\"\r\n action.blockedByContent\r\n ? (incompleteReason() ?? t('actions.completeRequiredFields'))\r\n : ''\r\n \"\r\n [loading]=\"pendingActionKey() === action.actionKey\"\r\n (onClick)=\"executeAction(action)\"\r\n />\r\n }\r\n }\r\n</ng-container>\r\n" }]
2826
+ }, providers: [WorkCenterActionFormValidator, WorkCenterRuntimeActionExecutor], template: "<ng-container *transloco=\"let t; prefix: 'workCenter'\">\n @if (shouldRender()) {\n @if (loading() && !displayActions().length) {\n <span class=\"me-auto text-sm text-surface-500\">{{\n t(\"modal.loadingActions\")\n }}</span>\n }\n\n @if (previewLevelTarget(); as previewLevelTarget) {\n <mt-button\n [label]=\"previewLevelLabel(previewLevelTarget, t)\"\n severity=\"secondary\"\n variant=\"outlined\"\n [disabled]=\"loading() || !!pendingActionKey()\"\n (onClick)=\"previewLevelSelected.emit(previewLevelTarget)\"\n />\n }\n\n @for (action of displayActions(); track action.actionKey + action.url) {\n <mt-button\n [label]=\"action.label\"\n [severity]=\"action.severity\"\n [variant]=\"action.variant\"\n [disabled]=\"\n loading() || !!pendingActionKey() || action.blockedByContent\n \"\n [tooltip]=\"\n action.blockedByContent\n ? (incompleteReason() ?? t('actions.completeRequiredFields'))\n : ''\n \"\n [loading]=\"pendingActionKey() === action.actionKey\"\n (onClick)=\"executeAction(action)\"\n />\n }\n }\n</ng-container>\n" }]
3716
2827
  }], ctorParameters: () => [], propDecorators: { contextKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextKey", required: false }] }], previewLevelTarget: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewLevelTarget", required: false }] }], actionExecuted: [{ type: i0.Output, args: ["actionExecuted"] }], itemUnavailable: [{ type: i0.Output, args: ["itemUnavailable"] }], previewLevelSelected: [{ type: i0.Output, args: ["previewLevelSelected"] }], visibilityChange: [{ type: i0.Output, args: ["visibilityChange"] }] } });
3717
2828
  // Only the actions that commit the edited values wait on the form being
3718
2829
  // locally valid. A negative outcome — reject, return, terminate — has to stay
@@ -3866,52 +2977,6 @@ function resolveHttpErrorMessage(error, fallback) {
3866
2977
  return httpError.error?.message ?? httpError.message ?? fallback;
3867
2978
  }
3868
2979
 
3869
- // Context keys contain `/`; keep them in one route segment without `%2F`/`%25`.
3870
- const ROUTE_CONTEXT_KEY_PREFIX = 'wc1.';
3871
- const HEX_PAIR_PATTERN = /^[\da-f]{2}$/i;
3872
- function encodeWorkCenterRouteContextKey(contextKey) {
3873
- const encoded = encodeURIComponent(contextKey);
3874
- let hex = '';
3875
- for (let index = 0; index < encoded.length; index += 1) {
3876
- if (encoded[index] === '%') {
3877
- hex += encoded.slice(index + 1, index + 3).toLowerCase();
3878
- index += 2;
3879
- continue;
3880
- }
3881
- hex += encoded.charCodeAt(index).toString(16).padStart(2, '0');
3882
- }
3883
- return `${ROUTE_CONTEXT_KEY_PREFIX}${hex}`;
3884
- }
3885
- function decodeWorkCenterRouteContextKey(value) {
3886
- if (!value) {
3887
- return null;
3888
- }
3889
- if (value.startsWith(ROUTE_CONTEXT_KEY_PREFIX)) {
3890
- return decodeRouteSafeContextKey(value.slice(ROUTE_CONTEXT_KEY_PREFIX.length));
3891
- }
3892
- try {
3893
- return decodeURIComponent(value);
3894
- }
3895
- catch {
3896
- return value;
3897
- }
3898
- }
3899
- function decodeRouteSafeContextKey(hex) {
3900
- if (hex.length % 2 !== 0) {
3901
- return null;
3902
- }
3903
- const parts = hex.match(/.{2}/g) ?? [];
3904
- if (parts.some((part) => !HEX_PAIR_PATTERN.test(part))) {
3905
- return null;
3906
- }
3907
- try {
3908
- return decodeURIComponent(parts.map((part) => `%${part.toUpperCase()}`).join(''));
3909
- }
3910
- catch {
3911
- return null;
3912
- }
3913
- }
3914
-
3915
2980
  // The drawer is absolute inside the host's page column, so its width is a share
3916
2981
  // of that column (%), not of the viewport (vw): a shell pane docked beside the
3917
2982
  // page (the Faris chat, an expanded nav) narrows the column, and a vw width
@@ -4200,115 +3265,6 @@ function normalizeCardKey(value) {
4200
3265
  .replace(/[\s_-]/g, '')
4201
3266
  .toLowerCase();
4202
3267
  }
4203
- /**
4204
- * Strips the user envelope used by `mt-table` user filters down to the
4205
- * scalar id that the BE rule payload accepts. Falls back to the original
4206
- * value for non-user shapes (e.g. simple string in a select filter).
4207
- */
4208
- function extractIdScalar(value) {
4209
- if (value !== null &&
4210
- typeof value === 'object' &&
4211
- 'id' in value) {
4212
- return value['id'];
4213
- }
4214
- return value;
4215
- }
4216
- function toIsoDate(value) {
4217
- if (value instanceof Date)
4218
- return value.toISOString();
4219
- return value;
4220
- }
4221
- /**
4222
- * Translates one in-table column filter value into a `WorkCenterFilterRule`.
4223
- *
4224
- * The shape of `raw` depends on the column's filter type — see
4225
- * `mt-table` `table-filter-field` outputs:
4226
- * - text → string → `Contains`
4227
- * - select → scalar | scalar[] → `Eq` | `In`
4228
- * - boolean → boolean → `Eq`
4229
- * - date → `{ from?, to?, value? }` (Date|null)→ `Between`/`Gte`/`Lte`/`Eq`
4230
- * - user → `{ id, ... }` | `{ id, ... }[]` → `Eq` (id) | `In` (ids)
4231
- *
4232
- * Returns `null` when the value is empty / nothing to send.
4233
- */
4234
- function toRuntimeFilterRule(field, raw, column) {
4235
- if (raw === null || raw === undefined || raw === '')
4236
- return null;
4237
- if (typeof raw === 'boolean') {
4238
- return { field, op: 'Eq', value: raw };
4239
- }
4240
- if (typeof raw === 'number') {
4241
- return { field, op: 'Eq', value: raw };
4242
- }
4243
- if (typeof raw === 'string') {
4244
- if (!raw.trim().length)
4245
- return null;
4246
- return { field, op: 'Contains', value: raw };
4247
- }
4248
- if (Array.isArray(raw)) {
4249
- const values = raw
4250
- .map(extractIdScalar)
4251
- .filter((v) => v !== null && v !== undefined && v !== '');
4252
- if (!values.length)
4253
- return null;
4254
- return { field, op: 'In', values };
4255
- }
4256
- if (typeof raw === 'object') {
4257
- const obj = raw;
4258
- // User filter envelope -> single-id Eq.
4259
- if (obj.id !== undefined && obj.id !== null && obj.id !== '') {
4260
- return { field, op: 'Eq', value: obj.id };
4261
- }
4262
- const hasFrom = obj.from !== undefined && obj.from !== null;
4263
- const hasTo = obj.to !== undefined && obj.to !== null;
4264
- if (hasFrom && hasTo) {
4265
- return {
4266
- field,
4267
- op: 'Between',
4268
- from: toIsoDate(obj.from),
4269
- to: toIsoDate(obj.to),
4270
- };
4271
- }
4272
- if (hasFrom) {
4273
- return { field, op: 'Gte', value: toIsoDate(obj.from) };
4274
- }
4275
- if (hasTo) {
4276
- return { field, op: 'Lte', value: toIsoDate(obj.to) };
4277
- }
4278
- if (obj.value !== undefined && obj.value !== null && obj.value !== '') {
4279
- const treatAsContains = column?.type === 'text' ||
4280
- (column?.filterConfig?.type === 'text' &&
4281
- typeof obj.value === 'string');
4282
- if (treatAsContains) {
4283
- return { field, op: 'Contains', value: obj.value };
4284
- }
4285
- return { field, op: 'Eq', value: extractIdScalar(obj.value) };
4286
- }
4287
- }
4288
- return null;
4289
- }
4290
- /**
4291
- * Walks `mt-table`'s filter map and produces the `WorkCenterFilterRule[]`
4292
- * sent on the BE column-filter slice. The synthetic `generalSearch` key is
4293
- * skipped because the page keeps general search local-only.
4294
- */
4295
- function buildColumnRuntimeFilters(filters, columns, allowedFields) {
4296
- if (!filters)
4297
- return [];
4298
- const allowed = allowedFields && allowedFields.length ? new Set(allowedFields) : null;
4299
- const columnByKey = new Map(columns.map((col) => [col.key, col]));
4300
- const rules = [];
4301
- for (const [key, raw] of Object.entries(filters)) {
4302
- if (key === 'generalSearch')
4303
- continue;
4304
- if (allowed && !allowed.has(key))
4305
- continue;
4306
- const rule = toRuntimeFilterRule(key, raw, columnByKey.get(key));
4307
- if (rule)
4308
- rules.push(rule);
4309
- }
4310
- return rules;
4311
- }
4312
3268
  function areFilterRulesEqual(left, right) {
4313
3269
  return JSON.stringify(left) === JSON.stringify(right);
4314
3270
  }
@@ -4396,7 +3352,6 @@ class WorkCenterPage {
4396
3352
  groupChanged = output();
4397
3353
  context = this.facade.context;
4398
3354
  headerFilters = this.facade.headerFilters;
4399
- tableFilters = signal({}, ...(ngDevMode ? [{ debugName: "tableFilters" }] : /* istanbul ignore next */ []));
4400
3355
  selectedItemContextKey = signal(null, ...(ngDevMode ? [{ debugName: "selectedItemContextKey" }] : /* istanbul ignore next */ []));
4401
3356
  _menuItems = this.facade.menuItems;
4402
3357
  menuItems = computed(() => {
@@ -4428,21 +3383,6 @@ class WorkCenterPage {
4428
3383
  columnFilters = this.facade.columnFilters;
4429
3384
  loading = this.facade.loading;
4430
3385
  groupBy = this.facade.groupBy;
4431
- /**
4432
- * Sort and grouping live in the runtime query (and the host's URL), not in
4433
- * table storage — persisting them locally would let a restored table claim a
4434
- * grouping the backend query no longer has. Stable reference: a fresh array
4435
- * per change detection would re-run the table's persistence effect.
4436
- */
4437
- persistStateExclude = [
4438
- 'pagePosition',
4439
- 'sort',
4440
- 'groupBy',
4441
- ];
4442
- tableColumns = computed(() => this.columns().map((column) => ({
4443
- ...column,
4444
- sortable: true,
4445
- })), ...(ngDevMode ? [{ debugName: "tableColumns" }] : /* istanbul ignore next */ []));
4446
3386
  /**
4447
3387
  * Grouping is executed by the backend as a single sort, so the table's own
4448
3388
  * sort state is driven from the query we actually sent instead of the
@@ -4535,7 +3475,6 @@ class WorkCenterPage {
4535
3475
  }
4536
3476
  // The store drops the previous card's filters and grouping; the table's
4537
3477
  // own filter chips live here, so they have to be cleared alongside.
4538
- this.tableFilters.set({});
4539
3478
  this.facade.selectCardAndLoad(this.area(), item.key);
4540
3479
  this.cardSelected.emit(item.key);
4541
3480
  this.groupChanged.emit(null);
@@ -4555,7 +3494,6 @@ class WorkCenterPage {
4555
3494
  }
4556
3495
  onRuntimeFiltersCleared() {
4557
3496
  this.facade.clearAllFiltersAndLoad(this.area());
4558
- this.tableFilters.set({});
4559
3497
  this.runtimeFiltersChanged.emit([]);
4560
3498
  }
4561
3499
  /**
@@ -4595,18 +3533,11 @@ class WorkCenterPage {
4595
3533
  this.groupChanged.emit(nextGroup);
4596
3534
  this.emitSortIfChanged(previousSort);
4597
3535
  }
4598
- onTableLazyLoad(event) {
4599
- const schema = this.runtimeFilterSchema();
4600
- const propertyKeys = (schema?.properties ?? [])
4601
- .map((p) => p?.key)
4602
- .filter((k) => typeof k === 'string' && k.length > 0);
4603
- const allowedKeys = schema?.allowedFields ?? [];
4604
- const allowedFields = propertyKeys.length ? propertyKeys : allowedKeys;
4605
- const nextColumnFilters = buildColumnRuntimeFilters(event?.filters, this.columns(), allowedFields.length ? allowedFields : undefined);
4606
- if (!areFilterRulesEqual(nextColumnFilters, this.columnFilters())) {
4607
- this.facade.applyColumnFiltersAndLoad(this.area(), nextColumnFilters);
4608
- return;
4609
- }
3536
+ onGridFiltersChange(filters) {
3537
+ if (!areFilterRulesEqual(filters, this.columnFilters()))
3538
+ this.facade.applyColumnFiltersAndLoad(this.area(), filters);
3539
+ }
3540
+ onGridQueryChange(event) {
4610
3541
  const previousSort = this.facade.snapshotContext().sort;
4611
3542
  this.facade.applyTableLazyLoadAndLoad(this.area(), event);
4612
3543
  this.emitSortIfChanged(previousSort);
@@ -4705,7 +3636,7 @@ class WorkCenterPage {
4705
3636
  return normalized.length ? normalized : null;
4706
3637
  }
4707
3638
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
4708
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterPage, isStandalone: true, selector: "mt-work-center-page", inputs: { area: { classPropertyName: "area", publicName: "area", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, menuIcon: { classPropertyName: "menuIcon", publicName: "menuIcon", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, showSidebar: { classPropertyName: "showSidebar", publicName: "showSidebar", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, bootstrapInputs: { classPropertyName: "bootstrapInputs", publicName: "bootstrapInputs", isSignal: true, isRequired: false, transformFunction: null }, openItemDrawer: { classPropertyName: "openItemDrawer", publicName: "openItemDrawer", isSignal: true, isRequired: false, transformFunction: null }, itemReadOnly: { classPropertyName: "itemReadOnly", publicName: "itemReadOnly", isSignal: true, isRequired: false, transformFunction: null }, openItemsInModal: { classPropertyName: "openItemsInModal", publicName: "openItemsInModal", isSignal: true, isRequired: false, transformFunction: null }, itemModal: { classPropertyName: "itemModal", publicName: "itemModal", isSignal: true, isRequired: false, transformFunction: null }, generalTaskModal: { classPropertyName: "generalTaskModal", publicName: "generalTaskModal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { runtimeFiltersChanged: "runtimeFiltersChanged", itemClicked: "itemClicked", cardSelected: "cardSelected", sortChanged: "sortChanged", groupChanged: "groupChanged" }, ngImport: i0, template: "<ng-template #headerActions>\r\n <div class=\"flex flex-wrap items-center justify-end gap-2\">\r\n <mt-property-filter-builder\r\n [schema]=\"propertyFilterSchema()\"\r\n [filters]=\"headerFilters()\"\r\n (applied)=\"onRuntimeFiltersApplied($event)\"\r\n (cleared)=\"onRuntimeFiltersCleared()\"\r\n />\r\n\r\n @if (showGeneralTaskCreateButton()) {\r\n <mt-button\r\n [label]=\"generalTaskButtonLabel()\"\r\n [icon]=\"generalTaskButtonIcon()\"\r\n size=\"small\"\r\n (onClick)=\"onGeneralTaskCreateClick()\"\r\n />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #pageContent>\r\n <div class=\"flex flex-col gap-8\">\r\n @if (loading()) {\r\n <div\r\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\r\n >\r\n @for (_ of [1, 2, 3, 4, 5]; track $index) {\r\n <p-skeleton height=\"6.5rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n } @else if (kpis().length) {\r\n <div class=\"gap-3 flex flex-wrap\">\r\n @for (kpi of kpis(); track $index) {\r\n <mt-statistic-card [data]=\"kpi\" class=\"min-w-[200px]\" />\r\n }\r\n </div>\r\n }\r\n\r\n <mt-table\r\n noCard\r\n [data]=\"rows()\"\r\n [columns]=\"tableColumns()\"\r\n tableLayout=\"auto\"\r\n [clickableRows]=\"rowsClickable()\"\r\n [loading]=\"loading()\"\r\n [showFilters]=\"true\"\r\n filterMode=\"column\"\r\n [cellClickFilter]=\"true\"\r\n [generalSearch]=\"true\"\r\n [exportable]=\"true\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [freezeActions]=\"true\"\r\n [lazy]=\"true\"\r\n [lazyLocalSearch]=\"true\"\r\n [lazyTotalRecords]=\"totalCount()\"\r\n [pageSize]=\"context().pageSize\"\r\n [currentPage]=\"context().page - 1\"\r\n [first]=\"(context().page - 1) * context().pageSize\"\r\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\r\n [groupCountMap]=\"groupCountMap()\"\r\n [groupBy]=\"groupBy()\"\r\n [sortField]=\"sortField()\"\r\n [sortDirection]=\"sortDirection()\"\r\n storageKey=\"work-center-page-table\"\r\n [persistStateExclude]=\"persistStateExclude\"\r\n [filters]=\"tableFilters()\"\r\n [externalFiltersActive]=\"headerFilters().length > 0\"\r\n (filtersChange)=\"tableFilters.set($event)\"\r\n (filtersCleared)=\"onEmptyStateFiltersCleared()\"\r\n (groupByChange)=\"onTableGroupByChange($event)\"\r\n (lazyLoad)=\"onTableLazyLoad($event)\"\r\n (rowClick)=\"onRowClick($event)\"\r\n />\r\n </div>\r\n</ng-template>\r\n\r\n@if (showSidebar()) {\r\n <mt-client-page\r\n [menuIcon]=\"menuIcon()\"\r\n [menuTitle]=\"resolvedPageTitle()\"\r\n [menuItems]=\"menuItems()\"\r\n [menuItemsLoading]=\"loading() && !menuItems().length\"\r\n [activeItem]=\"context().selectedCardKey ?? undefined\"\r\n (menuItemClick)=\"onMenuItemClick($event)\"\r\n >\r\n <ng-template #headerClientPageEnd>\r\n @if (showHeader()) {\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n }\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </mt-client-page>\r\n} @else {\r\n <div class=\"flex h-full min-h-0 flex-col bg-surface-0\">\r\n @if (showHeader()) {\r\n <div\r\n class=\"flex shrink-0 items-center justify-end border-b border-surface px-7 py-4\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n </div>\r\n }\r\n <div class=\"min-h-0 flex-1 overflow-y-auto px-7 py-5\">\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </div>\r\n </div>\r\n}\r\n\r\n@if (selectedItemContextKey(); as contextKey) {\r\n <mt-work-center-item-modal-route\r\n [contextKey]=\"contextKey\"\r\n [manageRouteOutlet]=\"false\"\r\n [showPreviewLevelAction]=\"false\"\r\n [readOnly]=\"itemReadOnly()\"\r\n appendTo=\"body\"\r\n drawerStyleClass=\"mt-work-center-item-drawer !w-[90vw]\"\r\n (closed)=\"selectedItemContextKey.set(null)\"\r\n />\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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: ClientPage, selector: "mt-client-page", inputs: ["menuIcon", "menuTitle", "menuItems", "menuItemsLoading", "showExpandIcon", "activeItem", "collapsed", "resizable", "storageKey", "storageMode", "minSidebarWidth", "maxSidebarWidth", "defaultSidebarWidth"], outputs: ["collapsedChange", "menuItemClick", "loadChildren"] }, { kind: "component", type: PropertyFilterBuilder, selector: "mt-property-filter-builder", inputs: ["schema", "filters", "title", "buttonLabel", "disabled"], outputs: ["filtersChange", "applied", "cleared"] }, { kind: "component", type: StatisticCard, selector: "mt-statistic-card", inputs: ["data", "cardClass"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "filterCloseOnOutsideClick", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "externalFiltersActive", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "filtersCleared", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: WorkCenterItemModalRoute, selector: "mt-work-center-item-modal-route", inputs: ["contextKey", "manageRouteOutlet", "showPreviewLevelAction", "readOnly", "appendTo", "drawerStyleClass"], outputs: ["previewLevel", "closed"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i1$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
3639
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterPage, isStandalone: true, selector: "mt-work-center-page", inputs: { area: { classPropertyName: "area", publicName: "area", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, menuIcon: { classPropertyName: "menuIcon", publicName: "menuIcon", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, showSidebar: { classPropertyName: "showSidebar", publicName: "showSidebar", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, bootstrapInputs: { classPropertyName: "bootstrapInputs", publicName: "bootstrapInputs", isSignal: true, isRequired: false, transformFunction: null }, openItemDrawer: { classPropertyName: "openItemDrawer", publicName: "openItemDrawer", isSignal: true, isRequired: false, transformFunction: null }, itemReadOnly: { classPropertyName: "itemReadOnly", publicName: "itemReadOnly", isSignal: true, isRequired: false, transformFunction: null }, openItemsInModal: { classPropertyName: "openItemsInModal", publicName: "openItemsInModal", isSignal: true, isRequired: false, transformFunction: null }, itemModal: { classPropertyName: "itemModal", publicName: "itemModal", isSignal: true, isRequired: false, transformFunction: null }, generalTaskModal: { classPropertyName: "generalTaskModal", publicName: "generalTaskModal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { runtimeFiltersChanged: "runtimeFiltersChanged", itemClicked: "itemClicked", cardSelected: "cardSelected", sortChanged: "sortChanged", groupChanged: "groupChanged" }, ngImport: i0, template: "<ng-template #headerActions>\r\n <div class=\"flex flex-wrap items-center justify-end gap-2\">\r\n <mt-property-filter-builder\r\n [schema]=\"propertyFilterSchema()\"\r\n [filters]=\"headerFilters()\"\r\n (applied)=\"onRuntimeFiltersApplied($event)\"\r\n (cleared)=\"onRuntimeFiltersCleared()\"\r\n />\r\n\r\n @if (showGeneralTaskCreateButton()) {\r\n <mt-button\r\n [label]=\"generalTaskButtonLabel()\"\r\n [icon]=\"generalTaskButtonIcon()\"\r\n size=\"small\"\r\n (onClick)=\"onGeneralTaskCreateClick()\"\r\n />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #pageContent>\r\n <div class=\"flex flex-col gap-8\">\r\n @if (loading()) {\r\n <div\r\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\r\n >\r\n @for (_ of [1, 2, 3, 4, 5]; track $index) {\r\n <p-skeleton height=\"6.5rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n } @else if (kpis().length) {\r\n <div class=\"gap-3 flex flex-wrap\">\r\n @for (kpi of kpis(); track $index) {\r\n <mt-statistic-card [data]=\"kpi\" class=\"min-w-[200px]\" />\r\n }\r\n </div>\r\n }\r\n\r\n <mt-work-center-grid\r\n [rows]=\"rows()\"\r\n [columns]=\"columns()\"\r\n [context]=\"context()\"\r\n [schema]=\"runtimeFilterSchema()\"\r\n [group]=\"groupBy()\"\r\n [groupCounts]=\"groupCountMap()\"\r\n [filterRules]=\"columnFilters()\"\r\n [total]=\"totalCount()\"\r\n [label]=\"resolvedPageTitle()\"\r\n [viewKey]=\"'work-center:' + area() + ':' + context().selectedCardKey\"\r\n [loading]=\"loading()\"\r\n (filtersChange)=\"onGridFiltersChange($event)\"\r\n (groupChange)=\"onTableGroupByChange($event)\"\r\n (queryChange)=\"onGridQueryChange($event)\"\r\n (rowClick)=\"rowsClickable() && onRowClick($event)\"\r\n />\r\n </div>\r\n</ng-template>\r\n\r\n@if (showSidebar()) {\r\n <mt-client-page\r\n [menuIcon]=\"menuIcon()\"\r\n [menuTitle]=\"resolvedPageTitle()\"\r\n [menuItems]=\"menuItems()\"\r\n [menuItemsLoading]=\"loading() && !menuItems().length\"\r\n [activeItem]=\"context().selectedCardKey ?? undefined\"\r\n (menuItemClick)=\"onMenuItemClick($event)\"\r\n >\r\n <ng-template #headerClientPageEnd>\r\n @if (showHeader()) {\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n }\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </mt-client-page>\r\n} @else {\r\n <div class=\"flex h-full min-h-0 flex-col bg-surface-0\">\r\n @if (showHeader()) {\r\n <div\r\n class=\"flex shrink-0 items-center justify-end border-b border-surface px-7 py-4\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n </div>\r\n }\r\n <div class=\"min-h-0 flex-1 overflow-y-auto px-7 py-5\">\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </div>\r\n </div>\r\n}\r\n\r\n@if (selectedItemContextKey(); as contextKey) {\r\n <mt-work-center-item-modal-route\r\n [contextKey]=\"contextKey\"\r\n [manageRouteOutlet]=\"false\"\r\n [showPreviewLevelAction]=\"false\"\r\n [readOnly]=\"itemReadOnly()\"\r\n appendTo=\"body\"\r\n drawerStyleClass=\"mt-work-center-item-drawer !w-[90vw]\"\r\n (closed)=\"selectedItemContextKey.set(null)\"\r\n />\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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: ClientPage, selector: "mt-client-page", inputs: ["menuIcon", "menuTitle", "menuItems", "menuItemsLoading", "showExpandIcon", "activeItem", "collapsed", "autoCollapse", "resizable", "storageKey", "storageMode", "minSidebarWidth", "maxSidebarWidth", "defaultSidebarWidth"], outputs: ["collapsedChange", "menuItemClick", "loadChildren"] }, { kind: "component", type: PropertyFilterBuilder, selector: "mt-property-filter-builder", inputs: ["schema", "filters", "title", "buttonLabel", "disabled"], outputs: ["filtersChange", "applied", "cleared"] }, { kind: "component", type: StatisticCard, selector: "mt-statistic-card", inputs: ["data", "cardClass"] }, { kind: "component", type: WorkCenterGrid, selector: "mt-work-center-grid", inputs: ["rows", "columns", "context", "schema", "group", "total", "loading", "filterRules", "groupCounts", "label", "viewKey"], outputs: ["rowClick", "filtersChange", "groupChange", "queryChange"] }, { kind: "component", type: WorkCenterItemModalRoute, selector: "mt-work-center-item-modal-route", inputs: ["contextKey", "manageRouteOutlet", "showPreviewLevelAction", "readOnly", "appendTo", "drawerStyleClass"], outputs: ["previewLevel", "closed"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i1$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
4709
3640
  }
4710
3641
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterPage, decorators: [{
4711
3642
  type: Component,
@@ -4715,10 +3646,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
4715
3646
  ClientPage,
4716
3647
  PropertyFilterBuilder,
4717
3648
  StatisticCard,
4718
- Table,
3649
+ WorkCenterGrid,
4719
3650
  WorkCenterItemModalRoute,
4720
3651
  SkeletonModule,
4721
- ], template: "<ng-template #headerActions>\r\n <div class=\"flex flex-wrap items-center justify-end gap-2\">\r\n <mt-property-filter-builder\r\n [schema]=\"propertyFilterSchema()\"\r\n [filters]=\"headerFilters()\"\r\n (applied)=\"onRuntimeFiltersApplied($event)\"\r\n (cleared)=\"onRuntimeFiltersCleared()\"\r\n />\r\n\r\n @if (showGeneralTaskCreateButton()) {\r\n <mt-button\r\n [label]=\"generalTaskButtonLabel()\"\r\n [icon]=\"generalTaskButtonIcon()\"\r\n size=\"small\"\r\n (onClick)=\"onGeneralTaskCreateClick()\"\r\n />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #pageContent>\r\n <div class=\"flex flex-col gap-8\">\r\n @if (loading()) {\r\n <div\r\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\r\n >\r\n @for (_ of [1, 2, 3, 4, 5]; track $index) {\r\n <p-skeleton height=\"6.5rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n } @else if (kpis().length) {\r\n <div class=\"gap-3 flex flex-wrap\">\r\n @for (kpi of kpis(); track $index) {\r\n <mt-statistic-card [data]=\"kpi\" class=\"min-w-[200px]\" />\r\n }\r\n </div>\r\n }\r\n\r\n <mt-table\r\n noCard\r\n [data]=\"rows()\"\r\n [columns]=\"tableColumns()\"\r\n tableLayout=\"auto\"\r\n [clickableRows]=\"rowsClickable()\"\r\n [loading]=\"loading()\"\r\n [showFilters]=\"true\"\r\n filterMode=\"column\"\r\n [cellClickFilter]=\"true\"\r\n [generalSearch]=\"true\"\r\n [exportable]=\"true\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [freezeActions]=\"true\"\r\n [lazy]=\"true\"\r\n [lazyLocalSearch]=\"true\"\r\n [lazyTotalRecords]=\"totalCount()\"\r\n [pageSize]=\"context().pageSize\"\r\n [currentPage]=\"context().page - 1\"\r\n [first]=\"(context().page - 1) * context().pageSize\"\r\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\r\n [groupCountMap]=\"groupCountMap()\"\r\n [groupBy]=\"groupBy()\"\r\n [sortField]=\"sortField()\"\r\n [sortDirection]=\"sortDirection()\"\r\n storageKey=\"work-center-page-table\"\r\n [persistStateExclude]=\"persistStateExclude\"\r\n [filters]=\"tableFilters()\"\r\n [externalFiltersActive]=\"headerFilters().length > 0\"\r\n (filtersChange)=\"tableFilters.set($event)\"\r\n (filtersCleared)=\"onEmptyStateFiltersCleared()\"\r\n (groupByChange)=\"onTableGroupByChange($event)\"\r\n (lazyLoad)=\"onTableLazyLoad($event)\"\r\n (rowClick)=\"onRowClick($event)\"\r\n />\r\n </div>\r\n</ng-template>\r\n\r\n@if (showSidebar()) {\r\n <mt-client-page\r\n [menuIcon]=\"menuIcon()\"\r\n [menuTitle]=\"resolvedPageTitle()\"\r\n [menuItems]=\"menuItems()\"\r\n [menuItemsLoading]=\"loading() && !menuItems().length\"\r\n [activeItem]=\"context().selectedCardKey ?? undefined\"\r\n (menuItemClick)=\"onMenuItemClick($event)\"\r\n >\r\n <ng-template #headerClientPageEnd>\r\n @if (showHeader()) {\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n }\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </mt-client-page>\r\n} @else {\r\n <div class=\"flex h-full min-h-0 flex-col bg-surface-0\">\r\n @if (showHeader()) {\r\n <div\r\n class=\"flex shrink-0 items-center justify-end border-b border-surface px-7 py-4\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n </div>\r\n }\r\n <div class=\"min-h-0 flex-1 overflow-y-auto px-7 py-5\">\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </div>\r\n </div>\r\n}\r\n\r\n@if (selectedItemContextKey(); as contextKey) {\r\n <mt-work-center-item-modal-route\r\n [contextKey]=\"contextKey\"\r\n [manageRouteOutlet]=\"false\"\r\n [showPreviewLevelAction]=\"false\"\r\n [readOnly]=\"itemReadOnly()\"\r\n appendTo=\"body\"\r\n drawerStyleClass=\"mt-work-center-item-drawer !w-[90vw]\"\r\n (closed)=\"selectedItemContextKey.set(null)\"\r\n />\r\n}\r\n" }]
3652
+ ], template: "<ng-template #headerActions>\r\n <div class=\"flex flex-wrap items-center justify-end gap-2\">\r\n <mt-property-filter-builder\r\n [schema]=\"propertyFilterSchema()\"\r\n [filters]=\"headerFilters()\"\r\n (applied)=\"onRuntimeFiltersApplied($event)\"\r\n (cleared)=\"onRuntimeFiltersCleared()\"\r\n />\r\n\r\n @if (showGeneralTaskCreateButton()) {\r\n <mt-button\r\n [label]=\"generalTaskButtonLabel()\"\r\n [icon]=\"generalTaskButtonIcon()\"\r\n size=\"small\"\r\n (onClick)=\"onGeneralTaskCreateClick()\"\r\n />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #pageContent>\r\n <div class=\"flex flex-col gap-8\">\r\n @if (loading()) {\r\n <div\r\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\r\n >\r\n @for (_ of [1, 2, 3, 4, 5]; track $index) {\r\n <p-skeleton height=\"6.5rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n } @else if (kpis().length) {\r\n <div class=\"gap-3 flex flex-wrap\">\r\n @for (kpi of kpis(); track $index) {\r\n <mt-statistic-card [data]=\"kpi\" class=\"min-w-[200px]\" />\r\n }\r\n </div>\r\n }\r\n\r\n <mt-work-center-grid\r\n [rows]=\"rows()\"\r\n [columns]=\"columns()\"\r\n [context]=\"context()\"\r\n [schema]=\"runtimeFilterSchema()\"\r\n [group]=\"groupBy()\"\r\n [groupCounts]=\"groupCountMap()\"\r\n [filterRules]=\"columnFilters()\"\r\n [total]=\"totalCount()\"\r\n [label]=\"resolvedPageTitle()\"\r\n [viewKey]=\"'work-center:' + area() + ':' + context().selectedCardKey\"\r\n [loading]=\"loading()\"\r\n (filtersChange)=\"onGridFiltersChange($event)\"\r\n (groupChange)=\"onTableGroupByChange($event)\"\r\n (queryChange)=\"onGridQueryChange($event)\"\r\n (rowClick)=\"rowsClickable() && onRowClick($event)\"\r\n />\r\n </div>\r\n</ng-template>\r\n\r\n@if (showSidebar()) {\r\n <mt-client-page\r\n [menuIcon]=\"menuIcon()\"\r\n [menuTitle]=\"resolvedPageTitle()\"\r\n [menuItems]=\"menuItems()\"\r\n [menuItemsLoading]=\"loading() && !menuItems().length\"\r\n [activeItem]=\"context().selectedCardKey ?? undefined\"\r\n (menuItemClick)=\"onMenuItemClick($event)\"\r\n >\r\n <ng-template #headerClientPageEnd>\r\n @if (showHeader()) {\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n }\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </mt-client-page>\r\n} @else {\r\n <div class=\"flex h-full min-h-0 flex-col bg-surface-0\">\r\n @if (showHeader()) {\r\n <div\r\n class=\"flex shrink-0 items-center justify-end border-b border-surface px-7 py-4\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"headerActions\" />\r\n </div>\r\n }\r\n <div class=\"min-h-0 flex-1 overflow-y-auto px-7 py-5\">\r\n <ng-container [ngTemplateOutlet]=\"pageContent\" />\r\n </div>\r\n </div>\r\n}\r\n\r\n@if (selectedItemContextKey(); as contextKey) {\r\n <mt-work-center-item-modal-route\r\n [contextKey]=\"contextKey\"\r\n [manageRouteOutlet]=\"false\"\r\n [showPreviewLevelAction]=\"false\"\r\n [readOnly]=\"itemReadOnly()\"\r\n appendTo=\"body\"\r\n drawerStyleClass=\"mt-work-center-item-drawer !w-[90vw]\"\r\n (closed)=\"selectedItemContextKey.set(null)\"\r\n />\r\n}\r\n" }]
4722
3653
  }], ctorParameters: () => [], propDecorators: { area: [{ type: i0.Input, args: [{ isSignal: true, alias: "area", required: false }] }], pageTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageTitle", required: false }] }], menuIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuIcon", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], showSidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSidebar", required: false }] }], showHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHeader", required: false }] }], bootstrapInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "bootstrapInputs", required: false }] }], openItemDrawer: [{ type: i0.Input, args: [{ isSignal: true, alias: "openItemDrawer", required: false }] }], itemReadOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemReadOnly", required: false }] }], openItemsInModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "openItemsInModal", required: false }] }], itemModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemModal", required: false }] }], generalTaskModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "generalTaskModal", required: false }] }], runtimeFiltersChanged: [{ type: i0.Output, args: ["runtimeFiltersChanged"] }], itemClicked: [{ type: i0.Output, args: ["itemClicked"] }], cardSelected: [{ type: i0.Output, args: ["cardSelected"] }], sortChanged: [{ type: i0.Output, args: ["sortChanged"] }], groupChanged: [{ type: i0.Output, args: ["groupChanged"] }] } });
4723
3654
 
4724
3655
  /**
@@ -4738,11 +3669,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
4738
3669
  * Pure TypeScript - no Angular, no DOM.
4739
3670
  */
4740
3671
 
4741
- const APP_STATES = [WorkCenterState];
4742
-
4743
3672
  /**
4744
3673
  * Generated bundle index. Do not edit.
4745
3674
  */
4746
3675
 
4747
- export { APP_STATES, ApplyColumnFilters, ApplyHeaderFilters, ClearAllFilters, EnterArea, HydrateFromContext, LoadRuntime, SCHEDULE_PUBLISH_GROUP_ORDER, SCHEDULE_PUBLISH_OPERATION_KEY, SelectCard, SetGroupBy, SetLookups, SetParams, WORK_CENTER_ACTION_HANDLERS, WORK_CENTER_EMPTY_LABEL, WORK_CENTER_EXTRA_TABS, WORK_CENTER_GROUP_NONE, WORK_CENTER_HIDDEN_TABS, WORK_CENTER_LEVEL_GROUP_FIELD, WORK_CENTER_LEVEL_NAME_KEY, WORK_CENTER_MAX_FILTERS, WORK_CENTER_MAX_PAGE_SIZE, WORK_CENTER_MAX_SORT, WORK_CENTER_QUERY_VERSION, WORK_CENTER_TYPE_COMPONENTS, WorkCenterActionKey, WorkCenterClientFormModal, WorkCenterFacade, WorkCenterItemModal, WorkCenterItemModalRoute, WorkCenterPage, WorkCenterSchedulePublishType, WorkCenterState, decodeWorkCenterRouteContextKey, encodeWorkCenterRouteContextKey, groupSchedulePublishRows, insertWorkCenterExtraTabs, isSchedulePublishConflictRow, matchesSchedulePublishSearch, parseSchedulePublishChangedFields, readSchedulePublishChanges, removeWorkCenterHiddenTabs, resolveWorkCenterActionHandler, resolveWorkCenterExtraTabs, schedulePublishRowKey, sortSchedulePublishRows, summarizeSchedulePublish, windowSchedulePublishRows, workCenterFormTabOptions, workCenterInitialFormTab };
3676
+ export { SCHEDULE_PUBLISH_GROUP_ORDER, SCHEDULE_PUBLISH_OPERATION_KEY, WORK_CENTER_ACTION_HANDLERS, WORK_CENTER_EXTRA_TABS, WORK_CENTER_HIDDEN_TABS, WORK_CENTER_TYPE_COMPONENTS, WorkCenterClientFormModal, WorkCenterItemModal, WorkCenterItemModalRoute, WorkCenterPage, WorkCenterSchedulePublishType, groupSchedulePublishRows, insertWorkCenterExtraTabs, isSchedulePublishConflictRow, matchesSchedulePublishSearch, parseSchedulePublishChangedFields, readSchedulePublishChanges, removeWorkCenterHiddenTabs, resolveWorkCenterActionHandler, resolveWorkCenterExtraTabs, schedulePublishRowKey, sortSchedulePublishRows, summarizeSchedulePublish, windowSchedulePublishRows, workCenterFormTabOptions, workCenterInitialFormTab };
4748
3677
  //# sourceMappingURL=masterteam-work-center.mjs.map