@cuvp1225/antd 0.1.19-beta.38 → 0.1.19-beta.39
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 +26 -4
- package/dist/index.js +26 -4
- package/lib/cjs/components/index.d.ts +2 -0
- package/lib/cjs/components/index.js +6 -1
- package/lib/cjs/components/select.js +0 -16
- package/lib/cjs/components/table1.js +0 -3
- package/lib/cjs/components/uniRadio/uniradio.d.ts +12 -0
- package/lib/cjs/components/uniRadio/uniradio.js +131 -0
- package/lib/cjs/components/uniSwitch/uniswitch.d.ts +7 -0
- package/lib/cjs/components/uniSwitch/uniswitch.js +39 -0
- package/lib/esm/components/index.d.ts +2 -0
- package/lib/esm/components/index.js +2 -0
- package/lib/esm/components/select.js +0 -16
- package/lib/esm/components/table1.js +0 -3
- package/lib/esm/components/uniRadio/uniradio.d.ts +12 -0
- package/lib/esm/components/uniRadio/uniradio.js +126 -0
- package/lib/esm/components/uniSwitch/uniswitch.d.ts +7 -0
- package/lib/esm/components/uniSwitch/uniswitch.js +35 -0
- package/package.json +2 -2
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.UniSwitch = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const antd_1 = require("antd");
|
6
|
+
const slottype_1 = require("../../helpers/slottype");
|
7
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
8
|
+
const UniSwitch = (_a) => {
|
9
|
+
var _b = slottype_1.SLOT.dnd, dataDnd = _a[_b], _c = slottype_1.SLOT.id, dataId = _a[_c], { style, theme } = _a, rest = tslib_1.__rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style", "theme"]);
|
10
|
+
const redCss = `
|
11
|
+
/* 根据tid定制Switch组件样式 */
|
12
|
+
.uni-switch[tid="${rest.tid}"].ant-switch-checked {
|
13
|
+
background-color: #B30000;
|
14
|
+
}
|
15
|
+
`;
|
16
|
+
const blueCss = `
|
17
|
+
/* 根据tid定制Switch组件样式 */
|
18
|
+
.uni-switch[tid="${rest.tid}"].ant-switch-checked {
|
19
|
+
background-color: #1890ff;
|
20
|
+
}
|
21
|
+
`;
|
22
|
+
const greenCss = `
|
23
|
+
/* 根据tid定制Switch组件样式 */
|
24
|
+
.uni-switch[tid="${rest.tid}"].ant-switch-checked {
|
25
|
+
background-color: #17c60e;
|
26
|
+
}
|
27
|
+
`;
|
28
|
+
(0, react_1.useEffect)(() => {
|
29
|
+
const allow = ['blue', 'green', 'red'];
|
30
|
+
if (allow.includes(theme)) {
|
31
|
+
const css = theme === 'blue' ? blueCss : theme === 'green' ? greenCss : redCss;
|
32
|
+
const style = document.createElement('style');
|
33
|
+
style.innerHTML = css;
|
34
|
+
document.head.appendChild(style);
|
35
|
+
}
|
36
|
+
}, [theme]);
|
37
|
+
return (react_1.default.createElement(antd_1.Switch, Object.assign({ className: `uni-${rest.tid} ${theme ? `theme-${theme}` : ''}`, "data-dnd": dataDnd, "data-id": rest.tid, style: style }, rest)));
|
38
|
+
};
|
39
|
+
exports.UniSwitch = UniSwitch;
|
@@ -58,3 +58,5 @@ export { UniButton, UniButtonGroup } from './uniButton/unibutton';
|
|
58
58
|
export { Steps } from './steps';
|
59
59
|
export { UniModal } from './uniModal/unimodal';
|
60
60
|
export { UniUpload } from './uniUpload/uniupload';
|
61
|
+
export { UniRadio, UniRadioGroup } from './uniRadio/uniradio';
|
62
|
+
export { UniSwitch } from './uniSwitch/uniswitch';
|
@@ -85,3 +85,5 @@ export { UniButton, UniButtonGroup } from './uniButton/unibutton';
|
|
85
85
|
export { Steps } from './steps';
|
86
86
|
export { UniModal } from './uniModal/unimodal';
|
87
87
|
export { UniUpload } from './uniUpload/uniupload';
|
88
|
+
export { UniRadio, UniRadioGroup } from './uniRadio/uniradio';
|
89
|
+
export { UniSwitch } from './uniSwitch/uniswitch';
|
@@ -15,25 +15,9 @@ export const Select = defineComponent(AntSelect, {
|
|
15
15
|
value: (_b = props.defaultValue) !== null && _b !== void 0 ? _b : '',
|
16
16
|
};
|
17
17
|
}
|
18
|
-
// return {
|
19
|
-
// value: props.defaultValue ?? '',
|
20
|
-
// };
|
21
18
|
},
|
22
19
|
getTriggerProps({ setPageState, getPageState }) {
|
23
20
|
var _a;
|
24
|
-
// 监听 props.mode 的变化
|
25
|
-
// const currentPageState = getPageState();
|
26
|
-
// if (props.mode === 'multiple' || props.mode === 'tags') {
|
27
|
-
// if (!Array.isArray(currentPageState?.value)) {
|
28
|
-
// // 如果 mode 是 'multiple' 或 'tags',但当前 value 不是数组,则重置 value
|
29
|
-
// setPageState({ value: props.defaultValue ?? [] });
|
30
|
-
// }
|
31
|
-
// } else {
|
32
|
-
// if (typeof currentPageState?.value !== 'string') {
|
33
|
-
// // 如果 mode 不是 'multiple' 或 'tags',但当前 value 不是字符串,则重置 value
|
34
|
-
// setPageState({ value: props.defaultValue ?? '' });
|
35
|
-
// }
|
36
|
-
// }
|
37
21
|
return {
|
38
22
|
value: (_a = getPageState()) === null || _a === void 0 ? void 0 : _a.value,
|
39
23
|
onChange(value) {
|
@@ -1,11 +1,8 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { Table as AntTable } from 'antd';
|
3
3
|
import React from 'react';
|
4
|
-
//import { SLOT } from '@music163/tango-helpers';
|
5
4
|
import { SLOT } from '../helpers/slottype';
|
6
5
|
export const Table = (_a) => {
|
7
|
-
//const newProps = {...rest, ...{draggable:true}}
|
8
|
-
//console.log("新的表格组件01",newProps);
|
9
6
|
var _b = SLOT.id, dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
10
7
|
return (React.createElement("div", { "data-dnd": dataDnd, "data-id": dataId, draggable: true, style: style },
|
11
8
|
React.createElement(AntTable, Object.assign({}, rest))));
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { RadioProps, RadioGroupProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
export declare const UniRadio: ({ [SLOT.dnd]: dataDnd, [SLOT.id]: dataId, style, theme, ...rest }: RadioProps & {
|
4
|
+
[key: string]: any;
|
5
|
+
dnd?: string;
|
6
|
+
children?: React.ReactNode;
|
7
|
+
}) => React.JSX.Element;
|
8
|
+
export declare const UniRadioGroup: ({ [SLOT.dnd]: dataDnd, [SLOT.id]: dataId, style, theme, ...rest }: RadioGroupProps & {
|
9
|
+
[key: string]: any;
|
10
|
+
dnd?: string;
|
11
|
+
children?: React.ReactNode;
|
12
|
+
}) => React.JSX.Element;
|
@@ -0,0 +1,126 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Radio as AntdRadio } from 'antd';
|
3
|
+
import { SLOT } from "../../helpers/slottype";
|
4
|
+
import React, { useEffect } from 'react';
|
5
|
+
export const UniRadio = (_a) => {
|
6
|
+
var _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style, theme } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style", "theme"]);
|
7
|
+
const redCss = `
|
8
|
+
/* 悬停时圆圈变红 */
|
9
|
+
.uni-${rest.tid}:hover .ant-radio-inner {
|
10
|
+
border-color: #B30000 !important;
|
11
|
+
}
|
12
|
+
|
13
|
+
/* 选中状态 - 边框变红 */
|
14
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner {
|
15
|
+
border-color: #B30000 !important;
|
16
|
+
}
|
17
|
+
|
18
|
+
/* 选中状态 - 中心点变红(覆盖整个内圆) */
|
19
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner::after {
|
20
|
+
background-color: #B30000 !important;
|
21
|
+
}
|
22
|
+
`;
|
23
|
+
const blueCss = `
|
24
|
+
/* 悬停时圆圈变蓝 */
|
25
|
+
.uni-${rest.tid}:hover .ant-radio-inner {
|
26
|
+
border-color: #1890ff !important;
|
27
|
+
}
|
28
|
+
|
29
|
+
/* 选中状态 - 边框变蓝 */
|
30
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner {
|
31
|
+
border-color: #1890ff !important;
|
32
|
+
}
|
33
|
+
|
34
|
+
/* 选中状态 - 中心点变蓝(覆盖整个内圆) */
|
35
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner::after {
|
36
|
+
background-color: #1890ff !important;
|
37
|
+
}
|
38
|
+
`;
|
39
|
+
const greenCss = `
|
40
|
+
/* 悬停时圆圈变绿 */
|
41
|
+
.uni-${rest.tid}:hover .ant-radio-inner {
|
42
|
+
border-color: #17c60e !important;
|
43
|
+
}
|
44
|
+
|
45
|
+
/* 选中状态 - 边框变绿 */
|
46
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner {
|
47
|
+
border-color: #17c60e !important;
|
48
|
+
}
|
49
|
+
|
50
|
+
/* 选中状态 - 中心点变绿(覆盖整个内圆) */
|
51
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner::after {
|
52
|
+
background-color: #17c60e !important;
|
53
|
+
}
|
54
|
+
`;
|
55
|
+
useEffect(() => {
|
56
|
+
const allow = ['blue', 'green', 'red'];
|
57
|
+
if (allow.includes(theme)) {
|
58
|
+
const css = theme === 'blue' ? blueCss : theme === 'green' ? greenCss : redCss;
|
59
|
+
const style = document.createElement('style');
|
60
|
+
style.innerHTML = css;
|
61
|
+
document.head.appendChild(style);
|
62
|
+
}
|
63
|
+
}, [theme]);
|
64
|
+
return (React.createElement(AntdRadio, Object.assign({ className: `uni-${rest.tid} ${theme ? `theme-${theme}` : ''}`, "data-dnd": dataDnd, "data-id": rest.tid, style: style }, rest)));
|
65
|
+
};
|
66
|
+
export const UniRadioGroup = (_a) => {
|
67
|
+
var _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style, theme } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style", "theme"]);
|
68
|
+
const redCss = `
|
69
|
+
/* 悬停时圆圈变红 */
|
70
|
+
.uni-${rest.tid}:hover .ant-radio-inner {
|
71
|
+
border-color: #B30000 !important;
|
72
|
+
}
|
73
|
+
|
74
|
+
/* 选中状态 - 边框变红 */
|
75
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner {
|
76
|
+
border-color: #B30000 !important;
|
77
|
+
}
|
78
|
+
|
79
|
+
/* 选中状态 - 中心点变红(覆盖整个内圆) */
|
80
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner::after {
|
81
|
+
background-color: #B30000 !important;
|
82
|
+
}
|
83
|
+
`;
|
84
|
+
const blueCss = `
|
85
|
+
/* 悬停时圆圈变蓝 */
|
86
|
+
.uni-${rest.tid}:hover .ant-radio-inner {
|
87
|
+
border-color: #1890ff !important;
|
88
|
+
}
|
89
|
+
|
90
|
+
/* 选中状态 - 边框变蓝 */
|
91
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner {
|
92
|
+
border-color: #1890ff !important;
|
93
|
+
}
|
94
|
+
|
95
|
+
/* 选中状态 - 中心点变蓝(覆盖整个内圆) */
|
96
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner::after {
|
97
|
+
background-color: #1890ff !important;
|
98
|
+
}
|
99
|
+
`;
|
100
|
+
const greenCss = `
|
101
|
+
/* 悬停时圆圈变绿 */
|
102
|
+
.uni-${rest.tid}:hover .ant-radio-inner {
|
103
|
+
border-color: #17c60e !important;
|
104
|
+
}
|
105
|
+
|
106
|
+
/* 选中状态 - 边框变绿 */
|
107
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner {
|
108
|
+
border-color: #17c60e !important;
|
109
|
+
}
|
110
|
+
|
111
|
+
/* 选中状态 - 中心点变绿(覆盖整个内圆) */
|
112
|
+
.uni-${rest.tid} .ant-radio-input:checked + .ant-radio-inner::after {
|
113
|
+
background-color: #17c60e !important;
|
114
|
+
}
|
115
|
+
`;
|
116
|
+
useEffect(() => {
|
117
|
+
const allow = ['blue', 'green', 'red'];
|
118
|
+
if (allow.includes(theme)) {
|
119
|
+
const css = theme === 'blue' ? blueCss : theme === 'green' ? greenCss : redCss;
|
120
|
+
const style = document.createElement('style');
|
121
|
+
style.innerHTML = css;
|
122
|
+
document.head.appendChild(style);
|
123
|
+
}
|
124
|
+
}, [theme]);
|
125
|
+
return (React.createElement(AntdRadio.Group, Object.assign({ className: `uni-${dataId} ${theme ? `theme-${theme}` : ''}`, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), rest.children));
|
126
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { SwitchProps } from "antd";
|
2
|
+
import React from 'react';
|
3
|
+
export declare const UniSwitch: ({ [SLOT.dnd]: dataDnd, [SLOT.id]: dataId, style, theme, ...rest }: SwitchProps & {
|
4
|
+
[key: string]: any;
|
5
|
+
dnd?: string;
|
6
|
+
children?: React.ReactNode;
|
7
|
+
}) => React.JSX.Element;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Switch as AntdSwitch } from "antd";
|
3
|
+
import { SLOT } from "../../helpers/slottype";
|
4
|
+
import React, { useEffect } from 'react';
|
5
|
+
export const UniSwitch = (_a) => {
|
6
|
+
var _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style, theme } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style", "theme"]);
|
7
|
+
const redCss = `
|
8
|
+
/* 根据tid定制Switch组件样式 */
|
9
|
+
.uni-switch[tid="${rest.tid}"].ant-switch-checked {
|
10
|
+
background-color: #B30000;
|
11
|
+
}
|
12
|
+
`;
|
13
|
+
const blueCss = `
|
14
|
+
/* 根据tid定制Switch组件样式 */
|
15
|
+
.uni-switch[tid="${rest.tid}"].ant-switch-checked {
|
16
|
+
background-color: #1890ff;
|
17
|
+
}
|
18
|
+
`;
|
19
|
+
const greenCss = `
|
20
|
+
/* 根据tid定制Switch组件样式 */
|
21
|
+
.uni-switch[tid="${rest.tid}"].ant-switch-checked {
|
22
|
+
background-color: #17c60e;
|
23
|
+
}
|
24
|
+
`;
|
25
|
+
useEffect(() => {
|
26
|
+
const allow = ['blue', 'green', 'red'];
|
27
|
+
if (allow.includes(theme)) {
|
28
|
+
const css = theme === 'blue' ? blueCss : theme === 'green' ? greenCss : redCss;
|
29
|
+
const style = document.createElement('style');
|
30
|
+
style.innerHTML = css;
|
31
|
+
document.head.appendChild(style);
|
32
|
+
}
|
33
|
+
}, [theme]);
|
34
|
+
return (React.createElement(AntdSwitch, Object.assign({ className: `uni-${rest.tid} ${theme ? `theme-${theme}` : ''}`, "data-dnd": dataDnd, "data-id": rest.tid, style: style }, rest)));
|
35
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@cuvp1225/antd",
|
3
|
-
"version": "0.1.19-beta.
|
3
|
+
"version": "0.1.19-beta.39",
|
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",
|
@@ -55,5 +55,5 @@
|
|
55
55
|
"classnames": "^2.3.2",
|
56
56
|
"coral-system": "^1.0.6"
|
57
57
|
},
|
58
|
-
"gitHead": "
|
58
|
+
"gitHead": "9ed02f6e68346318488c017b2be59ef6cc72e21a"
|
59
59
|
}
|