@masterteam/components 0.0.261 → 0.0.263
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/fesm2022/masterteam-components-date-field.mjs +17 -2
- package/fesm2022/masterteam-components-date-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +103 -66
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +34 -8
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-uploader.mjs +28 -2
- package/fesm2022/masterteam-components-uploader.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +67 -4
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-date-field.d.ts +3 -1
- package/types/masterteam-components-entities.d.ts +48 -14
- package/types/masterteam-components-table.d.ts +9 -2
- package/types/masterteam-components.d.ts +27 -2
package/package.json
CHANGED
|
@@ -19,7 +19,9 @@ declare class DateField implements ControlValueAccessor, OnInit, OnChanges {
|
|
|
19
19
|
/**
|
|
20
20
|
* Hides the calendar and edits only the clock time. The bound value stays a
|
|
21
21
|
* full `Date` — PrimeNG keeps the existing date part (or today's, when the
|
|
22
|
-
* control is empty) —
|
|
22
|
+
* control is empty) — but that date part is scratch state: a wall-clock
|
|
23
|
+
* `HH:mm:ss` string is accepted on write, and consumers storing a `Time`
|
|
24
|
+
* value are expected to serialize only the clock back out.
|
|
23
25
|
*/
|
|
24
26
|
readonly timeOnly: _angular_core.InputSignal<boolean>;
|
|
25
27
|
readonly minDate: _angular_core.InputSignal<Date | null | undefined>;
|
|
@@ -372,9 +372,9 @@ declare class EntityDate {
|
|
|
372
372
|
readonly viewType: _angular_core.InputSignal<"Date" | "DateTime" | "Time">;
|
|
373
373
|
readonly displayName: _angular_core.Signal<string>;
|
|
374
374
|
/**
|
|
375
|
-
* `Time` carries
|
|
376
|
-
*
|
|
377
|
-
* viewer's timezone
|
|
375
|
+
* `Time` carries a wall-clock value (`HH:mm:ss`) with no date and no zone, so
|
|
376
|
+
* `mtDateFormat` renders it as stored instead of shifting it into the
|
|
377
|
+
* viewer's timezone the way its `DateTime` sibling is shifted.
|
|
378
378
|
*/
|
|
379
379
|
readonly resolvedViewType: _angular_core.Signal<MTDateFormatType>;
|
|
380
380
|
readonly displayValue: _angular_core.Signal<unknown>;
|
|
@@ -856,6 +856,32 @@ interface EntityClickEvent {
|
|
|
856
856
|
key: string;
|
|
857
857
|
source: MouseEvent;
|
|
858
858
|
}
|
|
859
|
+
/**
|
|
860
|
+
* One entity's fully-resolved render inputs.
|
|
861
|
+
*
|
|
862
|
+
* Precomputing these is what keeps large grids cheap. The template used to call
|
|
863
|
+
* `isClickable` / `isActive` / `getColSpan` roughly eight times per entity on
|
|
864
|
+
* *every* change detection pass; in a client-list card grid (60 cards of ~50
|
|
865
|
+
* entities) that was tens of thousands of calls per tick. A slot is now rebuilt
|
|
866
|
+
* only when the entity list, the clickable/active key sets, or the tooltip
|
|
867
|
+
* strings actually change.
|
|
868
|
+
*/
|
|
869
|
+
interface EntitySlot {
|
|
870
|
+
entity: EntityData;
|
|
871
|
+
trackKey: string;
|
|
872
|
+
containerClass: string;
|
|
873
|
+
colSpan: string;
|
|
874
|
+
clickable: boolean;
|
|
875
|
+
rowClickIgnore: 'true' | null;
|
|
876
|
+
title: string | null;
|
|
877
|
+
}
|
|
878
|
+
/** A section box (or the leading bare run) with its slots already resolved. */
|
|
879
|
+
interface EntitySlotGroup {
|
|
880
|
+
trackKey: string;
|
|
881
|
+
boxed: boolean;
|
|
882
|
+
title: string;
|
|
883
|
+
slots: EntitySlot[];
|
|
884
|
+
}
|
|
859
885
|
declare class EntitiesPreview {
|
|
860
886
|
private readonly transloco;
|
|
861
887
|
/** Array of entity data to display */
|
|
@@ -875,12 +901,16 @@ declare class EntitiesPreview {
|
|
|
875
901
|
* clicks emit). Pass `new Set([...])` from a computed signal in the host
|
|
876
902
|
* for reactive enabling — when the host's set changes, Angular re-renders
|
|
877
903
|
* via its normal change detection, no manual subscriptions required.
|
|
904
|
+
*
|
|
905
|
+
* Pass a *stable* reference: a host method that mints a fresh `Set` on every
|
|
906
|
+
* call re-writes this input on every change detection pass and defeats the
|
|
907
|
+
* slot memoization below.
|
|
878
908
|
*/
|
|
879
909
|
readonly clickableKeys: _angular_core.InputSignal<ReadonlySet<string>>;
|
|
880
910
|
/**
|
|
881
911
|
* Set of entity keys that should render with the "active" treatment
|
|
882
|
-
* (e.g. currently the filter source). Same reactive pattern
|
|
883
|
-
*
|
|
912
|
+
* (e.g. currently the filter source). Same reactive pattern — and the same
|
|
913
|
+
* stable-reference requirement — as `clickableKeys`.
|
|
884
914
|
*/
|
|
885
915
|
readonly activeKeys: _angular_core.InputSignal<ReadonlySet<string>>;
|
|
886
916
|
/** Tooltip text shown on hover when an entity is clickable but not active. */
|
|
@@ -892,6 +922,12 @@ declare class EntitiesPreview {
|
|
|
892
922
|
* entity's key is present in `clickableKeys`.
|
|
893
923
|
*/
|
|
894
924
|
readonly entityClick: _angular_core.OutputEmitterRef<EntityClickEvent>;
|
|
925
|
+
/**
|
|
926
|
+
* The active language as a signal. Section headings are resolved per-language
|
|
927
|
+
* in a `computed`, so under `OnPush` a plain `getActiveLang()` read would
|
|
928
|
+
* freeze them at whatever language was active on first render.
|
|
929
|
+
*/
|
|
930
|
+
private readonly activeLang;
|
|
895
931
|
/** Entities expanded and sorted by order */
|
|
896
932
|
readonly displayEntities: _angular_core.Signal<EntityData[]>;
|
|
897
933
|
/**
|
|
@@ -900,15 +936,13 @@ declare class EntitiesPreview {
|
|
|
900
936
|
* exactly as before.
|
|
901
937
|
*/
|
|
902
938
|
readonly sectionGroups: _angular_core.Signal<_masterteam_components_entities.EntitySectionGroup[]>;
|
|
903
|
-
/**
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
protected
|
|
910
|
-
protected isActive(entity: EntityData): boolean;
|
|
911
|
-
protected onEntityClick(source: MouseEvent, entity: EntityData): void;
|
|
939
|
+
/**
|
|
940
|
+
* The render model the template iterates. Split from `sectionGroups` on
|
|
941
|
+
* purpose: grouping only re-runs when the entities themselves change, while
|
|
942
|
+
* this cheap mapping re-runs when the key sets or tooltips change.
|
|
943
|
+
*/
|
|
944
|
+
protected readonly slotGroups: _angular_core.Signal<EntitySlotGroup[]>;
|
|
945
|
+
protected onSlotClick(source: MouseEvent, slot: EntitySlot): void;
|
|
912
946
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntitiesPreview, never>;
|
|
913
947
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntitiesPreview, "mt-entities-preview", never, { "entities": { "alias": "entities"; "required": true; "isSignal": true; }; "attachmentShape": { "alias": "attachmentShape"; "required": false; "isSignal": true; }; "stackOnNarrow": { "alias": "stackOnNarrow"; "required": false; "isSignal": true; }; "clickableKeys": { "alias": "clickableKeys"; "required": false; "isSignal": true; }; "activeKeys": { "alias": "activeKeys"; "required": false; "isSignal": true; }; "clickableTooltip": { "alias": "clickableTooltip"; "required": false; "isSignal": true; }; "activeTooltip": { "alias": "activeTooltip"; "required": false; "isSignal": true; }; }, { "entityClick": "entityClick"; }, never, never, true, never>;
|
|
914
948
|
}
|
|
@@ -501,8 +501,8 @@ declare class TableValueResolver {
|
|
|
501
501
|
private static readonly EXPORTABLE_ENTITY_VIEW_TYPES;
|
|
502
502
|
/**
|
|
503
503
|
* `Time` is sortable and exportable but not filterable: a time-of-day has no
|
|
504
|
-
* meaningful date-range filter, and
|
|
505
|
-
*
|
|
504
|
+
* meaningful date-range filter, and a date picker cannot express one — it
|
|
505
|
+
* would silently filter by day instead of by clock time.
|
|
506
506
|
*/
|
|
507
507
|
private static readonly FILTERABLE_ENTITY_VIEW_TYPES;
|
|
508
508
|
/**
|
|
@@ -571,6 +571,13 @@ declare class TableValueResolver {
|
|
|
571
571
|
static normalizeTextSortValue(value: unknown): string | null;
|
|
572
572
|
static normalizeNumericSortValue(value: unknown): number | null;
|
|
573
573
|
static normalizeDateSortValue(value: unknown): number | null;
|
|
574
|
+
/**
|
|
575
|
+
* Order a `Time` cell by seconds since midnight. The stored shape is a
|
|
576
|
+
* wall-clock `HH:mm:ss`, which `Date` cannot parse at all; values still held
|
|
577
|
+
* as a full instant contribute their local clock, so a column holding both
|
|
578
|
+
* shapes still sorts by time of day rather than by the date part.
|
|
579
|
+
*/
|
|
580
|
+
static normalizeClockSortValue(value: unknown): number | null;
|
|
574
581
|
/**
|
|
575
582
|
* Resolves an entity column's view type from the column def, falling back to
|
|
576
583
|
* a sample row's cell. Public because grouping decides what it can bucket
|
|
@@ -1143,6 +1143,31 @@ declare const REQUEST_CONTEXT: HttpContextToken<RequestContextConfig>;
|
|
|
1143
1143
|
declare function getLightColor(hexColor: string): string;
|
|
1144
1144
|
declare function getContrastColor(bgColor: string): string;
|
|
1145
1145
|
|
|
1146
|
+
/**
|
|
1147
|
+
* Helpers for wall-clock values — the `HH:mm:ss` shape a `Time` property
|
|
1148
|
+
* stores. A time of day carries no calendar date and no timezone, so it is
|
|
1149
|
+
* never serialized as an instant: `new Date('09:30:00')` is `Invalid Date`,
|
|
1150
|
+
* and pushing the clock through UTC would shift it by the viewer's offset.
|
|
1151
|
+
*/
|
|
1152
|
+
/** A wall-clock time, already range-checked. */
|
|
1153
|
+
interface ClockTimeParts {
|
|
1154
|
+
hours: number;
|
|
1155
|
+
minutes: number;
|
|
1156
|
+
seconds: number;
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Parse a bare `H:mm`, `HH:mm`, or `HH:mm:ss` string — a trailing fractional
|
|
1160
|
+
* second, as .NET `TimeOnly`/`TimeSpan` may emit, is ignored. Returns `null`
|
|
1161
|
+
* for anything else, including full timestamps, which callers parse as dates.
|
|
1162
|
+
*/
|
|
1163
|
+
declare function parseClockTime(value: unknown): ClockTimeParts | null;
|
|
1164
|
+
/** Read the local wall-clock time off a `Date`, or `null` for an invalid one. */
|
|
1165
|
+
declare function toClockTimeParts(date: Date): ClockTimeParts | null;
|
|
1166
|
+
/** Format a wall-clock time as the `HH:mm:ss` text the backend stores. */
|
|
1167
|
+
declare function formatClockTime(parts: ClockTimeParts): string;
|
|
1168
|
+
/** Seconds since midnight — the comparable form of a wall-clock time. */
|
|
1169
|
+
declare function clockTimeToSeconds(parts: ClockTimeParts): number;
|
|
1170
|
+
|
|
1146
1171
|
type MTDateFormatType = 'date' | 'dateTime' | 'time';
|
|
1147
1172
|
declare class MTDateFormatPipe implements PipeTransform {
|
|
1148
1173
|
private readonly locale;
|
|
@@ -1152,5 +1177,5 @@ declare class MTDateFormatPipe implements PipeTransform {
|
|
|
1152
1177
|
static ɵpipe: i0.ɵɵPipeDeclaration<MTDateFormatPipe, "mtDateFormat", true>;
|
|
1153
1178
|
}
|
|
1154
1179
|
|
|
1155
|
-
export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DS_BLUE, DS_CHART_SERIES, DS_CONTROL_HEIGHT, DS_DEFAULT_PRIMARY_COLOR, DS_ERROR, DS_FONT_FAMILY, DS_GRAY, DS_INDIGO, DS_RADIUS, DS_SEMANTIC, DS_SHADOW, DS_SUCCESS, DS_WARNING, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, LookupModuleCheckListFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MT_DESIGN_IDENTITY_CLASS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, applyDesignIdentityClass, changeBackgroundColor, changePrimaryColor, changeTextColor, createCustomValidator, createEntityAdapter, dsChartSeries, dsIdentityConfigs, endLoading, generateTailwindPalette, getContrastColor, getLightColor, getMTDesignIdentity, handleApiRequest, isInvalid, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, setLoadingError, setMTDesignIdentity, startLoading, toAngularDateFormat, wrapValidatorWithMessage };
|
|
1156
|
-
export type { ApiRequestConfig, BaseFieldConstructorConfig, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DSColorScale, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, EntityListFieldRuntimeContext, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, LookupCheckListPropertyConfig, LookupMatrixCellConfig, LookupModuleCheckListFieldRuntimeContext, LookupOptionItemConfig, MTDateFormatType, MTDateFormats, MTDesignIdentity, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, ScheduleItemSelectorFieldRuntimeContext, SchedulePredecessorFieldRuntimeContext, SectionConfig, ValidatorType };
|
|
1180
|
+
export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DS_BLUE, DS_CHART_SERIES, DS_CONTROL_HEIGHT, DS_DEFAULT_PRIMARY_COLOR, DS_ERROR, DS_FONT_FAMILY, DS_GRAY, DS_INDIGO, DS_RADIUS, DS_SEMANTIC, DS_SHADOW, DS_SUCCESS, DS_WARNING, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, LookupModuleCheckListFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MT_DESIGN_IDENTITY_CLASS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, applyDesignIdentityClass, changeBackgroundColor, changePrimaryColor, changeTextColor, clockTimeToSeconds, createCustomValidator, createEntityAdapter, dsChartSeries, dsIdentityConfigs, endLoading, formatClockTime, generateTailwindPalette, getContrastColor, getLightColor, getMTDesignIdentity, handleApiRequest, isInvalid, parseClockTime, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, setLoadingError, setMTDesignIdentity, startLoading, toAngularDateFormat, toClockTimeParts, wrapValidatorWithMessage };
|
|
1181
|
+
export type { ApiRequestConfig, BaseFieldConstructorConfig, ClockTimeParts, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DSColorScale, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, EntityListFieldRuntimeContext, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, LookupCheckListPropertyConfig, LookupMatrixCellConfig, LookupModuleCheckListFieldRuntimeContext, LookupOptionItemConfig, MTDateFormatType, MTDateFormats, MTDesignIdentity, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, ScheduleItemSelectorFieldRuntimeContext, SchedulePredecessorFieldRuntimeContext, SectionConfig, ValidatorType };
|