@kengic/core.react 0.0.1-beta.76 → 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
  /*!
@@ -66902,6 +66902,7 @@ function createDispatchHook(e = ReactReduxContext) {
66902
66902
  }
66903
66903
  var useDispatch = /* @__PURE__ */ createDispatchHook();
66904
66904
  initializeUseSelector(withSelectorExports.useSyncExternalStoreWithSelector);
66905
+ console.log("AAA", KgSlice, KgWorkStationSlice);
66905
66906
  const store = configureStore({
66906
66907
  middleware: (e) => e({
66907
66908
  serializableCheck: {
@@ -67564,26 +67565,26 @@ const LOCAL_STORAGE_KEY__WORK_STATION = "KgWorkStation.workStation", LOCAL_STORA
67564
67565
  function getIsVisible(e) {
67565
67566
  return (t) => {
67566
67567
  var r, n;
67567
- 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;
67568
67569
  };
67569
67570
  }
67570
67571
  function getIsOpen(e) {
67571
67572
  return (t) => {
67572
67573
  var r, n, a;
67573
- 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;
67574
67575
  };
67575
67576
  }
67576
67577
  function getWorkStation(e = "") {
67577
67578
  return (t) => {
67578
67579
  var n;
67579
- let r = ((n = t[e]) == null ? void 0 : n.workStation) ?? null;
67580
+ let r = ((n = t.KgWorkStation[e]) == null ? void 0 : n.workStation) ?? null;
67580
67581
  return r || (r = storejs.get(LOCAL_STORAGE_KEY__WORK_STATION, null)), r;
67581
67582
  };
67582
67583
  }
67583
67584
  function getWorkStationArea(e = "") {
67584
67585
  return (t) => {
67585
67586
  var n;
67586
- let r = ((n = t[e]) == null ? void 0 : n.workStationArea) ?? null;
67587
+ let r = ((n = t.KgWorkStation[e]) == null ? void 0 : n.workStationArea) ?? null;
67587
67588
  return r || (r = storejs.get(LOCAL_STORAGE_KEY__WORK_STATION_AREA, null)), r;
67588
67589
  };
67589
67590
  }
@@ -67616,7 +67617,7 @@ function doKgWorkStation(e = "") {
67616
67617
  return [n, a];
67617
67618
  },
67618
67619
  getIsVisible() {
67619
- 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()));
67620
67621
  return [r, n];
67621
67622
  },
67622
67623
  id: e,
@@ -67654,13 +67655,13 @@ function doKgWorkStation(e = "") {
67654
67655
  get(r, n) {
67655
67656
  switch (n) {
67656
67657
  case "workStation":
67657
- return getWorkStation(e)(store.getState().KgWorkStation);
67658
+ return getWorkStation(e)(store.getState());
67658
67659
  case "workStation$": {
67659
- 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()));
67660
67661
  return [a, s];
67661
67662
  }
67662
67663
  case "workStationArea":
67663
- return getWorkStationArea(e)(store.getState().KgWorkStation);
67664
+ return getWorkStationArea(e)(store.getState());
67664
67665
  }
67665
67666
  return Reflect.get(r, n);
67666
67667
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/core.react",
3
- "version": "0.0.1-beta.76",
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
- unmount(state: IKgWorkStationState, action: PayloadAction<{
20
+ export declare const KgWorkStationSlice: import("@reduxjs/toolkit").Slice<IKgWorkStationState, {
21
+ /**
22
+ * 关闭弹窗.
23
+ *
24
+ * @param state
25
+ * @param action
26
+ */
27
+ closeModal(state: IKgWorkStationState, action: PayloadAction<{
21
28
  id: string | null | undefined;
22
29
  }>): void;
23
- set(state: IKgWorkStationState, action: PayloadAction<{
30
+ /**
31
+ * 挂载. 组件做初始化.
32
+ *
33
+ * @param state
34
+ * @param action
35
+ */
36
+ mount(state: IKgWorkStationState, action: PayloadAction<{
24
37
  id: string | null | undefined;
25
- fn: (state: IKgWorkStationState[string]) => void;
26
38
  }>): void;
39
+ /**
40
+ * 打开弹窗.
41
+ *
42
+ * @param state
43
+ * @param action
44
+ */
27
45
  openModal(state: IKgWorkStationState, action: PayloadAction<{
28
46
  id: string | null | undefined;
29
47
  }>): void;
30
- closeModal(state: IKgWorkStationState, action: PayloadAction<{
48
+ /**
49
+ * 设置数据.
50
+ *
51
+ * @param state
52
+ * @param action
53
+ */
54
+ set(state: IKgWorkStationState, action: PayloadAction<{
31
55
  id: string | null | undefined;
56
+ fn: (state: IKgWorkStationState[string]) => void;
32
57
  }>): void;
33
- mount(state: IKgWorkStationState, action: PayloadAction<{
34
- id: string | null | undefined;
58
+ /**
59
+ * 设置当前选择的工作站.
60
+ *
61
+ * @param state
62
+ * @param action
63
+ */
64
+ setWorkStation(state: IKgWorkStationState, action: PayloadAction<{
65
+ id?: string | null | undefined;
66
+ workStation: WorkstationDTO | null;
35
67
  }>): void;
68
+ /**
69
+ * 设置当前选择的工作区.
70
+ *
71
+ * @param state
72
+ * @param action
73
+ */
36
74
  setWorkStationArea(state: IKgWorkStationState, action: PayloadAction<{
37
75
  id?: string | null | undefined;
38
76
  workStationArea: WorkstationAreaDTO | null;
39
77
  }>): void;
40
- setWorkStation(state: IKgWorkStationState, action: PayloadAction<{
41
- id?: string | null | undefined;
42
- workStation: WorkstationDTO | null;
78
+ /**
79
+ * 卸载. 释放组件资源.
80
+ *
81
+ * @param state
82
+ * @param action
83
+ */
84
+ unmount(state: IKgWorkStationState, action: PayloadAction<{
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]>>;