@openmrs/esm-framework 3.4.1-pre.171 → 3.4.1-pre.174

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/docs/API.md CHANGED
@@ -2633,16 +2633,13 @@ ___
2633
2633
 
2634
2634
  Interpolates values of `params` into the `template` string.
2635
2635
 
2636
- Useful for additional template parameters in URLs.
2637
-
2638
2636
  Example usage:
2639
2637
  ```js
2640
- navigate({
2641
- to: interpolateString(
2642
- config.links.patientChart,
2643
- { patientUuid: patient.uuid }
2644
- )
2645
- });
2638
+ interpolateString("test ${one} ${two} 3", {
2639
+ one: "1",
2640
+ two: "2",
2641
+ }); // will return "test 1 2 3"
2642
+ interpolateString("test ok", { one: "1", two: "2" }) // will return "test ok"
2646
2643
  ```
2647
2644
 
2648
2645
  #### Parameters
@@ -2658,7 +2655,7 @@ navigate({
2658
2655
 
2659
2656
  #### Defined in
2660
2657
 
2661
- [packages/framework/esm-config/src/navigation/interpolate-string.ts:46](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/interpolate-string.ts#L46)
2658
+ [packages/framework/esm-config/src/navigation/interpolate-string.ts:63](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/interpolate-string.ts#L63)
2662
2659
 
2663
2660
  ___
2664
2661
 
@@ -2668,9 +2665,29 @@ ___
2668
2665
 
2669
2666
  Interpolates a string with openmrsBase and openmrsSpaBase.
2670
2667
 
2671
- Useful for accepting `${openmrsBase}` or `${openmrsSpaBase}` template
2668
+ Useful for accepting `${openmrsBase}` or `${openmrsSpaBase}`plus additional template
2672
2669
  parameters in configurable URLs.
2673
2670
 
2671
+ Example usage:
2672
+ ```js
2673
+ interpolateUrl("test ${openmrsBase} ${openmrsSpaBase} ok");
2674
+ // will return "test /openmrs /openmrs/spa ok"
2675
+
2676
+ interpolateUrl("${openmrsSpaBase}/patient/${patientUuid}", {
2677
+ patientUuid: "4fcb7185-c6c9-450f-8828-ccae9436bd82",
2678
+ }); // will return "/openmrs/spa/patient/4fcb7185-c6c9-450f-8828-ccae9436bd82"
2679
+ ```
2680
+
2681
+ This can be used in conjunction with the `navigate` function like so
2682
+ ```js
2683
+ navigate({
2684
+ to: interpolateUrl(
2685
+ "${openmrsSpaBase}/patient/${patientUuid}",
2686
+ { patientUuid: patient.uuid }
2687
+ )
2688
+ }); // will navigate to "/openmrs/spa/patient/4fcb7185-c6c9-450f-8828-ccae9436bd82"
2689
+ ```
2690
+
2674
2691
  #### Parameters
2675
2692
 
2676
2693
  | Name | Type | Description |
@@ -2684,7 +2701,7 @@ parameters in configurable URLs.
2684
2701
 
2685
2702
  #### Defined in
2686
2703
 
2687
- [packages/framework/esm-config/src/navigation/interpolate-string.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/interpolate-string.ts#L16)
2704
+ [packages/framework/esm-config/src/navigation/interpolate-string.ts:36](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/interpolate-string.ts#L36)
2688
2705
 
2689
2706
  ___
2690
2707
 
@@ -2701,6 +2718,13 @@ const submitHandler = () => {
2701
2718
  navigate({ to: config.links.submitSuccess });
2702
2719
  };
2703
2720
  ```
2721
+ Example return values:
2722
+ navigate({ to: "/some/path" }); => window.location.assign("/some/path")
2723
+ navigate({ to: "https://single-spa.js.org/" }); => window.location.assign("https://single-spa.js.org/")
2724
+ navigate({ to: "${openmrsBase}/some/path" }); => window.location.assign("/openmrs/some/path")
2725
+ navigate({ to: "/openmrs/spa/foo/page" }); => navigateToUrl("/openmrs/spa/foo/page")
2726
+ navigate({ to: "${openmrsSpaBase}/bar/page" }); => navigateToUrl("/openmrs/spa/bar/page")
2727
+ navigate({ to: "/${openmrsSpaBase}/baz/page" }) => navigateToUrl("/openmrs/spa/baz/page")
2704
2728
 
2705
2729
  #### Parameters
2706
2730
 
@@ -2714,7 +2738,7 @@ const submitHandler = () => {
2714
2738
 
2715
2739
  #### Defined in
2716
2740
 
2717
- [packages/framework/esm-config/src/navigation/navigate.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/navigate.ts#L35)
2741
+ [packages/framework/esm-config/src/navigation/navigate.ts:42](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/navigate.ts#L42)
2718
2742
 
2719
2743
  ___
2720
2744
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-framework",
3
- "version": "3.4.1-pre.171",
3
+ "version": "3.4.1-pre.174",
4
4
  "license": "MPL-2.0",
5
5
  "browser": "dist/openmrs-esm-framework.js",
6
6
  "main": "src/index.ts",
@@ -35,18 +35,18 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@openmrs/esm-api": "^3.4.1-pre.171",
39
- "@openmrs/esm-breadcrumbs": "^3.4.1-pre.171",
40
- "@openmrs/esm-config": "^3.4.1-pre.171",
41
- "@openmrs/esm-error-handling": "^3.4.1-pre.171",
42
- "@openmrs/esm-extensions": "^3.4.1-pre.171",
43
- "@openmrs/esm-globals": "^3.4.1-pre.171",
44
- "@openmrs/esm-offline": "^3.4.1-pre.171",
45
- "@openmrs/esm-react-utils": "^3.4.1-pre.171",
46
- "@openmrs/esm-state": "^3.4.1-pre.171",
47
- "@openmrs/esm-styleguide": "^3.4.1-pre.171",
48
- "@openmrs/esm-utils": "^3.4.1-pre.171",
38
+ "@openmrs/esm-api": "^3.4.1-pre.174",
39
+ "@openmrs/esm-breadcrumbs": "^3.4.1-pre.174",
40
+ "@openmrs/esm-config": "^3.4.1-pre.174",
41
+ "@openmrs/esm-error-handling": "^3.4.1-pre.174",
42
+ "@openmrs/esm-extensions": "^3.4.1-pre.174",
43
+ "@openmrs/esm-globals": "^3.4.1-pre.174",
44
+ "@openmrs/esm-offline": "^3.4.1-pre.174",
45
+ "@openmrs/esm-react-utils": "^3.4.1-pre.174",
46
+ "@openmrs/esm-state": "^3.4.1-pre.174",
47
+ "@openmrs/esm-styleguide": "^3.4.1-pre.174",
48
+ "@openmrs/esm-utils": "^3.4.1-pre.174",
49
49
  "dayjs": "^1.10.7"
50
50
  },
51
- "gitHead": "018c4c51c52048f88a093fe5c3041adaa6431dcc"
51
+ "gitHead": "1e75f8b6443bb6b0402c140aab3d798f82cd9846"
52
52
  }