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