@meshmakers/shared-ui 3.3.950 → 3.3.960
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,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { OnDestroy, AfterViewInit, EventEmitter, ElementRef, OnInit, InjectionToken, TemplateRef, PipeTransform, OnChanges, SimpleChanges, EnvironmentProviders } from '@angular/core';
|
|
3
|
-
import { FormGroup, ControlValueAccessor, Validator, FormControl, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
4
3
|
import * as _progress_kendo_svg_icons from '@progress/kendo-svg-icons';
|
|
5
4
|
import { SVGIcon } from '@progress/kendo-svg-icons';
|
|
5
|
+
import { FormGroup, ControlValueAccessor, Validator, FormControl, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
6
6
|
import { CommandBaseService, CommandItem, TreeItemData, TreeItemDataTyped, EntitySelectDataSource } from '@meshmakers/shared-services';
|
|
7
7
|
import { TreeViewComponent, TreeItem, NodeClickEvent, TreeItemDropEvent } from '@progress/kendo-angular-treeview';
|
|
8
8
|
import { Observable } from 'rxjs';
|
|
@@ -41,10 +41,29 @@ interface StatusFieldConfig {
|
|
|
41
41
|
/** Mapping of field values to icons */
|
|
42
42
|
statusMapping: StatusMapping;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Visual configuration for one possible value in a `badge` column. Lets host apps map enum-style
|
|
46
|
+
* cell values onto a tinted text pill — e.g. health states, lifecycle statuses, severity levels —
|
|
47
|
+
* without forcing every consumer to roll their own custom cell template.
|
|
48
|
+
*/
|
|
49
|
+
interface BadgeMapping {
|
|
50
|
+
/** Foreground text colour (CSS colour). Defaults to the host theme's `--badge-text-default`. */
|
|
51
|
+
color?: string;
|
|
52
|
+
/** Background colour (CSS colour). Defaults to the host theme's `--badge-bg-default`. */
|
|
53
|
+
backgroundColor?: string;
|
|
54
|
+
/** Border colour. Defaults to the resolved background. */
|
|
55
|
+
borderColor?: string;
|
|
56
|
+
/** Optional tooltip shown on hover. */
|
|
57
|
+
tooltip?: string;
|
|
58
|
+
/** Override the displayed label. When omitted, the cell renders the raw field value. */
|
|
59
|
+
label?: string;
|
|
60
|
+
}
|
|
61
|
+
/** Maps an enum-style cell value to its badge appearance. Keys compared with the raw value via String(). */
|
|
62
|
+
type BadgeMappingTable = Record<string, BadgeMapping>;
|
|
44
63
|
interface TableColumn {
|
|
45
64
|
displayName?: string | null;
|
|
46
65
|
field: string;
|
|
47
|
-
dataType?: 'text' | 'numeric' | 'numericRange' | 'boolean' | 'date' | 'iso8601' | 'bytes' | 'statusIcons' | 'cronExpression' | 'progressBar';
|
|
66
|
+
dataType?: 'text' | 'numeric' | 'numericRange' | 'boolean' | 'date' | 'iso8601' | 'bytes' | 'statusIcons' | 'cronExpression' | 'progressBar' | 'badge';
|
|
48
67
|
format?: string;
|
|
49
68
|
/**
|
|
50
69
|
* Column width in pixels. If not set, the column will auto-size.
|
|
@@ -87,6 +106,12 @@ interface TableColumn {
|
|
|
87
106
|
text: string;
|
|
88
107
|
value: string;
|
|
89
108
|
}[];
|
|
109
|
+
/**
|
|
110
|
+
* Mapping of raw cell values to badge appearances (only consulted for `dataType: 'badge'`).
|
|
111
|
+
* Values not in the mapping fall back to the neutral default badge styling, so callers don't
|
|
112
|
+
* have to handle every possible enum value explicitly.
|
|
113
|
+
*/
|
|
114
|
+
badgeMapping?: BadgeMappingTable;
|
|
90
115
|
/**
|
|
91
116
|
* Optional callback that produces the cell's display string.
|
|
92
117
|
* When set, this overrides the default rendering selected by `dataType`.
|
|
@@ -235,6 +260,12 @@ declare class ListViewComponent extends CommandBaseService implements OnDestroy,
|
|
|
235
260
|
* Gets the status icon mapping for a specific field value in a data item.
|
|
236
261
|
*/
|
|
237
262
|
protected getStatusIconMapping(dataItem: Record<string, unknown>, fieldConfig: StatusFieldConfig): StatusIconMapping | null;
|
|
263
|
+
/**
|
|
264
|
+
* Resolves the badge appearance for a cell from the column's `badgeMapping`. Returns null when
|
|
265
|
+
* no mapping is configured or no entry matches the cell's value — the template falls back to a
|
|
266
|
+
* neutral default badge in that case so missing-mapping entries don't blank out the column.
|
|
267
|
+
*/
|
|
268
|
+
protected getBadgeMapping(dataItem: Record<string, unknown>, column: TableColumn): BadgeMapping | null;
|
|
238
269
|
/**
|
|
239
270
|
* Helper to get a field value from a data item, supporting nested fields.
|
|
240
271
|
*/
|
|
@@ -1972,14 +2003,27 @@ declare class WindowStateService {
|
|
|
1972
2003
|
getDimensions(dialogKey: string): WindowDimensions | null;
|
|
1973
2004
|
saveDimensions(dialogKey: string, dimensions: WindowDimensions): void;
|
|
1974
2005
|
clearDimensions(dialogKey: string): void;
|
|
1975
|
-
resolveWindowSize(dialogKey: string, defaults: WindowDimensions): WindowDimensions;
|
|
1976
|
-
captureAndSave(dialogKey: string, windowElement: HTMLElement): void;
|
|
2006
|
+
resolveWindowSize(dialogKey: string, defaults: WindowDimensions, min?: WindowDimensions): WindowDimensions;
|
|
2007
|
+
captureAndSave(dialogKey: string, windowElement: HTMLElement, min?: WindowDimensions): void;
|
|
2008
|
+
private parsePixels;
|
|
1977
2009
|
/**
|
|
1978
2010
|
* Applies modal behavior to a Kendo WindowRef: shows a dark backdrop overlay
|
|
1979
2011
|
* that blocks interaction with the background, and removes it when the window closes.
|
|
1980
2012
|
* Also captures and saves window dimensions on close.
|
|
2013
|
+
*
|
|
2014
|
+
* Reads minWidth/minHeight from the Kendo Window instance and clamps stored sizes
|
|
2015
|
+
* accordingly — both on save (so future captures never fall below min) and as a
|
|
2016
|
+
* self-healing pass on entry (so a previously-stored size below the current min is
|
|
2017
|
+
* cleared on first open, falling back to the dialog's configured defaults next time).
|
|
1981
2018
|
*/
|
|
1982
2019
|
applyModalBehavior(dialogKey: string, windowRef: WindowRef): void;
|
|
2020
|
+
private readMinDimensions;
|
|
2021
|
+
/**
|
|
2022
|
+
* Drops stored dimensions that fall below the current minimum so the next open uses
|
|
2023
|
+
* the caller's defaults instead of a too-small persisted size. The current open is
|
|
2024
|
+
* unaffected (it already resolved at open time), but the next one is healed.
|
|
2025
|
+
*/
|
|
2026
|
+
private healStaleDimensions;
|
|
1983
2027
|
private showBackdrop;
|
|
1984
2028
|
private hideBackdrop;
|
|
1985
2029
|
private getOrCreateBackdropElement;
|
|
@@ -1992,4 +2036,4 @@ declare class WindowStateService {
|
|
|
1992
2036
|
declare function provideMmSharedUi(): EnvironmentProviders;
|
|
1993
2037
|
|
|
1994
2038
|
export { BaseFormComponent, BaseTreeDetailComponent, ButtonTypes, BytesToSizePipe, CRON_PRESETS, ConfirmationService, ConfirmationWindowResult, CopyableTextComponent, CronBuilderComponent, CronHumanizerService, CronParserService, DEFAULT_CRON_BUILDER_CONFIG, DEFAULT_ENTITY_SELECT_DIALOG_MESSAGES, DEFAULT_ENTITY_SELECT_INPUT_MESSAGES, DEFAULT_LIST_VIEW_MESSAGES, DEFAULT_RESPONSIVE_COLSPAN, DEFAULT_TIME_RANGE_LABELS, DataSourceBase, DataSourceTyped, DialogType, EntitySelectDialogComponent, EntitySelectDialogService, EntitySelectInputComponent, FetchResultBase, FetchResultTyped, FileUploadResult, FileUploadService, FormTitleExtraDirective, HAS_UNSAVED_CHANGES, HOUR_INTERVALS, HierarchyDataSource, HierarchyDataSourceBase, ImportStrategyDialogComponent, ImportStrategyDialogResult, ImportStrategyDialogService, ImportStrategyDto, InputDialogComponent, InputService, ListViewComponent, MINUTE_INTERVALS, MessageDetailsDialogComponent, MessageDetailsDialogService, MessageListenerService, MmListViewDataBindingDirective, NotificationDisplayService, PascalCasePipe, ProgressValue, ProgressWindowComponent, ProgressWindowService, RELATIVE_WEEKS, SECOND_INTERVALS, SaveAsDialogComponent, SaveAsDialogService, TimeRangePickerComponent, TimeRangeUtils, TreeComponent, UnsavedChangesDirective, UnsavedChangesGuard, UploadFileDialogComponent, WEEKDAYS, WEEKDAY_ABBREVIATIONS, WindowStateService, generateDayOfMonthOptions, generateHourOptions, generateMinuteOptions, provideMmSharedUi };
|
|
1995
|
-
export type { BaseFormConfig, BaseFormMessages, ColumnDefinition, ConfirmationButtonLabels, ConfirmationWindowData, ContextMenuType, CronBuilderConfig, CronFields, CronPreset, CronSchedule, CronValidationResult, DialogFetchOptions, DialogFetchResult, DropdownOption, EntitySelectDialogDataSource, EntitySelectDialogMessages, EntitySelectDialogOptions, EntitySelectDialogResult, EntitySelectInputMessages, FetchDataOptions, FetchResult, FileUploadData, HasUnsavedChanges, ListViewMessages, MessageDetailsDialogData, NameAvailabilityResult, NodeDroppedEvent, NodeInfo, ProgressWindowConfig, ProgressWindowData, ProgressWindowOptions, ProgressWindowResult, Quarter, RelativeTimeUnit, ResponsiveFormBreakPoint, RowClassFn, SaveAsDialogDataSource, SaveAsDialogOptions, SaveAsDialogResult, ScheduleType, StatusFieldConfig, StatusIconMapping, StatusMapping, TableColumn, TimeRange, TimeRangeISO, TimeRangeOption, TimeRangePickerConfig, TimeRangePickerLabels, TimeRangeSelection, TimeRangeType, UnsavedChangesMessages, Weekday, WindowDimensions };
|
|
2039
|
+
export type { BadgeMapping, BadgeMappingTable, BaseFormConfig, BaseFormMessages, ColumnDefinition, ConfirmationButtonLabels, ConfirmationWindowData, ContextMenuType, CronBuilderConfig, CronFields, CronPreset, CronSchedule, CronValidationResult, DialogFetchOptions, DialogFetchResult, DropdownOption, EntitySelectDialogDataSource, EntitySelectDialogMessages, EntitySelectDialogOptions, EntitySelectDialogResult, EntitySelectInputMessages, FetchDataOptions, FetchResult, FileUploadData, HasUnsavedChanges, ListViewMessages, MessageDetailsDialogData, NameAvailabilityResult, NodeDroppedEvent, NodeInfo, ProgressWindowConfig, ProgressWindowData, ProgressWindowOptions, ProgressWindowResult, Quarter, RelativeTimeUnit, ResponsiveFormBreakPoint, RowClassFn, SaveAsDialogDataSource, SaveAsDialogOptions, SaveAsDialogResult, ScheduleType, StatusFieldConfig, StatusIconMapping, StatusMapping, TableColumn, TimeRange, TimeRangeISO, TimeRangeOption, TimeRangePickerConfig, TimeRangePickerLabels, TimeRangeSelection, TimeRangeType, UnsavedChangesMessages, Weekday, WindowDimensions };
|