@vaadin/component-base 25.2.11 → 25.2.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/component-base",
3
- "version": "25.2.11",
3
+ "version": "25.2.13",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,11 +38,11 @@
38
38
  "lit": "^3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@vaadin/chai-plugins": "~25.2.11",
42
- "@vaadin/test-runner-commands": "~25.2.11",
41
+ "@vaadin/chai-plugins": "~25.2.13",
42
+ "@vaadin/test-runner-commands": "~25.2.13",
43
43
  "@vaadin/testing-helpers": "^2.0.0",
44
44
  "sinon": "^22.0.0"
45
45
  },
46
46
  "customElements": "custom-elements.json",
47
- "gitHead": "6b08306ffb11c5c7665b0af8050e4368e0c44a5a"
47
+ "gitHead": "601112f027fb53668eed85f9593fa6fe5222fa00"
48
48
  }
package/src/define.js CHANGED
@@ -13,7 +13,7 @@ function dashToCamelCase(dash) {
13
13
 
14
14
  const experimentalMap = {};
15
15
 
16
- export function defineCustomElement(CustomElement, version = '25.2.11') {
16
+ export function defineCustomElement(CustomElement, version = '25.2.13') {
17
17
  Object.defineProperty(CustomElement, 'version', {
18
18
  get() {
19
19
  return version;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2026 - 2026 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+
7
+ /**
8
+ * Marks the event as consumed by a component, e.g. a click that closed an overlay.
9
+ * Unlike `preventDefault()`, this does not cancel the default action of the event.
10
+ */
11
+ export declare function markEventConsumed(event: Event): void;
12
+
13
+ /**
14
+ * Returns true if the event was marked as consumed with `markEventConsumed()`.
15
+ * Only check it where a click that closed an overlay must be ignored, e.g. a backdrop.
16
+ * Do not use it in regular click handlers, so that synthetic clicks keep working.
17
+ */
18
+ export declare function isEventConsumed(event: Event): boolean;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2026 - 2026 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+
7
+ const consumedEvents = new WeakSet();
8
+
9
+ /**
10
+ * Marks the event as consumed by a component, e.g. a click that closed an overlay.
11
+ * Unlike `preventDefault()`, this does not cancel the default action of the event.
12
+ *
13
+ * @param {Event} event
14
+ */
15
+ export function markEventConsumed(event) {
16
+ consumedEvents.add(event);
17
+ }
18
+
19
+ /**
20
+ * Returns true if the event was marked as consumed with `markEventConsumed()`.
21
+ * Only check it where a click that closed an overlay must be ignored, e.g. a backdrop.
22
+ * Do not use it in regular click handlers, so that synthetic clicks keep working.
23
+ *
24
+ * @param {Event} event
25
+ * @return {boolean}
26
+ */
27
+ export function isEventConsumed(event) {
28
+ return consumedEvents.has(event);
29
+ }