commons-shared-web-ui 0.0.25 → 0.0.27
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/commons-shared-web-ui.mjs +270 -71
- package/fesm2022/commons-shared-web-ui.mjs.map +1 -1
- package/index.d.ts +100 -32
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { OnChanges, EventEmitter, SimpleChanges, ChangeDetectorRef, OnInit, OnDestroy, ElementRef, PipeTransform, AfterViewInit, QueryList, NgZone } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/material/snack-bar';
|
|
4
|
+
import { MatSnackBar, MatSnackBarRef } from '@angular/material/snack-bar';
|
|
3
5
|
import * as i2$1 from '@angular/common';
|
|
4
6
|
import * as i3$1 from '@angular/forms';
|
|
5
7
|
import { FormGroup, FormBuilder, FormArray, FormControl, ValidatorFn, ControlValueAccessor, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
@@ -7,8 +9,6 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
|
7
9
|
import * as i3$2 from '@angular/router';
|
|
8
10
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
9
11
|
import { BehaviorSubject, Subject, Observable } from 'rxjs';
|
|
10
|
-
import * as i2 from '@angular/material/snack-bar';
|
|
11
|
-
import { MatSnackBar, MatSnackBarRef } from '@angular/material/snack-bar';
|
|
12
12
|
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
|
13
13
|
import * as i1 from '@angular/material/card';
|
|
14
14
|
import * as i3 from '@angular/material/checkbox';
|
|
@@ -632,8 +632,15 @@ declare class FieldSelectionService {
|
|
|
632
632
|
* Initialize the store from a FormSchema.
|
|
633
633
|
*/
|
|
634
634
|
loadSchema(schema: FormSchema): void;
|
|
635
|
+
/**
|
|
636
|
+
* Load a schema while preserving the expanded/collapsed state of sections and groups.
|
|
637
|
+
* Used when the schema structure hasn't changed but field selections have.
|
|
638
|
+
* This prevents the UI from unexpectedly collapsing sections when the user toggles a field.
|
|
639
|
+
*/
|
|
640
|
+
loadSchemaPreservingExpanded(schema: FormSchema): void;
|
|
635
641
|
/**
|
|
636
642
|
* Toggle a group's enabled state. Disabling cascades to all sections + fields.
|
|
643
|
+
* When enabling, all fields are selected (unless locked).
|
|
637
644
|
*/
|
|
638
645
|
toggleGroup(groupIndex: number): void;
|
|
639
646
|
/**
|
|
@@ -658,9 +665,19 @@ declare class FieldSelectionService {
|
|
|
658
665
|
*/
|
|
659
666
|
buildUpdatedSchema(): FormSchema | null;
|
|
660
667
|
private _disableAllSections;
|
|
668
|
+
/**
|
|
669
|
+
* Enable all sections and their fields (except locked ones).
|
|
670
|
+
* Used when toggling a section/group back ON to restore field selections.
|
|
671
|
+
*/
|
|
672
|
+
private _enableAllSections;
|
|
661
673
|
private _toggleSectionAtPath;
|
|
662
674
|
private _toggleExpandedAtPath;
|
|
663
675
|
private _toggleFieldAtPath;
|
|
676
|
+
/**
|
|
677
|
+
* Recursively merge expansion state from old sections into new sections.
|
|
678
|
+
* Preserves which sections were expanded/collapsed by the user.
|
|
679
|
+
*/
|
|
680
|
+
private _mergeExpandedSections;
|
|
664
681
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldSelectionService, never>;
|
|
665
682
|
static ɵprov: i0.ɵɵInjectableDeclaration<FieldSelectionService>;
|
|
666
683
|
}
|
|
@@ -668,7 +685,20 @@ declare class FieldSelectionService {
|
|
|
668
685
|
declare class FieldSelectionComponent implements OnChanges {
|
|
669
686
|
schema: FormSchema;
|
|
670
687
|
schemaChange: EventEmitter<FormSchema>;
|
|
688
|
+
/**
|
|
689
|
+
* When true, the enable/disable toggle is hidden for option-driven field types
|
|
690
|
+
* (DROPDOWN, RADIO, MULTI_SELECT, etc.).
|
|
691
|
+
* Useful for business-user-facing form configurators where developers
|
|
692
|
+
* pre-fill the option data and these fields should always be included.
|
|
693
|
+
* Defaults to false (show toggle for all fields).
|
|
694
|
+
*/
|
|
695
|
+
hideToggleForOptionTypes: boolean;
|
|
671
696
|
protected readonly store: FieldSelectionService;
|
|
697
|
+
/**
|
|
698
|
+
* Flag to track if the next schema change is from internal toggles.
|
|
699
|
+
* When true, we'll use loadSchemaPreservingExpanded() to keep user's expansion state.
|
|
700
|
+
*/
|
|
701
|
+
private _isInternalChange;
|
|
672
702
|
ngOnChanges(changes: SimpleChanges): void;
|
|
673
703
|
onToggleGroup(groupIndex: number): void;
|
|
674
704
|
onToggleGroupExpanded(groupIndex: number): void;
|
|
@@ -678,7 +708,7 @@ declare class FieldSelectionComponent implements OnChanges {
|
|
|
678
708
|
trackByGroupIndex(index: number): number;
|
|
679
709
|
private _emitChange;
|
|
680
710
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldSelectionComponent, never>;
|
|
681
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FieldSelectionComponent, "lib-field-selection", never, { "schema": { "alias": "schema"; "required": true; }; }, { "schemaChange": "schemaChange"; }, never, never, false, never>;
|
|
711
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldSelectionComponent, "lib-field-selection", never, { "schema": { "alias": "schema"; "required": true; }; "hideToggleForOptionTypes": { "alias": "hideToggleForOptionTypes"; "required": false; }; }, { "schemaChange": "schemaChange"; }, never, never, false, never>;
|
|
682
712
|
}
|
|
683
713
|
|
|
684
714
|
/**
|
|
@@ -771,6 +801,13 @@ declare class FieldConfiguratorService {
|
|
|
771
801
|
declare class FieldConfiguratorComponent implements OnChanges {
|
|
772
802
|
schema: FormSchema;
|
|
773
803
|
schemaChange: EventEmitter<FormSchema>;
|
|
804
|
+
/**
|
|
805
|
+
* When false, the optionConfig section (apiUrl, dataPath, etc.) is hidden
|
|
806
|
+
* from the configurator panel. Useful for business-user-facing configurators
|
|
807
|
+
* where option URLs are pre-filled by the developer.
|
|
808
|
+
* Defaults to true (show everything).
|
|
809
|
+
*/
|
|
810
|
+
showOptionConfig: boolean;
|
|
774
811
|
readonly store: FieldConfiguratorService;
|
|
775
812
|
private readonly schemaMapOverride;
|
|
776
813
|
/**
|
|
@@ -786,12 +823,14 @@ declare class FieldConfiguratorComponent implements OnChanges {
|
|
|
786
823
|
onTypeChange(builderType: string): void;
|
|
787
824
|
private _emitChange;
|
|
788
825
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldConfiguratorComponent, never>;
|
|
789
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FieldConfiguratorComponent, "lib-field-configurator", never, { "schema": { "alias": "schema"; "required": true; }; }, { "schemaChange": "schemaChange"; }, never, never, false, never>;
|
|
826
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldConfiguratorComponent, "lib-field-configurator", never, { "schema": { "alias": "schema"; "required": true; }; "showOptionConfig": { "alias": "showOptionConfig"; "required": false; }; }, { "schemaChange": "schemaChange"; }, never, never, false, never>;
|
|
790
827
|
}
|
|
791
828
|
|
|
792
829
|
declare class GroupNodeComponent {
|
|
793
830
|
group: SelectionGroupNode;
|
|
794
831
|
groupIndex: number;
|
|
832
|
+
/** Propagated from FieldSelectionComponent — see SelectionFieldNodeComponent for details. */
|
|
833
|
+
hideToggleForOptionTypes: boolean;
|
|
795
834
|
toggleEnabled: EventEmitter<void>;
|
|
796
835
|
toggleExpanded: EventEmitter<void>;
|
|
797
836
|
sectionToggleEnabled: EventEmitter<number[]>;
|
|
@@ -808,13 +847,15 @@ declare class GroupNodeComponent {
|
|
|
808
847
|
}): void;
|
|
809
848
|
trackBySectionIndex(index: number): number;
|
|
810
849
|
static ɵfac: i0.ɵɵFactoryDeclaration<GroupNodeComponent, never>;
|
|
811
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GroupNodeComponent, "lib-group-node", never, { "group": { "alias": "group"; "required": true; }; "groupIndex": { "alias": "groupIndex"; "required": true; }; }, { "toggleEnabled": "toggleEnabled"; "toggleExpanded": "toggleExpanded"; "sectionToggleEnabled": "sectionToggleEnabled"; "sectionToggleExpanded": "sectionToggleExpanded"; "fieldToggle": "fieldToggle"; }, never, never, false, never>;
|
|
850
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GroupNodeComponent, "lib-group-node", never, { "group": { "alias": "group"; "required": true; }; "groupIndex": { "alias": "groupIndex"; "required": true; }; "hideToggleForOptionTypes": { "alias": "hideToggleForOptionTypes"; "required": false; }; }, { "toggleEnabled": "toggleEnabled"; "toggleExpanded": "toggleExpanded"; "sectionToggleEnabled": "sectionToggleEnabled"; "sectionToggleExpanded": "sectionToggleExpanded"; "fieldToggle": "fieldToggle"; }, never, never, false, never>;
|
|
812
851
|
}
|
|
813
852
|
|
|
814
853
|
declare class SelectionSectionNodeComponent {
|
|
815
854
|
section: SelectionSectionNode;
|
|
816
855
|
sectionIndex: number;
|
|
817
856
|
depth: number;
|
|
857
|
+
/** Propagated from FieldSelectionComponent — see SelectionFieldNodeComponent for details. */
|
|
858
|
+
hideToggleForOptionTypes: boolean;
|
|
818
859
|
/** Emits the sub-path from this node downward (empty [] for self) */
|
|
819
860
|
toggleEnabled: EventEmitter<number[]>;
|
|
820
861
|
toggleExpanded: EventEmitter<number[]>;
|
|
@@ -836,14 +877,21 @@ declare class SelectionSectionNodeComponent {
|
|
|
836
877
|
trackByFieldIndex(index: number): number;
|
|
837
878
|
trackBySubsectionIndex(index: number): number;
|
|
838
879
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectionSectionNodeComponent, never>;
|
|
839
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SelectionSectionNodeComponent, "lib-selection-section-node", never, { "section": { "alias": "section"; "required": true; }; "sectionIndex": { "alias": "sectionIndex"; "required": true; }; "depth": { "alias": "depth"; "required": false; }; }, { "toggleEnabled": "toggleEnabled"; "toggleExpanded": "toggleExpanded"; "fieldToggle": "fieldToggle"; }, never, never, false, never>;
|
|
880
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectionSectionNodeComponent, "lib-selection-section-node", never, { "section": { "alias": "section"; "required": true; }; "sectionIndex": { "alias": "sectionIndex"; "required": true; }; "depth": { "alias": "depth"; "required": false; }; "hideToggleForOptionTypes": { "alias": "hideToggleForOptionTypes"; "required": false; }; }, { "toggleEnabled": "toggleEnabled"; "toggleExpanded": "toggleExpanded"; "fieldToggle": "fieldToggle"; }, never, never, false, never>;
|
|
840
881
|
}
|
|
841
882
|
|
|
842
883
|
declare class SelectionFieldNodeComponent {
|
|
843
884
|
field: SelectionFieldNode;
|
|
844
885
|
toggleSelected: EventEmitter<void>;
|
|
886
|
+
/**
|
|
887
|
+
* When true, the enable/disable toggle is hidden for option-driven field types
|
|
888
|
+
* (DROPDOWN, RADIO, MULTI_SELECT, etc.). These types have their options
|
|
889
|
+
* pre-configured by the developer and shouldn't be toggled by business users.
|
|
890
|
+
*/
|
|
891
|
+
hideToggleForOptionTypes: boolean;
|
|
892
|
+
get isOptionDrivenType(): boolean;
|
|
845
893
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectionFieldNodeComponent, never>;
|
|
846
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SelectionFieldNodeComponent, "lib-selection-field-node", never, { "field": { "alias": "field"; "required": true; }; }, { "toggleSelected": "toggleSelected"; }, never, never, false, never>;
|
|
894
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectionFieldNodeComponent, "lib-selection-field-node", never, { "field": { "alias": "field"; "required": true; }; "hideToggleForOptionTypes": { "alias": "hideToggleForOptionTypes"; "required": false; }; }, { "toggleSelected": "toggleSelected"; }, never, never, false, never>;
|
|
847
895
|
}
|
|
848
896
|
|
|
849
897
|
declare class ConfiguratorTreeComponent {
|
|
@@ -861,15 +909,44 @@ declare class ConfiguratorTreeComponent {
|
|
|
861
909
|
static ɵcmp: i0.ɵɵComponentDeclaration<ConfiguratorTreeComponent, "lib-configurator-tree", never, { "tree": { "alias": "tree"; "required": false; }; "selectedFieldPath": { "alias": "selectedFieldPath"; "required": false; }; }, { "selectField": "selectField"; "toggleExpanded": "toggleExpanded"; }, never, never, false, never>;
|
|
862
910
|
}
|
|
863
911
|
|
|
912
|
+
type SnackbarVariant = 'success' | 'error' | 'warning' | 'info';
|
|
913
|
+
interface SnackbarConfig {
|
|
914
|
+
message: string;
|
|
915
|
+
variant?: SnackbarVariant;
|
|
916
|
+
duration?: number;
|
|
917
|
+
horizontalPosition?: 'start' | 'center' | 'end' | 'left' | 'right';
|
|
918
|
+
verticalPosition?: 'top' | 'bottom';
|
|
919
|
+
showCloseButton?: boolean;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
declare class SnackbarService {
|
|
923
|
+
private snackBar;
|
|
924
|
+
constructor(snackBar: MatSnackBar);
|
|
925
|
+
show(config: SnackbarConfig): void;
|
|
926
|
+
success(message: string, duration?: number): void;
|
|
927
|
+
error(message: string, duration?: number): void;
|
|
928
|
+
warning(message: string, duration?: number): void;
|
|
929
|
+
info(message: string, duration?: number): void;
|
|
930
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnackbarService, never>;
|
|
931
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SnackbarService>;
|
|
932
|
+
}
|
|
933
|
+
|
|
864
934
|
declare class ConfiguratorConfigPanelComponent implements OnChanges {
|
|
865
935
|
private cdr;
|
|
866
|
-
|
|
936
|
+
private snackbarService;
|
|
937
|
+
constructor(cdr: ChangeDetectorRef, snackbarService: SnackbarService);
|
|
867
938
|
selectedField: FieldConfig | null;
|
|
868
939
|
selectedFieldInfo: ConfiguratorFieldInfo | null;
|
|
869
940
|
builderFieldType: string | null;
|
|
870
941
|
fieldTypeSchemaMap: Record<string, FormSchema>;
|
|
871
942
|
configChange: EventEmitter<Record<string, unknown>>;
|
|
872
943
|
typeChange: EventEmitter<string>;
|
|
944
|
+
/**
|
|
945
|
+
* When false, all `optionConfig.*` fields (apiUrl, dataPath, labelPath, etc.)
|
|
946
|
+
* are hidden from the config panel. Business users don't need to configure
|
|
947
|
+
* option URLs — these are pre-filled by the developer in the master JSON.
|
|
948
|
+
*/
|
|
949
|
+
showOptionConfig: boolean;
|
|
873
950
|
/** Exposed to the template for the native type-switcher select */
|
|
874
951
|
readonly switchableFieldTypes: {
|
|
875
952
|
label: string;
|
|
@@ -905,10 +982,21 @@ declare class ConfiguratorConfigPanelComponent implements OnChanges {
|
|
|
905
982
|
* guarantee a completely fresh SmartForm instance is mounted.
|
|
906
983
|
*/
|
|
907
984
|
private _buildConfigFormForType;
|
|
985
|
+
/**
|
|
986
|
+
* Deep-clones the schema and removes any field whose `name` matches developer-only fields.
|
|
987
|
+
* This prevents end users from modifying system-level configurations like:
|
|
988
|
+
* - optionConfig.* (API URLs, data paths, etc.)
|
|
989
|
+
* - payloadPath (payload mapping)
|
|
990
|
+
* - className (CSS styling)
|
|
991
|
+
* - name (system identifier)
|
|
992
|
+
*
|
|
993
|
+
* Also removes entire sections that become empty after filtering.
|
|
994
|
+
*/
|
|
995
|
+
private _filterSchemaForOptionConfig;
|
|
908
996
|
private _extractInitialValuesFromField;
|
|
909
997
|
private _buildPatchFromFormData;
|
|
910
998
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfiguratorConfigPanelComponent, never>;
|
|
911
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ConfiguratorConfigPanelComponent, "lib-configurator-config-panel", never, { "selectedField": { "alias": "selectedField"; "required": false; }; "selectedFieldInfo": { "alias": "selectedFieldInfo"; "required": false; }; "builderFieldType": { "alias": "builderFieldType"; "required": false; }; "fieldTypeSchemaMap": { "alias": "fieldTypeSchemaMap"; "required": false; }; }, { "configChange": "configChange"; "typeChange": "typeChange"; }, never, never, false, never>;
|
|
999
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfiguratorConfigPanelComponent, "lib-configurator-config-panel", never, { "selectedField": { "alias": "selectedField"; "required": false; }; "selectedFieldInfo": { "alias": "selectedFieldInfo"; "required": false; }; "builderFieldType": { "alias": "builderFieldType"; "required": false; }; "fieldTypeSchemaMap": { "alias": "fieldTypeSchemaMap"; "required": false; }; "showOptionConfig": { "alias": "showOptionConfig"; "required": false; }; }, { "configChange": "configChange"; "typeChange": "typeChange"; }, never, never, false, never>;
|
|
912
1000
|
}
|
|
913
1001
|
|
|
914
1002
|
declare class SmartFormController {
|
|
@@ -956,28 +1044,6 @@ declare class ExpressionService {
|
|
|
956
1044
|
static ɵprov: i0.ɵɵInjectableDeclaration<ExpressionService>;
|
|
957
1045
|
}
|
|
958
1046
|
|
|
959
|
-
type SnackbarVariant = 'success' | 'error' | 'warning' | 'info';
|
|
960
|
-
interface SnackbarConfig {
|
|
961
|
-
message: string;
|
|
962
|
-
variant?: SnackbarVariant;
|
|
963
|
-
duration?: number;
|
|
964
|
-
horizontalPosition?: 'start' | 'center' | 'end' | 'left' | 'right';
|
|
965
|
-
verticalPosition?: 'top' | 'bottom';
|
|
966
|
-
showCloseButton?: boolean;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
declare class SnackbarService {
|
|
970
|
-
private snackBar;
|
|
971
|
-
constructor(snackBar: MatSnackBar);
|
|
972
|
-
show(config: SnackbarConfig): void;
|
|
973
|
-
success(message: string, duration?: number): void;
|
|
974
|
-
error(message: string, duration?: number): void;
|
|
975
|
-
warning(message: string, duration?: number): void;
|
|
976
|
-
info(message: string, duration?: number): void;
|
|
977
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SnackbarService, never>;
|
|
978
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<SnackbarService>;
|
|
979
|
-
}
|
|
980
|
-
|
|
981
1047
|
declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
982
1048
|
private fb;
|
|
983
1049
|
controller: SmartFormController;
|
|
@@ -998,6 +1064,8 @@ declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
998
1064
|
*/
|
|
999
1065
|
labels: any;
|
|
1000
1066
|
mode: 'CREATE' | 'EDIT';
|
|
1067
|
+
/** When true, all form fields are disabled and the action bar is hidden (preview/read-only mode). */
|
|
1068
|
+
readOnly: boolean;
|
|
1001
1069
|
submit: EventEmitter<{
|
|
1002
1070
|
[key: string]: any;
|
|
1003
1071
|
}>;
|
|
@@ -1078,7 +1146,7 @@ declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1078
1146
|
private getButtonByActionKind;
|
|
1079
1147
|
private navigateTo;
|
|
1080
1148
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartFormComponent, never>;
|
|
1081
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SmartFormComponent, "lib-smart-form", never, { "formJson": { "alias": "formJson"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "enableDraftAutoSave": { "alias": "enableDraftAutoSave"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; }, { "submit": "submit"; "draftSave": "draftSave"; "actionClick": "actionClick"; "valueChange": "valueChange"; "fileAdded": "fileAdded"; "fileUploadFinished": "fileUploadFinished"; "fileRemoved": "fileRemoved"; }, never, never, false, never>;
|
|
1149
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SmartFormComponent, "lib-smart-form", never, { "formJson": { "alias": "formJson"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "enableDraftAutoSave": { "alias": "enableDraftAutoSave"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; }, { "submit": "submit"; "draftSave": "draftSave"; "actionClick": "actionClick"; "valueChange": "valueChange"; "fileAdded": "fileAdded"; "fileUploadFinished": "fileUploadFinished"; "fileRemoved": "fileRemoved"; }, never, never, false, never>;
|
|
1082
1150
|
}
|
|
1083
1151
|
|
|
1084
1152
|
declare class FormSectionComponent implements OnInit, OnDestroy {
|