antd-mobile 5.3.1 → 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.
- package/2x/cjs/components/cascader-view/cascader-view.d.ts +1 -0
- package/2x/cjs/components/cascader-view/use-cascader-value-extend.js +23 -0
- package/2x/cjs/components/check-list/check-list-item.js +1 -1
- package/2x/cjs/components/checkbox/checkbox.js +16 -4
- package/2x/cjs/components/floating-bubble/floating-bubble.d.ts +2 -0
- package/2x/cjs/components/floating-bubble/floating-bubble.js +56 -16
- package/2x/cjs/components/form/form-array.d.ts +19 -0
- package/2x/cjs/components/form/form-array.js +52 -0
- package/2x/cjs/components/form/form-item.css +6 -1
- package/2x/cjs/components/form/form-item.js +24 -8
- package/2x/cjs/components/form/form.css +5 -0
- package/2x/cjs/components/form/form.js +17 -6
- package/2x/cjs/components/form/index.css +11 -1
- package/2x/cjs/components/form/index.d.ts +2 -0
- package/2x/cjs/components/form/index.js +3 -0
- package/2x/cjs/components/image-uploader/image-uploader.d.ts +1 -1
- package/2x/cjs/components/image-uploader/image-uploader.js +17 -1
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +23 -19
- package/2x/cjs/components/modal/modal.js +0 -1
- package/2x/cjs/components/notice-bar/notice-bar.js +1 -1
- package/2x/cjs/components/popover/index.d.ts +7 -2
- package/2x/cjs/components/popover/normalize-placement.d.ts +2 -0
- package/2x/cjs/components/popover/normalize-placement.js +22 -0
- package/2x/cjs/components/popover/popover.css +0 -104
- package/2x/cjs/components/popover/popover.d.ts +11 -5
- package/2x/cjs/components/popover/popover.js +126 -22
- package/2x/cjs/components/popover/temp-floating-ui.min.d.ts +1 -0
- package/2x/cjs/components/popover/temp-floating-ui.min.js +430 -0
- package/2x/cjs/components/popover/wrapper.d.ts +7 -0
- package/2x/cjs/components/popover/wrapper.js +41 -0
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +24 -9
- package/2x/cjs/components/radio/radio.js +16 -4
- package/2x/cjs/components/search-bar/search-bar.js +0 -1
- package/2x/cjs/components/swiper/swiper.js +1 -1
- package/2x/cjs/components/text-area/text-area.css +4 -1
- package/2x/cjs/components/text-area/text-area.d.ts +2 -2
- package/2x/cjs/utils/use-props-value.d.ts +2 -1
- package/2x/cjs/utils/use-props-value.js +4 -2
- package/2x/es/components/cascader-view/cascader-view.d.ts +1 -0
- package/2x/es/components/cascader-view/use-cascader-value-extend.js +23 -0
- package/2x/es/components/check-list/check-list-item.js +1 -1
- package/2x/es/components/checkbox/checkbox.js +17 -5
- package/2x/es/components/floating-bubble/floating-bubble.d.ts +2 -0
- package/2x/es/components/floating-bubble/floating-bubble.js +57 -17
- package/2x/es/components/form/form-array.d.ts +19 -0
- package/2x/es/components/form/form-array.js +38 -0
- package/2x/es/components/form/form-item.css +6 -1
- package/2x/es/components/form/form-item.js +22 -8
- package/2x/es/components/form/form.css +5 -0
- package/2x/es/components/form/form.js +16 -6
- package/2x/es/components/form/index.css +11 -1
- package/2x/es/components/form/index.d.ts +2 -0
- package/2x/es/components/form/index.js +2 -0
- package/2x/es/components/image-uploader/image-uploader.d.ts +1 -1
- package/2x/es/components/image-uploader/image-uploader.js +17 -1
- package/2x/es/components/infinite-scroll/infinite-scroll.js +22 -19
- package/2x/es/components/modal/modal.js +0 -1
- package/2x/es/components/notice-bar/notice-bar.js +1 -1
- package/2x/es/components/popover/index.d.ts +7 -2
- package/2x/es/components/popover/normalize-placement.d.ts +2 -0
- package/2x/es/components/popover/normalize-placement.js +15 -0
- package/2x/es/components/popover/popover.css +0 -104
- package/2x/es/components/popover/popover.d.ts +11 -5
- package/2x/es/components/popover/popover.js +118 -22
- package/2x/es/components/popover/temp-floating-ui.min.d.ts +1 -0
- package/2x/es/components/popover/temp-floating-ui.min.js +430 -0
- package/2x/es/components/popover/wrapper.d.ts +7 -0
- package/2x/es/components/popover/wrapper.js +28 -0
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +24 -9
- package/2x/es/components/radio/radio.js +17 -5
- package/2x/es/components/search-bar/search-bar.js +0 -1
- package/2x/es/components/swiper/swiper.js +1 -1
- package/2x/es/components/text-area/text-area.css +4 -1
- package/2x/es/components/text-area/text-area.d.ts +2 -2
- package/2x/es/utils/use-props-value.d.ts +2 -1
- package/2x/es/utils/use-props-value.js +4 -2
- package/2x/package.json +2 -2
- package/cjs/components/cascader-view/cascader-view.d.ts +1 -0
- package/cjs/components/cascader-view/use-cascader-value-extend.js +23 -0
- package/cjs/components/check-list/check-list-item.js +1 -1
- package/cjs/components/checkbox/checkbox.js +16 -4
- package/cjs/components/floating-bubble/floating-bubble.d.ts +2 -0
- package/cjs/components/floating-bubble/floating-bubble.js +56 -16
- package/cjs/components/form/form-array.d.ts +19 -0
- package/cjs/components/form/form-array.js +52 -0
- package/cjs/components/form/form-item.css +5 -1
- package/cjs/components/form/form-item.js +24 -8
- package/cjs/components/form/form.css +4 -0
- package/cjs/components/form/form.js +17 -6
- package/cjs/components/form/index.css +9 -1
- package/cjs/components/form/index.d.ts +2 -0
- package/cjs/components/form/index.js +3 -0
- package/cjs/components/image-uploader/image-uploader.d.ts +1 -1
- package/cjs/components/image-uploader/image-uploader.js +17 -1
- package/cjs/components/infinite-scroll/infinite-scroll.js +23 -19
- package/cjs/components/modal/modal.js +0 -1
- package/cjs/components/notice-bar/notice-bar.js +1 -1
- package/cjs/components/popover/index.d.ts +7 -2
- package/cjs/components/popover/normalize-placement.d.ts +2 -0
- package/cjs/components/popover/normalize-placement.js +22 -0
- package/cjs/components/popover/popover.css +0 -84
- package/cjs/components/popover/popover.d.ts +11 -5
- package/cjs/components/popover/popover.js +126 -22
- package/cjs/components/popover/temp-floating-ui.min.d.ts +1 -0
- package/cjs/components/popover/temp-floating-ui.min.js +430 -0
- package/cjs/components/popover/wrapper.d.ts +7 -0
- package/cjs/components/popover/wrapper.js +41 -0
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +24 -9
- package/cjs/components/radio/radio.js +16 -4
- package/cjs/components/search-bar/search-bar.js +0 -1
- package/cjs/components/swiper/swiper.js +1 -1
- package/cjs/components/text-area/text-area.css +4 -1
- package/cjs/components/text-area/text-area.d.ts +2 -2
- package/cjs/utils/use-props-value.d.ts +2 -1
- package/cjs/utils/use-props-value.js +4 -2
- package/es/components/cascader-view/cascader-view.d.ts +1 -0
- package/es/components/cascader-view/use-cascader-value-extend.js +23 -0
- package/es/components/check-list/check-list-item.js +1 -1
- package/es/components/checkbox/checkbox.js +17 -5
- package/es/components/floating-bubble/floating-bubble.d.ts +2 -0
- package/es/components/floating-bubble/floating-bubble.js +57 -17
- package/es/components/form/form-array.d.ts +19 -0
- package/es/components/form/form-array.js +38 -0
- package/es/components/form/form-item.css +5 -1
- package/es/components/form/form-item.js +22 -8
- package/es/components/form/form.css +4 -0
- package/es/components/form/form.js +16 -6
- package/es/components/form/index.css +9 -1
- package/es/components/form/index.d.ts +2 -0
- package/es/components/form/index.js +2 -0
- package/es/components/image-uploader/image-uploader.d.ts +1 -1
- package/es/components/image-uploader/image-uploader.js +17 -1
- package/es/components/infinite-scroll/infinite-scroll.js +22 -19
- package/es/components/modal/modal.js +0 -1
- package/es/components/notice-bar/notice-bar.js +1 -1
- package/es/components/popover/index.d.ts +7 -2
- package/es/components/popover/normalize-placement.d.ts +2 -0
- package/es/components/popover/normalize-placement.js +15 -0
- package/es/components/popover/popover.css +0 -84
- package/es/components/popover/popover.d.ts +11 -5
- package/es/components/popover/popover.js +118 -22
- package/es/components/popover/temp-floating-ui.min.d.ts +1 -0
- package/es/components/popover/temp-floating-ui.min.js +430 -0
- package/es/components/popover/wrapper.d.ts +7 -0
- package/es/components/popover/wrapper.js +28 -0
- package/es/components/pull-to-refresh/pull-to-refresh.js +24 -9
- package/es/components/radio/radio.js +17 -5
- package/es/components/search-bar/search-bar.js +0 -1
- package/es/components/swiper/swiper.js +1 -1
- package/es/components/text-area/text-area.css +4 -1
- package/es/components/text-area/text-area.d.ts +2 -2
- package/es/utils/use-props-value.d.ts +2 -1
- package/es/utils/use-props-value.js +4 -2
- package/package.json +2 -2
- package/umd/antd-mobile.js +1 -1
|
@@ -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
|
+
})
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Wrapper = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactDom = require("react-dom");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
class Wrapper extends _react.default.Component {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.element = null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
componentDidMount() {
|
|
21
|
+
this.componentDidUpdate();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
componentDidUpdate() {
|
|
25
|
+
// eslint-disable-next-line
|
|
26
|
+
const node = (0, _reactDom.findDOMNode)(this);
|
|
27
|
+
|
|
28
|
+
if (node instanceof Element) {
|
|
29
|
+
this.element = node;
|
|
30
|
+
} else {
|
|
31
|
+
this.element = null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
render() {
|
|
36
|
+
return _react.default.Children.only(this.props.children);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.Wrapper = Wrapper;
|
|
@@ -126,15 +126,30 @@ const PullToRefresh = p => {
|
|
|
126
126
|
|
|
127
127
|
const [, y] = state.movement;
|
|
128
128
|
|
|
129
|
-
if (state.first) {
|
|
130
|
-
const
|
|
131
|
-
if (!
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
129
|
+
if (state.first && y > 0) {
|
|
130
|
+
const target = state.event.target;
|
|
131
|
+
if (!target || !(target instanceof Element)) return;
|
|
132
|
+
let scrollParent = (0, _getScrollParent.getScrollParent)(target);
|
|
133
|
+
|
|
134
|
+
while (true) {
|
|
135
|
+
if (!scrollParent) return;
|
|
136
|
+
const scrollTop = getScrollTop(scrollParent);
|
|
137
|
+
|
|
138
|
+
if (scrollTop > 0) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (scrollParent instanceof Window) {
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
scrollParent = (0, _getScrollParent.getScrollParent)(scrollParent.parentNode);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
pullingRef.current = true;
|
|
150
|
+
|
|
151
|
+
function getScrollTop(element) {
|
|
152
|
+
return 'scrollTop' in element ? element.scrollTop : element.scrollY;
|
|
138
153
|
}
|
|
139
154
|
}
|
|
140
155
|
|
|
@@ -87,22 +87,34 @@ const Radio = p => {
|
|
|
87
87
|
}, checked && _react.default.createElement(_checkIcon.CheckIcon, null));
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
+
const inputRef = (0, _react.useRef)(null);
|
|
91
|
+
const labelRef = (0, _react.useRef)(null);
|
|
92
|
+
(0, _react.useEffect)(() => {
|
|
93
|
+
var _a;
|
|
94
|
+
|
|
95
|
+
(_a = labelRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('click', e => {
|
|
96
|
+
if (e.target !== inputRef.current) {
|
|
97
|
+
e.stopPropagation();
|
|
98
|
+
e.stopImmediatePropagation();
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
capture: false
|
|
102
|
+
});
|
|
103
|
+
}, []);
|
|
90
104
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("label", {
|
|
105
|
+
ref: labelRef,
|
|
91
106
|
className: (0, _classnames.default)(classPrefix, {
|
|
92
107
|
[`${classPrefix}-checked`]: checked,
|
|
93
108
|
[`${classPrefix}-disabled`]: disabled,
|
|
94
109
|
[`${classPrefix}-block`]: props.block
|
|
95
110
|
})
|
|
96
111
|
}, _react.default.createElement("input", {
|
|
112
|
+
ref: inputRef,
|
|
97
113
|
type: 'radio',
|
|
98
114
|
checked: checked,
|
|
99
115
|
onChange: e => {
|
|
100
116
|
setChecked(e.target.checked);
|
|
101
117
|
},
|
|
102
|
-
onClick: e => {
|
|
103
|
-
e.stopPropagation();
|
|
104
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
105
|
-
},
|
|
106
118
|
disabled: disabled,
|
|
107
119
|
id: props.id
|
|
108
120
|
}), renderIcon(), props.children && _react.default.createElement("div", {
|
|
@@ -67,7 +67,6 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
67
67
|
|
|
68
68
|
const renderCancelButton = () => {
|
|
69
69
|
let isShowCancel = false;
|
|
70
|
-
const showCancelButton = props.showCancelButton;
|
|
71
70
|
|
|
72
71
|
if (typeof props.showCancelButton === 'function') {
|
|
73
72
|
isShowCancel = props.showCancelButton(hasFocus, value);
|
|
@@ -258,7 +258,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
258
258
|
style: {
|
|
259
259
|
[isVertical ? 'y' : 'x']: position.to(position => `${-position}%`)
|
|
260
260
|
}
|
|
261
|
-
}, _react.default.Children.map(validChildren,
|
|
261
|
+
}, _react.default.Children.map(validChildren, child => {
|
|
262
262
|
return _react.default.createElement("div", {
|
|
263
263
|
className: 'adm-swiper-slide'
|
|
264
264
|
}, child);
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
--color: var(--adm-color-text);
|
|
4
4
|
--placeholder-color: var(--adm-color-light);
|
|
5
5
|
--disabled-color: var(--adm-color-weak);
|
|
6
|
+
--text-align: left;
|
|
7
|
+
--count-text-align: right;
|
|
6
8
|
width: 100%;
|
|
7
9
|
max-width: 100%;
|
|
8
10
|
max-height: 100%;
|
|
@@ -27,6 +29,7 @@
|
|
|
27
29
|
outline: none;
|
|
28
30
|
appearance: none;
|
|
29
31
|
min-height: 1.5em;
|
|
32
|
+
text-align: var(--text-align);
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
.adm-text-area-element::placeholder {
|
|
@@ -62,7 +65,7 @@
|
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
.adm-text-area-count {
|
|
65
|
-
text-align:
|
|
68
|
+
text-align: var(--count-text-align);
|
|
66
69
|
color: var(--adm-color-weak);
|
|
67
70
|
font-size: 34px;
|
|
68
71
|
padding-top: 16px;
|
|
@@ -14,7 +14,7 @@ export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaH
|
|
|
14
14
|
maxRows?: number;
|
|
15
15
|
};
|
|
16
16
|
id?: string;
|
|
17
|
-
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--disabled-color'>;
|
|
17
|
+
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--disabled-color' | '--text-align' | '--count-text-align'>;
|
|
18
18
|
export declare type TextAreaRef = {
|
|
19
19
|
clear: () => void;
|
|
20
20
|
focus: () => void;
|
|
@@ -33,4 +33,4 @@ export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.Detail
|
|
|
33
33
|
maxRows?: number | undefined;
|
|
34
34
|
} | undefined;
|
|
35
35
|
id?: string | undefined;
|
|
36
|
-
} & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--disabled-color"> & React.RefAttributes<TextAreaRef>>;
|
|
36
|
+
} & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--count-text-align"> & React.RefAttributes<TextAreaRef>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { SetStateAction } from 'react';
|
|
1
2
|
declare type Options<T> = {
|
|
2
3
|
value?: T;
|
|
3
4
|
defaultValue: T;
|
|
4
5
|
onChange?: (v: T) => void;
|
|
5
6
|
};
|
|
6
|
-
export declare function usePropsValue<T>(options: Options<T>): readonly [T, (this: unknown, v: T) => void];
|
|
7
|
+
export declare function usePropsValue<T>(options: Options<T>): readonly [T, (this: unknown, v: SetStateAction<T>) => void];
|
|
7
8
|
export {};
|
|
@@ -23,12 +23,14 @@ function usePropsValue(options) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const setState = (0, _ahooks.useMemoizedFn)(v => {
|
|
26
|
+
const nextValue = typeof v === 'function' ? v(stateRef.current) : v;
|
|
27
|
+
|
|
26
28
|
if (value === undefined) {
|
|
27
|
-
stateRef.current =
|
|
29
|
+
stateRef.current = nextValue;
|
|
28
30
|
update();
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(
|
|
33
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);
|
|
32
34
|
});
|
|
33
35
|
return [stateRef.current, setState];
|
|
34
36
|
}
|
|
@@ -21,11 +21,34 @@ export function useCascaderValueExtend(options) {
|
|
|
21
21
|
return ret;
|
|
22
22
|
}, val => JSON.stringify(val));
|
|
23
23
|
}, [options]);
|
|
24
|
+
const generateIsLeaf = useMemo(() => {
|
|
25
|
+
return memoize(val => {
|
|
26
|
+
var _a;
|
|
27
|
+
|
|
28
|
+
let isLeaf = false;
|
|
29
|
+
|
|
30
|
+
for (const v of val) {
|
|
31
|
+
const target = options.find(option => option.value === v);
|
|
32
|
+
|
|
33
|
+
if (!target) {
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
isLeaf = ((_a = target.children) === null || _a === void 0 ? void 0 : _a.length) === val.length;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return isLeaf;
|
|
41
|
+
}, val => JSON.stringify(val));
|
|
42
|
+
}, [options]);
|
|
24
43
|
|
|
25
44
|
function generateValueExtend(val) {
|
|
26
45
|
return {
|
|
27
46
|
get items() {
|
|
28
47
|
return generateItems(val);
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
get isLeaf() {
|
|
51
|
+
return generateIsLeaf(val);
|
|
29
52
|
}
|
|
30
53
|
|
|
31
54
|
};
|