commons-shared-web-ui 0.0.6 → 0.0.8
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/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ import { ControlValueAccessor, FormGroup, FormBuilder, AbstractControl, FormCont
|
|
|
36
36
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
37
37
|
import * as i11$1 from '@angular/cdk/scrolling';
|
|
38
38
|
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
39
|
-
import { HttpClient } from '@angular/common/http';
|
|
39
|
+
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
40
40
|
import { Observable, Subject } from 'rxjs';
|
|
41
41
|
|
|
42
42
|
declare class MaterialModule {
|
|
@@ -1240,9 +1240,13 @@ interface SummaryCardMeta {
|
|
|
1240
1240
|
backgroundColor?: string;
|
|
1241
1241
|
cssClass?: string;
|
|
1242
1242
|
}
|
|
1243
|
+
interface SummaryCardLabels {
|
|
1244
|
+
iconAlt: string;
|
|
1245
|
+
}
|
|
1243
1246
|
declare class SummaryCardComponent {
|
|
1244
1247
|
config: SummaryCardConfig;
|
|
1245
1248
|
theme?: 'theme-1' | 'theme-2';
|
|
1249
|
+
labels: any;
|
|
1246
1250
|
cardClick: EventEmitter<void>;
|
|
1247
1251
|
constructor();
|
|
1248
1252
|
onCardClick(): void;
|
|
@@ -1266,7 +1270,7 @@ declare class SummaryCardComponent {
|
|
|
1266
1270
|
[key: string]: string;
|
|
1267
1271
|
};
|
|
1268
1272
|
static ɵfac: i0.ɵɵFactoryDeclaration<SummaryCardComponent, never>;
|
|
1269
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SummaryCardComponent, "lib-summary-card", never, { "config": { "alias": "config"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; }, { "cardClick": "cardClick"; }, never, never, false, never>;
|
|
1273
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SummaryCardComponent, "lib-summary-card", never, { "config": { "alias": "config"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; }, { "cardClick": "cardClick"; }, never, never, false, never>;
|
|
1270
1274
|
}
|
|
1271
1275
|
|
|
1272
1276
|
declare class SummaryCardModule {
|
|
@@ -1395,6 +1399,7 @@ declare class ConfigurableFormComponent implements OnInit, OnChanges {
|
|
|
1395
1399
|
jsonConfig: JsonFormConfig;
|
|
1396
1400
|
data: any;
|
|
1397
1401
|
baseApiUrl: string;
|
|
1402
|
+
labels: any;
|
|
1398
1403
|
optionsLoad: EventEmitter<any>;
|
|
1399
1404
|
form: FormGroup;
|
|
1400
1405
|
processedConfig: FormConfig;
|
|
@@ -1438,7 +1443,7 @@ declare class ConfigurableFormComponent implements OnInit, OnChanges {
|
|
|
1438
1443
|
togglePassword(fieldName: string): void;
|
|
1439
1444
|
isPasswordVisible(fieldName: string): boolean;
|
|
1440
1445
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfigurableFormComponent, never>;
|
|
1441
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ConfigurableFormComponent, "lib-configurable-form", never, { "config": { "alias": "config"; "required": false; }; "jsonConfig": { "alias": "jsonConfig"; "required": false; }; "data": { "alias": "data"; "required": false; }; "baseApiUrl": { "alias": "baseApiUrl"; "required": false; }; }, { "optionsLoad": "optionsLoad"; }, never, never, true, never>;
|
|
1446
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfigurableFormComponent, "lib-configurable-form", never, { "config": { "alias": "config"; "required": false; }; "jsonConfig": { "alias": "jsonConfig"; "required": false; }; "data": { "alias": "data"; "required": false; }; "baseApiUrl": { "alias": "baseApiUrl"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; }, { "optionsLoad": "optionsLoad"; }, never, never, true, never>;
|
|
1442
1447
|
}
|
|
1443
1448
|
|
|
1444
1449
|
declare class ConfigurableFormModule {
|
|
@@ -1460,6 +1465,20 @@ interface FormSchema {
|
|
|
1460
1465
|
sectionConfig?: SectionConfig;
|
|
1461
1466
|
stepperConfig?: StepperConfig;
|
|
1462
1467
|
submitConfig?: SubmitConfig;
|
|
1468
|
+
showActions?: boolean;
|
|
1469
|
+
/** Full token string passed to all library API calls (e.g. "Bearer eyJ…") */
|
|
1470
|
+
token?: string;
|
|
1471
|
+
/** HTTP header name to use for the token (default: "Authorization") */
|
|
1472
|
+
tokenHeader?: string;
|
|
1473
|
+
/** Custom label keys for form actions */
|
|
1474
|
+
labels?: FormLabels;
|
|
1475
|
+
}
|
|
1476
|
+
interface FormLabels {
|
|
1477
|
+
nextLabel?: string;
|
|
1478
|
+
submitLabel?: string;
|
|
1479
|
+
previousLabel?: string;
|
|
1480
|
+
addLabel?: string;
|
|
1481
|
+
removeLabel?: string;
|
|
1463
1482
|
}
|
|
1464
1483
|
interface SubmitConfig {
|
|
1465
1484
|
apiUrl: string;
|
|
@@ -1482,16 +1501,39 @@ interface FieldConfig {
|
|
|
1482
1501
|
name?: string;
|
|
1483
1502
|
label?: string;
|
|
1484
1503
|
type: string;
|
|
1485
|
-
subType
|
|
1504
|
+
subType?: string;
|
|
1486
1505
|
visible?: boolean;
|
|
1487
1506
|
visibilityExpression?: string;
|
|
1488
1507
|
required?: boolean;
|
|
1489
1508
|
disabled?: boolean;
|
|
1490
1509
|
defaultValue?: any;
|
|
1510
|
+
placeholder?: string;
|
|
1491
1511
|
hint?: string;
|
|
1512
|
+
/**
|
|
1513
|
+
* Column span in a 12-column grid (1–12).
|
|
1514
|
+
* Use this on any field or ROW to control its width.
|
|
1515
|
+
* Examples: 3 = 25%, 4 = 33%, 6 = 50%, 12 = 100% (default).
|
|
1516
|
+
* When a field is inside a ROW, the ROW children share space via colSpan.
|
|
1517
|
+
* When a field is a direct section child (not inside a ROW), colSpan wraps
|
|
1518
|
+
* it in the section-level 12-col grid automatically.
|
|
1519
|
+
*/
|
|
1520
|
+
colSpan?: number;
|
|
1521
|
+
/** Custom CSS class for the field container */
|
|
1522
|
+
className?: string;
|
|
1523
|
+
/** Unit or symbol shown before the input */
|
|
1524
|
+
prefix?: string;
|
|
1525
|
+
/** Unit or symbol shown after the input (e.g. "%", "Students") */
|
|
1526
|
+
suffix?: string;
|
|
1527
|
+
/** Whether the field is read-only (shows lock icon) */
|
|
1528
|
+
readonly?: boolean;
|
|
1492
1529
|
sectionConfig?: SectionConfig;
|
|
1530
|
+
/**
|
|
1531
|
+
* Cross-field validation config for SUBFIELDS groups.
|
|
1532
|
+
* Applied as a group-level validator on the nested FormGroup.
|
|
1533
|
+
*/
|
|
1493
1534
|
onChange?: string;
|
|
1494
1535
|
onValidate?: string;
|
|
1536
|
+
errorMessage?: string;
|
|
1495
1537
|
textConfig?: TextConfig;
|
|
1496
1538
|
emailConfig?: EmailConfig;
|
|
1497
1539
|
phoneConfig?: PhoneConfig;
|
|
@@ -1510,6 +1552,13 @@ interface TextConfig {
|
|
|
1510
1552
|
pattern?: string;
|
|
1511
1553
|
patternMessage?: string;
|
|
1512
1554
|
inputType?: string;
|
|
1555
|
+
/**
|
|
1556
|
+
* Name of another field in the same FormGroup whose value must equal this
|
|
1557
|
+
* field's value (e.g. "password" on a confirmPassword field).
|
|
1558
|
+
* Validation runs bi-directionally: whichever field changes last triggers
|
|
1559
|
+
* the check on the field that carries matchField config.
|
|
1560
|
+
*/
|
|
1561
|
+
matchField?: string;
|
|
1513
1562
|
}
|
|
1514
1563
|
interface LengthConstraint {
|
|
1515
1564
|
min?: number;
|
|
@@ -1567,9 +1616,22 @@ interface RangeConfig {
|
|
|
1567
1616
|
minDate?: string;
|
|
1568
1617
|
maxDate?: string;
|
|
1569
1618
|
}
|
|
1619
|
+
/**
|
|
1620
|
+
* Unified attachment / file-upload configuration.
|
|
1621
|
+
* Used by FILE_UPLOAD fields for any kind of upload — images, documents, PDFs, etc.
|
|
1622
|
+
*/
|
|
1570
1623
|
interface AttachmentConfig {
|
|
1624
|
+
/** Allow multiple file selection (default: false) */
|
|
1625
|
+
multiple?: boolean;
|
|
1626
|
+
/** Max number of files when multiple=true (default: 10) */
|
|
1571
1627
|
maxFiles?: number;
|
|
1628
|
+
/** Max file size per file in MB (default: 10) */
|
|
1572
1629
|
maxSizeMB?: number;
|
|
1630
|
+
/** Accepted MIME types or extensions, e.g. '.pdf,.jpg,image/*' */
|
|
1631
|
+
accept?: string;
|
|
1632
|
+
/** Human-readable hint shown in the drop zone, e.g. 'JPG, PNG, PDF (max 5 MB)' */
|
|
1633
|
+
acceptLabel?: string;
|
|
1634
|
+
/** Legacy: explicit list of allowed extensions (e.g. ['.pdf', '.jpg']) */
|
|
1573
1635
|
allowedExtensions?: string[];
|
|
1574
1636
|
}
|
|
1575
1637
|
interface LocationConfig {
|
|
@@ -1590,6 +1652,14 @@ interface ValidationResult {
|
|
|
1590
1652
|
|
|
1591
1653
|
declare class SmartFormController {
|
|
1592
1654
|
private formData;
|
|
1655
|
+
/** Auth token sourced from the FormSchema configJSON (e.g. "Bearer eyJ…") */
|
|
1656
|
+
token?: string;
|
|
1657
|
+
/** HTTP header name for the token (default: "Authorization") */
|
|
1658
|
+
tokenHeader?: string;
|
|
1659
|
+
/** Flat map of translated i18n labels passed from SmartFormComponent */
|
|
1660
|
+
labels: any;
|
|
1661
|
+
/** Custom label keys for form actions (Next, Submit, Add, etc.) */
|
|
1662
|
+
actionLabels?: FormLabels;
|
|
1593
1663
|
private fieldSubjects;
|
|
1594
1664
|
initialize(initialData: {
|
|
1595
1665
|
[key: string]: any;
|
|
@@ -1632,6 +1702,12 @@ declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1632
1702
|
[key: string]: any;
|
|
1633
1703
|
};
|
|
1634
1704
|
enableDraftAutoSave: boolean;
|
|
1705
|
+
/** Flat i18n labels map passed by the consuming app.
|
|
1706
|
+
* After JSON parse the schema is walked and every string value that
|
|
1707
|
+
* matches a key in this map is replaced with the translated value.
|
|
1708
|
+
* Mirrors the pattern used by ConfigurableFormComponent + translateConfig.
|
|
1709
|
+
*/
|
|
1710
|
+
labels: any;
|
|
1635
1711
|
submit: EventEmitter<{
|
|
1636
1712
|
[key: string]: any;
|
|
1637
1713
|
}>;
|
|
@@ -1650,40 +1726,134 @@ declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1650
1726
|
initializeForm(): void;
|
|
1651
1727
|
collectFields(fields: FieldConfig[]): void;
|
|
1652
1728
|
handleSubmit(): void;
|
|
1729
|
+
/**
|
|
1730
|
+
* Recursively extracts values from the formGroup, converting FormArrays to
|
|
1731
|
+
* arrays of objects so repeater groups come out as expected.
|
|
1732
|
+
*/
|
|
1733
|
+
collectFormData(): {
|
|
1734
|
+
[key: string]: any;
|
|
1735
|
+
};
|
|
1736
|
+
private extractGroupValue;
|
|
1737
|
+
validate(): boolean;
|
|
1738
|
+
scrollToFirstInvalidControl(): void;
|
|
1653
1739
|
submitToApi(formData: any): void;
|
|
1740
|
+
/** Builds HttpHeaders from the token stored in the controller (sourced from configJSON). */
|
|
1741
|
+
getHeaders(): HttpHeaders;
|
|
1654
1742
|
nextStep(): void;
|
|
1655
1743
|
previousStep(): void;
|
|
1656
1744
|
get canGoNext(): boolean;
|
|
1657
1745
|
get canGoPrevious(): boolean;
|
|
1658
1746
|
get currentStepConfig(): FieldConfig | undefined;
|
|
1747
|
+
get nextLabel(): string;
|
|
1748
|
+
get submitLabel(): string;
|
|
1749
|
+
get previousLabel(): string;
|
|
1659
1750
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartFormComponent, never>;
|
|
1660
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SmartFormComponent, "lib-smart-form", never, { "formJson": { "alias": "formJson"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "enableDraftAutoSave": { "alias": "enableDraftAutoSave"; "required": false; }; }, { "submit": "submit"; "draftSave": "draftSave"; }, never, never, false, never>;
|
|
1751
|
+
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; }; }, { "submit": "submit"; "draftSave": "draftSave"; }, never, never, false, never>;
|
|
1661
1752
|
}
|
|
1662
1753
|
|
|
1663
|
-
declare class FormSectionComponent {
|
|
1754
|
+
declare class FormSectionComponent implements OnInit, OnDestroy {
|
|
1755
|
+
private fb;
|
|
1664
1756
|
config: SectionConfig;
|
|
1665
1757
|
controller: SmartFormController;
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1758
|
+
formGroup: FormGroup;
|
|
1759
|
+
/**
|
|
1760
|
+
* For allowMulti sections: the FormArray registered on the root formGroup.
|
|
1761
|
+
* Each element is a FormGroup representing one repeater instance.
|
|
1762
|
+
*/
|
|
1763
|
+
repeaterFormArray: FormArray;
|
|
1764
|
+
/**
|
|
1765
|
+
* The key under which the FormArray is registered in the root formGroup.
|
|
1766
|
+
* Falls back to config.name or a generated key.
|
|
1767
|
+
*/
|
|
1768
|
+
get arrayKey(): string;
|
|
1769
|
+
constructor(fb: FormBuilder);
|
|
1770
|
+
ngOnInit(): void;
|
|
1771
|
+
ngOnDestroy(): void;
|
|
1772
|
+
/** Creates a fresh FormGroup for one repeater instance */
|
|
1773
|
+
private createInstanceGroup;
|
|
1774
|
+
addInstance(): void;
|
|
1775
|
+
removeInstance(index: number): void;
|
|
1776
|
+
getInstanceGroup(index: number): FormGroup;
|
|
1777
|
+
get instanceGroups(): FormGroup[];
|
|
1778
|
+
/** For non-allowMulti sections we simply pass the root formGroup down */
|
|
1779
|
+
get flatFormGroup(): FormGroup;
|
|
1780
|
+
/** Flatten a field tree to get all leaf fields (for ROW children etc.) */
|
|
1781
|
+
getFlatFields(fields: FieldConfig[]): FieldConfig[];
|
|
1669
1782
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormSectionComponent, never>;
|
|
1670
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormSectionComponent, "lib-form-section", never, { "config": { "alias": "config"; "required": false; }; "controller": { "alias": "controller"; "required": false; }; }, {}, never, never, false, never>;
|
|
1783
|
+
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>;
|
|
1671
1784
|
}
|
|
1672
1785
|
|
|
1673
1786
|
declare class FormFieldComponent implements OnInit, OnDestroy {
|
|
1787
|
+
private fb;
|
|
1674
1788
|
private expressionService;
|
|
1675
1789
|
private http;
|
|
1676
1790
|
config: FieldConfig;
|
|
1677
1791
|
controller: SmartFormController;
|
|
1678
|
-
|
|
1792
|
+
/**
|
|
1793
|
+
* The FormGroup that THIS field's control should be registered in.
|
|
1794
|
+
* For repeater instances this is the instance's own isolated FormGroup.
|
|
1795
|
+
* For flat (non-repeater) fields this is the root formGroup.
|
|
1796
|
+
*/
|
|
1797
|
+
formGroup: FormGroup;
|
|
1798
|
+
/**
|
|
1799
|
+
* Set to TRUE when this field is part of a repeatable group (config.sectionConfig.allowMulti = true).
|
|
1800
|
+
* When true, the field does NOT sync with the global controller to prevent data collision
|
|
1801
|
+
* between different instances of the same repeater row.
|
|
1802
|
+
*/
|
|
1803
|
+
allowMulti: boolean;
|
|
1679
1804
|
value: any;
|
|
1680
1805
|
isVisible: boolean;
|
|
1681
|
-
|
|
1806
|
+
showPassword: boolean;
|
|
1807
|
+
isDragOver: boolean;
|
|
1808
|
+
fileUploadError: string;
|
|
1682
1809
|
private destroy$;
|
|
1683
|
-
|
|
1810
|
+
/** For GROUP fields with allowMulti = true */
|
|
1811
|
+
groupFormArray: FormArray;
|
|
1812
|
+
/** For GROUP fields with allowMulti = false — single nested FormGroup */
|
|
1813
|
+
groupFormGroup: FormGroup;
|
|
1814
|
+
/**
|
|
1815
|
+
* Tracked list of repeater instances.
|
|
1816
|
+
* Using a separate array (not FormArray.controls) + trackBy(id) ensures
|
|
1817
|
+
* Angular creates FRESH child components for every new row, preventing
|
|
1818
|
+
* cached values from bleeding into new instances.
|
|
1819
|
+
*/
|
|
1820
|
+
instanceList: Array<{
|
|
1821
|
+
id: number;
|
|
1822
|
+
fg: FormGroup;
|
|
1823
|
+
}>;
|
|
1824
|
+
private _nextInstanceId;
|
|
1825
|
+
/**
|
|
1826
|
+
* Key used to register the GROUP control on the parent formGroup.
|
|
1827
|
+
* Priority: sectionConfig.name > field.name > camelCase(label) > '__group__'
|
|
1828
|
+
*/
|
|
1829
|
+
get groupKey(): string;
|
|
1830
|
+
constructor(fb: FormBuilder, expressionService: ExpressionService, http: HttpClient);
|
|
1684
1831
|
ngOnInit(): void;
|
|
1832
|
+
private initGroupField;
|
|
1833
|
+
/**
|
|
1834
|
+
* Sets up cross-field validation based on the `onValidate` formula.
|
|
1835
|
+
* Watches all variables mentioned in the formula and updates the field's
|
|
1836
|
+
* validity whenever any of them change.
|
|
1837
|
+
*/
|
|
1838
|
+
private setupFormulaValidation;
|
|
1839
|
+
addGroupInstance(): void;
|
|
1840
|
+
removeGroupInstance(index: number): void;
|
|
1841
|
+
trackByInstanceId(_: number, item: {
|
|
1842
|
+
id: number;
|
|
1843
|
+
fg: FormGroup;
|
|
1844
|
+
}): number;
|
|
1685
1845
|
ngOnDestroy(): void;
|
|
1686
|
-
|
|
1846
|
+
registerControl(): void;
|
|
1847
|
+
getValidators(): ValidatorFn[];
|
|
1848
|
+
/**
|
|
1849
|
+
* When `textConfig.matchField` is configured, subscribes to value changes on
|
|
1850
|
+
* BOTH this control and the referenced control so the mismatch error updates
|
|
1851
|
+
* instantly whichever field the user edits last.
|
|
1852
|
+
*
|
|
1853
|
+
* - Values differ → sets `{ passwordMismatch: true }` on THIS control.
|
|
1854
|
+
* - Values match → clears `passwordMismatch` from THIS control.
|
|
1855
|
+
*/
|
|
1856
|
+
setupMatchValidation(): void;
|
|
1687
1857
|
setupVisibility(): void;
|
|
1688
1858
|
setupGeneratedField(): void;
|
|
1689
1859
|
evaluateFormula(context: {
|
|
@@ -1695,34 +1865,52 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
|
|
|
1695
1865
|
[key: string]: any;
|
|
1696
1866
|
}): void;
|
|
1697
1867
|
private getValueByPath;
|
|
1698
|
-
|
|
1868
|
+
/** Builds HttpHeaders using the token stored in the SmartFormController (sourced from configJSON). */
|
|
1869
|
+
private getHeaders;
|
|
1870
|
+
updateValue(newValue: any): void;
|
|
1699
1871
|
onCheckboxListChange(code: string, checked: boolean): void;
|
|
1700
1872
|
isChecked(code: string): boolean;
|
|
1701
|
-
|
|
1702
|
-
getFieldName(): string;
|
|
1873
|
+
get errorMessage(): string;
|
|
1703
1874
|
get isTextField(): boolean;
|
|
1704
1875
|
get isNumberField(): boolean;
|
|
1705
1876
|
get isDateField(): boolean;
|
|
1706
1877
|
get isDropdown(): boolean;
|
|
1878
|
+
get isFileUpload(): boolean;
|
|
1707
1879
|
get isRadio(): boolean;
|
|
1708
1880
|
get isCheckbox(): boolean;
|
|
1709
1881
|
get isChip(): boolean;
|
|
1710
1882
|
get isSwitch(): boolean;
|
|
1711
1883
|
get isRating(): boolean;
|
|
1884
|
+
get isGenerated(): boolean;
|
|
1885
|
+
get isRow(): boolean;
|
|
1886
|
+
get isGroup(): boolean;
|
|
1887
|
+
/**
|
|
1888
|
+
* Returns the effective grid column span for a child inside a ROW.
|
|
1889
|
+
* If the child declares an explicit colSpan, use it.
|
|
1890
|
+
* Otherwise divide 12 equally among all children (floor, min 1).
|
|
1891
|
+
*/
|
|
1892
|
+
getChildColSpan(child: FieldConfig): number;
|
|
1712
1893
|
onRatingChange(star: number, event?: MouseEvent): void;
|
|
1713
1894
|
getStarArray(): number[];
|
|
1714
1895
|
isStarHalf(star: number): boolean;
|
|
1715
1896
|
isStarFilled(star: number): boolean;
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1897
|
+
onDragOver(event: DragEvent): void;
|
|
1898
|
+
onDragLeave(event: DragEvent): void;
|
|
1899
|
+
onFileDrop(event: DragEvent): void;
|
|
1900
|
+
onFileSelected(event: Event): void;
|
|
1901
|
+
private processFiles;
|
|
1902
|
+
removeUploadedFile(index: number): void;
|
|
1903
|
+
getFileIcon(mimeType: string): string;
|
|
1904
|
+
formatFileSize(bytes: number): string;
|
|
1905
|
+
get addLabel(): string;
|
|
1906
|
+
get removeLabel(): string;
|
|
1719
1907
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldComponent, never>;
|
|
1720
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldComponent, "lib-form-field", never, { "config": { "alias": "config"; "required": false; }; "controller": { "alias": "controller"; "required": false; }; "
|
|
1908
|
+
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>;
|
|
1721
1909
|
}
|
|
1722
1910
|
|
|
1723
1911
|
declare class SmartFormModule {
|
|
1724
1912
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartFormModule, never>;
|
|
1725
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SmartFormModule, [typeof SmartFormComponent, typeof FormSectionComponent, typeof FormFieldComponent], [typeof i2$1.CommonModule, typeof i3$1.ReactiveFormsModule, typeof i3$1.FormsModule], [typeof SmartFormComponent]>;
|
|
1913
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SmartFormModule, [typeof SmartFormComponent, typeof FormSectionComponent, typeof FormFieldComponent], [typeof i2$1.CommonModule, typeof i3$1.ReactiveFormsModule, typeof i3$1.FormsModule, typeof MaterialModule, typeof ButtonModule], [typeof SmartFormComponent]>;
|
|
1726
1914
|
static ɵinj: i0.ɵɵInjectorDeclaration<SmartFormModule>;
|
|
1727
1915
|
}
|
|
1728
1916
|
|
|
@@ -1747,6 +1935,33 @@ declare const setSessionStorageItem: (key: string, value: string) => void;
|
|
|
1747
1935
|
declare const removeSessionStorageItem: (key: string) => void;
|
|
1748
1936
|
declare const clearSessionStorage: () => void;
|
|
1749
1937
|
|
|
1938
|
+
/**
|
|
1939
|
+
* Utility functions for string manipulation
|
|
1940
|
+
*/
|
|
1941
|
+
declare class StringUtils {
|
|
1942
|
+
/**
|
|
1943
|
+
* Converts a string to camelCase.
|
|
1944
|
+
* Example: "First Name" -> "firstName", "Profile Picture" -> "profilePicture"
|
|
1945
|
+
*/
|
|
1946
|
+
static toCamelCase(str?: string): string;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
/**
|
|
1950
|
+
* Recursively translates the Configuration object using the provided labels map.
|
|
1951
|
+
* This function processes:
|
|
1952
|
+
* - Section Titles
|
|
1953
|
+
* - Field Labels
|
|
1954
|
+
* - Placeholders
|
|
1955
|
+
* - Help Texts
|
|
1956
|
+
* - Option Labels (for static options)
|
|
1957
|
+
* - Repeater Labels (addLabel, repeaterItemLabel)
|
|
1958
|
+
*
|
|
1959
|
+
* @param config The FormConfig object to translate
|
|
1960
|
+
* @param labelsMap A map of key-value pairs for translation (Flattened JSON)
|
|
1961
|
+
* @returns A new FormConfig object with translated strings
|
|
1962
|
+
*/
|
|
1963
|
+
declare function translateConfig(config: any, labelsMap: any): any;
|
|
1964
|
+
|
|
1750
1965
|
/**
|
|
1751
1966
|
* Example: Basic Form Configuration
|
|
1752
1967
|
* This is a generic example for testing and demonstration purposes.
|
|
@@ -1901,9 +2116,20 @@ interface TableFilter {
|
|
|
1901
2116
|
requestKey?: string;
|
|
1902
2117
|
dataPath?: string;
|
|
1903
2118
|
}
|
|
2119
|
+
interface TableActionItem {
|
|
2120
|
+
label: string;
|
|
2121
|
+
type: 'api' | 'callback' | 'route';
|
|
2122
|
+
icon?: string;
|
|
2123
|
+
apiUrl?: string;
|
|
2124
|
+
apiMethod?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
2125
|
+
route?: string;
|
|
2126
|
+
confirmationNeeded?: boolean;
|
|
2127
|
+
confirmationMessage?: string;
|
|
2128
|
+
callback?: (row: any) => void;
|
|
2129
|
+
}
|
|
1904
2130
|
interface TableAction {
|
|
1905
2131
|
label: string;
|
|
1906
|
-
type: 'api' | 'callback' | 'route' | 'edit';
|
|
2132
|
+
type: 'api' | 'callback' | 'route' | 'edit' | 'dropdown';
|
|
1907
2133
|
icon?: string;
|
|
1908
2134
|
btnVariant?: 'primary' | 'secondary' | 'outline' | 'danger' | 'warning' | 'success' | 'danger-outline';
|
|
1909
2135
|
apiUrl?: string;
|
|
@@ -1912,6 +2138,7 @@ interface TableAction {
|
|
|
1912
2138
|
confirmationNeeded?: boolean;
|
|
1913
2139
|
confirmationMessage?: string;
|
|
1914
2140
|
callback?: (row: any) => void;
|
|
2141
|
+
items?: TableActionItem[];
|
|
1915
2142
|
}
|
|
1916
2143
|
interface PaginationConfig {
|
|
1917
2144
|
enabled: boolean;
|
|
@@ -2037,7 +2264,9 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
|
|
|
2037
2264
|
onSearch(event: Event): void;
|
|
2038
2265
|
onFilterChange(key: string, event: Event): void;
|
|
2039
2266
|
onAction(action: TableAction, row: any): void;
|
|
2267
|
+
onActionItemClick(item: any, row: any, event: Event): void;
|
|
2040
2268
|
onTopAction(action: TableAction): void;
|
|
2269
|
+
private executeApiAction;
|
|
2041
2270
|
onSelectAll(event: Event): void;
|
|
2042
2271
|
onRowSelect(row: any): void;
|
|
2043
2272
|
updateSelectedRows(): void;
|
|
@@ -2058,7 +2287,7 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
|
|
|
2058
2287
|
|
|
2059
2288
|
declare class SmartTableModule {
|
|
2060
2289
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartTableModule, never>;
|
|
2061
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SmartTableModule, [typeof SmartTableComponent], [typeof i2$1.CommonModule, typeof i3$1.FormsModule, typeof PaginationModule, typeof ButtonModule], [typeof SmartTableComponent]>;
|
|
2290
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SmartTableModule, [typeof SmartTableComponent], [typeof i2$1.CommonModule, typeof i3$1.FormsModule, typeof PaginationModule, typeof ButtonModule, typeof i16.MatMenuModule, typeof i12.MatIconModule], [typeof SmartTableComponent]>;
|
|
2062
2291
|
static ɵinj: i0.ɵɵInjectorDeclaration<SmartTableModule>;
|
|
2063
2292
|
}
|
|
2064
2293
|
|
|
@@ -2079,6 +2308,11 @@ declare const SAMPLE_FORMS: {
|
|
|
2079
2308
|
registrationForm: string;
|
|
2080
2309
|
surveyForm: string;
|
|
2081
2310
|
jobApplicationForm: string;
|
|
2311
|
+
donorForm: string;
|
|
2312
|
+
userBasicDetailsForm: string;
|
|
2313
|
+
documentUploadForm: string;
|
|
2314
|
+
demandDefinitionForm: string;
|
|
2315
|
+
projectInfoForm: string;
|
|
2082
2316
|
};
|
|
2083
2317
|
|
|
2084
2318
|
declare const smartForm_examples_d_SAMPLE_FORMS: typeof SAMPLE_FORMS;
|
|
@@ -2088,5 +2322,5 @@ declare namespace smartForm_examples_d {
|
|
|
2088
2322
|
};
|
|
2089
2323
|
}
|
|
2090
2324
|
|
|
2091
|
-
export { AlertComponent, AlertModule, ButtonComponent, ButtonModule, CheckboxComponent, ConfigurableFormComponent, configurableForm_examples_d as ConfigurableFormExamples, ConfigurableFormModule, ConfirmationModalComponent, ConfirmationModalModule, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE_OPTIONS, DatepickerComponent, DropdownComponent, ExpressionService, FilterComponent, FilterModule, FilterSidebarComponent, FilterSidebarModule, FormComponentsModule, InputComponent, MaterialModule, NAV_ORIENTATION_DEFAULT, NAV_VARIANT_DEFAULT, NavComponent, NavModule, PAGINATION_THEME_DARK, PAGINATION_THEME_DEFAULT, PaginationComponent, PaginationModule, RadioComponent, SearchComponent, SharedUiModule, SmartFormComponent, SmartFormController, smartForm_examples_d as SmartFormExamples, SmartFormModule, SmartTableComponent, SmartTableModule, SummaryCardComponent, SummaryCardModule, ToggleComponent, ValidationUtils, clearLocalStorage, clearSessionStorage, getLocalStorageItem, getSessionStorageItem, removeLocalStorageItem, removeSessionStorageItem, setLocalStorageItem, setSessionStorageItem };
|
|
2092
|
-
export type { AlertLabels, AlertVariant, AttachmentConfig, ButtonLabels, ButtonVariant, CheckboxConfig, CheckboxLabels, CheckboxOption, ConfirmationModalConfig, DateConfig, DatePickerConfig, DatepickerLabels, 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$1 as OptionConfig, OptionDTO, OptionItem, PaginationConfig, PaginationLabels, PhoneConfig, QueryParamsConfig, RadioConfig, RadioLabels, RadioOption, RangeConfig, RatingConfig, SearchConfig, SearchLabels, SectionConfig, StepperConfig, SubmitConfig, SummaryCardConfig, SummaryCardMeta, TableAction, TableColumn, TableConfig, TableFilter, TableFilterChangeEvent, TableFilterColumn, TableFilterConfig, TableFilterItem, TableFilterLabels, TableFilterOutput, TableLabels, TableOption, TableTheme, TextConfig, ToggleConfig, ToggleLabels, UIConfig, UISubType, UIType, UploadedFile, ValidationResult, ValidationRules };
|
|
2325
|
+
export { AlertComponent, AlertModule, ButtonComponent, ButtonModule, CheckboxComponent, ConfigurableFormComponent, configurableForm_examples_d as ConfigurableFormExamples, ConfigurableFormModule, ConfirmationModalComponent, ConfirmationModalModule, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE_OPTIONS, DatepickerComponent, DropdownComponent, ExpressionService, FilterComponent, FilterModule, FilterSidebarComponent, FilterSidebarModule, FormComponentsModule, InputComponent, MaterialModule, NAV_ORIENTATION_DEFAULT, NAV_VARIANT_DEFAULT, NavComponent, NavModule, PAGINATION_THEME_DARK, PAGINATION_THEME_DEFAULT, PaginationComponent, PaginationModule, RadioComponent, SearchComponent, SharedUiModule, SmartFormComponent, SmartFormController, smartForm_examples_d as SmartFormExamples, SmartFormModule, SmartTableComponent, SmartTableModule, StringUtils, SummaryCardComponent, SummaryCardModule, ToggleComponent, ValidationUtils, clearLocalStorage, clearSessionStorage, getLocalStorageItem, getSessionStorageItem, removeLocalStorageItem, removeSessionStorageItem, setLocalStorageItem, setSessionStorageItem, translateConfig };
|
|
2326
|
+
export type { AlertLabels, AlertVariant, AttachmentConfig, ButtonLabels, ButtonVariant, CheckboxConfig, CheckboxLabels, CheckboxOption, ConfirmationModalConfig, DateConfig, DatePickerConfig, DatepickerLabels, 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$1 as OptionConfig, OptionDTO, OptionItem, PaginationConfig, PaginationLabels, PhoneConfig, QueryParamsConfig, RadioConfig, RadioLabels, RadioOption, RangeConfig, RatingConfig, SearchConfig, SearchLabels, SectionConfig, 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 };
|