vap1 0.4.7 → 0.5.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/base.json +30 -0
- package/basetype.d.ts +0 -1
- package/cems/admin/AsyncSelect.d.ts +45 -0
- package/cems/admin/AsyncSelect.js +2 -0
- package/cems/admin/CardTable.d.ts +207 -0
- package/cems/admin/CardTable.js +2 -0
- package/cems/admin/EasyuiTree.d.ts +131 -0
- package/cems/admin/EasyuiTree.js +2 -0
- package/cems/admin/utils.d.ts +5 -0
- package/cems/admin/utils.js +3 -0
- package/cems/admin/validator.d.ts +137 -0
- package/cems/admin/validator.js +2 -0
- package/cems/assets/CUpload.d.ts +23 -0
- package/cems/assets/CUpload.js +2 -0
- package/cems/assets/Charts.d.ts +37 -0
- package/cems/assets/Charts.js +2 -0
- package/cems/assets/DInfo.d.ts +38 -0
- package/cems/assets/DInfo.js +2 -0
- package/cems/assets/DModal.d.ts +84 -0
- package/cems/assets/DModal.js +2 -0
- package/cems/assets/DTable.d.ts +128 -0
- package/cems/assets/DTable.js +2 -0
- package/cems/assets/DivWidth.d.ts +14 -0
- package/cems/assets/DivWidth.js +2 -0
- package/cems/assets/Patch.d.ts +9 -0
- package/cems/assets/Patch.js +2 -0
- package/cems/assets/Sensitive.d.ts +33 -0
- package/cems/assets/Sensitive.js +2 -0
- package/cems/assets/types.d.ts +200 -0
- package/cems/assets/types.js +2 -0
- package/cems/assets/utils.d.ts +61 -0
- package/cems/assets/utils.js +2 -0
- package/cems/define.d.ts +9 -0
- package/cems/define.js +18 -0
- package/cems/index.d.ts +228 -0
- package/cems/index.js +81 -0
- package/cems/policy/CForm.d.ts +133 -0
- package/cems/policy/CForm.js +2 -0
- package/cems/policy/DApiTable.d.ts +78 -0
- package/cems/policy/DApiTable.js +2 -0
- package/cems/policy/DButton.d.ts +17 -0
- package/cems/policy/DButton.js +2 -0
- package/cems/policy/DCheckbox.d.ts +50 -0
- package/cems/policy/DCheckbox.js +2 -0
- package/cems/policy/DCheckboxGroup.d.ts +34 -0
- package/cems/policy/DCheckboxGroup.js +2 -0
- package/cems/policy/DCol.d.ts +33 -0
- package/cems/policy/DCol.js +2 -0
- package/cems/policy/DColorPicker.d.ts +9 -0
- package/cems/policy/DColorPicker.js +2 -0
- package/cems/policy/DDatePicker.d.ts +41 -0
- package/cems/policy/DDatePicker.js +2 -0
- package/cems/policy/DDiv.d.ts +65 -0
- package/cems/policy/DDiv.js +2 -0
- package/cems/policy/DDrawer.d.ts +6 -0
- package/cems/policy/DDrawer.js +2 -0
- package/cems/policy/DDynamicSelect.d.ts +50 -0
- package/cems/policy/DDynamicSelect.js +2 -0
- package/cems/policy/DDynamicTreeSelect.d.ts +45 -0
- package/cems/policy/DDynamicTreeSelect.js +2 -0
- package/cems/policy/DForm.d.ts +248 -0
- package/cems/policy/DForm.js +2 -0
- package/cems/policy/DIcon.d.ts +33 -0
- package/cems/policy/DIcon.js +2 -0
- package/cems/policy/DInput.d.ts +41 -0
- package/cems/policy/DInput.js +2 -0
- package/cems/policy/DLabel.d.ts +17 -0
- package/cems/policy/DLabel.js +2 -0
- package/cems/policy/DPTable.d.ts +86 -0
- package/cems/policy/DPTable.js +2 -0
- package/cems/policy/DRadio.d.ts +34 -0
- package/cems/policy/DRadio.js +2 -0
- package/cems/policy/DSCTable.d.ts +33 -0
- package/cems/policy/DSCTable.js +2 -0
- package/cems/policy/DSelect.d.ts +42 -0
- package/cems/policy/DSelect.js +2 -0
- package/cems/policy/DSlider.d.ts +21 -0
- package/cems/policy/DSlider.js +2 -0
- package/cems/policy/DSwitch.d.ts +21 -0
- package/cems/policy/DSwitch.js +2 -0
- package/cems/policy/DTab.d.ts +30 -0
- package/cems/policy/DTab.js +2 -0
- package/cems/policy/DTimePicker.d.ts +37 -0
- package/cems/policy/DTimePicker.js +2 -0
- package/cems/policy/DTree.d.ts +98 -0
- package/cems/policy/DTree.js +2 -0
- package/cems/policy/DUpload.d.ts +33 -0
- package/cems/policy/DUpload.js +2 -0
- package/cems/policy/types.d.ts +200 -0
- package/cems/policy/types.js +2 -0
- package/cems/policy/utils.d.ts +13 -0
- package/cems/policy/utils.js +2 -0
- package/components/Box/Box.d.ts +42 -6
- package/components/Box/Box.js +66 -16
- package/components/Box/SelectBar.d.ts +1 -1
- package/components/Box/SelectBar.js +19 -9
- package/components/Lists/BaseList.d.ts +5 -0
- package/components/Lists/BaseList.js +111 -0
- package/components/Lists/Fields/IconRender.d.ts +53 -0
- package/components/Lists/Fields/IconRender.js +174 -0
- package/components/Lists/Fields/ItemRender.d.ts +2 -0
- package/components/Lists/Fields/ItemRender.js +127 -0
- package/components/Lists/Fields/_utils.d.ts +3 -0
- package/components/Lists/Fields/_utils.js +80 -0
- package/components/Lists/Fields/index.d.ts +3 -0
- package/components/Lists/Fields/index.js +47 -0
- package/components/Lists/Grid/grid.d.ts +7 -0
- package/components/Lists/Grid/grid.js +18 -0
- package/components/Lists/Grid/index.d.ts +3 -0
- package/components/Lists/Grid/index.js +50 -0
- package/components/Lists/Row/index.d.ts +3 -0
- package/components/Lists/Row/index.js +14 -0
- package/components/Lists/SList.js +17 -7
- package/components/Lists/Timeline/index.d.ts +3 -0
- package/components/Lists/Timeline/index.js +117 -0
- package/components/Lists/VList.d.ts +3 -0
- package/components/Lists/VList.js +92 -0
- package/components/Lists/components/LayoutSwitcher.d.ts +13 -0
- package/components/Lists/components/LayoutSwitcher.js +121 -0
- package/components/Lists/components/SearchTool.d.ts +13 -0
- package/components/Lists/components/SearchTool.js +34 -0
- package/components/Lists/index.d.ts +129 -0
- package/components/Lists/index.js +2 -0
- package/components/SearchTool/SearchBand/BandInput.d.ts +3 -0
- package/components/SearchTool/SearchBand/BandInput.js +54 -0
- package/components/SearchTool/SearchBand/BandTag.d.ts +7 -0
- package/components/SearchTool/SearchBand/BandTag.js +82 -0
- package/components/SearchTool/SearchBand/_SearchBandAction.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandAction.js +23 -0
- package/components/SearchTool/SearchBand/_SearchBandFix.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandFix.js +72 -0
- package/components/SearchTool/SearchBand/_SearchBandTag.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandTag.js +75 -0
- package/components/SearchTool/SearchBand/_register.d.ts +47 -0
- package/components/SearchTool/SearchBand/_register.js +15 -0
- package/components/SearchTool/SearchBand/hooks.d.ts +12 -0
- package/components/SearchTool/SearchBand/hooks.js +181 -0
- package/components/SearchTool/SearchBand/index.d.ts +3 -0
- package/components/SearchTool/SearchBand/index.js +66 -0
- package/components/SearchTool/SearchBand/type.d.ts +71 -0
- package/components/SearchTool/SearchBand/type.js +3 -0
- package/components/SearchTool/SearchBar/ActionButtons.js +17 -7
- package/components/SearchTool/SearchBar/ByField.d.ts +1 -1
- package/components/SearchTool/SearchBar/ByField.js +17 -7
- package/components/SearchTool/SearchBar/ByKeyword.d.ts +1 -1
- package/components/SearchTool/SearchBar/ByKeyword.js +17 -7
- package/components/SearchTool/SearchBar/SearchField.d.ts +1 -1
- package/components/SearchTool/SearchBar/_register.d.ts +1 -1
- package/components/SearchTool/SearchBar/index.d.ts +1 -65
- package/components/SearchTool/SearchBar/type.d.ts +133 -0
- package/components/SearchTool/SearchBar/type.js +35 -0
- package/components/SearchTool/index.d.ts +5 -63
- package/components/SearchTool/index.js +5 -0
- package/components/Tables/ApiTable.d.ts +5 -7
- package/components/Tables/ApiTable.js +17 -7
- package/components/Tables/ApiTableModal.d.ts +5 -7
- package/components/Tables/ApiTableModal.js +17 -7
- package/components/Tables/Components/ActionBar.d.ts +7 -10
- package/components/Tables/Components/ActionBar.js +73 -40
- package/components/Tables/Components/Actions.d.ts +3 -1
- package/components/Tables/Components/Actions.js +40 -3
- package/components/Tables/Components/index.d.ts +3 -1
- package/components/Tables/Components/useTableContext.d.ts +16 -0
- package/components/Tables/Components/useTableContext.js +116 -0
- package/components/Tables/STable.js +17 -7
- package/components/Tables/TopTable.js +17 -7
- package/components/Tables/Util.d.ts +2 -2
- package/components/Tables/Util.js +0 -1
- package/components/Tables/VTable.d.ts +9 -11
- package/components/Tables/VTable.js +119 -172
- package/components/Tables/VTableBack.d.ts +0 -0
- package/components/Tables/VTableBack.js +269 -0
- package/components/Tables/index.d.ts +11 -22
- package/components/TreeSelect/BaseTreeSelect.js +17 -7
- package/components/TreeSelect/DTreeSelect.js +19 -9
- package/components/TreeSelect/FTreeSelect.js +2 -2
- package/components/Trees/ActionTree.d.ts +3 -5
- package/components/Trees/ActionTree.js +19 -9
- package/components/Trees/BaseTree.js +17 -7
- package/components/Trees/COTree/COButton.js +17 -7
- package/components/Trees/COTree/COSelect.js +17 -7
- package/components/Trees/COTree/COTree.js +19 -9
- package/components/Trees/DTree.d.ts +0 -7
- package/components/Trees/DTree.js +19 -9
- package/components/Trees/FTree.js +19 -9
- package/components/Trees/STree.js +17 -7
- package/components/UForm/FormWrapper.js +17 -7
- package/components/UForm/UDescriptions.d.ts +2 -3
- package/components/UForm/UDescriptions.js +17 -7
- package/components/UForm/UForm.d.ts +1 -1
- package/components/UForm/UForm.js +24 -11
- package/components/UForm/UFormModal.js +19 -9
- package/components/UForm/_input.d.ts +5 -1
- package/components/UForm/_input.js +25 -8
- package/components/Upload/UploadImage.js +17 -7
- package/components/Upload/UploadModal.js +19 -9
- package/components/Upload/useUpload.js +2 -2
- package/components/_adapt/Alert.js +17 -7
- package/components/_adapt/ColorPicker.js +17 -7
- package/components/_adapt/Drawer.js +17 -7
- package/components/_adapt/Dropdown.js +17 -7
- package/components/_adapt/FloatButton.js +17 -7
- package/components/_adapt/Input.js +17 -7
- package/components/_adapt/InputNumber.js +17 -7
- package/components/_adapt/Layout.js +17 -7
- package/components/_adapt/Menu.js +17 -7
- package/components/_adapt/Modal.js +17 -7
- package/components/_adapt/Popconfirm.js +17 -7
- package/components/_adapt/Popover.js +17 -7
- package/components/_adapt/Progress.js +17 -7
- package/components/_adapt/Select.js +17 -7
- package/components/_adapt/Table.js +17 -7
- package/components/_adapt/Tabs.js +17 -7
- package/components/_adapt/Tag.js +17 -7
- package/components/_adapt/TreeSelect.js +17 -7
- package/components/_adapt/todo/Image.d.ts +0 -1
- package/components/_adapt/todo/Segmented.d.ts +0 -1
- package/components/_common/AutoComplete.js +35 -12
- package/components/_common/CountUp.js +17 -7
- package/components/_common/DateRange.d.ts +5 -2
- package/components/_common/DateRange.js +43 -40
- package/components/_common/HighLight.d.ts +1 -1
- package/components/_common/HighLight.js +26 -24
- package/components/_common/Loading.js +17 -7
- package/components/_common/MonthRange.js +17 -7
- package/components/_common/PromiseLabel.js +2 -2
- package/components/_common/UTitle.js +17 -7
- package/components/_common/Upagination.d.ts +1 -0
- package/components/_common/Upagination.js +5 -1
- package/components/_i18n.d.ts +1 -102
- package/components/index.js +4 -0
- package/deps/JsonView.js +17 -7
- package/deps/app-audit/LookUp.js +19 -9
- package/deps/app-data/useSource.js +19 -9
- package/deps/echarts.d.ts +3 -0
- package/deps/echarts.js +20 -10
- package/deps/editor/Article.js +17 -7
- package/deps/editor/Editor.js +17 -7
- package/deps/editor/EditorModal.js +17 -7
- package/deps/editor/support/buttons/ImageButton.js +17 -7
- package/deps/editor/tools/Button.js +0 -2
- package/deps/editor/tools/_TxtButton.js +17 -7
- package/deps/vapc/_basic.d.ts +1 -0
- package/deps/vapc/_basic.js +15 -0
- package/deps/vapc/index.d.ts +10 -0
- package/deps/vapc/index.js +70 -0
- package/hooks/useAjaxAction.js +2 -2
- package/hooks/useAjaxQuery.js +2 -2
- package/hooks/useApiBase.js +2 -2
- package/hooks/useApiGlobal.js +1 -1
- package/hooks/useArray.js +2 -2
- package/hooks/useDefault.d.ts +0 -1
- package/hooks/useDoLoad.d.ts +1 -1
- package/hooks/useError.d.ts +1 -1
- package/hooks/useMemoPromise.js +2 -2
- package/index.d.ts +2 -1
- package/login/Base65.d.ts +7 -1
- package/login/Base65.js +49 -22
- package/login/Password.d.ts +8 -5
- package/login/Password.js +68 -102
- package/package.json +1 -1
- package/screen/Page.js +17 -7
- package/screen/vapc-schema/dark.d.ts +1 -0
- package/screen/vapc-schema/dark.js +50 -0
- package/screen/vapc-schema/insight.d.ts +1 -0
- package/screen/vapc-schema/insight.js +49 -0
- package/uform/FormEditor.js +17 -7
- package/uform/FormViewer.js +17 -7
- package/uform/hooks/useEditor.d.ts +0 -1
- package/uform/hooks/useForm.d.ts +0 -1
- package/uform/inputs/index.d.ts +0 -1
- package/uform/panel/Editor/_GroupDefault.js +17 -7
- package/uform/panel/Editor/_GroupStep.js +17 -7
- package/uform/panel/Editor/_GroupTab.js +17 -7
- package/uform/panel/Editor/index.js +17 -7
- package/uform/panel/Items/Fields.js +17 -7
- package/uform/panel/Items/InputSelector.js +17 -7
- package/uform/panel/Items/Inputs.js +17 -7
- package/uform/panel/Items/index.d.ts +1 -1
- package/uform/panel/Propreties/CanvasProperties.js +17 -7
- package/uform/panel/Propreties/Component/FieldPlugin.js +17 -7
- package/uform/panel/Propreties/Component/LinkAsyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/LinkSyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/Links.js +17 -7
- package/uform/panel/Propreties/Component/OptionTable.js +17 -7
- package/uform/panel/Propreties/Component/RegexpModal.js +17 -7
- package/uform/panel/Propreties/Component/Validate.js +17 -7
- package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/ValidateSyncFunction.js +17 -7
- package/uform/panel/Propreties/FieldOptions.js +17 -7
- package/uform/panel/Propreties/FieldProperties.js +17 -7
- package/uform/panel/Propreties/_ItemAdvance.js +17 -7
- package/uform/panel/Propreties/_ItemBase.js +17 -7
- package/uform/panel/Propreties/_ItemLink.js +17 -7
- package/uform/panel/Propreties/_ItemValidate.js +17 -7
- package/uform/schema.d.ts +1 -1
- package/uform/utils/Convert.js +2 -2
- package/utils/Ajax.d.ts +3 -0
- package/utils/Ajax.js +10 -7
- package/utils/CacheUtil.d.ts +1 -1
- package/utils/Const.js +17 -7
- package/utils/Format.d.ts +138 -14
- package/utils/Format.js +127 -13
- package/utils/Global.d.ts +12 -0
- package/utils/Global.js +7 -1
- package/utils/PageUtil.d.ts +111 -23
- package/utils/PageUtil.js +163 -28
- package/utils/Renders/ApiGetRender.js +20 -10
- package/utils/Renders/ApiPostRender.js +3 -3
- package/utils/Renders/CondictionRender.js +17 -7
- package/utils/Renders/DateRender.js +20 -2
- package/utils/Renders/ListRender.js +1 -1
- package/utils/Renders/NumberRender.js +24 -5
- package/utils/Renders/StringRender.js +81 -11
- package/utils/Renders/_define.d.ts +8 -7
- package/utils/Renders/_define.js +76 -17
- package/utils/StringUtil.d.ts +292 -62
- package/utils/StringUtil.js +310 -63
- package/utils/TreeUtil.js +14 -10
- package/utils/VAP.d.ts +26 -1
- package/utils/VAP.js +57 -0
- package/utils/_AjaxUtil.d.ts +1 -0
- package/utils/_AjaxUtil.js +70 -3
- package/utils/_Support.d.ts +2 -2
- package/utils/_Support.js +4 -2
- package/utils/crontab/crontabRender.js +0 -1
- package/utils/i18n.d.ts +13 -2
- package/utils/i18n.js +13 -2
- package/utils/index.d.ts +4 -0
- package/utils/index.js +19 -9
- package/components/SearchTool/_FieldType.d.ts +0 -8
- package/components/SearchTool/_FieldType.js +0 -51
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
|
+
import type { SearchBandFiled } from './type';
|
|
3
|
+
import type { PlainObject } from '../../../basetype';
|
|
4
|
+
/**
|
|
5
|
+
* 输入组件
|
|
6
|
+
*/
|
|
7
|
+
export type SearchBandInputProps = {
|
|
8
|
+
/**
|
|
9
|
+
* field
|
|
10
|
+
*/
|
|
11
|
+
field: SearchBandFiled;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
onChange: (val: any) => void;
|
|
16
|
+
/**
|
|
17
|
+
* 是否在 Fixed 模式
|
|
18
|
+
*/
|
|
19
|
+
isFix?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 是否在 Tag 中弹开的模式
|
|
22
|
+
* */
|
|
23
|
+
isTag?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* fix / tag 模式中时,数据
|
|
26
|
+
* */
|
|
27
|
+
data?: PlainObject;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 组件特性
|
|
31
|
+
*/
|
|
32
|
+
export type SearchBandFieldOptions = {
|
|
33
|
+
isMulti?: boolean;
|
|
34
|
+
popWidth?: number;
|
|
35
|
+
breakCol?: boolean;
|
|
36
|
+
render?: (field: SearchBandFiled, value: any, formData: PlainObject) => ReactNode;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* 通用 SearchBar 搜索字段定义
|
|
40
|
+
*/
|
|
41
|
+
export type SearchBandFieldComponent = ComponentType<SearchBandInputProps>;
|
|
42
|
+
type SearchBandField = SearchBandFieldOptions & {
|
|
43
|
+
component: SearchBandFieldComponent;
|
|
44
|
+
};
|
|
45
|
+
export declare const registerSearchBandField: (type: string, component: SearchBandFieldComponent, options?: SearchBandFieldOptions, forceOverWrite?: boolean) => void;
|
|
46
|
+
export declare const getSearchBandField: (type: string) => SearchBandField;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSearchBandField = exports.registerSearchBandField = void 0;
|
|
4
|
+
var _RegisterUtil_1 = require("../../_RegisterUtil");
|
|
5
|
+
var _Support_1 = require("../../../utils/_Support");
|
|
6
|
+
var _C_SEARCHBAND = (0, _Support_1.globalDefault)('_C_SEARCHBAND', new Map());
|
|
7
|
+
var DEFAULT = { isMulti: false, breakCol: false, popWidth: 320 };
|
|
8
|
+
var registerSearchBandField = function (type, component, options, forceOverWrite) {
|
|
9
|
+
(0, _RegisterUtil_1.register)(_C_SEARCHBAND, type, DEFAULT, component, options, forceOverWrite);
|
|
10
|
+
};
|
|
11
|
+
exports.registerSearchBandField = registerSearchBandField;
|
|
12
|
+
var getSearchBandField = function (type) {
|
|
13
|
+
return _C_SEARCHBAND.has(type) ? _C_SEARCHBAND.get(type) : _C_SEARCHBAND.get('text');
|
|
14
|
+
};
|
|
15
|
+
exports.getSearchBandField = getSearchBandField;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ColHTMLAttributes } from 'react';
|
|
2
|
+
import type { PlainObject } from '../../../basetype';
|
|
3
|
+
import type { SearchBandFiled, SearchBandProps } from './type';
|
|
4
|
+
export declare const useSearchBand: (props: SearchBandProps, fixMode: boolean) => {
|
|
5
|
+
colgroup: ColHTMLAttributes<HTMLTableColElement>[];
|
|
6
|
+
cols: number;
|
|
7
|
+
rows: SearchBandFiled[][];
|
|
8
|
+
tags: SearchBandFiled[];
|
|
9
|
+
state: PlainObject;
|
|
10
|
+
changeField: (field: SearchBandFiled, value: any) => void;
|
|
11
|
+
removeField: (field: SearchBandFiled) => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __values = (this && this.__values) || function(o) {
|
|
14
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
15
|
+
if (m) return m.call(o);
|
|
16
|
+
if (o && typeof o.length === "number") return {
|
|
17
|
+
next: function () {
|
|
18
|
+
if (o && i >= o.length) o = void 0;
|
|
19
|
+
return { value: o && o[i++], done: !o };
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
23
|
+
};
|
|
24
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
25
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
26
|
+
if (!m) return o;
|
|
27
|
+
var i = m.call(o), r, ar = [], e;
|
|
28
|
+
try {
|
|
29
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
30
|
+
}
|
|
31
|
+
catch (error) { e = { error: error }; }
|
|
32
|
+
finally {
|
|
33
|
+
try {
|
|
34
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
35
|
+
}
|
|
36
|
+
finally { if (e) throw e.error; }
|
|
37
|
+
}
|
|
38
|
+
return ar;
|
|
39
|
+
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.useSearchBand = void 0;
|
|
45
|
+
var react_1 = require("react");
|
|
46
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
47
|
+
var hooks_1 = require("../../../hooks");
|
|
48
|
+
var Global_1 = require("../../../utils/Global");
|
|
49
|
+
var FONT_SIZE = 16;
|
|
50
|
+
var maxWidth = function (fields) {
|
|
51
|
+
return FONT_SIZE * lodash_1.default.max(fields.map(function (field) { return field.label.length; })) + 32;
|
|
52
|
+
};
|
|
53
|
+
var inTag = function (field, data) {
|
|
54
|
+
var e_1, _a;
|
|
55
|
+
var isMulti = field.indexOf(',') > 0; // 是否多字模式
|
|
56
|
+
if (!isMulti)
|
|
57
|
+
return lodash_1.default.has(data, field) && data[field] !== undefined;
|
|
58
|
+
var fields = field.split(',');
|
|
59
|
+
try {
|
|
60
|
+
for (var fields_1 = __values(fields), fields_1_1 = fields_1.next(); !fields_1_1.done; fields_1_1 = fields_1.next()) {
|
|
61
|
+
var item = fields_1_1.value;
|
|
62
|
+
if (lodash_1.default.has(data, item) && data[item] !== undefined)
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
67
|
+
finally {
|
|
68
|
+
try {
|
|
69
|
+
if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return)) _a.call(fields_1);
|
|
70
|
+
}
|
|
71
|
+
finally { if (e_1) throw e_1.error; }
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
};
|
|
75
|
+
var useTableColumns = function (props, labelWidth, data, fixMode) {
|
|
76
|
+
var cols = props.cols, fields = props.fields;
|
|
77
|
+
var MAX = cols || Global_1.CONFIG.SEARCHBAND.DEFALULT_COL;
|
|
78
|
+
return (0, react_1.useMemo)(function () {
|
|
79
|
+
var rows = [];
|
|
80
|
+
var tags = [];
|
|
81
|
+
var rowUse = 0;
|
|
82
|
+
fields.forEach(function (field, i) {
|
|
83
|
+
// note : segmented 用不出现在 tag 中
|
|
84
|
+
var inSearch = (fixMode || field.type == 'segmented') ? false : inTag(field.field, data);
|
|
85
|
+
if (inSearch) {
|
|
86
|
+
tags.push(__assign(__assign({}, field), { value: data[field.field] }));
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (MAX <= 1) {
|
|
90
|
+
rows.push([__assign(__assign({}, field), { span: 1 })]);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
var tailMode = false;
|
|
94
|
+
if (rows.length && rowUse < MAX) {
|
|
95
|
+
if ((field.span || 1) <= (MAX - rowUse)) {
|
|
96
|
+
tailMode = true; // 直接追尾
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// 无法追尾, 补全最后一列
|
|
100
|
+
var lastRow_1 = rows[rows.length - 1];
|
|
101
|
+
var total = lodash_1.default.sum(lastRow_1.map(function (item) { return item.span; }));
|
|
102
|
+
var diff = MAX - total;
|
|
103
|
+
if (diff > 0) {
|
|
104
|
+
lastRow_1[lastRow_1.length - 1].span = lastRow_1[lastRow_1.length - 1].span + diff;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (tailMode) {
|
|
109
|
+
rows[rows.length - 1].push(__assign(__assign({}, field), { span: lodash_1.default.min([field.span || 1, MAX]) }));
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
rows.push([__assign(__assign({}, field), { span: lodash_1.default.min([field.span || 1, MAX]) })]);
|
|
113
|
+
}
|
|
114
|
+
var lastRow = rows[rows.length - 1];
|
|
115
|
+
rowUse = lodash_1.default.sum(lastRow.map(function (item) { return (item.span || 1); }));
|
|
116
|
+
});
|
|
117
|
+
if (MAX > 1 && rowUse < MAX) {
|
|
118
|
+
if (rows.length > 0) {
|
|
119
|
+
var lastRow = rows[rows.length - 1];
|
|
120
|
+
lastRow[lastRow.length - 1].span += (MAX - rowUse);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
colgroup: lodash_1.default.flatten(lodash_1.default.range(MAX).map(function () { return [{ style: { width: labelWidth } }, {}]; })),
|
|
125
|
+
cols: MAX,
|
|
126
|
+
rows: rows,
|
|
127
|
+
tags: tags,
|
|
128
|
+
};
|
|
129
|
+
}, [data]);
|
|
130
|
+
};
|
|
131
|
+
var useSearchBand = function (props, fixMode) {
|
|
132
|
+
var _a = __read((0, react_1.useState)(props.default || {}), 2), state = _a[0], setState = _a[1];
|
|
133
|
+
var isFristMount = (0, hooks_1.useFirstMountState)();
|
|
134
|
+
var labelWidth = (0, react_1.useMemo)(function () {
|
|
135
|
+
if (lodash_1.default.isNumber(props.labelWidth))
|
|
136
|
+
return props.labelWidth;
|
|
137
|
+
return maxWidth(props.fields);
|
|
138
|
+
}, [props.fields, props.labelWidth]);
|
|
139
|
+
var colDefined = useTableColumns(props, labelWidth, state, fixMode);
|
|
140
|
+
(0, react_1.useEffect)(function () {
|
|
141
|
+
if (isFristMount)
|
|
142
|
+
return;
|
|
143
|
+
props.onSearch(state);
|
|
144
|
+
}, [state]);
|
|
145
|
+
var changeField = (0, react_1.useCallback)(function (field, value) {
|
|
146
|
+
var isMulti = field.field.indexOf(',') > 0; // 是否多字模式
|
|
147
|
+
if (!isMulti) {
|
|
148
|
+
setState(function (prev) {
|
|
149
|
+
var _a;
|
|
150
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[field.field] = value, _a)));
|
|
151
|
+
});
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
var fileds = field.field.split(',');
|
|
155
|
+
setState(function (prev) {
|
|
156
|
+
var extend = {};
|
|
157
|
+
fileds.forEach(function (field) {
|
|
158
|
+
if (lodash_1.default.has(value, field)) {
|
|
159
|
+
extend[field] = value[field];
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
return __assign(__assign({}, prev), extend);
|
|
163
|
+
});
|
|
164
|
+
}, []);
|
|
165
|
+
var removeField = (0, react_1.useCallback)(function (field) { return setState(function (prev) {
|
|
166
|
+
var isMulti = field.field.indexOf(',') > 0; // 是否多字模式
|
|
167
|
+
if (!isMulti) {
|
|
168
|
+
if (!lodash_1.default.has(prev, field.field))
|
|
169
|
+
return prev;
|
|
170
|
+
var value_1 = __assign({}, prev);
|
|
171
|
+
lodash_1.default.unset(value_1, field.field);
|
|
172
|
+
// setState(prev => ({ ...prev, [field.field]: value }));
|
|
173
|
+
return value_1;
|
|
174
|
+
}
|
|
175
|
+
var value = __assign({}, prev);
|
|
176
|
+
field.field.split(',').forEach(function (item) { return lodash_1.default.unset(value, item); });
|
|
177
|
+
return value;
|
|
178
|
+
}); }, []);
|
|
179
|
+
return __assign({ state: state, changeField: changeField, removeField: removeField }, colDefined);
|
|
180
|
+
};
|
|
181
|
+
exports.useSearchBand = useSearchBand;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.SearchBand = void 0;
|
|
51
|
+
var react_1 = __importStar(require("react"));
|
|
52
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
53
|
+
var Global_1 = require("../../../utils/Global");
|
|
54
|
+
var _SearchBandTag_1 = require("./_SearchBandTag");
|
|
55
|
+
var _SearchBandFix_1 = require("./_SearchBandFix");
|
|
56
|
+
var SearchBand = function (props) {
|
|
57
|
+
var fixMode = (0, react_1.useMemo)(function () {
|
|
58
|
+
if (lodash_1.default.isBoolean(props.fixMode))
|
|
59
|
+
return props.fixMode;
|
|
60
|
+
return Global_1.CONFIG.SEARCHBAND.FIX_MODE;
|
|
61
|
+
}, [props.fixMode]);
|
|
62
|
+
if (fixMode)
|
|
63
|
+
return react_1.default.createElement(_SearchBandFix_1.SearchBandFix, __assign({}, props));
|
|
64
|
+
return react_1.default.createElement(_SearchBandTag_1.SearchBandTag, __assign({}, props));
|
|
65
|
+
};
|
|
66
|
+
exports.SearchBand = SearchBand;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Field } from "../SearchBar/type";
|
|
2
|
+
import type { PlainObject } from '../../../basetype';
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import type { TagProps } from 'antd/es/tag';
|
|
5
|
+
declare const BuiltInType: readonly ["select", "multi-select", "segmented", "text", "number", "number-range", "slider-range", "date", "daterange", "daterange-single", "datetime", "datetimerange", "datetimerange-single"];
|
|
6
|
+
export type SearchBandFiled = Omit<Field, 'type'> & {
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
type?: typeof BuiltInType[number] | (string & {});
|
|
11
|
+
/**
|
|
12
|
+
* 选中后的TAG色, 默认为 default
|
|
13
|
+
*/
|
|
14
|
+
tagColor?: TagProps['color'];
|
|
15
|
+
/**
|
|
16
|
+
* 自定义 render 用于 tag 展示
|
|
17
|
+
*/
|
|
18
|
+
render?: (value: any, data: PlainObject) => ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* 在 radio / checkbox 时生效
|
|
21
|
+
* 选项展示模式,目前 支持 link(默认) tag button
|
|
22
|
+
* origin 时 radio = Radio CheckBox = checkbox
|
|
23
|
+
*/
|
|
24
|
+
optionStyle?: 'tag' | 'link' | 'button' | 'origin';
|
|
25
|
+
};
|
|
26
|
+
export type SearchBandProps = {
|
|
27
|
+
/**
|
|
28
|
+
* searchBar扩展类名称
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* 搜索参数
|
|
33
|
+
* 说明 : FlatSearchBar 支持的 type 与 SearchBar 一致
|
|
34
|
+
* 目前只支持 radio / checkbox / select / slider-range / timerange / datarange
|
|
35
|
+
*/
|
|
36
|
+
fields: SearchBandFiled[];
|
|
37
|
+
/**
|
|
38
|
+
* 搜索参数支持的列,最多支持3,默认为1
|
|
39
|
+
*/
|
|
40
|
+
cols?: 1 | 2 | 3;
|
|
41
|
+
/**
|
|
42
|
+
* 搜索被触发时
|
|
43
|
+
*/
|
|
44
|
+
onSearch: (param: PlainObject) => void;
|
|
45
|
+
/**
|
|
46
|
+
* 默认参数
|
|
47
|
+
*/
|
|
48
|
+
default?: PlainObject;
|
|
49
|
+
/**
|
|
50
|
+
* 如果为true, 则不会以Tag显示
|
|
51
|
+
*/
|
|
52
|
+
fixMode?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* @external
|
|
55
|
+
* 提示信息
|
|
56
|
+
*/
|
|
57
|
+
tip?: ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* @external
|
|
60
|
+
* 额外的 ACTION , 说明: 无特殊情况不要使用
|
|
61
|
+
*/
|
|
62
|
+
extraAction?: ReactNode | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* 说明:
|
|
65
|
+
* 系统会自动计算label需要的宽度
|
|
66
|
+
* 使用 labelWidth时,
|
|
67
|
+
* 会强制使用 labelWidth 做为label宽度, 用于个别场景
|
|
68
|
+
*/
|
|
69
|
+
labelWidth?: number;
|
|
70
|
+
};
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var BuiltInType = ['select', 'multi-select', 'segmented', 'text', 'number', 'number-range', 'slider-range', 'date', 'daterange', 'daterange-single', 'datetime', 'datetimerange', 'datetimerange-single'];
|
|
@@ -26,13 +26,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
26
|
}) : function(o, v) {
|
|
27
27
|
o["default"] = v;
|
|
28
28
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
36
46
|
var __values = (this && this.__values) || function(o) {
|
|
37
47
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
38
48
|
if (m) return m.call(o);
|
|
@@ -26,13 +26,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
26
|
}) : function(o, v) {
|
|
27
27
|
o["default"] = v;
|
|
28
28
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
36
46
|
var __read = (this && this.__read) || function (o, n) {
|
|
37
47
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
38
48
|
if (!m) return o;
|
|
@@ -26,13 +26,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
26
|
}) : function(o, v) {
|
|
27
27
|
o["default"] = v;
|
|
28
28
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
36
46
|
var __read = (this && this.__read) || function (o, n) {
|
|
37
47
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
38
48
|
if (!m) return o;
|
|
@@ -1,70 +1,6 @@
|
|
|
1
1
|
import { ActionButtons } from './ActionButtons';
|
|
2
2
|
import type { PropsWithChildren, ExoticComponent } from 'react';
|
|
3
|
-
import type {
|
|
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
|
-
};
|
|
3
|
+
import type { SearchBarProps } from './type';
|
|
68
4
|
export interface SearchBar extends ExoticComponent<PropsWithChildren<SearchBarProps>> {
|
|
69
5
|
ActionButtons: typeof ActionButtons;
|
|
70
6
|
}
|