diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..e36333f3 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,38 @@ +version: 2 +jobs: + build: + docker: + # specify the version you desire here + - image: cimg/node:12.22.12 + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/mongo:3.4.4 + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: yarn install + + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + + # run tests! + - run: npm test + + # To reeneable that the lib needs an account on codecov + # - run: + # name: Send code coverage + # command: './node_modules/.bin/codecov' diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 990e718e..e3c22fb3 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,7 +1,14 @@ diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..02bf6a4c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "04:00" + open-pull-requests-limit: 10 + ignore: + - dependency-name: "@vue/cli-plugin-babel" + versions: + - 4.5.11 + - dependency-name: webpack-bundle-analyzer + versions: + - 4.4.0 + - dependency-name: semver + versions: + - 7.3.4 + - dependency-name: cssnano + versions: + - 4.1.10 diff --git a/.github/funding.yml b/.github/funding.yml new file mode 100644 index 00000000..600a14aa --- /dev/null +++ b/.github/funding.yml @@ -0,0 +1 @@ +github: [shentao, akki-jat, mattelen] diff --git a/.gitignore b/.gitignore index dbb53252..ae828f87 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ selenium-debug.log tests/unit/coverage tests/e2e/reports .idea/ -dist/ diff --git a/README.md b/README.md index 81f0f261..a2258df0 100644 --- a/README.md +++ b/README.md @@ -8,34 +8,24 @@ Visit: [vue-multiselect.js.org](https://vue-multiselect.js.org/#sub-getting-star ## Sponsors -### Gold - -

- - Vuejs Amsterdam - -

- - Vue - The Road To Enterprise + + Get Form

+

Suade Labs

-### Silver -

Storyblok

-### Bronze -

Vue Mastery logo diff --git a/dist/vue-multiselect.css b/dist/vue-multiselect.css new file mode 100644 index 00000000..9c9a6ad1 --- /dev/null +++ b/dist/vue-multiselect.css @@ -0,0 +1,468 @@ + + + fieldset[disabled] .multiselect { + pointer-events: none; + } + + .multiselect__spinner { + position: absolute; + right: 1px; + top: 1px; + width: 40px; + height: 38px; + background: #fff; + display: block; + } + + .multiselect__spinner::before, + .multiselect__spinner::after { + position: absolute; + content: ""; + top: 50%; + left: 50%; + margin: -8px 0 0 -8px; + width: 16px; + height: 16px; + border-radius: 100%; + border-color: #41b883 transparent transparent; + border-style: solid; + border-width: 2px; + box-shadow: 0 0 0 1px transparent; + } + + .multiselect__spinner::before { + animation: spinning 2.4s cubic-bezier(0.41, 0.26, 0.2, 0.62); + animation-iteration-count: infinite; + } + + .multiselect__spinner::after { + animation: spinning 2.4s cubic-bezier(0.51, 0.09, 0.21, 0.8); + animation-iteration-count: infinite; + } + + .multiselect__loading-enter-active, + .multiselect__loading-leave-active { + transition: opacity 0.4s ease-in-out; + opacity: 1; + } + + .multiselect__loading-enter, + .multiselect__loading-leave-active { + opacity: 0; + } + + .multiselect, + .multiselect__input, + .multiselect__single { + font-family: inherit; + font-size: 16px; + touch-action: manipulation; + } + + .multiselect { + box-sizing: content-box; + display: block; + position: relative; + width: 100%; + min-height: 40px; + text-align: left; + color: #35495e; + } + + .multiselect * { + box-sizing: border-box; + } + + .multiselect:focus { + outline: none; + } + + .multiselect--disabled { + background: #ededed; + pointer-events: none; + opacity: 0.6; + } + + .multiselect--active { + z-index: 50; + } + + .multiselect--active:not(.multiselect--above) .multiselect__current, + .multiselect--active:not(.multiselect--above) .multiselect__input, + .multiselect--active:not(.multiselect--above) .multiselect__tags { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + + .multiselect--active .multiselect__select { + transform: rotateZ(180deg); + } + + .multiselect--above.multiselect--active .multiselect__current, + .multiselect--above.multiselect--active .multiselect__input, + .multiselect--above.multiselect--active .multiselect__tags { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + + .multiselect__input, + .multiselect__single { + position: relative; + display: inline-block; + min-height: 20px; + line-height: 20px; + border: none; + border-radius: 5px; + background: #fff; + padding: 0 0 0 5px; + width: calc(100%); + transition: border 0.1s ease; + box-sizing: border-box; + margin-bottom: 8px; + vertical-align: top; + } + + .multiselect__input::placeholder { + color: #35495e; + } + + .multiselect__tag ~ .multiselect__input, + .multiselect__tag ~ .multiselect__single { + width: auto; + } + + .multiselect__input:hover, + .multiselect__single:hover { + border-color: #cfcfcf; + } + + .multiselect__input:focus, + .multiselect__single:focus { + border-color: #a8a8a8; + outline: none; + } + + .multiselect__single { + padding-left: 5px; + margin-bottom: 8px; + } + + .multiselect__tags-wrap { + display: inline; + } + + .multiselect__tags { + min-height: 40px; + display: block; + padding: 8px 40px 0 8px; + border-radius: 5px; + border: 1px solid #e8e8e8; + background: #fff; + font-size: 14px; + } + + .multiselect__tag { + position: relative; + display: inline-block; + padding: 4px 26px 4px 10px; + border-radius: 5px; + margin-right: 10px; + color: #fff; + line-height: 1; + background: #41b883; + margin-bottom: 5px; + white-space: nowrap; + overflow: hidden; + max-width: 100%; + text-overflow: ellipsis; + } + + .multiselect__tag-icon { + cursor: pointer; + margin-left: 7px; + position: absolute; + right: 0; + top: 0; + bottom: 0; + font-weight: 700; + font-style: initial; + width: 22px; + text-align: center; + line-height: 22px; + transition: all 0.2s ease; + border-radius: 5px; + } + + .multiselect__tag-icon::after { + content: "×"; + color: #266d4d; + font-size: 14px; + } + + /* // Remove these lines to avoid green closing button + //.multiselect__tag-icon:focus, + //.multiselect__tag-icon:hover { + // background: #369a6e; + //} */ + + .multiselect__tag-icon:focus::after, + .multiselect__tag-icon:hover::after { + color: white; + } + + .multiselect__current { + line-height: 16px; + min-height: 40px; + box-sizing: border-box; + display: block; + overflow: hidden; + padding: 8px 12px 0; + padding-right: 30px; + white-space: nowrap; + margin: 0; + text-decoration: none; + border-radius: 5px; + border: 1px solid #e8e8e8; + cursor: pointer; + } + + .multiselect__select { + line-height: 16px; + display: block; + position: absolute; + box-sizing: border-box; + width: 40px; + height: 38px; + right: 1px; + top: 1px; + padding: 4px 8px; + margin: 0; + text-decoration: none; + text-align: center; + cursor: pointer; + transition: transform 0.2s ease; + } + + .multiselect__select::before { + position: relative; + right: 0; + top: 65%; + color: #999; + margin-top: 4px; + border-style: solid; + border-width: 5px 5px 0 5px; + border-color: #999 transparent transparent transparent; + content: ""; + } + + .multiselect__placeholder { + color: #adadad; + display: inline-block; + margin-bottom: 10px; + padding-top: 2px; + } + + .multiselect--active .multiselect__placeholder { + display: none; + } + + .multiselect__content-wrapper { + position: absolute; + display: block; + background: #fff; + width: 100%; + max-height: 240px; + overflow: auto; + border: 1px solid #e8e8e8; + border-top: none; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + z-index: 50; + -webkit-overflow-scrolling: touch; + } + + .multiselect__content { + list-style: none; + display: inline-block; + padding: 0; + margin: 0; + min-width: 100%; + vertical-align: top; + } + + .multiselect--above .multiselect__content-wrapper { + bottom: 100%; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + border-bottom: none; + border-top: 1px solid #e8e8e8; + } + + .multiselect__content::-webkit-scrollbar { + display: none; + } + + .multiselect__element { + display: block; + } + + .multiselect__option { + display: block; + padding: 12px; + min-height: 40px; + line-height: 16px; + text-decoration: none; + text-transform: none; + vertical-align: middle; + position: relative; + cursor: pointer; + white-space: nowrap; + } + + .multiselect__option::after { + top: 0; + right: 0; + position: absolute; + line-height: 40px; + padding-right: 12px; + padding-left: 20px; + font-size: 13px; + } + + .multiselect__option--highlight { + background: #41b883; + outline: none; + color: white; + } + + .multiselect__option--highlight::after { + content: attr(data-select); + background: #41b883; + color: white; + } + + .multiselect__option--selected { + background: #f3f3f3; + color: #35495e; + font-weight: bold; + } + + .multiselect__option--selected::after { + content: attr(data-selected); + color: silver; + background: inherit; + } + + .multiselect__option--selected.multiselect__option--highlight { + background: #ff6a6a; + color: #fff; + } + + .multiselect__option--selected.multiselect__option--highlight::after { + background: #ff6a6a; + content: attr(data-deselect); + color: #fff; + } + + .multiselect--disabled .multiselect__current, + .multiselect--disabled .multiselect__select { + background: #ededed; + color: #a6a6a6; + } + + .multiselect__option--disabled { + background: #ededed !important; + color: #a6a6a6 !important; + cursor: text; + pointer-events: none; + } + + .multiselect__option--group { + background: #ededed; + color: #35495e; + } + + .multiselect__option--group.multiselect__option--highlight { + background: #35495e; + color: #fff; + } + + .multiselect__option--group.multiselect__option--highlight::after { + background: #35495e; + } + + .multiselect__option--disabled.multiselect__option--highlight { + background: #dedede; + } + + .multiselect__option--group-selected.multiselect__option--highlight { + background: #ff6a6a; + color: #fff; + } + + .multiselect__option--group-selected.multiselect__option--highlight::after { + background: #ff6a6a; + content: attr(data-deselect); + color: #fff; + } + + .multiselect-enter-active, + .multiselect-leave-active { + transition: all 0.15s ease; + } + + .multiselect-enter, + .multiselect-leave-active { + opacity: 0; + } + + .multiselect__strong { + margin-bottom: 8px; + line-height: 20px; + display: inline-block; + vertical-align: top; + } + + *[dir="rtl"] .multiselect { + text-align: right; + } + + *[dir="rtl"] .multiselect__select { + right: auto; + left: 1px; + } + + *[dir="rtl"] .multiselect__tags { + padding: 8px 8px 0 40px; + } + + *[dir="rtl"] .multiselect__content { + text-align: right; + } + + *[dir="rtl"] .multiselect__option::after { + right: auto; + left: 0; + } + + *[dir="rtl"] .multiselect__clear { + right: auto; + left: 12px; + } + + *[dir="rtl"] .multiselect__spinner { + right: auto; + left: 1px; + } + + @keyframes spinning { + from { + transform: rotate(0); + } + + to { + transform: rotate(2turn); + } + } diff --git a/dist/vue-multiselect.esm.css b/dist/vue-multiselect.esm.css new file mode 100644 index 00000000..9c9a6ad1 --- /dev/null +++ b/dist/vue-multiselect.esm.css @@ -0,0 +1,468 @@ + + + fieldset[disabled] .multiselect { + pointer-events: none; + } + + .multiselect__spinner { + position: absolute; + right: 1px; + top: 1px; + width: 40px; + height: 38px; + background: #fff; + display: block; + } + + .multiselect__spinner::before, + .multiselect__spinner::after { + position: absolute; + content: ""; + top: 50%; + left: 50%; + margin: -8px 0 0 -8px; + width: 16px; + height: 16px; + border-radius: 100%; + border-color: #41b883 transparent transparent; + border-style: solid; + border-width: 2px; + box-shadow: 0 0 0 1px transparent; + } + + .multiselect__spinner::before { + animation: spinning 2.4s cubic-bezier(0.41, 0.26, 0.2, 0.62); + animation-iteration-count: infinite; + } + + .multiselect__spinner::after { + animation: spinning 2.4s cubic-bezier(0.51, 0.09, 0.21, 0.8); + animation-iteration-count: infinite; + } + + .multiselect__loading-enter-active, + .multiselect__loading-leave-active { + transition: opacity 0.4s ease-in-out; + opacity: 1; + } + + .multiselect__loading-enter, + .multiselect__loading-leave-active { + opacity: 0; + } + + .multiselect, + .multiselect__input, + .multiselect__single { + font-family: inherit; + font-size: 16px; + touch-action: manipulation; + } + + .multiselect { + box-sizing: content-box; + display: block; + position: relative; + width: 100%; + min-height: 40px; + text-align: left; + color: #35495e; + } + + .multiselect * { + box-sizing: border-box; + } + + .multiselect:focus { + outline: none; + } + + .multiselect--disabled { + background: #ededed; + pointer-events: none; + opacity: 0.6; + } + + .multiselect--active { + z-index: 50; + } + + .multiselect--active:not(.multiselect--above) .multiselect__current, + .multiselect--active:not(.multiselect--above) .multiselect__input, + .multiselect--active:not(.multiselect--above) .multiselect__tags { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + + .multiselect--active .multiselect__select { + transform: rotateZ(180deg); + } + + .multiselect--above.multiselect--active .multiselect__current, + .multiselect--above.multiselect--active .multiselect__input, + .multiselect--above.multiselect--active .multiselect__tags { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + + .multiselect__input, + .multiselect__single { + position: relative; + display: inline-block; + min-height: 20px; + line-height: 20px; + border: none; + border-radius: 5px; + background: #fff; + padding: 0 0 0 5px; + width: calc(100%); + transition: border 0.1s ease; + box-sizing: border-box; + margin-bottom: 8px; + vertical-align: top; + } + + .multiselect__input::placeholder { + color: #35495e; + } + + .multiselect__tag ~ .multiselect__input, + .multiselect__tag ~ .multiselect__single { + width: auto; + } + + .multiselect__input:hover, + .multiselect__single:hover { + border-color: #cfcfcf; + } + + .multiselect__input:focus, + .multiselect__single:focus { + border-color: #a8a8a8; + outline: none; + } + + .multiselect__single { + padding-left: 5px; + margin-bottom: 8px; + } + + .multiselect__tags-wrap { + display: inline; + } + + .multiselect__tags { + min-height: 40px; + display: block; + padding: 8px 40px 0 8px; + border-radius: 5px; + border: 1px solid #e8e8e8; + background: #fff; + font-size: 14px; + } + + .multiselect__tag { + position: relative; + display: inline-block; + padding: 4px 26px 4px 10px; + border-radius: 5px; + margin-right: 10px; + color: #fff; + line-height: 1; + background: #41b883; + margin-bottom: 5px; + white-space: nowrap; + overflow: hidden; + max-width: 100%; + text-overflow: ellipsis; + } + + .multiselect__tag-icon { + cursor: pointer; + margin-left: 7px; + position: absolute; + right: 0; + top: 0; + bottom: 0; + font-weight: 700; + font-style: initial; + width: 22px; + text-align: center; + line-height: 22px; + transition: all 0.2s ease; + border-radius: 5px; + } + + .multiselect__tag-icon::after { + content: "×"; + color: #266d4d; + font-size: 14px; + } + + /* // Remove these lines to avoid green closing button + //.multiselect__tag-icon:focus, + //.multiselect__tag-icon:hover { + // background: #369a6e; + //} */ + + .multiselect__tag-icon:focus::after, + .multiselect__tag-icon:hover::after { + color: white; + } + + .multiselect__current { + line-height: 16px; + min-height: 40px; + box-sizing: border-box; + display: block; + overflow: hidden; + padding: 8px 12px 0; + padding-right: 30px; + white-space: nowrap; + margin: 0; + text-decoration: none; + border-radius: 5px; + border: 1px solid #e8e8e8; + cursor: pointer; + } + + .multiselect__select { + line-height: 16px; + display: block; + position: absolute; + box-sizing: border-box; + width: 40px; + height: 38px; + right: 1px; + top: 1px; + padding: 4px 8px; + margin: 0; + text-decoration: none; + text-align: center; + cursor: pointer; + transition: transform 0.2s ease; + } + + .multiselect__select::before { + position: relative; + right: 0; + top: 65%; + color: #999; + margin-top: 4px; + border-style: solid; + border-width: 5px 5px 0 5px; + border-color: #999 transparent transparent transparent; + content: ""; + } + + .multiselect__placeholder { + color: #adadad; + display: inline-block; + margin-bottom: 10px; + padding-top: 2px; + } + + .multiselect--active .multiselect__placeholder { + display: none; + } + + .multiselect__content-wrapper { + position: absolute; + display: block; + background: #fff; + width: 100%; + max-height: 240px; + overflow: auto; + border: 1px solid #e8e8e8; + border-top: none; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + z-index: 50; + -webkit-overflow-scrolling: touch; + } + + .multiselect__content { + list-style: none; + display: inline-block; + padding: 0; + margin: 0; + min-width: 100%; + vertical-align: top; + } + + .multiselect--above .multiselect__content-wrapper { + bottom: 100%; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + border-bottom: none; + border-top: 1px solid #e8e8e8; + } + + .multiselect__content::-webkit-scrollbar { + display: none; + } + + .multiselect__element { + display: block; + } + + .multiselect__option { + display: block; + padding: 12px; + min-height: 40px; + line-height: 16px; + text-decoration: none; + text-transform: none; + vertical-align: middle; + position: relative; + cursor: pointer; + white-space: nowrap; + } + + .multiselect__option::after { + top: 0; + right: 0; + position: absolute; + line-height: 40px; + padding-right: 12px; + padding-left: 20px; + font-size: 13px; + } + + .multiselect__option--highlight { + background: #41b883; + outline: none; + color: white; + } + + .multiselect__option--highlight::after { + content: attr(data-select); + background: #41b883; + color: white; + } + + .multiselect__option--selected { + background: #f3f3f3; + color: #35495e; + font-weight: bold; + } + + .multiselect__option--selected::after { + content: attr(data-selected); + color: silver; + background: inherit; + } + + .multiselect__option--selected.multiselect__option--highlight { + background: #ff6a6a; + color: #fff; + } + + .multiselect__option--selected.multiselect__option--highlight::after { + background: #ff6a6a; + content: attr(data-deselect); + color: #fff; + } + + .multiselect--disabled .multiselect__current, + .multiselect--disabled .multiselect__select { + background: #ededed; + color: #a6a6a6; + } + + .multiselect__option--disabled { + background: #ededed !important; + color: #a6a6a6 !important; + cursor: text; + pointer-events: none; + } + + .multiselect__option--group { + background: #ededed; + color: #35495e; + } + + .multiselect__option--group.multiselect__option--highlight { + background: #35495e; + color: #fff; + } + + .multiselect__option--group.multiselect__option--highlight::after { + background: #35495e; + } + + .multiselect__option--disabled.multiselect__option--highlight { + background: #dedede; + } + + .multiselect__option--group-selected.multiselect__option--highlight { + background: #ff6a6a; + color: #fff; + } + + .multiselect__option--group-selected.multiselect__option--highlight::after { + background: #ff6a6a; + content: attr(data-deselect); + color: #fff; + } + + .multiselect-enter-active, + .multiselect-leave-active { + transition: all 0.15s ease; + } + + .multiselect-enter, + .multiselect-leave-active { + opacity: 0; + } + + .multiselect__strong { + margin-bottom: 8px; + line-height: 20px; + display: inline-block; + vertical-align: top; + } + + *[dir="rtl"] .multiselect { + text-align: right; + } + + *[dir="rtl"] .multiselect__select { + right: auto; + left: 1px; + } + + *[dir="rtl"] .multiselect__tags { + padding: 8px 8px 0 40px; + } + + *[dir="rtl"] .multiselect__content { + text-align: right; + } + + *[dir="rtl"] .multiselect__option::after { + right: auto; + left: 0; + } + + *[dir="rtl"] .multiselect__clear { + right: auto; + left: 12px; + } + + *[dir="rtl"] .multiselect__spinner { + right: auto; + left: 1px; + } + + @keyframes spinning { + from { + transform: rotate(0); + } + + to { + transform: rotate(2turn); + } + } diff --git a/dist/vue-multiselect.esm.js b/dist/vue-multiselect.esm.js new file mode 100644 index 00000000..8f841133 --- /dev/null +++ b/dist/vue-multiselect.esm.js @@ -0,0 +1,1341 @@ +import { openBlock, createBlock, withKeys, withModifiers, renderSlot, createVNode, withDirectives, Fragment, renderList, toDisplayString, vShow, createCommentVNode, Transition, withCtx, createTextVNode } from 'vue'; + +function isEmpty (opt) { + if (opt === 0) return false + if (Array.isArray(opt) && opt.length === 0) return true + return !opt +} + +function not (fun) { + return (...params) => !fun(...params) +} + +function includes (str, query) { + /* istanbul ignore else */ + if (str === undefined) str = 'undefined'; + if (str === null) str = 'null'; + if (str === false) str = 'false'; + const text = str.toString().toLowerCase(); + return text.indexOf(query.trim()) !== -1 +} + +function filterOptions (options, search, label, customLabel) { + return search ? options + .filter((option) => includes(customLabel(option, label), search)) + .sort((a, b) => customLabel(a, label).length - customLabel(b, label).length) : options +} + +function stripGroups (options) { + return options.filter((option) => !option.$isLabel) +} + +function flattenOptions (values, label) { + return (options) => + options.reduce((prev, curr) => { + /* istanbul ignore else */ + if (curr[values] && curr[values].length) { + prev.push({ + $groupLabel: curr[label], + $isLabel: true + }); + return prev.concat(curr[values]) + } + return prev + }, []) +} + +function filterGroups (search, label, values, groupLabel, customLabel) { + return (groups) => + groups.map((group) => { + /* istanbul ignore else */ + if (!group[values]) { + console.warn(`Options passed to vue-multiselect do not contain groups, despite the config.`); + return [] + } + const groupOptions = filterOptions(group[values], search, label, customLabel); + + return groupOptions.length + ? { + [groupLabel]: group[groupLabel], + [values]: groupOptions + } + : [] + }) +} + +const flow = (...fns) => (x) => fns.reduce((v, f) => f(v), x); + +var multiselectMixin = { + data () { + return { + search: '', + isOpen: false, + preferredOpenDirection: 'below', + optimizedHeight: this.maxHeight + } + }, + props: { + /** + * Decide whether to filter the results based on search query. + * Useful for async filtering, where we search through more complex data. + * @type {Boolean} + */ + internalSearch: { + type: Boolean, + default: true + }, + /** + * Array of available options: Objects, Strings or Integers. + * If array of objects, visible label will default to option.label. + * If `labal` prop is passed, label will equal option['label'] + * @type {Array} + */ + options: { + type: Array, + required: true + }, + /** + * Equivalent to the `multiple` attribute on a `` input. + * @default 'Select option' + * @type {String} + */ + placeholder: { + type: String, + default: 'Select option' + }, + /** + * Allow to remove all selected values + * @default true + * @type {Boolean} + */ + allowEmpty: { + type: Boolean, + default: true + }, + /** + * Reset this.internalValue, this.search after this.internalValue changes. + * Useful if want to create a stateless dropdown. + * @default false + * @type {Boolean} + */ + resetAfter: { + type: Boolean, + default: false + }, + /** + * Enable/disable closing after selecting an option + * @default true + * @type {Boolean} + */ + closeOnSelect: { + type: Boolean, + default: true + }, + /** + * Function to interpolate the custom label + * @default false + * @type {Function} + */ + customLabel: { + type: Function, + default (option, label) { + if (isEmpty(option)) return '' + return label ? option[label] : option + } + }, + /** + * Disable / Enable tagging + * @default false + * @type {Boolean} + */ + taggable: { + type: Boolean, + default: false + }, + /** + * String to show when highlighting a potential tag + * @default 'Press enter to create a tag' + * @type {String} + */ + tagPlaceholder: { + type: String, + default: 'Press enter to create a tag' + }, + /** + * By default new tags will appear above the search results. + * Changing to 'bottom' will revert this behaviour + * and will proritize the search results + * @default 'top' + * @type {String} + */ + tagPosition: { + type: String, + default: 'top' + }, + /** + * Number of allowed selected options. No limit if 0. + * @default 0 + * @type {Number} + */ + max: { + type: [Number, Boolean], + default: false + }, + /** + * Will be passed with all events as second param. + * Useful for identifying events origin. + * @default null + * @type {String|Integer} + */ + id: { + default: null + }, + /** + * Limits the options displayed in the dropdown + * to the first X options. + * @default 1000 + * @type {Integer} + */ + optionsLimit: { + type: Number, + default: 1000 + }, + /** + * Name of the property containing + * the group values + * @default 1000 + * @type {String} + */ + groupValues: { + type: String + }, + /** + * Name of the property containing + * the group label + * @default 1000 + * @type {String} + */ + groupLabel: { + type: String + }, + /** + * Allow to select all group values + * by selecting the group label + * @default false + * @type {Boolean} + */ + groupSelect: { + type: Boolean, + default: false + }, + /** + * Array of keyboard keys to block + * when selecting + * @default 1000 + * @type {String} + */ + blockKeys: { + type: Array, + default () { + return [] + } + }, + /** + * Prevent from wiping up the search value + * @default false + * @type {Boolean} + */ + preserveSearch: { + type: Boolean, + default: false + }, + /** + * Select 1st options if value is empty + * @default false + * @type {Boolean} + */ + preselectFirst: { + type: Boolean, + default: false + }, + /** + * Prevent autofocus + * @default false + * @type {Boolean} + */ + preventAutofocus: { + type: Boolean, + default: false + } + }, + mounted () { + /* istanbul ignore else */ + if (!this.multiple && this.max) { + console.warn('[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false.'); + } + if ( + this.preselectFirst && + !this.internalValue.length && + this.options.length + ) { + this.select(this.filteredOptions[0]); + } + }, + computed: { + internalValue () { + return this.modelValue || this.modelValue === 0 + ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue] + : [] + }, + filteredOptions () { + const search = this.search || ''; + const normalizedSearch = search.toLowerCase().trim(); + + let options = this.options.concat(); + + /* istanbul ignore else */ + if (this.internalSearch) { + options = this.groupValues + ? this.filterAndFlat(options, normalizedSearch, this.label) + : filterOptions(options, normalizedSearch, this.label, this.customLabel); + } else { + options = this.groupValues ? flattenOptions(this.groupValues, this.groupLabel)(options) : options; + } + + options = this.hideSelected + ? options.filter(not(this.isSelected)) + : options; + + /* istanbul ignore else */ + if (this.taggable && normalizedSearch.length && !this.isExistingOption(normalizedSearch)) { + if (this.tagPosition === 'bottom') { + options.push({isTag: true, label: search}); + } else { + options.unshift({isTag: true, label: search}); + } + } + + return options.slice(0, this.optionsLimit) + }, + valueKeys () { + if (this.trackBy) { + return this.internalValue.map((element) => element[this.trackBy]) + } else { + return this.internalValue + } + }, + optionKeys () { + const options = this.groupValues ? this.flatAndStrip(this.options) : this.options; + return options.map((element) => this.customLabel(element, this.label).toString().toLowerCase()) + }, + currentOptionLabel () { + return this.multiple + ? this.searchable ? '' : this.placeholder + : this.internalValue.length + ? this.getOptionLabel(this.internalValue[0]) + : this.searchable ? '' : this.placeholder + } + }, + watch: { + internalValue () { + /* istanbul ignore else */ + if (this.resetAfter && this.internalValue.length) { + this.search = ''; + this.$emit('update:modelValue', this.multiple ? [] : null); + } + }, + search () { + this.$emit('search-change', this.search); + } + }, + emits: ['open', 'search-change', 'close', 'select', 'update:modelValue', 'remove', 'tag'], + methods: { + /** + * Returns the internalValue in a way it can be emited to the parent + * @returns {Object||Array||String||Integer} + */ + getValue () { + return this.multiple + ? this.internalValue + : this.internalValue.length === 0 + ? null + : this.internalValue[0] + }, + /** + * Filters and then flattens the options list + * @param {Array} + * @return {Array} returns a filtered and flat options list + */ + filterAndFlat (options, search, label) { + return flow( + filterGroups(search, label, this.groupValues, this.groupLabel, this.customLabel), + flattenOptions(this.groupValues, this.groupLabel) + )(options) + }, + /** + * Flattens and then strips the group labels from the options list + * @param {Array} + * @return {Array} returns a flat options list without group labels + */ + flatAndStrip (options) { + return flow( + flattenOptions(this.groupValues, this.groupLabel), + stripGroups + )(options) + }, + /** + * Updates the search value + * @param {String} + */ + updateSearch (query) { + this.search = query; + }, + /** + * Finds out if the given query is already present + * in the available options + * @param {String} + * @return {Boolean} returns true if element is available + */ + isExistingOption (query) { + return !this.options + ? false + : this.optionKeys.indexOf(query) > -1 + }, + /** + * Finds out if the given element is already present + * in the result value + * @param {Object||String||Integer} option passed element to check + * @returns {Boolean} returns true if element is selected + */ + isSelected (option) { + const opt = this.trackBy + ? option[this.trackBy] + : option; + return this.valueKeys.indexOf(opt) > -1 + }, + /** + * Finds out if the given option is disabled + * @param {Object||String||Integer} option passed element to check + * @returns {Boolean} returns true if element is disabled + */ + isOptionDisabled (option) { + return !!option.$isDisabled + }, + /** + * Returns empty string when options is null/undefined + * Returns tag query if option is tag. + * Returns the customLabel() results and casts it to string. + * + * @param {Object||String||Integer} Passed option + * @returns {Object||String} + */ + getOptionLabel (option) { + if (isEmpty(option)) return '' + /* istanbul ignore else */ + if (option.isTag) return option.label + /* istanbul ignore else */ + if (option.$isLabel) return option.$groupLabel + + const label = this.customLabel(option, this.label); + /* istanbul ignore else */ + if (isEmpty(label)) return '' + return label + }, + /** + * Add the given option to the list of selected options + * or sets the option as the selected option. + * If option is already selected -> remove it from the results. + * + * @param {Object||String||Integer} option to select/deselect + * @param {Boolean} block removing + */ + select (option, key) { + /* istanbul ignore else */ + if (option.$isLabel && this.groupSelect) { + this.selectGroup(option); + return + } + if (this.blockKeys.indexOf(key) !== -1 || + this.disabled || + option.$isDisabled || + option.$isLabel + ) return + /* istanbul ignore else */ + if (this.max && this.multiple && this.internalValue.length === this.max) return + /* istanbul ignore else */ + if (key === 'Tab' && !this.pointerDirty) return + if (option.isTag) { + this.$emit('tag', option.label, this.id); + this.search = ''; + if (this.closeOnSelect && !this.multiple) this.deactivate(); + } else { + const isSelected = this.isSelected(option); + + if (isSelected) { + if (key !== 'Tab') this.removeElement(option); + return + } + + if (this.multiple) { + this.$emit('update:modelValue', this.internalValue.concat([option])); + } else { + this.$emit('update:modelValue', option); + } + + this.$emit('select', option, this.id); + + /* istanbul ignore else */ + if (this.clearOnSelect) this.search = ''; + } + /* istanbul ignore else */ + if (this.closeOnSelect) this.deactivate(); + }, + /** + * Add the given group options to the list of selected options + * If all group optiona are already selected -> remove it from the results. + * + * @param {Object||String||Integer} group to select/deselect + */ + selectGroup (selectedGroup) { + const group = this.options.find((option) => { + return option[this.groupLabel] === selectedGroup.$groupLabel + }); + + if (!group) return + + if (this.wholeGroupSelected(group)) { + this.$emit('remove', group[this.groupValues], this.id); + + const newValue = this.internalValue.filter( + (option) => group[this.groupValues].indexOf(option) === -1 + ); + + this.$emit('update:modelValue', newValue); + } else { + let optionsToAdd = group[this.groupValues].filter( + option => !(this.isOptionDisabled(option) || this.isSelected(option)) + ); + + // if max is defined then just select options respecting max + if (this.max) { + optionsToAdd.splice(this.max - this.internalValue.length); + } + + this.$emit('select', optionsToAdd, this.id); + this.$emit( + 'update:modelValue', + this.internalValue.concat(optionsToAdd) + ); + } + + if (this.closeOnSelect) this.deactivate(); + }, + /** + * Helper to identify if all values in a group are selected + * + * @param {Object} group to validated selected values against + */ + wholeGroupSelected (group) { + return group[this.groupValues].every((option) => this.isSelected(option) || this.isOptionDisabled(option) + ) + }, + /** + * Helper to identify if all values in a group are disabled + * + * @param {Object} group to check for disabled values + */ + wholeGroupDisabled (group) { + return group[this.groupValues].every(this.isOptionDisabled) + }, + /** + * Removes the given option from the selected options. + * Additionally checks this.allowEmpty prop if option can be removed when + * it is the last selected option. + * + * @param {type} option description + * @return {type} description + */ + removeElement (option, shouldClose = true) { + /* istanbul ignore else */ + if (this.disabled) return + /* istanbul ignore else */ + if (option.$isDisabled) return + /* istanbul ignore else */ + if (!this.allowEmpty && this.internalValue.length <= 1) { + this.deactivate(); + return + } + + const index = typeof option === 'object' + ? this.valueKeys.indexOf(option[this.trackBy]) + : this.valueKeys.indexOf(option); + + if (this.multiple) { + const newValue = this.internalValue.slice(0, index).concat(this.internalValue.slice(index + 1)); + this.$emit('update:modelValue', newValue); + } else { + this.$emit('update:modelValue', null); + } + this.$emit('remove', option, this.id); + + /* istanbul ignore else */ + if (this.closeOnSelect && shouldClose) this.deactivate(); + }, + /** + * Calls this.removeElement() with the last element + * from this.internalValue (selected element Array) + * + * @fires this#removeElement + */ + removeLastElement () { + /* istanbul ignore else */ + if (this.blockKeys.indexOf('Delete') !== -1) return + /* istanbul ignore else */ + if (this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length) { + this.removeElement(this.internalValue[this.internalValue.length - 1], false); + } + }, + /** + * Opens the multiselect’s dropdown. + * Sets this.isOpen to TRUE + */ + activate () { + /* istanbul ignore else */ + if (this.isOpen || this.disabled) return + + this.adjustPosition(); + /* istanbul ignore else */ + if (this.groupValues && this.pointer === 0 && this.filteredOptions.length) { + this.pointer = 1; + } + + this.isOpen = true; + /* istanbul ignore else */ + if (this.searchable) { + if (!this.preserveSearch) this.search = ''; + if (!this.preventAutofocus) this.$nextTick(() => this.$refs.search && this.$refs.search.focus()); + } else if (!this.preventAutofocus) { + if (typeof this.$el !== 'undefined') this.$el.focus(); + } + this.$emit('open', this.id); + }, + /** + * Closes the multiselect’s dropdown. + * Sets this.isOpen to FALSE + */ + deactivate () { + /* istanbul ignore else */ + if (!this.isOpen) return + + this.isOpen = false; + /* istanbul ignore else */ + if (this.searchable) { + if (typeof this.$refs.search !== 'undefined') this.$refs.search.blur(); + } else { + if (typeof this.$el !== 'undefined') this.$el.blur(); + } + if (!this.preserveSearch) this.search = ''; + this.$emit('close', this.getValue(), this.id); + }, + /** + * Call this.activate() or this.deactivate() + * depending on this.isOpen value. + * + * @fires this#activate || this#deactivate + * @property {Boolean} isOpen indicates if dropdown is open + */ + toggle () { + this.isOpen + ? this.deactivate() + : this.activate(); + }, + /** + * Updates the hasEnoughSpace variable used for + * detecting where to expand the dropdown + */ + adjustPosition () { + if (typeof window === 'undefined') return + + const spaceAbove = this.$el.getBoundingClientRect().top; + const spaceBelow = window.innerHeight - this.$el.getBoundingClientRect().bottom; + const hasEnoughSpaceBelow = spaceBelow > this.maxHeight; + + if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || this.openDirection === 'below' || this.openDirection === 'bottom') { + this.preferredOpenDirection = 'below'; + this.optimizedHeight = Math.min(spaceBelow - 40, this.maxHeight); + } else { + this.preferredOpenDirection = 'above'; + this.optimizedHeight = Math.min(spaceAbove - 40, this.maxHeight); + } + } + } +}; + +var pointerMixin = { + data () { + return { + pointer: 0, + pointerDirty: false + } + }, + props: { + /** + * Enable/disable highlighting of the pointed value. + * @type {Boolean} + * @default true + */ + showPointer: { + type: Boolean, + default: true + }, + optionHeight: { + type: Number, + default: 40 + } + }, + computed: { + pointerPosition () { + return this.pointer * this.optionHeight + }, + visibleElements () { + return this.optimizedHeight / this.optionHeight + } + }, + watch: { + filteredOptions () { + this.pointerAdjust(); + }, + isOpen () { + this.pointerDirty = false; + }, + pointer () { + this.$refs.search && this.$refs.search.setAttribute('aria-activedescendant', this.id + '-' + this.pointer.toString()); + } + }, + methods: { + optionHighlight (index, option) { + return { + 'multiselect__option--highlight': index === this.pointer && this.showPointer, + 'multiselect__option--selected': this.isSelected(option) + } + }, + groupHighlight (index, selectedGroup) { + if (!this.groupSelect) { + return [ + 'multiselect__option--disabled', + {'multiselect__option--group': selectedGroup.$isLabel} + ] + } + + const group = this.options.find((option) => { + return option[this.groupLabel] === selectedGroup.$groupLabel + }); + + return group && !this.wholeGroupDisabled(group) ? [ + 'multiselect__option--group', + {'multiselect__option--highlight': index === this.pointer && this.showPointer}, + {'multiselect__option--group-selected': this.wholeGroupSelected(group)} + ] : 'multiselect__option--disabled' + }, + addPointerElement ({key} = 'Enter') { + /* istanbul ignore else */ + if (this.filteredOptions.length > 0) { + this.select(this.filteredOptions[this.pointer], key); + } + this.pointerReset(); + }, + pointerForward () { + /* istanbul ignore else */ + if (this.pointer < this.filteredOptions.length - 1) { + this.pointer++; + /* istanbul ignore next */ + if (this.$refs.list.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight) { + this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight; + } + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) this.pointerForward(); + } + this.pointerDirty = true; + }, + pointerBackward () { + if (this.pointer > 0) { + this.pointer--; + /* istanbul ignore else */ + if (this.$refs.list.scrollTop >= this.pointerPosition) { + this.$refs.list.scrollTop = this.pointerPosition; + } + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) this.pointerBackward(); + } else { + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[0].$isLabel && + !this.groupSelect + ) this.pointerForward(); + } + this.pointerDirty = true; + }, + pointerReset () { + /* istanbul ignore else */ + if (!this.closeOnSelect) return + this.pointer = 0; + /* istanbul ignore else */ + if (this.$refs.list) { + this.$refs.list.scrollTop = 0; + } + }, + pointerAdjust () { + /* istanbul ignore else */ + if (this.pointer >= this.filteredOptions.length - 1) { + this.pointer = this.filteredOptions.length + ? this.filteredOptions.length - 1 + : 0; + } + + if (this.filteredOptions.length > 0 && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) { + this.pointerForward(); + } + }, + pointerSet (index) { + this.pointer = index; + this.pointerDirty = true; + } + } +}; + +var script = { + name: 'vue-multiselect', + mixins: [multiselectMixin, pointerMixin], + props: { + /** + * name attribute to match optional label element + * @default '' + * @type {String} + */ + name: { + type: String, + default: '' + }, + /** + * Presets the selected options value. + * @type {Object||Array||String||Integer} + */ + modelValue: { + type: null, + default () { + return [] + } + }, + /** + * String to show when pointing to an option + * @default 'Press enter to select' + * @type {String} + */ + selectLabel: { + type: String, + default: 'Press enter to select' + }, + /** + * String to show when pointing to an option + * @default 'Press enter to select' + * @type {String} + */ + selectGroupLabel: { + type: String, + default: 'Press enter to select group' + }, + /** + * String to show next to selected option + * @default 'Selected' + * @type {String} + */ + selectedLabel: { + type: String, + default: 'Selected' + }, + /** + * String to show when pointing to an already selected option + * @default 'Press enter to remove' + * @type {String} + */ + deselectLabel: { + type: String, + default: 'Press enter to remove' + }, + /** + * String to show when pointing to an already selected option + * @default 'Press enter to remove' + * @type {String} + */ + deselectGroupLabel: { + type: String, + default: 'Press enter to deselect group' + }, + /** + * Decide whether to show pointer labels + * @default true + * @type {Boolean} + */ + showLabels: { + type: Boolean, + default: true + }, + /** + * Limit the display of selected options. The rest will be hidden within the limitText string. + * @default 99999 + * @type {Integer} + */ + limit: { + type: Number, + default: 99999 + }, + /** + * Sets maxHeight style value of the dropdown + * @default 300 + * @type {Integer} + */ + maxHeight: { + type: Number, + default: 300 + }, + /** + * Function that process the message shown when selected + * elements pass the defined limit. + * @default 'and * more' + * @param {Int} count Number of elements more than limit + * @type {Function} + */ + limitText: { + type: Function, + default: (count) => `and ${count} more` + }, + /** + * Set true to trigger the loading spinner. + * @default False + * @type {Boolean} + */ + loading: { + type: Boolean, + default: false + }, + /** + * Disables the multiselect if true. + * @default false + * @type {Boolean} + */ + disabled: { + type: Boolean, + default: false + }, + /** + * Fixed opening direction + * @default '' + * @type {String} + */ + openDirection: { + type: String, + default: '' + }, + /** + * Shows slot with message about empty options + * @default true + * @type {Boolean} + */ + showNoOptions: { + type: Boolean, + default: true + }, + showNoResults: { + type: Boolean, + default: true + }, + tabindex: { + type: Number, + default: 0 + } + }, + computed: { + hasOptionGroup () { + return this.groupValues && this.groupLabel && this.groupSelect + }, + isSingleLabelVisible () { + return ( + (this.singleValue || this.singleValue === 0) && + (!this.isOpen || !this.searchable) && + !this.visibleValues.length + ) + }, + isPlaceholderVisible () { + return !this.internalValue.length && (!this.searchable || !this.isOpen) + }, + visibleValues () { + return this.multiple ? this.internalValue.slice(0, this.limit) : [] + }, + singleValue () { + return this.internalValue[0] + }, + deselectLabelText () { + return this.showLabels ? this.deselectLabel : '' + }, + deselectGroupLabelText () { + return this.showLabels ? this.deselectGroupLabel : '' + }, + selectLabelText () { + return this.showLabels ? this.selectLabel : '' + }, + selectGroupLabelText () { + return this.showLabels ? this.selectGroupLabel : '' + }, + selectedLabelText () { + return this.showLabels ? this.selectedLabel : '' + }, + inputStyle () { + if ( + this.searchable || + (this.multiple && this.modelValue && this.modelValue.length) + ) { + // Hide input by setting the width to 0 allowing it to receive focus + return this.isOpen + ? {width: '100%'} + : {width: '0', position: 'absolute', padding: '0'} + } + return '' + }, + contentStyle () { + return this.options.length + ? {display: 'inline-block'} + : {display: 'block'} + }, + isAbove () { + if (this.openDirection === 'above' || this.openDirection === 'top') { + return true + } else if ( + this.openDirection === 'below' || + this.openDirection === 'bottom' + ) { + return false + } else { + return this.preferredOpenDirection === 'above' + } + }, + showSearchInput () { + return ( + this.searchable && + (this.hasSingleSelectedSlot && + (this.visibleSingleValue || this.visibleSingleValue === 0) + ? this.isOpen + : true) + ) + } + } +}; + +const _hoisted_1 = { + ref: "tags", + class: "multiselect__tags" +}; +const _hoisted_2 = { class: "multiselect__tags-wrap" }; +const _hoisted_3 = { class: "multiselect__spinner" }; +const _hoisted_4 = { key: 0 }; +const _hoisted_5 = { class: "multiselect__option" }; +const _hoisted_6 = { class: "multiselect__option" }; +const _hoisted_7 = /*#__PURE__*/createTextVNode("No elements found. Consider changing the search query."); +const _hoisted_8 = { class: "multiselect__option" }; +const _hoisted_9 = /*#__PURE__*/createTextVNode("List is empty."); + +function render(_ctx, _cache, $props, $setup, $data, $options) { + return (openBlock(), createBlock("div", { + tabindex: _ctx.searchable ? -1 : $props.tabindex, + class: [{ 'multiselect--active': _ctx.isOpen, 'multiselect--disabled': $props.disabled, 'multiselect--above': $options.isAbove, 'multiselect--has-options-group': $options.hasOptionGroup }, "multiselect"], + onFocus: _cache[14] || (_cache[14] = $event => (_ctx.activate())), + onBlur: _cache[15] || (_cache[15] = $event => (_ctx.searchable ? false : _ctx.deactivate())), + onKeydown: [ + _cache[16] || (_cache[16] = withKeys(withModifiers($event => (_ctx.pointerForward()), ["self","prevent"]), ["down"])), + _cache[17] || (_cache[17] = withKeys(withModifiers($event => (_ctx.pointerBackward()), ["self","prevent"]), ["up"])) + ], + onKeypress: _cache[18] || (_cache[18] = withKeys(withModifiers($event => (_ctx.addPointerElement($event)), ["stop","self"]), ["enter","tab"])), + onKeyup: _cache[19] || (_cache[19] = withKeys($event => (_ctx.deactivate()), ["esc"])), + role: "combobox", + "aria-owns": 'listbox-'+_ctx.id + }, [ + renderSlot(_ctx.$slots, "caret", { toggle: _ctx.toggle }, () => [ + createVNode("div", { + onMousedown: _cache[1] || (_cache[1] = withModifiers($event => (_ctx.toggle()), ["prevent","stop"])), + class: "multiselect__select" + }, null, 32 /* HYDRATE_EVENTS */) + ]), + renderSlot(_ctx.$slots, "clear", { search: _ctx.search }), + createVNode("div", _hoisted_1, [ + renderSlot(_ctx.$slots, "selection", { + search: _ctx.search, + remove: _ctx.removeElement, + values: $options.visibleValues, + isOpen: _ctx.isOpen + }, () => [ + withDirectives(createVNode("div", _hoisted_2, [ + (openBlock(true), createBlock(Fragment, null, renderList($options.visibleValues, (option, index) => { + return renderSlot(_ctx.$slots, "tag", { + option: option, + search: _ctx.search, + remove: _ctx.removeElement + }, () => [ + (openBlock(), createBlock("span", { + class: "multiselect__tag", + key: index + }, [ + createVNode("span", { + textContent: toDisplayString(_ctx.getOptionLabel(option)) + }, null, 8 /* PROPS */, ["textContent"]), + createVNode("i", { + tabindex: "1", + onKeypress: withKeys(withModifiers($event => (_ctx.removeElement(option)), ["prevent"]), ["enter"]), + onMousedown: withModifiers($event => (_ctx.removeElement(option)), ["prevent"]), + class: "multiselect__tag-icon" + }, null, 40 /* PROPS, HYDRATE_EVENTS */, ["onKeypress", "onMousedown"]) + ])) + ]) + }), 256 /* UNKEYED_FRAGMENT */)) + ], 512 /* NEED_PATCH */), [ + [vShow, $options.visibleValues.length > 0] + ]), + (_ctx.internalValue && _ctx.internalValue.length > $props.limit) + ? renderSlot(_ctx.$slots, "limit", { key: 0 }, () => [ + createVNode("strong", { + class: "multiselect__strong", + textContent: toDisplayString($props.limitText(_ctx.internalValue.length - $props.limit)) + }, null, 8 /* PROPS */, ["textContent"]) + ]) + : createCommentVNode("v-if", true) + ]), + createVNode(Transition, { name: "multiselect__loading" }, { + default: withCtx(() => [ + renderSlot(_ctx.$slots, "loading", {}, () => [ + withDirectives(createVNode("div", _hoisted_3, null, 512 /* NEED_PATCH */), [ + [vShow, $props.loading] + ]) + ]) + ]), + _: 3 /* FORWARDED */ + }), + (_ctx.searchable) + ? (openBlock(), createBlock("input", { + key: 0, + ref: "search", + name: $props.name, + id: _ctx.id, + type: "text", + autocomplete: "off", + spellcheck: "false", + placeholder: _ctx.placeholder, + style: $options.inputStyle, + value: _ctx.search, + disabled: $props.disabled, + tabindex: $props.tabindex, + onInput: _cache[2] || (_cache[2] = $event => (_ctx.updateSearch($event.target.value))), + onFocus: _cache[3] || (_cache[3] = withModifiers($event => (_ctx.activate()), ["prevent"])), + onBlur: _cache[4] || (_cache[4] = withModifiers($event => (_ctx.deactivate()), ["prevent"])), + onKeyup: _cache[5] || (_cache[5] = withKeys($event => (_ctx.deactivate()), ["esc"])), + onKeydown: [ + _cache[6] || (_cache[6] = withKeys(withModifiers($event => (_ctx.pointerForward()), ["prevent"]), ["down"])), + _cache[7] || (_cache[7] = withKeys(withModifiers($event => (_ctx.pointerBackward()), ["prevent"]), ["up"])), + _cache[9] || (_cache[9] = withKeys(withModifiers($event => (_ctx.removeLastElement()), ["stop"]), ["delete"])) + ], + onKeypress: _cache[8] || (_cache[8] = withKeys(withModifiers($event => (_ctx.addPointerElement($event)), ["prevent","stop","self"]), ["enter"])), + class: "multiselect__input", + "aria-controls": 'listbox-'+_ctx.id + }, null, 44 /* STYLE, PROPS, HYDRATE_EVENTS */, ["name", "id", "placeholder", "value", "disabled", "tabindex", "aria-controls"])) + : createCommentVNode("v-if", true), + ($options.isSingleLabelVisible) + ? (openBlock(), createBlock("span", { + key: 1, + class: "multiselect__single", + onMousedown: _cache[10] || (_cache[10] = withModifiers((...args) => (_ctx.toggle && _ctx.toggle(...args)), ["prevent"])) + }, [ + renderSlot(_ctx.$slots, "singleLabel", { option: $options.singleValue }, () => [ + createTextVNode(toDisplayString(_ctx.currentOptionLabel), 1 /* TEXT */) + ]) + ], 32 /* HYDRATE_EVENTS */)) + : createCommentVNode("v-if", true), + ($options.isPlaceholderVisible) + ? (openBlock(), createBlock("span", { + key: 2, + class: "multiselect__placeholder", + onMousedown: _cache[11] || (_cache[11] = withModifiers((...args) => (_ctx.toggle && _ctx.toggle(...args)), ["prevent"])) + }, [ + renderSlot(_ctx.$slots, "placeholder", {}, () => [ + createTextVNode(toDisplayString(_ctx.placeholder), 1 /* TEXT */) + ]) + ], 32 /* HYDRATE_EVENTS */)) + : createCommentVNode("v-if", true) + ], 512 /* NEED_PATCH */), + createVNode(Transition, { name: "multiselect" }, { + default: withCtx(() => [ + withDirectives(createVNode("div", { + class: "multiselect__content-wrapper", + onFocus: _cache[12] || (_cache[12] = (...args) => (_ctx.activate && _ctx.activate(...args))), + tabindex: "-1", + onMousedown: _cache[13] || (_cache[13] = withModifiers(() => {}, ["prevent"])), + style: { maxHeight: _ctx.optimizedHeight + 'px' }, + ref: "list" + }, [ + createVNode("ul", { + class: "multiselect__content", + style: $options.contentStyle, + role: "listbox", + id: 'listbox-'+_ctx.id + }, [ + renderSlot(_ctx.$slots, "beforeList"), + (_ctx.multiple && _ctx.max === _ctx.internalValue.length) + ? (openBlock(), createBlock("li", _hoisted_4, [ + createVNode("span", _hoisted_5, [ + renderSlot(_ctx.$slots, "maxElements", {}, () => [ + createTextVNode("Maximum of " + toDisplayString(_ctx.max) + " options selected. First remove a selected option to select another.", 1 /* TEXT */) + ]) + ]) + ])) + : createCommentVNode("v-if", true), + (!_ctx.max || _ctx.internalValue.length < _ctx.max) + ? (openBlock(true), createBlock(Fragment, { key: 1 }, renderList(_ctx.filteredOptions, (option, index) => { + return (openBlock(), createBlock("li", { + class: "multiselect__element", + key: index, + id: _ctx.id + '-' + index, + role: !(option && (option.$isLabel || option.$isDisabled)) ? 'option' : null + }, [ + (!(option && (option.$isLabel || option.$isDisabled))) + ? (openBlock(), createBlock("span", { + key: 0, + class: [_ctx.optionHighlight(index, option), "multiselect__option"], + onClick: withModifiers($event => (_ctx.select(option)), ["stop"]), + onMouseenter: withModifiers($event => (_ctx.pointerSet(index)), ["self"]), + "data-select": option && option.isTag ? _ctx.tagPlaceholder : $options.selectLabelText, + "data-selected": $options.selectedLabelText, + "data-deselect": $options.deselectLabelText + }, [ + renderSlot(_ctx.$slots, "option", { + option: option, + search: _ctx.search, + index: index + }, () => [ + createVNode("span", null, toDisplayString(_ctx.getOptionLabel(option)), 1 /* TEXT */) + ]) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"])) + : createCommentVNode("v-if", true), + (option && (option.$isLabel || option.$isDisabled)) + ? (openBlock(), createBlock("span", { + key: 1, + "data-select": _ctx.groupSelect && $options.selectGroupLabelText, + "data-deselect": _ctx.groupSelect && $options.deselectGroupLabelText, + class: [_ctx.groupHighlight(index, option), "multiselect__option"], + onMouseenter: withModifiers($event => (_ctx.groupSelect && _ctx.pointerSet(index)), ["self"]), + onMousedown: withModifiers($event => (_ctx.selectGroup(option)), ["prevent"]) + }, [ + renderSlot(_ctx.$slots, "option", { + option: option, + search: _ctx.search, + index: index + }, () => [ + createVNode("span", null, toDisplayString(_ctx.getOptionLabel(option)), 1 /* TEXT */) + ]) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["data-select", "data-deselect", "onMouseenter", "onMousedown"])) + : createCommentVNode("v-if", true) + ], 8 /* PROPS */, ["id", "role"])) + }), 128 /* KEYED_FRAGMENT */)) + : createCommentVNode("v-if", true), + withDirectives(createVNode("li", null, [ + createVNode("span", _hoisted_6, [ + renderSlot(_ctx.$slots, "noResult", { search: _ctx.search }, () => [ + _hoisted_7 + ]) + ]) + ], 512 /* NEED_PATCH */), [ + [vShow, $props.showNoResults && (_ctx.filteredOptions.length === 0 && _ctx.search && !$props.loading)] + ]), + withDirectives(createVNode("li", null, [ + createVNode("span", _hoisted_8, [ + renderSlot(_ctx.$slots, "noOptions", {}, () => [ + _hoisted_9 + ]) + ]) + ], 512 /* NEED_PATCH */), [ + [vShow, $props.showNoOptions && ((_ctx.options.length === 0 || ($options.hasOptionGroup === true && _ctx.filteredOptions.length === 0)) && !_ctx.search && !$props.loading)] + ]), + renderSlot(_ctx.$slots, "afterList") + ], 12 /* STYLE, PROPS */, ["id"]) + ], 36 /* STYLE, HYDRATE_EVENTS */), [ + [vShow, _ctx.isOpen] + ]) + ]), + _: 3 /* FORWARDED */ + }) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["tabindex", "aria-owns"])) +} + +script.render = render; + +export default script; +export { script as Multiselect, multiselectMixin, pointerMixin }; diff --git a/dist/vue-multiselect.js b/dist/vue-multiselect.js new file mode 100644 index 00000000..3dcd0110 --- /dev/null +++ b/dist/vue-multiselect.js @@ -0,0 +1,1350 @@ +var VueMultiselect = (function (exports, vue) { + 'use strict'; + + function isEmpty (opt) { + if (opt === 0) return false + if (Array.isArray(opt) && opt.length === 0) return true + return !opt + } + + function not (fun) { + return (...params) => !fun(...params) + } + + function includes (str, query) { + /* istanbul ignore else */ + if (str === undefined) str = 'undefined'; + if (str === null) str = 'null'; + if (str === false) str = 'false'; + const text = str.toString().toLowerCase(); + return text.indexOf(query.trim()) !== -1 + } + + function filterOptions (options, search, label, customLabel) { + return search ? options + .filter((option) => includes(customLabel(option, label), search)) + .sort((a, b) => customLabel(a, label).length - customLabel(b, label).length) : options + } + + function stripGroups (options) { + return options.filter((option) => !option.$isLabel) + } + + function flattenOptions (values, label) { + return (options) => + options.reduce((prev, curr) => { + /* istanbul ignore else */ + if (curr[values] && curr[values].length) { + prev.push({ + $groupLabel: curr[label], + $isLabel: true + }); + return prev.concat(curr[values]) + } + return prev + }, []) + } + + function filterGroups (search, label, values, groupLabel, customLabel) { + return (groups) => + groups.map((group) => { + /* istanbul ignore else */ + if (!group[values]) { + console.warn(`Options passed to vue-multiselect do not contain groups, despite the config.`); + return [] + } + const groupOptions = filterOptions(group[values], search, label, customLabel); + + return groupOptions.length + ? { + [groupLabel]: group[groupLabel], + [values]: groupOptions + } + : [] + }) + } + + const flow = (...fns) => (x) => fns.reduce((v, f) => f(v), x); + + var multiselectMixin = { + data () { + return { + search: '', + isOpen: false, + preferredOpenDirection: 'below', + optimizedHeight: this.maxHeight + } + }, + props: { + /** + * Decide whether to filter the results based on search query. + * Useful for async filtering, where we search through more complex data. + * @type {Boolean} + */ + internalSearch: { + type: Boolean, + default: true + }, + /** + * Array of available options: Objects, Strings or Integers. + * If array of objects, visible label will default to option.label. + * If `labal` prop is passed, label will equal option['label'] + * @type {Array} + */ + options: { + type: Array, + required: true + }, + /** + * Equivalent to the `multiple` attribute on a `` input. + * @default 'Select option' + * @type {String} + */ + placeholder: { + type: String, + default: 'Select option' + }, + /** + * Allow to remove all selected values + * @default true + * @type {Boolean} + */ + allowEmpty: { + type: Boolean, + default: true + }, + /** + * Reset this.internalValue, this.search after this.internalValue changes. + * Useful if want to create a stateless dropdown. + * @default false + * @type {Boolean} + */ + resetAfter: { + type: Boolean, + default: false + }, + /** + * Enable/disable closing after selecting an option + * @default true + * @type {Boolean} + */ + closeOnSelect: { + type: Boolean, + default: true + }, + /** + * Function to interpolate the custom label + * @default false + * @type {Function} + */ + customLabel: { + type: Function, + default (option, label) { + if (isEmpty(option)) return '' + return label ? option[label] : option + } + }, + /** + * Disable / Enable tagging + * @default false + * @type {Boolean} + */ + taggable: { + type: Boolean, + default: false + }, + /** + * String to show when highlighting a potential tag + * @default 'Press enter to create a tag' + * @type {String} + */ + tagPlaceholder: { + type: String, + default: 'Press enter to create a tag' + }, + /** + * By default new tags will appear above the search results. + * Changing to 'bottom' will revert this behaviour + * and will proritize the search results + * @default 'top' + * @type {String} + */ + tagPosition: { + type: String, + default: 'top' + }, + /** + * Number of allowed selected options. No limit if 0. + * @default 0 + * @type {Number} + */ + max: { + type: [Number, Boolean], + default: false + }, + /** + * Will be passed with all events as second param. + * Useful for identifying events origin. + * @default null + * @type {String|Integer} + */ + id: { + default: null + }, + /** + * Limits the options displayed in the dropdown + * to the first X options. + * @default 1000 + * @type {Integer} + */ + optionsLimit: { + type: Number, + default: 1000 + }, + /** + * Name of the property containing + * the group values + * @default 1000 + * @type {String} + */ + groupValues: { + type: String + }, + /** + * Name of the property containing + * the group label + * @default 1000 + * @type {String} + */ + groupLabel: { + type: String + }, + /** + * Allow to select all group values + * by selecting the group label + * @default false + * @type {Boolean} + */ + groupSelect: { + type: Boolean, + default: false + }, + /** + * Array of keyboard keys to block + * when selecting + * @default 1000 + * @type {String} + */ + blockKeys: { + type: Array, + default () { + return [] + } + }, + /** + * Prevent from wiping up the search value + * @default false + * @type {Boolean} + */ + preserveSearch: { + type: Boolean, + default: false + }, + /** + * Select 1st options if value is empty + * @default false + * @type {Boolean} + */ + preselectFirst: { + type: Boolean, + default: false + }, + /** + * Prevent autofocus + * @default false + * @type {Boolean} + */ + preventAutofocus: { + type: Boolean, + default: false + } + }, + mounted () { + /* istanbul ignore else */ + if (!this.multiple && this.max) { + console.warn('[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false.'); + } + if ( + this.preselectFirst && + !this.internalValue.length && + this.options.length + ) { + this.select(this.filteredOptions[0]); + } + }, + computed: { + internalValue () { + return this.modelValue || this.modelValue === 0 + ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue] + : [] + }, + filteredOptions () { + const search = this.search || ''; + const normalizedSearch = search.toLowerCase().trim(); + + let options = this.options.concat(); + + /* istanbul ignore else */ + if (this.internalSearch) { + options = this.groupValues + ? this.filterAndFlat(options, normalizedSearch, this.label) + : filterOptions(options, normalizedSearch, this.label, this.customLabel); + } else { + options = this.groupValues ? flattenOptions(this.groupValues, this.groupLabel)(options) : options; + } + + options = this.hideSelected + ? options.filter(not(this.isSelected)) + : options; + + /* istanbul ignore else */ + if (this.taggable && normalizedSearch.length && !this.isExistingOption(normalizedSearch)) { + if (this.tagPosition === 'bottom') { + options.push({isTag: true, label: search}); + } else { + options.unshift({isTag: true, label: search}); + } + } + + return options.slice(0, this.optionsLimit) + }, + valueKeys () { + if (this.trackBy) { + return this.internalValue.map((element) => element[this.trackBy]) + } else { + return this.internalValue + } + }, + optionKeys () { + const options = this.groupValues ? this.flatAndStrip(this.options) : this.options; + return options.map((element) => this.customLabel(element, this.label).toString().toLowerCase()) + }, + currentOptionLabel () { + return this.multiple + ? this.searchable ? '' : this.placeholder + : this.internalValue.length + ? this.getOptionLabel(this.internalValue[0]) + : this.searchable ? '' : this.placeholder + } + }, + watch: { + internalValue () { + /* istanbul ignore else */ + if (this.resetAfter && this.internalValue.length) { + this.search = ''; + this.$emit('update:modelValue', this.multiple ? [] : null); + } + }, + search () { + this.$emit('search-change', this.search); + } + }, + emits: ['open', 'search-change', 'close', 'select', 'update:modelValue', 'remove', 'tag'], + methods: { + /** + * Returns the internalValue in a way it can be emited to the parent + * @returns {Object||Array||String||Integer} + */ + getValue () { + return this.multiple + ? this.internalValue + : this.internalValue.length === 0 + ? null + : this.internalValue[0] + }, + /** + * Filters and then flattens the options list + * @param {Array} + * @return {Array} returns a filtered and flat options list + */ + filterAndFlat (options, search, label) { + return flow( + filterGroups(search, label, this.groupValues, this.groupLabel, this.customLabel), + flattenOptions(this.groupValues, this.groupLabel) + )(options) + }, + /** + * Flattens and then strips the group labels from the options list + * @param {Array} + * @return {Array} returns a flat options list without group labels + */ + flatAndStrip (options) { + return flow( + flattenOptions(this.groupValues, this.groupLabel), + stripGroups + )(options) + }, + /** + * Updates the search value + * @param {String} + */ + updateSearch (query) { + this.search = query; + }, + /** + * Finds out if the given query is already present + * in the available options + * @param {String} + * @return {Boolean} returns true if element is available + */ + isExistingOption (query) { + return !this.options + ? false + : this.optionKeys.indexOf(query) > -1 + }, + /** + * Finds out if the given element is already present + * in the result value + * @param {Object||String||Integer} option passed element to check + * @returns {Boolean} returns true if element is selected + */ + isSelected (option) { + const opt = this.trackBy + ? option[this.trackBy] + : option; + return this.valueKeys.indexOf(opt) > -1 + }, + /** + * Finds out if the given option is disabled + * @param {Object||String||Integer} option passed element to check + * @returns {Boolean} returns true if element is disabled + */ + isOptionDisabled (option) { + return !!option.$isDisabled + }, + /** + * Returns empty string when options is null/undefined + * Returns tag query if option is tag. + * Returns the customLabel() results and casts it to string. + * + * @param {Object||String||Integer} Passed option + * @returns {Object||String} + */ + getOptionLabel (option) { + if (isEmpty(option)) return '' + /* istanbul ignore else */ + if (option.isTag) return option.label + /* istanbul ignore else */ + if (option.$isLabel) return option.$groupLabel + + const label = this.customLabel(option, this.label); + /* istanbul ignore else */ + if (isEmpty(label)) return '' + return label + }, + /** + * Add the given option to the list of selected options + * or sets the option as the selected option. + * If option is already selected -> remove it from the results. + * + * @param {Object||String||Integer} option to select/deselect + * @param {Boolean} block removing + */ + select (option, key) { + /* istanbul ignore else */ + if (option.$isLabel && this.groupSelect) { + this.selectGroup(option); + return + } + if (this.blockKeys.indexOf(key) !== -1 || + this.disabled || + option.$isDisabled || + option.$isLabel + ) return + /* istanbul ignore else */ + if (this.max && this.multiple && this.internalValue.length === this.max) return + /* istanbul ignore else */ + if (key === 'Tab' && !this.pointerDirty) return + if (option.isTag) { + this.$emit('tag', option.label, this.id); + this.search = ''; + if (this.closeOnSelect && !this.multiple) this.deactivate(); + } else { + const isSelected = this.isSelected(option); + + if (isSelected) { + if (key !== 'Tab') this.removeElement(option); + return + } + + if (this.multiple) { + this.$emit('update:modelValue', this.internalValue.concat([option])); + } else { + this.$emit('update:modelValue', option); + } + + this.$emit('select', option, this.id); + + /* istanbul ignore else */ + if (this.clearOnSelect) this.search = ''; + } + /* istanbul ignore else */ + if (this.closeOnSelect) this.deactivate(); + }, + /** + * Add the given group options to the list of selected options + * If all group optiona are already selected -> remove it from the results. + * + * @param {Object||String||Integer} group to select/deselect + */ + selectGroup (selectedGroup) { + const group = this.options.find((option) => { + return option[this.groupLabel] === selectedGroup.$groupLabel + }); + + if (!group) return + + if (this.wholeGroupSelected(group)) { + this.$emit('remove', group[this.groupValues], this.id); + + const newValue = this.internalValue.filter( + (option) => group[this.groupValues].indexOf(option) === -1 + ); + + this.$emit('update:modelValue', newValue); + } else { + let optionsToAdd = group[this.groupValues].filter( + option => !(this.isOptionDisabled(option) || this.isSelected(option)) + ); + + // if max is defined then just select options respecting max + if (this.max) { + optionsToAdd.splice(this.max - this.internalValue.length); + } + + this.$emit('select', optionsToAdd, this.id); + this.$emit( + 'update:modelValue', + this.internalValue.concat(optionsToAdd) + ); + } + + if (this.closeOnSelect) this.deactivate(); + }, + /** + * Helper to identify if all values in a group are selected + * + * @param {Object} group to validated selected values against + */ + wholeGroupSelected (group) { + return group[this.groupValues].every((option) => this.isSelected(option) || this.isOptionDisabled(option) + ) + }, + /** + * Helper to identify if all values in a group are disabled + * + * @param {Object} group to check for disabled values + */ + wholeGroupDisabled (group) { + return group[this.groupValues].every(this.isOptionDisabled) + }, + /** + * Removes the given option from the selected options. + * Additionally checks this.allowEmpty prop if option can be removed when + * it is the last selected option. + * + * @param {type} option description + * @return {type} description + */ + removeElement (option, shouldClose = true) { + /* istanbul ignore else */ + if (this.disabled) return + /* istanbul ignore else */ + if (option.$isDisabled) return + /* istanbul ignore else */ + if (!this.allowEmpty && this.internalValue.length <= 1) { + this.deactivate(); + return + } + + const index = typeof option === 'object' + ? this.valueKeys.indexOf(option[this.trackBy]) + : this.valueKeys.indexOf(option); + + if (this.multiple) { + const newValue = this.internalValue.slice(0, index).concat(this.internalValue.slice(index + 1)); + this.$emit('update:modelValue', newValue); + } else { + this.$emit('update:modelValue', null); + } + this.$emit('remove', option, this.id); + + /* istanbul ignore else */ + if (this.closeOnSelect && shouldClose) this.deactivate(); + }, + /** + * Calls this.removeElement() with the last element + * from this.internalValue (selected element Array) + * + * @fires this#removeElement + */ + removeLastElement () { + /* istanbul ignore else */ + if (this.blockKeys.indexOf('Delete') !== -1) return + /* istanbul ignore else */ + if (this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length) { + this.removeElement(this.internalValue[this.internalValue.length - 1], false); + } + }, + /** + * Opens the multiselect’s dropdown. + * Sets this.isOpen to TRUE + */ + activate () { + /* istanbul ignore else */ + if (this.isOpen || this.disabled) return + + this.adjustPosition(); + /* istanbul ignore else */ + if (this.groupValues && this.pointer === 0 && this.filteredOptions.length) { + this.pointer = 1; + } + + this.isOpen = true; + /* istanbul ignore else */ + if (this.searchable) { + if (!this.preserveSearch) this.search = ''; + if (!this.preventAutofocus) this.$nextTick(() => this.$refs.search && this.$refs.search.focus()); + } else if (!this.preventAutofocus) { + if (typeof this.$el !== 'undefined') this.$el.focus(); + } + this.$emit('open', this.id); + }, + /** + * Closes the multiselect’s dropdown. + * Sets this.isOpen to FALSE + */ + deactivate () { + /* istanbul ignore else */ + if (!this.isOpen) return + + this.isOpen = false; + /* istanbul ignore else */ + if (this.searchable) { + if (typeof this.$refs.search !== 'undefined') this.$refs.search.blur(); + } else { + if (typeof this.$el !== 'undefined') this.$el.blur(); + } + if (!this.preserveSearch) this.search = ''; + this.$emit('close', this.getValue(), this.id); + }, + /** + * Call this.activate() or this.deactivate() + * depending on this.isOpen value. + * + * @fires this#activate || this#deactivate + * @property {Boolean} isOpen indicates if dropdown is open + */ + toggle () { + this.isOpen + ? this.deactivate() + : this.activate(); + }, + /** + * Updates the hasEnoughSpace variable used for + * detecting where to expand the dropdown + */ + adjustPosition () { + if (typeof window === 'undefined') return + + const spaceAbove = this.$el.getBoundingClientRect().top; + const spaceBelow = window.innerHeight - this.$el.getBoundingClientRect().bottom; + const hasEnoughSpaceBelow = spaceBelow > this.maxHeight; + + if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || this.openDirection === 'below' || this.openDirection === 'bottom') { + this.preferredOpenDirection = 'below'; + this.optimizedHeight = Math.min(spaceBelow - 40, this.maxHeight); + } else { + this.preferredOpenDirection = 'above'; + this.optimizedHeight = Math.min(spaceAbove - 40, this.maxHeight); + } + } + } + }; + + var pointerMixin = { + data () { + return { + pointer: 0, + pointerDirty: false + } + }, + props: { + /** + * Enable/disable highlighting of the pointed value. + * @type {Boolean} + * @default true + */ + showPointer: { + type: Boolean, + default: true + }, + optionHeight: { + type: Number, + default: 40 + } + }, + computed: { + pointerPosition () { + return this.pointer * this.optionHeight + }, + visibleElements () { + return this.optimizedHeight / this.optionHeight + } + }, + watch: { + filteredOptions () { + this.pointerAdjust(); + }, + isOpen () { + this.pointerDirty = false; + }, + pointer () { + this.$refs.search && this.$refs.search.setAttribute('aria-activedescendant', this.id + '-' + this.pointer.toString()); + } + }, + methods: { + optionHighlight (index, option) { + return { + 'multiselect__option--highlight': index === this.pointer && this.showPointer, + 'multiselect__option--selected': this.isSelected(option) + } + }, + groupHighlight (index, selectedGroup) { + if (!this.groupSelect) { + return [ + 'multiselect__option--disabled', + {'multiselect__option--group': selectedGroup.$isLabel} + ] + } + + const group = this.options.find((option) => { + return option[this.groupLabel] === selectedGroup.$groupLabel + }); + + return group && !this.wholeGroupDisabled(group) ? [ + 'multiselect__option--group', + {'multiselect__option--highlight': index === this.pointer && this.showPointer}, + {'multiselect__option--group-selected': this.wholeGroupSelected(group)} + ] : 'multiselect__option--disabled' + }, + addPointerElement ({key} = 'Enter') { + /* istanbul ignore else */ + if (this.filteredOptions.length > 0) { + this.select(this.filteredOptions[this.pointer], key); + } + this.pointerReset(); + }, + pointerForward () { + /* istanbul ignore else */ + if (this.pointer < this.filteredOptions.length - 1) { + this.pointer++; + /* istanbul ignore next */ + if (this.$refs.list.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight) { + this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight; + } + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) this.pointerForward(); + } + this.pointerDirty = true; + }, + pointerBackward () { + if (this.pointer > 0) { + this.pointer--; + /* istanbul ignore else */ + if (this.$refs.list.scrollTop >= this.pointerPosition) { + this.$refs.list.scrollTop = this.pointerPosition; + } + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) this.pointerBackward(); + } else { + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[0].$isLabel && + !this.groupSelect + ) this.pointerForward(); + } + this.pointerDirty = true; + }, + pointerReset () { + /* istanbul ignore else */ + if (!this.closeOnSelect) return + this.pointer = 0; + /* istanbul ignore else */ + if (this.$refs.list) { + this.$refs.list.scrollTop = 0; + } + }, + pointerAdjust () { + /* istanbul ignore else */ + if (this.pointer >= this.filteredOptions.length - 1) { + this.pointer = this.filteredOptions.length + ? this.filteredOptions.length - 1 + : 0; + } + + if (this.filteredOptions.length > 0 && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) { + this.pointerForward(); + } + }, + pointerSet (index) { + this.pointer = index; + this.pointerDirty = true; + } + } + }; + + var script = { + name: 'vue-multiselect', + mixins: [multiselectMixin, pointerMixin], + props: { + /** + * name attribute to match optional label element + * @default '' + * @type {String} + */ + name: { + type: String, + default: '' + }, + /** + * Presets the selected options value. + * @type {Object||Array||String||Integer} + */ + modelValue: { + type: null, + default () { + return [] + } + }, + /** + * String to show when pointing to an option + * @default 'Press enter to select' + * @type {String} + */ + selectLabel: { + type: String, + default: 'Press enter to select' + }, + /** + * String to show when pointing to an option + * @default 'Press enter to select' + * @type {String} + */ + selectGroupLabel: { + type: String, + default: 'Press enter to select group' + }, + /** + * String to show next to selected option + * @default 'Selected' + * @type {String} + */ + selectedLabel: { + type: String, + default: 'Selected' + }, + /** + * String to show when pointing to an already selected option + * @default 'Press enter to remove' + * @type {String} + */ + deselectLabel: { + type: String, + default: 'Press enter to remove' + }, + /** + * String to show when pointing to an already selected option + * @default 'Press enter to remove' + * @type {String} + */ + deselectGroupLabel: { + type: String, + default: 'Press enter to deselect group' + }, + /** + * Decide whether to show pointer labels + * @default true + * @type {Boolean} + */ + showLabels: { + type: Boolean, + default: true + }, + /** + * Limit the display of selected options. The rest will be hidden within the limitText string. + * @default 99999 + * @type {Integer} + */ + limit: { + type: Number, + default: 99999 + }, + /** + * Sets maxHeight style value of the dropdown + * @default 300 + * @type {Integer} + */ + maxHeight: { + type: Number, + default: 300 + }, + /** + * Function that process the message shown when selected + * elements pass the defined limit. + * @default 'and * more' + * @param {Int} count Number of elements more than limit + * @type {Function} + */ + limitText: { + type: Function, + default: (count) => `and ${count} more` + }, + /** + * Set true to trigger the loading spinner. + * @default False + * @type {Boolean} + */ + loading: { + type: Boolean, + default: false + }, + /** + * Disables the multiselect if true. + * @default false + * @type {Boolean} + */ + disabled: { + type: Boolean, + default: false + }, + /** + * Fixed opening direction + * @default '' + * @type {String} + */ + openDirection: { + type: String, + default: '' + }, + /** + * Shows slot with message about empty options + * @default true + * @type {Boolean} + */ + showNoOptions: { + type: Boolean, + default: true + }, + showNoResults: { + type: Boolean, + default: true + }, + tabindex: { + type: Number, + default: 0 + } + }, + computed: { + hasOptionGroup () { + return this.groupValues && this.groupLabel && this.groupSelect + }, + isSingleLabelVisible () { + return ( + (this.singleValue || this.singleValue === 0) && + (!this.isOpen || !this.searchable) && + !this.visibleValues.length + ) + }, + isPlaceholderVisible () { + return !this.internalValue.length && (!this.searchable || !this.isOpen) + }, + visibleValues () { + return this.multiple ? this.internalValue.slice(0, this.limit) : [] + }, + singleValue () { + return this.internalValue[0] + }, + deselectLabelText () { + return this.showLabels ? this.deselectLabel : '' + }, + deselectGroupLabelText () { + return this.showLabels ? this.deselectGroupLabel : '' + }, + selectLabelText () { + return this.showLabels ? this.selectLabel : '' + }, + selectGroupLabelText () { + return this.showLabels ? this.selectGroupLabel : '' + }, + selectedLabelText () { + return this.showLabels ? this.selectedLabel : '' + }, + inputStyle () { + if ( + this.searchable || + (this.multiple && this.modelValue && this.modelValue.length) + ) { + // Hide input by setting the width to 0 allowing it to receive focus + return this.isOpen + ? {width: '100%'} + : {width: '0', position: 'absolute', padding: '0'} + } + return '' + }, + contentStyle () { + return this.options.length + ? {display: 'inline-block'} + : {display: 'block'} + }, + isAbove () { + if (this.openDirection === 'above' || this.openDirection === 'top') { + return true + } else if ( + this.openDirection === 'below' || + this.openDirection === 'bottom' + ) { + return false + } else { + return this.preferredOpenDirection === 'above' + } + }, + showSearchInput () { + return ( + this.searchable && + (this.hasSingleSelectedSlot && + (this.visibleSingleValue || this.visibleSingleValue === 0) + ? this.isOpen + : true) + ) + } + } + }; + + const _hoisted_1 = { + ref: "tags", + class: "multiselect__tags" + }; + const _hoisted_2 = { class: "multiselect__tags-wrap" }; + const _hoisted_3 = { class: "multiselect__spinner" }; + const _hoisted_4 = { key: 0 }; + const _hoisted_5 = { class: "multiselect__option" }; + const _hoisted_6 = { class: "multiselect__option" }; + const _hoisted_7 = /*#__PURE__*/vue.createTextVNode("No elements found. Consider changing the search query."); + const _hoisted_8 = { class: "multiselect__option" }; + const _hoisted_9 = /*#__PURE__*/vue.createTextVNode("List is empty."); + + function render(_ctx, _cache, $props, $setup, $data, $options) { + return (vue.openBlock(), vue.createBlock("div", { + tabindex: _ctx.searchable ? -1 : $props.tabindex, + class: [{ 'multiselect--active': _ctx.isOpen, 'multiselect--disabled': $props.disabled, 'multiselect--above': $options.isAbove, 'multiselect--has-options-group': $options.hasOptionGroup }, "multiselect"], + onFocus: _cache[14] || (_cache[14] = $event => (_ctx.activate())), + onBlur: _cache[15] || (_cache[15] = $event => (_ctx.searchable ? false : _ctx.deactivate())), + onKeydown: [ + _cache[16] || (_cache[16] = vue.withKeys(vue.withModifiers($event => (_ctx.pointerForward()), ["self","prevent"]), ["down"])), + _cache[17] || (_cache[17] = vue.withKeys(vue.withModifiers($event => (_ctx.pointerBackward()), ["self","prevent"]), ["up"])) + ], + onKeypress: _cache[18] || (_cache[18] = vue.withKeys(vue.withModifiers($event => (_ctx.addPointerElement($event)), ["stop","self"]), ["enter","tab"])), + onKeyup: _cache[19] || (_cache[19] = vue.withKeys($event => (_ctx.deactivate()), ["esc"])), + role: "combobox", + "aria-owns": 'listbox-'+_ctx.id + }, [ + vue.renderSlot(_ctx.$slots, "caret", { toggle: _ctx.toggle }, () => [ + vue.createVNode("div", { + onMousedown: _cache[1] || (_cache[1] = vue.withModifiers($event => (_ctx.toggle()), ["prevent","stop"])), + class: "multiselect__select" + }, null, 32 /* HYDRATE_EVENTS */) + ]), + vue.renderSlot(_ctx.$slots, "clear", { search: _ctx.search }), + vue.createVNode("div", _hoisted_1, [ + vue.renderSlot(_ctx.$slots, "selection", { + search: _ctx.search, + remove: _ctx.removeElement, + values: $options.visibleValues, + isOpen: _ctx.isOpen + }, () => [ + vue.withDirectives(vue.createVNode("div", _hoisted_2, [ + (vue.openBlock(true), vue.createBlock(vue.Fragment, null, vue.renderList($options.visibleValues, (option, index) => { + return vue.renderSlot(_ctx.$slots, "tag", { + option: option, + search: _ctx.search, + remove: _ctx.removeElement + }, () => [ + (vue.openBlock(), vue.createBlock("span", { + class: "multiselect__tag", + key: index + }, [ + vue.createVNode("span", { + textContent: vue.toDisplayString(_ctx.getOptionLabel(option)) + }, null, 8 /* PROPS */, ["textContent"]), + vue.createVNode("i", { + tabindex: "1", + onKeypress: vue.withKeys(vue.withModifiers($event => (_ctx.removeElement(option)), ["prevent"]), ["enter"]), + onMousedown: vue.withModifiers($event => (_ctx.removeElement(option)), ["prevent"]), + class: "multiselect__tag-icon" + }, null, 40 /* PROPS, HYDRATE_EVENTS */, ["onKeypress", "onMousedown"]) + ])) + ]) + }), 256 /* UNKEYED_FRAGMENT */)) + ], 512 /* NEED_PATCH */), [ + [vue.vShow, $options.visibleValues.length > 0] + ]), + (_ctx.internalValue && _ctx.internalValue.length > $props.limit) + ? vue.renderSlot(_ctx.$slots, "limit", { key: 0 }, () => [ + vue.createVNode("strong", { + class: "multiselect__strong", + textContent: vue.toDisplayString($props.limitText(_ctx.internalValue.length - $props.limit)) + }, null, 8 /* PROPS */, ["textContent"]) + ]) + : vue.createCommentVNode("v-if", true) + ]), + vue.createVNode(vue.Transition, { name: "multiselect__loading" }, { + default: vue.withCtx(() => [ + vue.renderSlot(_ctx.$slots, "loading", {}, () => [ + vue.withDirectives(vue.createVNode("div", _hoisted_3, null, 512 /* NEED_PATCH */), [ + [vue.vShow, $props.loading] + ]) + ]) + ]), + _: 3 /* FORWARDED */ + }), + (_ctx.searchable) + ? (vue.openBlock(), vue.createBlock("input", { + key: 0, + ref: "search", + name: $props.name, + id: _ctx.id, + type: "text", + autocomplete: "off", + spellcheck: "false", + placeholder: _ctx.placeholder, + style: $options.inputStyle, + value: _ctx.search, + disabled: $props.disabled, + tabindex: $props.tabindex, + onInput: _cache[2] || (_cache[2] = $event => (_ctx.updateSearch($event.target.value))), + onFocus: _cache[3] || (_cache[3] = vue.withModifiers($event => (_ctx.activate()), ["prevent"])), + onBlur: _cache[4] || (_cache[4] = vue.withModifiers($event => (_ctx.deactivate()), ["prevent"])), + onKeyup: _cache[5] || (_cache[5] = vue.withKeys($event => (_ctx.deactivate()), ["esc"])), + onKeydown: [ + _cache[6] || (_cache[6] = vue.withKeys(vue.withModifiers($event => (_ctx.pointerForward()), ["prevent"]), ["down"])), + _cache[7] || (_cache[7] = vue.withKeys(vue.withModifiers($event => (_ctx.pointerBackward()), ["prevent"]), ["up"])), + _cache[9] || (_cache[9] = vue.withKeys(vue.withModifiers($event => (_ctx.removeLastElement()), ["stop"]), ["delete"])) + ], + onKeypress: _cache[8] || (_cache[8] = vue.withKeys(vue.withModifiers($event => (_ctx.addPointerElement($event)), ["prevent","stop","self"]), ["enter"])), + class: "multiselect__input", + "aria-controls": 'listbox-'+_ctx.id + }, null, 44 /* STYLE, PROPS, HYDRATE_EVENTS */, ["name", "id", "placeholder", "value", "disabled", "tabindex", "aria-controls"])) + : vue.createCommentVNode("v-if", true), + ($options.isSingleLabelVisible) + ? (vue.openBlock(), vue.createBlock("span", { + key: 1, + class: "multiselect__single", + onMousedown: _cache[10] || (_cache[10] = vue.withModifiers((...args) => (_ctx.toggle && _ctx.toggle(...args)), ["prevent"])) + }, [ + vue.renderSlot(_ctx.$slots, "singleLabel", { option: $options.singleValue }, () => [ + vue.createTextVNode(vue.toDisplayString(_ctx.currentOptionLabel), 1 /* TEXT */) + ]) + ], 32 /* HYDRATE_EVENTS */)) + : vue.createCommentVNode("v-if", true), + ($options.isPlaceholderVisible) + ? (vue.openBlock(), vue.createBlock("span", { + key: 2, + class: "multiselect__placeholder", + onMousedown: _cache[11] || (_cache[11] = vue.withModifiers((...args) => (_ctx.toggle && _ctx.toggle(...args)), ["prevent"])) + }, [ + vue.renderSlot(_ctx.$slots, "placeholder", {}, () => [ + vue.createTextVNode(vue.toDisplayString(_ctx.placeholder), 1 /* TEXT */) + ]) + ], 32 /* HYDRATE_EVENTS */)) + : vue.createCommentVNode("v-if", true) + ], 512 /* NEED_PATCH */), + vue.createVNode(vue.Transition, { name: "multiselect" }, { + default: vue.withCtx(() => [ + vue.withDirectives(vue.createVNode("div", { + class: "multiselect__content-wrapper", + onFocus: _cache[12] || (_cache[12] = (...args) => (_ctx.activate && _ctx.activate(...args))), + tabindex: "-1", + onMousedown: _cache[13] || (_cache[13] = vue.withModifiers(() => {}, ["prevent"])), + style: { maxHeight: _ctx.optimizedHeight + 'px' }, + ref: "list" + }, [ + vue.createVNode("ul", { + class: "multiselect__content", + style: $options.contentStyle, + role: "listbox", + id: 'listbox-'+_ctx.id + }, [ + vue.renderSlot(_ctx.$slots, "beforeList"), + (_ctx.multiple && _ctx.max === _ctx.internalValue.length) + ? (vue.openBlock(), vue.createBlock("li", _hoisted_4, [ + vue.createVNode("span", _hoisted_5, [ + vue.renderSlot(_ctx.$slots, "maxElements", {}, () => [ + vue.createTextVNode("Maximum of " + vue.toDisplayString(_ctx.max) + " options selected. First remove a selected option to select another.", 1 /* TEXT */) + ]) + ]) + ])) + : vue.createCommentVNode("v-if", true), + (!_ctx.max || _ctx.internalValue.length < _ctx.max) + ? (vue.openBlock(true), vue.createBlock(vue.Fragment, { key: 1 }, vue.renderList(_ctx.filteredOptions, (option, index) => { + return (vue.openBlock(), vue.createBlock("li", { + class: "multiselect__element", + key: index, + id: _ctx.id + '-' + index, + role: !(option && (option.$isLabel || option.$isDisabled)) ? 'option' : null + }, [ + (!(option && (option.$isLabel || option.$isDisabled))) + ? (vue.openBlock(), vue.createBlock("span", { + key: 0, + class: [_ctx.optionHighlight(index, option), "multiselect__option"], + onClick: vue.withModifiers($event => (_ctx.select(option)), ["stop"]), + onMouseenter: vue.withModifiers($event => (_ctx.pointerSet(index)), ["self"]), + "data-select": option && option.isTag ? _ctx.tagPlaceholder : $options.selectLabelText, + "data-selected": $options.selectedLabelText, + "data-deselect": $options.deselectLabelText + }, [ + vue.renderSlot(_ctx.$slots, "option", { + option: option, + search: _ctx.search, + index: index + }, () => [ + vue.createVNode("span", null, vue.toDisplayString(_ctx.getOptionLabel(option)), 1 /* TEXT */) + ]) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"])) + : vue.createCommentVNode("v-if", true), + (option && (option.$isLabel || option.$isDisabled)) + ? (vue.openBlock(), vue.createBlock("span", { + key: 1, + "data-select": _ctx.groupSelect && $options.selectGroupLabelText, + "data-deselect": _ctx.groupSelect && $options.deselectGroupLabelText, + class: [_ctx.groupHighlight(index, option), "multiselect__option"], + onMouseenter: vue.withModifiers($event => (_ctx.groupSelect && _ctx.pointerSet(index)), ["self"]), + onMousedown: vue.withModifiers($event => (_ctx.selectGroup(option)), ["prevent"]) + }, [ + vue.renderSlot(_ctx.$slots, "option", { + option: option, + search: _ctx.search, + index: index + }, () => [ + vue.createVNode("span", null, vue.toDisplayString(_ctx.getOptionLabel(option)), 1 /* TEXT */) + ]) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["data-select", "data-deselect", "onMouseenter", "onMousedown"])) + : vue.createCommentVNode("v-if", true) + ], 8 /* PROPS */, ["id", "role"])) + }), 128 /* KEYED_FRAGMENT */)) + : vue.createCommentVNode("v-if", true), + vue.withDirectives(vue.createVNode("li", null, [ + vue.createVNode("span", _hoisted_6, [ + vue.renderSlot(_ctx.$slots, "noResult", { search: _ctx.search }, () => [ + _hoisted_7 + ]) + ]) + ], 512 /* NEED_PATCH */), [ + [vue.vShow, $props.showNoResults && (_ctx.filteredOptions.length === 0 && _ctx.search && !$props.loading)] + ]), + vue.withDirectives(vue.createVNode("li", null, [ + vue.createVNode("span", _hoisted_8, [ + vue.renderSlot(_ctx.$slots, "noOptions", {}, () => [ + _hoisted_9 + ]) + ]) + ], 512 /* NEED_PATCH */), [ + [vue.vShow, $props.showNoOptions && ((_ctx.options.length === 0 || ($options.hasOptionGroup === true && _ctx.filteredOptions.length === 0)) && !_ctx.search && !$props.loading)] + ]), + vue.renderSlot(_ctx.$slots, "afterList") + ], 12 /* STYLE, PROPS */, ["id"]) + ], 36 /* STYLE, HYDRATE_EVENTS */), [ + [vue.vShow, _ctx.isOpen] + ]) + ]), + _: 3 /* FORWARDED */ + }) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["tabindex", "aria-owns"])) + } + + script.render = render; + + exports.Multiselect = script; + exports.default = script; + exports.multiselectMixin = multiselectMixin; + exports.pointerMixin = pointerMixin; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +}({}, Vue)); diff --git a/dist/vue-multiselect.ssr.css b/dist/vue-multiselect.ssr.css new file mode 100644 index 00000000..9c9a6ad1 --- /dev/null +++ b/dist/vue-multiselect.ssr.css @@ -0,0 +1,468 @@ + + + fieldset[disabled] .multiselect { + pointer-events: none; + } + + .multiselect__spinner { + position: absolute; + right: 1px; + top: 1px; + width: 40px; + height: 38px; + background: #fff; + display: block; + } + + .multiselect__spinner::before, + .multiselect__spinner::after { + position: absolute; + content: ""; + top: 50%; + left: 50%; + margin: -8px 0 0 -8px; + width: 16px; + height: 16px; + border-radius: 100%; + border-color: #41b883 transparent transparent; + border-style: solid; + border-width: 2px; + box-shadow: 0 0 0 1px transparent; + } + + .multiselect__spinner::before { + animation: spinning 2.4s cubic-bezier(0.41, 0.26, 0.2, 0.62); + animation-iteration-count: infinite; + } + + .multiselect__spinner::after { + animation: spinning 2.4s cubic-bezier(0.51, 0.09, 0.21, 0.8); + animation-iteration-count: infinite; + } + + .multiselect__loading-enter-active, + .multiselect__loading-leave-active { + transition: opacity 0.4s ease-in-out; + opacity: 1; + } + + .multiselect__loading-enter, + .multiselect__loading-leave-active { + opacity: 0; + } + + .multiselect, + .multiselect__input, + .multiselect__single { + font-family: inherit; + font-size: 16px; + touch-action: manipulation; + } + + .multiselect { + box-sizing: content-box; + display: block; + position: relative; + width: 100%; + min-height: 40px; + text-align: left; + color: #35495e; + } + + .multiselect * { + box-sizing: border-box; + } + + .multiselect:focus { + outline: none; + } + + .multiselect--disabled { + background: #ededed; + pointer-events: none; + opacity: 0.6; + } + + .multiselect--active { + z-index: 50; + } + + .multiselect--active:not(.multiselect--above) .multiselect__current, + .multiselect--active:not(.multiselect--above) .multiselect__input, + .multiselect--active:not(.multiselect--above) .multiselect__tags { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + + .multiselect--active .multiselect__select { + transform: rotateZ(180deg); + } + + .multiselect--above.multiselect--active .multiselect__current, + .multiselect--above.multiselect--active .multiselect__input, + .multiselect--above.multiselect--active .multiselect__tags { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + + .multiselect__input, + .multiselect__single { + position: relative; + display: inline-block; + min-height: 20px; + line-height: 20px; + border: none; + border-radius: 5px; + background: #fff; + padding: 0 0 0 5px; + width: calc(100%); + transition: border 0.1s ease; + box-sizing: border-box; + margin-bottom: 8px; + vertical-align: top; + } + + .multiselect__input::placeholder { + color: #35495e; + } + + .multiselect__tag ~ .multiselect__input, + .multiselect__tag ~ .multiselect__single { + width: auto; + } + + .multiselect__input:hover, + .multiselect__single:hover { + border-color: #cfcfcf; + } + + .multiselect__input:focus, + .multiselect__single:focus { + border-color: #a8a8a8; + outline: none; + } + + .multiselect__single { + padding-left: 5px; + margin-bottom: 8px; + } + + .multiselect__tags-wrap { + display: inline; + } + + .multiselect__tags { + min-height: 40px; + display: block; + padding: 8px 40px 0 8px; + border-radius: 5px; + border: 1px solid #e8e8e8; + background: #fff; + font-size: 14px; + } + + .multiselect__tag { + position: relative; + display: inline-block; + padding: 4px 26px 4px 10px; + border-radius: 5px; + margin-right: 10px; + color: #fff; + line-height: 1; + background: #41b883; + margin-bottom: 5px; + white-space: nowrap; + overflow: hidden; + max-width: 100%; + text-overflow: ellipsis; + } + + .multiselect__tag-icon { + cursor: pointer; + margin-left: 7px; + position: absolute; + right: 0; + top: 0; + bottom: 0; + font-weight: 700; + font-style: initial; + width: 22px; + text-align: center; + line-height: 22px; + transition: all 0.2s ease; + border-radius: 5px; + } + + .multiselect__tag-icon::after { + content: "×"; + color: #266d4d; + font-size: 14px; + } + + /* // Remove these lines to avoid green closing button + //.multiselect__tag-icon:focus, + //.multiselect__tag-icon:hover { + // background: #369a6e; + //} */ + + .multiselect__tag-icon:focus::after, + .multiselect__tag-icon:hover::after { + color: white; + } + + .multiselect__current { + line-height: 16px; + min-height: 40px; + box-sizing: border-box; + display: block; + overflow: hidden; + padding: 8px 12px 0; + padding-right: 30px; + white-space: nowrap; + margin: 0; + text-decoration: none; + border-radius: 5px; + border: 1px solid #e8e8e8; + cursor: pointer; + } + + .multiselect__select { + line-height: 16px; + display: block; + position: absolute; + box-sizing: border-box; + width: 40px; + height: 38px; + right: 1px; + top: 1px; + padding: 4px 8px; + margin: 0; + text-decoration: none; + text-align: center; + cursor: pointer; + transition: transform 0.2s ease; + } + + .multiselect__select::before { + position: relative; + right: 0; + top: 65%; + color: #999; + margin-top: 4px; + border-style: solid; + border-width: 5px 5px 0 5px; + border-color: #999 transparent transparent transparent; + content: ""; + } + + .multiselect__placeholder { + color: #adadad; + display: inline-block; + margin-bottom: 10px; + padding-top: 2px; + } + + .multiselect--active .multiselect__placeholder { + display: none; + } + + .multiselect__content-wrapper { + position: absolute; + display: block; + background: #fff; + width: 100%; + max-height: 240px; + overflow: auto; + border: 1px solid #e8e8e8; + border-top: none; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + z-index: 50; + -webkit-overflow-scrolling: touch; + } + + .multiselect__content { + list-style: none; + display: inline-block; + padding: 0; + margin: 0; + min-width: 100%; + vertical-align: top; + } + + .multiselect--above .multiselect__content-wrapper { + bottom: 100%; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + border-bottom: none; + border-top: 1px solid #e8e8e8; + } + + .multiselect__content::-webkit-scrollbar { + display: none; + } + + .multiselect__element { + display: block; + } + + .multiselect__option { + display: block; + padding: 12px; + min-height: 40px; + line-height: 16px; + text-decoration: none; + text-transform: none; + vertical-align: middle; + position: relative; + cursor: pointer; + white-space: nowrap; + } + + .multiselect__option::after { + top: 0; + right: 0; + position: absolute; + line-height: 40px; + padding-right: 12px; + padding-left: 20px; + font-size: 13px; + } + + .multiselect__option--highlight { + background: #41b883; + outline: none; + color: white; + } + + .multiselect__option--highlight::after { + content: attr(data-select); + background: #41b883; + color: white; + } + + .multiselect__option--selected { + background: #f3f3f3; + color: #35495e; + font-weight: bold; + } + + .multiselect__option--selected::after { + content: attr(data-selected); + color: silver; + background: inherit; + } + + .multiselect__option--selected.multiselect__option--highlight { + background: #ff6a6a; + color: #fff; + } + + .multiselect__option--selected.multiselect__option--highlight::after { + background: #ff6a6a; + content: attr(data-deselect); + color: #fff; + } + + .multiselect--disabled .multiselect__current, + .multiselect--disabled .multiselect__select { + background: #ededed; + color: #a6a6a6; + } + + .multiselect__option--disabled { + background: #ededed !important; + color: #a6a6a6 !important; + cursor: text; + pointer-events: none; + } + + .multiselect__option--group { + background: #ededed; + color: #35495e; + } + + .multiselect__option--group.multiselect__option--highlight { + background: #35495e; + color: #fff; + } + + .multiselect__option--group.multiselect__option--highlight::after { + background: #35495e; + } + + .multiselect__option--disabled.multiselect__option--highlight { + background: #dedede; + } + + .multiselect__option--group-selected.multiselect__option--highlight { + background: #ff6a6a; + color: #fff; + } + + .multiselect__option--group-selected.multiselect__option--highlight::after { + background: #ff6a6a; + content: attr(data-deselect); + color: #fff; + } + + .multiselect-enter-active, + .multiselect-leave-active { + transition: all 0.15s ease; + } + + .multiselect-enter, + .multiselect-leave-active { + opacity: 0; + } + + .multiselect__strong { + margin-bottom: 8px; + line-height: 20px; + display: inline-block; + vertical-align: top; + } + + *[dir="rtl"] .multiselect { + text-align: right; + } + + *[dir="rtl"] .multiselect__select { + right: auto; + left: 1px; + } + + *[dir="rtl"] .multiselect__tags { + padding: 8px 8px 0 40px; + } + + *[dir="rtl"] .multiselect__content { + text-align: right; + } + + *[dir="rtl"] .multiselect__option::after { + right: auto; + left: 0; + } + + *[dir="rtl"] .multiselect__clear { + right: auto; + left: 12px; + } + + *[dir="rtl"] .multiselect__spinner { + right: auto; + left: 1px; + } + + @keyframes spinning { + from { + transform: rotate(0); + } + + to { + transform: rotate(2turn); + } + } diff --git a/dist/vue-multiselect.ssr.js b/dist/vue-multiselect.ssr.js new file mode 100644 index 00000000..d58a5120 --- /dev/null +++ b/dist/vue-multiselect.ssr.js @@ -0,0 +1,1347 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var vue = require('vue'); + +function isEmpty (opt) { + if (opt === 0) return false + if (Array.isArray(opt) && opt.length === 0) return true + return !opt +} + +function not (fun) { + return (...params) => !fun(...params) +} + +function includes (str, query) { + /* istanbul ignore else */ + if (str === undefined) str = 'undefined'; + if (str === null) str = 'null'; + if (str === false) str = 'false'; + const text = str.toString().toLowerCase(); + return text.indexOf(query.trim()) !== -1 +} + +function filterOptions (options, search, label, customLabel) { + return search ? options + .filter((option) => includes(customLabel(option, label), search)) + .sort((a, b) => customLabel(a, label).length - customLabel(b, label).length) : options +} + +function stripGroups (options) { + return options.filter((option) => !option.$isLabel) +} + +function flattenOptions (values, label) { + return (options) => + options.reduce((prev, curr) => { + /* istanbul ignore else */ + if (curr[values] && curr[values].length) { + prev.push({ + $groupLabel: curr[label], + $isLabel: true + }); + return prev.concat(curr[values]) + } + return prev + }, []) +} + +function filterGroups (search, label, values, groupLabel, customLabel) { + return (groups) => + groups.map((group) => { + /* istanbul ignore else */ + if (!group[values]) { + console.warn(`Options passed to vue-multiselect do not contain groups, despite the config.`); + return [] + } + const groupOptions = filterOptions(group[values], search, label, customLabel); + + return groupOptions.length + ? { + [groupLabel]: group[groupLabel], + [values]: groupOptions + } + : [] + }) +} + +const flow = (...fns) => (x) => fns.reduce((v, f) => f(v), x); + +var multiselectMixin = { + data () { + return { + search: '', + isOpen: false, + preferredOpenDirection: 'below', + optimizedHeight: this.maxHeight + } + }, + props: { + /** + * Decide whether to filter the results based on search query. + * Useful for async filtering, where we search through more complex data. + * @type {Boolean} + */ + internalSearch: { + type: Boolean, + default: true + }, + /** + * Array of available options: Objects, Strings or Integers. + * If array of objects, visible label will default to option.label. + * If `labal` prop is passed, label will equal option['label'] + * @type {Array} + */ + options: { + type: Array, + required: true + }, + /** + * Equivalent to the `multiple` attribute on a `` input. + * @default 'Select option' + * @type {String} + */ + placeholder: { + type: String, + default: 'Select option' + }, + /** + * Allow to remove all selected values + * @default true + * @type {Boolean} + */ + allowEmpty: { + type: Boolean, + default: true + }, + /** + * Reset this.internalValue, this.search after this.internalValue changes. + * Useful if want to create a stateless dropdown. + * @default false + * @type {Boolean} + */ + resetAfter: { + type: Boolean, + default: false + }, + /** + * Enable/disable closing after selecting an option + * @default true + * @type {Boolean} + */ + closeOnSelect: { + type: Boolean, + default: true + }, + /** + * Function to interpolate the custom label + * @default false + * @type {Function} + */ + customLabel: { + type: Function, + default (option, label) { + if (isEmpty(option)) return '' + return label ? option[label] : option + } + }, + /** + * Disable / Enable tagging + * @default false + * @type {Boolean} + */ + taggable: { + type: Boolean, + default: false + }, + /** + * String to show when highlighting a potential tag + * @default 'Press enter to create a tag' + * @type {String} + */ + tagPlaceholder: { + type: String, + default: 'Press enter to create a tag' + }, + /** + * By default new tags will appear above the search results. + * Changing to 'bottom' will revert this behaviour + * and will proritize the search results + * @default 'top' + * @type {String} + */ + tagPosition: { + type: String, + default: 'top' + }, + /** + * Number of allowed selected options. No limit if 0. + * @default 0 + * @type {Number} + */ + max: { + type: [Number, Boolean], + default: false + }, + /** + * Will be passed with all events as second param. + * Useful for identifying events origin. + * @default null + * @type {String|Integer} + */ + id: { + default: null + }, + /** + * Limits the options displayed in the dropdown + * to the first X options. + * @default 1000 + * @type {Integer} + */ + optionsLimit: { + type: Number, + default: 1000 + }, + /** + * Name of the property containing + * the group values + * @default 1000 + * @type {String} + */ + groupValues: { + type: String + }, + /** + * Name of the property containing + * the group label + * @default 1000 + * @type {String} + */ + groupLabel: { + type: String + }, + /** + * Allow to select all group values + * by selecting the group label + * @default false + * @type {Boolean} + */ + groupSelect: { + type: Boolean, + default: false + }, + /** + * Array of keyboard keys to block + * when selecting + * @default 1000 + * @type {String} + */ + blockKeys: { + type: Array, + default () { + return [] + } + }, + /** + * Prevent from wiping up the search value + * @default false + * @type {Boolean} + */ + preserveSearch: { + type: Boolean, + default: false + }, + /** + * Select 1st options if value is empty + * @default false + * @type {Boolean} + */ + preselectFirst: { + type: Boolean, + default: false + }, + /** + * Prevent autofocus + * @default false + * @type {Boolean} + */ + preventAutofocus: { + type: Boolean, + default: false + } + }, + mounted () { + /* istanbul ignore else */ + if (!this.multiple && this.max) { + console.warn('[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false.'); + } + if ( + this.preselectFirst && + !this.internalValue.length && + this.options.length + ) { + this.select(this.filteredOptions[0]); + } + }, + computed: { + internalValue () { + return this.modelValue || this.modelValue === 0 + ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue] + : [] + }, + filteredOptions () { + const search = this.search || ''; + const normalizedSearch = search.toLowerCase().trim(); + + let options = this.options.concat(); + + /* istanbul ignore else */ + if (this.internalSearch) { + options = this.groupValues + ? this.filterAndFlat(options, normalizedSearch, this.label) + : filterOptions(options, normalizedSearch, this.label, this.customLabel); + } else { + options = this.groupValues ? flattenOptions(this.groupValues, this.groupLabel)(options) : options; + } + + options = this.hideSelected + ? options.filter(not(this.isSelected)) + : options; + + /* istanbul ignore else */ + if (this.taggable && normalizedSearch.length && !this.isExistingOption(normalizedSearch)) { + if (this.tagPosition === 'bottom') { + options.push({isTag: true, label: search}); + } else { + options.unshift({isTag: true, label: search}); + } + } + + return options.slice(0, this.optionsLimit) + }, + valueKeys () { + if (this.trackBy) { + return this.internalValue.map((element) => element[this.trackBy]) + } else { + return this.internalValue + } + }, + optionKeys () { + const options = this.groupValues ? this.flatAndStrip(this.options) : this.options; + return options.map((element) => this.customLabel(element, this.label).toString().toLowerCase()) + }, + currentOptionLabel () { + return this.multiple + ? this.searchable ? '' : this.placeholder + : this.internalValue.length + ? this.getOptionLabel(this.internalValue[0]) + : this.searchable ? '' : this.placeholder + } + }, + watch: { + internalValue () { + /* istanbul ignore else */ + if (this.resetAfter && this.internalValue.length) { + this.search = ''; + this.$emit('update:modelValue', this.multiple ? [] : null); + } + }, + search () { + this.$emit('search-change', this.search); + } + }, + emits: ['open', 'search-change', 'close', 'select', 'update:modelValue', 'remove', 'tag'], + methods: { + /** + * Returns the internalValue in a way it can be emited to the parent + * @returns {Object||Array||String||Integer} + */ + getValue () { + return this.multiple + ? this.internalValue + : this.internalValue.length === 0 + ? null + : this.internalValue[0] + }, + /** + * Filters and then flattens the options list + * @param {Array} + * @return {Array} returns a filtered and flat options list + */ + filterAndFlat (options, search, label) { + return flow( + filterGroups(search, label, this.groupValues, this.groupLabel, this.customLabel), + flattenOptions(this.groupValues, this.groupLabel) + )(options) + }, + /** + * Flattens and then strips the group labels from the options list + * @param {Array} + * @return {Array} returns a flat options list without group labels + */ + flatAndStrip (options) { + return flow( + flattenOptions(this.groupValues, this.groupLabel), + stripGroups + )(options) + }, + /** + * Updates the search value + * @param {String} + */ + updateSearch (query) { + this.search = query; + }, + /** + * Finds out if the given query is already present + * in the available options + * @param {String} + * @return {Boolean} returns true if element is available + */ + isExistingOption (query) { + return !this.options + ? false + : this.optionKeys.indexOf(query) > -1 + }, + /** + * Finds out if the given element is already present + * in the result value + * @param {Object||String||Integer} option passed element to check + * @returns {Boolean} returns true if element is selected + */ + isSelected (option) { + const opt = this.trackBy + ? option[this.trackBy] + : option; + return this.valueKeys.indexOf(opt) > -1 + }, + /** + * Finds out if the given option is disabled + * @param {Object||String||Integer} option passed element to check + * @returns {Boolean} returns true if element is disabled + */ + isOptionDisabled (option) { + return !!option.$isDisabled + }, + /** + * Returns empty string when options is null/undefined + * Returns tag query if option is tag. + * Returns the customLabel() results and casts it to string. + * + * @param {Object||String||Integer} Passed option + * @returns {Object||String} + */ + getOptionLabel (option) { + if (isEmpty(option)) return '' + /* istanbul ignore else */ + if (option.isTag) return option.label + /* istanbul ignore else */ + if (option.$isLabel) return option.$groupLabel + + const label = this.customLabel(option, this.label); + /* istanbul ignore else */ + if (isEmpty(label)) return '' + return label + }, + /** + * Add the given option to the list of selected options + * or sets the option as the selected option. + * If option is already selected -> remove it from the results. + * + * @param {Object||String||Integer} option to select/deselect + * @param {Boolean} block removing + */ + select (option, key) { + /* istanbul ignore else */ + if (option.$isLabel && this.groupSelect) { + this.selectGroup(option); + return + } + if (this.blockKeys.indexOf(key) !== -1 || + this.disabled || + option.$isDisabled || + option.$isLabel + ) return + /* istanbul ignore else */ + if (this.max && this.multiple && this.internalValue.length === this.max) return + /* istanbul ignore else */ + if (key === 'Tab' && !this.pointerDirty) return + if (option.isTag) { + this.$emit('tag', option.label, this.id); + this.search = ''; + if (this.closeOnSelect && !this.multiple) this.deactivate(); + } else { + const isSelected = this.isSelected(option); + + if (isSelected) { + if (key !== 'Tab') this.removeElement(option); + return + } + + if (this.multiple) { + this.$emit('update:modelValue', this.internalValue.concat([option])); + } else { + this.$emit('update:modelValue', option); + } + + this.$emit('select', option, this.id); + + /* istanbul ignore else */ + if (this.clearOnSelect) this.search = ''; + } + /* istanbul ignore else */ + if (this.closeOnSelect) this.deactivate(); + }, + /** + * Add the given group options to the list of selected options + * If all group optiona are already selected -> remove it from the results. + * + * @param {Object||String||Integer} group to select/deselect + */ + selectGroup (selectedGroup) { + const group = this.options.find((option) => { + return option[this.groupLabel] === selectedGroup.$groupLabel + }); + + if (!group) return + + if (this.wholeGroupSelected(group)) { + this.$emit('remove', group[this.groupValues], this.id); + + const newValue = this.internalValue.filter( + (option) => group[this.groupValues].indexOf(option) === -1 + ); + + this.$emit('update:modelValue', newValue); + } else { + let optionsToAdd = group[this.groupValues].filter( + option => !(this.isOptionDisabled(option) || this.isSelected(option)) + ); + + // if max is defined then just select options respecting max + if (this.max) { + optionsToAdd.splice(this.max - this.internalValue.length); + } + + this.$emit('select', optionsToAdd, this.id); + this.$emit( + 'update:modelValue', + this.internalValue.concat(optionsToAdd) + ); + } + + if (this.closeOnSelect) this.deactivate(); + }, + /** + * Helper to identify if all values in a group are selected + * + * @param {Object} group to validated selected values against + */ + wholeGroupSelected (group) { + return group[this.groupValues].every((option) => this.isSelected(option) || this.isOptionDisabled(option) + ) + }, + /** + * Helper to identify if all values in a group are disabled + * + * @param {Object} group to check for disabled values + */ + wholeGroupDisabled (group) { + return group[this.groupValues].every(this.isOptionDisabled) + }, + /** + * Removes the given option from the selected options. + * Additionally checks this.allowEmpty prop if option can be removed when + * it is the last selected option. + * + * @param {type} option description + * @return {type} description + */ + removeElement (option, shouldClose = true) { + /* istanbul ignore else */ + if (this.disabled) return + /* istanbul ignore else */ + if (option.$isDisabled) return + /* istanbul ignore else */ + if (!this.allowEmpty && this.internalValue.length <= 1) { + this.deactivate(); + return + } + + const index = typeof option === 'object' + ? this.valueKeys.indexOf(option[this.trackBy]) + : this.valueKeys.indexOf(option); + + if (this.multiple) { + const newValue = this.internalValue.slice(0, index).concat(this.internalValue.slice(index + 1)); + this.$emit('update:modelValue', newValue); + } else { + this.$emit('update:modelValue', null); + } + this.$emit('remove', option, this.id); + + /* istanbul ignore else */ + if (this.closeOnSelect && shouldClose) this.deactivate(); + }, + /** + * Calls this.removeElement() with the last element + * from this.internalValue (selected element Array) + * + * @fires this#removeElement + */ + removeLastElement () { + /* istanbul ignore else */ + if (this.blockKeys.indexOf('Delete') !== -1) return + /* istanbul ignore else */ + if (this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length) { + this.removeElement(this.internalValue[this.internalValue.length - 1], false); + } + }, + /** + * Opens the multiselect’s dropdown. + * Sets this.isOpen to TRUE + */ + activate () { + /* istanbul ignore else */ + if (this.isOpen || this.disabled) return + + this.adjustPosition(); + /* istanbul ignore else */ + if (this.groupValues && this.pointer === 0 && this.filteredOptions.length) { + this.pointer = 1; + } + + this.isOpen = true; + /* istanbul ignore else */ + if (this.searchable) { + if (!this.preserveSearch) this.search = ''; + if (!this.preventAutofocus) this.$nextTick(() => this.$refs.search && this.$refs.search.focus()); + } else if (!this.preventAutofocus) { + if (typeof this.$el !== 'undefined') this.$el.focus(); + } + this.$emit('open', this.id); + }, + /** + * Closes the multiselect’s dropdown. + * Sets this.isOpen to FALSE + */ + deactivate () { + /* istanbul ignore else */ + if (!this.isOpen) return + + this.isOpen = false; + /* istanbul ignore else */ + if (this.searchable) { + if (typeof this.$refs.search !== 'undefined') this.$refs.search.blur(); + } else { + if (typeof this.$el !== 'undefined') this.$el.blur(); + } + if (!this.preserveSearch) this.search = ''; + this.$emit('close', this.getValue(), this.id); + }, + /** + * Call this.activate() or this.deactivate() + * depending on this.isOpen value. + * + * @fires this#activate || this#deactivate + * @property {Boolean} isOpen indicates if dropdown is open + */ + toggle () { + this.isOpen + ? this.deactivate() + : this.activate(); + }, + /** + * Updates the hasEnoughSpace variable used for + * detecting where to expand the dropdown + */ + adjustPosition () { + if (typeof window === 'undefined') return + + const spaceAbove = this.$el.getBoundingClientRect().top; + const spaceBelow = window.innerHeight - this.$el.getBoundingClientRect().bottom; + const hasEnoughSpaceBelow = spaceBelow > this.maxHeight; + + if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || this.openDirection === 'below' || this.openDirection === 'bottom') { + this.preferredOpenDirection = 'below'; + this.optimizedHeight = Math.min(spaceBelow - 40, this.maxHeight); + } else { + this.preferredOpenDirection = 'above'; + this.optimizedHeight = Math.min(spaceAbove - 40, this.maxHeight); + } + } + } +}; + +var pointerMixin = { + data () { + return { + pointer: 0, + pointerDirty: false + } + }, + props: { + /** + * Enable/disable highlighting of the pointed value. + * @type {Boolean} + * @default true + */ + showPointer: { + type: Boolean, + default: true + }, + optionHeight: { + type: Number, + default: 40 + } + }, + computed: { + pointerPosition () { + return this.pointer * this.optionHeight + }, + visibleElements () { + return this.optimizedHeight / this.optionHeight + } + }, + watch: { + filteredOptions () { + this.pointerAdjust(); + }, + isOpen () { + this.pointerDirty = false; + }, + pointer () { + this.$refs.search && this.$refs.search.setAttribute('aria-activedescendant', this.id + '-' + this.pointer.toString()); + } + }, + methods: { + optionHighlight (index, option) { + return { + 'multiselect__option--highlight': index === this.pointer && this.showPointer, + 'multiselect__option--selected': this.isSelected(option) + } + }, + groupHighlight (index, selectedGroup) { + if (!this.groupSelect) { + return [ + 'multiselect__option--disabled', + {'multiselect__option--group': selectedGroup.$isLabel} + ] + } + + const group = this.options.find((option) => { + return option[this.groupLabel] === selectedGroup.$groupLabel + }); + + return group && !this.wholeGroupDisabled(group) ? [ + 'multiselect__option--group', + {'multiselect__option--highlight': index === this.pointer && this.showPointer}, + {'multiselect__option--group-selected': this.wholeGroupSelected(group)} + ] : 'multiselect__option--disabled' + }, + addPointerElement ({key} = 'Enter') { + /* istanbul ignore else */ + if (this.filteredOptions.length > 0) { + this.select(this.filteredOptions[this.pointer], key); + } + this.pointerReset(); + }, + pointerForward () { + /* istanbul ignore else */ + if (this.pointer < this.filteredOptions.length - 1) { + this.pointer++; + /* istanbul ignore next */ + if (this.$refs.list.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight) { + this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight; + } + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) this.pointerForward(); + } + this.pointerDirty = true; + }, + pointerBackward () { + if (this.pointer > 0) { + this.pointer--; + /* istanbul ignore else */ + if (this.$refs.list.scrollTop >= this.pointerPosition) { + this.$refs.list.scrollTop = this.pointerPosition; + } + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) this.pointerBackward(); + } else { + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[0].$isLabel && + !this.groupSelect + ) this.pointerForward(); + } + this.pointerDirty = true; + }, + pointerReset () { + /* istanbul ignore else */ + if (!this.closeOnSelect) return + this.pointer = 0; + /* istanbul ignore else */ + if (this.$refs.list) { + this.$refs.list.scrollTop = 0; + } + }, + pointerAdjust () { + /* istanbul ignore else */ + if (this.pointer >= this.filteredOptions.length - 1) { + this.pointer = this.filteredOptions.length + ? this.filteredOptions.length - 1 + : 0; + } + + if (this.filteredOptions.length > 0 && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) { + this.pointerForward(); + } + }, + pointerSet (index) { + this.pointer = index; + this.pointerDirty = true; + } + } +}; + +var script = { + name: 'vue-multiselect', + mixins: [multiselectMixin, pointerMixin], + props: { + /** + * name attribute to match optional label element + * @default '' + * @type {String} + */ + name: { + type: String, + default: '' + }, + /** + * Presets the selected options value. + * @type {Object||Array||String||Integer} + */ + modelValue: { + type: null, + default () { + return [] + } + }, + /** + * String to show when pointing to an option + * @default 'Press enter to select' + * @type {String} + */ + selectLabel: { + type: String, + default: 'Press enter to select' + }, + /** + * String to show when pointing to an option + * @default 'Press enter to select' + * @type {String} + */ + selectGroupLabel: { + type: String, + default: 'Press enter to select group' + }, + /** + * String to show next to selected option + * @default 'Selected' + * @type {String} + */ + selectedLabel: { + type: String, + default: 'Selected' + }, + /** + * String to show when pointing to an already selected option + * @default 'Press enter to remove' + * @type {String} + */ + deselectLabel: { + type: String, + default: 'Press enter to remove' + }, + /** + * String to show when pointing to an already selected option + * @default 'Press enter to remove' + * @type {String} + */ + deselectGroupLabel: { + type: String, + default: 'Press enter to deselect group' + }, + /** + * Decide whether to show pointer labels + * @default true + * @type {Boolean} + */ + showLabels: { + type: Boolean, + default: true + }, + /** + * Limit the display of selected options. The rest will be hidden within the limitText string. + * @default 99999 + * @type {Integer} + */ + limit: { + type: Number, + default: 99999 + }, + /** + * Sets maxHeight style value of the dropdown + * @default 300 + * @type {Integer} + */ + maxHeight: { + type: Number, + default: 300 + }, + /** + * Function that process the message shown when selected + * elements pass the defined limit. + * @default 'and * more' + * @param {Int} count Number of elements more than limit + * @type {Function} + */ + limitText: { + type: Function, + default: (count) => `and ${count} more` + }, + /** + * Set true to trigger the loading spinner. + * @default False + * @type {Boolean} + */ + loading: { + type: Boolean, + default: false + }, + /** + * Disables the multiselect if true. + * @default false + * @type {Boolean} + */ + disabled: { + type: Boolean, + default: false + }, + /** + * Fixed opening direction + * @default '' + * @type {String} + */ + openDirection: { + type: String, + default: '' + }, + /** + * Shows slot with message about empty options + * @default true + * @type {Boolean} + */ + showNoOptions: { + type: Boolean, + default: true + }, + showNoResults: { + type: Boolean, + default: true + }, + tabindex: { + type: Number, + default: 0 + } + }, + computed: { + hasOptionGroup () { + return this.groupValues && this.groupLabel && this.groupSelect + }, + isSingleLabelVisible () { + return ( + (this.singleValue || this.singleValue === 0) && + (!this.isOpen || !this.searchable) && + !this.visibleValues.length + ) + }, + isPlaceholderVisible () { + return !this.internalValue.length && (!this.searchable || !this.isOpen) + }, + visibleValues () { + return this.multiple ? this.internalValue.slice(0, this.limit) : [] + }, + singleValue () { + return this.internalValue[0] + }, + deselectLabelText () { + return this.showLabels ? this.deselectLabel : '' + }, + deselectGroupLabelText () { + return this.showLabels ? this.deselectGroupLabel : '' + }, + selectLabelText () { + return this.showLabels ? this.selectLabel : '' + }, + selectGroupLabelText () { + return this.showLabels ? this.selectGroupLabel : '' + }, + selectedLabelText () { + return this.showLabels ? this.selectedLabel : '' + }, + inputStyle () { + if ( + this.searchable || + (this.multiple && this.modelValue && this.modelValue.length) + ) { + // Hide input by setting the width to 0 allowing it to receive focus + return this.isOpen + ? {width: '100%'} + : {width: '0', position: 'absolute', padding: '0'} + } + return '' + }, + contentStyle () { + return this.options.length + ? {display: 'inline-block'} + : {display: 'block'} + }, + isAbove () { + if (this.openDirection === 'above' || this.openDirection === 'top') { + return true + } else if ( + this.openDirection === 'below' || + this.openDirection === 'bottom' + ) { + return false + } else { + return this.preferredOpenDirection === 'above' + } + }, + showSearchInput () { + return ( + this.searchable && + (this.hasSingleSelectedSlot && + (this.visibleSingleValue || this.visibleSingleValue === 0) + ? this.isOpen + : true) + ) + } + } +}; + +const _hoisted_1 = { + ref: "tags", + class: "multiselect__tags" +}; +const _hoisted_2 = { class: "multiselect__tags-wrap" }; +const _hoisted_3 = { class: "multiselect__spinner" }; +const _hoisted_4 = { key: 0 }; +const _hoisted_5 = { class: "multiselect__option" }; +const _hoisted_6 = { class: "multiselect__option" }; +const _hoisted_7 = /*#__PURE__*/vue.createTextVNode("No elements found. Consider changing the search query."); +const _hoisted_8 = { class: "multiselect__option" }; +const _hoisted_9 = /*#__PURE__*/vue.createTextVNode("List is empty."); + +function render(_ctx, _cache, $props, $setup, $data, $options) { + return (vue.openBlock(), vue.createBlock("div", { + tabindex: _ctx.searchable ? -1 : $props.tabindex, + class: [{ 'multiselect--active': _ctx.isOpen, 'multiselect--disabled': $props.disabled, 'multiselect--above': $options.isAbove, 'multiselect--has-options-group': $options.hasOptionGroup }, "multiselect"], + onFocus: _cache[14] || (_cache[14] = $event => (_ctx.activate())), + onBlur: _cache[15] || (_cache[15] = $event => (_ctx.searchable ? false : _ctx.deactivate())), + onKeydown: [ + _cache[16] || (_cache[16] = vue.withKeys(vue.withModifiers($event => (_ctx.pointerForward()), ["self","prevent"]), ["down"])), + _cache[17] || (_cache[17] = vue.withKeys(vue.withModifiers($event => (_ctx.pointerBackward()), ["self","prevent"]), ["up"])) + ], + onKeypress: _cache[18] || (_cache[18] = vue.withKeys(vue.withModifiers($event => (_ctx.addPointerElement($event)), ["stop","self"]), ["enter","tab"])), + onKeyup: _cache[19] || (_cache[19] = vue.withKeys($event => (_ctx.deactivate()), ["esc"])), + role: "combobox", + "aria-owns": 'listbox-'+_ctx.id + }, [ + vue.renderSlot(_ctx.$slots, "caret", { toggle: _ctx.toggle }, () => [ + vue.createVNode("div", { + onMousedown: _cache[1] || (_cache[1] = vue.withModifiers($event => (_ctx.toggle()), ["prevent","stop"])), + class: "multiselect__select" + }, null, 32 /* HYDRATE_EVENTS */) + ]), + vue.renderSlot(_ctx.$slots, "clear", { search: _ctx.search }), + vue.createVNode("div", _hoisted_1, [ + vue.renderSlot(_ctx.$slots, "selection", { + search: _ctx.search, + remove: _ctx.removeElement, + values: $options.visibleValues, + isOpen: _ctx.isOpen + }, () => [ + vue.withDirectives(vue.createVNode("div", _hoisted_2, [ + (vue.openBlock(true), vue.createBlock(vue.Fragment, null, vue.renderList($options.visibleValues, (option, index) => { + return vue.renderSlot(_ctx.$slots, "tag", { + option: option, + search: _ctx.search, + remove: _ctx.removeElement + }, () => [ + (vue.openBlock(), vue.createBlock("span", { + class: "multiselect__tag", + key: index + }, [ + vue.createVNode("span", { + textContent: vue.toDisplayString(_ctx.getOptionLabel(option)) + }, null, 8 /* PROPS */, ["textContent"]), + vue.createVNode("i", { + tabindex: "1", + onKeypress: vue.withKeys(vue.withModifiers($event => (_ctx.removeElement(option)), ["prevent"]), ["enter"]), + onMousedown: vue.withModifiers($event => (_ctx.removeElement(option)), ["prevent"]), + class: "multiselect__tag-icon" + }, null, 40 /* PROPS, HYDRATE_EVENTS */, ["onKeypress", "onMousedown"]) + ])) + ]) + }), 256 /* UNKEYED_FRAGMENT */)) + ], 512 /* NEED_PATCH */), [ + [vue.vShow, $options.visibleValues.length > 0] + ]), + (_ctx.internalValue && _ctx.internalValue.length > $props.limit) + ? vue.renderSlot(_ctx.$slots, "limit", { key: 0 }, () => [ + vue.createVNode("strong", { + class: "multiselect__strong", + textContent: vue.toDisplayString($props.limitText(_ctx.internalValue.length - $props.limit)) + }, null, 8 /* PROPS */, ["textContent"]) + ]) + : vue.createCommentVNode("v-if", true) + ]), + vue.createVNode(vue.Transition, { name: "multiselect__loading" }, { + default: vue.withCtx(() => [ + vue.renderSlot(_ctx.$slots, "loading", {}, () => [ + vue.withDirectives(vue.createVNode("div", _hoisted_3, null, 512 /* NEED_PATCH */), [ + [vue.vShow, $props.loading] + ]) + ]) + ]), + _: 3 /* FORWARDED */ + }), + (_ctx.searchable) + ? (vue.openBlock(), vue.createBlock("input", { + key: 0, + ref: "search", + name: $props.name, + id: _ctx.id, + type: "text", + autocomplete: "off", + spellcheck: "false", + placeholder: _ctx.placeholder, + style: $options.inputStyle, + value: _ctx.search, + disabled: $props.disabled, + tabindex: $props.tabindex, + onInput: _cache[2] || (_cache[2] = $event => (_ctx.updateSearch($event.target.value))), + onFocus: _cache[3] || (_cache[3] = vue.withModifiers($event => (_ctx.activate()), ["prevent"])), + onBlur: _cache[4] || (_cache[4] = vue.withModifiers($event => (_ctx.deactivate()), ["prevent"])), + onKeyup: _cache[5] || (_cache[5] = vue.withKeys($event => (_ctx.deactivate()), ["esc"])), + onKeydown: [ + _cache[6] || (_cache[6] = vue.withKeys(vue.withModifiers($event => (_ctx.pointerForward()), ["prevent"]), ["down"])), + _cache[7] || (_cache[7] = vue.withKeys(vue.withModifiers($event => (_ctx.pointerBackward()), ["prevent"]), ["up"])), + _cache[9] || (_cache[9] = vue.withKeys(vue.withModifiers($event => (_ctx.removeLastElement()), ["stop"]), ["delete"])) + ], + onKeypress: _cache[8] || (_cache[8] = vue.withKeys(vue.withModifiers($event => (_ctx.addPointerElement($event)), ["prevent","stop","self"]), ["enter"])), + class: "multiselect__input", + "aria-controls": 'listbox-'+_ctx.id + }, null, 44 /* STYLE, PROPS, HYDRATE_EVENTS */, ["name", "id", "placeholder", "value", "disabled", "tabindex", "aria-controls"])) + : vue.createCommentVNode("v-if", true), + ($options.isSingleLabelVisible) + ? (vue.openBlock(), vue.createBlock("span", { + key: 1, + class: "multiselect__single", + onMousedown: _cache[10] || (_cache[10] = vue.withModifiers((...args) => (_ctx.toggle && _ctx.toggle(...args)), ["prevent"])) + }, [ + vue.renderSlot(_ctx.$slots, "singleLabel", { option: $options.singleValue }, () => [ + vue.createTextVNode(vue.toDisplayString(_ctx.currentOptionLabel), 1 /* TEXT */) + ]) + ], 32 /* HYDRATE_EVENTS */)) + : vue.createCommentVNode("v-if", true), + ($options.isPlaceholderVisible) + ? (vue.openBlock(), vue.createBlock("span", { + key: 2, + class: "multiselect__placeholder", + onMousedown: _cache[11] || (_cache[11] = vue.withModifiers((...args) => (_ctx.toggle && _ctx.toggle(...args)), ["prevent"])) + }, [ + vue.renderSlot(_ctx.$slots, "placeholder", {}, () => [ + vue.createTextVNode(vue.toDisplayString(_ctx.placeholder), 1 /* TEXT */) + ]) + ], 32 /* HYDRATE_EVENTS */)) + : vue.createCommentVNode("v-if", true) + ], 512 /* NEED_PATCH */), + vue.createVNode(vue.Transition, { name: "multiselect" }, { + default: vue.withCtx(() => [ + vue.withDirectives(vue.createVNode("div", { + class: "multiselect__content-wrapper", + onFocus: _cache[12] || (_cache[12] = (...args) => (_ctx.activate && _ctx.activate(...args))), + tabindex: "-1", + onMousedown: _cache[13] || (_cache[13] = vue.withModifiers(() => {}, ["prevent"])), + style: { maxHeight: _ctx.optimizedHeight + 'px' }, + ref: "list" + }, [ + vue.createVNode("ul", { + class: "multiselect__content", + style: $options.contentStyle, + role: "listbox", + id: 'listbox-'+_ctx.id + }, [ + vue.renderSlot(_ctx.$slots, "beforeList"), + (_ctx.multiple && _ctx.max === _ctx.internalValue.length) + ? (vue.openBlock(), vue.createBlock("li", _hoisted_4, [ + vue.createVNode("span", _hoisted_5, [ + vue.renderSlot(_ctx.$slots, "maxElements", {}, () => [ + vue.createTextVNode("Maximum of " + vue.toDisplayString(_ctx.max) + " options selected. First remove a selected option to select another.", 1 /* TEXT */) + ]) + ]) + ])) + : vue.createCommentVNode("v-if", true), + (!_ctx.max || _ctx.internalValue.length < _ctx.max) + ? (vue.openBlock(true), vue.createBlock(vue.Fragment, { key: 1 }, vue.renderList(_ctx.filteredOptions, (option, index) => { + return (vue.openBlock(), vue.createBlock("li", { + class: "multiselect__element", + key: index, + id: _ctx.id + '-' + index, + role: !(option && (option.$isLabel || option.$isDisabled)) ? 'option' : null + }, [ + (!(option && (option.$isLabel || option.$isDisabled))) + ? (vue.openBlock(), vue.createBlock("span", { + key: 0, + class: [_ctx.optionHighlight(index, option), "multiselect__option"], + onClick: vue.withModifiers($event => (_ctx.select(option)), ["stop"]), + onMouseenter: vue.withModifiers($event => (_ctx.pointerSet(index)), ["self"]), + "data-select": option && option.isTag ? _ctx.tagPlaceholder : $options.selectLabelText, + "data-selected": $options.selectedLabelText, + "data-deselect": $options.deselectLabelText + }, [ + vue.renderSlot(_ctx.$slots, "option", { + option: option, + search: _ctx.search, + index: index + }, () => [ + vue.createVNode("span", null, vue.toDisplayString(_ctx.getOptionLabel(option)), 1 /* TEXT */) + ]) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"])) + : vue.createCommentVNode("v-if", true), + (option && (option.$isLabel || option.$isDisabled)) + ? (vue.openBlock(), vue.createBlock("span", { + key: 1, + "data-select": _ctx.groupSelect && $options.selectGroupLabelText, + "data-deselect": _ctx.groupSelect && $options.deselectGroupLabelText, + class: [_ctx.groupHighlight(index, option), "multiselect__option"], + onMouseenter: vue.withModifiers($event => (_ctx.groupSelect && _ctx.pointerSet(index)), ["self"]), + onMousedown: vue.withModifiers($event => (_ctx.selectGroup(option)), ["prevent"]) + }, [ + vue.renderSlot(_ctx.$slots, "option", { + option: option, + search: _ctx.search, + index: index + }, () => [ + vue.createVNode("span", null, vue.toDisplayString(_ctx.getOptionLabel(option)), 1 /* TEXT */) + ]) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["data-select", "data-deselect", "onMouseenter", "onMousedown"])) + : vue.createCommentVNode("v-if", true) + ], 8 /* PROPS */, ["id", "role"])) + }), 128 /* KEYED_FRAGMENT */)) + : vue.createCommentVNode("v-if", true), + vue.withDirectives(vue.createVNode("li", null, [ + vue.createVNode("span", _hoisted_6, [ + vue.renderSlot(_ctx.$slots, "noResult", { search: _ctx.search }, () => [ + _hoisted_7 + ]) + ]) + ], 512 /* NEED_PATCH */), [ + [vue.vShow, $props.showNoResults && (_ctx.filteredOptions.length === 0 && _ctx.search && !$props.loading)] + ]), + vue.withDirectives(vue.createVNode("li", null, [ + vue.createVNode("span", _hoisted_8, [ + vue.renderSlot(_ctx.$slots, "noOptions", {}, () => [ + _hoisted_9 + ]) + ]) + ], 512 /* NEED_PATCH */), [ + [vue.vShow, $props.showNoOptions && ((_ctx.options.length === 0 || ($options.hasOptionGroup === true && _ctx.filteredOptions.length === 0)) && !_ctx.search && !$props.loading)] + ]), + vue.renderSlot(_ctx.$slots, "afterList") + ], 12 /* STYLE, PROPS */, ["id"]) + ], 36 /* STYLE, HYDRATE_EVENTS */), [ + [vue.vShow, _ctx.isOpen] + ]) + ]), + _: 3 /* FORWARDED */ + }) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["tabindex", "aria-owns"])) +} + +script.render = render; + +exports.Multiselect = script; +exports.default = script; +exports.multiselectMixin = multiselectMixin; +exports.pointerMixin = pointerMixin; diff --git a/dist/vue3-multiselect.common.js b/dist/vue3-multiselect.common.js new file mode 100644 index 00000000..e41b17b6 --- /dev/null +++ b/dist/vue3-multiselect.common.js @@ -0,0 +1,4454 @@ +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "fb15"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "00ee": +/***/ (function(module, exports, __webpack_require__) { + +var wellKnownSymbol = __webpack_require__("b622"); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var test = {}; + +test[TO_STRING_TAG] = 'z'; + +module.exports = String(test) === '[object z]'; + + +/***/ }), + +/***/ "0366": +/***/ (function(module, exports, __webpack_require__) { + +var aFunction = __webpack_require__("1c0b"); + +// optional / simple context binding +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 0: return function () { + return fn.call(that); + }; + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + + +/***/ }), + +/***/ "06cf": +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__("83ab"); +var propertyIsEnumerableModule = __webpack_require__("d1e7"); +var createPropertyDescriptor = __webpack_require__("5c6c"); +var toIndexedObject = __webpack_require__("fc6a"); +var toPrimitive = __webpack_require__("c04e"); +var has = __webpack_require__("5135"); +var IE8_DOM_DEFINE = __webpack_require__("0cfb"); + +var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// `Object.getOwnPropertyDescriptor` method +// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor +exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { + O = toIndexedObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return nativeGetOwnPropertyDescriptor(O, P); + } catch (error) { /* empty */ } + if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); +}; + + +/***/ }), + +/***/ "0cfb": +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__("83ab"); +var fails = __webpack_require__("d039"); +var createElement = __webpack_require__("cc12"); + +// Thank's IE8 for his funny defineProperty +module.exports = !DESCRIPTORS && !fails(function () { + return Object.defineProperty(createElement('div'), 'a', { + get: function () { return 7; } + }).a != 7; +}); + + +/***/ }), + +/***/ "0d03": +/***/ (function(module, exports, __webpack_require__) { + +var redefine = __webpack_require__("6eeb"); + +var DatePrototype = Date.prototype; +var INVALID_DATE = 'Invalid Date'; +var TO_STRING = 'toString'; +var nativeDateToString = DatePrototype[TO_STRING]; +var getTime = DatePrototype.getTime; + +// `Date.prototype.toString` method +// https://tc39.es/ecma262/#sec-date.prototype.tostring +if (new Date(NaN) + '' != INVALID_DATE) { + redefine(DatePrototype, TO_STRING, function toString() { + var value = getTime.call(this); + // eslint-disable-next-line no-self-compare -- NaN check + return value === value ? nativeDateToString.call(this) : INVALID_DATE; + }); +} + + +/***/ }), + +/***/ "129f": +/***/ (function(module, exports) { + +// `SameValue` abstract operation +// https://tc39.es/ecma262/#sec-samevalue +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare -- NaN check + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; + + +/***/ }), + +/***/ "13d5": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__("23e7"); +var $reduce = __webpack_require__("d58f").left; +var arrayMethodIsStrict = __webpack_require__("a640"); +var CHROME_VERSION = __webpack_require__("2d00"); +var IS_NODE = __webpack_require__("605d"); + +var STRICT_METHOD = arrayMethodIsStrict('reduce'); +// Chrome 80-82 has a critical bug +// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 +var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83; + +// `Array.prototype.reduce` method +// https://tc39.es/ecma262/#sec-array.prototype.reduce +$({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, { + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "14c3": +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__("c6b6"); +var regexpExec = __webpack_require__("9263"); + +// `RegExpExec` abstract operation +// https://tc39.es/ecma262/#sec-regexpexec +module.exports = function (R, S) { + var exec = R.exec; + if (typeof exec === 'function') { + var result = exec.call(R, S); + if (typeof result !== 'object') { + throw TypeError('RegExp exec method returned something other than an Object or null'); + } + return result; + } + + if (classof(R) !== 'RegExp') { + throw TypeError('RegExp#exec called on incompatible receiver'); + } + + return regexpExec.call(R, S); +}; + + + +/***/ }), + +/***/ "1be4": +/***/ (function(module, exports, __webpack_require__) { + +var getBuiltIn = __webpack_require__("d066"); + +module.exports = getBuiltIn('document', 'documentElement'); + + +/***/ }), + +/***/ "1c0b": +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') { + throw TypeError(String(it) + ' is not a function'); + } return it; +}; + + +/***/ }), + +/***/ "1d80": +/***/ (function(module, exports) { + +// `RequireObjectCoercible` abstract operation +// https://tc39.es/ecma262/#sec-requireobjectcoercible +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), + +/***/ "1dde": +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__("d039"); +var wellKnownSymbol = __webpack_require__("b622"); +var V8_VERSION = __webpack_require__("2d00"); + +var SPECIES = wellKnownSymbol('species'); + +module.exports = function (METHOD_NAME) { + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/677 + return V8_VERSION >= 51 || !fails(function () { + var array = []; + var constructor = array.constructor = {}; + constructor[SPECIES] = function () { + return { foo: 1 }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }); +}; + + +/***/ }), + +/***/ "23cb": +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__("a691"); + +var max = Math.max; +var min = Math.min; + +// Helper for a popular repeating case of the spec: +// Let integer be ? ToInteger(index). +// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). +module.exports = function (index, length) { + var integer = toInteger(index); + return integer < 0 ? max(integer + length, 0) : min(integer, length); +}; + + +/***/ }), + +/***/ "23e7": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("da84"); +var getOwnPropertyDescriptor = __webpack_require__("06cf").f; +var createNonEnumerableProperty = __webpack_require__("9112"); +var redefine = __webpack_require__("6eeb"); +var setGlobal = __webpack_require__("ce4e"); +var copyConstructorProperties = __webpack_require__("e893"); +var isForced = __webpack_require__("94ca"); + +/* + options.target - name of the target object + options.global - target is the global object + options.stat - export as static methods of target + options.proto - export as prototype methods of target + options.real - real prototype method for the `pure` version + options.forced - export even if the native feature is available + options.bind - bind methods to the target, required for the `pure` version + options.wrap - wrap constructors to preventing global pollution, required for the `pure` version + options.unsafe - use the simple assignment of property instead of delete + defineProperty + options.sham - add a flag to not completely full polyfills + options.enumerable - export as enumerable property + options.noTargetGet - prevent calling a getter on target +*/ +module.exports = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var FORCED, target, key, targetProperty, sourceProperty, descriptor; + if (GLOBAL) { + target = global; + } else if (STATIC) { + target = global[TARGET] || setGlobal(TARGET, {}); + } else { + target = (global[TARGET] || {}).prototype; + } + if (target) for (key in source) { + sourceProperty = source[key]; + if (options.noTargetGet) { + descriptor = getOwnPropertyDescriptor(target, key); + targetProperty = descriptor && descriptor.value; + } else targetProperty = target[key]; + FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); + // contained in target + if (!FORCED && targetProperty !== undefined) { + if (typeof sourceProperty === typeof targetProperty) continue; + copyConstructorProperties(sourceProperty, targetProperty); + } + // add a flag to not completely full polyfills + if (options.sham || (targetProperty && targetProperty.sham)) { + createNonEnumerableProperty(sourceProperty, 'sham', true); + } + // extend global + redefine(target, key, sourceProperty, options); + } +}; + + +/***/ }), + +/***/ "241c": +/***/ (function(module, exports, __webpack_require__) { + +var internalObjectKeys = __webpack_require__("ca84"); +var enumBugKeys = __webpack_require__("7839"); + +var hiddenKeys = enumBugKeys.concat('length', 'prototype'); + +// `Object.getOwnPropertyNames` method +// https://tc39.es/ecma262/#sec-object.getownpropertynames +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return internalObjectKeys(O, hiddenKeys); +}; + + +/***/ }), + +/***/ "25f0": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var redefine = __webpack_require__("6eeb"); +var anObject = __webpack_require__("825a"); +var fails = __webpack_require__("d039"); +var flags = __webpack_require__("ad6d"); + +var TO_STRING = 'toString'; +var RegExpPrototype = RegExp.prototype; +var nativeToString = RegExpPrototype[TO_STRING]; + +var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); +// FF44- RegExp#toString has a wrong name +var INCORRECT_NAME = nativeToString.name != TO_STRING; + +// `RegExp.prototype.toString` method +// https://tc39.es/ecma262/#sec-regexp.prototype.tostring +if (NOT_GENERIC || INCORRECT_NAME) { + redefine(RegExp.prototype, TO_STRING, function toString() { + var R = anObject(this); + var p = String(R.source); + var rf = R.flags; + var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); + return '/' + p + '/' + f; + }, { unsafe: true }); +} + + +/***/ }), + +/***/ "277d": +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__("23e7"); +var isArray = __webpack_require__("e8b5"); + +// `Array.isArray` method +// https://tc39.es/ecma262/#sec-array.isarray +$({ target: 'Array', stat: true }, { + isArray: isArray +}); + + +/***/ }), + +/***/ "2d00": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("da84"); +var userAgent = __webpack_require__("342f"); + +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8; +var match, version; + +if (v8) { + match = v8.split('.'); + version = match[0] + match[1]; +} else if (userAgent) { + match = userAgent.match(/Edge\/(\d+)/); + if (!match || match[1] >= 74) { + match = userAgent.match(/Chrome\/(\d+)/); + if (match) version = match[1]; + } +} + +module.exports = version && +version; + + +/***/ }), + +/***/ "342f": +/***/ (function(module, exports, __webpack_require__) { + +var getBuiltIn = __webpack_require__("d066"); + +module.exports = getBuiltIn('navigator', 'userAgent') || ''; + + +/***/ }), + +/***/ "37e8": +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__("83ab"); +var definePropertyModule = __webpack_require__("9bf2"); +var anObject = __webpack_require__("825a"); +var objectKeys = __webpack_require__("df75"); + +// `Object.defineProperties` method +// https://tc39.es/ecma262/#sec-object.defineproperties +module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = objectKeys(Properties); + var length = keys.length; + var index = 0; + var key; + while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); + return O; +}; + + +/***/ }), + +/***/ "3bbe": +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__("861d"); + +module.exports = function (it) { + if (!isObject(it) && it !== null) { + throw TypeError("Can't set " + String(it) + ' as a prototype'); + } return it; +}; + + +/***/ }), + +/***/ "428f": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("da84"); + +module.exports = global; + + +/***/ }), + +/***/ "44ad": +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__("d039"); +var classof = __webpack_require__("c6b6"); + +var split = ''.split; + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +module.exports = fails(function () { + // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 + // eslint-disable-next-line no-prototype-builtins -- safe + return !Object('z').propertyIsEnumerable(0); +}) ? function (it) { + return classof(it) == 'String' ? split.call(it, '') : Object(it); +} : Object; + + +/***/ }), + +/***/ "44d2": +/***/ (function(module, exports, __webpack_require__) { + +var wellKnownSymbol = __webpack_require__("b622"); +var create = __webpack_require__("7c73"); +var definePropertyModule = __webpack_require__("9bf2"); + +var UNSCOPABLES = wellKnownSymbol('unscopables'); +var ArrayPrototype = Array.prototype; + +// Array.prototype[@@unscopables] +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +if (ArrayPrototype[UNSCOPABLES] == undefined) { + definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { + configurable: true, + value: create(null) + }); +} + +// add a key to Array.prototype[@@unscopables] +module.exports = function (key) { + ArrayPrototype[UNSCOPABLES][key] = true; +}; + + +/***/ }), + +/***/ "4930": +/***/ (function(module, exports, __webpack_require__) { + +var IS_NODE = __webpack_require__("605d"); +var V8_VERSION = __webpack_require__("2d00"); +var fails = __webpack_require__("d039"); + +module.exports = !!Object.getOwnPropertySymbols && !fails(function () { + /* global Symbol -- required for testing */ + return !Symbol.sham && + // Chrome 38 Symbol has incorrect toString conversion + // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances + (IS_NODE ? V8_VERSION === 38 : V8_VERSION > 37 && V8_VERSION < 41); +}); + + +/***/ }), + +/***/ "498a": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__("23e7"); +var $trim = __webpack_require__("58a8").trim; +var forcedStringTrimMethod = __webpack_require__("c8d2"); + +// `String.prototype.trim` method +// https://tc39.es/ecma262/#sec-string.prototype.trim +$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { + trim: function trim() { + return $trim(this); + } +}); + + +/***/ }), + +/***/ "4d64": +/***/ (function(module, exports, __webpack_require__) { + +var toIndexedObject = __webpack_require__("fc6a"); +var toLength = __webpack_require__("50c4"); +var toAbsoluteIndex = __webpack_require__("23cb"); + +// `Array.prototype.{ indexOf, includes }` methods implementation +var createMethod = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIndexedObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare -- NaN check + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare -- NaN check + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) { + if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + +module.exports = { + // `Array.prototype.includes` method + // https://tc39.es/ecma262/#sec-array.prototype.includes + includes: createMethod(true), + // `Array.prototype.indexOf` method + // https://tc39.es/ecma262/#sec-array.prototype.indexof + indexOf: createMethod(false) +}; + + +/***/ }), + +/***/ "4de4": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__("23e7"); +var $filter = __webpack_require__("b727").filter; +var arrayMethodHasSpeciesSupport = __webpack_require__("1dde"); + +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); + +// `Array.prototype.filter` method +// https://tc39.es/ecma262/#sec-array.prototype.filter +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "4e82": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__("23e7"); +var aFunction = __webpack_require__("1c0b"); +var toObject = __webpack_require__("7b0b"); +var fails = __webpack_require__("d039"); +var arrayMethodIsStrict = __webpack_require__("a640"); + +var test = []; +var nativeSort = test.sort; + +// IE8- +var FAILS_ON_UNDEFINED = fails(function () { + test.sort(undefined); +}); +// V8 bug +var FAILS_ON_NULL = fails(function () { + test.sort(null); +}); +// Old WebKit +var STRICT_METHOD = arrayMethodIsStrict('sort'); + +var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD; + +// `Array.prototype.sort` method +// https://tc39.es/ecma262/#sec-array.prototype.sort +$({ target: 'Array', proto: true, forced: FORCED }, { + sort: function sort(comparefn) { + return comparefn === undefined + ? nativeSort.call(toObject(this)) + : nativeSort.call(toObject(this), aFunction(comparefn)); + } +}); + + +/***/ }), + +/***/ "50c4": +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__("a691"); + +var min = Math.min; + +// `ToLength` abstract operation +// https://tc39.es/ecma262/#sec-tolength +module.exports = function (argument) { + return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 +}; + + +/***/ }), + +/***/ "5135": +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; + +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), + +/***/ "5692": +/***/ (function(module, exports, __webpack_require__) { + +var IS_PURE = __webpack_require__("c430"); +var store = __webpack_require__("c6cd"); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: '3.9.1', + mode: IS_PURE ? 'pure' : 'global', + copyright: '© 2021 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), + +/***/ "56ef": +/***/ (function(module, exports, __webpack_require__) { + +var getBuiltIn = __webpack_require__("d066"); +var getOwnPropertyNamesModule = __webpack_require__("241c"); +var getOwnPropertySymbolsModule = __webpack_require__("7418"); +var anObject = __webpack_require__("825a"); + +// all object keys, includes non-enumerable and symbols +module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { + var keys = getOwnPropertyNamesModule.f(anObject(it)); + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; +}; + + +/***/ }), + +/***/ "5899": +/***/ (function(module, exports) { + +// a string of all valid unicode whitespaces +module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + + +/***/ }), + +/***/ "58a8": +/***/ (function(module, exports, __webpack_require__) { + +var requireObjectCoercible = __webpack_require__("1d80"); +var whitespaces = __webpack_require__("5899"); + +var whitespace = '[' + whitespaces + ']'; +var ltrim = RegExp('^' + whitespace + whitespace + '*'); +var rtrim = RegExp(whitespace + whitespace + '*$'); + +// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation +var createMethod = function (TYPE) { + return function ($this) { + var string = String(requireObjectCoercible($this)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; + }; +}; + +module.exports = { + // `String.prototype.{ trimLeft, trimStart }` methods + // https://tc39.es/ecma262/#sec-string.prototype.trimstart + start: createMethod(1), + // `String.prototype.{ trimRight, trimEnd }` methods + // https://tc39.es/ecma262/#sec-string.prototype.trimend + end: createMethod(2), + // `String.prototype.trim` method + // https://tc39.es/ecma262/#sec-string.prototype.trim + trim: createMethod(3) +}; + + +/***/ }), + +/***/ "5c6c": +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), + +/***/ "605d": +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__("c6b6"); +var global = __webpack_require__("da84"); + +module.exports = classof(global.process) == 'process'; + + +/***/ }), + +/***/ "65f0": +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__("861d"); +var isArray = __webpack_require__("e8b5"); +var wellKnownSymbol = __webpack_require__("b622"); + +var SPECIES = wellKnownSymbol('species'); + +// `ArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray, length) { + var C; + if (isArray(originalArray)) { + C = originalArray.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + else if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); +}; + + +/***/ }), + +/***/ "69f3": +/***/ (function(module, exports, __webpack_require__) { + +var NATIVE_WEAK_MAP = __webpack_require__("7f9a"); +var global = __webpack_require__("da84"); +var isObject = __webpack_require__("861d"); +var createNonEnumerableProperty = __webpack_require__("9112"); +var objectHas = __webpack_require__("5135"); +var shared = __webpack_require__("c6cd"); +var sharedKey = __webpack_require__("f772"); +var hiddenKeys = __webpack_require__("d012"); + +var WeakMap = global.WeakMap; +var set, get, has; + +var enforce = function (it) { + return has(it) ? get(it) : set(it, {}); +}; + +var getterFor = function (TYPE) { + return function (it) { + var state; + if (!isObject(it) || (state = get(it)).type !== TYPE) { + throw TypeError('Incompatible receiver, ' + TYPE + ' required'); + } return state; + }; +}; + +if (NATIVE_WEAK_MAP) { + var store = shared.state || (shared.state = new WeakMap()); + var wmget = store.get; + var wmhas = store.has; + var wmset = store.set; + set = function (it, metadata) { + metadata.facade = it; + wmset.call(store, it, metadata); + return metadata; + }; + get = function (it) { + return wmget.call(store, it) || {}; + }; + has = function (it) { + return wmhas.call(store, it); + }; +} else { + var STATE = sharedKey('state'); + hiddenKeys[STATE] = true; + set = function (it, metadata) { + metadata.facade = it; + createNonEnumerableProperty(it, STATE, metadata); + return metadata; + }; + get = function (it) { + return objectHas(it, STATE) ? it[STATE] : {}; + }; + has = function (it) { + return objectHas(it, STATE); + }; +} + +module.exports = { + set: set, + get: get, + has: has, + enforce: enforce, + getterFor: getterFor +}; + + +/***/ }), + +/***/ "6eeb": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("da84"); +var createNonEnumerableProperty = __webpack_require__("9112"); +var has = __webpack_require__("5135"); +var setGlobal = __webpack_require__("ce4e"); +var inspectSource = __webpack_require__("8925"); +var InternalStateModule = __webpack_require__("69f3"); + +var getInternalState = InternalStateModule.get; +var enforceInternalState = InternalStateModule.enforce; +var TEMPLATE = String(String).split('String'); + +(module.exports = function (O, key, value, options) { + var unsafe = options ? !!options.unsafe : false; + var simple = options ? !!options.enumerable : false; + var noTargetGet = options ? !!options.noTargetGet : false; + var state; + if (typeof value == 'function') { + if (typeof key == 'string' && !has(value, 'name')) { + createNonEnumerableProperty(value, 'name', key); + } + state = enforceInternalState(value); + if (!state.source) { + state.source = TEMPLATE.join(typeof key == 'string' ? key : ''); + } + } + if (O === global) { + if (simple) O[key] = value; + else setGlobal(key, value); + return; + } else if (!unsafe) { + delete O[key]; + } else if (!noTargetGet && O[key]) { + simple = true; + } + if (simple) O[key] = value; + else createNonEnumerableProperty(O, key, value); +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, 'toString', function toString() { + return typeof this == 'function' && getInternalState(this).source || inspectSource(this); +}); + + +/***/ }), + +/***/ "7156": +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__("861d"); +var setPrototypeOf = __webpack_require__("d2bb"); + +// makes subclassing work correct for wrapped built-ins +module.exports = function ($this, dummy, Wrapper) { + var NewTarget, NewTargetPrototype; + if ( + // it can work only with native `setPrototypeOf` + setPrototypeOf && + // we haven't completely correct pre-ES6 way for getting `new.target`, so use this + typeof (NewTarget = dummy.constructor) == 'function' && + NewTarget !== Wrapper && + isObject(NewTargetPrototype = NewTarget.prototype) && + NewTargetPrototype !== Wrapper.prototype + ) setPrototypeOf($this, NewTargetPrototype); + return $this; +}; + + +/***/ }), + +/***/ "7418": +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), + +/***/ "7839": +/***/ (function(module, exports) { + +// IE8- don't enum bug keys +module.exports = [ + 'constructor', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'toLocaleString', + 'toString', + 'valueOf' +]; + + +/***/ }), + +/***/ "7b0b": +/***/ (function(module, exports, __webpack_require__) { + +var requireObjectCoercible = __webpack_require__("1d80"); + +// `ToObject` abstract operation +// https://tc39.es/ecma262/#sec-toobject +module.exports = function (argument) { + return Object(requireObjectCoercible(argument)); +}; + + +/***/ }), + +/***/ "7c73": +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__("825a"); +var defineProperties = __webpack_require__("37e8"); +var enumBugKeys = __webpack_require__("7839"); +var hiddenKeys = __webpack_require__("d012"); +var html = __webpack_require__("1be4"); +var documentCreateElement = __webpack_require__("cc12"); +var sharedKey = __webpack_require__("f772"); + +var GT = '>'; +var LT = '<'; +var PROTOTYPE = 'prototype'; +var SCRIPT = 'script'; +var IE_PROTO = sharedKey('IE_PROTO'); + +var EmptyConstructor = function () { /* empty */ }; + +var scriptTag = function (content) { + return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; +}; + +// Create object with fake `null` prototype: use ActiveX Object with cleared prototype +var NullProtoObjectViaActiveX = function (activeXDocument) { + activeXDocument.write(scriptTag('')); + activeXDocument.close(); + var temp = activeXDocument.parentWindow.Object; + activeXDocument = null; // avoid memory leak + return temp; +}; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var NullProtoObjectViaIFrame = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = documentCreateElement('iframe'); + var JS = 'java' + SCRIPT + ':'; + var iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + // https://github.com/zloirock/core-js/issues/475 + iframe.src = String(JS); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(scriptTag('document.F=Object')); + iframeDocument.close(); + return iframeDocument.F; +}; + +// Check for document.domain and active x support +// No need to use active x approach when document.domain is not set +// see https://github.com/es-shims/es5-shim/issues/150 +// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 +// avoid IE GC bug +var activeXDocument; +var NullProtoObject = function () { + try { + /* global ActiveXObject -- old IE */ + activeXDocument = document.domain && new ActiveXObject('htmlfile'); + } catch (error) { /* ignore */ } + NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); + var length = enumBugKeys.length; + while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; + return NullProtoObject(); +}; + +hiddenKeys[IE_PROTO] = true; + +// `Object.create` method +// https://tc39.es/ecma262/#sec-object.create +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + EmptyConstructor[PROTOTYPE] = anObject(O); + result = new EmptyConstructor(); + EmptyConstructor[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = NullProtoObject(); + return Properties === undefined ? result : defineProperties(result, Properties); +}; + + +/***/ }), + +/***/ "7db0": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__("23e7"); +var $find = __webpack_require__("b727").find; +var addToUnscopables = __webpack_require__("44d2"); + +var FIND = 'find'; +var SKIPS_HOLES = true; + +// Shouldn't skip holes +if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); + +// `Array.prototype.find` method +// https://tc39.es/ecma262/#sec-array.prototype.find +$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables(FIND); + + +/***/ }), + +/***/ "7f9a": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("da84"); +var inspectSource = __webpack_require__("8925"); + +var WeakMap = global.WeakMap; + +module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); + + +/***/ }), + +/***/ "825a": +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__("861d"); + +module.exports = function (it) { + if (!isObject(it)) { + throw TypeError(String(it) + ' is not an object'); + } return it; +}; + + +/***/ }), + +/***/ "83ab": +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__("d039"); + +// Detect IE8's incomplete defineProperty implementation +module.exports = !fails(function () { + return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; +}); + + +/***/ }), + +/***/ "8418": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toPrimitive = __webpack_require__("c04e"); +var definePropertyModule = __webpack_require__("9bf2"); +var createPropertyDescriptor = __webpack_require__("5c6c"); + +module.exports = function (object, key, value) { + var propertyKey = toPrimitive(key); + if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); + else object[propertyKey] = value; +}; + + +/***/ }), + +/***/ "841c": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784"); +var anObject = __webpack_require__("825a"); +var requireObjectCoercible = __webpack_require__("1d80"); +var sameValue = __webpack_require__("129f"); +var regExpExec = __webpack_require__("14c3"); + +// @@search logic +fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) { + return [ + // `String.prototype.search` method + // https://tc39.es/ecma262/#sec-string.prototype.search + function search(regexp) { + var O = requireObjectCoercible(this); + var searcher = regexp == undefined ? undefined : regexp[SEARCH]; + return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, + // `RegExp.prototype[@@search]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@search + function (regexp) { + var res = maybeCallNative(nativeSearch, regexp, this); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; + var result = regExpExec(rx, S); + if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; + return result === null ? -1 : result.index; + } + ]; +}); + + +/***/ }), + +/***/ "861d": +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), + +/***/ "8875": +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller +// MIT license +// source: https://github.com/amiller-gh/currentScript-polyfill + +// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505 + +(function (root, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}(typeof self !== 'undefined' ? self : this, function () { + function getCurrentScript () { + var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript') + // for chrome + if (!descriptor && 'currentScript' in document && document.currentScript) { + return document.currentScript + } + + // for other browsers with native support for currentScript + if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) { + return document.currentScript + } + + // IE 8-10 support script readyState + // IE 11+ & Firefox support stack trace + try { + throw new Error(); + } + catch (err) { + // Find the second match for the "at" string to get file src url from stack. + var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig, + ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig, + stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack), + scriptLocation = (stackDetails && stackDetails[1]) || false, + line = (stackDetails && stackDetails[2]) || false, + currentLocation = document.location.href.replace(document.location.hash, ''), + pageSource, + inlineScriptSourceRegExp, + inlineScriptSource, + scripts = document.getElementsByTagName('script'); // Live NodeList collection + + if (scriptLocation === currentLocation) { + pageSource = document.documentElement.outerHTML; + inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*\n\n\n","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","function isEmpty (opt) {\n if (opt === 0) return false\n if (Array.isArray(opt) && opt.length === 0) return true\n return !opt\n}\n\nfunction not (fun) {\n return (...params) => !fun(...params)\n}\n\nfunction includes (str, query) {\n /* istanbul ignore else */\n if (str === undefined) str = 'undefined'\n if (str === null) str = 'null'\n if (str === false) str = 'false'\n const text = str.toString().toLowerCase()\n return text.indexOf(query.trim()) !== -1\n}\n\nfunction filterOptions (options, search, label, customLabel) {\n return search ? options\n .filter((option) => includes(customLabel(option, label), search))\n .sort((a, b) => customLabel(a, label).length - customLabel(b, label).length) : options\n}\n\nfunction stripGroups (options) {\n return options.filter((option) => !option.$isLabel)\n}\n\nfunction flattenOptions (values, label) {\n return (options) =>\n options.reduce((prev, curr) => {\n /* istanbul ignore else */\n if (curr[values] && curr[values].length) {\n prev.push({\n $groupLabel: curr[label],\n $isLabel: true\n })\n return prev.concat(curr[values])\n }\n return prev\n }, [])\n}\n\nfunction filterGroups (search, label, values, groupLabel, customLabel) {\n return (groups) =>\n groups.map((group) => {\n /* istanbul ignore else */\n if (!group[values]) {\n console.warn(`Options passed to vue-multiselect do not contain groups, despite the config.`)\n return []\n }\n const groupOptions = filterOptions(group[values], search, label, customLabel)\n\n return groupOptions.length\n ? {\n [groupLabel]: group[groupLabel],\n [values]: groupOptions\n }\n : []\n })\n}\n\nconst flow = (...fns) => (x) => fns.reduce((v, f) => f(v), x)\n\nexport default {\n data () {\n return {\n search: '',\n isOpen: false,\n preferredOpenDirection: 'below',\n optimizedHeight: this.maxHeight\n }\n },\n props: {\n /**\n * Decide whether to filter the results based on search query.\n * Useful for async filtering, where we search through more complex data.\n * @type {Boolean}\n */\n internalSearch: {\n type: Boolean,\n default: true\n },\n /**\n * Array of available options: Objects, Strings or Integers.\n * If array of objects, visible label will default to option.label.\n * If `labal` prop is passed, label will equal option['label']\n * @type {Array}\n */\n options: {\n type: Array,\n required: true\n },\n /**\n * Equivalent to the `multiple` attribute on a `` input.\n * @default 'Select option'\n * @type {String}\n */\n placeholder: {\n type: String,\n default: 'Select option'\n },\n /**\n * Allow to remove all selected values\n * @default true\n * @type {Boolean}\n */\n allowEmpty: {\n type: Boolean,\n default: true\n },\n /**\n * Reset this.internalValue, this.search after this.internalValue changes.\n * Useful if want to create a stateless dropdown.\n * @default false\n * @type {Boolean}\n */\n resetAfter: {\n type: Boolean,\n default: false\n },\n /**\n * Enable/disable closing after selecting an option\n * @default true\n * @type {Boolean}\n */\n closeOnSelect: {\n type: Boolean,\n default: true\n },\n /**\n * Function to interpolate the custom label\n * @default false\n * @type {Function}\n */\n customLabel: {\n type: Function,\n default (option, label) {\n if (isEmpty(option)) return ''\n return label ? option[label] : option\n }\n },\n /**\n * Disable / Enable tagging\n * @default false\n * @type {Boolean}\n */\n taggable: {\n type: Boolean,\n default: false\n },\n /**\n * String to show when highlighting a potential tag\n * @default 'Press enter to create a tag'\n * @type {String}\n */\n tagPlaceholder: {\n type: String,\n default: 'Press enter to create a tag'\n },\n /**\n * By default new tags will appear above the search results.\n * Changing to 'bottom' will revert this behaviour\n * and will proritize the search results\n * @default 'top'\n * @type {String}\n */\n tagPosition: {\n type: String,\n default: 'top'\n },\n /**\n * Number of allowed selected options. No limit if 0.\n * @default 0\n * @type {Number}\n */\n max: {\n type: [Number, Boolean],\n default: false\n },\n /**\n * Will be passed with all events as second param.\n * Useful for identifying events origin.\n * @default null\n * @type {String|Integer}\n */\n id: {\n default: null\n },\n /**\n * Limits the options displayed in the dropdown\n * to the first X options.\n * @default 1000\n * @type {Integer}\n */\n optionsLimit: {\n type: Number,\n default: 1000\n },\n /**\n * Name of the property containing\n * the group values\n * @default 1000\n * @type {String}\n */\n groupValues: {\n type: String\n },\n /**\n * Name of the property containing\n * the group label\n * @default 1000\n * @type {String}\n */\n groupLabel: {\n type: String\n },\n /**\n * Allow to select all group values\n * by selecting the group label\n * @default false\n * @type {Boolean}\n */\n groupSelect: {\n type: Boolean,\n default: false\n },\n /**\n * Array of keyboard keys to block\n * when selecting\n * @default 1000\n * @type {String}\n */\n blockKeys: {\n type: Array,\n default () {\n return []\n }\n },\n /**\n * Prevent from wiping up the search value\n * @default false\n * @type {Boolean}\n */\n preserveSearch: {\n type: Boolean,\n default: false\n },\n /**\n * Select 1st options if value is empty\n * @default false\n * @type {Boolean}\n */\n preselectFirst: {\n type: Boolean,\n default: false\n },\n /**\n * Prevent autofocus\n * @default false\n * @type {Boolean}\n */\n preventAutofocus: {\n type: Boolean,\n default: false\n }\n },\n mounted () {\n /* istanbul ignore else */\n if (!this.multiple && this.max) {\n console.warn('[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false.')\n }\n if (\n this.preselectFirst &&\n !this.internalValue.length &&\n this.options.length\n ) {\n this.select(this.filteredOptions[0])\n }\n },\n computed: {\n internalValue () {\n return this.modelValue || this.modelValue === 0\n ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue]\n : []\n },\n filteredOptions () {\n const search = this.search || ''\n const normalizedSearch = search.toLowerCase().trim()\n\n let options = this.options.concat()\n\n /* istanbul ignore else */\n if (this.internalSearch) {\n options = this.groupValues\n ? this.filterAndFlat(options, normalizedSearch, this.label)\n : filterOptions(options, normalizedSearch, this.label, this.customLabel)\n } else {\n options = this.groupValues ? flattenOptions(this.groupValues, this.groupLabel)(options) : options\n }\n\n options = this.hideSelected\n ? options.filter(not(this.isSelected))\n : options\n\n /* istanbul ignore else */\n if (this.taggable && normalizedSearch.length && !this.isExistingOption(normalizedSearch)) {\n if (this.tagPosition === 'bottom') {\n options.push({isTag: true, label: search})\n } else {\n options.unshift({isTag: true, label: search})\n }\n }\n\n return options.slice(0, this.optionsLimit)\n },\n valueKeys () {\n if (this.trackBy) {\n return this.internalValue.map((element) => element[this.trackBy])\n } else {\n return this.internalValue\n }\n },\n optionKeys () {\n const options = this.groupValues ? this.flatAndStrip(this.options) : this.options\n return options.map((element) => this.customLabel(element, this.label).toString().toLowerCase())\n },\n currentOptionLabel () {\n return this.multiple\n ? this.searchable ? '' : this.placeholder\n : this.internalValue.length\n ? this.getOptionLabel(this.internalValue[0])\n : this.searchable ? '' : this.placeholder\n }\n },\n watch: {\n internalValue () {\n /* istanbul ignore else */\n if (this.resetAfter && this.internalValue.length) {\n this.search = ''\n this.$emit('update:modelValue', this.multiple ? [] : null)\n }\n },\n search () {\n this.$emit('search-change', this.search)\n }\n },\n emits: ['open', 'search-change', 'close', 'select', 'update:modelValue', 'remove', 'tag'],\n methods: {\n /**\n * Returns the internalValue in a way it can be emited to the parent\n * @returns {Object||Array||String||Integer}\n */\n getValue () {\n return this.multiple\n ? this.internalValue\n : this.internalValue.length === 0\n ? null\n : this.internalValue[0]\n },\n /**\n * Filters and then flattens the options list\n * @param {Array}\n * @return {Array} returns a filtered and flat options list\n */\n filterAndFlat (options, search, label) {\n return flow(\n filterGroups(search, label, this.groupValues, this.groupLabel, this.customLabel),\n flattenOptions(this.groupValues, this.groupLabel)\n )(options)\n },\n /**\n * Flattens and then strips the group labels from the options list\n * @param {Array}\n * @return {Array} returns a flat options list without group labels\n */\n flatAndStrip (options) {\n return flow(\n flattenOptions(this.groupValues, this.groupLabel),\n stripGroups\n )(options)\n },\n /**\n * Updates the search value\n * @param {String}\n */\n updateSearch (query) {\n this.search = query\n },\n /**\n * Finds out if the given query is already present\n * in the available options\n * @param {String}\n * @return {Boolean} returns true if element is available\n */\n isExistingOption (query) {\n return !this.options\n ? false\n : this.optionKeys.indexOf(query) > -1\n },\n /**\n * Finds out if the given element is already present\n * in the result value\n * @param {Object||String||Integer} option passed element to check\n * @returns {Boolean} returns true if element is selected\n */\n isSelected (option) {\n const opt = this.trackBy\n ? option[this.trackBy]\n : option\n return this.valueKeys.indexOf(opt) > -1\n },\n /**\n * Finds out if the given option is disabled\n * @param {Object||String||Integer} option passed element to check\n * @returns {Boolean} returns true if element is disabled\n */\n isOptionDisabled (option) {\n return !!option.$isDisabled\n },\n /**\n * Returns empty string when options is null/undefined\n * Returns tag query if option is tag.\n * Returns the customLabel() results and casts it to string.\n *\n * @param {Object||String||Integer} Passed option\n * @returns {Object||String}\n */\n getOptionLabel (option) {\n if (isEmpty(option)) return ''\n /* istanbul ignore else */\n if (option.isTag) return option.label\n /* istanbul ignore else */\n if (option.$isLabel) return option.$groupLabel\n\n const label = this.customLabel(option, this.label)\n /* istanbul ignore else */\n if (isEmpty(label)) return ''\n return label\n },\n /**\n * Add the given option to the list of selected options\n * or sets the option as the selected option.\n * If option is already selected -> remove it from the results.\n *\n * @param {Object||String||Integer} option to select/deselect\n * @param {Boolean} block removing\n */\n select (option, key) {\n /* istanbul ignore else */\n if (option.$isLabel && this.groupSelect) {\n this.selectGroup(option)\n return\n }\n if (this.blockKeys.indexOf(key) !== -1 ||\n this.disabled ||\n option.$isDisabled ||\n option.$isLabel\n ) return\n /* istanbul ignore else */\n if (this.max && this.multiple && this.internalValue.length === this.max) return\n /* istanbul ignore else */\n if (key === 'Tab' && !this.pointerDirty) return\n if (option.isTag) {\n this.$emit('tag', option.label, this.id)\n this.search = ''\n if (this.closeOnSelect && !this.multiple) this.deactivate()\n } else {\n const isSelected = this.isSelected(option)\n\n if (isSelected) {\n if (key !== 'Tab') this.removeElement(option)\n return\n }\n\n if (this.multiple) {\n this.$emit('update:modelValue', this.internalValue.concat([option]))\n } else {\n this.$emit('update:modelValue', option)\n }\n\n this.$emit('select', option, this.id)\n\n /* istanbul ignore else */\n if (this.clearOnSelect) this.search = ''\n }\n /* istanbul ignore else */\n if (this.closeOnSelect) this.deactivate()\n },\n /**\n * Add the given group options to the list of selected options\n * If all group optiona are already selected -> remove it from the results.\n *\n * @param {Object||String||Integer} group to select/deselect\n */\n selectGroup (selectedGroup) {\n const group = this.options.find((option) => {\n return option[this.groupLabel] === selectedGroup.$groupLabel\n })\n\n if (!group) return\n\n if (this.wholeGroupSelected(group)) {\n this.$emit('remove', group[this.groupValues], this.id)\n\n const newValue = this.internalValue.filter(\n (option) => group[this.groupValues].indexOf(option) === -1\n )\n\n this.$emit('update:modelValue', newValue)\n } else {\n let optionsToAdd = group[this.groupValues].filter(\n option => !(this.isOptionDisabled(option) || this.isSelected(option))\n )\n\n // if max is defined then just select options respecting max\n if (this.max) {\n optionsToAdd.splice(this.max - this.internalValue.length)\n }\n\n this.$emit('select', optionsToAdd, this.id)\n this.$emit(\n 'update:modelValue',\n this.internalValue.concat(optionsToAdd)\n )\n }\n\n if (this.closeOnSelect) this.deactivate()\n },\n /**\n * Helper to identify if all values in a group are selected\n *\n * @param {Object} group to validated selected values against\n */\n wholeGroupSelected (group) {\n return group[this.groupValues].every((option) => this.isSelected(option) || this.isOptionDisabled(option)\n )\n },\n /**\n * Helper to identify if all values in a group are disabled\n *\n * @param {Object} group to check for disabled values\n */\n wholeGroupDisabled (group) {\n return group[this.groupValues].every(this.isOptionDisabled)\n },\n /**\n * Removes the given option from the selected options.\n * Additionally checks this.allowEmpty prop if option can be removed when\n * it is the last selected option.\n *\n * @param {type} option description\n * @return {type} description\n */\n removeElement (option, shouldClose = true) {\n /* istanbul ignore else */\n if (this.disabled) return\n /* istanbul ignore else */\n if (option.$isDisabled) return\n /* istanbul ignore else */\n if (!this.allowEmpty && this.internalValue.length <= 1) {\n this.deactivate()\n return\n }\n\n const index = typeof option === 'object'\n ? this.valueKeys.indexOf(option[this.trackBy])\n : this.valueKeys.indexOf(option)\n\n if (this.multiple) {\n const newValue = this.internalValue.slice(0, index).concat(this.internalValue.slice(index + 1))\n this.$emit('update:modelValue', newValue)\n } else {\n this.$emit('update:modelValue', null)\n }\n this.$emit('remove', option, this.id)\n\n /* istanbul ignore else */\n if (this.closeOnSelect && shouldClose) this.deactivate()\n },\n /**\n * Calls this.removeElement() with the last element\n * from this.internalValue (selected element Array)\n *\n * @fires this#removeElement\n */\n removeLastElement () {\n /* istanbul ignore else */\n if (this.blockKeys.indexOf('Delete') !== -1) return\n /* istanbul ignore else */\n if (this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length) {\n this.removeElement(this.internalValue[this.internalValue.length - 1], false)\n }\n },\n /**\n * Opens the multiselect’s dropdown.\n * Sets this.isOpen to TRUE\n */\n activate () {\n /* istanbul ignore else */\n if (this.isOpen || this.disabled) return\n\n this.adjustPosition()\n /* istanbul ignore else */\n if (this.groupValues && this.pointer === 0 && this.filteredOptions.length) {\n this.pointer = 1\n }\n\n this.isOpen = true\n /* istanbul ignore else */\n if (this.searchable) {\n if (!this.preserveSearch) this.search = ''\n if (!this.preventAutofocus) this.$nextTick(() => this.$refs.search && this.$refs.search.focus())\n } else if (!this.preventAutofocus) {\n if (typeof this.$el !== 'undefined') this.$el.focus()\n }\n this.$emit('open', this.id)\n },\n /**\n * Closes the multiselect’s dropdown.\n * Sets this.isOpen to FALSE\n */\n deactivate () {\n /* istanbul ignore else */\n if (!this.isOpen) return\n\n this.isOpen = false\n /* istanbul ignore else */\n if (this.searchable) {\n if (typeof this.$refs.search !== 'undefined') this.$refs.search.blur()\n } else {\n if (typeof this.$el !== 'undefined') this.$el.blur()\n }\n if (!this.preserveSearch) this.search = ''\n this.$emit('close', this.getValue(), this.id)\n },\n /**\n * Call this.activate() or this.deactivate()\n * depending on this.isOpen value.\n *\n * @fires this#activate || this#deactivate\n * @property {Boolean} isOpen indicates if dropdown is open\n */\n toggle () {\n this.isOpen\n ? this.deactivate()\n : this.activate()\n },\n /**\n * Updates the hasEnoughSpace variable used for\n * detecting where to expand the dropdown\n */\n adjustPosition () {\n if (typeof window === 'undefined') return\n\n const spaceAbove = this.$el.getBoundingClientRect().top\n const spaceBelow = window.innerHeight - this.$el.getBoundingClientRect().bottom\n const hasEnoughSpaceBelow = spaceBelow > this.maxHeight\n\n if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || this.openDirection === 'below' || this.openDirection === 'bottom') {\n this.preferredOpenDirection = 'below'\n this.optimizedHeight = Math.min(spaceBelow - 40, this.maxHeight)\n } else {\n this.preferredOpenDirection = 'above'\n this.optimizedHeight = Math.min(spaceAbove - 40, this.maxHeight)\n }\n }\n }\n}\n","export default {\n data () {\n return {\n pointer: 0,\n pointerDirty: false\n }\n },\n props: {\n /**\n * Enable/disable highlighting of the pointed value.\n * @type {Boolean}\n * @default true\n */\n showPointer: {\n type: Boolean,\n default: true\n },\n optionHeight: {\n type: Number,\n default: 40\n }\n },\n computed: {\n pointerPosition () {\n return this.pointer * this.optionHeight\n },\n visibleElements () {\n return this.optimizedHeight / this.optionHeight\n }\n },\n watch: {\n filteredOptions () {\n this.pointerAdjust()\n },\n isOpen () {\n this.pointerDirty = false\n },\n pointer () {\n this.$refs.search && this.$refs.search.setAttribute('aria-activedescendant', this.id + '-' + this.pointer.toString())\n }\n },\n methods: {\n optionHighlight (index, option) {\n return {\n 'multiselect__option--highlight': index === this.pointer && this.showPointer,\n 'multiselect__option--selected': this.isSelected(option)\n }\n },\n groupHighlight (index, selectedGroup) {\n if (!this.groupSelect) {\n return [\n 'multiselect__option--disabled',\n {'multiselect__option--group': selectedGroup.$isLabel}\n ]\n }\n\n const group = this.options.find((option) => {\n return option[this.groupLabel] === selectedGroup.$groupLabel\n })\n\n return group && !this.wholeGroupDisabled(group) ? [\n 'multiselect__option--group',\n {'multiselect__option--highlight': index === this.pointer && this.showPointer},\n {'multiselect__option--group-selected': this.wholeGroupSelected(group)}\n ] : 'multiselect__option--disabled'\n },\n addPointerElement ({key} = 'Enter') {\n /* istanbul ignore else */\n if (this.filteredOptions.length > 0) {\n this.select(this.filteredOptions[this.pointer], key)\n }\n this.pointerReset()\n },\n pointerForward () {\n /* istanbul ignore else */\n if (this.pointer < this.filteredOptions.length - 1) {\n this.pointer++\n /* istanbul ignore next */\n if (this.$refs.list.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight) {\n this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight\n }\n /* istanbul ignore else */\n if (\n this.filteredOptions[this.pointer] &&\n this.filteredOptions[this.pointer].$isLabel &&\n !this.groupSelect\n ) this.pointerForward()\n }\n this.pointerDirty = true\n },\n pointerBackward () {\n if (this.pointer > 0) {\n this.pointer--\n /* istanbul ignore else */\n if (this.$refs.list.scrollTop >= this.pointerPosition) {\n this.$refs.list.scrollTop = this.pointerPosition\n }\n /* istanbul ignore else */\n if (\n this.filteredOptions[this.pointer] &&\n this.filteredOptions[this.pointer].$isLabel &&\n !this.groupSelect\n ) this.pointerBackward()\n } else {\n /* istanbul ignore else */\n if (\n this.filteredOptions[this.pointer] &&\n this.filteredOptions[0].$isLabel &&\n !this.groupSelect\n ) this.pointerForward()\n }\n this.pointerDirty = true\n },\n pointerReset () {\n /* istanbul ignore else */\n if (!this.closeOnSelect) return\n this.pointer = 0\n /* istanbul ignore else */\n if (this.$refs.list) {\n this.$refs.list.scrollTop = 0\n }\n },\n pointerAdjust () {\n /* istanbul ignore else */\n if (this.pointer >= this.filteredOptions.length - 1) {\n this.pointer = this.filteredOptions.length\n ? this.filteredOptions.length - 1\n : 0\n }\n\n if (this.filteredOptions.length > 0 &&\n this.filteredOptions[this.pointer].$isLabel &&\n !this.groupSelect\n ) {\n this.pointerForward()\n }\n },\n pointerSet (index) {\n this.pointer = index\n this.pointerDirty = true\n }\n }\n}\n","export { default } from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Multiselect.vue?vue&type=script&lang=js\"; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Multiselect.vue?vue&type=script&lang=js\"","import { render } from \"./Multiselect.vue?vue&type=template&id=b01f7952\"\nimport script from \"./Multiselect.vue?vue&type=script&lang=js\"\nexport * from \"./Multiselect.vue?vue&type=script&lang=js\"\n\nimport \"./Multiselect.vue?vue&type=style&index=0&id=b01f7952&lang=css\"\n\nimport exportComponent from \"/home/matt/git/vue-multiselect/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import Multiselect from './Multiselect.vue'\nimport multiselectMixin from './multiselectMixin.js'\nimport pointerMixin from './pointerMixin.js'\n\nexport default Multiselect\n\nexport {Multiselect, multiselectMixin, pointerMixin}\n","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n","'use strict';\nvar $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\n\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.es/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n /* global Symbol -- safe */\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/vue3-multiselect.css b/dist/vue3-multiselect.css new file mode 100644 index 00000000..b7988418 --- /dev/null +++ b/dist/vue3-multiselect.css @@ -0,0 +1 @@ +fieldset[disabled] .multiselect{pointer-events:none}.multiselect__spinner{position:absolute;right:1px;top:1px;width:40px;height:38px;background:#fff;display:block}.multiselect__spinner:after,.multiselect__spinner:before{position:absolute;content:"";top:50%;left:50%;margin:-8px 0 0 -8px;width:16px;height:16px;border-radius:100%;border-color:#41b883 transparent transparent;border-style:solid;border-width:2px;box-shadow:0 0 0 1px transparent}.multiselect__spinner:before{-webkit-animation:spinning 2.4s cubic-bezier(.41,.26,.2,.62);animation:spinning 2.4s cubic-bezier(.41,.26,.2,.62);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.multiselect__spinner:after{-webkit-animation:spinning 2.4s cubic-bezier(.51,.09,.21,.8);animation:spinning 2.4s cubic-bezier(.51,.09,.21,.8);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.multiselect__loading-enter-active,.multiselect__loading-leave-active{transition:opacity .4s ease-in-out;opacity:1}.multiselect__loading-enter,.multiselect__loading-leave-active{opacity:0}.multiselect,.multiselect__input,.multiselect__single{font-family:inherit;font-size:16px;touch-action:manipulation}.multiselect{box-sizing:content-box;display:block;position:relative;width:100%;min-height:40px;text-align:left;color:#35495e}.multiselect *{box-sizing:border-box}.multiselect:focus{outline:none}.multiselect--disabled{background:#ededed;pointer-events:none;opacity:.6}.multiselect--active{z-index:50}.multiselect--active:not(.multiselect--above) .multiselect__current,.multiselect--active:not(.multiselect--above) .multiselect__input,.multiselect--active:not(.multiselect--above) .multiselect__tags{border-bottom-left-radius:0;border-bottom-right-radius:0}.multiselect--active .multiselect__select{transform:rotate(180deg)}.multiselect--above.multiselect--active .multiselect__current,.multiselect--above.multiselect--active .multiselect__input,.multiselect--above.multiselect--active .multiselect__tags{border-top-left-radius:0;border-top-right-radius:0}.multiselect__input,.multiselect__single{position:relative;display:inline-block;min-height:20px;line-height:20px;border:none;border-radius:5px;background:#fff;padding:0 0 0 5px;width:100%;transition:border .1s ease;box-sizing:border-box;margin-bottom:8px;vertical-align:top}.multiselect__input::-moz-placeholder{color:#35495e}.multiselect__input:-ms-input-placeholder{color:#35495e}.multiselect__input::placeholder{color:#35495e}.multiselect__tag~.multiselect__input,.multiselect__tag~.multiselect__single{width:auto}.multiselect__input:hover,.multiselect__single:hover{border-color:#cfcfcf}.multiselect__input:focus,.multiselect__single:focus{border-color:#a8a8a8;outline:none}.multiselect__single{padding-left:5px;margin-bottom:8px}.multiselect__tags-wrap{display:inline}.multiselect__tags{min-height:40px;display:block;padding:8px 40px 0 8px;border-radius:5px;border:1px solid #e8e8e8;background:#fff;font-size:14px}.multiselect__tag{position:relative;display:inline-block;padding:4px 26px 4px 10px;border-radius:5px;margin-right:10px;color:#fff;line-height:1;background:#41b883;margin-bottom:5px;white-space:nowrap;overflow:hidden;max-width:100%;text-overflow:ellipsis}.multiselect__tag-icon{cursor:pointer;margin-left:7px;position:absolute;right:0;top:0;bottom:0;font-weight:700;font-style:normal;width:22px;text-align:center;line-height:22px;transition:all .2s ease;border-radius:5px}.multiselect__tag-icon:after{content:"×";color:#266d4d;font-size:14px}.multiselect__tag-icon:focus:after,.multiselect__tag-icon:hover:after{color:#fff}.multiselect__current{min-height:40px;overflow:hidden;padding:8px 12px 0;padding-right:30px;white-space:nowrap;border-radius:5px;border:1px solid #e8e8e8}.multiselect__current,.multiselect__select{line-height:16px;box-sizing:border-box;display:block;margin:0;text-decoration:none;cursor:pointer}.multiselect__select{position:absolute;width:40px;height:38px;right:1px;top:1px;padding:4px 8px;text-align:center;transition:transform .2s ease}.multiselect__select:before{position:relative;right:0;top:65%;color:#999;margin-top:4px;border-style:solid;border-width:5px 5px 0 5px;border-color:#999 transparent transparent transparent;content:""}.multiselect__placeholder{color:#adadad;display:inline-block;margin-bottom:10px;padding-top:2px}.multiselect--active .multiselect__placeholder{display:none}.multiselect__content-wrapper{position:absolute;display:block;background:#fff;width:100%;max-height:240px;overflow:auto;border:1px solid #e8e8e8;border-top:none;border-bottom-left-radius:5px;border-bottom-right-radius:5px;z-index:50;-webkit-overflow-scrolling:touch}.multiselect__content{list-style:none;display:inline-block;padding:0;margin:0;min-width:100%;vertical-align:top}.multiselect--above .multiselect__content-wrapper{bottom:100%;border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom:none;border-top:1px solid #e8e8e8}.multiselect__content::-webkit-scrollbar{display:none}.multiselect__element{display:block}.multiselect__option{display:block;padding:12px;min-height:40px;line-height:16px;text-decoration:none;text-transform:none;vertical-align:middle;position:relative;cursor:pointer;white-space:nowrap}.multiselect__option:after{top:0;right:0;position:absolute;line-height:40px;padding-right:12px;padding-left:20px;font-size:13px}.multiselect__option--highlight{background:#41b883;outline:none;color:#fff}.multiselect__option--highlight:after{content:attr(data-select);background:#41b883;color:#fff}.multiselect__option--selected{background:#f3f3f3;color:#35495e;font-weight:700}.multiselect__option--selected:after{content:attr(data-selected);color:silver;background:inherit}.multiselect__option--selected.multiselect__option--highlight{background:#ff6a6a;color:#fff}.multiselect__option--selected.multiselect__option--highlight:after{background:#ff6a6a;content:attr(data-deselect);color:#fff}.multiselect--disabled .multiselect__current,.multiselect--disabled .multiselect__select{background:#ededed;color:#a6a6a6}.multiselect__option--disabled{background:#ededed!important;color:#a6a6a6!important;cursor:text;pointer-events:none}.multiselect__option--group{background:#ededed;color:#35495e}.multiselect__option--group.multiselect__option--highlight{background:#35495e;color:#fff}.multiselect__option--group.multiselect__option--highlight:after{background:#35495e}.multiselect__option--disabled.multiselect__option--highlight{background:#dedede}.multiselect__option--group-selected.multiselect__option--highlight{background:#ff6a6a;color:#fff}.multiselect__option--group-selected.multiselect__option--highlight:after{background:#ff6a6a;content:attr(data-deselect);color:#fff}.multiselect-enter-active,.multiselect-leave-active{transition:all .15s ease}.multiselect-enter,.multiselect-leave-active{opacity:0}.multiselect__strong{margin-bottom:8px;line-height:20px;display:inline-block;vertical-align:top}[dir=rtl] .multiselect{text-align:right}[dir=rtl] .multiselect__select{right:auto;left:1px}[dir=rtl] .multiselect__tags{padding:8px 8px 0 40px}[dir=rtl] .multiselect__content{text-align:right}[dir=rtl] .multiselect__option:after{right:auto;left:0}[dir=rtl] .multiselect__clear{right:auto;left:12px}[dir=rtl] .multiselect__spinner{right:auto;left:1px}@-webkit-keyframes spinning{0%{transform:rotate(0)}to{transform:rotate(2turn)}}@keyframes spinning{0%{transform:rotate(0)}to{transform:rotate(2turn)}} \ No newline at end of file diff --git a/dist/vue3-multiselect.umd.js b/dist/vue3-multiselect.umd.js new file mode 100644 index 00000000..d1356a19 --- /dev/null +++ b/dist/vue3-multiselect.umd.js @@ -0,0 +1,4464 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("vue")); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["vue3-multiselect"] = factory(require("vue")); + else + root["vue3-multiselect"] = factory(root["Vue"]); +})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__8bbf__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "fb15"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "00ee": +/***/ (function(module, exports, __webpack_require__) { + +var wellKnownSymbol = __webpack_require__("b622"); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var test = {}; + +test[TO_STRING_TAG] = 'z'; + +module.exports = String(test) === '[object z]'; + + +/***/ }), + +/***/ "0366": +/***/ (function(module, exports, __webpack_require__) { + +var aFunction = __webpack_require__("1c0b"); + +// optional / simple context binding +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 0: return function () { + return fn.call(that); + }; + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + + +/***/ }), + +/***/ "06cf": +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__("83ab"); +var propertyIsEnumerableModule = __webpack_require__("d1e7"); +var createPropertyDescriptor = __webpack_require__("5c6c"); +var toIndexedObject = __webpack_require__("fc6a"); +var toPrimitive = __webpack_require__("c04e"); +var has = __webpack_require__("5135"); +var IE8_DOM_DEFINE = __webpack_require__("0cfb"); + +var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// `Object.getOwnPropertyDescriptor` method +// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor +exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { + O = toIndexedObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return nativeGetOwnPropertyDescriptor(O, P); + } catch (error) { /* empty */ } + if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); +}; + + +/***/ }), + +/***/ "0cfb": +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__("83ab"); +var fails = __webpack_require__("d039"); +var createElement = __webpack_require__("cc12"); + +// Thank's IE8 for his funny defineProperty +module.exports = !DESCRIPTORS && !fails(function () { + return Object.defineProperty(createElement('div'), 'a', { + get: function () { return 7; } + }).a != 7; +}); + + +/***/ }), + +/***/ "0d03": +/***/ (function(module, exports, __webpack_require__) { + +var redefine = __webpack_require__("6eeb"); + +var DatePrototype = Date.prototype; +var INVALID_DATE = 'Invalid Date'; +var TO_STRING = 'toString'; +var nativeDateToString = DatePrototype[TO_STRING]; +var getTime = DatePrototype.getTime; + +// `Date.prototype.toString` method +// https://tc39.es/ecma262/#sec-date.prototype.tostring +if (new Date(NaN) + '' != INVALID_DATE) { + redefine(DatePrototype, TO_STRING, function toString() { + var value = getTime.call(this); + // eslint-disable-next-line no-self-compare -- NaN check + return value === value ? nativeDateToString.call(this) : INVALID_DATE; + }); +} + + +/***/ }), + +/***/ "129f": +/***/ (function(module, exports) { + +// `SameValue` abstract operation +// https://tc39.es/ecma262/#sec-samevalue +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare -- NaN check + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; + + +/***/ }), + +/***/ "13d5": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__("23e7"); +var $reduce = __webpack_require__("d58f").left; +var arrayMethodIsStrict = __webpack_require__("a640"); +var CHROME_VERSION = __webpack_require__("2d00"); +var IS_NODE = __webpack_require__("605d"); + +var STRICT_METHOD = arrayMethodIsStrict('reduce'); +// Chrome 80-82 has a critical bug +// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 +var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83; + +// `Array.prototype.reduce` method +// https://tc39.es/ecma262/#sec-array.prototype.reduce +$({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, { + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "14c3": +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__("c6b6"); +var regexpExec = __webpack_require__("9263"); + +// `RegExpExec` abstract operation +// https://tc39.es/ecma262/#sec-regexpexec +module.exports = function (R, S) { + var exec = R.exec; + if (typeof exec === 'function') { + var result = exec.call(R, S); + if (typeof result !== 'object') { + throw TypeError('RegExp exec method returned something other than an Object or null'); + } + return result; + } + + if (classof(R) !== 'RegExp') { + throw TypeError('RegExp#exec called on incompatible receiver'); + } + + return regexpExec.call(R, S); +}; + + + +/***/ }), + +/***/ "1be4": +/***/ (function(module, exports, __webpack_require__) { + +var getBuiltIn = __webpack_require__("d066"); + +module.exports = getBuiltIn('document', 'documentElement'); + + +/***/ }), + +/***/ "1c0b": +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') { + throw TypeError(String(it) + ' is not a function'); + } return it; +}; + + +/***/ }), + +/***/ "1d80": +/***/ (function(module, exports) { + +// `RequireObjectCoercible` abstract operation +// https://tc39.es/ecma262/#sec-requireobjectcoercible +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), + +/***/ "1dde": +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__("d039"); +var wellKnownSymbol = __webpack_require__("b622"); +var V8_VERSION = __webpack_require__("2d00"); + +var SPECIES = wellKnownSymbol('species'); + +module.exports = function (METHOD_NAME) { + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/677 + return V8_VERSION >= 51 || !fails(function () { + var array = []; + var constructor = array.constructor = {}; + constructor[SPECIES] = function () { + return { foo: 1 }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }); +}; + + +/***/ }), + +/***/ "23cb": +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__("a691"); + +var max = Math.max; +var min = Math.min; + +// Helper for a popular repeating case of the spec: +// Let integer be ? ToInteger(index). +// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). +module.exports = function (index, length) { + var integer = toInteger(index); + return integer < 0 ? max(integer + length, 0) : min(integer, length); +}; + + +/***/ }), + +/***/ "23e7": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("da84"); +var getOwnPropertyDescriptor = __webpack_require__("06cf").f; +var createNonEnumerableProperty = __webpack_require__("9112"); +var redefine = __webpack_require__("6eeb"); +var setGlobal = __webpack_require__("ce4e"); +var copyConstructorProperties = __webpack_require__("e893"); +var isForced = __webpack_require__("94ca"); + +/* + options.target - name of the target object + options.global - target is the global object + options.stat - export as static methods of target + options.proto - export as prototype methods of target + options.real - real prototype method for the `pure` version + options.forced - export even if the native feature is available + options.bind - bind methods to the target, required for the `pure` version + options.wrap - wrap constructors to preventing global pollution, required for the `pure` version + options.unsafe - use the simple assignment of property instead of delete + defineProperty + options.sham - add a flag to not completely full polyfills + options.enumerable - export as enumerable property + options.noTargetGet - prevent calling a getter on target +*/ +module.exports = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var FORCED, target, key, targetProperty, sourceProperty, descriptor; + if (GLOBAL) { + target = global; + } else if (STATIC) { + target = global[TARGET] || setGlobal(TARGET, {}); + } else { + target = (global[TARGET] || {}).prototype; + } + if (target) for (key in source) { + sourceProperty = source[key]; + if (options.noTargetGet) { + descriptor = getOwnPropertyDescriptor(target, key); + targetProperty = descriptor && descriptor.value; + } else targetProperty = target[key]; + FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); + // contained in target + if (!FORCED && targetProperty !== undefined) { + if (typeof sourceProperty === typeof targetProperty) continue; + copyConstructorProperties(sourceProperty, targetProperty); + } + // add a flag to not completely full polyfills + if (options.sham || (targetProperty && targetProperty.sham)) { + createNonEnumerableProperty(sourceProperty, 'sham', true); + } + // extend global + redefine(target, key, sourceProperty, options); + } +}; + + +/***/ }), + +/***/ "241c": +/***/ (function(module, exports, __webpack_require__) { + +var internalObjectKeys = __webpack_require__("ca84"); +var enumBugKeys = __webpack_require__("7839"); + +var hiddenKeys = enumBugKeys.concat('length', 'prototype'); + +// `Object.getOwnPropertyNames` method +// https://tc39.es/ecma262/#sec-object.getownpropertynames +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return internalObjectKeys(O, hiddenKeys); +}; + + +/***/ }), + +/***/ "25f0": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var redefine = __webpack_require__("6eeb"); +var anObject = __webpack_require__("825a"); +var fails = __webpack_require__("d039"); +var flags = __webpack_require__("ad6d"); + +var TO_STRING = 'toString'; +var RegExpPrototype = RegExp.prototype; +var nativeToString = RegExpPrototype[TO_STRING]; + +var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); +// FF44- RegExp#toString has a wrong name +var INCORRECT_NAME = nativeToString.name != TO_STRING; + +// `RegExp.prototype.toString` method +// https://tc39.es/ecma262/#sec-regexp.prototype.tostring +if (NOT_GENERIC || INCORRECT_NAME) { + redefine(RegExp.prototype, TO_STRING, function toString() { + var R = anObject(this); + var p = String(R.source); + var rf = R.flags; + var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); + return '/' + p + '/' + f; + }, { unsafe: true }); +} + + +/***/ }), + +/***/ "277d": +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__("23e7"); +var isArray = __webpack_require__("e8b5"); + +// `Array.isArray` method +// https://tc39.es/ecma262/#sec-array.isarray +$({ target: 'Array', stat: true }, { + isArray: isArray +}); + + +/***/ }), + +/***/ "2d00": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("da84"); +var userAgent = __webpack_require__("342f"); + +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8; +var match, version; + +if (v8) { + match = v8.split('.'); + version = match[0] + match[1]; +} else if (userAgent) { + match = userAgent.match(/Edge\/(\d+)/); + if (!match || match[1] >= 74) { + match = userAgent.match(/Chrome\/(\d+)/); + if (match) version = match[1]; + } +} + +module.exports = version && +version; + + +/***/ }), + +/***/ "342f": +/***/ (function(module, exports, __webpack_require__) { + +var getBuiltIn = __webpack_require__("d066"); + +module.exports = getBuiltIn('navigator', 'userAgent') || ''; + + +/***/ }), + +/***/ "37e8": +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__("83ab"); +var definePropertyModule = __webpack_require__("9bf2"); +var anObject = __webpack_require__("825a"); +var objectKeys = __webpack_require__("df75"); + +// `Object.defineProperties` method +// https://tc39.es/ecma262/#sec-object.defineproperties +module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = objectKeys(Properties); + var length = keys.length; + var index = 0; + var key; + while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); + return O; +}; + + +/***/ }), + +/***/ "3bbe": +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__("861d"); + +module.exports = function (it) { + if (!isObject(it) && it !== null) { + throw TypeError("Can't set " + String(it) + ' as a prototype'); + } return it; +}; + + +/***/ }), + +/***/ "428f": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("da84"); + +module.exports = global; + + +/***/ }), + +/***/ "44ad": +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__("d039"); +var classof = __webpack_require__("c6b6"); + +var split = ''.split; + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +module.exports = fails(function () { + // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 + // eslint-disable-next-line no-prototype-builtins -- safe + return !Object('z').propertyIsEnumerable(0); +}) ? function (it) { + return classof(it) == 'String' ? split.call(it, '') : Object(it); +} : Object; + + +/***/ }), + +/***/ "44d2": +/***/ (function(module, exports, __webpack_require__) { + +var wellKnownSymbol = __webpack_require__("b622"); +var create = __webpack_require__("7c73"); +var definePropertyModule = __webpack_require__("9bf2"); + +var UNSCOPABLES = wellKnownSymbol('unscopables'); +var ArrayPrototype = Array.prototype; + +// Array.prototype[@@unscopables] +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +if (ArrayPrototype[UNSCOPABLES] == undefined) { + definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { + configurable: true, + value: create(null) + }); +} + +// add a key to Array.prototype[@@unscopables] +module.exports = function (key) { + ArrayPrototype[UNSCOPABLES][key] = true; +}; + + +/***/ }), + +/***/ "4930": +/***/ (function(module, exports, __webpack_require__) { + +var IS_NODE = __webpack_require__("605d"); +var V8_VERSION = __webpack_require__("2d00"); +var fails = __webpack_require__("d039"); + +module.exports = !!Object.getOwnPropertySymbols && !fails(function () { + /* global Symbol -- required for testing */ + return !Symbol.sham && + // Chrome 38 Symbol has incorrect toString conversion + // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances + (IS_NODE ? V8_VERSION === 38 : V8_VERSION > 37 && V8_VERSION < 41); +}); + + +/***/ }), + +/***/ "498a": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__("23e7"); +var $trim = __webpack_require__("58a8").trim; +var forcedStringTrimMethod = __webpack_require__("c8d2"); + +// `String.prototype.trim` method +// https://tc39.es/ecma262/#sec-string.prototype.trim +$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { + trim: function trim() { + return $trim(this); + } +}); + + +/***/ }), + +/***/ "4d64": +/***/ (function(module, exports, __webpack_require__) { + +var toIndexedObject = __webpack_require__("fc6a"); +var toLength = __webpack_require__("50c4"); +var toAbsoluteIndex = __webpack_require__("23cb"); + +// `Array.prototype.{ indexOf, includes }` methods implementation +var createMethod = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIndexedObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare -- NaN check + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare -- NaN check + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) { + if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + +module.exports = { + // `Array.prototype.includes` method + // https://tc39.es/ecma262/#sec-array.prototype.includes + includes: createMethod(true), + // `Array.prototype.indexOf` method + // https://tc39.es/ecma262/#sec-array.prototype.indexof + indexOf: createMethod(false) +}; + + +/***/ }), + +/***/ "4de4": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__("23e7"); +var $filter = __webpack_require__("b727").filter; +var arrayMethodHasSpeciesSupport = __webpack_require__("1dde"); + +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); + +// `Array.prototype.filter` method +// https://tc39.es/ecma262/#sec-array.prototype.filter +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "4e82": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__("23e7"); +var aFunction = __webpack_require__("1c0b"); +var toObject = __webpack_require__("7b0b"); +var fails = __webpack_require__("d039"); +var arrayMethodIsStrict = __webpack_require__("a640"); + +var test = []; +var nativeSort = test.sort; + +// IE8- +var FAILS_ON_UNDEFINED = fails(function () { + test.sort(undefined); +}); +// V8 bug +var FAILS_ON_NULL = fails(function () { + test.sort(null); +}); +// Old WebKit +var STRICT_METHOD = arrayMethodIsStrict('sort'); + +var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD; + +// `Array.prototype.sort` method +// https://tc39.es/ecma262/#sec-array.prototype.sort +$({ target: 'Array', proto: true, forced: FORCED }, { + sort: function sort(comparefn) { + return comparefn === undefined + ? nativeSort.call(toObject(this)) + : nativeSort.call(toObject(this), aFunction(comparefn)); + } +}); + + +/***/ }), + +/***/ "50c4": +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__("a691"); + +var min = Math.min; + +// `ToLength` abstract operation +// https://tc39.es/ecma262/#sec-tolength +module.exports = function (argument) { + return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 +}; + + +/***/ }), + +/***/ "5135": +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; + +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), + +/***/ "5692": +/***/ (function(module, exports, __webpack_require__) { + +var IS_PURE = __webpack_require__("c430"); +var store = __webpack_require__("c6cd"); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: '3.9.1', + mode: IS_PURE ? 'pure' : 'global', + copyright: '© 2021 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), + +/***/ "56ef": +/***/ (function(module, exports, __webpack_require__) { + +var getBuiltIn = __webpack_require__("d066"); +var getOwnPropertyNamesModule = __webpack_require__("241c"); +var getOwnPropertySymbolsModule = __webpack_require__("7418"); +var anObject = __webpack_require__("825a"); + +// all object keys, includes non-enumerable and symbols +module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { + var keys = getOwnPropertyNamesModule.f(anObject(it)); + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; +}; + + +/***/ }), + +/***/ "5899": +/***/ (function(module, exports) { + +// a string of all valid unicode whitespaces +module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + + +/***/ }), + +/***/ "58a8": +/***/ (function(module, exports, __webpack_require__) { + +var requireObjectCoercible = __webpack_require__("1d80"); +var whitespaces = __webpack_require__("5899"); + +var whitespace = '[' + whitespaces + ']'; +var ltrim = RegExp('^' + whitespace + whitespace + '*'); +var rtrim = RegExp(whitespace + whitespace + '*$'); + +// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation +var createMethod = function (TYPE) { + return function ($this) { + var string = String(requireObjectCoercible($this)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; + }; +}; + +module.exports = { + // `String.prototype.{ trimLeft, trimStart }` methods + // https://tc39.es/ecma262/#sec-string.prototype.trimstart + start: createMethod(1), + // `String.prototype.{ trimRight, trimEnd }` methods + // https://tc39.es/ecma262/#sec-string.prototype.trimend + end: createMethod(2), + // `String.prototype.trim` method + // https://tc39.es/ecma262/#sec-string.prototype.trim + trim: createMethod(3) +}; + + +/***/ }), + +/***/ "5c6c": +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), + +/***/ "605d": +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__("c6b6"); +var global = __webpack_require__("da84"); + +module.exports = classof(global.process) == 'process'; + + +/***/ }), + +/***/ "65f0": +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__("861d"); +var isArray = __webpack_require__("e8b5"); +var wellKnownSymbol = __webpack_require__("b622"); + +var SPECIES = wellKnownSymbol('species'); + +// `ArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray, length) { + var C; + if (isArray(originalArray)) { + C = originalArray.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + else if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); +}; + + +/***/ }), + +/***/ "69f3": +/***/ (function(module, exports, __webpack_require__) { + +var NATIVE_WEAK_MAP = __webpack_require__("7f9a"); +var global = __webpack_require__("da84"); +var isObject = __webpack_require__("861d"); +var createNonEnumerableProperty = __webpack_require__("9112"); +var objectHas = __webpack_require__("5135"); +var shared = __webpack_require__("c6cd"); +var sharedKey = __webpack_require__("f772"); +var hiddenKeys = __webpack_require__("d012"); + +var WeakMap = global.WeakMap; +var set, get, has; + +var enforce = function (it) { + return has(it) ? get(it) : set(it, {}); +}; + +var getterFor = function (TYPE) { + return function (it) { + var state; + if (!isObject(it) || (state = get(it)).type !== TYPE) { + throw TypeError('Incompatible receiver, ' + TYPE + ' required'); + } return state; + }; +}; + +if (NATIVE_WEAK_MAP) { + var store = shared.state || (shared.state = new WeakMap()); + var wmget = store.get; + var wmhas = store.has; + var wmset = store.set; + set = function (it, metadata) { + metadata.facade = it; + wmset.call(store, it, metadata); + return metadata; + }; + get = function (it) { + return wmget.call(store, it) || {}; + }; + has = function (it) { + return wmhas.call(store, it); + }; +} else { + var STATE = sharedKey('state'); + hiddenKeys[STATE] = true; + set = function (it, metadata) { + metadata.facade = it; + createNonEnumerableProperty(it, STATE, metadata); + return metadata; + }; + get = function (it) { + return objectHas(it, STATE) ? it[STATE] : {}; + }; + has = function (it) { + return objectHas(it, STATE); + }; +} + +module.exports = { + set: set, + get: get, + has: has, + enforce: enforce, + getterFor: getterFor +}; + + +/***/ }), + +/***/ "6eeb": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("da84"); +var createNonEnumerableProperty = __webpack_require__("9112"); +var has = __webpack_require__("5135"); +var setGlobal = __webpack_require__("ce4e"); +var inspectSource = __webpack_require__("8925"); +var InternalStateModule = __webpack_require__("69f3"); + +var getInternalState = InternalStateModule.get; +var enforceInternalState = InternalStateModule.enforce; +var TEMPLATE = String(String).split('String'); + +(module.exports = function (O, key, value, options) { + var unsafe = options ? !!options.unsafe : false; + var simple = options ? !!options.enumerable : false; + var noTargetGet = options ? !!options.noTargetGet : false; + var state; + if (typeof value == 'function') { + if (typeof key == 'string' && !has(value, 'name')) { + createNonEnumerableProperty(value, 'name', key); + } + state = enforceInternalState(value); + if (!state.source) { + state.source = TEMPLATE.join(typeof key == 'string' ? key : ''); + } + } + if (O === global) { + if (simple) O[key] = value; + else setGlobal(key, value); + return; + } else if (!unsafe) { + delete O[key]; + } else if (!noTargetGet && O[key]) { + simple = true; + } + if (simple) O[key] = value; + else createNonEnumerableProperty(O, key, value); +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, 'toString', function toString() { + return typeof this == 'function' && getInternalState(this).source || inspectSource(this); +}); + + +/***/ }), + +/***/ "7156": +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__("861d"); +var setPrototypeOf = __webpack_require__("d2bb"); + +// makes subclassing work correct for wrapped built-ins +module.exports = function ($this, dummy, Wrapper) { + var NewTarget, NewTargetPrototype; + if ( + // it can work only with native `setPrototypeOf` + setPrototypeOf && + // we haven't completely correct pre-ES6 way for getting `new.target`, so use this + typeof (NewTarget = dummy.constructor) == 'function' && + NewTarget !== Wrapper && + isObject(NewTargetPrototype = NewTarget.prototype) && + NewTargetPrototype !== Wrapper.prototype + ) setPrototypeOf($this, NewTargetPrototype); + return $this; +}; + + +/***/ }), + +/***/ "7418": +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), + +/***/ "7839": +/***/ (function(module, exports) { + +// IE8- don't enum bug keys +module.exports = [ + 'constructor', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'toLocaleString', + 'toString', + 'valueOf' +]; + + +/***/ }), + +/***/ "7b0b": +/***/ (function(module, exports, __webpack_require__) { + +var requireObjectCoercible = __webpack_require__("1d80"); + +// `ToObject` abstract operation +// https://tc39.es/ecma262/#sec-toobject +module.exports = function (argument) { + return Object(requireObjectCoercible(argument)); +}; + + +/***/ }), + +/***/ "7c73": +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__("825a"); +var defineProperties = __webpack_require__("37e8"); +var enumBugKeys = __webpack_require__("7839"); +var hiddenKeys = __webpack_require__("d012"); +var html = __webpack_require__("1be4"); +var documentCreateElement = __webpack_require__("cc12"); +var sharedKey = __webpack_require__("f772"); + +var GT = '>'; +var LT = '<'; +var PROTOTYPE = 'prototype'; +var SCRIPT = 'script'; +var IE_PROTO = sharedKey('IE_PROTO'); + +var EmptyConstructor = function () { /* empty */ }; + +var scriptTag = function (content) { + return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; +}; + +// Create object with fake `null` prototype: use ActiveX Object with cleared prototype +var NullProtoObjectViaActiveX = function (activeXDocument) { + activeXDocument.write(scriptTag('')); + activeXDocument.close(); + var temp = activeXDocument.parentWindow.Object; + activeXDocument = null; // avoid memory leak + return temp; +}; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var NullProtoObjectViaIFrame = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = documentCreateElement('iframe'); + var JS = 'java' + SCRIPT + ':'; + var iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + // https://github.com/zloirock/core-js/issues/475 + iframe.src = String(JS); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(scriptTag('document.F=Object')); + iframeDocument.close(); + return iframeDocument.F; +}; + +// Check for document.domain and active x support +// No need to use active x approach when document.domain is not set +// see https://github.com/es-shims/es5-shim/issues/150 +// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 +// avoid IE GC bug +var activeXDocument; +var NullProtoObject = function () { + try { + /* global ActiveXObject -- old IE */ + activeXDocument = document.domain && new ActiveXObject('htmlfile'); + } catch (error) { /* ignore */ } + NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); + var length = enumBugKeys.length; + while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; + return NullProtoObject(); +}; + +hiddenKeys[IE_PROTO] = true; + +// `Object.create` method +// https://tc39.es/ecma262/#sec-object.create +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + EmptyConstructor[PROTOTYPE] = anObject(O); + result = new EmptyConstructor(); + EmptyConstructor[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = NullProtoObject(); + return Properties === undefined ? result : defineProperties(result, Properties); +}; + + +/***/ }), + +/***/ "7db0": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__("23e7"); +var $find = __webpack_require__("b727").find; +var addToUnscopables = __webpack_require__("44d2"); + +var FIND = 'find'; +var SKIPS_HOLES = true; + +// Shouldn't skip holes +if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); + +// `Array.prototype.find` method +// https://tc39.es/ecma262/#sec-array.prototype.find +$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables(FIND); + + +/***/ }), + +/***/ "7f9a": +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__("da84"); +var inspectSource = __webpack_require__("8925"); + +var WeakMap = global.WeakMap; + +module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); + + +/***/ }), + +/***/ "825a": +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__("861d"); + +module.exports = function (it) { + if (!isObject(it)) { + throw TypeError(String(it) + ' is not an object'); + } return it; +}; + + +/***/ }), + +/***/ "83ab": +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__("d039"); + +// Detect IE8's incomplete defineProperty implementation +module.exports = !fails(function () { + return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; +}); + + +/***/ }), + +/***/ "8418": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toPrimitive = __webpack_require__("c04e"); +var definePropertyModule = __webpack_require__("9bf2"); +var createPropertyDescriptor = __webpack_require__("5c6c"); + +module.exports = function (object, key, value) { + var propertyKey = toPrimitive(key); + if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); + else object[propertyKey] = value; +}; + + +/***/ }), + +/***/ "841c": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784"); +var anObject = __webpack_require__("825a"); +var requireObjectCoercible = __webpack_require__("1d80"); +var sameValue = __webpack_require__("129f"); +var regExpExec = __webpack_require__("14c3"); + +// @@search logic +fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) { + return [ + // `String.prototype.search` method + // https://tc39.es/ecma262/#sec-string.prototype.search + function search(regexp) { + var O = requireObjectCoercible(this); + var searcher = regexp == undefined ? undefined : regexp[SEARCH]; + return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, + // `RegExp.prototype[@@search]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@search + function (regexp) { + var res = maybeCallNative(nativeSearch, regexp, this); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; + var result = regExpExec(rx, S); + if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; + return result === null ? -1 : result.index; + } + ]; +}); + + +/***/ }), + +/***/ "861d": +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), + +/***/ "8875": +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller +// MIT license +// source: https://github.com/amiller-gh/currentScript-polyfill + +// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505 + +(function (root, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}(typeof self !== 'undefined' ? self : this, function () { + function getCurrentScript () { + var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript') + // for chrome + if (!descriptor && 'currentScript' in document && document.currentScript) { + return document.currentScript + } + + // for other browsers with native support for currentScript + if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) { + return document.currentScript + } + + // IE 8-10 support script readyState + // IE 11+ & Firefox support stack trace + try { + throw new Error(); + } + catch (err) { + // Find the second match for the "at" string to get file src url from stack. + var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig, + ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig, + stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack), + scriptLocation = (stackDetails && stackDetails[1]) || false, + line = (stackDetails && stackDetails[2]) || false, + currentLocation = document.location.href.replace(document.location.hash, ''), + pageSource, + inlineScriptSourceRegExp, + inlineScriptSource, + scripts = document.getElementsByTagName('script'); // Live NodeList collection + + if (scriptLocation === currentLocation) { + pageSource = document.documentElement.outerHTML; + inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*\n\n\n","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","function isEmpty (opt) {\n if (opt === 0) return false\n if (Array.isArray(opt) && opt.length === 0) return true\n return !opt\n}\n\nfunction not (fun) {\n return (...params) => !fun(...params)\n}\n\nfunction includes (str, query) {\n /* istanbul ignore else */\n if (str === undefined) str = 'undefined'\n if (str === null) str = 'null'\n if (str === false) str = 'false'\n const text = str.toString().toLowerCase()\n return text.indexOf(query.trim()) !== -1\n}\n\nfunction filterOptions (options, search, label, customLabel) {\n return search ? options\n .filter((option) => includes(customLabel(option, label), search))\n .sort((a, b) => customLabel(a, label).length - customLabel(b, label).length) : options\n}\n\nfunction stripGroups (options) {\n return options.filter((option) => !option.$isLabel)\n}\n\nfunction flattenOptions (values, label) {\n return (options) =>\n options.reduce((prev, curr) => {\n /* istanbul ignore else */\n if (curr[values] && curr[values].length) {\n prev.push({\n $groupLabel: curr[label],\n $isLabel: true\n })\n return prev.concat(curr[values])\n }\n return prev\n }, [])\n}\n\nfunction filterGroups (search, label, values, groupLabel, customLabel) {\n return (groups) =>\n groups.map((group) => {\n /* istanbul ignore else */\n if (!group[values]) {\n console.warn(`Options passed to vue-multiselect do not contain groups, despite the config.`)\n return []\n }\n const groupOptions = filterOptions(group[values], search, label, customLabel)\n\n return groupOptions.length\n ? {\n [groupLabel]: group[groupLabel],\n [values]: groupOptions\n }\n : []\n })\n}\n\nconst flow = (...fns) => (x) => fns.reduce((v, f) => f(v), x)\n\nexport default {\n data () {\n return {\n search: '',\n isOpen: false,\n preferredOpenDirection: 'below',\n optimizedHeight: this.maxHeight\n }\n },\n props: {\n /**\n * Decide whether to filter the results based on search query.\n * Useful for async filtering, where we search through more complex data.\n * @type {Boolean}\n */\n internalSearch: {\n type: Boolean,\n default: true\n },\n /**\n * Array of available options: Objects, Strings or Integers.\n * If array of objects, visible label will default to option.label.\n * If `labal` prop is passed, label will equal option['label']\n * @type {Array}\n */\n options: {\n type: Array,\n required: true\n },\n /**\n * Equivalent to the `multiple` attribute on a `` input.\n * @default 'Select option'\n * @type {String}\n */\n placeholder: {\n type: String,\n default: 'Select option'\n },\n /**\n * Allow to remove all selected values\n * @default true\n * @type {Boolean}\n */\n allowEmpty: {\n type: Boolean,\n default: true\n },\n /**\n * Reset this.internalValue, this.search after this.internalValue changes.\n * Useful if want to create a stateless dropdown.\n * @default false\n * @type {Boolean}\n */\n resetAfter: {\n type: Boolean,\n default: false\n },\n /**\n * Enable/disable closing after selecting an option\n * @default true\n * @type {Boolean}\n */\n closeOnSelect: {\n type: Boolean,\n default: true\n },\n /**\n * Function to interpolate the custom label\n * @default false\n * @type {Function}\n */\n customLabel: {\n type: Function,\n default (option, label) {\n if (isEmpty(option)) return ''\n return label ? option[label] : option\n }\n },\n /**\n * Disable / Enable tagging\n * @default false\n * @type {Boolean}\n */\n taggable: {\n type: Boolean,\n default: false\n },\n /**\n * String to show when highlighting a potential tag\n * @default 'Press enter to create a tag'\n * @type {String}\n */\n tagPlaceholder: {\n type: String,\n default: 'Press enter to create a tag'\n },\n /**\n * By default new tags will appear above the search results.\n * Changing to 'bottom' will revert this behaviour\n * and will proritize the search results\n * @default 'top'\n * @type {String}\n */\n tagPosition: {\n type: String,\n default: 'top'\n },\n /**\n * Number of allowed selected options. No limit if 0.\n * @default 0\n * @type {Number}\n */\n max: {\n type: [Number, Boolean],\n default: false\n },\n /**\n * Will be passed with all events as second param.\n * Useful for identifying events origin.\n * @default null\n * @type {String|Integer}\n */\n id: {\n default: null\n },\n /**\n * Limits the options displayed in the dropdown\n * to the first X options.\n * @default 1000\n * @type {Integer}\n */\n optionsLimit: {\n type: Number,\n default: 1000\n },\n /**\n * Name of the property containing\n * the group values\n * @default 1000\n * @type {String}\n */\n groupValues: {\n type: String\n },\n /**\n * Name of the property containing\n * the group label\n * @default 1000\n * @type {String}\n */\n groupLabel: {\n type: String\n },\n /**\n * Allow to select all group values\n * by selecting the group label\n * @default false\n * @type {Boolean}\n */\n groupSelect: {\n type: Boolean,\n default: false\n },\n /**\n * Array of keyboard keys to block\n * when selecting\n * @default 1000\n * @type {String}\n */\n blockKeys: {\n type: Array,\n default () {\n return []\n }\n },\n /**\n * Prevent from wiping up the search value\n * @default false\n * @type {Boolean}\n */\n preserveSearch: {\n type: Boolean,\n default: false\n },\n /**\n * Select 1st options if value is empty\n * @default false\n * @type {Boolean}\n */\n preselectFirst: {\n type: Boolean,\n default: false\n },\n /**\n * Prevent autofocus\n * @default false\n * @type {Boolean}\n */\n preventAutofocus: {\n type: Boolean,\n default: false\n }\n },\n mounted () {\n /* istanbul ignore else */\n if (!this.multiple && this.max) {\n console.warn('[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false.')\n }\n if (\n this.preselectFirst &&\n !this.internalValue.length &&\n this.options.length\n ) {\n this.select(this.filteredOptions[0])\n }\n },\n computed: {\n internalValue () {\n return this.modelValue || this.modelValue === 0\n ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue]\n : []\n },\n filteredOptions () {\n const search = this.search || ''\n const normalizedSearch = search.toLowerCase().trim()\n\n let options = this.options.concat()\n\n /* istanbul ignore else */\n if (this.internalSearch) {\n options = this.groupValues\n ? this.filterAndFlat(options, normalizedSearch, this.label)\n : filterOptions(options, normalizedSearch, this.label, this.customLabel)\n } else {\n options = this.groupValues ? flattenOptions(this.groupValues, this.groupLabel)(options) : options\n }\n\n options = this.hideSelected\n ? options.filter(not(this.isSelected))\n : options\n\n /* istanbul ignore else */\n if (this.taggable && normalizedSearch.length && !this.isExistingOption(normalizedSearch)) {\n if (this.tagPosition === 'bottom') {\n options.push({isTag: true, label: search})\n } else {\n options.unshift({isTag: true, label: search})\n }\n }\n\n return options.slice(0, this.optionsLimit)\n },\n valueKeys () {\n if (this.trackBy) {\n return this.internalValue.map((element) => element[this.trackBy])\n } else {\n return this.internalValue\n }\n },\n optionKeys () {\n const options = this.groupValues ? this.flatAndStrip(this.options) : this.options\n return options.map((element) => this.customLabel(element, this.label).toString().toLowerCase())\n },\n currentOptionLabel () {\n return this.multiple\n ? this.searchable ? '' : this.placeholder\n : this.internalValue.length\n ? this.getOptionLabel(this.internalValue[0])\n : this.searchable ? '' : this.placeholder\n }\n },\n watch: {\n internalValue () {\n /* istanbul ignore else */\n if (this.resetAfter && this.internalValue.length) {\n this.search = ''\n this.$emit('update:modelValue', this.multiple ? [] : null)\n }\n },\n search () {\n this.$emit('search-change', this.search)\n }\n },\n emits: ['open', 'search-change', 'close', 'select', 'update:modelValue', 'remove', 'tag'],\n methods: {\n /**\n * Returns the internalValue in a way it can be emited to the parent\n * @returns {Object||Array||String||Integer}\n */\n getValue () {\n return this.multiple\n ? this.internalValue\n : this.internalValue.length === 0\n ? null\n : this.internalValue[0]\n },\n /**\n * Filters and then flattens the options list\n * @param {Array}\n * @return {Array} returns a filtered and flat options list\n */\n filterAndFlat (options, search, label) {\n return flow(\n filterGroups(search, label, this.groupValues, this.groupLabel, this.customLabel),\n flattenOptions(this.groupValues, this.groupLabel)\n )(options)\n },\n /**\n * Flattens and then strips the group labels from the options list\n * @param {Array}\n * @return {Array} returns a flat options list without group labels\n */\n flatAndStrip (options) {\n return flow(\n flattenOptions(this.groupValues, this.groupLabel),\n stripGroups\n )(options)\n },\n /**\n * Updates the search value\n * @param {String}\n */\n updateSearch (query) {\n this.search = query\n },\n /**\n * Finds out if the given query is already present\n * in the available options\n * @param {String}\n * @return {Boolean} returns true if element is available\n */\n isExistingOption (query) {\n return !this.options\n ? false\n : this.optionKeys.indexOf(query) > -1\n },\n /**\n * Finds out if the given element is already present\n * in the result value\n * @param {Object||String||Integer} option passed element to check\n * @returns {Boolean} returns true if element is selected\n */\n isSelected (option) {\n const opt = this.trackBy\n ? option[this.trackBy]\n : option\n return this.valueKeys.indexOf(opt) > -1\n },\n /**\n * Finds out if the given option is disabled\n * @param {Object||String||Integer} option passed element to check\n * @returns {Boolean} returns true if element is disabled\n */\n isOptionDisabled (option) {\n return !!option.$isDisabled\n },\n /**\n * Returns empty string when options is null/undefined\n * Returns tag query if option is tag.\n * Returns the customLabel() results and casts it to string.\n *\n * @param {Object||String||Integer} Passed option\n * @returns {Object||String}\n */\n getOptionLabel (option) {\n if (isEmpty(option)) return ''\n /* istanbul ignore else */\n if (option.isTag) return option.label\n /* istanbul ignore else */\n if (option.$isLabel) return option.$groupLabel\n\n const label = this.customLabel(option, this.label)\n /* istanbul ignore else */\n if (isEmpty(label)) return ''\n return label\n },\n /**\n * Add the given option to the list of selected options\n * or sets the option as the selected option.\n * If option is already selected -> remove it from the results.\n *\n * @param {Object||String||Integer} option to select/deselect\n * @param {Boolean} block removing\n */\n select (option, key) {\n /* istanbul ignore else */\n if (option.$isLabel && this.groupSelect) {\n this.selectGroup(option)\n return\n }\n if (this.blockKeys.indexOf(key) !== -1 ||\n this.disabled ||\n option.$isDisabled ||\n option.$isLabel\n ) return\n /* istanbul ignore else */\n if (this.max && this.multiple && this.internalValue.length === this.max) return\n /* istanbul ignore else */\n if (key === 'Tab' && !this.pointerDirty) return\n if (option.isTag) {\n this.$emit('tag', option.label, this.id)\n this.search = ''\n if (this.closeOnSelect && !this.multiple) this.deactivate()\n } else {\n const isSelected = this.isSelected(option)\n\n if (isSelected) {\n if (key !== 'Tab') this.removeElement(option)\n return\n }\n\n if (this.multiple) {\n this.$emit('update:modelValue', this.internalValue.concat([option]))\n } else {\n this.$emit('update:modelValue', option)\n }\n\n this.$emit('select', option, this.id)\n\n /* istanbul ignore else */\n if (this.clearOnSelect) this.search = ''\n }\n /* istanbul ignore else */\n if (this.closeOnSelect) this.deactivate()\n },\n /**\n * Add the given group options to the list of selected options\n * If all group optiona are already selected -> remove it from the results.\n *\n * @param {Object||String||Integer} group to select/deselect\n */\n selectGroup (selectedGroup) {\n const group = this.options.find((option) => {\n return option[this.groupLabel] === selectedGroup.$groupLabel\n })\n\n if (!group) return\n\n if (this.wholeGroupSelected(group)) {\n this.$emit('remove', group[this.groupValues], this.id)\n\n const newValue = this.internalValue.filter(\n (option) => group[this.groupValues].indexOf(option) === -1\n )\n\n this.$emit('update:modelValue', newValue)\n } else {\n let optionsToAdd = group[this.groupValues].filter(\n option => !(this.isOptionDisabled(option) || this.isSelected(option))\n )\n\n // if max is defined then just select options respecting max\n if (this.max) {\n optionsToAdd.splice(this.max - this.internalValue.length)\n }\n\n this.$emit('select', optionsToAdd, this.id)\n this.$emit(\n 'update:modelValue',\n this.internalValue.concat(optionsToAdd)\n )\n }\n\n if (this.closeOnSelect) this.deactivate()\n },\n /**\n * Helper to identify if all values in a group are selected\n *\n * @param {Object} group to validated selected values against\n */\n wholeGroupSelected (group) {\n return group[this.groupValues].every((option) => this.isSelected(option) || this.isOptionDisabled(option)\n )\n },\n /**\n * Helper to identify if all values in a group are disabled\n *\n * @param {Object} group to check for disabled values\n */\n wholeGroupDisabled (group) {\n return group[this.groupValues].every(this.isOptionDisabled)\n },\n /**\n * Removes the given option from the selected options.\n * Additionally checks this.allowEmpty prop if option can be removed when\n * it is the last selected option.\n *\n * @param {type} option description\n * @return {type} description\n */\n removeElement (option, shouldClose = true) {\n /* istanbul ignore else */\n if (this.disabled) return\n /* istanbul ignore else */\n if (option.$isDisabled) return\n /* istanbul ignore else */\n if (!this.allowEmpty && this.internalValue.length <= 1) {\n this.deactivate()\n return\n }\n\n const index = typeof option === 'object'\n ? this.valueKeys.indexOf(option[this.trackBy])\n : this.valueKeys.indexOf(option)\n\n if (this.multiple) {\n const newValue = this.internalValue.slice(0, index).concat(this.internalValue.slice(index + 1))\n this.$emit('update:modelValue', newValue)\n } else {\n this.$emit('update:modelValue', null)\n }\n this.$emit('remove', option, this.id)\n\n /* istanbul ignore else */\n if (this.closeOnSelect && shouldClose) this.deactivate()\n },\n /**\n * Calls this.removeElement() with the last element\n * from this.internalValue (selected element Array)\n *\n * @fires this#removeElement\n */\n removeLastElement () {\n /* istanbul ignore else */\n if (this.blockKeys.indexOf('Delete') !== -1) return\n /* istanbul ignore else */\n if (this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length) {\n this.removeElement(this.internalValue[this.internalValue.length - 1], false)\n }\n },\n /**\n * Opens the multiselect’s dropdown.\n * Sets this.isOpen to TRUE\n */\n activate () {\n /* istanbul ignore else */\n if (this.isOpen || this.disabled) return\n\n this.adjustPosition()\n /* istanbul ignore else */\n if (this.groupValues && this.pointer === 0 && this.filteredOptions.length) {\n this.pointer = 1\n }\n\n this.isOpen = true\n /* istanbul ignore else */\n if (this.searchable) {\n if (!this.preserveSearch) this.search = ''\n if (!this.preventAutofocus) this.$nextTick(() => this.$refs.search && this.$refs.search.focus())\n } else if (!this.preventAutofocus) {\n if (typeof this.$el !== 'undefined') this.$el.focus()\n }\n this.$emit('open', this.id)\n },\n /**\n * Closes the multiselect’s dropdown.\n * Sets this.isOpen to FALSE\n */\n deactivate () {\n /* istanbul ignore else */\n if (!this.isOpen) return\n\n this.isOpen = false\n /* istanbul ignore else */\n if (this.searchable) {\n if (typeof this.$refs.search !== 'undefined') this.$refs.search.blur()\n } else {\n if (typeof this.$el !== 'undefined') this.$el.blur()\n }\n if (!this.preserveSearch) this.search = ''\n this.$emit('close', this.getValue(), this.id)\n },\n /**\n * Call this.activate() or this.deactivate()\n * depending on this.isOpen value.\n *\n * @fires this#activate || this#deactivate\n * @property {Boolean} isOpen indicates if dropdown is open\n */\n toggle () {\n this.isOpen\n ? this.deactivate()\n : this.activate()\n },\n /**\n * Updates the hasEnoughSpace variable used for\n * detecting where to expand the dropdown\n */\n adjustPosition () {\n if (typeof window === 'undefined') return\n\n const spaceAbove = this.$el.getBoundingClientRect().top\n const spaceBelow = window.innerHeight - this.$el.getBoundingClientRect().bottom\n const hasEnoughSpaceBelow = spaceBelow > this.maxHeight\n\n if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || this.openDirection === 'below' || this.openDirection === 'bottom') {\n this.preferredOpenDirection = 'below'\n this.optimizedHeight = Math.min(spaceBelow - 40, this.maxHeight)\n } else {\n this.preferredOpenDirection = 'above'\n this.optimizedHeight = Math.min(spaceAbove - 40, this.maxHeight)\n }\n }\n }\n}\n","export default {\n data () {\n return {\n pointer: 0,\n pointerDirty: false\n }\n },\n props: {\n /**\n * Enable/disable highlighting of the pointed value.\n * @type {Boolean}\n * @default true\n */\n showPointer: {\n type: Boolean,\n default: true\n },\n optionHeight: {\n type: Number,\n default: 40\n }\n },\n computed: {\n pointerPosition () {\n return this.pointer * this.optionHeight\n },\n visibleElements () {\n return this.optimizedHeight / this.optionHeight\n }\n },\n watch: {\n filteredOptions () {\n this.pointerAdjust()\n },\n isOpen () {\n this.pointerDirty = false\n },\n pointer () {\n this.$refs.search && this.$refs.search.setAttribute('aria-activedescendant', this.id + '-' + this.pointer.toString())\n }\n },\n methods: {\n optionHighlight (index, option) {\n return {\n 'multiselect__option--highlight': index === this.pointer && this.showPointer,\n 'multiselect__option--selected': this.isSelected(option)\n }\n },\n groupHighlight (index, selectedGroup) {\n if (!this.groupSelect) {\n return [\n 'multiselect__option--disabled',\n {'multiselect__option--group': selectedGroup.$isLabel}\n ]\n }\n\n const group = this.options.find((option) => {\n return option[this.groupLabel] === selectedGroup.$groupLabel\n })\n\n return group && !this.wholeGroupDisabled(group) ? [\n 'multiselect__option--group',\n {'multiselect__option--highlight': index === this.pointer && this.showPointer},\n {'multiselect__option--group-selected': this.wholeGroupSelected(group)}\n ] : 'multiselect__option--disabled'\n },\n addPointerElement ({key} = 'Enter') {\n /* istanbul ignore else */\n if (this.filteredOptions.length > 0) {\n this.select(this.filteredOptions[this.pointer], key)\n }\n this.pointerReset()\n },\n pointerForward () {\n /* istanbul ignore else */\n if (this.pointer < this.filteredOptions.length - 1) {\n this.pointer++\n /* istanbul ignore next */\n if (this.$refs.list.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight) {\n this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight\n }\n /* istanbul ignore else */\n if (\n this.filteredOptions[this.pointer] &&\n this.filteredOptions[this.pointer].$isLabel &&\n !this.groupSelect\n ) this.pointerForward()\n }\n this.pointerDirty = true\n },\n pointerBackward () {\n if (this.pointer > 0) {\n this.pointer--\n /* istanbul ignore else */\n if (this.$refs.list.scrollTop >= this.pointerPosition) {\n this.$refs.list.scrollTop = this.pointerPosition\n }\n /* istanbul ignore else */\n if (\n this.filteredOptions[this.pointer] &&\n this.filteredOptions[this.pointer].$isLabel &&\n !this.groupSelect\n ) this.pointerBackward()\n } else {\n /* istanbul ignore else */\n if (\n this.filteredOptions[this.pointer] &&\n this.filteredOptions[0].$isLabel &&\n !this.groupSelect\n ) this.pointerForward()\n }\n this.pointerDirty = true\n },\n pointerReset () {\n /* istanbul ignore else */\n if (!this.closeOnSelect) return\n this.pointer = 0\n /* istanbul ignore else */\n if (this.$refs.list) {\n this.$refs.list.scrollTop = 0\n }\n },\n pointerAdjust () {\n /* istanbul ignore else */\n if (this.pointer >= this.filteredOptions.length - 1) {\n this.pointer = this.filteredOptions.length\n ? this.filteredOptions.length - 1\n : 0\n }\n\n if (this.filteredOptions.length > 0 &&\n this.filteredOptions[this.pointer].$isLabel &&\n !this.groupSelect\n ) {\n this.pointerForward()\n }\n },\n pointerSet (index) {\n this.pointer = index\n this.pointerDirty = true\n }\n }\n}\n","export { default } from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Multiselect.vue?vue&type=script&lang=js\"; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Multiselect.vue?vue&type=script&lang=js\"","import { render } from \"./Multiselect.vue?vue&type=template&id=b01f7952\"\nimport script from \"./Multiselect.vue?vue&type=script&lang=js\"\nexport * from \"./Multiselect.vue?vue&type=script&lang=js\"\n\nimport \"./Multiselect.vue?vue&type=style&index=0&id=b01f7952&lang=css\"\n\nimport exportComponent from \"/home/matt/git/vue-multiselect/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import Multiselect from './Multiselect.vue'\nimport multiselectMixin from './multiselectMixin.js'\nimport pointerMixin from './pointerMixin.js'\n\nexport default Multiselect\n\nexport {Multiselect, multiselectMixin, pointerMixin}\n","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n","'use strict';\nvar $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\n\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.es/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n /* global Symbol -- safe */\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/vue3-multiselect.umd.min.js b/dist/vue3-multiselect.umd.min.js new file mode 100644 index 00000000..b7cc7933 --- /dev/null +++ b/dist/vue3-multiselect.umd.min.js @@ -0,0 +1,2 @@ +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue3-multiselect"]=t(require("vue")):e["vue3-multiselect"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},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="fb15")}({"00ee":function(e,t,n){var r=n("b622"),i=r("toStringTag"),o={};o[i]="z",e.exports="[object z]"===String(o)},"0366":function(e,t,n){var r=n("1c0b");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},"06cf":function(e,t,n){var r=n("83ab"),i=n("d1e7"),o=n("5c6c"),c=n("fc6a"),s=n("c04e"),a=n("5135"),l=n("0cfb"),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=c(e),t=s(t,!0),l)try{return u(e,t)}catch(n){}if(a(e,t))return o(!i.f.call(e,t),e[t])}},"0cfb":function(e,t,n){var r=n("83ab"),i=n("d039"),o=n("cc12");e.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"0d03":function(e,t,n){var r=n("6eeb"),i=Date.prototype,o="Invalid Date",c="toString",s=i[c],a=i.getTime;new Date(NaN)+""!=o&&r(i,c,(function(){var e=a.call(this);return e===e?s.call(this):o}))},"129f":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},"13d5":function(e,t,n){"use strict";var r=n("23e7"),i=n("d58f").left,o=n("a640"),c=n("2d00"),s=n("605d"),a=o("reduce"),l=!s&&c>79&&c<83;r({target:"Array",proto:!0,forced:!a||l},{reduce:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"14c3":function(e,t,n){var r=n("c6b6"),i=n("9263");e.exports=function(e,t){var n=e.exec;if("function"===typeof n){var o=n.call(e,t);if("object"!==typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},"1be4":function(e,t,n){var r=n("d066");e.exports=r("document","documentElement")},"1c0b":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},"1d80":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"1dde":function(e,t,n){var r=n("d039"),i=n("b622"),o=n("2d00"),c=i("species");e.exports=function(e){return o>=51||!r((function(){var t=[],n=t.constructor={};return n[c]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},"23cb":function(e,t,n){var r=n("a691"),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},"23e7":function(e,t,n){var r=n("da84"),i=n("06cf").f,o=n("9112"),c=n("6eeb"),s=n("ce4e"),a=n("e893"),l=n("94ca");e.exports=function(e,t){var n,u,f,p,d,h,b=e.target,g=e.global,v=e.stat;if(u=g?r:v?r[b]||s(b,{}):(r[b]||{}).prototype,u)for(f in t){if(d=t[f],e.noTargetGet?(h=i(u,f),p=h&&h.value):p=u[f],n=l(g?f:b+(v?".":"#")+f,e.forced),!n&&void 0!==p){if(typeof d===typeof p)continue;a(d,p)}(e.sham||p&&p.sham)&&o(d,"sham",!0),c(u,f,d,e)}}},"241c":function(e,t,n){var r=n("ca84"),i=n("7839"),o=i.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},"25f0":function(e,t,n){"use strict";var r=n("6eeb"),i=n("825a"),o=n("d039"),c=n("ad6d"),s="toString",a=RegExp.prototype,l=a[s],u=o((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),f=l.name!=s;(u||f)&&r(RegExp.prototype,s,(function(){var e=i(this),t=String(e.source),n=e.flags,r=String(void 0===n&&e instanceof RegExp&&!("flags"in a)?c.call(e):n);return"/"+t+"/"+r}),{unsafe:!0})},"277d":function(e,t,n){var r=n("23e7"),i=n("e8b5");r({target:"Array",stat:!0},{isArray:i})},"2d00":function(e,t,n){var r,i,o=n("da84"),c=n("342f"),s=o.process,a=s&&s.versions,l=a&&a.v8;l?(r=l.split("."),i=r[0]+r[1]):c&&(r=c.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=c.match(/Chrome\/(\d+)/),r&&(i=r[1]))),e.exports=i&&+i},"342f":function(e,t,n){var r=n("d066");e.exports=r("navigator","userAgent")||""},"37e8":function(e,t,n){var r=n("83ab"),i=n("9bf2"),o=n("825a"),c=n("df75");e.exports=r?Object.defineProperties:function(e,t){o(e);var n,r=c(t),s=r.length,a=0;while(s>a)i.f(e,n=r[a++],t[n]);return e}},"3bbe":function(e,t,n){var r=n("861d");e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},"428f":function(e,t,n){var r=n("da84");e.exports=r},"44ad":function(e,t,n){var r=n("d039"),i=n("c6b6"),o="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?o.call(e,""):Object(e)}:Object},"44d2":function(e,t,n){var r=n("b622"),i=n("7c73"),o=n("9bf2"),c=r("unscopables"),s=Array.prototype;void 0==s[c]&&o.f(s,c,{configurable:!0,value:i(null)}),e.exports=function(e){s[c][e]=!0}},4930:function(e,t,n){var r=n("605d"),i=n("2d00"),o=n("d039");e.exports=!!Object.getOwnPropertySymbols&&!o((function(){return!Symbol.sham&&(r?38===i:i>37&&i<41)}))},"498a":function(e,t,n){"use strict";var r=n("23e7"),i=n("58a8").trim,o=n("c8d2");r({target:"String",proto:!0,forced:o("trim")},{trim:function(){return i(this)}})},"4d64":function(e,t,n){var r=n("fc6a"),i=n("50c4"),o=n("23cb"),c=function(e){return function(t,n,c){var s,a=r(t),l=i(a.length),u=o(c,l);if(e&&n!=n){while(l>u)if(s=a[u++],s!=s)return!0}else for(;l>u;u++)if((e||u in a)&&a[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:c(!0),indexOf:c(!1)}},"4de4":function(e,t,n){"use strict";var r=n("23e7"),i=n("b727").filter,o=n("1dde"),c=o("filter");r({target:"Array",proto:!0,forced:!c},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},"4e82":function(e,t,n){"use strict";var r=n("23e7"),i=n("1c0b"),o=n("7b0b"),c=n("d039"),s=n("a640"),a=[],l=a.sort,u=c((function(){a.sort(void 0)})),f=c((function(){a.sort(null)})),p=s("sort"),d=u||!f||!p;r({target:"Array",proto:!0,forced:d},{sort:function(e){return void 0===e?l.call(o(this)):l.call(o(this),i(e))}})},"50c4":function(e,t,n){var r=n("a691"),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},5135:function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},5692:function(e,t,n){var r=n("c430"),i=n("c6cd");(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.9.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"56ef":function(e,t,n){var r=n("d066"),i=n("241c"),o=n("7418"),c=n("825a");e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(c(e)),n=o.f;return n?t.concat(n(e)):t}},5899:function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},"58a8":function(e,t,n){var r=n("1d80"),i=n("5899"),o="["+i+"]",c=RegExp("^"+o+o+"*"),s=RegExp(o+o+"*$"),a=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(c,"")),2&e&&(n=n.replace(s,"")),n}};e.exports={start:a(1),end:a(2),trim:a(3)}},"5c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"605d":function(e,t,n){var r=n("c6b6"),i=n("da84");e.exports="process"==r(i.process)},"65f0":function(e,t,n){var r=n("861d"),i=n("e8b5"),o=n("b622"),c=o("species");e.exports=function(e,t){var n;return i(e)&&(n=e.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)?r(n)&&(n=n[c],null===n&&(n=void 0)):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},"69f3":function(e,t,n){var r,i,o,c=n("7f9a"),s=n("da84"),a=n("861d"),l=n("9112"),u=n("5135"),f=n("c6cd"),p=n("f772"),d=n("d012"),h=s.WeakMap,b=function(e){return o(e)?i(e):r(e,{})},g=function(e){return function(t){var n;if(!a(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}};if(c){var v=f.state||(f.state=new h),m=v.get,y=v.has,O=v.set;r=function(e,t){return t.facade=e,O.call(v,e,t),t},i=function(e){return m.call(v,e)||{}},o=function(e){return y.call(v,e)}}else{var x=p("state");d[x]=!0,r=function(e,t){return t.facade=e,l(e,x,t),t},i=function(e){return u(e,x)?e[x]:{}},o=function(e){return u(e,x)}}e.exports={set:r,get:i,has:o,enforce:b,getterFor:g}},"6eeb":function(e,t,n){var r=n("da84"),i=n("9112"),o=n("5135"),c=n("ce4e"),s=n("8925"),a=n("69f3"),l=a.get,u=a.enforce,f=String(String).split("String");(e.exports=function(e,t,n,s){var a,l=!!s&&!!s.unsafe,p=!!s&&!!s.enumerable,d=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||o(n,"name")||i(n,"name",t),a=u(n),a.source||(a.source=f.join("string"==typeof t?t:""))),e!==r?(l?!d&&e[t]&&(p=!0):delete e[t],p?e[t]=n:i(e,t,n)):p?e[t]=n:c(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||s(this)}))},7156:function(e,t,n){var r=n("861d"),i=n("d2bb");e.exports=function(e,t,n){var o,c;return i&&"function"==typeof(o=t.constructor)&&o!==n&&r(c=o.prototype)&&c!==n.prototype&&i(e,c),e}},7418:function(e,t){t.f=Object.getOwnPropertySymbols},7839:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(e,t,n){var r=n("1d80");e.exports=function(e){return Object(r(e))}},"7c73":function(e,t,n){var r,i=n("825a"),o=n("37e8"),c=n("7839"),s=n("d012"),a=n("1be4"),l=n("cc12"),u=n("f772"),f=">",p="<",d="prototype",h="script",b=u("IE_PROTO"),g=function(){},v=function(e){return p+h+f+e+p+"/"+h+f},m=function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){var e,t=l("iframe"),n="java"+h+":";return t.style.display="none",a.appendChild(t),t.src=String(n),e=t.contentWindow.document,e.open(),e.write(v("document.F=Object")),e.close(),e.F},O=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(t){}O=r?m(r):y();var e=c.length;while(e--)delete O[d][c[e]];return O()};s[b]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(g[d]=i(e),n=new g,g[d]=null,n[b]=e):n=O(),void 0===t?n:o(n,t)}},"7db0":function(e,t,n){"use strict";var r=n("23e7"),i=n("b727").find,o=n("44d2"),c="find",s=!0;c in[]&&Array(1)[c]((function(){s=!1})),r({target:"Array",proto:!0,forced:s},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(c)},"7f9a":function(e,t,n){var r=n("da84"),i=n("8925"),o=r.WeakMap;e.exports="function"===typeof o&&/native code/.test(i(o))},"825a":function(e,t,n){var r=n("861d");e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},"83ab":function(e,t,n){var r=n("d039");e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8418:function(e,t,n){"use strict";var r=n("c04e"),i=n("9bf2"),o=n("5c6c");e.exports=function(e,t,n){var c=r(t);c in e?i.f(e,c,o(0,n)):e[c]=n}},"841c":function(e,t,n){"use strict";var r=n("d784"),i=n("825a"),o=n("1d80"),c=n("129f"),s=n("14c3");r("search",1,(function(e,t,n){return[function(t){var n=o(this),r=void 0==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var o=i(e),a=String(this),l=o.lastIndex;c(l,0)||(o.lastIndex=0);var u=s(o,a);return c(o.lastIndex,l)||(o.lastIndex=l),null===u?-1:u.index}]}))},"861d":function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},8875:function(e,t,n){var r,i,o;(function(n,c){i=[],r=c,o="function"===typeof r?r.apply(t,i):r,void 0===o||(e.exports=o)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(d){var n,r,i,o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,c=/@([^@]*):(\d+):(\d+)\s*$/gi,s=o.exec(d.stack)||c.exec(d.stack),a=s&&s[1]||!1,l=s&&s[2]||!1,u=document.location.href.replace(document.location.hash,""),f=document.getElementsByTagName("script");a===u&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(l-2)+"}[^<]*\n\n\n","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","function isEmpty (opt) {\n if (opt === 0) return false\n if (Array.isArray(opt) && opt.length === 0) return true\n return !opt\n}\n\nfunction not (fun) {\n return (...params) => !fun(...params)\n}\n\nfunction includes (str, query) {\n /* istanbul ignore else */\n if (str === undefined) str = 'undefined'\n if (str === null) str = 'null'\n if (str === false) str = 'false'\n const text = str.toString().toLowerCase()\n return text.indexOf(query.trim()) !== -1\n}\n\nfunction filterOptions (options, search, label, customLabel) {\n return search ? options\n .filter((option) => includes(customLabel(option, label), search))\n .sort((a, b) => customLabel(a, label).length - customLabel(b, label).length) : options\n}\n\nfunction stripGroups (options) {\n return options.filter((option) => !option.$isLabel)\n}\n\nfunction flattenOptions (values, label) {\n return (options) =>\n options.reduce((prev, curr) => {\n /* istanbul ignore else */\n if (curr[values] && curr[values].length) {\n prev.push({\n $groupLabel: curr[label],\n $isLabel: true\n })\n return prev.concat(curr[values])\n }\n return prev\n }, [])\n}\n\nfunction filterGroups (search, label, values, groupLabel, customLabel) {\n return (groups) =>\n groups.map((group) => {\n /* istanbul ignore else */\n if (!group[values]) {\n console.warn(`Options passed to vue-multiselect do not contain groups, despite the config.`)\n return []\n }\n const groupOptions = filterOptions(group[values], search, label, customLabel)\n\n return groupOptions.length\n ? {\n [groupLabel]: group[groupLabel],\n [values]: groupOptions\n }\n : []\n })\n}\n\nconst flow = (...fns) => (x) => fns.reduce((v, f) => f(v), x)\n\nexport default {\n data () {\n return {\n search: '',\n isOpen: false,\n preferredOpenDirection: 'below',\n optimizedHeight: this.maxHeight\n }\n },\n props: {\n /**\n * Decide whether to filter the results based on search query.\n * Useful for async filtering, where we search through more complex data.\n * @type {Boolean}\n */\n internalSearch: {\n type: Boolean,\n default: true\n },\n /**\n * Array of available options: Objects, Strings or Integers.\n * If array of objects, visible label will default to option.label.\n * If `labal` prop is passed, label will equal option['label']\n * @type {Array}\n */\n options: {\n type: Array,\n required: true\n },\n /**\n * Equivalent to the `multiple` attribute on a `` input.\n * @default 'Select option'\n * @type {String}\n */\n placeholder: {\n type: String,\n default: 'Select option'\n },\n /**\n * Allow to remove all selected values\n * @default true\n * @type {Boolean}\n */\n allowEmpty: {\n type: Boolean,\n default: true\n },\n /**\n * Reset this.internalValue, this.search after this.internalValue changes.\n * Useful if want to create a stateless dropdown.\n * @default false\n * @type {Boolean}\n */\n resetAfter: {\n type: Boolean,\n default: false\n },\n /**\n * Enable/disable closing after selecting an option\n * @default true\n * @type {Boolean}\n */\n closeOnSelect: {\n type: Boolean,\n default: true\n },\n /**\n * Function to interpolate the custom label\n * @default false\n * @type {Function}\n */\n customLabel: {\n type: Function,\n default (option, label) {\n if (isEmpty(option)) return ''\n return label ? option[label] : option\n }\n },\n /**\n * Disable / Enable tagging\n * @default false\n * @type {Boolean}\n */\n taggable: {\n type: Boolean,\n default: false\n },\n /**\n * String to show when highlighting a potential tag\n * @default 'Press enter to create a tag'\n * @type {String}\n */\n tagPlaceholder: {\n type: String,\n default: 'Press enter to create a tag'\n },\n /**\n * By default new tags will appear above the search results.\n * Changing to 'bottom' will revert this behaviour\n * and will proritize the search results\n * @default 'top'\n * @type {String}\n */\n tagPosition: {\n type: String,\n default: 'top'\n },\n /**\n * Number of allowed selected options. No limit if 0.\n * @default 0\n * @type {Number}\n */\n max: {\n type: [Number, Boolean],\n default: false\n },\n /**\n * Will be passed with all events as second param.\n * Useful for identifying events origin.\n * @default null\n * @type {String|Integer}\n */\n id: {\n default: null\n },\n /**\n * Limits the options displayed in the dropdown\n * to the first X options.\n * @default 1000\n * @type {Integer}\n */\n optionsLimit: {\n type: Number,\n default: 1000\n },\n /**\n * Name of the property containing\n * the group values\n * @default 1000\n * @type {String}\n */\n groupValues: {\n type: String\n },\n /**\n * Name of the property containing\n * the group label\n * @default 1000\n * @type {String}\n */\n groupLabel: {\n type: String\n },\n /**\n * Allow to select all group values\n * by selecting the group label\n * @default false\n * @type {Boolean}\n */\n groupSelect: {\n type: Boolean,\n default: false\n },\n /**\n * Array of keyboard keys to block\n * when selecting\n * @default 1000\n * @type {String}\n */\n blockKeys: {\n type: Array,\n default () {\n return []\n }\n },\n /**\n * Prevent from wiping up the search value\n * @default false\n * @type {Boolean}\n */\n preserveSearch: {\n type: Boolean,\n default: false\n },\n /**\n * Select 1st options if value is empty\n * @default false\n * @type {Boolean}\n */\n preselectFirst: {\n type: Boolean,\n default: false\n },\n /**\n * Prevent autofocus\n * @default false\n * @type {Boolean}\n */\n preventAutofocus: {\n type: Boolean,\n default: false\n }\n },\n mounted () {\n /* istanbul ignore else */\n if (!this.multiple && this.max) {\n console.warn('[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false.')\n }\n if (\n this.preselectFirst &&\n !this.internalValue.length &&\n this.options.length\n ) {\n this.select(this.filteredOptions[0])\n }\n },\n computed: {\n internalValue () {\n return this.modelValue || this.modelValue === 0\n ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue]\n : []\n },\n filteredOptions () {\n const search = this.search || ''\n const normalizedSearch = search.toLowerCase().trim()\n\n let options = this.options.concat()\n\n /* istanbul ignore else */\n if (this.internalSearch) {\n options = this.groupValues\n ? this.filterAndFlat(options, normalizedSearch, this.label)\n : filterOptions(options, normalizedSearch, this.label, this.customLabel)\n } else {\n options = this.groupValues ? flattenOptions(this.groupValues, this.groupLabel)(options) : options\n }\n\n options = this.hideSelected\n ? options.filter(not(this.isSelected))\n : options\n\n /* istanbul ignore else */\n if (this.taggable && normalizedSearch.length && !this.isExistingOption(normalizedSearch)) {\n if (this.tagPosition === 'bottom') {\n options.push({isTag: true, label: search})\n } else {\n options.unshift({isTag: true, label: search})\n }\n }\n\n return options.slice(0, this.optionsLimit)\n },\n valueKeys () {\n if (this.trackBy) {\n return this.internalValue.map((element) => element[this.trackBy])\n } else {\n return this.internalValue\n }\n },\n optionKeys () {\n const options = this.groupValues ? this.flatAndStrip(this.options) : this.options\n return options.map((element) => this.customLabel(element, this.label).toString().toLowerCase())\n },\n currentOptionLabel () {\n return this.multiple\n ? this.searchable ? '' : this.placeholder\n : this.internalValue.length\n ? this.getOptionLabel(this.internalValue[0])\n : this.searchable ? '' : this.placeholder\n }\n },\n watch: {\n internalValue () {\n /* istanbul ignore else */\n if (this.resetAfter && this.internalValue.length) {\n this.search = ''\n this.$emit('update:modelValue', this.multiple ? [] : null)\n }\n },\n search () {\n this.$emit('search-change', this.search)\n }\n },\n emits: ['open', 'search-change', 'close', 'select', 'update:modelValue', 'remove', 'tag'],\n methods: {\n /**\n * Returns the internalValue in a way it can be emited to the parent\n * @returns {Object||Array||String||Integer}\n */\n getValue () {\n return this.multiple\n ? this.internalValue\n : this.internalValue.length === 0\n ? null\n : this.internalValue[0]\n },\n /**\n * Filters and then flattens the options list\n * @param {Array}\n * @return {Array} returns a filtered and flat options list\n */\n filterAndFlat (options, search, label) {\n return flow(\n filterGroups(search, label, this.groupValues, this.groupLabel, this.customLabel),\n flattenOptions(this.groupValues, this.groupLabel)\n )(options)\n },\n /**\n * Flattens and then strips the group labels from the options list\n * @param {Array}\n * @return {Array} returns a flat options list without group labels\n */\n flatAndStrip (options) {\n return flow(\n flattenOptions(this.groupValues, this.groupLabel),\n stripGroups\n )(options)\n },\n /**\n * Updates the search value\n * @param {String}\n */\n updateSearch (query) {\n this.search = query\n },\n /**\n * Finds out if the given query is already present\n * in the available options\n * @param {String}\n * @return {Boolean} returns true if element is available\n */\n isExistingOption (query) {\n return !this.options\n ? false\n : this.optionKeys.indexOf(query) > -1\n },\n /**\n * Finds out if the given element is already present\n * in the result value\n * @param {Object||String||Integer} option passed element to check\n * @returns {Boolean} returns true if element is selected\n */\n isSelected (option) {\n const opt = this.trackBy\n ? option[this.trackBy]\n : option\n return this.valueKeys.indexOf(opt) > -1\n },\n /**\n * Finds out if the given option is disabled\n * @param {Object||String||Integer} option passed element to check\n * @returns {Boolean} returns true if element is disabled\n */\n isOptionDisabled (option) {\n return !!option.$isDisabled\n },\n /**\n * Returns empty string when options is null/undefined\n * Returns tag query if option is tag.\n * Returns the customLabel() results and casts it to string.\n *\n * @param {Object||String||Integer} Passed option\n * @returns {Object||String}\n */\n getOptionLabel (option) {\n if (isEmpty(option)) return ''\n /* istanbul ignore else */\n if (option.isTag) return option.label\n /* istanbul ignore else */\n if (option.$isLabel) return option.$groupLabel\n\n const label = this.customLabel(option, this.label)\n /* istanbul ignore else */\n if (isEmpty(label)) return ''\n return label\n },\n /**\n * Add the given option to the list of selected options\n * or sets the option as the selected option.\n * If option is already selected -> remove it from the results.\n *\n * @param {Object||String||Integer} option to select/deselect\n * @param {Boolean} block removing\n */\n select (option, key) {\n /* istanbul ignore else */\n if (option.$isLabel && this.groupSelect) {\n this.selectGroup(option)\n return\n }\n if (this.blockKeys.indexOf(key) !== -1 ||\n this.disabled ||\n option.$isDisabled ||\n option.$isLabel\n ) return\n /* istanbul ignore else */\n if (this.max && this.multiple && this.internalValue.length === this.max) return\n /* istanbul ignore else */\n if (key === 'Tab' && !this.pointerDirty) return\n if (option.isTag) {\n this.$emit('tag', option.label, this.id)\n this.search = ''\n if (this.closeOnSelect && !this.multiple) this.deactivate()\n } else {\n const isSelected = this.isSelected(option)\n\n if (isSelected) {\n if (key !== 'Tab') this.removeElement(option)\n return\n }\n\n if (this.multiple) {\n this.$emit('update:modelValue', this.internalValue.concat([option]))\n } else {\n this.$emit('update:modelValue', option)\n }\n\n this.$emit('select', option, this.id)\n\n /* istanbul ignore else */\n if (this.clearOnSelect) this.search = ''\n }\n /* istanbul ignore else */\n if (this.closeOnSelect) this.deactivate()\n },\n /**\n * Add the given group options to the list of selected options\n * If all group optiona are already selected -> remove it from the results.\n *\n * @param {Object||String||Integer} group to select/deselect\n */\n selectGroup (selectedGroup) {\n const group = this.options.find((option) => {\n return option[this.groupLabel] === selectedGroup.$groupLabel\n })\n\n if (!group) return\n\n if (this.wholeGroupSelected(group)) {\n this.$emit('remove', group[this.groupValues], this.id)\n\n const newValue = this.internalValue.filter(\n (option) => group[this.groupValues].indexOf(option) === -1\n )\n\n this.$emit('update:modelValue', newValue)\n } else {\n let optionsToAdd = group[this.groupValues].filter(\n option => !(this.isOptionDisabled(option) || this.isSelected(option))\n )\n\n // if max is defined then just select options respecting max\n if (this.max) {\n optionsToAdd.splice(this.max - this.internalValue.length)\n }\n\n this.$emit('select', optionsToAdd, this.id)\n this.$emit(\n 'update:modelValue',\n this.internalValue.concat(optionsToAdd)\n )\n }\n\n if (this.closeOnSelect) this.deactivate()\n },\n /**\n * Helper to identify if all values in a group are selected\n *\n * @param {Object} group to validated selected values against\n */\n wholeGroupSelected (group) {\n return group[this.groupValues].every((option) => this.isSelected(option) || this.isOptionDisabled(option)\n )\n },\n /**\n * Helper to identify if all values in a group are disabled\n *\n * @param {Object} group to check for disabled values\n */\n wholeGroupDisabled (group) {\n return group[this.groupValues].every(this.isOptionDisabled)\n },\n /**\n * Removes the given option from the selected options.\n * Additionally checks this.allowEmpty prop if option can be removed when\n * it is the last selected option.\n *\n * @param {type} option description\n * @return {type} description\n */\n removeElement (option, shouldClose = true) {\n /* istanbul ignore else */\n if (this.disabled) return\n /* istanbul ignore else */\n if (option.$isDisabled) return\n /* istanbul ignore else */\n if (!this.allowEmpty && this.internalValue.length <= 1) {\n this.deactivate()\n return\n }\n\n const index = typeof option === 'object'\n ? this.valueKeys.indexOf(option[this.trackBy])\n : this.valueKeys.indexOf(option)\n\n if (this.multiple) {\n const newValue = this.internalValue.slice(0, index).concat(this.internalValue.slice(index + 1))\n this.$emit('update:modelValue', newValue)\n } else {\n this.$emit('update:modelValue', null)\n }\n this.$emit('remove', option, this.id)\n\n /* istanbul ignore else */\n if (this.closeOnSelect && shouldClose) this.deactivate()\n },\n /**\n * Calls this.removeElement() with the last element\n * from this.internalValue (selected element Array)\n *\n * @fires this#removeElement\n */\n removeLastElement () {\n /* istanbul ignore else */\n if (this.blockKeys.indexOf('Delete') !== -1) return\n /* istanbul ignore else */\n if (this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length) {\n this.removeElement(this.internalValue[this.internalValue.length - 1], false)\n }\n },\n /**\n * Opens the multiselect’s dropdown.\n * Sets this.isOpen to TRUE\n */\n activate () {\n /* istanbul ignore else */\n if (this.isOpen || this.disabled) return\n\n this.adjustPosition()\n /* istanbul ignore else */\n if (this.groupValues && this.pointer === 0 && this.filteredOptions.length) {\n this.pointer = 1\n }\n\n this.isOpen = true\n /* istanbul ignore else */\n if (this.searchable) {\n if (!this.preserveSearch) this.search = ''\n if (!this.preventAutofocus) this.$nextTick(() => this.$refs.search && this.$refs.search.focus())\n } else if (!this.preventAutofocus) {\n if (typeof this.$el !== 'undefined') this.$el.focus()\n }\n this.$emit('open', this.id)\n },\n /**\n * Closes the multiselect’s dropdown.\n * Sets this.isOpen to FALSE\n */\n deactivate () {\n /* istanbul ignore else */\n if (!this.isOpen) return\n\n this.isOpen = false\n /* istanbul ignore else */\n if (this.searchable) {\n if (typeof this.$refs.search !== 'undefined') this.$refs.search.blur()\n } else {\n if (typeof this.$el !== 'undefined') this.$el.blur()\n }\n if (!this.preserveSearch) this.search = ''\n this.$emit('close', this.getValue(), this.id)\n },\n /**\n * Call this.activate() or this.deactivate()\n * depending on this.isOpen value.\n *\n * @fires this#activate || this#deactivate\n * @property {Boolean} isOpen indicates if dropdown is open\n */\n toggle () {\n this.isOpen\n ? this.deactivate()\n : this.activate()\n },\n /**\n * Updates the hasEnoughSpace variable used for\n * detecting where to expand the dropdown\n */\n adjustPosition () {\n if (typeof window === 'undefined') return\n\n const spaceAbove = this.$el.getBoundingClientRect().top\n const spaceBelow = window.innerHeight - this.$el.getBoundingClientRect().bottom\n const hasEnoughSpaceBelow = spaceBelow > this.maxHeight\n\n if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || this.openDirection === 'below' || this.openDirection === 'bottom') {\n this.preferredOpenDirection = 'below'\n this.optimizedHeight = Math.min(spaceBelow - 40, this.maxHeight)\n } else {\n this.preferredOpenDirection = 'above'\n this.optimizedHeight = Math.min(spaceAbove - 40, this.maxHeight)\n }\n }\n }\n}\n","export default {\n data () {\n return {\n pointer: 0,\n pointerDirty: false\n }\n },\n props: {\n /**\n * Enable/disable highlighting of the pointed value.\n * @type {Boolean}\n * @default true\n */\n showPointer: {\n type: Boolean,\n default: true\n },\n optionHeight: {\n type: Number,\n default: 40\n }\n },\n computed: {\n pointerPosition () {\n return this.pointer * this.optionHeight\n },\n visibleElements () {\n return this.optimizedHeight / this.optionHeight\n }\n },\n watch: {\n filteredOptions () {\n this.pointerAdjust()\n },\n isOpen () {\n this.pointerDirty = false\n },\n pointer () {\n this.$refs.search && this.$refs.search.setAttribute('aria-activedescendant', this.id + '-' + this.pointer.toString())\n }\n },\n methods: {\n optionHighlight (index, option) {\n return {\n 'multiselect__option--highlight': index === this.pointer && this.showPointer,\n 'multiselect__option--selected': this.isSelected(option)\n }\n },\n groupHighlight (index, selectedGroup) {\n if (!this.groupSelect) {\n return [\n 'multiselect__option--disabled',\n {'multiselect__option--group': selectedGroup.$isLabel}\n ]\n }\n\n const group = this.options.find((option) => {\n return option[this.groupLabel] === selectedGroup.$groupLabel\n })\n\n return group && !this.wholeGroupDisabled(group) ? [\n 'multiselect__option--group',\n {'multiselect__option--highlight': index === this.pointer && this.showPointer},\n {'multiselect__option--group-selected': this.wholeGroupSelected(group)}\n ] : 'multiselect__option--disabled'\n },\n addPointerElement ({key} = 'Enter') {\n /* istanbul ignore else */\n if (this.filteredOptions.length > 0) {\n this.select(this.filteredOptions[this.pointer], key)\n }\n this.pointerReset()\n },\n pointerForward () {\n /* istanbul ignore else */\n if (this.pointer < this.filteredOptions.length - 1) {\n this.pointer++\n /* istanbul ignore next */\n if (this.$refs.list.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight) {\n this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight\n }\n /* istanbul ignore else */\n if (\n this.filteredOptions[this.pointer] &&\n this.filteredOptions[this.pointer].$isLabel &&\n !this.groupSelect\n ) this.pointerForward()\n }\n this.pointerDirty = true\n },\n pointerBackward () {\n if (this.pointer > 0) {\n this.pointer--\n /* istanbul ignore else */\n if (this.$refs.list.scrollTop >= this.pointerPosition) {\n this.$refs.list.scrollTop = this.pointerPosition\n }\n /* istanbul ignore else */\n if (\n this.filteredOptions[this.pointer] &&\n this.filteredOptions[this.pointer].$isLabel &&\n !this.groupSelect\n ) this.pointerBackward()\n } else {\n /* istanbul ignore else */\n if (\n this.filteredOptions[this.pointer] &&\n this.filteredOptions[0].$isLabel &&\n !this.groupSelect\n ) this.pointerForward()\n }\n this.pointerDirty = true\n },\n pointerReset () {\n /* istanbul ignore else */\n if (!this.closeOnSelect) return\n this.pointer = 0\n /* istanbul ignore else */\n if (this.$refs.list) {\n this.$refs.list.scrollTop = 0\n }\n },\n pointerAdjust () {\n /* istanbul ignore else */\n if (this.pointer >= this.filteredOptions.length - 1) {\n this.pointer = this.filteredOptions.length\n ? this.filteredOptions.length - 1\n : 0\n }\n\n if (this.filteredOptions.length > 0 &&\n this.filteredOptions[this.pointer].$isLabel &&\n !this.groupSelect\n ) {\n this.pointerForward()\n }\n },\n pointerSet (index) {\n this.pointer = index\n this.pointerDirty = true\n }\n }\n}\n","import { render } from \"./Multiselect.vue?vue&type=template&id=b01f7952\"\nimport script from \"./Multiselect.vue?vue&type=script&lang=js\"\nexport * from \"./Multiselect.vue?vue&type=script&lang=js\"\n\nimport \"./Multiselect.vue?vue&type=style&index=0&id=b01f7952&lang=css\"\n\nimport exportComponent from \"/home/matt/git/vue-multiselect/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import Multiselect from './Multiselect.vue'\nimport multiselectMixin from './multiselectMixin.js'\nimport pointerMixin from './pointerMixin.js'\n\nexport default Multiselect\n\nexport {Multiselect, multiselectMixin, pointerMixin}\n","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n","'use strict';\nvar $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\n\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.es/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n /* global Symbol -- safe */\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/css/app.785fdcfba171d7f1dd8db2283193eb6f.css.map b/docs/static/css/app.785fdcfba171d7f1dd8db2283193eb6f.css.map new file mode 100644 index 00000000..ea6d0db5 --- /dev/null +++ b/docs/static/css/app.785fdcfba171d7f1dd8db2283193eb6f.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./src/Multiselect.vue","webpack:///./documentation/partials/examples/MultiSelect.vue","webpack:///./documentation/partials/examples/AjaxSearch.vue","webpack:///./documentation/partials/examples/CustomOption.vue","webpack:///./documentation/partials/examples/CustomConfig.vue","webpack:///./documentation/partials/examples/ProgrammaticCtrl.vue","webpack:///./documentation/MultiselectExample.vue"],"names":[],"mappings":";AACA;EACE,qBAAqB;CACtB;AACD;EACE,mBAAmB;EACnB,WAAW;EACX,SAAS;EACT,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,eAAe;CAChB;AACD;;EAEE,mBAAmB;EACnB,YAAY;EACZ,SAAS;EACT,UAAU;EACV,sBAAsB;EACtB,YAAY;EACZ,aAAa;EACb,oBAAoB;EACpB,8CAA8C;EAC9C,oBAAoB;EACpB,kBAAkB;EAClB,0CAA0C;UAClC,kCAAkC;CAC3C;AACD;EACE,qEAAqE;UAC7D,6DAA6D;EACrE,4CAA4C;UACpC,oCAAoC;CAC7C;AACD;EACE,qEAAqE;UAC7D,6DAA6D;EACrE,4CAA4C;UACpC,oCAAoC;CAC7C;AACD;;EAEE,6CAA6C;EAC7C,qCAAqC;EACrC,WAAW;CACZ;AACD;;EAEE,WAAW;CACZ;AACD;;;EAGE,qBAAqB;EACrB,gBAAgB;EAChB,+BAA+B;MAC3B,2BAA2B;CAChC;AACD;EACE,gCAAgC;UACxB,wBAAwB;EAChC,eAAe;EACf,mBAAmB;EACnB,YAAY;EACZ,iBAAiB;EACjB,iBAAiB;EACjB,eAAe;CAChB;AACD;EACE,+BAA+B;UACvB,uBAAuB;CAChC;AACD;EACE,cAAc;CACf;AACD;EACE,oBAAoB;EACpB,qBAAqB;EACrB,aAAa;CACd;AACD;EACE,YAAY;CACb;AACD;;;EAGE,6BAA6B;EAC7B,8BAA8B;CAC/B;AACD;EACE,mCAAmC;UAC3B,2BAA2B;CACpC;AACD;;;EAGE,0BAA0B;EAC1B,2BAA2B;CAC5B;AACD;;EAEE,mBAAmB;EACnB,sBAAsB;EACtB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,kBAAkB;EAClB,qCAAqC;EACrC,6BAA6B;EAC7B,+BAA+B;UACvB,uBAAuB;EAC/B,mBAAmB;EACnB,oBAAoB;CACrB;AACD;EACE,eAAe;CAChB;AACD;EACE,eAAe;CAChB;AACD;EACE,eAAe;CAChB;AACD;EACE,eAAe;CAChB;AACD;EACE,eAAe;CAChB;AACD;;EAEE,YAAY;CACb;AACD;;EAEE,sBAAsB;CACvB;AACD;;EAEE,sBAAsB;EACtB,cAAc;CACf;AACD;EACE,kBAAkB;EAClB,mBAAmB;CACpB;AACD;EACE,gBAAgB;CACjB;AACD;EACE,iBAAiB;EACjB,eAAe;EACf,wBAAwB;EACxB,mBAAmB;EACnB,0BAA0B;EAC1B,iBAAiB;EACjB,gBAAgB;CACjB;AACD;EACE,mBAAmB;EACnB,sBAAsB;EACtB,2BAA2B;EAC3B,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,eAAe;EACf,oBAAoB;EACpB,mBAAmB;EACnB,oBAAoB;EACpB,iBAAiB;EACjB,gBAAgB;EAChB,wBAAwB;CACzB;AACD;EACE,gBAAgB;EAChB,iBAAiB;EACjB,mBAAmB;EACnB,SAAS;EACT,OAAO;EACP,UAAU;EACV,iBAAiB;EACjB,oBAAoB;EACpB,YAAY;EACZ,mBAAmB;EACnB,kBAAkB;EAClB,kCAAkC;EAClC,0BAA0B;EAC1B,mBAAmB;CACpB;AACD;EACE,eAAa;EACb,eAAe;EACf,gBAAgB;CACjB;AACD;;EAEE,oBAAoB;CACrB;AACD;;EAEE,aAAa;CACd;AACD;EACE,kBAAkB;EAClB,iBAAiB;EACjB,+BAA+B;UACvB,uBAAuB;EAC/B,eAAe;EACf,iBAAiB;EACjB,oBAAoB;EACpB,oBAAoB;EACpB,oBAAoB;EACpB,UAAU;EACV,sBAAsB;EACtB,mBAAmB;EACnB,0BAA0B;EAC1B,gBAAgB;CACjB;AACD;EACE,kBAAkB;EAClB,eAAe;EACf,mBAAmB;EACnB,+BAA+B;UACvB,uBAAuB;EAC/B,YAAY;EACZ,aAAa;EACb,WAAW;EACX,SAAS;EACT,iBAAiB;EACjB,UAAU;EACV,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,gDAAgD;EAChD,wCAAwC;EACxC,gCAAgC;EAChC,6DAA6D;CAC9D;AACD;EACE,mBAAmB;EACnB,SAAS;EACT,SAAS;EACT,YAAY;EACZ,gBAAgB;EAChB,oBAAoB;EACpB,4BAA4B;EAC5B,0DAA0D;EAC1D,YAAY;CACb;AACD;EACE,eAAe;EACf,sBAAsB;EACtB,oBAAoB;EACpB,iBAAiB;CAClB;AACD;EACE,cAAc;CACf;AACD;EACE,mBAAmB;EACnB,eAAe;EACf,iBAAiB;EACjB,YAAY;EACZ,kBAAkB;EAClB,eAAe;EACf,0BAA0B;EAC1B,iBAAiB;EACjB,+BAA+B;EAC/B,gCAAgC;EAChC,YAAY;EACZ,kCAAkC;CACnC;AACD;EACE,iBAAiB;EACjB,sBAAsB;EACtB,WAAW;EACX,UAAU;EACV,gBAAgB;EAChB,oBAAoB;CACrB;AACD;EACE,aAAa;EACb,6BAA6B;EAC7B,8BAA8B;EAC9B,4BAA4B;EAC5B,6BAA6B;EAC7B,oBAAoB;EACpB,8BAA8B;CAC/B;AACD;EACE,cAAc;CACf;AACD;EACE,eAAe;CAChB;AACD;EACE,eAAe;EACf,cAAc;EACd,iBAAiB;EACjB,kBAAkB;EAClB,sBAAsB;EACtB,qBAAqB;EACrB,uBAAuB;EACvB,mBAAmB;EACnB,gBAAgB;EAChB,oBAAoB;CACrB;AACD;EACE,OAAO;EACP,SAAS;EACT,mBAAmB;EACnB,kBAAkB;EAClB,oBAAoB;EACpB,mBAAmB;EACnB,gBAAgB;CACjB;AACD;EACE,oBAAoB;EACpB,cAAc;EACd,aAAa;CACd;AACD;EACE,2BAA2B;EAC3B,oBAAoB;EACpB,aAAa;CACd;AACD;EACE,oBAAoB;EACpB,eAAe;EACf,kBAAkB;CACnB;AACD;EACE,6BAA6B;EAC7B,cAAc;EACd,oBAAoB;CACrB;AACD;EACE,oBAAoB;EACpB,YAAY;CACb;AACD;EACE,oBAAoB;EACpB,6BAA6B;EAC7B,YAAY;CACb;AACD;;EAEE,oBAAoB;EACpB,eAAe;CAChB;AACD;EACE,+BAA+B;EAC/B,0BAA0B;EAC1B,aAAa;EACb,qBAAqB;CACtB;AACD;EACE,oBAAoB;EACpB,eAAe;CAChB;AACD;EACE,oBAAoB;EACpB,YAAY;CACb;AACD;EACE,oBAAoB;CACrB;AACD;EACE,oBAAoB;CACrB;AACD;EACE,oBAAoB;EACpB,YAAY;CACb;AACD;EACE,oBAAoB;EACpB,6BAA6B;EAC7B,YAAY;CACb;AACD;;EAEE,mCAAmC;EACnC,2BAA2B;CAC5B;AACD;;EAEE,WAAW;CACZ;AACD;EACE,mBAAmB;EACnB,kBAAkB;EAClB,sBAAsB;EACtB,oBAAoB;CACrB;AACD;EACE,kBAAkB;CACnB;AACD;EACE,YAAY;EACZ,UAAU;CACX;AACD;EACE,0BAA0B;CAC3B;AACD;EACE,kBAAkB;CACnB;AACD;EACE,YAAY;EACZ,QAAQ;CACT;AACD;EACE,YAAY;EACZ,WAAW;CACZ;AACD;EACE,YAAY;EACZ,UAAU;CACX;AACD;AACA;IACI,6BAA6B;YACrB,qBAAqB;CAChC;AACD;IACI,iCAAiC;YACzB,yBAAyB;CACpC;CACA;AACD;AACA;IACI,6BAA6B;YACrB,qBAAqB;CAChC;AACD;IACI,iCAAiC;YACzB,yBAAyB;CACpC;CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzbD;EACE,sBAAsB;EACtB,kBAAkB;EAClB,oBAAoB;EACpB,kBAAkB;EAClB,mBAAmB;EACnB,oBAAoB;EACpB,gBAAgB;CACjB;AACD;IACI,oBAAoB;CACvB;AACD;IACI,oBAAoB;CACvB;AACD;EACE,aAAa;EACb,gBAAgB;EAChB,iBAAiB;CAClB;;ACnBD;EACE,mBAAmB;EACnB,YAAY;EACZ,aAAa;EACb,YAAY;EACZ,eAAe;EACf,gBAAgB;EAChB,WAAW;CACZ;AACD;IACI,YAAY;IACZ,eAAe;IACf,mBAAmB;IACnB,WAAW;IACX,aAAa;IACb,iBAAiB;IACjB,UAAU;IACV,WAAW;CACd;AACD;IACI,iCAAiC;YACzB,yBAAyB;CACpC;AACD;IACI,kCAAkC;YAC1B,0BAA0B;CACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1BD;EACE,iBAAiB;EACjB,mBAAmB;EACnB,sBAAsB;EACtB,uBAAuB;CACxB;AACD;EACE,sBAAsB;EACtB,uBAAuB;EACvB,mBAAmB;CACpB;AACD;EACE,qBAAqB;CACtB;AACD;EACE,sBAAsB;EACtB,eAAe;CAChB;;ACjBD;EACE,2BAA2B;CAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACFD;CACC,2BAA2B;CAC3B;;ACFD;EACE,uBAAuB;EACvB,aAAa;CACd;AACD;EACE,uBAAuB;EACvB,sBAAsB;EACtB,iBAAiB;EACjB,YAAY;CACb","file":"static/css/app.785fdcfba171d7f1dd8db2283193eb6f.css","sourcesContent":["\nfieldset[disabled] .multiselect {\n pointer-events: none;\n}\n.multiselect__spinner {\n position: absolute;\n right: 1px;\n top: 1px;\n width: 40px;\n height: 38px;\n background: #fff;\n display: block;\n}\n.multiselect__spinner:before,\n.multiselect__spinner:after {\n position: absolute;\n content: \"\";\n top: 50%;\n left: 50%;\n margin: -8px 0 0 -8px;\n width: 16px;\n height: 16px;\n border-radius: 100%;\n border-color: #41b883 transparent transparent;\n border-style: solid;\n border-width: 2px;\n -webkit-box-shadow: 0 0 0 1px transparent;\n box-shadow: 0 0 0 1px transparent;\n}\n.multiselect__spinner:before {\n -webkit-animation: spinning 2.4s cubic-bezier(0.41, 0.26, 0.2, 0.62);\n animation: spinning 2.4s cubic-bezier(0.41, 0.26, 0.2, 0.62);\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n}\n.multiselect__spinner:after {\n -webkit-animation: spinning 2.4s cubic-bezier(0.51, 0.09, 0.21, 0.8);\n animation: spinning 2.4s cubic-bezier(0.51, 0.09, 0.21, 0.8);\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n}\n.multiselect__loading-enter-active,\n.multiselect__loading-leave-active {\n -webkit-transition: opacity 0.4s ease-in-out;\n transition: opacity 0.4s ease-in-out;\n opacity: 1;\n}\n.multiselect__loading-enter,\n.multiselect__loading-leave-active {\n opacity: 0;\n}\n.multiselect,\n.multiselect__input,\n.multiselect__single {\n font-family: inherit;\n font-size: 16px;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n}\n.multiselect {\n -webkit-box-sizing: content-box;\n box-sizing: content-box;\n display: block;\n position: relative;\n width: 100%;\n min-height: 40px;\n text-align: left;\n color: #35495e;\n}\n.multiselect * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n.multiselect:focus {\n outline: none;\n}\n.multiselect--disabled {\n background: #ededed;\n pointer-events: none;\n opacity: 0.6;\n}\n.multiselect--active {\n z-index: 50;\n}\n.multiselect--active:not(.multiselect--above) .multiselect__current,\n.multiselect--active:not(.multiselect--above) .multiselect__input,\n.multiselect--active:not(.multiselect--above) .multiselect__tags {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n}\n.multiselect--active .multiselect__select {\n -webkit-transform: rotateZ(180deg);\n transform: rotateZ(180deg);\n}\n.multiselect--above.multiselect--active .multiselect__current,\n.multiselect--above.multiselect--active .multiselect__input,\n.multiselect--above.multiselect--active .multiselect__tags {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n.multiselect__input,\n.multiselect__single {\n position: relative;\n display: inline-block;\n min-height: 20px;\n line-height: 20px;\n border: none;\n border-radius: 5px;\n background: #fff;\n padding: 0 0 0 5px;\n width: calc(100%);\n -webkit-transition: border 0.1s ease;\n transition: border 0.1s ease;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n margin-bottom: 8px;\n vertical-align: top;\n}\n.multiselect__input::-webkit-input-placeholder {\n color: #35495e;\n}\n.multiselect__input::-moz-placeholder {\n color: #35495e;\n}\n.multiselect__input:-ms-input-placeholder {\n color: #35495e;\n}\n.multiselect__input::-ms-input-placeholder {\n color: #35495e;\n}\n.multiselect__input::placeholder {\n color: #35495e;\n}\n.multiselect__tag ~ .multiselect__input,\n.multiselect__tag ~ .multiselect__single {\n width: auto;\n}\n.multiselect__input:hover,\n.multiselect__single:hover {\n border-color: #cfcfcf;\n}\n.multiselect__input:focus,\n.multiselect__single:focus {\n border-color: #a8a8a8;\n outline: none;\n}\n.multiselect__single {\n padding-left: 5px;\n margin-bottom: 8px;\n}\n.multiselect__tags-wrap {\n display: inline;\n}\n.multiselect__tags {\n min-height: 40px;\n display: block;\n padding: 8px 40px 0 8px;\n border-radius: 5px;\n border: 1px solid #e8e8e8;\n background: #fff;\n font-size: 14px;\n}\n.multiselect__tag {\n position: relative;\n display: inline-block;\n padding: 4px 26px 4px 10px;\n border-radius: 5px;\n margin-right: 10px;\n color: #fff;\n line-height: 1;\n background: #41b883;\n margin-bottom: 5px;\n white-space: nowrap;\n overflow: hidden;\n max-width: 100%;\n text-overflow: ellipsis;\n}\n.multiselect__tag-icon {\n cursor: pointer;\n margin-left: 7px;\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n font-weight: 700;\n font-style: initial;\n width: 22px;\n text-align: center;\n line-height: 22px;\n -webkit-transition: all 0.2s ease;\n transition: all 0.2s ease;\n border-radius: 5px;\n}\n.multiselect__tag-icon:after {\n content: \"×\";\n color: #266d4d;\n font-size: 14px;\n}\n.multiselect__tag-icon:focus,\n.multiselect__tag-icon:hover {\n background: #369a6e;\n}\n.multiselect__tag-icon:focus:after,\n.multiselect__tag-icon:hover:after {\n color: white;\n}\n.multiselect__current {\n line-height: 16px;\n min-height: 40px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: block;\n overflow: hidden;\n padding: 8px 12px 0;\n padding-right: 30px;\n white-space: nowrap;\n margin: 0;\n text-decoration: none;\n border-radius: 5px;\n border: 1px solid #e8e8e8;\n cursor: pointer;\n}\n.multiselect__select {\n line-height: 16px;\n display: block;\n position: absolute;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n width: 40px;\n height: 38px;\n right: 1px;\n top: 1px;\n padding: 4px 8px;\n margin: 0;\n text-decoration: none;\n text-align: center;\n cursor: pointer;\n -webkit-transition: -webkit-transform 0.2s ease;\n transition: -webkit-transform 0.2s ease;\n transition: transform 0.2s ease;\n transition: transform 0.2s ease, -webkit-transform 0.2s ease;\n}\n.multiselect__select:before {\n position: relative;\n right: 0;\n top: 65%;\n color: #999;\n margin-top: 4px;\n border-style: solid;\n border-width: 5px 5px 0 5px;\n border-color: #999999 transparent transparent transparent;\n content: \"\";\n}\n.multiselect__placeholder {\n color: #adadad;\n display: inline-block;\n margin-bottom: 10px;\n padding-top: 2px;\n}\n.multiselect--active .multiselect__placeholder {\n display: none;\n}\n.multiselect__content-wrapper {\n position: absolute;\n display: block;\n background: #fff;\n width: 100%;\n max-height: 240px;\n overflow: auto;\n border: 1px solid #e8e8e8;\n border-top: none;\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n z-index: 50;\n -webkit-overflow-scrolling: touch;\n}\n.multiselect__content {\n list-style: none;\n display: inline-block;\n padding: 0;\n margin: 0;\n min-width: 100%;\n vertical-align: top;\n}\n.multiselect--above .multiselect__content-wrapper {\n bottom: 100%;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n border-bottom: none;\n border-top: 1px solid #e8e8e8;\n}\n.multiselect__content::webkit-scrollbar {\n display: none;\n}\n.multiselect__element {\n display: block;\n}\n.multiselect__option {\n display: block;\n padding: 12px;\n min-height: 40px;\n line-height: 16px;\n text-decoration: none;\n text-transform: none;\n vertical-align: middle;\n position: relative;\n cursor: pointer;\n white-space: nowrap;\n}\n.multiselect__option:after {\n top: 0;\n right: 0;\n position: absolute;\n line-height: 40px;\n padding-right: 12px;\n padding-left: 20px;\n font-size: 13px;\n}\n.multiselect__option--highlight {\n background: #41b883;\n outline: none;\n color: white;\n}\n.multiselect__option--highlight:after {\n content: attr(data-select);\n background: #41b883;\n color: white;\n}\n.multiselect__option--selected {\n background: #f3f3f3;\n color: #35495e;\n font-weight: bold;\n}\n.multiselect__option--selected:after {\n content: attr(data-selected);\n color: silver;\n background: inherit;\n}\n.multiselect__option--selected.multiselect__option--highlight {\n background: #ff6a6a;\n color: #fff;\n}\n.multiselect__option--selected.multiselect__option--highlight:after {\n background: #ff6a6a;\n content: attr(data-deselect);\n color: #fff;\n}\n.multiselect--disabled .multiselect__current,\n.multiselect--disabled .multiselect__select {\n background: #ededed;\n color: #a6a6a6;\n}\n.multiselect__option--disabled {\n background: #ededed !important;\n color: #a6a6a6 !important;\n cursor: text;\n pointer-events: none;\n}\n.multiselect__option--group {\n background: #ededed;\n color: #35495e;\n}\n.multiselect__option--group.multiselect__option--highlight {\n background: #35495e;\n color: #fff;\n}\n.multiselect__option--group.multiselect__option--highlight:after {\n background: #35495e;\n}\n.multiselect__option--disabled.multiselect__option--highlight {\n background: #dedede;\n}\n.multiselect__option--group-selected.multiselect__option--highlight {\n background: #ff6a6a;\n color: #fff;\n}\n.multiselect__option--group-selected.multiselect__option--highlight:after {\n background: #ff6a6a;\n content: attr(data-deselect);\n color: #fff;\n}\n.multiselect-enter-active,\n.multiselect-leave-active {\n -webkit-transition: all 0.15s ease;\n transition: all 0.15s ease;\n}\n.multiselect-enter,\n.multiselect-leave-active {\n opacity: 0;\n}\n.multiselect__strong {\n margin-bottom: 8px;\n line-height: 20px;\n display: inline-block;\n vertical-align: top;\n}\n*[dir=\"rtl\"] .multiselect {\n text-align: right;\n}\n*[dir=\"rtl\"] .multiselect__select {\n right: auto;\n left: 1px;\n}\n*[dir=\"rtl\"] .multiselect__tags {\n padding: 8px 8px 0px 40px;\n}\n*[dir=\"rtl\"] .multiselect__content {\n text-align: right;\n}\n*[dir=\"rtl\"] .multiselect__option:after {\n right: auto;\n left: 0;\n}\n*[dir=\"rtl\"] .multiselect__clear {\n right: auto;\n left: 12px;\n}\n*[dir=\"rtl\"] .multiselect__spinner {\n right: auto;\n left: 1px;\n}\n@-webkit-keyframes spinning {\nfrom {\n -webkit-transform: rotate(0);\n transform: rotate(0);\n}\nto {\n -webkit-transform: rotate(2turn);\n transform: rotate(2turn);\n}\n}\n@keyframes spinning {\nfrom {\n -webkit-transform: rotate(0);\n transform: rotate(0);\n}\nto {\n -webkit-transform: rotate(2turn);\n transform: rotate(2turn);\n}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/Multiselect.vue","\n.custom__tag {\n display: inline-block;\n padding: 3px 12px;\n background: #d2d7ff;\n margin-right: 8px;\n margin-bottom: 8px;\n border-radius: 10px;\n cursor: pointer;\n}\n.custom__tag:nth-child(even) {\n background: #daffee;\n}\n.custom__tag:hover {\n background: #eaeaea;\n}\n.custom__remove {\n padding: 0px;\n font-size: 10px;\n margin-left: 5px;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./documentation/partials/examples/MultiSelect.vue","\n.multiselect__clear {\n position: absolute;\n right: 41px;\n height: 40px;\n width: 40px;\n display: block;\n cursor: pointer;\n z-index: 3;\n}\n.multiselect__clear:before, .multiselect__clear:after {\n content: \"\";\n display: block;\n position: absolute;\n width: 3px;\n height: 16px;\n background: #aaa;\n top: 12px;\n right: 4px;\n}\n.multiselect__clear:before {\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n}\n.multiselect__clear:after {\n -webkit-transform: rotate(-45deg);\n transform: rotate(-45deg);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./documentation/partials/examples/AjaxSearch.vue","\n.option__image {\n max-height: 80px;\n margin-right: 10px;\n display: inline-block;\n vertical-align: middle;\n}\n.option__desc {\n display: inline-block;\n vertical-align: middle;\n padding: rem(10px);\n}\n.option__title {\n font-size: rem(24px);\n}\n.option__small {\n margin-top: rem(10px);\n display: block;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./documentation/partials/examples/CustomOption.vue","\n.form__label {\n margin-top: 5px !important;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./documentation/partials/examples/CustomConfig.vue","\n.form__label {\n\tmargin-top: 5px !important;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./documentation/partials/examples/ProgrammaticCtrl.vue","\n.badge__img {\n vertical-align: middle;\n float: right;\n}\n.badge__name {\n vertical-align: middle;\n display: inline-block;\n margin-left: 5px;\n float: left;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./documentation/MultiselectExample.vue"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/app.f7ff199ab89fb9e630e4.js b/docs/static/js/app.f7ff199ab89fb9e630e4.js new file mode 100644 index 00000000..f62da680 --- /dev/null +++ b/docs/static/js/app.f7ff199ab89fb9e630e4.js @@ -0,0 +1,2 @@ +webpackJsonp([1],[,,,,,,,function(e,t,n){"use strict";function a(e){n(200)}var i=n(89),s=n(227),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";t.a={props:["langs","current"],methods:{select:function(e){this.$emit("select",e)}}}},function(e,t,n){"use strict";var a=n(28),i=(n.n(a),n(7));t.a={components:{Multiselect:i.a},data:function(){return{badges:[{img:"https://camo.githubusercontent.com/d0e25b09a82bc4bfde9f1e048a092752eebbb4f3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174",name:"License"},{img:"https://img.shields.io/github/stars/shentao/vue-multiselect.svg?label=Stars",name:"GitHub Stars"},{img:"https://camo.githubusercontent.com/64f9a2333bb303d34b1587e1436b24dee6a8e134/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f7675652d6d756c746973656c6563742e737667",name:"Npm Monthly Downloads"},{img:"https://camo.githubusercontent.com/47ff0923e959e736113988e900268dfc7a601d3b/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6f6e74657261696c2f7675652d6d756c746973656c6563742f747265652f6d61737465722e7376673f7374796c653d736869656c6426636972636c652d746f6b656e3d35633933316666323866643132353837363130663833353437326265636464353134643039636566",name:"Full Test Coverage"},{img:"https://img.shields.io/badge/dependencies-none-brightgreen.svg?style=flat",name:"NO Dependencies"}],value:[]}},methods:{onTagging:function(e){this.source.push({name:e,language:e}),this.value.push({name:e,language:e})}}}},function(e,t,n){"use strict";var a=n(7);t.a={components:{Multiselect:a.a},data:function(){return{actions:["alert","console.log","scrollTop"]}},methods:{dispatchAction:function(e){switch(e){case"alert":window.alert('You just dispatched "alert" action!');break;case"console.log":console.log('You just dispatched "console.log" action!');break;case"scrollTop":window.scrollTo(0,0)}}}}},function(e,t,n){"use strict";var a=n(7),i=n(136);t.a={components:{Multiselect:a.a},data:function(){return{selectedCountries:[],countries:[],isLoading:!1}},methods:{limitText:function(e){return"and ".concat(e," other countries")},asyncFind:function(e){var t=this;this.isLoading=!0,n.i(i.a)(e).then(function(e){t.countries=e,t.isLoading=!1})},clearAll:function(){this.selectedCountries=[]}}}},function(e,t,n){"use strict";var a=n(118),i=(n.n(a),n(7));t.a={components:{Multiselect:i.a},data:function(){return{isDisabled:!1,isTouched:!1,value:[],options:["Select option","Disable me!","Reset me!","mulitple","label","searchable"]}},computed:{isInvalid:function(){return this.isTouched&&0===this.value.length}},methods:{onChange:function(e){this.value=e,-1!==e.indexOf("Reset me!")&&(this.value=[])},onSelect:function(e){"Disable me!"===e&&(this.isDisabled=!0)},onTouch:function(){this.isTouched=!0}}}},function(e,t,n){"use strict";var a=n(27),i=(n.n(a),n(7));t.a={components:{Multiselect:i.a},data:function(){return{value:{title:"Explorer",desc:"Discovering new species!",img:"static/posters/creatures.png"},options:[{title:"Space Pirate",desc:"More space battles!",img:"static/posters/fleet.png"},{title:"Merchant",desc:"PROFIT!",img:"static/posters/trading_post.png"},{title:"Explorer",desc:"Discovering new species!",img:"static/posters/creatures.png"},{title:"Miner",desc:"We need to go deeper!",img:"static/posters/resource_lab.png"}]}},methods:{customLabel:function(e){var t=e.title,n=e.desc;return"".concat(t," – ").concat(n)}}}},function(e,t,n){"use strict";var a=n(7);t.a={components:{Multiselect:a.a},data:function(){return{options:[{language:"Javascript",libs:[{name:"Vue.js",category:"Front-end"},{name:"Adonis",category:"Backend"}]},{language:"Ruby",libs:[{name:"Rails",category:"Backend"},{name:"Sinatra",category:"Backend"}]},{language:"Other",libs:[{name:"Laravel",category:"Backend"},{name:"Phoenix",category:"Backend"}]}],value:[]}}}},function(e,t,n){"use strict";var a=n(7);t.a={components:{Multiselect:a.a},data:function(){return{value:[],options:[{name:"Vue.js",language:"JavaScript"},{name:"Adonis",language:"JavaScript"},{name:"Rails",language:"Ruby"},{name:"Sinatra",language:"Ruby"},{name:"Laravel",language:"PHP"},{name:"Phoenix",language:"Elixir"}]}}}},function(e,t,n){"use strict";var a=n(43),i=(n.n(a),n(42)),s=(n.n(i),n(70)),o=(n.n(s),n(7));t.a={components:{Multiselect:o.a},data:function(){return{isOpen:!1,value:[],options:["Select option","Option 1","Option 2","Option 3","Option 4","Option 5"]}},methods:{toggle:function(){var e=this;this.$refs.multiselect.$el.focus(),setTimeout(function(){e.$refs.multiselect.$refs.search.blur()},1e3)},open:function(){this.$refs.multiselect.activate()},close:function(){this.$refs.multiselect.deactivate()}}}},function(e,t,n){"use strict";var a=n(7);t.a={components:{Multiselect:a.a},data:function(){return{value:null,options:[{name:"Vue.js",language:"JavaScript"},{name:"Rails",language:"Ruby"},{name:"Sinatra",language:"Ruby"},{name:"Laravel",language:"PHP",$isDisabled:!0},{name:"Phoenix",language:"Elixir"}]}}}},function(e,t,n){"use strict";var a=n(7);t.a={components:{Multiselect:a.a},data:function(){return{value:"",options:["Select option","options","selected","multiple","label","searchable","clearOnSelect","hideSelected","maxHeight","allowEmpty","showLabels","onChange","touched"]}}}},function(e,t,n){"use strict";var a=n(122),i=(n.n(a),n(27)),s=(n.n(i),n(7));t.a={components:{Multiselect:s.a},data:function(){return{value:{name:"Vue.js",language:"JavaScript"},options:[{name:"Vue.js",language:"JavaScript"},{name:"Rails",language:"Ruby"},{name:"Sinatra",language:"Ruby"},{name:"Laravel",language:"PHP"},{name:"Phoenix",language:"Elixir"}]}},methods:{nameWithLang:function(e){var t=e.name,n=e.language;return"".concat(t," — [").concat(n,"]")}}}},function(e,t,n){"use strict";var a=n(28),i=(n.n(a),n(7));t.a={components:{Multiselect:i.a},data:function(){return{value:[{name:"Javascript",code:"js"}],options:[{name:"Vue.js",code:"vu"},{name:"Javascript",code:"js"},{name:"Open Source",code:"os"}]}},methods:{addTag:function(e){var t={name:e,code:e.substring(0,2)+Math.floor(1e7*Math.random())};this.options.push(t),this.value.push(t)}}}},function(e,t,n){"use strict";var a=n(71),i=n(73),s=n.n(i),o=n(235),l=n(7),r=o.a.mapActions,c=o.a.mapState;s.a.use(o.a);var u=new o.a.Store({state:{value:"Vuex",options:["Vuex","Vue","Vuelidate","Vue-Multiselect","Vue-Router"]},mutations:{updateValue:function(e,t){e.value=t}},actions:{updateValueAction:function(e,t){(0,e.commit)("updateValue",t)}}});t.a={store:u,components:{Multiselect:l.a},computed:n.i(a.a)({},c(["value","options"])),methods:n.i(a.a)({},r(["updateValueAction"]))}},function(e,t,n){"use strict";var a=n(68),i=(n.n(a),n(119)),s=(n.n(i),n(137)),o=n(138);t.a={name:"vue-multiselect",mixins:[s.a,o.a],props:{name:{type:String,default:""},selectLabel:{type:String,default:"Press enter to select"},selectGroupLabel:{type:String,default:"Press enter to select group"},selectedLabel:{type:String,default:"Selected"},deselectLabel:{type:String,default:"Press enter to remove"},deselectGroupLabel:{type:String,default:"Press enter to deselect group"},showLabels:{type:Boolean,default:!0},limit:{type:Number,default:99999},maxHeight:{type:Number,default:300},limitText:{type:Function,default:function(e){return"and ".concat(e," more")}},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDirection:{type:String,default:""},showNoOptions:{type:Boolean,default:!0},showNoResults:{type:Boolean,default:!0},tabindex:{type:Number,default:0}},computed:{hasOptionGroup:function(){return this.groupValues&&this.groupLabel&&this.groupSelect},isSingleLabelVisible:function(){return(this.singleValue||0===this.singleValue)&&(!this.isOpen||!this.searchable)&&!this.visibleValues.length},isPlaceholderVisible:function(){return!(this.internalValue.length||this.searchable&&this.isOpen)},visibleValues:function(){return this.multiple?this.internalValue.slice(0,this.limit):[]},singleValue:function(){return this.internalValue[0]},deselectLabelText:function(){return this.showLabels?this.deselectLabel:""},deselectGroupLabelText:function(){return this.showLabels?this.deselectGroupLabel:""},selectLabelText:function(){return this.showLabels?this.selectLabel:""},selectGroupLabelText:function(){return this.showLabels?this.selectGroupLabel:""},selectedLabelText:function(){return this.showLabels?this.selectedLabel:""},inputStyle:function(){return this.searchable||this.multiple&&this.value&&this.value.length?this.isOpen?{width:"100%"}:{width:"0",position:"absolute",padding:"0"}:""},contentStyle:function(){return this.options.length?{display:"inline-block"}:{display:"block"}},isAbove:function(){return"above"===this.openDirection||"top"===this.openDirection||"below"!==this.openDirection&&"bottom"!==this.openDirection&&"above"===this.preferredOpenDirection},showSearchInput:function(){return this.searchable&&(!this.hasSingleSelectedSlot||!this.visibleSingleValue&&0!==this.visibleSingleValue||this.isOpen)}}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(215),i=n(214),s=n(216),o=n(212),l=n(208),r=n(217),c=n(210),u=n(218),d=n(209),p=n(211),h=n(207),m=n(213);n.d(t,"SingleSelectPrimitive",function(){return a.a}),n.d(t,"SingleSelectObject",function(){return i.a}),n.d(t,"SingleSelectSearch",function(){return s.a}),n.d(t,"MultiSelect",function(){return o.a}),n.d(t,"AjaxSearch",function(){return l.a}),n.d(t,"Tagging",function(){return r.a}),n.d(t,"CustomOption",function(){return c.a}),n.d(t,"VuexActions",function(){return u.a}),n.d(t,"CustomConfig",function(){return d.a}),n.d(t,"Groups",function(){return p.a}),n.d(t,"ActionDispatcher",function(){return h.a}),n.d(t,"ProgrammaticCtrl",function(){return m.a})},,,,function(e,t){},function(e,t,n){"use strict";var a=n(75),i=n(232),s=n(6),o=s(a.a,i.a,!1,null,null,null);t.a=o.exports},function(e,t,n){"use strict";function a(e){n(199)}var i=n(76),s=n(224),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},function(e,t){e.exports=[{name:"Afghanistan",code:"AF"},{name:"Åland Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:'Cote D"Ivoire',code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia and Montenegro",code:"CS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}]},,,function(e,t,n){"use strict";function a(){b=Array.from(document.querySelectorAll("[data-section]")).map(function(e){return{id:e.id,offset:e.getBoundingClientRect().top+window.pageYOffset-50}})}Object.defineProperty(t,"__esModule",{value:!0});var i=n(71),s=n(72),o=(n.n(s),n(126)),l=(n.n(o),n(127)),r=(n.n(l),n(27)),c=(n.n(r),n(28)),u=(n.n(c),n(43)),d=(n.n(u),n(73)),p=n.n(d),h=n(125),m=n(130),f=n(131),g=n(7),v=n(129);n.n(v);n(128).polyfill();var b,_=", 100%, 85%";new p.a({el:"#app",components:n.i(i.a)(n.i(i.a)({},h),{},{MultiselectExample:f.a,LangSwitcher:m.a,Multiselect:g.a}),data:function(){return{markupLangs:["pug","html"],markupLanguage:"pug",isNavSticky:!1,firstColor:Math.floor(255*Math.random()),secondColor:Math.floor(255*Math.random()),currentPosition:"",versions:["v1.x","v2.0"],version:"v2.0"}},computed:{gradient:function(){return{background:"linear-gradient(to left bottom, hsl(".concat(this.firstColor+_,") 0%, hsl(").concat(this.secondColor+_,") 100%)")}}},methods:{pickVersion:function(e){switch(e){case"v1.x":window.location.assign("v1/index.html");break;case"v2.0":window.location.assign("https://vue-multiselect.js.org/")}},selectLanguage:function(e){this.markupLanguage=e},adjustNav:function(){this.isNavSticky=window.scrollY>window.innerHeight,b||a();for(var e=b.length-1;e>=0;e--)if(window.scrollY>b[e].offset){this.currentPosition=b[e].id;break}},onTagging:function(e){this.source.push({name:e,language:e}),this.value.push({name:e,language:e})}},mounted:function(){this.adjustNav(),window.addEventListener("scroll",this.adjustNav),setTimeout(function(){a()},1e3)}})},function(e,t,n){"use strict";function a(e){return new Promise(function(t,n){setTimeout(function(){var n=d.a.filter(function(t,n,a){return t.name.toLowerCase().includes(e.toLowerCase())});t(n)},1e3)})}t.a=a;var i=n(69),s=(n.n(i),n(43)),o=(n.n(s),n(116)),l=(n.n(o),n(185)),r=(n.n(l),n(190)),c=(n.n(r),n(122)),u=(n.n(c),n(132)),d=n.n(u)},function(e,t,n){"use strict";function a(e){return 0!==e&&(!(!Array.isArray(e)||0!==e.length)||!e)}function i(e){return function(){return!e.apply(void 0,arguments)}}function s(e,t){return void 0===e&&(e="undefined"),null===e&&(e="null"),!1===e&&(e="false"),-1!==e.toString().toLowerCase().indexOf(t.trim())}function o(e,t,n,a){return e.filter(function(e){return s(a(e,n),t)})}function l(e){return e.filter(function(e){return!e.$isLabel})}function r(e,t){return function(n){return n.reduce(function(n,a){return a[e]&&a[e].length?(n.push({$groupLabel:a[t],$isLabel:!0}),n.concat(a[e])):n},[])}}function c(e,t,a,i,s){return function(l){return l.map(function(l){var r;if(!l[a])return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."),[];var c=o(l[a],e,t,s);return c.length?(r={},n.i(d.a)(r,i,l[i]),n.i(d.a)(r,a,c),r):[]})}}var u=n(44),d=n(74),p=n(186),h=(n.n(p),n(121)),m=(n.n(h),n(120)),f=(n.n(m),n(69)),g=(n.n(f),n(123)),v=(n.n(g),n(118)),b=(n.n(v),n(191)),_=(n.n(b),n(116)),y=(n.n(_),n(187)),S=(n.n(y),n(28)),C=(n.n(S),n(27)),w=(n.n(C),n(72)),k=(n.n(w),n(68)),x=(n.n(k),n(42)),O=(n.n(x),n(70)),L=(n.n(O),n(189)),M=(n.n(L),n(119)),T=(n.n(M),n(117)),V=(n.n(T),n(188)),A=(n.n(V),n(184)),P=(n.n(A),function(){for(var e=arguments.length,t=new Array(e),n=0;n-1},isSelected:function(e){var t=this.trackBy?e[this.trackBy]:e;return this.valueKeys.indexOf(t)>-1},isOptionDisabled:function(e){return!!e.$isDisabled},getOptionLabel:function(e){if(a(e))return"";if(e.isTag)return e.label;if(e.$isLabel)return e.$groupLabel;var t=this.customLabel(e,this.label);return a(t)?"":t},select:function(e,t){if(e.$isLabel&&this.groupSelect)return void this.selectGroup(e);if(!(-1!==this.blockKeys.indexOf(t)||this.disabled||e.$isDisabled||e.$isLabel)&&(!this.max||!this.multiple||this.internalValue.length!==this.max)&&("Tab"!==t||this.pointerDirty)){if(e.isTag)this.$emit("tag",e.label,this.id),this.search="",this.closeOnSelect&&!this.multiple&&this.deactivate();else{if(this.isSelected(e))return void("Tab"!==t&&this.removeElement(e));this.multiple?this.$emit("input",this.internalValue.concat([e]),this.id):this.$emit("input",e,this.id),this.$emit("select",e,this.id),this.clearOnSelect&&(this.search="")}this.closeOnSelect&&this.deactivate()}},selectGroup:function(e){var t=this,n=this.options.find(function(n){return n[t.groupLabel]===e.$groupLabel});if(n){if(this.wholeGroupSelected(n)){this.$emit("remove",n[this.groupValues],this.id);var a=this.internalValue.filter(function(e){return-1===n[t.groupValues].indexOf(e)});this.$emit("input",a,this.id)}else{var i=n[this.groupValues].filter(function(e){return!(t.isOptionDisabled(e)||t.isSelected(e))});this.max&&i.splice(this.max-this.internalValue.length),this.$emit("select",i,this.id),this.$emit("input",this.internalValue.concat(i),this.id)}this.closeOnSelect&&this.deactivate()}},wholeGroupSelected:function(e){var t=this;return e[this.groupValues].every(function(e){return t.isSelected(e)||t.isOptionDisabled(e)})},wholeGroupDisabled:function(e){return e[this.groupValues].every(this.isOptionDisabled)},removeElement:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.disabled&&!e.$isDisabled){if(!this.allowEmpty&&this.internalValue.length<=1)return void this.deactivate();var a="object"===n.i(u.a)(e)?this.valueKeys.indexOf(e[this.trackBy]):this.valueKeys.indexOf(e);if(this.multiple){var i=this.internalValue.slice(0,a).concat(this.internalValue.slice(a+1));this.$emit("input",i,this.id)}else this.$emit("input",null,this.id);this.$emit("remove",e,this.id),this.closeOnSelect&&t&&this.deactivate()}},removeLastElement:function(){-1===this.blockKeys.indexOf("Delete")&&0===this.search.length&&Array.isArray(this.internalValue)&&this.internalValue.length&&this.removeElement(this.internalValue[this.internalValue.length-1],!1)},activate:function(){var e=this;this.isOpen||this.disabled||(this.adjustPosition(),this.groupValues&&0===this.pointer&&this.filteredOptions.length&&(this.pointer=1),this.isOpen=!0,this.searchable?(this.preserveSearch||(this.search=""),this.preventAutofocus||this.$nextTick(function(){return e.$refs.search&&e.$refs.search.focus()})):this.preventAutofocus||void 0!==this.$el&&this.$el.focus(),this.$emit("open",this.id))},deactivate:function(){this.isOpen&&(this.isOpen=!1,this.searchable?void 0!==this.$refs.search&&this.$refs.search.blur():void 0!==this.$el&&this.$el.blur(),this.preserveSearch||(this.search=""),this.$emit("close",this.getValue(),this.id))},toggle:function(){this.isOpen?this.deactivate():this.activate()},adjustPosition:function(){if("undefined"!=typeof window){var e=this.$el.getBoundingClientRect().top,t=window.innerHeight-this.$el.getBoundingClientRect().bottom;t>this.maxHeight||t>e||"below"===this.openDirection||"bottom"===this.openDirection?(this.preferredOpenDirection="below",this.optimizedHeight=Math.min(t-40,this.maxHeight)):(this.preferredOpenDirection="above",this.optimizedHeight=Math.min(e-40,this.maxHeight))}}}}},function(e,t,n){"use strict";var a=n(68),i=(n.n(a),n(42)),s=(n.n(i),n(70)),o=(n.n(s),n(121)),l=(n.n(o),n(120)),r=(n.n(l),n(69)),c=(n.n(r),n(123)),u=(n.n(c),n(117));n.n(u);t.a={data:function(){return{pointer:0,pointerDirty:!1}},props:{showPointer:{type:Boolean,default:!0},optionHeight:{type:Number,default:40}},computed:{pointerPosition:function(){return this.pointer*this.optionHeight},visibleElements:function(){return this.optimizedHeight/this.optionHeight}},watch:{filteredOptions:function(){this.pointerAdjust()},isOpen:function(){this.pointerDirty=!1},pointer:function(){this.$refs.search&&this.$refs.search.setAttribute("aria-activedescendant",this.id+"-"+this.pointer.toString())}},methods:{optionHighlight:function(e,t){return{"multiselect__option--highlight":e===this.pointer&&this.showPointer,"multiselect__option--selected":this.isSelected(t)}},groupHighlight:function(e,t){var n=this;if(!this.groupSelect)return["multiselect__option--disabled",{"multiselect__option--group":t.$isLabel}];var a=this.options.find(function(e){return e[n.groupLabel]===t.$groupLabel});return a&&!this.wholeGroupDisabled(a)?["multiselect__option--group",{"multiselect__option--highlight":e===this.pointer&&this.showPointer},{"multiselect__option--group-selected":this.wholeGroupSelected(a)}]:"multiselect__option--disabled"},addPointerElement:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Enter",t=e.key;this.filteredOptions.length>0&&this.select(this.filteredOptions[this.pointer],t),this.pointerReset()},pointerForward:function(){this.pointer0?(this.pointer--,this.$refs.list.scrollTop>=this.pointerPosition&&(this.$refs.list.scrollTop=this.pointerPosition),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerBackward()):this.filteredOptions[this.pointer]&&this.filteredOptions[0].$isLabel&&!this.groupSelect&&this.pointerForward(),this.pointerDirty=!0},pointerReset:function(){this.closeOnSelect&&(this.pointer=0,this.$refs.list&&(this.$refs.list.scrollTop=0))},pointerAdjust:function(){this.pointer>=this.filteredOptions.length-1&&(this.pointer=this.filteredOptions.length?this.filteredOptions.length-1:0),this.filteredOptions.length>0&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()},pointerSet:function(e){this.pointer=e,this.pointerDirty=!0}}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,function(e,t,n){"use strict";var a=n(77),i=n(229),s=n(6),o=s(a.a,i.a,!1,null,null,null);t.a=o.exports},function(e,t,n){"use strict";function a(e){n(201)}var i=n(78),s=n(228),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},function(e,t,n){"use strict";function a(e){n(202)}var i=n(79),s=n(230),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},function(e,t,n){"use strict";function a(e){n(197)}var i=n(80),s=n(222),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},function(e,t,n){"use strict";function a(e){n(203)}var i=n(81),s=n(231),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},function(e,t,n){"use strict";function a(e){n(198)}var i=n(82),s=n(223),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},function(e,t,n){"use strict";function a(e){n(194)}var i=n(83),s=n(219),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},function(e,t,n){"use strict";function a(e){n(196)}var i=n(84),s=n(221),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},function(e,t,n){"use strict";var a=n(85),i=n(225),s=n(6),o=s(a.a,i.a,!1,null,null,null);t.a=o.exports},function(e,t,n){"use strict";function a(e){n(204)}var i=n(86),s=n(233),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},function(e,t,n){"use strict";function a(e){n(195)}var i=n(87),s=n(220),o=n(6),l=a,r=o(i.a,s.a,!1,l,null,null);t.a=r.exports},function(e,t,n){"use strict";var a=n(88),i=n(226),s=n(6),o=s(a.a,i.a,!1,null,null,null);t.a=o.exports},function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("button",{staticClass:"button button-small",on:{click:e.toggle}},[e._v("Toggle")]),e._v(" "),n("button",{staticClass:"button button-small",on:{click:e.open}},[e._v("Open")]),e._v(" "),n("button",{staticClass:"button button-small",on:{click:e.close}},[e._v("Close")]),e._v(" "),n("pre",[e._v("Multiselect Open: "+e._s(e.isOpen))]),n("label",{staticClass:"typo__label"},[e._v("Controlling multiselect programmatically")]),n("multiselect",{ref:"multiselect",attrs:{placeholder:"Pick at least one",value:e.value,options:e.options,multiple:!0,searchable:!0,"allow-empty":!1,"hide-selected":!0,"max-height":150,max:3},on:{open:function(t){e.isOpen=!0},close:function(t){e.isOpen=!1}}})],1)},i=[],s={render:a,staticRenderFns:i};t.a=s},function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("label",{staticClass:"typo__label"},[e._v("Tagging")]),n("multiselect",{attrs:{"tag-placeholder":"Add this as new tag",placeholder:"Search or add a tag",label:"name","track-by":"code",options:e.options,multiple:!0,taggable:!0},on:{tag:e.addTag},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}}),n("pre",{staticClass:"language-json"},[n("code",[e._v(e._s(e.value))])])],1)},i=[],s={render:a,staticRenderFns:i};t.a=s},function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("label",{staticClass:"typo__label"},[e._v("Single select / dropdown")]),n("multiselect",{attrs:{"deselect-label":"Can't remove this value","track-by":"name",label:"name",placeholder:"Select one",options:e.options,searchable:!1,"allow-empty":!1},scopedSlots:e._u([{key:"singleLabel",fn:function(t){var a=t.option;return[n("strong",[e._v(e._s(a.name))]),e._v(" is written in"),n("strong",[e._v(" "+e._s(a.language))])]}}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}}),n("pre",{staticClass:"language-json"},[n("code",[e._v(e._s(e.value))])])],1)},i=[],s={render:a,staticRenderFns:i};t.a=s},function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("label",{staticClass:"typo__label"},[e._v("Custom option template")]),n("multiselect",{attrs:{placeholder:"Fav No Man’s Sky path",label:"title","track-by":"title",options:e.options,"option-height":104,"custom-label":e.customLabel,"show-labels":!1},scopedSlots:e._u([{key:"singleLabel",fn:function(t){return[n("img",{staticClass:"option__image",attrs:{src:t.option.img,alt:"No Man’s Sky"}}),n("span",{staticClass:"option__desc"},[n("span",{staticClass:"option__title"},[e._v(e._s(t.option.title))])])]}},{key:"option",fn:function(t){return[n("img",{staticClass:"option__image",attrs:{src:t.option.img,alt:"No Man’s Sky"}}),n("div",{staticClass:"option__desc"},[n("span",{staticClass:"option__title"},[e._v(e._s(t.option.title))]),n("span",{staticClass:"option__small"},[e._v(e._s(t.option.desc))])])]}}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}}),n("pre",{staticClass:"language-json"},[n("code",[e._v(e._s(e.value))])])],1)},i=[],s={render:a,staticRenderFns:i};t.a=s},function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("label",{staticClass:"typo__label"},[e._v("Simple select / dropdown")]),n("multiselect",{attrs:{options:e.options,multiple:!0,"close-on-select":!1,"clear-on-select":!1,"preserve-search":!0,placeholder:"Pick some",label:"name","track-by":"name","preselect-first":!0},scopedSlots:e._u([{key:"selection",fn:function(t){var a=t.values,i=(t.search,t.isOpen);return[a.length?n("span",{directives:[{name:"show",rawName:"v-show",value:!i,expression:"!isOpen"}],staticClass:"multiselect__single"},[e._v(e._s(a.length)+" options selected")]):e._e()]}}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}}),n("pre",{staticClass:"language-json"},[n("code",[e._v(e._s(e.value))])])],1)},i=[],s={render:a,staticRenderFns:i};t.a=s},function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("multiselect",{attrs:{label:"name","track-by":"name",placeholder:"Pick badges",options:e.badges,multiple:!0,"show-labels":!1,limit:3},on:{tag:e.onTagging},scopedSlots:e._u([{key:"option",fn:function(t){return[n("span",{staticClass:"badge__name"},[e._v(e._s(t.option.name))]),n("img",{staticClass:"badge__img",attrs:{src:t.option.img,alt:t.option.name}})]}}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v("Badge not found. Suggest a badge "),n("a",{staticClass:"typo__link",attrs:{href:"https://github.com/shentao/vue-multiselect/issues",target:"_blank"}},[e._v("here")]),e._v(".")])])],1)},i=[],s={render:a,staticRenderFns:i};t.a=s},function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("label",{staticClass:"typo__label"},[e._v("Single select")]),n("multiselect",{attrs:{options:e.options,searchable:!1,"close-on-select":!1,"show-labels":!1,placeholder:"Pick a value"},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}}),n("pre",{staticClass:"language-json"},[n("code",[e._v(e._s(e.value))])])],1)},i=[],s={render:a,staticRenderFns:i};t.a=s},function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("label",{staticClass:"typo__label"},[e._v("Vuex example.")]),n("multiselect",{attrs:{placeholder:"Pick action",value:e.value,options:e.options,searchable:!1},on:{input:e.updateValueAction}})],1)},i=[],s={render:a,staticRenderFns:i};t.a=s},function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"multiselect",class:{"multiselect--active":e.isOpen,"multiselect--disabled":e.disabled,"multiselect--above":e.isAbove,"multiselect--has-options-group":e.hasOptionGroup},attrs:{tabindex:e.searchable?-1:e.tabindex,role:"combobox","aria-owns":"listbox-"+e.id},on:{focus:function(t){return e.activate()},blur:function(t){!e.searchable&&e.deactivate()},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:t.target!==t.currentTarget?null:(t.preventDefault(),e.pointerForward())},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:t.target!==t.currentTarget?null:(t.preventDefault(),e.pointerBackward())}],keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:(t.stopPropagation(),t.target!==t.currentTarget?null:e.addPointerElement(t))},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.deactivate()}}},[e._t("caret",function(){return[n("div",{staticClass:"multiselect__select",on:{mousedown:function(t){return t.preventDefault(),t.stopPropagation(),e.toggle()}}})]},{toggle:e.toggle}),e._v(" "),e._t("clear",null,{search:e.search}),e._v(" "),n("div",{ref:"tags",staticClass:"multiselect__tags"},[e._t("selection",function(){return[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visibleValues.length>0,expression:"visibleValues.length > 0"}],staticClass:"multiselect__tags-wrap"},[e._l(e.visibleValues,function(t,a){return[e._t("tag",function(){return[n("span",{key:a,staticClass:"multiselect__tag"},[n("span",{domProps:{textContent:e._s(e.getOptionLabel(t))}}),e._v(" "),n("i",{staticClass:"multiselect__tag-icon",attrs:{tabindex:"1"},on:{keypress:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:(n.preventDefault(),e.removeElement(t))},mousedown:function(n){return n.preventDefault(),e.removeElement(t)}}})])]},{option:t,search:e.search,remove:e.removeElement})]})],2),e._v(" "),e.internalValue&&e.internalValue.length>e.limit?[e._t("limit",function(){return[n("strong",{staticClass:"multiselect__strong",domProps:{textContent:e._s(e.limitText(e.internalValue.length-e.limit))}})]})]:e._e()]},{search:e.search,remove:e.removeElement,values:e.visibleValues,isOpen:e.isOpen}),e._v(" "),n("transition",{attrs:{name:"multiselect__loading"}},[e._t("loading",function(){return[n("div",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"multiselect__spinner"})]})],2),e._v(" "),e.searchable?n("input",{ref:"search",staticClass:"multiselect__input",style:e.inputStyle,attrs:{name:e.name,id:e.id,type:"text",autocomplete:"off",spellcheck:"false",placeholder:e.placeholder,disabled:e.disabled,tabindex:e.tabindex,"aria-controls":"listbox-"+e.id},domProps:{value:e.search},on:{input:function(t){return e.updateSearch(t.target.value)},focus:function(t){return t.preventDefault(),e.activate()},blur:function(t){return t.preventDefault(),e.deactivate()},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.deactivate()},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),e.pointerForward())},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),e.pointerBackward())},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:(t.stopPropagation(),e.removeLastElement())}],keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),t.stopPropagation(),t.target!==t.currentTarget?null:e.addPointerElement(t))}}}):e._e(),e._v(" "),e.isSingleLabelVisible?n("span",{staticClass:"multiselect__single",on:{mousedown:function(t){return t.preventDefault(),e.toggle.apply(null,arguments)}}},[e._t("singleLabel",function(){return[[e._v(e._s(e.currentOptionLabel))]]},{option:e.singleValue})],2):e._e(),e._v(" "),e.isPlaceholderVisible?n("span",{staticClass:"multiselect__placeholder",on:{mousedown:function(t){return t.preventDefault(),e.toggle.apply(null,arguments)}}},[e._t("placeholder",function(){return[e._v("\n "+e._s(e.placeholder)+"\n ")]})],2):e._e()],2),e._v(" "),n("transition",{attrs:{name:"multiselect"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.isOpen,expression:"isOpen"}],ref:"list",staticClass:"multiselect__content-wrapper",style:{maxHeight:e.optimizedHeight+"px"},attrs:{tabindex:"-1"},on:{focus:e.activate,mousedown:function(e){e.preventDefault()}}},[n("ul",{staticClass:"multiselect__content",style:e.contentStyle,attrs:{role:"listbox",id:"listbox-"+e.id}},[e._t("beforeList"),e._v(" "),e.multiple&&e.max===e.internalValue.length?n("li",[n("span",{staticClass:"multiselect__option"},[e._t("maxElements",function(){return[e._v("Maximum of "+e._s(e.max)+" options selected. First remove a selected option to select another.")]})],2)]):e._e(),e._v(" "),!e.max||e.internalValue.length