@cuvp1225/antd 0.2.64 → 0.2.66
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 +7 -7
- package/dist/index.js +6 -6
- package/lib/cjs/components/date-picker.js +20 -7
- package/lib/cjs/components/index.d.ts +1 -1
- package/lib/cjs/components/index.js +2 -1
- package/lib/cjs/components/input-number.js +23 -21
- package/lib/cjs/components/input.d.ts +2 -1
- package/lib/cjs/components/input.js +16 -1
- package/lib/cjs/components/row.js +22 -15
- package/lib/cjs/prototypes/input.js +30 -7
- package/lib/esm/components/date-picker.js +21 -8
- package/lib/esm/components/index.d.ts +1 -1
- package/lib/esm/components/index.js +1 -1
- package/lib/esm/components/input-number.js +23 -21
- package/lib/esm/components/input.d.ts +2 -1
- package/lib/esm/components/input.js +15 -0
- package/lib/esm/components/row.js +22 -15
- package/lib/esm/prototypes/input.js +30 -7
- package/package.json +3 -3
@@ -3,26 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Row1 = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
6
|
-
const styled_components_1 = require("styled-components");
|
7
|
-
const coral_system_1 = require("coral-system");
|
8
6
|
const antd_1 = require("antd");
|
9
7
|
const tango_boot_1 = require("@music163/tango-boot");
|
10
|
-
const
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
8
|
+
// const BaseRowWrapper = coral(
|
9
|
+
// 'div',
|
10
|
+
// css`
|
11
|
+
// position: relative;
|
12
|
+
// background-color: #fff;
|
13
|
+
// min-width: 600px;
|
14
|
+
// .RowNewPanelBody {
|
15
|
+
// padding: 12px;
|
16
|
+
// }
|
17
|
+
// `,
|
18
|
+
// );
|
19
|
+
const rowStyle = {
|
20
|
+
position: 'relative',
|
21
|
+
backgroundColor: '#fff',
|
22
|
+
minWidth: '600px',
|
23
|
+
};
|
24
|
+
// interface RowDesignerProps extends React.HTMLAttributes<HTMLDivElement> {
|
25
|
+
// style?: React.CSSProperties;
|
26
|
+
// children?: React.ReactNode;
|
27
|
+
// }
|
20
28
|
function RowDesigner(_a) {
|
21
29
|
var { gutter, align, justify, prefixCls, wrap, style, children } = _a, rest = tslib_1.__rest(_a, ["gutter", "align", "justify", "prefixCls", "wrap", "style", "children"]);
|
22
30
|
console.log("zcq栅格行的入参", gutter, align, justify, prefixCls, wrap, style, children);
|
23
|
-
return (react_1.default.createElement("div",
|
24
|
-
react_1.default.createElement(
|
25
|
-
react_1.default.createElement("div", null, children || react_1.default.createElement(placeholder_1.Placeholder, null)))));
|
31
|
+
return (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, rowStyle), style) },
|
32
|
+
react_1.default.createElement("div", null, children || react_1.default.createElement("div", null, "\u62D6\u5165\u7EC4\u4EF6"))));
|
26
33
|
}
|
27
34
|
exports.Row1 = (0, tango_boot_1.defineComponent)(antd_1.Row, {
|
28
35
|
name: 'Row1',
|
@@ -31,6 +31,36 @@ exports.Input = {
|
|
31
31
|
setter: 'textSetter',
|
32
32
|
group: 'basic',
|
33
33
|
},
|
34
|
+
{
|
35
|
+
name: 'type',
|
36
|
+
title: '类型',
|
37
|
+
tip: '声明 input 类型,同原生 input 标签的 type 属性',
|
38
|
+
setter: 'choiceSetter',
|
39
|
+
setterProps: {
|
40
|
+
options: [
|
41
|
+
{ label: '文本', value: 'text' },
|
42
|
+
{ label: '密码', value: 'password' },
|
43
|
+
{ label: '数字', value: 'number' },
|
44
|
+
{ label: '颜色', value: 'color' },
|
45
|
+
{ label: '电话', value: 'tel' },
|
46
|
+
{ label: '搜索', value: 'search' },
|
47
|
+
{ label: '电子邮件', value: 'email' },
|
48
|
+
{ label: '网址', value: 'url' },
|
49
|
+
{ label: '日期', value: 'date' },
|
50
|
+
{ label: '月份', value: 'month' },
|
51
|
+
{ label: '周', value: 'week' },
|
52
|
+
{ label: '时间', value: 'time' },
|
53
|
+
{ label: '日期时间', value: 'datetime-local' },
|
54
|
+
{ label: '文件', value: 'file' },
|
55
|
+
{ label: '提交', value: 'submit' },
|
56
|
+
{ label: '重置', value: 'reset' },
|
57
|
+
{ label: '图像', value: 'image' },
|
58
|
+
{ label: '按钮', value: 'button' },
|
59
|
+
{ label: '范围', value: 'range' }
|
60
|
+
],
|
61
|
+
},
|
62
|
+
group: 'basic',
|
63
|
+
},
|
34
64
|
{
|
35
65
|
name: 'maxLength',
|
36
66
|
title: '最大长度',
|
@@ -102,13 +132,6 @@ exports.Input = {
|
|
102
132
|
setter: 'iconSetter',
|
103
133
|
group: 'advanced',
|
104
134
|
},
|
105
|
-
{
|
106
|
-
name: 'type',
|
107
|
-
title: '类型',
|
108
|
-
tip: '声明 input 类型,同原生 input 标签的 type 属性',
|
109
|
-
setter: 'textSetter',
|
110
|
-
group: 'advanced',
|
111
|
-
},
|
112
135
|
{
|
113
136
|
name: 'onPressEnter',
|
114
137
|
title: '回车回调',
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { defineComponent } from '@music163/tango-boot';
|
3
|
-
import { DatePicker as AntDataPicker } from 'antd';
|
4
|
-
import zhCN from 'antd/es/locale/zh_CN';
|
5
|
-
import moment from 'moment';
|
3
|
+
import { DatePicker as AntDataPicker, ConfigProvider } from 'antd';
|
6
4
|
import 'moment/locale/zh-cn';
|
5
|
+
import locale from 'antd/es/locale/zh_CN';
|
7
6
|
import React from 'react';
|
8
|
-
moment.locale('zh-cn');
|
7
|
+
// moment.locale('zh-cn');
|
9
8
|
const local = {
|
10
9
|
"lang": {
|
11
10
|
"locale": "zh-cn",
|
@@ -39,23 +38,37 @@ const local = {
|
|
39
38
|
"previousCentury": "上一世纪",
|
40
39
|
"nextCentury": "下一世纪",
|
41
40
|
"shortWeekDays": ["日", "一", "二", "三", "四", "五", "六"],
|
42
|
-
"
|
43
|
-
"
|
41
|
+
"shortMonthDays": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
42
|
+
"longMonthDays": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
43
|
+
"monthsShort": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
44
|
+
"monthsFull": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
45
|
+
"weekStartsOn": 0,
|
46
|
+
"weekStart": 0,
|
47
|
+
"firstDayOfWeek": 0,
|
48
|
+
"timePickerColumns": {
|
49
|
+
"viewHour": "选择小时",
|
50
|
+
"viewMinute": "选择分钟",
|
51
|
+
"viewSecond": "选择秒数"
|
52
|
+
},
|
53
|
+
"yearSuffix": "年",
|
54
|
+
"weekSuffix": "周",
|
55
|
+
"monthSuffix": "月",
|
44
56
|
"weekShorter": "周",
|
45
57
|
"yearShorter": "年",
|
46
58
|
"monthShorter": "月",
|
59
|
+
"weekFormat": "YYYY-第wo周",
|
47
60
|
},
|
48
61
|
"timePickerLocale": {
|
49
62
|
"placeholder": "请选择时间"
|
50
63
|
},
|
51
64
|
"dateFormat": "YYYY-MM-DD",
|
52
65
|
"dateTimeFormat": "YYYY-MM-DD HH:mm:ss",
|
53
|
-
"weekFormat": "YYYY-wo",
|
54
66
|
"monthFormat": "YYYY-MM"
|
55
67
|
};
|
56
68
|
function DataPickerDesigner(_a) {
|
57
69
|
var { style } = _a, rest = __rest(_a, ["style"]);
|
58
|
-
return (React.createElement(
|
70
|
+
return (React.createElement(ConfigProvider, { locale: locale },
|
71
|
+
React.createElement(AntDataPicker, Object.assign({}, rest, { style: style, locale: local }))));
|
59
72
|
}
|
60
73
|
export const DatePicker = defineComponent(AntDataPicker, {
|
61
74
|
name: 'DatePicker',
|
@@ -4,7 +4,7 @@ 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, Password } from './input';
|
8
8
|
export { Modalnew } from './modal';
|
9
9
|
export * from './page';
|
10
10
|
export * from './placeholder';
|
@@ -5,7 +5,7 @@ export { Box } from './box';
|
|
5
5
|
export { Button, ButtonGroup } from './button';
|
6
6
|
export * from './formily';
|
7
7
|
export { InputNumber } from './input-number';
|
8
|
-
export { Input, TextArea } from './input';
|
8
|
+
export { Input, TextArea, Password } from './input';
|
9
9
|
export { Modalnew } from './modal';
|
10
10
|
export * from './page';
|
11
11
|
export * from './placeholder';
|
@@ -9,27 +9,29 @@ function InputNumberDesigner(_a) {
|
|
9
9
|
}
|
10
10
|
export const InputNumber = defineComponent(AntInputNumber, {
|
11
11
|
name: 'InputNumber',
|
12
|
-
designerConfig: {
|
13
|
-
|
14
|
-
|
15
|
-
},
|
16
|
-
},
|
17
|
-
// registerState: {
|
18
|
-
// getInitStates({ setPageState }, props) {
|
19
|
-
// return {
|
20
|
-
// value: props.defaultValue ?? props.value,
|
21
|
-
// setValue(value: number) {
|
22
|
-
// setPageState({ value });
|
23
|
-
// },
|
24
|
-
// };
|
25
|
-
// },
|
26
|
-
// getTriggerProps({ setPageState, getPageState }): InputNumberProps {
|
27
|
-
// return {
|
28
|
-
// value: getPageState()?.value,
|
29
|
-
// onChange(value) {
|
30
|
-
// setPageState({ value });
|
12
|
+
// designerConfig: {
|
13
|
+
// render({ designerProps, originalProps, }) {
|
14
|
+
// return <InputNumberDesigner {...designerProps} {...originalProps} />;
|
31
15
|
// },
|
32
|
-
// };
|
33
|
-
// },
|
34
16
|
// },
|
17
|
+
registerState: {
|
18
|
+
getInitStates({ setPageState }, props) {
|
19
|
+
var _a;
|
20
|
+
return {
|
21
|
+
value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : props.value,
|
22
|
+
setValue(value) {
|
23
|
+
setPageState({ value });
|
24
|
+
},
|
25
|
+
};
|
26
|
+
},
|
27
|
+
getTriggerProps({ setPageState, getPageState }) {
|
28
|
+
var _a;
|
29
|
+
return {
|
30
|
+
value: (_a = getPageState()) === null || _a === void 0 ? void 0 : _a.value,
|
31
|
+
onChange(value) {
|
32
|
+
setPageState({ value });
|
33
|
+
},
|
34
|
+
};
|
35
|
+
},
|
36
|
+
},
|
35
37
|
});
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { InputProps } from 'antd';
|
2
|
-
import { TextAreaProps } from 'antd/lib/input';
|
2
|
+
import { TextAreaProps, PasswordProps } from 'antd/lib/input';
|
3
3
|
import React from 'react';
|
4
4
|
export declare const Input: React.ForwardRefExoticComponent<Omit<InputProps & React.RefAttributes<import("antd").InputRef> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
5
5
|
export declare const TextArea: React.ForwardRefExoticComponent<Omit<TextAreaProps & React.RefAttributes<import("antd/lib/input/TextArea").TextAreaRef> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
6
|
+
export declare const Password: React.ForwardRefExoticComponent<Omit<PasswordProps & React.RefAttributes<import("antd").InputRef> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
@@ -33,3 +33,18 @@ export const TextArea = defineComponent(AntInput.TextArea, {
|
|
33
33
|
},
|
34
34
|
}
|
35
35
|
});
|
36
|
+
function PasswordDesigner(_a) {
|
37
|
+
var { style, value } = _a, rest = __rest(_a, ["style", "value"]);
|
38
|
+
if (value && value !== '') {
|
39
|
+
return React.createElement(AntInput.Password, Object.assign({ value: value }, rest, { style: style }));
|
40
|
+
}
|
41
|
+
return (React.createElement(AntInput.Password, Object.assign({}, rest, { style: style })));
|
42
|
+
}
|
43
|
+
export const Password = defineComponent(AntInput.Password, {
|
44
|
+
name: 'Password',
|
45
|
+
designerConfig: {
|
46
|
+
render({ designerProps, originalProps, }) {
|
47
|
+
return React.createElement(PasswordDesigner, Object.assign({}, designerProps, originalProps));
|
48
|
+
},
|
49
|
+
}
|
50
|
+
});
|
@@ -1,25 +1,32 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import React from 'react';
|
3
|
-
import { css } from 'styled-components';
|
4
|
-
import { coral } from 'coral-system';
|
5
3
|
import { Row as AntRow } from 'antd';
|
6
4
|
import { defineComponent } from '@music163/tango-boot';
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
5
|
+
// const BaseRowWrapper = coral(
|
6
|
+
// 'div',
|
7
|
+
// css`
|
8
|
+
// position: relative;
|
9
|
+
// background-color: #fff;
|
10
|
+
// min-width: 600px;
|
11
|
+
// .RowNewPanelBody {
|
12
|
+
// padding: 12px;
|
13
|
+
// }
|
14
|
+
// `,
|
15
|
+
// );
|
16
|
+
const rowStyle = {
|
17
|
+
position: 'relative',
|
18
|
+
backgroundColor: '#fff',
|
19
|
+
minWidth: '600px',
|
20
|
+
};
|
21
|
+
// interface RowDesignerProps extends React.HTMLAttributes<HTMLDivElement> {
|
22
|
+
// style?: React.CSSProperties;
|
23
|
+
// children?: React.ReactNode;
|
24
|
+
// }
|
17
25
|
function RowDesigner(_a) {
|
18
26
|
var { gutter, align, justify, prefixCls, wrap, style, children } = _a, rest = __rest(_a, ["gutter", "align", "justify", "prefixCls", "wrap", "style", "children"]);
|
19
27
|
console.log("zcq栅格行的入参", gutter, align, justify, prefixCls, wrap, style, children);
|
20
|
-
return (React.createElement("div",
|
21
|
-
React.createElement(
|
22
|
-
React.createElement("div", null, children || React.createElement(Placeholder, null)))));
|
28
|
+
return (React.createElement("div", { style: Object.assign(Object.assign({}, rowStyle), style) },
|
29
|
+
React.createElement("div", null, children || React.createElement("div", null, "\u62D6\u5165\u7EC4\u4EF6"))));
|
23
30
|
}
|
24
31
|
export const Row1 = defineComponent(AntRow, {
|
25
32
|
name: 'Row1',
|
@@ -28,6 +28,36 @@ export const Input = {
|
|
28
28
|
setter: 'textSetter',
|
29
29
|
group: 'basic',
|
30
30
|
},
|
31
|
+
{
|
32
|
+
name: 'type',
|
33
|
+
title: '类型',
|
34
|
+
tip: '声明 input 类型,同原生 input 标签的 type 属性',
|
35
|
+
setter: 'choiceSetter',
|
36
|
+
setterProps: {
|
37
|
+
options: [
|
38
|
+
{ label: '文本', value: 'text' },
|
39
|
+
{ label: '密码', value: 'password' },
|
40
|
+
{ label: '数字', value: 'number' },
|
41
|
+
{ label: '颜色', value: 'color' },
|
42
|
+
{ label: '电话', value: 'tel' },
|
43
|
+
{ label: '搜索', value: 'search' },
|
44
|
+
{ label: '电子邮件', value: 'email' },
|
45
|
+
{ label: '网址', value: 'url' },
|
46
|
+
{ label: '日期', value: 'date' },
|
47
|
+
{ label: '月份', value: 'month' },
|
48
|
+
{ label: '周', value: 'week' },
|
49
|
+
{ label: '时间', value: 'time' },
|
50
|
+
{ label: '日期时间', value: 'datetime-local' },
|
51
|
+
{ label: '文件', value: 'file' },
|
52
|
+
{ label: '提交', value: 'submit' },
|
53
|
+
{ label: '重置', value: 'reset' },
|
54
|
+
{ label: '图像', value: 'image' },
|
55
|
+
{ label: '按钮', value: 'button' },
|
56
|
+
{ label: '范围', value: 'range' }
|
57
|
+
],
|
58
|
+
},
|
59
|
+
group: 'basic',
|
60
|
+
},
|
31
61
|
{
|
32
62
|
name: 'maxLength',
|
33
63
|
title: '最大长度',
|
@@ -99,13 +129,6 @@ export const Input = {
|
|
99
129
|
setter: 'iconSetter',
|
100
130
|
group: 'advanced',
|
101
131
|
},
|
102
|
-
{
|
103
|
-
name: 'type',
|
104
|
-
title: '类型',
|
105
|
-
tip: '声明 input 类型,同原生 input 标签的 type 属性',
|
106
|
-
setter: 'textSetter',
|
107
|
-
group: 'advanced',
|
108
|
-
},
|
109
132
|
{
|
110
133
|
name: 'onPressEnter',
|
111
134
|
title: '回车回调',
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@cuvp1225/antd",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.66",
|
4
4
|
"description": "antd components for tango app",
|
5
5
|
"author": "wwsun <ww.sww@outlook.com>",
|
6
6
|
"homepage": "https://github.com/netease/tango-components#readme",
|
@@ -48,11 +48,11 @@
|
|
48
48
|
"dependencies": {
|
49
49
|
"@cuvp1225/formily": "^0.2.6",
|
50
50
|
"@cuvp1225/foundation": "^0.3.2",
|
51
|
-
"@music163/tango-boot": "
|
51
|
+
"@music163/tango-boot": "0.3.5",
|
52
52
|
"@music163/tango-helpers": "1.2.8",
|
53
53
|
"antd": "4",
|
54
54
|
"classnames": "^2.3.2",
|
55
55
|
"coral-system": "^1.0.6"
|
56
56
|
},
|
57
|
-
"gitHead": "
|
57
|
+
"gitHead": "bf402891b59d6ae0b03bfc513d9579e6940befe5"
|
58
58
|
}
|