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.
Files changed (111) hide show
  1. package/README.md +10 -1
  2. package/dist/index.js +58 -1
  3. package/dist/index.mjs +1 -29
  4. package/dist/miniapp.js +1 -1
  5. package/dist/miniapp.mjs +0 -1
  6. package/dist/mobile.js +1 -1
  7. package/dist/mobile.mjs +0 -1
  8. package/dist/react.js +1 -1
  9. package/dist/react.mjs +0 -1
  10. package/dist/shared.js +1 -1
  11. package/dist/shared.mjs +0 -1
  12. package/dist/style.css +1 -1
  13. package/dist/web/BasicInput/BInput.js +278 -1
  14. package/dist/web/BasicInput/BInput.mjs +263 -164
  15. package/dist/web/BasicInput/utils.js +47 -1
  16. package/dist/web/BasicInput/utils.mjs +22 -20
  17. package/dist/web/CategoryDropdown/CategoryDropdown.js +376 -1
  18. package/dist/web/CategoryDropdown/CategoryDropdown.mjs +355 -235
  19. package/dist/web/CheckBox/BCheckBox.js +176 -1
  20. package/dist/web/CheckBox/BCheckBox.mjs +169 -98
  21. package/dist/web/CheckBox/Group.js +111 -1
  22. package/dist/web/CheckBox/Group.mjs +104 -64
  23. package/dist/web/CheckBox/context.js +8 -1
  24. package/dist/web/CheckBox/context.mjs +2 -4
  25. package/dist/web/CheckBox/index.js +11 -1
  26. package/dist/web/CheckBox/index.mjs +2 -4
  27. package/dist/web/Dropdown/BDropdown.js +265 -1
  28. package/dist/web/Dropdown/BDropdown.mjs +233 -133
  29. package/dist/web/EmptyInputBox/EmptyInputBox.js +89 -1
  30. package/dist/web/EmptyInputBox/EmptyInputBox.mjs +85 -72
  31. package/dist/web/FileCard/FileCard.js +414 -1
  32. package/dist/web/FileCard/FileCard.mjs +400 -116
  33. package/dist/web/Icon/Icon.js +82 -1
  34. package/dist/web/Icon/Icon.mjs +78 -8
  35. package/dist/web/Input/Input.js +230 -1
  36. package/dist/web/Input/Input.mjs +219 -164
  37. package/dist/web/InputNumber/BInputNumber.js +271 -1
  38. package/dist/web/InputNumber/BInputNumber.mjs +254 -189
  39. package/dist/web/InputNumber/StepHandler.js +112 -1
  40. package/dist/web/InputNumber/StepHandler.mjs +102 -50
  41. package/dist/web/InputNumber/hooks/useCursor.js +38 -1
  42. package/dist/web/InputNumber/hooks/useCursor.mjs +31 -34
  43. package/dist/web/InputNumber/hooks/useFrame.js +15 -1
  44. package/dist/web/InputNumber/hooks/useFrame.mjs +8 -5
  45. package/dist/web/InputNumber/utils/decimal.js +163 -1
  46. package/dist/web/InputNumber/utils/decimal.mjs +114 -79
  47. package/dist/web/MobileDrawer/BMobileDrawer.js +238 -1
  48. package/dist/web/MobileDrawer/BMobileDrawer.mjs +221 -139
  49. package/dist/web/Modal/Modal.js +148 -1
  50. package/dist/web/Modal/Modal.mjs +143 -79
  51. package/dist/web/OverlayScrollbar/BOverlayScrollbar.js +273 -1
  52. package/dist/web/OverlayScrollbar/BOverlayScrollbar.mjs +262 -143
  53. package/dist/web/Pagination/Pagination.js +352 -1
  54. package/dist/web/Pagination/Pagination.mjs +342 -247
  55. package/dist/web/ProductField/ProductField.js +443 -1
  56. package/dist/web/ProductField/ProductField.mjs +423 -208
  57. package/dist/web/ProductField/arrow-up.svg.js +4 -1
  58. package/dist/web/ProductField/arrow-up.svg.mjs +2 -4
  59. package/dist/web/ProductField/checkbox-no.svg.js +4 -1
  60. package/dist/web/ProductField/checkbox-no.svg.mjs +2 -4
  61. package/dist/web/ProductField/checkbox-ok.svg.js +4 -1
  62. package/dist/web/ProductField/checkbox-ok.svg.mjs +2 -4
  63. package/dist/web/ProductField/no_data_light.svg.js +4 -1
  64. package/dist/web/ProductField/no_data_light.svg.mjs +2 -4
  65. package/dist/web/ProductField/search.svg.js +4 -1
  66. package/dist/web/ProductField/search.svg.mjs +2 -4
  67. package/dist/web/ProductField/sort.svg.js +4 -1
  68. package/dist/web/ProductField/sort.svg.mjs +2 -4
  69. package/dist/web/Radio/BRadio.js +151 -1
  70. package/dist/web/Radio/BRadio.mjs +147 -75
  71. package/dist/web/Radio/Button.js +54 -1
  72. package/dist/web/Radio/Button.mjs +51 -8
  73. package/dist/web/Radio/Group.js +97 -1
  74. package/dist/web/Radio/Group.mjs +92 -76
  75. package/dist/web/Radio/context.js +10 -1
  76. package/dist/web/Radio/context.mjs +3 -5
  77. package/dist/web/Radio/index.js +13 -1
  78. package/dist/web/Radio/index.mjs +2 -4
  79. package/dist/web/SkuInputCard/SkuInputCard.js +427 -1
  80. package/dist/web/SkuInputCard/SkuInputCard.mjs +414 -219
  81. package/dist/web/SkuInputCard/spin_loading_red.gif.js +4 -1
  82. package/dist/web/SkuInputCard/spin_loading_red.gif.mjs +2 -4
  83. package/dist/web/Switch/Switch.js +114 -1
  84. package/dist/web/Switch/Switch.mjs +109 -58
  85. package/dist/web/Table/BTable.js +1049 -1
  86. package/dist/web/Table/BTable.mjs +1011 -667
  87. package/dist/web/Table/Column.js +6 -1
  88. package/dist/web/Table/Column.mjs +1 -3
  89. package/dist/web/Table/ColumnGroup.js +6 -1
  90. package/dist/web/Table/ColumnGroup.mjs +1 -3
  91. package/dist/web/Table/utils/columns.js +116 -1
  92. package/dist/web/Table/utils/columns.mjs +103 -37
  93. package/dist/web/Table/utils/sortFilter.js +145 -1
  94. package/dist/web/Table/utils/sortFilter.mjs +129 -57
  95. package/dist/web/Tabs/BTabs.js +260 -1
  96. package/dist/web/Tabs/BTabs.mjs +239 -122
  97. package/dist/web/Tabs/TabPane.js +19 -1
  98. package/dist/web/Tabs/TabPane.mjs +1 -4
  99. package/dist/web/Tooltip/ConfirmTooltip.js +53 -1
  100. package/dist/web/Tooltip/ConfirmTooltip.mjs +47 -22
  101. package/dist/web/Tooltip/ContentTooltip.js +156 -1
  102. package/dist/web/Tooltip/ContentTooltip.mjs +145 -76
  103. package/dist/web/Tooltip/ProgressTooltip.js +56 -1
  104. package/dist/web/Tooltip/ProgressTooltip.mjs +50 -31
  105. package/dist/web/Tooltip/TooltipWrapper.js +19 -1
  106. package/dist/web/Tooltip/TooltipWrapper.mjs +13 -9
  107. package/dist/web/Tooltip/useAutoPlacement.js +65 -1
  108. package/dist/web/Tooltip/useAutoPlacement.mjs +52 -24
  109. package/dist/web.js +58 -1
  110. package/dist/web.mjs +1 -29
  111. package/package.json +3 -1
@@ -1,61 +1,112 @@
1
- import { jsx as t, jsxs as N } from "react/jsx-runtime";
2
- import { useState as x, useCallback as B } from "react";
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
- const C = ({
5
- checked: r,
6
- defaultChecked: u = !1,
7
- onChange: c,
8
- disabled: e = !1,
9
- loading: l = !1,
10
- checkedChildren: a,
11
- unCheckedChildren: o,
12
- theme: n = "light",
13
- activeColor: b,
14
- inactiveColor: w,
15
- className: d,
16
- style: k
17
- }) => {
18
- const i = r !== void 0, [v, f] = x(u), s = i ? r : v, p = B(() => {
19
- if (e || l) return;
20
- const h = !s;
21
- i || f(h), c == null || c(h);
22
- }, [s, e, l, i, c]), _ = s ? b ?? (n === "dark" ? "var(--bu-switch-dark-on)" : "var(--bu-switch-light-on)") : w ?? (n === "dark" ? "var(--bu-switch-dark-off)" : "var(--bu-switch-light-off)"), m = [
23
- "bu-switch",
24
- s && "bu-switch--checked",
25
- e && "bu-switch--disabled",
26
- l && "bu-switch--loading",
27
- d
28
- ].filter(Boolean).join(" ");
29
- return /* @__PURE__ */ t(
30
- "button",
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
- C.displayName = "BuSwitch";
59
- export {
60
- C as default
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 };