@rebilly/revel 10.0.9 → 10.0.10
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/CHANGELOG.md
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
## [10.0.
|
|
1
|
+
## [10.0.10](https://github.com/Rebilly/rebilly/compare/revel-v10.0.9...revel-v10.0.10) (2025-08-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **revel,docs:** display single preselected value on revel select when using async functionality ([#13936](https://github.com/Rebilly/rebilly/issues/13936)) ([0612ecb](https://github.com/Rebilly/rebilly/commit/0612ecb5f6f143d44988b44dda04885f07e92143))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CreateComponentPublicInstance } from 'vue';
|
|
2
|
-
import type { Query, Value, CacheItem,
|
|
2
|
+
import type { Query, Value, CacheItem, AsyncSearchFn, Options } from './types';
|
|
3
3
|
export type CacheValuePrefix = (value: unknown) => string;
|
|
4
4
|
export interface Config {
|
|
5
5
|
limit: number;
|
|
@@ -24,7 +24,6 @@ export interface Component extends CreateComponentPublicInstance {
|
|
|
24
24
|
interface ConstructorPayload {
|
|
25
25
|
component: Component;
|
|
26
26
|
config: Config;
|
|
27
|
-
asyncGetInitValue: AsyncSearchFn;
|
|
28
27
|
asyncFind: AsyncSearchFn;
|
|
29
28
|
prepareCacheValuePrefix: CacheValuePrefix;
|
|
30
29
|
}
|
|
@@ -32,20 +31,18 @@ export declare class AsyncExtension {
|
|
|
32
31
|
private component;
|
|
33
32
|
private config;
|
|
34
33
|
private prepareCacheValuePrefix;
|
|
35
|
-
private
|
|
34
|
+
private asyncFind;
|
|
36
35
|
private cache;
|
|
37
36
|
private query;
|
|
38
37
|
isLoading: boolean;
|
|
39
|
-
findByValue: (value: Value) => Promise<void>;
|
|
40
38
|
findBySearch: (value: Value) => Promise<void>;
|
|
41
39
|
loadMore: (count: number) => Promise<void>;
|
|
42
40
|
loadByQuery: (query: Partial<Query>) => Promise<void>;
|
|
43
41
|
private static defaultConfig;
|
|
44
|
-
|
|
45
|
-
constructor({ component, config, asyncGetInitValue, asyncFind, prepareCacheValuePrefix, }: ConstructorPayload);
|
|
42
|
+
constructor({ component, config, asyncFind, prepareCacheValuePrefix, }: ConstructorPayload);
|
|
46
43
|
static prepareConfig(config: Config): Config;
|
|
47
44
|
static makeCacheKey({ type, value, limit, offset, }: {
|
|
48
|
-
type:
|
|
45
|
+
type: string;
|
|
49
46
|
value: string;
|
|
50
47
|
limit: number;
|
|
51
48
|
offset: number;
|
|
@@ -69,8 +66,7 @@ export declare class AsyncExtension {
|
|
|
69
66
|
getLimit(): number;
|
|
70
67
|
/** Returns true if last request has any options. */
|
|
71
68
|
hasOptions(): boolean;
|
|
72
|
-
find(
|
|
73
|
-
private baseFindByValue;
|
|
69
|
+
find(value: Value, params?: Partial<Query>): Promise<void>;
|
|
74
70
|
private baseFindBySearch;
|
|
75
71
|
findNext(): Promise<void>;
|
|
76
72
|
findPrev(): Promise<void>;
|
|
@@ -78,9 +74,8 @@ export declare class AsyncExtension {
|
|
|
78
74
|
baseLoadByQuery({ limit, offset }: Partial<Query>): Promise<void>;
|
|
79
75
|
getFromCache(key: Nullable<string>): CacheItem | undefined;
|
|
80
76
|
getAllCacheItems(): CacheItem[];
|
|
81
|
-
saveToCache({ key,
|
|
77
|
+
saveToCache({ key, options, value, query, }: {
|
|
82
78
|
key: string;
|
|
83
|
-
type: Methods;
|
|
84
79
|
options: Options;
|
|
85
80
|
value: Value;
|
|
86
81
|
query: Query;
|
|
@@ -304,10 +304,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
304
304
|
type: PropType<Nullable<Options | OptionItem>>;
|
|
305
305
|
default(): never[];
|
|
306
306
|
};
|
|
307
|
-
asyncGetInitValue: {
|
|
308
|
-
type: PropType<AsyncSearchFn>;
|
|
309
|
-
default: null;
|
|
310
|
-
};
|
|
311
307
|
asyncFind: {
|
|
312
308
|
type: PropType<AsyncSearchFn>;
|
|
313
309
|
default: null;
|
|
@@ -320,6 +316,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
320
316
|
type: StringConstructor;
|
|
321
317
|
default: string;
|
|
322
318
|
};
|
|
319
|
+
/**
|
|
320
|
+
* Used to receive object in update:modelValue event, but not just the option key
|
|
321
|
+
*/
|
|
322
|
+
trackAsyncUpdatesByObject: {
|
|
323
|
+
type: BooleanConstructor;
|
|
324
|
+
default: boolean;
|
|
325
|
+
};
|
|
323
326
|
}>, {
|
|
324
327
|
searchElement: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
325
328
|
tagsElement: import("vue").Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
@@ -330,7 +333,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
330
333
|
computedLabel(): string;
|
|
331
334
|
computedOptions(): Options;
|
|
332
335
|
computedTrackBy(): string;
|
|
333
|
-
computedValue():
|
|
336
|
+
computedValue(): unknown;
|
|
334
337
|
contentStyle(): {
|
|
335
338
|
display: string;
|
|
336
339
|
minWidth: string;
|
|
@@ -353,20 +356,20 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
353
356
|
isSingleLabelVisible(): boolean;
|
|
354
357
|
optionKeys(): string[];
|
|
355
358
|
pointerPosition(): number;
|
|
356
|
-
primitiveValue():
|
|
359
|
+
primitiveValue(): unknown;
|
|
357
360
|
singleValue(): OptionItem;
|
|
358
361
|
valueKeys(): unknown[];
|
|
359
362
|
visibleElements(): number;
|
|
360
363
|
visibleValues(): OptionItem[];
|
|
361
364
|
computedIsAsync(): boolean;
|
|
362
365
|
computedIsLoading(): boolean;
|
|
363
|
-
computedValueProps(): any;
|
|
364
366
|
computedAsyncLastOptions(): Options | undefined;
|
|
365
367
|
computedAsyncHasOptions(): boolean;
|
|
366
368
|
computedAsyncHasPrevOptions(): boolean;
|
|
367
369
|
computedAsyncHasNextOptions(): boolean;
|
|
368
370
|
displayNoResultsMessage(): boolean;
|
|
369
371
|
showRemoveIcon(): boolean;
|
|
372
|
+
displayAsyncLoadingForPreselectedValue(): boolean;
|
|
370
373
|
}, {
|
|
371
374
|
activate(): void;
|
|
372
375
|
addPointerElement({ key }: KeyboardEvent): void;
|
|
@@ -374,11 +377,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
374
377
|
deactivate(): void;
|
|
375
378
|
getOptionLabel(option: Nullable<OptionItem>): string | boolean | undefined;
|
|
376
379
|
getOptionValue(option: Nullable<OptionItem>): unknown;
|
|
380
|
+
getSingleModelValue(option: Nullable<OptionItem>): unknown;
|
|
377
381
|
getPrimitiveValueFromValue({ value, trackBy, multiple, }: {
|
|
378
382
|
value: unknown;
|
|
379
383
|
trackBy: string;
|
|
380
384
|
multiple: boolean;
|
|
381
|
-
}):
|
|
385
|
+
}): unknown;
|
|
382
386
|
getValue(): OptionItem | Options | null;
|
|
383
387
|
isExistingOption(query: string): boolean;
|
|
384
388
|
isSelected(option: OptionItem): boolean;
|
|
@@ -684,10 +688,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
684
688
|
type: PropType<Nullable<Options | OptionItem>>;
|
|
685
689
|
default(): never[];
|
|
686
690
|
};
|
|
687
|
-
asyncGetInitValue: {
|
|
688
|
-
type: PropType<AsyncSearchFn>;
|
|
689
|
-
default: null;
|
|
690
|
-
};
|
|
691
691
|
asyncFind: {
|
|
692
692
|
type: PropType<AsyncSearchFn>;
|
|
693
693
|
default: null;
|
|
@@ -700,6 +700,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
700
700
|
type: StringConstructor;
|
|
701
701
|
default: string;
|
|
702
702
|
};
|
|
703
|
+
/**
|
|
704
|
+
* Used to receive object in update:modelValue event, but not just the option key
|
|
705
|
+
*/
|
|
706
|
+
trackAsyncUpdatesByObject: {
|
|
707
|
+
type: BooleanConstructor;
|
|
708
|
+
default: boolean;
|
|
709
|
+
};
|
|
703
710
|
}>> & Readonly<{
|
|
704
711
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
705
712
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -724,7 +731,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
724
731
|
autocomplete: string;
|
|
725
732
|
tabindex: number;
|
|
726
733
|
limit: number;
|
|
727
|
-
asyncGetInitValue: AsyncSearchFn;
|
|
728
734
|
asyncFind: AsyncSearchFn;
|
|
729
735
|
options: Options;
|
|
730
736
|
allowEmpty: boolean;
|
|
@@ -754,6 +760,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
754
760
|
tagValidator: TagValidatorFn;
|
|
755
761
|
asyncConfig: Config;
|
|
756
762
|
asyncValuePropsKey: string;
|
|
763
|
+
trackAsyncUpdatesByObject: boolean;
|
|
757
764
|
}, {}, {
|
|
758
765
|
RIcon: import("vue").DefineComponent<import("../r-icon/r-icon.vue").Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
759
766
|
click: () => any;
|
|
@@ -12,18 +12,11 @@ export type OptionItem = ComplexOptionItem | string | number | boolean;
|
|
|
12
12
|
export type Options = OptionItem[];
|
|
13
13
|
export type Value = number | string;
|
|
14
14
|
export type AsyncSearchFn = (value: Value, query: Query) => Promise<Options>;
|
|
15
|
-
export interface Methodmap {
|
|
16
|
-
bySearchInput: AsyncSearchFn;
|
|
17
|
-
byValue: AsyncSearchFn;
|
|
18
|
-
}
|
|
19
|
-
export type Methods = keyof Methodmap;
|
|
20
15
|
export interface CacheItem {
|
|
21
16
|
created: number;
|
|
22
17
|
key: string;
|
|
23
|
-
type: Methods;
|
|
24
18
|
options?: Options;
|
|
25
19
|
value: Value;
|
|
26
20
|
query: Query;
|
|
27
21
|
isSearch: boolean;
|
|
28
|
-
isValue: boolean;
|
|
29
22
|
}
|