@cuvp1225/antd 0.2.58 → 0.2.59
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/dist/designer.js +1959 -164
- package/dist/index.js +2047 -269
- package/lib/cjs/components/button.js +26 -0
- package/lib/cjs/components/cascader.d.ts +34 -0
- package/lib/cjs/components/cascader.js +23 -0
- package/lib/cjs/components/checkbox.d.ts +6 -0
- package/lib/cjs/components/checkbox.js +22 -0
- package/lib/cjs/components/date-picker.d.ts +8 -0
- package/lib/cjs/components/date-picker.js +24 -0
- package/lib/cjs/components/drawer.d.ts +3 -0
- package/lib/cjs/components/drawer.js +21 -0
- package/lib/cjs/components/icon.d.ts +2 -0
- package/lib/cjs/components/icon.js +48 -0
- package/lib/cjs/components/index.d.ts +7 -2
- package/lib/cjs/components/index.js +17 -4
- package/lib/cjs/components/popconfirm.d.ts +3 -0
- package/lib/cjs/components/popconfirm.js +26 -0
- package/lib/cjs/components/radio.d.ts +6 -0
- package/lib/cjs/components/radio.js +27 -0
- package/lib/cjs/components/select.js +30 -4
- package/lib/cjs/components/typography.d.ts +2 -1
- package/lib/cjs/components/typography.js +5 -2
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/prototypes/alert.js +6 -1
- package/lib/cjs/prototypes/auto-complete.js +69 -18
- package/lib/cjs/prototypes/button.js +8 -6
- package/lib/cjs/prototypes/cascader.js +1 -1
- package/lib/cjs/prototypes/common.js +6 -5
- package/lib/cjs/prototypes/drawer.js +25 -15
- package/lib/cjs/prototypes/form.js +1 -1
- package/lib/cjs/prototypes/icon.d.ts +2 -0
- package/lib/cjs/prototypes/icon.js +46 -0
- package/lib/cjs/prototypes/popconfirm.js +3 -1
- package/lib/cjs/prototypes/progress.js +1 -0
- package/lib/cjs/prototypes/radio.js +20 -4
- package/lib/cjs/prototypes/select.js +8 -0
- package/lib/cjs/prototypes/steps.js +30 -4
- package/lib/cjs/prototypes/table.js +5 -5
- package/lib/cjs/prototypes/tabs.js +53 -4
- package/lib/cjs/prototypes/tree-select.js +31 -1
- package/lib/cjs/prototypes/tree.js +1 -1
- package/lib/cjs/utils/utils.d.ts +2 -0
- package/lib/cjs/utils/utils.js +12 -0
- package/lib/esm/components/button.js +26 -0
- package/lib/esm/components/cascader.d.ts +34 -0
- package/lib/esm/components/cascader.js +20 -0
- package/lib/esm/components/checkbox.d.ts +6 -0
- package/lib/esm/components/checkbox.js +19 -0
- package/lib/esm/components/date-picker.d.ts +8 -0
- package/lib/esm/components/date-picker.js +21 -0
- package/lib/esm/components/drawer.d.ts +3 -0
- package/lib/esm/components/drawer.js +18 -0
- package/lib/esm/components/icon.d.ts +2 -0
- package/lib/esm/components/icon.js +45 -0
- package/lib/esm/components/index.d.ts +7 -2
- package/lib/esm/components/index.js +8 -2
- package/lib/esm/components/popconfirm.d.ts +3 -0
- package/lib/esm/components/popconfirm.js +23 -0
- package/lib/esm/components/radio.d.ts +6 -0
- package/lib/esm/components/radio.js +24 -0
- package/lib/esm/components/select.js +30 -4
- package/lib/esm/components/typography.d.ts +2 -1
- package/lib/esm/components/typography.js +4 -1
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/prototypes/alert.js +6 -1
- package/lib/esm/prototypes/auto-complete.js +70 -19
- package/lib/esm/prototypes/button.js +8 -6
- package/lib/esm/prototypes/cascader.js +1 -1
- package/lib/esm/prototypes/common.js +6 -5
- package/lib/esm/prototypes/drawer.js +25 -15
- package/lib/esm/prototypes/form.js +1 -1
- package/lib/esm/prototypes/icon.d.ts +2 -0
- package/lib/esm/prototypes/icon.js +43 -0
- package/lib/esm/prototypes/popconfirm.js +3 -1
- package/lib/esm/prototypes/progress.js +1 -0
- package/lib/esm/prototypes/radio.js +20 -4
- package/lib/esm/prototypes/select.js +8 -0
- package/lib/esm/prototypes/steps.js +30 -4
- package/lib/esm/prototypes/table.js +5 -5
- package/lib/esm/prototypes/tabs.js +53 -4
- package/lib/esm/prototypes/tree-select.js +32 -2
- package/lib/esm/prototypes/tree.js +1 -1
- package/lib/esm/utils/utils.d.ts +2 -0
- package/lib/esm/utils/utils.js +5 -0
- package/package.json +3 -3
@@ -0,0 +1,19 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { defineComponent } from '@music163/tango-boot';
|
3
|
+
import { Checkbox as AntCheckbox } from 'antd';
|
4
|
+
import React from 'react';
|
5
|
+
function CheckboxDesigner(_a) {
|
6
|
+
var { style } = _a, rest = __rest(_a, ["style"]);
|
7
|
+
return (React.createElement(AntCheckbox, Object.assign({}, rest, { style: style }), rest.label));
|
8
|
+
}
|
9
|
+
export const Checkbox = defineComponent(AntCheckbox, {
|
10
|
+
name: 'Checkbox',
|
11
|
+
designerConfig: {
|
12
|
+
render({ designerProps, originalProps, }) {
|
13
|
+
return React.createElement(CheckboxDesigner, Object.assign({ label: '多选项1' }, designerProps, originalProps));
|
14
|
+
},
|
15
|
+
},
|
16
|
+
});
|
17
|
+
export const CheckboxGroup = defineComponent(AntCheckbox.Group, {
|
18
|
+
name: 'CheckboxGroup',
|
19
|
+
});
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import moment from 'moment';
|
2
|
+
import 'moment/locale/zh-cn';
|
3
|
+
import React from 'react';
|
4
|
+
export declare const DatePicker: React.ForwardRefExoticComponent<((import("antd/lib/date-picker/generatePicker").PickerProps<moment.Moment> & {
|
5
|
+
status?: "" | "warning" | "error" | undefined;
|
6
|
+
dropdownClassName?: string | undefined;
|
7
|
+
popupClassName?: string | undefined;
|
8
|
+
}) & import("@music163/tango-boot").TangoComponentProps) & React.RefAttributes<unknown>>;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { defineComponent } from '@music163/tango-boot';
|
3
|
+
import { DatePicker as AntDataPicker, ConfigProvider } from 'antd';
|
4
|
+
import zhCN from 'antd/es/locale/zh_CN';
|
5
|
+
import moment from 'moment';
|
6
|
+
import 'moment/locale/zh-cn';
|
7
|
+
import React from 'react';
|
8
|
+
moment.locale('zh-cn');
|
9
|
+
function DataPickerDesigner(_a) {
|
10
|
+
var { style } = _a, rest = __rest(_a, ["style"]);
|
11
|
+
return (React.createElement(ConfigProvider, { locale: zhCN },
|
12
|
+
React.createElement(AntDataPicker, Object.assign({}, rest, { style: style }))));
|
13
|
+
}
|
14
|
+
export const DatePicker = defineComponent(AntDataPicker, {
|
15
|
+
name: 'DatePicker',
|
16
|
+
designerConfig: {
|
17
|
+
render({ designerProps, originalProps, }) {
|
18
|
+
return React.createElement(DataPickerDesigner, Object.assign({}, designerProps, originalProps));
|
19
|
+
},
|
20
|
+
},
|
21
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Drawer as AntDrawer } from 'antd';
|
3
|
+
import { defineComponent } from '@music163/tango-boot';
|
4
|
+
import React from 'react';
|
5
|
+
import { Placeholder } from './placeholder';
|
6
|
+
function DrawerDesigner(_a) {
|
7
|
+
var { children, style } = _a, rest = __rest(_a, ["children", "style"]);
|
8
|
+
return (React.createElement(AntDrawer, Object.assign({}, rest, { style: style }),
|
9
|
+
React.createElement(Placeholder, null)));
|
10
|
+
}
|
11
|
+
export const Drawer = defineComponent(AntDrawer, {
|
12
|
+
name: 'Drawer',
|
13
|
+
designerConfig: {
|
14
|
+
render({ designerProps, originalProps, }) {
|
15
|
+
return React.createElement(DrawerDesigner, Object.assign({}, designerProps, originalProps));
|
16
|
+
},
|
17
|
+
},
|
18
|
+
});
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare const AntdIcon: React.ForwardRefExoticComponent<Omit<Omit<import("@ant-design/icons/lib/components/Icon").IconComponentProps, "ref"> & React.RefAttributes<HTMLSpanElement> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import React from 'react';
|
3
|
+
// import * as icons from '@ant-design/icons';
|
4
|
+
// import { createFromIconfontCN } from '@ant-design/icons';
|
5
|
+
import HomeOutlined from "@ant-design/icons/HomeOutlined";
|
6
|
+
import { defineComponent } from '@music163/tango-boot';
|
7
|
+
import Icon from '@ant-design/icons';
|
8
|
+
// function IconView = (props: IconProps, ref: Ref<any>) => {
|
9
|
+
// const { type = '', size, color, ...rest } = props;
|
10
|
+
// // const IconComp = ((icons || {}) as any)[type];
|
11
|
+
// const style = {
|
12
|
+
// ...rest.style,
|
13
|
+
// fontSize: size,
|
14
|
+
// color,
|
15
|
+
// };
|
16
|
+
// // if (!IconComp) {
|
17
|
+
// // const IconFont = createFromIconfontCN();
|
18
|
+
// // return <IconFont type={type} {...rest} style={style} ref={ref} />;
|
19
|
+
// // }
|
20
|
+
// return <ChromeFilled {...rest} style={style} twoToneColor={color} ref={ref} />;
|
21
|
+
// };
|
22
|
+
// function IconView({
|
23
|
+
// ...props
|
24
|
+
// }) {
|
25
|
+
// const { type = '', size, color, ...rest } = props;
|
26
|
+
// const style = {
|
27
|
+
// ...props.style,
|
28
|
+
// fontSize: size,
|
29
|
+
// color,
|
30
|
+
// };
|
31
|
+
// return <ChromeFilled {...rest} style={style} twoToneColor={color}/>;
|
32
|
+
// }
|
33
|
+
// export const AntdIcon = defineComponent(IconView);
|
34
|
+
function IconDesigner(_a) {
|
35
|
+
var { children, style, icon } = _a, rest = __rest(_a, ["children", "style", "icon"]);
|
36
|
+
return (React.createElement(Icon, Object.assign({}, rest, { style: style, component: HomeOutlined })));
|
37
|
+
}
|
38
|
+
export const AntdIcon = defineComponent(Icon, {
|
39
|
+
name: 'AntdIcon',
|
40
|
+
designerConfig: {
|
41
|
+
render({ designerProps, originalProps }) {
|
42
|
+
return React.createElement(IconDesigner, Object.assign({}, designerProps, originalProps));
|
43
|
+
},
|
44
|
+
},
|
45
|
+
});
|
@@ -3,13 +3,18 @@ export { Box } from './box';
|
|
3
3
|
export { Button, ButtonGroup } from './button';
|
4
4
|
export * from './formily';
|
5
5
|
export { InputNumber } from './input-number';
|
6
|
-
export { Input, TextArea } from './input';
|
7
6
|
export { Modalnew } from './modal';
|
8
7
|
export * from './page';
|
9
8
|
export * from './placeholder';
|
10
9
|
export * from './section';
|
11
10
|
export { Select } from './select';
|
12
11
|
export { Space } from './space';
|
13
|
-
export { Typography, Title, Paragraph } from './typography';
|
12
|
+
export { Typography, Title, Paragraph, Text } from './typography';
|
14
13
|
export { Columns, Column } from './columns';
|
15
14
|
export { Row1 } from './row';
|
15
|
+
export { Popconfirm } from './popconfirm';
|
16
|
+
export { Drawer } from "./drawer";
|
17
|
+
export { DatePicker } from "./date-picker";
|
18
|
+
export { Radio, RadioGroup } from "./radio";
|
19
|
+
export { Checkbox, CheckboxGroup } from "./checkbox";
|
20
|
+
export { Cascader } from "./cascader";
|
@@ -4,16 +4,22 @@ export { Box } from './box';
|
|
4
4
|
export { Button, ButtonGroup } from './button';
|
5
5
|
export * from './formily';
|
6
6
|
export { InputNumber } from './input-number';
|
7
|
-
export { Input, TextArea } from './input';
|
7
|
+
// export { Input, TextArea } from './input';
|
8
8
|
export { Modalnew } from './modal';
|
9
9
|
export * from './page';
|
10
10
|
export * from './placeholder';
|
11
11
|
export * from './section';
|
12
12
|
export { Select } from './select';
|
13
13
|
export { Space } from './space';
|
14
|
-
export { Typography, Title, Paragraph } from './typography';
|
14
|
+
export { Typography, Title, Paragraph, Text } from './typography';
|
15
15
|
export { Columns, Column } from './columns';
|
16
16
|
export { Row1 } from './row';
|
17
|
+
export { Popconfirm } from './popconfirm';
|
18
|
+
export { Drawer } from "./drawer";
|
19
|
+
export { DatePicker } from "./date-picker";
|
20
|
+
export { Radio, RadioGroup } from "./radio";
|
21
|
+
export { Checkbox, CheckboxGroup } from "./checkbox";
|
22
|
+
export { Cascader } from "./cascader";
|
17
23
|
//export { MultiColumns } from './multiColumns'
|
18
24
|
//export { Row,Col } from './grid'
|
19
25
|
//export { RowCombination,ColCombination } from './gridCombination'
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { PopconfirmProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
export declare const Popconfirm: React.ForwardRefExoticComponent<Omit<PopconfirmProps & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Popconfirm as AntPopconfirm } from 'antd';
|
3
|
+
import { defineComponent } from '@music163/tango-boot';
|
4
|
+
import React, { useEffect } from 'react';
|
5
|
+
function PopconfirmDesigner(_a) {
|
6
|
+
var { children, title, dataDnd, dataId, style } = _a, rest = __rest(_a, ["children", "title", "dataDnd", "dataId", "style"]);
|
7
|
+
useEffect(() => {
|
8
|
+
console.log('PopconfirmDesigner', dataDnd, dataId, rest);
|
9
|
+
}, []);
|
10
|
+
return (React.createElement("div", { id: "popconfirSwrapper", "data-dnd": dataDnd, "data-id": dataId },
|
11
|
+
React.createElement(AntPopconfirm, Object.assign({ title: title, "data-dnd": dataDnd, "data-id": dataId }, rest, { style: style }), children)));
|
12
|
+
}
|
13
|
+
export const Popconfirm = defineComponent(AntPopconfirm, {
|
14
|
+
name: 'Popconfirm',
|
15
|
+
designerConfig: {
|
16
|
+
render({ designerProps, originalProps }) {
|
17
|
+
console.log("Popconfirm: designerProps:", designerProps, "originalProps:", originalProps);
|
18
|
+
return React.createElement(PopconfirmDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
|
19
|
+
},
|
20
|
+
},
|
21
|
+
// designerConfig: {
|
22
|
+
// },
|
23
|
+
});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { RadioProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
export declare const Radio: React.ForwardRefExoticComponent<Omit<RadioProps & React.RefAttributes<HTMLElement> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
4
|
+
export declare const RadioGroup: React.ForwardRefExoticComponent<Omit<Omit<import("antd").RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
5
|
+
ref?: React.Ref<HTMLDivElement>;
|
6
|
+
} & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { defineComponent } from '@music163/tango-boot';
|
3
|
+
import { Radio as AntRadio } from 'antd';
|
4
|
+
import React from 'react';
|
5
|
+
function RadioDesigner(_a) {
|
6
|
+
var { style } = _a, rest = __rest(_a, ["style"]);
|
7
|
+
const { optionType } = rest;
|
8
|
+
if (optionType === 'button') {
|
9
|
+
return React.createElement(AntRadio.Button, Object.assign({}, rest, { style: style }), rest.label);
|
10
|
+
}
|
11
|
+
return (React.createElement(AntRadio, Object.assign({}, rest, { style: style }), rest.label));
|
12
|
+
}
|
13
|
+
export const Radio = defineComponent(AntRadio, {
|
14
|
+
name: 'Radio',
|
15
|
+
designerConfig: {
|
16
|
+
render({ designerProps, originalProps, }) {
|
17
|
+
console.log("designerProps:", designerProps, "originalProps:", originalProps);
|
18
|
+
return React.createElement(RadioDesigner, Object.assign({ label: '单项1', optionType: '' }, designerProps, originalProps));
|
19
|
+
},
|
20
|
+
},
|
21
|
+
});
|
22
|
+
export const RadioGroup = defineComponent(AntRadio.Group, {
|
23
|
+
name: 'RadioGroup',
|
24
|
+
});
|
@@ -4,16 +4,42 @@ export const Select = defineComponent(AntSelect, {
|
|
4
4
|
name: 'Select',
|
5
5
|
registerState: {
|
6
6
|
getInitStates(_, props) {
|
7
|
-
var _a;
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
var _a, _b;
|
8
|
+
console.log('getInitStates', props);
|
9
|
+
if (props.mode === 'multiple' || props.mode === 'tags') {
|
10
|
+
return {
|
11
|
+
value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : [],
|
12
|
+
};
|
13
|
+
}
|
14
|
+
else {
|
15
|
+
return {
|
16
|
+
value: (_b = props.defaultValue) !== null && _b !== void 0 ? _b : '',
|
17
|
+
};
|
18
|
+
}
|
19
|
+
// return {
|
20
|
+
// value: props.defaultValue ?? '',
|
21
|
+
// };
|
11
22
|
},
|
12
23
|
getTriggerProps({ setPageState, getPageState }) {
|
13
24
|
var _a;
|
25
|
+
console.log('getTriggerProps', setPageState, getPageState);
|
26
|
+
// 监听 props.mode 的变化
|
27
|
+
// const currentPageState = getPageState();
|
28
|
+
// if (props.mode === 'multiple' || props.mode === 'tags') {
|
29
|
+
// if (!Array.isArray(currentPageState?.value)) {
|
30
|
+
// // 如果 mode 是 'multiple' 或 'tags',但当前 value 不是数组,则重置 value
|
31
|
+
// setPageState({ value: props.defaultValue ?? [] });
|
32
|
+
// }
|
33
|
+
// } else {
|
34
|
+
// if (typeof currentPageState?.value !== 'string') {
|
35
|
+
// // 如果 mode 不是 'multiple' 或 'tags',但当前 value 不是字符串,则重置 value
|
36
|
+
// setPageState({ value: props.defaultValue ?? '' });
|
37
|
+
// }
|
38
|
+
// }
|
14
39
|
return {
|
15
40
|
value: (_a = getPageState()) === null || _a === void 0 ? void 0 : _a.value,
|
16
41
|
onChange(value) {
|
42
|
+
console.log('onChange', value);
|
17
43
|
setPageState({ value });
|
18
44
|
},
|
19
45
|
};
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { Typography as AntTypography } from 'antd';
|
2
2
|
import React from 'react';
|
3
3
|
export declare const Title: React.ForwardRefExoticComponent<Omit<import("antd/lib/typography/Title").TitleProps & React.RefAttributes<HTMLElement> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
4
|
+
export declare const Text: React.ForwardRefExoticComponent<Omit<import("antd/lib/typography/Text").TextProps & React.RefAttributes<HTMLSpanElement> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
4
5
|
export declare const Paragraph: React.ForwardRefExoticComponent<Omit<import("antd/lib/typography/Paragraph").ParagraphProps & React.RefAttributes<HTMLElement> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
5
6
|
type TypographyComponent = React.ForwardRefExoticComponent<any & React.RefAttributes<React.ReactElement>> & {
|
6
7
|
Title: typeof Title;
|
7
8
|
Paragraph: typeof Paragraph;
|
8
9
|
Link: typeof AntTypography.Link;
|
9
|
-
Text: typeof
|
10
|
+
Text: typeof Text;
|
10
11
|
};
|
11
12
|
export declare const Typography: TypographyComponent;
|
12
13
|
export {};
|
@@ -5,6 +5,9 @@ import { Placeholder } from './placeholder';
|
|
5
5
|
export const Title = defineComponent(AntTypography.Title, {
|
6
6
|
name: 'Title',
|
7
7
|
});
|
8
|
+
export const Text = defineComponent(AntTypography.Text, {
|
9
|
+
name: 'Text',
|
10
|
+
});
|
8
11
|
export const Paragraph = defineComponent(AntTypography.Paragraph, {
|
9
12
|
name: 'Paragraph',
|
10
13
|
});
|
@@ -19,4 +22,4 @@ export const Typography = defineComponent(AntTypography, {
|
|
19
22
|
Typography.Title = Title;
|
20
23
|
Typography.Paragraph = Paragraph;
|
21
24
|
Typography.Link = AntTypography.Link;
|
22
|
-
Typography.Text =
|
25
|
+
Typography.Text = Text;
|
package/lib/esm/index.d.ts
CHANGED
package/lib/esm/index.js
CHANGED
@@ -33,7 +33,12 @@ export const Alert = {
|
|
33
33
|
],
|
34
34
|
},
|
35
35
|
},
|
36
|
-
{
|
36
|
+
{
|
37
|
+
name: 'action',
|
38
|
+
title: '自定义操作项',
|
39
|
+
setter: 'expressionSetter',
|
40
|
+
autoCompleteOptions: [`<Button size="small" danger>Detail</Button>`],
|
41
|
+
},
|
37
42
|
{
|
38
43
|
name: 'afterClose',
|
39
44
|
title: '关闭后的回调函数',
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { InstancePrototypes
|
1
|
+
import { InstancePrototypes } from './common';
|
2
2
|
export const AutoComplete = {
|
3
3
|
name: 'AutoComplete',
|
4
4
|
title: '自动完成',
|
@@ -7,13 +7,13 @@ export const AutoComplete = {
|
|
7
7
|
help: '输入框自动完成功能,可提供输入建议/辅助提示能力',
|
8
8
|
type: 'element',
|
9
9
|
props: [
|
10
|
-
...StylePrototypes,
|
10
|
+
// ...StylePrototypes,
|
11
11
|
...InstancePrototypes,
|
12
|
-
{
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
},
|
12
|
+
// {
|
13
|
+
// name: 'width',
|
14
|
+
// title: '输入框宽度',
|
15
|
+
// setter: 'textSetter',
|
16
|
+
// },
|
17
17
|
{
|
18
18
|
name: 'allowClear',
|
19
19
|
title: '支持清除',
|
@@ -78,13 +78,13 @@ export const AutoComplete = {
|
|
78
78
|
setter: 'boolSetter',
|
79
79
|
group: 'advanced',
|
80
80
|
},
|
81
|
-
{
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
},
|
81
|
+
// {
|
82
|
+
// name: 'filterOption',
|
83
|
+
// title: '根据输入项进行筛选',
|
84
|
+
// tip: '是否根据输入项进行筛选',
|
85
|
+
// setter: 'boolSetter',
|
86
|
+
// group: 'advanced',
|
87
|
+
// },
|
88
88
|
{
|
89
89
|
name: 'getPopupContainer',
|
90
90
|
title: '菜单渲染父节点',
|
@@ -98,7 +98,11 @@ export const AutoComplete = {
|
|
98
98
|
setter: 'expressionSetter',
|
99
99
|
group: 'advanced',
|
100
100
|
},
|
101
|
-
{
|
101
|
+
{
|
102
|
+
name: 'open',
|
103
|
+
title: '展开下拉菜单',
|
104
|
+
setter: 'boolSetter'
|
105
|
+
},
|
102
106
|
{
|
103
107
|
name: 'options',
|
104
108
|
title: '下拉数据源',
|
@@ -106,9 +110,23 @@ export const AutoComplete = {
|
|
106
110
|
setter: 'expressionSetter',
|
107
111
|
initValue: [{ value: 'option1' }, { value: 'option2' }, { value: 'option3' }],
|
108
112
|
},
|
109
|
-
{
|
110
|
-
|
111
|
-
|
113
|
+
{
|
114
|
+
name: 'placeholder',
|
115
|
+
title: '输入框提示',
|
116
|
+
setter: 'textSetter',
|
117
|
+
initValue: '请在这里输入'
|
118
|
+
},
|
119
|
+
{
|
120
|
+
name: 'value',
|
121
|
+
title: '指定当前选中的条目',
|
122
|
+
setter: 'textSetter'
|
123
|
+
},
|
124
|
+
{
|
125
|
+
name: 'onBlur',
|
126
|
+
title: '失去焦点时的回调',
|
127
|
+
setter: 'actionSetter',
|
128
|
+
group: 'event'
|
129
|
+
},
|
112
130
|
{
|
113
131
|
name: 'onChange',
|
114
132
|
title: 'onChange事件',
|
@@ -116,13 +134,29 @@ export const AutoComplete = {
|
|
116
134
|
group: 'event',
|
117
135
|
autoCompleteOptions: ['(currentActiveLink)=>{}'],
|
118
136
|
},
|
137
|
+
{
|
138
|
+
name: 'filterOption',
|
139
|
+
title: '是否根据输入项进行筛选',
|
140
|
+
tip: '是否根据输入项进行筛选。当其为一个函数时,会接收 inputValue option 两个参数,当 option 符合筛选条件时,应返回 true,反之则返回 false',
|
141
|
+
setter: 'boolSetter',
|
142
|
+
autoCompleteOptions: [`(inputValue, option) => {
|
143
|
+
// 将输入值和选项值都转换为小写,进行不区分大小写的匹配
|
144
|
+
return option.value.toLowerCase().includes(inputValue.toLowerCase());
|
145
|
+
}`],
|
146
|
+
group: 'event',
|
147
|
+
},
|
119
148
|
{
|
120
149
|
name: 'onDropdownVisibleChange',
|
121
150
|
title: '展开下拉菜单的回调',
|
122
151
|
setter: 'actionSetter',
|
123
152
|
group: 'event',
|
124
153
|
},
|
125
|
-
{
|
154
|
+
{
|
155
|
+
name: 'onFocus',
|
156
|
+
title: '获得焦点时的回调',
|
157
|
+
setter: 'actionSetter',
|
158
|
+
group: 'event'
|
159
|
+
},
|
126
160
|
{
|
127
161
|
name: 'onSearch',
|
128
162
|
title: '搜索补全项的时候调用',
|
@@ -135,5 +169,22 @@ export const AutoComplete = {
|
|
135
169
|
setter: 'actionSetter',
|
136
170
|
group: 'event',
|
137
171
|
},
|
172
|
+
{
|
173
|
+
name: 'style',
|
174
|
+
title: '样式对象',
|
175
|
+
setter: 'expressionSetter',
|
176
|
+
setterProps: {
|
177
|
+
expressionType: 'cssObject',
|
178
|
+
},
|
179
|
+
group: 'style',
|
180
|
+
initValue: '{{{width: "200px"}}}',
|
181
|
+
autoCompleteOptions: ['{}'],
|
182
|
+
},
|
183
|
+
{
|
184
|
+
name: 'className',
|
185
|
+
title: '自定义样式类名',
|
186
|
+
setter: 'classNameSetter',
|
187
|
+
group: 'style',
|
188
|
+
},
|
138
189
|
],
|
139
190
|
};
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { StylePrototypes } from './common';
|
2
|
+
// import { AntdIconSetter } from '../setters';
|
2
3
|
export const Button = {
|
3
4
|
title: '按钮',
|
4
5
|
name: 'Button',
|
@@ -20,6 +21,7 @@ export const Button = {
|
|
20
21
|
{ label: '幽灵按钮', value: 'ghost' },
|
21
22
|
{ label: '虚线按钮', value: 'dashed' },
|
22
23
|
{ label: '链接按钮', value: 'link' },
|
24
|
+
{ label: '文本按钮', value: 'text' },
|
23
25
|
],
|
24
26
|
},
|
25
27
|
{
|
@@ -31,13 +33,13 @@ export const Button = {
|
|
31
33
|
{
|
32
34
|
name: 'icon',
|
33
35
|
title: '图标',
|
34
|
-
setter: '
|
35
|
-
},
|
36
|
-
{
|
37
|
-
name: 'isText',
|
38
|
-
title: '文本按钮',
|
39
|
-
setter: 'boolSetter',
|
36
|
+
setter: 'AntdIconSetter',
|
40
37
|
},
|
38
|
+
// {
|
39
|
+
// name: 'isText',
|
40
|
+
// title: '文本按钮',
|
41
|
+
// setter: 'boolSetter',
|
42
|
+
// },
|
41
43
|
{
|
42
44
|
name: 'shape',
|
43
45
|
title: '按钮形状',
|
@@ -87,7 +87,7 @@ export const Cascader = {
|
|
87
87
|
name: 'loadData',
|
88
88
|
title: '动态加载选项',
|
89
89
|
setter: 'expressionSetter',
|
90
|
-
autoCompleteOptions: ['(selectedOptions) => {} '],
|
90
|
+
autoCompleteOptions: ['(selectedOptions) => {\nconsole.log("选择", selectedOptions);\nconst targetOption = selectedOptions[selectedOptions.length - 1];\nconsole.log("targetOption", targetOption);\nsetTimeout(() => {\ntargetOption.children = [\n{ label: `${targetOption.label} Dynamic 1`, value: "dynamic1" },\n{ label: `${targetOption.label} Dynamic 2`, value: "dynamic2" },\n];\nconsole.log("targetOption1", targetOption);\nthis.setState({ optionsList: [...this.state.optionsList] });\n }, 1000);\n} '],
|
91
91
|
tip: '无法与 showSearch 一起使用',
|
92
92
|
},
|
93
93
|
],
|
@@ -2,12 +2,13 @@ export const StylePrototypes = [
|
|
2
2
|
{
|
3
3
|
name: 'style',
|
4
4
|
title: '样式对象',
|
5
|
-
setter: 'expressionSetter',
|
6
|
-
setterProps: {
|
7
|
-
|
8
|
-
},
|
5
|
+
// setter: 'expressionSetter',
|
6
|
+
// setterProps: {
|
7
|
+
// expressionType: 'cssObject',
|
8
|
+
// },
|
9
|
+
setter: 'cssSetter',
|
9
10
|
group: 'style',
|
10
|
-
autoCompleteOptions: ['{}'],
|
11
|
+
// autoCompleteOptions: ['{}'],
|
11
12
|
},
|
12
13
|
{
|
13
14
|
name: 'className',
|
@@ -11,17 +11,26 @@ export const Drawer = {
|
|
11
11
|
initChildren: '',
|
12
12
|
props: [
|
13
13
|
...StylePrototypes,
|
14
|
-
{
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
},
|
20
|
-
{
|
21
|
-
|
14
|
+
// {
|
15
|
+
// name: 'id',
|
16
|
+
// title: '弹窗 ID',
|
17
|
+
// tip: '设置弹窗 ID,可以借助 tango.openModal 轻松唤起弹窗',
|
18
|
+
// setter: 'textSetter',
|
19
|
+
// },
|
20
|
+
// {
|
21
|
+
// name: 'visible',
|
22
|
+
// title: '是否显示',
|
23
|
+
// setter: 'expressionSetter',
|
24
|
+
// group: 'basic',
|
25
|
+
// },
|
26
|
+
{
|
27
|
+
name: 'open',
|
22
28
|
title: '是否显示',
|
23
29
|
setter: 'expressionSetter',
|
24
30
|
group: 'basic',
|
31
|
+
// initValue: true,
|
32
|
+
initValue: true,
|
33
|
+
tip: '默认显示为true,也可以绑定变量如:this.state.open',
|
25
34
|
},
|
26
35
|
{
|
27
36
|
name: 'title',
|
@@ -34,18 +43,18 @@ export const Drawer = {
|
|
34
43
|
name: 'closable',
|
35
44
|
title: '是否显示关闭按钮',
|
36
45
|
setter: 'boolSetter',
|
37
|
-
|
46
|
+
initValue: true,
|
38
47
|
},
|
39
48
|
{
|
40
49
|
name: 'destroyOnClose',
|
41
50
|
title: '关闭时销毁子元素',
|
42
51
|
setter: 'boolSetter',
|
43
|
-
|
52
|
+
initValue: false,
|
44
53
|
},
|
45
54
|
{
|
46
55
|
name: 'width',
|
47
56
|
title: '宽度',
|
48
|
-
|
57
|
+
initValue: 378,
|
49
58
|
setter: 'numberSetter',
|
50
59
|
},
|
51
60
|
{
|
@@ -60,6 +69,7 @@ export const Drawer = {
|
|
60
69
|
title: '点击关闭按钮的回调',
|
61
70
|
setter: 'actionSetter',
|
62
71
|
group: 'event',
|
72
|
+
initValue: '{{() => {if(this.state.open){ this.setState({open: false})}}}}',
|
63
73
|
},
|
64
74
|
{
|
65
75
|
name: 'afterVisibleChange',
|
@@ -70,7 +80,7 @@ export const Drawer = {
|
|
70
80
|
{
|
71
81
|
name: 'placement',
|
72
82
|
title: '抽屉的方向',
|
73
|
-
|
83
|
+
initValue: 'right',
|
74
84
|
options: [
|
75
85
|
{ label: '上', value: 'top' },
|
76
86
|
{ label: '右', value: 'right' },
|
@@ -84,7 +94,7 @@ export const Drawer = {
|
|
84
94
|
name: 'size',
|
85
95
|
title: '预设尺寸',
|
86
96
|
setter: 'choiceSetter',
|
87
|
-
|
97
|
+
initValue: 'default',
|
88
98
|
options: [
|
89
99
|
{ label: '默认', value: 'default' },
|
90
100
|
{ label: '更宽', value: 'large' },
|
@@ -94,7 +104,7 @@ export const Drawer = {
|
|
94
104
|
name: 'mask',
|
95
105
|
title: '是否展示遮罩',
|
96
106
|
setter: 'boolSetter',
|
97
|
-
|
107
|
+
initValue: true,
|
98
108
|
},
|
99
109
|
{
|
100
110
|
name: 'keyboard',
|
@@ -109,7 +119,7 @@ export const Drawer = {
|
|
109
119
|
{
|
110
120
|
name: 'zIndex',
|
111
121
|
title: '设置 Drawer 的 z-index',
|
112
|
-
|
122
|
+
initValue: 1000,
|
113
123
|
setter: 'numberSetter',
|
114
124
|
group: 'advanced',
|
115
125
|
},
|