countries selection fixed
This commit is contained in:
+48
-14
@@ -10074,6 +10074,22 @@ function dataSet(object, key, value) {
|
||||
function isNumeric(subject) {
|
||||
return !isNaN(parseInt(subject));
|
||||
}
|
||||
function dataDelete(object, key) {
|
||||
let segments = parsePathSegments(key);
|
||||
if (segments.length === 1) {
|
||||
if (Array.isArray(object)) {
|
||||
object.splice(segments[0], 1);
|
||||
} else {
|
||||
delete object[segments[0]];
|
||||
}
|
||||
return;
|
||||
}
|
||||
let firstSegment = segments.shift();
|
||||
let restOfSegments = segments.join(".");
|
||||
if (object[firstSegment] !== void 0) {
|
||||
dataDelete(object[firstSegment], restOfSegments);
|
||||
}
|
||||
}
|
||||
function diff(left, right, diffs = {}, path = "") {
|
||||
if (left === right)
|
||||
return diffs;
|
||||
@@ -13417,17 +13433,23 @@ function whenThisLinkIsPressed(el, callback) {
|
||||
let isNotPlainEnterKey = (e) => e.which !== 13 || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey;
|
||||
el.addEventListener("click", (e) => {
|
||||
if (isProgrammaticClick(e)) {
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => whenReleased());
|
||||
return;
|
||||
}
|
||||
if (isNotPlainLeftClick(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
});
|
||||
el.addEventListener("mousedown", (e) => {
|
||||
if (isNotPlainLeftClick(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => {
|
||||
let handler = (e2) => {
|
||||
@@ -13443,6 +13465,8 @@ function whenThisLinkIsPressed(el, callback) {
|
||||
el.addEventListener("keydown", (e) => {
|
||||
if (isNotPlainEnterKey(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => whenReleased());
|
||||
});
|
||||
@@ -13465,6 +13489,20 @@ function extractDestinationFromLink(linkEl) {
|
||||
function createUrlObjectFromString2(urlString) {
|
||||
return urlString !== null && new URL(urlString, document.baseURI);
|
||||
}
|
||||
function linkShouldBeHandledNatively(linkEl, destination = extractDestinationFromLink(linkEl)) {
|
||||
if (!destination)
|
||||
return true;
|
||||
if (!["http:", "https:"].includes(destination.protocol))
|
||||
return true;
|
||||
if (destination.origin !== window.location.origin)
|
||||
return true;
|
||||
if (linkEl.hasAttribute("download"))
|
||||
return true;
|
||||
let target = linkEl.getAttribute("target")?.trim().toLowerCase();
|
||||
if (target && target !== "_self")
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
function getUriStringFromUrlObject(urlObject) {
|
||||
return urlObject.pathname + urlObject.search + urlObject.hash;
|
||||
}
|
||||
@@ -13923,7 +13961,6 @@ function ignoreAttributes(subject, attributesToRemove) {
|
||||
var enablePersist = true;
|
||||
var showProgressBar = true;
|
||||
var restoreScroll = true;
|
||||
var autofocus = false;
|
||||
function navigate_default(Alpine25) {
|
||||
Alpine25.navigate = (url, options = {}) => {
|
||||
let { preserveScroll = false } = options;
|
||||
@@ -13946,7 +13983,7 @@ function navigate_default(Alpine25) {
|
||||
let preserveScroll = modifiers.includes("preserve-scroll");
|
||||
shouldPrefetchOnHover && whenThisLinkIsHoveredFor(el, 60, () => {
|
||||
let destination = extractDestinationFromLink(el);
|
||||
if (!destination)
|
||||
if (linkShouldBeHandledNatively(el, destination))
|
||||
return;
|
||||
prefetchHtml(destination, (html, finalDestination) => {
|
||||
storeThePrefetchedHtmlForWhenALinkIsClicked(html, destination, finalDestination);
|
||||
@@ -13956,8 +13993,6 @@ function navigate_default(Alpine25) {
|
||||
});
|
||||
whenThisLinkIsPressed(el, (whenItIsReleased) => {
|
||||
let destination = extractDestinationFromLink(el);
|
||||
if (!destination)
|
||||
return;
|
||||
prefetchHtml(destination, (html, finalDestination) => {
|
||||
storeThePrefetchedHtmlForWhenALinkIsClicked(html, destination, finalDestination);
|
||||
}, () => {
|
||||
@@ -14005,10 +14040,8 @@ function navigate_default(Alpine25) {
|
||||
swapCallbacks.forEach((callback) => callback());
|
||||
afterNewScriptsAreDoneLoading(() => {
|
||||
andAfterAllThis(() => {
|
||||
setTimeout(() => {
|
||||
autofocus && autofocusElementsWithTheAutofocusAttribute();
|
||||
});
|
||||
nowInitializeAlpineOnTheNewPage(Alpine25);
|
||||
autofocusElementsWithTheAutofocusAttribute();
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigated");
|
||||
showProgressBar && finishAndHideProgressBar();
|
||||
});
|
||||
@@ -14047,6 +14080,7 @@ function navigate_default(Alpine25) {
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigating", {
|
||||
onSwap: (callback) => swapCallbacks.push(callback)
|
||||
});
|
||||
cleanupAlpineElementsOnThePageThatArentInsideAPersistedElement();
|
||||
updateCurrentPageHtmlInSnapshotCacheForLaterBackButtonClicks(currentPageKey, currentPageUrl);
|
||||
preventAlpineFromPickingUpDomChanges(Alpine25, (andAfterAllThis) => {
|
||||
enablePersist && storePersistantElementsForLater((persistedEl) => {
|
||||
@@ -14063,8 +14097,8 @@ function navigate_default(Alpine25) {
|
||||
restoreScrollPositionOrScrollToTop();
|
||||
swapCallbacks.forEach((callback) => callback());
|
||||
andAfterAllThis(() => {
|
||||
autofocus && autofocusElementsWithTheAutofocusAttribute();
|
||||
nowInitializeAlpineOnTheNewPage(Alpine25);
|
||||
autofocusElementsWithTheAutofocusAttribute();
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigated");
|
||||
});
|
||||
});
|
||||
@@ -14229,24 +14263,24 @@ function queryStringUtils() {
|
||||
if (!search)
|
||||
return false;
|
||||
let data = fromQueryString(search, key);
|
||||
return Object.keys(data).includes(key);
|
||||
return dataGet(data, key) !== void 0;
|
||||
},
|
||||
get(url, key) {
|
||||
let search = url.search;
|
||||
if (!search)
|
||||
return false;
|
||||
let data = fromQueryString(search, key);
|
||||
return data[key];
|
||||
return dataGet(data, key);
|
||||
},
|
||||
set(url, key, value) {
|
||||
let data = fromQueryString(url.search, key);
|
||||
data[key] = stripNulls(unwrap(value));
|
||||
dataSet(data, key, stripNulls(unwrap(value)));
|
||||
url.search = toQueryString(data);
|
||||
return url;
|
||||
},
|
||||
remove(url, key) {
|
||||
let data = fromQueryString(url.search, key);
|
||||
delete data[key];
|
||||
dataDelete(data, key);
|
||||
url.search = toQueryString(data);
|
||||
return url;
|
||||
}
|
||||
@@ -14301,11 +14335,11 @@ function fromQueryString(search, queryKey) {
|
||||
return;
|
||||
value = decodeURIComponent(value.replaceAll("+", "%20"));
|
||||
let decodedKey = decodeURIComponent(key);
|
||||
let shouldBeHandledAsArray = decodedKey.includes("[") && decodedKey.startsWith(queryKey);
|
||||
let dotNotatedKey = decodedKey.replaceAll("[", ".").replaceAll("]", "");
|
||||
let shouldBeHandledAsArray = decodedKey.includes("[") && (dotNotatedKey === queryKey || dotNotatedKey.startsWith(`${queryKey}.`));
|
||||
if (!shouldBeHandledAsArray) {
|
||||
data[key] = value;
|
||||
} else {
|
||||
let dotNotatedKey = decodedKey.replaceAll("[", ".").replaceAll("]", "");
|
||||
insertDotNotatedValueIntoData(dotNotatedKey, value, data);
|
||||
}
|
||||
});
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+48
-14
@@ -5164,6 +5164,22 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
function isNumeric(subject) {
|
||||
return !isNaN(parseInt(subject));
|
||||
}
|
||||
function dataDelete(object, key) {
|
||||
let segments = parsePathSegments(key);
|
||||
if (segments.length === 1) {
|
||||
if (Array.isArray(object)) {
|
||||
object.splice(segments[0], 1);
|
||||
} else {
|
||||
delete object[segments[0]];
|
||||
}
|
||||
return;
|
||||
}
|
||||
let firstSegment = segments.shift();
|
||||
let restOfSegments = segments.join(".");
|
||||
if (object[firstSegment] !== void 0) {
|
||||
dataDelete(object[firstSegment], restOfSegments);
|
||||
}
|
||||
}
|
||||
function diff(left, right, diffs = {}, path = "") {
|
||||
if (left === right)
|
||||
return diffs;
|
||||
@@ -13853,17 +13869,23 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
let isNotPlainEnterKey = (e) => e.which !== 13 || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey;
|
||||
el.addEventListener("click", (e) => {
|
||||
if (isProgrammaticClick(e)) {
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => whenReleased());
|
||||
return;
|
||||
}
|
||||
if (isNotPlainLeftClick(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
});
|
||||
el.addEventListener("mousedown", (e) => {
|
||||
if (isNotPlainLeftClick(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => {
|
||||
let handler = (e2) => {
|
||||
@@ -13879,6 +13901,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
el.addEventListener("keydown", (e) => {
|
||||
if (isNotPlainEnterKey(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => whenReleased());
|
||||
});
|
||||
@@ -13901,6 +13925,20 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
function createUrlObjectFromString2(urlString) {
|
||||
return urlString !== null && new URL(urlString, document.baseURI);
|
||||
}
|
||||
function linkShouldBeHandledNatively(linkEl, destination = extractDestinationFromLink(linkEl)) {
|
||||
if (!destination)
|
||||
return true;
|
||||
if (!["http:", "https:"].includes(destination.protocol))
|
||||
return true;
|
||||
if (destination.origin !== window.location.origin)
|
||||
return true;
|
||||
if (linkEl.hasAttribute("download"))
|
||||
return true;
|
||||
let target = linkEl.getAttribute("target")?.trim().toLowerCase();
|
||||
if (target && target !== "_self")
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
function getUriStringFromUrlObject(urlObject) {
|
||||
return urlObject.pathname + urlObject.search + urlObject.hash;
|
||||
}
|
||||
@@ -14359,7 +14397,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
var enablePersist = true;
|
||||
var showProgressBar = true;
|
||||
var restoreScroll = true;
|
||||
var autofocus = false;
|
||||
function navigate_default(Alpine25) {
|
||||
Alpine25.navigate = (url, options = {}) => {
|
||||
let { preserveScroll = false } = options;
|
||||
@@ -14382,7 +14419,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
let preserveScroll = modifiers.includes("preserve-scroll");
|
||||
shouldPrefetchOnHover && whenThisLinkIsHoveredFor(el, 60, () => {
|
||||
let destination = extractDestinationFromLink(el);
|
||||
if (!destination)
|
||||
if (linkShouldBeHandledNatively(el, destination))
|
||||
return;
|
||||
prefetchHtml(destination, (html, finalDestination) => {
|
||||
storeThePrefetchedHtmlForWhenALinkIsClicked(html, destination, finalDestination);
|
||||
@@ -14392,8 +14429,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
});
|
||||
whenThisLinkIsPressed(el, (whenItIsReleased) => {
|
||||
let destination = extractDestinationFromLink(el);
|
||||
if (!destination)
|
||||
return;
|
||||
prefetchHtml(destination, (html, finalDestination) => {
|
||||
storeThePrefetchedHtmlForWhenALinkIsClicked(html, destination, finalDestination);
|
||||
}, () => {
|
||||
@@ -14441,10 +14476,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
swapCallbacks.forEach((callback) => callback());
|
||||
afterNewScriptsAreDoneLoading(() => {
|
||||
andAfterAllThis(() => {
|
||||
setTimeout(() => {
|
||||
autofocus && autofocusElementsWithTheAutofocusAttribute();
|
||||
});
|
||||
nowInitializeAlpineOnTheNewPage(Alpine25);
|
||||
autofocusElementsWithTheAutofocusAttribute();
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigated");
|
||||
showProgressBar && finishAndHideProgressBar();
|
||||
});
|
||||
@@ -14483,6 +14516,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigating", {
|
||||
onSwap: (callback) => swapCallbacks.push(callback)
|
||||
});
|
||||
cleanupAlpineElementsOnThePageThatArentInsideAPersistedElement();
|
||||
updateCurrentPageHtmlInSnapshotCacheForLaterBackButtonClicks(currentPageKey, currentPageUrl);
|
||||
preventAlpineFromPickingUpDomChanges(Alpine25, (andAfterAllThis) => {
|
||||
enablePersist && storePersistantElementsForLater((persistedEl) => {
|
||||
@@ -14499,8 +14533,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
restoreScrollPositionOrScrollToTop();
|
||||
swapCallbacks.forEach((callback) => callback());
|
||||
andAfterAllThis(() => {
|
||||
autofocus && autofocusElementsWithTheAutofocusAttribute();
|
||||
nowInitializeAlpineOnTheNewPage(Alpine25);
|
||||
autofocusElementsWithTheAutofocusAttribute();
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigated");
|
||||
});
|
||||
});
|
||||
@@ -14665,24 +14699,24 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
if (!search)
|
||||
return false;
|
||||
let data = fromQueryString(search, key);
|
||||
return Object.keys(data).includes(key);
|
||||
return dataGet(data, key) !== void 0;
|
||||
},
|
||||
get(url, key) {
|
||||
let search = url.search;
|
||||
if (!search)
|
||||
return false;
|
||||
let data = fromQueryString(search, key);
|
||||
return data[key];
|
||||
return dataGet(data, key);
|
||||
},
|
||||
set(url, key, value) {
|
||||
let data = fromQueryString(url.search, key);
|
||||
data[key] = stripNulls(unwrap(value));
|
||||
dataSet(data, key, stripNulls(unwrap(value)));
|
||||
url.search = toQueryString(data);
|
||||
return url;
|
||||
},
|
||||
remove(url, key) {
|
||||
let data = fromQueryString(url.search, key);
|
||||
delete data[key];
|
||||
dataDelete(data, key);
|
||||
url.search = toQueryString(data);
|
||||
return url;
|
||||
}
|
||||
@@ -14737,11 +14771,11 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
return;
|
||||
value = decodeURIComponent(value.replaceAll("+", "%20"));
|
||||
let decodedKey = decodeURIComponent(key);
|
||||
let shouldBeHandledAsArray = decodedKey.includes("[") && decodedKey.startsWith(queryKey);
|
||||
let dotNotatedKey = decodedKey.replaceAll("[", ".").replaceAll("]", "");
|
||||
let shouldBeHandledAsArray = decodedKey.includes("[") && (dotNotatedKey === queryKey || dotNotatedKey.startsWith(`${queryKey}.`));
|
||||
if (!shouldBeHandledAsArray) {
|
||||
data[key] = value;
|
||||
} else {
|
||||
let dotNotatedKey = decodedKey.replaceAll("[", ".").replaceAll("]", "");
|
||||
insertDotNotatedValueIntoData(dotNotatedKey, value, data);
|
||||
}
|
||||
});
|
||||
|
||||
+11
-11
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+48
-14
@@ -9304,6 +9304,22 @@ function dataSet(object, key, value) {
|
||||
function isNumeric(subject) {
|
||||
return !isNaN(parseInt(subject));
|
||||
}
|
||||
function dataDelete(object, key) {
|
||||
let segments = parsePathSegments(key);
|
||||
if (segments.length === 1) {
|
||||
if (Array.isArray(object)) {
|
||||
object.splice(segments[0], 1);
|
||||
} else {
|
||||
delete object[segments[0]];
|
||||
}
|
||||
return;
|
||||
}
|
||||
let firstSegment = segments.shift();
|
||||
let restOfSegments = segments.join(".");
|
||||
if (object[firstSegment] !== void 0) {
|
||||
dataDelete(object[firstSegment], restOfSegments);
|
||||
}
|
||||
}
|
||||
function diff(left, right, diffs = {}, path = "") {
|
||||
if (left === right)
|
||||
return diffs;
|
||||
@@ -12647,17 +12663,23 @@ function whenThisLinkIsPressed(el, callback) {
|
||||
let isNotPlainEnterKey = (e) => e.which !== 13 || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey;
|
||||
el.addEventListener("click", (e) => {
|
||||
if (isProgrammaticClick(e)) {
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => whenReleased());
|
||||
return;
|
||||
}
|
||||
if (isNotPlainLeftClick(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
});
|
||||
el.addEventListener("mousedown", (e) => {
|
||||
if (isNotPlainLeftClick(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => {
|
||||
let handler = (e2) => {
|
||||
@@ -12673,6 +12695,8 @@ function whenThisLinkIsPressed(el, callback) {
|
||||
el.addEventListener("keydown", (e) => {
|
||||
if (isNotPlainEnterKey(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => whenReleased());
|
||||
});
|
||||
@@ -12695,6 +12719,20 @@ function extractDestinationFromLink(linkEl) {
|
||||
function createUrlObjectFromString2(urlString) {
|
||||
return urlString !== null && new URL(urlString, document.baseURI);
|
||||
}
|
||||
function linkShouldBeHandledNatively(linkEl, destination = extractDestinationFromLink(linkEl)) {
|
||||
if (!destination)
|
||||
return true;
|
||||
if (!["http:", "https:"].includes(destination.protocol))
|
||||
return true;
|
||||
if (destination.origin !== window.location.origin)
|
||||
return true;
|
||||
if (linkEl.hasAttribute("download"))
|
||||
return true;
|
||||
let target = linkEl.getAttribute("target")?.trim().toLowerCase();
|
||||
if (target && target !== "_self")
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
function getUriStringFromUrlObject(urlObject) {
|
||||
return urlObject.pathname + urlObject.search + urlObject.hash;
|
||||
}
|
||||
@@ -13153,7 +13191,6 @@ function ignoreAttributes(subject, attributesToRemove) {
|
||||
var enablePersist = true;
|
||||
var showProgressBar = true;
|
||||
var restoreScroll = true;
|
||||
var autofocus = false;
|
||||
function navigate_default(Alpine25) {
|
||||
Alpine25.navigate = (url, options = {}) => {
|
||||
let { preserveScroll = false } = options;
|
||||
@@ -13176,7 +13213,7 @@ function navigate_default(Alpine25) {
|
||||
let preserveScroll = modifiers.includes("preserve-scroll");
|
||||
shouldPrefetchOnHover && whenThisLinkIsHoveredFor(el, 60, () => {
|
||||
let destination = extractDestinationFromLink(el);
|
||||
if (!destination)
|
||||
if (linkShouldBeHandledNatively(el, destination))
|
||||
return;
|
||||
prefetchHtml(destination, (html, finalDestination) => {
|
||||
storeThePrefetchedHtmlForWhenALinkIsClicked(html, destination, finalDestination);
|
||||
@@ -13186,8 +13223,6 @@ function navigate_default(Alpine25) {
|
||||
});
|
||||
whenThisLinkIsPressed(el, (whenItIsReleased) => {
|
||||
let destination = extractDestinationFromLink(el);
|
||||
if (!destination)
|
||||
return;
|
||||
prefetchHtml(destination, (html, finalDestination) => {
|
||||
storeThePrefetchedHtmlForWhenALinkIsClicked(html, destination, finalDestination);
|
||||
}, () => {
|
||||
@@ -13235,10 +13270,8 @@ function navigate_default(Alpine25) {
|
||||
swapCallbacks.forEach((callback) => callback());
|
||||
afterNewScriptsAreDoneLoading(() => {
|
||||
andAfterAllThis(() => {
|
||||
setTimeout(() => {
|
||||
autofocus && autofocusElementsWithTheAutofocusAttribute();
|
||||
});
|
||||
nowInitializeAlpineOnTheNewPage(Alpine25);
|
||||
autofocusElementsWithTheAutofocusAttribute();
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigated");
|
||||
showProgressBar && finishAndHideProgressBar();
|
||||
});
|
||||
@@ -13277,6 +13310,7 @@ function navigate_default(Alpine25) {
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigating", {
|
||||
onSwap: (callback) => swapCallbacks.push(callback)
|
||||
});
|
||||
cleanupAlpineElementsOnThePageThatArentInsideAPersistedElement();
|
||||
updateCurrentPageHtmlInSnapshotCacheForLaterBackButtonClicks(currentPageKey, currentPageUrl);
|
||||
preventAlpineFromPickingUpDomChanges(Alpine25, (andAfterAllThis) => {
|
||||
enablePersist && storePersistantElementsForLater((persistedEl) => {
|
||||
@@ -13293,8 +13327,8 @@ function navigate_default(Alpine25) {
|
||||
restoreScrollPositionOrScrollToTop();
|
||||
swapCallbacks.forEach((callback) => callback());
|
||||
andAfterAllThis(() => {
|
||||
autofocus && autofocusElementsWithTheAutofocusAttribute();
|
||||
nowInitializeAlpineOnTheNewPage(Alpine25);
|
||||
autofocusElementsWithTheAutofocusAttribute();
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigated");
|
||||
});
|
||||
});
|
||||
@@ -13459,24 +13493,24 @@ function queryStringUtils() {
|
||||
if (!search)
|
||||
return false;
|
||||
let data = fromQueryString(search, key);
|
||||
return Object.keys(data).includes(key);
|
||||
return dataGet(data, key) !== void 0;
|
||||
},
|
||||
get(url, key) {
|
||||
let search = url.search;
|
||||
if (!search)
|
||||
return false;
|
||||
let data = fromQueryString(search, key);
|
||||
return data[key];
|
||||
return dataGet(data, key);
|
||||
},
|
||||
set(url, key, value) {
|
||||
let data = fromQueryString(url.search, key);
|
||||
data[key] = stripNulls(unwrap(value));
|
||||
dataSet(data, key, stripNulls(unwrap(value)));
|
||||
url.search = toQueryString(data);
|
||||
return url;
|
||||
},
|
||||
remove(url, key) {
|
||||
let data = fromQueryString(url.search, key);
|
||||
delete data[key];
|
||||
dataDelete(data, key);
|
||||
url.search = toQueryString(data);
|
||||
return url;
|
||||
}
|
||||
@@ -13531,11 +13565,11 @@ function fromQueryString(search, queryKey) {
|
||||
return;
|
||||
value = decodeURIComponent(value.replaceAll("+", "%20"));
|
||||
let decodedKey = decodeURIComponent(key);
|
||||
let shouldBeHandledAsArray = decodedKey.includes("[") && decodedKey.startsWith(queryKey);
|
||||
let dotNotatedKey = decodedKey.replaceAll("[", ".").replaceAll("]", "");
|
||||
let shouldBeHandledAsArray = decodedKey.includes("[") && (dotNotatedKey === queryKey || dotNotatedKey.startsWith(`${queryKey}.`));
|
||||
if (!shouldBeHandledAsArray) {
|
||||
data[key] = value;
|
||||
} else {
|
||||
let dotNotatedKey = decodedKey.replaceAll("[", ".").replaceAll("]", "");
|
||||
insertDotNotatedValueIntoData(dotNotatedKey, value, data);
|
||||
}
|
||||
});
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+48
-14
@@ -405,6 +405,22 @@
|
||||
function isNumeric(subject) {
|
||||
return !isNaN(parseInt(subject));
|
||||
}
|
||||
function dataDelete(object, key) {
|
||||
let segments = parsePathSegments(key);
|
||||
if (segments.length === 1) {
|
||||
if (Array.isArray(object)) {
|
||||
object.splice(segments[0], 1);
|
||||
} else {
|
||||
delete object[segments[0]];
|
||||
}
|
||||
return;
|
||||
}
|
||||
let firstSegment = segments.shift();
|
||||
let restOfSegments = segments.join(".");
|
||||
if (object[firstSegment] !== void 0) {
|
||||
dataDelete(object[firstSegment], restOfSegments);
|
||||
}
|
||||
}
|
||||
function diff(left, right, diffs = {}, path = "") {
|
||||
if (left === right)
|
||||
return diffs;
|
||||
@@ -12440,17 +12456,23 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
let isNotPlainEnterKey = (e) => e.which !== 13 || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey;
|
||||
el.addEventListener("click", (e) => {
|
||||
if (isProgrammaticClick(e)) {
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => whenReleased());
|
||||
return;
|
||||
}
|
||||
if (isNotPlainLeftClick(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
});
|
||||
el.addEventListener("mousedown", (e) => {
|
||||
if (isNotPlainLeftClick(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => {
|
||||
let handler4 = (e2) => {
|
||||
@@ -12466,6 +12488,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
el.addEventListener("keydown", (e) => {
|
||||
if (isNotPlainEnterKey(e))
|
||||
return;
|
||||
if (linkShouldBeHandledNatively(el))
|
||||
return;
|
||||
e.preventDefault();
|
||||
callback((whenReleased) => whenReleased());
|
||||
});
|
||||
@@ -12488,6 +12512,20 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
function createUrlObjectFromString2(urlString) {
|
||||
return urlString !== null && new URL(urlString, document.baseURI);
|
||||
}
|
||||
function linkShouldBeHandledNatively(linkEl, destination = extractDestinationFromLink(linkEl)) {
|
||||
if (!destination)
|
||||
return true;
|
||||
if (!["http:", "https:"].includes(destination.protocol))
|
||||
return true;
|
||||
if (destination.origin !== window.location.origin)
|
||||
return true;
|
||||
if (linkEl.hasAttribute("download"))
|
||||
return true;
|
||||
let target = linkEl.getAttribute("target")?.trim().toLowerCase();
|
||||
if (target && target !== "_self")
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
function getUriStringFromUrlObject(urlObject) {
|
||||
return urlObject.pathname + urlObject.search + urlObject.hash;
|
||||
}
|
||||
@@ -12944,7 +12982,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
var enablePersist = true;
|
||||
var showProgressBar = true;
|
||||
var restoreScroll = true;
|
||||
var autofocus = false;
|
||||
function navigate_default(Alpine3) {
|
||||
Alpine3.navigate = (url, options = {}) => {
|
||||
let { preserveScroll = false } = options;
|
||||
@@ -12967,7 +13004,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
let preserveScroll = modifiers.includes("preserve-scroll");
|
||||
shouldPrefetchOnHover && whenThisLinkIsHoveredFor(el, 60, () => {
|
||||
let destination = extractDestinationFromLink(el);
|
||||
if (!destination)
|
||||
if (linkShouldBeHandledNatively(el, destination))
|
||||
return;
|
||||
prefetchHtml(destination, (html, finalDestination) => {
|
||||
storeThePrefetchedHtmlForWhenALinkIsClicked(html, destination, finalDestination);
|
||||
@@ -12977,8 +13014,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
});
|
||||
whenThisLinkIsPressed(el, (whenItIsReleased) => {
|
||||
let destination = extractDestinationFromLink(el);
|
||||
if (!destination)
|
||||
return;
|
||||
prefetchHtml(destination, (html, finalDestination) => {
|
||||
storeThePrefetchedHtmlForWhenALinkIsClicked(html, destination, finalDestination);
|
||||
}, () => {
|
||||
@@ -13026,10 +13061,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
swapCallbacks.forEach((callback) => callback());
|
||||
afterNewScriptsAreDoneLoading(() => {
|
||||
andAfterAllThis(() => {
|
||||
setTimeout(() => {
|
||||
autofocus && autofocusElementsWithTheAutofocusAttribute();
|
||||
});
|
||||
nowInitializeAlpineOnTheNewPage(Alpine3);
|
||||
autofocusElementsWithTheAutofocusAttribute();
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigated");
|
||||
showProgressBar && finishAndHideProgressBar();
|
||||
});
|
||||
@@ -13068,6 +13101,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigating", {
|
||||
onSwap: (callback) => swapCallbacks.push(callback)
|
||||
});
|
||||
cleanupAlpineElementsOnThePageThatArentInsideAPersistedElement();
|
||||
updateCurrentPageHtmlInSnapshotCacheForLaterBackButtonClicks(currentPageKey, currentPageUrl);
|
||||
preventAlpineFromPickingUpDomChanges(Alpine3, (andAfterAllThis) => {
|
||||
enablePersist && storePersistantElementsForLater((persistedEl) => {
|
||||
@@ -13084,8 +13118,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
restoreScrollPositionOrScrollToTop();
|
||||
swapCallbacks.forEach((callback) => callback());
|
||||
andAfterAllThis(() => {
|
||||
autofocus && autofocusElementsWithTheAutofocusAttribute();
|
||||
nowInitializeAlpineOnTheNewPage(Alpine3);
|
||||
autofocusElementsWithTheAutofocusAttribute();
|
||||
fireEventForOtherLibrariesToHookInto("alpine:navigated");
|
||||
});
|
||||
});
|
||||
@@ -13250,24 +13284,24 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
if (!search)
|
||||
return false;
|
||||
let data2 = fromQueryString(search, key);
|
||||
return Object.keys(data2).includes(key);
|
||||
return dataGet(data2, key) !== void 0;
|
||||
},
|
||||
get(url, key) {
|
||||
let search = url.search;
|
||||
if (!search)
|
||||
return false;
|
||||
let data2 = fromQueryString(search, key);
|
||||
return data2[key];
|
||||
return dataGet(data2, key);
|
||||
},
|
||||
set(url, key, value) {
|
||||
let data2 = fromQueryString(url.search, key);
|
||||
data2[key] = stripNulls(unwrap(value));
|
||||
dataSet(data2, key, stripNulls(unwrap(value)));
|
||||
url.search = toQueryString(data2);
|
||||
return url;
|
||||
},
|
||||
remove(url, key) {
|
||||
let data2 = fromQueryString(url.search, key);
|
||||
delete data2[key];
|
||||
dataDelete(data2, key);
|
||||
url.search = toQueryString(data2);
|
||||
return url;
|
||||
}
|
||||
@@ -13322,11 +13356,11 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
||||
return;
|
||||
value = decodeURIComponent(value.replaceAll("+", "%20"));
|
||||
let decodedKey = decodeURIComponent(key);
|
||||
let shouldBeHandledAsArray = decodedKey.includes("[") && decodedKey.startsWith(queryKey);
|
||||
let dotNotatedKey = decodedKey.replaceAll("[", ".").replaceAll("]", "");
|
||||
let shouldBeHandledAsArray = decodedKey.includes("[") && (dotNotatedKey === queryKey || dotNotatedKey.startsWith(`${queryKey}.`));
|
||||
if (!shouldBeHandledAsArray) {
|
||||
data2[key] = value;
|
||||
} else {
|
||||
let dotNotatedKey = decodedKey.replaceAll("[", ".").replaceAll("]", "");
|
||||
insertDotNotatedValueIntoData(dotNotatedKey, value, data2);
|
||||
}
|
||||
});
|
||||
|
||||
+9
-9
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
|
||||
{"/livewire.js":"4735e441"}
|
||||
{"/livewire.js":"657d57c2"}
|
||||
|
||||
Reference in New Issue
Block a user