antd-mobile 5.5.0 → 5.5.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.
@@ -23,7 +23,7 @@ var _arrow = require("./arrow");
23
23
 
24
24
  var _renderToContainer = require("../../utils/render-to-container");
25
25
 
26
- var _dom = require("@floating-ui/dom");
26
+ var _tempFloatingUiMin = require("./temp-floating-ui.min.js");
27
27
 
28
28
  var _wrapper = require("./wrapper");
29
29
 
@@ -98,13 +98,13 @@ const Popover = (0, _react.forwardRef)((p, ref) => {
98
98
  y,
99
99
  placement: realPlacement,
100
100
  middlewareData
101
- } = yield (0, _dom.computePosition)(target, floating, {
101
+ } = yield (0, _tempFloatingUiMin.computePosition)(target, floating, {
102
102
  placement,
103
- middleware: [(0, _dom.offset)((0, _convertPx.convertPx)(12)), (0, _dom.shift)({
103
+ middleware: [(0, _tempFloatingUiMin.offset)((0, _convertPx.convertPx)(12)), (0, _tempFloatingUiMin.shift)({
104
104
  padding: (0, _convertPx.convertPx)(4),
105
105
  crossAxis: false,
106
- limiter: (0, _dom.limitShift)()
107
- }), (0, _dom.flip)(), (0, _dom.hide)(), (0, _dom.arrow)({
106
+ limiter: (0, _tempFloatingUiMin.limitShift)()
107
+ }), (0, _tempFloatingUiMin.flip)(), (0, _tempFloatingUiMin.hide)(), (0, _tempFloatingUiMin.arrow)({
108
108
  element: arrowElement,
109
109
  padding: (0, _convertPx.convertPx)(12)
110
110
  })]
@@ -160,7 +160,7 @@ const Popover = (0, _react.forwardRef)((p, ref) => {
160
160
  (0, _react.useEffect)(() => {
161
161
  const floatingElement = floatingRef.current;
162
162
  if (!targetElement || !floatingElement) return;
163
- return (0, _dom.autoUpdate)(targetElement, floatingElement, update);
163
+ return (0, _tempFloatingUiMin.autoUpdate)(targetElement, floatingElement, update);
164
164
  }, [targetElement]);
165
165
  (0, _ahooks.useClickAway)(() => {
166
166
  if (!props.trigger) return;
@@ -0,0 +1 @@
1
+ export * from '@floating-ui/dom'
@@ -0,0 +1,430 @@
1
+ !(function (t, e) {
2
+ 'object' == typeof exports && 'undefined' != typeof module
3
+ ? e(exports, require('@floating-ui/core'))
4
+ : 'function' == typeof define && define.amd
5
+ ? define(['exports', '@floating-ui/core'], e)
6
+ : e(
7
+ ((t =
8
+ 'undefined' != typeof globalThis
9
+ ? globalThis
10
+ : t || self).FloatingUIDOM = {}),
11
+ t.FloatingUICore
12
+ )
13
+ })(this, function (t, e) {
14
+ 'use strict'
15
+ function n(t) {
16
+ return '[object Window]' === (null == t ? void 0 : t.toString())
17
+ }
18
+ function o(t) {
19
+ if (null == t) return window
20
+ if (!n(t)) {
21
+ const e = t.ownerDocument
22
+ return (e && e.defaultView) || window
23
+ }
24
+ return t
25
+ }
26
+ function i(t) {
27
+ return o(t).getComputedStyle(t)
28
+ }
29
+ function r(t) {
30
+ return n(t) ? '' : t ? (t.nodeName || '').toLowerCase() : ''
31
+ }
32
+ function l(t) {
33
+ return t instanceof o(t).HTMLElement
34
+ }
35
+ function c(t) {
36
+ return t instanceof o(t).Element
37
+ }
38
+ function f(t) {
39
+ return t instanceof o(t).ShadowRoot || t instanceof ShadowRoot
40
+ }
41
+ function u(t) {
42
+ const { overflow: e, overflowX: n, overflowY: o } = i(t)
43
+ return /auto|scroll|overlay|hidden/.test(e + o + n)
44
+ }
45
+ function s(t) {
46
+ return ['table', 'td', 'th'].includes(r(t))
47
+ }
48
+ function d(t) {
49
+ const e = navigator.userAgent.toLowerCase().includes('firefox'),
50
+ n = i(t)
51
+ return (
52
+ 'none' !== n.transform ||
53
+ 'none' !== n.perspective ||
54
+ 'paint' === n.contain ||
55
+ ['transform', 'perspective'].includes(n.willChange) ||
56
+ (e && 'filter' === n.willChange) ||
57
+ (e && !!n.filter && 'none' !== n.filter)
58
+ )
59
+ }
60
+ const h = Math.min,
61
+ a = Math.max,
62
+ g = Math.round
63
+ function p(t, e) {
64
+ void 0 === e && (e = !1)
65
+ const n = t.getBoundingClientRect()
66
+ let o = 1,
67
+ i = 1
68
+ return (
69
+ e &&
70
+ l(t) &&
71
+ ((o = (t.offsetWidth > 0 && g(n.width) / t.offsetWidth) || 1),
72
+ (i = (t.offsetHeight > 0 && g(n.height) / t.offsetHeight) || 1)),
73
+ {
74
+ width: n.width / o,
75
+ height: n.height / i,
76
+ top: n.top / i,
77
+ right: n.right / o,
78
+ bottom: n.bottom / i,
79
+ left: n.left / o,
80
+ x: n.left / o,
81
+ y: n.top / i,
82
+ }
83
+ )
84
+ }
85
+ function m(t) {
86
+ return ((e = t),
87
+ (e instanceof o(e).Node ? t.ownerDocument : t.document) ||
88
+ window.document).documentElement
89
+ var e
90
+ }
91
+ function y(t) {
92
+ return n(t)
93
+ ? { scrollLeft: t.pageXOffset, scrollTop: t.pageYOffset }
94
+ : { scrollLeft: t.scrollLeft, scrollTop: t.scrollTop }
95
+ }
96
+ function w(t) {
97
+ return p(m(t)).left + y(t).scrollLeft
98
+ }
99
+ function b(t, e, n) {
100
+ const o = l(e),
101
+ i = m(e),
102
+ c = p(
103
+ t,
104
+ o &&
105
+ (function (t) {
106
+ const e = p(t)
107
+ return (
108
+ g(e.width) !== t.offsetWidth || g(e.height) !== t.offsetHeight
109
+ )
110
+ })(e)
111
+ )
112
+ let f = { scrollLeft: 0, scrollTop: 0 }
113
+ const s = { x: 0, y: 0 }
114
+ if (o || (!o && 'fixed' !== n))
115
+ if ((('body' !== r(e) || u(i)) && (f = y(e)), l(e))) {
116
+ const t = p(e, !0)
117
+ ;(s.x = t.x + e.clientLeft), (s.y = t.y + e.clientTop)
118
+ } else i && (s.x = w(i))
119
+ return {
120
+ x: c.left + f.scrollLeft - s.x,
121
+ y: c.top + f.scrollTop - s.y,
122
+ width: c.width,
123
+ height: c.height,
124
+ }
125
+ }
126
+ function v(t) {
127
+ return 'html' === r(t)
128
+ ? t
129
+ : t.assignedSlot || t.parentNode || (f(t) ? t.host : null) || m(t)
130
+ }
131
+ function x(t) {
132
+ return l(t) && 'fixed' !== getComputedStyle(t).position
133
+ ? t.offsetParent
134
+ : null
135
+ }
136
+ function L(t) {
137
+ const e = o(t)
138
+ let n = x(t)
139
+ for (; n && s(n) && 'static' === getComputedStyle(n).position; ) n = x(n)
140
+ return n &&
141
+ ('html' === r(n) ||
142
+ ('body' === r(n) && 'static' === getComputedStyle(n).position && !d(n)))
143
+ ? e
144
+ : n ||
145
+ (function (t) {
146
+ let e = v(t)
147
+ for (
148
+ f(e) && (e = e.host);
149
+ l(e) && !['html', 'body'].includes(r(e));
150
+
151
+ ) {
152
+ if (d(e)) return e
153
+ e = e.parentNode
154
+ }
155
+ return null
156
+ })(t) ||
157
+ e
158
+ }
159
+ function O(t) {
160
+ if (l(t)) return { width: t.offsetWidth, height: t.offsetHeight }
161
+ const e = p(t)
162
+ return { width: e.width, height: e.height }
163
+ }
164
+ function P(t) {
165
+ const e = v(t)
166
+ return ['html', 'body', '#document'].includes(r(e))
167
+ ? t.ownerDocument.body
168
+ : l(e) && u(e)
169
+ ? e
170
+ : P(e)
171
+ }
172
+ function R(t, e) {
173
+ var n
174
+ void 0 === e && (e = [])
175
+ const i = P(t),
176
+ r = i === (null == (n = t.ownerDocument) ? void 0 : n.body),
177
+ l = o(i),
178
+ c = r ? [l].concat(l.visualViewport || [], u(i) ? i : []) : i,
179
+ f = e.concat(c)
180
+ return r ? f : f.concat(R(v(c)))
181
+ }
182
+ function T(t, n) {
183
+ return 'viewport' === n
184
+ ? e.rectToClientRect(
185
+ (function (t) {
186
+ const e = o(t),
187
+ n = m(t),
188
+ i = e.visualViewport
189
+ let r = n.clientWidth,
190
+ l = n.clientHeight,
191
+ c = 0,
192
+ f = 0
193
+ return (
194
+ i &&
195
+ ((r = i.width),
196
+ (l = i.height),
197
+ Math.abs(e.innerWidth / i.scale - i.width) < 0.01 &&
198
+ ((c = i.offsetLeft), (f = i.offsetTop))),
199
+ { width: r, height: l, x: c, y: f }
200
+ )
201
+ })(t)
202
+ )
203
+ : c(n)
204
+ ? (function (t) {
205
+ const e = p(t),
206
+ n = e.top + t.clientTop,
207
+ o = e.left + t.clientLeft
208
+ return {
209
+ top: n,
210
+ left: o,
211
+ x: o,
212
+ y: n,
213
+ right: o + t.clientWidth,
214
+ bottom: n + t.clientHeight,
215
+ width: t.clientWidth,
216
+ height: t.clientHeight,
217
+ }
218
+ })(n)
219
+ : e.rectToClientRect(
220
+ (function (t) {
221
+ var e
222
+ const n = m(t),
223
+ o = y(t),
224
+ r = null == (e = t.ownerDocument) ? void 0 : e.body,
225
+ l = a(
226
+ n.scrollWidth,
227
+ n.clientWidth,
228
+ r ? r.scrollWidth : 0,
229
+ r ? r.clientWidth : 0
230
+ ),
231
+ c = a(
232
+ n.scrollHeight,
233
+ n.clientHeight,
234
+ r ? r.scrollHeight : 0,
235
+ r ? r.clientHeight : 0
236
+ )
237
+ let f = -o.scrollLeft + w(t)
238
+ const u = -o.scrollTop
239
+ return (
240
+ 'rtl' === i(r || n).direction &&
241
+ (f += a(n.clientWidth, r ? r.clientWidth : 0) - l),
242
+ { width: l, height: c, x: f, y: u }
243
+ )
244
+ })(m(t))
245
+ )
246
+ }
247
+ function C(t) {
248
+ const e = R(t),
249
+ n = ['absolute', 'fixed'].includes(i(t).position) && l(t) ? L(t) : t
250
+ return c(n)
251
+ ? e.filter(
252
+ t =>
253
+ c(t) &&
254
+ (function (t, e) {
255
+ const n = null == e.getRootNode ? void 0 : e.getRootNode()
256
+ if (t.contains(e)) return !0
257
+ if (n && f(n)) {
258
+ let n = e
259
+ do {
260
+ if (n && t === n) return !0
261
+ n = n.parentNode || n.host
262
+ } while (n)
263
+ }
264
+ return !1
265
+ })(t, n) &&
266
+ 'body' !== r(t)
267
+ )
268
+ : []
269
+ }
270
+ const W = {
271
+ getClippingRect: function (t) {
272
+ let { element: e, boundary: n, rootBoundary: o } = t
273
+ const i = [...('clippingAncestors' === n ? C(e) : [].concat(n)), o],
274
+ r = i[0],
275
+ l = i.reduce((t, n) => {
276
+ const o = T(e, n)
277
+ return (
278
+ (t.top = a(o.top, t.top)),
279
+ (t.right = h(o.right, t.right)),
280
+ (t.bottom = h(o.bottom, t.bottom)),
281
+ (t.left = a(o.left, t.left)),
282
+ t
283
+ )
284
+ }, T(e, r))
285
+ return {
286
+ width: l.right - l.left,
287
+ height: l.bottom - l.top,
288
+ x: l.left,
289
+ y: l.top,
290
+ }
291
+ },
292
+ convertOffsetParentRelativeRectToViewportRelativeRect: function (t) {
293
+ let { rect: e, offsetParent: n, strategy: o } = t
294
+ const i = l(n),
295
+ c = m(n)
296
+ if (n === c) return e
297
+ let f = { scrollLeft: 0, scrollTop: 0 }
298
+ const s = { x: 0, y: 0 }
299
+ if (
300
+ (i || (!i && 'fixed' !== o)) &&
301
+ (('body' !== r(n) || u(c)) && (f = y(n)), l(n))
302
+ ) {
303
+ const t = p(n, !0)
304
+ ;(s.x = t.x + n.clientLeft), (s.y = t.y + n.clientTop)
305
+ }
306
+ return { ...e, x: e.x - f.scrollLeft + s.x, y: e.y - f.scrollTop + s.y }
307
+ },
308
+ isElement: c,
309
+ getDimensions: O,
310
+ getOffsetParent: L,
311
+ getDocumentElement: m,
312
+ getElementRects: t => {
313
+ let { reference: e, floating: n, strategy: o } = t
314
+ return { reference: b(e, L(n), o), floating: { ...O(n), x: 0, y: 0 } }
315
+ },
316
+ getClientRects: t => Array.from(t.getClientRects()),
317
+ isRTL: t => 'rtl' === i(t).direction,
318
+ }
319
+ Object.defineProperty(t, 'arrow', {
320
+ enumerable: !0,
321
+ get: function () {
322
+ return e.arrow
323
+ },
324
+ }),
325
+ Object.defineProperty(t, 'autoPlacement', {
326
+ enumerable: !0,
327
+ get: function () {
328
+ return e.autoPlacement
329
+ },
330
+ }),
331
+ Object.defineProperty(t, 'detectOverflow', {
332
+ enumerable: !0,
333
+ get: function () {
334
+ return e.detectOverflow
335
+ },
336
+ }),
337
+ Object.defineProperty(t, 'flip', {
338
+ enumerable: !0,
339
+ get: function () {
340
+ return e.flip
341
+ },
342
+ }),
343
+ Object.defineProperty(t, 'hide', {
344
+ enumerable: !0,
345
+ get: function () {
346
+ return e.hide
347
+ },
348
+ }),
349
+ Object.defineProperty(t, 'inline', {
350
+ enumerable: !0,
351
+ get: function () {
352
+ return e.inline
353
+ },
354
+ }),
355
+ Object.defineProperty(t, 'limitShift', {
356
+ enumerable: !0,
357
+ get: function () {
358
+ return e.limitShift
359
+ },
360
+ }),
361
+ Object.defineProperty(t, 'offset', {
362
+ enumerable: !0,
363
+ get: function () {
364
+ return e.offset
365
+ },
366
+ }),
367
+ Object.defineProperty(t, 'shift', {
368
+ enumerable: !0,
369
+ get: function () {
370
+ return e.shift
371
+ },
372
+ }),
373
+ Object.defineProperty(t, 'size', {
374
+ enumerable: !0,
375
+ get: function () {
376
+ return e.size
377
+ },
378
+ }),
379
+ (t.autoUpdate = function (t, e, n, o) {
380
+ void 0 === o && (o = {})
381
+ const {
382
+ ancestorScroll: i = !0,
383
+ ancestorResize: r = !0,
384
+ elementResize: l = !0,
385
+ animationFrame: f = !1,
386
+ } = o
387
+ let u = !1
388
+ const s = i && !f,
389
+ d = r && !f,
390
+ h = l && !f,
391
+ a = s || d ? [...(c(t) ? R(t) : []), ...R(e)] : []
392
+ a.forEach(t => {
393
+ s && t.addEventListener('scroll', n, { passive: !0 }),
394
+ d && t.addEventListener('resize', n)
395
+ })
396
+ let g,
397
+ m = null
398
+ h && ((m = new ResizeObserver(n)), c(t) && m.observe(t), m.observe(e))
399
+ let y = f ? p(t) : null
400
+ return (
401
+ f &&
402
+ (function e() {
403
+ if (u) return
404
+ const o = p(t)
405
+ !y ||
406
+ (o.x === y.x &&
407
+ o.y === y.y &&
408
+ o.width === y.width &&
409
+ o.height === y.height) ||
410
+ n()
411
+ ;(y = o), (g = requestAnimationFrame(e))
412
+ })(),
413
+ () => {
414
+ var t
415
+ ;(u = !0),
416
+ a.forEach(t => {
417
+ s && t.removeEventListener('scroll', n),
418
+ d && t.removeEventListener('resize', n)
419
+ }),
420
+ null == (t = m) || t.disconnect(),
421
+ (m = null),
422
+ f && cancelAnimationFrame(g)
423
+ }
424
+ )
425
+ }),
426
+ (t.computePosition = (t, n, o) =>
427
+ e.computePosition(t, n, { platform: W, ...o })),
428
+ (t.getOverflowAncestors = R),
429
+ Object.defineProperty(t, '__esModule', { value: !0 })
430
+ })
@@ -7,7 +7,7 @@ import { withNativeProps } from '../../utils/native-props';
7
7
  import { withStopPropagation } from '../../utils/with-stop-propagation';
8
8
  import { Arrow } from './arrow';
9
9
  import { renderToContainer } from '../../utils/render-to-container';
10
- import { arrow, computePosition, flip, offset, autoUpdate, hide, shift, limitShift } from '@floating-ui/dom';
10
+ import { arrow, computePosition, flip, offset, autoUpdate, hide, shift, limitShift } from './temp-floating-ui.min.js';
11
11
  import { Wrapper } from './wrapper';
12
12
  import { useShouldRender } from '../../utils/should-render';
13
13
  import { useClickAway, useIsomorphicLayoutEffect } from 'ahooks';
@@ -0,0 +1 @@
1
+ export * from '@floating-ui/dom'