cnhis-design-vue 3.1.15-beta.7 → 3.1.15

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 (66) hide show
  1. package/es/packages/big-table/src/hooks/useAnnotation.js +1 -2
  2. package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +7 -2
  3. package/es/packages/big-table/src/hooks/useEdit.js +16 -8
  4. package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
  5. package/es/packages/fabric-chart/src/hooks/useLeft.js +1 -2
  6. package/es/packages/form-config/index.d.ts +13854 -0
  7. package/es/packages/form-config/index.js +10 -0
  8. package/es/packages/form-config/src/FormConfig.js +113 -0
  9. package/es/packages/form-config/src/FormConfig.vue.d.ts +13856 -0
  10. package/es/packages/form-config/src/components/FormConfigCreator.js +97 -0
  11. package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +5094 -0
  12. package/es/packages/form-config/src/components/FormConfigEdit.js +81 -0
  13. package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +5336 -0
  14. package/es/packages/form-config/src/constants/index.d.ts +28 -0
  15. package/es/packages/form-config/src/constants/index.js +28 -0
  16. package/es/packages/form-config/src/hooks/index.d.ts +2 -0
  17. package/es/packages/form-config/src/hooks/index.js +2 -0
  18. package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +6 -0
  19. package/es/packages/form-config/src/hooks/useConfigurationField.js +103 -0
  20. package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +5 -0
  21. package/es/packages/form-config/src/hooks/usePresetRenderer.js +117 -0
  22. package/es/packages/form-config/src/hooks/useSortable.d.ts +11 -0
  23. package/es/packages/form-config/src/hooks/useSortable.js +31 -0
  24. package/es/packages/form-config/src/types/index.d.ts +18 -0
  25. package/es/packages/form-config/src/types/index.js +1 -0
  26. package/es/packages/form-config/style/index.css +108 -0
  27. package/es/packages/form-render/index.d.ts +3 -3
  28. package/es/packages/form-render/src/FormRender.vue.d.ts +3 -3
  29. package/es/packages/form-render/src/components/renderer/combination/index.js +3 -3
  30. package/es/packages/form-render/src/components/renderer/date.d.ts +2 -2
  31. package/es/packages/form-render/src/components/renderer/formItem.js +3 -3
  32. package/es/packages/form-render/src/components/renderer/select.js +16 -9
  33. package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +2 -2
  34. package/es/packages/form-render/src/hooks/useAsyncQueue.js +4 -8
  35. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -3
  36. package/es/packages/form-render/src/hooks/useFormContext.js +10 -4
  37. package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +2 -2
  38. package/es/packages/form-render/src/types/fieldItem.d.ts +8 -0
  39. package/es/packages/form-render/src/types/index.d.ts +7 -3
  40. package/es/packages/form-render/src/utils/index.d.ts +3 -2
  41. package/es/packages/form-render/src/utils/index.js +30 -7
  42. package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +1 -1
  43. package/es/packages/index.css +108 -0
  44. package/es/packages/index.d.ts +4 -1
  45. package/es/packages/index.js +5 -2
  46. package/es/packages/scale-view/src/hooks/scaleview-init.js +35 -35
  47. package/es/packages/shortcut-provider/index.d.ts +17 -2
  48. package/es/packages/shortcut-provider/index.js +1 -1
  49. package/es/packages/shortcut-provider/src/ShortcutProvider.js +5 -1
  50. package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +17 -2
  51. package/es/packages/shortcut-provider/src/hooks/index.js +1 -1
  52. package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +10 -10
  53. package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +45 -38
  54. package/es/packages/shortcut-provider/src/types/index.d.ts +2 -19
  55. package/es/packages/shortcut-setter/index.d.ts +1701 -4286
  56. package/es/packages/shortcut-setter/src/ShortcutSetter.js +63 -10
  57. package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +1723 -4306
  58. package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +26 -95
  59. package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +30 -3363
  60. package/es/packages/shortcut-setter/src/types/index.d.ts +6 -0
  61. package/es/packages/shortcut-setter/src/types/index.js +1 -0
  62. package/es/src/utils/state.d.ts +29 -0
  63. package/es/src/utils/state.js +44 -0
  64. package/package.json +2 -1
  65. package/es/packages/shortcut-setter/constant/index.d.ts +0 -4
  66. package/es/packages/shortcut-setter/constant/index.js +0 -7
@@ -0,0 +1,6 @@
1
+ import { ShortcutSignatureInfo } from '../../../../../es/packages/shortcut-provider';
2
+ export interface ShortcutSetterExpose {
3
+ loadSignature(): void;
4
+ getSignature(): Record<string, ShortcutSignatureInfo>;
5
+ setSignature(): void;
6
+ }
@@ -0,0 +1,29 @@
1
+ import { Ref, UnwrapRef, WritableComputedOptions, WritableComputedRef, ComputedRef } from 'vue';
2
+ interface GetState<T> {
3
+ (isRef: true): Ref<UnwrapRef<T>>;
4
+ (isRef?: false): UnwrapRef<T>;
5
+ }
6
+ export declare function useState<T>(initValue?: T): [GetState<T>, (val: UnwrapRef<T>) => UnwrapRef<T>];
7
+ export declare function useRef<T>(): GetState<T | null>;
8
+ /**
9
+ * v-for的ref引用
10
+ */
11
+ export declare function useRefs<T>(): [Set<T>, (el: T) => void];
12
+ /**
13
+ * v-for的ref引用
14
+ * @return 数组
15
+ */
16
+ export declare function useRefsArray<T>(): [T[], (el: T) => void];
17
+ interface GetComputed<T, R> {
18
+ (isRef: true): R;
19
+ (isRef: false): T;
20
+ (): T;
21
+ }
22
+ export declare function useComputed<T>(getter: WritableComputedOptions<T>['get']): GetComputed<T, ComputedRef<T>>;
23
+ export declare function useComputed<T>(options: WritableComputedOptions<T>): [GetComputed<T, WritableComputedRef<T>>, (val: T) => void];
24
+ /**
25
+ * 返回{ [key]: Ref }
26
+ * @params obj { [变量名]: useState或useComputed返回的getter函数 }
27
+ */
28
+ export declare function getRefs(obj: Record<string, GetState<any> | GetComputed<any, any>>): Record<string, Ref<any>>;
29
+ export {};
@@ -0,0 +1,44 @@
1
+ import { ref, onBeforeUpdate, computed, unref } from 'vue';
2
+
3
+ function useState(initValue) {
4
+ const state = ref(initValue);
5
+ const getState = (isRef) => isRef ? state : unref(state);
6
+ return [getState, (val) => state.value = val];
7
+ }
8
+ function useRef() {
9
+ return useState(null)[0];
10
+ }
11
+ function useRefs() {
12
+ const itemRefs = /* @__PURE__ */ new Set();
13
+ const setItemRef = (el) => el && itemRefs.add(el);
14
+ onBeforeUpdate(() => itemRefs.clear());
15
+ return [itemRefs, setItemRef];
16
+ }
17
+ function useRefsArray() {
18
+ let itemRefs = [];
19
+ const setItemRef = (el) => {
20
+ itemRefs.push(el);
21
+ };
22
+ onBeforeUpdate(() => {
23
+ itemRefs = [];
24
+ });
25
+ return [itemRefs, setItemRef];
26
+ }
27
+ function isWritableComputedOptions(arg) {
28
+ return typeof arg === "object" && Reflect.has(arg || {}, "set");
29
+ }
30
+ function useComputed(arg) {
31
+ const data = isWritableComputedOptions(arg) ? computed(arg) : computed(arg);
32
+ const getData = (isRef) => isRef ? data : data.value;
33
+ if (!isWritableComputedOptions(arg)) {
34
+ return getData;
35
+ }
36
+ return [getData, (val) => data.value = val];
37
+ }
38
+ function getRefs(obj) {
39
+ const result = {};
40
+ Object.entries(obj).forEach(([k, fn]) => result[k] = fn(true));
41
+ return result;
42
+ }
43
+
44
+ export { getRefs, useComputed, useRef, useRefs, useRefsArray, useState };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
3
  "private": false,
4
- "version": "3.1.15-beta.7",
4
+ "version": "3.1.15",
5
5
  "license": "ISC",
6
6
  "module": "es/packages/index.js",
7
7
  "main": "es/packages/index.js",
@@ -90,6 +90,7 @@
90
90
  "@types/markdown-it": "^12.2.3",
91
91
  "@types/node": "^17.0.38",
92
92
  "@types/replacestream": "^4.0.1",
93
+ "@types/sortablejs": "^1.13.0",
93
94
  "@types/vue-router": "^2.0.0",
94
95
  "@typescript-eslint/eslint-plugin": "^5.30.7",
95
96
  "@typescript-eslint/parser": "^5.30.7",
@@ -1,4 +0,0 @@
1
- export declare enum ShortcutInputState {
2
- STATIC = 0,
3
- EDIT = 1
4
- }
@@ -1,7 +0,0 @@
1
- var ShortcutInputState = /* @__PURE__ */ ((ShortcutInputState2) => {
2
- ShortcutInputState2[ShortcutInputState2["STATIC"] = 0] = "STATIC";
3
- ShortcutInputState2[ShortcutInputState2["EDIT"] = 1] = "EDIT";
4
- return ShortcutInputState2;
5
- })(ShortcutInputState || {});
6
-
7
- export { ShortcutInputState };