@masterteam/components 0.0.290 → 0.0.292

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.290",
3
+ "version": "0.0.292",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/components",
6
6
  "linkDirectory": true,
@@ -457,7 +457,17 @@ declare class EntityListField implements ControlValueAccessor {
457
457
  */
458
458
  private toLocalEntityValue;
459
459
  private emitValue;
460
- /** `values[]` entries, restricted to `writeFields` when configured. */
460
+ /**
461
+ * `values[]` entries, restricted to `writeFields` when configured.
462
+ *
463
+ * `submitShaped` carries the dialog-normalized counterpart of `values`,
464
+ * keyed the same way, and is preferred per key. The control value a rich
465
+ * field holds is not the scalar the backend stores — a user picker holds
466
+ * the whole search result, a date picker a `Date` — and only the dialog
467
+ * knows the target module's view types, so it does that reduction. Without
468
+ * it we would stringify the control value as-is and the row would carry a
469
+ * JSON user object where a bare id belongs.
470
+ */
461
471
  private toSubmitValues;
462
472
  /** Backend `rawValue` is a serialized scalar; objects/arrays go as JSON. */
463
473
  private toRawValue;
@@ -467,11 +477,24 @@ declare class EntityListField implements ControlValueAccessor {
467
477
  * Keys the user actually changed. A key that was empty before and is still
468
478
  * empty is skipped (the dialog simply could not pre-fill it); a key that had
469
479
  * a value and is now empty is kept so the backend clears it.
480
+ *
481
+ * `initial` holds stored scalars (a `User` column pre-fills as a bare id)
482
+ * while `next` holds control values (the whole picker result), so the two
483
+ * are only comparable once reduced — hence comparing `submitShaped`.
484
+ * Comparing the rich value directly marked every rich-valued column as
485
+ * changed even when untouched, and the partial update then rewrote it.
470
486
  */
471
487
  private diffValues;
472
488
  private isEmptyValue;
473
489
  private isSameValue;
474
490
  private fetchDraftColumns;
491
+ /**
492
+ * Project a Create form into the catalog shape the column builder expects.
493
+ * Sections and their fields are flattened into reading order and renumbered
494
+ * from there — a field's own `order` is section-relative, so carrying it over
495
+ * as the column order interleaves the sections once `applyResponse` sorts.
496
+ */
497
+ private mapProcessFormProperties;
475
498
  private fetchRows;
476
499
  private applyResponse;
477
500
  private toEntityData;
@@ -547,6 +547,22 @@ interface EntityData {
547
547
  normalizedKey?: string;
548
548
  name?: string;
549
549
  rawValue?: string;
550
+ /**
551
+ * The colour the backend resolved for *this value*, from the value cell's own
552
+ * `color` field.
553
+ *
554
+ * Distinct from `configuration.color`, which is a colour the configuration
555
+ * declares for every value alike. This one is per-record: the backend
556
+ * evaluates a Percentage property's colour rules — or, in `property` mode,
557
+ * the record's colour-bearing source property — and ships the winner here.
558
+ * It is therefore the most specific answer available and outranks anything
559
+ * derived from the configuration.
560
+ *
561
+ * Status and Lookup cells repeat the same colour inside `value`, which is
562
+ * where those renderers already read it; a Percentage's `value` is a
563
+ * formatted string with nowhere to hang a colour, which is why this exists.
564
+ */
565
+ color?: string;
550
566
  order?: number;
551
567
  propertyConfiguration?: EntityPropertyConfiguration;
552
568
  /**
@@ -580,6 +596,19 @@ declare function isValueMissing(value: unknown): boolean;
580
596
  * `String()` so dates/percentages/checkboxes are not wrapped in quotes.
581
597
  */
582
598
  declare function serializeEntityRawValue(raw: unknown): string | undefined;
599
+ /**
600
+ * Reads the colour the backend resolved for a value cell.
601
+ *
602
+ * The cell carries it as a sibling of `raw`/`value` — `{ raw: "22", value:
603
+ * "22%", color: "#FF0000" }` — because for a Percentage the value is a
604
+ * formatted string with nowhere to hang a colour on. Status and Lookup cells
605
+ * repeat it inside `value`, where those renderers already read it.
606
+ *
607
+ * Typed as `unknown` on purpose: every fetch-cell interface in the consuming
608
+ * packages carries an index signature, so a mistyped or absent `color` is a
609
+ * runtime possibility rather than a compile error.
610
+ */
611
+ declare function readEntityValueColor(color: unknown): string | undefined;
583
612
  declare function displayOrPlaceholder(value: unknown): string;
584
613
  /**
585
614
  * Text/LongText values are a plain string, except for translatable
@@ -780,21 +809,18 @@ declare class EntityPercentage {
780
809
  readonly maxValue: _angular_core.Signal<number>;
781
810
  readonly hideName: _angular_core.Signal<boolean>;
782
811
  /**
783
- * The bar colour. The backend evaluates the property's configuration and
812
+ * The bar colour. The backend evaluates the property's colour rules and
784
813
  * returns the winner as `color` on render/value/fetch responses, so a
785
- * resolved colour always wins — the configuration is only evaluated here for
786
- * ones that arrive without it (a catalog read, or the property-form preview).
814
+ * resolved colour always wins — the rules are only evaluated here for
815
+ * configurations that arrive without one (a catalog read, or the
816
+ * property-form preview).
787
817
  *
788
- * A configuration that takes its colour from another property has no
789
- * client-side answer at all: this component is given one entity and cannot
790
- * see the Status or Lookup sitting next to it. Its fallback is the declared
791
- * `defaultColor`, and the rules are skipped entirely.
792
- *
793
- * Dynamic-ness is decided once, across *both* configurations, before either
794
- * is evaluated. Deciding it per-configuration would let a `colorRules` copy
795
- * left on the instance config paint a band colour for a property whose own
796
- * configuration replaced those rules — the one outcome this mode exists to
797
- * prevent.
818
+ * The value's own `color` is checked first and is not the same thing as
819
+ * `configuration.color`: it is resolved per record, so it is the only one
820
+ * that can carry a band colour for *this* value, or the colour a
821
+ * `colorSource: 'property'` configuration took from a sibling property on
822
+ * this record. A configuration-level colour applies to every value alike and
823
+ * cannot answer either question.
798
824
  */
799
825
  readonly progressColor: _angular_core.Signal<string>;
800
826
  /**
@@ -1351,13 +1377,10 @@ declare function currencyUnitOf(formatted: string): string;
1351
1377
  declare function compactCurrencyDisplay(formatted: string, rawValue: string | null | undefined, locale: string, threshold?: number): string;
1352
1378
 
1353
1379
  /**
1354
- * Anything that can supply a percentage colour: a mode, the ordered rule set
1355
- * that mode may consult, the colour-bearing property it may point at instead,
1356
- * and the fallback used when neither produces one.
1380
+ * Anything that can supply a percentage colour: an ordered rule set plus the
1381
+ * fallback used when no rule matches.
1357
1382
  */
1358
1383
  interface PercentageColorSource {
1359
- colorSource?: PercentageColorMode | null;
1360
- colorProperty?: PercentageColorPropertyRef | null;
1361
1384
  colorRules?: PercentageColorRule[] | null;
1362
1385
  defaultColor?: string | null;
1363
1386
  }
@@ -1368,37 +1391,14 @@ interface PercentageColorSource {
1368
1391
  */
1369
1392
  declare function matchesPercentageColorRule(value: number, rule?: PercentageColorRule | null): boolean;
1370
1393
  /**
1371
- * Whether the configuration takes its colour from another property rather than
1372
- * from the percentage value. A mode of `property` with no usable reference is
1373
- * not dynamic — a half-authored configuration must keep behaving like the
1374
- * value-based one rather than losing its colour entirely.
1375
- */
1376
- declare function isDynamicPercentageColorSource(source?: PercentageColorSource | null): boolean;
1377
- /**
1378
- * The colour-bearing property the configuration points at, or `null` when it
1379
- * is value-based.
1380
- *
1381
- * The mode is also inferred from a present reference, not only from
1382
- * `colorSource`: the reference is the part that carries meaning, and a stored
1383
- * configuration that kept it while losing the discriminator must still resolve
1384
- * dynamically instead of silently repainting itself from the rules.
1385
- */
1386
- declare function resolvePercentageColorPropertyRef(source?: PercentageColorSource | null): PercentageColorPropertyRef | null;
1387
- /**
1388
- * The colour for a percentage value.
1389
- *
1390
- * In `rules` mode: the rules in their configured order, first match wins,
1391
- * `defaultColor` when nothing matches. In `property` mode the value decides
1392
- * nothing, and there is nothing here to decide it with — the colour belongs to
1393
- * another property on the same record, which only the backend can read — so the
1394
- * answer is `defaultColor`. The rules are never consulted in that mode: they
1395
- * would paint a value-based colour that the author deliberately replaced.
1394
+ * The colour for a percentage value: rules in their configured order, first
1395
+ * match wins, `defaultColor` when nothing matches.
1396
1396
  *
1397
1397
  * The backend owns this evaluation and ships the winner as `color` on
1398
1398
  * render/value/fetch responses, so callers must prefer that resolved colour.
1399
- * This exists for the surfaces that hold a raw configuration and no resolved
1400
- * colour — the property-form preview, and catalog reads that never went through
1401
- * a value response.
1399
+ * This exists for the surfaces that hold a raw rule set and no resolved colour
1400
+ * — the property-form preview, and catalog reads that never went through a
1401
+ * value response.
1402
1402
  */
1403
1403
  declare function resolvePercentageColor(value: unknown, source?: PercentageColorSource | null): string | null;
1404
1404
 
@@ -1460,7 +1460,7 @@ declare class EntityPreview {
1460
1460
  * `mt-entity-preview` usages in the app.
1461
1461
  */
1462
1462
  readonly infoText: _angular_core.Signal<string>;
1463
- readonly comparisonKind: _angular_core.Signal<"EntityList" | "Value" | null>;
1463
+ readonly comparisonKind: _angular_core.Signal<"Value" | "EntityList" | null>;
1464
1464
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityPreview, never>;
1465
1465
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityPreview, "mt-entity-preview", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "attachmentShape": { "alias": "attachmentShape"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1466
1466
  }
@@ -1723,5 +1723,5 @@ declare class FitText {
1723
1723
 
1724
1724
  declare function sharedActiveLang(transloco: TranslocoService): Signal<string>;
1725
1725
 
1726
- export { CONNECTION_KEY_SEPARATOR, CURRENCY_COMPACT_THRESHOLD, ComparisonEntityList, ComparisonValue, DEFAULT_PHASE_GATE_COLOR, ENTITY_EMPTY_VALUE_PLACEHOLDER, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityIcon, EntityLeafDetails, EntityListDrawer, EntityListPreview, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityScheduleItem, EntityStatus, EntityText, EntityUser, FitText, LEAF_DETAILS_KEY_SEPARATOR, LEAF_PHASES_KEY_SEPARATOR, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildEntityListRows, buildSectionKey, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, groupEntitiesIntoSections, humanizeEntityListKey, isConnectionSyntheticKey, isDynamicPercentageColorSource, isEntityAlignEnd, isEntityLabelHidden, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isLeafPhasesSyntheticKey, isLeafSyntheticKey, isSectionKey, isValueMissing, matchesPercentageColorRule, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, resolveConnectionLevelName, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalizedLabel, resolvePercentageColor, resolvePercentageColorPropertyRef, serializeEntityRawValue, sharedActiveLang, splitConnectionKey, splitLeafKey, summarizeEntityListRows };
1726
+ export { CONNECTION_KEY_SEPARATOR, CURRENCY_COMPACT_THRESHOLD, ComparisonEntityList, ComparisonValue, DEFAULT_PHASE_GATE_COLOR, ENTITY_EMPTY_VALUE_PLACEHOLDER, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityIcon, EntityLeafDetails, EntityListDrawer, EntityListPreview, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityScheduleItem, EntityStatus, EntityText, EntityUser, FitText, LEAF_DETAILS_KEY_SEPARATOR, LEAF_PHASES_KEY_SEPARATOR, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildEntityListRows, buildSectionKey, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, groupEntitiesIntoSections, humanizeEntityListKey, isConnectionSyntheticKey, isEntityAlignEnd, isEntityLabelHidden, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isLeafPhasesSyntheticKey, isLeafSyntheticKey, isSectionKey, isValueMissing, matchesPercentageColorRule, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, readEntityValueColor, resolveConnectionLevelName, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalizedLabel, resolvePercentageColor, serializeEntityRawValue, sharedActiveLang, splitConnectionKey, splitLeafKey, summarizeEntityListRows };
1727
1727
  export type { ComparisonValueSide, ConnectionCatalogConfiguration, ConnectionLevelSavedConfig, ConnectionSourceLevelConfig, EntityAttachmentItemValue, EntityAttachmentValue, EntityBaseConfig, EntityClickEvent, EntityComparisonField, EntityComparisonOperation, EntityConfiguration, EntityConnectionConfig, EntityConnectionSourceValue, EntityConnectionValue, EntityData, EntityLabelPosition, EntityLeafDetailsConfig, EntityListComparison, EntityListComparisonRow, EntityListEntityValue, EntityListInlineFieldMeta, EntityListRenderedRow, EntityListRowValue, EntityListValueItem, EntityLocationValue, EntityLookupCheckListItem, EntityLookupCheckListPropValue, EntityLookupCheckListValue, EntityLookupValue, EntityMultiLookupValue, EntityMultiUserValue, EntityNestedPropertyMeta, EntityPercentageConfig, EntityPhaseGateValue, EntityPropertyConfiguration, EntityResizeEvent, EntityScheduleItemValue, EntitySectionConfig, EntitySectionGroup, EntitySectionLabel, EntitySize, EntityStatusValue, EntityTranslatableTextValue, EntityUserConfig, EntityUserValue, EntityViewType, LeafDetailsBadgeKind, LeafDetailsCatalogConfiguration, LeafDetailsCatalogLevelValue, LeafDetailsCatalogPhaseValue, LeafDetailsCatalogStatusValue, LeafDetailsEntityCollectionValue, LeafDetailsEntityValue, LeafDetailsPhaseSummary, LeafDetailsRuntimeChildSchema, LeafDetailsRuntimePhaseCount, LeafDetailsRuntimePhaseDetails, LeafDetailsRuntimeStatusCount, LeafDetailsRuntimeStatusDetails, LeafDetailsRuntimeValue, LeafDetailsStatusSummary, LeafLevelSavedConfig, LeafPhaseSavedConfig, PercentageColorMode, PercentageColorPropertyRef, PercentageColorRule, PercentageColorSource, PropertyValueComparison, ValueComparison };