asab_webui_components 25.1.2 → 25.2.2
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/README.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TeskaLabs ASAB WebUI Components Library
|
|
2
2
|
|
|
3
3
|
Components library of ASAB used in WebUI projects.
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
pnpm add asab_webui_components
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
import { Module } from 'asab_webui_components';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Possible imports:
|
|
18
|
+
|
|
19
|
+
- Module
|
|
20
|
+
- Service
|
|
21
|
+
- Renderer
|
|
22
|
+
- Humanize, humanizeToString
|
|
23
|
+
- DataTable2, DataTableCard2, DataTableCardFooter2, DataTableFilter2, DataTableAdvFilterSingleValue2, DataTableAdvFilterMultiValue2
|
|
24
|
+
- Spinner
|
|
25
|
+
- ControlledSwitch
|
|
26
|
+
- UncontrolledSwitch
|
|
27
|
+
- CellContentLoader, ChartLoader
|
|
28
|
+
- DateTime, timeToString, useDateFNSLocale
|
|
29
|
+
- TreeMenuCard, formatIntoLeafFolderTree, removeTreeContent, formatIntoTree
|
|
30
|
+
- saveToLS, getFromLS, removeFromLS
|
|
31
|
+
- validateAccess, validateTenantAccess, validateResourceAccess
|
|
32
|
+
- ErrorHandler
|
|
33
|
+
- Credentials, ButtonWithAuthz, LinkWithAuthz, ControlledSwitchWithAuthz, UncontrolledSwitchWithAuthz, isAuthorized
|
|
34
|
+
- ResultCard
|
|
35
|
+
- AdvancedCard
|
|
36
|
+
- PubSubProvider, usePubSub
|
|
37
|
+
- ConsoleModeButton
|
|
38
|
+
- FullscreenButton
|
|
39
|
+
- ConsoleCard
|
|
40
|
+
- AttentionBadge
|
|
41
|
+
- hexToString
|
|
42
|
+
- isPrivateIP
|
|
43
|
+
- isValidIP
|
|
44
|
+
- itemExtensionHandler
|
|
45
|
+
- removeFileExtension
|
|
46
|
+
- deepMerge
|
|
47
|
+
- problemMarkers
|
|
48
|
+
- isoCodeCountries
|
|
49
|
+
|
|
50
|
+
## Documentation
|
|
51
|
+
|
|
52
|
+
**TODO**
|
|
@@ -60,7 +60,7 @@ var problemMarkers = exports.problemMarkers = function problemMarkers(_ref) {
|
|
|
60
60
|
startLineNumber: problem.line_start || problem.line,
|
|
61
61
|
startColumn: problem.column_start || problem.column,
|
|
62
62
|
endLineNumber: problem.line_end || problem.line,
|
|
63
|
-
endColumn: problem.column_end || problem.
|
|
63
|
+
endColumn: problem.column_end || (problem.line_start ? getValidEndColumn(problem.line_start, model) : null) || (problem.line ? getValidEndColumn(problem.line, model) : null) || 1,
|
|
64
64
|
tags: problem.tags || null,
|
|
65
65
|
// Example [2] (possible values 2 | 1)
|
|
66
66
|
code: problem.code || null,
|
|
@@ -75,4 +75,12 @@ var problemMarkers = exports.problemMarkers = function problemMarkers(_ref) {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
return markers;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// Function to safely get the last column for a valid line number
|
|
81
|
+
var getValidEndColumn = function getValidEndColumn(line, model) {
|
|
82
|
+
var _model$getLineCount;
|
|
83
|
+
var maxLines = (model === null || model === void 0 || (_model$getLineCount = model.getLineCount) === null || _model$getLineCount === void 0 ? void 0 : _model$getLineCount.call(model)) || 0;
|
|
84
|
+
if (!line || line <= 0 || line > maxLines) return 1; // Prevent invalid line access
|
|
85
|
+
return (model === null || model === void 0 ? void 0 : model.getLineLength(line)) + 1 || 1; // Default to column 1 if needed
|
|
78
86
|
};
|
|
@@ -45,7 +45,7 @@ export const problemMarkers = ({ problems, model }) => {
|
|
|
45
45
|
startLineNumber: problem.line_start || problem.line,
|
|
46
46
|
startColumn: problem.column_start || problem.column,
|
|
47
47
|
endLineNumber: problem.line_end || problem.line,
|
|
48
|
-
endColumn: problem.column_end || (problem.
|
|
48
|
+
endColumn: problem.column_end || (problem.line_start ? getValidEndColumn(problem.line_start, model) : null) || (problem.line ? getValidEndColumn(problem.line, model) : null) || 1,
|
|
49
49
|
tags: problem.tags || null, // Example [2] (possible values 2 | 1)
|
|
50
50
|
code: problem.code || null, // Example { target: 'https://teskalabs.com', value: 'TeskaLabs' }
|
|
51
51
|
source: problem.source || null, // Example 'asab-parser'
|
|
@@ -55,3 +55,10 @@ export const problemMarkers = ({ problems, model }) => {
|
|
|
55
55
|
|
|
56
56
|
return markers;
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
// Function to safely get the last column for a valid line number
|
|
60
|
+
const getValidEndColumn = (line, model) => {
|
|
61
|
+
const maxLines = model?.getLineCount?.() || 0;
|
|
62
|
+
if (!line || line <= 0 || line > maxLines) return 1; // Prevent invalid line access
|
|
63
|
+
return model?.getLineLength(line) + 1 || 1; // Default to column 1 if needed
|
|
64
|
+
};
|
package/package.json
CHANGED
|
@@ -1,43 +1,60 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
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
|
-
|
|
2
|
+
"name": "asab_webui_components",
|
|
3
|
+
"version": "25.2.2",
|
|
4
|
+
"license": "BSD-3-Clause",
|
|
5
|
+
"description": "TeskaLabs ASAB WebUI Components Library",
|
|
6
|
+
"contributors": [
|
|
7
|
+
{
|
|
8
|
+
"name": "TeskaLabs",
|
|
9
|
+
"email": "info@teskalabs.com",
|
|
10
|
+
"url": "https://teskalabs.com"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+ssh://git@github.com:TeskaLabs/asab-webui-components-lib.git"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/TeskaLabs/asab-webui-components-lib/issues"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/TeskaLabs/asab-webui-components-lib",
|
|
21
|
+
"main": "dist/index.js",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"registry": "https://registry.npmjs.org/"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@babel/cli": "^7.22.11",
|
|
30
|
+
"@babel/core": "^7.22.11",
|
|
31
|
+
"@babel/plugin-transform-runtime": "^7.22.10",
|
|
32
|
+
"@babel/preset-env": "^7.22.10",
|
|
33
|
+
"@babel/preset-react": "^7.22.5",
|
|
34
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
35
|
+
"copyfiles": "^2.4.1",
|
|
36
|
+
"rimraf": "^5.0.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@babel/runtime": "^7.22.11",
|
|
40
|
+
"axios": "^0.21.1",
|
|
41
|
+
"bootstrap": "^5.3.1",
|
|
42
|
+
"bootstrap-icons": "^1.10.5",
|
|
43
|
+
"date-fns": "^2.30.0",
|
|
44
|
+
"i18next": "^20.3.5",
|
|
45
|
+
"react": "^17.0.0",
|
|
46
|
+
"react-dom": "^17.0.0",
|
|
47
|
+
"react-i18next": "^11.8.12",
|
|
48
|
+
"react-json-view": "^1.21.3",
|
|
49
|
+
"react-redux": "^7.2.0",
|
|
50
|
+
"react-router": "^6.16.0",
|
|
51
|
+
"react-router-dom": "^6.16.0",
|
|
52
|
+
"react-simple-tree-menu": "^1.1.18",
|
|
53
|
+
"reactstrap": "^9.2.0",
|
|
54
|
+
"redux": "^4.0.5"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "babel src --extensions '.js,.jsx' --out-dir dist && copyfiles -u 1 'src/**/*.{scss,jsx}' dist",
|
|
58
|
+
"clean": "rimraf dist"
|
|
59
|
+
}
|
|
60
|
+
}
|