commons-shared-web-ui 0.0.57 → 0.0.59

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
@@ -9,6 +9,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';
11
11
  import { BehaviorSubject, Subject, Observable } from 'rxjs';
12
+ import * as i8$1 from '@angular/cdk/overlay';
13
+ import { ConnectedPosition } from '@angular/cdk/overlay';
12
14
  import { DomSanitizer, SafeResourceUrl, SafeHtml } from '@angular/platform-browser';
13
15
  import * as i1 from '@angular/material/card';
14
16
  import * as i3 from '@angular/material/checkbox';
@@ -39,7 +41,7 @@ import * as i26 from '@angular/material/paginator';
39
41
  import * as i27 from '@angular/material/table';
40
42
  import * as i28 from '@angular/material/expansion';
41
43
  import * as i29 from '@angular/cdk/accordion';
42
- import * as i10$1 from 'ngx-quill';
44
+ import * as i11$2 from 'ngx-quill';
43
45
  import * as i11$1 from '@angular/cdk/scrolling';
44
46
  import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
45
47
 
@@ -1635,6 +1637,19 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1635
1637
  * expected toolbar shape.
1636
1638
  */
1637
1639
  get richTextModules(): any;
1640
+ /**
1641
+ * Preferred positions for the custom dropdown panels, rendered in a CDK
1642
+ * connected overlay so they escape a scrollable modal body (cc-confirmation-modal)
1643
+ * instead of being clipped behind its footer. Opens below the trigger, flipping
1644
+ * above when there isn't room.
1645
+ */
1646
+ readonly dropdownOverlayPositions: ConnectedPosition[];
1647
+ /**
1648
+ * Close the dropdown when the CDK overlay reports a click outside the panel.
1649
+ * Clicks on the trigger itself are ignored here so the trigger's own toggle
1650
+ * handler can close it (otherwise the two would fight and re-open it).
1651
+ */
1652
+ onDropdownOverlayOutsideClick(event: MouseEvent, triggerEl: HTMLElement): void;
1638
1653
  toggleMultiDropdown(event: MouseEvent): void;
1639
1654
  toggleSingleDropdown(event: MouseEvent): void;
1640
1655
  selectSingleOption(option: any): void;
@@ -3047,7 +3062,7 @@ declare class TimePickerModule {
3047
3062
 
3048
3063
  declare class SmartFormModule {
3049
3064
  static ɵfac: i0.ɵɵFactoryDeclaration<SmartFormModule, never>;
3050
- static ɵmod: i0.ɵɵNgModuleDeclaration<SmartFormModule, [typeof SmartFormComponent, typeof FormSectionComponent, typeof FormFieldComponent, typeof TrustedUrlPipe], [typeof i2$1.CommonModule, typeof i3$1.ReactiveFormsModule, typeof i3$1.FormsModule, typeof MaterialModule, typeof ButtonModule, typeof AlertModule, typeof i10$1.QuillModule, typeof TimePickerModule], [typeof SmartFormComponent]>;
3065
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SmartFormModule, [typeof SmartFormComponent, typeof FormSectionComponent, typeof FormFieldComponent, typeof TrustedUrlPipe], [typeof i2$1.CommonModule, typeof i3$1.ReactiveFormsModule, typeof i3$1.FormsModule, typeof MaterialModule, typeof i8$1.OverlayModule, typeof ButtonModule, typeof AlertModule, typeof i11$2.QuillModule, typeof TimePickerModule], [typeof SmartFormComponent]>;
3051
3066
  static ɵinj: i0.ɵɵInjectorDeclaration<SmartFormModule>;
3052
3067
  }
3053
3068
 
@@ -3376,7 +3391,39 @@ interface TableFilter {
3376
3391
  handling?: 'standard' | 'nested_string';
3377
3392
  nestedStringConfig?: NestedStringConfig;
3378
3393
  }
3379
- interface TableActionItem {
3394
+ /**
3395
+ * A single condition evaluated against a row to decide action visibility.
3396
+ *
3397
+ * `field` is a path into the row (supports nesting + array index, e.g.
3398
+ * 'status.code', 'subStatus.code', 'name[0].text'). When the resolved value is
3399
+ * an object (e.g. `{ code, name, value }`), it is normalized to its `code`
3400
+ * (then `name`, then `value`) so the SAME rule works whether the API returns
3401
+ * `status: { code: 'ACTIVE' }` or `status: 'ACTIVE'`.
3402
+ *
3403
+ * String comparisons are case-insensitive.
3404
+ */
3405
+ interface VisibilityRule {
3406
+ /** Path into the row, e.g. 'status.code' or just 'status'. */
3407
+ field: string;
3408
+ /** Comparison operator. Default: 'eq'. */
3409
+ operator?: 'eq' | 'neq' | 'in' | 'nin' | 'truthy' | 'falsy';
3410
+ /** Comparison value for 'eq' / 'neq'. */
3411
+ value?: any;
3412
+ /** Comparison list for 'in' / 'nin'. */
3413
+ values?: any[];
3414
+ }
3415
+ /**
3416
+ * Row-aware visibility config shared by actions and action items.
3417
+ * - `visibleWhen`: ALL rules must pass (AND) for the action to show.
3418
+ * - `hiddenWhen`: if ANY rule passes (OR), the action is hidden.
3419
+ * `hiddenWhen` takes precedence over `visibleWhen`. Either may be a single
3420
+ * rule or an array of rules.
3421
+ */
3422
+ interface ActionVisibility {
3423
+ visibleWhen?: VisibilityRule | VisibilityRule[];
3424
+ hiddenWhen?: VisibilityRule | VisibilityRule[];
3425
+ }
3426
+ interface TableActionItem extends ActionVisibility {
3380
3427
  label: string;
3381
3428
  type: 'api' | 'callback' | 'route' | 'delete';
3382
3429
  icon?: string;
@@ -3398,7 +3445,7 @@ interface TableActionItem {
3398
3445
  cancelLabel?: string;
3399
3446
  };
3400
3447
  }
3401
- interface TableAction {
3448
+ interface TableAction extends ActionVisibility {
3402
3449
  label: string;
3403
3450
  type: 'api' | 'callback' | 'route' | 'edit' | 'dropdown';
3404
3451
  icon?: string;
@@ -4622,10 +4669,30 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
4622
4669
  private calculateStickyPositions;
4623
4670
  private toTitleCase;
4624
4671
  get columnCount(): number;
4625
- /** Filters out actions/action-items explicitly disabled via `isEnabled: false`. */
4672
+ /**
4673
+ * Filters out actions/action-items that are either explicitly disabled via
4674
+ * `isEnabled: false` or hidden for the given row by their `visibleWhen` /
4675
+ * `hiddenWhen` rules. Pass `row` to enable the row-aware rule evaluation;
4676
+ * omit it (e.g. for header/colspan calculations) to evaluate `isEnabled` only.
4677
+ */
4626
4678
  getVisibleActions<T extends {
4627
4679
  isEnabled?: boolean;
4628
- }>(actions?: T[] | null): T[];
4680
+ } & ActionVisibility>(actions?: T[] | null, row?: any): T[];
4681
+ /**
4682
+ * Evaluates an action's `visibleWhen` / `hiddenWhen` rules against a row.
4683
+ * `hiddenWhen` wins over `visibleWhen`. With no row or no rules, returns true.
4684
+ */
4685
+ private isActionVisibleForRow;
4686
+ /** Evaluates a single visibility rule against a row. */
4687
+ private evaluateRule;
4688
+ /**
4689
+ * Normalizes a value for comparison. Objects shaped like `{ code, name, value }`
4690
+ * collapse to their `code` (then `name`, then `value`) so a rule targeting
4691
+ * `status` works whether the API returns an object or a plain string.
4692
+ */
4693
+ private normalizeRuleValue;
4694
+ /** Case-insensitive comparison for strings; strict-ish equality otherwise. */
4695
+ private ruleValuesEqual;
4629
4696
  get showPagination(): boolean;
4630
4697
  private applyPaginationDefaults;
4631
4698
  onColumnClick(row: any, col: TableColumn): void;
@@ -4913,4 +4980,4 @@ declare class SnackbarModule {
4913
4980
  }
4914
4981
 
4915
4982
  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 };
4916
- export type { 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 };
4983
+ 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commons-shared-web-ui",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "20.3.15",
6
6
  "@angular/cdk": "20.2.14",