@cuvp1225/antd 0.1.3 → 0.1.4
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 +2682 -665
- package/dist/index.js +2663 -651
- package/lib/cjs/components/index.d.ts +2 -1
- package/lib/cjs/components/index.js +17 -1
- package/lib/cjs/components/placeholder.d.ts +24 -0
- package/lib/cjs/components/placeholder.js +48 -0
- package/lib/esm/components/index.d.ts +2 -1
- package/lib/esm/components/index.js +2 -1
- package/lib/esm/components/placeholder.d.ts +24 -0
- package/lib/esm/components/placeholder.js +45 -0
- package/package.json +1 -1
@@ -1 +1,2 @@
|
|
1
|
-
export { Row, Col, Timeline, Table } from 'antd';
|
1
|
+
export { Row, Col, Timeline, Table, Typography, Breadcrumb, Menu, Form, Collapse, Descriptions, List, Popover, Statistic, Tabs, Tag, Tooltip, Popconfirm, Anchor } from 'antd';
|
2
|
+
export * from './placeholder';
|
@@ -1,8 +1,24 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Table = exports.Timeline = exports.Col = exports.Row = void 0;
|
3
|
+
exports.Anchor = exports.Popconfirm = exports.Tooltip = exports.Tag = exports.Tabs = exports.Statistic = exports.Popover = exports.List = exports.Descriptions = exports.Collapse = exports.Form = exports.Menu = exports.Breadcrumb = exports.Typography = exports.Table = exports.Timeline = exports.Col = exports.Row = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
4
5
|
var antd_1 = require("antd");
|
5
6
|
Object.defineProperty(exports, "Row", { enumerable: true, get: function () { return antd_1.Row; } });
|
6
7
|
Object.defineProperty(exports, "Col", { enumerable: true, get: function () { return antd_1.Col; } });
|
7
8
|
Object.defineProperty(exports, "Timeline", { enumerable: true, get: function () { return antd_1.Timeline; } });
|
8
9
|
Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return antd_1.Table; } });
|
10
|
+
Object.defineProperty(exports, "Typography", { enumerable: true, get: function () { return antd_1.Typography; } });
|
11
|
+
Object.defineProperty(exports, "Breadcrumb", { enumerable: true, get: function () { return antd_1.Breadcrumb; } });
|
12
|
+
Object.defineProperty(exports, "Menu", { enumerable: true, get: function () { return antd_1.Menu; } });
|
13
|
+
Object.defineProperty(exports, "Form", { enumerable: true, get: function () { return antd_1.Form; } });
|
14
|
+
Object.defineProperty(exports, "Collapse", { enumerable: true, get: function () { return antd_1.Collapse; } });
|
15
|
+
Object.defineProperty(exports, "Descriptions", { enumerable: true, get: function () { return antd_1.Descriptions; } });
|
16
|
+
Object.defineProperty(exports, "List", { enumerable: true, get: function () { return antd_1.List; } });
|
17
|
+
Object.defineProperty(exports, "Popover", { enumerable: true, get: function () { return antd_1.Popover; } });
|
18
|
+
Object.defineProperty(exports, "Statistic", { enumerable: true, get: function () { return antd_1.Statistic; } });
|
19
|
+
Object.defineProperty(exports, "Tabs", { enumerable: true, get: function () { return antd_1.Tabs; } });
|
20
|
+
Object.defineProperty(exports, "Tag", { enumerable: true, get: function () { return antd_1.Tag; } });
|
21
|
+
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return antd_1.Tooltip; } });
|
22
|
+
Object.defineProperty(exports, "Popconfirm", { enumerable: true, get: function () { return antd_1.Popconfirm; } });
|
23
|
+
Object.defineProperty(exports, "Anchor", { enumerable: true, get: function () { return antd_1.Anchor; } });
|
24
|
+
tslib_1.__exportStar(require("./placeholder"), exports);
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { BoxProps } from '@music163/foundation';
|
3
|
+
export interface PlaceholderProps extends BoxProps {
|
4
|
+
/**
|
5
|
+
* 尺寸
|
6
|
+
* small - 适合文本,按钮等小型控件
|
7
|
+
* medium - 中型控件
|
8
|
+
* large - 大型控件
|
9
|
+
*/
|
10
|
+
size?: 'small' | 'medium' | 'large';
|
11
|
+
/**
|
12
|
+
* 占位文本
|
13
|
+
*/
|
14
|
+
placeholder?: string;
|
15
|
+
/**
|
16
|
+
* 按钮文本
|
17
|
+
*/
|
18
|
+
buttonText?: string;
|
19
|
+
/**
|
20
|
+
* 要实例化的组件名称
|
21
|
+
*/
|
22
|
+
targetComponentName?: string;
|
23
|
+
}
|
24
|
+
export declare const Placeholder: React.ForwardRefExoticComponent<PlaceholderProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Placeholder = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
6
|
+
const coral_system_1 = require("coral-system");
|
7
|
+
const foundation_1 = require("@music163/foundation");
|
8
|
+
const tango_boot_1 = require("@music163/tango-boot");
|
9
|
+
const placeholderStyle = (0, coral_system_1.css) `
|
10
|
+
display: flex;
|
11
|
+
flex-direction: column;
|
12
|
+
align-items: center;
|
13
|
+
justify-content: center;
|
14
|
+
background-color: #efefef;
|
15
|
+
color: #333;
|
16
|
+
border: 1px solid #666;
|
17
|
+
padding-left: 12px;
|
18
|
+
padding-right: 12px;
|
19
|
+
user-select: none;
|
20
|
+
overflow: hidden;
|
21
|
+
white-space: nowrap;
|
22
|
+
|
23
|
+
& ~ .tango-placeholder {
|
24
|
+
margin-top: 12px;
|
25
|
+
}
|
26
|
+
`;
|
27
|
+
const sizeMap = {
|
28
|
+
small: '32px',
|
29
|
+
medium: '64px',
|
30
|
+
large: '80px',
|
31
|
+
};
|
32
|
+
function PlaceholderView(_a) {
|
33
|
+
var { size = 'medium',
|
34
|
+
//placeholder = '点击或拖拽组件/区块到这里',
|
35
|
+
placeholder = '点击或拖拽组件/区块到这里' } = _a, rest = tslib_1.__rest(_a, ["size", "placeholder"]);
|
36
|
+
const height = sizeMap[size];
|
37
|
+
//console.log('zcq-PlaceholderView01', rest);
|
38
|
+
//去除rest里的dnd-id属性,解决row等容器组件能否直接选中问题(方案废弃,会导致占位符无法被替换)
|
39
|
+
// const newRest = Object.keys(rest)
|
40
|
+
// .filter(key => key !== "data-dnd")
|
41
|
+
// .reduce((acc, key) => {
|
42
|
+
// acc[key as keyof typeof rest] = rest[key as keyof typeof rest];
|
43
|
+
// return acc;
|
44
|
+
// }, {} as { [key: string]: any });
|
45
|
+
// console.log('zcq-PlaceholderView02', newRest);
|
46
|
+
return (react_1.default.createElement(foundation_1.Box, Object.assign({ className: "tango-placeholder", height: height, css: placeholderStyle }, rest), placeholder));
|
47
|
+
}
|
48
|
+
exports.Placeholder = (0, tango_boot_1.defineComponent)(PlaceholderView);
|
@@ -1 +1,2 @@
|
|
1
|
-
export { Row, Col, Timeline, Table } from 'antd';
|
1
|
+
export { Row, Col, Timeline, Table, Typography, Breadcrumb, Menu, Form, Collapse, Descriptions, List, Popover, Statistic, Tabs, Tag, Tooltip, Popconfirm, Anchor } from 'antd';
|
2
|
+
export * from './placeholder';
|
@@ -1 +1,2 @@
|
|
1
|
-
export { Row, Col, Timeline, Table } from 'antd';
|
1
|
+
export { Row, Col, Timeline, Table, Typography, Breadcrumb, Menu, Form, Collapse, Descriptions, List, Popover, Statistic, Tabs, Tag, Tooltip, Popconfirm, Anchor } from 'antd';
|
2
|
+
export * from './placeholder';
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { BoxProps } from '@music163/foundation';
|
3
|
+
export interface PlaceholderProps extends BoxProps {
|
4
|
+
/**
|
5
|
+
* 尺寸
|
6
|
+
* small - 适合文本,按钮等小型控件
|
7
|
+
* medium - 中型控件
|
8
|
+
* large - 大型控件
|
9
|
+
*/
|
10
|
+
size?: 'small' | 'medium' | 'large';
|
11
|
+
/**
|
12
|
+
* 占位文本
|
13
|
+
*/
|
14
|
+
placeholder?: string;
|
15
|
+
/**
|
16
|
+
* 按钮文本
|
17
|
+
*/
|
18
|
+
buttonText?: string;
|
19
|
+
/**
|
20
|
+
* 要实例化的组件名称
|
21
|
+
*/
|
22
|
+
targetComponentName?: string;
|
23
|
+
}
|
24
|
+
export declare const Placeholder: React.ForwardRefExoticComponent<PlaceholderProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import React from 'react';
|
3
|
+
import { css } from 'coral-system';
|
4
|
+
import { Box } from '@music163/foundation';
|
5
|
+
import { defineComponent } from '@music163/tango-boot';
|
6
|
+
const placeholderStyle = css `
|
7
|
+
display: flex;
|
8
|
+
flex-direction: column;
|
9
|
+
align-items: center;
|
10
|
+
justify-content: center;
|
11
|
+
background-color: #efefef;
|
12
|
+
color: #333;
|
13
|
+
border: 1px solid #666;
|
14
|
+
padding-left: 12px;
|
15
|
+
padding-right: 12px;
|
16
|
+
user-select: none;
|
17
|
+
overflow: hidden;
|
18
|
+
white-space: nowrap;
|
19
|
+
|
20
|
+
& ~ .tango-placeholder {
|
21
|
+
margin-top: 12px;
|
22
|
+
}
|
23
|
+
`;
|
24
|
+
const sizeMap = {
|
25
|
+
small: '32px',
|
26
|
+
medium: '64px',
|
27
|
+
large: '80px',
|
28
|
+
};
|
29
|
+
function PlaceholderView(_a) {
|
30
|
+
var { size = 'medium',
|
31
|
+
//placeholder = '点击或拖拽组件/区块到这里',
|
32
|
+
placeholder = '点击或拖拽组件/区块到这里' } = _a, rest = __rest(_a, ["size", "placeholder"]);
|
33
|
+
const height = sizeMap[size];
|
34
|
+
//console.log('zcq-PlaceholderView01', rest);
|
35
|
+
//去除rest里的dnd-id属性,解决row等容器组件能否直接选中问题(方案废弃,会导致占位符无法被替换)
|
36
|
+
// const newRest = Object.keys(rest)
|
37
|
+
// .filter(key => key !== "data-dnd")
|
38
|
+
// .reduce((acc, key) => {
|
39
|
+
// acc[key as keyof typeof rest] = rest[key as keyof typeof rest];
|
40
|
+
// return acc;
|
41
|
+
// }, {} as { [key: string]: any });
|
42
|
+
// console.log('zcq-PlaceholderView02', newRest);
|
43
|
+
return (React.createElement(Box, Object.assign({ className: "tango-placeholder", height: height, css: placeholderStyle }, rest), placeholder));
|
44
|
+
}
|
45
|
+
export const Placeholder = defineComponent(PlaceholderView);
|