antd-mobile 5.27.0 → 5.28.1
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/2x/README.md +1 -1
- package/2x/bundle/antd-mobile.cjs.development.js +681 -950
- package/2x/bundle/antd-mobile.cjs.js +9 -9
- package/2x/bundle/antd-mobile.es.development.js +681 -950
- package/2x/bundle/antd-mobile.es.js +5047 -5350
- package/2x/bundle/antd-mobile.umd.development.js +677 -946
- package/2x/bundle/antd-mobile.umd.js +9 -9
- package/2x/bundle/css-vars-patch.css +4 -0
- package/2x/bundle/style.css +0 -1
- package/2x/cjs/components/calendar/calendar.d.ts +1 -0
- package/2x/cjs/components/calendar/calendar.js +1 -1
- package/2x/cjs/components/cascader/cascader.patch.css +3 -0
- package/2x/cjs/components/ellipsis/ellipsis.d.ts +1 -0
- package/2x/cjs/components/ellipsis/ellipsis.js +3 -2
- package/2x/cjs/components/footer/footer.js +3 -3
- package/2x/cjs/components/input/input.js +1 -0
- package/2x/cjs/components/nav-bar/nav-bar.d.ts +2 -2
- package/2x/cjs/components/popup/popup.js +7 -1
- package/2x/cjs/components/steps/steps.css +0 -1
- package/2x/cjs/components/swiper/index.d.ts +1 -0
- package/2x/cjs/components/swiper/swiper.d.ts +9 -0
- package/2x/cjs/components/swiper/swiper.js +24 -5
- package/2x/cjs/components/text-area/text-area.js +4 -1
- package/2x/cjs/global/css-vars-patch.css +4 -0
- package/2x/cjs/locales/base.d.ts +1 -0
- package/2x/cjs/locales/base.js +2 -1
- package/2x/cjs/locales/en-US.d.ts +1 -0
- package/2x/cjs/locales/es-ES.d.ts +1 -0
- package/2x/cjs/locales/fa-IR.d.ts +1 -0
- package/2x/cjs/locales/fr-FR.d.ts +1 -0
- package/2x/cjs/locales/id-ID.d.ts +1 -0
- package/2x/cjs/locales/ja-JP.d.ts +1 -0
- package/2x/cjs/locales/kk-KZ.d.ts +1 -0
- package/2x/cjs/locales/ko-KR.d.ts +1 -0
- package/2x/cjs/locales/zh-CN.d.ts +1 -0
- package/2x/cjs/locales/zh-CN.js +2 -1
- package/2x/cjs/locales/zh-HK.d.ts +1 -0
- package/2x/cjs/locales/zh-HK.js +2 -1
- package/2x/cjs/locales/zh-TW.d.ts +1 -0
- package/2x/cjs/locales/zh-TW.js +2 -1
- package/2x/cjs/utils/with-func-props.d.ts +5 -0
- package/2x/cjs/utils/with-func-props.js +25 -0
- package/2x/es/components/calendar/calendar.d.ts +1 -0
- package/2x/es/components/calendar/calendar.js +1 -1
- package/2x/es/components/cascader/cascader.patch.css +3 -0
- package/2x/es/components/ellipsis/ellipsis.d.ts +1 -0
- package/2x/es/components/ellipsis/ellipsis.js +3 -2
- package/2x/es/components/footer/footer.js +1 -1
- package/2x/es/components/input/input.js +1 -0
- package/2x/es/components/nav-bar/nav-bar.d.ts +2 -2
- package/2x/es/components/popup/popup.js +7 -1
- package/2x/es/components/steps/steps.css +0 -1
- package/2x/es/components/swiper/index.d.ts +1 -0
- package/2x/es/components/swiper/swiper.d.ts +9 -0
- package/2x/es/components/swiper/swiper.js +24 -5
- package/2x/es/components/text-area/text-area.js +4 -1
- package/2x/es/global/css-vars-patch.css +4 -0
- package/2x/es/locales/base.d.ts +1 -0
- package/2x/es/locales/base.js +2 -1
- package/2x/es/locales/en-US.d.ts +1 -0
- package/2x/es/locales/es-ES.d.ts +1 -0
- package/2x/es/locales/fa-IR.d.ts +1 -0
- package/2x/es/locales/fr-FR.d.ts +1 -0
- package/2x/es/locales/id-ID.d.ts +1 -0
- package/2x/es/locales/ja-JP.d.ts +1 -0
- package/2x/es/locales/kk-KZ.d.ts +1 -0
- package/2x/es/locales/ko-KR.d.ts +1 -0
- package/2x/es/locales/zh-CN.d.ts +1 -0
- package/2x/es/locales/zh-CN.js +2 -1
- package/2x/es/locales/zh-HK.d.ts +1 -0
- package/2x/es/locales/zh-HK.js +2 -1
- package/2x/es/locales/zh-TW.d.ts +1 -0
- package/2x/es/locales/zh-TW.js +2 -1
- package/2x/es/utils/with-func-props.d.ts +5 -0
- package/2x/es/utils/with-func-props.js +19 -0
- package/2x/package.json +2 -2
- package/README.md +1 -1
- package/bundle/antd-mobile.cjs.development.js +681 -950
- package/bundle/antd-mobile.cjs.js +9 -9
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +681 -950
- package/bundle/antd-mobile.es.js +5047 -5350
- package/bundle/antd-mobile.umd.development.js +677 -946
- package/bundle/antd-mobile.umd.js +9 -9
- package/bundle/css-vars-patch.css +3 -0
- package/bundle/style.css +1 -1
- package/cjs/components/calendar/calendar.d.ts +1 -0
- package/cjs/components/calendar/calendar.js +1 -1
- package/cjs/components/cascader/cascader.patch.css +3 -0
- package/cjs/components/ellipsis/ellipsis.d.ts +1 -0
- package/cjs/components/ellipsis/ellipsis.js +3 -2
- package/cjs/components/footer/footer.js +3 -3
- package/cjs/components/input/input.js +1 -0
- package/cjs/components/nav-bar/nav-bar.d.ts +2 -2
- package/cjs/components/popup/popup.js +7 -1
- package/cjs/components/steps/steps.css +0 -1
- package/cjs/components/swiper/index.d.ts +1 -0
- package/cjs/components/swiper/swiper.d.ts +9 -0
- package/cjs/components/swiper/swiper.js +24 -5
- package/cjs/components/text-area/text-area.js +4 -1
- package/cjs/global/css-vars-patch.css +3 -0
- package/cjs/locales/base.d.ts +1 -0
- package/cjs/locales/base.js +2 -1
- package/cjs/locales/en-US.d.ts +1 -0
- package/cjs/locales/es-ES.d.ts +1 -0
- package/cjs/locales/fa-IR.d.ts +1 -0
- package/cjs/locales/fr-FR.d.ts +1 -0
- package/cjs/locales/id-ID.d.ts +1 -0
- package/cjs/locales/ja-JP.d.ts +1 -0
- package/cjs/locales/kk-KZ.d.ts +1 -0
- package/cjs/locales/ko-KR.d.ts +1 -0
- package/cjs/locales/zh-CN.d.ts +1 -0
- package/cjs/locales/zh-CN.js +2 -1
- package/cjs/locales/zh-HK.d.ts +1 -0
- package/cjs/locales/zh-HK.js +2 -1
- package/cjs/locales/zh-TW.d.ts +1 -0
- package/cjs/locales/zh-TW.js +2 -1
- package/cjs/utils/with-func-props.d.ts +5 -0
- package/cjs/utils/with-func-props.js +25 -0
- package/es/components/calendar/calendar.d.ts +1 -0
- package/es/components/calendar/calendar.js +1 -1
- package/es/components/cascader/cascader.patch.css +3 -0
- package/es/components/ellipsis/ellipsis.d.ts +1 -0
- package/es/components/ellipsis/ellipsis.js +3 -2
- package/es/components/footer/footer.js +1 -1
- package/es/components/input/input.js +1 -0
- package/es/components/nav-bar/nav-bar.d.ts +2 -2
- package/es/components/popup/popup.js +7 -1
- package/es/components/steps/steps.css +0 -1
- package/es/components/swiper/index.d.ts +1 -0
- package/es/components/swiper/swiper.d.ts +9 -0
- package/es/components/swiper/swiper.js +24 -5
- package/es/components/text-area/text-area.js +4 -1
- package/es/global/css-vars-patch.css +3 -0
- package/es/locales/base.d.ts +1 -0
- package/es/locales/base.js +2 -1
- package/es/locales/en-US.d.ts +1 -0
- package/es/locales/es-ES.d.ts +1 -0
- package/es/locales/fa-IR.d.ts +1 -0
- package/es/locales/fr-FR.d.ts +1 -0
- package/es/locales/id-ID.d.ts +1 -0
- package/es/locales/ja-JP.d.ts +1 -0
- package/es/locales/kk-KZ.d.ts +1 -0
- package/es/locales/ko-KR.d.ts +1 -0
- package/es/locales/zh-CN.d.ts +1 -0
- package/es/locales/zh-CN.js +2 -1
- package/es/locales/zh-HK.d.ts +1 -0
- package/es/locales/zh-HK.js +2 -1
- package/es/locales/zh-TW.d.ts +1 -0
- package/es/locales/zh-TW.js +2 -1
- package/es/utils/with-func-props.d.ts +5 -0
- package/es/utils/with-func-props.js +19 -0
- package/package.json +2 -2
- package/umd/antd-mobile.js +1 -1
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
return t;
|
|
44
44
|
}
|
|
45
|
-
function __awaiter
|
|
45
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
46
46
|
function adopt(value) {
|
|
47
47
|
return value instanceof P ? value : new P(function(resolve) {
|
|
48
48
|
resolve(value);
|
|
@@ -90,7 +90,8 @@
|
|
|
90
90
|
common: {
|
|
91
91
|
confirm: "Confirm",
|
|
92
92
|
cancel: "Cancel",
|
|
93
|
-
loading: "Loading"
|
|
93
|
+
loading: "Loading",
|
|
94
|
+
close: "Close"
|
|
94
95
|
},
|
|
95
96
|
Calendar: {
|
|
96
97
|
markItems: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
|
@@ -220,7 +221,8 @@
|
|
|
220
221
|
common: {
|
|
221
222
|
confirm: "\u786E\u5B9A",
|
|
222
223
|
cancel: "\u53D6\u6D88",
|
|
223
|
-
loading: "\u52A0\u8F7D\u4E2D"
|
|
224
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
225
|
+
close: "\u5173\u95ED"
|
|
224
226
|
},
|
|
225
227
|
Calendar: {
|
|
226
228
|
markItems: ["\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D", "\u65E5"],
|
|
@@ -904,48 +906,36 @@
|
|
|
904
906
|
return ret;
|
|
905
907
|
}
|
|
906
908
|
const popup = "";
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
}, deps);
|
|
922
|
-
};
|
|
923
|
-
};
|
|
924
|
-
var isFunction$1 = function isFunction2(value) {
|
|
925
|
-
return typeof value === "function";
|
|
926
|
-
};
|
|
927
|
-
var isNumber = function isNumber2(value) {
|
|
928
|
-
return typeof value === "number";
|
|
909
|
+
const createUpdateEffect = (hook) => (effect, deps) => {
|
|
910
|
+
const isMounted = React$4.useRef(false);
|
|
911
|
+
hook(() => {
|
|
912
|
+
return () => {
|
|
913
|
+
isMounted.current = false;
|
|
914
|
+
};
|
|
915
|
+
}, []);
|
|
916
|
+
hook(() => {
|
|
917
|
+
if (!isMounted.current) {
|
|
918
|
+
isMounted.current = true;
|
|
919
|
+
} else {
|
|
920
|
+
return effect();
|
|
921
|
+
}
|
|
922
|
+
}, deps);
|
|
929
923
|
};
|
|
930
|
-
|
|
924
|
+
const isFunction$1 = (value) => typeof value === "function";
|
|
925
|
+
const isNumber = (value) => typeof value === "number";
|
|
926
|
+
const isDev$1 = true;
|
|
931
927
|
const isDev$2 = isDev$1;
|
|
932
928
|
function useMemoizedFn(fn) {
|
|
933
929
|
if (isDev$2) {
|
|
934
930
|
if (!isFunction$1(fn)) {
|
|
935
|
-
console.error(
|
|
931
|
+
console.error(`useMemoizedFn expected parameter is a function, got ${typeof fn}`);
|
|
936
932
|
}
|
|
937
933
|
}
|
|
938
|
-
|
|
939
|
-
fnRef.current = React$4.useMemo(
|
|
940
|
-
|
|
941
|
-
}, [fn]);
|
|
942
|
-
var memoizedFn = React$4.useRef();
|
|
934
|
+
const fnRef = React$4.useRef(fn);
|
|
935
|
+
fnRef.current = React$4.useMemo(() => fn, [fn]);
|
|
936
|
+
const memoizedFn = React$4.useRef();
|
|
943
937
|
if (!memoizedFn.current) {
|
|
944
|
-
memoizedFn.current = function() {
|
|
945
|
-
var args = [];
|
|
946
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
947
|
-
args[_i] = arguments[_i];
|
|
948
|
-
}
|
|
938
|
+
memoizedFn.current = function(...args) {
|
|
949
939
|
return fnRef.current.apply(this, args);
|
|
950
940
|
};
|
|
951
941
|
}
|
|
@@ -955,28 +945,26 @@
|
|
|
955
945
|
function depsAreSame(oldDeps, deps) {
|
|
956
946
|
if (oldDeps === deps)
|
|
957
947
|
return true;
|
|
958
|
-
for (
|
|
948
|
+
for (let i = 0; i < oldDeps.length; i++) {
|
|
959
949
|
if (!Object.is(oldDeps[i], deps[i]))
|
|
960
950
|
return false;
|
|
961
951
|
}
|
|
962
952
|
return true;
|
|
963
953
|
}
|
|
964
954
|
function useLatest(value) {
|
|
965
|
-
|
|
955
|
+
const ref = React$4.useRef(value);
|
|
966
956
|
ref.current = value;
|
|
967
957
|
return ref;
|
|
968
958
|
}
|
|
969
|
-
|
|
959
|
+
const useUnmount = (fn) => {
|
|
970
960
|
if (isDev$2) {
|
|
971
961
|
if (!isFunction$1(fn)) {
|
|
972
|
-
console.error(
|
|
962
|
+
console.error(`useUnmount expected parameter is a function, got ${typeof fn}`);
|
|
973
963
|
}
|
|
974
964
|
}
|
|
975
|
-
|
|
976
|
-
React$4.useEffect(
|
|
977
|
-
|
|
978
|
-
fnRef.current();
|
|
979
|
-
};
|
|
965
|
+
const fnRef = useLatest(fn);
|
|
966
|
+
React$4.useEffect(() => () => {
|
|
967
|
+
fnRef.current();
|
|
980
968
|
}, []);
|
|
981
969
|
};
|
|
982
970
|
const useUnmount$1 = useUnmount;
|
|
@@ -1115,7 +1103,7 @@
|
|
|
1115
1103
|
return debounced;
|
|
1116
1104
|
}
|
|
1117
1105
|
var debounce_1 = debounce$1;
|
|
1118
|
-
|
|
1106
|
+
const isBrowser$2 = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
1119
1107
|
const isBrowser$3 = isBrowser$2;
|
|
1120
1108
|
var debounce = debounce_1, isObject$5 = isObject_1;
|
|
1121
1109
|
var FUNC_ERROR_TEXT$1 = "Expected a function";
|
|
@@ -1135,46 +1123,20 @@
|
|
|
1135
1123
|
});
|
|
1136
1124
|
}
|
|
1137
1125
|
var throttle_1 = throttle$1;
|
|
1138
|
-
|
|
1126
|
+
const useMount = (fn) => {
|
|
1139
1127
|
if (isDev$2) {
|
|
1140
1128
|
if (!isFunction$1(fn)) {
|
|
1141
|
-
console.error(
|
|
1129
|
+
console.error(`useMount: parameter \`fn\` expected to be a function, but got "${typeof fn}".`);
|
|
1142
1130
|
}
|
|
1143
1131
|
}
|
|
1144
|
-
React$4.useEffect(
|
|
1132
|
+
React$4.useEffect(() => {
|
|
1145
1133
|
fn === null || fn === void 0 ? void 0 : fn();
|
|
1146
1134
|
}, []);
|
|
1147
1135
|
};
|
|
1148
1136
|
const useMount$1 = useMount;
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
return o;
|
|
1153
|
-
var i = m.call(o), r, ar = [], e;
|
|
1154
|
-
try {
|
|
1155
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
1156
|
-
ar.push(r.value);
|
|
1157
|
-
}
|
|
1158
|
-
} catch (error) {
|
|
1159
|
-
e = {
|
|
1160
|
-
error
|
|
1161
|
-
};
|
|
1162
|
-
} finally {
|
|
1163
|
-
try {
|
|
1164
|
-
if (r && !r.done && (m = i["return"]))
|
|
1165
|
-
m.call(i);
|
|
1166
|
-
} finally {
|
|
1167
|
-
if (e)
|
|
1168
|
-
throw e.error;
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
return ar;
|
|
1172
|
-
};
|
|
1173
|
-
var useUpdate = function useUpdate2() {
|
|
1174
|
-
var _a = __read$7(React$4.useState({}), 2), setState = _a[1];
|
|
1175
|
-
return React$4.useCallback(function() {
|
|
1176
|
-
return setState({});
|
|
1177
|
-
}, []);
|
|
1137
|
+
const useUpdate = () => {
|
|
1138
|
+
const [, setState] = React$4.useState({});
|
|
1139
|
+
return React$4.useCallback(() => setState({}), []);
|
|
1178
1140
|
};
|
|
1179
1141
|
const useUpdate$1 = useUpdate;
|
|
1180
1142
|
function getTargetElement(target, defaultElement) {
|
|
@@ -1184,7 +1146,7 @@
|
|
|
1184
1146
|
if (!target) {
|
|
1185
1147
|
return defaultElement;
|
|
1186
1148
|
}
|
|
1187
|
-
|
|
1149
|
+
let targetElement;
|
|
1188
1150
|
if (isFunction$1(target)) {
|
|
1189
1151
|
targetElement = target();
|
|
1190
1152
|
} else if ("current" in target) {
|
|
@@ -1194,44 +1156,42 @@
|
|
|
1194
1156
|
}
|
|
1195
1157
|
return targetElement;
|
|
1196
1158
|
}
|
|
1197
|
-
|
|
1198
|
-
return targets.every(
|
|
1199
|
-
|
|
1159
|
+
const checkIfAllInShadow = (targets) => {
|
|
1160
|
+
return targets.every((item) => {
|
|
1161
|
+
const targetElement = getTargetElement(item);
|
|
1200
1162
|
if (!targetElement)
|
|
1201
1163
|
return false;
|
|
1202
1164
|
if (targetElement.getRootNode() instanceof ShadowRoot)
|
|
1203
1165
|
return true;
|
|
1204
1166
|
});
|
|
1205
1167
|
};
|
|
1206
|
-
|
|
1168
|
+
const getShadow = (node) => {
|
|
1207
1169
|
if (!node) {
|
|
1208
1170
|
return document;
|
|
1209
1171
|
}
|
|
1210
1172
|
return node.getRootNode();
|
|
1211
1173
|
};
|
|
1212
|
-
|
|
1174
|
+
const getDocumentOrShadow = (target) => {
|
|
1213
1175
|
if (!target || !document.getRootNode) {
|
|
1214
1176
|
return document;
|
|
1215
1177
|
}
|
|
1216
|
-
|
|
1178
|
+
const targets = Array.isArray(target) ? target : [target];
|
|
1217
1179
|
if (checkIfAllInShadow(targets)) {
|
|
1218
1180
|
return getShadow(getTargetElement(targets[0]));
|
|
1219
1181
|
}
|
|
1220
1182
|
return document;
|
|
1221
1183
|
};
|
|
1222
1184
|
const getDocumentOrShadow$1 = getDocumentOrShadow;
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
useEffectType(
|
|
1185
|
+
const createEffectWithTarget = (useEffectType) => {
|
|
1186
|
+
const useEffectWithTarget2 = (effect, deps, target) => {
|
|
1187
|
+
const hasInitRef = React$4.useRef(false);
|
|
1188
|
+
const lastElementRef = React$4.useRef([]);
|
|
1189
|
+
const lastDepsRef = React$4.useRef([]);
|
|
1190
|
+
const unLoadRef = React$4.useRef();
|
|
1191
|
+
useEffectType(() => {
|
|
1230
1192
|
var _a;
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
return getTargetElement(item);
|
|
1234
|
-
});
|
|
1193
|
+
const targets = Array.isArray(target) ? target : [target];
|
|
1194
|
+
const els = targets.map((item) => getTargetElement(item));
|
|
1235
1195
|
if (!hasInitRef.current) {
|
|
1236
1196
|
hasInitRef.current = true;
|
|
1237
1197
|
lastElementRef.current = els;
|
|
@@ -1246,7 +1206,7 @@
|
|
|
1246
1206
|
unLoadRef.current = effect();
|
|
1247
1207
|
}
|
|
1248
1208
|
});
|
|
1249
|
-
useUnmount$1(
|
|
1209
|
+
useUnmount$1(() => {
|
|
1250
1210
|
var _a;
|
|
1251
1211
|
(_a = unLoadRef.current) === null || _a === void 0 ? void 0 : _a.call(unLoadRef);
|
|
1252
1212
|
hasInitRef.current = false;
|
|
@@ -1255,33 +1215,26 @@
|
|
|
1255
1215
|
return useEffectWithTarget2;
|
|
1256
1216
|
};
|
|
1257
1217
|
const createEffectWithTarget$1 = createEffectWithTarget;
|
|
1258
|
-
|
|
1218
|
+
const useEffectWithTarget$1 = createEffectWithTarget$1(React$4.useEffect);
|
|
1259
1219
|
const useEffectWithTarget$2 = useEffectWithTarget$1;
|
|
1260
|
-
function useClickAway(onClickAway, target, eventName) {
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
var targets = Array.isArray(target) ? target : [target];
|
|
1268
|
-
if (targets.some(function(item) {
|
|
1269
|
-
var targetElement = getTargetElement(item);
|
|
1220
|
+
function useClickAway(onClickAway, target, eventName = "click") {
|
|
1221
|
+
const onClickAwayRef = useLatest(onClickAway);
|
|
1222
|
+
useEffectWithTarget$2(() => {
|
|
1223
|
+
const handler = (event) => {
|
|
1224
|
+
const targets = Array.isArray(target) ? target : [target];
|
|
1225
|
+
if (targets.some((item) => {
|
|
1226
|
+
const targetElement = getTargetElement(item);
|
|
1270
1227
|
return !targetElement || targetElement.contains(event.target);
|
|
1271
1228
|
})) {
|
|
1272
1229
|
return;
|
|
1273
1230
|
}
|
|
1274
1231
|
onClickAwayRef.current(event);
|
|
1275
1232
|
};
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
eventNames.forEach(
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
return function() {
|
|
1282
|
-
eventNames.forEach(function(event) {
|
|
1283
|
-
return documentOrShadow.removeEventListener(event, handler);
|
|
1284
|
-
});
|
|
1233
|
+
const documentOrShadow = getDocumentOrShadow$1(target);
|
|
1234
|
+
const eventNames = Array.isArray(eventName) ? eventName : [eventName];
|
|
1235
|
+
eventNames.forEach((event) => documentOrShadow.addEventListener(event, handler));
|
|
1236
|
+
return () => {
|
|
1237
|
+
eventNames.forEach((event) => documentOrShadow.removeEventListener(event, handler));
|
|
1285
1238
|
};
|
|
1286
1239
|
}, Array.isArray(eventName) ? eventName : [eventName], target);
|
|
1287
1240
|
}
|
|
@@ -1494,60 +1447,19 @@
|
|
|
1494
1447
|
});
|
|
1495
1448
|
})(dayjs_min);
|
|
1496
1449
|
const dayjs = dayjs_min.exports;
|
|
1497
|
-
var __read$6 = globalThis && globalThis.__read || function(o, n) {
|
|
1498
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1499
|
-
if (!m)
|
|
1500
|
-
return o;
|
|
1501
|
-
var i = m.call(o), r, ar = [], e;
|
|
1502
|
-
try {
|
|
1503
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
1504
|
-
ar.push(r.value);
|
|
1505
|
-
}
|
|
1506
|
-
} catch (error) {
|
|
1507
|
-
e = {
|
|
1508
|
-
error
|
|
1509
|
-
};
|
|
1510
|
-
} finally {
|
|
1511
|
-
try {
|
|
1512
|
-
if (r && !r.done && (m = i["return"]))
|
|
1513
|
-
m.call(i);
|
|
1514
|
-
} finally {
|
|
1515
|
-
if (e)
|
|
1516
|
-
throw e.error;
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
return ar;
|
|
1520
|
-
};
|
|
1521
|
-
var __spreadArray$2 = globalThis && globalThis.__spreadArray || function(to2, from, pack) {
|
|
1522
|
-
if (pack || arguments.length === 2)
|
|
1523
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1524
|
-
if (ar || !(i in from)) {
|
|
1525
|
-
if (!ar)
|
|
1526
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
1527
|
-
ar[i] = from[i];
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
return to2.concat(ar || Array.prototype.slice.call(from));
|
|
1531
|
-
};
|
|
1532
1450
|
function useDebounceFn(fn, options) {
|
|
1533
1451
|
var _a;
|
|
1534
1452
|
if (isDev$2) {
|
|
1535
1453
|
if (!isFunction$1(fn)) {
|
|
1536
|
-
console.error(
|
|
1454
|
+
console.error(`useDebounceFn expected parameter is a function, got ${typeof fn}`);
|
|
1537
1455
|
}
|
|
1538
1456
|
}
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
return
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
args[_i] = arguments[_i];
|
|
1546
|
-
}
|
|
1547
|
-
return fnRef.current.apply(fnRef, __spreadArray$2([], __read$6(args), false));
|
|
1548
|
-
}, wait, options);
|
|
1549
|
-
}, []);
|
|
1550
|
-
useUnmount$1(function() {
|
|
1457
|
+
const fnRef = useLatest(fn);
|
|
1458
|
+
const wait = (_a = options === null || options === void 0 ? void 0 : options.wait) !== null && _a !== void 0 ? _a : 1e3;
|
|
1459
|
+
const debounced = React$4.useMemo(() => debounce_1((...args) => {
|
|
1460
|
+
return fnRef.current(...args);
|
|
1461
|
+
}, wait, options), []);
|
|
1462
|
+
useUnmount$1(() => {
|
|
1551
1463
|
debounced.cancel();
|
|
1552
1464
|
});
|
|
1553
1465
|
return {
|
|
@@ -1556,36 +1468,14 @@
|
|
|
1556
1468
|
flush: debounced.flush
|
|
1557
1469
|
};
|
|
1558
1470
|
}
|
|
1559
|
-
var __read$5 = globalThis && globalThis.__read || function(o, n) {
|
|
1560
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1561
|
-
if (!m)
|
|
1562
|
-
return o;
|
|
1563
|
-
var i = m.call(o), r, ar = [], e;
|
|
1564
|
-
try {
|
|
1565
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
1566
|
-
ar.push(r.value);
|
|
1567
|
-
}
|
|
1568
|
-
} catch (error) {
|
|
1569
|
-
e = {
|
|
1570
|
-
error
|
|
1571
|
-
};
|
|
1572
|
-
} finally {
|
|
1573
|
-
try {
|
|
1574
|
-
if (r && !r.done && (m = i["return"]))
|
|
1575
|
-
m.call(i);
|
|
1576
|
-
} finally {
|
|
1577
|
-
if (e)
|
|
1578
|
-
throw e.error;
|
|
1579
|
-
}
|
|
1580
|
-
}
|
|
1581
|
-
return ar;
|
|
1582
|
-
};
|
|
1583
1471
|
function useDebounceEffect(effect, deps, options) {
|
|
1584
|
-
|
|
1585
|
-
|
|
1472
|
+
const [flag, setFlag] = React$4.useState({});
|
|
1473
|
+
const {
|
|
1474
|
+
run
|
|
1475
|
+
} = useDebounceFn(() => {
|
|
1586
1476
|
setFlag({});
|
|
1587
|
-
}, options)
|
|
1588
|
-
React$4.useEffect(
|
|
1477
|
+
}, options);
|
|
1478
|
+
React$4.useEffect(() => {
|
|
1589
1479
|
return run();
|
|
1590
1480
|
}, deps);
|
|
1591
1481
|
useUpdateEffect(effect, [flag]);
|
|
@@ -2706,333 +2596,66 @@
|
|
|
2706
2596
|
window.IntersectionObserver = IntersectionObserver2;
|
|
2707
2597
|
window.IntersectionObserverEntry = IntersectionObserverEntry;
|
|
2708
2598
|
})();
|
|
2709
|
-
var __assign = globalThis && globalThis.__assign || function() {
|
|
2710
|
-
__assign = Object.assign || function(t) {
|
|
2711
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2712
|
-
s = arguments[i];
|
|
2713
|
-
for (var p in s) {
|
|
2714
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
2715
|
-
t[p] = s[p];
|
|
2716
|
-
}
|
|
2717
|
-
}
|
|
2718
|
-
return t;
|
|
2719
|
-
};
|
|
2720
|
-
return __assign.apply(this, arguments);
|
|
2721
|
-
};
|
|
2722
|
-
var __read$4 = globalThis && globalThis.__read || function(o, n) {
|
|
2723
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2724
|
-
if (!m)
|
|
2725
|
-
return o;
|
|
2726
|
-
var i = m.call(o), r, ar = [], e;
|
|
2727
|
-
try {
|
|
2728
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
2729
|
-
ar.push(r.value);
|
|
2730
|
-
}
|
|
2731
|
-
} catch (error) {
|
|
2732
|
-
e = {
|
|
2733
|
-
error
|
|
2734
|
-
};
|
|
2735
|
-
} finally {
|
|
2736
|
-
try {
|
|
2737
|
-
if (r && !r.done && (m = i["return"]))
|
|
2738
|
-
m.call(i);
|
|
2739
|
-
} finally {
|
|
2740
|
-
if (e)
|
|
2741
|
-
throw e.error;
|
|
2742
|
-
}
|
|
2743
|
-
}
|
|
2744
|
-
return ar;
|
|
2745
|
-
};
|
|
2746
|
-
var __values = globalThis && globalThis.__values || function(o) {
|
|
2747
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
2748
|
-
if (m)
|
|
2749
|
-
return m.call(o);
|
|
2750
|
-
if (o && typeof o.length === "number")
|
|
2751
|
-
return {
|
|
2752
|
-
next: function next() {
|
|
2753
|
-
if (o && i >= o.length)
|
|
2754
|
-
o = void 0;
|
|
2755
|
-
return {
|
|
2756
|
-
value: o && o[i++],
|
|
2757
|
-
done: !o
|
|
2758
|
-
};
|
|
2759
|
-
}
|
|
2760
|
-
};
|
|
2761
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
2762
|
-
};
|
|
2763
2599
|
function useInViewport(target, options) {
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
useEffectWithTarget$2(
|
|
2767
|
-
|
|
2600
|
+
const [state, setState] = React$4.useState();
|
|
2601
|
+
const [ratio, setRatio] = React$4.useState();
|
|
2602
|
+
useEffectWithTarget$2(() => {
|
|
2603
|
+
const el = getTargetElement(target);
|
|
2768
2604
|
if (!el) {
|
|
2769
2605
|
return;
|
|
2770
2606
|
}
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
var entry = entries_1_1.value;
|
|
2776
|
-
setRatio(entry.intersectionRatio);
|
|
2777
|
-
setState(entry.isIntersecting);
|
|
2778
|
-
}
|
|
2779
|
-
} catch (e_1_1) {
|
|
2780
|
-
e_1 = {
|
|
2781
|
-
error: e_1_1
|
|
2782
|
-
};
|
|
2783
|
-
} finally {
|
|
2784
|
-
try {
|
|
2785
|
-
if (entries_1_1 && !entries_1_1.done && (_a2 = entries_1["return"]))
|
|
2786
|
-
_a2.call(entries_1);
|
|
2787
|
-
} finally {
|
|
2788
|
-
if (e_1)
|
|
2789
|
-
throw e_1.error;
|
|
2790
|
-
}
|
|
2607
|
+
const observer = new IntersectionObserver((entries) => {
|
|
2608
|
+
for (const entry of entries) {
|
|
2609
|
+
setRatio(entry.intersectionRatio);
|
|
2610
|
+
setState(entry.isIntersecting);
|
|
2791
2611
|
}
|
|
2792
|
-
},
|
|
2612
|
+
}, Object.assign(Object.assign({}, options), {
|
|
2793
2613
|
root: getTargetElement(options === null || options === void 0 ? void 0 : options.root)
|
|
2794
2614
|
}));
|
|
2795
2615
|
observer.observe(el);
|
|
2796
|
-
return
|
|
2616
|
+
return () => {
|
|
2797
2617
|
observer.disconnect();
|
|
2798
2618
|
};
|
|
2799
|
-
}, [], target);
|
|
2619
|
+
}, [options === null || options === void 0 ? void 0 : options.rootMargin, options === null || options === void 0 ? void 0 : options.threshold], target);
|
|
2800
2620
|
return [state, ratio];
|
|
2801
2621
|
}
|
|
2802
|
-
|
|
2622
|
+
const useIsomorphicLayoutEffect$1 = isBrowser$3 ? React$4.useLayoutEffect : React$4.useEffect;
|
|
2803
2623
|
const useIsomorphicLayoutEffect$2 = useIsomorphicLayoutEffect$1;
|
|
2804
|
-
var __awaiter = globalThis && globalThis.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
2805
|
-
function adopt(value) {
|
|
2806
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
2807
|
-
resolve(value);
|
|
2808
|
-
});
|
|
2809
|
-
}
|
|
2810
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
2811
|
-
function fulfilled(value) {
|
|
2812
|
-
try {
|
|
2813
|
-
step(generator.next(value));
|
|
2814
|
-
} catch (e) {
|
|
2815
|
-
reject(e);
|
|
2816
|
-
}
|
|
2817
|
-
}
|
|
2818
|
-
function rejected(value) {
|
|
2819
|
-
try {
|
|
2820
|
-
step(generator["throw"](value));
|
|
2821
|
-
} catch (e) {
|
|
2822
|
-
reject(e);
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
function step(result2) {
|
|
2826
|
-
result2.done ? resolve(result2.value) : adopt(result2.value).then(fulfilled, rejected);
|
|
2827
|
-
}
|
|
2828
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2829
|
-
});
|
|
2830
|
-
};
|
|
2831
|
-
var __generator = globalThis && globalThis.__generator || function(thisArg, body) {
|
|
2832
|
-
var _ = {
|
|
2833
|
-
label: 0,
|
|
2834
|
-
sent: function sent() {
|
|
2835
|
-
if (t[0] & 1)
|
|
2836
|
-
throw t[1];
|
|
2837
|
-
return t[1];
|
|
2838
|
-
},
|
|
2839
|
-
trys: [],
|
|
2840
|
-
ops: []
|
|
2841
|
-
}, f, y, t, g;
|
|
2842
|
-
return g = {
|
|
2843
|
-
next: verb(0),
|
|
2844
|
-
"throw": verb(1),
|
|
2845
|
-
"return": verb(2)
|
|
2846
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
2847
|
-
return this;
|
|
2848
|
-
}), g;
|
|
2849
|
-
function verb(n) {
|
|
2850
|
-
return function(v) {
|
|
2851
|
-
return step([n, v]);
|
|
2852
|
-
};
|
|
2853
|
-
}
|
|
2854
|
-
function step(op) {
|
|
2855
|
-
if (f)
|
|
2856
|
-
throw new TypeError("Generator is already executing.");
|
|
2857
|
-
while (_) {
|
|
2858
|
-
try {
|
|
2859
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
2860
|
-
return t;
|
|
2861
|
-
if (y = 0, t)
|
|
2862
|
-
op = [op[0] & 2, t.value];
|
|
2863
|
-
switch (op[0]) {
|
|
2864
|
-
case 0:
|
|
2865
|
-
case 1:
|
|
2866
|
-
t = op;
|
|
2867
|
-
break;
|
|
2868
|
-
case 4:
|
|
2869
|
-
_.label++;
|
|
2870
|
-
return {
|
|
2871
|
-
value: op[1],
|
|
2872
|
-
done: false
|
|
2873
|
-
};
|
|
2874
|
-
case 5:
|
|
2875
|
-
_.label++;
|
|
2876
|
-
y = op[1];
|
|
2877
|
-
op = [0];
|
|
2878
|
-
continue;
|
|
2879
|
-
case 7:
|
|
2880
|
-
op = _.ops.pop();
|
|
2881
|
-
_.trys.pop();
|
|
2882
|
-
continue;
|
|
2883
|
-
default:
|
|
2884
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
2885
|
-
_ = 0;
|
|
2886
|
-
continue;
|
|
2887
|
-
}
|
|
2888
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
2889
|
-
_.label = op[1];
|
|
2890
|
-
break;
|
|
2891
|
-
}
|
|
2892
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
2893
|
-
_.label = t[1];
|
|
2894
|
-
t = op;
|
|
2895
|
-
break;
|
|
2896
|
-
}
|
|
2897
|
-
if (t && _.label < t[2]) {
|
|
2898
|
-
_.label = t[2];
|
|
2899
|
-
_.ops.push(op);
|
|
2900
|
-
break;
|
|
2901
|
-
}
|
|
2902
|
-
if (t[2])
|
|
2903
|
-
_.ops.pop();
|
|
2904
|
-
_.trys.pop();
|
|
2905
|
-
continue;
|
|
2906
|
-
}
|
|
2907
|
-
op = body.call(thisArg, _);
|
|
2908
|
-
} catch (e) {
|
|
2909
|
-
op = [6, e];
|
|
2910
|
-
y = 0;
|
|
2911
|
-
} finally {
|
|
2912
|
-
f = t = 0;
|
|
2913
|
-
}
|
|
2914
|
-
}
|
|
2915
|
-
if (op[0] & 5)
|
|
2916
|
-
throw op[1];
|
|
2917
|
-
return {
|
|
2918
|
-
value: op[0] ? op[1] : void 0,
|
|
2919
|
-
done: true
|
|
2920
|
-
};
|
|
2921
|
-
}
|
|
2922
|
-
};
|
|
2923
|
-
var __read$3 = globalThis && globalThis.__read || function(o, n) {
|
|
2924
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2925
|
-
if (!m)
|
|
2926
|
-
return o;
|
|
2927
|
-
var i = m.call(o), r, ar = [], e;
|
|
2928
|
-
try {
|
|
2929
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
2930
|
-
ar.push(r.value);
|
|
2931
|
-
}
|
|
2932
|
-
} catch (error) {
|
|
2933
|
-
e = {
|
|
2934
|
-
error
|
|
2935
|
-
};
|
|
2936
|
-
} finally {
|
|
2937
|
-
try {
|
|
2938
|
-
if (r && !r.done && (m = i["return"]))
|
|
2939
|
-
m.call(i);
|
|
2940
|
-
} finally {
|
|
2941
|
-
if (e)
|
|
2942
|
-
throw e.error;
|
|
2943
|
-
}
|
|
2944
|
-
}
|
|
2945
|
-
return ar;
|
|
2946
|
-
};
|
|
2947
|
-
var __spreadArray$1 = globalThis && globalThis.__spreadArray || function(to2, from, pack) {
|
|
2948
|
-
if (pack || arguments.length === 2)
|
|
2949
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
2950
|
-
if (ar || !(i in from)) {
|
|
2951
|
-
if (!ar)
|
|
2952
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
2953
|
-
ar[i] = from[i];
|
|
2954
|
-
}
|
|
2955
|
-
}
|
|
2956
|
-
return to2.concat(ar || Array.prototype.slice.call(from));
|
|
2957
|
-
};
|
|
2958
2624
|
function useLockFn(fn) {
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
args[_i] = arguments[_i];
|
|
2965
|
-
}
|
|
2966
|
-
return __awaiter(_this, void 0, void 0, function() {
|
|
2967
|
-
var ret, e_1;
|
|
2968
|
-
return __generator(this, function(_a) {
|
|
2969
|
-
switch (_a.label) {
|
|
2970
|
-
case 0:
|
|
2971
|
-
if (lockRef.current)
|
|
2972
|
-
return [2];
|
|
2973
|
-
lockRef.current = true;
|
|
2974
|
-
_a.label = 1;
|
|
2975
|
-
case 1:
|
|
2976
|
-
_a.trys.push([1, 3, , 4]);
|
|
2977
|
-
return [4, fn.apply(void 0, __spreadArray$1([], __read$3(args), false))];
|
|
2978
|
-
case 2:
|
|
2979
|
-
ret = _a.sent();
|
|
2980
|
-
lockRef.current = false;
|
|
2981
|
-
return [2, ret];
|
|
2982
|
-
case 3:
|
|
2983
|
-
e_1 = _a.sent();
|
|
2984
|
-
lockRef.current = false;
|
|
2985
|
-
throw e_1;
|
|
2986
|
-
case 4:
|
|
2987
|
-
return [2];
|
|
2988
|
-
}
|
|
2989
|
-
});
|
|
2990
|
-
});
|
|
2991
|
-
}, [fn]);
|
|
2992
|
-
}
|
|
2993
|
-
var __read$2 = globalThis && globalThis.__read || function(o, n) {
|
|
2994
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2995
|
-
if (!m)
|
|
2996
|
-
return o;
|
|
2997
|
-
var i = m.call(o), r, ar = [], e;
|
|
2998
|
-
try {
|
|
2999
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
3000
|
-
ar.push(r.value);
|
|
3001
|
-
}
|
|
3002
|
-
} catch (error) {
|
|
3003
|
-
e = {
|
|
3004
|
-
error
|
|
3005
|
-
};
|
|
3006
|
-
} finally {
|
|
2625
|
+
const lockRef = React$4.useRef(false);
|
|
2626
|
+
return React$4.useCallback((...args) => __awaiter(this, void 0, void 0, function* () {
|
|
2627
|
+
if (lockRef.current)
|
|
2628
|
+
return;
|
|
2629
|
+
lockRef.current = true;
|
|
3007
2630
|
try {
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
2631
|
+
const ret = yield fn(...args);
|
|
2632
|
+
lockRef.current = false;
|
|
2633
|
+
return ret;
|
|
2634
|
+
} catch (e) {
|
|
2635
|
+
lockRef.current = false;
|
|
2636
|
+
throw e;
|
|
3013
2637
|
}
|
|
3014
|
-
}
|
|
3015
|
-
|
|
3016
|
-
};
|
|
2638
|
+
}), [fn]);
|
|
2639
|
+
}
|
|
3017
2640
|
function useRafState(initialState) {
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
2641
|
+
const ref = React$4.useRef(0);
|
|
2642
|
+
const [state, setState] = React$4.useState(initialState);
|
|
2643
|
+
const setRafState = React$4.useCallback((value) => {
|
|
3021
2644
|
cancelAnimationFrame(ref.current);
|
|
3022
|
-
ref.current = requestAnimationFrame(
|
|
2645
|
+
ref.current = requestAnimationFrame(() => {
|
|
3023
2646
|
setState(value);
|
|
3024
2647
|
});
|
|
3025
2648
|
}, []);
|
|
3026
|
-
useUnmount$1(
|
|
2649
|
+
useUnmount$1(() => {
|
|
3027
2650
|
cancelAnimationFrame(ref.current);
|
|
3028
2651
|
});
|
|
3029
2652
|
return [state, setRafState];
|
|
3030
2653
|
}
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
React$4.useEffect(
|
|
2654
|
+
const useUnmountedRef = () => {
|
|
2655
|
+
const unmountedRef = React$4.useRef(false);
|
|
2656
|
+
React$4.useEffect(() => {
|
|
3034
2657
|
unmountedRef.current = false;
|
|
3035
|
-
return
|
|
2658
|
+
return () => {
|
|
3036
2659
|
unmountedRef.current = true;
|
|
3037
2660
|
};
|
|
3038
2661
|
}, []);
|
|
@@ -3510,44 +3133,23 @@
|
|
|
3510
3133
|
}
|
|
3511
3134
|
return ResizeObserver$1;
|
|
3512
3135
|
}();
|
|
3513
|
-
|
|
3136
|
+
const useEffectWithTarget = createEffectWithTarget$1(React$4.useLayoutEffect);
|
|
3514
3137
|
const useLayoutEffectWithTarget = useEffectWithTarget;
|
|
3515
|
-
|
|
3138
|
+
const useIsomorphicLayoutEffectWithTarget = isBrowser$3 ? useLayoutEffectWithTarget : useEffectWithTarget$2;
|
|
3516
3139
|
const useIsomorphicLayoutEffectWithTarget$1 = useIsomorphicLayoutEffectWithTarget;
|
|
3517
|
-
var __read$1 = globalThis && globalThis.__read || function(o, n) {
|
|
3518
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3519
|
-
if (!m)
|
|
3520
|
-
return o;
|
|
3521
|
-
var i = m.call(o), r, ar = [], e;
|
|
3522
|
-
try {
|
|
3523
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
3524
|
-
ar.push(r.value);
|
|
3525
|
-
}
|
|
3526
|
-
} catch (error) {
|
|
3527
|
-
e = {
|
|
3528
|
-
error
|
|
3529
|
-
};
|
|
3530
|
-
} finally {
|
|
3531
|
-
try {
|
|
3532
|
-
if (r && !r.done && (m = i["return"]))
|
|
3533
|
-
m.call(i);
|
|
3534
|
-
} finally {
|
|
3535
|
-
if (e)
|
|
3536
|
-
throw e.error;
|
|
3537
|
-
}
|
|
3538
|
-
}
|
|
3539
|
-
return ar;
|
|
3540
|
-
};
|
|
3541
3140
|
function useSize(target) {
|
|
3542
|
-
|
|
3543
|
-
useIsomorphicLayoutEffectWithTarget$1(
|
|
3544
|
-
|
|
3141
|
+
const [state, setState] = useRafState();
|
|
3142
|
+
useIsomorphicLayoutEffectWithTarget$1(() => {
|
|
3143
|
+
const el = getTargetElement(target);
|
|
3545
3144
|
if (!el) {
|
|
3546
3145
|
return;
|
|
3547
3146
|
}
|
|
3548
|
-
|
|
3549
|
-
entries.forEach(
|
|
3550
|
-
|
|
3147
|
+
const resizeObserver = new index$k((entries) => {
|
|
3148
|
+
entries.forEach((entry) => {
|
|
3149
|
+
const {
|
|
3150
|
+
clientWidth,
|
|
3151
|
+
clientHeight
|
|
3152
|
+
} = entry.target;
|
|
3551
3153
|
setState({
|
|
3552
3154
|
width: clientWidth,
|
|
3553
3155
|
height: clientHeight
|
|
@@ -3555,66 +3157,25 @@
|
|
|
3555
3157
|
});
|
|
3556
3158
|
});
|
|
3557
3159
|
resizeObserver.observe(el);
|
|
3558
|
-
return
|
|
3160
|
+
return () => {
|
|
3559
3161
|
resizeObserver.disconnect();
|
|
3560
3162
|
};
|
|
3561
3163
|
}, [], target);
|
|
3562
3164
|
return state;
|
|
3563
3165
|
}
|
|
3564
|
-
var __read = globalThis && globalThis.__read || function(o, n) {
|
|
3565
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3566
|
-
if (!m)
|
|
3567
|
-
return o;
|
|
3568
|
-
var i = m.call(o), r, ar = [], e;
|
|
3569
|
-
try {
|
|
3570
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
3571
|
-
ar.push(r.value);
|
|
3572
|
-
}
|
|
3573
|
-
} catch (error) {
|
|
3574
|
-
e = {
|
|
3575
|
-
error
|
|
3576
|
-
};
|
|
3577
|
-
} finally {
|
|
3578
|
-
try {
|
|
3579
|
-
if (r && !r.done && (m = i["return"]))
|
|
3580
|
-
m.call(i);
|
|
3581
|
-
} finally {
|
|
3582
|
-
if (e)
|
|
3583
|
-
throw e.error;
|
|
3584
|
-
}
|
|
3585
|
-
}
|
|
3586
|
-
return ar;
|
|
3587
|
-
};
|
|
3588
|
-
var __spreadArray = globalThis && globalThis.__spreadArray || function(to2, from, pack) {
|
|
3589
|
-
if (pack || arguments.length === 2)
|
|
3590
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3591
|
-
if (ar || !(i in from)) {
|
|
3592
|
-
if (!ar)
|
|
3593
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
3594
|
-
ar[i] = from[i];
|
|
3595
|
-
}
|
|
3596
|
-
}
|
|
3597
|
-
return to2.concat(ar || Array.prototype.slice.call(from));
|
|
3598
|
-
};
|
|
3599
3166
|
function useThrottleFn(fn, options) {
|
|
3600
3167
|
var _a;
|
|
3601
3168
|
if (isDev$2) {
|
|
3602
3169
|
if (!isFunction$1(fn)) {
|
|
3603
|
-
console.error(
|
|
3170
|
+
console.error(`useThrottleFn expected parameter is a function, got ${typeof fn}`);
|
|
3604
3171
|
}
|
|
3605
3172
|
}
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
return
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
args[_i] = arguments[_i];
|
|
3613
|
-
}
|
|
3614
|
-
return fnRef.current.apply(fnRef, __spreadArray([], __read(args), false));
|
|
3615
|
-
}, wait, options);
|
|
3616
|
-
}, []);
|
|
3617
|
-
useUnmount$1(function() {
|
|
3173
|
+
const fnRef = useLatest(fn);
|
|
3174
|
+
const wait = (_a = options === null || options === void 0 ? void 0 : options.wait) !== null && _a !== void 0 ? _a : 1e3;
|
|
3175
|
+
const throttled = React$4.useMemo(() => throttle_1((...args) => {
|
|
3176
|
+
return fnRef.current(...args);
|
|
3177
|
+
}, wait, options), []);
|
|
3178
|
+
useUnmount$1(() => {
|
|
3618
3179
|
throttled.cancel();
|
|
3619
3180
|
});
|
|
3620
3181
|
return {
|
|
@@ -3624,22 +3185,22 @@
|
|
|
3624
3185
|
};
|
|
3625
3186
|
}
|
|
3626
3187
|
function useTimeout(fn, delay) {
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
React$4.useEffect(
|
|
3188
|
+
const fnRef = useLatest(fn);
|
|
3189
|
+
const timerRef = React$4.useRef(null);
|
|
3190
|
+
React$4.useEffect(() => {
|
|
3630
3191
|
if (!isNumber(delay) || delay < 0) {
|
|
3631
3192
|
return;
|
|
3632
3193
|
}
|
|
3633
|
-
timerRef.current = setTimeout(
|
|
3194
|
+
timerRef.current = setTimeout(() => {
|
|
3634
3195
|
fnRef.current();
|
|
3635
3196
|
}, delay);
|
|
3636
|
-
return
|
|
3197
|
+
return () => {
|
|
3637
3198
|
if (timerRef.current) {
|
|
3638
3199
|
clearTimeout(timerRef.current);
|
|
3639
3200
|
}
|
|
3640
3201
|
};
|
|
3641
3202
|
}, [delay]);
|
|
3642
|
-
|
|
3203
|
+
const clear2 = React$4.useCallback(() => {
|
|
3643
3204
|
if (timerRef.current) {
|
|
3644
3205
|
clearTimeout(timerRef.current);
|
|
3645
3206
|
}
|
|
@@ -4131,6 +3692,7 @@
|
|
|
4131
3692
|
const index2 = arr.findIndex(test);
|
|
4132
3693
|
return index2 < 0 ? arr.length : index2;
|
|
4133
3694
|
}
|
|
3695
|
+
const clamp$1 = (min2, max2, v) => Math.min(Math.max(v, min2), max2);
|
|
4134
3696
|
const colors = {
|
|
4135
3697
|
transparent: 0,
|
|
4136
3698
|
aliceblue: 4042850303,
|
|
@@ -4452,6 +4014,64 @@
|
|
|
4452
4014
|
break;
|
|
4453
4015
|
return i - 1;
|
|
4454
4016
|
}
|
|
4017
|
+
const steps$1 = (steps2, direction = "end") => (progress) => {
|
|
4018
|
+
progress = direction === "end" ? Math.min(progress, 0.999) : Math.max(progress, 1e-3);
|
|
4019
|
+
const expanded = progress * steps2;
|
|
4020
|
+
const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded);
|
|
4021
|
+
return clamp$1(0, 1, rounded / steps2);
|
|
4022
|
+
};
|
|
4023
|
+
const c1 = 1.70158;
|
|
4024
|
+
const c2 = c1 * 1.525;
|
|
4025
|
+
const c3 = c1 + 1;
|
|
4026
|
+
const c4 = 2 * Math.PI / 3;
|
|
4027
|
+
const c5 = 2 * Math.PI / 4.5;
|
|
4028
|
+
const bounceOut = (x) => {
|
|
4029
|
+
const n1 = 7.5625;
|
|
4030
|
+
const d1 = 2.75;
|
|
4031
|
+
if (x < 1 / d1) {
|
|
4032
|
+
return n1 * x * x;
|
|
4033
|
+
} else if (x < 2 / d1) {
|
|
4034
|
+
return n1 * (x -= 1.5 / d1) * x + 0.75;
|
|
4035
|
+
} else if (x < 2.5 / d1) {
|
|
4036
|
+
return n1 * (x -= 2.25 / d1) * x + 0.9375;
|
|
4037
|
+
} else {
|
|
4038
|
+
return n1 * (x -= 2.625 / d1) * x + 0.984375;
|
|
4039
|
+
}
|
|
4040
|
+
};
|
|
4041
|
+
const easings = {
|
|
4042
|
+
linear: (x) => x,
|
|
4043
|
+
easeInQuad: (x) => x * x,
|
|
4044
|
+
easeOutQuad: (x) => 1 - (1 - x) * (1 - x),
|
|
4045
|
+
easeInOutQuad: (x) => x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2,
|
|
4046
|
+
easeInCubic: (x) => x * x * x,
|
|
4047
|
+
easeOutCubic: (x) => 1 - Math.pow(1 - x, 3),
|
|
4048
|
+
easeInOutCubic: (x) => x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2,
|
|
4049
|
+
easeInQuart: (x) => x * x * x * x,
|
|
4050
|
+
easeOutQuart: (x) => 1 - Math.pow(1 - x, 4),
|
|
4051
|
+
easeInOutQuart: (x) => x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2,
|
|
4052
|
+
easeInQuint: (x) => x * x * x * x * x,
|
|
4053
|
+
easeOutQuint: (x) => 1 - Math.pow(1 - x, 5),
|
|
4054
|
+
easeInOutQuint: (x) => x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2,
|
|
4055
|
+
easeInSine: (x) => 1 - Math.cos(x * Math.PI / 2),
|
|
4056
|
+
easeOutSine: (x) => Math.sin(x * Math.PI / 2),
|
|
4057
|
+
easeInOutSine: (x) => -(Math.cos(Math.PI * x) - 1) / 2,
|
|
4058
|
+
easeInExpo: (x) => x === 0 ? 0 : Math.pow(2, 10 * x - 10),
|
|
4059
|
+
easeOutExpo: (x) => x === 1 ? 1 : 1 - Math.pow(2, -10 * x),
|
|
4060
|
+
easeInOutExpo: (x) => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2,
|
|
4061
|
+
easeInCirc: (x) => 1 - Math.sqrt(1 - Math.pow(x, 2)),
|
|
4062
|
+
easeOutCirc: (x) => Math.sqrt(1 - Math.pow(x - 1, 2)),
|
|
4063
|
+
easeInOutCirc: (x) => x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2,
|
|
4064
|
+
easeInBack: (x) => c3 * x * x * x - c1 * x * x,
|
|
4065
|
+
easeOutBack: (x) => 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2),
|
|
4066
|
+
easeInOutBack: (x) => x < 0.5 ? Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2,
|
|
4067
|
+
easeInElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4),
|
|
4068
|
+
easeOutElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1,
|
|
4069
|
+
easeInOutElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1,
|
|
4070
|
+
easeInBounce: (x) => 1 - bounceOut(1 - x),
|
|
4071
|
+
easeOutBounce: bounceOut,
|
|
4072
|
+
easeInOutBounce: (x) => x < 0.5 ? (1 - bounceOut(1 - 2 * x)) / 2 : (1 + bounceOut(2 * x - 1)) / 2,
|
|
4073
|
+
steps: steps$1
|
|
4074
|
+
};
|
|
4455
4075
|
function _extends$4() {
|
|
4456
4076
|
_extends$4 = Object.assign ? Object.assign.bind() : function(target) {
|
|
4457
4077
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -5133,57 +4753,6 @@
|
|
|
5133
4753
|
friction: 120
|
|
5134
4754
|
}
|
|
5135
4755
|
};
|
|
5136
|
-
const c1 = 1.70158;
|
|
5137
|
-
const c2 = c1 * 1.525;
|
|
5138
|
-
const c3 = c1 + 1;
|
|
5139
|
-
const c4 = 2 * Math.PI / 3;
|
|
5140
|
-
const c5 = 2 * Math.PI / 4.5;
|
|
5141
|
-
const bounceOut = (x) => {
|
|
5142
|
-
const n1 = 7.5625;
|
|
5143
|
-
const d1 = 2.75;
|
|
5144
|
-
if (x < 1 / d1) {
|
|
5145
|
-
return n1 * x * x;
|
|
5146
|
-
} else if (x < 2 / d1) {
|
|
5147
|
-
return n1 * (x -= 1.5 / d1) * x + 0.75;
|
|
5148
|
-
} else if (x < 2.5 / d1) {
|
|
5149
|
-
return n1 * (x -= 2.25 / d1) * x + 0.9375;
|
|
5150
|
-
} else {
|
|
5151
|
-
return n1 * (x -= 2.625 / d1) * x + 0.984375;
|
|
5152
|
-
}
|
|
5153
|
-
};
|
|
5154
|
-
const easings = {
|
|
5155
|
-
linear: (x) => x,
|
|
5156
|
-
easeInQuad: (x) => x * x,
|
|
5157
|
-
easeOutQuad: (x) => 1 - (1 - x) * (1 - x),
|
|
5158
|
-
easeInOutQuad: (x) => x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2,
|
|
5159
|
-
easeInCubic: (x) => x * x * x,
|
|
5160
|
-
easeOutCubic: (x) => 1 - Math.pow(1 - x, 3),
|
|
5161
|
-
easeInOutCubic: (x) => x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2,
|
|
5162
|
-
easeInQuart: (x) => x * x * x * x,
|
|
5163
|
-
easeOutQuart: (x) => 1 - Math.pow(1 - x, 4),
|
|
5164
|
-
easeInOutQuart: (x) => x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2,
|
|
5165
|
-
easeInQuint: (x) => x * x * x * x * x,
|
|
5166
|
-
easeOutQuint: (x) => 1 - Math.pow(1 - x, 5),
|
|
5167
|
-
easeInOutQuint: (x) => x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2,
|
|
5168
|
-
easeInSine: (x) => 1 - Math.cos(x * Math.PI / 2),
|
|
5169
|
-
easeOutSine: (x) => Math.sin(x * Math.PI / 2),
|
|
5170
|
-
easeInOutSine: (x) => -(Math.cos(Math.PI * x) - 1) / 2,
|
|
5171
|
-
easeInExpo: (x) => x === 0 ? 0 : Math.pow(2, 10 * x - 10),
|
|
5172
|
-
easeOutExpo: (x) => x === 1 ? 1 : 1 - Math.pow(2, -10 * x),
|
|
5173
|
-
easeInOutExpo: (x) => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2,
|
|
5174
|
-
easeInCirc: (x) => 1 - Math.sqrt(1 - Math.pow(x, 2)),
|
|
5175
|
-
easeOutCirc: (x) => Math.sqrt(1 - Math.pow(x - 1, 2)),
|
|
5176
|
-
easeInOutCirc: (x) => x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2,
|
|
5177
|
-
easeInBack: (x) => c3 * x * x * x - c1 * x * x,
|
|
5178
|
-
easeOutBack: (x) => 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2),
|
|
5179
|
-
easeInOutBack: (x) => x < 0.5 ? Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2,
|
|
5180
|
-
easeInElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4),
|
|
5181
|
-
easeOutElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1,
|
|
5182
|
-
easeInOutElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1,
|
|
5183
|
-
easeInBounce: (x) => 1 - bounceOut(1 - x),
|
|
5184
|
-
easeOutBounce: bounceOut,
|
|
5185
|
-
easeInOutBounce: (x) => x < 0.5 ? (1 - bounceOut(1 - 2 * x)) / 2 : (1 + bounceOut(2 * x - 1)) / 2
|
|
5186
|
-
};
|
|
5187
4756
|
const defaults = _extends$2({}, config$1.default, {
|
|
5188
4757
|
mass: 1,
|
|
5189
4758
|
damping: 1,
|
|
@@ -5379,7 +4948,7 @@
|
|
|
5379
4948
|
};
|
|
5380
4949
|
const animate = (arg1, arg2) => {
|
|
5381
4950
|
const bailSignal = new BailSignal();
|
|
5382
|
-
const skipAnimationSignal = new
|
|
4951
|
+
const skipAnimationSignal = new SkipAnimationSignal();
|
|
5383
4952
|
return (async () => {
|
|
5384
4953
|
if (globals.skipAnimation) {
|
|
5385
4954
|
stopAsync(state);
|
|
@@ -5428,7 +4997,7 @@
|
|
|
5428
4997
|
} catch (err) {
|
|
5429
4998
|
if (err instanceof BailSignal) {
|
|
5430
4999
|
result2 = err.result;
|
|
5431
|
-
} else if (err instanceof
|
|
5000
|
+
} else if (err instanceof SkipAnimationSignal) {
|
|
5432
5001
|
result2 = err.result;
|
|
5433
5002
|
} else {
|
|
5434
5003
|
throw err;
|
|
@@ -5462,7 +5031,7 @@
|
|
|
5462
5031
|
this.result = void 0;
|
|
5463
5032
|
}
|
|
5464
5033
|
}
|
|
5465
|
-
class
|
|
5034
|
+
class SkipAnimationSignal extends Error {
|
|
5466
5035
|
constructor() {
|
|
5467
5036
|
super("SkipAnimationSignal");
|
|
5468
5037
|
this.result = void 0;
|
|
@@ -6493,11 +6062,11 @@
|
|
|
6493
6062
|
}
|
|
6494
6063
|
return target;
|
|
6495
6064
|
}
|
|
6496
|
-
const _excluded$
|
|
6065
|
+
const _excluded$6 = ["children"];
|
|
6497
6066
|
const SpringContext = (_ref) => {
|
|
6498
6067
|
let {
|
|
6499
6068
|
children
|
|
6500
|
-
} = _ref, props = _objectWithoutPropertiesLoose$3(_ref, _excluded$
|
|
6069
|
+
} = _ref, props = _objectWithoutPropertiesLoose$3(_ref, _excluded$6);
|
|
6501
6070
|
const inherited = React$4.useContext(ctx);
|
|
6502
6071
|
const pause = props.pause || !!inherited.pause, immediate = props.immediate || !!inherited.immediate;
|
|
6503
6072
|
props = useMemoOne(() => ({
|
|
@@ -6801,7 +6370,7 @@
|
|
|
6801
6370
|
}
|
|
6802
6371
|
return target;
|
|
6803
6372
|
}
|
|
6804
|
-
const _excluded$2$1 = ["style", "children", "scrollTop", "scrollLeft"];
|
|
6373
|
+
const _excluded$2$1 = ["style", "children", "scrollTop", "scrollLeft", "viewBox"];
|
|
6805
6374
|
const isCustomPropRE = /^--/;
|
|
6806
6375
|
function dangerousStyleValue(name, value) {
|
|
6807
6376
|
if (value == null || typeof value === "boolean" || value === "")
|
|
@@ -6820,7 +6389,8 @@
|
|
|
6820
6389
|
style,
|
|
6821
6390
|
children,
|
|
6822
6391
|
scrollTop,
|
|
6823
|
-
scrollLeft
|
|
6392
|
+
scrollLeft,
|
|
6393
|
+
viewBox
|
|
6824
6394
|
} = _ref, attributes = _objectWithoutPropertiesLoose$2(_ref, _excluded$2$1);
|
|
6825
6395
|
const values = Object.values(attributes);
|
|
6826
6396
|
const names = Object.keys(attributes).map((name) => isFilterElement || instance.hasAttribute(name) ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, (n) => "-" + n.toLowerCase())));
|
|
@@ -6846,6 +6416,9 @@
|
|
|
6846
6416
|
if (scrollLeft !== void 0) {
|
|
6847
6417
|
instance.scrollLeft = scrollLeft;
|
|
6848
6418
|
}
|
|
6419
|
+
if (viewBox !== void 0) {
|
|
6420
|
+
instance.setAttribute("viewBox", viewBox);
|
|
6421
|
+
}
|
|
6849
6422
|
}
|
|
6850
6423
|
let isUnitlessNumber = {
|
|
6851
6424
|
animationIterationCount: true,
|
|
@@ -7018,13 +6591,13 @@
|
|
|
7018
6591
|
return false;
|
|
7019
6592
|
return !destroyOnClose;
|
|
7020
6593
|
}
|
|
7021
|
-
const eventToPropRecord = {
|
|
6594
|
+
const eventToPropRecord$1 = {
|
|
7022
6595
|
"click": "onClick"
|
|
7023
6596
|
};
|
|
7024
6597
|
function withStopPropagation(events, element) {
|
|
7025
6598
|
const props = Object.assign({}, element.props);
|
|
7026
6599
|
for (const key of events) {
|
|
7027
|
-
const prop = eventToPropRecord[key];
|
|
6600
|
+
const prop = eventToPropRecord$1[key];
|
|
7028
6601
|
props[prop] = function(e) {
|
|
7029
6602
|
var _a, _b;
|
|
7030
6603
|
e.stopPropagation();
|
|
@@ -7738,6 +7311,9 @@
|
|
|
7738
7311
|
});
|
|
7739
7312
|
const Popup$1 = (p) => {
|
|
7740
7313
|
const props = mergeProps(defaultProps$12, p);
|
|
7314
|
+
const {
|
|
7315
|
+
locale
|
|
7316
|
+
} = useConfig();
|
|
7741
7317
|
const bodyCls = classNames(`${classPrefix$1k}-body`, props.bodyClassName, `${classPrefix$1k}-body-position-${props.position}`);
|
|
7742
7318
|
const [active, setActive] = React$4.useState(props.visible);
|
|
7743
7319
|
useIsomorphicLayoutEffect$2(() => {
|
|
@@ -7817,7 +7393,9 @@
|
|
|
7817
7393
|
onClick: () => {
|
|
7818
7394
|
var _a;
|
|
7819
7395
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
7820
|
-
}
|
|
7396
|
+
},
|
|
7397
|
+
role: "button",
|
|
7398
|
+
"aria-label": locale.common.close
|
|
7821
7399
|
}, React__default.default.createElement(CloseOutline, null)), props.children))));
|
|
7822
7400
|
return React__default.default.createElement(ShouldRender, {
|
|
7823
7401
|
active,
|
|
@@ -7878,7 +7456,7 @@
|
|
|
7878
7456
|
return unmountComponentAtNode(container);
|
|
7879
7457
|
}
|
|
7880
7458
|
function concurrentUnmount(container) {
|
|
7881
|
-
return __awaiter
|
|
7459
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7882
7460
|
return Promise.resolve().then(() => {
|
|
7883
7461
|
var _a;
|
|
7884
7462
|
(_a = container[MARK]) === null || _a === void 0 ? void 0 : _a.unmount();
|
|
@@ -8357,7 +7935,7 @@
|
|
|
8357
7935
|
return nativeButtonRef.current;
|
|
8358
7936
|
}
|
|
8359
7937
|
}));
|
|
8360
|
-
const handleClick = (e) => __awaiter
|
|
7938
|
+
const handleClick = (e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8361
7939
|
if (!props.onClick)
|
|
8362
7940
|
return;
|
|
8363
7941
|
const promise = props.onClick(e);
|
|
@@ -8699,7 +8277,7 @@
|
|
|
8699
8277
|
}
|
|
8700
8278
|
}, React__default.default.createElement("div", {
|
|
8701
8279
|
className: `${classPrefix$1b}-cell-top`
|
|
8702
|
-
}, d.date()), React__default.default.createElement("div", {
|
|
8280
|
+
}, props.renderDate ? props.renderDate(d.toDate()) : d.date()), React__default.default.createElement("div", {
|
|
8703
8281
|
className: `${classPrefix$1b}-cell-bottom`
|
|
8704
8282
|
}, (_a = props.renderLabel) === null || _a === void 0 ? void 0 : _a.call(props, d.toDate()))));
|
|
8705
8283
|
iterator = iterator.add(1, "day");
|
|
@@ -13441,7 +13019,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13441
13019
|
}, actions.map((action, index3) => React__default.default.createElement(DialogActionButton, {
|
|
13442
13020
|
key: action.key,
|
|
13443
13021
|
action,
|
|
13444
|
-
onAction: () => __awaiter
|
|
13022
|
+
onAction: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
13445
13023
|
var _a, _b, _c;
|
|
13446
13024
|
yield Promise.all([(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action), (_b = props.onAction) === null || _b === void 0 ? void 0 : _b.call(props, action, index3)]);
|
|
13447
13025
|
if (props.closeOnAction) {
|
|
@@ -13532,7 +13110,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13532
13110
|
actions: [[{
|
|
13533
13111
|
key: "cancel",
|
|
13534
13112
|
text: props.cancelText,
|
|
13535
|
-
onClick: () => __awaiter
|
|
13113
|
+
onClick: () => __awaiter(this, void 0, void 0, function* () {
|
|
13536
13114
|
var _a;
|
|
13537
13115
|
yield (_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
13538
13116
|
resolve(false);
|
|
@@ -13541,7 +13119,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13541
13119
|
key: "confirm",
|
|
13542
13120
|
text: props.confirmText,
|
|
13543
13121
|
bold: true,
|
|
13544
|
-
onClick: () => __awaiter
|
|
13122
|
+
onClick: () => __awaiter(this, void 0, void 0, function* () {
|
|
13545
13123
|
var _b;
|
|
13546
13124
|
yield (_b = props.onConfirm) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
13547
13125
|
resolve(true);
|
|
@@ -13840,13 +13418,14 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13840
13418
|
collapseText: "",
|
|
13841
13419
|
stopPropagationForActionButtons: [],
|
|
13842
13420
|
onContentClick: () => {
|
|
13843
|
-
}
|
|
13421
|
+
},
|
|
13422
|
+
defaultExpanded: false
|
|
13844
13423
|
};
|
|
13845
13424
|
const Ellipsis$1 = (p) => {
|
|
13846
13425
|
const props = mergeProps(defaultProps$G, p);
|
|
13847
13426
|
const rootRef = React$4.useRef(null);
|
|
13848
13427
|
const [ellipsised, setEllipsised] = React$4.useState({});
|
|
13849
|
-
const [expanded, setExpanded] = React$4.useState(
|
|
13428
|
+
const [expanded, setExpanded] = React$4.useState(props.defaultExpanded);
|
|
13850
13429
|
const [exceeded, setExceeded] = React$4.useState(false);
|
|
13851
13430
|
const chars = React$4.useMemo(() => _runes_0_4_3_runes.exports(props.content), [props.content]);
|
|
13852
13431
|
function getSubString(start2, end) {
|
|
@@ -14910,9 +14489,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
14910
14489
|
function _arrayLikeToArray(arr, len) {
|
|
14911
14490
|
if (len == null || len > arr.length)
|
|
14912
14491
|
len = arr.length;
|
|
14913
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
14492
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
14914
14493
|
arr2[i] = arr[i];
|
|
14915
|
-
}
|
|
14916
14494
|
return arr2;
|
|
14917
14495
|
}
|
|
14918
14496
|
function _arrayWithoutHoles(arr) {
|
|
@@ -15444,10 +15022,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
15444
15022
|
return iterable;
|
|
15445
15023
|
if (!isNaN(iterable.length)) {
|
|
15446
15024
|
var i = -1, next = function next2() {
|
|
15447
|
-
for (; ++i < iterable.length; )
|
|
15025
|
+
for (; ++i < iterable.length; )
|
|
15448
15026
|
if (hasOwn.call(iterable, i))
|
|
15449
15027
|
return next2.value = iterable[i], next2.done = false, next2;
|
|
15450
|
-
}
|
|
15451
15028
|
return next2.value = void 0, next2.done = true, next2;
|
|
15452
15029
|
};
|
|
15453
15030
|
return next.next = next;
|
|
@@ -15492,9 +15069,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
15492
15069
|
return "[object Generator]";
|
|
15493
15070
|
}), exports3.keys = function(val) {
|
|
15494
15071
|
var object2 = Object(val), keys2 = [];
|
|
15495
|
-
for (var key in object2)
|
|
15072
|
+
for (var key in object2)
|
|
15496
15073
|
keys2.push(key);
|
|
15497
|
-
}
|
|
15498
15074
|
return keys2.reverse(), function next() {
|
|
15499
15075
|
for (; keys2.length; ) {
|
|
15500
15076
|
var key2 = keys2.pop();
|
|
@@ -15507,9 +15083,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
15507
15083
|
constructor: Context2,
|
|
15508
15084
|
reset: function reset(skipTempReset) {
|
|
15509
15085
|
if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
|
|
15510
|
-
for (var name in this)
|
|
15086
|
+
for (var name in this)
|
|
15511
15087
|
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
|
|
15512
|
-
}
|
|
15513
15088
|
},
|
|
15514
15089
|
stop: function stop2() {
|
|
15515
15090
|
this.done = true;
|
|
@@ -16906,7 +16481,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16906
16481
|
_validateRule = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2(name, value, rule, options, messageVariables) {
|
|
16907
16482
|
var cloneRule, originValidator, subRuleField, validator, messages2, result2, subResults, kv, fillVariableResult;
|
|
16908
16483
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
16909
|
-
while (1)
|
|
16484
|
+
while (1)
|
|
16910
16485
|
switch (_context2.prev = _context2.next) {
|
|
16911
16486
|
case 0:
|
|
16912
16487
|
cloneRule = _objectSpread2({}, rule);
|
|
@@ -16979,7 +16554,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16979
16554
|
case "end":
|
|
16980
16555
|
return _context2.stop();
|
|
16981
16556
|
}
|
|
16982
|
-
}
|
|
16983
16557
|
}, _callee2, null, [[9, 14]]);
|
|
16984
16558
|
}));
|
|
16985
16559
|
return _validateRule.apply(this, arguments);
|
|
@@ -17035,7 +16609,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17035
16609
|
var _ref3 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
17036
16610
|
var i, rule, errors;
|
|
17037
16611
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
17038
|
-
while (1)
|
|
16612
|
+
while (1)
|
|
17039
16613
|
switch (_context.prev = _context.next) {
|
|
17040
16614
|
case 0:
|
|
17041
16615
|
i = 0;
|
|
@@ -17068,7 +16642,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17068
16642
|
case "end":
|
|
17069
16643
|
return _context.stop();
|
|
17070
16644
|
}
|
|
17071
|
-
}
|
|
17072
16645
|
}, _callee);
|
|
17073
16646
|
}));
|
|
17074
16647
|
return function(_x6, _x7) {
|
|
@@ -17099,7 +16672,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17099
16672
|
function _finishOnAllFailed() {
|
|
17100
16673
|
_finishOnAllFailed = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee3(rulePromises) {
|
|
17101
16674
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
17102
|
-
while (1)
|
|
16675
|
+
while (1)
|
|
17103
16676
|
switch (_context3.prev = _context3.next) {
|
|
17104
16677
|
case 0:
|
|
17105
16678
|
return _context3.abrupt("return", Promise.all(rulePromises).then(function(errorsList) {
|
|
@@ -17111,7 +16684,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17111
16684
|
case "end":
|
|
17112
16685
|
return _context3.stop();
|
|
17113
16686
|
}
|
|
17114
|
-
}
|
|
17115
16687
|
}, _callee3);
|
|
17116
16688
|
}));
|
|
17117
16689
|
return _finishOnAllFailed.apply(this, arguments);
|
|
@@ -17123,7 +16695,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17123
16695
|
_finishOnFirstFailed = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee4(rulePromises) {
|
|
17124
16696
|
var count;
|
|
17125
16697
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
17126
|
-
while (1)
|
|
16698
|
+
while (1)
|
|
17127
16699
|
switch (_context4.prev = _context4.next) {
|
|
17128
16700
|
case 0:
|
|
17129
16701
|
count = 0;
|
|
@@ -17144,7 +16716,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17144
16716
|
case "end":
|
|
17145
16717
|
return _context4.stop();
|
|
17146
16718
|
}
|
|
17147
|
-
}
|
|
17148
16719
|
}, _callee4);
|
|
17149
16720
|
}));
|
|
17150
16721
|
return _finishOnFirstFailed.apply(this, arguments);
|
|
@@ -17685,9 +17256,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17685
17256
|
return;
|
|
17686
17257
|
_n = false;
|
|
17687
17258
|
} else
|
|
17688
|
-
for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = true)
|
|
17259
|
+
for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = true)
|
|
17689
17260
|
;
|
|
17690
|
-
}
|
|
17691
17261
|
} catch (err) {
|
|
17692
17262
|
_d = true, _e = err;
|
|
17693
17263
|
} finally {
|
|
@@ -18658,6 +18228,11 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18658
18228
|
return Math.random();
|
|
18659
18229
|
}
|
|
18660
18230
|
}
|
|
18231
|
+
var useWatchWarning = function(namePath) {
|
|
18232
|
+
var fullyStr = namePath.join("__RC_FIELD_FORM_SPLIT__");
|
|
18233
|
+
var nameStrRef = React$4.useRef(fullyStr);
|
|
18234
|
+
warningOnce$1(nameStrRef.current === fullyStr, "`useWatch` is not support dynamic `namePath`. Please provide static instead.");
|
|
18235
|
+
};
|
|
18661
18236
|
function useWatch() {
|
|
18662
18237
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18663
18238
|
args[_key] = arguments[_key];
|
|
@@ -18678,6 +18253,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18678
18253
|
var namePath = getNamePath(dependencies);
|
|
18679
18254
|
var namePathRef = React$4.useRef(namePath);
|
|
18680
18255
|
namePathRef.current = namePath;
|
|
18256
|
+
useWatchWarning(namePath);
|
|
18681
18257
|
React$4.useEffect(
|
|
18682
18258
|
function() {
|
|
18683
18259
|
if (!isValidForm) {
|
|
@@ -19230,18 +18806,18 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19230
18806
|
d: "M0,0 L30,0 L18.07289,14.312538 C16.65863,16.009645 14.13637,16.238942 12.43926,14.824685 C12.25341,14.669808 12.08199,14.49839 11.92711,14.312538 L0,0 L0,0 Z"
|
|
19231
18807
|
}))));
|
|
19232
18808
|
});
|
|
19233
|
-
function getSide(placement) {
|
|
19234
|
-
return placement.split("-")[0];
|
|
19235
|
-
}
|
|
19236
18809
|
function getAlignment(placement) {
|
|
19237
18810
|
return placement.split("-")[1];
|
|
19238
18811
|
}
|
|
19239
|
-
function getMainAxisFromPlacement(placement) {
|
|
19240
|
-
return ["top", "bottom"].includes(getSide(placement)) ? "x" : "y";
|
|
19241
|
-
}
|
|
19242
18812
|
function getLengthFromAxis(axis) {
|
|
19243
18813
|
return axis === "y" ? "height" : "width";
|
|
19244
18814
|
}
|
|
18815
|
+
function getSide(placement) {
|
|
18816
|
+
return placement.split("-")[0];
|
|
18817
|
+
}
|
|
18818
|
+
function getMainAxisFromPlacement(placement) {
|
|
18819
|
+
return ["top", "bottom"].includes(getSide(placement)) ? "x" : "y";
|
|
18820
|
+
}
|
|
19245
18821
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
19246
18822
|
let {
|
|
19247
18823
|
reference,
|
|
@@ -19427,7 +19003,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19427
19003
|
bottom: rect.y + rect.height
|
|
19428
19004
|
};
|
|
19429
19005
|
}
|
|
19430
|
-
async function detectOverflow(
|
|
19006
|
+
async function detectOverflow(state, options) {
|
|
19431
19007
|
var _await$platform$isEle;
|
|
19432
19008
|
if (options === void 0) {
|
|
19433
19009
|
options = {};
|
|
@@ -19439,7 +19015,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19439
19015
|
rects,
|
|
19440
19016
|
elements,
|
|
19441
19017
|
strategy
|
|
19442
|
-
} =
|
|
19018
|
+
} = state;
|
|
19443
19019
|
const {
|
|
19444
19020
|
boundary = "clippingAncestors",
|
|
19445
19021
|
rootBoundary = "viewport",
|
|
@@ -19489,18 +19065,18 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19489
19065
|
const arrow = (options) => ({
|
|
19490
19066
|
name: "arrow",
|
|
19491
19067
|
options,
|
|
19492
|
-
async fn(
|
|
19068
|
+
async fn(state) {
|
|
19493
19069
|
const {
|
|
19494
19070
|
element,
|
|
19495
19071
|
padding = 0
|
|
19496
|
-
} = options
|
|
19072
|
+
} = options || {};
|
|
19497
19073
|
const {
|
|
19498
19074
|
x,
|
|
19499
19075
|
y,
|
|
19500
19076
|
placement,
|
|
19501
19077
|
rects,
|
|
19502
19078
|
platform: platform2
|
|
19503
|
-
} =
|
|
19079
|
+
} = state;
|
|
19504
19080
|
if (element == null) {
|
|
19505
19081
|
{
|
|
19506
19082
|
console.warn("Floating UI: No `element` was passed to the `arrow` middleware.");
|
|
@@ -19513,7 +19089,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19513
19089
|
y
|
|
19514
19090
|
};
|
|
19515
19091
|
const axis = getMainAxisFromPlacement(placement);
|
|
19516
|
-
const alignment = getAlignment(placement);
|
|
19517
19092
|
const length = getLengthFromAxis(axis);
|
|
19518
19093
|
const arrowDimensions = await platform2.getDimensions(element);
|
|
19519
19094
|
const minProp = axis === "y" ? "top" : "left";
|
|
@@ -19530,8 +19105,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19530
19105
|
const max2 = clientSize - arrowDimensions[length] - paddingObject[maxProp];
|
|
19531
19106
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
19532
19107
|
const offset2 = within(min2, center, max2);
|
|
19533
|
-
const
|
|
19534
|
-
const shouldAddOffset = alignmentPadding > 0 && center !== offset2 && rects.reference[length] <= rects.floating[length];
|
|
19108
|
+
const shouldAddOffset = getAlignment(placement) != null && center != offset2 && rects.reference[length] / 2 - (center < min2 ? paddingObject[minProp] : paddingObject[maxProp]) - arrowDimensions[length] / 2 < 0;
|
|
19535
19109
|
const alignmentOffset = shouldAddOffset ? center < min2 ? min2 - center : max2 - center : 0;
|
|
19536
19110
|
return {
|
|
19537
19111
|
[axis]: coords[axis] - alignmentOffset,
|
|
@@ -19542,14 +19116,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19542
19116
|
};
|
|
19543
19117
|
}
|
|
19544
19118
|
});
|
|
19545
|
-
const
|
|
19119
|
+
const sides = ["top", "right", "bottom", "left"];
|
|
19120
|
+
const oppositeSideMap = {
|
|
19546
19121
|
left: "right",
|
|
19547
19122
|
right: "left",
|
|
19548
19123
|
bottom: "top",
|
|
19549
19124
|
top: "bottom"
|
|
19550
19125
|
};
|
|
19551
19126
|
function getOppositePlacement(placement) {
|
|
19552
|
-
return placement.replace(/left|right|bottom|top/g, (
|
|
19127
|
+
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
|
|
19553
19128
|
}
|
|
19554
19129
|
function getAlignmentSides(placement, rects, rtl) {
|
|
19555
19130
|
if (rtl === void 0) {
|
|
@@ -19567,18 +19142,46 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19567
19142
|
cross: getOppositePlacement(mainAlignmentSide)
|
|
19568
19143
|
};
|
|
19569
19144
|
}
|
|
19570
|
-
const
|
|
19145
|
+
const oppositeAlignmentMap = {
|
|
19571
19146
|
start: "end",
|
|
19572
19147
|
end: "start"
|
|
19573
19148
|
};
|
|
19574
19149
|
function getOppositeAlignmentPlacement(placement) {
|
|
19575
|
-
return placement.replace(/start|end/g, (
|
|
19150
|
+
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
19576
19151
|
}
|
|
19577
|
-
const sides = ["top", "right", "bottom", "left"];
|
|
19578
19152
|
function getExpandedPlacements(placement) {
|
|
19579
19153
|
const oppositePlacement = getOppositePlacement(placement);
|
|
19580
19154
|
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
19581
19155
|
}
|
|
19156
|
+
function getSideList(side, isStart, rtl) {
|
|
19157
|
+
const lr = ["left", "right"];
|
|
19158
|
+
const rl = ["right", "left"];
|
|
19159
|
+
const tb = ["top", "bottom"];
|
|
19160
|
+
const bt = ["bottom", "top"];
|
|
19161
|
+
switch (side) {
|
|
19162
|
+
case "top":
|
|
19163
|
+
case "bottom":
|
|
19164
|
+
if (rtl)
|
|
19165
|
+
return isStart ? rl : lr;
|
|
19166
|
+
return isStart ? lr : rl;
|
|
19167
|
+
case "left":
|
|
19168
|
+
case "right":
|
|
19169
|
+
return isStart ? tb : bt;
|
|
19170
|
+
default:
|
|
19171
|
+
return [];
|
|
19172
|
+
}
|
|
19173
|
+
}
|
|
19174
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
19175
|
+
const alignment = getAlignment(placement);
|
|
19176
|
+
let list2 = getSideList(getSide(placement), direction === "start", rtl);
|
|
19177
|
+
if (alignment) {
|
|
19178
|
+
list2 = list2.map((side) => side + "-" + alignment);
|
|
19179
|
+
if (flipAlignment) {
|
|
19180
|
+
list2 = list2.concat(list2.map(getOppositeAlignmentPlacement));
|
|
19181
|
+
}
|
|
19182
|
+
}
|
|
19183
|
+
return list2;
|
|
19184
|
+
}
|
|
19582
19185
|
const flip = function(options) {
|
|
19583
19186
|
if (options === void 0) {
|
|
19584
19187
|
options = {};
|
|
@@ -19586,7 +19189,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19586
19189
|
return {
|
|
19587
19190
|
name: "flip",
|
|
19588
19191
|
options,
|
|
19589
|
-
async fn(
|
|
19192
|
+
async fn(state) {
|
|
19590
19193
|
var _middlewareData$flip;
|
|
19591
19194
|
const {
|
|
19592
19195
|
placement,
|
|
@@ -19595,20 +19198,25 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19595
19198
|
initialPlacement,
|
|
19596
19199
|
platform: platform2,
|
|
19597
19200
|
elements
|
|
19598
|
-
} =
|
|
19201
|
+
} = state;
|
|
19599
19202
|
const {
|
|
19600
19203
|
mainAxis: checkMainAxis = true,
|
|
19601
19204
|
crossAxis: checkCrossAxis = true,
|
|
19602
19205
|
fallbackPlacements: specifiedFallbackPlacements,
|
|
19603
19206
|
fallbackStrategy = "bestFit",
|
|
19207
|
+
fallbackAxisSideDirection = "none",
|
|
19604
19208
|
flipAlignment = true,
|
|
19605
19209
|
...detectOverflowOptions
|
|
19606
19210
|
} = options;
|
|
19607
19211
|
const side = getSide(placement);
|
|
19608
|
-
const isBasePlacement =
|
|
19212
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
19213
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
19609
19214
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
19215
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
|
|
19216
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
19217
|
+
}
|
|
19610
19218
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
19611
|
-
const overflow = await detectOverflow(
|
|
19219
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
19612
19220
|
const overflows = [];
|
|
19613
19221
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
19614
19222
|
if (checkMainAxis) {
|
|
@@ -19618,7 +19226,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19618
19226
|
const {
|
|
19619
19227
|
main,
|
|
19620
19228
|
cross
|
|
19621
|
-
} = getAlignmentSides(placement, rects,
|
|
19229
|
+
} = getAlignmentSides(placement, rects, rtl);
|
|
19622
19230
|
overflows.push(overflow[main], overflow[cross]);
|
|
19623
19231
|
}
|
|
19624
19232
|
overflowsData = [...overflowsData, {
|
|
@@ -19626,8 +19234,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19626
19234
|
overflows
|
|
19627
19235
|
}];
|
|
19628
19236
|
if (!overflows.every((side2) => side2 <= 0)) {
|
|
19629
|
-
var _middlewareData$
|
|
19630
|
-
const nextIndex = ((
|
|
19237
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
19238
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
19631
19239
|
const nextPlacement = placements[nextIndex];
|
|
19632
19240
|
if (nextPlacement) {
|
|
19633
19241
|
return {
|
|
@@ -19640,19 +19248,21 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19640
19248
|
}
|
|
19641
19249
|
};
|
|
19642
19250
|
}
|
|
19643
|
-
let resetPlacement =
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
|
|
19647
|
-
|
|
19648
|
-
|
|
19649
|
-
|
|
19251
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
19252
|
+
if (!resetPlacement) {
|
|
19253
|
+
switch (fallbackStrategy) {
|
|
19254
|
+
case "bestFit": {
|
|
19255
|
+
var _overflowsData$map$so;
|
|
19256
|
+
const placement2 = (_overflowsData$map$so = overflowsData.map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
|
|
19257
|
+
if (placement2) {
|
|
19258
|
+
resetPlacement = placement2;
|
|
19259
|
+
}
|
|
19260
|
+
break;
|
|
19650
19261
|
}
|
|
19651
|
-
|
|
19262
|
+
case "initialPlacement":
|
|
19263
|
+
resetPlacement = initialPlacement;
|
|
19264
|
+
break;
|
|
19652
19265
|
}
|
|
19653
|
-
case "initialPlacement":
|
|
19654
|
-
resetPlacement = initialPlacement;
|
|
19655
|
-
break;
|
|
19656
19266
|
}
|
|
19657
19267
|
if (placement !== resetPlacement) {
|
|
19658
19268
|
return {
|
|
@@ -19677,20 +19287,24 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19677
19287
|
function isAnySideFullyClipped(overflow) {
|
|
19678
19288
|
return sides.some((side) => overflow[side] >= 0);
|
|
19679
19289
|
}
|
|
19680
|
-
const hide = function(
|
|
19681
|
-
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
} = _temp === void 0 ? {} : _temp;
|
|
19290
|
+
const hide = function(options) {
|
|
19291
|
+
if (options === void 0) {
|
|
19292
|
+
options = {};
|
|
19293
|
+
}
|
|
19685
19294
|
return {
|
|
19686
19295
|
name: "hide",
|
|
19687
|
-
|
|
19296
|
+
options,
|
|
19297
|
+
async fn(state) {
|
|
19298
|
+
const {
|
|
19299
|
+
strategy = "referenceHidden",
|
|
19300
|
+
...detectOverflowOptions
|
|
19301
|
+
} = options;
|
|
19688
19302
|
const {
|
|
19689
19303
|
rects
|
|
19690
|
-
} =
|
|
19304
|
+
} = state;
|
|
19691
19305
|
switch (strategy) {
|
|
19692
19306
|
case "referenceHidden": {
|
|
19693
|
-
const overflow = await detectOverflow(
|
|
19307
|
+
const overflow = await detectOverflow(state, {
|
|
19694
19308
|
...detectOverflowOptions,
|
|
19695
19309
|
elementContext: "reference"
|
|
19696
19310
|
});
|
|
@@ -19703,7 +19317,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19703
19317
|
};
|
|
19704
19318
|
}
|
|
19705
19319
|
case "escaped": {
|
|
19706
|
-
const overflow = await detectOverflow(
|
|
19320
|
+
const overflow = await detectOverflow(state, {
|
|
19707
19321
|
...detectOverflowOptions,
|
|
19708
19322
|
altBoundary: true
|
|
19709
19323
|
});
|
|
@@ -19722,19 +19336,19 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19722
19336
|
}
|
|
19723
19337
|
};
|
|
19724
19338
|
};
|
|
19725
|
-
async function convertValueToCoords(
|
|
19339
|
+
async function convertValueToCoords(state, value) {
|
|
19726
19340
|
const {
|
|
19727
19341
|
placement,
|
|
19728
19342
|
platform: platform2,
|
|
19729
19343
|
elements
|
|
19730
|
-
} =
|
|
19344
|
+
} = state;
|
|
19731
19345
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
19732
19346
|
const side = getSide(placement);
|
|
19733
19347
|
const alignment = getAlignment(placement);
|
|
19734
19348
|
const isVertical = getMainAxisFromPlacement(placement) === "x";
|
|
19735
19349
|
const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
|
|
19736
19350
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
19737
|
-
const rawValue = typeof value === "function" ? value(
|
|
19351
|
+
const rawValue = typeof value === "function" ? value(state) : value;
|
|
19738
19352
|
let {
|
|
19739
19353
|
mainAxis,
|
|
19740
19354
|
crossAxis,
|
|
@@ -19767,12 +19381,12 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19767
19381
|
return {
|
|
19768
19382
|
name: "offset",
|
|
19769
19383
|
options: value,
|
|
19770
|
-
async fn(
|
|
19384
|
+
async fn(state) {
|
|
19771
19385
|
const {
|
|
19772
19386
|
x,
|
|
19773
19387
|
y
|
|
19774
|
-
} =
|
|
19775
|
-
const diffCoords = await convertValueToCoords(
|
|
19388
|
+
} = state;
|
|
19389
|
+
const diffCoords = await convertValueToCoords(state, value);
|
|
19776
19390
|
return {
|
|
19777
19391
|
x: x + diffCoords.x,
|
|
19778
19392
|
y: y + diffCoords.y,
|
|
@@ -19791,12 +19405,12 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19791
19405
|
return {
|
|
19792
19406
|
name: "shift",
|
|
19793
19407
|
options,
|
|
19794
|
-
async fn(
|
|
19408
|
+
async fn(state) {
|
|
19795
19409
|
const {
|
|
19796
19410
|
x,
|
|
19797
19411
|
y,
|
|
19798
19412
|
placement
|
|
19799
|
-
} =
|
|
19413
|
+
} = state;
|
|
19800
19414
|
const {
|
|
19801
19415
|
mainAxis: checkMainAxis = true,
|
|
19802
19416
|
crossAxis: checkCrossAxis = false,
|
|
@@ -19818,7 +19432,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19818
19432
|
x,
|
|
19819
19433
|
y
|
|
19820
19434
|
};
|
|
19821
|
-
const overflow = await detectOverflow(
|
|
19435
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
19822
19436
|
const mainAxis = getMainAxisFromPlacement(getSide(placement));
|
|
19823
19437
|
const crossAxis = getCrossAxis(mainAxis);
|
|
19824
19438
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -19838,7 +19452,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19838
19452
|
crossAxisCoord = within(min2, crossAxisCoord, max2);
|
|
19839
19453
|
}
|
|
19840
19454
|
const limitedCoords = limiter.fn({
|
|
19841
|
-
...
|
|
19455
|
+
...state,
|
|
19842
19456
|
[mainAxis]: mainAxisCoord,
|
|
19843
19457
|
[crossAxis]: crossAxisCoord
|
|
19844
19458
|
});
|
|
@@ -19858,14 +19472,14 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19858
19472
|
}
|
|
19859
19473
|
return {
|
|
19860
19474
|
options,
|
|
19861
|
-
fn(
|
|
19475
|
+
fn(state) {
|
|
19862
19476
|
const {
|
|
19863
19477
|
x,
|
|
19864
19478
|
y,
|
|
19865
19479
|
placement,
|
|
19866
19480
|
rects,
|
|
19867
19481
|
middlewareData
|
|
19868
|
-
} =
|
|
19482
|
+
} = state;
|
|
19869
19483
|
const {
|
|
19870
19484
|
offset: offset2 = 0,
|
|
19871
19485
|
mainAxis: checkMainAxis = true,
|
|
@@ -19879,7 +19493,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19879
19493
|
const crossAxis = getCrossAxis(mainAxis);
|
|
19880
19494
|
let mainAxisCoord = coords[mainAxis];
|
|
19881
19495
|
let crossAxisCoord = coords[crossAxis];
|
|
19882
|
-
const rawOffset = typeof offset2 === "function" ? offset2(
|
|
19496
|
+
const rawOffset = typeof offset2 === "function" ? offset2(state) : offset2;
|
|
19883
19497
|
const computedOffset = typeof rawOffset === "number" ? {
|
|
19884
19498
|
mainAxis: rawOffset,
|
|
19885
19499
|
crossAxis: 0
|
|
@@ -19899,11 +19513,11 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19899
19513
|
}
|
|
19900
19514
|
}
|
|
19901
19515
|
if (checkCrossAxis) {
|
|
19902
|
-
var _middlewareData$offse, _middlewareData$offse2
|
|
19516
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
|
19903
19517
|
const len = mainAxis === "y" ? "width" : "height";
|
|
19904
19518
|
const isOriginSide = ["top", "left"].includes(getSide(placement));
|
|
19905
|
-
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? (_middlewareData$offse =
|
|
19906
|
-
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : (
|
|
19519
|
+
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
19520
|
+
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
19907
19521
|
if (crossAxisCoord < limitMin) {
|
|
19908
19522
|
crossAxisCoord = limitMin;
|
|
19909
19523
|
} else if (crossAxisCoord > limitMax) {
|
|
@@ -19917,30 +19531,45 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19917
19531
|
}
|
|
19918
19532
|
};
|
|
19919
19533
|
};
|
|
19920
|
-
const min = Math.min;
|
|
19921
|
-
const max = Math.max;
|
|
19922
|
-
const round = Math.round;
|
|
19923
|
-
function getScale(element, paramRect) {
|
|
19924
|
-
const rect = paramRect || element.getBoundingClientRect();
|
|
19925
|
-
return {
|
|
19926
|
-
x: element.offsetWidth > 0 ? round(rect.width) / element.offsetWidth || 1 : 1,
|
|
19927
|
-
y: element.offsetHeight > 0 ? round(rect.height) / element.offsetHeight || 1 : 1
|
|
19928
|
-
};
|
|
19929
|
-
}
|
|
19930
19534
|
function getWindow(node) {
|
|
19931
19535
|
var _node$ownerDocument;
|
|
19932
19536
|
return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
19933
19537
|
}
|
|
19934
|
-
function getComputedStyle(element) {
|
|
19538
|
+
function getComputedStyle$1(element) {
|
|
19935
19539
|
return getWindow(element).getComputedStyle(element);
|
|
19936
19540
|
}
|
|
19541
|
+
const min = Math.min;
|
|
19542
|
+
const max = Math.max;
|
|
19543
|
+
const round = Math.round;
|
|
19544
|
+
function getCssDimensions(element) {
|
|
19545
|
+
const css = getComputedStyle$1(element);
|
|
19546
|
+
let width = parseFloat(css.width);
|
|
19547
|
+
let height = parseFloat(css.height);
|
|
19548
|
+
const offsetWidth = element.offsetWidth;
|
|
19549
|
+
const offsetHeight = element.offsetHeight;
|
|
19550
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
19551
|
+
if (shouldFallback) {
|
|
19552
|
+
width = offsetWidth;
|
|
19553
|
+
height = offsetHeight;
|
|
19554
|
+
}
|
|
19555
|
+
return {
|
|
19556
|
+
width,
|
|
19557
|
+
height,
|
|
19558
|
+
fallback: shouldFallback
|
|
19559
|
+
};
|
|
19560
|
+
}
|
|
19937
19561
|
function getNodeName(node) {
|
|
19938
19562
|
return isNode(node) ? (node.nodeName || "").toLowerCase() : "";
|
|
19939
19563
|
}
|
|
19564
|
+
let uaString;
|
|
19940
19565
|
function getUAString() {
|
|
19566
|
+
if (uaString) {
|
|
19567
|
+
return uaString;
|
|
19568
|
+
}
|
|
19941
19569
|
const uaData = navigator.userAgentData;
|
|
19942
19570
|
if (uaData && Array.isArray(uaData.brands)) {
|
|
19943
|
-
|
|
19571
|
+
uaString = uaData.brands.map((item) => item.brand + "/" + item.version).join(" ");
|
|
19572
|
+
return uaString;
|
|
19944
19573
|
}
|
|
19945
19574
|
return navigator.userAgent;
|
|
19946
19575
|
}
|
|
@@ -19966,31 +19595,60 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19966
19595
|
overflowX,
|
|
19967
19596
|
overflowY,
|
|
19968
19597
|
display
|
|
19969
|
-
} = getComputedStyle(element);
|
|
19970
|
-
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
19598
|
+
} = getComputedStyle$1(element);
|
|
19599
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
19971
19600
|
}
|
|
19972
19601
|
function isTableElement(element) {
|
|
19973
19602
|
return ["table", "td", "th"].includes(getNodeName(element));
|
|
19974
19603
|
}
|
|
19975
19604
|
function isContainingBlock(element) {
|
|
19976
19605
|
const isFirefox = /firefox/i.test(getUAString());
|
|
19977
|
-
const css = getComputedStyle(element);
|
|
19606
|
+
const css = getComputedStyle$1(element);
|
|
19978
19607
|
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
|
|
19979
|
-
return css.transform !== "none" || css.perspective !== "none" || (backdropFilter ? backdropFilter !== "none" : false) || isFirefox && css.willChange === "filter" || isFirefox && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective"].some((value) => css.willChange.includes(value)) || ["paint", "layout", "strict", "content"].some(
|
|
19980
|
-
|
|
19981
|
-
|
|
19982
|
-
|
|
19983
|
-
}
|
|
19984
|
-
);
|
|
19608
|
+
return css.transform !== "none" || css.perspective !== "none" || (backdropFilter ? backdropFilter !== "none" : false) || isFirefox && css.willChange === "filter" || isFirefox && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective"].some((value) => css.willChange.includes(value)) || ["paint", "layout", "strict", "content"].some((value) => {
|
|
19609
|
+
const contain = css.contain;
|
|
19610
|
+
return contain != null ? contain.includes(value) : false;
|
|
19611
|
+
});
|
|
19985
19612
|
}
|
|
19986
|
-
function
|
|
19987
|
-
return
|
|
19613
|
+
function isClientRectVisualViewportBased() {
|
|
19614
|
+
return /^((?!chrome|android).)*safari/i.test(getUAString());
|
|
19988
19615
|
}
|
|
19989
19616
|
function isLastTraversableNode(node) {
|
|
19990
19617
|
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
19991
19618
|
}
|
|
19992
|
-
function
|
|
19993
|
-
|
|
19619
|
+
function unwrapElement(element) {
|
|
19620
|
+
return !isElement(element) ? element.contextElement : element;
|
|
19621
|
+
}
|
|
19622
|
+
const FALLBACK_SCALE = {
|
|
19623
|
+
x: 1,
|
|
19624
|
+
y: 1
|
|
19625
|
+
};
|
|
19626
|
+
function getScale(element) {
|
|
19627
|
+
const domElement = unwrapElement(element);
|
|
19628
|
+
if (!isHTMLElement(domElement)) {
|
|
19629
|
+
return FALLBACK_SCALE;
|
|
19630
|
+
}
|
|
19631
|
+
const rect = domElement.getBoundingClientRect();
|
|
19632
|
+
const {
|
|
19633
|
+
width,
|
|
19634
|
+
height,
|
|
19635
|
+
fallback
|
|
19636
|
+
} = getCssDimensions(domElement);
|
|
19637
|
+
let x = (fallback ? round(rect.width) : rect.width) / width;
|
|
19638
|
+
let y = (fallback ? round(rect.height) : rect.height) / height;
|
|
19639
|
+
if (!x || !Number.isFinite(x)) {
|
|
19640
|
+
x = 1;
|
|
19641
|
+
}
|
|
19642
|
+
if (!y || !Number.isFinite(y)) {
|
|
19643
|
+
y = 1;
|
|
19644
|
+
}
|
|
19645
|
+
return {
|
|
19646
|
+
x,
|
|
19647
|
+
y
|
|
19648
|
+
};
|
|
19649
|
+
}
|
|
19650
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
19651
|
+
var _win$visualViewport, _win$visualViewport2;
|
|
19994
19652
|
if (includeScale === void 0) {
|
|
19995
19653
|
includeScale = false;
|
|
19996
19654
|
}
|
|
@@ -19998,25 +19656,42 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19998
19656
|
isFixedStrategy = false;
|
|
19999
19657
|
}
|
|
20000
19658
|
const clientRect = element.getBoundingClientRect();
|
|
20001
|
-
|
|
20002
|
-
let
|
|
20003
|
-
|
|
20004
|
-
|
|
20005
|
-
|
|
20006
|
-
|
|
20007
|
-
|
|
20008
|
-
|
|
20009
|
-
|
|
20010
|
-
|
|
20011
|
-
|
|
20012
|
-
|
|
19659
|
+
const domElement = unwrapElement(element);
|
|
19660
|
+
let scale2 = FALLBACK_SCALE;
|
|
19661
|
+
if (includeScale) {
|
|
19662
|
+
if (offsetParent) {
|
|
19663
|
+
if (isElement(offsetParent)) {
|
|
19664
|
+
scale2 = getScale(offsetParent);
|
|
19665
|
+
}
|
|
19666
|
+
} else {
|
|
19667
|
+
scale2 = getScale(element);
|
|
19668
|
+
}
|
|
19669
|
+
}
|
|
19670
|
+
const win = domElement ? getWindow(domElement) : window;
|
|
19671
|
+
const addVisualOffsets = isClientRectVisualViewportBased() && isFixedStrategy;
|
|
19672
|
+
let x = (clientRect.left + (addVisualOffsets ? ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0 : 0)) / scale2.x;
|
|
19673
|
+
let y = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale2.y;
|
|
19674
|
+
let width = clientRect.width / scale2.x;
|
|
19675
|
+
let height = clientRect.height / scale2.y;
|
|
19676
|
+
if (domElement) {
|
|
19677
|
+
const win2 = getWindow(domElement);
|
|
19678
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
19679
|
+
let currentIFrame = win2.frameElement;
|
|
19680
|
+
while (currentIFrame && offsetParent && offsetWin !== win2) {
|
|
19681
|
+
const iframeScale = getScale(currentIFrame);
|
|
19682
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
19683
|
+
const css = getComputedStyle(currentIFrame);
|
|
19684
|
+
iframeRect.x += (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
19685
|
+
iframeRect.y += (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
19686
|
+
x *= iframeScale.x;
|
|
19687
|
+
y *= iframeScale.y;
|
|
19688
|
+
width *= iframeScale.x;
|
|
19689
|
+
height *= iframeScale.y;
|
|
19690
|
+
x += iframeRect.x;
|
|
19691
|
+
y += iframeRect.y;
|
|
19692
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
19693
|
+
}
|
|
20013
19694
|
}
|
|
20014
|
-
const win = isElement(element) ? getWindow(element) : window;
|
|
20015
|
-
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
20016
|
-
const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scale2.x;
|
|
20017
|
-
const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scale2.y;
|
|
20018
|
-
const width = clientRect.width / scale2.x;
|
|
20019
|
-
const height = clientRect.height / scale2.y;
|
|
20020
19695
|
return {
|
|
20021
19696
|
width,
|
|
20022
19697
|
height,
|
|
@@ -20043,96 +19718,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20043
19718
|
scrollTop: element.pageYOffset
|
|
20044
19719
|
};
|
|
20045
19720
|
}
|
|
20046
|
-
function getWindowScrollBarX(element) {
|
|
20047
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
20048
|
-
}
|
|
20049
|
-
function isScaled(element) {
|
|
20050
|
-
const rect = getBoundingClientRect(element);
|
|
20051
|
-
return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
|
|
20052
|
-
}
|
|
20053
|
-
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
20054
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
20055
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
20056
|
-
const rect = getBoundingClientRect(
|
|
20057
|
-
element,
|
|
20058
|
-
isOffsetParentAnElement && isScaled(offsetParent),
|
|
20059
|
-
strategy === "fixed"
|
|
20060
|
-
);
|
|
20061
|
-
let scroll = {
|
|
20062
|
-
scrollLeft: 0,
|
|
20063
|
-
scrollTop: 0
|
|
20064
|
-
};
|
|
20065
|
-
const offsets = {
|
|
20066
|
-
x: 0,
|
|
20067
|
-
y: 0
|
|
20068
|
-
};
|
|
20069
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
|
20070
|
-
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
20071
|
-
scroll = getNodeScroll(offsetParent);
|
|
20072
|
-
}
|
|
20073
|
-
if (isHTMLElement(offsetParent)) {
|
|
20074
|
-
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
20075
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
20076
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
20077
|
-
} else if (documentElement) {
|
|
20078
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
20079
|
-
}
|
|
20080
|
-
}
|
|
20081
|
-
return {
|
|
20082
|
-
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
20083
|
-
y: rect.top + scroll.scrollTop - offsets.y,
|
|
20084
|
-
width: rect.width,
|
|
20085
|
-
height: rect.height
|
|
20086
|
-
};
|
|
20087
|
-
}
|
|
20088
|
-
function getParentNode(node) {
|
|
20089
|
-
if (getNodeName(node) === "html") {
|
|
20090
|
-
return node;
|
|
20091
|
-
}
|
|
20092
|
-
const result2 = node.assignedSlot || node.parentNode || (isShadowRoot(node) ? node.host : null) || getDocumentElement(node);
|
|
20093
|
-
return isShadowRoot(result2) ? result2.host : result2;
|
|
20094
|
-
}
|
|
20095
|
-
function getTrueOffsetParent(element) {
|
|
20096
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
|
20097
|
-
return null;
|
|
20098
|
-
}
|
|
20099
|
-
return element.offsetParent;
|
|
20100
|
-
}
|
|
20101
|
-
function getContainingBlock(element) {
|
|
20102
|
-
let currentNode = getParentNode(element);
|
|
20103
|
-
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
20104
|
-
if (isContainingBlock(currentNode)) {
|
|
20105
|
-
return currentNode;
|
|
20106
|
-
} else {
|
|
20107
|
-
currentNode = getParentNode(currentNode);
|
|
20108
|
-
}
|
|
20109
|
-
}
|
|
20110
|
-
return null;
|
|
20111
|
-
}
|
|
20112
|
-
function getOffsetParent(element) {
|
|
20113
|
-
const window2 = getWindow(element);
|
|
20114
|
-
let offsetParent = getTrueOffsetParent(element);
|
|
20115
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
|
20116
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
20117
|
-
}
|
|
20118
|
-
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
|
20119
|
-
return window2;
|
|
20120
|
-
}
|
|
20121
|
-
return offsetParent || getContainingBlock(element) || window2;
|
|
20122
|
-
}
|
|
20123
|
-
function getDimensions(element) {
|
|
20124
|
-
if (isHTMLElement(element)) {
|
|
20125
|
-
return {
|
|
20126
|
-
width: element.offsetWidth,
|
|
20127
|
-
height: element.offsetHeight
|
|
20128
|
-
};
|
|
20129
|
-
}
|
|
20130
|
-
const rect = getBoundingClientRect(element);
|
|
20131
|
-
return {
|
|
20132
|
-
width: rect.width,
|
|
20133
|
-
height: rect.height
|
|
20134
|
-
};
|
|
20135
|
-
}
|
|
20136
19721
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
20137
19722
|
let {
|
|
20138
19723
|
rect,
|
|
@@ -20174,41 +19759,19 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20174
19759
|
y: rect.y * scale2.y - scroll.scrollTop * scale2.y + offsets.y
|
|
20175
19760
|
};
|
|
20176
19761
|
}
|
|
20177
|
-
function
|
|
20178
|
-
|
|
20179
|
-
const html = getDocumentElement(element);
|
|
20180
|
-
const visualViewport = win.visualViewport;
|
|
20181
|
-
let width = html.clientWidth;
|
|
20182
|
-
let height = html.clientHeight;
|
|
20183
|
-
let x = 0;
|
|
20184
|
-
let y = 0;
|
|
20185
|
-
if (visualViewport) {
|
|
20186
|
-
width = visualViewport.width;
|
|
20187
|
-
height = visualViewport.height;
|
|
20188
|
-
const layoutViewport = isLayoutViewport();
|
|
20189
|
-
if (layoutViewport || !layoutViewport && strategy === "fixed") {
|
|
20190
|
-
x = visualViewport.offsetLeft;
|
|
20191
|
-
y = visualViewport.offsetTop;
|
|
20192
|
-
}
|
|
20193
|
-
}
|
|
20194
|
-
return {
|
|
20195
|
-
width,
|
|
20196
|
-
height,
|
|
20197
|
-
x,
|
|
20198
|
-
y
|
|
20199
|
-
};
|
|
19762
|
+
function getWindowScrollBarX(element) {
|
|
19763
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
20200
19764
|
}
|
|
20201
19765
|
function getDocumentRect(element) {
|
|
20202
|
-
var _element$ownerDocumen;
|
|
20203
19766
|
const html = getDocumentElement(element);
|
|
20204
19767
|
const scroll = getNodeScroll(element);
|
|
20205
|
-
const body =
|
|
20206
|
-
const width = max(html.scrollWidth, html.clientWidth, body
|
|
20207
|
-
const height = max(html.scrollHeight, html.clientHeight, body
|
|
19768
|
+
const body = element.ownerDocument.body;
|
|
19769
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
19770
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
20208
19771
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
20209
19772
|
const y = -scroll.scrollTop;
|
|
20210
|
-
if (getComputedStyle(body
|
|
20211
|
-
x += max(html.clientWidth, body
|
|
19773
|
+
if (getComputedStyle$1(body).direction === "rtl") {
|
|
19774
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
20212
19775
|
}
|
|
20213
19776
|
return {
|
|
20214
19777
|
width,
|
|
@@ -20217,10 +19780,17 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20217
19780
|
y
|
|
20218
19781
|
};
|
|
20219
19782
|
}
|
|
19783
|
+
function getParentNode(node) {
|
|
19784
|
+
if (getNodeName(node) === "html") {
|
|
19785
|
+
return node;
|
|
19786
|
+
}
|
|
19787
|
+
const result2 = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
|
|
19788
|
+
return isShadowRoot(result2) ? result2.host : result2;
|
|
19789
|
+
}
|
|
20220
19790
|
function getNearestOverflowAncestor(node) {
|
|
20221
19791
|
const parentNode = getParentNode(node);
|
|
20222
19792
|
if (isLastTraversableNode(parentNode)) {
|
|
20223
|
-
return
|
|
19793
|
+
return parentNode.ownerDocument.body;
|
|
20224
19794
|
}
|
|
20225
19795
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
20226
19796
|
return parentNode;
|
|
@@ -20240,6 +19810,30 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20240
19810
|
}
|
|
20241
19811
|
return list2.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
|
|
20242
19812
|
}
|
|
19813
|
+
function getViewportRect(element, strategy) {
|
|
19814
|
+
const win = getWindow(element);
|
|
19815
|
+
const html = getDocumentElement(element);
|
|
19816
|
+
const visualViewport = win.visualViewport;
|
|
19817
|
+
let width = html.clientWidth;
|
|
19818
|
+
let height = html.clientHeight;
|
|
19819
|
+
let x = 0;
|
|
19820
|
+
let y = 0;
|
|
19821
|
+
if (visualViewport) {
|
|
19822
|
+
width = visualViewport.width;
|
|
19823
|
+
height = visualViewport.height;
|
|
19824
|
+
const visualViewportBased = isClientRectVisualViewportBased();
|
|
19825
|
+
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
19826
|
+
x = visualViewport.offsetLeft;
|
|
19827
|
+
y = visualViewport.offsetTop;
|
|
19828
|
+
}
|
|
19829
|
+
}
|
|
19830
|
+
return {
|
|
19831
|
+
width,
|
|
19832
|
+
height,
|
|
19833
|
+
x,
|
|
19834
|
+
y
|
|
19835
|
+
};
|
|
19836
|
+
}
|
|
20243
19837
|
function getInnerBoundingClientRect(element, strategy) {
|
|
20244
19838
|
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
20245
19839
|
const top = clientRect.top + element.clientTop;
|
|
@@ -20253,41 +19847,60 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20253
19847
|
const x = left * scale2.x;
|
|
20254
19848
|
const y = top * scale2.y;
|
|
20255
19849
|
return {
|
|
20256
|
-
top: y,
|
|
20257
|
-
left: x,
|
|
20258
|
-
right: x + width,
|
|
20259
|
-
bottom: y + height,
|
|
20260
|
-
x,
|
|
20261
|
-
y,
|
|
20262
19850
|
width,
|
|
20263
|
-
height
|
|
19851
|
+
height,
|
|
19852
|
+
x,
|
|
19853
|
+
y
|
|
20264
19854
|
};
|
|
20265
19855
|
}
|
|
20266
19856
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
19857
|
+
let rect;
|
|
20267
19858
|
if (clippingAncestor === "viewport") {
|
|
20268
|
-
|
|
20269
|
-
}
|
|
20270
|
-
|
|
20271
|
-
|
|
19859
|
+
rect = getViewportRect(element, strategy);
|
|
19860
|
+
} else if (clippingAncestor === "document") {
|
|
19861
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
19862
|
+
} else if (isElement(clippingAncestor)) {
|
|
19863
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
19864
|
+
} else {
|
|
19865
|
+
const mutableRect = {
|
|
19866
|
+
...clippingAncestor
|
|
19867
|
+
};
|
|
19868
|
+
if (isClientRectVisualViewportBased()) {
|
|
19869
|
+
var _win$visualViewport, _win$visualViewport2;
|
|
19870
|
+
const win = getWindow(element);
|
|
19871
|
+
mutableRect.x -= ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0;
|
|
19872
|
+
mutableRect.y -= ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0;
|
|
19873
|
+
}
|
|
19874
|
+
rect = mutableRect;
|
|
20272
19875
|
}
|
|
20273
|
-
return rectToClientRect(
|
|
19876
|
+
return rectToClientRect(rect);
|
|
20274
19877
|
}
|
|
20275
|
-
function getClippingElementAncestors(element) {
|
|
19878
|
+
function getClippingElementAncestors(element, cache) {
|
|
19879
|
+
const cachedResult = cache.get(element);
|
|
19880
|
+
if (cachedResult) {
|
|
19881
|
+
return cachedResult;
|
|
19882
|
+
}
|
|
20276
19883
|
let result2 = getOverflowAncestors(element).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
20277
19884
|
let currentContainingBlockComputedStyle = null;
|
|
20278
|
-
const elementIsFixed = getComputedStyle(element).position === "fixed";
|
|
19885
|
+
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
|
20279
19886
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
20280
19887
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
20281
|
-
const computedStyle = getComputedStyle(currentNode);
|
|
19888
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
20282
19889
|
const containingBlock = isContainingBlock(currentNode);
|
|
20283
|
-
const
|
|
20284
|
-
if (
|
|
20285
|
-
|
|
19890
|
+
const shouldIgnoreCurrentNode = computedStyle.position === "fixed";
|
|
19891
|
+
if (shouldIgnoreCurrentNode) {
|
|
19892
|
+
currentContainingBlockComputedStyle = null;
|
|
20286
19893
|
} else {
|
|
20287
|
-
|
|
19894
|
+
const shouldDropCurrentNode = elementIsFixed ? !containingBlock && !currentContainingBlockComputedStyle : !containingBlock && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position);
|
|
19895
|
+
if (shouldDropCurrentNode) {
|
|
19896
|
+
result2 = result2.filter((ancestor) => ancestor !== currentNode);
|
|
19897
|
+
} else {
|
|
19898
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
19899
|
+
}
|
|
20288
19900
|
}
|
|
20289
19901
|
currentNode = getParentNode(currentNode);
|
|
20290
19902
|
}
|
|
19903
|
+
cache.set(element, result2);
|
|
20291
19904
|
return result2;
|
|
20292
19905
|
}
|
|
20293
19906
|
function getClippingRect(_ref) {
|
|
@@ -20297,7 +19910,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20297
19910
|
rootBoundary,
|
|
20298
19911
|
strategy
|
|
20299
19912
|
} = _ref;
|
|
20300
|
-
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element) : [].concat(boundary);
|
|
19913
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
20301
19914
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
20302
19915
|
const firstClippingAncestor = clippingAncestors[0];
|
|
20303
19916
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
@@ -20315,6 +19928,74 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20315
19928
|
y: clippingRect.top
|
|
20316
19929
|
};
|
|
20317
19930
|
}
|
|
19931
|
+
function getDimensions(element) {
|
|
19932
|
+
if (isHTMLElement(element)) {
|
|
19933
|
+
return getCssDimensions(element);
|
|
19934
|
+
}
|
|
19935
|
+
return element.getBoundingClientRect();
|
|
19936
|
+
}
|
|
19937
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
19938
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
|
|
19939
|
+
return null;
|
|
19940
|
+
}
|
|
19941
|
+
if (polyfill) {
|
|
19942
|
+
return polyfill(element);
|
|
19943
|
+
}
|
|
19944
|
+
return element.offsetParent;
|
|
19945
|
+
}
|
|
19946
|
+
function getContainingBlock(element) {
|
|
19947
|
+
let currentNode = getParentNode(element);
|
|
19948
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
19949
|
+
if (isContainingBlock(currentNode)) {
|
|
19950
|
+
return currentNode;
|
|
19951
|
+
} else {
|
|
19952
|
+
currentNode = getParentNode(currentNode);
|
|
19953
|
+
}
|
|
19954
|
+
}
|
|
19955
|
+
return null;
|
|
19956
|
+
}
|
|
19957
|
+
function getOffsetParent(element, polyfill) {
|
|
19958
|
+
const window2 = getWindow(element);
|
|
19959
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
19960
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
|
|
19961
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
19962
|
+
}
|
|
19963
|
+
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
|
19964
|
+
return window2;
|
|
19965
|
+
}
|
|
19966
|
+
return offsetParent || getContainingBlock(element) || window2;
|
|
19967
|
+
}
|
|
19968
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
19969
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
19970
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
19971
|
+
const rect = getBoundingClientRect(element, true, strategy === "fixed", offsetParent);
|
|
19972
|
+
let scroll = {
|
|
19973
|
+
scrollLeft: 0,
|
|
19974
|
+
scrollTop: 0
|
|
19975
|
+
};
|
|
19976
|
+
const offsets = {
|
|
19977
|
+
x: 0,
|
|
19978
|
+
y: 0
|
|
19979
|
+
};
|
|
19980
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
|
19981
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
19982
|
+
scroll = getNodeScroll(offsetParent);
|
|
19983
|
+
}
|
|
19984
|
+
if (isHTMLElement(offsetParent)) {
|
|
19985
|
+
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
19986
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
19987
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
19988
|
+
} else if (documentElement) {
|
|
19989
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
19990
|
+
}
|
|
19991
|
+
}
|
|
19992
|
+
return {
|
|
19993
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
19994
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
19995
|
+
width: rect.width,
|
|
19996
|
+
height: rect.height
|
|
19997
|
+
};
|
|
19998
|
+
}
|
|
20318
19999
|
const platform = {
|
|
20319
20000
|
getClippingRect,
|
|
20320
20001
|
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
@@ -20341,7 +20022,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20341
20022
|
};
|
|
20342
20023
|
},
|
|
20343
20024
|
getClientRects: (element) => Array.from(element.getClientRects()),
|
|
20344
|
-
isRTL: (element) => getComputedStyle(element).direction === "rtl"
|
|
20025
|
+
isRTL: (element) => getComputedStyle$1(element).direction === "rtl"
|
|
20345
20026
|
};
|
|
20346
20027
|
function autoUpdate(reference, floating, update2, options) {
|
|
20347
20028
|
if (options === void 0) {
|
|
@@ -20403,10 +20084,21 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20403
20084
|
}
|
|
20404
20085
|
};
|
|
20405
20086
|
}
|
|
20406
|
-
const computePosition = (reference, floating, options) =>
|
|
20407
|
-
|
|
20408
|
-
|
|
20409
|
-
|
|
20087
|
+
const computePosition = (reference, floating, options) => {
|
|
20088
|
+
const cache = /* @__PURE__ */ new Map();
|
|
20089
|
+
const mergedOptions = {
|
|
20090
|
+
platform,
|
|
20091
|
+
...options
|
|
20092
|
+
};
|
|
20093
|
+
const platformWithCache = {
|
|
20094
|
+
...mergedOptions.platform,
|
|
20095
|
+
_c: cache
|
|
20096
|
+
};
|
|
20097
|
+
return computePosition$1(reference, floating, {
|
|
20098
|
+
...mergedOptions,
|
|
20099
|
+
platform: platformWithCache
|
|
20100
|
+
});
|
|
20101
|
+
};
|
|
20410
20102
|
class Wrapper extends React__default.default.Component {
|
|
20411
20103
|
constructor() {
|
|
20412
20104
|
super(...arguments);
|
|
@@ -20510,7 +20202,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20510
20202
|
const [targetElement, setTargetElement] = React$4.useState(null);
|
|
20511
20203
|
function update2() {
|
|
20512
20204
|
var _a, _b, _c;
|
|
20513
|
-
return __awaiter
|
|
20205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20514
20206
|
const target = (_b = (_a = targetRef.current) === null || _a === void 0 ? void 0 : _a.element) !== null && _b !== void 0 ? _b : null;
|
|
20515
20207
|
const floating2 = floatingRef.current;
|
|
20516
20208
|
const arrowElement = arrowRef.current;
|
|
@@ -21524,7 +21216,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21524
21216
|
renderItem
|
|
21525
21217
|
} = props;
|
|
21526
21218
|
function processFile(file, fileList) {
|
|
21527
|
-
return __awaiter
|
|
21219
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21528
21220
|
const {
|
|
21529
21221
|
beforeUpload
|
|
21530
21222
|
} = props;
|
|
@@ -21538,7 +21230,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21538
21230
|
}
|
|
21539
21231
|
function onChange(e) {
|
|
21540
21232
|
var _a;
|
|
21541
|
-
return __awaiter
|
|
21233
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21542
21234
|
e.persist();
|
|
21543
21235
|
const {
|
|
21544
21236
|
files: rawFiles
|
|
@@ -21571,7 +21263,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21571
21263
|
file
|
|
21572
21264
|
}));
|
|
21573
21265
|
setTasks((prev) => [...getFinalTasks(prev), ...newTasks]);
|
|
21574
|
-
yield Promise.all(newTasks.map((currentTask) => __awaiter
|
|
21266
|
+
yield Promise.all(newTasks.map((currentTask) => __awaiter(this, void 0, void 0, function* () {
|
|
21575
21267
|
try {
|
|
21576
21268
|
const result2 = yield props.upload(currentTask.file);
|
|
21577
21269
|
setTasks((prev) => {
|
|
@@ -21636,7 +21328,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21636
21328
|
}
|
|
21637
21329
|
onPreview && onPreview(index2, fileItem);
|
|
21638
21330
|
},
|
|
21639
|
-
onDelete: () => __awaiter
|
|
21331
|
+
onDelete: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
21640
21332
|
var _c;
|
|
21641
21333
|
const canDelete = yield (_c = props.onDelete) === null || _c === void 0 ? void 0 : _c.call(props, fileItem);
|
|
21642
21334
|
if (canDelete === false)
|
|
@@ -21884,7 +21576,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21884
21576
|
const InfiniteScroll$1 = (p) => {
|
|
21885
21577
|
const props = mergeProps(defaultProps$w, p);
|
|
21886
21578
|
const [failed, setFailed] = React$4.useState(false);
|
|
21887
|
-
const doLoadMore = useLockFn((isRetry) => __awaiter
|
|
21579
|
+
const doLoadMore = useLockFn((isRetry) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21888
21580
|
try {
|
|
21889
21581
|
yield props.loadMore(isRetry);
|
|
21890
21582
|
} catch (e) {
|
|
@@ -21898,7 +21590,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21898
21590
|
const [scrollParent, setScrollParent] = React$4.useState();
|
|
21899
21591
|
const {
|
|
21900
21592
|
run: check
|
|
21901
|
-
} = useThrottleFn(() => __awaiter
|
|
21593
|
+
} = useThrottleFn(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
21902
21594
|
if (nextFlagRef.current !== flag)
|
|
21903
21595
|
return;
|
|
21904
21596
|
if (!props.hasMore)
|
|
@@ -21944,7 +21636,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21944
21636
|
};
|
|
21945
21637
|
}, [scrollParent]);
|
|
21946
21638
|
function retry() {
|
|
21947
|
-
return __awaiter
|
|
21639
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21948
21640
|
setFailed(false);
|
|
21949
21641
|
yield doLoadMore(true);
|
|
21950
21642
|
setFlag(nextFlagRef.current);
|
|
@@ -22089,6 +21781,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22089
21781
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
22090
21782
|
},
|
|
22091
21783
|
onClick: props.onClick,
|
|
21784
|
+
step: props.step,
|
|
22092
21785
|
role: props.role,
|
|
22093
21786
|
"aria-valuenow": props["aria-valuenow"],
|
|
22094
21787
|
"aria-valuemax": props["aria-valuemax"],
|
|
@@ -22256,7 +21949,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22256
21949
|
return React__default.default.createElement(ModalActionButton, {
|
|
22257
21950
|
key: action.key,
|
|
22258
21951
|
action,
|
|
22259
|
-
onAction: () => __awaiter
|
|
21952
|
+
onAction: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
22260
21953
|
var _a, _b, _c;
|
|
22261
21954
|
yield Promise.all([(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action), (_b = props.onAction) === null || _b === void 0 ? void 0 : _b.call(props, action, index2)]);
|
|
22262
21955
|
if (props.closeOnAction) {
|
|
@@ -22346,7 +22039,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22346
22039
|
key: "confirm",
|
|
22347
22040
|
text: props.confirmText,
|
|
22348
22041
|
primary: true,
|
|
22349
|
-
onClick: () => __awaiter
|
|
22042
|
+
onClick: () => __awaiter(this, void 0, void 0, function* () {
|
|
22350
22043
|
var _a;
|
|
22351
22044
|
yield (_a = props.onConfirm) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
22352
22045
|
resolve(true);
|
|
@@ -22354,7 +22047,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22354
22047
|
}, {
|
|
22355
22048
|
key: "cancel",
|
|
22356
22049
|
text: props.cancelText,
|
|
22357
|
-
onClick: () => __awaiter
|
|
22050
|
+
onClick: () => __awaiter(this, void 0, void 0, function* () {
|
|
22358
22051
|
var _b;
|
|
22359
22052
|
yield (_b = props.onCancel) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
22360
22053
|
resolve(false);
|
|
@@ -22922,7 +22615,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22922
22615
|
});
|
|
22923
22616
|
}, []);
|
|
22924
22617
|
function doRefresh() {
|
|
22925
|
-
return __awaiter
|
|
22618
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22926
22619
|
api.start({
|
|
22927
22620
|
height: headHeight
|
|
22928
22621
|
});
|
|
@@ -22932,7 +22625,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22932
22625
|
setStatus("complete");
|
|
22933
22626
|
} catch (e) {
|
|
22934
22627
|
api.start({
|
|
22935
|
-
to: (next) => __awaiter
|
|
22628
|
+
to: (next) => __awaiter(this, void 0, void 0, function* () {
|
|
22936
22629
|
yield next({
|
|
22937
22630
|
height: 0
|
|
22938
22631
|
});
|
|
@@ -22945,7 +22638,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22945
22638
|
yield sleep(props.completeDelay);
|
|
22946
22639
|
}
|
|
22947
22640
|
api.start({
|
|
22948
|
-
to: (next) => __awaiter
|
|
22641
|
+
to: (next) => __awaiter(this, void 0, void 0, function* () {
|
|
22949
22642
|
yield next({
|
|
22950
22643
|
height: 0
|
|
22951
22644
|
});
|
|
@@ -24311,9 +24004,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24311
24004
|
return;
|
|
24312
24005
|
_n = false;
|
|
24313
24006
|
} else
|
|
24314
|
-
for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = true)
|
|
24007
|
+
for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = true)
|
|
24315
24008
|
;
|
|
24316
|
-
}
|
|
24317
24009
|
} catch (err) {
|
|
24318
24010
|
_d = true, _e = err;
|
|
24319
24011
|
} finally {
|
|
@@ -24336,9 +24028,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24336
24028
|
function _arrayLikeToArray2(arr, len) {
|
|
24337
24029
|
if (len == null || len > arr.length)
|
|
24338
24030
|
len = arr.length;
|
|
24339
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
24031
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
24340
24032
|
arr2[i] = arr[i];
|
|
24341
|
-
}
|
|
24342
24033
|
return arr2;
|
|
24343
24034
|
}
|
|
24344
24035
|
module2.exports = _arrayLikeToArray2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
@@ -24968,7 +24659,31 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24968
24659
|
}, [state]);
|
|
24969
24660
|
return [state, setState, ref];
|
|
24970
24661
|
}
|
|
24662
|
+
function mergeFuncProps(p1, p2) {
|
|
24663
|
+
const p1Keys = Object.keys(p1);
|
|
24664
|
+
const p2Keys = Object.keys(p2);
|
|
24665
|
+
const keys2 = /* @__PURE__ */ new Set([...p1Keys, ...p2Keys]);
|
|
24666
|
+
const res = {};
|
|
24667
|
+
keys2.forEach((key) => {
|
|
24668
|
+
const p1Value = p1[key];
|
|
24669
|
+
const p2Value = p2[key];
|
|
24670
|
+
if (typeof p1Value === "function" && typeof p2Value === "function") {
|
|
24671
|
+
res[key] = function(...args) {
|
|
24672
|
+
p1Value(...args);
|
|
24673
|
+
p2Value(...args);
|
|
24674
|
+
};
|
|
24675
|
+
} else {
|
|
24676
|
+
res[key] = p1Value || p2Value;
|
|
24677
|
+
}
|
|
24678
|
+
});
|
|
24679
|
+
return res;
|
|
24680
|
+
}
|
|
24971
24681
|
const classPrefix$a = `adm-swiper`;
|
|
24682
|
+
const eventToPropRecord = {
|
|
24683
|
+
"mousedown": "onMouseDown",
|
|
24684
|
+
"mousemove": "onMouseMove",
|
|
24685
|
+
"mouseup": "onMouseUp"
|
|
24686
|
+
};
|
|
24972
24687
|
const defaultProps$a = {
|
|
24973
24688
|
defaultIndex: 0,
|
|
24974
24689
|
allowTouchMove: true,
|
|
@@ -24979,7 +24694,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24979
24694
|
slideSize: 100,
|
|
24980
24695
|
trackOffset: 0,
|
|
24981
24696
|
stuckAtBoundary: true,
|
|
24982
|
-
rubberband: true
|
|
24697
|
+
rubberband: true,
|
|
24698
|
+
stopPropagation: []
|
|
24983
24699
|
};
|
|
24984
24700
|
let currentUid;
|
|
24985
24701
|
const Swiper = React$4.forwardRef(staged_1((p, ref) => {
|
|
@@ -25163,11 +24879,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25163
24879
|
React$4.useEffect(() => {
|
|
25164
24880
|
if (!autoplay || dragging)
|
|
25165
24881
|
return;
|
|
25166
|
-
|
|
24882
|
+
let interval;
|
|
24883
|
+
function tick() {
|
|
24884
|
+
interval = window.setTimeout(tick, autoplayInterval);
|
|
25167
24885
|
swipeNext();
|
|
25168
|
-
}
|
|
24886
|
+
}
|
|
24887
|
+
interval = window.setTimeout(tick, autoplayInterval);
|
|
25169
24888
|
return () => {
|
|
25170
|
-
|
|
24889
|
+
if (interval)
|
|
24890
|
+
window.clearTimeout(interval);
|
|
25171
24891
|
};
|
|
25172
24892
|
}, [autoplay, autoplayInterval, dragging, count]);
|
|
25173
24893
|
function renderTrackInner() {
|
|
@@ -25206,6 +24926,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25206
24926
|
"--slide-size": `${props.slideSize}%`,
|
|
25207
24927
|
"--track-offset": `${props.trackOffset}%`
|
|
25208
24928
|
};
|
|
24929
|
+
const dragProps = Object.assign({}, props.allowTouchMove ? bind() : {});
|
|
24930
|
+
const stopPropagationProps = {};
|
|
24931
|
+
for (const key of props.stopPropagation) {
|
|
24932
|
+
const prop = eventToPropRecord[key];
|
|
24933
|
+
stopPropagationProps[prop] = function(e) {
|
|
24934
|
+
e.stopPropagation();
|
|
24935
|
+
};
|
|
24936
|
+
}
|
|
24937
|
+
const mergedProps = mergeFuncProps(dragProps, stopPropagationProps);
|
|
25209
24938
|
return withNativeProps(props, React__default.default.createElement("div", {
|
|
25210
24939
|
className: classNames(classPrefix$a, `${classPrefix$a}-${props.direction}`),
|
|
25211
24940
|
style
|
|
@@ -25220,7 +24949,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25220
24949
|
}
|
|
25221
24950
|
forceCancelDrag();
|
|
25222
24951
|
}
|
|
25223
|
-
},
|
|
24952
|
+
}, mergedProps), renderTrackInner()), props.indicator === void 0 ? React__default.default.createElement("div", {
|
|
25224
24953
|
className: `${classPrefix$a}-indicator`
|
|
25225
24954
|
}, React__default.default.createElement(PageIndicator, Object.assign({}, props.indicatorProps, {
|
|
25226
24955
|
total: count,
|
|
@@ -25275,7 +25004,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25275
25004
|
onChange: props.onChange
|
|
25276
25005
|
});
|
|
25277
25006
|
function onClick() {
|
|
25278
|
-
return __awaiter
|
|
25007
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25279
25008
|
if (disabled || props.loading || changing) {
|
|
25280
25009
|
return;
|
|
25281
25010
|
}
|
|
@@ -25459,6 +25188,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25459
25188
|
devError("TextArea", "`value` prop on `TextArea` should not be `null`. Consider using an empty string to clear the component.");
|
|
25460
25189
|
}
|
|
25461
25190
|
const nativeTextAreaRef = React$4.useRef(null);
|
|
25191
|
+
const heightRef = React$4.useRef("auto");
|
|
25462
25192
|
React$4.useImperativeHandle(ref, () => ({
|
|
25463
25193
|
clear: () => {
|
|
25464
25194
|
setValue2("");
|
|
@@ -25481,7 +25211,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25481
25211
|
const textArea2 = nativeTextAreaRef.current;
|
|
25482
25212
|
if (!textArea2)
|
|
25483
25213
|
return;
|
|
25484
|
-
textArea2.style.height =
|
|
25214
|
+
textArea2.style.height = heightRef.current;
|
|
25485
25215
|
let height = textArea2.scrollHeight;
|
|
25486
25216
|
if (typeof autoSize === "object") {
|
|
25487
25217
|
const computedStyle = window.getComputedStyle(textArea2);
|
|
@@ -25493,6 +25223,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25493
25223
|
height = Math.min(height, autoSize.maxRows * lineHeight);
|
|
25494
25224
|
}
|
|
25495
25225
|
}
|
|
25226
|
+
heightRef.current = `${height}px`;
|
|
25496
25227
|
textArea2.style.height = `${height}px`;
|
|
25497
25228
|
}, [value, autoSize]);
|
|
25498
25229
|
const compositingRef = React$4.useRef(false);
|
|
@@ -26227,7 +25958,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
26227
25958
|
className: classNames(classPrefix)
|
|
26228
25959
|
}, label && React__default.default.createElement("div", {
|
|
26229
25960
|
className: `${classPrefix}-label`
|
|
26230
|
-
}, React__default.default.createElement(Divider
|
|
25961
|
+
}, React__default.default.createElement(Divider, null, label)), links && links.length > 0 && React__default.default.createElement("div", {
|
|
26231
25962
|
className: `${classPrefix}-links`
|
|
26232
25963
|
}, links.map((link, index2) => {
|
|
26233
25964
|
return React__default.default.createElement(React__default.default.Fragment, {
|
|
@@ -26236,7 +25967,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
26236
25967
|
href: link.href,
|
|
26237
25968
|
rel: "noopener noreferrer",
|
|
26238
25969
|
onClick: (event) => clickLinkItem(link, index2, event)
|
|
26239
|
-
}, link.text), index2 !== links.length - 1 && React__default.default.createElement(Divider
|
|
25970
|
+
}, link.text), index2 !== links.length - 1 && React__default.default.createElement(Divider, {
|
|
26240
25971
|
direction: "vertical"
|
|
26241
25972
|
}));
|
|
26242
25973
|
})), content && React__default.default.createElement("div", {
|