@vnejs/module.controller.arrows.horizontal 0.2.6 → 0.2.7
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 +0 -1
- package/dist/index.js +0 -5
- package/dist/types.d.ts +0 -1
- package/package.json +1 -1
- package/src/index.ts +0 -6
- package/src/types.ts +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export declare abstract class ModuleControllerArrowsHorizontal<TEvents extends M
|
|
|
15
15
|
currentItem: number | null;
|
|
16
16
|
maxCurrentItem: number;
|
|
17
17
|
subscribe: () => void;
|
|
18
|
-
getDefaultState: () => TState;
|
|
19
18
|
getMaxCurrentItem: () => number | Promise<number>;
|
|
20
19
|
isArrowItemAvailable: (_index: number) => boolean | Promise<boolean>;
|
|
21
20
|
onArrowLeft: () => void | Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -12,13 +12,11 @@ export class ModuleControllerArrowsHorizontal extends ModuleCore {
|
|
|
12
12
|
this.on(this.EVENT_HIDE, this.onHide, { priority: HIDE.CONTROLS });
|
|
13
13
|
this.on(this.EVENT_UPDATE_STATE, this.updateState);
|
|
14
14
|
};
|
|
15
|
-
getDefaultState = () => ({ isShow: false });
|
|
16
15
|
getMaxCurrentItem = () => 0;
|
|
17
16
|
isArrowItemAvailable = (_index) => true;
|
|
18
17
|
onArrowLeft = () => void this.decCurrentItem();
|
|
19
18
|
onArrowRight = () => void this.incCurrentItem();
|
|
20
19
|
onShow = () => {
|
|
21
|
-
this.updateState({ isShow: true });
|
|
22
20
|
this.currentItem = null;
|
|
23
21
|
return this.emit(this.EVENTS.CONTROLS.PUSH, {
|
|
24
22
|
key: this.name,
|
|
@@ -28,9 +26,6 @@ export class ModuleControllerArrowsHorizontal extends ModuleCore {
|
|
|
28
26
|
});
|
|
29
27
|
};
|
|
30
28
|
onHide = () => {
|
|
31
|
-
if (!this.state.isShow)
|
|
32
|
-
return;
|
|
33
|
-
this.updateState({ isShow: false });
|
|
34
29
|
this.currentItem = null;
|
|
35
30
|
return this.emit(this.EVENTS.CONTROLS.POP, { key: this.name });
|
|
36
31
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -5,6 +5,5 @@ export type ModuleControllerArrowsHorizontalConstants = ModuleCoreConstants & Re
|
|
|
5
5
|
export type ModuleControllerArrowsHorizontalSettings = ModuleCoreSettings;
|
|
6
6
|
export type ModuleControllerArrowsHorizontalParams = ModuleCoreParams;
|
|
7
7
|
export type ModuleControllerArrowsHorizontalState = {
|
|
8
|
-
isShow: boolean;
|
|
9
8
|
currentArrowHorizontalItem?: number | null;
|
|
10
9
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -49,8 +49,6 @@ export abstract class ModuleControllerArrowsHorizontal<
|
|
|
49
49
|
this.on(this.EVENT_UPDATE_STATE, this.updateState);
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
getDefaultState = (): TState => ({ isShow: false }) as TState;
|
|
53
|
-
|
|
54
52
|
getMaxCurrentItem = (): number | Promise<number> => 0;
|
|
55
53
|
|
|
56
54
|
isArrowItemAvailable = (_index: number): boolean | Promise<boolean> => true;
|
|
@@ -59,7 +57,6 @@ export abstract class ModuleControllerArrowsHorizontal<
|
|
|
59
57
|
onArrowRight = (): void | Promise<void> => void this.incCurrentItem();
|
|
60
58
|
|
|
61
59
|
onShow = () => {
|
|
62
|
-
this.updateState({ isShow: true } as Partial<TState>);
|
|
63
60
|
this.currentItem = null;
|
|
64
61
|
|
|
65
62
|
return this.emit(this.EVENTS.CONTROLS.PUSH, {
|
|
@@ -71,9 +68,6 @@ export abstract class ModuleControllerArrowsHorizontal<
|
|
|
71
68
|
};
|
|
72
69
|
|
|
73
70
|
onHide = () => {
|
|
74
|
-
if (!this.state.isShow) return;
|
|
75
|
-
|
|
76
|
-
this.updateState({ isShow: false } as Partial<TState>);
|
|
77
71
|
this.currentItem = null;
|
|
78
72
|
|
|
79
73
|
return this.emit(this.EVENTS.CONTROLS.POP, { key: this.name } satisfies ControlsPopPayload);
|
package/src/types.ts
CHANGED
|
@@ -10,6 +10,5 @@ export type ModuleControllerArrowsHorizontalSettings = ModuleCoreSettings;
|
|
|
10
10
|
export type ModuleControllerArrowsHorizontalParams = ModuleCoreParams;
|
|
11
11
|
|
|
12
12
|
export type ModuleControllerArrowsHorizontalState = {
|
|
13
|
-
isShow: boolean;
|
|
14
13
|
currentArrowHorizontalItem?: number | null;
|
|
15
14
|
};
|