@vue-start/pro 0.4.7 → 0.4.8
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/dist/index.d.ts +8 -30
- package/dist/index.es.js +4 -83
- package/dist/index.js +2 -84
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,13 @@ declare type TOption = {
|
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
};
|
|
33
33
|
declare type TOptions = TOption[];
|
|
34
|
+
declare type TreeOption = {
|
|
35
|
+
label?: string;
|
|
36
|
+
value: string | number;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
children?: TreeOption[];
|
|
39
|
+
};
|
|
40
|
+
declare type TreeOptions = TreeOption[];
|
|
34
41
|
declare type TColumn = {
|
|
35
42
|
title?: string | VNode;
|
|
36
43
|
dataIndex?: string | number;
|
|
@@ -910,31 +917,6 @@ declare const proFormListProps: () => {
|
|
|
910
917
|
declare type ProFormListProps = Partial<ExtractPropTypes<ReturnType<typeof proFormListProps>>>;
|
|
911
918
|
declare const createFormList: (FormItem: any) => any;
|
|
912
919
|
|
|
913
|
-
declare type TData = Record<string, any>;
|
|
914
|
-
/**
|
|
915
|
-
* 根据value从treeData中找到对象
|
|
916
|
-
* @param data
|
|
917
|
-
* @param value
|
|
918
|
-
* @param fieldNames
|
|
919
|
-
* @param cb 对象:同步 方法:回调,可以理解为异步
|
|
920
|
-
*/
|
|
921
|
-
declare const findTargetInTree: (data: TData[], value: TOption["value"], fieldNames: FieldNames, cb: {
|
|
922
|
-
target?: TData | undefined;
|
|
923
|
-
index?: number | undefined;
|
|
924
|
-
list?: TData[] | undefined;
|
|
925
|
-
} | ((index: number, target: TData, list: TData[]) => void)) => void;
|
|
926
|
-
/**
|
|
927
|
-
* 根据value从treeData中找出对象及父列表
|
|
928
|
-
* @param data
|
|
929
|
-
* @param value
|
|
930
|
-
* @param fieldNames
|
|
931
|
-
* @param cb
|
|
932
|
-
* @param parent
|
|
933
|
-
*/
|
|
934
|
-
declare const findTargetListInTree: (data: TData[], value: TOption["value"], fieldNames: FieldNames, cb: {
|
|
935
|
-
list?: TData[] | undefined;
|
|
936
|
-
} | ((list?: TData[] | undefined) => void), parent?: TData[]) => void;
|
|
937
|
-
|
|
938
920
|
/**
|
|
939
921
|
* 剔除showState或showStateRules规则为!true的值
|
|
940
922
|
* @param values
|
|
@@ -957,13 +939,9 @@ declare const convertPathToList: (path: undefined | string | number | (string |
|
|
|
957
939
|
*/
|
|
958
940
|
declare const mergeStateToList: (list: Record<string, any>[], listState: Record<string, any>, id: string | number | ((item: Record<string, any>) => string | number)) => Record<string, any>[];
|
|
959
941
|
|
|
960
|
-
/**
|
|
961
|
-
* 唯一id
|
|
962
|
-
*/
|
|
963
|
-
declare const generateId: () => string;
|
|
964
942
|
/**
|
|
965
943
|
* ref 传递
|
|
966
944
|
*/
|
|
967
945
|
declare const createExpose: (methods: string[], targetRef: Ref$1) => {};
|
|
968
946
|
|
|
969
|
-
export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, FieldNames, FormItemProps, GridProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IElementConfig, IHighConfig, IListData, IOperateItem, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, InternalNamePath, NamePath, ProCurd, ProCurdAddOrEditProps, ProCurdListProps, ProCurdProps, ProFormItemProps, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchFormProps, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent,
|
|
947
|
+
export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, FieldNames, FormItemProps, GridProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IElementConfig, IHighConfig, IListData, IOperateItem, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, InternalNamePath, NamePath, ProCurd, ProCurdAddOrEditProps, ProCurdListProps, ProCurdProps, ProFormItemProps, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchFormProps, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, TreeOption, TreeOptions, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, createVNode, mergeProps, isVNode, computed, h, inject, reactive, Fragment, provide, ref } from 'vue';
|
|
2
|
-
import { map, isString, forEach, reduce, size, get, set, pick, omit, isArray, some, keys, isFunction, head, isObject,
|
|
2
|
+
import { map, isString, forEach, reduce, size, get, set, pick, omit, isArray, some, keys, isFunction, head, isObject, filter as filter$1, split, isEmpty, mergeWith, sortBy, concat, isUndefined, debounce, clone, isBoolean } from 'lodash';
|
|
3
3
|
import { filter, tap, merge, Subject } from 'rxjs';
|
|
4
4
|
import { useEffect, setReactiveValue, useWatch } from '@vue-start/hooks';
|
|
5
5
|
import { useRequestProvide, isFailedRequestActor, isPreRequestActor, isDoneRequestActor } from '@vue-start/request';
|
|
@@ -754,78 +754,6 @@ var CurdAddAction;
|
|
|
754
754
|
CurdAddAction["CONTINUE"] = "CONTINUE";
|
|
755
755
|
})(CurdAddAction || (CurdAddAction = {}));
|
|
756
756
|
|
|
757
|
-
var treeDefaultNames = {
|
|
758
|
-
children: "children",
|
|
759
|
-
label: "label",
|
|
760
|
-
value: "value"
|
|
761
|
-
};
|
|
762
|
-
/**
|
|
763
|
-
* 根据value从treeData中找到对象
|
|
764
|
-
* @param data
|
|
765
|
-
* @param value
|
|
766
|
-
* @param fieldNames
|
|
767
|
-
* @param cb 对象:同步 方法:回调,可以理解为异步
|
|
768
|
-
*/
|
|
769
|
-
|
|
770
|
-
var findTargetInTree = function findTargetInTree(data, value, fieldNames, cb) {
|
|
771
|
-
var index = findIndex(data, function (item) {
|
|
772
|
-
return get(item, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || treeDefaultNames.value) === value;
|
|
773
|
-
});
|
|
774
|
-
|
|
775
|
-
if (index > -1) {
|
|
776
|
-
if (isFunction(cb)) {
|
|
777
|
-
cb(index, data[index], data);
|
|
778
|
-
} else {
|
|
779
|
-
cb.index = index;
|
|
780
|
-
cb.target = data[index];
|
|
781
|
-
cb.list = data;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
return;
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
forEach(data, function (item) {
|
|
788
|
-
var children = get(item, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || treeDefaultNames.children);
|
|
789
|
-
|
|
790
|
-
if (size(children) > 0) {
|
|
791
|
-
findTargetInTree(children, value, fieldNames, cb);
|
|
792
|
-
}
|
|
793
|
-
});
|
|
794
|
-
};
|
|
795
|
-
/**
|
|
796
|
-
* 根据value从treeData中找出对象及父列表
|
|
797
|
-
* @param data
|
|
798
|
-
* @param value
|
|
799
|
-
* @param fieldNames
|
|
800
|
-
* @param cb
|
|
801
|
-
* @param parent
|
|
802
|
-
*/
|
|
803
|
-
|
|
804
|
-
var findTargetListInTree = function findTargetListInTree(data, value, fieldNames, cb) {
|
|
805
|
-
var parent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
806
|
-
var target = find(data, function (item) {
|
|
807
|
-
return get(item, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || treeDefaultNames.value) === value;
|
|
808
|
-
});
|
|
809
|
-
|
|
810
|
-
if (target) {
|
|
811
|
-
if (isFunction(cb)) {
|
|
812
|
-
cb([].concat(_toConsumableArray(parent), [target]));
|
|
813
|
-
} else {
|
|
814
|
-
cb.list = [].concat(_toConsumableArray(parent), [target]);
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
return;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
forEach(data, function (item) {
|
|
821
|
-
var children = get(item, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || treeDefaultNames.children);
|
|
822
|
-
|
|
823
|
-
if (size(children) > 0) {
|
|
824
|
-
findTargetListInTree(children, value, fieldNames, cb, [].concat(_toConsumableArray(parent), [item]));
|
|
825
|
-
}
|
|
826
|
-
});
|
|
827
|
-
};
|
|
828
|
-
|
|
829
757
|
/**
|
|
830
758
|
* 剔除showState或showStateRules规则为!true的值
|
|
831
759
|
* @param values
|
|
@@ -904,15 +832,8 @@ var mergeStateToList = function mergeStateToList(list, listState, id) {
|
|
|
904
832
|
});
|
|
905
833
|
};
|
|
906
834
|
|
|
907
|
-
/**
|
|
908
|
-
*
|
|
909
|
-
*/
|
|
910
|
-
|
|
911
|
-
var generateId = function generateId() {
|
|
912
|
-
return Number(Math.random().toString().substr(3, 3) + Date.now()).toString(36);
|
|
913
|
-
};
|
|
914
|
-
/**
|
|
915
|
-
* ref 传递
|
|
835
|
+
/**
|
|
836
|
+
* ref 传递
|
|
916
837
|
*/
|
|
917
838
|
|
|
918
839
|
var createExpose = function createExpose(methods, targetRef) {
|
|
@@ -2754,4 +2675,4 @@ var createTable = function createTable(Table, Props, tableMethods) {
|
|
|
2754
2675
|
});
|
|
2755
2676
|
};
|
|
2756
2677
|
|
|
2757
|
-
export { CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, ProCurd, ProModalCurd, ProModule, ProPageCurd, RequestAction, SearchMode, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage,
|
|
2678
|
+
export { CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, ProCurd, ProModalCurd, ProModule, ProPageCurd, RequestAction, SearchMode, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
|
package/dist/index.js
CHANGED
|
@@ -758,78 +758,6 @@ exports.CurdAddAction = void 0;
|
|
|
758
758
|
CurdAddAction["CONTINUE"] = "CONTINUE";
|
|
759
759
|
})(exports.CurdAddAction || (exports.CurdAddAction = {}));
|
|
760
760
|
|
|
761
|
-
var treeDefaultNames = {
|
|
762
|
-
children: "children",
|
|
763
|
-
label: "label",
|
|
764
|
-
value: "value"
|
|
765
|
-
};
|
|
766
|
-
/**
|
|
767
|
-
* 根据value从treeData中找到对象
|
|
768
|
-
* @param data
|
|
769
|
-
* @param value
|
|
770
|
-
* @param fieldNames
|
|
771
|
-
* @param cb 对象:同步 方法:回调,可以理解为异步
|
|
772
|
-
*/
|
|
773
|
-
|
|
774
|
-
var findTargetInTree = function findTargetInTree(data, value, fieldNames, cb) {
|
|
775
|
-
var index = lodash.findIndex(data, function (item) {
|
|
776
|
-
return lodash.get(item, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || treeDefaultNames.value) === value;
|
|
777
|
-
});
|
|
778
|
-
|
|
779
|
-
if (index > -1) {
|
|
780
|
-
if (lodash.isFunction(cb)) {
|
|
781
|
-
cb(index, data[index], data);
|
|
782
|
-
} else {
|
|
783
|
-
cb.index = index;
|
|
784
|
-
cb.target = data[index];
|
|
785
|
-
cb.list = data;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
return;
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
lodash.forEach(data, function (item) {
|
|
792
|
-
var children = lodash.get(item, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || treeDefaultNames.children);
|
|
793
|
-
|
|
794
|
-
if (lodash.size(children) > 0) {
|
|
795
|
-
findTargetInTree(children, value, fieldNames, cb);
|
|
796
|
-
}
|
|
797
|
-
});
|
|
798
|
-
};
|
|
799
|
-
/**
|
|
800
|
-
* 根据value从treeData中找出对象及父列表
|
|
801
|
-
* @param data
|
|
802
|
-
* @param value
|
|
803
|
-
* @param fieldNames
|
|
804
|
-
* @param cb
|
|
805
|
-
* @param parent
|
|
806
|
-
*/
|
|
807
|
-
|
|
808
|
-
var findTargetListInTree = function findTargetListInTree(data, value, fieldNames, cb) {
|
|
809
|
-
var parent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
810
|
-
var target = lodash.find(data, function (item) {
|
|
811
|
-
return lodash.get(item, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || treeDefaultNames.value) === value;
|
|
812
|
-
});
|
|
813
|
-
|
|
814
|
-
if (target) {
|
|
815
|
-
if (lodash.isFunction(cb)) {
|
|
816
|
-
cb([].concat(_toConsumableArray(parent), [target]));
|
|
817
|
-
} else {
|
|
818
|
-
cb.list = [].concat(_toConsumableArray(parent), [target]);
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
return;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
lodash.forEach(data, function (item) {
|
|
825
|
-
var children = lodash.get(item, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || treeDefaultNames.children);
|
|
826
|
-
|
|
827
|
-
if (lodash.size(children) > 0) {
|
|
828
|
-
findTargetListInTree(children, value, fieldNames, cb, [].concat(_toConsumableArray(parent), [item]));
|
|
829
|
-
}
|
|
830
|
-
});
|
|
831
|
-
};
|
|
832
|
-
|
|
833
761
|
/**
|
|
834
762
|
* 剔除showState或showStateRules规则为!true的值
|
|
835
763
|
* @param values
|
|
@@ -908,15 +836,8 @@ var mergeStateToList = function mergeStateToList(list, listState, id) {
|
|
|
908
836
|
});
|
|
909
837
|
};
|
|
910
838
|
|
|
911
|
-
/**
|
|
912
|
-
*
|
|
913
|
-
*/
|
|
914
|
-
|
|
915
|
-
var generateId = function generateId() {
|
|
916
|
-
return Number(Math.random().toString().substr(3, 3) + Date.now()).toString(36);
|
|
917
|
-
};
|
|
918
|
-
/**
|
|
919
|
-
* ref 传递
|
|
839
|
+
/**
|
|
840
|
+
* ref 传递
|
|
920
841
|
*/
|
|
921
842
|
|
|
922
843
|
var createExpose = function createExpose(methods, targetRef) {
|
|
@@ -2777,9 +2698,6 @@ exports.createGrid = createGrid;
|
|
|
2777
2698
|
exports.createSearchForm = createSearchForm;
|
|
2778
2699
|
exports.createTable = createTable;
|
|
2779
2700
|
exports.defaultPage = defaultPage;
|
|
2780
|
-
exports.findTargetInTree = findTargetInTree;
|
|
2781
|
-
exports.findTargetListInTree = findTargetListInTree;
|
|
2782
|
-
exports.generateId = generateId;
|
|
2783
2701
|
exports.getColumnFormItemName = getColumnFormItemName;
|
|
2784
2702
|
exports.getColumnValueType = getColumnValueType;
|
|
2785
2703
|
exports.getFirstPropName = getFirstPropName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-start/pro",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "zx <zxpstudy@163.com>",
|
|
6
6
|
"homepage": "https://github.com/zxeryu/vue-start#readme",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"vue": ">=3.x",
|
|
33
33
|
"vue-router": ">=4.x"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "abed29975a9db75dcc076220d3ce0c6ba5df98b6"
|
|
36
36
|
}
|