@inertiajs/core 3.0.0 → 3.0.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/dist/index.js +13 -7
- package/dist/index.js.map +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1923,8 +1923,10 @@ var XhrHttpClient = class {
|
|
|
1923
1923
|
setHeaders(xhr, config2);
|
|
1924
1924
|
if (config2.onUploadProgress) {
|
|
1925
1925
|
xhr.upload.onprogress = (event) => {
|
|
1926
|
+
const progress3 = event.lengthComputable ? event.loaded / event.total : void 0;
|
|
1926
1927
|
config2.onUploadProgress({
|
|
1927
|
-
progress:
|
|
1928
|
+
progress: progress3,
|
|
1929
|
+
percentage: progress3 ? Math.round(progress3 * 100) : 0,
|
|
1928
1930
|
loaded: event.loaded,
|
|
1929
1931
|
total: event.lengthComputable ? event.total : void 0
|
|
1930
1932
|
});
|
|
@@ -2526,10 +2528,9 @@ var Response = class _Response {
|
|
|
2526
2528
|
...pageResponse.onceProps || {}
|
|
2527
2529
|
};
|
|
2528
2530
|
}
|
|
2529
|
-
|
|
2530
|
-
...page.get().flash
|
|
2531
|
-
|
|
2532
|
-
};
|
|
2531
|
+
if (this.requestParams.isDeferredPropsRequest()) {
|
|
2532
|
+
pageResponse.flash = { ...page.get().flash };
|
|
2533
|
+
}
|
|
2533
2534
|
const currentOriginalDeferred = page.get().initialDeferredProps;
|
|
2534
2535
|
if (currentOriginalDeferred && Object.keys(currentOriginalDeferred).length > 0) {
|
|
2535
2536
|
pageResponse.initialDeferredProps = currentOriginalDeferred;
|
|
@@ -2723,7 +2724,6 @@ var Request = class _Request {
|
|
|
2723
2724
|
}
|
|
2724
2725
|
onProgress(progress3) {
|
|
2725
2726
|
if (this.requestParams.data() instanceof FormData) {
|
|
2726
|
-
progress3.percentage = progress3.progress ? Math.round(progress3.progress * 100) : 0;
|
|
2727
2727
|
fireProgressEvent(progress3);
|
|
2728
2728
|
this.requestParams.all().onProgress(progress3);
|
|
2729
2729
|
}
|
|
@@ -3430,6 +3430,7 @@ function normalizeHeaders(headers) {
|
|
|
3430
3430
|
function toHttpProgressEvent(axiosEvent) {
|
|
3431
3431
|
return {
|
|
3432
3432
|
progress: axiosEvent.progress,
|
|
3433
|
+
percentage: axiosEvent.progress ? Math.round(axiosEvent.progress * 100) : 0,
|
|
3433
3434
|
loaded: axiosEvent.loaded,
|
|
3434
3435
|
total: axiosEvent.total
|
|
3435
3436
|
};
|
|
@@ -3629,6 +3630,9 @@ var Renderer = {
|
|
|
3629
3630
|
const targetElements = Array.from(document.head.childNodes).filter(
|
|
3630
3631
|
(element) => this.isInertiaManagedElement(element)
|
|
3631
3632
|
);
|
|
3633
|
+
if (sourceElements.some((element) => element instanceof HTMLTitleElement)) {
|
|
3634
|
+
document.head.querySelectorAll("title:not([data-inertia])").forEach((title) => title.remove());
|
|
3635
|
+
}
|
|
3632
3636
|
targetElements.forEach((targetElement) => {
|
|
3633
3637
|
const index = this.findMatchingElementIndex(targetElement, sourceElements);
|
|
3634
3638
|
if (index === -1) {
|
|
@@ -3640,7 +3644,9 @@ var Renderer = {
|
|
|
3640
3644
|
targetElement.replaceWith(sourceElement);
|
|
3641
3645
|
}
|
|
3642
3646
|
});
|
|
3643
|
-
sourceElements.forEach((element) =>
|
|
3647
|
+
sourceElements.forEach((element) => {
|
|
3648
|
+
document.head.appendChild(element);
|
|
3649
|
+
});
|
|
3644
3650
|
}, 1)
|
|
3645
3651
|
};
|
|
3646
3652
|
function createHeadManager(isServer3, titleCallback, onUpdate) {
|