hy-dispatch-ui-v3 0.2.56 → 0.2.58

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.
@@ -1,4 +1,4 @@
1
- import Map from '../../../utils/map/index.mjs';
1
+ import { InitMap } from '../../../utils/map/index.mjs';
2
2
  import { nextTick } from 'vue';
3
3
 
4
4
  const useAppMapWrapper = (hy) => {
@@ -10,7 +10,7 @@ const useAppMapWrapper = (hy) => {
10
10
  const hyMap = null;
11
11
  const map = null;
12
12
  function newMap(mapType) {
13
- hy.hyMap = new Map({
13
+ hy.hyMap = new InitMap({
14
14
  ...mapConfig,
15
15
  mapType,
16
16
  BM: window.BM
@@ -2,11 +2,11 @@ import { ref, onMounted, openBlock, createElementBlock, createElementVNode } fro
2
2
  import { useAppMapWrapper } from './js/index.mjs';
3
3
  import { useMixins } from '../../hooks/useMixins.mjs';
4
4
 
5
- import "@hy-dispatch-ui-v3/static/map/bigemap.css";
5
+ import "../../static/map/bigemap.css";
6
6
 
7
- import "@hy-dispatch-ui-v3/static/map/MarkerCluster.css";
7
+ import "../../static/map/MarkerCluster.css";
8
8
 
9
- import "@hy-dispatch-ui-v3/static/map/bmDraw.css";
9
+ import "../../static/map/bmDraw.css";
10
10
 
11
11
  const _sfc_main = {
12
12
  __name: "map",
package/es/index.mjs CHANGED
@@ -25,6 +25,7 @@ export { HyTableActionButton } from './components/hyTableActionButton/index.mjs'
25
25
  export { HyTree } from './components/hyTree/index.mjs';
26
26
  export { HyUserAvatar } from './components/hyUserAvatar/index.mjs';
27
27
  export { HyVideoPlayer } from './components/hyVideoPlayer/index.mjs';
28
+ export { InitMap, setMapServer, setPoiServer } from './utils/map/index.mjs';
28
29
  export { PERMISSION } from './utils/permission.mjs';
29
30
  export { base64Decrypt, encryptToBase64, generateRandomCode } from './utils/crypto.mjs';
30
31
  export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl, sizeToTextHandler } from './utils/file.mjs';
@@ -0,0 +1,12 @@
1
+ export default {
2
+ id: 'hy-icon-ops-list-grayout',
3
+ defs: `<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="hy-icon-ops-list-grayout-linearGradient-1">
4
+ <stop stop-color="#9DA7B2" offset="0%"></stop>
5
+ <stop stop-color="#586471" offset="100%"></stop>
6
+ </linearGradient>`,
7
+ symbol: `<symbol id="hy-icon-ops-list-grayout" viewBox="0 0 12 12">
8
+ <g id="hy-icon-ops-list-grayout-状态/置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
9
+ <path d="M6.41070049,0.13446417 C7.41256421,0.928299855 9.24582936,1.54952243 10.2322378,1.88459494 L10.5663439,1.9981319 C10.8254466,2.09043838 11,2.33966586 11,2.61935448 L10.9918178,6.34715147 L10.9913632,6.48238046 L10.9909087,6.65499356 L10.9904541,6.75006923 L10.9904541,6.79206868 L10.9899995,6.8936058 L10.9899995,6.91991315 L10.989545,6.97437397 L10.989545,6.9905276 L10.989545,6.78191497 C10.8404473,8.28466438 9.77267149,9.69649192 8.90081367,10.4252515 C8.20896404,11.0040131 7.2825583,11.529237 6.12159644,12 C4.8315378,11.5273908 3.83694713,11.0026285 3.13782445,10.4252515 C2.2705123,9.70710716 1.20682758,8.32389463 1.03318333,6.84837563 L1.02636483,6.78191497 L1.02591027,7.00021978 L1.02136461,6.88345209 C1.00772762,6.50822627 1.0013637,5.962695 1,5.37793348 L1,4.78486438 C1.00181826,3.92318344 1.01136415,3.07119467 1.02000091,2.6239698 C1.02443642,2.34378038 1.2038348,2.0974544 1.46638484,2.01105481 C3.40147279,1.38567844 4.84562935,0.735840854 5.64112005,0.129848846 C5.86903761,-0.0449821758 6.18437717,-0.0430921394 6.41070049,0.13446417 Z M5.11333048,1.8845739 L5.11333048,5.11767735 C3.93204133,5.52696398 3.24184904,6.7311781 3.49888017,7.93449218 C3.7559113,9.13780626 4.88078408,9.96858759 6.13010521,9.87779871 C7.37942633,9.78700983 8.36735423,8.80269008 8.44099817,7.57534565 L8.44537175,7.43124584 L8.44099817,7.28775922 C8.38523872,6.35753042 7.79758448,5.53850531 6.92399157,5.17347771 L6.77903871,5.11829055 L6.77903871,4.31612868 L8.44537175,4.31612868 L8.44537175,2.89945564 L6.77903871,2.89945564 L6.77903871,1.8845739 L5.11333048,1.8845739 Z M6,8.39591623 C6.55228475,8.39591623 7,7.94820098 7,7.39591623 C7,6.84363148 6.55228475,6.39591623 6,6.39591623 C5.44771525,6.39591623 5,6.84363148 5,7.39591623 C5,7.94820098 5.44771525,8.39591623 6,8.39591623 Z" id="hy-icon-ops-list-grayout-状态/激活" fill="url(#hy-icon-ops-list-grayout-linearGradient-1)" fill-rule="nonzero"></path>
10
+ </g>
11
+ </symbol>`,
12
+ };
@@ -2676,4 +2676,3 @@
2676
2676
  exports.MarkerCluster = MarkerCluster;
2677
2677
 
2678
2678
  })));
2679
- //# sourceMappingURL=leaflet.markercluster-src.js.map
@@ -7,3 +7,4 @@ export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl
7
7
  export { clearSpace, columnRuleHandler, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './form.mjs';
8
8
  export { enterNumbersRrLetters, enterTheMumber, filterSpaces, formatNumber, formatTimeFn, getPublicFileSize, inputForbidden, keepTwoDecimalPlaces, onlyNumber } from './input.mjs';
9
9
  export { PERMISSION } from './permission.mjs';
10
+ export { InitMap, setMapServer, setPoiServer } from './map/index.mjs';
@@ -27,7 +27,20 @@ const staticAssets = {
27
27
  ).href,
28
28
  "moveMarker.js": new URL("../../static/map/moveMarker.js", import.meta.url).href
29
29
  };
30
- const staticUrl = (file) => {
30
+ const normalizeStaticBaseUrl = (baseUrl) => {
31
+ return baseUrl.replace(/\/+$/, "");
32
+ };
33
+ const getPackageStaticBaseUrl = () => {
34
+ if (/\/node_modules\//.test(import.meta.url)) {
35
+ return "/node_modules/hy-dispatch-ui-v3/es/static/map";
36
+ }
37
+ return null;
38
+ };
39
+ const staticUrl = (file, baseUrl) => {
40
+ const configuredBaseUrl = baseUrl || globalThis.__HY_DISPATCH_UI_STATIC_URL__ || getPackageStaticBaseUrl();
41
+ if (configuredBaseUrl) {
42
+ return `${normalizeStaticBaseUrl(configuredBaseUrl)}/${file}`;
43
+ }
31
44
  const url = staticAssets[file];
32
45
  if (!url) {
33
46
  throw new Error(`Unknown map asset: ${file}`);
@@ -49,12 +62,13 @@ function setMapServer(mapType, mapConfig = {}) {
49
62
  }
50
63
  const promise = (async () => {
51
64
  if (mapType === "bigMap") {
52
- await loadScript(staticUrl("bigemap.js"));
65
+ const staticBaseUrl = mapConfig.staticBaseUrl;
66
+ await loadScript(staticUrl("bigemap.js", staticBaseUrl));
53
67
  await Promise.all([
54
- loadScript(staticUrl("markercluster.js")),
55
- loadScript(staticUrl("bmDraw.js")),
56
- loadScript(staticUrl("bm.geometryutil.js")),
57
- loadScript(staticUrl("moveMarker.js"))
68
+ loadScript(staticUrl("markercluster.js", staticBaseUrl)),
69
+ loadScript(staticUrl("bmDraw.js", staticBaseUrl)),
70
+ loadScript(staticUrl("bm.geometryutil.js", staticBaseUrl)),
71
+ loadScript(staticUrl("moveMarker.js", staticBaseUrl))
58
72
  ]);
59
73
  bmInit();
60
74
  return;
@@ -141,7 +155,7 @@ function bmInit() {
141
155
  });
142
156
  })();
143
157
  }
144
- class Map extends EventEmitter {
158
+ class InitMap extends EventEmitter {
145
159
  constructor(request) {
146
160
  super();
147
161
  this.map = null;
@@ -288,4 +302,4 @@ class Map extends EventEmitter {
288
302
  }
289
303
  }
290
304
 
291
- export { Map as default, setMapServer, setPoiServer };
305
+ export { InitMap, setMapServer, setPoiServer };
package/es/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const version = "0.2.55";
1
+ const version = "0.2.57";
2
2
 
3
3
  export { version };
@@ -12,7 +12,7 @@ const useAppMapWrapper = (hy) => {
12
12
  const hyMap = null;
13
13
  const map = null;
14
14
  function newMap(mapType) {
15
- hy.hyMap = new index.default({
15
+ hy.hyMap = new index.InitMap({
16
16
  ...mapConfig,
17
17
  mapType,
18
18
  BM: window.BM
@@ -6,11 +6,11 @@ var vue = require('vue');
6
6
  var index = require('./js/index.js');
7
7
  var useMixins = require('../../hooks/useMixins.js');
8
8
 
9
- import "@hy-dispatch-ui-v3/static/map/bigemap.css";
9
+ import "../../static/map/bigemap.css";
10
10
 
11
- import "@hy-dispatch-ui-v3/static/map/MarkerCluster.css";
11
+ import "../../static/map/MarkerCluster.css";
12
12
 
13
- import "@hy-dispatch-ui-v3/static/map/bmDraw.css";
13
+ import "../../static/map/bmDraw.css";
14
14
 
15
15
  const _sfc_main = {
16
16
  __name: "map",
package/lib/index.js CHANGED
@@ -29,6 +29,7 @@ var index$m = require('./components/hyTableActionButton/index.js');
29
29
  var index$n = require('./components/hyTree/index.js');
30
30
  var index$o = require('./components/hyUserAvatar/index.js');
31
31
  var index$p = require('./components/hyVideoPlayer/index.js');
32
+ var index$q = require('./utils/map/index.js');
32
33
  var permission = require('./utils/permission.js');
33
34
  var crypto = require('./utils/crypto.js');
34
35
  var file = require('./utils/file.js');
@@ -92,6 +93,9 @@ exports.HyTableActionButton = index$m.HyTableActionButton;
92
93
  exports.HyTree = index$n.HyTree;
93
94
  exports.HyUserAvatar = index$o.HyUserAvatar;
94
95
  exports.HyVideoPlayer = index$p.HyVideoPlayer;
96
+ exports.InitMap = index$q.InitMap;
97
+ exports.setMapServer = index$q.setMapServer;
98
+ exports.setPoiServer = index$q.setPoiServer;
95
99
  exports.PERMISSION = permission.PERMISSION;
96
100
  exports.base64Decrypt = crypto.base64Decrypt;
97
101
  exports.encryptToBase64 = crypto.encryptToBase64;
@@ -0,0 +1,12 @@
1
+ export default {
2
+ id: 'hy-icon-ops-list-grayout',
3
+ defs: `<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="hy-icon-ops-list-grayout-linearGradient-1">
4
+ <stop stop-color="#9DA7B2" offset="0%"></stop>
5
+ <stop stop-color="#586471" offset="100%"></stop>
6
+ </linearGradient>`,
7
+ symbol: `<symbol id="hy-icon-ops-list-grayout" viewBox="0 0 12 12">
8
+ <g id="hy-icon-ops-list-grayout-状态/置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
9
+ <path d="M6.41070049,0.13446417 C7.41256421,0.928299855 9.24582936,1.54952243 10.2322378,1.88459494 L10.5663439,1.9981319 C10.8254466,2.09043838 11,2.33966586 11,2.61935448 L10.9918178,6.34715147 L10.9913632,6.48238046 L10.9909087,6.65499356 L10.9904541,6.75006923 L10.9904541,6.79206868 L10.9899995,6.8936058 L10.9899995,6.91991315 L10.989545,6.97437397 L10.989545,6.9905276 L10.989545,6.78191497 C10.8404473,8.28466438 9.77267149,9.69649192 8.90081367,10.4252515 C8.20896404,11.0040131 7.2825583,11.529237 6.12159644,12 C4.8315378,11.5273908 3.83694713,11.0026285 3.13782445,10.4252515 C2.2705123,9.70710716 1.20682758,8.32389463 1.03318333,6.84837563 L1.02636483,6.78191497 L1.02591027,7.00021978 L1.02136461,6.88345209 C1.00772762,6.50822627 1.0013637,5.962695 1,5.37793348 L1,4.78486438 C1.00181826,3.92318344 1.01136415,3.07119467 1.02000091,2.6239698 C1.02443642,2.34378038 1.2038348,2.0974544 1.46638484,2.01105481 C3.40147279,1.38567844 4.84562935,0.735840854 5.64112005,0.129848846 C5.86903761,-0.0449821758 6.18437717,-0.0430921394 6.41070049,0.13446417 Z M5.11333048,1.8845739 L5.11333048,5.11767735 C3.93204133,5.52696398 3.24184904,6.7311781 3.49888017,7.93449218 C3.7559113,9.13780626 4.88078408,9.96858759 6.13010521,9.87779871 C7.37942633,9.78700983 8.36735423,8.80269008 8.44099817,7.57534565 L8.44537175,7.43124584 L8.44099817,7.28775922 C8.38523872,6.35753042 7.79758448,5.53850531 6.92399157,5.17347771 L6.77903871,5.11829055 L6.77903871,4.31612868 L8.44537175,4.31612868 L8.44537175,2.89945564 L6.77903871,2.89945564 L6.77903871,1.8845739 L5.11333048,1.8845739 Z M6,8.39591623 C6.55228475,8.39591623 7,7.94820098 7,7.39591623 C7,6.84363148 6.55228475,6.39591623 6,6.39591623 C5.44771525,6.39591623 5,6.84363148 5,7.39591623 C5,7.94820098 5.44771525,8.39591623 6,8.39591623 Z" id="hy-icon-ops-list-grayout-状态/激活" fill="url(#hy-icon-ops-list-grayout-linearGradient-1)" fill-rule="nonzero"></path>
10
+ </g>
11
+ </symbol>`,
12
+ };
@@ -2676,4 +2676,3 @@
2676
2676
  exports.MarkerCluster = MarkerCluster;
2677
2677
 
2678
2678
  })));
2679
- //# sourceMappingURL=leaflet.markercluster-src.js.map
@@ -9,6 +9,7 @@ var file = require('./file.js');
9
9
  var form = require('./form.js');
10
10
  var input = require('./input.js');
11
11
  var permission = require('./permission.js');
12
+ var index = require('./map/index.js');
12
13
 
13
14
 
14
15
 
@@ -64,3 +65,6 @@ exports.inputForbidden = input.inputForbidden;
64
65
  exports.keepTwoDecimalPlaces = input.keepTwoDecimalPlaces;
65
66
  exports.onlyNumber = input.onlyNumber;
66
67
  exports.PERMISSION = permission.PERMISSION;
68
+ exports.InitMap = index.InitMap;
69
+ exports.setMapServer = index.setMapServer;
70
+ exports.setPoiServer = index.setPoiServer;
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var gaode = require('./hook/gaode.js');
6
4
  var leafletjs = require('./hook/leafletjs.js');
7
5
  var bigMap = require('./hook/bigMap.js');
@@ -32,7 +30,20 @@ const staticAssets = {
32
30
  ).href,
33
31
  "moveMarker.js": new URL("../../static/map/moveMarker.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))).href
34
32
  };
35
- const staticUrl = (file) => {
33
+ const normalizeStaticBaseUrl = (baseUrl) => {
34
+ return baseUrl.replace(/\/+$/, "");
35
+ };
36
+ const getPackageStaticBaseUrl = () => {
37
+ if (/\/node_modules\//.test((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href)))) {
38
+ return "/node_modules/hy-dispatch-ui-v3/es/static/map";
39
+ }
40
+ return null;
41
+ };
42
+ const staticUrl = (file, baseUrl) => {
43
+ const configuredBaseUrl = baseUrl || globalThis.__HY_DISPATCH_UI_STATIC_URL__ || getPackageStaticBaseUrl();
44
+ if (configuredBaseUrl) {
45
+ return `${normalizeStaticBaseUrl(configuredBaseUrl)}/${file}`;
46
+ }
36
47
  const url = staticAssets[file];
37
48
  if (!url) {
38
49
  throw new Error(`Unknown map asset: ${file}`);
@@ -54,12 +65,13 @@ function setMapServer(mapType, mapConfig = {}) {
54
65
  }
55
66
  const promise = (async () => {
56
67
  if (mapType === "bigMap") {
57
- await loadScript(staticUrl("bigemap.js"));
68
+ const staticBaseUrl = mapConfig.staticBaseUrl;
69
+ await loadScript(staticUrl("bigemap.js", staticBaseUrl));
58
70
  await Promise.all([
59
- loadScript(staticUrl("markercluster.js")),
60
- loadScript(staticUrl("bmDraw.js")),
61
- loadScript(staticUrl("bm.geometryutil.js")),
62
- loadScript(staticUrl("moveMarker.js"))
71
+ loadScript(staticUrl("markercluster.js", staticBaseUrl)),
72
+ loadScript(staticUrl("bmDraw.js", staticBaseUrl)),
73
+ loadScript(staticUrl("bm.geometryutil.js", staticBaseUrl)),
74
+ loadScript(staticUrl("moveMarker.js", staticBaseUrl))
63
75
  ]);
64
76
  bmInit();
65
77
  return;
@@ -146,7 +158,7 @@ function bmInit() {
146
158
  });
147
159
  })();
148
160
  }
149
- class Map extends events.EventEmitter {
161
+ class InitMap extends events.EventEmitter {
150
162
  constructor(request) {
151
163
  super();
152
164
  this.map = null;
@@ -293,6 +305,6 @@ class Map extends events.EventEmitter {
293
305
  }
294
306
  }
295
307
 
296
- exports.default = Map;
308
+ exports.InitMap = InitMap;
297
309
  exports.setMapServer = setMapServer;
298
310
  exports.setPoiServer = setPoiServer;
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.2.55";
3
+ const version = "0.2.57";
4
4
 
5
5
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-dispatch-ui-v3",
3
- "version": "0.2.56",
3
+ "version": "0.2.58",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "scripts": {
@@ -141,6 +141,10 @@
141
141
  "import": "./es/style/theme.scss",
142
142
  "require": "./lib/style/theme.scss"
143
143
  },
144
+ "./utils/map": {
145
+ "import": "./es/utils/map/index.mjs",
146
+ "require": "./lib/utils/map/index.js"
147
+ },
144
148
  "./static": {
145
149
  "import": "./es/static/index.js",
146
150
  "require": "./lib/static/index.js"