@kengic/core.react 0.0.1-beta.47 → 0.0.1-beta.48

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/core.react",
3
- "version": "0.0.1-beta.47",
3
+ "version": "0.0.1-beta.48",
4
4
  "type": "module",
5
5
  "main": "./kengic-core.react.js",
6
6
  "module": "./kengic-core.react.js",
@@ -1,15 +1,19 @@
1
1
  import { IKgEventListener } from '@kengic/core.core';
2
2
  /**
3
3
  * 事件类型.
4
- * 'onMount': 挂载
4
+ * 'onMount': 挂载
5
+ * 'onOk': 确定
5
6
  */
6
- export type IKgWorkStationEvent = 'onMount';
7
+ export type IKgWorkStationEvent = 'onMount' | 'onOk';
7
8
  export type IKgWorkStationOnMountEventListenerParameter = {};
8
9
  export type IKgWorkStationOnMountEventListener = ((param: IKgWorkStationOnMountEventListenerParameter) => Promise<boolean>) & IKgEventListener;
9
- export type IKgWorkStationEventListenerParameter = IKgWorkStationOnMountEventListenerParameter;
10
- export type IKgWorkStationEventListener = IKgWorkStationOnMountEventListener;
10
+ export type IKgWorkStationOnOkEventListenerParameter = {};
11
+ export type IKgWorkStationOnOkEventListener = ((param: IKgWorkStationOnOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
12
+ export type IKgWorkStationEventListenerParameter = IKgWorkStationOnMountEventListenerParameter | IKgWorkStationOnOkEventListenerParameter;
13
+ export type IKgWorkStationEventListener = IKgWorkStationOnMountEventListener | IKgWorkStationOnOkEventListener;
11
14
  export declare const eventListenerListRecordRecord: Record<string, {
12
- onMount: Array<IKgWorkStationEventListener>;
15
+ onMount: Array<IKgWorkStationOnMountEventListener>;
16
+ onOk: Array<IKgWorkStationOnOkEventListener>;
13
17
  }>;
14
18
  /**
15
19
  * 触发事件.
@@ -1,5 +1,5 @@
1
1
  import { IRemoveEventListener } from '@kengic/core.core';
2
- import { IKgWorkStationOnMountEventListener } from './index.event';
2
+ import { IKgWorkStationOnMountEventListener, IKgWorkStationOnOkEventListener } from './index.event';
3
3
  import { IKgWorkStationState, store } from './index.store';
4
4
  export interface IDoKgWorkStation {
5
5
  /**
@@ -29,6 +29,13 @@ export interface IDoKgWorkStation {
29
29
  * @param isOnce 是否只会触发一次. 默认为 undefined.
30
30
  */
31
31
  onMount(listener: IKgWorkStationOnMountEventListener, isOnce?: boolean): IRemoveEventListener;
32
+ /**
33
+ * 监听事件: 确定.
34
+ *
35
+ * @param listener 事件监听函数.
36
+ * @param isOnce 是否只会触发一次. 默认为 undefined.
37
+ */
38
+ onOk(listener: IKgWorkStationOnOkEventListener, isOnce?: boolean): IRemoveEventListener;
32
39
  /**
33
40
  * 打开弹窗.
34
41
  */
package/src/i18n/en.d.ts CHANGED
@@ -1,7 +1,12 @@
1
1
  export declare const en: {
2
2
  'KgWorkStation.modalTitle': string;
3
+ 'KgWorkStation.reloadMessage': string;
3
4
  'KgWorkStation.selectWorkStation': string;
4
5
  'KgWorkStation.workStation': string;
5
6
  'KgWorkStation.workStationAndWorkStationArea': string;
6
7
  'KgWorkStation.workStationArea': string;
8
+ 'kg.cancel': string;
9
+ 'kg.confirm': string;
10
+ 'kg.confirmDelete': string;
11
+ 'kg.refresh': string;
7
12
  };
@@ -1,7 +1,12 @@
1
1
  export declare const zh_CN: {
2
2
  'KgWorkStation.modalTitle': string;
3
+ 'KgWorkStation.reloadMessage': string;
3
4
  'KgWorkStation.selectWorkStation': string;
4
5
  'KgWorkStation.workStation': string;
5
6
  'KgWorkStation.workStationAndWorkStationArea': string;
6
7
  'KgWorkStation.workStationArea': string;
8
+ 'kg.cancel': string;
9
+ 'kg.confirm': string;
10
+ 'kg.confirmDelete': string;
11
+ 'kg.refresh': string;
7
12
  };
@@ -1 +1 @@
1
- export {};
1
+ export * from './kg.util.tsx';
@@ -0,0 +1,26 @@
1
+ import { ModalFuncProps } from 'antd';
2
+ /**
3
+ * 工具方法.
4
+ */
5
+ export declare class KgUtil {
6
+ /**
7
+ * 确认弹窗.
8
+ * 设置了多个属性的默认值, 简化使用.
9
+ * https://www.antdv.com/components/modal
10
+ * @param props
11
+ */
12
+ static confirm(props: IKgVarButtonModalProperties): ModalFunc;
13
+ }
14
+ /**
15
+ * 按钮确认弹窗的参数.
16
+ */
17
+ export type IKgVarButtonModalProperties = ModalFuncProps & {
18
+ /** 是否隐藏取消按钮. */
19
+ kgHideCancelButton?: boolean;
20
+ };
21
+ export type ModalFunc = {
22
+ destroy: () => void;
23
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
24
+ showLoading(): void;
25
+ hideLoading(): void;
26
+ };