@kengic/core.react 0.0.1-beta.77 → 0.0.1-beta.78

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.
@@ -23888,7 +23888,7 @@ const KgSlice = createSlice({
23888
23888
  }
23889
23889
  }), { setOption } = KgSlice.actions;
23890
23890
  function getOption(e) {
23891
- return console.log("222", e, e.option), e.option;
23891
+ return console.log("222", e, e.Kg.option), e.Kg.option;
23892
23892
  }
23893
23893
  var classnames = { exports: {} };
23894
23894
  /*!
@@ -67565,26 +67565,26 @@ const LOCAL_STORAGE_KEY__WORK_STATION = "KgWorkStation.workStation", LOCAL_STORA
67565
67565
  function getIsVisible(e) {
67566
67566
  return (t) => {
67567
67567
  var r, n;
67568
- return ((n = (r = t[e]) == null ? void 0 : r.props) == null ? void 0 : n.isVisible) ?? !1;
67568
+ return ((n = (r = t.KgWorkStation[e]) == null ? void 0 : r.props) == null ? void 0 : n.isVisible) ?? !1;
67569
67569
  };
67570
67570
  }
67571
67571
  function getIsOpen(e) {
67572
67572
  return (t) => {
67573
67573
  var r, n, a;
67574
- return ((a = (n = (r = t[e]) == null ? void 0 : r.props) == null ? void 0 : n.KgWorkStationModal) == null ? void 0 : a.isOpen) ?? !1;
67574
+ return ((a = (n = (r = t.KgWorkStation[e]) == null ? void 0 : r.props) == null ? void 0 : n.KgWorkStationModal) == null ? void 0 : a.isOpen) ?? !1;
67575
67575
  };
67576
67576
  }
67577
67577
  function getWorkStation(e = "") {
67578
67578
  return (t) => {
67579
67579
  var n;
67580
- let r = ((n = t[e]) == null ? void 0 : n.workStation) ?? null;
67580
+ let r = ((n = t.KgWorkStation[e]) == null ? void 0 : n.workStation) ?? null;
67581
67581
  return r || (r = storejs.get(LOCAL_STORAGE_KEY__WORK_STATION, null)), r;
67582
67582
  };
67583
67583
  }
67584
67584
  function getWorkStationArea(e = "") {
67585
67585
  return (t) => {
67586
67586
  var n;
67587
- let r = ((n = t[e]) == null ? void 0 : n.workStationArea) ?? null;
67587
+ let r = ((n = t.KgWorkStation[e]) == null ? void 0 : n.workStationArea) ?? null;
67588
67588
  return r || (r = storejs.get(LOCAL_STORAGE_KEY__WORK_STATION_AREA, null)), r;
67589
67589
  };
67590
67590
  }
@@ -67617,7 +67617,7 @@ function doKgWorkStation(e = "") {
67617
67617
  return [n, a];
67618
67618
  },
67619
67619
  getIsVisible() {
67620
- const r = ref(getIsVisible(e)(store.getState().KgWorkStation)), n = store.subscribe(() => r.value = getIsVisible(e)(store.getState().KgWorkStation));
67620
+ const r = ref(getIsVisible(e)(store.getState())), n = store.subscribe(() => r.value = getIsVisible(e)(store.getState()));
67621
67621
  return [r, n];
67622
67622
  },
67623
67623
  id: e,
@@ -67655,13 +67655,13 @@ function doKgWorkStation(e = "") {
67655
67655
  get(r, n) {
67656
67656
  switch (n) {
67657
67657
  case "workStation":
67658
- return getWorkStation(e)(store.getState().KgWorkStation);
67658
+ return getWorkStation(e)(store.getState());
67659
67659
  case "workStation$": {
67660
- const a = ref(getWorkStation(e)(store.getState().KgWorkStation)), s = store.subscribe(() => a.value = getWorkStation(e)(store.getState().KgWorkStation));
67660
+ const a = ref(getWorkStation(e)(store.getState())), s = store.subscribe(() => a.value = getWorkStation(e)(store.getState()));
67661
67661
  return [a, s];
67662
67662
  }
67663
67663
  case "workStationArea":
67664
- return getWorkStationArea(e)(store.getState().KgWorkStation);
67664
+ return getWorkStationArea(e)(store.getState());
67665
67665
  }
67666
67666
  return Reflect.get(r, n);
67667
67667
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/core.react",
3
- "version": "0.0.1-beta.77",
3
+ "version": "0.0.1-beta.78",
4
4
  "type": "module",
5
5
  "main": "./kengic-core.react.js",
6
6
  "module": "./kengic-core.react.js",
@@ -1,4 +1,5 @@
1
1
  import { PayloadAction, Slice, SliceSelectors } from '@reduxjs/toolkit';
2
+ import { IState } from '../../index.store.ts';
2
3
  export interface IKgOption {
3
4
  /** 选择工作站. */
4
5
  KgWorkStation?: {
@@ -19,4 +20,4 @@ export declare const KgSlice: Slice<IKgState, {
19
20
  setOption(state: IKgState, action: PayloadAction<IKgOption | null | undefined>): void;
20
21
  }, string, string, SliceSelectors<IKgState>>;
21
22
  export declare const setOption: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<IKgOption | null | undefined, `${string}/setOption`>;
22
- export declare function getOption(state: IKgState): IKgOption;
23
+ export declare function getOption(state: IState): IKgOption;
@@ -1,5 +1,6 @@
1
- import { PayloadAction, Slice, SliceSelectors } from '@reduxjs/toolkit';
1
+ import { PayloadAction } from '@reduxjs/toolkit';
2
2
  import { WorkstationAreaDTO, WorkstationDTO } from '../../api/WMS/models.ts';
3
+ import { IState } from '../../index.store.ts';
3
4
  import { KgWorkStationProps } from './index.vm';
4
5
  export type IKgWorkStationState = Record<string, {
5
6
  /**
@@ -16,51 +17,93 @@ export type IKgWorkStationState = Record<string, {
16
17
  */
17
18
  workStationArea: WorkstationAreaDTO | null;
18
19
  }>;
19
- export declare const KgWorkStationSlice: Slice<IKgWorkStationState, {
20
+ export declare const KgWorkStationSlice: import("@reduxjs/toolkit").Slice<IKgWorkStationState, {
21
+ /**
22
+ * 关闭弹窗.
23
+ *
24
+ * @param state
25
+ * @param action
26
+ */
20
27
  closeModal(state: IKgWorkStationState, action: PayloadAction<{
21
28
  id: string | null | undefined;
22
29
  }>): void;
30
+ /**
31
+ * 挂载. 组件做初始化.
32
+ *
33
+ * @param state
34
+ * @param action
35
+ */
23
36
  mount(state: IKgWorkStationState, action: PayloadAction<{
24
37
  id: string | null | undefined;
25
38
  }>): void;
39
+ /**
40
+ * 打开弹窗.
41
+ *
42
+ * @param state
43
+ * @param action
44
+ */
26
45
  openModal(state: IKgWorkStationState, action: PayloadAction<{
27
46
  id: string | null | undefined;
28
47
  }>): void;
48
+ /**
49
+ * 设置数据.
50
+ *
51
+ * @param state
52
+ * @param action
53
+ */
29
54
  set(state: IKgWorkStationState, action: PayloadAction<{
30
55
  id: string | null | undefined;
31
56
  fn: (state: IKgWorkStationState[string]) => void;
32
57
  }>): void;
58
+ /**
59
+ * 设置当前选择的工作站.
60
+ *
61
+ * @param state
62
+ * @param action
63
+ */
33
64
  setWorkStation(state: IKgWorkStationState, action: PayloadAction<{
34
65
  id?: string | null | undefined;
35
66
  workStation: WorkstationDTO | null;
36
67
  }>): void;
68
+ /**
69
+ * 设置当前选择的工作区.
70
+ *
71
+ * @param state
72
+ * @param action
73
+ */
37
74
  setWorkStationArea(state: IKgWorkStationState, action: PayloadAction<{
38
75
  id?: string | null | undefined;
39
76
  workStationArea: WorkstationAreaDTO | null;
40
77
  }>): void;
78
+ /**
79
+ * 卸载. 释放组件资源.
80
+ *
81
+ * @param state
82
+ * @param action
83
+ */
41
84
  unmount(state: IKgWorkStationState, action: PayloadAction<{
42
85
  id: string | null | undefined;
43
86
  }>): void;
44
- }, string, string, SliceSelectors<IKgWorkStationState>>;
87
+ }, "KgWorkStation", "KgWorkStation", import("@reduxjs/toolkit").SliceSelectors<IKgWorkStationState>>;
45
88
  export declare const set: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
46
89
  id: string | null | undefined;
47
90
  fn: (state: IKgWorkStationState[string]) => void;
48
- }, `${string}/set`>, mount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
91
+ }, "KgWorkStation/set">, mount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
49
92
  id: string | null | undefined;
50
- }, `${string}/mount`>, openModal: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
93
+ }, "KgWorkStation/mount">, openModal: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
51
94
  id: string | null | undefined;
52
- }, `${string}/openModal`>, closeModal: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
95
+ }, "KgWorkStation/openModal">, closeModal: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
53
96
  id: string | null | undefined;
54
- }, `${string}/closeModal`>, setWorkStation: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
97
+ }, "KgWorkStation/closeModal">, setWorkStation: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
55
98
  id?: string | null | undefined;
56
99
  workStation: WorkstationDTO | null;
57
- }, `${string}/setWorkStation`>, setWorkStationArea: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
100
+ }, "KgWorkStation/setWorkStation">, setWorkStationArea: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
58
101
  id?: string | null | undefined;
59
102
  workStationArea: WorkstationAreaDTO | null;
60
- }, `${string}/setWorkStationArea`>, unmount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
103
+ }, "KgWorkStation/setWorkStationArea">, unmount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
61
104
  id: string | null | undefined;
62
- }, `${string}/unmount`>;
63
- export declare function getIsVisible(id: string): (state: IKgWorkStationState) => boolean;
64
- export declare function getIsOpen(id: string): (state: IKgWorkStationState) => boolean;
65
- export declare function getWorkStation(id?: string): (state: IKgWorkStationState) => WorkstationDTO | null;
66
- export declare function getWorkStationArea(id?: string): (state: IKgWorkStationState) => WorkstationAreaDTO | null;
105
+ }, "KgWorkStation/unmount">;
106
+ export declare function getIsVisible(id: string): (state: IState) => boolean;
107
+ export declare function getIsOpen(id: string): (state: IState) => boolean;
108
+ export declare function getWorkStation(id?: string): (state: IState) => WorkstationDTO | null;
109
+ export declare function getWorkStationArea(id?: string): (state: IState) => WorkstationAreaDTO | null;
@@ -1,9 +1,14 @@
1
+ import { IKgState, IKgWorkStationState } from './component';
2
+ export type IState = {
3
+ Kg: IKgState;
4
+ KgWorkStation: IKgWorkStationState;
5
+ };
1
6
  export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
2
- Kg: import("./component").IKgState;
3
- KgWorkStation: import("./component").IKgWorkStationState;
7
+ Kg: IKgState;
8
+ KgWorkStation: IKgWorkStationState;
4
9
  }, import("@reduxjs/toolkit").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("@reduxjs/toolkit").StoreEnhancer<{
5
10
  dispatch: import("@reduxjs/toolkit").ThunkDispatch<{
6
- Kg: import("./component").IKgState;
7
- KgWorkStation: import("./component").IKgWorkStationState;
11
+ Kg: IKgState;
12
+ KgWorkStation: IKgWorkStationState;
8
13
  }, undefined, import("@reduxjs/toolkit").UnknownAction>;
9
14
  }>, import("@reduxjs/toolkit").StoreEnhancer]>>;