vap1 0.0.9 → 0.1.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/components/Trees/DTree.js +3 -0
- package/components/UForm/UForm.js +5 -5
- package/components/_adapt/FloatButton.d.ts +14 -8
- package/components/_adapt/FloatButton.js +58 -4
- package/components/_adapt/Form.d.ts +0 -14
- package/components/_adapt/Form.js +36 -48
- package/components/_adapt/Menu.js +5 -6
- package/components/_adapt/Modal.d.ts +0 -3
- package/components/_adapt/Modal.js +1 -1
- package/components/_adapt/Radio.js +2 -2
- package/components/_common/Role.js +0 -1
- package/index.d.ts +2 -2
- package/index.js +3 -2
- package/package.json +1 -1
|
@@ -136,6 +136,9 @@ const _Dtree = (props) => {
|
|
|
136
136
|
});
|
|
137
137
|
return react_1.default.createElement(antd_1.Tree, Object.assign({}, treeState.baseProps, treeProps, { className: treeState.className, loadData: loadData,
|
|
138
138
|
// disabled={props.disabled}
|
|
139
|
+
onSelect: (keys, evt) => {
|
|
140
|
+
console.log(keys, evt);
|
|
141
|
+
},
|
|
139
142
|
// onSelect={onSelect}
|
|
140
143
|
// selectedKeys={treeState.selectedKeys}
|
|
141
144
|
selectedKeys: treeState.selectedKeys }), (0, ActionTree_1.renderRoot)(props, treeState, actionContext));
|
|
@@ -39,7 +39,7 @@ exports.UForm = exports.initValue = void 0;
|
|
|
39
39
|
const react_1 = __importStar(require("react"));
|
|
40
40
|
const lodash_1 = __importDefault(require("lodash"));
|
|
41
41
|
const utils_1 = require("../../utils");
|
|
42
|
-
const
|
|
42
|
+
const antd_1 = require("antd");
|
|
43
43
|
const Row_1 = require("../_adapt/Row");
|
|
44
44
|
const Col_1 = require("../_adapt/Col");
|
|
45
45
|
const Popconfirm_1 = require("../_adapt/Popconfirm");
|
|
@@ -145,7 +145,7 @@ const renderFormField = (state, field, form, update, data) => {
|
|
|
145
145
|
const input = (0, _register_1.getUFormInput)(field.type || 'text');
|
|
146
146
|
const { labelSpan, inputSpan, colSpan, cols, disableFields, hiddenFields, requireFields, optionFields, } = state;
|
|
147
147
|
if (hiddenFields.current.has(field.field)) {
|
|
148
|
-
return react_1.default.createElement(
|
|
148
|
+
return react_1.default.createElement(antd_1.Form.Item, { style: { display: 'none' } }, form.getFieldDecorator(field.field)(react_1.default.createElement(input.component, {
|
|
149
149
|
form,
|
|
150
150
|
// initValue:
|
|
151
151
|
field,
|
|
@@ -225,7 +225,7 @@ const renderFormField = (state, field, form, update, data) => {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
return react_1.default.createElement(Col_1.Col, Object.assign({}, colProps),
|
|
228
|
-
react_1.default.createElement(
|
|
228
|
+
react_1.default.createElement(antd_1.Form.Item, Object.assign({}, itemProps), form.getFieldDecorator(field.field, options)(react_1.default.createElement(input.component, {
|
|
229
229
|
form,
|
|
230
230
|
field,
|
|
231
231
|
disabled: disableFields.current.has(field.field),
|
|
@@ -480,7 +480,7 @@ const _UForm = (0, react_1.forwardRef)((props, ref) => {
|
|
|
480
480
|
return utils_1.Const.NONE;
|
|
481
481
|
// console.log(initRef)
|
|
482
482
|
// console.log('fdsafd')
|
|
483
|
-
return react_1.default.createElement(
|
|
483
|
+
return react_1.default.createElement(antd_1.Form
|
|
484
484
|
// defaultValue={initRef.current}
|
|
485
485
|
// initialValues={props.default}
|
|
486
486
|
// size={props.size || GLOBAL.CONFIG.FORM.SIZE}
|
|
@@ -500,7 +500,7 @@ class _UFormAdaptor extends react_1.default.Component {
|
|
|
500
500
|
}
|
|
501
501
|
// 3.0 适配层
|
|
502
502
|
const UFormAdaptor = (0, react_1.memo)((0, react_1.forwardRef)((props, ref) => {
|
|
503
|
-
const FROM =
|
|
503
|
+
const FROM = antd_1.Form.create()(_UFormAdaptor);
|
|
504
504
|
// <ConfigProvider ></ConfigProvider>
|
|
505
505
|
return react_1.default.createElement(FROM, Object.assign({}, props, { aref: ref }));
|
|
506
506
|
}));
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { BackTop } from 'antd';
|
|
3
|
+
import type { BadgeProps } from 'antd/es/badge';
|
|
4
|
+
import type { ExoticComponent } from 'react';
|
|
5
|
+
type FloatButtonType = 'default' | 'primary';
|
|
6
|
+
type FloatButtonShape = 'circle' | 'square';
|
|
7
|
+
type FloatButtonBadgeProps = Omit<BadgeProps, 'status' | 'text' | 'title' | 'children'>;
|
|
8
|
+
export type FloatButtonProps = {
|
|
8
9
|
className?: string;
|
|
9
10
|
style?: React.CSSProperties;
|
|
10
11
|
icon?: React.ReactNode;
|
|
11
12
|
description?: React.ReactNode;
|
|
12
13
|
type?: FloatButtonType;
|
|
14
|
+
title?: string;
|
|
13
15
|
shape?: FloatButtonShape;
|
|
14
16
|
href?: string;
|
|
15
17
|
badge?: FloatButtonBadgeProps;
|
|
16
18
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
+
};
|
|
20
|
+
type FloatButtonComponent = ExoticComponent<FloatButtonProps> & {
|
|
21
|
+
BackTop: typeof BackTop;
|
|
22
|
+
};
|
|
23
|
+
export declare const FloatButton: FloatButtonComponent;
|
|
24
|
+
export {};
|
|
@@ -1,7 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
29
|
exports.FloatButton = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
32
|
+
const antd_1 = require("antd");
|
|
33
|
+
const Icon_1 = require("./Icon");
|
|
34
|
+
const _FloatButton = (props) => {
|
|
35
|
+
const btnProps = (0, react_1.useMemo)(() => {
|
|
36
|
+
const btnProps = { shape: 'circle' };
|
|
37
|
+
if (props.type == 'primary')
|
|
38
|
+
btnProps.type = 'primary';
|
|
39
|
+
if (props.shape == 'square')
|
|
40
|
+
btnProps.shape = 'round';
|
|
41
|
+
if (props.title)
|
|
42
|
+
btnProps.title = props.title;
|
|
43
|
+
if (props.href)
|
|
44
|
+
btnProps.href = props.href;
|
|
45
|
+
if (lodash_1.default.isFunction(props.onClick))
|
|
46
|
+
btnProps.onClick = props.onClick;
|
|
47
|
+
return btnProps;
|
|
48
|
+
}, []);
|
|
49
|
+
if (props.badge) {
|
|
50
|
+
return react_1.default.createElement(antd_1.Badge, Object.assign({}, lodash_1.default.omit(props.badge, ['status', 'text', 'title', 'children'])),
|
|
51
|
+
react_1.default.createElement(antd_1.Button, Object.assign({ size: "large" }, btnProps, { className: 'float-button', style: lodash_1.default.merge({ right: 48, top: 72, }, props.style, { position: 'fixed', }) }),
|
|
52
|
+
props.icon && (lodash_1.default.isString(props.icon ? react_1.default.createElement(Icon_1.Icon, { type: props.icon }) : props.icon)),
|
|
53
|
+
props.description));
|
|
54
|
+
}
|
|
55
|
+
// let
|
|
56
|
+
return react_1.default.createElement(antd_1.Button, Object.assign({ size: "large" }, btnProps, { className: 'float-button', style: lodash_1.default.merge({ right: 48, top: 72, }, props.style, { position: 'fixed', }) }),
|
|
57
|
+
props.icon && (lodash_1.default.isString(props.icon) ? react_1.default.createElement(Icon_1.Icon, { type: props.icon }) : props.icon),
|
|
58
|
+
props.description);
|
|
59
|
+
};
|
|
60
|
+
exports.FloatButton = _FloatButton;
|
|
61
|
+
exports.FloatButton.BackTop = antd_1.BackTop;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { FormProps as AntdFormProps, FormItemProps as AntdFormItemProps, FormComponentProps, FormCreateOption } from 'antd/es/form';
|
|
3
|
-
import type { FormWrappedProps } from 'antd/es/form/interface';
|
|
4
|
-
import type { FC, ExoticComponent, PropsWithChildren } from 'react';
|
|
5
|
-
export type FormProps = AntdFormProps;
|
|
6
|
-
export type FormItemProps = AntdFormItemProps & {
|
|
7
|
-
tooltip?: React.ReactNode;
|
|
8
|
-
};
|
|
9
|
-
type FormComponent = ExoticComponent<PropsWithChildren<AntdFormProps>> & {
|
|
10
|
-
Item: FC<FormItemProps>;
|
|
11
|
-
create: <TOwnProps extends FormComponentProps<any>>(options?: FormCreateOption<TOwnProps>) => FormWrappedProps<TOwnProps>;
|
|
12
|
-
};
|
|
13
|
-
export declare const Form: FormComponent;
|
|
14
|
-
export {};
|
|
@@ -1,48 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
38
|
-
react_1.default.createElement(Popover_1.Popover, null,
|
|
39
|
-
react_1.default.createElement(Icon_1.Icon, { type: 'help' }),
|
|
40
|
-
props.label));
|
|
41
|
-
}
|
|
42
|
-
return props.label;
|
|
43
|
-
}, [props.label, props.tooltip]);
|
|
44
|
-
return react_1.default.createElement(antd_1.Form.Item, Object.assign({}, props, { label: label }));
|
|
45
|
-
};
|
|
46
|
-
const _Form = antd_1.Form;
|
|
47
|
-
exports.Form = _Form;
|
|
48
|
-
exports.Form.Item = FormItem;
|
|
1
|
+
// import React, { useMemo } from 'react';
|
|
2
|
+
// import { Form as AntdFrom } from 'antd'
|
|
3
|
+
// import { Icon } from './Icon'
|
|
4
|
+
// import { Popover } from './Popover'
|
|
5
|
+
// import type { FormProps as AntdFormProps, FormItemProps as AntdFormItemProps, FormComponentProps, FormCreateOption, } from 'antd/es/form';
|
|
6
|
+
// import type { FormWrappedProps } from 'antd/es/form/interface';
|
|
7
|
+
// import type { FC, ExoticComponent, PropsWithChildren } from 'react'
|
|
8
|
+
// export type FormProps = AntdFormProps;
|
|
9
|
+
// export type FormItemProps = AntdFormItemProps & {
|
|
10
|
+
// tooltip?: React.ReactNode
|
|
11
|
+
// }
|
|
12
|
+
// type FormComponent = ExoticComponent<PropsWithChildren<AntdFormProps>> & {
|
|
13
|
+
// Item: FC<FormItemProps>;
|
|
14
|
+
// create: <TOwnProps extends FormComponentProps<any>>(options?: FormCreateOption<TOwnProps>) => FormWrappedProps<TOwnProps>;
|
|
15
|
+
// }
|
|
16
|
+
// const FormItem: FC<FormItemProps> = props => {
|
|
17
|
+
// const label = useMemo(() => {
|
|
18
|
+
// if (props.label == null || props.label == undefined) {
|
|
19
|
+
// return undefined;
|
|
20
|
+
// }
|
|
21
|
+
// if (props.tooltip) {
|
|
22
|
+
// return <React.Fragment>
|
|
23
|
+
// <Popover>
|
|
24
|
+
// <Icon type='help' />
|
|
25
|
+
// {props.label}
|
|
26
|
+
// </Popover>
|
|
27
|
+
// </React.Fragment>
|
|
28
|
+
// }
|
|
29
|
+
// return props.label;
|
|
30
|
+
// }, [props.label, props.tooltip])
|
|
31
|
+
// return <AntdFrom.Item {...props} label={label} />
|
|
32
|
+
// }
|
|
33
|
+
// const _Form = AntdFrom as any
|
|
34
|
+
// export const Form = _Form as FormComponent;
|
|
35
|
+
// Form.Item = FormItem;
|
|
36
|
+
// // Form.create = AntdFrom.create;
|
|
@@ -15,16 +15,15 @@ const getMenuProps = (props) => {
|
|
|
15
15
|
if (props.ik) {
|
|
16
16
|
title = (0, i18n_1.txt)(props.ik);
|
|
17
17
|
}
|
|
18
|
-
if (props.danger) {
|
|
19
|
-
title = react_1.default.createElement(antd_1.Typography.Text, { type: "danger" }, title);
|
|
20
|
-
}
|
|
21
18
|
if (props.icon) {
|
|
22
|
-
title = react_1.default.createElement(react_1.default.Fragment, null,
|
|
19
|
+
result.title = react_1.default.createElement(react_1.default.Fragment, null,
|
|
23
20
|
lodash_1.default.isString(props.icon) ? react_1.default.createElement(Icon_1.Icon, { type: props.icon }) : props.icon,
|
|
24
21
|
" ",
|
|
25
|
-
(
|
|
22
|
+
react_1.default.createElement("span", { className: props.danger ? 'ant-typography ant-typography-danger' : undefined }, title));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
result.title = react_1.default.createElement("span", { className: props.danger ? 'ant-typography ant-typography-danger' : undefined }, title);
|
|
26
26
|
}
|
|
27
|
-
result.title = title;
|
|
28
27
|
return result;
|
|
29
28
|
};
|
|
30
29
|
const renderGroup = (props) => {
|
|
@@ -17,9 +17,6 @@ export declare class Modal extends Component<ModalProps> {
|
|
|
17
17
|
static warning: import("antd/lib/modal/Modal").ModalFunc;
|
|
18
18
|
static confirm: import("antd/lib/modal/Modal").ModalFunc;
|
|
19
19
|
static destroyAll: () => void;
|
|
20
|
-
static useDestoryModal: (props: {
|
|
21
|
-
open?: boolean;
|
|
22
|
-
}) => [boolean, () => void];
|
|
23
20
|
renderFooter(): React.ReactNode;
|
|
24
21
|
render(): React.ReactNode;
|
|
25
22
|
}
|
|
@@ -38,6 +38,7 @@ const useDestoryModal = (props) => {
|
|
|
38
38
|
};
|
|
39
39
|
exports.useDestoryModal = useDestoryModal;
|
|
40
40
|
class Modal extends react_1.Component {
|
|
41
|
+
// static useDestoryModal = useDestoryModal;
|
|
41
42
|
renderFooter() {
|
|
42
43
|
const { okText, okType = 'primary', cancelText, confirmLoading, onOk, onCancel, okButtonProps, cancelButtonProps, footer } = this.props;
|
|
43
44
|
if (footer !== undefined)
|
|
@@ -58,4 +59,3 @@ Modal.warn = antd_1.Modal.warn;
|
|
|
58
59
|
Modal.warning = antd_1.Modal.warning;
|
|
59
60
|
Modal.confirm = antd_1.Modal.confirm;
|
|
60
61
|
Modal.destroyAll = antd_1.Modal.destroyAll;
|
|
61
|
-
Modal.useDestoryModal = exports.useDestoryModal;
|
|
@@ -7,13 +7,13 @@ exports.Radio = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const antd_1 = require("antd");
|
|
9
9
|
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
-
const RadioGroupWithOptions = (props) => react_1.default.createElement(
|
|
10
|
+
const RadioGroupWithOptions = (props) => react_1.default.createElement(antd_1.Radio.Group, Object.assign({}, lodash_1.default.omit(props, 'children')), props.options.map(item => {
|
|
11
11
|
if (props.optionType == 'button') {
|
|
12
12
|
return react_1.default.createElement(antd_1.Radio.Button, { value: item.value }, item.label);
|
|
13
13
|
}
|
|
14
14
|
return react_1.default.createElement(antd_1.Radio, { value: item.value }, item.label);
|
|
15
15
|
}));
|
|
16
|
-
const RadioGroup =
|
|
16
|
+
const RadioGroup = props => {
|
|
17
17
|
if (lodash_1.default.isArray(props.options))
|
|
18
18
|
return react_1.default.createElement(RadioGroupWithOptions, Object.assign({}, props));
|
|
19
19
|
return react_1.default.createElement(antd_1.Radio.Group, Object.assign({}, props));
|
package/index.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ Checkbox, Switch, DatePicker, TimePicker, Upload, Rate, AutoComplete, Cascader,
|
|
|
90
90
|
* 应用性组件
|
|
91
91
|
*/
|
|
92
92
|
Carousel, Calendar, } from 'antd';
|
|
93
|
-
export { Form } from '
|
|
93
|
+
export { Form } from 'antd';
|
|
94
94
|
export { Table } from './components/_adapt/Table';
|
|
95
95
|
export type { TableProps } from './components/_adapt/Table';
|
|
96
96
|
export type { DescriptionsProps } from 'antd/es/descriptions';
|
|
@@ -105,7 +105,7 @@ export { Slider } from './components/_adapt/Slider';
|
|
|
105
105
|
export { InputNumber } from './components/_adapt/InputNumber';
|
|
106
106
|
export { Radio } from './components/_adapt/Radio';
|
|
107
107
|
export { ColorPicker } from './components/_adapt/ColorPicker';
|
|
108
|
-
export type { FormProps, FormItemProps } from '
|
|
108
|
+
export type { FormProps, FormItemProps } from 'antd/es/form';
|
|
109
109
|
export type { InputProps, TextAreaProps, PasswordProps } from 'antd/es/input';
|
|
110
110
|
export type { InputRef } from './components/_adapt/Input';
|
|
111
111
|
export type { InputNumberProps } from './components/_adapt/InputNumber';
|
package/index.js
CHANGED
|
@@ -109,8 +109,9 @@ Object.defineProperty(exports, "Transfer", { enumerable: true, get: function ()
|
|
|
109
109
|
*/
|
|
110
110
|
Object.defineProperty(exports, "Carousel", { enumerable: true, get: function () { return antd_5.Carousel; } });
|
|
111
111
|
Object.defineProperty(exports, "Calendar", { enumerable: true, get: function () { return antd_5.Calendar; } });
|
|
112
|
-
var
|
|
113
|
-
Object.defineProperty(exports, "Form", { enumerable: true, get: function () { return
|
|
112
|
+
var antd_6 = require("antd");
|
|
113
|
+
Object.defineProperty(exports, "Form", { enumerable: true, get: function () { return antd_6.Form; } });
|
|
114
|
+
// export { Form } from './components/_adapt/Form'
|
|
114
115
|
var Table_1 = require("./components/_adapt/Table");
|
|
115
116
|
Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return Table_1.Table; } });
|
|
116
117
|
var Input_1 = require("./components/_adapt/Input");
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"vap1","version":"0.0
|
|
1
|
+
{"name":"vap1","version":"0.1.0","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"}
|