jky-component-lib 0.0.143 → 0.0.145

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.
@@ -107,15 +107,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
107
107
  }, point.data));
108
108
  }
109
109
  function updatePoints(newPoints) {
110
- if (!clusterInstance)
110
+ if (!mapInstance)
111
111
  return;
112
- clusterInstance.setMap(null);
113
- const points = newPoints.map((point) => __spreadValues({
114
- lnglat: point.lnglat,
115
- title: point.title,
116
- content: point.content
117
- }, point.data));
118
- clusterInstance.addMarkers(points);
112
+ modelValue.value = newPoints;
113
+ initCluster(mapInstance);
119
114
  }
120
115
  function clearClusters() {
121
116
  if (clusterInstance) {
@@ -1,5 +1,4 @@
1
1
  import _sfc_main from "./AClusterMarker.vue.js";
2
- /* empty css */
3
2
  export {
4
3
  _sfc_main as default
5
4
  };
@@ -1,5 +1,4 @@
1
1
  import _sfc_main from "./AClusterMarker.vue.js";
2
- /* empty css */
3
2
  import { installWithSFC } from "../../utils/with-install.js";
4
3
  const JkyAClusterMarker = installWithSFC(_sfc_main);
5
4
  export {
@@ -1,14 +1,3 @@
1
- /* AMap 高德地图组件样式 */
2
- .jky-amap-container {
3
- /* 地图容器样式 */
4
- position: relative;
5
- overflow: hidden;
6
1
 
7
- /* 隐藏高德地图的 logo 和版权信息(注意:商业使用请遵守高德地图条款) */
8
- .amap-logo {
9
- display: none !important;
10
- }
11
- .amap-copyright {
12
- display: none !important;
13
- }
14
- }
2
+ /* 轨迹回放组件不需要额外样式 */
3
+ /* 所有样式通过 TailwindCSS 工具类或外部组件控制 */
@@ -1,3 +1,14 @@
1
+ /* AMap 高德地图组件样式 */
2
+ .jky-amap-container {
3
+ /* 地图容器样式 */
4
+ position: relative;
5
+ overflow: hidden;
1
6
 
2
- /* 轨迹回放组件不需要额外样式 */
3
- /* 所有样式通过 TailwindCSS 工具类或外部组件控制 */
7
+ /* 隐藏高德地图的 logo 和版权信息(注意:商业使用请遵守高德地图条款) */
8
+ .amap-logo {
9
+ display: none !important;
10
+ }
11
+ .amap-copyright {
12
+ display: none !important;
13
+ }
14
+ }
@@ -1,4 +1,4 @@
1
- const version = "0.0.143";
1
+ const version = "0.0.145";
2
2
  export {
3
3
  version
4
4
  };
@@ -1,2 +1,6 @@
1
1
  import { ComponentResolver } from 'unplugin-vue-components';
2
- export declare function JkyComponentLibResolver(): ComponentResolver;
2
+ export interface JkyComponentLibResolverOptions {
3
+ /** 不自动加载样式的组件白名单(组件名,不带 Jky 前缀) */
4
+ excludeStyleList?: string[];
5
+ }
6
+ export declare function JkyComponentLibResolver(options?: JkyComponentLibResolverOptions): ComponentResolver;
@@ -1,13 +1,37 @@
1
- function JkyComponentLibResolver() {
1
+ const defaultExcludeStyleList = [
2
+ // AMap 相关子组件,共用 amap 目录的样式
3
+ "AMapPicker",
4
+ "AClusterMarker",
5
+ "AMarker",
6
+ "ATrackPlayback",
7
+ // Form 相关子组件,共用 form 目录的样式
8
+ "FormItem",
9
+ "AMapPickerItem",
10
+ // 常见拼写变体(防止误写)
11
+ "AMarkerCluster"
12
+ // AClusterMarker 的常见误写
13
+ ];
14
+ function JkyComponentLibResolver(options = {}) {
15
+ const { excludeStyleList = [] } = options;
16
+ const excludeStyleSet = /* @__PURE__ */ new Set([...defaultExcludeStyleList, ...excludeStyleList]);
2
17
  return {
3
18
  type: "component",
4
19
  resolve: (name) => {
5
20
  if (name.match(/^Jky[A-Z]/)) {
21
+ const componentName = name.replace("Jky", "");
22
+ const kebabName = componentName.replace(/([A-Z])/g, "-$1").replace(/^-/, "").toLowerCase();
23
+ if (excludeStyleSet.has(componentName)) {
24
+ return {
25
+ name,
26
+ from: "jky-component-lib"
27
+ // 白名单中的组件不自动加载样式
28
+ };
29
+ }
6
30
  return {
7
31
  name,
8
32
  from: "jky-component-lib",
9
33
  sideEffects: [
10
- `jky-component-lib/dist/es/${name.replace("Jky", "").replace(/([A-Z])/g, "-$1").replace(/^-/, "").toLowerCase()}/style.css`
34
+ `jky-component-lib/dist/es/${kebabName}/style.css`
11
35
  ]
12
36
  };
13
37
  }
@@ -109,15 +109,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
109
109
  }, point.data));
110
110
  }
111
111
  function updatePoints(newPoints) {
112
- if (!clusterInstance)
112
+ if (!mapInstance)
113
113
  return;
114
- clusterInstance.setMap(null);
115
- const points = newPoints.map((point) => __spreadValues({
116
- lnglat: point.lnglat,
117
- title: point.title,
118
- content: point.content
119
- }, point.data));
120
- clusterInstance.addMarkers(points);
114
+ modelValue.value = newPoints;
115
+ initCluster(mapInstance);
121
116
  }
122
117
  function clearClusters() {
123
118
  if (clusterInstance) {
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const AClusterMarker_vue_vue_type_script_setup_true_lang = require("./AClusterMarker.vue.js");
4
- ;/* empty css */
5
4
  exports.default = AClusterMarker_vue_vue_type_script_setup_true_lang.default;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const AClusterMarker_vue_vue_type_script_setup_true_lang = require("./AClusterMarker.vue.js");
4
- ;/* empty css */
5
4
  const withInstall = require("../../utils/with-install.js");
6
5
  const JkyAClusterMarker = withInstall.installWithSFC(AClusterMarker_vue_vue_type_script_setup_true_lang.default);
7
6
  exports.JkyAClusterMarker = JkyAClusterMarker;
@@ -1,14 +1,3 @@
1
- /* AMap 高德地图组件样式 */
2
- .jky-amap-container {
3
- /* 地图容器样式 */
4
- position: relative;
5
- overflow: hidden;
6
1
 
7
- /* 隐藏高德地图的 logo 和版权信息(注意:商业使用请遵守高德地图条款) */
8
- .amap-logo {
9
- display: none !important;
10
- }
11
- .amap-copyright {
12
- display: none !important;
13
- }
14
- }
2
+ /* 轨迹回放组件不需要额外样式 */
3
+ /* 所有样式通过 TailwindCSS 工具类或外部组件控制 */
@@ -1,3 +1,14 @@
1
+ /* AMap 高德地图组件样式 */
2
+ .jky-amap-container {
3
+ /* 地图容器样式 */
4
+ position: relative;
5
+ overflow: hidden;
1
6
 
2
- /* 轨迹回放组件不需要额外样式 */
3
- /* 所有样式通过 TailwindCSS 工具类或外部组件控制 */
7
+ /* 隐藏高德地图的 logo 和版权信息(注意:商业使用请遵守高德地图条款) */
8
+ .amap-logo {
9
+ display: none !important;
10
+ }
11
+ .amap-copyright {
12
+ display: none !important;
13
+ }
14
+ }
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "0.0.143";
3
+ const version = "0.0.145";
4
4
  exports.version = version;
@@ -1,2 +1,6 @@
1
1
  import { ComponentResolver } from 'unplugin-vue-components';
2
- export declare function JkyComponentLibResolver(): ComponentResolver;
2
+ export interface JkyComponentLibResolverOptions {
3
+ /** 不自动加载样式的组件白名单(组件名,不带 Jky 前缀) */
4
+ excludeStyleList?: string[];
5
+ }
6
+ export declare function JkyComponentLibResolver(options?: JkyComponentLibResolverOptions): ComponentResolver;
@@ -1,15 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- function JkyComponentLibResolver() {
3
+ const defaultExcludeStyleList = [
4
+ // AMap 相关子组件,共用 amap 目录的样式
5
+ "AMapPicker",
6
+ "AClusterMarker",
7
+ "AMarker",
8
+ "ATrackPlayback",
9
+ // Form 相关子组件,共用 form 目录的样式
10
+ "FormItem",
11
+ "AMapPickerItem",
12
+ // 常见拼写变体(防止误写)
13
+ "AMarkerCluster"
14
+ // AClusterMarker 的常见误写
15
+ ];
16
+ function JkyComponentLibResolver(options = {}) {
17
+ const { excludeStyleList = [] } = options;
18
+ const excludeStyleSet = /* @__PURE__ */ new Set([...defaultExcludeStyleList, ...excludeStyleList]);
4
19
  return {
5
20
  type: "component",
6
21
  resolve: (name) => {
7
22
  if (name.match(/^Jky[A-Z]/)) {
23
+ const componentName = name.replace("Jky", "");
24
+ const kebabName = componentName.replace(/([A-Z])/g, "-$1").replace(/^-/, "").toLowerCase();
25
+ if (excludeStyleSet.has(componentName)) {
26
+ return {
27
+ name,
28
+ from: "jky-component-lib"
29
+ // 白名单中的组件不自动加载样式
30
+ };
31
+ }
8
32
  return {
9
33
  name,
10
34
  from: "jky-component-lib",
11
35
  sideEffects: [
12
- `jky-component-lib/dist/es/${name.replace("Jky", "").replace(/([A-Z])/g, "-$1").replace(/^-/, "").toLowerCase()}/style.css`
36
+ `jky-component-lib/dist/es/${kebabName}/style.css`
13
37
  ]
14
38
  };
15
39
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jky-component-lib",
3
3
  "type": "module",
4
- "version": "0.0.143",
4
+ "version": "0.0.145",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -1,3 +0,0 @@
1
- .jky-a-cluster-master {
2
- /** 簇类标记点主容器 */
3
- }
@@ -1,3 +0,0 @@
1
- .jky-a-cluster-master {
2
- /** 簇类标记点主容器 */
3
- }