onekijs-ui 0.19.26 → 0.19.27

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.
@@ -80,11 +80,11 @@ export declare const getIconDivProps: (props: IconProps) => {
80
80
  results?: number | undefined;
81
81
  security?: string | undefined;
82
82
  unselectable?: "on" | "off" | undefined;
83
- inputMode?: "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined;
83
+ inputMode?: "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined;
84
84
  is?: string | undefined;
85
85
  'aria-activedescendant'?: string | undefined;
86
86
  'aria-atomic'?: (boolean | "true" | "false") | undefined;
87
- 'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
87
+ 'aria-autocomplete'?: "none" | "list" | "inline" | "both" | undefined;
88
88
  'aria-braillelabel'?: string | undefined;
89
89
  'aria-brailleroledescription'?: string | undefined;
90
90
  'aria-busy'?: (boolean | "true" | "false") | undefined;
@@ -94,12 +94,12 @@ export declare const getIconDivProps: (props: IconProps) => {
94
94
  'aria-colindextext'?: string | undefined;
95
95
  'aria-colspan'?: number | undefined;
96
96
  'aria-controls'?: string | undefined;
97
- 'aria-current'?: boolean | "time" | "step" | "date" | "true" | "false" | "page" | "location" | undefined;
97
+ 'aria-current'?: boolean | "time" | "location" | "step" | "date" | "true" | "false" | "page" | undefined;
98
98
  'aria-describedby'?: string | undefined;
99
99
  'aria-description'?: string | undefined;
100
100
  'aria-details'?: string | undefined;
101
101
  'aria-disabled'?: (boolean | "true" | "false") | undefined;
102
- 'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
102
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
103
103
  'aria-errormessage'?: string | undefined;
104
104
  'aria-expanded'?: (boolean | "true" | "false") | undefined;
105
105
  'aria-flowto'?: string | undefined;
@@ -121,7 +121,7 @@ export declare const getIconDivProps: (props: IconProps) => {
121
121
  'aria-posinset'?: number | undefined;
122
122
  'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
123
123
  'aria-readonly'?: (boolean | "true" | "false") | undefined;
124
- 'aria-relevant'?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
124
+ 'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
125
125
  'aria-required'?: (boolean | "true" | "false") | undefined;
126
126
  'aria-roledescription'?: string | undefined;
127
127
  'aria-rowcount'?: number | undefined;
@@ -5,15 +5,15 @@ declare class SelectService<T = any, I extends SelectItem<T> = SelectItem<T>, S
5
5
  protected lastCheckQuery: Query | undefined;
6
6
  get defaultValue(): T | T[] | null | undefined;
7
7
  get defaultValueLoading(): boolean | undefined;
8
- check(): Generator<void | import("redux-saga/effects").AllEffect<import("redux-saga/effects").CallEffect<Generator<I[] | Generator<void | import("redux-saga/effects").CancelEffect | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | CollectionFetcherResult<T> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>>> | import("redux-saga/effects").AllEffect<Generator<I[] | Generator<void | import("redux-saga/effects").CancelEffect | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | CollectionFetcherResult<T> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>> | import("redux-saga/effects").CallEffect<void>, void, (I | undefined)[]>;
8
+ check(): Generator<void | import("redux-saga/effects").AllEffect<import("redux-saga/effects").CallEffect<Generator<I[] | Generator<void | CollectionFetcherResult<T> | import("redux-saga/effects").CancelEffect | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>>> | import("redux-saga/effects").AllEffect<Generator<I[] | Generator<void | CollectionFetcherResult<T> | import("redux-saga/effects").CancelEffect | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>> | import("redux-saga/effects").CallEffect<void>, void, (I | undefined)[]>;
9
9
  setData(data: T[], query?: Query): void;
10
- setDefaultValue(value: T | T[] | null | undefined): Generator<void | Generator<void | import("redux-saga/effects").AllEffect<import("redux-saga/effects").CallEffect<Generator<I[] | Generator<void | import("redux-saga/effects").CancelEffect | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | CollectionFetcherResult<T> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>>> | import("redux-saga/effects").AllEffect<Generator<I[] | Generator<void | import("redux-saga/effects").CancelEffect | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | CollectionFetcherResult<T> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>> | import("redux-saga/effects").CallEffect<void>, void, (I | undefined)[]>, void, unknown>;
10
+ setDefaultValue(value: T | T[] | null | undefined): Generator<void | Generator<void | import("redux-saga/effects").AllEffect<import("redux-saga/effects").CallEffect<Generator<I[] | Generator<void | CollectionFetcherResult<T> | import("redux-saga/effects").CancelEffect | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>>> | import("redux-saga/effects").AllEffect<Generator<I[] | Generator<void | CollectionFetcherResult<T> | import("redux-saga/effects").CancelEffect | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>> | import("redux-saga/effects").CallEffect<void>, void, (I | undefined)[]>, void, unknown>;
11
11
  setDefaultValueLoading(loading: boolean): void;
12
12
  setItemWidth(_item: I, value: number): void;
13
13
  setValue(value: null | T | T[]): void;
14
14
  setUrl(url: string, query?: Query): void;
15
15
  _buildItem(data: T | null | undefined, adaptee: unknown, context?: AnonymousObject): I;
16
- _filterItem(item: I | undefined, query: Query, valid: boolean): Generator<I[] | Generator<void | import("redux-saga/effects").CancelEffect | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | CollectionFetcherResult<T> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>;
16
+ _filterItem(item: I | undefined, query: Query, valid: boolean): Generator<I[] | Generator<void | CollectionFetcherResult<T> | import("redux-saga/effects").CancelEffect | import("redux-saga/effects").ForkEffect<Generator<void | import("redux-saga/effects").CallEffect<true>, void, unknown>> | Promise<CollectionFetcherResult<T> | undefined>, CollectionFetcherResult<T>, (import("redux-saga").Task<any> | null) & CollectionFetcherResult<T> & (CollectionFetcherResult<T> | undefined)>, I | undefined, I[] & CollectionFetcherResult<T>>;
17
17
  _compareItem(a: I | undefined, b: I | undefined): boolean;
18
18
  _setDefaultValue(value: T | T[] | null | undefined): void;
19
19
  _setValidDefaultValue(value: T | T[] | null): void;
package/dist/index.js CHANGED
@@ -5468,7 +5468,7 @@ const ListBodyComponent = ({ autoRefresh, bodyRef, className, follow, height, it
5468
5468
  const overflow = parentRef && parentRef !== bodyRef ? 'visible' : 'auto';
5469
5469
  if (virtualItems !== undefined) {
5470
5470
  if (virtualItems.length === 0) {
5471
- if (onekijsFramework.isCollectionInitializing(service) || service.status === onekijsFramework.LoadingStatus.Fetching) {
5471
+ if ( /*isCollectionInitializing(service) || */service.status === onekijsFramework.LoadingStatus.Fetching) {
5472
5472
  return null;
5473
5473
  }
5474
5474
  if (service.status === onekijsFramework.LoadingStatus.Loading) {
@@ -6383,6 +6383,8 @@ let SelectService = class SelectService extends onekijsFramework.CollectionServi
6383
6383
  return this.state.defaultValueLoading ?? this.config?.defaultValueLoading;
6384
6384
  }
6385
6385
  *check() {
6386
+ if (!this.config?.validateValue)
6387
+ return;
6386
6388
  if (this.defaultValueLoading || (this.state.local && this.status !== onekijsFramework.LoadingStatus.Loaded)) {
6387
6389
  return; // this validation will be done when the data will be loaded (can be delayed due to a fetchOnce)
6388
6390
  }
@@ -7114,6 +7116,9 @@ const ControlledSelectComponent = ({ attachDropdownToBody = false, className = '
7114
7116
  }, [open, service, forwardBlur, setOpen, focus, clearSearch]);
7115
7117
  const onFocus = React.useCallback(() => {
7116
7118
  if (!focus) {
7119
+ if (controller.state.status === onekijsFramework.LoadingStatus.NotReady) {
7120
+ controller.initialLoad();
7121
+ }
7117
7122
  setFocus(true);
7118
7123
  if (openOnFocus && !open) {
7119
7124
  setOpen(true);
@@ -7122,7 +7127,7 @@ const ControlledSelectComponent = ({ attachDropdownToBody = false, className = '
7122
7127
  forwardFocus();
7123
7128
  }
7124
7129
  }
7125
- }, [focus, forwardFocus, openOnFocus, open]);
7130
+ }, [controller, focus, forwardFocus, openOnFocus, open]);
7126
7131
  useClickOutside(containerRef, onBlur);
7127
7132
  useFocusOutside(containerRef, onBlur);
7128
7133
  React.useEffect(() => {