ng-hub-ui-forms 22.7.0 → 22.9.0

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-hub-ui-forms",
3
- "version": "22.7.0",
3
+ "version": "22.9.0",
4
4
  "license": "MIT",
5
5
  "description": "Accessible, signal-based form fields for Angular (input, textarea, slider, segmented, select, datepicker, file input with drag & drop and upload progress) with automatic error display for controls, FormGroups and FormArrays. Reactive Forms today, Signal Forms ready. Part of the ng-hub-ui family.",
6
6
  "author": "Carlos Morcillo <carlos.morcillo@me.com> (https://www.carlosmorcillo.com)",
@@ -294,6 +294,9 @@
294
294
  // `.ng-dropdown-panel` — one below HubModal (`--hub-sys-zindex-modal`, 1055) — so a
295
295
  // select opened inside a modal was clipped underneath it. Sit a few layers above
296
296
  // the modal instead.
297
+ // DEPRECATED name (non-canonical `z-index` spelling), kept one cycle as the default
298
+ // carrier and override bridge; the canonical hook is `--hub-select-dropdown-zindex`,
299
+ // read first at the consumption point (select.component.scss).
297
300
  --hub-select-dropdown-z-index: calc(var(--hub-sys-zindex-modal, 1055) + 5);
298
301
 
299
302
  // ── Datepicker ──────────────────────────────────────────────────────────────
@@ -980,6 +980,47 @@ declare class HubSliderComponent extends HubFieldControl {
980
980
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubSliderComponent, "hub-slider", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "range": { "alias": "range"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "showValue": { "alias": "showValue"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "formTextType": { "alias": "formTextType"; "required": false; "isSignal": true; }; "classlist": { "alias": "classlist"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
981
981
  }
982
982
 
983
+ /** Context handed to a projected `hubSegmentedOption` template. */
984
+ interface HubSegmentedOptionContext {
985
+ /** The option being rendered. */
986
+ $implicit: HubSegmentedOption;
987
+ /** Whether the option is currently selected. */
988
+ selected: boolean;
989
+ /** Position of the option within the control. */
990
+ index: number;
991
+ }
992
+ /**
993
+ * Replaces the rendering of each option's content in `<hub-segmented>`.
994
+ *
995
+ * By default a segment renders its `label` as plain text; this template takes over the
996
+ * inside of the segment button (icons, badges, rich markup) while the component keeps
997
+ * owning selection state, keyboard navigation and ARIA semantics.
998
+ *
999
+ * @example
1000
+ * ```html
1001
+ * <hub-segmented formControlName="view" [options]="views">
1002
+ * <ng-template hubSegmentedOption let-option let-selected="selected">
1003
+ * <hub-icon [name]="option.value" [label]="option.label" />
1004
+ * {{ option.label }}
1005
+ * </ng-template>
1006
+ * </hub-segmented>
1007
+ * ```
1008
+ */
1009
+ declare class HubSegmentedOptionDirective {
1010
+ /** Template reference for the option content. */
1011
+ readonly template: TemplateRef<HubSegmentedOptionContext>;
1012
+ /**
1013
+ * Narrows the context for the template type-checker.
1014
+ *
1015
+ * @param _directive - The directive instance.
1016
+ * @param _context - The candidate context.
1017
+ * @returns Always `true`; exists only to type `let-option` and the extra bindings.
1018
+ */
1019
+ static ngTemplateContextGuard(_directive: HubSegmentedOptionDirective, _context: unknown): _context is HubSegmentedOptionContext;
1020
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubSegmentedOptionDirective, never>;
1021
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HubSegmentedOptionDirective, "[hubSegmentedOption]", never, {}, {}, never, never, true, never>;
1022
+ }
1023
+
983
1024
  /** A single choice rendered by {@link HubSegmentedComponent}. */
984
1025
  interface HubSegmentedOption {
985
1026
  /** Value written to the form control when this option is selected. */
@@ -1019,6 +1060,8 @@ declare class HubSegmentedComponent extends HubFieldControl {
1019
1060
  protected readonly _labelTypes: typeof HubLabelTypes;
1020
1061
  /** The selectable options, in render order. */
1021
1062
  readonly options: _angular_core.InputSignal<HubSegmentedOption[]>;
1063
+ /** Optional `hubSegmentedOption` template replacing each option's content. */
1064
+ protected readonly optionTpt: _angular_core.Signal<HubSegmentedOptionDirective | undefined>;
1022
1065
  /** Visual density. */
1023
1066
  readonly size: _angular_core.InputSignal<HubSegmentedSize>;
1024
1067
  /**
@@ -1085,7 +1128,7 @@ declare class HubSegmentedComponent extends HubFieldControl {
1085
1128
  */
1086
1129
  private updateIndicator;
1087
1130
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubSegmentedComponent, never>;
1088
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubSegmentedComponent, "hub-segmented", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "vertical": { "alias": "vertical"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
1131
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubSegmentedComponent, "hub-segmented", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "vertical": { "alias": "vertical"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["optionTpt"], never, true, never>;
1089
1132
  }
1090
1133
 
1091
1134
  /**
@@ -1274,12 +1317,39 @@ declare class HubSelectComponent extends HubFieldControl {
1274
1317
  * render it inline within the component instead.
1275
1318
  */
1276
1319
  readonly appendTo: _angular_core.InputSignal<string | undefined>;
1320
+ /**
1321
+ * Allows creating new items from the search term (dropdown format). `true`
1322
+ * adds the term as-is; a function maps the term to a new item (sync or
1323
+ * `Promise`).
1324
+ */
1325
+ readonly addTag: _angular_core.InputSignal<boolean | ((term: string) => any | Promise<any>)>;
1326
+ /** Label of the "add item" row shown while typing when `addTag` is enabled. */
1327
+ readonly addTagText: _angular_core.InputSignal<string>;
1328
+ /** Minimum search-term length before filtering (or `typeahead`) kicks in. */
1329
+ readonly minTermLength: _angular_core.InputSignalWithTransform<number, unknown>;
1330
+ /**
1331
+ * Subject that receives search-term changes for async/server-side loading
1332
+ * (dropdown format). When provided, the control stops filtering client-side
1333
+ * and pushes each term here; feed the results back through `items`.
1334
+ *
1335
+ * Note: the vendor also pushes `null` through the Subject when it clears the
1336
+ * search box (e.g. right after a selection) — filter it out if you only
1337
+ * expect strings.
1338
+ */
1339
+ readonly typeahead: _angular_core.InputSignal<Subject<string> | undefined>;
1340
+ /**
1341
+ * Custom equality between an item and the bound value (e.g. objects compared
1342
+ * by id). When omitted, the vendor's built-in comparison applies.
1343
+ */
1344
+ readonly compareWith: _angular_core.InputSignal<((a: any, b: any) => boolean) | undefined>;
1277
1345
  /** Helper text shown below the control. */
1278
1346
  readonly formText: _angular_core.InputSignal<string>;
1279
1347
  /** Helper text placement. Only `bottom` is supported. */
1280
1348
  readonly formTextType: _angular_core.InputSignal<FormTextType>;
1281
1349
  /** Extra CSS classes applied to the host element. */
1282
1350
  readonly classlist: _angular_core.InputSignal<string>;
1351
+ /** ARIA attributes forwarded to the vendor's combobox search input. */
1352
+ protected readonly a11yInputAttrs: _angular_core.Signal<Record<string, string>>;
1283
1353
  /** Emits whenever the value changes. */
1284
1354
  readonly valueChange: _angular_core.OutputEmitterRef<any>;
1285
1355
  /** Emits when the control gains focus (dropdown format). */
@@ -1345,7 +1415,7 @@ declare class HubSelectComponent extends HubFieldControl {
1345
1415
  */
1346
1416
  protected toggleItem(item: any): void;
1347
1417
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubSelectComponent, never>;
1348
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubSelectComponent, "hub-select", never, { "format": { "alias": "format"; "required": false; "isSignal": true; }; "vertical": { "alias": "vertical"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "fixedPlaceholder": { "alias": "fixedPlaceholder"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "notFoundText": { "alias": "notFoundText"; "required": false; "isSignal": true; }; "appendTo": { "alias": "appendTo"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "formTextType": { "alias": "formTextType"; "required": false; "isSignal": true; }; "classlist": { "alias": "classlist"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "onFocus": "onFocus"; "onBlur": "onBlur"; "onOpen": "onOpen"; "onClose": "onClose"; "onClear": "onClear"; "onSearch": "onSearch"; "onAdd": "onAdd"; "onRemove": "onRemove"; "scroll": "scroll"; "scrollToEnd": "scrollToEnd"; }, ["_optionTpl", "_optgroupTpl", "_labelTpl", "_multiLabelTpl", "_headerTpl", "_footerTpl", "_notFoundTpl"], ["*"], true, never>;
1418
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubSelectComponent, "hub-select", never, { "format": { "alias": "format"; "required": false; "isSignal": true; }; "vertical": { "alias": "vertical"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "fixedPlaceholder": { "alias": "fixedPlaceholder"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "notFoundText": { "alias": "notFoundText"; "required": false; "isSignal": true; }; "appendTo": { "alias": "appendTo"; "required": false; "isSignal": true; }; "addTag": { "alias": "addTag"; "required": false; "isSignal": true; }; "addTagText": { "alias": "addTagText"; "required": false; "isSignal": true; }; "minTermLength": { "alias": "minTermLength"; "required": false; "isSignal": true; }; "typeahead": { "alias": "typeahead"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "formTextType": { "alias": "formTextType"; "required": false; "isSignal": true; }; "classlist": { "alias": "classlist"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "onFocus": "onFocus"; "onBlur": "onBlur"; "onOpen": "onOpen"; "onClose": "onClose"; "onClear": "onClear"; "onSearch": "onSearch"; "onAdd": "onAdd"; "onRemove": "onRemove"; "scroll": "scroll"; "scrollToEnd": "scrollToEnd"; }, ["_optionTpl", "_optgroupTpl", "_labelTpl", "_multiLabelTpl", "_headerTpl", "_footerTpl", "_notFoundTpl"], ["*"], true, never>;
1349
1419
  }
1350
1420
 
1351
1421
  /** A calendar cell enriched with its selection / range / disabled / focus state. */
@@ -2411,5 +2481,5 @@ interface HubFormControlAdapter {
2411
2481
  */
2412
2482
  declare const hubFormControlAdapter: HubFormControlAdapter;
2413
2483
 
2414
- export { FormTextTypes, HUB_FILE_UPLOADER, HUB_FORMS_CONFIG, HubAutoresizeDirective, HubDatepickerComponent, HubFieldControl, HubFieldsetComponent, HubFileDropzoneNoticeDirective, HubFileIconDirective, HubFileInputComponent, HubFilePreviewDirective, HubFormComponent, HubFormControl, HubFormTextDirective, HubGroupControl, HubInputComponent, HubInputFormats, HubInputPrefixDirective, HubInputSuffixDirective, HubInvertColorPipe, HubJoinButLastPipe, HubLabelTypes, HubLegendComponent, HubLegendDirective, HubMapPipe, HubOtpInputComponent, HubSafeUrlPipe, HubSegmentedComponent, HubSelectComponent, HubSelectFormats, HubSliderComponent, HubSnakeUpperPipe, HubTextareaComponent, HubUcfirstPipe, HubValidationErrorDirective, NgClearButtonTemplateDirective, NgFooterTemplateDirective, NgHeaderTemplateDirective, NgLabelTemplateDirective, NgLoadingSpinnerTemplateDirective, NgLoadingTextTemplateDirective, NgMultiLabelTemplateDirective, NgNotFoundTemplateDirective, NgOptgroupTemplateDirective, NgOptionComponent, NgOptionTemplateDirective, NgSelectConfig, NgTagTemplateDirective, NgTypeToSearchTemplateDirective, applyMask, areEqual, camelToSnakeUpper, controlHasMinOrMaxValidator, defaultHubDatepickerConfig, defaultHubDatepickerLabels, defaultHubFileInputLabels, defaultHubFormsConfig, defaultInvalidFeedback, fileKey, formatFileSize, get, getActiveElement, getMinOrMaxValueFromValidator, hubAcceptedFiles, hubAreEqual, hubFormControlAdapter, hubMaxFileSize, hubMaxFiles, hubMaxTotalSize, hubMinFileSize, hubMinFiles, isDefined, isMaskActive, isString, joinButLast, matchesAccept, provideHubFileUploader, provideHubForms, runInZone, toFileArray, uuid };
2415
- export type { FormTextType, HubDateRange, HubDateValue, HubDatepickerConfig, HubDatepickerLabels, HubDatepickerMode, HubFileConstraints, HubFileIconContext, HubFileInputLabels, HubFileItem, HubFilePreview, HubFilePreviewContext, HubFileRejection, HubFileRejectionReason, HubFileStatus, HubFileUploadEvent, HubFileUploader, HubFileValue, HubFormControlAdapter, HubFormControlConfig, HubFormControlHandle, HubFormControlOption, HubFormsConfig, HubGroupErrorTrigger, HubInputFormat, HubLabelType, HubMaskResult, HubOtpMode, HubSegmentedOption, HubSegmentedSize, HubSelectFormat, HubSliderValue };
2484
+ export { FormTextTypes, HUB_FILE_UPLOADER, HUB_FORMS_CONFIG, HubAutoresizeDirective, HubDatepickerComponent, HubFieldControl, HubFieldsetComponent, HubFileDropzoneNoticeDirective, HubFileIconDirective, HubFileInputComponent, HubFilePreviewDirective, HubFormComponent, HubFormControl, HubFormTextDirective, HubGroupControl, HubInputComponent, HubInputFormats, HubInputPrefixDirective, HubInputSuffixDirective, HubInvertColorPipe, HubJoinButLastPipe, HubLabelTypes, HubLegendComponent, HubLegendDirective, HubMapPipe, HubOtpInputComponent, HubSafeUrlPipe, HubSegmentedComponent, HubSegmentedOptionDirective, HubSelectComponent, HubSelectFormats, HubSliderComponent, HubSnakeUpperPipe, HubTextareaComponent, HubUcfirstPipe, HubValidationErrorDirective, NgClearButtonTemplateDirective, NgFooterTemplateDirective, NgHeaderTemplateDirective, NgLabelTemplateDirective, NgLoadingSpinnerTemplateDirective, NgLoadingTextTemplateDirective, NgMultiLabelTemplateDirective, NgNotFoundTemplateDirective, NgOptgroupTemplateDirective, NgOptionComponent, NgOptionTemplateDirective, NgSelectConfig, NgTagTemplateDirective, NgTypeToSearchTemplateDirective, applyMask, areEqual, camelToSnakeUpper, controlHasMinOrMaxValidator, defaultHubDatepickerConfig, defaultHubDatepickerLabels, defaultHubFileInputLabels, defaultHubFormsConfig, defaultInvalidFeedback, fileKey, formatFileSize, get, getActiveElement, getMinOrMaxValueFromValidator, hubAcceptedFiles, hubAreEqual, hubFormControlAdapter, hubMaxFileSize, hubMaxFiles, hubMaxTotalSize, hubMinFileSize, hubMinFiles, isDefined, isMaskActive, isString, joinButLast, matchesAccept, provideHubFileUploader, provideHubForms, runInZone, toFileArray, uuid };
2485
+ export type { FormTextType, HubDateRange, HubDateValue, HubDatepickerConfig, HubDatepickerLabels, HubDatepickerMode, HubFileConstraints, HubFileIconContext, HubFileInputLabels, HubFileItem, HubFilePreview, HubFilePreviewContext, HubFileRejection, HubFileRejectionReason, HubFileStatus, HubFileUploadEvent, HubFileUploader, HubFileValue, HubFormControlAdapter, HubFormControlConfig, HubFormControlHandle, HubFormControlOption, HubFormsConfig, HubGroupErrorTrigger, HubInputFormat, HubLabelType, HubMaskResult, HubOtpMode, HubSegmentedOption, HubSegmentedOptionContext, HubSegmentedSize, HubSelectFormat, HubSliderValue };
Binary file