pukaad-ui-lib 1.223.0 → 1.224.0

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.223.0",
4
+ "version": "1.224.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -23,6 +23,8 @@ let polygonLayer = null;
23
23
  let marker = null;
24
24
  let L = null;
25
25
  let drawDebounceTimer = null;
26
+ let subdistrictsCache = null;
27
+ let districtsCache = null;
26
28
  const { getProvinceById } = useThaiAddress();
27
29
  onMounted(async () => {
28
30
  const leafletModule = await import("leaflet");
@@ -42,14 +44,28 @@ onMounted(async () => {
42
44
  }
43
45
  });
44
46
  const resizeObserver = new ResizeObserver(() => {
45
- if (map) {
46
- map.invalidateSize();
47
- }
47
+ if (map) map.invalidateSize();
48
48
  });
49
49
  resizeObserver.observe(mapContainer.value);
50
- setTimeout(() => {
51
- if (map) map.invalidateSize();
52
- }, 550);
50
+ const intersectionObserver = new IntersectionObserver(
51
+ (entries) => {
52
+ entries.forEach((entry) => {
53
+ if (entry.isIntersecting && map) {
54
+ map.invalidateSize();
55
+ if (polygonLayer) {
56
+ map.flyToBounds(polygonLayer.getBounds(), { padding: [20, 20], duration: 0.3 });
57
+ }
58
+ }
59
+ });
60
+ },
61
+ { threshold: 0.1 }
62
+ );
63
+ intersectionObserver.observe(mapContainer.value);
64
+ [100, 300, 600, 1200].forEach((delay) => {
65
+ setTimeout(() => {
66
+ if (map) map.invalidateSize();
67
+ }, delay);
68
+ });
53
69
  drawPolygon();
54
70
  }
55
71
  });
@@ -83,15 +99,19 @@ const drawPolygon = async () => {
83
99
  }
84
100
  let feature = null;
85
101
  if (props.tambonId) {
86
- const module = await import("@/runtime/geo/subdistricts.json");
87
- const subdistrictsGeoJson = module.default || module;
88
- feature = subdistrictsGeoJson.features.find(
102
+ if (!subdistrictsCache) {
103
+ const module = await import("@/runtime/geo/subdistricts.json");
104
+ subdistrictsCache = module.default || module;
105
+ }
106
+ feature = subdistrictsCache.features.find(
89
107
  (f) => f.properties.tam_code === props.tambonId?.toString()
90
108
  );
91
109
  } else if (props.amphurId) {
92
- const module = await import("@/runtime/geo/districts.json");
93
- const districtsGeoJson = module.default || module;
94
- feature = districtsGeoJson.features.find(
110
+ if (!districtsCache) {
111
+ const module = await import("@/runtime/geo/districts.json");
112
+ districtsCache = module.default || module;
113
+ }
114
+ feature = districtsCache.features.find(
95
115
  (f) => f.properties.amp_code === props.amphurId?.toString()
96
116
  );
97
117
  } else if (props.provinceId) {
@@ -35,8 +35,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
35
35
  fullHeight: boolean;
36
36
  name: string;
37
37
  limit: number;
38
- accept: string;
39
38
  disabledErrorMessage: boolean;
39
+ accept: string;
40
40
  labelIcon: string;
41
41
  disabledDrop: boolean;
42
42
  column: boolean;
@@ -35,8 +35,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
35
35
  fullHeight: boolean;
36
36
  name: string;
37
37
  limit: number;
38
- accept: string;
39
38
  disabledErrorMessage: boolean;
39
+ accept: string;
40
40
  labelIcon: string;
41
41
  disabledDrop: boolean;
42
42
  column: boolean;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
22
22
  }>, {
23
23
  id: string;
24
24
  name: string;
25
- disabledForgotPassword: boolean;
26
25
  new: boolean;
26
+ disabledForgotPassword: boolean;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
22
22
  }>, {
23
23
  id: string;
24
24
  name: string;
25
- disabledForgotPassword: boolean;
26
25
  new: boolean;
26
+ disabledForgotPassword: boolean;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
12
12
  label: string;
13
13
  color: InputSliderColor;
14
14
  fullWidth: boolean;
15
- step: number;
16
15
  max: number;
17
16
  min: number;
17
+ step: number;
18
18
  lineHeight: number | string;
19
19
  appearance: boolean;
20
20
  thumbSize: number | string;
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
12
12
  label: string;
13
13
  color: InputSliderColor;
14
14
  fullWidth: boolean;
15
- step: number;
16
15
  max: number;
17
16
  min: number;
17
+ step: number;
18
18
  lineHeight: number | string;
19
19
  appearance: boolean;
20
20
  thumbSize: number | string;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  }) => any) | undefined;
25
25
  }>, {
26
26
  title: string;
27
- confirmText: string;
28
27
  disabledForgotPassword: boolean;
28
+ confirmText: string;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  }) => any) | undefined;
25
25
  }>, {
26
26
  title: string;
27
- confirmText: string;
28
27
  disabledForgotPassword: boolean;
28
+ confirmText: string;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -28,8 +28,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
28
28
  }>, {
29
29
  title: string;
30
30
  mode: "login" | "secure";
31
- confirmText: string;
32
31
  disabledForgotPassword: boolean;
32
+ confirmText: string;
33
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
34
  declare const _default: typeof __VLS_export;
35
35
  export default _default;
@@ -28,8 +28,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
28
28
  }>, {
29
29
  title: string;
30
30
  mode: "login" | "secure";
31
- confirmText: string;
32
31
  disabledForgotPassword: boolean;
32
+ confirmText: string;
33
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
34
  declare const _default: typeof __VLS_export;
35
35
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.223.0",
3
+ "version": "1.224.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",