@j2inn/fin5-ui-utils 8.2.0 → 9.0.0-beta.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/fantomProps/createFin5Props/index.d.ts +12 -12
- package/dist/fantomProps/createFin5Props/index.js +146 -146
- package/dist/fantomProps/createFin5Props/index.js.map +1 -1
- package/dist/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
- package/dist/fantomProps/createFin5Props/runCreateFin5Props.js +20 -20
- package/dist/fantomProps/createFin5Props/runCreateFin5Props.js.map +1 -1
- package/dist/fantomProps/fantomPropsToObject.d.ts +8 -8
- package/dist/fantomProps/fantomPropsToObject.js +182 -183
- package/dist/fantomProps/fantomPropsToObject.js.map +1 -1
- package/dist/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
- package/dist/fantomProps/generateJsonFromFantomPropsFile.js +51 -41
- package/dist/fantomProps/generateJsonFromFantomPropsFile.js.map +1 -1
- package/dist/fantomProps/localePropsToJson.d.ts +1 -1
- package/dist/fantomProps/localePropsToJson.js +60 -50
- package/dist/fantomProps/localePropsToJson.js.map +1 -1
- package/dist/fantomProps/readFantomPropsFile.d.ts +5 -5
- package/dist/fantomProps/readFantomPropsFile.js +74 -65
- package/dist/fantomProps/readFantomPropsFile.js.map +1 -1
- package/dist/fin5Top/fin5FileUpload.d.ts +24 -24
- package/dist/fin5Top/fin5FileUpload.js +51 -51
- package/dist/fin5Top/fin5FileUpload.js.map +1 -1
- package/dist/fin5Top/fin5Top.d.ts +188 -188
- package/dist/fin5Top/fin5Top.js +86 -86
- package/dist/fin5Top/fin5Top.js.map +1 -1
- package/dist/fin5Top/finEdge2Cloud.d.ts +6 -6
- package/dist/fin5Top/finEdge2Cloud.js +15 -15
- package/dist/fin5Top/getFin5BinUrl.d.ts +2 -2
- package/dist/fin5Top/getFin5BinUrl.js +9 -9
- package/dist/fin5Top/openFin5Alarm.d.ts +22 -22
- package/dist/fin5Top/openFin5Alarm.js +23 -23
- package/dist/fin5Top/openFin5Alarm.js.map +1 -1
- package/dist/fin5Top/openFin5Historian.d.ts +3 -3
- package/dist/fin5Top/openFin5Historian.js +19 -19
- package/dist/fin5Top/openFin5Historian.js.map +1 -1
- package/dist/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
- package/dist/fin5Top/useFin5AppURLHashParameter.js +133 -133
- package/dist/fin5Top/useFin5AppURLHashParameter.js.map +1 -1
- package/dist/index.d.ts +35 -35
- package/dist/index.js +69 -69
- package/dist/jobs/jobUtils.d.ts +14 -14
- package/dist/jobs/jobUtils.js +15 -15
- package/dist/jobs/jobUtils.js.map +1 -1
- package/dist/react/app/Fin5AppContainer.d.ts +36 -36
- package/dist/react/app/Fin5AppContainer.js +171 -161
- package/dist/react/app/Fin5AppContainer.js.map +1 -1
- package/dist/react/app/Fin5AppRootStore.d.ts +42 -42
- package/dist/react/app/Fin5AppRootStore.js +114 -114
- package/dist/react/app/Fin5AppRootStore.js.map +1 -1
- package/dist/react/components/ErrorBoundary.d.ts +57 -57
- package/dist/react/components/ErrorBoundary.js +160 -150
- package/dist/react/components/ErrorBoundary.js.map +1 -1
- package/dist/react/components/ErrorDisplayer.d.ts +19 -19
- package/dist/react/components/ErrorDisplayer.js +36 -36
- package/dist/react/components/ErrorDisplayer.js.map +1 -1
- package/dist/react/components/Loader.d.ts +9 -9
- package/dist/react/components/Loader.js +17 -17
- package/dist/react/components/LoadingSpinner.d.ts +2 -2
- package/dist/react/components/LoadingSpinner.js +27 -27
- package/dist/react/components/RecordImage.d.ts +20 -20
- package/dist/react/components/RecordImage.js +61 -51
- package/dist/react/components/RecordImage.js.map +1 -1
- package/dist/react/components/charts/QRCode.d.ts +25 -25
- package/dist/react/components/charts/QRCode.js +92 -82
- package/dist/react/components/charts/QRCode.js.map +1 -1
- package/dist/react/components/charts/line-bar/Chart.d.ts +166 -166
- package/dist/react/components/charts/line-bar/Chart.js +452 -442
- package/dist/react/components/charts/line-bar/Chart.js.map +1 -1
- package/dist/react/components/charts/line-bar/HGridChart.d.ts +58 -58
- package/dist/react/components/charts/line-bar/HGridChart.js +295 -285
- package/dist/react/components/charts/line-bar/HGridChart.js.map +1 -1
- package/dist/react/components/charts/pie/PieChart.d.ts +94 -94
- package/dist/react/components/charts/pie/PieChart.js +214 -204
- package/dist/react/components/charts/pie/PieChart.js.map +1 -1
- package/dist/react/components/charts/pie/SimplePieChart.d.ts +21 -21
- package/dist/react/components/charts/pie/SimplePieChart.js +65 -55
- package/dist/react/components/charts/pie/SimplePieChart.js.map +1 -1
- package/dist/react/components/graphics/GraphicViewer.d.ts +10 -10
- package/dist/react/components/graphics/GraphicViewer.js +29 -29
- package/dist/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
- package/dist/react/components/graphics/GraphicsTabViewer.js +100 -90
- package/dist/react/components/graphics/GraphicsTabViewer.js.map +1 -1
- package/dist/react/components/makeCustomElement.d.ts +16 -16
- package/dist/react/components/makeCustomElement.js +150 -150
- package/dist/react/components/makeCustomElement.js.map +1 -1
- package/dist/react/components/navigation/BasicLayout.d.ts +41 -41
- package/dist/react/components/navigation/BasicLayout.js +165 -155
- package/dist/react/components/navigation/BasicLayout.js.map +1 -1
- package/dist/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
- package/dist/react/components/navigation/HeaderSiderLayout.js +119 -110
- package/dist/react/components/navigation/HeaderSiderLayout.js.map +1 -1
- package/dist/react/components/navigation/MenuPage.d.ts +37 -37
- package/dist/react/components/navigation/MenuPage.js +35 -36
- package/dist/react/components/navigation/MenuPage.js.map +1 -1
- package/dist/react/components/navigation/MenuTrigger.d.ts +9 -9
- package/dist/react/components/navigation/MenuTrigger.js +33 -33
- package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
- package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.js +25 -25
- package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.js.map +1 -1
- package/dist/react/components/navigation/ReactRouterLayout.d.ts +45 -46
- package/dist/react/components/navigation/ReactRouterLayout.js +142 -132
- package/dist/react/components/navigation/ReactRouterLayout.js.map +1 -1
- package/dist/react/components/navigation/customRouting/Router.d.ts +12 -12
- package/dist/react/components/navigation/customRouting/Router.js +54 -45
- package/dist/react/components/navigation/customRouting/Router.js.map +1 -1
- package/dist/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
- package/dist/react/components/navigation/customRouting/RouterLayout.js +71 -61
- package/dist/react/components/navigation/customRouting/RouterLayout.js.map +1 -1
- package/dist/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +26 -27
- package/dist/react/components/resolvable/configurationForm/ConfigurationForm.js +105 -95
- package/dist/react/components/resolvable/configurationForm/ConfigurationForm.js.map +1 -1
- package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +15 -16
- package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +98 -88
- package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.js.map +1 -1
- package/dist/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
- package/dist/react/components/resolvable/configurationForm/getSectionDefault.js +99 -99
- package/dist/react/components/resolvable/configurationForm/getSectionDefault.js.map +1 -1
- package/dist/react/hooks/useFin5BinUrl.d.ts +6 -6
- package/dist/react/hooks/useFin5BinUrl.js +15 -15
- package/dist/react/hooks/useFin5ColorScheme.d.ts +2 -2
- package/dist/react/hooks/useFin5ColorScheme.js +55 -56
- package/dist/react/hooks/useFin5ColorScheme.js.map +1 -1
- package/dist/react/hooks/useScreenSize.d.ts +7 -7
- package/dist/react/hooks/useScreenSize.js +31 -31
- package/dist_es/fantomProps/createFin5Props/index.d.ts +12 -12
- package/dist_es/fantomProps/createFin5Props/index.js +140 -140
- package/dist_es/fantomProps/createFin5Props/index.js.map +1 -1
- package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
- package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.js +15 -15
- package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.js.map +1 -1
- package/dist_es/fantomProps/fantomPropsToObject.d.ts +8 -8
- package/dist_es/fantomProps/fantomPropsToObject.js +178 -178
- package/dist_es/fantomProps/fantomPropsToObject.js.map +1 -1
- package/dist_es/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
- package/dist_es/fantomProps/generateJsonFromFantomPropsFile.js +12 -12
- package/dist_es/fantomProps/localePropsToJson.d.ts +1 -1
- package/dist_es/fantomProps/localePropsToJson.js +21 -21
- package/dist_es/fantomProps/localePropsToJson.js.map +1 -1
- package/dist_es/fantomProps/readFantomPropsFile.d.ts +5 -5
- package/dist_es/fantomProps/readFantomPropsFile.js +38 -39
- package/dist_es/fantomProps/readFantomPropsFile.js.map +1 -1
- package/dist_es/fin5Top/fin5FileUpload.d.ts +24 -24
- package/dist_es/fin5Top/fin5FileUpload.js +47 -47
- package/dist_es/fin5Top/fin5FileUpload.js.map +1 -1
- package/dist_es/fin5Top/fin5Top.d.ts +188 -188
- package/dist_es/fin5Top/fin5Top.js +81 -81
- package/dist_es/fin5Top/fin5Top.js.map +1 -1
- package/dist_es/fin5Top/finEdge2Cloud.d.ts +6 -6
- package/dist_es/fin5Top/finEdge2Cloud.js +11 -11
- package/dist_es/fin5Top/getFin5BinUrl.d.ts +2 -2
- package/dist_es/fin5Top/getFin5BinUrl.js +5 -5
- package/dist_es/fin5Top/openFin5Alarm.d.ts +22 -22
- package/dist_es/fin5Top/openFin5Alarm.js +19 -19
- package/dist_es/fin5Top/openFin5Alarm.js.map +1 -1
- package/dist_es/fin5Top/openFin5Historian.d.ts +3 -3
- package/dist_es/fin5Top/openFin5Historian.js +15 -15
- package/dist_es/fin5Top/openFin5Historian.js.map +1 -1
- package/dist_es/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
- package/dist_es/fin5Top/useFin5AppURLHashParameter.js +124 -124
- package/dist_es/fin5Top/useFin5AppURLHashParameter.js.map +1 -1
- package/dist_es/index.d.ts +35 -35
- package/dist_es/index.js +53 -53
- package/dist_es/jobs/jobUtils.d.ts +14 -14
- package/dist_es/jobs/jobUtils.js +9 -9
- package/dist_es/react/app/Fin5AppContainer.d.ts +36 -36
- package/dist_es/react/app/Fin5AppContainer.js +132 -132
- package/dist_es/react/app/Fin5AppContainer.js.map +1 -1
- package/dist_es/react/app/Fin5AppRootStore.d.ts +42 -42
- package/dist_es/react/app/Fin5AppRootStore.js +110 -110
- package/dist_es/react/app/Fin5AppRootStore.js.map +1 -1
- package/dist_es/react/components/ErrorBoundary.d.ts +57 -57
- package/dist_es/react/components/ErrorBoundary.js +123 -123
- package/dist_es/react/components/ErrorDisplayer.d.ts +19 -19
- package/dist_es/react/components/ErrorDisplayer.js +28 -28
- package/dist_es/react/components/ErrorDisplayer.js.map +1 -1
- package/dist_es/react/components/Loader.d.ts +9 -9
- package/dist_es/react/components/Loader.js +12 -12
- package/dist_es/react/components/LoadingSpinner.d.ts +2 -2
- package/dist_es/react/components/LoadingSpinner.js +20 -20
- package/dist_es/react/components/RecordImage.d.ts +20 -20
- package/dist_es/react/components/RecordImage.js +24 -24
- package/dist_es/react/components/RecordImage.js.map +1 -1
- package/dist_es/react/components/charts/QRCode.d.ts +25 -25
- package/dist_es/react/components/charts/QRCode.js +52 -52
- package/dist_es/react/components/charts/QRCode.js.map +1 -1
- package/dist_es/react/components/charts/line-bar/Chart.d.ts +166 -166
- package/dist_es/react/components/charts/line-bar/Chart.js +415 -415
- package/dist_es/react/components/charts/line-bar/Chart.js.map +1 -1
- package/dist_es/react/components/charts/line-bar/HGridChart.d.ts +58 -58
- package/dist_es/react/components/charts/line-bar/HGridChart.js +250 -250
- package/dist_es/react/components/charts/line-bar/HGridChart.js.map +1 -1
- package/dist_es/react/components/charts/pie/PieChart.d.ts +94 -94
- package/dist_es/react/components/charts/pie/PieChart.js +177 -177
- package/dist_es/react/components/charts/pie/PieChart.js.map +1 -1
- package/dist_es/react/components/charts/pie/SimplePieChart.d.ts +21 -21
- package/dist_es/react/components/charts/pie/SimplePieChart.js +25 -25
- package/dist_es/react/components/graphics/GraphicViewer.d.ts +10 -10
- package/dist_es/react/components/graphics/GraphicViewer.js +22 -22
- package/dist_es/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
- package/dist_es/react/components/graphics/GraphicsTabViewer.js +60 -60
- package/dist_es/react/components/graphics/GraphicsTabViewer.js.map +1 -1
- package/dist_es/react/components/makeCustomElement.d.ts +16 -16
- package/dist_es/react/components/makeCustomElement.js +142 -142
- package/dist_es/react/components/makeCustomElement.js.map +1 -1
- package/dist_es/react/components/navigation/BasicLayout.d.ts +41 -41
- package/dist_es/react/components/navigation/BasicLayout.js +124 -124
- package/dist_es/react/components/navigation/BasicLayout.js.map +1 -1
- package/dist_es/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
- package/dist_es/react/components/navigation/HeaderSiderLayout.js +80 -80
- package/dist_es/react/components/navigation/HeaderSiderLayout.js.map +1 -1
- package/dist_es/react/components/navigation/MenuPage.d.ts +37 -37
- package/dist_es/react/components/navigation/MenuPage.js +30 -30
- package/dist_es/react/components/navigation/MenuPage.js.map +1 -1
- package/dist_es/react/components/navigation/MenuTrigger.d.ts +9 -9
- package/dist_es/react/components/navigation/MenuTrigger.js +28 -28
- package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
- package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js +18 -18
- package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js.map +1 -1
- package/dist_es/react/components/navigation/ReactRouterLayout.d.ts +45 -46
- package/dist_es/react/components/navigation/ReactRouterLayout.js +99 -99
- package/dist_es/react/components/navigation/ReactRouterLayout.js.map +1 -1
- package/dist_es/react/components/navigation/customRouting/Router.d.ts +12 -12
- package/dist_es/react/components/navigation/customRouting/Router.js +18 -18
- package/dist_es/react/components/navigation/customRouting/Router.js.map +1 -1
- package/dist_es/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
- package/dist_es/react/components/navigation/customRouting/RouterLayout.js +34 -34
- package/dist_es/react/components/navigation/customRouting/RouterLayout.js.map +1 -1
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +26 -27
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.js +64 -64
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.js.map +1 -1
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +15 -16
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +58 -58
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.js.map +1 -1
- package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
- package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.js +94 -94
- package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.js.map +1 -1
- package/dist_es/react/hooks/useFin5BinUrl.d.ts +6 -6
- package/dist_es/react/hooks/useFin5BinUrl.js +11 -11
- package/dist_es/react/hooks/useFin5ColorScheme.d.ts +2 -2
- package/dist_es/react/hooks/useFin5ColorScheme.js +52 -52
- package/dist_es/react/hooks/useFin5ColorScheme.js.map +1 -1
- package/dist_es/react/hooks/useScreenSize.d.ts +7 -7
- package/dist_es/react/hooks/useScreenSize.js +27 -27
- package/package.json +26 -49
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2023, J2 Innovations. All Rights Reserved
|
|
3
|
-
*/
|
|
4
|
-
import { HBool, HCoord, HDate, HDateTime, HDict, HGrid, HMarker, HNa, HNum, HRef, HRemove, HStr, HSymbol, HTime, HUri, HXStr, Kind, } from 'haystack-core';
|
|
5
|
-
/**
|
|
6
|
-
* Get default values for all elements that should resolve into an HVal.
|
|
7
|
-
* @param section a section element
|
|
8
|
-
* @returns an object containing as key the section element name and as value the default HVal.
|
|
9
|
-
*/
|
|
10
|
-
export const getSectionDefault = (section) => {
|
|
11
|
-
const result = {};
|
|
12
|
-
Object.entries(section).forEach(([key, element]) => {
|
|
13
|
-
const elementData = element;
|
|
14
|
-
const defaultValue = getDefaultHVal(elementData?._meta?.resolvedType);
|
|
15
|
-
if (defaultValue) {
|
|
16
|
-
result[key] = defaultValue;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Get a default for a specific kind of HVal.
|
|
23
|
-
* @param kind can be expressed as new or old Hayson, or alternatively the haystack-core type name
|
|
24
|
-
* @returns
|
|
25
|
-
*/
|
|
26
|
-
export const getDefaultHVal = (kind) => {
|
|
27
|
-
switch (kind) {
|
|
28
|
-
case Kind.Marker:
|
|
29
|
-
case 'Marker':
|
|
30
|
-
case 'HMarker':
|
|
31
|
-
return HMarker.make();
|
|
32
|
-
case Kind.Remove:
|
|
33
|
-
case 'Remove':
|
|
34
|
-
case 'HRemove':
|
|
35
|
-
return HRemove.make();
|
|
36
|
-
case Kind.NA:
|
|
37
|
-
case 'NA':
|
|
38
|
-
case 'HNa':
|
|
39
|
-
return HNa.make();
|
|
40
|
-
case Kind.Coord:
|
|
41
|
-
case 'Coord':
|
|
42
|
-
case 'HCoord':
|
|
43
|
-
return HCoord.make({ latitude: 0, longitude: 0 });
|
|
44
|
-
case Kind.XStr:
|
|
45
|
-
case 'XStr':
|
|
46
|
-
case 'HXStr':
|
|
47
|
-
return HXStr.make('');
|
|
48
|
-
case Kind.Date:
|
|
49
|
-
case 'Date':
|
|
50
|
-
case 'HDate':
|
|
51
|
-
return HDate.make(new Date());
|
|
52
|
-
case Kind.DateTime:
|
|
53
|
-
case 'DateTime':
|
|
54
|
-
case 'HDateTime':
|
|
55
|
-
return HDateTime.make(new Date());
|
|
56
|
-
case Kind.Number:
|
|
57
|
-
case 'Number':
|
|
58
|
-
case 'HNum':
|
|
59
|
-
return HNum.make(0);
|
|
60
|
-
case Kind.Bool:
|
|
61
|
-
case 'Bool':
|
|
62
|
-
case 'HBool':
|
|
63
|
-
return HBool.make(false);
|
|
64
|
-
case 'Str':
|
|
65
|
-
case 'HStr':
|
|
66
|
-
return HStr.make('');
|
|
67
|
-
case Kind.Ref:
|
|
68
|
-
case 'Ref':
|
|
69
|
-
case 'HRef':
|
|
70
|
-
return HRef.make('');
|
|
71
|
-
case Kind.Symbol:
|
|
72
|
-
case 'Symbol':
|
|
73
|
-
case 'HSymbol':
|
|
74
|
-
return HSymbol.make('');
|
|
75
|
-
case Kind.Time:
|
|
76
|
-
case 'Time':
|
|
77
|
-
case 'HTime':
|
|
78
|
-
return HTime.make(new Date());
|
|
79
|
-
case Kind.Uri:
|
|
80
|
-
case 'Uri':
|
|
81
|
-
case 'HUri':
|
|
82
|
-
return HUri.make('');
|
|
83
|
-
case Kind.Dict:
|
|
84
|
-
case 'Dict':
|
|
85
|
-
case 'HDict':
|
|
86
|
-
return HDict.make();
|
|
87
|
-
case Kind.Grid:
|
|
88
|
-
case 'Grid':
|
|
89
|
-
case 'HGrid':
|
|
90
|
-
return HGrid.make();
|
|
91
|
-
default:
|
|
92
|
-
return undefined;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023, J2 Innovations. All Rights Reserved
|
|
3
|
+
*/
|
|
4
|
+
import { HBool, HCoord, HDate, HDateTime, HDict, HGrid, HMarker, HNa, HNum, HRef, HRemove, HStr, HSymbol, HTime, HUri, HXStr, Kind, } from 'haystack-core';
|
|
5
|
+
/**
|
|
6
|
+
* Get default values for all elements that should resolve into an HVal.
|
|
7
|
+
* @param section a section element
|
|
8
|
+
* @returns an object containing as key the section element name and as value the default HVal.
|
|
9
|
+
*/
|
|
10
|
+
export const getSectionDefault = (section) => {
|
|
11
|
+
const result = {};
|
|
12
|
+
Object.entries(section).forEach(([key, element]) => {
|
|
13
|
+
const elementData = element;
|
|
14
|
+
const defaultValue = getDefaultHVal(elementData?._meta?.resolvedType);
|
|
15
|
+
if (defaultValue) {
|
|
16
|
+
result[key] = defaultValue;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Get a default for a specific kind of HVal.
|
|
23
|
+
* @param kind can be expressed as new or old Hayson, or alternatively the haystack-core type name
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export const getDefaultHVal = (kind) => {
|
|
27
|
+
switch (kind) {
|
|
28
|
+
case Kind.Marker:
|
|
29
|
+
case 'Marker':
|
|
30
|
+
case 'HMarker':
|
|
31
|
+
return HMarker.make();
|
|
32
|
+
case Kind.Remove:
|
|
33
|
+
case 'Remove':
|
|
34
|
+
case 'HRemove':
|
|
35
|
+
return HRemove.make();
|
|
36
|
+
case Kind.NA:
|
|
37
|
+
case 'NA':
|
|
38
|
+
case 'HNa':
|
|
39
|
+
return HNa.make();
|
|
40
|
+
case Kind.Coord:
|
|
41
|
+
case 'Coord':
|
|
42
|
+
case 'HCoord':
|
|
43
|
+
return HCoord.make({ latitude: 0, longitude: 0 });
|
|
44
|
+
case Kind.XStr:
|
|
45
|
+
case 'XStr':
|
|
46
|
+
case 'HXStr':
|
|
47
|
+
return HXStr.make('');
|
|
48
|
+
case Kind.Date:
|
|
49
|
+
case 'Date':
|
|
50
|
+
case 'HDate':
|
|
51
|
+
return HDate.make(new Date());
|
|
52
|
+
case Kind.DateTime:
|
|
53
|
+
case 'DateTime':
|
|
54
|
+
case 'HDateTime':
|
|
55
|
+
return HDateTime.make(new Date());
|
|
56
|
+
case Kind.Number:
|
|
57
|
+
case 'Number':
|
|
58
|
+
case 'HNum':
|
|
59
|
+
return HNum.make(0);
|
|
60
|
+
case Kind.Bool:
|
|
61
|
+
case 'Bool':
|
|
62
|
+
case 'HBool':
|
|
63
|
+
return HBool.make(false);
|
|
64
|
+
case 'Str':
|
|
65
|
+
case 'HStr':
|
|
66
|
+
return HStr.make('');
|
|
67
|
+
case Kind.Ref:
|
|
68
|
+
case 'Ref':
|
|
69
|
+
case 'HRef':
|
|
70
|
+
return HRef.make('');
|
|
71
|
+
case Kind.Symbol:
|
|
72
|
+
case 'Symbol':
|
|
73
|
+
case 'HSymbol':
|
|
74
|
+
return HSymbol.make('');
|
|
75
|
+
case Kind.Time:
|
|
76
|
+
case 'Time':
|
|
77
|
+
case 'HTime':
|
|
78
|
+
return HTime.make(new Date());
|
|
79
|
+
case Kind.Uri:
|
|
80
|
+
case 'Uri':
|
|
81
|
+
case 'HUri':
|
|
82
|
+
return HUri.make('');
|
|
83
|
+
case Kind.Dict:
|
|
84
|
+
case 'Dict':
|
|
85
|
+
case 'HDict':
|
|
86
|
+
return HDict.make();
|
|
87
|
+
case Kind.Grid:
|
|
88
|
+
case 'Grid':
|
|
89
|
+
case 'HGrid':
|
|
90
|
+
return HGrid.make();
|
|
91
|
+
default:
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
95
|
//# sourceMappingURL=getSectionDefault.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSectionDefault.js","sourceRoot":"","sources":["../../../../../src/react/components/resolvable/configurationForm/getSectionDefault.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACN,KAAK,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,KAAK,EACL,KAAK,EACL,OAAO,EACP,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,EACL,IAAI,EAEJ,KAAK,EACL,IAAI,GACJ,MAAM,eAAe,CAAA;AAEtB;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAChC,OAAsB,EACI,EAAE;IAC5B,MAAM,MAAM,GAA4B,EAAE,CAAA;IAC1C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE;QAClD,MAAM,WAAW,GAAG,OAAoD,CAAA;QACxE,MAAM,YAAY,GAAG,cAAc,CAAC,WAAW,EAAE,KAAK,EAAE,YAAY,CAAC,CAAA;QAErE,IAAI,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"getSectionDefault.js","sourceRoot":"","sources":["../../../../../src/react/components/resolvable/configurationForm/getSectionDefault.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HRef } from 'haystack-core';
|
|
2
|
-
/**
|
|
3
|
-
* Retrieves the url of a Fin 5 bin based on the file record id, or undefined if the url couldn't be retrieved.
|
|
4
|
-
* Uses haystack-nclient to retrieve the projectName from context.
|
|
5
|
-
*/
|
|
6
|
-
export declare const useFin5BinUrl: (fileId?: HRef) => string | undefined;
|
|
1
|
+
import { HRef } from 'haystack-core';
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves the url of a Fin 5 bin based on the file record id, or undefined if the url couldn't be retrieved.
|
|
4
|
+
* Uses haystack-nclient to retrieve the projectName from context.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useFin5BinUrl: (fileId?: HRef) => string | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useClient } from 'haystack-react';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { getFin5BinUrl } from '../../fin5Top/getFin5BinUrl';
|
|
4
|
-
/**
|
|
5
|
-
* Retrieves the url of a Fin 5 bin based on the file record id, or undefined if the url couldn't be retrieved.
|
|
6
|
-
* Uses haystack-nclient to retrieve the projectName from context.
|
|
7
|
-
*/
|
|
8
|
-
export const useFin5BinUrl = (fileId) => {
|
|
9
|
-
const projectName = useClient().project;
|
|
10
|
-
return useMemo(() => (fileId ? getFin5BinUrl(fileId, projectName) : undefined), [fileId, projectName]);
|
|
11
|
-
};
|
|
1
|
+
import { useClient } from 'haystack-react';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { getFin5BinUrl } from '../../fin5Top/getFin5BinUrl';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the url of a Fin 5 bin based on the file record id, or undefined if the url couldn't be retrieved.
|
|
6
|
+
* Uses haystack-nclient to retrieve the projectName from context.
|
|
7
|
+
*/
|
|
8
|
+
export const useFin5BinUrl = (fileId) => {
|
|
9
|
+
const projectName = useClient().project;
|
|
10
|
+
return useMemo(() => (fileId ? getFin5BinUrl(fileId, projectName) : undefined), [fileId, projectName]);
|
|
11
|
+
};
|
|
12
12
|
//# sourceMappingURL=useFin5BinUrl.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ThemeDef } from '@j2inn/ui';
|
|
2
|
-
export declare function useFin5ColorScheme(): ThemeDef;
|
|
1
|
+
import { ThemeDef } from '@j2inn/ui';
|
|
2
|
+
export declare function useFin5ColorScheme(): ThemeDef;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025, J2 Innovations. All Rights Reserved
|
|
3
|
-
*/
|
|
4
|
-
import { DEFAULT_THEME, GenerateTheme, lighten, shade, tint, } from '@j2inn/ui';
|
|
5
|
-
import { useTheme } from 'react-jss';
|
|
6
|
-
import { getFin5top } from '../../fin5Top/fin5Top';
|
|
7
|
-
import { useMemo } from 'react';
|
|
8
|
-
export function useFin5ColorScheme() {
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
const fin5 = getFin5top();
|
|
11
|
-
const colorScheme = fin5?.app.GetColorScheme?.();
|
|
12
|
-
const currentTheme = fin5?.app.get('currentTheme');
|
|
13
|
-
const isDarkMode = currentTheme === 'dark';
|
|
14
|
-
const brandedTheme = useMemo(() => {
|
|
15
|
-
if (!colorScheme) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
return GenerateTheme({
|
|
19
|
-
light: {
|
|
20
|
-
...DEFAULT_THEME.light,
|
|
21
|
-
bodyBg: colorScheme.bodyBackground,
|
|
22
|
-
bgColor: lighten(colorScheme.bodyBackground, 5),
|
|
23
|
-
},
|
|
24
|
-
dark: {
|
|
25
|
-
...DEFAULT_THEME.dark,
|
|
26
|
-
textColor: tint(colorScheme.bodyBackground, 100),
|
|
27
|
-
popupBgColor: colorScheme.bodyBackground,
|
|
28
|
-
bodyBg: colorScheme.bodyBackground,
|
|
29
|
-
bgColor: lighten(colorScheme.bodyBackground, 5),
|
|
30
|
-
},
|
|
31
|
-
palette: {
|
|
32
|
-
...DEFAULT_THEME.palette,
|
|
33
|
-
primary: colorScheme.primary,
|
|
34
|
-
secondary: tint(colorScheme.primary, 20),
|
|
35
|
-
accent: shade(colorScheme.primary, 20),
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
}, [
|
|
39
|
-
colorScheme?.primary,
|
|
40
|
-
colorScheme?.bodyBackground,
|
|
41
|
-
colorScheme?.sidebarBackground,
|
|
42
|
-
]);
|
|
43
|
-
if (!brandedTheme) {
|
|
44
|
-
return theme;
|
|
45
|
-
}
|
|
46
|
-
if (isDarkMode) {
|
|
47
|
-
return brandedTheme.dark;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
return brandedTheme.light;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, J2 Innovations. All Rights Reserved
|
|
3
|
+
*/
|
|
4
|
+
import { DEFAULT_THEME, GenerateTheme, lighten, shade, tint, } from '@j2inn/ui';
|
|
5
|
+
import { useTheme } from 'react-jss';
|
|
6
|
+
import { getFin5top } from '../../fin5Top/fin5Top';
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
|
+
export function useFin5ColorScheme() {
|
|
9
|
+
const theme = useTheme();
|
|
10
|
+
const fin5 = getFin5top();
|
|
11
|
+
const colorScheme = fin5?.app.GetColorScheme?.();
|
|
12
|
+
const currentTheme = fin5?.app.get('currentTheme');
|
|
13
|
+
const isDarkMode = currentTheme === 'dark';
|
|
14
|
+
const brandedTheme = useMemo(() => {
|
|
15
|
+
if (!colorScheme) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
return GenerateTheme({
|
|
19
|
+
light: {
|
|
20
|
+
...DEFAULT_THEME.light,
|
|
21
|
+
bodyBg: colorScheme.bodyBackground,
|
|
22
|
+
bgColor: lighten(colorScheme.bodyBackground, 5),
|
|
23
|
+
},
|
|
24
|
+
dark: {
|
|
25
|
+
...DEFAULT_THEME.dark,
|
|
26
|
+
textColor: tint(colorScheme.bodyBackground, 100),
|
|
27
|
+
popupBgColor: colorScheme.bodyBackground,
|
|
28
|
+
bodyBg: colorScheme.bodyBackground,
|
|
29
|
+
bgColor: lighten(colorScheme.bodyBackground, 5),
|
|
30
|
+
},
|
|
31
|
+
palette: {
|
|
32
|
+
...DEFAULT_THEME.palette,
|
|
33
|
+
primary: colorScheme.primary,
|
|
34
|
+
secondary: tint(colorScheme.primary, 20),
|
|
35
|
+
accent: shade(colorScheme.primary, 20),
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}, [
|
|
39
|
+
colorScheme?.primary,
|
|
40
|
+
colorScheme?.bodyBackground,
|
|
41
|
+
colorScheme?.sidebarBackground,
|
|
42
|
+
]);
|
|
43
|
+
if (!brandedTheme) {
|
|
44
|
+
return theme;
|
|
45
|
+
}
|
|
46
|
+
if (isDarkMode) {
|
|
47
|
+
return brandedTheme.dark;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return brandedTheme.light;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
53
|
//# sourceMappingURL=useFin5ColorScheme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFin5ColorScheme.js","sourceRoot":"","sources":["../../../src/react/hooks/useFin5ColorScheme.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,aAAa,EACb,aAAa,EACb,OAAO,EACP,KAAK,EAEL,IAAI,GACJ,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,MAAM,UAAU,kBAAkB;IACjC,MAAM,KAAK,GAAG,QAAQ,EAAY,CAAA;IAClC,MAAM,IAAI,GAAG,UAAU,EAAE,CAAA;IACzB,MAAM,WAAW,GAAG,IAAI,EAAE,GAAG,CAAC,cAAc,EAAE,EAAE,CAAA;IAChD,MAAM,YAAY,GAAG,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,cAAc,CAAsB,CAAA;IACvE,MAAM,UAAU,GAAG,YAAY,KAAK,MAAM,CAAA;IAE1C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,IAAI,CAAC,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"useFin5ColorScheme.js","sourceRoot":"","sources":["../../../src/react/hooks/useFin5ColorScheme.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,aAAa,EACb,aAAa,EACb,OAAO,EACP,KAAK,EAEL,IAAI,GACJ,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,MAAM,UAAU,kBAAkB;IACjC,MAAM,KAAK,GAAG,QAAQ,EAAY,CAAA;IAClC,MAAM,IAAI,GAAG,UAAU,EAAE,CAAA;IACzB,MAAM,WAAW,GAAG,IAAI,EAAE,GAAG,CAAC,cAAc,EAAE,EAAE,CAAA;IAChD,MAAM,YAAY,GAAG,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,cAAc,CAAsB,CAAA;IACvE,MAAM,UAAU,GAAG,YAAY,KAAK,MAAM,CAAA;IAE1C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,IAAI,CAAC,WAAW,EAAE,CAAC;YAClB,OAAO,SAAS,CAAA;QACjB,CAAC;QAED,OAAO,aAAa,CAAC;YACpB,KAAK,EAAE;gBACN,GAAG,aAAa,CAAC,KAAK;gBACtB,MAAM,EAAE,WAAW,CAAC,cAAc;gBAClC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;aAC/C;YACD,IAAI,EAAE;gBACL,GAAG,aAAa,CAAC,IAAI;gBACrB,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,GAAG,CAAC;gBAChD,YAAY,EAAE,WAAW,CAAC,cAAc;gBACxC,MAAM,EAAE,WAAW,CAAC,cAAc;gBAClC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;aAC/C;YACD,OAAO,EAAE;gBACR,GAAG,aAAa,CAAC,OAAO;gBACxB,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;gBACxC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;aACtC;SACD,CAAC,CAAA;IACH,CAAC,EAAE;QACF,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,iBAAiB;KAC9B,CAAC,CAAA;IAEF,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,OAAO,KAAK,CAAA;IACb,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QAChB,OAAO,YAAY,CAAC,IAAI,CAAA;IACzB,CAAC;SAAM,CAAC;QACP,OAAO,YAAY,CAAC,KAAK,CAAA;IAC1B,CAAC;AACF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Observe screen size.
|
|
3
|
-
*/
|
|
4
|
-
export declare const useScreenSize: () => {
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Observe screen size.
|
|
3
|
+
*/
|
|
4
|
+
export declare const useScreenSize: () => {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025, J2 Innovations. All Rights Reserved
|
|
3
|
-
*/
|
|
4
|
-
import { useEffect, useState } from 'react';
|
|
5
|
-
/**
|
|
6
|
-
* Observe screen size.
|
|
7
|
-
*/
|
|
8
|
-
export const useScreenSize = () => {
|
|
9
|
-
const [screenSize, setScreenSize] = useState({
|
|
10
|
-
width: window.innerWidth,
|
|
11
|
-
height: window.innerHeight,
|
|
12
|
-
});
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const handleResize = () => {
|
|
15
|
-
setScreenSize({
|
|
16
|
-
width: window.innerWidth,
|
|
17
|
-
height: window.innerHeight,
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
window.addEventListener('resize', handleResize);
|
|
21
|
-
// Clean up the event listener when the component unmounts
|
|
22
|
-
return () => {
|
|
23
|
-
window.removeEventListener('resize', handleResize);
|
|
24
|
-
};
|
|
25
|
-
}, []);
|
|
26
|
-
return screenSize;
|
|
27
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, J2 Innovations. All Rights Reserved
|
|
3
|
+
*/
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Observe screen size.
|
|
7
|
+
*/
|
|
8
|
+
export const useScreenSize = () => {
|
|
9
|
+
const [screenSize, setScreenSize] = useState({
|
|
10
|
+
width: window.innerWidth,
|
|
11
|
+
height: window.innerHeight,
|
|
12
|
+
});
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const handleResize = () => {
|
|
15
|
+
setScreenSize({
|
|
16
|
+
width: window.innerWidth,
|
|
17
|
+
height: window.innerHeight,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
window.addEventListener('resize', handleResize);
|
|
21
|
+
// Clean up the event listener when the component unmounts
|
|
22
|
+
return () => {
|
|
23
|
+
window.removeEventListener('resize', handleResize);
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
return screenSize;
|
|
27
|
+
};
|
|
28
28
|
//# sourceMappingURL=useScreenSize.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@j2inn/fin5-ui-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-beta.0",
|
|
4
4
|
"description": "A set of useful client-side utilities useful for creating UI applications on top of FIN 5",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"build:es": "tsc --module ESNext --outDir dist_es",
|
|
14
14
|
"checktypes": "tsc --noEmit",
|
|
15
15
|
"format": "prettier-eslint --list-different --write \"$(pwd)/src/**/*.{ts,tsx,js,jsx}\"",
|
|
16
|
-
"lint": "eslint --fix
|
|
16
|
+
"lint": "eslint --fix src/",
|
|
17
17
|
"lint-staged": "lint-staged",
|
|
18
18
|
"test": "cross-env NODE_ENV=test && npm run test:jest",
|
|
19
19
|
"test:jest": "jest",
|
|
@@ -28,9 +28,13 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@j2inn/react-config": "^5.0.0",
|
|
30
30
|
"classnames": "^2.3.1",
|
|
31
|
-
"js-yaml": "^4.
|
|
31
|
+
"js-yaml": "^5.4.3",
|
|
32
32
|
"qrious": "^4.0.2"
|
|
33
33
|
},
|
|
34
|
+
"overrides": {
|
|
35
|
+
"js-yaml": "$js-yaml",
|
|
36
|
+
"postcss-selector-parser": ">=7.1.6"
|
|
37
|
+
},
|
|
34
38
|
"peerDependencies": {
|
|
35
39
|
"@amcharts/amcharts5": "^5.9.13",
|
|
36
40
|
"@j2inn/app": "^6.0.0 || ^7.0.0",
|
|
@@ -47,79 +51,52 @@
|
|
|
47
51
|
"react": "^18.2.0",
|
|
48
52
|
"react-dom": "^18.2.0",
|
|
49
53
|
"react-jss": "^10.9.2",
|
|
50
|
-
"react-router": "^
|
|
51
|
-
"react-router-dom": "^6.10.0"
|
|
54
|
+
"react-router": "^7.18.4"
|
|
52
55
|
},
|
|
53
56
|
"devDependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
58
|
-
"@babel/plugin-proposal-decorators": "^7.19.1",
|
|
59
|
-
"@babel/plugin-proposal-export-default-from": "^7.18.10",
|
|
60
|
-
"@babel/plugin-proposal-function-bind": "^7.18.9",
|
|
61
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.18.9",
|
|
62
|
-
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
63
|
-
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
|
|
64
|
-
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
65
|
-
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
|
|
66
|
-
"@babel/plugin-transform-react-inline-elements": "^7.18.6",
|
|
67
|
-
"@babel/plugin-transform-runtime": "^7.19.1",
|
|
68
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
69
|
-
"@babel/runtime": "^7.19.0",
|
|
70
|
-
"@types/jest": "^29.0.3",
|
|
71
|
-
"@types/js-yaml": "^4.0.5",
|
|
57
|
+
"@eslint-react/eslint-plugin": "^5.26.5",
|
|
58
|
+
"@types/jest": "^30.0.0",
|
|
59
|
+
"@types/js-yaml": "^4.0.9",
|
|
72
60
|
"@types/lodash": "^4.17.19",
|
|
73
|
-
"@types/node": "^
|
|
61
|
+
"@types/node": "^22.20.5",
|
|
74
62
|
"@types/react": "^18.0.20",
|
|
75
63
|
"@types/react-dom": "^18.0.20",
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "^5.37.0",
|
|
77
|
-
"@typescript-eslint/parser": "^5.37.0",
|
|
78
|
-
"babel-eslint": "^10.1.0",
|
|
79
|
-
"babel-loader": "^8.2.2",
|
|
80
|
-
"babel-plugin-react-html-attrs": "^3.0.5",
|
|
81
|
-
"babel-preset-react-app": "^10.0.1",
|
|
82
64
|
"bundle-loader": "^0.5.6",
|
|
83
|
-
"cpy": "^9.0.1",
|
|
84
|
-
"cpy-cli": "^4.2.0",
|
|
85
65
|
"cross-env": "^7.0.3",
|
|
86
66
|
"css-loader": "^6.7.1",
|
|
87
67
|
"css-modules-typescript-loader": "^4.0.1",
|
|
88
|
-
"eslint": "^
|
|
89
|
-
"eslint-config-prettier": "^
|
|
90
|
-
"eslint-plugin-jest": "^
|
|
91
|
-
"eslint-plugin-prettier": "^
|
|
92
|
-
"eslint-plugin-react": "^7.31.8",
|
|
68
|
+
"eslint": "^10.12.0",
|
|
69
|
+
"eslint-config-prettier": "^10.1.8",
|
|
70
|
+
"eslint-plugin-jest": "^29.17.0",
|
|
71
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
93
72
|
"extract-css-chunks-webpack-plugin": "^4.9.0",
|
|
73
|
+
"globals": "^17.13.0",
|
|
94
74
|
"haystack-core": "^3.0.5",
|
|
95
75
|
"haystack-nclient": "^4.0.3",
|
|
96
76
|
"haystack-react": "^4.0.3",
|
|
97
77
|
"haystack-units": "^2.0.3",
|
|
98
|
-
"
|
|
99
|
-
"jest": "^29.0.3",
|
|
78
|
+
"jest": "^30.5.2",
|
|
100
79
|
"jest-chain": "^1.1.5",
|
|
101
80
|
"jest-css-modules": "^2.1.0",
|
|
102
81
|
"jest-css-modules-transform": "^4.2.1",
|
|
103
82
|
"jest-extended": "^3.1.0",
|
|
104
83
|
"less": "^4.1.2",
|
|
105
84
|
"less-loader": "^11.0.0",
|
|
106
|
-
"lint-staged": "^13.0.3",
|
|
107
85
|
"lodash-webpack-plugin": "^0.11.6",
|
|
108
86
|
"mini-css-extract-plugin": "^2.6.0",
|
|
109
87
|
"moment-locales-webpack-plugin": "^1.2.0",
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"prettier": "^2.
|
|
113
|
-
"prettier-eslint": "^15.0.1",
|
|
114
|
-
"prettier-eslint-cli": "^7.1.0",
|
|
88
|
+
"prettier": "^3.9.10",
|
|
89
|
+
"prettier-eslint": "^17.1.2",
|
|
90
|
+
"prettier-eslint-cli": "^9.2.1",
|
|
115
91
|
"react": "^18.2.0",
|
|
116
92
|
"react-dom": "^18.2.0",
|
|
117
93
|
"react-jss": "^10.9.2",
|
|
94
|
+
"react-router": "^7.18.4",
|
|
118
95
|
"rimraf": "^3.0.2",
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"typescript": "^
|
|
96
|
+
"ts-jest": "^29.4.14",
|
|
97
|
+
"typedoc": "^0.28.20",
|
|
98
|
+
"typescript": "^5.9.3",
|
|
99
|
+
"typescript-eslint": "^8.71.2"
|
|
123
100
|
},
|
|
124
101
|
"lint-staged": {
|
|
125
102
|
"**/*.[jt]s?(x)": [
|