@masterteam/work-center 0.0.98 → 0.0.99
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.
- package/fesm2022/{masterteam-work-center-work-center-process-preview-DRPL21nM.mjs → masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs} +2 -2
- package/fesm2022/{masterteam-work-center-work-center-process-preview-DRPL21nM.mjs.map → masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs.map} +1 -1
- package/fesm2022/masterteam-work-center.mjs +178 -397
- package/fesm2022/masterteam-work-center.mjs.map +1 -1
- package/package.json +6 -8
- package/types/masterteam-work-center.d.ts +42 -13
|
@@ -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,
|
|
4
|
+
import { inject, viewChild, input, computed, signal, Component, Injectable, DestroyRef, effect, untracked, InjectionToken, linkedSignal, Injector, output, 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,17 +9,13 @@ 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';
|
|
12
13
|
import * as i1$1 from 'primeng/skeleton';
|
|
13
14
|
import { SkeletonModule } from 'primeng/skeleton';
|
|
14
15
|
import { catchError, EMPTY, map, take, firstValueFrom, of, isObservable } from 'rxjs';
|
|
15
16
|
import { ModalRef } from '@masterteam/components/dialog';
|
|
16
17
|
import { DrawerController } from '@masterteam/components/dynamic-drawer';
|
|
17
18
|
import { ClientForm, ClientFormWarningsDialog } from '@masterteam/forms/client-form';
|
|
18
|
-
import { EntityPreview, EntitiesPreview, EntityPreviewBody } from '@masterteam/components/entities';
|
|
19
|
-
import { TableExportService, TableValueResolver } from '@masterteam/components/table';
|
|
20
|
-
import { MtDataGridComponent, captureGridViewState } from '@masterteam/data-grid';
|
|
21
|
-
import { mtEntityCellValues, mtEntityExportValue, mtEntityColumn } from '@masterteam/data-table';
|
|
22
|
-
import { MtTableText, MtTablePreferences } from '@masterteam/data-table/legacy';
|
|
23
19
|
import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http';
|
|
24
20
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
25
21
|
import { Drawer } from '@masterteam/components/drawer';
|
|
@@ -27,6 +23,7 @@ import { RuntimeActionContextStore, RuntimeActionRunner, RUNTIME_ACTION_CONFIRM_
|
|
|
27
23
|
import { Action, Selector, State, Store, select } from '@ngxs/store';
|
|
28
24
|
import { handleApiRequest } from '@masterteam/components';
|
|
29
25
|
import { ClientInstancePreview } from '@masterteam/client-components/client-instance-preview';
|
|
26
|
+
import { EntitiesPreview, EntityPreviewBody } from '@masterteam/components/entities';
|
|
30
27
|
import { Tabs } from '@masterteam/components/tabs';
|
|
31
28
|
import { StructureBuilder } from '@masterteam/structure-builder';
|
|
32
29
|
import { ToastService } from '@masterteam/components/toast';
|
|
@@ -124,372 +121,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
124
121
|
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" }]
|
|
125
122
|
}], 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 }] }] } });
|
|
126
123
|
|
|
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',
|
|
139
|
-
};
|
|
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])));
|
|
154
|
-
return {
|
|
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,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
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))
|
|
171
|
-
: null;
|
|
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
|
-
});
|
|
177
|
-
}
|
|
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 }];
|
|
193
|
-
}
|
|
194
|
-
|
|
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 same native grid as Dependencies. */
|
|
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
|
-
text = inject(MtTableText);
|
|
245
|
-
preferences = inject(MtTablePreferences);
|
|
246
|
-
exporter = inject(TableExportService);
|
|
247
|
-
host = inject(ElementRef);
|
|
248
|
-
grid = viewChild((MtDataGridComponent), ...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
|
|
249
|
-
ready = signal(null, ...(ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []));
|
|
250
|
-
height = signal(400, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
251
|
-
search = signal('', ...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
|
|
252
|
-
direction = computed(() => this.text.language().startsWith('ar') ? 'rtl' : 'ltr', ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
253
|
-
fit = { type: 'fitGridWidth' };
|
|
254
|
-
synchronizing = false;
|
|
255
|
-
restored = null;
|
|
256
|
-
layoutRevision = signal(0, ...(ngDevMode ? [{ debugName: "layoutRevision" }] : /* istanbul ignore next */ []));
|
|
257
|
-
identity = computed(() => ({
|
|
258
|
-
level: this.viewKey(),
|
|
259
|
-
role: 'work-center',
|
|
260
|
-
}), ...(ngDevMode ? [{ debugName: "identity" }] : /* istanbul ignore next */ []));
|
|
261
|
-
rowId = (row) => String(row['contextKey'] ?? row['id']);
|
|
262
|
-
exportParams = { processCellCallback: (mtEntityExportValue) };
|
|
263
|
-
visibleRows = computed(() => {
|
|
264
|
-
const words = this.search()
|
|
265
|
-
.trim()
|
|
266
|
-
.toLocaleLowerCase()
|
|
267
|
-
.split(/\s+/)
|
|
268
|
-
.filter(Boolean);
|
|
269
|
-
if (!words.length)
|
|
270
|
-
return this.rows();
|
|
271
|
-
// Retain Work Center's existing lazyLocalSearch contract; server column filters stay separate.
|
|
272
|
-
return this.rows().filter((row) => {
|
|
273
|
-
const value = this.columns()
|
|
274
|
-
.map((col) => mtEntityCellValues(this.entity(row, col)).display)
|
|
275
|
-
.join(' ')
|
|
276
|
-
.toLocaleLowerCase();
|
|
277
|
-
return words.every((word) => value.includes(word));
|
|
278
|
-
});
|
|
279
|
-
}, ...(ngDevMode ? [{ debugName: "visibleRows" }] : /* istanbul ignore next */ []));
|
|
280
|
-
definitions = computed(() => this.columns().map((column) => {
|
|
281
|
-
const viewType = (column
|
|
282
|
-
.viewType ?? 'Text');
|
|
283
|
-
const scalar = ['Number', 'Percentage', 'Currency'].includes(viewType)
|
|
284
|
-
? 'number'
|
|
285
|
-
: ['Date', 'DateTime'].includes(viewType)
|
|
286
|
-
? 'date'
|
|
287
|
-
: 'text';
|
|
288
|
-
const fields = this.schema()?.properties?.length
|
|
289
|
-
? this.schema().properties.map((p) => p.key)
|
|
290
|
-
: this.schema()?.allowedFields;
|
|
291
|
-
const filterable = column.filterable !== false &&
|
|
292
|
-
(!fields?.length || fields.includes(column.key));
|
|
293
|
-
// Runtime filters compare displayed values (WorkCenterRuntimeService.CompareValues), including lookup labels.
|
|
294
|
-
// Use the native scalar editor so values outside the loaded server page remain searchable.
|
|
295
|
-
const options = workCenterFilterOptions(this.schema(), scalar);
|
|
296
|
-
const definition = mtEntityColumn({
|
|
297
|
-
key: column.key,
|
|
298
|
-
label: column.label,
|
|
299
|
-
viewType,
|
|
300
|
-
entity: (row) => this.entity(row, column),
|
|
301
|
-
initialWidth: column.width?.endsWith('%')
|
|
302
|
-
? Number.parseFloat(column.width) * 12
|
|
303
|
-
: 200,
|
|
304
|
-
minWidth: 90,
|
|
305
|
-
filter: filterable && options.filterOptions?.length ? scalar : false,
|
|
306
|
-
filterParams: options,
|
|
307
|
-
enablePivot: false,
|
|
308
|
-
enableValue: false,
|
|
309
|
-
enableRowGroup: column.groupable !== false,
|
|
310
|
-
groupValueRenderer: WorkCenterGroupValue,
|
|
311
|
-
cellRendererParams: {
|
|
312
|
-
counts: column.groupKey ? null : this.groupCounts(),
|
|
313
|
-
},
|
|
314
|
-
...(column.groupKey
|
|
315
|
-
? {
|
|
316
|
-
valueGetter: ({ data }) => String(data[column.groupKey] ?? ''),
|
|
317
|
-
}
|
|
318
|
-
: {}),
|
|
319
|
-
});
|
|
320
|
-
return definition;
|
|
321
|
-
}), ...(ngDevMode ? [{ debugName: "definitions" }] : /* istanbul ignore next */ []));
|
|
322
|
-
constructor() {
|
|
323
|
-
effect(() => {
|
|
324
|
-
const key = this.viewKey();
|
|
325
|
-
untracked(() => {
|
|
326
|
-
this.search.set('');
|
|
327
|
-
this.ready()?.setFilterModel(null);
|
|
328
|
-
});
|
|
329
|
-
this.restored = null;
|
|
330
|
-
void key;
|
|
331
|
-
});
|
|
332
|
-
effect(() => {
|
|
333
|
-
const rules = this.filterRules(), api = this.ready();
|
|
334
|
-
if (!api || rules.length)
|
|
335
|
-
return;
|
|
336
|
-
untracked(() => {
|
|
337
|
-
this.synchronizing = true;
|
|
338
|
-
try {
|
|
339
|
-
api.setFilterModel(null);
|
|
340
|
-
}
|
|
341
|
-
finally {
|
|
342
|
-
this.synchronizing = false;
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
});
|
|
346
|
-
effect(() => {
|
|
347
|
-
const api = this.ready(), context = this.context(), group = this.group();
|
|
348
|
-
if (!api)
|
|
349
|
-
return;
|
|
350
|
-
untracked(() => {
|
|
351
|
-
this.synchronizing = true;
|
|
352
|
-
try {
|
|
353
|
-
const key = this.preferences.key(this.identity());
|
|
354
|
-
if (key && key !== this.restored) {
|
|
355
|
-
const state = this.preferences.read(this.identity());
|
|
356
|
-
if (state)
|
|
357
|
-
api.applyColumnState({
|
|
358
|
-
state: state.columns.map(({ colId, width, hide, pinned }) => ({
|
|
359
|
-
colId,
|
|
360
|
-
width,
|
|
361
|
-
hide,
|
|
362
|
-
pinned,
|
|
363
|
-
})),
|
|
364
|
-
applyOrder: true,
|
|
365
|
-
});
|
|
366
|
-
this.restored = key;
|
|
367
|
-
}
|
|
368
|
-
api.setRowGroupColumns(group ? [group] : []);
|
|
369
|
-
api.setSortModel(context.sort.map((rule) => ({ colId: rule.field, sort: rule.dir })));
|
|
370
|
-
}
|
|
371
|
-
finally {
|
|
372
|
-
this.synchronizing = false;
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
});
|
|
376
|
-
afterRenderEffect(() => {
|
|
377
|
-
this.layoutRevision();
|
|
378
|
-
this.visibleRows();
|
|
379
|
-
this.loading();
|
|
380
|
-
const grid = this.grid();
|
|
381
|
-
if (!grid)
|
|
382
|
-
return;
|
|
383
|
-
const root = this.host.nativeElement.querySelector('mt-data-grid');
|
|
384
|
-
const viewport = root?.querySelector('.mt-grid-viewport');
|
|
385
|
-
const header = root?.querySelector('.mt-grid-header');
|
|
386
|
-
if (!root || !viewport || !header)
|
|
387
|
-
return;
|
|
388
|
-
const chrome = root.getBoundingClientRect().height -
|
|
389
|
-
viewport.clientHeight +
|
|
390
|
-
header.getBoundingClientRect().height;
|
|
391
|
-
// A page grows with its displayed rows/groups. Only the surrounding ClientPage scrolls.
|
|
392
|
-
this.height.set(Math.max(400, Math.ceil(chrome + grid.api.getDisplayedRowCount() * 52)));
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
onReady(api) {
|
|
396
|
-
this.ready.set(api);
|
|
397
|
-
}
|
|
398
|
-
filters(event) {
|
|
399
|
-
if (this.synchronizing || this.loading())
|
|
400
|
-
return;
|
|
401
|
-
const api = this.ready();
|
|
402
|
-
if (!api)
|
|
403
|
-
return;
|
|
404
|
-
if (event.source === 'quickFilter')
|
|
405
|
-
this.search.set(api.getQuickFilter() ?? '');
|
|
406
|
-
else
|
|
407
|
-
this.filtersChange.emit(workCenterGridFilters(api.getFilterModel(), this.schema()));
|
|
408
|
-
this.resize();
|
|
409
|
-
}
|
|
410
|
-
sorted(sort) {
|
|
411
|
-
if (this.synchronizing || this.loading())
|
|
412
|
-
return;
|
|
413
|
-
const first = sort[0];
|
|
414
|
-
this.queryChange.emit({
|
|
415
|
-
currentPage: 1,
|
|
416
|
-
pageSize: this.context().pageSize,
|
|
417
|
-
sortField: first?.colId ?? null,
|
|
418
|
-
sortOrder: first?.sort === 'desc' ? -1 : 1,
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
grouped() {
|
|
422
|
-
if (this.synchronizing || this.loading())
|
|
423
|
-
return;
|
|
424
|
-
const groups = this.ready()?.getRowGroupColumns() ?? [];
|
|
425
|
-
const next = groups.at(-1) ?? null;
|
|
426
|
-
this.groupChange.emit(next);
|
|
427
|
-
this.resize();
|
|
428
|
-
}
|
|
429
|
-
paged(event) {
|
|
430
|
-
if (!event.newPage && !event.newPageSize)
|
|
431
|
-
return;
|
|
432
|
-
const sort = this.context().sort[0];
|
|
433
|
-
this.queryChange.emit({
|
|
434
|
-
currentPage: event.currentPage + 1,
|
|
435
|
-
pageSize: event.pageSize,
|
|
436
|
-
sortField: sort?.field ?? null,
|
|
437
|
-
sortOrder: sort?.dir === 'desc' ? -1 : 1,
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
resize() {
|
|
441
|
-
this.layoutRevision.update((value) => value + 1);
|
|
442
|
-
}
|
|
443
|
-
save() {
|
|
444
|
-
if (this.synchronizing || !this.ready())
|
|
445
|
-
return;
|
|
446
|
-
this.preferences.write(this.identity(), captureGridViewState(this.ready()));
|
|
447
|
-
}
|
|
448
|
-
menu = (params) => [
|
|
449
|
-
...params.defaultItems,
|
|
450
|
-
{ name: this.text.text('print'), action: () => this.print() },
|
|
451
|
-
];
|
|
452
|
-
print() {
|
|
453
|
-
const visible = new Set(this.ready()
|
|
454
|
-
?.getColumnState()
|
|
455
|
-
.filter((col) => !col.hide)
|
|
456
|
-
.map((col) => col.colId));
|
|
457
|
-
this.exporter.printPdf({
|
|
458
|
-
rows: this.visibleRows(),
|
|
459
|
-
columns: this.columns().filter((col) => visible.has(col.key)),
|
|
460
|
-
filename: this.label(),
|
|
461
|
-
title: this.label(),
|
|
462
|
-
resolveValue: (row, column) => TableValueResolver.getEntityValueByType(this.entity(row, column), 'export'),
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
entity(row, column) {
|
|
466
|
-
const entity = row[column.key];
|
|
467
|
-
const raw = entity.rawValue ??
|
|
468
|
-
(['Number', 'Percentage', 'Currency'].includes(entity.viewType)
|
|
469
|
-
? TableValueResolver.getEntityValueByType(entity, 'sort')
|
|
470
|
-
: ['Date', 'DateTime'].includes(entity.viewType)
|
|
471
|
-
? TableValueResolver.resolveDateValue(entity.value)
|
|
472
|
-
: null);
|
|
473
|
-
return {
|
|
474
|
-
...entity,
|
|
475
|
-
...(raw != null ? { rawValue: String(raw) } : {}),
|
|
476
|
-
configuration: {
|
|
477
|
-
...entity.configuration,
|
|
478
|
-
hideName: true,
|
|
479
|
-
showDisplayName: true,
|
|
480
|
-
showEmail: false,
|
|
481
|
-
showPhoneNumber: false,
|
|
482
|
-
},
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterGrid, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
486
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.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" }, viewQueries: [{ propertyName: "grid", first: true, predicate: (MtDataGridComponent), descendants: true, isSignal: true }], ngImport: i0, template: "<mt-data-grid\r\n [rowData]=\"visibleRows()\"\r\n [columnDefs]=\"definitions()\"\r\n [getRowId]=\"rowId\"\r\n dataProcessing=\"external\"\r\n [height]=\"height()\"\r\n [rowHeight]=\"52\"\r\n [headerHeight]=\"48\"\r\n [autoSizeStrategy]=\"fit\"\r\n [ariaLabel]=\"label()\"\r\n [loading]=\"loading()\"\r\n [direction]=\"direction()\"\r\n [localeText]=\"text.gridLocale()\"\r\n [showQuickFilter]=\"true\"\r\n [quickFilterText]=\"search()\"\r\n rowGroupPanelShow=\"always\"\r\n pivotPanelShow=\"never\"\r\n [sideBar]=\"{\r\n toolPanels: ['columns', 'filters'],\r\n position: direction() === 'rtl' ? 'left' : 'right',\r\n }\"\r\n [pagination]=\"true\"\r\n paginationPanelShow=\"whenNeeded\"\r\n [paginationTotalRows]=\"total()\"\r\n [paginationCurrentPage]=\"context().page - 1\"\r\n [paginationPageSize]=\"context().pageSize\"\r\n [paginationPageSizeSelector]=\"[10, 20, 50, 100]\"\r\n [cellSelection]=\"true\"\r\n [suppressCutToClipboard]=\"true\"\r\n [suppressPdfExport]=\"true\"\r\n [getContextMenuItems]=\"menu\"\r\n [defaultCsvExportParams]=\"exportParams\"\r\n [defaultExcelExportParams]=\"exportParams\"\r\n [groupDefaultExpanded]=\"-1\"\r\n [groupMaintainOrder]=\"true\"\r\n [autoGroupColumnDef]=\"{ cellRendererParams: { suppressCount: true } }\"\r\n groupDisplayType=\"groupRows\"\r\n (gridReady)=\"onReady($event.api)\"\r\n (filterChanged)=\"filters($event)\"\r\n (sortChanged)=\"sorted($event)\"\r\n (columnRowGroupChanged)=\"grouped()\"\r\n (rowGroupOpened)=\"resize()\"\r\n (paginationChanged)=\"paged($event)\"\r\n (columnResized)=\"$event.finished && save()\"\r\n (columnMoved)=\"save()\"\r\n (columnVisible)=\"save()\"\r\n (columnPinned)=\"save()\"\r\n (rowClicked)=\"\r\n $event.node.data && !$event.node.group && rowClick.emit($event.node.data)\r\n \"\r\n/>\r\n", dependencies: [{ kind: "component", type: MtDataGridComponent, selector: "mt-data-grid", inputs: ["rowData", "dataProcessing", "columnDefs", "getRowId", "height", "autoHeight", "autoHeightMaxRows", "autoHeightMinRows", "rowHeight", "animateRows", "headerHeight", "groupHeaderHeight", "direction", "localeText", "localeTextResolver", "ariaLabel", "loading", "noRowsText", "loadingText", "noRowsTemplate", "autoSizeStrategy", "columnMenu", "mainMenuItems", "autoSizePadding", "quickFilterText", "showQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "cacheQuickFilter", "applyQuickFilterBeforePivotOrAgg", "filtersToolPanelDef", "isExternalFilterPresent", "doesExternalFilterPass", "floatingFiltersHeight", "rowSelection", "selectionColumnDef", "rowNumbers", "rowDragManaged", "rowDragEntireRow", "rowDragMultiRow", "suppressMoveWhenRowDragging", "cellSelection", "statusBar", "suppressContextMenu", "allowContextMenuWithControlKey", "preventDefaultOnContextMenu", "getContextMenuItems", "suppressCsvExport", "suppressExcelExport", "suppressPdfExport", "defaultPdfExportParams", "excelStyles", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "copySelectedRows", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressCutToClipboard", "defaultCsvExportParams", "defaultExcelExportParams", "groupDisplayType", "groupRowRenderer", "groupRowRendererParams", "suppressGroupRowsSticky", "groupHideOpenParents", "groupHideParentOfSingleChild", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "showOpenedGroup", "groupAggFiltering", "suppressAggFilteredOnly", "aggregateOnlyChangedColumns", "suppressColumnMoveAnimation", "pivotRowTotals", "pivotColumnGroupTotals", "pivotMaxGeneratedColumns", "pivotDefaultExpanded", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "processPivotResultColDef", "processPivotResultColGroupDef", "processUnpinnedColumns", "rowGroupPanelShow", "pivotPanelShow", "pivotPanelHint", "groupDefaultExpanded", "autoGroupColumnDef", "groupTotalRow", "grandTotalRow", "aggFuncs", "suppressRowGroupHidesColumns", "suppressMakeColumnVisibleAfterUnGroup", "sideBar", "pivotMode", "suppressAggFuncInHeader", "enableCharts", "chartThemes", "customChartThemes", "chartToolPanelsDef", "chartThemeOverrides", "chartContext", "chartRecordsLabel", "getChartToolbarItems", "groupMaintainOrder", "treeData", "getDataPath", "masterDetail", "isRowMaster", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "singleClickEdit", "suppressClickEdit", "stopEditingWhenCellsLoseFocus", "undoRedoCellEditing", "undoRedoCellEditingLimit", "pagination", "paginationPanelShow", "paginationPageSize", "paginationTotalRows", "paginationCurrentPage", "paginationPageSizeSelector", "rowGroupPanelSuppressSort"], outputs: ["displayedColumnsChanged", "columnEverythingChanged", "pivotMaxColumnsExceeded", "gridReady", "sortChanged", "cellFocused", "columnResized", "columnMoved", "columnPinned", "columnVisible", "columnGroupOpened", "filterChanged", "filterModified", "filterOpened", "rowSelected", "selectionChanged", "rowClicked", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "cellSelectionChanged", "contextMenuVisibleChanged", "rowGroupOpened", "columnRowGroupChanged", "expandOrCollapseAll", "cellEditingStarted", "cellEditingStopped", "cellValueChanged", "pasteStart", "pasteEnd", "fillStart", "fillEnd", "paginationChanged", "toolPanelVisibleChanged", "toolPanelSizeChanged", "columnValueChanged", "columnPivotChanged", "columnPivotModeChanged", "chartCreated", "chartDestroyed", "chartRangeSelectionChanged", "chartOptionsChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
487
|
-
}
|
|
488
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterGrid, decorators: [{
|
|
489
|
-
type: Component,
|
|
490
|
-
args: [{ selector: 'mt-work-center-grid', imports: [MtDataGridComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mt-data-grid\r\n [rowData]=\"visibleRows()\"\r\n [columnDefs]=\"definitions()\"\r\n [getRowId]=\"rowId\"\r\n dataProcessing=\"external\"\r\n [height]=\"height()\"\r\n [rowHeight]=\"52\"\r\n [headerHeight]=\"48\"\r\n [autoSizeStrategy]=\"fit\"\r\n [ariaLabel]=\"label()\"\r\n [loading]=\"loading()\"\r\n [direction]=\"direction()\"\r\n [localeText]=\"text.gridLocale()\"\r\n [showQuickFilter]=\"true\"\r\n [quickFilterText]=\"search()\"\r\n rowGroupPanelShow=\"always\"\r\n pivotPanelShow=\"never\"\r\n [sideBar]=\"{\r\n toolPanels: ['columns', 'filters'],\r\n position: direction() === 'rtl' ? 'left' : 'right',\r\n }\"\r\n [pagination]=\"true\"\r\n paginationPanelShow=\"whenNeeded\"\r\n [paginationTotalRows]=\"total()\"\r\n [paginationCurrentPage]=\"context().page - 1\"\r\n [paginationPageSize]=\"context().pageSize\"\r\n [paginationPageSizeSelector]=\"[10, 20, 50, 100]\"\r\n [cellSelection]=\"true\"\r\n [suppressCutToClipboard]=\"true\"\r\n [suppressPdfExport]=\"true\"\r\n [getContextMenuItems]=\"menu\"\r\n [defaultCsvExportParams]=\"exportParams\"\r\n [defaultExcelExportParams]=\"exportParams\"\r\n [groupDefaultExpanded]=\"-1\"\r\n [groupMaintainOrder]=\"true\"\r\n [autoGroupColumnDef]=\"{ cellRendererParams: { suppressCount: true } }\"\r\n groupDisplayType=\"groupRows\"\r\n (gridReady)=\"onReady($event.api)\"\r\n (filterChanged)=\"filters($event)\"\r\n (sortChanged)=\"sorted($event)\"\r\n (columnRowGroupChanged)=\"grouped()\"\r\n (rowGroupOpened)=\"resize()\"\r\n (paginationChanged)=\"paged($event)\"\r\n (columnResized)=\"$event.finished && save()\"\r\n (columnMoved)=\"save()\"\r\n (columnVisible)=\"save()\"\r\n (columnPinned)=\"save()\"\r\n (rowClicked)=\"\r\n $event.node.data && !$event.node.group && rowClick.emit($event.node.data)\r\n \"\r\n/>\r\n" }]
|
|
491
|
-
}], 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"] }], grid: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MtDataGridComponent), { isSignal: true }] }] } });
|
|
492
|
-
|
|
493
124
|
class EnterArea {
|
|
494
125
|
area;
|
|
495
126
|
static type = '[WorkCenter] Enter Area';
|
|
@@ -2210,20 +1841,26 @@ function resolveWorkCenterExtraTabs(tabs, details) {
|
|
|
2210
1841
|
}
|
|
2211
1842
|
/**
|
|
2212
1843
|
* The request form's sub-tab strip (`placement: 'form'`): the form, then the
|
|
2213
|
-
* host tabs.
|
|
1844
|
+
* host tabs. `formLabel: null` leaves the form out (it loaded empty, "No form
|
|
1845
|
+
* required"). Empty when fewer than two options remain, so no strip renders.
|
|
2214
1846
|
*/
|
|
2215
1847
|
function workCenterFormTabOptions(formLabel, tabs, translate) {
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
}
|
|
2219
|
-
return [
|
|
2220
|
-
{ label: formLabel, value: 'form' },
|
|
1848
|
+
const options = [
|
|
1849
|
+
...(formLabel === null ? [] : [{ label: formLabel, value: 'form' }]),
|
|
2221
1850
|
...tabs.map((tab) => ({
|
|
2222
1851
|
label: translate(tab.label),
|
|
2223
1852
|
value: tab.key,
|
|
2224
1853
|
icon: tab.icon ?? null,
|
|
2225
1854
|
})),
|
|
2226
1855
|
];
|
|
1856
|
+
return options.length > 1 ? options : [];
|
|
1857
|
+
}
|
|
1858
|
+
/**
|
|
1859
|
+
* The form sub-tab a body opens on: the form, unless it loaded empty and a
|
|
1860
|
+
* host tab sits beside it — then the first host tab takes its place.
|
|
1861
|
+
*/
|
|
1862
|
+
function workCenterInitialFormTab(formEmpty, tabs) {
|
|
1863
|
+
return formEmpty && tabs.length ? tabs[0].key : 'form';
|
|
2227
1864
|
}
|
|
2228
1865
|
/** Splices the extra tabs into a built-in tab list (see `after`). */
|
|
2229
1866
|
function insertWorkCenterExtraTabs(options, tabs, translate) {
|
|
@@ -2296,10 +1933,15 @@ class WorkCenterProcessRequestType {
|
|
|
2296
1933
|
itemExtraTabs = computed(() => resolveWorkCenterExtraTabs(this.extraTabRegistry, this.details()), ...(ngDevMode ? [{ debugName: "itemExtraTabs" }] : /* istanbul ignore next */ []));
|
|
2297
1934
|
extraTabs = computed(() => this.itemExtraTabs().filter((tab) => tab.placement !== 'form'), ...(ngDevMode ? [{ debugName: "extraTabs" }] : /* istanbul ignore next */ []));
|
|
2298
1935
|
formTabs = computed(() => this.itemExtraTabs().filter((tab) => tab.placement === 'form'), ...(ngDevMode ? [{ debugName: "formTabs" }] : /* istanbul ignore next */ []));
|
|
2299
|
-
|
|
1936
|
+
// The form loaded empty ("No form required", e.g. a KPI value update): a
|
|
1937
|
+
// form-placed host tab then takes the form's place.
|
|
1938
|
+
formEmpty = computed(() => this.clientForm()?.isEmpty() ?? false, ...(ngDevMode ? [{ debugName: "formEmpty" }] : /* istanbul ignore next */ []));
|
|
1939
|
+
formTab = linkedSignal(() => workCenterInitialFormTab(this.formEmpty(), this.formTabs()), ...(ngDevMode ? [{ debugName: "formTab" }] : /* istanbul ignore next */ []));
|
|
2300
1940
|
formTabOptions = computed(() => {
|
|
2301
1941
|
this.activeLang();
|
|
2302
|
-
return workCenterFormTabOptions(this.
|
|
1942
|
+
return workCenterFormTabOptions(this.formEmpty()
|
|
1943
|
+
? null
|
|
1944
|
+
: this.transloco.translate('workCenter.tabs.requestDetails'), this.formTabs(), (key) => this.transloco.translate(key));
|
|
2303
1945
|
}, ...(ngDevMode ? [{ debugName: "formTabOptions" }] : /* istanbul ignore next */ []));
|
|
2304
1946
|
extraTabInputs = computed(() => ({
|
|
2305
1947
|
details: this.details(),
|
|
@@ -2398,9 +2040,9 @@ class WorkCenterProcessRequestType {
|
|
|
2398
2040
|
this.formStore?.setIncomplete(false);
|
|
2399
2041
|
}
|
|
2400
2042
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2401
|
-
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-
|
|
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)]] });
|
|
2402
2044
|
}
|
|
2403
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessRequestType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-
|
|
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: [{
|
|
2404
2046
|
type: Component,
|
|
2405
2047
|
args: [{ selector: 'mt-work-center-process-request-type', standalone: true, imports: [
|
|
2406
2048
|
CommonModule,
|
|
@@ -2441,10 +2083,15 @@ class WorkCenterProcessStepType {
|
|
|
2441
2083
|
itemExtraTabs = computed(() => resolveWorkCenterExtraTabs(this.extraTabRegistry, this.details()), ...(ngDevMode ? [{ debugName: "itemExtraTabs" }] : /* istanbul ignore next */ []));
|
|
2442
2084
|
extraTabs = computed(() => this.itemExtraTabs().filter((tab) => tab.placement !== 'form'), ...(ngDevMode ? [{ debugName: "extraTabs" }] : /* istanbul ignore next */ []));
|
|
2443
2085
|
formTabs = computed(() => this.itemExtraTabs().filter((tab) => tab.placement === 'form'), ...(ngDevMode ? [{ debugName: "formTabs" }] : /* istanbul ignore next */ []));
|
|
2444
|
-
|
|
2086
|
+
// The form loaded empty ("No form required", e.g. a KPI value update): a
|
|
2087
|
+
// form-placed host tab then takes the form's place.
|
|
2088
|
+
formEmpty = computed(() => this.clientForm()?.isEmpty() ?? false, ...(ngDevMode ? [{ debugName: "formEmpty" }] : /* istanbul ignore next */ []));
|
|
2089
|
+
formTab = linkedSignal(() => workCenterInitialFormTab(this.formEmpty(), this.formTabs()), ...(ngDevMode ? [{ debugName: "formTab" }] : /* istanbul ignore next */ []));
|
|
2445
2090
|
formTabOptions = computed(() => {
|
|
2446
2091
|
this.activeLang();
|
|
2447
|
-
return workCenterFormTabOptions(this.
|
|
2092
|
+
return workCenterFormTabOptions(this.formEmpty()
|
|
2093
|
+
? null
|
|
2094
|
+
: this.transloco.translate('workCenter.tabs.form'), this.formTabs(), (key) => this.transloco.translate(key));
|
|
2448
2095
|
}, ...(ngDevMode ? [{ debugName: "formTabOptions" }] : /* istanbul ignore next */ []));
|
|
2449
2096
|
extraTabInputs = computed(() => ({
|
|
2450
2097
|
details: this.details(),
|
|
@@ -2580,9 +2227,9 @@ class WorkCenterProcessStepType {
|
|
|
2580
2227
|
this.formStore?.setIncomplete(false);
|
|
2581
2228
|
}
|
|
2582
2229
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2583
|
-
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-
|
|
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)]] });
|
|
2584
2231
|
}
|
|
2585
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessStepType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-
|
|
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: [{
|
|
2586
2233
|
type: Component,
|
|
2587
2234
|
args: [{ selector: 'mt-work-center-process-step-type', standalone: true, imports: [
|
|
2588
2235
|
CommonModule,
|
|
@@ -3047,9 +2694,9 @@ class WorkCenterSchedulePublishType {
|
|
|
3047
2694
|
});
|
|
3048
2695
|
}
|
|
3049
2696
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3050
|
-
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 →\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-DRPL21nM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('./masterteam-work-center-work-center-process-preview-DRPL21nM.mjs').then(m => m.WorkCenterProcessPreview)], () => [import('@masterteam/discussion').then(m => m.DiscussionThread)]] });
|
|
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 →\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)]] });
|
|
3051
2698
|
}
|
|
3052
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterSchedulePublishType, resolveDeferredDeps: () => [import('./masterteam-work-center-work-center-process-preview-
|
|
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: [{
|
|
3053
2700
|
type: Component,
|
|
3054
2701
|
args: [{ selector: 'mt-work-center-schedule-publish-type', standalone: true, imports: [
|
|
3055
2702
|
CommonModule,
|
|
@@ -4553,6 +4200,115 @@ function normalizeCardKey(value) {
|
|
|
4553
4200
|
.replace(/[\s_-]/g, '')
|
|
4554
4201
|
.toLowerCase();
|
|
4555
4202
|
}
|
|
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
|
+
}
|
|
4556
4312
|
function areFilterRulesEqual(left, right) {
|
|
4557
4313
|
return JSON.stringify(left) === JSON.stringify(right);
|
|
4558
4314
|
}
|
|
@@ -4640,6 +4396,7 @@ class WorkCenterPage {
|
|
|
4640
4396
|
groupChanged = output();
|
|
4641
4397
|
context = this.facade.context;
|
|
4642
4398
|
headerFilters = this.facade.headerFilters;
|
|
4399
|
+
tableFilters = signal({}, ...(ngDevMode ? [{ debugName: "tableFilters" }] : /* istanbul ignore next */ []));
|
|
4643
4400
|
selectedItemContextKey = signal(null, ...(ngDevMode ? [{ debugName: "selectedItemContextKey" }] : /* istanbul ignore next */ []));
|
|
4644
4401
|
_menuItems = this.facade.menuItems;
|
|
4645
4402
|
menuItems = computed(() => {
|
|
@@ -4671,6 +4428,21 @@ class WorkCenterPage {
|
|
|
4671
4428
|
columnFilters = this.facade.columnFilters;
|
|
4672
4429
|
loading = this.facade.loading;
|
|
4673
4430
|
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 */ []));
|
|
4674
4446
|
/**
|
|
4675
4447
|
* Grouping is executed by the backend as a single sort, so the table's own
|
|
4676
4448
|
* sort state is driven from the query we actually sent instead of the
|
|
@@ -4763,6 +4535,7 @@ class WorkCenterPage {
|
|
|
4763
4535
|
}
|
|
4764
4536
|
// The store drops the previous card's filters and grouping; the table's
|
|
4765
4537
|
// own filter chips live here, so they have to be cleared alongside.
|
|
4538
|
+
this.tableFilters.set({});
|
|
4766
4539
|
this.facade.selectCardAndLoad(this.area(), item.key);
|
|
4767
4540
|
this.cardSelected.emit(item.key);
|
|
4768
4541
|
this.groupChanged.emit(null);
|
|
@@ -4782,6 +4555,7 @@ class WorkCenterPage {
|
|
|
4782
4555
|
}
|
|
4783
4556
|
onRuntimeFiltersCleared() {
|
|
4784
4557
|
this.facade.clearAllFiltersAndLoad(this.area());
|
|
4558
|
+
this.tableFilters.set({});
|
|
4785
4559
|
this.runtimeFiltersChanged.emit([]);
|
|
4786
4560
|
}
|
|
4787
4561
|
/**
|
|
@@ -4821,11 +4595,18 @@ class WorkCenterPage {
|
|
|
4821
4595
|
this.groupChanged.emit(nextGroup);
|
|
4822
4596
|
this.emitSortIfChanged(previousSort);
|
|
4823
4597
|
}
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
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
|
+
}
|
|
4829
4610
|
const previousSort = this.facade.snapshotContext().sort;
|
|
4830
4611
|
this.facade.applyTableLazyLoadAndLoad(this.area(), event);
|
|
4831
4612
|
this.emitSortIfChanged(previousSort);
|
|
@@ -4924,7 +4705,7 @@ class WorkCenterPage {
|
|
|
4924
4705
|
return normalized.length ? normalized : null;
|
|
4925
4706
|
}
|
|
4926
4707
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4927
|
-
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-
|
|
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"] }] });
|
|
4928
4709
|
}
|
|
4929
4710
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterPage, decorators: [{
|
|
4930
4711
|
type: Component,
|
|
@@ -4934,10 +4715,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
4934
4715
|
ClientPage,
|
|
4935
4716
|
PropertyFilterBuilder,
|
|
4936
4717
|
StatisticCard,
|
|
4937
|
-
|
|
4718
|
+
Table,
|
|
4938
4719
|
WorkCenterItemModalRoute,
|
|
4939
4720
|
SkeletonModule,
|
|
4940
|
-
], 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-
|
|
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" }]
|
|
4941
4722
|
}], 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"] }] } });
|
|
4942
4723
|
|
|
4943
4724
|
/**
|
|
@@ -4963,5 +4744,5 @@ const APP_STATES = [WorkCenterState];
|
|
|
4963
4744
|
* Generated bundle index. Do not edit.
|
|
4964
4745
|
*/
|
|
4965
4746
|
|
|
4966
|
-
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 };
|
|
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 };
|
|
4967
4748
|
//# sourceMappingURL=masterteam-work-center.mjs.map
|