cnhis-design-vue 3.1.22 → 3.1.23-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 (58) hide show
  1. package/es/components/big-table/index.d.ts +8 -0
  2. package/es/components/big-table/src/BigTable.vue.d.ts +8 -0
  3. package/es/components/big-table/src/components/edit-form/edit-separate.js +4 -1
  4. package/es/components/big-table/src/hooks/useSeparateRow2.js +1 -41
  5. package/es/components/field-set/src/FieldSet.js +5 -1
  6. package/es/components/form-render/src/hooks/useFormContext2.js +2 -1
  7. package/es/components/form-render/src/utils/index.d.ts +0 -1
  8. package/es/components/form-render/src/utils/index.js +1 -10
  9. package/es/components/iho-table/index.d.ts +141 -277
  10. package/es/components/iho-table/index.js +1 -1
  11. package/es/components/iho-table/src/IhoTable.js +52 -31
  12. package/es/components/iho-table/src/IhoTable.vue.d.ts +142 -278
  13. package/es/components/iho-table/src/constants/index.d.ts +5 -2
  14. package/es/components/iho-table/src/constants/index.js +1 -1
  15. package/es/components/iho-table/src/constants/index2.js +8 -5
  16. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +10 -3
  17. package/es/components/iho-table/src/hooks/tapHooks/index2.js +32 -21
  18. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +5 -3
  19. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks2.js +3 -3
  20. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +177 -60
  21. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks2.js +223 -59
  22. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.d.ts +10 -0
  23. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -0
  24. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks2.js +27 -0
  25. package/es/components/iho-table/src/plugins/index.js +2 -1
  26. package/es/components/iho-table/src/plugins/index2.js +2 -1
  27. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +2 -1
  28. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.d.ts +2 -0
  29. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.js +2 -0
  30. package/es/components/iho-table/src/plugins/rendererPlugins/{inputs → editableWidgets}/inputRendererPlugins.d.ts +0 -0
  31. package/es/components/iho-table/src/plugins/rendererPlugins/{inputs → editableWidgets}/inputRendererPlugins.js +0 -5
  32. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/edit-separate.js +110 -0
  33. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/edit-separate.vue.d.ts +107 -0
  34. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.d.ts +1 -0
  35. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +158 -0
  36. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separate-utils.d.ts +14 -0
  37. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separate-utils.js +1 -0
  38. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separate-utils2.js +54 -0
  39. package/es/components/iho-table/src/plugins/rendererPlugins/index.d.ts +1 -1
  40. package/es/components/iho-table/src/plugins/rendererPlugins/index.js +2 -1
  41. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +2 -1
  42. package/es/components/iho-table/src/types/index.d.ts +8 -3
  43. package/es/components/iho-table/src/types/index.js +1 -1
  44. package/es/components/iho-table/src/types/pluginType.d.ts +97 -83
  45. package/es/components/iho-table/src/types/pluginType.js +1 -1
  46. package/es/components/iho-table/src/types/pluginType2.js +3 -1
  47. package/es/components/iho-table/src/utils/index2.js +1 -1
  48. package/es/components/index.js +1 -1
  49. package/es/components/info-header/index.d.ts +2 -0
  50. package/es/components/info-header/src/InfoHeader.js +3 -1
  51. package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -0
  52. package/es/shared/utils/index.d.ts +4 -0
  53. package/es/shared/utils/index.js +1 -1
  54. package/es/shared/utils/index2.js +60 -2
  55. package/es/shared/utils/tapable/AsyncSeriesHook.js +17 -2
  56. package/package.json +2 -2
  57. package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.d.ts +0 -1
  58. package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.js +0 -1
@@ -1,5 +1,14 @@
1
- import { isString } from 'lodash-es';
1
+ import { useMemoize } from '@vueuse/core';
2
+ import { isArray, isString } from 'lodash-es';
2
3
 
4
+ function traverse(target, handler, keys = "children") {
5
+ arrayed(target).forEach((item) => {
6
+ handler(item);
7
+ arrayed(keys).forEach((key) => {
8
+ isArray(item[key]) && traverse(item[key], handler);
9
+ });
10
+ });
11
+ }
3
12
  function safeComponentRegister(app, component, cName = component.name, scheduler) {
4
13
  if (!cName)
5
14
  throw new Error(`[CUI]: invalid component name for ${component}`);
@@ -26,5 +35,54 @@ function arrayed(maybeArray) {
26
35
  return maybeArray;
27
36
  return [maybeArray];
28
37
  }
38
+ function uuidGenerator() {
39
+ if (window.isSecureContext && window.crypto)
40
+ return `key${window.crypto.randomUUID()}`;
41
+ const uuid = "xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
42
+ const r = Math.random() * 16 | 0, v = c == "x" ? r : r & 3 | 8;
43
+ return v.toString(16);
44
+ });
45
+ return `key${uuid}`;
46
+ }
47
+ const getStringWidth = /* @__PURE__ */ useMemoize(function(str) {
48
+ if (!str)
49
+ return 0;
50
+ return [...str].reduce((width, char) => {
51
+ if (/[a-z]/.test(char)) {
52
+ return width + 8;
53
+ }
54
+ if (/[A-Z]/.test(char)) {
55
+ return width + 12;
56
+ }
57
+ if (/\d/.test(char)) {
58
+ return width + 9;
59
+ }
60
+ if (/\./.test(char)) {
61
+ return width + 4;
62
+ }
63
+ if (/[\u4e00-\u9fa5]/.test(char)) {
64
+ return width + 15;
65
+ }
66
+ if (/-/.test(char)) {
67
+ return width + 4;
68
+ }
69
+ if (/[()]/.test(char)) {
70
+ return width + 14;
71
+ }
72
+ if (/[)(]/.test(char)) {
73
+ return width + 5;
74
+ }
75
+ if (/-/.test(char)) {
76
+ return width + 10;
77
+ }
78
+ if (/%/.test(char)) {
79
+ return width + 14;
80
+ }
81
+ if (/‰/.test(char)) {
82
+ return width + 16;
83
+ }
84
+ return width + 6;
85
+ }, 0);
86
+ });
29
87
 
30
- export { arrayed, generateTimeFormat, safeComponentRegister };
88
+ export { arrayed, generateTimeFormat, getStringWidth, safeComponentRegister, traverse, uuidGenerator };
@@ -1,4 +1,4 @@
1
- import './Hook.js';
1
+ import Hook from './Hook.js';
2
2
  import HookCodeFactory from './HookCodeFactory.js';
3
3
 
4
4
  class AsyncSeriesHookCodeFactory extends HookCodeFactory {
@@ -9,4 +9,19 @@ class AsyncSeriesHookCodeFactory extends HookCodeFactory {
9
9
  });
10
10
  }
11
11
  }
12
- new AsyncSeriesHookCodeFactory();
12
+ const factory = new AsyncSeriesHookCodeFactory();
13
+ const COMPILE = function(options) {
14
+ factory.setup(this, options);
15
+ return factory.create(options);
16
+ };
17
+ function AsyncSeriesHook(args = [], name = void 0) {
18
+ const hook = new Hook(args, name);
19
+ hook.constructor = AsyncSeriesHook;
20
+ hook.compile = COMPILE;
21
+ hook._call = void 0;
22
+ hook.call = void 0;
23
+ return hook;
24
+ }
25
+ AsyncSeriesHook.prototype = null;
26
+
27
+ export { AsyncSeriesHook as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.22",
3
+ "version": "3.1.23-beta.0",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -66,5 +66,5 @@
66
66
  "iOS 7",
67
67
  "last 3 iOS versions"
68
68
  ],
69
- "gitHead": "8e4ed1f54e0fddab1fe79a907d1bb37982ac1552"
69
+ "gitHead": "3239c2e9a7ced5091266fc42e325a148eac27b4c"
70
70
  }
@@ -1 +0,0 @@
1
- export * from './inputRendererPlugins';
@@ -1 +0,0 @@
1
- export { inputRendererPlugins } from './inputRendererPlugins.js';