@lucca-front/ng 22.0.3 → 22.0.4

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.
Files changed (32) hide show
  1. package/fesm2022/lucca-front-ng-core-select-api.mjs +33 -3
  2. package/fesm2022/lucca-front-ng-core-select-api.mjs.map +1 -1
  3. package/fesm2022/lucca-front-ng-core-select-department.mjs.map +1 -1
  4. package/fesm2022/lucca-front-ng-core-select-establishment.mjs.map +1 -1
  5. package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs.map +1 -1
  6. package/fesm2022/lucca-front-ng-core-select-legal-units.mjs.map +1 -1
  7. package/fesm2022/lucca-front-ng-core-select-occupation-category.mjs.map +1 -1
  8. package/fesm2022/lucca-front-ng-core-select-user.mjs.map +1 -1
  9. package/fesm2022/lucca-front-ng-core-select.mjs +9 -3
  10. package/fesm2022/lucca-front-ng-core-select.mjs.map +1 -1
  11. package/fesm2022/lucca-front-ng-date.mjs +1 -3
  12. package/fesm2022/lucca-front-ng-date.mjs.map +1 -1
  13. package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs +14 -12
  14. package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs.map +1 -1
  15. package/fesm2022/lucca-front-ng-multi-select.mjs +4 -4
  16. package/fesm2022/lucca-front-ng-multi-select.mjs.map +1 -1
  17. package/fesm2022/lucca-front-ng-option.mjs +5 -1
  18. package/fesm2022/lucca-front-ng-option.mjs.map +1 -1
  19. package/fesm2022/lucca-front-ng-picker.mjs.map +1 -1
  20. package/fesm2022/lucca-front-ng-scroll-box.mjs +8 -4
  21. package/fesm2022/lucca-front-ng-scroll-box.mjs.map +1 -1
  22. package/fesm2022/lucca-front-ng-select.mjs +1 -1
  23. package/fesm2022/lucca-front-ng-select.mjs.map +1 -1
  24. package/fesm2022/lucca-front-ng-simple-select.mjs +10 -7
  25. package/fesm2022/lucca-front-ng-simple-select.mjs.map +1 -1
  26. package/package.json +4 -4
  27. package/types/lucca-front-ng-core-select-api.d.ts +19 -1
  28. package/types/lucca-front-ng-core-select.d.ts +12 -0
  29. package/types/lucca-front-ng-option.d.ts +8 -8
  30. package/types/lucca-front-ng-picker.d.ts +2 -2
  31. package/types/lucca-front-ng-select.d.ts +6 -6
  32. package/types/lucca-front-ng-simple-select.d.ts +1 -1
@@ -51,13 +51,31 @@ declare abstract class ALuCoreSelectApiDirective<TOption, TParams = Record<strin
51
51
  */
52
52
  protected getGroupOptions?: (group: unknown) => Observable<TOption[]>;
53
53
  ngOnInit(): void;
54
+ /**
55
+ * Emits whenever something *other than the clue* changed in {@link params$}, so the option stream
56
+ * resets and reloads from page 0 — a panel header toggle, a filter bound to an input…
57
+ *
58
+ * Clue changes are already the select's own business (debounce included), and every directive folds
59
+ * the clue into its params under its own key — sometimes driving the sort along with it — so there
60
+ * is no clue key to strip generically. They are recognized here by comparing the clue of two
61
+ * consecutive params emissions instead: same clue but different params means a real params change.
62
+ */
63
+ protected buildParamsChange(): Observable<TParams>;
54
64
  /**
55
65
  * Post-process the whole list of loaded options (all pages accumulated). Override it for
56
66
  * decorations that can't be computed page by page, eg. flagging homonyms across pages.
57
67
  */
58
68
  protected transformOptions(options: readonly TOption[]): Observable<readonly TOption[]>;
59
69
  protected buildParamsFromClue(clue: string): Observable<TParams>;
60
- abstract totalCount$: Observable<number>;
70
+ /**
71
+ * Total number of options matching the current params, ignoring pagination. Only the select-all
72
+ * feature of `lu-multi-select` needs it, so it is optional: a directive that has no cheap way to
73
+ * count — or whose select never offers a select-all — simply leaves it undefined.
74
+ *
75
+ * Being a property of this class, it has to be implemented as a field: TypeScript rejects an
76
+ * accessor overriding a property (TS2611).
77
+ */
78
+ totalCount$: Observable<number> | undefined;
61
79
  protected clearLastPageByClue(): void;
62
80
  protected getOptionsPage(params: TParams, page: number): Observable<{
63
81
  items: TOption[];
@@ -16,6 +16,13 @@ interface SelectDataSourceParams {
16
16
  page: number;
17
17
  }
18
18
  interface SelectDataSource<TOption, TGroup = never> {
19
+ /**
20
+ * Emits when the params behind `getOptions` changed, so the select resets and reloads from page 0
21
+ * with the current clue — a panel header toggle, a filter bound to an input…
22
+ *
23
+ * It must not emit on clue changes: those are the select's own business, debounce included, and an
24
+ * emission here would load the same page a second time.
25
+ */
19
26
  paramsChange?: Observable<unknown>;
20
27
  /** Optional debounce in ms for clue-based re-queries (useful for API data sources) */
21
28
  clueDebounceMs?: number;
@@ -56,6 +63,11 @@ type CoreSelectAddOptionStrategy = 'never' | 'always' | 'if-empty-clue' | 'if-no
56
63
  declare const SELECT_ID: InjectionToken<number>;
57
64
  declare const SELECT_LABEL: InjectionToken<HTMLLabelElement>;
58
65
  declare const SELECT_LABEL_ID: InjectionToken<string>;
66
+ /**
67
+ * Contract behind {@link CORE_SELECT_API_TOTAL_COUNT_PROVIDER}: a directive fulfills it by declaring
68
+ * a `totalCount$`, which the select-all of `lu-multi-select` then reads through the token. Providing
69
+ * a count stays optional — see `ALuCoreSelectApiDirective.totalCount$`.
70
+ */
59
71
  interface CoreSelectApiTotalCountProvider {
60
72
  totalCount$: Observable<number>;
61
73
  }
@@ -133,8 +133,8 @@ type LuOptionComparer<T> = (option1: T, option2: T) => boolean;
133
133
  declare abstract class ALuOptionPicker<T, O extends ILuOptionItem<T> = ILuOptionItem<T>> extends ALuPickerPanel<T> implements ILuOptionPickerPanel<T> {
134
134
  protected _subs: Subscription;
135
135
  onSelectValue: Observable<T | T[]>;
136
- protected _value: T | T[];
137
- setValue(value: T | T[]): void;
136
+ protected _value: T | T[] | undefined;
137
+ setValue(value: T | T[] | undefined): void;
138
138
  private __options$;
139
139
  protected get _options$(): Observable<O[]>;
140
140
  protected set _options$(options$: Observable<O[]>);
@@ -430,12 +430,12 @@ declare class LuTreeOptionOperatorModule {
430
430
  interface ILuOptionSelector<T> {
431
431
  multiple: boolean;
432
432
  onSelectValue: Observable<T | T[]>;
433
- setValue(value: T | T[]): void;
433
+ setValue(value: T | T[] | undefined): void;
434
434
  }
435
435
  declare abstract class ALuOptionSelector<T> implements ILuOptionSelector<T> {
436
436
  multiple: boolean;
437
437
  abstract onSelectValue: Observable<T | T[]>;
438
- abstract setValue(value: T | T[]): void;
438
+ abstract setValue(value: T | T[] | undefined): void;
439
439
  }
440
440
 
441
441
  type ILuTreeOptionSelector<T> = ILuOptionSelector<T>;
@@ -456,7 +456,7 @@ declare class LuOptionSelectAllComponent<T> extends ALuOptionOperator<T> impleme
456
456
  readonly intl: i0.InputSignalWithTransform<_lucca_front_ng_option.ILuOptionSelectAllLabel, Partial<_lucca_front_ng_option.ILuOptionSelectAllLabel>>;
457
457
  selectAll(): void;
458
458
  deselectAll(): void;
459
- setValue(values: T | T[]): void;
459
+ setValue(values: T | T[] | undefined): void;
460
460
  static ɵfac: i0.ɵɵFactoryDeclaration<LuOptionSelectAllComponent<any>, never>;
461
461
  static ɵcmp: i0.ɵɵComponentDeclaration<LuOptionSelectAllComponent<any>, "lu-option-select-all", never, { "intl": { "alias": "intl"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
462
462
  }
@@ -491,7 +491,7 @@ declare class LuTreeOptionSelectAllComponent<T> extends ALuTreeOptionOperator<T>
491
491
  readonly intl: i0.InputSignalWithTransform<_lucca_front_ng_option.ILuOptionSelectAllLabel, Partial<_lucca_front_ng_option.ILuOptionSelectAllLabel>>;
492
492
  selectAll(): void;
493
493
  deselectAll(): void;
494
- setValue(values: T | T[]): void;
494
+ setValue(values: T | T[] | undefined): void;
495
495
  private flattenTree;
496
496
  static ɵfac: i0.ɵɵFactoryDeclaration<LuTreeOptionSelectAllComponent<any>, never>;
497
497
  static ɵcmp: i0.ɵɵComponentDeclaration<LuTreeOptionSelectAllComponent<any>, "lu-tree-option-select-all", never, { "intl": { "alias": "intl"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
@@ -518,7 +518,7 @@ declare abstract class ALuOptionPickerAdvancedComponent<T, O extends ILuOptionIt
518
518
  onScrollBottom(): void;
519
519
  onOpen(): void;
520
520
  onClose(): void;
521
- setValue(value: T | T[]): void;
521
+ setValue(value: T | T[] | undefined): void;
522
522
  protected initOperators(): void;
523
523
  protected initSelectors(): void;
524
524
  ngAfterViewInit(): void;
@@ -603,7 +603,7 @@ declare abstract class ALuTreeOptionPickerAdvancedComponent<T, O extends ILuTree
603
603
  onScrollBottom(): void;
604
604
  onOpen(): void;
605
605
  onClose(): void;
606
- setValue(value: T | T[]): void;
606
+ setValue(value: T | T[] | undefined): void;
607
607
  protected initOperators(): void;
608
608
  protected initSelectors(): void;
609
609
  ngAfterViewInit(): void;
@@ -15,12 +15,12 @@ declare interface ILuPickerPanel<T> extends ILuPopoverPanel {
15
15
  * called to tell the picker what's the current value
16
16
  * @param value
17
17
  */
18
- setValue(value: T | T[]): void;
18
+ setValue(value: T | T[] | undefined): void;
19
19
  }
20
20
  declare abstract class ALuPickerPanel<T> extends ALuPopoverPanel implements ILuPickerPanel<T> {
21
21
  multiple: boolean;
22
22
  onSelectValue: Observable<T | T[]>;
23
- abstract setValue(value: T | T[]): void;
23
+ abstract setValue(value: T | T[] | undefined): void;
24
24
  }
25
25
  declare interface ILuInputWithPicker<TValue> extends ILuInput, ILuPopoverTrigger<ILuPickerPanel<TValue>> {
26
26
  }
@@ -23,13 +23,13 @@ declare abstract class ALuSelectInput<T, TPicker extends ILuPickerPanel<T> = ILu
23
23
  /**
24
24
  * contriol value accessor interface implementation
25
25
  */
26
- protected _value: T | T[];
26
+ protected _value: T | T[] | undefined;
27
27
  setValue(value: T | T[] | undefined): void;
28
- get value(): T | T[];
29
- set value(value: T | T[]);
30
- writeValue(value: T | T[]): void;
31
- protected _cvaOnChange: (v: T | T[]) => unknown;
32
- registerOnChange(fn: (v: T | T[]) => unknown): void;
28
+ get value(): T | T[] | undefined;
29
+ set value(value: T | T[] | undefined);
30
+ writeValue(value: T | T[] | undefined): void;
31
+ protected _cvaOnChange: (v: T | T[] | undefined) => unknown;
32
+ registerOnChange(fn: (v: T | T[] | undefined) => unknown): void;
33
33
  protected _onTouched: () => unknown;
34
34
  registerOnTouched(fn: () => unknown): void;
35
35
  set disabled(d: boolean);
@@ -50,7 +50,7 @@ declare class LuSelectPanelComponent<T> implements AfterViewInit, CoreSelectPane
50
50
  readonly optionComparer: _angular_core.WritableSignal<_lucca_front_ng_core_select.LuOptionComparer<T>>;
51
51
  readonly optionKey: _angular_core.WritableSignal<(option: T) => unknown>;
52
52
  colorPanel: _angular_core.InputSignalWithTransform<boolean, boolean | "" | "false" | "true">;
53
- initialValue: T | null;
53
+ initialValue: T | null | undefined;
54
54
  readonly optionTpl: _angular_core.ModelSignal<_angular_core.Type<unknown> | _angular_core.TemplateRef<_lucca_front_ng_core_select.LuOptionContext<T>>>;
55
55
  readonly options: _angular_core.WritableSignal<_CoreSelectPanelElement<T>[]>;
56
56
  readonly pointerNavigation: _angular_core.Signal<boolean>;