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,160 +1,260 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 _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; } }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
12
|
+
import { useRef as S, useState as w } from "react";
|
|
13
|
+
import { createPortal as Z } from "react-dom";
|
|
14
|
+
import $ from "../BasicInput/BInput.mjs";
|
|
15
|
+
import { BCheckBox as ee } from "../CheckBox/index.mjs";
|
|
16
|
+
import L from "../Icon/Icon.mjs";
|
|
17
|
+
import ne from "../OverlayScrollbar/BOverlayScrollbar.mjs";
|
|
8
18
|
/* empty css */
|
|
9
19
|
import le from "../Tooltip/ContentTooltip.mjs";
|
|
10
20
|
import "../Tooltip/TooltipWrapper.mjs";
|
|
11
|
-
import
|
|
21
|
+
import oe from "../ProductField/no_data_light.svg.mjs";
|
|
12
22
|
/* empty css */
|
|
13
|
-
function
|
|
14
|
-
|
|
23
|
+
function p() {
|
|
24
|
+
for (var _len = arguments.length, l = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
|
+
l[_key] = arguments[_key];
|
|
26
|
+
}
|
|
27
|
+
return l.filter(Boolean).join(" ");
|
|
15
28
|
}
|
|
16
|
-
function te(
|
|
17
|
-
return typeof
|
|
29
|
+
function te(l) {
|
|
30
|
+
return typeof l.label == "string" || typeof l.label == "number" ? String(l.label) : String(l.value);
|
|
18
31
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
32
|
+
function z(_ref) {
|
|
33
|
+
var l = _ref.option;
|
|
34
|
+
var a = S(null),
|
|
35
|
+
_w = w(!1),
|
|
36
|
+
_w2 = _slicedToArray(_w, 2),
|
|
37
|
+
b = _w2[0],
|
|
38
|
+
t = _w2[1],
|
|
39
|
+
_w3 = w(null),
|
|
40
|
+
_w4 = _slicedToArray(_w3, 2),
|
|
41
|
+
r = _w4[0],
|
|
42
|
+
g = _w4[1],
|
|
43
|
+
m = typeof l.label == "string" || typeof l.label == "number",
|
|
44
|
+
f = m ? String(l.label) : l.label;
|
|
45
|
+
function c() {
|
|
46
|
+
var d = a.current;
|
|
47
|
+
m && d && d.scrollWidth > d.clientWidth && (g(d.getBoundingClientRect()), t(!0));
|
|
24
48
|
}
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
),
|
|
49
|
-
document.body
|
|
50
|
-
)
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
);
|
|
49
|
+
return /* @__PURE__ */i("span", {
|
|
50
|
+
ref: a,
|
|
51
|
+
className: "bj-dropdown__option-label",
|
|
52
|
+
onMouseEnter: c,
|
|
53
|
+
onMouseLeave: function onMouseLeave() {
|
|
54
|
+
return t(!1);
|
|
55
|
+
},
|
|
56
|
+
children: [f, b && r && typeof document != "undefined" && Z(/* @__PURE__ */n("span", {
|
|
57
|
+
className: "bj-dropdown__option-tooltip-anchor",
|
|
58
|
+
style: {
|
|
59
|
+
position: "fixed",
|
|
60
|
+
top: r.top,
|
|
61
|
+
left: r.left,
|
|
62
|
+
width: r.width,
|
|
63
|
+
height: r.height
|
|
64
|
+
},
|
|
65
|
+
children: /* @__PURE__ */n(le, {
|
|
66
|
+
className: "bj-dropdown__option-tooltip",
|
|
67
|
+
content: f,
|
|
68
|
+
placement: "top"
|
|
69
|
+
})
|
|
70
|
+
}), document.body)]
|
|
71
|
+
});
|
|
54
72
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
73
|
+
function A(_ref2) {
|
|
74
|
+
var l = _ref2.option,
|
|
75
|
+
a = _ref2.doubleLine;
|
|
76
|
+
return a ? /* @__PURE__ */i("span", {
|
|
77
|
+
className: "bj-dropdown__option-content",
|
|
78
|
+
children: [/* @__PURE__ */n(z, {
|
|
79
|
+
option: l
|
|
80
|
+
}), l.description !== void 0 && /* @__PURE__ */n("span", {
|
|
81
|
+
className: "bj-dropdown__option-description",
|
|
82
|
+
children: l.description
|
|
83
|
+
})]
|
|
84
|
+
}) : /* @__PURE__ */n(z, {
|
|
85
|
+
option: l
|
|
86
|
+
});
|
|
60
87
|
}
|
|
61
|
-
function
|
|
62
|
-
className
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
function he(_ref3) {
|
|
89
|
+
var l = _ref3.className,
|
|
90
|
+
a = _ref3.style,
|
|
91
|
+
b = _ref3.options,
|
|
92
|
+
t = _ref3.value,
|
|
93
|
+
_ref3$defaultValue = _ref3.defaultValue,
|
|
94
|
+
r = _ref3$defaultValue === void 0 ? [] : _ref3$defaultValue,
|
|
95
|
+
_ref3$multiple = _ref3.multiple,
|
|
96
|
+
g = _ref3$multiple === void 0 ? !1 : _ref3$multiple,
|
|
97
|
+
_ref3$optionMode = _ref3.optionMode,
|
|
98
|
+
m = _ref3$optionMode === void 0 ? "single-line" : _ref3$optionMode,
|
|
99
|
+
_ref3$searchable = _ref3.searchable,
|
|
100
|
+
f = _ref3$searchable === void 0 ? !1 : _ref3$searchable,
|
|
101
|
+
c = _ref3.searchValue,
|
|
102
|
+
_ref3$searchPlacehold = _ref3.searchPlaceholder,
|
|
103
|
+
d = _ref3$searchPlacehold === void 0 ? "搜索" : _ref3$searchPlacehold,
|
|
104
|
+
j = _ref3.onSearch,
|
|
105
|
+
_ref3$filterOption = _ref3.filterOption,
|
|
106
|
+
y = _ref3$filterOption === void 0 ? !0 : _ref3$filterOption,
|
|
107
|
+
k = _ref3.emptyText,
|
|
108
|
+
I = _ref3.labels,
|
|
109
|
+
_ref3$t = _ref3.t,
|
|
110
|
+
N = _ref3$t === void 0 ? function (h) {
|
|
111
|
+
return h;
|
|
112
|
+
} : _ref3$t,
|
|
113
|
+
_ = _ref3.optionRender,
|
|
114
|
+
R = _ref3.onChange,
|
|
115
|
+
_ref3$footer = _ref3.footer,
|
|
116
|
+
x = _ref3$footer === void 0 ? !0 : _ref3$footer,
|
|
117
|
+
_ref3$showReset = _ref3.showReset,
|
|
118
|
+
G = _ref3$showReset === void 0 ? !0 : _ref3$showReset,
|
|
119
|
+
_ref3$showConfirm = _ref3.showConfirm,
|
|
120
|
+
P = _ref3$showConfirm === void 0 ? !0 : _ref3$showConfirm,
|
|
121
|
+
_ref3$resetText = _ref3.resetText,
|
|
122
|
+
q = _ref3$resetText === void 0 ? N("重置") : _ref3$resetText,
|
|
123
|
+
_ref3$confirmText = _ref3.confirmText,
|
|
124
|
+
F = _ref3$confirmText === void 0 ? N("确定") : _ref3$confirmText,
|
|
125
|
+
M = _ref3.onReset,
|
|
126
|
+
T = _ref3.onConfirm;
|
|
127
|
+
var h;
|
|
128
|
+
var V = S(null),
|
|
129
|
+
E = S(null),
|
|
130
|
+
_w5 = w(r),
|
|
131
|
+
_w6 = _slicedToArray(_w5, 2),
|
|
132
|
+
H = _w6[0],
|
|
133
|
+
O = _w6[1],
|
|
134
|
+
_w7 = w(""),
|
|
135
|
+
_w8 = _slicedToArray(_w7, 2),
|
|
136
|
+
J = _w8[0],
|
|
137
|
+
K = _w8[1],
|
|
138
|
+
o = t != null ? t : H,
|
|
139
|
+
s = g === !0,
|
|
140
|
+
u = m === "double-line",
|
|
141
|
+
v = c != null ? c : J,
|
|
142
|
+
Q = (h = k != null ? k : I == null ? void 0 : I.emptyText) != null ? h : N("暂无结果"),
|
|
143
|
+
C = !j && y !== !1 && v ? b.filter(function (e) {
|
|
144
|
+
return typeof y == "function" ? y(v, e) : te(e).toLocaleLowerCase().includes(v.toLocaleLowerCase());
|
|
145
|
+
}) : b;
|
|
146
|
+
function U(e, B) {
|
|
147
|
+
t === void 0 && O(e), R == null || R(e, B);
|
|
93
148
|
}
|
|
94
149
|
function D(e) {
|
|
150
|
+
c === void 0 && K(e), j == null || j(e);
|
|
151
|
+
}
|
|
152
|
+
function W(e) {
|
|
95
153
|
if (e.disabled) return;
|
|
96
|
-
|
|
97
|
-
|
|
154
|
+
var B = s ? o.includes(e.value) ? o.filter(function (Y) {
|
|
155
|
+
return Y !== e.value;
|
|
156
|
+
}) : [].concat(_toConsumableArray(o), [e.value]) : [e.value];
|
|
157
|
+
U(B, e);
|
|
98
158
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
159
|
+
function X() {
|
|
160
|
+
t === void 0 && O([]), M == null || M();
|
|
101
161
|
}
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
162
|
+
return /* @__PURE__ */i("div", {
|
|
163
|
+
ref: V,
|
|
164
|
+
className: p("bj-dropdown", u && "bj-dropdown--double-line", !s && "bj-dropdown--single", l),
|
|
165
|
+
role: "dialog",
|
|
166
|
+
style: a,
|
|
167
|
+
children: [f && /* @__PURE__ */n("div", {
|
|
168
|
+
className: "bj-dropdown__search",
|
|
169
|
+
children: /* @__PURE__ */n($, {
|
|
106
170
|
"aria-label": "搜索选项",
|
|
107
|
-
allowClear: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
171
|
+
allowClear: {
|
|
172
|
+
clearIcon: /* @__PURE__ */n(L, {
|
|
173
|
+
className: "bj-dropdown__search-clear-icon",
|
|
174
|
+
type: "icon-a-guanbixi"
|
|
175
|
+
})
|
|
176
|
+
},
|
|
177
|
+
onChange: function onChange(e) {
|
|
178
|
+
return D(e.target.value);
|
|
179
|
+
},
|
|
180
|
+
onClear: function onClear() {
|
|
181
|
+
return D("");
|
|
182
|
+
},
|
|
183
|
+
placeholder: d,
|
|
184
|
+
prefix: /* @__PURE__ */n(L, {
|
|
185
|
+
type: "icon-a-sousuoxi"
|
|
186
|
+
}),
|
|
112
187
|
inputMode: "search",
|
|
113
188
|
role: "searchbox",
|
|
114
189
|
type: "text",
|
|
115
190
|
value: v
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
checked:
|
|
123
|
-
className:
|
|
191
|
+
})
|
|
192
|
+
}), /* @__PURE__ */i("div", {
|
|
193
|
+
ref: E,
|
|
194
|
+
className: p("bj-dropdown__options", "bj-overlay-scrollbar-hidden", C.length === 0 && "bj-dropdown__options--empty", !s && "bj-dropdown__options--single"),
|
|
195
|
+
children: [C.map(function (e) {
|
|
196
|
+
return s ? /* @__PURE__ */n(ee, {
|
|
197
|
+
checked: o.includes(e.value),
|
|
198
|
+
className: p("bj-dropdown__option", u && e.description !== void 0 && "bj-dropdown__option--double-line"),
|
|
124
199
|
disabled: e.disabled,
|
|
125
|
-
onChange: ()
|
|
200
|
+
onChange: function onChange() {
|
|
201
|
+
return W(e);
|
|
202
|
+
},
|
|
126
203
|
skipGroup: !0,
|
|
127
204
|
variant: "white",
|
|
128
|
-
children:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"button",
|
|
133
|
-
|
|
134
|
-
"
|
|
135
|
-
className: u("bj-dropdown__option", "bj-dropdown__option--single", c && e.description !== void 0 && "bj-dropdown__option--double-line", t.includes(e.value) && "bj-dropdown__option--selected"),
|
|
205
|
+
children: _ ? _(e) : /* @__PURE__ */n(A, {
|
|
206
|
+
doubleLine: u && e.description !== void 0,
|
|
207
|
+
option: e
|
|
208
|
+
})
|
|
209
|
+
}, String(e.value)) : /* @__PURE__ */i("button", {
|
|
210
|
+
"aria-pressed": o.includes(e.value),
|
|
211
|
+
className: p("bj-dropdown__option", "bj-dropdown__option--single", u && e.description !== void 0 && "bj-dropdown__option--double-line", o.includes(e.value) && "bj-dropdown__option--selected"),
|
|
136
212
|
disabled: e.disabled,
|
|
137
|
-
onClick: ()
|
|
213
|
+
onClick: function onClick() {
|
|
214
|
+
return W(e);
|
|
215
|
+
},
|
|
138
216
|
type: "button",
|
|
139
|
-
children: [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
217
|
+
children: [_ ? /* @__PURE__ */n("span", {
|
|
218
|
+
className: "bj-dropdown__option-label",
|
|
219
|
+
children: _(e)
|
|
220
|
+
}) : /* @__PURE__ */n(A, {
|
|
221
|
+
doubleLine: u && e.description !== void 0,
|
|
222
|
+
option: e
|
|
223
|
+
}), o.includes(e.value) && /* @__PURE__ */n(L, {
|
|
224
|
+
className: "bj-dropdown__option-icon",
|
|
225
|
+
type: "icon-a-dagouxi"
|
|
226
|
+
})]
|
|
227
|
+
}, String(e.value));
|
|
228
|
+
}), C.length === 0 && /* @__PURE__ */i("div", {
|
|
229
|
+
className: "bj-dropdown__empty",
|
|
230
|
+
children: [/* @__PURE__ */n("img", {
|
|
231
|
+
alt: "",
|
|
232
|
+
className: "bj-dropdown__empty-image",
|
|
233
|
+
src: oe
|
|
234
|
+
}), /* @__PURE__ */n("span", {
|
|
235
|
+
className: "bj-dropdown__empty-text",
|
|
236
|
+
children: Q
|
|
237
|
+
})]
|
|
238
|
+
})]
|
|
239
|
+
}), /* @__PURE__ */n(ne, {
|
|
240
|
+
containerRef: V,
|
|
241
|
+
gap: 2,
|
|
242
|
+
size: 2,
|
|
243
|
+
targetRef: E
|
|
244
|
+
}), x !== !1 && (x !== !0 ? x : /* @__PURE__ */i("div", {
|
|
245
|
+
className: p("bj-dropdown__actions", !s && "bj-dropdown__actions--single"),
|
|
246
|
+
children: [G && /* @__PURE__ */n("button", {
|
|
247
|
+
onClick: X,
|
|
248
|
+
type: "button",
|
|
249
|
+
children: q
|
|
250
|
+
}), s && P && /* @__PURE__ */n("button", {
|
|
251
|
+
onClick: function onClick() {
|
|
252
|
+
return T == null ? void 0 : T(o);
|
|
143
253
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
] })
|
|
150
|
-
] }),
|
|
151
|
-
/* @__PURE__ */ l(ee, { containerRef: w, gap: 2, size: 2, targetRef: S }),
|
|
152
|
-
L !== !1 && (L !== !0 ? L : /* @__PURE__ */ r("div", { className: u("bj-dropdown__actions", !s && "bj-dropdown__actions--single"), children: [
|
|
153
|
-
A && /* @__PURE__ */ l("button", { onClick: U, type: "button", children: P }),
|
|
154
|
-
s && G && /* @__PURE__ */ l("button", { onClick: () => C == null ? void 0 : C(t), type: "button", children: q })
|
|
155
|
-
] }))
|
|
156
|
-
] });
|
|
254
|
+
type: "button",
|
|
255
|
+
children: F
|
|
256
|
+
})]
|
|
257
|
+
}))]
|
|
258
|
+
});
|
|
157
259
|
}
|
|
158
|
-
export {
|
|
159
|
-
_e as BDropdown
|
|
160
|
-
};
|
|
260
|
+
export { he as BDropdown };
|
|
@@ -1 +1,89 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var e = require("react/jsx-runtime"),
|
|
4
|
+
H = require("react");
|
|
5
|
+
; /* empty css */
|
|
6
|
+
function N() {
|
|
7
|
+
return e.jsx("svg", {
|
|
8
|
+
width: "20",
|
|
9
|
+
height: "20",
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
children: e.jsx("path", {
|
|
14
|
+
d: "M14.1667 5.3335C15.1792 5.3335 16 6.15431 16 7.16683V8.00016H19C19.2761 8.00016 19.5 8.22402 19.5 8.50016C19.5 8.7763 19.2761 9.00016 19 9.00016H17.3333V16.8335C17.3333 17.846 16.5125 18.6668 15.5 18.6668H8.5C7.48748 18.6668 6.66667 17.846 6.66667 16.8335V9.00016H5C4.72386 9.00016 4.5 8.7763 4.5 8.50016C4.5 8.22402 4.72386 8.00016 5 8.00016H8V7.16683C8 6.15431 8.82081 5.3335 9.83333 5.3335H14.1667ZM7.66667 16.8335C7.66667 17.2937 8.03976 17.6668 8.5 17.6668H15.5C15.9602 17.6668 16.3333 17.2937 16.3333 16.8335V9.00016H7.66667V16.8335ZM10.5 11.3335C10.7761 11.3335 11 11.5574 11 11.8335V15.0002C11 15.2763 10.7761 15.5002 10.5 15.5002C10.2239 15.5002 10 15.2763 10 15.0002V11.8335C10 11.5574 10.2239 11.3335 10.5 11.3335ZM13.5 11.3335C13.7761 11.3335 14 11.5574 14 11.8335V15.0002C14 15.2763 13.7761 15.5002 13.5 15.5002C13.2239 15.5002 13 15.2763 13 15.0002V11.8335C13 11.5574 13.2239 11.3335 13.5 11.3335ZM9.83333 6.3335C9.3731 6.3335 9 6.70659 9 7.16683V8.00016H15V7.16683C15 6.70659 14.6269 6.3335 14.1667 6.3335H9.83333Z",
|
|
15
|
+
fill: "currentColor"
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
var B = H.forwardRef(function (_ref, m) {
|
|
20
|
+
var _ref$mode = _ref.mode,
|
|
21
|
+
a = _ref$mode === void 0 ? "single" : _ref$mode,
|
|
22
|
+
_ref$activeLang = _ref.activeLang,
|
|
23
|
+
o = _ref$activeLang === void 0 ? "zh" : _ref$activeLang,
|
|
24
|
+
n = _ref.onLangChange,
|
|
25
|
+
_ref$value = _ref.value,
|
|
26
|
+
_ = _ref$value === void 0 ? "" : _ref$value,
|
|
27
|
+
s = _ref.onChange,
|
|
28
|
+
x = _ref.placeholder,
|
|
29
|
+
d = _ref.maxLength,
|
|
30
|
+
_ref$error = _ref.error,
|
|
31
|
+
C = _ref$error === void 0 ? !1 : _ref$error,
|
|
32
|
+
b = _ref.disabled,
|
|
33
|
+
u = _ref.onDelete,
|
|
34
|
+
l = _ref.labels,
|
|
35
|
+
h = _ref.id,
|
|
36
|
+
v = _ref.className,
|
|
37
|
+
j = _ref.style;
|
|
38
|
+
var c, r;
|
|
39
|
+
var V = (c = l == null ? void 0 : l.zh) != null ? c : "中文",
|
|
40
|
+
p = (r = l == null ? void 0 : l.en) != null ? r : "EN",
|
|
41
|
+
i = a === "bilingual",
|
|
42
|
+
t = !!u,
|
|
43
|
+
f = ["bu-eib__box", i && t && "bu-eib__box--actions-both", i && !t && "bu-eib__box--actions-toggle", !i && t && "bu-eib__box--actions-delete", C && "bu-eib__box--error", b && "bu-eib__box--disabled"].filter(Boolean).join(" ");
|
|
44
|
+
return e.jsx("div", {
|
|
45
|
+
className: ["bu-eib", v].filter(Boolean).join(" "),
|
|
46
|
+
style: j,
|
|
47
|
+
children: e.jsxs("div", {
|
|
48
|
+
className: f,
|
|
49
|
+
children: [e.jsx("input", {
|
|
50
|
+
ref: m,
|
|
51
|
+
id: h,
|
|
52
|
+
className: "bu-eib__field",
|
|
53
|
+
value: _,
|
|
54
|
+
onChange: function onChange(g) {
|
|
55
|
+
return s == null ? void 0 : s(g.target.value);
|
|
56
|
+
},
|
|
57
|
+
placeholder: x,
|
|
58
|
+
maxLength: d,
|
|
59
|
+
disabled: b
|
|
60
|
+
}), (i || t) && e.jsxs("div", {
|
|
61
|
+
className: "bu-eib__actions",
|
|
62
|
+
children: [i && e.jsxs("div", {
|
|
63
|
+
className: "bu-eib__lang-toggle",
|
|
64
|
+
children: [e.jsx("button", {
|
|
65
|
+
type: "button",
|
|
66
|
+
className: "bu-eib__lang-btn".concat(o === "zh" ? " bu-eib__lang-btn--active" : ""),
|
|
67
|
+
onClick: function onClick() {
|
|
68
|
+
return n == null ? void 0 : n("zh");
|
|
69
|
+
},
|
|
70
|
+
children: V
|
|
71
|
+
}), e.jsx("button", {
|
|
72
|
+
type: "button",
|
|
73
|
+
className: "bu-eib__lang-btn".concat(o === "en" ? " bu-eib__lang-btn--active" : ""),
|
|
74
|
+
onClick: function onClick() {
|
|
75
|
+
return n == null ? void 0 : n("en");
|
|
76
|
+
},
|
|
77
|
+
children: p
|
|
78
|
+
})]
|
|
79
|
+
}), t && e.jsx("button", {
|
|
80
|
+
type: "button",
|
|
81
|
+
className: "bu-eib__delete",
|
|
82
|
+
onClick: u,
|
|
83
|
+
children: e.jsx(N, {})
|
|
84
|
+
})]
|
|
85
|
+
})]
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
module.exports = B;
|