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
|
@@ -8,6 +8,18 @@ if (canUseDom$2) {
|
|
|
8
8
|
document.addEventListener("touchstart", () => {
|
|
9
9
|
}, true);
|
|
10
10
|
}
|
|
11
|
+
var __assign = function() {
|
|
12
|
+
__assign = Object.assign || function __assign2(t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s)
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
17
|
+
t[p] = s[p];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
return __assign.apply(this, arguments);
|
|
22
|
+
};
|
|
11
23
|
function __rest(s, e) {
|
|
12
24
|
var t = {};
|
|
13
25
|
for (var p in s)
|
|
@@ -47,6 +59,128 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
47
59
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
60
|
});
|
|
49
61
|
}
|
|
62
|
+
function __generator(thisArg, body) {
|
|
63
|
+
var _ = { label: 0, sent: function() {
|
|
64
|
+
if (t[0] & 1)
|
|
65
|
+
throw t[1];
|
|
66
|
+
return t[1];
|
|
67
|
+
}, trys: [], ops: [] }, f, y, t, g;
|
|
68
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
69
|
+
return this;
|
|
70
|
+
}), g;
|
|
71
|
+
function verb(n) {
|
|
72
|
+
return function(v) {
|
|
73
|
+
return step([n, v]);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function step(op) {
|
|
77
|
+
if (f)
|
|
78
|
+
throw new TypeError("Generator is already executing.");
|
|
79
|
+
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
80
|
+
try {
|
|
81
|
+
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)
|
|
82
|
+
return t;
|
|
83
|
+
if (y = 0, t)
|
|
84
|
+
op = [op[0] & 2, t.value];
|
|
85
|
+
switch (op[0]) {
|
|
86
|
+
case 0:
|
|
87
|
+
case 1:
|
|
88
|
+
t = op;
|
|
89
|
+
break;
|
|
90
|
+
case 4:
|
|
91
|
+
_.label++;
|
|
92
|
+
return { value: op[1], done: false };
|
|
93
|
+
case 5:
|
|
94
|
+
_.label++;
|
|
95
|
+
y = op[1];
|
|
96
|
+
op = [0];
|
|
97
|
+
continue;
|
|
98
|
+
case 7:
|
|
99
|
+
op = _.ops.pop();
|
|
100
|
+
_.trys.pop();
|
|
101
|
+
continue;
|
|
102
|
+
default:
|
|
103
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
104
|
+
_ = 0;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
108
|
+
_.label = op[1];
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
112
|
+
_.label = t[1];
|
|
113
|
+
t = op;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
if (t && _.label < t[2]) {
|
|
117
|
+
_.label = t[2];
|
|
118
|
+
_.ops.push(op);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
if (t[2])
|
|
122
|
+
_.ops.pop();
|
|
123
|
+
_.trys.pop();
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
op = body.call(thisArg, _);
|
|
127
|
+
} catch (e) {
|
|
128
|
+
op = [6, e];
|
|
129
|
+
y = 0;
|
|
130
|
+
} finally {
|
|
131
|
+
f = t = 0;
|
|
132
|
+
}
|
|
133
|
+
if (op[0] & 5)
|
|
134
|
+
throw op[1];
|
|
135
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function __values(o) {
|
|
139
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
140
|
+
if (m)
|
|
141
|
+
return m.call(o);
|
|
142
|
+
if (o && typeof o.length === "number")
|
|
143
|
+
return {
|
|
144
|
+
next: function() {
|
|
145
|
+
if (o && i >= o.length)
|
|
146
|
+
o = void 0;
|
|
147
|
+
return { value: o && o[i++], done: !o };
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
151
|
+
}
|
|
152
|
+
function __read(o, n) {
|
|
153
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
154
|
+
if (!m)
|
|
155
|
+
return o;
|
|
156
|
+
var i = m.call(o), r, ar = [], e;
|
|
157
|
+
try {
|
|
158
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
159
|
+
ar.push(r.value);
|
|
160
|
+
} catch (error) {
|
|
161
|
+
e = { error };
|
|
162
|
+
} finally {
|
|
163
|
+
try {
|
|
164
|
+
if (r && !r.done && (m = i["return"]))
|
|
165
|
+
m.call(i);
|
|
166
|
+
} finally {
|
|
167
|
+
if (e)
|
|
168
|
+
throw e.error;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return ar;
|
|
172
|
+
}
|
|
173
|
+
function __spreadArray(to2, from, pack) {
|
|
174
|
+
if (pack || arguments.length === 2)
|
|
175
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
176
|
+
if (ar || !(i in from)) {
|
|
177
|
+
if (!ar)
|
|
178
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
179
|
+
ar[i] = from[i];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return to2.concat(ar || Array.prototype.slice.call(from));
|
|
183
|
+
}
|
|
50
184
|
function mergeLocale(base2, patch) {
|
|
51
185
|
function merge2(a, b) {
|
|
52
186
|
if (typeof a !== "object" || typeof b !== "object" || Array.isArray(a) || Array.isArray(b)) {
|
|
@@ -191,6 +325,9 @@ const base = {
|
|
|
191
325
|
},
|
|
192
326
|
Switch: {
|
|
193
327
|
name: "Switch"
|
|
328
|
+
},
|
|
329
|
+
Selector: {
|
|
330
|
+
name: "Selector"
|
|
194
331
|
}
|
|
195
332
|
};
|
|
196
333
|
const typeTemplate$1 = "${label}\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684${type}";
|
|
@@ -322,6 +459,9 @@ const zhCN = mergeLocale(base, {
|
|
|
322
459
|
},
|
|
323
460
|
Switch: {
|
|
324
461
|
name: "\u5F00\u5173"
|
|
462
|
+
},
|
|
463
|
+
Selector: {
|
|
464
|
+
name: "\u9009\u62E9\u7EC4"
|
|
325
465
|
}
|
|
326
466
|
});
|
|
327
467
|
const zhCN$1 = zhCN;
|
|
@@ -884,36 +1024,48 @@ function mergeProps(...items) {
|
|
|
884
1024
|
return ret;
|
|
885
1025
|
}
|
|
886
1026
|
const popup = "";
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
isMounted.current
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1027
|
+
var createUpdateEffect = function(hook) {
|
|
1028
|
+
return function(effect, deps) {
|
|
1029
|
+
var isMounted = useRef(false);
|
|
1030
|
+
hook(function() {
|
|
1031
|
+
return function() {
|
|
1032
|
+
isMounted.current = false;
|
|
1033
|
+
};
|
|
1034
|
+
}, []);
|
|
1035
|
+
hook(function() {
|
|
1036
|
+
if (!isMounted.current) {
|
|
1037
|
+
isMounted.current = true;
|
|
1038
|
+
} else {
|
|
1039
|
+
return effect();
|
|
1040
|
+
}
|
|
1041
|
+
}, deps);
|
|
1042
|
+
};
|
|
1043
|
+
};
|
|
1044
|
+
var isFunction$1 = function(value) {
|
|
1045
|
+
return typeof value === "function";
|
|
901
1046
|
};
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
1047
|
+
var isNumber = function(value) {
|
|
1048
|
+
return typeof value === "number";
|
|
1049
|
+
};
|
|
1050
|
+
var isDev$1 = true;
|
|
905
1051
|
const isDev$2 = isDev$1;
|
|
906
1052
|
function useMemoizedFn(fn) {
|
|
907
1053
|
if (isDev$2) {
|
|
908
1054
|
if (!isFunction$1(fn)) {
|
|
909
|
-
console.error(
|
|
1055
|
+
console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof fn));
|
|
910
1056
|
}
|
|
911
1057
|
}
|
|
912
|
-
|
|
913
|
-
fnRef.current = useMemo(()
|
|
914
|
-
|
|
1058
|
+
var fnRef = useRef(fn);
|
|
1059
|
+
fnRef.current = useMemo(function() {
|
|
1060
|
+
return fn;
|
|
1061
|
+
}, [fn]);
|
|
1062
|
+
var memoizedFn = useRef();
|
|
915
1063
|
if (!memoizedFn.current) {
|
|
916
|
-
memoizedFn.current = function(
|
|
1064
|
+
memoizedFn.current = function() {
|
|
1065
|
+
var args = [];
|
|
1066
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1067
|
+
args[_i] = arguments[_i];
|
|
1068
|
+
}
|
|
917
1069
|
return fnRef.current.apply(this, args);
|
|
918
1070
|
};
|
|
919
1071
|
}
|
|
@@ -923,26 +1075,28 @@ const useUpdateEffect = createUpdateEffect(useEffect);
|
|
|
923
1075
|
function depsAreSame(oldDeps, deps) {
|
|
924
1076
|
if (oldDeps === deps)
|
|
925
1077
|
return true;
|
|
926
|
-
for (
|
|
1078
|
+
for (var i = 0; i < oldDeps.length; i++) {
|
|
927
1079
|
if (!Object.is(oldDeps[i], deps[i]))
|
|
928
1080
|
return false;
|
|
929
1081
|
}
|
|
930
1082
|
return true;
|
|
931
1083
|
}
|
|
932
1084
|
function useLatest(value) {
|
|
933
|
-
|
|
1085
|
+
var ref = useRef(value);
|
|
934
1086
|
ref.current = value;
|
|
935
1087
|
return ref;
|
|
936
1088
|
}
|
|
937
|
-
|
|
1089
|
+
var useUnmount = function(fn) {
|
|
938
1090
|
if (isDev$2) {
|
|
939
1091
|
if (!isFunction$1(fn)) {
|
|
940
|
-
console.error(
|
|
1092
|
+
console.error("useUnmount expected parameter is a function, got ".concat(typeof fn));
|
|
941
1093
|
}
|
|
942
1094
|
}
|
|
943
|
-
|
|
944
|
-
useEffect(()
|
|
945
|
-
|
|
1095
|
+
var fnRef = useLatest(fn);
|
|
1096
|
+
useEffect(function() {
|
|
1097
|
+
return function() {
|
|
1098
|
+
fnRef.current();
|
|
1099
|
+
};
|
|
946
1100
|
}, []);
|
|
947
1101
|
};
|
|
948
1102
|
const useUnmount$1 = useUnmount;
|
|
@@ -1081,7 +1235,7 @@ function debounce$1(func, wait, options) {
|
|
|
1081
1235
|
return debounced;
|
|
1082
1236
|
}
|
|
1083
1237
|
var debounce_1 = debounce$1;
|
|
1084
|
-
|
|
1238
|
+
var isBrowser$2 = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
1085
1239
|
const isBrowser$3 = isBrowser$2;
|
|
1086
1240
|
var debounce = debounce_1, isObject$5 = isObject_1;
|
|
1087
1241
|
var FUNC_ERROR_TEXT$1 = "Expected a function";
|
|
@@ -1101,20 +1255,22 @@ function throttle$1(func, wait, options) {
|
|
|
1101
1255
|
});
|
|
1102
1256
|
}
|
|
1103
1257
|
var throttle_1 = throttle$1;
|
|
1104
|
-
|
|
1258
|
+
var useMount = function(fn) {
|
|
1105
1259
|
if (isDev$2) {
|
|
1106
1260
|
if (!isFunction$1(fn)) {
|
|
1107
|
-
console.error(
|
|
1261
|
+
console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof fn, '".'));
|
|
1108
1262
|
}
|
|
1109
1263
|
}
|
|
1110
|
-
useEffect(()
|
|
1264
|
+
useEffect(function() {
|
|
1111
1265
|
fn === null || fn === void 0 ? void 0 : fn();
|
|
1112
1266
|
}, []);
|
|
1113
1267
|
};
|
|
1114
1268
|
const useMount$1 = useMount;
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
return useCallback(()
|
|
1269
|
+
var useUpdate = function() {
|
|
1270
|
+
var _a = __read(useState$1({}), 2), setState = _a[1];
|
|
1271
|
+
return useCallback(function() {
|
|
1272
|
+
return setState({});
|
|
1273
|
+
}, []);
|
|
1118
1274
|
};
|
|
1119
1275
|
const useUpdate$1 = useUpdate;
|
|
1120
1276
|
function getTargetElement(target, defaultElement) {
|
|
@@ -1124,7 +1280,7 @@ function getTargetElement(target, defaultElement) {
|
|
|
1124
1280
|
if (!target) {
|
|
1125
1281
|
return defaultElement;
|
|
1126
1282
|
}
|
|
1127
|
-
|
|
1283
|
+
var targetElement;
|
|
1128
1284
|
if (isFunction$1(target)) {
|
|
1129
1285
|
targetElement = target();
|
|
1130
1286
|
} else if ("current" in target) {
|
|
@@ -1134,42 +1290,44 @@ function getTargetElement(target, defaultElement) {
|
|
|
1134
1290
|
}
|
|
1135
1291
|
return targetElement;
|
|
1136
1292
|
}
|
|
1137
|
-
|
|
1138
|
-
return targets.every((item)
|
|
1139
|
-
|
|
1293
|
+
var checkIfAllInShadow = function(targets) {
|
|
1294
|
+
return targets.every(function(item) {
|
|
1295
|
+
var targetElement = getTargetElement(item);
|
|
1140
1296
|
if (!targetElement)
|
|
1141
1297
|
return false;
|
|
1142
1298
|
if (targetElement.getRootNode() instanceof ShadowRoot)
|
|
1143
1299
|
return true;
|
|
1144
1300
|
});
|
|
1145
1301
|
};
|
|
1146
|
-
|
|
1302
|
+
var getShadow = function(node) {
|
|
1147
1303
|
if (!node) {
|
|
1148
1304
|
return document;
|
|
1149
1305
|
}
|
|
1150
1306
|
return node.getRootNode();
|
|
1151
1307
|
};
|
|
1152
|
-
|
|
1308
|
+
var getDocumentOrShadow = function(target) {
|
|
1153
1309
|
if (!target || !document.getRootNode) {
|
|
1154
1310
|
return document;
|
|
1155
1311
|
}
|
|
1156
|
-
|
|
1312
|
+
var targets = Array.isArray(target) ? target : [target];
|
|
1157
1313
|
if (checkIfAllInShadow(targets)) {
|
|
1158
1314
|
return getShadow(getTargetElement(targets[0]));
|
|
1159
1315
|
}
|
|
1160
1316
|
return document;
|
|
1161
1317
|
};
|
|
1162
1318
|
const getDocumentOrShadow$1 = getDocumentOrShadow;
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
useEffectType(()
|
|
1319
|
+
var createEffectWithTarget = function(useEffectType) {
|
|
1320
|
+
var useEffectWithTarget2 = function(effect, deps, target) {
|
|
1321
|
+
var hasInitRef = useRef(false);
|
|
1322
|
+
var lastElementRef = useRef([]);
|
|
1323
|
+
var lastDepsRef = useRef([]);
|
|
1324
|
+
var unLoadRef = useRef();
|
|
1325
|
+
useEffectType(function() {
|
|
1170
1326
|
var _a;
|
|
1171
|
-
|
|
1172
|
-
|
|
1327
|
+
var targets = Array.isArray(target) ? target : [target];
|
|
1328
|
+
var els = targets.map(function(item) {
|
|
1329
|
+
return getTargetElement(item);
|
|
1330
|
+
});
|
|
1173
1331
|
if (!hasInitRef.current) {
|
|
1174
1332
|
hasInitRef.current = true;
|
|
1175
1333
|
lastElementRef.current = els;
|
|
@@ -1184,7 +1342,7 @@ const createEffectWithTarget = (useEffectType) => {
|
|
|
1184
1342
|
unLoadRef.current = effect();
|
|
1185
1343
|
}
|
|
1186
1344
|
});
|
|
1187
|
-
useUnmount$1(()
|
|
1345
|
+
useUnmount$1(function() {
|
|
1188
1346
|
var _a;
|
|
1189
1347
|
(_a = unLoadRef.current) === null || _a === void 0 ? void 0 : _a.call(unLoadRef);
|
|
1190
1348
|
hasInitRef.current = false;
|
|
@@ -1193,26 +1351,33 @@ const createEffectWithTarget = (useEffectType) => {
|
|
|
1193
1351
|
return useEffectWithTarget2;
|
|
1194
1352
|
};
|
|
1195
1353
|
const createEffectWithTarget$1 = createEffectWithTarget;
|
|
1196
|
-
|
|
1354
|
+
var useEffectWithTarget$1 = createEffectWithTarget$1(useEffect);
|
|
1197
1355
|
const useEffectWithTarget$2 = useEffectWithTarget$1;
|
|
1198
|
-
function useClickAway(onClickAway, target, eventName
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1356
|
+
function useClickAway(onClickAway, target, eventName) {
|
|
1357
|
+
if (eventName === void 0) {
|
|
1358
|
+
eventName = "click";
|
|
1359
|
+
}
|
|
1360
|
+
var onClickAwayRef = useLatest(onClickAway);
|
|
1361
|
+
useEffectWithTarget$2(function() {
|
|
1362
|
+
var handler = function(event) {
|
|
1363
|
+
var targets = Array.isArray(target) ? target : [target];
|
|
1364
|
+
if (targets.some(function(item) {
|
|
1365
|
+
var targetElement = getTargetElement(item);
|
|
1205
1366
|
return !targetElement || targetElement.contains(event.target);
|
|
1206
1367
|
})) {
|
|
1207
1368
|
return;
|
|
1208
1369
|
}
|
|
1209
1370
|
onClickAwayRef.current(event);
|
|
1210
1371
|
};
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
eventNames.forEach((event)
|
|
1214
|
-
|
|
1215
|
-
|
|
1372
|
+
var documentOrShadow = getDocumentOrShadow$1(target);
|
|
1373
|
+
var eventNames = Array.isArray(eventName) ? eventName : [eventName];
|
|
1374
|
+
eventNames.forEach(function(event) {
|
|
1375
|
+
return documentOrShadow.addEventListener(event, handler);
|
|
1376
|
+
});
|
|
1377
|
+
return function() {
|
|
1378
|
+
eventNames.forEach(function(event) {
|
|
1379
|
+
return documentOrShadow.removeEventListener(event, handler);
|
|
1380
|
+
});
|
|
1216
1381
|
};
|
|
1217
1382
|
}, Array.isArray(eventName) ? eventName : [eventName], target);
|
|
1218
1383
|
}
|
|
@@ -1429,15 +1594,21 @@ function useDebounceFn(fn, options) {
|
|
|
1429
1594
|
var _a;
|
|
1430
1595
|
if (isDev$2) {
|
|
1431
1596
|
if (!isFunction$1(fn)) {
|
|
1432
|
-
console.error(
|
|
1597
|
+
console.error("useDebounceFn expected parameter is a function, got ".concat(typeof fn));
|
|
1433
1598
|
}
|
|
1434
1599
|
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
return
|
|
1439
|
-
|
|
1440
|
-
|
|
1600
|
+
var fnRef = useLatest(fn);
|
|
1601
|
+
var wait = (_a = options === null || options === void 0 ? void 0 : options.wait) !== null && _a !== void 0 ? _a : 1e3;
|
|
1602
|
+
var debounced = useMemo(function() {
|
|
1603
|
+
return debounce_1(function() {
|
|
1604
|
+
var args = [];
|
|
1605
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1606
|
+
args[_i] = arguments[_i];
|
|
1607
|
+
}
|
|
1608
|
+
return fnRef.current.apply(fnRef, __spreadArray([], __read(args), false));
|
|
1609
|
+
}, wait, options);
|
|
1610
|
+
}, []);
|
|
1611
|
+
useUnmount$1(function() {
|
|
1441
1612
|
debounced.cancel();
|
|
1442
1613
|
});
|
|
1443
1614
|
return {
|
|
@@ -1447,13 +1618,11 @@ function useDebounceFn(fn, options) {
|
|
|
1447
1618
|
};
|
|
1448
1619
|
}
|
|
1449
1620
|
function useDebounceEffect(effect, deps, options) {
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
run
|
|
1453
|
-
} = useDebounceFn(() => {
|
|
1621
|
+
var _a = __read(useState$1({}), 2), flag = _a[0], setFlag = _a[1];
|
|
1622
|
+
var run = useDebounceFn(function() {
|
|
1454
1623
|
setFlag({});
|
|
1455
|
-
}, options);
|
|
1456
|
-
useEffect(()
|
|
1624
|
+
}, options).run;
|
|
1625
|
+
useEffect(function() {
|
|
1457
1626
|
return run();
|
|
1458
1627
|
}, deps);
|
|
1459
1628
|
useUpdateEffect(effect, [flag]);
|
|
@@ -2575,65 +2744,100 @@ var isEqual_1 = isEqual$1;
|
|
|
2575
2744
|
window.IntersectionObserverEntry = IntersectionObserverEntry;
|
|
2576
2745
|
})();
|
|
2577
2746
|
function useInViewport(target, options) {
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
useEffectWithTarget$2(()
|
|
2581
|
-
|
|
2747
|
+
var _a = __read(useState$1(), 2), state = _a[0], setState = _a[1];
|
|
2748
|
+
var _b = __read(useState$1(), 2), ratio = _b[0], setRatio = _b[1];
|
|
2749
|
+
useEffectWithTarget$2(function() {
|
|
2750
|
+
var el = getTargetElement(target);
|
|
2582
2751
|
if (!el) {
|
|
2583
2752
|
return;
|
|
2584
2753
|
}
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2754
|
+
var observer = new IntersectionObserver(function(entries) {
|
|
2755
|
+
var e_1, _a2;
|
|
2756
|
+
try {
|
|
2757
|
+
for (var entries_1 = __values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {
|
|
2758
|
+
var entry = entries_1_1.value;
|
|
2759
|
+
setRatio(entry.intersectionRatio);
|
|
2760
|
+
setState(entry.isIntersecting);
|
|
2761
|
+
}
|
|
2762
|
+
} catch (e_1_1) {
|
|
2763
|
+
e_1 = {
|
|
2764
|
+
error: e_1_1
|
|
2765
|
+
};
|
|
2766
|
+
} finally {
|
|
2767
|
+
try {
|
|
2768
|
+
if (entries_1_1 && !entries_1_1.done && (_a2 = entries_1.return))
|
|
2769
|
+
_a2.call(entries_1);
|
|
2770
|
+
} finally {
|
|
2771
|
+
if (e_1)
|
|
2772
|
+
throw e_1.error;
|
|
2773
|
+
}
|
|
2589
2774
|
}
|
|
2590
|
-
},
|
|
2775
|
+
}, __assign(__assign({}, options), {
|
|
2591
2776
|
root: getTargetElement(options === null || options === void 0 ? void 0 : options.root)
|
|
2592
2777
|
}));
|
|
2593
2778
|
observer.observe(el);
|
|
2594
|
-
return ()
|
|
2779
|
+
return function() {
|
|
2595
2780
|
observer.disconnect();
|
|
2596
2781
|
};
|
|
2597
2782
|
}, [options === null || options === void 0 ? void 0 : options.rootMargin, options === null || options === void 0 ? void 0 : options.threshold], target);
|
|
2598
2783
|
return [state, ratio];
|
|
2599
2784
|
}
|
|
2600
|
-
|
|
2785
|
+
var useIsomorphicLayoutEffect$1 = isBrowser$3 ? useLayoutEffect$2 : useEffect;
|
|
2601
2786
|
const useIsomorphicLayoutEffect$2 = useIsomorphicLayoutEffect$1;
|
|
2602
2787
|
function useLockFn(fn) {
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2788
|
+
var _this = this;
|
|
2789
|
+
var lockRef = useRef(false);
|
|
2790
|
+
return useCallback(function() {
|
|
2791
|
+
var args = [];
|
|
2792
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2793
|
+
args[_i] = arguments[_i];
|
|
2794
|
+
}
|
|
2795
|
+
return __awaiter(_this, void 0, void 0, function() {
|
|
2796
|
+
var ret, e_1;
|
|
2797
|
+
return __generator(this, function(_a) {
|
|
2798
|
+
switch (_a.label) {
|
|
2799
|
+
case 0:
|
|
2800
|
+
if (lockRef.current)
|
|
2801
|
+
return [2];
|
|
2802
|
+
lockRef.current = true;
|
|
2803
|
+
_a.label = 1;
|
|
2804
|
+
case 1:
|
|
2805
|
+
_a.trys.push([1, 3, , 4]);
|
|
2806
|
+
return [4, fn.apply(void 0, __spreadArray([], __read(args), false))];
|
|
2807
|
+
case 2:
|
|
2808
|
+
ret = _a.sent();
|
|
2809
|
+
lockRef.current = false;
|
|
2810
|
+
return [2, ret];
|
|
2811
|
+
case 3:
|
|
2812
|
+
e_1 = _a.sent();
|
|
2813
|
+
lockRef.current = false;
|
|
2814
|
+
throw e_1;
|
|
2815
|
+
case 4:
|
|
2816
|
+
return [2];
|
|
2817
|
+
}
|
|
2818
|
+
});
|
|
2819
|
+
});
|
|
2820
|
+
}, [fn]);
|
|
2617
2821
|
}
|
|
2618
2822
|
function useRafState(initialState) {
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2823
|
+
var ref = useRef(0);
|
|
2824
|
+
var _a = __read(useState$1(initialState), 2), state = _a[0], setState = _a[1];
|
|
2825
|
+
var setRafState = useCallback(function(value) {
|
|
2622
2826
|
cancelAnimationFrame(ref.current);
|
|
2623
|
-
ref.current = requestAnimationFrame(()
|
|
2827
|
+
ref.current = requestAnimationFrame(function() {
|
|
2624
2828
|
setState(value);
|
|
2625
2829
|
});
|
|
2626
2830
|
}, []);
|
|
2627
|
-
useUnmount$1(()
|
|
2831
|
+
useUnmount$1(function() {
|
|
2628
2832
|
cancelAnimationFrame(ref.current);
|
|
2629
2833
|
});
|
|
2630
2834
|
return [state, setRafState];
|
|
2631
2835
|
}
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
useEffect(()
|
|
2836
|
+
var useUnmountedRef = function() {
|
|
2837
|
+
var unmountedRef = useRef(false);
|
|
2838
|
+
useEffect(function() {
|
|
2635
2839
|
unmountedRef.current = false;
|
|
2636
|
-
return ()
|
|
2840
|
+
return function() {
|
|
2637
2841
|
unmountedRef.current = true;
|
|
2638
2842
|
};
|
|
2639
2843
|
}, []);
|
|
@@ -3111,29 +3315,26 @@ var index$k = function() {
|
|
|
3111
3315
|
}
|
|
3112
3316
|
return ResizeObserver$1;
|
|
3113
3317
|
}();
|
|
3114
|
-
|
|
3318
|
+
var useEffectWithTarget = createEffectWithTarget$1(useLayoutEffect$2);
|
|
3115
3319
|
const useLayoutEffectWithTarget = useEffectWithTarget;
|
|
3116
|
-
|
|
3320
|
+
var useIsomorphicLayoutEffectWithTarget = isBrowser$3 ? useLayoutEffectWithTarget : useEffectWithTarget$2;
|
|
3117
3321
|
const useIsomorphicLayoutEffectWithTarget$1 = useIsomorphicLayoutEffectWithTarget;
|
|
3118
3322
|
function useSize(target) {
|
|
3119
|
-
|
|
3120
|
-
|
|
3323
|
+
var _a = __read(useRafState(function() {
|
|
3324
|
+
var el = getTargetElement(target);
|
|
3121
3325
|
return el ? {
|
|
3122
3326
|
width: el.clientWidth,
|
|
3123
3327
|
height: el.clientHeight
|
|
3124
3328
|
} : void 0;
|
|
3125
|
-
});
|
|
3126
|
-
useIsomorphicLayoutEffectWithTarget$1(()
|
|
3127
|
-
|
|
3329
|
+
}), 2), state = _a[0], setState = _a[1];
|
|
3330
|
+
useIsomorphicLayoutEffectWithTarget$1(function() {
|
|
3331
|
+
var el = getTargetElement(target);
|
|
3128
3332
|
if (!el) {
|
|
3129
3333
|
return;
|
|
3130
3334
|
}
|
|
3131
|
-
|
|
3132
|
-
entries.forEach((entry)
|
|
3133
|
-
|
|
3134
|
-
clientWidth,
|
|
3135
|
-
clientHeight
|
|
3136
|
-
} = entry.target;
|
|
3335
|
+
var resizeObserver = new index$k(function(entries) {
|
|
3336
|
+
entries.forEach(function(entry) {
|
|
3337
|
+
var _a2 = entry.target, clientWidth = _a2.clientWidth, clientHeight = _a2.clientHeight;
|
|
3137
3338
|
setState({
|
|
3138
3339
|
width: clientWidth,
|
|
3139
3340
|
height: clientHeight
|
|
@@ -3141,7 +3342,7 @@ function useSize(target) {
|
|
|
3141
3342
|
});
|
|
3142
3343
|
});
|
|
3143
3344
|
resizeObserver.observe(el);
|
|
3144
|
-
return ()
|
|
3345
|
+
return function() {
|
|
3145
3346
|
resizeObserver.disconnect();
|
|
3146
3347
|
};
|
|
3147
3348
|
}, [], target);
|
|
@@ -3151,15 +3352,21 @@ function useThrottleFn(fn, options) {
|
|
|
3151
3352
|
var _a;
|
|
3152
3353
|
if (isDev$2) {
|
|
3153
3354
|
if (!isFunction$1(fn)) {
|
|
3154
|
-
console.error(
|
|
3355
|
+
console.error("useThrottleFn expected parameter is a function, got ".concat(typeof fn));
|
|
3155
3356
|
}
|
|
3156
3357
|
}
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
return
|
|
3161
|
-
|
|
3162
|
-
|
|
3358
|
+
var fnRef = useLatest(fn);
|
|
3359
|
+
var wait = (_a = options === null || options === void 0 ? void 0 : options.wait) !== null && _a !== void 0 ? _a : 1e3;
|
|
3360
|
+
var throttled = useMemo(function() {
|
|
3361
|
+
return throttle_1(function() {
|
|
3362
|
+
var args = [];
|
|
3363
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3364
|
+
args[_i] = arguments[_i];
|
|
3365
|
+
}
|
|
3366
|
+
return fnRef.current.apply(fnRef, __spreadArray([], __read(args), false));
|
|
3367
|
+
}, wait, options);
|
|
3368
|
+
}, []);
|
|
3369
|
+
useUnmount$1(function() {
|
|
3163
3370
|
throttled.cancel();
|
|
3164
3371
|
});
|
|
3165
3372
|
return {
|
|
@@ -3168,29 +3375,24 @@ function useThrottleFn(fn, options) {
|
|
|
3168
3375
|
flush: throttled.flush
|
|
3169
3376
|
};
|
|
3170
3377
|
}
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
if (!isNumber(delay) || delay < 0) {
|
|
3176
|
-
return;
|
|
3177
|
-
}
|
|
3178
|
-
timerRef.current = setTimeout(() => {
|
|
3179
|
-
fnRef.current();
|
|
3180
|
-
}, delay);
|
|
3181
|
-
return () => {
|
|
3182
|
-
if (timerRef.current) {
|
|
3183
|
-
clearTimeout(timerRef.current);
|
|
3184
|
-
}
|
|
3185
|
-
};
|
|
3186
|
-
}, [delay]);
|
|
3187
|
-
const clear2 = useCallback(() => {
|
|
3378
|
+
var useTimeout = function(fn, delay) {
|
|
3379
|
+
var timerCallback = useMemoizedFn(fn);
|
|
3380
|
+
var timerRef = useRef(null);
|
|
3381
|
+
var clear2 = useCallback(function() {
|
|
3188
3382
|
if (timerRef.current) {
|
|
3189
3383
|
clearTimeout(timerRef.current);
|
|
3190
3384
|
}
|
|
3191
3385
|
}, []);
|
|
3386
|
+
useEffect(function() {
|
|
3387
|
+
if (!isNumber(delay) || delay < 0) {
|
|
3388
|
+
return;
|
|
3389
|
+
}
|
|
3390
|
+
timerRef.current = setTimeout(timerCallback, delay);
|
|
3391
|
+
return clear2;
|
|
3392
|
+
}, [delay]);
|
|
3192
3393
|
return clear2;
|
|
3193
|
-
}
|
|
3394
|
+
};
|
|
3395
|
+
const useTimeout$1 = useTimeout;
|
|
3194
3396
|
const mask = "";
|
|
3195
3397
|
const MIN_DISTANCE = 10;
|
|
3196
3398
|
function getDirection(x, y) {
|
|
@@ -7575,13 +7777,17 @@ const ActionSheet = (p) => {
|
|
|
7575
7777
|
if (props.closeOnAction) {
|
|
7576
7778
|
(_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
7577
7779
|
}
|
|
7578
|
-
}
|
|
7780
|
+
},
|
|
7781
|
+
role: "option",
|
|
7782
|
+
"aria-disabled": action.disabled
|
|
7579
7783
|
}, React__default.createElement("div", {
|
|
7580
7784
|
className: `${classPrefix$1i}-button-item-name`
|
|
7581
7785
|
}, action.text), action.description && React__default.createElement("div", {
|
|
7582
7786
|
className: `${classPrefix$1i}-button-item-description`
|
|
7583
7787
|
}, action.description))))), props.cancelText && React__default.createElement("div", {
|
|
7584
|
-
className: `${classPrefix$1i}-cancel
|
|
7788
|
+
className: `${classPrefix$1i}-cancel`,
|
|
7789
|
+
role: "option",
|
|
7790
|
+
"aria-label": props.cancelText
|
|
7585
7791
|
}, React__default.createElement("div", {
|
|
7586
7792
|
className: `${classPrefix$1i}-button-item-wrapper`
|
|
7587
7793
|
}, React__default.createElement("a", {
|
|
@@ -7806,7 +8012,8 @@ const Avatar$1 = (p) => {
|
|
|
7806
8012
|
lazy: props.lazy,
|
|
7807
8013
|
fit: props.fit,
|
|
7808
8014
|
onClick: props.onClick,
|
|
7809
|
-
onError: props.onError
|
|
8015
|
+
onError: props.onError,
|
|
8016
|
+
onLoad: props.onLoad
|
|
7810
8017
|
}));
|
|
7811
8018
|
};
|
|
7812
8019
|
const Avatar = Avatar$1;
|
|
@@ -11558,7 +11765,8 @@ const Tabs$1 = (p) => {
|
|
|
11558
11765
|
className: `${classPrefix$13}-tab-list`,
|
|
11559
11766
|
ref: tabListContainerRef,
|
|
11560
11767
|
scrollLeft,
|
|
11561
|
-
onScroll: updateMask
|
|
11768
|
+
onScroll: updateMask,
|
|
11769
|
+
role: "tablist"
|
|
11562
11770
|
}, React__default.createElement(animated.div, {
|
|
11563
11771
|
ref: activeLineRef,
|
|
11564
11772
|
className: `${classPrefix$13}-tab-line`,
|
|
@@ -11586,7 +11794,9 @@ const Tabs$1 = (p) => {
|
|
|
11586
11794
|
className: classNames(`${classPrefix$13}-tab`, {
|
|
11587
11795
|
[`${classPrefix$13}-tab-active`]: pane.key === activeKey,
|
|
11588
11796
|
[`${classPrefix$13}-tab-disabled`]: pane.props.disabled
|
|
11589
|
-
})
|
|
11797
|
+
}),
|
|
11798
|
+
role: "tab",
|
|
11799
|
+
"aria-selected": pane.key === activeKey
|
|
11590
11800
|
}, pane.props.title)))))), panes.map((pane) => {
|
|
11591
11801
|
if (pane.props.children === void 0) {
|
|
11592
11802
|
return null;
|
|
@@ -11686,6 +11896,7 @@ const CheckList$1 = (p) => {
|
|
|
11686
11896
|
}
|
|
11687
11897
|
const {
|
|
11688
11898
|
activeIcon,
|
|
11899
|
+
extra,
|
|
11689
11900
|
disabled,
|
|
11690
11901
|
readOnly
|
|
11691
11902
|
} = props;
|
|
@@ -11695,6 +11906,7 @@ const CheckList$1 = (p) => {
|
|
|
11695
11906
|
check,
|
|
11696
11907
|
uncheck,
|
|
11697
11908
|
activeIcon,
|
|
11909
|
+
extra,
|
|
11698
11910
|
disabled,
|
|
11699
11911
|
readOnly
|
|
11700
11912
|
}
|
|
@@ -11712,9 +11924,11 @@ const CheckListItem = (props) => {
|
|
|
11712
11924
|
}
|
|
11713
11925
|
const active = context.value.includes(props.value);
|
|
11714
11926
|
const readOnly = props.readOnly || context.readOnly;
|
|
11927
|
+
const defaultExtra = active ? context.activeIcon : null;
|
|
11928
|
+
const renderExtra = context.extra ? context.extra(active) : defaultExtra;
|
|
11715
11929
|
const extra = React__default.createElement("div", {
|
|
11716
11930
|
className: `${classPrefix$$}-extra`
|
|
11717
|
-
},
|
|
11931
|
+
}, renderExtra);
|
|
11718
11932
|
return withNativeProps(props, React__default.createElement(List$1.Item, {
|
|
11719
11933
|
title: props.title,
|
|
11720
11934
|
className: classNames(classPrefix$$, readOnly && `${classPrefix$$}-readonly`, active && `${classPrefix$$}-active`),
|
|
@@ -13505,7 +13719,7 @@ const Ellipsis$1 = (p) => {
|
|
|
13505
13719
|
setExpanded(true);
|
|
13506
13720
|
}
|
|
13507
13721
|
}, props.expandText)) : null;
|
|
13508
|
-
const collapseActionElement = exceeded && props.
|
|
13722
|
+
const collapseActionElement = exceeded && props.collapseText ? withStopPropagation(props.stopPropagationForActionButtons, React__default.createElement("a", {
|
|
13509
13723
|
onClick: () => {
|
|
13510
13724
|
setExpanded(false);
|
|
13511
13725
|
}
|
|
@@ -18860,22 +19074,6 @@ const computePosition$1 = async (reference, floating, config2) => {
|
|
|
18860
19074
|
} = config2;
|
|
18861
19075
|
const validMiddleware = middleware.filter(Boolean);
|
|
18862
19076
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
18863
|
-
{
|
|
18864
|
-
if (platform2 == null) {
|
|
18865
|
-
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(" "));
|
|
18866
|
-
}
|
|
18867
|
-
if (validMiddleware.filter((_ref) => {
|
|
18868
|
-
let {
|
|
18869
|
-
name
|
|
18870
|
-
} = _ref;
|
|
18871
|
-
return name === "autoPlacement" || name === "flip";
|
|
18872
|
-
}).length > 1) {
|
|
18873
|
-
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(" "));
|
|
18874
|
-
}
|
|
18875
|
-
if (!reference || !floating) {
|
|
18876
|
-
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(" "));
|
|
18877
|
-
}
|
|
18878
|
-
}
|
|
18879
19077
|
let rects = await platform2.getElementRects({
|
|
18880
19078
|
reference,
|
|
18881
19079
|
floating,
|
|
@@ -18921,11 +19119,6 @@ const computePosition$1 = async (reference, floating, config2) => {
|
|
|
18921
19119
|
...data
|
|
18922
19120
|
}
|
|
18923
19121
|
};
|
|
18924
|
-
{
|
|
18925
|
-
if (resetCount > 50) {
|
|
18926
|
-
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(" "));
|
|
18927
|
-
}
|
|
18928
|
-
}
|
|
18929
19122
|
if (reset && resetCount <= 50) {
|
|
18930
19123
|
resetCount++;
|
|
18931
19124
|
if (typeof reset === "object") {
|
|
@@ -19058,9 +19251,6 @@ const arrow = (options) => ({
|
|
|
19058
19251
|
elements
|
|
19059
19252
|
} = state;
|
|
19060
19253
|
if (element == null) {
|
|
19061
|
-
{
|
|
19062
|
-
console.warn("Floating UI: No `element` was passed to the `arrow` middleware.");
|
|
19063
|
-
}
|
|
19064
19254
|
return {};
|
|
19065
19255
|
}
|
|
19066
19256
|
const paddingObject = getSideObjectFromPadding(padding);
|
|
@@ -20220,7 +20410,7 @@ const Popover$1 = forwardRef((p, ref) => {
|
|
|
20220
20410
|
top: arrowY != null ? `${arrowY}px` : "",
|
|
20221
20411
|
right: "",
|
|
20222
20412
|
bottom: "",
|
|
20223
|
-
[arrowSide]:
|
|
20413
|
+
[arrowSide]: "calc(var(--arrow-size) * -1)"
|
|
20224
20414
|
});
|
|
20225
20415
|
const arrowRotate = {
|
|
20226
20416
|
top: "0deg",
|
|
@@ -22116,7 +22306,7 @@ const NoticeBar$1 = memo((p) => {
|
|
|
22116
22306
|
text.style.transitionDuration = `${Math.round(distance / speed)}s`;
|
|
22117
22307
|
text.style.transform = `translateX(-${text.offsetWidth}px)`;
|
|
22118
22308
|
}
|
|
22119
|
-
useTimeout(() => {
|
|
22309
|
+
useTimeout$1(() => {
|
|
22120
22310
|
delayLockRef.current = false;
|
|
22121
22311
|
start2();
|
|
22122
22312
|
}, props.delay);
|
|
@@ -22253,8 +22443,9 @@ const NumberKeyboard$1 = (p) => {
|
|
|
22253
22443
|
className: classNames(`${classPrefix$w}-header`, {
|
|
22254
22444
|
[`${classPrefix$w}-header-with-title`]: !!title
|
|
22255
22445
|
})
|
|
22256
|
-
},
|
|
22257
|
-
className: `${classPrefix$w}-title
|
|
22446
|
+
}, React__default.createElement("div", {
|
|
22447
|
+
className: `${classPrefix$w}-title`,
|
|
22448
|
+
"aria-label": title
|
|
22258
22449
|
}, title), showCloseButton && React__default.createElement("span", {
|
|
22259
22450
|
className: `${classPrefix$w}-header-close-button`,
|
|
22260
22451
|
onClick: () => {
|
|
@@ -22262,7 +22453,8 @@ const NumberKeyboard$1 = (p) => {
|
|
|
22262
22453
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
22263
22454
|
},
|
|
22264
22455
|
role: "button",
|
|
22265
|
-
title: "CLOSE"
|
|
22456
|
+
title: "CLOSE",
|
|
22457
|
+
tabIndex: -1
|
|
22266
22458
|
}, React__default.createElement(DownOutline, null)));
|
|
22267
22459
|
};
|
|
22268
22460
|
const renderKey = (key, index2) => {
|
|
@@ -22273,8 +22465,9 @@ const NumberKeyboard$1 = (p) => {
|
|
|
22273
22465
|
[`${classPrefix$w}-key-mid`]: index2 === 9 && !!confirmText && keys2.length < 12
|
|
22274
22466
|
});
|
|
22275
22467
|
const ariaProps = key ? {
|
|
22276
|
-
role: "
|
|
22277
|
-
title: key
|
|
22468
|
+
role: "grid",
|
|
22469
|
+
title: key,
|
|
22470
|
+
tabIndex: -1
|
|
22278
22471
|
} : void 0;
|
|
22279
22472
|
return React__default.createElement("div", Object.assign({
|
|
22280
22473
|
key,
|
|
@@ -22330,7 +22523,8 @@ const NumberKeyboard$1 = (p) => {
|
|
|
22330
22523
|
}, React__default.createElement(TextDeletionOutline, null)), React__default.createElement("div", {
|
|
22331
22524
|
className: `${classPrefix$w}-key ${classPrefix$w}-key-extra ${classPrefix$w}-key-ok`,
|
|
22332
22525
|
onTouchEnd: (e) => onKeyPress(e, "OK"),
|
|
22333
|
-
role: "button"
|
|
22526
|
+
role: "button",
|
|
22527
|
+
"aria-label": confirmText
|
|
22334
22528
|
}, confirmText))), props.safeArea && React__default.createElement("div", {
|
|
22335
22529
|
className: `${classPrefix$w}-footer`
|
|
22336
22530
|
}, React__default.createElement(SafeArea, {
|
|
@@ -23178,6 +23372,9 @@ const Selector$1 = (p) => {
|
|
|
23178
23372
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, val, extend);
|
|
23179
23373
|
}
|
|
23180
23374
|
});
|
|
23375
|
+
const {
|
|
23376
|
+
locale
|
|
23377
|
+
} = useConfig();
|
|
23181
23378
|
const items = props.options.map((option) => {
|
|
23182
23379
|
const active = (value || []).includes(option.value);
|
|
23183
23380
|
const disabled = option.disabled || props.disabled;
|
|
@@ -23200,7 +23397,9 @@ const Selector$1 = (p) => {
|
|
|
23200
23397
|
const val = active ? [] : [option.value];
|
|
23201
23398
|
setValue2(val);
|
|
23202
23399
|
}
|
|
23203
|
-
}
|
|
23400
|
+
},
|
|
23401
|
+
role: "option",
|
|
23402
|
+
"aria-selected": active && !props.multiple || active && props.multiple
|
|
23204
23403
|
}, option.label, option.description && React__default.createElement("div", {
|
|
23205
23404
|
className: `${classPrefix$k}-item-description`
|
|
23206
23405
|
}, option.description), active && props.showCheckMark && React__default.createElement("div", {
|
|
@@ -23208,7 +23407,9 @@ const Selector$1 = (p) => {
|
|
|
23208
23407
|
}, React__default.createElement(CheckMark, null)));
|
|
23209
23408
|
});
|
|
23210
23409
|
return withNativeProps(props, React__default.createElement("div", {
|
|
23211
|
-
className: classPrefix$k
|
|
23410
|
+
className: classPrefix$k,
|
|
23411
|
+
role: "listbox",
|
|
23412
|
+
"aria-label": locale.Selector.name
|
|
23212
23413
|
}, !props.columns && React__default.createElement(Space, {
|
|
23213
23414
|
wrap: true
|
|
23214
23415
|
}, items), props.columns && React__default.createElement(Grid, {
|
|
@@ -25756,6 +25957,9 @@ const VirtualInput$1 = forwardRef((p, ref) => {
|
|
|
25756
25957
|
const rootRef = useRef(null);
|
|
25757
25958
|
const contentRef = useRef(null);
|
|
25758
25959
|
const [hasFocus, setHasFocus] = useState$1(false);
|
|
25960
|
+
const {
|
|
25961
|
+
locale
|
|
25962
|
+
} = useConfig();
|
|
25759
25963
|
function scrollToEnd() {
|
|
25760
25964
|
const root2 = rootRef.current;
|
|
25761
25965
|
if (!root2)
|
|
@@ -25827,7 +26031,11 @@ const VirtualInput$1 = forwardRef((p, ref) => {
|
|
|
25827
26031
|
onClick: props.onClick
|
|
25828
26032
|
}, React__default.createElement("div", {
|
|
25829
26033
|
className: `${classPrefix$2}-content`,
|
|
25830
|
-
ref: contentRef
|
|
26034
|
+
ref: contentRef,
|
|
26035
|
+
role: "option",
|
|
26036
|
+
tabIndex: props.disabled ? void 0 : 0,
|
|
26037
|
+
"aria-disabled": props.disabled,
|
|
26038
|
+
"aria-label": props.placeholder
|
|
25831
26039
|
}, value, React__default.createElement("div", {
|
|
25832
26040
|
className: `${classPrefix$2}-caret-container`
|
|
25833
26041
|
}, hasFocus && React__default.createElement("div", {
|
|
@@ -25839,7 +26047,9 @@ const VirtualInput$1 = forwardRef((p, ref) => {
|
|
|
25839
26047
|
e.stopPropagation();
|
|
25840
26048
|
setValue2("");
|
|
25841
26049
|
(_a = props.onClear) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
25842
|
-
}
|
|
26050
|
+
},
|
|
26051
|
+
role: "button",
|
|
26052
|
+
"aria-label": locale.Input.clear
|
|
25843
26053
|
}, React__default.createElement(CloseCircleFill, null)), !value && React__default.createElement("div", {
|
|
25844
26054
|
className: `${classPrefix$2}-placeholder`
|
|
25845
26055
|
}, props.placeholder), keyboardElement));
|