commons-shared-web-ui 0.0.75 → 0.0.77

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
@@ -883,6 +883,10 @@ interface SelectionFieldNode {
883
883
  selected: boolean;
884
884
  /** If true, the field cannot be deselected by the user */
885
885
  isLocked: boolean;
886
+ /** True for a synthetic per-level node under a GEOGRAPHY_DYNAMIC master field (Country/State/
887
+ * District/...) — lets the UI render it nested under its master and disable it while the
888
+ * master is off, instead of showing it as an unrelated flat sibling. */
889
+ isGeographyLevel?: boolean;
886
890
  }
887
891
  /**
888
892
  * Wraps a section (SUBFIELDS / nested sectionConfig) with toggle + tree metadata.
@@ -942,6 +946,19 @@ declare class FieldSelectionService {
942
946
  * This prevents the UI from unexpectedly collapsing sections when the user toggles a field.
943
947
  */
944
948
  loadSchemaPreservingExpanded(schema: FormSchema): void;
949
+ /**
950
+ * A freshly-parsed group/section's `enabled` comes straight from its persisted
951
+ * FieldConfig.isEnabled — unlike toggleField()/toggleSection(), which always follow a mutation
952
+ * with `_recomputeEnabledFromChildren()` to keep the section/group toggle in sync with its
953
+ * children's actual selected state. Without this, a schema saved with e.g. Address.isEnabled:
954
+ * false but its Country/State/District checkboxes individually selected (a state that toggling
955
+ * from within the UI can never itself produce, but stale/pre-fix persisted data can) loads with
956
+ * checked child boxes sitting under a section toggle that shows OFF — contradicting what the
957
+ * checkboxes say and, worse, matching what the Configurator tree/actual form use to prune the
958
+ * whole section. Runs the same reconciliation parse-time gets on every load, so the toggle
959
+ * always reflects reality regardless of how the persisted schema got into this state.
960
+ */
961
+ private _reconcileGroupsFromChildren;
945
962
  /**
946
963
  * Toggle a group's enabled state. Disabling cascades to all sections + fields.
947
964
  * When enabling, all fields are selected (unless locked).
@@ -974,6 +991,15 @@ declare class FieldSelectionService {
974
991
  * Used when toggling a section/group back ON to restore field selections.
975
992
  */
976
993
  private _enableAllSections;
994
+ /**
995
+ * Re-derives `enabled` bottom-up for every section in the list, from its own current
996
+ * fields/subsections — mirroring "Master Toggle Reflects Children" (already true for the
997
+ * GROUP toggle vs. its sections) at every level: a section is ON as long as at least one of
998
+ * its fields is selected or a subsection is ON. Without this, re-selecting a single field
999
+ * after its parent section was switched off left the section's own toggle stuck OFF even
1000
+ * though a child was visibly selected again.
1001
+ */
1002
+ private _recomputeEnabledFromChildren;
977
1003
  private _toggleSectionAtPath;
978
1004
  private _toggleExpandedAtPath;
979
1005
  private _toggleFieldAtPath;
@@ -1210,6 +1236,17 @@ declare class SelectionSectionNodeComponent {
1210
1236
  get selectedCount(): number;
1211
1237
  get isLocked(): boolean;
1212
1238
  trackByFieldIndex(index: number): number;
1239
+ /**
1240
+ * A GEOGRAPHY_DYNAMIC field's per-level nodes (Country/State/District/...) are built as flat
1241
+ * entries immediately following their master in `section.fields` (see
1242
+ * FormSchemaTreeService._buildGeographyFieldNodes) — there's no real nested schema structure
1243
+ * to walk, so "master" here just means the nearest preceding non-level field.
1244
+ */
1245
+ private masterFieldFor;
1246
+ /** True for a geography level whose master field is currently unselected — locked out so the
1247
+ * user can't leave an individually-checked level under an unchecked (and therefore pruned)
1248
+ * master; see masterFieldFor(). */
1249
+ isFieldDisabled(field: SelectionFieldNode, index: number): boolean;
1213
1250
  trackBySubsectionIndex(index: number): number;
1214
1251
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectionSectionNodeComponent, never>;
1215
1252
  static ɵcmp: i0.ɵɵComponentDeclaration<SelectionSectionNodeComponent, "lib-selection-section-node", never, { "section": { "alias": "section"; "required": true; }; "sectionIndex": { "alias": "sectionIndex"; "required": true; }; "depth": { "alias": "depth"; "required": false; }; "hideToggleForOptionTypes": { "alias": "hideToggleForOptionTypes"; "required": false; }; }, { "toggleEnabled": "toggleEnabled"; "toggleExpanded": "toggleExpanded"; "fieldToggle": "fieldToggle"; }, never, never, false, never>;
@@ -1224,9 +1261,17 @@ declare class SelectionFieldNodeComponent {
1224
1261
  * pre-configured by the developer and shouldn't be toggled by business users.
1225
1262
  */
1226
1263
  hideToggleForOptionTypes: boolean;
1264
+ /**
1265
+ * Set when the enclosing section is off. A field can never be meaningfully "selected" while
1266
+ * its parent section is disabled — the Field Configuration step prunes the whole disabled
1267
+ * branch regardless of individual field state — so the checkbox is locked out here to make
1268
+ * that constraint visible instead of letting the user set a checked state that won't survive.
1269
+ */
1270
+ disabled: boolean;
1271
+ onCheckedChange(): void;
1227
1272
  get isOptionDrivenType(): boolean;
1228
1273
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectionFieldNodeComponent, never>;
1229
- static ɵcmp: i0.ɵɵComponentDeclaration<SelectionFieldNodeComponent, "lib-selection-field-node", never, { "field": { "alias": "field"; "required": true; }; "hideToggleForOptionTypes": { "alias": "hideToggleForOptionTypes"; "required": false; }; }, { "toggleSelected": "toggleSelected"; }, never, never, false, never>;
1274
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectionFieldNodeComponent, "lib-selection-field-node", never, { "field": { "alias": "field"; "required": true; }; "hideToggleForOptionTypes": { "alias": "hideToggleForOptionTypes"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "toggleSelected": "toggleSelected"; }, never, never, false, never>;
1230
1275
  }
1231
1276
 
1232
1277
  declare class ConfiguratorTreeComponent {
@@ -1663,6 +1708,12 @@ declare class FormFieldComponent implements OnInit, AfterViewInit, OnDestroy {
1663
1708
  private defaultStateSnapshot;
1664
1709
  /** Tracks whether the current localOptionList is filtered by an active server-side search query */
1665
1710
  private _isServerSearchActive;
1711
+ /** True from the moment "Select All" is turned on until the user deselects a single option,
1712
+ * toggles it back off, or starts a new search. While active, each newly-arrived paginated
1713
+ * page (loadMoreDropdownOptions) is auto-merged into the selection — see loadDropdownOptions
1714
+ * — so the selected count keeps pace with what's been scrolled into view (e.g. 10 -> 20 -> 34)
1715
+ * instead of freezing at whatever was loaded the moment "Select All" was clicked. */
1716
+ private _selectAllActive;
1666
1717
  /** Dedicated cache of currently selected option objects */
1667
1718
  selectedItems: any[];
1668
1719
  /** Cache of the latest dependency parameters for server-side autocomplete filtering */
@@ -1936,6 +1987,9 @@ declare class FormFieldComponent implements OnInit, AfterViewInit, OnDestroy {
1936
1987
  isSomeSelected(): boolean;
1937
1988
  /** Toggles selection of all filtered options. */
1938
1989
  toggleSelectAll(checked: boolean): void;
1990
+ /** Merges every currently-loaded filtered option into the selection — used to keep an
1991
+ * already-active "Select All" in sync as more paginated pages arrive (see loadDropdownOptions). */
1992
+ private applySelectAllToLoadedOptions;
1939
1993
  get isTextField(): boolean;
1940
1994
  get isNumberField(): boolean;
1941
1995
  get isDateField(): boolean;
@@ -2760,6 +2814,7 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
2760
2814
  selectionChange: EventEmitter<any>;
2761
2815
  searchTermChange: EventEmitter<string>;
2762
2816
  loadMore: EventEmitter<void>;
2817
+ opened: EventEmitter<void>;
2763
2818
  viewport?: CdkVirtualScrollViewport;
2764
2819
  searchInput?: ElementRef;
2765
2820
  triggerEl?: ElementRef;
@@ -2775,6 +2830,7 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
2775
2830
  };
2776
2831
  onChange: (value: any) => void;
2777
2832
  onTouched: () => void;
2833
+ private selectAllActive;
2778
2834
  private search$;
2779
2835
  constructor(el: ElementRef);
2780
2836
  ngOnInit(): void;
@@ -2796,6 +2852,11 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
2796
2852
  setDisabledState(isDisabled: boolean): void;
2797
2853
  toggle(): void;
2798
2854
  close(): void;
2855
+ get isAllFilteredSelected(): boolean;
2856
+ toggleSelectAll(): void;
2857
+ /** Merges every currently-loaded selectable option into the selection — used to keep a
2858
+ * "Select All" that's already active in sync as more lazy-loaded pages arrive. */
2859
+ private applySelectAllToLoadedOptions;
2799
2860
  selectOption(option: DropdownOption): void;
2800
2861
  isSelected(option: DropdownOption): boolean;
2801
2862
  onSearch(term: string): void;
@@ -2818,7 +2879,7 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
2818
2879
  [key: string]: string | undefined;
2819
2880
  };
2820
2881
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownComponent, 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>;
2882
+ 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"; "opened": "opened"; }, never, never, false, never>;
2822
2883
  }
2823
2884
 
2824
2885
  interface CheckboxOption {
@@ -5328,6 +5389,10 @@ interface HierarchyCfg {
5328
5389
  /** Passed straight through onto every generated level's DROPDOWN optionConfig — same shape as
5329
5390
  * optionConfig.pagination documented in smart-form.md (loadMore/infiniteScroll). */
5330
5391
  pagination?: any;
5392
+ /** optionConfig.sortBy path applied to every generated level (Country/State/District/...).
5393
+ * Defaults to `labelPath` when not set — see _buildHierarchyFields(). Set explicitly (or to
5394
+ * an empty string to opt out) if a template needs different, or no, ordering. */
5395
+ sortBy?: string;
5331
5396
  }
5332
5397
 
5333
5398
  declare class ValidationUtils {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commons-shared-web-ui",
3
- "version": "0.0.75",
3
+ "version": "0.0.77",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "20.3.15",
6
6
  "@angular/cdk": "20.2.14",
@@ -3,7 +3,7 @@
3
3
  // Default configuration for the snackbar theme
4
4
  $default-snackbar-config: (
5
5
  // Shared Layout
6
- font-family: ('Inter', sans-serif),
6
+ font-family: ('Poppins', sans-serif),
7
7
  font-size: 14px,
8
8
  font-weight: 500,
9
9
  min-width: 300px,