├── .circleci
└── config.yml
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── .releaserc.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── README_2VERSION.md
├── babel.config.js
├── build
├── bundlesConfigs.js
├── constants.js
├── postcss.js
└── rollup.config.js
├── codecov.yml
├── cypress.json
├── gh-pages-src
├── App.vue
├── SwitchTheme.vue
├── babel.config.js
├── countries.json
├── flags
│ ├── abw.svg
│ ├── afg.svg
│ ├── ago.svg
│ ├── aia.svg
│ ├── ala.svg
│ ├── alb.svg
│ ├── and.svg
│ ├── are.svg
│ ├── arg.svg
│ ├── arm.svg
│ ├── asm.svg
│ ├── ata.svg
│ ├── atf.svg
│ ├── atg.svg
│ ├── aus.svg
│ ├── aut.svg
│ ├── aze.svg
│ ├── bdi.svg
│ ├── bel.svg
│ ├── ben.svg
│ ├── bes.svg
│ ├── bfa.svg
│ ├── bgd.svg
│ ├── bgr.svg
│ ├── bhr.svg
│ ├── bhs.svg
│ ├── bih.svg
│ ├── blm.svg
│ ├── blr.svg
│ ├── blz.svg
│ ├── bmu.svg
│ ├── bol.svg
│ ├── bra.svg
│ ├── brb.svg
│ ├── brn.svg
│ ├── btn.svg
│ ├── bvt.svg
│ ├── bwa.svg
│ ├── caf.svg
│ ├── can.svg
│ ├── cck.svg
│ ├── che.svg
│ ├── chl.svg
│ ├── chn.svg
│ ├── civ.svg
│ ├── cmr.svg
│ ├── cod.svg
│ ├── cog.svg
│ ├── cok.svg
│ ├── col.svg
│ ├── com.svg
│ ├── cpv.svg
│ ├── cri.svg
│ ├── cub.svg
│ ├── cuw.svg
│ ├── cxr.svg
│ ├── cym.svg
│ ├── cyp.svg
│ ├── cze.svg
│ ├── deu.svg
│ ├── dji.svg
│ ├── dma.svg
│ ├── dnk.svg
│ ├── dom.svg
│ ├── dza.svg
│ ├── ecu.svg
│ ├── egy.svg
│ ├── eri.svg
│ ├── esh.svg
│ ├── esp.svg
│ ├── est.svg
│ ├── eth.svg
│ ├── fin.svg
│ ├── fji.svg
│ ├── flk.svg
│ ├── fra.svg
│ ├── fro.svg
│ ├── fsm.svg
│ ├── gab.svg
│ ├── gbr.svg
│ ├── geo.svg
│ ├── ggy.svg
│ ├── gha.svg
│ ├── gib.svg
│ ├── gin.svg
│ ├── glp.svg
│ ├── gmb.svg
│ ├── gnb.svg
│ ├── gnq.svg
│ ├── grc.svg
│ ├── grd.svg
│ ├── grl.svg
│ ├── gtm.svg
│ ├── guf.svg
│ ├── gum.svg
│ ├── guy.svg
│ ├── hkg.svg
│ ├── hmd.svg
│ ├── hnd.svg
│ ├── hrv.svg
│ ├── hti.svg
│ ├── hun.svg
│ ├── idn.svg
│ ├── imn.svg
│ ├── ind.svg
│ ├── iot.svg
│ ├── irl.svg
│ ├── irn.svg
│ ├── irq.svg
│ ├── isl.svg
│ ├── isr.svg
│ ├── ita.svg
│ ├── jam.svg
│ ├── jey.svg
│ ├── jor.svg
│ ├── jpn.svg
│ ├── kaz.svg
│ ├── ken.svg
│ ├── kgz.svg
│ ├── khm.svg
│ ├── kir.svg
│ ├── kna.svg
│ ├── kor.svg
│ ├── kwt.svg
│ ├── lao.svg
│ ├── lbn.svg
│ ├── lbr.svg
│ ├── lby.svg
│ ├── lca.svg
│ ├── lie.svg
│ ├── lka.svg
│ ├── lso.svg
│ ├── ltu.svg
│ ├── lux.svg
│ ├── lva.svg
│ ├── mac.svg
│ ├── maf.svg
│ ├── mar.svg
│ ├── mco.svg
│ ├── mda.svg
│ ├── mdg.svg
│ ├── mdv.svg
│ ├── mex.svg
│ ├── mhl.svg
│ ├── mkd.svg
│ ├── mli.svg
│ ├── mlt.svg
│ ├── mmr.svg
│ ├── mne.svg
│ ├── mng.svg
│ ├── mnp.svg
│ ├── moz.svg
│ ├── mrt.svg
│ ├── msr.svg
│ ├── mtq.svg
│ ├── mus.svg
│ ├── mwi.svg
│ ├── mys.svg
│ ├── myt.svg
│ ├── nam.svg
│ ├── ncl.svg
│ ├── ner.svg
│ ├── nfk.svg
│ ├── nga.svg
│ ├── nic.svg
│ ├── niu.svg
│ ├── nld.svg
│ ├── nor.svg
│ ├── npl.svg
│ ├── nru.svg
│ ├── nzl.svg
│ ├── omn.svg
│ ├── pak.svg
│ ├── pan.svg
│ ├── pcn.svg
│ ├── per.svg
│ ├── phl.svg
│ ├── plw.svg
│ ├── png.svg
│ ├── pol.svg
│ ├── pri.svg
│ ├── prk.svg
│ ├── prt.svg
│ ├── pry.svg
│ ├── pse.svg
│ ├── pyf.svg
│ ├── qat.svg
│ ├── reu.svg
│ ├── rou.svg
│ ├── rus.svg
│ ├── rwa.svg
│ ├── sau.svg
│ ├── sdn.svg
│ ├── sen.svg
│ ├── sgp.svg
│ ├── sgs.svg
│ ├── shn.svg
│ ├── sjm.svg
│ ├── slb.svg
│ ├── sle.svg
│ ├── slv.svg
│ ├── smr.svg
│ ├── som.svg
│ ├── spm.svg
│ ├── srb.svg
│ ├── ssd.svg
│ ├── stp.svg
│ ├── sur.svg
│ ├── svk.svg
│ ├── svn.svg
│ ├── swe.svg
│ ├── swz.svg
│ ├── sxm.svg
│ ├── syc.svg
│ ├── syr.svg
│ ├── tca.svg
│ ├── tcd.svg
│ ├── tgo.svg
│ ├── tha.svg
│ ├── tjk.svg
│ ├── tkl.svg
│ ├── tkm.svg
│ ├── tls.svg
│ ├── ton.svg
│ ├── tto.svg
│ ├── tun.svg
│ ├── tur.svg
│ ├── tuv.svg
│ ├── twn.svg
│ ├── tza.svg
│ ├── uga.svg
│ ├── ukr.svg
│ ├── umi.svg
│ ├── undefined.svg
│ ├── unk.svg
│ ├── ury.svg
│ ├── usa.svg
│ ├── uzb.svg
│ ├── vat.svg
│ ├── vct.svg
│ ├── ven.svg
│ ├── vgb.svg
│ ├── vir.svg
│ ├── vnm.svg
│ ├── vut.svg
│ ├── wlf.svg
│ ├── wsm.svg
│ ├── yem.svg
│ ├── zaf.svg
│ ├── zmb.svg
│ └── zwe.svg
├── main.js
├── package.json
├── pages
│ ├── CodesanboxExample.vue
│ ├── Docs.vue
│ └── dev
│ │ ├── Example1.vue
│ │ ├── Example2.vue
│ │ ├── Example3.vue
│ │ ├── Example4.vue
│ │ ├── Example5.vue
│ │ └── Example6.vue
├── public
│ ├── favicon.ico
│ └── index.html
├── router.js
├── themeHelpers.js
├── vue.config.js
└── yarn.lock
├── jest.config.js
├── package.json
├── src
├── component.vue
├── computed.js
├── constants.js
├── eventEmitter.js
├── eventsListeners.js
├── helpers.js
├── main.js
├── props.js
└── styles
│ ├── common
│ └── main.styl
│ └── themes
│ ├── bootstrap.styl
│ └── material-design.styl
├── tea.yaml
├── tests
├── e2e
│ ├── .eslintrc.js
│ ├── plugins
│ │ └── index.js
│ ├── specs
│ │ └── test.js
│ └── support
│ │ ├── commands.js
│ │ └── index.js
└── unit
│ ├── .eslintrc.js
│ ├── component.spec.js
│ ├── eventEmitter.spec.ts
│ ├── eventsListeners.spec.ts
│ ├── helpers.js
│ └── helpers.spec.js
├── tsconfig.json
├── tslint.json
├── types
├── types-libraries.d.ts
├── types.d.ts
└── vue-shim.d.ts
└── yarn.lock
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2.0
2 |
3 | defaults: &defaults
4 | # working_directory: ~/repo
5 | docker: # use the docker executor type; machine and macos executors are also supported
6 | - image: circleci/node:10 # the primary container, where your job's commands are run
7 |
8 | jobs:
9 | build: # install
10 | <<: *defaults
11 | branches:
12 | ignore:
13 | - gh-pages
14 | steps:
15 | - checkout # check out the code in the project directory
16 | - restore_cache: # Restores a previously saved cache based on a key (or keys)
17 | name: Restore Yarn Package Cache
18 | keys:
19 | - yarn-packages-cache-{{ checksum "yarn.lock" }}
20 | - run: # used for invoking all command-line programs
21 | name: Install Dependencies
22 | command: yarn # --frozen-lockfile
23 | - save_cache: # Generates and stores a cache of a file or directory of files
24 | name: Save Yarn Package Cache
25 | key: yarn-packages-cache-{{ checksum "yarn.lock" }}
26 | paths:
27 | - ./node_modules
28 | - ~/.cache/yarn
29 | # paths:
30 | # - ~/.cache/yarn
31 | - run: yarn test:unit
32 | - run: yarn test:unit-coverage
33 | - run:
34 | name: Send to Codecov
35 | command: "bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN"
36 | - run: yarn lint-show
37 | - run: yarn build
38 | - run: yarn semantic-release
39 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 2
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.yml]
15 | indent_style = space
16 | indent_size = 2
17 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | /types/
2 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | es6: true,
5 | browser: true,
6 | node: true
7 | },
8 | extends: [
9 | 'plugin:vue/recommended', // strongly-recommended
10 | '@vue/standard'
11 | ],
12 | plugins: [
13 | 'vue'
14 | ],
15 | rules: {
16 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
17 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
18 | },
19 | parserOptions: {
20 | parser: 'babel-eslint',
21 | sourceType: 'module',
22 | ecmaFeature: {
23 | jsx: false
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Jest coverage
2 | /coverage/
3 | /dist/
4 |
5 | .DS_Store
6 | # all node_modules folders
7 | node_modules/
8 | /dist/demo.html
9 | #/dist/
10 | #/gh-pages-src/
11 | /gh-pages-build/
12 |
13 | /tests/e2e/videos/
14 | /tests/e2e/screenshots/
15 |
16 | # local env files
17 | .env.local
18 | .env.*.local
19 |
20 | # Log files
21 | *.log*
22 |
23 | # Editor directories and files
24 | .idea
25 | .vscode
26 | *.suo
27 | *.ntvs*
28 | *.njsproj
29 | *.sln
30 | *.sw*
31 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | autoprefixer: {}
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/.releaserc.json:
--------------------------------------------------------------------------------
1 | {
2 | "branch": "next",
3 | "plugins": [
4 | "@semantic-release/commit-analyzer",
5 | "@semantic-release/release-notes-generator",
6 | ["@semantic-release/changelog", {
7 | "changelogFile": "CHANGELOG.md"
8 | }],
9 | ["@semantic-release/github", {
10 | "assets": [
11 | { "path": "dist/themes/bootstrap.css", "label": "Bootstrap Theme" },
12 | { "path": "dist/themes/material-design.css", "label": "Material Design Theme" },
13 | { "path": "dist/bundle-cjs.js", "label": "CommonJS module" },
14 | { "path": "dist/bundle-umd.js", "label": "UMD module" },
15 | { "path": "dist/bundle-cjs.js", "label": "ECMAScript 6 module" },
16 | { "path": "dist/bundle-iife.js", "label": "Browser IIFE module for
58 |
59 |
86 |
--------------------------------------------------------------------------------
/gh-pages-src/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | ['@vue/app']
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/abw.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ago.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ala.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/are.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/arm.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/atf.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/atg.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/aus.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/aut.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/aze.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bdi.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bel.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ben.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bes.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bfa.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bgd.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bgr.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bhr.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bhs.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bih.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/blr.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bol.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/brb.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bvt.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/bwa.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/caf.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/can.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/che.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/chl.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/chn.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/civ.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/cmr.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/cod.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/cog.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/cok.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/col.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/com.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/cpv.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/cri.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/cub.svg:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/cuw.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/cze.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/deu.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/dji.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/dnk.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/dza.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/esh.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/est.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/eth.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/fin.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/fra.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/fro.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/fsm.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/gab.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/gbr.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/geo.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ggy.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/gha.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/gin.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/gmb.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/gnb.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/grc.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/grd.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/grl.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/guf.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/guy.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/hkg.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/hmd.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/hnd.svg:
--------------------------------------------------------------------------------
1 |
2 |
19 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/hun.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/idn.svg:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ind.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/irl.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/irn.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/irq.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/isl.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/isr.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
36 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ita.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/jam.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/jor.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/jpn.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ken.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/kgz.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/kir.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/kna.svg:
--------------------------------------------------------------------------------
1 |
2 |
22 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/kor.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/kwt.svg:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/lao.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/lbr.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/lby.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/lca.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/lso.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ltu.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/lux.svg:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/lva.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/maf.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mar.svg:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mco.svg:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mdg.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mdv.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mhl.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mkd.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mli.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mmr.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mng.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mrt.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mtq.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mus.svg:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mwi.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/mys.svg:
--------------------------------------------------------------------------------
1 |
2 |
15 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/nam.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ncl.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ner.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/nga.svg:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/niu.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/nld.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/nor.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/npl.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
46 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/nru.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/nzl.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
60 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/pak.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/pan.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/per.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/phl.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
36 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/plw.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/pol.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/pri.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/prk.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/pse.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/qat.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/reu.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/rou.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/rus.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/rwa.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/sdn.svg:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/sen.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/sgp.svg:
--------------------------------------------------------------------------------
1 |
2 |
13 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/sjm.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/slb.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/sle.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/som.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ssd.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/stp.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/sur.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/svk.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/svn.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/swe.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/syc.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/syr.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tcd.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tgo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tha.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tjk.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | Flag of Tajikistan
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tkl.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tls.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ton.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tto.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tun.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tur.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tuv.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/twn.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/tza.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ukr.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/umi.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/undefined.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ury.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Flag of Uruguay
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/usa.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/uzb.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/vct.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/ven.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/vnm.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | Flag of Vietnam
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/wlf.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/wsm.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/yem.svg:
--------------------------------------------------------------------------------
1 |
2 | flag of Yemen
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gh-pages-src/flags/zaf.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/gh-pages-src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import VueAnalytics from 'vue-analytics'
3 | import Vuetify from 'vuetify'
4 | import 'vuetify/dist/vuetify.min.css'
5 | import '@mdi/font/css/materialdesignicons.css'
6 |
7 | import App from './App'
8 | import router from './router'
9 |
10 | import { getTheme } from './themeHelpers'
11 |
12 | import { CoolSelectPlugin } from '~/main' // '../dist/bundle-umd' // '~/main'
13 | export { CoolSelect, EventEmitter } from '~/main' // '../dist/bundle-umd'
14 |
15 | const theme = getTheme()
16 |
17 | import(`../src/styles/themes/${theme}.styl`)
18 | // import(`../dist/themes/${theme}.css`)
19 |
20 | Vue.use(Vuetify)
21 | Vue.use(CoolSelectPlugin, {
22 | text: {
23 | noData: 'Нет доступных данных'
24 | }
25 | })
26 |
27 | Vue.use(VueAnalytics, {
28 | id: 'UA-127403551-2',
29 | router
30 | })
31 |
32 | Vue.config.productionTip = false
33 |
34 | /* eslint-disable no-new */
35 | new Vue({
36 | el: '#app',
37 | router,
38 | vuetify: new Vuetify(),
39 | render: h => h(App)
40 | })
41 |
--------------------------------------------------------------------------------
/gh-pages-src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-cool-select-github-pages",
3 | "version": "1.0.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve ./main.js",
7 | "deploy": "push-dir --dir=../gh-pages-build --branch=gh-pages --cleanup",
8 | "build": "vue-cli-service build ./main.js --dest=../gh-pages-build",
9 | "build-with-deploy": "yarn build && yarn deploy"
10 | },
11 | "dependencies": {
12 | "bootstrap": "^4.3.1",
13 | "vue-analytics": "^5.16.4",
14 | "vuetify": "2.0.0-alpha.9"
15 | },
16 | "devDependencies": {
17 | "@mdi/font": "^3.5.95"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/gh-pages-src/pages/CodesanboxExample.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/gh-pages-src/pages/dev/Example1.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Usage Example 1
5 |
6 |
Selected timezone: {{ selectedTimezone || 'not chosen' }}.
7 |
8 |
9 |
15 |
19 |
20 |
![]()
24 |
25 |
26 | {{ timezone.offset }}
27 |
28 | {{ timezone.name }}
29 |
30 |
31 |
32 |
36 |
40 |
41 |
42 | {{ timezone.offset }}
43 |
44 | {{ timezone.name }}
45 |
46 |
47 |
48 |
49 |
55 |
56 |
57 | Not all time zones are used, the full list is
58 |
59 | here
60 |
61 | .
62 |
63 |
64 |
65 |
66 |
67 |
93 |
94 |
101 |
--------------------------------------------------------------------------------
/gh-pages-src/pages/dev/Example2.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Usage Example 2
5 |
6 |
7 | This example shows how to work with asynchronous data through REST API.
8 |
9 |
10 |
11 |
![Logo]()
15 |
16 | - Name: {{ selected.name }}
17 | - Domain: {{ selected.domain }}
18 |
19 |
20 |
21 |
22 |
Loading: {{ loading }}.
23 |
24 |
25 |
34 |
35 | {{ noData ? 'No information found by request.' : 'We need at least 2 letters to search.' }}
36 |
37 |
38 |
39 |
![]()
43 |
44 |
45 |
46 | {{ item.name }}
47 |
48 |
49 |
50 | {{ item.domain }}
51 |
52 |
53 |
54 |
55 |
59 |
63 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
113 |
114 |
133 |
--------------------------------------------------------------------------------
/gh-pages-src/pages/dev/Example3.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Reset search example
5 |
6 |
7 | Search will reset in {{ resetSecondsLeft }}
8 |
9 |
10 | Search is reset
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
27 |
28 |
29 |
30 |
31 |
74 |
--------------------------------------------------------------------------------
/gh-pages-src/pages/dev/Example4.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Usage Example 4
5 |
6 |
Selected: {{ selected || 'not chosen' }}.
7 |
8 |
9 |
14 |
15 | Search: "{{ search }}"
16 |
17 |
18 |
34 |
39 | before-items-fixed
40 |
41 |
46 | before-items
47 |
48 |
53 | after-items
54 |
55 |
60 | after-items-fixed
61 |
62 |
63 |
64 |
65 |
66 |
67 |
102 |
--------------------------------------------------------------------------------
/gh-pages-src/pages/dev/Example6.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
12 |
13 |
18 |
19 |
20 |
21 |
26 |
27 |
28 |
38 |
39 |
45 |
46 |
47 |
48 |
53 |
54 |
55 |
56 |
57 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
88 |
--------------------------------------------------------------------------------
/gh-pages-src/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iliyaZelenko/vue-cool-select/89fe8b811f5b992cffd4df7f17796f26a9b7e9f5/gh-pages-src/public/favicon.ico
--------------------------------------------------------------------------------
/gh-pages-src/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Vue Cool Select
9 |
10 |
11 |
14 |
15 |
16 |
17 |
21 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/gh-pages-src/themeHelpers.js:
--------------------------------------------------------------------------------
1 | // текущая тема
2 | export function getTheme () {
3 | return new URLSearchParams(window.location.search).get('theme') || 'bootstrap'
4 | }
5 |
6 | export function setTheme (theme) {
7 | const searchParams = new URLSearchParams(window.location.search)
8 |
9 | searchParams.set('theme', theme)
10 | window.location.search = searchParams.toString()
11 | }
12 |
--------------------------------------------------------------------------------
/gh-pages-src/vue.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 |
3 | module.exports = {
4 | publicPath: process.env.NODE_ENV === 'production'
5 | ? '/vue-cool-select/'
6 | : '/',
7 | outputDir: undefined,
8 | assetsDir: undefined,
9 | runtimeCompiler: undefined,
10 | productionSourceMap: undefined,
11 | parallel: undefined,
12 |
13 | css: {
14 | extract: false
15 | },
16 |
17 | configureWebpack: {
18 | resolve: {
19 | alias: {
20 | '~': path.resolve(__dirname, '../src')
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/gh-pages-src/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 | "@mdi/font@^3.5.95":
6 | version "3.5.95"
7 | resolved "https://registry.yarnpkg.com/@mdi/font/-/font-3.5.95.tgz#422d1982566b4a0577b457cd0acc2168ee8343c3"
8 | integrity sha512-WHSJ0TJ70qkn+EPsW9w22pQU+kjEnRZlfN4N7xsFFmKa6VhpdQcwTWqj9PDH3oq6Be2p0IW/VDURJvPWDnBAUw==
9 |
10 | bootstrap@^4.3.1:
11 | version "4.3.1"
12 | resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.3.1.tgz#280ca8f610504d99d7b6b4bfc4b68cec601704ac"
13 | integrity sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag==
14 |
15 | vue-analytics@^5.16.4:
16 | version "5.16.4"
17 | resolved "https://registry.yarnpkg.com/vue-analytics/-/vue-analytics-5.16.4.tgz#7f9e197cbc64afac96884a05214b17efaf8e9d09"
18 | integrity sha512-M67cUqpPeyk2rftrvlx2uU+BQ/C4E8SkF2Ct9LizOYUoTccZtCCJwhMJfQ3XL8xep6p3K8KYz58FzRWvx5zlPw==
19 |
20 | vuetify@2.0.0-alpha.9:
21 | version "2.0.0-alpha.9"
22 | resolved "https://registry.yarnpkg.com/vuetify/-/vuetify-2.0.0-alpha.9.tgz#5aca564f9ed374f87af77823047d49a05c7c127e"
23 | integrity sha512-Lqc6xA3mmAb/iKWT6N0P/XEcRBdPcbRnimTmBjQPo3uCfmFo9MT3lyTFoNWh38B3piqvm2idq7ktA1ZHuIpHRg==
24 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | const { pathsToModuleNameMapper } = require('ts-jest/utils')
2 | // In the following statement, replace `./tsconfig` with the path to your `tsconfig` file
3 | // which contains the path mapping (ie the `compilerOptions.paths` option):
4 | const { compilerOptions } = require('./tsconfig.json')
5 |
6 | module.exports = {
7 | // preset: 'ts-jest',
8 | // testEnvironment: 'node',
9 | moduleFileExtensions: [
10 | 'js',
11 | 'jsx',
12 | 'json',
13 | 'vue',
14 | 'ts',
15 | 'tsx'
16 | ],
17 | transform: {
18 | '^.+\\.vue$': 'vue-jest',
19 | '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
20 | '^.+\\.jsx?$': 'babel-jest',
21 | '^.+\\.tsx?$': 'ts-jest'
22 | },
23 | moduleNameMapper: {
24 | // "/^~\/(.*)$/": "./src/$1"
25 | // '^@/(.*)$': '/src/$1',
26 | // '^~/(.*)$': '/src/$1',
27 | ...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '/' })
28 | // '^@App/(.*)$': '/src/$1'
29 | },
30 | snapshotSerializers: [
31 | 'jest-serializer-vue'
32 | ],
33 | testMatch: [
34 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
35 | ],
36 | testURL: 'http://localhost/'
37 | }
38 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-cool-select",
3 | "version": "3.5.2",
4 | "scripts": {
5 | "commit": "git-cz",
6 | "serve": "cd ./gh-pages-src && yarn serve",
7 | "build": "rollup --c ./build/rollup.config.js --environment BUILD:production",
8 | "build-watch": "rollup -w -c",
9 | "lint": "vue-cli-service lint",
10 | "lint-show": "vue-cli-service lint --no-fix",
11 | "gp-build-with-deploy": "cd ./gh-pages-src && yarn build-with-deploy",
12 | "build-and-local-publish": "yarn build && yalc publish --push",
13 | "test:unit": "vue-cli-service test:unit",
14 | "test:unit-watch": "vue-cli-service test:unit --watch",
15 | "test:unit-coverage": "vue-cli-service test:unit --coverage",
16 | "test:e2e": "vue-cli-service test:e2e"
17 | },
18 | "dependencies": {},
19 | "devDependencies": {
20 | "@babel/preset-env": "^7.4.3",
21 | "@semantic-release/changelog": "^3.0.2",
22 | "@semantic-release/commit-analyzer": "^6.1.0",
23 | "@semantic-release/git": "^7.0.8",
24 | "@semantic-release/npm": "^5.1.4",
25 | "@semantic-release/release-notes-generator": "^7.1.4",
26 | "@types/jest": "^24.0.6",
27 | "@vue/cli-plugin-babel": "^3.0.5",
28 | "@vue/cli-plugin-e2e-cypress": "^3.4.1",
29 | "@vue/cli-plugin-eslint": "^3.0.5",
30 | "@vue/cli-plugin-unit-jest": "^3.4.1",
31 | "@vue/cli-service": "^3.0.5",
32 | "@vue/eslint-config-standard": "^4.0.0",
33 | "@vue/test-utils": "^1.0.0-beta.29",
34 | "babel-core": "7.0.0-bridge.0",
35 | "babel-jest": "^24.1.0",
36 | "clone": "^2.1.2",
37 | "commitizen": "^4.0.0",
38 | "core-js": "3.4.6",
39 | "cssnano": "^4.1.10",
40 | "fs-extra": "^7.0.1",
41 | "jest": "^24.1.0",
42 | "postcss-preset-env": "^6.6.0",
43 | "propdoc": "^0.9.3",
44 | "push-dir": "^0.4.1",
45 | "rollup": "^1.8.0",
46 | "rollup-plugin-alias": "^1.5.1",
47 | "rollup-plugin-babel": "^4.3.2",
48 | "rollup-plugin-commonjs": "^9.3.4",
49 | "rollup-plugin-node-resolve": "^4.1.0",
50 | "rollup-plugin-postcss": "^2.0.3",
51 | "rollup-plugin-terser": "^5.1.2",
52 | "rollup-plugin-vue": "^4.7.2",
53 | "semantic-release": "^15.13.3",
54 | "stylus": "^0.54.5",
55 | "stylus-loader": "^3.0.2",
56 | "sugarss": "^2.0.0",
57 | "ts-jest": "^24.0.0",
58 | "ts-loader": "^6.1.2",
59 | "tslint": "^5.13.0",
60 | "tslint-config-standard": "^8.0.1",
61 | "typescript": "^3.3.3333",
62 | "vue": "^2.5.17",
63 | "vue-router": "^3.0.1",
64 | "vue-template-compiler": "^2.5.17"
65 | },
66 | "browserslist": "> 0.5%, last 2 versions, Firefox ESR, not dead",
67 | "config": {
68 | "commitizen": {
69 | "path": "./node_modules/cz-conventional-changelog"
70 | }
71 | },
72 | "keywords": [
73 | "vue",
74 | "select",
75 | "autocomplete",
76 | "vue.js",
77 | "slots",
78 | "bootstrap",
79 | "bootstrap 4",
80 | "material design"
81 | ],
82 | "repository": {
83 | "type": "git",
84 | "url": "git+https://github.com/iliyaZelenko/vue-cool-select.git"
85 | },
86 | "bugs": {
87 | "url": "https://github.com/iliyaZelenko/vue-cool-select/issues"
88 | },
89 | "homepage": "https://github.com/iliyaZelenko/vue-cool-select#readme",
90 | "license": "MIT",
91 | "description": "Vue select with autocomplete and with slots. 2 themes: bootstrap 4, material design.",
92 | "peerDependencies": {
93 | "vue": "^2.5.17"
94 | },
95 | "author": "Ilya Zelenko",
96 | "main": "dist/bundle-cjs.js",
97 | "module": "dist/bundle-esm.js",
98 | "unpkg": "dist/bundle-umd.js",
99 | "jsdelivr": "dist/bundle-umd.js",
100 | "typings": "types/types.d.ts",
101 | "files": [
102 | "dist/*",
103 | "src/*",
104 | "types/*"
105 | ]
106 | }
107 |
--------------------------------------------------------------------------------
/src/computed.js:
--------------------------------------------------------------------------------
1 | export default {
2 | itemsComputed () {
3 | let items = this.items
4 |
5 | if (typeof this.items === 'string') {
6 | items = JSON.parse(this.items)
7 | }
8 |
9 | return this.filteredBySearchItems(items)
10 | },
11 | inputValue () {
12 | // если указан слот selection, то не надо отображать текст в инпуте, он только мешает
13 | if (this.$scopedSlots.selection && this.getSearchData() === '') return ''
14 | // если есть строка поиска, то пусть она там будет
15 | if (this.getSearchData() !== '') return this.getSearchData()
16 |
17 | // иначе пусть будет текст элемента или его значение
18 | return this.getItemText(this.selectedItem) || this.currentItemValue
19 | },
20 | currentItemValue () {
21 | return this.getItemValue(this.selectedItem)
22 | },
23 | showSelectionSlot () {
24 | return this.$scopedSlots.selection && this.selectedItem && !this.getSearchData()
25 | },
26 | inputForTextStyles () {
27 | let styles = {}
28 |
29 | if (this.inputElCustomAttributes && this.inputElCustomAttributes.style) {
30 | styles = {
31 | ...styles,
32 | ...this.inputElCustomAttributes.style
33 | }
34 | }
35 |
36 | return styles
37 | },
38 | hasMenu () {
39 | return !this.simpleInput && this.wishShowMenu && !this.loading // this.focused && !this.loading
40 | },
41 | hasError () {
42 | return !!this.errorMessage
43 | },
44 | isMobile () {
45 | if (process.server) return false
46 | // return window.innerWidth + window.innerHeight <= 1800
47 | return window.innerWidth <= 900 && window.innerHeight <= 900
48 | },
49 | // get item index from arr
50 | selectedItemIndex () {
51 | for (let itemKey in this.itemsComputed) {
52 | if (this.selectedItem === this.itemsComputed[itemKey] && this.itemsComputed.hasOwnProperty(itemKey)) {
53 | return itemKey
54 | }
55 | }
56 |
57 | return null
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/constants.js:
--------------------------------------------------------------------------------
1 | export const SIZES = {
2 | DEFAULT: 'default',
3 | SMALL: 'sm',
4 | LARGE: 'lg'
5 | }
6 |
7 | export const MENU_POSITIONS = {
8 | TOP: 'top',
9 | BOTTOM: 'bottom'
10 | }
11 |
--------------------------------------------------------------------------------
/src/eventEmitter.js:
--------------------------------------------------------------------------------
1 | // pattern Module
2 | function Observer () {
3 | const listeners = {}
4 |
5 | function addListener (event, listener) {
6 | if (!listeners[event]) listeners[event] = []
7 |
8 | listeners[event].push(listener)
9 | }
10 |
11 | return {
12 | on: addListener,
13 | onOnce (event, listener) {
14 | listener.once = true
15 |
16 | addListener(event, listener)
17 | },
18 | emit (event, data) {
19 | for (const index in listeners[event]) {
20 | const listener = listeners[event][index]
21 |
22 | listener(data)
23 |
24 | if (listener.once) {
25 | delete listeners[event][index]
26 | }
27 | }
28 | }
29 | }
30 | }
31 |
32 | export default Observer
33 |
--------------------------------------------------------------------------------
/src/helpers.js:
--------------------------------------------------------------------------------
1 | import { MENU_POSITIONS } from './constants'
2 |
3 | export function isObject (val) {
4 | return val && (val.constructor === Object)
5 | }
6 |
7 | export function getOffsetSum (elem) {
8 | let top = 0
9 | let left = 0
10 |
11 | while (elem) {
12 | top = top + parseFloat(elem.offsetTop)
13 | left = left + parseFloat(elem.offsetLeft)
14 | elem = elem.offsetParent
15 | }
16 |
17 | return { top: Math.round(top), left: Math.round(left) }
18 | }
19 |
20 | export function scrollIfNeeded (element, container) {
21 | if (element.offsetTop < container.scrollTop) {
22 | container.scrollTop = element.offsetTop
23 | } else {
24 | const offsetBottom = element.offsetTop + element.offsetHeight
25 | const scrollBottom = container.scrollTop + container.offsetHeight
26 |
27 | if (offsetBottom > scrollBottom) {
28 | container.scrollTop = offsetBottom - container.offsetHeight
29 | }
30 | }
31 | }
32 |
33 | export function mergeDeep (target, source) {
34 | let output = Object.assign({}, target)
35 | if (isObject(target) && isObject(source)) {
36 | Object.keys(source).forEach(key => {
37 | if (isObject(source[key])) {
38 | if (!(key in target)) {
39 | Object.assign(output, { [key]: source[key] })
40 | } else {
41 | output[key] = mergeDeep(target[key], source[key])
42 | }
43 | } else {
44 | Object.assign(output, { [key]: source[key] })
45 | }
46 | })
47 | }
48 | return output
49 | }
50 |
51 | export function outOfViewportGetFreePosition (elem) {
52 | const bounding = elem.getBoundingClientRect()
53 |
54 | return bounding.top < 0
55 | ? MENU_POSITIONS.BOTTOM
56 | : bounding.bottom > window.innerHeight
57 | ? MENU_POSITIONS.TOP
58 | // default position
59 | : false
60 | }
61 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import { mergeDeep } from '~/helpers'
2 | import CoolSelect from '~/component.vue'
3 |
4 | export const CoolSelectPlugin = new Singleton()
5 | export { default as EventEmitter } from '~/eventEmitter'
6 | export { default as component } from '~/component.vue'
7 | export { default as VueCoolSelect } from '~/component.vue'
8 | export { CoolSelect }
9 |
10 | function Singleton () {
11 | return {
12 | install (Vue, optionsInput = {}) {
13 | const optionsDefault = {
14 | text: {
15 | noData: 'No data available'
16 | }
17 | }
18 | const options = mergeDeep(optionsDefault, optionsInput)
19 |
20 | Vue.prototype.$coolSelect = {
21 | options
22 | }
23 | }
24 | }
25 | }
26 |
27 | let GlobalVue = null
28 |
29 | if (typeof window !== 'undefined') {
30 | GlobalVue = window.Vue
31 | } else if (typeof global !== 'undefined') {
32 | GlobalVue = global.Vue
33 | }
34 | if (GlobalVue) {
35 | // Automatic installation if Vue has been added to the global scope.
36 | GlobalVue.use(CoolSelectPlugin)
37 | GlobalVue.component('cool-select', CoolSelect)
38 | GlobalVue.component('vue-cool-select', CoolSelect)
39 | }
40 |
--------------------------------------------------------------------------------
/src/styles/common/main.styl:
--------------------------------------------------------------------------------
1 | .IZ-select
2 | *
3 | box-sizing: border-box
4 |
5 | .IZ-select__input-wrap
6 | display: flex
7 | align-items: center
8 | height: 100%
9 |
10 | .IZ-select__input
11 | height: 100%;
12 |
13 | input
14 | height: 100%;
15 |
16 | .fade
17 | &-leave-active
18 | position: absolute
19 |
20 | &-enter-active, &-leave, &-leave-to
21 | transition: opacity .2s
22 |
23 | &-enter, &-leave-to
24 | opacity: 0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/tea.yaml:
--------------------------------------------------------------------------------
1 | # https://tea.xyz/what-is-this-file
2 | ---
3 | version: 1.0.0
4 | codeOwners:
5 | - '0xc8d8dA379ECBCf21aF8586FD5392826B5E45fD3a'
6 | quorum: 1
7 |
--------------------------------------------------------------------------------
/tests/e2e/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | 'cypress'
4 | ],
5 | env: {
6 | mocha: true,
7 | 'cypress/globals': true
8 | },
9 | rules: {
10 | strict: 'off'
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/tests/e2e/plugins/index.js:
--------------------------------------------------------------------------------
1 | // https://docs.cypress.io/guides/guides/plugins-guide.html
2 |
3 | // if you need a custom webpack configuration you can uncomment the following import
4 | // and then use the `file:preprocessor` event
5 | // as explained in the cypress docs
6 | // https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
7 |
8 | /* eslint-disable import/no-extraneous-dependencies, global-require, arrow-body-style */
9 | // const webpack = require('@cypress/webpack-preprocessor')
10 |
11 | module.exports = (on, config) => {
12 | // on('file:preprocessor', webpack({
13 | // webpackOptions: require('@vue/cli-service/webpack.config'),
14 | // watchOptions: {}
15 | // }))
16 |
17 | return Object.assign({}, config, {
18 | fixturesFolder: 'tests/e2e/fixtures',
19 | integrationFolder: 'tests/e2e/specs',
20 | screenshotsFolder: 'tests/e2e/screenshots',
21 | videosFolder: 'tests/e2e/videos',
22 | supportFile: 'tests/e2e/support/index.js'
23 | })
24 | }
25 |
--------------------------------------------------------------------------------
/tests/e2e/specs/test.js:
--------------------------------------------------------------------------------
1 | // https://docs.cypress.io/api/introduction/api.html
2 |
3 | describe('My First Test', () => {
4 | it('Visits the app root url', () => {
5 | cy.visit('/')
6 | cy.contains('h1', 'Welcome to Your Vue.js App')
7 | })
8 | })
9 |
--------------------------------------------------------------------------------
/tests/e2e/support/commands.js:
--------------------------------------------------------------------------------
1 | // ***********************************************
2 | // This example commands.js shows you how to
3 | // create various custom commands and overwrite
4 | // existing commands.
5 | //
6 | // For more comprehensive examples of custom
7 | // commands please read more here:
8 | // https://on.cypress.io/custom-commands
9 | // ***********************************************
10 | //
11 | //
12 | // -- This is a parent command --
13 | // Cypress.Commands.add("login", (email, password) => { ... })
14 | //
15 | //
16 | // -- This is a child command --
17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18 | //
19 | //
20 | // -- This is a dual command --
21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22 | //
23 | //
24 | // -- This is will overwrite an existing command --
25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
26 |
--------------------------------------------------------------------------------
/tests/e2e/support/index.js:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/index.js is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.js using ES2015 syntax:
17 | import './commands'
18 |
19 | // Alternatively you can use CommonJS syntax:
20 | // require('./commands')
21 |
--------------------------------------------------------------------------------
/tests/unit/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | jest: true
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/tests/unit/eventEmitter.spec.ts:
--------------------------------------------------------------------------------
1 | import { EventEmitter } from '~/main'
2 |
3 | describe('eventsListeners', () => {
4 | it('checks EventEmitter', () => {
5 | const instance = new EventEmitter()
6 |
7 | expect(typeof EventEmitter).toEqual('function')
8 | expect(typeof instance).toEqual('object')
9 |
10 | expect(typeof instance.on).toEqual('function')
11 | expect(typeof instance.onOnce).toEqual('function')
12 | expect(typeof instance.emit).toEqual('function')
13 |
14 | expect(instance.on(
15 | 'myEvent',
16 | () => {}
17 | )).toBeUndefined()
18 | expect(instance.onOnce(
19 | 'myEvent',
20 | () => {}
21 | )).toBeUndefined()
22 | expect(instance.emit(
23 | 'myEvent',
24 | 'testData'
25 | )).toBeUndefined()
26 | })
27 | })
28 |
--------------------------------------------------------------------------------
/tests/unit/helpers.js:
--------------------------------------------------------------------------------
1 | import { createLocalVue } from '@vue/test-utils'
2 | import { CoolSelectPlugin } from '~/main'
3 |
4 | export default function createLocalVueWithPlugin () {
5 | const localVue = createLocalVue()
6 |
7 | localVue.use(CoolSelectPlugin)
8 |
9 | return localVue
10 | }
11 |
12 | // Выделен ли текст в инпуте. https://stackoverflow.com/a/5001669/5286034
13 | export function isTextSelected (input) {
14 | if (typeof input.selectionStart === 'number') {
15 | return input.selectionStart === 0 && input.selectionEnd === input.value.length
16 | } else if (typeof document.selection !== 'undefined') {
17 | input.focus()
18 |
19 | return document.selection.createRange().text === input.value
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/tests/unit/helpers.spec.js:
--------------------------------------------------------------------------------
1 | import { isObject, getOffsetSum, scrollIfNeeded, mergeDeep } from '~/helpers'
2 |
3 | describe('helpers.js', () => {
4 | it('checks isObject', () => {
5 | expect(
6 | isObject({})
7 | ).toBe(true)
8 |
9 | expect(
10 | isObject([])
11 | ).toBe(false)
12 |
13 | expect(
14 | isObject(function () {})
15 | ).toBe(false)
16 |
17 | expect(
18 | isObject(new Date())
19 | ).toBe(false)
20 | })
21 |
22 | it('checks getOffsetSum', () => {
23 | const DomElementMock = {
24 | offsetTop: 80,
25 | offsetLeft: 180,
26 | offsetParent: {
27 | offsetTop: 40,
28 | offsetLeft: 140,
29 | offsetParent: {
30 | offsetTop: 20,
31 | offsetLeft: 0,
32 | offsetParent: null
33 | }
34 | }
35 | }
36 |
37 | expect(
38 | getOffsetSum(DomElementMock)
39 | ).toEqual({ left: 320, top: 140 })
40 |
41 | DomElementMock.offsetParent = null
42 |
43 | expect(
44 | getOffsetSum(DomElementMock)
45 | ).toEqual({ left: 180, top: 80 })
46 | })
47 |
48 | it('checks scrollIfNeeded', () => {
49 | const TEST1 = {
50 | element: {
51 | offsetTop: 1,
52 | offsetHeight: null
53 | },
54 | container: {
55 | scrollTop: 2,
56 | offsetHeight: null
57 | }
58 | }
59 |
60 | scrollIfNeeded(TEST1.element, TEST1.container)
61 |
62 | expect(
63 | TEST1.container.scrollTop
64 | ).toBe(TEST1.element.offsetTop)
65 |
66 | const TEST2 = {
67 | element: {
68 | offsetTop: 2,
69 | offsetHeight: 10
70 | },
71 | container: {
72 | scrollTop: 1,
73 | offsetHeight: 9
74 | }
75 | }
76 |
77 | scrollIfNeeded(TEST2.element, TEST2.container)
78 |
79 | expect(
80 | TEST2.container.scrollTop
81 | ).toBe(TEST2.element.offsetTop + TEST2.element.offsetHeight - TEST2.container.offsetHeight)
82 |
83 | const TEST3 = {
84 | element: {
85 | offsetTop: 2,
86 | offsetHeight: 9
87 | },
88 | container: {
89 | scrollTop: 1,
90 | offsetHeight: 10
91 | }
92 | }
93 |
94 | scrollIfNeeded(TEST3.element, TEST3.container)
95 |
96 | expect(
97 | TEST3.container.scrollTop
98 | ).toBe(TEST3.container.scrollTop)
99 | })
100 |
101 | it('checks mergeDeep', () => {
102 | const obj = {
103 | a: 10,
104 | b: {
105 | b1: 20
106 | }
107 | }
108 |
109 | expect(
110 | mergeDeep(obj, {
111 | c: 40
112 | })
113 | ).toEqual({ ...obj, c: 40 })
114 |
115 | expect(
116 | mergeDeep(obj, {
117 | b: {
118 | b2: 20
119 | }
120 | })
121 | ).toEqual({
122 | a: 10,
123 | b: {
124 | b1: 20,
125 | b2: 20
126 | }
127 | })
128 |
129 | expect(
130 | mergeDeep(obj, {
131 | c: {
132 | test: 123
133 | }
134 | })
135 | ).toEqual({
136 | a: 10,
137 | b: {
138 | b1: 20
139 | },
140 | c: {
141 | test: 123
142 | }
143 | })
144 | })
145 | })
146 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "moduleResolution": "node",
4 | "baseUrl": ".",
5 | "paths": {
6 | "~/*": ["./src/*"]
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultSeverity": "warning",
3 | "extends": ["tslint:latest", "tslint-config-standard"],
4 | "linterOptions": {
5 | "include": [
6 | "**/*.ts",
7 | "**/*.vue"
8 | ],
9 | "exclude": [
10 | // "**/*.spec.js",
11 | "./node_modules/**/*"
12 | ]
13 | },
14 | "rules": {
15 | /* Ilya Zelen tastes */
16 | "object-literal-key-quotes": false,
17 | "interface-name": [true, "never-prefix"],
18 | "prefer-const": true,
19 | "ordered-imports": [false],
20 | "object-literal-sort-keys": [false],
21 | "whitespace": false, // вызывало предупреждение вообще где не нужно
22 | // "no-implicit-dependencies": [true, "dev"],
23 |
24 | // it is important for the imports work
25 | "no-implicit-dependencies": [true, ["~", "@"]],
26 | "no-submodule-imports": false, // [true, "~", "@"],
27 |
28 | "quotemark": [true, "single"],
29 | "semicolon": [true, "never"],
30 | "trailing-comma": [true, {
31 | "multiline": "never",
32 | "singleline": "never"
33 | }],
34 | "space-before-function-paren": true,
35 |
36 | // почитать
37 | "restrict-plus-operands": false
38 | }
39 | }
40 |
41 | //{
42 | // "defaultSeverity": "warning",
43 | // "extends": ["tslint:latest", "tslint-config-standard"],
44 | // "linterOptions": {
45 | // "include": [
46 | // "**/*.ts", "**/*.vue"
47 | // ],
48 | // "exclude": [
49 | // "node_modules/**",
50 | // "dist/**",
51 | // "dist.js/**",
52 | // ".nuxt/**",
53 | // "tests/**"
54 | // ]
55 | // },
56 | // "rules": {
57 | // /* Ilya Zelen tastes */
58 | // "interface-name": [true, "never-prefix"],
59 | // "prefer-const": true,
60 | // "ordered-imports": [false],
61 | // "object-literal-sort-keys": [false],
62 | // "whitespace": false, // вызывало предупреждение вообще где не нужно
63 | // "max-classes-per-file": [true, 1, "exclude-class-expressions"],
64 | // // "no-implicit-dependencies": [true, "dev"],
65 | //
66 | // // it is important for the imports work
67 | // "no-implicit-dependencies": [true, ["~", "@"]],
68 | // "no-submodule-imports": [true, "~", "@"],
69 | //
70 | // "quotemark": [true, "single"],
71 | // "semicolon": [true, "never"],
72 | // "trailing-comma": [true, {
73 | // "multiline": "never",
74 | // "singleline": "never"
75 | // }],
76 | // "space-before-function-paren": true,
77 | //
78 | // // почитать
79 | // "restrict-plus-operands": false
80 | // }
81 | //}
82 |
--------------------------------------------------------------------------------
/types/types-libraries.d.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import { CoolSelectUseOptionsInterface } from './types'
3 |
4 | declare module 'vue/types/vue' {
5 |
6 | interface Vue {
7 | $coolSelect: {
8 | options: CoolSelectUseOptionsInterface
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/types/types.d.ts:
--------------------------------------------------------------------------------
1 | import Vue, { Component, PluginFunction } from 'vue'
2 |
3 | // TODO чтобы у Component была связь с VueCoolSelectComponentInterface
4 | export const component: Component
5 | export const CoolSelect: Component
6 | export const VueCoolSelect: Component
7 | export const CoolSelectPlugin: PluginFunction
8 | export const EventEmitter: {
9 | on: (event: any, listener: any) => any
10 | onOnce: (event: any, listener: any) => any
11 | emit: (event: any, data: any) => any
12 | }
13 |
14 | export interface CoolSelectUseOptionsInterface {
15 | text: {
16 | noData: string
17 | }
18 | }
19 |
20 | export interface VueCoolSelectComponentInterface extends Vue {
21 | [key: string]: any
22 | wishShowMenu: boolean
23 | arrowsIndex: number | null
24 | focused: boolean
25 | selectedItem: any
26 | selectedItemByArrows: any
27 | searchData: string
28 | scrollItemsLimitCurrent: number
29 | // addEventListener identifier
30 | mousedownListener: any
31 |
32 | /* Props */
33 | arrowsDisableInstantSelection: boolean
34 | scrollItemsLimitAddAfterScroll: number
35 |
36 | /* Computed */
37 | hasMenu: boolean
38 | itemsComputed: any[]
39 |
40 | /* Methods */
41 | onSelectByArrow (e: any): any
42 | onEnter (e: any): any
43 | onClick (): any
44 | onClickSelectItem (item: any): any
45 | onSearchKeyDown (e: any): any
46 | onSearchKeyUp (e: any): any
47 | onSearch (e: any): any
48 | onScroll (event: any): any
49 |
50 | setBlured (): any
51 | }
52 |
--------------------------------------------------------------------------------
/types/vue-shim.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.vue' {
2 | import Vue from 'vue'
3 | export default Vue
4 | }
5 |
--------------------------------------------------------------------------------