bj-web-components 0.2.33 → 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.d.ts +160 -15
- package/dist/index.js +58 -1
- package/dist/index.mjs +15 -39
- 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 -96
- package/dist/web/CheckBox/Group.js +111 -1
- package/dist/web/CheckBox/Group.mjs +106 -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 -0
- package/dist/web/MobileDrawer/BMobileDrawer.mjs +233 -0
- 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 -0
- package/dist/web/Radio/BRadio.mjs +151 -0
- package/dist/web/Radio/Button.js +54 -0
- package/dist/web/Radio/Button.mjs +52 -0
- package/dist/web/Radio/Group.js +97 -0
- package/dist/web/Radio/Group.mjs +96 -0
- package/dist/web/Radio/context.js +10 -0
- package/dist/web/Radio/context.mjs +4 -0
- package/dist/web/Radio/index.js +13 -0
- package/dist/web/Radio/index.mjs +8 -0
- 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.d.ts +160 -15
- package/dist/web.js +58 -1
- package/dist/web.mjs +15 -39
- package/package.json +97 -94
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
4
|
+
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."); }
|
|
5
|
+
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; } }
|
|
6
|
+
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; }
|
|
7
|
+
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; } }
|
|
8
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
9
|
+
var o = require("react/jsx-runtime"),
|
|
10
|
+
t = require("react"),
|
|
11
|
+
w = require("./BRadio.js"),
|
|
12
|
+
z = require("./context.js");
|
|
13
|
+
function I() {
|
|
14
|
+
for (var _len = arguments.length, u = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15
|
+
u[_key] = arguments[_key];
|
|
16
|
+
}
|
|
17
|
+
return u.filter(Boolean).join(" ");
|
|
18
|
+
}
|
|
19
|
+
function P(u) {
|
|
20
|
+
return (u != null ? u : []).map(function (e) {
|
|
21
|
+
return typeof e == "string" || typeof e == "number" ? {
|
|
22
|
+
label: e,
|
|
23
|
+
value: e
|
|
24
|
+
} : e;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
var j = t.forwardRef(function (_ref, C) {
|
|
28
|
+
var u = _ref.defaultValue,
|
|
29
|
+
e = _ref.value,
|
|
30
|
+
l = _ref.onChange,
|
|
31
|
+
a = _ref.options,
|
|
32
|
+
v = _ref.children,
|
|
33
|
+
s = _ref.disabled,
|
|
34
|
+
c = _ref.name,
|
|
35
|
+
f = _ref.className,
|
|
36
|
+
x = _ref.style,
|
|
37
|
+
h = _ref.id,
|
|
38
|
+
_ref$direction = _ref.direction,
|
|
39
|
+
R = _ref$direction === void 0 ? "ltr" : _ref$direction,
|
|
40
|
+
_ref$variant = _ref.variant,
|
|
41
|
+
d = _ref$variant === void 0 ? "dark" : _ref$variant,
|
|
42
|
+
n = _ref.optionType,
|
|
43
|
+
_ref$buttonStyle = _ref.buttonStyle,
|
|
44
|
+
q = _ref$buttonStyle === void 0 ? "outline" : _ref$buttonStyle,
|
|
45
|
+
g = _ref.size,
|
|
46
|
+
B = _ref.onMouseEnter,
|
|
47
|
+
y = _ref.onMouseLeave,
|
|
48
|
+
G = _ref.onFocus,
|
|
49
|
+
N = _ref.onBlur;
|
|
50
|
+
var _t$useState = t.useState(u),
|
|
51
|
+
_t$useState2 = _slicedToArray(_t$useState, 2),
|
|
52
|
+
M = _t$useState2[0],
|
|
53
|
+
O = _t$useState2[1],
|
|
54
|
+
i = e !== void 0 ? e : M,
|
|
55
|
+
m = n === "button",
|
|
56
|
+
S = t.useMemo(function () {
|
|
57
|
+
return P(a);
|
|
58
|
+
}, [a]),
|
|
59
|
+
V = t.useMemo(function () {
|
|
60
|
+
return {
|
|
61
|
+
name: c,
|
|
62
|
+
value: i,
|
|
63
|
+
disabled: s,
|
|
64
|
+
variant: d,
|
|
65
|
+
optionType: n,
|
|
66
|
+
onChange: function onChange(r) {
|
|
67
|
+
var b = r.target.value;
|
|
68
|
+
e === void 0 && O(b), b !== i && (l == null || l(r));
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}, [e, s, i, c, l, n, d]),
|
|
72
|
+
k = a && a.length > 0 ? S.map(function (r) {
|
|
73
|
+
return o.jsx(w, {
|
|
74
|
+
disabled: r.disabled || s,
|
|
75
|
+
onChange: r.onChange,
|
|
76
|
+
style: r.style,
|
|
77
|
+
value: r.value,
|
|
78
|
+
children: r.label
|
|
79
|
+
}, String(r.value));
|
|
80
|
+
}) : v;
|
|
81
|
+
return o.jsx("div", {
|
|
82
|
+
className: I("bj-radio-group", m && "bj-radio-group--button", m && q === "solid" && "bj-radio-group--solid", g === "large" && "bj-radio-group--lg", g === "small" && "bj-radio-group--sm", R === "rtl" && "bj-radio-group--rtl", f),
|
|
83
|
+
id: h,
|
|
84
|
+
onBlur: N,
|
|
85
|
+
onFocus: G,
|
|
86
|
+
onMouseEnter: B,
|
|
87
|
+
onMouseLeave: y,
|
|
88
|
+
ref: C,
|
|
89
|
+
style: x,
|
|
90
|
+
children: o.jsx(z.RadioGroupContext.Provider, {
|
|
91
|
+
value: V,
|
|
92
|
+
children: k
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
j.displayName = "BRadio.Group";
|
|
97
|
+
module.exports = j;
|
|
@@ -0,0 +1,96 @@
|
|
|
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 _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; } }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
8
|
+
import { forwardRef as w, useState as z, useMemo as g } from "react";
|
|
9
|
+
import I from "./BRadio.mjs";
|
|
10
|
+
import { RadioGroupContext as M } from "./context.mjs";
|
|
11
|
+
function P() {
|
|
12
|
+
for (var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
+
a[_key] = arguments[_key];
|
|
14
|
+
}
|
|
15
|
+
return a.filter(Boolean).join(" ");
|
|
16
|
+
}
|
|
17
|
+
function q(a) {
|
|
18
|
+
return (a != null ? a : []).map(function (r) {
|
|
19
|
+
return typeof r == "string" || typeof r == "number" ? {
|
|
20
|
+
label: r,
|
|
21
|
+
value: r
|
|
22
|
+
} : r;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
var A = w(function (_ref, N) {
|
|
26
|
+
var a = _ref.defaultValue,
|
|
27
|
+
r = _ref.value,
|
|
28
|
+
u = _ref.onChange,
|
|
29
|
+
l = _ref.options,
|
|
30
|
+
b = _ref.children,
|
|
31
|
+
t = _ref.disabled,
|
|
32
|
+
d = _ref.name,
|
|
33
|
+
v = _ref.className,
|
|
34
|
+
j = _ref.style,
|
|
35
|
+
h = _ref.id,
|
|
36
|
+
_ref$direction = _ref.direction,
|
|
37
|
+
x = _ref$direction === void 0 ? "ltr" : _ref$direction,
|
|
38
|
+
_ref$variant = _ref.variant,
|
|
39
|
+
i = _ref$variant === void 0 ? "dark" : _ref$variant,
|
|
40
|
+
o = _ref.optionType,
|
|
41
|
+
_ref$buttonStyle = _ref.buttonStyle,
|
|
42
|
+
p = _ref$buttonStyle === void 0 ? "outline" : _ref$buttonStyle,
|
|
43
|
+
m = _ref.size,
|
|
44
|
+
B = _ref.onMouseEnter,
|
|
45
|
+
R = _ref.onMouseLeave,
|
|
46
|
+
y = _ref.onFocus,
|
|
47
|
+
G = _ref.onBlur;
|
|
48
|
+
var _z = z(a),
|
|
49
|
+
_z2 = _slicedToArray(_z, 2),
|
|
50
|
+
C = _z2[0],
|
|
51
|
+
O = _z2[1],
|
|
52
|
+
n = r !== void 0 ? r : C,
|
|
53
|
+
c = o === "button",
|
|
54
|
+
S = g(function () {
|
|
55
|
+
return q(l);
|
|
56
|
+
}, [l]),
|
|
57
|
+
V = g(function () {
|
|
58
|
+
return {
|
|
59
|
+
name: d,
|
|
60
|
+
value: n,
|
|
61
|
+
disabled: t,
|
|
62
|
+
variant: i,
|
|
63
|
+
// 保持原始值(可能是 undefined),以便 BRadio.Button 能在组内生效
|
|
64
|
+
optionType: o,
|
|
65
|
+
onChange: function onChange(e) {
|
|
66
|
+
var f = e.target.value;
|
|
67
|
+
r === void 0 && O(f), f !== n && (u == null || u(e));
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}, [r, t, n, d, u, o, i]),
|
|
71
|
+
k = l && l.length > 0 ? S.map(function (e) {
|
|
72
|
+
return /* @__PURE__ */s(I, {
|
|
73
|
+
disabled: e.disabled || t,
|
|
74
|
+
onChange: e.onChange,
|
|
75
|
+
style: e.style,
|
|
76
|
+
value: e.value,
|
|
77
|
+
children: e.label
|
|
78
|
+
}, String(e.value));
|
|
79
|
+
}) : b;
|
|
80
|
+
return /* @__PURE__ */s("div", {
|
|
81
|
+
className: P("bj-radio-group", c && "bj-radio-group--button", c && p === "solid" && "bj-radio-group--solid", m === "large" && "bj-radio-group--lg", m === "small" && "bj-radio-group--sm", x === "rtl" && "bj-radio-group--rtl", v),
|
|
82
|
+
id: h,
|
|
83
|
+
onBlur: G,
|
|
84
|
+
onFocus: y,
|
|
85
|
+
onMouseEnter: B,
|
|
86
|
+
onMouseLeave: R,
|
|
87
|
+
ref: N,
|
|
88
|
+
style: j,
|
|
89
|
+
children: /* @__PURE__ */s(M.Provider, {
|
|
90
|
+
value: V,
|
|
91
|
+
children: k
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
A.displayName = "BRadio.Group";
|
|
96
|
+
export { A as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
4
|
+
value: "Module"
|
|
5
|
+
});
|
|
6
|
+
var t = require("./BRadio.js"),
|
|
7
|
+
e = require("./Button.js"),
|
|
8
|
+
r = require("./Group.js"),
|
|
9
|
+
o = t;
|
|
10
|
+
o.Group = r;
|
|
11
|
+
o.Button = e;
|
|
12
|
+
o.__ANT_RADIO = !0;
|
|
13
|
+
exports.BRadio = o;
|