@cuvp1225/antd 0.1.19-beta.39 → 0.1.19-beta.40
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 +15 -4
- package/dist/index.js +15 -4
- package/lib/cjs/components/index.d.ts +1 -0
- package/lib/cjs/components/index.js +3 -1
- package/lib/cjs/components/unSteps/unisteps.d.ts +17 -0
- package/lib/cjs/components/unSteps/unisteps.js +95 -0
- package/lib/cjs/components/uniRadio/uniradio.js +1 -1
- package/lib/cjs/components/uniSwitch/uniswitch.js +3 -3
- package/lib/esm/components/index.d.ts +1 -0
- package/lib/esm/components/index.js +1 -0
- package/lib/esm/components/unSteps/unisteps.d.ts +17 -0
- package/lib/esm/components/unSteps/unisteps.js +90 -0
- package/lib/esm/components/uniRadio/uniradio.js +1 -1
- package/lib/esm/components/uniSwitch/uniswitch.js +3 -3
- package/package.json +2 -2
@@ -60,3 +60,4 @@ export { UniModal } from './uniModal/unimodal';
|
|
60
60
|
export { UniUpload } from './uniUpload/uniupload';
|
61
61
|
export { UniRadio, UniRadioGroup } from './uniRadio/uniradio';
|
62
62
|
export { UniSwitch } from './uniSwitch/uniswitch';
|
63
|
+
export { UniSteps } from './unSteps/unisteps';
|
@@ -87,3 +87,4 @@ export { UniModal } from './uniModal/unimodal';
|
|
87
87
|
export { UniUpload } from './uniUpload/uniupload';
|
88
88
|
export { UniRadio, UniRadioGroup } from './uniRadio/uniradio';
|
89
89
|
export { UniSwitch } from './uniSwitch/uniswitch';
|
90
|
+
export { UniSteps } from './unSteps/unisteps';
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { StepProps, StepsProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
export declare const UniSteps: {
|
4
|
+
({ [SLOT.dnd]: dataDnd, [SLOT.id]: dataId, style, theme, ...rest }: StepsProps & {
|
5
|
+
[key: string]: any;
|
6
|
+
dnd?: string;
|
7
|
+
children?: React.ReactNode;
|
8
|
+
}): React.JSX.Element;
|
9
|
+
Step: (props: StepProps & {
|
10
|
+
[key: string]: any;
|
11
|
+
children?: React.ReactNode;
|
12
|
+
}) => React.JSX.Element;
|
13
|
+
};
|
14
|
+
export declare const UniStepsStep: (props: StepProps & {
|
15
|
+
[key: string]: any;
|
16
|
+
children?: React.ReactNode;
|
17
|
+
}) => React.JSX.Element;
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Steps as AntdSteps } from 'antd';
|
3
|
+
import React, { useEffect } from 'react';
|
4
|
+
import { SLOT } from '../../helpers/slottype';
|
5
|
+
export const UniSteps = (_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
|
+
.uni-${rest.tid} .ant-steps-item-process > .ant-steps-item-container > .ant-steps-item-icon {
|
9
|
+
background: #B30000;
|
10
|
+
}
|
11
|
+
.uni-${rest.tid} .ant-steps-item-process .ant-steps-item-icon {
|
12
|
+
background-color: #fff;
|
13
|
+
border-color: #B30000;
|
14
|
+
}
|
15
|
+
|
16
|
+
.uni-${rest.tid} .ant-steps-item-finish .ant-steps-item-icon {
|
17
|
+
background-color: #fff;
|
18
|
+
border-color: #B30000;
|
19
|
+
}
|
20
|
+
|
21
|
+
.uni-${rest.tid} .anticon svg {
|
22
|
+
color: #B30000;
|
23
|
+
}
|
24
|
+
|
25
|
+
|
26
|
+
.uni-${rest.tid} .ant-steps-item-finish > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title::after {
|
27
|
+
background-color: #f0f0f0;
|
28
|
+
}
|
29
|
+
`;
|
30
|
+
const blueCss = `
|
31
|
+
.uni-${rest.tid} .ant-steps-item-process > .ant-steps-item-container > .ant-steps-item-icon {
|
32
|
+
background: #1890ff;
|
33
|
+
}
|
34
|
+
.uni-${rest.tid} .ant-steps-item-process .ant-steps-item-icon {
|
35
|
+
background-color: #fff;
|
36
|
+
border-color: #1890ff;
|
37
|
+
}
|
38
|
+
|
39
|
+
.uni-${rest.tid} .ant-steps-item-finish .ant-steps-item-icon {
|
40
|
+
background-color: #fff;
|
41
|
+
border-color: #1890ff;
|
42
|
+
}
|
43
|
+
|
44
|
+
.uni-${rest.tid} .anticon svg {
|
45
|
+
color: #1890ff;
|
46
|
+
}
|
47
|
+
|
48
|
+
|
49
|
+
.uni-${rest.tid} .ant-steps-item-finish > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title::after {
|
50
|
+
background-color: #f0f0f0;
|
51
|
+
}
|
52
|
+
`;
|
53
|
+
const greenCss = `
|
54
|
+
.uni-${rest.tid} .ant-steps-item-process > .ant-steps-item-container > .ant-steps-item-icon {
|
55
|
+
background: #17c60e;
|
56
|
+
}
|
57
|
+
.uni-${rest.tid} .ant-steps-item-process .ant-steps-item-icon {
|
58
|
+
background-color: #fff;
|
59
|
+
border-color: #17c60e;
|
60
|
+
}
|
61
|
+
|
62
|
+
.uni-${rest.tid} .ant-steps-item-finish .ant-steps-item-icon {
|
63
|
+
background-color: #fff;
|
64
|
+
border-color: #17c60e;
|
65
|
+
}
|
66
|
+
|
67
|
+
.uni-${rest.tid} .anticon svg {
|
68
|
+
color: #17c60e;
|
69
|
+
}
|
70
|
+
|
71
|
+
.uni-${rest.tid} .ant-steps-item-finish > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title::after {
|
72
|
+
background-color: #f0f0f0;
|
73
|
+
}
|
74
|
+
`;
|
75
|
+
useEffect(() => {
|
76
|
+
const allow = ['blue', 'green', 'red'];
|
77
|
+
if (allow.includes(theme)) {
|
78
|
+
const css = theme === 'blue' ? blueCss : theme === 'green' ? greenCss : redCss;
|
79
|
+
const style = document.createElement('style');
|
80
|
+
style.innerHTML = css;
|
81
|
+
document.head.appendChild(style);
|
82
|
+
}
|
83
|
+
}, [theme]);
|
84
|
+
return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
|
85
|
+
React.createElement(AntdSteps, Object.assign({ className: `uni-${rest.tid} ${theme ? `theme-${theme}` : ''}` }, rest), rest.children)));
|
86
|
+
};
|
87
|
+
export const UniStepsStep = (props) => {
|
88
|
+
return (React.createElement(AntdSteps.Step, Object.assign({}, props)));
|
89
|
+
};
|
90
|
+
UniSteps.Step = UniStepsStep;
|
@@ -122,5 +122,5 @@ export const UniRadioGroup = (_a) => {
|
|
122
122
|
document.head.appendChild(style);
|
123
123
|
}
|
124
124
|
}, [theme]);
|
125
|
-
return (React.createElement(AntdRadio.Group, Object.assign({ className: `uni-${
|
125
|
+
return (React.createElement(AntdRadio.Group, Object.assign({ className: `uni-${rest.tid} ${theme ? `theme-${theme}` : ''}`, "data-dnd": dataDnd, "data-id": rest.tid, style: style }, rest), rest.children));
|
126
126
|
};
|
@@ -6,19 +6,19 @@ export const UniSwitch = (_a) => {
|
|
6
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
7
|
const redCss = `
|
8
8
|
/* 根据tid定制Switch组件样式 */
|
9
|
-
.uni
|
9
|
+
.uni-${rest.tid}[tid="${rest.tid}"].ant-switch-checked {
|
10
10
|
background-color: #B30000;
|
11
11
|
}
|
12
12
|
`;
|
13
13
|
const blueCss = `
|
14
14
|
/* 根据tid定制Switch组件样式 */
|
15
|
-
.uni
|
15
|
+
.uni-${rest.tid}[tid="${rest.tid}"].ant-switch-checked {
|
16
16
|
background-color: #1890ff;
|
17
17
|
}
|
18
18
|
`;
|
19
19
|
const greenCss = `
|
20
20
|
/* 根据tid定制Switch组件样式 */
|
21
|
-
.uni
|
21
|
+
.uni-${rest.tid}[tid="${rest.tid}"].ant-switch-checked {
|
22
22
|
background-color: #17c60e;
|
23
23
|
}
|
24
24
|
`;
|
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.40",
|
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": "ea59047ee8b4eee4c34618432acf1f10419c6a93"
|
59
59
|
}
|