@nocobase/plugin-data-visualization 1.3.38-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.
- package/dist/client/block/ChartBlockProvider.d.ts +10 -0
- package/dist/client/block/GlobalAutoRefreshProvider.d.ts +19 -0
- package/dist/client/block/index.d.ts +2 -0
- package/dist/client/chart/chart.d.ts +9 -6
- package/dist/client/chart/configs.d.ts +212 -19
- package/dist/client/chart/group.d.ts +9 -4
- package/dist/client/configure/schemas/configure.d.ts +1 -1
- package/dist/client/filter/utils.d.ts +2 -1
- package/dist/client/hooks/chart.d.ts +20 -0
- package/dist/client/hooks/index.d.ts +1 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +30 -30
- package/dist/client/initializers/BlockRefreshAction.d.ts +14 -0
- package/dist/client/initializers/RefreshAction.d.ts +14 -0
- package/dist/client/initializers/chartActions.d.ts +10 -0
- package/dist/client/initializers/chartBlockActions.d.ts +10 -0
- package/dist/client/renderer/ChartRendererDesigner.d.ts +10 -0
- package/dist/client/renderer/ChartRendererProvider.d.ts +6 -0
- package/dist/client/settings/AutoRefreshItem.d.ts +13 -0
- package/dist/client/settings/chartActionRefresh.d.ts +10 -0
- package/dist/client/settings/chartBlockActionRefresh.d.ts +10 -0
- package/dist/client/utils.d.ts +42 -0
- package/dist/externalVersion.js +8 -8
- package/dist/locale/en-US.json +15 -14
- package/dist/locale/zh-CN.json +10 -9
- package/dist/node_modules/koa-compose/package.json +1 -1
- package/dist/node_modules/moment-timezone/LICENSE +20 -0
- package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.js +1548 -0
- package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.min.js +1 -0
- package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-1970-2030.js +1548 -0
- package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-1970-2030.min.js +1 -0
- package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-2012-2022.js +1560 -0
- package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data-2012-2022.min.js +1 -0
- package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data.js +1548 -0
- package/dist/node_modules/moment-timezone/builds/moment-timezone-with-data.min.js +1 -0
- package/dist/node_modules/moment-timezone/builds/moment-timezone.min.js +1 -0
- package/dist/node_modules/moment-timezone/composer.json +43 -0
- package/dist/node_modules/moment-timezone/data/meta/latest.json +5889 -0
- package/dist/node_modules/moment-timezone/data/packed/latest.json +852 -0
- package/dist/node_modules/moment-timezone/index.d.ts +78 -0
- package/dist/node_modules/moment-timezone/index.js +15 -0
- package/dist/node_modules/moment-timezone/moment-timezone-utils.d.ts +70 -0
- package/dist/node_modules/moment-timezone/moment-timezone-utils.js +339 -0
- package/dist/node_modules/moment-timezone/moment-timezone.js +696 -0
- package/dist/node_modules/moment-timezone/package.json +1 -0
- package/dist/server/actions/query.d.ts +0 -1
- package/dist/server/actions/query.js +11 -75
- package/dist/server/formatter/formatter.d.ts +27 -0
- package/dist/server/formatter/formatter.js +85 -0
- package/dist/server/formatter/mysql-formatter.d.ts +14 -0
- package/dist/server/formatter/mysql-formatter.js +86 -0
- package/dist/server/formatter/oracle-formatter.d.ts +14 -0
- package/dist/server/formatter/oracle-formatter.js +74 -0
- package/dist/server/formatter/postgres-formatter.d.ts +14 -0
- package/dist/server/formatter/postgres-formatter.js +74 -0
- package/dist/server/formatter/sqlite-formatter.d.ts +15 -0
- package/dist/server/formatter/sqlite-formatter.js +83 -0
- package/dist/server/migrations/20240921214400-rename-charttype.d.ts +14 -0
- package/dist/server/migrations/20240921214400-rename-charttype.js +64 -0
- package/dist/server/plugin.js +1 -1
- package/dist/server/query-parser/index.d.ts +11 -0
- package/dist/server/query-parser/index.js +56 -0
- package/dist/server/query-parser/mysql-query-parser.d.ts +15 -0
- package/dist/server/query-parser/mysql-query-parser.js +43 -0
- package/dist/server/query-parser/oracle-query-parser.d.ts +18 -0
- package/dist/server/query-parser/oracle-query-parser.js +60 -0
- package/dist/server/query-parser/postgres-query-parser.d.ts +15 -0
- package/dist/server/query-parser/postgres-query-parser.js +43 -0
- package/dist/server/query-parser/query-parser.d.ts +31 -0
- package/dist/server/query-parser/query-parser.js +134 -0
- package/dist/server/query-parser/sqlite-query-parser.d.ts +15 -0
- package/dist/server/query-parser/sqlite-query-parser.js +43 -0
- package/dist/server/types.d.ts +46 -0
- package/dist/server/types.js +24 -0
- package/package.json +2 -2
- package/dist/client/chart/g2plot/configs.d.ts +0 -122
- package/dist/server/actions/formatter.d.ts +0 -12
- package/dist/server/actions/formatter.js +0 -101
- /package/dist/locale/{ja_JP.json → ja-JP.json} +0 -0
- /package/dist/locale/{ko_KR.json → ko-KR.json} +0 -0
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
//! moment-timezone.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('moment')); // 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
|
+
// Resolves es6 module loading issue
|
|
22
|
+
if (moment.version === undefined && moment.default) {
|
|
23
|
+
moment = moment.default;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Do not load moment-timezone a second time.
|
|
27
|
+
// if (moment.tz !== undefined) {
|
|
28
|
+
// logError('Moment Timezone ' + moment.tz.version + ' was already loaded ' + (moment.tz.dataVersion ? 'with data from ' : 'without any data') + moment.tz.dataVersion);
|
|
29
|
+
// return moment;
|
|
30
|
+
// }
|
|
31
|
+
|
|
32
|
+
var VERSION = "0.5.43",
|
|
33
|
+
zones = {},
|
|
34
|
+
links = {},
|
|
35
|
+
countries = {},
|
|
36
|
+
names = {},
|
|
37
|
+
guesses = {},
|
|
38
|
+
cachedGuess;
|
|
39
|
+
|
|
40
|
+
if (!moment || typeof moment.version !== 'string') {
|
|
41
|
+
logError('Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var momentVersion = moment.version.split('.'),
|
|
45
|
+
major = +momentVersion[0],
|
|
46
|
+
minor = +momentVersion[1];
|
|
47
|
+
|
|
48
|
+
// Moment.js version check
|
|
49
|
+
if (major < 2 || (major === 2 && minor < 6)) {
|
|
50
|
+
logError('Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js ' + moment.version + '. See momentjs.com');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/************************************
|
|
54
|
+
Unpacking
|
|
55
|
+
************************************/
|
|
56
|
+
|
|
57
|
+
function charCodeToInt(charCode) {
|
|
58
|
+
if (charCode > 96) {
|
|
59
|
+
return charCode - 87;
|
|
60
|
+
} else if (charCode > 64) {
|
|
61
|
+
return charCode - 29;
|
|
62
|
+
}
|
|
63
|
+
return charCode - 48;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function unpackBase60(string) {
|
|
67
|
+
var i = 0,
|
|
68
|
+
parts = string.split('.'),
|
|
69
|
+
whole = parts[0],
|
|
70
|
+
fractional = parts[1] || '',
|
|
71
|
+
multiplier = 1,
|
|
72
|
+
num,
|
|
73
|
+
out = 0,
|
|
74
|
+
sign = 1;
|
|
75
|
+
|
|
76
|
+
// handle negative numbers
|
|
77
|
+
if (string.charCodeAt(0) === 45) {
|
|
78
|
+
i = 1;
|
|
79
|
+
sign = -1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// handle digits before the decimal
|
|
83
|
+
for (i; i < whole.length; i++) {
|
|
84
|
+
num = charCodeToInt(whole.charCodeAt(i));
|
|
85
|
+
out = 60 * out + num;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// handle digits after the decimal
|
|
89
|
+
for (i = 0; i < fractional.length; i++) {
|
|
90
|
+
multiplier = multiplier / 60;
|
|
91
|
+
num = charCodeToInt(fractional.charCodeAt(i));
|
|
92
|
+
out += num * multiplier;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return out * sign;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function arrayToInt (array) {
|
|
99
|
+
for (var i = 0; i < array.length; i++) {
|
|
100
|
+
array[i] = unpackBase60(array[i]);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function intToUntil (array, length) {
|
|
105
|
+
for (var i = 0; i < length; i++) {
|
|
106
|
+
array[i] = Math.round((array[i - 1] || 0) + (array[i] * 60000)); // minutes to milliseconds
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
array[length - 1] = Infinity;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function mapIndices (source, indices) {
|
|
113
|
+
var out = [], i;
|
|
114
|
+
|
|
115
|
+
for (i = 0; i < indices.length; i++) {
|
|
116
|
+
out[i] = source[indices[i]];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return out;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function unpack (string) {
|
|
123
|
+
var data = string.split('|'),
|
|
124
|
+
offsets = data[2].split(' '),
|
|
125
|
+
indices = data[3].split(''),
|
|
126
|
+
untils = data[4].split(' ');
|
|
127
|
+
|
|
128
|
+
arrayToInt(offsets);
|
|
129
|
+
arrayToInt(indices);
|
|
130
|
+
arrayToInt(untils);
|
|
131
|
+
|
|
132
|
+
intToUntil(untils, indices.length);
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
name : data[0],
|
|
136
|
+
abbrs : mapIndices(data[1].split(' '), indices),
|
|
137
|
+
offsets : mapIndices(offsets, indices),
|
|
138
|
+
untils : untils,
|
|
139
|
+
population : data[5] | 0
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/************************************
|
|
144
|
+
Zone object
|
|
145
|
+
************************************/
|
|
146
|
+
|
|
147
|
+
function Zone (packedString) {
|
|
148
|
+
if (packedString) {
|
|
149
|
+
this._set(unpack(packedString));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
Zone.prototype = {
|
|
154
|
+
_set : function (unpacked) {
|
|
155
|
+
this.name = unpacked.name;
|
|
156
|
+
this.abbrs = unpacked.abbrs;
|
|
157
|
+
this.untils = unpacked.untils;
|
|
158
|
+
this.offsets = unpacked.offsets;
|
|
159
|
+
this.population = unpacked.population;
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
_index : function (timestamp) {
|
|
163
|
+
var target = +timestamp,
|
|
164
|
+
untils = this.untils,
|
|
165
|
+
i;
|
|
166
|
+
|
|
167
|
+
for (i = 0; i < untils.length; i++) {
|
|
168
|
+
if (target < untils[i]) {
|
|
169
|
+
return i;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
countries : function () {
|
|
175
|
+
var zone_name = this.name;
|
|
176
|
+
return Object.keys(countries).filter(function (country_code) {
|
|
177
|
+
return countries[country_code].zones.indexOf(zone_name) !== -1;
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
parse : function (timestamp) {
|
|
182
|
+
var target = +timestamp,
|
|
183
|
+
offsets = this.offsets,
|
|
184
|
+
untils = this.untils,
|
|
185
|
+
max = untils.length - 1,
|
|
186
|
+
offset, offsetNext, offsetPrev, i;
|
|
187
|
+
|
|
188
|
+
for (i = 0; i < max; i++) {
|
|
189
|
+
offset = offsets[i];
|
|
190
|
+
offsetNext = offsets[i + 1];
|
|
191
|
+
offsetPrev = offsets[i ? i - 1 : i];
|
|
192
|
+
|
|
193
|
+
if (offset < offsetNext && tz.moveAmbiguousForward) {
|
|
194
|
+
offset = offsetNext;
|
|
195
|
+
} else if (offset > offsetPrev && tz.moveInvalidForward) {
|
|
196
|
+
offset = offsetPrev;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (target < untils[i] - (offset * 60000)) {
|
|
200
|
+
return offsets[i];
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return offsets[max];
|
|
205
|
+
},
|
|
206
|
+
|
|
207
|
+
abbr : function (mom) {
|
|
208
|
+
return this.abbrs[this._index(mom)];
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
offset : function (mom) {
|
|
212
|
+
logError("zone.offset has been deprecated in favor of zone.utcOffset");
|
|
213
|
+
return this.offsets[this._index(mom)];
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
utcOffset : function (mom) {
|
|
217
|
+
return this.offsets[this._index(mom)];
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
/************************************
|
|
222
|
+
Country object
|
|
223
|
+
************************************/
|
|
224
|
+
|
|
225
|
+
function Country (country_name, zone_names) {
|
|
226
|
+
this.name = country_name;
|
|
227
|
+
this.zones = zone_names;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/************************************
|
|
231
|
+
Current Timezone
|
|
232
|
+
************************************/
|
|
233
|
+
|
|
234
|
+
function OffsetAt(at) {
|
|
235
|
+
var timeString = at.toTimeString();
|
|
236
|
+
var abbr = timeString.match(/\([a-z ]+\)/i);
|
|
237
|
+
if (abbr && abbr[0]) {
|
|
238
|
+
// 17:56:31 GMT-0600 (CST)
|
|
239
|
+
// 17:56:31 GMT-0600 (Central Standard Time)
|
|
240
|
+
abbr = abbr[0].match(/[A-Z]/g);
|
|
241
|
+
abbr = abbr ? abbr.join('') : undefined;
|
|
242
|
+
} else {
|
|
243
|
+
// 17:56:31 CST
|
|
244
|
+
// 17:56:31 GMT+0800 (台北標準時間)
|
|
245
|
+
abbr = timeString.match(/[A-Z]{3,5}/g);
|
|
246
|
+
abbr = abbr ? abbr[0] : undefined;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (abbr === 'GMT') {
|
|
250
|
+
abbr = undefined;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
this.at = +at;
|
|
254
|
+
this.abbr = abbr;
|
|
255
|
+
this.offset = at.getTimezoneOffset();
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function ZoneScore(zone) {
|
|
259
|
+
this.zone = zone;
|
|
260
|
+
this.offsetScore = 0;
|
|
261
|
+
this.abbrScore = 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
ZoneScore.prototype.scoreOffsetAt = function (offsetAt) {
|
|
265
|
+
this.offsetScore += Math.abs(this.zone.utcOffset(offsetAt.at) - offsetAt.offset);
|
|
266
|
+
if (this.zone.abbr(offsetAt.at).replace(/[^A-Z]/g, '') !== offsetAt.abbr) {
|
|
267
|
+
this.abbrScore++;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
function findChange(low, high) {
|
|
272
|
+
var mid, diff;
|
|
273
|
+
|
|
274
|
+
while ((diff = ((high.at - low.at) / 12e4 | 0) * 6e4)) {
|
|
275
|
+
mid = new OffsetAt(new Date(low.at + diff));
|
|
276
|
+
if (mid.offset === low.offset) {
|
|
277
|
+
low = mid;
|
|
278
|
+
} else {
|
|
279
|
+
high = mid;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return low;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function userOffsets() {
|
|
287
|
+
var startYear = new Date().getFullYear() - 2,
|
|
288
|
+
last = new OffsetAt(new Date(startYear, 0, 1)),
|
|
289
|
+
offsets = [last],
|
|
290
|
+
change, next, i;
|
|
291
|
+
|
|
292
|
+
for (i = 1; i < 48; i++) {
|
|
293
|
+
next = new OffsetAt(new Date(startYear, i, 1));
|
|
294
|
+
if (next.offset !== last.offset) {
|
|
295
|
+
change = findChange(last, next);
|
|
296
|
+
offsets.push(change);
|
|
297
|
+
offsets.push(new OffsetAt(new Date(change.at + 6e4)));
|
|
298
|
+
}
|
|
299
|
+
last = next;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
for (i = 0; i < 4; i++) {
|
|
303
|
+
offsets.push(new OffsetAt(new Date(startYear + i, 0, 1)));
|
|
304
|
+
offsets.push(new OffsetAt(new Date(startYear + i, 6, 1)));
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return offsets;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function sortZoneScores (a, b) {
|
|
311
|
+
if (a.offsetScore !== b.offsetScore) {
|
|
312
|
+
return a.offsetScore - b.offsetScore;
|
|
313
|
+
}
|
|
314
|
+
if (a.abbrScore !== b.abbrScore) {
|
|
315
|
+
return a.abbrScore - b.abbrScore;
|
|
316
|
+
}
|
|
317
|
+
if (a.zone.population !== b.zone.population) {
|
|
318
|
+
return b.zone.population - a.zone.population;
|
|
319
|
+
}
|
|
320
|
+
return b.zone.name.localeCompare(a.zone.name);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function addToGuesses (name, offsets) {
|
|
324
|
+
var i, offset;
|
|
325
|
+
arrayToInt(offsets);
|
|
326
|
+
for (i = 0; i < offsets.length; i++) {
|
|
327
|
+
offset = offsets[i];
|
|
328
|
+
guesses[offset] = guesses[offset] || {};
|
|
329
|
+
guesses[offset][name] = true;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function guessesForUserOffsets (offsets) {
|
|
334
|
+
var offsetsLength = offsets.length,
|
|
335
|
+
filteredGuesses = {},
|
|
336
|
+
out = [],
|
|
337
|
+
i, j, guessesOffset;
|
|
338
|
+
|
|
339
|
+
for (i = 0; i < offsetsLength; i++) {
|
|
340
|
+
guessesOffset = guesses[offsets[i].offset] || {};
|
|
341
|
+
for (j in guessesOffset) {
|
|
342
|
+
if (guessesOffset.hasOwnProperty(j)) {
|
|
343
|
+
filteredGuesses[j] = true;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
for (i in filteredGuesses) {
|
|
349
|
+
if (filteredGuesses.hasOwnProperty(i)) {
|
|
350
|
+
out.push(names[i]);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
return out;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function rebuildGuess () {
|
|
358
|
+
|
|
359
|
+
// use Intl API when available and returning valid time zone
|
|
360
|
+
try {
|
|
361
|
+
var intlName = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
362
|
+
if (intlName && intlName.length > 3) {
|
|
363
|
+
var name = names[normalizeName(intlName)];
|
|
364
|
+
if (name) {
|
|
365
|
+
return name;
|
|
366
|
+
}
|
|
367
|
+
logError("Moment Timezone found " + intlName + " from the Intl api, but did not have that data loaded.");
|
|
368
|
+
}
|
|
369
|
+
} catch (e) {
|
|
370
|
+
// Intl unavailable, fall back to manual guessing.
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
var offsets = userOffsets(),
|
|
374
|
+
offsetsLength = offsets.length,
|
|
375
|
+
guesses = guessesForUserOffsets(offsets),
|
|
376
|
+
zoneScores = [],
|
|
377
|
+
zoneScore, i, j;
|
|
378
|
+
|
|
379
|
+
for (i = 0; i < guesses.length; i++) {
|
|
380
|
+
zoneScore = new ZoneScore(getZone(guesses[i]), offsetsLength);
|
|
381
|
+
for (j = 0; j < offsetsLength; j++) {
|
|
382
|
+
zoneScore.scoreOffsetAt(offsets[j]);
|
|
383
|
+
}
|
|
384
|
+
zoneScores.push(zoneScore);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
zoneScores.sort(sortZoneScores);
|
|
388
|
+
|
|
389
|
+
return zoneScores.length > 0 ? zoneScores[0].zone.name : undefined;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function guess (ignoreCache) {
|
|
393
|
+
if (!cachedGuess || ignoreCache) {
|
|
394
|
+
cachedGuess = rebuildGuess();
|
|
395
|
+
}
|
|
396
|
+
return cachedGuess;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/************************************
|
|
400
|
+
Global Methods
|
|
401
|
+
************************************/
|
|
402
|
+
|
|
403
|
+
function normalizeName (name) {
|
|
404
|
+
return (name || '').toLowerCase().replace(/\//g, '_');
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
function addZone (packed) {
|
|
408
|
+
var i, name, split, normalized;
|
|
409
|
+
|
|
410
|
+
if (typeof packed === "string") {
|
|
411
|
+
packed = [packed];
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
for (i = 0; i < packed.length; i++) {
|
|
415
|
+
split = packed[i].split('|');
|
|
416
|
+
name = split[0];
|
|
417
|
+
normalized = normalizeName(name);
|
|
418
|
+
zones[normalized] = packed[i];
|
|
419
|
+
names[normalized] = name;
|
|
420
|
+
addToGuesses(normalized, split[2].split(' '));
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
function getZone (name, caller) {
|
|
425
|
+
|
|
426
|
+
name = normalizeName(name);
|
|
427
|
+
|
|
428
|
+
var zone = zones[name];
|
|
429
|
+
var link;
|
|
430
|
+
|
|
431
|
+
if (zone instanceof Zone) {
|
|
432
|
+
return zone;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if (typeof zone === 'string') {
|
|
436
|
+
zone = new Zone(zone);
|
|
437
|
+
zones[name] = zone;
|
|
438
|
+
return zone;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// Pass getZone to prevent recursion more than 1 level deep
|
|
442
|
+
if (links[name] && caller !== getZone && (link = getZone(links[name], getZone))) {
|
|
443
|
+
zone = zones[name] = new Zone();
|
|
444
|
+
zone._set(link);
|
|
445
|
+
zone.name = names[name];
|
|
446
|
+
return zone;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
return null;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function getNames () {
|
|
453
|
+
var i, out = [];
|
|
454
|
+
|
|
455
|
+
for (i in names) {
|
|
456
|
+
if (names.hasOwnProperty(i) && (zones[i] || zones[links[i]]) && names[i]) {
|
|
457
|
+
out.push(names[i]);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
return out.sort();
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
function getCountryNames () {
|
|
465
|
+
return Object.keys(countries);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
function addLink (aliases) {
|
|
469
|
+
var i, alias, normal0, normal1;
|
|
470
|
+
|
|
471
|
+
if (typeof aliases === "string") {
|
|
472
|
+
aliases = [aliases];
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
for (i = 0; i < aliases.length; i++) {
|
|
476
|
+
alias = aliases[i].split('|');
|
|
477
|
+
|
|
478
|
+
normal0 = normalizeName(alias[0]);
|
|
479
|
+
normal1 = normalizeName(alias[1]);
|
|
480
|
+
|
|
481
|
+
links[normal0] = normal1;
|
|
482
|
+
names[normal0] = alias[0];
|
|
483
|
+
|
|
484
|
+
links[normal1] = normal0;
|
|
485
|
+
names[normal1] = alias[1];
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function addCountries (data) {
|
|
490
|
+
var i, country_code, country_zones, split;
|
|
491
|
+
if (!data || !data.length) return;
|
|
492
|
+
for (i = 0; i < data.length; i++) {
|
|
493
|
+
split = data[i].split('|');
|
|
494
|
+
country_code = split[0].toUpperCase();
|
|
495
|
+
country_zones = split[1].split(' ');
|
|
496
|
+
countries[country_code] = new Country(
|
|
497
|
+
country_code,
|
|
498
|
+
country_zones
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
function getCountry (name) {
|
|
504
|
+
name = name.toUpperCase();
|
|
505
|
+
return countries[name] || null;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
function zonesForCountry(country, with_offset) {
|
|
509
|
+
country = getCountry(country);
|
|
510
|
+
|
|
511
|
+
if (!country) return null;
|
|
512
|
+
|
|
513
|
+
var zones = country.zones.sort();
|
|
514
|
+
|
|
515
|
+
if (with_offset) {
|
|
516
|
+
return zones.map(function (zone_name) {
|
|
517
|
+
var zone = getZone(zone_name);
|
|
518
|
+
return {
|
|
519
|
+
name: zone_name,
|
|
520
|
+
offset: zone.utcOffset(new Date())
|
|
521
|
+
};
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return zones;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
function loadData (data) {
|
|
529
|
+
addZone(data.zones);
|
|
530
|
+
addLink(data.links);
|
|
531
|
+
addCountries(data.countries);
|
|
532
|
+
tz.dataVersion = data.version;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
function zoneExists (name) {
|
|
536
|
+
if (!zoneExists.didShowError) {
|
|
537
|
+
zoneExists.didShowError = true;
|
|
538
|
+
logError("moment.tz.zoneExists('" + name + "') has been deprecated in favor of !moment.tz.zone('" + name + "')");
|
|
539
|
+
}
|
|
540
|
+
return !!getZone(name);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
function needsOffset (m) {
|
|
544
|
+
var isUnixTimestamp = (m._f === 'X' || m._f === 'x');
|
|
545
|
+
return !!(m._a && (m._tzm === undefined) && !isUnixTimestamp);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
function logError (message) {
|
|
549
|
+
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
550
|
+
console.error(message);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/************************************
|
|
555
|
+
moment.tz namespace
|
|
556
|
+
************************************/
|
|
557
|
+
|
|
558
|
+
function tz (input) {
|
|
559
|
+
var args = Array.prototype.slice.call(arguments, 0, -1),
|
|
560
|
+
name = arguments[arguments.length - 1],
|
|
561
|
+
zone = getZone(name),
|
|
562
|
+
out = moment.utc.apply(null, args);
|
|
563
|
+
|
|
564
|
+
if (zone && !moment.isMoment(input) && needsOffset(out)) {
|
|
565
|
+
out.add(zone.parse(out), 'minutes');
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
out.tz(name);
|
|
569
|
+
|
|
570
|
+
return out;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
tz.version = VERSION;
|
|
574
|
+
tz.dataVersion = '';
|
|
575
|
+
tz._zones = zones;
|
|
576
|
+
tz._links = links;
|
|
577
|
+
tz._names = names;
|
|
578
|
+
tz._countries = countries;
|
|
579
|
+
tz.add = addZone;
|
|
580
|
+
tz.link = addLink;
|
|
581
|
+
tz.load = loadData;
|
|
582
|
+
tz.zone = getZone;
|
|
583
|
+
tz.zoneExists = zoneExists; // deprecated in 0.1.0
|
|
584
|
+
tz.guess = guess;
|
|
585
|
+
tz.names = getNames;
|
|
586
|
+
tz.Zone = Zone;
|
|
587
|
+
tz.unpack = unpack;
|
|
588
|
+
tz.unpackBase60 = unpackBase60;
|
|
589
|
+
tz.needsOffset = needsOffset;
|
|
590
|
+
tz.moveInvalidForward = true;
|
|
591
|
+
tz.moveAmbiguousForward = false;
|
|
592
|
+
tz.countries = getCountryNames;
|
|
593
|
+
tz.zonesForCountry = zonesForCountry;
|
|
594
|
+
|
|
595
|
+
/************************************
|
|
596
|
+
Interface with Moment.js
|
|
597
|
+
************************************/
|
|
598
|
+
|
|
599
|
+
var fn = moment.fn;
|
|
600
|
+
|
|
601
|
+
moment.tz = tz;
|
|
602
|
+
|
|
603
|
+
moment.defaultZone = null;
|
|
604
|
+
|
|
605
|
+
moment.updateOffset = function (mom, keepTime) {
|
|
606
|
+
var zone = moment.defaultZone,
|
|
607
|
+
offset;
|
|
608
|
+
|
|
609
|
+
if (mom._z === undefined) {
|
|
610
|
+
if (zone && needsOffset(mom) && !mom._isUTC) {
|
|
611
|
+
mom._d = moment.utc(mom._a)._d;
|
|
612
|
+
mom.utc().add(zone.parse(mom), 'minutes');
|
|
613
|
+
}
|
|
614
|
+
mom._z = zone;
|
|
615
|
+
}
|
|
616
|
+
if (mom._z) {
|
|
617
|
+
offset = mom._z.utcOffset(mom);
|
|
618
|
+
if (Math.abs(offset) < 16) {
|
|
619
|
+
offset = offset / 60;
|
|
620
|
+
}
|
|
621
|
+
if (mom.utcOffset !== undefined) {
|
|
622
|
+
var z = mom._z;
|
|
623
|
+
mom.utcOffset(-offset, keepTime);
|
|
624
|
+
mom._z = z;
|
|
625
|
+
} else {
|
|
626
|
+
mom.zone(offset, keepTime);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
fn.tz = function (name, keepTime) {
|
|
632
|
+
if (name) {
|
|
633
|
+
if (typeof name !== 'string') {
|
|
634
|
+
throw new Error('Time zone name must be a string, got ' + name + ' [' + typeof name + ']');
|
|
635
|
+
}
|
|
636
|
+
this._z = getZone(name);
|
|
637
|
+
if (this._z) {
|
|
638
|
+
moment.updateOffset(this, keepTime);
|
|
639
|
+
} else {
|
|
640
|
+
logError("Moment Timezone has no data for " + name + ". See http://momentjs.com/timezone/docs/#/data-loading/.");
|
|
641
|
+
}
|
|
642
|
+
return this;
|
|
643
|
+
}
|
|
644
|
+
if (this._z) { return this._z.name; }
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
function abbrWrap (old) {
|
|
648
|
+
return function () {
|
|
649
|
+
if (this._z) { return this._z.abbr(this); }
|
|
650
|
+
return old.call(this);
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
function resetZoneWrap (old) {
|
|
655
|
+
return function () {
|
|
656
|
+
this._z = null;
|
|
657
|
+
return old.apply(this, arguments);
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
function resetZoneWrap2 (old) {
|
|
662
|
+
return function () {
|
|
663
|
+
if (arguments.length > 0) this._z = null;
|
|
664
|
+
return old.apply(this, arguments);
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
fn.zoneName = abbrWrap(fn.zoneName);
|
|
669
|
+
fn.zoneAbbr = abbrWrap(fn.zoneAbbr);
|
|
670
|
+
fn.utc = resetZoneWrap(fn.utc);
|
|
671
|
+
fn.local = resetZoneWrap(fn.local);
|
|
672
|
+
fn.utcOffset = resetZoneWrap2(fn.utcOffset);
|
|
673
|
+
|
|
674
|
+
moment.tz.setDefault = function(name) {
|
|
675
|
+
if (major < 2 || (major === 2 && minor < 9)) {
|
|
676
|
+
logError('Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js ' + moment.version + '.');
|
|
677
|
+
}
|
|
678
|
+
moment.defaultZone = name ? getZone(name) : null;
|
|
679
|
+
return moment;
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
// Cloning a moment should include the _z property.
|
|
683
|
+
var momentProperties = moment.momentProperties;
|
|
684
|
+
if (Object.prototype.toString.call(momentProperties) === '[object Array]') {
|
|
685
|
+
// moment 2.8.1+
|
|
686
|
+
momentProperties.push('_z');
|
|
687
|
+
momentProperties.push('_a');
|
|
688
|
+
} else if (momentProperties) {
|
|
689
|
+
// moment 2.7.0
|
|
690
|
+
momentProperties._z = null;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
// INJECT DATA
|
|
694
|
+
|
|
695
|
+
return moment;
|
|
696
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"moment-timezone","version":"0.5.43","description":"Parse and display moments in any timezone.","homepage":"http://momentjs.com/timezone/","author":"Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","keywords":["moment","date","time","timezone","olson","iana","zone","tz"],"main":"./index.js","typings":"./index.d.ts","engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment-timezone.git"},"bugs":{"url":"https://github.com/moment/moment-timezone/issues"},"license":"MIT","dependencies":{"moment":"^2.29.4"},"devDependencies":{"grunt":"^1.5.3","grunt-contrib-clean":"^2.0.1","grunt-contrib-jshint":"^3.2.0","grunt-contrib-nodeunit":"^4.0.0","grunt-contrib-uglify":"^5.2.2","grunt-exec":"^3.0.0","typescript":"^3.5.1"},"jspm":{"main":"builds/moment-timezone-with-data","shim":{"moment-timezone":{"deps":["moment"]}}},"scripts":{"test":"grunt"},"_lastModified":"2024-10-24T14:07:31.179Z"}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import { Context, Next } from '@nocobase/actions';
|
|
10
10
|
export declare const postProcess: (ctx: Context, next: Next) => Promise<void>;
|
|
11
11
|
export declare const queryData: (ctx: Context, next: Next) => Promise<void>;
|
|
12
|
-
export declare const parseBuilder: (ctx: Context, next: Next) => Promise<void>;
|
|
13
12
|
export declare const parseFieldAndAssociations: (ctx: Context, next: Next) => Promise<void>;
|
|
14
13
|
export declare const parseVariables: (ctx: Context, next: Next) => Promise<void>;
|
|
15
14
|
export declare const cacheMiddleware: (ctx: Context, next: Next) => Promise<void>;
|