@cuvp1225/antd 0.2.65 → 0.2.67

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.
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
- import { RowProps } from 'antd';
3
- export declare const Row1: React.ForwardRefExoticComponent<Omit<RowProps & React.RefAttributes<HTMLDivElement> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
2
+ export declare const Row1: React.ForwardRefExoticComponent<Omit<import("coral-system/dist/esm/types").OmitCommonProps<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("coral-system").CoralProps> & import("coral-system").CoralProps & import("coral-system/dist/esm/types").OmitCommonProps<any, keyof import("coral-system").CoralProps> & {
3
+ as?: import("coral-system/dist/esm/types").As<any>;
4
+ } & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
@@ -3,31 +3,45 @@ 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
6
  const coral_system_1 = require("coral-system");
8
- const antd_1 = require("antd");
9
7
  const tango_boot_1 = require("@music163/tango-boot");
10
- const placeholder_1 = require("./placeholder");
11
- const BaseRowWrapper = (0, coral_system_1.coral)('div', (0, styled_components_1.css) `
12
- position: relative;
13
- background-color: #fff;
14
- min-width: 600px;
15
-
16
- .RowNewPanelBody {
17
- padding: 12px;
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
- console.log("zcq栅格行的入参", gutter, align, justify, prefixCls, wrap, style, children);
23
- return (react_1.default.createElement("div", { style: { position: "relative", backgroundColor: "#fff", minWidth: "600px" } },
24
- react_1.default.createElement("div", null, children || react_1.default.createElement(placeholder_1.Placeholder, null))));
30
+ //console.log("zcq栅格行的入参",gutter,align,justify,prefixCls,wrap,style,children);
31
+ const mergedStyle = react_1.default.useMemo(() => (Object.assign(Object.assign({}, rowStyle), style)), [style]);
32
+ return (react_1.default.createElement("div", { style: Object.assign({}, mergedStyle) },
33
+ react_1.default.createElement("div", null, children || react_1.default.createElement("div", null, "\u62D6\u5165\u7EC4\u4EF6"))));
25
34
  }
26
- exports.Row1 = (0, tango_boot_1.defineComponent)(antd_1.Row, {
35
+ const Div = (0, coral_system_1.coral)('div', undefined, {
36
+ prefix: '--music',
37
+ });
38
+ const MemoizedRowDesigner = react_1.default.memo(RowDesigner);
39
+ exports.Row1 = (0, tango_boot_1.defineComponent)(Div, {
27
40
  name: 'Row1',
28
41
  designerConfig: {
29
42
  render({ designerProps, originalProps }) {
30
- return react_1.default.createElement(RowDesigner, Object.assign({}, designerProps, originalProps));
43
+ //return <RowDesigner {...designerProps} {...originalProps} />;
44
+ return react_1.default.createElement(MemoizedRowDesigner, Object.assign({}, designerProps, originalProps));
31
45
  },
32
46
  },
33
47
  });
@@ -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
- "shortMonths": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
43
- "longMonths": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
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(AntDataPicker, Object.assign({}, rest, { style: style, locale: zhCN })));
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
- render({ designerProps, originalProps, }) {
14
- return React.createElement(InputNumberDesigner, Object.assign({}, designerProps, originalProps));
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,3 +1,4 @@
1
1
  import React from 'react';
2
- import { RowProps } from 'antd';
3
- export declare const Row1: React.ForwardRefExoticComponent<Omit<RowProps & React.RefAttributes<HTMLDivElement> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
2
+ export declare const Row1: React.ForwardRefExoticComponent<Omit<import("coral-system/dist/esm/types").OmitCommonProps<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("coral-system").CoralProps> & import("coral-system").CoralProps & import("coral-system/dist/esm/types").OmitCommonProps<any, keyof import("coral-system").CoralProps> & {
3
+ as?: import("coral-system/dist/esm/types").As<any>;
4
+ } & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
@@ -1,30 +1,44 @@
1
1
  import { __rest } from "tslib";
2
2
  import React from 'react';
3
- import { css } from 'styled-components';
4
3
  import { coral } from 'coral-system';
5
- import { Row as AntRow } from 'antd';
6
4
  import { defineComponent } from '@music163/tango-boot';
7
- import { Placeholder } from './placeholder';
8
- const BaseRowWrapper = coral('div', css `
9
- position: relative;
10
- background-color: #fff;
11
- min-width: 600px;
12
-
13
- .RowNewPanelBody {
14
- padding: 12px;
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
- console.log("zcq栅格行的入参", gutter, align, justify, prefixCls, wrap, style, children);
20
- return (React.createElement("div", { style: { position: "relative", backgroundColor: "#fff", minWidth: "600px" } },
21
- React.createElement("div", null, children || React.createElement(Placeholder, null))));
27
+ //console.log("zcq栅格行的入参",gutter,align,justify,prefixCls,wrap,style,children);
28
+ const mergedStyle = React.useMemo(() => (Object.assign(Object.assign({}, rowStyle), style)), [style]);
29
+ return (React.createElement("div", { style: Object.assign({}, mergedStyle) },
30
+ React.createElement("div", null, children || React.createElement("div", null, "\u62D6\u5165\u7EC4\u4EF6"))));
22
31
  }
23
- export const Row1 = defineComponent(AntRow, {
32
+ const Div = coral('div', undefined, {
33
+ prefix: '--music',
34
+ });
35
+ const MemoizedRowDesigner = React.memo(RowDesigner);
36
+ export const Row1 = defineComponent(Div, {
24
37
  name: 'Row1',
25
38
  designerConfig: {
26
39
  render({ designerProps, originalProps }) {
27
- return React.createElement(RowDesigner, Object.assign({}, designerProps, originalProps));
40
+ //return <RowDesigner {...designerProps} {...originalProps} />;
41
+ return React.createElement(MemoizedRowDesigner, Object.assign({}, designerProps, originalProps));
28
42
  },
29
43
  },
30
44
  });
@@ -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.65",
3
+ "version": "0.2.67",
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": "^0.3.3",
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": "1d5023197662f518fc4e24b3b79da8ae004c41fe"
57
+ "gitHead": "50729b648123837cefa6bdc9a586e754f36be6b6"
58
58
  }