Skip to content

Commit

Permalink
fix(Date Picker): update global.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Cata1989 committed Jun 4, 2024
1 parent a5f6bb2 commit f38cbec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions packages/beeq/src/components/date-picker/bq-date-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,6 @@ export class BqDatePicker {
firstDayOfWeek={this.firstDayOfWeek}
showOutsideDays={this.showOutsideDays}
onChange={this.handleCalendarChange}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
onRangestart={this.handleCalendarRangeStart}
onRangeend={this.handleCalendarRangeEnd}
exportparts="container,header,button,previous,next,disabled,heading"
Expand Down
8 changes: 7 additions & 1 deletion packages/beeq/src/global/scripts/global.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import 'cally';
import type { JSXBase } from '@stencil/core/internal';
import type { CalendarDateProps, CalendarMonthProps, CalendarMultiProps, CalendarRangeProps } from 'cally';

type EventName<T> = T extends `on${infer Rest}` ? `on${Capitalize<Lowercase<Rest>>}` : T;
type MapEvents<T> = {
[K in keyof T as EventName<K>]: T[K];
};

declare module '@stencil/core' {
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace JSX {
interface IntrinsicElements {
'calendar-multi': CalendarMultiProps & JSXBase.HTMLAttributes<CalendarMultiProps>;
'calendar-range': CalendarRangeProps & JSXBase.HTMLAttributes<CalendarDateProps>;
'calendar-range': MapEvents<CalendarRangeProps> & JSXBase.HTMLAttributes<CalendarDateProps>;
'calendar-date': CalendarDateProps & JSXBase.HTMLAttributes<CalendarDateProps>;
'calendar-month': CalendarMonthProps & JSXBase.HTMLAttributes<CalendarMonthProps>;
}
Expand Down

0 comments on commit f38cbec

Please sign in to comment.