antd-mobile 5.28.2 → 5.29.0
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 +405 -195
- package/2x/bundle/antd-mobile.cjs.js +9 -9
- package/2x/bundle/antd-mobile.es.development.js +405 -195
- package/2x/bundle/antd-mobile.es.js +4901 -4675
- package/2x/bundle/antd-mobile.umd.development.js +405 -195
- package/2x/bundle/antd-mobile.umd.js +9 -9
- package/2x/bundle/style.css +36 -33
- package/2x/cjs/components/action-sheet/action-sheet.css +1 -1
- package/2x/cjs/components/action-sheet/action-sheet.js +6 -2
- package/2x/cjs/components/avatar/avatar.d.ts +1 -1
- package/2x/cjs/components/avatar/avatar.js +2 -1
- package/2x/cjs/components/badge/badge.css +2 -2
- package/2x/cjs/components/button/button.css +2 -2
- package/2x/cjs/components/capsule-tabs/capsule-tabs.css +2 -2
- package/2x/cjs/components/check-list/check-list-item.js +3 -1
- package/2x/cjs/components/check-list/check-list.d.ts +1 -0
- package/2x/cjs/components/check-list/check-list.js +2 -0
- package/2x/cjs/components/check-list/context.d.ts +1 -0
- package/2x/cjs/components/checkbox/checkbox.css +2 -2
- package/2x/cjs/components/ellipsis/ellipsis.js +1 -1
- package/2x/cjs/components/image/image.css +1 -1
- package/2x/cjs/components/index-bar/index-bar.css +4 -4
- package/2x/cjs/components/input/input.d.ts +1 -1
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.css +2 -2
- package/2x/cjs/components/notice-bar/notice-bar.css +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.js +10 -6
- package/2x/cjs/components/popover/index.d.ts +1 -1
- package/2x/cjs/components/popover/popover.css +1 -1
- package/2x/cjs/components/popover/popover.d.ts +2 -2
- package/2x/cjs/components/popover/popover.js +1 -1
- package/2x/cjs/components/radio/radio.css +2 -2
- package/2x/cjs/components/search-bar/search-bar.css +1 -1
- package/2x/cjs/components/selector/selector.css +1 -1
- package/2x/cjs/components/selector/selector.js +10 -2
- package/2x/cjs/components/side-bar/side-bar.css +1 -1
- package/2x/cjs/components/slider/slider.css +3 -3
- package/2x/cjs/components/stepper/stepper.css +2 -2
- package/2x/cjs/components/swipe-action/swipe-action.css +1 -1
- package/2x/cjs/components/switch/switch.css +2 -2
- package/2x/cjs/components/tabs/tabs.js +5 -2
- package/2x/cjs/components/text-area/text-area.d.ts +1 -1
- package/2x/cjs/components/virtual-input/virtual-input.js +12 -2
- package/2x/cjs/global/global.css +5 -2
- package/2x/cjs/global/theme-default.css +5 -2
- package/2x/cjs/locales/base.d.ts +3 -0
- package/2x/cjs/locales/base.js +3 -0
- package/2x/cjs/locales/en-US.d.ts +3 -0
- package/2x/cjs/locales/es-ES.d.ts +3 -0
- package/2x/cjs/locales/fa-IR.d.ts +3 -0
- package/2x/cjs/locales/fr-FR.d.ts +3 -0
- package/2x/cjs/locales/id-ID.d.ts +3 -0
- package/2x/cjs/locales/ja-JP.d.ts +3 -0
- package/2x/cjs/locales/kk-KZ.d.ts +3 -0
- package/2x/cjs/locales/ko-KR.d.ts +3 -0
- package/2x/cjs/locales/zh-CN.d.ts +3 -0
- package/2x/cjs/locales/zh-CN.js +3 -0
- package/2x/cjs/locales/zh-HK.d.ts +3 -0
- package/2x/cjs/locales/zh-TW.d.ts +3 -0
- package/2x/es/components/action-sheet/action-sheet.css +1 -1
- package/2x/es/components/action-sheet/action-sheet.js +6 -2
- package/2x/es/components/avatar/avatar.d.ts +1 -1
- package/2x/es/components/avatar/avatar.js +2 -1
- package/2x/es/components/badge/badge.css +2 -2
- package/2x/es/components/button/button.css +2 -2
- package/2x/es/components/capsule-tabs/capsule-tabs.css +2 -2
- package/2x/es/components/check-list/check-list-item.js +3 -1
- package/2x/es/components/check-list/check-list.d.ts +1 -0
- package/2x/es/components/check-list/check-list.js +2 -0
- package/2x/es/components/check-list/context.d.ts +1 -0
- package/2x/es/components/checkbox/checkbox.css +2 -2
- package/2x/es/components/ellipsis/ellipsis.js +1 -1
- package/2x/es/components/image/image.css +1 -1
- package/2x/es/components/index-bar/index-bar.css +4 -4
- package/2x/es/components/input/input.d.ts +1 -1
- package/2x/es/components/jumbo-tabs/jumbo-tabs.css +2 -2
- package/2x/es/components/notice-bar/notice-bar.css +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.js +10 -6
- package/2x/es/components/popover/index.d.ts +1 -1
- package/2x/es/components/popover/popover.css +1 -1
- package/2x/es/components/popover/popover.d.ts +2 -2
- package/2x/es/components/popover/popover.js +1 -1
- package/2x/es/components/radio/radio.css +2 -2
- package/2x/es/components/search-bar/search-bar.css +1 -1
- package/2x/es/components/selector/selector.css +1 -1
- package/2x/es/components/selector/selector.js +10 -2
- package/2x/es/components/side-bar/side-bar.css +1 -1
- package/2x/es/components/slider/slider.css +3 -3
- package/2x/es/components/stepper/stepper.css +2 -2
- package/2x/es/components/swipe-action/swipe-action.css +1 -1
- package/2x/es/components/switch/switch.css +2 -2
- package/2x/es/components/tabs/tabs.js +5 -2
- package/2x/es/components/text-area/text-area.d.ts +1 -1
- package/2x/es/components/virtual-input/virtual-input.js +12 -2
- package/2x/es/global/global.css +5 -2
- package/2x/es/global/theme-default.css +5 -2
- package/2x/es/locales/base.d.ts +3 -0
- package/2x/es/locales/base.js +3 -0
- package/2x/es/locales/en-US.d.ts +3 -0
- package/2x/es/locales/es-ES.d.ts +3 -0
- package/2x/es/locales/fa-IR.d.ts +3 -0
- package/2x/es/locales/fr-FR.d.ts +3 -0
- package/2x/es/locales/id-ID.d.ts +3 -0
- package/2x/es/locales/ja-JP.d.ts +3 -0
- package/2x/es/locales/kk-KZ.d.ts +3 -0
- package/2x/es/locales/ko-KR.d.ts +3 -0
- package/2x/es/locales/zh-CN.d.ts +3 -0
- package/2x/es/locales/zh-CN.js +3 -0
- package/2x/es/locales/zh-HK.d.ts +3 -0
- package/2x/es/locales/zh-TW.d.ts +3 -0
- package/2x/package.json +1 -1
- package/bundle/antd-mobile.cjs.development.js +405 -195
- package/bundle/antd-mobile.cjs.js +9 -9
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +405 -195
- package/bundle/antd-mobile.es.js +4901 -4675
- package/bundle/antd-mobile.umd.development.js +405 -195
- package/bundle/antd-mobile.umd.js +9 -9
- package/bundle/style.css +1 -1
- package/cjs/components/action-sheet/action-sheet.css +1 -1
- package/cjs/components/action-sheet/action-sheet.js +6 -2
- package/cjs/components/avatar/avatar.d.ts +1 -1
- package/cjs/components/avatar/avatar.js +2 -1
- package/cjs/components/badge/badge.css +2 -2
- package/cjs/components/button/button.css +2 -2
- package/cjs/components/capsule-tabs/capsule-tabs.css +2 -2
- package/cjs/components/check-list/check-list-item.js +3 -1
- package/cjs/components/check-list/check-list.d.ts +1 -0
- package/cjs/components/check-list/check-list.js +2 -0
- package/cjs/components/check-list/context.d.ts +1 -0
- package/cjs/components/checkbox/checkbox.css +2 -2
- package/cjs/components/ellipsis/ellipsis.js +1 -1
- package/cjs/components/image/image.css +1 -1
- package/cjs/components/index-bar/index-bar.css +4 -4
- package/cjs/components/input/input.d.ts +1 -1
- package/cjs/components/jumbo-tabs/jumbo-tabs.css +2 -2
- package/cjs/components/notice-bar/notice-bar.css +1 -1
- package/cjs/components/number-keyboard/number-keyboard.js +10 -6
- package/cjs/components/popover/index.d.ts +1 -1
- package/cjs/components/popover/popover.css +1 -1
- package/cjs/components/popover/popover.d.ts +2 -2
- package/cjs/components/popover/popover.js +1 -1
- package/cjs/components/radio/radio.css +2 -2
- package/cjs/components/search-bar/search-bar.css +1 -1
- package/cjs/components/selector/selector.css +1 -1
- package/cjs/components/selector/selector.js +10 -2
- package/cjs/components/side-bar/side-bar.css +1 -1
- package/cjs/components/slider/slider.css +3 -3
- package/cjs/components/stepper/stepper.css +2 -2
- package/cjs/components/swipe-action/swipe-action.css +1 -1
- package/cjs/components/switch/switch.css +2 -2
- package/cjs/components/tabs/tabs.js +5 -2
- package/cjs/components/text-area/text-area.d.ts +1 -1
- package/cjs/components/virtual-input/virtual-input.js +12 -2
- package/cjs/global/global.css +5 -2
- package/cjs/global/theme-default.css +5 -2
- package/cjs/locales/base.d.ts +3 -0
- package/cjs/locales/base.js +3 -0
- package/cjs/locales/en-US.d.ts +3 -0
- package/cjs/locales/es-ES.d.ts +3 -0
- package/cjs/locales/fa-IR.d.ts +3 -0
- package/cjs/locales/fr-FR.d.ts +3 -0
- package/cjs/locales/id-ID.d.ts +3 -0
- package/cjs/locales/ja-JP.d.ts +3 -0
- package/cjs/locales/kk-KZ.d.ts +3 -0
- package/cjs/locales/ko-KR.d.ts +3 -0
- package/cjs/locales/zh-CN.d.ts +3 -0
- package/cjs/locales/zh-CN.js +3 -0
- package/cjs/locales/zh-HK.d.ts +3 -0
- package/cjs/locales/zh-TW.d.ts +3 -0
- package/es/components/action-sheet/action-sheet.css +1 -1
- package/es/components/action-sheet/action-sheet.js +6 -2
- package/es/components/avatar/avatar.d.ts +1 -1
- package/es/components/avatar/avatar.js +2 -1
- package/es/components/badge/badge.css +2 -2
- package/es/components/button/button.css +2 -2
- package/es/components/capsule-tabs/capsule-tabs.css +2 -2
- package/es/components/check-list/check-list-item.js +3 -1
- package/es/components/check-list/check-list.d.ts +1 -0
- package/es/components/check-list/check-list.js +2 -0
- package/es/components/check-list/context.d.ts +1 -0
- package/es/components/checkbox/checkbox.css +2 -2
- package/es/components/ellipsis/ellipsis.js +1 -1
- package/es/components/image/image.css +1 -1
- package/es/components/index-bar/index-bar.css +4 -4
- package/es/components/input/input.d.ts +1 -1
- package/es/components/jumbo-tabs/jumbo-tabs.css +2 -2
- package/es/components/notice-bar/notice-bar.css +1 -1
- package/es/components/number-keyboard/number-keyboard.js +10 -6
- package/es/components/popover/index.d.ts +1 -1
- package/es/components/popover/popover.css +1 -1
- package/es/components/popover/popover.d.ts +2 -2
- package/es/components/popover/popover.js +1 -1
- package/es/components/radio/radio.css +2 -2
- package/es/components/search-bar/search-bar.css +1 -1
- package/es/components/selector/selector.css +1 -1
- package/es/components/selector/selector.js +10 -2
- package/es/components/side-bar/side-bar.css +1 -1
- package/es/components/slider/slider.css +3 -3
- package/es/components/stepper/stepper.css +2 -2
- package/es/components/swipe-action/swipe-action.css +1 -1
- package/es/components/switch/switch.css +2 -2
- package/es/components/tabs/tabs.js +5 -2
- package/es/components/text-area/text-area.d.ts +1 -1
- package/es/components/virtual-input/virtual-input.js +12 -2
- package/es/global/global.css +5 -2
- package/es/global/theme-default.css +5 -2
- package/es/locales/base.d.ts +3 -0
- package/es/locales/base.js +3 -0
- package/es/locales/en-US.d.ts +3 -0
- package/es/locales/es-ES.d.ts +3 -0
- package/es/locales/fa-IR.d.ts +3 -0
- package/es/locales/fr-FR.d.ts +3 -0
- package/es/locales/id-ID.d.ts +3 -0
- package/es/locales/ja-JP.d.ts +3 -0
- package/es/locales/kk-KZ.d.ts +3 -0
- package/es/locales/ko-KR.d.ts +3 -0
- package/es/locales/zh-CN.d.ts +3 -0
- package/es/locales/zh-CN.js +3 -0
- package/es/locales/zh-HK.d.ts +3 -0
- package/es/locales/zh-TW.d.ts +3 -0
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -30,6 +30,18 @@ if (canUseDom$2) {
|
|
|
30
30
|
document.addEventListener("touchstart", () => {
|
|
31
31
|
}, true);
|
|
32
32
|
}
|
|
33
|
+
var __assign = function() {
|
|
34
|
+
__assign = Object.assign || function __assign2(t) {
|
|
35
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
36
|
+
s = arguments[i];
|
|
37
|
+
for (var p in s)
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
39
|
+
t[p] = s[p];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
return __assign.apply(this, arguments);
|
|
44
|
+
};
|
|
33
45
|
function __rest(s, e) {
|
|
34
46
|
var t = {};
|
|
35
47
|
for (var p in s)
|
|
@@ -69,6 +81,128 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
69
81
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
70
82
|
});
|
|
71
83
|
}
|
|
84
|
+
function __generator(thisArg, body) {
|
|
85
|
+
var _ = { label: 0, sent: function() {
|
|
86
|
+
if (t[0] & 1)
|
|
87
|
+
throw t[1];
|
|
88
|
+
return t[1];
|
|
89
|
+
}, trys: [], ops: [] }, f, y, t, g;
|
|
90
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
91
|
+
return this;
|
|
92
|
+
}), g;
|
|
93
|
+
function verb(n) {
|
|
94
|
+
return function(v) {
|
|
95
|
+
return step([n, v]);
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function step(op) {
|
|
99
|
+
if (f)
|
|
100
|
+
throw new TypeError("Generator is already executing.");
|
|
101
|
+
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
102
|
+
try {
|
|
103
|
+
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)
|
|
104
|
+
return t;
|
|
105
|
+
if (y = 0, t)
|
|
106
|
+
op = [op[0] & 2, t.value];
|
|
107
|
+
switch (op[0]) {
|
|
108
|
+
case 0:
|
|
109
|
+
case 1:
|
|
110
|
+
t = op;
|
|
111
|
+
break;
|
|
112
|
+
case 4:
|
|
113
|
+
_.label++;
|
|
114
|
+
return { value: op[1], done: false };
|
|
115
|
+
case 5:
|
|
116
|
+
_.label++;
|
|
117
|
+
y = op[1];
|
|
118
|
+
op = [0];
|
|
119
|
+
continue;
|
|
120
|
+
case 7:
|
|
121
|
+
op = _.ops.pop();
|
|
122
|
+
_.trys.pop();
|
|
123
|
+
continue;
|
|
124
|
+
default:
|
|
125
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
126
|
+
_ = 0;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
130
|
+
_.label = op[1];
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
134
|
+
_.label = t[1];
|
|
135
|
+
t = op;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
if (t && _.label < t[2]) {
|
|
139
|
+
_.label = t[2];
|
|
140
|
+
_.ops.push(op);
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
if (t[2])
|
|
144
|
+
_.ops.pop();
|
|
145
|
+
_.trys.pop();
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
op = body.call(thisArg, _);
|
|
149
|
+
} catch (e) {
|
|
150
|
+
op = [6, e];
|
|
151
|
+
y = 0;
|
|
152
|
+
} finally {
|
|
153
|
+
f = t = 0;
|
|
154
|
+
}
|
|
155
|
+
if (op[0] & 5)
|
|
156
|
+
throw op[1];
|
|
157
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function __values(o) {
|
|
161
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
162
|
+
if (m)
|
|
163
|
+
return m.call(o);
|
|
164
|
+
if (o && typeof o.length === "number")
|
|
165
|
+
return {
|
|
166
|
+
next: function() {
|
|
167
|
+
if (o && i >= o.length)
|
|
168
|
+
o = void 0;
|
|
169
|
+
return { value: o && o[i++], done: !o };
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
173
|
+
}
|
|
174
|
+
function __read(o, n) {
|
|
175
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
176
|
+
if (!m)
|
|
177
|
+
return o;
|
|
178
|
+
var i = m.call(o), r, ar = [], e;
|
|
179
|
+
try {
|
|
180
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
181
|
+
ar.push(r.value);
|
|
182
|
+
} catch (error) {
|
|
183
|
+
e = { error };
|
|
184
|
+
} finally {
|
|
185
|
+
try {
|
|
186
|
+
if (r && !r.done && (m = i["return"]))
|
|
187
|
+
m.call(i);
|
|
188
|
+
} finally {
|
|
189
|
+
if (e)
|
|
190
|
+
throw e.error;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return ar;
|
|
194
|
+
}
|
|
195
|
+
function __spreadArray(to2, from, pack) {
|
|
196
|
+
if (pack || arguments.length === 2)
|
|
197
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
198
|
+
if (ar || !(i in from)) {
|
|
199
|
+
if (!ar)
|
|
200
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
201
|
+
ar[i] = from[i];
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return to2.concat(ar || Array.prototype.slice.call(from));
|
|
205
|
+
}
|
|
72
206
|
function mergeLocale(base2, patch) {
|
|
73
207
|
function merge2(a, b) {
|
|
74
208
|
if (typeof a !== "object" || typeof b !== "object" || Array.isArray(a) || Array.isArray(b)) {
|
|
@@ -213,6 +347,9 @@ const base = {
|
|
|
213
347
|
},
|
|
214
348
|
Switch: {
|
|
215
349
|
name: "Switch"
|
|
350
|
+
},
|
|
351
|
+
Selector: {
|
|
352
|
+
name: "Selector"
|
|
216
353
|
}
|
|
217
354
|
};
|
|
218
355
|
const typeTemplate$1 = "${label}\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684${type}";
|
|
@@ -344,6 +481,9 @@ const zhCN = mergeLocale(base, {
|
|
|
344
481
|
},
|
|
345
482
|
Switch: {
|
|
346
483
|
name: "\u5F00\u5173"
|
|
484
|
+
},
|
|
485
|
+
Selector: {
|
|
486
|
+
name: "\u9009\u62E9\u7EC4"
|
|
347
487
|
}
|
|
348
488
|
});
|
|
349
489
|
const zhCN$1 = zhCN;
|
|
@@ -906,36 +1046,48 @@ function mergeProps(...items) {
|
|
|
906
1046
|
return ret;
|
|
907
1047
|
}
|
|
908
1048
|
const popup = "";
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
isMounted.current
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1049
|
+
var createUpdateEffect = function(hook) {
|
|
1050
|
+
return function(effect, deps) {
|
|
1051
|
+
var isMounted = React$4.useRef(false);
|
|
1052
|
+
hook(function() {
|
|
1053
|
+
return function() {
|
|
1054
|
+
isMounted.current = false;
|
|
1055
|
+
};
|
|
1056
|
+
}, []);
|
|
1057
|
+
hook(function() {
|
|
1058
|
+
if (!isMounted.current) {
|
|
1059
|
+
isMounted.current = true;
|
|
1060
|
+
} else {
|
|
1061
|
+
return effect();
|
|
1062
|
+
}
|
|
1063
|
+
}, deps);
|
|
1064
|
+
};
|
|
1065
|
+
};
|
|
1066
|
+
var isFunction$1 = function(value) {
|
|
1067
|
+
return typeof value === "function";
|
|
923
1068
|
};
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1069
|
+
var isNumber = function(value) {
|
|
1070
|
+
return typeof value === "number";
|
|
1071
|
+
};
|
|
1072
|
+
var isDev$1 = true;
|
|
927
1073
|
const isDev$2 = isDev$1;
|
|
928
1074
|
function useMemoizedFn(fn) {
|
|
929
1075
|
if (isDev$2) {
|
|
930
1076
|
if (!isFunction$1(fn)) {
|
|
931
|
-
console.error(
|
|
1077
|
+
console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof fn));
|
|
932
1078
|
}
|
|
933
1079
|
}
|
|
934
|
-
|
|
935
|
-
fnRef.current = React$4.useMemo(()
|
|
936
|
-
|
|
1080
|
+
var fnRef = React$4.useRef(fn);
|
|
1081
|
+
fnRef.current = React$4.useMemo(function() {
|
|
1082
|
+
return fn;
|
|
1083
|
+
}, [fn]);
|
|
1084
|
+
var memoizedFn = React$4.useRef();
|
|
937
1085
|
if (!memoizedFn.current) {
|
|
938
|
-
memoizedFn.current = function(
|
|
1086
|
+
memoizedFn.current = function() {
|
|
1087
|
+
var args = [];
|
|
1088
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1089
|
+
args[_i] = arguments[_i];
|
|
1090
|
+
}
|
|
939
1091
|
return fnRef.current.apply(this, args);
|
|
940
1092
|
};
|
|
941
1093
|
}
|
|
@@ -945,26 +1097,28 @@ const useUpdateEffect = createUpdateEffect(React$4.useEffect);
|
|
|
945
1097
|
function depsAreSame(oldDeps, deps) {
|
|
946
1098
|
if (oldDeps === deps)
|
|
947
1099
|
return true;
|
|
948
|
-
for (
|
|
1100
|
+
for (var i = 0; i < oldDeps.length; i++) {
|
|
949
1101
|
if (!Object.is(oldDeps[i], deps[i]))
|
|
950
1102
|
return false;
|
|
951
1103
|
}
|
|
952
1104
|
return true;
|
|
953
1105
|
}
|
|
954
1106
|
function useLatest(value) {
|
|
955
|
-
|
|
1107
|
+
var ref = React$4.useRef(value);
|
|
956
1108
|
ref.current = value;
|
|
957
1109
|
return ref;
|
|
958
1110
|
}
|
|
959
|
-
|
|
1111
|
+
var useUnmount = function(fn) {
|
|
960
1112
|
if (isDev$2) {
|
|
961
1113
|
if (!isFunction$1(fn)) {
|
|
962
|
-
console.error(
|
|
1114
|
+
console.error("useUnmount expected parameter is a function, got ".concat(typeof fn));
|
|
963
1115
|
}
|
|
964
1116
|
}
|
|
965
|
-
|
|
966
|
-
React$4.useEffect(()
|
|
967
|
-
|
|
1117
|
+
var fnRef = useLatest(fn);
|
|
1118
|
+
React$4.useEffect(function() {
|
|
1119
|
+
return function() {
|
|
1120
|
+
fnRef.current();
|
|
1121
|
+
};
|
|
968
1122
|
}, []);
|
|
969
1123
|
};
|
|
970
1124
|
const useUnmount$1 = useUnmount;
|
|
@@ -1103,7 +1257,7 @@ function debounce$1(func, wait, options) {
|
|
|
1103
1257
|
return debounced;
|
|
1104
1258
|
}
|
|
1105
1259
|
var debounce_1 = debounce$1;
|
|
1106
|
-
|
|
1260
|
+
var isBrowser$2 = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
1107
1261
|
const isBrowser$3 = isBrowser$2;
|
|
1108
1262
|
var debounce = debounce_1, isObject$5 = isObject_1;
|
|
1109
1263
|
var FUNC_ERROR_TEXT$1 = "Expected a function";
|
|
@@ -1123,20 +1277,22 @@ function throttle$1(func, wait, options) {
|
|
|
1123
1277
|
});
|
|
1124
1278
|
}
|
|
1125
1279
|
var throttle_1 = throttle$1;
|
|
1126
|
-
|
|
1280
|
+
var useMount = function(fn) {
|
|
1127
1281
|
if (isDev$2) {
|
|
1128
1282
|
if (!isFunction$1(fn)) {
|
|
1129
|
-
console.error(
|
|
1283
|
+
console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof fn, '".'));
|
|
1130
1284
|
}
|
|
1131
1285
|
}
|
|
1132
|
-
React$4.useEffect(()
|
|
1286
|
+
React$4.useEffect(function() {
|
|
1133
1287
|
fn === null || fn === void 0 ? void 0 : fn();
|
|
1134
1288
|
}, []);
|
|
1135
1289
|
};
|
|
1136
1290
|
const useMount$1 = useMount;
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
return React$4.useCallback(()
|
|
1291
|
+
var useUpdate = function() {
|
|
1292
|
+
var _a = __read(React$4.useState({}), 2), setState = _a[1];
|
|
1293
|
+
return React$4.useCallback(function() {
|
|
1294
|
+
return setState({});
|
|
1295
|
+
}, []);
|
|
1140
1296
|
};
|
|
1141
1297
|
const useUpdate$1 = useUpdate;
|
|
1142
1298
|
function getTargetElement(target, defaultElement) {
|
|
@@ -1146,7 +1302,7 @@ function getTargetElement(target, defaultElement) {
|
|
|
1146
1302
|
if (!target) {
|
|
1147
1303
|
return defaultElement;
|
|
1148
1304
|
}
|
|
1149
|
-
|
|
1305
|
+
var targetElement;
|
|
1150
1306
|
if (isFunction$1(target)) {
|
|
1151
1307
|
targetElement = target();
|
|
1152
1308
|
} else if ("current" in target) {
|
|
@@ -1156,42 +1312,44 @@ function getTargetElement(target, defaultElement) {
|
|
|
1156
1312
|
}
|
|
1157
1313
|
return targetElement;
|
|
1158
1314
|
}
|
|
1159
|
-
|
|
1160
|
-
return targets.every((item)
|
|
1161
|
-
|
|
1315
|
+
var checkIfAllInShadow = function(targets) {
|
|
1316
|
+
return targets.every(function(item) {
|
|
1317
|
+
var targetElement = getTargetElement(item);
|
|
1162
1318
|
if (!targetElement)
|
|
1163
1319
|
return false;
|
|
1164
1320
|
if (targetElement.getRootNode() instanceof ShadowRoot)
|
|
1165
1321
|
return true;
|
|
1166
1322
|
});
|
|
1167
1323
|
};
|
|
1168
|
-
|
|
1324
|
+
var getShadow = function(node) {
|
|
1169
1325
|
if (!node) {
|
|
1170
1326
|
return document;
|
|
1171
1327
|
}
|
|
1172
1328
|
return node.getRootNode();
|
|
1173
1329
|
};
|
|
1174
|
-
|
|
1330
|
+
var getDocumentOrShadow = function(target) {
|
|
1175
1331
|
if (!target || !document.getRootNode) {
|
|
1176
1332
|
return document;
|
|
1177
1333
|
}
|
|
1178
|
-
|
|
1334
|
+
var targets = Array.isArray(target) ? target : [target];
|
|
1179
1335
|
if (checkIfAllInShadow(targets)) {
|
|
1180
1336
|
return getShadow(getTargetElement(targets[0]));
|
|
1181
1337
|
}
|
|
1182
1338
|
return document;
|
|
1183
1339
|
};
|
|
1184
1340
|
const getDocumentOrShadow$1 = getDocumentOrShadow;
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
useEffectType(()
|
|
1341
|
+
var createEffectWithTarget = function(useEffectType) {
|
|
1342
|
+
var useEffectWithTarget2 = function(effect, deps, target) {
|
|
1343
|
+
var hasInitRef = React$4.useRef(false);
|
|
1344
|
+
var lastElementRef = React$4.useRef([]);
|
|
1345
|
+
var lastDepsRef = React$4.useRef([]);
|
|
1346
|
+
var unLoadRef = React$4.useRef();
|
|
1347
|
+
useEffectType(function() {
|
|
1192
1348
|
var _a;
|
|
1193
|
-
|
|
1194
|
-
|
|
1349
|
+
var targets = Array.isArray(target) ? target : [target];
|
|
1350
|
+
var els = targets.map(function(item) {
|
|
1351
|
+
return getTargetElement(item);
|
|
1352
|
+
});
|
|
1195
1353
|
if (!hasInitRef.current) {
|
|
1196
1354
|
hasInitRef.current = true;
|
|
1197
1355
|
lastElementRef.current = els;
|
|
@@ -1206,7 +1364,7 @@ const createEffectWithTarget = (useEffectType) => {
|
|
|
1206
1364
|
unLoadRef.current = effect();
|
|
1207
1365
|
}
|
|
1208
1366
|
});
|
|
1209
|
-
useUnmount$1(()
|
|
1367
|
+
useUnmount$1(function() {
|
|
1210
1368
|
var _a;
|
|
1211
1369
|
(_a = unLoadRef.current) === null || _a === void 0 ? void 0 : _a.call(unLoadRef);
|
|
1212
1370
|
hasInitRef.current = false;
|
|
@@ -1215,26 +1373,33 @@ const createEffectWithTarget = (useEffectType) => {
|
|
|
1215
1373
|
return useEffectWithTarget2;
|
|
1216
1374
|
};
|
|
1217
1375
|
const createEffectWithTarget$1 = createEffectWithTarget;
|
|
1218
|
-
|
|
1376
|
+
var useEffectWithTarget$1 = createEffectWithTarget$1(React$4.useEffect);
|
|
1219
1377
|
const useEffectWithTarget$2 = useEffectWithTarget$1;
|
|
1220
|
-
function useClickAway(onClickAway, target, eventName
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1378
|
+
function useClickAway(onClickAway, target, eventName) {
|
|
1379
|
+
if (eventName === void 0) {
|
|
1380
|
+
eventName = "click";
|
|
1381
|
+
}
|
|
1382
|
+
var onClickAwayRef = useLatest(onClickAway);
|
|
1383
|
+
useEffectWithTarget$2(function() {
|
|
1384
|
+
var handler = function(event) {
|
|
1385
|
+
var targets = Array.isArray(target) ? target : [target];
|
|
1386
|
+
if (targets.some(function(item) {
|
|
1387
|
+
var targetElement = getTargetElement(item);
|
|
1227
1388
|
return !targetElement || targetElement.contains(event.target);
|
|
1228
1389
|
})) {
|
|
1229
1390
|
return;
|
|
1230
1391
|
}
|
|
1231
1392
|
onClickAwayRef.current(event);
|
|
1232
1393
|
};
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
eventNames.forEach((event)
|
|
1236
|
-
|
|
1237
|
-
|
|
1394
|
+
var documentOrShadow = getDocumentOrShadow$1(target);
|
|
1395
|
+
var eventNames = Array.isArray(eventName) ? eventName : [eventName];
|
|
1396
|
+
eventNames.forEach(function(event) {
|
|
1397
|
+
return documentOrShadow.addEventListener(event, handler);
|
|
1398
|
+
});
|
|
1399
|
+
return function() {
|
|
1400
|
+
eventNames.forEach(function(event) {
|
|
1401
|
+
return documentOrShadow.removeEventListener(event, handler);
|
|
1402
|
+
});
|
|
1238
1403
|
};
|
|
1239
1404
|
}, Array.isArray(eventName) ? eventName : [eventName], target);
|
|
1240
1405
|
}
|
|
@@ -1451,15 +1616,21 @@ function useDebounceFn(fn, options) {
|
|
|
1451
1616
|
var _a;
|
|
1452
1617
|
if (isDev$2) {
|
|
1453
1618
|
if (!isFunction$1(fn)) {
|
|
1454
|
-
console.error(
|
|
1619
|
+
console.error("useDebounceFn expected parameter is a function, got ".concat(typeof fn));
|
|
1455
1620
|
}
|
|
1456
1621
|
}
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
return
|
|
1461
|
-
|
|
1462
|
-
|
|
1622
|
+
var fnRef = useLatest(fn);
|
|
1623
|
+
var wait = (_a = options === null || options === void 0 ? void 0 : options.wait) !== null && _a !== void 0 ? _a : 1e3;
|
|
1624
|
+
var debounced = React$4.useMemo(function() {
|
|
1625
|
+
return debounce_1(function() {
|
|
1626
|
+
var args = [];
|
|
1627
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1628
|
+
args[_i] = arguments[_i];
|
|
1629
|
+
}
|
|
1630
|
+
return fnRef.current.apply(fnRef, __spreadArray([], __read(args), false));
|
|
1631
|
+
}, wait, options);
|
|
1632
|
+
}, []);
|
|
1633
|
+
useUnmount$1(function() {
|
|
1463
1634
|
debounced.cancel();
|
|
1464
1635
|
});
|
|
1465
1636
|
return {
|
|
@@ -1469,13 +1640,11 @@ function useDebounceFn(fn, options) {
|
|
|
1469
1640
|
};
|
|
1470
1641
|
}
|
|
1471
1642
|
function useDebounceEffect(effect, deps, options) {
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
run
|
|
1475
|
-
} = useDebounceFn(() => {
|
|
1643
|
+
var _a = __read(React$4.useState({}), 2), flag = _a[0], setFlag = _a[1];
|
|
1644
|
+
var run = useDebounceFn(function() {
|
|
1476
1645
|
setFlag({});
|
|
1477
|
-
}, options);
|
|
1478
|
-
React$4.useEffect(()
|
|
1646
|
+
}, options).run;
|
|
1647
|
+
React$4.useEffect(function() {
|
|
1479
1648
|
return run();
|
|
1480
1649
|
}, deps);
|
|
1481
1650
|
useUpdateEffect(effect, [flag]);
|
|
@@ -2597,65 +2766,100 @@ var isEqual_1 = isEqual$1;
|
|
|
2597
2766
|
window.IntersectionObserverEntry = IntersectionObserverEntry;
|
|
2598
2767
|
})();
|
|
2599
2768
|
function useInViewport(target, options) {
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
useEffectWithTarget$2(()
|
|
2603
|
-
|
|
2769
|
+
var _a = __read(React$4.useState(), 2), state = _a[0], setState = _a[1];
|
|
2770
|
+
var _b = __read(React$4.useState(), 2), ratio = _b[0], setRatio = _b[1];
|
|
2771
|
+
useEffectWithTarget$2(function() {
|
|
2772
|
+
var el = getTargetElement(target);
|
|
2604
2773
|
if (!el) {
|
|
2605
2774
|
return;
|
|
2606
2775
|
}
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2776
|
+
var observer = new IntersectionObserver(function(entries) {
|
|
2777
|
+
var e_1, _a2;
|
|
2778
|
+
try {
|
|
2779
|
+
for (var entries_1 = __values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {
|
|
2780
|
+
var entry = entries_1_1.value;
|
|
2781
|
+
setRatio(entry.intersectionRatio);
|
|
2782
|
+
setState(entry.isIntersecting);
|
|
2783
|
+
}
|
|
2784
|
+
} catch (e_1_1) {
|
|
2785
|
+
e_1 = {
|
|
2786
|
+
error: e_1_1
|
|
2787
|
+
};
|
|
2788
|
+
} finally {
|
|
2789
|
+
try {
|
|
2790
|
+
if (entries_1_1 && !entries_1_1.done && (_a2 = entries_1.return))
|
|
2791
|
+
_a2.call(entries_1);
|
|
2792
|
+
} finally {
|
|
2793
|
+
if (e_1)
|
|
2794
|
+
throw e_1.error;
|
|
2795
|
+
}
|
|
2611
2796
|
}
|
|
2612
|
-
},
|
|
2797
|
+
}, __assign(__assign({}, options), {
|
|
2613
2798
|
root: getTargetElement(options === null || options === void 0 ? void 0 : options.root)
|
|
2614
2799
|
}));
|
|
2615
2800
|
observer.observe(el);
|
|
2616
|
-
return ()
|
|
2801
|
+
return function() {
|
|
2617
2802
|
observer.disconnect();
|
|
2618
2803
|
};
|
|
2619
2804
|
}, [options === null || options === void 0 ? void 0 : options.rootMargin, options === null || options === void 0 ? void 0 : options.threshold], target);
|
|
2620
2805
|
return [state, ratio];
|
|
2621
2806
|
}
|
|
2622
|
-
|
|
2807
|
+
var useIsomorphicLayoutEffect$1 = isBrowser$3 ? React$4.useLayoutEffect : React$4.useEffect;
|
|
2623
2808
|
const useIsomorphicLayoutEffect$2 = useIsomorphicLayoutEffect$1;
|
|
2624
2809
|
function useLockFn(fn) {
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2810
|
+
var _this = this;
|
|
2811
|
+
var lockRef = React$4.useRef(false);
|
|
2812
|
+
return React$4.useCallback(function() {
|
|
2813
|
+
var args = [];
|
|
2814
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2815
|
+
args[_i] = arguments[_i];
|
|
2816
|
+
}
|
|
2817
|
+
return __awaiter(_this, void 0, void 0, function() {
|
|
2818
|
+
var ret, e_1;
|
|
2819
|
+
return __generator(this, function(_a) {
|
|
2820
|
+
switch (_a.label) {
|
|
2821
|
+
case 0:
|
|
2822
|
+
if (lockRef.current)
|
|
2823
|
+
return [2];
|
|
2824
|
+
lockRef.current = true;
|
|
2825
|
+
_a.label = 1;
|
|
2826
|
+
case 1:
|
|
2827
|
+
_a.trys.push([1, 3, , 4]);
|
|
2828
|
+
return [4, fn.apply(void 0, __spreadArray([], __read(args), false))];
|
|
2829
|
+
case 2:
|
|
2830
|
+
ret = _a.sent();
|
|
2831
|
+
lockRef.current = false;
|
|
2832
|
+
return [2, ret];
|
|
2833
|
+
case 3:
|
|
2834
|
+
e_1 = _a.sent();
|
|
2835
|
+
lockRef.current = false;
|
|
2836
|
+
throw e_1;
|
|
2837
|
+
case 4:
|
|
2838
|
+
return [2];
|
|
2839
|
+
}
|
|
2840
|
+
});
|
|
2841
|
+
});
|
|
2842
|
+
}, [fn]);
|
|
2639
2843
|
}
|
|
2640
2844
|
function useRafState(initialState) {
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2845
|
+
var ref = React$4.useRef(0);
|
|
2846
|
+
var _a = __read(React$4.useState(initialState), 2), state = _a[0], setState = _a[1];
|
|
2847
|
+
var setRafState = React$4.useCallback(function(value) {
|
|
2644
2848
|
cancelAnimationFrame(ref.current);
|
|
2645
|
-
ref.current = requestAnimationFrame(()
|
|
2849
|
+
ref.current = requestAnimationFrame(function() {
|
|
2646
2850
|
setState(value);
|
|
2647
2851
|
});
|
|
2648
2852
|
}, []);
|
|
2649
|
-
useUnmount$1(()
|
|
2853
|
+
useUnmount$1(function() {
|
|
2650
2854
|
cancelAnimationFrame(ref.current);
|
|
2651
2855
|
});
|
|
2652
2856
|
return [state, setRafState];
|
|
2653
2857
|
}
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
React$4.useEffect(()
|
|
2858
|
+
var useUnmountedRef = function() {
|
|
2859
|
+
var unmountedRef = React$4.useRef(false);
|
|
2860
|
+
React$4.useEffect(function() {
|
|
2657
2861
|
unmountedRef.current = false;
|
|
2658
|
-
return ()
|
|
2862
|
+
return function() {
|
|
2659
2863
|
unmountedRef.current = true;
|
|
2660
2864
|
};
|
|
2661
2865
|
}, []);
|
|
@@ -3133,29 +3337,26 @@ var index$k = function() {
|
|
|
3133
3337
|
}
|
|
3134
3338
|
return ResizeObserver$1;
|
|
3135
3339
|
}();
|
|
3136
|
-
|
|
3340
|
+
var useEffectWithTarget = createEffectWithTarget$1(React$4.useLayoutEffect);
|
|
3137
3341
|
const useLayoutEffectWithTarget = useEffectWithTarget;
|
|
3138
|
-
|
|
3342
|
+
var useIsomorphicLayoutEffectWithTarget = isBrowser$3 ? useLayoutEffectWithTarget : useEffectWithTarget$2;
|
|
3139
3343
|
const useIsomorphicLayoutEffectWithTarget$1 = useIsomorphicLayoutEffectWithTarget;
|
|
3140
3344
|
function useSize(target) {
|
|
3141
|
-
|
|
3142
|
-
|
|
3345
|
+
var _a = __read(useRafState(function() {
|
|
3346
|
+
var el = getTargetElement(target);
|
|
3143
3347
|
return el ? {
|
|
3144
3348
|
width: el.clientWidth,
|
|
3145
3349
|
height: el.clientHeight
|
|
3146
3350
|
} : void 0;
|
|
3147
|
-
});
|
|
3148
|
-
useIsomorphicLayoutEffectWithTarget$1(()
|
|
3149
|
-
|
|
3351
|
+
}), 2), state = _a[0], setState = _a[1];
|
|
3352
|
+
useIsomorphicLayoutEffectWithTarget$1(function() {
|
|
3353
|
+
var el = getTargetElement(target);
|
|
3150
3354
|
if (!el) {
|
|
3151
3355
|
return;
|
|
3152
3356
|
}
|
|
3153
|
-
|
|
3154
|
-
entries.forEach((entry)
|
|
3155
|
-
|
|
3156
|
-
clientWidth,
|
|
3157
|
-
clientHeight
|
|
3158
|
-
} = entry.target;
|
|
3357
|
+
var resizeObserver = new index$k(function(entries) {
|
|
3358
|
+
entries.forEach(function(entry) {
|
|
3359
|
+
var _a2 = entry.target, clientWidth = _a2.clientWidth, clientHeight = _a2.clientHeight;
|
|
3159
3360
|
setState({
|
|
3160
3361
|
width: clientWidth,
|
|
3161
3362
|
height: clientHeight
|
|
@@ -3163,7 +3364,7 @@ function useSize(target) {
|
|
|
3163
3364
|
});
|
|
3164
3365
|
});
|
|
3165
3366
|
resizeObserver.observe(el);
|
|
3166
|
-
return ()
|
|
3367
|
+
return function() {
|
|
3167
3368
|
resizeObserver.disconnect();
|
|
3168
3369
|
};
|
|
3169
3370
|
}, [], target);
|
|
@@ -3173,15 +3374,21 @@ function useThrottleFn(fn, options) {
|
|
|
3173
3374
|
var _a;
|
|
3174
3375
|
if (isDev$2) {
|
|
3175
3376
|
if (!isFunction$1(fn)) {
|
|
3176
|
-
console.error(
|
|
3377
|
+
console.error("useThrottleFn expected parameter is a function, got ".concat(typeof fn));
|
|
3177
3378
|
}
|
|
3178
3379
|
}
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
return
|
|
3183
|
-
|
|
3184
|
-
|
|
3380
|
+
var fnRef = useLatest(fn);
|
|
3381
|
+
var wait = (_a = options === null || options === void 0 ? void 0 : options.wait) !== null && _a !== void 0 ? _a : 1e3;
|
|
3382
|
+
var throttled = React$4.useMemo(function() {
|
|
3383
|
+
return throttle_1(function() {
|
|
3384
|
+
var args = [];
|
|
3385
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3386
|
+
args[_i] = arguments[_i];
|
|
3387
|
+
}
|
|
3388
|
+
return fnRef.current.apply(fnRef, __spreadArray([], __read(args), false));
|
|
3389
|
+
}, wait, options);
|
|
3390
|
+
}, []);
|
|
3391
|
+
useUnmount$1(function() {
|
|
3185
3392
|
throttled.cancel();
|
|
3186
3393
|
});
|
|
3187
3394
|
return {
|
|
@@ -3190,29 +3397,24 @@ function useThrottleFn(fn, options) {
|
|
|
3190
3397
|
flush: throttled.flush
|
|
3191
3398
|
};
|
|
3192
3399
|
}
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
React$4.
|
|
3197
|
-
if (!isNumber(delay) || delay < 0) {
|
|
3198
|
-
return;
|
|
3199
|
-
}
|
|
3200
|
-
timerRef.current = setTimeout(() => {
|
|
3201
|
-
fnRef.current();
|
|
3202
|
-
}, delay);
|
|
3203
|
-
return () => {
|
|
3204
|
-
if (timerRef.current) {
|
|
3205
|
-
clearTimeout(timerRef.current);
|
|
3206
|
-
}
|
|
3207
|
-
};
|
|
3208
|
-
}, [delay]);
|
|
3209
|
-
const clear2 = React$4.useCallback(() => {
|
|
3400
|
+
var useTimeout = function(fn, delay) {
|
|
3401
|
+
var timerCallback = useMemoizedFn(fn);
|
|
3402
|
+
var timerRef = React$4.useRef(null);
|
|
3403
|
+
var clear2 = React$4.useCallback(function() {
|
|
3210
3404
|
if (timerRef.current) {
|
|
3211
3405
|
clearTimeout(timerRef.current);
|
|
3212
3406
|
}
|
|
3213
3407
|
}, []);
|
|
3408
|
+
React$4.useEffect(function() {
|
|
3409
|
+
if (!isNumber(delay) || delay < 0) {
|
|
3410
|
+
return;
|
|
3411
|
+
}
|
|
3412
|
+
timerRef.current = setTimeout(timerCallback, delay);
|
|
3413
|
+
return clear2;
|
|
3414
|
+
}, [delay]);
|
|
3214
3415
|
return clear2;
|
|
3215
|
-
}
|
|
3416
|
+
};
|
|
3417
|
+
const useTimeout$1 = useTimeout;
|
|
3216
3418
|
const mask = "";
|
|
3217
3419
|
const MIN_DISTANCE = 10;
|
|
3218
3420
|
function getDirection(x, y) {
|
|
@@ -7597,13 +7799,17 @@ const ActionSheet = (p) => {
|
|
|
7597
7799
|
if (props.closeOnAction) {
|
|
7598
7800
|
(_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
7599
7801
|
}
|
|
7600
|
-
}
|
|
7802
|
+
},
|
|
7803
|
+
role: "option",
|
|
7804
|
+
"aria-disabled": action.disabled
|
|
7601
7805
|
}, React__default.default.createElement("div", {
|
|
7602
7806
|
className: `${classPrefix$1i}-button-item-name`
|
|
7603
7807
|
}, action.text), action.description && React__default.default.createElement("div", {
|
|
7604
7808
|
className: `${classPrefix$1i}-button-item-description`
|
|
7605
7809
|
}, action.description))))), props.cancelText && React__default.default.createElement("div", {
|
|
7606
|
-
className: `${classPrefix$1i}-cancel
|
|
7810
|
+
className: `${classPrefix$1i}-cancel`,
|
|
7811
|
+
role: "option",
|
|
7812
|
+
"aria-label": props.cancelText
|
|
7607
7813
|
}, React__default.default.createElement("div", {
|
|
7608
7814
|
className: `${classPrefix$1i}-button-item-wrapper`
|
|
7609
7815
|
}, React__default.default.createElement("a", {
|
|
@@ -7828,7 +8034,8 @@ const Avatar$1 = (p) => {
|
|
|
7828
8034
|
lazy: props.lazy,
|
|
7829
8035
|
fit: props.fit,
|
|
7830
8036
|
onClick: props.onClick,
|
|
7831
|
-
onError: props.onError
|
|
8037
|
+
onError: props.onError,
|
|
8038
|
+
onLoad: props.onLoad
|
|
7832
8039
|
}));
|
|
7833
8040
|
};
|
|
7834
8041
|
const Avatar = Avatar$1;
|
|
@@ -11580,7 +11787,8 @@ const Tabs$1 = (p) => {
|
|
|
11580
11787
|
className: `${classPrefix$13}-tab-list`,
|
|
11581
11788
|
ref: tabListContainerRef,
|
|
11582
11789
|
scrollLeft,
|
|
11583
|
-
onScroll: updateMask
|
|
11790
|
+
onScroll: updateMask,
|
|
11791
|
+
role: "tablist"
|
|
11584
11792
|
}, React__default.default.createElement(animated.div, {
|
|
11585
11793
|
ref: activeLineRef,
|
|
11586
11794
|
className: `${classPrefix$13}-tab-line`,
|
|
@@ -11608,7 +11816,9 @@ const Tabs$1 = (p) => {
|
|
|
11608
11816
|
className: classNames(`${classPrefix$13}-tab`, {
|
|
11609
11817
|
[`${classPrefix$13}-tab-active`]: pane.key === activeKey,
|
|
11610
11818
|
[`${classPrefix$13}-tab-disabled`]: pane.props.disabled
|
|
11611
|
-
})
|
|
11819
|
+
}),
|
|
11820
|
+
role: "tab",
|
|
11821
|
+
"aria-selected": pane.key === activeKey
|
|
11612
11822
|
}, pane.props.title)))))), panes.map((pane) => {
|
|
11613
11823
|
if (pane.props.children === void 0) {
|
|
11614
11824
|
return null;
|
|
@@ -11708,6 +11918,7 @@ const CheckList$1 = (p) => {
|
|
|
11708
11918
|
}
|
|
11709
11919
|
const {
|
|
11710
11920
|
activeIcon,
|
|
11921
|
+
extra,
|
|
11711
11922
|
disabled,
|
|
11712
11923
|
readOnly
|
|
11713
11924
|
} = props;
|
|
@@ -11717,6 +11928,7 @@ const CheckList$1 = (p) => {
|
|
|
11717
11928
|
check,
|
|
11718
11929
|
uncheck,
|
|
11719
11930
|
activeIcon,
|
|
11931
|
+
extra,
|
|
11720
11932
|
disabled,
|
|
11721
11933
|
readOnly
|
|
11722
11934
|
}
|
|
@@ -11734,9 +11946,11 @@ const CheckListItem = (props) => {
|
|
|
11734
11946
|
}
|
|
11735
11947
|
const active = context.value.includes(props.value);
|
|
11736
11948
|
const readOnly = props.readOnly || context.readOnly;
|
|
11949
|
+
const defaultExtra = active ? context.activeIcon : null;
|
|
11950
|
+
const renderExtra = context.extra ? context.extra(active) : defaultExtra;
|
|
11737
11951
|
const extra = React__default.default.createElement("div", {
|
|
11738
11952
|
className: `${classPrefix$$}-extra`
|
|
11739
|
-
},
|
|
11953
|
+
}, renderExtra);
|
|
11740
11954
|
return withNativeProps(props, React__default.default.createElement(List$1.Item, {
|
|
11741
11955
|
title: props.title,
|
|
11742
11956
|
className: classNames(classPrefix$$, readOnly && `${classPrefix$$}-readonly`, active && `${classPrefix$$}-active`),
|
|
@@ -13527,7 +13741,7 @@ const Ellipsis$1 = (p) => {
|
|
|
13527
13741
|
setExpanded(true);
|
|
13528
13742
|
}
|
|
13529
13743
|
}, props.expandText)) : null;
|
|
13530
|
-
const collapseActionElement = exceeded && props.
|
|
13744
|
+
const collapseActionElement = exceeded && props.collapseText ? withStopPropagation(props.stopPropagationForActionButtons, React__default.default.createElement("a", {
|
|
13531
13745
|
onClick: () => {
|
|
13532
13746
|
setExpanded(false);
|
|
13533
13747
|
}
|
|
@@ -18882,22 +19096,6 @@ const computePosition$1 = async (reference, floating, config2) => {
|
|
|
18882
19096
|
} = config2;
|
|
18883
19097
|
const validMiddleware = middleware.filter(Boolean);
|
|
18884
19098
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
18885
|
-
{
|
|
18886
|
-
if (platform2 == null) {
|
|
18887
|
-
console.error(["Floating UI: `platform` property was not passed to config. If you", "want to use Floating UI on the web, install @floating-ui/dom", "instead of the /core package. Otherwise, you can create your own", "`platform`: https://floating-ui.com/docs/platform"].join(" "));
|
|
18888
|
-
}
|
|
18889
|
-
if (validMiddleware.filter((_ref) => {
|
|
18890
|
-
let {
|
|
18891
|
-
name
|
|
18892
|
-
} = _ref;
|
|
18893
|
-
return name === "autoPlacement" || name === "flip";
|
|
18894
|
-
}).length > 1) {
|
|
18895
|
-
throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware", "detected. This will lead to an infinite loop. Ensure only one of", "either has been passed to the `middleware` array."].join(" "));
|
|
18896
|
-
}
|
|
18897
|
-
if (!reference || !floating) {
|
|
18898
|
-
console.error(["Floating UI: The reference and/or floating element was not defined", "when `computePosition()` was called. Ensure that both elements have", "been created and can be measured."].join(" "));
|
|
18899
|
-
}
|
|
18900
|
-
}
|
|
18901
19099
|
let rects = await platform2.getElementRects({
|
|
18902
19100
|
reference,
|
|
18903
19101
|
floating,
|
|
@@ -18943,11 +19141,6 @@ const computePosition$1 = async (reference, floating, config2) => {
|
|
|
18943
19141
|
...data
|
|
18944
19142
|
}
|
|
18945
19143
|
};
|
|
18946
|
-
{
|
|
18947
|
-
if (resetCount > 50) {
|
|
18948
|
-
console.warn(["Floating UI: The middleware lifecycle appears to be running in an", "infinite loop. This is usually caused by a `reset` continually", "being returned without a break condition."].join(" "));
|
|
18949
|
-
}
|
|
18950
|
-
}
|
|
18951
19144
|
if (reset && resetCount <= 50) {
|
|
18952
19145
|
resetCount++;
|
|
18953
19146
|
if (typeof reset === "object") {
|
|
@@ -19080,9 +19273,6 @@ const arrow = (options) => ({
|
|
|
19080
19273
|
elements
|
|
19081
19274
|
} = state;
|
|
19082
19275
|
if (element == null) {
|
|
19083
|
-
{
|
|
19084
|
-
console.warn("Floating UI: No `element` was passed to the `arrow` middleware.");
|
|
19085
|
-
}
|
|
19086
19276
|
return {};
|
|
19087
19277
|
}
|
|
19088
19278
|
const paddingObject = getSideObjectFromPadding(padding);
|
|
@@ -20242,7 +20432,7 @@ const Popover$1 = React$4.forwardRef((p, ref) => {
|
|
|
20242
20432
|
top: arrowY != null ? `${arrowY}px` : "",
|
|
20243
20433
|
right: "",
|
|
20244
20434
|
bottom: "",
|
|
20245
|
-
[arrowSide]:
|
|
20435
|
+
[arrowSide]: "calc(var(--arrow-size) * -1)"
|
|
20246
20436
|
});
|
|
20247
20437
|
const arrowRotate = {
|
|
20248
20438
|
top: "0deg",
|
|
@@ -22138,7 +22328,7 @@ const NoticeBar$1 = React$4.memo((p) => {
|
|
|
22138
22328
|
text.style.transitionDuration = `${Math.round(distance / speed)}s`;
|
|
22139
22329
|
text.style.transform = `translateX(-${text.offsetWidth}px)`;
|
|
22140
22330
|
}
|
|
22141
|
-
useTimeout(() => {
|
|
22331
|
+
useTimeout$1(() => {
|
|
22142
22332
|
delayLockRef.current = false;
|
|
22143
22333
|
start2();
|
|
22144
22334
|
}, props.delay);
|
|
@@ -22275,8 +22465,9 @@ const NumberKeyboard$1 = (p) => {
|
|
|
22275
22465
|
className: classNames(`${classPrefix$w}-header`, {
|
|
22276
22466
|
[`${classPrefix$w}-header-with-title`]: !!title
|
|
22277
22467
|
})
|
|
22278
|
-
},
|
|
22279
|
-
className: `${classPrefix$w}-title
|
|
22468
|
+
}, React__default.default.createElement("div", {
|
|
22469
|
+
className: `${classPrefix$w}-title`,
|
|
22470
|
+
"aria-label": title
|
|
22280
22471
|
}, title), showCloseButton && React__default.default.createElement("span", {
|
|
22281
22472
|
className: `${classPrefix$w}-header-close-button`,
|
|
22282
22473
|
onClick: () => {
|
|
@@ -22284,7 +22475,8 @@ const NumberKeyboard$1 = (p) => {
|
|
|
22284
22475
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
22285
22476
|
},
|
|
22286
22477
|
role: "button",
|
|
22287
|
-
title: "CLOSE"
|
|
22478
|
+
title: "CLOSE",
|
|
22479
|
+
tabIndex: -1
|
|
22288
22480
|
}, React__default.default.createElement(DownOutline, null)));
|
|
22289
22481
|
};
|
|
22290
22482
|
const renderKey = (key, index2) => {
|
|
@@ -22295,8 +22487,9 @@ const NumberKeyboard$1 = (p) => {
|
|
|
22295
22487
|
[`${classPrefix$w}-key-mid`]: index2 === 9 && !!confirmText && keys2.length < 12
|
|
22296
22488
|
});
|
|
22297
22489
|
const ariaProps = key ? {
|
|
22298
|
-
role: "
|
|
22299
|
-
title: key
|
|
22490
|
+
role: "grid",
|
|
22491
|
+
title: key,
|
|
22492
|
+
tabIndex: -1
|
|
22300
22493
|
} : void 0;
|
|
22301
22494
|
return React__default.default.createElement("div", Object.assign({
|
|
22302
22495
|
key,
|
|
@@ -22352,7 +22545,8 @@ const NumberKeyboard$1 = (p) => {
|
|
|
22352
22545
|
}, React__default.default.createElement(TextDeletionOutline, null)), React__default.default.createElement("div", {
|
|
22353
22546
|
className: `${classPrefix$w}-key ${classPrefix$w}-key-extra ${classPrefix$w}-key-ok`,
|
|
22354
22547
|
onTouchEnd: (e) => onKeyPress(e, "OK"),
|
|
22355
|
-
role: "button"
|
|
22548
|
+
role: "button",
|
|
22549
|
+
"aria-label": confirmText
|
|
22356
22550
|
}, confirmText))), props.safeArea && React__default.default.createElement("div", {
|
|
22357
22551
|
className: `${classPrefix$w}-footer`
|
|
22358
22552
|
}, React__default.default.createElement(SafeArea, {
|
|
@@ -23200,6 +23394,9 @@ const Selector$1 = (p) => {
|
|
|
23200
23394
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, val, extend);
|
|
23201
23395
|
}
|
|
23202
23396
|
});
|
|
23397
|
+
const {
|
|
23398
|
+
locale
|
|
23399
|
+
} = useConfig();
|
|
23203
23400
|
const items = props.options.map((option) => {
|
|
23204
23401
|
const active = (value || []).includes(option.value);
|
|
23205
23402
|
const disabled = option.disabled || props.disabled;
|
|
@@ -23222,7 +23419,9 @@ const Selector$1 = (p) => {
|
|
|
23222
23419
|
const val = active ? [] : [option.value];
|
|
23223
23420
|
setValue2(val);
|
|
23224
23421
|
}
|
|
23225
|
-
}
|
|
23422
|
+
},
|
|
23423
|
+
role: "option",
|
|
23424
|
+
"aria-selected": active && !props.multiple || active && props.multiple
|
|
23226
23425
|
}, option.label, option.description && React__default.default.createElement("div", {
|
|
23227
23426
|
className: `${classPrefix$k}-item-description`
|
|
23228
23427
|
}, option.description), active && props.showCheckMark && React__default.default.createElement("div", {
|
|
@@ -23230,7 +23429,9 @@ const Selector$1 = (p) => {
|
|
|
23230
23429
|
}, React__default.default.createElement(CheckMark, null)));
|
|
23231
23430
|
});
|
|
23232
23431
|
return withNativeProps(props, React__default.default.createElement("div", {
|
|
23233
|
-
className: classPrefix$k
|
|
23432
|
+
className: classPrefix$k,
|
|
23433
|
+
role: "listbox",
|
|
23434
|
+
"aria-label": locale.Selector.name
|
|
23234
23435
|
}, !props.columns && React__default.default.createElement(Space, {
|
|
23235
23436
|
wrap: true
|
|
23236
23437
|
}, items), props.columns && React__default.default.createElement(Grid, {
|
|
@@ -25778,6 +25979,9 @@ const VirtualInput$1 = React$4.forwardRef((p, ref) => {
|
|
|
25778
25979
|
const rootRef = React$4.useRef(null);
|
|
25779
25980
|
const contentRef = React$4.useRef(null);
|
|
25780
25981
|
const [hasFocus, setHasFocus] = React$4.useState(false);
|
|
25982
|
+
const {
|
|
25983
|
+
locale
|
|
25984
|
+
} = useConfig();
|
|
25781
25985
|
function scrollToEnd() {
|
|
25782
25986
|
const root2 = rootRef.current;
|
|
25783
25987
|
if (!root2)
|
|
@@ -25849,7 +26053,11 @@ const VirtualInput$1 = React$4.forwardRef((p, ref) => {
|
|
|
25849
26053
|
onClick: props.onClick
|
|
25850
26054
|
}, React__default.default.createElement("div", {
|
|
25851
26055
|
className: `${classPrefix$2}-content`,
|
|
25852
|
-
ref: contentRef
|
|
26056
|
+
ref: contentRef,
|
|
26057
|
+
role: "option",
|
|
26058
|
+
tabIndex: props.disabled ? void 0 : 0,
|
|
26059
|
+
"aria-disabled": props.disabled,
|
|
26060
|
+
"aria-label": props.placeholder
|
|
25853
26061
|
}, value, React__default.default.createElement("div", {
|
|
25854
26062
|
className: `${classPrefix$2}-caret-container`
|
|
25855
26063
|
}, hasFocus && React__default.default.createElement("div", {
|
|
@@ -25861,7 +26069,9 @@ const VirtualInput$1 = React$4.forwardRef((p, ref) => {
|
|
|
25861
26069
|
e.stopPropagation();
|
|
25862
26070
|
setValue2("");
|
|
25863
26071
|
(_a = props.onClear) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
25864
|
-
}
|
|
26072
|
+
},
|
|
26073
|
+
role: "button",
|
|
26074
|
+
"aria-label": locale.Input.clear
|
|
25865
26075
|
}, React__default.default.createElement(CloseCircleFill, null)), !value && React__default.default.createElement("div", {
|
|
25866
26076
|
className: `${classPrefix$2}-placeholder`
|
|
25867
26077
|
}, props.placeholder), keyboardElement));
|