@equinor/fusion-framework-module-event
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -6,2 +6,11 @@ # Change Log | ||
## [1.0.12](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-event@1.0.11...@equinor/fusion-framework-module-event@1.0.12) (2022-10-21) | ||
### Bug Fixes | ||
* **module-event:** update import paths ([7007b30](https://github.com/equinor/fusion-framework/commit/7007b30eb5e7b4cdecafa264224f559f7b75b08a)) | ||
## 1.0.11 (2022-10-21) | ||
@@ -8,0 +17,0 @@ |
@@ -0,28 +1,44 @@ | ||
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { | ||
if (kind === "m") throw new TypeError("Private method is not writable"); | ||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); | ||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); | ||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; | ||
}; | ||
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { | ||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); | ||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); | ||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); | ||
}; | ||
var _FrameworkEvent_detail, _FrameworkEvent_source, _FrameworkEvent_canceled, _FrameworkEvent_cancelable, _FrameworkEvent_canBubble, _FrameworkEvent_created; | ||
export class FrameworkEvent { | ||
constructor(__type, args) { | ||
this.__type = __type; | ||
this.__canceled = false; | ||
this.__created = Date.now(); | ||
this.__detail = args.detail; | ||
this.__source = args.source; | ||
this.__cancelable = !!args.cancelable; | ||
this.__canBubble = args.canBubble === undefined ? true : args.canBubble; | ||
_FrameworkEvent_detail.set(this, void 0); | ||
_FrameworkEvent_source.set(this, void 0); | ||
_FrameworkEvent_canceled.set(this, false); | ||
_FrameworkEvent_cancelable.set(this, void 0); | ||
_FrameworkEvent_canBubble.set(this, void 0); | ||
_FrameworkEvent_created.set(this, Date.now()); | ||
__classPrivateFieldSet(this, _FrameworkEvent_detail, args.detail, "f"); | ||
__classPrivateFieldSet(this, _FrameworkEvent_source, args.source, "f"); | ||
__classPrivateFieldSet(this, _FrameworkEvent_cancelable, !!args.cancelable, "f"); | ||
__classPrivateFieldSet(this, _FrameworkEvent_canBubble, args.canBubble === undefined ? true : args.canBubble, "f"); | ||
} | ||
get bubbles() { | ||
return this.__canBubble && !this.__canceled; | ||
return __classPrivateFieldGet(this, _FrameworkEvent_canBubble, "f") && !__classPrivateFieldGet(this, _FrameworkEvent_canceled, "f"); | ||
} | ||
get created() { | ||
return this.__created; | ||
return __classPrivateFieldGet(this, _FrameworkEvent_created, "f"); | ||
} | ||
get cancelable() { | ||
return this.__cancelable; | ||
return __classPrivateFieldGet(this, _FrameworkEvent_cancelable, "f"); | ||
} | ||
get canceled() { | ||
return this.__canceled; | ||
return __classPrivateFieldGet(this, _FrameworkEvent_canceled, "f"); | ||
} | ||
get detail() { | ||
return this.__detail; | ||
return __classPrivateFieldGet(this, _FrameworkEvent_detail, "f"); | ||
} | ||
get source() { | ||
return this.__source; | ||
return __classPrivateFieldGet(this, _FrameworkEvent_source, "f"); | ||
} | ||
@@ -34,9 +50,10 @@ get type() { | ||
if (this.cancelable) { | ||
this.__canceled = true; | ||
__classPrivateFieldSet(this, _FrameworkEvent_canceled, true, "f"); | ||
} | ||
} | ||
stopPropagation() { | ||
this.__canBubble = false; | ||
__classPrivateFieldSet(this, _FrameworkEvent_canBubble, false, "f"); | ||
} | ||
} | ||
_FrameworkEvent_detail = new WeakMap(), _FrameworkEvent_source = new WeakMap(), _FrameworkEvent_canceled = new WeakMap(), _FrameworkEvent_cancelable = new WeakMap(), _FrameworkEvent_canBubble = new WeakMap(), _FrameworkEvent_created = new WeakMap(); | ||
//# sourceMappingURL=event.js.map |
@@ -1,2 +0,2 @@ | ||
import { FrameworkEvent } from 'event'; | ||
import { FrameworkEvent } from './event'; | ||
export interface IEventModuleConfigurator { | ||
@@ -3,0 +3,0 @@ onDispatch?: (event: FrameworkEvent) => Promise<void> | void; |
@@ -36,9 +36,4 @@ import type { ModuleInstance } from '@equinor/fusion-framework-module'; | ||
export declare class FrameworkEvent<TInit extends FrameworkEventInit = FrameworkEventInit, TType extends string = keyof FrameworkEventMap> implements IFrameworkEvent<TInit, TType> { | ||
#private; | ||
private __type; | ||
private __detail?; | ||
private __source?; | ||
private __canceled; | ||
private __cancelable; | ||
private __canBubble; | ||
private __created; | ||
constructor(__type: string, args: TInit); | ||
@@ -45,0 +40,0 @@ get bubbles(): boolean; |
import { Module, ModuleInstance } from '@equinor/fusion-framework-module'; | ||
import { FrameworkEvent, FrameworkEventInit } from 'event'; | ||
import { FrameworkEvent, FrameworkEventInit } from './event'; | ||
import { IEventModuleConfigurator } from './configurator'; | ||
@@ -4,0 +4,0 @@ import { EventModuleProvider, IEventModuleProvider } from './provider'; |
{ | ||
"name": "@equinor/fusion-framework-module-event", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "Fusion module for events", | ||
@@ -39,3 +39,3 @@ "main": "./dist/esm/index.js", | ||
}, | ||
"gitHead": "4476578317fe48e58849be381144cdfa193c3248" | ||
"gitHead": "b43085d957da8dd794cab3e59fca4f9d9b443db4" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { FrameworkEvent } from 'event'; | ||
import { FrameworkEvent } from './event'; | ||
@@ -3,0 +3,0 @@ export interface IEventModuleConfigurator { |
@@ -82,14 +82,14 @@ import type { ModuleInstance } from '@equinor/fusion-framework-module'; | ||
{ | ||
private __detail?: FrameworkEventInitDetail<TInit>; | ||
private __source?: FrameworkEventInitSource<TInit>; | ||
private __canceled = false; | ||
private __cancelable: boolean; | ||
private __canBubble: boolean; | ||
private __created: number = Date.now(); | ||
#detail?: FrameworkEventInitDetail<TInit>; | ||
#source?: FrameworkEventInitSource<TInit>; | ||
#canceled = false; | ||
#cancelable: boolean; | ||
#canBubble: boolean; | ||
#created: number = Date.now(); | ||
constructor(private __type: string, args: TInit) { | ||
this.__detail = args.detail as FrameworkEventInitDetail<TInit>; | ||
this.__source = args.source as FrameworkEventInitSource<TInit>; | ||
this.__cancelable = !!args.cancelable; | ||
this.__canBubble = args.canBubble === undefined ? true : args.canBubble; | ||
this.#detail = args.detail as FrameworkEventInitDetail<TInit>; | ||
this.#source = args.source as FrameworkEventInitSource<TInit>; | ||
this.#cancelable = !!args.cancelable; | ||
this.#canBubble = args.canBubble === undefined ? true : args.canBubble; | ||
} | ||
@@ -99,23 +99,23 @@ | ||
public get bubbles(): boolean { | ||
return this.__canBubble && !this.__canceled; | ||
return this.#canBubble && !this.#canceled; | ||
} | ||
public get created(): number { | ||
return this.__created; | ||
return this.#created; | ||
} | ||
public get cancelable(): boolean { | ||
return this.__cancelable; | ||
return this.#cancelable; | ||
} | ||
public get canceled(): boolean { | ||
return this.__canceled; | ||
return this.#canceled; | ||
} | ||
public get detail(): FrameworkEventInitDetail<TInit> | undefined { | ||
return this.__detail; | ||
return this.#detail; | ||
} | ||
public get source(): FrameworkEventInitSource<TInit> | undefined { | ||
return this.__source; | ||
return this.#source; | ||
} | ||
@@ -130,3 +130,3 @@ | ||
if (this.cancelable) { | ||
this.__canceled = true; | ||
this.#canceled = true; | ||
} | ||
@@ -137,4 +137,4 @@ } | ||
public stopPropagation(): void { | ||
this.__canBubble = false; | ||
this.#canBubble = false; | ||
} | ||
} |
import { Module, ModuleInstance, ModulesInstanceType } from '@equinor/fusion-framework-module'; | ||
import { FrameworkEvent, FrameworkEventInit } from 'event'; | ||
import { FrameworkEvent, FrameworkEventInit } from './event'; | ||
import { IEventModuleConfigurator } from './configurator'; | ||
@@ -4,0 +4,0 @@ import { EventModuleProvider, IEventModuleProvider } from './provider'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102288
686