@cuvp1225/antd 0.3.49 → 0.3.51

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.
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Table = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const antd_1 = require("antd");
6
+ const tango_boot_1 = require("@music163/tango-boot");
7
+ const react_1 = tslib_1.__importStar(require("react"));
8
+ const tango_helpers_1 = require("@music163/tango-helpers");
9
+ function TableDesigner(_a) {
10
+ var { children, columns, dataSource } = _a, _b = tango_helpers_1.SLOT.dnd, dataDnd = _a[_b], _c = tango_helpers_1.SLOT.id, dataId = _a[_c], { style } = _a, rest = tslib_1.__rest(_a, ["children", "columns", "dataSource", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
11
+ const tableRef = (0, react_1.useRef)(null);
12
+ (0, react_1.useEffect)(() => {
13
+ Promise.resolve().then(() => {
14
+ const popoverNode = document.querySelector('.ant-table');
15
+ // console.log('spinNode', popoverNode);
16
+ if (popoverNode) {
17
+ popoverNode.setAttribute('data-dnd', dataDnd);
18
+ popoverNode.setAttribute('data-id', dataId);
19
+ popoverNode.setAttribute('draggable', 'true');
20
+ }
21
+ });
22
+ }, [dataDnd, dataId]);
23
+ return (react_1.default.createElement("div", { ref: tableRef, draggable: 'true' },
24
+ react_1.default.createElement(antd_1.Table, Object.assign({ columns: columns, dataSource: dataSource, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
25
+ }
26
+ exports.Table = (0, tango_boot_1.defineComponent)(antd_1.Table, {
27
+ name: 'Table',
28
+ designerConfig: {
29
+ render({ designerProps, originalProps }) {
30
+ // console.log("Table: designerProps:", designerProps, "originalProps:", originalProps);
31
+ return react_1.default.createElement(TableDesigner, Object.assign({}, designerProps, originalProps));
32
+ }
33
+ }
34
+ });
@@ -0,0 +1,3 @@
1
+ import { BadgeProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Badge: React.ForwardRefExoticComponent<BadgeProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
@@ -0,0 +1,31 @@
1
+ import { __rest } from "tslib";
2
+ import { Badge as AntBadge } from 'antd';
3
+ import { defineComponent } from '@music163/tango-boot';
4
+ import React, { useEffect, useRef } from 'react';
5
+ import { SLOT } from '@music163/tango-helpers';
6
+ function BadgeDesigner(_a) {
7
+ var { children } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
8
+ const badgeRef = useRef(null);
9
+ useEffect(() => {
10
+ Promise.resolve().then(() => {
11
+ const popoverNode = document.querySelector('.ant-badge');
12
+ // console.log('spinNode', popoverNode);
13
+ if (popoverNode) {
14
+ popoverNode.setAttribute('data-dnd', dataDnd);
15
+ popoverNode.setAttribute('data-id', dataId);
16
+ popoverNode.setAttribute('draggable', 'true');
17
+ }
18
+ });
19
+ }, [dataDnd, dataId]);
20
+ return (React.createElement("div", { ref: badgeRef, draggable: 'true' },
21
+ React.createElement(AntBadge, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
22
+ }
23
+ export const Badge = defineComponent(AntBadge, {
24
+ name: 'Badge',
25
+ designerConfig: {
26
+ render({ designerProps, originalProps }) {
27
+ // console.log("Badge: designerProps:", designerProps, "originalProps:", originalProps);
28
+ return React.createElement(BadgeDesigner, Object.assign({}, designerProps, originalProps));
29
+ }
30
+ }
31
+ });
@@ -9,7 +9,7 @@ function DividerDesigner(_a) {
9
9
  useEffect(() => {
10
10
  Promise.resolve().then(() => {
11
11
  const popoverNode = document.querySelector('.ant-divider');
12
- console.log('spinNode', popoverNode);
12
+ // console.log('spinNode', popoverNode);
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
15
15
  popoverNode.setAttribute('data-id', dataId);
@@ -24,7 +24,7 @@ export const Divider = defineComponent(AntDivider, {
24
24
  name: 'Divider',
25
25
  designerConfig: {
26
26
  render({ designerProps, originalProps }) {
27
- console.log("Divider: designerProps:", designerProps, "originalProps:", originalProps);
27
+ // console.log("Divider: designerProps:", designerProps, "originalProps:", originalProps);
28
28
  return React.createElement(DividerDesigner, Object.assign({}, designerProps, originalProps));
29
29
  }
30
30
  }
@@ -34,3 +34,6 @@ export { Upload } from "./upload";
34
34
  export { Skeleton } from "./skeleton";
35
35
  export { Spin } from './spin';
36
36
  export { Divider } from './divider';
37
+ export { Badge } from './badge';
38
+ export { Pagination } from './pagination';
39
+ export { Table } from './table';
@@ -39,3 +39,6 @@ export { Upload } from "./upload";
39
39
  export { Skeleton } from "./skeleton";
40
40
  export { Spin } from './spin';
41
41
  export { Divider } from './divider';
42
+ export { Badge } from './badge';
43
+ export { Pagination } from './pagination';
44
+ export { Table } from './table';
@@ -0,0 +1,3 @@
1
+ import { PaginationProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
@@ -0,0 +1,31 @@
1
+ import { __rest } from "tslib";
2
+ import { Pagination as AntPagination } from 'antd';
3
+ import { defineComponent } from '@music163/tango-boot';
4
+ import React, { useEffect, useRef } from 'react';
5
+ import { SLOT } from '@music163/tango-helpers';
6
+ function PaginationDesigner(_a) {
7
+ var _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
8
+ const paginationRef = useRef(null);
9
+ useEffect(() => {
10
+ Promise.resolve().then(() => {
11
+ const popoverNode = document.querySelector('.ant-pagination');
12
+ // console.log('spinNode', popoverNode);
13
+ if (popoverNode) {
14
+ popoverNode.setAttribute('data-dnd', dataDnd);
15
+ popoverNode.setAttribute('data-id', dataId);
16
+ popoverNode.setAttribute('draggable', 'true');
17
+ }
18
+ });
19
+ }, [dataDnd, dataId]);
20
+ return (React.createElement("div", { ref: paginationRef, draggable: 'true' },
21
+ React.createElement(AntPagination, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
22
+ }
23
+ export const Pagination = defineComponent(AntPagination, {
24
+ name: 'Pagination',
25
+ designerConfig: {
26
+ render({ designerProps, originalProps }) {
27
+ // console.log("Pagination: designerProps:", designerProps, "originalProps:", originalProps);
28
+ return React.createElement(PaginationDesigner, Object.assign({}, designerProps, originalProps));
29
+ }
30
+ }
31
+ });
@@ -13,6 +13,7 @@ function ResultDesigner(_a) {
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
15
15
  popoverNode.setAttribute('data-id', dataId);
16
+ popoverNode.setAttribute('draggable', 'true');
16
17
  }
17
18
  });
18
19
  }, [dataDnd, dataId]);
@@ -31,8 +32,8 @@ function ResultDesigner(_a) {
31
32
  // });
32
33
  // }
33
34
  // };
34
- return (React.createElement("div", { ref: resultRef },
35
- React.createElement(AntResult, Object.assign({ title: title, "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
35
+ return (React.createElement("div", { ref: resultRef, draggable: 'true' },
36
+ React.createElement(AntResult, Object.assign({ title: title, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
36
37
  }
37
38
  export const Result = defineComponent(AntResult, {
38
39
  name: 'Result',
@@ -9,7 +9,7 @@ function SpinDesigner(_a) {
9
9
  useEffect(() => {
10
10
  Promise.resolve().then(() => {
11
11
  const popoverNode = document.querySelector('.ant-spin');
12
- console.log('spinNode', popoverNode);
12
+ // console.log('spinNode', popoverNode);
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
15
15
  popoverNode.setAttribute('data-id', dataId);
@@ -24,7 +24,7 @@ export const Spin = defineComponent(AntSpin, {
24
24
  name: 'Spin',
25
25
  designerConfig: {
26
26
  render({ designerProps, originalProps }) {
27
- console.log("Spin: designerProps:", designerProps, "originalProps:", originalProps);
27
+ // console.log("Spin: designerProps:", designerProps, "originalProps:", originalProps);
28
28
  return React.createElement(SpinDesigner, Object.assign({ spinning: true }, designerProps, originalProps));
29
29
  },
30
30
  },
@@ -0,0 +1,7 @@
1
+ import { TableProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Table: React.ForwardRefExoticComponent<Omit<TableProps<object> & {
4
+ children?: React.ReactNode;
5
+ } & {
6
+ ref?: React.Ref<HTMLDivElement> | undefined;
7
+ } & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
@@ -0,0 +1,31 @@
1
+ import { __rest } from "tslib";
2
+ import { Table as AntTable } from 'antd';
3
+ import { defineComponent } from '@music163/tango-boot';
4
+ import React, { useEffect, useRef } from 'react';
5
+ import { SLOT } from '@music163/tango-helpers';
6
+ function TableDesigner(_a) {
7
+ var { children, columns, dataSource } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", "columns", "dataSource", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
8
+ const tableRef = useRef(null);
9
+ useEffect(() => {
10
+ Promise.resolve().then(() => {
11
+ const popoverNode = document.querySelector('.ant-table');
12
+ // console.log('spinNode', popoverNode);
13
+ if (popoverNode) {
14
+ popoverNode.setAttribute('data-dnd', dataDnd);
15
+ popoverNode.setAttribute('data-id', dataId);
16
+ popoverNode.setAttribute('draggable', 'true');
17
+ }
18
+ });
19
+ }, [dataDnd, dataId]);
20
+ return (React.createElement("div", { ref: tableRef, draggable: 'true' },
21
+ React.createElement(AntTable, Object.assign({ columns: columns, dataSource: dataSource, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
22
+ }
23
+ export const Table = defineComponent(AntTable, {
24
+ name: 'Table',
25
+ designerConfig: {
26
+ render({ designerProps, originalProps }) {
27
+ // console.log("Table: designerProps:", designerProps, "originalProps:", originalProps);
28
+ return React.createElement(TableDesigner, Object.assign({}, designerProps, originalProps));
29
+ }
30
+ }
31
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuvp1225/antd",
3
- "version": "0.3.49",
3
+ "version": "0.3.51",
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",
@@ -54,5 +54,5 @@
54
54
  "classnames": "^2.3.2",
55
55
  "coral-system": "^1.0.6"
56
56
  },
57
- "gitHead": "b544956f040297509dc435799e9b1a02d843818d"
57
+ "gitHead": "223912bbc93780307694a631f81903bd8351ebab"
58
58
  }