commons-shared-web-ui 0.0.42 → 0.0.44

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
@@ -233,6 +233,22 @@ interface StepperConfig {
233
233
  showStep?: boolean;
234
234
  isHorizontal?: boolean;
235
235
  }
236
+ /**
237
+ * Describes a clickable action icon rendered as a suffix inside a TEXT_INPUT
238
+ * or NUMBER_INPUT field. Multiple icons can be shown side-by-side.
239
+ * When clicked, the field name and actionId are emitted via the
240
+ * SmartFormComponent's `suffixActionClick` output.
241
+ */
242
+ interface SuffixActionIcon {
243
+ /** Material icon name (e.g. 'edit', 'refresh', 'check', 'lock') */
244
+ icon: string;
245
+ /** Unique action identifier emitted on click (e.g. 'enable_edit', 'reset_code') */
246
+ actionId: string;
247
+ /** Optional tooltip shown on hover */
248
+ tooltip?: string;
249
+ /** Optional custom color override (e.g. '#16A34A' for a green check icon) */
250
+ color?: string;
251
+ }
236
252
  interface FieldConfig {
237
253
  name?: string;
238
254
  label?: string;
@@ -265,6 +281,12 @@ interface FieldConfig {
265
281
  suffix?: string;
266
282
  /** Whether the field is read-only (shows lock icon) */
267
283
  readonly?: boolean;
284
+ /**
285
+ * Clickable action icons rendered as suffixes inside the input.
286
+ * Ignored when `readonly` is true (the built-in lock icon takes precedence).
287
+ * Each icon emits a `suffixActionClick` event with `{ fieldName, actionId }`.
288
+ */
289
+ suffixActionIcons?: SuffixActionIcon[];
268
290
  sectionConfig?: SectionConfig;
269
291
  /**
270
292
  * Cross-field validation config for SUBFIELDS groups.
@@ -278,6 +300,7 @@ interface FieldConfig {
278
300
  phoneConfig?: PhoneConfig;
279
301
  numberConfig?: NumberConfig;
280
302
  dateConfig?: DateConfig;
303
+ timeConfig?: TimeConfig;
281
304
  optionConfig?: OptionConfig$1;
282
305
  autocompleteConfig?: AutocompleteConfig;
283
306
  generatedConfig?: GeneratedConfig;
@@ -314,6 +337,8 @@ interface NumberConfig {
314
337
  }
315
338
  interface DateConfig {
316
339
  allowFuture?: boolean;
340
+ /** When false, dates before today are disabled (today is the minimum). When true (default), all past dates are allowed. */
341
+ allowPast?: boolean;
317
342
  minDate?: string;
318
343
  maxDate?: string;
319
344
  /** When true, the text input is readonly (picker-only, no keyboard entry). */
@@ -321,6 +346,20 @@ interface DateConfig {
321
346
  /** Name of a sibling field whose value is used as the dynamic minimum date. */
322
347
  minDateField?: string;
323
348
  }
349
+ interface TimeConfig {
350
+ /** Explicit minimum time in "HH:mm" 24-hour format (e.g. "09:00"). */
351
+ minTime?: string;
352
+ /** Explicit maximum time in "HH:mm" 24-hour format (e.g. "18:00"). */
353
+ maxTime?: string;
354
+ /** When true, the input is readonly. */
355
+ inputReadonly?: boolean;
356
+ /**
357
+ * Name of a sibling TIME field whose value is used as the dynamic minimum time.
358
+ * When the sibling changes, this field's minimum updates and any now-invalid
359
+ * value (earlier than the new minimum) is cleared. Mirrors DateConfig.minDateField.
360
+ */
361
+ minTimeField?: string;
362
+ }
324
363
  interface OptionConfig$1 {
325
364
  optionClass?: string;
326
365
  optionUrl?: string;
@@ -1120,6 +1159,11 @@ declare class SmartFormController {
1120
1159
  fileAdded$: Subject<any>;
1121
1160
  fileUploadFinished$: Subject<any>;
1122
1161
  fileRemoved$: Subject<any>;
1162
+ /** Emitted when a suffixActionIcon is clicked inside a form field */
1163
+ suffixActionClick$: Subject<{
1164
+ fieldName: string;
1165
+ actionId: string;
1166
+ }>;
1123
1167
  initialize(initialData: {
1124
1168
  [key: string]: any;
1125
1169
  }): void;
@@ -1195,6 +1239,11 @@ declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
1195
1239
  fileAdded: EventEmitter<any>;
1196
1240
  fileUploadFinished: EventEmitter<any>;
1197
1241
  fileRemoved: EventEmitter<any>;
1242
+ /** Emitted when a suffixActionIcon is clicked. Payload: { fieldName, actionId } */
1243
+ suffixActionClick: EventEmitter<{
1244
+ fieldName: string;
1245
+ actionId: string;
1246
+ }>;
1198
1247
  /** Emitted whenever the active section step changes. Carries current state so the
1199
1248
  * host can show/hide Previous/Next/Submit buttons in its own footer. */
1200
1249
  stepChange: EventEmitter<{
@@ -1313,7 +1362,7 @@ declare class SmartFormComponent implements OnInit, OnChanges, OnDestroy {
1313
1362
  private _codeToFieldName;
1314
1363
  private _codeToLabel;
1315
1364
  static ɵfac: i0.ɵɵFactoryDeclaration<SmartFormComponent, never>;
1316
- static ɵcmp: i0.ɵɵComponentDeclaration<SmartFormComponent, "lib-smart-form", never, { "formJson": { "alias": "formJson"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "enableDraftAutoSave": { "alias": "enableDraftAutoSave"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; }, { "submit": "submit"; "draftSave": "draftSave"; "actionClick": "actionClick"; "valueChange": "valueChange"; "fileAdded": "fileAdded"; "fileUploadFinished": "fileUploadFinished"; "fileRemoved": "fileRemoved"; "stepChange": "stepChange"; }, never, never, false, never>;
1365
+ static ɵcmp: i0.ɵɵComponentDeclaration<SmartFormComponent, "lib-smart-form", never, { "formJson": { "alias": "formJson"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "enableDraftAutoSave": { "alias": "enableDraftAutoSave"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; }, { "submit": "submit"; "draftSave": "draftSave"; "actionClick": "actionClick"; "valueChange": "valueChange"; "fileAdded": "fileAdded"; "fileUploadFinished": "fileUploadFinished"; "fileRemoved": "fileRemoved"; "suffixActionClick": "suffixActionClick"; "stepChange": "stepChange"; }, never, never, false, never>;
1317
1366
  }
1318
1367
 
1319
1368
  declare class FormSectionComponent implements OnInit, OnDestroy {
@@ -1429,6 +1478,21 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1429
1478
  isVisible: boolean;
1430
1479
  showPassword: boolean;
1431
1480
  dynamicMinDate: string | null;
1481
+ dynamicMinTime: string | null;
1482
+ /**
1483
+ * Effective minimum date for the datepicker.
1484
+ * Priority: dynamic (sibling field) → explicit minDate → today (when allowPast is false).
1485
+ * When allowPast is not false, past dates stay allowed unless an explicit min is set.
1486
+ */
1487
+ get effectiveMinDate(): string | null;
1488
+ /**
1489
+ * Effective minimum time for the time input.
1490
+ * Priority: dynamic (sibling field) → explicit minTime.
1491
+ * Mirrors {@link effectiveMinDate} for TIME fields.
1492
+ */
1493
+ get effectiveMinTime(): string | null;
1494
+ /** Effective maximum time for the time input (explicit maxTime only). */
1495
+ get effectiveMaxTime(): string | null;
1432
1496
  isMultiDropdownOpen: boolean;
1433
1497
  isDragOver: boolean;
1434
1498
  fileUploadError: string;
@@ -1541,6 +1605,8 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1541
1605
  fg: FormGroup;
1542
1606
  }): number;
1543
1607
  ngAfterViewInit(): void;
1608
+ /** Handles click on a suffix action icon and emits via the controller */
1609
+ onSuffixActionClick(actionId: string): void;
1544
1610
  ngOnDestroy(): void;
1545
1611
  registerControl(): void;
1546
1612
  getValidators(): ValidatorFn[];
@@ -1555,6 +1621,13 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1555
1621
  setupMatchValidation(): void;
1556
1622
  setupVisibility(): void;
1557
1623
  setupMinDateField(): void;
1624
+ /**
1625
+ * Wires up a dynamic minimum for a TIME field from a sibling TIME field
1626
+ * (config.timeConfig.minTimeField). When the source changes, this field's
1627
+ * minimum updates and any now-invalid value (earlier than the new minimum)
1628
+ * is cleared. Mirrors {@link setupMinDateField} for TIME fields.
1629
+ */
1630
+ setupMinTimeField(): void;
1558
1631
  setupGeneratedField(): void;
1559
1632
  evaluateFormula(context: {
1560
1633
  [key: string]: any;
@@ -1565,6 +1638,16 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1565
1638
  [key: string]: any;
1566
1639
  }): void;
1567
1640
  private getValueByPath;
1641
+ /**
1642
+ * Replaces `{placeholder}` tokens in a URL with values resolved from the
1643
+ * current form data (supports dot / array-index paths via getValueByPath).
1644
+ * Returns the interpolated URL plus whether EVERY token was resolved.
1645
+ *
1646
+ * Used by the delete flows: when a required id (e.g. `{entityId}`) is missing
1647
+ * — as in CREATE mode before the entity exists — `resolved` is false and the
1648
+ * caller skips the server delete and just removes the item from the form.
1649
+ */
1650
+ private resolveUrlPlaceholders;
1568
1651
  /** Builds HttpHeaders using the token stored in the SmartFormController (sourced from configJSON)
1569
1652
  * merged with any custom headers declared in optionConfig.headers.
1570
1653
  */
@@ -4053,4 +4136,4 @@ declare class SnackbarModule {
4053
4136
  }
4054
4137
 
4055
4138
  export { AlertComponent, AlertModule, ButtonComponent, ButtonDropdownComponent, ButtonDropdownModule, ButtonModule, CheckboxComponent, 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, FieldConfiguratorComponent, FieldSelectionComponent, FilterComponent, FilterModule, FilterSidebarComponent, FilterSidebarModule, FilterTableSelectorComponent, FilterTableSelectorModule, FormBuilderModule, FormComponentsModule, 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, ToggleComponent, ValidationUtils, appendBaseUrlRecursively, clearLocalStorage, clearSessionStorage, getLocalStorageItem, getSessionStorageItem, removeLocalStorageItem, removeSessionStorageItem, setLocalStorageItem, setSessionStorageItem, translateConfig };
4056
- export type { AlertLabels, AlertVariant, AttachmentConfig, ButtonLabels, ButtonVariant, CheckboxConfig, CheckboxLabels, CheckboxOption, ConfirmationModalConfig, DateConfig, DatePickerConfig, DatepickerLabels, DropdownAction, DropdownConfig, DropdownLabels, DropdownOption, EmailConfig, FieldConfig, 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, SummaryCardConfig, SummaryCardLabels, SummaryCardMeta, TableAction, TableActionItem, TableColumn, TableColumnSubField, TableConfig, TableDataChangeEvent, TableFilter, TableFilterChangeEvent, TableFilterColumn, TableFilterConfig, TableFilterItem, TableFilterLabels, TableFilterOutput, TableLabels, TableOption, TableRowSaveEvent, TableTheme, TextConfig, ToggleConfig, ToggleLabels, UIConfig, UISubType, UIType, UploadedFile, ValidationResult, ValidationRules };
4139
+ export type { AlertLabels, AlertVariant, AttachmentConfig, ButtonLabels, ButtonVariant, CheckboxConfig, CheckboxLabels, CheckboxOption, ConfirmationModalConfig, DateConfig, DatePickerConfig, DatepickerLabels, DropdownAction, DropdownConfig, DropdownLabels, DropdownOption, EmailConfig, FieldConfig, 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, ToggleConfig, ToggleLabels, UIConfig, UISubType, UIType, UploadedFile, ValidationResult, ValidationRules };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commons-shared-web-ui",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "20.3.15",
6
6
  "@angular/cdk": "20.2.14",