@xaendar/core 0.6.17 → 0.6.18

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.
@@ -10,6 +10,7 @@ import { NoArgsVoidFunction as NoArgsVoidFunction_2 } from '@xaendar/types';
10
10
  import { RequireOne } from '@xaendar/types';
11
11
  import { SignalOptions } from '@xaendar/signals';
12
12
  import { VoidFunction as VoidFunction_2 } from '@xaendar/types';
13
+ import { VoidFunction as VoidFunction_3 } from '@xaendar/types';
13
14
 
14
15
  /**
15
16
  * Base class for all web components in the framework.
@@ -153,7 +154,7 @@ export declare class Context {
153
154
  * @param handler - The name of the method on the root component to retrieve.
154
155
  * @returns The handler function, bound to the root component so `this` is correct.
155
156
  */
156
- getEventHandler(handler: string): VoidFunction;
157
+ getEventHandler(handler: string): VoidFunction_2;
157
158
  /**
158
159
  * Registers a child context as a nested scope of this context.
159
160
  *
@@ -391,7 +392,7 @@ export declare function _iterationVariables(items: unknown[], index: number, ite
391
392
  * @template Value - The type of the value to emit as the event detail. Defaults to `void`.
392
393
  */
393
394
  export declare type Output<Value = void> = {
394
- emit: VoidFunction_2<Value extends void ? ([EventOptions] | []) : ([Value, EventOptions] | [Value])>;
395
+ emit: VoidFunction_3<Value extends void ? ([EventOptions] | []) : ([Value, EventOptions] | [Value])>;
395
396
  };
396
397
 
397
398
  /**
@@ -506,6 +507,10 @@ declare type RenderElementEvent = {
506
507
  * The name of the handler method on the component class to invoke when the event fires.
507
508
  */
508
509
  handler: string;
510
+ /**
511
+ * Event Parameters
512
+ */
513
+ parameters: NoArgsFunction<unknown>[];
509
514
  };
510
515
 
511
516
  /**
@@ -838,7 +838,7 @@ function _renderElement(parentNode, context, tagName, attributes, events) {
838
838
  literal ? element.setAttribute(name, String(value())) : context.listen(effect(() => element.setAttribute(name, String(value()))));
839
839
  });
840
840
  events.forEach((event) => {
841
- const handler = ($event) => context.getEventHandler(event.handler)();
841
+ const handler = ($event) => context.getEventHandler(event.handler)(...event.parameters.map((event) => event()));
842
842
  const name = event.name;
843
843
  element.addEventListener(name, handler);
844
844
  context.listen(() => element.removeEventListener(name, handler));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaendar/core",
3
- "version": "0.6.17",
3
+ "version": "0.6.18",
4
4
  "description": "A library containing core utils such as webcomponent base classes and theming support",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -16,7 +16,7 @@
16
16
  }
17
17
  },
18
18
  "dependencies": {
19
- "@xaendar/signals": "0.6.17",
20
- "@xaendar/types": "0.6.17"
19
+ "@xaendar/signals": "0.6.18",
20
+ "@xaendar/types": "0.6.18"
21
21
  }
22
22
  }