@vnejs/module.controller.arrows.grid 0.2.5 → 0.2.6

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 CHANGED
@@ -46,6 +46,7 @@ export declare abstract class ModuleControllerArrowsGrid<TEvents extends ModuleC
46
46
  snapSelectionToGrid: () => void;
47
47
  onShow: () => Promise<import("@vnejs/shared").EmitResults<"vne:controls:push">> | undefined;
48
48
  onHide: () => Promise<import("@vnejs/shared").EmitResults<"vne:controls:pop">> | undefined;
49
+ onHideCleanup: () => Promise<import("@vnejs/shared").EmitResults<string> | undefined>;
49
50
  onStateUpdate: (payload?: Partial<TState>) => void;
50
51
  initRowAndColumns: () => void;
51
52
  isCellInGrid: (row: number, column: number) => boolean;
package/dist/index.js CHANGED
@@ -26,6 +26,7 @@ export class ModuleControllerArrowsGrid extends ModuleCore {
26
26
  const { SHOW, HIDE } = this.CONST.COMPONENTS.LIFECYCLE_PRIORITY;
27
27
  this.on(this.EVENT_SHOW, this.onShow, { priority: SHOW.CONTROLS });
28
28
  this.on(this.EVENT_HIDE, this.onHide, { priority: HIDE.CONTROLS });
29
+ this.on(this.EVENT_HIDE, this.onHideCleanup, { priority: HIDE.CLEANUP });
29
30
  this.on(this.EVENT_UPDATE_STATE, this.onStateUpdate);
30
31
  this.on(this.EVENT_GRID_CLEAR, this.onGridClear);
31
32
  if (this.EVENT_GRID_UPDATE_ITEMS)
@@ -97,6 +98,13 @@ export class ModuleControllerArrowsGrid extends ModuleCore {
97
98
  this.gridColumn = null;
98
99
  return this.emit(this.EVENTS.CONTROLS.POP, { key: this.name });
99
100
  };
101
+ onHideCleanup = async () => {
102
+ this.gridRow = null;
103
+ this.gridColumn = null;
104
+ const unset = { gridRow: undefined, gridColumn: undefined };
105
+ await this.emit(this.EVENT_UPDATE_STATE, unset);
106
+ return this.emit(this.EVENT_UPDATE_FAST);
107
+ };
100
108
  onStateUpdate = (payload = {}) => {
101
109
  this.updateState(payload);
102
110
  if (payload.gridIndex !== undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/module.controller.arrows.grid",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -73,6 +73,7 @@ export abstract class ModuleControllerArrowsGrid<
73
73
 
74
74
  this.on(this.EVENT_SHOW, this.onShow, { priority: SHOW.CONTROLS });
75
75
  this.on(this.EVENT_HIDE, this.onHide, { priority: HIDE.CONTROLS });
76
+ this.on(this.EVENT_HIDE, this.onHideCleanup, { priority: HIDE.CLEANUP });
76
77
  this.on(this.EVENT_UPDATE_STATE, this.onStateUpdate);
77
78
  this.on(this.EVENT_GRID_CLEAR, this.onGridClear);
78
79
  if (this.EVENT_GRID_UPDATE_ITEMS) this.on(this.EVENT_GRID_UPDATE_ITEMS, this.onGridUpdateItems);
@@ -157,6 +158,17 @@ export abstract class ModuleControllerArrowsGrid<
157
158
  return this.emit(this.EVENTS.CONTROLS.POP, { key: this.name } satisfies ControlsPopPayload);
158
159
  };
159
160
 
161
+ onHideCleanup = async () => {
162
+ this.gridRow = null;
163
+ this.gridColumn = null;
164
+
165
+ const unset = { gridRow: undefined, gridColumn: undefined } satisfies Partial<ModuleControllerArrowsGridState>;
166
+
167
+ await this.emit(this.EVENT_UPDATE_STATE, unset);
168
+
169
+ return this.emit(this.EVENT_UPDATE_FAST);
170
+ };
171
+
160
172
  onStateUpdate = (payload: Partial<TState> = {} as Partial<TState>) => {
161
173
  this.updateState(payload);
162
174