@nocobase/plugin-charts 0.11.1-alpha.5 → 0.12.0-alpha.1
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.
- package/client.d.ts +2 -3
- package/client.js +1 -1
- package/{lib → dist}/client/index.d.ts +1 -0
- package/dist/client/index.js +3234 -0
- package/{lib → dist}/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/locale/en-US.js +26 -0
- package/{src/locale/es-ES.ts → dist/locale/es-ES.js} +22 -18
- package/dist/locale/fr-FR.js +5 -0
- package/dist/locale/ja-JP.js +5 -0
- package/dist/locale/pt-BR.js +26 -0
- package/dist/locale/ru-RU.js +5 -0
- package/dist/locale/tr-TR.js +5 -0
- package/dist/locale/zh-CN.js +65 -0
- package/dist/node_modules/json5/dist/index.js +1737 -0
- package/dist/node_modules/json5/dist/index.min.js +1 -0
- package/dist/node_modules/json5/lib/cli.js +152 -0
- package/dist/node_modules/json5/lib/index.d.ts +4 -0
- package/dist/node_modules/json5/lib/index.js +1 -0
- package/dist/node_modules/json5/lib/parse.d.ts +15 -0
- package/dist/node_modules/json5/lib/parse.js +1114 -0
- package/dist/node_modules/json5/lib/register.js +13 -0
- package/dist/node_modules/json5/lib/require.js +4 -0
- package/dist/node_modules/json5/lib/stringify.d.ts +89 -0
- package/dist/node_modules/json5/lib/stringify.js +261 -0
- package/dist/node_modules/json5/lib/unicode.d.ts +3 -0
- package/dist/node_modules/json5/lib/unicode.js +4 -0
- package/dist/node_modules/json5/lib/util.d.ts +5 -0
- package/dist/node_modules/json5/lib/util.js +35 -0
- package/dist/node_modules/json5/package.json +1 -0
- package/dist/server/actions/chartsQueries.js +57 -0
- package/dist/server/actions/index.js +2 -0
- package/dist/server/collections/chartsQueries.js +30 -0
- package/dist/server/index.js +11 -0
- package/dist/server/plugin.js +66 -0
- package/dist/server/query.js +39 -0
- package/dist/server/shared/index.js +5 -0
- package/package.json +17 -28
- package/server.d.ts +2 -3
- package/server.js +1 -1
- package/lib/client/ChartBlockEngine.js +0 -146
- package/lib/client/ChartBlockEngineDesigner.js +0 -293
- package/lib/client/ChartBlockInitializer.js +0 -263
- package/lib/client/ChartQueryBlockInitializer.js +0 -191
- package/lib/client/ChartQueryMetadataProvider.js +0 -91
- package/lib/client/DataSetPreviewTable.js +0 -113
- package/lib/client/Icons.js +0 -210
- package/lib/client/chartRenderComponents/index.js +0 -20
- package/lib/client/hooks/index.js +0 -38
- package/lib/client/index.js +0 -143
- package/lib/client/locale/index.js +0 -37
- package/lib/client/select/CustomSelect.js +0 -148
- package/lib/client/select/ReadPretty.js +0 -77
- package/lib/client/select/index.js +0 -27
- package/lib/client/select/shared.js +0 -66
- package/lib/client/settings/AddNewQuery.js +0 -270
- package/lib/client/settings/ConfigureFields.js +0 -39
- package/lib/client/settings/QueriesTable.js +0 -77
- package/lib/client/settings/queryTypes.js +0 -77
- package/lib/client/settings/schemas/chartsQueries.js +0 -353
- package/lib/client/templates/AreaTemplate.js +0 -81
- package/lib/client/templates/BarTemplate.js +0 -98
- package/lib/client/templates/ColumnTemplate.js +0 -98
- package/lib/client/templates/FunnelTemplate.js +0 -82
- package/lib/client/templates/LineTemplate.js +0 -89
- package/lib/client/templates/PieTemplate.js +0 -87
- package/lib/client/templates/RadarTemplate.js +0 -88
- package/lib/client/templates/ScatterTemplate.js +0 -107
- package/lib/client/templates/TableTemplate.js +0 -54
- package/lib/client/templates/index.js +0 -25
- package/lib/client/utils.js +0 -50
- package/lib/index.js +0 -13
- package/lib/locale/en-US.js +0 -29
- package/lib/locale/es-ES.js +0 -59
- package/lib/locale/fr-FR.js +0 -8
- package/lib/locale/ja-JP.js +0 -8
- package/lib/locale/pt-BR.js +0 -29
- package/lib/locale/ru-RU.js +0 -8
- package/lib/locale/tr-TR.js +0 -8
- package/lib/locale/zh-CN.js +0 -68
- package/lib/server/actions/chartsQueries.js +0 -89
- package/lib/server/actions/index.js +0 -1
- package/lib/server/collections/chartsQueries.js +0 -33
- package/lib/server/index.js +0 -13
- package/lib/server/plugin.js +0 -106
- package/lib/server/query.js +0 -71
- package/lib/server/shared/index.js +0 -8
- package/src/client/ChartBlockEngine.tsx +0 -121
- package/src/client/ChartBlockEngineDesigner.tsx +0 -248
- package/src/client/ChartBlockInitializer.tsx +0 -223
- package/src/client/ChartQueryBlockInitializer.tsx +0 -156
- package/src/client/ChartQueryMetadataProvider.tsx +0 -64
- package/src/client/DataSetPreviewTable.tsx +0 -71
- package/src/client/Icons.tsx +0 -99
- package/src/client/chartRenderComponents/index.ts +0 -7
- package/src/client/hooks/index.ts +0 -19
- package/src/client/index.tsx +0 -115
- package/src/client/locale/index.ts +0 -18
- package/src/client/select/CustomSelect.tsx +0 -126
- package/src/client/select/ReadPretty.tsx +0 -39
- package/src/client/select/index.md +0 -31
- package/src/client/select/index.ts +0 -2
- package/src/client/select/shared.ts +0 -37
- package/src/client/settings/AddNewQuery.tsx +0 -176
- package/src/client/settings/ConfigureFields.tsx +0 -18
- package/src/client/settings/QueriesTable.tsx +0 -26
- package/src/client/settings/queryTypes.ts +0 -65
- package/src/client/settings/schemas/chartsQueries.ts +0 -319
- package/src/client/templates/AreaTemplate.tsx +0 -64
- package/src/client/templates/BarTemplate.tsx +0 -80
- package/src/client/templates/ColumnTemplate.tsx +0 -81
- package/src/client/templates/FunnelTemplate.tsx +0 -65
- package/src/client/templates/LineTemplate.tsx +0 -72
- package/src/client/templates/PieTemplate.tsx +0 -68
- package/src/client/templates/RadarTemplate.tsx +0 -71
- package/src/client/templates/ScatterTemplate.tsx +0 -90
- package/src/client/templates/TableTemplate.tsx +0 -48
- package/src/client/templates/index.ts +0 -21
- package/src/client/utils.ts +0 -39
- package/src/index.ts +0 -1
- package/src/locale/en-US.ts +0 -23
- package/src/locale/fr-FR.ts +0 -1
- package/src/locale/ja-JP.ts +0 -1
- package/src/locale/pt-BR.ts +0 -23
- package/src/locale/ru-RU.ts +0 -1
- package/src/locale/tr-TR.ts +0 -1
- package/src/locale/zh-CN.ts +0 -64
- package/src/server/actions/chartsQueries.ts +0 -49
- package/src/server/actions/index.ts +0 -0
- package/src/server/collections/.gitkeep +0 -0
- package/src/server/collections/chartsQueries.ts +0 -26
- package/src/server/index.ts +0 -1
- package/src/server/plugin.ts +0 -61
- package/src/server/query.ts +0 -39
- package/src/server/shared/index.ts +0 -2
- /package/{lib → dist}/client/ChartBlockEngine.d.ts +0 -0
- /package/{lib → dist}/client/ChartBlockEngineDesigner.d.ts +0 -0
- /package/{lib → dist}/client/ChartBlockInitializer.d.ts +0 -0
- /package/{lib → dist}/client/ChartQueryBlockInitializer.d.ts +0 -0
- /package/{lib → dist}/client/ChartQueryMetadataProvider.d.ts +0 -0
- /package/{lib → dist}/client/DataSetPreviewTable.d.ts +0 -0
- /package/{lib → dist}/client/Icons.d.ts +0 -0
- /package/{lib → dist}/client/chartRenderComponents/index.d.ts +0 -0
- /package/{lib → dist}/client/hooks/index.d.ts +0 -0
- /package/{lib → dist}/client/locale/index.d.ts +0 -0
- /package/{lib → dist}/client/select/CustomSelect.d.ts +0 -0
- /package/{lib → dist}/client/select/ReadPretty.d.ts +0 -0
- /package/{lib → dist}/client/select/index.d.ts +0 -0
- /package/{lib → dist}/client/select/shared.d.ts +0 -0
- /package/{lib → dist}/client/settings/AddNewQuery.d.ts +0 -0
- /package/{lib → dist}/client/settings/ConfigureFields.d.ts +0 -0
- /package/{lib → dist}/client/settings/QueriesTable.d.ts +0 -0
- /package/{lib → dist}/client/settings/queryTypes.d.ts +0 -0
- /package/{lib → dist}/client/settings/schemas/chartsQueries.d.ts +0 -0
- /package/{lib → dist}/client/templates/AreaTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/BarTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/ColumnTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/FunnelTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/LineTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/PieTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/RadarTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/ScatterTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/TableTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/index.d.ts +0 -0
- /package/{lib → dist}/client/utils.d.ts +0 -0
- /package/{lib → dist}/locale/en-US.d.ts +0 -0
- /package/{lib → dist}/locale/es-ES.d.ts +0 -0
- /package/{lib → dist}/locale/fr-FR.d.ts +0 -0
- /package/{lib → dist}/locale/ja-JP.d.ts +0 -0
- /package/{lib → dist}/locale/pt-BR.d.ts +0 -0
- /package/{lib → dist}/locale/ru-RU.d.ts +0 -0
- /package/{lib → dist}/locale/tr-TR.d.ts +0 -0
- /package/{lib → dist}/locale/zh-CN.d.ts +0 -0
- /package/{lib → dist}/server/actions/chartsQueries.d.ts +0 -0
- /package/{lib → dist}/server/actions/index.d.ts +0 -0
- /package/{lib → dist}/server/collections/chartsQueries.d.ts +0 -0
- /package/{lib → dist}/server/index.d.ts +0 -0
- /package/{lib → dist}/server/plugin.d.ts +0 -0
- /package/{lib → dist}/server/query.d.ts +0 -0
- /package/{lib → dist}/server/shared/index.d.ts +0 -0
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ReadPretty = void 0;
|
|
7
|
-
function _core() {
|
|
8
|
-
const data = require("@formily/core");
|
|
9
|
-
_core = function _core() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _react() {
|
|
15
|
-
const data = require("@formily/react");
|
|
16
|
-
_react = function _react() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _shared() {
|
|
22
|
-
const data = require("@formily/shared");
|
|
23
|
-
_shared = function _shared() {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
function _antd() {
|
|
29
|
-
const data = require("antd");
|
|
30
|
-
_antd = function _antd() {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
function _react2() {
|
|
36
|
-
const data = _interopRequireDefault(require("react"));
|
|
37
|
-
_react2 = function _react2() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
|
-
var _shared2 = require("./shared");
|
|
43
|
-
function _client() {
|
|
44
|
-
const data = require("@nocobase/client");
|
|
45
|
-
_client = function _client() {
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
return data;
|
|
49
|
-
}
|
|
50
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
51
|
-
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; }
|
|
52
|
-
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; }
|
|
53
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
54
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
55
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
56
|
-
const ReadPretty = (0, _react().observer)(props => {
|
|
57
|
-
var _field$value;
|
|
58
|
-
const fieldNames = _objectSpread(_objectSpread({}, _shared2.defaultFieldNames), props.fieldNames);
|
|
59
|
-
const field = (0, _react().useField)();
|
|
60
|
-
const compile = (0, _client().useCompile)();
|
|
61
|
-
if (!(0, _shared().isValid)(props.value)) {
|
|
62
|
-
return _react2().default.createElement("div", null);
|
|
63
|
-
}
|
|
64
|
-
if ((0, _core().isArrayField)(field) && (field === null || field === void 0 ? void 0 : (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.length) === 0) {
|
|
65
|
-
return _react2().default.createElement("div", null);
|
|
66
|
-
}
|
|
67
|
-
const dataSource = field.dataSource || props.options || [];
|
|
68
|
-
const options = (0, _shared2.getCurrentOptions)(field.value, dataSource, fieldNames);
|
|
69
|
-
return _react2().default.createElement("div", null, options.map((option, key) => _react2().default.createElement(_antd().Tag, {
|
|
70
|
-
key: key,
|
|
71
|
-
color: option[fieldNames.color],
|
|
72
|
-
icon: option.icon
|
|
73
|
-
}, compile(option[fieldNames.label]))));
|
|
74
|
-
}, {
|
|
75
|
-
displayName: 'ReadPretty'
|
|
76
|
-
});
|
|
77
|
-
exports.ReadPretty = ReadPretty;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _CustomSelect = require("./CustomSelect");
|
|
7
|
-
Object.keys(_CustomSelect).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _CustomSelect[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _CustomSelect[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _shared = require("./shared");
|
|
18
|
-
Object.keys(_shared).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _shared[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _shared[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getCurrentOptions = exports.defaultFieldNames = void 0;
|
|
7
|
-
function _client() {
|
|
8
|
-
const data = require("@nocobase/utils/client");
|
|
9
|
-
_client = function _client() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
15
|
-
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); }
|
|
16
|
-
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; }
|
|
17
|
-
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; }
|
|
18
|
-
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; }
|
|
19
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
21
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
|
-
const defaultFieldNames = {
|
|
23
|
-
label: 'label',
|
|
24
|
-
value: 'value',
|
|
25
|
-
color: 'color',
|
|
26
|
-
options: 'children'
|
|
27
|
-
};
|
|
28
|
-
exports.defaultFieldNames = defaultFieldNames;
|
|
29
|
-
const getCurrentOptions = (values, dataSource, fieldNames) => {
|
|
30
|
-
function flatData(data) {
|
|
31
|
-
const newArr = [];
|
|
32
|
-
for (let i = 0; i < data.length; i++) {
|
|
33
|
-
const children = data[i][fieldNames.options];
|
|
34
|
-
if (Array.isArray(children)) {
|
|
35
|
-
newArr.push(...flatData(children));
|
|
36
|
-
}
|
|
37
|
-
newArr.push(_objectSpread({}, data[i]));
|
|
38
|
-
}
|
|
39
|
-
return newArr;
|
|
40
|
-
}
|
|
41
|
-
const result = flatData(dataSource);
|
|
42
|
-
values = _client().lodash.castArray(values).filter(item => item != null).map(val => typeof val === 'object' ? val[fieldNames.value] : val);
|
|
43
|
-
const findOptions = options => {
|
|
44
|
-
if (!options) return [];
|
|
45
|
-
const current = [];
|
|
46
|
-
var _iterator = _createForOfIteratorHelper(values),
|
|
47
|
-
_step;
|
|
48
|
-
try {
|
|
49
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
50
|
-
const value = _step.value;
|
|
51
|
-
const option = options.find(v => v[fieldNames.value] === value) || {
|
|
52
|
-
value: value,
|
|
53
|
-
label: value
|
|
54
|
-
};
|
|
55
|
-
current.push(option);
|
|
56
|
-
}
|
|
57
|
-
} catch (err) {
|
|
58
|
-
_iterator.e(err);
|
|
59
|
-
} finally {
|
|
60
|
-
_iterator.f();
|
|
61
|
-
}
|
|
62
|
-
return current;
|
|
63
|
-
};
|
|
64
|
-
return findOptions(result);
|
|
65
|
-
};
|
|
66
|
-
exports.getCurrentOptions = getCurrentOptions;
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.EditQuery = exports.AddNewQuery = void 0;
|
|
7
|
-
function _icons() {
|
|
8
|
-
const data = require("@ant-design/icons");
|
|
9
|
-
_icons = function _icons() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _core() {
|
|
15
|
-
const data = require("@formily/core");
|
|
16
|
-
_core = function _core() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _react() {
|
|
22
|
-
const data = require("@formily/react");
|
|
23
|
-
_react = function _react() {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
function _shared() {
|
|
29
|
-
const data = require("@formily/shared");
|
|
30
|
-
_shared = function _shared() {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
function _client() {
|
|
36
|
-
const data = require("@nocobase/client");
|
|
37
|
-
_client = function _client() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
|
-
function _antd() {
|
|
43
|
-
const data = require("antd");
|
|
44
|
-
_antd = function _antd() {
|
|
45
|
-
return data;
|
|
46
|
-
};
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
|
-
function _react2() {
|
|
50
|
-
const data = _interopRequireWildcard(require("react"));
|
|
51
|
-
_react2 = function _react2() {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
return data;
|
|
55
|
-
}
|
|
56
|
-
var _ChartQueryMetadataProvider = require("../ChartQueryMetadataProvider");
|
|
57
|
-
var _locale = require("../locale");
|
|
58
|
-
var _queryTypes = require("./queryTypes");
|
|
59
|
-
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); }
|
|
60
|
-
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; }
|
|
61
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
62
|
-
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."); }
|
|
63
|
-
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); }
|
|
64
|
-
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; }
|
|
65
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
66
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
67
|
-
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); } }
|
|
68
|
-
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); }); }; }
|
|
69
|
-
const useCreateAction = () => {
|
|
70
|
-
const _useActionContext = (0, _client().useActionContext)(),
|
|
71
|
-
setVisible = _useActionContext.setVisible;
|
|
72
|
-
const form = (0, _react().useForm)();
|
|
73
|
-
const _useResourceActionCon = (0, _client().useResourceActionContext)(),
|
|
74
|
-
refresh = _useResourceActionCon.refresh;
|
|
75
|
-
const _useResourceContext = (0, _client().useResourceContext)(),
|
|
76
|
-
resource = _useResourceContext.resource;
|
|
77
|
-
const ctx = (0, _ChartQueryMetadataProvider.useChartQueryMetadataContext)();
|
|
78
|
-
return {
|
|
79
|
-
run() {
|
|
80
|
-
return _asyncToGenerator(function* () {
|
|
81
|
-
yield form.submit();
|
|
82
|
-
yield resource.create({
|
|
83
|
-
values: form.values
|
|
84
|
-
});
|
|
85
|
-
setVisible(false);
|
|
86
|
-
yield form.reset();
|
|
87
|
-
refresh();
|
|
88
|
-
ctx.refresh();
|
|
89
|
-
})();
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
const useUpdateAction = () => {
|
|
94
|
-
const _useActionContext2 = (0, _client().useActionContext)(),
|
|
95
|
-
setVisible = _useActionContext2.setVisible;
|
|
96
|
-
const form = (0, _react().useForm)();
|
|
97
|
-
const _useResourceActionCon2 = (0, _client().useResourceActionContext)(),
|
|
98
|
-
refresh = _useResourceActionCon2.refresh;
|
|
99
|
-
const _useResourceContext2 = (0, _client().useResourceContext)(),
|
|
100
|
-
resource = _useResourceContext2.resource,
|
|
101
|
-
targetKey = _useResourceContext2.targetKey;
|
|
102
|
-
const _useRecord = (0, _client().useRecord)(),
|
|
103
|
-
filterByTk = _useRecord[targetKey];
|
|
104
|
-
const ctx = (0, _ChartQueryMetadataProvider.useChartQueryMetadataContext)();
|
|
105
|
-
return {
|
|
106
|
-
run() {
|
|
107
|
-
return _asyncToGenerator(function* () {
|
|
108
|
-
yield form.submit();
|
|
109
|
-
yield resource.update({
|
|
110
|
-
filterByTk,
|
|
111
|
-
values: form.values
|
|
112
|
-
});
|
|
113
|
-
setVisible(false);
|
|
114
|
-
yield form.reset();
|
|
115
|
-
refresh();
|
|
116
|
-
ctx.refresh();
|
|
117
|
-
})();
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
const useCloseAction = () => {
|
|
122
|
-
const _useActionContext3 = (0, _client().useActionContext)(),
|
|
123
|
-
setVisible = _useActionContext3.setVisible;
|
|
124
|
-
return {
|
|
125
|
-
run() {
|
|
126
|
-
return _asyncToGenerator(function* () {
|
|
127
|
-
setVisible(false);
|
|
128
|
-
})();
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
const getSchema = (initialValue, {
|
|
133
|
-
form,
|
|
134
|
-
isNewRecord
|
|
135
|
-
}) => {
|
|
136
|
-
const type = initialValue.type;
|
|
137
|
-
const schema = {
|
|
138
|
-
type: 'void',
|
|
139
|
-
name: (0, _shared().uid)(),
|
|
140
|
-
'x-component': 'Action.Drawer',
|
|
141
|
-
'x-decorator': 'Form',
|
|
142
|
-
'x-decorator-props': {
|
|
143
|
-
form
|
|
144
|
-
// initialValue: JSON.parse(JSON.stringify(initialValue)),
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
title: isNewRecord ? (0, _locale.lang)('Add query') : (0, _locale.lang)('Edit query'),
|
|
148
|
-
properties: {
|
|
149
|
-
title: {
|
|
150
|
-
title: (0, _locale.lang)('Title'),
|
|
151
|
-
required: true,
|
|
152
|
-
'x-component': 'Input',
|
|
153
|
-
'x-decorator': 'FormItem'
|
|
154
|
-
},
|
|
155
|
-
options: (0, _queryTypes.getQueryTypeSchema)(type),
|
|
156
|
-
footer: {
|
|
157
|
-
type: 'void',
|
|
158
|
-
'x-component': 'Action.Drawer.Footer',
|
|
159
|
-
properties: {
|
|
160
|
-
cancel: {
|
|
161
|
-
'x-component': 'Action',
|
|
162
|
-
title: (0, _locale.lang)('Cancel'),
|
|
163
|
-
'x-component-props': {
|
|
164
|
-
useAction: '{{ useCloseAction }}'
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
submit: {
|
|
168
|
-
'x-component': 'Action',
|
|
169
|
-
title: (0, _locale.lang)('Submit'),
|
|
170
|
-
'x-component-props': {
|
|
171
|
-
type: 'primary',
|
|
172
|
-
useAction: '{{ useSubmitAction }}'
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
return schema;
|
|
180
|
-
};
|
|
181
|
-
const AddNewQuery = () => {
|
|
182
|
-
const _useState = (0, _react2().useState)(false),
|
|
183
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
184
|
-
visible = _useState2[0],
|
|
185
|
-
setVisible = _useState2[1];
|
|
186
|
-
const _useState3 = (0, _react2().useState)({}),
|
|
187
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
188
|
-
schema = _useState4[0],
|
|
189
|
-
setSchema = _useState4[1];
|
|
190
|
-
const form = (0, _react2().useMemo)(() => (0, _core().createForm)(), []);
|
|
191
|
-
const menu = (0, _react2().useMemo)(() => {
|
|
192
|
-
return {
|
|
193
|
-
onClick: info => {
|
|
194
|
-
setVisible(true);
|
|
195
|
-
form.setValues({
|
|
196
|
-
type: info.key
|
|
197
|
-
});
|
|
198
|
-
setSchema(getSchema({
|
|
199
|
-
type: info.key
|
|
200
|
-
}, {
|
|
201
|
-
form,
|
|
202
|
-
isNewRecord: true
|
|
203
|
-
}));
|
|
204
|
-
},
|
|
205
|
-
items: [{
|
|
206
|
-
key: 'json',
|
|
207
|
-
label: 'JSON'
|
|
208
|
-
}, {
|
|
209
|
-
key: 'sql',
|
|
210
|
-
label: 'SQL'
|
|
211
|
-
}, {
|
|
212
|
-
key: 'api',
|
|
213
|
-
label: 'API',
|
|
214
|
-
disabled: true
|
|
215
|
-
}, {
|
|
216
|
-
key: 'collection',
|
|
217
|
-
label: 'Collection',
|
|
218
|
-
disabled: true
|
|
219
|
-
}]
|
|
220
|
-
};
|
|
221
|
-
}, [form]);
|
|
222
|
-
return _react2().default.createElement(_client().ActionContextProvider, {
|
|
223
|
-
value: {
|
|
224
|
-
visible,
|
|
225
|
-
setVisible
|
|
226
|
-
}
|
|
227
|
-
}, _react2().default.createElement(_antd().Dropdown, {
|
|
228
|
-
menu: menu
|
|
229
|
-
}, _react2().default.createElement(_antd().Button, {
|
|
230
|
-
icon: _react2().default.createElement(_icons().PlusOutlined, null),
|
|
231
|
-
type: 'primary'
|
|
232
|
-
}, (0, _locale.lang)('Add query'), " ", _react2().default.createElement(_icons().DownOutlined, null))), _react2().default.createElement(_client().SchemaComponent, {
|
|
233
|
-
schema: schema,
|
|
234
|
-
scope: {
|
|
235
|
-
useCloseAction,
|
|
236
|
-
useSubmitAction: useCreateAction
|
|
237
|
-
}
|
|
238
|
-
}));
|
|
239
|
-
};
|
|
240
|
-
exports.AddNewQuery = AddNewQuery;
|
|
241
|
-
const EditQuery = () => {
|
|
242
|
-
const _useState5 = (0, _react2().useState)(false),
|
|
243
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
244
|
-
visible = _useState6[0],
|
|
245
|
-
setVisible = _useState6[1];
|
|
246
|
-
const record = (0, _client().useRecord)();
|
|
247
|
-
const form = (0, _react2().useMemo)(() => (0, _core().createForm)(), []);
|
|
248
|
-
const schema = getSchema(record, {
|
|
249
|
-
form,
|
|
250
|
-
isNewRecord: false
|
|
251
|
-
});
|
|
252
|
-
return _react2().default.createElement(_client().ActionContextProvider, {
|
|
253
|
-
value: {
|
|
254
|
-
visible,
|
|
255
|
-
setVisible
|
|
256
|
-
}
|
|
257
|
-
}, _react2().default.createElement("a", {
|
|
258
|
-
onClick: () => {
|
|
259
|
-
form.setValues(record);
|
|
260
|
-
setVisible(true);
|
|
261
|
-
}
|
|
262
|
-
}, (0, _locale.lang)('Edit')), _react2().default.createElement(_client().SchemaComponent, {
|
|
263
|
-
schema: schema,
|
|
264
|
-
scope: {
|
|
265
|
-
useCloseAction,
|
|
266
|
-
useSubmitAction: useUpdateAction
|
|
267
|
-
}
|
|
268
|
-
}));
|
|
269
|
-
};
|
|
270
|
-
exports.EditQuery = EditQuery;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ConfigureFields = void 0;
|
|
7
|
-
function _client() {
|
|
8
|
-
const data = require("@nocobase/client");
|
|
9
|
-
_client = function _client() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _antd() {
|
|
15
|
-
const data = require("antd");
|
|
16
|
-
_antd = function _antd() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _react() {
|
|
22
|
-
const data = _interopRequireDefault(require("react"));
|
|
23
|
-
_react = function _react() {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
const ConfigureFields = () => {
|
|
30
|
-
const record = (0, _client().useRecord)();
|
|
31
|
-
return _react().default.createElement(_antd().Table, {
|
|
32
|
-
columns: [{
|
|
33
|
-
title: '字段标识',
|
|
34
|
-
dataIndex: 'name'
|
|
35
|
-
}],
|
|
36
|
-
dataSource: record.fields || []
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
exports.ConfigureFields = ConfigureFields;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.QueriesTable = void 0;
|
|
7
|
-
function _client() {
|
|
8
|
-
const data = require("@nocobase/client");
|
|
9
|
-
_client = function _client() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _antd() {
|
|
15
|
-
const data = require("antd");
|
|
16
|
-
_antd = function _antd() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _react() {
|
|
22
|
-
const data = _interopRequireWildcard(require("react"));
|
|
23
|
-
_react = function _react() {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
function _reactI18next() {
|
|
29
|
-
const data = require("react-i18next");
|
|
30
|
-
_reactI18next = function _reactI18next() {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
var _AddNewQuery = require("./AddNewQuery");
|
|
36
|
-
var _ConfigureFields = require("./ConfigureFields");
|
|
37
|
-
var _chartsQueries = require("./schemas/chartsQueries");
|
|
38
|
-
function _json() {
|
|
39
|
-
const data = _interopRequireDefault(require("json5"));
|
|
40
|
-
_json = function _json() {
|
|
41
|
-
return data;
|
|
42
|
-
};
|
|
43
|
-
return data;
|
|
44
|
-
}
|
|
45
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
46
|
-
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); }
|
|
47
|
-
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; }
|
|
48
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
49
|
-
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."); }
|
|
50
|
-
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); }
|
|
51
|
-
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; }
|
|
52
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
53
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
54
|
-
const QueriesTable = () => {
|
|
55
|
-
const _useState = (0, _react().useState)(false),
|
|
56
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
-
visible = _useState2[0],
|
|
58
|
-
setVisible = _useState2[1];
|
|
59
|
-
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
60
|
-
t = _useTranslation.t;
|
|
61
|
-
return _react().default.createElement(_antd().Card, {
|
|
62
|
-
bordered: false
|
|
63
|
-
}, _react().default.createElement(_client().SchemaComponent, {
|
|
64
|
-
scope: {
|
|
65
|
-
JSON5: _json().default,
|
|
66
|
-
useDestroyQueryItemAction: _chartsQueries.useDestroyQueryItemAction,
|
|
67
|
-
useDestroyAllSelectedQueriesAction: _chartsQueries.useDestroyAllSelectedQueriesAction
|
|
68
|
-
},
|
|
69
|
-
schema: _chartsQueries.chartsQueriesSchema,
|
|
70
|
-
components: {
|
|
71
|
-
AddNewQuery: _AddNewQuery.AddNewQuery,
|
|
72
|
-
EditQuery: _AddNewQuery.EditQuery,
|
|
73
|
-
ConfigureFields: _ConfigureFields.ConfigureFields
|
|
74
|
-
}
|
|
75
|
-
}));
|
|
76
|
-
};
|
|
77
|
-
exports.QueriesTable = QueriesTable;
|
|
@@ -1,77 +0,0 @@
|
|
|
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
|
-
function _client() {
|
|
8
|
-
const data = require("@nocobase/utils/client");
|
|
9
|
-
_client = function _client() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
const json = {
|
|
15
|
-
type: 'object',
|
|
16
|
-
properties: {
|
|
17
|
-
data: {
|
|
18
|
-
title: 'JSON',
|
|
19
|
-
required: true,
|
|
20
|
-
'x-component': 'Input.TextArea',
|
|
21
|
-
'x-validator': {
|
|
22
|
-
json5: true
|
|
23
|
-
},
|
|
24
|
-
'x-component-props': {
|
|
25
|
-
autoSize: {
|
|
26
|
-
maxRows: 20,
|
|
27
|
-
minRows: 10
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
'x-decorator': 'FormItem'
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
exports.json = json;
|
|
35
|
-
const sql = {
|
|
36
|
-
type: 'object',
|
|
37
|
-
properties: {
|
|
38
|
-
sql: {
|
|
39
|
-
title: 'SQL',
|
|
40
|
-
required: true,
|
|
41
|
-
'x-component': 'Input.TextArea',
|
|
42
|
-
'x-decorator': 'FormItem',
|
|
43
|
-
'x-validator': {
|
|
44
|
-
triggerType: 'onBlur',
|
|
45
|
-
validator: '{{validateSQL}}'
|
|
46
|
-
},
|
|
47
|
-
'x-component-props': {
|
|
48
|
-
autoSize: {
|
|
49
|
-
maxRows: 20,
|
|
50
|
-
minRows: 10
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
exports.sql = sql;
|
|
57
|
-
const api = {
|
|
58
|
-
type: 'object',
|
|
59
|
-
properties: {
|
|
60
|
-
api: {
|
|
61
|
-
title: 'API',
|
|
62
|
-
required: true,
|
|
63
|
-
'x-component': 'Input',
|
|
64
|
-
'x-decorator': 'FormItem'
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
exports.api = api;
|
|
69
|
-
const types = {
|
|
70
|
-
json,
|
|
71
|
-
sql,
|
|
72
|
-
api
|
|
73
|
-
};
|
|
74
|
-
const getQueryTypeSchema = type => {
|
|
75
|
-
return _client().lodash.cloneDeep(types[type]);
|
|
76
|
-
};
|
|
77
|
-
exports.getQueryTypeSchema = getQueryTypeSchema;
|