zartui 3.1.57 → 3.1.59
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.
- package/es/hierarchy-select/HierarchySelect.mjs +6 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/media-picker/MediaPicker.d.ts +13 -0
- package/es/media-picker/MediaPicker.mjs +31 -2
- package/es/media-picker/index.d.ts +9 -0
- package/lib/hierarchy-select/HierarchySelect.js +5 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/media-picker/MediaPicker.d.ts +13 -0
- package/lib/media-picker/MediaPicker.js +30 -1
- package/lib/media-picker/index.d.ts +9 -0
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +2858 -624
- package/lib/zartui.es.js +2858 -624
- package/lib/zartui.js +2398 -164
- package/lib/zartui.min.js +8 -1
- package/package.json +10 -7
package/lib/zartui.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
const isWeixin = () => inBrowser$1 ? /micromessenger/.test(navigator.userAgent.toLowerCase()) : false;
|
|
13
13
|
function noop() {
|
|
14
14
|
}
|
|
15
|
-
const extend = Object.assign;
|
|
15
|
+
const extend$1 = Object.assign;
|
|
16
16
|
const inBrowser$1 = typeof window !== "undefined";
|
|
17
17
|
function get(object, path) {
|
|
18
18
|
const keys = path.split(".");
|
|
@@ -696,7 +696,7 @@
|
|
|
696
696
|
};
|
|
697
697
|
return options;
|
|
698
698
|
}
|
|
699
|
-
function closest(arr, target) {
|
|
699
|
+
function closest$1(arr, target) {
|
|
700
700
|
return arr.reduce(
|
|
701
701
|
(pre, cur) => Math.abs(pre - target) < Math.abs(cur - target) ? pre : cur
|
|
702
702
|
);
|
|
@@ -844,7 +844,7 @@
|
|
|
844
844
|
setup(props, {
|
|
845
845
|
slots
|
|
846
846
|
}) {
|
|
847
|
-
const style = vue.computed(() => mapThemeVarsToCSSVars(extend({}, props.themeVars, props.theme === "dark" ? props.themeVarsDark : props.themeVarsLight)));
|
|
847
|
+
const style = vue.computed(() => mapThemeVarsToCSSVars(extend$1({}, props.themeVars, props.theme === "dark" ? props.themeVarsDark : props.themeVarsLight)));
|
|
848
848
|
if (inBrowser$1) {
|
|
849
849
|
const addTheme = () => {
|
|
850
850
|
document.documentElement.classList.add(`zt-theme-${props.theme}`);
|
|
@@ -982,7 +982,7 @@
|
|
|
982
982
|
function useExpose(apis) {
|
|
983
983
|
const instance2 = vue.getCurrentInstance();
|
|
984
984
|
if (instance2) {
|
|
985
|
-
extend(instance2.proxy, apis);
|
|
985
|
+
extend$1(instance2.proxy, apis);
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
function getDirection(x, y) {
|
|
@@ -1148,7 +1148,7 @@
|
|
|
1148
1148
|
};
|
|
1149
1149
|
const renderOverlay = lazyRender(() => {
|
|
1150
1150
|
var _a;
|
|
1151
|
-
const style = extend(getZIndexStyle(props.zIndex), props.customStyle);
|
|
1151
|
+
const style = extend$1(getZIndexStyle(props.zIndex), props.customStyle);
|
|
1152
1152
|
if (isDef(props.duration)) {
|
|
1153
1153
|
style.animationDuration = `${props.duration}s`;
|
|
1154
1154
|
}
|
|
@@ -1167,7 +1167,7 @@
|
|
|
1167
1167
|
}
|
|
1168
1168
|
});
|
|
1169
1169
|
const Overlay = withInstall(stdin_default$1W);
|
|
1170
|
-
const popupProps$2 = extend({}, popupSharedProps, {
|
|
1170
|
+
const popupProps$2 = extend$1({}, popupSharedProps, {
|
|
1171
1171
|
round: Boolean,
|
|
1172
1172
|
position: makeStringProp("center"),
|
|
1173
1173
|
closeIcon: makeStringProp("clear"),
|
|
@@ -1517,7 +1517,7 @@
|
|
|
1517
1517
|
setup(props, {
|
|
1518
1518
|
slots
|
|
1519
1519
|
}) {
|
|
1520
|
-
const spinnerStyle = vue.computed(() => extend({
|
|
1520
|
+
const spinnerStyle = vue.computed(() => extend$1({
|
|
1521
1521
|
color: props.color
|
|
1522
1522
|
}, getSizeStyle(props.size)));
|
|
1523
1523
|
const renderText = () => {
|
|
@@ -1553,7 +1553,7 @@
|
|
|
1553
1553
|
const Loading = withInstall(stdin_default$1T);
|
|
1554
1554
|
var stdin_default$1S = Loading;
|
|
1555
1555
|
const [name$1m, bem$1i] = createNamespace("action-sheet");
|
|
1556
|
-
const actionSheetProps = extend({}, popupSharedProps, {
|
|
1556
|
+
const actionSheetProps = extend$1({}, popupSharedProps, {
|
|
1557
1557
|
title: String,
|
|
1558
1558
|
round: truthProp,
|
|
1559
1559
|
actions: makeArrayProp(),
|
|
@@ -2475,7 +2475,7 @@
|
|
|
2475
2475
|
return () => route(vm);
|
|
2476
2476
|
}
|
|
2477
2477
|
const [name$1h, bem$1d] = createNamespace("button");
|
|
2478
|
-
const buttonProps = extend({}, routeProps, {
|
|
2478
|
+
const buttonProps = extend$1({}, routeProps, {
|
|
2479
2479
|
tag: makeStringProp("button"),
|
|
2480
2480
|
text: String,
|
|
2481
2481
|
icon: String,
|
|
@@ -2840,7 +2840,7 @@
|
|
|
2840
2840
|
state.show = show;
|
|
2841
2841
|
};
|
|
2842
2842
|
const open = (props) => {
|
|
2843
|
-
extend(state, { primaryHeader: false }, props, { transitionAppear: true });
|
|
2843
|
+
extend$1(state, { primaryHeader: false }, props, { transitionAppear: true });
|
|
2844
2844
|
toggle(true);
|
|
2845
2845
|
};
|
|
2846
2846
|
const close2 = () => toggle(false);
|
|
@@ -2887,7 +2887,7 @@
|
|
|
2887
2887
|
};
|
|
2888
2888
|
let queue = [];
|
|
2889
2889
|
let allowMultiple = false;
|
|
2890
|
-
let currentOptions$2 = extend({}, defaultOptions$1);
|
|
2890
|
+
let currentOptions$2 = extend$1({}, defaultOptions$1);
|
|
2891
2891
|
const defaultOptionsMap = /* @__PURE__ */ new Map();
|
|
2892
2892
|
function parseOptions$1(message) {
|
|
2893
2893
|
if (isObject(message)) {
|
|
@@ -2949,10 +2949,10 @@
|
|
|
2949
2949
|
}
|
|
2950
2950
|
const toast = getInstance();
|
|
2951
2951
|
const parsedOptions = parseOptions$1(options);
|
|
2952
|
-
toast.open(extend({}, currentOptions$2, defaultOptionsMap.get(parsedOptions.type || currentOptions$2.type), parsedOptions));
|
|
2952
|
+
toast.open(extend$1({}, currentOptions$2, defaultOptionsMap.get(parsedOptions.type || currentOptions$2.type), parsedOptions));
|
|
2953
2953
|
return toast;
|
|
2954
2954
|
}
|
|
2955
|
-
const createMethod = (type) => (options) => showToast(extend({
|
|
2955
|
+
const createMethod = (type) => (options) => showToast(extend$1({
|
|
2956
2956
|
type
|
|
2957
2957
|
}, parseOptions$1(options)));
|
|
2958
2958
|
const showLoadingToast = createMethod("loading");
|
|
@@ -2977,14 +2977,14 @@
|
|
|
2977
2977
|
if (typeof type === "string") {
|
|
2978
2978
|
defaultOptionsMap.set(type, options);
|
|
2979
2979
|
} else {
|
|
2980
|
-
extend(currentOptions$2, type);
|
|
2980
|
+
extend$1(currentOptions$2, type);
|
|
2981
2981
|
}
|
|
2982
2982
|
}
|
|
2983
2983
|
const resetToastDefaultOptions = (type) => {
|
|
2984
2984
|
if (typeof type === "string") {
|
|
2985
2985
|
defaultOptionsMap.delete(type);
|
|
2986
2986
|
} else {
|
|
2987
|
-
currentOptions$2 = extend({}, defaultOptions$1);
|
|
2987
|
+
currentOptions$2 = extend$1({}, defaultOptions$1);
|
|
2988
2988
|
defaultOptionsMap.clear();
|
|
2989
2989
|
}
|
|
2990
2990
|
};
|
|
@@ -4106,7 +4106,7 @@
|
|
|
4106
4106
|
if (!state.fixed) {
|
|
4107
4107
|
return;
|
|
4108
4108
|
}
|
|
4109
|
-
const style = extend(getZIndexStyle(props.zIndex), {
|
|
4109
|
+
const style = extend$1(getZIndexStyle(props.zIndex), {
|
|
4110
4110
|
width: `${state.width}px`,
|
|
4111
4111
|
height: `${state.height}px`,
|
|
4112
4112
|
[props.position]: `${offset2.value}px`
|
|
@@ -4862,14 +4862,14 @@
|
|
|
4862
4862
|
}
|
|
4863
4863
|
};
|
|
4864
4864
|
const setCurrentIndex = (currentIndex) => {
|
|
4865
|
-
const
|
|
4866
|
-
if (!isDef(
|
|
4865
|
+
const newIndex2 = findAvailableTab(currentIndex);
|
|
4866
|
+
if (!isDef(newIndex2)) {
|
|
4867
4867
|
return;
|
|
4868
4868
|
}
|
|
4869
|
-
const newTab = children[
|
|
4870
|
-
const newName = getTabName(newTab,
|
|
4869
|
+
const newTab = children[newIndex2];
|
|
4870
|
+
const newName = getTabName(newTab, newIndex2);
|
|
4871
4871
|
const shouldEmitChange = state.currentIndex !== null;
|
|
4872
|
-
state.currentIndex =
|
|
4872
|
+
state.currentIndex = newIndex2;
|
|
4873
4873
|
if (newName !== props.active) {
|
|
4874
4874
|
emit("update:active", newName);
|
|
4875
4875
|
if (shouldEmitChange) {
|
|
@@ -5184,7 +5184,7 @@
|
|
|
5184
5184
|
});
|
|
5185
5185
|
const SwipeItem = withInstall(stdin_default$1x);
|
|
5186
5186
|
const [name$15, bem$14] = createNamespace("tab");
|
|
5187
|
-
const tabProps = extend({}, routeProps, {
|
|
5187
|
+
const tabProps = extend$1({}, routeProps, {
|
|
5188
5188
|
dot: Boolean,
|
|
5189
5189
|
name: numericProp,
|
|
5190
5190
|
badge: numericProp,
|
|
@@ -5344,7 +5344,7 @@
|
|
|
5344
5344
|
text: textKey,
|
|
5345
5345
|
value: valueKey,
|
|
5346
5346
|
children: childrenKey
|
|
5347
|
-
} = extend({
|
|
5347
|
+
} = extend$1({
|
|
5348
5348
|
text: "text",
|
|
5349
5349
|
value: "value",
|
|
5350
5350
|
children: "children"
|
|
@@ -5696,7 +5696,7 @@
|
|
|
5696
5696
|
descriptionClass: unknownProp,
|
|
5697
5697
|
description: makeStringProp("")
|
|
5698
5698
|
};
|
|
5699
|
-
const cellProps = extend({}, cellSharedProps, routeProps);
|
|
5699
|
+
const cellProps = extend$1({}, cellSharedProps, routeProps);
|
|
5700
5700
|
var stdin_default$1t = vue.defineComponent({
|
|
5701
5701
|
name: name$12,
|
|
5702
5702
|
props: cellProps,
|
|
@@ -6017,7 +6017,7 @@
|
|
|
6017
6017
|
labelDisabled: Boolean
|
|
6018
6018
|
};
|
|
6019
6019
|
var stdin_default$1q = vue.defineComponent({
|
|
6020
|
-
props: extend({}, checkerProps, {
|
|
6020
|
+
props: extend$1({}, checkerProps, {
|
|
6021
6021
|
bem: makeRequiredProp(Function),
|
|
6022
6022
|
role: String,
|
|
6023
6023
|
parent: Object,
|
|
@@ -6118,7 +6118,7 @@
|
|
|
6118
6118
|
}
|
|
6119
6119
|
});
|
|
6120
6120
|
const [name$$, bem$_] = createNamespace("checkbox");
|
|
6121
|
-
const checkboxProps = extend({}, checkerProps, {
|
|
6121
|
+
const checkboxProps = extend$1({}, checkerProps, {
|
|
6122
6122
|
bindGroup: truthProp,
|
|
6123
6123
|
indeterminate: {
|
|
6124
6124
|
type: Boolean,
|
|
@@ -6427,7 +6427,7 @@
|
|
|
6427
6427
|
});
|
|
6428
6428
|
const Collapse = withInstall(stdin_default$1m);
|
|
6429
6429
|
const [name$X, bem$W] = createNamespace("collapse-item");
|
|
6430
|
-
const collapseItemProps = extend({}, {
|
|
6430
|
+
const collapseItemProps = extend$1({}, {
|
|
6431
6431
|
name: numericProp,
|
|
6432
6432
|
title: numericProp,
|
|
6433
6433
|
// disabled: Boolean,
|
|
@@ -6608,7 +6608,7 @@
|
|
|
6608
6608
|
return Number(translateY);
|
|
6609
6609
|
}
|
|
6610
6610
|
function assignDefaultFields$1(fields) {
|
|
6611
|
-
return extend(
|
|
6611
|
+
return extend$1(
|
|
6612
6612
|
{
|
|
6613
6613
|
text: "text",
|
|
6614
6614
|
value: "value",
|
|
@@ -6949,7 +6949,7 @@
|
|
|
6949
6949
|
}, [genOptions2()])]);
|
|
6950
6950
|
}
|
|
6951
6951
|
});
|
|
6952
|
-
const pickerSharedProps$1 = extend({
|
|
6952
|
+
const pickerSharedProps$1 = extend$1({
|
|
6953
6953
|
loading: Boolean,
|
|
6954
6954
|
readonly: Boolean,
|
|
6955
6955
|
allowHtml: Boolean,
|
|
@@ -6960,7 +6960,7 @@
|
|
|
6960
6960
|
visibleOptionNum: makeNumericProp(5),
|
|
6961
6961
|
title: makeStringProp("请选择")
|
|
6962
6962
|
}, pickerToolbarProps$1);
|
|
6963
|
-
const pickerProps = extend({}, pickerSharedProps$1, {
|
|
6963
|
+
const pickerProps = extend$1({}, pickerSharedProps$1, {
|
|
6964
6964
|
columns: makeArrayProp(),
|
|
6965
6965
|
columnsUnit: makeArrayProp(),
|
|
6966
6966
|
modelValue: makeArrayProp(),
|
|
@@ -7041,13 +7041,13 @@
|
|
|
7041
7041
|
});
|
|
7042
7042
|
}
|
|
7043
7043
|
vue.nextTick(() => {
|
|
7044
|
-
emit("change", extend({
|
|
7044
|
+
emit("change", extend$1({
|
|
7045
7045
|
columnIndex
|
|
7046
7046
|
}, getEventParams()));
|
|
7047
7047
|
});
|
|
7048
7048
|
};
|
|
7049
7049
|
const onClickOption = (currentOption, columnIndex) => {
|
|
7050
|
-
emit("clickOption", extend({
|
|
7050
|
+
emit("clickOption", extend$1({
|
|
7051
7051
|
columnIndex,
|
|
7052
7052
|
currentOption
|
|
7053
7053
|
}, getEventParams()));
|
|
@@ -7232,7 +7232,7 @@
|
|
|
7232
7232
|
};
|
|
7233
7233
|
}
|
|
7234
7234
|
});
|
|
7235
|
-
const sharedProps = extend({}, pickerSharedProps$1, {
|
|
7235
|
+
const sharedProps = extend$1({}, pickerSharedProps$1, {
|
|
7236
7236
|
modelValue: makeArrayProp(),
|
|
7237
7237
|
filter: {
|
|
7238
7238
|
type: Function
|
|
@@ -7526,7 +7526,7 @@
|
|
|
7526
7526
|
}
|
|
7527
7527
|
});
|
|
7528
7528
|
const [name$R, bem$R] = createNamespace("time-picker");
|
|
7529
|
-
const timePickerProps = extend({}, sharedProps, {
|
|
7529
|
+
const timePickerProps = extend$1({}, sharedProps, {
|
|
7530
7530
|
minHour: makeNumericProp(0),
|
|
7531
7531
|
maxHour: makeNumericProp(23),
|
|
7532
7532
|
minMinute: makeNumericProp(0),
|
|
@@ -7608,11 +7608,11 @@
|
|
|
7608
7608
|
}
|
|
7609
7609
|
});
|
|
7610
7610
|
}
|
|
7611
|
-
emit("change", extend({
|
|
7611
|
+
emit("change", extend$1({
|
|
7612
7612
|
columnIndex
|
|
7613
7613
|
}, getEventParams()));
|
|
7614
7614
|
};
|
|
7615
|
-
const onClickOption = (currentOption, columnIndex) => emit("clickOption", extend({
|
|
7615
|
+
const onClickOption = (currentOption, columnIndex) => emit("clickOption", extend$1({
|
|
7616
7616
|
columnIndex,
|
|
7617
7617
|
currentOption
|
|
7618
7618
|
}, getEventParams()));
|
|
@@ -7690,7 +7690,7 @@
|
|
|
7690
7690
|
var stdin_default$1c = TimePicker;
|
|
7691
7691
|
const [name$Q, bem$Q] = createNamespace("date-time-picker-wrapper");
|
|
7692
7692
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
7693
|
-
const dateTimePickerProps = extend({}, sharedProps, popupSharedProps, {
|
|
7693
|
+
const dateTimePickerProps = extend$1({}, sharedProps, popupSharedProps, {
|
|
7694
7694
|
range: Boolean,
|
|
7695
7695
|
popup: truthProp,
|
|
7696
7696
|
columnsType: {
|
|
@@ -7923,7 +7923,7 @@
|
|
|
7923
7923
|
"modelValue": dateValuesRef.value,
|
|
7924
7924
|
"onUpdate:modelValue": ($event) => dateValuesRef.value = $event,
|
|
7925
7925
|
"columns": dateColumns.value
|
|
7926
|
-
}, extend(pick(props, pickerInheritKeys), {
|
|
7926
|
+
}, extend$1(pick(props, pickerInheritKeys), {
|
|
7927
7927
|
showToolbar: false
|
|
7928
7928
|
})), null) : null, hasTimeColumn ? vue.createVNode(Divider, {
|
|
7929
7929
|
"style": "margin: 0"
|
|
@@ -8141,7 +8141,7 @@
|
|
|
8141
8141
|
"columnsType": props.columnsType,
|
|
8142
8142
|
"maxDate": props.maxDate,
|
|
8143
8143
|
"minDate": props.minDate
|
|
8144
|
-
}, extend(pick(props, pickerInheritKeys), {
|
|
8144
|
+
}, extend$1(pick(props, pickerInheritKeys), {
|
|
8145
8145
|
showTitle: false
|
|
8146
8146
|
})), null);
|
|
8147
8147
|
}
|
|
@@ -8153,7 +8153,7 @@
|
|
|
8153
8153
|
"columnsType": props.columnsType,
|
|
8154
8154
|
"maxDate": props.maxDate,
|
|
8155
8155
|
"minDate": props.minDate
|
|
8156
|
-
}, extend(pick(props, pickerInheritKeys), {
|
|
8156
|
+
}, extend$1(pick(props, pickerInheritKeys), {
|
|
8157
8157
|
showTitle: false
|
|
8158
8158
|
})), null), [[vue.vShow, rangeSelectedIndex.value === 0]]), vue.withDirectives(vue.createVNode(stdin_default$1b, vue.mergeProps({
|
|
8159
8159
|
"ref": currentEndPickerRef,
|
|
@@ -8163,7 +8163,7 @@
|
|
|
8163
8163
|
"columnsType": props.columnsType,
|
|
8164
8164
|
"maxDate": props.maxDate,
|
|
8165
8165
|
"minDate": props.minDate
|
|
8166
|
-
}, extend(pick(props, pickerInheritKeys), {
|
|
8166
|
+
}, extend$1(pick(props, pickerInheritKeys), {
|
|
8167
8167
|
showTitle: false
|
|
8168
8168
|
})), null), [[vue.vShow, rangeSelectedIndex.value === 1]])];
|
|
8169
8169
|
};
|
|
@@ -8190,7 +8190,7 @@
|
|
|
8190
8190
|
});
|
|
8191
8191
|
const DateTimePicker = withInstall(stdin_default$1a);
|
|
8192
8192
|
const [name$O, bem$O, t$4] = createNamespace("dialog");
|
|
8193
|
-
const dialogProps = extend({}, popupSharedProps, {
|
|
8193
|
+
const dialogProps = extend$1({}, popupSharedProps, {
|
|
8194
8194
|
title: String,
|
|
8195
8195
|
primaryHeader: Boolean,
|
|
8196
8196
|
theme: String,
|
|
@@ -8419,7 +8419,7 @@
|
|
|
8419
8419
|
closeOnPopstate: true,
|
|
8420
8420
|
closeOnClickOverlay: false
|
|
8421
8421
|
};
|
|
8422
|
-
let currentOptions$1 = extend({}, DEFAULT_OPTIONS$1);
|
|
8422
|
+
let currentOptions$1 = extend$1({}, DEFAULT_OPTIONS$1);
|
|
8423
8423
|
function initInstance$2() {
|
|
8424
8424
|
const Wrapper = {
|
|
8425
8425
|
setup() {
|
|
@@ -8444,7 +8444,7 @@
|
|
|
8444
8444
|
if (!instance$2) {
|
|
8445
8445
|
initInstance$2();
|
|
8446
8446
|
}
|
|
8447
|
-
instance$2.open(extend({}, currentOptions$1, options, {
|
|
8447
|
+
instance$2.open(extend$1({}, currentOptions$1, options, {
|
|
8448
8448
|
callback: (action) => {
|
|
8449
8449
|
(action === "confirm" ? resolve : reject)(action);
|
|
8450
8450
|
}
|
|
@@ -8452,12 +8452,12 @@
|
|
|
8452
8452
|
});
|
|
8453
8453
|
}
|
|
8454
8454
|
const setDialogDefaultOptions = (options) => {
|
|
8455
|
-
extend(currentOptions$1, options);
|
|
8455
|
+
extend$1(currentOptions$1, options);
|
|
8456
8456
|
};
|
|
8457
8457
|
const resetDialogDefaultOptions = () => {
|
|
8458
|
-
currentOptions$1 = extend({}, DEFAULT_OPTIONS$1);
|
|
8458
|
+
currentOptions$1 = extend$1({}, DEFAULT_OPTIONS$1);
|
|
8459
8459
|
};
|
|
8460
|
-
const showConfirmDialog = (options) => showDialog(extend({
|
|
8460
|
+
const showConfirmDialog = (options) => showDialog(extend$1({
|
|
8461
8461
|
showCancelButton: true
|
|
8462
8462
|
}, options));
|
|
8463
8463
|
const closeDialog = () => {
|
|
@@ -8499,7 +8499,7 @@
|
|
|
8499
8499
|
default: null
|
|
8500
8500
|
}
|
|
8501
8501
|
};
|
|
8502
|
-
const fieldProps = extend({}, cellSharedProps, fieldSharedProps, {
|
|
8502
|
+
const fieldProps = extend$1({}, cellSharedProps, fieldSharedProps, {
|
|
8503
8503
|
rows: numericProp,
|
|
8504
8504
|
type: makeStringProp("text"),
|
|
8505
8505
|
rules: Array,
|
|
@@ -8976,7 +8976,7 @@
|
|
|
8976
8976
|
const Field = withInstall(stdin_default$18);
|
|
8977
8977
|
var stdin_default$17 = Field;
|
|
8978
8978
|
const [name$M, bem$M] = createNamespace("search");
|
|
8979
|
-
const searchProps = extend({}, fieldSharedProps, {
|
|
8979
|
+
const searchProps = extend$1({}, fieldSharedProps, {
|
|
8980
8980
|
shape: makeStringProp("round"),
|
|
8981
8981
|
value: String,
|
|
8982
8982
|
label: String,
|
|
@@ -9058,7 +9058,7 @@
|
|
|
9058
9058
|
const fieldPropNames = Object.keys(fieldSharedProps);
|
|
9059
9059
|
const direction = "horizontal";
|
|
9060
9060
|
const renderField = () => {
|
|
9061
|
-
const fieldAttrs = extend({}, attrs, pick(props, fieldPropNames), {
|
|
9061
|
+
const fieldAttrs = extend$1({}, attrs, pick(props, fieldPropNames), {
|
|
9062
9062
|
id: getInputId(),
|
|
9063
9063
|
leftIcon: props.leftIcon,
|
|
9064
9064
|
rightIcon: props.rightIcon,
|
|
@@ -9793,7 +9793,7 @@
|
|
|
9793
9793
|
transition: true,
|
|
9794
9794
|
showWrapper: false
|
|
9795
9795
|
});
|
|
9796
|
-
const fields = vue.computed(() => extend({
|
|
9796
|
+
const fields = vue.computed(() => extend$1({
|
|
9797
9797
|
text: "text",
|
|
9798
9798
|
value: "value",
|
|
9799
9799
|
children: "children"
|
|
@@ -11394,11 +11394,11 @@
|
|
|
11394
11394
|
dragging.value = false;
|
|
11395
11395
|
vue.nextTick(() => {
|
|
11396
11396
|
if (props.magnetic === "x") {
|
|
11397
|
-
const nextX = closest([boundary.value.left, boundary.value.right], state.value.x);
|
|
11397
|
+
const nextX = closest$1([boundary.value.left, boundary.value.right], state.value.x);
|
|
11398
11398
|
state.value.x = nextX;
|
|
11399
11399
|
}
|
|
11400
11400
|
if (props.magnetic === "y") {
|
|
11401
|
-
const nextY = closest([boundary.value.top, boundary.value.bottom], state.value.y);
|
|
11401
|
+
const nextY = closest$1([boundary.value.top, boundary.value.bottom], state.value.y);
|
|
11402
11402
|
state.value.y = nextY;
|
|
11403
11403
|
}
|
|
11404
11404
|
if (!touch.isTap.value) {
|
|
@@ -11646,7 +11646,7 @@
|
|
|
11646
11646
|
const Grid = withInstall(stdin_default$Y);
|
|
11647
11647
|
var stdin_default$X = Grid;
|
|
11648
11648
|
const [name$D, bem$D] = createNamespace("grid-item");
|
|
11649
|
-
const gridItemProps = extend({}, routeProps, {
|
|
11649
|
+
const gridItemProps = extend$1({}, routeProps, {
|
|
11650
11650
|
dot: Boolean,
|
|
11651
11651
|
text: String,
|
|
11652
11652
|
icon: String,
|
|
@@ -11908,6 +11908,11 @@
|
|
|
11908
11908
|
const dataList = vue.ref(deepClone(props.treeData));
|
|
11909
11909
|
const breadcrumbData = vue.ref([]);
|
|
11910
11910
|
const historyLayers = vue.ref([]);
|
|
11911
|
+
vue.watch(() => props.treeData, () => {
|
|
11912
|
+
dataList.value = deepClone(props.treeData);
|
|
11913
|
+
}, {
|
|
11914
|
+
deep: true
|
|
11915
|
+
});
|
|
11911
11916
|
const isDisabled = (item) => {
|
|
11912
11917
|
if (!props.autoChangeToChildren && props.disableParent && item.children) {
|
|
11913
11918
|
return true;
|
|
@@ -12718,7 +12723,7 @@
|
|
|
12718
12723
|
startPosition
|
|
12719
12724
|
};
|
|
12720
12725
|
}
|
|
12721
|
-
instance$1.open(extend({}, defaultConfig, options));
|
|
12726
|
+
instance$1.open(extend$1({}, defaultConfig, options));
|
|
12722
12727
|
return instance$1;
|
|
12723
12728
|
};
|
|
12724
12729
|
const ImagePreview = withInstall(stdin_default$R);
|
|
@@ -13162,7 +13167,7 @@
|
|
|
13162
13167
|
highlightColor
|
|
13163
13168
|
} = parent.props;
|
|
13164
13169
|
if (isSticky()) {
|
|
13165
|
-
return extend(getZIndexStyle(zIndex), {
|
|
13170
|
+
return extend$1(getZIndexStyle(zIndex), {
|
|
13166
13171
|
left: state.left ? `${state.left}px` : void 0,
|
|
13167
13172
|
width: state.width ? `${state.width}px` : void 0,
|
|
13168
13173
|
transform: state.top ? `translate3d(0, ${state.top}px, 0)` : void 0,
|
|
@@ -13170,7 +13175,7 @@
|
|
|
13170
13175
|
});
|
|
13171
13176
|
}
|
|
13172
13177
|
});
|
|
13173
|
-
const
|
|
13178
|
+
const getRect2 = (scrollParent, scrollParentRect) => {
|
|
13174
13179
|
const rootRect = useRect(root);
|
|
13175
13180
|
state.rect.height = rootRect.height;
|
|
13176
13181
|
if (scrollParent === window || scrollParent === document.body) {
|
|
@@ -13182,7 +13187,7 @@
|
|
|
13182
13187
|
};
|
|
13183
13188
|
useExpose({
|
|
13184
13189
|
state,
|
|
13185
|
-
getRect
|
|
13190
|
+
getRect: getRect2
|
|
13186
13191
|
});
|
|
13187
13192
|
return () => {
|
|
13188
13193
|
const sticky = isSticky();
|
|
@@ -15525,87 +15530,2292 @@
|
|
|
15525
15530
|
});
|
|
15526
15531
|
});
|
|
15527
15532
|
};
|
|
15528
|
-
|
|
15529
|
-
|
|
15530
|
-
|
|
15531
|
-
|
|
15532
|
-
|
|
15533
|
-
|
|
15534
|
-
|
|
15535
|
-
|
|
15533
|
+
/**!
|
|
15534
|
+
* Sortable 1.15.6
|
|
15535
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
15536
|
+
* @author owenm <owen23355@gmail.com>
|
|
15537
|
+
* @license MIT
|
|
15538
|
+
*/
|
|
15539
|
+
function ownKeys(object, enumerableOnly) {
|
|
15540
|
+
var keys = Object.keys(object);
|
|
15541
|
+
if (Object.getOwnPropertySymbols) {
|
|
15542
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
15543
|
+
if (enumerableOnly) {
|
|
15544
|
+
symbols = symbols.filter(function(sym) {
|
|
15545
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
15546
|
+
});
|
|
15547
|
+
}
|
|
15548
|
+
keys.push.apply(keys, symbols);
|
|
15549
|
+
}
|
|
15550
|
+
return keys;
|
|
15551
|
+
}
|
|
15552
|
+
function _objectSpread2(target) {
|
|
15553
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15554
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
15555
|
+
if (i % 2) {
|
|
15556
|
+
ownKeys(Object(source), true).forEach(function(key) {
|
|
15557
|
+
_defineProperty(target, key, source[key]);
|
|
15558
|
+
});
|
|
15559
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
15560
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
15561
|
+
} else {
|
|
15562
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
15563
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
15564
|
+
});
|
|
15565
|
+
}
|
|
15566
|
+
}
|
|
15567
|
+
return target;
|
|
15568
|
+
}
|
|
15569
|
+
function _typeof(obj) {
|
|
15570
|
+
"@babel/helpers - typeof";
|
|
15571
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
15572
|
+
_typeof = function(obj2) {
|
|
15573
|
+
return typeof obj2;
|
|
15536
15574
|
};
|
|
15537
|
-
|
|
15538
|
-
|
|
15539
|
-
|
|
15540
|
-
} catch (e) {
|
|
15541
|
-
reject(e);
|
|
15542
|
-
}
|
|
15575
|
+
} else {
|
|
15576
|
+
_typeof = function(obj2) {
|
|
15577
|
+
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
15543
15578
|
};
|
|
15544
|
-
|
|
15545
|
-
|
|
15579
|
+
}
|
|
15580
|
+
return _typeof(obj);
|
|
15581
|
+
}
|
|
15582
|
+
function _defineProperty(obj, key, value) {
|
|
15583
|
+
if (key in obj) {
|
|
15584
|
+
Object.defineProperty(obj, key, {
|
|
15585
|
+
value,
|
|
15586
|
+
enumerable: true,
|
|
15587
|
+
configurable: true,
|
|
15588
|
+
writable: true
|
|
15589
|
+
});
|
|
15590
|
+
} else {
|
|
15591
|
+
obj[key] = value;
|
|
15592
|
+
}
|
|
15593
|
+
return obj;
|
|
15594
|
+
}
|
|
15595
|
+
function _extends$p() {
|
|
15596
|
+
_extends$p = Object.assign || function(target) {
|
|
15597
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15598
|
+
var source = arguments[i];
|
|
15599
|
+
for (var key in source) {
|
|
15600
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
15601
|
+
target[key] = source[key];
|
|
15602
|
+
}
|
|
15603
|
+
}
|
|
15604
|
+
}
|
|
15605
|
+
return target;
|
|
15606
|
+
};
|
|
15607
|
+
return _extends$p.apply(this, arguments);
|
|
15608
|
+
}
|
|
15609
|
+
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
15610
|
+
if (source == null)
|
|
15611
|
+
return {};
|
|
15612
|
+
var target = {};
|
|
15613
|
+
var sourceKeys = Object.keys(source);
|
|
15614
|
+
var key, i;
|
|
15615
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
15616
|
+
key = sourceKeys[i];
|
|
15617
|
+
if (excluded.indexOf(key) >= 0)
|
|
15618
|
+
continue;
|
|
15619
|
+
target[key] = source[key];
|
|
15620
|
+
}
|
|
15621
|
+
return target;
|
|
15622
|
+
}
|
|
15623
|
+
function _objectWithoutProperties(source, excluded) {
|
|
15624
|
+
if (source == null)
|
|
15625
|
+
return {};
|
|
15626
|
+
var target = _objectWithoutPropertiesLoose$2(source, excluded);
|
|
15627
|
+
var key, i;
|
|
15628
|
+
if (Object.getOwnPropertySymbols) {
|
|
15629
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
15630
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
15631
|
+
key = sourceSymbolKeys[i];
|
|
15632
|
+
if (excluded.indexOf(key) >= 0)
|
|
15633
|
+
continue;
|
|
15634
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
15635
|
+
continue;
|
|
15636
|
+
target[key] = source[key];
|
|
15637
|
+
}
|
|
15638
|
+
}
|
|
15639
|
+
return target;
|
|
15640
|
+
}
|
|
15641
|
+
var version$1 = "1.15.6";
|
|
15642
|
+
function userAgent(pattern) {
|
|
15643
|
+
if (typeof window !== "undefined" && window.navigator) {
|
|
15644
|
+
return !!/* @__PURE__ */ navigator.userAgent.match(pattern);
|
|
15645
|
+
}
|
|
15646
|
+
}
|
|
15647
|
+
var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
|
|
15648
|
+
var Edge = userAgent(/Edge/i);
|
|
15649
|
+
var FireFox = userAgent(/firefox/i);
|
|
15650
|
+
var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
|
|
15651
|
+
var IOS = userAgent(/iP(ad|od|hone)/i);
|
|
15652
|
+
var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
|
|
15653
|
+
var captureMode = {
|
|
15654
|
+
capture: false,
|
|
15655
|
+
passive: false
|
|
15656
|
+
};
|
|
15657
|
+
function on$1(el, event, fn) {
|
|
15658
|
+
el.addEventListener(event, fn, !IE11OrLess && captureMode);
|
|
15659
|
+
}
|
|
15660
|
+
function off$1(el, event, fn) {
|
|
15661
|
+
el.removeEventListener(event, fn, !IE11OrLess && captureMode);
|
|
15662
|
+
}
|
|
15663
|
+
function matches(el, selector) {
|
|
15664
|
+
if (!selector)
|
|
15665
|
+
return;
|
|
15666
|
+
selector[0] === ">" && (selector = selector.substring(1));
|
|
15667
|
+
if (el) {
|
|
15668
|
+
try {
|
|
15669
|
+
if (el.matches) {
|
|
15670
|
+
return el.matches(selector);
|
|
15671
|
+
} else if (el.msMatchesSelector) {
|
|
15672
|
+
return el.msMatchesSelector(selector);
|
|
15673
|
+
} else if (el.webkitMatchesSelector) {
|
|
15674
|
+
return el.webkitMatchesSelector(selector);
|
|
15675
|
+
}
|
|
15676
|
+
} catch (_) {
|
|
15677
|
+
return false;
|
|
15678
|
+
}
|
|
15679
|
+
}
|
|
15680
|
+
return false;
|
|
15681
|
+
}
|
|
15682
|
+
function getParentOrHost(el) {
|
|
15683
|
+
return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
|
|
15684
|
+
}
|
|
15685
|
+
function closest(el, selector, ctx, includeCTX) {
|
|
15686
|
+
if (el) {
|
|
15687
|
+
ctx = ctx || document;
|
|
15688
|
+
do {
|
|
15689
|
+
if (selector != null && (selector[0] === ">" ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
|
|
15690
|
+
return el;
|
|
15691
|
+
}
|
|
15692
|
+
if (el === ctx)
|
|
15693
|
+
break;
|
|
15694
|
+
} while (el = getParentOrHost(el));
|
|
15695
|
+
}
|
|
15696
|
+
return null;
|
|
15697
|
+
}
|
|
15698
|
+
var R_SPACE = /\s+/g;
|
|
15699
|
+
function toggleClass(el, name2, state) {
|
|
15700
|
+
if (el && name2) {
|
|
15701
|
+
if (el.classList) {
|
|
15702
|
+
el.classList[state ? "add" : "remove"](name2);
|
|
15703
|
+
} else {
|
|
15704
|
+
var className = (" " + el.className + " ").replace(R_SPACE, " ").replace(" " + name2 + " ", " ");
|
|
15705
|
+
el.className = (className + (state ? " " + name2 : "")).replace(R_SPACE, " ");
|
|
15706
|
+
}
|
|
15707
|
+
}
|
|
15708
|
+
}
|
|
15709
|
+
function css(el, prop, val) {
|
|
15710
|
+
var style = el && el.style;
|
|
15711
|
+
if (style) {
|
|
15712
|
+
if (val === void 0) {
|
|
15713
|
+
if (document.defaultView && document.defaultView.getComputedStyle) {
|
|
15714
|
+
val = document.defaultView.getComputedStyle(el, "");
|
|
15715
|
+
} else if (el.currentStyle) {
|
|
15716
|
+
val = el.currentStyle;
|
|
15717
|
+
}
|
|
15718
|
+
return prop === void 0 ? val : val[prop];
|
|
15719
|
+
} else {
|
|
15720
|
+
if (!(prop in style) && prop.indexOf("webkit") === -1) {
|
|
15721
|
+
prop = "-webkit-" + prop;
|
|
15722
|
+
}
|
|
15723
|
+
style[prop] = val + (typeof val === "string" ? "" : "px");
|
|
15724
|
+
}
|
|
15725
|
+
}
|
|
15726
|
+
}
|
|
15727
|
+
function matrix(el, selfOnly) {
|
|
15728
|
+
var appliedTransforms = "";
|
|
15729
|
+
if (typeof el === "string") {
|
|
15730
|
+
appliedTransforms = el;
|
|
15731
|
+
} else {
|
|
15732
|
+
do {
|
|
15733
|
+
var transform = css(el, "transform");
|
|
15734
|
+
if (transform && transform !== "none") {
|
|
15735
|
+
appliedTransforms = transform + " " + appliedTransforms;
|
|
15736
|
+
}
|
|
15737
|
+
} while (!selfOnly && (el = el.parentNode));
|
|
15738
|
+
}
|
|
15739
|
+
var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
15740
|
+
return matrixFn && new matrixFn(appliedTransforms);
|
|
15741
|
+
}
|
|
15742
|
+
function find(ctx, tagName, iterator) {
|
|
15743
|
+
if (ctx) {
|
|
15744
|
+
var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;
|
|
15745
|
+
if (iterator) {
|
|
15746
|
+
for (; i < n; i++) {
|
|
15747
|
+
iterator(list[i], i);
|
|
15748
|
+
}
|
|
15749
|
+
}
|
|
15750
|
+
return list;
|
|
15751
|
+
}
|
|
15752
|
+
return [];
|
|
15753
|
+
}
|
|
15754
|
+
function getWindowScrollingElement() {
|
|
15755
|
+
var scrollingElement = document.scrollingElement;
|
|
15756
|
+
if (scrollingElement) {
|
|
15757
|
+
return scrollingElement;
|
|
15758
|
+
} else {
|
|
15759
|
+
return document.documentElement;
|
|
15760
|
+
}
|
|
15761
|
+
}
|
|
15762
|
+
function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
|
|
15763
|
+
if (!el.getBoundingClientRect && el !== window)
|
|
15764
|
+
return;
|
|
15765
|
+
var elRect, top2, left2, bottom2, right2, height2, width2;
|
|
15766
|
+
if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
|
|
15767
|
+
elRect = el.getBoundingClientRect();
|
|
15768
|
+
top2 = elRect.top;
|
|
15769
|
+
left2 = elRect.left;
|
|
15770
|
+
bottom2 = elRect.bottom;
|
|
15771
|
+
right2 = elRect.right;
|
|
15772
|
+
height2 = elRect.height;
|
|
15773
|
+
width2 = elRect.width;
|
|
15774
|
+
} else {
|
|
15775
|
+
top2 = 0;
|
|
15776
|
+
left2 = 0;
|
|
15777
|
+
bottom2 = window.innerHeight;
|
|
15778
|
+
right2 = window.innerWidth;
|
|
15779
|
+
height2 = window.innerHeight;
|
|
15780
|
+
width2 = window.innerWidth;
|
|
15781
|
+
}
|
|
15782
|
+
if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
|
|
15783
|
+
container = container || el.parentNode;
|
|
15784
|
+
if (!IE11OrLess) {
|
|
15785
|
+
do {
|
|
15786
|
+
if (container && container.getBoundingClientRect && (css(container, "transform") !== "none" || relativeToNonStaticParent && css(container, "position") !== "static")) {
|
|
15787
|
+
var containerRect = container.getBoundingClientRect();
|
|
15788
|
+
top2 -= containerRect.top + parseInt(css(container, "border-top-width"));
|
|
15789
|
+
left2 -= containerRect.left + parseInt(css(container, "border-left-width"));
|
|
15790
|
+
bottom2 = top2 + elRect.height;
|
|
15791
|
+
right2 = left2 + elRect.width;
|
|
15792
|
+
break;
|
|
15793
|
+
}
|
|
15794
|
+
} while (container = container.parentNode);
|
|
15795
|
+
}
|
|
15796
|
+
}
|
|
15797
|
+
if (undoScale && el !== window) {
|
|
15798
|
+
var elMatrix = matrix(container || el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d;
|
|
15799
|
+
if (elMatrix) {
|
|
15800
|
+
top2 /= scaleY;
|
|
15801
|
+
left2 /= scaleX;
|
|
15802
|
+
width2 /= scaleX;
|
|
15803
|
+
height2 /= scaleY;
|
|
15804
|
+
bottom2 = top2 + height2;
|
|
15805
|
+
right2 = left2 + width2;
|
|
15806
|
+
}
|
|
15807
|
+
}
|
|
15808
|
+
return {
|
|
15809
|
+
top: top2,
|
|
15810
|
+
left: left2,
|
|
15811
|
+
bottom: bottom2,
|
|
15812
|
+
right: right2,
|
|
15813
|
+
width: width2,
|
|
15814
|
+
height: height2
|
|
15815
|
+
};
|
|
15816
|
+
}
|
|
15817
|
+
function isScrolledPast(el, elSide, parentSide) {
|
|
15818
|
+
var parent = getParentAutoScrollElement(el, true), elSideVal = getRect(el)[elSide];
|
|
15819
|
+
while (parent) {
|
|
15820
|
+
var parentSideVal = getRect(parent)[parentSide], visible = void 0;
|
|
15821
|
+
if (parentSide === "top" || parentSide === "left") {
|
|
15822
|
+
visible = elSideVal >= parentSideVal;
|
|
15823
|
+
} else {
|
|
15824
|
+
visible = elSideVal <= parentSideVal;
|
|
15825
|
+
}
|
|
15826
|
+
if (!visible)
|
|
15827
|
+
return parent;
|
|
15828
|
+
if (parent === getWindowScrollingElement())
|
|
15829
|
+
break;
|
|
15830
|
+
parent = getParentAutoScrollElement(parent, false);
|
|
15831
|
+
}
|
|
15832
|
+
return false;
|
|
15833
|
+
}
|
|
15834
|
+
function getChild(el, childNum, options, includeDragEl) {
|
|
15835
|
+
var currentChild = 0, i = 0, children = el.children;
|
|
15836
|
+
while (i < children.length) {
|
|
15837
|
+
if (children[i].style.display !== "none" && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
|
|
15838
|
+
if (currentChild === childNum) {
|
|
15839
|
+
return children[i];
|
|
15840
|
+
}
|
|
15841
|
+
currentChild++;
|
|
15842
|
+
}
|
|
15843
|
+
i++;
|
|
15844
|
+
}
|
|
15845
|
+
return null;
|
|
15846
|
+
}
|
|
15847
|
+
function lastChild(el, selector) {
|
|
15848
|
+
var last = el.lastElementChild;
|
|
15849
|
+
while (last && (last === Sortable.ghost || css(last, "display") === "none" || selector && !matches(last, selector))) {
|
|
15850
|
+
last = last.previousElementSibling;
|
|
15851
|
+
}
|
|
15852
|
+
return last || null;
|
|
15853
|
+
}
|
|
15854
|
+
function index$1(el, selector) {
|
|
15855
|
+
var index2 = 0;
|
|
15856
|
+
if (!el || !el.parentNode) {
|
|
15857
|
+
return -1;
|
|
15858
|
+
}
|
|
15859
|
+
while (el = el.previousElementSibling) {
|
|
15860
|
+
if (el.nodeName.toUpperCase() !== "TEMPLATE" && el !== Sortable.clone && (!selector || matches(el, selector))) {
|
|
15861
|
+
index2++;
|
|
15862
|
+
}
|
|
15863
|
+
}
|
|
15864
|
+
return index2;
|
|
15865
|
+
}
|
|
15866
|
+
function getRelativeScrollOffset(el) {
|
|
15867
|
+
var offsetLeft = 0, offsetTop = 0, winScroller = getWindowScrollingElement();
|
|
15868
|
+
if (el) {
|
|
15869
|
+
do {
|
|
15870
|
+
var elMatrix = matrix(el), scaleX = elMatrix.a, scaleY = elMatrix.d;
|
|
15871
|
+
offsetLeft += el.scrollLeft * scaleX;
|
|
15872
|
+
offsetTop += el.scrollTop * scaleY;
|
|
15873
|
+
} while (el !== winScroller && (el = el.parentNode));
|
|
15874
|
+
}
|
|
15875
|
+
return [offsetLeft, offsetTop];
|
|
15876
|
+
}
|
|
15877
|
+
function indexOfObject(arr, obj) {
|
|
15878
|
+
for (var i in arr) {
|
|
15879
|
+
if (!arr.hasOwnProperty(i))
|
|
15880
|
+
continue;
|
|
15881
|
+
for (var key in obj) {
|
|
15882
|
+
if (obj.hasOwnProperty(key) && obj[key] === arr[i][key])
|
|
15883
|
+
return Number(i);
|
|
15884
|
+
}
|
|
15885
|
+
}
|
|
15886
|
+
return -1;
|
|
15887
|
+
}
|
|
15888
|
+
function getParentAutoScrollElement(el, includeSelf) {
|
|
15889
|
+
if (!el || !el.getBoundingClientRect)
|
|
15890
|
+
return getWindowScrollingElement();
|
|
15891
|
+
var elem = el;
|
|
15892
|
+
var gotSelf = false;
|
|
15893
|
+
do {
|
|
15894
|
+
if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
|
|
15895
|
+
var elemCSS = css(elem);
|
|
15896
|
+
if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == "auto" || elemCSS.overflowX == "scroll") || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == "auto" || elemCSS.overflowY == "scroll")) {
|
|
15897
|
+
if (!elem.getBoundingClientRect || elem === document.body)
|
|
15898
|
+
return getWindowScrollingElement();
|
|
15899
|
+
if (gotSelf || includeSelf)
|
|
15900
|
+
return elem;
|
|
15901
|
+
gotSelf = true;
|
|
15902
|
+
}
|
|
15903
|
+
}
|
|
15904
|
+
} while (elem = elem.parentNode);
|
|
15905
|
+
return getWindowScrollingElement();
|
|
15906
|
+
}
|
|
15907
|
+
function extend(dst, src) {
|
|
15908
|
+
if (dst && src) {
|
|
15909
|
+
for (var key in src) {
|
|
15910
|
+
if (src.hasOwnProperty(key)) {
|
|
15911
|
+
dst[key] = src[key];
|
|
15912
|
+
}
|
|
15913
|
+
}
|
|
15914
|
+
}
|
|
15915
|
+
return dst;
|
|
15916
|
+
}
|
|
15917
|
+
function isRectEqual(rect1, rect2) {
|
|
15918
|
+
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);
|
|
15919
|
+
}
|
|
15920
|
+
var _throttleTimeout;
|
|
15921
|
+
function throttle$1(callback, ms) {
|
|
15922
|
+
return function() {
|
|
15923
|
+
if (!_throttleTimeout) {
|
|
15924
|
+
var args = arguments, _this = this;
|
|
15925
|
+
if (args.length === 1) {
|
|
15926
|
+
callback.call(_this, args[0]);
|
|
15927
|
+
} else {
|
|
15928
|
+
callback.apply(_this, args);
|
|
15929
|
+
}
|
|
15930
|
+
_throttleTimeout = setTimeout(function() {
|
|
15931
|
+
_throttleTimeout = void 0;
|
|
15932
|
+
}, ms);
|
|
15933
|
+
}
|
|
15934
|
+
};
|
|
15935
|
+
}
|
|
15936
|
+
function cancelThrottle() {
|
|
15937
|
+
clearTimeout(_throttleTimeout);
|
|
15938
|
+
_throttleTimeout = void 0;
|
|
15939
|
+
}
|
|
15940
|
+
function scrollBy(el, x, y) {
|
|
15941
|
+
el.scrollLeft += x;
|
|
15942
|
+
el.scrollTop += y;
|
|
15943
|
+
}
|
|
15944
|
+
function clone(el) {
|
|
15945
|
+
var Polymer = window.Polymer;
|
|
15946
|
+
var $ = window.jQuery || window.Zepto;
|
|
15947
|
+
if (Polymer && Polymer.dom) {
|
|
15948
|
+
return Polymer.dom(el).cloneNode(true);
|
|
15949
|
+
} else if ($) {
|
|
15950
|
+
return $(el).clone(true)[0];
|
|
15951
|
+
} else {
|
|
15952
|
+
return el.cloneNode(true);
|
|
15953
|
+
}
|
|
15954
|
+
}
|
|
15955
|
+
function getChildContainingRectFromElement(container, options, ghostEl2) {
|
|
15956
|
+
var rect = {};
|
|
15957
|
+
Array.from(container.children).forEach(function(child) {
|
|
15958
|
+
var _rect$left, _rect$top, _rect$right, _rect$bottom;
|
|
15959
|
+
if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl2)
|
|
15960
|
+
return;
|
|
15961
|
+
var childRect = getRect(child);
|
|
15962
|
+
rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
|
|
15963
|
+
rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
|
|
15964
|
+
rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
|
|
15965
|
+
rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
|
|
15546
15966
|
});
|
|
15967
|
+
rect.width = rect.right - rect.left;
|
|
15968
|
+
rect.height = rect.bottom - rect.top;
|
|
15969
|
+
rect.x = rect.left;
|
|
15970
|
+
rect.y = rect.top;
|
|
15971
|
+
return rect;
|
|
15972
|
+
}
|
|
15973
|
+
var expando = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
15974
|
+
function AnimationStateManager() {
|
|
15975
|
+
var animationStates = [], animationCallbackId;
|
|
15976
|
+
return {
|
|
15977
|
+
captureAnimationState: function captureAnimationState() {
|
|
15978
|
+
animationStates = [];
|
|
15979
|
+
if (!this.options.animation)
|
|
15980
|
+
return;
|
|
15981
|
+
var children = [].slice.call(this.el.children);
|
|
15982
|
+
children.forEach(function(child) {
|
|
15983
|
+
if (css(child, "display") === "none" || child === Sortable.ghost)
|
|
15984
|
+
return;
|
|
15985
|
+
animationStates.push({
|
|
15986
|
+
target: child,
|
|
15987
|
+
rect: getRect(child)
|
|
15988
|
+
});
|
|
15989
|
+
var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
|
|
15990
|
+
if (child.thisAnimationDuration) {
|
|
15991
|
+
var childMatrix = matrix(child, true);
|
|
15992
|
+
if (childMatrix) {
|
|
15993
|
+
fromRect.top -= childMatrix.f;
|
|
15994
|
+
fromRect.left -= childMatrix.e;
|
|
15995
|
+
}
|
|
15996
|
+
}
|
|
15997
|
+
child.fromRect = fromRect;
|
|
15998
|
+
});
|
|
15999
|
+
},
|
|
16000
|
+
addAnimationState: function addAnimationState(state) {
|
|
16001
|
+
animationStates.push(state);
|
|
16002
|
+
},
|
|
16003
|
+
removeAnimationState: function removeAnimationState(target) {
|
|
16004
|
+
animationStates.splice(indexOfObject(animationStates, {
|
|
16005
|
+
target
|
|
16006
|
+
}), 1);
|
|
16007
|
+
},
|
|
16008
|
+
animateAll: function animateAll(callback) {
|
|
16009
|
+
var _this = this;
|
|
16010
|
+
if (!this.options.animation) {
|
|
16011
|
+
clearTimeout(animationCallbackId);
|
|
16012
|
+
if (typeof callback === "function")
|
|
16013
|
+
callback();
|
|
16014
|
+
return;
|
|
16015
|
+
}
|
|
16016
|
+
var animating = false, animationTime = 0;
|
|
16017
|
+
animationStates.forEach(function(state) {
|
|
16018
|
+
var time = 0, target = state.target, fromRect = target.fromRect, toRect = getRect(target), prevFromRect = target.prevFromRect, prevToRect = target.prevToRect, animatingRect = state.rect, targetMatrix = matrix(target, true);
|
|
16019
|
+
if (targetMatrix) {
|
|
16020
|
+
toRect.top -= targetMatrix.f;
|
|
16021
|
+
toRect.left -= targetMatrix.e;
|
|
16022
|
+
}
|
|
16023
|
+
target.toRect = toRect;
|
|
16024
|
+
if (target.thisAnimationDuration) {
|
|
16025
|
+
if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect
|
|
16026
|
+
(animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
|
|
16027
|
+
time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
|
|
16028
|
+
}
|
|
16029
|
+
}
|
|
16030
|
+
if (!isRectEqual(toRect, fromRect)) {
|
|
16031
|
+
target.prevFromRect = fromRect;
|
|
16032
|
+
target.prevToRect = toRect;
|
|
16033
|
+
if (!time) {
|
|
16034
|
+
time = _this.options.animation;
|
|
16035
|
+
}
|
|
16036
|
+
_this.animate(target, animatingRect, toRect, time);
|
|
16037
|
+
}
|
|
16038
|
+
if (time) {
|
|
16039
|
+
animating = true;
|
|
16040
|
+
animationTime = Math.max(animationTime, time);
|
|
16041
|
+
clearTimeout(target.animationResetTimer);
|
|
16042
|
+
target.animationResetTimer = setTimeout(function() {
|
|
16043
|
+
target.animationTime = 0;
|
|
16044
|
+
target.prevFromRect = null;
|
|
16045
|
+
target.fromRect = null;
|
|
16046
|
+
target.prevToRect = null;
|
|
16047
|
+
target.thisAnimationDuration = null;
|
|
16048
|
+
}, time);
|
|
16049
|
+
target.thisAnimationDuration = time;
|
|
16050
|
+
}
|
|
16051
|
+
});
|
|
16052
|
+
clearTimeout(animationCallbackId);
|
|
16053
|
+
if (!animating) {
|
|
16054
|
+
if (typeof callback === "function")
|
|
16055
|
+
callback();
|
|
16056
|
+
} else {
|
|
16057
|
+
animationCallbackId = setTimeout(function() {
|
|
16058
|
+
if (typeof callback === "function")
|
|
16059
|
+
callback();
|
|
16060
|
+
}, animationTime);
|
|
16061
|
+
}
|
|
16062
|
+
animationStates = [];
|
|
16063
|
+
},
|
|
16064
|
+
animate: function animate(target, currentRect, toRect, duration) {
|
|
16065
|
+
if (duration) {
|
|
16066
|
+
css(target, "transition", "");
|
|
16067
|
+
css(target, "transform", "");
|
|
16068
|
+
var elMatrix = matrix(this.el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d, translateX = (currentRect.left - toRect.left) / (scaleX || 1), translateY = (currentRect.top - toRect.top) / (scaleY || 1);
|
|
16069
|
+
target.animatingX = !!translateX;
|
|
16070
|
+
target.animatingY = !!translateY;
|
|
16071
|
+
css(target, "transform", "translate3d(" + translateX + "px," + translateY + "px,0)");
|
|
16072
|
+
this.forRepaintDummy = repaint(target);
|
|
16073
|
+
css(target, "transition", "transform " + duration + "ms" + (this.options.easing ? " " + this.options.easing : ""));
|
|
16074
|
+
css(target, "transform", "translate3d(0,0,0)");
|
|
16075
|
+
typeof target.animated === "number" && clearTimeout(target.animated);
|
|
16076
|
+
target.animated = setTimeout(function() {
|
|
16077
|
+
css(target, "transition", "");
|
|
16078
|
+
css(target, "transform", "");
|
|
16079
|
+
target.animated = false;
|
|
16080
|
+
target.animatingX = false;
|
|
16081
|
+
target.animatingY = false;
|
|
16082
|
+
}, duration);
|
|
16083
|
+
}
|
|
16084
|
+
}
|
|
16085
|
+
};
|
|
16086
|
+
}
|
|
16087
|
+
function repaint(target) {
|
|
16088
|
+
return target.offsetWidth;
|
|
16089
|
+
}
|
|
16090
|
+
function calculateRealTime(animatingRect, fromRect, toRect, options) {
|
|
16091
|
+
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;
|
|
16092
|
+
}
|
|
16093
|
+
var plugins = [];
|
|
16094
|
+
var defaults = {
|
|
16095
|
+
initializeByDefault: true
|
|
15547
16096
|
};
|
|
15548
|
-
|
|
15549
|
-
|
|
15550
|
-
|
|
15551
|
-
|
|
15552
|
-
|
|
15553
|
-
|
|
15554
|
-
|
|
15555
|
-
|
|
15556
|
-
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
|
|
15561
|
-
maxFileSize: makeNumberProp(FILE_SIZE_LIMIT * 1024),
|
|
15562
|
-
/**
|
|
15563
|
-
* {
|
|
15564
|
-
* maxImageSideLength,
|
|
15565
|
-
* address,
|
|
15566
|
-
* humanName,
|
|
15567
|
-
* projectName,
|
|
15568
|
-
* watermarkConfigString
|
|
15569
|
-
* (http://faq.egova.com.cn:7777/redmine/projects/redmine/wiki/%E6%8B%8D%E7%85%A7%E6%B0%B4%E5%8D%B0%E9%85%8D%E7%BD%AE)
|
|
15570
|
-
* }
|
|
15571
|
-
*/
|
|
15572
|
-
watermarkOptions: {
|
|
15573
|
-
type: Object,
|
|
15574
|
-
default: () => null
|
|
16097
|
+
var PluginManager = {
|
|
16098
|
+
mount: function mount(plugin) {
|
|
16099
|
+
for (var option in defaults) {
|
|
16100
|
+
if (defaults.hasOwnProperty(option) && !(option in plugin)) {
|
|
16101
|
+
plugin[option] = defaults[option];
|
|
16102
|
+
}
|
|
16103
|
+
}
|
|
16104
|
+
plugins.forEach(function(p) {
|
|
16105
|
+
if (p.pluginName === plugin.pluginName) {
|
|
16106
|
+
throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
|
|
16107
|
+
}
|
|
16108
|
+
});
|
|
16109
|
+
plugins.push(plugin);
|
|
15575
16110
|
},
|
|
15576
|
-
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
|
|
15581
|
-
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
|
|
15585
|
-
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15589
|
-
|
|
15590
|
-
|
|
15591
|
-
|
|
15592
|
-
|
|
15593
|
-
|
|
15594
|
-
|
|
15595
|
-
|
|
15596
|
-
|
|
15597
|
-
|
|
15598
|
-
|
|
15599
|
-
|
|
15600
|
-
|
|
15601
|
-
|
|
15602
|
-
|
|
15603
|
-
|
|
15604
|
-
|
|
15605
|
-
|
|
15606
|
-
|
|
15607
|
-
|
|
15608
|
-
|
|
16111
|
+
pluginEvent: function pluginEvent2(eventName, sortable, evt) {
|
|
16112
|
+
var _this = this;
|
|
16113
|
+
this.eventCanceled = false;
|
|
16114
|
+
evt.cancel = function() {
|
|
16115
|
+
_this.eventCanceled = true;
|
|
16116
|
+
};
|
|
16117
|
+
var eventNameGlobal = eventName + "Global";
|
|
16118
|
+
plugins.forEach(function(plugin) {
|
|
16119
|
+
if (!sortable[plugin.pluginName])
|
|
16120
|
+
return;
|
|
16121
|
+
if (sortable[plugin.pluginName][eventNameGlobal]) {
|
|
16122
|
+
sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
|
|
16123
|
+
sortable
|
|
16124
|
+
}, evt));
|
|
16125
|
+
}
|
|
16126
|
+
if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
|
|
16127
|
+
sortable[plugin.pluginName][eventName](_objectSpread2({
|
|
16128
|
+
sortable
|
|
16129
|
+
}, evt));
|
|
16130
|
+
}
|
|
16131
|
+
});
|
|
16132
|
+
},
|
|
16133
|
+
initializePlugins: function initializePlugins(sortable, el, defaults2, options) {
|
|
16134
|
+
plugins.forEach(function(plugin) {
|
|
16135
|
+
var pluginName = plugin.pluginName;
|
|
16136
|
+
if (!sortable.options[pluginName] && !plugin.initializeByDefault)
|
|
16137
|
+
return;
|
|
16138
|
+
var initialized = new plugin(sortable, el, sortable.options);
|
|
16139
|
+
initialized.sortable = sortable;
|
|
16140
|
+
initialized.options = sortable.options;
|
|
16141
|
+
sortable[pluginName] = initialized;
|
|
16142
|
+
_extends$p(defaults2, initialized.defaults);
|
|
16143
|
+
});
|
|
16144
|
+
for (var option in sortable.options) {
|
|
16145
|
+
if (!sortable.options.hasOwnProperty(option))
|
|
16146
|
+
continue;
|
|
16147
|
+
var modified = this.modifyOption(sortable, option, sortable.options[option]);
|
|
16148
|
+
if (typeof modified !== "undefined") {
|
|
16149
|
+
sortable.options[option] = modified;
|
|
16150
|
+
}
|
|
16151
|
+
}
|
|
16152
|
+
},
|
|
16153
|
+
getEventProperties: function getEventProperties(name2, sortable) {
|
|
16154
|
+
var eventProperties = {};
|
|
16155
|
+
plugins.forEach(function(plugin) {
|
|
16156
|
+
if (typeof plugin.eventProperties !== "function")
|
|
16157
|
+
return;
|
|
16158
|
+
_extends$p(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name2));
|
|
16159
|
+
});
|
|
16160
|
+
return eventProperties;
|
|
16161
|
+
},
|
|
16162
|
+
modifyOption: function modifyOption(sortable, name2, value) {
|
|
16163
|
+
var modifiedValue;
|
|
16164
|
+
plugins.forEach(function(plugin) {
|
|
16165
|
+
if (!sortable[plugin.pluginName])
|
|
16166
|
+
return;
|
|
16167
|
+
if (plugin.optionListeners && typeof plugin.optionListeners[name2] === "function") {
|
|
16168
|
+
modifiedValue = plugin.optionListeners[name2].call(sortable[plugin.pluginName], value);
|
|
16169
|
+
}
|
|
16170
|
+
});
|
|
16171
|
+
return modifiedValue;
|
|
16172
|
+
}
|
|
16173
|
+
};
|
|
16174
|
+
function dispatchEvent(_ref) {
|
|
16175
|
+
var sortable = _ref.sortable, rootEl2 = _ref.rootEl, name2 = _ref.name, targetEl = _ref.targetEl, cloneEl2 = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex2 = _ref.oldIndex, newIndex2 = _ref.newIndex, oldDraggableIndex2 = _ref.oldDraggableIndex, newDraggableIndex2 = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable2 = _ref.putSortable, extraEventProperties = _ref.extraEventProperties;
|
|
16176
|
+
sortable = sortable || rootEl2 && rootEl2[expando];
|
|
16177
|
+
if (!sortable)
|
|
16178
|
+
return;
|
|
16179
|
+
var evt, options = sortable.options, onName = "on" + name2.charAt(0).toUpperCase() + name2.substr(1);
|
|
16180
|
+
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
|
16181
|
+
evt = new CustomEvent(name2, {
|
|
16182
|
+
bubbles: true,
|
|
16183
|
+
cancelable: true
|
|
16184
|
+
});
|
|
16185
|
+
} else {
|
|
16186
|
+
evt = document.createEvent("Event");
|
|
16187
|
+
evt.initEvent(name2, true, true);
|
|
16188
|
+
}
|
|
16189
|
+
evt.to = toEl || rootEl2;
|
|
16190
|
+
evt.from = fromEl || rootEl2;
|
|
16191
|
+
evt.item = targetEl || rootEl2;
|
|
16192
|
+
evt.clone = cloneEl2;
|
|
16193
|
+
evt.oldIndex = oldIndex2;
|
|
16194
|
+
evt.newIndex = newIndex2;
|
|
16195
|
+
evt.oldDraggableIndex = oldDraggableIndex2;
|
|
16196
|
+
evt.newDraggableIndex = newDraggableIndex2;
|
|
16197
|
+
evt.originalEvent = originalEvent;
|
|
16198
|
+
evt.pullMode = putSortable2 ? putSortable2.lastPutMode : void 0;
|
|
16199
|
+
var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name2, sortable));
|
|
16200
|
+
for (var option in allEventProperties) {
|
|
16201
|
+
evt[option] = allEventProperties[option];
|
|
16202
|
+
}
|
|
16203
|
+
if (rootEl2) {
|
|
16204
|
+
rootEl2.dispatchEvent(evt);
|
|
16205
|
+
}
|
|
16206
|
+
if (options[onName]) {
|
|
16207
|
+
options[onName].call(sortable, evt);
|
|
16208
|
+
}
|
|
16209
|
+
}
|
|
16210
|
+
var _excluded$2 = ["evt"];
|
|
16211
|
+
var pluginEvent = function pluginEvent2(eventName, sortable) {
|
|
16212
|
+
var _ref = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, originalEvent = _ref.evt, data = _objectWithoutProperties(_ref, _excluded$2);
|
|
16213
|
+
PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
|
|
16214
|
+
dragEl,
|
|
16215
|
+
parentEl,
|
|
16216
|
+
ghostEl,
|
|
16217
|
+
rootEl,
|
|
16218
|
+
nextEl,
|
|
16219
|
+
lastDownEl,
|
|
16220
|
+
cloneEl,
|
|
16221
|
+
cloneHidden,
|
|
16222
|
+
dragStarted: moved,
|
|
16223
|
+
putSortable,
|
|
16224
|
+
activeSortable: Sortable.active,
|
|
16225
|
+
originalEvent,
|
|
16226
|
+
oldIndex,
|
|
16227
|
+
oldDraggableIndex,
|
|
16228
|
+
newIndex,
|
|
16229
|
+
newDraggableIndex,
|
|
16230
|
+
hideGhostForTarget: _hideGhostForTarget,
|
|
16231
|
+
unhideGhostForTarget: _unhideGhostForTarget,
|
|
16232
|
+
cloneNowHidden: function cloneNowHidden() {
|
|
16233
|
+
cloneHidden = true;
|
|
16234
|
+
},
|
|
16235
|
+
cloneNowShown: function cloneNowShown() {
|
|
16236
|
+
cloneHidden = false;
|
|
16237
|
+
},
|
|
16238
|
+
dispatchSortableEvent: function dispatchSortableEvent(name2) {
|
|
16239
|
+
_dispatchEvent({
|
|
16240
|
+
sortable,
|
|
16241
|
+
name: name2,
|
|
16242
|
+
originalEvent
|
|
16243
|
+
});
|
|
16244
|
+
}
|
|
16245
|
+
}, data));
|
|
16246
|
+
};
|
|
16247
|
+
function _dispatchEvent(info) {
|
|
16248
|
+
dispatchEvent(_objectSpread2({
|
|
16249
|
+
putSortable,
|
|
16250
|
+
cloneEl,
|
|
16251
|
+
targetEl: dragEl,
|
|
16252
|
+
rootEl,
|
|
16253
|
+
oldIndex,
|
|
16254
|
+
oldDraggableIndex,
|
|
16255
|
+
newIndex,
|
|
16256
|
+
newDraggableIndex
|
|
16257
|
+
}, info));
|
|
16258
|
+
}
|
|
16259
|
+
var dragEl, parentEl, ghostEl, rootEl, nextEl, lastDownEl, cloneEl, cloneHidden, oldIndex, newIndex, oldDraggableIndex, newDraggableIndex, activeGroup, putSortable, awaitingDragStarted = false, ignoreNextClick = false, sortables = [], tapEvt, touchEvt, lastDx, lastDy, tapDistanceLeft, tapDistanceTop, moved, lastTarget, lastDirection, pastFirstInvertThresh = false, isCircumstantialInvert = false, targetMoveDistance, ghostRelativeParent, ghostRelativeParentInitialScroll = [], _silent = false, savedInputChecked = [];
|
|
16260
|
+
var documentExists = typeof document !== "undefined", PositionGhostAbsolutely = IOS, CSSFloatProperty = Edge || IE11OrLess ? "cssFloat" : "float", supportDraggable = documentExists && !ChromeForAndroid && !IOS && "draggable" in document.createElement("div"), supportCssPointerEvents = function() {
|
|
16261
|
+
if (!documentExists)
|
|
16262
|
+
return;
|
|
16263
|
+
if (IE11OrLess) {
|
|
16264
|
+
return false;
|
|
16265
|
+
}
|
|
16266
|
+
var el = document.createElement("x");
|
|
16267
|
+
el.style.cssText = "pointer-events:auto";
|
|
16268
|
+
return el.style.pointerEvents === "auto";
|
|
16269
|
+
}(), _detectDirection = function _detectDirection2(el, options) {
|
|
16270
|
+
var elCSS = css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = getChild(el, 0, options), child2 = getChild(el, 1, options), firstChildCSS = child1 && css(child1), secondChildCSS = child2 && css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
|
|
16271
|
+
if (elCSS.display === "flex") {
|
|
16272
|
+
return elCSS.flexDirection === "column" || elCSS.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
16273
|
+
}
|
|
16274
|
+
if (elCSS.display === "grid") {
|
|
16275
|
+
return elCSS.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
16276
|
+
}
|
|
16277
|
+
if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== "none") {
|
|
16278
|
+
var touchingSideChild2 = firstChildCSS["float"] === "left" ? "left" : "right";
|
|
16279
|
+
return child2 && (secondChildCSS.clear === "both" || secondChildCSS.clear === touchingSideChild2) ? "vertical" : "horizontal";
|
|
16280
|
+
}
|
|
16281
|
+
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";
|
|
16282
|
+
}, _dragElInRowColumn = function _dragElInRowColumn2(dragRect, targetRect, vertical) {
|
|
16283
|
+
var dragElS1Opp = vertical ? dragRect.left : dragRect.top, dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, dragElOppLength = vertical ? dragRect.width : dragRect.height, targetS1Opp = vertical ? targetRect.left : targetRect.top, targetS2Opp = vertical ? targetRect.right : targetRect.bottom, targetOppLength = vertical ? targetRect.width : targetRect.height;
|
|
16284
|
+
return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
|
|
16285
|
+
}, _detectNearestEmptySortable = function _detectNearestEmptySortable2(x, y) {
|
|
16286
|
+
var ret;
|
|
16287
|
+
sortables.some(function(sortable) {
|
|
16288
|
+
var threshold = sortable[expando].options.emptyInsertThreshold;
|
|
16289
|
+
if (!threshold || lastChild(sortable))
|
|
16290
|
+
return;
|
|
16291
|
+
var rect = getRect(sortable), insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
|
|
16292
|
+
if (insideHorizontally && insideVertically) {
|
|
16293
|
+
return ret = sortable;
|
|
16294
|
+
}
|
|
16295
|
+
});
|
|
16296
|
+
return ret;
|
|
16297
|
+
}, _prepareGroup = function _prepareGroup2(options) {
|
|
16298
|
+
function toFn(value, pull) {
|
|
16299
|
+
return function(to, from, dragEl2, evt) {
|
|
16300
|
+
var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
|
|
16301
|
+
if (value == null && (pull || sameGroup)) {
|
|
16302
|
+
return true;
|
|
16303
|
+
} else if (value == null || value === false) {
|
|
16304
|
+
return false;
|
|
16305
|
+
} else if (pull && value === "clone") {
|
|
16306
|
+
return value;
|
|
16307
|
+
} else if (typeof value === "function") {
|
|
16308
|
+
return toFn(value(to, from, dragEl2, evt), pull)(to, from, dragEl2, evt);
|
|
16309
|
+
} else {
|
|
16310
|
+
var otherGroup = (pull ? to : from).options.group.name;
|
|
16311
|
+
return value === true || typeof value === "string" && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
|
|
16312
|
+
}
|
|
16313
|
+
};
|
|
16314
|
+
}
|
|
16315
|
+
var group = {};
|
|
16316
|
+
var originalGroup = options.group;
|
|
16317
|
+
if (!originalGroup || _typeof(originalGroup) != "object") {
|
|
16318
|
+
originalGroup = {
|
|
16319
|
+
name: originalGroup
|
|
16320
|
+
};
|
|
16321
|
+
}
|
|
16322
|
+
group.name = originalGroup.name;
|
|
16323
|
+
group.checkPull = toFn(originalGroup.pull, true);
|
|
16324
|
+
group.checkPut = toFn(originalGroup.put);
|
|
16325
|
+
group.revertClone = originalGroup.revertClone;
|
|
16326
|
+
options.group = group;
|
|
16327
|
+
}, _hideGhostForTarget = function _hideGhostForTarget2() {
|
|
16328
|
+
if (!supportCssPointerEvents && ghostEl) {
|
|
16329
|
+
css(ghostEl, "display", "none");
|
|
16330
|
+
}
|
|
16331
|
+
}, _unhideGhostForTarget = function _unhideGhostForTarget2() {
|
|
16332
|
+
if (!supportCssPointerEvents && ghostEl) {
|
|
16333
|
+
css(ghostEl, "display", "");
|
|
16334
|
+
}
|
|
16335
|
+
};
|
|
16336
|
+
if (documentExists && !ChromeForAndroid) {
|
|
16337
|
+
document.addEventListener("click", function(evt) {
|
|
16338
|
+
if (ignoreNextClick) {
|
|
16339
|
+
evt.preventDefault();
|
|
16340
|
+
evt.stopPropagation && evt.stopPropagation();
|
|
16341
|
+
evt.stopImmediatePropagation && evt.stopImmediatePropagation();
|
|
16342
|
+
ignoreNextClick = false;
|
|
16343
|
+
return false;
|
|
16344
|
+
}
|
|
16345
|
+
}, true);
|
|
16346
|
+
}
|
|
16347
|
+
var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent2(evt) {
|
|
16348
|
+
if (dragEl) {
|
|
16349
|
+
evt = evt.touches ? evt.touches[0] : evt;
|
|
16350
|
+
var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
|
|
16351
|
+
if (nearest) {
|
|
16352
|
+
var event = {};
|
|
16353
|
+
for (var i in evt) {
|
|
16354
|
+
if (evt.hasOwnProperty(i)) {
|
|
16355
|
+
event[i] = evt[i];
|
|
16356
|
+
}
|
|
16357
|
+
}
|
|
16358
|
+
event.target = event.rootEl = nearest;
|
|
16359
|
+
event.preventDefault = void 0;
|
|
16360
|
+
event.stopPropagation = void 0;
|
|
16361
|
+
nearest[expando]._onDragOver(event);
|
|
16362
|
+
}
|
|
16363
|
+
}
|
|
16364
|
+
};
|
|
16365
|
+
var _checkOutsideTargetEl = function _checkOutsideTargetEl2(evt) {
|
|
16366
|
+
if (dragEl) {
|
|
16367
|
+
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
|
16368
|
+
}
|
|
16369
|
+
};
|
|
16370
|
+
function Sortable(el, options) {
|
|
16371
|
+
if (!(el && el.nodeType && el.nodeType === 1)) {
|
|
16372
|
+
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
|
|
16373
|
+
}
|
|
16374
|
+
this.el = el;
|
|
16375
|
+
this.options = options = _extends$p({}, options);
|
|
16376
|
+
el[expando] = this;
|
|
16377
|
+
var defaults2 = {
|
|
16378
|
+
group: null,
|
|
16379
|
+
sort: true,
|
|
16380
|
+
disabled: false,
|
|
16381
|
+
store: null,
|
|
16382
|
+
handle: null,
|
|
16383
|
+
draggable: /^[uo]l$/i.test(el.nodeName) ? ">li" : ">*",
|
|
16384
|
+
swapThreshold: 1,
|
|
16385
|
+
// percentage; 0 <= x <= 1
|
|
16386
|
+
invertSwap: false,
|
|
16387
|
+
// invert always
|
|
16388
|
+
invertedSwapThreshold: null,
|
|
16389
|
+
// will be set to same as swapThreshold if default
|
|
16390
|
+
removeCloneOnHide: true,
|
|
16391
|
+
direction: function direction() {
|
|
16392
|
+
return _detectDirection(el, this.options);
|
|
16393
|
+
},
|
|
16394
|
+
ghostClass: "sortable-ghost",
|
|
16395
|
+
chosenClass: "sortable-chosen",
|
|
16396
|
+
dragClass: "sortable-drag",
|
|
16397
|
+
ignore: "a, img",
|
|
16398
|
+
filter: null,
|
|
16399
|
+
preventOnFilter: true,
|
|
16400
|
+
animation: 0,
|
|
16401
|
+
easing: null,
|
|
16402
|
+
setData: function setData(dataTransfer, dragEl2) {
|
|
16403
|
+
dataTransfer.setData("Text", dragEl2.textContent);
|
|
16404
|
+
},
|
|
16405
|
+
dropBubble: false,
|
|
16406
|
+
dragoverBubble: false,
|
|
16407
|
+
dataIdAttr: "data-id",
|
|
16408
|
+
delay: 0,
|
|
16409
|
+
delayOnTouchOnly: false,
|
|
16410
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
16411
|
+
forceFallback: false,
|
|
16412
|
+
fallbackClass: "sortable-fallback",
|
|
16413
|
+
fallbackOnBody: false,
|
|
16414
|
+
fallbackTolerance: 0,
|
|
16415
|
+
fallbackOffset: {
|
|
16416
|
+
x: 0,
|
|
16417
|
+
y: 0
|
|
16418
|
+
},
|
|
16419
|
+
// Disabled on Safari: #1571; Enabled on Safari IOS: #2244
|
|
16420
|
+
supportPointer: Sortable.supportPointer !== false && "PointerEvent" in window && (!Safari || IOS),
|
|
16421
|
+
emptyInsertThreshold: 5
|
|
16422
|
+
};
|
|
16423
|
+
PluginManager.initializePlugins(this, el, defaults2);
|
|
16424
|
+
for (var name2 in defaults2) {
|
|
16425
|
+
!(name2 in options) && (options[name2] = defaults2[name2]);
|
|
16426
|
+
}
|
|
16427
|
+
_prepareGroup(options);
|
|
16428
|
+
for (var fn in this) {
|
|
16429
|
+
if (fn.charAt(0) === "_" && typeof this[fn] === "function") {
|
|
16430
|
+
this[fn] = this[fn].bind(this);
|
|
16431
|
+
}
|
|
16432
|
+
}
|
|
16433
|
+
this.nativeDraggable = options.forceFallback ? false : supportDraggable;
|
|
16434
|
+
if (this.nativeDraggable) {
|
|
16435
|
+
this.options.touchStartThreshold = 1;
|
|
16436
|
+
}
|
|
16437
|
+
if (options.supportPointer) {
|
|
16438
|
+
on$1(el, "pointerdown", this._onTapStart);
|
|
16439
|
+
} else {
|
|
16440
|
+
on$1(el, "mousedown", this._onTapStart);
|
|
16441
|
+
on$1(el, "touchstart", this._onTapStart);
|
|
16442
|
+
}
|
|
16443
|
+
if (this.nativeDraggable) {
|
|
16444
|
+
on$1(el, "dragover", this);
|
|
16445
|
+
on$1(el, "dragenter", this);
|
|
16446
|
+
}
|
|
16447
|
+
sortables.push(this.el);
|
|
16448
|
+
options.store && options.store.get && this.sort(options.store.get(this) || []);
|
|
16449
|
+
_extends$p(this, AnimationStateManager());
|
|
16450
|
+
}
|
|
16451
|
+
Sortable.prototype = /** @lends Sortable.prototype */
|
|
16452
|
+
{
|
|
16453
|
+
constructor: Sortable,
|
|
16454
|
+
_isOutsideThisEl: function _isOutsideThisEl(target) {
|
|
16455
|
+
if (!this.el.contains(target) && target !== this.el) {
|
|
16456
|
+
lastTarget = null;
|
|
16457
|
+
}
|
|
16458
|
+
},
|
|
16459
|
+
_getDirection: function _getDirection(evt, target) {
|
|
16460
|
+
return typeof this.options.direction === "function" ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
|
|
16461
|
+
},
|
|
16462
|
+
_onTapStart: function _onTapStart(evt) {
|
|
16463
|
+
if (!evt.cancelable)
|
|
16464
|
+
return;
|
|
16465
|
+
var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === "touch" && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter;
|
|
16466
|
+
_saveInputCheckedState(el);
|
|
16467
|
+
if (dragEl) {
|
|
16468
|
+
return;
|
|
16469
|
+
}
|
|
16470
|
+
if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
|
|
16471
|
+
return;
|
|
16472
|
+
}
|
|
16473
|
+
if (originalTarget.isContentEditable) {
|
|
16474
|
+
return;
|
|
16475
|
+
}
|
|
16476
|
+
if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === "SELECT") {
|
|
16477
|
+
return;
|
|
16478
|
+
}
|
|
16479
|
+
target = closest(target, options.draggable, el, false);
|
|
16480
|
+
if (target && target.animated) {
|
|
16481
|
+
return;
|
|
16482
|
+
}
|
|
16483
|
+
if (lastDownEl === target) {
|
|
16484
|
+
return;
|
|
16485
|
+
}
|
|
16486
|
+
oldIndex = index$1(target);
|
|
16487
|
+
oldDraggableIndex = index$1(target, options.draggable);
|
|
16488
|
+
if (typeof filter === "function") {
|
|
16489
|
+
if (filter.call(this, evt, target, this)) {
|
|
16490
|
+
_dispatchEvent({
|
|
16491
|
+
sortable: _this,
|
|
16492
|
+
rootEl: originalTarget,
|
|
16493
|
+
name: "filter",
|
|
16494
|
+
targetEl: target,
|
|
16495
|
+
toEl: el,
|
|
16496
|
+
fromEl: el
|
|
16497
|
+
});
|
|
16498
|
+
pluginEvent("filter", _this, {
|
|
16499
|
+
evt
|
|
16500
|
+
});
|
|
16501
|
+
preventOnFilter && evt.preventDefault();
|
|
16502
|
+
return;
|
|
16503
|
+
}
|
|
16504
|
+
} else if (filter) {
|
|
16505
|
+
filter = filter.split(",").some(function(criteria) {
|
|
16506
|
+
criteria = closest(originalTarget, criteria.trim(), el, false);
|
|
16507
|
+
if (criteria) {
|
|
16508
|
+
_dispatchEvent({
|
|
16509
|
+
sortable: _this,
|
|
16510
|
+
rootEl: criteria,
|
|
16511
|
+
name: "filter",
|
|
16512
|
+
targetEl: target,
|
|
16513
|
+
fromEl: el,
|
|
16514
|
+
toEl: el
|
|
16515
|
+
});
|
|
16516
|
+
pluginEvent("filter", _this, {
|
|
16517
|
+
evt
|
|
16518
|
+
});
|
|
16519
|
+
return true;
|
|
16520
|
+
}
|
|
16521
|
+
});
|
|
16522
|
+
if (filter) {
|
|
16523
|
+
preventOnFilter && evt.preventDefault();
|
|
16524
|
+
return;
|
|
16525
|
+
}
|
|
16526
|
+
}
|
|
16527
|
+
if (options.handle && !closest(originalTarget, options.handle, el, false)) {
|
|
16528
|
+
return;
|
|
16529
|
+
}
|
|
16530
|
+
this._prepareDragStart(evt, touch, target);
|
|
16531
|
+
},
|
|
16532
|
+
_prepareDragStart: function _prepareDragStart(evt, touch, target) {
|
|
16533
|
+
var _this = this, el = _this.el, options = _this.options, ownerDocument = el.ownerDocument, dragStartFn;
|
|
16534
|
+
if (target && !dragEl && target.parentNode === el) {
|
|
16535
|
+
var dragRect = getRect(target);
|
|
16536
|
+
rootEl = el;
|
|
16537
|
+
dragEl = target;
|
|
16538
|
+
parentEl = dragEl.parentNode;
|
|
16539
|
+
nextEl = dragEl.nextSibling;
|
|
16540
|
+
lastDownEl = target;
|
|
16541
|
+
activeGroup = options.group;
|
|
16542
|
+
Sortable.dragged = dragEl;
|
|
16543
|
+
tapEvt = {
|
|
16544
|
+
target: dragEl,
|
|
16545
|
+
clientX: (touch || evt).clientX,
|
|
16546
|
+
clientY: (touch || evt).clientY
|
|
16547
|
+
};
|
|
16548
|
+
tapDistanceLeft = tapEvt.clientX - dragRect.left;
|
|
16549
|
+
tapDistanceTop = tapEvt.clientY - dragRect.top;
|
|
16550
|
+
this._lastX = (touch || evt).clientX;
|
|
16551
|
+
this._lastY = (touch || evt).clientY;
|
|
16552
|
+
dragEl.style["will-change"] = "all";
|
|
16553
|
+
dragStartFn = function dragStartFn2() {
|
|
16554
|
+
pluginEvent("delayEnded", _this, {
|
|
16555
|
+
evt
|
|
16556
|
+
});
|
|
16557
|
+
if (Sortable.eventCanceled) {
|
|
16558
|
+
_this._onDrop();
|
|
16559
|
+
return;
|
|
16560
|
+
}
|
|
16561
|
+
_this._disableDelayedDragEvents();
|
|
16562
|
+
if (!FireFox && _this.nativeDraggable) {
|
|
16563
|
+
dragEl.draggable = true;
|
|
16564
|
+
}
|
|
16565
|
+
_this._triggerDragStart(evt, touch);
|
|
16566
|
+
_dispatchEvent({
|
|
16567
|
+
sortable: _this,
|
|
16568
|
+
name: "choose",
|
|
16569
|
+
originalEvent: evt
|
|
16570
|
+
});
|
|
16571
|
+
toggleClass(dragEl, options.chosenClass, true);
|
|
16572
|
+
};
|
|
16573
|
+
options.ignore.split(",").forEach(function(criteria) {
|
|
16574
|
+
find(dragEl, criteria.trim(), _disableDraggable);
|
|
16575
|
+
});
|
|
16576
|
+
on$1(ownerDocument, "dragover", nearestEmptyInsertDetectEvent);
|
|
16577
|
+
on$1(ownerDocument, "mousemove", nearestEmptyInsertDetectEvent);
|
|
16578
|
+
on$1(ownerDocument, "touchmove", nearestEmptyInsertDetectEvent);
|
|
16579
|
+
if (options.supportPointer) {
|
|
16580
|
+
on$1(ownerDocument, "pointerup", _this._onDrop);
|
|
16581
|
+
!this.nativeDraggable && on$1(ownerDocument, "pointercancel", _this._onDrop);
|
|
16582
|
+
} else {
|
|
16583
|
+
on$1(ownerDocument, "mouseup", _this._onDrop);
|
|
16584
|
+
on$1(ownerDocument, "touchend", _this._onDrop);
|
|
16585
|
+
on$1(ownerDocument, "touchcancel", _this._onDrop);
|
|
16586
|
+
}
|
|
16587
|
+
if (FireFox && this.nativeDraggable) {
|
|
16588
|
+
this.options.touchStartThreshold = 4;
|
|
16589
|
+
dragEl.draggable = true;
|
|
16590
|
+
}
|
|
16591
|
+
pluginEvent("delayStart", this, {
|
|
16592
|
+
evt
|
|
16593
|
+
});
|
|
16594
|
+
if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
|
|
16595
|
+
if (Sortable.eventCanceled) {
|
|
16596
|
+
this._onDrop();
|
|
16597
|
+
return;
|
|
16598
|
+
}
|
|
16599
|
+
if (options.supportPointer) {
|
|
16600
|
+
on$1(ownerDocument, "pointerup", _this._disableDelayedDrag);
|
|
16601
|
+
on$1(ownerDocument, "pointercancel", _this._disableDelayedDrag);
|
|
16602
|
+
} else {
|
|
16603
|
+
on$1(ownerDocument, "mouseup", _this._disableDelayedDrag);
|
|
16604
|
+
on$1(ownerDocument, "touchend", _this._disableDelayedDrag);
|
|
16605
|
+
on$1(ownerDocument, "touchcancel", _this._disableDelayedDrag);
|
|
16606
|
+
}
|
|
16607
|
+
on$1(ownerDocument, "mousemove", _this._delayedDragTouchMoveHandler);
|
|
16608
|
+
on$1(ownerDocument, "touchmove", _this._delayedDragTouchMoveHandler);
|
|
16609
|
+
options.supportPointer && on$1(ownerDocument, "pointermove", _this._delayedDragTouchMoveHandler);
|
|
16610
|
+
_this._dragStartTimer = setTimeout(dragStartFn, options.delay);
|
|
16611
|
+
} else {
|
|
16612
|
+
dragStartFn();
|
|
16613
|
+
}
|
|
16614
|
+
}
|
|
16615
|
+
},
|
|
16616
|
+
_delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(e) {
|
|
16617
|
+
var touch = e.touches ? e.touches[0] : e;
|
|
16618
|
+
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))) {
|
|
16619
|
+
this._disableDelayedDrag();
|
|
16620
|
+
}
|
|
16621
|
+
},
|
|
16622
|
+
_disableDelayedDrag: function _disableDelayedDrag() {
|
|
16623
|
+
dragEl && _disableDraggable(dragEl);
|
|
16624
|
+
clearTimeout(this._dragStartTimer);
|
|
16625
|
+
this._disableDelayedDragEvents();
|
|
16626
|
+
},
|
|
16627
|
+
_disableDelayedDragEvents: function _disableDelayedDragEvents() {
|
|
16628
|
+
var ownerDocument = this.el.ownerDocument;
|
|
16629
|
+
off$1(ownerDocument, "mouseup", this._disableDelayedDrag);
|
|
16630
|
+
off$1(ownerDocument, "touchend", this._disableDelayedDrag);
|
|
16631
|
+
off$1(ownerDocument, "touchcancel", this._disableDelayedDrag);
|
|
16632
|
+
off$1(ownerDocument, "pointerup", this._disableDelayedDrag);
|
|
16633
|
+
off$1(ownerDocument, "pointercancel", this._disableDelayedDrag);
|
|
16634
|
+
off$1(ownerDocument, "mousemove", this._delayedDragTouchMoveHandler);
|
|
16635
|
+
off$1(ownerDocument, "touchmove", this._delayedDragTouchMoveHandler);
|
|
16636
|
+
off$1(ownerDocument, "pointermove", this._delayedDragTouchMoveHandler);
|
|
16637
|
+
},
|
|
16638
|
+
_triggerDragStart: function _triggerDragStart(evt, touch) {
|
|
16639
|
+
touch = touch || evt.pointerType == "touch" && evt;
|
|
16640
|
+
if (!this.nativeDraggable || touch) {
|
|
16641
|
+
if (this.options.supportPointer) {
|
|
16642
|
+
on$1(document, "pointermove", this._onTouchMove);
|
|
16643
|
+
} else if (touch) {
|
|
16644
|
+
on$1(document, "touchmove", this._onTouchMove);
|
|
16645
|
+
} else {
|
|
16646
|
+
on$1(document, "mousemove", this._onTouchMove);
|
|
16647
|
+
}
|
|
16648
|
+
} else {
|
|
16649
|
+
on$1(dragEl, "dragend", this);
|
|
16650
|
+
on$1(rootEl, "dragstart", this._onDragStart);
|
|
16651
|
+
}
|
|
16652
|
+
try {
|
|
16653
|
+
if (document.selection) {
|
|
16654
|
+
_nextTick(function() {
|
|
16655
|
+
document.selection.empty();
|
|
16656
|
+
});
|
|
16657
|
+
} else {
|
|
16658
|
+
window.getSelection().removeAllRanges();
|
|
16659
|
+
}
|
|
16660
|
+
} catch (err) {
|
|
16661
|
+
}
|
|
16662
|
+
},
|
|
16663
|
+
_dragStarted: function _dragStarted(fallback, evt) {
|
|
16664
|
+
awaitingDragStarted = false;
|
|
16665
|
+
if (rootEl && dragEl) {
|
|
16666
|
+
pluginEvent("dragStarted", this, {
|
|
16667
|
+
evt
|
|
16668
|
+
});
|
|
16669
|
+
if (this.nativeDraggable) {
|
|
16670
|
+
on$1(document, "dragover", _checkOutsideTargetEl);
|
|
16671
|
+
}
|
|
16672
|
+
var options = this.options;
|
|
16673
|
+
!fallback && toggleClass(dragEl, options.dragClass, false);
|
|
16674
|
+
toggleClass(dragEl, options.ghostClass, true);
|
|
16675
|
+
Sortable.active = this;
|
|
16676
|
+
fallback && this._appendGhost();
|
|
16677
|
+
_dispatchEvent({
|
|
16678
|
+
sortable: this,
|
|
16679
|
+
name: "start",
|
|
16680
|
+
originalEvent: evt
|
|
16681
|
+
});
|
|
16682
|
+
} else {
|
|
16683
|
+
this._nulling();
|
|
16684
|
+
}
|
|
16685
|
+
},
|
|
16686
|
+
_emulateDragOver: function _emulateDragOver() {
|
|
16687
|
+
if (touchEvt) {
|
|
16688
|
+
this._lastX = touchEvt.clientX;
|
|
16689
|
+
this._lastY = touchEvt.clientY;
|
|
16690
|
+
_hideGhostForTarget();
|
|
16691
|
+
var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
|
16692
|
+
var parent = target;
|
|
16693
|
+
while (target && target.shadowRoot) {
|
|
16694
|
+
target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
|
16695
|
+
if (target === parent)
|
|
16696
|
+
break;
|
|
16697
|
+
parent = target;
|
|
16698
|
+
}
|
|
16699
|
+
dragEl.parentNode[expando]._isOutsideThisEl(target);
|
|
16700
|
+
if (parent) {
|
|
16701
|
+
do {
|
|
16702
|
+
if (parent[expando]) {
|
|
16703
|
+
var inserted = void 0;
|
|
16704
|
+
inserted = parent[expando]._onDragOver({
|
|
16705
|
+
clientX: touchEvt.clientX,
|
|
16706
|
+
clientY: touchEvt.clientY,
|
|
16707
|
+
target,
|
|
16708
|
+
rootEl: parent
|
|
16709
|
+
});
|
|
16710
|
+
if (inserted && !this.options.dragoverBubble) {
|
|
16711
|
+
break;
|
|
16712
|
+
}
|
|
16713
|
+
}
|
|
16714
|
+
target = parent;
|
|
16715
|
+
} while (parent = getParentOrHost(parent));
|
|
16716
|
+
}
|
|
16717
|
+
_unhideGhostForTarget();
|
|
16718
|
+
}
|
|
16719
|
+
},
|
|
16720
|
+
_onTouchMove: function _onTouchMove(evt) {
|
|
16721
|
+
if (tapEvt) {
|
|
16722
|
+
var options = this.options, fallbackTolerance = options.fallbackTolerance, fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, ghostMatrix = ghostEl && matrix(ghostEl, true), scaleX = ghostEl && ghostMatrix && ghostMatrix.a, scaleY = ghostEl && ghostMatrix && ghostMatrix.d, relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent), dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
|
|
16723
|
+
if (!Sortable.active && !awaitingDragStarted) {
|
|
16724
|
+
if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
|
|
16725
|
+
return;
|
|
16726
|
+
}
|
|
16727
|
+
this._onDragStart(evt, true);
|
|
16728
|
+
}
|
|
16729
|
+
if (ghostEl) {
|
|
16730
|
+
if (ghostMatrix) {
|
|
16731
|
+
ghostMatrix.e += dx - (lastDx || 0);
|
|
16732
|
+
ghostMatrix.f += dy - (lastDy || 0);
|
|
16733
|
+
} else {
|
|
16734
|
+
ghostMatrix = {
|
|
16735
|
+
a: 1,
|
|
16736
|
+
b: 0,
|
|
16737
|
+
c: 0,
|
|
16738
|
+
d: 1,
|
|
16739
|
+
e: dx,
|
|
16740
|
+
f: dy
|
|
16741
|
+
};
|
|
16742
|
+
}
|
|
16743
|
+
var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
|
|
16744
|
+
css(ghostEl, "webkitTransform", cssMatrix);
|
|
16745
|
+
css(ghostEl, "mozTransform", cssMatrix);
|
|
16746
|
+
css(ghostEl, "msTransform", cssMatrix);
|
|
16747
|
+
css(ghostEl, "transform", cssMatrix);
|
|
16748
|
+
lastDx = dx;
|
|
16749
|
+
lastDy = dy;
|
|
16750
|
+
touchEvt = touch;
|
|
16751
|
+
}
|
|
16752
|
+
evt.cancelable && evt.preventDefault();
|
|
16753
|
+
}
|
|
16754
|
+
},
|
|
16755
|
+
_appendGhost: function _appendGhost() {
|
|
16756
|
+
if (!ghostEl) {
|
|
16757
|
+
var container = this.options.fallbackOnBody ? document.body : rootEl, rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container), options = this.options;
|
|
16758
|
+
if (PositionGhostAbsolutely) {
|
|
16759
|
+
ghostRelativeParent = container;
|
|
16760
|
+
while (css(ghostRelativeParent, "position") === "static" && css(ghostRelativeParent, "transform") === "none" && ghostRelativeParent !== document) {
|
|
16761
|
+
ghostRelativeParent = ghostRelativeParent.parentNode;
|
|
16762
|
+
}
|
|
16763
|
+
if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
|
|
16764
|
+
if (ghostRelativeParent === document)
|
|
16765
|
+
ghostRelativeParent = getWindowScrollingElement();
|
|
16766
|
+
rect.top += ghostRelativeParent.scrollTop;
|
|
16767
|
+
rect.left += ghostRelativeParent.scrollLeft;
|
|
16768
|
+
} else {
|
|
16769
|
+
ghostRelativeParent = getWindowScrollingElement();
|
|
16770
|
+
}
|
|
16771
|
+
ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
|
|
16772
|
+
}
|
|
16773
|
+
ghostEl = dragEl.cloneNode(true);
|
|
16774
|
+
toggleClass(ghostEl, options.ghostClass, false);
|
|
16775
|
+
toggleClass(ghostEl, options.fallbackClass, true);
|
|
16776
|
+
toggleClass(ghostEl, options.dragClass, true);
|
|
16777
|
+
css(ghostEl, "transition", "");
|
|
16778
|
+
css(ghostEl, "transform", "");
|
|
16779
|
+
css(ghostEl, "box-sizing", "border-box");
|
|
16780
|
+
css(ghostEl, "margin", 0);
|
|
16781
|
+
css(ghostEl, "top", rect.top);
|
|
16782
|
+
css(ghostEl, "left", rect.left);
|
|
16783
|
+
css(ghostEl, "width", rect.width);
|
|
16784
|
+
css(ghostEl, "height", rect.height);
|
|
16785
|
+
css(ghostEl, "opacity", "0.8");
|
|
16786
|
+
css(ghostEl, "position", PositionGhostAbsolutely ? "absolute" : "fixed");
|
|
16787
|
+
css(ghostEl, "zIndex", "100000");
|
|
16788
|
+
css(ghostEl, "pointerEvents", "none");
|
|
16789
|
+
Sortable.ghost = ghostEl;
|
|
16790
|
+
container.appendChild(ghostEl);
|
|
16791
|
+
css(ghostEl, "transform-origin", tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + "% " + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + "%");
|
|
16792
|
+
}
|
|
16793
|
+
},
|
|
16794
|
+
_onDragStart: function _onDragStart(evt, fallback) {
|
|
16795
|
+
var _this = this;
|
|
16796
|
+
var dataTransfer = evt.dataTransfer;
|
|
16797
|
+
var options = _this.options;
|
|
16798
|
+
pluginEvent("dragStart", this, {
|
|
16799
|
+
evt
|
|
16800
|
+
});
|
|
16801
|
+
if (Sortable.eventCanceled) {
|
|
16802
|
+
this._onDrop();
|
|
16803
|
+
return;
|
|
16804
|
+
}
|
|
16805
|
+
pluginEvent("setupClone", this);
|
|
16806
|
+
if (!Sortable.eventCanceled) {
|
|
16807
|
+
cloneEl = clone(dragEl);
|
|
16808
|
+
cloneEl.removeAttribute("id");
|
|
16809
|
+
cloneEl.draggable = false;
|
|
16810
|
+
cloneEl.style["will-change"] = "";
|
|
16811
|
+
this._hideClone();
|
|
16812
|
+
toggleClass(cloneEl, this.options.chosenClass, false);
|
|
16813
|
+
Sortable.clone = cloneEl;
|
|
16814
|
+
}
|
|
16815
|
+
_this.cloneId = _nextTick(function() {
|
|
16816
|
+
pluginEvent("clone", _this);
|
|
16817
|
+
if (Sortable.eventCanceled)
|
|
16818
|
+
return;
|
|
16819
|
+
if (!_this.options.removeCloneOnHide) {
|
|
16820
|
+
rootEl.insertBefore(cloneEl, dragEl);
|
|
16821
|
+
}
|
|
16822
|
+
_this._hideClone();
|
|
16823
|
+
_dispatchEvent({
|
|
16824
|
+
sortable: _this,
|
|
16825
|
+
name: "clone"
|
|
16826
|
+
});
|
|
16827
|
+
});
|
|
16828
|
+
!fallback && toggleClass(dragEl, options.dragClass, true);
|
|
16829
|
+
if (fallback) {
|
|
16830
|
+
ignoreNextClick = true;
|
|
16831
|
+
_this._loopId = setInterval(_this._emulateDragOver, 50);
|
|
16832
|
+
} else {
|
|
16833
|
+
off$1(document, "mouseup", _this._onDrop);
|
|
16834
|
+
off$1(document, "touchend", _this._onDrop);
|
|
16835
|
+
off$1(document, "touchcancel", _this._onDrop);
|
|
16836
|
+
if (dataTransfer) {
|
|
16837
|
+
dataTransfer.effectAllowed = "move";
|
|
16838
|
+
options.setData && options.setData.call(_this, dataTransfer, dragEl);
|
|
16839
|
+
}
|
|
16840
|
+
on$1(document, "drop", _this);
|
|
16841
|
+
css(dragEl, "transform", "translateZ(0)");
|
|
16842
|
+
}
|
|
16843
|
+
awaitingDragStarted = true;
|
|
16844
|
+
_this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
|
|
16845
|
+
on$1(document, "selectstart", _this);
|
|
16846
|
+
moved = true;
|
|
16847
|
+
window.getSelection().removeAllRanges();
|
|
16848
|
+
if (Safari) {
|
|
16849
|
+
css(document.body, "user-select", "none");
|
|
16850
|
+
}
|
|
16851
|
+
},
|
|
16852
|
+
// Returns true - if no further action is needed (either inserted or another condition)
|
|
16853
|
+
_onDragOver: function _onDragOver(evt) {
|
|
16854
|
+
var el = this.el, target = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = Sortable.active, isOwner = activeGroup === group, canSort = options.sort, fromSortable = putSortable || activeSortable, vertical, _this = this, completedFired = false;
|
|
16855
|
+
if (_silent)
|
|
16856
|
+
return;
|
|
16857
|
+
function dragOverEvent(name2, extra) {
|
|
16858
|
+
pluginEvent(name2, _this, _objectSpread2({
|
|
16859
|
+
evt,
|
|
16860
|
+
isOwner,
|
|
16861
|
+
axis: vertical ? "vertical" : "horizontal",
|
|
16862
|
+
revert,
|
|
16863
|
+
dragRect,
|
|
16864
|
+
targetRect,
|
|
16865
|
+
canSort,
|
|
16866
|
+
fromSortable,
|
|
16867
|
+
target,
|
|
16868
|
+
completed,
|
|
16869
|
+
onMove: function onMove(target2, after2) {
|
|
16870
|
+
return _onMove(rootEl, el, dragEl, dragRect, target2, getRect(target2), evt, after2);
|
|
16871
|
+
},
|
|
16872
|
+
changed
|
|
16873
|
+
}, extra));
|
|
16874
|
+
}
|
|
16875
|
+
function capture() {
|
|
16876
|
+
dragOverEvent("dragOverAnimationCapture");
|
|
16877
|
+
_this.captureAnimationState();
|
|
16878
|
+
if (_this !== fromSortable) {
|
|
16879
|
+
fromSortable.captureAnimationState();
|
|
16880
|
+
}
|
|
16881
|
+
}
|
|
16882
|
+
function completed(insertion) {
|
|
16883
|
+
dragOverEvent("dragOverCompleted", {
|
|
16884
|
+
insertion
|
|
16885
|
+
});
|
|
16886
|
+
if (insertion) {
|
|
16887
|
+
if (isOwner) {
|
|
16888
|
+
activeSortable._hideClone();
|
|
16889
|
+
} else {
|
|
16890
|
+
activeSortable._showClone(_this);
|
|
16891
|
+
}
|
|
16892
|
+
if (_this !== fromSortable) {
|
|
16893
|
+
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
|
|
16894
|
+
toggleClass(dragEl, options.ghostClass, true);
|
|
16895
|
+
}
|
|
16896
|
+
if (putSortable !== _this && _this !== Sortable.active) {
|
|
16897
|
+
putSortable = _this;
|
|
16898
|
+
} else if (_this === Sortable.active && putSortable) {
|
|
16899
|
+
putSortable = null;
|
|
16900
|
+
}
|
|
16901
|
+
if (fromSortable === _this) {
|
|
16902
|
+
_this._ignoreWhileAnimating = target;
|
|
16903
|
+
}
|
|
16904
|
+
_this.animateAll(function() {
|
|
16905
|
+
dragOverEvent("dragOverAnimationComplete");
|
|
16906
|
+
_this._ignoreWhileAnimating = null;
|
|
16907
|
+
});
|
|
16908
|
+
if (_this !== fromSortable) {
|
|
16909
|
+
fromSortable.animateAll();
|
|
16910
|
+
fromSortable._ignoreWhileAnimating = null;
|
|
16911
|
+
}
|
|
16912
|
+
}
|
|
16913
|
+
if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
|
|
16914
|
+
lastTarget = null;
|
|
16915
|
+
}
|
|
16916
|
+
if (!options.dragoverBubble && !evt.rootEl && target !== document) {
|
|
16917
|
+
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
|
16918
|
+
!insertion && nearestEmptyInsertDetectEvent(evt);
|
|
16919
|
+
}
|
|
16920
|
+
!options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
|
|
16921
|
+
return completedFired = true;
|
|
16922
|
+
}
|
|
16923
|
+
function changed() {
|
|
16924
|
+
newIndex = index$1(dragEl);
|
|
16925
|
+
newDraggableIndex = index$1(dragEl, options.draggable);
|
|
16926
|
+
_dispatchEvent({
|
|
16927
|
+
sortable: _this,
|
|
16928
|
+
name: "change",
|
|
16929
|
+
toEl: el,
|
|
16930
|
+
newIndex,
|
|
16931
|
+
newDraggableIndex,
|
|
16932
|
+
originalEvent: evt
|
|
16933
|
+
});
|
|
16934
|
+
}
|
|
16935
|
+
if (evt.preventDefault !== void 0) {
|
|
16936
|
+
evt.cancelable && evt.preventDefault();
|
|
16937
|
+
}
|
|
16938
|
+
target = closest(target, options.draggable, el, true);
|
|
16939
|
+
dragOverEvent("dragOver");
|
|
16940
|
+
if (Sortable.eventCanceled)
|
|
16941
|
+
return completedFired;
|
|
16942
|
+
if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
|
|
16943
|
+
return completed(false);
|
|
16944
|
+
}
|
|
16945
|
+
ignoreNextClick = false;
|
|
16946
|
+
if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
|
|
16947
|
+
vertical = this._getDirection(evt, target) === "vertical";
|
|
16948
|
+
dragRect = getRect(dragEl);
|
|
16949
|
+
dragOverEvent("dragOverValid");
|
|
16950
|
+
if (Sortable.eventCanceled)
|
|
16951
|
+
return completedFired;
|
|
16952
|
+
if (revert) {
|
|
16953
|
+
parentEl = rootEl;
|
|
16954
|
+
capture();
|
|
16955
|
+
this._hideClone();
|
|
16956
|
+
dragOverEvent("revert");
|
|
16957
|
+
if (!Sortable.eventCanceled) {
|
|
16958
|
+
if (nextEl) {
|
|
16959
|
+
rootEl.insertBefore(dragEl, nextEl);
|
|
16960
|
+
} else {
|
|
16961
|
+
rootEl.appendChild(dragEl);
|
|
16962
|
+
}
|
|
16963
|
+
}
|
|
16964
|
+
return completed(true);
|
|
16965
|
+
}
|
|
16966
|
+
var elLastChild = lastChild(el, options.draggable);
|
|
16967
|
+
if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
|
|
16968
|
+
if (elLastChild === dragEl) {
|
|
16969
|
+
return completed(false);
|
|
16970
|
+
}
|
|
16971
|
+
if (elLastChild && el === evt.target) {
|
|
16972
|
+
target = elLastChild;
|
|
16973
|
+
}
|
|
16974
|
+
if (target) {
|
|
16975
|
+
targetRect = getRect(target);
|
|
16976
|
+
}
|
|
16977
|
+
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
|
|
16978
|
+
capture();
|
|
16979
|
+
if (elLastChild && elLastChild.nextSibling) {
|
|
16980
|
+
el.insertBefore(dragEl, elLastChild.nextSibling);
|
|
16981
|
+
} else {
|
|
16982
|
+
el.appendChild(dragEl);
|
|
16983
|
+
}
|
|
16984
|
+
parentEl = el;
|
|
16985
|
+
changed();
|
|
16986
|
+
return completed(true);
|
|
16987
|
+
}
|
|
16988
|
+
} else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
|
|
16989
|
+
var firstChild = getChild(el, 0, options, true);
|
|
16990
|
+
if (firstChild === dragEl) {
|
|
16991
|
+
return completed(false);
|
|
16992
|
+
}
|
|
16993
|
+
target = firstChild;
|
|
16994
|
+
targetRect = getRect(target);
|
|
16995
|
+
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
|
|
16996
|
+
capture();
|
|
16997
|
+
el.insertBefore(dragEl, firstChild);
|
|
16998
|
+
parentEl = el;
|
|
16999
|
+
changed();
|
|
17000
|
+
return completed(true);
|
|
17001
|
+
}
|
|
17002
|
+
} else if (target.parentNode === el) {
|
|
17003
|
+
targetRect = getRect(target);
|
|
17004
|
+
var direction = 0, targetBeforeFirstSwap, differentLevel = dragEl.parentNode !== el, differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical), side1 = vertical ? "top" : "left", scrolledPastTop = isScrolledPast(target, "top", "top") || isScrolledPast(dragEl, "top", "top"), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
|
|
17005
|
+
if (lastTarget !== target) {
|
|
17006
|
+
targetBeforeFirstSwap = targetRect[side1];
|
|
17007
|
+
pastFirstInvertThresh = false;
|
|
17008
|
+
isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
|
|
17009
|
+
}
|
|
17010
|
+
direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
|
|
17011
|
+
var sibling;
|
|
17012
|
+
if (direction !== 0) {
|
|
17013
|
+
var dragIndex = index$1(dragEl);
|
|
17014
|
+
do {
|
|
17015
|
+
dragIndex -= direction;
|
|
17016
|
+
sibling = parentEl.children[dragIndex];
|
|
17017
|
+
} while (sibling && (css(sibling, "display") === "none" || sibling === ghostEl));
|
|
17018
|
+
}
|
|
17019
|
+
if (direction === 0 || sibling === target) {
|
|
17020
|
+
return completed(false);
|
|
17021
|
+
}
|
|
17022
|
+
lastTarget = target;
|
|
17023
|
+
lastDirection = direction;
|
|
17024
|
+
var nextSibling = target.nextElementSibling, after = false;
|
|
17025
|
+
after = direction === 1;
|
|
17026
|
+
var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
|
|
17027
|
+
if (moveVector !== false) {
|
|
17028
|
+
if (moveVector === 1 || moveVector === -1) {
|
|
17029
|
+
after = moveVector === 1;
|
|
17030
|
+
}
|
|
17031
|
+
_silent = true;
|
|
17032
|
+
setTimeout(_unsilent, 30);
|
|
17033
|
+
capture();
|
|
17034
|
+
if (after && !nextSibling) {
|
|
17035
|
+
el.appendChild(dragEl);
|
|
17036
|
+
} else {
|
|
17037
|
+
target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
|
|
17038
|
+
}
|
|
17039
|
+
if (scrolledPastTop) {
|
|
17040
|
+
scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
|
|
17041
|
+
}
|
|
17042
|
+
parentEl = dragEl.parentNode;
|
|
17043
|
+
if (targetBeforeFirstSwap !== void 0 && !isCircumstantialInvert) {
|
|
17044
|
+
targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
|
|
17045
|
+
}
|
|
17046
|
+
changed();
|
|
17047
|
+
return completed(true);
|
|
17048
|
+
}
|
|
17049
|
+
}
|
|
17050
|
+
if (el.contains(dragEl)) {
|
|
17051
|
+
return completed(false);
|
|
17052
|
+
}
|
|
17053
|
+
}
|
|
17054
|
+
return false;
|
|
17055
|
+
},
|
|
17056
|
+
_ignoreWhileAnimating: null,
|
|
17057
|
+
_offMoveEvents: function _offMoveEvents() {
|
|
17058
|
+
off$1(document, "mousemove", this._onTouchMove);
|
|
17059
|
+
off$1(document, "touchmove", this._onTouchMove);
|
|
17060
|
+
off$1(document, "pointermove", this._onTouchMove);
|
|
17061
|
+
off$1(document, "dragover", nearestEmptyInsertDetectEvent);
|
|
17062
|
+
off$1(document, "mousemove", nearestEmptyInsertDetectEvent);
|
|
17063
|
+
off$1(document, "touchmove", nearestEmptyInsertDetectEvent);
|
|
17064
|
+
},
|
|
17065
|
+
_offUpEvents: function _offUpEvents() {
|
|
17066
|
+
var ownerDocument = this.el.ownerDocument;
|
|
17067
|
+
off$1(ownerDocument, "mouseup", this._onDrop);
|
|
17068
|
+
off$1(ownerDocument, "touchend", this._onDrop);
|
|
17069
|
+
off$1(ownerDocument, "pointerup", this._onDrop);
|
|
17070
|
+
off$1(ownerDocument, "pointercancel", this._onDrop);
|
|
17071
|
+
off$1(ownerDocument, "touchcancel", this._onDrop);
|
|
17072
|
+
off$1(document, "selectstart", this);
|
|
17073
|
+
},
|
|
17074
|
+
_onDrop: function _onDrop(evt) {
|
|
17075
|
+
var el = this.el, options = this.options;
|
|
17076
|
+
newIndex = index$1(dragEl);
|
|
17077
|
+
newDraggableIndex = index$1(dragEl, options.draggable);
|
|
17078
|
+
pluginEvent("drop", this, {
|
|
17079
|
+
evt
|
|
17080
|
+
});
|
|
17081
|
+
parentEl = dragEl && dragEl.parentNode;
|
|
17082
|
+
newIndex = index$1(dragEl);
|
|
17083
|
+
newDraggableIndex = index$1(dragEl, options.draggable);
|
|
17084
|
+
if (Sortable.eventCanceled) {
|
|
17085
|
+
this._nulling();
|
|
17086
|
+
return;
|
|
17087
|
+
}
|
|
17088
|
+
awaitingDragStarted = false;
|
|
17089
|
+
isCircumstantialInvert = false;
|
|
17090
|
+
pastFirstInvertThresh = false;
|
|
17091
|
+
clearInterval(this._loopId);
|
|
17092
|
+
clearTimeout(this._dragStartTimer);
|
|
17093
|
+
_cancelNextTick(this.cloneId);
|
|
17094
|
+
_cancelNextTick(this._dragStartId);
|
|
17095
|
+
if (this.nativeDraggable) {
|
|
17096
|
+
off$1(document, "drop", this);
|
|
17097
|
+
off$1(el, "dragstart", this._onDragStart);
|
|
17098
|
+
}
|
|
17099
|
+
this._offMoveEvents();
|
|
17100
|
+
this._offUpEvents();
|
|
17101
|
+
if (Safari) {
|
|
17102
|
+
css(document.body, "user-select", "");
|
|
17103
|
+
}
|
|
17104
|
+
css(dragEl, "transform", "");
|
|
17105
|
+
if (evt) {
|
|
17106
|
+
if (moved) {
|
|
17107
|
+
evt.cancelable && evt.preventDefault();
|
|
17108
|
+
!options.dropBubble && evt.stopPropagation();
|
|
17109
|
+
}
|
|
17110
|
+
ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
|
|
17111
|
+
if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== "clone") {
|
|
17112
|
+
cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
|
|
17113
|
+
}
|
|
17114
|
+
if (dragEl) {
|
|
17115
|
+
if (this.nativeDraggable) {
|
|
17116
|
+
off$1(dragEl, "dragend", this);
|
|
17117
|
+
}
|
|
17118
|
+
_disableDraggable(dragEl);
|
|
17119
|
+
dragEl.style["will-change"] = "";
|
|
17120
|
+
if (moved && !awaitingDragStarted) {
|
|
17121
|
+
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
|
|
17122
|
+
}
|
|
17123
|
+
toggleClass(dragEl, this.options.chosenClass, false);
|
|
17124
|
+
_dispatchEvent({
|
|
17125
|
+
sortable: this,
|
|
17126
|
+
name: "unchoose",
|
|
17127
|
+
toEl: parentEl,
|
|
17128
|
+
newIndex: null,
|
|
17129
|
+
newDraggableIndex: null,
|
|
17130
|
+
originalEvent: evt
|
|
17131
|
+
});
|
|
17132
|
+
if (rootEl !== parentEl) {
|
|
17133
|
+
if (newIndex >= 0) {
|
|
17134
|
+
_dispatchEvent({
|
|
17135
|
+
rootEl: parentEl,
|
|
17136
|
+
name: "add",
|
|
17137
|
+
toEl: parentEl,
|
|
17138
|
+
fromEl: rootEl,
|
|
17139
|
+
originalEvent: evt
|
|
17140
|
+
});
|
|
17141
|
+
_dispatchEvent({
|
|
17142
|
+
sortable: this,
|
|
17143
|
+
name: "remove",
|
|
17144
|
+
toEl: parentEl,
|
|
17145
|
+
originalEvent: evt
|
|
17146
|
+
});
|
|
17147
|
+
_dispatchEvent({
|
|
17148
|
+
rootEl: parentEl,
|
|
17149
|
+
name: "sort",
|
|
17150
|
+
toEl: parentEl,
|
|
17151
|
+
fromEl: rootEl,
|
|
17152
|
+
originalEvent: evt
|
|
17153
|
+
});
|
|
17154
|
+
_dispatchEvent({
|
|
17155
|
+
sortable: this,
|
|
17156
|
+
name: "sort",
|
|
17157
|
+
toEl: parentEl,
|
|
17158
|
+
originalEvent: evt
|
|
17159
|
+
});
|
|
17160
|
+
}
|
|
17161
|
+
putSortable && putSortable.save();
|
|
17162
|
+
} else {
|
|
17163
|
+
if (newIndex !== oldIndex) {
|
|
17164
|
+
if (newIndex >= 0) {
|
|
17165
|
+
_dispatchEvent({
|
|
17166
|
+
sortable: this,
|
|
17167
|
+
name: "update",
|
|
17168
|
+
toEl: parentEl,
|
|
17169
|
+
originalEvent: evt
|
|
17170
|
+
});
|
|
17171
|
+
_dispatchEvent({
|
|
17172
|
+
sortable: this,
|
|
17173
|
+
name: "sort",
|
|
17174
|
+
toEl: parentEl,
|
|
17175
|
+
originalEvent: evt
|
|
17176
|
+
});
|
|
17177
|
+
}
|
|
17178
|
+
}
|
|
17179
|
+
}
|
|
17180
|
+
if (Sortable.active) {
|
|
17181
|
+
if (newIndex == null || newIndex === -1) {
|
|
17182
|
+
newIndex = oldIndex;
|
|
17183
|
+
newDraggableIndex = oldDraggableIndex;
|
|
17184
|
+
}
|
|
17185
|
+
_dispatchEvent({
|
|
17186
|
+
sortable: this,
|
|
17187
|
+
name: "end",
|
|
17188
|
+
toEl: parentEl,
|
|
17189
|
+
originalEvent: evt
|
|
17190
|
+
});
|
|
17191
|
+
this.save();
|
|
17192
|
+
}
|
|
17193
|
+
}
|
|
17194
|
+
}
|
|
17195
|
+
this._nulling();
|
|
17196
|
+
},
|
|
17197
|
+
_nulling: function _nulling() {
|
|
17198
|
+
pluginEvent("nulling", this);
|
|
17199
|
+
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;
|
|
17200
|
+
savedInputChecked.forEach(function(el) {
|
|
17201
|
+
el.checked = true;
|
|
17202
|
+
});
|
|
17203
|
+
savedInputChecked.length = lastDx = lastDy = 0;
|
|
17204
|
+
},
|
|
17205
|
+
handleEvent: function handleEvent(evt) {
|
|
17206
|
+
switch (evt.type) {
|
|
17207
|
+
case "drop":
|
|
17208
|
+
case "dragend":
|
|
17209
|
+
this._onDrop(evt);
|
|
17210
|
+
break;
|
|
17211
|
+
case "dragenter":
|
|
17212
|
+
case "dragover":
|
|
17213
|
+
if (dragEl) {
|
|
17214
|
+
this._onDragOver(evt);
|
|
17215
|
+
_globalDragOver(evt);
|
|
17216
|
+
}
|
|
17217
|
+
break;
|
|
17218
|
+
case "selectstart":
|
|
17219
|
+
evt.preventDefault();
|
|
17220
|
+
break;
|
|
17221
|
+
}
|
|
17222
|
+
},
|
|
17223
|
+
/**
|
|
17224
|
+
* Serializes the item into an array of string.
|
|
17225
|
+
* @returns {String[]}
|
|
17226
|
+
*/
|
|
17227
|
+
toArray: function toArray2() {
|
|
17228
|
+
var order2 = [], el, children = this.el.children, i = 0, n = children.length, options = this.options;
|
|
17229
|
+
for (; i < n; i++) {
|
|
17230
|
+
el = children[i];
|
|
17231
|
+
if (closest(el, options.draggable, this.el, false)) {
|
|
17232
|
+
order2.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
|
|
17233
|
+
}
|
|
17234
|
+
}
|
|
17235
|
+
return order2;
|
|
17236
|
+
},
|
|
17237
|
+
/**
|
|
17238
|
+
* Sorts the elements according to the array.
|
|
17239
|
+
* @param {String[]} order order of the items
|
|
17240
|
+
*/
|
|
17241
|
+
sort: function sort(order2, useAnimation) {
|
|
17242
|
+
var items = {}, rootEl2 = this.el;
|
|
17243
|
+
this.toArray().forEach(function(id, i) {
|
|
17244
|
+
var el = rootEl2.children[i];
|
|
17245
|
+
if (closest(el, this.options.draggable, rootEl2, false)) {
|
|
17246
|
+
items[id] = el;
|
|
17247
|
+
}
|
|
17248
|
+
}, this);
|
|
17249
|
+
useAnimation && this.captureAnimationState();
|
|
17250
|
+
order2.forEach(function(id) {
|
|
17251
|
+
if (items[id]) {
|
|
17252
|
+
rootEl2.removeChild(items[id]);
|
|
17253
|
+
rootEl2.appendChild(items[id]);
|
|
17254
|
+
}
|
|
17255
|
+
});
|
|
17256
|
+
useAnimation && this.animateAll();
|
|
17257
|
+
},
|
|
17258
|
+
/**
|
|
17259
|
+
* Save the current sorting
|
|
17260
|
+
*/
|
|
17261
|
+
save: function save() {
|
|
17262
|
+
var store = this.options.store;
|
|
17263
|
+
store && store.set && store.set(this);
|
|
17264
|
+
},
|
|
17265
|
+
/**
|
|
17266
|
+
* 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.
|
|
17267
|
+
* @param {HTMLElement} el
|
|
17268
|
+
* @param {String} [selector] default: `options.draggable`
|
|
17269
|
+
* @returns {HTMLElement|null}
|
|
17270
|
+
*/
|
|
17271
|
+
closest: function closest$12(el, selector) {
|
|
17272
|
+
return closest(el, selector || this.options.draggable, this.el, false);
|
|
17273
|
+
},
|
|
17274
|
+
/**
|
|
17275
|
+
* Set/get option
|
|
17276
|
+
* @param {string} name
|
|
17277
|
+
* @param {*} [value]
|
|
17278
|
+
* @returns {*}
|
|
17279
|
+
*/
|
|
17280
|
+
option: function option(name2, value) {
|
|
17281
|
+
var options = this.options;
|
|
17282
|
+
if (value === void 0) {
|
|
17283
|
+
return options[name2];
|
|
17284
|
+
} else {
|
|
17285
|
+
var modifiedValue = PluginManager.modifyOption(this, name2, value);
|
|
17286
|
+
if (typeof modifiedValue !== "undefined") {
|
|
17287
|
+
options[name2] = modifiedValue;
|
|
17288
|
+
} else {
|
|
17289
|
+
options[name2] = value;
|
|
17290
|
+
}
|
|
17291
|
+
if (name2 === "group") {
|
|
17292
|
+
_prepareGroup(options);
|
|
17293
|
+
}
|
|
17294
|
+
}
|
|
17295
|
+
},
|
|
17296
|
+
/**
|
|
17297
|
+
* Destroy
|
|
17298
|
+
*/
|
|
17299
|
+
destroy: function destroy() {
|
|
17300
|
+
pluginEvent("destroy", this);
|
|
17301
|
+
var el = this.el;
|
|
17302
|
+
el[expando] = null;
|
|
17303
|
+
off$1(el, "mousedown", this._onTapStart);
|
|
17304
|
+
off$1(el, "touchstart", this._onTapStart);
|
|
17305
|
+
off$1(el, "pointerdown", this._onTapStart);
|
|
17306
|
+
if (this.nativeDraggable) {
|
|
17307
|
+
off$1(el, "dragover", this);
|
|
17308
|
+
off$1(el, "dragenter", this);
|
|
17309
|
+
}
|
|
17310
|
+
Array.prototype.forEach.call(el.querySelectorAll("[draggable]"), function(el2) {
|
|
17311
|
+
el2.removeAttribute("draggable");
|
|
17312
|
+
});
|
|
17313
|
+
this._onDrop();
|
|
17314
|
+
this._disableDelayedDragEvents();
|
|
17315
|
+
sortables.splice(sortables.indexOf(this.el), 1);
|
|
17316
|
+
this.el = el = null;
|
|
17317
|
+
},
|
|
17318
|
+
_hideClone: function _hideClone() {
|
|
17319
|
+
if (!cloneHidden) {
|
|
17320
|
+
pluginEvent("hideClone", this);
|
|
17321
|
+
if (Sortable.eventCanceled)
|
|
17322
|
+
return;
|
|
17323
|
+
css(cloneEl, "display", "none");
|
|
17324
|
+
if (this.options.removeCloneOnHide && cloneEl.parentNode) {
|
|
17325
|
+
cloneEl.parentNode.removeChild(cloneEl);
|
|
17326
|
+
}
|
|
17327
|
+
cloneHidden = true;
|
|
17328
|
+
}
|
|
17329
|
+
},
|
|
17330
|
+
_showClone: function _showClone(putSortable2) {
|
|
17331
|
+
if (putSortable2.lastPutMode !== "clone") {
|
|
17332
|
+
this._hideClone();
|
|
17333
|
+
return;
|
|
17334
|
+
}
|
|
17335
|
+
if (cloneHidden) {
|
|
17336
|
+
pluginEvent("showClone", this);
|
|
17337
|
+
if (Sortable.eventCanceled)
|
|
17338
|
+
return;
|
|
17339
|
+
if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
|
|
17340
|
+
rootEl.insertBefore(cloneEl, dragEl);
|
|
17341
|
+
} else if (nextEl) {
|
|
17342
|
+
rootEl.insertBefore(cloneEl, nextEl);
|
|
17343
|
+
} else {
|
|
17344
|
+
rootEl.appendChild(cloneEl);
|
|
17345
|
+
}
|
|
17346
|
+
if (this.options.group.revertClone) {
|
|
17347
|
+
this.animate(dragEl, cloneEl);
|
|
17348
|
+
}
|
|
17349
|
+
css(cloneEl, "display", "");
|
|
17350
|
+
cloneHidden = false;
|
|
17351
|
+
}
|
|
17352
|
+
}
|
|
17353
|
+
};
|
|
17354
|
+
function _globalDragOver(evt) {
|
|
17355
|
+
if (evt.dataTransfer) {
|
|
17356
|
+
evt.dataTransfer.dropEffect = "move";
|
|
17357
|
+
}
|
|
17358
|
+
evt.cancelable && evt.preventDefault();
|
|
17359
|
+
}
|
|
17360
|
+
function _onMove(fromEl, toEl, dragEl2, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
|
|
17361
|
+
var evt, sortable = fromEl[expando], onMoveFn = sortable.options.onMove, retVal;
|
|
17362
|
+
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
|
17363
|
+
evt = new CustomEvent("move", {
|
|
17364
|
+
bubbles: true,
|
|
17365
|
+
cancelable: true
|
|
17366
|
+
});
|
|
17367
|
+
} else {
|
|
17368
|
+
evt = document.createEvent("Event");
|
|
17369
|
+
evt.initEvent("move", true, true);
|
|
17370
|
+
}
|
|
17371
|
+
evt.to = toEl;
|
|
17372
|
+
evt.from = fromEl;
|
|
17373
|
+
evt.dragged = dragEl2;
|
|
17374
|
+
evt.draggedRect = dragRect;
|
|
17375
|
+
evt.related = targetEl || toEl;
|
|
17376
|
+
evt.relatedRect = targetRect || getRect(toEl);
|
|
17377
|
+
evt.willInsertAfter = willInsertAfter;
|
|
17378
|
+
evt.originalEvent = originalEvent;
|
|
17379
|
+
fromEl.dispatchEvent(evt);
|
|
17380
|
+
if (onMoveFn) {
|
|
17381
|
+
retVal = onMoveFn.call(sortable, evt, originalEvent);
|
|
17382
|
+
}
|
|
17383
|
+
return retVal;
|
|
17384
|
+
}
|
|
17385
|
+
function _disableDraggable(el) {
|
|
17386
|
+
el.draggable = false;
|
|
17387
|
+
}
|
|
17388
|
+
function _unsilent() {
|
|
17389
|
+
_silent = false;
|
|
17390
|
+
}
|
|
17391
|
+
function _ghostIsFirst(evt, vertical, sortable) {
|
|
17392
|
+
var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
|
|
17393
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
|
17394
|
+
var spacer = 10;
|
|
17395
|
+
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;
|
|
17396
|
+
}
|
|
17397
|
+
function _ghostIsLast(evt, vertical, sortable) {
|
|
17398
|
+
var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
|
|
17399
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
|
17400
|
+
var spacer = 10;
|
|
17401
|
+
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;
|
|
17402
|
+
}
|
|
17403
|
+
function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
|
|
17404
|
+
var mouseOnAxis = vertical ? evt.clientY : evt.clientX, targetLength = vertical ? targetRect.height : targetRect.width, targetS1 = vertical ? targetRect.top : targetRect.left, targetS2 = vertical ? targetRect.bottom : targetRect.right, invert = false;
|
|
17405
|
+
if (!invertSwap) {
|
|
17406
|
+
if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
|
|
17407
|
+
if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
|
|
17408
|
+
pastFirstInvertThresh = true;
|
|
17409
|
+
}
|
|
17410
|
+
if (!pastFirstInvertThresh) {
|
|
17411
|
+
if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance : mouseOnAxis > targetS2 - targetMoveDistance) {
|
|
17412
|
+
return -lastDirection;
|
|
17413
|
+
}
|
|
17414
|
+
} else {
|
|
17415
|
+
invert = true;
|
|
17416
|
+
}
|
|
17417
|
+
} else {
|
|
17418
|
+
if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
|
|
17419
|
+
return _getInsertDirection(target);
|
|
17420
|
+
}
|
|
17421
|
+
}
|
|
17422
|
+
}
|
|
17423
|
+
invert = invert || invertSwap;
|
|
17424
|
+
if (invert) {
|
|
17425
|
+
if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
|
|
17426
|
+
return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
|
|
17427
|
+
}
|
|
17428
|
+
}
|
|
17429
|
+
return 0;
|
|
17430
|
+
}
|
|
17431
|
+
function _getInsertDirection(target) {
|
|
17432
|
+
if (index$1(dragEl) < index$1(target)) {
|
|
17433
|
+
return 1;
|
|
17434
|
+
} else {
|
|
17435
|
+
return -1;
|
|
17436
|
+
}
|
|
17437
|
+
}
|
|
17438
|
+
function _generateId(el) {
|
|
17439
|
+
var str = el.tagName + el.className + el.src + el.href + el.textContent, i = str.length, sum = 0;
|
|
17440
|
+
while (i--) {
|
|
17441
|
+
sum += str.charCodeAt(i);
|
|
17442
|
+
}
|
|
17443
|
+
return sum.toString(36);
|
|
17444
|
+
}
|
|
17445
|
+
function _saveInputCheckedState(root) {
|
|
17446
|
+
savedInputChecked.length = 0;
|
|
17447
|
+
var inputs = root.getElementsByTagName("input");
|
|
17448
|
+
var idx = inputs.length;
|
|
17449
|
+
while (idx--) {
|
|
17450
|
+
var el = inputs[idx];
|
|
17451
|
+
el.checked && savedInputChecked.push(el);
|
|
17452
|
+
}
|
|
17453
|
+
}
|
|
17454
|
+
function _nextTick(fn) {
|
|
17455
|
+
return setTimeout(fn, 0);
|
|
17456
|
+
}
|
|
17457
|
+
function _cancelNextTick(id) {
|
|
17458
|
+
return clearTimeout(id);
|
|
17459
|
+
}
|
|
17460
|
+
if (documentExists) {
|
|
17461
|
+
on$1(document, "touchmove", function(evt) {
|
|
17462
|
+
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
|
|
17463
|
+
evt.preventDefault();
|
|
17464
|
+
}
|
|
17465
|
+
});
|
|
17466
|
+
}
|
|
17467
|
+
Sortable.utils = {
|
|
17468
|
+
on: on$1,
|
|
17469
|
+
off: off$1,
|
|
17470
|
+
css,
|
|
17471
|
+
find,
|
|
17472
|
+
is: function is(el, selector) {
|
|
17473
|
+
return !!closest(el, selector, el, false);
|
|
17474
|
+
},
|
|
17475
|
+
extend,
|
|
17476
|
+
throttle: throttle$1,
|
|
17477
|
+
closest,
|
|
17478
|
+
toggleClass,
|
|
17479
|
+
clone,
|
|
17480
|
+
index: index$1,
|
|
17481
|
+
nextTick: _nextTick,
|
|
17482
|
+
cancelNextTick: _cancelNextTick,
|
|
17483
|
+
detectDirection: _detectDirection,
|
|
17484
|
+
getChild,
|
|
17485
|
+
expando
|
|
17486
|
+
};
|
|
17487
|
+
Sortable.get = function(element) {
|
|
17488
|
+
return element[expando];
|
|
17489
|
+
};
|
|
17490
|
+
Sortable.mount = function() {
|
|
17491
|
+
for (var _len = arguments.length, plugins2 = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
17492
|
+
plugins2[_key] = arguments[_key];
|
|
17493
|
+
}
|
|
17494
|
+
if (plugins2[0].constructor === Array)
|
|
17495
|
+
plugins2 = plugins2[0];
|
|
17496
|
+
plugins2.forEach(function(plugin) {
|
|
17497
|
+
if (!plugin.prototype || !plugin.prototype.constructor) {
|
|
17498
|
+
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
|
|
17499
|
+
}
|
|
17500
|
+
if (plugin.utils)
|
|
17501
|
+
Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
|
|
17502
|
+
PluginManager.mount(plugin);
|
|
17503
|
+
});
|
|
17504
|
+
};
|
|
17505
|
+
Sortable.create = function(el, options) {
|
|
17506
|
+
return new Sortable(el, options);
|
|
17507
|
+
};
|
|
17508
|
+
Sortable.version = version$1;
|
|
17509
|
+
var autoScrolls = [], scrollEl, scrollRootEl, scrolling = false, lastAutoScrollX, lastAutoScrollY, touchEvt$1, pointerElemChangedInterval;
|
|
17510
|
+
function AutoScrollPlugin() {
|
|
17511
|
+
function AutoScroll() {
|
|
17512
|
+
this.defaults = {
|
|
17513
|
+
scroll: true,
|
|
17514
|
+
forceAutoScrollFallback: false,
|
|
17515
|
+
scrollSensitivity: 30,
|
|
17516
|
+
scrollSpeed: 10,
|
|
17517
|
+
bubbleScroll: true
|
|
17518
|
+
};
|
|
17519
|
+
for (var fn in this) {
|
|
17520
|
+
if (fn.charAt(0) === "_" && typeof this[fn] === "function") {
|
|
17521
|
+
this[fn] = this[fn].bind(this);
|
|
17522
|
+
}
|
|
17523
|
+
}
|
|
17524
|
+
}
|
|
17525
|
+
AutoScroll.prototype = {
|
|
17526
|
+
dragStarted: function dragStarted(_ref) {
|
|
17527
|
+
var originalEvent = _ref.originalEvent;
|
|
17528
|
+
if (this.sortable.nativeDraggable) {
|
|
17529
|
+
on$1(document, "dragover", this._handleAutoScroll);
|
|
17530
|
+
} else {
|
|
17531
|
+
if (this.options.supportPointer) {
|
|
17532
|
+
on$1(document, "pointermove", this._handleFallbackAutoScroll);
|
|
17533
|
+
} else if (originalEvent.touches) {
|
|
17534
|
+
on$1(document, "touchmove", this._handleFallbackAutoScroll);
|
|
17535
|
+
} else {
|
|
17536
|
+
on$1(document, "mousemove", this._handleFallbackAutoScroll);
|
|
17537
|
+
}
|
|
17538
|
+
}
|
|
17539
|
+
},
|
|
17540
|
+
dragOverCompleted: function dragOverCompleted(_ref2) {
|
|
17541
|
+
var originalEvent = _ref2.originalEvent;
|
|
17542
|
+
if (!this.options.dragOverBubble && !originalEvent.rootEl) {
|
|
17543
|
+
this._handleAutoScroll(originalEvent);
|
|
17544
|
+
}
|
|
17545
|
+
},
|
|
17546
|
+
drop: function drop2() {
|
|
17547
|
+
if (this.sortable.nativeDraggable) {
|
|
17548
|
+
off$1(document, "dragover", this._handleAutoScroll);
|
|
17549
|
+
} else {
|
|
17550
|
+
off$1(document, "pointermove", this._handleFallbackAutoScroll);
|
|
17551
|
+
off$1(document, "touchmove", this._handleFallbackAutoScroll);
|
|
17552
|
+
off$1(document, "mousemove", this._handleFallbackAutoScroll);
|
|
17553
|
+
}
|
|
17554
|
+
clearPointerElemChangedInterval();
|
|
17555
|
+
clearAutoScrolls();
|
|
17556
|
+
cancelThrottle();
|
|
17557
|
+
},
|
|
17558
|
+
nulling: function nulling() {
|
|
17559
|
+
touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
|
|
17560
|
+
autoScrolls.length = 0;
|
|
17561
|
+
},
|
|
17562
|
+
_handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
|
|
17563
|
+
this._handleAutoScroll(evt, true);
|
|
17564
|
+
},
|
|
17565
|
+
_handleAutoScroll: function _handleAutoScroll(evt, fallback) {
|
|
17566
|
+
var _this = this;
|
|
17567
|
+
var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, elem = document.elementFromPoint(x, y);
|
|
17568
|
+
touchEvt$1 = evt;
|
|
17569
|
+
if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
|
|
17570
|
+
autoScroll(evt, this.options, elem, fallback);
|
|
17571
|
+
var ogElemScroller = getParentAutoScrollElement(elem, true);
|
|
17572
|
+
if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
|
|
17573
|
+
pointerElemChangedInterval && clearPointerElemChangedInterval();
|
|
17574
|
+
pointerElemChangedInterval = setInterval(function() {
|
|
17575
|
+
var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
|
|
17576
|
+
if (newElem !== ogElemScroller) {
|
|
17577
|
+
ogElemScroller = newElem;
|
|
17578
|
+
clearAutoScrolls();
|
|
17579
|
+
}
|
|
17580
|
+
autoScroll(evt, _this.options, newElem, fallback);
|
|
17581
|
+
}, 10);
|
|
17582
|
+
lastAutoScrollX = x;
|
|
17583
|
+
lastAutoScrollY = y;
|
|
17584
|
+
}
|
|
17585
|
+
} else {
|
|
17586
|
+
if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
|
|
17587
|
+
clearAutoScrolls();
|
|
17588
|
+
return;
|
|
17589
|
+
}
|
|
17590
|
+
autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
|
|
17591
|
+
}
|
|
17592
|
+
}
|
|
17593
|
+
};
|
|
17594
|
+
return _extends$p(AutoScroll, {
|
|
17595
|
+
pluginName: "scroll",
|
|
17596
|
+
initializeByDefault: true
|
|
17597
|
+
});
|
|
17598
|
+
}
|
|
17599
|
+
function clearAutoScrolls() {
|
|
17600
|
+
autoScrolls.forEach(function(autoScroll2) {
|
|
17601
|
+
clearInterval(autoScroll2.pid);
|
|
17602
|
+
});
|
|
17603
|
+
autoScrolls = [];
|
|
17604
|
+
}
|
|
17605
|
+
function clearPointerElemChangedInterval() {
|
|
17606
|
+
clearInterval(pointerElemChangedInterval);
|
|
17607
|
+
}
|
|
17608
|
+
var autoScroll = throttle$1(function(evt, options, rootEl2, isFallback) {
|
|
17609
|
+
if (!options.scroll)
|
|
17610
|
+
return;
|
|
17611
|
+
var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = getWindowScrollingElement();
|
|
17612
|
+
var scrollThisInstance = false, scrollCustomFn;
|
|
17613
|
+
if (scrollRootEl !== rootEl2) {
|
|
17614
|
+
scrollRootEl = rootEl2;
|
|
17615
|
+
clearAutoScrolls();
|
|
17616
|
+
scrollEl = options.scroll;
|
|
17617
|
+
scrollCustomFn = options.scrollFn;
|
|
17618
|
+
if (scrollEl === true) {
|
|
17619
|
+
scrollEl = getParentAutoScrollElement(rootEl2, true);
|
|
17620
|
+
}
|
|
17621
|
+
}
|
|
17622
|
+
var layersOut = 0;
|
|
17623
|
+
var currentParent = scrollEl;
|
|
17624
|
+
do {
|
|
17625
|
+
var el = currentParent, rect = getRect(el), top2 = rect.top, bottom2 = rect.bottom, left2 = rect.left, right2 = rect.right, width2 = rect.width, height2 = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop;
|
|
17626
|
+
if (el === winScroller) {
|
|
17627
|
+
canScrollX = width2 < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll" || elCSS.overflowX === "visible");
|
|
17628
|
+
canScrollY = height2 < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll" || elCSS.overflowY === "visible");
|
|
17629
|
+
} else {
|
|
17630
|
+
canScrollX = width2 < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll");
|
|
17631
|
+
canScrollY = height2 < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll");
|
|
17632
|
+
}
|
|
17633
|
+
var vx = canScrollX && (Math.abs(right2 - x) <= sens && scrollPosX + width2 < scrollWidth) - (Math.abs(left2 - x) <= sens && !!scrollPosX);
|
|
17634
|
+
var vy = canScrollY && (Math.abs(bottom2 - y) <= sens && scrollPosY + height2 < scrollHeight) - (Math.abs(top2 - y) <= sens && !!scrollPosY);
|
|
17635
|
+
if (!autoScrolls[layersOut]) {
|
|
17636
|
+
for (var i = 0; i <= layersOut; i++) {
|
|
17637
|
+
if (!autoScrolls[i]) {
|
|
17638
|
+
autoScrolls[i] = {};
|
|
17639
|
+
}
|
|
17640
|
+
}
|
|
17641
|
+
}
|
|
17642
|
+
if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
|
|
17643
|
+
autoScrolls[layersOut].el = el;
|
|
17644
|
+
autoScrolls[layersOut].vx = vx;
|
|
17645
|
+
autoScrolls[layersOut].vy = vy;
|
|
17646
|
+
clearInterval(autoScrolls[layersOut].pid);
|
|
17647
|
+
if (vx != 0 || vy != 0) {
|
|
17648
|
+
scrollThisInstance = true;
|
|
17649
|
+
autoScrolls[layersOut].pid = setInterval((function() {
|
|
17650
|
+
if (isFallback && this.layer === 0) {
|
|
17651
|
+
Sortable.active._onTouchMove(touchEvt$1);
|
|
17652
|
+
}
|
|
17653
|
+
var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
|
|
17654
|
+
var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
|
|
17655
|
+
if (typeof scrollCustomFn === "function") {
|
|
17656
|
+
if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== "continue") {
|
|
17657
|
+
return;
|
|
17658
|
+
}
|
|
17659
|
+
}
|
|
17660
|
+
scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
|
|
17661
|
+
}).bind({
|
|
17662
|
+
layer: layersOut
|
|
17663
|
+
}), 24);
|
|
17664
|
+
}
|
|
17665
|
+
}
|
|
17666
|
+
layersOut++;
|
|
17667
|
+
} while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
|
|
17668
|
+
scrolling = scrollThisInstance;
|
|
17669
|
+
}, 30);
|
|
17670
|
+
var drop = function drop2(_ref) {
|
|
17671
|
+
var originalEvent = _ref.originalEvent, putSortable2 = _ref.putSortable, dragEl2 = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget;
|
|
17672
|
+
if (!originalEvent)
|
|
17673
|
+
return;
|
|
17674
|
+
var toSortable = putSortable2 || activeSortable;
|
|
17675
|
+
hideGhostForTarget();
|
|
17676
|
+
var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
|
|
17677
|
+
var target = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
17678
|
+
unhideGhostForTarget();
|
|
17679
|
+
if (toSortable && !toSortable.el.contains(target)) {
|
|
17680
|
+
dispatchSortableEvent("spill");
|
|
17681
|
+
this.onSpill({
|
|
17682
|
+
dragEl: dragEl2,
|
|
17683
|
+
putSortable: putSortable2
|
|
17684
|
+
});
|
|
17685
|
+
}
|
|
17686
|
+
};
|
|
17687
|
+
function Revert() {
|
|
17688
|
+
}
|
|
17689
|
+
Revert.prototype = {
|
|
17690
|
+
startIndex: null,
|
|
17691
|
+
dragStart: function dragStart(_ref2) {
|
|
17692
|
+
var oldDraggableIndex2 = _ref2.oldDraggableIndex;
|
|
17693
|
+
this.startIndex = oldDraggableIndex2;
|
|
17694
|
+
},
|
|
17695
|
+
onSpill: function onSpill(_ref3) {
|
|
17696
|
+
var dragEl2 = _ref3.dragEl, putSortable2 = _ref3.putSortable;
|
|
17697
|
+
this.sortable.captureAnimationState();
|
|
17698
|
+
if (putSortable2) {
|
|
17699
|
+
putSortable2.captureAnimationState();
|
|
17700
|
+
}
|
|
17701
|
+
var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
|
|
17702
|
+
if (nextSibling) {
|
|
17703
|
+
this.sortable.el.insertBefore(dragEl2, nextSibling);
|
|
17704
|
+
} else {
|
|
17705
|
+
this.sortable.el.appendChild(dragEl2);
|
|
17706
|
+
}
|
|
17707
|
+
this.sortable.animateAll();
|
|
17708
|
+
if (putSortable2) {
|
|
17709
|
+
putSortable2.animateAll();
|
|
17710
|
+
}
|
|
17711
|
+
},
|
|
17712
|
+
drop
|
|
17713
|
+
};
|
|
17714
|
+
_extends$p(Revert, {
|
|
17715
|
+
pluginName: "revertOnSpill"
|
|
17716
|
+
});
|
|
17717
|
+
function Remove() {
|
|
17718
|
+
}
|
|
17719
|
+
Remove.prototype = {
|
|
17720
|
+
onSpill: function onSpill(_ref4) {
|
|
17721
|
+
var dragEl2 = _ref4.dragEl, putSortable2 = _ref4.putSortable;
|
|
17722
|
+
var parentSortable = putSortable2 || this.sortable;
|
|
17723
|
+
parentSortable.captureAnimationState();
|
|
17724
|
+
dragEl2.parentNode && dragEl2.parentNode.removeChild(dragEl2);
|
|
17725
|
+
parentSortable.animateAll();
|
|
17726
|
+
},
|
|
17727
|
+
drop
|
|
17728
|
+
};
|
|
17729
|
+
_extends$p(Remove, {
|
|
17730
|
+
pluginName: "removeOnSpill"
|
|
17731
|
+
});
|
|
17732
|
+
Sortable.mount(new AutoScrollPlugin());
|
|
17733
|
+
Sortable.mount(Remove, Revert);
|
|
17734
|
+
var __async$2 = (__this, __arguments, generator) => {
|
|
17735
|
+
return new Promise((resolve, reject) => {
|
|
17736
|
+
var fulfilled = (value) => {
|
|
17737
|
+
try {
|
|
17738
|
+
step(generator.next(value));
|
|
17739
|
+
} catch (e) {
|
|
17740
|
+
reject(e);
|
|
17741
|
+
}
|
|
17742
|
+
};
|
|
17743
|
+
var rejected = (value) => {
|
|
17744
|
+
try {
|
|
17745
|
+
step(generator.throw(value));
|
|
17746
|
+
} catch (e) {
|
|
17747
|
+
reject(e);
|
|
17748
|
+
}
|
|
17749
|
+
};
|
|
17750
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
17751
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
17752
|
+
});
|
|
17753
|
+
};
|
|
17754
|
+
const [name$v, bem$u] = createNamespace("media-picker");
|
|
17755
|
+
const FILE_SIZE_LIMIT = 100;
|
|
17756
|
+
const mediaPickerProps = {
|
|
17757
|
+
sortable: {
|
|
17758
|
+
type: Boolean,
|
|
17759
|
+
default: false
|
|
17760
|
+
},
|
|
17761
|
+
disabled: Boolean,
|
|
17762
|
+
showTitle: Boolean,
|
|
17763
|
+
useFileNameAsLabel: Boolean,
|
|
17764
|
+
title: makeStringProp("添加附件"),
|
|
17765
|
+
mediaList: makeArrayProp(),
|
|
17766
|
+
// 图片压缩后的最大边长
|
|
17767
|
+
maxImageSideLength: makeNumberProp(1920),
|
|
17768
|
+
// 单个图片文件大小限制(本单位为KB,默认最大1M)
|
|
17769
|
+
maxImageFileSize: makeNumberProp(1024),
|
|
17770
|
+
// 单个文件大小限制(本单位为KB,默认最大1M)
|
|
17771
|
+
maxFileSize: makeNumberProp(FILE_SIZE_LIMIT * 1024),
|
|
17772
|
+
/**
|
|
17773
|
+
* {
|
|
17774
|
+
* maxImageSideLength,
|
|
17775
|
+
* address,
|
|
17776
|
+
* humanName,
|
|
17777
|
+
* projectName,
|
|
17778
|
+
* watermarkConfigString
|
|
17779
|
+
* (http://faq.egova.com.cn:7777/redmine/projects/redmine/wiki/%E6%8B%8D%E7%85%A7%E6%B0%B4%E5%8D%B0%E9%85%8D%E7%BD%AE)
|
|
17780
|
+
* }
|
|
17781
|
+
*/
|
|
17782
|
+
watermarkOptions: {
|
|
17783
|
+
type: Object,
|
|
17784
|
+
default: () => null
|
|
17785
|
+
},
|
|
17786
|
+
maxMediaCount: makeNumberProp(Number.MAX_VALUE),
|
|
17787
|
+
maxImageCount: makeNumberProp(Number.MAX_VALUE),
|
|
17788
|
+
maxAudioCount: makeNumberProp(Number.MAX_VALUE),
|
|
17789
|
+
maxVideoCount: makeNumberProp(Number.MAX_VALUE),
|
|
17790
|
+
allowTakePhoto: truthProp,
|
|
17791
|
+
allowPickPhoto: truthProp,
|
|
17792
|
+
allowTakeVideo: Boolean,
|
|
17793
|
+
allowPickVideo: Boolean,
|
|
17794
|
+
allowTakeAudio: Boolean,
|
|
17795
|
+
allowPickAudio: Boolean,
|
|
17796
|
+
allowPickFile: Boolean,
|
|
17797
|
+
// 预览函数(返回true时不再执行默认行为)
|
|
17798
|
+
// 参数:media,index
|
|
17799
|
+
preview: Function,
|
|
17800
|
+
// 点击按钮事件(返回true时不再执行默认行为)
|
|
17801
|
+
mediaPick: Function,
|
|
17802
|
+
// 文件读取前的回调函数,返回 false 可终止文件读取,支持返回 Promise
|
|
17803
|
+
beforeRead: Function,
|
|
17804
|
+
// 文件读取完成后的回调函数,获取到对应的 media 对象
|
|
17805
|
+
afterRead: Function,
|
|
17806
|
+
// 文件删除前的回调函数,返回 false 可终止文件读取,支持返回 Promise
|
|
17807
|
+
beforeDelete: Function,
|
|
17808
|
+
// 是否强制使用微信
|
|
17809
|
+
useWx: Boolean,
|
|
17810
|
+
imageSizeType: makeStringProp("compressed"),
|
|
17811
|
+
mediaPlayerProps: Object
|
|
17812
|
+
};
|
|
17813
|
+
var stdin_default$C = vue.defineComponent({
|
|
17814
|
+
name: name$v,
|
|
17815
|
+
props: mediaPickerProps,
|
|
17816
|
+
emits: ["update:mediaList", "delete", "processing"],
|
|
17817
|
+
setup(props, {
|
|
17818
|
+
emit,
|
|
15609
17819
|
slots
|
|
15610
17820
|
}) {
|
|
15611
17821
|
const videoOptionsVisible = vue.ref(false);
|
|
@@ -15621,7 +17831,29 @@
|
|
|
15621
17831
|
const audioRecorderInputRef = vue.ref();
|
|
15622
17832
|
const audioFileInputRef = vue.ref();
|
|
15623
17833
|
const fileInputRef = vue.ref();
|
|
17834
|
+
const gridRef = vue.ref();
|
|
15624
17835
|
const mediaListPlaceholder = vue.ref([]);
|
|
17836
|
+
const sort = vue.ref();
|
|
17837
|
+
vue.watch(() => props.mediaList.length, () => {
|
|
17838
|
+
var _a;
|
|
17839
|
+
if (sort.value || !props.sortable)
|
|
17840
|
+
return;
|
|
17841
|
+
sort.value = Sortable.create((_a = gridRef.value) == null ? void 0 : _a.$el, {
|
|
17842
|
+
animation: 200,
|
|
17843
|
+
handle: ".zt-grid-item",
|
|
17844
|
+
onEnd: (evt) => {
|
|
17845
|
+
const raws = exchangeArrayIndex(props.mediaList, evt.oldIndex, evt.newIndex);
|
|
17846
|
+
emit("update:mediaList", raws);
|
|
17847
|
+
}
|
|
17848
|
+
});
|
|
17849
|
+
});
|
|
17850
|
+
const exchangeArrayIndex = (list, index2, newIndex2) => {
|
|
17851
|
+
const raws = [...list];
|
|
17852
|
+
const raw = raws[index2];
|
|
17853
|
+
raws.splice(index2, 1);
|
|
17854
|
+
raws.splice(newIndex2, 0, raw);
|
|
17855
|
+
return [...raws];
|
|
17856
|
+
};
|
|
15625
17857
|
const checkFileCountBeforeAdd = (mediaType) => {
|
|
15626
17858
|
if (props.mediaList.length === props.maxMediaCount) {
|
|
15627
17859
|
showFailToast("已达到文件最大数量限制");
|
|
@@ -16201,12 +18433,12 @@
|
|
|
16201
18433
|
}
|
|
16202
18434
|
deleteMedia(media, index2);
|
|
16203
18435
|
});
|
|
16204
|
-
const previewMedia = (index$
|
|
18436
|
+
const previewMedia = (index$12) => __async$2(this, null, function* () {
|
|
16205
18437
|
var _a;
|
|
16206
|
-
if (props.preview && props.preview(props.mediaList, index$
|
|
18438
|
+
if (props.preview && props.preview(props.mediaList, index$12)) {
|
|
16207
18439
|
return;
|
|
16208
18440
|
}
|
|
16209
|
-
const media = props.mediaList[index$
|
|
18441
|
+
const media = props.mediaList[index$12];
|
|
16210
18442
|
if (media.type === "photo") {
|
|
16211
18443
|
const imageIndex = imageList.value.indexOf(media);
|
|
16212
18444
|
showImagePreview({
|
|
@@ -16294,7 +18526,8 @@
|
|
|
16294
18526
|
useExpose({
|
|
16295
18527
|
mediaPickAction,
|
|
16296
18528
|
handleInputFiles,
|
|
16297
|
-
transformImageFiles
|
|
18529
|
+
transformImageFiles,
|
|
18530
|
+
resetInput
|
|
16298
18531
|
});
|
|
16299
18532
|
return () => {
|
|
16300
18533
|
const title = props.showTitle && vue.createVNode("div", {
|
|
@@ -16319,6 +18552,7 @@
|
|
|
16319
18552
|
}, null), vue.withDirectives(vue.createVNode("div", {
|
|
16320
18553
|
"class": bem$u("line")
|
|
16321
18554
|
}, [renderButtons(), slots["extend"] ? slots.extend() : ""]), [[vue.vShow, showButtons]]), vue.withDirectives(vue.createVNode(stdin_default$X, {
|
|
18555
|
+
"ref": gridRef,
|
|
16322
18556
|
"column-num": "3",
|
|
16323
18557
|
"border": false,
|
|
16324
18558
|
"square": true,
|
|
@@ -16947,7 +19181,7 @@
|
|
|
16947
19181
|
});
|
|
16948
19182
|
const NoticeBar = withInstall(stdin_default$y);
|
|
16949
19183
|
const [name$q, bem$p] = createNamespace("notify");
|
|
16950
|
-
const notifyProps = extend({}, popupSharedProps, {
|
|
19184
|
+
const notifyProps = extend$1({}, popupSharedProps, {
|
|
16951
19185
|
type: makeStringProp("danger"),
|
|
16952
19186
|
color: String,
|
|
16953
19187
|
message: numericProp,
|
|
@@ -17028,7 +19262,7 @@
|
|
|
17028
19262
|
if (!instance) {
|
|
17029
19263
|
initInstance();
|
|
17030
19264
|
}
|
|
17031
|
-
options = extend({}, currentOptions, parseOptions(options));
|
|
19265
|
+
options = extend$1({}, currentOptions, parseOptions(options));
|
|
17032
19266
|
instance.open(options);
|
|
17033
19267
|
clearTimeout(timer);
|
|
17034
19268
|
if (options.duration > 0) {
|
|
@@ -17036,7 +19270,7 @@
|
|
|
17036
19270
|
}
|
|
17037
19271
|
return instance;
|
|
17038
19272
|
}
|
|
17039
|
-
const setNotifyDefaultOptions = (options) => extend(currentOptions, options);
|
|
19273
|
+
const setNotifyDefaultOptions = (options) => extend$1(currentOptions, options);
|
|
17040
19274
|
const resetNotifyDefaultOptions = () => {
|
|
17041
19275
|
currentOptions = getDefaultOptions();
|
|
17042
19276
|
};
|
|
@@ -18231,8 +20465,8 @@
|
|
|
18231
20465
|
}
|
|
18232
20466
|
function isContainingBlock(elementOrCss) {
|
|
18233
20467
|
const webkit = isWebKit();
|
|
18234
|
-
const
|
|
18235
|
-
return
|
|
20468
|
+
const css2 = isElement$1(elementOrCss) ? getComputedStyle$2(elementOrCss) : elementOrCss;
|
|
20469
|
+
return css2.transform !== "none" || css2.perspective !== "none" || (css2.containerType ? css2.containerType !== "normal" : false) || !webkit && (css2.backdropFilter ? css2.backdropFilter !== "none" : false) || !webkit && (css2.filter ? css2.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css2.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css2.contain || "").includes(value));
|
|
18236
20470
|
}
|
|
18237
20471
|
function getContainingBlock$1(element) {
|
|
18238
20472
|
let currentNode = getParentNode$1(element);
|
|
@@ -18313,9 +20547,9 @@
|
|
|
18313
20547
|
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
18314
20548
|
}
|
|
18315
20549
|
function getCssDimensions(element) {
|
|
18316
|
-
const
|
|
18317
|
-
let width2 = parseFloat(
|
|
18318
|
-
let height2 = parseFloat(
|
|
20550
|
+
const css2 = getComputedStyle$2(element);
|
|
20551
|
+
let width2 = parseFloat(css2.width) || 0;
|
|
20552
|
+
let height2 = parseFloat(css2.height) || 0;
|
|
18319
20553
|
const hasOffset = isHTMLElement$1(element);
|
|
18320
20554
|
const offsetWidth = hasOffset ? element.offsetWidth : width2;
|
|
18321
20555
|
const offsetHeight = hasOffset ? element.offsetHeight : height2;
|
|
@@ -18409,9 +20643,9 @@
|
|
|
18409
20643
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
18410
20644
|
const iframeScale = getScale(currentIFrame);
|
|
18411
20645
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
18412
|
-
const
|
|
18413
|
-
const left2 = iframeRect.left + (currentIFrame.clientLeft + parseFloat(
|
|
18414
|
-
const top2 = iframeRect.top + (currentIFrame.clientTop + parseFloat(
|
|
20646
|
+
const css2 = getComputedStyle$2(currentIFrame);
|
|
20647
|
+
const left2 = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css2.paddingLeft)) * iframeScale.x;
|
|
20648
|
+
const top2 = iframeRect.top + (currentIFrame.clientTop + parseFloat(css2.paddingTop)) * iframeScale.y;
|
|
18415
20649
|
x *= iframeScale.x;
|
|
18416
20650
|
y *= iframeScale.y;
|
|
18417
20651
|
width2 *= iframeScale.x;
|
|
@@ -19140,8 +21374,8 @@
|
|
|
19140
21374
|
currentNode = currentNode.host;
|
|
19141
21375
|
}
|
|
19142
21376
|
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
|
19143
|
-
var
|
|
19144
|
-
if (
|
|
21377
|
+
var css2 = getComputedStyle$1(currentNode);
|
|
21378
|
+
if (css2.transform !== "none" || css2.perspective !== "none" || css2.contain === "paint" || ["transform", "perspective"].indexOf(css2.willChange) !== -1 || isFirefox && css2.willChange === "filter" || isFirefox && css2.filter && css2.filter !== "none") {
|
|
19145
21379
|
return currentNode;
|
|
19146
21380
|
} else {
|
|
19147
21381
|
currentNode = currentNode.parentNode;
|
|
@@ -19793,7 +22027,7 @@
|
|
|
19793
22027
|
adaptive: false,
|
|
19794
22028
|
gpuAcceleration: false
|
|
19795
22029
|
}
|
|
19796
|
-
}, extend({}, offset_default, {
|
|
22030
|
+
}, extend$1({}, offset_default, {
|
|
19797
22031
|
options: {
|
|
19798
22032
|
offset: props.offset
|
|
19799
22033
|
}
|
|
@@ -20318,7 +22552,7 @@
|
|
|
20318
22552
|
return Number(translateY);
|
|
20319
22553
|
}
|
|
20320
22554
|
function assignDefaultFields(fields) {
|
|
20321
|
-
return extend(
|
|
22555
|
+
return extend$1(
|
|
20322
22556
|
{
|
|
20323
22557
|
text: "text",
|
|
20324
22558
|
value: "value",
|
|
@@ -20652,7 +22886,7 @@
|
|
|
20652
22886
|
}
|
|
20653
22887
|
const RADIO_PICKER_TITLE_HEIGHT = 44;
|
|
20654
22888
|
const RADIO_PICKER_SEARCH_HEIGHT = 60;
|
|
20655
|
-
const pickerSharedProps = extend({
|
|
22889
|
+
const pickerSharedProps = extend$1({
|
|
20656
22890
|
loading: Boolean,
|
|
20657
22891
|
readonly: Boolean,
|
|
20658
22892
|
allowHtml: Boolean,
|
|
@@ -20661,7 +22895,7 @@
|
|
|
20661
22895
|
swipeDuration: makeNumericProp(1e3),
|
|
20662
22896
|
title: makeStringProp("请选择")
|
|
20663
22897
|
}, pickerToolbarProps);
|
|
20664
|
-
const radioPickerProps = extend({}, pickerSharedProps, {
|
|
22898
|
+
const radioPickerProps = extend$1({}, pickerSharedProps, {
|
|
20665
22899
|
columns: makeArrayProp(),
|
|
20666
22900
|
modelValue: makeArrayProp(),
|
|
20667
22901
|
columnsFieldNames: Object,
|
|
@@ -20755,12 +22989,12 @@
|
|
|
20755
22989
|
});
|
|
20756
22990
|
}
|
|
20757
22991
|
vue.nextTick(() => {
|
|
20758
|
-
emit("change", extend({
|
|
22992
|
+
emit("change", extend$1({
|
|
20759
22993
|
columnIndex
|
|
20760
22994
|
}, getEventParams()));
|
|
20761
22995
|
});
|
|
20762
22996
|
};
|
|
20763
|
-
const onClickOption = (currentOption, columnIndex) => emit("clickOption", extend({
|
|
22997
|
+
const onClickOption = (currentOption, columnIndex) => emit("clickOption", extend$1({
|
|
20764
22998
|
columnIndex,
|
|
20765
22999
|
currentOption
|
|
20766
23000
|
}, getEventParams()));
|
|
@@ -22552,7 +24786,7 @@
|
|
|
22552
24786
|
});
|
|
22553
24787
|
const Tabbar = withInstall(stdin_default$c);
|
|
22554
24788
|
const [name$5, bem$5] = createNamespace("tabbar-item");
|
|
22555
|
-
const tabbarItemProps = extend({}, routeProps, {
|
|
24789
|
+
const tabbarItemProps = extend$1({}, routeProps, {
|
|
22556
24790
|
dot: Boolean,
|
|
22557
24791
|
icon: String,
|
|
22558
24792
|
name: numericProp,
|
|
@@ -23350,7 +25584,7 @@
|
|
|
23350
25584
|
} = props;
|
|
23351
25585
|
return vue.createVNode("div", {
|
|
23352
25586
|
"class": bem$1("preview-cover")
|
|
23353
|
-
}, [slots["preview-cover"](extend({
|
|
25587
|
+
}, [slots["preview-cover"](extend$1({
|
|
23354
25588
|
index: index2
|
|
23355
25589
|
}, item))]);
|
|
23356
25590
|
}
|
|
@@ -23536,7 +25770,7 @@
|
|
|
23536
25770
|
}
|
|
23537
25771
|
return item2.url;
|
|
23538
25772
|
}).filter(Boolean);
|
|
23539
|
-
imagePreview = showImagePreview(extend({
|
|
25773
|
+
imagePreview = showImagePreview(extend$1({
|
|
23540
25774
|
images,
|
|
23541
25775
|
startPosition: imageFiles.indexOf(item),
|
|
23542
25776
|
closeable: true,
|
|
@@ -23557,7 +25791,7 @@
|
|
|
23557
25791
|
};
|
|
23558
25792
|
const renderPreviewItem = (item, index2) => {
|
|
23559
25793
|
const needPickData = ["imageFit", "deletable", "previewSize", "beforeDelete"];
|
|
23560
|
-
const previewData = extend(pick(props, needPickData), pick(item, needPickData, true));
|
|
25794
|
+
const previewData = extend$1(pick(props, needPickData), pick(item, needPickData, true));
|
|
23561
25795
|
return vue.createVNode(stdin_default$6, vue.mergeProps({
|
|
23562
25796
|
"item": item,
|
|
23563
25797
|
"index": index2,
|
|
@@ -24388,7 +26622,7 @@
|
|
|
24388
26622
|
error,
|
|
24389
26623
|
throttleWait,
|
|
24390
26624
|
preLoadTop,
|
|
24391
|
-
dispatchEvent,
|
|
26625
|
+
dispatchEvent: dispatchEvent2,
|
|
24392
26626
|
loading,
|
|
24393
26627
|
attempt,
|
|
24394
26628
|
silent = true,
|
|
@@ -24405,7 +26639,7 @@
|
|
|
24405
26639
|
this.targets = [];
|
|
24406
26640
|
this.options = {
|
|
24407
26641
|
silent,
|
|
24408
|
-
dispatchEvent: !!
|
|
26642
|
+
dispatchEvent: !!dispatchEvent2,
|
|
24409
26643
|
throttleWait: throttleWait || 200,
|
|
24410
26644
|
preLoad: preLoad || 1.3,
|
|
24411
26645
|
preLoadTop: preLoadTop || 0,
|
|
@@ -25023,7 +27257,7 @@
|
|
|
25023
27257
|
});
|
|
25024
27258
|
}
|
|
25025
27259
|
};
|
|
25026
|
-
const version = "3.1.
|
|
27260
|
+
const version = "3.1.59";
|
|
25027
27261
|
function install(app) {
|
|
25028
27262
|
const components = [
|
|
25029
27263
|
ActionSheet,
|