@heycar/heycars-map 0.9.23-alpha3 → 0.9.23-alpha5
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.cjs +58 -17
- package/dist/index.js +58 -17
- package/dist/src/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -1
- package/dist/src/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
- package/dist/src/business-components/StartEndPoint/StartEndPoint.d.ts +2 -2
- package/dist/src/hooks/useMapLoader.d.ts +2 -1
- package/dist/src/hooks/useMapRecomendPlace.d.ts +1 -0
- package/dist/src/types/interface.d.ts +1 -0
- package/dist/src/utils/QueryWxSignatureStatus.d.ts +1 -0
- package/dist/src/utils/transform.d.ts +2 -2
- package/package.json +1 -1
- package/dist/src/business-components/BusinessRecomendPlaceMap/useFirstWorkflowRecomendLoading.d.ts +0 -4
package/dist/index.cjs
CHANGED
|
@@ -19,7 +19,7 @@ if (typeof GeolocationPositionError === "undefined") {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
const name = "@heycar/heycars-map";
|
|
22
|
-
const version = "0.9.23-
|
|
22
|
+
const version = "0.9.23-alpha5";
|
|
23
23
|
const type = "module";
|
|
24
24
|
const bin = {
|
|
25
25
|
checkVersion: "./bin/checkVersion.js"
|
|
@@ -1514,6 +1514,7 @@ const language2vectorMapForeign = (lang) => {
|
|
|
1514
1514
|
switch (lang) {
|
|
1515
1515
|
case "en":
|
|
1516
1516
|
return "style_en";
|
|
1517
|
+
case "zh-TW":
|
|
1517
1518
|
case "zh":
|
|
1518
1519
|
return "style_zh_cn";
|
|
1519
1520
|
}
|
|
@@ -1784,11 +1785,6 @@ const createRunOnce = (fn) => {
|
|
|
1784
1785
|
return result;
|
|
1785
1786
|
};
|
|
1786
1787
|
};
|
|
1787
|
-
const createAsyncNoFailNonNullable = (fn, defaultValue) => {
|
|
1788
|
-
return function noFailNoNullable(...args) {
|
|
1789
|
-
return fn(...args).then((result) => result != null ? result : defaultValue).catch(() => defaultValue);
|
|
1790
|
-
};
|
|
1791
|
-
};
|
|
1792
1788
|
const pipeTimeout = (fn, defaultValue, timeout) => {
|
|
1793
1789
|
return function pipedTimeoutedFunction(...args) {
|
|
1794
1790
|
return new Promise((resolve, reject) => {
|
|
@@ -4199,7 +4195,7 @@ const AStartEndPoint = defineSetup(function AStartEndPoint2(props, {
|
|
|
4199
4195
|
type: type2,
|
|
4200
4196
|
language
|
|
4201
4197
|
} = props;
|
|
4202
|
-
const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
|
|
4198
|
+
const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
|
|
4203
4199
|
const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
|
|
4204
4200
|
if (!description && !title)
|
|
4205
4201
|
return `<img class="AStartEndPoint ${pointIcon({
|
|
@@ -4267,7 +4263,7 @@ const GStartEndPoint = defineSetup(function GStartEndPoint2(props, {
|
|
|
4267
4263
|
type: type2,
|
|
4268
4264
|
language = "zh"
|
|
4269
4265
|
} = props;
|
|
4270
|
-
const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
|
|
4266
|
+
const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
|
|
4271
4267
|
const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
|
|
4272
4268
|
if (!description && !title)
|
|
4273
4269
|
return createDom("img", {
|
|
@@ -4470,10 +4466,22 @@ class QueryWxSignatureStatus {
|
|
|
4470
4466
|
}, this.timeout);
|
|
4471
4467
|
}));
|
|
4472
4468
|
__publicField(this, "timoutStatusPromise", Promise.resolve("TIMEOUT"));
|
|
4469
|
+
__publicField(this, "readyStatusPromise", Promise.resolve("READY"));
|
|
4473
4470
|
this.timeout = timeout;
|
|
4474
4471
|
}
|
|
4475
4472
|
get statusPromise() {
|
|
4476
|
-
|
|
4473
|
+
switch (this.status) {
|
|
4474
|
+
case "PENDING":
|
|
4475
|
+
return this.pendingStatusPromise;
|
|
4476
|
+
case "TIMEOUT":
|
|
4477
|
+
return this.timoutStatusPromise;
|
|
4478
|
+
case "READY":
|
|
4479
|
+
return this.readyStatusPromise;
|
|
4480
|
+
case "FAIL":
|
|
4481
|
+
return Promise.reject(this.error);
|
|
4482
|
+
default:
|
|
4483
|
+
throw new Error("MyError: QueryWxSignatureStatus.statusPromise Never !");
|
|
4484
|
+
}
|
|
4477
4485
|
}
|
|
4478
4486
|
}
|
|
4479
4487
|
function createCustomGeolocationPositionError(message, code) {
|
|
@@ -7270,6 +7278,25 @@ const useMapPlace = (props) => {
|
|
|
7270
7278
|
const { supplier } = useMapSupplier();
|
|
7271
7279
|
return supplier === "gmap" ? useGmapPlace(props) : useAmapPlace(props);
|
|
7272
7280
|
};
|
|
7281
|
+
function mergeGetRecommendPlaceAndGetAvailable(getRecomendPlace, getAvailable, timeout) {
|
|
7282
|
+
return function mergedGetRecommendPlace(place, context2) {
|
|
7283
|
+
const available = true;
|
|
7284
|
+
return new Promise((resolve) => {
|
|
7285
|
+
getAvailable(place).then((value) => {
|
|
7286
|
+
if (!value)
|
|
7287
|
+
resolve({ available: false });
|
|
7288
|
+
});
|
|
7289
|
+
getRecomendPlace(place, context2).then((result) => {
|
|
7290
|
+
debugger;
|
|
7291
|
+
resolve(result != null ? result : { available });
|
|
7292
|
+
}).catch(() => {
|
|
7293
|
+
debugger;
|
|
7294
|
+
resolve({ available });
|
|
7295
|
+
});
|
|
7296
|
+
setTimeout(() => resolve({ available }), timeout);
|
|
7297
|
+
});
|
|
7298
|
+
};
|
|
7299
|
+
}
|
|
7273
7300
|
function findNearestPlace(place, candidates, distanceFn) {
|
|
7274
7301
|
var _a;
|
|
7275
7302
|
let shortestDistance = Infinity;
|
|
@@ -7286,6 +7313,7 @@ function findNearestPlace(place, candidates, distanceFn) {
|
|
|
7286
7313
|
const useMapRecomendPlace = (props) => {
|
|
7287
7314
|
const {
|
|
7288
7315
|
defaultPoint,
|
|
7316
|
+
getAvailable,
|
|
7289
7317
|
getRecomendPlace,
|
|
7290
7318
|
getLimit,
|
|
7291
7319
|
context: context2,
|
|
@@ -7311,9 +7339,9 @@ const useMapRecomendPlace = (props) => {
|
|
|
7311
7339
|
displayName: ""
|
|
7312
7340
|
});
|
|
7313
7341
|
const isQueryingRef = Vue.ref(false);
|
|
7314
|
-
const getRecomendPlaceNoFail =
|
|
7315
|
-
|
|
7316
|
-
|
|
7342
|
+
const getRecomendPlaceNoFail = mergeGetRecommendPlaceAndGetAvailable(
|
|
7343
|
+
getRecomendPlace,
|
|
7344
|
+
getAvailable,
|
|
7317
7345
|
GET_RECOMMEND_PLACE_TIMEOUT
|
|
7318
7346
|
);
|
|
7319
7347
|
const findAttachedPlace = async (place) => {
|
|
@@ -8412,10 +8440,12 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8412
8440
|
geoDefaultPosition,
|
|
8413
8441
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
8414
8442
|
geoErrorOnceNotificationInterval = 0,
|
|
8443
|
+
getAvailable,
|
|
8415
8444
|
getRecomendPlace,
|
|
8416
8445
|
getDefaultCenterPlace,
|
|
8417
8446
|
mapContext
|
|
8418
8447
|
} = props;
|
|
8448
|
+
const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
|
|
8419
8449
|
const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
|
|
8420
8450
|
const {
|
|
8421
8451
|
mapRef,
|
|
@@ -8446,8 +8476,9 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8446
8476
|
centerSource.source = "api";
|
|
8447
8477
|
updatePlace(point);
|
|
8448
8478
|
};
|
|
8449
|
-
const setCenterPlaceByUserSpecified = async (input) => {
|
|
8450
|
-
|
|
8479
|
+
const setCenterPlaceByUserSpecified = async (input, context2) => {
|
|
8480
|
+
var _a2;
|
|
8481
|
+
centerSource.source = (_a2 = context2 == null ? void 0 : context2.source) != null ? _a2 : "api";
|
|
8451
8482
|
const place = toPlaceType(input);
|
|
8452
8483
|
Object.assign(centerPlace, place);
|
|
8453
8484
|
updateRecommendPlaceOnlyInZone(place);
|
|
@@ -8516,7 +8547,9 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8516
8547
|
centerSource.source = "geo";
|
|
8517
8548
|
emit("loadDefaultGeoLocation", value);
|
|
8518
8549
|
if (inputPlace) {
|
|
8519
|
-
await setCenterPlaceByUserSpecified(inputPlace
|
|
8550
|
+
await setCenterPlaceByUserSpecified(inputPlace, {
|
|
8551
|
+
source: "geo"
|
|
8552
|
+
});
|
|
8520
8553
|
} else {
|
|
8521
8554
|
updatePlace(value.position);
|
|
8522
8555
|
}
|
|
@@ -8561,6 +8594,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8561
8594
|
emptyPlaceName: emptyTitle,
|
|
8562
8595
|
queryingPlaceName: queryingTitle,
|
|
8563
8596
|
context: centerSource,
|
|
8597
|
+
getAvailable: pipedGetAvailable,
|
|
8564
8598
|
getRecomendPlace: pipedGetRecomendPlace,
|
|
8565
8599
|
getLimit: (context2) => {
|
|
8566
8600
|
const source = context2 == null ? void 0 : context2.source;
|
|
@@ -8675,7 +8709,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8675
8709
|
}
|
|
8676
8710
|
})]);
|
|
8677
8711
|
};
|
|
8678
|
-
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getDefaultCenterPlace", "loading", "mapContext"]);
|
|
8712
|
+
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getAvailable", "getDefaultCenterPlace", "loading", "mapContext"]);
|
|
8679
8713
|
const emptyPlace = {
|
|
8680
8714
|
lng: 0,
|
|
8681
8715
|
lat: 0,
|
|
@@ -8691,6 +8725,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8691
8725
|
queryingTitle,
|
|
8692
8726
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
8693
8727
|
geoErrorOnceNotificationInterval = 0,
|
|
8728
|
+
getAvailable,
|
|
8694
8729
|
getRecomendPlace,
|
|
8695
8730
|
mapContext,
|
|
8696
8731
|
disableLocator,
|
|
@@ -8698,6 +8733,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8698
8733
|
...emptyPlace
|
|
8699
8734
|
}
|
|
8700
8735
|
} = props;
|
|
8736
|
+
const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
|
|
8701
8737
|
const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
|
|
8702
8738
|
const {
|
|
8703
8739
|
mapRef,
|
|
@@ -8780,6 +8816,10 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8780
8816
|
geoLoading
|
|
8781
8817
|
} = useGeoLocation({
|
|
8782
8818
|
geoDefaultPosition: place2point(defaultPlace),
|
|
8819
|
+
onChange: (v) => {
|
|
8820
|
+
mapContext.geoPositionRef.value = v.position;
|
|
8821
|
+
emit("changeGeoLocation", v);
|
|
8822
|
+
},
|
|
8783
8823
|
onError: (error) => {
|
|
8784
8824
|
emit("geoError", error);
|
|
8785
8825
|
emitGeoErrorOnce(error);
|
|
@@ -8816,6 +8856,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8816
8856
|
emptyPlaceName: emptyTitle,
|
|
8817
8857
|
queryingPlaceName: queryingTitle,
|
|
8818
8858
|
context: centerSource,
|
|
8859
|
+
getAvailable: pipedGetAvailable,
|
|
8819
8860
|
getRecomendPlace: pipedGetRecomendPlace,
|
|
8820
8861
|
getLimit: (context2) => {
|
|
8821
8862
|
const source = context2 == null ? void 0 : context2.source;
|
|
@@ -8927,7 +8968,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8927
8968
|
}
|
|
8928
8969
|
})]);
|
|
8929
8970
|
};
|
|
8930
|
-
}).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getRecomendPlace", "mapContext"]);
|
|
8971
|
+
}).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getAvailable", "getRecomendPlace", "mapContext"]);
|
|
8931
8972
|
const assertPropNoEmptyArray = (list, funcName, propName) => {
|
|
8932
8973
|
if (list.length > 0)
|
|
8933
8974
|
return;
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ if (typeof GeolocationPositionError === "undefined") {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
const name = "@heycar/heycars-map";
|
|
20
|
-
const version = "0.9.23-
|
|
20
|
+
const version = "0.9.23-alpha5";
|
|
21
21
|
const type = "module";
|
|
22
22
|
const bin = {
|
|
23
23
|
checkVersion: "./bin/checkVersion.js"
|
|
@@ -1512,6 +1512,7 @@ const language2vectorMapForeign = (lang) => {
|
|
|
1512
1512
|
switch (lang) {
|
|
1513
1513
|
case "en":
|
|
1514
1514
|
return "style_en";
|
|
1515
|
+
case "zh-TW":
|
|
1515
1516
|
case "zh":
|
|
1516
1517
|
return "style_zh_cn";
|
|
1517
1518
|
}
|
|
@@ -1782,11 +1783,6 @@ const createRunOnce = (fn) => {
|
|
|
1782
1783
|
return result;
|
|
1783
1784
|
};
|
|
1784
1785
|
};
|
|
1785
|
-
const createAsyncNoFailNonNullable = (fn, defaultValue) => {
|
|
1786
|
-
return function noFailNoNullable(...args) {
|
|
1787
|
-
return fn(...args).then((result) => result != null ? result : defaultValue).catch(() => defaultValue);
|
|
1788
|
-
};
|
|
1789
|
-
};
|
|
1790
1786
|
const pipeTimeout = (fn, defaultValue, timeout) => {
|
|
1791
1787
|
return function pipedTimeoutedFunction(...args) {
|
|
1792
1788
|
return new Promise((resolve, reject) => {
|
|
@@ -4197,7 +4193,7 @@ const AStartEndPoint = defineSetup(function AStartEndPoint2(props, {
|
|
|
4197
4193
|
type: type2,
|
|
4198
4194
|
language
|
|
4199
4195
|
} = props;
|
|
4200
|
-
const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
|
|
4196
|
+
const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
|
|
4201
4197
|
const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
|
|
4202
4198
|
if (!description && !title)
|
|
4203
4199
|
return `<img class="AStartEndPoint ${pointIcon({
|
|
@@ -4265,7 +4261,7 @@ const GStartEndPoint = defineSetup(function GStartEndPoint2(props, {
|
|
|
4265
4261
|
type: type2,
|
|
4266
4262
|
language = "zh"
|
|
4267
4263
|
} = props;
|
|
4268
|
-
const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
|
|
4264
|
+
const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
|
|
4269
4265
|
const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
|
|
4270
4266
|
if (!description && !title)
|
|
4271
4267
|
return createDom("img", {
|
|
@@ -4468,10 +4464,22 @@ class QueryWxSignatureStatus {
|
|
|
4468
4464
|
}, this.timeout);
|
|
4469
4465
|
}));
|
|
4470
4466
|
__publicField(this, "timoutStatusPromise", Promise.resolve("TIMEOUT"));
|
|
4467
|
+
__publicField(this, "readyStatusPromise", Promise.resolve("READY"));
|
|
4471
4468
|
this.timeout = timeout;
|
|
4472
4469
|
}
|
|
4473
4470
|
get statusPromise() {
|
|
4474
|
-
|
|
4471
|
+
switch (this.status) {
|
|
4472
|
+
case "PENDING":
|
|
4473
|
+
return this.pendingStatusPromise;
|
|
4474
|
+
case "TIMEOUT":
|
|
4475
|
+
return this.timoutStatusPromise;
|
|
4476
|
+
case "READY":
|
|
4477
|
+
return this.readyStatusPromise;
|
|
4478
|
+
case "FAIL":
|
|
4479
|
+
return Promise.reject(this.error);
|
|
4480
|
+
default:
|
|
4481
|
+
throw new Error("MyError: QueryWxSignatureStatus.statusPromise Never !");
|
|
4482
|
+
}
|
|
4475
4483
|
}
|
|
4476
4484
|
}
|
|
4477
4485
|
function createCustomGeolocationPositionError(message, code) {
|
|
@@ -7268,6 +7276,25 @@ const useMapPlace = (props) => {
|
|
|
7268
7276
|
const { supplier } = useMapSupplier();
|
|
7269
7277
|
return supplier === "gmap" ? useGmapPlace(props) : useAmapPlace(props);
|
|
7270
7278
|
};
|
|
7279
|
+
function mergeGetRecommendPlaceAndGetAvailable(getRecomendPlace, getAvailable, timeout) {
|
|
7280
|
+
return function mergedGetRecommendPlace(place, context2) {
|
|
7281
|
+
const available = true;
|
|
7282
|
+
return new Promise((resolve) => {
|
|
7283
|
+
getAvailable(place).then((value) => {
|
|
7284
|
+
if (!value)
|
|
7285
|
+
resolve({ available: false });
|
|
7286
|
+
});
|
|
7287
|
+
getRecomendPlace(place, context2).then((result) => {
|
|
7288
|
+
debugger;
|
|
7289
|
+
resolve(result != null ? result : { available });
|
|
7290
|
+
}).catch(() => {
|
|
7291
|
+
debugger;
|
|
7292
|
+
resolve({ available });
|
|
7293
|
+
});
|
|
7294
|
+
setTimeout(() => resolve({ available }), timeout);
|
|
7295
|
+
});
|
|
7296
|
+
};
|
|
7297
|
+
}
|
|
7271
7298
|
function findNearestPlace(place, candidates, distanceFn) {
|
|
7272
7299
|
var _a;
|
|
7273
7300
|
let shortestDistance = Infinity;
|
|
@@ -7284,6 +7311,7 @@ function findNearestPlace(place, candidates, distanceFn) {
|
|
|
7284
7311
|
const useMapRecomendPlace = (props) => {
|
|
7285
7312
|
const {
|
|
7286
7313
|
defaultPoint,
|
|
7314
|
+
getAvailable,
|
|
7287
7315
|
getRecomendPlace,
|
|
7288
7316
|
getLimit,
|
|
7289
7317
|
context: context2,
|
|
@@ -7309,9 +7337,9 @@ const useMapRecomendPlace = (props) => {
|
|
|
7309
7337
|
displayName: ""
|
|
7310
7338
|
});
|
|
7311
7339
|
const isQueryingRef = ref(false);
|
|
7312
|
-
const getRecomendPlaceNoFail =
|
|
7313
|
-
|
|
7314
|
-
|
|
7340
|
+
const getRecomendPlaceNoFail = mergeGetRecommendPlaceAndGetAvailable(
|
|
7341
|
+
getRecomendPlace,
|
|
7342
|
+
getAvailable,
|
|
7315
7343
|
GET_RECOMMEND_PLACE_TIMEOUT
|
|
7316
7344
|
);
|
|
7317
7345
|
const findAttachedPlace = async (place) => {
|
|
@@ -8410,10 +8438,12 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8410
8438
|
geoDefaultPosition,
|
|
8411
8439
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
8412
8440
|
geoErrorOnceNotificationInterval = 0,
|
|
8441
|
+
getAvailable,
|
|
8413
8442
|
getRecomendPlace,
|
|
8414
8443
|
getDefaultCenterPlace,
|
|
8415
8444
|
mapContext
|
|
8416
8445
|
} = props;
|
|
8446
|
+
const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
|
|
8417
8447
|
const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
|
|
8418
8448
|
const {
|
|
8419
8449
|
mapRef,
|
|
@@ -8444,8 +8474,9 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8444
8474
|
centerSource.source = "api";
|
|
8445
8475
|
updatePlace(point);
|
|
8446
8476
|
};
|
|
8447
|
-
const setCenterPlaceByUserSpecified = async (input) => {
|
|
8448
|
-
|
|
8477
|
+
const setCenterPlaceByUserSpecified = async (input, context2) => {
|
|
8478
|
+
var _a2;
|
|
8479
|
+
centerSource.source = (_a2 = context2 == null ? void 0 : context2.source) != null ? _a2 : "api";
|
|
8449
8480
|
const place = toPlaceType(input);
|
|
8450
8481
|
Object.assign(centerPlace, place);
|
|
8451
8482
|
updateRecommendPlaceOnlyInZone(place);
|
|
@@ -8514,7 +8545,9 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8514
8545
|
centerSource.source = "geo";
|
|
8515
8546
|
emit("loadDefaultGeoLocation", value);
|
|
8516
8547
|
if (inputPlace) {
|
|
8517
|
-
await setCenterPlaceByUserSpecified(inputPlace
|
|
8548
|
+
await setCenterPlaceByUserSpecified(inputPlace, {
|
|
8549
|
+
source: "geo"
|
|
8550
|
+
});
|
|
8518
8551
|
} else {
|
|
8519
8552
|
updatePlace(value.position);
|
|
8520
8553
|
}
|
|
@@ -8559,6 +8592,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8559
8592
|
emptyPlaceName: emptyTitle,
|
|
8560
8593
|
queryingPlaceName: queryingTitle,
|
|
8561
8594
|
context: centerSource,
|
|
8595
|
+
getAvailable: pipedGetAvailable,
|
|
8562
8596
|
getRecomendPlace: pipedGetRecomendPlace,
|
|
8563
8597
|
getLimit: (context2) => {
|
|
8564
8598
|
const source = context2 == null ? void 0 : context2.source;
|
|
@@ -8673,7 +8707,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8673
8707
|
}
|
|
8674
8708
|
})]);
|
|
8675
8709
|
};
|
|
8676
|
-
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getDefaultCenterPlace", "loading", "mapContext"]);
|
|
8710
|
+
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getAvailable", "getDefaultCenterPlace", "loading", "mapContext"]);
|
|
8677
8711
|
const emptyPlace = {
|
|
8678
8712
|
lng: 0,
|
|
8679
8713
|
lat: 0,
|
|
@@ -8689,6 +8723,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8689
8723
|
queryingTitle,
|
|
8690
8724
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
8691
8725
|
geoErrorOnceNotificationInterval = 0,
|
|
8726
|
+
getAvailable,
|
|
8692
8727
|
getRecomendPlace,
|
|
8693
8728
|
mapContext,
|
|
8694
8729
|
disableLocator,
|
|
@@ -8696,6 +8731,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8696
8731
|
...emptyPlace
|
|
8697
8732
|
}
|
|
8698
8733
|
} = props;
|
|
8734
|
+
const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
|
|
8699
8735
|
const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
|
|
8700
8736
|
const {
|
|
8701
8737
|
mapRef,
|
|
@@ -8778,6 +8814,10 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8778
8814
|
geoLoading
|
|
8779
8815
|
} = useGeoLocation({
|
|
8780
8816
|
geoDefaultPosition: place2point(defaultPlace),
|
|
8817
|
+
onChange: (v) => {
|
|
8818
|
+
mapContext.geoPositionRef.value = v.position;
|
|
8819
|
+
emit("changeGeoLocation", v);
|
|
8820
|
+
},
|
|
8781
8821
|
onError: (error) => {
|
|
8782
8822
|
emit("geoError", error);
|
|
8783
8823
|
emitGeoErrorOnce(error);
|
|
@@ -8814,6 +8854,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8814
8854
|
emptyPlaceName: emptyTitle,
|
|
8815
8855
|
queryingPlaceName: queryingTitle,
|
|
8816
8856
|
context: centerSource,
|
|
8857
|
+
getAvailable: pipedGetAvailable,
|
|
8817
8858
|
getRecomendPlace: pipedGetRecomendPlace,
|
|
8818
8859
|
getLimit: (context2) => {
|
|
8819
8860
|
const source = context2 == null ? void 0 : context2.source;
|
|
@@ -8925,7 +8966,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8925
8966
|
}
|
|
8926
8967
|
})]);
|
|
8927
8968
|
};
|
|
8928
|
-
}).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getRecomendPlace", "mapContext"]);
|
|
8969
|
+
}).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getAvailable", "getRecomendPlace", "mapContext"]);
|
|
8929
8970
|
const assertPropNoEmptyArray = (list, funcName, propName) => {
|
|
8930
8971
|
if (list.length > 0)
|
|
8931
8972
|
return;
|
|
@@ -17,7 +17,7 @@ export declare const ZONE_ZOOM = 13.75;
|
|
|
17
17
|
export interface CenterPlaceSource {
|
|
18
18
|
source: "default" | "geo" | "drag" | "recomend" | "api";
|
|
19
19
|
}
|
|
20
|
-
export interface BusinessRecomendPlaceMapProps extends Omit<HeycarMapProps, "center" | "zoom" | "mapRef">, Pick<UseMapRecomendPlaceProps<CenterPlaceSource>, "getRecomendPlace"> {
|
|
20
|
+
export interface BusinessRecomendPlaceMapProps extends Omit<HeycarMapProps, "center" | "zoom" | "mapRef">, Pick<UseMapRecomendPlaceProps<CenterPlaceSource>, "getRecomendPlace" | "getAvailable"> {
|
|
21
21
|
log?: boolean;
|
|
22
22
|
geoLoadingTitle: string;
|
|
23
23
|
unavailableTitle: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Place } from "../../types/interface";
|
|
2
2
|
import { type BusinessRecomendPlaceMapProps } from "../BusinessRecomendPlaceMap";
|
|
3
|
-
export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "geoErrorOnceNotificationInterval" | "loading" | "fallback" | "log" | "getRecomendPlace" | "unavailableTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "disableLocatorPhoto" | "mapContext" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocatorText" | "onClickLocatorPhoto"> {
|
|
3
|
+
export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "geoErrorOnceNotificationInterval" | "loading" | "fallback" | "log" | "getAvailable" | "getRecomendPlace" | "unavailableTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "disableLocatorPhoto" | "mapContext" | "onChangeGeoLocation" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocatorText" | "onClickLocatorPhoto"> {
|
|
4
4
|
defaultPlace?: Place;
|
|
5
5
|
}
|
|
6
|
-
export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", BusinessReselectPlaceMapProps, {}>;
|
|
6
|
+
export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", BusinessReselectPlaceMapProps, {}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
2
|
-
import type { Point } from "../../types/interface";
|
|
2
|
+
import type { Language, Point } from "../../types/interface";
|
|
3
3
|
export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T> {
|
|
4
|
-
language:
|
|
4
|
+
language: Language;
|
|
5
5
|
type: "start" | "end";
|
|
6
6
|
position: [number, number];
|
|
7
7
|
title?: string;
|
|
@@ -2,6 +2,7 @@ import { load as loadAmap } from "@amap/amap-jsapi-loader";
|
|
|
2
2
|
import { LoaderOptions } from "@googlemaps/js-api-loader";
|
|
3
3
|
import { Ref } from "vue-demi";
|
|
4
4
|
import type { VueNode } from "../types/helper";
|
|
5
|
+
import type { Language } from "../types/interface";
|
|
5
6
|
export declare const DEFAULT_AMAP_PLUGINS: AmapLoaderProps["plugins"];
|
|
6
7
|
export declare const DEFAULT_GMAP_LIBRARIES: LoaderOptions["libraries"];
|
|
7
8
|
export declare enum Status {
|
|
@@ -60,7 +61,7 @@ export interface UseMapLoaderProps {
|
|
|
60
61
|
amapSecret?: string;
|
|
61
62
|
amapServiceHost?: string;
|
|
62
63
|
supplier: MapSupplier;
|
|
63
|
-
language:
|
|
64
|
+
language: Language;
|
|
64
65
|
onChange?: (status: Status) => any;
|
|
65
66
|
}
|
|
66
67
|
export declare const useMapLoader: (props: UseMapLoaderProps) => UseMapLoaderOutput;
|
|
@@ -12,6 +12,7 @@ export interface UseMapRecomendPlaceProps<C = Record<string, any>> {
|
|
|
12
12
|
emptyPlaceName: string;
|
|
13
13
|
queryingPlaceName: string;
|
|
14
14
|
getLimit: (context?: C) => number;
|
|
15
|
+
getAvailable: (place: Place) => Promise<boolean>;
|
|
15
16
|
getRecomendPlace: (place: Place, context?: C) => Promise<RecommendZonePlaces | undefined>;
|
|
16
17
|
onChangePlace?: UseMapPlaceProps["onChange"];
|
|
17
18
|
onQueryingPlace?: UseMapPlaceProps["onChange"];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
2
|
import type { ShallowRef } from "vue-demi";
|
|
3
3
|
import type { SafeAmap } from "../components/Amap/SafeAmap";
|
|
4
|
+
export type Language = "en" | "zh" | "zh-TW";
|
|
4
5
|
export type Point = [number, number];
|
|
5
6
|
export type AmapMap = SafeAmap;
|
|
6
7
|
export type MapShallowRef<M = AmapMap | google.maps.Map> = ShallowRef<M | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
import type { Place, Point, RecommendZonePlaces, TrackPoint, Zone } from "../types/interface";
|
|
2
|
+
import type { Language, Place, Point, RecommendZonePlaces, TrackPoint, Zone } from "../types/interface";
|
|
3
3
|
import type { AlipayMyGetLocationSuccessResponse } from "../types/my";
|
|
4
4
|
import type { WxGetLocationSuccessResponse } from "../types/wx";
|
|
5
5
|
import { BRWOSER_PLATFORM } from "./platform";
|
|
@@ -16,7 +16,7 @@ export declare const decodeAsterisk: (encodedValue: string) => AsteriskItem[];
|
|
|
16
16
|
export declare const property2emitEventName: (propertyName: string) => string;
|
|
17
17
|
export declare const property2mapEventName: (propertyName: string) => string;
|
|
18
18
|
export type VectorMapForeign = "style_en" | "style_local" | "style_zh_cn";
|
|
19
|
-
export declare const language2vectorMapForeign: (lang:
|
|
19
|
+
export declare const language2vectorMapForeign: (lang: Language) => VectorMapForeign;
|
|
20
20
|
export declare const place2point: (place: Place) => Point;
|
|
21
21
|
export declare const combineHandler: <P extends any[], R>(fn1: ((...args: P) => any) | undefined, fn2: (...args: P) => R) => (...args: P) => R;
|
|
22
22
|
export declare const pipeAsync: <P extends any[]>(fn?: ((...args: P) => any) | undefined) => (...args: P) => void;
|
package/package.json
CHANGED