@kengic/core.react 0.0.1-beta.0

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 (40) hide show
  1. package/README.md +1 -0
  2. package/dist/close-outlined-DMcSQWxQ.js +8 -0
  3. package/dist/fullscreen-exit-outlined-X1iYkFc4.js +8 -0
  4. package/dist/fullscreen-outlined-DDBrsRcy.js +8 -0
  5. package/dist/index.css +1 -0
  6. package/dist/kengic-core.react.js +46976 -0
  7. package/dist/src/component/Kg/Kg.d.ts +4 -0
  8. package/dist/src/component/Kg/KgProvider.d.ts +7 -0
  9. package/dist/src/component/Kg/index.d.ts +2 -0
  10. package/dist/src/component/KgModal/KgModal.HeaderButtons.Close.d.ts +6 -0
  11. package/dist/src/component/KgModal/KgModal.HeaderButtons.Fullscreen.d.ts +6 -0
  12. package/dist/src/component/KgModal/KgModal.HeaderButtons.d.ts +6 -0
  13. package/dist/src/component/KgModal/KgModal.d.ts +66 -0
  14. package/dist/src/component/KgModal/KgModalPropsProvider.d.ts +8 -0
  15. package/dist/src/component/KgModal/hook/useDragToMove.d.ts +9 -0
  16. package/dist/src/component/KgModal/index.d.ts +2 -0
  17. package/dist/src/component/KgModal/index.vm.d.ts +8 -0
  18. package/dist/src/component/KgVarConfig/KgVarConfig.d.ts +9 -0
  19. package/dist/src/component/KgVarConfig/KgVarConfigModal.d.ts +11 -0
  20. package/dist/src/component/KgVarConfig/index.d.ts +1 -0
  21. package/dist/src/component/KgVarConfig/index.wc.d.ts +4 -0
  22. package/dist/src/component/KgWorkStation/KgWorkStation.d.ts +7 -0
  23. package/dist/src/component/KgWorkStation/KgWorkStation.service.d.ts +2 -0
  24. package/dist/src/component/KgWorkStation/KgWorkStationModal.d.ts +4 -0
  25. package/dist/src/component/KgWorkStation/index.d.ts +2 -0
  26. package/dist/src/component/KgWorkStation/index.event.d.ts +46 -0
  27. package/dist/src/component/KgWorkStation/index.hooks.d.ts +37 -0
  28. package/dist/src/component/KgWorkStation/index.store.d.ts +21 -0
  29. package/dist/src/component/KgWorkStation/index.vm.d.ts +17 -0
  30. package/dist/src/component/KgWorkStation/index.wc.d.ts +4 -0
  31. package/dist/src/component/index.d.ts +7 -0
  32. package/dist/src/const/index.d.ts +1 -0
  33. package/dist/src/const/index.vm.d.ts +1 -0
  34. package/dist/src/i18n/en.d.ts +4 -0
  35. package/dist/src/i18n/index.d.ts +1 -0
  36. package/dist/src/i18n/zh_CN.d.ts +4 -0
  37. package/dist/src/iconify.init.d.ts +1 -0
  38. package/dist/src/index.d.ts +7 -0
  39. package/dist/src/util/index.d.ts +1 -0
  40. package/package.json +84 -0
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare function Kg({ children }: {
3
+ children?: React.ReactNode;
4
+ }): React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ /**
3
+ * 组件通用逻辑.
4
+ */
5
+ export declare function KgProvider({ children }: {
6
+ children?: React.ReactNode;
7
+ }): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './Kg';
2
+ export * from './KgProvider.tsx';
@@ -0,0 +1,6 @@
1
+ export interface KgModalHeaderButtonsCloseProps {
2
+ }
3
+ /**
4
+ * 弹窗:顶部右侧按钮:关闭.
5
+ */
6
+ export declare function KgModalHeaderButtonsClose({}: KgModalHeaderButtonsCloseProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export interface KgModalHeaderButtonsFullscreenProps {
2
+ }
3
+ /**
4
+ * 弹窗:顶部右侧按钮:全屏.
5
+ */
6
+ export declare function KgModalHeaderButtonsFullscreen({}: KgModalHeaderButtonsFullscreenProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export interface KgModalHeaderButtonsProps {
2
+ }
3
+ /**
4
+ * 弹窗:顶部右侧按钮.
5
+ */
6
+ export declare function KgModalHeaderButtons({}: KgModalHeaderButtonsProps): import("react").JSX.Element;
@@ -0,0 +1,66 @@
1
+ import { ModalProps } from 'antd';
2
+ import './KgModal.css';
3
+ export interface KgModalProps extends ModalProps {
4
+ /**
5
+ * 高度是否撑满屏幕.
6
+ *
7
+ * @default true
8
+ */
9
+ kgFullHeight?: boolean;
10
+ /**
11
+ * 是否默认全屏.
12
+ *
13
+ * @default false
14
+ */
15
+ kgIsDefaultFullscreen?: boolean;
16
+ /**
17
+ * 是否可以拖拽改变位置.
18
+ *
19
+ * @default true
20
+ */
21
+ kgIsDragToMove?: boolean;
22
+ /**
23
+ * 是否可以拖拽改变大小.
24
+ *
25
+ * @default true
26
+ */
27
+ kgIsDragToResize?: boolean;
28
+ /**
29
+ * 是否显示全屏按钮.
30
+ *
31
+ * @default true
32
+ */
33
+ kgIsShowFullscreenButton?: boolean;
34
+ /**
35
+ * 最大高度.
36
+ */
37
+ kgMaxHeight?: boolean;
38
+ /**
39
+ * 最大宽度.
40
+ */
41
+ kgMaxWidth?: boolean;
42
+ /**
43
+ * 最小高度.
44
+ */
45
+ kgMinHeight?: boolean;
46
+ /**
47
+ * 最小宽度.
48
+ */
49
+ kgMinWidth?: boolean;
50
+ /**
51
+ * 是否显示取消按钮.
52
+ *
53
+ * @default true
54
+ */
55
+ kgShowCancelButton?: boolean;
56
+ /**
57
+ * 是否显示确定按钮.
58
+ *
59
+ * @default true
60
+ */
61
+ kgShowOkButton?: boolean;
62
+ }
63
+ /**
64
+ * 弹窗.
65
+ */
66
+ export declare function KgModal({ children, closeIcon, ...props }: KgModalProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { KgModalProps } from './KgModal';
3
+ export declare const KgModalPropsContext: React.Context<KgModalProps>;
4
+ export declare function KgModalPropsProvider({ children, value }: {
5
+ children?: React.ReactNode;
6
+ value: KgModalProps;
7
+ }): React.JSX.Element;
8
+ export declare function useKgModalProps(): KgModalProps;
@@ -0,0 +1,9 @@
1
+ import { MutableRefObject } from 'react';
2
+ /**
3
+ * 拖拽改变位置.
4
+ */
5
+ export declare function useDragToMove(param: {
6
+ domRef: MutableRefObject<HTMLDivElement | null>;
7
+ kgIsDragToMove: boolean;
8
+ open: boolean;
9
+ }): void;
@@ -0,0 +1,2 @@
1
+ export * from './index.vm';
2
+ export * from './KgModal';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 弹窗边框宽度.
3
+ */
4
+ export declare const KG_MODAL_BORDER_WIDTH = 1;
5
+ /**
6
+ * 弹窗滚动条的宽度。
7
+ */
8
+ export declare const KG_MODAL_SCROLL_WIDTH = 17;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface KgVarConfigProps {
3
+ /** 该组件实例的唯一标识. */
4
+ id: string;
5
+ }
6
+ /**
7
+ * 变量配置.
8
+ */
9
+ export declare function KgVarConfig(props: KgVarConfigProps): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ export interface KgVarConfigModalProps {
2
+ onClose?: () => void;
3
+ /**
4
+ * 是否打开弹窗.
5
+ */
6
+ open?: boolean;
7
+ }
8
+ /**
9
+ * 变量配置弹窗.
10
+ */
11
+ export declare function KgVarConfigModal(props: KgVarConfigModalProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './KgVarConfig';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 注册 web component.
3
+ */
4
+ export declare function initKgVarConfigElement(): void;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './KgWorkStation.css';
3
+ import { KgWorkStationProps } from './index.vm';
4
+ /**
5
+ * 选择工作站.
6
+ */
7
+ export declare function KgWorkStation(props: KgWorkStationProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare function KgWorkStationIdProvider({ children, value }: any): import("react").JSX.Element;
2
+ export declare function useKgWorkStationID(): string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 选择工作站:弹窗.
3
+ */
4
+ export declare function KgWorkStationModal(): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './KgWorkStation';
2
+ export * from './index.hooks';
@@ -0,0 +1,46 @@
1
+ import { IKgEventListener } from '@kengic/core.core';
2
+ /**
3
+ * 事件类型.
4
+ * 'onMount': 挂载
5
+ */
6
+ export type IKgWorkStationEvent = 'onMount';
7
+ export type IKgWorkStationOnMountEventListenerParameter = {};
8
+ 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<T extends IKgWorkStationEventListener>(param: {
19
+ event: IKgWorkStationEvent;
20
+ id?: string | undefined;
21
+ listener: T;
22
+ }): void;
23
+ /**
24
+ * 移除事件监听.
25
+ *
26
+ * @param param.event 事件名称.
27
+ * @param param.id 唯一标识.
28
+ * @param param.listener 事件监听函数.
29
+ */
30
+ export declare function removeEventListener(param: {
31
+ event: IKgWorkStationEvent;
32
+ id?: string | undefined;
33
+ listener?: any;
34
+ }): void;
35
+ /**
36
+ * 触发事件.
37
+ *
38
+ * @param param.event 事件名称.
39
+ * @param param.id 唯一标识.
40
+ * @param param.parameter 事件参数.
41
+ */
42
+ export declare function emit<T = IKgWorkStationEventListenerParameter>(param: {
43
+ event: IKgWorkStationEvent;
44
+ id?: string | undefined;
45
+ parameter: T;
46
+ }): Promise<boolean>;
@@ -0,0 +1,37 @@
1
+ import { IKgWorkStationState, store } from './index.store';
2
+ export interface IDoKgWorkStation {
3
+ /**
4
+ * 关闭弹窗.
5
+ */
6
+ closeModal(): void;
7
+ /**
8
+ * 挂载.
9
+ */
10
+ mount(): void;
11
+ /**
12
+ * 打开弹窗.
13
+ */
14
+ openModal(): void;
15
+ /**
16
+ * 设置数据.
17
+ *
18
+ * @param fn 设置函数.
19
+ */
20
+ set(fn: (state: IKgWorkStationState[string]) => void): void;
21
+ store: typeof store;
22
+ /**
23
+ * 订阅数据变更.
24
+ *
25
+ * @param fn 回调函数, 可以通过参数 state 获取到最新的数据.
26
+ */
27
+ subscribe(fn: (state: IKgWorkStationState[string]) => void): () => void;
28
+ /**
29
+ * 卸载.
30
+ */
31
+ unmount(): void;
32
+ }
33
+ /**
34
+ *
35
+ * @param id 唯一标识.
36
+ */
37
+ export declare function doKgWorkStation(id?: string): IDoKgWorkStation;
@@ -0,0 +1,21 @@
1
+ import { KgWorkStationProps } from './index.vm';
2
+ export type IKgWorkStationState = Record<string, {
3
+ props?: KgWorkStationProps;
4
+ }>;
5
+ export declare const set: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
6
+ id: string | null | undefined;
7
+ fn: (state: IKgWorkStationState[string]) => void;
8
+ }, "KgWorkStation/set">, mount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
9
+ id: string | null | undefined;
10
+ }, "KgWorkStation/mount">, openModal: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
11
+ id: string | null | undefined;
12
+ }, "KgWorkStation/openModal">, closeModal: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
13
+ id: string | null | undefined;
14
+ }, "KgWorkStation/closeModal">, unmount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
15
+ id: string | null | undefined;
16
+ }, "KgWorkStation/unmount">;
17
+ export declare const store: import("@reduxjs/toolkit").EnhancedStore<IKgWorkStationState, import("@reduxjs/toolkit").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("@reduxjs/toolkit").StoreEnhancer<{
18
+ dispatch: import("@reduxjs/toolkit").ThunkDispatch<IKgWorkStationState, undefined, import("@reduxjs/toolkit").UnknownAction>;
19
+ }>, 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>;
@@ -0,0 +1,17 @@
1
+ export interface KgWorkStationProps {
2
+ /**
3
+ * 弹窗.
4
+ */
5
+ KgWorkStationModal?: {
6
+ /**
7
+ * 弹窗是否打开.
8
+ */
9
+ isOpen?: boolean;
10
+ };
11
+ /** 该组件实例的唯一标识. */
12
+ id: string;
13
+ /**
14
+ * 是否显示.
15
+ */
16
+ isVisible?: boolean;
17
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 注册 web component.
3
+ */
4
+ export declare function initKgWorkStationElement(): void;
@@ -0,0 +1,7 @@
1
+ export * from './KgModal';
2
+ export * from './KgVarConfig';
3
+ export * from './KgWorkStation';
4
+ /**
5
+ * 初始化 web component.
6
+ */
7
+ export declare function initWebComponent(): void;
@@ -0,0 +1 @@
1
+ export * from './index.vm';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const en: {
2
+ 'KgVarConfig.xxx': string;
3
+ 'KgWorkStation.modalTitle': string;
4
+ };
@@ -0,0 +1 @@
1
+ export declare const I18N: any;
@@ -0,0 +1,4 @@
1
+ export declare const zh_CN: {
2
+ 'KgVarConfig.xxx': string;
3
+ 'KgWorkStation.modalTitle': string;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import './asset/index.css';
2
+ import './iconify.init';
3
+ export { doKgWorkStation, type IDoKgWorkStation } from './component';
4
+ /**
5
+ * 初始.
6
+ */
7
+ export declare function initKgCoreReact(): void;
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@kengic/core.react",
3
+ "version": "0.0.1-beta.0",
4
+ "type": "module",
5
+ "scripts": {
6
+ "build": "npm run use-node && rimraf ./dist && tsc -b && vite build",
7
+ "lint": "npm run use-node && eslint .",
8
+ "--------------------------------------------------": "",
9
+ "gen:apis:WMS": "npm run use-node && kengic-pont generate-apis --config kg.config.ts --origin WMS",
10
+ "- ------------------------------------------------": "",
11
+ "use-node": "nvm use 20.17.0 && corepack enable && corepack use pnpm@9.12.1",
12
+ "cnpm:sync": "npm run use-node && npx cnpm --yes sync @kengic/core",
13
+ "-- -----------------------------------------------": "",
14
+ "publish:major": "npm run bump:major && tsx script/publish.ts",
15
+ "publish:minor": "npm run bump:minor && tsx script/publish.ts",
16
+ "publish:patch": "npm run bump:patch && tsx script/publish.ts",
17
+ "publish:beta": "npm run bump:beta && tsx script/publish.ts",
18
+ "----- --------------------------------------------": "",
19
+ "bump:major": "npm run use-node && tsx script/bump.ts major",
20
+ "bump:minor": "npm run use-node && tsx script/bump.ts minor",
21
+ "bump:patch": "npm run use-node && tsx script/bump.ts patch",
22
+ "bump:beta": "npm run use-node && tsx script/bump.ts beta",
23
+ "---- ---------------------------------------------": "",
24
+ "publish:npm": "npm run use-node && npmrc kengic && npm publish ./ --registry https://registry.npmjs.org/ --access public",
25
+ "------ -------------------------------------------": "",
26
+ "bump-to:kengic": "npm run use-node && tsx script/bump-to.kengic.ts"
27
+ },
28
+ "dependencies": {
29
+ "@eslint/js": "9.9.0",
30
+ "@iconify-icons/ant-design": "1.2.7",
31
+ "@iconify/react": "5.0.2",
32
+ "@kengic/core.core": "0.0.1-beta.5",
33
+ "@reduxjs/toolkit": "2.3.0",
34
+ "@types/lodash-es": "4.17.12",
35
+ "@types/node": "20.16.10",
36
+ "@types/react": "18.3.3",
37
+ "@types/react-dom": "18.3.0",
38
+ "@types/semver": "7.5.8",
39
+ "@vitejs/plugin-react": "4.3.1",
40
+ "ahooks": "3.8.1",
41
+ "antd": "5.21.3",
42
+ "chalk": "4.1.2",
43
+ "eslint": "9.9.0",
44
+ "eslint-plugin-react-hooks": "5.1.0-rc.0",
45
+ "eslint-plugin-react-refresh": "0.4.9",
46
+ "globals": "15.9.0",
47
+ "lodash-es": "4.17.21",
48
+ "prettier": "3.3.3",
49
+ "react": "18.3.1",
50
+ "react-dom": "18.3.1",
51
+ "react-intl": "6.8.0",
52
+ "react-redux": "9.1.2",
53
+ "rimraf": "6.0.1",
54
+ "semver": "7.6.3",
55
+ "tsx": "4.19.1",
56
+ "typescript": "5.5.3",
57
+ "typescript-eslint": "8.0.1",
58
+ "use-immer": "0.10.0",
59
+ "vite": "5.4.1"
60
+ },
61
+ "main": "./kengic-core.react.js",
62
+ "module": "./kengic-core.react.js",
63
+ "types": "./src/index.d.ts",
64
+ "prettier": {
65
+ "endOfLine": "auto",
66
+ "overrides": [
67
+ {
68
+ "files": [
69
+ "*.less",
70
+ "*.css"
71
+ ],
72
+ "options": {
73
+ "printWidth": 320
74
+ }
75
+ }
76
+ ],
77
+ "printWidth": 160,
78
+ "semi": true,
79
+ "singleAttributePerLine": true,
80
+ "singleQuote": true,
81
+ "tabWidth": 4,
82
+ "trailingComma": "all"
83
+ }
84
+ }