@wernfried/daterangepicker 5.5.1 → 5.5.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.
@@ -2334,24 +2334,37 @@ class DateRangePicker {
2334
2334
  });
2335
2335
  }
2336
2336
  /**
2337
- * Adds an event listener to the anchor element (e.g., `<input>`) the DateRangePicker is attached to.
2338
- * This allows external code to subscribe to native DOM events such as 'click', 'focus', 'keyup', etc.
2337
+ * Adding event listener to input element where dateragnepicker is attached to.
2338
+ * Wrapper to give easy access for `addEventListener()` on DateRangePicker instance.
2339
2339
  *
2340
- * @param {string} type - The event name (e.g., 'click', 'focus', 'keyup')
2340
+ * @param {string} type - The event name, either native DOM-Event or [DateRangePicker](API_Doc.md#event) specific event
2341
2341
  * @param {function} listener - The callback function invoked when the event fires
2342
2342
  * @param {boolean|object} [options] - Optional event options:
2343
2343
  * - `boolean capture`: Whether to listen in the capture phase (default: `false`)
2344
2344
  * - `object signal`: An `AbortSignal` for later removal of the listener (default: `undefined`)
2345
2345
  *
2346
2346
  * @example
2347
- * daterangepicker.addEventListener('click', (e) => {
2348
- * console.log('Picker element was clicked', e);
2347
+ * picker.addEventListener('hide', (e) => {
2348
+ * console.log('Picker element was hidden', e);
2349
2349
  * });
2350
2350
  *
2351
2351
  */
2352
2352
  addEventListener(type, listener, options) {
2353
2353
  this.element.addEventListener(type, listener, options);
2354
2354
  }
2355
+ /**
2356
+ * Counterpart to `addEventListener()`
2357
+ * Note, `listener` most be a named function to enable remove.
2358
+ *
2359
+ * @param {string} type - The event name, either native
2360
+ * @param {function} listener - The callback function invoked when the event fires
2361
+ * @param {boolean|object} [options] - Optional event options:
2362
+ * - `boolean capture`: Whether to listen in the capture phase (default: `false`)
2363
+ * - `object signal`: An `AbortSignal` for later removal of the listener (default: `undefined`)
2364
+ */
2365
+ removeEventListener(type, listener, options) {
2366
+ this.element.removeEventListener(type, listener, options);
2367
+ }
2355
2368
  }
2356
2369
  function createElementFromHTML(html) {
2357
2370
  const template = document.createElement("template");