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,61 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _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; } } }; }
|
|
6
|
+
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; } }
|
|
7
|
+
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; }
|
|
8
|
+
import { jsx as s, jsxs as P } from "react/jsx-runtime";
|
|
9
|
+
import { useState as x, useCallback as j } from "react";
|
|
3
10
|
/* empty css */
|
|
4
|
-
|
|
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
|
-
type: "button",
|
|
33
|
-
role: "switch",
|
|
34
|
-
"aria-checked": s,
|
|
35
|
-
"aria-disabled": e,
|
|
36
|
-
className: m,
|
|
37
|
-
style: {
|
|
38
|
-
"--bu-switch-track-bg": _,
|
|
39
|
-
...k
|
|
40
|
-
},
|
|
41
|
-
onClick: p,
|
|
42
|
-
children: /* @__PURE__ */ N("span", { className: "bu-switch__track", children: [
|
|
43
|
-
o != null && /* @__PURE__ */ t("span", { className: "bu-switch__label bu-switch__label--left", children: o }),
|
|
44
|
-
/* @__PURE__ */ t("span", { className: "bu-switch__thumb", children: l && /* @__PURE__ */ t("span", { className: "bu-switch__loading-icon", children: /* @__PURE__ */ t("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
45
|
-
"path",
|
|
46
|
-
{
|
|
47
|
-
d: "M8 1.5a6.5 6.5 0 0 1 6.5 6.5",
|
|
48
|
-
stroke: "currentColor",
|
|
49
|
-
strokeWidth: "2",
|
|
50
|
-
strokeLinecap: "round"
|
|
51
|
-
}
|
|
52
|
-
) }) }) }),
|
|
53
|
-
a != null && /* @__PURE__ */ t("span", { className: "bu-switch__label bu-switch__label--right", children: a })
|
|
54
|
-
] })
|
|
11
|
+
var B = Object.defineProperty,
|
|
12
|
+
b = Object.getOwnPropertySymbols,
|
|
13
|
+
S = Object.prototype.hasOwnProperty,
|
|
14
|
+
I = Object.prototype.propertyIsEnumerable,
|
|
15
|
+
_ = function _(e, r, t) {
|
|
16
|
+
return r in e ? B(e, r, {
|
|
17
|
+
enumerable: !0,
|
|
18
|
+
configurable: !0,
|
|
19
|
+
writable: !0,
|
|
20
|
+
value: t
|
|
21
|
+
}) : e[r] = t;
|
|
22
|
+
},
|
|
23
|
+
C = function C(e, r) {
|
|
24
|
+
for (var t in r || (r = {})) S.call(r, t) && _(e, t, r[t]);
|
|
25
|
+
if (b) {
|
|
26
|
+
var _iterator = _createForOfIteratorHelper(b(r)),
|
|
27
|
+
_step;
|
|
28
|
+
try {
|
|
29
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
30
|
+
var t = _step.value;
|
|
31
|
+
I.call(r, t) && _(e, t, r[t]);
|
|
32
|
+
}
|
|
33
|
+
} catch (err) {
|
|
34
|
+
_iterator.e(err);
|
|
35
|
+
} finally {
|
|
36
|
+
_iterator.f();
|
|
37
|
+
}
|
|
55
38
|
}
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
39
|
+
return e;
|
|
40
|
+
};
|
|
41
|
+
var E = function E(_ref) {
|
|
42
|
+
var e = _ref.checked,
|
|
43
|
+
_ref$defaultChecked = _ref.defaultChecked,
|
|
44
|
+
r = _ref$defaultChecked === void 0 ? !1 : _ref$defaultChecked,
|
|
45
|
+
t = _ref.onChange,
|
|
46
|
+
_ref$disabled = _ref.disabled,
|
|
47
|
+
a = _ref$disabled === void 0 ? !1 : _ref$disabled,
|
|
48
|
+
_ref$loading = _ref.loading,
|
|
49
|
+
c = _ref$loading === void 0 ? !1 : _ref$loading,
|
|
50
|
+
i = _ref.checkedChildren,
|
|
51
|
+
n = _ref.unCheckedChildren,
|
|
52
|
+
_ref$theme = _ref.theme,
|
|
53
|
+
u = _ref$theme === void 0 ? "light" : _ref$theme,
|
|
54
|
+
h = _ref.activeColor,
|
|
55
|
+
w = _ref.inactiveColor,
|
|
56
|
+
f = _ref.className,
|
|
57
|
+
d = _ref.style;
|
|
58
|
+
var o = e !== void 0,
|
|
59
|
+
_x = x(r),
|
|
60
|
+
_x2 = _slicedToArray(_x, 2),
|
|
61
|
+
m = _x2[0],
|
|
62
|
+
v = _x2[1],
|
|
63
|
+
l = o ? e : m,
|
|
64
|
+
k = j(function () {
|
|
65
|
+
if (a || c) return;
|
|
66
|
+
var p = !l;
|
|
67
|
+
o || v(p), t == null || t(p);
|
|
68
|
+
}, [l, a, c, o, t]),
|
|
69
|
+
g = h != null ? h : u === "dark" ? "var(--bu-switch-dark-on)" : "var(--bu-switch-light-on)",
|
|
70
|
+
y = w != null ? w : u === "dark" ? "var(--bu-switch-dark-off)" : "var(--bu-switch-light-off)",
|
|
71
|
+
N = l ? g : y,
|
|
72
|
+
O = ["bu-switch", l && "bu-switch--checked", a && "bu-switch--disabled", c && "bu-switch--loading", f].filter(Boolean).join(" ");
|
|
73
|
+
return /* @__PURE__ */s("button", {
|
|
74
|
+
type: "button",
|
|
75
|
+
role: "switch",
|
|
76
|
+
"aria-checked": l,
|
|
77
|
+
"aria-disabled": a,
|
|
78
|
+
className: O,
|
|
79
|
+
style: C({
|
|
80
|
+
"--bu-switch-track-bg": N
|
|
81
|
+
}, d),
|
|
82
|
+
onClick: k,
|
|
83
|
+
children: /* @__PURE__ */P("span", {
|
|
84
|
+
className: "bu-switch__track",
|
|
85
|
+
children: [n != null && /* @__PURE__ */s("span", {
|
|
86
|
+
className: "bu-switch__label bu-switch__label--left",
|
|
87
|
+
children: n
|
|
88
|
+
}), /* @__PURE__ */s("span", {
|
|
89
|
+
className: "bu-switch__thumb",
|
|
90
|
+
children: c && /* @__PURE__ */s("span", {
|
|
91
|
+
className: "bu-switch__loading-icon",
|
|
92
|
+
children: /* @__PURE__ */s("svg", {
|
|
93
|
+
viewBox: "0 0 16 16",
|
|
94
|
+
fill: "none",
|
|
95
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
96
|
+
children: /* @__PURE__ */s("path", {
|
|
97
|
+
d: "M8 1.5a6.5 6.5 0 0 1 6.5 6.5",
|
|
98
|
+
stroke: "currentColor",
|
|
99
|
+
strokeWidth: "2",
|
|
100
|
+
strokeLinecap: "round"
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
}), i != null && /* @__PURE__ */s("span", {
|
|
105
|
+
className: "bu-switch__label bu-switch__label--right",
|
|
106
|
+
children: i
|
|
107
|
+
})]
|
|
108
|
+
})
|
|
109
|
+
});
|
|
61
110
|
};
|
|
111
|
+
E.displayName = "BuSwitch";
|
|
112
|
+
export { E as default };
|