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.
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 +234 -134
  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 +97 -95
@@ -1,128 +1,412 @@
1
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import { useState as u, useRef as m, useEffect as b } from "react";
1
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
2
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
3
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
4
+ 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."); }
5
+ 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; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
+ 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; } } }; }
8
+ 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; } }
9
+ 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; }
10
+ import { jsx as e, jsxs as d } from "react/jsx-runtime";
11
+ import { useState as p, useRef as C, useEffect as w } from "react";
3
12
  /* empty css */
4
- const y = {
5
- pdf: { color: "#F54A45", label: "PDF" },
6
- image: { color: "#00AAFF", label: "IMG" },
7
- doc: { color: "#3B64FC", label: "DOC" },
8
- docx: { color: "#3B64FC", label: "DOC" },
9
- xls: { color: "#1D9B4C", label: "XLS" },
10
- xlsx: { color: "#1D9B4C", label: "XLS" },
11
- ppt: { color: "#DF4023", label: "PPT" },
12
- pptx: { color: "#DF4023", label: "PPT" },
13
- zip: { color: "#7B5EA7", label: "ZIP" },
14
- rar: { color: "#7B5EA7", label: "RAR" },
15
- txt: { color: "#8C8C8C", label: "TXT" },
16
- other: { color: "#1677FF", label: "FILE" }
17
- };
18
- function v({ fileType: r, fileUrl: l, fileName: o }) {
19
- if (r === "image" && l)
20
- return /* @__PURE__ */ e("img", { src: l, alt: o, className: "file-card__image-thumb" });
21
- const { color: t, label: s } = y[r];
22
- return /* @__PURE__ */ c("svg", { width: "88", height: "88", viewBox: "0 0 88 88", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
23
- /* @__PURE__ */ e("rect", { x: "14", y: "8", width: "50", height: "62", rx: "4", fill: "#F5F5F5" }),
24
- /* @__PURE__ */ e("path", { d: "M50 8L64 22H50V8Z", fill: "#E2E2E2" }),
25
- /* @__PURE__ */ e("rect", { x: "20", y: "30", width: "30", height: "4", rx: "2", fill: "#E2E2E2" }),
26
- /* @__PURE__ */ e("rect", { x: "20", y: "40", width: "30", height: "4", rx: "2", fill: "#E2E2E2" }),
27
- /* @__PURE__ */ e("rect", { x: "20", y: "50", width: "20", height: "4", rx: "2", fill: "#E2E2E2" }),
28
- /* @__PURE__ */ e("rect", { x: "42", y: "52", width: "32", height: "28", rx: "4", fill: t }),
29
- /* @__PURE__ */ e("rect", { x: "42", y: "52", width: "4", height: "28", rx: "2", fill: "rgba(255,255,255,0.25)" }),
30
- /* @__PURE__ */ e("rect", { x: "42", y: "76", width: "32", height: "4", rx: "2", fill: "rgba(0,0,0,0.15)" }),
31
- /* @__PURE__ */ e(
32
- "text",
33
- {
34
- x: "58",
35
- y: "71",
36
- textAnchor: "middle",
37
- fill: "white",
38
- fontSize: "9",
39
- fontWeight: "700",
40
- fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
41
- letterSpacing: "0.3",
42
- children: s
13
+ var E = Object.defineProperty,
14
+ _ = Object.getOwnPropertySymbols,
15
+ F = Object.prototype.hasOwnProperty,
16
+ L = Object.prototype.propertyIsEnumerable,
17
+ v = function v(r, t, l) {
18
+ return t in r ? E(r, t, {
19
+ enumerable: !0,
20
+ configurable: !0,
21
+ writable: !0,
22
+ value: l
23
+ }) : r[t] = l;
24
+ },
25
+ m = function m(r, t) {
26
+ for (var l in t || (t = {})) F.call(t, l) && v(r, l, t[l]);
27
+ if (_) {
28
+ var _iterator = _createForOfIteratorHelper(_(t)),
29
+ _step;
30
+ try {
31
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
32
+ var l = _step.value;
33
+ L.call(t, l) && v(r, l, t[l]);
34
+ }
35
+ } catch (err) {
36
+ _iterator.e(err);
37
+ } finally {
38
+ _iterator.f();
43
39
  }
44
- )
45
- ] });
40
+ }
41
+ return r;
42
+ },
43
+ P = function P(r, t, l) {
44
+ return new Promise(function (i, a) {
45
+ var c = function c(o) {
46
+ try {
47
+ h(l.next(o));
48
+ } catch (f) {
49
+ a(f);
50
+ }
51
+ },
52
+ s = function s(o) {
53
+ try {
54
+ h(l.throw(o));
55
+ } catch (f) {
56
+ a(f);
57
+ }
58
+ },
59
+ h = function h(o) {
60
+ return o.done ? i(o.value) : Promise.resolve(o.value).then(c, s);
61
+ };
62
+ h((l = l.apply(r, t)).next());
63
+ });
64
+ };
65
+ var N = {
66
+ pdf: {
67
+ color: "#F54A45",
68
+ label: "PDF"
69
+ },
70
+ image: {
71
+ color: "#00AAFF",
72
+ label: "IMG"
73
+ },
74
+ doc: {
75
+ color: "#3B64FC",
76
+ label: "DOC"
77
+ },
78
+ docx: {
79
+ color: "#3B64FC",
80
+ label: "DOC"
81
+ },
82
+ xls: {
83
+ color: "#1D9B4C",
84
+ label: "XLS"
85
+ },
86
+ xlsx: {
87
+ color: "#1D9B4C",
88
+ label: "XLS"
89
+ },
90
+ ppt: {
91
+ color: "#DF4023",
92
+ label: "PPT"
93
+ },
94
+ pptx: {
95
+ color: "#DF4023",
96
+ label: "PPT"
97
+ },
98
+ zip: {
99
+ color: "#7B5EA7",
100
+ label: "ZIP"
101
+ },
102
+ rar: {
103
+ color: "#7B5EA7",
104
+ label: "RAR"
105
+ },
106
+ txt: {
107
+ color: "#8C8C8C",
108
+ label: "TXT"
109
+ },
110
+ other: {
111
+ color: "#1677FF",
112
+ label: "FILE"
113
+ }
114
+ };
115
+ function B(_ref) {
116
+ var r = _ref.fileType,
117
+ t = _ref.fileUrl,
118
+ l = _ref.fileName;
119
+ if (r === "image" && t) return /* @__PURE__ */e("img", {
120
+ src: t,
121
+ alt: l,
122
+ className: "file-card__image-thumb"
123
+ });
124
+ var _N$r = N[r],
125
+ i = _N$r.color,
126
+ a = _N$r.label;
127
+ return /* @__PURE__ */d("svg", {
128
+ width: "88",
129
+ height: "88",
130
+ viewBox: "0 0 88 88",
131
+ fill: "none",
132
+ xmlns: "http://www.w3.org/2000/svg",
133
+ children: [/* @__PURE__ */e("rect", {
134
+ x: "14",
135
+ y: "8",
136
+ width: "50",
137
+ height: "62",
138
+ rx: "4",
139
+ fill: "#F5F5F5"
140
+ }), /* @__PURE__ */e("path", {
141
+ d: "M50 8L64 22H50V8Z",
142
+ fill: "#E2E2E2"
143
+ }), /* @__PURE__ */e("rect", {
144
+ x: "20",
145
+ y: "30",
146
+ width: "30",
147
+ height: "4",
148
+ rx: "2",
149
+ fill: "#E2E2E2"
150
+ }), /* @__PURE__ */e("rect", {
151
+ x: "20",
152
+ y: "40",
153
+ width: "30",
154
+ height: "4",
155
+ rx: "2",
156
+ fill: "#E2E2E2"
157
+ }), /* @__PURE__ */e("rect", {
158
+ x: "20",
159
+ y: "50",
160
+ width: "20",
161
+ height: "4",
162
+ rx: "2",
163
+ fill: "#E2E2E2"
164
+ }), /* @__PURE__ */e("rect", {
165
+ x: "42",
166
+ y: "52",
167
+ width: "32",
168
+ height: "28",
169
+ rx: "4",
170
+ fill: i
171
+ }), /* @__PURE__ */e("rect", {
172
+ x: "42",
173
+ y: "52",
174
+ width: "4",
175
+ height: "28",
176
+ rx: "2",
177
+ fill: "rgba(255,255,255,0.25)"
178
+ }), /* @__PURE__ */e("rect", {
179
+ x: "42",
180
+ y: "76",
181
+ width: "32",
182
+ height: "4",
183
+ rx: "2",
184
+ fill: "rgba(0,0,0,0.15)"
185
+ }), /* @__PURE__ */e("text", {
186
+ x: "58",
187
+ y: "71",
188
+ textAnchor: "middle",
189
+ fill: "white",
190
+ fontSize: "9",
191
+ fontWeight: "700",
192
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
193
+ letterSpacing: "0.3",
194
+ children: a
195
+ })]
196
+ });
46
197
  }
47
- function p() {
48
- return /* @__PURE__ */ c("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: [
49
- /* @__PURE__ */ e("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
50
- /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3", stroke: "currentColor", strokeWidth: "2" })
51
- ] });
198
+ function y() {
199
+ return /* @__PURE__ */d("svg", {
200
+ width: "16",
201
+ height: "16",
202
+ viewBox: "0 0 24 24",
203
+ fill: "none",
204
+ children: [/* @__PURE__ */e("path", {
205
+ d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z",
206
+ stroke: "currentColor",
207
+ strokeWidth: "2",
208
+ strokeLinecap: "round",
209
+ strokeLinejoin: "round"
210
+ }), /* @__PURE__ */e("circle", {
211
+ cx: "12",
212
+ cy: "12",
213
+ r: "3",
214
+ stroke: "currentColor",
215
+ strokeWidth: "2"
216
+ })]
217
+ });
52
218
  }
53
219
  function g() {
54
- return /* @__PURE__ */ c("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: [
55
- /* @__PURE__ */ e("polyline", { points: "3,6 5,6 21,6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
56
- /* @__PURE__ */ e("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
57
- /* @__PURE__ */ e("path", { d: "M10 11v6M14 11v6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
58
- /* @__PURE__ */ e("path", { d: "M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
59
- ] });
220
+ return /* @__PURE__ */d("svg", {
221
+ width: "16",
222
+ height: "16",
223
+ viewBox: "0 0 24 24",
224
+ fill: "none",
225
+ children: [/* @__PURE__ */e("polyline", {
226
+ points: "3,6 5,6 21,6",
227
+ stroke: "currentColor",
228
+ strokeWidth: "2",
229
+ strokeLinecap: "round",
230
+ strokeLinejoin: "round"
231
+ }), /* @__PURE__ */e("path", {
232
+ d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6",
233
+ stroke: "currentColor",
234
+ strokeWidth: "2",
235
+ strokeLinecap: "round",
236
+ strokeLinejoin: "round"
237
+ }), /* @__PURE__ */e("path", {
238
+ d: "M10 11v6M14 11v6",
239
+ stroke: "currentColor",
240
+ strokeWidth: "2",
241
+ strokeLinecap: "round",
242
+ strokeLinejoin: "round"
243
+ }), /* @__PURE__ */e("path", {
244
+ d: "M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2",
245
+ stroke: "currentColor",
246
+ strokeWidth: "2",
247
+ strokeLinecap: "round",
248
+ strokeLinejoin: "round"
249
+ })]
250
+ });
60
251
  }
61
- function k({ fileName: r, onRename: l }) {
62
- const [o, t] = u(!1), [s, a] = u(r), n = m(null);
63
- b(() => {
64
- var i, f;
65
- o && (a(r), (i = n.current) == null || i.focus(), (f = n.current) == null || f.select());
66
- }, [o, r]);
67
- const h = async () => {
68
- const i = s.trim();
69
- i && i !== r && await (l == null ? void 0 : l(i)), t(!1);
70
- }, d = () => t(!1), x = (i) => {
71
- i.key === "Enter" && !i.shiftKey && (i.preventDefault(), h()), i.key === "Escape" && d();
72
- }, _ = () => {
73
- h();
74
- }, C = () => {
75
- l && t(!0);
76
- };
77
- return o ? /* @__PURE__ */ e("div", { className: "file-card__name-area file-card__name-area--editing", children: /* @__PURE__ */ e(
78
- "textarea",
79
- {
80
- ref: n,
252
+ function x(_ref2) {
253
+ var r = _ref2.fileName,
254
+ t = _ref2.onRename;
255
+ var _p = p(!1),
256
+ _p2 = _slicedToArray(_p, 2),
257
+ l = _p2[0],
258
+ i = _p2[1],
259
+ _p3 = p(r),
260
+ _p4 = _slicedToArray(_p3, 2),
261
+ a = _p4[0],
262
+ c = _p4[1],
263
+ s = C(null);
264
+ w(function () {
265
+ var n, u;
266
+ l && (c(r), (n = s.current) == null || n.focus(), (u = s.current) == null || u.select());
267
+ }, [l, r]);
268
+ var h = function h() {
269
+ return P(null, null, /*#__PURE__*/_regenerator().m(function _callee() {
270
+ var n, _t;
271
+ return _regenerator().w(function (_context) {
272
+ while (1) switch (_context.n) {
273
+ case 0:
274
+ n = a.trim();
275
+ _t = n && n !== r;
276
+ if (!_t) {
277
+ _context.n = 1;
278
+ break;
279
+ }
280
+ _context.n = 1;
281
+ return t == null ? void 0 : t(n);
282
+ case 1:
283
+ i(!1);
284
+ case 2:
285
+ return _context.a(2);
286
+ }
287
+ }, _callee);
288
+ }));
289
+ },
290
+ o = function o() {
291
+ return i(!1);
292
+ },
293
+ f = function f(n) {
294
+ n.key === "Enter" && !n.shiftKey && (n.preventDefault(), h()), n.key === "Escape" && o();
295
+ },
296
+ k = function k() {
297
+ h();
298
+ },
299
+ b = function b() {
300
+ t && i(!0);
301
+ };
302
+ return l ? /* @__PURE__ */e("div", {
303
+ className: "file-card__name-area file-card__name-area--editing",
304
+ children: /* @__PURE__ */e("textarea", {
305
+ ref: s,
81
306
  className: "file-card__edit-input",
82
- value: s,
83
- onChange: (i) => a(i.target.value),
84
- onKeyDown: x,
85
- onBlur: _,
307
+ value: a,
308
+ onChange: function onChange(n) {
309
+ return c(n.target.value);
310
+ },
311
+ onKeyDown: f,
312
+ onBlur: k,
86
313
  rows: 2,
87
- style: { height: "42px" }
88
- }
89
- ) }) : /* @__PURE__ */ e("div", { className: "file-card__name-area", onDoubleClick: C, children: /* @__PURE__ */ e("span", { className: "file-card__filename", title: r, children: r }) });
314
+ style: {
315
+ height: "42px"
316
+ }
317
+ })
318
+ }) : /* @__PURE__ */e("div", {
319
+ className: "file-card__name-area",
320
+ onDoubleClick: b,
321
+ children: /* @__PURE__ */e("span", {
322
+ className: "file-card__filename",
323
+ title: r,
324
+ children: r
325
+ })
326
+ });
90
327
  }
91
- function E({ fileName: r, onDelete: l, onRename: o, onPreview: t, className: s, style: a }) {
92
- return /* @__PURE__ */ c("div", { className: `file-card file-card--pdf ${s || ""}`, style: a, children: [
93
- /* @__PURE__ */ c("div", { className: "file-card__pdf-preview", onClick: t, children: [
94
- (t || l) && /* @__PURE__ */ c("div", { className: "file-card__overlay", children: [
95
- t && /* @__PURE__ */ e("button", { className: "file-card__overlay-btn", onClick: (n) => {
96
- n.stopPropagation(), t();
97
- }, children: /* @__PURE__ */ e(p, {}) }),
98
- l && /* @__PURE__ */ e("button", { className: "file-card__overlay-btn", onClick: (n) => {
99
- n.stopPropagation(), l();
100
- }, children: /* @__PURE__ */ e(g, {}) })
101
- ] }),
102
- /* @__PURE__ */ e("div", { className: "file-card__pdf-label", children: /* @__PURE__ */ e("span", { children: "PDF" }) })
103
- ] }),
104
- /* @__PURE__ */ e(k, { fileName: r, onRename: o })
105
- ] });
328
+ function O(_ref3) {
329
+ var r = _ref3.fileName,
330
+ t = _ref3.onDelete,
331
+ l = _ref3.onRename,
332
+ i = _ref3.onPreview,
333
+ a = _ref3.className,
334
+ c = _ref3.style;
335
+ return /* @__PURE__ */d("div", {
336
+ className: "file-card file-card--pdf ".concat(a || ""),
337
+ style: c,
338
+ children: [/* @__PURE__ */d("div", {
339
+ className: "file-card__pdf-preview",
340
+ onClick: i,
341
+ children: [(i || t) && /* @__PURE__ */d("div", {
342
+ className: "file-card__overlay",
343
+ children: [i && /* @__PURE__ */e("button", {
344
+ className: "file-card__overlay-btn",
345
+ onClick: function onClick(s) {
346
+ s.stopPropagation(), i();
347
+ },
348
+ children: /* @__PURE__ */e(y, {})
349
+ }), t && /* @__PURE__ */e("button", {
350
+ className: "file-card__overlay-btn",
351
+ onClick: function onClick(s) {
352
+ s.stopPropagation(), t();
353
+ },
354
+ children: /* @__PURE__ */e(g, {})
355
+ })]
356
+ }), /* @__PURE__ */e("div", {
357
+ className: "file-card__pdf-label",
358
+ children: /* @__PURE__ */e("span", {
359
+ children: "PDF"
360
+ })
361
+ })]
362
+ }), /* @__PURE__ */e(x, {
363
+ fileName: r,
364
+ onRename: l
365
+ })]
366
+ });
106
367
  }
107
- function F({ fileName: r, fileType: l, fileUrl: o, onDelete: t, onRename: s, onPreview: a, className: n, style: h }) {
108
- return /* @__PURE__ */ c("div", { className: `file-card file-card--other ${n || ""}`, style: h, children: [
109
- /* @__PURE__ */ c("div", { className: "file-card__other-preview", onClick: a, children: [
110
- (a || t) && /* @__PURE__ */ c("div", { className: "file-card__overlay", children: [
111
- a && /* @__PURE__ */ e("button", { className: "file-card__overlay-btn", onClick: (d) => {
112
- d.stopPropagation(), a();
113
- }, children: /* @__PURE__ */ e(p, {}) }),
114
- t && /* @__PURE__ */ e("button", { className: "file-card__overlay-btn", onClick: (d) => {
115
- d.stopPropagation(), t();
116
- }, children: /* @__PURE__ */ e(g, {}) })
117
- ] }),
118
- /* @__PURE__ */ e(v, { fileType: l, fileUrl: o, fileName: r })
119
- ] }),
120
- /* @__PURE__ */ e(k, { fileName: r, onRename: s })
121
- ] });
368
+ function I(_ref4) {
369
+ var r = _ref4.fileName,
370
+ t = _ref4.fileType,
371
+ l = _ref4.fileUrl,
372
+ i = _ref4.onDelete,
373
+ a = _ref4.onRename,
374
+ c = _ref4.onPreview,
375
+ s = _ref4.className,
376
+ h = _ref4.style;
377
+ return /* @__PURE__ */d("div", {
378
+ className: "file-card file-card--other ".concat(s || ""),
379
+ style: h,
380
+ children: [/* @__PURE__ */d("div", {
381
+ className: "file-card__other-preview",
382
+ onClick: c,
383
+ children: [(c || i) && /* @__PURE__ */d("div", {
384
+ className: "file-card__overlay",
385
+ children: [c && /* @__PURE__ */e("button", {
386
+ className: "file-card__overlay-btn",
387
+ onClick: function onClick(o) {
388
+ o.stopPropagation(), c();
389
+ },
390
+ children: /* @__PURE__ */e(y, {})
391
+ }), i && /* @__PURE__ */e("button", {
392
+ className: "file-card__overlay-btn",
393
+ onClick: function onClick(o) {
394
+ o.stopPropagation(), i();
395
+ },
396
+ children: /* @__PURE__ */e(g, {})
397
+ })]
398
+ }), /* @__PURE__ */e(B, {
399
+ fileType: t,
400
+ fileUrl: l,
401
+ fileName: r
402
+ })]
403
+ }), /* @__PURE__ */e(x, {
404
+ fileName: r,
405
+ onRename: a
406
+ })]
407
+ });
122
408
  }
123
- function N(r) {
124
- return r.fileType === "pdf" ? /* @__PURE__ */ e(E, { ...r }) : /* @__PURE__ */ e(F, { ...r });
409
+ function M(r) {
410
+ return r.fileType === "pdf" ? /* @__PURE__ */e(O, m({}, r)) : /* @__PURE__ */e(I, m({}, r));
125
411
  }
126
- export {
127
- N as default
128
- };
412
+ export { M as default };
@@ -1 +1,82 @@
1
- "use strict";const s=require("react/jsx-runtime");;/* empty css */const n=({type:r,style:i,onClick:u,className:e,...c})=>{const t=e?`bu-icon ${e}`:"bu-icon";return s.jsx("svg",{style:i,className:t,"aria-hidden":"true",onClick:u,...c,children:s.jsx("use",{xlinkHref:`#${r}`})})};n.displayName="BuIcon";module.exports=n;
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 i = require("react/jsx-runtime");
7
+ ; /* empty css */
8
+ var u = Object.defineProperty,
9
+ O = Object.defineProperties,
10
+ d = Object.getOwnPropertyDescriptors,
11
+ n = Object.getOwnPropertySymbols,
12
+ l = Object.prototype.hasOwnProperty,
13
+ c = Object.prototype.propertyIsEnumerable,
14
+ o = function o(r, e, t) {
15
+ return e in r ? u(r, e, {
16
+ enumerable: !0,
17
+ configurable: !0,
18
+ writable: !0,
19
+ value: t
20
+ }) : r[e] = t;
21
+ },
22
+ y = function y(r, e) {
23
+ for (var t in e || (e = {})) l.call(e, t) && o(r, t, e[t]);
24
+ if (n) {
25
+ var _iterator = _createForOfIteratorHelper(n(e)),
26
+ _step;
27
+ try {
28
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
29
+ var t = _step.value;
30
+ c.call(e, t) && o(r, t, e[t]);
31
+ }
32
+ } catch (err) {
33
+ _iterator.e(err);
34
+ } finally {
35
+ _iterator.f();
36
+ }
37
+ }
38
+ return r;
39
+ },
40
+ P = function P(r, e) {
41
+ return O(r, d(e));
42
+ },
43
+ m = function m(r, e) {
44
+ var t = {};
45
+ for (var a in r) l.call(r, a) && e.indexOf(a) < 0 && (t[a] = r[a]);
46
+ if (r != null && n) {
47
+ var _iterator2 = _createForOfIteratorHelper(n(r)),
48
+ _step2;
49
+ try {
50
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
51
+ var a = _step2.value;
52
+ e.indexOf(a) < 0 && c.call(r, a) && (t[a] = r[a]);
53
+ }
54
+ } catch (err) {
55
+ _iterator2.e(err);
56
+ } finally {
57
+ _iterator2.f();
58
+ }
59
+ }
60
+ return t;
61
+ };
62
+ var f = function f(r) {
63
+ var e = r,
64
+ t = e.type,
65
+ a = e.style,
66
+ p = e.onClick,
67
+ s = e.className,
68
+ _ = m(e, ["type", "style", "onClick", "className"]);
69
+ var v = s ? "bu-icon ".concat(s) : "bu-icon";
70
+ return i.jsx("svg", P(y({
71
+ style: a,
72
+ className: v,
73
+ "aria-hidden": "true",
74
+ onClick: p
75
+ }, _), {
76
+ children: i.jsx("use", {
77
+ xlinkHref: "#".concat(t)
78
+ })
79
+ }));
80
+ };
81
+ f.displayName = "BuIcon";
82
+ module.exports = f;