@masterteam/work-center 0.0.17 → 0.0.18
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.
|
@@ -150,6 +150,7 @@ const WORK_CENTER_MAX_SORT = 5;
|
|
|
150
150
|
|
|
151
151
|
const AREA_COLORS = ['violet', 'blue', 'emerald', 'amber', 'teal'];
|
|
152
152
|
const KPI_COLORS = ['violet', 'blue', 'emerald', 'amber', 'teal'];
|
|
153
|
+
const WORK_CENTER_LOCAL_FETCH_SIZE = WORK_CENTER_MAX_PAGE_SIZE;
|
|
153
154
|
const FILTER_OPERATORS = new Set([
|
|
154
155
|
'Eq',
|
|
155
156
|
'Neq',
|
|
@@ -169,7 +170,7 @@ function clampPage(value, fallback = 1) {
|
|
|
169
170
|
return fallback;
|
|
170
171
|
return Math.max(1, Math.floor(value));
|
|
171
172
|
}
|
|
172
|
-
function clampPageSize(value, fallback =
|
|
173
|
+
function clampPageSize(value, fallback = WORK_CENTER_LOCAL_FETCH_SIZE) {
|
|
173
174
|
if (!Number.isFinite(value))
|
|
174
175
|
return fallback;
|
|
175
176
|
const parsed = Math.floor(value);
|
|
@@ -248,6 +249,61 @@ function toViewType(viewType, key) {
|
|
|
248
249
|
}
|
|
249
250
|
return key.toLowerCase().includes('date') ? 'Date' : 'Text';
|
|
250
251
|
}
|
|
252
|
+
function normalizeColumnKey(key) {
|
|
253
|
+
return key
|
|
254
|
+
.trim()
|
|
255
|
+
.toLowerCase()
|
|
256
|
+
.replace(/[\s._-]+/g, '');
|
|
257
|
+
}
|
|
258
|
+
function resolveColumnWeight(key) {
|
|
259
|
+
const normalizedKey = normalizeColumnKey(key);
|
|
260
|
+
if (normalizedKey.includes('title'))
|
|
261
|
+
return 26;
|
|
262
|
+
if (normalizedKey.includes('subtitle') ||
|
|
263
|
+
normalizedKey.includes('description')) {
|
|
264
|
+
return 20;
|
|
265
|
+
}
|
|
266
|
+
if (normalizedKey.includes('status'))
|
|
267
|
+
return 14;
|
|
268
|
+
if (normalizedKey.includes('progress'))
|
|
269
|
+
return 17;
|
|
270
|
+
if (normalizedKey.includes('createdby') ||
|
|
271
|
+
normalizedKey.includes('assignedto') ||
|
|
272
|
+
normalizedKey.includes('owner') ||
|
|
273
|
+
normalizedKey.includes('user')) {
|
|
274
|
+
return 20;
|
|
275
|
+
}
|
|
276
|
+
if (normalizedKey.includes('duedate') ||
|
|
277
|
+
normalizedKey.includes('createdat') ||
|
|
278
|
+
normalizedKey.includes('updatedat') ||
|
|
279
|
+
normalizedKey.endsWith('date')) {
|
|
280
|
+
return 15;
|
|
281
|
+
}
|
|
282
|
+
if (normalizedKey.includes('priority'))
|
|
283
|
+
return 12;
|
|
284
|
+
return 16;
|
|
285
|
+
}
|
|
286
|
+
function applySmartColumnWidths(columns) {
|
|
287
|
+
const dynamicWeightTotal = columns.reduce((total, column) => {
|
|
288
|
+
return column.width?.trim()
|
|
289
|
+
? total
|
|
290
|
+
: total + resolveColumnWeight(column.key);
|
|
291
|
+
}, 0);
|
|
292
|
+
if (!dynamicWeightTotal) {
|
|
293
|
+
return columns;
|
|
294
|
+
}
|
|
295
|
+
return columns.map((column) => {
|
|
296
|
+
if (column.width?.trim()) {
|
|
297
|
+
return column;
|
|
298
|
+
}
|
|
299
|
+
const width = ((resolveColumnWeight(column.key) / dynamicWeightTotal) *
|
|
300
|
+
100).toFixed(2);
|
|
301
|
+
return {
|
|
302
|
+
...column,
|
|
303
|
+
width: `${width}%`,
|
|
304
|
+
};
|
|
305
|
+
});
|
|
306
|
+
}
|
|
251
307
|
function getValue(record, key) {
|
|
252
308
|
return key.split('.').reduce((current, part) => {
|
|
253
309
|
if (!current || typeof current !== 'object') {
|
|
@@ -293,15 +349,15 @@ function buildColumnsFromProperties(properties) {
|
|
|
293
349
|
function buildColumns(columnsConfig) {
|
|
294
350
|
const propertyColumns = buildColumnsFromProperties(columnsConfig?.properties ?? []);
|
|
295
351
|
if (propertyColumns.length) {
|
|
296
|
-
return propertyColumns;
|
|
352
|
+
return applySmartColumnWidths(propertyColumns);
|
|
297
353
|
}
|
|
298
354
|
const keys = columnsConfig?.columns?.length ? columnsConfig.columns : [];
|
|
299
|
-
return keys.map((key) => ({
|
|
355
|
+
return applySmartColumnWidths(keys.map((key) => ({
|
|
300
356
|
key,
|
|
301
357
|
label: toLabel$1(key),
|
|
302
358
|
type: 'entity',
|
|
303
359
|
viewType: toViewType(undefined, key),
|
|
304
|
-
}));
|
|
360
|
+
})));
|
|
305
361
|
}
|
|
306
362
|
function toDisplayRows(rows, columns) {
|
|
307
363
|
return rows.map((row) => {
|
|
@@ -352,7 +408,7 @@ function createDefaultContext(area) {
|
|
|
352
408
|
templateId: null,
|
|
353
409
|
selectedCardKey: null,
|
|
354
410
|
page: 1,
|
|
355
|
-
pageSize:
|
|
411
|
+
pageSize: WORK_CENTER_LOCAL_FETCH_SIZE,
|
|
356
412
|
sort: [],
|
|
357
413
|
runtimeFilters: [],
|
|
358
414
|
includeStats: true,
|
|
@@ -385,7 +441,7 @@ function normalizeContext(context) {
|
|
|
385
441
|
return {
|
|
386
442
|
...context,
|
|
387
443
|
page: clampPage(context.page, 1),
|
|
388
|
-
pageSize: clampPageSize(context.pageSize,
|
|
444
|
+
pageSize: clampPageSize(context.pageSize, WORK_CENTER_LOCAL_FETCH_SIZE),
|
|
389
445
|
sort: sanitizeSort(context.sort),
|
|
390
446
|
runtimeFilters: sanitizeFilters(context.runtimeFilters),
|
|
391
447
|
};
|
|
@@ -907,10 +963,7 @@ class WorkCenterPage {
|
|
|
907
963
|
columns = this.facade.columns;
|
|
908
964
|
kpis = this.facade.kpis;
|
|
909
965
|
runtimeFilterSchema = this.facade.runtimeFilterSchema;
|
|
910
|
-
totalCount = this.facade.totalCount;
|
|
911
966
|
loading = this.facade.loading;
|
|
912
|
-
tableCurrentPage = computed(() => Math.max((this.context().page ?? 1) - 1, 0), ...(ngDevMode ? [{ debugName: "tableCurrentPage" }] : /* istanbul ignore next */ []));
|
|
913
|
-
tableFirst = computed(() => this.tableCurrentPage() * (this.context().pageSize || 20), ...(ngDevMode ? [{ debugName: "tableFirst" }] : /* istanbul ignore next */ []));
|
|
914
967
|
tableColumns = computed(() => this.columns().map((column) => ({
|
|
915
968
|
...column,
|
|
916
969
|
sortable: true,
|
|
@@ -973,9 +1026,6 @@ class WorkCenterPage {
|
|
|
973
1026
|
}
|
|
974
1027
|
this.facade.selectCardAndLoad(this.area(), item.key);
|
|
975
1028
|
}
|
|
976
|
-
onLazyLoad(event) {
|
|
977
|
-
this.facade.applyTableLazyLoadAndLoad(this.area(), event);
|
|
978
|
-
}
|
|
979
1029
|
onRuntimeFiltersApplied(filters) {
|
|
980
1030
|
const mappedFilters = filters.map((filter) => ({
|
|
981
1031
|
field: filter.field,
|
|
@@ -1065,7 +1115,7 @@ class WorkCenterPage {
|
|
|
1065
1115
|
return normalized.length ? normalized : null;
|
|
1066
1116
|
}
|
|
1067
1117
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1068
|
-
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 }, 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" }, ngImport: i0, template: "<mt-client-page\
|
|
1118
|
+
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 }, 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" }, ngImport: i0, template: "<mt-client-page\n [menuIcon]=\"menuIcon()\"\n [menuTitle]=\"resolvedPageTitle()\"\n [menuItems]=\"menuItems()\"\n [menuItemsLoading]=\"loading() && !menuItems().length\"\n [activeItem]=\"context().selectedCardKey ?? undefined\"\n storageKey=\"work-center-client-page\"\n (menuItemClick)=\"onMenuItemClick($event)\"\n>\n <ng-template #headerClientPageEnd>\n <div class=\"flex flex-wrap items-center justify-end gap-2\">\n <mt-property-filter-builder\n [schema]=\"propertyFilterSchema()\"\n [filters]=\"context().runtimeFilters\"\n (applied)=\"onRuntimeFiltersApplied($event)\"\n (cleared)=\"onRuntimeFiltersCleared()\"\n />\n\n @if (showGeneralTaskCreateButton()) {\n <mt-button\n [label]=\"generalTaskButtonLabel()\"\n [icon]=\"generalTaskButtonIcon()\"\n size=\"small\"\n (onClick)=\"onGeneralTaskCreateClick()\"\n />\n }\n </div>\n </ng-template>\n\n <div class=\"flex flex-col gap-8\">\n @if (loading()) {\n <div\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\n >\n @for (_ of [1, 2, 3, 4, 5]; track $index) {\n <p-skeleton height=\"6.5rem\" class=\"rounded-lg\" />\n }\n </div>\n } @else if (kpis().length) {\n <div\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\n >\n @for (kpi of kpis(); track $index) {\n <mt-statistic-card [data]=\"kpi\" cardClass=\"shadow-sm\" />\n }\n </div>\n }\n\n <mt-table\n [data]=\"rows()\"\n [columns]=\"tableColumns()\"\n tableLayout=\"auto\"\n [clickableRows]=\"rowsClickable()\"\n [loading]=\"loading()\"\n [showFilters]=\"false\"\n [generalSearch]=\"true\"\n [exportable]=\"true\"\n [alwaysShowPaginator]=\"true\"\n [pageSize]=\"5\"\n [rowsPerPageOptions]=\"[5, 10, 20, 50]\"\n storageKey=\"work-center-page-table\"\n (rowClick)=\"onRowClick($event)\"\n />\n </div>\n</mt-client-page>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: ClientPage, selector: "mt-client-page", inputs: ["menuIcon", "menuTitle", "menuItems", "menuItemsLoading", "activeItem", "collapsed", "resizable", "storageKey", "storageMode", "minSidebarWidth", "maxSidebarWidth", "defaultSidebarWidth"], outputs: ["collapsedChange", "menuItemClick"] }, { 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", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "exportable", "exportFilename", "actionShape", "tableLayout", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
|
|
1069
1119
|
}
|
|
1070
1120
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterPage, decorators: [{
|
|
1071
1121
|
type: Component,
|
|
@@ -1077,7 +1127,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1077
1127
|
StatisticCard,
|
|
1078
1128
|
Table,
|
|
1079
1129
|
SkeletonModule,
|
|
1080
|
-
], template: "<mt-client-page\
|
|
1130
|
+
], template: "<mt-client-page\n [menuIcon]=\"menuIcon()\"\n [menuTitle]=\"resolvedPageTitle()\"\n [menuItems]=\"menuItems()\"\n [menuItemsLoading]=\"loading() && !menuItems().length\"\n [activeItem]=\"context().selectedCardKey ?? undefined\"\n storageKey=\"work-center-client-page\"\n (menuItemClick)=\"onMenuItemClick($event)\"\n>\n <ng-template #headerClientPageEnd>\n <div class=\"flex flex-wrap items-center justify-end gap-2\">\n <mt-property-filter-builder\n [schema]=\"propertyFilterSchema()\"\n [filters]=\"context().runtimeFilters\"\n (applied)=\"onRuntimeFiltersApplied($event)\"\n (cleared)=\"onRuntimeFiltersCleared()\"\n />\n\n @if (showGeneralTaskCreateButton()) {\n <mt-button\n [label]=\"generalTaskButtonLabel()\"\n [icon]=\"generalTaskButtonIcon()\"\n size=\"small\"\n (onClick)=\"onGeneralTaskCreateClick()\"\n />\n }\n </div>\n </ng-template>\n\n <div class=\"flex flex-col gap-8\">\n @if (loading()) {\n <div\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\n >\n @for (_ of [1, 2, 3, 4, 5]; track $index) {\n <p-skeleton height=\"6.5rem\" class=\"rounded-lg\" />\n }\n </div>\n } @else if (kpis().length) {\n <div\n class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-3\"\n >\n @for (kpi of kpis(); track $index) {\n <mt-statistic-card [data]=\"kpi\" cardClass=\"shadow-sm\" />\n }\n </div>\n }\n\n <mt-table\n [data]=\"rows()\"\n [columns]=\"tableColumns()\"\n tableLayout=\"auto\"\n [clickableRows]=\"rowsClickable()\"\n [loading]=\"loading()\"\n [showFilters]=\"false\"\n [generalSearch]=\"true\"\n [exportable]=\"true\"\n [alwaysShowPaginator]=\"true\"\n [pageSize]=\"5\"\n [rowsPerPageOptions]=\"[5, 10, 20, 50]\"\n storageKey=\"work-center-page-table\"\n (rowClick)=\"onRowClick($event)\"\n />\n </div>\n</mt-client-page>\n" }]
|
|
1081
1131
|
}], 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 }] }], 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"] }] } });
|
|
1082
1132
|
|
|
1083
1133
|
function readItemContext(details) {
|
|
@@ -1456,7 +1506,7 @@ class WorkCenterProcessPreview {
|
|
|
1456
1506
|
});
|
|
1457
1507
|
}
|
|
1458
1508
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessPreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1459
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessPreview, isStandalone: true, selector: "mt-work-center-process-preview", inputs: { requestId: { classPropertyName: "requestId", publicName: "requestId", isSignal: true, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (!canRenderPreview()) {\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 Process preview is not available for this item yet.\r\n </p>\r\n </div>\r\n} @else 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=\"text-sm text-surface-500\">Loading process preview...</p>\r\n </div>\r\n} @else if (error()) {\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\">{{ error() }}</p>\r\n </div>\r\n} @else {\r\n @if (view() === \"schema\") {\r\n @if (hasSchema()) {\r\n <div class=\"h-[70vh] overflow-hidden rounded-lg\">\r\n <mt-structure-builder\r\n class=\"h-full\"\r\n [layoutDirection]=\"'LR'\"\r\n [readonly]=\"true\"\r\n [nodes]=\"schemaNodes()\"\r\n [connections]=\"schemaConnections()\"\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 Process steps are not available for this item yet.\r\n </p>\r\n </div>\r\n }\r\n } @else if (hasApprovals()) {\r\n <mt-table\r\n [data]=\"approvalRows()\"\r\n [columns]=\"approvalColumns\"\r\n storageKey=\"work-center-process-preview-table\"\r\n [showFilters]=\"false\"\r\n [generalSearch]=\"false\"\r\n [clickableRows]=\"false\"\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 Process approvals data is not available for this item yet.\r\n </p>\r\n </div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "exportable", "exportFilename", "actionShape", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange"] }, { kind: "component", type: StructureBuilder, selector: "mt-structure-builder", inputs: ["availableNodes", "nodeForm", "nodeDialogFooterConfig", "connectionForm", "connectionFormulaSchemaId", "connectionFormulaConfig", "nodeActions", "nodeFields", "isAutoLayout", "readonly", "addModalType", "updateModalType", "addModalStyleClass", "updateModalStyleClass", "addModalHeader", "updateModalHeader", "appendTo", "availableTabsClass", "layoutDirection", "nodes", "connections", "nodeTemplate"], outputs: ["nodeActionsEvent", "action", "nodesChange", "connectionsChange"] }] });
|
|
1509
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WorkCenterProcessPreview, isStandalone: true, selector: "mt-work-center-process-preview", inputs: { requestId: { classPropertyName: "requestId", publicName: "requestId", isSignal: true, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (!canRenderPreview()) {\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 Process preview is not available for this item yet.\r\n </p>\r\n </div>\r\n} @else 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=\"text-sm text-surface-500\">Loading process preview...</p>\r\n </div>\r\n} @else if (error()) {\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\">{{ error() }}</p>\r\n </div>\r\n} @else {\r\n @if (view() === \"schema\") {\r\n @if (hasSchema()) {\r\n <div class=\"h-[70vh] overflow-hidden rounded-lg\">\r\n <mt-structure-builder\r\n class=\"h-full\"\r\n [layoutDirection]=\"'LR'\"\r\n [readonly]=\"true\"\r\n [nodes]=\"schemaNodes()\"\r\n [connections]=\"schemaConnections()\"\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 Process steps are not available for this item yet.\r\n </p>\r\n </div>\r\n }\r\n } @else if (hasApprovals()) {\r\n <mt-table\r\n [data]=\"approvalRows()\"\r\n [columns]=\"approvalColumns\"\r\n storageKey=\"work-center-process-preview-table\"\r\n [showFilters]=\"false\"\r\n [generalSearch]=\"false\"\r\n [clickableRows]=\"false\"\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 Process approvals data is not available for this item yet.\r\n </p>\r\n </div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "exportable", "exportFilename", "actionShape", "tableLayout", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange"] }, { kind: "component", type: StructureBuilder, selector: "mt-structure-builder", inputs: ["availableNodes", "nodeForm", "nodeDialogFooterConfig", "connectionForm", "connectionFormulaSchemaId", "connectionFormulaConfig", "nodeActions", "nodeFields", "isAutoLayout", "readonly", "addModalType", "updateModalType", "addModalStyleClass", "updateModalStyleClass", "addModalHeader", "updateModalHeader", "appendTo", "availableTabsClass", "layoutDirection", "nodes", "connections", "nodeTemplate"], outputs: ["nodeActionsEvent", "action", "nodesChange", "connectionsChange"] }] });
|
|
1460
1510
|
}
|
|
1461
1511
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WorkCenterProcessPreview, decorators: [{
|
|
1462
1512
|
type: Component,
|