spiderly 19.7.1 → 19.7.2

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/README.md CHANGED
@@ -6,6 +6,8 @@
6
6
 
7
7
  Spiderly Angular is a library designed to work with Spiderly, but it can also be used independently. It utilizes the PrimeNG UI library.
8
8
 
9
+ This npm package is the Angular library distribution. It is not the CLI package. The future npm CLI package is `spiderly-cli`, while the currently supported CLI remains the `Spiderly.CLI` NuGet tool.
10
+
9
11
  ## Sakai PrimeNG Theme
10
12
 
11
13
  Currently, Spiderly Angular uses and provides the layout of the free Sakai PrimeNG theme.
@@ -1983,33 +1983,6 @@ class BaseFormComponent {
1983
1983
  this.baseFormService.showInvalidFieldsMessage();
1984
1984
  }
1985
1985
  };
1986
- /**
1987
- * Handles navigation after a successful save.
1988
- * Override this to customize the post-save navigation behavior.
1989
- * By default, navigates to the parent URL when `rerouteId` is not provided, or to the saved object's URL otherwise.
1990
- *
1991
- * @param rerouteId - The ID of the saved object, used to build the target URL. When not provided, navigates to the parent URL.
1992
- *
1993
- * @example
1994
- * ```ts
1995
- * // Override to navigate to a custom route after save
1996
- * rerouteToSavedObject = (rerouteId: number | string): void => {
1997
- * this.router.navigateByUrl(`/products/${rerouteId}/details`);
1998
- * };
1999
- * ```
2000
- */
2001
- this.rerouteToSavedObject = (rerouteId) => {
2002
- if (rerouteId == null) {
2003
- const currentUrl = this.router.url;
2004
- const parentUrl = getParentUrl(currentUrl);
2005
- this.router.navigateByUrl(parentUrl);
2006
- return;
2007
- }
2008
- const segments = this.router.url.split('/');
2009
- segments[segments.length - 1] = rerouteId.toString();
2010
- const newUrl = segments.join('/');
2011
- this.router.navigateByUrl(newUrl);
2012
- };
2013
1986
  /**
2014
1987
  * Hook that runs **before** form validation and the save request.
2015
1988
  * Use this to modify the save body or perform any pre-save logic (e.g., transforming data, setting computed fields).
@@ -2050,6 +2023,33 @@ class BaseFormComponent {
2050
2023
  this.onAfterSaveRequest = () => { };
2051
2024
  }
2052
2025
  ngOnInit() { }
2026
+ /**
2027
+ * Handles navigation after a successful save.
2028
+ * Override this to customize the post-save navigation behavior.
2029
+ * By default, navigates to the parent URL when `rerouteId` is not provided, or to the saved object's URL otherwise.
2030
+ *
2031
+ * @param rerouteId - The ID of the saved object, used to build the target URL. When not provided, navigates to the parent URL.
2032
+ *
2033
+ * @example
2034
+ * ```ts
2035
+ * // Override to navigate to a custom route after save
2036
+ * override rerouteToSavedObject(rerouteId: number | string): void {
2037
+ * this.router.navigateByUrl(`/products/${rerouteId}/details`);
2038
+ * }
2039
+ * ```
2040
+ */
2041
+ rerouteToSavedObject(rerouteId) {
2042
+ if (rerouteId == null) {
2043
+ const currentUrl = this.router.url;
2044
+ const parentUrl = getParentUrl(currentUrl);
2045
+ this.router.navigateByUrl(parentUrl);
2046
+ return;
2047
+ }
2048
+ const segments = this.router.url.split('/');
2049
+ segments[segments.length - 1] = rerouteId.toString();
2050
+ const newUrl = segments.join('/');
2051
+ this.router.navigateByUrl(newUrl);
2052
+ }
2053
2053
  //#endregion
2054
2054
  //#region Model List
2055
2055
  getFormArrayControlByIndex(formControlName, formArray, index, filter) {