@masterteam/work-center 0.0.97 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/work-center",
3
- "version": "0.0.97",
3
+ "version": "0.0.99",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/work-center",
6
6
  "linkDirectory": false,
@@ -20,14 +20,12 @@
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.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",
23
+ "@masterteam/components": "^0.0.331",
24
+ "@masterteam/discussion": "^0.0.26",
25
+ "@masterteam/client-components": "^0.0.107",
26
+ "@masterteam/forms": "^0.0.171",
28
27
  "@masterteam/structure-builder": "^0.0.64",
29
- "@masterteam/icons": "^0.0.17",
30
- "@masterteam/discussion": "^0.0.26"
28
+ "@masterteam/icons": "^0.0.17"
31
29
  },
32
30
  "sideEffects": false,
33
31
  "exports": {
@@ -1,6 +1,7 @@
1
+ import * as _masterteam_components_table from '@masterteam/components/table';
2
+ import { ColumnDef, TableFilters, TablePersistStateKey } from '@masterteam/components/table';
1
3
  import * as _masterteam_components_statistic_card from '@masterteam/components/statistic-card';
2
4
  import { StatisticCardData } from '@masterteam/components/statistic-card';
3
- import * as _masterteam_components_types_masterteam_components_table from '@masterteam/components/types/masterteam-components-table';
4
5
  import * as _masterteam_work_center from '@masterteam/work-center';
5
6
  import * as _angular_core from '@angular/core';
6
7
  import { Type, InjectionToken, OnDestroy } from '@angular/core';
@@ -8,7 +9,6 @@ import { ClientPageMenuItem } from '@masterteam/components/client-page-menu';
8
9
  import { PropertyFilterBuilderSchema, PropertyFilterBuilderRule } from '@masterteam/components/property-filter-builder';
9
10
  import { ClientLookup, ClientForm, ClientFormSubmitRequestMapper, ProcessFormSubmitResponse } from '@masterteam/forms/client-form';
10
11
  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';
@@ -19,6 +19,7 @@ import { Observable } from 'rxjs';
19
19
  import { ClientInstancePreviewConfig } from '@masterteam/client-components/client-instance-preview';
20
20
  import { EntityData } from '@masterteam/components/entities';
21
21
  import * as _masterteam_components_types_masterteam_components_statistic_card from '@masterteam/components/types/masterteam-components-statistic-card';
22
+ import * as _masterteam_components_types_masterteam_components_table from '@masterteam/components/types/masterteam-components-table';
22
23
  import * as _masterteam_components_types_masterteam_components_client_page_menu from '@masterteam/components/types/masterteam-components-client-page-menu';
23
24
  import { StateContext } from '@ngxs/store';
24
25
 
@@ -349,6 +350,7 @@ declare class WorkCenterPage {
349
350
  readonly groupChanged: _angular_core.OutputEmitterRef<string | null>;
350
351
  protected readonly context: _angular_core.Signal<_masterteam_work_center.WorkCenterContext>;
351
352
  protected readonly headerFilters: _angular_core.Signal<WorkCenterFilterRule[]>;
353
+ protected readonly tableFilters: _angular_core.WritableSignal<TableFilters>;
352
354
  protected readonly selectedItemContextKey: _angular_core.WritableSignal<string | null>;
353
355
  private readonly _menuItems;
354
356
  protected readonly menuItems: _angular_core.Signal<{
@@ -365,13 +367,40 @@ declare class WorkCenterPage {
365
367
  childrenLoading?: boolean;
366
368
  }[]>;
367
369
  protected readonly rows: _angular_core.Signal<Record<string, unknown>[]>;
368
- protected readonly columns: _angular_core.Signal<_masterteam_components_types_masterteam_components_table.ColumnDef[]>;
370
+ protected readonly columns: _angular_core.Signal<ColumnDef[]>;
369
371
  protected readonly kpis: _angular_core.Signal<_masterteam_components_statistic_card.StatisticCardData[]>;
370
372
  protected readonly runtimeFilterSchema: _angular_core.Signal<WorkCenterRuntimeFilterSchema | null>;
371
373
  protected readonly totalCount: _angular_core.Signal<number>;
372
374
  protected readonly columnFilters: _angular_core.Signal<WorkCenterFilterRule[]>;
373
375
  protected readonly loading: _angular_core.Signal<boolean>;
374
376
  protected readonly groupBy: _angular_core.Signal<string | null>;
377
+ /**
378
+ * Sort and grouping live in the runtime query (and the host's URL), not in
379
+ * table storage — persisting them locally would let a restored table claim a
380
+ * grouping the backend query no longer has. Stable reference: a fresh array
381
+ * per change detection would re-run the table's persistence effect.
382
+ */
383
+ protected readonly persistStateExclude: TablePersistStateKey[];
384
+ protected readonly tableColumns: _angular_core.Signal<{
385
+ sortable: boolean;
386
+ key: string;
387
+ label: string;
388
+ type?: _masterteam_components_table.ColumnType;
389
+ customCellTpl?: _angular_core.TemplateRef<any>;
390
+ filterConfig?: _masterteam_components_table.FilterConfig;
391
+ statusMap?: Record<string, _masterteam_components_table.TableStatusMapValue>;
392
+ groupable?: boolean;
393
+ groupKey?: string;
394
+ showGroupColumnLabel?: boolean;
395
+ readonly?: boolean;
396
+ width?: string;
397
+ align?: "start" | "center" | "end";
398
+ shrink?: boolean;
399
+ filterOnly?: boolean;
400
+ filterable?: boolean;
401
+ exportable?: boolean;
402
+ exportValue?: (row: any) => string | number | boolean | null;
403
+ }[]>;
375
404
  /**
376
405
  * Grouping is executed by the backend as a single sort, so the table's own
377
406
  * sort state is driven from the query we actually sent instead of the
@@ -417,13 +446,7 @@ declare class WorkCenterPage {
417
446
  * fires straight after carries the same sort and lands as a no-op.
418
447
  */
419
448
  onTableGroupByChange(key: string | null): void;
420
- onGridFiltersChange(filters: WorkCenterFilterRule[]): void;
421
- onGridQueryChange(event: {
422
- currentPage: number;
423
- pageSize: number;
424
- sortField: string | null;
425
- sortOrder: number;
426
- }): void;
449
+ onTableLazyLoad(event: any): void;
427
450
  /**
428
451
  * Announces the backend sort to the host only when it actually moved, so a
429
452
  * host that mirrors it into the URL doesn't churn history on every page hit.
@@ -620,6 +643,15 @@ interface WorkCenterExtraTab {
620
643
  * item's first tab.
621
644
  */
622
645
  after?: string;
646
+ /**
647
+ * `tab` (default): its own entry in the body's tab list, placed by `after`.
648
+ * `form`: a sub-tab of the request form instead. The form tab (`form` /
649
+ * `requestDetails`) then opens on a horizontal strip, the form first (value
650
+ * `form`, labelled like the form tab) and these after it, in registration
651
+ * order. `after` is ignored. The form stays mounted on the other sub-tabs,
652
+ * since it's the footer actions' form source.
653
+ */
654
+ placement?: 'tab' | 'form';
623
655
  /** Show the tab only for matching items. */
624
656
  when: (item: WorkCenterExtraTabItem) => boolean;
625
657
  component: Type<unknown>;
@@ -655,10 +687,36 @@ interface WorkCenterExtraTab {
655
687
  declare const WORK_CENTER_EXTRA_TABS: InjectionToken<WorkCenterExtraTab[]>;
656
688
  /** The registered tabs that apply to this item, in registration order. */
657
689
  declare function resolveWorkCenterExtraTabs(tabs: readonly WorkCenterExtraTab[] | null, details: WorkCenterItemBasicInfoData): WorkCenterExtraTab[];
690
+ /**
691
+ * The request form's sub-tab strip (`placement: 'form'`): the form, then the
692
+ * host tabs. `formLabel: null` leaves the form out (it loaded empty, "No form
693
+ * required"). Empty when fewer than two options remain, so no strip renders.
694
+ */
695
+ declare function workCenterFormTabOptions(formLabel: string | null, tabs: readonly WorkCenterExtraTab[], translate: (key: string) => string): OptionItem[];
696
+ /**
697
+ * The form sub-tab a body opens on: the form, unless it loaded empty and a
698
+ * host tab sits beside it — then the first host tab takes its place.
699
+ */
700
+ declare function workCenterInitialFormTab(formEmpty: boolean, tabs: readonly WorkCenterExtraTab[]): string;
658
701
  /** Splices the extra tabs into a built-in tab list (see `after`). */
659
702
  declare function insertWorkCenterExtraTabs<T extends {
660
703
  value?: unknown;
661
704
  }>(options: readonly T[], tabs: readonly WorkCenterExtraTab[], translate: (key: string) => string): (T | OptionItem)[];
705
+ /**
706
+ * Built-in tabs a host hides from the `ProcessStep` / `ProcessRequest` bodies,
707
+ * by tab value: `levelDetails` (ProcessStep), `approvals`, `schema`,
708
+ * `discussion`. The item's first tab (`form` / `requestDetails`) is the one the
709
+ * body opens on, so it always stays. A hidden `levelDetails` also skips its
710
+ * record fetch. Providing nothing changes nothing.
711
+ *
712
+ * @example
713
+ * providers: [{ provide: WORK_CENTER_HIDDEN_TABS, useValue: ['levelDetails'] }]
714
+ */
715
+ declare const WORK_CENTER_HIDDEN_TABS: InjectionToken<readonly string[]>;
716
+ /** Drops the hidden built-in tabs, always keeping the first (default) one. */
717
+ declare function removeWorkCenterHiddenTabs<T extends {
718
+ value?: unknown;
719
+ }>(options: readonly T[], hidden: readonly string[] | null): T[];
662
720
 
663
721
  /**
664
722
  * What a host action handler receives: the clicked footer action plus the
@@ -1194,5 +1252,5 @@ declare class WorkCenterState {
1194
1252
 
1195
1253
  declare const APP_STATES: (typeof WorkCenterState)[];
1196
1254
 
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 };
1255
+ 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 };
1198
1256
  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 };