vap1 0.4.5 → 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 +4 -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 +43 -7
- package/components/Box/Box.js +67 -17
- 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/{SearchBar → SearchTool/SearchBar}/ActionButtons.d.ts +2 -2
- package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.js +22 -12
- package/components/{SearchBar → SearchTool/SearchBar}/ByField.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/ByField.js +21 -11
- package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.js +20 -10
- 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 +7 -0
- package/components/{SearchBar → SearchTool/SearchBar}/index.js +1 -1
- package/components/{SearchBar/index.d.ts → SearchTool/SearchBar/type.d.ts} +68 -67
- package/components/SearchTool/SearchBar/type.js +35 -0
- package/components/SearchTool/index.d.ts +5 -0
- package/components/SearchTool/index.js +7 -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 +8 -11
- package/components/Tables/Components/ActionBar.js +74 -41
- 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 -9
- 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/TreeSelect/STreeSelect.js +1 -1
- 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/_FieldType.d.ts +1 -1
- package/components/UForm/_FieldType.js +4 -0
- 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/Col.d.ts +1 -1
- 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.d.ts +1 -1
- package/components/_common/UTitle.js +18 -8
- 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.d.ts +2 -2
- package/components/index.js +5 -1
- package/deps/JsonView.js +17 -7
- package/deps/app-audit/LookUp.js +19 -9
- 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 +253 -162
- 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/index.js +1 -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 +22 -16
- package/utils/CacheUtil.d.ts +1 -1
- package/utils/Const.js +17 -7
- package/utils/Format.d.ts +138 -14
- package/utils/Format.js +132 -23
- package/utils/Global.d.ts +46 -2
- package/utils/Global.js +24 -2
- package/utils/PageUtil.d.ts +111 -23
- package/utils/PageUtil.js +163 -28
- package/utils/Renders/ApiGetRender.js +25 -12
- 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 -12
- package/utils/VAP.d.ts +26 -1
- package/utils/VAP.js +57 -1
- 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/_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 +502 -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/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/utils/py.js +2 -0
- package/components/SearchBar/_FieldType.d.ts +0 -8
- package/components/SearchBar/_FieldType.js +0 -51
- /package/components/{SearchBar → SearchTool/SearchBar}/SearchField.js +0 -0
- /package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.d.ts +0 -0
|
@@ -1,68 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { PropsWithChildren, ExoticComponent } from 'react';
|
|
3
|
-
import type { BaseOption, PlainObject, BaseItem } from '../../basetype';
|
|
4
|
-
import type { _FieldType } from './_FieldType';
|
|
1
|
+
import type { PlainObject, BaseOption, BaseItem } from '../../../basetype';
|
|
5
2
|
/**
|
|
6
|
-
*
|
|
3
|
+
*
|
|
4
|
+
| 类型 | 说明 |
|
|
5
|
+
| --- | --- |
|
|
6
|
+
| text ||
|
|
7
|
+
*
|
|
7
8
|
*/
|
|
8
|
-
export
|
|
9
|
-
/**
|
|
10
|
-
* api通信对应条件的字段
|
|
11
|
-
*/
|
|
12
|
-
field: string;
|
|
13
|
-
/**
|
|
14
|
-
* 字段标签
|
|
15
|
-
*/
|
|
16
|
-
label: string;
|
|
17
|
-
/**
|
|
18
|
-
* 默认为1,最多为3,超过3按3算,小于1 按1算,
|
|
19
|
-
* 可以参考 antd Descriptions / DescriptionItem 里面文档里面的 span 的用法
|
|
20
|
-
* */
|
|
21
|
-
span?: number;
|
|
22
|
-
/**
|
|
23
|
-
* 字段类型,目前支持
|
|
24
|
-
* text 文本输入(默认)
|
|
25
|
-
* number 文本输入(数字)
|
|
26
|
-
* autocomplete 文本输入(自动完成)
|
|
27
|
-
* select 普通选择器
|
|
28
|
-
* multiselect 多项选择器
|
|
29
|
-
* dictselect 字典选择器(必须指定字典ID)
|
|
30
|
-
* treeselect 静态树选择器(暂不支持动态树)
|
|
31
|
-
* inputselect 输入框,但有辅助选项
|
|
32
|
-
* radio 单选框(强㓡使用外置Label)
|
|
33
|
-
* checkbox 复选框(强制使用外围Label)
|
|
34
|
-
* datetime 时间(如 2010-06-25 12:00:00)
|
|
35
|
-
* date 日期 (如 2010-06-25)
|
|
36
|
-
* month 月份 (如 2010-06-01) 返回选择月份的首日
|
|
37
|
-
* timerange 时间区间
|
|
38
|
-
* daterange 日期区间
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* 支持中:
|
|
42
|
-
* radiomore 单选,可自定义更多
|
|
43
|
-
* switch 双状态切换
|
|
44
|
-
* sider 区间划动
|
|
45
|
-
*/
|
|
46
|
-
type?: typeof _FieldType[number] | (string & {});
|
|
47
|
-
/**
|
|
48
|
-
* 输入框里面的提示
|
|
49
|
-
*/
|
|
50
|
-
placeholder?: string;
|
|
51
|
-
/**
|
|
52
|
-
* 是否可以清除 支持 text
|
|
53
|
-
* */
|
|
54
|
-
allowClear?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* select / multiselect / radio / checkbox 时,需要带的选项
|
|
57
|
-
* 使用方法1: 传入一个数组 ,以 {name:string,value:string|number} 的结构传入
|
|
58
|
-
* 使用方法2: 传入一个对象, 以 data: any[] 传入选项数据,再指定 name : stirng, value : string 来指定需要显示在页面的名称和选中后的取值
|
|
59
|
-
*/
|
|
60
|
-
options?: BaseOption[];
|
|
61
|
-
/**
|
|
62
|
-
* 扩展属性,具体使用方法后续说明
|
|
63
|
-
* */
|
|
64
|
-
config?: any;
|
|
65
|
-
};
|
|
9
|
+
export declare const _FieldType: readonly ["text", "number", "select", "multi-select", "radio", "radio-button", "checkbox", "switch", "date", "daterange", "daterange-single", "datetime", "datetimerange", "datetimerange-single", "month", "monthrange", "stree-select", "dtree-select", "ftree-select", "multi-stree-select", "multi-dtree-select", "multi-ftree-select", "autocomplete"];
|
|
66
10
|
/**
|
|
67
11
|
* 当没有指定 keyword时,SearchBar的配置参数
|
|
68
12
|
* 指字 keyword 时,将出以弹出方式展示
|
|
@@ -126,7 +70,64 @@ export type KeyWord = true | {
|
|
|
126
70
|
export type SearchBarProps = SearchBarByFieldProps & {
|
|
127
71
|
keyword?: KeyWord;
|
|
128
72
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
export
|
|
73
|
+
/**
|
|
74
|
+
* 搜索条件字段
|
|
75
|
+
*/
|
|
76
|
+
export type Field = BaseItem & {
|
|
77
|
+
/**
|
|
78
|
+
* api通信对应条件的字段
|
|
79
|
+
*/
|
|
80
|
+
field: string;
|
|
81
|
+
/**
|
|
82
|
+
* 字段标签
|
|
83
|
+
*/
|
|
84
|
+
label: string;
|
|
85
|
+
/**
|
|
86
|
+
* 默认为1,最多为3,超过3按3算,小于1 按1算,
|
|
87
|
+
* 可以参考 antd Descriptions / DescriptionItem 里面文档里面的 span 的用法
|
|
88
|
+
* */
|
|
89
|
+
span?: number;
|
|
90
|
+
/**
|
|
91
|
+
* 字段类型,目前支持
|
|
92
|
+
* text 文本输入(默认)
|
|
93
|
+
* number 文本输入(数字)
|
|
94
|
+
* autocomplete 文本输入(自动完成)
|
|
95
|
+
* select 普通选择器
|
|
96
|
+
* multiselect 多项选择器
|
|
97
|
+
* dictselect 字典选择器(必须指定字典ID)
|
|
98
|
+
* treeselect 静态树选择器(暂不支持动态树)
|
|
99
|
+
* inputselect 输入框,但有辅助选项
|
|
100
|
+
* radio 单选框(强㓡使用外置Label)
|
|
101
|
+
* checkbox 复选框(强制使用外围Label)
|
|
102
|
+
* datetime 时间(如 2010-06-25 12:00:00)
|
|
103
|
+
* date 日期 (如 2010-06-25)
|
|
104
|
+
* month 月份 (如 2010-06-01) 返回选择月份的首日
|
|
105
|
+
* timerange 时间区间
|
|
106
|
+
* daterange 日期区间
|
|
107
|
+
*
|
|
108
|
+
*
|
|
109
|
+
* 支持中:
|
|
110
|
+
* radiomore 单选,可自定义更多
|
|
111
|
+
* switch 双状态切换
|
|
112
|
+
* sider 区间划动
|
|
113
|
+
*/
|
|
114
|
+
type?: typeof _FieldType[number] | (string & {});
|
|
115
|
+
/**
|
|
116
|
+
* 输入框里面的提示
|
|
117
|
+
*/
|
|
118
|
+
placeholder?: string;
|
|
119
|
+
/**
|
|
120
|
+
* 是否可以清除 支持 text
|
|
121
|
+
* */
|
|
122
|
+
allowClear?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* select / multiselect / radio / checkbox 时,需要带的选项
|
|
125
|
+
* 使用方法1: 传入一个数组 ,以 {name:string,value:string|number} 的结构传入
|
|
126
|
+
* 使用方法2: 传入一个对象, 以 data: any[] 传入选项数据,再指定 name : stirng, value : string 来指定需要显示在页面的名称和选中后的取值
|
|
127
|
+
*/
|
|
128
|
+
options?: BaseOption[];
|
|
129
|
+
/**
|
|
130
|
+
* 扩展属性,具体使用方法后续说明
|
|
131
|
+
* */
|
|
132
|
+
config?: any;
|
|
133
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._FieldType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
| 类型 | 说明 |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| text ||
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
exports._FieldType = [
|
|
12
|
+
'text',
|
|
13
|
+
'number',
|
|
14
|
+
'select',
|
|
15
|
+
'multi-select',
|
|
16
|
+
'radio',
|
|
17
|
+
'radio-button',
|
|
18
|
+
'checkbox',
|
|
19
|
+
'switch',
|
|
20
|
+
'date',
|
|
21
|
+
'daterange',
|
|
22
|
+
'daterange-single',
|
|
23
|
+
'datetime',
|
|
24
|
+
'datetimerange',
|
|
25
|
+
'datetimerange-single',
|
|
26
|
+
'month',
|
|
27
|
+
'monthrange',
|
|
28
|
+
'stree-select',
|
|
29
|
+
'dtree-select',
|
|
30
|
+
'ftree-select',
|
|
31
|
+
'multi-stree-select',
|
|
32
|
+
'multi-dtree-select',
|
|
33
|
+
'multi-ftree-select',
|
|
34
|
+
'autocomplete',
|
|
35
|
+
];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchBar = exports.SearchBand = void 0;
|
|
4
|
+
var SearchBand_1 = require("./SearchBand");
|
|
5
|
+
Object.defineProperty(exports, "SearchBand", { enumerable: true, get: function () { return SearchBand_1.SearchBand; } });
|
|
6
|
+
var SearchBar_1 = require("./SearchBar");
|
|
7
|
+
Object.defineProperty(exports, "SearchBar", { enumerable: true, get: function () { return SearchBar_1.SearchBar; } });
|
|
@@ -3,16 +3,14 @@ import type { BaseTableProps } from './index';
|
|
|
3
3
|
import type { ApiModel } from '../../hooks/_list';
|
|
4
4
|
import type { ApiOption } from '../../hooks/useApiBase';
|
|
5
5
|
export type ApiTableProps = BaseTableProps & Pick<ApiOption, 'api' | 'aop' | 'tipDisabled' | 'tipField'>;
|
|
6
|
-
export declare const ApiTable: React.ForwardRefExoticComponent<import("./index").TableDefine & {
|
|
7
|
-
|
|
6
|
+
export declare const ApiTable: React.ForwardRefExoticComponent<import("./index").TableDefine & Pick<import("../..").BoxProps, "default" | "mode" | "selectBar"> & {
|
|
7
|
+
searchBar?: Omit<import("../SearchTool").SearchBarProps, "onChange" | "onSearch">;
|
|
8
|
+
} & {
|
|
8
9
|
columns: import("./index").TableCol[];
|
|
9
|
-
showIndex?:
|
|
10
|
+
showIndex?: false | string;
|
|
10
11
|
rowKey?: string;
|
|
11
12
|
select?: true | "DEFAULT" | "QUERY";
|
|
12
13
|
selectDisabled?: (record: any) => boolean;
|
|
13
|
-
actionBar?:
|
|
14
|
-
selectBar?: import("../Box/SelectBar").SelectBarProps;
|
|
15
|
-
searchBar?: Omit<import("../SearchBar").SearchBarProps, "onChange" | "onSearch">;
|
|
16
|
-
default?: import("../..").PlainObject;
|
|
14
|
+
actionBar?: Array<import("./Components/ActionBar").TableActionButton[]> | React.ReactNode;
|
|
17
15
|
autoLoad?: false;
|
|
18
16
|
} & Pick<ApiOption, "api" | "tipField" | "tipDisabled" | "aop"> & React.RefAttributes<ApiModel>>;
|
|
@@ -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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
47
|
exports.ApiTable = void 0;
|
|
38
48
|
var react_1 = __importStar(require("react"));
|
|
@@ -3,17 +3,15 @@ import type { ModalProps } from '../_adapt/Modal';
|
|
|
3
3
|
import type { ApiTableProps } from './ApiTable';
|
|
4
4
|
import type { ApiModel } from '../../hooks/_list';
|
|
5
5
|
export type ApiTableModalProps = ApiTableProps & ModalProps;
|
|
6
|
-
export declare const ApiTableModal: React.ForwardRefExoticComponent<import(".").TableDefine & {
|
|
7
|
-
|
|
6
|
+
export declare const ApiTableModal: React.ForwardRefExoticComponent<import(".").TableDefine & Pick<import("../..").BoxProps, "default" | "mode" | "selectBar"> & {
|
|
7
|
+
searchBar?: Omit<import("../SearchTool").SearchBarProps, "onChange" | "onSearch">;
|
|
8
|
+
} & {
|
|
8
9
|
columns: import(".").TableCol[];
|
|
9
|
-
showIndex?:
|
|
10
|
+
showIndex?: false | string;
|
|
10
11
|
rowKey?: string;
|
|
11
12
|
select?: true | "DEFAULT" | "QUERY";
|
|
12
13
|
selectDisabled?: (record: any) => boolean;
|
|
13
|
-
actionBar?:
|
|
14
|
-
selectBar?: import("../Box/SelectBar").SelectBarProps;
|
|
15
|
-
searchBar?: Omit<import("../SearchBar").SearchBarProps, "onChange" | "onSearch">;
|
|
16
|
-
default?: import("../..").PlainObject;
|
|
14
|
+
actionBar?: Array<import("./Components/ActionBar").TableActionButton[]> | React.ReactNode;
|
|
17
15
|
autoLoad?: false;
|
|
18
16
|
} & Pick<import("../../hooks/useApiBase").ApiOption, "api" | "tipField" | "tipDisabled" | "aop"> & Omit<import("antd/es/modal").ModalProps, "visible" | "onCancel" | "onOk"> & {
|
|
19
17
|
open?: boolean;
|
|
@@ -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,6 +1,6 @@
|
|
|
1
|
-
import type { FC
|
|
1
|
+
import type { FC } 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 区域点击后的方法,支持三个参数
|
|
@@ -22,16 +22,13 @@ export type TableActionButton = Omit<ActButton, 'onClick' | 'children'> & {
|
|
|
22
22
|
*/
|
|
23
23
|
children?: TableActionButton[];
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
onSelected: () => void;
|
|
25
|
+
type TableActionBarProps = {
|
|
26
|
+
buttons: Array<TableActionButton | null | false>;
|
|
28
27
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
export declare const ActionBar: FC<TableActionBar>;
|
|
28
|
+
/**
|
|
29
|
+
* 说明: 此ActionBar 仅供VTable使用
|
|
30
|
+
* */
|
|
31
|
+
export declare const VTableActionBar: FC<TableActionBarProps>;
|
|
35
32
|
/**
|
|
36
33
|
* 通用添加按钮
|
|
37
34
|
*/
|
|
@@ -26,79 +26,76 @@ 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
|
-
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
47
|
-
}
|
|
48
|
-
finally { if (e) throw e.error; }
|
|
49
|
-
}
|
|
50
|
-
return ar;
|
|
51
|
-
};
|
|
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
|
+
})();
|
|
52
46
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
53
47
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
54
48
|
};
|
|
55
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
-
exports.BUTTON_EXPORT = exports.BUTTON_IMPORT = exports.BUTTON_MORE = exports.BUTTON_DELETE = exports.BUTTON_ADD = exports.
|
|
50
|
+
exports.BUTTON_EXPORT = exports.BUTTON_IMPORT = exports.BUTTON_MORE = exports.BUTTON_DELETE = exports.BUTTON_ADD = exports.VTableActionBar = void 0;
|
|
57
51
|
var react_1 = __importStar(require("react"));
|
|
58
52
|
var lodash_1 = __importDefault(require("lodash"));
|
|
59
|
-
var ActionButtons_1 = require("../../SearchBar/ActionButtons");
|
|
53
|
+
var ActionButtons_1 = require("../../SearchTool/SearchBar/ActionButtons");
|
|
60
54
|
var _i18n_1 = require("../../_i18n");
|
|
61
55
|
var i18n_1 = require("../../../utils/i18n");
|
|
62
|
-
var
|
|
63
|
-
var convertButton = function (item, selectedRowKeys,
|
|
56
|
+
var useTableContext_1 = require("./useTableContext");
|
|
57
|
+
var convertButton = function (item, selectedRowKeys, contextRef) {
|
|
64
58
|
var btn = __assign({}, item);
|
|
65
59
|
if (item.mustSelected)
|
|
66
60
|
btn.disabled = selectedRowKeys.length <= 0;
|
|
67
61
|
if (item.onClick)
|
|
68
|
-
btn.onClick = function () {
|
|
62
|
+
btn.onClick = function () {
|
|
63
|
+
item.onClick(contextRef.current.selectedRowKeys, contextRef.current.selectedObjects, contextRef.current.param);
|
|
64
|
+
};
|
|
69
65
|
return btn;
|
|
70
66
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
/**
|
|
68
|
+
* 说明: 此ActionBar 仅供VTable使用
|
|
69
|
+
* */
|
|
70
|
+
var VTableActionBar = function (props) {
|
|
71
|
+
var _a = (0, useTableContext_1.useTableContext)(), selectedRowKeys = _a.selectedRowKeys, selectedObjects = _a.selectedObjects, param = _a.param;
|
|
72
|
+
var contextRef = (0, react_1.useRef)({ selectedRowKeys: selectedRowKeys, selectedObjects: selectedObjects, param: param });
|
|
73
|
+
(0, react_1.useEffect)(function () {
|
|
74
|
+
contextRef.current = { selectedRowKeys: selectedRowKeys, selectedObjects: selectedObjects, param: param };
|
|
75
|
+
}, [selectedRowKeys, selectedObjects, param]);
|
|
79
76
|
var buttons = (0, react_1.useMemo)(function () {
|
|
80
77
|
var btns = [];
|
|
81
|
-
(props.buttons || []).
|
|
78
|
+
(props.buttons || []).forEach(function (btn) {
|
|
82
79
|
if (btn === false)
|
|
83
80
|
return;
|
|
84
81
|
if (btn === null) {
|
|
85
82
|
btns.push(null);
|
|
86
83
|
return;
|
|
87
84
|
}
|
|
88
|
-
var sub = convertButton(btn, selectedRowKeys,
|
|
85
|
+
var sub = convertButton(btn, selectedRowKeys, contextRef);
|
|
89
86
|
if (lodash_1.default.isArray(btn.children) && btn.children.length > 0) {
|
|
90
87
|
sub.children = [];
|
|
91
88
|
btn.children.map(function (item) {
|
|
92
|
-
sub.children.push(convertButton(item, selectedRowKeys,
|
|
89
|
+
sub.children.push(convertButton(item, selectedRowKeys, contextRef));
|
|
93
90
|
});
|
|
94
91
|
}
|
|
95
92
|
btns.push(sub);
|
|
96
93
|
});
|
|
97
94
|
return btns;
|
|
98
|
-
}, [
|
|
95
|
+
}, [props.buttons, selectedRowKeys]);
|
|
99
96
|
return react_1.default.createElement(ActionButtons_1.ActionButtons, { buttons: buttons });
|
|
100
97
|
};
|
|
101
|
-
exports.
|
|
98
|
+
exports.VTableActionBar = VTableActionBar;
|
|
102
99
|
/**
|
|
103
100
|
* 通用添加按钮
|
|
104
101
|
*/
|
|
@@ -128,3 +125,39 @@ exports.BUTTON_IMPORT = BUTTON_IMPORT;
|
|
|
128
125
|
*/
|
|
129
126
|
var BUTTON_EXPORT = function (onClick, props) { return (__assign(__assign({ label: (0, i18n_1.txt)(_i18n_1.V.BTN_EXPORT), icon: 'export' }, props), { onClick: onClick })); };
|
|
130
127
|
exports.BUTTON_EXPORT = BUTTON_EXPORT;
|
|
128
|
+
// import { useLayoutEffect } from 'react';
|
|
129
|
+
// import { useUpdate } from '../../../hooks'
|
|
130
|
+
// type TableActionBar = {
|
|
131
|
+
// buttons: (TableActionButton | null | false)[],
|
|
132
|
+
// queryParam: PlainObject
|
|
133
|
+
// selectedRef: MutableRefObject<any>
|
|
134
|
+
// }
|
|
135
|
+
// export const ActionBar: FC<TableActionBar> = props => {
|
|
136
|
+
// const update = useUpdate();
|
|
137
|
+
// useLayoutEffect(() => {
|
|
138
|
+
// props.selectedRef.current.onSelected = () => {
|
|
139
|
+
// update();
|
|
140
|
+
// }
|
|
141
|
+
// }, [])
|
|
142
|
+
// const [selectedRowKeys, selectedObjects] = props.selectedRef.current.selected;
|
|
143
|
+
// const buttons = useMemo(() => {
|
|
144
|
+
// const btns = [];
|
|
145
|
+
// (props.buttons || []).map(btn => {
|
|
146
|
+
// if (btn === false) return;
|
|
147
|
+
// if (btn === null) {
|
|
148
|
+
// btns.push(null);
|
|
149
|
+
// return;
|
|
150
|
+
// }
|
|
151
|
+
// let sub = convertButton(btn, selectedRowKeys, selectedObjects, props.queryParam);
|
|
152
|
+
// if (_.isArray(btn.children) && btn.children.length > 0) {
|
|
153
|
+
// sub.children = [];
|
|
154
|
+
// btn.children.map(item => {
|
|
155
|
+
// sub.children.push(convertButton(item, selectedRowKeys, selectedObjects, props.queryParam))
|
|
156
|
+
// })
|
|
157
|
+
// }
|
|
158
|
+
// btns.push(sub);
|
|
159
|
+
// });
|
|
160
|
+
// return btns;
|
|
161
|
+
// }, [selectedRowKeys, props.buttons, props.queryParam])
|
|
162
|
+
// return <ActionButtons buttons={buttons} />
|
|
163
|
+
// }
|
|
@@ -42,6 +42,8 @@ export type CustomAcitonProps = ActionPorps & {
|
|
|
42
42
|
};
|
|
43
43
|
export declare const INFO: FC<ActionPorps>;
|
|
44
44
|
export declare const EDIT: FC<ActionPorps>;
|
|
45
|
-
export declare const DELETE: FC<ActionPorps
|
|
45
|
+
export declare const DELETE: FC<ActionPorps & {
|
|
46
|
+
confirm?: ReactNode;
|
|
47
|
+
}>;
|
|
46
48
|
export declare const ACTION: FC<CustomAcitonProps>;
|
|
47
49
|
export declare const COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => ReactNode)) => TableColumn;
|
|
@@ -10,12 +10,45 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
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
|
+
})();
|
|
13
46
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
47
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
48
|
};
|
|
16
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
50
|
exports.COL_OPERACTION = exports.ACTION = exports.DELETE = exports.EDIT = exports.INFO = void 0;
|
|
18
|
-
var react_1 =
|
|
51
|
+
var react_1 = __importStar(require("react"));
|
|
19
52
|
var lodash_1 = __importDefault(require("lodash"));
|
|
20
53
|
var Popconfirm_1 = require("../../_adapt/Popconfirm");
|
|
21
54
|
var Icon_1 = require("../../_adapt/Icon");
|
|
@@ -48,8 +81,12 @@ var DELETE = function (props) {
|
|
|
48
81
|
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode))
|
|
49
82
|
return utils_1.Const.NONE;
|
|
50
83
|
var title = utils_1.i18n.getText(props.ik, props.title, _i18n_1.V.ACT_DELETE);
|
|
51
|
-
var popTitle =
|
|
52
|
-
|
|
84
|
+
var popTitle = (0, react_1.useMemo)(function () {
|
|
85
|
+
if (props.confirm)
|
|
86
|
+
return props.confirm;
|
|
87
|
+
return react_1.default.createElement("span", null, utils_1.i18n.txt(_i18n_1.V.ACT_DELETE_CONFIRM, props.name || ''));
|
|
88
|
+
}, []);
|
|
89
|
+
return react_1.default.createElement(Popconfirm_1.Popconfirm, { onConfirm: function (e) { return utils_1.PageUtil.stopEvent(e, function () { return props.onClick(); }); }, placement: "right", title: popTitle, overlayClassName: 'c-table-action-confirm' },
|
|
53
90
|
react_1.default.createElement("span", { className: DEFAULT_CLASS.DELETE, title: "".concat(title, " ").concat(props.name || '') },
|
|
54
91
|
react_1.default.createElement(Icon_1.Icon, { type: 'delete' }),
|
|
55
92
|
react_1.default.createElement("span", null, title)));
|
|
@@ -6,7 +6,9 @@ export declare const defineTable: (table: TableDefined) => void;
|
|
|
6
6
|
export type TableDefined = {
|
|
7
7
|
INFO: FC<ActionPorps>;
|
|
8
8
|
EDIT: FC<ActionPorps>;
|
|
9
|
-
DELETE: FC<ActionPorps
|
|
9
|
+
DELETE: FC<ActionPorps & {
|
|
10
|
+
confirm?: ReactNode;
|
|
11
|
+
}>;
|
|
10
12
|
ACTION: FC<CustomAcitonProps>;
|
|
11
13
|
COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => ReactNode)) => TableColumn;
|
|
12
14
|
BUTTON_ADD: (onClick: TableAction, props?: Partial<TableActionButton>) => TableActionButton;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { VTableProps } from '../VTable';
|
|
2
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
3
|
+
export type TableContext = {
|
|
4
|
+
selectedRowKeys: Array<string | number>;
|
|
5
|
+
selectedObjects: Array<any>;
|
|
6
|
+
param: any;
|
|
7
|
+
};
|
|
8
|
+
type TableAction = {
|
|
9
|
+
setParam: (param: any, clean?: boolean) => void;
|
|
10
|
+
setSelection: (selectedRowKeys: string[], selectedObjects: any[]) => void;
|
|
11
|
+
initObjects: (List: Array<any>) => void;
|
|
12
|
+
reflushPage: (List: Array<any>) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const TableContextWrapper: FC<PropsWithChildren<Pick<VTableProps, 'default' | 'defaultSelectedKeys' | 'rowKey'>>>;
|
|
15
|
+
export declare const useTableContext: () => TableContext & TableAction;
|
|
16
|
+
export {};
|