@handaotech-design/bom 0.0.16 → 0.0.18

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 (42) hide show
  1. package/dist/es/components/bom-tree/index.vue +2 -0
  2. package/dist/es/components/gray-input/index.vue +3 -0
  3. package/dist/es/hooks/use-ppboms.d.ts +2 -2
  4. package/dist/es/hooks/use-ppboms.js +4 -4
  5. package/dist/lib/components/bom-tree/index.vue +2 -0
  6. package/dist/lib/components/gray-input/index.vue +3 -0
  7. package/dist/lib/hooks/use-ppboms.d.ts +2 -2
  8. package/dist/lib/hooks/use-ppboms.js +6 -6
  9. package/package.json +1 -1
  10. package/src/components/bom-tree/index.vue +2 -0
  11. package/src/components/gray-input/index.vue +3 -0
  12. package/src/hooks/use-ppboms.ts +4 -4
  13. package/tsconfig.json +29 -3
  14. package/types/build.config.d.ts +2 -0
  15. package/types/rollup.config.d.ts +3 -0
  16. package/types/src/all-components.d.ts +3 -0
  17. package/types/src/components/bom-tree/index.d.ts +69 -0
  18. package/types/src/components/bom-tree/index.vue.d.ts +30 -0
  19. package/types/src/components/bom-workbench/index.d.ts +88 -0
  20. package/types/src/components/bom-workbench/index.vue.d.ts +30 -0
  21. package/types/src/components/gray-input/index.d.ts +17 -0
  22. package/types/src/components/gray-input/index.vue.d.ts +7 -0
  23. package/types/src/components/index.d.ts +4 -0
  24. package/types/src/components/left-right/index.d.ts +56 -0
  25. package/types/src/components/left-right/index.vue.d.ts +28 -0
  26. package/types/src/defaults.d.ts +4 -0
  27. package/types/src/hooks/index.d.ts +1 -0
  28. package/types/src/hooks/use-ppboms.d.ts +19 -0
  29. package/types/src/index.d.ts +7 -0
  30. package/types/src/models/bom.d.ts +35 -0
  31. package/types/src/models/common.d.ts +5 -0
  32. package/types/src/models/index.d.ts +2 -0
  33. package/types/src/shared/keys.d.ts +1 -0
  34. package/types/src/shared/make-installer.d.ts +4 -0
  35. package/types/src/tokens/index.d.ts +0 -0
  36. package/types/src/utils/bom.d.ts +3 -0
  37. package/types/src/utils/config.d.ts +1 -0
  38. package/types/src/utils/index.d.ts +4 -0
  39. package/types/src/utils/rule-engine.d.ts +20 -0
  40. package/types/src/utils/template.d.ts +1 -0
  41. package/types/unocss.config.d.ts +3 -0
  42. package/types/vite.config.d.ts +2 -0
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { nextTick, onBeforeUnmount, onMounted, ref, toRefs, watch } from 'vue'
3
3
  import type { TreeProps } from 'ant-design-vue'
4
+ import { Dropdown, Tree } from 'ant-design-vue'
4
5
  import { watchDebounced } from '@vueuse/shared'
5
6
  import * as _ from 'lodash-es'
6
7
  import type { DataNode } from 'ant-design-vue/es/vc-tree-select/interface'
@@ -13,6 +14,7 @@ const emits = defineEmits(['select'])
13
14
  const COMPONENT_NAME = 'HdBomTree'
14
15
  defineOptions({
15
16
  name: COMPONENT_NAME,
17
+ components: { ATree: Tree, ADropdown: Dropdown },
16
18
  })
17
19
 
18
20
  type TreeNodeWithMeta = DataNode & {
@@ -1,7 +1,10 @@
1
1
  <script setup lang="ts">
2
+ import { Input } from 'ant-design-vue'
3
+
2
4
  const COMPONENT_NAME = 'HdBomGrayInput'
3
5
  defineOptions({
4
6
  name: COMPONENT_NAME,
7
+ components: { AInput: Input },
5
8
  })
6
9
  </script>
7
10
 
@@ -9,8 +9,8 @@ interface UsePpbomsParams {
9
9
  queryType?: QueryType;
10
10
  options?: Record<string, any>;
11
11
  }
12
- export declare const UsePpboms: (params: UsePpbomsParams) => {
13
- data: import("vue").Ref<any>;
12
+ export declare const usePpboms: (params: UsePpbomsParams) => {
13
+ treeData: import("vue").Ref<any>;
14
14
  layoutConfig: import("vue").Ref<any>;
15
15
  treeConfig: import("vue").Ref<any>;
16
16
  loading: import("vue").Ref<boolean>;
@@ -7,10 +7,10 @@ export var QueryType = /* @__PURE__ */ ((QueryType2) => {
7
7
  QueryType2["MODEL_ESN"] = "MODEL_ESN";
8
8
  return QueryType2;
9
9
  })(QueryType || {});
10
- export const UsePpboms = (params) => {
10
+ export const usePpboms = (params) => {
11
11
  const { host, appId, appSecret, queryType, options } = params;
12
12
  const loading = ref(false);
13
- const data = ref();
13
+ const treeData = ref();
14
14
  const treeConfig = ref();
15
15
  const layoutConfig = ref();
16
16
  const queryBoms = async () => {
@@ -64,7 +64,7 @@ export const UsePpboms = (params) => {
64
64
  const configResp = await getConfig(host, ppbomPageConfigCode, appId, appSecret);
65
65
  loading.value = false;
66
66
  const props = configResp.config.props;
67
- data.value = convertBomDataToTree(dataResp.data.items, props.content.tree.nodeConfig.rule);
67
+ treeData.value = convertBomDataToTree(dataResp.data.items, props.content.tree.nodeConfig.rule);
68
68
  treeConfig.value = props.content.tree;
69
69
  layoutConfig.value = props.content.tree.layout;
70
70
  } finally {
@@ -72,7 +72,7 @@ export const UsePpboms = (params) => {
72
72
  }
73
73
  };
74
74
  return {
75
- data,
75
+ treeData,
76
76
  layoutConfig,
77
77
  treeConfig,
78
78
  loading,
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { nextTick, onBeforeUnmount, onMounted, ref, toRefs, watch } from 'vue'
3
3
  import type { TreeProps } from 'ant-design-vue'
4
+ import { Dropdown, Tree } from 'ant-design-vue'
4
5
  import { watchDebounced } from '@vueuse/shared'
5
6
  import * as _ from 'lodash-es'
6
7
  import type { DataNode } from 'ant-design-vue/es/vc-tree-select/interface'
@@ -13,6 +14,7 @@ const emits = defineEmits(['select'])
13
14
  const COMPONENT_NAME = 'HdBomTree'
14
15
  defineOptions({
15
16
  name: COMPONENT_NAME,
17
+ components: { ATree: Tree, ADropdown: Dropdown },
16
18
  })
17
19
 
18
20
  type TreeNodeWithMeta = DataNode & {
@@ -1,7 +1,10 @@
1
1
  <script setup lang="ts">
2
+ import { Input } from 'ant-design-vue'
3
+
2
4
  const COMPONENT_NAME = 'HdBomGrayInput'
3
5
  defineOptions({
4
6
  name: COMPONENT_NAME,
7
+ components: { AInput: Input },
5
8
  })
6
9
  </script>
7
10
 
@@ -9,8 +9,8 @@ interface UsePpbomsParams {
9
9
  queryType?: QueryType;
10
10
  options?: Record<string, any>;
11
11
  }
12
- export declare const UsePpboms: (params: UsePpbomsParams) => {
13
- data: import("vue").Ref<any>;
12
+ export declare const usePpboms: (params: UsePpbomsParams) => {
13
+ treeData: import("vue").Ref<any>;
14
14
  layoutConfig: import("vue").Ref<any>;
15
15
  treeConfig: import("vue").Ref<any>;
16
16
  loading: import("vue").Ref<boolean>;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.UsePpboms = exports.QueryType = void 0;
6
+ exports.usePpboms = exports.QueryType = void 0;
7
7
  var _vue = require("vue");
8
8
  var _utils = require("../utils");
9
9
  var _models = require("../models");
@@ -13,7 +13,7 @@ var QueryType = exports.QueryType = /* @__PURE__ */(QueryType2 => {
13
13
  QueryType2["MODEL_ESN"] = "MODEL_ESN";
14
14
  return QueryType2;
15
15
  })(QueryType || {});
16
- const UsePpboms = params => {
16
+ const usePpboms = params => {
17
17
  const {
18
18
  host,
19
19
  appId,
@@ -22,7 +22,7 @@ const UsePpboms = params => {
22
22
  options
23
23
  } = params;
24
24
  const loading = (0, _vue.ref)(false);
25
- const data = (0, _vue.ref)();
25
+ const treeData = (0, _vue.ref)();
26
26
  const treeConfig = (0, _vue.ref)();
27
27
  const layoutConfig = (0, _vue.ref)();
28
28
  const queryBoms = async () => {
@@ -76,7 +76,7 @@ const UsePpboms = params => {
76
76
  const configResp = await (0, _utils.getConfig)(host, ppbomPageConfigCode, appId, appSecret);
77
77
  loading.value = false;
78
78
  const props = configResp.config.props;
79
- data.value = (0, _utils.convertBomDataToTree)(dataResp.data.items, props.content.tree.nodeConfig.rule);
79
+ treeData.value = (0, _utils.convertBomDataToTree)(dataResp.data.items, props.content.tree.nodeConfig.rule);
80
80
  treeConfig.value = props.content.tree;
81
81
  layoutConfig.value = props.content.tree.layout;
82
82
  } finally {
@@ -84,11 +84,11 @@ const UsePpboms = params => {
84
84
  }
85
85
  };
86
86
  return {
87
- data,
87
+ treeData,
88
88
  layoutConfig,
89
89
  treeConfig,
90
90
  loading,
91
91
  getDataAndConfig
92
92
  };
93
93
  };
94
- exports.UsePpboms = UsePpboms;
94
+ exports.usePpboms = usePpboms;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handaotech-design/bom",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { nextTick, onBeforeUnmount, onMounted, ref, toRefs, watch } from 'vue'
3
3
  import type { TreeProps } from 'ant-design-vue'
4
+ import { Dropdown, Tree } from 'ant-design-vue'
4
5
  import { watchDebounced } from '@vueuse/shared'
5
6
  import * as _ from 'lodash-es'
6
7
  import type { DataNode } from 'ant-design-vue/es/vc-tree-select/interface'
@@ -13,6 +14,7 @@ const emits = defineEmits(['select'])
13
14
  const COMPONENT_NAME = 'HdBomTree'
14
15
  defineOptions({
15
16
  name: COMPONENT_NAME,
17
+ components: { ATree: Tree, ADropdown: Dropdown },
16
18
  })
17
19
 
18
20
  type TreeNodeWithMeta = DataNode & {
@@ -1,7 +1,10 @@
1
1
  <script setup lang="ts">
2
+ import { Input } from 'ant-design-vue'
3
+
2
4
  const COMPONENT_NAME = 'HdBomGrayInput'
3
5
  defineOptions({
4
6
  name: COMPONENT_NAME,
7
+ components: { AInput: Input },
5
8
  })
6
9
  </script>
7
10
 
@@ -17,10 +17,10 @@ interface UsePpbomsParams {
17
17
  options?: Record<string, any>
18
18
  }
19
19
 
20
- export const UsePpboms = (params: UsePpbomsParams) => {
20
+ export const usePpboms = (params: UsePpbomsParams) => {
21
21
  const { host, appId, appSecret, queryType, options } = params
22
22
  const loading = ref<boolean>(false)
23
- const data = ref<any>()
23
+ const treeData = ref<any>()
24
24
  const treeConfig = ref<any>()
25
25
  const layoutConfig = ref<any>()
26
26
 
@@ -78,7 +78,7 @@ export const UsePpboms = (params: UsePpbomsParams) => {
78
78
  const configResp = await getConfig(host, ppbomPageConfigCode, appId, appSecret)
79
79
  loading.value = false
80
80
  const props = configResp.config.props
81
- data.value = convertBomDataToTree(dataResp.data.items, props.content.tree.nodeConfig.rule)
81
+ treeData.value = convertBomDataToTree(dataResp.data.items, props.content.tree.nodeConfig.rule)
82
82
  treeConfig.value = props.content.tree
83
83
  layoutConfig.value = props.content.tree.layout
84
84
  }
@@ -88,7 +88,7 @@ export const UsePpboms = (params: UsePpbomsParams) => {
88
88
  }
89
89
 
90
90
  return {
91
- data,
91
+ treeData,
92
92
  layoutConfig,
93
93
  treeConfig,
94
94
  loading,
package/tsconfig.json CHANGED
@@ -1,7 +1,33 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
3
2
  "compilerOptions": {
4
- "lib": ["DOM", "esnext"]
3
+ "target": "es2018",
4
+ "module": "esnext",
5
+ "lib": ["esnext", "DOM"],
6
+ "moduleResolution": "node",
7
+ "esModuleInterop": true,
8
+ "strict": true,
9
+ "strictNullChecks": true,
10
+ "resolveJsonModule": true,
11
+ "skipDefaultLibCheck": true,
12
+ "skipLibCheck": true,
13
+ "declaration": true,
14
+ "declarationDir": "./types",
15
+ "rootDir": ".",
16
+ "baseUrl": ".",
17
+ "jsx": "preserve",
18
+ "types": ["node"],
19
+ "paths": {
20
+ "@handaotech-design/apollo": ["./packages/apollo/src/index.ts"],
21
+ "@handaotech-design/uno-preset-hd": ["./packages/uno-preset-hd/src/index.ts"],
22
+ "@handaotech-design/unplugin-hd-components": ["./packages/unplugin-hd-components/src/index.ts"],
23
+ "@handaotech-design/vue": ["./packages/vue/src/index.ts"],
24
+ "@handaotech-design/ui": ["./packages/ui/src/index.ts"],
25
+ }
5
26
  },
6
- "strict": false
27
+ "exclude": [
28
+ "**/dist/**",
29
+ "**/node_modules/**",
30
+ "**/play/**",
31
+ "**/types/**",
32
+ ]
7
33
  }
@@ -0,0 +1,2 @@
1
+ declare const _default: import("unbuild").BuildConfig;
2
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { RollupOptions } from 'rollup';
2
+ declare const configs: RollupOptions[];
3
+ export default configs;
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from 'vue';
2
+ declare const _default: Plugin<any[]>[];
3
+ export default _default;
@@ -0,0 +1,69 @@
1
+ export * from './index.vue';
2
+ export declare const HdBomTree: import("@handaotech-design/vue").SFCWithInstall<{
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
4
+ treeData: {
5
+ type: import("vue").PropType<import("ant-design-vue/lib/tree").DataNode[] | undefined>;
6
+ required: true;
7
+ };
8
+ config: {
9
+ type: import("vue").PropType<import("../..").BomTreeConfig>;
10
+ required: true;
11
+ };
12
+ }>> & {
13
+ onSelect?: ((...args: any[]) => any) | undefined;
14
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ select: (...args: any[]) => void;
16
+ }, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
17
+ treeData: {
18
+ type: import("vue").PropType<import("ant-design-vue/lib/tree").DataNode[] | undefined>;
19
+ required: true;
20
+ };
21
+ config: {
22
+ type: import("vue").PropType<import("../..").BomTreeConfig>;
23
+ required: true;
24
+ };
25
+ }>> & {
26
+ onSelect?: ((...args: any[]) => any) | undefined;
27
+ }, {}, true, {}, {}, {
28
+ P: {};
29
+ B: {};
30
+ D: {};
31
+ C: {};
32
+ M: {};
33
+ Defaults: {};
34
+ }, Readonly<import("vue").ExtractPropTypes<{
35
+ treeData: {
36
+ type: import("vue").PropType<import("ant-design-vue/lib/tree").DataNode[] | undefined>;
37
+ required: true;
38
+ };
39
+ config: {
40
+ type: import("vue").PropType<import("../..").BomTreeConfig>;
41
+ required: true;
42
+ };
43
+ }>> & {
44
+ onSelect?: ((...args: any[]) => any) | undefined;
45
+ }, {}, {}, {}, {}, {}>;
46
+ __isFragment?: undefined;
47
+ __isTeleport?: undefined;
48
+ __isSuspense?: undefined;
49
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
50
+ treeData: {
51
+ type: import("vue").PropType<import("ant-design-vue/lib/tree").DataNode[] | undefined>;
52
+ required: true;
53
+ };
54
+ config: {
55
+ type: import("vue").PropType<import("../..").BomTreeConfig>;
56
+ required: true;
57
+ };
58
+ }>> & {
59
+ onSelect?: ((...args: any[]) => any) | undefined;
60
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
61
+ select: (...args: any[]) => void;
62
+ }, string, {}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
63
+ $slots: {
64
+ "right-click"?(_: {
65
+ treeNode: any;
66
+ }): any;
67
+ };
68
+ })> & Record<string, any>;
69
+ export default HdBomTree;
@@ -0,0 +1,30 @@
1
+ import type { TreeProps } from 'ant-design-vue';
2
+ import type { BomTreeConfig } from '../../models';
3
+ interface Props {
4
+ treeData: TreeProps['treeData'];
5
+ config: BomTreeConfig;
6
+ }
7
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ select: (...args: any[]) => void;
9
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
10
+ onSelect?: ((...args: any[]) => any) | undefined;
11
+ }, {}, {}>, {
12
+ "right-click"?(_: {
13
+ treeNode: any;
14
+ }): any;
15
+ }>;
16
+ export default _default;
17
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
18
+ type __VLS_TypePropsToRuntimeProps<T> = {
19
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
20
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
21
+ } : {
22
+ type: import('vue').PropType<T[K]>;
23
+ required: true;
24
+ };
25
+ };
26
+ type __VLS_WithTemplateSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -0,0 +1,88 @@
1
+ export * from './index.vue';
2
+ export declare const HdBomWorkbench: import("@handaotech-design/vue").SFCWithInstall<{
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
4
+ moduleKey: {
5
+ type: import("vue").PropType<string>;
6
+ required: true;
7
+ };
8
+ bomData: {
9
+ type: import("vue").PropType<import("../..").Optional<import("../..").BomNode[]>>;
10
+ required: true;
11
+ };
12
+ treeConfig: {
13
+ type: import("vue").PropType<import("../..").BomTreeConfig>;
14
+ required: true;
15
+ };
16
+ layoutConfig: {
17
+ type: import("vue").PropType<import("../..").WorkBenchLayoutConfig>;
18
+ };
19
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
20
+ moduleKey: {
21
+ type: import("vue").PropType<string>;
22
+ required: true;
23
+ };
24
+ bomData: {
25
+ type: import("vue").PropType<import("../..").Optional<import("../..").BomNode[]>>;
26
+ required: true;
27
+ };
28
+ treeConfig: {
29
+ type: import("vue").PropType<import("../..").BomTreeConfig>;
30
+ required: true;
31
+ };
32
+ layoutConfig: {
33
+ type: import("vue").PropType<import("../..").WorkBenchLayoutConfig>;
34
+ };
35
+ }>>, {}, true, {}, {}, {
36
+ P: {};
37
+ B: {};
38
+ D: {};
39
+ C: {};
40
+ M: {};
41
+ Defaults: {};
42
+ }, Readonly<import("vue").ExtractPropTypes<{
43
+ moduleKey: {
44
+ type: import("vue").PropType<string>;
45
+ required: true;
46
+ };
47
+ bomData: {
48
+ type: import("vue").PropType<import("../..").Optional<import("../..").BomNode[]>>;
49
+ required: true;
50
+ };
51
+ treeConfig: {
52
+ type: import("vue").PropType<import("../..").BomTreeConfig>;
53
+ required: true;
54
+ };
55
+ layoutConfig: {
56
+ type: import("vue").PropType<import("../..").WorkBenchLayoutConfig>;
57
+ };
58
+ }>>, {}, {}, {}, {}, {}>;
59
+ __isFragment?: undefined;
60
+ __isTeleport?: undefined;
61
+ __isSuspense?: undefined;
62
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
63
+ moduleKey: {
64
+ type: import("vue").PropType<string>;
65
+ required: true;
66
+ };
67
+ bomData: {
68
+ type: import("vue").PropType<import("../..").Optional<import("../..").BomNode[]>>;
69
+ required: true;
70
+ };
71
+ treeConfig: {
72
+ type: import("vue").PropType<import("../..").BomTreeConfig>;
73
+ required: true;
74
+ };
75
+ layoutConfig: {
76
+ type: import("vue").PropType<import("../..").WorkBenchLayoutConfig>;
77
+ };
78
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
79
+ $slots: {
80
+ "tree-right-click"?(_: {
81
+ bomNode: import("../..").BomNode | undefined;
82
+ }): any;
83
+ content?(_: {
84
+ bomNode: import("../..").BomNode | undefined;
85
+ }): any;
86
+ };
87
+ })> & Record<string, any>;
88
+ export default HdBomWorkbench;
@@ -0,0 +1,30 @@
1
+ import type { BomNode, BomTreeConfig, Optional, WorkBenchLayoutConfig } from '../../models';
2
+ interface Props {
3
+ moduleKey: string;
4
+ bomData: Optional<BomNode[]>;
5
+ treeConfig: BomTreeConfig;
6
+ layoutConfig?: WorkBenchLayoutConfig;
7
+ }
8
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
9
+ "tree-right-click"?(_: {
10
+ bomNode: BomNode | undefined;
11
+ }): any;
12
+ content?(_: {
13
+ bomNode: BomNode | undefined;
14
+ }): any;
15
+ }>;
16
+ export default _default;
17
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
18
+ type __VLS_TypePropsToRuntimeProps<T> = {
19
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
20
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
21
+ } : {
22
+ type: import('vue').PropType<T[K]>;
23
+ required: true;
24
+ };
25
+ };
26
+ type __VLS_WithTemplateSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -0,0 +1,17 @@
1
+ export * from './index.vue';
2
+ export declare const HdGrayInput: import("@handaotech-design/vue").SFCWithInstall<{
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{}>>, {}, true, {}, {}, {
4
+ P: {};
5
+ B: {};
6
+ D: {};
7
+ C: {};
8
+ M: {};
9
+ Defaults: {};
10
+ }, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, {}>;
11
+ __isFragment?: undefined;
12
+ __isTeleport?: undefined;
13
+ __isSuspense?: undefined;
14
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
15
+ $slots: Partial<Record<string, (_: {}) => any>>;
16
+ })> & Record<string, any>;
17
+ export default HdGrayInput;
@@ -0,0 +1,7 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, Partial<Record<string, (_: {}) => any>>>;
2
+ export default _default;
3
+ type __VLS_WithTemplateSlots<T, S> = T & {
4
+ new (): {
5
+ $slots: S;
6
+ };
7
+ };
@@ -0,0 +1,4 @@
1
+ export * from './bom-tree';
2
+ export * from './bom-workbench';
3
+ export * from './gray-input';
4
+ export * from './left-right';
@@ -0,0 +1,56 @@
1
+ export * from './index.vue';
2
+ export declare const HdLeftRight: import("@handaotech-design/vue").SFCWithInstall<{
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
4
+ moduleKey: {
5
+ type: StringConstructor;
6
+ required: true;
7
+ };
8
+ maxLeftWidth: {
9
+ type: NumberConstructor;
10
+ required: false;
11
+ };
12
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
13
+ moduleKey: {
14
+ type: StringConstructor;
15
+ required: true;
16
+ };
17
+ maxLeftWidth: {
18
+ type: NumberConstructor;
19
+ required: false;
20
+ };
21
+ }>>, {}, true, {}, {}, {
22
+ P: {};
23
+ B: {};
24
+ D: {};
25
+ C: {};
26
+ M: {};
27
+ Defaults: {};
28
+ }, Readonly<import("vue").ExtractPropTypes<{
29
+ moduleKey: {
30
+ type: StringConstructor;
31
+ required: true;
32
+ };
33
+ maxLeftWidth: {
34
+ type: NumberConstructor;
35
+ required: false;
36
+ };
37
+ }>>, {}, {}, {}, {}, {}>;
38
+ __isFragment?: undefined;
39
+ __isTeleport?: undefined;
40
+ __isSuspense?: undefined;
41
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
42
+ moduleKey: {
43
+ type: StringConstructor;
44
+ required: true;
45
+ };
46
+ maxLeftWidth: {
47
+ type: NumberConstructor;
48
+ required: false;
49
+ };
50
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
51
+ $slots: {
52
+ left?(_: {}): any;
53
+ right?(_: {}): any;
54
+ };
55
+ })> & Record<string, any>;
56
+ export default HdLeftRight;
@@ -0,0 +1,28 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
+ moduleKey: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
6
+ maxLeftWidth: {
7
+ type: NumberConstructor;
8
+ required: false;
9
+ };
10
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
+ moduleKey: {
12
+ type: StringConstructor;
13
+ required: true;
14
+ };
15
+ maxLeftWidth: {
16
+ type: NumberConstructor;
17
+ required: false;
18
+ };
19
+ }>>, {}, {}>, {
20
+ left?(_: {}): any;
21
+ right?(_: {}): any;
22
+ }>;
23
+ export default _default;
24
+ type __VLS_WithTemplateSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ install: (app: import("vue").App<any>) => void;
3
+ };
4
+ export default _default;
@@ -0,0 +1 @@
1
+ export * from './use-ppboms';
@@ -0,0 +1,19 @@
1
+ export declare enum QueryType {
2
+ ALL = "ALL",
3
+ MODEL_ESN = "MODEL_ESN"
4
+ }
5
+ interface UsePpbomsParams {
6
+ host: string;
7
+ appId: string;
8
+ appSecret: string;
9
+ queryType?: QueryType;
10
+ options?: Record<string, any>;
11
+ }
12
+ export declare const UsePpboms: (params: UsePpbomsParams) => {
13
+ data: import("vue").Ref<any>;
14
+ layoutConfig: import("vue").Ref<any>;
15
+ treeConfig: import("vue").Ref<any>;
16
+ loading: import("vue").Ref<boolean>;
17
+ getDataAndConfig: () => Promise<void>;
18
+ };
19
+ export {};
@@ -0,0 +1,7 @@
1
+ import installer from './defaults';
2
+ export * from './components';
3
+ export * from './hooks';
4
+ export * from './models';
5
+ export * from './utils';
6
+ export declare const install: (app: import("vue").App<any>) => void;
7
+ export default installer;
@@ -0,0 +1,35 @@
1
+ import type { BaseRule } from '../utils';
2
+ import type { YesNo } from './common';
3
+ export declare const defaultTitleTemplate = "${code}";
4
+ export interface BomNodeTitleConfig {
5
+ template: string;
6
+ }
7
+ export interface WorkBenchLayoutConfig {
8
+ maxLeftWidth: number;
9
+ }
10
+ export interface BomTreeNodeConfig {
11
+ title?: BomNodeTitleConfig;
12
+ selectable?: YesNo;
13
+ icon?: string;
14
+ }
15
+ export interface BomLocalFilter {
16
+ placeholder?: string;
17
+ }
18
+ export interface BomTreeConfig {
19
+ filter?: BomLocalFilter;
20
+ nodeConfig: {
21
+ rule: BaseRule<BomTreeNodeConfig>;
22
+ };
23
+ }
24
+ export interface BomNode {
25
+ id: string;
26
+ key: string;
27
+ code: string;
28
+ version: string;
29
+ name: string;
30
+ qty: number;
31
+ children?: BomNode[];
32
+ businessType: string;
33
+ raw: Record<string, any>;
34
+ [key: string]: any;
35
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum YesNo {
2
+ YES = "YES",
3
+ NO = "NO"
4
+ }
5
+ export type Optional<T> = T | undefined | null;
@@ -0,0 +1,2 @@
1
+ export * from './common';
2
+ export * from './bom';
@@ -0,0 +1 @@
1
+ export declare const INSTALLED_KEY: unique symbol;
@@ -0,0 +1,4 @@
1
+ import type { App, Plugin } from '@vue/runtime-core';
2
+ export declare const makeInstaller: (components?: Plugin[]) => {
3
+ install: (app: App) => void;
4
+ };
File without changes
@@ -0,0 +1,3 @@
1
+ import type { BomNode, BomTreeNodeConfig } from '../models';
2
+ import type { BaseRule } from './rule-engine';
3
+ export declare const convertBomDataToTree: (treeData: BomNode[], nodeConfigRule: BaseRule<BomTreeNodeConfig>) => BomNode[];
@@ -0,0 +1 @@
1
+ export declare const getConfig: (host: string, code: string, appId: string, appSecret: string) => Promise<any>;
@@ -0,0 +1,4 @@
1
+ export * from './bom';
2
+ export * from './rule-engine';
3
+ export * from './template';
4
+ export * from './config';
@@ -0,0 +1,20 @@
1
+ import type { Optional } from '../models/common';
2
+ export type RuleCondition = 'default' | 'always' | string | LogicExpression;
3
+ export interface LogicExpression {
4
+ logic: any;
5
+ conditions: any[];
6
+ }
7
+ export interface BaseRule<T> {
8
+ cases: BaseCase<T>[];
9
+ }
10
+ export interface BaseCase<T> {
11
+ key?: string;
12
+ condition: RuleCondition;
13
+ result: T;
14
+ }
15
+ export declare class RuleEngine<T> {
16
+ private readonly rule;
17
+ constructor(rule: BaseRule<T>);
18
+ matchOne(context: any, defaultResult?: T): Optional<T> | T;
19
+ matchMany(context: any, defaultResult?: T): T[];
20
+ }
@@ -0,0 +1 @@
1
+ export declare function genText(data: Record<string, any>, templateStr: string, defaultText?: string): string;
@@ -0,0 +1,3 @@
1
+ import type { UserConfig } from 'unocss';
2
+ declare const _default: UserConfig<{}>;
3
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;