vap1 0.4.4 → 0.4.7
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/basetype.d.ts +4 -0
- package/components/Box/Box.d.ts +2 -2
- package/components/Box/Box.js +1 -1
- package/components/Box/index.d.ts +1 -1
- package/components/Lists/SList.d.ts +1 -1
- package/components/Lists/SList.js +3 -2
- package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.d.ts +2 -2
- package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.js +5 -5
- package/components/{SearchBar → SearchTool/SearchBar}/ByField.js +4 -4
- package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.js +3 -3
- package/components/{SearchBar → SearchTool/SearchBar}/SearchField.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.js +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/_register.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/_register.js +3 -3
- package/components/SearchTool/SearchBar/index.d.ts +71 -0
- package/components/{SearchBar → SearchTool/SearchBar}/index.js +1 -1
- package/components/{SearchBar → SearchTool}/index.d.ts +1 -70
- package/components/SearchTool/index.js +2 -0
- package/components/Tables/ApiTable.d.ts +1 -1
- package/components/Tables/ApiTableModal.d.ts +1 -1
- package/components/Tables/Components/ActionBar.d.ts +1 -1
- package/components/Tables/Components/ActionBar.js +1 -1
- package/components/Tables/STable.d.ts +1 -1
- package/components/Tables/TopTable.js +0 -1
- package/components/Tables/VTable.d.ts +4 -2
- package/components/Tables/index.d.ts +1 -1
- package/components/TreeSelect/STreeSelect.js +1 -1
- package/components/Trees/ActionTree.d.ts +4 -1
- package/components/Trees/BaseTree.d.ts +1 -0
- package/components/Trees/BaseTree.js +11 -2
- package/components/Trees/DTree.d.ts +1 -0
- package/components/Trees/FTree.d.ts +1 -0
- package/components/Trees/index.d.ts +4 -0
- package/components/UForm/_FieldType.d.ts +1 -1
- package/components/UForm/_FieldType.js +4 -0
- package/components/UForm/_input.d.ts +1 -1
- package/components/UForm/_register.d.ts +1 -1
- package/components/_adapt/Col.d.ts +1 -1
- package/components/_common/HighLight.js +1 -1
- package/components/_common/UTitle.d.ts +1 -1
- package/components/_common/UTitle.js +1 -1
- package/components/index.d.ts +2 -2
- package/components/index.js +1 -1
- package/deps/app-data/Const.d.ts +68 -3
- package/deps/app-data/Const.js +47 -3
- package/deps/app-data/TimeConst.d.ts +0 -0
- package/deps/app-data/TimeConst.js +58 -0
- package/deps/app-data/useSource.d.ts +22 -0
- package/deps/app-data/useSource.js +243 -162
- package/hooks/useApiGlobal.js +1 -1
- package/hooks/useEffectFunction.d.ts +4 -2
- package/hooks/useGetSet.d.ts +1 -1
- package/hooks/useGlobal.d.ts +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/screen/Page.js +3 -3
- package/utils/Ajax.js +12 -9
- package/utils/CustomApp.d.ts +2 -2
- package/utils/Format.js +5 -10
- package/utils/Global.d.ts +39 -2
- package/utils/Global.js +18 -1
- package/utils/Renders/ApiGetRender.js +5 -2
- package/utils/Renders/DictRender.d.ts +2 -5
- package/utils/Renders/DictRender.js +14 -8
- package/utils/StringUtil.d.ts +4 -2
- package/utils/StringUtil.js +12 -3
- package/utils/TreeUtil.js +7 -8
- package/utils/VAP.js +0 -1
- package/utils/_Support.d.ts +1 -7
- package/utils/_Support.js +1 -67
- package/utils/crontab/_en.d.ts +2 -0
- package/utils/crontab/_en.js +178 -0
- package/utils/crontab/_global.d.ts +11 -0
- package/utils/crontab/_global.js +23 -0
- package/utils/crontab/_zh_CN.d.ts +2 -0
- package/utils/crontab/_zh_CN.js +180 -0
- package/utils/crontab/_zh_TW.d.ts +2 -0
- package/utils/crontab/_zh_TW.js +170 -0
- package/utils/crontab/crontabParser.d.ts +1 -0
- package/utils/crontab/crontabParser.js +251 -0
- package/utils/crontab/crontabRender.d.ts +23 -0
- package/utils/crontab/crontabRender.js +503 -0
- package/utils/crontab/index.d.ts +3 -0
- package/utils/crontab/index.js +9 -0
- package/utils/crontab/type.d.ts +79 -0
- package/utils/crontab/type.js +2 -0
- package/utils/crontab/utils.d.ts +20 -0
- package/utils/crontab/utils.js +122 -0
- package/utils/py.d.ts +19 -0
- package/utils/py.js +176 -0
- /package/components/{SearchBar → SearchTool/SearchBar}/ByField.d.ts +0 -0
- /package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.d.ts +0 -0
- /package/components/{SearchBar → SearchTool/SearchBar}/SearchField.js +0 -0
- /package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.d.ts +0 -0
- /package/components/{SearchBar → SearchTool}/_FieldType.d.ts +0 -0
- /package/components/{SearchBar → SearchTool}/_FieldType.js +0 -0
package/basetype.d.ts
CHANGED
|
@@ -60,3 +60,7 @@ export type BaseOption = BaseItem & {
|
|
|
60
60
|
[propName: string]: any;
|
|
61
61
|
};
|
|
62
62
|
export type { ApiModel } from './hooks/_list';
|
|
63
|
+
export type Without<T, U> = {
|
|
64
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
|
65
|
+
};
|
|
66
|
+
export type XOR<T, U> = (T | U) extends object ? (T extends object ? U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U : T | U) : T | U;
|
package/components/Box/Box.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MutableRefObject, ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import type { SelectBarProps } from './SelectBar';
|
|
4
|
-
import type { SearchBarProps } from '../SearchBar';
|
|
5
|
-
import type { ActButton } from '../SearchBar/ActionButtons';
|
|
4
|
+
import type { SearchBarProps } from '../SearchTool/SearchBar';
|
|
5
|
+
import type { ActButton } from '../SearchTool/SearchBar/ActionButtons';
|
|
6
6
|
import type { Key, PlainObject } from '../../basetype';
|
|
7
7
|
import type { UPaginationProps } from '../_common/Upagination';
|
|
8
8
|
type BoxState = {
|
package/components/Box/Box.js
CHANGED
|
@@ -59,7 +59,7 @@ var lodash_1 = __importDefault(require("lodash"));
|
|
|
59
59
|
var Layout_1 = require("../_adapt/Layout");
|
|
60
60
|
var hooks_1 = require("../../hooks");
|
|
61
61
|
var SelectBar_1 = require("./SelectBar");
|
|
62
|
-
var SearchBar_1 = require("../SearchBar");
|
|
62
|
+
var SearchBar_1 = require("../SearchTool/SearchBar");
|
|
63
63
|
var Upagination_1 = require("../_common/Upagination");
|
|
64
64
|
var utils_1 = require("../../utils");
|
|
65
65
|
var _register_1 = require("./_register");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useBox } from './Box';
|
|
2
|
-
import { ForwardRefExoticComponent, PropsWithChildren, RefAttributes } from 'react';
|
|
2
|
+
import type { ForwardRefExoticComponent, PropsWithChildren, RefAttributes } from 'react';
|
|
3
3
|
import type { BoxProps } from './Box';
|
|
4
4
|
export type BoxComponent = ForwardRefExoticComponent<PropsWithChildren<BoxProps> & RefAttributes<{
|
|
5
5
|
resize: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FC, CSSProperties, ReactNode } from 'react';
|
|
2
1
|
import type { PlainObject, Key } from '../../basetype';
|
|
2
|
+
import type { FC, ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import type { IconProps } from '../_adapt/Icon';
|
|
4
4
|
type ItemRenderFunction = (record: PlainObject, searchValue?: string) => ReactNode;
|
|
5
5
|
export type SListProps = {
|
|
@@ -55,6 +55,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
55
55
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
56
|
exports.SList = void 0;
|
|
57
57
|
var react_1 = __importStar(require("react"));
|
|
58
|
+
var py_1 = require("../../utils/py");
|
|
58
59
|
var lodash_1 = __importDefault(require("lodash"));
|
|
59
60
|
var utils_1 = require("../../utils");
|
|
60
61
|
var Icon_1 = require("../_adapt/Icon");
|
|
@@ -131,8 +132,8 @@ exports.SList = (0, react_1.memo)(function (props) {
|
|
|
131
132
|
return;
|
|
132
133
|
}
|
|
133
134
|
setList(lodash_1.default.filter(all, function (item) {
|
|
134
|
-
var
|
|
135
|
-
return
|
|
135
|
+
var hited = (0, py_1.spellHit)(item[props.titleField], searchValue);
|
|
136
|
+
return hited.length > 0;
|
|
136
137
|
}));
|
|
137
138
|
}, [searchValue, props.list]);
|
|
138
139
|
(0, react_1.useLayoutEffect)(function () {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import type { ButtonType } from '
|
|
3
|
-
import type { ButtonProps } from '
|
|
2
|
+
import type { ButtonType } from '../../_adapt/_Antd5';
|
|
3
|
+
import type { ButtonProps } from '../../_adapt/Button';
|
|
4
4
|
import type { ButtonSize } from 'antd/es/button';
|
|
5
5
|
export type ActButton = {
|
|
6
6
|
/**
|
|
@@ -51,11 +51,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
51
51
|
exports.ActionButtons = void 0;
|
|
52
52
|
var react_1 = __importStar(require("react"));
|
|
53
53
|
var lodash_1 = __importDefault(require("lodash"));
|
|
54
|
-
var Popconfirm_1 = require("
|
|
55
|
-
var Icon_1 = require("
|
|
56
|
-
var Button_1 = require("
|
|
57
|
-
var Dropdown_1 = require("
|
|
58
|
-
var utils_1 = require("
|
|
54
|
+
var Popconfirm_1 = require("../../_adapt/Popconfirm");
|
|
55
|
+
var Icon_1 = require("../../_adapt/Icon");
|
|
56
|
+
var Button_1 = require("../../_adapt/Button");
|
|
57
|
+
var Dropdown_1 = require("../../_adapt/Dropdown");
|
|
58
|
+
var utils_1 = require("../../../utils");
|
|
59
59
|
var getIcon = function (icon) {
|
|
60
60
|
if (lodash_1.default.isString(icon)) {
|
|
61
61
|
return react_1.default.createElement(Icon_1.Icon, { type: icon });
|
|
@@ -57,10 +57,10 @@ exports.SearchBarByField = exports.InnerSearchBarByField = void 0;
|
|
|
57
57
|
var react_1 = __importStar(require("react"));
|
|
58
58
|
var lodash_1 = __importDefault(require("lodash"));
|
|
59
59
|
var antd_1 = require("antd");
|
|
60
|
-
var Button_1 = require("
|
|
61
|
-
var Popover_1 = require("
|
|
62
|
-
var utils_1 = require("
|
|
63
|
-
var _i18n_1 = require("
|
|
60
|
+
var Button_1 = require("../../_adapt/Button");
|
|
61
|
+
var Popover_1 = require("../../_adapt/Popover");
|
|
62
|
+
var utils_1 = require("../../../utils");
|
|
63
|
+
var _i18n_1 = require("../../_i18n");
|
|
64
64
|
var SearchField_1 = require("./SearchField");
|
|
65
65
|
var _register_1 = require("./_register");
|
|
66
66
|
exports.InnerSearchBarByField = (0, react_1.forwardRef)(function (props, ref) {
|
|
@@ -53,10 +53,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
53
53
|
exports.SearchBarByKeyword = void 0;
|
|
54
54
|
var react_1 = __importStar(require("react"));
|
|
55
55
|
var antd_1 = require("antd");
|
|
56
|
-
var Popover_1 = require("
|
|
56
|
+
var Popover_1 = require("../../_adapt/Popover");
|
|
57
57
|
var ByField_1 = require("./ByField");
|
|
58
|
-
var utils_1 = require("
|
|
59
|
-
var _i18n_1 = require("
|
|
58
|
+
var utils_1 = require("../../../utils");
|
|
59
|
+
var _i18n_1 = require("../../_i18n");
|
|
60
60
|
var SearchBarByKeyword = function (props) {
|
|
61
61
|
var _a = __read((0, react_1.useState)(false), 2), open = _a[0], setOpen = _a[1];
|
|
62
62
|
var spanRef = (0, react_1.useRef)(null);
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SearchTags = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var Tag_1 = require("
|
|
8
|
+
var Tag_1 = require("../../_adapt/Tag");
|
|
9
9
|
var SearchTags = function () {
|
|
10
10
|
return react_1.default.createElement("div", null,
|
|
11
11
|
react_1.default.createElement("h1", null,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSearchField = exports.registerSearchField = void 0;
|
|
4
|
-
var _Support_1 = require("
|
|
5
|
-
var StringUtil_1 = require("
|
|
6
|
-
var _RegisterUtil_1 = require("
|
|
4
|
+
var _Support_1 = require("../../../utils/_Support");
|
|
5
|
+
var StringUtil_1 = require("../../../utils/StringUtil");
|
|
6
|
+
var _RegisterUtil_1 = require("../../_RegisterUtil");
|
|
7
7
|
var DEFAULT = { outside: false, fieldNum: 1, defaultSpan: 1, };
|
|
8
8
|
var _C_SEARCH_FIELD = (0, _Support_1.globalDefault)('_C_SEARCH_FIELD', new Map());
|
|
9
9
|
/**
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ActionButtons } from './ActionButtons';
|
|
2
|
+
import type { PropsWithChildren, ExoticComponent } from 'react';
|
|
3
|
+
import type { Field } from '../index';
|
|
4
|
+
import type { PlainObject } from '../../../basetype';
|
|
5
|
+
/**
|
|
6
|
+
* 当没有指定 keyword时,SearchBar的配置参数
|
|
7
|
+
* 指字 keyword 时,将出以弹出方式展示
|
|
8
|
+
*/
|
|
9
|
+
export type SearchBarByFieldProps = {
|
|
10
|
+
/**
|
|
11
|
+
* 禁用
|
|
12
|
+
*/
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* searchBar扩展类名称
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 1. 传一个字,代表 inside 模式宽度
|
|
20
|
+
* 2. 传一个数字数组,
|
|
21
|
+
* 代表 outside 模式 [label宽度,input宽度]
|
|
22
|
+
* 或是 inside 模式加各的结果
|
|
23
|
+
*/
|
|
24
|
+
fieldWidth?: number | [number, number];
|
|
25
|
+
/**
|
|
26
|
+
* 搜索参数
|
|
27
|
+
*/
|
|
28
|
+
fields?: Field[];
|
|
29
|
+
/**
|
|
30
|
+
* 搜索参数支持的列,最多支持4,默认为3
|
|
31
|
+
*/
|
|
32
|
+
cols?: 1 | 2 | 3 | 4;
|
|
33
|
+
/**
|
|
34
|
+
* 变量有变动时使用
|
|
35
|
+
*/
|
|
36
|
+
onChange?: (param: PlainObject) => void;
|
|
37
|
+
/**
|
|
38
|
+
* 搜索被触发时
|
|
39
|
+
*/
|
|
40
|
+
onSearch: (param: PlainObject) => void;
|
|
41
|
+
/**
|
|
42
|
+
* 显示更多时触发
|
|
43
|
+
*/
|
|
44
|
+
onExpand?: (isShowMore: boolean) => void;
|
|
45
|
+
/**
|
|
46
|
+
* 默认参数
|
|
47
|
+
*/
|
|
48
|
+
default?: any;
|
|
49
|
+
/**
|
|
50
|
+
* 用于单独使用时,不需要按钮的情况
|
|
51
|
+
*/
|
|
52
|
+
hideAction?: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type KeyWord = true | {
|
|
55
|
+
/**
|
|
56
|
+
* 提示,默认为 "请填写关键字"
|
|
57
|
+
*/
|
|
58
|
+
placeholder?: string;
|
|
59
|
+
/**
|
|
60
|
+
* 需要高亮的字段
|
|
61
|
+
* 高亮设定: 说明:高亮设定后, column 指定的 render 会失效
|
|
62
|
+
*/
|
|
63
|
+
highlight?: string[];
|
|
64
|
+
};
|
|
65
|
+
export type SearchBarProps = SearchBarByFieldProps & {
|
|
66
|
+
keyword?: KeyWord;
|
|
67
|
+
};
|
|
68
|
+
export interface SearchBar extends ExoticComponent<PropsWithChildren<SearchBarProps>> {
|
|
69
|
+
ActionButtons: typeof ActionButtons;
|
|
70
|
+
}
|
|
71
|
+
export declare const SearchBar: SearchBar;
|
|
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.SearchBar = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
19
|
var lodash_1 = __importDefault(require("lodash"));
|
|
20
|
-
var utils_1 = require("
|
|
20
|
+
var utils_1 = require("../../../utils");
|
|
21
21
|
var ByField_1 = require("./ByField");
|
|
22
22
|
var ByKeyword_1 = require("./ByKeyword");
|
|
23
23
|
var ActionButtons_1 = require("./ActionButtons");
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { PropsWithChildren, ExoticComponent } from 'react';
|
|
3
|
-
import type { BaseOption, PlainObject, BaseItem } from '../../basetype';
|
|
1
|
+
import type { BaseOption, BaseItem } from '../../basetype';
|
|
4
2
|
import type { _FieldType } from './_FieldType';
|
|
5
3
|
/**
|
|
6
4
|
* 搜索条件字段
|
|
@@ -63,70 +61,3 @@ export type Field = BaseItem & {
|
|
|
63
61
|
* */
|
|
64
62
|
config?: any;
|
|
65
63
|
};
|
|
66
|
-
/**
|
|
67
|
-
* 当没有指定 keyword时,SearchBar的配置参数
|
|
68
|
-
* 指字 keyword 时,将出以弹出方式展示
|
|
69
|
-
*/
|
|
70
|
-
export type SearchBarByFieldProps = {
|
|
71
|
-
/**
|
|
72
|
-
* 禁用
|
|
73
|
-
*/
|
|
74
|
-
disabled?: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* searchBar扩展类名称
|
|
77
|
-
*/
|
|
78
|
-
className?: string;
|
|
79
|
-
/**
|
|
80
|
-
* 1. 传一个字,代表 inside 模式宽度
|
|
81
|
-
* 2. 传一个数字数组,
|
|
82
|
-
* 代表 outside 模式 [label宽度,input宽度]
|
|
83
|
-
* 或是 inside 模式加各的结果
|
|
84
|
-
*/
|
|
85
|
-
fieldWidth?: number | [number, number];
|
|
86
|
-
/**
|
|
87
|
-
* 搜索参数
|
|
88
|
-
*/
|
|
89
|
-
fields?: Field[];
|
|
90
|
-
/**
|
|
91
|
-
* 搜索参数支持的列,最多支持4,默认为3
|
|
92
|
-
*/
|
|
93
|
-
cols?: 1 | 2 | 3 | 4;
|
|
94
|
-
/**
|
|
95
|
-
* 变量有变动时使用
|
|
96
|
-
*/
|
|
97
|
-
onChange?: (param: PlainObject) => void;
|
|
98
|
-
/**
|
|
99
|
-
* 搜索被触发时
|
|
100
|
-
*/
|
|
101
|
-
onSearch: (param: PlainObject) => void;
|
|
102
|
-
/**
|
|
103
|
-
* 显示更多时触发
|
|
104
|
-
*/
|
|
105
|
-
onExpand?: (isShowMore: boolean) => void;
|
|
106
|
-
/**
|
|
107
|
-
* 默认参数
|
|
108
|
-
*/
|
|
109
|
-
default?: any;
|
|
110
|
-
/**
|
|
111
|
-
* 用于单独使用时,不需要按钮的情况
|
|
112
|
-
*/
|
|
113
|
-
hideAction?: boolean;
|
|
114
|
-
};
|
|
115
|
-
export type KeyWord = true | {
|
|
116
|
-
/**
|
|
117
|
-
* 提示,默认为 "请填写关键字"
|
|
118
|
-
*/
|
|
119
|
-
placeholder?: string;
|
|
120
|
-
/**
|
|
121
|
-
* 需要高亮的字段
|
|
122
|
-
* 高亮设定: 说明:高亮设定后, column 指定的 render 会失效
|
|
123
|
-
*/
|
|
124
|
-
highlight?: string[];
|
|
125
|
-
};
|
|
126
|
-
export type SearchBarProps = SearchBarByFieldProps & {
|
|
127
|
-
keyword?: KeyWord;
|
|
128
|
-
};
|
|
129
|
-
export interface SearchBar extends ExoticComponent<PropsWithChildren<SearchBarProps>> {
|
|
130
|
-
ActionButtons: typeof ActionButtons;
|
|
131
|
-
}
|
|
132
|
-
export declare const SearchBar: SearchBar;
|
|
@@ -12,7 +12,7 @@ export declare const ApiTable: React.ForwardRefExoticComponent<import("./index")
|
|
|
12
12
|
selectDisabled?: (record: any) => boolean;
|
|
13
13
|
actionBar?: React.ReactNode | import("./Components/ActionBar").TableActionButton[];
|
|
14
14
|
selectBar?: import("../Box/SelectBar").SelectBarProps;
|
|
15
|
-
searchBar?: Omit<import("
|
|
15
|
+
searchBar?: Omit<import("../..").SearchBarProps, "onChange" | "onSearch">;
|
|
16
16
|
default?: import("../..").PlainObject;
|
|
17
17
|
autoLoad?: false;
|
|
18
18
|
} & Pick<ApiOption, "api" | "tipField" | "tipDisabled" | "aop"> & React.RefAttributes<ApiModel>>;
|
|
@@ -12,7 +12,7 @@ export declare const ApiTableModal: React.ForwardRefExoticComponent<import(".").
|
|
|
12
12
|
selectDisabled?: (record: any) => boolean;
|
|
13
13
|
actionBar?: React.ReactNode | import("./Components/ActionBar").TableActionButton[];
|
|
14
14
|
selectBar?: import("../Box/SelectBar").SelectBarProps;
|
|
15
|
-
searchBar?: Omit<import("
|
|
15
|
+
searchBar?: Omit<import("../..").SearchBarProps, "onChange" | "onSearch">;
|
|
16
16
|
default?: import("../..").PlainObject;
|
|
17
17
|
autoLoad?: false;
|
|
18
18
|
} & Pick<import("../../hooks/useApiBase").ApiOption, "api" | "tipField" | "tipDisabled" | "aop"> & Omit<import("antd/es/modal").ModalProps, "visible" | "onCancel" | "onOk"> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FC, MutableRefObject } from 'react';
|
|
2
2
|
import type { Key, PlainObject } from '../../../basetype';
|
|
3
|
-
import type { ActButton } from '../../SearchBar/ActionButtons';
|
|
3
|
+
import type { ActButton } from '../../SearchTool/SearchBar/ActionButtons';
|
|
4
4
|
export type TableAction = (ids?: Key[], objs?: PlainObject[], param?: PlainObject) => void;
|
|
5
5
|
/**
|
|
6
6
|
* VTable Button 区域点击后的方法,支持三个参数
|
|
@@ -56,7 +56,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
56
56
|
exports.BUTTON_EXPORT = exports.BUTTON_IMPORT = exports.BUTTON_MORE = exports.BUTTON_DELETE = exports.BUTTON_ADD = exports.ActionBar = void 0;
|
|
57
57
|
var react_1 = __importStar(require("react"));
|
|
58
58
|
var lodash_1 = __importDefault(require("lodash"));
|
|
59
|
-
var ActionButtons_1 = require("../../SearchBar/ActionButtons");
|
|
59
|
+
var ActionButtons_1 = require("../../SearchTool/SearchBar/ActionButtons");
|
|
60
60
|
var _i18n_1 = require("../../_i18n");
|
|
61
61
|
var i18n_1 = require("../../../utils/i18n");
|
|
62
62
|
var hooks_1 = require("../../../hooks");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ListInit } from '../../hooks/_list';
|
|
3
2
|
import type { VTableProps, VTableRef } from './VTable';
|
|
3
|
+
import type { ListInit } from '../../hooks/_list';
|
|
4
4
|
export type STableProps = Omit<VTableProps, 'model'> & ListInit & {
|
|
5
5
|
/**
|
|
6
6
|
* 说明 pageSize : 默认为 false : 不分页。
|
|
@@ -149,7 +149,6 @@ var TopTable = function (props) {
|
|
|
149
149
|
}
|
|
150
150
|
}); };
|
|
151
151
|
}
|
|
152
|
-
console.log(scroll);
|
|
153
152
|
return react_1.default.createElement("div", { ref: tableRef, className: 'c-table-top-container' },
|
|
154
153
|
react_1.default.createElement(Table_1.Table, __assign({}, tableProps, props, { rowClassName: function (record, i) {
|
|
155
154
|
var clazz = [];
|
|
@@ -28,13 +28,15 @@ export type VTableProps = BaseTableProps & {
|
|
|
28
28
|
export declare const VTable: React.ForwardRefExoticComponent<import("./index").TableDefine & {
|
|
29
29
|
mode?: import("../Box/Box").BoxMode;
|
|
30
30
|
columns: import("./index").TableCol[];
|
|
31
|
-
showIndex?: string | false;
|
|
31
|
+
showIndex?: string | false; /**
|
|
32
|
+
* 列表模型,可以使用系统提供的 useApi/useArray 等,也可自行实现列表模型
|
|
33
|
+
*/
|
|
32
34
|
rowKey?: string;
|
|
33
35
|
select?: true | "DEFAULT" | "QUERY";
|
|
34
36
|
selectDisabled?: (record: any) => boolean;
|
|
35
37
|
actionBar?: React.ReactNode | import("./Components/ActionBar").TableActionButton[];
|
|
36
38
|
selectBar?: import("../Box/SelectBar").SelectBarProps;
|
|
37
|
-
searchBar?: Omit<import("
|
|
39
|
+
searchBar?: Omit<import("../..").SearchBarProps, "onChange" | "onSearch">;
|
|
38
40
|
default?: PlainObject;
|
|
39
41
|
autoLoad?: false;
|
|
40
42
|
} & {
|
|
@@ -2,7 +2,7 @@ import type { TableDefined } from './Components';
|
|
|
2
2
|
import type { ReactNode, ForwardRefExoticComponent, ExoticComponent, RefAttributes } from 'react';
|
|
3
3
|
import type { TableProps } from '../_adapt/Table';
|
|
4
4
|
import type { ColumnProps } from 'antd/es/table/interface';
|
|
5
|
-
import type { SearchBarProps } from '../SearchBar/index';
|
|
5
|
+
import type { SearchBarProps } from '../SearchTool/SearchBar/index';
|
|
6
6
|
import type { TableActionButton } from './Components/ActionBar';
|
|
7
7
|
import type { PlainObject, BaseItem, ApiModel } from '../../basetype';
|
|
8
8
|
import type { BoxMode } from '../Box/Box';
|
|
@@ -26,7 +26,7 @@ var _STreeSelect = function (props) {
|
|
|
26
26
|
// 说明,等待数据处理好了再绑定,让 defaultExpand 之类的默认属性能生效
|
|
27
27
|
if (!treeState.inited)
|
|
28
28
|
return utils_1.Const.NONE;
|
|
29
|
-
return react_1.default.createElement(antd_1.TreeSelect, __assign({}, baseProps, extraProps, { value: value == null ? undefined : value, disabled: props.disabled }), (0, BaseTreeSelect_1.renderRoot)(props, treeState));
|
|
29
|
+
return react_1.default.createElement(antd_1.TreeSelect, __assign({}, baseProps, extraProps, { treeDefaultExpandAll: props.treeDefaultExpandAll, allowClear: props.allowClear, value: value == null ? undefined : value, disabled: props.disabled }), (0, BaseTreeSelect_1.renderRoot)(props, treeState));
|
|
30
30
|
};
|
|
31
31
|
var STreeSelect = function (props) { return react_1.default.createElement(BaseTreeSelect_1.BaseTreeSelect, __assign({}, props),
|
|
32
32
|
react_1.default.createElement(_STreeSelect, __assign({}, props))); };
|
|
@@ -37,9 +37,12 @@ export declare const useActionTree: () => ActionTreeContext;
|
|
|
37
37
|
export declare const ActionTree: React.ForwardRefExoticComponent<import("../../utils/TreeUtil").BaseTreeOpts & Pick<import("antd/es/tree/Tree").TreeProps, "className" | "disabled" | "defaultExpandAll"> & {
|
|
38
38
|
iconField?: string | ((item: any) => React.ReactNode);
|
|
39
39
|
titleField: string | import("./index").LanguageField;
|
|
40
|
+
titleRender?: (node: PlainObject) => React.ReactNode;
|
|
40
41
|
mustSelect?: boolean;
|
|
41
42
|
disabledNode?: (node: PlainObject) => boolean;
|
|
42
|
-
onSelect?: (key: Key, node: PlainObject, parentNode: PlainObject, crumb: PlainObject[], pos: number[]) => void;
|
|
43
|
+
onSelect?: (key: Key, node: PlainObject, parentNode: PlainObject, crumb: PlainObject[], pos: number[]) => void; /**
|
|
44
|
+
* 获取子节点方法
|
|
45
|
+
*/
|
|
43
46
|
searchValue?: string;
|
|
44
47
|
} & BaseActionTreeProps & CacheTree & React.RefAttributes<ActionTreeRef>>;
|
|
45
48
|
export declare const renderRoot: (props: ActionTreeProps, state: BaseTreeState, context: ActionTreeContext) => ReactNode;
|
|
@@ -99,6 +99,7 @@ var BaseTree = function (props) {
|
|
|
99
99
|
rootCode: '0',
|
|
100
100
|
search: { word: null, keyword: null, match: null },
|
|
101
101
|
titleField: 'name',
|
|
102
|
+
titleRender: null,
|
|
102
103
|
keyField: 'id',
|
|
103
104
|
iconField: null,
|
|
104
105
|
sortField: null,
|
|
@@ -145,6 +146,9 @@ var BaseTree = function (props) {
|
|
|
145
146
|
DEFAULT.langs = langs;
|
|
146
147
|
}
|
|
147
148
|
}
|
|
149
|
+
if (props.titleRender && lodash_1.default.isFunction(props.titleRender)) {
|
|
150
|
+
DEFAULT.titleRender = props.titleRender;
|
|
151
|
+
}
|
|
148
152
|
var _a = __read((0, hooks_1.useSetState)(DEFAULT), 2), state = _a[0], setState = _a[1];
|
|
149
153
|
var PID = (0, react_1.useRef)(null);
|
|
150
154
|
var searchByKeyWord = (0, react_1.useCallback)(function (word) {
|
|
@@ -203,13 +207,18 @@ var BaseTree = function (props) {
|
|
|
203
207
|
};
|
|
204
208
|
exports.BaseTree = BaseTree;
|
|
205
209
|
var getNodeParam = function (node, position, state, search, disabledNode, folderChecker) {
|
|
206
|
-
var titleField = state.titleField, keyField = state.keyField, iconField = state.iconField;
|
|
210
|
+
var titleField = state.titleField, keyField = state.keyField, iconField = state.iconField, titleRender = state.titleRender;
|
|
207
211
|
var param = { key: node[keyField], data: { node: node, position: position } };
|
|
208
212
|
if (search.keyword) {
|
|
209
213
|
param.title = react_1.default.createElement(HighLight_1.HighLight, { keyword: search.keyword, text: node[titleField] });
|
|
210
214
|
}
|
|
211
215
|
else {
|
|
212
|
-
|
|
216
|
+
if (titleRender) {
|
|
217
|
+
param.title = titleRender(node);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
param.title = node[titleField];
|
|
221
|
+
}
|
|
213
222
|
}
|
|
214
223
|
if (lodash_1.default.isFunction(disabledNode)) {
|
|
215
224
|
if (disabledNode(node)) {
|
|
@@ -42,6 +42,7 @@ export declare const DTree: React.MemoExoticComponent<React.ForwardRefExoticComp
|
|
|
42
42
|
* 方式二:传一个方法 ,接收一个父节点参数,必须返回 Promise<TreeNodeData[]> (不要返回 children, 仅返回一级)
|
|
43
43
|
*/
|
|
44
44
|
titleField: string | import("./index").LanguageField;
|
|
45
|
+
titleRender?: (node: PlainObject) => React.ReactNode;
|
|
45
46
|
mustSelect?: boolean;
|
|
46
47
|
disabledNode?: (node: PlainObject) => boolean;
|
|
47
48
|
onSelect?: (key: Key, node: PlainObject, parentNode: PlainObject, crumb: PlainObject[], pos: number[]) => void;
|
|
@@ -18,6 +18,7 @@ export type FTreeProps = BaseTreeProps & BaseActionTreeProps & FTreeData;
|
|
|
18
18
|
export declare const FTree: React.MemoExoticComponent<React.ForwardRefExoticComponent<TreeUtil.BaseTreeOpts & Pick<TreeProps, "className" | "disabled" | "defaultExpandAll"> & {
|
|
19
19
|
iconField?: string | ((item: any) => React.ReactNode);
|
|
20
20
|
titleField: string | import("./index").LanguageField;
|
|
21
|
+
titleRender?: (node: import("../..").PlainObject) => React.ReactNode;
|
|
21
22
|
mustSelect?: boolean;
|
|
22
23
|
disabledNode?: (node: import("../..").PlainObject) => boolean;
|
|
23
24
|
onSelect?: (key: import("../..").Key, node: import("../..").PlainObject, parentNode: import("../..").PlainObject, crumb: import("../..").PlainObject[], pos: number[]) => void;
|
|
@@ -36,6 +36,10 @@ export type BaseTreeProps = BaseTreeOpts & Pick<TreeProps, 'className' | 'defaul
|
|
|
36
36
|
* 如果需要支持 i18n ,则传一个对象,支持3个字段
|
|
37
37
|
*/
|
|
38
38
|
titleField: string | LanguageField;
|
|
39
|
+
/**
|
|
40
|
+
* 自定义标题
|
|
41
|
+
*/
|
|
42
|
+
titleRender?: (node: PlainObject) => ReactNode;
|
|
39
43
|
/**
|
|
40
44
|
* 是否必选,
|
|
41
45
|
*/
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
| text ||
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export declare const _FieldType: readonly ["text", "textarea", "password", "color", "number", "slider", "slider-range", "slider-range", "input-with-select", "button", "select", "multi-select", "switch", "switch-checkbox", "radio", "radio-button", "radio-with-more", "checkbox", "checkbox-with-all", "icon", "stree-select", "dtree-select", "ftree-select", "multi-stree-select", "multi-dtree-select", "multi-ftree-select", "date", "datetime", "month", "week", "time", "daterange", "datetimerange", "daterange-single", "datetimerange-single", "timerange", "monthrange", "json-array", "json-table", "file", "multi-file", "img", "idcard", "ip", "ip4", "ip6", "phone", "telephone", "mobilephone", "port", "mac", "url", "email", "crontab", "organization", "role", "roles", "cems-org-button"];
|
|
8
|
+
export declare const _FieldType: readonly ["text", "textarea", "password", "color", "number", "slider", "slider-range", "slider-range", "input-with-select", "button", "divider", "select", "multi-select", "switch", "switch-checkbox", "radio", "radio-button", "radio-with-more", "checkbox", "checkbox-with-all", "icon", "stree-select", "dtree-select", "ftree-select", "multi-stree-select", "multi-dtree-select", "multi-ftree-select", "date", "datetime", "month", "week", "time", "daterange", "datetimerange", "daterange-single", "datetimerange-single", "timerange", "monthrange", "json-array", "json-table", "file", "multi-file", "img", "idcard", "ip", "ip4", "ip6", "phone", "telephone", "mobilephone", "port", "mac", "url", "email", "crontab", "organization", "role", "roles", "cems-org-button"];
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import type { UFormField } from './index';
|
|
3
3
|
import type { PlainObject } from '../../basetype';
|
|
4
4
|
import type { TableColumn } from '../Tables';
|
|
5
|
-
import type { SearchBarProps } from '../SearchBar';
|
|
5
|
+
import type { SearchBarProps } from '../SearchTool/SearchBar';
|
|
6
6
|
export declare const copyMultiValue: (fields: string[], data: PlainObject, properties: string[]) => PlainObject;
|
|
7
7
|
/**
|
|
8
8
|
* 获取复合字段的 字段与值,以数组形式返回
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode, ComponentType } from 'react';
|
|
2
2
|
import type { BaseOption, PlainObject } from '../../basetype';
|
|
3
3
|
import type { UFormField } from './index';
|
|
4
4
|
import type { ValidationRule, WrappedFormUtils } from 'antd/es/form/Form';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FC, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { ColProps as AntdColprops } from 'antd/es/grid/col';
|
|
3
|
-
import type { ActButton } from '../SearchBar/ActionButtons';
|
|
3
|
+
import type { ActButton } from '../SearchTool/SearchBar/ActionButtons';
|
|
4
4
|
import type { UTitleProps } from '../_common/UTitle';
|
|
5
5
|
export type ColProps = Omit<AntdColprops, 'title'> & UTitleProps & {
|
|
6
6
|
/**
|
|
@@ -48,6 +48,6 @@ var StringUtil_1 = require("../../utils/StringUtil");
|
|
|
48
48
|
var HighLight = function (props) {
|
|
49
49
|
var _a = __read((0, react_1.useState)([]), 2), ptns = _a[0], setPtns = _a[1];
|
|
50
50
|
(0, react_1.useLayoutEffect)(function () { return setPtns((0, StringUtil_1.searchText)(props.text, props.keyword)); }, [props]);
|
|
51
|
-
return
|
|
51
|
+
return ptns.map(function (ptn) { return ptn.hit ? react_1.default.createElement("span", { className: 'v-highlight' }, ptn.text) : ptn.text; });
|
|
52
52
|
};
|
|
53
53
|
exports.HighLight = HighLight;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode, CSSProperties } from 'react';
|
|
3
|
-
import type { ActButton } from '../SearchBar/ActionButtons';
|
|
3
|
+
import type { ActButton } from '../SearchTool/SearchBar/ActionButtons';
|
|
4
4
|
export type UTitleProps = {
|
|
5
5
|
className?: string;
|
|
6
6
|
style?: CSSProperties;
|
|
@@ -32,7 +32,7 @@ var lodash_1 = __importDefault(require("lodash"));
|
|
|
32
32
|
var utils_1 = require("../../utils");
|
|
33
33
|
var Popover_1 = require("../_adapt/Popover");
|
|
34
34
|
var Icon_1 = require("../_adapt/Icon");
|
|
35
|
-
var ActionButtons_1 = require("../SearchBar/ActionButtons");
|
|
35
|
+
var ActionButtons_1 = require("../SearchTool/SearchBar/ActionButtons");
|
|
36
36
|
var UTitle = function (props) {
|
|
37
37
|
var elAction = '';
|
|
38
38
|
var actions = [];
|
package/components/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { registerFormField, } from './UForm/_register';
|
|
2
2
|
export { getPlaceholder, getMultiFieldValues, registerApiTableSelector, copyMultiValue } from './UForm/_input';
|
|
3
3
|
export type { FormFieldComponent, FormFieldProps, FormFieldOptions, } from './UForm/_register';
|
|
4
|
-
export { registerSearchField, } from './SearchBar/_register';
|
|
5
|
-
export type { SearchFieldComponent, SearchFieldProps, SearchFieldOptions, } from './SearchBar/_register';
|
|
4
|
+
export { registerSearchField, } from './SearchTool/SearchBar/_register';
|
|
5
|
+
export type { SearchFieldComponent, SearchFieldProps, SearchFieldOptions, } from './SearchTool/SearchBar/_register';
|
|
6
6
|
export { registerSelectBar } from './Box/_register';
|
|
7
7
|
export type { SelectBarComponent, SelectBarProps, SelectBarOptions, } from './Box/_register';
|
package/components/index.js
CHANGED
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "getMultiFieldValues", { enumerable: true, get: f
|
|
|
10
10
|
Object.defineProperty(exports, "registerApiTableSelector", { enumerable: true, get: function () { return _input_1.registerApiTableSelector; } });
|
|
11
11
|
Object.defineProperty(exports, "copyMultiValue", { enumerable: true, get: function () { return _input_1.copyMultiValue; } });
|
|
12
12
|
// SearchField 搜索条件输入字段
|
|
13
|
-
var _register_2 = require("./SearchBar/_register");
|
|
13
|
+
var _register_2 = require("./SearchTool/SearchBar/_register");
|
|
14
14
|
Object.defineProperty(exports, "registerSearchField", { enumerable: true, get: function () { return _register_2.registerSearchField; } });
|
|
15
15
|
// SelectBar - 左侧边栏
|
|
16
16
|
var _register_3 = require("./Box/_register");
|