@masterteam/components 0.0.280 → 0.0.282
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 +15 -0
- package/assets/i18n/en.json +15 -0
- package/fesm2022/masterteam-components-entities.mjs +136 -75
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +141 -4
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +35 -2
- package/types/masterteam-components-formula.d.ts +68 -3
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;
|
|
@@ -416,6 +427,16 @@ declare function displayOrPlaceholder(value: unknown): string;
|
|
|
416
427
|
declare function extractDisplayText(value: unknown): string | null;
|
|
417
428
|
declare function isEntityLabelHidden(configuration?: EntityConfiguration | null): boolean;
|
|
418
429
|
declare function isEntityAlignEnd(configuration?: EntityConfiguration | null): boolean;
|
|
430
|
+
/**
|
|
431
|
+
* The admin-authored note attached to a property in the customization drawer
|
|
432
|
+
* (`configuration.info`), resolved for the active language.
|
|
433
|
+
*
|
|
434
|
+
* Returns `''` when there is no note, which is what the renderer keys off to
|
|
435
|
+
* decide whether the entity gets an info affordance at all. The drawer omits
|
|
436
|
+
* the key entirely rather than writing an empty object, so "absent" and "blank"
|
|
437
|
+
* collapse to the same answer here on purpose.
|
|
438
|
+
*/
|
|
439
|
+
declare function resolveEntityInfo(configuration?: EntityConfiguration | null, lang?: string): string;
|
|
419
440
|
/**
|
|
420
441
|
* The product default: label above value.
|
|
421
442
|
*
|
|
@@ -1041,8 +1062,18 @@ declare function groupEntitiesIntoSections(entities: EntityData[]): EntitySectio
|
|
|
1041
1062
|
declare function getEntitySectionTitle(section: EntityData | null | undefined, lang?: string): string;
|
|
1042
1063
|
|
|
1043
1064
|
declare class EntityPreview {
|
|
1065
|
+
private readonly transloco;
|
|
1044
1066
|
readonly data: _angular_core.InputSignal<EntityData>;
|
|
1045
1067
|
readonly attachmentShape: _angular_core.InputSignal<"compact" | "default">;
|
|
1068
|
+
private readonly activeLang;
|
|
1069
|
+
/**
|
|
1070
|
+
* The admin-authored note for the active language, or `''` when the property
|
|
1071
|
+
* has none. Resolved here rather than in each `entity-*` component because
|
|
1072
|
+
* this is the one wrapper every view type and every call site passes through
|
|
1073
|
+
* — the card grid, the customization builder preview, and the standalone
|
|
1074
|
+
* `mt-entity-preview` usages in the app.
|
|
1075
|
+
*/
|
|
1076
|
+
readonly infoText: _angular_core.Signal<string>;
|
|
1046
1077
|
readonly comparisonKind: _angular_core.Signal<"Value" | "EntityList" | null>;
|
|
1047
1078
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityPreview, never>;
|
|
1048
1079
|
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 +1329,7 @@ declare class FitText {
|
|
|
1298
1329
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<FitText, "[mtFitText]", never, { "mtFitText": { "alias": "mtFitText"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1299
1330
|
}
|
|
1300
1331
|
|
|
1301
|
-
|
|
1332
|
+
declare function sharedActiveLang(transloco: TranslocoService): Signal<string>;
|
|
1333
|
+
|
|
1334
|
+
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, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildSectionKey, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, groupEntitiesIntoSections, isConnectionSyntheticKey, isEntityAlignEnd, isEntityLabelHidden, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isSectionKey, isValueMissing, matchesPercentageColorRule, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, resolveConnectionLevelName, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalizedLabel, resolvePercentageColor, serializeEntityRawValue, sharedActiveLang, splitConnectionKey };
|
|
1302
1335
|
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, LeafDetailsCatalogConfiguration, LeafDetailsCatalogLevelValue, LeafDetailsCatalogStatusValue, LeafDetailsEntityCollectionValue, LeafDetailsEntityValue, LeafDetailsRuntimeChildSchema, LeafDetailsRuntimeStatusCount, LeafDetailsRuntimeStatusDetails, LeafDetailsRuntimeValue, LeafDetailsStatusSummary, LeafLevelSavedConfig, 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
|
}
|
|
@@ -477,6 +481,22 @@ interface FormulaToolbarPropertyItem {
|
|
|
477
481
|
key: string;
|
|
478
482
|
name?: string;
|
|
479
483
|
description?: string;
|
|
484
|
+
/**
|
|
485
|
+
* Marks a property whose comparison values come from a real source (a
|
|
486
|
+
* lookup, a lookup matrix, a status set) instead of being typed by hand.
|
|
487
|
+
* The toolbar renders a values toggle on such chips and asks the host for
|
|
488
|
+
* the items through `onPropertyValuesRequest`.
|
|
489
|
+
*/
|
|
490
|
+
hasValues?: boolean;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* One selectable value of a value-backed property. `key` is what the formula
|
|
494
|
+
* stores and what the engine compares against; `name` is only the label shown
|
|
495
|
+
* on the chip.
|
|
496
|
+
*/
|
|
497
|
+
interface FormulaToolbarValueItem {
|
|
498
|
+
key: string;
|
|
499
|
+
name: string;
|
|
480
500
|
}
|
|
481
501
|
interface OperatorGroup {
|
|
482
502
|
type: string;
|
|
@@ -490,6 +510,14 @@ declare class FormulaToolbar {
|
|
|
490
510
|
readonly propertiesTemplate: _angular_core.InputSignal<TemplateRef<FormulaToolbarPropertiesContext> | null>;
|
|
491
511
|
/** Projected properties template */
|
|
492
512
|
readonly projectedPropertiesTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
513
|
+
/**
|
|
514
|
+
* Values of value-backed properties, keyed by property key. Supplied by the
|
|
515
|
+
* host (usually lazily, in response to `onPropertyValuesRequest`); a key
|
|
516
|
+
* present here — even with an empty array — counts as loaded.
|
|
517
|
+
*/
|
|
518
|
+
readonly propertyValues: _angular_core.InputSignal<Record<string, readonly FormulaToolbarValueItem[]>>;
|
|
519
|
+
/** Property key whose values are currently being fetched by the host. */
|
|
520
|
+
readonly loadingValuesFor: _angular_core.InputSignal<string | null>;
|
|
493
521
|
/** Function categories (from API or static data) */
|
|
494
522
|
readonly functionCategories: _angular_core.InputSignal<FunctionCategoryGroup[]>;
|
|
495
523
|
/** Operators list (overridable) */
|
|
@@ -508,11 +536,18 @@ declare class FormulaToolbar {
|
|
|
508
536
|
noFunctionsFound?: string;
|
|
509
537
|
noPropertiesAvailable?: string;
|
|
510
538
|
noOperatorsFound?: string;
|
|
539
|
+
values?: string;
|
|
540
|
+
noValuesAvailable?: string;
|
|
511
541
|
}>;
|
|
512
542
|
/** Insert event - emits SmartBlock for the editor */
|
|
513
543
|
readonly onBlockInsert: _angular_core.OutputEmitterRef<SmartBlock>;
|
|
514
544
|
/** Tab change event */
|
|
515
545
|
readonly onTabChange: _angular_core.OutputEmitterRef<ToolbarTab>;
|
|
546
|
+
/**
|
|
547
|
+
* A value-backed property was expanded and its values are not in
|
|
548
|
+
* `propertyValues` yet — the host should fetch them for this key.
|
|
549
|
+
*/
|
|
550
|
+
readonly onPropertyValuesRequest: _angular_core.OutputEmitterRef<string>;
|
|
516
551
|
/** Active tab */
|
|
517
552
|
readonly activeTab: _angular_core.WritableSignal<ToolbarTab>;
|
|
518
553
|
/** Tab options */
|
|
@@ -529,6 +564,8 @@ declare class FormulaToolbar {
|
|
|
529
564
|
protected readonly propertiesTemplateContext: FormulaToolbarPropertiesContext;
|
|
530
565
|
/** Resolve properties template (projected first, input fallback) */
|
|
531
566
|
readonly resolvedPropertiesTemplate: _angular_core.Signal<TemplateRef<any> | null>;
|
|
567
|
+
/** Property key whose value list is currently expanded, if any. */
|
|
568
|
+
readonly expandedPropertyKey: _angular_core.WritableSignal<string | null>;
|
|
532
569
|
/** Search query */
|
|
533
570
|
readonly searchQuery: _angular_core.WritableSignal<string>;
|
|
534
571
|
/** Custom value input */
|
|
@@ -552,6 +589,20 @@ declare class FormulaToolbar {
|
|
|
552
589
|
readonly propertyItems: _angular_core.Signal<FormulaToolbarPropertyItem[]>;
|
|
553
590
|
/** Filtered properties based on search */
|
|
554
591
|
readonly filteredProperties: _angular_core.Signal<FormulaToolbarPropertyItem[]>;
|
|
592
|
+
/**
|
|
593
|
+
* The expanded property, but only while it survives the current search —
|
|
594
|
+
* filtering it away collapses the panel without touching the stored key.
|
|
595
|
+
*/
|
|
596
|
+
readonly expandedProperty: _angular_core.Signal<FormulaToolbarPropertyItem | null>;
|
|
597
|
+
/** Values of the expanded property, or an empty list while none is open. */
|
|
598
|
+
readonly expandedPropertyValues: _angular_core.Signal<readonly FormulaToolbarValueItem[]>;
|
|
599
|
+
/** True while the expanded property's values are still being fetched. */
|
|
600
|
+
readonly isLoadingExpandedValues: _angular_core.Signal<boolean>;
|
|
601
|
+
/**
|
|
602
|
+
* True when the expanded property finished loading and genuinely has no
|
|
603
|
+
* values — distinct from "still loading", so the empty note does not flash.
|
|
604
|
+
*/
|
|
605
|
+
readonly hasNoExpandedValues: _angular_core.Signal<boolean>;
|
|
555
606
|
/** Operators translated through the active locale */
|
|
556
607
|
private readonly translatedOperators;
|
|
557
608
|
/** Filtered operators based on search */
|
|
@@ -581,6 +632,8 @@ declare class FormulaToolbar {
|
|
|
581
632
|
readonly labelNoFunctions: _angular_core.Signal<string>;
|
|
582
633
|
readonly labelNoProperties: _angular_core.Signal<string>;
|
|
583
634
|
readonly labelNoOperators: _angular_core.Signal<string>;
|
|
635
|
+
readonly labelValues: _angular_core.Signal<string>;
|
|
636
|
+
readonly labelNoValues: _angular_core.Signal<string>;
|
|
584
637
|
/** Get count for a specific tab (filtered when searching) */
|
|
585
638
|
getTabCount(tab: ToolbarTab): number;
|
|
586
639
|
/** Check if a tab has results when searching */
|
|
@@ -591,12 +644,24 @@ declare class FormulaToolbar {
|
|
|
591
644
|
insertBlock(block: SmartBlock): void;
|
|
592
645
|
/** Clear search */
|
|
593
646
|
clearSearch(): void;
|
|
647
|
+
/**
|
|
648
|
+
* Open (or close) the value list of a value-backed property, asking the host
|
|
649
|
+
* to load the items the first time that key is opened.
|
|
650
|
+
*/
|
|
651
|
+
togglePropertyValues(property: FormulaToolbarPropertyItem): void;
|
|
652
|
+
/** Whether a property's value list is the one currently expanded. */
|
|
653
|
+
isPropertyExpanded(propertyKey: string): boolean;
|
|
654
|
+
/**
|
|
655
|
+
* Insert a picked value as a literal. The item's `key` is what gets stored
|
|
656
|
+
* and compared; the name rides along as the chip's display label only.
|
|
657
|
+
*/
|
|
658
|
+
insertPropertyValue(item: FormulaToolbarValueItem): void;
|
|
594
659
|
/** Insert custom value */
|
|
595
660
|
insertCustomValue(): void;
|
|
596
661
|
/** Clear custom value input */
|
|
597
662
|
clearCustomValue(): void;
|
|
598
663
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormulaToolbar, never>;
|
|
599
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormulaToolbar, "mt-formula-toolbar", never, { "knownProperties": { "alias": "knownProperties"; "required": false; "isSignal": true; }; "propertiesTemplate": { "alias": "propertiesTemplate"; "required": false; "isSignal": true; }; "functionCategories": { "alias": "functionCategories"; "required": false; "isSignal": true; }; "operators": { "alias": "operators"; "required": false; "isSignal": true; }; "initialTab": { "alias": "initialTab"; "required": false; "isSignal": true; }; "visibleTabs": { "alias": "visibleTabs"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; }, { "onBlockInsert": "onBlockInsert"; "onTabChange": "onTabChange"; }, ["projectedPropertiesTemplate"], never, true, never>;
|
|
664
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormulaToolbar, "mt-formula-toolbar", never, { "knownProperties": { "alias": "knownProperties"; "required": false; "isSignal": true; }; "propertiesTemplate": { "alias": "propertiesTemplate"; "required": false; "isSignal": true; }; "propertyValues": { "alias": "propertyValues"; "required": false; "isSignal": true; }; "loadingValuesFor": { "alias": "loadingValuesFor"; "required": false; "isSignal": true; }; "functionCategories": { "alias": "functionCategories"; "required": false; "isSignal": true; }; "operators": { "alias": "operators"; "required": false; "isSignal": true; }; "initialTab": { "alias": "initialTab"; "required": false; "isSignal": true; }; "visibleTabs": { "alias": "visibleTabs"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; }, { "onBlockInsert": "onBlockInsert"; "onTabChange": "onTabChange"; "onPropertyValuesRequest": "onPropertyValuesRequest"; }, ["projectedPropertiesTemplate"], never, true, never>;
|
|
600
665
|
}
|
|
601
666
|
|
|
602
667
|
declare const OPERATOR_SYMBOL_TO_TRANSLATION_KEY: Record<string, string>;
|
|
@@ -756,4 +821,4 @@ declare class FormulaRuntimeEngine {
|
|
|
756
821
|
}
|
|
757
822
|
|
|
758
823
|
export { CONDITION_FUNCTION_CATEGORIES, CONDITION_OPERATORS, CONDITION_RUNTIME_CATALOG, DEFAULT_OPERATORS, FormulaEditor, FormulaEditorCode, FormulaRuntimeEngine, FormulaStatusBar, FormulaToolbar, FormulaToolbarItem, OPERATOR_SYMBOL_TO_TRANSLATION_KEY, VALIDATION_FUNCTION_CATEGORIES, VALIDATION_OPERATORS, VALIDATION_RUNTIME_CATALOG, cloneBlock, cloneToken, cloneTokens, createFunctionBlock, createFunctionTokens, createLiteralBlock, createLiteralToken, createOperatorBlock, createOperatorToken, createPropertyBlock, createPropertyToken, createTextToken, findFunctionRange, generateFunctionId, generateSmartBlockId, generateTokenId, getArgumentIndexAtPosition, getFunctionTokens, isValidDropPosition, parseSignature, recalculateDepths, serializeTokens, serializeTokensForDisplay, shouldInsertSpace, tokenizeFormulaTemplate };
|
|
759
|
-
export type { ApiErrorResponse, ArgumentSlot, AutocompleteContext, AutocompleteRequest, AutocompleteResponse, AutocompleteSuggestion, BlockType, DragBehavior, ExampleItem, FormulaConditionEvaluation, FormulaEvaluationContext, FormulaRuntimeCatalog, FormulaRuntimeDomain, FormulaRuntimeEngineError, FormulaRuntimeEngineErrorCode, FormulaToken, FormulaToolbarPropertiesContext, FormulaToolbarPropertyItem, FormulaValidationEvaluation, FormulaValidationRulesEvaluation, FunctionCategory, FunctionCategoryGroup, FunctionDefinition, FunctionExample, FunctionInfo, OperatorDefinition, ParameterDefinition, SmartBlock, TokenType, ToolbarItemType, ToolbarTab, ValidationError, ValidationRequest, ValidationResult, ValidationSeverity, ValidationWarning };
|
|
824
|
+
export type { ApiErrorResponse, ArgumentSlot, AutocompleteContext, AutocompleteRequest, AutocompleteResponse, AutocompleteSuggestion, BlockType, DragBehavior, ExampleItem, FormulaConditionEvaluation, FormulaEvaluationContext, FormulaRuntimeCatalog, FormulaRuntimeDomain, FormulaRuntimeEngineError, FormulaRuntimeEngineErrorCode, FormulaToken, FormulaToolbarPropertiesContext, FormulaToolbarPropertyItem, FormulaToolbarValueItem, FormulaValidationEvaluation, FormulaValidationRulesEvaluation, FunctionCategory, FunctionCategoryGroup, FunctionDefinition, FunctionExample, FunctionInfo, OperatorDefinition, ParameterDefinition, SmartBlock, TokenType, ToolbarItemType, ToolbarTab, ValidationError, ValidationRequest, ValidationResult, ValidationSeverity, ValidationWarning };
|