@leo1998work/fuzzy-ui 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,8 @@
1
- import { w as withInstall, g as getRandomColor, _ as _objectSpread2$1, a as _toConsumableArray, i as isAsyncFunction, b as _typeof$1, c as _asyncToGenerator, d as _regenerator, e as _slicedToArray, f as _createForOfIteratorHelper, h as _defineProperty$1, j as _asyncIterator, t as tmplProps, m as mergeTemplate, k as countNodesRecursive } from '../tool-1d27c421.js';
1
+ import { w as withInstall, g as getRandomColor, _ as _objectSpread2, a as _toConsumableArray, i as isAsyncFunction, b as _typeof, c as _asyncToGenerator, d as _regenerator, e as _slicedToArray, f as _createForOfIteratorHelper, h as _defineProperty, j as _asyncIterator, t as tmplProps, m as mergeTemplate, k as countNodesRecursive } from '../tool-ec1a214b.js';
2
2
  import ElementPlus, { ElButton, ElInput, ElIcon, ElCard, ElSwitch, ElPopover, ElSelect, ElOption, ElSelectV2, ElMessage, ElDialog, ElTree } from 'element-plus';
3
3
  import { ref, withDirectives, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot, defineComponent, createElementBlock, createElementVNode, useSlots, computed, resolveDirective, createVNode, withKeys, createSlots, normalizeClass, withModifiers, Fragment, renderList, toDisplayString, createCommentVNode, resolveComponent, resolveDynamicComponent, normalizeStyle, normalizeProps, guardReactiveProps, watch, vShow, nextTick, watchEffect, createTextVNode, isRef, onMounted, inject, isVNode, provide, createApp, toRaw, shallowRef } from 'vue';
4
4
  import dayjs from 'dayjs';
5
- import { tmplProps as tmplProps$1 } from '@leo1998work/fuzzy-ui-utils';
6
- import '@leo1998work/fuzzy-ui-theme-chalk/src/filter-display/filter-display.sass';
5
+ import Sortable from 'sortablejs';
7
6
 
8
7
  /*! Element Plus v2.13.6 */
9
8
 
@@ -889,7 +888,7 @@ function createRangeDatePicker() {
889
888
  setup: function setup(_, _ref) {
890
889
  var attrs = _ref.attrs;
891
890
  return function () {
892
- return createVNode(script$x, _objectSpread2$1({
891
+ return createVNode(script$x, _objectSpread2({
893
892
  "type": "datetime",
894
893
  "modelValue": startValue.value,
895
894
  "onUpdate:modelValue": function onUpdateModelValue($event) {
@@ -908,7 +907,7 @@ function createRangeDatePicker() {
908
907
  setup: function setup() {
909
908
  return function (_, _ref2) {
910
909
  var attrs = _ref2.attrs;
911
- return createVNode(script$x, _objectSpread2$1({
910
+ return createVNode(script$x, _objectSpread2({
912
911
  "type": "datetime",
913
912
  "disabledDate": function disabledDate(time) {
914
913
  return new Date(time) < new Date(startValue.value);
@@ -1577,7 +1576,7 @@ var script$t = /*@__PURE__*/Object.assign({
1577
1576
  if (props.tag) {
1578
1577
  var _options$find$index, _options$find;
1579
1578
  var options = props.options.map(function (item, index) {
1580
- return _objectSpread2$1(_objectSpread2$1({}, item), {}, {
1579
+ return _objectSpread2(_objectSpread2({}, item), {}, {
1581
1580
  index: index
1582
1581
  });
1583
1582
  });
@@ -1858,13 +1857,13 @@ var script$s = /*@__PURE__*/Object.assign({
1858
1857
  };
1859
1858
  });
1860
1859
  var getActiveValue = computed(function () {
1861
- if (["boolean", "string", "number"].includes(_typeof$1(props.activeValue))) {
1860
+ if (["boolean", "string", "number"].includes(_typeof(props.activeValue))) {
1862
1861
  return props.activeValue;
1863
1862
  }
1864
1863
  return true;
1865
1864
  });
1866
1865
  var getInActiveValue = computed(function () {
1867
- if (["boolean", "string", "number"].includes(_typeof$1(props.inActiveValue))) {
1866
+ if (["boolean", "string", "number"].includes(_typeof(props.inActiveValue))) {
1868
1867
  return props.inActiveValue;
1869
1868
  }
1870
1869
  return false;
@@ -1998,7 +1997,7 @@ function mapperToOptions(mapper) {
1998
1997
  var Select$5 = {
1999
1998
  type: 'select',
2000
1999
  renderer: function renderer(props) {
2001
- return createVNode(FYSelect, _objectSpread2$1(_objectSpread2$1({
2000
+ return createVNode(FYSelect, _objectSpread2(_objectSpread2({
2002
2001
  "placeholder": "\u8BF7\u9009\u62E9".concat(props.label)
2003
2002
  }, props), {}, {
2004
2003
  "modelValue": props.model[props.value],
@@ -2043,7 +2042,7 @@ var DatePicker$3 = {
2043
2042
  label: '本周',
2044
2043
  value: 3
2045
2044
  }]
2046
- }, null), createVNode(FYDatePicker, _objectSpread2$1(_objectSpread2$1({
2045
+ }, null), createVNode(FYDatePicker, _objectSpread2(_objectSpread2({
2047
2046
  "style": "width: 180px",
2048
2047
  "placeholder": "\u8BF7\u9009\u62E9"
2049
2048
  }, props), {}, {
@@ -2099,9 +2098,9 @@ function useForm(filterItem) {
2099
2098
  var model = ref({});
2100
2099
  var rules = computed(function () {
2101
2100
  if (filterItem.value.validate) {
2102
- return _defineProperty$1({}, filterItem.value.value, filterItem.value.validate);
2101
+ return _defineProperty({}, filterItem.value.value, filterItem.value.validate);
2103
2102
  }
2104
- return _defineProperty$1({}, filterItem.value.value, [{
2103
+ return _defineProperty({}, filterItem.value.value, [{
2105
2104
  required: true,
2106
2105
  trigger: 'change',
2107
2106
  message: ''
@@ -2121,7 +2120,7 @@ function useForm(filterItem) {
2121
2120
  watch(filterItem, function (value, oldValue) {
2122
2121
  if (value === oldValue) return;
2123
2122
  // model.value = { [filterItem.value.value]: '' }
2124
- model.value = _defineProperty$1({}, filterItem.value.value, filterItem.value.defaultValue || '');
2123
+ model.value = _defineProperty({}, filterItem.value.value, filterItem.value.defaultValue || '');
2125
2124
  }, {
2126
2125
  immediate: true
2127
2126
  });
@@ -2302,7 +2301,7 @@ var FormGroup = defineComponent({
2302
2301
  * }
2303
2302
  * }
2304
2303
  */
2305
- return _context.a(2, _defineProperty$1({}, field, {
2304
+ return _context.a(2, _defineProperty({}, field, {
2306
2305
  value: model.value[field],
2307
2306
  // 字段值
2308
2307
  relation: relationValue.value,
@@ -2370,7 +2369,7 @@ var FormGroup = defineComponent({
2370
2369
  "default": function _default() {
2371
2370
  return [createVNode("div", {
2372
2371
  "style": "width: 300px"
2373
- }, [createVNode(FormItem.value, _objectSpread2$1(_objectSpread2$1({}, formItemProps.value), {}, {
2372
+ }, [createVNode(FormItem.value, _objectSpread2(_objectSpread2({}, formItemProps.value), {}, {
2374
2373
  "model": model.value
2375
2374
  }), null)])];
2376
2375
  }
@@ -3427,7 +3426,7 @@ var FYSkeleton = withInstall(script$p);
3427
3426
  var Select$4 = {
3428
3427
  type: 'select',
3429
3428
  renderer: function renderer(props) {
3430
- return createVNode(FYSelect, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
3429
+ return createVNode(FYSelect, _objectSpread2(_objectSpread2({}, props), {}, {
3431
3430
  "options": unref(props.options),
3432
3431
  "disabled": 'disabled' in props ? unref(props.disabled) : false,
3433
3432
  "modelValue": props.model[props.value],
@@ -3440,7 +3439,7 @@ var Select$4 = {
3440
3439
  var Input$3 = {
3441
3440
  type: 'input',
3442
3441
  renderer: function renderer(props) {
3443
- return createVNode(FYInput, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
3442
+ return createVNode(FYInput, _objectSpread2(_objectSpread2({}, props), {}, {
3444
3443
  "disabled": 'disabled' in props ? unref(props.disabled) : false,
3445
3444
  "modelValue": props.model[props.value],
3446
3445
  "onUpdate:modelValue": function onUpdateModelValue($event) {
@@ -3452,7 +3451,7 @@ var Input$3 = {
3452
3451
  var Textarea = {
3453
3452
  type: 'textarea',
3454
3453
  renderer: function renderer(props) {
3455
- return createVNode(FYInput, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
3454
+ return createVNode(FYInput, _objectSpread2(_objectSpread2({}, props), {}, {
3456
3455
  "textarea": true,
3457
3456
  "disabled": 'disabled' in props ? unref(props.disabled) : false,
3458
3457
  "modelValue": props.model[props.value],
@@ -3465,7 +3464,7 @@ var Textarea = {
3465
3464
  var PasswordInput = {
3466
3465
  type: 'password',
3467
3466
  renderer: function renderer(props) {
3468
- return createVNode(FYInput, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
3467
+ return createVNode(FYInput, _objectSpread2(_objectSpread2({}, props), {}, {
3469
3468
  "type": "password",
3470
3469
  "disabled": 'disabled' in props ? unref(props.disabled) : false,
3471
3470
  "modelValue": props.model[props.value],
@@ -3478,7 +3477,7 @@ var PasswordInput = {
3478
3477
  var Switch$1 = {
3479
3478
  type: 'switch',
3480
3479
  renderer: function renderer(props) {
3481
- return createVNode(FYSwitch, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
3480
+ return createVNode(FYSwitch, _objectSpread2(_objectSpread2({}, props), {}, {
3482
3481
  "disabled": 'disabled' in props ? unref(props.disabled) : false,
3483
3482
  "modelValue": props.model[props.value],
3484
3483
  "onUpdate:modelValue": function onUpdateModelValue($event) {
@@ -3796,7 +3795,7 @@ var FormItem$1 = defineComponent({
3796
3795
  return [props.tmplItem.type === 'upload' ? createVNode(script$o, {
3797
3796
  "onTypeCheck": typeCheck,
3798
3797
  "onFileChange": fileChange
3799
- }, null) : createVNode(FormItemCom.value, _objectSpread2$1({
3798
+ }, null) : createVNode(FormItemCom.value, _objectSpread2({
3800
3799
  "model": props.tmplItem.model
3801
3800
  }, props.tmplItem), null)];
3802
3801
  }
@@ -3918,7 +3917,7 @@ var Form$1 = defineComponent({
3918
3917
  var initFormItems = props.template.filter(function (item) {
3919
3918
  return !item.filterUnShow && item.show !== false;
3920
3919
  }).map(function (sec) {
3921
- return _objectSpread2$1(_objectSpread2$1({}, sec), {}, {
3920
+ return _objectSpread2(_objectSpread2({}, sec), {}, {
3922
3921
  model: props.modelValue
3923
3922
  });
3924
3923
  });
@@ -3938,7 +3937,7 @@ var Form$1 = defineComponent({
3938
3937
  });
3939
3938
  return function () {
3940
3939
  var _slot;
3941
- return createVNode(resolveComponent("el-form"), _objectSpread2$1({
3940
+ return createVNode(resolveComponent("el-form"), _objectSpread2({
3942
3941
  "label-position": props.labelPosition,
3943
3942
  "model": props.modelValue,
3944
3943
  "labelWidth": props.labelWidth,
@@ -4138,7 +4137,7 @@ var script$n = /*@__PURE__*/Object.assign({
4138
4137
  }
4139
4138
  };
4140
4139
  var handleSubmit = function handleSubmit() {
4141
- emit('submit', _objectSpread2$1({}, model.value));
4140
+ emit('submit', _objectSpread2({}, model.value));
4142
4141
  };
4143
4142
 
4144
4143
  // form组件校验失败时的回调
@@ -4289,7 +4288,7 @@ function useFormModel(props) {
4289
4288
  var Select$3 = {
4290
4289
  type: 'select',
4291
4290
  renderer: function renderer(props) {
4292
- return createVNode(FYSelect, _objectSpread2$1(_objectSpread2$1({
4291
+ return createVNode(FYSelect, _objectSpread2(_objectSpread2({
4293
4292
  "placeholder": "\u8BF7\u9009\u62E9".concat(props.label)
4294
4293
  }, props), {}, {
4295
4294
  "modelValue": props.model[props.value],
@@ -4302,7 +4301,7 @@ var Select$3 = {
4302
4301
  var Input$2 = {
4303
4302
  type: 'input',
4304
4303
  renderer: function renderer(props) {
4305
- return createVNode(FYInput, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
4304
+ return createVNode(FYInput, _objectSpread2(_objectSpread2({}, props), {}, {
4306
4305
  "modelValue": props.model[props.value],
4307
4306
  "onUpdate:modelValue": function onUpdateModelValue($event) {
4308
4307
  return props.model[props.value] = $event;
@@ -4313,7 +4312,7 @@ var Input$2 = {
4313
4312
  var DatePicker$1 = {
4314
4313
  type: 'datePicker',
4315
4314
  renderer: function renderer(props) {
4316
- return createVNode(FYDatePicker, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
4315
+ return createVNode(FYDatePicker, _objectSpread2(_objectSpread2({}, props), {}, {
4317
4316
  "placeholder": "\u8BF7\u9009\u62E9".concat(props.label),
4318
4317
  "modelValue": props.model[props.value],
4319
4318
  "onUpdate:modelValue": function onUpdateModelValue($event) {
@@ -4373,7 +4372,7 @@ function useFormItems(props, model) {
4373
4372
  return [item.render ? createVNode(item.render, {
4374
4373
  "model": unref(model),
4375
4374
  "value": item.value
4376
- }, null) : createVNode(FormItemComp, _objectSpread2$1(_objectSpread2$1({}, item), {}, {
4375
+ }, null) : createVNode(FormItemComp, _objectSpread2(_objectSpread2({}, item), {}, {
4377
4376
  "model": unref(model)
4378
4377
  }), null)];
4379
4378
  }
@@ -4427,7 +4426,7 @@ var FilterInline = defineComponent({
4427
4426
  var _props$disabled;
4428
4427
  return createVNode("div", {
4429
4428
  "class": "fy-filter-inline-wrap"
4430
- }, [createVNode(resolveComponent("el-form"), _objectSpread2$1(_objectSpread2$1({
4429
+ }, [createVNode(resolveComponent("el-form"), _objectSpread2(_objectSpread2({
4431
4430
  "class": "custom-el-form flex w-full flex-wrap"
4432
4431
  }, props), {}, {
4433
4432
  "model": unref(model),
@@ -4484,7 +4483,7 @@ var _hoisted_4$5 = {
4484
4483
  var _hoisted_5$3 = ["onClick"];
4485
4484
  var script$m = {
4486
4485
  __name: 'TheHeader',
4487
- props: _objectSpread2$1(_objectSpread2$1({}, tmplProps), {}, {
4486
+ props: _objectSpread2(_objectSpread2({}, tmplProps), {}, {
4488
4487
  activeIdx: {
4489
4488
  type: Number,
4490
4489
  "default": 0
@@ -4806,7 +4805,7 @@ var _hoisted_1$f = {
4806
4805
  };
4807
4806
  var script$k = {
4808
4807
  __name: 'TheBody',
4809
- props: _objectSpread2$1(_objectSpread2$1({}, tmplProps), {}, {
4808
+ props: _objectSpread2(_objectSpread2({}, tmplProps), {}, {
4810
4809
  activeIdx: {
4811
4810
  type: Number,
4812
4811
  "default": 0
@@ -4907,7 +4906,7 @@ var script$i = /*@__PURE__*/Object.assign({
4907
4906
  name: "FYMemberSelect"
4908
4907
  }, {
4909
4908
  __name: 'MemberSelect',
4910
- props: _objectSpread2$1(_objectSpread2$1({}, tmplProps), {}, {
4909
+ props: _objectSpread2(_objectSpread2({}, tmplProps), {}, {
4911
4910
  visible: {
4912
4911
  type: Boolean,
4913
4912
  "default": false
@@ -5017,7 +5016,7 @@ var FYMemberSelect = withInstall(script$i);
5017
5016
  var Select$1 = {
5018
5017
  type: "select",
5019
5018
  renderer: function renderer(props) {
5020
- return createVNode(FYSelect, _objectSpread2$1(_objectSpread2$1({
5019
+ return createVNode(FYSelect, _objectSpread2(_objectSpread2({
5021
5020
  "teleported": false,
5022
5021
  "placeholder": "\u8BF7\u9009\u62E9".concat(props.label),
5023
5022
  "multiple": true
@@ -5094,7 +5093,7 @@ var MultipleSelect = {
5094
5093
  var Cascader$1 = {
5095
5094
  type: "cascader",
5096
5095
  renderer: function renderer(props) {
5097
- return createVNode(FYCascader, _objectSpread2$1(_objectSpread2$1({
5096
+ return createVNode(FYCascader, _objectSpread2(_objectSpread2({
5098
5097
  "onChange": function onChange() {
5099
5098
  props.onWithChange({
5100
5099
  field: props.value,
@@ -5167,7 +5166,7 @@ var DisplayItem = defineComponent({
5167
5166
  toggle();
5168
5167
  emit('click', unfold.value);
5169
5168
  };
5170
- var withOnChangeProps = _objectSpread2$1(_objectSpread2$1({}, props.tmplItem), {}, {
5169
+ var withOnChangeProps = _objectSpread2(_objectSpread2({}, props.tmplItem), {}, {
5171
5170
  onWithChange: function onWithChange(_ref2) {
5172
5171
  var field = _ref2.field,
5173
5172
  value = _ref2.value;
@@ -5196,7 +5195,7 @@ var DisplayItem = defineComponent({
5196
5195
 
5197
5196
  // 下拉弹出框
5198
5197
  var popoverVisible = ref(false);
5199
- var model = ref(_defineProperty$1({}, value.value, props.tmplItem.defaultValue || ''));
5198
+ var model = ref(_defineProperty({}, value.value, props.tmplItem.defaultValue || ''));
5200
5199
 
5201
5200
  // 已选择的值
5202
5201
  var checkedLength = computed(function () {
@@ -5225,7 +5224,7 @@ var DisplayItem = defineComponent({
5225
5224
  "default": function _default() {
5226
5225
  return createVNode("div", {
5227
5226
  "class": "popover-content"
5228
- }, [createVNode(FormItem.value, _objectSpread2$1({
5227
+ }, [createVNode(FormItem.value, _objectSpread2({
5229
5228
  "model": model.value
5230
5229
  }, withOnChangeProps), null), createVNode("div", {
5231
5230
  "class": "checked"
@@ -5263,7 +5262,7 @@ var FilterDisplay = defineComponent({
5263
5262
  components: {
5264
5263
  DisplayItem: DisplayItem
5265
5264
  },
5266
- props: _objectSpread2$1({}, tmplProps$1),
5265
+ props: _objectSpread2({}, tmplProps),
5267
5266
  emits: ["change"],
5268
5267
  setup: function setup(props, _ref) {
5269
5268
  var emit = _ref.emit;
@@ -5375,7 +5374,7 @@ var script$f = /*@__PURE__*/Object.assign({
5375
5374
  name: "FYActionPanel"
5376
5375
  }, {
5377
5376
  __name: 'ActionPanel',
5378
- props: _objectSpread2$1(_objectSpread2$1({}, tmplProps$1), {}, {
5377
+ props: _objectSpread2(_objectSpread2({}, tmplProps), {}, {
5379
5378
  visible: {
5380
5379
  type: Boolean,
5381
5380
  "default": false
@@ -5676,7 +5675,7 @@ var script$e = /*@__PURE__*/Object.assign({
5676
5675
  };
5677
5676
  var handleSubmit = function handleSubmit() {
5678
5677
  if (dialogConfig.value.type === "create") {
5679
- var newChild = _objectSpread2$1({
5678
+ var newChild = _objectSpread2({
5680
5679
  id: countNodesRecursive(props.config.dataSource) + 1,
5681
5680
  children: [],
5682
5681
  type: "text"
@@ -5688,7 +5687,7 @@ var script$e = /*@__PURE__*/Object.assign({
5688
5687
  }, 0);
5689
5688
  } else {
5690
5689
  var parent = currentTarget.value.node.parent;
5691
- var target = _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, currentTarget.value.data), formModel.value), {}, {
5690
+ var target = _objectSpread2(_objectSpread2(_objectSpread2({}, currentTarget.value.data), formModel.value), {}, {
5692
5691
  type: "text"
5693
5692
  });
5694
5693
  var targetSon;
@@ -6039,7 +6038,7 @@ var FYTree = withInstall(script$e);
6039
6038
  var Select = {
6040
6039
  type: 'select',
6041
6040
  renderer: function renderer(props) {
6042
- return createVNode(FYSelect, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
6041
+ return createVNode(FYSelect, _objectSpread2(_objectSpread2({}, props), {}, {
6043
6042
  "modelValue": props.model[props.value],
6044
6043
  "onUpdate:modelValue": function onUpdateModelValue($event) {
6045
6044
  return props.model[props.value] = $event;
@@ -6050,7 +6049,7 @@ var Select = {
6050
6049
  var Input$1 = {
6051
6050
  type: 'input',
6052
6051
  renderer: function renderer(props) {
6053
- return createVNode(FYInput, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
6052
+ return createVNode(FYInput, _objectSpread2(_objectSpread2({}, props), {}, {
6054
6053
  "modelValue": props.model[props.value],
6055
6054
  "onUpdate:modelValue": function onUpdateModelValue($event) {
6056
6055
  return props.model[props.value] = $event;
@@ -6061,7 +6060,7 @@ var Input$1 = {
6061
6060
  var Switch = {
6062
6061
  type: 'switch',
6063
6062
  renderer: function renderer(props) {
6064
- return createVNode(FYSwitch, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
6063
+ return createVNode(FYSwitch, _objectSpread2(_objectSpread2({}, props), {}, {
6065
6064
  "modelValue": props.model[props.value],
6066
6065
  "onUpdate:modelValue": function onUpdateModelValue($event) {
6067
6066
  return props.model[props.value] = $event;
@@ -6072,7 +6071,7 @@ var Switch = {
6072
6071
  var DatePicker = {
6073
6072
  type: 'datePicker',
6074
6073
  renderer: function renderer(props) {
6075
- return createVNode(FYDatePicker, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
6074
+ return createVNode(FYDatePicker, _objectSpread2(_objectSpread2({}, props), {}, {
6076
6075
  "type": "date",
6077
6076
  "modelValue": props.model[props.value],
6078
6077
  "onUpdate:modelValue": function onUpdateModelValue($event) {
@@ -6084,7 +6083,7 @@ var DatePicker = {
6084
6083
  var Cascader = {
6085
6084
  type: 'cascader',
6086
6085
  renderer: function renderer(props) {
6087
- return createVNode(FYCascader, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
6086
+ return createVNode(FYCascader, _objectSpread2(_objectSpread2({}, props), {}, {
6088
6087
  "modelValue": props.model[props.value],
6089
6088
  "onUpdate:modelValue": function onUpdateModelValue($event) {
6090
6089
  return props.model[props.value] = $event;
@@ -6187,7 +6186,7 @@ var FormItem = defineComponent({
6187
6186
  "disabled": !!props.tmplItem.disabled
6188
6187
  }, {
6189
6188
  "default": function _default() {
6190
- return [createVNode(FormItemCom.value, _objectSpread2$1({
6189
+ return [createVNode(FormItemCom.value, _objectSpread2({
6191
6190
  "model": props.tmplItem.model
6192
6191
  }, props.tmplItem), null), props.config ? createVNode("div", {
6193
6192
  "class": "fy-form-config-info",
@@ -6400,7 +6399,7 @@ var Form = defineComponent({
6400
6399
  var initFormItems = props.template.filter(function (item) {
6401
6400
  return !item.filterUnShow && item.show !== false;
6402
6401
  }).map(function (sec) {
6403
- return _objectSpread2$1(_objectSpread2$1({}, sec), {}, {
6402
+ return _objectSpread2(_objectSpread2({}, sec), {}, {
6404
6403
  model: props.modelValue
6405
6404
  });
6406
6405
  });
@@ -6411,7 +6410,7 @@ var Form = defineComponent({
6411
6410
  oneOfFour: false
6412
6411
  };
6413
6412
  initFormItems = initFormItems.map(function (item) {
6414
- return _objectSpread2$1(_objectSpread2$1({}, item), styleObj);
6413
+ return _objectSpread2(_objectSpread2({}, item), styleObj);
6415
6414
  });
6416
6415
  expose({
6417
6416
  resetFields: resetFields,
@@ -6420,7 +6419,7 @@ var Form = defineComponent({
6420
6419
  clearValidate: clearValidate
6421
6420
  });
6422
6421
  return function () {
6423
- return createVNode(resolveComponent("el-form"), _objectSpread2$1({
6422
+ return createVNode(resolveComponent("el-form"), _objectSpread2({
6424
6423
  "label-position": props.labelPosition,
6425
6424
  "model": props.modelValue,
6426
6425
  "labelWidth": props.labelWidth,
@@ -7131,7 +7130,7 @@ function useFirstColumn(columnProps) {
7131
7130
  if (!props.selection && !props.index) {
7132
7131
  return function () {};
7133
7132
  }
7134
- return createVNode(resolveComponent("el-table-column"), _objectSpread2$1({
7133
+ return createVNode(resolveComponent("el-table-column"), _objectSpread2({
7135
7134
  "fixed": unref(columnProps.template).some(function (item) {
7136
7135
  return item.fixed;
7137
7136
  }),
@@ -7242,7 +7241,7 @@ var ImagePreview = {
7242
7241
  srcList[0] = value;
7243
7242
  url = value;
7244
7243
  }
7245
- return createVNode(resolveComponent("el-image"), _objectSpread2$1({
7244
+ return createVNode(resolveComponent("el-image"), _objectSpread2({
7246
7245
  "src": url,
7247
7246
  "preview-src-list": srcList,
7248
7247
  "preview-teleported": true,
@@ -7323,7 +7322,7 @@ function getColumns(template) {
7323
7322
  // render 如果是string 则代表type
7324
7323
  if (typeof tmpl.render === 'string') {
7325
7324
  if (tableEditItem.get(tmpl.render)) {
7326
- return createVNode(resolveComponent("EditRenderer"), _objectSpread2$1(_objectSpread2$1({}, tmpl), {}, {
7325
+ return createVNode(resolveComponent("EditRenderer"), _objectSpread2(_objectSpread2({}, tmpl), {}, {
7327
7326
  "scope": scope,
7328
7327
  "template": tmpl
7329
7328
  }), null);
@@ -7356,7 +7355,7 @@ function getColumns(template) {
7356
7355
  }();
7357
7356
  var _EditRenderer = tableEditItem.get(type);
7358
7357
  if (_EditRenderer) {
7359
- return createVNode(_EditRenderer, _objectSpread2$1(_objectSpread2$1({}, tmpl), {}, {
7358
+ return createVNode(_EditRenderer, _objectSpread2(_objectSpread2({}, tmpl), {}, {
7360
7359
  "scope": scope,
7361
7360
  "template": tmpl
7362
7361
  }), null);
@@ -7372,7 +7371,7 @@ function getColumns(template) {
7372
7371
  }
7373
7372
  };
7374
7373
  var key = "".concat(idx, "-").concat(tmpl.value);
7375
- return createVNode(resolveComponent("el-table-column"), _objectSpread2$1({
7374
+ return createVNode(resolveComponent("el-table-column"), _objectSpread2({
7376
7375
  "key": key,
7377
7376
  "label": tmpl.label,
7378
7377
  "prop": tmpl.value,
@@ -7403,7 +7402,7 @@ function getHeadSettingColumn(_ref) {
7403
7402
  setup: function setup(_, _ref2) {
7404
7403
  var attrs = _ref2.attrs;
7405
7404
  return function () {
7406
- return createVNode(resolveComponent("el-table-column"), _objectSpread2$1(_objectSpread2$1({
7405
+ return createVNode(resolveComponent("el-table-column"), _objectSpread2(_objectSpread2({
7407
7406
  "width": "55",
7408
7407
  "align": "center",
7409
7408
  "prop": "fy-setting"
@@ -7461,2663 +7460,12 @@ function useTableAttrs(attrs, template, showSelectionIndex) {
7461
7460
  colspan: 1
7462
7461
  };
7463
7462
  };
7464
- return _objectSpread2$1(_objectSpread2$1({}, attrs), {}, {
7463
+ return _objectSpread2(_objectSpread2({}, attrs), {}, {
7465
7464
  spanMethod: spanMethod,
7466
7465
  'header-row-class-name': attrs.headerRowClassName ? "".concat(attrs.headerRowClassName, " fy-table-header-row") : 'fy-table-header-row'
7467
7466
  });
7468
7467
  }
7469
7468
 
7470
- /**!
7471
- * Sortable 1.15.7
7472
- * @author RubaXa <trash@rubaxa.org>
7473
- * @author owenm <owen23355@gmail.com>
7474
- * @license MIT
7475
- */
7476
- function _defineProperty(e, r, t) {
7477
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
7478
- value: t,
7479
- enumerable: !0,
7480
- configurable: !0,
7481
- writable: !0
7482
- }) : e[r] = t, e;
7483
- }
7484
- function _extends() {
7485
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
7486
- for (var e = 1; e < arguments.length; e++) {
7487
- var t = arguments[e];
7488
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
7489
- }
7490
- return n;
7491
- }, _extends.apply(null, arguments);
7492
- }
7493
- function ownKeys(e, r) {
7494
- var t = Object.keys(e);
7495
- if (Object.getOwnPropertySymbols) {
7496
- var o = Object.getOwnPropertySymbols(e);
7497
- r && (o = o.filter(function (r) {
7498
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
7499
- })), t.push.apply(t, o);
7500
- }
7501
- return t;
7502
- }
7503
- function _objectSpread2(e) {
7504
- for (var r = 1; r < arguments.length; r++) {
7505
- var t = null != arguments[r] ? arguments[r] : {};
7506
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
7507
- _defineProperty(e, r, t[r]);
7508
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
7509
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
7510
- });
7511
- }
7512
- return e;
7513
- }
7514
- function _objectWithoutProperties(e, t) {
7515
- if (null == e) return {};
7516
- var o,
7517
- r,
7518
- i = _objectWithoutPropertiesLoose(e, t);
7519
- if (Object.getOwnPropertySymbols) {
7520
- var n = Object.getOwnPropertySymbols(e);
7521
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
7522
- }
7523
- return i;
7524
- }
7525
- function _objectWithoutPropertiesLoose(r, e) {
7526
- if (null == r) return {};
7527
- var t = {};
7528
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
7529
- if (-1 !== e.indexOf(n)) continue;
7530
- t[n] = r[n];
7531
- }
7532
- return t;
7533
- }
7534
- function _toPrimitive(t, r) {
7535
- if ("object" != typeof t || !t) return t;
7536
- var e = t[Symbol.toPrimitive];
7537
- if (void 0 !== e) {
7538
- var i = e.call(t, r || "default");
7539
- if ("object" != typeof i) return i;
7540
- throw new TypeError("@@toPrimitive must return a primitive value.");
7541
- }
7542
- return ("string" === r ? String : Number)(t);
7543
- }
7544
- function _toPropertyKey(t) {
7545
- var i = _toPrimitive(t, "string");
7546
- return "symbol" == typeof i ? i : i + "";
7547
- }
7548
- function _typeof(o) {
7549
- "@babel/helpers - typeof";
7550
-
7551
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
7552
- return typeof o;
7553
- } : function (o) {
7554
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
7555
- }, _typeof(o);
7556
- }
7557
-
7558
- var version = "1.15.7";
7559
-
7560
- function userAgent(pattern) {
7561
- if (typeof window !== 'undefined' && window.navigator) {
7562
- return !! /*@__PURE__*/navigator.userAgent.match(pattern);
7563
- }
7564
- }
7565
- var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
7566
- var Edge = userAgent(/Edge/i);
7567
- var FireFox = userAgent(/firefox/i);
7568
- var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
7569
- var IOS = userAgent(/iP(ad|od|hone)/i);
7570
- var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
7571
-
7572
- var captureMode = {
7573
- capture: false,
7574
- passive: false
7575
- };
7576
- function on(el, event, fn) {
7577
- el.addEventListener(event, fn, !IE11OrLess && captureMode);
7578
- }
7579
- function off(el, event, fn) {
7580
- el.removeEventListener(event, fn, !IE11OrLess && captureMode);
7581
- }
7582
- function matches( /**HTMLElement*/el, /**String*/selector) {
7583
- if (!selector) return;
7584
- selector[0] === '>' && (selector = selector.substring(1));
7585
- if (el) {
7586
- try {
7587
- if (el.matches) {
7588
- return el.matches(selector);
7589
- } else if (el.msMatchesSelector) {
7590
- return el.msMatchesSelector(selector);
7591
- } else if (el.webkitMatchesSelector) {
7592
- return el.webkitMatchesSelector(selector);
7593
- }
7594
- } catch (_) {
7595
- return false;
7596
- }
7597
- }
7598
- return false;
7599
- }
7600
- function getParentOrHost(el) {
7601
- return el.host && el !== document && el.host.nodeType && el.host !== el ? el.host : el.parentNode;
7602
- }
7603
- function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
7604
- if (el) {
7605
- ctx = ctx || document;
7606
- do {
7607
- if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
7608
- return el;
7609
- }
7610
- if (el === ctx) break;
7611
- /* jshint boss:true */
7612
- } while (el = getParentOrHost(el));
7613
- }
7614
- return null;
7615
- }
7616
- var R_SPACE = /\s+/g;
7617
- function toggleClass(el, name, state) {
7618
- if (el && name) {
7619
- if (el.classList) {
7620
- el.classList[state ? 'add' : 'remove'](name);
7621
- } else {
7622
- var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
7623
- el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
7624
- }
7625
- }
7626
- }
7627
- function css(el, prop, val) {
7628
- var style = el && el.style;
7629
- if (style) {
7630
- if (val === void 0) {
7631
- if (document.defaultView && document.defaultView.getComputedStyle) {
7632
- val = document.defaultView.getComputedStyle(el, '');
7633
- } else if (el.currentStyle) {
7634
- val = el.currentStyle;
7635
- }
7636
- return prop === void 0 ? val : val[prop];
7637
- } else {
7638
- if (!(prop in style) && prop.indexOf('webkit') === -1) {
7639
- prop = '-webkit-' + prop;
7640
- }
7641
- style[prop] = val + (typeof val === 'string' ? '' : 'px');
7642
- }
7643
- }
7644
- }
7645
- function matrix(el, selfOnly) {
7646
- var appliedTransforms = '';
7647
- if (typeof el === 'string') {
7648
- appliedTransforms = el;
7649
- } else {
7650
- do {
7651
- var transform = css(el, 'transform');
7652
- if (transform && transform !== 'none') {
7653
- appliedTransforms = transform + ' ' + appliedTransforms;
7654
- }
7655
- /* jshint boss:true */
7656
- } while (!selfOnly && (el = el.parentNode));
7657
- }
7658
- var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
7659
- /*jshint -W056 */
7660
- return matrixFn && new matrixFn(appliedTransforms);
7661
- }
7662
- function find(ctx, tagName, iterator) {
7663
- if (ctx) {
7664
- var list = ctx.getElementsByTagName(tagName),
7665
- i = 0,
7666
- n = list.length;
7667
- if (iterator) {
7668
- for (; i < n; i++) {
7669
- iterator(list[i], i);
7670
- }
7671
- }
7672
- return list;
7673
- }
7674
- return [];
7675
- }
7676
- function getWindowScrollingElement() {
7677
- var scrollingElement = document.scrollingElement;
7678
- if (scrollingElement) {
7679
- return scrollingElement;
7680
- } else {
7681
- return document.documentElement;
7682
- }
7683
- }
7684
-
7685
- /**
7686
- * Returns the "bounding client rect" of given element
7687
- * @param {HTMLElement} el The element whose boundingClientRect is wanted
7688
- * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
7689
- * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
7690
- * @param {[Boolean]} undoScale Whether the container's scale() should be undone
7691
- * @param {[HTMLElement]} container The parent the element will be placed in
7692
- * @return {Object} The boundingClientRect of el, with specified adjustments
7693
- */
7694
- function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
7695
- if (!el.getBoundingClientRect && el !== window) return;
7696
- var elRect, top, left, bottom, right, height, width;
7697
- if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
7698
- elRect = el.getBoundingClientRect();
7699
- top = elRect.top;
7700
- left = elRect.left;
7701
- bottom = elRect.bottom;
7702
- right = elRect.right;
7703
- height = elRect.height;
7704
- width = elRect.width;
7705
- } else {
7706
- top = 0;
7707
- left = 0;
7708
- bottom = window.innerHeight;
7709
- right = window.innerWidth;
7710
- height = window.innerHeight;
7711
- width = window.innerWidth;
7712
- }
7713
- if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
7714
- // Adjust for translate()
7715
- container = container || el.parentNode;
7716
-
7717
- // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
7718
- // Not needed on <= IE11
7719
- if (!IE11OrLess) {
7720
- do {
7721
- if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
7722
- var containerRect = container.getBoundingClientRect();
7723
-
7724
- // Set relative to edges of padding box of container
7725
- top -= containerRect.top + parseInt(css(container, 'border-top-width'));
7726
- left -= containerRect.left + parseInt(css(container, 'border-left-width'));
7727
- bottom = top + elRect.height;
7728
- right = left + elRect.width;
7729
- break;
7730
- }
7731
- /* jshint boss:true */
7732
- } while (container = container.parentNode);
7733
- }
7734
- }
7735
- if (undoScale && el !== window) {
7736
- // Adjust for scale()
7737
- var elMatrix = matrix(container || el),
7738
- scaleX = elMatrix && elMatrix.a,
7739
- scaleY = elMatrix && elMatrix.d;
7740
- if (elMatrix) {
7741
- top /= scaleY;
7742
- left /= scaleX;
7743
- width /= scaleX;
7744
- height /= scaleY;
7745
- bottom = top + height;
7746
- right = left + width;
7747
- }
7748
- }
7749
- return {
7750
- top: top,
7751
- left: left,
7752
- bottom: bottom,
7753
- right: right,
7754
- width: width,
7755
- height: height
7756
- };
7757
- }
7758
-
7759
- /**
7760
- * Checks if a side of an element is scrolled past a side of its parents
7761
- * @param {HTMLElement} el The element who's side being scrolled out of view is in question
7762
- * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
7763
- * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
7764
- * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
7765
- */
7766
- function isScrolledPast(el, elSide, parentSide) {
7767
- var parent = getParentAutoScrollElement(el, true),
7768
- elSideVal = getRect(el)[elSide];
7769
-
7770
- /* jshint boss:true */
7771
- while (parent) {
7772
- var parentSideVal = getRect(parent)[parentSide],
7773
- visible = void 0;
7774
- if (parentSide === 'top' || parentSide === 'left') {
7775
- visible = elSideVal >= parentSideVal;
7776
- } else {
7777
- visible = elSideVal <= parentSideVal;
7778
- }
7779
- if (!visible) return parent;
7780
- if (parent === getWindowScrollingElement()) break;
7781
- parent = getParentAutoScrollElement(parent, false);
7782
- }
7783
- return false;
7784
- }
7785
-
7786
- /**
7787
- * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
7788
- * and non-draggable elements
7789
- * @param {HTMLElement} el The parent element
7790
- * @param {Number} childNum The index of the child
7791
- * @param {Object} options Parent Sortable's options
7792
- * @return {HTMLElement} The child at index childNum, or null if not found
7793
- */
7794
- function getChild(el, childNum, options, includeDragEl) {
7795
- var currentChild = 0,
7796
- i = 0,
7797
- children = el.children;
7798
- while (i < children.length) {
7799
- if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
7800
- if (currentChild === childNum) {
7801
- return children[i];
7802
- }
7803
- currentChild++;
7804
- }
7805
- i++;
7806
- }
7807
- return null;
7808
- }
7809
-
7810
- /**
7811
- * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
7812
- * @param {HTMLElement} el Parent element
7813
- * @param {selector} selector Any other elements that should be ignored
7814
- * @return {HTMLElement} The last child, ignoring ghostEl
7815
- */
7816
- function lastChild(el, selector) {
7817
- var last = el.lastElementChild;
7818
- while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
7819
- last = last.previousElementSibling;
7820
- }
7821
- return last || null;
7822
- }
7823
-
7824
- /**
7825
- * Returns the index of an element within its parent for a selected set of
7826
- * elements
7827
- * @param {HTMLElement} el
7828
- * @param {selector} selector
7829
- * @return {number}
7830
- */
7831
- function index$1(el, selector) {
7832
- var index = 0;
7833
- if (!el || !el.parentNode) {
7834
- return -1;
7835
- }
7836
-
7837
- /* jshint boss:true */
7838
- while (el = el.previousElementSibling) {
7839
- if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
7840
- index++;
7841
- }
7842
- }
7843
- return index;
7844
- }
7845
-
7846
- /**
7847
- * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
7848
- * The value is returned in real pixels.
7849
- * @param {HTMLElement} el
7850
- * @return {Array} Offsets in the format of [left, top]
7851
- */
7852
- function getRelativeScrollOffset(el) {
7853
- var offsetLeft = 0,
7854
- offsetTop = 0,
7855
- winScroller = getWindowScrollingElement();
7856
- if (el) {
7857
- do {
7858
- var elMatrix = matrix(el),
7859
- scaleX = elMatrix.a,
7860
- scaleY = elMatrix.d;
7861
- offsetLeft += el.scrollLeft * scaleX;
7862
- offsetTop += el.scrollTop * scaleY;
7863
- } while (el !== winScroller && (el = el.parentNode));
7864
- }
7865
- return [offsetLeft, offsetTop];
7866
- }
7867
-
7868
- /**
7869
- * Returns the index of the object within the given array
7870
- * @param {Array} arr Array that may or may not hold the object
7871
- * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
7872
- * @return {Number} The index of the object in the array, or -1
7873
- */
7874
- function indexOfObject(arr, obj) {
7875
- for (var i in arr) {
7876
- if (!arr.hasOwnProperty(i)) continue;
7877
- for (var key in obj) {
7878
- if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
7879
- }
7880
- }
7881
- return -1;
7882
- }
7883
- function getParentAutoScrollElement(el, includeSelf) {
7884
- // skip to window
7885
- if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
7886
- var elem = el;
7887
- var gotSelf = false;
7888
- do {
7889
- // we don't need to get elem css if it isn't even overflowing in the first place (performance)
7890
- if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
7891
- var elemCSS = css(elem);
7892
- if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
7893
- if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
7894
- if (gotSelf || includeSelf) return elem;
7895
- gotSelf = true;
7896
- }
7897
- }
7898
- /* jshint boss:true */
7899
- } while (elem = elem.parentNode);
7900
- return getWindowScrollingElement();
7901
- }
7902
- function extend(dst, src) {
7903
- if (dst && src) {
7904
- for (var key in src) {
7905
- if (src.hasOwnProperty(key)) {
7906
- dst[key] = src[key];
7907
- }
7908
- }
7909
- }
7910
- return dst;
7911
- }
7912
- function isRectEqual(rect1, rect2) {
7913
- return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
7914
- }
7915
- var _throttleTimeout;
7916
- function throttle(callback, ms) {
7917
- return function () {
7918
- if (!_throttleTimeout) {
7919
- var args = arguments,
7920
- _this = this;
7921
- if (args.length === 1) {
7922
- callback.call(_this, args[0]);
7923
- } else {
7924
- callback.apply(_this, args);
7925
- }
7926
- _throttleTimeout = setTimeout(function () {
7927
- _throttleTimeout = void 0;
7928
- }, ms);
7929
- }
7930
- };
7931
- }
7932
- function cancelThrottle() {
7933
- clearTimeout(_throttleTimeout);
7934
- _throttleTimeout = void 0;
7935
- }
7936
- function scrollBy(el, x, y) {
7937
- el.scrollLeft += x;
7938
- el.scrollTop += y;
7939
- }
7940
- function clone(el) {
7941
- var Polymer = window.Polymer;
7942
- var $ = window.jQuery || window.Zepto;
7943
- if (Polymer && Polymer.dom) {
7944
- return Polymer.dom(el).cloneNode(true);
7945
- } else if ($) {
7946
- return $(el).clone(true)[0];
7947
- } else {
7948
- return el.cloneNode(true);
7949
- }
7950
- }
7951
- function getChildContainingRectFromElement(container, options, ghostEl) {
7952
- var rect = {};
7953
- Array.from(container.children).forEach(function (child) {
7954
- var _rect$left, _rect$top, _rect$right, _rect$bottom;
7955
- if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
7956
- var childRect = getRect(child);
7957
- rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
7958
- rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
7959
- rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
7960
- rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
7961
- });
7962
- rect.width = rect.right - rect.left;
7963
- rect.height = rect.bottom - rect.top;
7964
- rect.x = rect.left;
7965
- rect.y = rect.top;
7966
- return rect;
7967
- }
7968
- var expando = 'Sortable' + new Date().getTime();
7969
-
7970
- function AnimationStateManager() {
7971
- var animationStates = [],
7972
- animationCallbackId;
7973
- return {
7974
- captureAnimationState: function captureAnimationState() {
7975
- animationStates = [];
7976
- if (!this.options.animation) return;
7977
- var children = [].slice.call(this.el.children);
7978
- children.forEach(function (child) {
7979
- if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
7980
- animationStates.push({
7981
- target: child,
7982
- rect: getRect(child)
7983
- });
7984
- var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
7985
-
7986
- // If animating: compensate for current animation
7987
- if (child.thisAnimationDuration) {
7988
- var childMatrix = matrix(child, true);
7989
- if (childMatrix) {
7990
- fromRect.top -= childMatrix.f;
7991
- fromRect.left -= childMatrix.e;
7992
- }
7993
- }
7994
- child.fromRect = fromRect;
7995
- });
7996
- },
7997
- addAnimationState: function addAnimationState(state) {
7998
- animationStates.push(state);
7999
- },
8000
- removeAnimationState: function removeAnimationState(target) {
8001
- animationStates.splice(indexOfObject(animationStates, {
8002
- target: target
8003
- }), 1);
8004
- },
8005
- animateAll: function animateAll(callback) {
8006
- var _this = this;
8007
- if (!this.options.animation) {
8008
- clearTimeout(animationCallbackId);
8009
- if (typeof callback === 'function') callback();
8010
- return;
8011
- }
8012
- var animating = false,
8013
- animationTime = 0;
8014
- animationStates.forEach(function (state) {
8015
- var time = 0,
8016
- target = state.target,
8017
- fromRect = target.fromRect,
8018
- toRect = getRect(target),
8019
- prevFromRect = target.prevFromRect,
8020
- prevToRect = target.prevToRect,
8021
- animatingRect = state.rect,
8022
- targetMatrix = matrix(target, true);
8023
- if (targetMatrix) {
8024
- // Compensate for current animation
8025
- toRect.top -= targetMatrix.f;
8026
- toRect.left -= targetMatrix.e;
8027
- }
8028
- target.toRect = toRect;
8029
- if (target.thisAnimationDuration) {
8030
- // Could also check if animatingRect is between fromRect and toRect
8031
- if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
8032
- // Make sure animatingRect is on line between toRect & fromRect
8033
- (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
8034
- // If returning to same place as started from animation and on same axis
8035
- time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
8036
- }
8037
- }
8038
-
8039
- // if fromRect != toRect: animate
8040
- if (!isRectEqual(toRect, fromRect)) {
8041
- target.prevFromRect = fromRect;
8042
- target.prevToRect = toRect;
8043
- if (!time) {
8044
- time = _this.options.animation;
8045
- }
8046
- _this.animate(target, animatingRect, toRect, time);
8047
- }
8048
- if (time) {
8049
- animating = true;
8050
- animationTime = Math.max(animationTime, time);
8051
- clearTimeout(target.animationResetTimer);
8052
- target.animationResetTimer = setTimeout(function () {
8053
- target.animationTime = 0;
8054
- target.prevFromRect = null;
8055
- target.fromRect = null;
8056
- target.prevToRect = null;
8057
- target.thisAnimationDuration = null;
8058
- }, time);
8059
- target.thisAnimationDuration = time;
8060
- }
8061
- });
8062
- clearTimeout(animationCallbackId);
8063
- if (!animating) {
8064
- if (typeof callback === 'function') callback();
8065
- } else {
8066
- animationCallbackId = setTimeout(function () {
8067
- if (typeof callback === 'function') callback();
8068
- }, animationTime);
8069
- }
8070
- animationStates = [];
8071
- },
8072
- animate: function animate(target, currentRect, toRect, duration) {
8073
- if (duration) {
8074
- css(target, 'transition', '');
8075
- css(target, 'transform', '');
8076
- var elMatrix = matrix(this.el),
8077
- scaleX = elMatrix && elMatrix.a,
8078
- scaleY = elMatrix && elMatrix.d,
8079
- translateX = (currentRect.left - toRect.left) / (scaleX || 1),
8080
- translateY = (currentRect.top - toRect.top) / (scaleY || 1);
8081
- target.animatingX = !!translateX;
8082
- target.animatingY = !!translateY;
8083
- css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
8084
- this.forRepaintDummy = repaint(target); // repaint
8085
-
8086
- css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
8087
- css(target, 'transform', 'translate3d(0,0,0)');
8088
- typeof target.animated === 'number' && clearTimeout(target.animated);
8089
- target.animated = setTimeout(function () {
8090
- css(target, 'transition', '');
8091
- css(target, 'transform', '');
8092
- target.animated = false;
8093
- target.animatingX = false;
8094
- target.animatingY = false;
8095
- }, duration);
8096
- }
8097
- }
8098
- };
8099
- }
8100
- function repaint(target) {
8101
- return target.offsetWidth;
8102
- }
8103
- function calculateRealTime(animatingRect, fromRect, toRect, options) {
8104
- return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
8105
- }
8106
-
8107
- var plugins = [];
8108
- var defaults = {
8109
- initializeByDefault: true
8110
- };
8111
- var PluginManager = {
8112
- mount: function mount(plugin) {
8113
- // Set default static properties
8114
- for (var option in defaults) {
8115
- if (defaults.hasOwnProperty(option) && !(option in plugin)) {
8116
- plugin[option] = defaults[option];
8117
- }
8118
- }
8119
- plugins.forEach(function (p) {
8120
- if (p.pluginName === plugin.pluginName) {
8121
- throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
8122
- }
8123
- });
8124
- plugins.push(plugin);
8125
- },
8126
- pluginEvent: function pluginEvent(eventName, sortable, evt) {
8127
- var _this = this;
8128
- this.eventCanceled = false;
8129
- evt.cancel = function () {
8130
- _this.eventCanceled = true;
8131
- };
8132
- var eventNameGlobal = eventName + 'Global';
8133
- plugins.forEach(function (plugin) {
8134
- if (!sortable[plugin.pluginName]) return;
8135
- // Fire global events if it exists in this sortable
8136
- if (sortable[plugin.pluginName][eventNameGlobal]) {
8137
- sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
8138
- sortable: sortable
8139
- }, evt));
8140
- }
8141
-
8142
- // Only fire plugin event if plugin is enabled in this sortable,
8143
- // and plugin has event defined
8144
- if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
8145
- sortable[plugin.pluginName][eventName](_objectSpread2({
8146
- sortable: sortable
8147
- }, evt));
8148
- }
8149
- });
8150
- },
8151
- initializePlugins: function initializePlugins(sortable, el, defaults, options) {
8152
- plugins.forEach(function (plugin) {
8153
- var pluginName = plugin.pluginName;
8154
- if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
8155
- var initialized = new plugin(sortable, el, sortable.options);
8156
- initialized.sortable = sortable;
8157
- initialized.options = sortable.options;
8158
- sortable[pluginName] = initialized;
8159
-
8160
- // Add default options from plugin
8161
- _extends(defaults, initialized.defaults);
8162
- });
8163
- for (var option in sortable.options) {
8164
- if (!sortable.options.hasOwnProperty(option)) continue;
8165
- var modified = this.modifyOption(sortable, option, sortable.options[option]);
8166
- if (typeof modified !== 'undefined') {
8167
- sortable.options[option] = modified;
8168
- }
8169
- }
8170
- },
8171
- getEventProperties: function getEventProperties(name, sortable) {
8172
- var eventProperties = {};
8173
- plugins.forEach(function (plugin) {
8174
- if (typeof plugin.eventProperties !== 'function') return;
8175
- _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
8176
- });
8177
- return eventProperties;
8178
- },
8179
- modifyOption: function modifyOption(sortable, name, value) {
8180
- var modifiedValue;
8181
- plugins.forEach(function (plugin) {
8182
- // Plugin must exist on the Sortable
8183
- if (!sortable[plugin.pluginName]) return;
8184
-
8185
- // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
8186
- if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
8187
- modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
8188
- }
8189
- });
8190
- return modifiedValue;
8191
- }
8192
- };
8193
-
8194
- function dispatchEvent(_ref) {
8195
- var sortable = _ref.sortable,
8196
- rootEl = _ref.rootEl,
8197
- name = _ref.name,
8198
- targetEl = _ref.targetEl,
8199
- cloneEl = _ref.cloneEl,
8200
- toEl = _ref.toEl,
8201
- fromEl = _ref.fromEl,
8202
- oldIndex = _ref.oldIndex,
8203
- newIndex = _ref.newIndex,
8204
- oldDraggableIndex = _ref.oldDraggableIndex,
8205
- newDraggableIndex = _ref.newDraggableIndex,
8206
- originalEvent = _ref.originalEvent,
8207
- putSortable = _ref.putSortable,
8208
- extraEventProperties = _ref.extraEventProperties;
8209
- sortable = sortable || rootEl && rootEl[expando];
8210
- if (!sortable) return;
8211
- var evt,
8212
- options = sortable.options,
8213
- onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
8214
- // Support for new CustomEvent feature
8215
- if (window.CustomEvent && !IE11OrLess && !Edge) {
8216
- evt = new CustomEvent(name, {
8217
- bubbles: true,
8218
- cancelable: true
8219
- });
8220
- } else {
8221
- evt = document.createEvent('Event');
8222
- evt.initEvent(name, true, true);
8223
- }
8224
- evt.to = toEl || rootEl;
8225
- evt.from = fromEl || rootEl;
8226
- evt.item = targetEl || rootEl;
8227
- evt.clone = cloneEl;
8228
- evt.oldIndex = oldIndex;
8229
- evt.newIndex = newIndex;
8230
- evt.oldDraggableIndex = oldDraggableIndex;
8231
- evt.newDraggableIndex = newDraggableIndex;
8232
- evt.originalEvent = originalEvent;
8233
- evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
8234
- var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
8235
- for (var option in allEventProperties) {
8236
- evt[option] = allEventProperties[option];
8237
- }
8238
- if (rootEl) {
8239
- rootEl.dispatchEvent(evt);
8240
- }
8241
- if (options[onName]) {
8242
- options[onName].call(sortable, evt);
8243
- }
8244
- }
8245
-
8246
- var _excluded = ["evt"];
8247
- var pluginEvent = function pluginEvent(eventName, sortable) {
8248
- var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
8249
- originalEvent = _ref.evt,
8250
- data = _objectWithoutProperties(_ref, _excluded);
8251
- PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
8252
- dragEl: dragEl,
8253
- parentEl: parentEl,
8254
- ghostEl: ghostEl,
8255
- rootEl: rootEl,
8256
- nextEl: nextEl,
8257
- lastDownEl: lastDownEl,
8258
- cloneEl: cloneEl,
8259
- cloneHidden: cloneHidden,
8260
- dragStarted: moved,
8261
- putSortable: putSortable,
8262
- activeSortable: Sortable.active,
8263
- originalEvent: originalEvent,
8264
- oldIndex: oldIndex,
8265
- oldDraggableIndex: oldDraggableIndex,
8266
- newIndex: newIndex,
8267
- newDraggableIndex: newDraggableIndex,
8268
- hideGhostForTarget: _hideGhostForTarget,
8269
- unhideGhostForTarget: _unhideGhostForTarget,
8270
- cloneNowHidden: function cloneNowHidden() {
8271
- cloneHidden = true;
8272
- },
8273
- cloneNowShown: function cloneNowShown() {
8274
- cloneHidden = false;
8275
- },
8276
- dispatchSortableEvent: function dispatchSortableEvent(name) {
8277
- _dispatchEvent({
8278
- sortable: sortable,
8279
- name: name,
8280
- originalEvent: originalEvent
8281
- });
8282
- }
8283
- }, data));
8284
- };
8285
- function _dispatchEvent(info) {
8286
- dispatchEvent(_objectSpread2({
8287
- putSortable: putSortable,
8288
- cloneEl: cloneEl,
8289
- targetEl: dragEl,
8290
- rootEl: rootEl,
8291
- oldIndex: oldIndex,
8292
- oldDraggableIndex: oldDraggableIndex,
8293
- newIndex: newIndex,
8294
- newDraggableIndex: newDraggableIndex
8295
- }, info));
8296
- }
8297
- var dragEl,
8298
- parentEl,
8299
- ghostEl,
8300
- rootEl,
8301
- nextEl,
8302
- lastDownEl,
8303
- cloneEl,
8304
- cloneHidden,
8305
- oldIndex,
8306
- newIndex,
8307
- oldDraggableIndex,
8308
- newDraggableIndex,
8309
- activeGroup,
8310
- putSortable,
8311
- awaitingDragStarted = false,
8312
- ignoreNextClick = false,
8313
- sortables = [],
8314
- tapEvt,
8315
- touchEvt,
8316
- lastDx,
8317
- lastDy,
8318
- tapDistanceLeft,
8319
- tapDistanceTop,
8320
- moved,
8321
- lastTarget,
8322
- lastDirection,
8323
- pastFirstInvertThresh = false,
8324
- isCircumstantialInvert = false,
8325
- targetMoveDistance,
8326
- // For positioning ghost absolutely
8327
- ghostRelativeParent,
8328
- ghostRelativeParentInitialScroll = [],
8329
- // (left, top)
8330
-
8331
- _silent = false,
8332
- savedInputChecked = [];
8333
-
8334
- /** @const */
8335
- var documentExists = typeof document !== 'undefined',
8336
- PositionGhostAbsolutely = IOS,
8337
- CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
8338
- // This will not pass for IE9, because IE9 DnD only works on anchors
8339
- supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
8340
- supportCssPointerEvents = function () {
8341
- if (!documentExists) return;
8342
- // false when <= IE11
8343
- if (IE11OrLess) {
8344
- return false;
8345
- }
8346
- var el = document.createElement('x');
8347
- el.style.cssText = 'pointer-events:auto';
8348
- return el.style.pointerEvents === 'auto';
8349
- }(),
8350
- _detectDirection = function _detectDirection(el, options) {
8351
- var elCSS = css(el),
8352
- elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
8353
- child1 = getChild(el, 0, options),
8354
- child2 = getChild(el, 1, options),
8355
- firstChildCSS = child1 && css(child1),
8356
- secondChildCSS = child2 && css(child2),
8357
- firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
8358
- secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
8359
- if (elCSS.display === 'flex') {
8360
- return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
8361
- }
8362
- if (elCSS.display === 'grid') {
8363
- return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
8364
- }
8365
- if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
8366
- var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
8367
- return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
8368
- }
8369
- return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
8370
- },
8371
- _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
8372
- var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
8373
- dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
8374
- dragElOppLength = vertical ? dragRect.width : dragRect.height,
8375
- targetS1Opp = vertical ? targetRect.left : targetRect.top,
8376
- targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
8377
- targetOppLength = vertical ? targetRect.width : targetRect.height;
8378
- return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
8379
- },
8380
- /**
8381
- * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
8382
- * @param {Number} x X position
8383
- * @param {Number} y Y position
8384
- * @return {HTMLElement} Element of the first found nearest Sortable
8385
- */
8386
- _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
8387
- var ret;
8388
- sortables.some(function (sortable) {
8389
- var threshold = sortable[expando].options.emptyInsertThreshold;
8390
- if (!threshold || lastChild(sortable)) return;
8391
- var rect = getRect(sortable),
8392
- insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
8393
- insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
8394
- if (insideHorizontally && insideVertically) {
8395
- return ret = sortable;
8396
- }
8397
- });
8398
- return ret;
8399
- },
8400
- _prepareGroup = function _prepareGroup(options) {
8401
- function toFn(value, pull) {
8402
- return function (to, from, dragEl, evt) {
8403
- var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
8404
- if (value == null && (pull || sameGroup)) {
8405
- // Default pull value
8406
- // Default pull and put value if same group
8407
- return true;
8408
- } else if (value == null || value === false) {
8409
- return false;
8410
- } else if (pull && value === 'clone') {
8411
- return value;
8412
- } else if (typeof value === 'function') {
8413
- return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
8414
- } else {
8415
- var otherGroup = (pull ? to : from).options.group.name;
8416
- return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
8417
- }
8418
- };
8419
- }
8420
- var group = {};
8421
- var originalGroup = options.group;
8422
- if (!originalGroup || _typeof(originalGroup) != 'object') {
8423
- originalGroup = {
8424
- name: originalGroup
8425
- };
8426
- }
8427
- group.name = originalGroup.name;
8428
- group.checkPull = toFn(originalGroup.pull, true);
8429
- group.checkPut = toFn(originalGroup.put);
8430
- group.revertClone = originalGroup.revertClone;
8431
- options.group = group;
8432
- },
8433
- _hideGhostForTarget = function _hideGhostForTarget() {
8434
- if (!supportCssPointerEvents && ghostEl) {
8435
- css(ghostEl, 'display', 'none');
8436
- }
8437
- },
8438
- _unhideGhostForTarget = function _unhideGhostForTarget() {
8439
- if (!supportCssPointerEvents && ghostEl) {
8440
- css(ghostEl, 'display', '');
8441
- }
8442
- };
8443
-
8444
- // #1184 fix - Prevent click event on fallback if dragged but item not changed position
8445
- if (documentExists && !ChromeForAndroid) {
8446
- document.addEventListener('click', function (evt) {
8447
- if (ignoreNextClick) {
8448
- evt.preventDefault();
8449
- evt.stopPropagation && evt.stopPropagation();
8450
- evt.stopImmediatePropagation && evt.stopImmediatePropagation();
8451
- ignoreNextClick = false;
8452
- return false;
8453
- }
8454
- }, true);
8455
- }
8456
- var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
8457
- if (dragEl) {
8458
- evt = evt.touches ? evt.touches[0] : evt;
8459
- var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
8460
- if (nearest) {
8461
- // Create imitation event
8462
- var event = {};
8463
- for (var i in evt) {
8464
- if (evt.hasOwnProperty(i)) {
8465
- event[i] = evt[i];
8466
- }
8467
- }
8468
- event.target = event.rootEl = nearest;
8469
- event.preventDefault = void 0;
8470
- event.stopPropagation = void 0;
8471
- nearest[expando]._onDragOver(event);
8472
- }
8473
- }
8474
- };
8475
- var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
8476
- if (dragEl) {
8477
- dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
8478
- }
8479
- };
8480
-
8481
- /**
8482
- * @class Sortable
8483
- * @param {HTMLElement} el
8484
- * @param {Object} [options]
8485
- */
8486
- function Sortable(el, options) {
8487
- if (!(el && el.nodeType && el.nodeType === 1)) {
8488
- throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
8489
- }
8490
- this.el = el; // root element
8491
- this.options = options = _extends({}, options);
8492
-
8493
- // Export instance
8494
- el[expando] = this;
8495
- var defaults = {
8496
- group: null,
8497
- sort: true,
8498
- disabled: false,
8499
- store: null,
8500
- handle: null,
8501
- draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
8502
- swapThreshold: 1,
8503
- // percentage; 0 <= x <= 1
8504
- invertSwap: false,
8505
- // invert always
8506
- invertedSwapThreshold: null,
8507
- // will be set to same as swapThreshold if default
8508
- removeCloneOnHide: true,
8509
- direction: function direction() {
8510
- return _detectDirection(el, this.options);
8511
- },
8512
- ghostClass: 'sortable-ghost',
8513
- chosenClass: 'sortable-chosen',
8514
- dragClass: 'sortable-drag',
8515
- ignore: 'a, img',
8516
- filter: null,
8517
- preventOnFilter: true,
8518
- animation: 0,
8519
- easing: null,
8520
- setData: function setData(dataTransfer, dragEl) {
8521
- dataTransfer.setData('Text', dragEl.textContent);
8522
- },
8523
- dropBubble: false,
8524
- dragoverBubble: false,
8525
- dataIdAttr: 'data-id',
8526
- delay: 0,
8527
- delayOnTouchOnly: false,
8528
- touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
8529
- forceFallback: false,
8530
- fallbackClass: 'sortable-fallback',
8531
- fallbackOnBody: false,
8532
- fallbackTolerance: 0,
8533
- fallbackOffset: {
8534
- x: 0,
8535
- y: 0
8536
- },
8537
- // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
8538
- supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),
8539
- emptyInsertThreshold: 5
8540
- };
8541
- PluginManager.initializePlugins(this, el, defaults);
8542
-
8543
- // Set default options
8544
- for (var name in defaults) {
8545
- !(name in options) && (options[name] = defaults[name]);
8546
- }
8547
- _prepareGroup(options);
8548
-
8549
- // Bind all private methods
8550
- for (var fn in this) {
8551
- if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
8552
- this[fn] = this[fn].bind(this);
8553
- }
8554
- }
8555
-
8556
- // Setup drag mode
8557
- this.nativeDraggable = options.forceFallback ? false : supportDraggable;
8558
- if (this.nativeDraggable) {
8559
- // Touch start threshold cannot be greater than the native dragstart threshold
8560
- this.options.touchStartThreshold = 1;
8561
- }
8562
-
8563
- // Bind events
8564
- if (options.supportPointer) {
8565
- on(el, 'pointerdown', this._onTapStart);
8566
- } else {
8567
- on(el, 'mousedown', this._onTapStart);
8568
- on(el, 'touchstart', this._onTapStart);
8569
- }
8570
- if (this.nativeDraggable) {
8571
- on(el, 'dragover', this);
8572
- on(el, 'dragenter', this);
8573
- }
8574
- sortables.push(this.el);
8575
-
8576
- // Restore sorting
8577
- options.store && options.store.get && this.sort(options.store.get(this) || []);
8578
-
8579
- // Add animation state manager
8580
- _extends(this, AnimationStateManager());
8581
- }
8582
- Sortable.prototype = /** @lends Sortable.prototype */{
8583
- constructor: Sortable,
8584
- _isOutsideThisEl: function _isOutsideThisEl(target) {
8585
- if (!this.el.contains(target) && target !== this.el) {
8586
- lastTarget = null;
8587
- }
8588
- },
8589
- _getDirection: function _getDirection(evt, target) {
8590
- return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
8591
- },
8592
- _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
8593
- if (!evt.cancelable) return;
8594
- var _this = this,
8595
- el = this.el,
8596
- options = this.options,
8597
- preventOnFilter = options.preventOnFilter,
8598
- type = evt.type,
8599
- touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
8600
- target = (touch || evt).target,
8601
- originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
8602
- filter = options.filter;
8603
- _saveInputCheckedState(el);
8604
-
8605
- // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
8606
- if (dragEl) {
8607
- return;
8608
- }
8609
- if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
8610
- return; // only left button and enabled
8611
- }
8612
-
8613
- // cancel dnd if original target is content editable
8614
- if (originalTarget.isContentEditable) {
8615
- return;
8616
- }
8617
-
8618
- // Safari ignores further event handling after mousedown
8619
- if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
8620
- return;
8621
- }
8622
- target = closest(target, options.draggable, el, false);
8623
- if (target && target.animated) {
8624
- return;
8625
- }
8626
- if (lastDownEl === target) {
8627
- // Ignoring duplicate `down`
8628
- return;
8629
- }
8630
-
8631
- // Get the index of the dragged element within its parent
8632
- oldIndex = index$1(target);
8633
- oldDraggableIndex = index$1(target, options.draggable);
8634
-
8635
- // Check filter
8636
- if (typeof filter === 'function') {
8637
- if (filter.call(this, evt, target, this)) {
8638
- _dispatchEvent({
8639
- sortable: _this,
8640
- rootEl: originalTarget,
8641
- name: 'filter',
8642
- targetEl: target,
8643
- toEl: el,
8644
- fromEl: el
8645
- });
8646
- pluginEvent('filter', _this, {
8647
- evt: evt
8648
- });
8649
- preventOnFilter && evt.preventDefault();
8650
- return; // cancel dnd
8651
- }
8652
- } else if (filter) {
8653
- filter = filter.split(',').some(function (criteria) {
8654
- criteria = closest(originalTarget, criteria.trim(), el, false);
8655
- if (criteria) {
8656
- _dispatchEvent({
8657
- sortable: _this,
8658
- rootEl: criteria,
8659
- name: 'filter',
8660
- targetEl: target,
8661
- fromEl: el,
8662
- toEl: el
8663
- });
8664
- pluginEvent('filter', _this, {
8665
- evt: evt
8666
- });
8667
- return true;
8668
- }
8669
- });
8670
- if (filter) {
8671
- preventOnFilter && evt.preventDefault();
8672
- return; // cancel dnd
8673
- }
8674
- }
8675
- if (options.handle && !closest(originalTarget, options.handle, el, false)) {
8676
- return;
8677
- }
8678
-
8679
- // Prepare `dragstart`
8680
- this._prepareDragStart(evt, touch, target);
8681
- },
8682
- _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
8683
- var _this = this,
8684
- el = _this.el,
8685
- options = _this.options,
8686
- ownerDocument = el.ownerDocument,
8687
- dragStartFn;
8688
- if (target && !dragEl && target.parentNode === el) {
8689
- var dragRect = getRect(target);
8690
- rootEl = el;
8691
- dragEl = target;
8692
- parentEl = dragEl.parentNode;
8693
- nextEl = dragEl.nextSibling;
8694
- lastDownEl = target;
8695
- activeGroup = options.group;
8696
- Sortable.dragged = dragEl;
8697
- tapEvt = {
8698
- target: dragEl,
8699
- clientX: (touch || evt).clientX,
8700
- clientY: (touch || evt).clientY
8701
- };
8702
- tapDistanceLeft = tapEvt.clientX - dragRect.left;
8703
- tapDistanceTop = tapEvt.clientY - dragRect.top;
8704
- this._lastX = (touch || evt).clientX;
8705
- this._lastY = (touch || evt).clientY;
8706
- dragEl.style['will-change'] = 'all';
8707
- dragStartFn = function dragStartFn() {
8708
- pluginEvent('delayEnded', _this, {
8709
- evt: evt
8710
- });
8711
- if (Sortable.eventCanceled) {
8712
- _this._onDrop();
8713
- return;
8714
- }
8715
- // Delayed drag has been triggered
8716
- // we can re-enable the events: touchmove/mousemove
8717
- _this._disableDelayedDragEvents();
8718
- if (!FireFox && _this.nativeDraggable) {
8719
- dragEl.draggable = true;
8720
- }
8721
-
8722
- // Bind the events: dragstart/dragend
8723
- _this._triggerDragStart(evt, touch);
8724
-
8725
- // Drag start event
8726
- _dispatchEvent({
8727
- sortable: _this,
8728
- name: 'choose',
8729
- originalEvent: evt
8730
- });
8731
-
8732
- // Chosen item
8733
- toggleClass(dragEl, options.chosenClass, true);
8734
- };
8735
-
8736
- // Disable "draggable"
8737
- options.ignore.split(',').forEach(function (criteria) {
8738
- find(dragEl, criteria.trim(), _disableDraggable);
8739
- });
8740
- on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
8741
- on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
8742
- on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
8743
- if (options.supportPointer) {
8744
- on(ownerDocument, 'pointerup', _this._onDrop);
8745
- // Native D&D triggers pointercancel
8746
- !this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);
8747
- } else {
8748
- on(ownerDocument, 'mouseup', _this._onDrop);
8749
- on(ownerDocument, 'touchend', _this._onDrop);
8750
- on(ownerDocument, 'touchcancel', _this._onDrop);
8751
- }
8752
-
8753
- // Make dragEl draggable (must be before delay for FireFox)
8754
- if (FireFox && this.nativeDraggable) {
8755
- this.options.touchStartThreshold = 4;
8756
- dragEl.draggable = true;
8757
- }
8758
- pluginEvent('delayStart', this, {
8759
- evt: evt
8760
- });
8761
-
8762
- // Delay is impossible for native DnD in Edge or IE
8763
- if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
8764
- if (Sortable.eventCanceled) {
8765
- this._onDrop();
8766
- return;
8767
- }
8768
- // If the user moves the pointer or let go the click or touch
8769
- // before the delay has been reached:
8770
- // disable the delayed drag
8771
- if (options.supportPointer) {
8772
- on(ownerDocument, 'pointerup', _this._disableDelayedDrag);
8773
- on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);
8774
- } else {
8775
- on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
8776
- on(ownerDocument, 'touchend', _this._disableDelayedDrag);
8777
- on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
8778
- }
8779
- on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
8780
- on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
8781
- options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
8782
- _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
8783
- } else {
8784
- dragStartFn();
8785
- }
8786
- }
8787
- },
8788
- _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
8789
- var touch = e.touches ? e.touches[0] : e;
8790
- if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
8791
- this._disableDelayedDrag();
8792
- }
8793
- },
8794
- _disableDelayedDrag: function _disableDelayedDrag() {
8795
- dragEl && _disableDraggable(dragEl);
8796
- clearTimeout(this._dragStartTimer);
8797
- this._disableDelayedDragEvents();
8798
- },
8799
- _disableDelayedDragEvents: function _disableDelayedDragEvents() {
8800
- var ownerDocument = this.el.ownerDocument;
8801
- off(ownerDocument, 'mouseup', this._disableDelayedDrag);
8802
- off(ownerDocument, 'touchend', this._disableDelayedDrag);
8803
- off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
8804
- off(ownerDocument, 'pointerup', this._disableDelayedDrag);
8805
- off(ownerDocument, 'pointercancel', this._disableDelayedDrag);
8806
- off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
8807
- off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
8808
- off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
8809
- },
8810
- _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
8811
- touch = touch || evt.pointerType == 'touch' && evt;
8812
- if (!this.nativeDraggable || touch) {
8813
- if (this.options.supportPointer) {
8814
- on(document, 'pointermove', this._onTouchMove);
8815
- } else if (touch) {
8816
- on(document, 'touchmove', this._onTouchMove);
8817
- } else {
8818
- on(document, 'mousemove', this._onTouchMove);
8819
- }
8820
- } else {
8821
- on(dragEl, 'dragend', this);
8822
- on(rootEl, 'dragstart', this._onDragStart);
8823
- }
8824
- try {
8825
- if (document.selection) {
8826
- _nextTick(function () {
8827
- document.selection.empty();
8828
- });
8829
- } else {
8830
- window.getSelection().removeAllRanges();
8831
- }
8832
- } catch (err) {}
8833
- },
8834
- _dragStarted: function _dragStarted(fallback, evt) {
8835
- awaitingDragStarted = false;
8836
- if (rootEl && dragEl) {
8837
- pluginEvent('dragStarted', this, {
8838
- evt: evt
8839
- });
8840
- if (this.nativeDraggable) {
8841
- on(document, 'dragover', _checkOutsideTargetEl);
8842
- }
8843
- var options = this.options;
8844
-
8845
- // Apply effect
8846
- !fallback && toggleClass(dragEl, options.dragClass, false);
8847
- toggleClass(dragEl, options.ghostClass, true);
8848
- Sortable.active = this;
8849
- fallback && this._appendGhost();
8850
-
8851
- // Drag start event
8852
- _dispatchEvent({
8853
- sortable: this,
8854
- name: 'start',
8855
- originalEvent: evt
8856
- });
8857
- } else {
8858
- this._nulling();
8859
- }
8860
- },
8861
- _emulateDragOver: function _emulateDragOver() {
8862
- if (touchEvt) {
8863
- this._lastX = touchEvt.clientX;
8864
- this._lastY = touchEvt.clientY;
8865
- _hideGhostForTarget();
8866
- var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
8867
- var parent = target;
8868
- while (target && target.shadowRoot) {
8869
- target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
8870
- if (target === parent) break;
8871
- parent = target;
8872
- }
8873
- dragEl.parentNode[expando]._isOutsideThisEl(target);
8874
- if (parent) {
8875
- do {
8876
- if (parent[expando]) {
8877
- var inserted = void 0;
8878
- inserted = parent[expando]._onDragOver({
8879
- clientX: touchEvt.clientX,
8880
- clientY: touchEvt.clientY,
8881
- target: target,
8882
- rootEl: parent
8883
- });
8884
- if (inserted && !this.options.dragoverBubble) {
8885
- break;
8886
- }
8887
- }
8888
- target = parent; // store last element
8889
- }
8890
- /* jshint boss:true */ while (parent = getParentOrHost(parent));
8891
- }
8892
- _unhideGhostForTarget();
8893
- }
8894
- },
8895
- _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
8896
- if (tapEvt) {
8897
- var options = this.options,
8898
- fallbackTolerance = options.fallbackTolerance,
8899
- fallbackOffset = options.fallbackOffset,
8900
- touch = evt.touches ? evt.touches[0] : evt,
8901
- ghostMatrix = ghostEl && matrix(ghostEl, true),
8902
- scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
8903
- scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
8904
- relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
8905
- dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
8906
- dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
8907
-
8908
- // only set the status to dragging, when we are actually dragging
8909
- if (!Sortable.active && !awaitingDragStarted) {
8910
- if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
8911
- return;
8912
- }
8913
- this._onDragStart(evt, true);
8914
- }
8915
- if (ghostEl) {
8916
- if (ghostMatrix) {
8917
- ghostMatrix.e += dx - (lastDx || 0);
8918
- ghostMatrix.f += dy - (lastDy || 0);
8919
- } else {
8920
- ghostMatrix = {
8921
- a: 1,
8922
- b: 0,
8923
- c: 0,
8924
- d: 1,
8925
- e: dx,
8926
- f: dy
8927
- };
8928
- }
8929
- var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
8930
- css(ghostEl, 'webkitTransform', cssMatrix);
8931
- css(ghostEl, 'mozTransform', cssMatrix);
8932
- css(ghostEl, 'msTransform', cssMatrix);
8933
- css(ghostEl, 'transform', cssMatrix);
8934
- lastDx = dx;
8935
- lastDy = dy;
8936
- touchEvt = touch;
8937
- }
8938
- evt.cancelable && evt.preventDefault();
8939
- }
8940
- },
8941
- _appendGhost: function _appendGhost() {
8942
- // Bug if using scale(): https://stackoverflow.com/questions/2637058
8943
- // Not being adjusted for
8944
- if (!ghostEl) {
8945
- var container = this.options.fallbackOnBody ? document.body : rootEl,
8946
- rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
8947
- options = this.options;
8948
-
8949
- // Position absolutely
8950
- if (PositionGhostAbsolutely) {
8951
- // Get relatively positioned parent
8952
- ghostRelativeParent = container;
8953
- while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
8954
- ghostRelativeParent = ghostRelativeParent.parentNode;
8955
- }
8956
- if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
8957
- if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
8958
- rect.top += ghostRelativeParent.scrollTop;
8959
- rect.left += ghostRelativeParent.scrollLeft;
8960
- } else {
8961
- ghostRelativeParent = getWindowScrollingElement();
8962
- }
8963
- ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
8964
- }
8965
- ghostEl = dragEl.cloneNode(true);
8966
- toggleClass(ghostEl, options.ghostClass, false);
8967
- toggleClass(ghostEl, options.fallbackClass, true);
8968
- toggleClass(ghostEl, options.dragClass, true);
8969
- css(ghostEl, 'transition', '');
8970
- css(ghostEl, 'transform', '');
8971
- css(ghostEl, 'box-sizing', 'border-box');
8972
- css(ghostEl, 'margin', 0);
8973
- css(ghostEl, 'top', rect.top);
8974
- css(ghostEl, 'left', rect.left);
8975
- css(ghostEl, 'width', rect.width);
8976
- css(ghostEl, 'height', rect.height);
8977
- css(ghostEl, 'opacity', '0.8');
8978
- css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
8979
- css(ghostEl, 'zIndex', '100000');
8980
- css(ghostEl, 'pointerEvents', 'none');
8981
- Sortable.ghost = ghostEl;
8982
- container.appendChild(ghostEl);
8983
-
8984
- // Set transform-origin
8985
- css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
8986
- }
8987
- },
8988
- _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
8989
- var _this = this;
8990
- var dataTransfer = evt.dataTransfer;
8991
- var options = _this.options;
8992
- pluginEvent('dragStart', this, {
8993
- evt: evt
8994
- });
8995
- if (Sortable.eventCanceled) {
8996
- this._onDrop();
8997
- return;
8998
- }
8999
- pluginEvent('setupClone', this);
9000
- if (!Sortable.eventCanceled) {
9001
- cloneEl = clone(dragEl);
9002
- cloneEl.removeAttribute("id");
9003
- cloneEl.draggable = false;
9004
- cloneEl.style['will-change'] = '';
9005
- this._hideClone();
9006
- toggleClass(cloneEl, this.options.chosenClass, false);
9007
- Sortable.clone = cloneEl;
9008
- }
9009
-
9010
- // #1143: IFrame support workaround
9011
- _this.cloneId = _nextTick(function () {
9012
- pluginEvent('clone', _this);
9013
- if (Sortable.eventCanceled) return;
9014
- if (!_this.options.removeCloneOnHide) {
9015
- rootEl.insertBefore(cloneEl, dragEl);
9016
- }
9017
- _this._hideClone();
9018
- _dispatchEvent({
9019
- sortable: _this,
9020
- name: 'clone'
9021
- });
9022
- });
9023
- !fallback && toggleClass(dragEl, options.dragClass, true);
9024
-
9025
- // Set proper drop events
9026
- if (fallback) {
9027
- ignoreNextClick = true;
9028
- _this._loopId = setInterval(_this._emulateDragOver, 50);
9029
- } else {
9030
- // Undo what was set in _prepareDragStart before drag started
9031
- off(document, 'mouseup', _this._onDrop);
9032
- off(document, 'touchend', _this._onDrop);
9033
- off(document, 'touchcancel', _this._onDrop);
9034
- if (dataTransfer) {
9035
- dataTransfer.effectAllowed = 'move';
9036
- options.setData && options.setData.call(_this, dataTransfer, dragEl);
9037
- }
9038
- on(document, 'drop', _this);
9039
-
9040
- // #1276 fix:
9041
- css(dragEl, 'transform', 'translateZ(0)');
9042
- }
9043
- awaitingDragStarted = true;
9044
- _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
9045
- on(document, 'selectstart', _this);
9046
- moved = true;
9047
- window.getSelection().removeAllRanges();
9048
- if (Safari) {
9049
- css(document.body, 'user-select', 'none');
9050
- }
9051
- },
9052
- // Returns true - if no further action is needed (either inserted or another condition)
9053
- _onDragOver: function _onDragOver( /**Event*/evt) {
9054
- var el = this.el,
9055
- target = evt.target,
9056
- dragRect,
9057
- targetRect,
9058
- revert,
9059
- options = this.options,
9060
- group = options.group,
9061
- activeSortable = Sortable.active,
9062
- isOwner = activeGroup === group,
9063
- canSort = options.sort,
9064
- fromSortable = putSortable || activeSortable,
9065
- vertical,
9066
- _this = this,
9067
- completedFired = false;
9068
- if (_silent) return;
9069
- function dragOverEvent(name, extra) {
9070
- pluginEvent(name, _this, _objectSpread2({
9071
- evt: evt,
9072
- isOwner: isOwner,
9073
- axis: vertical ? 'vertical' : 'horizontal',
9074
- revert: revert,
9075
- dragRect: dragRect,
9076
- targetRect: targetRect,
9077
- canSort: canSort,
9078
- fromSortable: fromSortable,
9079
- target: target,
9080
- completed: completed,
9081
- onMove: function onMove(target, after) {
9082
- return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
9083
- },
9084
- changed: changed
9085
- }, extra));
9086
- }
9087
-
9088
- // Capture animation state
9089
- function capture() {
9090
- dragOverEvent('dragOverAnimationCapture');
9091
- _this.captureAnimationState();
9092
- if (_this !== fromSortable) {
9093
- fromSortable.captureAnimationState();
9094
- }
9095
- }
9096
-
9097
- // Return invocation when dragEl is inserted (or completed)
9098
- function completed(insertion) {
9099
- dragOverEvent('dragOverCompleted', {
9100
- insertion: insertion
9101
- });
9102
- if (insertion) {
9103
- // Clones must be hidden before folding animation to capture dragRectAbsolute properly
9104
- if (isOwner) {
9105
- activeSortable._hideClone();
9106
- } else {
9107
- activeSortable._showClone(_this);
9108
- }
9109
- if (_this !== fromSortable) {
9110
- // Set ghost class to new sortable's ghost class
9111
- toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
9112
- toggleClass(dragEl, options.ghostClass, true);
9113
- }
9114
- if (putSortable !== _this && _this !== Sortable.active) {
9115
- putSortable = _this;
9116
- } else if (_this === Sortable.active && putSortable) {
9117
- putSortable = null;
9118
- }
9119
-
9120
- // Animation
9121
- if (fromSortable === _this) {
9122
- _this._ignoreWhileAnimating = target;
9123
- }
9124
- _this.animateAll(function () {
9125
- dragOverEvent('dragOverAnimationComplete');
9126
- _this._ignoreWhileAnimating = null;
9127
- });
9128
- if (_this !== fromSortable) {
9129
- fromSortable.animateAll();
9130
- fromSortable._ignoreWhileAnimating = null;
9131
- }
9132
- }
9133
-
9134
- // Null lastTarget if it is not inside a previously swapped element
9135
- if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
9136
- lastTarget = null;
9137
- }
9138
-
9139
- // no bubbling and not fallback
9140
- if (!options.dragoverBubble && !evt.rootEl && target !== document) {
9141
- dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
9142
-
9143
- // Do not detect for empty insert if already inserted
9144
- !insertion && nearestEmptyInsertDetectEvent(evt);
9145
- }
9146
- !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
9147
- return completedFired = true;
9148
- }
9149
-
9150
- // Call when dragEl has been inserted
9151
- function changed() {
9152
- newIndex = index$1(dragEl);
9153
- newDraggableIndex = index$1(dragEl, options.draggable);
9154
- _dispatchEvent({
9155
- sortable: _this,
9156
- name: 'change',
9157
- toEl: el,
9158
- newIndex: newIndex,
9159
- newDraggableIndex: newDraggableIndex,
9160
- originalEvent: evt
9161
- });
9162
- }
9163
- if (evt.preventDefault !== void 0) {
9164
- evt.cancelable && evt.preventDefault();
9165
- }
9166
- target = closest(target, options.draggable, el, true);
9167
- dragOverEvent('dragOver');
9168
- if (Sortable.eventCanceled) return completedFired;
9169
- if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
9170
- return completed(false);
9171
- }
9172
- ignoreNextClick = false;
9173
- if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
9174
- : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
9175
- vertical = this._getDirection(evt, target) === 'vertical';
9176
- dragRect = getRect(dragEl);
9177
- dragOverEvent('dragOverValid');
9178
- if (Sortable.eventCanceled) return completedFired;
9179
- if (revert) {
9180
- parentEl = rootEl; // actualization
9181
- capture();
9182
- this._hideClone();
9183
- dragOverEvent('revert');
9184
- if (!Sortable.eventCanceled) {
9185
- if (nextEl) {
9186
- rootEl.insertBefore(dragEl, nextEl);
9187
- } else {
9188
- rootEl.appendChild(dragEl);
9189
- }
9190
- }
9191
- return completed(true);
9192
- }
9193
- var elLastChild = lastChild(el, options.draggable);
9194
- if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
9195
- // Insert to end of list
9196
-
9197
- // If already at end of list: Do not insert
9198
- if (elLastChild === dragEl) {
9199
- return completed(false);
9200
- }
9201
-
9202
- // if there is a last element, it is the target
9203
- if (elLastChild && el === evt.target) {
9204
- target = elLastChild;
9205
- }
9206
- if (target) {
9207
- targetRect = getRect(target);
9208
- }
9209
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
9210
- capture();
9211
- if (elLastChild && elLastChild.nextSibling) {
9212
- // the last draggable element is not the last node
9213
- el.insertBefore(dragEl, elLastChild.nextSibling);
9214
- } else {
9215
- el.appendChild(dragEl);
9216
- }
9217
- parentEl = el; // actualization
9218
-
9219
- changed();
9220
- return completed(true);
9221
- }
9222
- } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
9223
- // Insert to start of list
9224
- var firstChild = getChild(el, 0, options, true);
9225
- if (firstChild === dragEl) {
9226
- return completed(false);
9227
- }
9228
- target = firstChild;
9229
- targetRect = getRect(target);
9230
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
9231
- capture();
9232
- el.insertBefore(dragEl, firstChild);
9233
- parentEl = el; // actualization
9234
-
9235
- changed();
9236
- return completed(true);
9237
- }
9238
- } else if (target.parentNode === el) {
9239
- targetRect = getRect(target);
9240
- var direction = 0,
9241
- targetBeforeFirstSwap,
9242
- differentLevel = dragEl.parentNode !== el,
9243
- differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
9244
- side1 = vertical ? 'top' : 'left',
9245
- scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
9246
- scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
9247
- if (lastTarget !== target) {
9248
- targetBeforeFirstSwap = targetRect[side1];
9249
- pastFirstInvertThresh = false;
9250
- isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
9251
- }
9252
- direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
9253
- var sibling;
9254
- if (direction !== 0) {
9255
- // Check if target is beside dragEl in respective direction (ignoring hidden elements)
9256
- var dragIndex = index$1(dragEl);
9257
- do {
9258
- dragIndex -= direction;
9259
- sibling = parentEl.children[dragIndex];
9260
- } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
9261
- }
9262
- // If dragEl is already beside target: Do not insert
9263
- if (direction === 0 || sibling === target) {
9264
- return completed(false);
9265
- }
9266
- lastTarget = target;
9267
- lastDirection = direction;
9268
- var nextSibling = target.nextElementSibling,
9269
- after = false;
9270
- after = direction === 1;
9271
- var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
9272
- if (moveVector !== false) {
9273
- if (moveVector === 1 || moveVector === -1) {
9274
- after = moveVector === 1;
9275
- }
9276
- _silent = true;
9277
- setTimeout(_unsilent, 30);
9278
- capture();
9279
- if (after && !nextSibling) {
9280
- el.appendChild(dragEl);
9281
- } else {
9282
- target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
9283
- }
9284
-
9285
- // Undo chrome's scroll adjustment (has no effect on other browsers)
9286
- if (scrolledPastTop) {
9287
- scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
9288
- }
9289
- parentEl = dragEl.parentNode; // actualization
9290
-
9291
- // must be done before animation
9292
- if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
9293
- targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
9294
- }
9295
- changed();
9296
- return completed(true);
9297
- }
9298
- }
9299
- if (el.contains(dragEl)) {
9300
- return completed(false);
9301
- }
9302
- }
9303
- return false;
9304
- },
9305
- _ignoreWhileAnimating: null,
9306
- _offMoveEvents: function _offMoveEvents() {
9307
- off(document, 'mousemove', this._onTouchMove);
9308
- off(document, 'touchmove', this._onTouchMove);
9309
- off(document, 'pointermove', this._onTouchMove);
9310
- off(document, 'dragover', nearestEmptyInsertDetectEvent);
9311
- off(document, 'mousemove', nearestEmptyInsertDetectEvent);
9312
- off(document, 'touchmove', nearestEmptyInsertDetectEvent);
9313
- },
9314
- _offUpEvents: function _offUpEvents() {
9315
- var ownerDocument = this.el.ownerDocument;
9316
- off(ownerDocument, 'mouseup', this._onDrop);
9317
- off(ownerDocument, 'touchend', this._onDrop);
9318
- off(ownerDocument, 'pointerup', this._onDrop);
9319
- off(ownerDocument, 'pointercancel', this._onDrop);
9320
- off(ownerDocument, 'touchcancel', this._onDrop);
9321
- off(document, 'selectstart', this);
9322
- },
9323
- _onDrop: function _onDrop( /**Event*/evt) {
9324
- var el = this.el,
9325
- options = this.options;
9326
-
9327
- // Get the index of the dragged element within its parent
9328
- newIndex = index$1(dragEl);
9329
- newDraggableIndex = index$1(dragEl, options.draggable);
9330
- pluginEvent('drop', this, {
9331
- evt: evt
9332
- });
9333
- parentEl = dragEl && dragEl.parentNode;
9334
-
9335
- // Get again after plugin event
9336
- newIndex = index$1(dragEl);
9337
- newDraggableIndex = index$1(dragEl, options.draggable);
9338
- if (Sortable.eventCanceled) {
9339
- this._nulling();
9340
- return;
9341
- }
9342
- awaitingDragStarted = false;
9343
- isCircumstantialInvert = false;
9344
- pastFirstInvertThresh = false;
9345
- clearInterval(this._loopId);
9346
- clearTimeout(this._dragStartTimer);
9347
- _cancelNextTick(this.cloneId);
9348
- _cancelNextTick(this._dragStartId);
9349
-
9350
- // Unbind events
9351
- if (this.nativeDraggable) {
9352
- off(document, 'drop', this);
9353
- off(el, 'dragstart', this._onDragStart);
9354
- }
9355
- this._offMoveEvents();
9356
- this._offUpEvents();
9357
- if (Safari) {
9358
- css(document.body, 'user-select', '');
9359
- }
9360
- css(dragEl, 'transform', '');
9361
- if (evt) {
9362
- if (moved) {
9363
- evt.cancelable && evt.preventDefault();
9364
- !options.dropBubble && evt.stopPropagation();
9365
- }
9366
- ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
9367
- if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
9368
- // Remove clone(s)
9369
- cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
9370
- }
9371
- if (dragEl) {
9372
- if (this.nativeDraggable) {
9373
- off(dragEl, 'dragend', this);
9374
- }
9375
- _disableDraggable(dragEl);
9376
- dragEl.style['will-change'] = '';
9377
-
9378
- // Remove classes
9379
- // ghostClass is added in dragStarted
9380
- if (moved && !awaitingDragStarted) {
9381
- toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
9382
- }
9383
- toggleClass(dragEl, this.options.chosenClass, false);
9384
-
9385
- // Drag stop event
9386
- _dispatchEvent({
9387
- sortable: this,
9388
- name: 'unchoose',
9389
- toEl: parentEl,
9390
- newIndex: null,
9391
- newDraggableIndex: null,
9392
- originalEvent: evt
9393
- });
9394
- if (rootEl !== parentEl) {
9395
- if (newIndex >= 0) {
9396
- // Add event
9397
- _dispatchEvent({
9398
- rootEl: parentEl,
9399
- name: 'add',
9400
- toEl: parentEl,
9401
- fromEl: rootEl,
9402
- originalEvent: evt
9403
- });
9404
-
9405
- // Remove event
9406
- _dispatchEvent({
9407
- sortable: this,
9408
- name: 'remove',
9409
- toEl: parentEl,
9410
- originalEvent: evt
9411
- });
9412
-
9413
- // drag from one list and drop into another
9414
- _dispatchEvent({
9415
- rootEl: parentEl,
9416
- name: 'sort',
9417
- toEl: parentEl,
9418
- fromEl: rootEl,
9419
- originalEvent: evt
9420
- });
9421
- _dispatchEvent({
9422
- sortable: this,
9423
- name: 'sort',
9424
- toEl: parentEl,
9425
- originalEvent: evt
9426
- });
9427
- }
9428
- putSortable && putSortable.save();
9429
- } else {
9430
- if (newIndex !== oldIndex) {
9431
- if (newIndex >= 0) {
9432
- // drag & drop within the same list
9433
- _dispatchEvent({
9434
- sortable: this,
9435
- name: 'update',
9436
- toEl: parentEl,
9437
- originalEvent: evt
9438
- });
9439
- _dispatchEvent({
9440
- sortable: this,
9441
- name: 'sort',
9442
- toEl: parentEl,
9443
- originalEvent: evt
9444
- });
9445
- }
9446
- }
9447
- }
9448
- if (Sortable.active) {
9449
- /* jshint eqnull:true */
9450
- if (newIndex == null || newIndex === -1) {
9451
- newIndex = oldIndex;
9452
- newDraggableIndex = oldDraggableIndex;
9453
- }
9454
- _dispatchEvent({
9455
- sortable: this,
9456
- name: 'end',
9457
- toEl: parentEl,
9458
- originalEvent: evt
9459
- });
9460
-
9461
- // Save sorting
9462
- this.save();
9463
- }
9464
- }
9465
- }
9466
- this._nulling();
9467
- },
9468
- _nulling: function _nulling() {
9469
- pluginEvent('nulling', this);
9470
- rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
9471
- var el = this.el;
9472
- savedInputChecked.forEach(function (checkEl) {
9473
- if (el.contains(checkEl)) {
9474
- checkEl.checked = true;
9475
- }
9476
- });
9477
- savedInputChecked.length = lastDx = lastDy = 0;
9478
- },
9479
- handleEvent: function handleEvent( /**Event*/evt) {
9480
- switch (evt.type) {
9481
- case 'drop':
9482
- case 'dragend':
9483
- this._onDrop(evt);
9484
- break;
9485
- case 'dragenter':
9486
- case 'dragover':
9487
- if (dragEl) {
9488
- this._onDragOver(evt);
9489
- _globalDragOver(evt);
9490
- }
9491
- break;
9492
- case 'selectstart':
9493
- evt.preventDefault();
9494
- break;
9495
- }
9496
- },
9497
- /**
9498
- * Serializes the item into an array of string.
9499
- * @returns {String[]}
9500
- */
9501
- toArray: function toArray() {
9502
- var order = [],
9503
- el,
9504
- children = this.el.children,
9505
- i = 0,
9506
- n = children.length,
9507
- options = this.options;
9508
- for (; i < n; i++) {
9509
- el = children[i];
9510
- if (closest(el, options.draggable, this.el, false)) {
9511
- order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
9512
- }
9513
- }
9514
- return order;
9515
- },
9516
- /**
9517
- * Sorts the elements according to the array.
9518
- * @param {String[]} order order of the items
9519
- */
9520
- sort: function sort(order, useAnimation) {
9521
- var items = {},
9522
- rootEl = this.el;
9523
- this.toArray().forEach(function (id, i) {
9524
- var el = rootEl.children[i];
9525
- if (closest(el, this.options.draggable, rootEl, false)) {
9526
- items[id] = el;
9527
- }
9528
- }, this);
9529
- useAnimation && this.captureAnimationState();
9530
- order.forEach(function (id) {
9531
- if (items[id]) {
9532
- rootEl.removeChild(items[id]);
9533
- rootEl.appendChild(items[id]);
9534
- }
9535
- });
9536
- useAnimation && this.animateAll();
9537
- },
9538
- /**
9539
- * Save the current sorting
9540
- */
9541
- save: function save() {
9542
- var store = this.options.store;
9543
- store && store.set && store.set(this);
9544
- },
9545
- /**
9546
- * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
9547
- * @param {HTMLElement} el
9548
- * @param {String} [selector] default: `options.draggable`
9549
- * @returns {HTMLElement|null}
9550
- */
9551
- closest: function closest$1(el, selector) {
9552
- return closest(el, selector || this.options.draggable, this.el, false);
9553
- },
9554
- /**
9555
- * Set/get option
9556
- * @param {string} name
9557
- * @param {*} [value]
9558
- * @returns {*}
9559
- */
9560
- option: function option(name, value) {
9561
- var options = this.options;
9562
- if (value === void 0) {
9563
- return options[name];
9564
- } else {
9565
- var modifiedValue = PluginManager.modifyOption(this, name, value);
9566
- if (typeof modifiedValue !== 'undefined') {
9567
- options[name] = modifiedValue;
9568
- } else {
9569
- options[name] = value;
9570
- }
9571
- if (name === 'group') {
9572
- _prepareGroup(options);
9573
- }
9574
- }
9575
- },
9576
- /**
9577
- * Destroy
9578
- */
9579
- destroy: function destroy() {
9580
- pluginEvent('destroy', this);
9581
- var el = this.el;
9582
- el[expando] = null;
9583
- off(el, 'mousedown', this._onTapStart);
9584
- off(el, 'touchstart', this._onTapStart);
9585
- off(el, 'pointerdown', this._onTapStart);
9586
- if (this.nativeDraggable) {
9587
- off(el, 'dragover', this);
9588
- off(el, 'dragenter', this);
9589
- }
9590
- // Remove draggable attributes
9591
- Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
9592
- el.removeAttribute('draggable');
9593
- });
9594
- this._onDrop();
9595
- this._disableDelayedDragEvents();
9596
- sortables.splice(sortables.indexOf(this.el), 1);
9597
- this.el = el = null;
9598
- },
9599
- _hideClone: function _hideClone() {
9600
- if (!cloneHidden) {
9601
- pluginEvent('hideClone', this);
9602
- if (Sortable.eventCanceled) return;
9603
- css(cloneEl, 'display', 'none');
9604
- if (this.options.removeCloneOnHide && cloneEl.parentNode) {
9605
- cloneEl.parentNode.removeChild(cloneEl);
9606
- }
9607
- cloneHidden = true;
9608
- }
9609
- },
9610
- _showClone: function _showClone(putSortable) {
9611
- if (putSortable.lastPutMode !== 'clone') {
9612
- this._hideClone();
9613
- return;
9614
- }
9615
- if (cloneHidden) {
9616
- pluginEvent('showClone', this);
9617
- if (Sortable.eventCanceled) return;
9618
-
9619
- // show clone at dragEl or original position
9620
- if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
9621
- rootEl.insertBefore(cloneEl, dragEl);
9622
- } else if (nextEl) {
9623
- rootEl.insertBefore(cloneEl, nextEl);
9624
- } else {
9625
- rootEl.appendChild(cloneEl);
9626
- }
9627
- if (this.options.group.revertClone) {
9628
- this.animate(dragEl, cloneEl);
9629
- }
9630
- css(cloneEl, 'display', '');
9631
- cloneHidden = false;
9632
- }
9633
- }
9634
- };
9635
- function _globalDragOver( /**Event*/evt) {
9636
- if (evt.dataTransfer) {
9637
- evt.dataTransfer.dropEffect = 'move';
9638
- }
9639
- evt.cancelable && evt.preventDefault();
9640
- }
9641
- function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
9642
- var evt,
9643
- sortable = fromEl[expando],
9644
- onMoveFn = sortable.options.onMove,
9645
- retVal;
9646
- // Support for new CustomEvent feature
9647
- if (window.CustomEvent && !IE11OrLess && !Edge) {
9648
- evt = new CustomEvent('move', {
9649
- bubbles: true,
9650
- cancelable: true
9651
- });
9652
- } else {
9653
- evt = document.createEvent('Event');
9654
- evt.initEvent('move', true, true);
9655
- }
9656
- evt.to = toEl;
9657
- evt.from = fromEl;
9658
- evt.dragged = dragEl;
9659
- evt.draggedRect = dragRect;
9660
- evt.related = targetEl || toEl;
9661
- evt.relatedRect = targetRect || getRect(toEl);
9662
- evt.willInsertAfter = willInsertAfter;
9663
- evt.originalEvent = originalEvent;
9664
- fromEl.dispatchEvent(evt);
9665
- if (onMoveFn) {
9666
- retVal = onMoveFn.call(sortable, evt, originalEvent);
9667
- }
9668
- return retVal;
9669
- }
9670
- function _disableDraggable(el) {
9671
- el.draggable = false;
9672
- }
9673
- function _unsilent() {
9674
- _silent = false;
9675
- }
9676
- function _ghostIsFirst(evt, vertical, sortable) {
9677
- var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
9678
- var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
9679
- var spacer = 10;
9680
- return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
9681
- }
9682
- function _ghostIsLast(evt, vertical, sortable) {
9683
- var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
9684
- var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
9685
- var spacer = 10;
9686
- return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
9687
- }
9688
- function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
9689
- var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
9690
- targetLength = vertical ? targetRect.height : targetRect.width,
9691
- targetS1 = vertical ? targetRect.top : targetRect.left,
9692
- targetS2 = vertical ? targetRect.bottom : targetRect.right,
9693
- invert = false;
9694
- if (!invertSwap) {
9695
- // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
9696
- if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
9697
- // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
9698
- // check if past first invert threshold on side opposite of lastDirection
9699
- if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
9700
- // past first invert threshold, do not restrict inverted threshold to dragEl shadow
9701
- pastFirstInvertThresh = true;
9702
- }
9703
- if (!pastFirstInvertThresh) {
9704
- // dragEl shadow (target move distance shadow)
9705
- if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
9706
- : mouseOnAxis > targetS2 - targetMoveDistance) {
9707
- return -lastDirection;
9708
- }
9709
- } else {
9710
- invert = true;
9711
- }
9712
- } else {
9713
- // Regular
9714
- if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
9715
- return _getInsertDirection(target);
9716
- }
9717
- }
9718
- }
9719
- invert = invert || invertSwap;
9720
- if (invert) {
9721
- // Invert of regular
9722
- if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
9723
- return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
9724
- }
9725
- }
9726
- return 0;
9727
- }
9728
-
9729
- /**
9730
- * Gets the direction dragEl must be swapped relative to target in order to make it
9731
- * seem that dragEl has been "inserted" into that element's position
9732
- * @param {HTMLElement} target The target whose position dragEl is being inserted at
9733
- * @return {Number} Direction dragEl must be swapped
9734
- */
9735
- function _getInsertDirection(target) {
9736
- if (index$1(dragEl) < index$1(target)) {
9737
- return 1;
9738
- } else {
9739
- return -1;
9740
- }
9741
- }
9742
-
9743
- /**
9744
- * Generate id
9745
- * @param {HTMLElement} el
9746
- * @returns {String}
9747
- * @private
9748
- */
9749
- function _generateId(el) {
9750
- var str = el.tagName + el.className + el.src + el.href + el.textContent,
9751
- i = str.length,
9752
- sum = 0;
9753
- while (i--) {
9754
- sum += str.charCodeAt(i);
9755
- }
9756
- return sum.toString(36);
9757
- }
9758
- function _saveInputCheckedState(root) {
9759
- savedInputChecked.length = 0;
9760
- var inputs = root.getElementsByTagName('input');
9761
- var idx = inputs.length;
9762
- while (idx--) {
9763
- var el = inputs[idx];
9764
- el.checked && savedInputChecked.push(el);
9765
- }
9766
- }
9767
- function _nextTick(fn) {
9768
- return setTimeout(fn, 0);
9769
- }
9770
- function _cancelNextTick(id) {
9771
- return clearTimeout(id);
9772
- }
9773
-
9774
- // Fixed #973:
9775
- if (documentExists) {
9776
- on(document, 'touchmove', function (evt) {
9777
- if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
9778
- evt.preventDefault();
9779
- }
9780
- });
9781
- }
9782
-
9783
- // Export utils
9784
- Sortable.utils = {
9785
- on: on,
9786
- off: off,
9787
- css: css,
9788
- find: find,
9789
- is: function is(el, selector) {
9790
- return !!closest(el, selector, el, false);
9791
- },
9792
- extend: extend,
9793
- throttle: throttle,
9794
- closest: closest,
9795
- toggleClass: toggleClass,
9796
- clone: clone,
9797
- index: index$1,
9798
- nextTick: _nextTick,
9799
- cancelNextTick: _cancelNextTick,
9800
- detectDirection: _detectDirection,
9801
- getChild: getChild,
9802
- expando: expando
9803
- };
9804
-
9805
- /**
9806
- * Get the Sortable instance of an element
9807
- * @param {HTMLElement} element The element
9808
- * @return {Sortable|undefined} The instance of Sortable
9809
- */
9810
- Sortable.get = function (element) {
9811
- return element[expando];
9812
- };
9813
-
9814
- /**
9815
- * Mount a plugin to Sortable
9816
- * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
9817
- */
9818
- Sortable.mount = function () {
9819
- for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
9820
- plugins[_key] = arguments[_key];
9821
- }
9822
- if (plugins[0].constructor === Array) plugins = plugins[0];
9823
- plugins.forEach(function (plugin) {
9824
- if (!plugin.prototype || !plugin.prototype.constructor) {
9825
- throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
9826
- }
9827
- if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
9828
- PluginManager.mount(plugin);
9829
- });
9830
- };
9831
-
9832
- /**
9833
- * Create sortable instance
9834
- * @param {HTMLElement} el
9835
- * @param {Object} [options]
9836
- */
9837
- Sortable.create = function (el, options) {
9838
- return new Sortable(el, options);
9839
- };
9840
-
9841
- // Export
9842
- Sortable.version = version;
9843
-
9844
- var autoScrolls = [],
9845
- scrollEl,
9846
- scrollRootEl,
9847
- scrolling = false,
9848
- lastAutoScrollX,
9849
- lastAutoScrollY,
9850
- touchEvt$1,
9851
- pointerElemChangedInterval;
9852
- function AutoScrollPlugin() {
9853
- function AutoScroll() {
9854
- this.defaults = {
9855
- scroll: true,
9856
- forceAutoScrollFallback: false,
9857
- scrollSensitivity: 30,
9858
- scrollSpeed: 10,
9859
- bubbleScroll: true
9860
- };
9861
-
9862
- // Bind all private methods
9863
- for (var fn in this) {
9864
- if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
9865
- this[fn] = this[fn].bind(this);
9866
- }
9867
- }
9868
- }
9869
- AutoScroll.prototype = {
9870
- dragStarted: function dragStarted(_ref) {
9871
- var originalEvent = _ref.originalEvent;
9872
- if (this.sortable.nativeDraggable) {
9873
- on(document, 'dragover', this._handleAutoScroll);
9874
- } else {
9875
- if (this.options.supportPointer) {
9876
- on(document, 'pointermove', this._handleFallbackAutoScroll);
9877
- } else if (originalEvent.touches) {
9878
- on(document, 'touchmove', this._handleFallbackAutoScroll);
9879
- } else {
9880
- on(document, 'mousemove', this._handleFallbackAutoScroll);
9881
- }
9882
- }
9883
- },
9884
- dragOverCompleted: function dragOverCompleted(_ref2) {
9885
- var originalEvent = _ref2.originalEvent;
9886
- // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
9887
- if (!this.options.dragOverBubble && !originalEvent.rootEl) {
9888
- this._handleAutoScroll(originalEvent);
9889
- }
9890
- },
9891
- drop: function drop() {
9892
- if (this.sortable.nativeDraggable) {
9893
- off(document, 'dragover', this._handleAutoScroll);
9894
- } else {
9895
- off(document, 'pointermove', this._handleFallbackAutoScroll);
9896
- off(document, 'touchmove', this._handleFallbackAutoScroll);
9897
- off(document, 'mousemove', this._handleFallbackAutoScroll);
9898
- }
9899
- clearPointerElemChangedInterval();
9900
- clearAutoScrolls();
9901
- cancelThrottle();
9902
- },
9903
- nulling: function nulling() {
9904
- touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
9905
- autoScrolls.length = 0;
9906
- },
9907
- _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
9908
- this._handleAutoScroll(evt, true);
9909
- },
9910
- _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
9911
- var _this = this;
9912
- var x = (evt.touches ? evt.touches[0] : evt).clientX,
9913
- y = (evt.touches ? evt.touches[0] : evt).clientY,
9914
- elem = document.elementFromPoint(x, y);
9915
- touchEvt$1 = evt;
9916
-
9917
- // IE does not seem to have native autoscroll,
9918
- // Edge's autoscroll seems too conditional,
9919
- // MACOS Safari does not have autoscroll,
9920
- // Firefox and Chrome are good
9921
- if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
9922
- autoScroll(evt, this.options, elem, fallback);
9923
-
9924
- // Listener for pointer element change
9925
- var ogElemScroller = getParentAutoScrollElement(elem, true);
9926
- if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
9927
- pointerElemChangedInterval && clearPointerElemChangedInterval();
9928
- // Detect for pointer elem change, emulating native DnD behaviour
9929
- pointerElemChangedInterval = setInterval(function () {
9930
- var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
9931
- if (newElem !== ogElemScroller) {
9932
- ogElemScroller = newElem;
9933
- clearAutoScrolls();
9934
- }
9935
- autoScroll(evt, _this.options, newElem, fallback);
9936
- }, 10);
9937
- lastAutoScrollX = x;
9938
- lastAutoScrollY = y;
9939
- }
9940
- } else {
9941
- // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
9942
- if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
9943
- clearAutoScrolls();
9944
- return;
9945
- }
9946
- autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
9947
- }
9948
- }
9949
- };
9950
- return _extends(AutoScroll, {
9951
- pluginName: 'scroll',
9952
- initializeByDefault: true
9953
- });
9954
- }
9955
- function clearAutoScrolls() {
9956
- autoScrolls.forEach(function (autoScroll) {
9957
- clearInterval(autoScroll.pid);
9958
- });
9959
- autoScrolls = [];
9960
- }
9961
- function clearPointerElemChangedInterval() {
9962
- clearInterval(pointerElemChangedInterval);
9963
- }
9964
- var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
9965
- // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
9966
- if (!options.scroll) return;
9967
- var x = (evt.touches ? evt.touches[0] : evt).clientX,
9968
- y = (evt.touches ? evt.touches[0] : evt).clientY,
9969
- sens = options.scrollSensitivity,
9970
- speed = options.scrollSpeed,
9971
- winScroller = getWindowScrollingElement();
9972
- var scrollThisInstance = false,
9973
- scrollCustomFn;
9974
-
9975
- // New scroll root, set scrollEl
9976
- if (scrollRootEl !== rootEl) {
9977
- scrollRootEl = rootEl;
9978
- clearAutoScrolls();
9979
- scrollEl = options.scroll;
9980
- scrollCustomFn = options.scrollFn;
9981
- if (scrollEl === true) {
9982
- scrollEl = getParentAutoScrollElement(rootEl, true);
9983
- }
9984
- }
9985
- var layersOut = 0;
9986
- var currentParent = scrollEl;
9987
- do {
9988
- var el = currentParent,
9989
- rect = getRect(el),
9990
- top = rect.top,
9991
- bottom = rect.bottom,
9992
- left = rect.left,
9993
- right = rect.right,
9994
- width = rect.width,
9995
- height = rect.height,
9996
- canScrollX = void 0,
9997
- canScrollY = void 0,
9998
- scrollWidth = el.scrollWidth,
9999
- scrollHeight = el.scrollHeight,
10000
- elCSS = css(el),
10001
- scrollPosX = el.scrollLeft,
10002
- scrollPosY = el.scrollTop;
10003
- if (el === winScroller) {
10004
- canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
10005
- canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
10006
- } else {
10007
- canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
10008
- canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
10009
- }
10010
- var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
10011
- var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
10012
- if (!autoScrolls[layersOut]) {
10013
- for (var i = 0; i <= layersOut; i++) {
10014
- if (!autoScrolls[i]) {
10015
- autoScrolls[i] = {};
10016
- }
10017
- }
10018
- }
10019
- if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
10020
- autoScrolls[layersOut].el = el;
10021
- autoScrolls[layersOut].vx = vx;
10022
- autoScrolls[layersOut].vy = vy;
10023
- clearInterval(autoScrolls[layersOut].pid);
10024
- if (vx != 0 || vy != 0) {
10025
- scrollThisInstance = true;
10026
- /* jshint loopfunc:true */
10027
- autoScrolls[layersOut].pid = setInterval(function () {
10028
- // emulate drag over during autoscroll (fallback), emulating native DnD behaviour
10029
- if (isFallback && this.layer === 0) {
10030
- Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
10031
- }
10032
- var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
10033
- var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
10034
- if (typeof scrollCustomFn === 'function') {
10035
- if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
10036
- return;
10037
- }
10038
- }
10039
- scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
10040
- }.bind({
10041
- layer: layersOut
10042
- }), 24);
10043
- }
10044
- }
10045
- layersOut++;
10046
- } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
10047
- scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
10048
- }, 30);
10049
-
10050
- var drop = function drop(_ref) {
10051
- var originalEvent = _ref.originalEvent,
10052
- putSortable = _ref.putSortable,
10053
- dragEl = _ref.dragEl,
10054
- activeSortable = _ref.activeSortable,
10055
- dispatchSortableEvent = _ref.dispatchSortableEvent,
10056
- hideGhostForTarget = _ref.hideGhostForTarget,
10057
- unhideGhostForTarget = _ref.unhideGhostForTarget;
10058
- if (!originalEvent) return;
10059
- var toSortable = putSortable || activeSortable;
10060
- hideGhostForTarget();
10061
- var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
10062
- var target = document.elementFromPoint(touch.clientX, touch.clientY);
10063
- unhideGhostForTarget();
10064
- if (toSortable && !toSortable.el.contains(target)) {
10065
- dispatchSortableEvent('spill');
10066
- this.onSpill({
10067
- dragEl: dragEl,
10068
- putSortable: putSortable
10069
- });
10070
- }
10071
- };
10072
- function Revert() {}
10073
- Revert.prototype = {
10074
- startIndex: null,
10075
- dragStart: function dragStart(_ref2) {
10076
- var oldDraggableIndex = _ref2.oldDraggableIndex;
10077
- this.startIndex = oldDraggableIndex;
10078
- },
10079
- onSpill: function onSpill(_ref3) {
10080
- var dragEl = _ref3.dragEl,
10081
- putSortable = _ref3.putSortable;
10082
- this.sortable.captureAnimationState();
10083
- if (putSortable) {
10084
- putSortable.captureAnimationState();
10085
- }
10086
- var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
10087
- if (nextSibling) {
10088
- this.sortable.el.insertBefore(dragEl, nextSibling);
10089
- } else {
10090
- this.sortable.el.appendChild(dragEl);
10091
- }
10092
- this.sortable.animateAll();
10093
- if (putSortable) {
10094
- putSortable.animateAll();
10095
- }
10096
- },
10097
- drop: drop
10098
- };
10099
- _extends(Revert, {
10100
- pluginName: 'revertOnSpill'
10101
- });
10102
- function Remove() {}
10103
- Remove.prototype = {
10104
- onSpill: function onSpill(_ref4) {
10105
- var dragEl = _ref4.dragEl,
10106
- putSortable = _ref4.putSortable;
10107
- var parentSortable = putSortable || this.sortable;
10108
- parentSortable.captureAnimationState();
10109
- dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
10110
- parentSortable.animateAll();
10111
- },
10112
- drop: drop
10113
- };
10114
- _extends(Remove, {
10115
- pluginName: 'removeOnSpill'
10116
- });
10117
-
10118
- Sortable.mount(new AutoScrollPlugin());
10119
- Sortable.mount(Remove, Revert);
10120
-
10121
7469
  var _hoisted_1$7 = {
10122
7470
  "class": "fy-transfer-wrap"
10123
7471
  };
@@ -10170,7 +7518,7 @@ var _hoisted_18 = {
10170
7518
  };
10171
7519
  var script$9 = {
10172
7520
  __name: 'transfer',
10173
- props: _objectSpread2$1(_objectSpread2$1({}, tmplProps), {}, {
7521
+ props: _objectSpread2(_objectSpread2({}, tmplProps), {}, {
10174
7522
  visibleTemplate: {
10175
7523
  type: Array,
10176
7524
  "default": function _default() {
@@ -10190,12 +7538,12 @@ var script$9 = {
10190
7538
  }, function () {
10191
7539
  if (props.template.length) {
10192
7540
  allTmpl.value = props.template.map(function (item) {
10193
- return _objectSpread2$1({}, item);
7541
+ return _objectSpread2({}, item);
10194
7542
  });
10195
7543
  visibleTmpl.value = props.template.filter(function (item) {
10196
7544
  return item.visible;
10197
7545
  }).map(function (item) {
10198
- return _objectSpread2$1({}, item);
7546
+ return _objectSpread2({}, item);
10199
7547
  });
10200
7548
  }
10201
7549
  }, {
@@ -10390,7 +7738,7 @@ script$9.__file = "packages/components/table/src/transfer.vue";
10390
7738
 
10391
7739
  var TableSetting = defineComponent({
10392
7740
  name: "TableSetting",
10393
- props: _objectSpread2$1(_objectSpread2$1({}, tmplProps), {}, {
7741
+ props: _objectSpread2(_objectSpread2({}, tmplProps), {}, {
10394
7742
  visible: {
10395
7743
  type: Boolean,
10396
7744
  "default": false
@@ -10476,7 +7824,7 @@ var TableSetting = defineComponent({
10476
7824
  "width": "60%",
10477
7825
  "top": "5vh",
10478
7826
  "destroy-on-close": true
10479
- }, _objectSpread2$1({
7827
+ }, _objectSpread2({
10480
7828
  "default": function _default() {
10481
7829
  return [createVNode(script$9, {
10482
7830
  "template": props.template,
@@ -10501,7 +7849,7 @@ var TableSetting = defineComponent({
10501
7849
 
10502
7850
  var Table = defineComponent({
10503
7851
  name: "FYTable",
10504
- props: _objectSpread2$1(_objectSpread2$1({}, tmplProps), {}, {
7852
+ props: _objectSpread2(_objectSpread2({}, tmplProps), {}, {
10505
7853
  columnIndex: {
10506
7854
  type: Boolean,
10507
7855
  "default": true
@@ -10548,7 +7896,7 @@ var Table = defineComponent({
10548
7896
 
10549
7897
  // 初始化字段排序
10550
7898
  effectTmpl.value = tmpl.map(function (item) {
10551
- return _objectSpread2$1({
7899
+ return _objectSpread2({
10552
7900
  order: item.order ? item.order : 0
10553
7901
  }, item);
10554
7902
  }) // order 初始化
@@ -10619,7 +7967,7 @@ var Table = defineComponent({
10619
7967
  return function () {
10620
7968
  return createVNode("div", {
10621
7969
  "class": "fy-table-wrap"
10622
- }, [createVNode(resolveComponent("el-table"), _objectSpread2$1(_objectSpread2$1({
7970
+ }, [createVNode(resolveComponent("el-table"), _objectSpread2(_objectSpread2({
10623
7971
  "border": true,
10624
7972
  "table-layout": "auto"
10625
7973
  }, tableAttrs), {}, {
@@ -10645,7 +7993,7 @@ var Table = defineComponent({
10645
7993
  var sorted = tmpl.sort(function (a, b) {
10646
7994
  return a.order - b.order;
10647
7995
  }).map(function (item) {
10648
- return _objectSpread2$1({}, item);
7996
+ return _objectSpread2({}, item);
10649
7997
  });
10650
7998
  effectTmpl.value = sorted;
10651
7999
  emit("headerSelection", tmpl);
@@ -10760,7 +8108,7 @@ var script$6 = /*@__PURE__*/Object.assign({
10760
8108
  name: "FYMenu"
10761
8109
  }, {
10762
8110
  __name: 'menu',
10763
- props: _objectSpread2$1({}, tmplProps),
8111
+ props: _objectSpread2({}, tmplProps),
10764
8112
  emits: ["select", "itemClick"],
10765
8113
  setup: function setup(__props, _ref) {
10766
8114
  var __emit = _ref.emit;
@@ -10920,7 +8268,7 @@ var script$4 = /*@__PURE__*/Object.assign({
10920
8268
  name: "FYNavigation"
10921
8269
  }, {
10922
8270
  __name: 'navigation',
10923
- props: _objectSpread2$1({}, tmplProps),
8271
+ props: _objectSpread2({}, tmplProps),
10924
8272
  emits: ["select", "itemClick"],
10925
8273
  setup: function setup(__props, _ref) {
10926
8274
  var __emit = _ref.emit;
@@ -11396,7 +8744,7 @@ var YHComponents = /*#__PURE__*/Object.freeze({
11396
8744
  useUnfold: useUnfold
11397
8745
  });
11398
8746
 
11399
- var index = _objectSpread2$1(_objectSpread2$1({}, YHComponents), {}, {
8747
+ var index = _objectSpread2(_objectSpread2({}, YHComponents), {}, {
11400
8748
  install: function install(app) {
11401
8749
  // 全局组件注册
11402
8750
  // 依赖于Element Plus 提前安装