@inertiajs/core 2.3.10 → 2.3.12

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/dist/index.esm.js CHANGED
@@ -884,6 +884,9 @@ var setHashIfSameUrl = (originUrl, destinationUrl) => {
884
884
  var isSameUrlWithoutHash = (url1, url2) => {
885
885
  return urlWithoutHash(url1).href === urlWithoutHash(url2).href;
886
886
  };
887
+ var isSameUrlWithoutQueryOrHash = (url1, url2) => {
888
+ return url1.origin === url2.origin && url1.pathname === url2.pathname;
889
+ };
887
890
  function isUrlMethodPair(href) {
888
891
  return href !== null && typeof href === "object" && href !== void 0 && "url" in href && "method" in href;
889
892
  }
@@ -2426,7 +2429,10 @@ var Router = class {
2426
2429
  if (events.onBefore(visit) === false || !fireBeforeEvent(visit)) {
2427
2430
  return;
2428
2431
  }
2429
- if (!isSameUrlWithoutHash(visit.url, hrefToUrl(page.get().url))) {
2432
+ const currentPageUrl = hrefToUrl(page.get().url);
2433
+ const isPartialReload = visit.only.length > 0 || visit.except.length > 0 || visit.reset.length > 0;
2434
+ const isSamePage = isPartialReload ? isSameUrlWithoutQueryOrHash(visit.url, currentPageUrl) : isSameUrlWithoutHash(visit.url, currentPageUrl);
2435
+ if (!isSamePage) {
2430
2436
  this.asyncRequestStream.cancelInFlight({ prefetch: false });
2431
2437
  }
2432
2438
  if (!visit.async) {
@@ -2750,6 +2756,7 @@ var UseFormUtils = class {
2750
2756
  /**
2751
2757
  * Parses all useForm() arguments into { rememberKey, data, precognitionEndpoint }.
2752
2758
  *
2759
+ * useForm()
2753
2760
  * useForm(data)
2754
2761
  * useForm(rememberKey, data)
2755
2762
  * useForm(method, url, data)
@@ -2757,6 +2764,13 @@ var UseFormUtils = class {
2757
2764
  *
2758
2765
  */
2759
2766
  static parseUseFormArguments(...args) {
2767
+ if (args.length === 0) {
2768
+ return {
2769
+ rememberKey: null,
2770
+ data: {},
2771
+ precognitionEndpoint: null
2772
+ };
2773
+ }
2760
2774
  if (args.length === 1) {
2761
2775
  return {
2762
2776
  rememberKey: null,
@@ -3913,7 +3927,7 @@ function setupProgress({
3913
3927
  }
3914
3928
 
3915
3929
  // src/resetFormFields.ts
3916
- var FormComponentResetSymbol = Symbol("FormComponentReset");
3930
+ var FormComponentResetSymbol = /* @__PURE__ */ Symbol("FormComponentReset");
3917
3931
  function isFormElement(element) {
3918
3932
  return element instanceof HTMLInputElement || element instanceof HTMLSelectElement || element instanceof HTMLTextAreaElement;
3919
3933
  }