bj-web-components 0.2.34 → 0.2.36
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 +233 -133
- 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 +3 -1
|
@@ -1,177 +1,276 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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; } }
|
|
4
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
5
|
+
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); }
|
|
6
|
+
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; } } }; }
|
|
7
|
+
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; } }
|
|
8
|
+
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; }
|
|
9
|
+
import { jsx as u, jsxs as K } from "react/jsx-runtime";
|
|
10
|
+
import { forwardRef as re, useState as H, useRef as P, useImperativeHandle as te, useEffect as oe, cloneElement as L } from "react";
|
|
11
|
+
import { triggerFocus as V, resolveOnChange as M, hasPrefixSuffix as q, hasAddon as ae } from "./utils.mjs";
|
|
4
12
|
/* empty css */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
onMouseDown: (u) => u.preventDefault(),
|
|
56
|
-
tabIndex: -1,
|
|
57
|
-
type: "button",
|
|
58
|
-
children: I
|
|
59
|
-
}
|
|
60
|
-
),
|
|
61
|
-
i
|
|
62
|
-
] })
|
|
63
|
-
]
|
|
13
|
+
var ie = Object.defineProperty,
|
|
14
|
+
se = Object.defineProperties,
|
|
15
|
+
ue = Object.getOwnPropertyDescriptors,
|
|
16
|
+
E = Object.getOwnPropertySymbols,
|
|
17
|
+
G = Object.prototype.hasOwnProperty,
|
|
18
|
+
J = Object.prototype.propertyIsEnumerable,
|
|
19
|
+
T = function T(n, t, r) {
|
|
20
|
+
return t in n ? ie(n, t, {
|
|
21
|
+
enumerable: !0,
|
|
22
|
+
configurable: !0,
|
|
23
|
+
writable: !0,
|
|
24
|
+
value: r
|
|
25
|
+
}) : n[t] = r;
|
|
26
|
+
},
|
|
27
|
+
le = function le(n, t) {
|
|
28
|
+
for (var r in t || (t = {})) G.call(t, r) && T(n, r, t[r]);
|
|
29
|
+
if (E) {
|
|
30
|
+
var _iterator = _createForOfIteratorHelper(E(t)),
|
|
31
|
+
_step;
|
|
32
|
+
try {
|
|
33
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
34
|
+
var r = _step.value;
|
|
35
|
+
J.call(t, r) && T(n, r, t[r]);
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
_iterator.e(err);
|
|
39
|
+
} finally {
|
|
40
|
+
_iterator.f();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return n;
|
|
44
|
+
},
|
|
45
|
+
ce = function ce(n, t) {
|
|
46
|
+
return se(n, ue(t));
|
|
47
|
+
},
|
|
48
|
+
pe = function pe(n, t) {
|
|
49
|
+
var r = {};
|
|
50
|
+
for (var o in n) G.call(n, o) && t.indexOf(o) < 0 && (r[o] = n[o]);
|
|
51
|
+
if (n != null && E) {
|
|
52
|
+
var _iterator2 = _createForOfIteratorHelper(E(n)),
|
|
53
|
+
_step2;
|
|
54
|
+
try {
|
|
55
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
56
|
+
var o = _step2.value;
|
|
57
|
+
t.indexOf(o) < 0 && J.call(n, o) && (r[o] = n[o]);
|
|
58
|
+
}
|
|
59
|
+
} catch (err) {
|
|
60
|
+
_iterator2.e(err);
|
|
61
|
+
} finally {
|
|
62
|
+
_iterator2.f();
|
|
64
63
|
}
|
|
65
|
-
|
|
64
|
+
}
|
|
65
|
+
return r;
|
|
66
|
+
};
|
|
67
|
+
function w() {
|
|
68
|
+
for (var _len = arguments.length, n = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
69
|
+
n[_key] = arguments[_key];
|
|
66
70
|
}
|
|
67
|
-
return
|
|
68
|
-
l && /* @__PURE__ */ a("span", { className: "bj-input__group-addon", children: l }),
|
|
69
|
-
s,
|
|
70
|
-
c && /* @__PURE__ */ a("span", { className: "bj-input__group-addon", children: c })
|
|
71
|
-
] }) })), O(s, { className: k(s.props.className, g) });
|
|
71
|
+
return n.filter(Boolean).join(" ");
|
|
72
72
|
}
|
|
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
|
-
|
|
73
|
+
function fe(_ref) {
|
|
74
|
+
var n = _ref.addonAfter,
|
|
75
|
+
t = _ref.addonBefore,
|
|
76
|
+
r = _ref.allowClear,
|
|
77
|
+
o = _ref.children,
|
|
78
|
+
I = _ref.className,
|
|
79
|
+
c = _ref.disabled,
|
|
80
|
+
S = _ref.focused,
|
|
81
|
+
C = _ref.handleReset,
|
|
82
|
+
v = _ref.onClear,
|
|
83
|
+
i = _ref.prefix,
|
|
84
|
+
j = _ref.readOnly,
|
|
85
|
+
p = _ref.size,
|
|
86
|
+
f = _ref.status,
|
|
87
|
+
d = _ref.suffix,
|
|
88
|
+
g = _ref.triggerInputFocus,
|
|
89
|
+
_ = _ref.value;
|
|
90
|
+
var h = P(null),
|
|
91
|
+
y = q({
|
|
92
|
+
prefix: i,
|
|
93
|
+
suffix: d,
|
|
94
|
+
allowClear: r
|
|
95
|
+
}),
|
|
96
|
+
m = L(o, {
|
|
97
|
+
value: _
|
|
98
|
+
});
|
|
99
|
+
var s = m;
|
|
100
|
+
if (y) {
|
|
101
|
+
var x = !!(r && !c && !j && _),
|
|
102
|
+
R = _typeof(r) == "object" && r.clearIcon ? r.clearIcon : "×";
|
|
103
|
+
s = /* @__PURE__ */K("span", {
|
|
104
|
+
className: w("bj-input__affix-wrapper", c && "bj-input__affix-wrapper--disabled", S && "bj-input__affix-wrapper--focused", j && "bj-input__affix-wrapper--readonly", p && "bj-input__affix-wrapper--".concat(p), f && "bj-input__affix-wrapper--".concat(f)),
|
|
105
|
+
onClick: g,
|
|
106
|
+
ref: h,
|
|
107
|
+
children: [i && /* @__PURE__ */u("span", {
|
|
108
|
+
className: "bj-input__prefix",
|
|
109
|
+
children: i
|
|
110
|
+
}), m, (d || r) && /* @__PURE__ */K("span", {
|
|
111
|
+
className: "bj-input__suffix",
|
|
112
|
+
children: [r && /* @__PURE__ */u("button", {
|
|
113
|
+
"aria-label": "清除输入内容",
|
|
114
|
+
className: w("bj-input__clear-icon", !x && "bj-input__clear-icon--hidden"),
|
|
115
|
+
onClick: function onClick(l) {
|
|
116
|
+
C(l), v == null || v();
|
|
117
|
+
},
|
|
118
|
+
onMouseDown: function onMouseDown(l) {
|
|
119
|
+
return l.preventDefault();
|
|
120
|
+
},
|
|
121
|
+
tabIndex: -1,
|
|
122
|
+
type: "button",
|
|
123
|
+
children: R
|
|
124
|
+
}), d]
|
|
125
|
+
})]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return ae({
|
|
129
|
+
addonBefore: t,
|
|
130
|
+
addonAfter: n
|
|
131
|
+
}) && (s = /* @__PURE__ */u("span", {
|
|
132
|
+
className: "bj-input__group-wrapper",
|
|
133
|
+
children: /* @__PURE__ */K("span", {
|
|
134
|
+
className: "bj-input__group",
|
|
135
|
+
children: [t && /* @__PURE__ */u("span", {
|
|
136
|
+
className: "bj-input__group-addon",
|
|
137
|
+
children: t
|
|
138
|
+
}), s, n && /* @__PURE__ */u("span", {
|
|
139
|
+
className: "bj-input__group-addon",
|
|
140
|
+
children: n
|
|
141
|
+
})]
|
|
142
|
+
})
|
|
143
|
+
})), L(s, {
|
|
144
|
+
className: w(s.props.className, I)
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
var de = re(function (n, t) {
|
|
148
|
+
var r = n,
|
|
149
|
+
o = r.addonAfter,
|
|
150
|
+
I = r.addonBefore,
|
|
151
|
+
c = r.allowClear,
|
|
152
|
+
_r$bordered = r.bordered,
|
|
153
|
+
S = _r$bordered === void 0 ? !0 : _r$bordered,
|
|
154
|
+
C = r.className,
|
|
155
|
+
v = r.defaultValue,
|
|
156
|
+
i = r.disabled,
|
|
157
|
+
j = r.htmlSize,
|
|
158
|
+
p = r.onBlur,
|
|
159
|
+
f = r.onChange,
|
|
160
|
+
d = r.onClear,
|
|
161
|
+
g = r.onCompositionEnd,
|
|
162
|
+
_ = r.onCompositionStart,
|
|
163
|
+
h = r.onFocus,
|
|
164
|
+
y = r.onKeyDown,
|
|
165
|
+
m = r.onKeyUp,
|
|
166
|
+
s = r.onPressEnter,
|
|
167
|
+
x = r.prefix,
|
|
168
|
+
R = r.readOnly,
|
|
169
|
+
_r$size = r.size,
|
|
170
|
+
l = _r$size === void 0 ? "middle" : _r$size,
|
|
171
|
+
B = r.status,
|
|
172
|
+
k = r.suffix,
|
|
173
|
+
_r$type = r.type,
|
|
174
|
+
Q = _r$type === void 0 ? "text" : _r$type,
|
|
175
|
+
N = r.value,
|
|
176
|
+
W = pe(r, ["addonAfter", "addonBefore", "allowClear", "bordered", "className", "defaultValue", "disabled", "htmlSize", "onBlur", "onChange", "onClear", "onCompositionEnd", "onCompositionStart", "onFocus", "onKeyDown", "onKeyUp", "onPressEnter", "prefix", "readOnly", "size", "status", "suffix", "type", "value"]),
|
|
177
|
+
_H = H(!1),
|
|
178
|
+
_H2 = _slicedToArray(_H, 2),
|
|
179
|
+
z = _H2[0],
|
|
180
|
+
D = _H2[1],
|
|
181
|
+
_H3 = H(v),
|
|
182
|
+
_H4 = _slicedToArray(_H3, 2),
|
|
183
|
+
X = _H4[0],
|
|
184
|
+
$ = _H4[1],
|
|
185
|
+
a = P(null),
|
|
186
|
+
A = P(!1),
|
|
187
|
+
O = P(!1),
|
|
188
|
+
Y = q({
|
|
189
|
+
prefix: x,
|
|
190
|
+
suffix: k,
|
|
191
|
+
allowClear: c
|
|
192
|
+
}),
|
|
193
|
+
F = N === void 0 ? X : N,
|
|
194
|
+
Z = F == null ? "" : String(F);
|
|
195
|
+
te(t, function () {
|
|
196
|
+
return {
|
|
197
|
+
focus: function focus(e) {
|
|
198
|
+
return V(a.current, e);
|
|
199
|
+
},
|
|
200
|
+
blur: function blur() {
|
|
201
|
+
var e;
|
|
202
|
+
return (e = a.current) == null ? void 0 : e.blur();
|
|
203
|
+
},
|
|
204
|
+
setSelectionRange: function setSelectionRange() {
|
|
205
|
+
var _b;
|
|
206
|
+
var b;
|
|
207
|
+
return (b = a.current) == null ? void 0 : (_b = b).setSelectionRange.apply(_b, arguments);
|
|
208
|
+
},
|
|
209
|
+
select: function select() {
|
|
210
|
+
var e;
|
|
211
|
+
return (e = a.current) == null ? void 0 : e.select();
|
|
212
|
+
},
|
|
213
|
+
input: a.current,
|
|
214
|
+
nativeElement: a.current
|
|
215
|
+
};
|
|
216
|
+
}), oe(function () {
|
|
217
|
+
return D(function (e) {
|
|
218
|
+
return e && !i;
|
|
219
|
+
});
|
|
220
|
+
}, [i]);
|
|
221
|
+
var U = function U(e, b, ne) {
|
|
222
|
+
ne !== "compositionEnd" && (N === void 0 && $(b), a.current && M(a.current, e, f, b));
|
|
114
223
|
},
|
|
115
|
-
input
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}, W = /* @__PURE__ */ a(
|
|
121
|
-
"input",
|
|
122
|
-
{
|
|
123
|
-
...J,
|
|
124
|
-
className: k("bj-input", `bj-input--${I}`, A && !Q && "bj-input--focused", u && `bj-input--${u}`, !x && "bj-input--borderless", r && "bj-input--disabled"),
|
|
125
|
-
disabled: r,
|
|
126
|
-
onBlur: (e) => {
|
|
127
|
-
R.current = !1, V(!1), o == null || o(e);
|
|
224
|
+
ee = /* @__PURE__ */u("input", ce(le({}, W), {
|
|
225
|
+
className: w("bj-input", "bj-input--".concat(l), z && !Y && "bj-input--focused", B && "bj-input--".concat(B), !S && "bj-input--borderless", i && "bj-input--disabled"),
|
|
226
|
+
disabled: i,
|
|
227
|
+
onBlur: function onBlur(e) {
|
|
228
|
+
O.current = !1, D(!1), p == null || p(e);
|
|
128
229
|
},
|
|
129
|
-
onChange: (e)
|
|
130
|
-
|
|
131
|
-
H.current = !1, L(e, e.currentTarget.value, "compositionEnd"), i == null || i(e);
|
|
230
|
+
onChange: function onChange(e) {
|
|
231
|
+
return U(e, e.target.value, "change");
|
|
132
232
|
},
|
|
133
|
-
|
|
134
|
-
|
|
233
|
+
onCompositionEnd: function onCompositionEnd(e) {
|
|
234
|
+
A.current = !1, U(e, e.currentTarget.value, "compositionEnd"), g == null || g(e);
|
|
135
235
|
},
|
|
136
|
-
|
|
137
|
-
|
|
236
|
+
onCompositionStart: function onCompositionStart(e) {
|
|
237
|
+
A.current = !0, _ == null || _(e);
|
|
138
238
|
},
|
|
139
|
-
|
|
140
|
-
|
|
239
|
+
onFocus: function onFocus(e) {
|
|
240
|
+
D(!0), h == null || h(e);
|
|
141
241
|
},
|
|
142
|
-
|
|
143
|
-
e.key === "Enter" && (
|
|
242
|
+
onKeyDown: function onKeyDown(e) {
|
|
243
|
+
s && e.key === "Enter" && !O.current && (O.current = !0, s(e)), y == null || y(e);
|
|
144
244
|
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
type: G
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
return /* @__PURE__ */ a(
|
|
151
|
-
ne,
|
|
152
|
-
{
|
|
153
|
-
addonAfter: t,
|
|
154
|
-
addonBefore: v,
|
|
155
|
-
allowClear: g,
|
|
156
|
-
className: S,
|
|
157
|
-
disabled: r,
|
|
158
|
-
focused: A,
|
|
159
|
-
handleReset: (e) => {
|
|
160
|
-
E === void 0 && D(""), P(n.current), n.current && T(n.current, e, d);
|
|
245
|
+
onKeyUp: function onKeyUp(e) {
|
|
246
|
+
e.key === "Enter" && (O.current = !1), m == null || m(e);
|
|
161
247
|
},
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
248
|
+
ref: a,
|
|
249
|
+
size: j,
|
|
250
|
+
type: Q
|
|
251
|
+
}));
|
|
252
|
+
return /* @__PURE__ */u(fe, {
|
|
253
|
+
addonAfter: o,
|
|
254
|
+
addonBefore: I,
|
|
255
|
+
allowClear: c,
|
|
256
|
+
className: C,
|
|
257
|
+
disabled: i,
|
|
258
|
+
focused: z,
|
|
259
|
+
handleReset: function handleReset(e) {
|
|
260
|
+
N === void 0 && $(""), V(a.current), a.current && M(a.current, e, f);
|
|
261
|
+
},
|
|
262
|
+
onClear: d,
|
|
263
|
+
prefix: x,
|
|
264
|
+
readOnly: R,
|
|
265
|
+
size: l,
|
|
266
|
+
status: B,
|
|
267
|
+
suffix: k,
|
|
268
|
+
triggerInputFocus: function triggerInputFocus() {
|
|
269
|
+
return V(a.current);
|
|
270
|
+
},
|
|
271
|
+
value: Z,
|
|
272
|
+
children: ee
|
|
273
|
+
});
|
|
173
274
|
});
|
|
174
|
-
|
|
175
|
-
export {
|
|
176
|
-
te as default
|
|
177
|
-
};
|
|
275
|
+
de.displayName = "BInput";
|
|
276
|
+
export { de as default };
|
|
@@ -1 +1,47 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
4
|
+
value: "Module"
|
|
5
|
+
});
|
|
6
|
+
function u(e) {
|
|
7
|
+
return !!(e.addonBefore || e.addonAfter);
|
|
8
|
+
}
|
|
9
|
+
function f(e) {
|
|
10
|
+
return !!(e.prefix || e.suffix || e.allowClear);
|
|
11
|
+
}
|
|
12
|
+
function c(e, n, r) {
|
|
13
|
+
var t = n.cloneNode(!0),
|
|
14
|
+
i = Object.create(e, {
|
|
15
|
+
target: {
|
|
16
|
+
value: t
|
|
17
|
+
},
|
|
18
|
+
currentTarget: {
|
|
19
|
+
value: t
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return t.value = r, typeof n.selectionStart == "number" && typeof n.selectionEnd == "number" && (t.selectionStart = n.selectionStart, t.selectionEnd = n.selectionEnd), t.setSelectionRange = function () {
|
|
23
|
+
return n.setSelectionRange.apply(n, arguments);
|
|
24
|
+
}, i;
|
|
25
|
+
}
|
|
26
|
+
function l(e, n, r, t) {
|
|
27
|
+
if (r) {
|
|
28
|
+
if (n.type === "click") {
|
|
29
|
+
r(c(n, e, ""));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (e.type !== "file" && t !== void 0) {
|
|
33
|
+
r(c(n, e, t));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
r(n);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function s(e, n) {
|
|
40
|
+
if (!e || (e.focus(n), !(n != null && n.cursor))) return;
|
|
41
|
+
var r = e.value.length;
|
|
42
|
+
n.cursor === "start" ? e.setSelectionRange(0, 0) : n.cursor === "end" ? e.setSelectionRange(r, r) : e.setSelectionRange(0, r);
|
|
43
|
+
}
|
|
44
|
+
exports.hasAddon = u;
|
|
45
|
+
exports.hasPrefixSuffix = f;
|
|
46
|
+
exports.resolveOnChange = l;
|
|
47
|
+
exports.triggerFocus = s;
|
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
function
|
|
1
|
+
function o(e) {
|
|
2
2
|
return !!(e.addonBefore || e.addonAfter);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function f(e) {
|
|
5
5
|
return !!(e.prefix || e.suffix || e.allowClear);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
function c(e, n, r) {
|
|
8
|
+
var t = n.cloneNode(!0),
|
|
9
|
+
i = Object.create(e, {
|
|
10
|
+
target: {
|
|
11
|
+
value: t
|
|
12
|
+
},
|
|
13
|
+
currentTarget: {
|
|
14
|
+
value: t
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return t.value = r, typeof n.selectionStart == "number" && typeof n.selectionEnd == "number" && (t.selectionStart = n.selectionStart, t.selectionEnd = n.selectionEnd), t.setSelectionRange = function () {
|
|
18
|
+
return n.setSelectionRange.apply(n, arguments);
|
|
19
|
+
}, i;
|
|
13
20
|
}
|
|
14
|
-
function
|
|
21
|
+
function l(e, n, r, t) {
|
|
15
22
|
if (r) {
|
|
16
23
|
if (n.type === "click") {
|
|
17
|
-
r(
|
|
24
|
+
r(c(n, e, ""));
|
|
18
25
|
return;
|
|
19
26
|
}
|
|
20
|
-
if (e.type !== "file" &&
|
|
21
|
-
r(
|
|
27
|
+
if (e.type !== "file" && t !== void 0) {
|
|
28
|
+
r(c(n, e, t));
|
|
22
29
|
return;
|
|
23
30
|
}
|
|
24
31
|
r(n);
|
|
25
32
|
}
|
|
26
33
|
}
|
|
27
|
-
function
|
|
34
|
+
function s(e, n) {
|
|
28
35
|
if (!e || (e.focus(n), !(n != null && n.cursor))) return;
|
|
29
|
-
|
|
36
|
+
var r = e.value.length;
|
|
30
37
|
n.cursor === "start" ? e.setSelectionRange(0, 0) : n.cursor === "end" ? e.setSelectionRange(r, r) : e.setSelectionRange(0, r);
|
|
31
38
|
}
|
|
32
|
-
export {
|
|
33
|
-
i as hasAddon,
|
|
34
|
-
l as hasPrefixSuffix,
|
|
35
|
-
s as resolveOnChange,
|
|
36
|
-
o as triggerFocus
|
|
37
|
-
};
|
|
39
|
+
export { o as hasAddon, f as hasPrefixSuffix, l as resolveOnChange, s as triggerFocus };
|