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,226 +1,441 @@
1
- import { jsxs as s, jsx as t, Fragment as ae } from "react/jsx-runtime";
2
- import { useState as h, useRef as m, useCallback as U, useLayoutEffect as le, useEffect as H, useMemo as de } from "react";
3
- import { createPortal as ue } from "react-dom";
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 i, jsx as t, Fragment as Ne } from "react/jsx-runtime";
13
+ import { useState as h, useRef as p, useCallback as Y, useLayoutEffect as Le, useEffect as ee, useMemo as Pe } from "react";
14
+ import { createPortal as Oe } from "react-dom";
4
15
  /* empty css */
5
- import fe from "./no_data_light.svg.mjs";
6
- import q from "./arrow-up.svg.mjs";
7
- import me from "./sort.svg.mjs";
8
- import pe from "./search.svg.mjs";
9
- import _e from "./checkbox-no.svg.mjs";
10
- import he from "./checkbox-ok.svg.mjs";
11
- function G({ size: l = 20 }) {
12
- return /* @__PURE__ */ t("svg", { width: l, height: l, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("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" }) });
16
+ import Ce from "./no_data_light.svg.mjs";
17
+ import te from "./arrow-up.svg.mjs";
18
+ import xe from "./sort.svg.mjs";
19
+ import ye from "./search.svg.mjs";
20
+ import ke from "./checkbox-no.svg.mjs";
21
+ import Ee from "./checkbox-ok.svg.mjs";
22
+ var De = Object.defineProperty,
23
+ Ie = Object.defineProperties,
24
+ Me = Object.getOwnPropertyDescriptors,
25
+ re = Object.getOwnPropertySymbols,
26
+ Fe = Object.prototype.hasOwnProperty,
27
+ je = Object.prototype.propertyIsEnumerable,
28
+ ne = function ne(s, n, l) {
29
+ return n in s ? De(s, n, {
30
+ enumerable: !0,
31
+ configurable: !0,
32
+ writable: !0,
33
+ value: l
34
+ }) : s[n] = l;
35
+ },
36
+ oe = function oe(s, n) {
37
+ for (var l in n || (n = {})) Fe.call(n, l) && ne(s, l, n[l]);
38
+ if (re) {
39
+ var _iterator = _createForOfIteratorHelper(re(n)),
40
+ _step;
41
+ try {
42
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
43
+ var l = _step.value;
44
+ je.call(n, l) && ne(s, l, n[l]);
45
+ }
46
+ } catch (err) {
47
+ _iterator.e(err);
48
+ } finally {
49
+ _iterator.f();
50
+ }
51
+ }
52
+ return s;
53
+ },
54
+ se = function se(s, n) {
55
+ return Ie(s, Me(n));
56
+ };
57
+ function le(_ref) {
58
+ var _ref$size = _ref.size,
59
+ s = _ref$size === void 0 ? 20 : _ref$size;
60
+ return /* @__PURE__ */t("svg", {
61
+ width: s,
62
+ height: s,
63
+ viewBox: "0 0 24 24",
64
+ fill: "none",
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ children: /* @__PURE__ */t("path", {
67
+ 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",
68
+ fill: "currentColor"
69
+ })
70
+ });
13
71
  }
14
- function De({
15
- options: l = [],
16
- value: a = [],
17
- onChange: o,
18
- placeholder: O = "请选择",
19
- emptyText: M = "暂无产品数据",
20
- onManageField: J,
21
- multiple: u = !0,
22
- showSearch: C = !0,
23
- showSort: F = !0,
24
- addButtonText: I,
25
- onAdd: K,
26
- labels: r,
27
- className: Q,
28
- style: V,
29
- getPopupContainer: v
30
- }) {
31
- const W = (r == null ? void 0 : r.searchPlaceholder) ?? "搜索", Y = (r == null ? void 0 : r.sortDefault) ?? "默认顺序", ee = (r == null ? void 0 : r.sortAsc) ?? "名称A-Z", te = (r == null ? void 0 : r.sortDesc) ?? "名称Z-A", P = (r == null ? void 0 : r.noMatchText) ?? "暂无选项", re = (r == null ? void 0 : r.manageFieldPre) ?? "请前往", ne = (r == null ? void 0 : r.manageFieldLink) ?? "管理字段", ce = (r == null ? void 0 : r.manageFieldPost) ?? "添加", [f, R] = h(!1), [b, $] = h(""), [p, T] = h("none"), [L, k] = h(!1), g = m(null), x = m(null), X = m(null), [y, se] = h({ top: 0, left: 0, width: 0 }), d = U(() => {
32
- if (!g.current) return;
33
- const e = g.current.getBoundingClientRect();
34
- se({
35
- top: e.bottom + 4,
36
- left: e.left,
37
- width: e.width
38
- });
39
- }, []);
40
- le(() => {
41
- f && d();
42
- }, [f, d]), H(() => {
72
+ function He(_ref2) {
73
+ var _ref2$options = _ref2.options,
74
+ s = _ref2$options === void 0 ? [] : _ref2$options,
75
+ _ref2$value = _ref2.value,
76
+ n = _ref2$value === void 0 ? [] : _ref2$value,
77
+ l = _ref2.onChange,
78
+ _ref2$placeholder = _ref2.placeholder,
79
+ y = _ref2$placeholder === void 0 ? "请选择" : _ref2$placeholder,
80
+ _ref2$emptyText = _ref2.emptyText,
81
+ k = _ref2$emptyText === void 0 ? "暂无产品数据" : _ref2$emptyText,
82
+ ae = _ref2.onManageField,
83
+ _ref2$multiple = _ref2.multiple,
84
+ d = _ref2$multiple === void 0 ? !0 : _ref2$multiple,
85
+ _ref2$showSearch = _ref2.showSearch,
86
+ E = _ref2$showSearch === void 0 ? !0 : _ref2$showSearch,
87
+ _ref2$showSort = _ref2.showSort,
88
+ D = _ref2$showSort === void 0 ? !0 : _ref2$showSort,
89
+ I = _ref2.addButtonText,
90
+ ce = _ref2.onAdd,
91
+ a = _ref2.labels,
92
+ ie = _ref2.className,
93
+ ue = _ref2.style,
94
+ M = _ref2.getPopupContainer;
95
+ var F, j, R, $, S, T, X, z, A;
96
+ var de = (F = a == null ? void 0 : a.searchPlaceholder) != null ? F : "搜索",
97
+ fe = (j = a == null ? void 0 : a.sortDefault) != null ? j : "默认顺序",
98
+ pe = (R = a == null ? void 0 : a.sortAsc) != null ? R : "名称A-Z",
99
+ _e = ($ = a == null ? void 0 : a.sortDesc) != null ? $ : "名称Z-A",
100
+ B = (S = a == null ? void 0 : a.noMatchText) != null ? S : "暂无选项",
101
+ me = (T = a == null ? void 0 : a.manageFieldPre) != null ? T : "请前往",
102
+ ge = (X = a == null ? void 0 : a.manageFieldLink) != null ? X : "管理字段",
103
+ he = (z = a == null ? void 0 : a.manageFieldPost) != null ? z : "添加",
104
+ _h = h(!1),
105
+ _h2 = _slicedToArray(_h, 2),
106
+ f = _h2[0],
107
+ Z = _h2[1],
108
+ _h3 = h(""),
109
+ _h4 = _slicedToArray(_h3, 2),
110
+ w = _h4[0],
111
+ U = _h4[1],
112
+ _h5 = h("none"),
113
+ _h6 = _slicedToArray(_h5, 2),
114
+ _ = _h6[0],
115
+ H = _h6[1],
116
+ _h7 = h(!1),
117
+ _h8 = _slicedToArray(_h7, 2),
118
+ N = _h8[0],
119
+ L = _h8[1],
120
+ b = p(null),
121
+ P = p(null),
122
+ V = p(null),
123
+ _h9 = h({
124
+ top: 0,
125
+ left: 0,
126
+ width: 0
127
+ }),
128
+ _h0 = _slicedToArray(_h9, 2),
129
+ O = _h0[0],
130
+ be = _h0[1],
131
+ u = Y(function () {
132
+ if (!b.current) return;
133
+ var e = b.current.getBoundingClientRect();
134
+ be({
135
+ top: e.bottom + 4,
136
+ left: e.left,
137
+ width: e.width
138
+ });
139
+ }, []);
140
+ Le(function () {
141
+ f && u();
142
+ }, [f, u]), ee(function () {
43
143
  if (!f) return;
44
- const e = (n) => {
45
- var i, N;
46
- const c = n.target;
47
- (i = X.current) != null && i.contains(c) || (N = g.current) != null && N.contains(c) || E();
144
+ var e = function e(r) {
145
+ var o, c;
146
+ var g = r.target;
147
+ (o = V.current) != null && o.contains(g) || (c = b.current) != null && c.contains(g) || C();
48
148
  };
49
- return document.addEventListener("mousedown", e), window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
50
- document.removeEventListener("mousedown", e), window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
149
+ return document.addEventListener("mousedown", e), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), function () {
150
+ document.removeEventListener("mousedown", e), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
51
151
  };
52
- }, [f, d]), H(() => {
53
- if (!L) return;
54
- const e = (n) => {
55
- x.current && !x.current.contains(n.target) && k(!1);
152
+ }, [f, u]), ee(function () {
153
+ if (!N) return;
154
+ var e = function e(r) {
155
+ P.current && !P.current.contains(r.target) && L(!1);
56
156
  };
57
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
58
- }, [L]);
59
- const z = m(null), A = m(null), w = m({ dragging: !1, startX: 0, scrollLeft: 0, target: null }), B = U((e) => ({
60
- onMouseDown: (n) => {
61
- const c = e.current;
62
- c && (w.current = { dragging: !0, startX: n.clientX, scrollLeft: c.scrollLeft, target: c });
63
- },
64
- onMouseMove: (n) => {
65
- const { dragging: c, startX: i, scrollLeft: N, target: Z } = w.current;
66
- !c || !Z || (n.preventDefault(), Z.scrollLeft = N - (n.clientX - i));
67
- },
68
- onMouseUp: () => {
69
- w.current.dragging = !1;
70
- },
71
- onMouseLeave: () => {
72
- w.current.dragging = !1;
73
- }
74
- }), []);
75
- function oe(e) {
76
- if (!u) {
77
- o == null || o(a.includes(e) ? [] : [e]), a.includes(e) || E();
157
+ return document.addEventListener("mousedown", e), function () {
158
+ return document.removeEventListener("mousedown", e);
159
+ };
160
+ }, [N]);
161
+ var q = p(null),
162
+ G = p(null),
163
+ v = p({
164
+ dragging: !1,
165
+ startX: 0,
166
+ scrollLeft: 0,
167
+ target: null
168
+ }),
169
+ J = Y(function (e) {
170
+ return {
171
+ onMouseDown: function onMouseDown(r) {
172
+ var o = e.current;
173
+ o && (v.current = {
174
+ dragging: !0,
175
+ startX: r.clientX,
176
+ scrollLeft: o.scrollLeft,
177
+ target: o
178
+ });
179
+ },
180
+ onMouseMove: function onMouseMove(r) {
181
+ var _v$current = v.current,
182
+ o = _v$current.dragging,
183
+ c = _v$current.startX,
184
+ g = _v$current.scrollLeft,
185
+ W = _v$current.target;
186
+ !o || !W || (r.preventDefault(), W.scrollLeft = g - (r.clientX - c));
187
+ },
188
+ onMouseUp: function onMouseUp() {
189
+ v.current.dragging = !1;
190
+ },
191
+ onMouseLeave: function onMouseLeave() {
192
+ v.current.dragging = !1;
193
+ }
194
+ };
195
+ }, []);
196
+ function ve(e) {
197
+ if (!d) {
198
+ l == null || l(n.includes(e) ? [] : [e]), n.includes(e) || C();
78
199
  return;
79
200
  }
80
- const n = a.includes(e) ? a.filter((c) => c !== e) : [...a, e];
81
- o == null || o(n);
201
+ var r = n.includes(e) ? n.filter(function (o) {
202
+ return o !== e;
203
+ }) : [].concat(_toConsumableArray(n), [e]);
204
+ l == null || l(r);
82
205
  }
83
- function S(e) {
84
- o == null || o(a.filter((n) => n !== e));
206
+ function K(e) {
207
+ l == null || l(n.filter(function (r) {
208
+ return r !== e;
209
+ }));
85
210
  }
86
- function E() {
87
- R(!1), $(""), T("none");
211
+ function C() {
212
+ Z(!1), U(""), H("none");
88
213
  }
89
- function ie(e) {
90
- T(e), k(!1);
214
+ function we(e) {
215
+ H(e), L(!1);
91
216
  }
92
- const j = de(() => {
93
- let e = l.filter((c) => (c.searchText ?? (typeof c.label == "string" ? c.label : "")).toLowerCase().includes(b.toLowerCase()));
94
- const n = (c) => c.searchText ?? (typeof c.label == "string" ? c.label : "");
95
- return p === "asc" && (e = [...e].sort((c, i) => n(c).localeCompare(n(i)))), p === "desc" && (e = [...e].sort((c, i) => n(i).localeCompare(n(c)))), e;
96
- }, [l, b, p]), _ = l.filter((e) => a.includes(e.value)), D = l.length > 0;
97
- return /* @__PURE__ */ s("div", { ref: g, className: ["bu-pf", Q].filter(Boolean).join(" "), style: V, children: [
98
- !f && /* @__PURE__ */ s("div", { className: `bu-pf__trigger${_.length > 0 ? " bu-pf__trigger--selected" : ""}`, onClick: () => R(!0), children: [
99
- _.length > 0 ? /* @__PURE__ */ t(
100
- "div",
101
- {
102
- className: "bu-pf__trigger-tags",
103
- ref: A,
104
- ...B(A),
105
- children: _.map((e) => /* @__PURE__ */ s("span", { className: `bu-pf__tag${u ? "" : " bu-pf__tag--single"}`, children: [
106
- /* @__PURE__ */ t("span", { className: "bu-pf__tag-text", children: e.label }),
107
- /* @__PURE__ */ t(
108
- "button",
109
- {
110
- type: "button",
111
- className: "bu-pf__tag-close",
112
- onClick: (n) => {
113
- n.stopPropagation(), S(e.value);
114
- },
115
- children: /* @__PURE__ */ t(G, { size: 12 })
116
- }
117
- )
118
- ] }, e.value))
119
- }
120
- ) : /* @__PURE__ */ t("span", { className: "bu-pf__placeholder", children: O }),
121
- /* @__PURE__ */ t("span", { className: "bu-pf__arrow", children: /* @__PURE__ */ t("img", { src: q, width: 24, height: 24, alt: "" }) })
122
- ] }),
123
- f && /* @__PURE__ */ s(ae, { children: [
124
- /* @__PURE__ */ t("div", { className: "bu-pf__panel", children: /* @__PURE__ */ s("div", { className: "bu-pf__header", children: [
125
- /* @__PURE__ */ t(
126
- "div",
127
- {
217
+ var Q = Pe(function () {
218
+ var e = s.filter(function (o) {
219
+ var c;
220
+ return ((c = o.searchText) != null ? c : typeof o.label == "string" ? o.label : "").toLowerCase().includes(w.toLowerCase());
221
+ });
222
+ var r = function r(o) {
223
+ var c;
224
+ return (c = o.searchText) != null ? c : typeof o.label == "string" ? o.label : "";
225
+ };
226
+ return _ === "asc" && (e = _toConsumableArray(e).sort(function (o, c) {
227
+ return r(o).localeCompare(r(c));
228
+ })), _ === "desc" && (e = _toConsumableArray(e).sort(function (o, c) {
229
+ return r(c).localeCompare(r(o));
230
+ })), e;
231
+ }, [s, w, _]),
232
+ m = s.filter(function (e) {
233
+ return n.includes(e.value);
234
+ }),
235
+ x = s.length > 0;
236
+ return /* @__PURE__ */i("div", {
237
+ ref: b,
238
+ className: ["bu-pf", ie].filter(Boolean).join(" "),
239
+ style: ue,
240
+ children: [!f && /* @__PURE__ */i("div", {
241
+ className: "bu-pf__trigger".concat(m.length > 0 ? " bu-pf__trigger--selected" : ""),
242
+ onClick: function onClick() {
243
+ return Z(!0);
244
+ },
245
+ children: [m.length > 0 ? /* @__PURE__ */t("div", se(oe({
246
+ className: "bu-pf__trigger-tags",
247
+ ref: G
248
+ }, J(G)), {
249
+ children: m.map(function (e) {
250
+ return /* @__PURE__ */i("span", {
251
+ className: "bu-pf__tag".concat(d ? "" : " bu-pf__tag--single"),
252
+ children: [/* @__PURE__ */t("span", {
253
+ className: "bu-pf__tag-text",
254
+ children: e.label
255
+ }), /* @__PURE__ */t("button", {
256
+ type: "button",
257
+ className: "bu-pf__tag-close",
258
+ onClick: function onClick(r) {
259
+ r.stopPropagation(), K(e.value);
260
+ },
261
+ children: /* @__PURE__ */t(le, {
262
+ size: 12
263
+ })
264
+ })]
265
+ }, e.value);
266
+ })
267
+ })) : /* @__PURE__ */t("span", {
268
+ className: "bu-pf__placeholder",
269
+ children: y
270
+ }), /* @__PURE__ */t("span", {
271
+ className: "bu-pf__arrow",
272
+ children: /* @__PURE__ */t("img", {
273
+ src: te,
274
+ width: 24,
275
+ height: 24,
276
+ alt: ""
277
+ })
278
+ })]
279
+ }), f && /* @__PURE__ */i(Ne, {
280
+ children: [/* @__PURE__ */t("div", {
281
+ className: "bu-pf__panel",
282
+ children: /* @__PURE__ */i("div", {
283
+ className: "bu-pf__header",
284
+ children: [/* @__PURE__ */t("div", se(oe({
128
285
  className: "bu-pf__tags",
129
- ref: z,
130
- ...B(z),
131
- children: _.length > 0 ? _.map((e) => /* @__PURE__ */ s("span", { className: `bu-pf__tag${u ? "" : " bu-pf__tag--single"}`, children: [
132
- /* @__PURE__ */ t("span", { className: "bu-pf__tag-text", children: e.label }),
133
- /* @__PURE__ */ t(
134
- "button",
135
- {
286
+ ref: q
287
+ }, J(q)), {
288
+ children: m.length > 0 ? m.map(function (e) {
289
+ return /* @__PURE__ */i("span", {
290
+ className: "bu-pf__tag".concat(d ? "" : " bu-pf__tag--single"),
291
+ children: [/* @__PURE__ */t("span", {
292
+ className: "bu-pf__tag-text",
293
+ children: e.label
294
+ }), /* @__PURE__ */t("button", {
136
295
  type: "button",
137
296
  className: "bu-pf__tag-close",
138
- onClick: () => S(e.value),
139
- children: /* @__PURE__ */ t(G, { size: 12 })
140
- }
141
- )
142
- ] }, e.value)) : /* @__PURE__ */ t("span", { className: "bu-pf__placeholder-inline", children: O })
143
- }
144
- ),
145
- /* @__PURE__ */ t("button", { type: "button", className: "bu-pf__close", onClick: E, children: /* @__PURE__ */ t("img", { src: q, width: 24, height: 24, alt: "" }) })
146
- ] }) }),
147
- ue(
148
- /* @__PURE__ */ t("div", { ref: X, className: "bu-pf__portal", style: { position: "fixed", top: y.top, left: y.left, width: y.width, zIndex: 1050 }, children: /* @__PURE__ */ s("div", { className: "bu-pf__dropdown", children: [
149
- (C || F) && /* @__PURE__ */ s("div", { className: "bu-pf__toolbar", children: [
150
- C && /* @__PURE__ */ s("div", { className: "bu-pf__search", children: [
151
- /* @__PURE__ */ t("span", { className: "bu-pf__search-icon", children: /* @__PURE__ */ t("img", { src: pe, width: 20, height: 20, alt: "" }) }),
152
- /* @__PURE__ */ t(
153
- "input",
154
- {
155
- className: "bu-pf__search-input",
156
- placeholder: W,
157
- value: b,
158
- onChange: (e) => $(e.target.value)
159
- }
160
- )
161
- ] }),
162
- F && /* @__PURE__ */ s("div", { ref: x, className: "bu-pf__sort-wrap", children: [
163
- /* @__PURE__ */ t(
164
- "button",
165
- {
166
- type: "button",
167
- className: `bu-pf__sort-btn${p !== "none" ? " bu-pf__sort-btn--active" : ""}`,
168
- onClick: () => k((e) => !e),
169
- children: /* @__PURE__ */ t("img", { src: me, width: 24, height: 24, alt: "" })
297
+ onClick: function onClick() {
298
+ return K(e.value);
299
+ },
300
+ children: /* @__PURE__ */t(le, {
301
+ size: 12
302
+ })
303
+ })]
304
+ }, e.value);
305
+ }) : /* @__PURE__ */t("span", {
306
+ className: "bu-pf__placeholder-inline",
307
+ children: y
308
+ })
309
+ })), /* @__PURE__ */t("button", {
310
+ type: "button",
311
+ className: "bu-pf__close",
312
+ onClick: C,
313
+ children: /* @__PURE__ */t("img", {
314
+ src: te,
315
+ width: 24,
316
+ height: 24,
317
+ alt: ""
318
+ })
319
+ })]
320
+ })
321
+ }), Oe(/* @__PURE__ */t("div", {
322
+ ref: V,
323
+ className: "bu-pf__portal",
324
+ style: {
325
+ position: "fixed",
326
+ top: O.top,
327
+ left: O.left,
328
+ width: O.width,
329
+ zIndex: 1050
330
+ },
331
+ children: /* @__PURE__ */i("div", {
332
+ className: "bu-pf__dropdown",
333
+ children: [(E || D) && /* @__PURE__ */i("div", {
334
+ className: "bu-pf__toolbar",
335
+ children: [E && /* @__PURE__ */i("div", {
336
+ className: "bu-pf__search",
337
+ children: [/* @__PURE__ */t("span", {
338
+ className: "bu-pf__search-icon",
339
+ children: /* @__PURE__ */t("img", {
340
+ src: ye,
341
+ width: 20,
342
+ height: 20,
343
+ alt: ""
344
+ })
345
+ }), /* @__PURE__ */t("input", {
346
+ className: "bu-pf__search-input",
347
+ placeholder: de,
348
+ value: w,
349
+ onChange: function onChange(e) {
350
+ return U(e.target.value);
170
351
  }
171
- ),
172
- L && /* @__PURE__ */ t("div", { className: "bu-pf__sort-dropdown", children: [
173
- { key: "none", label: Y },
174
- { key: "asc", label: ee },
175
- { key: "desc", label: te }
176
- ].map(({ key: e, label: n }) => /* @__PURE__ */ t(
177
- "div",
178
- {
179
- className: `bu-pf__sort-option${p === e ? " bu-pf__sort-option--active" : ""}`,
180
- onClick: () => ie(e),
181
- children: n
352
+ })]
353
+ }), D && /* @__PURE__ */i("div", {
354
+ ref: P,
355
+ className: "bu-pf__sort-wrap",
356
+ children: [/* @__PURE__ */t("button", {
357
+ type: "button",
358
+ className: "bu-pf__sort-btn".concat(_ !== "none" ? " bu-pf__sort-btn--active" : ""),
359
+ onClick: function onClick() {
360
+ return L(function (e) {
361
+ return !e;
362
+ });
182
363
  },
183
- e
184
- )) })
185
- ] })
186
- ] }),
187
- /* @__PURE__ */ t("div", { className: "bu-pf__list", children: D && j.length > 0 ? j.map((e) => {
188
- const n = a.includes(e.value);
189
- return /* @__PURE__ */ s(
190
- "div",
191
- {
192
- className: `bu-pf__option${u ? " bu-pf__option--multiple" : ""}${n && !u ? " bu-pf__option--selected" : ""}`,
193
- onClick: () => oe(e.value),
194
- children: [
195
- u && /* @__PURE__ */ t(
196
- "img",
197
- {
198
- className: "bu-pf__checkbox-img",
199
- src: n ? he : _e,
200
- alt: ""
201
- }
202
- ),
203
- /* @__PURE__ */ t("span", { className: "bu-pf__option-label", children: e.label })
204
- ]
205
- },
206
- e.value
207
- );
208
- }) : /* @__PURE__ */ s("div", { className: "bu-pf__no-match", children: [
209
- /* @__PURE__ */ t("img", { className: "bu-pf__no-match-img", src: fe, alt: D ? P : M }),
210
- /* @__PURE__ */ t("p", { className: "bu-pf__no-match-text", children: D ? P : M }),
211
- /* @__PURE__ */ s("p", { className: "bu-pf__no-match-hint", children: [
212
- re,
213
- /* @__PURE__ */ t("button", { type: "button", className: "bu-pf__manage-btn", onClick: J, children: ne }),
214
- ce
215
- ] })
216
- ] }) }),
217
- I && /* @__PURE__ */ t("div", { className: "bu-pf__add-row", onClick: K, children: I })
218
- ] }) }),
219
- (v == null ? void 0 : v()) ?? document.body
220
- )
221
- ] })
222
- ] });
364
+ children: /* @__PURE__ */t("img", {
365
+ src: xe,
366
+ width: 24,
367
+ height: 24,
368
+ alt: ""
369
+ })
370
+ }), N && /* @__PURE__ */t("div", {
371
+ className: "bu-pf__sort-dropdown",
372
+ children: [{
373
+ key: "none",
374
+ label: fe
375
+ }, {
376
+ key: "asc",
377
+ label: pe
378
+ }, {
379
+ key: "desc",
380
+ label: _e
381
+ }].map(function (_ref3) {
382
+ var e = _ref3.key,
383
+ r = _ref3.label;
384
+ return /* @__PURE__ */t("div", {
385
+ className: "bu-pf__sort-option".concat(_ === e ? " bu-pf__sort-option--active" : ""),
386
+ onClick: function onClick() {
387
+ return we(e);
388
+ },
389
+ children: r
390
+ }, e);
391
+ })
392
+ })]
393
+ })]
394
+ }), /* @__PURE__ */t("div", {
395
+ className: "bu-pf__list",
396
+ children: x && Q.length > 0 ? Q.map(function (e) {
397
+ var r = n.includes(e.value);
398
+ return /* @__PURE__ */i("div", {
399
+ className: "bu-pf__option".concat(d ? " bu-pf__option--multiple" : "").concat(r && !d ? " bu-pf__option--selected" : ""),
400
+ onClick: function onClick() {
401
+ return ve(e.value);
402
+ },
403
+ children: [d && /* @__PURE__ */t("img", {
404
+ className: "bu-pf__checkbox-img",
405
+ src: r ? Ee : ke,
406
+ alt: ""
407
+ }), /* @__PURE__ */t("span", {
408
+ className: "bu-pf__option-label",
409
+ children: e.label
410
+ })]
411
+ }, e.value);
412
+ }) : /* @__PURE__ */i("div", {
413
+ className: "bu-pf__no-match",
414
+ children: [/* @__PURE__ */t("img", {
415
+ className: "bu-pf__no-match-img",
416
+ src: Ce,
417
+ alt: x ? B : k
418
+ }), /* @__PURE__ */t("p", {
419
+ className: "bu-pf__no-match-text",
420
+ children: x ? B : k
421
+ }), /* @__PURE__ */i("p", {
422
+ className: "bu-pf__no-match-hint",
423
+ children: [me, /* @__PURE__ */t("button", {
424
+ type: "button",
425
+ className: "bu-pf__manage-btn",
426
+ onClick: ae,
427
+ children: ge
428
+ }), he]
429
+ })]
430
+ })
431
+ }), I && /* @__PURE__ */t("div", {
432
+ className: "bu-pf__add-row",
433
+ onClick: ce,
434
+ children: I
435
+ })]
436
+ })
437
+ }), (A = M == null ? void 0 : M()) != null ? A : document.body)]
438
+ })]
439
+ });
223
440
  }
224
- export {
225
- De as default
226
- };
441
+ export { He as default };