commons-shared-web-ui 0.0.24 → 0.0.26
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 +427 -80
- package/fesm2022/commons-shared-web-ui.mjs.map +1 -1
- package/index.d.ts +129 -19
- package/package.json +1 -1
- package/src/lib/modules/confirmation-modal/confirmation-modal.theme.scss +1 -1
- package/src/lib/modules/smart-table/smart-table.theme.scss +4 -0
package/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { FormGroup, FormBuilder, FormArray, FormControl, ValidatorFn, ControlVal
|
|
|
6
6
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
7
7
|
import * as i3$2 from '@angular/router';
|
|
8
8
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
9
|
-
import {
|
|
9
|
+
import { BehaviorSubject, Subject, Observable } from 'rxjs';
|
|
10
10
|
import * as i2 from '@angular/material/snack-bar';
|
|
11
11
|
import { MatSnackBar, MatSnackBarRef } from '@angular/material/snack-bar';
|
|
12
12
|
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
|
@@ -668,6 +668,14 @@ declare class FieldSelectionService {
|
|
|
668
668
|
declare class FieldSelectionComponent implements OnChanges {
|
|
669
669
|
schema: FormSchema;
|
|
670
670
|
schemaChange: EventEmitter<FormSchema>;
|
|
671
|
+
/**
|
|
672
|
+
* When true, the enable/disable toggle is hidden for option-driven field types
|
|
673
|
+
* (DROPDOWN, RADIO, MULTI_SELECT, etc.).
|
|
674
|
+
* Useful for business-user-facing form configurators where developers
|
|
675
|
+
* pre-fill the option data and these fields should always be included.
|
|
676
|
+
* Defaults to false (show toggle for all fields).
|
|
677
|
+
*/
|
|
678
|
+
hideToggleForOptionTypes: boolean;
|
|
671
679
|
protected readonly store: FieldSelectionService;
|
|
672
680
|
ngOnChanges(changes: SimpleChanges): void;
|
|
673
681
|
onToggleGroup(groupIndex: number): void;
|
|
@@ -678,7 +686,7 @@ declare class FieldSelectionComponent implements OnChanges {
|
|
|
678
686
|
trackByGroupIndex(index: number): number;
|
|
679
687
|
private _emitChange;
|
|
680
688
|
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>;
|
|
689
|
+
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
690
|
}
|
|
683
691
|
|
|
684
692
|
/**
|
|
@@ -771,6 +779,13 @@ declare class FieldConfiguratorService {
|
|
|
771
779
|
declare class FieldConfiguratorComponent implements OnChanges {
|
|
772
780
|
schema: FormSchema;
|
|
773
781
|
schemaChange: EventEmitter<FormSchema>;
|
|
782
|
+
/**
|
|
783
|
+
* When false, the optionConfig section (apiUrl, dataPath, etc.) is hidden
|
|
784
|
+
* from the configurator panel. Useful for business-user-facing configurators
|
|
785
|
+
* where option URLs are pre-filled by the developer.
|
|
786
|
+
* Defaults to true (show everything).
|
|
787
|
+
*/
|
|
788
|
+
showOptionConfig: boolean;
|
|
774
789
|
readonly store: FieldConfiguratorService;
|
|
775
790
|
private readonly schemaMapOverride;
|
|
776
791
|
/**
|
|
@@ -786,12 +801,14 @@ declare class FieldConfiguratorComponent implements OnChanges {
|
|
|
786
801
|
onTypeChange(builderType: string): void;
|
|
787
802
|
private _emitChange;
|
|
788
803
|
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>;
|
|
804
|
+
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
805
|
}
|
|
791
806
|
|
|
792
807
|
declare class GroupNodeComponent {
|
|
793
808
|
group: SelectionGroupNode;
|
|
794
809
|
groupIndex: number;
|
|
810
|
+
/** Propagated from FieldSelectionComponent — see SelectionFieldNodeComponent for details. */
|
|
811
|
+
hideToggleForOptionTypes: boolean;
|
|
795
812
|
toggleEnabled: EventEmitter<void>;
|
|
796
813
|
toggleExpanded: EventEmitter<void>;
|
|
797
814
|
sectionToggleEnabled: EventEmitter<number[]>;
|
|
@@ -808,13 +825,15 @@ declare class GroupNodeComponent {
|
|
|
808
825
|
}): void;
|
|
809
826
|
trackBySectionIndex(index: number): number;
|
|
810
827
|
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>;
|
|
828
|
+
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
829
|
}
|
|
813
830
|
|
|
814
831
|
declare class SelectionSectionNodeComponent {
|
|
815
832
|
section: SelectionSectionNode;
|
|
816
833
|
sectionIndex: number;
|
|
817
834
|
depth: number;
|
|
835
|
+
/** Propagated from FieldSelectionComponent — see SelectionFieldNodeComponent for details. */
|
|
836
|
+
hideToggleForOptionTypes: boolean;
|
|
818
837
|
/** Emits the sub-path from this node downward (empty [] for self) */
|
|
819
838
|
toggleEnabled: EventEmitter<number[]>;
|
|
820
839
|
toggleExpanded: EventEmitter<number[]>;
|
|
@@ -836,14 +855,21 @@ declare class SelectionSectionNodeComponent {
|
|
|
836
855
|
trackByFieldIndex(index: number): number;
|
|
837
856
|
trackBySubsectionIndex(index: number): number;
|
|
838
857
|
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>;
|
|
858
|
+
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
859
|
}
|
|
841
860
|
|
|
842
861
|
declare class SelectionFieldNodeComponent {
|
|
843
862
|
field: SelectionFieldNode;
|
|
844
863
|
toggleSelected: EventEmitter<void>;
|
|
864
|
+
/**
|
|
865
|
+
* When true, the enable/disable toggle is hidden for option-driven field types
|
|
866
|
+
* (DROPDOWN, RADIO, MULTI_SELECT, etc.). These types have their options
|
|
867
|
+
* pre-configured by the developer and shouldn't be toggled by business users.
|
|
868
|
+
*/
|
|
869
|
+
hideToggleForOptionTypes: boolean;
|
|
870
|
+
get isOptionDrivenType(): boolean;
|
|
845
871
|
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>;
|
|
872
|
+
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
873
|
}
|
|
848
874
|
|
|
849
875
|
declare class ConfiguratorTreeComponent {
|
|
@@ -870,6 +896,12 @@ declare class ConfiguratorConfigPanelComponent implements OnChanges {
|
|
|
870
896
|
fieldTypeSchemaMap: Record<string, FormSchema>;
|
|
871
897
|
configChange: EventEmitter<Record<string, unknown>>;
|
|
872
898
|
typeChange: EventEmitter<string>;
|
|
899
|
+
/**
|
|
900
|
+
* When false, all `optionConfig.*` fields (apiUrl, dataPath, labelPath, etc.)
|
|
901
|
+
* are hidden from the config panel. Business users don't need to configure
|
|
902
|
+
* option URLs — these are pre-filled by the developer in the master JSON.
|
|
903
|
+
*/
|
|
904
|
+
showOptionConfig: boolean;
|
|
873
905
|
/** Exposed to the template for the native type-switcher select */
|
|
874
906
|
readonly switchableFieldTypes: {
|
|
875
907
|
label: string;
|
|
@@ -905,10 +937,15 @@ declare class ConfiguratorConfigPanelComponent implements OnChanges {
|
|
|
905
937
|
* guarantee a completely fresh SmartForm instance is mounted.
|
|
906
938
|
*/
|
|
907
939
|
private _buildConfigFormForType;
|
|
940
|
+
/**
|
|
941
|
+
* Deep-clones the schema and removes any field whose `name` starts with
|
|
942
|
+
* `optionConfig.` and removes entire sections that become empty after that.
|
|
943
|
+
*/
|
|
944
|
+
private _filterSchemaForOptionConfig;
|
|
908
945
|
private _extractInitialValuesFromField;
|
|
909
946
|
private _buildPatchFromFormData;
|
|
910
947
|
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>;
|
|
948
|
+
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
949
|
}
|
|
913
950
|
|
|
914
951
|
declare class SmartFormController {
|
|
@@ -921,7 +958,10 @@ declare class SmartFormController {
|
|
|
921
958
|
labels: any;
|
|
922
959
|
/** Custom label keys for form actions (Next, Submit, Add, etc.) */
|
|
923
960
|
actionLabels?: FormLabels;
|
|
924
|
-
|
|
961
|
+
fieldSubjects: Map<string, BehaviorSubject<any>>;
|
|
962
|
+
fileAdded$: Subject<any>;
|
|
963
|
+
fileUploadFinished$: Subject<any>;
|
|
964
|
+
fileRemoved$: Subject<any>;
|
|
925
965
|
initialize(initialData: {
|
|
926
966
|
[key: string]: any;
|
|
927
967
|
}): void;
|
|
@@ -995,6 +1035,8 @@ declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
995
1035
|
*/
|
|
996
1036
|
labels: any;
|
|
997
1037
|
mode: 'CREATE' | 'EDIT';
|
|
1038
|
+
/** When true, all form fields are disabled and the action bar is hidden (preview/read-only mode). */
|
|
1039
|
+
readOnly: boolean;
|
|
998
1040
|
submit: EventEmitter<{
|
|
999
1041
|
[key: string]: any;
|
|
1000
1042
|
}>;
|
|
@@ -1013,6 +1055,9 @@ declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1013
1055
|
valueChange: EventEmitter<{
|
|
1014
1056
|
[key: string]: any;
|
|
1015
1057
|
}>;
|
|
1058
|
+
fileAdded: EventEmitter<any>;
|
|
1059
|
+
fileUploadFinished: EventEmitter<any>;
|
|
1060
|
+
fileRemoved: EventEmitter<any>;
|
|
1016
1061
|
formSchema: FormSchema;
|
|
1017
1062
|
formGroup: FormGroup;
|
|
1018
1063
|
fieldList: FieldConfig[];
|
|
@@ -1072,7 +1117,7 @@ declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1072
1117
|
private getButtonByActionKind;
|
|
1073
1118
|
private navigateTo;
|
|
1074
1119
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartFormComponent, never>;
|
|
1075
|
-
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"; }, never, never, false, never>;
|
|
1120
|
+
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>;
|
|
1076
1121
|
}
|
|
1077
1122
|
|
|
1078
1123
|
declare class FormSectionComponent implements OnInit, OnDestroy {
|
|
@@ -1845,7 +1890,7 @@ interface RadioConfig {
|
|
|
1845
1890
|
disabled?: boolean;
|
|
1846
1891
|
required?: boolean;
|
|
1847
1892
|
labelPosition?: 'before' | 'after';
|
|
1848
|
-
color?: 'primary' | 'accent' | 'warn';
|
|
1893
|
+
color?: 'primary' | 'warning' | 'danger' | 'success' | 'accent' | 'warn' | string;
|
|
1849
1894
|
layout?: 'vertical' | 'horizontal';
|
|
1850
1895
|
gap?: string;
|
|
1851
1896
|
labelColor?: string;
|
|
@@ -1872,7 +1917,7 @@ declare class RadioComponent implements ControlValueAccessor, OnInit {
|
|
|
1872
1917
|
disabled: boolean;
|
|
1873
1918
|
required: boolean;
|
|
1874
1919
|
labelPosition: 'before' | 'after';
|
|
1875
|
-
color: 'primary' | 'accent' | 'warn';
|
|
1920
|
+
color: 'primary' | 'warning' | 'danger' | 'success' | 'accent' | 'warn' | string;
|
|
1876
1921
|
layout: 'vertical' | 'horizontal';
|
|
1877
1922
|
labels: RadioLabels;
|
|
1878
1923
|
gap?: string;
|
|
@@ -1904,8 +1949,9 @@ declare class RadioComponent implements ControlValueAccessor, OnInit {
|
|
|
1904
1949
|
registerOnChange(fn: any): void;
|
|
1905
1950
|
registerOnTouched(fn: any): void;
|
|
1906
1951
|
setDisabledState(isDisabled: boolean): void;
|
|
1907
|
-
onRadioChange(
|
|
1952
|
+
onRadioChange(option: RadioOption): void;
|
|
1908
1953
|
private getStyleValue;
|
|
1954
|
+
private getThemeColor;
|
|
1909
1955
|
get wrapperStyles(): {
|
|
1910
1956
|
[key: string]: string | undefined;
|
|
1911
1957
|
};
|
|
@@ -1922,7 +1968,7 @@ interface ToggleConfig {
|
|
|
1922
1968
|
disabled?: boolean;
|
|
1923
1969
|
required?: boolean;
|
|
1924
1970
|
labelPosition?: 'before' | 'after';
|
|
1925
|
-
color?: string;
|
|
1971
|
+
color?: 'primary' | 'warning' | 'danger' | 'success' | string;
|
|
1926
1972
|
uncheckedColor?: string;
|
|
1927
1973
|
checkedColor?: string;
|
|
1928
1974
|
thumbColor?: string;
|
|
@@ -1976,6 +2022,7 @@ declare class ToggleComponent implements ControlValueAccessor, OnInit, OnChanges
|
|
|
1976
2022
|
setDisabledState(isDisabled: boolean): void;
|
|
1977
2023
|
onToggleChange(event: any): void;
|
|
1978
2024
|
private getStyleValue;
|
|
2025
|
+
private getThemeColor;
|
|
1979
2026
|
get wrapperStyles(): {
|
|
1980
2027
|
[key: string]: string | undefined;
|
|
1981
2028
|
};
|
|
@@ -2339,6 +2386,8 @@ declare class ButtonDropdownComponent {
|
|
|
2339
2386
|
declare class ConfirmationModalComponent implements OnInit, OnDestroy {
|
|
2340
2387
|
config: ConfirmationModalConfig;
|
|
2341
2388
|
isOpen: boolean;
|
|
2389
|
+
confirmDisabled: boolean;
|
|
2390
|
+
confirmLoading: boolean;
|
|
2342
2391
|
confirm: EventEmitter<void>;
|
|
2343
2392
|
cancel: EventEmitter<void>;
|
|
2344
2393
|
close: EventEmitter<void>;
|
|
@@ -2346,6 +2395,7 @@ declare class ConfirmationModalComponent implements OnInit, OnDestroy {
|
|
|
2346
2395
|
private defaultConfig;
|
|
2347
2396
|
mergedConfig: ConfirmationModalConfig;
|
|
2348
2397
|
private previousActiveElement;
|
|
2398
|
+
private isSubmitting;
|
|
2349
2399
|
ngOnInit(): void;
|
|
2350
2400
|
ngOnChanges(): void;
|
|
2351
2401
|
private updateConfig;
|
|
@@ -2364,7 +2414,7 @@ declare class ConfirmationModalComponent implements OnInit, OnDestroy {
|
|
|
2364
2414
|
getIconValue(icon: any): string;
|
|
2365
2415
|
getIconColor(icon: any): string | undefined;
|
|
2366
2416
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmationModalComponent, never>;
|
|
2367
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmationModalComponent, "cc-confirmation-modal", never, { "config": { "alias": "config"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; }, { "confirm": "confirm"; "cancel": "cancel"; "close": "close"; "showCodeSnippet": "showCodeSnippet"; }, never, ["*", "[cc-modal-footer]"], false, never>;
|
|
2417
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmationModalComponent, "cc-confirmation-modal", never, { "config": { "alias": "config"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "confirmDisabled": { "alias": "confirmDisabled"; "required": false; }; "confirmLoading": { "alias": "confirmLoading"; "required": false; }; }, { "confirm": "confirm"; "cancel": "cancel"; "close": "close"; "showCodeSnippet": "showCodeSnippet"; }, never, ["*", "[cc-modal-footer]"], false, never>;
|
|
2368
2418
|
}
|
|
2369
2419
|
|
|
2370
2420
|
declare class ConfirmationModalModule {
|
|
@@ -3128,7 +3178,7 @@ interface TableFilter {
|
|
|
3128
3178
|
}
|
|
3129
3179
|
interface TableActionItem {
|
|
3130
3180
|
label: string;
|
|
3131
|
-
type: 'api' | 'callback' | 'route';
|
|
3181
|
+
type: 'api' | 'callback' | 'route' | 'delete';
|
|
3132
3182
|
icon?: string;
|
|
3133
3183
|
apiUrl?: string;
|
|
3134
3184
|
apiMethod?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
@@ -3136,6 +3186,15 @@ interface TableActionItem {
|
|
|
3136
3186
|
confirmationNeeded?: boolean;
|
|
3137
3187
|
confirmationMessage?: string;
|
|
3138
3188
|
callback?: (row: any) => void;
|
|
3189
|
+
/** Config for native 'delete' action type — drives the built-in confirmation modal */
|
|
3190
|
+
deleteConfig?: {
|
|
3191
|
+
apiUrl: string;
|
|
3192
|
+
idField?: string;
|
|
3193
|
+
modalTitle?: string;
|
|
3194
|
+
modalMessage?: string;
|
|
3195
|
+
confirmLabel?: string;
|
|
3196
|
+
cancelLabel?: string;
|
|
3197
|
+
};
|
|
3139
3198
|
}
|
|
3140
3199
|
interface TableAction {
|
|
3141
3200
|
label: string;
|
|
@@ -3182,7 +3241,7 @@ interface QueryParamsConfig {
|
|
|
3182
3241
|
}
|
|
3183
3242
|
interface TableConfig {
|
|
3184
3243
|
columns: TableColumn[];
|
|
3185
|
-
apiUrl
|
|
3244
|
+
apiUrl?: string;
|
|
3186
3245
|
apiMethod?: 'GET' | 'POST';
|
|
3187
3246
|
apiPayload?: any;
|
|
3188
3247
|
dataResponsePath?: string;
|
|
@@ -3220,6 +3279,22 @@ interface TableLabels {
|
|
|
3220
3279
|
itemsPerPageLabel?: string;
|
|
3221
3280
|
defaultConfirmationMessage?: string;
|
|
3222
3281
|
}
|
|
3282
|
+
/**
|
|
3283
|
+
* Emitted by the SmartTableComponent when operating in external-data mode
|
|
3284
|
+
* (i.e. when [tableData] input is provided by the parent).
|
|
3285
|
+
* The parent is responsible for fetching updated data based on this event
|
|
3286
|
+
* and providing it back via [tableData] and [totalItemsCount].
|
|
3287
|
+
*/
|
|
3288
|
+
interface TableDataChangeEvent {
|
|
3289
|
+
page: number;
|
|
3290
|
+
pageSize: number;
|
|
3291
|
+
sortBy?: string;
|
|
3292
|
+
orderBy?: 'ASC' | 'DESC';
|
|
3293
|
+
searchTerm?: string;
|
|
3294
|
+
filters?: {
|
|
3295
|
+
[key: string]: any;
|
|
3296
|
+
};
|
|
3297
|
+
}
|
|
3223
3298
|
|
|
3224
3299
|
declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
|
|
3225
3300
|
private http;
|
|
@@ -3227,6 +3302,18 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
|
|
|
3227
3302
|
private cdr;
|
|
3228
3303
|
private ngZone;
|
|
3229
3304
|
config: TableConfig;
|
|
3305
|
+
/**
|
|
3306
|
+
* External data mode: pass table rows directly from the parent.
|
|
3307
|
+
* When this input is provided, the component will NOT make any internal API calls.
|
|
3308
|
+
* Instead, it emits sortChange / pageChange / searchChange / filterChange events
|
|
3309
|
+
* so the parent can fetch and supply updated data.
|
|
3310
|
+
*/
|
|
3311
|
+
tableData?: any[];
|
|
3312
|
+
/**
|
|
3313
|
+
* Total number of items — used by the pagination component when operating in
|
|
3314
|
+
* external-data mode. Must be kept in sync by the parent.
|
|
3315
|
+
*/
|
|
3316
|
+
totalItemsCount?: number;
|
|
3230
3317
|
action: EventEmitter<{
|
|
3231
3318
|
action: TableAction;
|
|
3232
3319
|
row: any;
|
|
@@ -3241,6 +3328,12 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
|
|
|
3241
3328
|
row: any;
|
|
3242
3329
|
column: string;
|
|
3243
3330
|
}>;
|
|
3331
|
+
/** Emitted in external-data mode when the user changes the sort column/direction. */
|
|
3332
|
+
sortChange: EventEmitter<TableDataChangeEvent>;
|
|
3333
|
+
/** Emitted in external-data mode when the user changes the page or page size. */
|
|
3334
|
+
pageChange: EventEmitter<TableDataChangeEvent>;
|
|
3335
|
+
/** Emitted in external-data mode when the user types in the search box. */
|
|
3336
|
+
searchChange: EventEmitter<TableDataChangeEvent>;
|
|
3244
3337
|
data: any[];
|
|
3245
3338
|
totalItems: number;
|
|
3246
3339
|
currentPage: number;
|
|
@@ -3260,6 +3353,14 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
|
|
|
3260
3353
|
};
|
|
3261
3354
|
hasStickyColumns: boolean;
|
|
3262
3355
|
openDropdownId: string | null;
|
|
3356
|
+
/** Viewport-relative position used to render the dropdown as position:fixed. */
|
|
3357
|
+
dropdownPosition: {
|
|
3358
|
+
top: number;
|
|
3359
|
+
right: number;
|
|
3360
|
+
};
|
|
3361
|
+
deleteModalOpen: boolean;
|
|
3362
|
+
deleteModalConfig: any;
|
|
3363
|
+
private pendingDeleteAction;
|
|
3263
3364
|
searchSubject: Subject<string>;
|
|
3264
3365
|
stickyHeaders: QueryList<ElementRef>;
|
|
3265
3366
|
private resizeObserver;
|
|
@@ -3277,8 +3378,17 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
|
|
|
3277
3378
|
onSort(col: TableColumn): void;
|
|
3278
3379
|
onSearch(event: Event): void;
|
|
3279
3380
|
onFilterChange(key: string, event: Event): void;
|
|
3381
|
+
/**
|
|
3382
|
+
* Assembles the current table state into a `TableDataChangeEvent` object.
|
|
3383
|
+
* Emitted to the parent in external-data mode so it can fetch and supply new data.
|
|
3384
|
+
*/
|
|
3385
|
+
private buildChangeEvent;
|
|
3280
3386
|
onAction(action: TableAction, row: any): void;
|
|
3281
3387
|
onActionItemClick(item: any, row: any, event: Event): void;
|
|
3388
|
+
private openDeleteConfirmModal;
|
|
3389
|
+
deleteModalMessage: string;
|
|
3390
|
+
onDeleteConfirm(): void;
|
|
3391
|
+
onDeleteCancel(): void;
|
|
3282
3392
|
onTopAction(action: TableAction): void;
|
|
3283
3393
|
private executeApiAction;
|
|
3284
3394
|
onSelectAll(event: Event): void;
|
|
@@ -3298,12 +3408,12 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
|
|
|
3298
3408
|
toggleDropdown(id: string, event: Event): void;
|
|
3299
3409
|
closeDropdown(): void;
|
|
3300
3410
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartTableComponent, never>;
|
|
3301
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SmartTableComponent, "lib-smart-table", never, { "config": { "alias": "config"; "required": false; }; }, { "action": "action"; "topAction": "topAction"; "filterChange": "filterChange"; "rowSelect": "rowSelect"; "columnClick": "columnClick"; }, never, never, false, never>;
|
|
3411
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SmartTableComponent, "lib-smart-table", never, { "config": { "alias": "config"; "required": false; }; "tableData": { "alias": "tableData"; "required": false; }; "totalItemsCount": { "alias": "totalItemsCount"; "required": false; }; }, { "action": "action"; "topAction": "topAction"; "filterChange": "filterChange"; "rowSelect": "rowSelect"; "columnClick": "columnClick"; "sortChange": "sortChange"; "pageChange": "pageChange"; "searchChange": "searchChange"; }, never, never, false, never>;
|
|
3302
3412
|
}
|
|
3303
3413
|
|
|
3304
3414
|
declare class SmartTableModule {
|
|
3305
3415
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartTableModule, never>;
|
|
3306
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SmartTableModule, [typeof SmartTableComponent], [typeof i2$1.CommonModule, typeof i3$1.FormsModule, typeof PaginationModule, typeof ButtonModule, typeof MaterialModule], [typeof SmartTableComponent]>;
|
|
3416
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SmartTableModule, [typeof SmartTableComponent], [typeof i2$1.CommonModule, typeof i3$1.FormsModule, typeof PaginationModule, typeof ButtonModule, typeof MaterialModule, typeof ConfirmationModalModule], [typeof SmartTableComponent]>;
|
|
3307
3417
|
static ɵinj: i0.ɵɵInjectorDeclaration<SmartTableModule>;
|
|
3308
3418
|
}
|
|
3309
3419
|
|
|
@@ -3357,4 +3467,4 @@ declare class SnackbarModule {
|
|
|
3357
3467
|
}
|
|
3358
3468
|
|
|
3359
3469
|
export { AlertComponent, AlertModule, ButtonComponent, ButtonDropdownComponent, ButtonDropdownModule, ButtonModule, CheckboxComponent, ConfigurableFormComponent, configurableForm_examples_d as ConfigurableFormExamples, ConfigurableFormModule, ConfirmationModalComponent, ConfirmationModalModule, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_SIDE_NAV_TOOLTIP_POSITION, DatepickerComponent, DropdownComponent, ExpressionService, FieldConfiguratorComponent, FieldSelectionComponent, FilterComponent, FilterModule, FilterSidebarComponent, FilterSidebarModule, FormBuilderModule, FormComponentsModule, InputComponent, MaterialModule, NAV_ORIENTATION_DEFAULT, NAV_VARIANT_DEFAULT, NavComponent, NavModule, PAGINATION_THEME_DARK, PAGINATION_THEME_DEFAULT, PaginationComponent, PaginationModule, RadioComponent, SearchComponent, SharedUiModule, SideNavComponent, SideNavModule, SmartFormComponent, SmartFormController, smartForm_examples_d as SmartFormExamples, SmartFormModule, SmartTableComponent, SmartTableModule, SnackbarComponent, SnackbarModule, SnackbarService, StringUtils, SummaryCardComponent, SummaryCardModule, ToggleComponent, ValidationUtils, appendBaseUrlRecursively, clearLocalStorage, clearSessionStorage, getLocalStorageItem, getSessionStorageItem, removeLocalStorageItem, removeSessionStorageItem, setLocalStorageItem, setSessionStorageItem, translateConfig };
|
|
3360
|
-
export type { AlertLabels, AlertVariant, AttachmentConfig, ButtonLabels, ButtonVariant, CheckboxConfig, CheckboxLabels, CheckboxOption, ConfirmationModalConfig, DateConfig, DatePickerConfig, DatepickerLabels, DropdownAction, DropdownConfig, DropdownLabels, DropdownOption, EmailConfig, FieldConfig, FieldType, FilterChangeEvent, FilterConfig, FilterItem, FilterItemType, FilterOutput, FilterSearchConfig, FilterSidebarChangeEvent, FilterSidebarConfig, FilterSidebarOutput, FormConfig, FormField, FormOption, FormSchema, FormSection, GeneratedConfig, IconInput, InputConfig, InputLabels, InputType, JsonFieldConfig, JsonFormConfig, KeyType, LengthConstraint, LocationConfig, NavItem, NavStyleConfig, NestedStringConfig, NumberConfig, OptionConfig, OptionDTO, OptionItem, PaginationConfig, PaginationLabels, PhoneConfig, QueryParamsConfig, RadioConfig, RadioLabels, RadioOption, RangeConfig, RatingConfig, SearchConfig, SearchLabels, SectionConfig, SideNavItem, SideNavSection, SideNavStyleConfig, SnackbarConfig, SnackbarVariant, StepperConfig, SubmitConfig, SummaryCardConfig, SummaryCardLabels, SummaryCardMeta, TableAction, TableActionItem, TableColumn, TableConfig, TableFilter, TableFilterChangeEvent, TableFilterColumn, TableFilterConfig, TableFilterItem, TableFilterLabels, TableFilterOutput, TableLabels, TableOption, TableTheme, TextConfig, ToggleConfig, ToggleLabels, UIConfig, UISubType, UIType, UploadedFile, ValidationResult, ValidationRules };
|
|
3470
|
+
export type { AlertLabels, AlertVariant, AttachmentConfig, ButtonLabels, ButtonVariant, CheckboxConfig, CheckboxLabels, CheckboxOption, ConfirmationModalConfig, DateConfig, DatePickerConfig, DatepickerLabels, DropdownAction, DropdownConfig, DropdownLabels, DropdownOption, EmailConfig, FieldConfig, FieldType, FilterChangeEvent, FilterConfig, FilterItem, FilterItemType, FilterOutput, FilterSearchConfig, FilterSidebarChangeEvent, FilterSidebarConfig, FilterSidebarOutput, FormConfig, FormField, FormOption, FormSchema, FormSection, GeneratedConfig, IconInput, InputConfig, InputLabels, InputType, JsonFieldConfig, JsonFormConfig, KeyType, LengthConstraint, LocationConfig, NavItem, NavStyleConfig, NestedStringConfig, NumberConfig, OptionConfig, OptionDTO, OptionItem, PaginationConfig, PaginationLabels, PhoneConfig, QueryParamsConfig, RadioConfig, RadioLabels, RadioOption, RangeConfig, RatingConfig, SearchConfig, SearchLabels, SectionConfig, SideNavItem, SideNavSection, SideNavStyleConfig, SnackbarConfig, SnackbarVariant, StepperConfig, SubmitConfig, SummaryCardConfig, SummaryCardLabels, SummaryCardMeta, TableAction, TableActionItem, TableColumn, TableConfig, TableDataChangeEvent, TableFilter, TableFilterChangeEvent, TableFilterColumn, TableFilterConfig, TableFilterItem, TableFilterLabels, TableFilterOutput, TableLabels, TableOption, TableTheme, TextConfig, ToggleConfig, ToggleLabels, UIConfig, UISubType, UIType, UploadedFile, ValidationResult, ValidationRules };
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
+
@use '../confirmation-modal/confirmation-modal.theme' as confirmation-modal;
|
|
2
3
|
|
|
3
4
|
// Default Smart Table Theme
|
|
4
5
|
$smart-table-theme-defaults: (
|
|
@@ -215,4 +216,7 @@ $smart-table-theme-defaults: (
|
|
|
215
216
|
|
|
216
217
|
// --- Misc ---
|
|
217
218
|
--st-sort-icon-size: #{map.get($theme, sort-icon-size)};
|
|
219
|
+
|
|
220
|
+
// --- Confirmation Modal (bundled so delete modal renders correctly) ---
|
|
221
|
+
@include confirmation-modal.confirmation-modal-theme();
|
|
218
222
|
}
|