@masterteam/work-center 0.0.95 → 0.0.97
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/assets/i18n/ar.json +217 -217
- package/assets/i18n/en.json +217 -217
- package/fesm2022/{masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs → masterteam-work-center-work-center-process-preview-DRPL21nM.mjs} +2 -2
- package/fesm2022/{masterteam-work-center-work-center-process-preview-jbm4vnuM.mjs.map → masterteam-work-center-work-center-process-preview-DRPL21nM.mjs.map} +1 -1
- package/fesm2022/masterteam-work-center.mjs +480 -159
- package/fesm2022/masterteam-work-center.mjs.map +1 -1
- package/package.json +8 -6
- package/types/masterteam-work-center.d.ts +80 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masterteam/work-center",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.97",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"directory": "../../../dist/masterteam/work-center",
|
|
6
6
|
"linkDirectory": false,
|
|
@@ -20,12 +20,14 @@
|
|
|
20
20
|
"rxjs": "^7.8.2",
|
|
21
21
|
"tailwindcss": "^4.2.2",
|
|
22
22
|
"tailwindcss-primeui": "^0.6.1",
|
|
23
|
-
"@masterteam/client-components": "^0.0.
|
|
24
|
-
"@masterteam/
|
|
23
|
+
"@masterteam/client-components": "^0.0.106",
|
|
24
|
+
"@masterteam/data-grid": "^0.0.1",
|
|
25
|
+
"@masterteam/forms": "^0.0.169",
|
|
26
|
+
"@masterteam/components": "^0.0.329",
|
|
27
|
+
"@masterteam/data-table": "^0.0.1",
|
|
28
|
+
"@masterteam/structure-builder": "^0.0.64",
|
|
25
29
|
"@masterteam/icons": "^0.0.17",
|
|
26
|
-
"@masterteam/discussion": "^0.0.26"
|
|
27
|
-
"@masterteam/forms": "^0.0.168",
|
|
28
|
-
"@masterteam/structure-builder": "^0.0.64"
|
|
30
|
+
"@masterteam/discussion": "^0.0.26"
|
|
29
31
|
},
|
|
30
32
|
"sideEffects": false,
|
|
31
33
|
"exports": {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as _masterteam_components_table from '@masterteam/components/table';
|
|
2
|
-
import { ColumnDef, TableFilters, TablePersistStateKey } from '@masterteam/components/table';
|
|
3
1
|
import * as _masterteam_components_statistic_card from '@masterteam/components/statistic-card';
|
|
4
2
|
import { StatisticCardData } from '@masterteam/components/statistic-card';
|
|
3
|
+
import * as _masterteam_components_types_masterteam_components_table from '@masterteam/components/types/masterteam-components-table';
|
|
5
4
|
import * as _masterteam_work_center from '@masterteam/work-center';
|
|
6
5
|
import * as _angular_core from '@angular/core';
|
|
7
6
|
import { Type, InjectionToken, OnDestroy } from '@angular/core';
|
|
@@ -9,15 +8,17 @@ import { ClientPageMenuItem } from '@masterteam/components/client-page-menu';
|
|
|
9
8
|
import { PropertyFilterBuilderSchema, PropertyFilterBuilderRule } from '@masterteam/components/property-filter-builder';
|
|
10
9
|
import { ClientLookup, ClientForm, ClientFormSubmitRequestMapper, ProcessFormSubmitResponse } from '@masterteam/forms/client-form';
|
|
11
10
|
import { LoadingStateShape } from '@masterteam/components';
|
|
11
|
+
import { ColumnDef } from '@masterteam/components/table';
|
|
12
12
|
import { ModalRef } from '@masterteam/components/dialog';
|
|
13
13
|
import { DrawerController } from '@masterteam/components/dynamic-drawer';
|
|
14
14
|
import { ModalService } from '@masterteam/components/modal';
|
|
15
|
+
import { OptionItem } from '@masterteam/components/tabs';
|
|
16
|
+
import { MTIcon } from '@masterteam/icons';
|
|
15
17
|
import * as rxjs from 'rxjs';
|
|
16
18
|
import { Observable } from 'rxjs';
|
|
17
19
|
import { ClientInstancePreviewConfig } from '@masterteam/client-components/client-instance-preview';
|
|
18
20
|
import { EntityData } from '@masterteam/components/entities';
|
|
19
21
|
import * as _masterteam_components_types_masterteam_components_statistic_card from '@masterteam/components/types/masterteam-components-statistic-card';
|
|
20
|
-
import * as _masterteam_components_types_masterteam_components_table from '@masterteam/components/types/masterteam-components-table';
|
|
21
22
|
import * as _masterteam_components_types_masterteam_components_client_page_menu from '@masterteam/components/types/masterteam-components-client-page-menu';
|
|
22
23
|
import { StateContext } from '@ngxs/store';
|
|
23
24
|
|
|
@@ -348,7 +349,6 @@ declare class WorkCenterPage {
|
|
|
348
349
|
readonly groupChanged: _angular_core.OutputEmitterRef<string | null>;
|
|
349
350
|
protected readonly context: _angular_core.Signal<_masterteam_work_center.WorkCenterContext>;
|
|
350
351
|
protected readonly headerFilters: _angular_core.Signal<WorkCenterFilterRule[]>;
|
|
351
|
-
protected readonly tableFilters: _angular_core.WritableSignal<TableFilters>;
|
|
352
352
|
protected readonly selectedItemContextKey: _angular_core.WritableSignal<string | null>;
|
|
353
353
|
private readonly _menuItems;
|
|
354
354
|
protected readonly menuItems: _angular_core.Signal<{
|
|
@@ -365,40 +365,13 @@ declare class WorkCenterPage {
|
|
|
365
365
|
childrenLoading?: boolean;
|
|
366
366
|
}[]>;
|
|
367
367
|
protected readonly rows: _angular_core.Signal<Record<string, unknown>[]>;
|
|
368
|
-
protected readonly columns: _angular_core.Signal<ColumnDef[]>;
|
|
368
|
+
protected readonly columns: _angular_core.Signal<_masterteam_components_types_masterteam_components_table.ColumnDef[]>;
|
|
369
369
|
protected readonly kpis: _angular_core.Signal<_masterteam_components_statistic_card.StatisticCardData[]>;
|
|
370
370
|
protected readonly runtimeFilterSchema: _angular_core.Signal<WorkCenterRuntimeFilterSchema | null>;
|
|
371
371
|
protected readonly totalCount: _angular_core.Signal<number>;
|
|
372
372
|
protected readonly columnFilters: _angular_core.Signal<WorkCenterFilterRule[]>;
|
|
373
373
|
protected readonly loading: _angular_core.Signal<boolean>;
|
|
374
374
|
protected readonly groupBy: _angular_core.Signal<string | null>;
|
|
375
|
-
/**
|
|
376
|
-
* Sort and grouping live in the runtime query (and the host's URL), not in
|
|
377
|
-
* table storage — persisting them locally would let a restored table claim a
|
|
378
|
-
* grouping the backend query no longer has. Stable reference: a fresh array
|
|
379
|
-
* per change detection would re-run the table's persistence effect.
|
|
380
|
-
*/
|
|
381
|
-
protected readonly persistStateExclude: TablePersistStateKey[];
|
|
382
|
-
protected readonly tableColumns: _angular_core.Signal<{
|
|
383
|
-
sortable: boolean;
|
|
384
|
-
key: string;
|
|
385
|
-
label: string;
|
|
386
|
-
type?: _masterteam_components_table.ColumnType;
|
|
387
|
-
customCellTpl?: _angular_core.TemplateRef<any>;
|
|
388
|
-
filterConfig?: _masterteam_components_table.FilterConfig;
|
|
389
|
-
statusMap?: Record<string, _masterteam_components_table.TableStatusMapValue>;
|
|
390
|
-
groupable?: boolean;
|
|
391
|
-
groupKey?: string;
|
|
392
|
-
showGroupColumnLabel?: boolean;
|
|
393
|
-
readonly?: boolean;
|
|
394
|
-
width?: string;
|
|
395
|
-
align?: "start" | "center" | "end";
|
|
396
|
-
shrink?: boolean;
|
|
397
|
-
filterOnly?: boolean;
|
|
398
|
-
filterable?: boolean;
|
|
399
|
-
exportable?: boolean;
|
|
400
|
-
exportValue?: (row: any) => string | number | boolean | null;
|
|
401
|
-
}[]>;
|
|
402
375
|
/**
|
|
403
376
|
* Grouping is executed by the backend as a single sort, so the table's own
|
|
404
377
|
* sort state is driven from the query we actually sent instead of the
|
|
@@ -444,7 +417,13 @@ declare class WorkCenterPage {
|
|
|
444
417
|
* fires straight after carries the same sort and lands as a no-op.
|
|
445
418
|
*/
|
|
446
419
|
onTableGroupByChange(key: string | null): void;
|
|
447
|
-
|
|
420
|
+
onGridFiltersChange(filters: WorkCenterFilterRule[]): void;
|
|
421
|
+
onGridQueryChange(event: {
|
|
422
|
+
currentPage: number;
|
|
423
|
+
pageSize: number;
|
|
424
|
+
sortField: string | null;
|
|
425
|
+
sortOrder: number;
|
|
426
|
+
}): void;
|
|
448
427
|
/**
|
|
449
428
|
* Announces the backend sort to the host only when it actually moved, so a
|
|
450
429
|
* host that mirrors it into the URL doesn't churn history on every page hit.
|
|
@@ -615,6 +594,72 @@ interface WorkCenterTypeComponentInputs {
|
|
|
615
594
|
*/
|
|
616
595
|
declare const WORK_CENTER_TYPE_COMPONENTS: InjectionToken<Record<string, Type<unknown>>>;
|
|
617
596
|
|
|
597
|
+
/** What a host's `when` sees of the item — same shape the footer action
|
|
598
|
+
* handlers get. */
|
|
599
|
+
interface WorkCenterExtraTabItem {
|
|
600
|
+
type: string | null;
|
|
601
|
+
context: Record<string, unknown> | null;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* A host tab added to the built-in `ProcessStep` / `ProcessRequest` bodies.
|
|
605
|
+
*
|
|
606
|
+
* `component` is mounted with the same inputs as a `WORK_CENTER_TYPE_COMPONENTS`
|
|
607
|
+
* entry (`details`, `lookups`, `readOnly`), the first time its tab opens, and
|
|
608
|
+
* then kept (hidden, not destroyed) like the built-in tabs.
|
|
609
|
+
*/
|
|
610
|
+
interface WorkCenterExtraTab {
|
|
611
|
+
/** The tab's value — must not collide with a built-in tab. */
|
|
612
|
+
key: string;
|
|
613
|
+
/** Transloco key, translated by the host type on every language change. */
|
|
614
|
+
label: string;
|
|
615
|
+
icon?: MTIcon;
|
|
616
|
+
/**
|
|
617
|
+
* The built-in tab to insert after: `form` / `levelDetails` (ProcessStep),
|
|
618
|
+
* `requestDetails` (ProcessRequest), `approvals`, `schema`, `discussion`.
|
|
619
|
+
* Missing, or naming a tab this item doesn't show, places it right after the
|
|
620
|
+
* item's first tab.
|
|
621
|
+
*/
|
|
622
|
+
after?: string;
|
|
623
|
+
/** Show the tab only for matching items. */
|
|
624
|
+
when: (item: WorkCenterExtraTabItem) => boolean;
|
|
625
|
+
component: Type<unknown>;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Host-side extra tabs for the built-in request bodies.
|
|
629
|
+
*
|
|
630
|
+
* `WORK_CENTER_TYPE_COMPONENTS` can only replace a body wholesale, so adding one
|
|
631
|
+
* tab to an approval meant rebuilding the form, level details, approvals, steps
|
|
632
|
+
* and discussion around it. This token adds a tab and leaves everything else to
|
|
633
|
+
* the built-in body. Strictly additive: providing nothing changes nothing.
|
|
634
|
+
*
|
|
635
|
+
* Gate `when` on what actually identifies the item (e.g. its component type),
|
|
636
|
+
* not on `operationKey` alone - that one is shared by every request of the same
|
|
637
|
+
* kind across all component types.
|
|
638
|
+
*
|
|
639
|
+
* @example
|
|
640
|
+
* providers: [
|
|
641
|
+
* {
|
|
642
|
+
* provide: WORK_CENTER_EXTRA_TABS,
|
|
643
|
+
* useValue: [
|
|
644
|
+
* {
|
|
645
|
+
* key: 'kpiMeasures',
|
|
646
|
+
* label: 'workCenter.kpiMeasures.tab',
|
|
647
|
+
* after: 'levelDetails',
|
|
648
|
+
* when: ({ context }) => context?.['componentType'] === 'PerformanceIndicator',
|
|
649
|
+
* component: KpiApprovalMeasuresTab,
|
|
650
|
+
* },
|
|
651
|
+
* ],
|
|
652
|
+
* },
|
|
653
|
+
* ]
|
|
654
|
+
*/
|
|
655
|
+
declare const WORK_CENTER_EXTRA_TABS: InjectionToken<WorkCenterExtraTab[]>;
|
|
656
|
+
/** The registered tabs that apply to this item, in registration order. */
|
|
657
|
+
declare function resolveWorkCenterExtraTabs(tabs: readonly WorkCenterExtraTab[] | null, details: WorkCenterItemBasicInfoData): WorkCenterExtraTab[];
|
|
658
|
+
/** Splices the extra tabs into a built-in tab list (see `after`). */
|
|
659
|
+
declare function insertWorkCenterExtraTabs<T extends {
|
|
660
|
+
value?: unknown;
|
|
661
|
+
}>(options: readonly T[], tabs: readonly WorkCenterExtraTab[], translate: (key: string) => string): (T | OptionItem)[];
|
|
662
|
+
|
|
618
663
|
/**
|
|
619
664
|
* What a host action handler receives: the clicked footer action plus the
|
|
620
665
|
* item it was resolved for (`GET workcenter/runtime/item-actions`).
|
|
@@ -1149,5 +1194,5 @@ declare class WorkCenterState {
|
|
|
1149
1194
|
|
|
1150
1195
|
declare const APP_STATES: (typeof WorkCenterState)[];
|
|
1151
1196
|
|
|
1152
|
-
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_GROUP_NONE, 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, isSchedulePublishConflictRow, matchesSchedulePublishSearch, parseSchedulePublishChangedFields, readSchedulePublishChanges, resolveWorkCenterActionHandler, schedulePublishRowKey, sortSchedulePublishRows, summarizeSchedulePublish, windowSchedulePublishRows };
|
|
1153
|
-
export type { ApiEnvelope, SchedulePublishDiff, SchedulePublishDiffRow, SchedulePublishFieldChange, SchedulePublishFormLoadResponse, SchedulePublishGroup, SchedulePublishGroupKey, SchedulePublishState, SchedulePublishSummary, TranslatableDto, WorkCenterActionHandler, WorkCenterActionHandlerContext, WorkCenterArea, WorkCenterAreaState, WorkCenterBootstrapInputs, WorkCenterClientFormModalData, WorkCenterClientFormModalOptions, WorkCenterColumnsConfig, WorkCenterContext, WorkCenterFilterOperator, WorkCenterFilterRule, WorkCenterHydratePatch, WorkCenterItemActionAfterSuccess, WorkCenterItemActionExecutionResult, WorkCenterItemActionsData, WorkCenterItemBasicInfoData, WorkCenterItemContextKey, WorkCenterItemModalComponentInput, WorkCenterItemModalOptions, WorkCenterLoadReason, WorkCenterLookups, WorkCenterPreviewLevelTarget, WorkCenterRuntimeCard, WorkCenterRuntimeFilterSchema, WorkCenterRuntimeItemAction, WorkCenterRuntimeOperatorOption, WorkCenterRuntimePagination, WorkCenterRuntimeProperty, WorkCenterRuntimeRequest, WorkCenterRuntimeResponseData, WorkCenterRuntimeSelectedCard, WorkCenterRuntimeStatsItem, WorkCenterRuntimeWarningDto, WorkCenterSortRule, WorkCenterStateModel, WorkCenterTypeComponentInputs };
|
|
1197
|
+
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_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, resolveWorkCenterActionHandler, resolveWorkCenterExtraTabs, schedulePublishRowKey, sortSchedulePublishRows, summarizeSchedulePublish, windowSchedulePublishRows };
|
|
1198
|
+
export type { ApiEnvelope, SchedulePublishDiff, SchedulePublishDiffRow, SchedulePublishFieldChange, SchedulePublishFormLoadResponse, SchedulePublishGroup, SchedulePublishGroupKey, SchedulePublishState, SchedulePublishSummary, TranslatableDto, WorkCenterActionHandler, WorkCenterActionHandlerContext, WorkCenterArea, WorkCenterAreaState, WorkCenterBootstrapInputs, WorkCenterClientFormModalData, WorkCenterClientFormModalOptions, WorkCenterColumnsConfig, WorkCenterContext, WorkCenterExtraTab, WorkCenterExtraTabItem, WorkCenterFilterOperator, WorkCenterFilterRule, WorkCenterHydratePatch, WorkCenterItemActionAfterSuccess, WorkCenterItemActionExecutionResult, WorkCenterItemActionsData, WorkCenterItemBasicInfoData, WorkCenterItemContextKey, WorkCenterItemModalComponentInput, WorkCenterItemModalOptions, WorkCenterLoadReason, WorkCenterLookups, WorkCenterPreviewLevelTarget, WorkCenterRuntimeCard, WorkCenterRuntimeFilterSchema, WorkCenterRuntimeItemAction, WorkCenterRuntimeOperatorOption, WorkCenterRuntimePagination, WorkCenterRuntimeProperty, WorkCenterRuntimeRequest, WorkCenterRuntimeResponseData, WorkCenterRuntimeSelectedCard, WorkCenterRuntimeStatsItem, WorkCenterRuntimeWarningDto, WorkCenterSortRule, WorkCenterStateModel, WorkCenterTypeComponentInputs };
|