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