commons-shared-web-ui 0.0.72 → 0.0.74
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 +395 -48
- package/fesm2022/commons-shared-web-ui.mjs.map +1 -1
- package/index.d.ts +167 -18
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ import * as i29 from '@angular/cdk/accordion';
|
|
|
45
45
|
import * as i11$2 from 'ngx-quill';
|
|
46
46
|
import * as i11$1 from '@angular/cdk/scrolling';
|
|
47
47
|
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
48
|
+
import * as i5$1 from '@angular/cdk/drag-drop';
|
|
49
|
+
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
48
50
|
|
|
49
51
|
type ButtonVariant = 'primary' | 'warning' | 'outline' | 'secondary' | 'success' | 'danger' | 'danger-outline' | 'text';
|
|
50
52
|
interface ButtonLabels {
|
|
@@ -517,6 +519,13 @@ interface OptionConfig$1 {
|
|
|
517
519
|
showSelectAll?: boolean;
|
|
518
520
|
/** When true, displays a loading spinner during options API requests. */
|
|
519
521
|
showLoader?: boolean;
|
|
522
|
+
/**
|
|
523
|
+
* When true, a plain `optionList`-only SINGLE DROPDOWN (no `searchConfig`/`pagination`) renders
|
|
524
|
+
* the same styled overlay/chevron panel used by searchable and paginated dropdowns, instead of
|
|
525
|
+
* a native `<select>` — purely for visual consistency with sibling fields. No search box or
|
|
526
|
+
* pagination is added.
|
|
527
|
+
*/
|
|
528
|
+
customUI?: boolean;
|
|
520
529
|
}
|
|
521
530
|
interface AutocompleteDisplayField {
|
|
522
531
|
/** Dot-notation path to the value in the API response item (e.g. 'login', 'contact.phone'). */
|
|
@@ -1650,10 +1659,27 @@ declare class FormFieldComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1650
1659
|
* object is reused across multiple allowMulti repeater instances.
|
|
1651
1660
|
*/
|
|
1652
1661
|
localOptionList: any[];
|
|
1662
|
+
/** Snapshot of default (unsearched) options and pagination state for DROPDOWN / AUTOCOMPLETE fields */
|
|
1663
|
+
private defaultStateSnapshot;
|
|
1664
|
+
/** Tracks whether the current localOptionList is filtered by an active server-side search query */
|
|
1665
|
+
private _isServerSearchActive;
|
|
1653
1666
|
/** Dedicated cache of currently selected option objects */
|
|
1654
1667
|
selectedItems: any[];
|
|
1655
1668
|
/** Cache of the latest dependency parameters for server-side autocomplete filtering */
|
|
1656
1669
|
private _latestDependencyValues;
|
|
1670
|
+
/** True when this field has no optionConfig.dependencies (nothing to satisfy) OR every
|
|
1671
|
+
* dependency's current value is present — false while waiting on a parent field. Guards every
|
|
1672
|
+
* opportunistic reload path (dropdown-open, search-reset, search-clear) so a dependent
|
|
1673
|
+
* dropdown never re-fetches an unfiltered full list just because it was opened/searched before
|
|
1674
|
+
* its parent was chosen — only setupDependencies()'s own reactive load (which always supplies
|
|
1675
|
+
* the real dependency params) is allowed to populate it.
|
|
1676
|
+
* Defaults to true here (fields with no dependencies never get corrected otherwise), but
|
|
1677
|
+
* ngOnInit flips it to false up front for any field that DOES declare dependencies — closing
|
|
1678
|
+
* the window between component creation and setupDependencies()'s first (necessarily async,
|
|
1679
|
+
* via combineLatest) emission, during which a fast dropdown-open would otherwise still see
|
|
1680
|
+
* this stale `true` default and fire an unfiltered fetch before the parent-unmet state is
|
|
1681
|
+
* known. */
|
|
1682
|
+
private _dependenciesSatisfied;
|
|
1657
1683
|
/** For GROUP fields with allowMulti = true */
|
|
1658
1684
|
groupFormArray: FormArray;
|
|
1659
1685
|
/** For GROUP fields with allowMulti = false — single nested FormGroup */
|
|
@@ -1716,7 +1742,9 @@ declare class FormFieldComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1716
1742
|
isSingleOptionSelected(code: any): boolean;
|
|
1717
1743
|
/** Whether the dropdown search feature is enabled for this field */
|
|
1718
1744
|
get isSearchableDropdown(): boolean;
|
|
1719
|
-
/** Whether the custom single-select dropdown overlay is required
|
|
1745
|
+
/** Whether the custom single-select dropdown overlay is required — for search, pagination, or
|
|
1746
|
+
* when optionConfig.customUI opts in to the styled overlay purely for visual consistency with
|
|
1747
|
+
* sibling dropdowns (no search box, no pagination — just the same panel/chevron treatment). */
|
|
1720
1748
|
get isCustomSingleDropdown(): boolean;
|
|
1721
1749
|
private initGroupField;
|
|
1722
1750
|
/**
|
|
@@ -1888,6 +1916,8 @@ declare class FormFieldComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1888
1916
|
private initDropdownSearch;
|
|
1889
1917
|
/** Execute client-side or server-side dropdown search. */
|
|
1890
1918
|
private executeDropdownSearch;
|
|
1919
|
+
/** Restores localOptionList and pagination metadata from defaultStateSnapshot, preserving selected item(s) */
|
|
1920
|
+
private restoreDefaultOptionList;
|
|
1891
1921
|
/** Resets the dropdown search text and filtered list. */
|
|
1892
1922
|
resetDropdownSearch(forceLoad?: boolean, bypassCache?: boolean): void;
|
|
1893
1923
|
/** Merges option(s) from selectedOptionsData into the local dropdown options list */
|
|
@@ -2660,6 +2690,9 @@ interface DropdownConfig {
|
|
|
2660
2690
|
disabled?: boolean;
|
|
2661
2691
|
required?: boolean;
|
|
2662
2692
|
errorMessage?: string;
|
|
2693
|
+
serverSearch?: boolean;
|
|
2694
|
+
searchDebounceMs?: number;
|
|
2695
|
+
lazyLoad?: boolean;
|
|
2663
2696
|
width?: string;
|
|
2664
2697
|
height?: string;
|
|
2665
2698
|
borderRadius?: string;
|
|
@@ -2683,7 +2716,7 @@ interface DropdownConfig {
|
|
|
2683
2716
|
boxShadow?: string;
|
|
2684
2717
|
}
|
|
2685
2718
|
|
|
2686
|
-
declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChanges {
|
|
2719
|
+
declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChanges, OnDestroy {
|
|
2687
2720
|
private el;
|
|
2688
2721
|
config?: DropdownConfig;
|
|
2689
2722
|
labels?: DropdownLabels;
|
|
@@ -2697,6 +2730,12 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
|
|
|
2697
2730
|
disabled: boolean;
|
|
2698
2731
|
required: boolean;
|
|
2699
2732
|
errorMessage: string;
|
|
2733
|
+
serverSearch: boolean;
|
|
2734
|
+
searchDebounceMs: number;
|
|
2735
|
+
lazyLoad: boolean;
|
|
2736
|
+
loading: boolean;
|
|
2737
|
+
loadingMore: boolean;
|
|
2738
|
+
hasMore: boolean;
|
|
2700
2739
|
width?: string;
|
|
2701
2740
|
height?: string;
|
|
2702
2741
|
borderRadius?: string;
|
|
@@ -2719,6 +2758,8 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
|
|
|
2719
2758
|
disabledColor?: string;
|
|
2720
2759
|
boxShadow?: string;
|
|
2721
2760
|
selectionChange: EventEmitter<any>;
|
|
2761
|
+
searchTermChange: EventEmitter<string>;
|
|
2762
|
+
loadMore: EventEmitter<void>;
|
|
2722
2763
|
viewport?: CdkVirtualScrollViewport;
|
|
2723
2764
|
searchInput?: ElementRef;
|
|
2724
2765
|
triggerEl?: ElementRef;
|
|
@@ -2734,8 +2775,10 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
|
|
|
2734
2775
|
};
|
|
2735
2776
|
onChange: (value: any) => void;
|
|
2736
2777
|
onTouched: () => void;
|
|
2778
|
+
private search$;
|
|
2737
2779
|
constructor(el: ElementRef);
|
|
2738
2780
|
ngOnInit(): void;
|
|
2781
|
+
ngOnDestroy(): void;
|
|
2739
2782
|
ngOnChanges(changes: SimpleChanges): void;
|
|
2740
2783
|
private get validOptions();
|
|
2741
2784
|
private updateFromConfig;
|
|
@@ -2756,6 +2799,7 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
|
|
|
2756
2799
|
selectOption(option: DropdownOption): void;
|
|
2757
2800
|
isSelected(option: DropdownOption): boolean;
|
|
2758
2801
|
onSearch(term: string): void;
|
|
2802
|
+
onOptionsScroll(event: Event): void;
|
|
2759
2803
|
clearSelection(event?: Event): void;
|
|
2760
2804
|
getIconType(icon: any): 'material' | 'fontawesome' | 'img' | 'none';
|
|
2761
2805
|
getIconValue(icon: any): string;
|
|
@@ -2774,7 +2818,7 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
|
|
|
2774
2818
|
[key: string]: string | undefined;
|
|
2775
2819
|
};
|
|
2776
2820
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownComponent, never>;
|
|
2777
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownComponent, "lib-dropdown", never, { "config": { "alias": "config"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "options": { "alias": "options"; "required": false; }; "selectedValue": { "alias": "selectedValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "label": { "alias": "label"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "searchable": { "alias": "searchable"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "borderRadius": { "alias": "borderRadius"; "required": false; }; "fontSize": { "alias": "fontSize"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; "fontFamily": { "alias": "fontFamily"; "required": false; }; "labelColor": { "alias": "labelColor"; "required": false; }; "labelFontSize": { "alias": "labelFontSize"; "required": false; }; "labelFontWeight": { "alias": "labelFontWeight"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; }; "borderColor": { "alias": "borderColor"; "required": false; }; "borderWidth": { "alias": "borderWidth"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "fontWeight": { "alias": "fontWeight"; "required": false; }; "color": { "alias": "color"; "required": false; }; "placeholderColor": { "alias": "placeholderColor"; "required": false; }; "focusBorderColor": { "alias": "focusBorderColor"; "required": false; }; "errorColor": { "alias": "errorColor"; "required": false; }; "disabledBackgroundColor": { "alias": "disabledBackgroundColor"; "required": false; }; "disabledColor": { "alias": "disabledColor"; "required": false; }; "boxShadow": { "alias": "boxShadow"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, never, false, never>;
|
|
2821
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownComponent, "lib-dropdown", never, { "config": { "alias": "config"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "options": { "alias": "options"; "required": false; }; "selectedValue": { "alias": "selectedValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "label": { "alias": "label"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "searchable": { "alias": "searchable"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "serverSearch": { "alias": "serverSearch"; "required": false; }; "searchDebounceMs": { "alias": "searchDebounceMs"; "required": false; }; "lazyLoad": { "alias": "lazyLoad"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingMore": { "alias": "loadingMore"; "required": false; }; "hasMore": { "alias": "hasMore"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "borderRadius": { "alias": "borderRadius"; "required": false; }; "fontSize": { "alias": "fontSize"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; "fontFamily": { "alias": "fontFamily"; "required": false; }; "labelColor": { "alias": "labelColor"; "required": false; }; "labelFontSize": { "alias": "labelFontSize"; "required": false; }; "labelFontWeight": { "alias": "labelFontWeight"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; }; "borderColor": { "alias": "borderColor"; "required": false; }; "borderWidth": { "alias": "borderWidth"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "fontWeight": { "alias": "fontWeight"; "required": false; }; "color": { "alias": "color"; "required": false; }; "placeholderColor": { "alias": "placeholderColor"; "required": false; }; "focusBorderColor": { "alias": "focusBorderColor"; "required": false; }; "errorColor": { "alias": "errorColor"; "required": false; }; "disabledBackgroundColor": { "alias": "disabledBackgroundColor"; "required": false; }; "disabledColor": { "alias": "disabledColor"; "required": false; }; "boxShadow": { "alias": "boxShadow"; "required": false; }; }, { "selectionChange": "selectionChange"; "searchTermChange": "searchTermChange"; "loadMore": "loadMore"; }, never, never, false, never>;
|
|
2778
2822
|
}
|
|
2779
2823
|
|
|
2780
2824
|
interface CheckboxOption {
|
|
@@ -3306,6 +3350,8 @@ interface ConfigFieldNode {
|
|
|
3306
3350
|
visible: boolean;
|
|
3307
3351
|
/** Whether the field is mandatory (required). Only meaningful when `visible` is true. */
|
|
3308
3352
|
mandatory: boolean;
|
|
3353
|
+
/** Column span in the section's 12-column grid (1-12). Freely editable. */
|
|
3354
|
+
colSpan: number;
|
|
3309
3355
|
/** When true, the visibility toggle is locked ON (cannot be hidden). */
|
|
3310
3356
|
lockVisibility: boolean;
|
|
3311
3357
|
/** When true, the mandatory control is locked (cannot be changed). */
|
|
@@ -3345,6 +3391,21 @@ interface ConfigSectionNode {
|
|
|
3345
3391
|
fields: ConfigFieldNode[];
|
|
3346
3392
|
/** Recursively nested child sections. */
|
|
3347
3393
|
subsections: ConfigSectionNode[];
|
|
3394
|
+
/**
|
|
3395
|
+
* Live reference to the schema array `fields` was parsed from (e.g. a section's
|
|
3396
|
+
* `sectionConfig.children`, or the top-level `sectionConfig.children` for a
|
|
3397
|
+
* synthetic bundle). Reordering writes directly into this array so the schema's
|
|
3398
|
+
* own field order — not a separate `sequence` property — drives render order.
|
|
3399
|
+
* Null when there is nothing to reorder into (e.g. an empty section).
|
|
3400
|
+
*/
|
|
3401
|
+
fieldsSource: FieldConfig[] | null;
|
|
3402
|
+
/**
|
|
3403
|
+
* False when this section's own children include a `ROW` wrapper. Reordering is
|
|
3404
|
+
* disabled in that case — flattening a ROW's grouped children into plain
|
|
3405
|
+
* siblings would silently break the row layout, so dragging is turned off
|
|
3406
|
+
* instead of risking a corrupted schema.
|
|
3407
|
+
*/
|
|
3408
|
+
reorderable: boolean;
|
|
3348
3409
|
}
|
|
3349
3410
|
|
|
3350
3411
|
/**
|
|
@@ -3377,6 +3438,16 @@ declare class FieldConfigurationService {
|
|
|
3377
3438
|
toggleFieldVisible(path: number[], fieldIndex: number): void;
|
|
3378
3439
|
/** Toggle a field's mandatory flag. Ignored when locked or hidden. */
|
|
3379
3440
|
toggleFieldMandatory(path: number[], fieldIndex: number): void;
|
|
3441
|
+
/** Set a field's column span, clamped to the 1-12 grid range. */
|
|
3442
|
+
setFieldColSpan(path: number[], fieldIndex: number, colSpan: number): void;
|
|
3443
|
+
/**
|
|
3444
|
+
* Reorder a field within its own section (drag-and-drop). Reordering is scoped to
|
|
3445
|
+
* one section's direct fields — dragging never moves a field across sections.
|
|
3446
|
+
* Rejected (no-op) if the move would place a field above the field it depends on
|
|
3447
|
+
* via `optionConfig.dependencies` (e.g. a "state" field can never sort above the
|
|
3448
|
+
* "country" field it depends on).
|
|
3449
|
+
*/
|
|
3450
|
+
reorderField(path: number[], previousIndex: number, currentIndex: number): void;
|
|
3380
3451
|
/**
|
|
3381
3452
|
* Produce the updated schema. Writes the current tree state onto the working
|
|
3382
3453
|
* clone and returns a fresh deep clone (safe to hand to the host / submit).
|
|
@@ -3398,6 +3469,12 @@ declare class FieldConfigurationService {
|
|
|
3398
3469
|
* derived `visibilityLockedByParent` flag set (drives the disabled toggle in the UI).
|
|
3399
3470
|
*/
|
|
3400
3471
|
private _applyDependencyRules;
|
|
3472
|
+
/**
|
|
3473
|
+
* True when every field with a dependency parent (`parentName`) sorts after that
|
|
3474
|
+
* parent within the given list. Fields whose parent isn't a sibling in this same
|
|
3475
|
+
* list (cross-section dependency, or no such field) are unconstrained here.
|
|
3476
|
+
*/
|
|
3477
|
+
private _isValidFieldOrder;
|
|
3401
3478
|
/** Recursively set visibility on a section and all its descendants (respecting locks). */
|
|
3402
3479
|
private _cascadeVisibility;
|
|
3403
3480
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldConfigurationService, never>;
|
|
@@ -3409,6 +3486,16 @@ interface FieldEventPayload {
|
|
|
3409
3486
|
sectionPath: number[];
|
|
3410
3487
|
fieldIndex: number;
|
|
3411
3488
|
}
|
|
3489
|
+
/** Payload for a field colSpan change, carrying the sub-path from this section down. */
|
|
3490
|
+
interface FieldColSpanPayload extends FieldEventPayload {
|
|
3491
|
+
colSpan: number;
|
|
3492
|
+
}
|
|
3493
|
+
/** Payload for a field drag-reorder, carrying the sub-path from this section down. */
|
|
3494
|
+
interface FieldReorderPayload {
|
|
3495
|
+
sectionPath: number[];
|
|
3496
|
+
previousIndex: number;
|
|
3497
|
+
currentIndex: number;
|
|
3498
|
+
}
|
|
3412
3499
|
/**
|
|
3413
3500
|
* A recursive section/group node in the form-field-configuration tree.
|
|
3414
3501
|
* Emits path-relative events that parents prefix with their own index before
|
|
@@ -3423,6 +3510,8 @@ declare class ConfigSectionNodeComponent {
|
|
|
3423
3510
|
toggleExpanded: EventEmitter<number[]>;
|
|
3424
3511
|
fieldToggleVisible: EventEmitter<FieldEventPayload>;
|
|
3425
3512
|
fieldToggleMandatory: EventEmitter<FieldEventPayload>;
|
|
3513
|
+
fieldColSpanChange: EventEmitter<FieldColSpanPayload>;
|
|
3514
|
+
fieldReorder: EventEmitter<FieldReorderPayload>;
|
|
3426
3515
|
get displayLabel(): string;
|
|
3427
3516
|
get visibleFieldCount(): number;
|
|
3428
3517
|
get hasToggle(): boolean;
|
|
@@ -3430,29 +3519,41 @@ declare class ConfigSectionNodeComponent {
|
|
|
3430
3519
|
onToggleExpanded(): void;
|
|
3431
3520
|
onFieldToggleVisible(fieldIndex: number): void;
|
|
3432
3521
|
onFieldToggleMandatory(fieldIndex: number): void;
|
|
3522
|
+
onFieldColSpanChange(fieldIndex: number, colSpan: number): void;
|
|
3523
|
+
onFieldDrop(event: CdkDragDrop<unknown>): void;
|
|
3433
3524
|
onSubToggleVisible(subIndex: number, subPath: number[]): void;
|
|
3434
3525
|
onSubToggleExpanded(subIndex: number, subPath: number[]): void;
|
|
3435
3526
|
onSubFieldToggleVisible(subIndex: number, payload: FieldEventPayload): void;
|
|
3436
3527
|
onSubFieldToggleMandatory(subIndex: number, payload: FieldEventPayload): void;
|
|
3528
|
+
onSubFieldColSpanChange(subIndex: number, payload: FieldColSpanPayload): void;
|
|
3529
|
+
onSubFieldReorder(subIndex: number, payload: FieldReorderPayload): void;
|
|
3437
3530
|
trackByIndex(index: number): number;
|
|
3438
3531
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfigSectionNodeComponent, never>;
|
|
3439
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ConfigSectionNodeComponent, "lib-config-section-node", never, { "section": { "alias": "section"; "required": true; }; "depth": { "alias": "depth"; "required": false; }; "translate": { "alias": "translate"; "required": false; }; }, { "toggleVisible": "toggleVisible"; "toggleExpanded": "toggleExpanded"; "fieldToggleVisible": "fieldToggleVisible"; "fieldToggleMandatory": "fieldToggleMandatory"; }, never, never, false, never>;
|
|
3532
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfigSectionNodeComponent, "lib-config-section-node", never, { "section": { "alias": "section"; "required": true; }; "depth": { "alias": "depth"; "required": false; }; "translate": { "alias": "translate"; "required": false; }; }, { "toggleVisible": "toggleVisible"; "toggleExpanded": "toggleExpanded"; "fieldToggleVisible": "fieldToggleVisible"; "fieldToggleMandatory": "fieldToggleMandatory"; "fieldColSpanChange": "fieldColSpanChange"; "fieldReorder": "fieldReorder"; }, never, never, false, never>;
|
|
3440
3533
|
}
|
|
3441
3534
|
|
|
3442
3535
|
/**
|
|
3443
3536
|
* Form Field Configuration
|
|
3444
3537
|
* ------------------------
|
|
3445
3538
|
* Renders a compact tree of a form schema's sections and fields, each with a
|
|
3446
|
-
* **visibility** toggle
|
|
3447
|
-
*
|
|
3539
|
+
* **visibility** toggle, a **mandatory** control, an editable **column span**,
|
|
3540
|
+
* and a drag handle to **reorder** fields within their own section. Intended to
|
|
3541
|
+
* be embedded inside a `cc-confirmation-modal` on a host page ("Configure fields").
|
|
3448
3542
|
*
|
|
3449
3543
|
* Pass a `FormSchema` via `[schema]`. The input is deep-cloned, so it is never
|
|
3450
3544
|
* mutated. When the user confirms, call `getUpdatedSchema()` to read back the
|
|
3451
|
-
* modified schema (visible/isEnabled/disabled and
|
|
3545
|
+
* modified schema (visible/isEnabled/disabled, required, and colSpan flags
|
|
3546
|
+
* updated, and each section's own children reordered to match the tree).
|
|
3452
3547
|
*
|
|
3453
3548
|
* Fields/sections carrying `lockVisibility: true` cannot be hidden, and
|
|
3454
3549
|
* `lockMandatory: true` freezes their required state.
|
|
3455
3550
|
*
|
|
3551
|
+
* Reordering is scoped to one section's direct fields — a field can never be
|
|
3552
|
+
* dragged into another section, and a field can never be dragged above a field
|
|
3553
|
+
* it depends on via `optionConfig.dependencies` (e.g. "state" can't sort above
|
|
3554
|
+
* "country"). Sections whose children include a `ROW` wrapper can't be
|
|
3555
|
+
* reordered at all (dragging is disabled) to avoid flattening the row layout.
|
|
3556
|
+
*
|
|
3456
3557
|
* @example
|
|
3457
3558
|
* ```html
|
|
3458
3559
|
* <cc-confirmation-modal [isOpen]="open" (confirm)="save()" (cancel)="open = false">
|
|
@@ -3482,6 +3583,8 @@ declare class FormFieldConfigurationComponent implements OnChanges {
|
|
|
3482
3583
|
onToggleExpanded(sectionIndex: number, subPath: number[]): void;
|
|
3483
3584
|
onFieldToggleVisible(sectionIndex: number, payload: FieldEventPayload): void;
|
|
3484
3585
|
onFieldToggleMandatory(sectionIndex: number, payload: FieldEventPayload): void;
|
|
3586
|
+
onFieldColSpanChange(sectionIndex: number, payload: FieldColSpanPayload): void;
|
|
3587
|
+
onFieldReorder(sectionIndex: number, payload: FieldReorderPayload): void;
|
|
3485
3588
|
trackByIndex(index: number): number;
|
|
3486
3589
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldConfigurationComponent, never>;
|
|
3487
3590
|
static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldConfigurationComponent, "lib-form-field-configuration", never, { "schema": { "alias": "schema"; "required": true; }; "translate": { "alias": "translate"; "required": false; }; "showLegend": { "alias": "showLegend"; "required": false; }; }, {}, never, never, false, never>;
|
|
@@ -3498,14 +3601,16 @@ declare class ConfigFieldNodeComponent {
|
|
|
3498
3601
|
translate?: (key: string) => string;
|
|
3499
3602
|
toggleVisible: EventEmitter<void>;
|
|
3500
3603
|
toggleMandatory: EventEmitter<void>;
|
|
3604
|
+
colSpanChange: EventEmitter<number>;
|
|
3501
3605
|
get displayLabel(): string;
|
|
3606
|
+
onColSpanInput(value: string): void;
|
|
3502
3607
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfigFieldNodeComponent, never>;
|
|
3503
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ConfigFieldNodeComponent, "lib-config-field-node", never, { "field": { "alias": "field"; "required": true; }; "translate": { "alias": "translate"; "required": false; }; }, { "toggleVisible": "toggleVisible"; "toggleMandatory": "toggleMandatory"; }, never, never, false, never>;
|
|
3608
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfigFieldNodeComponent, "lib-config-field-node", never, { "field": { "alias": "field"; "required": true; }; "translate": { "alias": "translate"; "required": false; }; }, { "toggleVisible": "toggleVisible"; "toggleMandatory": "toggleMandatory"; "colSpanChange": "colSpanChange"; }, never, never, false, never>;
|
|
3504
3609
|
}
|
|
3505
3610
|
|
|
3506
3611
|
declare class FormFieldConfigurationModule {
|
|
3507
3612
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldConfigurationModule, never>;
|
|
3508
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<FormFieldConfigurationModule, [typeof FormFieldConfigurationComponent, typeof ConfigSectionNodeComponent, typeof ConfigFieldNodeComponent], [typeof i2$1.CommonModule], [typeof FormFieldConfigurationComponent]>;
|
|
3613
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FormFieldConfigurationModule, [typeof FormFieldConfigurationComponent, typeof ConfigSectionNodeComponent, typeof ConfigFieldNodeComponent], [typeof i2$1.CommonModule, typeof i5$1.DragDropModule], [typeof FormFieldConfigurationComponent]>;
|
|
3509
3614
|
static ɵinj: i0.ɵɵInjectorDeclaration<FormFieldConfigurationModule>;
|
|
3510
3615
|
}
|
|
3511
3616
|
|
|
@@ -3517,6 +3622,11 @@ declare class FormFieldConfigurationModule {
|
|
|
3517
3622
|
* clone, so `applyTreeToSchema` simply walks the tree and assigns the node state
|
|
3518
3623
|
* onto those references — there is no positional re-matching, which keeps it robust
|
|
3519
3624
|
* against ROWs, nested groups, and mixed leaf/section children.
|
|
3625
|
+
*
|
|
3626
|
+
* Field order is a plain property of the schema — there is no separate `sequence`
|
|
3627
|
+
* field. Reordering rewrites the schema's own children array in place, so render
|
|
3628
|
+
* order (which simply follows array order, as it always has) reflects the
|
|
3629
|
+
* configurator's choices with no extra sorting logic anywhere else.
|
|
3520
3630
|
*/
|
|
3521
3631
|
declare class ConfigSchemaTreeService {
|
|
3522
3632
|
/**
|
|
@@ -3526,8 +3636,9 @@ declare class ConfigSchemaTreeService {
|
|
|
3526
3636
|
parseSchema(schema: FormSchema): ConfigSectionNode[];
|
|
3527
3637
|
/**
|
|
3528
3638
|
* Write the current tree state back onto the schema the nodes reference.
|
|
3529
|
-
* Sets isEnabled/visible/disabled for visibility
|
|
3530
|
-
*
|
|
3639
|
+
* Sets isEnabled/visible/disabled for visibility, required for mandatory, and
|
|
3640
|
+
* colSpan; and physically reorders each section's own children array to match
|
|
3641
|
+
* the tree's current field order.
|
|
3531
3642
|
*/
|
|
3532
3643
|
applyTreeToSchema(sections: ConfigSectionNode[]): void;
|
|
3533
3644
|
private _buildSections;
|
|
@@ -3536,6 +3647,13 @@ declare class ConfigSchemaTreeService {
|
|
|
3536
3647
|
private _buildField;
|
|
3537
3648
|
private _isSection;
|
|
3538
3649
|
private _applySection;
|
|
3650
|
+
/**
|
|
3651
|
+
* Rewrites `slots` in place so its leaf-field entries follow `fields`' current
|
|
3652
|
+
* order. Section entries (GROUP/SUBFIELDS) keep their original array position —
|
|
3653
|
+
* only the leaf fields move. Safe to call whenever `slots` contains no ROW
|
|
3654
|
+
* (guaranteed by the `reorderable` flag the caller checks).
|
|
3655
|
+
*/
|
|
3656
|
+
private _reorderChildren;
|
|
3539
3657
|
private _applyField;
|
|
3540
3658
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfigSchemaTreeService, never>;
|
|
3541
3659
|
static ɵprov: i0.ɵɵInjectableDeclaration<ConfigSchemaTreeService>;
|
|
@@ -3588,6 +3706,12 @@ interface TableColumn {
|
|
|
3588
3706
|
visible?: boolean;
|
|
3589
3707
|
/** Configurator-only flag: when true the column can never be hidden (toggle is replaced by a lock). */
|
|
3590
3708
|
lockVisibility?: boolean;
|
|
3709
|
+
/**
|
|
3710
|
+
* Explicit display order (lower renders first). Columns without a sequence keep their
|
|
3711
|
+
* original relative order, placed after any columns that do have one. Set automatically
|
|
3712
|
+
* by the column configurator when the user reorders columns.
|
|
3713
|
+
*/
|
|
3714
|
+
sequence?: number;
|
|
3591
3715
|
}
|
|
3592
3716
|
interface TableFilter {
|
|
3593
3717
|
key: string;
|
|
@@ -3818,6 +3942,8 @@ declare class TableColumnConfigurationService {
|
|
|
3818
3942
|
loadConfig(config: TableConfig): void;
|
|
3819
3943
|
/** Toggle a column's visibility. Locked columns are ignored. */
|
|
3820
3944
|
toggleColumnVisible(index: number): void;
|
|
3945
|
+
/** Move a column from `previousIndex` to `currentIndex` (drag-and-drop reorder). */
|
|
3946
|
+
reorderColumn(previousIndex: number, currentIndex: number): void;
|
|
3821
3947
|
/**
|
|
3822
3948
|
* Produce the updated config. Writes the current node state onto the working
|
|
3823
3949
|
* clone and returns a fresh deep clone (safe to hand to the host / persist).
|
|
@@ -3825,6 +3951,12 @@ declare class TableColumnConfigurationService {
|
|
|
3825
3951
|
*/
|
|
3826
3952
|
buildUpdatedConfig(): TableConfig | null;
|
|
3827
3953
|
private _buildColumn;
|
|
3954
|
+
/**
|
|
3955
|
+
* Orders columns by `sequence` (ascending). Columns without a `sequence` keep their
|
|
3956
|
+
* original relative order, placed after any columns that do have one — so configs that
|
|
3957
|
+
* never set `sequence` come back untouched (stable sort).
|
|
3958
|
+
*/
|
|
3959
|
+
private _sortBySequence;
|
|
3828
3960
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableColumnConfigurationService, never>;
|
|
3829
3961
|
static ɵprov: i0.ɵɵInjectableDeclaration<TableColumnConfigurationService>;
|
|
3830
3962
|
}
|
|
@@ -3833,15 +3965,17 @@ declare class TableColumnConfigurationService {
|
|
|
3833
3965
|
* Table Column Configuration
|
|
3834
3966
|
* --------------------------
|
|
3835
3967
|
* Renders a compact list of a table config's columns, each with a **visibility**
|
|
3836
|
-
* toggle
|
|
3837
|
-
* ("Configure columns").
|
|
3968
|
+
* toggle and a drag handle for **reordering**. Intended to be embedded inside a
|
|
3969
|
+
* `cc-confirmation-modal` on a host page ("Configure columns").
|
|
3838
3970
|
*
|
|
3839
3971
|
* Pass a `TableConfig` via `[config]`. The input is deep-cloned, so it is never
|
|
3840
|
-
* mutated.
|
|
3841
|
-
*
|
|
3972
|
+
* mutated. Columns load pre-sorted by `sequence` (if set); columns without a
|
|
3973
|
+
* `sequence` keep their original relative order. When the user confirms, call
|
|
3974
|
+
* `getUpdatedConfig()` to read back the modified config (isEnabled/visible flags
|
|
3975
|
+
* and `sequence` updated per column, in the new order).
|
|
3842
3976
|
*
|
|
3843
3977
|
* Columns carrying `lockVisibility: true` cannot be hidden — their toggle is
|
|
3844
|
-
* replaced by a lock icon.
|
|
3978
|
+
* replaced by a lock icon. They can still be dragged to reorder.
|
|
3845
3979
|
*
|
|
3846
3980
|
* @example
|
|
3847
3981
|
* ```html
|
|
@@ -3869,6 +4003,8 @@ declare class TableColumnConfigurationComponent implements OnChanges {
|
|
|
3869
4003
|
*/
|
|
3870
4004
|
getUpdatedConfig(): TableConfig | null;
|
|
3871
4005
|
onToggleVisible(index: number): void;
|
|
4006
|
+
/** Drag-and-drop reorder. Written back as `sequence` on each column by `getUpdatedConfig()`. */
|
|
4007
|
+
onDrop(event: CdkDragDrop<ConfigColumnNode[]>): void;
|
|
3872
4008
|
trackByIndex(index: number): number;
|
|
3873
4009
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableColumnConfigurationComponent, never>;
|
|
3874
4010
|
static ɵcmp: i0.ɵɵComponentDeclaration<TableColumnConfigurationComponent, "lib-table-column-configuration", never, { "config": { "alias": "config"; "required": true; }; "translate": { "alias": "translate"; "required": false; }; "showLegend": { "alias": "showLegend"; "required": false; }; }, {}, never, never, false, never>;
|
|
@@ -3891,7 +4027,7 @@ declare class ConfigColumnNodeComponent {
|
|
|
3891
4027
|
|
|
3892
4028
|
declare class TableColumnConfigurationModule {
|
|
3893
4029
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableColumnConfigurationModule, never>;
|
|
3894
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TableColumnConfigurationModule, [typeof TableColumnConfigurationComponent, typeof ConfigColumnNodeComponent], [typeof i2$1.CommonModule], [typeof TableColumnConfigurationComponent]>;
|
|
4030
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TableColumnConfigurationModule, [typeof TableColumnConfigurationComponent, typeof ConfigColumnNodeComponent], [typeof i2$1.CommonModule, typeof i5$1.DragDropModule], [typeof TableColumnConfigurationComponent]>;
|
|
3895
4031
|
static ɵinj: i0.ɵɵInjectorDeclaration<TableColumnConfigurationModule>;
|
|
3896
4032
|
}
|
|
3897
4033
|
|
|
@@ -4903,6 +5039,12 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
|
|
|
4903
5039
|
private calculateStickyPositions;
|
|
4904
5040
|
private toTitleCase;
|
|
4905
5041
|
get columnCount(): number;
|
|
5042
|
+
/**
|
|
5043
|
+
* Orders `config.columns` by their `sequence` value (ascending). Columns without a
|
|
5044
|
+
* `sequence` are left in their original relative order, placed after any columns that
|
|
5045
|
+
* do have one — so configs that never set `sequence` are left untouched (stable sort).
|
|
5046
|
+
*/
|
|
5047
|
+
private sortColumnsBySequence;
|
|
4906
5048
|
/**
|
|
4907
5049
|
* Filters out actions/action-items that are either explicitly disabled via
|
|
4908
5050
|
* `isEnabled: false` or hidden for the given row by their `visibleWhen` /
|
|
@@ -5178,6 +5320,13 @@ interface HierarchyCfg {
|
|
|
5178
5320
|
nodes: Record<string, any>;
|
|
5179
5321
|
branchSubType: string;
|
|
5180
5322
|
showLoader: boolean;
|
|
5323
|
+
/** Passed straight through onto every generated level's DROPDOWN optionConfig — same shape as
|
|
5324
|
+
* optionConfig.searchConfig documented in smart-form.md. Lets a large flat MDM level (e.g.
|
|
5325
|
+
* hundreds of districts) be searched instead of scrolled through in full. */
|
|
5326
|
+
searchConfig?: any;
|
|
5327
|
+
/** Passed straight through onto every generated level's DROPDOWN optionConfig — same shape as
|
|
5328
|
+
* optionConfig.pagination documented in smart-form.md (loadMore/infiniteScroll). */
|
|
5329
|
+
pagination?: any;
|
|
5181
5330
|
}
|
|
5182
5331
|
|
|
5183
5332
|
declare class ValidationUtils {
|
|
@@ -5228,4 +5377,4 @@ declare class SnackbarModule {
|
|
|
5228
5377
|
}
|
|
5229
5378
|
|
|
5230
5379
|
export { AlertComponent, AlertModule, ButtonComponent, ButtonDropdownComponent, ButtonDropdownModule, ButtonModule, CheckboxComponent, ClickOutsideDirective, ConfigColumnNodeComponent, ConfigFieldNodeComponent, ConfigSchemaTreeService, ConfigSectionNodeComponent, 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, FieldConfigurationService, FieldConfiguratorComponent, FieldSelectionComponent, FilterComponent, FilterModule, FilterSidebarComponent, FilterSidebarModule, FilterTableSelectorComponent, FilterTableSelectorModule, FormBuilderModule, FormComponentsModule, FormFieldConfigurationComponent, FormFieldConfigurationModule, 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, TableColumnConfigurationComponent, TableColumnConfigurationModule, TableColumnConfigurationService, TimePickerComponent, TimePickerModule, TimeWheelPanelComponent, ToggleComponent, ValidationUtils, appendBaseUrlRecursively, clearLocalStorage, clearSessionStorage, getLocalStorageItem, getSessionStorageItem, removeLocalStorageItem, removeSessionStorageItem, setLocalStorageItem, setSessionStorageItem, translateConfig };
|
|
5231
|
-
export type { ActionVisibility, AlertLabels, AlertVariant, AttachmentConfig, ButtonLabels, ButtonVariant, CheckboxConfig, CheckboxLabels, CheckboxOption, ConfigColumnNode, ConfigFieldNode, ConfigSectionNode, ConfirmationModalConfig, DateConfig, DatePickerConfig, DatepickerLabels, DropdownAction, DropdownConfig, DropdownLabels, DropdownOption, EmailConfig, FieldConfig, FieldEventPayload, FieldType, FilterChangeEvent, FilterConfig, FilterItem, FilterItemType, FilterOutput, FilterPanelConfig, FilterParamMap, FilterSearchConfig, FilterSidebarChangeEvent, FilterSidebarConfig, FilterSidebarOutput, FilterTableConfig, FilterTableSelectorConfig, FormConfig, FormField, FormOption, FormSchema, FormSection, GeneratedConfig, HierarchyCfg, 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, SelectionConfig, SideNavItem, SideNavSection, SideNavStyleConfig, SnackbarConfig, SnackbarVariant, StepperConfig, SubmitConfig, SuffixActionIcon, SummaryCardConfig, SummaryCardLabels, SummaryCardMeta, TableAction, TableActionItem, TableColumn, TableColumnSubField, TableConfig, TableDataChangeEvent, TableFilter, TableFilterChangeEvent, TableFilterColumn, TableFilterConfig, TableFilterItem, TableFilterLabels, TableFilterOutput, TableLabels, TableOption, TableRowSaveEvent, TableTheme, TextConfig, TimeMode, TimePickerConfig, TimePickerLabels, TimePickerVariant, ToggleConfig, ToggleLabels, UIConfig, UISubType, UIType, UploadedFile, ValidationResult, ValidationRules, VisibilityRule };
|
|
5380
|
+
export type { ActionVisibility, AlertLabels, AlertVariant, AttachmentConfig, ButtonLabels, ButtonVariant, CheckboxConfig, CheckboxLabels, CheckboxOption, ConfigColumnNode, ConfigFieldNode, ConfigSectionNode, ConfirmationModalConfig, DateConfig, DatePickerConfig, DatepickerLabels, DropdownAction, DropdownConfig, DropdownLabels, DropdownOption, EmailConfig, FieldColSpanPayload, FieldConfig, FieldEventPayload, FieldReorderPayload, FieldType, FilterChangeEvent, FilterConfig, FilterItem, FilterItemType, FilterOutput, FilterPanelConfig, FilterParamMap, FilterSearchConfig, FilterSidebarChangeEvent, FilterSidebarConfig, FilterSidebarOutput, FilterTableConfig, FilterTableSelectorConfig, FormConfig, FormField, FormOption, FormSchema, FormSection, GeneratedConfig, HierarchyCfg, 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, SelectionConfig, SideNavItem, SideNavSection, SideNavStyleConfig, SnackbarConfig, SnackbarVariant, StepperConfig, SubmitConfig, SuffixActionIcon, SummaryCardConfig, SummaryCardLabels, SummaryCardMeta, TableAction, TableActionItem, TableColumn, TableColumnSubField, TableConfig, TableDataChangeEvent, TableFilter, TableFilterChangeEvent, TableFilterColumn, TableFilterConfig, TableFilterItem, TableFilterLabels, TableFilterOutput, TableLabels, TableOption, TableRowSaveEvent, TableTheme, TextConfig, TimeMode, TimePickerConfig, TimePickerLabels, TimePickerVariant, ToggleConfig, ToggleLabels, UIConfig, UISubType, UIType, UploadedFile, ValidationResult, ValidationRules, VisibilityRule };
|