@nocobase/plugin-charts 0.9.1-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.
Files changed (139) hide show
  1. package/client.d.ts +4 -0
  2. package/client.js +30 -0
  3. package/lib/client/ChartBlockEngine.d.ts +27 -0
  4. package/lib/client/ChartBlockEngine.js +201 -0
  5. package/lib/client/ChartBlockEngineDesigner.d.ts +3 -0
  6. package/lib/client/ChartBlockEngineDesigner.js +348 -0
  7. package/lib/client/ChartBlockInitializer.d.ts +3 -0
  8. package/lib/client/ChartBlockInitializer.js +324 -0
  9. package/lib/client/ChartQueryBlockInitializer.d.ts +9 -0
  10. package/lib/client/ChartQueryBlockInitializer.js +230 -0
  11. package/lib/client/ChartQueryMetadataProvider.d.ts +10 -0
  12. package/lib/client/ChartQueryMetadataProvider.js +118 -0
  13. package/lib/client/DataSetPreviewTable.d.ts +5 -0
  14. package/lib/client/DataSetPreviewTable.js +127 -0
  15. package/lib/client/Icons.d.ts +1 -0
  16. package/lib/client/Icons.js +226 -0
  17. package/lib/client/chartRenderComponents/index.d.ts +2 -0
  18. package/lib/client/chartRenderComponents/index.js +26 -0
  19. package/lib/client/hooks/index.d.ts +4 -0
  20. package/lib/client/hooks/index.js +52 -0
  21. package/lib/client/index.d.ts +4 -0
  22. package/lib/client/index.js +161 -0
  23. package/lib/client/locale/en-US.d.ts +23 -0
  24. package/lib/client/locale/en-US.js +29 -0
  25. package/lib/client/locale/index.d.ts +3 -0
  26. package/lib/client/locale/index.js +46 -0
  27. package/lib/client/locale/ja-JP.d.ts +2 -0
  28. package/lib/client/locale/ja-JP.js +8 -0
  29. package/lib/client/locale/ru-RU.d.ts +2 -0
  30. package/lib/client/locale/ru-RU.js +8 -0
  31. package/lib/client/locale/tr-TR.d.ts +2 -0
  32. package/lib/client/locale/tr-TR.js +8 -0
  33. package/lib/client/locale/zh-CN.d.ts +61 -0
  34. package/lib/client/locale/zh-CN.js +67 -0
  35. package/lib/client/select/CustomSelect.d.ts +11 -0
  36. package/lib/client/select/CustomSelect.js +193 -0
  37. package/lib/client/select/ReadPretty.d.ts +2 -0
  38. package/lib/client/select/ReadPretty.js +102 -0
  39. package/lib/client/select/index.d.ts +2 -0
  40. package/lib/client/select/index.js +31 -0
  41. package/lib/client/select/shared.d.ts +7 -0
  42. package/lib/client/select/shared.js +86 -0
  43. package/lib/client/settings/AddNewQuery.d.ts +2 -0
  44. package/lib/client/settings/AddNewQuery.js +321 -0
  45. package/lib/client/settings/ConfigureFields.d.ts +1 -0
  46. package/lib/client/settings/ConfigureFields.js +51 -0
  47. package/lib/client/settings/QueriesTable.d.ts +1 -0
  48. package/lib/client/settings/QueriesTable.js +108 -0
  49. package/lib/client/settings/queryTypes.d.ts +5 -0
  50. package/lib/client/settings/queryTypes.js +85 -0
  51. package/lib/client/settings/schemas/chartsQueries.d.ts +8 -0
  52. package/lib/client/settings/schemas/chartsQueries.js +378 -0
  53. package/lib/client/templates/AreaTemplate.d.ts +65 -0
  54. package/lib/client/templates/AreaTemplate.js +86 -0
  55. package/lib/client/templates/BarTemplate.d.ts +80 -0
  56. package/lib/client/templates/BarTemplate.js +103 -0
  57. package/lib/client/templates/ColumnTemplate.d.ts +80 -0
  58. package/lib/client/templates/ColumnTemplate.js +103 -0
  59. package/lib/client/templates/FunnelTemplate.d.ts +66 -0
  60. package/lib/client/templates/FunnelTemplate.js +87 -0
  61. package/lib/client/templates/LineTemplate.d.ts +67 -0
  62. package/lib/client/templates/LineTemplate.js +92 -0
  63. package/lib/client/templates/PieTemplate.d.ts +71 -0
  64. package/lib/client/templates/PieTemplate.js +92 -0
  65. package/lib/client/templates/RadarTemplate.d.ts +71 -0
  66. package/lib/client/templates/RadarTemplate.js +93 -0
  67. package/lib/client/templates/ScatterTemplate.d.ts +91 -0
  68. package/lib/client/templates/ScatterTemplate.js +112 -0
  69. package/lib/client/templates/TableTemplate.d.ts +28 -0
  70. package/lib/client/templates/TableTemplate.js +54 -0
  71. package/lib/client/templates/index.d.ts +1 -0
  72. package/lib/client/templates/index.js +33 -0
  73. package/lib/client/utils.d.ts +3 -0
  74. package/lib/client/utils.js +66 -0
  75. package/lib/index.d.ts +1 -0
  76. package/lib/index.js +15 -0
  77. package/lib/server/actions/chartsQueries.d.ts +3 -0
  78. package/lib/server/actions/chartsQueries.js +104 -0
  79. package/lib/server/actions/index.d.ts +1 -0
  80. package/lib/server/actions/index.js +1 -0
  81. package/lib/server/collections/chartsQueries.d.ts +2 -0
  82. package/lib/server/collections/chartsQueries.js +36 -0
  83. package/lib/server/index.d.ts +1 -0
  84. package/lib/server/index.js +15 -0
  85. package/lib/server/plugin.d.ts +14 -0
  86. package/lib/server/plugin.js +142 -0
  87. package/lib/server/query.d.ts +12 -0
  88. package/lib/server/query.js +91 -0
  89. package/lib/server/shared/index.d.ts +2 -0
  90. package/lib/server/shared/index.js +8 -0
  91. package/package.json +14 -0
  92. package/server.d.ts +4 -0
  93. package/server.js +30 -0
  94. package/src/client/ChartBlockEngine.tsx +120 -0
  95. package/src/client/ChartBlockEngineDesigner.tsx +238 -0
  96. package/src/client/ChartBlockInitializer.tsx +216 -0
  97. package/src/client/ChartQueryBlockInitializer.tsx +136 -0
  98. package/src/client/ChartQueryMetadataProvider.tsx +62 -0
  99. package/src/client/DataSetPreviewTable.tsx +73 -0
  100. package/src/client/Icons.tsx +99 -0
  101. package/src/client/chartRenderComponents/index.ts +7 -0
  102. package/src/client/hooks/index.ts +19 -0
  103. package/src/client/index.tsx +101 -0
  104. package/src/client/locale/en-US.ts +23 -0
  105. package/src/client/locale/index.ts +18 -0
  106. package/src/client/locale/ja-JP.ts +1 -0
  107. package/src/client/locale/ru-RU.ts +1 -0
  108. package/src/client/locale/tr-TR.ts +1 -0
  109. package/src/client/locale/zh-CN.ts +63 -0
  110. package/src/client/select/CustomSelect.tsx +127 -0
  111. package/src/client/select/ReadPretty.tsx +36 -0
  112. package/src/client/select/index.md +38 -0
  113. package/src/client/select/index.ts +2 -0
  114. package/src/client/select/shared.ts +36 -0
  115. package/src/client/settings/AddNewQuery.tsx +161 -0
  116. package/src/client/settings/ConfigureFields.tsx +18 -0
  117. package/src/client/settings/QueriesTable.tsx +26 -0
  118. package/src/client/settings/queryTypes.ts +64 -0
  119. package/src/client/settings/schemas/chartsQueries.ts +319 -0
  120. package/src/client/templates/AreaTemplate.tsx +64 -0
  121. package/src/client/templates/BarTemplate.tsx +80 -0
  122. package/src/client/templates/ColumnTemplate.tsx +81 -0
  123. package/src/client/templates/FunnelTemplate.tsx +65 -0
  124. package/src/client/templates/LineTemplate.tsx +72 -0
  125. package/src/client/templates/PieTemplate.tsx +68 -0
  126. package/src/client/templates/RadarTemplate.tsx +71 -0
  127. package/src/client/templates/ScatterTemplate.tsx +90 -0
  128. package/src/client/templates/TableTemplate.tsx +48 -0
  129. package/src/client/templates/index.ts +21 -0
  130. package/src/client/utils.ts +39 -0
  131. package/src/index.ts +1 -0
  132. package/src/server/actions/chartsQueries.ts +44 -0
  133. package/src/server/actions/index.ts +0 -0
  134. package/src/server/collections/.gitkeep +0 -0
  135. package/src/server/collections/chartsQueries.ts +24 -0
  136. package/src/server/index.ts +1 -0
  137. package/src/server/plugin.ts +61 -0
  138. package/src/server/query.ts +39 -0
  139. package/src/server/shared/index.ts +2 -0
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.QueriesTable = void 0;
7
+
8
+ function _client() {
9
+ const data = require("@nocobase/client");
10
+
11
+ _client = function _client() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _antd() {
19
+ const data = require("antd");
20
+
21
+ _antd = function _antd() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ function _react() {
29
+ const data = _interopRequireWildcard(require("react"));
30
+
31
+ _react = function _react() {
32
+ return data;
33
+ };
34
+
35
+ return data;
36
+ }
37
+
38
+ function _reactI18next() {
39
+ const data = require("react-i18next");
40
+
41
+ _reactI18next = function _reactI18next() {
42
+ return data;
43
+ };
44
+
45
+ return data;
46
+ }
47
+
48
+ var _AddNewQuery = require("./AddNewQuery");
49
+
50
+ var _ConfigureFields = require("./ConfigureFields");
51
+
52
+ var _chartsQueries = require("./schemas/chartsQueries");
53
+
54
+ function _json() {
55
+ const data = _interopRequireDefault(require("json5"));
56
+
57
+ _json = function _json() {
58
+ return data;
59
+ };
60
+
61
+ return data;
62
+ }
63
+
64
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65
+
66
+ 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); }
67
+
68
+ 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; }
69
+
70
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
71
+
72
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
73
+
74
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
75
+
76
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
77
+
78
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
79
+
80
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
81
+
82
+ const QueriesTable = () => {
83
+ const _useState = (0, _react().useState)(false),
84
+ _useState2 = _slicedToArray(_useState, 2),
85
+ visible = _useState2[0],
86
+ setVisible = _useState2[1];
87
+
88
+ const _useTranslation = (0, _reactI18next().useTranslation)(),
89
+ t = _useTranslation.t;
90
+
91
+ return _react().default.createElement(_antd().Card, {
92
+ bordered: false
93
+ }, _react().default.createElement(_client().SchemaComponent, {
94
+ scope: {
95
+ JSON5: _json().default,
96
+ useDestroyQueryItemAction: _chartsQueries.useDestroyQueryItemAction,
97
+ useDestroyAllSelectedQueriesAction: _chartsQueries.useDestroyAllSelectedQueriesAction
98
+ },
99
+ schema: _chartsQueries.chartsQueriesSchema,
100
+ components: {
101
+ AddNewQuery: _AddNewQuery.AddNewQuery,
102
+ EditQuery: _AddNewQuery.EditQuery,
103
+ ConfigureFields: _ConfigureFields.ConfigureFields
104
+ }
105
+ }));
106
+ };
107
+
108
+ exports.QueriesTable = QueriesTable;
@@ -0,0 +1,5 @@
1
+ import { ISchema } from '@formily/react';
2
+ export declare const json: ISchema;
3
+ export declare const sql: ISchema;
4
+ export declare const api: ISchema;
5
+ export declare const getQueryTypeSchema: (type: any) => any;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sql = exports.json = exports.getQueryTypeSchema = exports.api = void 0;
7
+
8
+ function _cloneDeep() {
9
+ const data = _interopRequireDefault(require("lodash/cloneDeep"));
10
+
11
+ _cloneDeep = function _cloneDeep() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const json = {
21
+ type: 'object',
22
+ properties: {
23
+ data: {
24
+ title: 'JSON',
25
+ required: true,
26
+ 'x-component': 'Input.TextArea',
27
+ 'x-validator': {
28
+ json5: true
29
+ },
30
+ 'x-component-props': {
31
+ autoSize: {
32
+ maxRows: 20,
33
+ minRows: 10
34
+ }
35
+ },
36
+ 'x-decorator': 'FormItem'
37
+ }
38
+ }
39
+ };
40
+ exports.json = json;
41
+ const sql = {
42
+ type: 'object',
43
+ properties: {
44
+ sql: {
45
+ title: 'SQL',
46
+ required: true,
47
+ 'x-component': 'Input.TextArea',
48
+ 'x-decorator': 'FormItem',
49
+ 'x-validator': {
50
+ triggerType: 'onBlur',
51
+ validator: '{{validateSQL}}'
52
+ },
53
+ 'x-component-props': {
54
+ autoSize: {
55
+ maxRows: 20,
56
+ minRows: 10
57
+ }
58
+ }
59
+ }
60
+ }
61
+ };
62
+ exports.sql = sql;
63
+ const api = {
64
+ type: 'object',
65
+ properties: {
66
+ api: {
67
+ title: 'API',
68
+ required: true,
69
+ 'x-component': 'Input',
70
+ 'x-decorator': 'FormItem'
71
+ }
72
+ }
73
+ };
74
+ exports.api = api;
75
+ const types = {
76
+ json,
77
+ sql,
78
+ api
79
+ };
80
+
81
+ const getQueryTypeSchema = type => {
82
+ return (0, _cloneDeep().default)(types[type]);
83
+ };
84
+
85
+ exports.getQueryTypeSchema = getQueryTypeSchema;
@@ -0,0 +1,8 @@
1
+ import { ISchema } from '@formily/react';
2
+ export declare const useDestroyQueryItemAction: () => {
3
+ run(): Promise<void>;
4
+ };
5
+ export declare const useDestroyAllSelectedQueriesAction: () => {
6
+ run(): Promise<void>;
7
+ };
8
+ export declare const chartsQueriesSchema: ISchema;
@@ -0,0 +1,378 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useDestroyQueryItemAction = exports.useDestroyAllSelectedQueriesAction = exports.chartsQueriesSchema = void 0;
7
+
8
+ function _shared() {
9
+ const data = require("@formily/shared");
10
+
11
+ _shared = function _shared() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _client() {
19
+ const data = require("@nocobase/client");
20
+
21
+ _client = function _client() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ var _ChartQueryMetadataProvider = require("../../ChartQueryMetadataProvider");
29
+
30
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
+
32
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
+
34
+ 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; }
35
+
36
+ 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); } }
37
+
38
+ 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); }); }; }
39
+
40
+ const collection = {
41
+ name: 'chartsQueries',
42
+ fields: [{
43
+ type: 'integer',
44
+ name: 'title',
45
+ interface: 'input',
46
+ uiSchema: {
47
+ title: '{{t("Title",{ns:"charts"})}}',
48
+ type: 'string',
49
+ 'x-component': 'Input',
50
+ required: true
51
+ }
52
+ }, {
53
+ type: 'string',
54
+ name: 'type',
55
+ interface: 'select',
56
+ uiSchema: {
57
+ title: '{{t("Type",{ns:"charts"})}}',
58
+ type: 'string',
59
+ 'x-component': 'Select',
60
+ required: true,
61
+ enum: [{
62
+ label: '{{t("API")}}',
63
+ value: 'api'
64
+ }, {
65
+ label: '{{t("SQL")}}',
66
+ value: 'sql'
67
+ }, {
68
+ label: '{{t("JSON")}}',
69
+ value: 'json'
70
+ }]
71
+ }
72
+ }]
73
+ };
74
+
75
+ const useDestroyQueryItemAction = () => {
76
+ const ctx = (0, _ChartQueryMetadataProvider.useChartQueryMetadataContext)();
77
+
78
+ const _useResourceActionCon = (0, _client().useResourceActionContext)(),
79
+ refresh = _useResourceActionCon.refresh;
80
+
81
+ const _useResourceContext = (0, _client().useResourceContext)(),
82
+ resource = _useResourceContext.resource,
83
+ targetKey = _useResourceContext.targetKey;
84
+
85
+ const _useRecord = (0, _client().useRecord)(),
86
+ filterByTk = _useRecord[targetKey];
87
+
88
+ return {
89
+ run() {
90
+ return _asyncToGenerator(function* () {
91
+ yield resource.destroy({
92
+ filterByTk
93
+ });
94
+ refresh();
95
+ ctx.refresh();
96
+ })();
97
+ }
98
+
99
+ };
100
+ };
101
+
102
+ exports.useDestroyQueryItemAction = useDestroyQueryItemAction;
103
+
104
+ const useDestroyAllSelectedQueriesAction = () => {
105
+ const ctx = (0, _ChartQueryMetadataProvider.useChartQueryMetadataContext)();
106
+
107
+ const _useResourceActionCon2 = (0, _client().useResourceActionContext)(),
108
+ state = _useResourceActionCon2.state,
109
+ setState = _useResourceActionCon2.setState,
110
+ refresh = _useResourceActionCon2.refresh;
111
+
112
+ const _useResourceContext2 = (0, _client().useResourceContext)(),
113
+ resource = _useResourceContext2.resource,
114
+ targetKey = _useResourceContext2.targetKey;
115
+
116
+ return {
117
+ run() {
118
+ return _asyncToGenerator(function* () {
119
+ yield resource.destroy({
120
+ filterByTk: (state === null || state === void 0 ? void 0 : state.selectedRowKeys) || []
121
+ });
122
+ setState === null || setState === void 0 ? void 0 : setState({
123
+ selectedRowKeys: []
124
+ });
125
+ refresh();
126
+ ctx.refresh();
127
+ })();
128
+ }
129
+
130
+ };
131
+ };
132
+
133
+ exports.useDestroyAllSelectedQueriesAction = useDestroyAllSelectedQueriesAction;
134
+ const chartsQueriesSchema = {
135
+ type: 'object',
136
+ properties: {
137
+ [(0, _shared().uid)()]: {
138
+ type: 'void',
139
+ 'x-decorator': 'ResourceActionProvider',
140
+ 'x-decorator-props': {
141
+ collection,
142
+ resourceName: 'chartsQueries',
143
+ request: {
144
+ resource: 'chartsQueries',
145
+ action: 'list',
146
+ params: {
147
+ pageSize: 50,
148
+ sort: ['-id'],
149
+ appends: []
150
+ }
151
+ }
152
+ },
153
+ 'x-component': 'CollectionProvider',
154
+ 'x-component-props': {
155
+ collection
156
+ },
157
+ properties: {
158
+ actions: {
159
+ type: 'void',
160
+ 'x-component': 'ActionBar',
161
+ 'x-component-props': {
162
+ style: {
163
+ marginBottom: 16
164
+ }
165
+ },
166
+ properties: {
167
+ delete: {
168
+ type: 'void',
169
+ title: '{{ t("Delete") }}',
170
+ 'x-component': 'Action',
171
+ 'x-component-props': {
172
+ useAction: '{{ useDestroyAllSelectedQueriesAction }}',
173
+ confirm: {
174
+ title: '{{t("Delete queries",{ns:"charts"})}}',
175
+ content: "{{t('Are you sure you want to delete it?')}}"
176
+ }
177
+ }
178
+ },
179
+ create: {
180
+ type: 'void',
181
+ title: '{{t("Add query")}}',
182
+ 'x-component': 'AddNewQuery',
183
+ 'x-component-props': {
184
+ type: 'primary'
185
+ },
186
+ properties: {
187
+ drawer: {
188
+ type: 'void',
189
+ 'x-component': 'Action.Drawer',
190
+ 'x-decorator': 'Form',
191
+ 'x-decorator-props': {
192
+ useValues(options) {
193
+ const ctx = (0, _client().useActionContext)();
194
+ return (0, _client().useRequest)(() => Promise.resolve({
195
+ data: {
196
+ name: `s_${(0, _shared().uid)()}`
197
+ }
198
+ }), _objectSpread(_objectSpread({}, options), {}, {
199
+ refreshDeps: [ctx.visible]
200
+ }));
201
+ }
202
+
203
+ },
204
+ title: '{{t("Add query",{ns:"charts"})}}',
205
+ properties: {
206
+ title: {
207
+ 'x-component': 'CollectionField',
208
+ 'x-decorator': 'FormItem'
209
+ },
210
+ type: {
211
+ 'x-component': 'CollectionField',
212
+ 'x-decorator': 'FormItem'
213
+ },
214
+ footer: {
215
+ type: 'void',
216
+ 'x-component': 'Action.Drawer.Footer',
217
+ properties: {
218
+ cancel: {
219
+ title: '{{t("Cancel",{ns:"charts"})}}',
220
+ 'x-component': 'Action',
221
+ 'x-component-props': {
222
+ useAction: '{{ cm.useCancelAction }}'
223
+ }
224
+ },
225
+ submit: {
226
+ title: '{{t("Submit",{ns:"charts"})}}',
227
+ 'x-component': 'Action',
228
+ 'x-component-props': {
229
+ type: 'primary',
230
+ useAction: '{{ cm.useCreateAction }}'
231
+ }
232
+ }
233
+ }
234
+ }
235
+ }
236
+ }
237
+ }
238
+ }
239
+ }
240
+ },
241
+ table: {
242
+ type: 'void',
243
+ 'x-uid': 'input',
244
+ 'x-component': 'Table.Void',
245
+ 'x-component-props': {
246
+ rowKey: 'id',
247
+ rowSelection: {
248
+ type: 'checkbox'
249
+ },
250
+ useDataSource: '{{ cm.useDataSourceFromRAC }}'
251
+ },
252
+ properties: {
253
+ title: {
254
+ type: 'void',
255
+ 'x-decorator': 'Table.Column.Decorator',
256
+ 'x-component': 'Table.Column',
257
+ properties: {
258
+ title: {
259
+ type: 'number',
260
+ 'x-component': 'CollectionField',
261
+ 'x-read-pretty': true
262
+ }
263
+ }
264
+ },
265
+ type: {
266
+ type: 'void',
267
+ 'x-decorator': 'Table.Column.Decorator',
268
+ 'x-component': 'Table.Column',
269
+ properties: {
270
+ type: {
271
+ type: 'string',
272
+ 'x-component': 'CollectionField',
273
+ 'x-read-pretty': true
274
+ }
275
+ }
276
+ },
277
+ actions: {
278
+ type: 'void',
279
+ title: '{{t("Actions")}}',
280
+ 'x-component': 'Table.Column',
281
+ properties: {
282
+ actions: {
283
+ type: 'void',
284
+ 'x-component': 'Space',
285
+ 'x-component-props': {
286
+ split: '|'
287
+ },
288
+ properties: {
289
+ fields: {
290
+ type: 'void',
291
+ title: '{{t("Configure fields")}}',
292
+ 'x-component': 'Action.Link',
293
+ 'x-component-props': {
294
+ type: 'primary'
295
+ },
296
+ properties: {
297
+ drawer: {
298
+ type: 'void',
299
+ 'x-component': 'Action.Drawer',
300
+ title: '{{t("Configure fields")}}',
301
+ properties: {
302
+ configure: {
303
+ type: 'void',
304
+ 'x-component': 'ConfigureFields'
305
+ }
306
+ }
307
+ }
308
+ }
309
+ },
310
+ update: {
311
+ type: 'void',
312
+ title: '{{t("Edit")}}',
313
+ 'x-component': 'EditQuery',
314
+ 'x-component-props': {
315
+ type: 'primary'
316
+ },
317
+ properties: {
318
+ drawer: {
319
+ type: 'void',
320
+ 'x-component': 'Action.Drawer',
321
+ 'x-decorator': 'Form',
322
+ 'x-decorator-props': {
323
+ useValues: '{{ cm.useValuesFromRecord }}'
324
+ },
325
+ title: '{{t("Edit")}}',
326
+ properties: {
327
+ title: {
328
+ 'x-component': 'CollectionField',
329
+ 'x-decorator': 'FormItem'
330
+ },
331
+ footer: {
332
+ type: 'void',
333
+ 'x-component': 'Action.Drawer.Footer',
334
+ properties: {
335
+ cancel: {
336
+ title: '{{t("Cancel",{ns:"charts"})}}',
337
+ 'x-component': 'Action',
338
+ 'x-component-props': {
339
+ useAction: '{{ cm.useCancelAction }}'
340
+ }
341
+ },
342
+ submit: {
343
+ title: '{{t("Submit",{ns:"charts"})}}',
344
+ 'x-component': 'Action',
345
+ 'x-component-props': {
346
+ type: 'primary',
347
+ useAction: '{{ cm.useUpdateAction }}'
348
+ }
349
+ }
350
+ }
351
+ }
352
+ }
353
+ }
354
+ }
355
+ },
356
+ delete: {
357
+ type: 'void',
358
+ title: '{{ t("Delete") }}',
359
+ 'x-component': 'Action.Link',
360
+ 'x-component-props': {
361
+ confirm: {
362
+ title: '{{t("Delete query",{ns:"charts"})}}',
363
+ content: "{{t('Are you sure you want to delete it?')}}"
364
+ },
365
+ useAction: '{{ useDestroyQueryItemAction }}'
366
+ }
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }
376
+ }
377
+ };
378
+ exports.chartsQueriesSchema = chartsQueriesSchema;
@@ -0,0 +1,65 @@
1
+ export declare const areaTemplate: {
2
+ description: string;
3
+ type: string;
4
+ title: string;
5
+ iconId: string;
6
+ group: number;
7
+ renderComponent: string;
8
+ defaultChartOptions: {
9
+ yField: string;
10
+ xField: string;
11
+ seriesField: string;
12
+ };
13
+ configurableProperties: {
14
+ type: string;
15
+ properties: {
16
+ dimension: {
17
+ required: boolean;
18
+ type: string;
19
+ title: string;
20
+ 'x-decorator': string;
21
+ 'x-component': string;
22
+ enum: string;
23
+ };
24
+ metric: {
25
+ required: boolean;
26
+ type: string;
27
+ title: string;
28
+ 'x-decorator': string;
29
+ 'x-component': string;
30
+ enum: string;
31
+ };
32
+ category: {
33
+ type: string;
34
+ title: string;
35
+ 'x-decorator': string;
36
+ 'x-component': string;
37
+ enum: string;
38
+ };
39
+ jsonConfig: {
40
+ type: string;
41
+ 'x-component': string;
42
+ properties: {
43
+ template: {
44
+ required: boolean;
45
+ title: string;
46
+ type: string;
47
+ default: string;
48
+ 'x-decorator': string;
49
+ 'x-component': string;
50
+ 'x-component-props': {
51
+ autoSize: {
52
+ minRows: number;
53
+ maxRows: number;
54
+ };
55
+ };
56
+ description: string;
57
+ 'x-validator': {
58
+ json5: boolean;
59
+ };
60
+ };
61
+ };
62
+ };
63
+ };
64
+ };
65
+ };