@nocobase/plugin-charts 0.9.1-alpha.2 → 0.9.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.
- package/lib/client/ChartBlockEngine.js +17 -71
- package/lib/client/ChartBlockEngineDesigner.js +13 -73
- package/lib/client/ChartBlockInitializer.js +16 -72
- package/lib/client/ChartQueryBlockInitializer.js +18 -65
- package/lib/client/ChartQueryMetadataProvider.js +1 -28
- package/lib/client/DataSetPreviewTable.js +14 -28
- package/lib/client/Icons.js +3 -19
- package/lib/client/chartRenderComponents/index.js +0 -6
- package/lib/client/hooks/index.js +4 -18
- package/lib/client/index.js +0 -33
- package/lib/client/locale/index.js +2 -11
- package/lib/client/locale/pt-BR.d.ts +23 -0
- package/lib/client/locale/pt-BR.js +29 -0
- package/lib/client/select/CustomSelect.js +9 -47
- package/lib/client/select/ReadPretty.js +3 -30
- package/lib/client/select/index.js +0 -4
- package/lib/client/select/shared.js +4 -24
- package/lib/client/settings/AddNewQuery.js +22 -81
- package/lib/client/settings/ConfigureFields.js +0 -12
- package/lib/client/settings/QueriesTable.js +5 -36
- package/lib/client/settings/queryTypes.js +0 -7
- package/lib/client/settings/schemas/chartsQueries.js +12 -37
- package/lib/client/templates/AreaTemplate.js +0 -5
- package/lib/client/templates/BarTemplate.js +0 -5
- package/lib/client/templates/ColumnTemplate.js +0 -5
- package/lib/client/templates/FunnelTemplate.js +0 -5
- package/lib/client/templates/LineTemplate.js +4 -7
- package/lib/client/templates/PieTemplate.js +0 -5
- package/lib/client/templates/RadarTemplate.js +0 -5
- package/lib/client/templates/ScatterTemplate.js +0 -5
- package/lib/client/templates/index.js +2 -10
- package/lib/client/utils.js +0 -16
- package/lib/index.js +0 -2
- package/lib/server/actions/chartsQueries.js +16 -31
- package/lib/server/collections/chartsQueries.js +2 -5
- package/lib/server/index.js +0 -2
- package/lib/server/plugin.js +0 -36
- package/lib/server/query.js +5 -25
- package/package.json +5 -5
- package/src/client/DataSetPreviewTable.tsx +8 -1
- package/src/client/locale/pt-BR.ts +23 -0
- package/src/server/actions/chartsQueries.ts +11 -6
- package/src/server/collections/chartsQueries.ts +2 -0
package/lib/client/Icons.js
CHANGED
|
@@ -2,32 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
function _client() {
|
|
4
4
|
const data = require("@nocobase/client");
|
|
5
|
-
|
|
6
5
|
_client = function _client() {
|
|
7
6
|
return data;
|
|
8
7
|
};
|
|
9
|
-
|
|
10
8
|
return data;
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
function _react() {
|
|
14
11
|
const data = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
12
|
_react = function _react() {
|
|
17
13
|
return data;
|
|
18
14
|
};
|
|
19
|
-
|
|
20
15
|
return data;
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
|
|
25
18
|
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; }
|
|
26
|
-
|
|
27
19
|
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; }
|
|
28
|
-
|
|
29
|
-
function
|
|
30
|
-
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
22
|
+
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); }
|
|
31
23
|
const RadarChart = () => _react().default.createElement("svg", {
|
|
32
24
|
width: "1em",
|
|
33
25
|
height: "1em",
|
|
@@ -64,7 +56,6 @@ const RadarChart = () => _react().default.createElement("svg", {
|
|
|
64
56
|
}), _react().default.createElement("path", {
|
|
65
57
|
d: "M245.7 318.4l250.3-114 0-82.8c-125 4.8-234.8 68.5-302.8 164L245.7 318.4z"
|
|
66
58
|
}));
|
|
67
|
-
|
|
68
59
|
const FunnelChart = () => _react().default.createElement("svg", {
|
|
69
60
|
width: "1em",
|
|
70
61
|
height: "1em",
|
|
@@ -83,7 +74,6 @@ const FunnelChart = () => _react().default.createElement("svg", {
|
|
|
83
74
|
}), _react().default.createElement("path", {
|
|
84
75
|
d: "M391.6 576l232.5 0 0 64-232.5 0 0-64Z"
|
|
85
76
|
}));
|
|
86
|
-
|
|
87
77
|
const ScatterChart = () => _react().default.createElement("svg", {
|
|
88
78
|
width: "1em",
|
|
89
79
|
height: "1em",
|
|
@@ -114,7 +104,6 @@ const ScatterChart = () => _react().default.createElement("svg", {
|
|
|
114
104
|
}), _react().default.createElement("path", {
|
|
115
105
|
d: "M439.9 662.4m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"
|
|
116
106
|
}));
|
|
117
|
-
|
|
118
107
|
const ColumnChart = () => _react().default.createElement("svg", {
|
|
119
108
|
width: "1em",
|
|
120
109
|
height: "1em",
|
|
@@ -137,7 +126,6 @@ const ColumnChart = () => _react().default.createElement("svg", {
|
|
|
137
126
|
}), _react().default.createElement("path", {
|
|
138
127
|
d: "M645.5 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7l0-97.2c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L645.5 734.3z"
|
|
139
128
|
}));
|
|
140
|
-
|
|
141
129
|
const BarChart = () => _react().default.createElement("svg", {
|
|
142
130
|
width: "1em",
|
|
143
131
|
height: "1em",
|
|
@@ -148,7 +136,6 @@ const BarChart = () => _react().default.createElement("svg", {
|
|
|
148
136
|
}, _react().default.createElement("path", {
|
|
149
137
|
d: "M131.072 156.16c0-17.92 14.336-31.744 31.744-31.744 17.92 0 31.744 14.336 31.744 31.744v712.192c0 17.92-14.336 31.744-31.744 31.744-17.92 0-31.744-14.336-31.744-31.744V156.16zM292.864 338.944c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h245.248c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-245.248zM292.864 490.496c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744H640c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-347.136zM292.864 794.112c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h499.712c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-499.712zM292.864 642.56c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h97.28c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-97.28z"
|
|
150
138
|
}));
|
|
151
|
-
|
|
152
139
|
const LineChart = () => _react().default.createElement("svg", {
|
|
153
140
|
width: "1em",
|
|
154
141
|
height: "1em",
|
|
@@ -167,7 +154,6 @@ const LineChart = () => _react().default.createElement("svg", {
|
|
|
167
154
|
}), _react().default.createElement("path", {
|
|
168
155
|
d: "M608 595.3c12.4 12.4 12.4 32.4 0 44.8l0 0c-12.4 12.4-32.4 12.4-44.8 0L436 512.8c-12.4-12.4-12.4-32.4 0-44.8l0 0c12.4-12.4 32.4-12.4 44.8 0L608 595.3z"
|
|
169
156
|
}));
|
|
170
|
-
|
|
171
157
|
const PieChart = () => _react().default.createElement("svg", {
|
|
172
158
|
width: "1em",
|
|
173
159
|
height: "1em",
|
|
@@ -182,7 +168,6 @@ const PieChart = () => _react().default.createElement("svg", {
|
|
|
182
168
|
}), _react().default.createElement("path", {
|
|
183
169
|
d: "M819.5 281.6 564.1 505.1 822 739c3-4 5.9-8.1 8.7-12.3 41.4-61.3 65.6-135.2 65.6-214.7C896.3 425.6 867.7 345.8 819.5 281.6z"
|
|
184
170
|
}));
|
|
185
|
-
|
|
186
171
|
const AreaChart = () => _react().default.createElement("svg", {
|
|
187
172
|
width: "1em",
|
|
188
173
|
height: "1em",
|
|
@@ -197,7 +182,6 @@ const AreaChart = () => _react().default.createElement("svg", {
|
|
|
197
182
|
}), _react().default.createElement("path", {
|
|
198
183
|
d: "M830.6 338.2 830.6 338.2c0.9-9.2-2.1-18.6-9.1-25.7-12.4-12.4-32.4-12.4-44.8 0L586 503.3 480.8 398.1c-6.2-6.2-14.4-9.3-22.5-9.3-8.1 0-16.3 3.1-22.5 9.3L262.4 571.5c-6 6-9.1 13.8-9.3 21.6 0 0.1 0 0.1 0 0.2l0 111.8c0 35.3 28.7 64 64 64l449.7 0c33.8 0 61.4-26.1 63.8-59.3l0 0 0-0.2c0.1-1.5 0.2-3 0.2-4.5L830.8 593.3c0-0.3-0.1-0.7-0.2-1L830.6 338.2z"
|
|
199
184
|
}));
|
|
200
|
-
|
|
201
185
|
_client().Icon.register({
|
|
202
186
|
'icon-area': props => _react().default.createElement(_client().Icon, _objectSpread({
|
|
203
187
|
component: AreaChart
|
|
@@ -4,21 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _client() {
|
|
9
8
|
const data = require("@nocobase/client");
|
|
10
|
-
|
|
11
9
|
_client = function _client() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
var _DataSetPreviewTable = _interopRequireDefault(require("../DataSetPreviewTable"));
|
|
19
|
-
|
|
20
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
16
|
const chartRenderComponentsMap = new Map();
|
|
23
17
|
chartRenderComponentsMap.set('G2Plot', _client().G2Plot);
|
|
24
18
|
chartRenderComponentsMap.set('DataSetPreviewTable', _DataSetPreviewTable.default);
|
|
@@ -4,41 +4,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useFieldsById = void 0;
|
|
7
|
-
|
|
8
7
|
var _ChartQueryMetadataProvider = require("../ChartQueryMetadataProvider");
|
|
9
|
-
|
|
10
8
|
function _react() {
|
|
11
9
|
const data = require("react");
|
|
12
|
-
|
|
13
10
|
_react = function _react() {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
-
|
|
22
16
|
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."); }
|
|
23
|
-
|
|
24
17
|
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); }
|
|
25
|
-
|
|
26
18
|
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; }
|
|
27
|
-
|
|
28
|
-
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; }
|
|
29
|
-
|
|
19
|
+
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; } }
|
|
30
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
-
|
|
32
21
|
const useFieldsById = queryId => {
|
|
33
22
|
const _useState = (0, _react().useState)([]),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
fields = _useState2[0],
|
|
25
|
+
setFields = _useState2[1];
|
|
38
26
|
const ctx = (0, _ChartQueryMetadataProvider.useChartQueryMetadataContext)();
|
|
39
27
|
(0, _react().useEffect)(() => {
|
|
40
28
|
const chartQueryList = ctx === null || ctx === void 0 ? void 0 : ctx.data;
|
|
41
|
-
|
|
42
29
|
if (chartQueryList && Array.isArray(chartQueryList)) {
|
|
43
30
|
const currentQuery = chartQueryList.find(chartQuery => chartQuery.id === queryId);
|
|
44
31
|
setFields(currentQuery === null || currentQuery === void 0 ? void 0 : currentQuery.fields);
|
|
@@ -48,5 +35,4 @@ const useFieldsById = queryId => {
|
|
|
48
35
|
fields
|
|
49
36
|
};
|
|
50
37
|
};
|
|
51
|
-
|
|
52
38
|
exports.useFieldsById = useFieldsById;
|
package/lib/client/index.js
CHANGED
|
@@ -4,83 +4,57 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _core() {
|
|
9
8
|
const data = require("@formily/core");
|
|
10
|
-
|
|
11
9
|
_core = function _core() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _client() {
|
|
19
15
|
const data = require("@nocobase/client");
|
|
20
|
-
|
|
21
16
|
_client = function _client() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _json() {
|
|
29
22
|
const data = _interopRequireDefault(require("json5"));
|
|
30
|
-
|
|
31
23
|
_json = function _json() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _react() {
|
|
39
29
|
const data = _interopRequireWildcard(require("react"));
|
|
40
|
-
|
|
41
30
|
_react = function _react() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
var _ChartBlockEngine = require("./ChartBlockEngine");
|
|
49
|
-
|
|
50
36
|
var _ChartBlockInitializer = require("./ChartBlockInitializer");
|
|
51
|
-
|
|
52
37
|
var _ChartQueryMetadataProvider = require("./ChartQueryMetadataProvider");
|
|
53
|
-
|
|
54
38
|
require("./Icons");
|
|
55
|
-
|
|
56
39
|
var _locale = require("./locale");
|
|
57
|
-
|
|
58
40
|
var _select = require("./select");
|
|
59
|
-
|
|
60
41
|
var _QueriesTable = require("./settings/QueriesTable");
|
|
61
|
-
|
|
62
42
|
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); }
|
|
63
|
-
|
|
64
43
|
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; }
|
|
65
|
-
|
|
66
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
67
|
-
|
|
68
45
|
(0, _core().registerValidateRules)({
|
|
69
46
|
json5: (value, rule) => {
|
|
70
47
|
if (!value) {
|
|
71
48
|
return '';
|
|
72
49
|
}
|
|
73
|
-
|
|
74
50
|
try {
|
|
75
51
|
const val = _json().default.parse(value);
|
|
76
|
-
|
|
77
52
|
if (!isNaN(val)) {
|
|
78
53
|
return {
|
|
79
54
|
type: 'error',
|
|
80
55
|
message: (0, _locale.lang)('Invalid JSON format')
|
|
81
56
|
};
|
|
82
57
|
}
|
|
83
|
-
|
|
84
58
|
return '';
|
|
85
59
|
} catch (error) {
|
|
86
60
|
console.error(error);
|
|
@@ -91,15 +65,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
91
65
|
}
|
|
92
66
|
}
|
|
93
67
|
});
|
|
94
|
-
|
|
95
68
|
var _default = _react().default.memo(props => {
|
|
96
69
|
const api = (0, _client().useAPIClient)();
|
|
97
70
|
const items = (0, _react().useContext)(_client().SchemaInitializerContext);
|
|
98
71
|
const children = items.BlockInitializers.items[0].children;
|
|
99
|
-
|
|
100
72
|
if (children) {
|
|
101
73
|
const hasChartItem = children.some(child => (child === null || child === void 0 ? void 0 : child.component) === 'ChartBlockInitializer');
|
|
102
|
-
|
|
103
74
|
if (!hasChartItem) {
|
|
104
75
|
children.push({
|
|
105
76
|
key: 'chart',
|
|
@@ -110,7 +81,6 @@ var _default = _react().default.memo(props => {
|
|
|
110
81
|
});
|
|
111
82
|
}
|
|
112
83
|
}
|
|
113
|
-
|
|
114
84
|
const validateSQL = sql => {
|
|
115
85
|
return new Promise(resolve => {
|
|
116
86
|
api.request({
|
|
@@ -123,14 +93,12 @@ var _default = _react().default.memo(props => {
|
|
|
123
93
|
data
|
|
124
94
|
}) => {
|
|
125
95
|
var _data$data;
|
|
126
|
-
|
|
127
96
|
resolve(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.errorMessage);
|
|
128
97
|
}).catch(() => {
|
|
129
98
|
resolve('Invalid SQL');
|
|
130
99
|
});
|
|
131
100
|
});
|
|
132
101
|
};
|
|
133
|
-
|
|
134
102
|
return _react().default.createElement(_ChartQueryMetadataProvider.ChartQueryMetadataProvider, null, _react().default.createElement(_client().SettingsCenterProvider, {
|
|
135
103
|
settings: {
|
|
136
104
|
charts: {
|
|
@@ -157,5 +125,4 @@ var _default = _react().default.memo(props => {
|
|
|
157
125
|
value: items
|
|
158
126
|
}, props.children))));
|
|
159
127
|
});
|
|
160
|
-
|
|
161
128
|
exports.default = _default;
|
|
@@ -6,41 +6,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.NAMESPACE = void 0;
|
|
7
7
|
exports.lang = lang;
|
|
8
8
|
exports.useChartsTranslation = useChartsTranslation;
|
|
9
|
-
|
|
10
9
|
function _client() {
|
|
11
10
|
const data = require("@nocobase/client");
|
|
12
|
-
|
|
13
11
|
_client = function _client() {
|
|
14
12
|
return data;
|
|
15
13
|
};
|
|
16
|
-
|
|
17
14
|
return data;
|
|
18
15
|
}
|
|
19
|
-
|
|
20
16
|
function _reactI18next() {
|
|
21
17
|
const data = require("react-i18next");
|
|
22
|
-
|
|
23
18
|
_reactI18next = function _reactI18next() {
|
|
24
19
|
return data;
|
|
25
20
|
};
|
|
26
|
-
|
|
27
21
|
return data;
|
|
28
22
|
}
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
const NAMESPACE = 'charts';
|
|
24
|
+
// i18n.addResources('zh-CN', NAMESPACE, zhCN);
|
|
31
25
|
// i18n.addResources('en-US', NAMESPACE, enUS);
|
|
32
26
|
// i18n.addResources('ja-JP', NAMESPACE, jaJP);
|
|
33
27
|
// i18n.addResources('ru-RU', NAMESPACE, ruRU);
|
|
34
28
|
// i18n.addResources('tr-TR', NAMESPACE, trTR);
|
|
35
|
-
|
|
36
29
|
exports.NAMESPACE = NAMESPACE;
|
|
37
|
-
|
|
38
30
|
function lang(key) {
|
|
39
31
|
return _client().i18n.t(key, {
|
|
40
32
|
ns: NAMESPACE
|
|
41
33
|
});
|
|
42
34
|
}
|
|
43
|
-
|
|
44
35
|
function useChartsTranslation() {
|
|
45
36
|
return (0, _reactI18next().useTranslation)(NAMESPACE);
|
|
46
37
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
Edit: string;
|
|
3
|
+
Delete: string;
|
|
4
|
+
Cancel: string;
|
|
5
|
+
Submit: string;
|
|
6
|
+
Actions: string;
|
|
7
|
+
Title: string;
|
|
8
|
+
Enable: string;
|
|
9
|
+
'SAML manager': string;
|
|
10
|
+
'SAML Providers': string;
|
|
11
|
+
'Redirect url': string;
|
|
12
|
+
'SP entity id': string;
|
|
13
|
+
'Add provider': string;
|
|
14
|
+
'Edit provider': string;
|
|
15
|
+
'Client id': string;
|
|
16
|
+
'Entity id or issuer': string;
|
|
17
|
+
'Login Url': string;
|
|
18
|
+
'Public cert': string;
|
|
19
|
+
'Delete provider': string;
|
|
20
|
+
'Are you sure you want to delete it?': string;
|
|
21
|
+
'Sign in button name, which will be displayed on the sign in page': string;
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
Edit: 'Editar',
|
|
9
|
+
Delete: 'Delete',
|
|
10
|
+
Cancel: 'Cancelar',
|
|
11
|
+
Submit: 'Enviar',
|
|
12
|
+
Actions: 'Ações',
|
|
13
|
+
Title: 'Titulo',
|
|
14
|
+
Enable: 'Ativo',
|
|
15
|
+
'SAML manager': 'Gerenciador SAML',
|
|
16
|
+
'SAML Providers': 'Provedores SAML',
|
|
17
|
+
'Redirect url': 'URL de redirecionamento',
|
|
18
|
+
'SP entity id': 'ID de entidade do provedor de serviço (SP)',
|
|
19
|
+
'Add provider': 'Adicionar',
|
|
20
|
+
'Edit provider': 'Editar',
|
|
21
|
+
'Client id': 'ID do cliente',
|
|
22
|
+
'Entity id or issuer': 'ID de entidade ou emissor',
|
|
23
|
+
'Login Url': 'URL de login',
|
|
24
|
+
'Public cert': 'Certificado público',
|
|
25
|
+
'Delete provider': 'Excluir',
|
|
26
|
+
'Are you sure you want to delete it?': 'Tem certeza de que deseja excluí-lo?',
|
|
27
|
+
'Sign in button name, which will be displayed on the sign in page': 'Nome do botão de login, que será exibido na página de login'
|
|
28
|
+
};
|
|
29
|
+
exports.default = _default;
|
|
@@ -4,115 +4,80 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.CustomSelect = void 0;
|
|
7
|
-
|
|
8
7
|
function _icons() {
|
|
9
8
|
const data = require("@ant-design/icons");
|
|
10
|
-
|
|
11
9
|
_icons = function _icons() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _css() {
|
|
19
15
|
const data = require("@emotion/css");
|
|
20
|
-
|
|
21
16
|
_css = function _css() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _react() {
|
|
29
22
|
const data = require("@formily/react");
|
|
30
|
-
|
|
31
23
|
_react = function _react() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _shared() {
|
|
39
29
|
const data = require("@formily/shared");
|
|
40
|
-
|
|
41
30
|
_shared = function _shared() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
function _client() {
|
|
49
36
|
const data = require("@nocobase/client");
|
|
50
|
-
|
|
51
37
|
_client = function _client() {
|
|
52
38
|
return data;
|
|
53
39
|
};
|
|
54
|
-
|
|
55
40
|
return data;
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
function _antd() {
|
|
59
43
|
const data = require("antd");
|
|
60
|
-
|
|
61
44
|
_antd = function _antd() {
|
|
62
45
|
return data;
|
|
63
46
|
};
|
|
64
|
-
|
|
65
47
|
return data;
|
|
66
48
|
}
|
|
67
|
-
|
|
68
49
|
function _react2() {
|
|
69
50
|
const data = _interopRequireDefault(require("react"));
|
|
70
|
-
|
|
71
51
|
_react2 = function _react2() {
|
|
72
52
|
return data;
|
|
73
53
|
};
|
|
74
|
-
|
|
75
54
|
return data;
|
|
76
55
|
}
|
|
77
|
-
|
|
78
56
|
var _locale = require("../locale");
|
|
79
|
-
|
|
80
57
|
var _ReadPretty = require("./ReadPretty");
|
|
81
|
-
|
|
82
58
|
const _excluded = ["options"];
|
|
83
|
-
|
|
84
59
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
85
|
-
|
|
86
60
|
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; }
|
|
87
|
-
|
|
88
61
|
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; }
|
|
89
|
-
|
|
90
|
-
function
|
|
91
|
-
|
|
62
|
+
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; }
|
|
63
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
64
|
+
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); }
|
|
92
65
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
93
|
-
|
|
94
66
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
95
|
-
|
|
96
|
-
function _extends() { _extends = Object.assign
|
|
97
|
-
|
|
67
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
68
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
98
69
|
const isEmptyObject = val => !(0, _shared().isValid)(val) || typeof val === 'object' && Object.keys(val).length === 0;
|
|
99
|
-
|
|
100
70
|
const Option = _antd().Select.Option,
|
|
101
|
-
|
|
102
|
-
|
|
71
|
+
OptGroup = _antd().Select.OptGroup;
|
|
103
72
|
const filterOption = (input, option) => {
|
|
104
73
|
var _option$label;
|
|
105
|
-
|
|
106
74
|
return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase().includes((input || '').toLowerCase());
|
|
107
75
|
};
|
|
108
|
-
|
|
109
76
|
const InternalSelect = (0, _react().connect)(props => {
|
|
110
|
-
const others = _extends({}, props);
|
|
111
|
-
|
|
77
|
+
const others = _extends({}, (_objectDestructuringEmpty(props), props));
|
|
112
78
|
const _others = _objectSpread({}, others),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
79
|
+
options = _others.options,
|
|
80
|
+
othersProps = _objectWithoutProperties(_others, _excluded);
|
|
116
81
|
const mode = props.mode || props.multiple ? 'multiple' : undefined;
|
|
117
82
|
const group1 = options.filter(option => option.group === 2);
|
|
118
83
|
const group2 = options.filter(option => option.group === 1);
|
|
@@ -123,7 +88,6 @@ const InternalSelect = (0, _react().connect)(props => {
|
|
|
123
88
|
}, othersProps), {}, {
|
|
124
89
|
onChange: changed => {
|
|
125
90
|
var _props$onChange;
|
|
126
|
-
|
|
127
91
|
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, changed === undefined ? null : changed);
|
|
128
92
|
},
|
|
129
93
|
mode: mode
|
|
@@ -137,7 +101,6 @@ const InternalSelect = (0, _react().connect)(props => {
|
|
|
137
101
|
zIndex: 99999999999,
|
|
138
102
|
content: () => {
|
|
139
103
|
var _lang;
|
|
140
|
-
|
|
141
104
|
return _react2().default.createElement("span", null, (_lang = (0, _locale.lang)(option === null || option === void 0 ? void 0 : option.description)) === null || _lang === void 0 ? void 0 : _lang.split(',').map(item => _react2().default.createElement("div", null, item)));
|
|
142
105
|
},
|
|
143
106
|
trigger: "hover"
|
|
@@ -162,7 +125,6 @@ const InternalSelect = (0, _react().connect)(props => {
|
|
|
162
125
|
zIndex: 99999999999,
|
|
163
126
|
content: () => {
|
|
164
127
|
var _lang2;
|
|
165
|
-
|
|
166
128
|
return _react2().default.createElement("span", null, (_lang2 = (0, _locale.lang)(option === null || option === void 0 ? void 0 : option.description)) === null || _lang2 === void 0 ? void 0 : _lang2.split(',').map(item => _react2().default.createElement("div", null, item)));
|
|
167
129
|
},
|
|
168
130
|
trigger: "hover"
|
|
@@ -4,93 +4,66 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ReadPretty = void 0;
|
|
7
|
-
|
|
8
7
|
function _core() {
|
|
9
8
|
const data = require("@formily/core");
|
|
10
|
-
|
|
11
9
|
_core = function _core() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _react() {
|
|
19
15
|
const data = require("@formily/react");
|
|
20
|
-
|
|
21
16
|
_react = function _react() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _shared() {
|
|
29
22
|
const data = require("@formily/shared");
|
|
30
|
-
|
|
31
23
|
_shared = function _shared() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _antd() {
|
|
39
29
|
const data = require("antd");
|
|
40
|
-
|
|
41
30
|
_antd = function _antd() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
function _react2() {
|
|
49
36
|
const data = _interopRequireDefault(require("react"));
|
|
50
|
-
|
|
51
37
|
_react2 = function _react2() {
|
|
52
38
|
return data;
|
|
53
39
|
};
|
|
54
|
-
|
|
55
40
|
return data;
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
var _shared2 = require("./shared");
|
|
59
|
-
|
|
60
43
|
function _client() {
|
|
61
44
|
const data = require("@nocobase/client");
|
|
62
|
-
|
|
63
45
|
_client = function _client() {
|
|
64
46
|
return data;
|
|
65
47
|
};
|
|
66
|
-
|
|
67
48
|
return data;
|
|
68
49
|
}
|
|
69
|
-
|
|
70
50
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
71
|
-
|
|
72
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; }
|
|
73
|
-
|
|
74
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; }
|
|
75
|
-
|
|
76
|
-
function
|
|
77
|
-
|
|
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); }
|
|
78
56
|
const ReadPretty = (0, _react().observer)(props => {
|
|
79
57
|
var _field$value;
|
|
80
|
-
|
|
81
58
|
const fieldNames = _objectSpread(_objectSpread({}, _shared2.defaultFieldNames), props.fieldNames);
|
|
82
|
-
|
|
83
59
|
const field = (0, _react().useField)();
|
|
84
60
|
const compile = (0, _client().useCompile)();
|
|
85
|
-
|
|
86
61
|
if (!(0, _shared().isValid)(props.value)) {
|
|
87
62
|
return _react2().default.createElement("div", null);
|
|
88
63
|
}
|
|
89
|
-
|
|
90
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) {
|
|
91
65
|
return _react2().default.createElement("div", null);
|
|
92
66
|
}
|
|
93
|
-
|
|
94
67
|
const dataSource = field.dataSource || props.options || [];
|
|
95
68
|
const options = (0, _shared2.getCurrentOptions)(field.value, dataSource, fieldNames);
|
|
96
69
|
return _react2().default.createElement("div", null, options.map((option, key) => _react2().default.createElement(_antd().Tag, {
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _CustomSelect = require("./CustomSelect");
|
|
8
|
-
|
|
9
7
|
Object.keys(_CustomSelect).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _CustomSelect[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_CustomSelect).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _shared = require("./shared");
|
|
21
|
-
|
|
22
18
|
Object.keys(_shared).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _shared[key]) return;
|