vue-daum-postcode 0.9.0 → 0.10.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 +13 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -8
- package/src/create-vue-daum-postcode.js +51 -37
package/README.md
CHANGED
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
[Daum 우편번호 서비스](http://postcode.map.daum.net/guide)를 기반으로 작업된 Vue Component 입니다.
|
|
14
14
|
|
|
15
|
+
Vue 3.x를 사용하다면 [main branch](https://github.com/wan2land/vue-daum-postcode/tree/main)브랜치를 참고해주세요.
|
|
16
|
+
|
|
15
17
|
## Installation
|
|
16
18
|
|
|
17
19
|
```
|
|
18
|
-
npm install vue-daum-postcode --save
|
|
20
|
+
npm install vue-daum-postcode@legacy --save
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
### Demo
|
|
@@ -81,8 +83,8 @@ Webpack과 같은 번들러를 사용하지 않는 경우 다음과 같이 사
|
|
|
81
83
|
<div id="app">
|
|
82
84
|
<vue-daum-postcode />
|
|
83
85
|
</div>
|
|
84
|
-
<script src="//cdn.jsdelivr.net/npm/vue/dist/vue.
|
|
85
|
-
<script src="//cdn.jsdelivr.net/
|
|
86
|
+
<script src="//cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
|
|
87
|
+
<script src="//cdn.jsdelivr.net/npm/vue-daum-postcode/dist/index.js"></script>
|
|
86
88
|
<script>
|
|
87
89
|
new Vue({
|
|
88
90
|
el: '#app'
|
|
@@ -163,8 +165,16 @@ export default {
|
|
|
163
165
|
|
|
164
166
|
이름 | 설명
|
|
165
167
|
------------------------- | -----------
|
|
168
|
+
`load` | 다음 우편번호가 로딩 되었을 때 발생
|
|
166
169
|
`search` | [Daum 우편번호, 속성](http://postcode.map.daum.net/guide)에서 `onsearch`.
|
|
167
170
|
`complete` | [Daum 우편번호, 속성](http://postcode.map.daum.net/guide)에서 `oncomplete`.
|
|
171
|
+
`error` | 스크립트 로딩 실패시 발생
|
|
172
|
+
|
|
173
|
+
## Slots
|
|
174
|
+
|
|
175
|
+
이름 | 설명
|
|
176
|
+
------------------------- | ---------
|
|
177
|
+
`loading` | 다음 우편번호가 아직 완전히 불러오기 전에 보여줄 내용이 있는 경우 해당 슬롯에 넣습니다. (ex. spinner)
|
|
168
178
|
|
|
169
179
|
## License
|
|
170
180
|
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r={};function a(e){let t=null;return()=>{try{return t||(t=Promise.resolve(e()).catch(e=>{throw t=null,e}))}catch(e){return Promise.reject(e)}}}((t,n)=>{for(var o in n)e(t,o,{get:n[o],enumerable:!0})})(r,{defer:()=>i,load:()=>d,once:()=>a});var u,i=a,d=(e,t)=>new Promise((n,o)=>{(document.head||document.body).appendChild(Object.assign(document.createElement("script"),t,{src:e,async:!0,onload:n,onerror:o}))});typeof document>"u"&&(d=()=>Promise.reject(new Error("load is not supported in nodejs"))),u=r,((r,a,u,i)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let d of n(a))!o.call(r,d)&&d!==u&&e(r,d,{get:()=>a[d],enumerable:!(i=t(a,d))||i.enumerable})})(e({},"__esModule",{value:!0}),u)})()},function(e,t,n){"use strict";n.r(t),n.d(t,"install",(function(){return d})),n.d(t,"VueDaumPostcode",(function(){return a}));var o=n(0);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.scriptUrl||"//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js",n=Object(o.once)((function(){return Object(o.load)(t).then((function(){return new Promise((function(e){return window.daum.postcode.load(e)}))}))}));return{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:function(){return{}}}},data:function(){return{styleHeight:0,isLoaded:!1}},mounted:function(){var e=this;n().then((function(){e.isLoaded=!0,e.$nextTick((function(){new window.daum.Postcode({width:"100%",height:"100%",animation:e.animation,autoMapping:!e.noAutoMapping,shorthand:!e.noShorthand,pleaseReadGuide:e.pleaseReadGuide,pleaseReadGuideTimer:e.pleaseReadGuideTimer,maxSuggestItems:e.maxSuggestItems,showMoreHName:e.showMoreHName,hideMapBtn:e.hideMapBtn,hideEngBtn:e.hideEngBtn,alwaysShowEngAddr:e.alwaysShowEngAddr,zonecodeOnly:e.zonecodeOnly,theme:e.theme,submitMode:!e.noSubmitMode,onsearch:function(t){e.$emit("search",t)},oncomplete:function(t){e.$emit("complete",t)},onresize:function(t){e.styleHeight="".concat(t.height,"px")}}).embed(e.$refs.container,{q:e.q,autoClose:!1}),e.$emit("load")}))})).catch((function(n){var o=new Error("Load ".concat(t," failed."));o.cause=n,e.$emit("error",o)}))},computed:{styles:function(){var e={};return e.height=this.styleHeight,e}},render:function(e){return e("div",{class:["vue-daum-postcode"]},this.isLoaded||!this.$slots.loading?[e("div",{class:["vue-daum-postcode-container"],ref:"container",style:this.styles})]:[e("div",{class:["vue-daum-postcode-loading"]},this.$slots.loading)])}}}var a=r(),u=["name"];function i(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.name,o=i(t,u);e.component(n||"vue-daum-postcode",Object.keys(o).length>0?r(o):a)}"undefined"!=typeof window&&window.Vue&&d(window.Vue);t.default={install:d}}])}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./node_modules/nano-loader/index.min.js","webpack:///./src/create-vue-daum-postcode.js","webpack:///./src/vue-daum-postcode.js","webpack:///./src/index.js"],"names":["root","factory","exports","module","define","amd","a","i","window","installedModules","__webpack_require__","moduleId","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","e","Promise","document","head","body","appendChild","assign","createElement","src","async","charset","then","Error","load","createVueDaumPostcode","options","loadDaumPostcode","scriptUrl","resolve","daum","postcode","props","q","type","String","default","animation","Boolean","noAutoMapping","noShorthand","noSubmitMode","pleaseReadGuide","Number","pleaseReadGuideTimer","maxSuggestItems","showMoreHName","hideMapBtn","hideEngBtn","alwaysShowEngAddr","zonecodeOnly","theme","data","styleHeight","mounted","Postcode","width","height","autoMapping","shorthand","submitMode","onsearch","$emit","oncomplete","onresize","size","embed","$refs","container","autoClose","computed","styles","this","render","h","class","ref","style","install","Vue","remainOptions","component","keys","length","VueDaumPostcode"],"m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O,CAAC,+BAAgCC,IAAK,YAAaC,MAAOL,KAAKD,a,+FClHzE9C,U,oXCCR,SAASqD,EAAQC,GAAmB,IAAdrD,EAAc,uDAAJ,GAC7BxC,EAA2BwC,EAA3BxC,KAAS8F,EADwB,EACNtD,EADM,UAEzCqD,EAAIE,UAAU/F,GAAQ,oBAAqBG,OAAO6F,KAAKF,GAAeG,OAAS,EAAI1D,EAAsBuD,GAAiBI,GAGtG,oBAAX5G,QAA0BA,OAAOuG,KAC1CD,EAAQtG,OAAOuG,KAOF,WACbD","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","export function create(e,n){let o=null;return()=>o||(o=load(e,n))}export function load(e,n){return new Promise((o,t)=>{(document.head||document.body).appendChild(Object.assign(document.createElement(\"script\"),{src:e,async:!0,charset:\"utf8\",onload(){const e=n&&n();e instanceof Promise?e.then(o):o()},onerror(){t(new Error(`Failed to load ${e}`))}}))})}","import { create } from 'nano-loader'\n\nexport function createVueDaumPostcode(options = {}) {\n const loadDaumPostcode = create(\n options.scriptUrl || 'https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js',\n () => {\n return new Promise(resolve => window.daum.postcode.load(resolve))\n },\n )\n\n return {\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,\n default: () => ({}),\n },\n },\n data() {\n return {\n styleHeight: 0,\n }\n },\n mounted() {\n loadDaumPostcode().then(() => {\n new window.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) => {\n this.$emit('search', data)\n },\n oncomplete: (data) => {\n this.$emit('complete', data)\n },\n onresize: (size) => {\n this.styleHeight = `${size.height}px`\n },\n }).embed(this.$refs.container, {\n q: this.q,\n autoClose: false,\n })\n })\n },\n computed: {\n styles() {\n const styles = {}\n styles.height = this.styleHeight\n return styles\n },\n },\n render(h) {\n return h('div', {class: ['vue-daum-postcode']}, [\n h('div', {class: ['vue-daum-postcode-container'], ref: 'container', style: this.styles})\n ])\n },\n }\n}\n","import { createVueDaumPostcode } from './create-vue-daum-postcode'\n\nexport default createVueDaumPostcode()\n","import { createVueDaumPostcode } from './create-vue-daum-postcode'\nimport VueDaumPostcode from './vue-daum-postcode'\n\nexport function install(Vue, options = {}) {\n const { name, ...remainOptions } = options\n Vue.component(name || 'vue-daum-postcode', Object.keys(remainOptions).length > 0 ? createVueDaumPostcode(remainOptions) : VueDaumPostcode)\n}\n\nif (typeof window !== 'undefined' && window.Vue) {\n install(window.Vue)\n}\n\nexport {\n VueDaumPostcode,\n}\n\nexport default {\n install,\n}\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./node_modules/nano-loader/index.iife.js","webpack:///./src/create-vue-daum-postcode.js","webpack:///./src/vue-daum-postcode.js","webpack:///./src/index.js"],"names":["root","factory","exports","module","define","amd","a","i","window","installedModules","__webpack_require__","moduleId","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","getOwnPropertyDescriptor","getOwnPropertyNames","y","e","Promise","resolve","catch","reject","defer","P","load","once","document","head","body","appendChild","assign","createElement","src","async","onload","onerror","Error","createVueDaumPostcode","options","scriptUrl","loadDaumPostcode","then","daum","postcode","props","q","type","String","default","animation","Boolean","noAutoMapping","noShorthand","noSubmitMode","pleaseReadGuide","Number","pleaseReadGuideTimer","maxSuggestItems","showMoreHName","hideMapBtn","hideEngBtn","alwaysShowEngAddr","zonecodeOnly","theme","data","styleHeight","isLoaded","mounted","$nextTick","Postcode","width","height","autoMapping","shorthand","submitMode","onsearch","$emit","oncomplete","onresize","size","embed","$refs","container","autoClose","error","cause","computed","styles","this","render","h","class","$slots","loading","ref","style","install","Vue","remainOptions","component","keys","length","VueDaumPostcode"],"mappings":"CAAA,SAA2CA,EAAMC,GA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AAS6G,EAAjB,EAAmC5D,EAAnC,GACA2D,EAAIE,UAAU9G,GAAQ,oBAAqBG,OAAO4G,KAAKF,GAAeG,OAAS,EAAIhE,EAAsB6D,GAAiBI,GAGtG,oBAAX3H,QAA0BA,OAAOsH,KAC1CD,EAAQrH,OAAOsH,KAOF,WACbD","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","\"use strict\";var NanoLoader=(()=>{var i=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var a=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},p=(t,e,o,n)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let r of l(e))!m.call(t,r)&&r!==o&&i(t,r,{get:()=>e[r],enumerable:!(n=d(e,r))||n.enumerable});return t};var u=t=>p(i({},\"__esModule\",{value:!0}),t);var y={};a(y,{defer:()=>P,load:()=>c,once:()=>s});function s(t){let e=null;return()=>{try{return e||(e=Promise.resolve(t()).catch(o=>{throw e=null,o}))}catch(o){return Promise.reject(o)}}}var P=s,c=(t,e)=>new Promise((o,n)=>{(document.head||document.body).appendChild(Object.assign(document.createElement(\"script\"),e,{src:t,async:!0,onload:o,onerror:n}))});typeof document>\"u\"&&(c=()=>Promise.reject(new Error(\"load is not supported in nodejs\")));return u(y);})();\n","import { once, load } from 'nano-loader'\n\nexport function createVueDaumPostcode(options = {}) {\n const scriptUrl = options.scriptUrl || '//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js';\n const loadDaumPostcode = once(\n () => load(scriptUrl)\n .then(() => new Promise(resolve => window.daum.postcode.load(resolve)))\n )\n\n return {\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,\n default: () => ({}),\n },\n },\n data() {\n return {\n styleHeight: 0,\n isLoaded: false,\n }\n },\n mounted() {\n loadDaumPostcode().then(() => {\n this.isLoaded = true\n this.$nextTick(() => {\n new window.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) => {\n this.$emit('search', data)\n },\n oncomplete: (data) => {\n this.$emit('complete', data)\n },\n onresize: (size) => {\n this.styleHeight = `${size.height}px`\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 computed: {\n styles() {\n const styles = {}\n styles.height = this.styleHeight\n return styles\n },\n },\n render(h) {\n return h(\n 'div',\n {\n class: ['vue-daum-postcode']\n },\n this.isLoaded || !this.$slots.loading\n ? [h('div', { class: ['vue-daum-postcode-container'], ref: 'container', style: this.styles })]\n : [h('div', { class: ['vue-daum-postcode-loading'] }, this.$slots.loading)]\n )\n },\n }\n}\n","import { createVueDaumPostcode } from './create-vue-daum-postcode'\n\nexport default createVueDaumPostcode()\n","import { createVueDaumPostcode } from './create-vue-daum-postcode'\nimport VueDaumPostcode from './vue-daum-postcode'\n\nexport function install(Vue, options = {}) {\n const { name, ...remainOptions } = options\n Vue.component(name || 'vue-daum-postcode', Object.keys(remainOptions).length > 0 ? createVueDaumPostcode(remainOptions) : VueDaumPostcode)\n}\n\nif (typeof window !== 'undefined' && window.Vue) {\n install(window.Vue)\n}\n\nexport {\n VueDaumPostcode,\n}\n\nexport default {\n install,\n}\n"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-daum-postcode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"title": "Vue Daum Postcode",
|
|
5
5
|
"description": "Daum Postcode Component for Vue.js.",
|
|
6
6
|
"author": "Changwan Jun",
|
|
@@ -27,25 +27,24 @@
|
|
|
27
27
|
},
|
|
28
28
|
"main": "dist/index.js",
|
|
29
29
|
"types": "dist/index.d.ts",
|
|
30
|
-
"dependencies": {},
|
|
31
30
|
"devDependencies": {
|
|
32
|
-
"@babel/core": "7.
|
|
33
|
-
"@babel/preset-env": "7.
|
|
31
|
+
"@babel/core": "7.10.5",
|
|
32
|
+
"@babel/preset-env": "7.10.4",
|
|
34
33
|
"babel-loader": "8.1.0",
|
|
35
34
|
"cross-env": "7.0.2",
|
|
36
|
-
"css-loader": "3.
|
|
35
|
+
"css-loader": "3.6.0",
|
|
37
36
|
"html-webpack-plugin": "4.3.0",
|
|
38
37
|
"mini-css-extract-plugin": "0.9.0",
|
|
39
|
-
"nano-loader": "
|
|
38
|
+
"nano-loader": "1.1.0",
|
|
40
39
|
"push-dir": "0.4.1",
|
|
41
40
|
"rimraf": "3.0.2",
|
|
42
41
|
"vue": "2.6.11",
|
|
43
42
|
"vue-highlightjs": "1.3.3",
|
|
44
|
-
"vue-loader": "15.9.
|
|
43
|
+
"vue-loader": "15.9.3",
|
|
45
44
|
"vue-style-loader": "4.1.2",
|
|
46
45
|
"vue-template-compiler": "2.6.11",
|
|
47
46
|
"webpack": "4.43.0",
|
|
48
|
-
"webpack-cli": "3.3.
|
|
47
|
+
"webpack-cli": "3.3.12",
|
|
49
48
|
"webpack-dev-server": "3.11.0"
|
|
50
49
|
}
|
|
51
50
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { once, load } from 'nano-loader'
|
|
2
2
|
|
|
3
3
|
export function createVueDaumPostcode(options = {}) {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
() =>
|
|
7
|
-
|
|
8
|
-
},
|
|
4
|
+
const scriptUrl = options.scriptUrl || '//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js';
|
|
5
|
+
const loadDaumPostcode = once(
|
|
6
|
+
() => load(scriptUrl)
|
|
7
|
+
.then(() => new Promise(resolve => window.daum.postcode.load(resolve)))
|
|
9
8
|
)
|
|
10
9
|
|
|
11
10
|
return {
|
|
@@ -70,39 +69,48 @@ export function createVueDaumPostcode(options = {}) {
|
|
|
70
69
|
data() {
|
|
71
70
|
return {
|
|
72
71
|
styleHeight: 0,
|
|
72
|
+
isLoaded: false,
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
mounted() {
|
|
76
76
|
loadDaumPostcode().then(() => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
77
|
+
this.isLoaded = true
|
|
78
|
+
this.$nextTick(() => {
|
|
79
|
+
new window.daum.Postcode({
|
|
80
|
+
width: '100%',
|
|
81
|
+
height: '100%',
|
|
82
|
+
animation: this.animation,
|
|
83
|
+
autoMapping: !this.noAutoMapping,
|
|
84
|
+
shorthand: !this.noShorthand,
|
|
85
|
+
pleaseReadGuide: this.pleaseReadGuide,
|
|
86
|
+
pleaseReadGuideTimer: this.pleaseReadGuideTimer,
|
|
87
|
+
maxSuggestItems: this.maxSuggestItems,
|
|
88
|
+
showMoreHName: this.showMoreHName,
|
|
89
|
+
hideMapBtn: this.hideMapBtn,
|
|
90
|
+
hideEngBtn: this.hideEngBtn,
|
|
91
|
+
alwaysShowEngAddr: this.alwaysShowEngAddr,
|
|
92
|
+
zonecodeOnly: this.zonecodeOnly,
|
|
93
|
+
theme: this.theme,
|
|
94
|
+
submitMode: !this.noSubmitMode,
|
|
95
|
+
onsearch: (data) => {
|
|
96
|
+
this.$emit('search', data)
|
|
97
|
+
},
|
|
98
|
+
oncomplete: (data) => {
|
|
99
|
+
this.$emit('complete', data)
|
|
100
|
+
},
|
|
101
|
+
onresize: (size) => {
|
|
102
|
+
this.styleHeight = `${size.height}px`
|
|
103
|
+
},
|
|
104
|
+
}).embed(this.$refs.container, {
|
|
105
|
+
q: this.q,
|
|
106
|
+
autoClose: false,
|
|
107
|
+
})
|
|
108
|
+
this.$emit('load')
|
|
105
109
|
})
|
|
110
|
+
}).catch((e) => {
|
|
111
|
+
const error = new Error(`Load ${scriptUrl} failed.`);
|
|
112
|
+
error.cause = e;
|
|
113
|
+
this.$emit("error", error);
|
|
106
114
|
})
|
|
107
115
|
},
|
|
108
116
|
computed: {
|
|
@@ -113,9 +121,15 @@ export function createVueDaumPostcode(options = {}) {
|
|
|
113
121
|
},
|
|
114
122
|
},
|
|
115
123
|
render(h) {
|
|
116
|
-
return h(
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
return h(
|
|
125
|
+
'div',
|
|
126
|
+
{
|
|
127
|
+
class: ['vue-daum-postcode']
|
|
128
|
+
},
|
|
129
|
+
this.isLoaded || !this.$slots.loading
|
|
130
|
+
? [h('div', { class: ['vue-daum-postcode-container'], ref: 'container', style: this.styles })]
|
|
131
|
+
: [h('div', { class: ['vue-daum-postcode-loading'] }, this.$slots.loading)]
|
|
132
|
+
)
|
|
119
133
|
},
|
|
120
134
|
}
|
|
121
135
|
}
|