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.
Files changed (113) hide show
  1. package/README.md +10 -1
  2. package/dist/index.d.ts +160 -15
  3. package/dist/index.js +58 -1
  4. package/dist/index.mjs +15 -39
  5. package/dist/miniapp.js +1 -1
  6. package/dist/miniapp.mjs +0 -1
  7. package/dist/mobile.js +1 -1
  8. package/dist/mobile.mjs +0 -1
  9. package/dist/react.js +1 -1
  10. package/dist/react.mjs +0 -1
  11. package/dist/shared.js +1 -1
  12. package/dist/shared.mjs +0 -1
  13. package/dist/style.css +1 -1
  14. package/dist/web/BasicInput/BInput.js +278 -1
  15. package/dist/web/BasicInput/BInput.mjs +263 -164
  16. package/dist/web/BasicInput/utils.js +47 -1
  17. package/dist/web/BasicInput/utils.mjs +22 -20
  18. package/dist/web/CategoryDropdown/CategoryDropdown.js +376 -1
  19. package/dist/web/CategoryDropdown/CategoryDropdown.mjs +355 -235
  20. package/dist/web/CheckBox/BCheckBox.js +176 -1
  21. package/dist/web/CheckBox/BCheckBox.mjs +169 -96
  22. package/dist/web/CheckBox/Group.js +111 -1
  23. package/dist/web/CheckBox/Group.mjs +106 -64
  24. package/dist/web/CheckBox/context.js +8 -1
  25. package/dist/web/CheckBox/context.mjs +2 -4
  26. package/dist/web/CheckBox/index.js +11 -1
  27. package/dist/web/CheckBox/index.mjs +2 -4
  28. package/dist/web/Dropdown/BDropdown.js +265 -1
  29. package/dist/web/Dropdown/BDropdown.mjs +234 -134
  30. package/dist/web/EmptyInputBox/EmptyInputBox.js +89 -1
  31. package/dist/web/EmptyInputBox/EmptyInputBox.mjs +85 -72
  32. package/dist/web/FileCard/FileCard.js +414 -1
  33. package/dist/web/FileCard/FileCard.mjs +400 -116
  34. package/dist/web/Icon/Icon.js +82 -1
  35. package/dist/web/Icon/Icon.mjs +78 -8
  36. package/dist/web/Input/Input.js +230 -1
  37. package/dist/web/Input/Input.mjs +219 -164
  38. package/dist/web/InputNumber/BInputNumber.js +271 -1
  39. package/dist/web/InputNumber/BInputNumber.mjs +254 -189
  40. package/dist/web/InputNumber/StepHandler.js +112 -1
  41. package/dist/web/InputNumber/StepHandler.mjs +102 -50
  42. package/dist/web/InputNumber/hooks/useCursor.js +38 -1
  43. package/dist/web/InputNumber/hooks/useCursor.mjs +31 -34
  44. package/dist/web/InputNumber/hooks/useFrame.js +15 -1
  45. package/dist/web/InputNumber/hooks/useFrame.mjs +8 -5
  46. package/dist/web/InputNumber/utils/decimal.js +163 -1
  47. package/dist/web/InputNumber/utils/decimal.mjs +114 -79
  48. package/dist/web/MobileDrawer/BMobileDrawer.js +238 -0
  49. package/dist/web/MobileDrawer/BMobileDrawer.mjs +233 -0
  50. package/dist/web/Modal/Modal.js +148 -1
  51. package/dist/web/Modal/Modal.mjs +143 -79
  52. package/dist/web/OverlayScrollbar/BOverlayScrollbar.js +273 -1
  53. package/dist/web/OverlayScrollbar/BOverlayScrollbar.mjs +262 -143
  54. package/dist/web/Pagination/Pagination.js +352 -1
  55. package/dist/web/Pagination/Pagination.mjs +342 -247
  56. package/dist/web/ProductField/ProductField.js +443 -1
  57. package/dist/web/ProductField/ProductField.mjs +423 -208
  58. package/dist/web/ProductField/arrow-up.svg.js +4 -1
  59. package/dist/web/ProductField/arrow-up.svg.mjs +2 -4
  60. package/dist/web/ProductField/checkbox-no.svg.js +4 -1
  61. package/dist/web/ProductField/checkbox-no.svg.mjs +2 -4
  62. package/dist/web/ProductField/checkbox-ok.svg.js +4 -1
  63. package/dist/web/ProductField/checkbox-ok.svg.mjs +2 -4
  64. package/dist/web/ProductField/no_data_light.svg.js +4 -1
  65. package/dist/web/ProductField/no_data_light.svg.mjs +2 -4
  66. package/dist/web/ProductField/search.svg.js +4 -1
  67. package/dist/web/ProductField/search.svg.mjs +2 -4
  68. package/dist/web/ProductField/sort.svg.js +4 -1
  69. package/dist/web/ProductField/sort.svg.mjs +2 -4
  70. package/dist/web/Radio/BRadio.js +151 -0
  71. package/dist/web/Radio/BRadio.mjs +151 -0
  72. package/dist/web/Radio/Button.js +54 -0
  73. package/dist/web/Radio/Button.mjs +52 -0
  74. package/dist/web/Radio/Group.js +97 -0
  75. package/dist/web/Radio/Group.mjs +96 -0
  76. package/dist/web/Radio/context.js +10 -0
  77. package/dist/web/Radio/context.mjs +4 -0
  78. package/dist/web/Radio/index.js +13 -0
  79. package/dist/web/Radio/index.mjs +8 -0
  80. package/dist/web/SkuInputCard/SkuInputCard.js +427 -1
  81. package/dist/web/SkuInputCard/SkuInputCard.mjs +414 -219
  82. package/dist/web/SkuInputCard/spin_loading_red.gif.js +4 -1
  83. package/dist/web/SkuInputCard/spin_loading_red.gif.mjs +2 -4
  84. package/dist/web/Switch/Switch.js +114 -1
  85. package/dist/web/Switch/Switch.mjs +109 -58
  86. package/dist/web/Table/BTable.js +1049 -1
  87. package/dist/web/Table/BTable.mjs +1011 -667
  88. package/dist/web/Table/Column.js +6 -1
  89. package/dist/web/Table/Column.mjs +1 -3
  90. package/dist/web/Table/ColumnGroup.js +6 -1
  91. package/dist/web/Table/ColumnGroup.mjs +1 -3
  92. package/dist/web/Table/utils/columns.js +116 -1
  93. package/dist/web/Table/utils/columns.mjs +103 -37
  94. package/dist/web/Table/utils/sortFilter.js +145 -1
  95. package/dist/web/Table/utils/sortFilter.mjs +129 -57
  96. package/dist/web/Tabs/BTabs.js +260 -1
  97. package/dist/web/Tabs/BTabs.mjs +239 -122
  98. package/dist/web/Tabs/TabPane.js +19 -1
  99. package/dist/web/Tabs/TabPane.mjs +1 -4
  100. package/dist/web/Tooltip/ConfirmTooltip.js +53 -1
  101. package/dist/web/Tooltip/ConfirmTooltip.mjs +47 -22
  102. package/dist/web/Tooltip/ContentTooltip.js +156 -1
  103. package/dist/web/Tooltip/ContentTooltip.mjs +145 -76
  104. package/dist/web/Tooltip/ProgressTooltip.js +56 -1
  105. package/dist/web/Tooltip/ProgressTooltip.mjs +50 -31
  106. package/dist/web/Tooltip/TooltipWrapper.js +19 -1
  107. package/dist/web/Tooltip/TooltipWrapper.mjs +13 -9
  108. package/dist/web/Tooltip/useAutoPlacement.js +65 -1
  109. package/dist/web/Tooltip/useAutoPlacement.mjs +52 -24
  110. package/dist/web.d.ts +160 -15
  111. package/dist/web.js +58 -1
  112. package/dist/web.mjs +15 -39
  113. package/package.json +97 -94
@@ -0,0 +1,233 @@
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";
14
+ import { createPortal as W } from "react-dom";
15
+ import { BCheckBox as Y } from "../CheckBox/index.mjs";
16
+ import Z from "../Icon/Icon.mjs";
17
+ /* empty css */
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(" ");
53
+ }
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
+ };
117
+ }
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);
122
+ };
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;
130
+ };
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);
139
+ };
140
+ return document.addEventListener("keydown", e), function () {
141
+ return document.removeEventListener("keydown", e);
142
+ };
143
+ }, [i, c, u]);
144
+ var X = function X(e) {
145
+ if (e.disabled) return;
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);
150
+ };
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;
232
+ }
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;
@@ -1,82 +1,146 @@
1
- import { jsx as l, jsxs as i } from "react/jsx-runtime";
1
+ 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; } } }; }
2
+ 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; } }
3
+ 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; }
4
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
5
  /* empty css */
3
- function j({
4
- open: _ = !1,
5
- title: r = "标题",
6
- mode: n = "standard",
7
- children: b,
8
- okText: m = "确认",
9
- cancelText: p = "取消",
10
- onOk: N,
11
- onCancel: h,
12
- onClose: a,
13
- activeLang: c = "zh",
14
- onLangChange: t,
15
- labels: o,
16
- hint: d,
17
- confirmLoading: e = !1,
18
- width: s,
19
- className: v,
20
- style: u
21
- }) {
22
- const k = (o == null ? void 0 : o.zh) ?? "中文", f = (o == null ? void 0 : o.en) ?? "EN";
23
- if (!_) return null;
24
- const y = n === "bilingual", w = n === "single", x = s != null ? { width: s, ...u } : u;
25
- return /* @__PURE__ */ l("div", { className: ["bu-modal__overlay", v].filter(Boolean).join(" "), onClick: a, children: /* @__PURE__ */ i(
26
- "div",
27
- {
28
- className: "bu-modal__container",
29
- style: x,
30
- onClick: (z) => z.stopPropagation(),
31
- children: [
32
- /* @__PURE__ */ i("div", { className: "bu-modal__header", children: [
33
- /* @__PURE__ */ l("p", { className: "bu-modal__title", children: r }),
34
- y && /* @__PURE__ */ i("div", { className: "bu-modal__lang-toggle", children: [
35
- /* @__PURE__ */ l(
36
- "button",
37
- {
38
- type: "button",
39
- className: `bu-modal__lang-btn${c === "zh" ? " bu-modal__lang-btn--active" : ""}`,
40
- onClick: () => t == null ? void 0 : t("zh"),
41
- children: k
42
- }
43
- ),
44
- /* @__PURE__ */ l(
45
- "button",
46
- {
47
- type: "button",
48
- className: `bu-modal__lang-btn${c === "en" ? " bu-modal__lang-btn--active" : ""}`,
49
- onClick: () => t == null ? void 0 : t("en"),
50
- children: f
51
- }
52
- )
53
- ] }),
54
- /* @__PURE__ */ l("button", { type: "button", className: "bu-modal__close", onClick: a, children: /* @__PURE__ */ l("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ l("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" }) }) })
55
- ] }),
56
- /* @__PURE__ */ l("div", { className: "bu-modal__body", children: b }),
57
- /* @__PURE__ */ i("div", { className: "bu-modal__footer", children: [
58
- d && /* @__PURE__ */ l("p", { className: "bu-modal__hint", children: d }),
59
- /* @__PURE__ */ i("div", { className: "bu-modal__btn-row", children: [
60
- !w && /* @__PURE__ */ l("button", { type: "button", className: "bu-modal__btn-cancel", onClick: h ?? a, children: p }),
61
- /* @__PURE__ */ i(
62
- "button",
63
- {
64
- type: "button",
65
- className: ["bu-modal__btn-ok", e ? "bu-modal__btn-ok--loading" : ""].filter(Boolean).join(" "),
66
- disabled: e,
67
- onClick: e ? void 0 : N,
68
- children: [
69
- e && /* @__PURE__ */ l("span", { className: "bu-modal__btn-ok-spinner" }),
70
- m
71
- ]
72
- }
73
- )
74
- ] })
75
- ] })
76
- ]
6
+ var z = Object.defineProperty,
7
+ v = Object.getOwnPropertySymbols,
8
+ B = Object.prototype.hasOwnProperty,
9
+ S = Object.prototype.propertyIsEnumerable,
10
+ h = function h(a, l, e) {
11
+ return l in a ? z(a, l, {
12
+ enumerable: !0,
13
+ configurable: !0,
14
+ writable: !0,
15
+ value: e
16
+ }) : a[l] = e;
17
+ },
18
+ E = function E(a, l) {
19
+ for (var e in l || (l = {})) B.call(l, e) && h(a, e, l[e]);
20
+ if (v) {
21
+ var _iterator = _createForOfIteratorHelper(v(l)),
22
+ _step;
23
+ try {
24
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
25
+ var e = _step.value;
26
+ S.call(l, e) && h(a, e, l[e]);
27
+ }
28
+ } catch (err) {
29
+ _iterator.e(err);
30
+ } finally {
31
+ _iterator.f();
32
+ }
77
33
  }
78
- ) });
34
+ return a;
35
+ };
36
+ function M(_ref) {
37
+ var _ref$open = _ref.open,
38
+ a = _ref$open === void 0 ? !1 : _ref$open,
39
+ _ref$title = _ref.title,
40
+ l = _ref$title === void 0 ? "标题" : _ref$title,
41
+ _ref$mode = _ref.mode,
42
+ e = _ref$mode === void 0 ? "standard" : _ref$mode,
43
+ f = _ref.children,
44
+ _ref$okText = _ref.okText,
45
+ N = _ref$okText === void 0 ? "确认" : _ref$okText,
46
+ _ref$cancelText = _ref.cancelText,
47
+ y = _ref$cancelText === void 0 ? "取消" : _ref$cancelText,
48
+ w = _ref.onOk,
49
+ d = _ref.onCancel,
50
+ s = _ref.onClose,
51
+ _ref$activeLang = _ref.activeLang,
52
+ u = _ref$activeLang === void 0 ? "zh" : _ref$activeLang,
53
+ o = _ref.onLangChange,
54
+ r = _ref.labels,
55
+ c = _ref.hint,
56
+ _ref$confirmLoading = _ref.confirmLoading,
57
+ i = _ref$confirmLoading === void 0 ? !1 : _ref$confirmLoading,
58
+ _ = _ref.width,
59
+ g = _ref.className,
60
+ b = _ref.style;
61
+ var m, p;
62
+ var C = (m = r == null ? void 0 : r.zh) != null ? m : "中文",
63
+ k = (p = r == null ? void 0 : r.en) != null ? p : "EN";
64
+ if (!a) return null;
65
+ var O = e === "bilingual",
66
+ P = e === "single",
67
+ j = _ != null ? E({
68
+ width: _
69
+ }, b) : b;
70
+ return /* @__PURE__ */t("div", {
71
+ className: ["bu-modal__overlay", g].filter(Boolean).join(" "),
72
+ onClick: s,
73
+ children: /* @__PURE__ */n("div", {
74
+ className: "bu-modal__container",
75
+ style: j,
76
+ onClick: function onClick(x) {
77
+ return x.stopPropagation();
78
+ },
79
+ children: [/* @__PURE__ */n("div", {
80
+ className: "bu-modal__header",
81
+ children: [/* @__PURE__ */t("p", {
82
+ className: "bu-modal__title",
83
+ children: l
84
+ }), O && /* @__PURE__ */n("div", {
85
+ className: "bu-modal__lang-toggle",
86
+ children: [/* @__PURE__ */t("button", {
87
+ type: "button",
88
+ className: "bu-modal__lang-btn".concat(u === "zh" ? " bu-modal__lang-btn--active" : ""),
89
+ onClick: function onClick() {
90
+ return o == null ? void 0 : o("zh");
91
+ },
92
+ children: C
93
+ }), /* @__PURE__ */t("button", {
94
+ type: "button",
95
+ className: "bu-modal__lang-btn".concat(u === "en" ? " bu-modal__lang-btn--active" : ""),
96
+ onClick: function onClick() {
97
+ return o == null ? void 0 : o("en");
98
+ },
99
+ children: k
100
+ })]
101
+ }), /* @__PURE__ */t("button", {
102
+ type: "button",
103
+ className: "bu-modal__close",
104
+ onClick: s,
105
+ children: /* @__PURE__ */t("svg", {
106
+ width: "24",
107
+ height: "24",
108
+ viewBox: "0 0 24 24",
109
+ fill: "none",
110
+ xmlns: "http://www.w3.org/2000/svg",
111
+ children: /* @__PURE__ */t("path", {
112
+ 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",
113
+ fill: "currentColor"
114
+ })
115
+ })
116
+ })]
117
+ }), /* @__PURE__ */t("div", {
118
+ className: "bu-modal__body",
119
+ children: f
120
+ }), /* @__PURE__ */n("div", {
121
+ className: "bu-modal__footer",
122
+ children: [c && /* @__PURE__ */t("p", {
123
+ className: "bu-modal__hint",
124
+ children: c
125
+ }), /* @__PURE__ */n("div", {
126
+ className: "bu-modal__btn-row",
127
+ children: [!P && /* @__PURE__ */t("button", {
128
+ type: "button",
129
+ className: "bu-modal__btn-cancel",
130
+ onClick: d != null ? d : s,
131
+ children: y
132
+ }), /* @__PURE__ */n("button", {
133
+ type: "button",
134
+ className: ["bu-modal__btn-ok", i ? "bu-modal__btn-ok--loading" : ""].filter(Boolean).join(" "),
135
+ disabled: i,
136
+ onClick: i ? void 0 : w,
137
+ children: [i && /* @__PURE__ */t("span", {
138
+ className: "bu-modal__btn-ok-spinner"
139
+ }), N]
140
+ })]
141
+ })]
142
+ })]
143
+ })
144
+ });
79
145
  }
80
- export {
81
- j as default
82
- };
146
+ export { M as default };