cnhis-design-vue 3.1.15-beta.7 → 3.1.16-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.
- package/es/packages/big-table/src/hooks/useAnnotation.js +1 -2
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +7 -2
- package/es/packages/big-table/src/hooks/useEdit.js +16 -8
- package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
- package/es/packages/fabric-chart/src/hooks/useLeft.js +1 -2
- package/es/packages/form-config/index.d.ts +13854 -0
- package/es/packages/form-config/index.js +10 -0
- package/es/packages/form-config/src/FormConfig.js +113 -0
- package/es/packages/form-config/src/FormConfig.vue.d.ts +13856 -0
- package/es/packages/form-config/src/components/FormConfigCreator.js +97 -0
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +5094 -0
- package/es/packages/form-config/src/components/FormConfigEdit.js +81 -0
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +5336 -0
- package/es/packages/form-config/src/constants/index.d.ts +28 -0
- package/es/packages/form-config/src/constants/index.js +28 -0
- package/es/packages/form-config/src/hooks/index.d.ts +2 -0
- package/es/packages/form-config/src/hooks/index.js +2 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +6 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.js +103 -0
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +5 -0
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +117 -0
- package/es/packages/form-config/src/hooks/useSortable.d.ts +11 -0
- package/es/packages/form-config/src/hooks/useSortable.js +31 -0
- package/es/packages/form-config/src/types/index.d.ts +18 -0
- package/es/packages/form-config/src/types/index.js +1 -0
- package/es/packages/form-config/style/index.css +108 -0
- package/es/packages/form-render/index.d.ts +3 -3
- package/es/packages/form-render/src/FormRender.vue.d.ts +3 -3
- package/es/packages/form-render/src/components/renderer/combination/index.js +3 -3
- package/es/packages/form-render/src/components/renderer/date.d.ts +2 -2
- package/es/packages/form-render/src/components/renderer/formItem.js +3 -3
- package/es/packages/form-render/src/components/renderer/select.js +16 -9
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +2 -2
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +4 -8
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -3
- package/es/packages/form-render/src/hooks/useFormContext.js +10 -4
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +2 -2
- package/es/packages/form-render/src/types/fieldItem.d.ts +8 -0
- package/es/packages/form-render/src/types/index.d.ts +7 -3
- package/es/packages/form-render/src/utils/index.d.ts +3 -2
- package/es/packages/form-render/src/utils/index.js +30 -7
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +1 -1
- package/es/packages/index.css +108 -0
- package/es/packages/index.d.ts +4 -1
- package/es/packages/index.js +5 -2
- package/es/packages/shortcut-provider/index.d.ts +17 -2
- package/es/packages/shortcut-provider/index.js +1 -1
- package/es/packages/shortcut-provider/src/ShortcutProvider.js +5 -1
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +17 -2
- package/es/packages/shortcut-provider/src/hooks/index.js +1 -1
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +10 -10
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +45 -38
- package/es/packages/shortcut-provider/src/types/index.d.ts +2 -19
- package/es/packages/shortcut-setter/index.d.ts +2 -6040
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +60 -10
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -6041
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +26 -95
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +30 -3363
- package/es/packages/shortcut-setter/src/types/index.d.ts +6 -0
- package/es/packages/shortcut-setter/src/types/index.js +1 -0
- package/es/src/utils/state.d.ts +29 -0
- package/es/src/utils/state.js +44 -0
- package/package.json +2 -1
- package/es/packages/shortcut-setter/constant/index.d.ts +0 -4
- package/es/packages/shortcut-setter/constant/index.js +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -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.
|
|
4
|
+
"version": "3.1.16-beta.0",
|
|
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,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 };
|