@vertigis/workflow 5.33.1 → 5.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Activator.d.ts +6 -2
- package/Collections.d.ts +8 -5
- package/EnumUtils.d.ts +1 -0
- package/Errors.d.ts +10 -1
- package/Errors.js +1 -1
- package/Hooks.d.ts +4 -1
- package/IActivityHandler.d.ts +20 -6
- package/LanguageStringUtils.js +1 -1
- package/ProgramInspectorFacility.d.ts +1 -0
- package/Task.d.ts +1 -0
- package/activities/app/GetApplicationData.d.ts +2 -2
- package/activities/app/GetApplicationInfo.d.ts +6 -3
- package/activities/app/GetUserInfo.d.ts +6 -3
- package/activities/app/PublishEvent.d.ts +2 -2
- package/activities/app/RemoveApplicationData.d.ts +2 -2
- package/activities/app/RunCommand.d.ts +6 -3
- package/activities/app/RunOperation.d.ts +10 -4
- package/activities/app/SetApplicationData.d.ts +2 -2
- package/activities/arcgis/AddAttachment.d.ts +2 -2
- package/activities/arcgis/AddFeatureLayer.d.ts +2 -2
- package/activities/arcgis/AddFeatures.d.ts +2 -2
- package/activities/arcgis/AddFeatures.js +1 -1
- package/activities/arcgis/AddGraphics.d.ts +10 -4
- package/activities/arcgis/ArcadeScript.d.ts +2 -2
- package/activities/arcgis/AreaEngineTask.d.ts +2 -2
- package/activities/arcgis/BufferEngineTask.d.ts +2 -2
- package/activities/arcgis/BufferServiceTask.d.ts +2 -2
- package/activities/arcgis/CastGeometry.d.ts +2 -2
- package/activities/arcgis/ClearGraphics.d.ts +2 -2
- package/activities/arcgis/ClipEngineTask.d.ts +2 -2
- package/activities/arcgis/ClosestFacilityTask.d.ts +2 -2
- package/activities/arcgis/CompareGeometries.d.ts +2 -2
- package/activities/arcgis/CreateGraphic.d.ts +2 -2
- package/activities/arcgis/CreatePoint.d.ts +2 -2
- package/activities/arcgis/CutEngineTask.d.ts +2 -2
- package/activities/arcgis/DeleteAttachments.d.ts +2 -2
- package/activities/arcgis/DeleteFeatures.d.ts +2 -2
- package/activities/arcgis/DensifyEngineTask.d.ts +2 -2
- package/activities/arcgis/DifferenceEngineTask.d.ts +2 -2
- package/activities/arcgis/DistanceEngineTask.d.ts +2 -2
- package/activities/arcgis/DistanceServiceTask.d.ts +2 -2
- package/activities/arcgis/ExtendedSpatialReferenceInfoEngineTask.d.ts +2 -2
- package/activities/arcgis/FeatureSetFromJson.d.ts +2 -2
- package/activities/arcgis/FlipEngineTask.d.ts +2 -2
- package/activities/arcgis/FromGeoCoordinateStringServiceTask.d.ts +2 -2
- package/activities/arcgis/GeneralizeEngineTask.d.ts +2 -2
- package/activities/arcgis/GenerateArcGisToken.d.ts +2 -2
- package/activities/arcgis/GenerateWebmapForReport.d.ts +2 -2
- package/activities/arcgis/Geocode.d.ts +2 -2
- package/activities/arcgis/GeometryFromJson.d.ts +2 -2
- package/activities/arcgis/Geoprocessing.d.ts +2 -2
- package/activities/arcgis/GeoprocessingAsync.d.ts +2 -2
- package/activities/arcgis/GetAttributeValue.d.ts +2 -2
- package/activities/arcgis/GetAttributeValues.d.ts +2 -2
- package/activities/arcgis/GetCentroid.d.ts +2 -2
- package/activities/arcgis/GetCodedValueDomain.d.ts +2 -2
- package/activities/arcgis/GetCurrentPosition.d.ts +2 -2
- package/activities/arcgis/GetFeatureGeometries.d.ts +2 -2
- package/activities/arcgis/GetFeatureGeometry.d.ts +2 -2
- package/activities/arcgis/GetFeatureLayerInfo.d.ts +2 -2
- package/activities/arcgis/GetFeatureSetExtent.d.ts +2 -2
- package/activities/arcgis/GetFeatureSetObjectIds.d.ts +2 -2
- package/activities/arcgis/GetFormElementItemsFromFeatures.d.ts +2 -2
- package/activities/arcgis/GetGeometryExtent.d.ts +2 -2
- package/activities/arcgis/GetGraphics.d.ts +2 -2
- package/activities/arcgis/GetLayer.d.ts +2 -2
- package/activities/arcgis/GetLayerDefinitionExpression.d.ts +2 -2
- package/activities/arcgis/GetLayerProperty.d.ts +2 -2
- package/activities/arcgis/GetLayerVisibility.d.ts +2 -2
- package/activities/arcgis/GetMap.d.ts +2 -2
- package/activities/arcgis/GetMapScreenshot.d.ts +2 -2
- package/activities/arcgis/GetPortalUser.d.ts +2 -2
- package/activities/arcgis/GetTable.d.ts +2 -2
- package/activities/arcgis/GetViewExtent.d.ts +2 -2
- package/activities/arcgis/GetViewpoint.d.ts +2 -2
- package/activities/arcgis/IntersectEngineTask.d.ts +2 -2
- package/activities/arcgis/LabelPointsServiceTask.d.ts +2 -2
- package/activities/arcgis/LengthEngineTask.d.ts +2 -2
- package/activities/arcgis/MapProvider.d.ts +4 -1
- package/activities/arcgis/NearestCoordinateEngineTask.d.ts +2 -2
- package/activities/arcgis/NearestVertexEngineTask.d.ts +2 -2
- package/activities/arcgis/NearestVerticesEngineTask.d.ts +2 -2
- package/activities/arcgis/OffsetEngineTask.d.ts +2 -2
- package/activities/arcgis/ProjectServiceTask.d.ts +2 -2
- package/activities/arcgis/QueryAttachmentInfos.d.ts +2 -2
- package/activities/arcgis/QueryTask.d.ts +10 -4
- package/activities/arcgis/RefreshLayer.d.ts +2 -2
- package/activities/arcgis/RegisterCorsUrl.d.ts +2 -2
- package/activities/arcgis/RelateEngineTask.d.ts +2 -2
- package/activities/arcgis/RelationServiceTask.d.ts +2 -2
- package/activities/arcgis/RelationshipQueryTask.d.ts +2 -2
- package/activities/arcgis/RemoveFeatureSetFields.d.ts +2 -2
- package/activities/arcgis/RemoveGraphics.d.ts +2 -2
- package/activities/arcgis/RemoveLayer.d.ts +2 -2
- package/activities/arcgis/RendererFromJson.d.ts +2 -2
- package/activities/arcgis/ReshapeServiceTask.d.ts +2 -2
- package/activities/arcgis/ReverseGeocode.d.ts +2 -2
- package/activities/arcgis/RotateEngineTask.d.ts +2 -2
- package/activities/arcgis/RouteTask.d.ts +2 -2
- package/activities/arcgis/RunPrint.d.ts +2 -2
- package/activities/arcgis/RunReport.d.ts +2 -2
- package/activities/arcgis/RunWorkflow.d.ts +21 -3
- package/activities/arcgis/RunWorkflow.js +1 -1
- package/activities/arcgis/SendLayerToAttributeTable.d.ts +2 -2
- package/activities/arcgis/ServiceAreaTask.d.ts +2 -2
- package/activities/arcgis/SetFeatureAttribute.d.ts +2 -2
- package/activities/arcgis/SetFeatureGeometry.d.ts +2 -2
- package/activities/arcgis/SetFeaturePopup.d.ts +2 -2
- package/activities/arcgis/SetFeatureSymbol.d.ts +2 -2
- package/activities/arcgis/SetImageryLayerOptions.d.ts +2 -2
- package/activities/arcgis/SetLayerDefinitionExpression.d.ts +2 -2
- package/activities/arcgis/SetLayerPopup.d.ts +2 -2
- package/activities/arcgis/SetLayerProperty.d.ts +2 -2
- package/activities/arcgis/SetLayerVisibility.d.ts +2 -2
- package/activities/arcgis/SetMap.d.ts +6 -3
- package/activities/arcgis/SetViewExtent.d.ts +2 -2
- package/activities/arcgis/SetViewpoint.d.ts +2 -2
- package/activities/arcgis/ShowFeaturePopup.d.ts +2 -2
- package/activities/arcgis/ShowResults.d.ts +5 -2
- package/activities/arcgis/SimplifyEngineTask.d.ts +2 -2
- package/activities/arcgis/SortFeatureSet.d.ts +2 -2
- package/activities/arcgis/SymbolFromJson.d.ts +2 -2
- package/activities/arcgis/ToGeoCoordinateStringServiceTask.d.ts +2 -2
- package/activities/arcgis/UnionEngineTask.d.ts +2 -2
- package/activities/arcgis/UnionServiceTask.d.ts +2 -2
- package/activities/arcgis/UpdateAttachment.d.ts +2 -2
- package/activities/arcgis/UpdateFeatures.d.ts +2 -2
- package/activities/arcgis/runUtils.d.ts +6 -2
- package/activities/browser/GetBrowserInfo.d.ts +2 -2
- package/activities/browser/InjectCss.d.ts +2 -2
- package/activities/core/AddItem.d.ts +2 -2
- package/activities/core/AddItems.d.ts +2 -2
- package/activities/core/Annotation.d.ts +2 -2
- package/activities/core/Cast.d.ts +2 -2
- package/activities/core/ChannelProvider.d.ts +1 -0
- package/activities/core/ClearItems.d.ts +2 -2
- package/activities/core/Container.d.ts +2 -2
- package/activities/core/ConvertBytesToText.d.ts +2 -2
- package/activities/core/ConvertDataTableToFeatureSet.d.ts +2 -2
- package/activities/core/ConvertTextToBytes.d.ts +2 -2
- package/activities/core/ConvertToJson.d.ts +2 -2
- package/activities/core/CreateFile.d.ts +2 -2
- package/activities/core/CreateValue.d.ts +2 -2
- package/activities/core/DecodeUriComponent.d.ts +2 -2
- package/activities/core/Delay.d.ts +2 -2
- package/activities/core/EncodeUriComponent.d.ts +2 -2
- package/activities/core/Evaluate.d.ts +2 -2
- package/activities/core/EvaluateAsync.d.ts +2 -2
- package/activities/core/Exit.d.ts +2 -2
- package/activities/core/ForEach.d.ts +2 -2
- package/activities/core/FormatDate.d.ts +5 -5
- package/activities/core/FormatDate.js +1 -1
- package/activities/core/GetBase64StringFromBytes.d.ts +2 -2
- package/activities/core/GetBase64StringFromFile.d.ts +2 -2
- package/activities/core/GetBytesFromBase64String.d.ts +2 -2
- package/activities/core/GetFirstItem.d.ts +2 -2
- package/activities/core/GetItemAtIndex.d.ts +2 -2
- package/activities/core/GetLastItem.d.ts +2 -2
- package/activities/core/GetLogLevel.d.ts +2 -2
- package/activities/core/GetTextFromFile.d.ts +2 -2
- package/activities/core/GetWorkflowInputs.d.ts +2 -2
- package/activities/core/If.d.ts +2 -2
- package/activities/core/Log.d.ts +2 -2
- package/activities/core/Loop.d.ts +2 -2
- package/activities/core/ParseJson.d.ts +2 -2
- package/activities/core/ParseNumber.d.ts +2 -2
- package/activities/core/ParseUrl.d.ts +2 -2
- package/activities/core/Placeholder.d.ts +2 -2
- package/activities/core/RegexMatches.d.ts +2 -2
- package/activities/core/RegexReplace.d.ts +2 -2
- package/activities/core/RemoveItem.d.ts +2 -2
- package/activities/core/RunActivity.d.ts +2 -2
- package/activities/core/RunSubworkflow.d.ts +2 -2
- package/activities/core/SetLogLevel.d.ts +2 -2
- package/activities/core/SetProperty.d.ts +2 -2
- package/activities/core/SetWorkflowOutput.d.ts +2 -2
- package/activities/core/Subworkflow.d.ts +2 -2
- package/activities/core/Switch.d.ts +2 -2
- package/activities/core/TextReplace.d.ts +2 -2
- package/activities/core/Throw.d.ts +2 -2
- package/activities/core/TryCatch.d.ts +2 -2
- package/activities/core/WebRequest.d.ts +2 -2
- package/activities/core/converters.d.ts +1 -1
- package/activities/csv/ConvertCsvToDataTable.d.ts +2 -2
- package/activities/csv/ConvertDataTableToCsv.d.ts +2 -2
- package/activities/essentials/GetEssentialsSite.d.ts +2 -2
- package/activities/essentials/RunEssentialsWorkflow.d.ts +2 -2
- package/activities/essentials/RunEssentialsWorkflowActivity.d.ts +2 -2
- package/activities/forms/ActivateFormElement.d.ts +2 -2
- package/activities/forms/AddFormElement.d.ts +2 -2
- package/activities/forms/ClearFormElementError.d.ts +2 -2
- package/activities/forms/CompleteForm.d.ts +2 -2
- package/activities/forms/DisplayForm.d.ts +6 -3
- package/activities/forms/FilterFormElementItems.d.ts +2 -2
- package/activities/forms/FormRenderer.d.ts +1 -0
- package/activities/forms/FormRenderer.js +1 -1
- package/activities/forms/GetFormElementItemsFromCollection.d.ts +2 -2
- package/activities/forms/GetFormElementProperty.d.ts +2 -2
- package/activities/forms/GetFormElementValue.d.ts +2 -2
- package/activities/forms/GetFormEventData.d.ts +2 -2
- package/activities/forms/HideFormElement.d.ts +2 -2
- package/activities/forms/PropagateFormEvent.d.ts +2 -2
- package/activities/forms/SetCurrentFormElementItem.d.ts +2 -2
- package/activities/forms/SetFormElementError.d.ts +2 -2
- package/activities/forms/SetFormElementEvent.d.ts +2 -2
- package/activities/forms/SetFormElementItemProperty.d.ts +2 -2
- package/activities/forms/SetFormElementItems.d.ts +2 -2
- package/activities/forms/SetFormElementProperty.d.ts +3 -3
- package/activities/forms/ShowFormElement.d.ts +2 -2
- package/activities/image/GetImageMetadata.d.ts +2 -2
- package/activities/image/RotateImage.d.ts +2 -2
- package/activities/index.d.ts +1 -0
- package/activities/index.js +1 -1
- package/activities/math/Abs.d.ts +2 -2
- package/activities/math/Cos.d.ts +2 -2
- package/activities/math/Max.d.ts +2 -2
- package/activities/math/Min.d.ts +2 -2
- package/activities/math/Pow.d.ts +2 -2
- package/activities/math/Random.d.ts +2 -2
- package/activities/math/Sin.d.ts +2 -2
- package/activities/math/Sqrt.d.ts +2 -2
- package/activities/math/Tan.d.ts +2 -2
- package/activities/pdf/AddGeoreferenceToPdf.d.ts +19 -0
- package/activities/pdf/AddGeoreferenceToPdf.js +1 -0
- package/activities/pdf/ExtractPdfPages.d.ts +2 -2
- package/activities/pdf/MergePdfs.d.ts +2 -2
- package/activities/server/CopyFile.d.ts +2 -2
- package/activities/server/CreateDirectory.d.ts +2 -2
- package/activities/server/CreateDownload.d.ts +2 -2
- package/activities/server/CreateEmailAttachment.d.ts +2 -2
- package/activities/server/CreateZipFromDirectory.d.ts +2 -2
- package/activities/server/DeleteDirectory.d.ts +2 -2
- package/activities/server/DeleteFile.d.ts +2 -2
- package/activities/server/DirectoryExists.d.ts +2 -2
- package/activities/server/ExtractZipToDirectory.d.ts +2 -2
- package/activities/server/FileExists.d.ts +2 -2
- package/activities/server/GetDirectoriesInDirectory.d.ts +2 -2
- package/activities/server/GetFilesInDirectory.d.ts +2 -2
- package/activities/server/MoveFile.d.ts +2 -2
- package/activities/server/ReadFile.d.ts +2 -2
- package/activities/server/ReadFileBytes.d.ts +2 -2
- package/activities/server/RunApplication.d.ts +2 -2
- package/activities/server/RunPython.d.ts +2 -2
- package/activities/server/SendEmail.d.ts +2 -2
- package/activities/server/SqlNonQuery.d.ts +2 -2
- package/activities/server/SqlQuery.d.ts +2 -2
- package/activities/server/SqlQueryUnsafe.d.ts +2 -2
- package/activities/server/WriteFile.d.ts +2 -2
- package/activities/server/WriteFileBytes.d.ts +2 -2
- package/activities/ui/Alert.d.ts +6 -3
- package/activities/ui/Confirm.d.ts +10 -4
- package/activities/ui/Prompt.d.ts +10 -4
- package/activities/wab/OpenWidget.d.ts +2 -2
- package/activities/wab/PublishWidgetData.d.ts +2 -2
- package/activities/xlsx/ConvertDataTableToXlsx.d.ts +2 -2
- package/activities/xlsx/ConvertXlsxToDataSet.d.ts +2 -2
- package/definition/Program.d.ts +4 -1
- package/definition/ProgramInspector.d.ts +4 -1
- package/definition/Reference.d.ts +4 -1
- package/diagnostics/ConsoleDebugLogger.d.ts +4 -1
- package/diagnostics/logging.d.ts +4 -1
- package/execution/ActivityLoader.d.ts +4 -1
- package/execution/Engine.d.ts +16 -4
- package/execution/IDebugSession.d.ts +4 -1
- package/execution/ProgramRunner.js +1 -1
- package/forms/Calendar.d.ts +1 -1
- package/forms/FormComponent.d.ts +4 -3
- package/forms/FormComponent.js +1 -1
- package/forms/FormDefinition.d.ts +100 -19
- package/forms/FormElement.d.ts +3 -17
- package/forms/FormElement.js +1 -1
- package/forms/FormHost.d.ts +29 -8
- package/forms/FormHost.js +1 -1
- package/forms/FormPresenterHost.d.ts +33 -7
- package/forms/common.d.ts +6 -7
- package/forms/common.js +1 -1
- package/forms/components/AccordionGroup.d.ts +15 -0
- package/forms/components/AccordionGroup.js +1 -0
- package/forms/components/AutoComplete.d.ts +7 -0
- package/forms/components/AutoComplete.js +1 -0
- package/forms/components/ButtonBar.d.ts +13 -0
- package/forms/components/ButtonBar.js +1 -0
- package/forms/components/CheckBox.d.ts +7 -0
- package/forms/components/CheckBox.js +1 -0
- package/forms/components/CheckGroup.d.ts +7 -0
- package/forms/components/CheckGroup.js +1 -0
- package/forms/components/Custom.d.ts +7 -0
- package/forms/components/Custom.js +1 -0
- package/forms/components/DatePicker.d.ts +6 -16
- package/forms/components/DatePicker.js +1 -1
- package/forms/components/DateRangePicker.d.ts +10 -8
- package/forms/components/DateRangePicker.js +1 -1
- package/forms/components/DateTimePicker.d.ts +6 -8
- package/forms/components/DateTimePicker.js +1 -1
- package/forms/components/DropDownList.d.ts +7 -0
- package/forms/components/DropDownList.js +1 -0
- package/forms/components/FilePicker.d.ts +9 -0
- package/forms/components/FilePicker.js +1 -0
- package/forms/components/Form.d.ts +23 -0
- package/forms/components/Form.js +1 -0
- package/forms/components/FormLabelNumberField.d.ts +15 -0
- package/forms/components/FormLabelNumberField.js +1 -0
- package/forms/components/GeometryPicker.d.ts +4 -0
- package/forms/components/GeometryPicker.js +1 -0
- package/forms/components/GeometryPickerListItem.d.ts +23 -0
- package/forms/components/GeometryPickerListItem.js +1 -0
- package/forms/components/HorizontalRule.d.ts +7 -0
- package/forms/components/HorizontalRule.js +1 -0
- package/forms/components/Image.d.ts +7 -0
- package/forms/components/Image.js +1 -0
- package/forms/components/ItemPicker.d.ts +17 -0
- package/forms/components/ItemPicker.js +1 -0
- package/forms/components/ListBox.d.ts +7 -0
- package/forms/components/ListBox.js +1 -0
- package/forms/components/Markdown.d.ts +1 -1
- package/forms/components/Markdown.js +1 -1
- package/forms/components/Number.d.ts +7 -0
- package/forms/components/Number.js +1 -0
- package/forms/components/NumberRangeSlider.d.ts +11 -8
- package/forms/components/NumberRangeSlider.js +1 -1
- package/forms/components/NumberSlider.d.ts +9 -8
- package/forms/components/NumberSlider.js +1 -1
- package/forms/components/RadioGroup.d.ts +7 -0
- package/forms/components/RadioGroup.js +1 -0
- package/forms/components/Scanner.d.ts +9 -0
- package/forms/components/Scanner.js +1 -0
- package/forms/components/Section.d.ts +14 -0
- package/forms/components/Section.js +1 -0
- package/forms/components/Signature.d.ts +11 -0
- package/forms/components/Signature.js +1 -0
- package/forms/components/SignatureDialog.d.ts +22 -0
- package/forms/components/SignatureDialog.js +1 -0
- package/forms/components/Text.d.ts +1 -1
- package/forms/components/Text.js +1 -1
- package/forms/components/TextArea.d.ts +1 -1
- package/forms/components/TextArea.js +1 -1
- package/forms/components/TextBox.d.ts +1 -1
- package/forms/components/TextBox.js +1 -1
- package/forms/components/TimePicker.d.ts +7 -0
- package/forms/components/TimePicker.js +1 -0
- package/forms/constants.d.ts +19 -31
- package/forms/constants.js +1 -1
- package/forms/dateUtilities.d.ts +41 -9
- package/forms/dateUtilities.js +1 -1
- package/forms/elements/AutoComplete.d.ts +7 -0
- package/forms/elements/AutoComplete.js +1 -0
- package/forms/elements/Number.d.ts +5 -0
- package/forms/elements/Number.js +1 -0
- package/forms/elements/NumberRangeSlider.d.ts +5 -3
- package/forms/elements/NumberRangeSlider.js +1 -1
- package/forms/elements/NumberSlider.d.ts +0 -3
- package/forms/elements/NumberSlider.js +0 -1
- package/forms/elements/Scanner.d.ts +9 -0
- package/forms/elements/Scanner.js +1 -0
- package/forms/elements/Signature.d.ts +16 -0
- package/forms/elements/Signature.js +1 -0
- package/forms/elements/types.d.ts +4 -2
- package/forms/index.d.ts +6 -2
- package/forms/index.js +1 -1
- package/forms/keyboard.d.ts +1 -0
- package/forms/numberFormatter.d.ts +5 -6
- package/forms/numberFormatter.js +1 -1
- package/forms/numberUtilities.d.ts +113 -0
- package/forms/numberUtilities.js +1 -0
- package/forms/presenter.d.ts +1 -0
- package/forms/presenter.js +1 -1
- package/forms/renderers.d.ts +5 -43
- package/forms/renderers.js +1 -1
- package/forms/textUtilities.d.ts +6 -4
- package/forms/textUtilities.js +1 -1
- package/forms/utils.d.ts +102 -20
- package/forms/utils.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +0 -1
- package/libs/version.d.ts +1 -1
- package/libs/version.js +1 -1
- package/package.json +10 -10
- package/app/ActivityPackUtils.d.ts +0 -10
- package/app/ActivityPackUtils.js +0 -1
- package/app/AppActivity.d.ts +0 -82
- package/app/AppActivity.js +0 -1
- package/app/RegisterCustomFormElementBase.d.ts +0 -34
- package/app/RegisterCustomFormElementBase.js +0 -1
- package/forms/LegacyStyles.d.ts +0 -498
- package/forms/LegacyStyles.js +0 -1
- package/forms/assets/arrow.d.ts +0 -4
- package/forms/assets/arrow.js +0 -1
- package/forms/assets/chevron.d.ts +0 -3
- package/forms/assets/chevron.js +0 -1
- package/forms/assets/cross.d.ts +0 -3
- package/forms/assets/cross.js +0 -1
- package/forms/assets/datetime.d.ts +0 -3
- package/forms/assets/datetime.js +0 -1
- package/forms/assets/remove.d.ts +0 -2
- package/forms/assets/remove.js +0 -1
- package/forms/assets/scan.d.ts +0 -4
- package/forms/assets/scan.js +0 -1
- package/forms/assets/stock.d.ts +0 -5
- package/forms/assets/stock.js +0 -1
- package/forms/components/DateRange.d.ts +0 -6
- package/forms/components/DateRange.js +0 -1
- package/forms/components/Navigator.d.ts +0 -1
- package/forms/components/Navigator.js +0 -1
- package/forms/components/ReactDateRangeCalendar.d.ts +0 -6
- package/forms/components/ReactDateRangeCalendar.js +0 -1
- package/forms/components/SyntheticButton.d.ts +0 -1
- package/forms/components/SyntheticButton.js +0 -1
- package/forms/components/TimePickerInput.d.ts +0 -24
- package/forms/components/TimePickerInput.js +0 -1
- package/forms/components/TimerManager.d.ts +0 -7
- package/forms/components/TimerManager.js +0 -1
- package/forms/components/utils.d.ts +0 -2
- package/forms/components/utils.js +0 -1
- package/forms/datetime.d.ts +0 -5
- package/forms/datetime.js +0 -1
- package/forms/files.d.ts +0 -4
- package/forms/files.js +0 -1
- package/forms/geometry.d.ts +0 -4
- package/forms/geometry.js +0 -1
- package/forms/number.d.ts +0 -11
- package/forms/number.js +0 -1
- package/forms/numberSliderUtilities.d.ts +0 -12
- package/forms/numberSliderUtilities.js +0 -1
- package/forms/scanner.d.ts +0 -4
- package/forms/scanner.js +0 -1
- package/forms/selectors.d.ts +0 -10
- package/forms/selectors.js +0 -1
- package/forms/styles/daterange.css +0 -1
- package/forms/styles/daterange.d.ts +0 -1
- package/forms/styles/daterange.js +0 -1
- package/forms/styles/stock.css +0 -1
- package/forms/styles/stock.d.ts +0 -1
- package/forms/styles/stock.js +0 -1
package/forms/numberFormatter.js
CHANGED
|
@@ -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={};if(1===t.length?
|
|
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};
|
|
@@ -0,0 +1,113 @@
|
|
|
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 number and returns the result.
|
|
36
|
+
* This uses Intl.NumberFormat rather than number.toString() to ensure that large numbers don't get converted to an exponential format.
|
|
37
|
+
*
|
|
38
|
+
* Despite this, it may not be accurate for very large numbers as it seems the decimal places might still be ignored.
|
|
39
|
+
* e.g. `(10 ** 21.5) + 0.123456789 and `(10 ** 21.5)` both return "3162277660168379400000".
|
|
40
|
+
* @param value The value to be inspected.
|
|
41
|
+
* @returns The number of decimal places in `value`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function countDecimalPlaces(value: number): number;
|
|
44
|
+
/**
|
|
45
|
+
* Determines how many decimal places should be used in presenting values to the user.
|
|
46
|
+
*
|
|
47
|
+
* There must be at least enough decimal places for the step size, although there could be more.
|
|
48
|
+
* @param precision A precision value, likely from element.format.precision.
|
|
49
|
+
* @param step The step size being used. This must be a validated step size from a NumberConstraints.
|
|
50
|
+
* @param partialNumberFormatConfiguration Any configuration to normalize the supplied precision.
|
|
51
|
+
* @returns The number of decimal places to be used to display values.
|
|
52
|
+
*/
|
|
53
|
+
export declare function sanitizePrecision(precision: number | undefined, step: number, partialNumberFormatConfiguration?: Partial<NumberFormatConfiguration>): number;
|
|
54
|
+
/**
|
|
55
|
+
* Combines the provided configuration with the default and returns a new {@link NumberFormatConfiguration}.
|
|
56
|
+
* @param partialConfiguration Configuration to be added with the defaults.
|
|
57
|
+
* @returns The full set of constraints to use.
|
|
58
|
+
*/
|
|
59
|
+
export declare function getNumberFormatConfiguration(partialConfiguration: Partial<NumberFormatConfiguration> | undefined): NumberFormatConfiguration;
|
|
60
|
+
/**
|
|
61
|
+
* Compares a value with some constraints and returns an adjusted value that satisfies the constraints. There are three considerations:
|
|
62
|
+
* 1. The value must be >= `minimum`. Otherwise it is changed to `minimum`.
|
|
63
|
+
* 2. The value must be <= `maximum`. Otherwise it is changed to `maximum`.
|
|
64
|
+
* 3. The value must land on a valid step between the bounds. Otherwise it is moved to the nearest step.
|
|
65
|
+
* This can only be enforced if `minimum` or `maximum` is specified.
|
|
66
|
+
*
|
|
67
|
+
* It is assumed that the supplied `numberConstraints` satisfy the following criteria:
|
|
68
|
+
* * `maximum` must not be less than or equal to `minimum`.
|
|
69
|
+
* * If `maximum` and `minimum` are both defined:
|
|
70
|
+
* * `maximum` must be a whole number of steps greater than `minimum`.
|
|
71
|
+
* * `step` must not be greater than `maximum - minimum`.
|
|
72
|
+
* @param value The value to be inspected.
|
|
73
|
+
* @param numberConstraints The constraints to be applied to the value.
|
|
74
|
+
* @returns A new value which satisfies the constraints.
|
|
75
|
+
*/
|
|
76
|
+
export declare function enforceConstraints(value: number, numberConstraints: defs.NumberConstraints): number;
|
|
77
|
+
/**
|
|
78
|
+
* Retrieves the effective number slider values after applying various validation checks and bounds.
|
|
79
|
+
* @param values The initial input values based on which the result is computed.
|
|
80
|
+
* @param numberConstraints
|
|
81
|
+
* @returns A sorted numeric array with user entered values, if valid and default values if not.
|
|
82
|
+
*/
|
|
83
|
+
export declare function getNumberSliderValues(values: defs.Value | undefined, numberConstraints: defs.NumberConstraints, singleValue?: boolean): number[];
|
|
84
|
+
/**
|
|
85
|
+
* Checks if a form element's value is equal to the supplied value.
|
|
86
|
+
* @param element A Form Element to inspect.
|
|
87
|
+
* @param newValue A new value for the Form Element.
|
|
88
|
+
* @returns True if the element's current value and the new value are equal, false otherwise.
|
|
89
|
+
*/
|
|
90
|
+
export declare function areValuesEqual(element: defs.Element, newValue: defs.NumberRef | undefined): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* A mark on the slider. This is a copy of the interface by the same name in @mui/base/useSlider.
|
|
93
|
+
* We use string rather than React.Node so that we can share this between runtime and designer without discrepancies between the typings.
|
|
94
|
+
*/
|
|
95
|
+
export interface Mark {
|
|
96
|
+
value: number;
|
|
97
|
+
label?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Gets marks to be used with the @vertigis/react-ui/Slider component.
|
|
101
|
+
*
|
|
102
|
+
* Returning `true` is a shortcut to tell the Slider to generate its own marks based on the step size.
|
|
103
|
+
* This is only possible when `showMinMaxLabels` is false, though, as they are also rendered as marks.
|
|
104
|
+
* When `showMinMaxLabels` and `showTickMarks` are both true, we need to manually generate all of the marks.
|
|
105
|
+
* @param maximum The highest allowed value.
|
|
106
|
+
* @param minimum The lowest allowed value.
|
|
107
|
+
* @param step: The amount of change between values.
|
|
108
|
+
* @param formatOptions The FormatOptions for formatting text on the labels.
|
|
109
|
+
* @param showMinMaxLabels True if labels should be included for min and max, false otherwise.
|
|
110
|
+
* @param showTickMarks True if tick marsks should be shown, false otherwise.
|
|
111
|
+
* @returns The value for the marks property for the slider.
|
|
112
|
+
*/
|
|
113
|
+
export declare function getMarks(maximum: number, minimum: number, step: number, formatOptions: FormatOptions, showMinMaxLabels: boolean, showTickMarks: boolean): boolean | Mark[];
|
|
@@ -0,0 +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:i,upperBound:t}=e=e||{};let{precision:u,step:o}=e;var n,r=getNumberFormatConfiguration(r);let a=isNumeric(i)?i:r.lowerBound.default,m=isNumeric(t)?t:r.upperBound.default;return void 0!==m&&void 0!==a&&m<=a&&(a=r.lowerBound.default,m=r.upperBound.default),u="number"!=typeof u||Number.isNaN(u)?r.precision.default:u,void 0!==r.precision.minimum&&(u=Math.max(u,r.precision.minimum)),void 0!==r.precision.maximum&&(u=Math.min(u,r.precision.maximum)),u<0?(n=Math.pow(10,-1*u),void 0!==o&&o%n==0||(o=n)):(o=isNumeric(o)&&0<o?o:r.step.default,void 0!==m&&void 0!==a&&(o=Math.min(o,m-a),n=(m-a)/o,Number.isInteger(n)||(r=countDecimalPlaces(o),m=roundAccurately(a+Math.floor(n)*o,r)))),{maximum:m,minimum:a,step:o}}const intlNumberFormat=new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:20,useGrouping:!1});function countDecimalPlaces(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,i){i=getNumberFormatConfiguration(i);void 0===e&&(e=i.precision.default);r=countDecimalPlaces(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 i in e)r[i]=Object.assign(r[i],e[i]);return r}function enforceConstraints(e,r){var i,t,{maximum:u,minimum:o,step:r}=r;return void 0!==o?(i=(e-o)/r,Number.isInteger(i)||(t=countDecimalPlaces(r),e=roundAccurately(o+Math.round(i)*r,t))):void 0!==u&&(i=(u-e)/r,Number.isInteger(i)||(t=countDecimalPlaces(r),e=roundAccurately(u-Math.round(i)*r,t))),void 0!==o&&e<o&&(e=o),e=void 0!==u&&u<e?u:e}function getNumberSliderValues(e,r,i=!1){let t=[],u=NaN,o=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?u=e:"number"==typeof e?.numeric&&(u=e.numeric);if(Array.isArray(e)&&1<=e.length&&(u=e[0],o=e[1]),void 0===u||isNaN(u)||(u=enforceConstraints(u,r),void 0===o||isNaN(o)?i&&t.push(u):(o=enforceConstraints(o,r),t.push(u,o))),t=t.sort((e,r)=>e-r),t.length===(i?1:2))return t;var n=r.maximum,e=r.minimum;return i?[enforceConstraints((e+n)/2,r)]:[e,n]}function areValuesEqual(e,r){e=e.value;if(void 0===e&&void 0===r||null===e&&null===r)return!0;var i,t;return!(!isNumberRef(e)||!isNumberRef(r))&&(e.display===r.display&&e.refValueType===r.refValueType&&e.numeric===r.numeric&&(i=e.format,t=r.format,void 0===i&&void 0===t||void 0!==i&&void 0!==t&&(i.currency===t.currency&&i.customDisplayFormat===t.customDisplayFormat&&i.displayFormat===t.displayFormat&&i.lowerBound===t.lowerBound&&i.precision===t.precision&&i.step===t.step&&i.upperBound===t.upperBound)))}function getMarks(r,i,t,e,u,o){if(u&&o){const n=[{value:i,label:format(e,i)}];for(let e=i+t;e<r;e+=t)n.push({value:e});return n.push({value:r,label:format(e,r)}),n}return u&&!o?[{value:i,label:format(e,i)},{value:r,label:format(e,r)}]:o}function roundAccurately(e,r){return Number(Math.round(Number(e+`e${r}`))+`e-${r}`)}export{defaultNumberFormatConfiguration,getNumberConstraints,countDecimalPlaces,sanitizePrecision,getNumberFormatConfiguration,enforceConstraints,getNumberSliderValues,areValuesEqual,getMarks};
|
package/forms/presenter.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare function refresh(component: {}): void;
|
|
|
8
8
|
export declare function refreshForm(host: FormPresenterHost, container: Element): void;
|
|
9
9
|
/**
|
|
10
10
|
* Releases the underlying visual for the element.
|
|
11
|
+
* @product This is intended for internal use only within VertiGIS Studio products.
|
|
11
12
|
* @param element The element to release from.
|
|
12
13
|
*/
|
|
13
14
|
export declare function releaseForm(container: HTMLElement): void;
|
package/forms/presenter.js
CHANGED
|
@@ -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
|
|
1
|
+
import{createElement}from"react";import*as React from"react";import{unmountComponentAtNode,render as reactRender}from"react-dom";import{FormComponent}from"./FormComponent.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:n===FormElementTypes.CUSTOM?e.props.host.renderCustom(e,r):e.elementRegistration?createElement(e.elementRegistration.component,getElementProps(e,r)):renderElement(n,e,r)}}function renderNone(e){if(e instanceof FormComponent)return renderers_renderNone(e)}export{refresh,refreshForm,releaseForm,render,renderNone};
|
package/forms/renderers.d.ts
CHANGED
|
@@ -1,46 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormComponent } from "./FormComponent";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import * as geometry from "./geometry";
|
|
7
|
-
import * as number from "./number";
|
|
8
|
-
import * as scanner from "./scanner";
|
|
9
|
-
import * as selectors from "./selectors";
|
|
10
|
-
import { FormElementProps } from "./index";
|
|
11
|
-
export declare function renderForm(component: FormComponent): JSX.Element;
|
|
12
|
-
export declare function renderHeader(component: FormComponent): JSX.Element;
|
|
13
|
-
export declare function renderFooter(component: FormComponent): JSX.Element;
|
|
14
|
-
export declare function renderBody(component: FormComponent): JSX.Element;
|
|
15
|
-
export declare function renderRow(component: FormComponent): JSX.Element;
|
|
16
|
-
export declare function renderMain(component: FormComponent): JSX.Element;
|
|
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;
|
|
17
6
|
export declare function renderNone(component: FormComponent): any;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function renderText(component: FormComponent, element: defs.Element): JSX.Element;
|
|
21
|
-
function renderTextArea(component: FormComponent, element: defs.Element): JSX.Element;
|
|
22
|
-
function renderTextBox(component: FormComponent, element: defs.Element): JSX.Element;
|
|
23
|
-
export import renderNumber = number.renderNumber;
|
|
24
|
-
export import renderNumberRangeSlider = number.renderNumberRangeSlider;
|
|
25
|
-
export import renderNumberSlider = number.renderNumberSlider;
|
|
26
|
-
export import renderAutoComplete = selectors.renderAutoComplete;
|
|
27
|
-
export import renderCheckBox = selectors.renderCheckBox;
|
|
28
|
-
export import renderCheckGroup = selectors.renderCheckGroup;
|
|
29
|
-
export import renderDropDownList = selectors.renderDropDownList;
|
|
30
|
-
export import renderItemPicker = selectors.renderItemPicker;
|
|
31
|
-
export import renderListBox = selectors.renderListBox;
|
|
32
|
-
export import renderRadioGroup = selectors.renderRadioGroup;
|
|
33
|
-
export import renderDatePicker = datetime.renderDateTimePicker;
|
|
34
|
-
export import renderDateRangePicker = datetime.renderDateRangePicker;
|
|
35
|
-
export import renderTimePicker = datetime.renderDateTimePicker;
|
|
36
|
-
export import renderDateTimePicker = datetime.renderDateTimePicker;
|
|
37
|
-
export import renderGeometryPicker = geometry.renderGeometryPicker;
|
|
38
|
-
export import renderFilePicker = files.renderFilePicker;
|
|
39
|
-
export import renderScanner = scanner.renderScanner;
|
|
40
|
-
function renderSection(component: FormComponent, element: defs.Element): JSX.Element;
|
|
41
|
-
function renderHorizontalRule(component: FormComponent, element: defs.Element): JSX.Element;
|
|
42
|
-
function renderImage(component: FormComponent, element: defs.Element): JSX.Element;
|
|
43
|
-
function renderButtonBar(component: FormComponent, element: defs.Element): JSX.Element;
|
|
44
|
-
function renderCustom(component: FormComponent, element: defs.Element): JSX.Element;
|
|
45
|
-
}
|
|
46
|
-
export declare function getElementProps(component: FormComponent, element: defs.Element): FormElementProps;
|
|
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;
|
package/forms/renderers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Box from"@vertigis/react-ui/Box";import*as React from"react";import AccordionGroup from"./components/AccordionGroup.js";import AutoComplete from"./components/AutoComplete.js";import ButtonBar from"./components/ButtonBar.js";import CheckBox from"./components/CheckBox.js";import CheckGroup from"./components/CheckGroup.js";import Custom from"./components/Custom.js";import DatePicker from"./components/DatePicker.js";import DateRangePicker from"./components/DateRangePicker.js";import DateTimePicker from"./components/DateTimePicker.js";import DropDownList from"./components/DropDownList.js";import FilePicker from"./components/FilePicker.js";import Form,{formClasses}from"./components/Form.js";import GeometryPicker from"./components/GeometryPicker.js";import HorizontalRule from"./components/HorizontalRule.js";import Image from"./components/Image.js";import ItemPicker from"./components/ItemPicker.js";import ListBox from"./components/ListBox.js";import Number from"./components/Number.js";import NumberRangeSlider from"./components/NumberRangeSlider.js";import NumberSlider from"./components/NumberSlider.js";import RadioGroup from"./components/RadioGroup.js";import Scanner from"./components/Scanner.js";import Section from"./components/Section.js";import Signature from"./components/Signature.js";import Text from"./components/Text.js";import TextArea from"./components/TextArea.js";import TextBox from"./components/TextBox.js";import TimePicker from"./components/TimePicker.js";import{FormComponentTypes,FormElementTypes}from"./constants.js";function renderComponent(e){switch(e.props.type){case FormComponentTypes.FORM:return React.createElement(Form,{component:e});case FormComponentTypes.HEADER:return renderBox(e.props.children,formClasses.header);case FormComponentTypes.MAIN:return renderBox(e.props.children,formClasses.main);case FormComponentTypes.FOOTER:return renderBox(e.props.children,formClasses.footer);case FormComponentTypes.BODY:return renderBox(e.props.children,formClasses.body);case FormComponentTypes.ROW:return renderBox(e.props.children,formClasses.row);case FormComponentTypes.SECTION:return renderElement(FormElementTypes.SECTION,e,e.prepare());case FormComponentTypes.ACCORDIONGROUP:return React.createElement(AccordionGroup,{component:e});default:return null}}function renderNone(e){return renderBox([`--- Unsupported Form Element (name=${e.props.name}) ---`],"None")}function renderBox(e,t){return React.createElement(Box,{className:t},e)}function renderElement(e,t,r){switch(e){case FormElementTypes.AUTOCOMPLETE:return React.createElement(AutoComplete,{component:t,element:r});case FormElementTypes.BUTTONBAR:return React.createElement(ButtonBar,{component:t,element:r});case FormElementTypes.CHECKBOX:return React.createElement(CheckBox,{component:t,element:r});case FormElementTypes.CHECKGROUP:return React.createElement(CheckGroup,{component:t,element:r});case FormElementTypes.CUSTOM:return React.createElement(Custom,{component:t,element:r});case FormElementTypes.DATEPICKER:return React.createElement(DatePicker,{component:t,element:r});case FormElementTypes.DATERANGEPICKER:return React.createElement(DateRangePicker,{component:t,element:r});case FormElementTypes.DATETIMEPICKER:return React.createElement(DateTimePicker,{component:t,element:r});case FormElementTypes.DROPDOWNLIST:return React.createElement(DropDownList,{component:t,element:r});case FormElementTypes.FILEPICKER:return React.createElement(FilePicker,{component:t,element:r});case FormElementTypes.GEOMETRYPICKER:return React.createElement(GeometryPicker,{component:t,element:r});case FormElementTypes.HORIZONTALRULE:return React.createElement(HorizontalRule,{component:t,element:r});case FormElementTypes.IMAGE:return React.createElement(Image,{component:t,element:r});case FormElementTypes.ITEMPICKER:return React.createElement(ItemPicker,{component:t,element:r});case FormElementTypes.LISTBOX:return React.createElement(ListBox,{component:t,element:r});case FormElementTypes.NUMBER:return React.createElement(Number,{component:t,element:r});case FormElementTypes.NUMBERRANGESLIDER:return React.createElement(NumberRangeSlider,{component:t,element:r});case FormElementTypes.NUMBERSLIDER:return React.createElement(NumberSlider,{component:t,element:r});case FormElementTypes.PASSWORDBOX:return React.createElement(TextBox,{component:t,element:r,type:"password"});case FormElementTypes.RADIOGROUP:return React.createElement(RadioGroup,{component:t,element:r});case FormElementTypes.SCANNER:return React.createElement(Scanner,{component:t,element:r});case FormElementTypes.SECTION:return React.createElement(Section,{component:t,element:r});case FormElementTypes.SIGNATURE:return React.createElement(Signature,{component:t,element:r});case FormElementTypes.TEXT:return React.createElement(Text,{component:t,element:r});case FormElementTypes.TEXTAREA:return React.createElement(TextArea,{component:t,element:r});case FormElementTypes.TEXTBOX:return React.createElement(TextBox,{component:t,element:r});case FormElementTypes.TIMEPICKER:return React.createElement(TimePicker,{component:t,element:r});default:return null}}export{renderComponent,renderNone,renderElement};
|
package/forms/textUtilities.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { markdownToSafeHtml } from "@vertigis/react-ui/utils/markdown";
|
|
1
2
|
import * as defs from "./FormDefinition";
|
|
2
3
|
/**
|
|
3
4
|
* Ensures the supplied string can be rendered literally in markdown by
|
|
@@ -14,8 +15,9 @@ import * as defs from "./FormDefinition";
|
|
|
14
15
|
* @param literalString A string to be treated literally in markdown.
|
|
15
16
|
*/
|
|
16
17
|
export declare function escapeTextForMarkdown(literalString: string): string;
|
|
17
|
-
export declare function
|
|
18
|
-
export declare function
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function markdownToHtml(markdown: string, htmlContentCategory?: defs.HTMLContentCategory): string;
|
|
18
|
+
export declare function hasContent(text: defs.Text | undefined): boolean;
|
|
19
|
+
export declare function isMarkdown(text: (Partial<defs.MarkdownRef> & defs.Text) | undefined | null): text is defs.MarkdownRef;
|
|
20
|
+
export declare function isStatus(text: (Partial<defs.StatusRef> & defs.Text) | undefined | null): text is defs.StatusRef;
|
|
21
21
|
export declare function markdownToText(markdown: string): string;
|
|
22
|
+
export declare function textToHtml(text: string): string;
|
|
23
|
+
export { markdownToSafeHtml };
|
package/forms/textUtilities.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{markdownToSafeHtml}from"@vertigis/react-ui/utils/markdown";const htmlContent=document.createElement("div"),textContent=document.createElement("div"),textNode=document.createTextNode("");htmlContent.appendChild(textNode);const markdownCharsRegExp=/[\\`*_{}[\]()#+\-.!>~]/g,markdownCodeBlockSpacesRegExp=/^[ ]{4}/gm,markdownCodeBlockTabRegExp=/^[ ]{0,3}[ ]{1}/gm,markdownLineBreakSuffixRegExp=/[ ]{2}$/gm;function escapeTextForMarkdown(t){let e=t.replace(markdownCharsRegExp,"\\$&");return e=e.replace(markdownCodeBlockSpacesRegExp," "),e=e.replace(markdownCodeBlockTabRegExp," "),e=e.replace(markdownLineBreakSuffixRegExp," "),e}function hasContent(t){return"string"==typeof t?!!t:isMarkdown(t)?!!t.markdown:!!isStatus(t)&&!!t.status}function isMarkdown(t){return null!=t&&"string"==typeof t.markdown}function isStatus(t){return null!=t&&"string"==typeof t.status}function markdownToText(t){return textContent.innerHTML=markdownToSafeHtml(t),textContent.innerText}function textToHtml(t){return textNode.data=t,htmlContent.innerHTML}export{escapeTextForMarkdown,hasContent,isMarkdown,isStatus,markdownToText,textToHtml,markdownToSafeHtml};
|
package/forms/utils.d.ts
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
|
+
import { Lookup } from "../Collections";
|
|
2
|
+
import { FormComponent } from "./FormComponent";
|
|
1
3
|
import * as defs from "./FormDefinition";
|
|
2
4
|
import * as text from "./textUtilities";
|
|
5
|
+
import { FormElementProps } from "./index";
|
|
6
|
+
/**
|
|
7
|
+
* Constraints for a property that may specify a default value and bounds.
|
|
8
|
+
*/
|
|
9
|
+
export interface PropertyConstraints<T> {
|
|
10
|
+
default?: T;
|
|
11
|
+
maximum?: T;
|
|
12
|
+
minimum?: T;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Constraints for a property that specifies a default value.
|
|
16
|
+
*/
|
|
17
|
+
export interface PropertyConstraintsWithDefault<T> extends PropertyConstraints<T> {
|
|
18
|
+
default: T;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Constraints for a property that specifies a maximum value.
|
|
22
|
+
*/
|
|
23
|
+
export interface PropertyConstraintsWithMaximum<T> extends PropertyConstraints<T> {
|
|
24
|
+
maximum: T;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Constraints for a property that specifies a minimum value.
|
|
28
|
+
*/
|
|
29
|
+
export interface PropertyConstraintsWithMinimum<T> extends PropertyConstraints<T> {
|
|
30
|
+
minimum: T;
|
|
31
|
+
}
|
|
32
|
+
export interface FormElementPropertyConstraints {
|
|
33
|
+
[key: string]: PropertyConstraints<any> | undefined;
|
|
34
|
+
}
|
|
3
35
|
export interface DebounceResult {
|
|
4
36
|
/** Invoke the scheduled function immediately, without any further delay. */
|
|
5
37
|
now: () => void;
|
|
@@ -12,39 +44,89 @@ export interface DebounceResult {
|
|
|
12
44
|
**/
|
|
13
45
|
export { text };
|
|
14
46
|
export declare function makeId(): string;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Performs key/item sorting.
|
|
49
|
+
* @product This is intended for internal use only within VertiGIS Studio products.
|
|
50
|
+
*/
|
|
51
|
+
export declare function sort<T>(items: T | undefined, predicate?: (item: T[keyof T], index: number) => number | undefined): T;
|
|
52
|
+
/**
|
|
53
|
+
* This function does a few things relating to items within an element.
|
|
54
|
+
*
|
|
55
|
+
* 1. The items are sorted by index, falling back to their order of the keys if no index is present.
|
|
56
|
+
* 2. Any items with visibe = false are excluded.
|
|
57
|
+
* 3. It ensures `element.value` and `element.current` are consistent.
|
|
58
|
+
* 4. It updates `element.label` to match the current item.
|
|
59
|
+
* @product This is intended for internal use only within VertiGIS Studio products.
|
|
60
|
+
* @param element The element whose items are to be sorted.
|
|
61
|
+
* @returns An array of visible items, sorted by index.
|
|
62
|
+
*/
|
|
63
|
+
export declare function sortItems(element: defs.Element): Lookup<defs.Item>;
|
|
64
|
+
/**
|
|
65
|
+
* Details returned by `sortAndFilterItems()`.
|
|
66
|
+
*/
|
|
67
|
+
declare type sortAndFilterItemsResult = {
|
|
68
|
+
/** The index of the now-selected item, based on the new value of `items`. */
|
|
69
|
+
current: string | undefined;
|
|
70
|
+
/** The sorted and filtered items. */
|
|
71
|
+
items: Lookup<defs.Item>;
|
|
72
|
+
/** The new `label` of the element, based on the new value of `current`. */
|
|
73
|
+
label: defs.Text | undefined;
|
|
74
|
+
/** The new `value` of the element, based on the new value of `current`. */
|
|
75
|
+
value: defs.Value | undefined;
|
|
19
76
|
};
|
|
20
|
-
|
|
21
|
-
|
|
77
|
+
/**
|
|
78
|
+
* This function produces a set of `items` based on the supplied `element`.
|
|
79
|
+
* They are sorted based on `element.index` or the ordinal position.
|
|
80
|
+
* They are filtered to exclude `undefined`, `null` or elements with `visible` set to `false.`
|
|
81
|
+
*
|
|
82
|
+
* Unlike `sortItems()`, this function does not attempt to change `element`.
|
|
83
|
+
* Instead, new values for `current`, `label` and `value` are included in the result.
|
|
84
|
+
* It is then the responsibility of the caller to update them in the original `element` if necessary.
|
|
85
|
+
* @param element The element whose items are to be sorted.
|
|
86
|
+
* @returns A sorted and filtered set if items, along with a few properties that should be updated on `element`.
|
|
87
|
+
*/
|
|
88
|
+
export declare function sortAndFilterItems(element: defs.Element): sortAndFilterItemsResult;
|
|
89
|
+
/** @product This is intended for internal use only within VertiGIS Studio products. */
|
|
90
|
+
export declare function makeSafeClassName(elementName: string | undefined): string;
|
|
91
|
+
/** @public */
|
|
92
|
+
export declare function makeUniqueId(elementName: string | undefined): string;
|
|
22
93
|
export declare function addClass(element: HTMLElement, name: string): void;
|
|
23
94
|
export declare function removeClass(element: HTMLElement, name: string): void;
|
|
24
95
|
export declare function setClass(element: HTMLElement, name: string, exists: boolean): void;
|
|
25
|
-
export declare function isBoolean(value: defs.Value): value is boolean;
|
|
26
|
-
export declare function isNumber(value: defs.Value): value is number;
|
|
27
|
-
|
|
28
|
-
export declare function
|
|
29
|
-
export declare function
|
|
30
|
-
export declare function
|
|
31
|
-
export declare function
|
|
32
|
-
export declare function
|
|
33
|
-
export declare function
|
|
34
|
-
export declare function
|
|
35
|
-
export declare function
|
|
36
|
-
|
|
96
|
+
export declare function isBoolean(value: defs.Value | undefined): value is boolean;
|
|
97
|
+
export declare function isNumber(value: defs.Value | undefined): value is number;
|
|
98
|
+
/** @product This is intended for internal use only within VertiGIS Studio products. */
|
|
99
|
+
export declare function isString(value: defs.Value | undefined): value is string;
|
|
100
|
+
export declare function isDataRef(value: defs.Value | undefined): value is defs.DataRef;
|
|
101
|
+
export declare function isDateRangeRef(value: defs.Value | undefined): value is defs.DateRangeRef;
|
|
102
|
+
export declare function isDateTimeRef(value: defs.Value | undefined): value is defs.DateTimeRef;
|
|
103
|
+
export declare function isFilesRef(value: defs.Value | undefined): value is defs.FilesRef;
|
|
104
|
+
export declare function isScanRef(value: defs.Value | undefined): value is defs.ScanRef;
|
|
105
|
+
export declare function isGeometryRef(value: defs.Value | undefined): value is defs.GeometryRef;
|
|
106
|
+
export declare function isItemsRef(value: defs.Value | undefined): value is defs.ItemsRef;
|
|
107
|
+
/** @product This is intended for internal use only within VertiGIS Studio products. */
|
|
108
|
+
export declare function isNumberRef(value: defs.Value | undefined): value is defs.NumberRef;
|
|
109
|
+
/** @product This is intended for internal use only within VertiGIS Studio products. */
|
|
110
|
+
export declare function sanitizeGeometryRef(value: defs.Value | undefined): defs.GeometryRef;
|
|
111
|
+
/** @product This is intended for internal use only within VertiGIS Studio products. */
|
|
37
112
|
export declare function createGeometryRef(format: defs.GeometryFormat): defs.GeometryRef;
|
|
38
|
-
export declare function addStyleToDocument(css: string): HTMLStyleElement;
|
|
39
113
|
/**
|
|
40
114
|
* Creates a throttled function that will invoke the given
|
|
41
115
|
* function at most once per the given delay.
|
|
42
116
|
* @param func The function to invoke.
|
|
43
117
|
* @param delay The delay to wait (in milliseconds) before invoking the function again.
|
|
44
118
|
*/
|
|
45
|
-
export declare function throttle(func: Function, delay?: number): () => void;
|
|
119
|
+
export declare function throttle(func: Function, delay?: number): (this: any) => void;
|
|
46
120
|
/**
|
|
47
121
|
* Determines whether a value is numeric, i.e. a number or a numeric string.
|
|
48
122
|
* @param value The value to check.
|
|
49
123
|
*/
|
|
50
124
|
export declare function isNumeric(value: unknown): boolean;
|
|
125
|
+
export declare function getElementProps(component: FormComponent, element: defs.Element): FormElementProps;
|
|
126
|
+
/**
|
|
127
|
+
* Gets the id of an item from a Lookup<defs.Item>.
|
|
128
|
+
* @param item The item to find.
|
|
129
|
+
* @param items The items to look through.
|
|
130
|
+
* @returns The key corresponding to the item, or undefined if no match was found.
|
|
131
|
+
*/
|
|
132
|
+
export declare function getItemId(item: defs.Item | null | undefined, items: Lookup<defs.Item>): string;
|
package/forms/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as text from"./textUtilities.js";const DEFAULT_THROTTLE_DELAY=100;let next=0,seed=(new Date).valueOf();const guid="5DDC9A38-AAAB-44C1-AD87-415160F43D75";function makeId(){return 2147483648<=next&&(seed=(new Date).valueOf(),next=0),`${guid}:${seed}:${next++}`}function indexOf(e,t){if(null!=e){e=e.index;return"number"==typeof e?e:t}}function compareIndex(e,t){return compareNumber(e.index,t.index)}function compareNumber(e,t){return e<t?-1:t<e?1:0}function sort(e,t){void 0===t&&(t=indexOf);const n={};if("object"!=typeof e||null===e)return n;let i=0;const r=[];for(const
|
|
1
|
+
import*as text from"./textUtilities.js";const DEFAULT_THROTTLE_DELAY=100;let next=0,seed=(new Date).valueOf();const guid="5DDC9A38-AAAB-44C1-AD87-415160F43D75";function makeId(){return 2147483648<=next&&(seed=(new Date).valueOf(),next=0),`${guid}:${seed}:${next++}`}function indexOf(e,t){if(null!=e){e=e.index;return"number"==typeof e?e:t}}function compareIndex(e,t){return compareNumber(e.index,t.index)}function compareNumber(e,t){return e<t?-1:t<e?1:0}function sort(e,t){void 0===t&&(t=indexOf);const n={};if("object"!=typeof e||null===e)return n;let i=0;const r=[];for(const o in e){var s=e[o],a=t(s,i++);"number"==typeof a&&r.push({key:o,index:a,item:s})}for(const u of r.sort(compareIndex))n[u.key]=u.item;return n}function sortItems(e){let t=e.current;var n=e.value,i=sort(e.items,function(e,t){if(null!=e&&!1!==e.visible){e=e.index;return"number"==typeof e?e:t}});if(void 0!==t&&null!==t&&void 0!==i[t]||(t=void 0),void 0===t&&null!=n)for(const r in i){if(i[r].value===n){t=r;break}t=void 0}return void 0!==t?(e.current=t,e.label=i[t].label,e.value=i[t].value):(e.current=void 0,e.label=void 0,e.value=void 0),i}function sortAndFilterItems(e){var t={...e},e=sortItems(t);return{current:t.current,items:e,label:t.label,value:t.value}}function stripClassName(e,t){return e.className.split(" ").filter(e=>0<e.length&&e!==t).join(" ")}function makeSafeClassName(e){return`gcx-forms-${e?.replace(/[\W]/g,"")||"element"}`}let idSuffix=0;function makeUniqueId(e){return`${makeSafeClassName(e)}-${++idSuffix}`}function addClass(e,t){void 0!==e.classList?e.classList.add(t):e.className=stripClassName(e,t)+" "+t}function removeClass(e,t){void 0!==e.classList?e.classList.remove(t):e.className=stripClassName(e,t)}function setClass(e,t,n){(n?addClass:removeClass)(e,t)}function isObjectType(e,t){return"object"==typeof e&&null!==e&&(!Array.isArray(e)&&e.refValueType===t)}function isBoolean(e){return"boolean"==typeof e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isDataRef(e){return isObjectType(e,"data")}function isDateRangeRef(e){return isObjectType(e,"daterange")}function isDateTimeRef(e){return isObjectType(e,"date")||isObjectType(e,"time")||isObjectType(e,"datetime")}function isFilesRef(e){return isObjectType(e,"files")}function isScanRef(e){return isObjectType(e,"scan")}function isGeometryRef(e){return isObjectType(e,"geometry")}function isItemsRef(e){return isObjectType(e,"items")}function isNumberRef(e){return isObjectType(e,"number")}function sanitizeGeometryRef(e){if(isGeometryRef(e)){var t=e.geometry;if(Array.isArray(t)&&0<t.length)switch(e.format){case"point":case"polygon":case"polyline":case"polygon-freehand":case"polyline-freehand":case"extent":case"line":return e}}}function createGeometryRef(e){return{refValueType:"geometry",format:e,geometry:[]}}function throttle(r,s=DEFAULT_THROTTLE_DELAY){let a,o;return function(){const e=this,t=arguments;function n(){o=void 0,a=Date.now(),r.apply(e,t)}var i=Date.now();a&&i<a+s?(clearTimeout(o),o=setTimeout(n,s)):n()}}function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}function getElementProps(e,t){return{...t,element:t,name:e.props.name,enabled:!!t.enabled,setProperty:e.setProperty,setValue:e.setValue,raiseEvent:e.raiseEvent,value:t.value}}function getItemId(e,t){if(e)for(const n in t)if(t[n]===e)return n}export{text,makeId,sort,sortItems,sortAndFilterItems,makeSafeClassName,makeUniqueId,addClass,removeClass,setClass,isBoolean,isNumber,isString,isDataRef,isDateRangeRef,isDateTimeRef,isFilesRef,isScanRef,isGeometryRef,isItemsRef,isNumberRef,sanitizeGeometryRef,createGeometryRef,throttle,isNumeric,getElementProps,getItemId};
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { IActivityHandler } from "./IActivityHandler";
|
|
2
|
-
export
|
|
2
|
+
export type { FormElementProps, FormElementSettableProps, PropertyChangeEvent, FormElementRegistration, } from "./forms/index";
|
package/index.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./forms/index.js";
|
package/libs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "5.
|
|
1
|
+
export declare const VERSION = "5.35.0+38";
|
package/libs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const VERSION="5.
|
|
1
|
+
const VERSION="5.35.0+38";export{VERSION};
|
package/package.json
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertigis/workflow",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.35.0",
|
|
4
4
|
"author": "VertiGIS",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@zxing/library": "^0.
|
|
6
|
+
"@zxing/library": "^0.20.0",
|
|
7
|
+
"autosuggest-highlight": "^3.3.4",
|
|
7
8
|
"bluebird": "3.5.5",
|
|
9
|
+
"clsx": "^1.2.1",
|
|
8
10
|
"date-fns": "^2.16.1",
|
|
9
|
-
"react-
|
|
10
|
-
"react-range": "^1.8.14",
|
|
11
|
-
"remarkable": "^2.0.1"
|
|
11
|
+
"react-signature-pad-wrapper": "^3.3.2"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@arcgis/core": "^4.25.5",
|
|
16
16
|
"@types/arcgis-js-api": "^4.24.0",
|
|
17
|
+
"@types/autosuggest-highlight": "^3.2.0",
|
|
17
18
|
"@types/jest": "^29.2.3",
|
|
18
19
|
"@types/react": "^17.0.53",
|
|
19
|
-
"@types/react-date-range": "1.1.7",
|
|
20
20
|
"@types/react-dom": "^17.0.18",
|
|
21
|
-
"@types/remarkable": "^2.0.0",
|
|
22
21
|
"@vertigis-internal/licensing": "^5.0.102865",
|
|
23
|
-
"@vertigis/react-ui": "11.
|
|
22
|
+
"@vertigis/react-ui": "11.32.0",
|
|
24
23
|
"cross-env": "7.0.3",
|
|
25
24
|
"jest": "29.3.1",
|
|
26
25
|
"jest-environment-jsdom": "^29.3.1",
|
|
@@ -32,11 +31,12 @@
|
|
|
32
31
|
"react-dom": "^17.0.2",
|
|
33
32
|
"ts-jest": "^29.0.3",
|
|
34
33
|
"tslib": "^2.3.1",
|
|
35
|
-
"typescript": "4.5.5"
|
|
34
|
+
"typescript": "4.5.5",
|
|
35
|
+
"typescript-strict-plugin": "^2.1.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@arcgis/core": ">= 4.24.0 < 5.0.0",
|
|
39
|
-
"@vertigis/react-ui": ">= 11 < 12",
|
|
39
|
+
"@vertigis/react-ui": ">= 11.26 < 12",
|
|
40
40
|
"react": ">= 17 < 19",
|
|
41
41
|
"react-dom": ">= 17 < 19"
|
|
42
42
|
},
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This method allows an activity pack author to register a library
|
|
3
|
-
* to be used by their code.
|
|
4
|
-
* @param mapEntries An object defining paths to modules for names of libraries.
|
|
5
|
-
* @param modulePrefix The prefix for the activity pack, as provided by runtime.
|
|
6
|
-
* @param libraryPath (Optional) The path to a library within the activity pack.
|
|
7
|
-
* This can be used when a particular set of entries only apply to a subset of
|
|
8
|
-
* the activity pack.
|
|
9
|
-
*/
|
|
10
|
-
export declare function mapDependencies(mapEntries: any, modulePrefix: string, libraryPath?: string): void;
|
package/app/ActivityPackUtils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{global}from"../execution/ModuleLoader.js";function mapDependencies(o,e,t){let i=e;"/"===i[i.length-1]&&(i=i.substring(0,i.length-1));var r=i;t&&(i=`${i}/${t}`);let n=global.require.map[i];if(!n){n={};var s=global.require.map["@vertigis/workflow"];for(const l in s)n[l]=s[l]}for(const p in o){let e=o[p];"string"==typeof e&&("./"===e.substring(0,2)?e=`${r}${e.substring(1)}`:"/"===e.substring(0,1)?e=`${r}${e}`:"@"!==e.substring(0,1)&&(e=`${r}/${e}`),n[p]=e)}const a={map:{}};a.map[i]=n,global.require(a)}console.warn("The @vertigis/workflow/app/ActivityPackUtils module is deprecated and will be removed in Workflow 5.35. Upgrade your activity pack to the new SDK before August 2023 for continued operation. More details: https://community.vertigis.com/hc/en-us/community/posts/11043551431698");export{mapDependencies};
|