From 1fa9959cdf33017e239f2794c9f550c4b8b6d63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=9APS=E7=9A=84=E5=B0=8F=E7=A0=81=E5=86=9C?= <747357766@qq.com> Date: Sat, 26 Mar 2022 16:21:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E5=92=8C=E5=9C=B0=E5=9D=80=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .babelrc | 6 + .editorconfig | 9 + .editorconfig copy | 14 + .eslintignore | 2 + .eslintrc.json | 33 + .gitignore | 5 + LICENSE | 22 + README.md | 75 + build/webpack.dev.config.js | 60 + build/webpack.prod.config.js | 42 + dist/v-distpicker.js | 1 + docs/bundle.ae5da5107a6bbf9c0352.js | 26 + docs/bundle.ae5da5107a6bbf9c0352.js.map | 1 + docs/index.html | 173 + docs/vendor.87f6b9a6cf09cc79d59b.js | 10 + docs/vendor.87f6b9a6cf09cc79d59b.js.map | 1 + examples/App.vue | 22 + examples/assets/favicon.ico | Bin 0 -> 67646 bytes examples/assets/v-distpicker.png | Bin 0 -> 29458 bytes examples/components/index.vue | 26 + examples/css/styles.css | 175 + examples/index.html | 21 + examples/main.js | 7 + index.d.ts | 19 + index.js | 3 + package-lock.json1 | 10641 ++++++++++++++++++++++ package.json | 54 + scripts/dev.sh | 14 + scripts/release.sh | 30 + src/Distpicker.vue | 114 + src/districts.js | 4599 ++++++++++ src/index.js | 5 + src/lib/address-json.js | 18 + src/lib/address-parse.js | 544 ++ src/lib/areas.json | 1 + src/lib/cities.json | 1 + src/lib/getMcaGovData.js | 185 + src/lib/names.json | 506 + src/lib/pca-code.json | 1 + src/lib/provinceList.json | 1 + src/lib/provinces.json | 1 + yarn.lock | 6632 ++++++++++++++ 42 files changed, 24100 insertions(+) create mode 100644 .babelrc create mode 100644 .editorconfig create mode 100644 .editorconfig copy create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 build/webpack.dev.config.js create mode 100644 build/webpack.prod.config.js create mode 100644 dist/v-distpicker.js create mode 100644 docs/bundle.ae5da5107a6bbf9c0352.js create mode 100644 docs/bundle.ae5da5107a6bbf9c0352.js.map create mode 100644 docs/index.html create mode 100644 docs/vendor.87f6b9a6cf09cc79d59b.js create mode 100644 docs/vendor.87f6b9a6cf09cc79d59b.js.map create mode 100644 examples/App.vue create mode 100644 examples/assets/favicon.ico create mode 100644 examples/assets/v-distpicker.png create mode 100644 examples/components/index.vue create mode 100644 examples/css/styles.css create mode 100644 examples/index.html create mode 100644 examples/main.js create mode 100644 index.d.ts create mode 100644 index.js create mode 100644 package-lock.json1 create mode 100644 package.json create mode 100644 scripts/dev.sh create mode 100644 scripts/release.sh create mode 100644 src/Distpicker.vue create mode 100644 src/districts.js create mode 100644 src/index.js create mode 100644 src/lib/address-json.js create mode 100644 src/lib/address-parse.js create mode 100644 src/lib/areas.json create mode 100644 src/lib/cities.json create mode 100644 src/lib/getMcaGovData.js create mode 100644 src/lib/names.json create mode 100644 src/lib/pca-code.json create mode 100644 src/lib/provinceList.json create mode 100644 src/lib/provinces.json create mode 100644 yarn.lock diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..7487ad4 --- /dev/null +++ b/.babelrc @@ -0,0 +1,6 @@ +{ + "presets": [ + ["@babel/preset-env"] + ], + "plugins": ["@babel/plugin-transform-runtime"] +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9d08a1a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.editorconfig copy b/.editorconfig copy new file mode 100644 index 0000000..ecd17e7 --- /dev/null +++ b/.editorconfig copy @@ -0,0 +1,14 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.json] +indent_size = 2 +indent_style = space diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..3675648 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +node_modules/* +build/* diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..af57ce3 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,33 @@ +{ + "parser": "babel-eslint", + "env": { + "browser": true, + "commonjs": true, + "es6": true, + "node": true + }, + "parserOptions": { + "ecmaVersion": 8, + "sourceType": "module" + }, + "rules": { + "no-const-assign": "warn", + "no-this-before-super": "warn", + "no-undef": "warn", + "no-unreachable": "warn", + "no-unused-vars": "warn", + "constructor-super": "warn", + "valid-typeof": "warn", + "semi": [ + "warn", + "never" + ], + "quotes": [ + "warn", + "single" + ], + "arrow-parens": 0, + "generator-star-spacing": 0, + "space-before-function-paren": 0 + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..580ebce --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.DS_Store +node_modules/ +npm-debug.log +yarn-error.log +.idea diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ebf67ad --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2018 Christoph von Gellhorn +Copyright (c) 2022 Edison Liu + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..747c2f9 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +
+
+
A flexible, highly available district selector for picking provinces, cities and districts of China.
+ +# V - Distpicker + +Here is [documents](http://distpicker.pigjian.com/) + +## Installation + +```javascript +npm install v-distpicker --save +``` + +Or + +```javascript +yarn add v-distpicker --save +``` + +## Usage + +**Register component** + +Registe global component: + +```javascript +import Distpicker from 'v-distpicker' + +Vue.component('v-distpicker', Distpicker) +``` + +Registe component: + +```javascript +import VDistpicker from 'v-distpicker' + +export default { + components: { VDistpicker } +} +``` + +**How to use** + +Basic: + +```javascript +