@vertigis/workflow 5.43.0 → 5.45.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 +1 -1
- package/Hooks.d.ts +11 -2
- package/IActivityHandler.d.ts +2 -2
- package/ProgramInspectorFacility.d.ts +1 -1
- package/ProgramInspectorFacility.js +1 -1
- package/TemplateUtils.js +1 -1
- package/Validation.d.ts +32 -26
- package/Validation.js +1 -1
- package/activities/app/GetApplicationInfo.d.ts +2 -2
- package/activities/app/GetApplicationInfo.js +1 -1
- package/activities/app/GetUserInfo.d.ts +2 -2
- package/activities/app/GetUserInfo.js +1 -1
- package/activities/app/RunCommand.d.ts +2 -2
- package/activities/app/RunCommand.js +1 -1
- package/activities/app/RunOperation.d.ts +2 -2
- package/activities/app/RunOperation.js +1 -1
- package/activities/app/applicationData.d.ts +6 -0
- package/activities/arcgis/AddFeatureLayer.d.ts +2 -2
- package/activities/arcgis/AddFeatureLayer.js +1 -1
- package/activities/arcgis/AddFeatures.d.ts +2 -2
- package/activities/arcgis/AddGraphics.d.ts +1 -1
- package/activities/arcgis/BufferServiceTask.d.ts +1 -1
- package/activities/arcgis/CastGeometry.js +1 -1
- package/activities/arcgis/ClearGraphics.d.ts +1 -1
- package/activities/arcgis/ClipEngineTask.js +1 -1
- package/activities/arcgis/ClosestFacilityTask.d.ts +1 -1
- package/activities/arcgis/ConvertValueToArcGisFieldType.d.ts +2 -2
- package/activities/arcgis/CreateFeatureSet.d.ts +2 -2
- package/activities/arcgis/CreateFeatureSet.js +1 -1
- package/activities/arcgis/CreateGraphic.d.ts +3 -3
- package/activities/arcgis/CreateGraphic.js +1 -1
- package/activities/arcgis/CreatePoint.d.ts +2 -2
- package/activities/arcgis/CreatePoint.js +1 -1
- package/activities/arcgis/DeleteAttachments.js +1 -1
- package/activities/arcgis/DeleteFeatures.d.ts +2 -2
- package/activities/arcgis/ExtendedSpatialReferenceInfoEngineTask.d.ts +1 -1
- package/activities/arcgis/FeatureSetFromJson.d.ts +3 -3
- package/activities/arcgis/FeatureSetFromJson.js +1 -1
- package/activities/arcgis/GenerateWebmapForReport.d.ts +2 -2
- package/activities/arcgis/Geocode.d.ts +1 -1
- package/activities/arcgis/Geocode.js +1 -1
- package/activities/arcgis/GeometryFromJson.d.ts +3 -3
- package/activities/arcgis/GeometryFromJson.js +1 -1
- package/activities/arcgis/Geoprocessing.d.ts +1 -1
- package/activities/arcgis/GeoprocessingAsync.d.ts +1 -1
- package/activities/arcgis/GeoprocessingAsync.js +1 -1
- package/activities/arcgis/GetAttributeValue.d.ts +2 -2
- package/activities/arcgis/GetAttributeValue.js +1 -1
- package/activities/arcgis/GetCentroid.d.ts +2 -2
- package/activities/arcgis/GetCentroid.js +1 -1
- package/activities/arcgis/GetCodedValueDomain.js +1 -1
- package/activities/arcgis/GetCurrentPosition.js +1 -1
- package/activities/arcgis/GetFeatureGeometry.d.ts +2 -2
- package/activities/arcgis/GetFeatureGeometry.js +1 -1
- package/activities/arcgis/GetFeatureLayerInfo.d.ts +4 -2
- package/activities/arcgis/GetFeatureLayerInfo.js +1 -1
- package/activities/arcgis/GetFeatureSetExtent.d.ts +2 -2
- package/activities/arcgis/GetFeatureSetExtent.js +1 -1
- package/activities/arcgis/GetFeatureSetObjectIds.d.ts +2 -2
- package/activities/arcgis/GetFeatureSetObjectIds.js +1 -1
- package/activities/arcgis/GetFormElementItemsFromFeatures.js +1 -1
- package/activities/arcgis/GetGeometryExtent.d.ts +2 -2
- package/activities/arcgis/GetGeometryExtent.js +1 -1
- package/activities/arcgis/GetGraphics.d.ts +1 -1
- package/activities/arcgis/GetLayer.d.ts +1 -1
- package/activities/arcgis/GetLayerDefinitionExpression.d.ts +1 -1
- package/activities/arcgis/GetLayerProperty.d.ts +1 -1
- package/activities/arcgis/GetLayerVisibility.d.ts +1 -1
- package/activities/arcgis/GetMap.d.ts +1 -1
- package/activities/arcgis/GetMapScreenshot.d.ts +1 -1
- package/activities/arcgis/GetPortalUser.d.ts +4 -6
- package/activities/arcgis/GetPortalUser.js +1 -1
- package/activities/arcgis/GetTable.d.ts +1 -1
- package/activities/arcgis/GetViewExtent.d.ts +1 -1
- package/activities/arcgis/GetViewpoint.d.ts +1 -1
- package/activities/arcgis/MapProvider.d.ts +23 -2
- package/activities/arcgis/MapProvider.js +1 -1
- package/activities/arcgis/ProjectServiceTask.d.ts +2 -2
- package/activities/arcgis/QueryAttachmentInfos.js +1 -1
- package/activities/arcgis/QueryTask.d.ts +2 -2
- package/activities/arcgis/QueryTask.js +1 -1
- package/activities/arcgis/RelationServiceTask.js +1 -1
- package/activities/arcgis/RelationshipQueryTask.d.ts +1 -1
- package/activities/arcgis/RemoveFeatureSetFields.d.ts +3 -0
- package/activities/arcgis/RemoveGraphics.d.ts +1 -1
- package/activities/arcgis/RemoveLayer.d.ts +1 -1
- package/activities/arcgis/RendererFromJson.d.ts +3 -3
- package/activities/arcgis/RendererFromJson.js +1 -1
- package/activities/arcgis/ResetLayerDefinitionExpression.d.ts +24 -0
- package/activities/arcgis/ResetLayerDefinitionExpression.js +1 -0
- package/activities/arcgis/ReverseGeocode.d.ts +2 -2
- package/activities/arcgis/ReverseGeocode.js +1 -1
- package/activities/arcgis/RouteTask.d.ts +1 -1
- package/activities/arcgis/RunPrint.d.ts +3 -3
- package/activities/arcgis/RunReport.d.ts +3 -3
- package/activities/arcgis/RunWorkflow.d.ts +1 -1
- package/activities/arcgis/RunWorkflow.js +1 -1
- package/activities/arcgis/SendLayerToAttributeTable.d.ts +2 -2
- package/activities/arcgis/SendLayerToAttributeTable.js +1 -1
- package/activities/arcgis/ServiceAreaTask.d.ts +1 -1
- package/activities/arcgis/SetFeaturePopup.d.ts +1 -1
- package/activities/arcgis/SetImageryLayerOptions.d.ts +3 -3
- package/activities/arcgis/SetLayerDefinitionExpression.d.ts +1 -1
- package/activities/arcgis/SetLayerPopup.d.ts +1 -1
- package/activities/arcgis/SetLayerProperty.d.ts +1 -1
- package/activities/arcgis/SetLayerVisibility.d.ts +1 -1
- package/activities/arcgis/SetMap.d.ts +2 -2
- package/activities/arcgis/SetMap.js +1 -1
- package/activities/arcgis/SetViewExtent.d.ts +1 -1
- package/activities/arcgis/SetViewpoint.d.ts +1 -1
- package/activities/arcgis/ShowFeaturePopup.d.ts +1 -1
- package/activities/arcgis/ShowResults.d.ts +4 -3
- package/activities/arcgis/ShowResults.js +1 -1
- package/activities/arcgis/SortFeatureSet.d.ts +2 -2
- package/activities/arcgis/SortFeatureSet.js +1 -1
- package/activities/arcgis/SymbolFromJson.d.ts +3 -3
- package/activities/arcgis/SymbolFromJson.js +1 -1
- package/activities/arcgis/TypeChecking.d.ts +0 -7
- package/activities/arcgis/TypeChecking.js +1 -1
- package/activities/arcgis/UpdateFeatures.d.ts +2 -2
- package/activities/arcgis/libs/arcGisRestApi.d.ts +20 -1
- package/activities/arcgis/shared.d.ts +3 -3
- package/activities/arcgis/shared.js +1 -1
- package/activities/arcgis/tools.d.ts +2 -2
- package/activities/arcgis/tools.js +1 -1
- package/activities/browser/GetBrowserInfo.d.ts +2 -2
- package/activities/browser/GetBrowserInfo.js +1 -1
- package/activities/constants.js +1 -1
- package/activities/core/Annotation.d.ts +2 -2
- package/activities/core/Annotation.js +1 -1
- package/activities/core/ChannelProvider.d.ts +4 -4
- package/activities/core/ChannelProvider.js +1 -1
- package/activities/core/Container.d.ts +1 -1
- package/activities/core/ConvertToJson.d.ts +1 -1
- package/activities/core/{RunSubworkflow.d.ts → ExecuteFunction.d.ts} +4 -4
- package/activities/core/ExecuteFunction.js +1 -0
- package/activities/core/Exit.d.ts +1 -1
- package/activities/core/FormatDate.d.ts +39 -1
- package/activities/core/FormatDate.js +1 -1
- package/activities/core/{Subworkflow.d.ts → Function.d.ts} +6 -6
- package/activities/core/Function.js +1 -0
- package/activities/core/GetWorkflowInputs.d.ts +2 -2
- package/activities/core/ParseUrl.js +1 -1
- package/activities/core/Placeholder.d.ts +2 -2
- package/activities/core/Placeholder.js +1 -1
- package/activities/core/SetProperty.d.ts +1 -1
- package/activities/core/TextReplace.d.ts +1 -0
- package/activities/core/TextReplace.js +1 -1
- package/activities/core/TryCatch.d.ts +1 -1
- package/activities/core/WebRequest.d.ts +1 -1
- package/activities/core/converters.d.ts +1 -1
- package/activities/essentials/GetEssentialsSite.d.ts +1 -1
- package/activities/essentials/RunEssentialsWorkflow.d.ts +1 -1
- package/activities/essentials/RunEssentialsWorkflow.js +1 -1
- package/activities/forms/AddFormElement.d.ts +4 -2
- package/activities/forms/AddFormElement.js +1 -1
- package/activities/forms/DisplayForm.d.ts +2 -2
- package/activities/forms/FormActor.d.ts +56 -0
- package/activities/forms/FormActor.js +1 -0
- package/activities/forms/FormRenderer.d.ts +6 -42
- package/activities/forms/FormRenderer.js +1 -1
- package/activities/forms/GetFormElementItemsFromCollection.d.ts +2 -2
- package/activities/forms/GetFormElementItemsFromCollection.js +1 -1
- package/activities/forms/GetFormElementProperty.d.ts +2 -2
- package/activities/forms/GetFormElementProperty.js +1 -1
- package/activities/forms/GetFormElementValue.d.ts +2 -2
- package/activities/forms/GetFormElementValue.js +1 -1
- package/activities/forms/SetCurrentFormElementItem.js +1 -1
- package/activities/forms/SetFormElementEvent.d.ts +1 -1
- package/activities/forms/SetFormElementEvent.js +1 -1
- package/activities/index.js +1 -1
- package/activities/math/Random.d.ts +2 -2
- package/activities/math/Random.js +1 -1
- package/activities/ui/Alert.d.ts +1 -1
- package/activities/ui/Confirm.d.ts +1 -1
- package/activities/ui/Prompt.d.ts +1 -1
- package/activities/wab/OpenWidget.d.ts +2 -2
- package/activities/wab/OpenWidget.js +1 -1
- package/activities/wab/PublishWidgetData.d.ts +2 -2
- package/activities/wab/PublishWidgetData.js +1 -1
- package/definition/ActivityInput.d.ts +1 -1
- package/definition/Program.d.ts +11 -6
- package/definition/ProgramInspector.d.ts +9 -2
- package/definition/ProgramInspector.js +1 -1
- package/execution/ActivityContext.js +1 -1
- package/execution/AmbientState.d.ts +5 -5
- package/execution/AmbientState.js +1 -1
- package/execution/AmbientStateProxy.d.ts +4 -4
- package/execution/Engine.d.ts +6 -9
- package/execution/Engine.js +1 -1
- package/execution/ModuleLoader.d.ts +1 -1
- package/execution/ProgramRunner.js +1 -1
- package/execution/util.js +1 -1
- package/forms/FormComponent.d.ts +1 -1
- package/forms/FormDefinition.d.ts +6 -21
- package/forms/FormDefinition.js +1 -1
- package/forms/FormHost.d.ts +19 -7
- package/forms/FormHost.js +1 -1
- package/forms/FormPresenterHost.d.ts +18 -6
- package/forms/components/AutoComplete.js +1 -1
- package/forms/components/ButtonBar.js +1 -1
- package/forms/components/CheckBox.js +1 -1
- package/forms/components/CheckGroup.js +1 -1
- package/forms/components/DateRangePicker.js +1 -1
- package/forms/components/DateTimePicker.js +1 -1
- package/forms/components/DateTimeTextField.js +1 -1
- package/forms/components/Form.js +1 -1
- package/forms/components/FormElement.js +1 -1
- package/forms/components/GeometryPicker.js +1 -1
- package/forms/components/ItemPicker.js +1 -1
- package/forms/components/Number.js +1 -1
- package/forms/components/NumberRangeSlider.js +1 -1
- package/forms/components/NumberSlider.js +1 -1
- package/forms/components/RadioGroup.js +1 -1
- package/forms/components/Scanner.js +1 -1
- package/forms/components/Section.js +1 -1
- package/forms/components/TextBox.js +1 -1
- package/forms/components/TimePicker.js +1 -1
- package/forms/customNumberFormat.js +1 -1
- package/forms/dateUtilities.d.ts +15 -3
- package/forms/dateUtilities.js +1 -1
- package/forms/index.d.ts +2 -4
- package/forms/numberFormatter.d.ts +0 -13
- package/forms/numberFormatter.js +1 -1
- package/forms/numberUtilities.js +1 -1
- package/forms/presenter.d.ts +3 -3
- package/forms/textUtilities.js +1 -1
- package/forms/utils.d.ts +1 -1
- package/forms/utils.js +1 -1
- package/libs/version.d.ts +1 -1
- package/libs/version.js +1 -1
- package/package.json +10 -9
- package/activities/core/RunSubworkflow.js +0 -1
- package/activities/core/Subworkflow.js +0 -1
|
@@ -3,5 +3,5 @@ import type { IActivityHandler, IActivityContext, EmptyInputs, EmptyOutputs } fr
|
|
|
3
3
|
export declare class Exit implements IActivityHandler {
|
|
4
4
|
static readonly action = "gcx:wf:core::Exit";
|
|
5
5
|
static readonly suite = "gcx:wf:builtin";
|
|
6
|
-
execute(
|
|
6
|
+
execute(_inputs: EmptyInputs, context: IActivityContext): EmptyOutputs;
|
|
7
7
|
}
|
|
@@ -16,5 +16,43 @@ export declare class FormatDate implements IActivityHandler {
|
|
|
16
16
|
static readonly action = "gcx:wf:core::FormatDate";
|
|
17
17
|
static readonly suite = "gcx:wf:builtin";
|
|
18
18
|
execute(inputs: FormatDateInputs, context: IActivityContext): FormatDateOutputs;
|
|
19
|
-
getFormattedDate
|
|
19
|
+
private getFormattedDate;
|
|
20
|
+
/**
|
|
21
|
+
* This is used for a subset of the standard date and time format strings
|
|
22
|
+
* which do not relate to an explicit custom equivalent.
|
|
23
|
+
* With these constraints in mind, we can make some assumptions to simplify the code.
|
|
24
|
+
* 1. The "abbreviated month" is never present.
|
|
25
|
+
* 2. The "abbreviated day" is never present.
|
|
26
|
+
* 3. The "full day" is never present.
|
|
27
|
+
* @param dateTimeFormatParts The results of formatting a test date (2000-05-01 14:00:00) to parts.
|
|
28
|
+
* @returns Our own details of the parts, for formatting the date from the activity inputs.
|
|
29
|
+
*/
|
|
30
|
+
private toCustomDateFormatParts;
|
|
31
|
+
/**
|
|
32
|
+
* This method inspects a single-character Custom date and time format string which is assumed to be
|
|
33
|
+
* a Standard date and time format string. These are all described on this page:
|
|
34
|
+
*
|
|
35
|
+
* https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings
|
|
36
|
+
*
|
|
37
|
+
* We use the `STANDARD_FORMAT_STRINGS` namespace to describe each of the supported options.
|
|
38
|
+
*
|
|
39
|
+
* @param formatString A standard date and time format string
|
|
40
|
+
* @param locale The current locale.
|
|
41
|
+
* @returns Details to be used to format the date and time.
|
|
42
|
+
*/
|
|
43
|
+
private inspectStandardFormatString;
|
|
44
|
+
/**
|
|
45
|
+
* This method inspects a multi-character Custom date and time format string.
|
|
46
|
+
* These are all described on this page:
|
|
47
|
+
*
|
|
48
|
+
* https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
|
|
49
|
+
*
|
|
50
|
+
* We use the `CUSTOM_FORMAT_CHARS` namespace to describe the supported characters.
|
|
51
|
+
*
|
|
52
|
+
* @param customFormatString The format string to be inspected.
|
|
53
|
+
* @param locale The locale to be used for localized characters, like separators.
|
|
54
|
+
* @returns Details about how to format a date from the specified format string.
|
|
55
|
+
*/
|
|
56
|
+
private inspectCustomFormat;
|
|
57
|
+
private renderCustom;
|
|
20
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_LOCALE}from"../../constants.js";class FormatDate{execute(t,e){const a=new Date(t.date);var r=a.toISOString();return{formatted:this.getFormattedDate(a,t.format,e.ambient.locale)||r,iso:r,local:a.toString(),unix:a.valueOf(),utc:a.toUTCString()}}getFormattedDate(t,e,a){switch(a=a||DEFAULT_LOCALE,e){case"LT":return new Intl.DateTimeFormat(a,{timeStyle:"short"}).format(t);case"LTS":return new Intl.DateTimeFormat(a,{timeStyle:"medium"}).format(t);case"L":return new Intl.DateTimeFormat(a,{month:"2-digit",day:"2-digit",year:"numeric"}).format(t);case"l":return new Intl.DateTimeFormat(a,{month:"numeric",day:"numeric",year:"numeric"}).format(t);case"LL":return new Intl.DateTimeFormat(a,{dateStyle:"long"}).format(t);case"ll":return new Intl.DateTimeFormat(a,{dateStyle:"medium"}).format(t);case"LLL":return new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t);case"lll":return new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t);case"LLLL":return`${new Intl.DateTimeFormat(a,{weekday:"long"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t)}`;case"llll":return`${new Intl.DateTimeFormat(a,{weekday:"short"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t)}`;default:return}}}FormatDate.action="gcx:wf:core::FormatDate",FormatDate.suite="gcx:wf:builtin";export{FormatDate};
|
|
1
|
+
import{ActivityInputError}from"../../Errors.js";import{DEFAULT_LOCALE}from"../../constants.js";class FormatDate{execute(t,e){const a=new Date(t.date);return{formatted:this.getFormattedDate(a,t.format,e.ambient.locale),iso:a.toISOString(),local:a.toString(),unix:a.valueOf(),utc:a.toUTCString()}}getFormattedDate(t,e,a){switch(a=a||DEFAULT_LOCALE,e){case"LT":return new Intl.DateTimeFormat(a,{timeStyle:"short"}).format(t);case"LTS":return new Intl.DateTimeFormat(a,{timeStyle:"medium"}).format(t);case"L":return new Intl.DateTimeFormat(a,{month:"2-digit",day:"2-digit",year:"numeric"}).format(t);case"l":return new Intl.DateTimeFormat(a,{month:"numeric",day:"numeric",year:"numeric"}).format(t);case"LL":return new Intl.DateTimeFormat(a,{dateStyle:"long"}).format(t);case"ll":return new Intl.DateTimeFormat(a,{dateStyle:"medium"}).format(t);case"LLL":return new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t);case"lll":return new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t);case"LLLL":return`${new Intl.DateTimeFormat(a,{weekday:"long"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t)}`;case"llll":return`${new Intl.DateTimeFormat(a,{weekday:"short"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t)}`;case void 0:case"":return t.toISOString();default:return this.renderCustom(t,e,a)}}toCustomDateFormatParts(t){const a=[];for(const n of t){var r=n.value;let t=n.type,e;switch(t){case"day":case"fractionalSecond":case"hour":case"minute":case"month":if(!/\d/i.test(r)){e=4;break}case"second":case"year":e=r.length;break;case"weekday":t="day",e=4}"hour"===t&&12<parseInt(r)&&(t="hour24"),a.push({length:e,type:t,value:"literal"===t?r:void 0})}return a}inspectStandardFormatString(t,e){var a="current";let r="local",n;switch(t){case STANDARD_FORMAT_STRINGS.DATE_SHORT:n={};break;case STANDARD_FORMAT_STRINGS.DATE_LONG:n={weekday:"long",year:"numeric",month:"long",day:"numeric"};break;case STANDARD_FORMAT_STRINGS.DATETIME_FULL_SHORT_TIME:var o=[...new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).formatToParts(new Date(2e3,0,5)),{type:"literal",value:" "},...new Intl.DateTimeFormat(e,{timeStyle:"short"}).formatToParts(new Date(2e3,0,5,1,2,3))];return{dateTimeKind:r,culture:a,customDateFormatParts:this.toCustomDateFormatParts(o)};case STANDARD_FORMAT_STRINGS.DATE_TIME_UNIVERSAL_FULL:r="utc";case STANDARD_FORMAT_STRINGS.DATETIME_FULL_LONG_TIME:var T=[...new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).formatToParts(new Date(2e3,0,5)),{type:"literal",value:" "},...new Intl.DateTimeFormat(e,{timeStyle:"medium"}).formatToParts(new Date(2e3,0,5,1,2,3))];return{dateTimeKind:r,culture:a,customDateFormatParts:this.toCustomDateFormatParts(T)};case STANDARD_FORMAT_STRINGS.DATETIME_GENERAL_SHORT_TIME:n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1};break;case STANDARD_FORMAT_STRINGS.DATETIME_GENERAL_LONG_TIME:n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1};break;case STANDARD_FORMAT_STRINGS.MONTH_DAY_1:case STANDARD_FORMAT_STRINGS.MONTH_DAY_2:{const s=new Intl.DateTimeFormat(e,{dateStyle:"short"}).formatToParts(new Date(2e3,0,5));T=s.find(t=>"day"===t.type),T=T&&1===T.value.length?"numeric":"2-digit";n={month:"long",day:T};break}case STANDARD_FORMAT_STRINGS.ROUND_TRIP_DATE_TIME_1:case STANDARD_FORMAT_STRINGS.ROUND_TRIP_DATE_TIME_2:return{dateTimeKind:r,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.RFC1123_1:case STANDARD_FORMAT_STRINGS.RFC1123_2:return{dateTimeKind:r,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.DATE_TIME_SORTABLE:return{dateTimeKind:r,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.TIME_SHORT:n={timeStyle:"short"};break;case STANDARD_FORMAT_STRINGS.TIME_LONG:n={timeStyle:"long"};break;case STANDARD_FORMAT_STRINGS.DATE_TIME_UNIVERSAL_SORTABLE:return{dateTimeKind:r,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd HH':'mm':'ss'Z'",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.YEAR_MONTH_1:case STANDARD_FORMAT_STRINGS.YEAR_MONTH_2:n={month:"long",year:"numeric"}}return{dateTimeKind:r,culture:a,customDateFormatParts:this.toCustomDateFormatParts(new Intl.DateTimeFormat(e,n).formatToParts(new Date(2e3,0,5,14)))}}inspectCustomFormat(a,t){if(1===a.length)return this.inspectStandardFormatString(a,t);const r=[];let n="",o=!1,T=!1,s="";for(let e=0;e<=a.length;e++){var i=a[e];if(T)i===s?(r.push({type:"literal",value:n}),n="",T=!1,s=""):i&&(n+=i);else if(o){if(e===a.length)throw new ActivityInputError("format","Escape character without subsequent character.");r.push({type:"literal",value:i}),o=!1}else{let t=0<e?a[e-1]:"";if(a[e-2]===CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER&&(t=""),i!==t){var l=maxLengths[t];if(void 0!==l&&n.length>l)throw new ActivityInputError("format",`Too many occurrences of the '${t}' character in a sequence.`);switch(t){case"":break;case CUSTOM_FORMAT_CHARS.CUSTOM_FORMAT_SPECIFIER:if(e===a.length)throw new ActivityInputError("format","In a custom format string, the '%' character must be followed by another character.");continue;case CUSTOM_FORMAT_CHARS.DATE_SEPARATOR:r.push({type:"dateSeparator",length:n.length});break;case CUSTOM_FORMAT_CHARS.DAY:r.push({type:"day",length:n.length});break;case CUSTOM_FORMAT_CHARS.ERA:r.push({type:"era",length:n.length});break;case CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER:break;case CUSTOM_FORMAT_CHARS.HOURS_LOWER:r.push({type:"hour",length:n.length});break;case CUSTOM_FORMAT_CHARS.HOURS_UPPER:r.push({type:"hour24",length:n.length});break;case CUSTOM_FORMAT_CHARS.LITERAL_DOUBLE_QUOTE:case CUSTOM_FORMAT_CHARS.LITERAL_SINGLE_QUOTE:break;case CUSTOM_FORMAT_CHARS.MERIDIEM:r.push({type:"dayPeriod",length:n.length});break;case CUSTOM_FORMAT_CHARS.MINUTE:r.push({type:"minute",length:n.length});break;case CUSTOM_FORMAT_CHARS.MONTH:r.push({type:"month",length:n.length});break;case CUSTOM_FORMAT_CHARS.OFFSET:r.push({type:"offset",length:n.length});break;case CUSTOM_FORMAT_CHARS.SECONDS:r.push({type:"second",length:n.length});break;case CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_LOWER:r.push({type:"fractionalSecond",length:n.length});break;case CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_UPPPER:r.push({type:"fractionalSecondOptional",length:n.length});break;case CUSTOM_FORMAT_CHARS.TIME_SEPARATOR:r.push({type:"timeSeparator",length:n.length});break;case CUSTOM_FORMAT_CHARS.TIME_ZONE:r.push({type:"offset",length:3});break;case CUSTOM_FORMAT_CHARS.YEAR:r.push({type:"year",length:n.length});break;default:r.push({type:"literal",value:n})}i&&(i===CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER?o=!0:n=isLiteralChar(i)?(T=!0,s=i,""):i)}else n+=i}}if(T)throw new ActivityInputError("format",`Unterminated literal: ${s}${n}`);return{customDateFormatParts:r,culture:"current",dateTimeKind:"local"}}renderCustom(r,t,e){if(t.length<1)return"";var{culture:a,customDateFormatParts:t,dateTimeKind:n}=this.inspectCustomFormat(t,e);"invariant"===a&&(e="inv");let o;"utc"===n&&(o="utc");const T=[];for(const h of t){const{type:O,value:E}=h;var s=h.length??1;switch(O){case"day":{let t="";switch(s){case 1:case 2:t=("utc"===n?r.getUTCDate():r.getDate()).toString(),2===s&&1===t.length&&(t="0"+t);break;default:t=new Intl.DateTimeFormat(e,{timeZone:o,weekday:3===s?"short":"long"}).format(r)}T.push(t);break}case"month":{let t="";switch(s){case 1:case 2:t=(("utc"===n?r.getUTCMonth():r.getMonth())+1).toString(),2===s&&1===t.length&&(t="0"+t);break;default:t=new Intl.DateTimeFormat(e,{month:3===s?"short":"long",timeZone:o}).format(r)}T.push(t);break}case"year":{let t=("utc"===n?r.getUTCFullYear():r.getFullYear()).toString();switch(s){case 1:case 2:2<t.length&&(t=t.substring(t.length-2,t.length)),1===s&&2===t.length&&"0"===t[0]&&(t=t.substring(1,2));break;default:t.length<s&&(t="0".repeat(s-t.length)+t)}T.push(t)}break;case"hour":case"hour24":{let t="utc"===n?r.getUTCHours():r.getHours();"hour"===O&&(12<t&&(t-=12),0===t&&(t=12));let e=t.toString();1<s&&1===e.length&&(e="0"+e),T.push(e);break}case"minute":{let t=("utc"===n?r.getUTCMinutes():r.getMinutes()).toString();1<s&&1===t.length&&(t="0"+t),T.push(t);break}case"second":{let t=("utc"===n?r.getUTCSeconds():r.getSeconds()).toString();1<s&&1===t.length&&(t="0"+t),T.push(t);break}case"fractionalSecond":case"fractionalSecondOptional":{const M="utc"===o?r.getUTCMilliseconds():r.getMilliseconds();let t=M.toString();if(M<10?t="00"+M:M<100&&(t="0"+M),t.length>s&&(t=t.substring(0,s)),"fractionalSecondOptional"===O)for(;t.endsWith("0");)t=t.substring(0,t.length-1);else t.length<s&&(t+="0".repeat(s-t.length));if("fractionalSecondOptional"===O&&""===t){const D=0<T.length?T[T.length-1]:void 0;D?.endsWith(".")&&(T[T.length-1]=D.substring(0,D.length-1))}else T.push(t);break}case"dayPeriod":var i=new Intl.DateTimeFormat(e,{hourCycle:"h12",timeStyle:"short",timeZone:o}).formatToParts(r).find(t=>t.type===O);i&&T.push(i.value);break;case"era":var l=new Intl.DateTimeFormat(e,{era:"short"}).formatToParts(r).find(t=>t.type===O);l&&T.push(l.value);break;case"timeZoneName":var m=new Intl.DateTimeFormat(e,{timeZoneName:"short"}).formatToParts(r).find(t=>t.type===O);m&&T.push(m.value);break;case"literal":E&&T.push(E);break;case"offset":{var l="utc"===o?0:-1*r.getTimezoneOffset(),m=l/60,S=Math.trunc(m),_=l%60;let a=Math.abs(m).toString();switch(s){case 1:break;case 2:1===a.length&&(a="0"+a);break;default:{let t=Math.abs(S).toString(),e=Math.abs(_).toString();1===t.length&&(t="0"+t),1===e.length&&(e="0"+e),a=`${t}:${e}`;break}}a=0<=m?"+"+a:"-"+a,T.push(a);break}case"dateSeparator":{const F=new Intl.DateTimeFormat(e,{dateStyle:"short"}).formatToParts(r);var c=F.findIndex(t=>"day"===t.type),A=F.findIndex(t=>"month"===t.type);if(-1!==c&&-1!==A){var R=Math.min(c,A),u=Math.max(c,A);for(let t=R+1;t<u;t++){const d=F[t];if("literal"===d.type){T.push(d.value.repeat(s));break}}}break}case"timeSeparator":{const g=new Intl.DateTimeFormat(e,{timeStyle:"short"}).formatToParts(r);c=g.findIndex(t=>"hour"===t.type),A=g.findIndex(t=>"literal"===t.type),R=g.findIndex(t=>"minute"===t.type);0<=c&&c<A&&A<R&&T.push(g[A].value.repeat(s));break}}}return T.join("")}}var STANDARD_FORMAT_STRINGS,CUSTOM_FORMAT_CHARS;FormatDate.action="gcx:wf:core::FormatDate",FormatDate.suite="gcx:wf:builtin",function(t){t.DATE_SHORT="d",t.DATE_LONG="D",t.DATETIME_FULL_SHORT_TIME="f",t.DATETIME_FULL_LONG_TIME="F",t.DATETIME_GENERAL_SHORT_TIME="g",t.DATETIME_GENERAL_LONG_TIME="G",t.MONTH_DAY_1="m",t.MONTH_DAY_2="M",t.ROUND_TRIP_DATE_TIME_1="o",t.ROUND_TRIP_DATE_TIME_2="O",t.RFC1123_1="r",t.RFC1123_2="R",t.DATE_TIME_SORTABLE="s",t.TIME_SHORT="t",t.TIME_LONG="T",t.DATE_TIME_UNIVERSAL_SORTABLE="u",t.DATE_TIME_UNIVERSAL_FULL="U",t.YEAR_MONTH_1="y",t.YEAR_MONTH_2="Y"}(STANDARD_FORMAT_STRINGS=STANDARD_FORMAT_STRINGS||{}),function(t){t.CUSTOM_FORMAT_SPECIFIER="%",t.DATE_SEPARATOR="/",t.DAY="d",t.ERA="g",t.ESCAPE_CHARACTER="\\",t.HOURS_LOWER="h",t.HOURS_UPPER="H",t.LITERAL_DOUBLE_QUOTE='"',t.LITERAL_SINGLE_QUOTE="'",t.MERIDIEM="t",t.MINUTE="m",t.MONTH="M",t.OFFSET="z",t.SECONDS="s",t.SECONDS_FRACTION_LOWER="f",t.SECONDS_FRACTION_UPPPER="F",t.TIME_SEPARATOR=":",t.TIME_ZONE="K",t.YEAR="y"}(CUSTOM_FORMAT_CHARS=CUSTOM_FORMAT_CHARS||{});const maxLengths={[CUSTOM_FORMAT_CHARS.CUSTOM_FORMAT_SPECIFIER]:1,[CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_LOWER]:7,[CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_UPPPER]:7};function isLiteralChar(t){return[CUSTOM_FORMAT_CHARS.LITERAL_DOUBLE_QUOTE,CUSTOM_FORMAT_CHARS.LITERAL_SINGLE_QUOTE].includes(t)}export{FormatDate};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExecuteFunctionOutputs } from "./ExecuteFunction";
|
|
2
2
|
import type { IActivityContext, IActivityHandler } from "../../IActivityHandler";
|
|
3
|
-
export interface
|
|
4
|
-
subworkflow:
|
|
3
|
+
export interface FunctionInputs {
|
|
4
|
+
subworkflow: ExecuteFunctionOutputs;
|
|
5
5
|
argumentsType?: "any" | "{ addressCandidate: esri.AddressCandidate }" | "{ extent: esri.Extent }" | "{ featureSet: esri.FeatureSet }" | "{ geometry: esri.Geometry }" | "{ graphic: esri.Graphic }" | "{ id: number; name: string; location: esri.Point; }" | "{ layer: esri.Layer }" | "{ multiPoint: esri.Multipoint }" | "{ point: esri.Point }" | "{ polygon: esri.Polygon }" | "{ polyline: esri.Polyline }" | "{ portalGroup: esri.PortalGroup }" | "{ portalUser: esri.PortalUser }" | "{ spatialReference: esri.SpatialReference }" | "{ symbol: esri.Symbol }" | string;
|
|
6
6
|
resultType?: "any" | "ArrayBuffer" | "boolean" | "Date" | "Error" | "Function" | "number" | "number[]" | "Object" | "string" | "string[]" | "esri.Graphic" | "esri.Extent" | "esri.Geometry" | "esri.Multipoint" | "esri.Point" | "esri.Polygon" | "esri.Polyline" | "esri.PortalGroup" | "esri.PortalUser" | "esri.SpatialReference" | "esri.Layer" | "esri.Symbol" | "esri.AddressCandidate" | "esri.FeatureSet" | "{ id: number; name: string; location: esri.Point; }" | string;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface FunctionOutputs {
|
|
9
9
|
arguments?: Record<string, any>;
|
|
10
10
|
setResult: (value: any) => void;
|
|
11
11
|
}
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class Function implements IActivityHandler {
|
|
13
13
|
static readonly action = "gcx:wf:core::Subworkflow";
|
|
14
14
|
static readonly suite = "gcx:wf:builtin";
|
|
15
|
-
execute(inputs:
|
|
15
|
+
execute(inputs: FunctionInputs, context: IActivityContext): FunctionOutputs;
|
|
16
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class Function{execute(t,n){0===n.passes&&n.call("content");const e=t.subworkflow;return{arguments:e?.arguments,setResult:t=>{e&&(e.result=t)}}}}Function.action="gcx:wf:core::Subworkflow",Function.suite="gcx:wf:builtin";export{Function};
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import type { IActivityHandler, IActivityContext, EmptyInputs } from "../../IActivityHandler";
|
|
3
3
|
/** Defines outputs to the GetWorkflowInputs activity. */
|
|
4
4
|
export interface GetWorkflowInputsOutputs {
|
|
5
|
-
inputs:
|
|
5
|
+
inputs: object;
|
|
6
6
|
}
|
|
7
7
|
/** Activity which gets the input parameters of the workflow. */
|
|
8
8
|
export declare class GetWorkflowInputs implements IActivityHandler {
|
|
9
9
|
static readonly action = "gcx:wf:core::GetWorkflowInputs";
|
|
10
10
|
static readonly suite = "gcx:wf:builtin";
|
|
11
|
-
execute(
|
|
11
|
+
execute(_inputs: EmptyInputs, context: IActivityContext): GetWorkflowInputsOutputs;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class ParseUrl{execute(e){let r=e.url;if("string"!=typeof r){if("undefined"==typeof location||null===location)return{};r=location.href}const t={};var n=r.match(/^([
|
|
1
|
+
class ParseUrl{execute(e){let r=e.url;if("string"!=typeof r){if("undefined"==typeof location||null===location)return{};r=location.href}const t={};var n=r.match(/^([^?#]+?)?(\?.*?)?(#.*)?$/),e=n[1];const o=n[2];n=n[3];if(o){var l,c,s=/(.*?)=(.*)/;for(const a of o.substring(1).split("&")){const i=a.match(s);i&&0<i.length&&(l=i[1],c=decodeURIComponent(i[2].replace(/\+/g," ")),t[l]=c)}}return{url:r,query:t,request:e,queryString:o,fragment:n}}}ParseUrl.action="gcx:wf:core::ParseUrl",ParseUrl.suite="gcx:wf:builtin";export{ParseUrl};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EmptyOutputs, IActivityHandler } from "../../IActivityHandler";
|
|
2
2
|
export declare class Placeholder implements IActivityHandler {
|
|
3
3
|
static readonly action = "gcx:wf:core::Placeholder";
|
|
4
4
|
static readonly suite = "gcx:wf:builtin";
|
|
5
|
-
execute(
|
|
5
|
+
execute(): EmptyOutputs;
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class Placeholder{execute(
|
|
1
|
+
class Placeholder{execute(){return{}}}Placeholder.action="gcx:wf:core::Placeholder",Placeholder.suite="gcx:wf:builtin";export{Placeholder};
|
|
@@ -2,7 +2,7 @@ import type { IActivityHandler, EmptyOutputs } from "../../IActivityHandler";
|
|
|
2
2
|
/** Defines inputs for the SetProperty activity. */
|
|
3
3
|
export interface SetPropertyInputs {
|
|
4
4
|
/** The object to set the property on. */
|
|
5
|
-
object:
|
|
5
|
+
object: object;
|
|
6
6
|
/** The name of the property to set. */
|
|
7
7
|
propertyName: string;
|
|
8
8
|
/** The value of the property. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validation}from"../../Validation.js";class TextReplace{execute(e){const a=validation.string("text",e.text,validation.never),t=validation.string("oldValue",e.oldValue,validation.never);var
|
|
1
|
+
import{validation}from"../../Validation.js";class TextReplace{execute(e){const a=validation.string("text",e.text,validation.never),t=validation.string("oldValue",e.oldValue,validation.never);var i=validation.string("newValue",e.newValue,""),l=validation.boolean("ignoreCase",e.ignoreCase,!1),e=t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),l=new RegExp(e,"g"+(l?"i":""));return{result:a.replace(l,i)}}}TextReplace.action="gcx:wf:core::TextReplace",TextReplace.suite="gcx:wf:builtin";export{TextReplace};
|
|
@@ -8,5 +8,5 @@ export interface TryCatchOutputs {
|
|
|
8
8
|
export declare class TryCatch implements IActivityHandler {
|
|
9
9
|
static readonly action = "gcx:wf:core::TryCatch";
|
|
10
10
|
static readonly suite = "gcx:wf:builtin";
|
|
11
|
-
execute(
|
|
11
|
+
execute(_inputs: EmptyInputs, context: IActivityContext): TryCatchOutputs;
|
|
12
12
|
}
|
|
@@ -48,5 +48,5 @@ export interface WebRequestOutputs {
|
|
|
48
48
|
export declare class WebRequest implements IActivityHandler {
|
|
49
49
|
static readonly action = "gcx:wf:core:request:WebRequest";
|
|
50
50
|
static readonly suite = "gcx:wf:builtin";
|
|
51
|
-
execute(inputs: WebRequestInputs, context: IActivityContext,
|
|
51
|
+
execute(inputs: WebRequestInputs, context: IActivityContext, ChannelProviderType: typeof ChannelProvider): Promise<WebRequestOutputs>;
|
|
52
52
|
}
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* @product This is intended for internal use only within VertiGIS Studio products.
|
|
7
7
|
* @param query The object to be sent using an esri.request.
|
|
8
8
|
*/
|
|
9
|
-
export declare function jsonToQueryObject(contentObject: Record<string, any>):
|
|
9
|
+
export declare function jsonToQueryObject(contentObject: Record<string, any>): Record<string, any>;
|
|
10
10
|
export declare function jsonToFormData(contentObject: Record<string, any>): FormData;
|
|
@@ -221,5 +221,5 @@ export interface GetEssentialsSiteOutputs {
|
|
|
221
221
|
export declare class GetEssentialsSite implements IActivityHandler {
|
|
222
222
|
static readonly action = "gcx:wf:essentials::GetEssentialsSite";
|
|
223
223
|
static readonly suite = "gcx:wf:builtin";
|
|
224
|
-
execute(
|
|
224
|
+
execute(_inputs: EmptyInputs, context: IActivityContext): GetEssentialsSiteOutputs;
|
|
225
225
|
}
|
|
@@ -17,7 +17,7 @@ export interface RunEssentialsWorkflowOutputs {
|
|
|
17
17
|
export declare class RunEssentialsWorkflow implements IActivityHandler {
|
|
18
18
|
static readonly action = "gcx:wf:essentials::RunEssentialsWorkflow";
|
|
19
19
|
static readonly suite = "gcx:wf:builtin";
|
|
20
|
-
execute(inputs: RunEssentialsWorkflowInputs, context: IActivityContext,
|
|
20
|
+
execute(inputs: RunEssentialsWorkflowInputs, context: IActivityContext, ChannelProviderType: typeof ChannelProvider): Promise<RunEssentialsWorkflowOutputs>;
|
|
21
21
|
private isString;
|
|
22
22
|
private getWorkflowSchema;
|
|
23
23
|
private validateInputs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import Bluebird from"bluebird";import{GenericActivityError}from"../../Errors.js";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{ChannelProvider}from"../core/ChannelProvider.js";class WorkflowSchema{constructor(){this.inputs={}}}let RunEssentialsWorkflow=class{async execute(e,t,r){var n=validation.string("url",e.url,validation.never),
|
|
1
|
+
import{__decorate}from"tslib";import Bluebird from"bluebird";import{GenericActivityError}from"../../Errors.js";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{ChannelProvider}from"../core/ChannelProvider.js";class WorkflowSchema{constructor(){this.inputs={}}}let RunEssentialsWorkflow=class{async execute(e,t,r){var n=validation.string("url",e.url,validation.never),s=await this.getWorkflowSchema(n,r),o=this.validateInputs(e.arguments,s);if(o)return Bluebird.reject(o);const i=r.create(void 0,"geocortex");i.request.url=n+"/run",i.timeout=validation.number("timeout",e.timeout,6e4),i.request.method="POST",i.request.headers["Content-Type"]="application/x-www-form-urlencoded",i.request.json={inargs:this.constructInArgs(e.arguments,s),f:"json"},t.cancellationToken.finally(function(){i.cancel()});s=(new Date).valueOf(),t=await i.send(),s=(new Date).valueOf()-s;const a={result:{}};if(t){t=i.getResponseData(i.response.payload);if("Completed"===t.status){t=t.outputs;if(t)for(const f of t){var l=f.name,u=f.value;a.result[l]=u}return a}}const c=new GenericActivityError(void 0,"Error running Essentials Workflow activity.");throw c.timedOut=s>=i.timeout,c.elapsed=s,c.error=i.response.error,c.partialResult=a,c}isString(e){return"string"==typeof e}async getWorkflowSchema(e,t){const r=t.create(void 0,"geocortex");if(r.request.url=e,r.request.json={f:"json",deep:!0},await r.send()){const o=new WorkflowSchema;e=r.getResponseData(r.response.payload).inputs;if(e)for(const i of e){var n=i.name,s=i.typeName;this.isString(n)&&this.isString(s)&&(o.inputs[n]={name:n,typeName:s})}return o}throw new GenericActivityError(void 0,"Error running Essentials Workflow activity. Error retrieving workflow schema.")}validateInputs(r,e){const n=[],s=[],t=Object.keys(r);for(const i in e.inputs)t.includes(i)||n.push(i);const o=Object.keys(e.inputs);for(const a in r)o.includes(a)||s.push(a);if(0<n.length+s.length){let e="",t="";n.length&&(e=" Missing parameters: "+n),s.length&&(t=" Unexpected parameters: "+s);r="Invalid parameters supplied to Essentials Workflow activity."+e+t;return new GenericActivityError(void 0,r)}}constructInArgs(e,t){const r=[];for(const n in e)r.push({name:n,typeName:t.inputs[n].typeName,value:e[n]});return r}};RunEssentialsWorkflow.action="gcx:wf:essentials::RunEssentialsWorkflow",RunEssentialsWorkflow.suite="gcx:wf:builtin",RunEssentialsWorkflow=__decorate([activate(ChannelProvider)],RunEssentialsWorkflow);export{RunEssentialsWorkflow};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DisplayFormOutputs } from "./DisplayForm";
|
|
2
|
-
import type { IActivityHandler,
|
|
2
|
+
import type { IActivityHandler, EmptyOutputs } from "../../IActivityHandler";
|
|
3
3
|
import type * as defs from "../../forms/FormDefinition";
|
|
4
4
|
export interface AddFormElementInputs {
|
|
5
5
|
form: DisplayFormOutputs;
|
|
@@ -10,9 +10,11 @@ export interface AddFormElementInputs {
|
|
|
10
10
|
/** The definition of the form element to add. */
|
|
11
11
|
element: defs.Element;
|
|
12
12
|
targetForm?: DisplayFormOutputs;
|
|
13
|
+
targetElement?: string | defs.Element;
|
|
14
|
+
targetPosition?: "above" | "below" | "before" | "after" | string;
|
|
13
15
|
}
|
|
14
16
|
export declare class AddFormElement implements IActivityHandler {
|
|
15
17
|
static readonly action = "gcx:wf:forms::AddFormElement";
|
|
16
18
|
static readonly suite = "gcx:wf:builtin";
|
|
17
|
-
execute(inputs: AddFormElementInputs
|
|
19
|
+
execute(inputs: AddFormElementInputs): EmptyOutputs;
|
|
18
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validation}from"../../Validation.js";import{setFormForElement}from"./FormElementMap.js";class AddFormElement{execute(e
|
|
1
|
+
import{validation}from"../../Validation.js";import{setFormForElement}from"./FormElementMap.js";class AddFormElement{execute(e){var{elementName:t,elementType:o,element:r,targetForm:n,targetPosition:a}=e;let{form:m,targetElement:i}=e;if(m=n||m,validation.exists("form",m),validation.string("elementName",t,validation.never),validation.string("elementType",o,validation.never),"Header"===o)throw new Error("A form cannot contain more than one header element.");i=m.actor.getElementName(i,m.event);let l;switch(a){case"above":case"below":case"before":case"after":l=a}n=l&&i?{relativePosition:l,targetElementName:i}:void 0,n=m.actor.addElement(t,o,r,n);return setFormForElement(n,m),{}}}AddFormElement.action="gcx:wf:forms::AddFormElement",AddFormElement.suite="gcx:wf:builtin";export{AddFormElement};
|
|
@@ -33,9 +33,9 @@ export declare class DisplayForm implements IActivityHandler {
|
|
|
33
33
|
* Creates a form renderer if it does not exist.
|
|
34
34
|
* @param inputs The inputs to create the renderer.
|
|
35
35
|
* @param context The context to use to create the renderer.
|
|
36
|
-
* @param
|
|
36
|
+
* @param FormRendererType The type of FormRenderer (subclass) to create.
|
|
37
37
|
*/
|
|
38
|
-
static createRenderer(inputs: DisplayFormInputs, context: IActivityContext,
|
|
38
|
+
static createRenderer(inputs: DisplayFormInputs, context: IActivityContext, FormRendererType: typeof FormRenderer): FormRenderer;
|
|
39
39
|
static readonly action = "gcx:wf:forms:form:DisplayForm";
|
|
40
40
|
static readonly suite = "gcx:wf:builtin";
|
|
41
41
|
/** Performs the operation on behalf of the engine. */
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defs } from "../../forms/FormHost";
|
|
2
|
+
import type { FormElementRegistration } from "../../forms/index";
|
|
3
|
+
export { defs };
|
|
4
|
+
/**
|
|
5
|
+
* Describes the position of something relative to something else.
|
|
6
|
+
* We use "before" and "after" instead of "left" and "right" to still make sense
|
|
7
|
+
* in a right-to-left environment.
|
|
8
|
+
*/
|
|
9
|
+
export type RelativePosition = "above" | "below" | "before" | "after";
|
|
10
|
+
/**
|
|
11
|
+
* Details of where to position an element when adding it to the form.
|
|
12
|
+
*/
|
|
13
|
+
export interface ElementPosition {
|
|
14
|
+
/** The direction we move from the target element to determine the new position. */
|
|
15
|
+
relativePosition: RelativePosition;
|
|
16
|
+
/** The name of the element to use as a starting position. */
|
|
17
|
+
targetElementName: string;
|
|
18
|
+
}
|
|
19
|
+
/** Defines what the renderer exposes. */
|
|
20
|
+
export default interface FormActor {
|
|
21
|
+
/** Returns the element with the given name. If the element does not exist an error will be thrown. */
|
|
22
|
+
getElement(element: string | defs.Element | undefined, event?: defs.Event): defs.Element;
|
|
23
|
+
getElementRegistration(element: defs.Element): FormElementRegistration | undefined;
|
|
24
|
+
/** Returns the name of the given element. If the element does not exist an error will be thrown. */
|
|
25
|
+
getElementName(element: defs.Element | string | undefined, event?: defs.Event): string;
|
|
26
|
+
/** Sets element visibility to false. */
|
|
27
|
+
hideElement(element: defs.Element): void;
|
|
28
|
+
/** Sets element visibility to true. */
|
|
29
|
+
showElement(element: defs.Element): void;
|
|
30
|
+
/** Assigns an error message to an element. */
|
|
31
|
+
setElementError(elementName: string, error: string | undefined, markdown?: boolean): void;
|
|
32
|
+
/** Finds the specified item and sets it as the current one. Returns true if a match was found, false otherwise. */
|
|
33
|
+
setCurrentItem(elementName: string, value: defs.Value | defs.Text | defs.Item, matchType: defs.ItemMatchType): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Assigns a property to an element, or overwrites an existing property.
|
|
36
|
+
* @param elementName The name of the element to be updated.
|
|
37
|
+
* @param propertyName The name of the property of the element to be updated.
|
|
38
|
+
* @param propertyValue The new value for the element's property.
|
|
39
|
+
* @param markdown (optional) True if the value should be treated as markdown, false otherwise. The default value is false.
|
|
40
|
+
* @param event (optional) Only relevant when `propertyName` is `"value"`. If a boolean value, indicates whether or not to post a "changed" event. If a `Partial<defs.Element>` specifies some of the properties of the event to be posted. Any `name` and `value` provided here are ignored. The default value is true.
|
|
41
|
+
*/
|
|
42
|
+
assignElementProperty(elementName: string, propertyName: string, propertyValue: any, markdown?: boolean, event?: Partial<defs.Event> | boolean): void;
|
|
43
|
+
/** Assigns an items property to an element. */
|
|
44
|
+
assignItemsToElement(elementName: string, items: Record<string, defs.Item>, reset?: boolean): void;
|
|
45
|
+
/** Assigns a property to an element item, or overwrites an existing property. */
|
|
46
|
+
assignElementItemProperty(elementName: string, itemKey: string, propertyName: string, propertyValue: any, markdown?: boolean): void;
|
|
47
|
+
/** Filters the items of an element based on heuristics. */
|
|
48
|
+
filterItems(elementName: string, phrase: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Adds the supplied element to the form.
|
|
51
|
+
* @param elementName The unique name for the element.
|
|
52
|
+
* @param type The type of element to add.
|
|
53
|
+
* @param element The contents of the element to add.
|
|
54
|
+
*/
|
|
55
|
+
addElement(elementName: string, type: string, element: defs.Element, elementPosition?: ElementPosition): defs.Element;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defs}from"../../forms/FormHost.js";export{defs};
|
|
@@ -1,45 +1,9 @@
|
|
|
1
1
|
import { FormHost, defs } from "../../forms/FormHost";
|
|
2
|
+
import type { ElementPosition } from "./FormActor";
|
|
3
|
+
import type FormActor from "./FormActor";
|
|
2
4
|
import type { Activator } from "../../Activator";
|
|
3
5
|
import type { FormElementRegistration } from "../../forms/index";
|
|
4
6
|
export { defs };
|
|
5
|
-
/** Defines what the renderer exposes. */
|
|
6
|
-
export interface FormActor {
|
|
7
|
-
/** Returns the element with the given name. If the element does not exist an error will be thrown. */
|
|
8
|
-
getElement(element: string | defs.Element | undefined, event?: defs.Event): defs.Element;
|
|
9
|
-
getElementRegistration(element: defs.Element): FormElementRegistration | undefined;
|
|
10
|
-
/** Returns the name of the given element. If the element does not exist an error will be thrown. */
|
|
11
|
-
getElementName(element: defs.Element | string | undefined, event?: defs.Event): string;
|
|
12
|
-
/** Sets element visibility to false. */
|
|
13
|
-
hideElement(element: defs.Element): void;
|
|
14
|
-
/** Sets element visibility to true. */
|
|
15
|
-
showElement(element: defs.Element): void;
|
|
16
|
-
/** Assigns an error message to an element. */
|
|
17
|
-
setElementError(elementName: string, error: string | undefined, markdown?: boolean): void;
|
|
18
|
-
/** Finds the specified item and sets it as the current one. Returns true if a match was found, false otherwise. */
|
|
19
|
-
setCurrentItem(elementName: string, value: defs.Value | defs.Text | defs.Item, matchType: defs.ItemMatchType): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Assigns a property to an element, or overwrites an existing property.
|
|
22
|
-
* @param elementName The name of the element to be updated.
|
|
23
|
-
* @param propertyName The name of the property of the element to be updated.
|
|
24
|
-
* @param propertyValue The new value for the element's property.
|
|
25
|
-
* @param markdown (optional) True if the value should be treated as markdown, false otherwise. The default value is false.
|
|
26
|
-
* @param event (optional) Only relevant when `propertyName` is `"value"`. If a boolean value, indicates whether or not to post a "changed" event. If a `Partial<defs.Element>` specifies some of the properties of the event to be posted. Any `name` and `value` provided here are ignored. The default value is true.
|
|
27
|
-
*/
|
|
28
|
-
assignElementProperty(elementName: string, propertyName: string, propertyValue: any, markdown?: boolean, event?: Partial<defs.Event> | boolean): void;
|
|
29
|
-
/** Assigns an items property to an element. */
|
|
30
|
-
assignItemsToElement(elementName: string, items: Record<string, defs.Item>, reset?: boolean): void;
|
|
31
|
-
/** Assigns a property to an element item, or overwrites an existing property. */
|
|
32
|
-
assignElementItemProperty(elementName: string, itemKey: string, propertyName: string, propertyValue: any, markdown?: boolean): void;
|
|
33
|
-
/** Filters the items of an element based on heuristics. */
|
|
34
|
-
filterItems(elementName: string, phrase: string): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Adds the supplied element to the form.
|
|
37
|
-
* @param elementName The unique name for the element.
|
|
38
|
-
* @param type The type of element to add.
|
|
39
|
-
* @param element The contents of the element to add.
|
|
40
|
-
*/
|
|
41
|
-
addElement(elementName: string, type: string, element: defs.Element): defs.Element;
|
|
42
|
-
}
|
|
43
7
|
/**
|
|
44
8
|
* Renders a form on behalf of the DisplayForm activity.
|
|
45
9
|
* @public
|
|
@@ -52,7 +16,7 @@ export declare class FormRenderer extends FormHost implements FormActor {
|
|
|
52
16
|
static createCustom(): FormRenderer;
|
|
53
17
|
/** Register this renderer class as the form renderer. */
|
|
54
18
|
static register(activator: Activator): void;
|
|
55
|
-
addElement(elementName: string, type: string, element: defs.Element): defs.Element;
|
|
19
|
+
addElement(elementName: string, type: string, element: defs.Element, elementPosition?: ElementPosition): defs.Element;
|
|
56
20
|
assignElementProperty(elementName: string, propertyName: string, propertyValue: any, markdown?: boolean, event?: Partial<defs.Event> | boolean): void;
|
|
57
21
|
assignElementItemProperty(elementName: string, itemKey: string, propertyName: string, propertyValue: any, markdown?: boolean): void;
|
|
58
22
|
assignItemsToElement(elementName: string, items: Record<string, defs.Item>, reset?: boolean): void;
|
|
@@ -126,8 +90,6 @@ export declare class FormRenderer extends FormHost implements FormActor {
|
|
|
126
90
|
load(): boolean;
|
|
127
91
|
/** Loads the form with a new definition. */
|
|
128
92
|
load(form: defs.Form, template?: defs.Form): boolean;
|
|
129
|
-
/** Renders form text as HTML. */
|
|
130
|
-
renderHtml(content: defs.Text, htmlContentCategory?: defs.HTMLContentCategory): string;
|
|
131
93
|
/** Renders form text as plain text. */
|
|
132
94
|
renderText(content: defs.Text | undefined): string;
|
|
133
95
|
setCurrentItem(elementName: string, searchValue: defs.Value | defs.Text | defs.Item, itemMatchType: defs.ItemMatchType): boolean;
|
|
@@ -135,5 +97,7 @@ export declare class FormRenderer extends FormHost implements FormActor {
|
|
|
135
97
|
showElement(element: defs.Element): void;
|
|
136
98
|
/** Used to request that the form spins without blocking the application. */
|
|
137
99
|
spinNoBlock(): boolean;
|
|
138
|
-
translateText(content:
|
|
100
|
+
translateText(content: string | defs.StatusRef | undefined): string | undefined;
|
|
101
|
+
translateText(content: defs.MarkdownRef | undefined): defs.MarkdownRef | undefined;
|
|
102
|
+
translateText(content: defs.Text | undefined): string | defs.MarkdownRef | undefined;
|
|
139
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ActivityAbortedError}from"../../Errors.js";import{FormHost,defs}from"../../forms/FormHost.js";import{FormElementTypes}from"../../forms/constants.js";import{getContent}from"../../forms/textUtilities.js";import{text}from"../../forms/utils.js";import{FormElementNotFoundError,NoFormElementAvailableError}from"./Errors.js";function toMarkdownRef(e,t){return"string"!=typeof t?t:{markdown:t}}const guid="F889738A-EBE2-4D52-8B46-3E24CC6E30F6:";class FormRenderer extends FormHost{static create(){return new this}static createCustom(){const e=new this;return e.custom=!0,e}static register(e){e.factories.push(e=>e===this.type?this:void 0)}addElement(e,t,
|
|
1
|
+
import{ActivityAbortedError}from"../../Errors.js";import{FormHost,defs}from"../../forms/FormHost.js";import{FormElementTypes}from"../../forms/constants.js";import{getContent}from"../../forms/textUtilities.js";import{text}from"../../forms/utils.js";import{FormElementNotFoundError,NoFormElementAvailableError}from"./Errors.js";function toMarkdownRef(e,t){return"string"!=typeof t?t:{markdown:t}}const guid="F889738A-EBE2-4D52-8B46-3E24CC6E30F6:";class FormRenderer extends FormHost{static create(){return new this}static createCustom(){const e=new this;return e.custom=!0,e}static register(e){e.factories.push(e=>e===this.type?this:void 0)}addElement(e,r,t,o){if(r===FormElementTypes.HEADER)throw new Error("A form cannot contain more than one header element.");const n=this.form["elements"];if(n[e])throw new Error(`Element already present: ${e}`);const s={};if("object"==typeof t)for(const E in t)s[E]=t[E];s.type=r;var i=o?.targetElementName;let m=o?.relativePosition,a=!0;o=()=>{let e=-1;for(const t of Object.values(n))void 0!==t.rowNumber&&(e=Math.max(e,t.rowNumber));return e};let l,f;if(i&&m&&n[i]){let e=0,t=0;i=n[i];switch("header"===i.section?m="above":"footer"===i.section?(m="below",e=o()):(e=i.rowNumber,t=i.rowIndex,i.type!==FormElementTypes.SECTION&&r!==FormElementTypes.SECTION||(t=0,"before"===m?m="above":"after"===m&&(m="below"))),m){case"before":a=!1,l=e,f=t;break;case"after":a=!1,l=e,f=t+1;break;case"above":a=!0,l=e,f=0;break;default:a=!0,l=e+1,f=0}}else f=void 0!==s.rowNumber&&void 0!==s.rowIndex?(l=s.rowNumber||0,s.rowIndex||0):(l=o()+1,0);s.rowNumber=l,s.rowIndex=f;for(const t of Object.values(n)){var{rowNumber:c,rowIndex:u}=t;void 0!==c&&void 0!==u&&(a?c>=l&&t.rowNumber++:c===l&&u>=f&&t.rowIndex++)}n[e]=s;const d=[];for(const e of Object.keys(n)){const t=n[e];t.type===FormElementTypes.SECTION&&(d[t.rowNumber]={name:e})}for(const t of Object.values(n))void 0===t.rowNumber||t.rowNumber<l||t.type!==FormElementTypes.SECTION&&(t.section=(e=>{for(;0<=e;){var t=d[e];if(t)return t;e--}})(t.rowNumber));return this.invalidate(),s}assignElementProperty(t,r,o,e=!1,n=!0){e&&(o=toMarkdownRef(r,o));const s=this.getElement(t);if(s[r]!==o){const i={},m=this.getElementRegistration(s);if(m?.onPropertyChange)try{const a=(e,t)=>{i[e]!==t&&(i[e]=t,m.onPropertyChange({properties:{...s,...i},property:e,setProperty:a}))};a(r,o)}catch(e){throw console.error(`Error setting element property.\nElement: "${t}"\nProperty: "${r}"\nValue: ${o}\n`,e),e}else i[r]=o;for(const l of Object.keys(i))s[l]=i[l];m&&"value"in i&&!1!==n&&(t={..."object"==typeof n?n:{},name:t,value:i.value},this.post("changed",t)),this.refresh()}}assignElementItemProperty(e,t,r,o,n){const s=this.getElement(e),i=s.items||{};if(i[t][r]=n?toMarkdownRef(r,o):o,"checked"===r&&[FormElementTypes.CHECKGROUP,FormElementTypes.ITEMPICKER,FormElementTypes.LISTBOX].includes(s.type)){const a=[];for(const t in i){var m=i[t];m.checked&&a.push(m)}s.value=0===a.length?void 0:{refValueType:"items",items:a}}this.refresh(e)}assignItemsToElement(e,t,r){const o=this.getElement(e);let n=o.items||{};!1!==r&&(n={});for(const s in t)n[s]=t[s];o.items=n,o.type!==FormElementTypes.GEOMETRYPICKER&&o.type!==FormElementTypes.ITEMPICKER||delete o.state,this.invalidate(e)}cancelTool(){}deriveLocale(){return this.state?.locale||super.deriveLocale()}dispose(){if(super.dispose()){const e=this.state;return void 0!==e&&null!==e&&e.completion.isPending()&&e.reject(new ActivityAbortedError),!0}return!1}filterItems(e,t){const r=this.find(e);if(void 0===r||null===r)return!1;var o=r.items;if(null==o)return!1;if("string"!=typeof t)return t;let n=!1;const s={};var i=t.toLowerCase().split(/\s+/);for(const l in o){var m=o[l];const f=this.renderText(m.label);var a=f.toLowerCase().split(/\s+/);for(const c of i)if(0<c.length)for(const u of a)0<u.length&&0===u.indexOf(c)&&(n=!0,s[l]=m)}return r.items=s,this.invalidate(e),n}getElement(e,t){let r;if(e){if("string"!=typeof e)return e;r=e}else t?.name&&(r=t.name);if(r){t=this.form.elements[r];if(!t)throw new FormElementNotFoundError(r);return t}throw new NoFormElementAvailableError}getElementName(e,t){if(e){if("string"==typeof e)return e;for(const r in this.form.elements)if(this.form.elements[r]===e)return r;throw new FormElementNotFoundError(e)}if(t?.name)return t.name;throw new NoFormElementAvailableError}getElementRegistration(e){return this.state?.trivia?.getFormElementRegistration?.(e.customType??e.type)}getText(e){var t=this.state;if(void 0!==t){const r=t.environment.getText;if("function"==typeof r){if(text.isMarkdown(e))return{markdown:r(e.markdown)};if(text.isStatus(e))return{markdown:r(`@form-element-status-${e.status}`)};if(e&&"@"===e[0]){t=r(e);if(t)return t}}}return e}hideElement(e){e.visible=!1,this.invalidate()}isRelated(e){return this.state?.trivia?.isDescendantOf?.(e.state)}load(e,t){t=super.load(e,t);if(t&&this.form?.elements)for(const o in this.form.elements){var r=this.form.elements[o];const n=this.getElementRegistration(r);n&&n.getInitialProperties&&(r={...r,...n.getInitialProperties()},this.form.elements[o]=r)}return t}renderText(e){return super.renderText(this.getText(e))}setCurrentItem(e,t,r){const n=this.getElement(e);if(!n||!n.items)return!1;let o;switch(r){case"index":o=(e,t,r)=>{var o=Object.keys(n.items);return 0<o.length&&e===o[r]};break;case"item":o=(e,t,r)=>r===t;break;case"key":o=(e,t,r)=>r===e;break;case"label":o=(e,t,r)=>getContent(r)===getContent(t.label);break;case"value":o=(e,t,r)=>r===t.value;break;default:throw new Error("Unsupported value for itemMatchType: "+r)}for(const s in n.items)if(o(s,n.items[s],t))return n.current=s,[FormElementTypes.AUTOCOMPLETE,FormElementTypes.DROPDOWNLIST,FormElementTypes.RADIOGROUP].includes(n.type)&&(n.label=n.items[s].label,n.value=n.items[s].value),this.invalidate(e),this.cascade(e),!0;return!1}setElementError(e,t,r=!1){this.errors[e]=r?toMarkdownRef("error",t):t}showElement(e){e.visible=!0,this.invalidate()}spinNoBlock(){return this.spin()}translateText(e){return super.translateText(this.getText(e))}}FormRenderer.type=guid+"FormRenderer";export{defs,FormRenderer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IActivityHandler
|
|
1
|
+
import type { IActivityHandler } from "../../IActivityHandler";
|
|
2
2
|
import type { Item } from "../../forms/FormDefinition";
|
|
3
3
|
export interface GetFormElementItemsFromCollectionInputs {
|
|
4
4
|
/** The collection to be converted to the items collection. */
|
|
@@ -45,5 +45,5 @@ export declare class GetFormElementItemsFromCollection implements IActivityHandl
|
|
|
45
45
|
* Instead, we check every prototype.
|
|
46
46
|
*/
|
|
47
47
|
private getPropertyNames;
|
|
48
|
-
execute(inputs: GetFormElementItemsFromCollectionInputs
|
|
48
|
+
execute(inputs: GetFormElementItemsFromCollectionInputs): GetFormElementItemsFromCollectionOutputs;
|
|
49
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as TemplateUtils from"../../TemplateUtils.js";import{validation}from"../../Validation.js";import{text}from"../../forms/utils.js";class GetFormElementItemsFromCollection{_isLabelFieldName(e,t){return null!=e&&0!==t.length&&e===this._getPropertyName(e,t)}_getPropertyName(e,t){return t.includes(e)?e:void 0}_getPropertyValue(e,t,l){t=this._getPropertyName(e,t);return t?TemplateUtils.valueOrEmptyString(l[t]):void 0}_getTokenValues(e,t,l){const o={};for(const i of e){var r,a=i.token;o.
|
|
1
|
+
import*as TemplateUtils from"../../TemplateUtils.js";import{validation}from"../../Validation.js";import{text}from"../../forms/utils.js";class GetFormElementItemsFromCollection{_isLabelFieldName(e,t){return null!=e&&0!==t.length&&e===this._getPropertyName(e,t)}_getPropertyName(e,t){return t.includes(e)?e:void 0}_getPropertyValue(e,t,l){t=this._getPropertyName(e,t);return t?TemplateUtils.valueOrEmptyString(l[t]):void 0}_getTokenValues(e,t,l){const o={};for(const i of e){var r,a=i.token;const n=Object.keys(o);n.includes(a)||(r=this._getPropertyValue(a,t,l),r=TemplateUtils.getTokenValueString(a,r),o[a]=text.escapeTextForMarkdown(r))}return o}getPropertyNames(e){const t=[];if(!e)return t;for(const l in e)"function"!=typeof e[l]&&t.push(l);return t}execute(l){var o=l.labelFieldName||void 0,r=validation.array("collection",l.collection,validation.never);const a={};var i=0<r.length?this.getPropertyNames(r[0]):[],n=this._isLabelFieldName(o,i),s=n?[]:TemplateUtils.findTokenInstances(o);for(let t=0;t<r.length;++t){var m,c=r[t];let e;e=n?c[l.labelFieldName]:o?(m=this._getTokenValues(s,i,c),TemplateUtils.replacePlaceholders(o,s,m)):c,void 0!==e&&null!==e||(e="");const u={};l.valueFieldName?u.value=c[l.valueFieldName]:u.value={refValueType:"data",type:"object",data:c},text.isMarkdown(e)?u.label=e:u.label=e.toString(),a[t]=u}return{items:a}}}GetFormElementItemsFromCollection.action="gcx:wf:forms::GetFormElementItemsFromCollection",GetFormElementItemsFromCollection.suite="gcx:wf:builtin";export{GetFormElementItemsFromCollection};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DisplayFormOutputs } from "./DisplayForm";
|
|
2
|
-
import type { IActivityHandler
|
|
2
|
+
import type { IActivityHandler } from "../../IActivityHandler";
|
|
3
3
|
import type * as defs from "../../forms/FormDefinition";
|
|
4
4
|
export interface GetFormElementPropertyInputs {
|
|
5
5
|
form: DisplayFormOutputs;
|
|
@@ -15,5 +15,5 @@ export interface GetFormElementPropertyOutputs {
|
|
|
15
15
|
export declare class GetFormElementProperty implements IActivityHandler {
|
|
16
16
|
static readonly action = "gcx:wf:forms::GetFormElementProperty";
|
|
17
17
|
static readonly suite = "gcx:wf:builtin";
|
|
18
|
-
execute(inputs: GetFormElementPropertyInputs
|
|
18
|
+
execute(inputs: GetFormElementPropertyInputs): GetFormElementPropertyOutputs;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validation}from"../../Validation.js";import{getFormForElement}from"./FormElementMap.js";class GetFormElementProperty{execute(e
|
|
1
|
+
import{validation}from"../../Validation.js";import{getFormForElement}from"./FormElementMap.js";class GetFormElementProperty{execute(e){var{elementName:t,name:r}=e;let o=e["form"];return"object"==typeof t&&(o=getFormForElement(t)),validation.exists("form",o),{value:o.actor.getElement(t,o.event)[r]}}}GetFormElementProperty.action="gcx:wf:forms::GetFormElementProperty",GetFormElementProperty.suite="gcx:wf:builtin";export{GetFormElementProperty};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DisplayFormOutputs } from "./DisplayForm";
|
|
2
|
-
import type { IActivityHandler
|
|
2
|
+
import type { IActivityHandler } from "../../IActivityHandler";
|
|
3
3
|
import type * as defs from "../../forms/FormDefinition";
|
|
4
4
|
export interface GetFormElementValueInputs {
|
|
5
5
|
form: DisplayFormOutputs;
|
|
@@ -13,5 +13,5 @@ export interface GetFormElementValueOutputs {
|
|
|
13
13
|
export declare class GetFormElementValue implements IActivityHandler {
|
|
14
14
|
static readonly action = "gcx:wf:forms::GetFormElementValue";
|
|
15
15
|
static readonly suite = "gcx:wf:builtin";
|
|
16
|
-
execute(inputs: GetFormElementValueInputs
|
|
16
|
+
execute(inputs: GetFormElementValueInputs): GetFormElementValueOutputs;
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validation}from"../../Validation.js";import{isDataRef,isDateRangeRef,isDateTimeRef,isFilesRef,isGeometryRef,isItemsRef,isNumberRef,isScanRef}from"../../forms/utils.js";import{getFormForElement}from"./FormElementMap.js";class GetFormElementValue{execute(e
|
|
1
|
+
import{validation}from"../../Validation.js";import{isDataRef,isDateRangeRef,isDateTimeRef,isFilesRef,isGeometryRef,isItemsRef,isNumberRef,isScanRef}from"../../forms/utils.js";import{getFormForElement}from"./FormElementMap.js";class GetFormElementValue{execute(e){var t=e["elementName"];let m=e["form"];"object"==typeof t&&(m=getFormForElement(t)),validation.exists("form",m);let a=m.actor.getElement(t,m.event).value;return isDataRef(a)?a=a.data:isDateRangeRef(a)?a=[a.startDate,a.endDate]:isDateTimeRef(a)?a=a.value:isFilesRef(a)?a=a.files:isGeometryRef(a)?a=a.geometry:isItemsRef(a)?a=a.items:isNumberRef(a)?a=a.numeric:isScanRef(a)&&(a=a.value),{value:a}}}GetFormElementValue.action="gcx:wf:forms::GetFormElementValue",GetFormElementValue.suite="gcx:wf:builtin";export{GetFormElementValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ActivityInputError}from"../../Errors.js";import{validation}from"../../Validation.js";import{getFormForElement}from"./FormElementMap.js";class SetCurrentFormElementItem{execute(e){var{
|
|
1
|
+
import{ActivityInputError}from"../../Errors.js";import{validation}from"../../Validation.js";import{getFormForElement}from"./FormElementMap.js";class SetCurrentFormElementItem{execute(e){var{elementName:t,matchType:r,value:m}=e;let a=e["form"];switch("object"==typeof t&&(a=getFormForElement(t)),validation.exists("form",a),validation.string("matchType",r,validation.never),validation.exists("value",m),r){case"index":case"item":case"key":case"label":case"value":break;default:throw new ActivityInputError("matchOn",'The `matchOn` input must be "index", "item", "key", "label" or "value".')}t=a.actor.getElementName(t,a.event);return{result:a.actor.setCurrentItem(t,m,r)}}}SetCurrentFormElementItem.action="gcx:wf:forms::SetCurrentFormElementItem",SetCurrentFormElementItem.suite="gcx:wf:builtin";export{SetCurrentFormElementItem};
|
|
@@ -8,7 +8,7 @@ export interface SetFormElementEventInputs {
|
|
|
8
8
|
elementName?: string;
|
|
9
9
|
/** The name of the event to add to the Element. */
|
|
10
10
|
eventName: "cancel" | "changed" | "clicked" | "custom" | "dragged" | "load" | "populate" | "submit" | "suggest" | "validate" | string;
|
|
11
|
-
/** The id of the activity to be used as the event handler. This can be a Container,
|
|
11
|
+
/** The id of the activity to be used as the event handler. This can be a Container, Function, or Try Catch. */
|
|
12
12
|
targetActivityId: string;
|
|
13
13
|
}
|
|
14
14
|
export declare class SetFormElementEvent implements IActivityHandler {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GenericActivityError}from"../../Errors.js";import{validation}from"../../Validation.js";class SetFormElementEvent{execute(e,t){
|
|
1
|
+
import{GenericActivityError}from"../../Errors.js";import{validation}from"../../Validation.js";class SetFormElementEvent{execute(e,t){const{eventName:i,form:r}=e;let{displayFormId:n,elementName:o,targetActivityId:m}=e;if(n=validation.string("displayFormId",n),o=validation.string("elementName",o),m=validation.string("targetActivityId",m,validation.never),n&&"$"===n[0]&&(n=n.substring(1)),n=n||t.ambient.activityContexts.$$form.activity.id,!n)throw new GenericActivityError(`No form could be found. displayFormId=${e.displayFormId}`);if(!(o=r.actor.getElementName(o,r.event)))throw new GenericActivityError(`No form element could be found to assign the event to. elementName=${e.elementName}`);return"$"===m[0]&&(m=m.substring(1)),t.ambient.trivia.setFormElementEvent(n,m,o,i),{}}}SetFormElementEvent.action="gcx:wf:forms::SetFormElementEvent",SetFormElementEvent.suite="gcx:wf:builtin";export{SetFormElementEvent};
|