dcp-design-react 1.7.42
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/LICENSE +21 -0
- package/README.md +4 -0
- package/lib/_utils/cloneElement.d.ts +2 -0
- package/lib/_utils/dom.d.ts +75 -0
- package/lib/_utils/download.d.ts +7 -0
- package/lib/_utils/error.d.ts +2 -0
- package/lib/_utils/isDev.d.ts +1 -0
- package/lib/_utils/isMobile.d.ts +1 -0
- package/lib/_utils/isServer.d.ts +2 -0
- package/lib/_utils/prefix.d.ts +1 -0
- package/lib/_utils/resize-event.d.ts +10 -0
- package/lib/_utils/scrollbar-width.d.ts +1 -0
- package/lib/_utils/types.d.ts +39 -0
- package/lib/_utils/util.d.ts +27 -0
- package/lib/_utils/validators.d.ts +2 -0
- package/lib/anchor/index.d.ts +4 -0
- package/lib/anchor/src/anchor-item.d.ts +15 -0
- package/lib/anchor/src/anchor-nav.d.ts +12 -0
- package/lib/anchor/src/anchor.d.ts +61 -0
- package/lib/anchor/style/index.less +101 -0
- package/lib/antd/Calendar.d.ts +4 -0
- package/lib/antd/DatePicker.d.ts +50 -0
- package/lib/antd/TimePicker.d.ts +16 -0
- package/lib/antd/compact.less +11 -0
- package/lib/antd/dayjs.d.ts +1 -0
- package/lib/antd/index.d.ts +124 -0
- package/lib/antd/index.less +19 -0
- package/lib/button/index.d.ts +3 -0
- package/lib/button/src/button.d.ts +32 -0
- package/lib/button/style/index.less +12 -0
- package/lib/collapse/index.d.ts +3 -0
- package/lib/collapse/src/Content.d.ts +3 -0
- package/lib/collapse/src/_util/motion.less +13 -0
- package/lib/collapse/src/_util/motionUtil.d.ts +3 -0
- package/lib/collapse/src/collapse.d.ts +18 -0
- package/lib/collapse/style/index.less +24 -0
- package/lib/config-provider/context.d.ts +10 -0
- package/lib/config-provider/index.d.ts +3 -0
- package/lib/config-provider/src/config-provider.d.ts +36 -0
- package/lib/copy-to-clipboard/index.d.ts +3 -0
- package/lib/copy-to-clipboard/src/copy-to-clipboard.d.ts +15 -0
- package/lib/copy-to-clipboard/style/index.less +12 -0
- package/lib/countup/index.d.ts +3 -0
- package/lib/countup/src/countup.d.ts +17 -0
- package/lib/countup/style/index.less +22 -0
- package/lib/cropper/index.d.ts +3 -0
- package/lib/cropper/src/cropper.d.ts +213 -0
- package/lib/cropper/style/index.less +13 -0
- package/lib/divider/index.d.ts +3 -0
- package/lib/divider/src/divider.d.ts +27 -0
- package/lib/divider/style/index.less +54 -0
- package/lib/download/index.d.ts +3 -0
- package/lib/download/src/download.d.ts +54 -0
- package/lib/download/style/index.less +12 -0
- package/lib/drawer/index.d.ts +3 -0
- package/lib/drawer/src/drawer.d.ts +46 -0
- package/lib/drawer/style/index.less +82 -0
- package/lib/empty/index.d.ts +3 -0
- package/lib/empty/src/empty.d.ts +15 -0
- package/lib/empty/style/index.less +35 -0
- package/lib/form/index.d.ts +4 -0
- package/lib/form/src/context.d.ts +9 -0
- package/lib/form/src/fields-filter.d.ts +26 -0
- package/lib/form/src/form-cascader.d.ts +21 -0
- package/lib/form/src/form-checkbox-group.d.ts +19 -0
- package/lib/form/src/form-checkbox.d.ts +16 -0
- package/lib/form/src/form-city-select.d.ts +10 -0
- package/lib/form/src/form-date.d.ts +10 -0
- package/lib/form/src/form-divider.d.ts +10 -0
- package/lib/form/src/form-immediate.d.ts +20 -0
- package/lib/form/src/form-input-number.d.ts +11 -0
- package/lib/form/src/form-input.d.ts +11 -0
- package/lib/form/src/form-item-view.d.ts +7 -0
- package/lib/form/src/form-multiple-search-helper.d.ts +20 -0
- package/lib/form/src/form-multiple-tree-table-helper.d.ts +20 -0
- package/lib/form/src/form-radio.d.ts +19 -0
- package/lib/form/src/form-range-date.d.ts +10 -0
- package/lib/form/src/form-range-input-number.d.ts +10 -0
- package/lib/form/src/form-range-input.d.ts +10 -0
- package/lib/form/src/form-range-search-helper.d.ts +20 -0
- package/lib/form/src/form-range-time.d.ts +10 -0
- package/lib/form/src/form-rate.d.ts +10 -0
- package/lib/form/src/form-region-select.d.ts +10 -0
- package/lib/form/src/form-search-helper.d.ts +21 -0
- package/lib/form/src/form-select.d.ts +21 -0
- package/lib/form/src/form-switch.d.ts +10 -0
- package/lib/form/src/form-text-area.d.ts +10 -0
- package/lib/form/src/form-time.d.ts +10 -0
- package/lib/form/src/form-tinymce.d.ts +10 -0
- package/lib/form/src/form-tree-select.d.ts +21 -0
- package/lib/form/src/form-tree-table-helper.d.ts +20 -0
- package/lib/form/src/form-upload-file.d.ts +10 -0
- package/lib/form/src/form-upload-img.d.ts +10 -0
- package/lib/form/src/form.d.ts +197 -0
- package/lib/form/src/types.d.ts +356 -0
- package/lib/form/src/utils.d.ts +57 -0
- package/lib/form/style/index.less +352 -0
- package/lib/guide-tracker/index.d.ts +3 -0
- package/lib/guide-tracker/src/Panel.d.ts +9 -0
- package/lib/guide-tracker/src/guideTracker.d.ts +37 -0
- package/lib/guide-tracker/src/lib/Highlighter.d.ts +2 -0
- package/lib/guide-tracker/src/lib/Overlay.d.ts +36 -0
- package/lib/guide-tracker/src/lib/index.d.ts +29 -0
- package/lib/guide-tracker/src/lib/utils.d.ts +27 -0
- package/lib/guide-tracker/style/index.less +189 -0
- package/lib/hoc/outsideClick.d.ts +1 -0
- package/lib/hooks/useDebounce.d.ts +3 -0
- package/lib/hooks/useEvent.d.ts +2 -0
- package/lib/hooks/useForceUpdate.d.ts +1 -0
- package/lib/hooks/useLayoutUpdateEffect.d.ts +2 -0
- package/lib/hooks/useLocale.d.ts +4 -0
- package/lib/hooks/useMergedState.d.ts +8 -0
- package/lib/hooks/useOutsideClick.d.ts +2 -0
- package/lib/hooks/useResizeObserve.d.ts +5 -0
- package/lib/hooks/useSafeState.d.ts +4 -0
- package/lib/hooks/useSize.d.ts +9 -0
- package/lib/hooks/useUpdateEffect.d.ts +2 -0
- package/lib/index.d.ts +127 -0
- package/lib/index.esm.js +1 -0
- package/lib/index.full.js +1 -0
- package/lib/index.js +1 -0
- package/lib/locale/index.d.ts +11 -0
- package/lib/locale/index.js +44 -0
- package/lib/locale/lang/en.d.ts +320 -0
- package/lib/locale/lang/en.js +325 -0
- package/lib/locale/lang/zh-cn.d.ts +320 -0
- package/lib/locale/lang/zh-cn.js +325 -0
- package/lib/modal/index.d.ts +3 -0
- package/lib/modal/src/modal.d.ts +68 -0
- package/lib/modal/style/index.less +95 -0
- package/lib/pinyin/core.d.ts +12 -0
- package/lib/pinyin/dict.d.ts +31 -0
- package/lib/pinyin/index.d.ts +2 -0
- package/lib/pinyin/patchers/56l.d.ts +7 -0
- package/lib/print/index.d.ts +3 -0
- package/lib/print/src/LodopFuncs.d.ts +1 -0
- package/lib/print/src/config.d.ts +6 -0
- package/lib/print/src/container.d.ts +14 -0
- package/lib/print/src/context.d.ts +6 -0
- package/lib/print/src/preview.d.ts +61 -0
- package/lib/print/src/print.d.ts +37 -0
- package/lib/print/src/setting.d.ts +49 -0
- package/lib/print/src/utils.d.ts +5 -0
- package/lib/print/style/index.less +175 -0
- package/lib/qm-design.d.ts +28 -0
- package/lib/range-table-helper/index.d.ts +3 -0
- package/lib/range-table-helper/src/range-table-helper.d.ts +22 -0
- package/lib/range-table-helper/style/index.less +18 -0
- package/lib/scrollbar/index.d.ts +3 -0
- package/lib/scrollbar/src/context.d.ts +7 -0
- package/lib/scrollbar/src/scrollbar.d.ts +28 -0
- package/lib/scrollbar/src/thumb.d.ts +15 -0
- package/lib/scrollbar/style/index.less +72 -0
- package/lib/search-helper/index.d.ts +3 -0
- package/lib/search-helper/src/search-helper.d.ts +24 -0
- package/lib/search-helper/style/index.less +14 -0
- package/lib/search-tree/index.d.ts +3 -0
- package/lib/search-tree/src/search-tree.d.ts +57 -0
- package/lib/search-tree/style/index.less +34 -0
- package/lib/space/index.d.ts +3 -0
- package/lib/space/src/space.d.ts +12 -0
- package/lib/space/style/index.less +12 -0
- package/lib/spin/index.d.ts +3 -0
- package/lib/spin/src/spin.d.ts +14 -0
- package/lib/spin/style/index.less +16 -0
- package/lib/split/index.d.ts +4 -0
- package/lib/split/src/context.d.ts +8 -0
- package/lib/split/src/resize-bar.d.ts +8 -0
- package/lib/split/src/split-pane.d.ts +11 -0
- package/lib/split/src/split.d.ts +18 -0
- package/lib/split/style/index.less +83 -0
- package/lib/style/common.less +8 -0
- package/lib/style/compact.css +26706 -0
- package/lib/style/compact.less +10 -0
- package/lib/style/compact.min.css +1 -0
- package/lib/style/index.css +30459 -0
- package/lib/style/index.less +39 -0
- package/lib/style/index.min.css +1 -0
- package/lib/style/mixins/box.less +13 -0
- package/lib/style/mixins/clearfix.less +21 -0
- package/lib/style/mixins/index.less +11 -0
- package/lib/style/mixins/operation-unit.less +24 -0
- package/lib/style/mixins/reset.less +34 -0
- package/lib/style/mixins/size.less +15 -0
- package/lib/style/reset.less +132 -0
- package/lib/style/themes/compact.less +19 -0
- package/lib/style/themes/default.less +117 -0
- package/lib/style/themes/index.less +7 -0
- package/lib/style/var.less +9 -0
- package/lib/table/index.d.ts +4 -0
- package/lib/table/src/alert/index.d.ts +6 -0
- package/lib/table/src/body/index.d.ts +8 -0
- package/lib/table/src/body/useMergeCell.d.ts +7 -0
- package/lib/table/src/body/useValueFormat.d.ts +12 -0
- package/lib/table/src/clipboard/index.d.ts +8 -0
- package/lib/table/src/clipboard/setting.d.ts +8 -0
- package/lib/table/src/column-filter/index.d.ts +7 -0
- package/lib/table/src/config/index.d.ts +47 -0
- package/lib/table/src/context/index.d.ts +85 -0
- package/lib/table/src/edit/InputNumber.d.ts +26 -0
- package/lib/table/src/edit/index.d.ts +15 -0
- package/lib/table/src/empty/index.d.ts +3 -0
- package/lib/table/src/expandable/all.d.ts +6 -0
- package/lib/table/src/expandable/index.d.ts +9 -0
- package/lib/table/src/export/define.d.ts +8 -0
- package/lib/table/src/export/index.d.ts +19 -0
- package/lib/table/src/export/setting.d.ts +14 -0
- package/lib/table/src/export/useExport.d.ts +13 -0
- package/lib/table/src/fast-search/index.d.ts +7 -0
- package/lib/table/src/fast-search/setting.d.ts +6 -0
- package/lib/table/src/filter/index.d.ts +8 -0
- package/lib/table/src/filter-sql/index.d.ts +5 -0
- package/lib/table/src/filter-sql/lib/filter_string.d.ts +11 -0
- package/lib/table/src/filter-sql/lib/operations.d.ts +8 -0
- package/lib/table/src/filter-sql/lib/variables_replacement.d.ts +5 -0
- package/lib/table/src/footer/index.d.ts +8 -0
- package/lib/table/src/full-screen/index.d.ts +8 -0
- package/lib/table/src/group-summary/index.d.ts +7 -0
- package/lib/table/src/group-summary/result.d.ts +9 -0
- package/lib/table/src/group-summary/setting.d.ts +6 -0
- package/lib/table/src/header/index.d.ts +10 -0
- package/lib/table/src/hooks/useImperativeMethod.d.ts +49 -0
- package/lib/table/src/hooks/useTableCore.d.ts +93 -0
- package/lib/table/src/hooks/useTableEffect.d.ts +45 -0
- package/lib/table/src/hooks/useTableLayout.d.ts +44 -0
- package/lib/table/src/hooks/useTableMemo.d.ts +48 -0
- package/lib/table/src/hooks/useTableRef.d.ts +111 -0
- package/lib/table/src/hooks/useTableState.d.ts +98 -0
- package/lib/table/src/icon/caretdown.d.ts +3 -0
- package/lib/table/src/icon/caretup.d.ts +3 -0
- package/lib/table/src/icon/filter.d.ts +3 -0
- package/lib/table/src/import/SelectFile.d.ts +8 -0
- package/lib/table/src/import/index.d.ts +8 -0
- package/lib/table/src/import/setting.d.ts +8 -0
- package/lib/table/src/manager/index.d.ts +15 -0
- package/lib/table/src/pager/index.d.ts +9 -0
- package/lib/table/src/print/index.d.ts +8 -0
- package/lib/table/src/reload/index.d.ts +7 -0
- package/lib/table/src/resizable/index.d.ts +7 -0
- package/lib/table/src/select-collection/index.d.ts +8 -0
- package/lib/table/src/select-collection/result.d.ts +8 -0
- package/lib/table/src/selection/all.d.ts +7 -0
- package/lib/table/src/selection/index.d.ts +12 -0
- package/lib/table/src/store/index.d.ts +33 -0
- package/lib/table/src/super-search/index.d.ts +7 -0
- package/lib/table/src/super-search/result.d.ts +6 -0
- package/lib/table/src/table/index.d.ts +5 -0
- package/lib/table/src/table/props.d.ts +299 -0
- package/lib/table/src/table/types.d.ts +444 -0
- package/lib/table/src/toolbox/index.d.ts +18 -0
- package/lib/table/src/utils/index.d.ts +43 -0
- package/lib/table/style/alert.less +34 -0
- package/lib/table/style/body.less +77 -0
- package/lib/table/style/clipboard.less +29 -0
- package/lib/table/style/column-filter.less +94 -0
- package/lib/table/style/empty.less +19 -0
- package/lib/table/style/expandable.less +64 -0
- package/lib/table/style/export.less +26 -0
- package/lib/table/style/fast-search.less +110 -0
- package/lib/table/style/footer.less +33 -0
- package/lib/table/style/full-screen.less +21 -0
- package/lib/table/style/group-summary.less +93 -0
- package/lib/table/style/header.less +207 -0
- package/lib/table/style/import.less +25 -0
- package/lib/table/style/index.less +29 -0
- package/lib/table/style/pager.less +29 -0
- package/lib/table/style/print.less +21 -0
- package/lib/table/style/reload.less +21 -0
- package/lib/table/style/select-collection.less +21 -0
- package/lib/table/style/size.less +88 -0
- package/lib/table/style/super-search.less +102 -0
- package/lib/table/style/table.less +372 -0
- package/lib/table/style/tollbox.less +39 -0
- package/lib/table/style/toper.less +31 -0
- package/lib/table/style/variable.less +48 -0
- package/lib/tabs/index.d.ts +4 -0
- package/lib/tabs/src/tab-pane.d.ts +9 -0
- package/lib/tabs/src/tabs.d.ts +19 -0
- package/lib/tabs/style/index.less +32 -0
- package/lib/tinymce/index.d.ts +3 -0
- package/lib/tinymce/src/Events.d.ts +85 -0
- package/lib/tinymce/src/ScriptLoader.d.ts +13 -0
- package/lib/tinymce/src/TinyMCE.d.ts +9 -0
- package/lib/tinymce/src/Utils.d.ts +20 -0
- package/lib/tinymce/src/components/Editor.d.ts +73 -0
- package/lib/tinymce/src/components/EditorPropTypes.d.ts +18 -0
- package/lib/tinymce/src/index.d.ts +35 -0
- package/lib/tinymce/style/index.less +18 -0
- package/lib/tour/index.d.ts +4 -0
- package/lib/tour/src/Mask.d.ts +17 -0
- package/lib/tour/src/Pause.d.ts +10 -0
- package/lib/tour/src/Tour.d.ts +41 -0
- package/lib/tour/src/TourStep/DefaultPanel.d.ts +4 -0
- package/lib/tour/src/TourStep/index.d.ts +34 -0
- package/lib/tour/src/hooks/useTarget.d.ts +14 -0
- package/lib/tour/src/placements.d.ts +29 -0
- package/lib/tour/src/util.d.ts +5 -0
- package/lib/tour/style/index.less +157 -0
- package/lib/transition/index.d.ts +3 -0
- package/lib/transition/src/tools.d.ts +13 -0
- package/lib/transition/src/transition.d.ts +12 -0
- package/lib/transition/src/types.d.ts +25 -0
- package/lib/transition/src/useTransition.d.ts +2 -0
- package/lib/tree-helper/index.d.ts +3 -0
- package/lib/tree-helper/src/tree-helper.d.ts +22 -0
- package/lib/tree-helper/style/index.less +21 -0
- package/lib/tree-table-helper/index.d.ts +3 -0
- package/lib/tree-table-helper/src/tree-table-helper.d.ts +31 -0
- package/lib/tree-table-helper/style/index.less +24 -0
- package/lib/upload-file/index.d.ts +3 -0
- package/lib/upload-file/src/upload-file.d.ts +35 -0
- package/lib/upload-file/style/index.less +18 -0
- package/lib/upload-img/index.d.ts +3 -0
- package/lib/upload-img/src/cropper-preview.d.ts +32 -0
- package/lib/upload-img/src/upload-img.d.ts +39 -0
- package/lib/upload-img/style/index.less +41 -0
- package/lib/version/index.d.ts +2 -0
- package/package.json +138 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import type { IFormItem } from './types';
|
|
3
|
+
type IProps = {
|
|
4
|
+
option: IFormItem;
|
|
5
|
+
};
|
|
6
|
+
type IState = {
|
|
7
|
+
searchHelper: IFormItem['searchHelper'];
|
|
8
|
+
};
|
|
9
|
+
declare class FormTreeTableHelper extends Component<IProps, IState> {
|
|
10
|
+
static contextType: React.Context<import("./context").IFormContext | undefined>;
|
|
11
|
+
private promiseRef;
|
|
12
|
+
state: IState;
|
|
13
|
+
constructor(props: IProps, { $$form }: {
|
|
14
|
+
$$form: any;
|
|
15
|
+
});
|
|
16
|
+
waiting: () => Promise<void>;
|
|
17
|
+
getHelperConfig: ($configContext: any) => void;
|
|
18
|
+
render(): React.JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export default FormTreeTableHelper;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import type { IFormItem } from './types';
|
|
3
|
+
type IProps = {
|
|
4
|
+
option: IFormItem;
|
|
5
|
+
};
|
|
6
|
+
declare class FormUploadFile extends Component<IProps> {
|
|
7
|
+
static contextType: React.Context<import("./context").IFormContext | undefined>;
|
|
8
|
+
render(): React.JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export default FormUploadFile;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import type { IFormItem } from './types';
|
|
3
|
+
type IProps = {
|
|
4
|
+
option: IFormItem;
|
|
5
|
+
};
|
|
6
|
+
declare class FormUploadImg extends Component<IProps> {
|
|
7
|
+
static contextType: React.Context<import("./context").IFormContext | undefined>;
|
|
8
|
+
render(): React.JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export default FormUploadImg;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import { IFieldData } from './types';
|
|
4
|
+
import type { IFormProps, IFormData, IFormItem, IExtraData, IViewData, IExpandData, IFieldAuthItem } from './types';
|
|
5
|
+
import type { JSXElement, ValueOf, IDict } from '../../_utils/types';
|
|
6
|
+
import type { FormProps as AntFormProps } from '../../antd';
|
|
7
|
+
type IProps = AntFormProps & IFormProps;
|
|
8
|
+
type IState = {
|
|
9
|
+
formData: IFormData;
|
|
10
|
+
viewData: IViewData;
|
|
11
|
+
other: IFormData;
|
|
12
|
+
extra: IExtraData;
|
|
13
|
+
expand: IExpandData;
|
|
14
|
+
flexCols: number;
|
|
15
|
+
collapse: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type FormProps = IProps;
|
|
18
|
+
export type FormRef = QmForm;
|
|
19
|
+
declare class QmForm extends Component<IProps, IState> {
|
|
20
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
21
|
+
static propTypes: {
|
|
22
|
+
items: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
23
|
+
type: import("prop-types").Validator<string>;
|
|
24
|
+
fieldName: import("prop-types").Validator<string>;
|
|
25
|
+
}> | null | undefined)[]>;
|
|
26
|
+
initialValues: import("prop-types").Requireable<object>;
|
|
27
|
+
initialExtras: import("prop-types").Requireable<object>;
|
|
28
|
+
layout: import("prop-types").Requireable<string>;
|
|
29
|
+
size: (props: any, propName: any, componentName: any) => void;
|
|
30
|
+
cols: import("prop-types").Requireable<number>;
|
|
31
|
+
customClass: import("prop-types").Requireable<string>;
|
|
32
|
+
compactMode: import("prop-types").Requireable<boolean>;
|
|
33
|
+
labelWidth: import("prop-types").Requireable<NonNullable<string | number | null | undefined>>;
|
|
34
|
+
labelAlign: import("prop-types").Requireable<string>;
|
|
35
|
+
labelWrap: import("prop-types").Requireable<boolean>;
|
|
36
|
+
formType: import("prop-types").Requireable<string>;
|
|
37
|
+
disabled: import("prop-types").Requireable<boolean>;
|
|
38
|
+
uniqueKey: import("prop-types").Requireable<string>;
|
|
39
|
+
defaultRows: import("prop-types").Requireable<number>;
|
|
40
|
+
defaultExpand: import("prop-types").Requireable<boolean>;
|
|
41
|
+
searchButtonCols: import("prop-types").Requireable<number>;
|
|
42
|
+
scrollToFirstError: import("prop-types").Requireable<boolean>;
|
|
43
|
+
authConfig: import("prop-types").Requireable<object>;
|
|
44
|
+
isAutoFocus: import("prop-types").Requireable<boolean>;
|
|
45
|
+
isCollapse: import("prop-types").Requireable<boolean>;
|
|
46
|
+
isFieldsDefine: import("prop-types").Requireable<boolean>;
|
|
47
|
+
isSearchBtn: import("prop-types").Requireable<boolean>;
|
|
48
|
+
isSubmitBtn: import("prop-types").Requireable<boolean>;
|
|
49
|
+
fieldsChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
50
|
+
onValuesChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
51
|
+
onFieldsChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
52
|
+
onFinish: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
53
|
+
onFinishFailed: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
54
|
+
onReset: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
55
|
+
onCollapse: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
56
|
+
};
|
|
57
|
+
static defaultProps: {
|
|
58
|
+
layout: string;
|
|
59
|
+
labelWidth: number;
|
|
60
|
+
labelAlign: string;
|
|
61
|
+
formType: string;
|
|
62
|
+
initialValues: {};
|
|
63
|
+
initialExtras: {};
|
|
64
|
+
defaultRows: number;
|
|
65
|
+
isAutoFocus: boolean;
|
|
66
|
+
isCollapse: boolean;
|
|
67
|
+
isSearchBtn: boolean;
|
|
68
|
+
onValuesChange: () => void;
|
|
69
|
+
onFieldsChange: () => void;
|
|
70
|
+
onFinish: () => void;
|
|
71
|
+
onFinishFailed: () => void;
|
|
72
|
+
onReset: () => void;
|
|
73
|
+
onCollapse: () => void;
|
|
74
|
+
onFormItemsChange: () => void;
|
|
75
|
+
};
|
|
76
|
+
private provide;
|
|
77
|
+
private _initialValues;
|
|
78
|
+
private _initialOthers;
|
|
79
|
+
private _initialExtras;
|
|
80
|
+
private _fieldAuth;
|
|
81
|
+
private wrapperRef;
|
|
82
|
+
private formRef;
|
|
83
|
+
state: IState;
|
|
84
|
+
constructor(props: IProps);
|
|
85
|
+
get $size(): any;
|
|
86
|
+
get verticalLayout(): boolean;
|
|
87
|
+
get formItems(): IFormItem[];
|
|
88
|
+
get flattenItems(): IFormItem[];
|
|
89
|
+
get dividers(): IFormItem[];
|
|
90
|
+
get isFilterType(): boolean;
|
|
91
|
+
get isOnlyShow(): boolean;
|
|
92
|
+
get isCompactMode(): boolean;
|
|
93
|
+
get showDividerCollapse(): boolean;
|
|
94
|
+
get showFilterCollapse(): boolean | undefined;
|
|
95
|
+
componentDidMount(): void;
|
|
96
|
+
componentDidUpdate(prevProps: IProps, prevState: IState): void;
|
|
97
|
+
componentWillUnmount(): void;
|
|
98
|
+
resizeObserveHandler: () => void;
|
|
99
|
+
resizeListenerHandle: import("lodash").DebouncedFunc<() => void>;
|
|
100
|
+
bindResizeEvent(): void;
|
|
101
|
+
removeResizeEvent(): void;
|
|
102
|
+
initialHandle(): void;
|
|
103
|
+
checkFieldNames(): void;
|
|
104
|
+
getFormItemRequired(rules?: Record<string, any>[]): boolean;
|
|
105
|
+
createOtherValue(values: IFormData): IFormData;
|
|
106
|
+
createExtraValue(values: IExtraData): IExtraData;
|
|
107
|
+
createDividerExpand(): IExpandData;
|
|
108
|
+
getInitialValue(item: IFormItem, val?: ValueOf<IFormData>): string | number | any[] | undefined;
|
|
109
|
+
createFormValue(values: IFormData): IFormData;
|
|
110
|
+
createInitialValues(): void;
|
|
111
|
+
createInitialOthers(): void;
|
|
112
|
+
createInitialExtras(): void;
|
|
113
|
+
getFormItems: import("memoize-one").MemoizedFn<(items: IFormItem[]) => IFormItem[]>;
|
|
114
|
+
getFlattenItems: import("memoize-one").MemoizedFn<(items: IFormItem[]) => IFormItem[]>;
|
|
115
|
+
setViewValue(fieldName: string, val?: string): void;
|
|
116
|
+
getViewValue(fieldName: string): string;
|
|
117
|
+
setExpandHandle(collapse: boolean): void;
|
|
118
|
+
createInputFocus(): void;
|
|
119
|
+
getFormItemLabel(label: string | IFormItem): string;
|
|
120
|
+
getBlockDerivedItems(): Pick<IFormItem, "label" | "fieldName">[][];
|
|
121
|
+
getFormItemDisplay({ type, fieldName }: {
|
|
122
|
+
type: any;
|
|
123
|
+
fieldName: any;
|
|
124
|
+
}): boolean;
|
|
125
|
+
formatFormValue(values: IFormData): IFormData;
|
|
126
|
+
setFieldAuth(key: string, value: IFieldAuthItem): void;
|
|
127
|
+
createFormAuth(): Promise<void>;
|
|
128
|
+
INPUT(option: IFormItem): JSXElement;
|
|
129
|
+
RANGE_INPUT(option: IFormItem): JSXElement;
|
|
130
|
+
INPUT_NUMBER(option: IFormItem): JSXElement;
|
|
131
|
+
RANGE_INPUT_NUMBER(option: IFormItem): JSXElement;
|
|
132
|
+
SEARCH_HELPER(option: IFormItem): JSXElement;
|
|
133
|
+
MULTIPLE_SEARCH_HELPER(option: IFormItem): JSXElement;
|
|
134
|
+
TREE_TABLE_HELPER(option: IFormItem): JSXElement;
|
|
135
|
+
MULTIPLE_TREE_TABLE_HELPER(option: IFormItem): JSXElement;
|
|
136
|
+
RANGE_SEARCH_HELPER(option: IFormItem): JSXElement;
|
|
137
|
+
CHECKBOX(option: IFormItem): JSXElement;
|
|
138
|
+
MULTIPLE_CHECKBOX(option: IFormItem): JSXElement;
|
|
139
|
+
RATE(option: IFormItem): JSXElement;
|
|
140
|
+
RADIO(option: IFormItem): JSXElement;
|
|
141
|
+
SWITCH(option: IFormItem): JSXElement;
|
|
142
|
+
TEXT_AREA(option: IFormItem): JSXElement;
|
|
143
|
+
DATE(option: IFormItem): JSXElement;
|
|
144
|
+
RANGE_DATE(option: IFormItem): JSXElement;
|
|
145
|
+
TIME(option: IFormItem): JSXElement;
|
|
146
|
+
RANGE_TIME(option: IFormItem): JSXElement;
|
|
147
|
+
SELECT(option: IFormItem): JSXElement;
|
|
148
|
+
MULTIPLE_SELECT(option: IFormItem): JSXElement;
|
|
149
|
+
IMMEDIATE(option: IFormItem): JSXElement;
|
|
150
|
+
DIVIDER(option: IFormItem): JSXElement;
|
|
151
|
+
TREE_SELECT(option: IFormItem): JSXElement;
|
|
152
|
+
MULTIPLE_TREE_SELECT(option: IFormItem): JSXElement;
|
|
153
|
+
CASCADER(option: IFormItem): JSXElement;
|
|
154
|
+
MULTIPLE_CASCADER(option: IFormItem): JSXElement;
|
|
155
|
+
CITY_SELECT(option: IFormItem): JSXElement;
|
|
156
|
+
REGION_SELECT(option: IFormItem): JSXElement;
|
|
157
|
+
UPLOAD_FILE(option: IFormItem): JSXElement;
|
|
158
|
+
UPLOAD_IMG(option: IFormItem): JSXElement;
|
|
159
|
+
TINYMCE(option: IFormItem): JSXElement;
|
|
160
|
+
renderFormLabel(label: IFormItem | string): string | React.JSX.Element | null;
|
|
161
|
+
renderFormItemExtra(option: IFormItem['extra'] & {
|
|
162
|
+
fieldName: string;
|
|
163
|
+
}): React.JSX.Element;
|
|
164
|
+
renderFormItemButton(fieldName: string, buttonAfter: IFormItem['buttonAfter']): JSXElement;
|
|
165
|
+
renderFormItem(option: IFormItem): React.JSX.Element | null;
|
|
166
|
+
createFormItem(item: IFormItem): JSXElement;
|
|
167
|
+
createFormLayout(): (React.JSX.Element | null)[];
|
|
168
|
+
createSearchButtonLayout(lastCols?: number): React.JSX.Element | null;
|
|
169
|
+
createFormButtonLayout(): React.JSX.Element | null;
|
|
170
|
+
createFieldsDefine(): React.JSX.Element;
|
|
171
|
+
valuesChangeHandle: (changedValues: IFormData, allValues: IFormData) => void;
|
|
172
|
+
fieldsChangeHandle: (changedFields: IFieldData[], allFields: IFieldData[]) => void;
|
|
173
|
+
finishHandle: (values: IFormData) => void;
|
|
174
|
+
finishFailedHandle: ({ values, errorFields }: {
|
|
175
|
+
values: any;
|
|
176
|
+
errorFields: any;
|
|
177
|
+
}) => void;
|
|
178
|
+
set_fields_other(values: IFormData): void;
|
|
179
|
+
get_fields_other(fields?: string[]): IFormData;
|
|
180
|
+
openValidateInfo: (errorFields: any) => void;
|
|
181
|
+
scrollToField: (fieldName?: string) => void;
|
|
182
|
+
formValidate(): Promise<IFormData>;
|
|
183
|
+
SET_FIELDS_VALUE(values: IFormData): void;
|
|
184
|
+
GET_FIELDS_VALUE(fields?: string[]): IFormData;
|
|
185
|
+
GET_FORM_DATA(): Promise<[any, any]>;
|
|
186
|
+
VALIDATE_FIELDS(fields?: string[]): Promise<any[]>;
|
|
187
|
+
SET_FIELDS_EXTRA(values: IExtraData): void;
|
|
188
|
+
SET_FIELDS_ECHO(values: Record<string, IDict[]>): void;
|
|
189
|
+
GET_FIELDS_EXTRA(fields?: string[]): IExtraData;
|
|
190
|
+
GET_FIELDS_TOUCHED(fields?: string[]): boolean;
|
|
191
|
+
SUBMIT_FORM(): Promise<void>;
|
|
192
|
+
RESET_FORM(): void;
|
|
193
|
+
CREATE_FOCUS(fieldName: string): void;
|
|
194
|
+
SET_FORM_ITEM(fieldName: string, option: Record<string, any>, forceUpdate?: boolean): void;
|
|
195
|
+
render(): React.JSX.Element;
|
|
196
|
+
}
|
|
197
|
+
export default QmForm;
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import type { Dayjs } from 'dayjs';
|
|
4
|
+
import type { UploadProps } from '../../antd';
|
|
5
|
+
import type { BuildInPlacements } from 'rc-trigger';
|
|
6
|
+
import type { IFetch, IColumn, IRowKey } from '../../table/src/table/types';
|
|
7
|
+
import type { UploadFile } from '../../upload-file/src/upload-file';
|
|
8
|
+
import type { CSSProperties, ComponentSize, JSXElement, ValueOf, AjaxResponse, IDict, IAuth } from '../../_utils/types';
|
|
9
|
+
export declare const DEFAULT_COL = 4;
|
|
10
|
+
export declare const DEFAULT_ROWS = 1;
|
|
11
|
+
export declare const DEFAULT_LABEL_WIDTH = 80;
|
|
12
|
+
export declare const DEFAULT_COL_WIDTH = 300;
|
|
13
|
+
export declare const DEFAULT_TRUE_VALUE = "1";
|
|
14
|
+
export declare const DEFAULT_FALSE_VALUE = "0";
|
|
15
|
+
export declare const DEFAULT_LIST_HEIGHT = 400;
|
|
16
|
+
export type IRecord = Record<string, any>;
|
|
17
|
+
export type IFormLayout = 'horizontal' | 'vertical';
|
|
18
|
+
export type ILabelAlign = 'left' | 'right';
|
|
19
|
+
export type IFormType = 'default' | 'search' | 'onlyShow';
|
|
20
|
+
export type IValidateTrigger = 'onChange' | 'onBlur';
|
|
21
|
+
export type ICheckStrategy = 'SHOW_ALL' | 'SHOW_PARENT' | 'SHOW_CHILD';
|
|
22
|
+
export type IFormItemType = 'DIVIDER' | 'INPUT' | 'TEXT_AREA' | 'RANGE_INPUT' | 'INPUT_NUMBER' | 'RANGE_INPUT_NUMBER' | 'CHECKBOX' | 'MULTIPLE_CHECKBOX' | 'RADIO' | 'SWITCH' | 'RATE' | 'DATE' | 'RANGE_DATE' | 'TIME' | 'RANGE_TIME' | 'SELECT' | 'MULTIPLE_SELECT' | 'IMMEDIATE' | 'SEARCH_HELPER' | 'MULTIPLE_SEARCH_HELPER' | 'TREE_TABLE_HELPER' | 'MULTIPLE_TREE_TABLE_HELPER' | 'RANGE_SEARCH_HELPER' | 'TREE_SELECT' | 'MULTIPLE_TREE_SELECT' | 'CASCADER' | 'MULTIPLE_CASCADER' | 'CITY_SELECT' | 'REGION_SELECT' | 'UPLOAD_FILE' | 'UPLOAD_IMG' | 'TINYMCE';
|
|
23
|
+
export declare const ARRAY_TYPE: IFormItemType[];
|
|
24
|
+
export declare const BUILT_IN_PLACEMENTS: BuildInPlacements;
|
|
25
|
+
export type IFieldsDefine = {
|
|
26
|
+
valueKey: string;
|
|
27
|
+
displayKey?: string;
|
|
28
|
+
extraKey?: string;
|
|
29
|
+
};
|
|
30
|
+
export type IFieldAuthItem = {
|
|
31
|
+
visible: number;
|
|
32
|
+
disabled?: number;
|
|
33
|
+
secretName?: string;
|
|
34
|
+
};
|
|
35
|
+
export type IDateType = 'date' | 'datetime' | 'exactdate' | 'week' | 'month' | 'quarter' | 'year';
|
|
36
|
+
export declare enum EDateType {
|
|
37
|
+
'date' = "date",
|
|
38
|
+
'datetime' = "date",
|
|
39
|
+
'exactdate' = "date",
|
|
40
|
+
'week' = "week",
|
|
41
|
+
'month' = "month",
|
|
42
|
+
'quarter' = "quarter",
|
|
43
|
+
'year' = "year"
|
|
44
|
+
}
|
|
45
|
+
export declare enum EDateFormat {
|
|
46
|
+
'date' = "YYYY-MM-DD HH:mm:ss",
|
|
47
|
+
'datetime' = "YYYY-MM-DD HH:mm:ss",
|
|
48
|
+
'exactdate' = "YYYY-MM-DD",
|
|
49
|
+
'week' = "YYYY-wo",
|
|
50
|
+
'month' = "YYYY-MM",
|
|
51
|
+
'quarter' = "YYYY-[Q]Q",
|
|
52
|
+
'year' = "YYYY"
|
|
53
|
+
}
|
|
54
|
+
export type ITimeType = 'hour' | 'hour-minute' | 'hour-minute-second';
|
|
55
|
+
export declare enum ETimeFormat {
|
|
56
|
+
'hour' = "HH",
|
|
57
|
+
'hour-minute' = "HH:mm",
|
|
58
|
+
'hour-minute-second' = "HH:mm:ss"
|
|
59
|
+
}
|
|
60
|
+
export type IFormData = Record<string, string | number | any[] | undefined>;
|
|
61
|
+
export type IFetchHeader = Record<string, string>;
|
|
62
|
+
export type IFetchParams = Record<string, any>;
|
|
63
|
+
export type IFieldData = {
|
|
64
|
+
name: string[];
|
|
65
|
+
errors?: string[];
|
|
66
|
+
touched?: boolean;
|
|
67
|
+
validating?: boolean;
|
|
68
|
+
value?: ValueOf<IFormData>;
|
|
69
|
+
};
|
|
70
|
+
export type IExtraData = Record<string, string | number>;
|
|
71
|
+
export type IViewData = Record<string, string>;
|
|
72
|
+
export type IExpandData = Record<string, boolean>;
|
|
73
|
+
export type IFetchFn = (params?: Record<string, unknown>) => Promise<AjaxResponse>;
|
|
74
|
+
export type IFetchFnMaker = (url: string, type?: 'post' | 'get') => IFetchFn;
|
|
75
|
+
export type IRequest = {
|
|
76
|
+
fetchApi?: IFetchFn;
|
|
77
|
+
params?: IFetchParams;
|
|
78
|
+
formatter?: (params: IFetchParams) => IFetchParams;
|
|
79
|
+
dataKey?: string;
|
|
80
|
+
callback?: (itemList: IRecord[]) => void;
|
|
81
|
+
};
|
|
82
|
+
export type IAuthConfig = {
|
|
83
|
+
fetch?: {
|
|
84
|
+
api: IFetchFn;
|
|
85
|
+
params?: IFetchParams;
|
|
86
|
+
dataKey?: string;
|
|
87
|
+
};
|
|
88
|
+
fieldList?: IAuth[];
|
|
89
|
+
};
|
|
90
|
+
export type IFormItem = {
|
|
91
|
+
type: IFormItemType;
|
|
92
|
+
fieldName: string;
|
|
93
|
+
label?: string | IFormItem;
|
|
94
|
+
tooltip?: string;
|
|
95
|
+
labelWidth?: number | string;
|
|
96
|
+
hidden?: boolean;
|
|
97
|
+
noAuth?: boolean;
|
|
98
|
+
noReset?: boolean;
|
|
99
|
+
invisible?: boolean;
|
|
100
|
+
rules?: Record<string, any>[];
|
|
101
|
+
validateTrigger?: IValidateTrigger | IValidateTrigger[];
|
|
102
|
+
selfCol?: number;
|
|
103
|
+
offsetLeft?: number;
|
|
104
|
+
offsetRight?: number;
|
|
105
|
+
style?: CSSProperties;
|
|
106
|
+
className?: string;
|
|
107
|
+
placeholder?: string;
|
|
108
|
+
bordered?: boolean;
|
|
109
|
+
disabled?: boolean;
|
|
110
|
+
allowClear?: boolean;
|
|
111
|
+
readOnly?: boolean;
|
|
112
|
+
options?: {
|
|
113
|
+
itemList?: IDict[];
|
|
114
|
+
prefix?: React.ReactNode;
|
|
115
|
+
suffix?: React.ReactNode;
|
|
116
|
+
autoFocus?: boolean;
|
|
117
|
+
maxLength?: number;
|
|
118
|
+
password?: boolean;
|
|
119
|
+
toUpper?: boolean;
|
|
120
|
+
toTrim?: boolean;
|
|
121
|
+
pattern?: RegExp;
|
|
122
|
+
secretType?: string;
|
|
123
|
+
autoComplete?: string;
|
|
124
|
+
step?: number;
|
|
125
|
+
min?: number;
|
|
126
|
+
max?: number;
|
|
127
|
+
textAlign?: ILabelAlign | 'center';
|
|
128
|
+
controls?: boolean;
|
|
129
|
+
precision?: number;
|
|
130
|
+
stringMode?: boolean;
|
|
131
|
+
formatter?: (value: number | string) => string;
|
|
132
|
+
parser?: (value: string) => string | number;
|
|
133
|
+
falseValue?: string | number;
|
|
134
|
+
trueValue?: string | number;
|
|
135
|
+
labelToCheckbox?: boolean;
|
|
136
|
+
showCount?: boolean;
|
|
137
|
+
autoSize?: {
|
|
138
|
+
minRows?: number;
|
|
139
|
+
maxRows?: number;
|
|
140
|
+
};
|
|
141
|
+
dateType?: IDateType;
|
|
142
|
+
minDateTime?: string;
|
|
143
|
+
maxDateTime?: string;
|
|
144
|
+
disableds?: [boolean, boolean];
|
|
145
|
+
shortCuts?: boolean;
|
|
146
|
+
format?: string;
|
|
147
|
+
disabledDate?: (current: Dayjs) => boolean;
|
|
148
|
+
timeType?: ITimeType;
|
|
149
|
+
hourStep?: number;
|
|
150
|
+
minuteStep?: number;
|
|
151
|
+
secondStep?: number;
|
|
152
|
+
startTime?: string;
|
|
153
|
+
endTime?: string;
|
|
154
|
+
timeStep?: string;
|
|
155
|
+
allowHalf?: boolean;
|
|
156
|
+
tooltips?: string[];
|
|
157
|
+
count?: number;
|
|
158
|
+
labelToSwitch?: boolean;
|
|
159
|
+
filterable?: boolean;
|
|
160
|
+
listHeight?: number;
|
|
161
|
+
collapseTags?: boolean;
|
|
162
|
+
maxTagTextLength?: number;
|
|
163
|
+
openPyt?: boolean;
|
|
164
|
+
checkStrategy?: ICheckStrategy;
|
|
165
|
+
checkStrictly?: boolean;
|
|
166
|
+
changeOnSelect?: boolean;
|
|
167
|
+
hideHeader?: boolean;
|
|
168
|
+
onlySelect?: boolean;
|
|
169
|
+
columns?: IColumn[];
|
|
170
|
+
fieldsDefine?: IFieldsDefine;
|
|
171
|
+
echoRequest?: IRequest & {
|
|
172
|
+
fieldAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
173
|
+
extraAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
174
|
+
};
|
|
175
|
+
fieldAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
176
|
+
extraAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
177
|
+
multiple?: boolean;
|
|
178
|
+
maxCount?: number;
|
|
179
|
+
fileTypes?: string[];
|
|
180
|
+
fileSize?: number;
|
|
181
|
+
showTip?: boolean;
|
|
182
|
+
openCropper?: boolean;
|
|
183
|
+
onPreview?: (file: UploadFile, cb: (file?: UploadFile) => void) => void;
|
|
184
|
+
onRemove?: (file: UploadFile) => void;
|
|
185
|
+
fixedSize?: [number, number] | undefined;
|
|
186
|
+
quality?: number;
|
|
187
|
+
tinymce?: Record<string, any>;
|
|
188
|
+
thresholdSize?: number;
|
|
189
|
+
};
|
|
190
|
+
searchHelper?: {
|
|
191
|
+
name?: string;
|
|
192
|
+
getServerConfig?: IFetchFn;
|
|
193
|
+
createFetchApi?: (url: string, type?: string) => IFetchFn;
|
|
194
|
+
fieldsDefine?: IFieldsDefine;
|
|
195
|
+
filters?: IFormItem[];
|
|
196
|
+
table?: {
|
|
197
|
+
fetch?: IFetch;
|
|
198
|
+
columns?: IColumn[];
|
|
199
|
+
rowKey?: ((row: IRecord, index: number) => IRowKey) | IRowKey;
|
|
200
|
+
webPagination?: boolean;
|
|
201
|
+
};
|
|
202
|
+
tree?: {
|
|
203
|
+
fetch?: IFetch & {
|
|
204
|
+
valueKey?: string;
|
|
205
|
+
textKey?: string;
|
|
206
|
+
};
|
|
207
|
+
tableParamsMap?: (() => Record<string, string>) | Record<string, string>;
|
|
208
|
+
};
|
|
209
|
+
request?: IRequest;
|
|
210
|
+
echoRequest?: IRequest & {
|
|
211
|
+
fieldAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
212
|
+
extraAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
213
|
+
};
|
|
214
|
+
hideHeader?: boolean;
|
|
215
|
+
columns?: IColumn[];
|
|
216
|
+
width?: number | string;
|
|
217
|
+
initialValue?: IFormData;
|
|
218
|
+
onlySelect?: boolean;
|
|
219
|
+
autoQueryAssign?: boolean;
|
|
220
|
+
closeRemoteMatch?: boolean;
|
|
221
|
+
fieldAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
222
|
+
extraAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
223
|
+
filterAliasMap?: (() => string[]) | string[];
|
|
224
|
+
beforeOpen?: (formData: IFormData) => void | Promise<void> | boolean;
|
|
225
|
+
closed?: (rowData: Record<string, any>) => void;
|
|
226
|
+
};
|
|
227
|
+
request?: IRequest & {
|
|
228
|
+
valueKey?: string;
|
|
229
|
+
textKey?: string;
|
|
230
|
+
};
|
|
231
|
+
asyncLoad?: IRequest & {
|
|
232
|
+
valueKey?: string;
|
|
233
|
+
textKey?: string;
|
|
234
|
+
};
|
|
235
|
+
upload?: {
|
|
236
|
+
action?: string;
|
|
237
|
+
headers?: IFetchHeader;
|
|
238
|
+
withCredentials?: boolean;
|
|
239
|
+
params?: IFetchParams;
|
|
240
|
+
dataKey?: string;
|
|
241
|
+
beforeUpload?: UploadProps['beforeUpload'];
|
|
242
|
+
button?: {
|
|
243
|
+
text?: string;
|
|
244
|
+
icon?: React.ReactNode;
|
|
245
|
+
};
|
|
246
|
+
fieldAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
247
|
+
};
|
|
248
|
+
extra?: {
|
|
249
|
+
style?: CSSProperties;
|
|
250
|
+
labelWidth?: number | string;
|
|
251
|
+
isTooltip?: boolean;
|
|
252
|
+
render?: (options: IFormItem, instance: any) => JSXElement;
|
|
253
|
+
};
|
|
254
|
+
buttonAfter?: JSXElement | ((options: IFormItem) => JSXElement);
|
|
255
|
+
collapse?: {
|
|
256
|
+
defaultExpand?: boolean;
|
|
257
|
+
showLimit?: number;
|
|
258
|
+
remarkItems?: Array<{
|
|
259
|
+
fieldName: string;
|
|
260
|
+
showLabel?: boolean;
|
|
261
|
+
}>;
|
|
262
|
+
onCollapse?: (collapse: boolean) => void;
|
|
263
|
+
};
|
|
264
|
+
render?: (options: IFormItem, instance: any) => JSXElement;
|
|
265
|
+
onChange?: (value: ValueOf<IFormData> | boolean, ...rest: any[]) => void;
|
|
266
|
+
onBlur?: (value: ValueOf<IFormData>) => void;
|
|
267
|
+
onEnter?: (value: ValueOf<IFormData>) => void;
|
|
268
|
+
};
|
|
269
|
+
export type IFormProps = {
|
|
270
|
+
items: IFormItem[];
|
|
271
|
+
initialValues?: IFormData;
|
|
272
|
+
initialExtras?: IExtraData;
|
|
273
|
+
layout?: IFormLayout;
|
|
274
|
+
size?: ComponentSize;
|
|
275
|
+
cols?: number;
|
|
276
|
+
customClass?: string;
|
|
277
|
+
compactMode?: boolean;
|
|
278
|
+
labelWidth?: number | string;
|
|
279
|
+
labelAlign?: ILabelAlign;
|
|
280
|
+
labelWrap?: boolean;
|
|
281
|
+
formType?: IFormType;
|
|
282
|
+
disabled?: boolean;
|
|
283
|
+
uniqueKey?: string;
|
|
284
|
+
defaultRows?: number;
|
|
285
|
+
defaultExpand?: boolean;
|
|
286
|
+
searchButtonCols?: number;
|
|
287
|
+
scrollToFirstError?: boolean;
|
|
288
|
+
authConfig?: IAuthConfig;
|
|
289
|
+
isAutoFocus?: boolean;
|
|
290
|
+
isCollapse?: boolean;
|
|
291
|
+
isFieldsDefine?: boolean;
|
|
292
|
+
isSearchBtn?: boolean;
|
|
293
|
+
isSubmitBtn?: boolean;
|
|
294
|
+
fieldsChange?: (items: IFormItem[]) => void;
|
|
295
|
+
onValuesChange?: (changedValues: IFormData, initialValues: IFormData) => void;
|
|
296
|
+
onFieldsChange?: (changedFields: IFieldData[], allFields: IFieldData[]) => void;
|
|
297
|
+
onFinish?: (values: IFormData) => void;
|
|
298
|
+
onFinishFailed?: (errorFields: any[]) => void;
|
|
299
|
+
onReset?: () => void;
|
|
300
|
+
onCollapse?: (collapse: boolean) => void;
|
|
301
|
+
};
|
|
302
|
+
export declare const propTypes: {
|
|
303
|
+
items: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
304
|
+
type: PropTypes.Validator<string>;
|
|
305
|
+
fieldName: PropTypes.Validator<string>;
|
|
306
|
+
}> | null | undefined)[]>;
|
|
307
|
+
initialValues: PropTypes.Requireable<object>;
|
|
308
|
+
initialExtras: PropTypes.Requireable<object>;
|
|
309
|
+
layout: PropTypes.Requireable<string>;
|
|
310
|
+
size: (props: any, propName: any, componentName: any) => void;
|
|
311
|
+
cols: PropTypes.Requireable<number>;
|
|
312
|
+
customClass: PropTypes.Requireable<string>;
|
|
313
|
+
compactMode: PropTypes.Requireable<boolean>;
|
|
314
|
+
labelWidth: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
315
|
+
labelAlign: PropTypes.Requireable<string>;
|
|
316
|
+
labelWrap: PropTypes.Requireable<boolean>;
|
|
317
|
+
formType: PropTypes.Requireable<string>;
|
|
318
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
319
|
+
uniqueKey: PropTypes.Requireable<string>;
|
|
320
|
+
defaultRows: PropTypes.Requireable<number>;
|
|
321
|
+
defaultExpand: PropTypes.Requireable<boolean>;
|
|
322
|
+
searchButtonCols: PropTypes.Requireable<number>;
|
|
323
|
+
scrollToFirstError: PropTypes.Requireable<boolean>;
|
|
324
|
+
authConfig: PropTypes.Requireable<object>;
|
|
325
|
+
isAutoFocus: PropTypes.Requireable<boolean>;
|
|
326
|
+
isCollapse: PropTypes.Requireable<boolean>;
|
|
327
|
+
isFieldsDefine: PropTypes.Requireable<boolean>;
|
|
328
|
+
isSearchBtn: PropTypes.Requireable<boolean>;
|
|
329
|
+
isSubmitBtn: PropTypes.Requireable<boolean>;
|
|
330
|
+
fieldsChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
331
|
+
onValuesChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
332
|
+
onFieldsChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
333
|
+
onFinish: PropTypes.Requireable<(...args: any[]) => any>;
|
|
334
|
+
onFinishFailed: PropTypes.Requireable<(...args: any[]) => any>;
|
|
335
|
+
onReset: PropTypes.Requireable<(...args: any[]) => any>;
|
|
336
|
+
onCollapse: PropTypes.Requireable<(...args: any[]) => any>;
|
|
337
|
+
};
|
|
338
|
+
export declare const defaultProps: {
|
|
339
|
+
layout: string;
|
|
340
|
+
labelWidth: number;
|
|
341
|
+
labelAlign: string;
|
|
342
|
+
formType: string;
|
|
343
|
+
initialValues: {};
|
|
344
|
+
initialExtras: {};
|
|
345
|
+
defaultRows: number;
|
|
346
|
+
isAutoFocus: boolean;
|
|
347
|
+
isCollapse: boolean;
|
|
348
|
+
isSearchBtn: boolean;
|
|
349
|
+
onValuesChange: () => void;
|
|
350
|
+
onFieldsChange: () => void;
|
|
351
|
+
onFinish: () => void;
|
|
352
|
+
onFinishFailed: () => void;
|
|
353
|
+
onReset: () => void;
|
|
354
|
+
onCollapse: () => void;
|
|
355
|
+
onFormItemsChange: () => void;
|
|
356
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import dayjs, { Dayjs } from 'dayjs';
|
|
2
|
+
import type { IDict } from '../../_utils/types';
|
|
3
|
+
import type { IFormItem, IFetchFnMaker, IRecord } from './types';
|
|
4
|
+
export declare const getDate: (dateString: string | undefined, format: string) => dayjs.Dayjs | null;
|
|
5
|
+
export declare const formatDate: (date: Dayjs | null | undefined, format: string) => string;
|
|
6
|
+
export declare const padDate: (input: string, options?: Record<'hour' | 'minute' | 'second', string>) => string;
|
|
7
|
+
export declare const isEmptyValue: (value: unknown) => boolean;
|
|
8
|
+
export declare const getSplitValue: (data: IRecord | null, path: string) => any;
|
|
9
|
+
export declare const setEchoRecord: (row: IRecord, alias: any, echoAlias: any) => void;
|
|
10
|
+
export declare const setEchoExtras: (row: IRecord, extras: any, echoExtras: any) => void;
|
|
11
|
+
export declare const deepMapList: (list: any[], valueKey: string, textKey: string) => (IDict & {
|
|
12
|
+
selectable?: boolean | undefined;
|
|
13
|
+
isLeaf?: boolean | undefined;
|
|
14
|
+
})[];
|
|
15
|
+
export declare const deepFind: (arr: any[], mark: string) => any;
|
|
16
|
+
export declare const deepFindValues: <T>(arr: T[], str: string, depth?: number) => T[];
|
|
17
|
+
export declare const deepGetPath: (arr: any[], value: string) => string[] | undefined;
|
|
18
|
+
export declare const formatNumber: (value: string | number) => string;
|
|
19
|
+
export declare const parserNumber: (value: string) => string;
|
|
20
|
+
export declare const secretFormat: (value: string | number | undefined, type: string) => string;
|
|
21
|
+
export declare const createShConfig: (data: any, fieldName: string, createFetch: IFetchFnMaker, multiple?: boolean) => {
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
getServerConfig?: import("./types").IFetchFn | undefined;
|
|
24
|
+
createFetchApi?: ((url: string, type?: string | undefined) => import("./types").IFetchFn) | undefined;
|
|
25
|
+
fieldsDefine?: import("./types").IFieldsDefine | undefined;
|
|
26
|
+
filters?: IFormItem[] | undefined;
|
|
27
|
+
table?: {
|
|
28
|
+
fetch?: import("../../table/src/table/types").IFetch | undefined;
|
|
29
|
+
columns?: import("../..").QmTableColumn[] | undefined;
|
|
30
|
+
rowKey?: string | number | ((row: IRecord, index: number) => string | number) | undefined;
|
|
31
|
+
webPagination?: boolean | undefined;
|
|
32
|
+
} | undefined;
|
|
33
|
+
tree?: {
|
|
34
|
+
fetch?: (import("../../table/src/table/types").IFetch & {
|
|
35
|
+
valueKey?: string | undefined;
|
|
36
|
+
textKey?: string | undefined;
|
|
37
|
+
}) | undefined;
|
|
38
|
+
tableParamsMap?: Record<string, string> | (() => Record<string, string>) | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
request?: import("./types").IRequest | undefined;
|
|
41
|
+
echoRequest?: (import("./types").IRequest & {
|
|
42
|
+
fieldAliasMap?: Record<string, string> | (() => Record<string, string>) | undefined;
|
|
43
|
+
extraAliasMap?: Record<string, string> | (() => Record<string, string>) | undefined;
|
|
44
|
+
}) | undefined;
|
|
45
|
+
hideHeader?: boolean | undefined;
|
|
46
|
+
columns?: import("../..").QmTableColumn[] | undefined;
|
|
47
|
+
width?: string | number | undefined;
|
|
48
|
+
initialValue?: import("./types").IFormData | undefined;
|
|
49
|
+
onlySelect?: boolean | undefined;
|
|
50
|
+
autoQueryAssign?: boolean | undefined;
|
|
51
|
+
closeRemoteMatch?: boolean | undefined;
|
|
52
|
+
fieldAliasMap?: Record<string, string> | (() => Record<string, string>) | undefined;
|
|
53
|
+
extraAliasMap?: Record<string, string> | (() => Record<string, string>) | undefined;
|
|
54
|
+
filterAliasMap?: string[] | (() => string[]) | undefined;
|
|
55
|
+
beforeOpen?: ((formData: import("./types").IFormData) => boolean | void | Promise<void>) | undefined;
|
|
56
|
+
closed?: ((rowData: Record<string, any>) => void) | undefined;
|
|
57
|
+
};
|