@tellaro/tql 1.3.8 → 1.4.0
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/index.js +44 -41
- package/dist/node_modules/@kurkle/color/dist/color.esm.js +442 -0
- package/dist/node_modules/chart.js/dist/chart.js +6149 -0
- package/dist/node_modules/chart.js/dist/chunks/helpers.dataset.js +1685 -0
- package/dist/node_modules/chartjs-adapter-luxon/dist/chartjs-adapter-luxon.esm.js +56 -0
- package/dist/node_modules/chartjs-plugin-annotation/dist/chartjs-plugin-annotation.esm.js +1655 -0
- package/dist/node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js +607 -0
- package/dist/node_modules/luxon/build/es6/luxon.js +5524 -0
- package/dist/src/builder.d.ts +62 -0
- package/dist/src/builder.js +56 -0
- package/dist/src/chart/colors.d.ts +23 -0
- package/dist/src/chart/colors.js +101 -0
- package/dist/src/chart/formatters.d.ts +17 -0
- package/dist/src/chart/formatters.js +49 -0
- package/dist/src/chart/index.d.ts +9 -0
- package/dist/src/chart/index.js +31 -0
- package/dist/src/chart/mappers.d.ts +849 -0
- package/dist/src/chart/mappers.js +613 -0
- package/dist/src/completionProvider.js +294 -165
- package/dist/src/index.d.ts +2 -1
- package/dist/src/parser.d.ts +10 -0
- package/dist/src/parser.js +41 -9
- package/dist/src/tokenizer.js +124 -103
- package/dist/src/types.d.ts +27 -3
- package/dist/src/validator.js +10 -9
- package/dist/tql.css +1 -1
- package/dist/vue/TqlChart.vue.d.ts +2 -0
- package/dist/vue/TqlChart.vue.js +7 -0
- package/dist/vue/TqlChart.vue2.js +212 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +12 -10
- package/dist/vue/useTqlInput.js +80 -80
- package/package.json +39 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { _adapters as o } from "../../chart.js/dist/chart.js";
|
|
2
|
+
import { DateTime as i } from "../../luxon/build/es6/luxon.js";
|
|
3
|
+
const s = {
|
|
4
|
+
datetime: i.DATETIME_MED_WITH_SECONDS,
|
|
5
|
+
millisecond: "h:mm:ss.SSS a",
|
|
6
|
+
second: i.TIME_WITH_SECONDS,
|
|
7
|
+
minute: i.TIME_SIMPLE,
|
|
8
|
+
hour: { hour: "numeric" },
|
|
9
|
+
day: { day: "numeric", month: "short" },
|
|
10
|
+
week: "DD",
|
|
11
|
+
month: { month: "short", year: "numeric" },
|
|
12
|
+
quarter: "'Q'q - yyyy",
|
|
13
|
+
year: { year: "numeric" }
|
|
14
|
+
};
|
|
15
|
+
o._date.override({
|
|
16
|
+
_id: "luxon",
|
|
17
|
+
// DEBUG
|
|
18
|
+
/**
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
_create: function(t) {
|
|
22
|
+
return i.fromMillis(t, this.options);
|
|
23
|
+
},
|
|
24
|
+
init(t) {
|
|
25
|
+
this.options.locale || (this.options.locale = t.locale);
|
|
26
|
+
},
|
|
27
|
+
formats: function() {
|
|
28
|
+
return s;
|
|
29
|
+
},
|
|
30
|
+
parse: function(t, e) {
|
|
31
|
+
const r = this.options, n = typeof t;
|
|
32
|
+
return t === null || n === "undefined" ? null : (n === "number" ? t = this._create(t) : n === "string" ? typeof e == "string" ? t = i.fromFormat(t, e, r) : t = i.fromISO(t, r) : t instanceof Date ? t = i.fromJSDate(t, r) : n === "object" && !(t instanceof i) && (t = i.fromObject(t, r)), t.isValid ? t.valueOf() : null);
|
|
33
|
+
},
|
|
34
|
+
format: function(t, e) {
|
|
35
|
+
const r = this._create(t);
|
|
36
|
+
return typeof e == "string" ? r.toFormat(e) : r.toLocaleString(e);
|
|
37
|
+
},
|
|
38
|
+
add: function(t, e, r) {
|
|
39
|
+
const n = {};
|
|
40
|
+
return n[r] = e, this._create(t).plus(n).valueOf();
|
|
41
|
+
},
|
|
42
|
+
diff: function(t, e, r) {
|
|
43
|
+
return this._create(t).diff(this._create(e)).as(r).valueOf();
|
|
44
|
+
},
|
|
45
|
+
startOf: function(t, e, r) {
|
|
46
|
+
if (e === "isoWeek") {
|
|
47
|
+
r = Math.trunc(Math.min(Math.max(0, r), 6));
|
|
48
|
+
const n = this._create(t);
|
|
49
|
+
return n.minus({ days: (n.weekday - r + 7) % 7 }).startOf("day").valueOf();
|
|
50
|
+
}
|
|
51
|
+
return e ? this._create(t).startOf(e).valueOf() : t;
|
|
52
|
+
},
|
|
53
|
+
endOf: function(t, e) {
|
|
54
|
+
return this._create(t).endOf(e).valueOf();
|
|
55
|
+
}
|
|
56
|
+
});
|