commons-shared-web-ui 0.0.46 → 0.0.48
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 +194 -146
- package/fesm2022/commons-shared-web-ui.mjs.map +1 -1
- package/index.d.ts +225 -210
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnChanges, EventEmitter, SimpleChanges, ChangeDetectorRef, OnInit, OnDestroy, ElementRef, PipeTransform, NgZone, AfterViewInit
|
|
2
|
+
import { OnChanges, EventEmitter, SimpleChanges, ChangeDetectorRef, OnInit, OnDestroy, ElementRef, QueryList, PipeTransform, NgZone, AfterViewInit } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/material/snack-bar';
|
|
4
4
|
import { MatSnackBar, MatSnackBarRef } from '@angular/material/snack-bar';
|
|
5
5
|
import * as i2$1 from '@angular/common';
|
|
6
6
|
import * as i3$1 from '@angular/forms';
|
|
7
|
-
import { FormGroup,
|
|
7
|
+
import { FormGroup, FormControl, FormArray, FormBuilder, ValidatorFn, ControlValueAccessor, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
8
8
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
9
9
|
import * as i3$2 from '@angular/router';
|
|
10
10
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
@@ -1215,212 +1215,6 @@ declare class ExpressionService {
|
|
|
1215
1215
|
static ɵprov: i0.ɵɵInjectableDeclaration<ExpressionService>;
|
|
1216
1216
|
}
|
|
1217
1217
|
|
|
1218
|
-
declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
1219
|
-
private fb;
|
|
1220
|
-
controller: SmartFormController;
|
|
1221
|
-
private expressionService;
|
|
1222
|
-
private http;
|
|
1223
|
-
private snackbarService;
|
|
1224
|
-
private router;
|
|
1225
|
-
private cdr;
|
|
1226
|
-
private destroy$;
|
|
1227
|
-
formJson: string;
|
|
1228
|
-
initialValues?: {
|
|
1229
|
-
[key: string]: any;
|
|
1230
|
-
};
|
|
1231
|
-
enableDraftAutoSave: boolean;
|
|
1232
|
-
/** Flat i18n labels map passed by the consuming app.
|
|
1233
|
-
* After JSON parse the schema is walked and every string value that
|
|
1234
|
-
* matches a key in this map is replaced with the translated value.
|
|
1235
|
-
* Mirrors the pattern used by ConfigurableFormComponent + translateConfig.
|
|
1236
|
-
*/
|
|
1237
|
-
labels: any;
|
|
1238
|
-
mode: 'CREATE' | 'EDIT';
|
|
1239
|
-
/** When true, all form fields are disabled and the action bar is hidden (preview/read-only mode). */
|
|
1240
|
-
readOnly: boolean;
|
|
1241
|
-
submit: EventEmitter<{
|
|
1242
|
-
[key: string]: any;
|
|
1243
|
-
}>;
|
|
1244
|
-
draftSave: EventEmitter<string>;
|
|
1245
|
-
/**
|
|
1246
|
-
* Emitted when a button with a custom `type` (not 'cancel', 'draft', or
|
|
1247
|
-
* 'submit') is clicked. Payload contains the button `id` and the current
|
|
1248
|
-
* form data snapshot.
|
|
1249
|
-
*/
|
|
1250
|
-
actionClick: EventEmitter<{
|
|
1251
|
-
id: string;
|
|
1252
|
-
formData: {
|
|
1253
|
-
[key: string]: any;
|
|
1254
|
-
};
|
|
1255
|
-
}>;
|
|
1256
|
-
valueChange: EventEmitter<{
|
|
1257
|
-
[key: string]: any;
|
|
1258
|
-
}>;
|
|
1259
|
-
fileAdded: EventEmitter<any>;
|
|
1260
|
-
fileUploadFinished: EventEmitter<any>;
|
|
1261
|
-
fileRemoved: EventEmitter<any>;
|
|
1262
|
-
/** Emitted when a suffixActionIcon is clicked. Payload: { fieldName, actionId } */
|
|
1263
|
-
suffixActionClick: EventEmitter<{
|
|
1264
|
-
fieldName: string;
|
|
1265
|
-
actionId: string;
|
|
1266
|
-
}>;
|
|
1267
|
-
/** Emitted whenever the active section step changes. Carries current state so the
|
|
1268
|
-
* host can show/hide Previous/Next/Submit buttons in its own footer. */
|
|
1269
|
-
stepChange: EventEmitter<{
|
|
1270
|
-
currentStep: number;
|
|
1271
|
-
totalSteps: number;
|
|
1272
|
-
isFirst: boolean;
|
|
1273
|
-
isLast: boolean;
|
|
1274
|
-
stepLabel: string;
|
|
1275
|
-
}>;
|
|
1276
|
-
formSchema: FormSchema;
|
|
1277
|
-
formGroup: FormGroup;
|
|
1278
|
-
fieldList: FieldConfig[];
|
|
1279
|
-
isStepper: boolean;
|
|
1280
|
-
currentStep: number;
|
|
1281
|
-
isLoading: boolean;
|
|
1282
|
-
isDraftLoading: boolean;
|
|
1283
|
-
/** True when sectionStepper mode is active (SECTION form with top-level GROUPs as steps). */
|
|
1284
|
-
isSectionStepper: boolean;
|
|
1285
|
-
/** Index of the currently visible section step. */
|
|
1286
|
-
currentSectionStep: number;
|
|
1287
|
-
/** Flat list of top-level GROUP FieldConfigs that become the stepper steps. */
|
|
1288
|
-
sectionSteps: FieldConfig[];
|
|
1289
|
-
/** Validation state per section step — drives badge colour/icon. */
|
|
1290
|
-
stepValidationStates: ('untouched' | 'valid' | 'warning')[];
|
|
1291
|
-
/** Flat field-name lists per step used for targeted validation. */
|
|
1292
|
-
private stepFieldNames;
|
|
1293
|
-
/** Controls skeleton visibility. Stays false until schema is parsed AND
|
|
1294
|
-
* any EDIT-mode data fetch completes, but always shows for at least
|
|
1295
|
-
* SKELETON_MIN_MS so the animation is visible even on fast loads. */
|
|
1296
|
-
isFormReady: boolean;
|
|
1297
|
-
private readonly SKELETON_MIN_MS;
|
|
1298
|
-
private _skeletonStart;
|
|
1299
|
-
constructor(fb: FormBuilder, controller: SmartFormController, expressionService: ExpressionService, http: HttpClient, snackbarService: SnackbarService, router: Router, cdr: ChangeDetectorRef);
|
|
1300
|
-
ngOnInit(): void;
|
|
1301
|
-
loadEditData(): void;
|
|
1302
|
-
/** Flips isFormReady=true after the skeleton has been visible for at least SKELETON_MIN_MS. */
|
|
1303
|
-
private _markReady;
|
|
1304
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
1305
|
-
ngOnDestroy(): void;
|
|
1306
|
-
/** Public backward-compatible entry point — delegates to _startForm. */
|
|
1307
|
-
parseFormJson(): void;
|
|
1308
|
-
private _startForm;
|
|
1309
|
-
private _applySchema;
|
|
1310
|
-
initializeForm(): void;
|
|
1311
|
-
collectFields(fields: FieldConfig[]): void;
|
|
1312
|
-
handleSubmit(): void;
|
|
1313
|
-
/**
|
|
1314
|
-
* Universal action handler for any button click.
|
|
1315
|
-
* One handler decides how to process based on action.kind.
|
|
1316
|
-
*/
|
|
1317
|
-
handleButtonClick(btn: ActionButtonConfig): void;
|
|
1318
|
-
private fireActionApiCall;
|
|
1319
|
-
/**
|
|
1320
|
-
* Constructs nested payload by checking field properties on form controls.
|
|
1321
|
-
*/
|
|
1322
|
-
collectFormData(): {
|
|
1323
|
-
[key: string]: any;
|
|
1324
|
-
};
|
|
1325
|
-
/**
|
|
1326
|
-
* Deep merges the source object (e.g. extraPayload) into the target object (e.g. form payload).
|
|
1327
|
-
*/
|
|
1328
|
-
private deepMerge;
|
|
1329
|
-
private buildNestedPayload;
|
|
1330
|
-
private setNestedValue;
|
|
1331
|
-
private extractGroupValue;
|
|
1332
|
-
validate(): boolean;
|
|
1333
|
-
scrollToFirstInvalidControl(): void;
|
|
1334
|
-
submitToApi(formData: any, actionType?: 'submit' | 'draft', btn?: ActionButtonConfig): void;
|
|
1335
|
-
showAlert(type: 'success' | 'error' | 'warning' | 'info', message: string, customConfig?: any): void;
|
|
1336
|
-
/** Builds HttpHeaders from the token stored in the controller (sourced from configJSON). */
|
|
1337
|
-
getHeaders(): HttpHeaders;
|
|
1338
|
-
nextStep(): void;
|
|
1339
|
-
previousStep(): void;
|
|
1340
|
-
get canGoNext(): boolean;
|
|
1341
|
-
get canGoPrevious(): boolean;
|
|
1342
|
-
get currentStepConfig(): FieldConfig | undefined;
|
|
1343
|
-
/** Advance to the next section step. Called by the host footer "Next" button.
|
|
1344
|
-
* Validates the current step first — marks it valid (green) or warning (orange). */
|
|
1345
|
-
navigateToNext(): void;
|
|
1346
|
-
/** Go back to the previous section step. Called by the host footer "Previous" button. */
|
|
1347
|
-
navigateToPrevious(): void;
|
|
1348
|
-
/** Jump directly to a specific section step by index.
|
|
1349
|
-
* Validates the step being left so the badge state updates correctly. */
|
|
1350
|
-
goToSectionStep(index: number): void;
|
|
1351
|
-
get isSectionStepFirst(): boolean;
|
|
1352
|
-
get isSectionStepLast(): boolean;
|
|
1353
|
-
/** Returns the SectionConfig for a given step — passed to lib-form-section.
|
|
1354
|
-
* The outer label is intentionally omitted because the stepper nav already
|
|
1355
|
-
* displays it; showing it again inside the content would be redundant. */
|
|
1356
|
-
getSectionStepConfig(step: FieldConfig): any;
|
|
1357
|
-
private _emitStepChange;
|
|
1358
|
-
/** Marks all controls in the given step as touched and records valid/warning state. */
|
|
1359
|
-
private _validateStep;
|
|
1360
|
-
/** Recursively collects all leaf field names from a set of FieldConfigs. */
|
|
1361
|
-
private _collectFieldNames;
|
|
1362
|
-
get nextLabel(): string;
|
|
1363
|
-
get submitLabel(): string;
|
|
1364
|
-
get previousLabel(): string;
|
|
1365
|
-
get actionBarConfig(): ActionBarConfig | undefined;
|
|
1366
|
-
/**
|
|
1367
|
-
* Returns buttons for a given alignment, sorted by `order` (stable).
|
|
1368
|
-
*/
|
|
1369
|
-
getButtonsForAlignment(alignment: 'left' | 'right'): ActionButtonConfig[];
|
|
1370
|
-
getButtonLabel(btn: ActionButtonConfig): string;
|
|
1371
|
-
isButtonDisabled(btn: ActionButtonConfig): boolean;
|
|
1372
|
-
private getButtonByActionKind;
|
|
1373
|
-
private navigateTo;
|
|
1374
|
-
private _hasHierarchyDynamic;
|
|
1375
|
-
private _expandHierarchyNodes;
|
|
1376
|
-
private _expandNodeRecursive;
|
|
1377
|
-
private _expandSingleNode;
|
|
1378
|
-
private _normalizeHierarchyCfg;
|
|
1379
|
-
private _fetchHierarchyTemplate;
|
|
1380
|
-
private _buildHierarchyFields;
|
|
1381
|
-
private _getPathValue;
|
|
1382
|
-
private _codeToFieldName;
|
|
1383
|
-
private _codeToLabel;
|
|
1384
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SmartFormComponent, never>;
|
|
1385
|
-
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"; "suffixActionClick": "suffixActionClick"; "stepChange": "stepChange"; }, never, never, false, never>;
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
declare class FormSectionComponent implements OnInit, OnDestroy {
|
|
1389
|
-
private fb;
|
|
1390
|
-
config: SectionConfig;
|
|
1391
|
-
controller: SmartFormController;
|
|
1392
|
-
formGroup: FormGroup;
|
|
1393
|
-
/**
|
|
1394
|
-
* For allowMulti sections: the FormArray registered on the root formGroup.
|
|
1395
|
-
* Each element is a FormGroup representing one repeater instance.
|
|
1396
|
-
*/
|
|
1397
|
-
repeaterFormArray: FormArray;
|
|
1398
|
-
/** Tracks which accordion panels are open (by index). New instances start expanded. */
|
|
1399
|
-
expandedInstances: Set<number>;
|
|
1400
|
-
/**
|
|
1401
|
-
* The key under which the FormArray is registered in the root formGroup.
|
|
1402
|
-
* Falls back to config.name or a generated key.
|
|
1403
|
-
*/
|
|
1404
|
-
get arrayKey(): string;
|
|
1405
|
-
constructor(fb: FormBuilder);
|
|
1406
|
-
ngOnInit(): void;
|
|
1407
|
-
ngOnDestroy(): void;
|
|
1408
|
-
/** Creates a fresh FormGroup for one repeater instance */
|
|
1409
|
-
private createInstanceGroup;
|
|
1410
|
-
addInstance(): void;
|
|
1411
|
-
removeInstance(index: number): void;
|
|
1412
|
-
toggleInstance(index: number): void;
|
|
1413
|
-
isExpanded(index: number): boolean;
|
|
1414
|
-
getInstanceGroup(index: number): FormGroup;
|
|
1415
|
-
get instanceGroups(): FormGroup[];
|
|
1416
|
-
/** For non-allowMulti sections we simply pass the root formGroup down */
|
|
1417
|
-
get flatFormGroup(): FormGroup;
|
|
1418
|
-
/** Flatten a field tree to get all leaf fields (for ROW children etc.) */
|
|
1419
|
-
getFlatFields(fields: FieldConfig[]): FieldConfig[];
|
|
1420
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormSectionComponent, never>;
|
|
1421
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormSectionComponent, "lib-form-section", never, { "config": { "alias": "config"; "required": false; }; "controller": { "alias": "controller"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; }, {}, never, never, false, never>;
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
1218
|
interface ConfirmationModalConfig {
|
|
1425
1219
|
title: string;
|
|
1426
1220
|
headerTheme?: 'light' | 'dark';
|
|
@@ -1628,6 +1422,13 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
|
|
|
1628
1422
|
private setupFormulaValidation;
|
|
1629
1423
|
addGroupInstance(initialData?: any): void;
|
|
1630
1424
|
saveGroupInstance(index: number): void;
|
|
1425
|
+
/**
|
|
1426
|
+
* Re-opens any repeater instance (multiSave card or standard accordion panel)
|
|
1427
|
+
* whose nested FormGroup is invalid, so errors hidden by a collapsed card/panel
|
|
1428
|
+
* become visible. Called by the root form when a submit attempt is blocked.
|
|
1429
|
+
* Returns true if at least one invalid instance was revealed.
|
|
1430
|
+
*/
|
|
1431
|
+
revealInvalidInstances(): boolean;
|
|
1631
1432
|
cancelGroupInstance(index: number): void;
|
|
1632
1433
|
editGroupInstance(index: number): void;
|
|
1633
1434
|
toggleExpandGroupInstance(index: number): void;
|
|
@@ -1818,6 +1619,213 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
|
|
|
1818
1619
|
static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldComponent, "lib-form-field", never, { "config": { "alias": "config"; "required": false; }; "controller": { "alias": "controller"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "allowMulti": { "alias": "allowMulti"; "required": false; }; }, {}, never, never, false, never>;
|
|
1819
1620
|
}
|
|
1820
1621
|
|
|
1622
|
+
declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
1623
|
+
private fb;
|
|
1624
|
+
controller: SmartFormController;
|
|
1625
|
+
private expressionService;
|
|
1626
|
+
private http;
|
|
1627
|
+
private snackbarService;
|
|
1628
|
+
private router;
|
|
1629
|
+
private cdr;
|
|
1630
|
+
formFieldComponents: QueryList<FormFieldComponent>;
|
|
1631
|
+
private destroy$;
|
|
1632
|
+
formJson: string;
|
|
1633
|
+
initialValues?: {
|
|
1634
|
+
[key: string]: any;
|
|
1635
|
+
};
|
|
1636
|
+
enableDraftAutoSave: boolean;
|
|
1637
|
+
/** Flat i18n labels map passed by the consuming app.
|
|
1638
|
+
* After JSON parse the schema is walked and every string value that
|
|
1639
|
+
* matches a key in this map is replaced with the translated value.
|
|
1640
|
+
* Mirrors the pattern used by ConfigurableFormComponent + translateConfig.
|
|
1641
|
+
*/
|
|
1642
|
+
labels: any;
|
|
1643
|
+
mode: 'CREATE' | 'EDIT';
|
|
1644
|
+
/** When true, all form fields are disabled and the action bar is hidden (preview/read-only mode). */
|
|
1645
|
+
readOnly: boolean;
|
|
1646
|
+
submit: EventEmitter<{
|
|
1647
|
+
[key: string]: any;
|
|
1648
|
+
}>;
|
|
1649
|
+
draftSave: EventEmitter<string>;
|
|
1650
|
+
/**
|
|
1651
|
+
* Emitted when a button with a custom `type` (not 'cancel', 'draft', or
|
|
1652
|
+
* 'submit') is clicked. Payload contains the button `id` and the current
|
|
1653
|
+
* form data snapshot.
|
|
1654
|
+
*/
|
|
1655
|
+
actionClick: EventEmitter<{
|
|
1656
|
+
id: string;
|
|
1657
|
+
formData: {
|
|
1658
|
+
[key: string]: any;
|
|
1659
|
+
};
|
|
1660
|
+
}>;
|
|
1661
|
+
valueChange: EventEmitter<{
|
|
1662
|
+
[key: string]: any;
|
|
1663
|
+
}>;
|
|
1664
|
+
fileAdded: EventEmitter<any>;
|
|
1665
|
+
fileUploadFinished: EventEmitter<any>;
|
|
1666
|
+
fileRemoved: EventEmitter<any>;
|
|
1667
|
+
/** Emitted when a suffixActionIcon is clicked. Payload: { fieldName, actionId } */
|
|
1668
|
+
suffixActionClick: EventEmitter<{
|
|
1669
|
+
fieldName: string;
|
|
1670
|
+
actionId: string;
|
|
1671
|
+
}>;
|
|
1672
|
+
/** Emitted whenever the active section step changes. Carries current state so the
|
|
1673
|
+
* host can show/hide Previous/Next/Submit buttons in its own footer. */
|
|
1674
|
+
stepChange: EventEmitter<{
|
|
1675
|
+
currentStep: number;
|
|
1676
|
+
totalSteps: number;
|
|
1677
|
+
isFirst: boolean;
|
|
1678
|
+
isLast: boolean;
|
|
1679
|
+
stepLabel: string;
|
|
1680
|
+
}>;
|
|
1681
|
+
formSchema: FormSchema;
|
|
1682
|
+
formGroup: FormGroup;
|
|
1683
|
+
fieldList: FieldConfig[];
|
|
1684
|
+
isStepper: boolean;
|
|
1685
|
+
currentStep: number;
|
|
1686
|
+
isLoading: boolean;
|
|
1687
|
+
isDraftLoading: boolean;
|
|
1688
|
+
/** True when sectionStepper mode is active (SECTION form with top-level GROUPs as steps). */
|
|
1689
|
+
isSectionStepper: boolean;
|
|
1690
|
+
/** Index of the currently visible section step. */
|
|
1691
|
+
currentSectionStep: number;
|
|
1692
|
+
/** Flat list of top-level GROUP FieldConfigs that become the stepper steps. */
|
|
1693
|
+
sectionSteps: FieldConfig[];
|
|
1694
|
+
/** Validation state per section step — drives badge colour/icon. */
|
|
1695
|
+
stepValidationStates: ('untouched' | 'valid' | 'warning')[];
|
|
1696
|
+
/** Flat field-name lists per step used for targeted validation. */
|
|
1697
|
+
private stepFieldNames;
|
|
1698
|
+
/** Controls skeleton visibility. Stays false until schema is parsed AND
|
|
1699
|
+
* any EDIT-mode data fetch completes, but always shows for at least
|
|
1700
|
+
* SKELETON_MIN_MS so the animation is visible even on fast loads. */
|
|
1701
|
+
isFormReady: boolean;
|
|
1702
|
+
private readonly SKELETON_MIN_MS;
|
|
1703
|
+
private _skeletonStart;
|
|
1704
|
+
constructor(fb: FormBuilder, controller: SmartFormController, expressionService: ExpressionService, http: HttpClient, snackbarService: SnackbarService, router: Router, cdr: ChangeDetectorRef);
|
|
1705
|
+
ngOnInit(): void;
|
|
1706
|
+
loadEditData(): void;
|
|
1707
|
+
/** Flips isFormReady=true after the skeleton has been visible for at least SKELETON_MIN_MS. */
|
|
1708
|
+
private _markReady;
|
|
1709
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
1710
|
+
ngOnDestroy(): void;
|
|
1711
|
+
/** Public backward-compatible entry point — delegates to _startForm. */
|
|
1712
|
+
parseFormJson(): void;
|
|
1713
|
+
private _startForm;
|
|
1714
|
+
private _applySchema;
|
|
1715
|
+
initializeForm(): void;
|
|
1716
|
+
collectFields(fields: FieldConfig[]): void;
|
|
1717
|
+
handleSubmit(): void;
|
|
1718
|
+
/**
|
|
1719
|
+
* Universal action handler for any button click.
|
|
1720
|
+
* One handler decides how to process based on action.kind.
|
|
1721
|
+
*/
|
|
1722
|
+
handleButtonClick(btn: ActionButtonConfig): void;
|
|
1723
|
+
private fireActionApiCall;
|
|
1724
|
+
/**
|
|
1725
|
+
* Constructs nested payload by checking field properties on form controls.
|
|
1726
|
+
*/
|
|
1727
|
+
collectFormData(): {
|
|
1728
|
+
[key: string]: any;
|
|
1729
|
+
};
|
|
1730
|
+
/**
|
|
1731
|
+
* Deep merges the source object (e.g. extraPayload) into the target object (e.g. form payload).
|
|
1732
|
+
*/
|
|
1733
|
+
private deepMerge;
|
|
1734
|
+
private buildNestedPayload;
|
|
1735
|
+
private setNestedValue;
|
|
1736
|
+
private extractGroupValue;
|
|
1737
|
+
validate(): boolean;
|
|
1738
|
+
scrollToFirstInvalidControl(): void;
|
|
1739
|
+
submitToApi(formData: any, actionType?: 'submit' | 'draft', btn?: ActionButtonConfig): void;
|
|
1740
|
+
showAlert(type: 'success' | 'error' | 'warning' | 'info', message: string, customConfig?: any): void;
|
|
1741
|
+
/** Builds HttpHeaders from the token stored in the controller (sourced from configJSON). */
|
|
1742
|
+
getHeaders(): HttpHeaders;
|
|
1743
|
+
nextStep(): void;
|
|
1744
|
+
previousStep(): void;
|
|
1745
|
+
get canGoNext(): boolean;
|
|
1746
|
+
get canGoPrevious(): boolean;
|
|
1747
|
+
get currentStepConfig(): FieldConfig | undefined;
|
|
1748
|
+
/** Advance to the next section step. Called by the host footer "Next" button.
|
|
1749
|
+
* Validates the current step first — marks it valid (green) or warning (orange). */
|
|
1750
|
+
navigateToNext(): void;
|
|
1751
|
+
/** Go back to the previous section step. Called by the host footer "Previous" button. */
|
|
1752
|
+
navigateToPrevious(): void;
|
|
1753
|
+
/** Jump directly to a specific section step by index.
|
|
1754
|
+
* Validates the step being left so the badge state updates correctly. */
|
|
1755
|
+
goToSectionStep(index: number): void;
|
|
1756
|
+
get isSectionStepFirst(): boolean;
|
|
1757
|
+
get isSectionStepLast(): boolean;
|
|
1758
|
+
/** Returns the SectionConfig for a given step — passed to lib-form-section.
|
|
1759
|
+
* The outer label is intentionally omitted because the stepper nav already
|
|
1760
|
+
* displays it; showing it again inside the content would be redundant. */
|
|
1761
|
+
getSectionStepConfig(step: FieldConfig): any;
|
|
1762
|
+
private _emitStepChange;
|
|
1763
|
+
/** Marks all controls in the given step as touched and records valid/warning state. */
|
|
1764
|
+
private _validateStep;
|
|
1765
|
+
/** Recursively collects all leaf field names from a set of FieldConfigs. */
|
|
1766
|
+
private _collectFieldNames;
|
|
1767
|
+
get nextLabel(): string;
|
|
1768
|
+
get submitLabel(): string;
|
|
1769
|
+
get previousLabel(): string;
|
|
1770
|
+
get actionBarConfig(): ActionBarConfig | undefined;
|
|
1771
|
+
/**
|
|
1772
|
+
* Returns buttons for a given alignment, sorted by `order` (stable).
|
|
1773
|
+
*/
|
|
1774
|
+
getButtonsForAlignment(alignment: 'left' | 'right'): ActionButtonConfig[];
|
|
1775
|
+
getButtonLabel(btn: ActionButtonConfig): string;
|
|
1776
|
+
isButtonDisabled(btn: ActionButtonConfig): boolean;
|
|
1777
|
+
private getButtonByActionKind;
|
|
1778
|
+
private navigateTo;
|
|
1779
|
+
private _hasHierarchyDynamic;
|
|
1780
|
+
private _expandHierarchyNodes;
|
|
1781
|
+
private _expandNodeRecursive;
|
|
1782
|
+
private _expandSingleNode;
|
|
1783
|
+
private _normalizeHierarchyCfg;
|
|
1784
|
+
private _fetchHierarchyTemplate;
|
|
1785
|
+
private _buildHierarchyFields;
|
|
1786
|
+
private _getPathValue;
|
|
1787
|
+
private _codeToFieldName;
|
|
1788
|
+
private _codeToLabel;
|
|
1789
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SmartFormComponent, never>;
|
|
1790
|
+
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"; "suffixActionClick": "suffixActionClick"; "stepChange": "stepChange"; }, never, never, false, never>;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
declare class FormSectionComponent implements OnInit, OnDestroy {
|
|
1794
|
+
private fb;
|
|
1795
|
+
config: SectionConfig;
|
|
1796
|
+
controller: SmartFormController;
|
|
1797
|
+
formGroup: FormGroup;
|
|
1798
|
+
/**
|
|
1799
|
+
* For allowMulti sections: the FormArray registered on the root formGroup.
|
|
1800
|
+
* Each element is a FormGroup representing one repeater instance.
|
|
1801
|
+
*/
|
|
1802
|
+
repeaterFormArray: FormArray;
|
|
1803
|
+
/** Tracks which accordion panels are open (by index). New instances start expanded. */
|
|
1804
|
+
expandedInstances: Set<number>;
|
|
1805
|
+
/**
|
|
1806
|
+
* The key under which the FormArray is registered in the root formGroup.
|
|
1807
|
+
* Falls back to config.name or a generated key.
|
|
1808
|
+
*/
|
|
1809
|
+
get arrayKey(): string;
|
|
1810
|
+
constructor(fb: FormBuilder);
|
|
1811
|
+
ngOnInit(): void;
|
|
1812
|
+
ngOnDestroy(): void;
|
|
1813
|
+
/** Creates a fresh FormGroup for one repeater instance */
|
|
1814
|
+
private createInstanceGroup;
|
|
1815
|
+
addInstance(): void;
|
|
1816
|
+
removeInstance(index: number): void;
|
|
1817
|
+
toggleInstance(index: number): void;
|
|
1818
|
+
isExpanded(index: number): boolean;
|
|
1819
|
+
getInstanceGroup(index: number): FormGroup;
|
|
1820
|
+
get instanceGroups(): FormGroup[];
|
|
1821
|
+
/** For non-allowMulti sections we simply pass the root formGroup down */
|
|
1822
|
+
get flatFormGroup(): FormGroup;
|
|
1823
|
+
/** Flatten a field tree to get all leaf fields (for ROW children etc.) */
|
|
1824
|
+
getFlatFields(fields: FieldConfig[]): FieldConfig[];
|
|
1825
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormSectionComponent, never>;
|
|
1826
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormSectionComponent, "lib-form-section", never, { "config": { "alias": "config"; "required": false; }; "controller": { "alias": "controller"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; }, {}, never, never, false, never>;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1821
1829
|
/**
|
|
1822
1830
|
* Bypasses Angular's DomSanitizer for resource URLs (e.g. YouTube embed iframes).
|
|
1823
1831
|
* Used only for trusted URLs such as YouTube embed links derived from user-provided video IDs.
|
|
@@ -3923,8 +3931,15 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
|
|
|
3923
3931
|
}
|
|
3924
3932
|
|
|
3925
3933
|
/**
|
|
3926
|
-
*
|
|
3927
|
-
*
|
|
3934
|
+
* Marks rich-text HTML (e.g. from a smart-table "html" column, always sourced from this
|
|
3935
|
+
* app's own rich-text editor output, never arbitrary external/user-supplied markup) as
|
|
3936
|
+
* trusted so [innerHTML] renders it without Angular's default HTML sanitizer stripping it.
|
|
3937
|
+
*
|
|
3938
|
+
* Deliberately does NOT run the value through DomSanitizer.sanitize(SecurityContext.HTML, ...)
|
|
3939
|
+
* first — that sanitizer strips `style` attributes entirely (they're not in its allowlist),
|
|
3940
|
+
* which silently destroyed rich-text formatting like text color and highlight color while
|
|
3941
|
+
* leaving semantic-tag formatting (bold/italic/underline) untouched, since only tags — not
|
|
3942
|
+
* inline styles — survive that pass.
|
|
3928
3943
|
*/
|
|
3929
3944
|
declare class SafeHtmlPipe implements PipeTransform {
|
|
3930
3945
|
private sanitizer;
|