@masterteam/components 0.0.230 → 0.0.231
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
|
@@ -36,7 +36,13 @@ 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' | 'Attachment' | 'Location' | 'LookupMatrix' | 'LookupModuleCheckList' | 'LeafDetails' | 'Connection' | 'ScheduleItemSelector'
|
|
40
|
+
/**
|
|
41
|
+
* Layout marker, not a value. Rendered full-width and non-resizable; the
|
|
42
|
+
* preview layer (`groupEntitiesIntoSections`) turns each marker into a titled
|
|
43
|
+
* section box that owns every entity following it until the next marker.
|
|
44
|
+
*/
|
|
45
|
+
| 'Section';
|
|
40
46
|
type EntityLabelPosition = 'top' | 'bottom';
|
|
41
47
|
/** Entity size – controls column span (1-24) inside a 24-column grid */
|
|
42
48
|
type EntitySize = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24;
|
|
@@ -55,6 +61,11 @@ interface EntityBaseConfig {
|
|
|
55
61
|
labelPostion?: EntityLabelPosition;
|
|
56
62
|
/** Whether the entity content is aligned to the end (right in LTR) */
|
|
57
63
|
alignEnd?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Custom localized label override. When present it replaces the catalog
|
|
66
|
+
* label; it also serves as the heading for `Section` markers.
|
|
67
|
+
*/
|
|
68
|
+
label?: EntitySectionLabel;
|
|
58
69
|
}
|
|
59
70
|
interface EntityUserConfig extends EntityBaseConfig {
|
|
60
71
|
showDisplayName?: boolean;
|
|
@@ -76,7 +87,17 @@ interface EntityLeafDetailsConfig extends EntityBaseConfig {
|
|
|
76
87
|
/** Per-level display overrides for LeafDetails entities */
|
|
77
88
|
leafLevels?: Record<string, LeafLevelSavedConfig>;
|
|
78
89
|
}
|
|
79
|
-
|
|
90
|
+
/** A localized label ({ en, ar }) — used by section headings and custom labels. */
|
|
91
|
+
interface EntitySectionLabel {
|
|
92
|
+
en?: string;
|
|
93
|
+
ar?: string;
|
|
94
|
+
}
|
|
95
|
+
/** Configuration for a `Section` layout marker (`viewType: 'Section'`). */
|
|
96
|
+
interface EntitySectionConfig extends EntityBaseConfig {
|
|
97
|
+
/** Section heading, localized. Empty/absent renders a header-less box. */
|
|
98
|
+
label?: EntitySectionLabel;
|
|
99
|
+
}
|
|
100
|
+
type EntityConfiguration = EntityBaseConfig | EntityUserConfig | EntityPercentageConfig | EntityLeafDetailsConfig | EntitySectionConfig;
|
|
80
101
|
interface EntityStatusValue {
|
|
81
102
|
key: string;
|
|
82
103
|
display: string;
|
|
@@ -571,6 +592,51 @@ declare function isLeafDetailsSyntheticKey(key?: string | null): boolean;
|
|
|
571
592
|
declare function expandLeafDetailsEntity(entity: EntityData): EntityData[];
|
|
572
593
|
declare function buildDisplayEntities(entities: EntityData[]): EntityData[];
|
|
573
594
|
|
|
595
|
+
/**
|
|
596
|
+
* A section is persisted/transported as an ordinary display item whose
|
|
597
|
+
* `propertyKey` carries this sentinel prefix instead of a real property key
|
|
598
|
+
* (mirrors the LeafDetails synthetic-key convention). Both the customization
|
|
599
|
+
* builder and the runtime renderer recognize it, so the constant lives here in
|
|
600
|
+
* the shared entities layer rather than in either consumer.
|
|
601
|
+
*/
|
|
602
|
+
declare const SECTION_KEY_PREFIX = "__section__::";
|
|
603
|
+
/** True when a display item's key denotes a section marker. */
|
|
604
|
+
declare function isSectionKey(key?: string | null): boolean;
|
|
605
|
+
/** Mints a unique section marker key. */
|
|
606
|
+
declare function buildSectionKey(): string;
|
|
607
|
+
/**
|
|
608
|
+
* Resolves a localized label (`{ en, ar }`) for the given language, falling
|
|
609
|
+
* back across locales. Returns '' when nothing is set.
|
|
610
|
+
*/
|
|
611
|
+
declare function resolveLocalizedLabel(label: EntitySectionLabel | null | undefined, lang?: string): string;
|
|
612
|
+
/**
|
|
613
|
+
* A run of entities that belong to the same section. `section` is the marker
|
|
614
|
+
* entity (`viewType: 'Section'`) whose title heads the group, or `null` for the
|
|
615
|
+
* leading run of entities that appear before the first marker (rendered bare,
|
|
616
|
+
* with no box — so a card with no markers looks exactly like it did before
|
|
617
|
+
* sections existed).
|
|
618
|
+
*/
|
|
619
|
+
interface EntitySectionGroup {
|
|
620
|
+
section: EntityData | null;
|
|
621
|
+
entities: EntityData[];
|
|
622
|
+
}
|
|
623
|
+
/** True when the entity is a `Section` layout marker rather than a value. */
|
|
624
|
+
declare function isEntitySection(entity: EntityData | null | undefined): entity is EntityData;
|
|
625
|
+
/**
|
|
626
|
+
* Splits a flat, order-sorted entity list into section groups. Membership is
|
|
627
|
+
* purely positional: each entity belongs to whichever `Section` marker precedes
|
|
628
|
+
* it. Pass the output of `buildDisplayEntities` (already sorted by `order`).
|
|
629
|
+
*
|
|
630
|
+
* Zero markers → a single `{ section: null }` group holding everything, so the
|
|
631
|
+
* bare-grid rendering is unchanged. Empty leading/trailing runs are dropped.
|
|
632
|
+
*/
|
|
633
|
+
declare function groupEntitiesIntoSections(entities: EntityData[]): EntitySectionGroup[];
|
|
634
|
+
/**
|
|
635
|
+
* Resolves a section marker's display label for the given language, falling
|
|
636
|
+
* back across locales and finally to the entity's `name`.
|
|
637
|
+
*/
|
|
638
|
+
declare function getEntitySectionTitle(section: EntityData | null | undefined, lang?: string): string;
|
|
639
|
+
|
|
574
640
|
declare class EntityPreview {
|
|
575
641
|
readonly data: _angular_core.InputSignal<EntityData>;
|
|
576
642
|
readonly attachmentShape: _angular_core.InputSignal<"compact" | "default">;
|
|
@@ -661,6 +727,14 @@ declare class EntitiesPreview {
|
|
|
661
727
|
readonly entityClick: _angular_core.OutputEmitterRef<EntityClickEvent>;
|
|
662
728
|
/** Entities expanded and sorted by order */
|
|
663
729
|
readonly displayEntities: _angular_core.Signal<EntityData[]>;
|
|
730
|
+
/**
|
|
731
|
+
* The display entities split into section groups. With no `Section` markers
|
|
732
|
+
* this is a single `{ section: null }` group, so the bare grid renders
|
|
733
|
+
* exactly as before.
|
|
734
|
+
*/
|
|
735
|
+
readonly sectionGroups: _angular_core.Signal<_masterteam_components_entities.EntitySectionGroup[]>;
|
|
736
|
+
/** Localized heading for a section box (empty → header-less box). */
|
|
737
|
+
sectionTitle(section: EntityData | null): string;
|
|
664
738
|
/** Returns the grid-column span for a given entity size (1-24) */
|
|
665
739
|
getColSpan(entity: EntityData): string;
|
|
666
740
|
/** Stable key resolution shared with the host — must agree on order. */
|
|
@@ -729,16 +803,27 @@ declare class EntitiesManage extends EntitiesResizeBase {
|
|
|
729
803
|
readonly entitiesReordered: _angular_core.OutputEmitterRef<EntityData[]>;
|
|
730
804
|
/** Emits when an entity cell is clicked (for opening edit drawer) */
|
|
731
805
|
readonly entityClicked: _angular_core.OutputEmitterRef<EntityData>;
|
|
806
|
+
/**
|
|
807
|
+
* Emits when an item dragged from a *different* connected list (e.g. a sidebar
|
|
808
|
+
* "add section" tool) is dropped onto this grid. `index` is the target slot;
|
|
809
|
+
* `data` is the dropped `cdkDragData`. The host decides what to insert.
|
|
810
|
+
*/
|
|
811
|
+
readonly externalItemDropped: _angular_core.OutputEmitterRef<{
|
|
812
|
+
index: number;
|
|
813
|
+
data: unknown;
|
|
814
|
+
}>;
|
|
732
815
|
/** Entities expanded and sorted by their configured order */
|
|
733
816
|
readonly displayEntities: _angular_core.Signal<EntityData[]>;
|
|
734
817
|
/** Returns the grid-column span for a given entity size (1-24) */
|
|
735
818
|
getColSpan(entity: EntityData): string;
|
|
819
|
+
/** True when the entity is a full-width `Section` layout marker. */
|
|
820
|
+
isSection(entity: EntityData): boolean;
|
|
736
821
|
/** Handle drag-drop reorder */
|
|
737
822
|
onDrop(event: CdkDragDrop<EntityData[]>): void;
|
|
738
823
|
protected onResizeComplete(entity: EntityData, previousSize: EntitySize, newSize: EntitySize): void;
|
|
739
824
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntitiesManage, never>;
|
|
740
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntitiesManage, "mt-entities-manage", never, { "entities": { "alias": "entities"; "required": true; "isSignal": true; }; }, { "entities": "entitiesChange"; "entitiesReordered": "entitiesReordered"; "entityClicked": "entityClicked"; }, never, never, true, never>;
|
|
825
|
+
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>;
|
|
741
826
|
}
|
|
742
827
|
|
|
743
|
-
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, buildDisplayEntities, expandLeafDetailsEntity, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue };
|
|
744
|
-
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, EntitySize, EntityStatusValue, EntityUserConfig, EntityUserValue, EntityViewType, LeafDetailsCatalogConfiguration, LeafDetailsCatalogLevelValue, LeafDetailsCatalogStatusValue, LeafDetailsEntityCollectionValue, LeafDetailsEntityValue, LeafDetailsRuntimeChildSchema, LeafDetailsRuntimeStatusCount, LeafDetailsRuntimeStatusDetails, LeafDetailsRuntimeValue, LeafDetailsStatusSummary, LeafLevelSavedConfig, PropertyValueComparison, ValueComparison };
|
|
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 };
|