@j2inn/fin5-ui-utils 8.1.1-beta.4 → 8.1.1-beta.6

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.
Files changed (216) hide show
  1. package/README.md +5 -5
  2. package/dist/fantomProps/createFin5Props/index.d.ts +12 -12
  3. package/dist/fantomProps/createFin5Props/index.js +146 -146
  4. package/dist/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
  5. package/dist/fantomProps/createFin5Props/runCreateFin5Props.js +20 -20
  6. package/dist/fantomProps/fantomPropsToObject.d.ts +8 -8
  7. package/dist/fantomProps/fantomPropsToObject.js +183 -183
  8. package/dist/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
  9. package/dist/fantomProps/generateJsonFromFantomPropsFile.js +41 -41
  10. package/dist/fantomProps/localePropsToJson.d.ts +1 -1
  11. package/dist/fantomProps/localePropsToJson.js +50 -50
  12. package/dist/fantomProps/readFantomPropsFile.d.ts +5 -5
  13. package/dist/fantomProps/readFantomPropsFile.js +65 -65
  14. package/dist/fin5Top/fin5FileUpload.d.ts +24 -24
  15. package/dist/fin5Top/fin5FileUpload.js +51 -51
  16. package/dist/fin5Top/fin5Top.d.ts +165 -124
  17. package/dist/fin5Top/fin5Top.js +61 -53
  18. package/dist/fin5Top/fin5Top.js.map +1 -1
  19. package/dist/fin5Top/finEdge2Cloud.d.ts +6 -6
  20. package/dist/fin5Top/finEdge2Cloud.js +15 -15
  21. package/dist/fin5Top/getFin5BinUrl.d.ts +2 -2
  22. package/dist/fin5Top/getFin5BinUrl.js +9 -9
  23. package/dist/fin5Top/openFin5Alarm.d.ts +22 -22
  24. package/dist/fin5Top/openFin5Alarm.js +23 -23
  25. package/dist/fin5Top/openFin5Historian.d.ts +3 -3
  26. package/dist/fin5Top/openFin5Historian.js +19 -19
  27. package/dist/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
  28. package/dist/fin5Top/useFin5AppURLHashParameter.js +133 -133
  29. package/dist/index.d.ts +35 -35
  30. package/dist/index.js +69 -69
  31. package/dist/jobs/jobUtils.d.ts +14 -14
  32. package/dist/jobs/jobUtils.js +15 -15
  33. package/dist/react/app/Fin5AppContainer.d.ts +36 -36
  34. package/dist/react/app/Fin5AppContainer.js +145 -168
  35. package/dist/react/app/Fin5AppContainer.js.map +1 -1
  36. package/dist/react/app/Fin5AppRootStore.d.ts +40 -42
  37. package/dist/react/app/Fin5AppRootStore.js +90 -114
  38. package/dist/react/app/Fin5AppRootStore.js.map +1 -1
  39. package/dist/react/components/ErrorBoundary.d.ts +57 -57
  40. package/dist/react/components/ErrorBoundary.js +150 -150
  41. package/dist/react/components/ErrorDisplayer.d.ts +19 -19
  42. package/dist/react/components/ErrorDisplayer.js +36 -36
  43. package/dist/react/components/Loader.d.ts +9 -9
  44. package/dist/react/components/Loader.js +17 -17
  45. package/dist/react/components/LoadingSpinner.d.ts +2 -2
  46. package/dist/react/components/LoadingSpinner.js +27 -27
  47. package/dist/react/components/RecordImage.d.ts +20 -20
  48. package/dist/react/components/RecordImage.js +51 -51
  49. package/dist/react/components/charts/QRCode.d.ts +25 -25
  50. package/dist/react/components/charts/QRCode.js +82 -82
  51. package/dist/react/components/charts/line-bar/Chart.d.ts +166 -166
  52. package/dist/react/components/charts/line-bar/Chart.js +442 -442
  53. package/dist/react/components/charts/line-bar/HGridChart.d.ts +58 -58
  54. package/dist/react/components/charts/line-bar/HGridChart.js +285 -285
  55. package/dist/react/components/charts/pie/PieChart.d.ts +94 -94
  56. package/dist/react/components/charts/pie/PieChart.js +204 -204
  57. package/dist/react/components/charts/pie/SimplePieChart.d.ts +21 -21
  58. package/dist/react/components/charts/pie/SimplePieChart.js +55 -55
  59. package/dist/react/components/graphics/GraphicViewer.d.ts +10 -10
  60. package/dist/react/components/graphics/GraphicViewer.js +29 -29
  61. package/dist/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
  62. package/dist/react/components/graphics/GraphicsTabViewer.js +90 -90
  63. package/dist/react/components/makeCustomElement.d.ts +16 -16
  64. package/dist/react/components/makeCustomElement.js +150 -150
  65. package/dist/react/components/navigation/BasicLayout.d.ts +41 -41
  66. package/dist/react/components/navigation/BasicLayout.js +155 -155
  67. package/dist/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
  68. package/dist/react/components/navigation/HeaderSiderLayout.js +110 -110
  69. package/dist/react/components/navigation/MenuPage.d.ts +37 -37
  70. package/dist/react/components/navigation/MenuPage.js +36 -36
  71. package/dist/react/components/navigation/MenuTrigger.d.ts +9 -9
  72. package/dist/react/components/navigation/MenuTrigger.js +33 -33
  73. package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
  74. package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.js +25 -25
  75. package/dist/react/components/navigation/ReactRouterLayout.d.ts +46 -46
  76. package/dist/react/components/navigation/ReactRouterLayout.js +132 -132
  77. package/dist/react/components/navigation/customRouting/Router.d.ts +12 -12
  78. package/dist/react/components/navigation/customRouting/Router.js +45 -45
  79. package/dist/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
  80. package/dist/react/components/navigation/customRouting/RouterLayout.js +61 -61
  81. package/dist/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +27 -27
  82. package/dist/react/components/resolvable/configurationForm/ConfigurationForm.js +95 -95
  83. package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +16 -16
  84. package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +88 -88
  85. package/dist/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
  86. package/dist/react/components/resolvable/configurationForm/getSectionDefault.js +99 -99
  87. package/dist/react/hooks/useFin5BinUrl.d.ts +6 -6
  88. package/dist/react/hooks/useFin5BinUrl.js +15 -15
  89. package/dist/react/hooks/useFin5ColorScheme.d.ts +2 -2
  90. package/dist/react/hooks/useFin5ColorScheme.js +56 -56
  91. package/dist/react/hooks/useScreenSize.d.ts +7 -7
  92. package/dist/react/hooks/useScreenSize.js +31 -31
  93. package/dist_es/fantomProps/createFin5Props/index.d.ts +12 -12
  94. package/dist_es/fantomProps/createFin5Props/index.js +140 -140
  95. package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
  96. package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.js +15 -15
  97. package/dist_es/fantomProps/fantomPropsToObject.d.ts +8 -8
  98. package/dist_es/fantomProps/fantomPropsToObject.js +178 -178
  99. package/dist_es/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
  100. package/dist_es/fantomProps/generateJsonFromFantomPropsFile.js +12 -12
  101. package/dist_es/fantomProps/localePropsToJson.d.ts +1 -1
  102. package/dist_es/fantomProps/localePropsToJson.js +21 -21
  103. package/dist_es/fantomProps/readFantomPropsFile.d.ts +5 -5
  104. package/dist_es/fantomProps/readFantomPropsFile.js +39 -39
  105. package/dist_es/fin5Top/fin5FileUpload.d.ts +24 -24
  106. package/dist_es/fin5Top/fin5FileUpload.js +47 -47
  107. package/dist_es/fin5Top/fin5Top.d.ts +165 -124
  108. package/dist_es/fin5Top/fin5Top.js +57 -49
  109. package/dist_es/fin5Top/fin5Top.js.map +1 -1
  110. package/dist_es/fin5Top/finEdge2Cloud.d.ts +6 -6
  111. package/dist_es/fin5Top/finEdge2Cloud.js +11 -11
  112. package/dist_es/fin5Top/getFin5BinUrl.d.ts +2 -2
  113. package/dist_es/fin5Top/getFin5BinUrl.js +5 -5
  114. package/dist_es/fin5Top/openFin5Alarm.d.ts +22 -22
  115. package/dist_es/fin5Top/openFin5Alarm.js +19 -19
  116. package/dist_es/fin5Top/openFin5Historian.d.ts +3 -3
  117. package/dist_es/fin5Top/openFin5Historian.js +15 -15
  118. package/dist_es/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
  119. package/dist_es/fin5Top/useFin5AppURLHashParameter.js +124 -124
  120. package/dist_es/index.d.ts +35 -35
  121. package/dist_es/index.js +53 -53
  122. package/dist_es/jobs/jobUtils.d.ts +14 -14
  123. package/dist_es/jobs/jobUtils.js +9 -9
  124. package/dist_es/react/app/Fin5AppContainer.d.ts +36 -36
  125. package/dist_es/react/app/Fin5AppContainer.js +116 -139
  126. package/dist_es/react/app/Fin5AppContainer.js.map +1 -1
  127. package/dist_es/react/app/Fin5AppContainer.jsx +82 -0
  128. package/dist_es/react/app/Fin5AppContainer.jsx.map +1 -0
  129. package/dist_es/react/app/Fin5AppRootStore.d.ts +40 -42
  130. package/dist_es/react/app/Fin5AppRootStore.js +86 -110
  131. package/dist_es/react/app/Fin5AppRootStore.js.map +1 -1
  132. package/dist_es/react/components/ErrorBoundary.d.ts +57 -57
  133. package/dist_es/react/components/ErrorBoundary.js +123 -123
  134. package/dist_es/react/components/ErrorBoundary.jsx +150 -0
  135. package/dist_es/react/components/ErrorBoundary.jsx.map +1 -0
  136. package/dist_es/react/components/ErrorDisplayer.d.ts +19 -19
  137. package/dist_es/react/components/ErrorDisplayer.js +28 -28
  138. package/dist_es/react/components/ErrorDisplayer.jsx +36 -0
  139. package/dist_es/react/components/ErrorDisplayer.jsx.map +1 -0
  140. package/dist_es/react/components/Loader.d.ts +9 -9
  141. package/dist_es/react/components/Loader.js +12 -12
  142. package/dist_es/react/components/Loader.jsx +13 -0
  143. package/dist_es/react/components/Loader.jsx.map +1 -0
  144. package/dist_es/react/components/LoadingSpinner.d.ts +2 -2
  145. package/dist_es/react/components/LoadingSpinner.js +20 -20
  146. package/dist_es/react/components/LoadingSpinner.jsx +22 -0
  147. package/dist_es/react/components/LoadingSpinner.jsx.map +1 -0
  148. package/dist_es/react/components/RecordImage.d.ts +20 -20
  149. package/dist_es/react/components/RecordImage.js +24 -24
  150. package/dist_es/react/components/charts/QRCode.d.ts +25 -25
  151. package/dist_es/react/components/charts/QRCode.js +52 -52
  152. package/dist_es/react/components/charts/line-bar/Chart.d.ts +166 -166
  153. package/dist_es/react/components/charts/line-bar/Chart.js +415 -415
  154. package/dist_es/react/components/charts/line-bar/HGridChart.d.ts +58 -58
  155. package/dist_es/react/components/charts/line-bar/HGridChart.js +250 -250
  156. package/dist_es/react/components/charts/line-bar/ZincGridChart.d.ts +12 -0
  157. package/dist_es/react/components/charts/line-bar/ZincGridChart.js +17 -0
  158. package/dist_es/react/components/charts/line-bar/ZincGridChart.js.map +1 -0
  159. package/dist_es/react/components/charts/pie/PieChart.d.ts +94 -94
  160. package/dist_es/react/components/charts/pie/PieChart.js +177 -177
  161. package/dist_es/react/components/charts/pie/SimplePieChart.d.ts +21 -21
  162. package/dist_es/react/components/charts/pie/SimplePieChart.js +25 -25
  163. package/dist_es/react/components/graphics/GraphicViewer.d.ts +10 -10
  164. package/dist_es/react/components/graphics/GraphicViewer.js +22 -22
  165. package/dist_es/react/components/graphics/GraphicViewer.jsx +23 -0
  166. package/dist_es/react/components/graphics/GraphicViewer.jsx.map +1 -0
  167. package/dist_es/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
  168. package/dist_es/react/components/graphics/GraphicsTabViewer.js +60 -60
  169. package/dist_es/react/components/graphics/GraphicsTabViewer.jsx +63 -0
  170. package/dist_es/react/components/graphics/GraphicsTabViewer.jsx.map +1 -0
  171. package/dist_es/react/components/makeCustomElement.d.ts +16 -16
  172. package/dist_es/react/components/makeCustomElement.js +142 -142
  173. package/dist_es/react/components/navigation/BasicLayout.d.ts +41 -41
  174. package/dist_es/react/components/navigation/BasicLayout.js +124 -124
  175. package/dist_es/react/components/navigation/BasicLayout.jsx +133 -0
  176. package/dist_es/react/components/navigation/BasicLayout.jsx.map +1 -0
  177. package/dist_es/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
  178. package/dist_es/react/components/navigation/HeaderSiderLayout.js +80 -80
  179. package/dist_es/react/components/navigation/MenuPage.d.ts +37 -37
  180. package/dist_es/react/components/navigation/MenuPage.js +30 -30
  181. package/dist_es/react/components/navigation/MenuPage.jsx +31 -0
  182. package/dist_es/react/components/navigation/MenuPage.jsx.map +1 -0
  183. package/dist_es/react/components/navigation/MenuTrigger.d.ts +9 -9
  184. package/dist_es/react/components/navigation/MenuTrigger.js +28 -28
  185. package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
  186. package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js +18 -18
  187. package/dist_es/react/components/navigation/ReactRouterLayout.d.ts +46 -46
  188. package/dist_es/react/components/navigation/ReactRouterLayout.js +99 -99
  189. package/dist_es/react/components/navigation/Router.d.ts +12 -0
  190. package/dist_es/react/components/navigation/Router.js +19 -0
  191. package/dist_es/react/components/navigation/Router.js.map +1 -0
  192. package/dist_es/react/components/navigation/Router.jsx +19 -0
  193. package/dist_es/react/components/navigation/Router.jsx.map +1 -0
  194. package/dist_es/react/components/navigation/customRouting/Router.d.ts +12 -12
  195. package/dist_es/react/components/navigation/customRouting/Router.js +18 -18
  196. package/dist_es/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
  197. package/dist_es/react/components/navigation/customRouting/RouterLayout.js +34 -34
  198. package/dist_es/react/components/navigation/react-router/BasicLayout.d.ts +23 -0
  199. package/dist_es/react/components/navigation/react-router/BasicLayout.js +82 -0
  200. package/dist_es/react/components/navigation/react-router/BasicLayout.js.map +1 -0
  201. package/dist_es/react/components/navigation/react-router/ReactRouterBasicLayout.d.ts +24 -0
  202. package/dist_es/react/components/navigation/react-router/ReactRouterBasicLayout.js +82 -0
  203. package/dist_es/react/components/navigation/react-router/ReactRouterBasicLayout.js.map +1 -0
  204. package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +27 -27
  205. package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.js +64 -64
  206. package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +16 -16
  207. package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +58 -58
  208. package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
  209. package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.js +94 -94
  210. package/dist_es/react/hooks/useFin5BinUrl.d.ts +6 -6
  211. package/dist_es/react/hooks/useFin5BinUrl.js +11 -11
  212. package/dist_es/react/hooks/useFin5ColorScheme.d.ts +2 -2
  213. package/dist_es/react/hooks/useFin5ColorScheme.js +52 -52
  214. package/dist_es/react/hooks/useScreenSize.d.ts +7 -7
  215. package/dist_es/react/hooks/useScreenSize.js +27 -27
  216. package/package.json +1 -1
@@ -1,89 +1,89 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2023, J2 Innovations. All Rights Reserved
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.ConfigurationFormEntry = void 0;
33
- const ui_1 = require("@j2inn/ui");
34
- const classnames_1 = __importDefault(require("classnames"));
35
- const haystack_core_1 = require("haystack-core");
36
- const react_1 = __importStar(require("react"));
37
- const react_jss_1 = require("react-jss");
38
- const useStyles = (0, react_jss_1.createUseStyles)((theme) => ({
39
- formEntry: {
40
- [`& .${ui_1.ant_prefix}-input`]: {
41
- height: 32,
42
- },
43
- },
44
- entryTitle: {
45
- fontWeight: 600,
46
- fontSize: '1em',
47
- color: theme.textColorSecondary,
48
- },
49
- select: {
50
- width: '100%',
51
- },
52
- }));
53
- const getHValFromSelectValue = (selectValue, initialHVal) => {
54
- if ((0, haystack_core_1.valueIsKind)(initialHVal, haystack_core_1.Kind.Number)) {
55
- return haystack_core_1.HNum.make(selectValue, initialHVal.unit);
56
- }
57
- else if ((0, haystack_core_1.valueIsKind)(initialHVal, haystack_core_1.Kind.Ref)) {
58
- return haystack_core_1.HRef.make(selectValue);
59
- }
60
- return haystack_core_1.HStr.make(selectValue);
61
- };
62
- const ConfigurationFormEntry = ({ name, value, onChange, disabled, options, className, }) => {
63
- const classes = useStyles();
64
- if (!(0, haystack_core_1.isHVal)(value)) {
65
- return react_1.default.createElement(react_1.default.Fragment, null, `${name} = ${value}`);
66
- }
67
- const [showedVal, setShowedVal] = (0, react_1.useState)(value);
68
- (0, react_1.useEffect)(() => {
69
- setShowedVal(value);
70
- }, [value]);
71
- const selectOptions = (0, react_1.useMemo)(() => options?.getRows().map((cfeOpt) => ({
72
- value: cfeOpt.value.value,
73
- label: cfeOpt.label.value,
74
- })), [options]);
75
- const onInputChange = (0, react_1.useCallback)((val) => {
76
- setShowedVal(val);
77
- onChange?.(val);
78
- }, [onChange]);
79
- return (react_1.default.createElement("div", { className: (0, classnames_1.default)(classes.formEntry, className) },
80
- react_1.default.createElement("div", { className: classes.entryTitle }, name),
81
- selectOptions ? (react_1.default.createElement(ui_1.Select, { showSearch: true, className: classes.select, value: showedVal.value, options: selectOptions, disabled: disabled, onChange: (val) => {
82
- if (val != null) {
83
- const newVal = getHValFromSelectValue(val, value);
84
- onInputChange(newVal);
85
- }
86
- } })) : !disabled ? (react_1.default.createElement(ui_1.HInput, { value: showedVal, editable: true, onChange: onInputChange })) : (react_1.default.createElement(ui_1.Input, { disabled: true, value: showedVal.toString() }))));
87
- };
88
- exports.ConfigurationFormEntry = ConfigurationFormEntry;
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2023, J2 Innovations. All Rights Reserved
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.ConfigurationFormEntry = void 0;
33
+ const ui_1 = require("@j2inn/ui");
34
+ const classnames_1 = __importDefault(require("classnames"));
35
+ const haystack_core_1 = require("haystack-core");
36
+ const react_1 = __importStar(require("react"));
37
+ const react_jss_1 = require("react-jss");
38
+ const useStyles = (0, react_jss_1.createUseStyles)((theme) => ({
39
+ formEntry: {
40
+ [`& .${ui_1.ant_prefix}-input`]: {
41
+ height: 32,
42
+ },
43
+ },
44
+ entryTitle: {
45
+ fontWeight: 600,
46
+ fontSize: '1em',
47
+ color: theme.textColorSecondary,
48
+ },
49
+ select: {
50
+ width: '100%',
51
+ },
52
+ }));
53
+ const getHValFromSelectValue = (selectValue, initialHVal) => {
54
+ if ((0, haystack_core_1.valueIsKind)(initialHVal, haystack_core_1.Kind.Number)) {
55
+ return haystack_core_1.HNum.make(selectValue, initialHVal.unit);
56
+ }
57
+ else if ((0, haystack_core_1.valueIsKind)(initialHVal, haystack_core_1.Kind.Ref)) {
58
+ return haystack_core_1.HRef.make(selectValue);
59
+ }
60
+ return haystack_core_1.HStr.make(selectValue);
61
+ };
62
+ const ConfigurationFormEntry = ({ name, value, onChange, disabled, options, className, }) => {
63
+ const classes = useStyles();
64
+ if (!(0, haystack_core_1.isHVal)(value)) {
65
+ return react_1.default.createElement(react_1.default.Fragment, null, `${name} = ${value}`);
66
+ }
67
+ const [showedVal, setShowedVal] = (0, react_1.useState)(value);
68
+ (0, react_1.useEffect)(() => {
69
+ setShowedVal(value);
70
+ }, [value]);
71
+ const selectOptions = (0, react_1.useMemo)(() => options?.getRows().map((cfeOpt) => ({
72
+ value: cfeOpt.value.value,
73
+ label: cfeOpt.label.value,
74
+ })), [options]);
75
+ const onInputChange = (0, react_1.useCallback)((val) => {
76
+ setShowedVal(val);
77
+ onChange?.(val);
78
+ }, [onChange]);
79
+ return (react_1.default.createElement("div", { className: (0, classnames_1.default)(classes.formEntry, className) },
80
+ react_1.default.createElement("div", { className: classes.entryTitle }, name),
81
+ selectOptions ? (react_1.default.createElement(ui_1.Select, { showSearch: true, className: classes.select, value: showedVal.value, options: selectOptions, disabled: disabled, onChange: (val) => {
82
+ if (val != null) {
83
+ const newVal = getHValFromSelectValue(val, value);
84
+ onInputChange(newVal);
85
+ }
86
+ } })) : !disabled ? (react_1.default.createElement(ui_1.HInput, { value: showedVal, editable: true, onChange: onInputChange })) : (react_1.default.createElement(ui_1.Input, { disabled: true, value: showedVal.toString() }))));
87
+ };
88
+ exports.ConfigurationFormEntry = ConfigurationFormEntry;
89
89
  //# sourceMappingURL=ConfigurationFormEntry.js.map
@@ -1,16 +1,16 @@
1
- import { UiElementData } from '@j2inn/resolvable-ui-elements';
2
- import { HVal } from 'haystack-core';
3
- /**
4
- * Get default values for all elements that should resolve into an HVal.
5
- * @param section a section element
6
- * @returns an object containing as key the section element name and as value the default HVal.
7
- */
8
- export declare const getSectionDefault: (section: UiElementData) => {
9
- [key: string]: HVal;
10
- };
11
- /**
12
- * Get a default for a specific kind of HVal.
13
- * @param kind can be expressed as new or old Hayson, or alternatively the haystack-core type name
14
- * @returns
15
- */
16
- export declare const getDefaultHVal: (kind?: string) => HVal | undefined;
1
+ import { UiElementData } from '@j2inn/resolvable-ui-elements';
2
+ import { HVal } from 'haystack-core';
3
+ /**
4
+ * Get default values for all elements that should resolve into an HVal.
5
+ * @param section a section element
6
+ * @returns an object containing as key the section element name and as value the default HVal.
7
+ */
8
+ export declare const getSectionDefault: (section: UiElementData) => {
9
+ [key: string]: HVal;
10
+ };
11
+ /**
12
+ * Get a default for a specific kind of HVal.
13
+ * @param kind can be expressed as new or old Hayson, or alternatively the haystack-core type name
14
+ * @returns
15
+ */
16
+ export declare const getDefaultHVal: (kind?: string) => HVal | undefined;
@@ -1,100 +1,100 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2023, J2 Innovations. All Rights Reserved
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getDefaultHVal = exports.getSectionDefault = void 0;
7
- const haystack_core_1 = require("haystack-core");
8
- /**
9
- * Get default values for all elements that should resolve into an HVal.
10
- * @param section a section element
11
- * @returns an object containing as key the section element name and as value the default HVal.
12
- */
13
- const getSectionDefault = (section) => {
14
- const result = {};
15
- Object.entries(section).forEach(([key, element]) => {
16
- const elementData = element;
17
- const defaultValue = (0, exports.getDefaultHVal)(elementData?._meta?.resolvedType);
18
- if (defaultValue) {
19
- result[key] = defaultValue;
20
- }
21
- });
22
- return result;
23
- };
24
- exports.getSectionDefault = getSectionDefault;
25
- /**
26
- * Get a default for a specific kind of HVal.
27
- * @param kind can be expressed as new or old Hayson, or alternatively the haystack-core type name
28
- * @returns
29
- */
30
- const getDefaultHVal = (kind) => {
31
- switch (kind) {
32
- case haystack_core_1.Kind.Marker:
33
- case 'Marker':
34
- case 'HMarker':
35
- return haystack_core_1.HMarker.make();
36
- case haystack_core_1.Kind.Remove:
37
- case 'Remove':
38
- case 'HRemove':
39
- return haystack_core_1.HRemove.make();
40
- case haystack_core_1.Kind.NA:
41
- case 'NA':
42
- case 'HNa':
43
- return haystack_core_1.HNa.make();
44
- case haystack_core_1.Kind.Coord:
45
- case 'Coord':
46
- case 'HCoord':
47
- return haystack_core_1.HCoord.make({ latitude: 0, longitude: 0 });
48
- case haystack_core_1.Kind.XStr:
49
- case 'XStr':
50
- case 'HXStr':
51
- return haystack_core_1.HXStr.make('');
52
- case haystack_core_1.Kind.Date:
53
- case 'Date':
54
- case 'HDate':
55
- return haystack_core_1.HDate.make(new Date());
56
- case haystack_core_1.Kind.DateTime:
57
- case 'DateTime':
58
- case 'HDateTime':
59
- return haystack_core_1.HDateTime.make(new Date());
60
- case haystack_core_1.Kind.Number:
61
- case 'Number':
62
- case 'HNum':
63
- return haystack_core_1.HNum.make(0);
64
- case haystack_core_1.Kind.Bool:
65
- case 'Bool':
66
- case 'HBool':
67
- return haystack_core_1.HBool.make(false);
68
- case 'Str':
69
- case 'HStr':
70
- return haystack_core_1.HStr.make('');
71
- case haystack_core_1.Kind.Ref:
72
- case 'Ref':
73
- case 'HRef':
74
- return haystack_core_1.HRef.make('');
75
- case haystack_core_1.Kind.Symbol:
76
- case 'Symbol':
77
- case 'HSymbol':
78
- return haystack_core_1.HSymbol.make('');
79
- case haystack_core_1.Kind.Time:
80
- case 'Time':
81
- case 'HTime':
82
- return haystack_core_1.HTime.make(new Date());
83
- case haystack_core_1.Kind.Uri:
84
- case 'Uri':
85
- case 'HUri':
86
- return haystack_core_1.HUri.make('');
87
- case haystack_core_1.Kind.Dict:
88
- case 'Dict':
89
- case 'HDict':
90
- return haystack_core_1.HDict.make();
91
- case haystack_core_1.Kind.Grid:
92
- case 'Grid':
93
- case 'HGrid':
94
- return haystack_core_1.HGrid.make();
95
- default:
96
- return undefined;
97
- }
98
- };
99
- exports.getDefaultHVal = getDefaultHVal;
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2023, J2 Innovations. All Rights Reserved
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getDefaultHVal = exports.getSectionDefault = void 0;
7
+ const haystack_core_1 = require("haystack-core");
8
+ /**
9
+ * Get default values for all elements that should resolve into an HVal.
10
+ * @param section a section element
11
+ * @returns an object containing as key the section element name and as value the default HVal.
12
+ */
13
+ const getSectionDefault = (section) => {
14
+ const result = {};
15
+ Object.entries(section).forEach(([key, element]) => {
16
+ const elementData = element;
17
+ const defaultValue = (0, exports.getDefaultHVal)(elementData?._meta?.resolvedType);
18
+ if (defaultValue) {
19
+ result[key] = defaultValue;
20
+ }
21
+ });
22
+ return result;
23
+ };
24
+ exports.getSectionDefault = getSectionDefault;
25
+ /**
26
+ * Get a default for a specific kind of HVal.
27
+ * @param kind can be expressed as new or old Hayson, or alternatively the haystack-core type name
28
+ * @returns
29
+ */
30
+ const getDefaultHVal = (kind) => {
31
+ switch (kind) {
32
+ case haystack_core_1.Kind.Marker:
33
+ case 'Marker':
34
+ case 'HMarker':
35
+ return haystack_core_1.HMarker.make();
36
+ case haystack_core_1.Kind.Remove:
37
+ case 'Remove':
38
+ case 'HRemove':
39
+ return haystack_core_1.HRemove.make();
40
+ case haystack_core_1.Kind.NA:
41
+ case 'NA':
42
+ case 'HNa':
43
+ return haystack_core_1.HNa.make();
44
+ case haystack_core_1.Kind.Coord:
45
+ case 'Coord':
46
+ case 'HCoord':
47
+ return haystack_core_1.HCoord.make({ latitude: 0, longitude: 0 });
48
+ case haystack_core_1.Kind.XStr:
49
+ case 'XStr':
50
+ case 'HXStr':
51
+ return haystack_core_1.HXStr.make('');
52
+ case haystack_core_1.Kind.Date:
53
+ case 'Date':
54
+ case 'HDate':
55
+ return haystack_core_1.HDate.make(new Date());
56
+ case haystack_core_1.Kind.DateTime:
57
+ case 'DateTime':
58
+ case 'HDateTime':
59
+ return haystack_core_1.HDateTime.make(new Date());
60
+ case haystack_core_1.Kind.Number:
61
+ case 'Number':
62
+ case 'HNum':
63
+ return haystack_core_1.HNum.make(0);
64
+ case haystack_core_1.Kind.Bool:
65
+ case 'Bool':
66
+ case 'HBool':
67
+ return haystack_core_1.HBool.make(false);
68
+ case 'Str':
69
+ case 'HStr':
70
+ return haystack_core_1.HStr.make('');
71
+ case haystack_core_1.Kind.Ref:
72
+ case 'Ref':
73
+ case 'HRef':
74
+ return haystack_core_1.HRef.make('');
75
+ case haystack_core_1.Kind.Symbol:
76
+ case 'Symbol':
77
+ case 'HSymbol':
78
+ return haystack_core_1.HSymbol.make('');
79
+ case haystack_core_1.Kind.Time:
80
+ case 'Time':
81
+ case 'HTime':
82
+ return haystack_core_1.HTime.make(new Date());
83
+ case haystack_core_1.Kind.Uri:
84
+ case 'Uri':
85
+ case 'HUri':
86
+ return haystack_core_1.HUri.make('');
87
+ case haystack_core_1.Kind.Dict:
88
+ case 'Dict':
89
+ case 'HDict':
90
+ return haystack_core_1.HDict.make();
91
+ case haystack_core_1.Kind.Grid:
92
+ case 'Grid':
93
+ case 'HGrid':
94
+ return haystack_core_1.HGrid.make();
95
+ default:
96
+ return undefined;
97
+ }
98
+ };
99
+ exports.getDefaultHVal = getDefaultHVal;
100
100
  //# sourceMappingURL=getSectionDefault.js.map
@@ -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,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useFin5BinUrl = void 0;
4
- const haystack_react_1 = require("haystack-react");
5
- const react_1 = require("react");
6
- const getFin5BinUrl_1 = require("../../fin5Top/getFin5BinUrl");
7
- /**
8
- * Retrieves the url of a Fin 5 bin based on the file record id, or undefined if the url couldn't be retrieved.
9
- * Uses haystack-nclient to retrieve the projectName from context.
10
- */
11
- const useFin5BinUrl = (fileId) => {
12
- const projectName = (0, haystack_react_1.useClient)().project;
13
- return (0, react_1.useMemo)(() => (fileId ? (0, getFin5BinUrl_1.getFin5BinUrl)(fileId, projectName) : undefined), [fileId, projectName]);
14
- };
15
- exports.useFin5BinUrl = useFin5BinUrl;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useFin5BinUrl = void 0;
4
+ const haystack_react_1 = require("haystack-react");
5
+ const react_1 = require("react");
6
+ const getFin5BinUrl_1 = require("../../fin5Top/getFin5BinUrl");
7
+ /**
8
+ * Retrieves the url of a Fin 5 bin based on the file record id, or undefined if the url couldn't be retrieved.
9
+ * Uses haystack-nclient to retrieve the projectName from context.
10
+ */
11
+ const useFin5BinUrl = (fileId) => {
12
+ const projectName = (0, haystack_react_1.useClient)().project;
13
+ return (0, react_1.useMemo)(() => (fileId ? (0, getFin5BinUrl_1.getFin5BinUrl)(fileId, projectName) : undefined), [fileId, projectName]);
14
+ };
15
+ exports.useFin5BinUrl = useFin5BinUrl;
16
16
  //# 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,57 +1,57 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2025, J2 Innovations. All Rights Reserved
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useFin5ColorScheme = void 0;
7
- const ui_1 = require("@j2inn/ui");
8
- const react_jss_1 = require("react-jss");
9
- const fin5Top_1 = require("../../fin5Top/fin5Top");
10
- const react_1 = require("react");
11
- function useFin5ColorScheme() {
12
- const theme = (0, react_jss_1.useTheme)();
13
- const fin5 = (0, fin5Top_1.getFin5top)();
14
- const colorScheme = fin5?.app.GetColorScheme?.();
15
- const currentTheme = fin5?.app.get('currentTheme');
16
- const isDarkMode = currentTheme === 'dark';
17
- const brandedTheme = (0, react_1.useMemo)(() => {
18
- if (!colorScheme) {
19
- return undefined;
20
- }
21
- return (0, ui_1.GenerateTheme)({
22
- light: {
23
- ...ui_1.DEFAULT_THEME.light,
24
- bodyBg: colorScheme.bodyBackground,
25
- bgColor: (0, ui_1.lighten)(colorScheme.bodyBackground, 5),
26
- },
27
- dark: {
28
- ...ui_1.DEFAULT_THEME.dark,
29
- textColor: (0, ui_1.tint)(colorScheme.bodyBackground, 100),
30
- popupBgColor: colorScheme.bodyBackground,
31
- bodyBg: colorScheme.bodyBackground,
32
- bgColor: (0, ui_1.lighten)(colorScheme.bodyBackground, 5),
33
- },
34
- palette: {
35
- ...ui_1.DEFAULT_THEME.palette,
36
- primary: colorScheme.primary,
37
- secondary: (0, ui_1.tint)(colorScheme.primary, 20),
38
- accent: (0, ui_1.shade)(colorScheme.primary, 20),
39
- },
40
- });
41
- }, [
42
- colorScheme?.primary,
43
- colorScheme?.bodyBackground,
44
- colorScheme?.sidebarBackground,
45
- ]);
46
- if (!brandedTheme) {
47
- return theme;
48
- }
49
- if (isDarkMode) {
50
- return brandedTheme.dark;
51
- }
52
- else {
53
- return brandedTheme.light;
54
- }
55
- }
56
- exports.useFin5ColorScheme = useFin5ColorScheme;
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025, J2 Innovations. All Rights Reserved
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useFin5ColorScheme = void 0;
7
+ const ui_1 = require("@j2inn/ui");
8
+ const react_jss_1 = require("react-jss");
9
+ const fin5Top_1 = require("../../fin5Top/fin5Top");
10
+ const react_1 = require("react");
11
+ function useFin5ColorScheme() {
12
+ const theme = (0, react_jss_1.useTheme)();
13
+ const fin5 = (0, fin5Top_1.getFin5top)();
14
+ const colorScheme = fin5?.app.GetColorScheme?.();
15
+ const currentTheme = fin5?.app.get('currentTheme');
16
+ const isDarkMode = currentTheme === 'dark';
17
+ const brandedTheme = (0, react_1.useMemo)(() => {
18
+ if (!colorScheme) {
19
+ return undefined;
20
+ }
21
+ return (0, ui_1.GenerateTheme)({
22
+ light: {
23
+ ...ui_1.DEFAULT_THEME.light,
24
+ bodyBg: colorScheme.bodyBackground,
25
+ bgColor: (0, ui_1.lighten)(colorScheme.bodyBackground, 5),
26
+ },
27
+ dark: {
28
+ ...ui_1.DEFAULT_THEME.dark,
29
+ textColor: (0, ui_1.tint)(colorScheme.bodyBackground, 100),
30
+ popupBgColor: colorScheme.bodyBackground,
31
+ bodyBg: colorScheme.bodyBackground,
32
+ bgColor: (0, ui_1.lighten)(colorScheme.bodyBackground, 5),
33
+ },
34
+ palette: {
35
+ ...ui_1.DEFAULT_THEME.palette,
36
+ primary: colorScheme.primary,
37
+ secondary: (0, ui_1.tint)(colorScheme.primary, 20),
38
+ accent: (0, ui_1.shade)(colorScheme.primary, 20),
39
+ },
40
+ });
41
+ }, [
42
+ colorScheme?.primary,
43
+ colorScheme?.bodyBackground,
44
+ colorScheme?.sidebarBackground,
45
+ ]);
46
+ if (!brandedTheme) {
47
+ return theme;
48
+ }
49
+ if (isDarkMode) {
50
+ return brandedTheme.dark;
51
+ }
52
+ else {
53
+ return brandedTheme.light;
54
+ }
55
+ }
56
+ exports.useFin5ColorScheme = useFin5ColorScheme;
57
57
  //# sourceMappingURL=useFin5ColorScheme.js.map
@@ -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,32 +1,32 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2025, J2 Innovations. All Rights Reserved
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useScreenSize = void 0;
7
- const react_1 = require("react");
8
- /**
9
- * Observe screen size.
10
- */
11
- const useScreenSize = () => {
12
- const [screenSize, setScreenSize] = (0, react_1.useState)({
13
- width: window.innerWidth,
14
- height: window.innerHeight,
15
- });
16
- (0, react_1.useEffect)(() => {
17
- const handleResize = () => {
18
- setScreenSize({
19
- width: window.innerWidth,
20
- height: window.innerHeight,
21
- });
22
- };
23
- window.addEventListener('resize', handleResize);
24
- // Clean up the event listener when the component unmounts
25
- return () => {
26
- window.removeEventListener('resize', handleResize);
27
- };
28
- }, []);
29
- return screenSize;
30
- };
31
- exports.useScreenSize = useScreenSize;
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025, J2 Innovations. All Rights Reserved
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useScreenSize = void 0;
7
+ const react_1 = require("react");
8
+ /**
9
+ * Observe screen size.
10
+ */
11
+ const useScreenSize = () => {
12
+ const [screenSize, setScreenSize] = (0, react_1.useState)({
13
+ width: window.innerWidth,
14
+ height: window.innerHeight,
15
+ });
16
+ (0, react_1.useEffect)(() => {
17
+ const handleResize = () => {
18
+ setScreenSize({
19
+ width: window.innerWidth,
20
+ height: window.innerHeight,
21
+ });
22
+ };
23
+ window.addEventListener('resize', handleResize);
24
+ // Clean up the event listener when the component unmounts
25
+ return () => {
26
+ window.removeEventListener('resize', handleResize);
27
+ };
28
+ }, []);
29
+ return screenSize;
30
+ };
31
+ exports.useScreenSize = useScreenSize;
32
32
  //# sourceMappingURL=useScreenSize.js.map