@vnejs/module.controller.accept 0.2.2 → 0.2.4
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/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +5 -15
- package/src/types.ts +1 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import type { ModuleControllerAcceptConstants, ModuleControllerAcceptEvents, ModuleControllerAcceptParams, ModuleControllerAcceptSettings } from "./types.js";
|
|
3
|
-
export type { ModuleControllerAcceptConstants, ModuleControllerAcceptEvents, ModuleControllerAcceptParams, ModuleControllerAcceptSettings
|
|
3
|
+
export type { ModuleControllerAcceptConstants, ModuleControllerAcceptEvents, ModuleControllerAcceptParams, ModuleControllerAcceptSettings } from "./types.js";
|
|
4
4
|
export declare abstract class ModuleControllerAccept<TEvents extends ModuleControllerAcceptEvents = ModuleControllerAcceptEvents, TConstants extends ModuleControllerAcceptConstants = ModuleControllerAcceptConstants, TSettings extends ModuleControllerAcceptSettings = ModuleControllerAcceptSettings, TParams extends ModuleControllerAcceptParams = ModuleControllerAcceptParams, TState = unknown> extends ModuleCore<TEvents, TConstants, TSettings, TParams, TState> {
|
|
5
5
|
abstract name: string;
|
|
6
6
|
abstract EVENT_SHOW: string;
|
|
@@ -11,7 +11,7 @@ export declare abstract class ModuleControllerAccept<TEvents extends ModuleContr
|
|
|
11
11
|
IS_ACCEPT_ENABLED: boolean;
|
|
12
12
|
IS_INTERACT_ENABLED: boolean;
|
|
13
13
|
emitAccept: () => Promise<unknown[]> | undefined;
|
|
14
|
-
get
|
|
14
|
+
get CONTROLS(): Record<string, () => void>;
|
|
15
15
|
subscribe: () => void;
|
|
16
16
|
getDefaultState: () => TState;
|
|
17
17
|
abstract onAccept: () => void | Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export class ModuleControllerAccept extends ModuleCore {
|
|
|
4
4
|
IS_ACCEPT_ENABLED = true;
|
|
5
5
|
IS_INTERACT_ENABLED = true;
|
|
6
6
|
emitAccept = () => this.emit(this.EVENT_ACCEPT);
|
|
7
|
-
get
|
|
7
|
+
get CONTROLS() {
|
|
8
8
|
const controls = {};
|
|
9
9
|
if (this.IS_ACCEPT_ENABLED)
|
|
10
10
|
controls[this.CONST.CONTROLS.BUTTONS.ACCEPT] = () => void this.emitAccept();
|
|
@@ -22,7 +22,7 @@ export class ModuleControllerAccept extends ModuleCore {
|
|
|
22
22
|
getDefaultState = () => ({});
|
|
23
23
|
onShow = () => this.emit(this.EVENTS.CONTROLS.PUSH, {
|
|
24
24
|
key: this.name,
|
|
25
|
-
controls: this.
|
|
25
|
+
controls: this.CONTROLS,
|
|
26
26
|
index: this.CONTROLS_ZINDEX + 1,
|
|
27
27
|
checkNext: true,
|
|
28
28
|
});
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import type { ControlsPopPayload, ControlsPushPayload } from "@vnejs/contracts.controls";
|
|
3
3
|
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ModuleControllerAcceptParams,
|
|
8
|
-
ModuleControllerAcceptSettings,
|
|
9
|
-
} from "./types.js";
|
|
10
|
-
|
|
11
|
-
export type {
|
|
12
|
-
ModuleControllerAcceptConstants,
|
|
13
|
-
ModuleControllerAcceptEvents,
|
|
14
|
-
ModuleControllerAcceptParams,
|
|
15
|
-
ModuleControllerAcceptSettings,
|
|
16
|
-
} from "./types.js";
|
|
4
|
+
import type { ModuleControllerAcceptConstants, ModuleControllerAcceptEvents, ModuleControllerAcceptParams, ModuleControllerAcceptSettings } from "./types.js";
|
|
5
|
+
|
|
6
|
+
export type { ModuleControllerAcceptConstants, ModuleControllerAcceptEvents, ModuleControllerAcceptParams, ModuleControllerAcceptSettings } from "./types.js";
|
|
17
7
|
|
|
18
8
|
export abstract class ModuleControllerAccept<
|
|
19
9
|
TEvents extends ModuleControllerAcceptEvents = ModuleControllerAcceptEvents,
|
|
@@ -36,7 +26,7 @@ export abstract class ModuleControllerAccept<
|
|
|
36
26
|
|
|
37
27
|
emitAccept = () => this.emit(this.EVENT_ACCEPT);
|
|
38
28
|
|
|
39
|
-
get
|
|
29
|
+
get CONTROLS() {
|
|
40
30
|
const controls: Record<string, () => void> = {};
|
|
41
31
|
|
|
42
32
|
if (this.IS_ACCEPT_ENABLED) controls[this.CONST.CONTROLS.BUTTONS.ACCEPT] = () => void this.emitAccept();
|
|
@@ -59,7 +49,7 @@ export abstract class ModuleControllerAccept<
|
|
|
59
49
|
onShow = () =>
|
|
60
50
|
this.emit(this.EVENTS.CONTROLS.PUSH, {
|
|
61
51
|
key: this.name,
|
|
62
|
-
controls: this.
|
|
52
|
+
controls: this.CONTROLS,
|
|
63
53
|
index: this.CONTROLS_ZINDEX + 1,
|
|
64
54
|
checkNext: true,
|
|
65
55
|
} satisfies ControlsPushPayload);
|
package/src/types.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
-
import type {
|
|
3
|
-
Constants as ControlsConstants,
|
|
4
|
-
PluginName as ControlsPluginName,
|
|
5
|
-
SubscribeEvents as ControlsSubscribeEvents,
|
|
6
|
-
} from "@vnejs/contracts.controls";
|
|
2
|
+
import type { Constants as ControlsConstants, PluginName as ControlsPluginName, SubscribeEvents as ControlsSubscribeEvents } from "@vnejs/contracts.controls";
|
|
7
3
|
|
|
8
4
|
export type ModuleControllerAcceptEvents = ModuleCoreEvents & Record<ControlsPluginName, ControlsSubscribeEvents>;
|
|
9
5
|
|