devexpress-aspnetcore-spreadsheet 25.1.7 → 25.2.3
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/bin/localization-builder.js +96 -101
- package/dist/dx-aspnetcore-spreadsheet.css +2132 -2126
- package/dist/dx-aspnetcore-spreadsheet.js +841 -794
- package/dist/icons/dxss-icons.ttf +0 -0
- package/dist/icons/dxss-icons.woff +0 -0
- package/dist/icons/dxss-icons.woff2 +0 -0
- package/package.json +2 -2
|
@@ -1,102 +1,97 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DevExpress AspNetCore Spreadsheet (
|
|
3
|
-
* Version: 25.
|
|
4
|
-
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
|
|
5
|
-
* License: https://www.devexpress.com/Support/EULAs
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
const
|
|
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
|
-
if (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (process.argv.length != 4)
|
|
98
|
-
throw Error('Incorrect arguments count. localization-builder.js sourcePath targetPath');
|
|
99
|
-
generate(process.argv[2], process.argv[3]);
|
|
100
|
-
}
|
|
101
|
-
|
|
1
|
+
/**
|
|
2
|
+
* DevExpress AspNetCore Spreadsheet (localization-builder.js)
|
|
3
|
+
* Version: 25.2.3
|
|
4
|
+
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
|
|
5
|
+
* License: https://www.devexpress.com/Support/EULAs
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const jsHeader =
|
|
9
|
+
`(function(root, factory) {
|
|
10
|
+
if(typeof define === 'function' && define.amd) {
|
|
11
|
+
define(function(require) {
|
|
12
|
+
factory(require("devextreme/localization"));
|
|
13
|
+
});
|
|
14
|
+
} else if(typeof module === "object" && module.exports) {
|
|
15
|
+
factory(require("devextreme/localization"));
|
|
16
|
+
} else {
|
|
17
|
+
factory(DevExpress.localization);
|
|
18
|
+
}
|
|
19
|
+
}(this, function(localization) {
|
|
20
|
+
localization.loadMessages(`;
|
|
21
|
+
|
|
22
|
+
const jsFooter =
|
|
23
|
+
`);
|
|
24
|
+
}));`
|
|
25
|
+
|
|
26
|
+
const fs = require('fs');
|
|
27
|
+
const path = require('path');
|
|
28
|
+
|
|
29
|
+
function getLocale(fileName) {
|
|
30
|
+
const parts = fileName.split('.');
|
|
31
|
+
return parts[parts.length - 2];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function writeFile(filePath, content) {
|
|
35
|
+
const dirPath = path.dirname(filePath);
|
|
36
|
+
if (!fs.existsSync(dirPath))
|
|
37
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
38
|
+
fs.writeFileSync(filePath, content, 'utf8');
|
|
39
|
+
console.log(`${filePath} created`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function getFullPath(p) {
|
|
43
|
+
return path.normalize(path.isAbsolute(p) ? p : path.join(process.cwd(), p));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Possible calls:
|
|
47
|
+
// * generate(souceDir, targetDir)
|
|
48
|
+
// * generate(sourceFile, targetFile)
|
|
49
|
+
function generate(sourcePath, targetPath) {
|
|
50
|
+
sourcePath = getFullPath(sourcePath);
|
|
51
|
+
targetPath = getFullPath(targetPath);
|
|
52
|
+
if (!fs.existsSync(sourcePath))
|
|
53
|
+
throw Error('Source path is incorrect');
|
|
54
|
+
if (fs.lstatSync(sourcePath).isFile()) {
|
|
55
|
+
const extension = path.extname(targetPath);
|
|
56
|
+
generateFromFile(sourcePath, targetPath.slice(0, -extension.length),
|
|
57
|
+
getLocale(path.basename(sourcePath)), extension == '.js', extension == '.json');
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
let numFiles = 0;
|
|
61
|
+
fs.readdirSync(sourcePath).forEach(fileName => {
|
|
62
|
+
const locale = getLocale(fileName);
|
|
63
|
+
if (locale) {
|
|
64
|
+
numFiles++;
|
|
65
|
+
generateFromFile(path.join(sourcePath, fileName),
|
|
66
|
+
path.join(targetPath, fileName.slice(0, -path.extname(fileName).length)),
|
|
67
|
+
locale, true, true);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
if (numFiles == 0)
|
|
71
|
+
console.log(`No source files found`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// targetPath without extension
|
|
76
|
+
function generateFromFile(sourceFilePath, targetPath, locale, generateJsContent, generateJsonContent) {
|
|
77
|
+
if (!locale) {
|
|
78
|
+
console.log(`Incorrect locale ${locale}`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const correctJsonContent = {
|
|
82
|
+
[locale]: JSON.parse(fs.readFileSync(sourceFilePath, 'utf8'))
|
|
83
|
+
};
|
|
84
|
+
const jsonContentAsString = JSON.stringify(correctJsonContent, null, ' ');
|
|
85
|
+
if (generateJsContent)
|
|
86
|
+
writeFile(targetPath +'.js', jsHeader + jsonContentAsString + jsFooter);
|
|
87
|
+
if (generateJsonContent)
|
|
88
|
+
writeFile(targetPath + '.json', jsonContentAsString);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (require.main === module) {
|
|
92
|
+
if (process.argv.length != 4)
|
|
93
|
+
throw Error('Incorrect arguments count. localization-builder.js sourcePath targetPath');
|
|
94
|
+
generate(process.argv[2], process.argv[3]);
|
|
95
|
+
}
|
|
96
|
+
|
|
102
97
|
module.exports = generate;
|