@j2inn/fin5-ui-utils 6.0.5-beta.0 → 6.0.5

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 (212) 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 +16 -16
  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 -66
  14. package/dist/fantomProps/readFantomPropsFile.js.map +1 -1
  15. package/dist/fin5Top/fin5FileUpload.d.ts +24 -24
  16. package/dist/fin5Top/fin5FileUpload.js +51 -51
  17. package/dist/fin5Top/fin5Top.d.ts +124 -124
  18. package/dist/fin5Top/fin5Top.js +53 -53
  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 +102 -102
  35. package/dist/react/app/Fin5AppRootStore.d.ts +40 -40
  36. package/dist/react/app/Fin5AppRootStore.js +69 -69
  37. package/dist/react/components/ErrorBoundary.d.ts +57 -57
  38. package/dist/react/components/ErrorBoundary.js +150 -150
  39. package/dist/react/components/ErrorDisplayer.d.ts +19 -19
  40. package/dist/react/components/ErrorDisplayer.js +36 -36
  41. package/dist/react/components/Loader.d.ts +9 -9
  42. package/dist/react/components/Loader.js +17 -17
  43. package/dist/react/components/LoadingSpinner.d.ts +2 -2
  44. package/dist/react/components/LoadingSpinner.js +27 -27
  45. package/dist/react/components/RecordImage.d.ts +20 -20
  46. package/dist/react/components/RecordImage.js +51 -51
  47. package/dist/react/components/charts/QRCode.d.ts +25 -25
  48. package/dist/react/components/charts/QRCode.js +82 -82
  49. package/dist/react/components/charts/line-bar/Chart.d.ts +166 -166
  50. package/dist/react/components/charts/line-bar/Chart.js +442 -442
  51. package/dist/react/components/charts/line-bar/HGridChart.d.ts +58 -58
  52. package/dist/react/components/charts/line-bar/HGridChart.js +285 -285
  53. package/dist/react/components/charts/pie/PieChart.d.ts +94 -94
  54. package/dist/react/components/charts/pie/PieChart.js +204 -204
  55. package/dist/react/components/charts/pie/SimplePieChart.d.ts +21 -21
  56. package/dist/react/components/charts/pie/SimplePieChart.js +55 -55
  57. package/dist/react/components/graphics/GraphicViewer.d.ts +10 -10
  58. package/dist/react/components/graphics/GraphicViewer.js +29 -29
  59. package/dist/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
  60. package/dist/react/components/graphics/GraphicsTabViewer.js +90 -90
  61. package/dist/react/components/makeCustomElement.d.ts +16 -16
  62. package/dist/react/components/makeCustomElement.js +150 -150
  63. package/dist/react/components/navigation/BasicLayout.d.ts +41 -41
  64. package/dist/react/components/navigation/BasicLayout.js +155 -155
  65. package/dist/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
  66. package/dist/react/components/navigation/HeaderSiderLayout.js +110 -110
  67. package/dist/react/components/navigation/MenuPage.d.ts +37 -37
  68. package/dist/react/components/navigation/MenuPage.js +36 -36
  69. package/dist/react/components/navigation/MenuTrigger.d.ts +9 -9
  70. package/dist/react/components/navigation/MenuTrigger.js +33 -33
  71. package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
  72. package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.js +25 -25
  73. package/dist/react/components/navigation/ReactRouterLayout.d.ts +46 -46
  74. package/dist/react/components/navigation/ReactRouterLayout.js +132 -132
  75. package/dist/react/components/navigation/customRouting/Router.d.ts +12 -12
  76. package/dist/react/components/navigation/customRouting/Router.js +45 -45
  77. package/dist/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
  78. package/dist/react/components/navigation/customRouting/RouterLayout.js +61 -61
  79. package/dist/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +27 -27
  80. package/dist/react/components/resolvable/configurationForm/ConfigurationForm.js +95 -95
  81. package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +16 -16
  82. package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +88 -88
  83. package/dist/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
  84. package/dist/react/components/resolvable/configurationForm/getSectionDefault.js +99 -99
  85. package/dist/react/hooks/useFin5BinUrl.d.ts +6 -6
  86. package/dist/react/hooks/useFin5BinUrl.js +15 -15
  87. package/dist/react/hooks/useFin5ColorScheme.d.ts +2 -2
  88. package/dist/react/hooks/useFin5ColorScheme.js +49 -49
  89. package/dist/react/hooks/useScreenSize.d.ts +7 -7
  90. package/dist/react/hooks/useScreenSize.js +31 -31
  91. package/dist_es/fantomProps/createFin5Props/index.d.ts +12 -12
  92. package/dist_es/fantomProps/createFin5Props/index.js +140 -140
  93. package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
  94. package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.js +11 -11
  95. package/dist_es/fantomProps/fantomPropsToObject.d.ts +8 -8
  96. package/dist_es/fantomProps/fantomPropsToObject.js +178 -178
  97. package/dist_es/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
  98. package/dist_es/fantomProps/generateJsonFromFantomPropsFile.js +12 -12
  99. package/dist_es/fantomProps/localePropsToJson.d.ts +1 -1
  100. package/dist_es/fantomProps/localePropsToJson.js +21 -21
  101. package/dist_es/fantomProps/readFantomPropsFile.d.ts +5 -5
  102. package/dist_es/fantomProps/readFantomPropsFile.js +39 -40
  103. package/dist_es/fantomProps/readFantomPropsFile.js.map +1 -1
  104. package/dist_es/fin5Top/fin5FileUpload.d.ts +24 -24
  105. package/dist_es/fin5Top/fin5FileUpload.js +47 -47
  106. package/dist_es/fin5Top/fin5Top.d.ts +124 -124
  107. package/dist_es/fin5Top/fin5Top.js +49 -49
  108. package/dist_es/fin5Top/finEdge2Cloud.d.ts +6 -6
  109. package/dist_es/fin5Top/finEdge2Cloud.js +11 -11
  110. package/dist_es/fin5Top/getFin5BinUrl.d.ts +2 -2
  111. package/dist_es/fin5Top/getFin5BinUrl.js +5 -5
  112. package/dist_es/fin5Top/openFin5Alarm.d.ts +22 -22
  113. package/dist_es/fin5Top/openFin5Alarm.js +19 -19
  114. package/dist_es/fin5Top/openFin5Historian.d.ts +3 -3
  115. package/dist_es/fin5Top/openFin5Historian.js +15 -15
  116. package/dist_es/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
  117. package/dist_es/fin5Top/useFin5AppURLHashParameter.js +124 -124
  118. package/dist_es/index.d.ts +35 -35
  119. package/dist_es/index.js +53 -53
  120. package/dist_es/jobs/jobUtils.d.ts +14 -14
  121. package/dist_es/jobs/jobUtils.js +9 -9
  122. package/dist_es/react/app/Fin5AppContainer.d.ts +36 -36
  123. package/dist_es/react/app/Fin5AppContainer.js +73 -73
  124. package/dist_es/react/app/Fin5AppRootStore.d.ts +40 -40
  125. package/dist_es/react/app/Fin5AppRootStore.js +65 -65
  126. package/dist_es/react/components/ErrorBoundary.d.ts +57 -57
  127. package/dist_es/react/components/ErrorBoundary.js +123 -123
  128. package/dist_es/react/components/ErrorDisplayer.d.ts +19 -19
  129. package/dist_es/react/components/ErrorDisplayer.js +28 -28
  130. package/dist_es/react/components/Loader.d.ts +9 -9
  131. package/dist_es/react/components/Loader.js +12 -12
  132. package/dist_es/react/components/LoadingSpinner.d.ts +2 -2
  133. package/dist_es/react/components/LoadingSpinner.js +20 -20
  134. package/dist_es/react/components/RecordImage.d.ts +20 -20
  135. package/dist_es/react/components/RecordImage.js +24 -24
  136. package/dist_es/react/components/charts/QRCode.d.ts +25 -25
  137. package/dist_es/react/components/charts/QRCode.js +52 -52
  138. package/dist_es/react/components/charts/line-bar/Chart.d.ts +166 -166
  139. package/dist_es/react/components/charts/line-bar/Chart.js +415 -415
  140. package/dist_es/react/components/charts/line-bar/HGridChart.d.ts +58 -58
  141. package/dist_es/react/components/charts/line-bar/HGridChart.js +250 -250
  142. package/dist_es/react/components/charts/pie/PieChart.d.ts +94 -94
  143. package/dist_es/react/components/charts/pie/PieChart.js +177 -177
  144. package/dist_es/react/components/charts/pie/SimplePieChart.d.ts +21 -21
  145. package/dist_es/react/components/charts/pie/SimplePieChart.js +25 -25
  146. package/dist_es/react/components/graphics/GraphicViewer.d.ts +10 -10
  147. package/dist_es/react/components/graphics/GraphicViewer.js +22 -22
  148. package/dist_es/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
  149. package/dist_es/react/components/graphics/GraphicsTabViewer.js +60 -60
  150. package/dist_es/react/components/makeCustomElement.d.ts +16 -16
  151. package/dist_es/react/components/makeCustomElement.js +142 -142
  152. package/dist_es/react/components/navigation/BasicLayout.d.ts +41 -41
  153. package/dist_es/react/components/navigation/BasicLayout.js +124 -124
  154. package/dist_es/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
  155. package/dist_es/react/components/navigation/HeaderSiderLayout.js +80 -80
  156. package/dist_es/react/components/navigation/MenuPage.d.ts +37 -37
  157. package/dist_es/react/components/navigation/MenuPage.js +30 -30
  158. package/dist_es/react/components/navigation/MenuTrigger.d.ts +9 -9
  159. package/dist_es/react/components/navigation/MenuTrigger.js +28 -28
  160. package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
  161. package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js +18 -18
  162. package/dist_es/react/components/navigation/ReactRouterLayout.d.ts +46 -46
  163. package/dist_es/react/components/navigation/ReactRouterLayout.js +99 -99
  164. package/dist_es/react/components/navigation/customRouting/Router.d.ts +12 -12
  165. package/dist_es/react/components/navigation/customRouting/Router.js +18 -18
  166. package/dist_es/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
  167. package/dist_es/react/components/navigation/customRouting/RouterLayout.js +34 -34
  168. package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +27 -27
  169. package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.js +64 -64
  170. package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +16 -16
  171. package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +58 -58
  172. package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
  173. package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.js +94 -94
  174. package/dist_es/react/hooks/useFin5BinUrl.d.ts +6 -6
  175. package/dist_es/react/hooks/useFin5BinUrl.js +11 -11
  176. package/dist_es/react/hooks/useFin5ColorScheme.d.ts +2 -2
  177. package/dist_es/react/hooks/useFin5ColorScheme.js +45 -45
  178. package/dist_es/react/hooks/useScreenSize.d.ts +7 -7
  179. package/dist_es/react/hooks/useScreenSize.js +27 -27
  180. package/package.json +1 -1
  181. package/dist_es/react/app/Fin5AppContainer.jsx +0 -82
  182. package/dist_es/react/app/Fin5AppContainer.jsx.map +0 -1
  183. package/dist_es/react/components/ErrorBoundary.jsx +0 -150
  184. package/dist_es/react/components/ErrorBoundary.jsx.map +0 -1
  185. package/dist_es/react/components/ErrorDisplayer.jsx +0 -36
  186. package/dist_es/react/components/ErrorDisplayer.jsx.map +0 -1
  187. package/dist_es/react/components/Loader.jsx +0 -13
  188. package/dist_es/react/components/Loader.jsx.map +0 -1
  189. package/dist_es/react/components/LoadingSpinner.jsx +0 -22
  190. package/dist_es/react/components/LoadingSpinner.jsx.map +0 -1
  191. package/dist_es/react/components/charts/line-bar/ZincGridChart.d.ts +0 -12
  192. package/dist_es/react/components/charts/line-bar/ZincGridChart.js +0 -17
  193. package/dist_es/react/components/charts/line-bar/ZincGridChart.js.map +0 -1
  194. package/dist_es/react/components/graphics/GraphicViewer.jsx +0 -23
  195. package/dist_es/react/components/graphics/GraphicViewer.jsx.map +0 -1
  196. package/dist_es/react/components/graphics/GraphicsTabViewer.jsx +0 -63
  197. package/dist_es/react/components/graphics/GraphicsTabViewer.jsx.map +0 -1
  198. package/dist_es/react/components/navigation/BasicLayout.jsx +0 -133
  199. package/dist_es/react/components/navigation/BasicLayout.jsx.map +0 -1
  200. package/dist_es/react/components/navigation/MenuPage.jsx +0 -31
  201. package/dist_es/react/components/navigation/MenuPage.jsx.map +0 -1
  202. package/dist_es/react/components/navigation/Router.d.ts +0 -12
  203. package/dist_es/react/components/navigation/Router.js +0 -19
  204. package/dist_es/react/components/navigation/Router.js.map +0 -1
  205. package/dist_es/react/components/navigation/Router.jsx +0 -19
  206. package/dist_es/react/components/navigation/Router.jsx.map +0 -1
  207. package/dist_es/react/components/navigation/react-router/BasicLayout.d.ts +0 -23
  208. package/dist_es/react/components/navigation/react-router/BasicLayout.js +0 -82
  209. package/dist_es/react/components/navigation/react-router/BasicLayout.js.map +0 -1
  210. package/dist_es/react/components/navigation/react-router/ReactRouterBasicLayout.d.ts +0 -24
  211. package/dist_es/react/components/navigation/react-router/ReactRouterBasicLayout.js +0 -82
  212. package/dist_es/react/components/navigation/react-router/ReactRouterBasicLayout.js.map +0 -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,50 +1,50 @@
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 colorScheme = (0, fin5Top_1.getFin5top)()?.app.GetColorScheme?.();
14
- const brandedTheme = (0, react_1.useMemo)(() => {
15
- if (!colorScheme) {
16
- return undefined;
17
- }
18
- return (0, ui_1.GenerateTheme)({
19
- light: {
20
- ...ui_1.DEFAULT_THEME.light,
21
- bodyBg: colorScheme.bodyBackground,
22
- bgColor: (0, ui_1.lighten)(colorScheme.bodyBackground, 5),
23
- },
24
- dark: {
25
- ...ui_1.DEFAULT_THEME.dark,
26
- bodyBg: colorScheme.bodyBackground,
27
- bgColor: (0, ui_1.lighten)(colorScheme.bodyBackground, 5),
28
- },
29
- palette: {
30
- ...ui_1.DEFAULT_THEME.palette,
31
- primary: colorScheme.primary,
32
- secondary: (0, ui_1.tint)(colorScheme.primary, 20),
33
- accent: (0, ui_1.shade)(colorScheme.primary, 20),
34
- },
35
- });
36
- }, [
37
- colorScheme?.primary,
38
- colorScheme?.bodyBackground,
39
- colorScheme?.sidebarBackground,
40
- ]);
41
- if (brandedTheme && theme.type === 'light') {
42
- return brandedTheme.light;
43
- }
44
- if (brandedTheme && theme.type === 'dark') {
45
- return brandedTheme.dark;
46
- }
47
- return theme;
48
- }
49
- 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 colorScheme = (0, fin5Top_1.getFin5top)()?.app.GetColorScheme?.();
14
+ const brandedTheme = (0, react_1.useMemo)(() => {
15
+ if (!colorScheme) {
16
+ return undefined;
17
+ }
18
+ return (0, ui_1.GenerateTheme)({
19
+ light: {
20
+ ...ui_1.DEFAULT_THEME.light,
21
+ bodyBg: colorScheme.bodyBackground,
22
+ bgColor: (0, ui_1.lighten)(colorScheme.bodyBackground, 5),
23
+ },
24
+ dark: {
25
+ ...ui_1.DEFAULT_THEME.dark,
26
+ bodyBg: colorScheme.bodyBackground,
27
+ bgColor: (0, ui_1.lighten)(colorScheme.bodyBackground, 5),
28
+ },
29
+ palette: {
30
+ ...ui_1.DEFAULT_THEME.palette,
31
+ primary: colorScheme.primary,
32
+ secondary: (0, ui_1.tint)(colorScheme.primary, 20),
33
+ accent: (0, ui_1.shade)(colorScheme.primary, 20),
34
+ },
35
+ });
36
+ }, [
37
+ colorScheme?.primary,
38
+ colorScheme?.bodyBackground,
39
+ colorScheme?.sidebarBackground,
40
+ ]);
41
+ if (brandedTheme && theme.type === 'light') {
42
+ return brandedTheme.light;
43
+ }
44
+ if (brandedTheme && theme.type === 'dark') {
45
+ return brandedTheme.dark;
46
+ }
47
+ return theme;
48
+ }
49
+ exports.useFin5ColorScheme = useFin5ColorScheme;
50
50
  //# 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