UNPKG

@lspriv/wc-plugin-multiple

Version:

小程序日历组件多选插件

40 lines (39 loc) 1.69 kB
import { type Plugin, type PluginService, type CalendarDay, type CalendarEventDetail, type Nullable, type TrackDateResult, type CalendarData, type DateRange, type WcDateStyle, type OnceEmiter, type TrackYearResult, type WcYear } from '@lspriv/wx-calendar/lib'; export interface MultiSelOpts { type: 'range' | 'multi'; bgColor: WcDateStyle; textColor: WcDateStyle; borderRadius: number; } export interface ChangeEventDtail { checked: Array<CalendarDay>; validDates: Array<CalendarDay | DateRange>; } type PluginDateRange = [start: CalendarDay, end: CalendarDay]; export declare class MultiPlugin implements Plugin { static KEY: "wc-plugin-multiple"; private options; private checked; private _range_; private baseStyle; private service; constructor(options?: Partial<MultiSelOpts>); private formOptions; private formBaseStyle; PLUGIN_INITIALIZE(service: PluginService): void; PLUGIN_ON_ATTACH(service: PluginService, sets: Partial<CalendarData>): void; PLUGIN_CATCH_TAP(service: PluginService): void; PLUGIN_ON_CLICK(_: PluginService, detail: CalendarEventDetail): void; PLUGIN_TRACK_DATE(date: CalendarDay): Nullable<TrackDateResult>; PLUGIN_TRACK_YEAR(year: WcYear): Nullable<TrackYearResult>; PLUGIN_ON_CHANGE(service: PluginService, detail: CalendarEventDetail, emiter: OnceEmiter): void; select(dates: PluginDateRange): void; select(dates: Array<CalendarDay>, clear: boolean): void; private dispatchSet; private updatePluginRange; private emitChange; private updateDates; private filterDates; } export declare const MULTI_PLUGIN_KEY: "wc-plugin-multiple"; export {};