@kengic/core.react 0.0.1-beta.7 → 0.0.1-beta.71

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.
Files changed (46) hide show
  1. package/exclamation-circle-outlined-DZrXCnvM.js +8 -0
  2. package/index.css +1 -1
  3. package/kengic-core.react.js +58283 -37631
  4. package/package.json +1 -1
  5. package/search-outlined-Od1M_oxf.js +8 -0
  6. package/src/api/WMS/Controllers/WorkstationController/List.d.ts +25 -0
  7. package/src/api/WMS/Controllers/WorkstationController/index.d.ts +1 -0
  8. package/src/api/WMS/Controllers/index.d.ts +1 -0
  9. package/src/api/WMS/index.d.ts +2 -0
  10. package/src/api/WMS/models.d.ts +62 -0
  11. package/src/api/api.d.ts +1 -0
  12. package/src/api/def.d.ts +1 -0
  13. package/src/api/index.d.ts +2 -0
  14. package/src/component/Kg/KgProvider.d.ts +6 -1
  15. package/src/component/Kg/index.d.ts +2 -2
  16. package/src/component/Kg/index.store.d.ts +23 -0
  17. package/src/component/KgModal/KgModal.d.ts +4 -4
  18. package/src/component/KgModal/hook/useDragToResize.d.ts +13 -0
  19. package/src/component/KgVarConfig/KgVarConfig.d.ts +1 -5
  20. package/src/component/KgVarConfig/index.vm.d.ts +2 -0
  21. package/src/component/KgVarConfig/index.wc.d.ts +1 -1
  22. package/src/component/KgWorkStation/KgWorkStation.d.ts +1 -2
  23. package/src/component/KgWorkStation/KgWorkStationModal.d.ts +2 -1
  24. package/src/component/KgWorkStation/index.event.d.ts +11 -28
  25. package/src/component/KgWorkStation/index.hooks.d.ts +41 -3
  26. package/src/component/KgWorkStation/index.store.d.ts +27 -4
  27. package/src/component/KgWorkStation/index.vm.d.ts +0 -2
  28. package/src/component/KgWorkStation/index.wc.d.ts +1 -1
  29. package/src/component/index.d.ts +2 -2
  30. package/src/const/index.vm.d.ts +8 -1
  31. package/src/hook/index.d.ts +1 -0
  32. package/src/hook/kg.hook.d.ts +12 -0
  33. package/src/i18n/en.d.ts +9 -1
  34. package/src/i18n/es_ES.d.ts +12 -0
  35. package/src/i18n/fr_FR.d.ts +12 -0
  36. package/src/i18n/km_KH.d.ts +12 -0
  37. package/src/i18n/ko_KR.d.ts +12 -0
  38. package/src/i18n/vi_VN.d.ts +12 -0
  39. package/src/i18n/zh_CN.d.ts +9 -1
  40. package/src/index.d.ts +15 -1
  41. package/src/service/http-client.d.ts +32 -0
  42. package/src/service/index.d.ts +1 -0
  43. package/src/util/index.d.ts +1 -1
  44. package/src/util/kg.util.d.ts +28 -0
  45. package/src/component/Kg/Kg.d.ts +0 -4
  46. package/src/component/KgWorkStation/KgWorkStation.service.d.ts +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/core.react",
3
- "version": "0.0.1-beta.7",
3
+ "version": "0.0.1-beta.71",
4
4
  "type": "module",
5
5
  "main": "./kengic-core.react.js",
6
6
  "module": "./kengic-core.react.js",
@@ -0,0 +1,8 @@
1
+ const t = {
2
+ width: 1024,
3
+ height: 1024,
4
+ body: '<path fill="currentColor" d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1c-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"/>'
5
+ };
6
+ export {
7
+ t as default
8
+ };
@@ -0,0 +1,25 @@
1
+ import { IRequestConfig, IRequestOptions } from '../../../../service';
2
+ import * as DEF from '../../../def';
3
+ /** 请求参数. */
4
+ export declare class ListQuery {
5
+ /** 排序字段. */
6
+ column?: string | null;
7
+ /** 排序方式. */
8
+ order?: 'asc' | 'desc' | null;
9
+ /** 当前页数. */
10
+ pageNo?: number | null;
11
+ /** 每页条数. */
12
+ pageSize?: number | null;
13
+ constructor(obj?: ListQuery);
14
+ }
15
+ /**
16
+ * 工作站-分页列表查询.
17
+ *
18
+ * @param config 请求配置.
19
+ * @param option 请求选项.
20
+ */
21
+ export declare function List(config?: IRequestConfig<ListQuery, {}>, option?: IRequestOptions): Promise<DEF.WMS.IPage<DEF.WMS.WorkstationDTO>>;
22
+ export declare namespace List {
23
+ var method: "GET";
24
+ var url: string;
25
+ }
@@ -0,0 +1 @@
1
+ export { List, ListQuery } from './List';
@@ -0,0 +1 @@
1
+ export * as WorkstationController from './WorkstationController';
@@ -0,0 +1,2 @@
1
+ export * as WMSAPI from './Controllers';
2
+ export * as WMSDEF from './models';
@@ -0,0 +1,62 @@
1
+ export declare class IPage<T0> {
2
+ /** Current. */
3
+ current?: number | null;
4
+ /** Pages. */
5
+ pages?: number | null;
6
+ /** Records. */
7
+ records?: Array<T0> | null;
8
+ /** Size. */
9
+ size?: number | null;
10
+ /** Total. */
11
+ total?: number | null;
12
+ constructor(obj?: IPage<T0>);
13
+ }
14
+ /** 工作站区域数据传输对象. */
15
+ export declare class WorkstationAreaDTO {
16
+ /** 主键. */
17
+ id?: string | null;
18
+ /** 创建日期. */
19
+ insDt?: string | null;
20
+ /** 创建用户. */
21
+ insUsrId?: string | null;
22
+ /** 修改日期. */
23
+ modUsrId?: string | null;
24
+ /** 修改用户. */
25
+ moddte?: string | null;
26
+ /** 仓库. */
27
+ whId?: string | null;
28
+ /** 工作区. */
29
+ wrkare?: string | null;
30
+ /** 工作区描述. */
31
+ wrkareDsc?: string | null;
32
+ constructor(obj?: WorkstationAreaDTO);
33
+ }
34
+ /** 工作站数据传输对象. */
35
+ export declare class WorkstationDTO {
36
+ /** 工作站. */
37
+ devcod?: string | null;
38
+ /** 工作站描述. */
39
+ devcodDsc?: string | null;
40
+ /** 主工作区. */
41
+ hmewrkare?: string | null;
42
+ /** 主键. */
43
+ id?: string | null;
44
+ /** 创建日期. */
45
+ insDt?: string | null;
46
+ /** 创建用户. */
47
+ insUsrId?: string | null;
48
+ /** 修改日期. */
49
+ modUsrId?: string | null;
50
+ /** 修改用户. */
51
+ moddte?: string | null;
52
+ /** 仓库. */
53
+ whId?: string | null;
54
+ /** 工作站与工作区域关系. */
55
+ workstationAreas?: Array<WorkstationAreaDTO> | null;
56
+ constructor(obj?: WorkstationDTO);
57
+ }
58
+ /**
59
+ * 获取对象的属性名数组.
60
+ * @param obj 对象.
61
+ */
62
+ export declare function keys<C extends object>(obj: C): Array<keyof C>;
@@ -0,0 +1 @@
1
+ export { WMSAPI as WMS } from './WMS';
@@ -0,0 +1 @@
1
+ export { WMSDEF as WMS } from './WMS';
@@ -0,0 +1,2 @@
1
+ export * as API from './api';
2
+ export * as DEF from './def';
@@ -2,6 +2,11 @@ import React from 'react';
2
2
  /**
3
3
  * 组件通用逻辑.
4
4
  */
5
- export declare function KgProvider({ children }: {
5
+ export declare function KgProvider({ children, id }: {
6
6
  children?: React.ReactNode;
7
+ id: string;
7
8
  }): React.JSX.Element;
9
+ /**
10
+ * 获取组件标识.
11
+ */
12
+ export declare function useID(): string;
@@ -1,2 +1,2 @@
1
- export * from './Kg';
2
- export * from './KgProvider.tsx';
1
+ export * from './index.store';
2
+ export * from './KgProvider';
@@ -0,0 +1,23 @@
1
+ export interface IKgOption {
2
+ /** 选择工作站. */
3
+ KgWorkStation?: {
4
+ /**
5
+ * 是否启用功能.
6
+ * @default true
7
+ */
8
+ isOn?: boolean;
9
+ };
10
+ }
11
+ export type IKgState = {
12
+ /**
13
+ * 选项.
14
+ */
15
+ option: IKgOption;
16
+ };
17
+ export declare const setOption: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<IKgOption | null | undefined, "Kg/setOption">;
18
+ export declare function getOption(state: IKgState): IKgOption;
19
+ export declare const kgStore: import("@reduxjs/toolkit").EnhancedStore<IKgState, import("@reduxjs/toolkit").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("@reduxjs/toolkit").StoreEnhancer<{
20
+ dispatch: import("@reduxjs/toolkit").ThunkDispatch<IKgState, undefined, import("@reduxjs/toolkit").UnknownAction>;
21
+ }>, import("@reduxjs/toolkit").StoreEnhancer]>>;
22
+ export declare const useKgDispatch: import("react-redux").UseDispatch<import("@reduxjs/toolkit").ThunkDispatch<IKgState, undefined, import("@reduxjs/toolkit").UnknownAction> & import("@reduxjs/toolkit").Dispatch<import("@reduxjs/toolkit").UnknownAction>>;
23
+ export declare const useKgSelector: import("react-redux").UseSelector<IKgState>;
@@ -34,19 +34,19 @@ export interface KgModalProps extends ModalProps {
34
34
  /**
35
35
  * 最大高度.
36
36
  */
37
- kgMaxHeight?: boolean;
37
+ kgMaxHeight?: number;
38
38
  /**
39
39
  * 最大宽度.
40
40
  */
41
- kgMaxWidth?: boolean;
41
+ kgMaxWidth?: number;
42
42
  /**
43
43
  * 最小高度.
44
44
  */
45
- kgMinHeight?: boolean;
45
+ kgMinHeight?: number;
46
46
  /**
47
47
  * 最小宽度.
48
48
  */
49
- kgMinWidth?: boolean;
49
+ kgMinWidth?: number;
50
50
  /**
51
51
  * 是否显示取消按钮.
52
52
  *
@@ -0,0 +1,13 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { KgModalProps } from '../KgModal';
3
+ /**
4
+ * 拖拽改变大小.
5
+ *
6
+ * @param param.props 组件参数.
7
+ * @param param.domRef 页面上的那个特殊元素对象, 专门用于获取其他元素对象.
8
+ * @param param.getProps 计算后的组件参数.
9
+ */
10
+ export declare function useDragToResize(param: {
11
+ domRef: MutableRefObject<HTMLDivElement | null>;
12
+ getProps: KgModalProps;
13
+ }): void;
@@ -1,9 +1,5 @@
1
1
  import React from 'react';
2
- export interface KgVarConfigProps {
3
- /** 该组件实例的唯一标识. */
4
- id: string;
5
- }
6
2
  /**
7
3
  * 变量配置.
8
4
  */
9
- export declare function KgVarConfig(props: KgVarConfigProps): React.JSX.Element;
5
+ export declare function KgVarConfig(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export interface KgVarConfigProps {
2
+ }
@@ -1,4 +1,4 @@
1
1
  /**
2
- * 注册 web component.
2
+ * 注册组件.
3
3
  */
4
4
  export declare function initKgVarConfigElement(): void;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import './KgWorkStation.css';
3
- import { KgWorkStationProps } from './index.vm';
4
3
  /**
5
4
  * 选择工作站.
6
5
  */
7
- export declare function KgWorkStation(props: KgWorkStationProps): React.JSX.Element;
6
+ export declare function KgWorkStation(): React.JSX.Element | null;
@@ -1,4 +1,5 @@
1
+ import React from 'react';
1
2
  /**
2
3
  * 选择工作站:弹窗.
3
4
  */
4
- export declare function KgWorkStationModal(): import("react").JSX.Element;
5
+ export declare function KgWorkStationModal(): React.JSX.Element;
@@ -1,37 +1,20 @@
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;
11
- /**
12
- * 添加事件监听.
13
- *
14
- * @param param.event 事件名称.
15
- * @param param.id 唯一标识.
16
- * @param param.listener 事件监听函数.
17
- */
18
- export declare function addEventListener<L extends IKgWorkStationEventListener>(param: {
19
- event: IKgWorkStationEvent;
20
- id?: string | undefined;
21
- listener: L;
22
- }): void;
23
- /**
24
- * 移除事件监听.
25
- *
26
- * @param param.event 事件名称.
27
- * @param param.id 唯一标识.
28
- * @param param.listener 事件监听函数.
29
- */
30
- export declare function removeEventListener<L extends IKgWorkStationEventListener>(param: {
31
- event: IKgWorkStationEvent;
32
- id?: string | undefined;
33
- listener?: L;
34
- }): void;
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;
14
+ export declare const eventListenerListRecordRecord: Record<string, {
15
+ onMount: Array<IKgWorkStationOnMountEventListener>;
16
+ onOk: Array<IKgWorkStationOnOkEventListener>;
17
+ }>;
35
18
  /**
36
19
  * 触发事件.
37
20
  *
@@ -1,11 +1,28 @@
1
- import { IKgWorkStationState, store } from './index.store';
2
- import { IKgWorkStationOnMountEventListener } from './index.event.ts';
3
1
  import { IRemoveEventListener } from '@kengic/core.core';
2
+ import { WorkstationAreaDTO, WorkstationDTO } from '../../api/WMS/models.ts';
3
+ import { IKgWorkStationOnMountEventListener, IKgWorkStationOnOkEventListener } from './index.event';
4
+ import { IKgWorkStationState, kgWorkStationStore } from './index.store';
4
5
  export interface IDoKgWorkStation {
5
6
  /**
6
7
  * 关闭弹窗.
7
8
  */
8
9
  closeModal(): void;
10
+ /**
11
+ * <p>获取某个状态数据. 在 vue 项目中使用.</p>
12
+ *
13
+ * @param fn 获取函数, 该函数由框架调用并传入状态数据作为参数, 调用者从参数中获取想要的数据.
14
+ * @return 返回一个数组, 包含两个元素, 第一个元素是要获取的数据, 是一个 ref 数据, 第二个元素是一个退订函数, 由调用者负责在合适的时候调用, 用于移除对该数据的变更监听.
15
+ */
16
+ get<T extends {
17
+ value: any;
18
+ }>(fn: (state: IKgWorkStationState[string]) => any): [T, () => void];
19
+ /**
20
+ * <p>获取「是否显示」. 在 vue 项目中使用.</p>
21
+ */
22
+ getIsVisible(): [{
23
+ value: boolean;
24
+ }, () => void];
25
+ id: string;
9
26
  /**
10
27
  * 监听事件: 挂载.
11
28
  *
@@ -13,6 +30,13 @@ export interface IDoKgWorkStation {
13
30
  * @param isOnce 是否只会触发一次. 默认为 undefined.
14
31
  */
15
32
  onMount(listener: IKgWorkStationOnMountEventListener, isOnce?: boolean): IRemoveEventListener;
33
+ /**
34
+ * 监听事件: 确定.
35
+ *
36
+ * @param listener 事件监听函数.
37
+ * @param isOnce 是否只会触发一次. 默认为 undefined.
38
+ */
39
+ onOk(listener: IKgWorkStationOnOkEventListener, isOnce?: boolean): IRemoveEventListener;
16
40
  /**
17
41
  * 打开弹窗.
18
42
  */
@@ -23,13 +47,27 @@ export interface IDoKgWorkStation {
23
47
  * @param fn 设置函数.
24
48
  */
25
49
  set(fn: (state: IKgWorkStationState[string]) => void): void;
26
- store: typeof store;
50
+ store: typeof kgWorkStationStore;
27
51
  /**
28
52
  * 订阅数据变更.
29
53
  *
30
54
  * @param fn 回调函数, 可以通过参数 state 获取到最新的数据.
31
55
  */
32
56
  subscribe(fn: (state: IKgWorkStationState[string]) => void): () => void;
57
+ /**
58
+ * <p>获取「当前选择的工作站」快照. 在 vue 项目中使用.</p>
59
+ */
60
+ workStation: WorkstationDTO | null;
61
+ /**
62
+ * <p>获取「当前选择的工作站」. 在 vue 项目中使用.</p>
63
+ */
64
+ workStation$: [{
65
+ value: WorkstationDTO | null;
66
+ }, () => void];
67
+ /**
68
+ * <p>获取「当前选择的工作区」快照. 在 vue 项目中使用.</p>
69
+ */
70
+ workStationArea: WorkstationAreaDTO | null;
33
71
  }
34
72
  /**
35
73
  *
@@ -1,6 +1,19 @@
1
+ import { WorkstationAreaDTO, WorkstationDTO } from '../../api/WMS/models.ts';
1
2
  import { KgWorkStationProps } from './index.vm';
2
3
  export type IKgWorkStationState = Record<string, {
4
+ /**
5
+ * 是否已经完成挂载.
6
+ */
7
+ isMount: boolean;
3
8
  props?: KgWorkStationProps;
9
+ /**
10
+ * 当前选择的工作站.
11
+ */
12
+ workStation: WorkstationDTO | null;
13
+ /**
14
+ * 当前选择的工作区.
15
+ */
16
+ workStationArea: WorkstationAreaDTO | null;
4
17
  }>;
5
18
  export declare const set: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
6
19
  id: string | null | undefined;
@@ -11,11 +24,21 @@ export declare const set: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
11
24
  id: string | null | undefined;
12
25
  }, "KgWorkStation/openModal">, closeModal: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
13
26
  id: string | null | undefined;
14
- }, "KgWorkStation/closeModal">, unmount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
27
+ }, "KgWorkStation/closeModal">, setWorkStation: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
28
+ id?: string | null | undefined;
29
+ workStation: WorkstationDTO | null;
30
+ }, "KgWorkStation/setWorkStation">, setWorkStationArea: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
31
+ id?: string | null | undefined;
32
+ workStationArea: WorkstationAreaDTO | null;
33
+ }, "KgWorkStation/setWorkStationArea">, unmount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
15
34
  id: string | null | undefined;
16
35
  }, "KgWorkStation/unmount">;
17
- export declare const store: import("@reduxjs/toolkit").EnhancedStore<IKgWorkStationState, import("@reduxjs/toolkit").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("@reduxjs/toolkit").StoreEnhancer<{
36
+ export declare function getIsVisible(id: string): (state: IKgWorkStationState) => boolean;
37
+ export declare function getIsOpen(id: string): (state: IKgWorkStationState) => boolean;
38
+ export declare function getWorkStation(id?: string): (state: IKgWorkStationState) => WorkstationDTO | null;
39
+ export declare function getWorkStationArea(id?: string): (state: IKgWorkStationState) => WorkstationAreaDTO | null;
40
+ export declare const kgWorkStationStore: import("@reduxjs/toolkit").EnhancedStore<IKgWorkStationState, import("@reduxjs/toolkit").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("@reduxjs/toolkit").StoreEnhancer<{
18
41
  dispatch: import("@reduxjs/toolkit").ThunkDispatch<IKgWorkStationState, undefined, import("@reduxjs/toolkit").UnknownAction>;
19
42
  }>, import("@reduxjs/toolkit").StoreEnhancer]>>;
20
- export declare const useReduxDispatch: import("react-redux").UseDispatch<import("@reduxjs/toolkit").ThunkDispatch<IKgWorkStationState, undefined, import("@reduxjs/toolkit").UnknownAction> & import("@reduxjs/toolkit").Dispatch<import("@reduxjs/toolkit").UnknownAction>>;
21
- export declare const useReduxSelector: import("react-redux").UseSelector<IKgWorkStationState>;
43
+ export declare const useKgWorkStationDispatch: import("react-redux").UseDispatch<import("@reduxjs/toolkit").ThunkDispatch<IKgWorkStationState, undefined, import("@reduxjs/toolkit").UnknownAction> & import("@reduxjs/toolkit").Dispatch<import("@reduxjs/toolkit").UnknownAction>>;
44
+ export declare const useKgWorkStationSelector: import("react-redux").UseSelector<IKgWorkStationState>;
@@ -8,8 +8,6 @@ export interface KgWorkStationProps {
8
8
  */
9
9
  isOpen?: boolean;
10
10
  };
11
- /** 该组件实例的唯一标识. */
12
- id: string;
13
11
  /**
14
12
  * 是否显示.
15
13
  */
@@ -1,4 +1,4 @@
1
1
  /**
2
- * 注册 web component.
2
+ * 注册组件.
3
3
  */
4
4
  export declare function initKgWorkStationElement(): void;
@@ -2,6 +2,6 @@ export * from './KgModal';
2
2
  export * from './KgVarConfig';
3
3
  export * from './KgWorkStation';
4
4
  /**
5
- * 初始化 web component.
5
+ * 初始化所有的 web component.
6
6
  */
7
- export declare function initWebComponent(): void;
7
+ export declare function initWebComponents(): void;
@@ -1 +1,8 @@
1
- export {};
1
+ /**
2
+ * vue 中的 ref() 函数.
3
+ */
4
+ declare let ref: (value: any) => {
5
+ value: any;
6
+ };
7
+ export declare function setRef(_ref: (value: any) => any): void;
8
+ export { ref };
@@ -0,0 +1 @@
1
+ export * from './kg.hook.tsx';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 通用工具方法.
3
+ */
4
+ export declare function useKg(): {
5
+ /**
6
+ * 翻译.
7
+ *
8
+ * @param id 被翻译的数据.
9
+ * @return 翻译后的数据.
10
+ */
11
+ t(id: string): string;
12
+ };
package/src/i18n/en.d.ts CHANGED
@@ -1,4 +1,12 @@
1
1
  export declare const en: {
2
- 'KgVarConfig.xxx': string;
3
2
  'KgWorkStation.modalTitle': string;
3
+ 'KgWorkStation.reloadMessage': string;
4
+ 'KgWorkStation.selectWorkStation': string;
5
+ 'KgWorkStation.workStation': string;
6
+ 'KgWorkStation.workStationAndWorkStationArea': string;
7
+ 'KgWorkStation.workStationArea': string;
8
+ 'kg.cancel': string;
9
+ 'kg.confirm': string;
10
+ 'kg.confirmDelete': string;
11
+ 'kg.refresh': string;
4
12
  };
@@ -0,0 +1,12 @@
1
+ export declare const es_ES: {
2
+ 'KgWorkStation.modalTitle': string;
3
+ 'KgWorkStation.reloadMessage': string;
4
+ 'KgWorkStation.selectWorkStation': string;
5
+ 'KgWorkStation.workStation': string;
6
+ 'KgWorkStation.workStationAndWorkStationArea': string;
7
+ 'KgWorkStation.workStationArea': string;
8
+ 'kg.cancel': string;
9
+ 'kg.confirm': string;
10
+ 'kg.confirmDelete': string;
11
+ 'kg.refresh': string;
12
+ };
@@ -0,0 +1,12 @@
1
+ export declare const fr_FR: {
2
+ 'KgWorkStation.modalTitle': string;
3
+ 'KgWorkStation.reloadMessage': string;
4
+ 'KgWorkStation.selectWorkStation': string;
5
+ 'KgWorkStation.workStation': string;
6
+ 'KgWorkStation.workStationAndWorkStationArea': string;
7
+ 'KgWorkStation.workStationArea': string;
8
+ 'kg.cancel': string;
9
+ 'kg.confirm': string;
10
+ 'kg.confirmDelete': string;
11
+ 'kg.refresh': string;
12
+ };
@@ -0,0 +1,12 @@
1
+ export declare const km_KH: {
2
+ 'KgWorkStation.modalTitle': string;
3
+ 'KgWorkStation.reloadMessage': string;
4
+ 'KgWorkStation.selectWorkStation': string;
5
+ 'KgWorkStation.workStation': string;
6
+ 'KgWorkStation.workStationAndWorkStationArea': string;
7
+ 'KgWorkStation.workStationArea': string;
8
+ 'kg.cancel': string;
9
+ 'kg.confirm': string;
10
+ 'kg.confirmDelete': string;
11
+ 'kg.refresh': string;
12
+ };
@@ -0,0 +1,12 @@
1
+ export declare const ko_KR: {
2
+ 'KgWorkStation.modalTitle': string;
3
+ 'KgWorkStation.reloadMessage': string;
4
+ 'KgWorkStation.selectWorkStation': string;
5
+ 'KgWorkStation.workStation': string;
6
+ 'KgWorkStation.workStationAndWorkStationArea': string;
7
+ 'KgWorkStation.workStationArea': string;
8
+ 'kg.cancel': string;
9
+ 'kg.confirm': string;
10
+ 'kg.confirmDelete': string;
11
+ 'kg.refresh': string;
12
+ };
@@ -0,0 +1,12 @@
1
+ export declare const vi_VN: {
2
+ 'KgWorkStation.modalTitle': string;
3
+ 'KgWorkStation.reloadMessage': string;
4
+ 'KgWorkStation.selectWorkStation': string;
5
+ 'KgWorkStation.workStation': string;
6
+ 'KgWorkStation.workStationAndWorkStationArea': string;
7
+ 'KgWorkStation.workStationArea': string;
8
+ 'kg.cancel': string;
9
+ 'kg.confirm': string;
10
+ 'kg.confirmDelete': string;
11
+ 'kg.refresh': string;
12
+ };
@@ -1,4 +1,12 @@
1
1
  export declare const zh_CN: {
2
- 'KgVarConfig.xxx': string;
3
2
  'KgWorkStation.modalTitle': string;
3
+ 'KgWorkStation.reloadMessage': string;
4
+ 'KgWorkStation.selectWorkStation': string;
5
+ 'KgWorkStation.workStation': string;
6
+ 'KgWorkStation.workStationAndWorkStationArea': string;
7
+ 'KgWorkStation.workStationArea': string;
8
+ 'kg.cancel': string;
9
+ 'kg.confirm': string;
10
+ 'kg.confirmDelete': string;
11
+ 'kg.refresh': string;
4
12
  };
package/src/index.d.ts CHANGED
@@ -1,7 +1,21 @@
1
1
  import './asset/index.css';
2
2
  import './iconify.init';
3
+ import { IKgOption } from './component/Kg';
3
4
  export { doKgWorkStation, type IDoKgWorkStation } from './component';
5
+ export { setHttpClient } from './service';
6
+ export interface IKgCoreReactOptions {
7
+ /**
8
+ * 选项.
9
+ */
10
+ option?: IKgOption;
11
+ /**
12
+ * vue 中的 ref() 函数.
13
+ *
14
+ * @param value
15
+ */
16
+ ref: (value: any) => any;
17
+ }
4
18
  /**
5
19
  * 初始.
6
20
  */
7
- export declare function initKgCoreReact(): void;
21
+ export declare function initKgCoreReact(param: IKgCoreReactOptions): void;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * 设置 httpClient 实例.
3
+ */
4
+ declare function setHttpClient(httpClient: any | null): void;
5
+ /**
6
+ * 获取 httpClient 实例.
7
+ */
8
+ declare function httpClient(): any;
9
+ interface IRequestConfig<P = {}, D = {}> {
10
+ data?: D;
11
+ params?: P;
12
+ }
13
+ interface IRequestOptions {
14
+ apiUrl?: string;
15
+ dayjs?: any;
16
+ dynamicQueryFormID?: string;
17
+ dynamicQueryKgSearchFormID?: string;
18
+ dynamicQueryOperatorModel?: Record<string, string>;
19
+ errorMessageMode?: 'none' | 'modal' | 'message' | undefined;
20
+ formatDate?: boolean;
21
+ ignoreCancelToken?: boolean;
22
+ isReturnNativeResponse?: boolean;
23
+ isTransformResponse?: boolean;
24
+ joinParamsToUrl?: boolean;
25
+ joinPrefix?: boolean;
26
+ joinTime?: boolean;
27
+ mock?: any;
28
+ successMessageMode?: 'none' | 'success' | 'error' | undefined;
29
+ urlPrefix?: string;
30
+ withToken?: boolean;
31
+ }
32
+ export { setHttpClient, httpClient, type IRequestConfig, type IRequestOptions };
@@ -0,0 +1 @@
1
+ export * from './http-client';
@@ -1 +1 @@
1
- export {};
1
+ export * from './kg.util.tsx';