@baishuyun/ui-business 2.0.0

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 (79) hide show
  1. package/README.md +67 -0
  2. package/dist/ConfigProvider/ConfigProvider-CE-neQMa.js +9 -0
  3. package/dist/ConfigProvider/configContext-lDqg07Z3.js +7 -0
  4. package/dist/ConfigProvider/index.d.ts +4 -0
  5. package/dist/ConfigProvider/index.js +4 -0
  6. package/dist/DeptsMember/DeptsMember-C54jKU8C.js +685 -0
  7. package/dist/DeptsMember/TabGroup-B_2npRbC.js +121 -0
  8. package/dist/DeptsMember/index.d.ts +6 -0
  9. package/dist/DeptsMember/index.js +6 -0
  10. package/dist/DeptsMember/subcomponents/Entity/Department/index.d.ts +2 -0
  11. package/dist/DeptsMember/subcomponents/Entity/Department/index.js +363 -0
  12. package/dist/DeptsMember/subcomponents/Entity/Member/index.d.ts +2 -0
  13. package/dist/DeptsMember/subcomponents/Entity/Member/index.js +671 -0
  14. package/dist/DeptsMember/utils/index.d.ts +2 -0
  15. package/dist/DeptsMember/utils/index.js +77 -0
  16. package/dist/components/ConfigProvider/ConfigProvider.d.ts +4 -0
  17. package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +5 -0
  18. package/dist/components/ConfigProvider/context/configContext.d.ts +3 -0
  19. package/dist/components/ConfigProvider/index.d.ts +2 -0
  20. package/dist/components/DeptsMember/DeptsMember.d.ts +3 -0
  21. package/dist/components/DeptsMember/DeptsMember.type.d.ts +23 -0
  22. package/dist/components/DeptsMember/context/DeptsMemberContext.d.ts +45 -0
  23. package/dist/components/DeptsMember/hooks/useDeptsMemberSelector.d.ts +7 -0
  24. package/dist/components/DeptsMember/index.d.ts +4 -0
  25. package/dist/components/DeptsMember/reducers/deptsMemberReducer.d.ts +3 -0
  26. package/dist/components/DeptsMember/subcomponents/Entity/Department/CurrentDepartmentEntity/CurrentDepartmentEntity.d.ts +2 -0
  27. package/dist/components/DeptsMember/subcomponents/Entity/Department/DepartmentSearch/DepartmentSearch.d.ts +4 -0
  28. package/dist/components/DeptsMember/subcomponents/Entity/Department/ExternalContactEntity/ExternalContactEntity.d.ts +2 -0
  29. package/dist/components/DeptsMember/subcomponents/Entity/Department/GroupList/GroupList.d.ts +9 -0
  30. package/dist/components/DeptsMember/subcomponents/Entity/Department/OrganizationalEntity/ExternalOrganization/ExternalOrganization.d.ts +7 -0
  31. package/dist/components/DeptsMember/subcomponents/Entity/Department/OrganizationalEntity/InternalOrganization/InternalOrganization.d.ts +7 -0
  32. package/dist/components/DeptsMember/subcomponents/Entity/Department/OrganizationalEntity/OrganizationalEntity.d.ts +2 -0
  33. package/dist/components/DeptsMember/subcomponents/Entity/Department/index.d.ts +6 -0
  34. package/dist/components/DeptsMember/subcomponents/Entity/Member/CurrentEntity/CurrentEntity.d.ts +2 -0
  35. package/dist/components/DeptsMember/subcomponents/Entity/Member/ExternalContactEntity/ExternalContactEntity.d.ts +2 -0
  36. package/dist/components/DeptsMember/subcomponents/Entity/Member/MajorEntity/MajorEntity.d.ts +2 -0
  37. package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/AllMemeberCheck/AllMemeberCheck.d.ts +5 -0
  38. package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/ExternalMember/ExternalMember.d.ts +8 -0
  39. package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/InternalMemeber/InternalMemeber.d.ts +8 -0
  40. package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/MemberEntity.d.ts +2 -0
  41. package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/MemerList/MemberList.d.ts +7 -0
  42. package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberSearch/MemberSearch.d.ts +4 -0
  43. package/dist/components/DeptsMember/subcomponents/Entity/Member/RoleEntity/RoleEntity.d.ts +2 -0
  44. package/dist/components/DeptsMember/subcomponents/Entity/Member/index.d.ts +6 -0
  45. package/dist/components/DeptsMember/subcomponents/SelectionArea/SelectionArea.d.ts +6 -0
  46. package/dist/components/DeptsMember/subcomponents/SelectionTabs/SelectionTabList/SelectionTabList.d.ts +14 -0
  47. package/dist/components/DeptsMember/subcomponents/SelectionTabs/SelectionTabPanel/SelectionTabPanel.d.ts +3 -0
  48. package/dist/components/DeptsMember/subcomponents/SelectionTabs/SelectionTabs.d.ts +2 -0
  49. package/dist/components/DeptsMember/subcomponents/TabGroup/TabGroup.d.ts +9 -0
  50. package/dist/components/DeptsMember/subcomponents/TagIcon/TagIcon.d.ts +4 -0
  51. package/dist/components/DeptsMember/utils/constants.d.ts +25 -0
  52. package/dist/components/DeptsMember/utils/index.d.ts +43 -0
  53. package/dist/components/index.d.ts +2 -0
  54. package/dist/hooks/useLocale.d.ts +10 -0
  55. package/dist/index.css +1 -0
  56. package/dist/index.d.ts +2 -0
  57. package/dist/index.js +9 -0
  58. package/dist/lang/en-US.json.d.ts +58 -0
  59. package/dist/lang/zh-CN.json.d.ts +58 -0
  60. package/dist/services/apiService.d.ts +12 -0
  61. package/dist/services/corp/outsider.service.d.ts +6 -0
  62. package/dist/services/data/department.service.d.ts +12 -0
  63. package/dist/services/data/member.service.d.ts +19 -0
  64. package/dist/services/data/member_limit.service.d.ts +5 -0
  65. package/dist/services/data/outsider.service.d.ts +11 -0
  66. package/dist/services/team/team.services.d.ts +10 -0
  67. package/dist/vendors/axios.js +1720 -0
  68. package/dist/vendors/clsx.js +16 -0
  69. package/dist/vendors/lodash-es.js +124 -0
  70. package/dist/vendors/services/apiService.js +88 -0
  71. package/dist/vendors/services/corp/outsider.service.js +6 -0
  72. package/dist/vendors/services/data/department.service.js +6 -0
  73. package/dist/vendors/services/data/member.service.js +9 -0
  74. package/dist/vendors/services/data/member_limit.service.js +5 -0
  75. package/dist/vendors/services/data/outsider.service.js +6 -0
  76. package/dist/vendors/services/team/team.services.js +5 -0
  77. package/dist/vendors/simplebar-react.js +408 -0
  78. package/dist/vite-env.d.ts +6 -0
  79. package/package.json +87 -0
@@ -0,0 +1,408 @@
1
+ import * as f from "react";
2
+ import { t as j, d as M } from "./lodash-es.js";
3
+ var w = function() {
4
+ return w = Object.assign || function(t) {
5
+ for (var i, e = 1, r = arguments.length; e < r; e++) {
6
+ i = arguments[e];
7
+ for (var l in i) Object.prototype.hasOwnProperty.call(i, l) && (t[l] = i[l]);
8
+ }
9
+ return t;
10
+ }, w.apply(this, arguments);
11
+ };
12
+ function T(s) {
13
+ return !s || !s.ownerDocument || !s.ownerDocument.defaultView ? window : s.ownerDocument.defaultView;
14
+ }
15
+ function P(s) {
16
+ return !s || !s.ownerDocument ? document : s.ownerDocument;
17
+ }
18
+ var V = function(s) {
19
+ var t = {}, i = Array.prototype.reduce.call(s, function(e, r) {
20
+ var l = r.name.match(/data-simplebar-(.+)/);
21
+ if (l) {
22
+ var o = l[1].replace(/\W+(.)/g, function(a, u) {
23
+ return u.toUpperCase();
24
+ });
25
+ switch (r.value) {
26
+ case "true":
27
+ e[o] = !0;
28
+ break;
29
+ case "false":
30
+ e[o] = !1;
31
+ break;
32
+ case void 0:
33
+ e[o] = !0;
34
+ break;
35
+ default:
36
+ e[o] = r.value;
37
+ }
38
+ }
39
+ return e;
40
+ }, t);
41
+ return i;
42
+ };
43
+ function H(s, t) {
44
+ var i;
45
+ s && (i = s.classList).add.apply(i, t.split(" "));
46
+ }
47
+ function B(s, t) {
48
+ s && t.split(" ").forEach(function(i) {
49
+ s.classList.remove(i);
50
+ });
51
+ }
52
+ function X(s) {
53
+ return ".".concat(s.split(" ").join("."));
54
+ }
55
+ var _ = !!(typeof window < "u" && window.document && window.document.createElement), I = /* @__PURE__ */ Object.freeze({
56
+ __proto__: null,
57
+ addClasses: H,
58
+ canUseDOM: _,
59
+ classNamesToQuery: X,
60
+ getElementDocument: P,
61
+ getElementWindow: T,
62
+ getOptions: V,
63
+ removeClasses: B
64
+ }), O = null, R = null;
65
+ _ && window.addEventListener("resize", function() {
66
+ R !== window.devicePixelRatio && (R = window.devicePixelRatio, O = null);
67
+ });
68
+ function D() {
69
+ if (O === null) {
70
+ if (typeof document > "u")
71
+ return O = 0, O;
72
+ var s = document.body, t = document.createElement("div");
73
+ t.classList.add("simplebar-hide-scrollbar"), s.appendChild(t);
74
+ var i = t.getBoundingClientRect().right;
75
+ s.removeChild(t), O = i;
76
+ }
77
+ return O;
78
+ }
79
+ var g = T, C = P, $ = V, b = H, y = B, d = X, k = (
80
+ /** @class */
81
+ (function() {
82
+ function s(t, i) {
83
+ i === void 0 && (i = {});
84
+ var e = this;
85
+ if (this.removePreventClickId = null, this.minScrollbarWidth = 20, this.stopScrollDelay = 175, this.isScrolling = !1, this.isMouseEntering = !1, this.isDragging = !1, this.scrollXTicking = !1, this.scrollYTicking = !1, this.wrapperEl = null, this.contentWrapperEl = null, this.contentEl = null, this.offsetEl = null, this.maskEl = null, this.placeholderEl = null, this.heightAutoObserverWrapperEl = null, this.heightAutoObserverEl = null, this.rtlHelpers = null, this.scrollbarWidth = 0, this.resizeObserver = null, this.mutationObserver = null, this.elStyles = null, this.isRtl = null, this.mouseX = 0, this.mouseY = 0, this.onMouseMove = function() {
86
+ }, this.onWindowResize = function() {
87
+ }, this.onStopScrolling = function() {
88
+ }, this.onMouseEntered = function() {
89
+ }, this.onScroll = function() {
90
+ var r = g(e.el);
91
+ e.scrollXTicking || (r.requestAnimationFrame(e.scrollX), e.scrollXTicking = !0), e.scrollYTicking || (r.requestAnimationFrame(e.scrollY), e.scrollYTicking = !0), e.isScrolling || (e.isScrolling = !0, b(e.el, e.classNames.scrolling)), e.showScrollbar("x"), e.showScrollbar("y"), e.onStopScrolling();
92
+ }, this.scrollX = function() {
93
+ e.axis.x.isOverflowing && e.positionScrollbar("x"), e.scrollXTicking = !1;
94
+ }, this.scrollY = function() {
95
+ e.axis.y.isOverflowing && e.positionScrollbar("y"), e.scrollYTicking = !1;
96
+ }, this._onStopScrolling = function() {
97
+ y(e.el, e.classNames.scrolling), e.options.autoHide && (e.hideScrollbar("x"), e.hideScrollbar("y")), e.isScrolling = !1;
98
+ }, this.onMouseEnter = function() {
99
+ e.isMouseEntering || (b(e.el, e.classNames.mouseEntered), e.showScrollbar("x"), e.showScrollbar("y"), e.isMouseEntering = !0), e.onMouseEntered();
100
+ }, this._onMouseEntered = function() {
101
+ y(e.el, e.classNames.mouseEntered), e.options.autoHide && (e.hideScrollbar("x"), e.hideScrollbar("y")), e.isMouseEntering = !1;
102
+ }, this._onMouseMove = function(r) {
103
+ e.mouseX = r.clientX, e.mouseY = r.clientY, (e.axis.x.isOverflowing || e.axis.x.forceVisible) && e.onMouseMoveForAxis("x"), (e.axis.y.isOverflowing || e.axis.y.forceVisible) && e.onMouseMoveForAxis("y");
104
+ }, this.onMouseLeave = function() {
105
+ e.onMouseMove.cancel(), (e.axis.x.isOverflowing || e.axis.x.forceVisible) && e.onMouseLeaveForAxis("x"), (e.axis.y.isOverflowing || e.axis.y.forceVisible) && e.onMouseLeaveForAxis("y"), e.mouseX = -1, e.mouseY = -1;
106
+ }, this._onWindowResize = function() {
107
+ e.scrollbarWidth = e.getScrollbarWidth(), e.hideNativeScrollbar();
108
+ }, this.onPointerEvent = function(r) {
109
+ if (!(!e.axis.x.track.el || !e.axis.y.track.el || !e.axis.x.scrollbar.el || !e.axis.y.scrollbar.el)) {
110
+ var l, o;
111
+ e.axis.x.track.rect = e.axis.x.track.el.getBoundingClientRect(), e.axis.y.track.rect = e.axis.y.track.el.getBoundingClientRect(), (e.axis.x.isOverflowing || e.axis.x.forceVisible) && (l = e.isWithinBounds(e.axis.x.track.rect)), (e.axis.y.isOverflowing || e.axis.y.forceVisible) && (o = e.isWithinBounds(e.axis.y.track.rect)), (l || o) && (r.stopPropagation(), r.type === "pointerdown" && r.pointerType !== "touch" && (l && (e.axis.x.scrollbar.rect = e.axis.x.scrollbar.el.getBoundingClientRect(), e.isWithinBounds(e.axis.x.scrollbar.rect) ? e.onDragStart(r, "x") : e.onTrackClick(r, "x")), o && (e.axis.y.scrollbar.rect = e.axis.y.scrollbar.el.getBoundingClientRect(), e.isWithinBounds(e.axis.y.scrollbar.rect) ? e.onDragStart(r, "y") : e.onTrackClick(r, "y"))));
112
+ }
113
+ }, this.drag = function(r) {
114
+ var l, o, a, u, h, v, n, p, c, W, E;
115
+ if (!(!e.draggedAxis || !e.contentWrapperEl)) {
116
+ var x, S = e.axis[e.draggedAxis].track, A = (o = (l = S.rect) === null || l === void 0 ? void 0 : l[e.axis[e.draggedAxis].sizeAttr]) !== null && o !== void 0 ? o : 0, L = e.axis[e.draggedAxis].scrollbar, Y = (u = (a = e.contentWrapperEl) === null || a === void 0 ? void 0 : a[e.axis[e.draggedAxis].scrollSizeAttr]) !== null && u !== void 0 ? u : 0, q = parseInt((v = (h = e.elStyles) === null || h === void 0 ? void 0 : h[e.axis[e.draggedAxis].sizeAttr]) !== null && v !== void 0 ? v : "0px", 10);
117
+ r.preventDefault(), r.stopPropagation(), e.draggedAxis === "y" ? x = r.pageY : x = r.pageX;
118
+ var N = x - ((p = (n = S.rect) === null || n === void 0 ? void 0 : n[e.axis[e.draggedAxis].offsetAttr]) !== null && p !== void 0 ? p : 0) - e.axis[e.draggedAxis].dragOffset;
119
+ N = e.draggedAxis === "x" && e.isRtl ? ((W = (c = S.rect) === null || c === void 0 ? void 0 : c[e.axis[e.draggedAxis].sizeAttr]) !== null && W !== void 0 ? W : 0) - L.size - N : N;
120
+ var F = N / (A - L.size), z = F * (Y - q);
121
+ e.draggedAxis === "x" && e.isRtl && (z = !((E = s.getRtlHelpers()) === null || E === void 0) && E.isScrollingToNegative ? -z : z), e.contentWrapperEl[e.axis[e.draggedAxis].scrollOffsetAttr] = z;
122
+ }
123
+ }, this.onEndDrag = function(r) {
124
+ e.isDragging = !1;
125
+ var l = C(e.el), o = g(e.el);
126
+ r.preventDefault(), r.stopPropagation(), y(e.el, e.classNames.dragging), e.onStopScrolling(), l.removeEventListener("mousemove", e.drag, !0), l.removeEventListener("mouseup", e.onEndDrag, !0), e.removePreventClickId = o.setTimeout(function() {
127
+ l.removeEventListener("click", e.preventClick, !0), l.removeEventListener("dblclick", e.preventClick, !0), e.removePreventClickId = null;
128
+ });
129
+ }, this.preventClick = function(r) {
130
+ r.preventDefault(), r.stopPropagation();
131
+ }, this.el = t, this.options = w(w({}, s.defaultOptions), i), this.classNames = w(w({}, s.defaultOptions.classNames), i.classNames), this.axis = {
132
+ x: {
133
+ scrollOffsetAttr: "scrollLeft",
134
+ sizeAttr: "width",
135
+ scrollSizeAttr: "scrollWidth",
136
+ offsetSizeAttr: "offsetWidth",
137
+ offsetAttr: "left",
138
+ overflowAttr: "overflowX",
139
+ dragOffset: 0,
140
+ isOverflowing: !0,
141
+ forceVisible: !1,
142
+ track: { size: null, el: null, rect: null, isVisible: !1 },
143
+ scrollbar: { size: null, el: null, rect: null, isVisible: !1 }
144
+ },
145
+ y: {
146
+ scrollOffsetAttr: "scrollTop",
147
+ sizeAttr: "height",
148
+ scrollSizeAttr: "scrollHeight",
149
+ offsetSizeAttr: "offsetHeight",
150
+ offsetAttr: "top",
151
+ overflowAttr: "overflowY",
152
+ dragOffset: 0,
153
+ isOverflowing: !0,
154
+ forceVisible: !1,
155
+ track: { size: null, el: null, rect: null, isVisible: !1 },
156
+ scrollbar: { size: null, el: null, rect: null, isVisible: !1 }
157
+ }
158
+ }, typeof this.el != "object" || !this.el.nodeName)
159
+ throw new Error("Argument passed to SimpleBar must be an HTML element instead of ".concat(this.el));
160
+ this.onMouseMove = j(this._onMouseMove, 64), this.onWindowResize = M(this._onWindowResize, 64, { leading: !0 }), this.onStopScrolling = M(this._onStopScrolling, this.stopScrollDelay), this.onMouseEntered = M(this._onMouseEntered, this.stopScrollDelay), this.init();
161
+ }
162
+ return s.getRtlHelpers = function() {
163
+ if (s.rtlHelpers)
164
+ return s.rtlHelpers;
165
+ var t = document.createElement("div");
166
+ t.innerHTML = '<div class="simplebar-dummy-scrollbar-size"><div></div></div>';
167
+ var i = t.firstElementChild, e = i?.firstElementChild;
168
+ if (!e)
169
+ return null;
170
+ document.body.appendChild(i), i.scrollLeft = 0;
171
+ var r = s.getOffset(i), l = s.getOffset(e);
172
+ i.scrollLeft = -999;
173
+ var o = s.getOffset(e);
174
+ return document.body.removeChild(i), s.rtlHelpers = {
175
+ // determines if the scrolling is responding with negative values
176
+ isScrollOriginAtZero: r.left !== l.left,
177
+ // determines if the origin scrollbar position is inverted or not (positioned on left or right)
178
+ isScrollingToNegative: l.left !== o.left
179
+ }, s.rtlHelpers;
180
+ }, s.prototype.getScrollbarWidth = function() {
181
+ try {
182
+ return this.contentWrapperEl && getComputedStyle(this.contentWrapperEl, "::-webkit-scrollbar").display === "none" || "scrollbarWidth" in document.documentElement.style || "-ms-overflow-style" in document.documentElement.style ? 0 : D();
183
+ } catch {
184
+ return D();
185
+ }
186
+ }, s.getOffset = function(t) {
187
+ var i = t.getBoundingClientRect(), e = C(t), r = g(t);
188
+ return {
189
+ top: i.top + (r.pageYOffset || e.documentElement.scrollTop),
190
+ left: i.left + (r.pageXOffset || e.documentElement.scrollLeft)
191
+ };
192
+ }, s.prototype.init = function() {
193
+ _ && (this.initDOM(), this.rtlHelpers = s.getRtlHelpers(), this.scrollbarWidth = this.getScrollbarWidth(), this.recalculate(), this.initListeners());
194
+ }, s.prototype.initDOM = function() {
195
+ var t, i;
196
+ this.wrapperEl = this.el.querySelector(d(this.classNames.wrapper)), this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector(d(this.classNames.contentWrapper)), this.contentEl = this.options.contentNode || this.el.querySelector(d(this.classNames.contentEl)), this.offsetEl = this.el.querySelector(d(this.classNames.offset)), this.maskEl = this.el.querySelector(d(this.classNames.mask)), this.placeholderEl = this.findChild(this.wrapperEl, d(this.classNames.placeholder)), this.heightAutoObserverWrapperEl = this.el.querySelector(d(this.classNames.heightAutoObserverWrapperEl)), this.heightAutoObserverEl = this.el.querySelector(d(this.classNames.heightAutoObserverEl)), this.axis.x.track.el = this.findChild(this.el, "".concat(d(this.classNames.track)).concat(d(this.classNames.horizontal))), this.axis.y.track.el = this.findChild(this.el, "".concat(d(this.classNames.track)).concat(d(this.classNames.vertical))), this.axis.x.scrollbar.el = ((t = this.axis.x.track.el) === null || t === void 0 ? void 0 : t.querySelector(d(this.classNames.scrollbar))) || null, this.axis.y.scrollbar.el = ((i = this.axis.y.track.el) === null || i === void 0 ? void 0 : i.querySelector(d(this.classNames.scrollbar))) || null, this.options.autoHide || (b(this.axis.x.scrollbar.el, this.classNames.visible), b(this.axis.y.scrollbar.el, this.classNames.visible));
197
+ }, s.prototype.initListeners = function() {
198
+ var t = this, i, e = g(this.el);
199
+ if (this.el.addEventListener("mouseenter", this.onMouseEnter), this.el.addEventListener("pointerdown", this.onPointerEvent, !0), this.el.addEventListener("mousemove", this.onMouseMove), this.el.addEventListener("mouseleave", this.onMouseLeave), (i = this.contentWrapperEl) === null || i === void 0 || i.addEventListener("scroll", this.onScroll), e.addEventListener("resize", this.onWindowResize), !!this.contentEl) {
200
+ if (window.ResizeObserver) {
201
+ var r = !1, l = e.ResizeObserver || ResizeObserver;
202
+ this.resizeObserver = new l(function() {
203
+ r && e.requestAnimationFrame(function() {
204
+ t.recalculate();
205
+ });
206
+ }), this.resizeObserver.observe(this.el), this.resizeObserver.observe(this.contentEl), e.requestAnimationFrame(function() {
207
+ r = !0;
208
+ });
209
+ }
210
+ this.mutationObserver = new e.MutationObserver(function() {
211
+ e.requestAnimationFrame(function() {
212
+ t.recalculate();
213
+ });
214
+ }), this.mutationObserver.observe(this.contentEl, {
215
+ childList: !0,
216
+ subtree: !0,
217
+ characterData: !0
218
+ });
219
+ }
220
+ }, s.prototype.recalculate = function() {
221
+ if (!(!this.heightAutoObserverEl || !this.contentEl || !this.contentWrapperEl || !this.wrapperEl || !this.placeholderEl)) {
222
+ var t = g(this.el);
223
+ this.elStyles = t.getComputedStyle(this.el), this.isRtl = this.elStyles.direction === "rtl";
224
+ var i = this.contentEl.offsetWidth, e = this.heightAutoObserverEl.offsetHeight <= 1, r = this.heightAutoObserverEl.offsetWidth <= 1 || i > 0, l = this.contentWrapperEl.offsetWidth, o = this.elStyles.overflowX, a = this.elStyles.overflowY;
225
+ this.contentEl.style.padding = "".concat(this.elStyles.paddingTop, " ").concat(this.elStyles.paddingRight, " ").concat(this.elStyles.paddingBottom, " ").concat(this.elStyles.paddingLeft), this.wrapperEl.style.margin = "-".concat(this.elStyles.paddingTop, " -").concat(this.elStyles.paddingRight, " -").concat(this.elStyles.paddingBottom, " -").concat(this.elStyles.paddingLeft);
226
+ var u = this.contentEl.scrollHeight, h = this.contentEl.scrollWidth;
227
+ this.contentWrapperEl.style.height = e ? "auto" : "100%", this.placeholderEl.style.width = r ? "".concat(i || h, "px") : "auto", this.placeholderEl.style.height = "".concat(u, "px");
228
+ var v = this.contentWrapperEl.offsetHeight;
229
+ this.axis.x.isOverflowing = i !== 0 && h > i, this.axis.y.isOverflowing = u > v, this.axis.x.isOverflowing = o === "hidden" ? !1 : this.axis.x.isOverflowing, this.axis.y.isOverflowing = a === "hidden" ? !1 : this.axis.y.isOverflowing, this.axis.x.forceVisible = this.options.forceVisible === "x" || this.options.forceVisible === !0, this.axis.y.forceVisible = this.options.forceVisible === "y" || this.options.forceVisible === !0, this.hideNativeScrollbar();
230
+ var n = this.axis.x.isOverflowing ? this.scrollbarWidth : 0, p = this.axis.y.isOverflowing ? this.scrollbarWidth : 0;
231
+ this.axis.x.isOverflowing = this.axis.x.isOverflowing && h > l - p, this.axis.y.isOverflowing = this.axis.y.isOverflowing && u > v - n, this.axis.x.scrollbar.size = this.getScrollbarSize("x"), this.axis.y.scrollbar.size = this.getScrollbarSize("y"), this.axis.x.scrollbar.el && (this.axis.x.scrollbar.el.style.width = "".concat(this.axis.x.scrollbar.size, "px")), this.axis.y.scrollbar.el && (this.axis.y.scrollbar.el.style.height = "".concat(this.axis.y.scrollbar.size, "px")), this.positionScrollbar("x"), this.positionScrollbar("y"), this.toggleTrackVisibility("x"), this.toggleTrackVisibility("y");
232
+ }
233
+ }, s.prototype.getScrollbarSize = function(t) {
234
+ var i, e;
235
+ if (t === void 0 && (t = "y"), !this.axis[t].isOverflowing || !this.contentEl)
236
+ return 0;
237
+ var r = this.contentEl[this.axis[t].scrollSizeAttr], l = (e = (i = this.axis[t].track.el) === null || i === void 0 ? void 0 : i[this.axis[t].offsetSizeAttr]) !== null && e !== void 0 ? e : 0, o = l / r, a;
238
+ return a = Math.max(~~(o * l), this.options.scrollbarMinSize), this.options.scrollbarMaxSize && (a = Math.min(a, this.options.scrollbarMaxSize)), a;
239
+ }, s.prototype.positionScrollbar = function(t) {
240
+ var i, e, r;
241
+ t === void 0 && (t = "y");
242
+ var l = this.axis[t].scrollbar;
243
+ if (!(!this.axis[t].isOverflowing || !this.contentWrapperEl || !l.el || !this.elStyles)) {
244
+ var o = this.contentWrapperEl[this.axis[t].scrollSizeAttr], a = ((i = this.axis[t].track.el) === null || i === void 0 ? void 0 : i[this.axis[t].offsetSizeAttr]) || 0, u = parseInt(this.elStyles[this.axis[t].sizeAttr], 10), h = this.contentWrapperEl[this.axis[t].scrollOffsetAttr];
245
+ h = t === "x" && this.isRtl && (!((e = s.getRtlHelpers()) === null || e === void 0) && e.isScrollOriginAtZero) ? -h : h, t === "x" && this.isRtl && (h = !((r = s.getRtlHelpers()) === null || r === void 0) && r.isScrollingToNegative ? h : -h);
246
+ var v = h / (o - u), n = ~~((a - l.size) * v);
247
+ n = t === "x" && this.isRtl ? -n + (a - l.size) : n, l.el.style.transform = t === "x" ? "translate3d(".concat(n, "px, 0, 0)") : "translate3d(0, ".concat(n, "px, 0)");
248
+ }
249
+ }, s.prototype.toggleTrackVisibility = function(t) {
250
+ t === void 0 && (t = "y");
251
+ var i = this.axis[t].track.el, e = this.axis[t].scrollbar.el;
252
+ !i || !e || !this.contentWrapperEl || (this.axis[t].isOverflowing || this.axis[t].forceVisible ? (i.style.visibility = "visible", this.contentWrapperEl.style[this.axis[t].overflowAttr] = "scroll", this.el.classList.add("".concat(this.classNames.scrollable, "-").concat(t))) : (i.style.visibility = "hidden", this.contentWrapperEl.style[this.axis[t].overflowAttr] = "hidden", this.el.classList.remove("".concat(this.classNames.scrollable, "-").concat(t))), this.axis[t].isOverflowing ? e.style.display = "block" : e.style.display = "none");
253
+ }, s.prototype.showScrollbar = function(t) {
254
+ t === void 0 && (t = "y"), this.axis[t].isOverflowing && !this.axis[t].scrollbar.isVisible && (b(this.axis[t].scrollbar.el, this.classNames.visible), this.axis[t].scrollbar.isVisible = !0);
255
+ }, s.prototype.hideScrollbar = function(t) {
256
+ t === void 0 && (t = "y"), !this.isDragging && this.axis[t].isOverflowing && this.axis[t].scrollbar.isVisible && (y(this.axis[t].scrollbar.el, this.classNames.visible), this.axis[t].scrollbar.isVisible = !1);
257
+ }, s.prototype.hideNativeScrollbar = function() {
258
+ this.offsetEl && (this.offsetEl.style[this.isRtl ? "left" : "right"] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? "-".concat(this.scrollbarWidth, "px") : "0px", this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? "-".concat(this.scrollbarWidth, "px") : "0px");
259
+ }, s.prototype.onMouseMoveForAxis = function(t) {
260
+ t === void 0 && (t = "y");
261
+ var i = this.axis[t];
262
+ !i.track.el || !i.scrollbar.el || (i.track.rect = i.track.el.getBoundingClientRect(), i.scrollbar.rect = i.scrollbar.el.getBoundingClientRect(), this.isWithinBounds(i.track.rect) ? (this.showScrollbar(t), b(i.track.el, this.classNames.hover), this.isWithinBounds(i.scrollbar.rect) ? b(i.scrollbar.el, this.classNames.hover) : y(i.scrollbar.el, this.classNames.hover)) : (y(i.track.el, this.classNames.hover), this.options.autoHide && this.hideScrollbar(t)));
263
+ }, s.prototype.onMouseLeaveForAxis = function(t) {
264
+ t === void 0 && (t = "y"), y(this.axis[t].track.el, this.classNames.hover), y(this.axis[t].scrollbar.el, this.classNames.hover), this.options.autoHide && this.hideScrollbar(t);
265
+ }, s.prototype.onDragStart = function(t, i) {
266
+ var e;
267
+ i === void 0 && (i = "y"), this.isDragging = !0;
268
+ var r = C(this.el), l = g(this.el), o = this.axis[i].scrollbar, a = i === "y" ? t.pageY : t.pageX;
269
+ this.axis[i].dragOffset = a - (((e = o.rect) === null || e === void 0 ? void 0 : e[this.axis[i].offsetAttr]) || 0), this.draggedAxis = i, b(this.el, this.classNames.dragging), r.addEventListener("mousemove", this.drag, !0), r.addEventListener("mouseup", this.onEndDrag, !0), this.removePreventClickId === null ? (r.addEventListener("click", this.preventClick, !0), r.addEventListener("dblclick", this.preventClick, !0)) : (l.clearTimeout(this.removePreventClickId), this.removePreventClickId = null);
270
+ }, s.prototype.onTrackClick = function(t, i) {
271
+ var e = this, r, l, o, a;
272
+ i === void 0 && (i = "y");
273
+ var u = this.axis[i];
274
+ if (!(!this.options.clickOnTrack || !u.scrollbar.el || !this.contentWrapperEl)) {
275
+ t.preventDefault();
276
+ var h = g(this.el);
277
+ this.axis[i].scrollbar.rect = u.scrollbar.el.getBoundingClientRect();
278
+ var v = this.axis[i].scrollbar, n = (l = (r = v.rect) === null || r === void 0 ? void 0 : r[this.axis[i].offsetAttr]) !== null && l !== void 0 ? l : 0, p = parseInt((a = (o = this.elStyles) === null || o === void 0 ? void 0 : o[this.axis[i].sizeAttr]) !== null && a !== void 0 ? a : "0px", 10), c = this.contentWrapperEl[this.axis[i].scrollOffsetAttr], W = i === "y" ? this.mouseY - n : this.mouseX - n, E = W < 0 ? -1 : 1, x = E === -1 ? c - p : c + p, S = 40, A = function() {
279
+ e.contentWrapperEl && (E === -1 ? c > x && (c -= S, e.contentWrapperEl[e.axis[i].scrollOffsetAttr] = c, h.requestAnimationFrame(A)) : c < x && (c += S, e.contentWrapperEl[e.axis[i].scrollOffsetAttr] = c, h.requestAnimationFrame(A)));
280
+ };
281
+ A();
282
+ }
283
+ }, s.prototype.getContentElement = function() {
284
+ return this.contentEl;
285
+ }, s.prototype.getScrollElement = function() {
286
+ return this.contentWrapperEl;
287
+ }, s.prototype.removeListeners = function() {
288
+ var t = g(this.el);
289
+ this.el.removeEventListener("mouseenter", this.onMouseEnter), this.el.removeEventListener("pointerdown", this.onPointerEvent, !0), this.el.removeEventListener("mousemove", this.onMouseMove), this.el.removeEventListener("mouseleave", this.onMouseLeave), this.contentWrapperEl && this.contentWrapperEl.removeEventListener("scroll", this.onScroll), t.removeEventListener("resize", this.onWindowResize), this.mutationObserver && this.mutationObserver.disconnect(), this.resizeObserver && this.resizeObserver.disconnect(), this.onMouseMove.cancel(), this.onWindowResize.cancel(), this.onStopScrolling.cancel(), this.onMouseEntered.cancel();
290
+ }, s.prototype.unMount = function() {
291
+ this.removeListeners();
292
+ }, s.prototype.isWithinBounds = function(t) {
293
+ return this.mouseX >= t.left && this.mouseX <= t.left + t.width && this.mouseY >= t.top && this.mouseY <= t.top + t.height;
294
+ }, s.prototype.findChild = function(t, i) {
295
+ var e = t.matches || t.webkitMatchesSelector || t.mozMatchesSelector || t.msMatchesSelector;
296
+ return Array.prototype.filter.call(t.children, function(r) {
297
+ return e.call(r, i);
298
+ })[0];
299
+ }, s.rtlHelpers = null, s.defaultOptions = {
300
+ forceVisible: !1,
301
+ clickOnTrack: !0,
302
+ scrollbarMinSize: 25,
303
+ scrollbarMaxSize: 0,
304
+ ariaLabel: "scrollable content",
305
+ tabIndex: 0,
306
+ classNames: {
307
+ contentEl: "simplebar-content",
308
+ contentWrapper: "simplebar-content-wrapper",
309
+ offset: "simplebar-offset",
310
+ mask: "simplebar-mask",
311
+ wrapper: "simplebar-wrapper",
312
+ placeholder: "simplebar-placeholder",
313
+ scrollbar: "simplebar-scrollbar",
314
+ track: "simplebar-track",
315
+ heightAutoObserverWrapperEl: "simplebar-height-auto-observer-wrapper",
316
+ heightAutoObserverEl: "simplebar-height-auto-observer",
317
+ visible: "simplebar-visible",
318
+ horizontal: "simplebar-horizontal",
319
+ vertical: "simplebar-vertical",
320
+ hover: "simplebar-hover",
321
+ dragging: "simplebar-dragging",
322
+ scrolling: "simplebar-scrolling",
323
+ scrollable: "simplebar-scrollable",
324
+ mouseEntered: "simplebar-mouse-entered"
325
+ },
326
+ scrollableNode: null,
327
+ contentNode: null,
328
+ autoHide: !0
329
+ }, s.getOptions = $, s.helpers = I, s;
330
+ })()
331
+ ), m = function() {
332
+ return m = Object.assign || function(t) {
333
+ for (var i, e = 1, r = arguments.length; e < r; e++) {
334
+ i = arguments[e];
335
+ for (var l in i) Object.prototype.hasOwnProperty.call(i, l) && (t[l] = i[l]);
336
+ }
337
+ return t;
338
+ }, m.apply(this, arguments);
339
+ };
340
+ function Q(s, t) {
341
+ var i = {};
342
+ for (var e in s) Object.prototype.hasOwnProperty.call(s, e) && t.indexOf(e) < 0 && (i[e] = s[e]);
343
+ if (s != null && typeof Object.getOwnPropertySymbols == "function")
344
+ for (var r = 0, e = Object.getOwnPropertySymbols(s); r < e.length; r++)
345
+ t.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(s, e[r]) && (i[e[r]] = s[e[r]]);
346
+ return i;
347
+ }
348
+ var U = f.forwardRef(function(s, t) {
349
+ var i = s.children, e = s.scrollableNodeProps, r = e === void 0 ? {} : e, l = Q(s, ["children", "scrollableNodeProps"]), o = f.useRef(), a = f.useRef(), u = f.useRef(), h = {}, v = {};
350
+ Object.keys(l).forEach(function(c) {
351
+ Object.prototype.hasOwnProperty.call(k.defaultOptions, c) ? h[c] = l[c] : v[c] = l[c];
352
+ });
353
+ var n = m(m({}, k.defaultOptions.classNames), h.classNames), p = m(m({}, r), { className: "".concat(n.contentWrapper).concat(r.className ? " ".concat(r.className) : ""), tabIndex: h.tabIndex || k.defaultOptions.tabIndex, role: "region", "aria-label": h.ariaLabel || k.defaultOptions.ariaLabel });
354
+ return f.useEffect(function() {
355
+ var c;
356
+ return a.current = p.ref ? p.ref.current : a.current, o.current && (c = new k(o.current, m(m(m({}, h), a.current && {
357
+ scrollableNode: a.current
358
+ }), u.current && {
359
+ contentNode: u.current
360
+ })), typeof t == "function" ? t(c) : t && (t.current = c)), function() {
361
+ c?.unMount(), c = null, typeof t == "function" && t(null);
362
+ };
363
+ }, []), f.createElement(
364
+ "div",
365
+ m({ "data-simplebar": "init", ref: o }, v),
366
+ f.createElement(
367
+ "div",
368
+ { className: n.wrapper },
369
+ f.createElement(
370
+ "div",
371
+ { className: n.heightAutoObserverWrapperEl },
372
+ f.createElement("div", { className: n.heightAutoObserverEl })
373
+ ),
374
+ f.createElement(
375
+ "div",
376
+ { className: n.mask },
377
+ f.createElement("div", { className: n.offset }, typeof i == "function" ? i({
378
+ scrollableNodeRef: a,
379
+ scrollableNodeProps: m(m({}, p), { ref: a }),
380
+ contentNodeRef: u,
381
+ contentNodeProps: {
382
+ className: n.contentEl,
383
+ ref: u
384
+ }
385
+ }) : f.createElement(
386
+ "div",
387
+ m({}, p),
388
+ f.createElement("div", { className: n.contentEl }, i)
389
+ ))
390
+ ),
391
+ f.createElement("div", { className: n.placeholder })
392
+ ),
393
+ f.createElement(
394
+ "div",
395
+ { className: "".concat(n.track, " ").concat(n.horizontal) },
396
+ f.createElement("div", { className: n.scrollbar })
397
+ ),
398
+ f.createElement(
399
+ "div",
400
+ { className: "".concat(n.track, " ").concat(n.vertical) },
401
+ f.createElement("div", { className: n.scrollbar })
402
+ )
403
+ );
404
+ });
405
+ U.displayName = "SimpleBar";
406
+ export {
407
+ U as S
408
+ };
@@ -0,0 +1,6 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.module.scss' {
4
+ const classes: { readonly [key: string]: string };
5
+ export default classes;
6
+ }
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "@baishuyun/ui-business",
3
+ "version": "2.0.0",
4
+ "description": "百数云业务组件库",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/components/index.d.ts"
13
+ },
14
+ "./index.css": "./dist/index.css",
15
+ "./DeptsMember": {
16
+ "import": "./dist/DeptsMember/index.js",
17
+ "types": "./dist/components/DeptsMember/index.d.ts"
18
+ },
19
+ "./ConfigProvider": {
20
+ "import": "./dist/ConfigProvider/index.js",
21
+ "types": "./dist/components/ConfigProvider/index.d.ts"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "README.md"
27
+ ],
28
+ "keywords": [
29
+ "react",
30
+ "components",
31
+ "ui",
32
+ "business",
33
+ "typescript"
34
+ ],
35
+ "author": "BSY Team",
36
+ "license": "MIT",
37
+ "peerDependencies": {
38
+ "ahooks": ">=3.7.0",
39
+ "antd": ">=5.1.2",
40
+ "bsy-react-ui": ">=1.34.2",
41
+ "immer": "^10.0.0",
42
+ "motion": "^11.18.2",
43
+ "react": ">=18.3.1",
44
+ "react-dom": ">=18.3.1"
45
+ },
46
+ "devDependencies": {
47
+ "@ant-design/icons": "^6.0.0",
48
+ "@types/lodash-es": "^4.17.12",
49
+ "@types/react": "^18.3.1",
50
+ "@types/react-dom": "^18.3.0",
51
+ "@vitejs/plugin-react": "^5.0.0",
52
+ "ahooks": "^3.9.3",
53
+ "antd": "^5.27.0",
54
+ "bsy-react-ui": "^1.34.2",
55
+ "glob": "^11.0.3",
56
+ "immer": "^10.1.1",
57
+ "motion": "^11.18.2",
58
+ "react": "18.3.1",
59
+ "react-dom": "18.3.1",
60
+ "rimraf": "^6.0.1",
61
+ "sass": "^1.90.0",
62
+ "vite": "^7.0.0",
63
+ "vite-plugin-dts": "^4.5.4"
64
+ },
65
+ "dependencies": {
66
+ "autoprefixer": "^10.4.21",
67
+ "axios": "^1.11.0",
68
+ "clsx": "^2.0.0",
69
+ "lodash-es": "^4.17.21",
70
+ "postcss": "^8.5.6",
71
+ "simplebar-react": "^3.3.2",
72
+ "tailwindcss": "^3.4.0"
73
+ },
74
+ "publishConfig": {
75
+ "access": "public"
76
+ },
77
+ "scripts": {
78
+ "build": "vite build",
79
+ "build:debug": "vite build --mode debug",
80
+ "build:watch": "vite build --watch",
81
+ "dev": "vite build --watch",
82
+ "type-check": "tsc --noEmit",
83
+ "lint": "eslint src --ext .ts,.tsx",
84
+ "lint:fix": "eslint src --ext .ts,.tsx --fix",
85
+ "clean": "rimraf dist"
86
+ }
87
+ }