@inertiajs/vue3 2.3.7 → 2.3.9
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 +36 -10
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +25 -9
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
- package/types/form.d.ts +2 -1
- package/types/index.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(index_exports, {
|
|
|
32
32
|
progress: () => import_core13.progress,
|
|
33
33
|
router: () => import_core13.router,
|
|
34
34
|
useForm: () => useForm,
|
|
35
|
+
useFormContext: () => useFormContext,
|
|
35
36
|
usePage: () => usePage,
|
|
36
37
|
usePoll: () => usePoll,
|
|
37
38
|
usePrefetch: () => usePrefetch,
|
|
@@ -604,6 +605,7 @@ var import_core5 = require("@inertiajs/core");
|
|
|
604
605
|
var import_lodash_es3 = require("lodash-es");
|
|
605
606
|
var import_vue5 = require("vue");
|
|
606
607
|
var noop = () => void 0;
|
|
608
|
+
var FormContextKey = Symbol("InertiaFormContext");
|
|
607
609
|
var Form = (0, import_vue5.defineComponent)({
|
|
608
610
|
name: "Form",
|
|
609
611
|
slots: Object,
|
|
@@ -856,6 +858,7 @@ var Form = (0, import_vue5.defineComponent)({
|
|
|
856
858
|
validator: () => form.validator()
|
|
857
859
|
};
|
|
858
860
|
expose(exposed);
|
|
861
|
+
(0, import_vue5.provide)(FormContextKey, exposed);
|
|
859
862
|
return () => {
|
|
860
863
|
return (0, import_vue5.h)(
|
|
861
864
|
"form",
|
|
@@ -875,6 +878,9 @@ var Form = (0, import_vue5.defineComponent)({
|
|
|
875
878
|
};
|
|
876
879
|
}
|
|
877
880
|
});
|
|
881
|
+
function useFormContext() {
|
|
882
|
+
return (0, import_vue5.inject)(FormContextKey);
|
|
883
|
+
}
|
|
878
884
|
var form_default = Form;
|
|
879
885
|
|
|
880
886
|
// src/head.ts
|
|
@@ -1095,6 +1101,13 @@ var InfiniteScroll = (0, import_vue7.defineComponent)({
|
|
|
1095
1101
|
const loadingPrevious = (0, import_vue7.ref)(false);
|
|
1096
1102
|
const loadingNext = (0, import_vue7.ref)(false);
|
|
1097
1103
|
const requestCount = (0, import_vue7.ref)(0);
|
|
1104
|
+
const hasPreviousPage = (0, import_vue7.ref)(false);
|
|
1105
|
+
const hasNextPage = (0, import_vue7.ref)(false);
|
|
1106
|
+
const syncStateFromDataManager = () => {
|
|
1107
|
+
requestCount.value = dataManager.getRequestCount();
|
|
1108
|
+
hasPreviousPage.value = dataManager.hasPrevious();
|
|
1109
|
+
hasNextPage.value = dataManager.hasNext();
|
|
1110
|
+
};
|
|
1098
1111
|
const {
|
|
1099
1112
|
dataManager,
|
|
1100
1113
|
elementManager,
|
|
@@ -1116,15 +1129,16 @@ var InfiniteScroll = (0, import_vue7.defineComponent)({
|
|
|
1116
1129
|
onBeforePreviousRequest: () => loadingPrevious.value = true,
|
|
1117
1130
|
onBeforeNextRequest: () => loadingNext.value = true,
|
|
1118
1131
|
onCompletePreviousRequest: () => {
|
|
1119
|
-
requestCount.value = dataManager.getRequestCount();
|
|
1120
1132
|
loadingPrevious.value = false;
|
|
1133
|
+
syncStateFromDataManager();
|
|
1121
1134
|
},
|
|
1122
1135
|
onCompleteNextRequest: () => {
|
|
1123
|
-
requestCount.value = dataManager.getRequestCount();
|
|
1124
1136
|
loadingNext.value = false;
|
|
1125
|
-
|
|
1137
|
+
syncStateFromDataManager();
|
|
1138
|
+
},
|
|
1139
|
+
onDataReset: syncStateFromDataManager
|
|
1126
1140
|
});
|
|
1127
|
-
|
|
1141
|
+
syncStateFromDataManager();
|
|
1128
1142
|
const autoLoad = (0, import_vue7.computed)(() => !manualMode.value);
|
|
1129
1143
|
const manualMode = (0, import_vue7.computed)(
|
|
1130
1144
|
() => props.manual || props.manualAfter > 0 && requestCount.value >= props.manualAfter
|
|
@@ -1171,8 +1185,8 @@ var InfiniteScroll = (0, import_vue7.defineComponent)({
|
|
|
1171
1185
|
const sharedExposed = {
|
|
1172
1186
|
loadingPrevious: loadingPrevious.value,
|
|
1173
1187
|
loadingNext: loadingNext.value,
|
|
1174
|
-
hasPrevious:
|
|
1175
|
-
hasNext:
|
|
1188
|
+
hasPrevious: hasPreviousPage.value,
|
|
1189
|
+
hasNext: hasNextPage.value
|
|
1176
1190
|
};
|
|
1177
1191
|
if (!props.startElement) {
|
|
1178
1192
|
const headerAutoMode = autoLoad.value && !props.onlyNext;
|
|
@@ -1181,7 +1195,7 @@ var InfiniteScroll = (0, import_vue7.defineComponent)({
|
|
|
1181
1195
|
fetch: dataManager.fetchPrevious,
|
|
1182
1196
|
autoMode: headerAutoMode,
|
|
1183
1197
|
manualMode: !headerAutoMode,
|
|
1184
|
-
hasMore:
|
|
1198
|
+
hasMore: hasPreviousPage.value,
|
|
1185
1199
|
...sharedExposed
|
|
1186
1200
|
};
|
|
1187
1201
|
renderElements.push(
|
|
@@ -1210,7 +1224,7 @@ var InfiniteScroll = (0, import_vue7.defineComponent)({
|
|
|
1210
1224
|
fetch: dataManager.fetchNext,
|
|
1211
1225
|
autoMode: footerAutoMode,
|
|
1212
1226
|
manualMode: !footerAutoMode,
|
|
1213
|
-
hasMore:
|
|
1227
|
+
hasMore: hasNextPage.value,
|
|
1214
1228
|
...sharedExposed
|
|
1215
1229
|
};
|
|
1216
1230
|
renderElements.push(
|
|
@@ -1661,7 +1675,9 @@ var whenVisible_default = (0, import_vue12.defineComponent)({
|
|
|
1661
1675
|
if (exists && !this.always) {
|
|
1662
1676
|
return;
|
|
1663
1677
|
}
|
|
1664
|
-
|
|
1678
|
+
if (!this.observer || !exists) {
|
|
1679
|
+
this.$nextTick(this.registerObserver);
|
|
1680
|
+
}
|
|
1665
1681
|
},
|
|
1666
1682
|
{ immediate: true }
|
|
1667
1683
|
);
|