cnhis-design-vue 3.1.23-beta.2 → 3.1.23-beta.4

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 (55) hide show
  1. package/README.md +123 -123
  2. package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +8 -2
  3. package/es/components/big-table/src/components/edit-form/useCommon.d.ts +4 -0
  4. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  5. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  6. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  7. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  8. package/es/components/fabric-chart/src/hooks/useEvent2.js +8 -4
  9. package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
  10. package/es/components/form-config/index.d.ts +6 -0
  11. package/es/components/form-config/src/FormConfig.vue.d.ts +6 -0
  12. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -0
  13. package/es/components/form-render/src/components/renderer/search.d.ts +13 -1
  14. package/es/components/form-render/src/components/renderer/searchCascader.d.ts +63 -0
  15. package/es/components/form-render/src/types/fieldItem.d.ts +6 -0
  16. package/es/components/form-render/src/utils/schema2.js +1 -4
  17. package/es/components/iho-table/index.d.ts +100 -270
  18. package/es/components/iho-table/src/IhoTable.vue.d.ts +100 -270
  19. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +2 -2
  20. package/es/components/iho-table/src/plugins/index.js +1 -1
  21. package/es/components/iho-table/src/plugins/index2.js +1 -1
  22. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.d.ts +1 -1
  23. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.js +1 -1
  24. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.d.ts +1 -0
  25. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/{inputRendererPlugins.js → inputRendererPlugin.js} +2 -2
  26. package/es/components/iho-table/src/plugins/rendererPlugins/index.js +1 -1
  27. package/es/components/index.css +1 -1
  28. package/es/components/search-cascader/index.d.ts +133 -0
  29. package/es/components/search-cascader/index.js +1 -0
  30. package/es/components/search-cascader/index2.js +10 -0
  31. package/es/components/search-cascader/src/SearchCascader.js +189 -0
  32. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +135 -0
  33. package/es/components/search-cascader/src/components/SearchMenu.d.ts +36 -0
  34. package/es/components/search-cascader/src/components/SearchMenu.js +125 -0
  35. package/es/components/search-cascader/src/components/index.d.ts +1 -0
  36. package/es/components/search-cascader/src/components/index.js +1 -0
  37. package/es/components/search-cascader/src/constants/index.d.ts +3 -0
  38. package/es/components/search-cascader/src/constants/index.js +1 -0
  39. package/es/components/search-cascader/src/constants/index2.js +3 -0
  40. package/es/components/search-cascader/src/hooks/index.d.ts +1 -0
  41. package/es/components/search-cascader/src/hooks/index.js +1 -0
  42. package/es/components/search-cascader/src/hooks/useCssVariable.d.ts +3 -0
  43. package/es/components/search-cascader/src/hooks/useCssVariable.js +1 -0
  44. package/es/components/search-cascader/src/hooks/useCssVariable2.js +7 -0
  45. package/es/components/search-cascader/src/utils/index.d.ts +2 -0
  46. package/es/components/search-cascader/src/utils/index.js +1 -0
  47. package/es/components/search-cascader/src/utils/index2.js +11 -0
  48. package/es/components/search-cascader/style/index.css +1 -0
  49. package/es/components/shortcut-setter/index.d.ts +6 -0
  50. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -0
  51. package/es/shared/utils/index.d.ts +1 -1
  52. package/es/shared/utils/index2.js +14 -5
  53. package/es/shared/utils/tapable/index.d.ts +139 -0
  54. package/package.json +2 -2
  55. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugins.d.ts +0 -1
package/README.md CHANGED
@@ -1,123 +1,123 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式 1(按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式 2(全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3. 注意
65
-
66
- 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
-
68
- ```typescript
69
- // main.ts
70
- import { createApp } from 'vue';
71
- import App from './App.vue';
72
-
73
- import { CGrid } from 'cnhis-design-vue';
74
- // 或者
75
- import { CBigTable } from 'cnhis-design-vue';
76
-
77
- const app = createApp(App);
78
- app.use(CGrid);
79
- // 或者
80
- app.use(CBigTable);
81
- app.mount('#app');
82
- ```
83
-
84
- ## 4.FAQ
85
-
86
- ### 4.1 项目打包后样式丢失
87
-
88
- > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
-
90
- ```typescript
91
- // vite.config.ts
92
- import { defineConfig } from 'vite';
93
-
94
- export default defineConfig({
95
- rollupOptions: {
96
- // ..otherOptions
97
- output: {
98
- dir: './dist',
99
- manualChunks(id: string) {
100
- if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
- return 'vendor';
102
- }
103
- }
104
- }
105
- }
106
- });
107
- ```
108
-
109
- ### 4.2 找不到文件
110
-
111
- > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
-
113
- ```javascript
114
- // vite.config.ts
115
- const config = {
116
- // ...otherOptions
117
- resolve: {
118
- // ...otherOptions
119
- // 如果没有配置, 则不用考虑
120
- extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
- }
122
- };
123
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式 1(按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式 2(全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3. 注意
65
+
66
+ 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
+
68
+ ```typescript
69
+ // main.ts
70
+ import { createApp } from 'vue';
71
+ import App from './App.vue';
72
+
73
+ import { CGrid } from 'cnhis-design-vue';
74
+ // 或者
75
+ import { CBigTable } from 'cnhis-design-vue';
76
+
77
+ const app = createApp(App);
78
+ app.use(CGrid);
79
+ // 或者
80
+ app.use(CBigTable);
81
+ app.mount('#app');
82
+ ```
83
+
84
+ ## 4.FAQ
85
+
86
+ ### 4.1 项目打包后样式丢失
87
+
88
+ > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
+
90
+ ```typescript
91
+ // vite.config.ts
92
+ import { defineConfig } from 'vite';
93
+
94
+ export default defineConfig({
95
+ rollupOptions: {
96
+ // ..otherOptions
97
+ output: {
98
+ dir: './dist',
99
+ manualChunks(id: string) {
100
+ if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
+ return 'vendor';
102
+ }
103
+ }
104
+ }
105
+ }
106
+ });
107
+ ```
108
+
109
+ ### 4.2 找不到文件
110
+
111
+ > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
+
113
+ ```javascript
114
+ // vite.config.ts
115
+ const config = {
116
+ // ...otherOptions
117
+ resolve: {
118
+ // ...otherOptions
119
+ // 如果没有配置, 则不用考虑
120
+ extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
+ }
122
+ };
123
+ ```
@@ -2149,8 +2149,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2149
2149
  }, {
2150
2150
  immediate: true
2151
2151
  });
2152
- nextTick(() => {
2153
- loadData(props.data);
2152
+ watch([() => props.data, () => {
2153
+ var _a;
2154
+ return (_a = props.data) == null ? void 0 : _a.length;
2155
+ }], async ([value]) => {
2156
+ await nextTick();
2157
+ loadData(value);
2158
+ }, {
2159
+ immediate: true
2154
2160
  });
2155
2161
  watch(() => currentCheckedKeys, (val) => {
2156
2162
  setVisibleCheckAllWrap(state, props, currentCheckedKeys.value);
@@ -0,0 +1,4 @@
1
+ export declare const useCommon: (props: any, attrs: any) => {
2
+ formRef: import("vue").Ref<HTMLElement | null>;
3
+ isShow: import("vue").Ref<boolean>;
4
+ };
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/Viewer';
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/features/modeling';
@@ -0,0 +1 @@
1
+ declare module 'diagram-js/lib/navigation/movecanvas';
@@ -29,9 +29,8 @@ function useCanvasEvent(canvas, propItems, emits) {
29
29
  canvas.value.add(rect);
30
30
  return rect;
31
31
  }
32
+ let selections = [];
32
33
  function initSelection() {
33
- if (typeof (selectionStyle == null ? void 0 : selectionStyle.evented) === "boolean" && !(selectionStyle == null ? void 0 : selectionStyle.evented))
34
- return;
35
34
  const selections2 = [];
36
35
  selections2.push(drawRect({
37
36
  left: iconsWidth,
@@ -91,7 +90,6 @@ function useCanvasEvent(canvas, propItems, emits) {
91
90
  canvas.value.renderAll();
92
91
  return selections2;
93
92
  }
94
- const selections = initSelection();
95
93
  function addSelectionListener() {
96
94
  canvas.value.on("selection:cleared", selectionCB);
97
95
  canvas.value.on("selection:updated", selectionCB);
@@ -102,13 +100,19 @@ function useCanvasEvent(canvas, propItems, emits) {
102
100
  });
103
101
  }
104
102
  }
105
- addSelectionListener();
106
103
  function select(key) {
107
104
  canvas.value.discardActiveObject().renderAll();
108
105
  const obj = selections == null ? void 0 : selections.find((obj2) => obj2.key === key);
109
106
  obj == null ? void 0 : obj.bringToFront();
110
107
  obj && canvas.value.setActiveObject(obj);
111
108
  }
109
+ function init() {
110
+ if (typeof (selectionStyle == null ? void 0 : selectionStyle.evented) === "boolean" && !(selectionStyle == null ? void 0 : selectionStyle.evented))
111
+ return;
112
+ selections = initSelection();
113
+ addSelectionListener();
114
+ }
115
+ init();
112
116
  return { select };
113
117
  }
114
118