Repository: SortableJS/Vue.Draggable
Branch: master
Commit: 431db153bfdf
Files: 64
Total size: 12.0 MB
Directory structure:
gitextract_5xe_ehz6/
├── .circleci/
│ └── config.yml
├── .codebeatignore
├── .github/
│ └── issue_template.md
├── .gitignore
├── .vscode/
│ └── launch.json
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── babel.config.js
├── dist/
│ ├── demo.html
│ ├── vuedraggable.common.js
│ └── vuedraggable.umd.js
├── docs/
│ ├── app.js
│ └── index.html
├── documentation/
│ ├── Vue.draggable.for.ReadME.md
│ ├── legacy.options.md
│ └── migrate.md
├── example/
│ ├── App.vue
│ ├── components/
│ │ ├── clone-on-control.vue
│ │ ├── clone.vue
│ │ ├── custom-clone.vue
│ │ ├── footerslot.vue
│ │ ├── functional.vue
│ │ ├── handle.vue
│ │ ├── headerslot.vue
│ │ ├── infra/
│ │ │ ├── nested.vue
│ │ │ └── raw-displayer.vue
│ │ ├── nested/
│ │ │ ├── nested-store.js
│ │ │ └── nested-test.vue
│ │ ├── nested-example.vue
│ │ ├── nested-with-vmodel.vue
│ │ ├── simple.vue
│ │ ├── table-column-example.vue
│ │ ├── table-example.vue
│ │ ├── third-party.vue
│ │ ├── transition-example-2.vue
│ │ ├── transition-example.vue
│ │ ├── two-list-headerslots.vue
│ │ └── two-lists.vue
│ ├── debug-components/
│ │ ├── future-index.vue
│ │ ├── nested/
│ │ │ └── draggable-list.vue
│ │ └── slot-example.vue
│ ├── main.js
│ ├── route.js
│ └── store.js
├── jest.config.js
├── package.json
├── public/
│ └── index.html
├── src/
│ ├── util/
│ │ └── helper.js
│ ├── vuedraggable.d.ts
│ └── vuedraggable.js
├── tests/
│ └── unit/
│ ├── .eslintrc.js
│ ├── helper/
│ │ ├── DraggableWithList.vue
│ │ ├── DraggableWithModel.vue
│ │ ├── DraggableWithTransition.vue
│ │ ├── FakeComponent.js
│ │ └── FakeFunctionalComponent.js
│ ├── util/
│ │ ├── helper.node.spec.js
│ │ └── helper.spec.js
│ ├── vuedraggable.integrated.spec.js
│ ├── vuedraggable.script.tag.spec.js
│ ├── vuedraggable.spec.js
│ └── vuedraggable.ssr.spec.js
└── vue.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .circleci/config.yml
================================================
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:10-browsers
# 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: yarn test:coverage
================================================
FILE: .codebeatignore
================================================
docs/**
================================================
FILE: .github/issue_template.md
================================================
First check https://github.com/SortableJS/Vue.Draggable/blob/master/CONTRIBUTING.md
### Jsfiddle link
### Step by step scenario
### Actual Solution
### Expected Solution
================================================
FILE: .gitignore
================================================
node_modules
.tmp
.sass-cache
app/bower_components
test/bower_components
bower_components
examples/src
test/tmp
/test/tmp
/examples/src
/examples/libs/
/coverage
================================================
FILE: .vscode/launch.json
================================================
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
}
},
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${relativeFile}",
"--config",
"jest.config.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
}
},
{
"type": "node",
"request": "launch",
"name": "Jest Vue Current File",
"program": "${workspaceFolder}/node_modules/@vue/cli-service/bin/vue-cli-service",
"args": [
"test:unit",
"${relativeFile}",
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/@vue/cli-service/bin/vue-cli-service",
}
}
]
}
================================================
FILE: CONTRIBUTING.md
================================================
## How to contribute
#### **Did you find a bug?**
* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/SortableJS/Vue.Draggable/issues).
* **Check if you are using the last version of vue.draggable and a compatible version of Sortable** (as indicated in the [README section](./README.md))
* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/SortableJS/Vue.Draggable/issues/new). Be sure to respect issue template including a **title and clear description**, as much relevant information as possible, and a [**jsfiddle**](http://jsfiddle.net/) (or similar online tool) containing an sample demonstrating the bug. Explain the **step by step scenario** as well as the **actual result** as opposed as the **expected result**.
#### **Do you have questions about how to use vue.draggable?**
* Check [README section](./README.md) section as well as [Issues](https://github.com/SortableJS/Vue.Draggable/issues) to see if a similar question has been asked and answered.
* Check [Sortable](https://github.com/RubaXa/Sortable) documentation.
* DO NOT OPEN ISSUE. Ask a question on [stackoverflow](https://stackoverflow.com) instead to get answer from the vue fantastic community.
#### **Did you write a correction that fixes a bug?**
* Open a new GitHub pull request with the code.
* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
#### **Do you intend to add a new feature or change an existing one?**
* Open an issue proposing the enhancement explaining the rational and the added value.
* Once agreed you may submit the corresponding PR.
Thanks!
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2016-2019 David Desmaisons
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
Vue.Draggable
[](https://circleci.com/gh/SortableJS/Vue.Draggable)
[](https://codecov.io/gh/SortableJS/Vue.Draggable)
[](https://codebeat.co/projects/github-com-sortablejs-vue-draggable-master)
[](https://github.com/SortableJS/Vue.Draggable/issues?q=is%3Aopen+is%3Aissue)
[](https://www.npmjs.com/package/vuedraggable)
[](https://www.npmjs.com/package/vuedraggable)
[](https://www.npmjs.com/package/vuedraggable)
[](https://github.com/SortableJS/Vue.Draggable/blob/master/LICENSE)
Vue component (Vue.js 2.0) or directive (Vue.js 1.0) allowing drag-and-drop and synchronization with view model array.
Based on and offering all features of [Sortable.js](https://github.com/RubaXa/Sortable)
## For Vue 3
See [vue.draggable.next](https://github.com/SortableJS/vue.draggable.next)
## Demo

## Live Demos
https://sortablejs.github.io/Vue.Draggable/
https://david-desmaisons.github.io/draggable-example/
## Features
* Full support of [Sortable.js](https://github.com/RubaXa/Sortable) features:
* Supports touch devices
* Supports drag handles and selectable text
* Smart auto-scrolling
* Support drag and drop between different lists
* No jQuery dependency
* Keeps in sync HTML and view model list
* Compatible with Vue.js 2.0 transition-group
* Cancellation support
* Events reporting any changes when full control is needed
* Reuse existing UI library components (such as [vuetify](https://vuetifyjs.com), [element](http://element.eleme.io/), or [vue material](https://vuematerial.io) etc...) and make them draggable using `tag` and `componentData` props
## Backers
Looking for backers!
## Donate
Find this project useful? You can buy me a :coffee: or a :beer:
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GYAEKQZJ4FQT2¤cy_code=USD&source=url)
## Installation
### With npm or yarn
```bash
yarn add vuedraggable
npm i -S vuedraggable
```
**Beware it is vuedraggable for Vue 2.0 and not vue-draggable which is for version 1.0**
### with direct link
```html
```
[cf example section](https://github.com/SortableJS/Vue.Draggable/tree/master/example)
## For Vue.js 2.0
Use draggable component:
### Typical use:
``` html
{{element.name}}
```
.vue file:
``` js
import draggable from 'vuedraggable'
...
export default {
components: {
draggable,
},
...
```
### With `transition-group`:
``` html
{{element.name}}
```
Draggable component should directly wrap the draggable elements, or a `transition-component` containing the draggable elements.
### With footer slot:
``` html
{{element.name}}
Add
```
### With header slot:
``` html
{{element.name}}
Add
```
### With Vuex:
```html
```
```javascript
computed: {
myList: {
get() {
return this.$store.state.myList
},
set(value) {
this.$store.commit('updateList', value)
}
}
}
```
### Props
#### value
Type: `Array`
Required: `false`
Default: `null`
Input array to draggable component. Typically same array as referenced by inner element v-for directive.
This is the preferred way to use Vue.draggable as it is compatible with Vuex.
It should not be used directly but only though the `v-model` directive:
```html
```
#### list
Type: `Array`
Required: `false`
Default: `null`
Alternative to the `value` prop, list is an array to be synchronized with drag-and-drop.
The main difference is that `list` prop is updated by draggable component using splice method, whereas `value` is immutable.
**Do not use in conjunction with value prop.**
#### All sortable options
New in version 2.19
Sortable options can be set directly as vue.draggable props since version 2.19.
This means that all [sortable option](https://github.com/RubaXa/Sortable#options) are valid sortable props with the notable exception of all the method starting by "on" as draggable component expose the same API via events.
kebab-case propery are supported: for example `ghost-class` props will be converted to `ghostClass` sortable option.
Example setting handle, sortable and a group option:
```HTML
```
#### tag
Type: `String`
Default: `'div'`
HTML node type of the element that draggable component create as outer element for the included slot.
It is also possible to pass the name of vue component as element. In this case, draggable attribute will be passed to the create component.
See also [componentData](#componentdata) if you need to set props or event to the created component.
#### clone
Type: `Function`
Required: `false`
Default: `(original) => { return original;}`
Function called on the source component to clone element when clone option is true. The unique argument is the viewModel element to be cloned and the returned value is its cloned version.
By default vue.draggable reuses the viewModel element, so you have to use this hook if you want to clone or deep clone it.
#### move
Type: `Function`
Required: `false`
Default: `null`
If not null this function will be called in a similar way as [Sortable onMove callback](https://github.com/RubaXa/Sortable#move-event-object).
Returning false will cancel the drag operation.
```javascript
function onMoveCallback(evt, originalEvent){
...
// return false; — for cancel
}
```
evt object has same property as [Sortable onMove event](https://github.com/RubaXa/Sortable#move-event-object), and 3 additional properties:
- `draggedContext`: context linked to dragged element
- `index`: dragged element index
- `element`: dragged element underlying view model element
- `futureIndex`: potential index of the dragged element if the drop operation is accepted
- `relatedContext`: context linked to current drag operation
- `index`: target element index
- `element`: target element view model element
- `list`: target list
- `component`: target VueComponent
HTML:
```HTML
```
javascript:
```javascript
checkMove: function(evt){
return (evt.draggedContext.element.name!=='apple');
}
```
See complete example: [Cancel.html](https://github.com/SortableJS/Vue.Draggable/blob/master/examples/Cancel.html), [cancel.js](https://github.com/SortableJS/Vue.Draggable/blob/master/examples/script/cancel.js)
#### componentData
Type: `Object`
Required: `false`
Default: `null`
This props is used to pass additional information to child component declared by [tag props](#tag).
Value:
* `props`: props to be passed to the child component
* `attrs`: attrs to be passed to the child component
* `on`: events to be subscribe in the child component
Example (using [element UI library](http://element.eleme.io/#/en-US)):
```HTML
{{e.description}}
```
```javascript
methods: {
handleChange() {
console.log('changed');
},
inputChanged(value) {
this.activeNames = value;
},
getComponentData() {
return {
on: {
change: this.handleChange,
input: this.inputChanged
},
attrs:{
wrap: true
},
props: {
value: this.activeNames
}
};
}
}
```
### Events
* Support for Sortable events:
`start`, `add`, `remove`, `update`, `end`, `choose`, `unchoose`, `sort`, `filter`, `clone`
Events are called whenever onStart, onAdd, onRemove, onUpdate, onEnd, onChoose, onUnchoose, onSort, onClone are fired by Sortable.js with the same argument.
[See here for reference](https://github.com/RubaXa/Sortable#event-object-demo)
Note that SortableJS OnMove callback is mapped with the [move prop](https://github.com/SortableJS/Vue.Draggable/blob/master/README.md#move)
HTML:
```HTML
```
* change event
`change` event is triggered when list prop is not null and the corresponding array is altered due to drag-and-drop operation.
This event is called with one argument containing one of the following properties:
- `added`: contains information of an element added to the array
- `newIndex`: the index of the added element
- `element`: the added element
- `removed`: contains information of an element removed from to the array
- `oldIndex`: the index of the element before remove
- `element`: the removed element
- `moved`: contains information of an element moved within the array
- `newIndex`: the current index of the moved element
- `oldIndex`: the old index of the moved element
- `element`: the moved element
### Slots
Limitation: neither header or footer slot works in conjunction with transition-group.
#### Header
Use the `header` slot to add none-draggable element inside the vuedraggable component.
Important: it should be used in conjunction with draggable option to tag draggable element.
Note that header slot will always be added before the default slot regardless its position in the template.
Ex:
``` html
{{element.name}}
Add
```
#### Footer
Use the `footer` slot to add none-draggable element inside the vuedraggable component.
Important: it should be used in conjunction with draggable option to tag draggable elements.
Note that footer slot will always be added after the default slot regardless its position in the template.
Ex:
``` html
{{element.name}}
Add
```
### Gotchas
- Vue.draggable children should always map the list or value prop using a v-for directive
* You may use [header](https://github.com/SortableJS/Vue.Draggable#header) and [footer](https://github.com/SortableJS/Vue.Draggable#footer) slot to by-pass this limitation.
- Children elements inside v-for should be keyed as any element in Vue.js. Be carefull to provide revelant key values in particular:
* typically providing array index as keys won't work as key should be linked to the items content
* cloned elements should provide updated keys, it is doable using the [clone props](#clone) for example
### Example
* [Clone](https://sortablejs.github.io/Vue.Draggable/#/custom-clone)
* [Handle](https://sortablejs.github.io/Vue.Draggable/#/handle)
* [Transition](https://sortablejs.github.io/Vue.Draggable/#/transition-example-2)
* [Nested](https://sortablejs.github.io/Vue.Draggable/#/nested-example)
* [Table](https://sortablejs.github.io/Vue.Draggable/#/table-example)
### Full demo example
[draggable-example](https://github.com/David-Desmaisons/draggable-example)
## For Vue.js 1.0
[See here](documentation/Vue.draggable.for.ReadME.md)
```
================================================
FILE: babel.config.js
================================================
module.exports = {
presets: [["@vue/app", {
useBuiltIns: "usage"
}]
]
};
================================================
FILE: dist/demo.html
================================================
vuedraggable demo
================================================
FILE: dist/vuedraggable.common.js
================================================
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");
/******/ })
/************************************************************************/
/******/ ({
/***/ "01f9":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var LIBRARY = __webpack_require__("2d00");
var $export = __webpack_require__("5ca1");
var redefine = __webpack_require__("2aba");
var hide = __webpack_require__("32e9");
var Iterators = __webpack_require__("84f2");
var $iterCreate = __webpack_require__("41a0");
var setToStringTag = __webpack_require__("7f20");
var getPrototypeOf = __webpack_require__("38fd");
var ITERATOR = __webpack_require__("2b4c")('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = $native || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ }),
/***/ "02f4":
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__("4588");
var defined = __webpack_require__("be13");
// true -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
return function (that, pos) {
var s = String(defined(that));
var i = toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ }),
/***/ "0390":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var at = __webpack_require__("02f4")(true);
// `AdvanceStringIndex` abstract operation
// https://tc39.github.io/ecma262/#sec-advancestringindex
module.exports = function (S, index, unicode) {
return index + (unicode ? at(S, index).length : 1);
};
/***/ }),
/***/ "0bfb":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.2.5.3 get RegExp.prototype.flags
var anObject = __webpack_require__("cb7c");
module.exports = function () {
var that = anObject(this);
var result = '';
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
if (that.unicode) result += 'u';
if (that.sticky) result += 'y';
return result;
};
/***/ }),
/***/ "0d58":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__("ce10");
var enumBugKeys = __webpack_require__("e11e");
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/***/ "1495":
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__("86cc");
var anObject = __webpack_require__("cb7c");
var getKeys = __webpack_require__("0d58");
module.exports = __webpack_require__("9e1e") ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = getKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ }),
/***/ "214f":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__("b0c5");
var redefine = __webpack_require__("2aba");
var hide = __webpack_require__("32e9");
var fails = __webpack_require__("79e5");
var defined = __webpack_require__("be13");
var wks = __webpack_require__("2b4c");
var regexpExec = __webpack_require__("520a");
var SPECIES = wks('species');
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
// #replace needs built-in support for named groups.
// #match works fine because it just return the exec results, even if it has
// a "grops" property.
var re = /./;
re.exec = function () {
var result = [];
result.groups = { a: '7' };
return result;
};
return ''.replace(re, '$') !== '7';
});
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
var re = /(?:)/;
var originalExec = re.exec;
re.exec = function () { return originalExec.apply(this, arguments); };
var result = 'ab'.split(re);
return result.length === 2 && result[0] === 'a' && result[1] === 'b';
})();
module.exports = function (KEY, length, exec) {
var SYMBOL = wks(KEY);
var DELEGATES_TO_SYMBOL = !fails(function () {
// String methods call symbol-named RegEp methods
var O = {};
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) != 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
// Symbol-named RegExp methods call .exec
var execCalled = false;
var re = /a/;
re.exec = function () { execCalled = true; return null; };
if (KEY === 'split') {
// RegExp[@@split] doesn't call the regex's exec method, but first creates
// a new one. We need to return the patched regex when creating the new one.
re.constructor = {};
re.constructor[SPECIES] = function () { return re; };
}
re[SYMBOL]('');
return !execCalled;
}) : undefined;
if (
!DELEGATES_TO_SYMBOL ||
!DELEGATES_TO_EXEC ||
(KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
) {
var nativeRegExpMethod = /./[SYMBOL];
var fns = exec(
defined,
SYMBOL,
''[KEY],
function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
if (regexp.exec === regexpExec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
// The native String method already delegates to @@method (this
// polyfilled function), leasing to infinite recursion.
// We avoid it by directly calling the native @@method method.
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
}
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
}
return { done: false };
}
);
var strfn = fns[0];
var rxfn = fns[1];
redefine(String.prototype, KEY, strfn);
hide(RegExp.prototype, SYMBOL, length == 2
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
? function (string, arg) { return rxfn.call(string, this, arg); }
// 21.2.5.6 RegExp.prototype[@@match](string)
// 21.2.5.9 RegExp.prototype[@@search](string)
: function (string) { return rxfn.call(string, this); }
);
}
};
/***/ }),
/***/ "230e":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("d3f4");
var document = __webpack_require__("7726").document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/***/ "23c6":
/***/ (function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__("2d95");
var TAG = __webpack_require__("2b4c")('toStringTag');
// ES3 wrong here
var ARG = cof(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (e) { /* empty */ }
};
module.exports = function (it) {
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ }),
/***/ "2621":
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/***/ "2aba":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("7726");
var hide = __webpack_require__("32e9");
var has = __webpack_require__("69a8");
var SRC = __webpack_require__("ca5a")('src');
var $toString = __webpack_require__("fa5b");
var TO_STRING = 'toString';
var TPL = ('' + $toString).split(TO_STRING);
__webpack_require__("8378").inspectSource = function (it) {
return $toString.call(it);
};
(module.exports = function (O, key, val, safe) {
var isFunction = typeof val == 'function';
if (isFunction) has(val, 'name') || hide(val, 'name', key);
if (O[key] === val) return;
if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
if (O === global) {
O[key] = val;
} else if (!safe) {
delete O[key];
hide(O, key, val);
} else if (O[key]) {
O[key] = val;
} else {
hide(O, key, val);
}
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, TO_STRING, function toString() {
return typeof this == 'function' && this[SRC] || $toString.call(this);
});
/***/ }),
/***/ "2aeb":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__("cb7c");
var dPs = __webpack_require__("1495");
var enumBugKeys = __webpack_require__("e11e");
var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__("230e")('iframe');
var i = enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
__webpack_require__("fab2").appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE] = anObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ }),
/***/ "2b4c":
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__("5537")('wks');
var uid = __webpack_require__("ca5a");
var Symbol = __webpack_require__("7726").Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/***/ "2d00":
/***/ (function(module, exports) {
module.exports = false;
/***/ }),
/***/ "2d95":
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/***/ "2fdb":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.1.3.7 String.prototype.includes(searchString, position = 0)
var $export = __webpack_require__("5ca1");
var context = __webpack_require__("d2c8");
var INCLUDES = 'includes';
$export($export.P + $export.F * __webpack_require__("5147")(INCLUDES), 'String', {
includes: function includes(searchString /* , position = 0 */) {
return !!~context(this, searchString, INCLUDES)
.indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "32e9":
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__("86cc");
var createDesc = __webpack_require__("4630");
module.exports = __webpack_require__("9e1e") ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/***/ "38fd":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__("69a8");
var toObject = __webpack_require__("4bf8");
var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
var ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ }),
/***/ "41a0":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var create = __webpack_require__("2aeb");
var descriptor = __webpack_require__("4630");
var setToStringTag = __webpack_require__("7f20");
var IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__("32e9")(IteratorPrototype, __webpack_require__("2b4c")('iterator'), function () { return this; });
module.exports = function (Constructor, NAME, next) {
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ }),
/***/ "456d":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 Object.keys(O)
var toObject = __webpack_require__("4bf8");
var $keys = __webpack_require__("0d58");
__webpack_require__("5eda")('keys', function () {
return function keys(it) {
return $keys(toObject(it));
};
});
/***/ }),
/***/ "4588":
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/***/ "4630":
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/***/ "4bf8":
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__("be13");
module.exports = function (it) {
return Object(defined(it));
};
/***/ }),
/***/ "5147":
/***/ (function(module, exports, __webpack_require__) {
var MATCH = __webpack_require__("2b4c")('match');
module.exports = function (KEY) {
var re = /./;
try {
'/./'[KEY](re);
} catch (e) {
try {
re[MATCH] = false;
return !'/./'[KEY](re);
} catch (f) { /* empty */ }
} return true;
};
/***/ }),
/***/ "520a":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var regexpFlags = __webpack_require__("0bfb");
var nativeExec = RegExp.prototype.exec;
// This always refers to the native implementation, because the
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
// which loads this file before patching the method.
var nativeReplace = String.prototype.replace;
var patchedExec = nativeExec;
var LAST_INDEX = 'lastIndex';
var UPDATES_LAST_INDEX_WRONG = (function () {
var re1 = /a/,
re2 = /b*/g;
nativeExec.call(re1, 'a');
nativeExec.call(re2, 'a');
return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
})();
// nonparticipating capturing group, copied from es5-shim's String#split patch.
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
if (PATCH) {
patchedExec = function exec(str) {
var re = this;
var lastIndex, reCopy, match, i;
if (NPCG_INCLUDED) {
reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
}
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
match = nativeExec.call(re, str);
if (UPDATES_LAST_INDEX_WRONG && match) {
re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
}
if (NPCG_INCLUDED && match && match.length > 1) {
// Fix browsers whose `exec` methods don't consistently return `undefined`
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
// eslint-disable-next-line no-loop-func
nativeReplace.call(match[0], reCopy, function () {
for (i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
}
});
}
return match;
};
}
module.exports = patchedExec;
/***/ }),
/***/ "52a7":
/***/ (function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ }),
/***/ "5537":
/***/ (function(module, exports, __webpack_require__) {
var core = __webpack_require__("8378");
var global = __webpack_require__("7726");
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: core.version,
mode: __webpack_require__("2d00") ? 'pure' : 'global',
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
});
/***/ }),
/***/ "5ca1":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("7726");
var core = __webpack_require__("8378");
var hide = __webpack_require__("32e9");
var redefine = __webpack_require__("2aba");
var ctx = __webpack_require__("9b43");
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
var key, own, out, exp;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
// export native or passed
out = (own ? target : source)[key];
// bind timers to global for call from export context
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// extend global
if (target) redefine(target, key, out, type & $export.U);
// export
if (exports[key] != out) hide(exports, key, exp);
if (IS_PROTO && expProto[key] != out) expProto[key] = out;
}
};
global.core = core;
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/***/ "5eda":
/***/ (function(module, exports, __webpack_require__) {
// most Object methods by ES6 should accept primitives
var $export = __webpack_require__("5ca1");
var core = __webpack_require__("8378");
var fails = __webpack_require__("79e5");
module.exports = function (KEY, exec) {
var fn = (core.Object || {})[KEY] || Object[KEY];
var exp = {};
exp[KEY] = exec(fn);
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
};
/***/ }),
/***/ "5f1b":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var classof = __webpack_require__("23c6");
var builtinExec = RegExp.prototype.exec;
// `RegExpExec` abstract operation
// https://tc39.github.io/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 new TypeError('RegExp exec method returned something other than an Object or null');
}
return result;
}
if (classof(R) !== 'RegExp') {
throw new TypeError('RegExp#exec called on incompatible receiver');
}
return builtinExec.call(R, S);
};
/***/ }),
/***/ "613b":
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__("5537")('keys');
var uid = __webpack_require__("ca5a");
module.exports = function (key) {
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/***/ "626a":
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__("2d95");
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/***/ "6762":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://github.com/tc39/Array.prototype.includes
var $export = __webpack_require__("5ca1");
var $includes = __webpack_require__("c366")(true);
$export($export.P, 'Array', {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__("9c6c")('includes');
/***/ }),
/***/ "6821":
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__("626a");
var defined = __webpack_require__("be13");
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/***/ "69a8":
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/***/ "6a99":
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__("d3f4");
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/***/ "7333":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 19.1.2.1 Object.assign(target, source, ...)
var getKeys = __webpack_require__("0d58");
var gOPS = __webpack_require__("2621");
var pIE = __webpack_require__("52a7");
var toObject = __webpack_require__("4bf8");
var IObject = __webpack_require__("626a");
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__("79e5")(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = gOPS.f;
var isEnum = pIE.f;
while (aLen > index) {
var S = IObject(arguments[index++]);
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
} return T;
} : $assign;
/***/ }),
/***/ "7726":
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/***/ "77f1":
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__("4588");
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/***/ "79e5":
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/***/ "7f20":
/***/ (function(module, exports, __webpack_require__) {
var def = __webpack_require__("86cc").f;
var has = __webpack_require__("69a8");
var TAG = __webpack_require__("2b4c")('toStringTag');
module.exports = function (it, tag, stat) {
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};
/***/ }),
/***/ "8378":
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.5' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/***/ "84f2":
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/***/ "86cc":
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__("cb7c");
var IE8_DOM_DEFINE = __webpack_require__("c69a");
var toPrimitive = __webpack_require__("6a99");
var dP = Object.defineProperty;
exports.f = __webpack_require__("9e1e") ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/***/ "9b43":
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__("d8e8");
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
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);
};
};
/***/ }),
/***/ "9c6c":
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.31 Array.prototype[@@unscopables]
var UNSCOPABLES = __webpack_require__("2b4c")('unscopables');
var ArrayProto = Array.prototype;
if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__("32e9")(ArrayProto, UNSCOPABLES, {});
module.exports = function (key) {
ArrayProto[UNSCOPABLES][key] = true;
};
/***/ }),
/***/ "9def":
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__("4588");
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/***/ "9e1e":
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__("79e5")(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/***/ "a352":
/***/ (function(module, exports) {
module.exports = require("sortablejs");
/***/ }),
/***/ "a481":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var anObject = __webpack_require__("cb7c");
var toObject = __webpack_require__("4bf8");
var toLength = __webpack_require__("9def");
var toInteger = __webpack_require__("4588");
var advanceStringIndex = __webpack_require__("0390");
var regExpExec = __webpack_require__("5f1b");
var max = Math.max;
var min = Math.min;
var floor = Math.floor;
var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
var maybeToString = function (it) {
return it === undefined ? it : String(it);
};
// @@replace logic
__webpack_require__("214f")('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
return [
// `String.prototype.replace` method
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
function replace(searchValue, replaceValue) {
var O = defined(this);
var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
return fn !== undefined
? fn.call(searchValue, O, replaceValue)
: $replace.call(String(O), searchValue, replaceValue);
},
// `RegExp.prototype[@@replace]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
function (regexp, replaceValue) {
var res = maybeCallNative($replace, regexp, this, replaceValue);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
var functionalReplace = typeof replaceValue === 'function';
if (!functionalReplace) replaceValue = String(replaceValue);
var global = rx.global;
if (global) {
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
}
var results = [];
while (true) {
var result = regExpExec(rx, S);
if (result === null) break;
results.push(result);
if (!global) break;
var matchStr = String(result[0]);
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
}
var accumulatedResult = '';
var nextSourcePosition = 0;
for (var i = 0; i < results.length; i++) {
result = results[i];
var matched = String(result[0]);
var position = max(min(toInteger(result.index), S.length), 0);
var captures = [];
// NOTE: This is equivalent to
// captures = result.slice(1).map(maybeToString)
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = [matched].concat(captures, position, S);
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
var replacement = String(replaceValue.apply(undefined, replacerArgs));
} else {
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
}
if (position >= nextSourcePosition) {
accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
nextSourcePosition = position + matched.length;
}
}
return accumulatedResult + S.slice(nextSourcePosition);
}
];
// https://tc39.github.io/ecma262/#sec-getsubstitution
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== undefined) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return $replace.call(replacement, symbols, function (match, ch) {
var capture;
switch (ch.charAt(0)) {
case '$': return '$';
case '&': return matched;
case '`': return str.slice(0, position);
case "'": return str.slice(tailPos);
case '<':
capture = namedCaptures[ch.slice(1, -1)];
break;
default: // \d\d?
var n = +ch;
if (n === 0) return match;
if (n > m) {
var f = floor(n / 10);
if (f === 0) return match;
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
return match;
}
capture = captures[n - 1];
}
return capture === undefined ? '' : capture;
});
}
});
/***/ }),
/***/ "aae3":
/***/ (function(module, exports, __webpack_require__) {
// 7.2.8 IsRegExp(argument)
var isObject = __webpack_require__("d3f4");
var cof = __webpack_require__("2d95");
var MATCH = __webpack_require__("2b4c")('match');
module.exports = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
};
/***/ }),
/***/ "ac6a":
/***/ (function(module, exports, __webpack_require__) {
var $iterators = __webpack_require__("cadf");
var getKeys = __webpack_require__("0d58");
var redefine = __webpack_require__("2aba");
var global = __webpack_require__("7726");
var hide = __webpack_require__("32e9");
var Iterators = __webpack_require__("84f2");
var wks = __webpack_require__("2b4c");
var ITERATOR = wks('iterator');
var TO_STRING_TAG = wks('toStringTag');
var ArrayValues = Iterators.Array;
var DOMIterables = {
CSSRuleList: true, // TODO: Not spec compliant, should be false.
CSSStyleDeclaration: false,
CSSValueList: false,
ClientRectList: false,
DOMRectList: false,
DOMStringList: false,
DOMTokenList: true,
DataTransferItemList: false,
FileList: false,
HTMLAllCollection: false,
HTMLCollection: false,
HTMLFormElement: false,
HTMLSelectElement: false,
MediaList: true, // TODO: Not spec compliant, should be false.
MimeTypeArray: false,
NamedNodeMap: false,
NodeList: true,
PaintRequestList: false,
Plugin: false,
PluginArray: false,
SVGLengthList: false,
SVGNumberList: false,
SVGPathSegList: false,
SVGPointList: false,
SVGStringList: false,
SVGTransformList: false,
SourceBufferList: false,
StyleSheetList: true, // TODO: Not spec compliant, should be false.
TextTrackCueList: false,
TextTrackList: false,
TouchList: false
};
for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
var NAME = collections[i];
var explicit = DOMIterables[NAME];
var Collection = global[NAME];
var proto = Collection && Collection.prototype;
var key;
if (proto) {
if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = ArrayValues;
if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
}
}
/***/ }),
/***/ "b0c5":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var regexpExec = __webpack_require__("520a");
__webpack_require__("5ca1")({
target: 'RegExp',
proto: true,
forced: regexpExec !== /./.exec
}, {
exec: regexpExec
});
/***/ }),
/***/ "be13":
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/***/ "c366":
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__("6821");
var toLength = __webpack_require__("9def");
var toAbsoluteIndex = __webpack_require__("77f1");
module.exports = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIObject($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
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/***/ "c649":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return insertNodeAt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return camelize; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return console; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return removeNode; });
/* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a481");
/* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0__);
function getConsole() {
if (typeof window !== "undefined") {
return window.console;
}
return global.console;
}
var console = getConsole();
function cached(fn) {
var cache = Object.create(null);
return function cachedFn(str) {
var hit = cache[str];
return hit || (cache[str] = fn(str));
};
}
var regex = /-(\w)/g;
var camelize = cached(function (str) {
return str.replace(regex, function (_, c) {
return c ? c.toUpperCase() : "";
});
});
function removeNode(node) {
if (node.parentElement !== null) {
node.parentElement.removeChild(node);
}
}
function insertNodeAt(fatherNode, node, position) {
var refNode = position === 0 ? fatherNode.children[0] : fatherNode.children[position - 1].nextSibling;
fatherNode.insertBefore(node, refNode);
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
/***/ }),
/***/ "c69a":
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__("9e1e") && !__webpack_require__("79e5")(function () {
return Object.defineProperty(__webpack_require__("230e")('div'), 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/***/ "c8ba":
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/***/ "ca5a":
/***/ (function(module, exports) {
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/***/ "cadf":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var addToUnscopables = __webpack_require__("9c6c");
var step = __webpack_require__("d53b");
var Iterators = __webpack_require__("84f2");
var toIObject = __webpack_require__("6821");
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__("01f9")(Array, 'Array', function (iterated, kind) {
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
var O = this._t;
var kind = this._k;
var index = this._i++;
if (!O || index >= O.length) {
this._t = undefined;
return step(1);
}
if (kind == 'keys') return step(0, index);
if (kind == 'values') return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ }),
/***/ "cb7c":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("d3f4");
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/***/ "ce10":
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__("69a8");
var toIObject = __webpack_require__("6821");
var arrayIndexOf = __webpack_require__("c366")(false);
var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
module.exports = function (object, names) {
var O = toIObject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/***/ "d2c8":
/***/ (function(module, exports, __webpack_require__) {
// helper for String#{startsWith, endsWith, includes}
var isRegExp = __webpack_require__("aae3");
var defined = __webpack_require__("be13");
module.exports = function (that, searchString, NAME) {
if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
return String(defined(that));
};
/***/ }),
/***/ "d3f4":
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/***/ "d53b":
/***/ (function(module, exports) {
module.exports = function (done, value) {
return { value: value, done: !!done };
};
/***/ }),
/***/ "d8e8":
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/***/ "e11e":
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/***/ "f559":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.1.3.18 String.prototype.startsWith(searchString [, position ])
var $export = __webpack_require__("5ca1");
var toLength = __webpack_require__("9def");
var context = __webpack_require__("d2c8");
var STARTS_WITH = 'startsWith';
var $startsWith = ''[STARTS_WITH];
$export($export.P + $export.F * __webpack_require__("5147")(STARTS_WITH), 'String', {
startsWith: function startsWith(searchString /* , position = 0 */) {
var that = context(this, searchString, STARTS_WITH);
var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
var search = String(searchString);
return $startsWith
? $startsWith.call(that, search, index)
: that.slice(index, index + search.length) === search;
}
});
/***/ }),
/***/ "f6fd":
/***/ (function(module, exports) {
// document.currentScript polyfill by Adam Miller
// MIT license
(function(document){
var currentScript = "currentScript",
scripts = document.getElementsByTagName('script'); // Live NodeList collection
// If browser needs currentScript polyfill, add get currentScript() to the document object
if (!(currentScript in document)) {
Object.defineProperty(document, currentScript, {
get: function(){
// IE 6-10 supports script readyState
// IE 10+ support stack trace
try { throw new Error(); }
catch (err) {
// Find the second match for the "at" string to get file src url from stack.
// Specifically works with the format of stack traces in IE.
var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1];
// For all scripts on the page, if src matches or if ready state is interactive, return the script tag
for(i in scripts){
if(scripts[i].src == res || scripts[i].readyState == "interactive"){
return scripts[i];
}
}
// If no match, return null
return null;
}
}
});
}
})(document);
/***/ }),
/***/ "f751":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__("5ca1");
$export($export.S + $export.F, 'Object', { assign: __webpack_require__("7333") });
/***/ }),
/***/ "fa5b":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__("5537")('native-function-to-string', Function.toString);
/***/ }),
/***/ "fab2":
/***/ (function(module, exports, __webpack_require__) {
var document = __webpack_require__("7726").document;
module.exports = document && document.documentElement;
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
if (true) {
__webpack_require__("f6fd")
}
var setPublicPath_i
if ((setPublicPath_i = window.document.currentScript) && (setPublicPath_i = setPublicPath_i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
__webpack_require__.p = setPublicPath_i[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.assign.js
var es6_object_assign = __webpack_require__("f751");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.starts-with.js
var es6_string_starts_with = __webpack_require__("f559");
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js
var web_dom_iterable = __webpack_require__("ac6a");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.iterator.js
var es6_array_iterator = __webpack_require__("cadf");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.keys.js
var es6_object_keys = __webpack_require__("456d");
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
function _iterableToArrayLimit(arr, i) {
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
// EXTERNAL MODULE: ./node_modules/core-js/modules/es7.array.includes.js
var es7_array_includes = __webpack_require__("6762");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.includes.js
var es6_string_includes = __webpack_require__("2fdb");
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
// EXTERNAL MODULE: external {"commonjs":"sortablejs","commonjs2":"sortablejs","amd":"sortablejs","root":"Sortable"}
var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_ = __webpack_require__("a352");
var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_);
// EXTERNAL MODULE: ./src/util/helper.js
var helper = __webpack_require__("c649");
// CONCATENATED MODULE: ./src/vuedraggable.js
function buildAttribute(object, propName, value) {
if (value === undefined) {
return object;
}
object = object || {};
object[propName] = value;
return object;
}
function computeVmIndex(vnodes, element) {
return vnodes.map(function (elt) {
return elt.elm;
}).indexOf(element);
}
function _computeIndexes(slots, children, isTransition, footerOffset) {
if (!slots) {
return [];
}
var elmFromNodes = slots.map(function (elt) {
return elt.elm;
});
var footerIndex = children.length - footerOffset;
var rawIndexes = _toConsumableArray(children).map(function (elt, idx) {
return idx >= footerIndex ? elmFromNodes.length : elmFromNodes.indexOf(elt);
});
return isTransition ? rawIndexes.filter(function (ind) {
return ind !== -1;
}) : rawIndexes;
}
function emit(evtName, evtData) {
var _this = this;
this.$nextTick(function () {
return _this.$emit(evtName.toLowerCase(), evtData);
});
}
function delegateAndEmit(evtName) {
var _this2 = this;
return function (evtData) {
if (_this2.realList !== null) {
_this2["onDrag" + evtName](evtData);
}
emit.call(_this2, evtName, evtData);
};
}
function isTransitionName(name) {
return ["transition-group", "TransitionGroup"].includes(name);
}
function vuedraggable_isTransition(slots) {
if (!slots || slots.length !== 1) {
return false;
}
var _slots = _slicedToArray(slots, 1),
componentOptions = _slots[0].componentOptions;
if (!componentOptions) {
return false;
}
return isTransitionName(componentOptions.tag);
}
function getSlot(slot, scopedSlot, key) {
return slot[key] || (scopedSlot[key] ? scopedSlot[key]() : undefined);
}
function computeChildrenAndOffsets(children, slot, scopedSlot) {
var headerOffset = 0;
var footerOffset = 0;
var header = getSlot(slot, scopedSlot, "header");
if (header) {
headerOffset = header.length;
children = children ? [].concat(_toConsumableArray(header), _toConsumableArray(children)) : _toConsumableArray(header);
}
var footer = getSlot(slot, scopedSlot, "footer");
if (footer) {
footerOffset = footer.length;
children = children ? [].concat(_toConsumableArray(children), _toConsumableArray(footer)) : _toConsumableArray(footer);
}
return {
children: children,
headerOffset: headerOffset,
footerOffset: footerOffset
};
}
function getComponentAttributes($attrs, componentData) {
var attributes = null;
var update = function update(name, value) {
attributes = buildAttribute(attributes, name, value);
};
var attrs = Object.keys($attrs).filter(function (key) {
return key === "id" || key.startsWith("data-");
}).reduce(function (res, key) {
res[key] = $attrs[key];
return res;
}, {});
update("attrs", attrs);
if (!componentData) {
return attributes;
}
var on = componentData.on,
props = componentData.props,
componentDataAttrs = componentData.attrs;
update("on", on);
update("props", props);
Object.assign(attributes.attrs, componentDataAttrs);
return attributes;
}
var eventsListened = ["Start", "Add", "Remove", "Update", "End"];
var eventsToEmit = ["Choose", "Unchoose", "Sort", "Filter", "Clone"];
var readonlyProperties = ["Move"].concat(eventsListened, eventsToEmit).map(function (evt) {
return "on" + evt;
});
var draggingElement = null;
var props = {
options: Object,
list: {
type: Array,
required: false,
default: null
},
value: {
type: Array,
required: false,
default: null
},
noTransitionOnDrag: {
type: Boolean,
default: false
},
clone: {
type: Function,
default: function _default(original) {
return original;
}
},
element: {
type: String,
default: "div"
},
tag: {
type: String,
default: null
},
move: {
type: Function,
default: null
},
componentData: {
type: Object,
required: false,
default: null
}
};
var draggableComponent = {
name: "draggable",
inheritAttrs: false,
props: props,
data: function data() {
return {
transitionMode: false,
noneFunctionalComponentMode: false
};
},
render: function render(h) {
var slots = this.$slots.default;
this.transitionMode = vuedraggable_isTransition(slots);
var _computeChildrenAndOf = computeChildrenAndOffsets(slots, this.$slots, this.$scopedSlots),
children = _computeChildrenAndOf.children,
headerOffset = _computeChildrenAndOf.headerOffset,
footerOffset = _computeChildrenAndOf.footerOffset;
this.headerOffset = headerOffset;
this.footerOffset = footerOffset;
var attributes = getComponentAttributes(this.$attrs, this.componentData);
return h(this.getTag(), attributes, children);
},
created: function created() {
if (this.list !== null && this.value !== null) {
helper["b" /* console */].error("Value and list props are mutually exclusive! Please set one or another.");
}
if (this.element !== "div") {
helper["b" /* console */].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props");
}
if (this.options !== undefined) {
helper["b" /* console */].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props");
}
},
mounted: function mounted() {
var _this3 = this;
this.noneFunctionalComponentMode = this.getTag().toLowerCase() !== this.$el.nodeName.toLowerCase() && !this.getIsFunctional();
if (this.noneFunctionalComponentMode && this.transitionMode) {
throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));
}
var optionsAdded = {};
eventsListened.forEach(function (elt) {
optionsAdded["on" + elt] = delegateAndEmit.call(_this3, elt);
});
eventsToEmit.forEach(function (elt) {
optionsAdded["on" + elt] = emit.bind(_this3, elt);
});
var attributes = Object.keys(this.$attrs).reduce(function (res, key) {
res[Object(helper["a" /* camelize */])(key)] = _this3.$attrs[key];
return res;
}, {});
var options = Object.assign({}, this.options, attributes, optionsAdded, {
onMove: function onMove(evt, originalEvent) {
return _this3.onDragMove(evt, originalEvent);
}
});
!("draggable" in options) && (options.draggable = ">*");
this._sortable = new external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default.a(this.rootContainer, options);
this.computeIndexes();
},
beforeDestroy: function beforeDestroy() {
if (this._sortable !== undefined) this._sortable.destroy();
},
computed: {
rootContainer: function rootContainer() {
return this.transitionMode ? this.$el.children[0] : this.$el;
},
realList: function realList() {
return this.list ? this.list : this.value;
}
},
watch: {
options: {
handler: function handler(newOptionValue) {
this.updateOptions(newOptionValue);
},
deep: true
},
$attrs: {
handler: function handler(newOptionValue) {
this.updateOptions(newOptionValue);
},
deep: true
},
realList: function realList() {
this.computeIndexes();
}
},
methods: {
getIsFunctional: function getIsFunctional() {
var fnOptions = this._vnode.fnOptions;
return fnOptions && fnOptions.functional;
},
getTag: function getTag() {
return this.tag || this.element;
},
updateOptions: function updateOptions(newOptionValue) {
for (var property in newOptionValue) {
var value = Object(helper["a" /* camelize */])(property);
if (readonlyProperties.indexOf(value) === -1) {
this._sortable.option(value, newOptionValue[property]);
}
}
},
getChildrenNodes: function getChildrenNodes() {
if (this.noneFunctionalComponentMode) {
return this.$children[0].$slots.default;
}
var rawNodes = this.$slots.default;
return this.transitionMode ? rawNodes[0].child.$slots.default : rawNodes;
},
computeIndexes: function computeIndexes() {
var _this4 = this;
this.$nextTick(function () {
_this4.visibleIndexes = _computeIndexes(_this4.getChildrenNodes(), _this4.rootContainer.children, _this4.transitionMode, _this4.footerOffset);
});
},
getUnderlyingVm: function getUnderlyingVm(htmlElt) {
var index = computeVmIndex(this.getChildrenNodes() || [], htmlElt);
if (index === -1) {
//Edge case during move callback: related element might be
//an element different from collection
return null;
}
var element = this.realList[index];
return {
index: index,
element: element
};
},
getUnderlyingPotencialDraggableComponent: function getUnderlyingPotencialDraggableComponent(_ref) {
var vue = _ref.__vue__;
if (!vue || !vue.$options || !isTransitionName(vue.$options._componentTag)) {
if (!("realList" in vue) && vue.$children.length === 1 && "realList" in vue.$children[0]) return vue.$children[0];
return vue;
}
return vue.$parent;
},
emitChanges: function emitChanges(evt) {
var _this5 = this;
this.$nextTick(function () {
_this5.$emit("change", evt);
});
},
alterList: function alterList(onList) {
if (this.list) {
onList(this.list);
return;
}
var newList = _toConsumableArray(this.value);
onList(newList);
this.$emit("input", newList);
},
spliceList: function spliceList() {
var _arguments = arguments;
var spliceList = function spliceList(list) {
return list.splice.apply(list, _toConsumableArray(_arguments));
};
this.alterList(spliceList);
},
updatePosition: function updatePosition(oldIndex, newIndex) {
var updatePosition = function updatePosition(list) {
return list.splice(newIndex, 0, list.splice(oldIndex, 1)[0]);
};
this.alterList(updatePosition);
},
getRelatedContextFromMoveEvent: function getRelatedContextFromMoveEvent(_ref2) {
var to = _ref2.to,
related = _ref2.related;
var component = this.getUnderlyingPotencialDraggableComponent(to);
if (!component) {
return {
component: component
};
}
var list = component.realList;
var context = {
list: list,
component: component
};
if (to !== related && list && component.getUnderlyingVm) {
var destination = component.getUnderlyingVm(related);
if (destination) {
return Object.assign(destination, context);
}
}
return context;
},
getVmIndex: function getVmIndex(domIndex) {
var indexes = this.visibleIndexes;
var numberIndexes = indexes.length;
return domIndex > numberIndexes - 1 ? numberIndexes : indexes[domIndex];
},
getComponent: function getComponent() {
return this.$slots.default[0].componentInstance;
},
resetTransitionData: function resetTransitionData(index) {
if (!this.noTransitionOnDrag || !this.transitionMode) {
return;
}
var nodes = this.getChildrenNodes();
nodes[index].data = null;
var transitionContainer = this.getComponent();
transitionContainer.children = [];
transitionContainer.kept = undefined;
},
onDragStart: function onDragStart(evt) {
this.context = this.getUnderlyingVm(evt.item);
evt.item._underlying_vm_ = this.clone(this.context.element);
draggingElement = evt.item;
},
onDragAdd: function onDragAdd(evt) {
var element = evt.item._underlying_vm_;
if (element === undefined) {
return;
}
Object(helper["d" /* removeNode */])(evt.item);
var newIndex = this.getVmIndex(evt.newIndex);
this.spliceList(newIndex, 0, element);
this.computeIndexes();
var added = {
element: element,
newIndex: newIndex
};
this.emitChanges({
added: added
});
},
onDragRemove: function onDragRemove(evt) {
Object(helper["c" /* insertNodeAt */])(this.rootContainer, evt.item, evt.oldIndex);
if (evt.pullMode === "clone") {
Object(helper["d" /* removeNode */])(evt.clone);
return;
}
var oldIndex = this.context.index;
this.spliceList(oldIndex, 1);
var removed = {
element: this.context.element,
oldIndex: oldIndex
};
this.resetTransitionData(oldIndex);
this.emitChanges({
removed: removed
});
},
onDragUpdate: function onDragUpdate(evt) {
Object(helper["d" /* removeNode */])(evt.item);
Object(helper["c" /* insertNodeAt */])(evt.from, evt.item, evt.oldIndex);
var oldIndex = this.context.index;
var newIndex = this.getVmIndex(evt.newIndex);
this.updatePosition(oldIndex, newIndex);
var moved = {
element: this.context.element,
oldIndex: oldIndex,
newIndex: newIndex
};
this.emitChanges({
moved: moved
});
},
updateProperty: function updateProperty(evt, propertyName) {
evt.hasOwnProperty(propertyName) && (evt[propertyName] += this.headerOffset);
},
computeFutureIndex: function computeFutureIndex(relatedContext, evt) {
if (!relatedContext.element) {
return 0;
}
var domChildren = _toConsumableArray(evt.to.children).filter(function (el) {
return el.style["display"] !== "none";
});
var currentDOMIndex = domChildren.indexOf(evt.related);
var currentIndex = relatedContext.component.getVmIndex(currentDOMIndex);
var draggedInList = domChildren.indexOf(draggingElement) !== -1;
return draggedInList || !evt.willInsertAfter ? currentIndex : currentIndex + 1;
},
onDragMove: function onDragMove(evt, originalEvent) {
var onMove = this.move;
if (!onMove || !this.realList) {
return true;
}
var relatedContext = this.getRelatedContextFromMoveEvent(evt);
var draggedContext = this.context;
var futureIndex = this.computeFutureIndex(relatedContext, evt);
Object.assign(draggedContext, {
futureIndex: futureIndex
});
var sendEvt = Object.assign({}, evt, {
relatedContext: relatedContext,
draggedContext: draggedContext
});
return onMove(sendEvt, originalEvent);
},
onDragEnd: function onDragEnd() {
this.computeIndexes();
draggingElement = null;
}
}
};
if (typeof window !== "undefined" && "Vue" in window) {
window.Vue.component("draggable", draggableComponent);
}
/* harmony default export */ var vuedraggable = (draggableComponent);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (vuedraggable);
/***/ })
/******/ })["default"];
//# sourceMappingURL=vuedraggable.common.js.map
================================================
FILE: dist/vuedraggable.umd.js
================================================
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("sortablejs"));
else if(typeof define === 'function' && define.amd)
define(["sortablejs"], factory);
else if(typeof exports === 'object')
exports["vuedraggable"] = factory(require("sortablejs"));
else
root["vuedraggable"] = factory(root["Sortable"]);
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE_a352__) {
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");
/******/ })
/************************************************************************/
/******/ ({
/***/ "01f9":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var LIBRARY = __webpack_require__("2d00");
var $export = __webpack_require__("5ca1");
var redefine = __webpack_require__("2aba");
var hide = __webpack_require__("32e9");
var Iterators = __webpack_require__("84f2");
var $iterCreate = __webpack_require__("41a0");
var setToStringTag = __webpack_require__("7f20");
var getPrototypeOf = __webpack_require__("38fd");
var ITERATOR = __webpack_require__("2b4c")('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = $native || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ }),
/***/ "02f4":
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__("4588");
var defined = __webpack_require__("be13");
// true -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
return function (that, pos) {
var s = String(defined(that));
var i = toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ }),
/***/ "0390":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var at = __webpack_require__("02f4")(true);
// `AdvanceStringIndex` abstract operation
// https://tc39.github.io/ecma262/#sec-advancestringindex
module.exports = function (S, index, unicode) {
return index + (unicode ? at(S, index).length : 1);
};
/***/ }),
/***/ "0bfb":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.2.5.3 get RegExp.prototype.flags
var anObject = __webpack_require__("cb7c");
module.exports = function () {
var that = anObject(this);
var result = '';
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
if (that.unicode) result += 'u';
if (that.sticky) result += 'y';
return result;
};
/***/ }),
/***/ "0d58":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__("ce10");
var enumBugKeys = __webpack_require__("e11e");
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/***/ "1495":
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__("86cc");
var anObject = __webpack_require__("cb7c");
var getKeys = __webpack_require__("0d58");
module.exports = __webpack_require__("9e1e") ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = getKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ }),
/***/ "214f":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__("b0c5");
var redefine = __webpack_require__("2aba");
var hide = __webpack_require__("32e9");
var fails = __webpack_require__("79e5");
var defined = __webpack_require__("be13");
var wks = __webpack_require__("2b4c");
var regexpExec = __webpack_require__("520a");
var SPECIES = wks('species');
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
// #replace needs built-in support for named groups.
// #match works fine because it just return the exec results, even if it has
// a "grops" property.
var re = /./;
re.exec = function () {
var result = [];
result.groups = { a: '7' };
return result;
};
return ''.replace(re, '$ ') !== '7';
});
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
var re = /(?:)/;
var originalExec = re.exec;
re.exec = function () { return originalExec.apply(this, arguments); };
var result = 'ab'.split(re);
return result.length === 2 && result[0] === 'a' && result[1] === 'b';
})();
module.exports = function (KEY, length, exec) {
var SYMBOL = wks(KEY);
var DELEGATES_TO_SYMBOL = !fails(function () {
// String methods call symbol-named RegEp methods
var O = {};
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) != 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
// Symbol-named RegExp methods call .exec
var execCalled = false;
var re = /a/;
re.exec = function () { execCalled = true; return null; };
if (KEY === 'split') {
// RegExp[@@split] doesn't call the regex's exec method, but first creates
// a new one. We need to return the patched regex when creating the new one.
re.constructor = {};
re.constructor[SPECIES] = function () { return re; };
}
re[SYMBOL]('');
return !execCalled;
}) : undefined;
if (
!DELEGATES_TO_SYMBOL ||
!DELEGATES_TO_EXEC ||
(KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
) {
var nativeRegExpMethod = /./[SYMBOL];
var fns = exec(
defined,
SYMBOL,
''[KEY],
function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
if (regexp.exec === regexpExec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
// The native String method already delegates to @@method (this
// polyfilled function), leasing to infinite recursion.
// We avoid it by directly calling the native @@method method.
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
}
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
}
return { done: false };
}
);
var strfn = fns[0];
var rxfn = fns[1];
redefine(String.prototype, KEY, strfn);
hide(RegExp.prototype, SYMBOL, length == 2
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
? function (string, arg) { return rxfn.call(string, this, arg); }
// 21.2.5.6 RegExp.prototype[@@match](string)
// 21.2.5.9 RegExp.prototype[@@search](string)
: function (string) { return rxfn.call(string, this); }
);
}
};
/***/ }),
/***/ "230e":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("d3f4");
var document = __webpack_require__("7726").document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/***/ "23c6":
/***/ (function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__("2d95");
var TAG = __webpack_require__("2b4c")('toStringTag');
// ES3 wrong here
var ARG = cof(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (e) { /* empty */ }
};
module.exports = function (it) {
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ }),
/***/ "2621":
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/***/ "2aba":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("7726");
var hide = __webpack_require__("32e9");
var has = __webpack_require__("69a8");
var SRC = __webpack_require__("ca5a")('src');
var $toString = __webpack_require__("fa5b");
var TO_STRING = 'toString';
var TPL = ('' + $toString).split(TO_STRING);
__webpack_require__("8378").inspectSource = function (it) {
return $toString.call(it);
};
(module.exports = function (O, key, val, safe) {
var isFunction = typeof val == 'function';
if (isFunction) has(val, 'name') || hide(val, 'name', key);
if (O[key] === val) return;
if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
if (O === global) {
O[key] = val;
} else if (!safe) {
delete O[key];
hide(O, key, val);
} else if (O[key]) {
O[key] = val;
} else {
hide(O, key, val);
}
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, TO_STRING, function toString() {
return typeof this == 'function' && this[SRC] || $toString.call(this);
});
/***/ }),
/***/ "2aeb":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__("cb7c");
var dPs = __webpack_require__("1495");
var enumBugKeys = __webpack_require__("e11e");
var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__("230e")('iframe');
var i = enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
__webpack_require__("fab2").appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE] = anObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ }),
/***/ "2b4c":
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__("5537")('wks');
var uid = __webpack_require__("ca5a");
var Symbol = __webpack_require__("7726").Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/***/ "2d00":
/***/ (function(module, exports) {
module.exports = false;
/***/ }),
/***/ "2d95":
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/***/ "2fdb":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.1.3.7 String.prototype.includes(searchString, position = 0)
var $export = __webpack_require__("5ca1");
var context = __webpack_require__("d2c8");
var INCLUDES = 'includes';
$export($export.P + $export.F * __webpack_require__("5147")(INCLUDES), 'String', {
includes: function includes(searchString /* , position = 0 */) {
return !!~context(this, searchString, INCLUDES)
.indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "32e9":
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__("86cc");
var createDesc = __webpack_require__("4630");
module.exports = __webpack_require__("9e1e") ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/***/ "38fd":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__("69a8");
var toObject = __webpack_require__("4bf8");
var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
var ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ }),
/***/ "41a0":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var create = __webpack_require__("2aeb");
var descriptor = __webpack_require__("4630");
var setToStringTag = __webpack_require__("7f20");
var IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__("32e9")(IteratorPrototype, __webpack_require__("2b4c")('iterator'), function () { return this; });
module.exports = function (Constructor, NAME, next) {
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ }),
/***/ "456d":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 Object.keys(O)
var toObject = __webpack_require__("4bf8");
var $keys = __webpack_require__("0d58");
__webpack_require__("5eda")('keys', function () {
return function keys(it) {
return $keys(toObject(it));
};
});
/***/ }),
/***/ "4588":
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/***/ "4630":
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/***/ "4bf8":
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__("be13");
module.exports = function (it) {
return Object(defined(it));
};
/***/ }),
/***/ "5147":
/***/ (function(module, exports, __webpack_require__) {
var MATCH = __webpack_require__("2b4c")('match');
module.exports = function (KEY) {
var re = /./;
try {
'/./'[KEY](re);
} catch (e) {
try {
re[MATCH] = false;
return !'/./'[KEY](re);
} catch (f) { /* empty */ }
} return true;
};
/***/ }),
/***/ "520a":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var regexpFlags = __webpack_require__("0bfb");
var nativeExec = RegExp.prototype.exec;
// This always refers to the native implementation, because the
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
// which loads this file before patching the method.
var nativeReplace = String.prototype.replace;
var patchedExec = nativeExec;
var LAST_INDEX = 'lastIndex';
var UPDATES_LAST_INDEX_WRONG = (function () {
var re1 = /a/,
re2 = /b*/g;
nativeExec.call(re1, 'a');
nativeExec.call(re2, 'a');
return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
})();
// nonparticipating capturing group, copied from es5-shim's String#split patch.
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
if (PATCH) {
patchedExec = function exec(str) {
var re = this;
var lastIndex, reCopy, match, i;
if (NPCG_INCLUDED) {
reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
}
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
match = nativeExec.call(re, str);
if (UPDATES_LAST_INDEX_WRONG && match) {
re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
}
if (NPCG_INCLUDED && match && match.length > 1) {
// Fix browsers whose `exec` methods don't consistently return `undefined`
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
// eslint-disable-next-line no-loop-func
nativeReplace.call(match[0], reCopy, function () {
for (i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
}
});
}
return match;
};
}
module.exports = patchedExec;
/***/ }),
/***/ "52a7":
/***/ (function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ }),
/***/ "5537":
/***/ (function(module, exports, __webpack_require__) {
var core = __webpack_require__("8378");
var global = __webpack_require__("7726");
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: core.version,
mode: __webpack_require__("2d00") ? 'pure' : 'global',
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
});
/***/ }),
/***/ "5ca1":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("7726");
var core = __webpack_require__("8378");
var hide = __webpack_require__("32e9");
var redefine = __webpack_require__("2aba");
var ctx = __webpack_require__("9b43");
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
var key, own, out, exp;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
// export native or passed
out = (own ? target : source)[key];
// bind timers to global for call from export context
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// extend global
if (target) redefine(target, key, out, type & $export.U);
// export
if (exports[key] != out) hide(exports, key, exp);
if (IS_PROTO && expProto[key] != out) expProto[key] = out;
}
};
global.core = core;
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/***/ "5eda":
/***/ (function(module, exports, __webpack_require__) {
// most Object methods by ES6 should accept primitives
var $export = __webpack_require__("5ca1");
var core = __webpack_require__("8378");
var fails = __webpack_require__("79e5");
module.exports = function (KEY, exec) {
var fn = (core.Object || {})[KEY] || Object[KEY];
var exp = {};
exp[KEY] = exec(fn);
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
};
/***/ }),
/***/ "5f1b":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var classof = __webpack_require__("23c6");
var builtinExec = RegExp.prototype.exec;
// `RegExpExec` abstract operation
// https://tc39.github.io/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 new TypeError('RegExp exec method returned something other than an Object or null');
}
return result;
}
if (classof(R) !== 'RegExp') {
throw new TypeError('RegExp#exec called on incompatible receiver');
}
return builtinExec.call(R, S);
};
/***/ }),
/***/ "613b":
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__("5537")('keys');
var uid = __webpack_require__("ca5a");
module.exports = function (key) {
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/***/ "626a":
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__("2d95");
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/***/ "6762":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://github.com/tc39/Array.prototype.includes
var $export = __webpack_require__("5ca1");
var $includes = __webpack_require__("c366")(true);
$export($export.P, 'Array', {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__("9c6c")('includes');
/***/ }),
/***/ "6821":
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__("626a");
var defined = __webpack_require__("be13");
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/***/ "69a8":
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/***/ "6a99":
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__("d3f4");
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/***/ "7333":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 19.1.2.1 Object.assign(target, source, ...)
var getKeys = __webpack_require__("0d58");
var gOPS = __webpack_require__("2621");
var pIE = __webpack_require__("52a7");
var toObject = __webpack_require__("4bf8");
var IObject = __webpack_require__("626a");
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__("79e5")(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = gOPS.f;
var isEnum = pIE.f;
while (aLen > index) {
var S = IObject(arguments[index++]);
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
} return T;
} : $assign;
/***/ }),
/***/ "7726":
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/***/ "77f1":
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__("4588");
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/***/ "79e5":
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/***/ "7f20":
/***/ (function(module, exports, __webpack_require__) {
var def = __webpack_require__("86cc").f;
var has = __webpack_require__("69a8");
var TAG = __webpack_require__("2b4c")('toStringTag');
module.exports = function (it, tag, stat) {
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};
/***/ }),
/***/ "8378":
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.5' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/***/ "84f2":
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/***/ "86cc":
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__("cb7c");
var IE8_DOM_DEFINE = __webpack_require__("c69a");
var toPrimitive = __webpack_require__("6a99");
var dP = Object.defineProperty;
exports.f = __webpack_require__("9e1e") ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/***/ "9b43":
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__("d8e8");
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
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);
};
};
/***/ }),
/***/ "9c6c":
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.31 Array.prototype[@@unscopables]
var UNSCOPABLES = __webpack_require__("2b4c")('unscopables');
var ArrayProto = Array.prototype;
if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__("32e9")(ArrayProto, UNSCOPABLES, {});
module.exports = function (key) {
ArrayProto[UNSCOPABLES][key] = true;
};
/***/ }),
/***/ "9def":
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__("4588");
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/***/ "9e1e":
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__("79e5")(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/***/ "a352":
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_a352__;
/***/ }),
/***/ "a481":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var anObject = __webpack_require__("cb7c");
var toObject = __webpack_require__("4bf8");
var toLength = __webpack_require__("9def");
var toInteger = __webpack_require__("4588");
var advanceStringIndex = __webpack_require__("0390");
var regExpExec = __webpack_require__("5f1b");
var max = Math.max;
var min = Math.min;
var floor = Math.floor;
var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
var maybeToString = function (it) {
return it === undefined ? it : String(it);
};
// @@replace logic
__webpack_require__("214f")('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
return [
// `String.prototype.replace` method
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
function replace(searchValue, replaceValue) {
var O = defined(this);
var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
return fn !== undefined
? fn.call(searchValue, O, replaceValue)
: $replace.call(String(O), searchValue, replaceValue);
},
// `RegExp.prototype[@@replace]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
function (regexp, replaceValue) {
var res = maybeCallNative($replace, regexp, this, replaceValue);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
var functionalReplace = typeof replaceValue === 'function';
if (!functionalReplace) replaceValue = String(replaceValue);
var global = rx.global;
if (global) {
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
}
var results = [];
while (true) {
var result = regExpExec(rx, S);
if (result === null) break;
results.push(result);
if (!global) break;
var matchStr = String(result[0]);
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
}
var accumulatedResult = '';
var nextSourcePosition = 0;
for (var i = 0; i < results.length; i++) {
result = results[i];
var matched = String(result[0]);
var position = max(min(toInteger(result.index), S.length), 0);
var captures = [];
// NOTE: This is equivalent to
// captures = result.slice(1).map(maybeToString)
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = [matched].concat(captures, position, S);
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
var replacement = String(replaceValue.apply(undefined, replacerArgs));
} else {
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
}
if (position >= nextSourcePosition) {
accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
nextSourcePosition = position + matched.length;
}
}
return accumulatedResult + S.slice(nextSourcePosition);
}
];
// https://tc39.github.io/ecma262/#sec-getsubstitution
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== undefined) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return $replace.call(replacement, symbols, function (match, ch) {
var capture;
switch (ch.charAt(0)) {
case '$': return '$';
case '&': return matched;
case '`': return str.slice(0, position);
case "'": return str.slice(tailPos);
case '<':
capture = namedCaptures[ch.slice(1, -1)];
break;
default: // \d\d?
var n = +ch;
if (n === 0) return match;
if (n > m) {
var f = floor(n / 10);
if (f === 0) return match;
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
return match;
}
capture = captures[n - 1];
}
return capture === undefined ? '' : capture;
});
}
});
/***/ }),
/***/ "aae3":
/***/ (function(module, exports, __webpack_require__) {
// 7.2.8 IsRegExp(argument)
var isObject = __webpack_require__("d3f4");
var cof = __webpack_require__("2d95");
var MATCH = __webpack_require__("2b4c")('match');
module.exports = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
};
/***/ }),
/***/ "ac6a":
/***/ (function(module, exports, __webpack_require__) {
var $iterators = __webpack_require__("cadf");
var getKeys = __webpack_require__("0d58");
var redefine = __webpack_require__("2aba");
var global = __webpack_require__("7726");
var hide = __webpack_require__("32e9");
var Iterators = __webpack_require__("84f2");
var wks = __webpack_require__("2b4c");
var ITERATOR = wks('iterator');
var TO_STRING_TAG = wks('toStringTag');
var ArrayValues = Iterators.Array;
var DOMIterables = {
CSSRuleList: true, // TODO: Not spec compliant, should be false.
CSSStyleDeclaration: false,
CSSValueList: false,
ClientRectList: false,
DOMRectList: false,
DOMStringList: false,
DOMTokenList: true,
DataTransferItemList: false,
FileList: false,
HTMLAllCollection: false,
HTMLCollection: false,
HTMLFormElement: false,
HTMLSelectElement: false,
MediaList: true, // TODO: Not spec compliant, should be false.
MimeTypeArray: false,
NamedNodeMap: false,
NodeList: true,
PaintRequestList: false,
Plugin: false,
PluginArray: false,
SVGLengthList: false,
SVGNumberList: false,
SVGPathSegList: false,
SVGPointList: false,
SVGStringList: false,
SVGTransformList: false,
SourceBufferList: false,
StyleSheetList: true, // TODO: Not spec compliant, should be false.
TextTrackCueList: false,
TextTrackList: false,
TouchList: false
};
for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
var NAME = collections[i];
var explicit = DOMIterables[NAME];
var Collection = global[NAME];
var proto = Collection && Collection.prototype;
var key;
if (proto) {
if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = ArrayValues;
if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
}
}
/***/ }),
/***/ "b0c5":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var regexpExec = __webpack_require__("520a");
__webpack_require__("5ca1")({
target: 'RegExp',
proto: true,
forced: regexpExec !== /./.exec
}, {
exec: regexpExec
});
/***/ }),
/***/ "be13":
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/***/ "c366":
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__("6821");
var toLength = __webpack_require__("9def");
var toAbsoluteIndex = __webpack_require__("77f1");
module.exports = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIObject($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
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/***/ "c649":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return insertNodeAt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return camelize; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return console; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return removeNode; });
/* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a481");
/* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0__);
function getConsole() {
if (typeof window !== "undefined") {
return window.console;
}
return global.console;
}
var console = getConsole();
function cached(fn) {
var cache = Object.create(null);
return function cachedFn(str) {
var hit = cache[str];
return hit || (cache[str] = fn(str));
};
}
var regex = /-(\w)/g;
var camelize = cached(function (str) {
return str.replace(regex, function (_, c) {
return c ? c.toUpperCase() : "";
});
});
function removeNode(node) {
if (node.parentElement !== null) {
node.parentElement.removeChild(node);
}
}
function insertNodeAt(fatherNode, node, position) {
var refNode = position === 0 ? fatherNode.children[0] : fatherNode.children[position - 1].nextSibling;
fatherNode.insertBefore(node, refNode);
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
/***/ }),
/***/ "c69a":
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__("9e1e") && !__webpack_require__("79e5")(function () {
return Object.defineProperty(__webpack_require__("230e")('div'), 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/***/ "c8ba":
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/***/ "ca5a":
/***/ (function(module, exports) {
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/***/ "cadf":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var addToUnscopables = __webpack_require__("9c6c");
var step = __webpack_require__("d53b");
var Iterators = __webpack_require__("84f2");
var toIObject = __webpack_require__("6821");
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__("01f9")(Array, 'Array', function (iterated, kind) {
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
var O = this._t;
var kind = this._k;
var index = this._i++;
if (!O || index >= O.length) {
this._t = undefined;
return step(1);
}
if (kind == 'keys') return step(0, index);
if (kind == 'values') return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ }),
/***/ "cb7c":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("d3f4");
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/***/ "ce10":
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__("69a8");
var toIObject = __webpack_require__("6821");
var arrayIndexOf = __webpack_require__("c366")(false);
var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
module.exports = function (object, names) {
var O = toIObject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/***/ "d2c8":
/***/ (function(module, exports, __webpack_require__) {
// helper for String#{startsWith, endsWith, includes}
var isRegExp = __webpack_require__("aae3");
var defined = __webpack_require__("be13");
module.exports = function (that, searchString, NAME) {
if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
return String(defined(that));
};
/***/ }),
/***/ "d3f4":
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/***/ "d53b":
/***/ (function(module, exports) {
module.exports = function (done, value) {
return { value: value, done: !!done };
};
/***/ }),
/***/ "d8e8":
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/***/ "e11e":
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/***/ "f559":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.1.3.18 String.prototype.startsWith(searchString [, position ])
var $export = __webpack_require__("5ca1");
var toLength = __webpack_require__("9def");
var context = __webpack_require__("d2c8");
var STARTS_WITH = 'startsWith';
var $startsWith = ''[STARTS_WITH];
$export($export.P + $export.F * __webpack_require__("5147")(STARTS_WITH), 'String', {
startsWith: function startsWith(searchString /* , position = 0 */) {
var that = context(this, searchString, STARTS_WITH);
var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
var search = String(searchString);
return $startsWith
? $startsWith.call(that, search, index)
: that.slice(index, index + search.length) === search;
}
});
/***/ }),
/***/ "f6fd":
/***/ (function(module, exports) {
// document.currentScript polyfill by Adam Miller
// MIT license
(function(document){
var currentScript = "currentScript",
scripts = document.getElementsByTagName('script'); // Live NodeList collection
// If browser needs currentScript polyfill, add get currentScript() to the document object
if (!(currentScript in document)) {
Object.defineProperty(document, currentScript, {
get: function(){
// IE 6-10 supports script readyState
// IE 10+ support stack trace
try { throw new Error(); }
catch (err) {
// Find the second match for the "at" string to get file src url from stack.
// Specifically works with the format of stack traces in IE.
var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1];
// For all scripts on the page, if src matches or if ready state is interactive, return the script tag
for(i in scripts){
if(scripts[i].src == res || scripts[i].readyState == "interactive"){
return scripts[i];
}
}
// If no match, return null
return null;
}
}
});
}
})(document);
/***/ }),
/***/ "f751":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__("5ca1");
$export($export.S + $export.F, 'Object', { assign: __webpack_require__("7333") });
/***/ }),
/***/ "fa5b":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__("5537")('native-function-to-string', Function.toString);
/***/ }),
/***/ "fab2":
/***/ (function(module, exports, __webpack_require__) {
var document = __webpack_require__("7726").document;
module.exports = document && document.documentElement;
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
if (true) {
__webpack_require__("f6fd")
}
var setPublicPath_i
if ((setPublicPath_i = window.document.currentScript) && (setPublicPath_i = setPublicPath_i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
__webpack_require__.p = setPublicPath_i[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.assign.js
var es6_object_assign = __webpack_require__("f751");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.starts-with.js
var es6_string_starts_with = __webpack_require__("f559");
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js
var web_dom_iterable = __webpack_require__("ac6a");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.iterator.js
var es6_array_iterator = __webpack_require__("cadf");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.keys.js
var es6_object_keys = __webpack_require__("456d");
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
function _iterableToArrayLimit(arr, i) {
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
// EXTERNAL MODULE: ./node_modules/core-js/modules/es7.array.includes.js
var es7_array_includes = __webpack_require__("6762");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.includes.js
var es6_string_includes = __webpack_require__("2fdb");
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
// EXTERNAL MODULE: external {"commonjs":"sortablejs","commonjs2":"sortablejs","amd":"sortablejs","root":"Sortable"}
var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_ = __webpack_require__("a352");
var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_);
// EXTERNAL MODULE: ./src/util/helper.js
var helper = __webpack_require__("c649");
// CONCATENATED MODULE: ./src/vuedraggable.js
function buildAttribute(object, propName, value) {
if (value === undefined) {
return object;
}
object = object || {};
object[propName] = value;
return object;
}
function computeVmIndex(vnodes, element) {
return vnodes.map(function (elt) {
return elt.elm;
}).indexOf(element);
}
function _computeIndexes(slots, children, isTransition, footerOffset) {
if (!slots) {
return [];
}
var elmFromNodes = slots.map(function (elt) {
return elt.elm;
});
var footerIndex = children.length - footerOffset;
var rawIndexes = _toConsumableArray(children).map(function (elt, idx) {
return idx >= footerIndex ? elmFromNodes.length : elmFromNodes.indexOf(elt);
});
return isTransition ? rawIndexes.filter(function (ind) {
return ind !== -1;
}) : rawIndexes;
}
function emit(evtName, evtData) {
var _this = this;
this.$nextTick(function () {
return _this.$emit(evtName.toLowerCase(), evtData);
});
}
function delegateAndEmit(evtName) {
var _this2 = this;
return function (evtData) {
if (_this2.realList !== null) {
_this2["onDrag" + evtName](evtData);
}
emit.call(_this2, evtName, evtData);
};
}
function isTransitionName(name) {
return ["transition-group", "TransitionGroup"].includes(name);
}
function vuedraggable_isTransition(slots) {
if (!slots || slots.length !== 1) {
return false;
}
var _slots = _slicedToArray(slots, 1),
componentOptions = _slots[0].componentOptions;
if (!componentOptions) {
return false;
}
return isTransitionName(componentOptions.tag);
}
function getSlot(slot, scopedSlot, key) {
return slot[key] || (scopedSlot[key] ? scopedSlot[key]() : undefined);
}
function computeChildrenAndOffsets(children, slot, scopedSlot) {
var headerOffset = 0;
var footerOffset = 0;
var header = getSlot(slot, scopedSlot, "header");
if (header) {
headerOffset = header.length;
children = children ? [].concat(_toConsumableArray(header), _toConsumableArray(children)) : _toConsumableArray(header);
}
var footer = getSlot(slot, scopedSlot, "footer");
if (footer) {
footerOffset = footer.length;
children = children ? [].concat(_toConsumableArray(children), _toConsumableArray(footer)) : _toConsumableArray(footer);
}
return {
children: children,
headerOffset: headerOffset,
footerOffset: footerOffset
};
}
function getComponentAttributes($attrs, componentData) {
var attributes = null;
var update = function update(name, value) {
attributes = buildAttribute(attributes, name, value);
};
var attrs = Object.keys($attrs).filter(function (key) {
return key === "id" || key.startsWith("data-");
}).reduce(function (res, key) {
res[key] = $attrs[key];
return res;
}, {});
update("attrs", attrs);
if (!componentData) {
return attributes;
}
var on = componentData.on,
props = componentData.props,
componentDataAttrs = componentData.attrs;
update("on", on);
update("props", props);
Object.assign(attributes.attrs, componentDataAttrs);
return attributes;
}
var eventsListened = ["Start", "Add", "Remove", "Update", "End"];
var eventsToEmit = ["Choose", "Unchoose", "Sort", "Filter", "Clone"];
var readonlyProperties = ["Move"].concat(eventsListened, eventsToEmit).map(function (evt) {
return "on" + evt;
});
var draggingElement = null;
var props = {
options: Object,
list: {
type: Array,
required: false,
default: null
},
value: {
type: Array,
required: false,
default: null
},
noTransitionOnDrag: {
type: Boolean,
default: false
},
clone: {
type: Function,
default: function _default(original) {
return original;
}
},
element: {
type: String,
default: "div"
},
tag: {
type: String,
default: null
},
move: {
type: Function,
default: null
},
componentData: {
type: Object,
required: false,
default: null
}
};
var draggableComponent = {
name: "draggable",
inheritAttrs: false,
props: props,
data: function data() {
return {
transitionMode: false,
noneFunctionalComponentMode: false
};
},
render: function render(h) {
var slots = this.$slots.default;
this.transitionMode = vuedraggable_isTransition(slots);
var _computeChildrenAndOf = computeChildrenAndOffsets(slots, this.$slots, this.$scopedSlots),
children = _computeChildrenAndOf.children,
headerOffset = _computeChildrenAndOf.headerOffset,
footerOffset = _computeChildrenAndOf.footerOffset;
this.headerOffset = headerOffset;
this.footerOffset = footerOffset;
var attributes = getComponentAttributes(this.$attrs, this.componentData);
return h(this.getTag(), attributes, children);
},
created: function created() {
if (this.list !== null && this.value !== null) {
helper["b" /* console */].error("Value and list props are mutually exclusive! Please set one or another.");
}
if (this.element !== "div") {
helper["b" /* console */].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props");
}
if (this.options !== undefined) {
helper["b" /* console */].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props");
}
},
mounted: function mounted() {
var _this3 = this;
this.noneFunctionalComponentMode = this.getTag().toLowerCase() !== this.$el.nodeName.toLowerCase() && !this.getIsFunctional();
if (this.noneFunctionalComponentMode && this.transitionMode) {
throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));
}
var optionsAdded = {};
eventsListened.forEach(function (elt) {
optionsAdded["on" + elt] = delegateAndEmit.call(_this3, elt);
});
eventsToEmit.forEach(function (elt) {
optionsAdded["on" + elt] = emit.bind(_this3, elt);
});
var attributes = Object.keys(this.$attrs).reduce(function (res, key) {
res[Object(helper["a" /* camelize */])(key)] = _this3.$attrs[key];
return res;
}, {});
var options = Object.assign({}, this.options, attributes, optionsAdded, {
onMove: function onMove(evt, originalEvent) {
return _this3.onDragMove(evt, originalEvent);
}
});
!("draggable" in options) && (options.draggable = ">*");
this._sortable = new external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default.a(this.rootContainer, options);
this.computeIndexes();
},
beforeDestroy: function beforeDestroy() {
if (this._sortable !== undefined) this._sortable.destroy();
},
computed: {
rootContainer: function rootContainer() {
return this.transitionMode ? this.$el.children[0] : this.$el;
},
realList: function realList() {
return this.list ? this.list : this.value;
}
},
watch: {
options: {
handler: function handler(newOptionValue) {
this.updateOptions(newOptionValue);
},
deep: true
},
$attrs: {
handler: function handler(newOptionValue) {
this.updateOptions(newOptionValue);
},
deep: true
},
realList: function realList() {
this.computeIndexes();
}
},
methods: {
getIsFunctional: function getIsFunctional() {
var fnOptions = this._vnode.fnOptions;
return fnOptions && fnOptions.functional;
},
getTag: function getTag() {
return this.tag || this.element;
},
updateOptions: function updateOptions(newOptionValue) {
for (var property in newOptionValue) {
var value = Object(helper["a" /* camelize */])(property);
if (readonlyProperties.indexOf(value) === -1) {
this._sortable.option(value, newOptionValue[property]);
}
}
},
getChildrenNodes: function getChildrenNodes() {
if (this.noneFunctionalComponentMode) {
return this.$children[0].$slots.default;
}
var rawNodes = this.$slots.default;
return this.transitionMode ? rawNodes[0].child.$slots.default : rawNodes;
},
computeIndexes: function computeIndexes() {
var _this4 = this;
this.$nextTick(function () {
_this4.visibleIndexes = _computeIndexes(_this4.getChildrenNodes(), _this4.rootContainer.children, _this4.transitionMode, _this4.footerOffset);
});
},
getUnderlyingVm: function getUnderlyingVm(htmlElt) {
var index = computeVmIndex(this.getChildrenNodes() || [], htmlElt);
if (index === -1) {
//Edge case during move callback: related element might be
//an element different from collection
return null;
}
var element = this.realList[index];
return {
index: index,
element: element
};
},
getUnderlyingPotencialDraggableComponent: function getUnderlyingPotencialDraggableComponent(_ref) {
var vue = _ref.__vue__;
if (!vue || !vue.$options || !isTransitionName(vue.$options._componentTag)) {
if (!("realList" in vue) && vue.$children.length === 1 && "realList" in vue.$children[0]) return vue.$children[0];
return vue;
}
return vue.$parent;
},
emitChanges: function emitChanges(evt) {
var _this5 = this;
this.$nextTick(function () {
_this5.$emit("change", evt);
});
},
alterList: function alterList(onList) {
if (this.list) {
onList(this.list);
return;
}
var newList = _toConsumableArray(this.value);
onList(newList);
this.$emit("input", newList);
},
spliceList: function spliceList() {
var _arguments = arguments;
var spliceList = function spliceList(list) {
return list.splice.apply(list, _toConsumableArray(_arguments));
};
this.alterList(spliceList);
},
updatePosition: function updatePosition(oldIndex, newIndex) {
var updatePosition = function updatePosition(list) {
return list.splice(newIndex, 0, list.splice(oldIndex, 1)[0]);
};
this.alterList(updatePosition);
},
getRelatedContextFromMoveEvent: function getRelatedContextFromMoveEvent(_ref2) {
var to = _ref2.to,
related = _ref2.related;
var component = this.getUnderlyingPotencialDraggableComponent(to);
if (!component) {
return {
component: component
};
}
var list = component.realList;
var context = {
list: list,
component: component
};
if (to !== related && list && component.getUnderlyingVm) {
var destination = component.getUnderlyingVm(related);
if (destination) {
return Object.assign(destination, context);
}
}
return context;
},
getVmIndex: function getVmIndex(domIndex) {
var indexes = this.visibleIndexes;
var numberIndexes = indexes.length;
return domIndex > numberIndexes - 1 ? numberIndexes : indexes[domIndex];
},
getComponent: function getComponent() {
return this.$slots.default[0].componentInstance;
},
resetTransitionData: function resetTransitionData(index) {
if (!this.noTransitionOnDrag || !this.transitionMode) {
return;
}
var nodes = this.getChildrenNodes();
nodes[index].data = null;
var transitionContainer = this.getComponent();
transitionContainer.children = [];
transitionContainer.kept = undefined;
},
onDragStart: function onDragStart(evt) {
this.context = this.getUnderlyingVm(evt.item);
evt.item._underlying_vm_ = this.clone(this.context.element);
draggingElement = evt.item;
},
onDragAdd: function onDragAdd(evt) {
var element = evt.item._underlying_vm_;
if (element === undefined) {
return;
}
Object(helper["d" /* removeNode */])(evt.item);
var newIndex = this.getVmIndex(evt.newIndex);
this.spliceList(newIndex, 0, element);
this.computeIndexes();
var added = {
element: element,
newIndex: newIndex
};
this.emitChanges({
added: added
});
},
onDragRemove: function onDragRemove(evt) {
Object(helper["c" /* insertNodeAt */])(this.rootContainer, evt.item, evt.oldIndex);
if (evt.pullMode === "clone") {
Object(helper["d" /* removeNode */])(evt.clone);
return;
}
var oldIndex = this.context.index;
this.spliceList(oldIndex, 1);
var removed = {
element: this.context.element,
oldIndex: oldIndex
};
this.resetTransitionData(oldIndex);
this.emitChanges({
removed: removed
});
},
onDragUpdate: function onDragUpdate(evt) {
Object(helper["d" /* removeNode */])(evt.item);
Object(helper["c" /* insertNodeAt */])(evt.from, evt.item, evt.oldIndex);
var oldIndex = this.context.index;
var newIndex = this.getVmIndex(evt.newIndex);
this.updatePosition(oldIndex, newIndex);
var moved = {
element: this.context.element,
oldIndex: oldIndex,
newIndex: newIndex
};
this.emitChanges({
moved: moved
});
},
updateProperty: function updateProperty(evt, propertyName) {
evt.hasOwnProperty(propertyName) && (evt[propertyName] += this.headerOffset);
},
computeFutureIndex: function computeFutureIndex(relatedContext, evt) {
if (!relatedContext.element) {
return 0;
}
var domChildren = _toConsumableArray(evt.to.children).filter(function (el) {
return el.style["display"] !== "none";
});
var currentDOMIndex = domChildren.indexOf(evt.related);
var currentIndex = relatedContext.component.getVmIndex(currentDOMIndex);
var draggedInList = domChildren.indexOf(draggingElement) !== -1;
return draggedInList || !evt.willInsertAfter ? currentIndex : currentIndex + 1;
},
onDragMove: function onDragMove(evt, originalEvent) {
var onMove = this.move;
if (!onMove || !this.realList) {
return true;
}
var relatedContext = this.getRelatedContextFromMoveEvent(evt);
var draggedContext = this.context;
var futureIndex = this.computeFutureIndex(relatedContext, evt);
Object.assign(draggedContext, {
futureIndex: futureIndex
});
var sendEvt = Object.assign({}, evt, {
relatedContext: relatedContext,
draggedContext: draggedContext
});
return onMove(sendEvt, originalEvent);
},
onDragEnd: function onDragEnd() {
this.computeIndexes();
draggingElement = null;
}
}
};
if (typeof window !== "undefined" && "Vue" in window) {
window.Vue.component("draggable", draggableComponent);
}
/* harmony default export */ var vuedraggable = (draggableComponent);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (vuedraggable);
/***/ })
/******/ })["default"];
});
//# sourceMappingURL=vuedraggable.umd.js.map
================================================
FILE: docs/app.js
================================================
[File too large to display: 11.7 MB]
================================================
FILE: docs/index.html
================================================
vuedraggable
We're sorry but vuedraggable doesn't work properly without JavaScript enabled. Please enable it to continue.
================================================
FILE: documentation/Vue.draggable.for.ReadME.md
================================================
## For Vue.js 1.0
Use it exactly as v-for directive, passing optional parameters using 'options' parameter.
Options parameter can be json string or a full javascript object.
``` html
```
### Limitation
* This directive works only when applied to arrays and not to objects.
* `onStart`, `onUpdate`, `onAdd`, `onRemove` Sortable.js options hooks are used by v-dragable-for to update VM. As such these four options are not usable with v-dragable-for. If you need to listen to re-order events, you can watch the underlying view model collection. For example:
``` js
watch: {
'list1': function () {
console.log('Collection updated!');
},
```
### fiddle
Simple:
https://jsfiddle.net/dede89/j62g58z7/
Two Lists:
https://jsfiddle.net/dede89/hqxranrd/
Example with list clone:
https://jsfiddle.net/dede89/u5ecgtsj/
## Installation
- Available through:
``` js
npm install vuedraggable
```
``` js
Bower install vue.draggable
```
Version 1.0.9 is Vue.js 1.0 compatible
- #### For Modules
``` js
// ES6
//For Vue.js 1.0 only
import VueDraggable from 'vuedraggable'
import Vue from 'vue'
Vue.use(VueDraggable)
// ES5
//For Vue.js 1.0
var Vue = require('vue')
Vue.use(require('vuedraggable'))
```
- #### For `
================================================
FILE: example/components/clone-on-control.vue
================================================
Draggable 1
{{ element.name }}
Draggable 2
{{ element.name }}
================================================
FILE: example/components/clone.vue
================================================
Draggable 1
{{ element.name }}
Draggable 2
{{ element.name }}
================================================
FILE: example/components/custom-clone.vue
================================================
Draggable 1
{{ element.name }}
Draggable 2
{{ element.name }}
================================================
FILE: example/components/footerslot.vue
================================================
Draggable with footer
{{ element.name }}
Add
Replace
================================================
FILE: example/components/functional.vue
================================================
Draggable
{{ item.title }}
================================================
FILE: example/components/handle.vue
================================================
================================================
FILE: example/components/headerslot.vue
================================================
Draggable with header
{{ element.name }}
Add
Replace
================================================
FILE: example/components/infra/nested.vue
================================================
{{ el.name }}
================================================
FILE: example/components/infra/raw-displayer.vue
================================================
{{ title }}
{{ valueString }}
================================================
FILE: example/components/nested/nested-store.js
================================================
import Vuex from "vuex";
import Vue from "vue";
Vue.use(Vuex);
export const nested = {
namespaced: true,
state: {
elements: [
{
id: 1,
name: "Shrek",
elements: []
},
{
id: 2,
name: "Fiona",
elements: [
{
id: 4,
name: "Lord Farquad",
elements: []
},
{
id: 5,
name: "Prince Charming",
elements: []
}
]
},
{
id: 3,
name: "Donkey",
elements: []
}
]
},
mutations: {
updateElements: (state, payload) => {
state.elements = payload;
}
},
actions: {
updateElements: ({ commit }, payload) => {
commit("updateElements", payload);
}
}
};
================================================
FILE: example/components/nested/nested-test.vue
================================================
================================================
FILE: example/components/nested-example.vue
================================================
================================================
FILE: example/components/nested-with-vmodel.vue
================================================
================================================
FILE: example/components/simple.vue
================================================
Draggable {{ draggingInfo }}
{{ element.name }}
================================================
FILE: example/components/table-column-example.vue
================================================
Draggable table
{{ header }}
{{ item[header] }}
================================================
FILE: example/components/table-example.vue
================================================
Draggable table
Id
Name
Sport
{{ item.id }}
{{ item.name }}
{{ item.sport }}
================================================
FILE: example/components/third-party.vue
================================================
================================================
FILE: example/components/transition-example-2.vue
================================================
To original order
Transition
{{ element.name }}
================================================
FILE: example/components/transition-example.vue
================================================
To original order
Transition
{{ element.name }}
================================================
FILE: example/components/two-list-headerslots.vue
================================================
First draggable with header
{{ element.name }}
Add
Replace
Second draggable with header
{{ element.name }}
Add
Replace
================================================
FILE: example/components/two-lists.vue
================================================
Draggable 1
{{ element.name }} {{ index }}
Draggable 2
{{ element.name }} {{ index }}
================================================
FILE: example/debug-components/future-index.vue
================================================
================================================
FILE: example/debug-components/nested/draggable-list.vue
================================================
{{ element.name }}
================================================
FILE: example/debug-components/slot-example.vue
================================================
Draggable
{{ element.name }}
header slot
footer slot
================================================
FILE: example/main.js
================================================
import Vue from "vue";
import App from "./App.vue";
import VueRouter from "vue-router";
import routes from "./route";
import rawDisplayer from "./components/infra/raw-displayer.vue";
import ElementUI from "element-ui";
import store from "./store";
import "bootstrap/dist/css/bootstrap.min.css";
import "font-awesome/css/font-awesome.css";
require("bootstrap");
const router = new VueRouter({
routes
});
Vue.config.productionTip = false;
Vue.use(VueRouter);
Vue.component("rawDisplayer", rawDisplayer);
Vue.use(ElementUI);
new Vue({
store,
router,
render: h => h(App)
}).$mount("#app");
================================================
FILE: example/route.js
================================================
const ctx = require.context("./components/", false, /\.vue$/);
const routes = ctx.keys().map(key => ({
path: key
}));
routes.push({
path: "/",
redirect: "./simple"
});
export default routes;
================================================
FILE: example/store.js
================================================
import { nested } from "./components/nested/nested-store";
import Vuex from "vuex";
import Vue from "vue";
Vue.use(Vuex);
export default new Vuex.Store({
namespaced: true,
modules: {
nested
}
});
================================================
FILE: jest.config.js
================================================
module.exports = {
moduleFileExtensions: [
"js",
"jsx",
"json",
"vue"
],
transform: {
"^.+\\.vue$": "vue-jest",
".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": "jest-transform-stub",
"^.+\\.jsx?$": "babel-jest"
},
moduleNameMapper: {
"^@/(.*)$": "/src/$1"
},
snapshotSerializers: [
"jest-serializer-vue"
],
testMatch: [
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
],
testURL: "http://localhost/",
collectCoverageFrom: [
"/src/vuedraggable.js",
"/src/util/helper.js"
],
// testEnvironment: "node",
transformIgnorePatterns: [
"node_modules/(?!(babel-jest|jest-vue-preprocessor)/)"
],
};
================================================
FILE: package.json
================================================
{
"name": "vuedraggable",
"version": "2.24.3",
"description": "draggable component for vue",
"license": "MIT",
"main": "dist/vuedraggable.umd.min.js",
"types": "src/vuedraggable.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/SortableJS/Vue.Draggable.git"
},
"private": false,
"scripts": {
"serve": "vue-cli-service serve ./example/main.js --open --mode local",
"build:doc": "vue-cli-service build ./example/main.js --dest docs --mode development",
"build": "vue-cli-service build --name vuedraggable --entry ./src/vuedraggable.js --target lib",
"lint": "vue-cli-service lint src example",
"prepublishOnly": "npm run lint && npm run test:unit && npm run build:doc && npm run build",
"test:unit": "vue-cli-service test:unit --coverage",
"test:coverage": "vue-cli-service test:unit --coverage --verbose && codecov"
},
"keywords": [
"vue",
"vuejs",
"drag",
"and",
"drop",
"list",
"Sortable.js",
"component",
"nested"
],
"dependencies": {
"sortablejs": "1.10.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.11.0",
"@vue/cli-plugin-eslint": "^3.11.0",
"@vue/cli-plugin-unit-jest": "^3.11.0",
"@vue/cli-service": "^3.11.0",
"@vue/eslint-config-prettier": "^4.0.1",
"@vue/test-utils": "^1.1.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"bootstrap": "^4.3.1",
"codecov": "^3.2.0",
"component-fixture": "^0.4.1",
"element-ui": "^2.5.4",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"font-awesome": "^4.7.0",
"jquery": "^3.5.1",
"vue": "^2.6.12",
"vue-cli-plugin-component": "^1.10.5",
"vue-router": "^3.0.2",
"vue-server-renderer": "^2.6.12",
"vue-template-compiler": "^2.6.12",
"vuetify": "^1.5.16",
"vuex": "^3.1.1"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"@vue/prettier"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"files": [
"dist/*.css",
"dist/*.map",
"dist/*.js",
"src/*"
],
"module": "dist/vuedraggable.umd.js"
}
================================================
FILE: public/index.html
================================================
vuedraggable
We're sorry but vuedraggable doesn't work properly without JavaScript enabled. Please enable it to continue.
================================================
FILE: src/util/helper.js
================================================
function getConsole() {
if (typeof window !== "undefined") {
return window.console;
}
return global.console;
}
const console = getConsole();
function cached(fn) {
const cache = Object.create(null);
return function cachedFn(str) {
const hit = cache[str];
return hit || (cache[str] = fn(str));
};
}
const regex = /-(\w)/g;
const camelize = cached(str =>
str.replace(regex, (_, c) => (c ? c.toUpperCase() : ""))
);
function removeNode(node) {
if (node.parentElement !== null) {
node.parentElement.removeChild(node);
}
}
function insertNodeAt(fatherNode, node, position) {
const refNode =
position === 0
? fatherNode.children[0]
: fatherNode.children[position - 1].nextSibling;
fatherNode.insertBefore(node, refNode);
}
export { insertNodeAt, camelize, console, removeNode };
================================================
FILE: src/vuedraggable.d.ts
================================================
declare module 'vuedraggable' {
import Vue, { VueConstructor } from 'vue';
type CombinedVueInstance<
Instance extends Vue,
Data,
Methods,
Computed,
Props
> = Data & Methods & Computed & Props & Instance;
type ExtendedVue<
Instance extends Vue,
Data,
Methods,
Computed,
Props
> = VueConstructor<
CombinedVueInstance & Vue
>;
export type DraggedContext = {
index: number;
futureIndex: number;
element: T;
};
export type DropContext = {
index: number;
component: Vue;
element: T;
};
export type Rectangle = {
top: number;
right: number;
bottom: number;
left: number;
width: number;
height: number;
};
export type MoveEvent = {
originalEvent: DragEvent;
dragged: Element;
draggedContext: DraggedContext;
draggedRect: Rectangle;
related: Element;
relatedContext: DropContext;
relatedRect: Rectangle;
from: Element;
to: Element;
willInsertAfter: boolean;
isTrusted: boolean;
};
const draggable: ExtendedVue<
Vue,
{},
{},
{},
{
options: any;
list: any[];
value: any[];
noTransitionOnDrag?: boolean;
clone: any;
tag?: string | null;
move: any;
componentData: any;
}
>;
export default draggable;
}
================================================
FILE: src/vuedraggable.js
================================================
import Sortable from "sortablejs";
import { insertNodeAt, camelize, console, removeNode } from "./util/helper";
function buildAttribute(object, propName, value) {
if (value === undefined) {
return object;
}
object = object || {};
object[propName] = value;
return object;
}
function computeVmIndex(vnodes, element) {
return vnodes.map(elt => elt.elm).indexOf(element);
}
function computeIndexes(slots, children, isTransition, footerOffset) {
if (!slots) {
return [];
}
const elmFromNodes = slots.map(elt => elt.elm);
const footerIndex = children.length - footerOffset;
const rawIndexes = [...children].map((elt, idx) =>
idx >= footerIndex ? elmFromNodes.length : elmFromNodes.indexOf(elt)
);
return isTransition ? rawIndexes.filter(ind => ind !== -1) : rawIndexes;
}
function emit(evtName, evtData) {
this.$nextTick(() => this.$emit(evtName.toLowerCase(), evtData));
}
function delegateAndEmit(evtName) {
return evtData => {
if (this.realList !== null) {
this["onDrag" + evtName](evtData);
}
emit.call(this, evtName, evtData);
};
}
function isTransitionName(name) {
return ["transition-group", "TransitionGroup"].includes(name);
}
function isTransition(slots) {
if (!slots || slots.length !== 1) {
return false;
}
const [{ componentOptions }] = slots;
if (!componentOptions) {
return false;
}
return isTransitionName(componentOptions.tag);
}
function getSlot(slot, scopedSlot, key) {
return slot[key] || (scopedSlot[key] ? scopedSlot[key]() : undefined);
}
function computeChildrenAndOffsets(children, slot, scopedSlot) {
let headerOffset = 0;
let footerOffset = 0;
const header = getSlot(slot, scopedSlot, "header");
if (header) {
headerOffset = header.length;
children = children ? [...header, ...children] : [...header];
}
const footer = getSlot(slot, scopedSlot, "footer");
if (footer) {
footerOffset = footer.length;
children = children ? [...children, ...footer] : [...footer];
}
return { children, headerOffset, footerOffset };
}
function getComponentAttributes($attrs, componentData) {
let attributes = null;
const update = (name, value) => {
attributes = buildAttribute(attributes, name, value);
};
const attrs = Object.keys($attrs)
.filter(key => key === "id" || key.startsWith("data-"))
.reduce((res, key) => {
res[key] = $attrs[key];
return res;
}, {});
update("attrs", attrs);
if (!componentData) {
return attributes;
}
const { on, props, attrs: componentDataAttrs } = componentData;
update("on", on);
update("props", props);
Object.assign(attributes.attrs, componentDataAttrs);
return attributes;
}
const eventsListened = ["Start", "Add", "Remove", "Update", "End"];
const eventsToEmit = ["Choose", "Unchoose", "Sort", "Filter", "Clone"];
const readonlyProperties = ["Move", ...eventsListened, ...eventsToEmit].map(
evt => "on" + evt
);
var draggingElement = null;
const props = {
options: Object,
list: {
type: Array,
required: false,
default: null
},
value: {
type: Array,
required: false,
default: null
},
noTransitionOnDrag: {
type: Boolean,
default: false
},
clone: {
type: Function,
default: original => {
return original;
}
},
element: {
type: String,
default: "div"
},
tag: {
type: String,
default: null
},
move: {
type: Function,
default: null
},
componentData: {
type: Object,
required: false,
default: null
}
};
const draggableComponent = {
name: "draggable",
inheritAttrs: false,
props,
data() {
return {
transitionMode: false,
noneFunctionalComponentMode: false
};
},
render(h) {
const slots = this.$slots.default;
this.transitionMode = isTransition(slots);
const { children, headerOffset, footerOffset } = computeChildrenAndOffsets(
slots,
this.$slots,
this.$scopedSlots
);
this.headerOffset = headerOffset;
this.footerOffset = footerOffset;
const attributes = getComponentAttributes(this.$attrs, this.componentData);
return h(this.getTag(), attributes, children);
},
created() {
if (this.list !== null && this.value !== null) {
console.error(
"Value and list props are mutually exclusive! Please set one or another."
);
}
if (this.element !== "div") {
console.warn(
"Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"
);
}
if (this.options !== undefined) {
console.warn(
"Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props"
);
}
},
mounted() {
this.noneFunctionalComponentMode =
this.getTag().toLowerCase() !== this.$el.nodeName.toLowerCase() &&
!this.getIsFunctional();
if (this.noneFunctionalComponentMode && this.transitionMode) {
throw new Error(
`Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ${this.getTag()}`
);
}
const optionsAdded = {};
eventsListened.forEach(elt => {
optionsAdded["on" + elt] = delegateAndEmit.call(this, elt);
});
eventsToEmit.forEach(elt => {
optionsAdded["on" + elt] = emit.bind(this, elt);
});
const attributes = Object.keys(this.$attrs).reduce((res, key) => {
res[camelize(key)] = this.$attrs[key];
return res;
}, {});
const options = Object.assign({}, this.options, attributes, optionsAdded, {
onMove: (evt, originalEvent) => {
return this.onDragMove(evt, originalEvent);
}
});
!("draggable" in options) && (options.draggable = ">*");
this._sortable = new Sortable(this.rootContainer, options);
this.computeIndexes();
},
beforeDestroy() {
if (this._sortable !== undefined) this._sortable.destroy();
},
computed: {
rootContainer() {
return this.transitionMode ? this.$el.children[0] : this.$el;
},
realList() {
return this.list ? this.list : this.value;
}
},
watch: {
options: {
handler(newOptionValue) {
this.updateOptions(newOptionValue);
},
deep: true
},
$attrs: {
handler(newOptionValue) {
this.updateOptions(newOptionValue);
},
deep: true
},
realList() {
this.computeIndexes();
}
},
methods: {
getIsFunctional() {
const { fnOptions } = this._vnode;
return fnOptions && fnOptions.functional;
},
getTag() {
return this.tag || this.element;
},
updateOptions(newOptionValue) {
for (var property in newOptionValue) {
const value = camelize(property);
if (readonlyProperties.indexOf(value) === -1) {
this._sortable.option(value, newOptionValue[property]);
}
}
},
getChildrenNodes() {
if (this.noneFunctionalComponentMode) {
return this.$children[0].$slots.default;
}
const rawNodes = this.$slots.default;
return this.transitionMode ? rawNodes[0].child.$slots.default : rawNodes;
},
computeIndexes() {
this.$nextTick(() => {
this.visibleIndexes = computeIndexes(
this.getChildrenNodes(),
this.rootContainer.children,
this.transitionMode,
this.footerOffset
);
});
},
getUnderlyingVm(htmlElt) {
const index = computeVmIndex(this.getChildrenNodes() || [], htmlElt);
if (index === -1) {
//Edge case during move callback: related element might be
//an element different from collection
return null;
}
const element = this.realList[index];
return { index, element };
},
getUnderlyingPotencialDraggableComponent({ __vue__: vue }) {
if (
!vue ||
!vue.$options ||
!isTransitionName(vue.$options._componentTag)
) {
if (
!("realList" in vue) &&
vue.$children.length === 1 &&
"realList" in vue.$children[0]
)
return vue.$children[0];
return vue;
}
return vue.$parent;
},
emitChanges(evt) {
this.$nextTick(() => {
this.$emit("change", evt);
});
},
alterList(onList) {
if (this.list) {
onList(this.list);
return;
}
const newList = [...this.value];
onList(newList);
this.$emit("input", newList);
},
spliceList() {
const spliceList = list => list.splice(...arguments);
this.alterList(spliceList);
},
updatePosition(oldIndex, newIndex) {
const updatePosition = list =>
list.splice(newIndex, 0, list.splice(oldIndex, 1)[0]);
this.alterList(updatePosition);
},
getRelatedContextFromMoveEvent({ to, related }) {
const component = this.getUnderlyingPotencialDraggableComponent(to);
if (!component) {
return { component };
}
const list = component.realList;
const context = { list, component };
if (to !== related && list && component.getUnderlyingVm) {
const destination = component.getUnderlyingVm(related);
if (destination) {
return Object.assign(destination, context);
}
}
return context;
},
getVmIndex(domIndex) {
const indexes = this.visibleIndexes;
const numberIndexes = indexes.length;
return domIndex > numberIndexes - 1 ? numberIndexes : indexes[domIndex];
},
getComponent() {
return this.$slots.default[0].componentInstance;
},
resetTransitionData(index) {
if (!this.noTransitionOnDrag || !this.transitionMode) {
return;
}
var nodes = this.getChildrenNodes();
nodes[index].data = null;
const transitionContainer = this.getComponent();
transitionContainer.children = [];
transitionContainer.kept = undefined;
},
onDragStart(evt) {
this.context = this.getUnderlyingVm(evt.item);
evt.item._underlying_vm_ = this.clone(this.context.element);
draggingElement = evt.item;
},
onDragAdd(evt) {
const element = evt.item._underlying_vm_;
if (element === undefined) {
return;
}
removeNode(evt.item);
const newIndex = this.getVmIndex(evt.newIndex);
this.spliceList(newIndex, 0, element);
this.computeIndexes();
const added = { element, newIndex };
this.emitChanges({ added });
},
onDragRemove(evt) {
insertNodeAt(this.rootContainer, evt.item, evt.oldIndex);
if (evt.pullMode === "clone") {
removeNode(evt.clone);
return;
}
const oldIndex = this.context.index;
this.spliceList(oldIndex, 1);
const removed = { element: this.context.element, oldIndex };
this.resetTransitionData(oldIndex);
this.emitChanges({ removed });
},
onDragUpdate(evt) {
removeNode(evt.item);
insertNodeAt(evt.from, evt.item, evt.oldIndex);
const oldIndex = this.context.index;
const newIndex = this.getVmIndex(evt.newIndex);
this.updatePosition(oldIndex, newIndex);
const moved = { element: this.context.element, oldIndex, newIndex };
this.emitChanges({ moved });
},
updateProperty(evt, propertyName) {
evt.hasOwnProperty(propertyName) &&
(evt[propertyName] += this.headerOffset);
},
computeFutureIndex(relatedContext, evt) {
if (!relatedContext.element) {
return 0;
}
const domChildren = [...evt.to.children].filter(
el => el.style["display"] !== "none"
);
const currentDOMIndex = domChildren.indexOf(evt.related);
const currentIndex = relatedContext.component.getVmIndex(currentDOMIndex);
const draggedInList = domChildren.indexOf(draggingElement) !== -1;
return draggedInList || !evt.willInsertAfter
? currentIndex
: currentIndex + 1;
},
onDragMove(evt, originalEvent) {
const onMove = this.move;
if (!onMove || !this.realList) {
return true;
}
const relatedContext = this.getRelatedContextFromMoveEvent(evt);
const draggedContext = this.context;
const futureIndex = this.computeFutureIndex(relatedContext, evt);
Object.assign(draggedContext, { futureIndex });
const sendEvt = Object.assign({}, evt, {
relatedContext,
draggedContext
});
return onMove(sendEvt, originalEvent);
},
onDragEnd() {
this.computeIndexes();
draggingElement = null;
}
}
};
if (typeof window !== "undefined" && "Vue" in window) {
window.Vue.component("draggable", draggableComponent);
}
export default draggableComponent;
================================================
FILE: tests/unit/.eslintrc.js
================================================
module.exports = {
env: {
jest: true
}
};
================================================
FILE: tests/unit/helper/DraggableWithList.vue
================================================
{{item}}
================================================
FILE: tests/unit/helper/DraggableWithModel.vue
================================================
{{item}}
================================================
FILE: tests/unit/helper/DraggableWithTransition.vue
================================================
{{item}}
================================================
FILE: tests/unit/helper/FakeComponent.js
================================================
export default {
name: "Fake",
props: {
prop1: {
type: String,
default: "string"
}
},
template: "{{prop1}}
"
}
================================================
FILE: tests/unit/helper/FakeFunctionalComponent.js
================================================
export default {
name: "FakeFunctional",
functional:true,
props: {
prop1: {
type: String,
default: "string"
}
},
render(createElement, context) {
return createElement('button', 'Click me');
}
}
================================================
FILE: tests/unit/util/helper.node.spec.js
================================================
/**
* @jest-environment node
*/
import { console } from "@/util/helper";
describe("console", () => {
test.each([
["log"],
["warn"],
["error"],
["info"],
])(
"has %s function",
(key) => {
const actual = console[key];
expect(typeof actual).toEqual("function");
}
)
});
================================================
FILE: tests/unit/util/helper.spec.js
================================================
import { camelize, console } from "@/util/helper";
describe("camelize", () => {
test.each([
["MyProp", "MyProp"],
["MyProp", "MyProp"],
["kebab-case", "kebabCase"],
["multi-hyphen-string", "multiHyphenString"],
["drag-class", "dragClass"],
["test-", "test-"]
])(
"transform %s into %s",
(value, expected) =>{
const actual = camelize(value);
expect(actual).toEqual(expected);
}
)
});
describe("console", () => {
test.each([
["log"],
["warn"],
["error"],
["info"],
])(
"has %s function",
(key) =>{
const actual = console[key];
expect(typeof actual).toEqual("function");
}
)
});
================================================
FILE: tests/unit/vuedraggable.integrated.spec.js
================================================
import { mount } from "@vue/test-utils";
import Sortable from "sortablejs";
jest.genMockFromModule("sortablejs");
jest.mock("sortablejs");
const SortableFake = {
destroy: jest.fn(),
option: jest.fn(),
};
Sortable.mockImplementation(() => SortableFake);
import Vue from "vue";
import DraggableWithList from "./helper/DraggableWithList";
import DraggableWithModel from "./helper/DraggableWithList";
import DraggableWithTransition from "./helper/DraggableWithTransition";
import draggable from "@/vuedraggable";
let wrapper;
let element;
let vm;
function getEvent(name) {
return Sortable.mock.calls[0][1][name];
}
const expectedArray = [0, 1, 3, 4, 5, 6, 7, 2, 8, 9];
const expectedDomWithWrapper = (wrapper) =>
`<${wrapper}>${expectedArray
.map((nu) => `${nu}
`)
.join("")}${wrapper}>`;
const expectedDomNoTransition = expectedDomWithWrapper("span");
const expectedDomTransition = `${expectedDomWithWrapper(
"transition-group-stub"
)}
`;
function normalizeHTML(wrapper) {
return wrapper.html().replace(/(\r\n\t|\n|\r\t| )/gm, "");
}
function expectHTML(wrapper, expected) {
const htmlStripped = normalizeHTML(wrapper);
expect(htmlStripped).toEqual(expected);
}
describe.each([
[DraggableWithList, "draggable with list", expectedDomNoTransition, "span"],
[DraggableWithModel, "draggable with model", expectedDomNoTransition, "span"],
[
DraggableWithTransition,
"draggable with transition",
expectedDomTransition,
"transition-group-stub",
],
])(
"should update list and DOM with component: %s %s",
(component, _, expectedDom, expectWrapper) => {
describe("when handling sort", () => {
beforeEach(async () => {
jest.resetAllMocks();
wrapper = mount(component);
vm = wrapper.vm;
element = wrapper.find(expectWrapper).element;
const item = element.children[2];
const startEvt = { item };
getEvent("onStart")(startEvt);
await Vue.nextTick();
const firstDraggable = element.children[1];
element.removeChild(item);
element.insertBefore(item, firstDraggable);
getEvent("onUpdate")({
item,
oldIndex: 2,
newIndex: 7,
from: element,
});
await Vue.nextTick();
});
it("sends a change event", async () => {
const draggableWrapper = wrapper.findComponent(draggable);
const expectedEvt = { moved: { element: 2, oldIndex: 2, newIndex: 7 } };
expect(draggableWrapper.emitted().change).toEqual([[expectedEvt]]);
});
it("update list", async () => {
expect(vm.array).toEqual(expectedArray);
});
it("updates DOM", async () => {
expectHTML(wrapper, expectedDom);
});
});
}
);
================================================
FILE: tests/unit/vuedraggable.script.tag.spec.js
================================================
import Vue from "vue";
window.Vue = Vue;
describe("draggable when used with script tag", () => {
it("register draggable component", () => {
const draggable = require("@/vuedraggable").default._Ctor[0];
const component = Vue.component("draggable");
expect(component).toBe(draggable);
});
});
================================================
FILE: tests/unit/vuedraggable.spec.js
================================================
import { mount, shallowMount } from "@vue/test-utils";
import Sortable from "sortablejs";
jest.genMockFromModule("sortablejs");
jest.mock("sortablejs");
const SortableFake = {
destroy: jest.fn(),
option: jest.fn(),
};
Sortable.mockImplementation(() => SortableFake);
import draggable from "@/vuedraggable";
import Vue from "vue";
import Fake from "./helper/FakeComponent.js";
import FakeFunctional from "./helper/FakeFunctionalComponent.js";
let wrapper;
let vm;
let props;
let items;
let item;
let element;
let input;
const initialRender =
"";
const initialRenderRaw = "";
const initialRenderTransition =
"";
function normalizeHTML(wrapper) {
return wrapper.html().replace(/(\r\n\t|\n|\r\t| )/gm, "");
}
function expectHTML(wrapper, expected) {
const htmlStripped = normalizeHTML(wrapper);
expect(htmlStripped).toEqual(expected);
}
function getEvent(name) {
return Sortable.mock.calls[0][1][name];
}
function resetMocks() {
Sortable.mockClear();
SortableFake.destroy.mockClear();
SortableFake.option.mockClear();
}
describe("draggable.vue when initialized with list", () => {
beforeEach(() => {
resetMocks();
items = ["a", "b", "c"];
wrapper = shallowMount(draggable, {
propsData: {
list: items,
},
attrs: {
sortableOption: "value",
"to-be-camelized": true,
},
slots: {
default: items.map((item) => `${item}
`),
header: "",
footer: "",
},
});
vm = wrapper.vm;
props = vm.$options.props;
element = wrapper.element;
});
describe("when initialized with incorrect props", () => {
const { error } = console;
const { warn } = console;
beforeEach(() => {
console.error = jest.fn();
console.warn = jest.fn();
});
afterEach(() => {
console.error = error;
console.warn = warn;
});
it("log an error when list and value are both not null", () => {
wrapper = shallowMount(draggable, {
propsData: {
list: [],
value: [],
},
slots: {
default: "",
},
});
expect(console.error).toBeCalledWith(
"Value and list props are mutually exclusive! Please set one or another."
);
});
it("warns when options is used", () => {
wrapper = shallowMount(draggable, {
propsData: {
options: {
group: "led zeppelin",
},
},
slots: {
default: "",
},
});
expect(console.warn).toBeCalledWith(
"Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props"
);
});
it("warns when element is used", () => {
wrapper = shallowMount(draggable, {
propsData: {
element: "li",
},
slots: {
default: "",
},
});
expect(console.warn).toBeCalledWith(
"Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"
);
});
});
it("instantiate without error", () => {
expect(wrapper).not.toBeUndefined();
});
it("has draggable name", () => {
expect(vm.name).not.toBe("draggable");
});
test.each([
["options", { type: Object }],
[
"list",
{
type: Array,
required: false,
default: null,
},
],
[
"value",
{
type: Array,
required: false,
default: null,
},
],
[
"noTransitionOnDrag",
{
type: Boolean,
default: false,
},
],
[
"element",
{
type: String,
default: "div",
},
],
[
"tag",
{
type: String,
default: null,
},
],
[
"move",
{
type: Function,
default: null,
},
],
[
"componentData",
{
type: Object,
required: false,
default: null,
},
],
])("should have props %s equal to %o", (name, value) => {
const propsValue = props[name];
expect(propsValue).toEqual(value);
});
it("has a clone props, defaulting with identity function", () => {
const expected = {};
const { clone } = props;
expect(clone.type).toBe(Function);
expect(clone.default(expected)).toBe(expected);
});
it("renders root element correctly", () => {
expect(normalizeHTML(wrapper)).toMatch(/^.*<\/div>$/);
});
it("renders footer slot element correctly", () => {
expect(normalizeHTML(wrapper)).toMatch(/
<\/footer><\/div>$/);
});
it("renders header slot element correctly", () => {
expect(normalizeHTML(wrapper)).toMatch(/^<\/header>/);
});
it("renders default slot element correctly", () => {
expect(normalizeHTML(wrapper)).toContain(
"a
b
c
"
);
});
it("renders correctly", () => {
expectHTML(wrapper, initialRender);
});
describe.each(["ul", "span", "div"])("considering a tag %s", (tag) => {
beforeEach(() => {
wrapper = shallowMount(draggable, {
propsData: { tag },
});
});
it("renders tag as root element", () => {
const expectedRegex = new RegExp(`^<${tag}>.*<\/${tag}>$`);
expect(wrapper.html()).toMatch(expectedRegex);
});
it("set noneFunctionalComponentMode to false ", () => {
const { noneFunctionalComponentMode } = vm;
expect(noneFunctionalComponentMode).toBe(false);
});
});
it("computes indexes", async () => {
await Vue.nextTick();
expect(vm.visibleIndexes).toEqual([-1, 0, 1, 2, 3]);
});
it("update indexes", async () => {
await Vue.nextTick();
const computeIndexes = jest.fn();
wrapper.setMethods({ computeIndexes });
wrapper.setProps({ list: ["c", "d", "e", "f", "g"] });
await Vue.nextTick();
expect(computeIndexes).toHaveBeenCalled();
});
it("set realList", () => {
expect(vm.realList).toEqual(["a", "b", "c"]);
});
describe("when using component as tag", () => {
beforeEach(() => {
input = jest.fn();
wrapper = mount(draggable, {
propsData: {
tag: "child",
componentData: {
on: {
input,
},
attrs: {
attribute1: "value1",
},
props: {
prop1: "info",
prop2: true,
},
},
},
stubs: {
child: Fake,
},
});
});
it("instantiate child component", async () => {
const child = wrapper.find(Fake);
expect(child).not.toBeNull();
});
it("pass data to tag child", async () => {
const fakeChild = wrapper.find(Fake);
expect(fakeChild.props("prop1")).toEqual("info");
});
it("pass event listener to tag child", async () => {
const child = wrapper.find(Fake);
const evt = { data: 33 };
child.vm.$emit("input", evt);
expect(input).toHaveBeenCalledWith(evt);
});
it("pass attributes to tag child", async () => {
const child = wrapper.find(Fake);
const attrValue = child.attributes("attribute1");
expect(attrValue).toEqual("value1");
});
});
test.each([[Fake, true], [FakeFunctional, false]])(
"when using component as tag",
(component, expectedNoneFunctionalComponentMode) => {
wrapper = mount(draggable, {
propsData: {
tag: "child",
},
stubs: {
child: component,
},
});
const {
vm: { noneFunctionalComponentMode },
} = wrapper;
expect(noneFunctionalComponentMode).toBe(
expectedNoneFunctionalComponentMode
);
}
);
it("keeps a reference to Sortable instance", () => {
expect(vm._sortable).toBe(SortableFake);
});
it("creates sortable instance with options", () => {
expect(Sortable.mock.calls.length).toBe(1);
const parameters = Sortable.mock.calls[0];
expect(parameters[0]).toBe(element);
expect(parameters[1]).toMatchObject({
draggable: ">*",
sortableOption: "value",
toBeCamelized: true,
});
});
test.each([
["onChoose", "choose"],
["onUnchoose", "unchoose"],
["onSort", "sort"],
["onFilter", "filter"],
["onClone", "clone"],
])("when event %s is emitted from sortable", async (evt, vueEvt) => {
const callBack = getEvent(evt);
const evtInfo = {
data: {},
};
callBack(evtInfo);
await Vue.nextTick();
expect(wrapper.emitted()).toEqual({
[vueEvt]: [[evtInfo]],
});
});
it("creates sortable instance with options", () => {
expect(Sortable.mock.calls.length).toBe(1);
const parameters = Sortable.mock.calls[0];
expect(parameters[0]).toBe(element);
expect(parameters[1]).toMatchObject({
draggable: ">*",
sortableOption: "value",
toBeCamelized: true,
});
});
describe("when add is called", () => {
let newItem;
beforeEach(async () => {
await Vue.nextTick();
newItem = document.createElement("div");
const newContent = document.createTextNode("d");
newItem.appendChild(newContent);
newItem._underlying_vm_ = "d";
const last = element.children[3];
element.insertBefore(newItem, last);
const add = getEvent("onAdd");
add({
item: newItem,
newIndex: 3,
});
});
it("DOM changes should be reverted", async () => {
await Vue.nextTick();
expectHTML(wrapper, initialRender);
});
it("list should be updated", async () => {
await Vue.nextTick();
expect(vm.list).toEqual(["a", "b", "d", "c"]);
});
it("sends a update event", async () => {
await Vue.nextTick();
const expectedEvt = {
item: newItem,
newIndex: 3,
};
expect(wrapper.emitted().add).toEqual([[expectedEvt]]);
});
it("sends a change event", async () => {
await Vue.nextTick();
const expectedEvt = { added: { element: "d", newIndex: 2 } };
expect(wrapper.emitted().change).toEqual([[expectedEvt]]);
});
});
describe("when initiating a drag operation", () => {
let evt;
beforeEach(() => {
item = element.children[2];
evt = { item };
const start = getEvent("onStart");
start(evt);
});
it("sends a start event", async () => {
await Vue.nextTick();
expect(wrapper.emitted()).toEqual({
start: [[evt]],
});
});
it("sets context", async () => {
await Vue.nextTick();
expect(vm.context).toEqual({
element: "b",
index: 1,
});
});
describe("when calling onMove", () => {
let originalEvt;
let move;
let doMove;
beforeEach(() => {
evt = {
to: element,
related: element.children[1],
willInsertAfter: false,
};
originalEvt = {
domInfo: true,
};
move = getEvent("onMove");
doMove = () => move(evt, originalEvt);
});
it("returns true when move props is null", () => {
const actual = doMove();
expect(actual).toBe(true);
});
describe("when move is set", () => {
let move;
beforeEach(() => {
move = jest.fn();
wrapper.setProps({ move });
});
it("calls move with list information", () => {
const expectedEvt = {
draggedContext: {
element: "b",
futureIndex: 0,
index: 1,
},
relatedContext: {
component: vm,
element: "a",
index: 0,
list: ["a", "b", "c"],
},
to: element,
related: element.children[1],
willInsertAfter: false,
};
doMove();
expect(move.mock.calls.length).toBe(1);
expect(move).toHaveBeenCalledWith(expectedEvt, originalEvt);
});
test.each([
[1, false, 0, { element: "a", index: 0 }],
[2, false, 1, { element: "b", index: 1 }],
[3, false, 2, { element: "c", index: 2 }],
// Will insert after is not taken into account if the dragging
// element is in the target list
[1, true, 0, { element: "a", index: 0 }],
[2, true, 1, { element: "b", index: 1 }],
[3, true, 2, { element: "c", index: 2 }],
])(
"when context is of index %n with insert after %o has futureIndex: %n and context: %o",
(index, willInsertAfter, futureIndex, context) => {
evt.willInsertAfter = willInsertAfter;
evt.related = element.children[index];
const expectedEvt = {
draggedContext: {
element: "b",
futureIndex,
index: 1,
},
relatedContext: {
component: vm,
element: context.element,
index: context.index,
list: ["a", "b", "c"],
},
to: element,
related: element.children[index],
willInsertAfter,
};
doMove();
expect(move.mock.calls.length).toBe(1);
expect(move).toHaveBeenCalledWith(expectedEvt, originalEvt);
}
);
test.each([true, false])("returns move result %o", (result) => {
move.mockImplementation(() => result);
const actual = doMove();
expect(actual).toBe(result);
});
});
});
describe("when remove is called", () => {
beforeEach(() => {
element.removeChild(item);
const remove = getEvent("onRemove");
remove({
item,
oldIndex: 2,
});
});
it("DOM changes should be reverted", async () => {
await Vue.nextTick();
expectHTML(wrapper, initialRender);
});
it("list should be updated", async () => {
await Vue.nextTick();
expect(vm.list).toEqual(["a", "c"]);
});
it("sends a remove event", async () => {
await Vue.nextTick();
const expectedEvt = { item, oldIndex: 2 };
expect(wrapper.emitted().remove).toEqual([[expectedEvt]]);
});
it("sends a change event", async () => {
await Vue.nextTick();
const expectedEvt = { removed: { element: "b", oldIndex: 1 } };
expect(wrapper.emitted().change).toEqual([[expectedEvt]]);
});
});
describe.each([[1, ["b", "a", "c"]], [3, ["a", "c", "b"]]])(
"when update is called with new index being %i",
(index, expectedList) => {
beforeEach(() => {
const firstDraggable = element.children[index];
element.removeChild(item);
element.insertBefore(item, firstDraggable);
const update = getEvent("onUpdate");
update({
item,
oldIndex: 2,
newIndex: index,
from: element,
});
});
it("DOM changes should be reverted", async () => {
await Vue.nextTick();
expectHTML(wrapper, initialRender);
});
it("list should be updated", async () => {
await Vue.nextTick();
expect(vm.list).toEqual(expectedList);
});
it("sends a update event", async () => {
await Vue.nextTick();
const expectedEvt = {
item,
oldIndex: 2,
newIndex: index,
from: element,
};
expect(wrapper.emitted().update).toEqual([[expectedEvt]]);
});
it("sends a change event", async () => {
await Vue.nextTick();
const expectedEvt = {
moved: { element: "b", oldIndex: 1, newIndex: index - 1 },
};
expect(wrapper.emitted().change).toEqual([[expectedEvt]]);
});
}
);
describe("when sending DragEnd", () => {
let endEvt;
beforeEach(() => {
endEvt = {
data: "data",
};
const onEnd = getEvent("onEnd");
onEnd(endEvt);
});
it("sends a update event", async () => {
await Vue.nextTick();
expect(wrapper.emitted().end).toEqual([[endEvt]]);
});
});
});
describe("when initiating a drag operation in clone context", () => {
let evt;
beforeEach(() => {
resetMocks();
wrapper = shallowMount(draggable, {
propsData: {
list: items,
},
slots: {
default: items.map((item) => `${item}
`),
},
});
vm = wrapper.vm;
element = wrapper.element;
item = element.children[1];
evt = { item };
const start = getEvent("onStart");
start(evt);
});
describe("when remove is called", () => {
beforeEach(() => {
var clone = item.cloneNode(true);
wrapper.element.insertBefore(clone, item);
wrapper.element.removeChild(item);
const remove = getEvent("onRemove");
remove({
item,
clone,
pullMode: "clone",
oldIndex: 1,
});
});
it("DOM changes should be reverted", async () => {
await Vue.nextTick();
expectHTML(wrapper, initialRenderRaw);
});
it("list should be not updated", async () => {
await Vue.nextTick();
expect(vm.list).toEqual(["a", "b", "c"]);
});
it("sends a remove event", async () => {
await Vue.nextTick();
expect(wrapper.emitted().remove).toEqual([
[
{
item,
clone: item,
pullMode: "clone",
oldIndex: 1,
},
],
]);
});
it("does not send a change event", async () => {
await Vue.nextTick();
expect(wrapper.emitted().change).toBeUndefined();
});
});
});
describe("when initiating a drag operation in clone context using a pull function", () => {
let evt;
beforeEach(() => {
resetMocks();
wrapper = shallowMount(draggable, {
propsData: {
list: items,
},
attrs: {
group: { pull: () => "clone" },
},
slots: {
default: items.map((item) => `${item}
`),
},
});
vm = wrapper.vm;
element = wrapper.element;
item = element.children[1];
evt = { item };
const start = getEvent("onStart");
start(evt);
});
describe("when remove is called", () => {
beforeEach(() => {
var clone = item.cloneNode(true);
wrapper.element.insertBefore(clone, item);
wrapper.element.removeChild(item);
const remove = getEvent("onRemove");
remove({
item,
clone,
pullMode: "clone",
oldIndex: 1,
});
});
it("DOM changes should be reverted", async () => {
await Vue.nextTick();
expectHTML(wrapper, initialRenderRaw);
});
it("list should be not updated", async () => {
await Vue.nextTick();
expect(vm.list).toEqual(["a", "b", "c"]);
});
it("does not send a remove event", async () => {
await Vue.nextTick();
expect(wrapper.emitted().remove).toEqual([
[
{
item,
clone: item,
pullMode: "clone",
oldIndex: 1,
},
],
]);
});
it("does not send a change event", async () => {
await Vue.nextTick();
expect(wrapper.emitted().change).toBeUndefined();
});
});
});
describe("when attribute changes:", () => {
const { error } = console;
beforeEach(() => {
console.error = () => {};
});
afterEach(() => {
console.error = error;
});
test.each([
["sortableOption", "newValue", "sortableOption"],
["to-be-camelized", 1, "toBeCamelized"],
])(
"attribute %s change for value %o, calls sortable option with %s attribute",
async (attribute, value, sortableAttribute) => {
vm.$attrs = { [attribute]: value };
await Vue.nextTick();
expect(SortableFake.option).toHaveBeenCalledWith(
sortableAttribute,
value
);
}
);
test.each([
"Start",
"Add",
"Remove",
"Update",
"End",
"Choose",
"Unchoose",
"Sort",
"Filter",
"Clone",
"Move",
])("do not call option when updating option on%s", (callBack) => {
vm.$attrs = { [`on${callBack}`]: jest.fn() };
expect(SortableFake.option).not.toHaveBeenCalled();
});
});
test.each([
["sortableOption", "newValue", "sortableOption"],
["to-be-camelized", 1, "toBeCamelized"],
])(
"when option %s change for value %o, calls sortable option with %s attribute",
async (attribute, value, sortableAttribute) => {
wrapper.setProps({ options: { [attribute]: value } });
await Vue.nextTick();
expect(SortableFake.option).toHaveBeenCalledWith(
sortableAttribute,
value
);
}
);
it("does calls Sortable destroy when mounted", () => {
expect(SortableFake.destroy.mock.calls.length).toBe(0);
});
it("calls Sortable destroy when destroyed", () => {
wrapper.destroy();
expect(SortableFake.destroy).toHaveBeenCalled();
expect(SortableFake.destroy.mock.calls.length).toBe(1);
});
it("does not throw on destroy when sortable is not set", () => {
delete vm._sortable;
expect(() => wrapper.destroy()).not.toThrow();
});
it("renders id as html attribute", () => {
wrapper = shallowMount(draggable, {
propsData: {
list: [],
},
attrs: {
id: "my-id",
},
slots: {
default: "",
},
});
const element = wrapper.find("#my-id");
expect(element.is("div")).toBe(true);
expect(element.html()).toEqual(wrapper.html());
});
test.each([
["data-valor", "a"],
["data-valor2", "bd"],
["data-attribute", "efg"],
])(
"renders attribute %s with value %s as html attribute",
(attribute, value) => {
wrapper = shallowMount(draggable, {
propsData: {
list: [],
},
attrs: {
[attribute]: value,
},
slots: {
default: "",
},
});
const element = wrapper.find(`[${attribute}='${value}']`);
expect(element.is("div")).toBe(true);
expect(element.html()).toEqual(wrapper.html());
}
);
});
describe("draggable.vue when initialized with value", () => {
beforeEach(() => {
Sortable.mockClear();
items = ["a", "b", "c"];
wrapper = shallowMount(draggable, {
propsData: {
value: items,
},
slots: {
default: items.map((item) => `${item}
`),
},
});
vm = wrapper.vm;
props = vm.$options.props;
element = wrapper.element;
});
it("computes indexes", async () => {
await Vue.nextTick();
expect(vm.visibleIndexes).toEqual([0, 1, 2]);
});
it("renders correctly", () => {
expectHTML(wrapper, initialRenderRaw);
});
it("update indexes", async () => {
await Vue.nextTick();
const computeIndexes = jest.fn();
wrapper.setMethods({ computeIndexes });
wrapper.setProps({ value: ["c", "d", "e", "f", "g"] });
await Vue.nextTick();
expect(computeIndexes).toHaveBeenCalled();
});
it("set realList", () => {
expect(vm.realList).toEqual(["a", "b", "c"]);
});
it("transition mode should be false", () => {
expect(vm.transitionMode).toBe(false);
});
describe("when initiating a drag operation", () => {
let evt;
beforeEach(() => {
item = element.children[1];
evt = { item };
const start = getEvent("onStart");
start(evt);
});
it("sends a start event", async () => {
await Vue.nextTick();
expect(wrapper.emitted()).toEqual({
start: [[evt]],
});
});
it("sets context", async () => {
await Vue.nextTick();
expect(vm.context).toEqual({
element: "b",
index: 1,
});
});
describe("when remove is called", () => {
beforeEach(() => {
element.removeChild(item);
const remove = getEvent("onRemove");
remove({
item,
oldIndex: 1,
});
});
it("DOM changes should be reverted", async () => {
await Vue.nextTick();
expectHTML(wrapper, initialRenderRaw);
});
it("input should with updated value", async () => {
await Vue.nextTick();
const expected = ["a", "c"];
expect(wrapper.emitted().input).toEqual([[expected]]);
});
it("sends a remove event", async () => {
await Vue.nextTick();
const expectedEvt = { item, oldIndex: 1 };
expect(wrapper.emitted().remove).toEqual([[expectedEvt]]);
});
it("sends a change event", async () => {
await Vue.nextTick();
const expectedEvt = { removed: { element: "b", oldIndex: 1 } };
expect(wrapper.emitted().change).toEqual([[expectedEvt]]);
});
});
describe("when update is called", () => {
beforeEach(() => {
const firstDraggable = element.children[0];
element.removeChild(item);
element.insertBefore(item, firstDraggable);
const update = getEvent("onUpdate");
update({
item,
oldIndex: 1,
newIndex: 0,
from: element,
});
});
it("DOM changes should be reverted", async () => {
await Vue.nextTick();
expectHTML(wrapper, initialRenderRaw);
});
it("send an input event", async () => {
await Vue.nextTick();
const expected = ["b", "a", "c"];
expect(wrapper.emitted().input).toEqual([[expected]]);
});
it("sends a update event", async () => {
await Vue.nextTick();
const expectedEvt = {
item,
oldIndex: 1,
newIndex: 0,
from: element,
};
expect(wrapper.emitted().update).toEqual([[expectedEvt]]);
});
it("sends a change event", async () => {
await Vue.nextTick();
const expectedEvt = {
moved: { element: "b", oldIndex: 1, newIndex: 0 },
};
expect(wrapper.emitted().change).toEqual([[expectedEvt]]);
});
});
describe("when sending DragEnd", () => {
let endEvt;
beforeEach(() => {
endEvt = {
data: "data",
};
const onEnd = getEvent("onEnd");
onEnd(endEvt);
});
it("sends a update event", async () => {
await Vue.nextTick();
expect(wrapper.emitted().end).toEqual([[endEvt]]);
});
});
});
});
describe("draggable.vue when initialized with a transition group", () => {
beforeEach(() => {
Sortable.mockClear();
items = ["a", "b", "c"];
const inside = items.map((item) => `${item}
`).join("");
const template = `${inside} `;
wrapper = shallowMount(draggable, {
propsData: {
value: items,
},
slots: {
default: template,
},
});
vm = wrapper.vm;
props = vm.$options.props;
element = wrapper.element;
});
it("computes indexes", async () => {
await Vue.nextTick();
expect(vm.visibleIndexes).toEqual([0, 1, 2]);
});
it("set realList", () => {
expect(vm.realList).toEqual(["a", "b", "c"]);
});
it("transition mode should be false", () => {
expect(vm.transitionMode).toBe(true);
});
it("enders correctly", () => {
expectHTML(wrapper, initialRenderTransition);
});
it("creates sortable instance with options on transition root", () => {
expect(Sortable.mock.calls.length).toBe(1);
const parameters = Sortable.mock.calls[0];
expect(parameters[0]).toBe(element.children[0]);
});
describe("when initiating a drag operation", () => {
let evt;
beforeEach(() => {
item = element.children[0].children[1];
evt = { item };
const start = getEvent("onStart");
start(evt);
});
it("sends a start event", async () => {
await Vue.nextTick();
expect(wrapper.emitted()).toEqual({
start: [[evt]],
});
});
it("sets context", async () => {
await Vue.nextTick();
expect(vm.context).toEqual({
element: "b",
index: 1,
});
});
describe("when remove is called", () => {
beforeEach(() => {
element.children[0].removeChild(item);
const remove = getEvent("onRemove");
remove({
item,
oldIndex: 1,
});
});
it("DOM changes should be reverted", async () => {
await Vue.nextTick();
expectHTML(wrapper, initialRenderTransition);
});
it("input should with updated value", async () => {
await Vue.nextTick();
const expected = ["a", "c"];
expect(wrapper.emitted().input).toEqual([[expected]]);
});
it("sends a remove event", async () => {
await Vue.nextTick();
const expectedEvt = { item, oldIndex: 1 };
expect(wrapper.emitted().remove).toEqual([[expectedEvt]]);
});
it("sends a change event", async () => {
await Vue.nextTick();
const expectedEvt = { removed: { element: "b", oldIndex: 1 } };
expect(wrapper.emitted().change).toEqual([[expectedEvt]]);
});
});
describe("when update is called", () => {
beforeEach(() => {
const transitionRoot = element.children[0];
const firstDraggable = transitionRoot.children[0];
transitionRoot.removeChild(item);
transitionRoot.insertBefore(item, firstDraggable);
const update = getEvent("onUpdate");
update({
item,
oldIndex: 1,
newIndex: 0,
from: transitionRoot,
});
});
it("DOM changes should be reverted", async () => {
await Vue.nextTick();
expectHTML(wrapper, initialRenderTransition);
});
it("send an input event", async () => {
await Vue.nextTick();
const expected = ["b", "a", "c"];
expect(wrapper.emitted().input).toEqual([[expected]]);
});
it("sends a update event", async () => {
await Vue.nextTick();
const expectedEvt = {
item,
oldIndex: 1,
newIndex: 0,
from: element.children[0],
};
expect(wrapper.emitted().update).toEqual([[expectedEvt]]);
});
it("sends a change event", async () => {
await Vue.nextTick();
const expectedEvt = {
moved: { element: "b", oldIndex: 1, newIndex: 0 },
};
expect(wrapper.emitted().change).toEqual([[expectedEvt]]);
});
});
describe("when calling onMove", () => {
let originalEvt;
let move;
let doMove;
beforeEach(() => {
move = jest.fn();
wrapper.setProps({ move });
evt = {
to: element.children[0],
related: element.children[0].children[1],
willInsertAfter: false,
};
originalEvt = {
domInfo: true,
};
doMove = () => getEvent("onMove")(evt, originalEvt);
});
it("calls move with list information", () => {
const expectedEvt = {
draggedContext: {
element: "b",
futureIndex: 1,
index: 1,
},
relatedContext: {
component: vm,
element: "b",
index: 1,
list: ["a", "b", "c"],
},
to: element.children[0],
related: element.children[0].children[1],
willInsertAfter: false,
};
doMove();
expect(move.mock.calls).toEqual([[expectedEvt, originalEvt]]);
});
});
describe("when sending DragEnd", () => {
let endEvt;
beforeEach(() => {
endEvt = {
data: "data",
};
const onEnd = getEvent("onEnd");
onEnd(endEvt);
});
it("sends a update event", async () => {
await Vue.nextTick();
expect(wrapper.emitted().end).toEqual([[endEvt]]);
});
});
});
describe("draggable.vue when initialized with header and footer scoped slots", () => {
beforeEach(() => {
resetMocks();
items = ["a", "b", "c"];
wrapper = shallowMount(draggable, {
propsData: {
list: items,
},
attrs: {
sortableOption: "value",
"to-be-camelized": true,
},
slots: {
default: items.map((item) => `${item}
`),
},
scopedSlots: {
header: "",
footer: "",
},
});
vm = wrapper.vm;
props = vm.$options.props;
element = wrapper.element;
});
it("renders correctly", () => {
expectHTML(wrapper, initialRender);
});
});
});
================================================
FILE: tests/unit/vuedraggable.ssr.spec.js
================================================
/**
* @jest-environment node
*/
const Vue = require('vue');
const renderer = require('vue-server-renderer').createRenderer();
const draggable = require("@/vuedraggable").default;
Vue.component('draggable', draggable);
const app = new Vue({
name: "test-app",
template: `{{item}}
`,
data:{
items:["a","b","c"]
}
});
let html;
describe("vuedraggable in a SSR context", () => {
beforeEach(async () => {
html = await renderer.renderToString(app);
});
it("can be rendered", () => {
const expected = '';
expect(html).toEqual(expected);
})
})
================================================
FILE: vue.config.js
================================================
const config = {
publicPath: "./",
configureWebpack: {
output: {
libraryExport: 'default'
}
}
}
if (process.env.NODE_ENV === "production") {
config.configureWebpack.externals = {
sortablejs: {
commonjs: "sortablejs",
commonjs2: "sortablejs",
amd: "sortablejs",
root: "Sortable"
}
};
};
module.exports = config;