@nocobase/client 0.7.2-alpha.1 → 0.7.2-alpha.2

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.
@@ -43,6 +43,7 @@ export var scopesSchema = {
43
43
  label: 'name',
44
44
  value: 'id'
45
45
  },
46
+ multiple: false,
46
47
  association: {
47
48
  target: 'rolesResourcesScopes'
48
49
  },
@@ -9,10 +9,12 @@ import * as components from '.';
9
9
  import * as common from '../common';
10
10
  import { SchemaComponentOptions } from '../core/SchemaComponentOptions';
11
11
  import { useFilterActionProps } from './filter/useFilterActionProps';
12
+ import { requestChartData } from './g2plot/requestChartData';
12
13
  export var AntdSchemaComponentProvider = function AntdSchemaComponentProvider(props) {
13
14
  var children = props.children;
14
15
  return /*#__PURE__*/React.createElement(SchemaComponentOptions, {
15
16
  scope: {
17
+ requestChartData: requestChartData,
16
18
  useFilterActionProps: useFilterActionProps
17
19
  },
18
20
  components: _objectSpread(_objectSpread({}, components), common)
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- import { Area, Bar, Column, Line, Pie } from '@antv/g2plot';
7
+ import { Area, Bar, BidirectionalBar, Box, Bullet, Chord, CirclePacking, Column, DualAxes, Facet, Funnel, Gauge, Heatmap, Histogram, Line, Liquid, Mix, Pie, Progress, Radar, RadialBar, RingProgress, Rose, Sankey, Scatter, Stock, Sunburst, TinyArea, TinyColumn, TinyLine, Treemap, Venn, Violin, Waterfall, WordCloud } from '@antv/g2plot';
8
8
  import { observer, useField } from '@formily/react';
9
9
  import { Spin } from 'antd';
10
10
  import cls from 'classnames';
@@ -13,11 +13,41 @@ import { useTranslation } from 'react-i18next';
13
13
  import { useAPIClient } from '../../../api-client';
14
14
  import { G2PlotDesigner } from './G2PlotDesigner';
15
15
  var plots = {
16
+ Line: Line,
16
17
  Area: Area,
17
18
  Column: Column,
18
- Line: Line,
19
+ Bar: Bar,
19
20
  Pie: Pie,
20
- Bar: Bar
21
+ Rose: Rose,
22
+ WordCloud: WordCloud,
23
+ Scatter: Scatter,
24
+ Radar: Radar,
25
+ DualAxes: DualAxes,
26
+ TinyLine: TinyLine,
27
+ TinyColumn: TinyColumn,
28
+ TinyArea: TinyArea,
29
+ Histogram: Histogram,
30
+ Progress: Progress,
31
+ RingProgress: RingProgress,
32
+ Heatmap: Heatmap,
33
+ Box: Box,
34
+ Violin: Violin,
35
+ Venn: Venn,
36
+ Stock: Stock,
37
+ Funnel: Funnel,
38
+ Liquid: Liquid,
39
+ Bullet: Bullet,
40
+ Sunburst: Sunburst,
41
+ Gauge: Gauge,
42
+ Waterfall: Waterfall,
43
+ RadialBar: RadialBar,
44
+ BidirectionalBar: BidirectionalBar,
45
+ Treemap: Treemap,
46
+ Sankey: Sankey,
47
+ Chord: Chord,
48
+ CirclePacking: CirclePacking,
49
+ Mix: Mix,
50
+ Facet: Facet
21
51
  };
22
52
  export var G2PlotRenderer = /*#__PURE__*/forwardRef(function (props, ref) {
23
53
  var className = props.className,
@@ -0,0 +1,4 @@
1
+ import { APIClient } from '../../../api-client';
2
+ export declare const requestChartData: (options: any) => (this: {
3
+ api: APIClient;
4
+ }) => Promise<any>;
@@ -0,0 +1,33 @@
1
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
+
3
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4
+
5
+ export var requestChartData = function requestChartData(options) {
6
+ return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
7
+ var _response$data, response;
8
+
9
+ return regeneratorRuntime.wrap(function _callee$(_context) {
10
+ while (1) {
11
+ switch (_context.prev = _context.next) {
12
+ case 0:
13
+ _context.prev = 0;
14
+ _context.next = 3;
15
+ return this.api.request(options);
16
+
17
+ case 3:
18
+ response = _context.sent;
19
+ return _context.abrupt("return", response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.data);
20
+
21
+ case 7:
22
+ _context.prev = 7;
23
+ _context.t0 = _context["catch"](0);
24
+ return _context.abrupt("return", []);
25
+
26
+ case 10:
27
+ case "end":
28
+ return _context.stop();
29
+ }
30
+ }
31
+ }, _callee, this, [[0, 7]]);
32
+ }));
33
+ };
@@ -55,6 +55,7 @@ var scopesSchema = {
55
55
  label: 'name',
56
56
  value: 'id'
57
57
  },
58
+ multiple: false,
58
59
  association: {
59
60
  target: 'rolesResourcesScopes'
60
61
  },
@@ -17,6 +17,8 @@ var _SchemaComponentOptions = require("../core/SchemaComponentOptions");
17
17
 
18
18
  var _useFilterActionProps = require("./filter/useFilterActionProps");
19
19
 
20
+ var _requestChartData = require("./g2plot/requestChartData");
21
+
20
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
23
 
22
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -33,6 +35,7 @@ var AntdSchemaComponentProvider = function AntdSchemaComponentProvider(props) {
33
35
  var children = props.children;
34
36
  return /*#__PURE__*/_react.default.createElement(_SchemaComponentOptions.SchemaComponentOptions, {
35
37
  scope: {
38
+ requestChartData: _requestChartData.requestChartData,
36
39
  useFilterActionProps: _useFilterActionProps.useFilterActionProps
37
40
  },
38
41
  components: _objectSpread(_objectSpread({}, components), common)
@@ -36,11 +36,41 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
36
36
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
37
37
 
38
38
  var plots = {
39
+ Line: _g2plot.Line,
39
40
  Area: _g2plot.Area,
40
41
  Column: _g2plot.Column,
41
- Line: _g2plot.Line,
42
+ Bar: _g2plot.Bar,
42
43
  Pie: _g2plot.Pie,
43
- Bar: _g2plot.Bar
44
+ Rose: _g2plot.Rose,
45
+ WordCloud: _g2plot.WordCloud,
46
+ Scatter: _g2plot.Scatter,
47
+ Radar: _g2plot.Radar,
48
+ DualAxes: _g2plot.DualAxes,
49
+ TinyLine: _g2plot.TinyLine,
50
+ TinyColumn: _g2plot.TinyColumn,
51
+ TinyArea: _g2plot.TinyArea,
52
+ Histogram: _g2plot.Histogram,
53
+ Progress: _g2plot.Progress,
54
+ RingProgress: _g2plot.RingProgress,
55
+ Heatmap: _g2plot.Heatmap,
56
+ Box: _g2plot.Box,
57
+ Violin: _g2plot.Violin,
58
+ Venn: _g2plot.Venn,
59
+ Stock: _g2plot.Stock,
60
+ Funnel: _g2plot.Funnel,
61
+ Liquid: _g2plot.Liquid,
62
+ Bullet: _g2plot.Bullet,
63
+ Sunburst: _g2plot.Sunburst,
64
+ Gauge: _g2plot.Gauge,
65
+ Waterfall: _g2plot.Waterfall,
66
+ RadialBar: _g2plot.RadialBar,
67
+ BidirectionalBar: _g2plot.BidirectionalBar,
68
+ Treemap: _g2plot.Treemap,
69
+ Sankey: _g2plot.Sankey,
70
+ Chord: _g2plot.Chord,
71
+ CirclePacking: _g2plot.CirclePacking,
72
+ Mix: _g2plot.Mix,
73
+ Facet: _g2plot.Facet
44
74
  };
45
75
  var G2PlotRenderer = /*#__PURE__*/(0, _react2.forwardRef)(function (props, ref) {
46
76
  var className = props.className,
@@ -0,0 +1,4 @@
1
+ import { APIClient } from '../../../api-client';
2
+ export declare const requestChartData: (options: any) => (this: {
3
+ api: APIClient;
4
+ }) => Promise<any>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.requestChartData = void 0;
7
+
8
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
+
10
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
11
+
12
+ var requestChartData = function requestChartData(options) {
13
+ return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
14
+ var _response$data, response;
15
+
16
+ return regeneratorRuntime.wrap(function _callee$(_context) {
17
+ while (1) {
18
+ switch (_context.prev = _context.next) {
19
+ case 0:
20
+ _context.prev = 0;
21
+ _context.next = 3;
22
+ return this.api.request(options);
23
+
24
+ case 3:
25
+ response = _context.sent;
26
+ return _context.abrupt("return", response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.data);
27
+
28
+ case 7:
29
+ _context.prev = 7;
30
+ _context.t0 = _context["catch"](0);
31
+ return _context.abrupt("return", []);
32
+
33
+ case 10:
34
+ case "end":
35
+ return _context.stop();
36
+ }
37
+ }
38
+ }, _callee, this, [[0, 7]]);
39
+ }));
40
+ };
41
+
42
+ exports.requestChartData = requestChartData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/client",
3
- "version": "0.7.2-alpha.1",
3
+ "version": "0.7.2-alpha.2",
4
4
  "license": "Apache-2.0",
5
5
  "licenses": [
6
6
  {
@@ -19,8 +19,8 @@
19
19
  "@formily/antd": "2.0.20",
20
20
  "@formily/core": "2.0.20",
21
21
  "@formily/react": "2.0.20",
22
- "@nocobase/sdk": "0.7.2-alpha.1",
23
- "@nocobase/utils": "0.7.2-alpha.1",
22
+ "@nocobase/sdk": "0.7.2-alpha.2",
23
+ "@nocobase/utils": "0.7.2-alpha.2",
24
24
  "ahooks": "^3.0.5",
25
25
  "antd": "~4.19.5",
26
26
  "axios": "^0.26.1",
@@ -52,5 +52,5 @@
52
52
  "@types/marked": "^4.0.1",
53
53
  "axios-mock-adapter": "^1.20.0"
54
54
  },
55
- "gitHead": "2e7958360628d6306845aabcb1e574a8e91d08ad"
55
+ "gitHead": "a0cc50154cc292248ef107c95a24bcc0c7a586fa"
56
56
  }