vue-daum-postcode 1.1.0 → 1.2.1
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/README.md +10 -5
- package/lib/VueDaumPostcode.d.ts +59 -17
- package/lib/createVueDaumPostcode.d.ts +61 -19
- package/lib/index.d.ts +5 -5
- package/lib/vue-daum-postcode.mjs +170 -0
- package/lib/vue-daum-postcode.mjs.map +1 -0
- package/lib/vue-daum-postcode.umd.js +1 -1
- package/lib/vue-daum-postcode.umd.js.map +1 -1
- package/package.json +28 -18
- package/src/VueDaumPostcode.ts +3 -3
- package/src/createVueDaumPostcode.ts +60 -39
- package/src/index.ts +25 -12
- package/src/interfaces.ts +52 -53
- package/lib/vue-daum-postcode.es.js +0 -2
- package/lib/vue-daum-postcode.es.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
# Vue Daum Postcode
|
|
2
2
|
|
|
3
3
|
<p>
|
|
4
|
-
<a href="https://github.com/wan2land/vue-daum-postcode/actions
|
|
4
|
+
<a href="https://github.com/wan2land/vue-daum-postcode/actions"><img alt="Build" src="https://img.shields.io/github/actions/workflow/status/wan2land/vue-daum-postcode/ci.yml?branch=main&logo=github&style=flat-square" /></a>
|
|
5
5
|
<a href="https://npmcharts.com/compare/vue-daum-postcode?minimal=true"><img alt="Downloads" src="https://img.shields.io/npm/dt/vue-daum-postcode.svg?style=flat-square" /></a>
|
|
6
6
|
<a href="https://www.npmjs.com/package/vue-daum-postcode"><img alt="Version" src="https://img.shields.io/npm/v/vue-daum-postcode.svg?style=flat-square" /></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/vue-daum-postcode"><img alt="License" src="https://img.shields.io/npm/l/vue-daum-postcode.svg?style=flat-square" /></a>
|
|
8
8
|
<img alt="VueJS 3.x" src="https://img.shields.io/badge/vue.js-3.x-brightgreen.svg?style=flat-square" />
|
|
9
9
|
<img alt="Language Typescript" src="https://img.shields.io/badge/language-Typescript-007acc.svg?style=flat-square" />
|
|
10
|
-
<br />
|
|
11
|
-
<a href="https://david-dm.org/wan2land/vue-daum-postcode"><img alt="dependencies Status" src="https://img.shields.io/david/wan2land/vue-daum-postcode.svg?style=flat-square" /></a>
|
|
12
|
-
<a href="https://david-dm.org/wan2land/vue-daum-postcode?type=dev"><img alt="devDependencies Status" src="https://img.shields.io/david/dev/wan2land/vue-daum-postcode.svg?style=flat-square" /></a>
|
|
13
10
|
</p>
|
|
14
11
|
|
|
15
12
|
[Daum 우편번호 서비스](http://postcode.map.daum.net/guide)를 기반으로 작업된 Vue Component 입니다.
|
|
@@ -21,7 +18,7 @@ Vue 2.x를 사용하다면 [v0.x branch](https://github.com/wan2land/vue-daum-po
|
|
|
21
18
|
## Installation
|
|
22
19
|
|
|
23
20
|
```bash
|
|
24
|
-
npm i vue-daum-postcode
|
|
21
|
+
npm i vue-daum-postcode
|
|
25
22
|
```
|
|
26
23
|
|
|
27
24
|
|
|
@@ -100,6 +97,14 @@ app.use(VueDaumPostcode, {
|
|
|
100
97
|
|
|
101
98
|
이름 | 설명
|
|
102
99
|
------------------------- | -----------
|
|
100
|
+
`load` | 다음 우편번호가 로딩 되었을 때 발생
|
|
103
101
|
`search` | [Daum 우편번호, 속성](http://postcode.map.daum.net/guide)에서 `onsearch`.
|
|
104
102
|
`complete` | [Daum 우편번호, 속성](http://postcode.map.daum.net/guide)에서 `oncomplete`.
|
|
105
103
|
`resize` | [Daum 우편번호, 속성](http://postcode.map.daum.net/guide)에서 `onresize`.
|
|
104
|
+
`error` | 스크립트 로딩 실패시 발생
|
|
105
|
+
|
|
106
|
+
## Slots
|
|
107
|
+
|
|
108
|
+
이름 | 설명
|
|
109
|
+
------------------------- | ---------
|
|
110
|
+
`loading` | 다음 우편번호가 아직 완전히 불러오기 전에 보여줄 내용이 있는 경우 해당 슬롯에 넣습니다. (ex. spinner)
|
package/lib/VueDaumPostcode.d.ts
CHANGED
|
@@ -58,24 +58,66 @@ declare const VueDaumPostcode: import("vue").DefineComponent<{
|
|
|
58
58
|
}, unknown, {
|
|
59
59
|
styleHeight: string | number;
|
|
60
60
|
isLoaded: boolean;
|
|
61
|
-
}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
62
|
-
q:
|
|
61
|
+
}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
62
|
+
q: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
animation: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: boolean;
|
|
69
|
+
};
|
|
70
|
+
noAutoMapping: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: boolean;
|
|
73
|
+
};
|
|
74
|
+
noShorthand: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
78
|
+
noSubmitMode: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
82
|
+
pleaseReadGuide: {
|
|
83
|
+
type: NumberConstructor;
|
|
84
|
+
default: number;
|
|
85
|
+
};
|
|
86
|
+
pleaseReadGuideTimer: {
|
|
87
|
+
type: NumberConstructor;
|
|
88
|
+
default: number;
|
|
89
|
+
};
|
|
90
|
+
maxSuggestItems: {
|
|
91
|
+
type: NumberConstructor;
|
|
92
|
+
default: number;
|
|
93
|
+
};
|
|
94
|
+
showMoreHName: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: boolean;
|
|
97
|
+
};
|
|
98
|
+
hideMapBtn: {
|
|
99
|
+
type: BooleanConstructor;
|
|
100
|
+
default: boolean;
|
|
101
|
+
};
|
|
102
|
+
hideEngBtn: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
default: boolean;
|
|
105
|
+
};
|
|
106
|
+
alwaysShowEngAddr: {
|
|
107
|
+
type: BooleanConstructor;
|
|
108
|
+
default: boolean;
|
|
109
|
+
};
|
|
110
|
+
zonecodeOnly: {
|
|
111
|
+
type: BooleanConstructor;
|
|
112
|
+
default: boolean;
|
|
113
|
+
};
|
|
114
|
+
theme: {
|
|
115
|
+
type: import("vue").PropType<import("./interfaces").VueDaumPostcodeTheme>;
|
|
116
|
+
default: () => {};
|
|
117
|
+
};
|
|
118
|
+
}>>, {
|
|
63
119
|
animation: boolean;
|
|
64
|
-
noAutoMapping: boolean;
|
|
65
|
-
noShorthand: boolean;
|
|
66
|
-
noSubmitMode: boolean;
|
|
67
|
-
pleaseReadGuide: number;
|
|
68
|
-
pleaseReadGuideTimer: number;
|
|
69
|
-
maxSuggestItems: number;
|
|
70
|
-
showMoreHName: boolean;
|
|
71
|
-
hideMapBtn: boolean;
|
|
72
|
-
hideEngBtn: boolean;
|
|
73
|
-
alwaysShowEngAddr: boolean;
|
|
74
|
-
zonecodeOnly: boolean;
|
|
75
|
-
theme: import("./interfaces").VueDaumPostcodeTheme;
|
|
76
|
-
} & {}>, {
|
|
77
120
|
q: string;
|
|
78
|
-
animation: boolean;
|
|
79
121
|
noAutoMapping: boolean;
|
|
80
122
|
noShorthand: boolean;
|
|
81
123
|
noSubmitMode: boolean;
|
|
@@ -88,5 +130,5 @@ declare const VueDaumPostcode: import("vue").DefineComponent<{
|
|
|
88
130
|
alwaysShowEngAddr: boolean;
|
|
89
131
|
zonecodeOnly: boolean;
|
|
90
132
|
theme: import("./interfaces").VueDaumPostcodeTheme;
|
|
91
|
-
}>;
|
|
133
|
+
}, {}>;
|
|
92
134
|
export default VueDaumPostcode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropType } from
|
|
2
|
-
import type { VueDaumPostcodeTheme } from
|
|
1
|
+
import { PropType } from "vue";
|
|
2
|
+
import type { VueDaumPostcodeTheme } from "./interfaces";
|
|
3
3
|
export interface CreateVueDaumPostcodeOptions {
|
|
4
4
|
scriptUrl?: string | null;
|
|
5
5
|
}
|
|
@@ -63,24 +63,66 @@ export declare function createVueDaumPostcode(options?: CreateVueDaumPostcodeOpt
|
|
|
63
63
|
}, unknown, {
|
|
64
64
|
styleHeight: string | number;
|
|
65
65
|
isLoaded: boolean;
|
|
66
|
-
}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
67
|
-
q:
|
|
66
|
+
}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
67
|
+
q: {
|
|
68
|
+
type: StringConstructor;
|
|
69
|
+
default: string;
|
|
70
|
+
};
|
|
71
|
+
animation: {
|
|
72
|
+
type: BooleanConstructor;
|
|
73
|
+
default: boolean;
|
|
74
|
+
};
|
|
75
|
+
noAutoMapping: {
|
|
76
|
+
type: BooleanConstructor;
|
|
77
|
+
default: boolean;
|
|
78
|
+
};
|
|
79
|
+
noShorthand: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
default: boolean;
|
|
82
|
+
};
|
|
83
|
+
noSubmitMode: {
|
|
84
|
+
type: BooleanConstructor;
|
|
85
|
+
default: boolean;
|
|
86
|
+
};
|
|
87
|
+
pleaseReadGuide: {
|
|
88
|
+
type: NumberConstructor;
|
|
89
|
+
default: number;
|
|
90
|
+
};
|
|
91
|
+
pleaseReadGuideTimer: {
|
|
92
|
+
type: NumberConstructor;
|
|
93
|
+
default: number;
|
|
94
|
+
};
|
|
95
|
+
maxSuggestItems: {
|
|
96
|
+
type: NumberConstructor;
|
|
97
|
+
default: number;
|
|
98
|
+
};
|
|
99
|
+
showMoreHName: {
|
|
100
|
+
type: BooleanConstructor;
|
|
101
|
+
default: boolean;
|
|
102
|
+
};
|
|
103
|
+
hideMapBtn: {
|
|
104
|
+
type: BooleanConstructor;
|
|
105
|
+
default: boolean;
|
|
106
|
+
};
|
|
107
|
+
hideEngBtn: {
|
|
108
|
+
type: BooleanConstructor;
|
|
109
|
+
default: boolean;
|
|
110
|
+
};
|
|
111
|
+
alwaysShowEngAddr: {
|
|
112
|
+
type: BooleanConstructor;
|
|
113
|
+
default: boolean;
|
|
114
|
+
};
|
|
115
|
+
zonecodeOnly: {
|
|
116
|
+
type: BooleanConstructor;
|
|
117
|
+
default: boolean;
|
|
118
|
+
};
|
|
119
|
+
theme: {
|
|
120
|
+
type: PropType<VueDaumPostcodeTheme>;
|
|
121
|
+
default: () => {};
|
|
122
|
+
};
|
|
123
|
+
}>>, {
|
|
68
124
|
animation: boolean;
|
|
69
|
-
noAutoMapping: boolean;
|
|
70
|
-
noShorthand: boolean;
|
|
71
|
-
noSubmitMode: boolean;
|
|
72
|
-
pleaseReadGuide: number;
|
|
73
|
-
pleaseReadGuideTimer: number;
|
|
74
|
-
maxSuggestItems: number;
|
|
75
|
-
showMoreHName: boolean;
|
|
76
|
-
hideMapBtn: boolean;
|
|
77
|
-
hideEngBtn: boolean;
|
|
78
|
-
alwaysShowEngAddr: boolean;
|
|
79
|
-
zonecodeOnly: boolean;
|
|
80
|
-
theme: VueDaumPostcodeTheme;
|
|
81
|
-
} & {}>, {
|
|
82
125
|
q: string;
|
|
83
|
-
animation: boolean;
|
|
84
126
|
noAutoMapping: boolean;
|
|
85
127
|
noShorthand: boolean;
|
|
86
128
|
noSubmitMode: boolean;
|
|
@@ -93,4 +135,4 @@ export declare function createVueDaumPostcode(options?: CreateVueDaumPostcodeOpt
|
|
|
93
135
|
alwaysShowEngAddr: boolean;
|
|
94
136
|
zonecodeOnly: boolean;
|
|
95
137
|
theme: VueDaumPostcodeTheme;
|
|
96
|
-
}>;
|
|
138
|
+
}, {}>;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { App, Plugin } from
|
|
2
|
-
import VueDaumPostcode from
|
|
3
|
-
import { createVueDaumPostcode } from
|
|
4
|
-
import type { CreateVueDaumPostcodeOptions } from
|
|
5
|
-
import type { VueDaumPostcodeTheme, VueDaumPostcodeCompleteResult, VueDaumPostcodeSearchResult, VueDaumPostcodeResizeResult } from
|
|
1
|
+
import { App, Plugin } from "vue";
|
|
2
|
+
import VueDaumPostcode from "./VueDaumPostcode";
|
|
3
|
+
import { createVueDaumPostcode } from "./createVueDaumPostcode";
|
|
4
|
+
import type { CreateVueDaumPostcodeOptions } from "./createVueDaumPostcode";
|
|
5
|
+
import type { VueDaumPostcodeTheme, VueDaumPostcodeCompleteResult, VueDaumPostcodeSearchResult, VueDaumPostcodeResizeResult } from "./interfaces";
|
|
6
6
|
export interface VueDaumPostcodeInstallOptions extends CreateVueDaumPostcodeOptions {
|
|
7
7
|
name?: string | null;
|
|
8
8
|
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { defineComponent as r, h as s } from "vue";
|
|
2
|
+
function l(a) {
|
|
3
|
+
let t = null;
|
|
4
|
+
return () => {
|
|
5
|
+
try {
|
|
6
|
+
return t || (t = Promise.resolve(a()).catch((o) => {
|
|
7
|
+
throw t = null, o;
|
|
8
|
+
}));
|
|
9
|
+
} catch (o) {
|
|
10
|
+
return Promise.reject(o);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
var i = (a, t) => new Promise((o, e) => {
|
|
15
|
+
(document.head || document.body).appendChild(Object.assign(document.createElement("script"), t, { src: a, async: !0, onload: o, onerror: () => e(new Error(`Failed to load script: ${a}`)) }));
|
|
16
|
+
});
|
|
17
|
+
typeof document > "u" && (i = () => Promise.reject(new Error("load is not supported in nodejs")));
|
|
18
|
+
function d(a = {}) {
|
|
19
|
+
const t = a.scriptUrl || "//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js", o = l(
|
|
20
|
+
() => i(t).then(
|
|
21
|
+
() => new Promise(
|
|
22
|
+
(e) => window.daum.postcode.load(e)
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
return r({
|
|
27
|
+
props: {
|
|
28
|
+
q: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ""
|
|
31
|
+
},
|
|
32
|
+
animation: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
36
|
+
noAutoMapping: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
},
|
|
40
|
+
noShorthand: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !1
|
|
43
|
+
},
|
|
44
|
+
noSubmitMode: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
pleaseReadGuide: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: 0
|
|
51
|
+
},
|
|
52
|
+
pleaseReadGuideTimer: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: 1.5
|
|
55
|
+
},
|
|
56
|
+
maxSuggestItems: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: 10
|
|
59
|
+
},
|
|
60
|
+
showMoreHName: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
},
|
|
64
|
+
hideMapBtn: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !1
|
|
67
|
+
},
|
|
68
|
+
hideEngBtn: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !1
|
|
71
|
+
},
|
|
72
|
+
alwaysShowEngAddr: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: !1
|
|
75
|
+
},
|
|
76
|
+
zonecodeOnly: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: !1
|
|
79
|
+
},
|
|
80
|
+
theme: {
|
|
81
|
+
type: Object,
|
|
82
|
+
default: () => ({})
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
data() {
|
|
86
|
+
return {
|
|
87
|
+
styleHeight: 0,
|
|
88
|
+
isLoaded: !1
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
mounted() {
|
|
92
|
+
o().then(() => (this.isLoaded = !0, this.$nextTick())).then(() => {
|
|
93
|
+
new window.daum.Postcode({
|
|
94
|
+
width: "100%",
|
|
95
|
+
height: "100%",
|
|
96
|
+
animation: this.animation,
|
|
97
|
+
autoMapping: !this.noAutoMapping,
|
|
98
|
+
shorthand: !this.noShorthand,
|
|
99
|
+
pleaseReadGuide: this.pleaseReadGuide,
|
|
100
|
+
pleaseReadGuideTimer: this.pleaseReadGuideTimer,
|
|
101
|
+
maxSuggestItems: this.maxSuggestItems,
|
|
102
|
+
showMoreHName: this.showMoreHName,
|
|
103
|
+
hideMapBtn: this.hideMapBtn,
|
|
104
|
+
hideEngBtn: this.hideEngBtn,
|
|
105
|
+
alwaysShowEngAddr: this.alwaysShowEngAddr,
|
|
106
|
+
zonecodeOnly: this.zonecodeOnly,
|
|
107
|
+
theme: this.theme,
|
|
108
|
+
submitMode: !this.noSubmitMode,
|
|
109
|
+
onsearch: (e) => {
|
|
110
|
+
this.$emit("search", e);
|
|
111
|
+
},
|
|
112
|
+
oncomplete: (e) => {
|
|
113
|
+
this.$emit("complete", e);
|
|
114
|
+
},
|
|
115
|
+
onresize: (e) => {
|
|
116
|
+
this.styleHeight = `${e.height}px`, this.$emit("resize", e);
|
|
117
|
+
}
|
|
118
|
+
}).embed(this.$refs.container, {
|
|
119
|
+
q: this.q,
|
|
120
|
+
autoClose: !1
|
|
121
|
+
}), this.$emit("load");
|
|
122
|
+
}).catch((e) => {
|
|
123
|
+
const n = new Error(`Load ${t} failed.`);
|
|
124
|
+
n.cause = e, this.$emit("error", n);
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
render() {
|
|
128
|
+
return s(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
class: ["vue-daum-postcode"]
|
|
132
|
+
},
|
|
133
|
+
this.isLoaded || !this.$slots.loading ? [
|
|
134
|
+
s("div", {
|
|
135
|
+
class: ["vue-daum-postcode-container"],
|
|
136
|
+
ref: "container",
|
|
137
|
+
style: {
|
|
138
|
+
height: this.styleHeight
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
] : [
|
|
142
|
+
s(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
class: ["vue-daum-postcode-loading"]
|
|
146
|
+
},
|
|
147
|
+
[this.$slots.loading()]
|
|
148
|
+
)
|
|
149
|
+
]
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
const u = d();
|
|
155
|
+
function h(a, { name: t, ...o } = {}) {
|
|
156
|
+
a.component(
|
|
157
|
+
t ?? "VueDaumPostcode",
|
|
158
|
+
Object.keys(o).length > 0 ? d(o) : u
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
const m = {
|
|
162
|
+
install: h
|
|
163
|
+
};
|
|
164
|
+
export {
|
|
165
|
+
u as VueDaumPostcode,
|
|
166
|
+
d as createVueDaumPostcode,
|
|
167
|
+
m as default,
|
|
168
|
+
h as install
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=vue-daum-postcode.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-daum-postcode.mjs","sources":["../node_modules/nano-loader/index.mjs","../src/createVueDaumPostcode.ts","../src/VueDaumPostcode.ts","../src/index.ts"],"sourcesContent":["function n(o){let e=null;return()=>{try{return e||(e=Promise.resolve(o()).catch(r=>{throw e=null,r}))}catch(r){return Promise.reject(r)}}}var s=n,i=(o,e)=>new Promise((r,t)=>{(document.head||document.body).appendChild(Object.assign(document.createElement(\"script\"),e,{src:o,async:!0,onload:r,onerror:()=>t(new Error(`Failed to load script: ${o}`))}))});typeof document>\"u\"&&(i=()=>Promise.reject(new Error(\"load is not supported in nodejs\")));export{s as defer,i as load,n as once};\n","import { once, load } from \"nano-loader\";\nimport { defineComponent, PropType, h } from \"vue\";\n\nimport type {\n VueDaumPostcodeCompleteResult,\n VueDaumPostcodeResizeResult,\n VueDaumPostcodeSearchResult,\n VueDaumPostcodeTheme,\n} from \"./interfaces\";\n\nexport interface CreateVueDaumPostcodeOptions {\n scriptUrl?: string | null;\n}\n\nexport function createVueDaumPostcode(\n options: CreateVueDaumPostcodeOptions = {}\n) {\n const scriptUrl =\n options.scriptUrl ||\n \"//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js\";\n const loadDaumPostcode = once(() =>\n load(scriptUrl).then(\n () =>\n new Promise<void>((resolve) =>\n (window as any).daum.postcode.load(resolve)\n )\n )\n );\n\n return defineComponent({\n props: {\n q: {\n type: String,\n default: \"\",\n },\n animation: {\n type: Boolean,\n default: false,\n },\n noAutoMapping: {\n type: Boolean,\n default: false,\n },\n noShorthand: {\n type: Boolean,\n default: false,\n },\n noSubmitMode: {\n type: Boolean,\n default: false,\n },\n pleaseReadGuide: {\n type: Number,\n default: 0,\n },\n pleaseReadGuideTimer: {\n type: Number,\n default: 1.5,\n },\n maxSuggestItems: {\n type: Number,\n default: 10,\n },\n showMoreHName: {\n type: Boolean,\n default: false,\n },\n hideMapBtn: {\n type: Boolean,\n default: false,\n },\n hideEngBtn: {\n type: Boolean,\n default: false,\n },\n alwaysShowEngAddr: {\n type: Boolean,\n default: false,\n },\n zonecodeOnly: {\n type: Boolean,\n default: false,\n },\n theme: {\n type: Object as PropType<VueDaumPostcodeTheme>,\n default: () => ({}),\n },\n },\n data() {\n return {\n styleHeight: 0 as string | number,\n isLoaded: false,\n };\n },\n mounted() {\n loadDaumPostcode()\n .then(() => {\n this.isLoaded = true;\n return this.$nextTick();\n })\n .then(() => {\n new (window as any).daum.Postcode({\n width: \"100%\",\n height: \"100%\",\n animation: this.animation,\n autoMapping: !this.noAutoMapping,\n shorthand: !this.noShorthand,\n pleaseReadGuide: this.pleaseReadGuide,\n pleaseReadGuideTimer: this.pleaseReadGuideTimer,\n maxSuggestItems: this.maxSuggestItems,\n showMoreHName: this.showMoreHName,\n hideMapBtn: this.hideMapBtn,\n hideEngBtn: this.hideEngBtn,\n alwaysShowEngAddr: this.alwaysShowEngAddr,\n zonecodeOnly: this.zonecodeOnly,\n theme: this.theme,\n submitMode: !this.noSubmitMode,\n onsearch: (data: VueDaumPostcodeSearchResult) => {\n this.$emit(\"search\", data);\n },\n oncomplete: (data: VueDaumPostcodeCompleteResult) => {\n this.$emit(\"complete\", data);\n },\n onresize: (data: VueDaumPostcodeResizeResult) => {\n this.styleHeight = `${data.height}px`;\n this.$emit(\"resize\", data);\n },\n }).embed(this.$refs.container, {\n q: this.q,\n autoClose: false,\n });\n this.$emit(\"load\");\n })\n .catch((e) => {\n const error = new Error(`Load ${scriptUrl} failed.`);\n error.cause = e;\n this.$emit(\"error\", error);\n });\n },\n render() {\n return h(\n \"div\",\n {\n class: [\"vue-daum-postcode\"],\n },\n this.isLoaded || !this.$slots.loading\n ? [\n h(\"div\", {\n class: [\"vue-daum-postcode-container\"],\n ref: \"container\",\n style: {\n height: this.styleHeight,\n },\n }),\n ]\n : [\n h(\n \"div\",\n {\n class: [\"vue-daum-postcode-loading\"],\n },\n [this.$slots.loading()]\n ),\n ]\n );\n },\n });\n}\n","import { createVueDaumPostcode } from \"./createVueDaumPostcode\";\n\nconst VueDaumPostcode = createVueDaumPostcode();\n\nexport default VueDaumPostcode;\n","import { App, Plugin } from \"vue\";\n\nimport VueDaumPostcode from \"./VueDaumPostcode\";\nimport { createVueDaumPostcode } from \"./createVueDaumPostcode\";\nimport type { CreateVueDaumPostcodeOptions } from \"./createVueDaumPostcode\";\nimport type {\n VueDaumPostcodeTheme,\n VueDaumPostcodeCompleteResult,\n VueDaumPostcodeSearchResult,\n VueDaumPostcodeResizeResult,\n} from \"./interfaces\";\n\nexport interface VueDaumPostcodeInstallOptions\n extends CreateVueDaumPostcodeOptions {\n name?: string | null;\n}\n\nexport function install(\n app: App,\n { name, ...options }: VueDaumPostcodeInstallOptions = {}\n) {\n app.component(\n name ?? \"VueDaumPostcode\",\n Object.keys(options).length > 0\n ? createVueDaumPostcode(options)\n : VueDaumPostcode\n );\n}\n\nconst plugin: Plugin = {\n install,\n};\n\nexport {\n plugin as default,\n createVueDaumPostcode,\n CreateVueDaumPostcodeOptions,\n VueDaumPostcodeTheme,\n VueDaumPostcode,\n VueDaumPostcodeCompleteResult,\n VueDaumPostcodeSearchResult,\n VueDaumPostcodeResizeResult,\n};\n"],"names":["n","o","e","r","t","createVueDaumPostcode","options","scriptUrl","loadDaumPostcode","once","load","resolve","defineComponent","data","error","h","VueDaumPostcode","install","app","name","plugin"],"mappings":";AAAA,SAASA,EAAEC,GAAE;AAAC,MAAIC,IAAE;AAAK,SAAM,MAAI;AAAC,QAAG;AAAC,aAAOA,MAAIA,IAAE,QAAQ,QAAQD,EAAC,CAAE,EAAE,MAAM,CAAAE,MAAG;AAAC,cAAMD,IAAE,MAAKC;AAAA,MAAC,CAAC;AAAA,IAAE,SAAOA,GAAN;AAAS,aAAO,QAAQ,OAAOA,CAAC;AAAA,IAAC;AAAA,EAAC;AAAC;AAAI,IAAK,IAAE,CAACF,GAAEC,MAAI,IAAI,QAAQ,CAACC,GAAEC,MAAI;AAAC,GAAC,SAAS,QAAM,SAAS,MAAM,YAAY,OAAO,OAAO,SAAS,cAAc,QAAQ,GAAEF,GAAE,EAAC,KAAID,GAAE,OAAM,IAAG,QAAOE,GAAE,SAAQ,MAAIC,EAAE,IAAI,MAAM,0BAA0BH,GAAG,CAAC,EAAC,CAAC,CAAC;AAAC,CAAC;AAAE,OAAO,WAAS,QAAM,IAAE,MAAI,QAAQ,OAAO,IAAI,MAAM,iCAAiC,CAAC;ACcxa,SAAAI,EACdC,IAAwC,IACxC;AACM,QAAAC,IACJD,EAAQ,aACR,iEACIE,IAAmBC;AAAAA,IAAK,MAC5BC,EAAKH,CAAS,EAAE;AAAA,MACd,MACE,IAAI;AAAA,QAAc,CAACI,MAChB,OAAe,KAAK,SAAS,KAAKA,CAAO;AAAA,MAC5C;AAAA,IACJ;AAAA,EAAA;AAGF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C;AAAA,YACA,CAAC,KAAK,OAAO,SAAS;AAAA,UACxB;AAAA,QACF;AAAA,MAAA;AAAA,IAER;AAAA,EAAA,CACD;AACH;ACrKA,MAAMC,IAAkBX,EAAsB;ACe9B,SAAAY,EACdC,GACA,EAAE,MAAAC,GAAM,GAAGb,EAAQ,IAAmC,CAAA,GACtD;AACI,EAAAY,EAAA;AAAA,IACFC,KAAQ;AAAA,IACR,OAAO,KAAKb,CAAO,EAAE,SAAS,IAC1BD,EAAsBC,CAAO,IAC7BU;AAAA,EAAA;AAER;AAEA,MAAMI,IAAiB;AAAA,EACrB,SAAAH;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
(function(t,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(t=typeof globalThis<"u"?globalThis:t||self,s(t.VueDaumPostcode={},t.Vue))})(this,function(t,s){"use strict";function h(a){let o=null;return()=>{try{return o||(o=Promise.resolve(a()).catch(n=>{throw o=null,n}))}catch(n){return Promise.reject(n)}}}var d=(a,o)=>new Promise((n,e)=>{(document.head||document.body).appendChild(Object.assign(document.createElement("script"),o,{src:a,async:!0,onload:n,onerror:()=>e(new Error(`Failed to load script: ${a}`))}))});typeof document>"u"&&(d=()=>Promise.reject(new Error("load is not supported in nodejs")));function i(a={}){const o=a.scriptUrl||"//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",n=h(()=>d(o).then(()=>new Promise(e=>window.daum.postcode.load(e))));return s.defineComponent({props:{q:{type:String,default:""},animation:{type:Boolean,default:!1},noAutoMapping:{type:Boolean,default:!1},noShorthand:{type:Boolean,default:!1},noSubmitMode:{type:Boolean,default:!1},pleaseReadGuide:{type:Number,default:0},pleaseReadGuideTimer:{type:Number,default:1.5},maxSuggestItems:{type:Number,default:10},showMoreHName:{type:Boolean,default:!1},hideMapBtn:{type:Boolean,default:!1},hideEngBtn:{type:Boolean,default:!1},alwaysShowEngAddr:{type:Boolean,default:!1},zonecodeOnly:{type:Boolean,default:!1},theme:{type:Object,default:()=>({})}},data(){return{styleHeight:0,isLoaded:!1}},mounted(){n().then(()=>(this.isLoaded=!0,this.$nextTick())).then(()=>{new window.daum.Postcode({width:"100%",height:"100%",animation:this.animation,autoMapping:!this.noAutoMapping,shorthand:!this.noShorthand,pleaseReadGuide:this.pleaseReadGuide,pleaseReadGuideTimer:this.pleaseReadGuideTimer,maxSuggestItems:this.maxSuggestItems,showMoreHName:this.showMoreHName,hideMapBtn:this.hideMapBtn,hideEngBtn:this.hideEngBtn,alwaysShowEngAddr:this.alwaysShowEngAddr,zonecodeOnly:this.zonecodeOnly,theme:this.theme,submitMode:!this.noSubmitMode,onsearch:e=>{this.$emit("search",e)},oncomplete:e=>{this.$emit("complete",e)},onresize:e=>{this.styleHeight=`${e.height}px`,this.$emit("resize",e)}}).embed(this.$refs.container,{q:this.q,autoClose:!1}),this.$emit("load")}).catch(e=>{const r=new Error(`Load ${o} failed.`);r.cause=e,this.$emit("error",r)})},render(){return s.h("div",{class:["vue-daum-postcode"]},this.isLoaded||!this.$slots.loading?[s.h("div",{class:["vue-daum-postcode-container"],ref:"container",style:{height:this.styleHeight}})]:[s.h("div",{class:["vue-daum-postcode-loading"]},[this.$slots.loading()])])}})}const l=i();function u(a,{name:o,...n}={}){a.component(o??"VueDaumPostcode",Object.keys(n).length>0?i(n):l)}const c={install:u};t.VueDaumPostcode=l,t.createVueDaumPostcode=i,t.default=c,t.install=u,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2
2
|
//# sourceMappingURL=vue-daum-postcode.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-daum-postcode.umd.js","sources":["../node_modules/nano-loader/index.
|
|
1
|
+
{"version":3,"file":"vue-daum-postcode.umd.js","sources":["../node_modules/nano-loader/index.mjs","../src/createVueDaumPostcode.ts","../src/VueDaumPostcode.ts","../src/index.ts"],"sourcesContent":["function n(o){let e=null;return()=>{try{return e||(e=Promise.resolve(o()).catch(r=>{throw e=null,r}))}catch(r){return Promise.reject(r)}}}var s=n,i=(o,e)=>new Promise((r,t)=>{(document.head||document.body).appendChild(Object.assign(document.createElement(\"script\"),e,{src:o,async:!0,onload:r,onerror:()=>t(new Error(`Failed to load script: ${o}`))}))});typeof document>\"u\"&&(i=()=>Promise.reject(new Error(\"load is not supported in nodejs\")));export{s as defer,i as load,n as once};\n","import { once, load } from \"nano-loader\";\nimport { defineComponent, PropType, h } from \"vue\";\n\nimport type {\n VueDaumPostcodeCompleteResult,\n VueDaumPostcodeResizeResult,\n VueDaumPostcodeSearchResult,\n VueDaumPostcodeTheme,\n} from \"./interfaces\";\n\nexport interface CreateVueDaumPostcodeOptions {\n scriptUrl?: string | null;\n}\n\nexport function createVueDaumPostcode(\n options: CreateVueDaumPostcodeOptions = {}\n) {\n const scriptUrl =\n options.scriptUrl ||\n \"//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js\";\n const loadDaumPostcode = once(() =>\n load(scriptUrl).then(\n () =>\n new Promise<void>((resolve) =>\n (window as any).daum.postcode.load(resolve)\n )\n )\n );\n\n return defineComponent({\n props: {\n q: {\n type: String,\n default: \"\",\n },\n animation: {\n type: Boolean,\n default: false,\n },\n noAutoMapping: {\n type: Boolean,\n default: false,\n },\n noShorthand: {\n type: Boolean,\n default: false,\n },\n noSubmitMode: {\n type: Boolean,\n default: false,\n },\n pleaseReadGuide: {\n type: Number,\n default: 0,\n },\n pleaseReadGuideTimer: {\n type: Number,\n default: 1.5,\n },\n maxSuggestItems: {\n type: Number,\n default: 10,\n },\n showMoreHName: {\n type: Boolean,\n default: false,\n },\n hideMapBtn: {\n type: Boolean,\n default: false,\n },\n hideEngBtn: {\n type: Boolean,\n default: false,\n },\n alwaysShowEngAddr: {\n type: Boolean,\n default: false,\n },\n zonecodeOnly: {\n type: Boolean,\n default: false,\n },\n theme: {\n type: Object as PropType<VueDaumPostcodeTheme>,\n default: () => ({}),\n },\n },\n data() {\n return {\n styleHeight: 0 as string | number,\n isLoaded: false,\n };\n },\n mounted() {\n loadDaumPostcode()\n .then(() => {\n this.isLoaded = true;\n return this.$nextTick();\n })\n .then(() => {\n new (window as any).daum.Postcode({\n width: \"100%\",\n height: \"100%\",\n animation: this.animation,\n autoMapping: !this.noAutoMapping,\n shorthand: !this.noShorthand,\n pleaseReadGuide: this.pleaseReadGuide,\n pleaseReadGuideTimer: this.pleaseReadGuideTimer,\n maxSuggestItems: this.maxSuggestItems,\n showMoreHName: this.showMoreHName,\n hideMapBtn: this.hideMapBtn,\n hideEngBtn: this.hideEngBtn,\n alwaysShowEngAddr: this.alwaysShowEngAddr,\n zonecodeOnly: this.zonecodeOnly,\n theme: this.theme,\n submitMode: !this.noSubmitMode,\n onsearch: (data: VueDaumPostcodeSearchResult) => {\n this.$emit(\"search\", data);\n },\n oncomplete: (data: VueDaumPostcodeCompleteResult) => {\n this.$emit(\"complete\", data);\n },\n onresize: (data: VueDaumPostcodeResizeResult) => {\n this.styleHeight = `${data.height}px`;\n this.$emit(\"resize\", data);\n },\n }).embed(this.$refs.container, {\n q: this.q,\n autoClose: false,\n });\n this.$emit(\"load\");\n })\n .catch((e) => {\n const error = new Error(`Load ${scriptUrl} failed.`);\n error.cause = e;\n this.$emit(\"error\", error);\n });\n },\n render() {\n return h(\n \"div\",\n {\n class: [\"vue-daum-postcode\"],\n },\n this.isLoaded || !this.$slots.loading\n ? [\n h(\"div\", {\n class: [\"vue-daum-postcode-container\"],\n ref: \"container\",\n style: {\n height: this.styleHeight,\n },\n }),\n ]\n : [\n h(\n \"div\",\n {\n class: [\"vue-daum-postcode-loading\"],\n },\n [this.$slots.loading()]\n ),\n ]\n );\n },\n });\n}\n","import { createVueDaumPostcode } from \"./createVueDaumPostcode\";\n\nconst VueDaumPostcode = createVueDaumPostcode();\n\nexport default VueDaumPostcode;\n","import { App, Plugin } from \"vue\";\n\nimport VueDaumPostcode from \"./VueDaumPostcode\";\nimport { createVueDaumPostcode } from \"./createVueDaumPostcode\";\nimport type { CreateVueDaumPostcodeOptions } from \"./createVueDaumPostcode\";\nimport type {\n VueDaumPostcodeTheme,\n VueDaumPostcodeCompleteResult,\n VueDaumPostcodeSearchResult,\n VueDaumPostcodeResizeResult,\n} from \"./interfaces\";\n\nexport interface VueDaumPostcodeInstallOptions\n extends CreateVueDaumPostcodeOptions {\n name?: string | null;\n}\n\nexport function install(\n app: App,\n { name, ...options }: VueDaumPostcodeInstallOptions = {}\n) {\n app.component(\n name ?? \"VueDaumPostcode\",\n Object.keys(options).length > 0\n ? createVueDaumPostcode(options)\n : VueDaumPostcode\n );\n}\n\nconst plugin: Plugin = {\n install,\n};\n\nexport {\n plugin as default,\n createVueDaumPostcode,\n CreateVueDaumPostcodeOptions,\n VueDaumPostcodeTheme,\n VueDaumPostcode,\n VueDaumPostcodeCompleteResult,\n VueDaumPostcodeSearchResult,\n VueDaumPostcodeResizeResult,\n};\n"],"names":["n","o","e","r","i","t","createVueDaumPostcode","options","scriptUrl","loadDaumPostcode","once","load","resolve","defineComponent","data","error","h","VueDaumPostcode","install","app","name","plugin"],"mappings":"oQAAA,SAASA,EAAEC,EAAE,CAAC,IAAIC,EAAE,KAAK,MAAM,IAAI,CAAC,GAAG,CAAC,OAAOA,IAAIA,EAAE,QAAQ,QAAQD,EAAC,CAAE,EAAE,MAAME,GAAG,CAAC,MAAMD,EAAE,KAAKC,CAAC,CAAC,EAAE,OAAOA,EAAN,CAAS,OAAO,QAAQ,OAAOA,CAAC,CAAC,CAAC,CAAC,CAAI,IAAKC,EAAE,CAACH,EAAEC,IAAI,IAAI,QAAQ,CAACC,EAAEE,IAAI,EAAE,SAAS,MAAM,SAAS,MAAM,YAAY,OAAO,OAAO,SAAS,cAAc,QAAQ,EAAEH,EAAE,CAAC,IAAID,EAAE,MAAM,GAAG,OAAOE,EAAE,QAAQ,IAAIE,EAAE,IAAI,MAAM,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GED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-daum-postcode",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"title": "Daum Postcode Component",
|
|
5
5
|
"description": "Daum(Kakao) Postcode Component for Vue 3.",
|
|
6
6
|
"author": "Changwan Jun",
|
|
@@ -28,24 +28,34 @@
|
|
|
28
28
|
"deploy:example": "npm run build:example && gh-pages -d example-dist"
|
|
29
29
|
},
|
|
30
30
|
"main": "lib/vue-daum-postcode.umd.js",
|
|
31
|
-
"module": "lib/vue-daum-postcode.
|
|
31
|
+
"module": "lib/vue-daum-postcode.mjs",
|
|
32
32
|
"types": "lib/index.d.ts",
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@commitlint/
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"eslint": "
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"typescript": "
|
|
48
|
-
"
|
|
49
|
-
"
|
|
34
|
+
"@babel/types": "^7.20.7",
|
|
35
|
+
"@commitlint/cli": "17.6.5",
|
|
36
|
+
"@commitlint/config-conventional": "17.6.5",
|
|
37
|
+
"@rushstack/eslint-patch": "^1.2.0",
|
|
38
|
+
"@types/node": "^18.16.16",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^5.50.0",
|
|
40
|
+
"@typescript-eslint/parser": "^5.50.0",
|
|
41
|
+
"@vitejs/plugin-vue": "4.2.3",
|
|
42
|
+
"@vue/compiler-sfc": "3.3.4",
|
|
43
|
+
"@vue/eslint-config-prettier": "^7.0.0",
|
|
44
|
+
"@vue/eslint-config-typescript": "^11.0.2",
|
|
45
|
+
"eslint": "^8.33.0",
|
|
46
|
+
"eslint-config-prettier": "^8.6.0",
|
|
47
|
+
"eslint-import-resolver-typescript": "^3.5.3",
|
|
48
|
+
"eslint-plugin-import": "^2.27.5",
|
|
49
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
50
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
51
|
+
"eslint-plugin-vue": "^9.9.0",
|
|
52
|
+
"gh-pages": "^5.0.0",
|
|
53
|
+
"husky": "8.0.3",
|
|
54
|
+
"nano-loader": "^1.1.2",
|
|
55
|
+
"prettier": "^2.8.3",
|
|
56
|
+
"simple-icons": "^9.0.0",
|
|
57
|
+
"typescript": "4.9.5",
|
|
58
|
+
"vite": "4.3.9",
|
|
59
|
+
"vue": "3.3.4"
|
|
50
60
|
}
|
|
51
61
|
}
|
package/src/VueDaumPostcode.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createVueDaumPostcode } from
|
|
1
|
+
import { createVueDaumPostcode } from "./createVueDaumPostcode";
|
|
2
2
|
|
|
3
|
-
const VueDaumPostcode = createVueDaumPostcode()
|
|
3
|
+
const VueDaumPostcode = createVueDaumPostcode();
|
|
4
4
|
|
|
5
|
-
export default VueDaumPostcode
|
|
5
|
+
export default VueDaumPostcode;
|
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineComponent, PropType, h } from
|
|
1
|
+
import { once, load } from "nano-loader";
|
|
2
|
+
import { defineComponent, PropType, h } from "vue";
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
VueDaumPostcodeCompleteResult,
|
|
6
|
+
VueDaumPostcodeResizeResult,
|
|
7
|
+
VueDaumPostcodeSearchResult,
|
|
8
|
+
VueDaumPostcodeTheme,
|
|
9
|
+
} from "./interfaces";
|
|
5
10
|
|
|
6
11
|
export interface CreateVueDaumPostcodeOptions {
|
|
7
|
-
scriptUrl?: string | null
|
|
12
|
+
scriptUrl?: string | null;
|
|
8
13
|
}
|
|
9
14
|
|
|
10
|
-
export function createVueDaumPostcode(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
export function createVueDaumPostcode(
|
|
16
|
+
options: CreateVueDaumPostcodeOptions = {}
|
|
17
|
+
) {
|
|
18
|
+
const scriptUrl =
|
|
19
|
+
options.scriptUrl ||
|
|
20
|
+
"//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js";
|
|
21
|
+
const loadDaumPostcode = once(() =>
|
|
22
|
+
load(scriptUrl).then(
|
|
23
|
+
() =>
|
|
24
|
+
new Promise<void>((resolve) =>
|
|
25
|
+
(window as any).daum.postcode.load(resolve)
|
|
26
|
+
)
|
|
27
|
+
)
|
|
28
|
+
);
|
|
15
29
|
|
|
16
30
|
return defineComponent({
|
|
17
31
|
props: {
|
|
18
32
|
q: {
|
|
19
33
|
type: String,
|
|
20
|
-
default:
|
|
34
|
+
default: "",
|
|
21
35
|
},
|
|
22
36
|
animation: {
|
|
23
37
|
type: Boolean,
|
|
@@ -76,18 +90,18 @@ export function createVueDaumPostcode(options: CreateVueDaumPostcodeOptions = {}
|
|
|
76
90
|
return {
|
|
77
91
|
styleHeight: 0 as string | number,
|
|
78
92
|
isLoaded: false,
|
|
79
|
-
}
|
|
93
|
+
};
|
|
80
94
|
},
|
|
81
95
|
mounted() {
|
|
82
96
|
loadDaumPostcode()
|
|
83
97
|
.then(() => {
|
|
84
|
-
this.isLoaded = true
|
|
85
|
-
return this.$nextTick()
|
|
98
|
+
this.isLoaded = true;
|
|
99
|
+
return this.$nextTick();
|
|
86
100
|
})
|
|
87
101
|
.then(() => {
|
|
88
102
|
new (window as any).daum.Postcode({
|
|
89
|
-
width:
|
|
90
|
-
height:
|
|
103
|
+
width: "100%",
|
|
104
|
+
height: "100%",
|
|
91
105
|
animation: this.animation,
|
|
92
106
|
autoMapping: !this.noAutoMapping,
|
|
93
107
|
shorthand: !this.noShorthand,
|
|
@@ -102,46 +116,53 @@ export function createVueDaumPostcode(options: CreateVueDaumPostcodeOptions = {}
|
|
|
102
116
|
theme: this.theme,
|
|
103
117
|
submitMode: !this.noSubmitMode,
|
|
104
118
|
onsearch: (data: VueDaumPostcodeSearchResult) => {
|
|
105
|
-
this.$emit(
|
|
119
|
+
this.$emit("search", data);
|
|
106
120
|
},
|
|
107
121
|
oncomplete: (data: VueDaumPostcodeCompleteResult) => {
|
|
108
|
-
this.$emit(
|
|
122
|
+
this.$emit("complete", data);
|
|
109
123
|
},
|
|
110
124
|
onresize: (data: VueDaumPostcodeResizeResult) => {
|
|
111
|
-
this.styleHeight = `${data.height}px
|
|
112
|
-
this.$emit(
|
|
125
|
+
this.styleHeight = `${data.height}px`;
|
|
126
|
+
this.$emit("resize", data);
|
|
113
127
|
},
|
|
114
128
|
}).embed(this.$refs.container, {
|
|
115
129
|
q: this.q,
|
|
116
130
|
autoClose: false,
|
|
117
|
-
})
|
|
118
|
-
this.$emit(
|
|
131
|
+
});
|
|
132
|
+
this.$emit("load");
|
|
119
133
|
})
|
|
134
|
+
.catch((e) => {
|
|
135
|
+
const error = new Error(`Load ${scriptUrl} failed.`);
|
|
136
|
+
error.cause = e;
|
|
137
|
+
this.$emit("error", error);
|
|
138
|
+
});
|
|
120
139
|
},
|
|
121
140
|
render() {
|
|
122
141
|
return h(
|
|
123
|
-
|
|
142
|
+
"div",
|
|
124
143
|
{
|
|
125
|
-
class: [
|
|
144
|
+
class: ["vue-daum-postcode"],
|
|
126
145
|
},
|
|
127
146
|
this.isLoaded || !this.$slots.loading
|
|
128
147
|
? [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
148
|
+
h("div", {
|
|
149
|
+
class: ["vue-daum-postcode-container"],
|
|
150
|
+
ref: "container",
|
|
151
|
+
style: {
|
|
152
|
+
height: this.styleHeight,
|
|
153
|
+
},
|
|
154
|
+
}),
|
|
155
|
+
]
|
|
137
156
|
: [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
157
|
+
h(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
class: ["vue-daum-postcode-loading"],
|
|
161
|
+
},
|
|
162
|
+
[this.$slots.loading()]
|
|
163
|
+
),
|
|
164
|
+
]
|
|
165
|
+
);
|
|
145
166
|
},
|
|
146
|
-
})
|
|
167
|
+
});
|
|
147
168
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
import { App, Plugin } from
|
|
2
|
-
|
|
3
|
-
import VueDaumPostcode from './VueDaumPostcode'
|
|
4
|
-
import { createVueDaumPostcode } from './createVueDaumPostcode'
|
|
5
|
-
import type { CreateVueDaumPostcodeOptions } from './createVueDaumPostcode'
|
|
6
|
-
import type { VueDaumPostcodeTheme, VueDaumPostcodeCompleteResult, VueDaumPostcodeSearchResult, VueDaumPostcodeResizeResult } from './interfaces'
|
|
1
|
+
import { App, Plugin } from "vue";
|
|
7
2
|
|
|
3
|
+
import VueDaumPostcode from "./VueDaumPostcode";
|
|
4
|
+
import { createVueDaumPostcode } from "./createVueDaumPostcode";
|
|
5
|
+
import type { CreateVueDaumPostcodeOptions } from "./createVueDaumPostcode";
|
|
6
|
+
import type {
|
|
7
|
+
VueDaumPostcodeTheme,
|
|
8
|
+
VueDaumPostcodeCompleteResult,
|
|
9
|
+
VueDaumPostcodeSearchResult,
|
|
10
|
+
VueDaumPostcodeResizeResult,
|
|
11
|
+
} from "./interfaces";
|
|
8
12
|
|
|
9
|
-
export interface VueDaumPostcodeInstallOptions
|
|
10
|
-
|
|
13
|
+
export interface VueDaumPostcodeInstallOptions
|
|
14
|
+
extends CreateVueDaumPostcodeOptions {
|
|
15
|
+
name?: string | null;
|
|
11
16
|
}
|
|
12
17
|
|
|
13
|
-
export function install(
|
|
14
|
-
app
|
|
18
|
+
export function install(
|
|
19
|
+
app: App,
|
|
20
|
+
{ name, ...options }: VueDaumPostcodeInstallOptions = {}
|
|
21
|
+
) {
|
|
22
|
+
app.component(
|
|
23
|
+
name ?? "VueDaumPostcode",
|
|
24
|
+
Object.keys(options).length > 0
|
|
25
|
+
? createVueDaumPostcode(options)
|
|
26
|
+
: VueDaumPostcode
|
|
27
|
+
);
|
|
15
28
|
}
|
|
16
29
|
|
|
17
30
|
const plugin: Plugin = {
|
|
18
31
|
install,
|
|
19
|
-
}
|
|
32
|
+
};
|
|
20
33
|
|
|
21
34
|
export {
|
|
22
35
|
plugin as default,
|
|
@@ -27,4 +40,4 @@ export {
|
|
|
27
40
|
VueDaumPostcodeCompleteResult,
|
|
28
41
|
VueDaumPostcodeSearchResult,
|
|
29
42
|
VueDaumPostcodeResizeResult,
|
|
30
|
-
}
|
|
43
|
+
};
|
package/src/interfaces.ts
CHANGED
|
@@ -1,64 +1,63 @@
|
|
|
1
|
-
|
|
2
1
|
export interface VueDaumPostcodeTheme {
|
|
3
|
-
bgColor?: string | null
|
|
4
|
-
searchBgColor?: string | null
|
|
5
|
-
contentBgColor?: string | null
|
|
6
|
-
pageBgColor?: string | null
|
|
7
|
-
textColor?: string | null
|
|
8
|
-
queryTextColor?: string | null
|
|
9
|
-
postcodeTextColor?: string | null
|
|
10
|
-
emphTextColor?: string | null
|
|
11
|
-
outlineColor?: string | null
|
|
2
|
+
bgColor?: string | null;
|
|
3
|
+
searchBgColor?: string | null;
|
|
4
|
+
contentBgColor?: string | null;
|
|
5
|
+
pageBgColor?: string | null;
|
|
6
|
+
textColor?: string | null;
|
|
7
|
+
queryTextColor?: string | null;
|
|
8
|
+
postcodeTextColor?: string | null;
|
|
9
|
+
emphTextColor?: string | null;
|
|
10
|
+
outlineColor?: string | null;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
export interface VueDaumPostcodeCompleteResult {
|
|
15
|
-
postcode: string
|
|
16
|
-
postcode1: string
|
|
17
|
-
postcode2: string
|
|
18
|
-
postcodeSeq: string
|
|
19
|
-
zonecode: string
|
|
20
|
-
address: string
|
|
21
|
-
addressEnglish: string
|
|
22
|
-
addressType: string
|
|
23
|
-
bcode: string
|
|
24
|
-
bname: string
|
|
25
|
-
bnameEnglish: string
|
|
26
|
-
bname1: string
|
|
27
|
-
bname1English: string
|
|
28
|
-
bname2: string
|
|
29
|
-
bname2English: string
|
|
30
|
-
sido: string
|
|
31
|
-
sidoEnglish: string
|
|
32
|
-
sigungu: string
|
|
33
|
-
sigunguEnglish: string
|
|
34
|
-
sigunguCode: string
|
|
35
|
-
userLanguageType: string
|
|
36
|
-
query: string
|
|
37
|
-
buildingName: string
|
|
38
|
-
buildingCode: string
|
|
39
|
-
apartment: string
|
|
40
|
-
jibunAddress: string
|
|
41
|
-
jibunAddressEnglish: string
|
|
42
|
-
roadAddress: string
|
|
43
|
-
roadAddressEnglish: string
|
|
44
|
-
autoRoadAddress: string
|
|
45
|
-
autoRoadAddressEnglish: string
|
|
46
|
-
autoJibunAddress: string
|
|
47
|
-
autoJibunAddressEnglish: string
|
|
48
|
-
userSelectedType: string
|
|
49
|
-
noSelected: string
|
|
50
|
-
hname: string
|
|
51
|
-
roadnameCode: string
|
|
52
|
-
roadname: string
|
|
53
|
-
roadnameEnglish: string
|
|
14
|
+
postcode: string;
|
|
15
|
+
postcode1: string;
|
|
16
|
+
postcode2: string;
|
|
17
|
+
postcodeSeq: string;
|
|
18
|
+
zonecode: string;
|
|
19
|
+
address: string;
|
|
20
|
+
addressEnglish: string;
|
|
21
|
+
addressType: string;
|
|
22
|
+
bcode: string;
|
|
23
|
+
bname: string;
|
|
24
|
+
bnameEnglish: string;
|
|
25
|
+
bname1: string;
|
|
26
|
+
bname1English: string;
|
|
27
|
+
bname2: string;
|
|
28
|
+
bname2English: string;
|
|
29
|
+
sido: string;
|
|
30
|
+
sidoEnglish: string;
|
|
31
|
+
sigungu: string;
|
|
32
|
+
sigunguEnglish: string;
|
|
33
|
+
sigunguCode: string;
|
|
34
|
+
userLanguageType: string;
|
|
35
|
+
query: string;
|
|
36
|
+
buildingName: string;
|
|
37
|
+
buildingCode: string;
|
|
38
|
+
apartment: string;
|
|
39
|
+
jibunAddress: string;
|
|
40
|
+
jibunAddressEnglish: string;
|
|
41
|
+
roadAddress: string;
|
|
42
|
+
roadAddressEnglish: string;
|
|
43
|
+
autoRoadAddress: string;
|
|
44
|
+
autoRoadAddressEnglish: string;
|
|
45
|
+
autoJibunAddress: string;
|
|
46
|
+
autoJibunAddressEnglish: string;
|
|
47
|
+
userSelectedType: string;
|
|
48
|
+
noSelected: string;
|
|
49
|
+
hname: string;
|
|
50
|
+
roadnameCode: string;
|
|
51
|
+
roadname: string;
|
|
52
|
+
roadnameEnglish: string;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
export interface VueDaumPostcodeSearchResult {
|
|
57
|
-
q: string
|
|
58
|
-
count: number
|
|
56
|
+
q: string;
|
|
57
|
+
count: number;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
export interface VueDaumPostcodeResizeResult {
|
|
62
|
-
width: number
|
|
63
|
-
height: number
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
64
63
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,o=Object.prototype.propertyIsEnumerable;import{defineComponent as n,h as a}from"vue";var i="undefined"==typeof document?Promise.reject(new Error("not supported")):(e,t={})=>new Promise(((o,n)=>{(document.head||document.body).appendChild(Object.assign(document.createElement("script"),t,{src:e,async:!0,onload:o,onerror:n}))}));function d(e={}){const t=function(e){let t=null;return()=>t||(t=Promise.resolve(e()))}((()=>i(e.scriptUrl||"//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js").then((()=>new Promise((e=>window.daum.postcode.load(e)))))));return n({props:{q:{type:String,default:""},animation:{type:Boolean,default:!1},noAutoMapping:{type:Boolean,default:!1},noShorthand:{type:Boolean,default:!1},noSubmitMode:{type:Boolean,default:!1},pleaseReadGuide:{type:Number,default:0},pleaseReadGuideTimer:{type:Number,default:1.5},maxSuggestItems:{type:Number,default:10},showMoreHName:{type:Boolean,default:!1},hideMapBtn:{type:Boolean,default:!1},hideEngBtn:{type:Boolean,default:!1},alwaysShowEngAddr:{type:Boolean,default:!1},zonecodeOnly:{type:Boolean,default:!1},theme:{type:Object,default:()=>({})}},data:()=>({styleHeight:0,isLoaded:!1}),mounted(){t().then((()=>(this.isLoaded=!0,this.$nextTick()))).then((()=>{new window.daum.Postcode({width:"100%",height:"100%",animation:this.animation,autoMapping:!this.noAutoMapping,shorthand:!this.noShorthand,pleaseReadGuide:this.pleaseReadGuide,pleaseReadGuideTimer:this.pleaseReadGuideTimer,maxSuggestItems:this.maxSuggestItems,showMoreHName:this.showMoreHName,hideMapBtn:this.hideMapBtn,hideEngBtn:this.hideEngBtn,alwaysShowEngAddr:this.alwaysShowEngAddr,zonecodeOnly:this.zonecodeOnly,theme:this.theme,submitMode:!this.noSubmitMode,onsearch:e=>{this.$emit("search",e)},oncomplete:e=>{this.$emit("complete",e)},onresize:e=>{this.styleHeight=`${e.height}px`,this.$emit("resize",e)}}).embed(this.$refs.container,{q:this.q,autoClose:!1}),this.$emit("load")}))},render(){return a("div",{class:["vue-daum-postcode"]},this.isLoaded||!this.$slots.loading?[a("div",{class:["vue-daum-postcode-container"],ref:"container",style:{height:this.styleHeight}})]:[a("div",{class:["vue-daum-postcode-loading"]},[this.$slots.loading()])])}})}const s=d();function r(n,a={}){var{name:i}=a,r=((n,a)=>{var i={};for(var d in n)e.call(n,d)&&a.indexOf(d)<0&&(i[d]=n[d]);if(null!=n&&t)for(var d of t(n))a.indexOf(d)<0&&o.call(n,d)&&(i[d]=n[d]);return i})(a,["name"]);n.component(null!=i?i:"VueDaumPostcode",Object.keys(r).length>0?d(r):s)}const l={install:r};export default l;export{s as VueDaumPostcode,d as createVueDaumPostcode,r as install};
|
|
2
|
-
//# sourceMappingURL=vue-daum-postcode.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vue-daum-postcode.es.js","sources":["../node_modules/nano-loader/index.esm.js","../src/createVueDaumPostcode.ts","../src/VueDaumPostcode.ts","../src/index.ts"],"sourcesContent":["function r(o){let e=null;return()=>e||(e=Promise.resolve(o()))}var d=typeof document==\"undefined\"?Promise.reject(new Error(\"not supported\")):(o,e={})=>new Promise((t,n)=>{(document.head||document.body).appendChild(Object.assign(document.createElement(\"script\"),e,{src:o,async:!0,onload:t,onerror:n}))});export{r as defer,d as load};\n","import { defer, load } from 'nano-loader'\nimport { defineComponent, PropType, h } from 'vue'\n\nimport type { VueDaumPostcodeCompleteResult, VueDaumPostcodeResizeResult, VueDaumPostcodeSearchResult, VueDaumPostcodeTheme } from './interfaces'\n\nexport interface CreateVueDaumPostcodeOptions {\n scriptUrl?: string | null\n}\n\nexport function createVueDaumPostcode(options: CreateVueDaumPostcodeOptions = {}) {\n const loadDaumPostcode = defer(\n () => load(options.scriptUrl || '//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js')\n .then(() => new Promise<void>(resolve => (window as any).daum.postcode.load(resolve)))\n )\n\n return defineComponent({\n props: {\n q: {\n type: String,\n default: '',\n },\n animation: {\n type: Boolean,\n default: false,\n },\n noAutoMapping: {\n type: Boolean,\n default: false,\n },\n noShorthand: {\n type: Boolean,\n default: false,\n },\n noSubmitMode: {\n type: Boolean,\n default: false,\n },\n pleaseReadGuide: {\n type: Number,\n default: 0,\n },\n pleaseReadGuideTimer: {\n type: Number,\n default: 1.5,\n },\n maxSuggestItems: {\n type: Number,\n default: 10,\n },\n showMoreHName: {\n type: Boolean,\n default: false,\n },\n hideMapBtn: {\n type: Boolean,\n default: false,\n },\n hideEngBtn: {\n type: Boolean,\n default: false,\n },\n alwaysShowEngAddr: {\n type: Boolean,\n default: false,\n },\n zonecodeOnly: {\n type: Boolean,\n default: false,\n },\n theme: {\n type: Object as PropType<VueDaumPostcodeTheme>,\n default: () => ({}),\n },\n },\n data() {\n return {\n styleHeight: 0 as string | number,\n isLoaded: false,\n }\n },\n mounted() {\n loadDaumPostcode()\n .then(() => {\n this.isLoaded = true\n return this.$nextTick()\n })\n .then(() => {\n new (window as any).daum.Postcode({\n width: '100%',\n height: '100%',\n animation: this.animation,\n autoMapping: !this.noAutoMapping,\n shorthand: !this.noShorthand,\n pleaseReadGuide: this.pleaseReadGuide,\n pleaseReadGuideTimer: this.pleaseReadGuideTimer,\n maxSuggestItems: this.maxSuggestItems,\n showMoreHName: this.showMoreHName,\n hideMapBtn: this.hideMapBtn,\n hideEngBtn: this.hideEngBtn,\n alwaysShowEngAddr: this.alwaysShowEngAddr,\n zonecodeOnly: this.zonecodeOnly,\n theme: this.theme,\n submitMode: !this.noSubmitMode,\n onsearch: (data: VueDaumPostcodeSearchResult) => {\n this.$emit('search', data)\n },\n oncomplete: (data: VueDaumPostcodeCompleteResult) => {\n this.$emit('complete', data)\n },\n onresize: (data: VueDaumPostcodeResizeResult) => {\n this.styleHeight = `${data.height}px`\n this.$emit('resize', data)\n },\n }).embed(this.$refs.container, {\n q: this.q,\n autoClose: false,\n })\n this.$emit('load')\n })\n },\n render() {\n return h(\n 'div',\n {\n class: ['vue-daum-postcode'],\n },\n this.isLoaded || !this.$slots.loading\n ? [\n h('div', {\n class: ['vue-daum-postcode-container'],\n ref: 'container',\n style: {\n height: this.styleHeight,\n },\n }),\n ]\n : [\n h('div', {\n class: ['vue-daum-postcode-loading'],\n }, [\n this.$slots.loading(),\n ]),\n ]\n )\n },\n })\n}\n","import { createVueDaumPostcode } from './createVueDaumPostcode'\n\nconst VueDaumPostcode = createVueDaumPostcode()\n\nexport default VueDaumPostcode\n","import { App, Plugin } from 'vue'\n\nimport VueDaumPostcode from './VueDaumPostcode'\nimport { createVueDaumPostcode } from './createVueDaumPostcode'\nimport type { CreateVueDaumPostcodeOptions } from './createVueDaumPostcode'\nimport type { VueDaumPostcodeTheme, VueDaumPostcodeCompleteResult, VueDaumPostcodeSearchResult, VueDaumPostcodeResizeResult } from './interfaces'\n\n\nexport interface VueDaumPostcodeInstallOptions extends CreateVueDaumPostcodeOptions {\n name?: string | null\n}\n\nexport function install(app: App, { name, ...options }: VueDaumPostcodeInstallOptions = {}) {\n app.component(name ?? 'VueDaumPostcode', Object.keys(options).length > 0 ? createVueDaumPostcode(options) : VueDaumPostcode)\n}\n\nconst plugin: Plugin = {\n install,\n}\n\nexport {\n plugin as default,\n createVueDaumPostcode,\n CreateVueDaumPostcodeOptions,\n VueDaumPostcodeTheme,\n VueDaumPostcode,\n VueDaumPostcodeCompleteResult,\n VueDaumPostcodeSearchResult,\n VueDaumPostcodeResizeResult,\n}\n"],"names":["d","document","Promise","reject","Error","o","e","t","n","head","body","appendChild","Object","assign","createElement","src","async","onload","onerror","options","loadDaumPostcode","resolve","defer","load","scriptUrl","then","window","daum","postcode","defineComponent","props","q","type","String","default","animation","Boolean","noAutoMapping","noShorthand","noSubmitMode","pleaseReadGuide","Number","pleaseReadGuideTimer","maxSuggestItems","showMoreHName","hideMapBtn","hideEngBtn","alwaysShowEngAddr","zonecodeOnly","theme","data","styleHeight","isLoaded","[object Object]","this","$nextTick","Postcode","width","height","autoMapping","shorthand","submitMode","onsearch","$emit","oncomplete","onresize","embed","$refs","container","autoClose","h","class","$slots","loading","ref","style","VueDaumPostcode","createVueDaumPostcode","app","_a","name","component","keys","length","plugin","install"],"mappings":"0JAA+D,IAAIA,EAAmB,oBAAVC,SAAsBC,QAAQC,OAAO,IAAIC,MAAM,kBAAkB,CAACC,EAAEC,EAAE,KAAK,IAAIJ,SAAQ,CAACK,EAAEC,eAAeC,MAAMR,SAASS,MAAMC,YAAYC,OAAOC,OAAOZ,SAASa,cAAc,UAAUR,EAAE,CAACS,IAAIV,EAAEW,OAAM,EAAGC,OAAOV,EAAEW,QAAQV,mBCSlQW,EAAwC,UACtEC,EDVR,SAAWf,OAAOC,EAAE,WAAW,IAAIA,MAAMJ,QAAQmB,QAAQhB,MCU9BiB,EACvB,IAAMC,EAAKJ,EAAQK,WAAa,iEAC7BC,MAAK,IAAM,IAA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