ng-hub-ui-forms 22.49.0 → 22.50.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-hub-ui-forms",
3
- "version": "22.49.0",
3
+ "version": "22.50.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 Fernández <carlos.morcillo@me.com> (https://www.carlosmorcillo.com)",
@@ -426,7 +426,7 @@ hub-timepicker {
426
426
  .hub-field__control:focus-visible,
427
427
  .hub-input__control:focus,
428
428
  .hub-textarea__control:focus,
429
- .hub-select__control.ng-select-focused {
429
+ .hub-select__control-focused {
430
430
  border-color: var(--hub-input-readonly-border-color);
431
431
  box-shadow: none;
432
432
  outline: none;
@@ -436,8 +436,8 @@ hub-timepicker {
436
436
  // offer. The datepicker already hides its own clear when read-only; the icon it
437
437
  // opens with is the same promise.
438
438
  .hub-select__control {
439
- .ng-arrow-wrapper,
440
- .ng-clear-wrapper {
439
+ .hub-select__arrow-wrapper,
440
+ .hub-select__clear {
441
441
  display: none;
442
442
  }
443
443
  }
@@ -498,7 +498,7 @@ hub-timepicker {
498
498
  .hub-field__control:focus-visible,
499
499
  .hub-input__control:focus,
500
500
  .hub-textarea__control:focus,
501
- .hub-select__control.ng-select-focused {
501
+ .hub-select__control-focused {
502
502
  border-color: transparent;
503
503
  box-shadow: none;
504
504
  outline: none;
@@ -511,8 +511,8 @@ hub-timepicker {
511
511
 
512
512
  // Every affordance promises a choice that is not on offer here.
513
513
  .hub-select__control {
514
- .ng-arrow-wrapper,
515
- .ng-clear-wrapper {
514
+ .hub-select__arrow-wrapper,
515
+ .hub-select__clear {
516
516
  display: none;
517
517
  }
518
518
  }
@@ -101,8 +101,8 @@
101
101
 
102
102
  .hub-field__control:focus,
103
103
  .hub-#{$field}__control:focus,
104
- .ng-select.ng-select-focused .ng-select-container,
105
- .ng-select.ng-select-opened .ng-select-container {
104
+ .hub-select__control--focused .hub-select__box,
105
+ .hub-select__control--opened .hub-select__box {
106
106
  box-shadow: none;
107
107
  }
108
108
 
@@ -274,7 +274,7 @@
274
274
  // padding it should never have taken, and the control inside takes the squaring.
275
275
  //
276
276
  // Not wrapped in `:where()`, unlike the fill below. The select's own radius arrives
277
- // from `.hub-select__control.ng-select .ng-select-container` — three classes — and a
277
+ // from `.hub-select__control .hub-select__box` — three classes — and a
278
278
  // zero-specificity rule would lose to it in silence.
279
279
  > hub-input,
280
280
  > hub-select,
@@ -287,7 +287,7 @@
287
287
  }
288
288
 
289
289
  &--prepend > hub-input .hub-field__control,
290
- &--prepend > hub-select .ng-select-container,
290
+ &--prepend > hub-select .hub-select__box,
291
291
  &--prepend > hub-textarea .hub-field__control,
292
292
  &--prepend > hub-datepicker .hub-field__control,
293
293
  &--prepend > hub-timepicker .hub-field__control {
@@ -322,13 +322,13 @@
322
322
  border-end-start-radius: var(--hub-input-border-radius);
323
323
  }
324
324
 
325
- &--prepend > hub-select:first-child .ng-select-container {
325
+ &--prepend > hub-select:first-child .hub-select__box {
326
326
  border-start-start-radius: var(--hub-select-border-radius);
327
327
  border-end-start-radius: var(--hub-select-border-radius);
328
328
  }
329
329
 
330
330
  &--append > hub-input .hub-field__control,
331
- &--append > hub-select .ng-select-container,
331
+ &--append > hub-select .hub-select__box,
332
332
  &--append > hub-textarea .hub-field__control,
333
333
  &--append > hub-datepicker .hub-field__control,
334
334
  &--append > hub-timepicker .hub-field__control {
@@ -345,7 +345,7 @@
345
345
  border-end-end-radius: var(--hub-input-border-radius);
346
346
  }
347
347
 
348
- &--append > hub-select:last-child .ng-select-container {
348
+ &--append > hub-select:last-child .hub-select__box {
349
349
  border-start-end-radius: var(--hub-select-border-radius);
350
350
  border-end-end-radius: var(--hub-select-border-radius);
351
351
  }
@@ -387,7 +387,7 @@
387
387
  //
388
388
  // Descendant, not child. The element that PAINTS the box is not always a child of
389
389
  // the group: the datepicker wraps its input in a `__trigger` (it is the overlay
390
- // origin) and the select paints on `.ng-select-container`, two levels down. A child
390
+ // origin) and the select paints on `.hub-select__box`, two levels down. A child
391
391
  // combinator here reproduces 22.13.1 one storey lower — the rule reads as though it
392
392
  // covers every field while quietly matching nothing on the nested ones.
393
393
  //
@@ -397,7 +397,7 @@
397
397
  // The select's branch stays spelled out to the engine's own class. Reaching the element
398
398
  // is not enough — the rule has to OUTRANK whatever else paints that corner, and the
399
399
  // select theme claims it with three classes from a stylesheet that loads later. Trimming
400
- // this branch to a bare `.ng-select-container` shipped 22.17.0 with every select round
400
+ // this branch to a bare `.hub-select__box` shipped 22.17.0 with every select round
401
401
  // again: the selector still matched, so a test that asks `matches()` stayed green.
402
402
  .hub-#{$field}__group {
403
403
  // Governed by the same token as the strip's own corners: the seam is one decision, not
@@ -406,14 +406,14 @@
406
406
  // corners back too, or the flat side betrays a join that is no longer there.
407
407
  &--has-prepend .hub-#{$field}__control,
408
408
  &--has-prepend .hub-field__control,
409
- &--has-prepend .hub-#{$field}__control.ng-select .ng-select-container {
409
+ &--has-prepend .hub-#{$field}__control.hub-select__control .hub-select__box {
410
410
  border-start-start-radius: #{$attached-radius};
411
411
  border-end-start-radius: #{$attached-radius};
412
412
  }
413
413
 
414
414
  &--has-append .hub-#{$field}__control,
415
415
  &--has-append .hub-field__control,
416
- &--has-append .hub-#{$field}__control.ng-select .ng-select-container {
416
+ &--has-append .hub-#{$field}__control.hub-select__control .hub-select__box {
417
417
  border-start-end-radius: #{$attached-radius};
418
418
  border-end-end-radius: #{$attached-radius};
419
419
  }
@@ -621,7 +621,7 @@
621
621
  // How far a list may grow past its control to show its options whole.
622
622
  --hub-select-dropdown-max-width: 24rem;
623
623
  // Dropdown panel stacking. The select engine hard-codes `z-index: 1050` on
624
- // `.ng-dropdown-panel` — one below HubModal (`--hub-sys-zindex-modal`, 1055) — so a
624
+ // `.hub-select__panel` — one below HubModal (`--hub-sys-zindex-modal`, 1055) — so a
625
625
  // select opened inside a modal was clipped underneath it. Sit a few layers above
626
626
  // the modal instead.
627
627
  // DEPRECATED name (non-canonical `z-index` spelling), kept one cycle as the default
@@ -81,20 +81,20 @@
81
81
  }
82
82
  }
83
83
 
84
- .ng-select-container {
84
+ .hub-select__box {
85
85
  cursor: pointer;
86
86
  }
87
87
 
88
- .ng-clear-wrapper {
88
+ .hub-select__clear {
89
89
  margin-inline-start: var(--hub-ref-space-2, 0.5rem);
90
90
  }
91
91
 
92
- &:has(.ng-has-value) .hub-select__group {
92
+ &:has(.hub-select__box--has-value) .hub-select__group {
93
93
  border-color: var(--hub-select-chip-accent);
94
94
  background: color-mix(in oklch, var(--hub-select-chip-accent) 16%, var(--hub-sys-surface-page, #fff));
95
95
  }
96
96
 
97
- &:has(.ng-has-value) .ng-value-label {
97
+ &:has(.hub-select__box--has-value) .hub-select__value-label {
98
98
  color: var(--hub-select-chip-accent-emphasis);
99
99
  font-weight: 600;
100
100
  }
@@ -1805,6 +1805,37 @@ declare enum HubSelectFormats {
1805
1805
  Radio = "radio"
1806
1806
  }
1807
1807
 
1808
+ /**
1809
+ * Declares an option for ng-select declared via HTML. Use the value input to bind the option's value and the element content as its label.
1810
+ *
1811
+ * @since 3.0.0
1812
+ */
1813
+ declare class HubOptionComponent implements OnInit {
1814
+ /** Value bound to the option. The projected element content is used as the option's label. */
1815
+ readonly value: _angular_core.InputSignal<any>;
1816
+ /** Whether the option is disabled and cannot be selected. */
1817
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
1818
+ readonly elementRef: ElementRef<any>;
1819
+ readonly label: _angular_core.WritableSignal<string>;
1820
+ readonly classes: _angular_core.WritableSignal<string>;
1821
+ /** True when this component's inputs are initialized (after first change detection). */
1822
+ readonly isInitialized: _angular_core.WritableSignal<boolean>;
1823
+ /**
1824
+ * Creates an instance of HubOptionComponent.
1825
+ *
1826
+ * @since 3.0.0
1827
+ */
1828
+ constructor();
1829
+ /**
1830
+ * Initializes the instance after Angular has assigned its inputs.
1831
+ *
1832
+ * @since 21.5.2
1833
+ */
1834
+ ngOnInit(): void;
1835
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubOptionComponent, never>;
1836
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubOptionComponent, "hub-option, ng-option", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
1837
+ }
1838
+
1808
1839
  /**
1809
1840
  * Configuration provider for the NgSelect component. You can inject this service and provide application wide configuration.
1810
1841
  *
@@ -1839,7 +1870,7 @@ declare class HubSelectConfig {
1839
1870
  bindValue?: string;
1840
1871
  /** Object property to use for label. */
1841
1872
  bindLabel?: string;
1842
- /** Allows to select dropdown appearance. Set to `outline` or `fill` for Material form-field styles (applies only to Material theme). */
1873
+ /** @deprecated Has no effect: the Material appearances were removed along with the unused themes. */
1843
1874
  appearance: string;
1844
1875
  /** Clears search input when item is selected. */
1845
1876
  clearSearchOnAdd?: boolean;
@@ -1859,6 +1890,22 @@ declare class HubSelectConfig {
1859
1890
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<HubSelectConfig>;
1860
1891
  }
1861
1892
 
1893
+ /** Custom templates the engine can render, each receiving the same context as its `ng-*-tmp` directive. */
1894
+ interface HubSelectEngineTemplates {
1895
+ option?: TemplateRef<any> | null;
1896
+ optgroup?: TemplateRef<any> | null;
1897
+ label?: TemplateRef<any> | null;
1898
+ multiLabel?: TemplateRef<any> | null;
1899
+ header?: TemplateRef<any> | null;
1900
+ footer?: TemplateRef<any> | null;
1901
+ notFound?: TemplateRef<any> | null;
1902
+ typeToSearch?: TemplateRef<any> | null;
1903
+ loadingText?: TemplateRef<any> | null;
1904
+ tag?: TemplateRef<any> | null;
1905
+ loadingSpinner?: TemplateRef<any> | null;
1906
+ clearButton?: TemplateRef<any> | null;
1907
+ }
1908
+
1862
1909
  /**
1863
1910
  * Accessible select / multiselect / autocomplete built on the select engine, with the
1864
1911
  * `ng-hub-ui-forms` conventions on top: CVA binding, automatic error display (via
@@ -1943,6 +1990,8 @@ declare class HubSelectComponent extends HubFieldControl {
1943
1990
  private readonly _hubClearButtonTpl;
1944
1991
  private readonly _ngClearButtonTpl;
1945
1992
  protected readonly _clearButtonTpl: _angular_core.Signal<TemplateRef<any> | undefined>;
1993
+ /** Every customization template found in this field's content, keyed the way the engine expects. */
1994
+ protected readonly _templates: _angular_core.Signal<HubSelectEngineTemplates>;
1946
1995
  /** Deprecated select-only slot, superseded by `[hubAppend]`. */
1947
1996
  protected readonly _legacySuffixTpl: _angular_core.Signal<TemplateRef<any> | undefined>;
1948
1997
  /** Projected inline-start content (`[hubPrepend]`). */
@@ -3413,37 +3462,6 @@ declare class HubSelectClearButtonDirective {
3413
3462
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HubSelectClearButtonDirective, "[hubSelectClearButton]", never, {}, {}, never, never, true, never>;
3414
3463
  }
3415
3464
 
3416
- /**
3417
- * Declares an option for ng-select declared via HTML. Use the value input to bind the option's value and the element content as its label.
3418
- *
3419
- * @since 3.0.0
3420
- */
3421
- declare class HubOptionComponent implements OnInit {
3422
- /** Value bound to the option. The projected element content is used as the option's label. */
3423
- readonly value: _angular_core.InputSignal<any>;
3424
- /** Whether the option is disabled and cannot be selected. */
3425
- readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
3426
- readonly elementRef: ElementRef<any>;
3427
- readonly label: _angular_core.WritableSignal<string>;
3428
- readonly classes: _angular_core.WritableSignal<string>;
3429
- /** True when this component's inputs are initialized (after first change detection). */
3430
- readonly isInitialized: _angular_core.WritableSignal<boolean>;
3431
- /**
3432
- * Creates an instance of HubOptionComponent.
3433
- *
3434
- * @since 3.0.0
3435
- */
3436
- constructor();
3437
- /**
3438
- * Initializes the instance after Angular has assigned its inputs.
3439
- *
3440
- * @since 21.5.2
3441
- */
3442
- ngOnInit(): void;
3443
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubOptionComponent, never>;
3444
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubOptionComponent, "hub-option, ng-option", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
3445
- }
3446
-
3447
3465
  /**
3448
3466
  * Marks a template as the custom option template for ng-select.
3449
3467
  *