@vertigis/workflow 5.36.0 → 5.37.1

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 (453) hide show
  1. package/Activator.d.ts +25 -25
  2. package/Collections.d.ts +83 -91
  3. package/EnumUtils.d.ts +28 -28
  4. package/Errors.d.ts +155 -155
  5. package/Hooks.d.ts +32 -32
  6. package/IActivityHandler.d.ts +101 -101
  7. package/LanguageStringUtils.d.ts +16 -17
  8. package/LanguageStringUtils.js +1 -1
  9. package/ProgramInspectorFacility.d.ts +23 -24
  10. package/Task.d.ts +56 -56
  11. package/TemplateUtils.d.ts +28 -28
  12. package/Validation.d.ts +151 -26
  13. package/Validation.js +1 -1
  14. package/activities/app/GetApplicationData.d.ts +15 -12
  15. package/activities/app/GetApplicationData.js +1 -1
  16. package/activities/app/GetApplicationInfo.d.ts +15 -15
  17. package/activities/app/GetUserInfo.d.ts +15 -15
  18. package/activities/app/PublishEvent.d.ts +14 -14
  19. package/activities/app/RemoveApplicationData.d.ts +14 -11
  20. package/activities/app/RemoveApplicationData.js +1 -1
  21. package/activities/app/RunCommand.d.ts +17 -17
  22. package/activities/app/RunOperation.d.ts +25 -25
  23. package/activities/app/SetApplicationData.d.ts +13 -10
  24. package/activities/app/SetApplicationData.js +1 -1
  25. package/activities/app/applicationData.d.ts +12 -0
  26. package/activities/app/applicationData.js +1 -0
  27. package/activities/arcgis/AddAttachment.d.ts +22 -22
  28. package/activities/arcgis/AddFeatureLayer.d.ts +23 -23
  29. package/activities/arcgis/AddFeatureLayer.js +1 -1
  30. package/activities/arcgis/AddFeatures.d.ts +27 -27
  31. package/activities/arcgis/AddGraphics.d.ts +27 -27
  32. package/activities/arcgis/ArcadeScript.d.ts +17 -18
  33. package/activities/arcgis/AreaEngineTask.d.ts +20 -20
  34. package/activities/arcgis/BufferEngineTask.d.ts +27 -27
  35. package/activities/arcgis/BufferServiceTask.d.ts +33 -33
  36. package/activities/arcgis/BufferServiceTask.js +1 -1
  37. package/activities/arcgis/CastGeometry.d.ts +23 -23
  38. package/activities/arcgis/ClearGraphics.d.ts +12 -12
  39. package/activities/arcgis/ClearGraphics.js +1 -1
  40. package/activities/arcgis/ClipEngineTask.d.ts +18 -18
  41. package/activities/arcgis/ClosestFacilityTask.d.ts +90 -90
  42. package/activities/arcgis/ClosestFacilityTask.js +1 -1
  43. package/activities/arcgis/CompareGeometries.d.ts +19 -19
  44. package/activities/arcgis/ConvertValueToArcGisFieldType.d.ts +13 -0
  45. package/activities/arcgis/ConvertValueToArcGisFieldType.js +1 -0
  46. package/activities/arcgis/CreateFeatureSet.d.ts +16 -16
  47. package/activities/arcgis/CreateFeatureSet.js +1 -1
  48. package/activities/arcgis/CreateGraphic.d.ts +17 -17
  49. package/activities/arcgis/CreateGraphic.js +1 -1
  50. package/activities/arcgis/CreatePoint.d.ts +17 -17
  51. package/activities/arcgis/CutEngineTask.d.ts +18 -18
  52. package/activities/arcgis/DeleteAttachments.d.ts +22 -22
  53. package/activities/arcgis/DeleteFeatures.d.ts +30 -30
  54. package/activities/arcgis/DensifyEngineTask.d.ts +20 -20
  55. package/activities/arcgis/DifferenceEngineTask.d.ts +23 -23
  56. package/activities/arcgis/DistanceEngineTask.d.ts +20 -20
  57. package/activities/arcgis/DistanceServiceTask.d.ts +24 -24
  58. package/activities/arcgis/DistanceServiceTask.js +1 -1
  59. package/activities/arcgis/ExtendedSpatialReferenceInfoEngineTask.d.ts +17 -17
  60. package/activities/arcgis/FeatureSetFromJson.d.ts +16 -16
  61. package/activities/arcgis/FeatureTableMap.d.ts +12 -12
  62. package/activities/arcgis/FlipEngineTask.d.ts +21 -21
  63. package/activities/arcgis/FromGeoCoordinateStringServiceTask.d.ts +24 -24
  64. package/activities/arcgis/GeneralizeEngineTask.d.ts +22 -22
  65. package/activities/arcgis/GenerateArcGisToken.d.ts +23 -23
  66. package/activities/arcgis/GenerateWebmapForReport.d.ts +20 -20
  67. package/activities/arcgis/GenerateWebmapForReport.js +1 -1
  68. package/activities/arcgis/Geocode.d.ts +37 -38
  69. package/activities/arcgis/Geocode.js +1 -1
  70. package/activities/arcgis/GeometryFromJson.d.ts +16 -16
  71. package/activities/arcgis/Geoprocessing.d.ts +25 -26
  72. package/activities/arcgis/Geoprocessing.js +1 -1
  73. package/activities/arcgis/GeoprocessingAsync.d.ts +36 -37
  74. package/activities/arcgis/GeoprocessingAsync.js +1 -1
  75. package/activities/arcgis/GetAttributeValue.d.ts +22 -22
  76. package/activities/arcgis/GetAttributeValues.d.ts +20 -20
  77. package/activities/arcgis/GetCentroid.d.ts +16 -16
  78. package/activities/arcgis/GetCodedValueDomain.d.ts +29 -29
  79. package/activities/arcgis/GetCodedValueDomain.js +1 -1
  80. package/activities/arcgis/GetCurrentPosition.d.ts +46 -46
  81. package/activities/arcgis/GetFeatureGeometries.d.ts +20 -20
  82. package/activities/arcgis/GetFeatureGeometry.d.ts +18 -18
  83. package/activities/arcgis/GetFeatureLayerInfo.d.ts +22 -22
  84. package/activities/arcgis/GetFeatureSetExtent.d.ts +18 -18
  85. package/activities/arcgis/GetFeatureSetObjectIds.d.ts +20 -20
  86. package/activities/arcgis/GetFormElementItemsFromFeatures.d.ts +49 -50
  87. package/activities/arcgis/GetFormElementItemsFromFeatures.js +1 -1
  88. package/activities/arcgis/GetGeometryExtent.d.ts +17 -17
  89. package/activities/arcgis/GetGraphics.d.ts +19 -19
  90. package/activities/arcgis/GetLayer.d.ts +21 -21
  91. package/activities/arcgis/GetLayerDefinitionExpression.d.ts +18 -18
  92. package/activities/arcgis/GetLayerProperty.d.ts +18 -18
  93. package/activities/arcgis/GetLayerVisibility.d.ts +18 -18
  94. package/activities/arcgis/GetMap.d.ts +11 -11
  95. package/activities/arcgis/GetMapScreenshot.d.ts +18 -18
  96. package/activities/arcgis/GetPortalUser.d.ts +20 -20
  97. package/activities/arcgis/GetTable.d.ts +18 -18
  98. package/activities/arcgis/GetViewExtent.d.ts +16 -16
  99. package/activities/arcgis/GetViewpoint.d.ts +12 -12
  100. package/activities/arcgis/IntersectEngineTask.d.ts +20 -20
  101. package/activities/arcgis/LabelPointsServiceTask.d.ts +18 -18
  102. package/activities/arcgis/LengthEngineTask.d.ts +20 -20
  103. package/activities/arcgis/MapProvider.d.ts +133 -132
  104. package/activities/arcgis/MapProvider.js +1 -1
  105. package/activities/arcgis/NearestCoordinateEngineTask.d.ts +26 -26
  106. package/activities/arcgis/NearestVertexEngineTask.d.ts +26 -26
  107. package/activities/arcgis/NearestVerticesEngineTask.d.ts +34 -34
  108. package/activities/arcgis/OffsetEngineTask.d.ts +25 -25
  109. package/activities/arcgis/ProjectServiceTask.d.ts +27 -27
  110. package/activities/arcgis/ProjectServiceTask.js +1 -1
  111. package/activities/arcgis/QueryAttachmentInfos.d.ts +21 -21
  112. package/activities/arcgis/QueryTask.d.ts +77 -77
  113. package/activities/arcgis/QueryTask.js +1 -1
  114. package/activities/arcgis/RefreshLayer.d.ts +12 -12
  115. package/activities/arcgis/RegisterCorsUrl.d.ts +21 -21
  116. package/activities/arcgis/RelateEngineTask.d.ts +22 -22
  117. package/activities/arcgis/RelationServiceTask.d.ts +29 -29
  118. package/activities/arcgis/RelationServiceTask.js +1 -1
  119. package/activities/arcgis/RelationshipQueryTask.d.ts +37 -38
  120. package/activities/arcgis/RelationshipQueryTask.js +1 -1
  121. package/activities/arcgis/RemoveFeatureSetFields.d.ts +22 -22
  122. package/activities/arcgis/RemoveFeatureSetFields.js +1 -1
  123. package/activities/arcgis/RemoveGraphics.d.ts +14 -14
  124. package/activities/arcgis/RemoveGraphics.js +1 -1
  125. package/activities/arcgis/RemoveLayer.d.ts +16 -16
  126. package/activities/arcgis/RendererFromJson.d.ts +16 -16
  127. package/activities/arcgis/ReshapeServiceTask.d.ts +20 -20
  128. package/activities/arcgis/ReverseGeocode.d.ts +31 -31
  129. package/activities/arcgis/ReverseGeocode.js +1 -1
  130. package/activities/arcgis/RotateEngineTask.d.ts +20 -20
  131. package/activities/arcgis/RouteTask.d.ts +91 -91
  132. package/activities/arcgis/RouteTask.js +1 -1
  133. package/activities/arcgis/RunPrint.d.ts +33 -34
  134. package/activities/arcgis/RunPrint.js +1 -1
  135. package/activities/arcgis/RunReport.d.ts +37 -38
  136. package/activities/arcgis/RunReport.js +1 -1
  137. package/activities/arcgis/RunWorkflow.d.ts +51 -52
  138. package/activities/arcgis/SendLayerToAttributeTable.d.ts +10 -10
  139. package/activities/arcgis/ServiceAreaTask.d.ts +87 -87
  140. package/activities/arcgis/ServiceAreaTask.js +1 -1
  141. package/activities/arcgis/SetFeatureAttribute.d.ts +15 -15
  142. package/activities/arcgis/SetFeatureGeometry.d.ts +13 -13
  143. package/activities/arcgis/SetFeaturePopup.d.ts +12 -12
  144. package/activities/arcgis/SetFeatureSymbol.d.ts +13 -13
  145. package/activities/arcgis/SetImageryLayerOptions.d.ts +27 -27
  146. package/activities/arcgis/SetLayerDefinitionExpression.d.ts +21 -21
  147. package/activities/arcgis/SetLayerDefinitionExpression.js +1 -1
  148. package/activities/arcgis/SetLayerPopup.d.ts +12 -12
  149. package/activities/arcgis/SetLayerProperty.d.ts +23 -23
  150. package/activities/arcgis/SetLayerVisibility.d.ts +23 -23
  151. package/activities/arcgis/SetMap.d.ts +14 -14
  152. package/activities/arcgis/SetViewExtent.d.ts +27 -27
  153. package/activities/arcgis/SetViewpoint.d.ts +23 -23
  154. package/activities/arcgis/ShowFeaturePopup.d.ts +11 -11
  155. package/activities/arcgis/ShowResults.d.ts +51 -51
  156. package/activities/arcgis/SimplifyEngineTask.d.ts +15 -15
  157. package/activities/arcgis/SortFeatureSet.d.ts +20 -20
  158. package/activities/arcgis/SymbolFromJson.d.ts +16 -16
  159. package/activities/arcgis/ToGeoCoordinateStringServiceTask.d.ts +30 -30
  160. package/activities/arcgis/TypeChecking.d.ts +46 -46
  161. package/activities/arcgis/UnionEngineTask.d.ts +19 -19
  162. package/activities/arcgis/UnionServiceTask.d.ts +20 -20
  163. package/activities/arcgis/UpdateAttachment.d.ts +29 -29
  164. package/activities/arcgis/UpdateFeatures.d.ts +27 -27
  165. package/activities/arcgis/libs/arcGisRestApi.d.ts +18 -18
  166. package/activities/arcgis/runUtils.d.ts +93 -93
  167. package/activities/arcgis/shared.d.ts +61 -61
  168. package/activities/arcgis/tools.d.ts +42 -40
  169. package/activities/arcgis/tools.js +1 -1
  170. package/activities/browser/GetBrowserInfo.d.ts +13 -13
  171. package/activities/browser/InjectCss.d.ts +11 -11
  172. package/activities/constants.d.ts +19 -19
  173. package/activities/core/AddItem.d.ts +12 -12
  174. package/activities/core/AddItems.d.ts +12 -12
  175. package/activities/core/Annotation.d.ts +8 -8
  176. package/activities/core/Cast.d.ts +16 -16
  177. package/activities/core/ChannelProvider.d.ts +89 -90
  178. package/activities/core/ChannelProvider.js +1 -1
  179. package/activities/core/ClearItems.d.ts +10 -10
  180. package/activities/core/Container.d.ts +7 -7
  181. package/activities/core/ConvertBytesToText.d.ts +14 -14
  182. package/activities/core/ConvertDataTableToFeatureSet.d.ts +12 -12
  183. package/activities/core/ConvertTextToBytes.d.ts +14 -14
  184. package/activities/core/ConvertToJson.d.ts +16 -16
  185. package/activities/core/ConvertToJson.js +1 -1
  186. package/activities/core/CreateFile.d.ts +18 -18
  187. package/activities/core/CreateValue.d.ts +21 -21
  188. package/activities/core/DecodeUriComponent.d.ts +14 -14
  189. package/activities/core/Delay.d.ts +18 -18
  190. package/activities/core/EncodeUriComponent.d.ts +14 -14
  191. package/activities/core/Evaluate.d.ts +18 -18
  192. package/activities/core/EvaluateAsync.d.ts +18 -18
  193. package/activities/core/Exit.d.ts +7 -7
  194. package/activities/core/ForEach.d.ts +25 -26
  195. package/activities/core/FormatDate.d.ts +23 -23
  196. package/activities/core/GetBase64StringFromBytes.d.ts +15 -15
  197. package/activities/core/GetBase64StringFromFile.d.ts +15 -15
  198. package/activities/core/GetBytesFromBase64String.d.ts +15 -15
  199. package/activities/core/GetFirstItem.d.ts +14 -14
  200. package/activities/core/GetItemAtIndex.d.ts +15 -15
  201. package/activities/core/GetLastItem.d.ts +14 -14
  202. package/activities/core/GetLogLevel.d.ts +9 -9
  203. package/activities/core/GetTextFromFile.d.ts +16 -16
  204. package/activities/core/GetWorkflowInputs.d.ts +12 -12
  205. package/activities/core/If.d.ts +18 -18
  206. package/activities/core/Log.d.ts +14 -14
  207. package/activities/core/Log.js +1 -1
  208. package/activities/core/Loop.d.ts +27 -27
  209. package/activities/core/Loop.js +1 -1
  210. package/activities/core/ParseJson.d.ts +16 -16
  211. package/activities/core/ParseNumber.d.ts +12 -12
  212. package/activities/core/ParseUrl.d.ts +24 -25
  213. package/activities/core/ParseUrl.js +1 -1
  214. package/activities/core/Placeholder.d.ts +6 -6
  215. package/activities/core/RegexMatches.d.ts +17 -17
  216. package/activities/core/RegexReplace.d.ts +18 -18
  217. package/activities/core/RemoveItem.d.ts +14 -14
  218. package/activities/core/RunActivity.d.ts +12 -13
  219. package/activities/core/RunSubworkflow.d.ts +14 -15
  220. package/activities/core/SetLogLevel.d.ts +9 -9
  221. package/activities/core/SetProperty.d.ts +15 -15
  222. package/activities/core/SetWorkflowOutput.d.ts +12 -12
  223. package/activities/core/Subworkflow.d.ts +14 -15
  224. package/activities/core/Switch.d.ts +19 -19
  225. package/activities/core/TextReplace.d.ts +16 -16
  226. package/activities/core/Throw.d.ts +12 -12
  227. package/activities/core/TryCatch.d.ts +12 -12
  228. package/activities/core/WebRequest.d.ts +49 -50
  229. package/activities/core/converters.d.ts +10 -10
  230. package/activities/csv/ConvertCsvToDataTable.d.ts +15 -15
  231. package/activities/csv/ConvertDataTableToCsv.d.ts +15 -15
  232. package/activities/essentials/GetEssentialsSite.d.ts +225 -225
  233. package/activities/essentials/RunEssentialsWorkflow.d.ts +25 -26
  234. package/activities/essentials/RunEssentialsWorkflowActivity.d.ts +17 -18
  235. package/activities/forms/ActivateFormElement.d.ts +13 -13
  236. package/activities/forms/ActivateFormElement.js +1 -1
  237. package/activities/forms/AddFormElement.d.ts +18 -18
  238. package/activities/forms/ClearFormElementError.d.ts +13 -13
  239. package/activities/forms/CompleteForm.d.ts +11 -11
  240. package/activities/forms/DisplayForm.d.ts +48 -49
  241. package/activities/forms/Errors.d.ts +18 -18
  242. package/activities/forms/FilterFormElementItems.d.ts +16 -16
  243. package/activities/forms/FormElementMap.d.ts +13 -13
  244. package/activities/forms/FormRenderer.d.ts +139 -140
  245. package/activities/forms/FormRenderer.js +1 -1
  246. package/activities/forms/GetFormElementItemsFromCollection.d.ts +49 -50
  247. package/activities/forms/GetFormElementItemsFromCollection.js +1 -1
  248. package/activities/forms/GetFormElementProperty.d.ts +19 -19
  249. package/activities/forms/GetFormElementValue.d.ts +17 -17
  250. package/activities/forms/GetFormEventData.d.ts +17 -17
  251. package/activities/forms/HideFormElement.d.ts +13 -13
  252. package/activities/forms/PropagateFormEvent.d.ts +10 -10
  253. package/activities/forms/SetCurrentFormElementItem.d.ts +18 -18
  254. package/activities/forms/SetCurrentFormElementItem.js +1 -1
  255. package/activities/forms/SetFormElementError.d.ts +17 -17
  256. package/activities/forms/SetFormElementEvent.d.ts +18 -18
  257. package/activities/forms/SetFormElementItemProperty.d.ts +34 -21
  258. package/activities/forms/SetFormElementItemProperty.js +1 -1
  259. package/activities/forms/SetFormElementItems.d.ts +18 -19
  260. package/activities/forms/SetFormElementProperty.d.ts +32 -19
  261. package/activities/forms/SetFormElementProperty.js +1 -1
  262. package/activities/forms/ShowFormElement.d.ts +15 -15
  263. package/activities/image/GetImageMetadata.d.ts +16 -16
  264. package/activities/image/RotateImage.d.ts +15 -15
  265. package/activities/index.d.ts +4 -2
  266. package/activities/index.js +1 -1
  267. package/activities/main.d.ts +1 -1
  268. package/activities/math/Abs.d.ts +14 -14
  269. package/activities/math/Cos.d.ts +14 -14
  270. package/activities/math/Max.d.ts +16 -16
  271. package/activities/math/Min.d.ts +16 -16
  272. package/activities/math/Pow.d.ts +15 -15
  273. package/activities/math/Random.d.ts +10 -10
  274. package/activities/math/Sin.d.ts +14 -14
  275. package/activities/math/Sqrt.d.ts +14 -14
  276. package/activities/math/Tan.d.ts +14 -14
  277. package/activities/pdf/AddGeoreferenceToPdf.d.ts +19 -19
  278. package/activities/pdf/AddImageToPdf.d.ts +63 -0
  279. package/activities/pdf/AddImageToPdf.js +1 -0
  280. package/activities/pdf/AddTextToPdf.d.ts +59 -0
  281. package/activities/pdf/AddTextToPdf.js +1 -0
  282. package/activities/pdf/CreatePdf.d.ts +49 -0
  283. package/activities/pdf/CreatePdf.js +1 -0
  284. package/activities/pdf/ExtractPdfPages.d.ts +17 -17
  285. package/activities/pdf/MergePdfs.d.ts +15 -15
  286. package/activities/server/CopyFile.d.ts +10 -10
  287. package/activities/server/CreateDirectory.d.ts +9 -9
  288. package/activities/server/CreateDownload.d.ts +18 -18
  289. package/activities/server/CreateEmailAttachment.d.ts +16 -16
  290. package/activities/server/CreateZipFromDirectory.d.ts +12 -12
  291. package/activities/server/DeleteDirectory.d.ts +9 -9
  292. package/activities/server/DeleteFile.d.ts +9 -9
  293. package/activities/server/DirectoryExists.d.ts +13 -13
  294. package/activities/server/ExtractZipToDirectory.d.ts +11 -11
  295. package/activities/server/FileExists.d.ts +13 -13
  296. package/activities/server/GetDirectoriesInDirectory.d.ts +14 -14
  297. package/activities/server/GetFilesInDirectory.d.ts +14 -14
  298. package/activities/server/MoveFile.d.ts +10 -10
  299. package/activities/server/ReadFile.d.ts +14 -14
  300. package/activities/server/ReadFileBytes.d.ts +13 -13
  301. package/activities/server/RunApplication.d.ts +22 -22
  302. package/activities/server/RunPython.d.ts +23 -23
  303. package/activities/server/SendEmail.d.ts +16 -16
  304. package/activities/server/SqlNonQuery.d.ts +18 -18
  305. package/activities/server/SqlQuery.d.ts +18 -18
  306. package/activities/server/SqlQueryUnsafe.d.ts +18 -18
  307. package/activities/server/WriteFile.d.ts +11 -11
  308. package/activities/server/WriteFileBytes.d.ts +10 -10
  309. package/activities/ui/Alert.d.ts +17 -17
  310. package/activities/ui/Confirm.d.ts +24 -24
  311. package/activities/ui/Prompt.d.ts +26 -26
  312. package/activities/wab/OpenWidget.d.ts +10 -10
  313. package/activities/wab/PublishWidgetData.d.ts +11 -11
  314. package/activities/xlsx/ConvertDataTableToXlsx.d.ts +15 -15
  315. package/activities/xlsx/ConvertXlsxToDataSet.d.ts +15 -15
  316. package/constants.d.ts +2 -2
  317. package/definition/Activity.d.ts +12 -13
  318. package/definition/ActivityInput.d.ts +31 -31
  319. package/definition/Component.d.ts +10 -10
  320. package/definition/DeploymentConfig.d.ts +4 -5
  321. package/definition/Form.d.ts +5 -5
  322. package/definition/Program.d.ts +29 -30
  323. package/definition/ProgramInspector.d.ts +290 -288
  324. package/definition/ProgramInspector.js +1 -1
  325. package/definition/Reference.d.ts +11 -11
  326. package/definition/Resource.d.ts +26 -26
  327. package/definition/Step.d.ts +9 -9
  328. package/definition/Transition.d.ts +17 -17
  329. package/diagnostics/ConsoleDebugLogger.d.ts +10 -10
  330. package/diagnostics/logging.d.ts +5 -5
  331. package/execution/ActivityLoader.d.ts +23 -24
  332. package/execution/Engine.d.ts +84 -85
  333. package/execution/IDebugSession.d.ts +43 -44
  334. package/execution/ModuleLoader.d.ts +42 -42
  335. package/execution/ProgramRunner.d.ts +1 -1
  336. package/execution/ProgramRunner.js +1 -1
  337. package/forms/Calendar.d.ts +89 -89
  338. package/forms/ExclusiveTimer.d.ts +13 -13
  339. package/forms/FormComponent.d.ts +47 -47
  340. package/forms/FormComponent.js +1 -1
  341. package/forms/FormDefinition.d.ts +451 -452
  342. package/forms/FormElement.d.ts +24 -59
  343. package/forms/FormElement.js +1 -1
  344. package/forms/FormHost.d.ts +225 -231
  345. package/forms/FormHost.js +1 -1
  346. package/forms/FormPresenterHost.d.ts +62 -74
  347. package/forms/MutuallyExclusiveSectionGroup.d.ts +41 -41
  348. package/forms/NumberParser.d.ts +27 -26
  349. package/forms/NumberParser.js +1 -1
  350. package/forms/common.d.ts +67 -62
  351. package/forms/common.js +1 -1
  352. package/forms/components/AccordionGroup.d.ts +15 -15
  353. package/forms/components/AutoComplete.d.ts +8 -8
  354. package/forms/components/ButtonBar.d.ts +8 -8
  355. package/forms/components/CheckBox.d.ts +7 -7
  356. package/forms/components/CheckGroup.d.ts +8 -8
  357. package/forms/components/Custom.d.ts +7 -7
  358. package/forms/components/DatePicker.d.ts +8 -8
  359. package/forms/components/DatePicker.js +1 -1
  360. package/forms/components/DateRangePicker.d.ts +12 -12
  361. package/forms/components/DateRangePicker.js +1 -1
  362. package/forms/components/DateTimePicker.d.ts +8 -8
  363. package/forms/components/DateTimePicker.js +1 -1
  364. package/forms/components/DropDownList.d.ts +8 -7
  365. package/forms/components/DropDownList.js +1 -1
  366. package/forms/components/FilePicker.d.ts +10 -9
  367. package/forms/components/FilePicker.js +1 -1
  368. package/forms/components/Form.d.ts +23 -23
  369. package/forms/components/Form.js +1 -1
  370. package/forms/components/FormLabelNumberField.d.ts +17 -17
  371. package/forms/components/GeometryPicker.d.ts +5 -4
  372. package/forms/components/GeometryPicker.js +1 -1
  373. package/forms/components/GeometryPickerListItem.d.ts +23 -23
  374. package/forms/components/HorizontalRule.d.ts +7 -7
  375. package/forms/components/Image.d.ts +7 -7
  376. package/forms/components/ItemPicker.d.ts +15 -17
  377. package/forms/components/ItemPicker.js +1 -1
  378. package/forms/components/ListBox.d.ts +8 -8
  379. package/forms/components/Markdown.d.ts +14 -14
  380. package/forms/components/Number.d.ts +8 -8
  381. package/forms/components/Number.js +1 -1
  382. package/forms/components/NumberRangeSlider.d.ts +12 -12
  383. package/forms/components/NumberSlider.d.ts +11 -11
  384. package/forms/components/RadioGroup.d.ts +8 -8
  385. package/forms/components/Scanner.d.ts +11 -9
  386. package/forms/components/Scanner.js +1 -1
  387. package/forms/components/Section.d.ts +14 -14
  388. package/forms/components/Section.js +1 -1
  389. package/forms/components/Signature.d.ts +12 -11
  390. package/forms/components/Signature.js +1 -1
  391. package/forms/components/SignatureDialog.d.ts +22 -22
  392. package/forms/components/Text.d.ts +8 -8
  393. package/forms/components/TextArea.d.ts +7 -7
  394. package/forms/components/TextBox.d.ts +7 -7
  395. package/forms/components/TimePicker.d.ts +8 -8
  396. package/forms/components/TimePicker.js +1 -1
  397. package/forms/constants.d.ts +81 -81
  398. package/forms/dateUtilities.d.ts +102 -103
  399. package/forms/dateUtilities.js +1 -1
  400. package/forms/elements/AutoComplete.d.ts +13 -13
  401. package/forms/elements/ButtonBar.d.ts +9 -9
  402. package/forms/elements/CheckBox.d.ts +7 -7
  403. package/forms/elements/CheckGroup.d.ts +11 -11
  404. package/forms/elements/Custom.d.ts +7 -7
  405. package/forms/elements/DatePicker.d.ts +6 -6
  406. package/forms/elements/DateRangePicker.d.ts +6 -6
  407. package/forms/elements/DateTimePicker.d.ts +6 -6
  408. package/forms/elements/DropDownList.d.ts +6 -6
  409. package/forms/elements/FilePicker.d.ts +8 -8
  410. package/forms/elements/GeometryPicker.d.ts +18 -18
  411. package/forms/elements/Header.d.ts +10 -10
  412. package/forms/elements/HorizontalRule.d.ts +2 -2
  413. package/forms/elements/Image.d.ts +2 -2
  414. package/forms/elements/ItemPicker.d.ts +13 -13
  415. package/forms/elements/ListBox.d.ts +11 -11
  416. package/forms/elements/Number.d.ts +11 -11
  417. package/forms/elements/NumberRangeSlider.d.ts +10 -10
  418. package/forms/elements/NumberSlider.d.ts +6 -6
  419. package/forms/elements/PasswordBox.d.ts +5 -5
  420. package/forms/elements/RadioGroup.d.ts +6 -6
  421. package/forms/elements/Scanner.d.ts +19 -19
  422. package/forms/elements/Section.d.ts +2 -2
  423. package/forms/elements/Signature.d.ts +16 -16
  424. package/forms/elements/Text.d.ts +2 -2
  425. package/forms/elements/TextArea.d.ts +7 -7
  426. package/forms/elements/TextBox.d.ts +5 -5
  427. package/forms/elements/TimePicker.d.ts +6 -6
  428. package/forms/elements/types.d.ts +83 -83
  429. package/forms/index.d.ts +124 -108
  430. package/forms/keyboard.d.ts +9 -9
  431. package/forms/listUtilities.d.ts +3 -3
  432. package/forms/manifest.d.ts +3 -3
  433. package/forms/manifest.js +1 -1
  434. package/forms/numberFormatter.d.ts +90 -94
  435. package/forms/numberFormatter.js +1 -1
  436. package/forms/numberUtilities.d.ts +150 -150
  437. package/forms/numberUtilities.js +1 -1
  438. package/forms/presenter.d.ts +21 -21
  439. package/forms/presenter.js +1 -1
  440. package/forms/renderers.d.ts +5 -8
  441. package/forms/renderers.js +1 -1
  442. package/forms/textUtilities.d.ts +33 -23
  443. package/forms/textUtilities.js +1 -1
  444. package/forms/utils.d.ts +177 -146
  445. package/forms/utils.js +1 -1
  446. package/index.d.ts +2 -2
  447. package/libs/version.d.ts +1 -1
  448. package/libs/version.js +1 -1
  449. package/licensing/LicenseChecker.d.ts +1 -1
  450. package/licensing/Watermark.d.ts +7 -7
  451. package/package.json +9 -11
  452. package/activities/app/constants.d.ts +0 -1
  453. package/activities/app/constants.js +0 -1
@@ -1,94 +1,90 @@
1
- export { isNumeric } from "./utils";
2
- /**
3
- * Pre-defined format specifiers for use with format().
4
- */
5
- export declare enum NumberDisplayFormat {
6
- /**
7
- * A localized representation of a number with a decimal separator and group
8
- * separators (e.g. "12,345.67", "-42" for en-US locale).
9
- */
10
- NUMBER = "n",
11
- /**
12
- * A localized representation of a number with a decimal separator (e.g.
13
- * "12345.67", "-42" for en-US locale).
14
- */
15
- FIXED_POINT = "f",
16
- /**
17
- * A localized representation of a monetary amount in a specific currency
18
- * (e.g. "$123.45" for USD, "£123.45" for GBP for en-US locale).
19
- */
20
- CURRENCY = "c",
21
- /**
22
- * Same as CURRENCY, except that in many locales, negative values may be displayed in
23
- * parentheses instead of using a "-" sign.
24
- */
25
- ACCOUNTING = "a",
26
- /**
27
- * A localized representation of a percentage (e.g. 0.99 -\> "99%" in the
28
- * en-US locale).
29
- */
30
- PERCENT = "p",
31
- /**
32
- * An invariant representation of a number (e.g. "12345.67"). Guarantees
33
- * that the number can be parsed back into the same number, regardless of
34
- * locale.
35
- */
36
- ROUND_TRIP = "r",
37
- /**
38
- * The default representation for number values (equivalent to NUMBER).
39
- */
40
- DEFAULT = "n",
41
- /**
42
- * A custom format string.
43
- */
44
- CUSTOM = "custom"
45
- }
46
- /**
47
- * Options supported by {@link format}.
48
- */
49
- export interface FormatOptions {
50
- /**
51
- * The locale to use when formatting the number.
52
- */
53
- locale: string;
54
- /**
55
- * The number format. See {@link NumberFormatter.format}.
56
- */
57
- format?: NumberDisplayFormat;
58
- /**
59
- * See NumberFormat.currency.
60
- */
61
- currency?: string;
62
- /**
63
- * The custom number format. Required for a format type of 'Custom'
64
- */
65
- customDisplayFormat?: string;
66
- /**
67
- * See NumberFormat.precision.
68
- */
69
- fractionalDigits?: number;
70
- }
71
- export declare const DEFAULT_CURRENCY = "USD";
72
- export declare const DEFAULT_CUSTOM_FORMAT = "#.##";
73
- export declare const DEFAULT_FRACTIONAL_DIGITS = 4;
74
- export declare const SUPPORTED_CURRENCIES: string[];
75
- /**
76
- * Formats a number for display in the current locale.
77
- *
78
- * @param num The number to format.
79
- */
80
- export declare function format(num: number): string;
81
- /**
82
- * Formats a number for display.
83
- *
84
- * @param format See {@link NumberFormatter.format}.
85
- * @param num The number to format.
86
- */
87
- export declare function format(format: string, num: number): string;
88
- /**
89
- * Formats a number for display.
90
- *
91
- * @param options Specifies the format settings to use.
92
- * @param num The number to format.
93
- */
94
- export declare function format(options: FormatOptions, num: number): string;
1
+ export { isNumeric } from "./utils";
2
+ /**
3
+ * Pre-defined format specifiers for use with format().
4
+ */
5
+ export declare enum NumberDisplayFormat {
6
+ /**
7
+ * A localized representation of a number with a decimal separator and group
8
+ * separators (e.g. "12,345.67", "-42" for en-US locale).
9
+ */
10
+ NUMBER = "n",
11
+ /**
12
+ * A localized representation of a number with a decimal separator (e.g.
13
+ * "12345.67", "-42" for en-US locale).
14
+ */
15
+ FIXED_POINT = "f",
16
+ /**
17
+ * A localized representation of a monetary amount in a specific currency
18
+ * (e.g. "$123.45" for USD, "£123.45" for GBP for en-US locale).
19
+ */
20
+ CURRENCY = "c",
21
+ /**
22
+ * Same as CURRENCY, except that in many locales, negative values may be displayed in
23
+ * parentheses instead of using a "-" sign.
24
+ */
25
+ ACCOUNTING = "a",
26
+ /**
27
+ * A localized representation of a percentage (e.g. 0.99 -\> "99%" in the
28
+ * en-US locale).
29
+ */
30
+ PERCENT = "p",
31
+ /**
32
+ * An invariant representation of a number (e.g. "12345.67"). Guarantees
33
+ * that the number can be parsed back into the same number, regardless of
34
+ * locale.
35
+ */
36
+ ROUND_TRIP = "r",
37
+ /**
38
+ * A custom format string.
39
+ */
40
+ CUSTOM = "custom"
41
+ }
42
+ /**
43
+ * Options supported by {@link format}.
44
+ */
45
+ export interface FormatOptions {
46
+ /**
47
+ * The locale to use when formatting the number.
48
+ */
49
+ locale: string;
50
+ /**
51
+ * The number format. See {@link NumberFormatter.format}.
52
+ */
53
+ format?: NumberDisplayFormat;
54
+ /**
55
+ * See NumberFormat.currency.
56
+ */
57
+ currency?: string;
58
+ /**
59
+ * The custom number format. Required for a format type of 'Custom'
60
+ */
61
+ customDisplayFormat?: string;
62
+ /**
63
+ * See NumberFormat.precision.
64
+ */
65
+ fractionalDigits?: number;
66
+ }
67
+ export declare const DEFAULT_CURRENCY = "USD";
68
+ export declare const DEFAULT_CUSTOM_FORMAT = "#.##";
69
+ export declare const DEFAULT_FRACTIONAL_DIGITS = 4;
70
+ export declare const SUPPORTED_CURRENCIES: string[];
71
+ /**
72
+ * Formats a number for display in the current locale.
73
+ *
74
+ * @param num The number to format.
75
+ */
76
+ export declare function format(num: number): string;
77
+ /**
78
+ * Formats a number for display.
79
+ *
80
+ * @param format See {@link NumberFormatter.format}.
81
+ * @param num The number to format.
82
+ */
83
+ export declare function format(format: string, num: number): string;
84
+ /**
85
+ * Formats a number for display.
86
+ *
87
+ * @param options Specifies the format settings to use.
88
+ * @param num The number to format.
89
+ */
90
+ export declare function format(options: FormatOptions, num: number): string;
@@ -1 +1 @@
1
- import{DEFAULT_LOCALE}from"../constants.js";export{isNumeric}from"./utils.js";var NumberDisplayFormat;!function(t){t.NUMBER="n",t.FIXED_POINT="f",t.CURRENCY="c",t.ACCOUNTING="a",t.PERCENT="p",t.ROUND_TRIP="r",t.DEFAULT="n",t.CUSTOM="custom"}(NumberDisplayFormat=NumberDisplayFormat||{});const DEFAULT_CURRENCY="USD",DEFAULT_CUSTOM_FORMAT="#.##",DEFAULT_FRACTIONAL_DIGITS=4,SUPPORTED_CURRENCIES=["ADP","AED","AFA","AFN","ALK","ALL","AMD","ANG","AOA","AOK","AON","AOR","ARA","ARL","ARM","ARP","ARS","ATS","AUD","AWG","AZM","AZN","BAD","BAM","BAN","BBD","BDT","BEC","BEF","BEL","BGL","BGM","BGN","BGO","BHD","BIF","BMD","BND","BOB","BOL","BOP","BOV","BRB","BRC","BRE","BRL","BRN","BRR","BRZ","BSD","BTN","BUK","BWP","BYB","BYN","BYR","BZD","CAD","CDF","CHE","CHF","CHW","CLE","CLF","CLP","CNH","CNX","CNY","COP","COU","CRC","CSD","CSK","CUC","CUP","CVE","CYP","CZK","DDM","DEM","DJF","DKK","DOP","DZD","ECS","ECV","EEK","EGP","ERN","ESA","ESB","ESP","ETB","EUR","FIM","FJD","FKP","FRF","GBP","GEK","GEL","GHC","GHS","GIP","GMD","GNF","GNS","GQE","GRD","GTQ","GWE","GWP","GYD","HKD","HNL","HRD","HRK","HTG","HUF","IDR","IEP","ILP","ILR","ILS","INR","IQD","IRR","ISJ","ISK","ITL","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRH","KRO","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LTL","LTT","LUC","LUF","LUL","LVL","LVR","LYD","MAD","MAF","MCF","MDC","MDL","MGA","MGF","MKD","MKN","MLF","MMK","MNT","MOP","MRO","MRU","MTL","MTP","MUR","MVP","MVR","MWK","MXN","MXP","MXV","MYR","MZE","MZM","MZN","NAD","NGN","NIC","NIO","NLG","NOK","NPR","NZD","OMR","PAB","PEI","PEN","PES","PGK","PHP","PKR","PLN","PLZ","PTE","PYG","QAR","RHD","ROL","RON","RSD","RUB","RUR","RWF","SAR","SBD","SCR","SDD","SDG","SDP","SEK","SGD","SHP","SIT","SKK","SLL","SOS","SRD","SRG","SSP","STD","STN","SUR","SVC","SYP","SZL","THB","TJR","TJS","TMM","TMT","TND","TOP","TPE","TRL","TRY","TTD","TWD","TZS","UAH","UAK","UGS","UGX","USD","USN","USS","UYI","UYP","UYU","UYW","UZS","VEB","VEF","VES","VND","VNN","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XEU","XFO","XFU","XOF","XPD","XPF","XPT","XRE","XSU","XTS","XUA","XXX","YDD","YER","YUD","YUM","YUN","YUR","ZAL","ZAR","ZMK","ZMW","ZRN","ZRZ","ZWD","ZWL","ZWR"];function format(...t){return globalFormatter.format.apply(globalFormatter,t)}class NumberFormatter{format(...t){let r=NaN,a={locale:DEFAULT_LOCALE};if(1===t.length?r=t[0]:2<=arguments.length&&(r=t[1],a="string"==typeof t[0]?{format:t[0],locale:DEFAULT_LOCALE}:t[0]||a),null===r||void 0===r||isNaN(r))return"";let e=a.format||NumberDisplayFormat.DEFAULT;if(e===NumberDisplayFormat.CUSTOM&&(e=a.customDisplayFormat||DEFAULT_CUSTOM_FORMAT),e===NumberDisplayFormat.ROUND_TRIP)return r.toString();var m=e.toLowerCase();m===NumberDisplayFormat.CURRENCY||m===NumberDisplayFormat.ACCOUNTING?(i=a.currency||DEFAULT_CURRENCY,e=m,e+=a.fractionalDigits??"",e+=i?`$${i}`:""):m!==NumberDisplayFormat.NUMBER&&m!==NumberDisplayFormat.FIXED_POINT&&m!==NumberDisplayFormat.PERCENT||(e=m,e+=a.fractionalDigits??"");const D=[a.locale];var i=`${D.join(";")}|${e}`;let N=numberFormatters.get(i);return N||(N=[],1===(m=e.split(";",3)).length?(N[0]=this._createNumberFormatter(D,m[0]),N[1]=N[0],N[2]=N[0]):2===m.length?(N[0]=this._createNumberFormatter(D,m[0]),N[1]=this._createNumberFormatter(D,m[1]),N[2]=N[0]):3===m.length&&(N[0]=this._createNumberFormatter(D,m[0]),N[1]=this._createNumberFormatter(D,m[1]),N[2]=this._createNumberFormatter(D,m[2])),numberFormatters.set(i,N)),0<r?N[0](r):r<0?N[1](r):N[2](r)}_createNumberFormatter(r,t){const a={};let e=t.match(standardFormatPattern);if(e){var m=e[1].toLowerCase(),D=Math.min(20,parseInt(e[2]));let t=e[3];m===NumberDisplayFormat.CURRENCY||m===NumberDisplayFormat.ACCOUNTING?t=(t||DEFAULT_CURRENCY).toUpperCase():(t="",void 0===a.minimumFractionDigits&&(a.minimumFractionDigits=0),void 0===a.maximumFractionDigits&&(a.maximumFractionDigits=Math.max(DEFAULT_FRACTIONAL_DIGITS,a.minimumFractionDigits))),m===NumberDisplayFormat.PERCENT?a.style="percent":m===NumberDisplayFormat.ACCOUNTING?a.currencySign="accounting":m===NumberDisplayFormat.FIXED_POINT&&(a.useGrouping=!1),isNaN(D)||(a.minimumFractionDigits=D,a.maximumFractionDigits=D);const E=t?new Intl.NumberFormat(r,{style:"currency",currency:t,...a}):new Intl.NumberFormat(r,a);return t=>E.format(t)}var i,N;e=t.match(/[0#]+|\.|,|%|\\.|(["'])[^\1]+\1|[^0#.,\\'"]+/g);let R=!1,F="",o="",n="",s="";a.minimumFractionDigits=0,a.maximumFractionDigits=0,a.useGrouping=!1;for(i of e)switch(i[0]){case".":R=!0;break;case",":a.useGrouping=!0;break;case"%":a.style="percent";break;case"0":case"#":R?o+=i:F+=i;break;default:0===i.indexOf('"')||0===i.indexOf("'")?i=i.slice(1,-1):0===i.indexOf("\\")&&(i=i.slice(1)),F||o?s+=i:n+=i}if(!F||0<=(N=F.indexOf("0"))&&(a.minimumIntegerDigits=F.length-N),o&&(N=o.lastIndexOf("0"),a.minimumFractionDigits=0<=N?N+1:0,a.maximumFractionDigits=Math.min(20,o.length)),F||o){const A=new Intl.NumberFormat(r,a);return t=>`${n}${A.format(t)}${s}`}return()=>n+s}}const numberFormatters=new Map,standardFormatPattern=/^([acfnp])(\d*)(?:\$([a-zA-Z]{3}))?$/i,globalFormatter=new NumberFormatter;export{NumberDisplayFormat,DEFAULT_CURRENCY,DEFAULT_CUSTOM_FORMAT,DEFAULT_FRACTIONAL_DIGITS,SUPPORTED_CURRENCIES,format};
1
+ import{DEFAULT_LOCALE}from"../constants.js";export{isNumeric}from"./utils.js";var NumberDisplayFormat;!function(t){t.NUMBER="n",t.FIXED_POINT="f",t.CURRENCY="c",t.ACCOUNTING="a",t.PERCENT="p",t.ROUND_TRIP="r",t.CUSTOM="custom"}(NumberDisplayFormat=NumberDisplayFormat||{});const DEFAULT_CURRENCY="USD",DEFAULT_CUSTOM_FORMAT="#.##",DEFAULT_FRACTIONAL_DIGITS=4,SUPPORTED_CURRENCIES=["ADP","AED","AFA","AFN","ALK","ALL","AMD","ANG","AOA","AOK","AON","AOR","ARA","ARL","ARM","ARP","ARS","ATS","AUD","AWG","AZM","AZN","BAD","BAM","BAN","BBD","BDT","BEC","BEF","BEL","BGL","BGM","BGN","BGO","BHD","BIF","BMD","BND","BOB","BOL","BOP","BOV","BRB","BRC","BRE","BRL","BRN","BRR","BRZ","BSD","BTN","BUK","BWP","BYB","BYN","BYR","BZD","CAD","CDF","CHE","CHF","CHW","CLE","CLF","CLP","CNH","CNX","CNY","COP","COU","CRC","CSD","CSK","CUC","CUP","CVE","CYP","CZK","DDM","DEM","DJF","DKK","DOP","DZD","ECS","ECV","EEK","EGP","ERN","ESA","ESB","ESP","ETB","EUR","FIM","FJD","FKP","FRF","GBP","GEK","GEL","GHC","GHS","GIP","GMD","GNF","GNS","GQE","GRD","GTQ","GWE","GWP","GYD","HKD","HNL","HRD","HRK","HTG","HUF","IDR","IEP","ILP","ILR","ILS","INR","IQD","IRR","ISJ","ISK","ITL","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRH","KRO","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LTL","LTT","LUC","LUF","LUL","LVL","LVR","LYD","MAD","MAF","MCF","MDC","MDL","MGA","MGF","MKD","MKN","MLF","MMK","MNT","MOP","MRO","MRU","MTL","MTP","MUR","MVP","MVR","MWK","MXN","MXP","MXV","MYR","MZE","MZM","MZN","NAD","NGN","NIC","NIO","NLG","NOK","NPR","NZD","OMR","PAB","PEI","PEN","PES","PGK","PHP","PKR","PLN","PLZ","PTE","PYG","QAR","RHD","ROL","RON","RSD","RUB","RUR","RWF","SAR","SBD","SCR","SDD","SDG","SDP","SEK","SGD","SHP","SIT","SKK","SLL","SOS","SRD","SRG","SSP","STD","STN","SUR","SVC","SYP","SZL","THB","TJR","TJS","TMM","TMT","TND","TOP","TPE","TRL","TRY","TTD","TWD","TZS","UAH","UAK","UGS","UGX","USD","USN","USS","UYI","UYP","UYU","UYW","UZS","VEB","VEF","VES","VND","VNN","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XEU","XFO","XFU","XOF","XPD","XPF","XPT","XRE","XSU","XTS","XUA","XXX","YDD","YER","YUD","YUM","YUN","YUR","ZAL","ZAR","ZMK","ZMW","ZRN","ZRZ","ZWD","ZWL","ZWR"];function format(...t){return globalFormatter.format.apply(globalFormatter,t)}class NumberFormatter{format(...t){let r=NaN,a={locale:DEFAULT_LOCALE};if(1===t.length?r=t[0]:2<=arguments.length&&(r=t[1],a="string"==typeof t[0]?{format:t[0],locale:DEFAULT_LOCALE}:t[0]||a),null===r||void 0===r||isNaN(r))return"";let e=a.format||NumberDisplayFormat.NUMBER;if(e===NumberDisplayFormat.CUSTOM&&(e=a.customDisplayFormat||DEFAULT_CUSTOM_FORMAT),e===NumberDisplayFormat.ROUND_TRIP)return r.toString();var m=e.toLowerCase();m===NumberDisplayFormat.CURRENCY||m===NumberDisplayFormat.ACCOUNTING?(i=a.currency||DEFAULT_CURRENCY,e=m,e+=a.fractionalDigits??"",e+=i?`$${i}`:""):m!==NumberDisplayFormat.NUMBER&&m!==NumberDisplayFormat.FIXED_POINT&&m!==NumberDisplayFormat.PERCENT||(e=m,e+=a.fractionalDigits??"");const D=[a.locale];var i=`${D.join(";")}|${e}`;let N=numberFormatters.get(i);return N||(N=[],1===(m=e.split(";",3)).length?(N[0]=this._createNumberFormatter(D,m[0]),N[1]=N[0],N[2]=N[0]):2===m.length?(N[0]=this._createNumberFormatter(D,m[0]),N[1]=this._createNumberFormatter(D,m[1]),N[2]=N[0]):3===m.length&&(N[0]=this._createNumberFormatter(D,m[0]),N[1]=this._createNumberFormatter(D,m[1]),N[2]=this._createNumberFormatter(D,m[2])),numberFormatters.set(i,N)),0<r?N[0](r):r<0?N[1](r):N[2](r)}_createNumberFormatter(r,t){const a={};let e=t.match(standardFormatPattern);if(e){var m=e[1].toLowerCase(),D=Math.min(20,parseInt(e[2]));let t=e[3];m===NumberDisplayFormat.CURRENCY||m===NumberDisplayFormat.ACCOUNTING?t=(t||DEFAULT_CURRENCY).toUpperCase():(t="",void 0===a.minimumFractionDigits&&(a.minimumFractionDigits=0),void 0===a.maximumFractionDigits&&(a.maximumFractionDigits=Math.max(DEFAULT_FRACTIONAL_DIGITS,a.minimumFractionDigits))),m===NumberDisplayFormat.PERCENT?a.style="percent":m===NumberDisplayFormat.ACCOUNTING?a.currencySign="accounting":m===NumberDisplayFormat.FIXED_POINT&&(a.useGrouping=!1),isNaN(D)||(a.minimumFractionDigits=D,a.maximumFractionDigits=D);const E=t?new Intl.NumberFormat(r,{style:"currency",currency:t,...a}):new Intl.NumberFormat(r,a);return t=>E.format(t)}var i,N;e=t.match(/[0#]+|\.|,|%|\\.|(["'])[^\1]+\1|[^0#.,\\'"]+/g);let R=!1,F="",o="",n="",s="";a.minimumFractionDigits=0,a.maximumFractionDigits=0,a.useGrouping=!1;for(i of e)switch(i[0]){case".":R=!0;break;case",":a.useGrouping=!0;break;case"%":a.style="percent";break;case"0":case"#":R?o+=i:F+=i;break;default:0===i.indexOf('"')||0===i.indexOf("'")?i=i.slice(1,-1):0===i.indexOf("\\")&&(i=i.slice(1)),F||o?s+=i:n+=i}if(!F||0<=(N=F.indexOf("0"))&&(a.minimumIntegerDigits=F.length-N),o&&(N=o.lastIndexOf("0"),a.minimumFractionDigits=0<=N?N+1:0,a.maximumFractionDigits=Math.min(20,o.length)),F||o){const C=new Intl.NumberFormat(r,a);return t=>`${n}${C.format(t)}${s}`}return()=>n+s}}const numberFormatters=new Map,standardFormatPattern=/^([acfnp])(\d*)(?:\$([a-zA-Z]{3}))?$/i,globalFormatter=new NumberFormatter;export{NumberDisplayFormat,DEFAULT_CURRENCY,DEFAULT_CUSTOM_FORMAT,DEFAULT_FRACTIONAL_DIGITS,SUPPORTED_CURRENCIES,format};
@@ -1,150 +1,150 @@
1
- import * as defs from "./FormDefinition";
2
- import { FormatOptions } from "./numberFormatter";
3
- import { PropertyConstraints, PropertyConstraintsWithDefault } from "./utils";
4
- /**
5
- * Configuration for cleaning up a {@link defs.NumberFormat} used in producing a {@link defs.NumberConstraints}.
6
- *
7
- * This is a bit meta.
8
- * * A `NumberConstraints` is used at runtime to ensure the value that a user entered is valid.
9
- * * The `NumberConstraints` is generated from a `NumberFormat` which may only be partially defined, or may have values that are out of range.
10
- * * We need to populate and validate the `NumberFormat` first of all before we can generate a valid `NumberConstraints`.
11
- */
12
- export interface NumberFormatConfiguration {
13
- [key: string]: PropertyConstraints<any> | undefined;
14
- lowerBound: PropertyConstraints<number>;
15
- precision: PropertyConstraintsWithDefault<number>;
16
- step: PropertyConstraintsWithDefault<number>;
17
- upperBound: PropertyConstraints<number>;
18
- }
19
- export declare const defaultNumberFormatConfiguration: NumberFormatConfiguration;
20
- /**
21
- * Returns constraints to be used to ensure a value is a valid number for a form element.
22
- *
23
- * Non-numeric or missing values are replaced by defaults.
24
- *
25
- * The step is sanitized as follows:
26
- * 1. If it is not a number it is set to 1.
27
- * 2. If it is <= zero it is set to 1. (The @vertigis/react-ui/Slider gets stuck on the minimum value if the step is zero.)
28
- * 2. It cannot be greater than the full range. (max-min)
29
- * @param numberFormat The formatting options to use, typically configured on a Form Element.
30
- * @param partialNumberFormatConfiguration Additional configuration specific to the caller. These are combined with the defaults.
31
- * @returns A {@link defs.NumberConstraints} containing values that can be safely used in a component.
32
- */
33
- export declare function getNumberConstraints(numberFormat: defs.NumberFormat | undefined, partialNumberFormatConfiguration?: Partial<NumberFormatConfiguration>): defs.NumberConstraints;
34
- /**
35
- * Counts the number of decimal places in the specified custom format string and returns the result.
36
- * The supplied value is treated as one of Microsoft's [Custom numeric format strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings)
37
- *
38
- * There are lots of unusual ways you can combine the supported characters, but for simplicity, we support the most common use case
39
- * which is using `#` and numeric characters as placeholders.
40
- * @param customFormat The custom format to be inspected.
41
- * @returns The number of decimal places in `customFormat`.
42
- */
43
- export declare function countDecimalsInCustomFormat(customFormat: string | undefined): number;
44
- /**
45
- * Counts the number of decimal places in the specified number and returns the result.
46
- * This uses Intl.NumberFormat rather than number.toString() to ensure that large numbers don't get converted to an exponential format.
47
- *
48
- * Despite this, it may not be accurate for very large numbers as it seems the decimal places might still be ignored.
49
- * e.g. `(10 ** 21.5) + 0.123456789 and `(10 ** 21.5)` both return "3162277660168379400000".
50
- * @param value The value to be inspected.
51
- * @returns The number of decimal places in `value`.
52
- */
53
- export declare function countDecimalsInValue(value: number): number;
54
- /**
55
- * Determines how many decimal places should be used in presenting values to the user.
56
- *
57
- * There must be at least enough decimal places for the step size, although there could be more.
58
- * @param precision A precision value, likely from element.format.precision.
59
- * @param step The step size being used. This must be a validated step size from a NumberConstraints.
60
- * @param partialNumberFormatConfiguration Any configuration to normalize the supplied precision.
61
- * @returns The number of decimal places to be used to display values.
62
- */
63
- export declare function sanitizePrecision(precision: number | undefined, step: number, partialNumberFormatConfiguration?: Partial<NumberFormatConfiguration>): number;
64
- /**
65
- * Combines the provided configuration with the default and returns a new {@link NumberFormatConfiguration}.
66
- * @param partialConfiguration Configuration to be added with the defaults.
67
- * @returns The full set of constraints to use.
68
- */
69
- export declare function getNumberFormatConfiguration(partialConfiguration: Partial<NumberFormatConfiguration> | undefined): NumberFormatConfiguration;
70
- /**
71
- * Compares a value with some constraints and returns an adjusted value that satisfies the constraints. There are three considerations:
72
- * 1. The value must be >= `minimum`. Otherwise it is changed to `minimum`.
73
- * 2. The value must be <= `maximum`. Otherwise it is changed to `maximum`.
74
- * 3. The value must land on a valid step between the bounds. Otherwise it is moved to the nearest step.
75
- * This can only be enforced if `minimum` or `maximum` is specified.
76
- *
77
- * It is assumed that the supplied `numberConstraints` satisfy the following criteria:
78
- * * `maximum` must not be less than or equal to `minimum`.
79
- * * If `maximum` and `minimum` are both defined:
80
- * * `maximum` must be a whole number of steps greater than `minimum`.
81
- * * `step` must not be greater than `maximum - minimum`.
82
- * @param value The value to be inspected.
83
- * @param numberConstraints The constraints to be applied to the value.
84
- * @returns A new value which satisfies the constraints.
85
- */
86
- export declare function enforceConstraints(value: number, numberConstraints: defs.NumberConstraints): number;
87
- /**
88
- * Retrieves the effective number slider values after applying various validation checks and bounds.
89
- * @param values The initial input values based on which the result is computed.
90
- * @param numberConstraints
91
- * @returns A sorted numeric array with user entered values, if valid and default values if not.
92
- */
93
- export declare function getNumberSliderValues(values: defs.Value | undefined, numberConstraints: defs.NumberConstraints, singleValue?: boolean): number[];
94
- /**
95
- * Checks if a form element's value is equal to the supplied value.
96
- * @param elementValue The current value of a Form Element.
97
- * @param newValue A new value for the Form Element.
98
- * @returns True if the element's current value and the new value are equal, false otherwise.
99
- */
100
- export declare function areValuesEqual(elementValue: defs.Value | undefined, newValue: defs.NumberRef | undefined): boolean;
101
- /**
102
- * A mark on the slider. This is a copy of the interface by the same name in @mui/base/useSlider.
103
- * We use string rather than React.Node so that we can share this between runtime and designer without discrepancies between the typings.
104
- */
105
- export interface Mark {
106
- value: number;
107
- label?: string;
108
- }
109
- /**
110
- * Gets marks to be used with the @vertigis/react-ui/Slider component.
111
- *
112
- * Returning `true` is a shortcut to tell the Slider to generate its own marks based on the step size.
113
- * This is only possible when `showMinMaxLabels` is false, though, as they are also rendered as marks.
114
- * When `showMinMaxLabels` and `showTickMarks` are both true, we need to manually generate all of the marks.
115
- * @param maximum The highest allowed value.
116
- * @param minimum The lowest allowed value.
117
- * @param step: The amount of change between values.
118
- * @param formatOptions The FormatOptions for formatting text on the labels.
119
- * @param showMinMaxLabels True if labels should be included for min and max, false otherwise.
120
- * @param showTickMarks True if tick marsks should be shown, false otherwise.
121
- * @returns The value for the marks property for the slider.
122
- */
123
- export declare function getMarks(maximum: number, minimum: number, step: number, formatOptions: FormatOptions, showMinMaxLabels: boolean, showTickMarks: boolean): boolean | Mark[];
124
- /**
125
- * Rounds a value to the specified number of decimals in a way that should avoid rounding errors.
126
- * This is based on an example found here:
127
- * https://medium.com/swlh/how-to-round-to-a-certain-number-of-decimal-places-in-javascript-ed74c471c1b8
128
- * @param value The value to be rounded.
129
- * @param decimalPlaces The number of decimal places to round to.
130
- * @returns An accurately rounded value.
131
- */
132
- export declare function roundAccurately(value: number, decimalPlaces: number): number;
133
- /**
134
- * Details about a symbol that is used to represent currency or percentage.
135
- */
136
- declare type SymbolInfo = {
137
- /**
138
- * Whether the symbol should appear at the start (before the value) or end (after it).
139
- */
140
- position: "start" | "end";
141
- /**
142
- * The symbol to displayed.
143
- */
144
- symbol: string;
145
- symbolCount?: number;
146
- integerCount?: number;
147
- };
148
- export declare function getCurrencySymbolInfo(locale: string, currency: string): SymbolInfo;
149
- export declare function getPercentSymbolInfo(locale: string): SymbolInfo;
150
- export {};
1
+ import * as defs from "./FormDefinition";
2
+ import { FormatOptions } from "./numberFormatter";
3
+ import { PropertyConstraints, PropertyConstraintsWithDefault } from "./utils";
4
+ /**
5
+ * Configuration for cleaning up a {@link defs.NumberFormat} used in producing a {@link defs.NumberConstraints}.
6
+ *
7
+ * This is a bit meta.
8
+ * * A `NumberConstraints` is used at runtime to ensure the value that a user entered is valid.
9
+ * * The `NumberConstraints` is generated from a `NumberFormat` which may only be partially defined, or may have values that are out of range.
10
+ * * We need to populate and validate the `NumberFormat` first of all before we can generate a valid `NumberConstraints`.
11
+ */
12
+ export interface NumberFormatConfiguration {
13
+ [key: string]: PropertyConstraints<any> | undefined;
14
+ lowerBound: PropertyConstraints<number>;
15
+ precision: PropertyConstraintsWithDefault<number>;
16
+ step: PropertyConstraintsWithDefault<number>;
17
+ upperBound: PropertyConstraints<number>;
18
+ }
19
+ export declare const defaultNumberFormatConfiguration: NumberFormatConfiguration;
20
+ /**
21
+ * Returns constraints to be used to ensure a value is a valid number for a form element.
22
+ *
23
+ * Non-numeric or missing values are replaced by defaults.
24
+ *
25
+ * The step is sanitized as follows:
26
+ * 1. If it is not a number it is set to 1.
27
+ * 2. If it is <= zero it is set to 1. (The @vertigis/react-ui/Slider gets stuck on the minimum value if the step is zero.)
28
+ * 2. It cannot be greater than the full range. (max-min)
29
+ * @param numberFormat The formatting options to use, typically configured on a Form Element.
30
+ * @param partialNumberFormatConfiguration Additional configuration specific to the caller. These are combined with the defaults.
31
+ * @returns A {@link defs.NumberConstraints} containing values that can be safely used in a component.
32
+ */
33
+ export declare function getNumberConstraints(numberFormat: defs.NumberFormat | undefined, partialNumberFormatConfiguration?: Partial<NumberFormatConfiguration>): defs.NumberConstraints;
34
+ /**
35
+ * Counts the number of decimal places in the specified custom format string and returns the result.
36
+ * The supplied value is treated as one of Microsoft's [Custom numeric format strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings)
37
+ *
38
+ * There are lots of unusual ways you can combine the supported characters, but for simplicity, we support the most common use case
39
+ * which is using `#` and numeric characters as placeholders.
40
+ * @param customFormat The custom format to be inspected.
41
+ * @returns The number of decimal places in `customFormat`.
42
+ */
43
+ export declare function countDecimalsInCustomFormat(customFormat: string | undefined): number;
44
+ /**
45
+ * Counts the number of decimal places in the specified number and returns the result.
46
+ * This uses Intl.NumberFormat rather than number.toString() to ensure that large numbers don't get converted to an exponential format.
47
+ *
48
+ * Despite this, it may not be accurate for very large numbers as it seems the decimal places might still be ignored.
49
+ * e.g. `(10 ** 21.5) + 0.123456789 and `(10 ** 21.5)` both return "3162277660168379400000".
50
+ * @param value The value to be inspected.
51
+ * @returns The number of decimal places in `value`.
52
+ */
53
+ export declare function countDecimalsInValue(value: number): number;
54
+ /**
55
+ * Determines how many decimal places should be used in presenting values to the user.
56
+ *
57
+ * There must be at least enough decimal places for the step size, although there could be more.
58
+ * @param precision A precision value, likely from element.format.precision.
59
+ * @param step The step size being used. This must be a validated step size from a NumberConstraints.
60
+ * @param partialNumberFormatConfiguration Any configuration to normalize the supplied precision.
61
+ * @returns The number of decimal places to be used to display values.
62
+ */
63
+ export declare function sanitizePrecision(precision: number | undefined, step: number, partialNumberFormatConfiguration?: Partial<NumberFormatConfiguration>): number;
64
+ /**
65
+ * Combines the provided configuration with the default and returns a new {@link NumberFormatConfiguration}.
66
+ * @param partialConfiguration Configuration to be added with the defaults.
67
+ * @returns The full set of constraints to use.
68
+ */
69
+ export declare function getNumberFormatConfiguration(partialConfiguration: Partial<NumberFormatConfiguration> | undefined): NumberFormatConfiguration;
70
+ /**
71
+ * Compares a value with some constraints and returns an adjusted value that satisfies the constraints. There are three considerations:
72
+ * 1. The value must be >= `minimum`. Otherwise it is changed to `minimum`.
73
+ * 2. The value must be <= `maximum`. Otherwise it is changed to `maximum`.
74
+ * 3. The value must land on a valid step between the bounds. Otherwise it is moved to the nearest step.
75
+ * This can only be enforced if `minimum` or `maximum` is specified.
76
+ *
77
+ * It is assumed that the supplied `numberConstraints` satisfy the following criteria:
78
+ * * `maximum` must not be less than or equal to `minimum`.
79
+ * * If `maximum` and `minimum` are both defined:
80
+ * * `maximum` must be a whole number of steps greater than `minimum`.
81
+ * * `step` must not be greater than `maximum - minimum`.
82
+ * @param value The value to be inspected.
83
+ * @param numberConstraints The constraints to be applied to the value.
84
+ * @returns A new value which satisfies the constraints.
85
+ */
86
+ export declare function enforceConstraints(value: number, numberConstraints: defs.NumberConstraints): number;
87
+ /**
88
+ * Retrieves the effective number slider values after applying various validation checks and bounds.
89
+ * @param values The initial input values based on which the result is computed.
90
+ * @param numberConstraints
91
+ * @returns A sorted numeric array with user entered values, if valid and default values if not.
92
+ */
93
+ export declare function getNumberSliderValues(values: defs.Value | undefined, numberConstraints: defs.NumberConstraints, singleValue?: boolean): number[];
94
+ /**
95
+ * Checks if a form element's value is equal to the supplied value.
96
+ * @param elementValue The current value of a Form Element.
97
+ * @param newValue A new value for the Form Element.
98
+ * @returns True if the element's current value and the new value are equal, false otherwise.
99
+ */
100
+ export declare function areValuesEqual(elementValue: defs.Value | undefined, newValue: defs.NumberRef | undefined): boolean;
101
+ /**
102
+ * A mark on the slider. This is a copy of the interface by the same name in @mui/base/useSlider.
103
+ * We use string rather than React.Node so that we can share this between runtime and designer without discrepancies between the typings.
104
+ */
105
+ export interface Mark {
106
+ value: number;
107
+ label?: string;
108
+ }
109
+ /**
110
+ * Gets marks to be used with the @vertigis/react-ui/Slider component.
111
+ *
112
+ * Returning `true` is a shortcut to tell the Slider to generate its own marks based on the step size.
113
+ * This is only possible when `showMinMaxLabels` is false, though, as they are also rendered as marks.
114
+ * When `showMinMaxLabels` and `showTickMarks` are both true, we need to manually generate all of the marks.
115
+ * @param maximum The highest allowed value.
116
+ * @param minimum The lowest allowed value.
117
+ * @param step: The amount of change between values.
118
+ * @param formatOptions The FormatOptions for formatting text on the labels.
119
+ * @param showMinMaxLabels True if labels should be included for min and max, false otherwise.
120
+ * @param showTickMarks True if tick marsks should be shown, false otherwise.
121
+ * @returns The value for the marks property for the slider.
122
+ */
123
+ export declare function getMarks(maximum: number, minimum: number, step: number, formatOptions: FormatOptions, showMinMaxLabels: boolean, showTickMarks: boolean): boolean | Mark[];
124
+ /**
125
+ * Rounds a value to the specified number of decimals in a way that should avoid rounding errors.
126
+ * This is based on an example found here:
127
+ * https://medium.com/swlh/how-to-round-to-a-certain-number-of-decimal-places-in-javascript-ed74c471c1b8
128
+ * @param value The value to be rounded.
129
+ * @param decimalPlaces The number of decimal places to round to.
130
+ * @returns An accurately rounded value.
131
+ */
132
+ export declare function roundAccurately(value: number, decimalPlaces: number): number;
133
+ /**
134
+ * Details about a symbol that is used to represent currency or percentage.
135
+ */
136
+ type SymbolInfo = {
137
+ /**
138
+ * Whether the symbol should appear at the start (before the value) or end (after it).
139
+ */
140
+ position: "start" | "end";
141
+ /**
142
+ * The symbol to displayed.
143
+ */
144
+ symbol: string;
145
+ symbolCount?: number;
146
+ integerCount?: number;
147
+ };
148
+ export declare function getCurrencySymbolInfo(locale: string, currency: string): SymbolInfo | undefined;
149
+ export declare function getPercentSymbolInfo(locale: string): SymbolInfo | undefined;
150
+ export {};
@@ -1 +1 @@
1
- import{format}from"./numberFormatter.js";import{isNumberRef,isNumeric}from"./utils.js";const defaultNumberFormatConfiguration={lowerBound:{default:0},precision:{default:3,minimum:-20,maximum:20},step:{default:1},upperBound:{default:100}};function getNumberConstraints(e,r){var{lowerBound:t,upperBound:n}=e=e||{};let{precision:i,step:u}=e;var o,r=getNumberFormatConfiguration(r);let a=isNumeric(t)?t:r.lowerBound.default,m=isNumeric(n)?n:r.upperBound.default;return void 0!==m&&void 0!==a&&m<=a&&(a=r.lowerBound.default,m=r.upperBound.default),i="number"!=typeof i||Number.isNaN(i)?r.precision.default:i,void 0!==r.precision.minimum&&(i=Math.max(i,r.precision.minimum)),void 0!==r.precision.maximum&&(i=Math.min(i,r.precision.maximum)),i<0?(o=Math.pow(10,-1*i),void 0!==u&&u%o==0||(u=o)):(u=isNumeric(u)&&0<u?u:r.step.default,void 0!==m&&void 0!==a&&(u=Math.min(u,m-a),o=(m-a)/u,Number.isInteger(o)||(r=countDecimalsInValue(u),m=roundAccurately(a+Math.floor(o)*u,r)))),{maximum:m,minimum:a,step:u}}const intlNumberFormat=new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:20,useGrouping:!1}),customDecimals=/\.([#\d]+)/;function countDecimalsInCustomFormat(e){if(e){e=customDecimals.exec(e);if(e)return e[1].length}return 0}function countDecimalsInValue(e){if(Number.isInteger(e))return 0;const r=intlNumberFormat.format(e);e=r.indexOf(".");return-1===e?0:r.length-e-1}function sanitizePrecision(e,r,t){t=getNumberFormatConfiguration(t);void 0===e&&(e=t.precision.default);r=countDecimalsInValue(r);return Math.max(r,e)}function getNumberFormatConfiguration(e){const r={lowerBound:{...defaultNumberFormatConfiguration.lowerBound},precision:{...defaultNumberFormatConfiguration.precision},step:{...defaultNumberFormatConfiguration.step},upperBound:{...defaultNumberFormatConfiguration.upperBound}};if(void 0!==e)for(const t in e)r[t]=Object.assign(r[t],e[t]);return r}function enforceConstraints(e,r){var t,n,{maximum:i,minimum:u,step:r}=r;return void 0!==u?(t=(e-u)/r,Number.isInteger(t)||(n=countDecimalsInValue(r),e=roundAccurately(u+Math.round(t)*r,n))):void 0!==i&&(t=(i-e)/r,Number.isInteger(t)||(n=countDecimalsInValue(r),e=roundAccurately(i-Math.round(t)*r,n))),void 0!==u&&e<u&&(e=u),e=void 0!==i&&i<e?i:e}function getNumberSliderValues(e,r,t=!1){let n=[],i=NaN,u=NaN;if("string"==typeof e){const a=e.split("\n").filter(e=>""!==e);e=a.map(e=>(e=>(e=(e||"").trim(),isNumeric(e)?parseFloat(e):NaN))(e))}else"number"==typeof e?i=e:"number"==typeof e?.numeric&&(i=e.numeric);if(Array.isArray(e)&&1<=e.length&&(i=e[0],u=e[1]),void 0===i||isNaN(i)||(i=enforceConstraints(i,r),void 0===u||isNaN(u)?t&&n.push(i):(u=enforceConstraints(u,r),n.push(i,u))),n=n.sort((e,r)=>e-r),n.length===(t?1:2))return n;var o=r.maximum,e=r.minimum;return t?[enforceConstraints((e+o)/2,r)]:[e,o]}function areValuesEqual(e,r){if(void 0===e&&void 0===r||null===e&&null===r)return!0;var t,n;return!(!isNumberRef(e)||!isNumberRef(r))&&(e.display===r.display&&e.refValueType===r.refValueType&&e.numeric===r.numeric&&(t=e.format,n=r.format,void 0===t&&void 0===n||void 0!==t&&void 0!==n&&(t.currency===n.currency&&t.customDisplayFormat===n.customDisplayFormat&&t.displayFormat===n.displayFormat&&t.lowerBound===n.lowerBound&&t.precision===n.precision&&t.step===n.step&&t.upperBound===n.upperBound)))}function getMarks(r,t,n,e,i,u){if(i&&u){const o=[{value:t,label:format(e,t)}];for(let e=t+n;e<r;e+=n)o.push({value:e});return o.push({value:r,label:format(e,r)}),o}return i&&!u?[{value:t,label:format(e,t)},{value:r,label:format(e,r)}]:u}function roundAccurately(e,r){return Number(Math.round(Number(e+`e${r}`))+`e-${r}`)}function getCurrencySymbolInfo(e,r){const t=new Intl.NumberFormat(e,{style:"currency",currency:r,minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:!1}),n=t.formatToParts(0);e=n.filter(e=>"currency"===e.type)[0],r=n.filter(e=>"integer"===e.type)[0];if(e&&r)return{position:n.indexOf(e)<n.indexOf(r)?"start":"end",symbol:e.value}}function getPercentSymbolInfo(e){const r=new Intl.NumberFormat(e,{style:"percent",minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:!1}),t=r.formatToParts(0);var n=t.filter(e=>"percentSign"===e.type)[0],e=t.filter(e=>"integer"===e.type)[0];if(n&&e)return{position:t.indexOf(n)<t.indexOf(e)?"start":"end",symbol:n.value}}export{defaultNumberFormatConfiguration,getNumberConstraints,countDecimalsInCustomFormat,countDecimalsInValue,sanitizePrecision,getNumberFormatConfiguration,enforceConstraints,getNumberSliderValues,areValuesEqual,getMarks,roundAccurately,getCurrencySymbolInfo,getPercentSymbolInfo};
1
+ import{format}from"./numberFormatter.js";import{isNumberRef,isNumeric}from"./utils.js";const defaultNumberFormatConfiguration={lowerBound:{default:0},precision:{default:3,minimum:-20,maximum:20},step:{default:1},upperBound:{default:100}};function getNumberConstraints(e,r){var{lowerBound:t,upperBound:n}=e=e||{};let{precision:i,step:u}=e;var o,r=getNumberFormatConfiguration(r);let a=isNumeric(t)?t:r.lowerBound.default,m=isNumeric(n)?n:r.upperBound.default;return void 0!==m&&void 0!==a&&m<=a&&(a=r.lowerBound.default,m=r.upperBound.default),i="number"!=typeof i||Number.isNaN(i)?r.precision.default:i,void 0!==r.precision.minimum&&(i=Math.max(i,r.precision.minimum)),void 0!==r.precision.maximum&&(i=Math.min(i,r.precision.maximum)),i<0?(o=Math.pow(10,-1*i),void 0!==u&&u%o==0||(u=o)):(u=isNumeric(u)&&0<u?u:r.step.default,void 0!==m&&void 0!==a&&(u=Math.min(u,m-a),o=(m-a)/u,Number.isInteger(o)||(r=countDecimalsInValue(u),m=roundAccurately(a+Math.floor(o)*u,r)))),{maximum:m,minimum:a,step:u}}const intlNumberFormat=new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:20,useGrouping:!1}),customDecimals=/\.([#\d]+)/;function countDecimalsInCustomFormat(e){if(e){e=customDecimals.exec(e);if(e)return e[1].length}return 0}function countDecimalsInValue(e){if(Number.isInteger(e))return 0;const r=intlNumberFormat.format(e);e=r.indexOf(".");return-1===e?0:r.length-e-1}function sanitizePrecision(e,r,t){t=getNumberFormatConfiguration(t);void 0===e&&(e=t.precision.default);r=countDecimalsInValue(r);return Math.max(r,e)}function getNumberFormatConfiguration(e){const r={lowerBound:{...defaultNumberFormatConfiguration.lowerBound},precision:{...defaultNumberFormatConfiguration.precision},step:{...defaultNumberFormatConfiguration.step},upperBound:{...defaultNumberFormatConfiguration.upperBound}};if(void 0!==e)for(const t in e)r[t]=Object.assign(r[t]||{},e[t]);return r}function enforceConstraints(e,r){var t,n,{maximum:i,minimum:u,step:r}=r;return void 0!==u?(t=(e-u)/r,Number.isInteger(t)||(n=countDecimalsInValue(r),e=roundAccurately(u+Math.round(t)*r,n))):void 0!==i&&(t=(i-e)/r,Number.isInteger(t)||(n=countDecimalsInValue(r),e=roundAccurately(i-Math.round(t)*r,n))),void 0!==u&&e<u&&(e=u),e=void 0!==i&&i<e?i:e}function getNumberSliderValues(e,r,t=!1){let n=[],i=NaN,u=NaN;if("string"==typeof e){const a=e.split("\n").filter(e=>""!==e);e=a.map(e=>(e=>(e=(e||"").trim(),isNumeric(e)?parseFloat(e):NaN))(e))}else"number"==typeof e?i=e:"number"==typeof e?.numeric&&(i=e.numeric);if(Array.isArray(e)&&1<=e.length&&(i=e[0],u=e[1]),void 0===i||isNaN(i)||(i=enforceConstraints(i,r),void 0===u||isNaN(u)?t&&n.push(i):(u=enforceConstraints(u,r),n.push(i,u))),n=n.sort((e,r)=>e-r),n.length===(t?1:2))return n;var o=r.maximum,e=r.minimum;return t?[enforceConstraints((e+o)/2,r)]:[e,o]}function areValuesEqual(e,r){if(void 0===e&&void 0===r||null===e&&null===r)return!0;var t,n;return!(!isNumberRef(e)||!isNumberRef(r))&&(e.display===r.display&&e.refValueType===r.refValueType&&e.numeric===r.numeric&&(t=e.format,n=r.format,void 0===t&&void 0===n||void 0!==t&&void 0!==n&&(t.currency===n.currency&&t.customDisplayFormat===n.customDisplayFormat&&t.displayFormat===n.displayFormat&&t.lowerBound===n.lowerBound&&t.precision===n.precision&&t.step===n.step&&t.upperBound===n.upperBound)))}function getMarks(r,t,n,e,i,u){if(i&&u){const o=[{value:t,label:format(e,t)}];for(let e=t+n;e<r;e+=n)o.push({value:e});return o.push({value:r,label:format(e,r)}),o}return i&&!u?[{value:t,label:format(e,t)},{value:r,label:format(e,r)}]:u}function roundAccurately(e,r){return Number(Math.round(Number(e+`e${r}`))+`e-${r}`)}function getCurrencySymbolInfo(e,r){const t=new Intl.NumberFormat(e,{style:"currency",currency:r,minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:!1}),n=t.formatToParts(0);e=n.filter(e=>"currency"===e.type)[0],r=n.filter(e=>"integer"===e.type)[0];if(e&&r)return{position:n.indexOf(e)<n.indexOf(r)?"start":"end",symbol:e.value}}function getPercentSymbolInfo(e){const r=new Intl.NumberFormat(e,{style:"percent",minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:!1}),t=r.formatToParts(0);var n=t.filter(e=>"percentSign"===e.type)[0],e=t.filter(e=>"integer"===e.type)[0];if(n&&e)return{position:t.indexOf(n)<t.indexOf(e)?"start":"end",symbol:n.value}}export{defaultNumberFormatConfiguration,getNumberConstraints,countDecimalsInCustomFormat,countDecimalsInValue,sanitizePrecision,getNumberFormatConfiguration,enforceConstraints,getNumberSliderValues,areValuesEqual,getMarks,roundAccurately,getCurrencySymbolInfo,getPercentSymbolInfo};
@@ -1,21 +1,21 @@
1
- import { FormPresenterHost } from "./FormComponent";
2
- export declare function refresh(component: {}): void;
3
- /**
4
- * Refreshes an element.
5
- * @param host The host for the presenter.
6
- * @param name The name of the element to refresh.
7
- */
8
- export declare function refreshForm(host: FormPresenterHost, container: Element): void;
9
- /**
10
- * Releases the underlying visual for the element.
11
- * @product This is intended for internal use only within VertiGIS Studio products.
12
- * @param element The element to release from.
13
- */
14
- export declare function releaseForm(container: HTMLElement): void;
15
- /** Renders a component's visual. */
16
- export declare function render(component: {}): any;
17
- /**
18
- * Renders an element with a placeholder.
19
- * @param owner
20
- */
21
- export declare function renderNone(component: {}): any;
1
+ import { FormPresenterHost } from "./FormComponent";
2
+ export declare function refresh(component: {}): void;
3
+ /**
4
+ * Refreshes an element.
5
+ * @param host The host for the presenter.
6
+ * @param name The name of the element to refresh.
7
+ */
8
+ export declare function refreshForm(host: FormPresenterHost, container: Element): void;
9
+ /**
10
+ * Releases the underlying visual for the element.
11
+ * @product This is intended for internal use only within VertiGIS Studio products.
12
+ * @param element The element to release from.
13
+ */
14
+ export declare function releaseForm(container: HTMLElement): void;
15
+ /** Renders a component's visual. */
16
+ export declare function render(component: {}): any;
17
+ /**
18
+ * Renders an element with a placeholder.
19
+ * @param owner
20
+ */
21
+ export declare function renderNone(component: {}): any;
@@ -1 +1 @@
1
- import{createElement}from"react";import*as React from"react";import{unmountComponentAtNode,render as reactRender}from"react-dom";import{FormComponent}from"./FormComponent.js";import Custom from"./components/Custom.js";import{FormComponentTypes,FormElementTypes}from"./constants.js";import{renderComponent,renderElement,renderNone as renderers_renderNone}from"./renderers.js";import{getElementProps}from"./utils.js";function refresh(e){e instanceof FormComponent&&e.forceUpdate()}function refreshForm(e,r){reactRender(React.createElement(FormComponent,{host:e,type:"form"}),r)}function releaseForm(e){unmountComponentAtNode(e)}function render(e){if(e instanceof FormComponent){if(e.props.type!==FormComponentTypes.ELEMENT)return renderComponent(e);var r=e.prepare();if(null==r)return;var n=r.type;return"string"!=typeof n?void 0:e.elementRegistration?createElement(e.elementRegistration.component,getElementProps(e,r)):n===FormElementTypes.CUSTOM?createElement(Custom,getElementProps(e,r)):renderElement(n,e,r)}}function renderNone(e){if(e instanceof FormComponent)return renderers_renderNone(e)}export{refresh,refreshForm,releaseForm,render,renderNone};
1
+ import{createElement}from"react";import*as React from"react";import{unmountComponentAtNode,render as reactRender}from"react-dom";import{FormComponent}from"./FormComponent.js";import Custom from"./components/Custom.js";import{FormComponentTypes,FormElementTypes}from"./constants.js";import{renderComponent,renderNone as renderers_renderNone}from"./renderers.js";import{getElementProps}from"./utils.js";function refresh(e){e instanceof FormComponent&&e.forceUpdate()}function refreshForm(e,r){reactRender(React.createElement(FormComponent,{host:e,type:"form",children:[]}),r)}function releaseForm(e){unmountComponentAtNode(e)}function render(e){if(e instanceof FormComponent){var r=e.props.type;if(r!==FormComponentTypes.ELEMENT&&r!==FormComponentTypes.SECTION)return renderComponent(e);var n=e.prepare();if(null==n)return;r=n.type;if("string"!=typeof r)return;if(r===FormElementTypes.CUSTOM)return createElement(Custom,getElementProps(e,n));if(e.elementRegistration)return createElement(e.elementRegistration.component,getElementProps(e,n))}}function renderNone(e){if(e instanceof FormComponent)return renderers_renderNone(e)}export{refresh,refreshForm,releaseForm,render,renderNone};
@@ -1,8 +1,5 @@
1
- /// <reference types="react" />
2
- import { FormComponent } from "./FormComponent";
3
- import { Element } from "./FormDefinition";
4
- /** @product This is intended for internal use only within VertiGIS Studio products. */
5
- export declare function renderComponent(component: FormComponent): JSX.Element;
6
- export declare function renderNone(component: FormComponent): any;
7
- /** @product This is intended for internal use only within VertiGIS Studio products. */
8
- export declare function renderElement(type: string, component: FormComponent, element: Element): JSX.Element;
1
+ /// <reference types="react" />
2
+ import { FormComponent } from "./FormComponent";
3
+ /** @product This is intended for internal use only within VertiGIS Studio products. */
4
+ export declare function renderComponent(component: FormComponent): JSX.Element | null;
5
+ export declare function renderNone(component: FormComponent): any;