@nocobase/plugin-data-visualization 1.3.39-beta → 1.4.0-alpha

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 (80) hide show
  1. package/dist/client/block/ChartBlockProvider.d.ts +10 -0
  2. package/dist/client/block/GlobalAutoRefreshProvider.d.ts +19 -0
  3. package/dist/client/block/index.d.ts +2 -0
  4. package/dist/client/chart/chart.d.ts +9 -6
  5. package/dist/client/chart/configs.d.ts +212 -19
  6. package/dist/client/chart/group.d.ts +9 -4
  7. package/dist/client/configure/schemas/configure.d.ts +1 -1
  8. package/dist/client/filter/utils.d.ts +2 -1
  9. package/dist/client/hooks/chart.d.ts +20 -0
  10. package/dist/client/hooks/index.d.ts +1 -0
  11. package/dist/client/index.d.ts +1 -0
  12. package/dist/client/index.js +30 -30
  13. package/dist/client/initializers/BlockRefreshAction.d.ts +14 -0
  14. package/dist/client/initializers/RefreshAction.d.ts +14 -0
  15. package/dist/client/initializers/chartActions.d.ts +10 -0
  16. package/dist/client/initializers/chartBlockActions.d.ts +10 -0
  17. package/dist/client/renderer/ChartRendererDesigner.d.ts +10 -0
  18. package/dist/client/renderer/ChartRendererProvider.d.ts +6 -0
  19. package/dist/client/settings/AutoRefreshItem.d.ts +13 -0
  20. package/dist/client/settings/chartActionRefresh.d.ts +10 -0
  21. package/dist/client/settings/chartBlockActionRefresh.d.ts +10 -0
  22. package/dist/client/utils.d.ts +42 -0
  23. package/dist/externalVersion.js +8 -8
  24. package/dist/locale/en-US.json +15 -14
  25. package/dist/locale/zh-CN.json +10 -9
  26. package/dist/node_modules/koa-compose/package.json +1 -1
  27. package/dist/node_modules/moment-timezone/LICENSE +20 -0
  28. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.js +1548 -0
  29. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.min.js +1 -0
  30. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-1970-2030.js +1548 -0
  31. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-1970-2030.min.js +1 -0
  32. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-2012-2022.js +1560 -0
  33. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-2012-2022.min.js +1 -0
  34. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data.js +1548 -0
  35. package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data.min.js +1 -0
  36. package/dist/node_modules/moment-timezone/builds/moment-timezone.min.js +1 -0
  37. package/dist/node_modules/moment-timezone/composer.json +43 -0
  38. package/dist/node_modules/moment-timezone/data/meta/latest.json +5889 -0
  39. package/dist/node_modules/moment-timezone/data/packed/latest.json +852 -0
  40. package/dist/node_modules/moment-timezone/index.d.ts +78 -0
  41. package/dist/node_modules/moment-timezone/index.js +15 -0
  42. package/dist/node_modules/moment-timezone/moment-timezone-utils.d.ts +70 -0
  43. package/dist/node_modules/moment-timezone/moment-timezone-utils.js +339 -0
  44. package/dist/node_modules/moment-timezone/moment-timezone.js +696 -0
  45. package/dist/node_modules/moment-timezone/package.json +1 -0
  46. package/dist/server/actions/query.d.ts +0 -1
  47. package/dist/server/actions/query.js +11 -75
  48. package/dist/server/formatter/formatter.d.ts +27 -0
  49. package/dist/server/formatter/formatter.js +85 -0
  50. package/dist/server/formatter/mysql-formatter.d.ts +14 -0
  51. package/dist/server/formatter/mysql-formatter.js +86 -0
  52. package/dist/server/formatter/oracle-formatter.d.ts +14 -0
  53. package/dist/server/formatter/oracle-formatter.js +74 -0
  54. package/dist/server/formatter/postgres-formatter.d.ts +14 -0
  55. package/dist/server/formatter/postgres-formatter.js +74 -0
  56. package/dist/server/formatter/sqlite-formatter.d.ts +15 -0
  57. package/dist/server/formatter/sqlite-formatter.js +83 -0
  58. package/dist/server/migrations/20240921214400-rename-charttype.d.ts +14 -0
  59. package/dist/server/migrations/20240921214400-rename-charttype.js +64 -0
  60. package/dist/server/plugin.js +1 -1
  61. package/dist/server/query-parser/index.d.ts +11 -0
  62. package/dist/server/query-parser/index.js +56 -0
  63. package/dist/server/query-parser/mysql-query-parser.d.ts +15 -0
  64. package/dist/server/query-parser/mysql-query-parser.js +43 -0
  65. package/dist/server/query-parser/oracle-query-parser.d.ts +18 -0
  66. package/dist/server/query-parser/oracle-query-parser.js +60 -0
  67. package/dist/server/query-parser/postgres-query-parser.d.ts +15 -0
  68. package/dist/server/query-parser/postgres-query-parser.js +43 -0
  69. package/dist/server/query-parser/query-parser.d.ts +31 -0
  70. package/dist/server/query-parser/query-parser.js +134 -0
  71. package/dist/server/query-parser/sqlite-query-parser.d.ts +15 -0
  72. package/dist/server/query-parser/sqlite-query-parser.js +43 -0
  73. package/dist/server/types.d.ts +46 -0
  74. package/dist/server/types.js +24 -0
  75. package/package.json +2 -2
  76. package/dist/client/chart/g2plot/configs.d.ts +0 -122
  77. package/dist/server/actions/formatter.d.ts +0 -12
  78. package/dist/server/actions/formatter.js +0 -101
  79. /package/dist/locale/{ja_JP.json → ja-JP.json} +0 -0
  80. /package/dist/locale/{ko_KR.json → ko-KR.json} +0 -0
@@ -0,0 +1,70 @@
1
+ import moment = require('moment');
2
+ import { MomentTimezone } from "./index";
3
+
4
+ declare module 'moment' {
5
+
6
+ /** Parsed / unpacked zone data. */
7
+ interface UnpackedZone {
8
+ /** The uniquely identifying name of the time zone. */
9
+ name: string;
10
+ /** zone abbreviations */
11
+ abbrs: Array<string>;
12
+ /** (measured in milliseconds) */
13
+ untils: Array<number | null>;
14
+ /** (measured in minutes) */
15
+ offsets: Array<number>;
16
+ }
17
+
18
+ /** Bundle of zone data and links for multiple timezones */
19
+ interface PackedZoneBundle {
20
+ version: string;
21
+ zones: Array<string>;
22
+ links: Array<string>;
23
+ }
24
+
25
+ /** Bundle of zone data and links for multiple timezones */
26
+ interface UnpackedZoneBundle {
27
+ version: string;
28
+ zones: Array<UnpackedZone>;
29
+ links: Array<string>;
30
+ }
31
+
32
+ /** extends MomentTimezone declared in index */
33
+ interface MomentTimezone {
34
+ /** Converts zone data in the unpacked format to the packed format. */
35
+ pack(unpackedObject: UnpackedZone): string;
36
+
37
+ /** Convert a base 10 number to a base 60 string. */
38
+ packBase60(input: number, precision?: number): string;
39
+
40
+ /** Create links out of two zones that share data.
41
+ * @returns A new ZoneBundle with duplicate zone data replaced by links
42
+ */
43
+ createLinks(unlinked: UnpackedZoneBundle): PackedZoneBundle;
44
+
45
+ /**
46
+ * Filter out data for years outside a certain range.
47
+ * @return a new, filtered UnPackedZone object
48
+ */
49
+ filterYears(unpackedZone: UnpackedZone, startYear: number, endYear: number): UnpackedZone;
50
+ /**
51
+ * Filter out data for years outside a certain range.
52
+ * @return a new, filtered UnPackedZone object
53
+ */
54
+ filterYears(unpackedZone: UnpackedZone, startAndEndYear: number): UnpackedZone;
55
+
56
+ /**
57
+ * Combines packing, link creation, and subsetting of years into one simple interface.
58
+ * Pass in an unpacked bundle, start year, and end year and get a filtered, linked, packed bundle back.
59
+ */
60
+ filterLinkPack(unpackedBundle: UnpackedZoneBundle, startYear: number, endYear: number): PackedZoneBundle;
61
+ /**
62
+ * Combines packing, link creation, and subsetting of years into one simple interface.
63
+ * Pass in an unpacked bundle, start year, and end year and get a filtered, linked, packed bundle back.
64
+ */
65
+ filterLinkPack(unpackedBundle: UnpackedZoneBundle, startAndEndYear: number): PackedZoneBundle;
66
+ }
67
+ }
68
+
69
+ // require("moment-timezone") === require("moment")
70
+ export = moment;
@@ -0,0 +1,339 @@
1
+ //! moment-timezone-utils.js
2
+ //! version : 0.5.43
3
+ //! Copyright (c) JS Foundation and other contributors
4
+ //! license : MIT
5
+ //! github.com/moment/moment-timezone
6
+
7
+ (function (root, factory) {
8
+ "use strict";
9
+
10
+ /*global define*/
11
+ if (typeof module === 'object' && module.exports) {
12
+ module.exports = factory(require('./')); // Node
13
+ } else if (typeof define === 'function' && define.amd) {
14
+ define(['moment'], factory); // AMD
15
+ } else {
16
+ factory(root.moment); // Browser
17
+ }
18
+ }(this, function (moment) {
19
+ "use strict";
20
+
21
+ if (!moment.tz) {
22
+ throw new Error("moment-timezone-utils.js must be loaded after moment-timezone.js");
23
+ }
24
+
25
+ /************************************
26
+ Pack Base 60
27
+ ************************************/
28
+
29
+ var BASE60 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX',
30
+ EPSILON = 0.000001; // Used to fix floating point rounding errors
31
+
32
+ function packBase60Fraction(fraction, precision) {
33
+ var buffer = '.',
34
+ output = '',
35
+ current;
36
+
37
+ while (precision > 0) {
38
+ precision -= 1;
39
+ fraction *= 60;
40
+ current = Math.floor(fraction + EPSILON);
41
+ buffer += BASE60[current];
42
+ fraction -= current;
43
+
44
+ // Only add buffer to output once we have a non-zero value.
45
+ // This makes '.000' output '', and '.100' output '.1'
46
+ if (current) {
47
+ output += buffer;
48
+ buffer = '';
49
+ }
50
+ }
51
+
52
+ return output;
53
+ }
54
+
55
+ function packBase60(number, precision) {
56
+ var output = '',
57
+ absolute = Math.abs(number),
58
+ whole = Math.floor(absolute),
59
+ fraction = packBase60Fraction(absolute - whole, Math.min(~~precision, 10));
60
+
61
+ while (whole > 0) {
62
+ output = BASE60[whole % 60] + output;
63
+ whole = Math.floor(whole / 60);
64
+ }
65
+
66
+ if (number < 0) {
67
+ output = '-' + output;
68
+ }
69
+
70
+ if (output && fraction) {
71
+ return output + fraction;
72
+ }
73
+
74
+ if (!fraction && output === '-') {
75
+ return '0';
76
+ }
77
+
78
+ return output || fraction || '0';
79
+ }
80
+
81
+ /************************************
82
+ Pack
83
+ ************************************/
84
+
85
+ function packUntils(untils) {
86
+ var out = [],
87
+ last = 0,
88
+ i;
89
+
90
+ for (i = 0; i < untils.length - 1; i++) {
91
+ out[i] = packBase60(Math.round((untils[i] - last) / 1000) / 60, 1);
92
+ last = untils[i];
93
+ }
94
+
95
+ return out.join(' ');
96
+ }
97
+
98
+ function packAbbrsAndOffsets(source) {
99
+ var index = 0,
100
+ abbrs = [],
101
+ offsets = [],
102
+ indices = [],
103
+ map = {},
104
+ i, key;
105
+
106
+ for (i = 0; i < source.abbrs.length; i++) {
107
+ key = source.abbrs[i] + '|' + source.offsets[i];
108
+ if (map[key] === undefined) {
109
+ map[key] = index;
110
+ abbrs[index] = source.abbrs[i];
111
+ offsets[index] = packBase60(Math.round(source.offsets[i] * 60) / 60, 1);
112
+ index++;
113
+ }
114
+ indices[i] = packBase60(map[key], 0);
115
+ }
116
+
117
+ return abbrs.join(' ') + '|' + offsets.join(' ') + '|' + indices.join('');
118
+ }
119
+
120
+ function packPopulation (number) {
121
+ if (!number) {
122
+ return '';
123
+ }
124
+ if (number < 1000) {
125
+ return number;
126
+ }
127
+ var exponent = String(number | 0).length - 2;
128
+ var precision = Math.round(number / Math.pow(10, exponent));
129
+ return precision + 'e' + exponent;
130
+ }
131
+
132
+ function packCountries (countries) {
133
+ if (!countries) {
134
+ return '';
135
+ }
136
+ return countries.join(' ');
137
+ }
138
+
139
+ function validatePackData (source) {
140
+ if (!source.name) { throw new Error("Missing name"); }
141
+ if (!source.abbrs) { throw new Error("Missing abbrs"); }
142
+ if (!source.untils) { throw new Error("Missing untils"); }
143
+ if (!source.offsets) { throw new Error("Missing offsets"); }
144
+ if (
145
+ source.offsets.length !== source.untils.length ||
146
+ source.offsets.length !== source.abbrs.length
147
+ ) {
148
+ throw new Error("Mismatched array lengths");
149
+ }
150
+ }
151
+
152
+ function pack (source) {
153
+ validatePackData(source);
154
+ return [
155
+ source.name, // 0 - timezone name
156
+ packAbbrsAndOffsets(source), // 1 - abbrs, 2 - offsets, 3 - indices
157
+ packUntils(source.untils), // 4 - untils
158
+ packPopulation(source.population) // 5 - population
159
+ ].join('|');
160
+ }
161
+
162
+ function packCountry (source) {
163
+ return [
164
+ source.name,
165
+ source.zones.join(' '),
166
+ ].join('|');
167
+ }
168
+
169
+ /************************************
170
+ Create Links
171
+ ************************************/
172
+
173
+ function arraysAreEqual(a, b) {
174
+ var i;
175
+
176
+ if (a.length !== b.length) { return false; }
177
+
178
+ for (i = 0; i < a.length; i++) {
179
+ if (a[i] !== b[i]) {
180
+ return false;
181
+ }
182
+ }
183
+ return true;
184
+ }
185
+
186
+ function zonesAreEqual(a, b) {
187
+ return arraysAreEqual(a.offsets, b.offsets) && arraysAreEqual(a.abbrs, b.abbrs) && arraysAreEqual(a.untils, b.untils);
188
+ }
189
+
190
+ function findAndCreateLinks (input, output, links, groupLeaders) {
191
+ var i, j, a, b, group, foundGroup, groups = [];
192
+
193
+ for (i = 0; i < input.length; i++) {
194
+ foundGroup = false;
195
+ a = input[i];
196
+
197
+ for (j = 0; j < groups.length; j++) {
198
+ group = groups[j];
199
+ b = group[0];
200
+ if (zonesAreEqual(a, b)) {
201
+ if (a.population > b.population) {
202
+ group.unshift(a);
203
+ } else if (a.population === b.population && groupLeaders && groupLeaders[a.name]) {
204
+ group.unshift(a);
205
+ } else {
206
+ group.push(a);
207
+ }
208
+ foundGroup = true;
209
+ }
210
+ }
211
+
212
+ if (!foundGroup) {
213
+ groups.push([a]);
214
+ }
215
+ }
216
+
217
+ for (i = 0; i < groups.length; i++) {
218
+ group = groups[i];
219
+ output.push(group[0]);
220
+ for (j = 1; j < group.length; j++) {
221
+ links.push(group[0].name + '|' + group[j].name);
222
+ }
223
+ }
224
+ }
225
+
226
+ function createLinks (source, groupLeaders) {
227
+ var zones = [],
228
+ links = [];
229
+
230
+ if (source.links) {
231
+ links = source.links.slice();
232
+ }
233
+
234
+ findAndCreateLinks(source.zones, zones, links, groupLeaders);
235
+
236
+ return {
237
+ version : source.version,
238
+ zones : zones,
239
+ links : links.sort()
240
+ };
241
+ }
242
+
243
+ /************************************
244
+ Filter Years
245
+ ************************************/
246
+
247
+ function findStartAndEndIndex (untils, start, end) {
248
+ var startI = 0,
249
+ endI = untils.length + 1,
250
+ untilYear,
251
+ i;
252
+
253
+ if (!end) {
254
+ end = start;
255
+ }
256
+
257
+ if (start > end) {
258
+ i = start;
259
+ start = end;
260
+ end = i;
261
+ }
262
+
263
+ for (i = 0; i < untils.length; i++) {
264
+ if (untils[i] == null) {
265
+ continue;
266
+ }
267
+ untilYear = new Date(untils[i]).getUTCFullYear();
268
+ if (untilYear < start) {
269
+ startI = i + 1;
270
+ }
271
+ if (untilYear > end) {
272
+ endI = Math.min(endI, i + 1);
273
+ }
274
+ }
275
+
276
+ return [startI, endI];
277
+ }
278
+
279
+ function filterYears (source, start, end) {
280
+ var slice = Array.prototype.slice,
281
+ indices = findStartAndEndIndex(source.untils, start, end),
282
+ untils = slice.apply(source.untils, indices);
283
+
284
+ untils[untils.length - 1] = null;
285
+
286
+ return {
287
+ name : source.name,
288
+ abbrs : slice.apply(source.abbrs, indices),
289
+ untils : untils,
290
+ offsets : slice.apply(source.offsets, indices),
291
+ population : source.population,
292
+ countries : source.countries
293
+ };
294
+ }
295
+
296
+ /************************************
297
+ Filter, Link, and Pack
298
+ ************************************/
299
+
300
+ function filterLinkPack (input, start, end, groupLeaders) {
301
+ var i,
302
+ inputZones = input.zones,
303
+ outputZones = [],
304
+ output;
305
+
306
+ for (i = 0; i < inputZones.length; i++) {
307
+ outputZones[i] = filterYears(inputZones[i], start, end);
308
+ }
309
+
310
+ output = createLinks({
311
+ zones : outputZones,
312
+ links : input.links.slice(),
313
+ version : input.version
314
+ }, groupLeaders);
315
+
316
+ for (i = 0; i < output.zones.length; i++) {
317
+ output.zones[i] = pack(output.zones[i]);
318
+ }
319
+
320
+ output.countries = input.countries ? input.countries.map(function (unpacked) {
321
+ return packCountry(unpacked);
322
+ }) : [];
323
+
324
+ return output;
325
+ }
326
+
327
+ /************************************
328
+ Exports
329
+ ************************************/
330
+
331
+ moment.tz.pack = pack;
332
+ moment.tz.packBase60 = packBase60;
333
+ moment.tz.createLinks = createLinks;
334
+ moment.tz.filterYears = filterYears;
335
+ moment.tz.filterLinkPack = filterLinkPack;
336
+ moment.tz.packCountry = packCountry;
337
+
338
+ return moment;
339
+ }));