@cuvp1225/antd 0.1.19-beta.35 → 0.1.19-beta.36

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.
@@ -54,3 +54,4 @@ export { Alert } from "./alert";
54
54
  export { Progress } from './progress';
55
55
  export { BackTop } from './backTop';
56
56
  export { UniTabs } from './uniTabs/unitabs';
57
+ export { UniButton, UniButtonGroup } from './uniButton/unibutton';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TreeSelect = exports.Mentions = exports.AutoComplete = exports.Switch = exports.PageHeader = exports.Statistic = exports.Transfer = exports.TimePicker = exports.Comment = exports.Rate = exports.Slider = exports.Empty = exports.Avatar = exports.Card = exports.Table = exports.Pagination = exports.Badge = exports.Divider = exports.Carousel = exports.Calendar = exports.Anchor = exports.Spin = exports.Skeleton = exports.Upload = exports.Dropdown = exports.Collapse = exports.Menu = exports.Breadcrumb = exports.Cascader = exports.CheckboxGroup = exports.Checkbox = exports.RadioGroup = exports.Radio = exports.DatePicker = exports.Drawer = exports.Result = exports.Tooltip = exports.Popover = exports.Popconfirm = exports.Space = exports.Select = exports.Password = exports.TextArea = exports.Input = exports.InputNumber = exports.ButtonGroup = exports.Button = exports.Box = exports.When = exports.Each = void 0;
4
- exports.UniTabs = exports.BackTop = exports.Progress = exports.Alert = exports.Tree = exports.Descriptions = exports.Image = void 0;
4
+ exports.UniButtonGroup = exports.UniButton = exports.UniTabs = exports.BackTop = exports.Progress = exports.Alert = exports.Tree = exports.Descriptions = exports.Image = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  tslib_1.__exportStar(require("antd"), exports);
7
7
  //以下组件都从antd中导出,解决下述组件卡顿问题
@@ -143,3 +143,6 @@ Object.defineProperty(exports, "BackTop", { enumerable: true, get: function () {
143
143
  //export {LineChart} from './LineChart';
144
144
  var unitabs_1 = require("./uniTabs/unitabs");
145
145
  Object.defineProperty(exports, "UniTabs", { enumerable: true, get: function () { return unitabs_1.UniTabs; } });
146
+ var unibutton_1 = require("./uniButton/unibutton");
147
+ Object.defineProperty(exports, "UniButton", { enumerable: true, get: function () { return unibutton_1.UniButton; } });
148
+ Object.defineProperty(exports, "UniButtonGroup", { enumerable: true, get: function () { return unibutton_1.UniButtonGroup; } });
@@ -0,0 +1,8 @@
1
+ import { ButtonProps } from "antd";
2
+ import React from "react";
3
+ export declare const UniButton: ({ [SLOT.dnd]: dataDnd, [SLOT.id]: dataId, style, theme, ...rest }: ButtonProps & {
4
+ [key: string]: any;
5
+ dnd?: string;
6
+ children?: React.ReactNode;
7
+ }) => React.JSX.Element;
8
+ export declare const UniButtonGroup: React.FC<import("antd/lib/button").ButtonGroupProps>;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UniButtonGroup = exports.UniButton = 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 UniButton = (_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
+ .uni-${rest.tid} {
12
+ color: #fff;
13
+ border-color: #d0262f !important;
14
+ background: #d0262f !important;
15
+
16
+ }
17
+
18
+ .uni-${rest.tid}:hover,
19
+ .uni-${rest.tid}:focus {
20
+ color: #fff;
21
+ border-color: #d0262f !important;
22
+ background: #d0262f !important;
23
+ }
24
+ `;
25
+ const blueCss = `
26
+ .uni-${rest.tid} {
27
+ color: #fff;
28
+ border-color: #1890ff !important;
29
+ background: #1890ff !important;
30
+
31
+ }
32
+
33
+ .uni-${rest.tid}:hover,
34
+ .uni-${rest.tid}:focus {
35
+ color: #fff;
36
+ border-color: #1890ff !important;
37
+ background: #1890ff !important;
38
+ }`;
39
+ const greenCss = `
40
+ .uni-${rest.tid} {
41
+ color: #fff;
42
+ border-color: #17c60e !important;
43
+ background: #17c60e !important;
44
+
45
+ }
46
+
47
+ .uni-${rest.tid}:hover,
48
+ .uni-${rest.tid}:focus {
49
+ color: #fff;
50
+ border-color: #17c60e !important;
51
+ background: #17c60e !important;
52
+ }`;
53
+ (0, react_1.useEffect)(() => {
54
+ const allow = ['blue', 'green', 'red'];
55
+ if (allow.includes(theme)) {
56
+ const css = theme === 'blue' ? blueCss : theme === 'green' ? greenCss : redCss;
57
+ const style = document.createElement('style');
58
+ style.innerHTML = css;
59
+ document.head.appendChild(style);
60
+ }
61
+ }, [theme]);
62
+ return (react_1.default.createElement(antd_1.Button, Object.assign({ className: `uni-${rest.tid} ${theme ? `theme-${theme}` : ''}`, "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style }, rest)));
63
+ };
64
+ exports.UniButton = UniButton;
65
+ exports.UniButtonGroup = antd_1.Button.Group;
@@ -1,2 +1 @@
1
- import 'antd/dist/antd.css';
2
1
  export * from './components';
package/lib/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- require("antd/dist/antd.css");
4
+ //import 'antd/dist/antd.css';
5
5
  tslib_1.__exportStar(require("./components"), exports);
@@ -54,3 +54,4 @@ export { Alert } from "./alert";
54
54
  export { Progress } from './progress';
55
55
  export { BackTop } from './backTop';
56
56
  export { UniTabs } from './uniTabs/unitabs';
57
+ export { UniButton, UniButtonGroup } from './uniButton/unibutton';
@@ -81,3 +81,4 @@ export { BackTop } from './backTop';
81
81
  //import * as echarts from 'echarts';
82
82
  //export {LineChart} from './LineChart';
83
83
  export { UniTabs } from './uniTabs/unitabs';
84
+ export { UniButton, UniButtonGroup } from './uniButton/unibutton';
@@ -0,0 +1,8 @@
1
+ import { ButtonProps } from "antd";
2
+ import React from "react";
3
+ export declare const UniButton: ({ [SLOT.dnd]: dataDnd, [SLOT.id]: dataId, style, theme, ...rest }: ButtonProps & {
4
+ [key: string]: any;
5
+ dnd?: string;
6
+ children?: React.ReactNode;
7
+ }) => React.JSX.Element;
8
+ export declare const UniButtonGroup: React.FC<import("antd/lib/button").ButtonGroupProps>;
@@ -0,0 +1,61 @@
1
+ import { __rest } from "tslib";
2
+ import { Button as AntButton } from "antd";
3
+ import { SLOT } from "../../helpers/slottype";
4
+ import React, { useEffect } from "react";
5
+ export const UniButton = (_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} {
9
+ color: #fff;
10
+ border-color: #d0262f !important;
11
+ background: #d0262f !important;
12
+
13
+ }
14
+
15
+ .uni-${rest.tid}:hover,
16
+ .uni-${rest.tid}:focus {
17
+ color: #fff;
18
+ border-color: #d0262f !important;
19
+ background: #d0262f !important;
20
+ }
21
+ `;
22
+ const blueCss = `
23
+ .uni-${rest.tid} {
24
+ color: #fff;
25
+ border-color: #1890ff !important;
26
+ background: #1890ff !important;
27
+
28
+ }
29
+
30
+ .uni-${rest.tid}:hover,
31
+ .uni-${rest.tid}:focus {
32
+ color: #fff;
33
+ border-color: #1890ff !important;
34
+ background: #1890ff !important;
35
+ }`;
36
+ const greenCss = `
37
+ .uni-${rest.tid} {
38
+ color: #fff;
39
+ border-color: #17c60e !important;
40
+ background: #17c60e !important;
41
+
42
+ }
43
+
44
+ .uni-${rest.tid}:hover,
45
+ .uni-${rest.tid}:focus {
46
+ color: #fff;
47
+ border-color: #17c60e !important;
48
+ background: #17c60e !important;
49
+ }`;
50
+ useEffect(() => {
51
+ const allow = ['blue', 'green', 'red'];
52
+ if (allow.includes(theme)) {
53
+ const css = theme === 'blue' ? blueCss : theme === 'green' ? greenCss : redCss;
54
+ const style = document.createElement('style');
55
+ style.innerHTML = css;
56
+ document.head.appendChild(style);
57
+ }
58
+ }, [theme]);
59
+ return (React.createElement(AntButton, Object.assign({ className: `uni-${rest.tid} ${theme ? `theme-${theme}` : ''}`, "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style }, rest)));
60
+ };
61
+ export const UniButtonGroup = AntButton.Group;
@@ -1,2 +1 @@
1
- import 'antd/dist/antd.css';
2
1
  export * from './components';
package/lib/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import 'antd/dist/antd.css';
1
+ //import 'antd/dist/antd.css';
2
2
  export * from './components';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuvp1225/antd",
3
- "version": "0.1.19-beta.35",
3
+ "version": "0.1.19-beta.36",
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": "a2d2d6722c414c78fd5d413c5bc322c4a2d89867"
58
+ "gitHead": "f824b786a983c0b8ec488805391e8556b386ab7a"
59
59
  }