@masterteam/components 0.0.281 → 0.0.283
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/common.css +1 -1
- package/assets/i18n/ar.json +382 -368
- package/assets/i18n/en.json +382 -368
- package/fesm2022/masterteam-components-entities.mjs +273 -85
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +59 -1
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +139 -4
- package/types/masterteam-components-formula.d.ts +5 -1
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as _masterteam_components_entities from '@masterteam/components/entities';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
|
-
import { ElementRef, NgZone } from '@angular/core';
|
|
3
|
+
import { ElementRef, NgZone, Signal } from '@angular/core';
|
|
4
4
|
import { MTDateFormatType } from '@masterteam/components';
|
|
5
5
|
import { MTIcon } from '@masterteam/icons';
|
|
6
6
|
import { HttpContext } from '@angular/common/http';
|
|
7
7
|
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
8
|
+
import { TranslocoService } from '@jsverse/transloco';
|
|
8
9
|
|
|
9
10
|
interface ComparisonValueSide {
|
|
10
11
|
raw: unknown;
|
|
@@ -86,6 +87,16 @@ interface EntityBaseConfig {
|
|
|
86
87
|
* label; it also serves as the heading for `Section` markers.
|
|
87
88
|
*/
|
|
88
89
|
label?: EntitySectionLabel;
|
|
90
|
+
/**
|
|
91
|
+
* Admin-authored explanatory note, localized. When present the entity grows a
|
|
92
|
+
* small info affordance at its top-end corner that reveals this text on hover.
|
|
93
|
+
*
|
|
94
|
+
* Plain text, deliberately. Every string inside a `configuration` payload is
|
|
95
|
+
* sanitized server-side with the PlainText profile, which strips HTML tags
|
|
96
|
+
* outright — rich markup authored here would come back as bare words. The
|
|
97
|
+
* renderer preserves the author's own line breaks instead.
|
|
98
|
+
*/
|
|
99
|
+
info?: EntitySectionLabel;
|
|
89
100
|
}
|
|
90
101
|
interface EntityUserConfig extends EntityBaseConfig {
|
|
91
102
|
showDisplayName?: boolean;
|
|
@@ -128,9 +139,29 @@ interface LeafLevelSavedConfig {
|
|
|
128
139
|
/** Status keys the user has chosen to display */
|
|
129
140
|
selectedStatuses: string[];
|
|
130
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Per-level display overrides for the *phase* projection of a LeafDetails
|
|
144
|
+
* property — the sibling of {@link LeafLevelSavedConfig}. The two are kept
|
|
145
|
+
* apart on purpose: one level can contribute a status item, a phase item, or
|
|
146
|
+
* both, each with its own slot and width in the grid.
|
|
147
|
+
*
|
|
148
|
+
* Unlike `leafLevels`, an absent `leafPhases` map hides every phase item.
|
|
149
|
+
* Phases are strictly opt-in so existing cards do not grow badges they were
|
|
150
|
+
* never configured with.
|
|
151
|
+
*/
|
|
152
|
+
interface LeafPhaseSavedConfig {
|
|
153
|
+
/** Position order for this level's phase entity in the preview grid */
|
|
154
|
+
order: number;
|
|
155
|
+
/** Column span (1-24), persisted from drag-resize */
|
|
156
|
+
size?: EntitySize;
|
|
157
|
+
/** Phase keys the user has chosen to display */
|
|
158
|
+
selectedPhases: string[];
|
|
159
|
+
}
|
|
131
160
|
interface EntityLeafDetailsConfig extends EntityBaseConfig {
|
|
132
161
|
/** Per-level display overrides for LeafDetails entities */
|
|
133
162
|
leafLevels?: Record<string, LeafLevelSavedConfig>;
|
|
163
|
+
/** Per-level phase-badge overrides for LeafDetails entities */
|
|
164
|
+
leafPhases?: Record<string, LeafPhaseSavedConfig>;
|
|
134
165
|
}
|
|
135
166
|
/**
|
|
136
167
|
* Per-source-level display overrides for a Connection entity. Unlike
|
|
@@ -256,17 +287,50 @@ interface LeafDetailsCatalogStatusValue {
|
|
|
256
287
|
icon?: string | null;
|
|
257
288
|
order?: number;
|
|
258
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* One phase bucket of a child level, as published on the catalog
|
|
292
|
+
* `configuration` and counted at runtime. `id` is the schema phase-gate id and
|
|
293
|
+
* is `null` on the backend's synthetic "No current phase" bucket — `key` is
|
|
294
|
+
* what the saved configuration selects on, so it is the stable identifier here.
|
|
295
|
+
*/
|
|
296
|
+
interface LeafDetailsCatalogPhaseValue {
|
|
297
|
+
id?: number | null;
|
|
298
|
+
key: string;
|
|
299
|
+
display: string;
|
|
300
|
+
color: string | null;
|
|
301
|
+
icon?: string | null;
|
|
302
|
+
order?: number;
|
|
303
|
+
}
|
|
304
|
+
interface LeafDetailsPhaseSummary {
|
|
305
|
+
id?: number | null;
|
|
306
|
+
key: string;
|
|
307
|
+
display: string;
|
|
308
|
+
color: string | null;
|
|
309
|
+
/** Always 0 in preview/configuration context; populated from runtime fetch */
|
|
310
|
+
count: number;
|
|
311
|
+
}
|
|
259
312
|
interface LeafDetailsCatalogLevelValue {
|
|
260
313
|
levelId: number;
|
|
261
314
|
levelName: string;
|
|
262
315
|
levelIcon: string;
|
|
263
316
|
statuses: LeafDetailsCatalogStatusValue[];
|
|
317
|
+
/** Absent for child levels the tenant has defined no phase gates on. */
|
|
318
|
+
phases?: LeafDetailsCatalogPhaseValue[] | null;
|
|
264
319
|
}
|
|
320
|
+
/** Which projection of a child level an expanded LeafDetails item renders. */
|
|
321
|
+
type LeafDetailsBadgeKind = 'status' | 'phase';
|
|
265
322
|
interface LeafDetailsEntityValue {
|
|
266
323
|
levelId: number;
|
|
267
324
|
levelName: string;
|
|
268
325
|
levelIcon: string;
|
|
269
326
|
statuses: LeafDetailsStatusSummary[];
|
|
327
|
+
phases?: LeafDetailsPhaseSummary[];
|
|
328
|
+
/**
|
|
329
|
+
* Set by `expandLeafDetailsEntity` on the split items. `'status'` (or absent,
|
|
330
|
+
* for values produced before phases existed) renders the status badges;
|
|
331
|
+
* `'phase'` renders the phase badges.
|
|
332
|
+
*/
|
|
333
|
+
kind?: LeafDetailsBadgeKind;
|
|
270
334
|
}
|
|
271
335
|
type LeafDetailsEntityCollectionValue = LeafDetailsEntityValue[];
|
|
272
336
|
type LeafDetailsCatalogConfiguration = LeafDetailsCatalogLevelValue[];
|
|
@@ -283,12 +347,26 @@ interface LeafDetailsRuntimeStatusCount {
|
|
|
283
347
|
details: LeafDetailsRuntimeStatusDetails;
|
|
284
348
|
count: number;
|
|
285
349
|
}
|
|
350
|
+
interface LeafDetailsRuntimePhaseDetails {
|
|
351
|
+
id?: number | null;
|
|
352
|
+
key: string;
|
|
353
|
+
display: string;
|
|
354
|
+
color: string | null;
|
|
355
|
+
icon?: string | null;
|
|
356
|
+
order?: number;
|
|
357
|
+
}
|
|
358
|
+
interface LeafDetailsRuntimePhaseCount {
|
|
359
|
+
details: LeafDetailsRuntimePhaseDetails;
|
|
360
|
+
count: number;
|
|
361
|
+
}
|
|
286
362
|
interface LeafDetailsRuntimeChildSchema {
|
|
287
363
|
levelId: number;
|
|
288
364
|
levelName: string;
|
|
289
365
|
levelIcon: string;
|
|
290
366
|
totalCount?: number;
|
|
291
367
|
statuses: LeafDetailsRuntimeStatusCount[];
|
|
368
|
+
/** Absent for child levels the tenant has defined no phase gates on. */
|
|
369
|
+
phases?: LeafDetailsRuntimePhaseCount[] | null;
|
|
292
370
|
}
|
|
293
371
|
interface LeafDetailsRuntimeValue {
|
|
294
372
|
totalCount?: number;
|
|
@@ -416,6 +494,16 @@ declare function displayOrPlaceholder(value: unknown): string;
|
|
|
416
494
|
declare function extractDisplayText(value: unknown): string | null;
|
|
417
495
|
declare function isEntityLabelHidden(configuration?: EntityConfiguration | null): boolean;
|
|
418
496
|
declare function isEntityAlignEnd(configuration?: EntityConfiguration | null): boolean;
|
|
497
|
+
/**
|
|
498
|
+
* The admin-authored note attached to a property in the customization drawer
|
|
499
|
+
* (`configuration.info`), resolved for the active language.
|
|
500
|
+
*
|
|
501
|
+
* Returns `''` when there is no note, which is what the renderer keys off to
|
|
502
|
+
* decide whether the entity gets an info affordance at all. The drawer omits
|
|
503
|
+
* the key entirely rather than writing an empty object, so "absent" and "blank"
|
|
504
|
+
* collapse to the same answer here on purpose.
|
|
505
|
+
*/
|
|
506
|
+
declare function resolveEntityInfo(configuration?: EntityConfiguration | null, lang?: string): string;
|
|
419
507
|
/**
|
|
420
508
|
* The product default: label above value.
|
|
421
509
|
*
|
|
@@ -867,9 +955,28 @@ declare class EntityLookupModuleCheckList {
|
|
|
867
955
|
}
|
|
868
956
|
|
|
869
957
|
declare class EntityLeafDetails {
|
|
958
|
+
private readonly transloco;
|
|
870
959
|
readonly data: _angular_core.InputSignal<EntityData>;
|
|
960
|
+
/**
|
|
961
|
+
* Re-resolves the "Phases" qualifier when the user switches language. The
|
|
962
|
+
* shared signal keeps this to one subscription for the whole grid — a cards
|
|
963
|
+
* board mounts thousands of these.
|
|
964
|
+
*/
|
|
965
|
+
private readonly activeLang;
|
|
871
966
|
readonly leafValue: _angular_core.Signal<LeafDetailsEntityValue | null>;
|
|
872
|
-
/**
|
|
967
|
+
/** True when this item paints the level's phase badges instead of statuses. */
|
|
968
|
+
readonly isPhaseItem: _angular_core.Signal<boolean>;
|
|
969
|
+
/**
|
|
970
|
+
* The badges to paint. Phases and statuses carry the same `{ key, display,
|
|
971
|
+
* color, count }` shape, so one template drives both — only which projection
|
|
972
|
+
* of the level is read differs.
|
|
973
|
+
*/
|
|
974
|
+
readonly badges: _angular_core.Signal<LeafDetailsStatusSummary[]>;
|
|
975
|
+
/**
|
|
976
|
+
* Label shown below the badges: "Level Name (total)", with a "— Phases"
|
|
977
|
+
* qualifier on the phase item so a level configured with both projections
|
|
978
|
+
* does not render two identically-labelled tiles.
|
|
979
|
+
*/
|
|
873
980
|
readonly labelWithTotal: _angular_core.Signal<string>;
|
|
874
981
|
readonly labelIcon: _angular_core.Signal<string | null>;
|
|
875
982
|
statusColor(color: string | null): string;
|
|
@@ -884,11 +991,27 @@ declare class EntityLeafDetails {
|
|
|
884
991
|
}
|
|
885
992
|
|
|
886
993
|
declare const LEAF_DETAILS_KEY_SEPARATOR = "::leaflevel::";
|
|
994
|
+
/**
|
|
995
|
+
* The phase projection of the same child level. One level can contribute both
|
|
996
|
+
* a status item and a phase item to the same area, so they need distinct keys
|
|
997
|
+
* — the key is what each item's persisted order/size is looked up by.
|
|
998
|
+
*/
|
|
999
|
+
declare const LEAF_PHASES_KEY_SEPARATOR = "::leafphase::";
|
|
887
1000
|
declare function isLeafDetailsValue(value: unknown): value is LeafDetailsEntityValue;
|
|
888
1001
|
declare function isLeafDetailsCollectionValue(value: unknown): value is LeafDetailsEntityCollectionValue;
|
|
889
1002
|
declare function isLeafDetailsCatalogConfiguration(value: unknown): value is LeafDetailsCatalogConfiguration;
|
|
890
1003
|
declare function isLeafDetailsRuntimeValue(value: unknown): value is LeafDetailsRuntimeValue;
|
|
891
1004
|
declare function isLeafDetailsSyntheticKey(key?: string | null): boolean;
|
|
1005
|
+
/** True for the key of an expanded *phase* item of a LeafDetails property. */
|
|
1006
|
+
declare function isLeafPhasesSyntheticKey(key?: string | null): boolean;
|
|
1007
|
+
/** True for either projection's expanded key. */
|
|
1008
|
+
declare function isLeafSyntheticKey(key?: string | null): boolean;
|
|
1009
|
+
/** Splits either projection's expanded key back into property key + level id. */
|
|
1010
|
+
declare function splitLeafKey(key: string): {
|
|
1011
|
+
propertyKey: string;
|
|
1012
|
+
levelId: string;
|
|
1013
|
+
kind: 'status' | 'phase';
|
|
1014
|
+
};
|
|
892
1015
|
declare function expandLeafDetailsEntity(entity: EntityData): EntityData[];
|
|
893
1016
|
/**
|
|
894
1017
|
* Expands the entity types that render as several items — LeafDetails levels
|
|
@@ -1041,8 +1164,18 @@ declare function groupEntitiesIntoSections(entities: EntityData[]): EntitySectio
|
|
|
1041
1164
|
declare function getEntitySectionTitle(section: EntityData | null | undefined, lang?: string): string;
|
|
1042
1165
|
|
|
1043
1166
|
declare class EntityPreview {
|
|
1167
|
+
private readonly transloco;
|
|
1044
1168
|
readonly data: _angular_core.InputSignal<EntityData>;
|
|
1045
1169
|
readonly attachmentShape: _angular_core.InputSignal<"compact" | "default">;
|
|
1170
|
+
private readonly activeLang;
|
|
1171
|
+
/**
|
|
1172
|
+
* The admin-authored note for the active language, or `''` when the property
|
|
1173
|
+
* has none. Resolved here rather than in each `entity-*` component because
|
|
1174
|
+
* this is the one wrapper every view type and every call site passes through
|
|
1175
|
+
* — the card grid, the customization builder preview, and the standalone
|
|
1176
|
+
* `mt-entity-preview` usages in the app.
|
|
1177
|
+
*/
|
|
1178
|
+
readonly infoText: _angular_core.Signal<string>;
|
|
1046
1179
|
readonly comparisonKind: _angular_core.Signal<"Value" | "EntityList" | null>;
|
|
1047
1180
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityPreview, never>;
|
|
1048
1181
|
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>;
|
|
@@ -1298,5 +1431,7 @@ declare class FitText {
|
|
|
1298
1431
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<FitText, "[mtFitText]", never, { "mtFitText": { "alias": "mtFitText"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1299
1432
|
}
|
|
1300
1433
|
|
|
1301
|
-
|
|
1302
|
-
|
|
1434
|
+
declare function sharedActiveLang(transloco: TranslocoService): Signal<string>;
|
|
1435
|
+
|
|
1436
|
+
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, 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, buildSectionKey, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, groupEntitiesIntoSections, isConnectionSyntheticKey, isEntityAlignEnd, isEntityLabelHidden, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isLeafPhasesSyntheticKey, isLeafSyntheticKey, isSectionKey, isValueMissing, matchesPercentageColorRule, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, resolveConnectionLevelName, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalizedLabel, resolvePercentageColor, serializeEntityRawValue, sharedActiveLang, splitConnectionKey, splitLeafKey };
|
|
1437
|
+
export type { ComparisonValueSide, ConnectionCatalogConfiguration, ConnectionLevelSavedConfig, ConnectionSourceLevelConfig, EntityAttachmentItemValue, EntityAttachmentValue, EntityBaseConfig, EntityClickEvent, EntityComparisonField, EntityComparisonOperation, EntityConfiguration, EntityConnectionConfig, EntityConnectionSourceValue, EntityConnectionValue, EntityData, EntityLabelPosition, EntityLeafDetailsConfig, EntityListComparison, EntityListComparisonRow, 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, PercentageColorRule, PercentageColorSource, PropertyValueComparison, ValueComparison };
|
|
@@ -297,7 +297,11 @@ interface FunctionCategoryGroup {
|
|
|
297
297
|
interface OperatorDefinition {
|
|
298
298
|
symbol: string;
|
|
299
299
|
name: string;
|
|
300
|
-
|
|
300
|
+
/**
|
|
301
|
+
* 'grouping' covers the syntax pieces the toolbar also has to offer — the
|
|
302
|
+
* parens that override precedence and the comma that separates arguments.
|
|
303
|
+
*/
|
|
304
|
+
type: 'arithmetic' | 'comparison' | 'logical' | 'grouping';
|
|
301
305
|
description: string;
|
|
302
306
|
precedence: number;
|
|
303
307
|
}
|