@resistdesign/voltra 0.0.0-alpha.0 → 1.2.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.
Files changed (287) hide show
  1. package/.releaserc +3 -0
  2. package/README.md +4 -51
  3. package/api/ORM/CriteriaUtils/CriteriaUtils.d.ts +7 -0
  4. package/api/ORM/CriteriaUtils/CriteriaUtils.js +140 -0
  5. package/api/ORM/CriteriaUtils/CriterionDriverResolutionTools.d.ts +4 -0
  6. package/api/ORM/CriteriaUtils/CriterionDriverResolutionTools.js +23 -0
  7. package/api/ORM/CriteriaUtils/index.d.ts +2 -0
  8. package/api/ORM/CriteriaUtils/index.js +18 -0
  9. package/api/ORM/DataContextService.d.ts +68 -0
  10. package/api/ORM/DataContextService.js +352 -0
  11. package/api/ORM/SearchCriteriaTypes.d.ts +83 -0
  12. package/api/ORM/SearchCriteriaTypes.js +47 -0
  13. package/api/ORM/ServiceTypes/DBServiceTypes.d.ts +30 -0
  14. package/api/ORM/ServiceTypes/FileServiceTypes.d.ts +25 -0
  15. package/api/ORM/ServiceTypes/index.d.ts +2 -0
  16. package/api/ORM/ServiceTypes/index.js +18 -0
  17. package/api/ORM/TypeStructureUtils.d.ts +17 -0
  18. package/api/ORM/TypeStructureUtils.js +120 -0
  19. package/api/ORM/drivers/db/DynamoDBServiceItem.d.ts +19 -0
  20. package/api/ORM/drivers/db/DynamoDBServiceItem.js +206 -0
  21. package/api/ORM/drivers/db/S3DBServiceItem.d.ts +17 -0
  22. package/api/ORM/drivers/db/S3DBServiceItem.js +118 -0
  23. package/api/ORM/drivers/db/index.d.ts +2 -0
  24. package/{src/api/ORM/drivers/common → api/ORM/drivers/db}/index.js +2 -2
  25. package/api/ORM/drivers/file/S3.d.ts +15 -0
  26. package/api/ORM/drivers/file/S3.js +97 -0
  27. package/api/ORM/drivers/file/index.d.ts +1 -0
  28. package/{src/common/TypeInfoORM → api/ORM/drivers/file}/index.js +1 -1
  29. package/api/ORM/drivers/index.d.ts +2 -0
  30. package/{src/common/ItemRelationships → api/ORM/drivers}/index.js +2 -1
  31. package/api/ORM/index.d.ts +6 -0
  32. package/api/ORM/index.js +32 -0
  33. package/{src/api → api}/Router/AWS.js +2 -8
  34. package/{src/api → api}/Router/CORS.d.ts +1 -1
  35. package/{src/api → api}/Router/CORS.js +10 -10
  36. package/{src/api → api}/Router/Types.d.ts +1 -1
  37. package/{src/api → api}/Router/index.js +18 -22
  38. package/api/index.d.ts +2 -0
  39. package/{src/api → api}/index.js +8 -19
  40. package/app/components/BaseForm.d.ts +9 -0
  41. package/app/components/BaseForm.js +37 -0
  42. package/app/components/FormGen/Application.d.ts +10 -0
  43. package/app/components/FormGen/Application.js +58 -0
  44. package/app/components/FormGen/Display.d.ts +13 -0
  45. package/app/components/FormGen/Display.js +69 -0
  46. package/app/components/FormGen/Editor.d.ts +12 -0
  47. package/app/components/FormGen/Editor.js +46 -0
  48. package/app/components/FormGen/Form.d.ts +5 -0
  49. package/app/components/FormGen/Form.js +25 -0
  50. package/app/components/FormGen/HelperTypes.d.ts +41 -0
  51. package/app/components/FormGen/HelperTypes.js +27 -0
  52. package/app/components/FormGen/IdUtils.d.ts +3 -0
  53. package/app/components/FormGen/IdUtils.js +22 -0
  54. package/app/components/FormGen/Input.d.ts +13 -0
  55. package/app/components/FormGen/Input.js +82 -0
  56. package/app/components/FormGen/Layout.d.ts +20 -0
  57. package/app/components/FormGen/Layout.js +107 -0
  58. package/app/components/FormGen/List.d.ts +12 -0
  59. package/app/components/FormGen/List.js +134 -0
  60. package/app/components/FormGen/Navigation.d.ts +27 -0
  61. package/app/components/FormGen/Navigation.js +82 -0
  62. package/app/components/FormGen/Storage/LocalJSON.d.ts +8 -0
  63. package/app/components/FormGen/Storage/LocalJSON.js +35 -0
  64. package/app/components/FormGen/Storage/index.d.ts +1 -0
  65. package/{src/common/Logging → app/components/FormGen/Storage}/index.js +1 -1
  66. package/app/components/FormGen/TypeStructureComponent.d.ts +20 -0
  67. package/app/components/FormGen/TypeStructureComponent.js +223 -0
  68. package/app/components/FormGen/ValueProcessing/HashMatrix.d.ts +50 -0
  69. package/app/components/FormGen/ValueProcessing/HashMatrix.js +268 -0
  70. package/app/components/FormGen/ValueProcessing/index.d.ts +1 -0
  71. package/{src/common/IdGeneration → app/components/FormGen/ValueProcessing}/index.js +1 -1
  72. package/app/components/FormGen/index.d.ts +13 -0
  73. package/app/components/FormGen/index.js +42 -0
  74. package/app/components/MaterialSymbol.d.ts +8 -0
  75. package/app/components/MaterialSymbol.js +22 -0
  76. package/app/components/Tabs.d.ts +9 -0
  77. package/app/components/Tabs.js +26 -0
  78. package/app/components/index.d.ts +4 -0
  79. package/{src/api/ORM → app/components}/index.js +12 -22
  80. package/app/index.d.ts +2 -0
  81. package/{src/app → app}/index.js +9 -18
  82. package/{src/app → app}/utils/ApplicationState.d.ts +1 -1
  83. package/{src/app → app}/utils/ApplicationState.js +3 -9
  84. package/{src/app → app}/utils/ApplicationStateLoader.js +13 -4
  85. package/{src/app → app}/utils/Controller.js +1 -4
  86. package/{src/app → app}/utils/Debug.d.ts +0 -3
  87. package/{src/app → app}/utils/Debug.js +1 -4
  88. package/{src/app → app}/utils/EasyLayout.d.ts +1 -1
  89. package/{src/app → app}/utils/EasyLayout.js +2 -5
  90. package/{src/app → app}/utils/Route.d.ts +1 -1
  91. package/{src/app → app}/utils/Route.js +4 -8
  92. package/{src/app → app}/utils/Service.js +14 -5
  93. package/{src/app → app}/utils/index.d.ts +0 -1
  94. package/{src/app → app}/utils/index.js +0 -1
  95. package/common/Routing.d.ts +20 -0
  96. package/{src/common → common}/Routing.js +10 -32
  97. package/common/TypeParsing/TypeParsing.d.ts +5 -0
  98. package/common/TypeParsing/TypeParsing.js +283 -0
  99. package/common/TypeParsing/TypeUtils.d.ts +86 -0
  100. package/common/TypeParsing/TypeUtils.js +281 -0
  101. package/common/TypeParsing/index.d.ts +2 -0
  102. package/{src/common/Testing → common/TypeParsing}/index.js +2 -2
  103. package/common/index.d.ts +2 -0
  104. package/common/index.js +28 -0
  105. package/{src/iac → iac}/SimpleCFT.d.ts +1 -21
  106. package/iac/SimpleCFT.js +67 -0
  107. package/{src/iac → iac}/index.js +7 -17
  108. package/iac/packs/abstract/user-management/UserPoolAliasTargetCustomResourceCode.d.ts +2 -0
  109. package/iac/packs/abstract/user-management/UserPoolAliasTargetCustomResourceCode.js +86 -0
  110. package/{src/iac/packs/auth → iac/packs/abstract}/user-management.js +88 -16
  111. package/{src/iac → iac}/packs/auth.js +1 -1
  112. package/{src/iac → iac}/packs/build/utils.d.ts +1 -1
  113. package/{src/iac → iac}/packs/build.d.ts +2 -7
  114. package/{src/iac → iac}/packs/cloud-function.d.ts +1 -2
  115. package/{src/iac → iac}/packs/cloud-function.js +1 -1
  116. package/iac/packs/database.d.ts +10 -0
  117. package/{src/iac → iac}/packs/database.js +1 -2
  118. package/iac/packs/dns.d.ts +11 -0
  119. package/iac/packs/dns.js +60 -0
  120. package/{src/iac → iac}/packs/gateway.d.ts +1 -2
  121. package/{src/iac → iac}/packs/gateway.js +8 -20
  122. package/{src/iac → iac}/types/CloudFormationResourceSpecification.d.ts +1 -1
  123. package/iac/types/CloudFormationResourceSpecification.js +196438 -0
  124. package/{src/iac → iac}/types/Renderers.js +1 -1
  125. package/{src/iac → iac}/types/Utils.js +2 -7
  126. package/{src/iac → iac}/types/generate.js +15 -5
  127. package/{src/iac → iac}/utils/index.d.ts +1 -4
  128. package/{src/iac → iac}/utils/index.js +10 -27
  129. package/{src/iac → iac}/utils/patch-utils.js +2 -8
  130. package/{src/index.d.ts → index.d.ts} +5 -5
  131. package/{src/index.js → index.js} +12 -22
  132. package/package.json +11 -69
  133. package/src/api/DataAccessControl.d.ts +0 -85
  134. package/src/api/DataAccessControl.js +0 -159
  135. package/src/api/ORM/DACUtils.d.ts +0 -60
  136. package/src/api/ORM/DACUtils.js +0 -197
  137. package/src/api/ORM/ListItemUtils.d.ts +0 -7
  138. package/src/api/ORM/ListItemUtils.js +0 -22
  139. package/src/api/ORM/ORMRouteMap.d.ts +0 -19
  140. package/src/api/ORM/ORMRouteMap.js +0 -82
  141. package/src/api/ORM/TypeInfoORMService.d.ts +0 -103
  142. package/src/api/ORM/TypeInfoORMService.js +0 -581
  143. package/src/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.d.ts +0 -63
  144. package/src/api/ORM/drivers/DynamoDBDataItemDBDriver.d.ts +0 -36
  145. package/src/api/ORM/drivers/DynamoDBDataItemDBDriver.js +0 -282
  146. package/src/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.d.ts +0 -90
  147. package/src/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.d.ts +0 -45
  148. package/src/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.js +0 -127
  149. package/src/api/ORM/drivers/S3FileItemDBDriver.d.ts +0 -44
  150. package/src/api/ORM/drivers/S3FileItemDBDriver.js +0 -182
  151. package/src/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.d.ts +0 -12
  152. package/src/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.js +0 -20
  153. package/src/api/ORM/drivers/common/Types.d.ts +0 -77
  154. package/src/api/ORM/drivers/common/Types.js +0 -14
  155. package/src/api/ORM/drivers/common/index.d.ts +0 -2
  156. package/src/api/ORM/drivers/index.d.ts +0 -3
  157. package/src/api/ORM/drivers/index.js +0 -19
  158. package/src/api/ORM/index.d.ts +0 -4
  159. package/src/api/index.d.ts +0 -3
  160. package/src/app/index.d.ts +0 -1
  161. package/src/app/utils/TypeInfoORMAPIUtils.d.ts +0 -20
  162. package/src/app/utils/TypeInfoORMAPIUtils.js +0 -62
  163. package/src/app/utils/TypeInfoORMClient.d.ts +0 -24
  164. package/src/app/utils/TypeInfoORMClient.js +0 -69
  165. package/src/common/CommandLine/collectRequiredEnvironmentVariables.d.ts +0 -1
  166. package/src/common/CommandLine/collectRequiredEnvironmentVariables.js +0 -16
  167. package/src/common/HelperTypes.d.ts +0 -3
  168. package/src/common/HelperTypes.js +0 -2
  169. package/src/common/IdGeneration/getSimpleId.d.ts +0 -4
  170. package/src/common/IdGeneration/getSimpleId.js +0 -16
  171. package/src/common/IdGeneration/index.d.ts +0 -1
  172. package/src/common/ItemRelationshipInfoTypes.d.ts +0 -46
  173. package/src/common/ItemRelationshipInfoTypes.js +0 -20
  174. package/src/common/ItemRelationships/ItemRelationshipValidation.d.ts +0 -10
  175. package/src/common/ItemRelationships/ItemRelationshipValidation.js +0 -43
  176. package/src/common/ItemRelationships/index.d.ts +0 -1
  177. package/src/common/Logging/Utils.d.ts +0 -10
  178. package/src/common/Logging/Utils.js +0 -33
  179. package/src/common/Logging/index.d.ts +0 -1
  180. package/src/common/Routing.d.ts +0 -25
  181. package/src/common/SearchTypes.d.ts +0 -98
  182. package/src/common/SearchTypes.js +0 -39
  183. package/src/common/SearchUtils.d.ts +0 -22
  184. package/src/common/SearchUtils.js +0 -134
  185. package/src/common/SearchValidation.d.ts +0 -17
  186. package/src/common/SearchValidation.js +0 -90
  187. package/src/common/Storyboarding/Types.d.ts +0 -25
  188. package/src/common/StringTransformers.d.ts +0 -17
  189. package/src/common/StringTransformers.js +0 -36
  190. package/src/common/Testing/CLI.d.ts +0 -2
  191. package/src/common/Testing/CLI.js +0 -56
  192. package/src/common/Testing/Types.d.ts +0 -117
  193. package/src/common/Testing/Types.js +0 -19
  194. package/src/common/Testing/Utils.d.ts +0 -48
  195. package/src/common/Testing/Utils.js +0 -334
  196. package/src/common/Testing/index.d.ts +0 -2
  197. package/src/common/TypeInfoDataItemUtils.d.ts +0 -10
  198. package/src/common/TypeInfoDataItemUtils.js +0 -55
  199. package/src/common/TypeInfoORM/Types.d.ts +0 -76
  200. package/src/common/TypeInfoORM/Types.js +0 -55
  201. package/src/common/TypeInfoORM/index.d.ts +0 -1
  202. package/src/common/TypeParsing/Constants.d.ts +0 -1
  203. package/src/common/TypeParsing/Constants.js +0 -4
  204. package/src/common/TypeParsing/ParsingUtils/Constants.d.ts +0 -5
  205. package/src/common/TypeParsing/ParsingUtils/Constants.js +0 -8
  206. package/src/common/TypeParsing/ParsingUtils/checkType.d.ts +0 -8
  207. package/src/common/TypeParsing/ParsingUtils/checkType.js +0 -46
  208. package/src/common/TypeParsing/ParsingUtils/checkUnionType.d.ts +0 -6
  209. package/src/common/TypeParsing/ParsingUtils/checkUnionType.js +0 -15
  210. package/src/common/TypeParsing/ParsingUtils/extractCommentTags.d.ts +0 -2
  211. package/src/common/TypeParsing/ParsingUtils/extractCommentTags.js +0 -105
  212. package/src/common/TypeParsing/ParsingUtils/extractLiteralValues.d.ts +0 -6
  213. package/src/common/TypeParsing/ParsingUtils/extractLiteralValues.js +0 -42
  214. package/src/common/TypeParsing/ParsingUtils/extractTypeDetails.d.ts +0 -8
  215. package/src/common/TypeParsing/ParsingUtils/extractTypeDetails.js +0 -14
  216. package/src/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.d.ts +0 -5
  217. package/src/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.js +0 -27
  218. package/src/common/TypeParsing/ParsingUtils/getTypeInfo.d.ts +0 -3
  219. package/src/common/TypeParsing/ParsingUtils/getTypeInfo.js +0 -27
  220. package/src/common/TypeParsing/ParsingUtils/getTypeInfoField.d.ts +0 -3
  221. package/src/common/TypeParsing/ParsingUtils/getTypeInfoField.js +0 -44
  222. package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.d.ts +0 -4
  223. package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.js +0 -28
  224. package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.d.ts +0 -4
  225. package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.js +0 -105
  226. package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.d.ts +0 -4
  227. package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.js +0 -20
  228. package/src/common/TypeParsing/ParsingUtils/getTypeKeyword.d.ts +0 -3
  229. package/src/common/TypeParsing/ParsingUtils/getTypeKeyword.js +0 -17
  230. package/src/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.d.ts +0 -4
  231. package/src/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.js +0 -49
  232. package/src/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.d.ts +0 -2
  233. package/src/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.js +0 -24
  234. package/src/common/TypeParsing/TypeInfo.d.ts +0 -142
  235. package/src/common/TypeParsing/TypeInfo.js +0 -13
  236. package/src/common/TypeParsing/TypeMapping.d.ts +0 -9
  237. package/src/common/TypeParsing/TypeMapping.js +0 -32
  238. package/src/common/TypeParsing/TypeParsing.d.ts +0 -5
  239. package/src/common/TypeParsing/TypeParsing.js +0 -39
  240. package/src/common/TypeParsing/Utils.d.ts +0 -21
  241. package/src/common/TypeParsing/Utils.js +0 -94
  242. package/src/common/TypeParsing/Validation.d.ts +0 -92
  243. package/src/common/TypeParsing/Validation.js +0 -340
  244. package/src/common/TypeParsing/index.d.ts +0 -5
  245. package/src/common/TypeParsing/index.js +0 -44
  246. package/src/common/index.d.ts +0 -11
  247. package/src/common/index.js +0 -47
  248. package/src/iac/SimpleCFT.js +0 -82
  249. package/src/iac/packs/database.d.ts +0 -29
  250. package/src/iac/packs/dns.d.ts +0 -13
  251. package/src/iac/packs/dns.js +0 -26
  252. package/src/iac/types/IaCTypes.d.ts +0 -234994
  253. package/src/iac/types/IaCTypes.js +0 -14
  254. package/src/iac/types/Types.js +0 -2
  255. /package/{src/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.js → api/ORM/ServiceTypes/DBServiceTypes.js} +0 -0
  256. /package/{src/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.js → api/ORM/ServiceTypes/FileServiceTypes.js} +0 -0
  257. /package/{src/api → api}/Router/AWS.d.ts +0 -0
  258. /package/{src/api → api}/Router/Auth.d.ts +0 -0
  259. /package/{src/api → api}/Router/Auth.js +0 -0
  260. /package/{src/api → api}/Router/Types.js +0 -0
  261. /package/{src/api → api}/Router/index.d.ts +0 -0
  262. /package/{src/app → app}/utils/ApplicationStateLoader.d.ts +0 -0
  263. /package/{src/app → app}/utils/Controller.d.ts +0 -0
  264. /package/{src/app → app}/utils/Service.d.ts +0 -0
  265. /package/{src/iac → iac}/index.d.ts +0 -0
  266. /package/{src/iac/packs/auth → iac/packs/abstract}/user-management.d.ts +0 -0
  267. /package/{src/iac → iac}/packs/auth.d.ts +0 -0
  268. /package/{src/iac → iac}/packs/build/utils.js +0 -0
  269. /package/{src/iac → iac}/packs/build.js +0 -0
  270. /package/{src/iac → iac}/packs/cdn.d.ts +0 -0
  271. /package/{src/iac → iac}/packs/cdn.js +0 -0
  272. /package/{src/iac → iac}/packs/file-storage.d.ts +0 -0
  273. /package/{src/iac → iac}/packs/file-storage.js +0 -0
  274. /package/{src/iac → iac}/packs/index.d.ts +0 -0
  275. /package/{src/iac → iac}/packs/index.js +0 -0
  276. /package/{src/iac → iac}/packs/repo.d.ts +0 -0
  277. /package/{src/iac → iac}/packs/repo.js +0 -0
  278. /package/{src/iac → iac}/packs/ssl-certificate.d.ts +0 -0
  279. /package/{src/iac → iac}/packs/ssl-certificate.js +0 -0
  280. /package/{src/iac → iac}/types/Constants.d.ts +0 -0
  281. /package/{src/iac → iac}/types/Constants.js +0 -0
  282. /package/{src/iac → iac}/types/Renderers.d.ts +0 -0
  283. /package/{src/iac → iac}/types/Types.d.ts +0 -0
  284. /package/{src/common/Storyboarding → iac/types}/Types.js +0 -0
  285. /package/{src/iac → iac}/types/Utils.d.ts +0 -0
  286. /package/{src/iac → iac}/types/generate.d.ts +0 -0
  287. /package/{src/iac → iac}/utils/patch-utils.d.ts +0 -0
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.TypeStructureComponent = void 0;
30
+ const jsx_runtime_1 = require("react/jsx-runtime");
31
+ const react_1 = require("react");
32
+ const TypeUtils_1 = require("../../../common/TypeParsing/TypeUtils");
33
+ const Input_1 = require("./Input");
34
+ const Form_1 = require("./Form");
35
+ const HashMatrix_1 = __importDefault(require("./ValueProcessing/HashMatrix"));
36
+ const Layout_1 = require("./Layout");
37
+ const styled_components_1 = __importStar(require("styled-components"));
38
+ const HelperTypes_1 = require("./HelperTypes");
39
+ const LayoutForm = (0, styled_components_1.default)(Form_1.Form) `
40
+ ${(p) => (0, Layout_1.getLayoutContainerCSS)(p)}
41
+ `;
42
+ const OpenFormButtonBase = styled_components_1.default.button `
43
+ ${(p) => p.$gridArea
44
+ ? (0, styled_components_1.css) `
45
+ grid-area: ${p.$gridArea};
46
+ `
47
+ : ""}
48
+ `;
49
+ const OpenFormButton = ({ disabled = false, name, label, onOpenForm, }) => {
50
+ const onOpenFormInternal = (0, react_1.useCallback)(() => {
51
+ onOpenForm(name);
52
+ }, [name, onOpenForm]);
53
+ return ((0, jsx_runtime_1.jsxs)(OpenFormButtonBase, { disabled: disabled, type: "button", "$gridArea": name, onClick: onOpenFormInternal, children: ["Edit ", label] }));
54
+ };
55
+ /**
56
+ * Automatically generate a complex, nested set of form views from a type structure map.
57
+ *
58
+ * @see {@link convertTypeScriptToTypeStructureMap}
59
+ * */
60
+ const TypeStructureComponent = ({ typeStructureMap, typeStructure, value, onChange, onNavigateToPath, onNavigateBack, navigationPathPrefix = [], topLevel = false, isEntryPoint = false, }) => {
61
+ const baseTypeStructure = (0, react_1.useMemo)(() => {
62
+ const { type: typeStructureType = "" } = typeStructure;
63
+ const topLevelTypeStructure = (0, TypeUtils_1.getTypeStructureByName)(typeStructureType, typeStructureMap);
64
+ return Object.assign(Object.assign({}, topLevelTypeStructure), typeStructure);
65
+ }, [typeStructureMap, typeStructure]);
66
+ const isForm = (0, react_1.useMemo)(() => {
67
+ const { content = [] } = baseTypeStructure;
68
+ return content.length > 0;
69
+ }, [baseTypeStructure]);
70
+ const cleanTypeStructure = (0, react_1.useMemo)(() => {
71
+ const { contentNames } = baseTypeStructure;
72
+ return (0, TypeUtils_1.getTypeStructureWithFilteredContent)(contentNames, baseTypeStructure);
73
+ }, [baseTypeStructure]);
74
+ const { name: typeStructureName = "", type: typeStructureType, content: typeStructureContent = [], readonly = false, } = cleanTypeStructure;
75
+ const { [TypeUtils_1.TAG_TYPES.label]: typeStructureLabel = undefined, [TypeUtils_1.TAG_TYPES.layout]: typeStructureLayout = undefined, [TypeUtils_1.TAG_TYPES.options]: typeStructureOptionsString = undefined, [TypeUtils_1.TAG_TYPES.optionsType]: typeStructureOptionsTypeName = undefined, [TypeUtils_1.TAG_TYPES.allowCustomValue]: typeStructureAllowCustomValue = undefined, } = (0, react_1.useMemo)(() => (0, TypeUtils_1.getTagValues)([
76
+ TypeUtils_1.TAG_TYPES.label,
77
+ TypeUtils_1.TAG_TYPES.inline,
78
+ TypeUtils_1.TAG_TYPES.layout,
79
+ TypeUtils_1.TAG_TYPES.options,
80
+ TypeUtils_1.TAG_TYPES.optionsType,
81
+ TypeUtils_1.TAG_TYPES.allowCustomValue,
82
+ ], cleanTypeStructure), [cleanTypeStructure]);
83
+ const typeStructureOptions = (0, react_1.useMemo)(() => {
84
+ if (typeof typeStructureOptionsString === "string") {
85
+ return (typeStructureOptionsString
86
+ .split("\n")
87
+ .map((l) => l.split(","))
88
+ // @ts-ignore
89
+ .flat()
90
+ .map((l) => l.trim()));
91
+ }
92
+ else {
93
+ return typeStructureOptionsTypeName &&
94
+ typeof typeStructureOptionsTypeName === "string"
95
+ ? (0, TypeUtils_1.getTypeStructureByName)(typeStructureOptionsTypeName, typeStructureMap)
96
+ : undefined;
97
+ }
98
+ }, [
99
+ typeStructureOptionsString,
100
+ typeStructureOptionsTypeName,
101
+ typeStructureMap,
102
+ ]);
103
+ const hasTypeStructureLayout = (0, react_1.useMemo)(() => typeof typeStructureLayout === "string", [typeStructureLayout]);
104
+ const [internalValueBase, setInternalValue] = (0, react_1.useState)(value);
105
+ const valueLastChanged = (0, react_1.useMemo)(() => new Date().getTime(), [value]);
106
+ const internalValueLastChanged = (0, react_1.useMemo)(() => new Date().getTime(), [internalValueBase]);
107
+ const internalValue = (0, react_1.useMemo)(() => valueLastChanged > internalValueLastChanged ? value : internalValueBase, [value, internalValueBase, valueLastChanged, internalValueLastChanged]);
108
+ const hasChanges = (0, react_1.useMemo)(() => internalValue !== value, [internalValue, value]);
109
+ const submissionTypeName = (0, react_1.useMemo)(() => {
110
+ return topLevel ? "" : typeStructureName;
111
+ }, [topLevel, typeStructureName]);
112
+ const onFormSubmit = (0, react_1.useCallback)(() => {
113
+ onChange(submissionTypeName, internalValue);
114
+ if (onNavigateBack) {
115
+ onNavigateBack();
116
+ }
117
+ }, [topLevel, submissionTypeName, internalValue, onNavigateBack]);
118
+ const onResetForm = (0, react_1.useCallback)(() => {
119
+ setInternalValue(value);
120
+ }, [value]);
121
+ const onCancelForm = (0, react_1.useCallback)(() => {
122
+ if (onNavigateBack) {
123
+ onNavigateBack();
124
+ }
125
+ }, [onNavigateBack]);
126
+ const onPrimitiveChangeInternal = (0, react_1.useCallback)((_n, v) => {
127
+ setInternalValue(v);
128
+ }, [setInternalValue]);
129
+ const onPropertyChange = (0, react_1.useCallback)((n, v) => {
130
+ const newValue = Object.assign(Object.assign({}, internalValue), { [n]: v });
131
+ setInternalValue(newValue);
132
+ if (!topLevel || isEntryPoint) {
133
+ onChange(submissionTypeName, newValue);
134
+ }
135
+ }, [
136
+ internalValue,
137
+ setInternalValue,
138
+ topLevel,
139
+ isEntryPoint,
140
+ onChange,
141
+ submissionTypeName,
142
+ ]);
143
+ const onNavigateToPathInternal = (0, react_1.useCallback)((path = []) => {
144
+ if (onNavigateToPath) {
145
+ const targetValue = new HashMatrix_1.default({
146
+ hashMatrix: internalValue,
147
+ }).getPath(path);
148
+ const targetTypeStructure = (0, TypeUtils_1.getTypeStructureByPath)(path, cleanTypeStructure, typeStructureMap);
149
+ const { multiple: ttsMultiple } = targetTypeStructure;
150
+ const targetLabel = (0, TypeUtils_1.getTagValue)(TypeUtils_1.TAG_TYPES.label, targetTypeStructure);
151
+ const cleanTargetLabel = typeof targetLabel === "string" ? targetLabel : "";
152
+ onNavigateToPath({
153
+ label: ttsMultiple
154
+ ? cleanTargetLabel
155
+ : (0, TypeUtils_1.getValueLabel)(targetValue, targetTypeStructure, typeStructureMap),
156
+ path: [...navigationPathPrefix, ...path],
157
+ });
158
+ }
159
+ }, [
160
+ onNavigateToPath,
161
+ navigationPathPrefix,
162
+ internalValue,
163
+ cleanTypeStructure,
164
+ typeStructureMap,
165
+ ]);
166
+ const onOpenForm = (0, react_1.useCallback)((name) => {
167
+ onNavigateToPathInternal([name]);
168
+ }, [onNavigateToPathInternal]);
169
+ const FormComp = topLevel ? LayoutForm : Layout_1.LayoutBox;
170
+ const formProps = (0, react_1.useMemo)(() => {
171
+ return Object.assign(Object.assign({}, (topLevel ? { onSubmit: onFormSubmit } : {})), { $gridArea: !topLevel ? typeStructureName : undefined });
172
+ }, [topLevel, onFormSubmit, topLevel, typeStructureName]);
173
+ const layoutBoxProps = (0, react_1.useMemo)(() => {
174
+ return {
175
+ $isGrid: hasTypeStructureLayout,
176
+ $gridTemplate: (0, Layout_1.getTypeStructureLayoutGridTemplate)(typeStructureLayout, topLevel),
177
+ };
178
+ }, [hasTypeStructureLayout, typeStructureLayout, topLevel]);
179
+ const controls = (0, react_1.useMemo)(() => {
180
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [topLevel && !isEntryPoint && hasChanges ? ((0, jsx_runtime_1.jsxs)(Layout_1.LayoutControls, { children: [(0, jsx_runtime_1.jsx)("button", { style: {
181
+ flex: "1 0 auto",
182
+ width: "auto",
183
+ }, type: "button", onClick: onCancelForm, children: "Cancel" }), (0, jsx_runtime_1.jsx)("button", { style: {
184
+ flex: "1 0 auto",
185
+ width: "auto",
186
+ }, type: "button", onClick: onResetForm, children: "Reset" }), (0, jsx_runtime_1.jsx)("button", { style: {
187
+ flex: "1 0 auto",
188
+ width: "auto",
189
+ }, type: "submit", children: "Submit" })] })) : undefined, topLevel && !isEntryPoint && !hasChanges ? ((0, jsx_runtime_1.jsx)(Layout_1.LayoutControls, { children: (0, jsx_runtime_1.jsx)("button", { style: {
190
+ flex: "1 0 auto",
191
+ width: "auto",
192
+ }, type: "button", onClick: onCancelForm, children: "Done" }) })) : undefined] }));
193
+ }, [
194
+ topLevel,
195
+ isEntryPoint,
196
+ hasChanges,
197
+ onCancelForm,
198
+ onResetForm,
199
+ onFormSubmit,
200
+ ]);
201
+ if (isForm) {
202
+ return ((0, jsx_runtime_1.jsxs)(FormComp, Object.assign({}, formProps, { "$allowShrink": topLevel, children: [(0, jsx_runtime_1.jsx)(Layout_1.LayoutBox, { "$allowShrink": topLevel, children: (0, jsx_runtime_1.jsx)(Layout_1.LayoutBox, Object.assign({}, layoutBoxProps, { "$allowShrink": false, children: typeStructureContent.map((tS) => {
203
+ const { name: tSName, literal: tSLiteral = false, type: tSType, multiple: tSMultiple, } = tS;
204
+ const { [TypeUtils_1.TAG_TYPES.inline]: tSInline, [TypeUtils_1.TAG_TYPES.label]: tSLabel, } = (0, TypeUtils_1.getTagValues)([TypeUtils_1.TAG_TYPES.inline, TypeUtils_1.TAG_TYPES.label], tS);
205
+ const inputLabel = typeof tSLabel === "string" ? tSLabel : tSName;
206
+ const tSTypeIsTypeStructure = typeof tSType === "string" && !!typeStructureMap[tSType];
207
+ const useInputType = !tSTypeIsTypeStructure;
208
+ const isHelperType = tSType in HelperTypes_1.DataTypeMap;
209
+ if (!tSMultiple &&
210
+ (isHelperType || tSLiteral || tSInline || useInputType)) {
211
+ return ((0, jsx_runtime_1.jsx)(exports.TypeStructureComponent, { typeStructureMap: typeStructureMap, typeStructure: tS, value: internalValue === null || internalValue === void 0 ? void 0 : internalValue[tSName], onChange: onPropertyChange, onNavigateToPath: onNavigateToPath, navigationPathPrefix: [tSName] }, tSName));
212
+ }
213
+ else {
214
+ return ((0, jsx_runtime_1.jsx)(OpenFormButton, { disabled: hasChanges, name: tSName, label: inputLabel, onOpenForm: onOpenForm }, tSName));
215
+ }
216
+ }) })) }), controls] })));
217
+ }
218
+ else {
219
+ const inputComp = ((0, jsx_runtime_1.jsx)(Input_1.Input, { name: typeStructureName, label: `${typeStructureLabel !== null && typeStructureLabel !== void 0 ? typeStructureLabel : ""}`, value: topLevel ? internalValue : value, type: typeStructureType, onChange: topLevel ? onPrimitiveChangeInternal : onChange, options: typeStructureOptions, allowCustomValue: !!typeStructureAllowCustomValue, readonly: readonly }, typeStructureName));
220
+ return topLevel ? ((0, jsx_runtime_1.jsxs)(LayoutForm, { "$allowShrink": false, onSubmit: onFormSubmit, children: [inputComp, controls] })) : (inputComp);
221
+ }
222
+ };
223
+ exports.TypeStructureComponent = TypeStructureComponent;
@@ -0,0 +1,50 @@
1
+ export type HashMatrixPathPartType = string | string[];
2
+ export type HashMatrixConfig = {
3
+ name?: string;
4
+ targetPath?: string | string[];
5
+ hashMatrix?: any | Record<any, any> | HashMatrix;
6
+ pathDelimiter?: string;
7
+ debounceInvalidationMS?: number;
8
+ preventInvalidation?: boolean;
9
+ };
10
+ export default class HashMatrix {
11
+ static DEFAULT_NAME: string;
12
+ static DEFAULT_PATH_DELIMITER: string;
13
+ static keyIsNumeric(key: string | number): boolean;
14
+ private _changeHandlerMap;
15
+ private _errorHandlerMap;
16
+ name?: string;
17
+ targetPath?: string | string[];
18
+ hashMatrix?: any | Record<any, any> | HashMatrix;
19
+ pathDelimiter?: string;
20
+ debounceInvalidationMS?: number;
21
+ preventInvalidation?: boolean;
22
+ constructor(config?: HashMatrixConfig);
23
+ private _setDefaultName;
24
+ getChangeHandlerList(path: HashMatrixPathPartType): Function[];
25
+ setChangeHandlerList(path: HashMatrixPathPartType, handlerList?: Function[]): void;
26
+ addChangeHandler(path: HashMatrixPathPartType | undefined, handler: Function): Function | void;
27
+ removeChangeHandler(path: HashMatrixPathPartType | undefined, handler: Function): void;
28
+ onChange(path: HashMatrixPathPartType, causePath: string): void;
29
+ getErrorHandlerList(path: HashMatrixPathPartType): Function[];
30
+ setErrorHandlerList(path: HashMatrixPathPartType, handlerList?: Function[]): void;
31
+ addErrorHandler(path: HashMatrixPathPartType | undefined, handler: Function): Function | void;
32
+ removeErrorHandler(path: HashMatrixPathPartType | undefined, handler: Function): void;
33
+ onError(error: any, path: HashMatrixPathPartType, causePath: string): void;
34
+ getBasePathArray(path?: HashMatrixPathPartType): string[];
35
+ getPathArray(path?: HashMatrixPathPartType, prefixPath?: HashMatrixPathPartType): string[];
36
+ getPathString(path?: HashMatrixPathPartType, prefixPath?: HashMatrixPathPartType): string;
37
+ dispatchChanges(path?: string | string[]): void;
38
+ dispatchErrors(error: any, path: HashMatrixPathPartType): void;
39
+ private _setErrorInternal;
40
+ setError(path: HashMatrixPathPartType, error: any): void;
41
+ private _getPathInternal;
42
+ getPath(path?: HashMatrixPathPartType): any;
43
+ private _setPathInternal;
44
+ setPath(path: HashMatrixPathPartType, value: any): void;
45
+ invalidatePath(path: HashMatrixPathPartType): void;
46
+ getValue(): any;
47
+ setValue(value: any): void;
48
+ private _invalidationDebounceTimeout?;
49
+ invalidate(): void;
50
+ }
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const INVALID = {};
4
+ class HashMatrix {
5
+ static keyIsNumeric(key) {
6
+ let numeric = false;
7
+ try {
8
+ numeric = Number.isInteger(parseInt(`${key}`, 10));
9
+ }
10
+ catch (error) {
11
+ // Ignore.
12
+ }
13
+ return numeric;
14
+ }
15
+ constructor(config = {}) {
16
+ this._changeHandlerMap = {};
17
+ this._errorHandlerMap = {};
18
+ Object.assign(this, config);
19
+ if (typeof this.pathDelimiter !== 'string') {
20
+ this.pathDelimiter = HashMatrix.DEFAULT_PATH_DELIMITER;
21
+ }
22
+ this._setDefaultName();
23
+ }
24
+ _setDefaultName() {
25
+ if (!this.hasOwnProperty('name')) {
26
+ if (typeof this.constructor.DEFAULT_NAME === 'string') {
27
+ this.name = this.constructor.DEFAULT_NAME;
28
+ }
29
+ else {
30
+ this.name = HashMatrix.DEFAULT_NAME;
31
+ }
32
+ }
33
+ }
34
+ getChangeHandlerList(path) {
35
+ const pathString = this.getPathString(path);
36
+ return this._changeHandlerMap[pathString] || [];
37
+ }
38
+ setChangeHandlerList(path, handlerList = []) {
39
+ const pathString = this.getPathString(path);
40
+ this._changeHandlerMap[pathString] = handlerList;
41
+ }
42
+ addChangeHandler(path = '', handler) {
43
+ if (this.hashMatrix instanceof HashMatrix) {
44
+ return this.hashMatrix.addChangeHandler(this.getPathArray(path, this.targetPath), handler);
45
+ }
46
+ if (!!handler) {
47
+ const handlerList = this.getChangeHandlerList(path);
48
+ if (handlerList.indexOf(handler) === -1) {
49
+ handlerList.push(handler);
50
+ this.setChangeHandlerList(path, handlerList);
51
+ return () => this.removeChangeHandler(path, handler);
52
+ }
53
+ }
54
+ }
55
+ removeChangeHandler(path = '', handler) {
56
+ if (this.hashMatrix instanceof HashMatrix) {
57
+ return this.hashMatrix.removeChangeHandler(this.getPathArray(path, this.targetPath), handler);
58
+ }
59
+ const handlerList = this.getChangeHandlerList(path);
60
+ if (handlerList.indexOf(handler) !== -1) {
61
+ const newHandlerList = [];
62
+ handlerList.forEach((h) => {
63
+ if (h !== handler) {
64
+ newHandlerList.push(h);
65
+ }
66
+ });
67
+ this.setChangeHandlerList(path, newHandlerList);
68
+ }
69
+ }
70
+ onChange(path, causePath) {
71
+ const handlerList = this.getChangeHandlerList(path);
72
+ handlerList.forEach((h) => h(path, causePath, this));
73
+ }
74
+ getErrorHandlerList(path) {
75
+ const pathString = this.getPathString(path);
76
+ return this._errorHandlerMap[pathString] || [];
77
+ }
78
+ setErrorHandlerList(path, handlerList = []) {
79
+ const pathString = this.getPathString(path);
80
+ this._errorHandlerMap[pathString] = handlerList;
81
+ }
82
+ addErrorHandler(path = '', handler) {
83
+ if (this.hashMatrix instanceof HashMatrix) {
84
+ return this.hashMatrix.addErrorHandler(this.getPathArray(path, this.targetPath), handler);
85
+ }
86
+ if (!!handler) {
87
+ const handlerList = this.getErrorHandlerList(path);
88
+ if (handlerList.indexOf(handler) === -1) {
89
+ handlerList.push(handler);
90
+ this.setErrorHandlerList(path, handlerList);
91
+ return () => this.removeErrorHandler(path, handler);
92
+ }
93
+ }
94
+ }
95
+ removeErrorHandler(path = '', handler) {
96
+ if (this.hashMatrix instanceof HashMatrix) {
97
+ return this.hashMatrix.removeErrorHandler(this.getPathArray(path, this.targetPath), handler);
98
+ }
99
+ const handlerList = this.getErrorHandlerList(path);
100
+ if (handlerList.indexOf(handler) !== -1) {
101
+ const newHandlerList = [];
102
+ handlerList.forEach((h) => {
103
+ if (h !== handler) {
104
+ newHandlerList.push(h);
105
+ }
106
+ });
107
+ this.setErrorHandlerList(path, newHandlerList);
108
+ }
109
+ }
110
+ onError(error, path, causePath) {
111
+ const handlerList = this.getErrorHandlerList(path);
112
+ handlerList.forEach((h) => h(error, path, causePath, this));
113
+ }
114
+ getBasePathArray(path = '') {
115
+ return path instanceof Array ? [...path] : path === '' ? [] : `${path}`.split(this.pathDelimiter);
116
+ }
117
+ getPathArray(path = '', prefixPath = '') {
118
+ const prefixPathArray = this.getBasePathArray(prefixPath);
119
+ const pathArray = this.getBasePathArray(path);
120
+ return [...prefixPathArray, ...pathArray];
121
+ }
122
+ getPathString(path, prefixPath) {
123
+ return this.getPathArray(path, prefixPath).join(this.pathDelimiter);
124
+ }
125
+ dispatchChanges(path) {
126
+ const pathArray = this.getPathArray(path);
127
+ const pathString = this.getPathString(pathArray);
128
+ // Notify lifecycle listeners of changes all the way up the path.
129
+ if (pathArray.length) {
130
+ const currentPath = [...pathArray];
131
+ // TRICKY: Start with the deepest path and move up to the most shallow.
132
+ while (currentPath.length) {
133
+ this.onChange(
134
+ // Path as a string.
135
+ this.getPathString(currentPath),
136
+ // The cause path.
137
+ pathString);
138
+ currentPath.pop();
139
+ }
140
+ }
141
+ this.onChange('', pathString);
142
+ }
143
+ dispatchErrors(error, path) {
144
+ const pathArray = this.getPathArray(path);
145
+ const pathString = this.getPathString(pathArray);
146
+ // Notify lifecycle listeners of errors all the way up the path.
147
+ if (pathArray.length) {
148
+ const currentPath = [...pathArray];
149
+ // TRICKY: Start with the deepest path and move up to the most shallow.
150
+ while (currentPath.length) {
151
+ this.onError(
152
+ // The error.
153
+ error,
154
+ // Path as a string.
155
+ this.getPathString(currentPath),
156
+ // The cause path.
157
+ pathString);
158
+ currentPath.pop();
159
+ }
160
+ }
161
+ this.onError(error, '', pathString);
162
+ }
163
+ _setErrorInternal(path, error) {
164
+ if (this.hashMatrix instanceof HashMatrix) {
165
+ return this.hashMatrix.setError(this.getPathArray(path, this.targetPath), error);
166
+ }
167
+ this.dispatchErrors(error, path);
168
+ }
169
+ setError(path, error) {
170
+ return this._setErrorInternal(path, error);
171
+ }
172
+ _getPathInternal(path) {
173
+ if (this.hashMatrix instanceof HashMatrix) {
174
+ return this.hashMatrix.getPath(this.getPathArray(path, this.targetPath));
175
+ }
176
+ const pathArray = this.getPathArray(path);
177
+ if (pathArray.length) {
178
+ let value, currentValue = this.hashMatrix, finished = true;
179
+ for (const part of pathArray) {
180
+ // Don't fail, just return `undefined`.
181
+ try {
182
+ currentValue = currentValue === null || currentValue === void 0 ? void 0 : currentValue[part];
183
+ }
184
+ catch (error) {
185
+ finished = false;
186
+ break;
187
+ }
188
+ }
189
+ // TRICKY: Don't select the current value if the full path wasn't processed.
190
+ if (finished) {
191
+ value = currentValue;
192
+ }
193
+ return value;
194
+ }
195
+ else {
196
+ return this.hashMatrix;
197
+ }
198
+ }
199
+ getPath(path) {
200
+ return this._getPathInternal(path);
201
+ }
202
+ _setPathInternal(path, value) {
203
+ if (this.hashMatrix instanceof HashMatrix) {
204
+ return this.hashMatrix.setPath(this.getPathArray(path, this.targetPath), value);
205
+ }
206
+ const targetValue = value === INVALID ? undefined : value;
207
+ const pathArray = this.getPathArray(path);
208
+ // TRICKY: DO NOT set if the value is exactly equal.
209
+ if (targetValue !== this._getPathInternal(path)) {
210
+ const newHashMatrix = Object.assign({}, this.hashMatrix);
211
+ if (pathArray.length) {
212
+ const lastIndex = pathArray.length - 1;
213
+ const lastPart = pathArray[lastIndex];
214
+ let currentValue = newHashMatrix;
215
+ for (let i = 0; i < lastIndex; i++) {
216
+ const part = pathArray[i];
217
+ const nextPart = pathArray[i + 1];
218
+ // TRICKY: Build out the tree is it's not there.
219
+ if (typeof currentValue[part] === 'undefined') {
220
+ currentValue[part] = HashMatrix.keyIsNumeric(nextPart) ? [] : {};
221
+ }
222
+ else if (currentValue[part] instanceof Array) {
223
+ currentValue[part] = [...currentValue[part]];
224
+ }
225
+ else if (currentValue[part] instanceof Object) {
226
+ currentValue[part] = Object.assign({}, currentValue[part]);
227
+ }
228
+ currentValue = currentValue[part];
229
+ }
230
+ currentValue[lastPart] = targetValue;
231
+ this.hashMatrix = newHashMatrix;
232
+ }
233
+ else {
234
+ this.hashMatrix = targetValue;
235
+ }
236
+ this.dispatchChanges(pathArray);
237
+ }
238
+ else if (value === INVALID) {
239
+ this.dispatchChanges(pathArray);
240
+ }
241
+ }
242
+ setPath(path, value) {
243
+ return this._setPathInternal(path, value);
244
+ }
245
+ invalidatePath(path) {
246
+ this.setPath(path, INVALID);
247
+ }
248
+ getValue() {
249
+ return this.getPath([]);
250
+ }
251
+ setValue(value) {
252
+ return this.setPath([], value);
253
+ }
254
+ invalidate() {
255
+ if (!this.preventInvalidation) {
256
+ if (typeof this.debounceInvalidationMS === 'number') {
257
+ clearTimeout(this._invalidationDebounceTimeout);
258
+ this._invalidationDebounceTimeout = setTimeout(() => this.setValue(INVALID), this.debounceInvalidationMS);
259
+ }
260
+ else {
261
+ this.setValue(INVALID);
262
+ }
263
+ }
264
+ }
265
+ }
266
+ HashMatrix.DEFAULT_NAME = 'HashMatrix';
267
+ HashMatrix.DEFAULT_PATH_DELIMITER = '.';
268
+ exports.default = HashMatrix;
@@ -0,0 +1 @@
1
+ export * from "./HashMatrix";
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./getSimpleId"), exports);
17
+ __exportStar(require("./HashMatrix"), exports);
@@ -0,0 +1,13 @@
1
+ export * as Storage from "./Storage";
2
+ export * as ValueProcessing from "./ValueProcessing";
3
+ export * from "./Application";
4
+ export * from "./Display";
5
+ export * from "./Editor";
6
+ export * from "./Form";
7
+ export * as HelperTypes from "./HelperTypes";
8
+ export * from "./IdUtils";
9
+ export * from "./Input";
10
+ export * from "./Layout";
11
+ export * from "./List";
12
+ export * from "./Navigation";
13
+ export * from "./TypeStructureComponent";
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.HelperTypes = exports.ValueProcessing = exports.Storage = void 0;
30
+ exports.Storage = __importStar(require("./Storage"));
31
+ exports.ValueProcessing = __importStar(require("./ValueProcessing"));
32
+ __exportStar(require("./Application"), exports);
33
+ __exportStar(require("./Display"), exports);
34
+ __exportStar(require("./Editor"), exports);
35
+ __exportStar(require("./Form"), exports);
36
+ exports.HelperTypes = __importStar(require("./HelperTypes"));
37
+ __exportStar(require("./IdUtils"), exports);
38
+ __exportStar(require("./Input"), exports);
39
+ __exportStar(require("./Layout"), exports);
40
+ __exportStar(require("./List"), exports);
41
+ __exportStar(require("./Navigation"), exports);
42
+ __exportStar(require("./TypeStructureComponent"), exports);
@@ -0,0 +1,8 @@
1
+ import "material-symbols";
2
+ import { FC, HTMLAttributes, PropsWithChildren } from "react";
3
+ export type MaterialSymbolVariant = "outlined" | "rounded" | "sharp";
4
+ export type MaterialSymbolProps = PropsWithChildren<HTMLAttributes<HTMLSpanElement> & {
5
+ variant?: MaterialSymbolVariant;
6
+ }>;
7
+ export declare const MaterialSymbol: FC<MaterialSymbolProps>;
8
+ export declare const SYM: FC<MaterialSymbolProps>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.SYM = exports.MaterialSymbol = void 0;
15
+ const jsx_runtime_1 = require("react/jsx-runtime");
16
+ require("material-symbols");
17
+ const MaterialSymbol = (_a) => {
18
+ var { variant = "outlined", children } = _a, rest = __rest(_a, ["variant", "children"]);
19
+ return ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: `material-symbols-${variant}` }, rest, { children: children })));
20
+ };
21
+ exports.MaterialSymbol = MaterialSymbol;
22
+ exports.SYM = exports.MaterialSymbol;
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ export type TabItem = {
3
+ label: string;
4
+ onClick?: () => void;
5
+ };
6
+ export type TabsProps = {
7
+ tabItems: TabItem[];
8
+ };
9
+ export declare const Tabs: FC<TabsProps>;