antd-mobile 5.28.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/bundle/antd-mobile.cjs.development.js +235 -200
- package/2x/bundle/antd-mobile.cjs.js +9 -9
- package/2x/bundle/antd-mobile.es.development.js +235 -200
- package/2x/bundle/antd-mobile.es.js +5086 -5066
- package/2x/bundle/antd-mobile.umd.development.js +235 -200
- package/2x/bundle/antd-mobile.umd.js +9 -9
- package/2x/bundle/style.css +0 -1
- package/2x/cjs/components/ellipsis/ellipsis.d.ts +1 -0
- package/2x/cjs/components/ellipsis/ellipsis.js +3 -2
- 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/swiper.js +6 -3
- package/2x/cjs/components/text-area/text-area.js +4 -1
- 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/es/components/ellipsis/ellipsis.d.ts +1 -0
- package/2x/es/components/ellipsis/ellipsis.js +3 -2
- 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/swiper.js +6 -3
- package/2x/es/components/text-area/text-area.js +4 -1
- 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/package.json +2 -2
- package/bundle/antd-mobile.cjs.development.js +235 -200
- package/bundle/antd-mobile.cjs.js +9 -9
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +235 -200
- package/bundle/antd-mobile.es.js +5086 -5066
- package/bundle/antd-mobile.umd.development.js +235 -200
- package/bundle/antd-mobile.umd.js +9 -9
- package/bundle/style.css +1 -1
- package/cjs/components/ellipsis/ellipsis.d.ts +1 -0
- package/cjs/components/ellipsis/ellipsis.js +3 -2
- 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/swiper.js +6 -3
- package/cjs/components/text-area/text-area.js +4 -1
- 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/es/components/ellipsis/ellipsis.d.ts +1 -0
- package/es/components/ellipsis/ellipsis.js +3 -2
- 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/swiper.js +6 -3
- package/es/components/text-area/text-area.js +4 -1
- 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/package.json +2 -2
- package/umd/antd-mobile.js +1 -1
|
@@ -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"],
|
|
@@ -7309,6 +7311,9 @@
|
|
|
7309
7311
|
});
|
|
7310
7312
|
const Popup$1 = (p) => {
|
|
7311
7313
|
const props = mergeProps(defaultProps$12, p);
|
|
7314
|
+
const {
|
|
7315
|
+
locale
|
|
7316
|
+
} = useConfig();
|
|
7312
7317
|
const bodyCls = classNames(`${classPrefix$1k}-body`, props.bodyClassName, `${classPrefix$1k}-body-position-${props.position}`);
|
|
7313
7318
|
const [active, setActive] = React$4.useState(props.visible);
|
|
7314
7319
|
useIsomorphicLayoutEffect$2(() => {
|
|
@@ -7388,7 +7393,9 @@
|
|
|
7388
7393
|
onClick: () => {
|
|
7389
7394
|
var _a;
|
|
7390
7395
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
7391
|
-
}
|
|
7396
|
+
},
|
|
7397
|
+
role: "button",
|
|
7398
|
+
"aria-label": locale.common.close
|
|
7392
7399
|
}, React__default.default.createElement(CloseOutline, null)), props.children))));
|
|
7393
7400
|
return React__default.default.createElement(ShouldRender, {
|
|
7394
7401
|
active,
|
|
@@ -13411,13 +13418,14 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13411
13418
|
collapseText: "",
|
|
13412
13419
|
stopPropagationForActionButtons: [],
|
|
13413
13420
|
onContentClick: () => {
|
|
13414
|
-
}
|
|
13421
|
+
},
|
|
13422
|
+
defaultExpanded: false
|
|
13415
13423
|
};
|
|
13416
13424
|
const Ellipsis$1 = (p) => {
|
|
13417
13425
|
const props = mergeProps(defaultProps$G, p);
|
|
13418
13426
|
const rootRef = React$4.useRef(null);
|
|
13419
13427
|
const [ellipsised, setEllipsised] = React$4.useState({});
|
|
13420
|
-
const [expanded, setExpanded] = React$4.useState(
|
|
13428
|
+
const [expanded, setExpanded] = React$4.useState(props.defaultExpanded);
|
|
13421
13429
|
const [exceeded, setExceeded] = React$4.useState(false);
|
|
13422
13430
|
const chars = React$4.useMemo(() => _runes_0_4_3_runes.exports(props.content), [props.content]);
|
|
13423
13431
|
function getSubString(start2, end) {
|
|
@@ -16473,7 +16481,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16473
16481
|
_validateRule = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2(name, value, rule, options, messageVariables) {
|
|
16474
16482
|
var cloneRule, originValidator, subRuleField, validator, messages2, result2, subResults, kv, fillVariableResult;
|
|
16475
16483
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
16476
|
-
while (1)
|
|
16484
|
+
while (1)
|
|
16477
16485
|
switch (_context2.prev = _context2.next) {
|
|
16478
16486
|
case 0:
|
|
16479
16487
|
cloneRule = _objectSpread2({}, rule);
|
|
@@ -16546,7 +16554,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16546
16554
|
case "end":
|
|
16547
16555
|
return _context2.stop();
|
|
16548
16556
|
}
|
|
16549
|
-
}
|
|
16550
16557
|
}, _callee2, null, [[9, 14]]);
|
|
16551
16558
|
}));
|
|
16552
16559
|
return _validateRule.apply(this, arguments);
|
|
@@ -16602,7 +16609,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16602
16609
|
var _ref3 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
16603
16610
|
var i, rule, errors;
|
|
16604
16611
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
16605
|
-
while (1)
|
|
16612
|
+
while (1)
|
|
16606
16613
|
switch (_context.prev = _context.next) {
|
|
16607
16614
|
case 0:
|
|
16608
16615
|
i = 0;
|
|
@@ -16635,7 +16642,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16635
16642
|
case "end":
|
|
16636
16643
|
return _context.stop();
|
|
16637
16644
|
}
|
|
16638
|
-
}
|
|
16639
16645
|
}, _callee);
|
|
16640
16646
|
}));
|
|
16641
16647
|
return function(_x6, _x7) {
|
|
@@ -16666,7 +16672,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16666
16672
|
function _finishOnAllFailed() {
|
|
16667
16673
|
_finishOnAllFailed = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee3(rulePromises) {
|
|
16668
16674
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
16669
|
-
while (1)
|
|
16675
|
+
while (1)
|
|
16670
16676
|
switch (_context3.prev = _context3.next) {
|
|
16671
16677
|
case 0:
|
|
16672
16678
|
return _context3.abrupt("return", Promise.all(rulePromises).then(function(errorsList) {
|
|
@@ -16678,7 +16684,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16678
16684
|
case "end":
|
|
16679
16685
|
return _context3.stop();
|
|
16680
16686
|
}
|
|
16681
|
-
}
|
|
16682
16687
|
}, _callee3);
|
|
16683
16688
|
}));
|
|
16684
16689
|
return _finishOnAllFailed.apply(this, arguments);
|
|
@@ -16690,7 +16695,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16690
16695
|
_finishOnFirstFailed = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee4(rulePromises) {
|
|
16691
16696
|
var count;
|
|
16692
16697
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
16693
|
-
while (1)
|
|
16698
|
+
while (1)
|
|
16694
16699
|
switch (_context4.prev = _context4.next) {
|
|
16695
16700
|
case 0:
|
|
16696
16701
|
count = 0;
|
|
@@ -16711,7 +16716,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16711
16716
|
case "end":
|
|
16712
16717
|
return _context4.stop();
|
|
16713
16718
|
}
|
|
16714
|
-
}
|
|
16715
16719
|
}, _callee4);
|
|
16716
16720
|
}));
|
|
16717
16721
|
return _finishOnFirstFailed.apply(this, arguments);
|
|
@@ -18224,6 +18228,11 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18224
18228
|
return Math.random();
|
|
18225
18229
|
}
|
|
18226
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
|
+
};
|
|
18227
18236
|
function useWatch() {
|
|
18228
18237
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18229
18238
|
args[_key] = arguments[_key];
|
|
@@ -18244,6 +18253,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18244
18253
|
var namePath = getNamePath(dependencies);
|
|
18245
18254
|
var namePathRef = React$4.useRef(namePath);
|
|
18246
18255
|
namePathRef.current = namePath;
|
|
18256
|
+
useWatchWarning(namePath);
|
|
18247
18257
|
React$4.useEffect(
|
|
18248
18258
|
function() {
|
|
18249
18259
|
if (!isValidForm) {
|
|
@@ -18993,7 +19003,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18993
19003
|
bottom: rect.y + rect.height
|
|
18994
19004
|
};
|
|
18995
19005
|
}
|
|
18996
|
-
async function detectOverflow(
|
|
19006
|
+
async function detectOverflow(state, options) {
|
|
18997
19007
|
var _await$platform$isEle;
|
|
18998
19008
|
if (options === void 0) {
|
|
18999
19009
|
options = {};
|
|
@@ -19005,7 +19015,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19005
19015
|
rects,
|
|
19006
19016
|
elements,
|
|
19007
19017
|
strategy
|
|
19008
|
-
} =
|
|
19018
|
+
} = state;
|
|
19009
19019
|
const {
|
|
19010
19020
|
boundary = "clippingAncestors",
|
|
19011
19021
|
rootBoundary = "viewport",
|
|
@@ -19055,7 +19065,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19055
19065
|
const arrow = (options) => ({
|
|
19056
19066
|
name: "arrow",
|
|
19057
19067
|
options,
|
|
19058
|
-
async fn(
|
|
19068
|
+
async fn(state) {
|
|
19059
19069
|
const {
|
|
19060
19070
|
element,
|
|
19061
19071
|
padding = 0
|
|
@@ -19066,7 +19076,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19066
19076
|
placement,
|
|
19067
19077
|
rects,
|
|
19068
19078
|
platform: platform2
|
|
19069
|
-
} =
|
|
19079
|
+
} = state;
|
|
19070
19080
|
if (element == null) {
|
|
19071
19081
|
{
|
|
19072
19082
|
console.warn("Floating UI: No `element` was passed to the `arrow` middleware.");
|
|
@@ -19179,7 +19189,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19179
19189
|
return {
|
|
19180
19190
|
name: "flip",
|
|
19181
19191
|
options,
|
|
19182
|
-
async fn(
|
|
19192
|
+
async fn(state) {
|
|
19183
19193
|
var _middlewareData$flip;
|
|
19184
19194
|
const {
|
|
19185
19195
|
placement,
|
|
@@ -19188,7 +19198,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19188
19198
|
initialPlacement,
|
|
19189
19199
|
platform: platform2,
|
|
19190
19200
|
elements
|
|
19191
|
-
} =
|
|
19201
|
+
} = state;
|
|
19192
19202
|
const {
|
|
19193
19203
|
mainAxis: checkMainAxis = true,
|
|
19194
19204
|
crossAxis: checkCrossAxis = true,
|
|
@@ -19206,7 +19216,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19206
19216
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
19207
19217
|
}
|
|
19208
19218
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
19209
|
-
const overflow = await detectOverflow(
|
|
19219
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
19210
19220
|
const overflows = [];
|
|
19211
19221
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
19212
19222
|
if (checkMainAxis) {
|
|
@@ -19224,7 +19234,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19224
19234
|
overflows
|
|
19225
19235
|
}];
|
|
19226
19236
|
if (!overflows.every((side2) => side2 <= 0)) {
|
|
19227
|
-
var _middlewareData$flip2;
|
|
19237
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
19228
19238
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
19229
19239
|
const nextPlacement = placements[nextIndex];
|
|
19230
19240
|
if (nextPlacement) {
|
|
@@ -19238,19 +19248,21 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19238
19248
|
}
|
|
19239
19249
|
};
|
|
19240
19250
|
}
|
|
19241
|
-
let resetPlacement =
|
|
19242
|
-
|
|
19243
|
-
|
|
19244
|
-
|
|
19245
|
-
|
|
19246
|
-
|
|
19247
|
-
|
|
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;
|
|
19248
19261
|
}
|
|
19249
|
-
|
|
19262
|
+
case "initialPlacement":
|
|
19263
|
+
resetPlacement = initialPlacement;
|
|
19264
|
+
break;
|
|
19250
19265
|
}
|
|
19251
|
-
case "initialPlacement":
|
|
19252
|
-
resetPlacement = initialPlacement;
|
|
19253
|
-
break;
|
|
19254
19266
|
}
|
|
19255
19267
|
if (placement !== resetPlacement) {
|
|
19256
19268
|
return {
|
|
@@ -19282,17 +19294,17 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19282
19294
|
return {
|
|
19283
19295
|
name: "hide",
|
|
19284
19296
|
options,
|
|
19285
|
-
async fn(
|
|
19297
|
+
async fn(state) {
|
|
19286
19298
|
const {
|
|
19287
19299
|
strategy = "referenceHidden",
|
|
19288
19300
|
...detectOverflowOptions
|
|
19289
19301
|
} = options;
|
|
19290
19302
|
const {
|
|
19291
19303
|
rects
|
|
19292
|
-
} =
|
|
19304
|
+
} = state;
|
|
19293
19305
|
switch (strategy) {
|
|
19294
19306
|
case "referenceHidden": {
|
|
19295
|
-
const overflow = await detectOverflow(
|
|
19307
|
+
const overflow = await detectOverflow(state, {
|
|
19296
19308
|
...detectOverflowOptions,
|
|
19297
19309
|
elementContext: "reference"
|
|
19298
19310
|
});
|
|
@@ -19305,7 +19317,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19305
19317
|
};
|
|
19306
19318
|
}
|
|
19307
19319
|
case "escaped": {
|
|
19308
|
-
const overflow = await detectOverflow(
|
|
19320
|
+
const overflow = await detectOverflow(state, {
|
|
19309
19321
|
...detectOverflowOptions,
|
|
19310
19322
|
altBoundary: true
|
|
19311
19323
|
});
|
|
@@ -19324,19 +19336,19 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19324
19336
|
}
|
|
19325
19337
|
};
|
|
19326
19338
|
};
|
|
19327
|
-
async function convertValueToCoords(
|
|
19339
|
+
async function convertValueToCoords(state, value) {
|
|
19328
19340
|
const {
|
|
19329
19341
|
placement,
|
|
19330
19342
|
platform: platform2,
|
|
19331
19343
|
elements
|
|
19332
|
-
} =
|
|
19344
|
+
} = state;
|
|
19333
19345
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
19334
19346
|
const side = getSide(placement);
|
|
19335
19347
|
const alignment = getAlignment(placement);
|
|
19336
19348
|
const isVertical = getMainAxisFromPlacement(placement) === "x";
|
|
19337
19349
|
const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
|
|
19338
19350
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
19339
|
-
const rawValue = typeof value === "function" ? value(
|
|
19351
|
+
const rawValue = typeof value === "function" ? value(state) : value;
|
|
19340
19352
|
let {
|
|
19341
19353
|
mainAxis,
|
|
19342
19354
|
crossAxis,
|
|
@@ -19369,12 +19381,12 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19369
19381
|
return {
|
|
19370
19382
|
name: "offset",
|
|
19371
19383
|
options: value,
|
|
19372
|
-
async fn(
|
|
19384
|
+
async fn(state) {
|
|
19373
19385
|
const {
|
|
19374
19386
|
x,
|
|
19375
19387
|
y
|
|
19376
|
-
} =
|
|
19377
|
-
const diffCoords = await convertValueToCoords(
|
|
19388
|
+
} = state;
|
|
19389
|
+
const diffCoords = await convertValueToCoords(state, value);
|
|
19378
19390
|
return {
|
|
19379
19391
|
x: x + diffCoords.x,
|
|
19380
19392
|
y: y + diffCoords.y,
|
|
@@ -19393,12 +19405,12 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19393
19405
|
return {
|
|
19394
19406
|
name: "shift",
|
|
19395
19407
|
options,
|
|
19396
|
-
async fn(
|
|
19408
|
+
async fn(state) {
|
|
19397
19409
|
const {
|
|
19398
19410
|
x,
|
|
19399
19411
|
y,
|
|
19400
19412
|
placement
|
|
19401
|
-
} =
|
|
19413
|
+
} = state;
|
|
19402
19414
|
const {
|
|
19403
19415
|
mainAxis: checkMainAxis = true,
|
|
19404
19416
|
crossAxis: checkCrossAxis = false,
|
|
@@ -19420,7 +19432,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19420
19432
|
x,
|
|
19421
19433
|
y
|
|
19422
19434
|
};
|
|
19423
|
-
const overflow = await detectOverflow(
|
|
19435
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
19424
19436
|
const mainAxis = getMainAxisFromPlacement(getSide(placement));
|
|
19425
19437
|
const crossAxis = getCrossAxis(mainAxis);
|
|
19426
19438
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -19440,7 +19452,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19440
19452
|
crossAxisCoord = within(min2, crossAxisCoord, max2);
|
|
19441
19453
|
}
|
|
19442
19454
|
const limitedCoords = limiter.fn({
|
|
19443
|
-
...
|
|
19455
|
+
...state,
|
|
19444
19456
|
[mainAxis]: mainAxisCoord,
|
|
19445
19457
|
[crossAxis]: crossAxisCoord
|
|
19446
19458
|
});
|
|
@@ -19460,14 +19472,14 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19460
19472
|
}
|
|
19461
19473
|
return {
|
|
19462
19474
|
options,
|
|
19463
|
-
fn(
|
|
19475
|
+
fn(state) {
|
|
19464
19476
|
const {
|
|
19465
19477
|
x,
|
|
19466
19478
|
y,
|
|
19467
19479
|
placement,
|
|
19468
19480
|
rects,
|
|
19469
19481
|
middlewareData
|
|
19470
|
-
} =
|
|
19482
|
+
} = state;
|
|
19471
19483
|
const {
|
|
19472
19484
|
offset: offset2 = 0,
|
|
19473
19485
|
mainAxis: checkMainAxis = true,
|
|
@@ -19481,7 +19493,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19481
19493
|
const crossAxis = getCrossAxis(mainAxis);
|
|
19482
19494
|
let mainAxisCoord = coords[mainAxis];
|
|
19483
19495
|
let crossAxisCoord = coords[crossAxis];
|
|
19484
|
-
const rawOffset = typeof offset2 === "function" ? offset2(
|
|
19496
|
+
const rawOffset = typeof offset2 === "function" ? offset2(state) : offset2;
|
|
19485
19497
|
const computedOffset = typeof rawOffset === "number" ? {
|
|
19486
19498
|
mainAxis: rawOffset,
|
|
19487
19499
|
crossAxis: 0
|
|
@@ -19526,6 +19538,26 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19526
19538
|
function getComputedStyle$1(element) {
|
|
19527
19539
|
return getWindow(element).getComputedStyle(element);
|
|
19528
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
|
+
}
|
|
19529
19561
|
function getNodeName(node) {
|
|
19530
19562
|
return isNode(node) ? (node.nodeName || "").toLowerCase() : "";
|
|
19531
19563
|
}
|
|
@@ -19573,39 +19605,17 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19573
19605
|
const isFirefox = /firefox/i.test(getUAString());
|
|
19574
19606
|
const css = getComputedStyle$1(element);
|
|
19575
19607
|
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
|
|
19576
|
-
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(
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
}
|
|
19581
|
-
);
|
|
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
|
+
});
|
|
19582
19612
|
}
|
|
19583
|
-
function
|
|
19584
|
-
return
|
|
19613
|
+
function isClientRectVisualViewportBased() {
|
|
19614
|
+
return /^((?!chrome|android).)*safari/i.test(getUAString());
|
|
19585
19615
|
}
|
|
19586
19616
|
function isLastTraversableNode(node) {
|
|
19587
19617
|
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
19588
19618
|
}
|
|
19589
|
-
const min = Math.min;
|
|
19590
|
-
const max = Math.max;
|
|
19591
|
-
const round = Math.round;
|
|
19592
|
-
function getCssDimensions(element) {
|
|
19593
|
-
const css = getComputedStyle$1(element);
|
|
19594
|
-
let width = parseFloat(css.width);
|
|
19595
|
-
let height = parseFloat(css.height);
|
|
19596
|
-
const offsetWidth = element.offsetWidth;
|
|
19597
|
-
const offsetHeight = element.offsetHeight;
|
|
19598
|
-
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
19599
|
-
if (shouldFallback) {
|
|
19600
|
-
width = offsetWidth;
|
|
19601
|
-
height = offsetHeight;
|
|
19602
|
-
}
|
|
19603
|
-
return {
|
|
19604
|
-
width,
|
|
19605
|
-
height,
|
|
19606
|
-
fallback: shouldFallback
|
|
19607
|
-
};
|
|
19608
|
-
}
|
|
19609
19619
|
function unwrapElement(element) {
|
|
19610
19620
|
return !isElement(element) ? element.contextElement : element;
|
|
19611
19621
|
}
|
|
@@ -19658,7 +19668,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19658
19668
|
}
|
|
19659
19669
|
}
|
|
19660
19670
|
const win = domElement ? getWindow(domElement) : window;
|
|
19661
|
-
const addVisualOffsets =
|
|
19671
|
+
const addVisualOffsets = isClientRectVisualViewportBased() && isFixedStrategy;
|
|
19662
19672
|
let x = (clientRect.left + (addVisualOffsets ? ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0 : 0)) / scale2.x;
|
|
19663
19673
|
let y = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale2.y;
|
|
19664
19674
|
let width = clientRect.width / scale2.x;
|
|
@@ -19708,78 +19718,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19708
19718
|
scrollTop: element.pageYOffset
|
|
19709
19719
|
};
|
|
19710
19720
|
}
|
|
19711
|
-
function getWindowScrollBarX(element) {
|
|
19712
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
19713
|
-
}
|
|
19714
|
-
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
19715
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
19716
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
19717
|
-
const rect = getBoundingClientRect(element, true, strategy === "fixed", offsetParent);
|
|
19718
|
-
let scroll = {
|
|
19719
|
-
scrollLeft: 0,
|
|
19720
|
-
scrollTop: 0
|
|
19721
|
-
};
|
|
19722
|
-
const offsets = {
|
|
19723
|
-
x: 0,
|
|
19724
|
-
y: 0
|
|
19725
|
-
};
|
|
19726
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
|
19727
|
-
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
19728
|
-
scroll = getNodeScroll(offsetParent);
|
|
19729
|
-
}
|
|
19730
|
-
if (isHTMLElement(offsetParent)) {
|
|
19731
|
-
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
19732
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
19733
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
19734
|
-
} else if (documentElement) {
|
|
19735
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
19736
|
-
}
|
|
19737
|
-
}
|
|
19738
|
-
return {
|
|
19739
|
-
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
19740
|
-
y: rect.top + scroll.scrollTop - offsets.y,
|
|
19741
|
-
width: rect.width,
|
|
19742
|
-
height: rect.height
|
|
19743
|
-
};
|
|
19744
|
-
}
|
|
19745
|
-
function getParentNode(node) {
|
|
19746
|
-
if (getNodeName(node) === "html") {
|
|
19747
|
-
return node;
|
|
19748
|
-
}
|
|
19749
|
-
const result2 = node.assignedSlot || node.parentNode || (isShadowRoot(node) ? node.host : null) || getDocumentElement(node);
|
|
19750
|
-
return isShadowRoot(result2) ? result2.host : result2;
|
|
19751
|
-
}
|
|
19752
|
-
function getTrueOffsetParent(element) {
|
|
19753
|
-
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
|
|
19754
|
-
return null;
|
|
19755
|
-
}
|
|
19756
|
-
return element.offsetParent;
|
|
19757
|
-
}
|
|
19758
|
-
function getContainingBlock(element) {
|
|
19759
|
-
let currentNode = getParentNode(element);
|
|
19760
|
-
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
19761
|
-
if (isContainingBlock(currentNode)) {
|
|
19762
|
-
return currentNode;
|
|
19763
|
-
} else {
|
|
19764
|
-
currentNode = getParentNode(currentNode);
|
|
19765
|
-
}
|
|
19766
|
-
}
|
|
19767
|
-
return null;
|
|
19768
|
-
}
|
|
19769
|
-
function getOffsetParent(element) {
|
|
19770
|
-
const window2 = getWindow(element);
|
|
19771
|
-
let offsetParent = getTrueOffsetParent(element);
|
|
19772
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
|
|
19773
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
19774
|
-
}
|
|
19775
|
-
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
|
19776
|
-
return window2;
|
|
19777
|
-
}
|
|
19778
|
-
return offsetParent || getContainingBlock(element) || window2;
|
|
19779
|
-
}
|
|
19780
|
-
function getDimensions(element) {
|
|
19781
|
-
return getCssDimensions(element);
|
|
19782
|
-
}
|
|
19783
19721
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
19784
19722
|
let {
|
|
19785
19723
|
rect,
|
|
@@ -19821,41 +19759,19 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19821
19759
|
y: rect.y * scale2.y - scroll.scrollTop * scale2.y + offsets.y
|
|
19822
19760
|
};
|
|
19823
19761
|
}
|
|
19824
|
-
function
|
|
19825
|
-
|
|
19826
|
-
const html = getDocumentElement(element);
|
|
19827
|
-
const visualViewport = win.visualViewport;
|
|
19828
|
-
let width = html.clientWidth;
|
|
19829
|
-
let height = html.clientHeight;
|
|
19830
|
-
let x = 0;
|
|
19831
|
-
let y = 0;
|
|
19832
|
-
if (visualViewport) {
|
|
19833
|
-
width = visualViewport.width;
|
|
19834
|
-
height = visualViewport.height;
|
|
19835
|
-
const layoutViewport = isLayoutViewport();
|
|
19836
|
-
if (layoutViewport || !layoutViewport && strategy === "fixed") {
|
|
19837
|
-
x = visualViewport.offsetLeft;
|
|
19838
|
-
y = visualViewport.offsetTop;
|
|
19839
|
-
}
|
|
19840
|
-
}
|
|
19841
|
-
return {
|
|
19842
|
-
width,
|
|
19843
|
-
height,
|
|
19844
|
-
x,
|
|
19845
|
-
y
|
|
19846
|
-
};
|
|
19762
|
+
function getWindowScrollBarX(element) {
|
|
19763
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
19847
19764
|
}
|
|
19848
19765
|
function getDocumentRect(element) {
|
|
19849
|
-
var _element$ownerDocumen;
|
|
19850
19766
|
const html = getDocumentElement(element);
|
|
19851
19767
|
const scroll = getNodeScroll(element);
|
|
19852
|
-
const body =
|
|
19853
|
-
const width = max(html.scrollWidth, html.clientWidth, body
|
|
19854
|
-
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);
|
|
19855
19771
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
19856
19772
|
const y = -scroll.scrollTop;
|
|
19857
|
-
if (getComputedStyle$1(body
|
|
19858
|
-
x += max(html.clientWidth, body
|
|
19773
|
+
if (getComputedStyle$1(body).direction === "rtl") {
|
|
19774
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
19859
19775
|
}
|
|
19860
19776
|
return {
|
|
19861
19777
|
width,
|
|
@@ -19864,10 +19780,17 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19864
19780
|
y
|
|
19865
19781
|
};
|
|
19866
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
|
+
}
|
|
19867
19790
|
function getNearestOverflowAncestor(node) {
|
|
19868
19791
|
const parentNode = getParentNode(node);
|
|
19869
19792
|
if (isLastTraversableNode(parentNode)) {
|
|
19870
|
-
return
|
|
19793
|
+
return parentNode.ownerDocument.body;
|
|
19871
19794
|
}
|
|
19872
19795
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
19873
19796
|
return parentNode;
|
|
@@ -19887,6 +19810,30 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19887
19810
|
}
|
|
19888
19811
|
return list2.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
|
|
19889
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
|
+
}
|
|
19890
19837
|
function getInnerBoundingClientRect(element, strategy) {
|
|
19891
19838
|
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
19892
19839
|
const top = clientRect.top + element.clientTop;
|
|
@@ -19900,24 +19847,33 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19900
19847
|
const x = left * scale2.x;
|
|
19901
19848
|
const y = top * scale2.y;
|
|
19902
19849
|
return {
|
|
19903
|
-
top: y,
|
|
19904
|
-
left: x,
|
|
19905
|
-
right: x + width,
|
|
19906
|
-
bottom: y + height,
|
|
19907
|
-
x,
|
|
19908
|
-
y,
|
|
19909
19850
|
width,
|
|
19910
|
-
height
|
|
19851
|
+
height,
|
|
19852
|
+
x,
|
|
19853
|
+
y
|
|
19911
19854
|
};
|
|
19912
19855
|
}
|
|
19913
19856
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
19857
|
+
let rect;
|
|
19914
19858
|
if (clippingAncestor === "viewport") {
|
|
19915
|
-
|
|
19916
|
-
}
|
|
19917
|
-
|
|
19918
|
-
|
|
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;
|
|
19919
19875
|
}
|
|
19920
|
-
return rectToClientRect(
|
|
19876
|
+
return rectToClientRect(rect);
|
|
19921
19877
|
}
|
|
19922
19878
|
function getClippingElementAncestors(element, cache) {
|
|
19923
19879
|
const cachedResult = cache.get(element);
|
|
@@ -19931,11 +19887,16 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19931
19887
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
19932
19888
|
const computedStyle = getComputedStyle$1(currentNode);
|
|
19933
19889
|
const containingBlock = isContainingBlock(currentNode);
|
|
19934
|
-
const
|
|
19935
|
-
if (
|
|
19936
|
-
|
|
19890
|
+
const shouldIgnoreCurrentNode = computedStyle.position === "fixed";
|
|
19891
|
+
if (shouldIgnoreCurrentNode) {
|
|
19892
|
+
currentContainingBlockComputedStyle = null;
|
|
19937
19893
|
} else {
|
|
19938
|
-
|
|
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
|
+
}
|
|
19939
19900
|
}
|
|
19940
19901
|
currentNode = getParentNode(currentNode);
|
|
19941
19902
|
}
|
|
@@ -19967,6 +19928,74 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19967
19928
|
y: clippingRect.top
|
|
19968
19929
|
};
|
|
19969
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
|
+
}
|
|
19970
19999
|
const platform = {
|
|
19971
20000
|
getClippingRect,
|
|
19972
20001
|
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
@@ -24850,11 +24879,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24850
24879
|
React$4.useEffect(() => {
|
|
24851
24880
|
if (!autoplay || dragging)
|
|
24852
24881
|
return;
|
|
24853
|
-
|
|
24882
|
+
let interval;
|
|
24883
|
+
function tick() {
|
|
24884
|
+
interval = window.setTimeout(tick, autoplayInterval);
|
|
24854
24885
|
swipeNext();
|
|
24855
|
-
}
|
|
24886
|
+
}
|
|
24887
|
+
interval = window.setTimeout(tick, autoplayInterval);
|
|
24856
24888
|
return () => {
|
|
24857
|
-
|
|
24889
|
+
if (interval)
|
|
24890
|
+
window.clearTimeout(interval);
|
|
24858
24891
|
};
|
|
24859
24892
|
}, [autoplay, autoplayInterval, dragging, count]);
|
|
24860
24893
|
function renderTrackInner() {
|
|
@@ -25155,6 +25188,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25155
25188
|
devError("TextArea", "`value` prop on `TextArea` should not be `null`. Consider using an empty string to clear the component.");
|
|
25156
25189
|
}
|
|
25157
25190
|
const nativeTextAreaRef = React$4.useRef(null);
|
|
25191
|
+
const heightRef = React$4.useRef("auto");
|
|
25158
25192
|
React$4.useImperativeHandle(ref, () => ({
|
|
25159
25193
|
clear: () => {
|
|
25160
25194
|
setValue2("");
|
|
@@ -25177,7 +25211,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25177
25211
|
const textArea2 = nativeTextAreaRef.current;
|
|
25178
25212
|
if (!textArea2)
|
|
25179
25213
|
return;
|
|
25180
|
-
textArea2.style.height =
|
|
25214
|
+
textArea2.style.height = heightRef.current;
|
|
25181
25215
|
let height = textArea2.scrollHeight;
|
|
25182
25216
|
if (typeof autoSize === "object") {
|
|
25183
25217
|
const computedStyle = window.getComputedStyle(textArea2);
|
|
@@ -25189,6 +25223,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
25189
25223
|
height = Math.min(height, autoSize.maxRows * lineHeight);
|
|
25190
25224
|
}
|
|
25191
25225
|
}
|
|
25226
|
+
heightRef.current = `${height}px`;
|
|
25192
25227
|
textArea2.style.height = `${height}px`;
|
|
25193
25228
|
}, [value, autoSize]);
|
|
25194
25229
|
const compositingRef = React$4.useRef(false);
|