@masterteam/components 0.0.233 → 0.0.234

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/components",
3
- "version": "0.0.233",
3
+ "version": "0.0.234",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/components",
6
6
  "linkDirectory": true,
@@ -36,7 +36,12 @@ interface EntityListComparison {
36
36
  }
37
37
  type PropertyValueComparison = ValueComparison | EntityListComparison;
38
38
 
39
- type EntityViewType = 'Text' | 'LongText' | 'Date' | 'DateTime' | 'Number' | 'Percentage' | 'Status' | 'Currency' | 'Checkbox' | 'User' | 'Lookup' | 'Attachment' | 'Location' | 'LookupMatrix' | 'LookupModuleCheckList' | 'LeafDetails' | 'Connection' | 'ScheduleItemSelector'
39
+ type EntityViewType = 'Text' | 'LongText' | 'Date' | 'DateTime' | 'Number' | 'Percentage' | 'Status' | 'Currency' | 'Checkbox' | 'User' | 'Lookup'
40
+ /**
41
+ * Calculated, read-only lookup resolved by the backend to the schema phase
42
+ * gate the record currently sits on. Never editable at runtime.
43
+ */
44
+ | 'PhaseGate' | 'Attachment' | 'Location' | 'LookupMatrix' | 'LookupModuleCheckList' | 'LeafDetails' | 'Connection' | 'ScheduleItemSelector'
40
45
  /**
41
46
  * Layout marker, not a value. Rendered full-width and non-resizable; the
42
47
  * preview layer (`groupEntitiesIntoSections`) turns each marker into a titled
@@ -110,6 +115,27 @@ interface EntityLookupValue {
110
115
  color: string;
111
116
  description?: string;
112
117
  }
118
+ /**
119
+ * A `PhaseGate` value — the schema phase gate the record currently sits on.
120
+ *
121
+ * Calculated and read-only: the backend owns it, nothing in the runtime writes
122
+ * it back. `key` is the stable phase-gate key; the schema phase-gate *id* rides
123
+ * on the owning entity's `rawValue`, not here. `display` is resolved for the
124
+ * request language, and `en`/`ar` carry the explicit per-language labels so the
125
+ * renderer can follow a client-side language switch without a refetch.
126
+ */
127
+ interface EntityPhaseGateValue {
128
+ key: string;
129
+ display: string;
130
+ en?: string;
131
+ ar?: string;
132
+ description?: string;
133
+ /**
134
+ * Optional presentation metadata (hex). Absent → the renderer's
135
+ * `DEFAULT_PHASE_GATE_COLOR` neutral badge.
136
+ */
137
+ color?: string;
138
+ }
113
139
  interface EntityUserValue {
114
140
  id?: string;
115
141
  userName?: string;
@@ -262,7 +288,7 @@ interface EntityData {
262
288
  * props have no label and no view type to render with.
263
289
  */
264
290
  nestedProperties?: EntityNestedPropertyMeta[];
265
- value: string | EntityStatusValue | EntityUserValue | EntityLookupValue | EntityAttachmentValue | EntityLocationValue | EntityConnectionValue | EntityScheduleItemValue[] | EntityLookupCheckListValue | EntityLookupCheckListItem[] | LeafDetailsEntityValue | LeafDetailsEntityCollectionValue | LeafDetailsRuntimeValue;
291
+ value: string | EntityStatusValue | EntityUserValue | EntityLookupValue | EntityPhaseGateValue | EntityAttachmentValue | EntityLocationValue | EntityConnectionValue | EntityScheduleItemValue[] | EntityLookupCheckListValue | EntityLookupCheckListItem[] | LeafDetailsEntityValue | LeafDetailsEntityCollectionValue | LeafDetailsRuntimeValue;
266
292
  viewType: EntityViewType;
267
293
  type?: string;
268
294
  configuration?: EntityConfiguration;
@@ -450,6 +476,59 @@ declare class EntityLookup {
450
476
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityLookup, "mt-entity-lookup", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
451
477
  }
452
478
 
479
+ /**
480
+ * Badge color used when the phase gate carries no `color`. `color` is optional
481
+ * presentation metadata, so a phase gate without one must still read as a
482
+ * badge rather than as bare text — this is the same neutral slate the table
483
+ * falls back to for uncategorized status chips.
484
+ */
485
+ declare const DEFAULT_PHASE_GATE_COLOR = "#475569";
486
+ /**
487
+ * Preview renderer for `PhaseGate` properties — a calculated, read-only lookup
488
+ * pointing at the schema phase gate the record currently sits on. It renders
489
+ * exactly like {@link EntityLookup} (colored badge) but resolves its label
490
+ * per-language.
491
+ *
492
+ * Label resolution, in order:
493
+ * 1. `value.ar` / `value.en` for the active language — the backend sends both
494
+ * so a client-side language switch re-renders without a refetch, which is
495
+ * why they win over the already-resolved `display`.
496
+ * 2. `value.display`, then the other locale.
497
+ * 3. The flat display, for payloads that send the value as a bare string
498
+ * (comparison snapshots build their sides that way).
499
+ * 4. `rawValue` — the schema phase-gate id — as a last resort.
500
+ */
501
+ declare class EntityPhaseGate {
502
+ private readonly transloco;
503
+ /** Full entity data object */
504
+ readonly data: _angular_core.InputSignal<EntityData | undefined>;
505
+ /** Individual inputs (used when data is not provided) */
506
+ readonly name: _angular_core.InputSignal<string | undefined>;
507
+ readonly value: _angular_core.InputSignal<EntityPhaseGateValue | undefined>;
508
+ private readonly activeLang;
509
+ readonly displayName: _angular_core.Signal<string>;
510
+ readonly phaseGateValue: _angular_core.Signal<EntityPhaseGateValue | null>;
511
+ /** Resolved label, or `null` when nothing at all is available. */
512
+ private readonly resolvedLabel;
513
+ readonly hasValue: _angular_core.Signal<boolean>;
514
+ readonly phaseGateLabel: _angular_core.Signal<string>;
515
+ readonly badgeStyle: _angular_core.Signal<{
516
+ color: string;
517
+ backgroundColor?: undefined;
518
+ } | {
519
+ color: string;
520
+ backgroundColor: string;
521
+ }>;
522
+ readonly emptyLabel = "_";
523
+ /** The value flattened to a plain display string by the sender. */
524
+ private flatDisplay;
525
+ /** The schema phase-gate id. */
526
+ private rawId;
527
+ private hexToRgba;
528
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityPhaseGate, never>;
529
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityPhaseGate, "mt-entity-phase-gate", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
530
+ }
531
+
453
532
  type AttachmentReference = EntityAttachmentItemValue | string;
454
533
  declare class EntityAttachment {
455
534
  readonly data: _angular_core.InputSignal<EntityData | undefined>;
@@ -825,5 +904,5 @@ declare class EntitiesManage extends EntitiesResizeBase {
825
904
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntitiesManage, "mt-entities-manage", never, { "entities": { "alias": "entities"; "required": true; "isSignal": true; }; }, { "entities": "entitiesChange"; "entitiesReordered": "entitiesReordered"; "entityClicked": "entityClicked"; "externalItemDropped": "externalItemDropped"; }, never, never, true, never>;
826
905
  }
827
906
 
828
- export { ComparisonEntityList, ComparisonValue, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityLeafDetails, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPreview, EntityPreviewBody, EntityScheduleItem, EntityStatus, EntityText, EntityUser, LEAF_DETAILS_KEY_SEPARATOR, SECTION_KEY_PREFIX, buildDisplayEntities, buildSectionKey, expandLeafDetailsEntity, getEntitySectionTitle, groupEntitiesIntoSections, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isSectionKey, resolveLocalizedLabel };
829
- export type { ComparisonValueSide, EntityAttachmentItemValue, EntityAttachmentValue, EntityBaseConfig, EntityClickEvent, EntityComparisonField, EntityComparisonOperation, EntityConfiguration, EntityConnectionValue, EntityData, EntityLabelPosition, EntityLeafDetailsConfig, EntityListComparison, EntityListComparisonRow, EntityLocationValue, EntityLookupCheckListItem, EntityLookupCheckListPropValue, EntityLookupCheckListValue, EntityLookupValue, EntityNestedPropertyMeta, EntityPercentageConfig, EntityPropertyConfiguration, EntityResizeEvent, EntityScheduleItemValue, EntitySectionConfig, EntitySectionGroup, EntitySectionLabel, EntitySize, EntityStatusValue, EntityUserConfig, EntityUserValue, EntityViewType, LeafDetailsCatalogConfiguration, LeafDetailsCatalogLevelValue, LeafDetailsCatalogStatusValue, LeafDetailsEntityCollectionValue, LeafDetailsEntityValue, LeafDetailsRuntimeChildSchema, LeafDetailsRuntimeStatusCount, LeafDetailsRuntimeStatusDetails, LeafDetailsRuntimeValue, LeafDetailsStatusSummary, LeafLevelSavedConfig, PropertyValueComparison, ValueComparison };
907
+ export { ComparisonEntityList, ComparisonValue, DEFAULT_PHASE_GATE_COLOR, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityLeafDetails, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityScheduleItem, EntityStatus, EntityText, EntityUser, LEAF_DETAILS_KEY_SEPARATOR, SECTION_KEY_PREFIX, buildDisplayEntities, buildSectionKey, expandLeafDetailsEntity, getEntitySectionTitle, groupEntitiesIntoSections, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isSectionKey, resolveLocalizedLabel };
908
+ export type { ComparisonValueSide, EntityAttachmentItemValue, EntityAttachmentValue, EntityBaseConfig, EntityClickEvent, EntityComparisonField, EntityComparisonOperation, EntityConfiguration, EntityConnectionValue, EntityData, EntityLabelPosition, EntityLeafDetailsConfig, EntityListComparison, EntityListComparisonRow, EntityLocationValue, EntityLookupCheckListItem, EntityLookupCheckListPropValue, EntityLookupCheckListValue, EntityLookupValue, EntityNestedPropertyMeta, EntityPercentageConfig, EntityPhaseGateValue, EntityPropertyConfiguration, EntityResizeEvent, EntityScheduleItemValue, EntitySectionConfig, EntitySectionGroup, EntitySectionLabel, EntitySize, EntityStatusValue, EntityUserConfig, EntityUserValue, EntityViewType, LeafDetailsCatalogConfiguration, LeafDetailsCatalogLevelValue, LeafDetailsCatalogStatusValue, LeafDetailsEntityCollectionValue, LeafDetailsEntityValue, LeafDetailsRuntimeChildSchema, LeafDetailsRuntimeStatusCount, LeafDetailsRuntimeStatusDetails, LeafDetailsRuntimeValue, LeafDetailsStatusSummary, LeafLevelSavedConfig, PropertyValueComparison, ValueComparison };