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,151 +1,233 @@
1
- import { jsxs as m, jsx as r, Fragment as H } from "react/jsx-runtime";
2
- import { useState as b, useRef as J, useEffect as h, useCallback as Q } from "react";
1
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
4
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
5
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
6
+ 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."); }
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
+ 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; } } }; }
10
+ 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; } }
11
+ 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; }
12
+ import { jsxs as _, jsx as t, Fragment as J } from "react/jsx-runtime";
13
+ import { useState as v, useRef as K, useEffect as w, useCallback as Q } from "react";
3
14
  import { createPortal as W } from "react-dom";
4
15
  import { BCheckBox as Y } from "../CheckBox/index.mjs";
5
16
  import Z from "../Icon/Icon.mjs";
6
17
  /* empty css */
7
- function $(...n) {
8
- return n.filter(Boolean).join(" ");
18
+ var $ = Object.defineProperty,
19
+ V = Object.getOwnPropertySymbols,
20
+ z = Object.prototype.hasOwnProperty,
21
+ ee = Object.prototype.propertyIsEnumerable,
22
+ B = function B(r, l, n) {
23
+ return l in r ? $(r, l, {
24
+ enumerable: !0,
25
+ configurable: !0,
26
+ writable: !0,
27
+ value: n
28
+ }) : r[l] = n;
29
+ },
30
+ re = function re(r, l) {
31
+ for (var n in l || (l = {})) z.call(l, n) && B(r, n, l[n]);
32
+ if (V) {
33
+ var _iterator = _createForOfIteratorHelper(V(l)),
34
+ _step;
35
+ try {
36
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
37
+ var n = _step.value;
38
+ ee.call(l, n) && B(r, n, l[n]);
39
+ }
40
+ } catch (err) {
41
+ _iterator.e(err);
42
+ } finally {
43
+ _iterator.f();
44
+ }
45
+ }
46
+ return r;
47
+ };
48
+ function le() {
49
+ for (var _len = arguments.length, r = new Array(_len), _key = 0; _key < _len; _key++) {
50
+ r[_key] = arguments[_key];
51
+ }
52
+ return r.filter(Boolean).join(" ");
9
53
  }
10
- const z = 240;
11
- function te({
12
- visible: n,
13
- defaultVisible: B = !1,
14
- title: V,
15
- options: y,
16
- value: p,
17
- defaultValue: E = [],
18
- onChange: f,
19
- onOK: v,
20
- onCancel: T,
21
- onClose: o,
22
- footer: s,
23
- t: c = (w) => w,
24
- okText: I = c("确定"),
25
- cancelText: A = c("取消"),
26
- emptyText: D,
27
- closable: F = !0,
28
- maskClosable: L = !0,
29
- maxHeight: M = "86.21vh",
30
- zIndex: j,
31
- className: R,
32
- style: S,
33
- getContainer: _
34
- }) {
35
- const [w, q] = b(B), [G, P] = b(E), u = n ?? w, a = p ?? G, [d, N] = b(u), [U, k] = b(u), l = J(null);
36
- h(() => {
37
- if (l.current && (clearTimeout(l.current), l.current = null), u) {
38
- N(!0);
39
- const e = requestAnimationFrame(() => k(!0));
40
- return () => cancelAnimationFrame(e);
54
+ var ne = 240;
55
+ function ue(_ref) {
56
+ var r = _ref.visible,
57
+ _ref$defaultVisible = _ref.defaultVisible,
58
+ l = _ref$defaultVisible === void 0 ? !1 : _ref$defaultVisible,
59
+ n = _ref.title,
60
+ h = _ref.options,
61
+ p = _ref.value,
62
+ _ref$defaultValue = _ref.defaultValue,
63
+ x = _ref$defaultValue === void 0 ? [] : _ref$defaultValue,
64
+ y = _ref.onChange,
65
+ j = _ref.onOK,
66
+ I = _ref.onCancel,
67
+ u = _ref.onClose,
68
+ s = _ref.footer,
69
+ _ref$t = _ref.t,
70
+ m = _ref$t === void 0 ? function (b) {
71
+ return b;
72
+ } : _ref$t,
73
+ _ref$okText = _ref.okText,
74
+ C = _ref$okText === void 0 ? m("确定") : _ref$okText,
75
+ _ref$cancelText = _ref.cancelText,
76
+ T = _ref$cancelText === void 0 ? m("取消") : _ref$cancelText,
77
+ N = _ref.emptyText,
78
+ _ref$closable = _ref.closable,
79
+ S = _ref$closable === void 0 ? !0 : _ref$closable,
80
+ _ref$maskClosable = _ref.maskClosable,
81
+ A = _ref$maskClosable === void 0 ? !0 : _ref$maskClosable,
82
+ _ref$maxHeight = _ref.maxHeight,
83
+ D = _ref$maxHeight === void 0 ? "86.21vh" : _ref$maxHeight,
84
+ k = _ref.zIndex,
85
+ F = _ref.className,
86
+ L = _ref.style,
87
+ O = _ref.getContainer;
88
+ var b;
89
+ var _v = v(l),
90
+ _v2 = _slicedToArray(_v, 2),
91
+ M = _v2[0],
92
+ R = _v2[1],
93
+ _v3 = v(x),
94
+ _v4 = _slicedToArray(_v3, 2),
95
+ q = _v4[0],
96
+ G = _v4[1],
97
+ f = r != null ? r : M,
98
+ d = p != null ? p : q,
99
+ _v5 = v(f),
100
+ _v6 = _slicedToArray(_v5, 2),
101
+ c = _v6[0],
102
+ g = _v6[1],
103
+ _v7 = v(f),
104
+ _v8 = _slicedToArray(_v7, 2),
105
+ U = _v8[0],
106
+ E = _v8[1],
107
+ a = K(null);
108
+ w(function () {
109
+ if (a.current && (clearTimeout(a.current), a.current = null), f) {
110
+ g(!0);
111
+ var e = requestAnimationFrame(function () {
112
+ return E(!0);
113
+ });
114
+ return function () {
115
+ return cancelAnimationFrame(e);
116
+ };
41
117
  }
42
- return k(!1), l.current = setTimeout(() => {
43
- l.current = null, N(!1);
44
- }, z), () => {
45
- l.current && (clearTimeout(l.current), l.current = null);
118
+ return E(!1), a.current = setTimeout(function () {
119
+ a.current = null, g(!1);
120
+ }, ne), function () {
121
+ a.current && (clearTimeout(a.current), a.current = null);
46
122
  };
47
- }, [u]), h(() => {
48
- if (!d || typeof document > "u") return;
49
- const { body: e } = document, i = e.style.overflow;
50
- return e.style.overflow = "hidden", () => {
51
- e.style.overflow = i;
123
+ }, [f]), w(function () {
124
+ if (!c || typeof document == "undefined") return;
125
+ var _document = document,
126
+ e = _document.body,
127
+ o = e.style.overflow;
128
+ return e.style.overflow = "hidden", function () {
129
+ e.style.overflow = o;
52
130
  };
53
- }, [d]);
54
- const t = Q((e) => {
55
- n === void 0 && q(!1), e == null || e();
56
- }, [n]);
57
- h(() => {
58
- if (!d || typeof document > "u") return;
59
- const e = (i) => {
60
- i.key === "Escape" && t(o);
131
+ }, [c]);
132
+ var i = Q(function (e) {
133
+ r === void 0 && R(!1), e == null || e();
134
+ }, [r]);
135
+ w(function () {
136
+ if (!c || typeof document == "undefined") return;
137
+ var e = function e(o) {
138
+ o.key === "Escape" && i(u);
61
139
  };
62
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
63
- }, [t, d, o]);
64
- const X = (e) => {
140
+ return document.addEventListener("keydown", e), function () {
141
+ return document.removeEventListener("keydown", e);
142
+ };
143
+ }, [i, c, u]);
144
+ var X = function X(e) {
65
145
  if (e.disabled) return;
66
- const i = a.includes(e.value) ? a.filter((g) => g !== e.value) : [...a, e.value];
67
- p === void 0 && P(i), f == null || f(i, e);
146
+ var o = d.includes(e.value) ? d.filter(function (H) {
147
+ return H !== e.value;
148
+ }) : [].concat(_toConsumableArray(d), [e.value]);
149
+ p === void 0 && G(o), y == null || y(o, e);
68
150
  };
69
- if (!d || typeof document > "u") return null;
70
- const x = (_ == null ? void 0 : _()) ?? document.body;
71
- return x ? W(
72
- /* @__PURE__ */ m(
73
- "div",
74
- {
75
- className: $("bj-mobile-drawer", U && "bj-mobile-drawer--open", R),
76
- style: j === void 0 ? void 0 : { zIndex: j },
77
- children: [
78
- /* @__PURE__ */ r(
79
- "div",
80
- {
81
- "aria-hidden": "true",
82
- className: "bj-mobile-drawer__mask",
83
- onClick: L ? () => t(o) : void 0
84
- }
85
- ),
86
- /* @__PURE__ */ m(
87
- "div",
88
- {
89
- "aria-modal": "true",
90
- className: "bj-mobile-drawer__panel",
91
- role: "dialog",
92
- style: { maxHeight: M, ...S },
93
- children: [
94
- /* @__PURE__ */ m("div", { className: "bj-mobile-drawer__header", children: [
95
- /* @__PURE__ */ r("div", { className: "bj-mobile-drawer__title", children: V }),
96
- F && /* @__PURE__ */ r(
97
- "button",
98
- {
99
- "aria-label": c("关闭"),
100
- className: "bj-mobile-drawer__close",
101
- onClick: () => t(o),
102
- type: "button",
103
- children: /* @__PURE__ */ r(Z, { type: "icon-a-guanbixi" })
104
- }
105
- )
106
- ] }),
107
- /* @__PURE__ */ r("div", { className: "bj-mobile-drawer__body", children: y.length > 0 ? y.map((e) => /* @__PURE__ */ r(
108
- Y,
109
- {
110
- checked: a.includes(e.value),
111
- className: "bj-mobile-drawer__option",
112
- disabled: e.disabled,
113
- onChange: () => X(e),
114
- shape: "circle",
115
- skipGroup: !0,
116
- children: /* @__PURE__ */ r("span", { className: "bj-mobile-drawer__option-label", children: e.label })
117
- },
118
- String(e.value)
119
- )) : /* @__PURE__ */ r("div", { className: "bj-mobile-drawer__empty", children: D ?? c("暂无数据") }) }),
120
- s !== !1 && /* @__PURE__ */ r("div", { className: "bj-mobile-drawer__footer", children: s === void 0 || s === !0 ? /* @__PURE__ */ m(H, { children: [
121
- /* @__PURE__ */ r(
122
- "button",
123
- {
124
- className: "bj-mobile-drawer__action",
125
- onClick: () => t(T),
126
- type: "button",
127
- children: A
128
- }
129
- ),
130
- /* @__PURE__ */ r(
131
- "button",
132
- {
133
- className: "bj-mobile-drawer__action bj-mobile-drawer__action--primary",
134
- onClick: () => t(() => v == null ? void 0 : v(a)),
135
- type: "button",
136
- children: I
137
- }
138
- )
139
- ] }) : s })
140
- ]
141
- }
142
- )
143
- ]
144
- }
145
- ),
146
- x
147
- ) : null;
151
+ if (!c || typeof document == "undefined") return null;
152
+ var P = (b = O == null ? void 0 : O()) != null ? b : document.body;
153
+ return P ? W(/* @__PURE__ */_("div", {
154
+ className: le("bj-mobile-drawer", U && "bj-mobile-drawer--open", F),
155
+ style: k === void 0 ? void 0 : {
156
+ zIndex: k
157
+ },
158
+ children: [/* @__PURE__ */t("div", {
159
+ "aria-hidden": "true",
160
+ className: "bj-mobile-drawer__mask",
161
+ onClick: A ? function () {
162
+ return i(u);
163
+ } : void 0
164
+ }), /* @__PURE__ */_("div", {
165
+ "aria-modal": "true",
166
+ className: "bj-mobile-drawer__panel",
167
+ role: "dialog",
168
+ style: re({
169
+ maxHeight: D
170
+ }, L),
171
+ children: [/* @__PURE__ */_("div", {
172
+ className: "bj-mobile-drawer__header",
173
+ children: [/* @__PURE__ */t("div", {
174
+ className: "bj-mobile-drawer__title",
175
+ children: n
176
+ }), S && /* @__PURE__ */t("button", {
177
+ "aria-label": m("关闭"),
178
+ className: "bj-mobile-drawer__close",
179
+ onClick: function onClick() {
180
+ return i(u);
181
+ },
182
+ type: "button",
183
+ children: /* @__PURE__ */t(Z, {
184
+ type: "icon-a-guanbixi"
185
+ })
186
+ })]
187
+ }), /* @__PURE__ */t("div", {
188
+ className: "bj-mobile-drawer__body",
189
+ children: h.length > 0 ? h.map(function (e) {
190
+ return /* @__PURE__ */t(Y, {
191
+ checked: d.includes(e.value),
192
+ className: "bj-mobile-drawer__option",
193
+ disabled: e.disabled,
194
+ onChange: function onChange() {
195
+ return X(e);
196
+ },
197
+ shape: "circle",
198
+ skipGroup: !0,
199
+ children: /* @__PURE__ */t("span", {
200
+ className: "bj-mobile-drawer__option-label",
201
+ children: e.label
202
+ })
203
+ }, String(e.value));
204
+ }) : /* @__PURE__ */t("div", {
205
+ className: "bj-mobile-drawer__empty",
206
+ children: N != null ? N : m("暂无数据")
207
+ })
208
+ }), s !== !1 && /* @__PURE__ */t("div", {
209
+ className: "bj-mobile-drawer__footer",
210
+ children: s === void 0 || s === !0 ? /* @__PURE__ */_(J, {
211
+ children: [/* @__PURE__ */t("button", {
212
+ className: "bj-mobile-drawer__action",
213
+ onClick: function onClick() {
214
+ return i(I);
215
+ },
216
+ type: "button",
217
+ children: T
218
+ }), /* @__PURE__ */t("button", {
219
+ className: "bj-mobile-drawer__action bj-mobile-drawer__action--primary",
220
+ onClick: function onClick() {
221
+ return i(function () {
222
+ return j == null ? void 0 : j(d);
223
+ });
224
+ },
225
+ type: "button",
226
+ children: C
227
+ })]
228
+ }) : s
229
+ })]
230
+ })]
231
+ }), P) : null;
148
232
  }
149
- export {
150
- te as BMobileDrawer
151
- };
233
+ export { ue as BMobileDrawer };
@@ -1 +1,148 @@
1
- "use strict";const l=require("react/jsx-runtime");;/* empty css */function w({open:u=!1,title:r="标题",mode:o="standard",children:_,okText:b="确认",cancelText:m="取消",onOk:x,onCancel:j,onClose:i,activeLang:n="zh",onLangChange:s,labels:t,hint:c,confirmLoading:e=!1,width:a,className:N,style:d}){const h=(t==null?void 0:t.zh)??"中文",p=(t==null?void 0:t.en)??"EN";if(!u)return null;const v=o==="bilingual",k=o==="single",y=a!=null?{width:a,...d}:d;return l.jsx("div",{className:["bu-modal__overlay",N].filter(Boolean).join(" "),onClick:i,children:l.jsxs("div",{className:"bu-modal__container",style:y,onClick:f=>f.stopPropagation(),children:[l.jsxs("div",{className:"bu-modal__header",children:[l.jsx("p",{className:"bu-modal__title",children:r}),v&&l.jsxs("div",{className:"bu-modal__lang-toggle",children:[l.jsx("button",{type:"button",className:`bu-modal__lang-btn${n==="zh"?" bu-modal__lang-btn--active":""}`,onClick:()=>s==null?void 0:s("zh"),children:h}),l.jsx("button",{type:"button",className:`bu-modal__lang-btn${n==="en"?" bu-modal__lang-btn--active":""}`,onClick:()=>s==null?void 0:s("en"),children:p})]}),l.jsx("button",{type:"button",className:"bu-modal__close",onClick:i,children:l.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M16.5613 6.73027C16.7558 6.53571 17.0723 6.53442 17.2684 6.72736C17.4644 6.92032 17.4657 7.23444 17.2713 7.42901L12.7036 12.0002L17.2713 16.5714C17.4657 16.766 17.4644 17.0801 17.2684 17.273C17.0723 17.4659 16.7558 17.4646 16.5613 17.2701L11.9996 12.7047L7.43794 17.2701C7.24352 17.4647 6.92699 17.4659 6.73091 17.273C6.53485 17.0801 6.53355 16.7659 6.72798 16.5714L11.2955 12.0002L6.72798 7.42901C6.53355 7.23442 6.53485 6.92032 6.73091 6.72736C6.92698 6.53442 7.2435 6.53571 7.43794 6.73027L11.9996 11.2955L16.5613 6.73027Z",fill:"currentColor"})})})]}),l.jsx("div",{className:"bu-modal__body",children:_}),l.jsxs("div",{className:"bu-modal__footer",children:[c&&l.jsx("p",{className:"bu-modal__hint",children:c}),l.jsxs("div",{className:"bu-modal__btn-row",children:[!k&&l.jsx("button",{type:"button",className:"bu-modal__btn-cancel",onClick:j??i,children:m}),l.jsxs("button",{type:"button",className:["bu-modal__btn-ok",e?"bu-modal__btn-ok--loading":""].filter(Boolean).join(" "),disabled:e,onClick:e?void 0:x,children:[e&&l.jsx("span",{className:"bu-modal__btn-ok-spinner"}),b]})]})]})]})})}module.exports=w;
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 l = require("react/jsx-runtime");
7
+ ; /* empty css */
8
+ var P = Object.defineProperty,
9
+ p = Object.getOwnPropertySymbols,
10
+ z = Object.prototype.hasOwnProperty,
11
+ B = Object.prototype.propertyIsEnumerable,
12
+ v = function v(t, e, n) {
13
+ return e in t ? P(t, e, {
14
+ enumerable: !0,
15
+ configurable: !0,
16
+ writable: !0,
17
+ value: n
18
+ }) : t[e] = n;
19
+ },
20
+ S = function S(t, e) {
21
+ for (var n in e || (e = {})) z.call(e, n) && v(t, n, e[n]);
22
+ if (p) {
23
+ var _iterator = _createForOfIteratorHelper(p(e)),
24
+ _step;
25
+ try {
26
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
27
+ var n = _step.value;
28
+ B.call(e, n) && v(t, n, e[n]);
29
+ }
30
+ } catch (err) {
31
+ _iterator.e(err);
32
+ } finally {
33
+ _iterator.f();
34
+ }
35
+ }
36
+ return t;
37
+ };
38
+ function E(_ref) {
39
+ var _ref$open = _ref.open,
40
+ t = _ref$open === void 0 ? !1 : _ref$open,
41
+ _ref$title = _ref.title,
42
+ e = _ref$title === void 0 ? "标题" : _ref$title,
43
+ _ref$mode = _ref.mode,
44
+ n = _ref$mode === void 0 ? "standard" : _ref$mode,
45
+ h = _ref.children,
46
+ _ref$okText = _ref.okText,
47
+ j = _ref$okText === void 0 ? "确认" : _ref$okText,
48
+ _ref$cancelText = _ref.cancelText,
49
+ x = _ref$cancelText === void 0 ? "取消" : _ref$cancelText,
50
+ N = _ref.onOk,
51
+ i = _ref.onCancel,
52
+ r = _ref.onClose,
53
+ _ref$activeLang = _ref.activeLang,
54
+ u = _ref$activeLang === void 0 ? "zh" : _ref$activeLang,
55
+ a = _ref.onLangChange,
56
+ s = _ref.labels,
57
+ c = _ref.hint,
58
+ _ref$confirmLoading = _ref.confirmLoading,
59
+ o = _ref$confirmLoading === void 0 ? !1 : _ref$confirmLoading,
60
+ d = _ref.width,
61
+ f = _ref.className,
62
+ _ = _ref.style;
63
+ var b, m;
64
+ var y = (b = s == null ? void 0 : s.zh) != null ? b : "中文",
65
+ w = (m = s == null ? void 0 : s.en) != null ? m : "EN";
66
+ if (!t) return null;
67
+ var g = n === "bilingual",
68
+ C = n === "single",
69
+ k = d != null ? S({
70
+ width: d
71
+ }, _) : _;
72
+ return l.jsx("div", {
73
+ className: ["bu-modal__overlay", f].filter(Boolean).join(" "),
74
+ onClick: r,
75
+ children: l.jsxs("div", {
76
+ className: "bu-modal__container",
77
+ style: k,
78
+ onClick: function onClick(O) {
79
+ return O.stopPropagation();
80
+ },
81
+ children: [l.jsxs("div", {
82
+ className: "bu-modal__header",
83
+ children: [l.jsx("p", {
84
+ className: "bu-modal__title",
85
+ children: e
86
+ }), g && l.jsxs("div", {
87
+ className: "bu-modal__lang-toggle",
88
+ children: [l.jsx("button", {
89
+ type: "button",
90
+ className: "bu-modal__lang-btn".concat(u === "zh" ? " bu-modal__lang-btn--active" : ""),
91
+ onClick: function onClick() {
92
+ return a == null ? void 0 : a("zh");
93
+ },
94
+ children: y
95
+ }), l.jsx("button", {
96
+ type: "button",
97
+ className: "bu-modal__lang-btn".concat(u === "en" ? " bu-modal__lang-btn--active" : ""),
98
+ onClick: function onClick() {
99
+ return a == null ? void 0 : a("en");
100
+ },
101
+ children: w
102
+ })]
103
+ }), l.jsx("button", {
104
+ type: "button",
105
+ className: "bu-modal__close",
106
+ onClick: r,
107
+ children: l.jsx("svg", {
108
+ width: "24",
109
+ height: "24",
110
+ viewBox: "0 0 24 24",
111
+ fill: "none",
112
+ xmlns: "http://www.w3.org/2000/svg",
113
+ children: l.jsx("path", {
114
+ d: "M16.5613 6.73027C16.7558 6.53571 17.0723 6.53442 17.2684 6.72736C17.4644 6.92032 17.4657 7.23444 17.2713 7.42901L12.7036 12.0002L17.2713 16.5714C17.4657 16.766 17.4644 17.0801 17.2684 17.273C17.0723 17.4659 16.7558 17.4646 16.5613 17.2701L11.9996 12.7047L7.43794 17.2701C7.24352 17.4647 6.92699 17.4659 6.73091 17.273C6.53485 17.0801 6.53355 16.7659 6.72798 16.5714L11.2955 12.0002L6.72798 7.42901C6.53355 7.23442 6.53485 6.92032 6.73091 6.72736C6.92698 6.53442 7.2435 6.53571 7.43794 6.73027L11.9996 11.2955L16.5613 6.73027Z",
115
+ fill: "currentColor"
116
+ })
117
+ })
118
+ })]
119
+ }), l.jsx("div", {
120
+ className: "bu-modal__body",
121
+ children: h
122
+ }), l.jsxs("div", {
123
+ className: "bu-modal__footer",
124
+ children: [c && l.jsx("p", {
125
+ className: "bu-modal__hint",
126
+ children: c
127
+ }), l.jsxs("div", {
128
+ className: "bu-modal__btn-row",
129
+ children: [!C && l.jsx("button", {
130
+ type: "button",
131
+ className: "bu-modal__btn-cancel",
132
+ onClick: i != null ? i : r,
133
+ children: x
134
+ }), l.jsxs("button", {
135
+ type: "button",
136
+ className: ["bu-modal__btn-ok", o ? "bu-modal__btn-ok--loading" : ""].filter(Boolean).join(" "),
137
+ disabled: o,
138
+ onClick: o ? void 0 : N,
139
+ children: [o && l.jsx("span", {
140
+ className: "bu-modal__btn-ok-spinner"
141
+ }), j]
142
+ })]
143
+ })]
144
+ })]
145
+ })
146
+ });
147
+ }
148
+ module.exports = E;