@mintjamsinc/ichigojs 0.1.65 → 0.1.67

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.
@@ -39,6 +39,13 @@ export interface VApplicationOptions {
39
39
  * and the value is either a callback function or an options object with handler, deep, and immediate properties.
40
40
  */
41
41
  watch?: WatcherDictionary;
42
+ /**
43
+ * Optional list of event names this application/component is expected to emit via `$emit`.
44
+ * When declared, emitting an event whose name is not in this list logs a development warning.
45
+ * When omitted, `$emit` accepts any event name without warning. This is documentation/validation
46
+ * only and never blocks dispatch.
47
+ */
48
+ emits?: string[];
42
49
  /**
43
50
  * The log level for the application.
44
51
  * This property determines the verbosity of logging output.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Options for `$emit`, controlling how the underlying CustomEvent is dispatched.
3
+ */
4
+ export interface VEmitOptions {
5
+ /**
6
+ * Whether the event bubbles up through the DOM. Default is true.
7
+ * Bubbling lets a parent component listen with `v-on` / `@` on the component tag,
8
+ * because the application root is dispatched from inside the host custom element.
9
+ */
10
+ bubbles?: boolean;
11
+ /**
12
+ * Whether the event is cancelable (i.e. `preventDefault()` has an effect).
13
+ * Default is true. `$emit` returns false when a listener called `preventDefault()`.
14
+ */
15
+ cancelable?: boolean;
16
+ /**
17
+ * Whether the event propagates across shadow DOM boundaries. Default is false.
18
+ * ichigo.js components use Light DOM, so this is rarely needed.
19
+ */
20
+ composed?: boolean;
21
+ /**
22
+ * The target the event is dispatched on. Defaults to the application root element.
23
+ * Set this to `document` or `window` to use a global event bus, or to a specific
24
+ * element for element-scoped dispatch.
25
+ */
26
+ target?: EventTarget;
27
+ }
@@ -18,6 +18,15 @@ import { VDOMUpdater } from "../VDOMUpdater";
18
18
  * Mouse button modifiers (MouseEvent): `.left`, `.middle`, `.right`.
19
19
  * System modifiers (KeyboardEvent and MouseEvent): `.shift`, `.ctrl`, `.alt`, `.meta`, plus `.exact` to require that no other system modifiers are held.
20
20
  *
21
+ * Listen target and filter modifiers (two orthogonal axes):
22
+ * - Listen target (where the listener is attached): `.window`, `.document`. When omitted the listener
23
+ * is attached to the bound element. This is useful for global / cross-component events, e.g.
24
+ * `@webtop-message.document="onMessage"`, and the listener is removed automatically on unmount.
25
+ * - Filter (whether the handler runs): `.self` fires only when `event.target` is the bound element;
26
+ * `.outside` fires only when `event.target` is outside the bound element (e.g. click-outside to
27
+ * close a popup). `.outside` implies listening on `document` (capture phase) even without `.document`,
28
+ * and `.self` / `.outside` are mutually exclusive.
29
+ *
21
30
  * Additionally, this directive supports lifecycle hooks:
22
31
  * @mount="onMount" - Called before the VNode is mounted to the DOM element
23
32
  * @mounted="onMounted" - Called after the VNode is mounted to the DOM element
@@ -6,3 +6,4 @@ export { ExpressionUtils } from './ichigo/util/ExpressionUtils';
6
6
  export { defineComponent } from './ichigo/components/defineComponent';
7
7
  export type { IchigoComponentOptions } from './ichigo/components/IchigoComponentOptions';
8
8
  export { IchigoElement } from './ichigo/components/IchigoElement';
9
+ export type { VEmitOptions } from './ichigo/VEmitOptions';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintjamsinc/ichigojs",
3
- "version": "0.1.65",
3
+ "version": "0.1.67",
4
4
  "description": "ichigo.js - Simple and intuitive reactive framework. Lightweight, fast, and user-friendly virtual DOM library",
5
5
  "main": "./dist/ichigo.cjs",
6
6
  "module": "./dist/ichigo.esm.js",