Skip to content

Commit d725ad5

Browse files
committed
- BsListNavItem, BsListTile: improve route matcher
- Improved TypeScript type declarations for better type checking
1 parent 4937b9b commit d725ad5

File tree

22 files changed

+268
-78
lines changed

22 files changed

+268
-78
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Released: August XX, 2024
1111

1212
- **BsListNavItem**, **BsListTile**, **BsTab**, **BsTabItem**:
1313
- Add `path-name` and `location` properties to better accommodate the `<RouterLink>` property.
14+
- **BsListNavItem**, **BsListTile**: improve route matcher
1415

1516

1617
## v2.0.10

src/components/Alert/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
VNode,
77
VNodeProps
88
} from 'vue';
9-
import { EventClosableProps, EventUpdateModelValueProps, TIconProps, TIconVariant } from '../../../types';
9+
import { EventVoidClosableProps, EventUpdateModelValueProps, TIconProps, TIconVariant } from '../../../types';
1010

1111
export declare type TAlertOptionProps = TIconProps & {
1212
/**
@@ -57,7 +57,7 @@ export declare type TAlertOptionProps = TIconProps & {
5757
export declare type TBsAlert = ComponentObjectPropsOptions<TAlertOptionProps>;
5858

5959
declare type AllowedAlertProps = AllowedComponentProps &
60-
ComponentCustomProps & VNodeProps & EventClosableProps &
60+
ComponentCustomProps & VNodeProps & EventVoidClosableProps &
6161
EventUpdateModelValueProps<boolean>;
6262

6363
export declare const BsAlert: {

src/components/Appbar/types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export declare type TBsAppbarTitle = ComponentObjectPropsOptions<TAppbarTitleOpt
4949

5050
declare type AllowedAppbarProps = AllowedComponentProps & ComponentCustomProps & VNodeProps & {
5151
onResize?: (target: HTMLElement) => void;
52+
'@resize'?: (target: HTMLElement) => void;
5253
}
5354

5455
export declare const BsAppbar: {

src/components/Chip/types/index.d.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import {
66
VNode,
77
VNodeProps
88
} from 'vue';
9-
import { TLabelPosition } from '../../../types';
10-
import { EventClosableProps, EventUpdateModelValueProps, TIconProps } from '../../../types';
9+
import { EventUpdateModelValueProps, EventVoidClosableProps, TIconProps, TLabelPosition } from '../../../types';
1110

1211
export declare type TChipValue = {
1312
id: string;
@@ -179,14 +178,17 @@ export declare type TBsChip = ComponentObjectPropsOptions<TChipOptionProps>;
179178
export declare type TBsChipGroup = ComponentObjectPropsOptions<TChipGroupOptionProps>;
180179

181180
declare type AllowedChipProps = AllowedComponentProps & ComponentCustomProps &
182-
VNodeProps & EventClosableProps & EventUpdateModelValueProps<boolean> & {
181+
VNodeProps & EventVoidClosableProps & EventUpdateModelValueProps<boolean> & {
183182
'onUpdate:active'?: (active: boolean) => void;
183+
'@update:active'?: (active: boolean) => void;
184184
}
185185

186186
declare type AllowedChipGroupProps = AllowedComponentProps & ComponentCustomProps &
187187
VNodeProps & EventUpdateModelValueProps<TChipValue | TChipValue[] | null> & {
188188
onChange?: (newValue: TChipValue | TChipValue[] | null) => void;
189189
'onItem:close'?: (dismissedItem: TChipValue) => void;
190+
'@change'?: (newValue: TChipValue | TChipValue[] | null) => void;
191+
'@item:close'?: (dismissedItem: TChipValue) => void;
190192
}
191193

192194
export declare const BsChip: {

src/components/ColorPicker/types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export declare type TBsColorPicker = ComponentObjectPropsOptions<TColorPickerOpt
120120
declare type AllowedColorPickerProps = AllowedComponentProps & ComponentCustomProps &
121121
VNodeProps & EventUpdateOpenProps & EventUpdateModelValueProps<string> & {
122122
'onUpdate:mode'?: (mode: TColorPickerMode) => void;
123+
'@update:mode'?: (mode: TColorPickerMode) => void;
123124
}
124125

125126
export declare const BsColorPicker: {

src/components/Combobox/types/index.d.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
VNodeProps
88
} from 'vue';
99
import {
10-
EventClosableProps,
1110
EventUpdateModelValueProps,
11+
EventVoidClosableProps,
1212
IBsModel,
1313
TDataSource,
1414
TInputFieldProps,
@@ -154,7 +154,7 @@ export declare type TComboboxOptionProps = TInputFieldProps & {
154154
export declare type TBsCombobox = ComponentObjectPropsOptions<TComboboxOptionProps>;
155155

156156
declare type AllowedComboboxProps = AllowedComponentProps &
157-
ComponentCustomProps & VNodeProps & EventClosableProps &
157+
ComponentCustomProps & VNodeProps & EventVoidClosableProps &
158158
EventUpdateModelValueProps<string | number | string[] | number[] | undefined> & {
159159
onClear?: VoidFunction;
160160
onOpen?: VoidFunction;
@@ -164,6 +164,14 @@ declare type AllowedComboboxProps = AllowedComponentProps &
164164
onDataError?: (error: unknown) => void;
165165
onDataFilter?: (data: IBsModel[]) => void;
166166
'onUpdate:selected-value'?: (selected: IBsModel[]) => void;
167+
'@clear'?: VoidFunction;
168+
'@open'?: VoidFunction;
169+
'@select'?: (item: IBsModel) => void;
170+
'@deselect'?: (item: IBsModel) => void;
171+
'@data-bind'?: (data: IBsModel[]) => void;
172+
'@data-error'?: (error: unknown) => void;
173+
'@data-filter'?: (data: IBsModel[]) => void;
174+
'@update:selected-value'?: (selected: IBsModel[]) => void;
167175
}
168176

169177
export declare const BsCombobox: {

src/components/Container/types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export declare type TBsContent = ComponentObjectPropsOptions<TContainerOptionPro
3838

3939
export declare type AllowedContainerProps = AllowedComponentProps & ComponentCustomProps & VNodeProps & {
4040
onResize?: (target: HTMLElement) => void;
41+
'@resize'?: (target: HTMLElement) => void;
4142
}
4243

4344
export declare const BsAppContainer: {

src/components/DatePicker/types/index.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
VNodeProps
88
} from 'vue';
99
import {
10-
EventClosableProps,
1110
EventUpdateModelValueProps,
11+
EventVoidClosableProps,
1212
TInputFieldProps,
1313
TPopoverPosition
1414
} from '../../../types';
@@ -201,11 +201,15 @@ declare type AllowedDatePickerProps = AllowedComponentProps & ComponentCustomPro
201201
VNodeProps & EventUpdateModelValueProps<string>;
202202

203203
declare type AllowedDateTimeFieldProps = AllowedComponentProps & ComponentCustomProps & VNodeProps &
204-
EventClosableProps & EventUpdateModelValueProps<string> & {
204+
EventVoidClosableProps & EventUpdateModelValueProps<string> & {
205205
onBlur?: (event: Event) => void;
206206
onFocus?: (event: Event) => void;
207207
onClear?: VoidFunction;
208208
onOpen?: VoidFunction;
209+
'@blur'?: (event: Event) => void;
210+
'@focus'?: (event: Event) => void;
211+
'@clear'?: VoidFunction;
212+
'@open'?: VoidFunction;
209213
}
210214

211215
export declare const BsDatePicker: {

src/components/Drawer/types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ declare type AllowedSideDrawerProps = AllowedComponentProps &
3232
VNodeProps &
3333
EventUpdateOpenProps & {
3434
onResize?: (target: HTMLElement) => void;
35+
'@resize'?: (target: HTMLElement) => void;
3536
};
3637

3738
export declare const BsSideDrawer: {

src/components/Field/types/index.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,10 @@ declare type AllowedTextFieldProps = AllowedComponentProps & ComponentCustomProp
366366
onClear?: VoidFunction;
367367
onFocus?: EventListener;
368368
onKeydown?: EventListener;
369+
'@blur'?: EventListener;
370+
'@clear'?: VoidFunction;
371+
'@focus'?: EventListener;
372+
'@keydown'?: EventListener;
369373
}
370374

371375
export declare const BsTextField: {
@@ -447,6 +451,11 @@ declare type AllowedChipFieldProps = AllowedComponentProps & ComponentCustomProp
447451
onFocus?: EventListener;
448452
onKeydown?: EventListener;
449453
'onDelete-item'?: (deletedItem: string) => void;
454+
'@blur'?: EventListener;
455+
'@clear'?: VoidFunction;
456+
'@focus'?: EventListener;
457+
'@keydown'?: EventListener;
458+
'@delete-item'?: (deletedItem: string) => void;
450459
}
451460

452461
export declare const BsChipField: {
@@ -495,6 +504,10 @@ declare type AllowedNumericFieldProps = AllowedComponentProps & ComponentCustomP
495504
onClear?: VoidFunction;
496505
onFocus?: EventListener;
497506
onKeydown?: EventListener;
507+
'@blur'?: EventListener;
508+
'@clear'?: VoidFunction;
509+
'@focus'?: EventListener;
510+
'@keydown'?: EventListener;
498511
}
499512

500513
export declare const BsNumericField: {
@@ -541,6 +554,12 @@ declare type AllowedSearchFieldProps = AllowedComponentProps & ComponentCustomPr
541554
onOpen?: VoidFunction;
542555
onFocus?: EventListener;
543556
onSearch?: (value: string) => void;
557+
'@blur'?: EventListener;
558+
'@clear'?: VoidFunction;
559+
'@close'?: VoidFunction;
560+
'@open'?: VoidFunction;
561+
'@focus'?: EventListener;
562+
'@search'?: (value: string) => void;
544563
}
545564

546565
export declare const BsSearchField: {

0 commit comments

Comments
 (0)