cx 24.3.7 → 24.3.9
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/charts.js +35 -35
- package/dist/data.js +83 -42
- package/dist/manifest.js +799 -775
- package/dist/svg.js +11 -11
- package/dist/ui.js +224 -95
- package/dist/util.js +6 -1
- package/dist/widgets.js +151 -154
- package/package.json +1 -1
- package/src/data/Expression.d.ts +17 -16
- package/src/data/Expression.js +220 -212
- package/src/data/Grouper.js +144 -120
- package/src/data/Grouper.spec.js +57 -42
- package/src/data/StringTemplate.d.ts +15 -14
- package/src/data/StringTemplate.js +92 -85
- package/src/ui/Culture.d.ts +47 -23
- package/src/ui/Culture.js +132 -76
- package/src/ui/CultureScope.d.ts +10 -0
- package/src/ui/CultureScope.js +53 -0
- package/src/ui/Format.js +107 -87
- package/src/ui/adapter/GroupAdapter.js +141 -138
- package/src/ui/index.d.ts +43 -42
- package/src/ui/index.js +45 -44
- package/src/util/Format.d.ts +18 -14
- package/src/util/Format.js +234 -242
- package/src/widgets/grid/Grid.js +10 -6
package/src/data/Grouper.js
CHANGED
|
@@ -1,120 +1,144 @@
|
|
|
1
|
-
import {getSelector} from
|
|
2
|
-
import {AggregateFunction} from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
1
|
+
import { getSelector } from "./getSelector";
|
|
2
|
+
import { AggregateFunction } from "./AggregateFunction";
|
|
3
|
+
import { Binding } from "./Binding";
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
'column': {
|
|
7
|
+
index: 0,
|
|
8
|
+
sort: 'asc',
|
|
9
|
+
group: true
|
|
10
|
+
aggregate: 'count'
|
|
11
|
+
}
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export class Grouper {
|
|
15
|
+
constructor(key, aggregates, dataGetter, nameGetter) {
|
|
16
|
+
this.keys = Object.keys(key).map((keyField) => {
|
|
17
|
+
let isSimpleField = keyField.indexOf(".") === -1;
|
|
18
|
+
let keySetter;
|
|
19
|
+
if (isSimpleField) {
|
|
20
|
+
// use simple field setter wherever possible
|
|
21
|
+
keySetter = function set(result, value) {
|
|
22
|
+
result[keyField] = value;
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
} else {
|
|
26
|
+
// for complex paths, use deep setter
|
|
27
|
+
let binding = Binding.get(keyField);
|
|
28
|
+
keySetter = (result, value) => binding.set(result, value);
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
name: keyField,
|
|
32
|
+
keySetter,
|
|
33
|
+
value: getSelector(key[keyField]),
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
if (nameGetter) this.nameGetter = getSelector(nameGetter);
|
|
37
|
+
this.dataGetter = dataGetter || ((x) => x);
|
|
38
|
+
this.aggregates =
|
|
39
|
+
aggregates &&
|
|
40
|
+
transformValues(aggregates, (prop) => {
|
|
41
|
+
if (!AggregateFunction[prop.type]) throw new Error(`Unknown aggregate function '${prop.type}'.`);
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
value: getSelector(prop.value),
|
|
45
|
+
weight: getSelector(prop.weight ?? 1),
|
|
46
|
+
type: prop.type,
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
this.reset();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
reset() {
|
|
53
|
+
this.groups = this.initGroup(this.keys.length == 0);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
initGroup(leaf) {
|
|
57
|
+
if (!leaf) return {};
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
records: [],
|
|
61
|
+
indexes: [],
|
|
62
|
+
aggregates:
|
|
63
|
+
this.aggregates &&
|
|
64
|
+
transformValues(this.aggregates, (prop) => {
|
|
65
|
+
let f = AggregateFunction[prop.type];
|
|
66
|
+
return {
|
|
67
|
+
processor: f(),
|
|
68
|
+
value: prop.value,
|
|
69
|
+
weight: prop.weight,
|
|
70
|
+
};
|
|
71
|
+
}),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
process(record, index) {
|
|
76
|
+
let data = this.dataGetter(record);
|
|
77
|
+
let key = this.keys.map((k) => k.value(data));
|
|
78
|
+
let g = this.groups;
|
|
79
|
+
for (let i = 0; i < key.length; i++) {
|
|
80
|
+
let sg = g[key[i]];
|
|
81
|
+
if (!sg) {
|
|
82
|
+
sg = g[key[i]] = this.initGroup(i + 1 == key.length);
|
|
83
|
+
if (this.nameGetter) sg.name = this.nameGetter(data);
|
|
84
|
+
}
|
|
85
|
+
g = sg;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
g.records.push(record);
|
|
89
|
+
g.indexes.push(index);
|
|
90
|
+
|
|
91
|
+
if (g.aggregates) {
|
|
92
|
+
for (let k in g.aggregates)
|
|
93
|
+
g.aggregates[k].processor.process(g.aggregates[k].value(data), g.aggregates[k].weight(data));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
processAll(records, indexes) {
|
|
98
|
+
if (indexes) {
|
|
99
|
+
for (let i = 0; i < records.length; i++) this.process(records[i], indexes[i]);
|
|
100
|
+
} else records.forEach((r, i) => this.process(r, i));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
report(g, path, level, results) {
|
|
104
|
+
if (level == this.keys.length) {
|
|
105
|
+
let key = {};
|
|
106
|
+
this.keys.forEach((k, i) => {
|
|
107
|
+
key = k.keySetter(key, path[i]);
|
|
108
|
+
});
|
|
109
|
+
results.push({
|
|
110
|
+
key: key,
|
|
111
|
+
name: g.name,
|
|
112
|
+
records: g.records,
|
|
113
|
+
indexes: g.indexes,
|
|
114
|
+
aggregates: resolveKeyPaths(transformValues(g.aggregates, (p) => p.processor.getResult())),
|
|
115
|
+
});
|
|
116
|
+
} else {
|
|
117
|
+
Object.keys(g).forEach((k) => this.report(g[k], [...path, k], level + 1, results));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
getResults() {
|
|
122
|
+
let g = this.groups;
|
|
123
|
+
let results = [];
|
|
124
|
+
this.report(g, [], 0, results);
|
|
125
|
+
return results;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// transform object values using a function
|
|
130
|
+
function transformValues(o, f) {
|
|
131
|
+
let res = {};
|
|
132
|
+
for (let k in o) res[k] = f(o[k], k);
|
|
133
|
+
return res;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// transform keys like 'a.b.c' into nested objects
|
|
137
|
+
function resolveKeyPaths(o) {
|
|
138
|
+
let res = {};
|
|
139
|
+
for (let k in o) {
|
|
140
|
+
if (k.indexOf(".") > 0) res = Binding.get(k).set(res, o[k]);
|
|
141
|
+
else res[k] = o[k];
|
|
142
|
+
}
|
|
143
|
+
return res;
|
|
144
|
+
}
|
package/src/data/Grouper.spec.js
CHANGED
|
@@ -1,42 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
import assert from "assert";
|
|
3
|
-
|
|
4
|
-
describe("Grouper", function () {
|
|
5
|
-
describe("single grouping", function () {
|
|
6
|
-
it("should work", function () {
|
|
7
|
-
|
|
8
|
-
{ name: "John", age: 12 },
|
|
9
|
-
{ name: "Jane", age: 12 },
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
grouper.processAll(data);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// console.log(results);
|
|
17
|
-
assert.equal(results.length, 2);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
1
|
+
let Grouper = require("./Grouper").Grouper;
|
|
2
|
+
import assert from "assert";
|
|
3
|
+
|
|
4
|
+
describe("Grouper", function () {
|
|
5
|
+
describe("single grouping", function () {
|
|
6
|
+
it("should work", function () {
|
|
7
|
+
let data = [
|
|
8
|
+
{ name: "John", age: 12 },
|
|
9
|
+
{ name: "Jane", age: 12 },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
let grouper = new Grouper({ name: { bind: "name" } });
|
|
13
|
+
grouper.processAll(data);
|
|
14
|
+
|
|
15
|
+
let results = grouper.getResults();
|
|
16
|
+
// console.log(results);
|
|
17
|
+
assert.equal(results.length, 2);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("keys can have nested properties", function () {
|
|
21
|
+
let data = [
|
|
22
|
+
{ name: "John", age: 12 },
|
|
23
|
+
{ name: "Jane", age: 12 },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
let grouper = new Grouper({ "person.name": { bind: "name" } });
|
|
27
|
+
grouper.processAll(data);
|
|
28
|
+
|
|
29
|
+
let results = grouper.getResults();
|
|
30
|
+
assert.equal(results.length, 2);
|
|
31
|
+
assert.equal(results[0].key.person?.name, "John");
|
|
32
|
+
assert.equal(results[1].key.person?.name, "Jane");
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe("multi grouping", function () {
|
|
37
|
+
it("should work", function () {
|
|
38
|
+
let data = [
|
|
39
|
+
{ name: "John", age: 12 },
|
|
40
|
+
{ name: "John", age: 12 },
|
|
41
|
+
{ name: "John", age: 13 },
|
|
42
|
+
{ name: "John", age: 14 },
|
|
43
|
+
{ name: "Jane", age: 12 },
|
|
44
|
+
{ name: "Jane", age: 13 },
|
|
45
|
+
{ name: "Jane", age: 14 },
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
let grouper = new Grouper({ name: { bind: "name" }, age: { bind: "age" } });
|
|
49
|
+
grouper.processAll(data);
|
|
50
|
+
|
|
51
|
+
let results = grouper.getResults();
|
|
52
|
+
// console.log(results);
|
|
53
|
+
assert.equal(results.length, 6);
|
|
54
|
+
assert.equal(results[0].records.length, 2);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {Selector} from
|
|
2
|
-
|
|
3
|
-
export function stringTemplate(str: string): Selector<string>;
|
|
4
|
-
|
|
5
|
-
export class StringTemplate {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { Selector } from "../core";
|
|
2
|
+
|
|
3
|
+
export function stringTemplate(str: string): Selector<string>;
|
|
4
|
+
|
|
5
|
+
export class StringTemplate {
|
|
6
|
+
static get(str: string): Selector<string>;
|
|
7
|
+
|
|
8
|
+
static compile(str: string): Selector<string>;
|
|
9
|
+
|
|
10
|
+
static format(format: string, ...args): string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function invalidateStringTemplateCache(): void;
|
|
14
|
+
|
|
15
|
+
export function setGetStringTemplateCacheCallback(callback: () => {}): void;
|
|
@@ -1,85 +1,92 @@
|
|
|
1
|
-
import { expression } from "./Expression";
|
|
2
|
-
|
|
3
|
-
import { quoteStr } from "../util/quote";
|
|
4
|
-
|
|
5
|
-
function plus(str) {
|
|
6
|
-
return str.length ? str + " + " : str;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
i
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
term
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
i
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
1
|
+
import { expression } from "./Expression";
|
|
2
|
+
|
|
3
|
+
import { quoteStr } from "../util/quote";
|
|
4
|
+
|
|
5
|
+
function plus(str) {
|
|
6
|
+
return str.length ? str + " + " : str;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function stringTemplate(str) {
|
|
10
|
+
let tplCache = getTplCache();
|
|
11
|
+
let expr = tplCache[str];
|
|
12
|
+
if (expr) return expr;
|
|
13
|
+
|
|
14
|
+
expr = "";
|
|
15
|
+
|
|
16
|
+
let termStart = -1,
|
|
17
|
+
quoteStart = 0,
|
|
18
|
+
term,
|
|
19
|
+
bracketsOpen = 0,
|
|
20
|
+
percentSign;
|
|
21
|
+
|
|
22
|
+
for (let i = 0; i < str.length; i++) {
|
|
23
|
+
let c = str[i];
|
|
24
|
+
switch (c) {
|
|
25
|
+
case "{":
|
|
26
|
+
if (termStart < 0) {
|
|
27
|
+
if (str[i + 1] == "{" && str[i - 1] != "%") {
|
|
28
|
+
expr = plus(expr) + quoteStr(str.substring(quoteStart, i) + "{");
|
|
29
|
+
i++;
|
|
30
|
+
quoteStart = i + 1;
|
|
31
|
+
} else {
|
|
32
|
+
termStart = i + 1;
|
|
33
|
+
percentSign = str[i - 1] == "%";
|
|
34
|
+
if (i > quoteStart) expr = plus(expr) + quoteStr(str.substring(quoteStart, percentSign ? i - 1 : i));
|
|
35
|
+
bracketsOpen = 1;
|
|
36
|
+
}
|
|
37
|
+
} else bracketsOpen++;
|
|
38
|
+
break;
|
|
39
|
+
|
|
40
|
+
case "}":
|
|
41
|
+
if (termStart >= 0) {
|
|
42
|
+
if (--bracketsOpen == 0) {
|
|
43
|
+
term = str.substring(termStart, i);
|
|
44
|
+
if (term.indexOf(":") == -1) {
|
|
45
|
+
let nullSepIndex = term.indexOf("|");
|
|
46
|
+
if (nullSepIndex == -1) term += ":s";
|
|
47
|
+
else term = term.substring(0, nullSepIndex) + ":s" + term.substring(nullSepIndex);
|
|
48
|
+
}
|
|
49
|
+
expr = plus(expr) + (percentSign ? "%{" : "{") + term + "}";
|
|
50
|
+
termStart = -1;
|
|
51
|
+
quoteStart = i + 1;
|
|
52
|
+
bracketsOpen = 0;
|
|
53
|
+
}
|
|
54
|
+
} else if (str[i + 1] == "}") {
|
|
55
|
+
expr = plus(expr) + quoteStr(str.substring(quoteStart, i) + "}");
|
|
56
|
+
i++;
|
|
57
|
+
quoteStart = i + 1;
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (quoteStart < str.length) expr = plus(expr) + quoteStr(str.substring(quoteStart));
|
|
64
|
+
|
|
65
|
+
return (tplCache[str] = expression(expr));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const StringTemplate = {
|
|
69
|
+
get: function (str) {
|
|
70
|
+
return stringTemplate(str);
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
compile: function (str) {
|
|
74
|
+
return stringTemplate(str).memoize();
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
format: function (format, ...args) {
|
|
78
|
+
return stringTemplate(format)(args);
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
let tplCache = {};
|
|
83
|
+
|
|
84
|
+
let getTplCache = () => tplCache;
|
|
85
|
+
|
|
86
|
+
export function invalidateStringTemplateCache() {
|
|
87
|
+
tplCache = {};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function setGetStringTemplateCacheCallback(callback) {
|
|
91
|
+
getTplCache = callback;
|
|
92
|
+
}
|
package/src/ui/Culture.d.ts
CHANGED
|
@@ -1,23 +1,47 @@
|
|
|
1
|
-
declare type DateEncoding = (date: Date) => any;
|
|
2
|
-
|
|
3
|
-
export class Culture {
|
|
4
|
-
static setCulture(cultureCode: string): void;
|
|
5
|
-
|
|
6
|
-
static setDefaultCurrency(currencyCode: string): void;
|
|
7
|
-
|
|
8
|
-
static readonly defaultCurrency: string;
|
|
9
|
-
|
|
10
|
-
static readonly culture: string;
|
|
11
|
-
|
|
12
|
-
static setNumberCulture(cultureCode: string): void;
|
|
13
|
-
|
|
14
|
-
static getNumberCulture(): any;
|
|
15
|
-
|
|
16
|
-
static setDateTimeCulture(cultureCode: string): void;
|
|
17
|
-
|
|
18
|
-
static getDateTimeCulture(): any;
|
|
19
|
-
|
|
20
|
-
static getDefaultDateEncoding(): DateEncoding;
|
|
21
|
-
|
|
22
|
-
static setDefaultDateEncoding(encoding: DateEncoding): void;
|
|
23
|
-
}
|
|
1
|
+
declare type DateEncoding = (date: Date) => any;
|
|
2
|
+
|
|
3
|
+
export class Culture {
|
|
4
|
+
static setCulture(cultureCode: string): void;
|
|
5
|
+
|
|
6
|
+
static setDefaultCurrency(currencyCode: string): void;
|
|
7
|
+
|
|
8
|
+
static readonly defaultCurrency: string;
|
|
9
|
+
|
|
10
|
+
static readonly culture: string;
|
|
11
|
+
|
|
12
|
+
static setNumberCulture(cultureCode: string): void;
|
|
13
|
+
|
|
14
|
+
static getNumberCulture(): any;
|
|
15
|
+
|
|
16
|
+
static setDateTimeCulture(cultureCode: string): void;
|
|
17
|
+
|
|
18
|
+
static getDateTimeCulture(): any;
|
|
19
|
+
|
|
20
|
+
static getDefaultDateEncoding(): DateEncoding;
|
|
21
|
+
|
|
22
|
+
static setDefaultDateEncoding(encoding: DateEncoding): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface CultureSpecs {
|
|
26
|
+
culture?: string;
|
|
27
|
+
numberCulture?: string;
|
|
28
|
+
dateCulture?: string;
|
|
29
|
+
defaultCurrency?: string;
|
|
30
|
+
dateEncoding?: DateEncoding;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface CultureInfo {
|
|
34
|
+
culture: string;
|
|
35
|
+
numberCulture?: string;
|
|
36
|
+
dateCulture?: string;
|
|
37
|
+
defaultCurrency: string;
|
|
38
|
+
dateEncoding: DateEncoding;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function createCulture(cultureSpecs: CultureSpecs): CultureInfo;
|
|
42
|
+
|
|
43
|
+
export function pushCulture(cultureSpecs: CultureInfo): void;
|
|
44
|
+
|
|
45
|
+
export function popCulture(): CultureInfo;
|
|
46
|
+
|
|
47
|
+
export function getCurrentCultureCache(): any;
|