@vue-start/pro 0.4.7 → 0.4.9

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 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;
@@ -606,6 +613,13 @@ declare const proCurdListProps: () => {
606
613
  tableProps: {
607
614
  type: PropType<Record<string, any>>;
608
615
  };
616
+ paginationProps: {
617
+ type: PropType<Record<string, any>>;
618
+ };
619
+ showPagination: {
620
+ type: BooleanConstructor;
621
+ default: boolean;
622
+ };
609
623
  pageState: {
610
624
  type: PropType<TPageState>;
611
625
  };
@@ -625,6 +639,13 @@ declare const createCurdList: (SearchForm: any, Table: any) => vue.DefineCompone
625
639
  tableProps: {
626
640
  type: PropType<Record<string, any>>;
627
641
  };
642
+ paginationProps: {
643
+ type: PropType<Record<string, any>>;
644
+ };
645
+ showPagination: {
646
+ type: BooleanConstructor;
647
+ default: boolean;
648
+ };
628
649
  pageState: {
629
650
  type: PropType<TPageState>;
630
651
  };
@@ -642,6 +663,13 @@ declare const createCurdList: (SearchForm: any, Table: any) => vue.DefineCompone
642
663
  tableProps: {
643
664
  type: PropType<Record<string, any>>;
644
665
  };
666
+ paginationProps: {
667
+ type: PropType<Record<string, any>>;
668
+ };
669
+ showPagination: {
670
+ type: BooleanConstructor;
671
+ default: boolean;
672
+ };
645
673
  pageState: {
646
674
  type: PropType<TPageState>;
647
675
  };
@@ -910,31 +938,6 @@ declare const proFormListProps: () => {
910
938
  declare type ProFormListProps = Partial<ExtractPropTypes<ReturnType<typeof proFormListProps>>>;
911
939
  declare const createFormList: (FormItem: any) => any;
912
940
 
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
941
  /**
939
942
  * 剔除showState或showStateRules规则为!true的值
940
943
  * @param values
@@ -957,13 +960,9 @@ declare const convertPathToList: (path: undefined | string | number | (string |
957
960
  */
958
961
  declare const mergeStateToList: (list: Record<string, any>[], listState: Record<string, any>, id: string | number | ((item: Record<string, any>) => string | number)) => Record<string, any>[];
959
962
 
960
- /**
961
- * 唯一id
962
- */
963
- declare const generateId: () => string;
964
963
  /**
965
964
  * ref 传递
966
965
  */
967
966
  declare const createExpose: (methods: string[], targetRef: Ref$1) => {};
968
967
 
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, TData, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, findTargetInTree, findTargetListInTree, generateId, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
968
+ 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, findIndex, find, filter as filter$1, split, isEmpty, mergeWith, sortBy, concat, isUndefined, debounce, clone, isBoolean } from 'lodash';
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
- * 唯一id
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) {
@@ -1899,6 +1820,14 @@ var proCurdListProps = function proCurdListProps() {
1899
1820
  tableProps: {
1900
1821
  type: Object
1901
1822
  },
1823
+ //pagination是否展示
1824
+ paginationProps: {
1825
+ type: Object
1826
+ },
1827
+ showPagination: {
1828
+ type: Boolean,
1829
+ "default": true
1830
+ },
1902
1831
  //pageState
1903
1832
  pageState: {
1904
1833
  type: Object
@@ -2025,7 +1954,7 @@ var createCurdList = function createCurdList(SearchForm, Table) {
2025
1954
  "default": function _default() {
2026
1955
  return [props.extraInSearch && extra];
2027
1956
  }
2028
- }, (_props$searchProps = props.searchProps) === null || _props$searchProps === void 0 ? void 0 : _props$searchProps.slots)), (_slots$divide = slots.divide) === null || _slots$divide === void 0 ? void 0 : _slots$divide.call(slots), !props.extraInSearch && extra, slots.table ? slots.table(rewriteTableProps) : createVNode(Table, rewriteTableProps, tableProps === null || tableProps === void 0 ? void 0 : tableProps.slots), (_slots$divide2 = slots.divide2) === null || _slots$divide2 === void 0 ? void 0 : _slots$divide2.call(slots), createVNode("div", {
1957
+ }, (_props$searchProps = props.searchProps) === null || _props$searchProps === void 0 ? void 0 : _props$searchProps.slots)), (_slots$divide = slots.divide) === null || _slots$divide === void 0 ? void 0 : _slots$divide.call(slots), !props.extraInSearch && extra, slots.table ? slots.table(rewriteTableProps) : createVNode(Table, rewriteTableProps, tableProps === null || tableProps === void 0 ? void 0 : tableProps.slots), (_slots$divide2 = slots.divide2) === null || _slots$divide2 === void 0 ? void 0 : _slots$divide2.call(slots), props.showPagination && createVNode("div", {
2029
1958
  "class": "pro-curd-list-footer"
2030
1959
  }, [(_slots$footerStart = slots.footerStart) === null || _slots$footerStart === void 0 ? void 0 : _slots$footerStart.call(slots), (_slots$pagination = slots.pagination) === null || _slots$pagination === void 0 ? void 0 : _slots$pagination.call(slots, pageState, (_curdState$listData2 = curdState.listData) === null || _curdState$listData2 === void 0 ? void 0 : _curdState$listData2.total, handleSearch), (_slots$footerEnd = slots.footerEnd) === null || _slots$footerEnd === void 0 ? void 0 : _slots$footerEnd.call(slots)]), (_slots$end = slots.end) === null || _slots$end === void 0 ? void 0 : _slots$end.call(slots)]);
2031
1960
  };
@@ -2754,4 +2683,4 @@ var createTable = function createTable(Table, Props, tableMethods) {
2754
2683
  });
2755
2684
  };
2756
2685
 
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, findTargetInTree, findTargetListInTree, generateId, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
2686
+ 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
- * 唯一id
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) {
@@ -1903,6 +1824,14 @@ var proCurdListProps = function proCurdListProps() {
1903
1824
  tableProps: {
1904
1825
  type: Object
1905
1826
  },
1827
+ //pagination是否展示
1828
+ paginationProps: {
1829
+ type: Object
1830
+ },
1831
+ showPagination: {
1832
+ type: Boolean,
1833
+ "default": true
1834
+ },
1906
1835
  //pageState
1907
1836
  pageState: {
1908
1837
  type: Object
@@ -2029,7 +1958,7 @@ var createCurdList = function createCurdList(SearchForm, Table) {
2029
1958
  "default": function _default() {
2030
1959
  return [props.extraInSearch && extra];
2031
1960
  }
2032
- }, (_props$searchProps = props.searchProps) === null || _props$searchProps === void 0 ? void 0 : _props$searchProps.slots)), (_slots$divide = slots.divide) === null || _slots$divide === void 0 ? void 0 : _slots$divide.call(slots), !props.extraInSearch && extra, slots.table ? slots.table(rewriteTableProps) : vue.createVNode(Table, rewriteTableProps, tableProps === null || tableProps === void 0 ? void 0 : tableProps.slots), (_slots$divide2 = slots.divide2) === null || _slots$divide2 === void 0 ? void 0 : _slots$divide2.call(slots), vue.createVNode("div", {
1961
+ }, (_props$searchProps = props.searchProps) === null || _props$searchProps === void 0 ? void 0 : _props$searchProps.slots)), (_slots$divide = slots.divide) === null || _slots$divide === void 0 ? void 0 : _slots$divide.call(slots), !props.extraInSearch && extra, slots.table ? slots.table(rewriteTableProps) : vue.createVNode(Table, rewriteTableProps, tableProps === null || tableProps === void 0 ? void 0 : tableProps.slots), (_slots$divide2 = slots.divide2) === null || _slots$divide2 === void 0 ? void 0 : _slots$divide2.call(slots), props.showPagination && vue.createVNode("div", {
2033
1962
  "class": "pro-curd-list-footer"
2034
1963
  }, [(_slots$footerStart = slots.footerStart) === null || _slots$footerStart === void 0 ? void 0 : _slots$footerStart.call(slots), (_slots$pagination = slots.pagination) === null || _slots$pagination === void 0 ? void 0 : _slots$pagination.call(slots, pageState, (_curdState$listData2 = curdState.listData) === null || _curdState$listData2 === void 0 ? void 0 : _curdState$listData2.total, handleSearch), (_slots$footerEnd = slots.footerEnd) === null || _slots$footerEnd === void 0 ? void 0 : _slots$footerEnd.call(slots)]), (_slots$end = slots.end) === null || _slots$end === void 0 ? void 0 : _slots$end.call(slots)]);
2035
1964
  };
@@ -2777,9 +2706,6 @@ exports.createGrid = createGrid;
2777
2706
  exports.createSearchForm = createSearchForm;
2778
2707
  exports.createTable = createTable;
2779
2708
  exports.defaultPage = defaultPage;
2780
- exports.findTargetInTree = findTargetInTree;
2781
- exports.findTargetListInTree = findTargetListInTree;
2782
- exports.generateId = generateId;
2783
2709
  exports.getColumnFormItemName = getColumnFormItemName;
2784
2710
  exports.getColumnValueType = getColumnValueType;
2785
2711
  exports.getFirstPropName = getFirstPropName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-start/pro",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
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": "797728f9f41829dae1311c7284d0bfbbdae6524f"
35
+ "gitHead": "9075107632a73989f5ade116c22cbc0250f29340"
36
36
  }