timepicker-ui 4.2.0 → 4.2.2

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/README.md CHANGED
@@ -7,7 +7,7 @@ Modern time picker library built with TypeScript. Works with any framework or va
7
7
  [![license](https://img.shields.io/badge/license-MIT-green.svg)](https://img.shields.io/npm/l/timepicker-ui)
8
8
  [![Coverage Status](https://coveralls.io/repos/github/pglejzer/timepicker-ui/badge.svg?branch=main)](https://coveralls.io/github/pglejzer/timepicker-ui?branch=main)
9
9
  [![Tests](https://github.com/pglejzer/timepicker-ui/actions/workflows/tests.yml/badge.svg)](https://github.com/pglejzer/timepicker-ui/actions/workflows/tests.yml)
10
- [![Socket Badge](https://badge.socket.dev/npm/package/timepicker-ui/4.2.0)](https://badge.socket.dev/npm/package/timepicker-ui/4.2.0)
10
+ [![Socket Badge](https://badge.socket.dev/npm/package/timepicker-ui/4.2.2)](https://badge.socket.dev/npm/package/timepicker-ui/4.2.2)
11
11
 
12
12
  [Live Demo](https://timepicker-ui.vercel.app/) • [Documentation](https://timepicker-ui.vercel.app/docs) • [React Wrapper](https://github.com/pglejzer/timepicker-ui-react) • [Changelog](./CHANGELOG.md)
13
13
 
@@ -161,6 +161,7 @@ const picker = new TimepickerUI(input, {
161
161
  behavior: BehaviorOptions, // Behavior (focus, delays, ID)
162
162
  callbacks: CallbacksOptions, // Event handlers
163
163
  clearBehavior: ClearBehaviorOptions, // Clear button behavior
164
+ wheel: WheelOptions, // Wheel/compact-wheel mode configuration
164
165
  });
165
166
  ```
166
167
 
@@ -194,7 +195,7 @@ const picker = new TimepickerUI(input, {
194
195
  | `inline` | object | `undefined` | Inline mode configuration |
195
196
  | `clearButton` | boolean | `false` | Show clear button |
196
197
  | `mode` | `clock` / `wheel` / `compact-wheel` | `clock` | Picker mode - analog clock, scroll-spinner, or headerless wheel |
197
- | `wheel` | object | `undefined` | Wheel/compact-wheel config (placement, hideFooter, commitOnScroll) |
198
+ | `wheel` | `WheelOptions` | `undefined` | Wheel/compact-wheel config (placement, hideFooter, commitOnScroll) |
198
199
 
199
200
  ### Labels Options
200
201
 
@@ -225,6 +226,16 @@ const picker = new TimepickerUI(input, {
225
226
  | ------------ | ------- | ------- | --------------------------------------- |
226
227
  | `clearInput` | boolean | `true` | Whether clearing also empties the input |
227
228
 
229
+ ### Wheel Options
230
+
231
+ | Property | Type | Default | Description |
232
+ | -------------------- | ------------------------- | ------- | -------------------------------------------------------------------- |
233
+ | `placement` | `auto` / `top` / `bottom` | `auto` | Popover placement in compact-wheel mode |
234
+ | `hideFooter` | boolean | `false` | Hide OK/Cancel/Clear buttons — useful with `commitOnScroll` |
235
+ | `commitOnScroll` | boolean | `false` | Auto-confirm time at end of scroll without pressing OK |
236
+ | `hideDisabled` | boolean | `false` | Remove disabled values from list instead of dimming them |
237
+ | `ignoreOutsideClick` | boolean | `false` | Prevent picker from closing when clicking outside (wheel modes only) |
238
+
228
239
  ### Callbacks Options
229
240
 
230
241
  | Property | Type | Description |
package/dist/index.d.ts CHANGED
@@ -908,21 +908,21 @@ declare class TimepickerUI {
908
908
  * @param handler - The function to handle the event.
909
909
  * @returns - void
910
910
  */
911
- on<K extends keyof TimepickerEventMap>(event: K, handler: () => void): void;
911
+ on<K extends keyof TimepickerEventMap>(event: K, handler: (data: TimepickerEventMap[K]) => void): void;
912
912
  /**
913
913
  * Subscribe to a timepicker event with a handler function that will be called only once.
914
914
  * @param event - The name of the event to subscribe to.
915
915
  * @param handler - The function to handle the event.
916
916
  * @returns - void
917
917
  */
918
- once<K extends keyof TimepickerEventMap>(event: K, handler: () => void): void;
918
+ once<K extends keyof TimepickerEventMap>(event: K, handler: (data: TimepickerEventMap[K]) => void): void;
919
919
  /**
920
920
  * Unsubscribe from a timepicker event. If a handler is provided, only that handler will be removed. If no handler is provided, all handlers for the event will be removed.
921
921
  * @param event - The name of the event to unsubscribe from.
922
922
  * @param handler - The function to handle the event.
923
923
  * @returns - void
924
924
  */
925
- off<K extends keyof TimepickerEventMap>(event: K, handler?: () => void): void;
925
+ off<K extends keyof TimepickerEventMap>(event: K, handler?: (data: TimepickerEventMap[K]) => void): void;
926
926
  private resolveInputElement;
927
927
  private createWrapperElement;
928
928
  /**
@@ -1054,4 +1054,4 @@ declare class PluginRegistryClass {
1054
1054
  declare const PluginRegistry: PluginRegistryClass;
1055
1055
 
1056
1056
  export { CoreState, EventEmitter, PluginRegistry, TimepickerUI, TimepickerUI as default };
1057
- export type { BehaviorOptions, CallbacksOptions, CancelEventData, ClearBehaviorOptions, ClearEventData, ClockOptions, ConfirmEventData, ErrorEventData, HideEventData, LabelsOptions, OpenEventData, OptionTypes, Plugin, PluginFactory, PluginManager, RangeConfirmEventData, RangeOptions, RangeSwitchEventData, RangeValidationEventData, SelectAMEventData, SelectHourEventData, SelectMinuteEventData, SelectPMEventData, ShowEventData, SwitchViewEventData, TimepickerEventMap, TimepickerOptions, TimezoneChangeEventData, TimezoneOptions, UIOptions, UpdateEventData, WheelScrollEndEventData, WheelScrollStartEventData };
1057
+ export type { BehaviorOptions, CallbacksOptions, CancelEventData, ClearBehaviorOptions, ClearEventData, ClockOptions, ConfirmEventData, ErrorEventData, HideEventData, LabelsOptions, OpenEventData, OptionTypes, Plugin, PluginFactory, PluginManager, RangeConfirmEventData, RangeOptions, RangeSwitchEventData, RangeValidationEventData, SelectAMEventData, SelectHourEventData, SelectMinuteEventData, SelectPMEventData, ShowEventData, SwitchViewEventData, TimepickerEventMap, TimepickerOptions, TimezoneChangeEventData, TimezoneOptions, UIOptions, UpdateEventData, WheelOptions, WheelScrollEndEventData, WheelScrollStartEventData };
@@ -5,7 +5,7 @@ interface PluginManager {
5
5
 
6
6
  interface PluginDefinition {
7
7
  name: string;
8
- factory: (core: never, emitter: never) => PluginManager;
8
+ factory: (core: any, emitter: any) => PluginManager;
9
9
  optionsExtender?: (options: Record<string, unknown>) => void;
10
10
  }
11
11
 
@@ -5,7 +5,7 @@ interface PluginManager {
5
5
 
6
6
  interface PluginDefinition {
7
7
  name: string;
8
- factory: (core: never, emitter: never) => PluginManager;
8
+ factory: (core: any, emitter: any) => PluginManager;
9
9
  optionsExtender?: (options: Record<string, unknown>) => void;
10
10
  }
11
11
 
@@ -5,7 +5,7 @@ interface PluginManager {
5
5
 
6
6
  interface PluginDefinition {
7
7
  name: string;
8
- factory: (core: never, emitter: never) => PluginManager;
8
+ factory: (core: any, emitter: any) => PluginManager;
9
9
  optionsExtender?: (options: Record<string, unknown>) => void;
10
10
  }
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "timepicker-ui",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "timepicker-ui is a customizable time picker library built with TypeScript, inspired by Google's Material Design. Lightweight, themeable, and easy to integrate.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",