bj-web-components 0.2.34 → 0.2.35
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/README.md +10 -1
- package/dist/index.js +58 -1
- package/dist/index.mjs +1 -29
- package/dist/miniapp.js +1 -1
- package/dist/miniapp.mjs +0 -1
- package/dist/mobile.js +1 -1
- package/dist/mobile.mjs +0 -1
- package/dist/react.js +1 -1
- package/dist/react.mjs +0 -1
- package/dist/shared.js +1 -1
- package/dist/shared.mjs +0 -1
- package/dist/style.css +1 -1
- package/dist/web/BasicInput/BInput.js +278 -1
- package/dist/web/BasicInput/BInput.mjs +263 -164
- package/dist/web/BasicInput/utils.js +47 -1
- package/dist/web/BasicInput/utils.mjs +22 -20
- package/dist/web/CategoryDropdown/CategoryDropdown.js +376 -1
- package/dist/web/CategoryDropdown/CategoryDropdown.mjs +355 -235
- package/dist/web/CheckBox/BCheckBox.js +176 -1
- package/dist/web/CheckBox/BCheckBox.mjs +169 -98
- package/dist/web/CheckBox/Group.js +111 -1
- package/dist/web/CheckBox/Group.mjs +104 -64
- package/dist/web/CheckBox/context.js +8 -1
- package/dist/web/CheckBox/context.mjs +2 -4
- package/dist/web/CheckBox/index.js +11 -1
- package/dist/web/CheckBox/index.mjs +2 -4
- package/dist/web/Dropdown/BDropdown.js +265 -1
- package/dist/web/Dropdown/BDropdown.mjs +234 -134
- package/dist/web/EmptyInputBox/EmptyInputBox.js +89 -1
- package/dist/web/EmptyInputBox/EmptyInputBox.mjs +85 -72
- package/dist/web/FileCard/FileCard.js +414 -1
- package/dist/web/FileCard/FileCard.mjs +400 -116
- package/dist/web/Icon/Icon.js +82 -1
- package/dist/web/Icon/Icon.mjs +78 -8
- package/dist/web/Input/Input.js +230 -1
- package/dist/web/Input/Input.mjs +219 -164
- package/dist/web/InputNumber/BInputNumber.js +271 -1
- package/dist/web/InputNumber/BInputNumber.mjs +254 -189
- package/dist/web/InputNumber/StepHandler.js +112 -1
- package/dist/web/InputNumber/StepHandler.mjs +102 -50
- package/dist/web/InputNumber/hooks/useCursor.js +38 -1
- package/dist/web/InputNumber/hooks/useCursor.mjs +31 -34
- package/dist/web/InputNumber/hooks/useFrame.js +15 -1
- package/dist/web/InputNumber/hooks/useFrame.mjs +8 -5
- package/dist/web/InputNumber/utils/decimal.js +163 -1
- package/dist/web/InputNumber/utils/decimal.mjs +114 -79
- package/dist/web/MobileDrawer/BMobileDrawer.js +238 -1
- package/dist/web/MobileDrawer/BMobileDrawer.mjs +221 -139
- package/dist/web/Modal/Modal.js +148 -1
- package/dist/web/Modal/Modal.mjs +143 -79
- package/dist/web/OverlayScrollbar/BOverlayScrollbar.js +273 -1
- package/dist/web/OverlayScrollbar/BOverlayScrollbar.mjs +262 -143
- package/dist/web/Pagination/Pagination.js +352 -1
- package/dist/web/Pagination/Pagination.mjs +342 -247
- package/dist/web/ProductField/ProductField.js +443 -1
- package/dist/web/ProductField/ProductField.mjs +423 -208
- package/dist/web/ProductField/arrow-up.svg.js +4 -1
- package/dist/web/ProductField/arrow-up.svg.mjs +2 -4
- package/dist/web/ProductField/checkbox-no.svg.js +4 -1
- package/dist/web/ProductField/checkbox-no.svg.mjs +2 -4
- package/dist/web/ProductField/checkbox-ok.svg.js +4 -1
- package/dist/web/ProductField/checkbox-ok.svg.mjs +2 -4
- package/dist/web/ProductField/no_data_light.svg.js +4 -1
- package/dist/web/ProductField/no_data_light.svg.mjs +2 -4
- package/dist/web/ProductField/search.svg.js +4 -1
- package/dist/web/ProductField/search.svg.mjs +2 -4
- package/dist/web/ProductField/sort.svg.js +4 -1
- package/dist/web/ProductField/sort.svg.mjs +2 -4
- package/dist/web/Radio/BRadio.js +151 -1
- package/dist/web/Radio/BRadio.mjs +147 -75
- package/dist/web/Radio/Button.js +54 -1
- package/dist/web/Radio/Button.mjs +51 -8
- package/dist/web/Radio/Group.js +97 -1
- package/dist/web/Radio/Group.mjs +92 -76
- package/dist/web/Radio/context.js +10 -1
- package/dist/web/Radio/context.mjs +3 -5
- package/dist/web/Radio/index.js +13 -1
- package/dist/web/Radio/index.mjs +2 -4
- package/dist/web/SkuInputCard/SkuInputCard.js +427 -1
- package/dist/web/SkuInputCard/SkuInputCard.mjs +414 -219
- package/dist/web/SkuInputCard/spin_loading_red.gif.js +4 -1
- package/dist/web/SkuInputCard/spin_loading_red.gif.mjs +2 -4
- package/dist/web/Switch/Switch.js +114 -1
- package/dist/web/Switch/Switch.mjs +109 -58
- package/dist/web/Table/BTable.js +1049 -1
- package/dist/web/Table/BTable.mjs +1011 -667
- package/dist/web/Table/Column.js +6 -1
- package/dist/web/Table/Column.mjs +1 -3
- package/dist/web/Table/ColumnGroup.js +6 -1
- package/dist/web/Table/ColumnGroup.mjs +1 -3
- package/dist/web/Table/utils/columns.js +116 -1
- package/dist/web/Table/utils/columns.mjs +103 -37
- package/dist/web/Table/utils/sortFilter.js +145 -1
- package/dist/web/Table/utils/sortFilter.mjs +129 -57
- package/dist/web/Tabs/BTabs.js +260 -1
- package/dist/web/Tabs/BTabs.mjs +239 -122
- package/dist/web/Tabs/TabPane.js +19 -1
- package/dist/web/Tabs/TabPane.mjs +1 -4
- package/dist/web/Tooltip/ConfirmTooltip.js +53 -1
- package/dist/web/Tooltip/ConfirmTooltip.mjs +47 -22
- package/dist/web/Tooltip/ContentTooltip.js +156 -1
- package/dist/web/Tooltip/ContentTooltip.mjs +145 -76
- package/dist/web/Tooltip/ProgressTooltip.js +56 -1
- package/dist/web/Tooltip/ProgressTooltip.mjs +50 -31
- package/dist/web/Tooltip/TooltipWrapper.js +19 -1
- package/dist/web/Tooltip/TooltipWrapper.mjs +13 -9
- package/dist/web/Tooltip/useAutoPlacement.js +65 -1
- package/dist/web/Tooltip/useAutoPlacement.mjs +52 -24
- package/dist/web.js +58 -1
- package/dist/web.mjs +1 -29
- package/package.json +97 -95
|
@@ -1,204 +1,269 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
|
+
import { jsxs as pe, jsx as l } from "react/jsx-runtime";
|
|
9
|
+
import { forwardRef as Me, useRef as d, useState as J, useCallback as L, useMemo as C } from "react";
|
|
3
10
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { getDecimal as i, getNumberPrecision as de, validateNumber as
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
+
import He from "./hooks/useCursor.mjs";
|
|
12
|
+
import We from "./hooks/useFrame.mjs";
|
|
13
|
+
import Ye from "./StepHandler.mjs";
|
|
14
|
+
import { getDecimal as i, getNumberPrecision as de, validateNumber as Ge, toFixed as Q, getDecupleSteps as ge } from "./utils/decimal.mjs";
|
|
15
|
+
function ve(j) {
|
|
16
|
+
if (j == null) return null;
|
|
17
|
+
var u = i(j);
|
|
11
18
|
return u.isInvalidate() ? null : u;
|
|
12
19
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
20
|
+
var Ae = Me(function (_ref, R) {
|
|
21
|
+
var u = _ref.value,
|
|
22
|
+
F = _ref.defaultValue,
|
|
23
|
+
X = _ref.onChange,
|
|
24
|
+
P = _ref.min,
|
|
25
|
+
U = _ref.max,
|
|
26
|
+
_ref$step = _ref.step,
|
|
27
|
+
c = _ref$step === void 0 ? 1 : _ref$step,
|
|
28
|
+
I = _ref.precision,
|
|
29
|
+
_ref$disabled = _ref.disabled,
|
|
30
|
+
x = _ref$disabled === void 0 ? !1 : _ref$disabled,
|
|
31
|
+
_ref$readOnly = _ref.readOnly,
|
|
32
|
+
K = _ref$readOnly === void 0 ? !1 : _ref$readOnly,
|
|
33
|
+
je = _ref.placeholder,
|
|
34
|
+
Ie = _ref.autoFocus,
|
|
35
|
+
_ref$size = _ref.size,
|
|
36
|
+
Z = _ref$size === void 0 ? "middle" : _ref$size,
|
|
37
|
+
z = _ref.status,
|
|
38
|
+
_ref$bordered = _ref.bordered,
|
|
39
|
+
Ne = _ref$bordered === void 0 ? !0 : _ref$bordered,
|
|
40
|
+
_ref$controls = _ref.controls,
|
|
41
|
+
S = _ref$controls === void 0 ? !0 : _ref$controls,
|
|
42
|
+
_ref$keyboard = _ref.keyboard,
|
|
43
|
+
Ve = _ref$keyboard === void 0 ? !0 : _ref$keyboard,
|
|
44
|
+
_ref$changeOnWheel = _ref.changeOnWheel,
|
|
45
|
+
he = _ref$changeOnWheel === void 0 ? !1 : _ref$changeOnWheel,
|
|
46
|
+
_ref$changeOnBlur = _ref.changeOnBlur,
|
|
47
|
+
De = _ref$changeOnBlur === void 0 ? !0 : _ref$changeOnBlur,
|
|
48
|
+
a = _ref.addonBefore,
|
|
49
|
+
f = _ref.addonAfter,
|
|
50
|
+
N = _ref.prefix,
|
|
51
|
+
V = _ref.suffix,
|
|
52
|
+
h = _ref.formatter,
|
|
53
|
+
D = _ref.parser,
|
|
54
|
+
m = _ref.decimalSeparator,
|
|
55
|
+
O = _ref.onStep,
|
|
56
|
+
A = _ref.onPressEnter,
|
|
57
|
+
T = _ref.onFocus,
|
|
58
|
+
ee = _ref.onBlur,
|
|
59
|
+
Re = _ref.id,
|
|
60
|
+
_e = _ref.name,
|
|
61
|
+
ne = _ref.className,
|
|
62
|
+
te = _ref.style;
|
|
63
|
+
var $ = d(null),
|
|
64
|
+
_J = J(!1),
|
|
65
|
+
_J2 = _slicedToArray(_J, 2),
|
|
66
|
+
k = _J2[0],
|
|
67
|
+
re = _J2[1],
|
|
68
|
+
o = d(!1),
|
|
69
|
+
g = d(!1),
|
|
70
|
+
_ = d(!1),
|
|
71
|
+
B = d(""),
|
|
72
|
+
_J3 = J(function () {
|
|
73
|
+
return i(u != null ? u : F);
|
|
74
|
+
}),
|
|
75
|
+
_J4 = _slicedToArray(_J3, 2),
|
|
76
|
+
r = _J4[0],
|
|
77
|
+
ue = _J4[1],
|
|
78
|
+
we = function we(e) {
|
|
79
|
+
u === void 0 && ue(e);
|
|
61
80
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
M = L(function (e, t) {
|
|
82
|
+
if (!t) return I !== void 0 && I >= 0 ? I : Math.max(de(e), de(c));
|
|
83
|
+
}, [I, c]),
|
|
84
|
+
H = L(function (e) {
|
|
85
|
+
if (D) return D(e);
|
|
86
|
+
var t = e;
|
|
87
|
+
return m && (t = t.replace(m, ".")), t.replace(/[^\w.-]+/g, "");
|
|
88
|
+
}, [D, m]),
|
|
89
|
+
ie = L(function (e, t) {
|
|
90
|
+
if (h) return h(e, {
|
|
91
|
+
userTyping: !!t,
|
|
92
|
+
input: B.current
|
|
93
|
+
});
|
|
94
|
+
var n = e;
|
|
67
95
|
if (!t) {
|
|
68
|
-
|
|
69
|
-
|
|
96
|
+
var s = M(n, t);
|
|
97
|
+
Ge(n) && (m || (s != null ? s : -1) >= 0) && (n = Q(n, m || ".", s));
|
|
70
98
|
}
|
|
71
99
|
return n;
|
|
100
|
+
}, [h, M, m]),
|
|
101
|
+
_J5 = J(function () {
|
|
102
|
+
var e = F != null ? F : u;
|
|
103
|
+
return r.isInvalidate() && ["string", "number"].includes(_typeof(e)) ? e == null || Number.isNaN(e) ? "" : String(e) : ie(r.toString(), !1);
|
|
104
|
+
}),
|
|
105
|
+
_J6 = _slicedToArray(_J5, 2),
|
|
106
|
+
w = _J6[0],
|
|
107
|
+
se = _J6[1];
|
|
108
|
+
B.current = w;
|
|
109
|
+
var E = function E(e, t) {
|
|
110
|
+
se(ie(e.isInvalidate() ? e.toString(!1) : e.toString(!t), t));
|
|
72
111
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
112
|
+
b = C(function () {
|
|
113
|
+
return ve(U);
|
|
114
|
+
}, [U]),
|
|
115
|
+
p = C(function () {
|
|
116
|
+
return ve(P);
|
|
117
|
+
}, [P]),
|
|
118
|
+
oe = C(function () {
|
|
119
|
+
return !b || r.isInvalidate() ? !1 : b.lessEquals(r);
|
|
120
|
+
}, [b, r]),
|
|
121
|
+
le = C(function () {
|
|
122
|
+
return !p || r.isInvalidate() ? !1 : r.lessEquals(p);
|
|
123
|
+
}, [p, r]),
|
|
124
|
+
_He = He($.current, k),
|
|
125
|
+
_He2 = _slicedToArray(_He, 1),
|
|
126
|
+
Ee = _He2[0],
|
|
127
|
+
ce = function ce(e) {
|
|
128
|
+
return b && !e.lessEquals(b) ? b : p && !p.lessEquals(e) ? p : null;
|
|
129
|
+
},
|
|
130
|
+
W = function W(e) {
|
|
131
|
+
return !ce(e);
|
|
132
|
+
},
|
|
133
|
+
q = function q(e, t) {
|
|
134
|
+
var n = e,
|
|
135
|
+
s = W(n) || n.isEmpty();
|
|
136
|
+
if (!n.isEmpty() && !t && (n = ce(n) || n, s = !0), !K && !x && s) {
|
|
137
|
+
var v = n.toString(),
|
|
138
|
+
y = M(v, t);
|
|
139
|
+
return y !== void 0 && y >= 0 && (n = i(Q(v, ".", y)), W(n) || (n = i(Q(v, ".", y, !0)))), n.equals(r) || (we(n), X == null || X(n.isEmpty() ? null : n.toNumber()), u === void 0 && E(n, t)), n;
|
|
140
|
+
}
|
|
141
|
+
return r;
|
|
142
|
+
},
|
|
143
|
+
qe = We(),
|
|
144
|
+
_Y = function Y(e) {
|
|
145
|
+
if (Ee(), B.current = e, se(e), !g.current) {
|
|
146
|
+
var t = H(e),
|
|
147
|
+
n = i(t);
|
|
148
|
+
n.isNaN() || q(n, !0);
|
|
149
|
+
}
|
|
150
|
+
qe(function () {
|
|
151
|
+
var t = D ? e : e.replace(/。/g, ".");
|
|
152
|
+
t !== e && _Y(t);
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
ye = function ye() {
|
|
156
|
+
g.current = !0;
|
|
157
|
+
},
|
|
158
|
+
Ce = function Ce(e) {
|
|
159
|
+
g.current = !1, _Y(e.target.value);
|
|
160
|
+
},
|
|
161
|
+
Fe = function Fe(e) {
|
|
162
|
+
return _Y(e.target.value);
|
|
163
|
+
},
|
|
164
|
+
G = function G(e) {
|
|
165
|
+
var t;
|
|
166
|
+
if (e && oe || !e && le) return;
|
|
167
|
+
o.current = !1;
|
|
168
|
+
var n = i(_.current ? ge(c) : c);
|
|
169
|
+
e || (n = n.negate());
|
|
170
|
+
var s = (r.isInvalidate() ? i(0) : r).add(n.toString()),
|
|
171
|
+
v = q(s, !1);
|
|
172
|
+
O == null || O(v.toNumber(), {
|
|
173
|
+
offset: _.current ? ge(c) : c,
|
|
174
|
+
type: e ? "up" : "down"
|
|
175
|
+
}), (t = $.current) == null || t.focus();
|
|
176
|
+
},
|
|
177
|
+
ae = function ae(e) {
|
|
178
|
+
var t = i(H(w));
|
|
179
|
+
var n;
|
|
180
|
+
t.isNaN() ? n = q(r, e) : n = q(t, e), u !== void 0 ? E(r, !1) : n.isNaN() || E(n, !1);
|
|
181
|
+
},
|
|
182
|
+
Pe = function Pe(e) {
|
|
183
|
+
var t = e.key,
|
|
184
|
+
n = e.shiftKey;
|
|
185
|
+
o.current = !0, _.current = n, t === "Enter" && (g.current || (o.current = !1), ae(!1), A == null || A(e)), Ve && !g.current && (t === "ArrowUp" || t === "ArrowDown") && (G(t === "ArrowUp"), e.preventDefault());
|
|
186
|
+
},
|
|
187
|
+
Ue = function Ue() {
|
|
188
|
+
o.current = !1, _.current = !1;
|
|
189
|
+
},
|
|
190
|
+
xe = function xe(e) {
|
|
191
|
+
re(!0), T == null || T(e);
|
|
192
|
+
},
|
|
193
|
+
Ke = function Ke(e) {
|
|
194
|
+
De && ae(!1), re(!1), o.current = !1, ee == null || ee(e);
|
|
195
|
+
},
|
|
196
|
+
fe = d(u);
|
|
125
197
|
if (fe.current !== u) {
|
|
126
198
|
fe.current = u;
|
|
127
|
-
|
|
199
|
+
var e = i(u);
|
|
128
200
|
if (!e.equals(r)) {
|
|
129
201
|
ue(e);
|
|
130
|
-
|
|
131
|
-
(!e.equals(t) || !
|
|
202
|
+
var t = i(H(w));
|
|
203
|
+
(!e.equals(t) || !o.current || h) && E(e, o.current);
|
|
132
204
|
}
|
|
133
205
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
"
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
{
|
|
192
|
-
className:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
be,
|
|
197
|
-
f && /* @__PURE__ */ o("div", { className: "bj-input-number-group__addon", children: f })
|
|
198
|
-
]
|
|
199
|
-
}
|
|
200
|
-
);
|
|
206
|
+
var Se = function Se(e) {
|
|
207
|
+
$.current = e, typeof R == "function" ? R(e) : R && (R.current = e);
|
|
208
|
+
},
|
|
209
|
+
me = !!S,
|
|
210
|
+
$e = _typeof(S) == "object" ? S.icon : void 0,
|
|
211
|
+
ke = !r.isInvalidate() && !W(r),
|
|
212
|
+
Be = ["bj-input-number", "bj-input-number--".concat(Z), k && "bj-input-number--focused", x && "bj-input-number--disabled", K && "bj-input-number--readonly", !Ne && "bj-input-number--borderless", z && "bj-input-number--".concat(z), ke && "bj-input-number--out-of-range", me && "bj-input-number--with-controls", a && "bj-input-number--group-left", f && "bj-input-number--group-right"].filter(Boolean).join(" "),
|
|
213
|
+
be = /* @__PURE__ */pe("div", {
|
|
214
|
+
className: [Be, !(a || f || N || V) && ne].filter(Boolean).join(" "),
|
|
215
|
+
style: a || f || N || V ? void 0 : te,
|
|
216
|
+
onKeyDown: Pe,
|
|
217
|
+
onKeyUp: Ue,
|
|
218
|
+
children: [N && /* @__PURE__ */l("span", {
|
|
219
|
+
className: "bj-input-number__prefix",
|
|
220
|
+
children: N
|
|
221
|
+
}), /* @__PURE__ */l("div", {
|
|
222
|
+
className: "bj-input-number__input-wrap",
|
|
223
|
+
children: /* @__PURE__ */l("input", {
|
|
224
|
+
ref: Se,
|
|
225
|
+
id: Re,
|
|
226
|
+
name: _e,
|
|
227
|
+
className: "bj-input-number__input",
|
|
228
|
+
autoComplete: "off",
|
|
229
|
+
role: "spinbutton",
|
|
230
|
+
"aria-valuemin": P,
|
|
231
|
+
"aria-valuemax": U,
|
|
232
|
+
"aria-valuenow": r.isInvalidate() ? void 0 : r.toNumber(),
|
|
233
|
+
value: w,
|
|
234
|
+
placeholder: je,
|
|
235
|
+
disabled: x,
|
|
236
|
+
readOnly: K,
|
|
237
|
+
autoFocus: Ie,
|
|
238
|
+
onChange: Fe,
|
|
239
|
+
onFocus: xe,
|
|
240
|
+
onBlur: Ke,
|
|
241
|
+
onCompositionStart: ye,
|
|
242
|
+
onCompositionEnd: Ce,
|
|
243
|
+
onWheel: he ? function (e) {
|
|
244
|
+
k && G(e.deltaY < 0);
|
|
245
|
+
} : void 0
|
|
246
|
+
})
|
|
247
|
+
}), V && /* @__PURE__ */l("span", {
|
|
248
|
+
className: "bj-input-number__suffix",
|
|
249
|
+
children: V
|
|
250
|
+
}), me && /* @__PURE__ */l(Ye, {
|
|
251
|
+
icon: $e,
|
|
252
|
+
upDisabled: oe,
|
|
253
|
+
downDisabled: le,
|
|
254
|
+
onStep: G
|
|
255
|
+
})]
|
|
256
|
+
});
|
|
257
|
+
return !a && !f ? be : /* @__PURE__ */pe("div", {
|
|
258
|
+
className: ["bj-input-number-group", "bj-input-number-group--".concat(Z), ne].filter(Boolean).join(" "),
|
|
259
|
+
style: te,
|
|
260
|
+
children: [a && /* @__PURE__ */l("div", {
|
|
261
|
+
className: "bj-input-number-group__addon",
|
|
262
|
+
children: a
|
|
263
|
+
}), be, f && /* @__PURE__ */l("div", {
|
|
264
|
+
className: "bj-input-number-group__addon",
|
|
265
|
+
children: f
|
|
266
|
+
})]
|
|
267
|
+
});
|
|
201
268
|
});
|
|
202
|
-
export {
|
|
203
|
-
Ae as default
|
|
204
|
-
};
|
|
269
|
+
export { Ae as default };
|
|
@@ -1 +1,112 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
var t = require("react/jsx-runtime"),
|
|
7
|
+
i = require("react");
|
|
8
|
+
var w = Object.defineProperty,
|
|
9
|
+
v = Object.defineProperties,
|
|
10
|
+
P = Object.getOwnPropertyDescriptors,
|
|
11
|
+
d = Object.getOwnPropertySymbols,
|
|
12
|
+
x = Object.prototype.hasOwnProperty,
|
|
13
|
+
O = Object.prototype.propertyIsEnumerable,
|
|
14
|
+
m = function m(r, e, n) {
|
|
15
|
+
return e in r ? w(r, e, {
|
|
16
|
+
enumerable: !0,
|
|
17
|
+
configurable: !0,
|
|
18
|
+
writable: !0,
|
|
19
|
+
value: n
|
|
20
|
+
}) : r[e] = n;
|
|
21
|
+
},
|
|
22
|
+
j = function j(r, e) {
|
|
23
|
+
for (var n in e || (e = {})) x.call(e, n) && m(r, n, e[n]);
|
|
24
|
+
if (d) {
|
|
25
|
+
var _iterator = _createForOfIteratorHelper(d(e)),
|
|
26
|
+
_step;
|
|
27
|
+
try {
|
|
28
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
29
|
+
var n = _step.value;
|
|
30
|
+
O.call(e, n) && m(r, n, e[n]);
|
|
31
|
+
}
|
|
32
|
+
} catch (err) {
|
|
33
|
+
_iterator.e(err);
|
|
34
|
+
} finally {
|
|
35
|
+
_iterator.f();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return r;
|
|
39
|
+
},
|
|
40
|
+
h = function h(r, e) {
|
|
41
|
+
return v(r, P(e));
|
|
42
|
+
};
|
|
43
|
+
var g = 600,
|
|
44
|
+
S = 200;
|
|
45
|
+
function f(_ref) {
|
|
46
|
+
var r = _ref.className;
|
|
47
|
+
return t.jsx("svg", {
|
|
48
|
+
width: "24",
|
|
49
|
+
height: "24",
|
|
50
|
+
viewBox: "0 0 24 24",
|
|
51
|
+
fill: "none",
|
|
52
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
53
|
+
className: r,
|
|
54
|
+
children: t.jsx("path", {
|
|
55
|
+
d: "M15.4573 13.6501C15.9047 13.6504 16.129 14.192 15.8128 14.5085L12.3352 17.9851C12.139 18.1811 11.8214 18.1811 11.6253 17.9851L8.14772 14.5085C7.83144 14.192 8.0558 13.6504 8.50319 13.6501H15.4573ZM11.6643 5.98311C11.8606 5.78688 12.179 5.78688 12.3753 5.98311L15.8518 9.45967C16.1683 9.77623 15.944 10.3171 15.4964 10.3171H8.54323C8.09567 10.3171 7.87154 9.77625 8.18776 9.45967L11.6643 5.98311Z",
|
|
56
|
+
fill: "currentColor"
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function y(_ref2) {
|
|
61
|
+
var r = _ref2.icon,
|
|
62
|
+
e = _ref2.upDisabled,
|
|
63
|
+
n = _ref2.downDisabled,
|
|
64
|
+
l = _ref2.onStep;
|
|
65
|
+
var s = i.useRef(void 0),
|
|
66
|
+
u = i.useRef(l);
|
|
67
|
+
u.current = l;
|
|
68
|
+
var o = function o() {
|
|
69
|
+
return clearTimeout(s.current);
|
|
70
|
+
},
|
|
71
|
+
p = function p(a, _) {
|
|
72
|
+
a.preventDefault(), o(), u.current(_);
|
|
73
|
+
function b() {
|
|
74
|
+
u.current(_), s.current = setTimeout(b, S);
|
|
75
|
+
}
|
|
76
|
+
s.current = setTimeout(b, g);
|
|
77
|
+
};
|
|
78
|
+
i.useEffect(function () {
|
|
79
|
+
return o;
|
|
80
|
+
}, []);
|
|
81
|
+
var c = {
|
|
82
|
+
unselectable: "on",
|
|
83
|
+
role: "button",
|
|
84
|
+
onMouseUp: o,
|
|
85
|
+
onMouseLeave: o
|
|
86
|
+
};
|
|
87
|
+
return t.jsxs("div", {
|
|
88
|
+
className: "bj-input-number__handler-wrap",
|
|
89
|
+
children: [t.jsx("span", h(j({}, c), {
|
|
90
|
+
"aria-label": "Increase Value",
|
|
91
|
+
"aria-disabled": e,
|
|
92
|
+
className: e ? "bj-input-number__handler bj-input-number__handler--up bj-input-number__handler--disabled" : "bj-input-number__handler bj-input-number__handler--up",
|
|
93
|
+
onMouseDown: function onMouseDown(a) {
|
|
94
|
+
return p(a, !0);
|
|
95
|
+
}
|
|
96
|
+
})), t.jsx("span", h(j({}, c), {
|
|
97
|
+
"aria-label": "Decrease Value",
|
|
98
|
+
"aria-disabled": n,
|
|
99
|
+
className: n ? "bj-input-number__handler bj-input-number__handler--down bj-input-number__handler--disabled" : "bj-input-number__handler bj-input-number__handler--down",
|
|
100
|
+
onMouseDown: function onMouseDown(a) {
|
|
101
|
+
return p(a, !1);
|
|
102
|
+
}
|
|
103
|
+
})), r || t.jsxs(t.Fragment, {
|
|
104
|
+
children: [t.jsx(f, {
|
|
105
|
+
className: "bj-input-number__handler-icon bj-input-number__handler-icon--up"
|
|
106
|
+
}), t.jsx(f, {
|
|
107
|
+
className: "bj-input-number__handler-icon bj-input-number__handler-icon--down"
|
|
108
|
+
})]
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
module.exports = y;
|