@meshmakers/shared-ui 3.3.520 → 3.3.540

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshmakers/shared-ui",
3
- "version": "3.3.520",
3
+ "version": "3.3.540",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.2.0",
6
6
  "@angular/core": "^21.2.0",
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnDestroy, AfterViewInit, EventEmitter, ElementRef, OnInit, InjectionToken, PipeTransform, OnChanges, SimpleChanges, EnvironmentProviders } from '@angular/core';
2
+ import { OnDestroy, AfterViewInit, EventEmitter, ElementRef, OnInit, InjectionToken, TemplateRef, PipeTransform, OnChanges, SimpleChanges, EnvironmentProviders } from '@angular/core';
3
3
  import { FormGroup, ControlValueAccessor, Validator, FormControl, AbstractControl, ValidationErrors } from '@angular/forms';
4
4
  import * as _progress_kendo_svg_icons from '@progress/kendo-svg-icons';
5
5
  import { SVGIcon } from '@progress/kendo-svg-icons';
@@ -367,6 +367,24 @@ declare class TreeComponent implements OnInit, AfterViewInit, OnDestroy {
367
367
  static ɵcmp: i0.ɵɵComponentDeclaration<TreeComponent, "mm-tree-view", never, { "dataSource": { "alias": "dataSource"; "required": false; }; }, { "nodeSelected": "nodeSelected"; "nodeClick": "nodeClick"; "nodeDoubleClick": "nodeDoubleClick"; "nodeDrop": "nodeDrop"; "expand": "expand"; "collapse": "collapse"; }, never, never, true, never>;
368
368
  }
369
369
 
370
+ /**
371
+ * Messages for the unsaved changes confirmation dialog.
372
+ * All properties are optional — English defaults are used for any missing values.
373
+ */
374
+ interface UnsavedChangesMessages {
375
+ /** Dialog title (default: "Unsaved Changes") */
376
+ title?: string;
377
+ /** Message when component supports saving (default: "You have unsaved changes. Do you want to save before leaving?") */
378
+ savePrompt?: string;
379
+ /** Message when component does not support saving (default: "You have unsaved changes. Are you sure you want to leave? Your changes will be lost.") */
380
+ discardPrompt?: string;
381
+ /** Label for the "Yes" button (default: "Yes") */
382
+ yesButton?: string;
383
+ /** Label for the "No" button (default: "No") */
384
+ noButton?: string;
385
+ /** Label for the "Cancel" button (default: "Cancel") */
386
+ cancelButton?: string;
387
+ }
370
388
  /**
371
389
  * Interface for components that track unsaved changes.
372
390
  * Implement this interface in components that need to warn users before navigating away
@@ -383,6 +401,11 @@ interface HasUnsavedChanges {
383
401
  * @returns Promise resolving to true if save was successful, false otherwise.
384
402
  */
385
403
  saveChanges?(): Promise<boolean>;
404
+ /**
405
+ * Optional translated messages for the confirmation dialog.
406
+ * If not provided, English defaults are used.
407
+ */
408
+ unsavedChangesMessages?(): UnsavedChangesMessages;
386
409
  }
387
410
  /**
388
411
  * Injection token for components implementing HasUnsavedChanges.
@@ -435,10 +458,47 @@ declare class UnsavedChangesDirective {
435
458
  static ɵdir: i0.ɵɵDirectiveDeclaration<UnsavedChangesDirective, "[mmUnsavedChanges]", never, {}, {}, never, never, true, never>;
436
459
  }
437
460
 
461
+ declare class FormTitleExtraDirective {
462
+ readonly templateRef: TemplateRef<any>;
463
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormTitleExtraDirective, never>;
464
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FormTitleExtraDirective, "[mmFormTitleExtra]", never, {}, {}, never, never, true, never>;
465
+ }
438
466
  interface ResponsiveFormBreakPoint {
439
467
  maxWidth: number;
440
468
  value: number;
441
469
  }
470
+ /**
471
+ * Translatable messages for the base form.
472
+ * All properties are optional — English defaults are used as fallbacks.
473
+ */
474
+ interface BaseFormMessages {
475
+ /** Default title when isViewMode is true (default: 'View Details') */
476
+ viewTitle?: string;
477
+ /** Default title when isEditMode is true (default: 'Edit') */
478
+ editTitle?: string;
479
+ /** Default title for new items (default: 'New') */
480
+ newTitle?: string;
481
+ /** Save button text when saving is in progress (default: 'Saving...') */
482
+ savingText?: string;
483
+ /** Save button text in edit mode (default: 'Update') */
484
+ updateText?: string;
485
+ /** Save button text in create mode (default: 'Create') */
486
+ createText?: string;
487
+ /** Cancel button text in view mode (default: 'Back') */
488
+ backText?: string;
489
+ /** Cancel button text (default: 'Cancel') */
490
+ cancelText?: string;
491
+ /** Save button text (default: 'Save') */
492
+ saveText?: string;
493
+ /** Badge text for unsaved changes (default: 'Unsaved Changes') */
494
+ unsavedChangesText?: string;
495
+ /** Loading overlay text (default: 'Loading...') */
496
+ loadingText?: string;
497
+ /** Status text when form has changes (default: 'MODIFIED') */
498
+ modifiedText?: string;
499
+ /** Status text when form is clean (default: 'READY') */
500
+ readyText?: string;
501
+ }
442
502
  interface BaseFormConfig {
443
503
  title?: string;
444
504
  cardWidth?: string;
@@ -456,9 +516,15 @@ interface BaseFormConfig {
456
516
  * When true, displays a "Modified" indicator in the header and footer.
457
517
  */
458
518
  hasChanges?: boolean;
519
+ /**
520
+ * Translatable messages for all static texts in the form.
521
+ * Allows consuming applications to provide localized strings.
522
+ */
523
+ messages?: BaseFormMessages;
459
524
  }
460
525
  declare const DEFAULT_RESPONSIVE_COLSPAN: ResponsiveFormBreakPoint[];
461
526
  declare class BaseFormComponent implements HasUnsavedChanges {
527
+ titleExtra?: FormTitleExtraDirective;
462
528
  form: FormGroup;
463
529
  config: BaseFormConfig;
464
530
  saveForm: EventEmitter<void>;
@@ -468,6 +534,10 @@ declare class BaseFormComponent implements HasUnsavedChanges {
468
534
  protected get title(): string;
469
535
  protected get saveButtonText(): string;
470
536
  protected get cancelButtonText(): string;
537
+ protected get unsavedChangesText(): string;
538
+ protected get loadingText(): string;
539
+ protected get modifiedText(): string;
540
+ protected get readyText(): string;
471
541
  protected get showSaveButton(): boolean;
472
542
  protected get showCancelButton(): boolean;
473
543
  protected get saveButtonDisabled(): boolean;
@@ -479,7 +549,7 @@ declare class BaseFormComponent implements HasUnsavedChanges {
479
549
  */
480
550
  hasUnsavedChanges(): boolean;
481
551
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormComponent, never>;
482
- static ɵcmp: i0.ɵɵComponentDeclaration<BaseFormComponent, "mm-base-form", never, { "form": { "alias": "form"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "saveForm": "saveForm"; "cancelForm": "cancelForm"; }, never, ["*", "[additionalActions]"], true, [{ directive: typeof UnsavedChangesDirective; inputs: {}; outputs: {}; }]>;
552
+ static ɵcmp: i0.ɵɵComponentDeclaration<BaseFormComponent, "mm-base-form", never, { "form": { "alias": "form"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "saveForm": "saveForm"; "cancelForm": "cancelForm"; }, ["titleExtra"], ["*", "[additionalActions]"], true, [{ directive: typeof UnsavedChangesDirective; inputs: {}; outputs: {}; }]>;
483
553
  }
484
554
 
485
555
  declare class BaseTreeDetailComponent<T = unknown> extends CommandBaseService {
@@ -695,28 +765,56 @@ declare enum ImportStrategyDto {
695
765
  Upsert = 1
696
766
  }
697
767
 
698
- declare class FileUploadService {
699
- private readonly dialogService;
700
- showUploadDialog(title: string, message: string, mimeTypes?: string | null, fileExtensions?: string | null): Promise<File | null>;
701
- static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadService, never>;
702
- static ɵprov: i0.ɵɵInjectableDeclaration<FileUploadService>;
703
- }
704
-
705
768
  declare enum ButtonTypes {
706
769
  Ok = 0,
707
770
  Cancel = 1,
708
771
  Yes = 2,
709
772
  No = 3
710
773
  }
774
+ declare enum DialogType {
775
+ YesNo = 0,
776
+ YesNoCancel = 1,
777
+ OkCancel = 2,
778
+ Ok = 3
779
+ }
780
+ interface ConfirmationButtonLabels {
781
+ yes?: string;
782
+ no?: string;
783
+ ok?: string;
784
+ cancel?: string;
785
+ }
786
+ interface ConfirmationWindowData {
787
+ title: string;
788
+ message: string;
789
+ dialogType: DialogType;
790
+ buttonLabels?: ConfirmationButtonLabels;
791
+ }
711
792
  declare class ConfirmationWindowResult {
712
793
  result: ButtonTypes;
713
794
  constructor(result: ButtonTypes);
714
795
  }
796
+ interface FileUploadData {
797
+ title: string;
798
+ message: string;
799
+ mimeTypes: string;
800
+ fileExtensions: string | null;
801
+ }
802
+ declare class FileUploadResult {
803
+ selectedFile: File | null;
804
+ constructor(selectedFile: File);
805
+ }
806
+
807
+ declare class FileUploadService {
808
+ private readonly dialogService;
809
+ showUploadDialog(title: string, message: string, mimeTypes?: string | null, fileExtensions?: string | null): Promise<File | null>;
810
+ static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadService, never>;
811
+ static ɵprov: i0.ɵɵInjectableDeclaration<FileUploadService>;
812
+ }
715
813
 
716
814
  declare class ConfirmationService {
717
815
  private readonly dialogService;
718
- showYesNoConfirmationDialog(title: string, message: string, cssClass?: string): Promise<boolean>;
719
- showYesNoCancelConfirmationDialog(title: string, message: string): Promise<ConfirmationWindowResult | undefined>;
816
+ showYesNoConfirmationDialog(title: string, message: string, cssClass?: string, buttonLabels?: ConfirmationButtonLabels): Promise<boolean>;
817
+ showYesNoCancelConfirmationDialog(title: string, message: string, buttonLabels?: ConfirmationButtonLabels): Promise<ConfirmationWindowResult | undefined>;
720
818
  showOkCancelConfirmationDialog(title: string, message: string): Promise<boolean>;
721
819
  showOkDialog(title: string, message: string): Promise<boolean>;
722
820
  private openDialog;
@@ -1714,5 +1812,5 @@ declare class ImportStrategyDialogService {
1714
1812
 
1715
1813
  declare function provideMmSharedUi(): EnvironmentProviders;
1716
1814
 
1717
- export { BaseFormComponent, BaseTreeDetailComponent, BytesToSizePipe, CRON_PRESETS, ConfirmationService, CopyableTextComponent, CronBuilderComponent, CronHumanizerService, CronParserService, DEFAULT_CRON_BUILDER_CONFIG, DEFAULT_LIST_VIEW_MESSAGES, DEFAULT_RESPONSIVE_COLSPAN, DEFAULT_TIME_RANGE_LABELS, DataSourceBase, DataSourceTyped, EntitySelectDialogComponent, EntitySelectDialogService, EntitySelectInputComponent, FetchResultBase, FetchResultTyped, FileUploadService, 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, generateDayOfMonthOptions, generateHourOptions, generateMinuteOptions, provideMmSharedUi };
1718
- export type { BaseFormConfig, ColumnDefinition, ContextMenuType, CronBuilderConfig, CronFields, CronPreset, CronSchedule, CronValidationResult, DialogFetchOptions, DialogFetchResult, DropdownOption, EntitySelectDialogDataSource, EntitySelectDialogOptions, EntitySelectDialogResult, FetchDataOptions, FetchResult, HasUnsavedChanges, ListViewMessages, MessageDetailsDialogData, NameAvailabilityResult, NodeDroppedEvent, NodeInfo, ProgressWindowConfig, ProgressWindowData, ProgressWindowOptions, ProgressWindowResult, Quarter, RelativeTimeUnit, ResponsiveFormBreakPoint, SaveAsDialogDataSource, SaveAsDialogOptions, SaveAsDialogResult, ScheduleType, StatusFieldConfig, StatusIconMapping, StatusMapping, TableColumn, TimeRange, TimeRangeISO, TimeRangeOption, TimeRangePickerConfig, TimeRangePickerLabels, TimeRangeSelection, TimeRangeType, Weekday };
1815
+ export { BaseFormComponent, BaseTreeDetailComponent, ButtonTypes, BytesToSizePipe, CRON_PRESETS, ConfirmationService, ConfirmationWindowResult, CopyableTextComponent, CronBuilderComponent, CronHumanizerService, CronParserService, DEFAULT_CRON_BUILDER_CONFIG, 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, generateDayOfMonthOptions, generateHourOptions, generateMinuteOptions, provideMmSharedUi };
1816
+ export type { BaseFormConfig, BaseFormMessages, ColumnDefinition, ConfirmationButtonLabels, ConfirmationWindowData, ContextMenuType, CronBuilderConfig, CronFields, CronPreset, CronSchedule, CronValidationResult, DialogFetchOptions, DialogFetchResult, DropdownOption, EntitySelectDialogDataSource, EntitySelectDialogOptions, EntitySelectDialogResult, FetchDataOptions, FetchResult, FileUploadData, HasUnsavedChanges, ListViewMessages, MessageDetailsDialogData, NameAvailabilityResult, NodeDroppedEvent, NodeInfo, ProgressWindowConfig, ProgressWindowData, ProgressWindowOptions, ProgressWindowResult, Quarter, RelativeTimeUnit, ResponsiveFormBreakPoint, SaveAsDialogDataSource, SaveAsDialogOptions, SaveAsDialogResult, ScheduleType, StatusFieldConfig, StatusIconMapping, StatusMapping, TableColumn, TimeRange, TimeRangeISO, TimeRangeOption, TimeRangePickerConfig, TimeRangePickerLabels, TimeRangeSelection, TimeRangeType, UnsavedChangesMessages, Weekday };