@vertigis/workflow 5.47.0 → 5.48.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/IActivityHandler.d.ts +2 -1
  2. package/activities/arcgis/GetAttributeValue.js +1 -1
  3. package/activities/arcgis/GetAttributeValues.js +1 -1
  4. package/activities/arcgis/IntersectEngineTask.js +1 -1
  5. package/activities/arcgis/MapProvider.js +1 -1
  6. package/activities/core/AwaitAsyncActivity.d.ts +9 -0
  7. package/activities/core/AwaitAsyncActivity.js +1 -0
  8. package/activities/core/WebRequest.js +1 -1
  9. package/activities/forms/FormRenderer.js +1 -1
  10. package/activities/forms/SetFormElementEvent.js +1 -1
  11. package/activities/index.js +1 -1
  12. package/definition/Step.d.ts +1 -1
  13. package/execution/AmbientState.d.ts +2 -0
  14. package/execution/AmbientState.js +1 -1
  15. package/execution/AsyncContext.d.ts +4 -0
  16. package/execution/AsyncContext.js +1 -1
  17. package/forms/FormDefinition.d.ts +4 -4
  18. package/forms/FormHost.d.ts +55 -9
  19. package/forms/FormHost.js +1 -1
  20. package/forms/branding/WorkflowColor.d.ts +17 -0
  21. package/forms/branding/WorkflowColor.js +1 -0
  22. package/forms/branding/colors.d.ts +15 -0
  23. package/forms/branding/colors.js +1 -0
  24. package/forms/branding/createPalette.d.ts +21 -0
  25. package/forms/branding/createPalette.js +1 -0
  26. package/forms/components/AutoComplete.d.ts +1 -1
  27. package/forms/components/AutoComplete.js +1 -1
  28. package/forms/components/Button.d.ts +7 -0
  29. package/forms/components/Button.js +1 -1
  30. package/forms/components/ButtonBar.d.ts +1 -1
  31. package/forms/components/ButtonBar.js +1 -1
  32. package/forms/components/CheckBox.d.ts +1 -1
  33. package/forms/components/CheckBox.js +1 -1
  34. package/forms/components/CheckGroup.d.ts +1 -1
  35. package/forms/components/CheckGroup.js +1 -1
  36. package/forms/components/Custom.d.ts +1 -1
  37. package/forms/components/Custom.js +1 -1
  38. package/forms/components/DatePicker.d.ts +1 -1
  39. package/forms/components/DatePicker.js +1 -1
  40. package/forms/components/DateRangePicker.d.ts +1 -1
  41. package/forms/components/DateRangePicker.js +1 -1
  42. package/forms/components/DateTimePicker.d.ts +1 -1
  43. package/forms/components/DateTimePicker.js +1 -1
  44. package/forms/components/DropDownList.d.ts +1 -1
  45. package/forms/components/DropDownList.js +1 -1
  46. package/forms/components/FilePicker.d.ts +1 -1
  47. package/forms/components/FilePicker.js +1 -1
  48. package/forms/components/Form.js +1 -1
  49. package/forms/components/GeometryPicker.d.ts +1 -1
  50. package/forms/components/GeometryPicker.js +1 -1
  51. package/forms/components/HorizontalRule.d.ts +1 -1
  52. package/forms/components/HorizontalRule.js +1 -1
  53. package/forms/components/Image.d.ts +1 -1
  54. package/forms/components/Image.js +1 -1
  55. package/forms/components/ItemPicker.d.ts +2 -2
  56. package/forms/components/ItemPicker.js +1 -1
  57. package/forms/components/ListBox.d.ts +1 -1
  58. package/forms/components/ListBox.js +1 -1
  59. package/forms/components/Number.d.ts +1 -1
  60. package/forms/components/Number.js +1 -1
  61. package/forms/components/NumberRangeSlider.d.ts +1 -1
  62. package/forms/components/NumberRangeSlider.js +1 -1
  63. package/forms/components/NumberSlider.d.ts +1 -1
  64. package/forms/components/NumberSlider.js +1 -1
  65. package/forms/components/RadioGroup.d.ts +1 -1
  66. package/forms/components/RadioGroup.js +1 -1
  67. package/forms/components/Scanner.d.ts +2 -2
  68. package/forms/components/Scanner.js +1 -1
  69. package/forms/components/Section.d.ts +1 -1
  70. package/forms/components/Section.js +1 -1
  71. package/forms/components/Signature.d.ts +1 -1
  72. package/forms/components/Signature.js +1 -1
  73. package/forms/components/Sketch.d.ts +1 -1
  74. package/forms/components/Sketch.js +1 -1
  75. package/forms/components/Text.d.ts +1 -1
  76. package/forms/components/Text.js +1 -1
  77. package/forms/components/TextArea.d.ts +1 -1
  78. package/forms/components/TextArea.js +1 -1
  79. package/forms/components/TextBox.d.ts +1 -1
  80. package/forms/components/TextBox.js +1 -1
  81. package/forms/components/TimePicker.d.ts +1 -1
  82. package/forms/components/TimePicker.js +1 -1
  83. package/forms/dateUtilities.d.ts +3 -5
  84. package/forms/dateUtilities.js +1 -1
  85. package/forms/presenter.d.ts +1 -1
  86. package/forms/presenter.js +1 -1
  87. package/forms/utils.d.ts +41 -7
  88. package/forms/utils.js +1 -1
  89. package/libs/version.d.ts +1 -1
  90. package/libs/version.js +1 -1
  91. package/package.json +21 -11
  92. package/forms/Calendar.d.ts +0 -89
  93. package/forms/Calendar.js +0 -1
@@ -1 +1 @@
1
- import{createElement}from"react";import*as React from"react";import{createRoot}from"react-dom/client";import{FormComponent}from"./FormComponent.js";import Custom from"./components/Custom.js";import{FormComponentTypes,FormElementTypes}from"./constants.js";import{HostProvider}from"./hostContext.js";import{renderComponent,renderNone as renderers_renderNone}from"./renderers.js";import{getElementProps}from"./utils.js";export function refresh(e){e instanceof FormComponent&&e.forceUpdate()}const rootMap=new WeakMap;export function refreshForm(e,o){rootMap.has(o)||rootMap.set(o,createRoot(o)),rootMap.get(o).render(React.createElement(HostProvider,{value:e},React.createElement(FormComponent,{host:e,type:"form",children:[]})))}export function releaseForm(e){rootMap.has(e)&&(rootMap.get(e).unmount(),rootMap.delete(e))}export function render(e){if(e instanceof FormComponent){const o=e.props.type;if(o!==FormComponentTypes.ELEMENT&&o!==FormComponentTypes.SECTION)return renderComponent(e);const r=e.prepare();if(null==r)return;const t=r.type;if("string"!=typeof t)return;if(t===FormElementTypes.CUSTOM)return createElement(Custom,getElementProps(e,r));if(e.elementRegistration)return createElement(e.elementRegistration.component,getElementProps(e,r))}}export function renderNone(e){if(e instanceof FormComponent)return renderers_renderNone(e)}
1
+ import{createElement}from"react";import*as React from"react";import{createRoot}from"react-dom/client";import{FormComponent}from"./FormComponent.js";import Custom from"./components/Custom.js";import{FormComponentTypes,FormElementTypes}from"./constants.js";import{HostProvider}from"./hostContext.js";import{renderComponent,renderNone as renderers_renderNone}from"./renderers.js";import{getElementProps}from"./utils.js";export function refresh(e){e instanceof FormComponent&&e.forceUpdate()}const rootMap=new WeakMap;export function refreshForm(e,o){rootMap.has(o)||rootMap.set(o,createRoot(o)),rootMap.get(o).render(React.createElement(HostProvider,{value:e},React.createElement(FormComponent,{host:e,type:"form",children:[]})))}export function releaseForm(e){rootMap.has(e)&&(rootMap.get(e).unmount(),rootMap.delete(e))}export function render(e,o){if(e instanceof FormComponent){const r=e.props.type;if(r!==FormComponentTypes.ELEMENT&&r!==FormComponentTypes.SECTION)return renderComponent(e);const t=e.prepare();if(null==t)return;const n=t.type;if("string"!=typeof n)return;if(n===FormElementTypes.CUSTOM)return createElement(Custom,getElementProps(e,t));if(e.elementRegistration)return createElement(e.elementRegistration.component,{...getElementProps(e,t),ref:o})}}export function renderNone(e){if(e instanceof FormComponent)return renderers_renderNone(e)}
package/forms/utils.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import * as text from "./textUtilities";
2
2
  import type { FormComponent } from "./FormComponent";
3
+ import type { ElementTuple } from "./FormDefinition";
3
4
  import type * as defs from "./FormDefinition";
4
5
  import type { FormElementProps } from "./index";
6
+ import type { Theme } from "@vertigis/react-ui/styles";
5
7
  /**
6
8
  * Constraints for a property that may specify a default value and bounds.
7
9
  */
@@ -182,13 +184,6 @@ export declare function getElementProps(component: FormComponent, element: defs.
182
184
  * @returns The key corresponding to the item, or undefined if no match was found.
183
185
  */
184
186
  export declare function getItemId(item: defs.Item | null | undefined, items: Record<string, defs.Item>): string | undefined;
185
- /**
186
- * This custom hook returns the locale code for the current locale.
187
- * It is expected that a component that uses this hook has a `@vertigis/react-ui/LocalizationProvider` somewhere in its ancestory.
188
- * @returns The locale code for the current locale.
189
- * @throws If no locale was found.
190
- */
191
- export declare function useLocale(): string;
192
187
  type NumberFormatKeys = keyof defs.NumberFormat;
193
188
  type SizeKeys = keyof defs.Size;
194
189
  /**
@@ -207,4 +202,43 @@ export declare function isSizeProperty(accessor: string): accessor is SizeKeys;
207
202
  export declare function getBorderStyle(borderStyle?: string): defs.BorderStyle;
208
203
  export declare function getEmphasis(emphasis?: string): "custom" | defs.Emphasis;
209
204
  export declare function getIconPosition(iconPosition?: string): defs.IconPosition;
205
+ export declare function getItemColors(itemAppearance: defs.ItemAppearance, theme: Theme): {
206
+ foregroundColor?: undefined;
207
+ backgroundColor?: undefined;
208
+ } | {
209
+ foregroundColor: string;
210
+ backgroundColor: string;
211
+ };
210
212
  export declare function getItemSize(size?: string): defs.ItemSize;
213
+ export declare function getShowBorder(emphasis: defs.Emphasis | "custom", showBorder: boolean | undefined): boolean;
214
+ /**
215
+ * This function checks the elements to decide if they are an older single-column layout, or a newer
216
+ * layout that supports side-by-side elements.
217
+ *
218
+ * Since Workflow 5.25, form element position information has been saved in `rowNumber` and `rowIndex` values, allowing
219
+ * elements to be placed beside each other on the same row.
220
+ * Prior to that, the `index` property was used and all elements were stacked in a single column.
221
+ *
222
+ * The header and footer are excluded from this check as they never contain any of these properties.
223
+ * @param elements A set of form elements to be instpected.
224
+ * @returns True if the elements should be treated as a single-column layout, false if they should allow side-by-sde elements.
225
+ */
226
+ export declare function isSingleColumnLayout(elements: Record<string, defs.Element>): boolean;
227
+ /**
228
+ * This function orders elements based on their `index` property, with the `header` always first and the `footer` always last.
229
+ * @param elementTuple1 The first element to compare.
230
+ * @param elementTuple2 The second element to compare.
231
+ * @returns A negative number if `elementTuple1` should be before `elementTuple2`,
232
+ * a positive number if `elementTuple2` should be before `elementTuple1`,
233
+ * or zero if their `index` values are the same.
234
+ */
235
+ export declare function compareElementIndex(elementTuple1: ElementTuple, elementTuple2: ElementTuple): number;
236
+ /**
237
+ * This function orders elements based on their `rowNumber` and `rowIndex` properties, with the `header` always first and the `footer` always last.
238
+ * @param elementTuple1 The first element to compare.
239
+ * @param elementTuple2 The second element to compare.
240
+ * @returns A negative number if `elementTuple1` should be before `elementTuple2`,
241
+ * a positive number if `elementTuple2` should be before `elementTuple1`,
242
+ * or zero if their `rowNumber` and `rowIndex` values are the same.
243
+ */
244
+ export declare function compareRowNumberAndRowIndex(elementTuple1: ElementTuple, elementTuple2: ElementTuple): number;
package/forms/utils.js CHANGED
@@ -1 +1 @@
1
- import{MuiPickersAdapterContext}from"@vertigis/react-ui/LocalizationProvider";import{useContext}from"react";import{FormElementTypes}from"./constants.js";import*as text from"./textUtilities.js";const DEFAULT_DEBOUNCE_DELAY=300,DEFAULT_THROTTLE_DELAY=100;export{text};let next=0,seed=(new Date).valueOf();const guid="5DDC9A38-AAAB-44C1-AD87-415160F43D75";export function makeId(){return next>=2147483648&&(seed=(new Date).valueOf(),next=0),`${guid}:${seed}:${next++}`}function indexOf(e,t){if(null==e)return;const r=e.index;return"number"==typeof r?r:t}function compareIndex(e,t){return compareNumber(e.index,t.index)}function compareNumber(e,t){return e<t?-1:e>t?1:0}export function sortAndFilter(e,t){void 0===t&&(t=indexOf);const r={};if("object"!=typeof e||null===e)return r;let n=0;const o=[];for(const r in e){const i=e[r],s=t(i,n++);"number"==typeof s&&o.push({key:r,index:s,item:i})}for(const e of o.sort(compareIndex))r[e.key]=e.item;return r}export function inspectItems(e,t,r){let n;const o=sortAndFilter(t,function(e,t){if(null==e||!1===e.visible)return;const r=e.index;return"number"==typeof r?r:t});if(null!=e&&void 0!==o[e]||(e=void 0),void 0===e&&null!=r)for(const t in o){if(o[t].value===r){e=t;break}e=void 0}return void 0!==e?(n=o[e].label,r=o[e].value):(n=void 0,r=void 0),{current:e,items:o,label:n,value:r}}export function makeSafeClassName(e){return`gcx-forms-${e?.replace(/[\W]/g,"")||"element"}`}let idSuffix=0;export function makeUniqueId(e){return`${makeSafeClassName(e)}-${++idSuffix}`}function addSuffix(e,t){return`${e}-${t}`}export function getAccessibleDescriptionId(e){return addSuffix(e,"accessible-description")}export function getDescriptionId(e){return addSuffix(e,"description")}export function getInputId(e){return addSuffix(e,"input")}export function getLabelId(e){return addSuffix(e,"label")}function isObjectType(e,t){return"object"==typeof e&&null!==e&&(!Array.isArray(e)&&e.refValueType===t)}export function isSection(e){return e?.type===FormElementTypes.SECTION}export function isAccordionSection(e){return isSection(e)&&"accordion-section"===e.format}export function isCollapsibleSection(e){return isSection(e)&&"collapsible-section"===e.format}export function isFieldsetSection(e){return isSection(e)&&"fieldset-section"===e.format}export function isMutuallyExclusiveSection(e){return isAccordionSection(e)||isTabSection(e)}export function isTabSection(e){return isSection(e)&&"tab-section"===e.format}export function isNumber(e){return"number"==typeof e}export function isString(e){return"string"==typeof e}export function isDataRef(e){return isObjectType(e,"data")}export function isDateRangeRef(e){return isObjectType(e,"daterange")}export function isDateTimeRef(e){return isObjectType(e,"date")||isObjectType(e,"time")||isObjectType(e,"datetime")}export function isFilesRef(e){return isObjectType(e,"files")}export function isScanRef(e){return isObjectType(e,"scan")}export function isGeometryRef(e){return isObjectType(e,"geometry")}export function isItemsRef(e){return isObjectType(e,"items")}export function isNumberRef(e){return isObjectType(e,"number")}export function sanitizeGeometryRef(e){if(isGeometryRef(e)){const t=e.geometry;if(Array.isArray(t)&&t.length>0)switch(e.format){case"circle":case"extent":case"line":case"multipoint":case"point":case"polygon":case"polygon-freehand":case"polyline":case"polyline-freehand":return e}}}export function createGeometryRef(e){return{refValueType:"geometry",format:e,geometry:[]}}export function debounce(e,t=300){let r;return function(...n){const o=()=>{r=void 0,e.apply(this,n)};return clearTimeout(r),r=setTimeout(o,t),{now:()=>{r&&(clearTimeout(r),o())},cancel:()=>{r&&(clearTimeout(r),r=void 0)}}}}export function throttle(e,t=100){let r,n;return function(){const o=Date.now(),i=(...t)=>{n=void 0,r=Date.now(),e.apply(this,t)};r&&o<r+t?(clearTimeout(n),n=setTimeout(i,t)):i()}}export function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}export function getElementProps(e,t){const{enabled:r,id:n,raiseEvent:o,setItemProperty:i,setProperty:s,setValue:u}=e,{format:c,manualEntry:a,showMinMaxLabels:p,showTickMarks:f,size:l,type:m,value:d,wrap:y}=t;return{...t,enabled:!!r,id:n,raiseEvent:o,setItemProperty:i,setProperty:s,setValue:u,format:c,manualEntry:a,showMinMaxLabels:p,showTickMarks:f,size:l,type:m,value:d,wrap:y,element:t,name:e.props.name,component:e}}export function getItemId(e,t){if(e)for(const r in t)if(t[r]===e)return r}export function useLocale(){const e=useContext(MuiPickersAdapterContext),t=e?.utils?.locale?.code;if(!t)throw new Error("Failed to detect locale. Ensure there is a LocalizationProvider in the ancestry of the component that is using this hook.");return t}const BorderStyleArray=["rounded","square"],EmphasisArray=["high","low","medium"],IconPositionArray=["above","below","before","after"],ItemSizeArray=["small","medium","large"],ItemAppearanceKeysArray=["backgroundColor","borderStyle","emphasis","foregroundColor","icon","iconPosition","showBorder","size"],NumberFormatKeysArray=["currency","customDisplayFormat","displayFormat","lowerBound","precision","step","timeFormat","upperBound"],SizeKeysArray=["height","width"];export function isItemAppearanceProperty(e){return ItemAppearanceKeysArray.includes(e)}export function isNumberFormatProperty(e){return NumberFormatKeysArray.includes(e)}export function isSizeProperty(e){return SizeKeysArray.includes(e)}function isBorderStyle(e){return void 0!==e&&BorderStyleArray.includes(e)}function isEmphasis(e){return void 0!==e&&EmphasisArray.includes(e)}function isIconPosition(e){return void 0!==e&&IconPositionArray.includes(e)}function isItemSize(e){return void 0!==e&&ItemSizeArray.includes(e)}export function getBorderStyle(e){return isBorderStyle(e)?e:"square"}export function getEmphasis(e){return"string"!=typeof e||!isEmphasis(e)&&"custom"!==e?"medium":e}export function getIconPosition(e){return isIconPosition(e)?e:"before"}export function getItemSize(e){return isItemSize(e)?e:"medium"}
1
+ import{FormElementTypes}from"./constants.js";import*as text from"./textUtilities.js";const DEFAULT_DEBOUNCE_DELAY=300,DEFAULT_THROTTLE_DELAY=100;export{text};let next=0,seed=(new Date).valueOf();const guid="5DDC9A38-AAAB-44C1-AD87-415160F43D75";export function makeId(){return next>=2147483648&&(seed=(new Date).valueOf(),next=0),`${guid}:${seed}:${next++}`}function indexOf(e,t){if(null==e)return;const r=e.index;return"number"==typeof r?r:t}function compareIndex(e,t){return compareNumber(e.index,t.index)}function compareNumber(e,t){return e<t?-1:e>t?1:0}export function sortAndFilter(e,t){void 0===t&&(t=indexOf);const r={};if("object"!=typeof e||null===e)return r;let n=0;const o=[];for(const r in e){const i=e[r],u=t(i,n++);"number"==typeof u&&o.push({key:r,index:u,item:i})}for(const e of o.sort(compareIndex))r[e.key]=e.item;return r}export function inspectItems(e,t,r){let n;const o=sortAndFilter(t,function(e,t){if(null==e||!1===e.visible)return;const r=e.index;return"number"==typeof r?r:t});if(null!=e&&void 0!==o[e]||(e=void 0),void 0===e&&null!=r)for(const t in o){if(o[t].value===r){e=t;break}e=void 0}return void 0!==e?(n=o[e].label,r=o[e].value):(n=void 0,r=void 0),{current:e,items:o,label:n,value:r}}export function makeSafeClassName(e){return`gcx-forms-${e?.replace(/[\W]/g,"")||"element"}`}let idSuffix=0;export function makeUniqueId(e){return`${makeSafeClassName(e)}-${++idSuffix}`}function addSuffix(e,t){return`${e}-${t}`}export function getAccessibleDescriptionId(e){return addSuffix(e,"accessible-description")}export function getDescriptionId(e){return addSuffix(e,"description")}export function getInputId(e){return addSuffix(e,"input")}export function getLabelId(e){return addSuffix(e,"label")}function isObjectType(e,t){return"object"==typeof e&&null!==e&&(!Array.isArray(e)&&e.refValueType===t)}export function isSection(e){return e?.type===FormElementTypes.SECTION}export function isAccordionSection(e){return isSection(e)&&"accordion-section"===e.format}export function isCollapsibleSection(e){return isSection(e)&&"collapsible-section"===e.format}export function isFieldsetSection(e){return isSection(e)&&"fieldset-section"===e.format}export function isMutuallyExclusiveSection(e){return isAccordionSection(e)||isTabSection(e)}export function isTabSection(e){return isSection(e)&&"tab-section"===e.format}export function isNumber(e){return"number"==typeof e}export function isString(e){return"string"==typeof e}export function isDataRef(e){return isObjectType(e,"data")}export function isDateRangeRef(e){return isObjectType(e,"daterange")}export function isDateTimeRef(e){return isObjectType(e,"date")||isObjectType(e,"time")||isObjectType(e,"datetime")}export function isFilesRef(e){return isObjectType(e,"files")}export function isScanRef(e){return isObjectType(e,"scan")}export function isGeometryRef(e){return isObjectType(e,"geometry")}export function isItemsRef(e){return isObjectType(e,"items")}export function isNumberRef(e){return isObjectType(e,"number")}export function sanitizeGeometryRef(e){if(isGeometryRef(e)){const t=e.geometry;if(Array.isArray(t)&&t.length>0)switch(e.format){case"circle":case"extent":case"line":case"multipoint":case"point":case"polygon":case"polygon-freehand":case"polyline":case"polyline-freehand":return e}}}export function createGeometryRef(e){return{refValueType:"geometry",format:e,geometry:[]}}export function debounce(e,t=300){let r;return function(...n){const o=()=>{r=void 0,e.apply(this,n)};return clearTimeout(r),r=setTimeout(o,t),{now:()=>{r&&(clearTimeout(r),o())},cancel:()=>{r&&(clearTimeout(r),r=void 0)}}}}export function throttle(e,t=100){let r,n;return function(){const o=Date.now(),i=(...t)=>{n=void 0,r=Date.now(),e.apply(this,t)};r&&o<r+t?(clearTimeout(n),n=setTimeout(i,t)):i()}}export function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}export function getElementProps(e,t){const{enabled:r,id:n,raiseEvent:o,setItemProperty:i,setProperty:u,setValue:s}=e,{format:c,manualEntry:a,showMinMaxLabels:f,showTickMarks:p,size:m,type:l,value:d,wrap:y}=t;return{...t,enabled:!!r,id:n,raiseEvent:o,setItemProperty:i,setProperty:u,setValue:s,format:c,manualEntry:a,showMinMaxLabels:f,showTickMarks:p,size:m,type:l,value:d,wrap:y,element:t,name:e.props.name,component:e}}export function getItemId(e,t){if(e)for(const r in t)if(t[r]===e)return r}const BorderStyleArray=["rounded","square"],EmphasisArray=["high","low","medium"],IconPositionArray=["above","below","before","after"],ItemSizeArray=["small","medium","large"],ItemAppearanceKeysArray=["backgroundColor","borderStyle","emphasis","foregroundColor","icon","iconPosition","showBorder","size"],NumberFormatKeysArray=["currency","customDisplayFormat","displayFormat","lowerBound","precision","step","timeFormat","upperBound"],SizeKeysArray=["height","width"];export function isItemAppearanceProperty(e){return ItemAppearanceKeysArray.includes(e)}export function isNumberFormatProperty(e){return NumberFormatKeysArray.includes(e)}export function isSizeProperty(e){return SizeKeysArray.includes(e)}function isBorderStyle(e){return void 0!==e&&BorderStyleArray.includes(e)}function isEmphasis(e){return void 0!==e&&EmphasisArray.includes(e)}function isIconPosition(e){return void 0!==e&&IconPositionArray.includes(e)}function isItemSize(e){return void 0!==e&&ItemSizeArray.includes(e)}export function getBorderStyle(e){return isBorderStyle(e)?e:"square"}export function getEmphasis(e){return"string"!=typeof e||!isEmphasis(e)&&"custom"!==e?"medium":e}export function getIconPosition(e){return isIconPosition(e)?e:"before"}export function getItemColors(e,t){return"custom"!==e.emphasis?{}:{foregroundColor:e.foregroundColor??t.palette.primary.main,backgroundColor:e.backgroundColor??t.palette.background.default}}export function getItemSize(e){return isItemSize(e)?e:"medium"}export function getShowBorder(e,t){switch(e){case"custom":return!1!==t;case"low":return!1;default:return!0}}export function isSingleColumnLayout(e){return Object.entries(e).filter(e=>!["header","footer"].includes(e[0])).some(e=>void 0===e[1].rowNumber||void 0===e[1].rowIndex)}export function compareElementIndex(e,t){const r=e[1],n=t[1],o=r.section,i=n.section;return"header"===o||"footer"===i?Number.MIN_SAFE_INTEGER:"footer"===o||"header"===i?Number.MAX_SAFE_INTEGER:r.index-n.index}export function compareRowNumberAndRowIndex(e,t){const r=e[1],n=t[1],o=r.section,i=n.section;return"header"===o||"footer"===i?Number.MIN_SAFE_INTEGER:"footer"===o||"header"===i?Number.MAX_SAFE_INTEGER:r.rowNumber===n.rowNumber?r.rowIndex-n.rowIndex:r.rowNumber-n.rowNumber}
package/libs/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "5.47.0+28";
1
+ export declare const VERSION = "5.48.1+2";
package/libs/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION="5.47.0+28";
1
+ export const VERSION="5.48.1+2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertigis/workflow",
3
- "version": "5.47.0",
3
+ "version": "5.48.1",
4
4
  "author": "VertiGIS",
5
5
  "dependencies": {
6
6
  "@date-fns/utc": "^1.2.0",
@@ -10,24 +10,34 @@
10
10
  "autosuggest-highlight": "^3.3.4",
11
11
  "bluebird": "3.5.5",
12
12
  "clsx": "^1.2.1",
13
- "date-fns": "^3.6.0",
13
+ "color-rgba": "^3.0.0",
14
+ "date-fns": "^4.1.0",
15
+ "react-is": "18.2.0",
14
16
  "react-signature-pad-wrapper": "^3.3.2"
15
17
  },
16
18
  "type": "module",
17
19
  "devDependencies": {
18
20
  "@arcgis/core": "4.33.11",
21
+ "@babel/preset-env": "^7.28.3",
22
+ "@babel/preset-react": "^7.27.1",
19
23
  "@emotion/react": "^11.8.2",
20
24
  "@emotion/styled": "^11.8.1",
21
25
  "@swc/core": "^1.3.95",
22
26
  "@swc/jest": "^0.2.29",
27
+ "@testing-library/dom": "^10.4.1",
28
+ "@testing-library/jest-dom": "^6.9.1",
29
+ "@testing-library/react": "^16.3.0",
23
30
  "@types/autosuggest-highlight": "^3.2.0",
31
+ "@types/babel__preset-env": "^7",
32
+ "@types/color-rgba": "^2.1.3",
24
33
  "@types/jest": "^29.5.14",
25
34
  "@types/react": "18.2.46",
26
35
  "@types/react-dom": "18.2.18",
27
36
  "@vertigis/licensing": "5.1.1",
28
- "@vertigis/react-ui": "19.0.2",
37
+ "@vertigis/react-ui": "20.0.1",
38
+ "babel-jest": "^30.2.0",
29
39
  "cross-fetch": "^4.1.0",
30
- "jest": "^29.7.0",
40
+ "jest": "^30.2.0",
31
41
  "jest-environment-jsdom": "^29.7.0",
32
42
  "jest-junit": "^15.0.0",
33
43
  "jest-runtime": "^29.3.1",
@@ -39,21 +49,21 @@
39
49
  },
40
50
  "peerDependencies": {
41
51
  "@arcgis/core": ">= 4.31.0 < 5.0.0",
42
- "@vertigis/react-ui": ">= 19.0.2-0 < 20.0.0-0",
52
+ "@vertigis/react-ui": ">= 20.0.0-0 < 21.0.0-0",
43
53
  "react": ">= 18 < 19",
44
54
  "react-dom": ">= 18 < 19"
45
55
  },
46
56
  "resolutions": {
47
57
  "@types/react": "18.2.46",
48
- "@types/react-dom": "18.2.18"
58
+ "@types/react-dom": "18.2.18",
59
+ "react-is": "^18.2.0"
49
60
  },
50
61
  "homepage": "https://developers.vertigisstudio.com/docs/workflow/overview/",
51
62
  "license": "SEE LICENSE IN LICENSE",
52
63
  "scripts": {
53
- "compile-tests": "tsc -p ./tsconfig.tests.json",
54
- "test": "yarn compile-tests && jest",
55
- "test-de": "yarn compile-tests && jest --config=./jest.config.de.js",
56
- "test-coverage": "yarn compile-tests && jest --coverage && yarn test-de formatDate",
57
- "test-watch": "yarn compile-tests && jest --watch"
64
+ "test": "jest",
65
+ "test-de": "jest --config=./jest.config.de.js",
66
+ "test-coverage": "jest --coverage && yarn test-de formatDate",
67
+ "test-watch": "jest --watch"
58
68
  }
59
69
  }
@@ -1,89 +0,0 @@
1
- /** Exposes a local date object. */
2
- interface LocalDate {
3
- /** Gets the year. */
4
- getFullYear(): number;
5
- /** Sets the year. */
6
- setFullYear(value: number): void;
7
- /** Gets the month. */
8
- getMonth(): number;
9
- /** Sets the month. */
10
- setMonth(value: number): void;
11
- /** Gets the day of the month. */
12
- getDate(): number;
13
- /** Sets the day of the month. */
14
- setDate(value: number): void;
15
- /** Gets the hours. */
16
- getHours(): number;
17
- /** Sets the hours. */
18
- setHours(value: number): void;
19
- /** Gets the minutes. */
20
- getMinutes(): number;
21
- /** Sets the minutes. */
22
- setMinutes(value: number): void;
23
- /** Gets the seconds. */
24
- getSeconds(): number;
25
- /** Sets the seconds. */
26
- setSeconds(value: number): void;
27
- /** Gets the milliseconds. */
28
- getMilliseconds(): number;
29
- /** Sets the milliseconds. */
30
- setMilliseconds(value: number): void;
31
- /** Gets the day of the week. */
32
- getDay(): number;
33
- /** Gets the day of the week. */
34
- valueOf(): number;
35
- }
36
- type DateTimeFormatOptions = Intl.DateTimeFormatOptions & {
37
- toString(): string;
38
- };
39
- type NumberFormatOptions = Intl.NumberFormatOptions & {
40
- toString(): string;
41
- };
42
- /** Exposes model data for Date and Time related components. */
43
- export declare class Calendar {
44
- /** Indicates the year format. */
45
- static yearFormat: DateTimeFormatOptions;
46
- /** Indicates the month format. */
47
- static monthFormat: DateTimeFormatOptions;
48
- /** Indicates the month & year format. */
49
- static monthYearFormat: DateTimeFormatOptions;
50
- /** Indicates the day of the week format. */
51
- static dayOfMonthFormat: DateTimeFormatOptions;
52
- /** Indicates the day of the week format. */
53
- static dayOfWeekFormat: DateTimeFormatOptions;
54
- /** Indicates the full date format. */
55
- static dateFormat: DateTimeFormatOptions;
56
- /** Indicates the hour format. */
57
- static hourFormat: DateTimeFormatOptions;
58
- /** Indicates the hour format. */
59
- static ampmFormat: DateTimeFormatOptions;
60
- /** Indicates the minute format. */
61
- static minuteFormat: NumberFormatOptions;
62
- /** Indicates the time format. */
63
- static timeFormat: DateTimeFormatOptions;
64
- /** Indicates the time long format. */
65
- static timeLongFormat: DateTimeFormatOptions;
66
- /** Indicates the time long format. */
67
- static timeClockFormat: DateTimeFormatOptions;
68
- /** Indicates the time long format. */
69
- static fractionalFormat: DateTimeFormatOptions;
70
- /** Indicates the time full format. */
71
- static fullFormat: DateTimeFormatOptions;
72
- /** Coerces a date from a string while keeping the time from the basis. */
73
- coerceDate(value: string, basis: LocalDate): LocalDate;
74
- /** Coerces a time from a string while keeping the date from the basis. */
75
- coerceTime(value: string, basis: LocalDate): LocalDate;
76
- /** Formats a date/time value using options. */
77
- format(date: LocalDate, options: Intl.DateTimeFormatOptions | Intl.NumberFormatOptions): string;
78
- /** Returns the current date with time set to noon. */
79
- today(): LocalDate;
80
- /** Returns the current date. */
81
- now(): LocalDate;
82
- /** Coerces a date, local date, or value into a local date. */
83
- coerceIntoLocal(date: Date | LocalDate | number | string): LocalDate;
84
- /** Coerces a local date into a full date. */
85
- coerceIntoValue(date: Date | LocalDate | number | string): Date;
86
- /** Attempts to return a native calendar if browser support is available. */
87
- static useNative(): Calendar;
88
- }
89
- export {};
package/forms/Calendar.js DELETED
@@ -1 +0,0 @@
1
- let nativeDefault;const markCleaner=/[\u200E\u200F]+/g,spaceCleaner=/\s+/g;function clean(e){return e.replace(markCleaner,"").replace(spaceCleaner," ")}function trim(e,t){const n=e.lastIndexOf(t);return n>=0&&n===e.length-t.length?e.substring(0,e.length-t.length):e}export class Calendar{coerceDate(e,t){e=clean(e);const n=new Date(e);return n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),n.setMilliseconds(t.getMilliseconds()),n}coerceTime(e,t){if((e=clean(e)).length<1)return new Date(NaN);const n=this.format(t,Calendar.dateFormat),r=new Date(n+" "+e);return r.setFullYear(t.getFullYear()),r.setMonth(t.getMonth()),r.setDate(t.getDate()),r}format(e,t){const n=this.coerceIntoValue(e);if(t===Calendar.hourFormat){const e=clean(n.toLocaleTimeString("en",t));return trim(e," AM")!==e?trim(e," AM"):trim(e," PM")!==e?trim(e," PM"):e}if(t===Calendar.ampmFormat){const e=clean(n.toLocaleTimeString("en",t));return trim(e," AM")!==e?"AM":trim(e," PM")!==e?"PM":""}return t===Calendar.minuteFormat?n.getMinutes().toLocaleString(void 0,t):t===Calendar.timeFormat?e.getSeconds()>0?clean(n.toLocaleTimeString(void 0,Calendar.timeLongFormat)):clean(n.toLocaleTimeString(void 0,t)):t===Calendar.timeClockFormat?clean(n.toLocaleTimeString(void 0,t)):clean(n.toLocaleString(void 0,t))}today(){const e=this.now();return e.setHours(12),e.setMinutes(0),e}now(){const e=new Date;return e.setSeconds(0),e.setMilliseconds(0),e}coerceIntoLocal(e){return this.coerceIntoValue(e)}coerceIntoValue(e){return e instanceof Date||"string"==typeof e?new Date(e):null!=e?new Date(e.valueOf()):new Date(NaN)}static useNative(){return void 0===nativeDefault&&(nativeDefault=new Calendar),nativeDefault}}Calendar.yearFormat={year:"numeric",toString:()=>"YYYY"},Calendar.monthFormat={month:"long",toString:()=>"MMM"},Calendar.monthYearFormat={month:"long",year:"numeric",toString:()=>"MMM YYYY"},Calendar.dayOfMonthFormat={day:"numeric",toString:()=>"D"},Calendar.dayOfWeekFormat={weekday:"short",toString:()=>"ddd"},Calendar.dateFormat={day:"numeric",month:"short",year:"numeric",toString:()=>"ll"},Calendar.hourFormat={hour:"numeric",toString:()=>"LT"},Calendar.ampmFormat={hour:"numeric",toString:()=>"LT"},Calendar.minuteFormat={maximumFractionDigits:0,minimumIntegerDigits:2,toString:()=>"mm"},Calendar.timeFormat={hour:"numeric",minute:"2-digit",toString:()=>"LT"},Calendar.timeLongFormat={hour:"numeric",minute:"2-digit",second:"2-digit",toString:()=>"LTS"},Calendar.timeClockFormat={hour:"numeric",minute:"2-digit",second:"2-digit",timeZoneName:"short",toString:()=>"LTS z"},Calendar.fractionalFormat={toString:()=>"~fff"},Calendar.fullFormat={toString:()=>"LL LTS ~fff z"};