@rebilly/revel 10.0.9 → 10.0.11

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.9](https://github.com/Rebilly/rebilly/compare/revel-v10.0.8...revel-v10.0.9) (2025-08-01)
1
+ ## [10.0.11](https://github.com/Rebilly/rebilly/compare/revel-v10.0.10...revel-v10.0.11) (2025-08-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **revel:** Fix r-date-input clearing behaviour ([#14020](https://github.com/Rebilly/rebilly/issues/14020)) ([c8d5038](https://github.com/Rebilly/rebilly/commit/c8d5038603b91bb265e9c7aa389230ade632d6b4))
@@ -3,7 +3,7 @@ interface Props {
3
3
  /**
4
4
  * Date value
5
5
  */
6
- modelValue?: Date | string;
6
+ modelValue?: Date | string | null;
7
7
  /**
8
8
  * Disable
9
9
  */
@@ -24,15 +24,19 @@ interface Props {
24
24
  * Masks are used to properly format and parse different sections of the calendar and date picker components.
25
25
  */
26
26
  masks?: object;
27
+ /**
28
+ * Whether the value can be null
29
+ */
30
+ allowEmpty?: boolean;
27
31
  }
28
32
  declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
29
- "update:modelValue": (value: string | Date) => any;
33
+ "update:modelValue": (value: string | Date | null) => any;
30
34
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
31
- "onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
35
+ "onUpdate:modelValue"?: ((value: string | Date | null) => any) | undefined;
32
36
  }>, {
33
37
  type: string;
34
38
  disabled: boolean;
35
- modelValue: Date | string;
39
+ modelValue: Date | string | null;
36
40
  timezone: string;
37
41
  modelConfig: object;
38
42
  masks: object;
@@ -17,7 +17,7 @@ interface Props {
17
17
  * Used to specify selected dates
18
18
  * @model
19
19
  */
20
- modelValue?: Date | object | string;
20
+ modelValue?: Date | object | string | null;
21
21
  /**
22
22
  * Disable
23
23
  */
@@ -83,11 +83,15 @@ interface Props {
83
83
  * Masks are used to properly format and parse different sections of the calendar and date picker components.
84
84
  */
85
85
  masks?: object;
86
+ /**
87
+ * Whether the value can be null for single date inputs
88
+ */
89
+ allowEmpty?: boolean;
86
90
  }
87
91
  declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
88
- "update:modelValue": (value: string | Date | DateRange) => any;
92
+ "update:modelValue": (value: string | Date | DateRange | null) => any;
89
93
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
90
- "onUpdate:modelValue"?: ((value: string | Date | DateRange) => any) | undefined;
94
+ "onUpdate:modelValue"?: ((value: string | Date | DateRange | null) => any) | undefined;
91
95
  }>, {
92
96
  columns: number;
93
97
  id: string;
@@ -95,19 +99,19 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
95
99
  label: string;
96
100
  type: string;
97
101
  disabled: boolean;
98
- modelValue: Date | object | string;
102
+ modelValue: Date | object | string | null;
99
103
  validate: Nullable<ValidationState>;
100
104
  placement: string;
101
105
  timezone: string;
102
106
  masks: object;
107
+ is24hr: boolean;
108
+ hideTimeHeader: boolean;
109
+ locale: string;
110
+ minDate: Date | string | object;
111
+ maxDate: Date | string | object;
103
112
  placeholder: string;
104
113
  timePicker: boolean;
105
- is24hr: boolean;
106
114
  showValidateMessages: boolean;
107
115
  availableDates: object;
108
- minDate: Date | string | object;
109
- maxDate: Date | string | object;
110
- hideTimeHeader: boolean;
111
- locale: string;
112
116
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
113
117
  export default _default;
@@ -41,10 +41,10 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
41
41
  disabled: boolean;
42
42
  modelValue: DateRange | string;
43
43
  timezone: string;
44
+ is24hr: boolean;
44
45
  placeholder: string;
45
46
  calendarToggle: () => void;
46
47
  timePicker: boolean;
47
- is24hr: boolean;
48
48
  showPresets: boolean;
49
49
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
50
50
  export default _default;
@@ -36,8 +36,8 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
36
36
  disabled: boolean;
37
37
  modelValue: Date | string | DateRange;
38
38
  timezone: string;
39
+ is24hr: boolean;
39
40
  placeholder: string;
40
41
  timePicker: boolean;
41
- is24hr: boolean;
42
42
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
43
  export default _default;
@@ -10,21 +10,21 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {
10
10
  blur: (...args: any[]) => void;
11
11
  focus: (...args: any[]) => void;
12
12
  "update:modelValue": (...args: any[]) => void;
13
+ "right-icon-click": (...args: any[]) => void;
13
14
  "key-press": (...args: any[]) => void;
14
15
  "key-down": (...args: any[]) => void;
15
16
  "key-submit": (...args: any[]) => void;
16
17
  "left-icon-click": (...args: any[]) => void;
17
- "right-icon-click": (...args: any[]) => void;
18
18
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
19
19
  onClick?: ((...args: any[]) => any) | undefined;
20
20
  onBlur?: ((...args: any[]) => any) | undefined;
21
21
  onFocus?: ((...args: any[]) => any) | undefined;
22
22
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
23
+ "onRight-icon-click"?: ((...args: any[]) => any) | undefined;
23
24
  "onKey-press"?: ((...args: any[]) => any) | undefined;
24
25
  "onKey-down"?: ((...args: any[]) => any) | undefined;
25
26
  "onKey-submit"?: ((...args: any[]) => any) | undefined;
26
27
  "onLeft-icon-click"?: ((...args: any[]) => any) | undefined;
27
- "onRight-icon-click"?: ((...args: any[]) => any) | undefined;
28
28
  }>, {
29
29
  label: Nullable<string>;
30
30
  modelValue: Nullable<string | number | boolean>;
@@ -1,5 +1,5 @@
1
1
  import type { CreateComponentPublicInstance } from 'vue';
2
- import type { Query, Value, CacheItem, Methods, AsyncSearchFn, Options } from './types';
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 methodsmap;
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
- private static findMethodTypes;
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: Methods;
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(type: Methods, value: Value, params?: Partial<Query>): Promise<void>;
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, type, options, value, query, }: {
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(): {} | null | undefined;
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(): {} | null | undefined;
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
- }): {} | null | undefined;
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;
@@ -716,6 +723,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
716
723
  disabled: boolean;
717
724
  modelValue: Nullable<OptionItem | Options>;
718
725
  validate: ValidationState;
726
+ allowEmpty: boolean;
719
727
  placeholder: string;
720
728
  showValidateMessages: boolean;
721
729
  name: string;
@@ -724,10 +732,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
724
732
  autocomplete: string;
725
733
  tabindex: number;
726
734
  limit: number;
727
- asyncGetInitValue: AsyncSearchFn;
728
735
  asyncFind: AsyncSearchFn;
729
736
  options: Options;
730
- allowEmpty: boolean;
731
737
  blockKeys: string[];
732
738
  clearOnSelect: boolean;
733
739
  closeOnSelect: 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
  }