bj-web-components 0.2.18 → 0.2.20

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.
@@ -1,5 +1,5 @@
1
1
  import { jsxs as P, jsx as f } from "react/jsx-runtime";
2
- import { useRef as ne, useMemo as Q, useState as k, useEffect as X, createElement as Ke, isValidElement as Zt } from "react";
2
+ import { useRef as ne, useMemo as Q, useState as k, useEffect as Y, createElement as Ke, isValidElement as Zt } from "react";
3
3
  import { createPortal as Xt } from "react-dom";
4
4
  import Yt from "../Pagination/Pagination.mjs";
5
5
  import Be from "../Icon/Icon.mjs";
@@ -94,7 +94,7 @@ function pr({
94
94
  emptyText: _e,
95
95
  emptyImage: ye = sr,
96
96
  emptyHeight: yt,
97
- t: Y = (le) => le,
97
+ t: Z = (le) => le,
98
98
  className: jt,
99
99
  style: pt,
100
100
  rowClassName: je,
@@ -110,7 +110,7 @@ function pr({
110
110
  onHeaderRow: ve,
111
111
  id: vt,
112
112
  scroll: b,
113
- locale: Z,
113
+ locale: X,
114
114
  groupCollapse: h
115
115
  }) {
116
116
  var it, st, nt;
@@ -146,9 +146,9 @@ function pr({
146
146
  const r = be(e, t), s = $.includes(r), l = s ? $.filter((i) => i !== r) : [...$, r];
147
147
  (h == null ? void 0 : h.expandedKeys) === void 0 && Ot(l), (c = h == null ? void 0 : h.onExpandedKeysChange) == null || c.call(h, l, e, !s);
148
148
  };
149
- X(() => {
149
+ Y(() => {
150
150
  q !== ge && (a == null ? void 0 : a.current) === void 0 && ce(q);
151
- }, [q, a == null ? void 0 : a.current, ge]), X(() => {
151
+ }, [q, a == null ? void 0 : a.current, ge]), Y(() => {
152
152
  if (!W || S === null) {
153
153
  Ae(null);
154
154
  return;
@@ -160,20 +160,20 @@ function pr({
160
160
  return e(), document.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
161
161
  document.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
162
162
  };
163
- }, [W, S]), X(() => {
163
+ }, [W, S]), Y(() => {
164
164
  if (S === null) return;
165
165
  const e = (t) => {
166
166
  const r = t.target;
167
167
  W != null && W.contains(r) || r.closest(".bj-table__filter-dropdown") || (U(null), Ne(null));
168
168
  };
169
169
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
170
- }, [W, S]), X(() => {
170
+ }, [W, S]), Y(() => {
171
171
  const e = window.setTimeout(
172
172
  () => He(Fe.trim()),
173
173
  or
174
174
  );
175
175
  return () => window.clearTimeout(e);
176
- }, [Fe]), X(() => {
176
+ }, [Fe]), Y(() => {
177
177
  if (S === null) return;
178
178
  const e = C.find((r, s) => E(r, s) === S);
179
179
  if (!e || "children" in e || !e.filterRequest) return;
@@ -211,7 +211,7 @@ function pr({
211
211
  () => H.map(({ record: e, index: t }) => G(e, t, _)),
212
212
  [_, H]
213
213
  ), Mt = K.map(String).join("|"), Tt = Qe.map(String).join("|");
214
- X(() => {
214
+ Y(() => {
215
215
  var l;
216
216
  if (!n || F || K.length === 0) return;
217
217
  const e = new Set(Qe), t = K.filter((c) => e.has(c));
@@ -315,7 +315,7 @@ function pr({
315
315
  rr,
316
316
  {
317
317
  ...e.filterDropdownProps,
318
- emptyText: (Z == null ? void 0 : Z.filterEmptyText) ?? Y("暂无结果"),
318
+ emptyText: (X == null ? void 0 : X.filterEmptyText) ?? Z("暂无结果"),
319
319
  multiple: e.filterMultiple !== !1,
320
320
  onChange: (d, j) => {
321
321
  var O, lt;
@@ -339,8 +339,9 @@ function pr({
339
339
  value: d.value
340
340
  })),
341
341
  searchable: ((T = e.filterDropdownProps) == null ? void 0 : T.searchable) ?? D,
342
- searchPlaceholder: ((se = e.filterDropdownProps) == null ? void 0 : se.searchPlaceholder) ?? (e.filterRequest ? Y("请输入搜索内容") : (Z == null ? void 0 : Z.filterSearchPlaceholder) ?? Y("搜索")),
342
+ searchPlaceholder: ((se = e.filterDropdownProps) == null ? void 0 : se.searchPlaceholder) ?? (e.filterRequest ? Z("请输入搜索内容") : (X == null ? void 0 : X.filterSearchPlaceholder) ?? Z("搜索")),
343
343
  searchValue: Fe,
344
+ t: Z,
344
345
  value: i
345
346
  }
346
347
  )
@@ -419,7 +420,7 @@ function pr({
419
420
  width: b.x === !0 ? "max-content" : b.x,
420
421
  minWidth: "100%",
421
422
  tableLayout: Se ?? "fixed"
422
- } : { tableLayout: Se }, Ht = (g == null ? void 0 : g.table) ?? "table", Ut = ((it = g == null ? void 0 : g.header) == null ? void 0 : it.wrapper) ?? "thead", Wt = ((st = g == null ? void 0 : g.header) == null ? void 0 : st.row) ?? "tr", tt = ((nt = g == null ? void 0 : g.header) == null ? void 0 : nt.cell) ?? "th", V = typeof (g == null ? void 0 : g.body) == "object" ? g.body : void 0, $t = (V == null ? void 0 : V.wrapper) ?? "tbody", rt = (V == null ? void 0 : V.row) ?? "tr", Ee = (V == null ? void 0 : V.cell) ?? "td", Jt = typeof _e == "function" ? _e() : _e ?? Y("暂无数据"), at = typeof ye == "string" ? /* @__PURE__ */ f("img", { alt: "", className: "bj-table__empty-image", src: ye }) : ye;
423
+ } : { tableLayout: Se }, Ht = (g == null ? void 0 : g.table) ?? "table", Ut = ((it = g == null ? void 0 : g.header) == null ? void 0 : it.wrapper) ?? "thead", Wt = ((st = g == null ? void 0 : g.header) == null ? void 0 : st.row) ?? "tr", tt = ((nt = g == null ? void 0 : g.header) == null ? void 0 : nt.cell) ?? "th", V = typeof (g == null ? void 0 : g.body) == "object" ? g.body : void 0, $t = (V == null ? void 0 : V.wrapper) ?? "tbody", rt = (V == null ? void 0 : V.row) ?? "tr", Ee = (V == null ? void 0 : V.cell) ?? "td", Jt = typeof _e == "function" ? _e() : _e ?? Z("暂无数据"), at = typeof ye == "string" ? /* @__PURE__ */ f("img", { alt: "", className: "bj-table__empty-image", src: ye }) : ye;
423
424
  return /* @__PURE__ */ P(
424
425
  "div",
425
426
  {
@@ -629,7 +630,7 @@ function pr({
629
630
  showTotal: a.showTotal,
630
631
  simple: a.simple,
631
632
  size: a.size,
632
- t: a.t ?? Y,
633
+ t: a.t ?? Z,
633
634
  total: We
634
635
  }
635
636
  ) })
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),c=require("react"),M=require("./TabPane.js");;/* empty css */function I(...s){return s.filter(Boolean).join(" ")}function P(s,n){const[t,a]=c.useState(s);return[n===void 0?t:n,a]}function D(s,n){return c.useMemo(()=>s?s.filter(t=>!!(t&&typeof t=="object"&&"key"in t)):c.Children.toArray(n).flatMap(t=>{if(!c.isValidElement(t))return[];const{tab:a,tabKey:b,...y}=t.props,i=b??t.key;return i===null?[]:[{...y,key:String(i),label:a}]}),[n,s])}function E({active:s,id:n,item:t,onClick:a,onKeyDown:b,tabCount:y,tabIndex:i}){return r.jsxs("button",{"aria-controls":`${n}-panel-${t.key}`,"aria-disabled":t.disabled,"aria-selected":s,className:I("bj-tabs__tab",s&&"bj-tabs__tab--active",t.disabled&&"bj-tabs__tab--disabled"),disabled:t.disabled,id:`${n}-tab-${t.key}`,onClick:a,onKeyDown:b,role:"tab",tabIndex:t.disabled?-1:s?0:-1,type:"button",children:[r.jsx("span",{className:"bj-tabs__tab-btn",children:t.label}),r.jsx("span",{className:"bj-tabs__sr-only",children:`Tab ${i+1} of ${y}`})]})}function L({activeKey:s,id:n,items:t}){return r.jsx("div",{className:"bj-tabs__content-holder",children:r.jsx("div",{className:"bj-tabs__content",children:t.map(a=>{const b=a.key===s;return!b&&!a.forceRender?null:r.jsx("div",{"aria-hidden":!b,"aria-labelledby":`${n}-tab-${a.key}`,className:I("bj-tabs__tabpane",b&&"bj-tabs__tabpane--active",a.className),id:`${n}-panel-${a.key}`,role:"tabpanel",style:a.style,tabIndex:b?0:-1,children:a.children},a.key)})})})}function m({activeKey:s,children:n,centered:t,className:a,defaultActiveKey:b,id:y,items:i,onChange:f,onTabClick:_,style:w,tabBarGutter:F,tabBarStyle:S,tabPosition:x="top",type:K="line"}){const l=D(i,n),B=c.useRef(`bj-tabs-${Math.random().toString(36).slice(2,10)}`),p=y??B.current,[o,v]=P(()=>{var e;return b??((e=l[0])==null?void 0:e.key)},s),[$,R]=c.useState(()=>l.findIndex(e=>e.key===o));c.useEffect(()=>{var d;let e=l.findIndex(u=>u.key===o);e===-1&&(e=Math.max(0,Math.min($,l.length-1)),v((d=l[e])==null?void 0:d.key)),R(e)},[$,o,v,l]);const T=(e,d)=>{_==null||_(e,d),e!==o&&(v(e),f==null||f(e))},V=(e,d)=>{var N;const g=x==="left"||x==="right"?e.key==="ArrowDown"?1:e.key==="ArrowUp"?-1:0:e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;if(!g)return;e.preventDefault();const j=l.filter(h=>!h.disabled),q=j.findIndex(h=>{var A;return h.key===((A=l[d])==null?void 0:A.key)}),k=j[(q+g+j.length)%j.length];(N=document.getElementById(`${p}-tab-${k==null?void 0:k.key}`))==null||N.focus()};return r.jsxs("div",{className:I("bj-tabs",`bj-tabs--${x}`,`bj-tabs--${K}`,t&&"bj-tabs--centered",a),style:w,children:[r.jsx("div",{className:"bj-tabs__nav",role:"tablist",style:S,children:r.jsx("div",{className:"bj-tabs__nav-wrap",children:r.jsx("div",{className:"bj-tabs__nav-list",children:l.map((e,d)=>r.jsx(E,{active:e.key===o,id:p,item:e,onClick:u=>T(e.key,u),onKeyDown:u=>V(u,d),tabCount:l.length,tabIndex:d},e.key))})})}),r.jsx(L,{activeKey:o,id:p,items:l})]})}m.TabPane=M;exports.TabPane=M;exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),c=require("react"),M=require("./TabPane.js");;/* empty css */function I(...s){return s.filter(Boolean).join(" ")}function q(s,n){const[t,a]=c.useState(s);return[n===void 0?t:n,a]}function D(s,n){return c.useMemo(()=>s?s.filter(t=>!!(t&&typeof t=="object"&&"key"in t)):c.Children.toArray(n).flatMap(t=>{if(!c.isValidElement(t))return[];const{tab:a,tabKey:b,...y}=t.props,i=b??t.key;return i===null?[]:[{...y,key:String(i),label:a}]}),[n,s])}function E({active:s,id:n,item:t,onClick:a,onKeyDown:b,tabCount:y,tabIndex:i}){return r.jsxs("button",{"aria-controls":`${n}-panel-${t.key}`,"aria-disabled":t.disabled,"aria-selected":s,className:I("bj-tabs__tab",s&&"bj-tabs__tab--active",t.disabled&&"bj-tabs__tab--disabled"),disabled:t.disabled,id:`${n}-tab-${t.key}`,onClick:a,onKeyDown:b,role:"tab",tabIndex:t.disabled?-1:s?0:-1,type:"button",children:[r.jsx("span",{className:"bj-tabs__tab-btn",children:t.label}),r.jsx("span",{className:"bj-tabs__sr-only",children:`Tab ${i+1} of ${y}`})]})}function L({activeKey:s,id:n,items:t}){return r.jsx("div",{className:"bj-tabs__content-holder",children:r.jsx("div",{className:"bj-tabs__content",children:t.map(a=>{const b=a.key===s;return!b&&!a.forceRender?null:r.jsx("div",{"aria-hidden":!b,"aria-labelledby":`${n}-tab-${a.key}`,className:I("bj-tabs__tabpane",b&&"bj-tabs__tabpane--active",a.className),id:`${n}-panel-${a.key}`,role:"tabpanel",style:a.style,tabIndex:b?0:-1,children:a.children},a.key)})})})}function m({activeKey:s,children:n,centered:t,className:a,defaultActiveKey:b,id:y,items:i,onChange:f,onTabClick:_,style:w,tabBarGutter:F,tabBarStyle:S,tabPosition:x="top",type:T="line"}){const l=D(i,n),K=c.useRef(`bj-tabs-${Math.random().toString(36).slice(2,10)}`),p=y??K.current,[o,v]=q(()=>{var e;return b??((e=l[0])==null?void 0:e.key)},s),[$,P]=c.useState(()=>l.findIndex(e=>e.key===o));c.useEffect(()=>{var d;let e=l.findIndex(u=>u.key===o);e===-1&&(e=Math.max(0,Math.min($,l.length-1)),v((d=l[e])==null?void 0:d.key)),P(e)},[$,o,v,l]);const B=(e,d)=>{_==null||_(e,d),e!==o&&(v(e),f==null||f(e))},R=(e,d)=>{var N;const g=x==="left"||x==="right"?e.key==="ArrowDown"?1:e.key==="ArrowUp"?-1:0:e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;if(!g)return;e.preventDefault();const j=l.filter(h=>!h.disabled),V=j.findIndex(h=>{var A;return h.key===((A=l[d])==null?void 0:A.key)}),k=j[(V+g+j.length)%j.length];(N=document.getElementById(`${p}-tab-${k==null?void 0:k.key}`))==null||N.focus()};return r.jsxs("div",{className:I("bj-tabs",`bj-tabs--${x}`,`bj-tabs--${T}`,t&&"bj-tabs--centered",a),style:w,children:[r.jsx("div",{className:"bj-tabs__nav",role:"tablist",style:S,children:r.jsx("div",{className:"bj-tabs__nav-wrap",children:r.jsx("div",{className:"bj-tabs__nav-list",children:l.map((e,d)=>r.jsx(E,{active:e.key===o,id:p,item:e,onClick:u=>B(e.key,u),onKeyDown:u=>R(u,d),tabCount:l.length,tabIndex:d},e.key))})})}),r.jsx(L,{activeKey:o,id:p,items:l})]})}m.TabPane=M.TabPane;exports.TabPane=M.TabPane;exports.default=m;
@@ -1,6 +1,6 @@
1
1
  import { jsxs as g, jsx as b } from "react/jsx-runtime";
2
2
  import { useRef as E, useState as A, useEffect as L, useMemo as T, Children as P, isValidElement as F } from "react";
3
- import G from "./TabPane.mjs";
3
+ import { TabPane as G } from "./TabPane.mjs";
4
4
  /* empty css */
5
5
  function I(...n) {
6
6
  return n.filter(Boolean).join(" ");
@@ -1 +1 @@
1
- "use strict";function a(e){return null}a.displayName="BTabs.TabPane";module.exports=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(a){return null}e.displayName="BTabs.TabPane";exports.TabPane=e;exports.default=e;
@@ -3,5 +3,6 @@ function a(e) {
3
3
  }
4
4
  a.displayName = "BTabs.TabPane";
5
5
  export {
6
+ a as TabPane,
6
7
  a as default
7
8
  };
@@ -1 +1 @@
1
- "use strict";const t=require("react/jsx-runtime"),a=require("react"),q=require("react-dom");;/* empty css */const R=require("./useAutoPlacement.js");function B({placement:v="top",content:p="这里是提示内容,可以包含更多详细信息。",variant:c="default",className:N,style:w,getPopupContainer:o,getAnchorElement:s,color:e,fontColor:r}){const[u,d]=R.useAutoPlacement(v),i=a.useRef(null),[f,S]=a.useState(),x=["tooltip-popup","tooltip-popup--content",`tooltip-popup--${u}`,c!=="default"?`tooltip-popup--${c}`:"",N].filter(Boolean).join(" "),m=["tooltip-arrow",`tooltip-arrow--${u}`,c==="tinted"?"tooltip-arrow--tinted-bg":""].filter(Boolean).join(" "),y={...w,...e?{backgroundColor:e}:{},...r?{color:r}:{}},j=e?{backgroundColor:e,borderColor:e}:void 0,b=r?{color:r}:void 0,h=t.jsxs("div",{ref:d,className:x,style:y,children:[t.jsx("div",{className:m,style:j}),t.jsx("div",{className:"bu-tooltip-content__text",style:b,children:p})]});if(a.useLayoutEffect(()=>{if(!o||!i.current)return;const l=(s==null?void 0:s())??i.current.parentElement;if(!l)return;const n=l.getBoundingClientRect();S({position:"fixed",left:n.left+n.width/2,top:n.top,right:"auto",bottom:"auto",transform:"translate(-50%, calc(-100% - 16px))"})},[s,o]),o&&typeof document<"u"){const l=o();return t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:i,className:"tooltip-portal-anchor"}),f&&q.createPortal(t.jsxs("div",{ref:d,className:x,style:{...y,...f},children:[t.jsx("div",{className:m,style:j}),t.jsx("div",{className:"bu-tooltip-content__text",style:b,children:p})]}),l)]})}return h}module.exports=B;
1
+ "use strict";const t=require("react/jsx-runtime"),y=require("react"),R=require("react-dom"),B=require("antd");;/* empty css */const $=require("./useAutoPlacement.js");function P({children:j,placement:i="top",content:a="这里是提示内容,可以包含更多详细信息。",variant:c="default",className:w,style:h,getPopupContainer:e,getAnchorElement:s,color:o,fontColor:r}){const[v,N]=$.useAutoPlacement(i),n=y.useRef(null),[b,q]=y.useState(),u=["tooltip-popup","tooltip-popup--content",`tooltip-popup--${v}`,c!=="default"?`tooltip-popup--${c}`:"",w].filter(Boolean).join(" "),p=["tooltip-arrow",`tooltip-arrow--${v}`,c==="tinted"?"tooltip-arrow--tinted-bg":""].filter(Boolean).join(" "),d={...h,...o?{backgroundColor:o}:{},...r?{color:r}:{}},f=o?{backgroundColor:o,borderColor:o}:void 0,x=r?{color:r}:void 0,S=t.jsxs("div",{className:`${u} tooltip-popup--antd`,style:d,children:[t.jsx("div",{className:p,style:f}),t.jsx("div",{className:"bu-tooltip-content__text",style:x,children:a})]});if(j)return t.jsx(B.Tooltip,{title:S,placement:i==="auto"?"top":i,arrowPointAtCenter:!0,getPopupContainer:e,overlayClassName:"bu-content-tooltip",children:j});const _=t.jsxs("div",{ref:N,className:u,style:d,children:[t.jsx("div",{className:p,style:f}),t.jsx("div",{className:"bu-tooltip-content__text",style:x,children:a})]});if(y.useLayoutEffect(()=>{if(!e||!n.current)return;const l=(s==null?void 0:s())??n.current.parentElement;if(!l)return;const m=l.getBoundingClientRect();q({position:"fixed",left:m.left+m.width/2,top:m.top,right:"auto",bottom:"auto",transform:"translate(-50%, calc(-100% - 16px))"})},[s,e]),e&&typeof document<"u"){const l=e();return t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:n,className:"tooltip-portal-anchor"}),b&&R.createPortal(t.jsxs("div",{ref:N,className:u,style:{...d,...b},children:[t.jsx("div",{className:p,style:f}),t.jsx("div",{className:"bu-tooltip-content__text",style:x,children:a})]}),l)]})}return _}module.exports=P;
@@ -1,65 +1,83 @@
1
- import { jsxs as c, Fragment as B, jsx as o } from "react/jsx-runtime";
2
- import { useRef as R, useState as _, useLayoutEffect as $ } from "react";
3
- import { createPortal as k } from "react-dom";
1
+ import { jsx as t, jsxs as i, Fragment as R } from "react/jsx-runtime";
2
+ import { useRef as $, useState as k, useLayoutEffect as C } from "react";
3
+ import { createPortal as P } from "react-dom";
4
+ import { Tooltip as T } from "antd";
4
5
  /* empty css */
5
- import { useAutoPlacement as P } from "./useAutoPlacement.mjs";
6
- function z({
7
- placement: N = "top",
8
- content: n = "这里是提示内容,可以包含更多详细信息。",
9
- variant: i = "default",
10
- className: w,
6
+ import { useAutoPlacement as F } from "./useAutoPlacement.mjs";
7
+ function I({
8
+ children: N,
9
+ placement: a = "top",
10
+ content: p = "这里是提示内容,可以包含更多详细信息。",
11
+ variant: n = "default",
12
+ className: h,
11
13
  style: S,
12
- getPopupContainer: e,
13
- getAnchorElement: r,
14
- color: t,
15
- fontColor: l
14
+ getPopupContainer: o,
15
+ getAnchorElement: l,
16
+ color: e,
17
+ fontColor: r
16
18
  }) {
17
- const [u, d] = P(N), p = R(null), [f, h] = _(), m = [
19
+ const [b, x] = F(a), c = $(null), [w, _] = k(), u = [
18
20
  "tooltip-popup",
19
21
  "tooltip-popup--content",
20
- `tooltip-popup--${u}`,
21
- i !== "default" ? `tooltip-popup--${i}` : "",
22
- w
23
- ].filter(Boolean).join(" "), y = [
22
+ `tooltip-popup--${b}`,
23
+ n !== "default" ? `tooltip-popup--${n}` : "",
24
+ h
25
+ ].filter(Boolean).join(" "), d = [
24
26
  "tooltip-arrow",
25
- `tooltip-arrow--${u}`,
26
- i === "tinted" ? "tooltip-arrow--tinted-bg" : ""
27
- ].filter(Boolean).join(" "), b = {
27
+ `tooltip-arrow--${b}`,
28
+ n === "tinted" ? "tooltip-arrow--tinted-bg" : ""
29
+ ].filter(Boolean).join(" "), f = {
28
30
  ...S,
29
- ...t ? { backgroundColor: t } : {},
30
- ...l ? { color: l } : {}
31
- }, v = t ? { backgroundColor: t, borderColor: t } : void 0, x = l ? { color: l } : void 0, j = /* @__PURE__ */ c("div", { ref: d, className: m, style: b, children: [
32
- /* @__PURE__ */ o("div", { className: y, style: v }),
33
- /* @__PURE__ */ o("div", { className: "bu-tooltip-content__text", style: x, children: n })
31
+ ...e ? { backgroundColor: e } : {},
32
+ ...r ? { color: r } : {}
33
+ }, m = e ? { backgroundColor: e, borderColor: e } : void 0, y = r ? { color: r } : void 0, j = /* @__PURE__ */ i("div", { className: `${u} tooltip-popup--antd`, style: f, children: [
34
+ /* @__PURE__ */ t("div", { className: d, style: m }),
35
+ /* @__PURE__ */ t("div", { className: "bu-tooltip-content__text", style: y, children: p })
34
36
  ] });
35
- if ($(() => {
36
- if (!e || !p.current) return;
37
- const s = (r == null ? void 0 : r()) ?? p.current.parentElement;
37
+ if (N)
38
+ return /* @__PURE__ */ t(
39
+ T,
40
+ {
41
+ title: j,
42
+ placement: a === "auto" ? "top" : a,
43
+ arrowPointAtCenter: !0,
44
+ getPopupContainer: o,
45
+ overlayClassName: "bu-content-tooltip",
46
+ children: N
47
+ }
48
+ );
49
+ const B = /* @__PURE__ */ i("div", { ref: x, className: u, style: f, children: [
50
+ /* @__PURE__ */ t("div", { className: d, style: m }),
51
+ /* @__PURE__ */ t("div", { className: "bu-tooltip-content__text", style: y, children: p })
52
+ ] });
53
+ if (C(() => {
54
+ if (!o || !c.current) return;
55
+ const s = (l == null ? void 0 : l()) ?? c.current.parentElement;
38
56
  if (!s) return;
39
- const a = s.getBoundingClientRect();
40
- h({
57
+ const v = s.getBoundingClientRect();
58
+ _({
41
59
  position: "fixed",
42
- left: a.left + a.width / 2,
43
- top: a.top,
60
+ left: v.left + v.width / 2,
61
+ top: v.top,
44
62
  right: "auto",
45
63
  bottom: "auto",
46
64
  transform: "translate(-50%, calc(-100% - 16px))"
47
65
  });
48
- }, [r, e]), e && typeof document < "u") {
49
- const s = e();
50
- return /* @__PURE__ */ c(B, { children: [
51
- /* @__PURE__ */ o("span", { ref: p, className: "tooltip-portal-anchor" }),
52
- f && k(
53
- /* @__PURE__ */ c("div", { ref: d, className: m, style: { ...b, ...f }, children: [
54
- /* @__PURE__ */ o("div", { className: y, style: v }),
55
- /* @__PURE__ */ o("div", { className: "bu-tooltip-content__text", style: x, children: n })
66
+ }, [l, o]), o && typeof document < "u") {
67
+ const s = o();
68
+ return /* @__PURE__ */ i(R, { children: [
69
+ /* @__PURE__ */ t("span", { ref: c, className: "tooltip-portal-anchor" }),
70
+ w && P(
71
+ /* @__PURE__ */ i("div", { ref: x, className: u, style: { ...f, ...w }, children: [
72
+ /* @__PURE__ */ t("div", { className: d, style: m }),
73
+ /* @__PURE__ */ t("div", { className: "bu-tooltip-content__text", style: y, children: p })
56
74
  ] }),
57
75
  s
58
76
  )
59
77
  ] });
60
78
  }
61
- return j;
79
+ return B;
62
80
  }
63
81
  export {
64
- z as default
82
+ I as default
65
83
  };
package/dist/web.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { CSSProperties } from 'react';
2
- import { default as default_2 } from 'react';
3
2
  import { FocusEvent as FocusEvent_2 } from 'react';
4
3
  import { FocusEventHandler } from 'react';
5
4
  import { ForwardRefExoticComponent } from 'react';
6
5
  import { HTMLAttributes } from 'react';
7
6
  import { InputHTMLAttributes } from 'react';
8
- import { JSX } from 'react';
7
+ import { JSX } from 'react/jsx-runtime';
9
8
  import { Key } from 'react';
10
9
  import { KeyboardEvent as KeyboardEvent_2 } from 'react';
11
10
  import { KeyboardEventHandler } from 'react';
@@ -291,7 +290,7 @@ export declare interface BTabsTabPaneProps extends Omit<BTabsItem, 'key' | 'labe
291
290
 
292
291
  export declare type BTabsType = 'line' | 'card';
293
292
 
294
- declare function BTooltip({ placement, content, variant, className, style, getPopupContainer, getAnchorElement, color, fontColor, }: ContentTooltipProps): JSX.Element;
293
+ declare function BTooltip({ children, placement, content, variant, className, style, getPopupContainer, getAnchorElement, color, fontColor, }: ContentTooltipProps): JSX.Element;
295
294
  export { BTooltip }
296
295
  export { BTooltip as ContentTooltip }
297
296
 
@@ -696,6 +695,7 @@ export declare interface ConfirmTooltipProps extends BaseTooltipProps {
696
695
  }
697
696
 
698
697
  declare interface ContentTooltipProps extends BaseTooltipProps {
698
+ children?: React.ReactElement;
699
699
  content?: ReactNode;
700
700
  variant?: TooltipVariant;
701
701
  /** Tooltip background color, including the arrow. */
@@ -868,7 +868,7 @@ export declare interface ProductFieldOption {
868
868
  searchText?: string;
869
869
  }
870
870
 
871
- export declare function ProgressTooltip({ placement, title, progress, className, style, }: ProgressTooltipProps): default_2.JSX.Element;
871
+ export declare function ProgressTooltip({ placement, title, progress, className, style, }: ProgressTooltipProps): JSX.Element;
872
872
 
873
873
  export declare interface ProgressTooltipProps extends BaseTooltipProps {
874
874
  title?: string;
package/dist/web.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./web/Icon/Icon.js"),e=require("./web/Tooltip/ConfirmTooltip.js"),t=require("./web/Tooltip/ProgressTooltip.js"),r=require("./web/Tooltip/ContentTooltip.js"),n=require("./web/Tooltip/TooltipWrapper.js"),u=require("./web/SkuInputCard/SkuInputCard.js"),i=require("./web/Input/Input.js"),c=require("./web/BasicInput/BInput.js"),p=require("./web/Tabs/BTabs.js"),l=require("./web/Tabs/TabPane.js"),s=require("./web/EmptyInputBox/EmptyInputBox.js"),a=require("./web/Modal/Modal.js"),B=require("./web/ProductField/ProductField.js"),q=require("./web/CategoryDropdown/CategoryDropdown.js"),d=require("./web/Pagination/Pagination.js"),T=require("./web/FileCard/FileCard.js"),C=require("./web/Switch/Switch.js"),b=require("./web/InputNumber/BInputNumber.js"),I=require("./web/Table/BTable.js"),m=require("./web/Table/Column.js"),P=require("./web/Table/ColumnGroup.js"),g=require("./web/CheckBox/index.js"),y=require("./web/OverlayScrollbar/BOverlayScrollbar.js"),S=require("./web/Dropdown/BDropdown.js");exports.BuIcon=o;exports.ConfirmTooltip=e;exports.ProgressTooltip=t;exports.BTooltip=r;exports.ContentTooltip=r;exports.TooltipWrapper=n;exports.SkuInputCard=u;exports.BuInput=i;exports.BInput=c;exports.BTabs=p.default;exports.TabPane=l;exports.BuEmptyInputBox=s;exports.BuModal=a;exports.BuProductField=B;exports.BuCategoryDropdown=q;exports.Pagination=d;exports.FileCard=T;exports.BuSwitch=C;exports.BInputNumber=b;exports.BTable=I.BTable;exports.Column=m;exports.ColumnGroup=P;exports.BCheckBox=g.BCheckBox;exports.BOverlayScrollbar=y;exports.BDropdown=S.BDropdown;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./web/Icon/Icon.js"),e=require("./web/Tooltip/ConfirmTooltip.js"),t=require("./web/Tooltip/ProgressTooltip.js"),r=require("./web/Tooltip/ContentTooltip.js"),n=require("./web/Tooltip/TooltipWrapper.js"),u=require("./web/SkuInputCard/SkuInputCard.js"),i=require("./web/Input/Input.js"),c=require("./web/BasicInput/BInput.js"),p=require("./web/Tabs/BTabs.js"),a=require("./web/Tabs/TabPane.js"),l=require("./web/EmptyInputBox/EmptyInputBox.js"),s=require("./web/Modal/Modal.js"),B=require("./web/ProductField/ProductField.js"),q=require("./web/CategoryDropdown/CategoryDropdown.js"),d=require("./web/Pagination/Pagination.js"),T=require("./web/FileCard/FileCard.js"),C=require("./web/Switch/Switch.js"),b=require("./web/InputNumber/BInputNumber.js"),I=require("./web/Table/BTable.js"),m=require("./web/Table/Column.js"),P=require("./web/Table/ColumnGroup.js"),g=require("./web/CheckBox/index.js"),y=require("./web/OverlayScrollbar/BOverlayScrollbar.js"),S=require("./web/Dropdown/BDropdown.js");exports.BuIcon=o;exports.ConfirmTooltip=e;exports.ProgressTooltip=t;exports.BTooltip=r;exports.ContentTooltip=r;exports.TooltipWrapper=n;exports.SkuInputCard=u;exports.BuInput=i;exports.BInput=c;exports.BTabs=p.default;exports.TabPane=a.TabPane;exports.BuEmptyInputBox=l;exports.BuModal=s;exports.BuProductField=B;exports.BuCategoryDropdown=q;exports.Pagination=d;exports.FileCard=T;exports.BuSwitch=C;exports.BInputNumber=b;exports.BTable=I.BTable;exports.Column=m;exports.ColumnGroup=P;exports.BCheckBox=g.BCheckBox;exports.BOverlayScrollbar=y;exports.BDropdown=S.BDropdown;
package/dist/web.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import { default as t } from "./web/Icon/Icon.mjs";
2
- import { default as e } from "./web/Tooltip/ConfirmTooltip.mjs";
2
+ import { default as a } from "./web/Tooltip/ConfirmTooltip.mjs";
3
3
  import { default as p } from "./web/Tooltip/ProgressTooltip.mjs";
4
- import { default as l, default as d } from "./web/Tooltip/ContentTooltip.mjs";
4
+ import { default as l, default as m } from "./web/Tooltip/ContentTooltip.mjs";
5
5
  import { default as x } from "./web/Tooltip/TooltipWrapper.mjs";
6
6
  import { default as B } from "./web/SkuInputCard/SkuInputCard.mjs";
7
7
  import { default as i } from "./web/Input/Input.mjs";
8
8
  import { default as T } from "./web/BasicInput/BInput.mjs";
9
9
  import { default as b } from "./web/Tabs/BTabs.mjs";
10
- import { default as P } from "./web/Tabs/TabPane.mjs";
10
+ import { TabPane as P } from "./web/Tabs/TabPane.mjs";
11
11
  import { default as w } from "./web/EmptyInputBox/EmptyInputBox.mjs";
12
12
  import { default as S } from "./web/Modal/Modal.mjs";
13
13
  import { default as k } from "./web/ProductField/ProductField.mjs";
@@ -40,8 +40,8 @@ export {
40
40
  O as BuSwitch,
41
41
  H as Column,
42
42
  K as ColumnGroup,
43
- e as ConfirmTooltip,
44
- d as ContentTooltip,
43
+ a as ConfirmTooltip,
44
+ m as ContentTooltip,
45
45
  M as FileCard,
46
46
  E as Pagination,
47
47
  p as ProgressTooltip,
package/package.json CHANGED
@@ -1,92 +1,93 @@
1
- {
2
- "name": "bj-web-components",
3
- "version": "0.2.18",
4
- "description": "Enterprise UI component library for Web, Mobile, and Mini-app platforms",
5
- "keywords": [
6
- "react",
7
- "ui",
8
- "component",
9
- "design-system",
10
- "web",
11
- "mobile",
12
- "miniapp"
13
- ],
14
- "author": "hkm-hfrl",
15
- "license": "MIT",
16
- "repository": {
17
- "type": "git",
18
- "url": ""
19
- },
20
- "private": false,
21
- "main": "./dist/index.js",
22
- "module": "./dist/index.mjs",
23
- "types": "./dist/index.d.ts",
24
- "exports": {
25
- ".": {
26
- "types": "./dist/index.d.ts",
27
- "import": "./dist/index.mjs",
28
- "require": "./dist/index.js"
29
- },
30
- "./react": {
31
- "types": "./dist/react.d.ts",
32
- "import": "./dist/react.mjs",
33
- "require": "./dist/react.js"
34
- },
35
- "./web": {
36
- "types": "./dist/web.d.ts",
37
- "import": "./dist/web.mjs",
38
- "require": "./dist/web.js"
39
- },
40
- "./mobile": {
41
- "types": "./dist/mobile.d.ts",
42
- "import": "./dist/mobile.mjs",
43
- "require": "./dist/mobile.js"
44
- },
45
- "./miniapp": {
46
- "types": "./dist/miniapp.d.ts",
47
- "import": "./dist/miniapp.mjs",
48
- "require": "./dist/miniapp.js"
49
- },
50
- "./shared": {
51
- "types": "./dist/shared.d.ts",
52
- "import": "./dist/shared.mjs",
53
- "require": "./dist/shared.js"
54
- },
55
- "./style": "./dist/style.css"
56
- },
57
- "files": [
58
- "dist"
59
- ],
60
- "scripts": {
61
- "dev": "vite",
62
- "build": "vite build --mode lib --minify false",
63
- "build:dev": "vite build --mode lib --watch --minify false",
64
- "build:docs": "vite build",
65
- "preview": "vite preview",
66
- "lint": "eslint",
67
- "build:lib": "vite build --mode lib",
68
- "build:lib:watch": "vite build --mode lib --watch"
69
- },
70
- "peerDependencies": {
71
- "react": ">=17.0.2",
72
- "react-dom": ">=17.0.2"
73
- },
74
- "devDependencies": {
75
- "@tailwindcss/postcss": "^4",
76
- "@types/node": "^20",
77
- "@types/react": "^19",
78
- "@types/react-dom": "^19",
79
- "@vitejs/plugin-react": "^4.3.4",
80
- "antd": "^6.3.3",
81
- "eslint": "^9",
82
- "less": "^4.6.4",
83
- "lucide-react": "^0.577.0",
84
- "react": "19.2.3",
85
- "react-dom": "19.2.3",
86
- "react-router-dom": "^6.30.3",
87
- "tailwindcss": "^4",
88
- "typescript": "^5",
89
- "vite": "^6.0.7",
90
- "vite-plugin-dts": "^4.3.0"
91
- }
92
- }
1
+ {
2
+ "name": "bj-web-components",
3
+ "version": "0.2.20",
4
+ "description": "Enterprise UI component library for Web, Mobile, and Mini-app platforms",
5
+ "keywords": [
6
+ "react",
7
+ "ui",
8
+ "component",
9
+ "design-system",
10
+ "web",
11
+ "mobile",
12
+ "miniapp"
13
+ ],
14
+ "author": "hkm-hfrl",
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": ""
19
+ },
20
+ "private": false,
21
+ "main": "./dist/index.js",
22
+ "module": "./dist/index.mjs",
23
+ "types": "./dist/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.mjs",
28
+ "require": "./dist/index.js"
29
+ },
30
+ "./react": {
31
+ "types": "./dist/react.d.ts",
32
+ "import": "./dist/react.mjs",
33
+ "require": "./dist/react.js"
34
+ },
35
+ "./web": {
36
+ "types": "./dist/web.d.ts",
37
+ "import": "./dist/web.mjs",
38
+ "require": "./dist/web.js"
39
+ },
40
+ "./mobile": {
41
+ "types": "./dist/mobile.d.ts",
42
+ "import": "./dist/mobile.mjs",
43
+ "require": "./dist/mobile.js"
44
+ },
45
+ "./miniapp": {
46
+ "types": "./dist/miniapp.d.ts",
47
+ "import": "./dist/miniapp.mjs",
48
+ "require": "./dist/miniapp.js"
49
+ },
50
+ "./shared": {
51
+ "types": "./dist/shared.d.ts",
52
+ "import": "./dist/shared.mjs",
53
+ "require": "./dist/shared.js"
54
+ },
55
+ "./style": "./dist/style.css"
56
+ },
57
+ "files": [
58
+ "dist"
59
+ ],
60
+ "scripts": {
61
+ "dev": "vite",
62
+ "build": "vite build --mode lib --minify false",
63
+ "build:dev": "vite build --mode lib --watch --minify false",
64
+ "build:docs": "vite build",
65
+ "preview": "vite preview",
66
+ "lint": "eslint",
67
+ "build:lib": "vite build --mode lib",
68
+ "build:lib:watch": "vite build --mode lib --watch"
69
+ },
70
+ "peerDependencies": {
71
+ "antd": ">=4.19.3 <5",
72
+ "react": ">=17.0.2",
73
+ "react-dom": ">=17.0.2"
74
+ },
75
+ "devDependencies": {
76
+ "@tailwindcss/postcss": "^4",
77
+ "@types/node": "^20",
78
+ "@types/react": "^19",
79
+ "@types/react-dom": "^19",
80
+ "@vitejs/plugin-react": "^4.3.4",
81
+ "antd": "^6.3.3",
82
+ "eslint": "^9",
83
+ "less": "^4.6.4",
84
+ "lucide-react": "^0.577.0",
85
+ "react": "19.2.3",
86
+ "react-dom": "19.2.3",
87
+ "react-router-dom": "^6.30.3",
88
+ "tailwindcss": "^4",
89
+ "typescript": "^5",
90
+ "vite": "^6.0.7",
91
+ "vite-plugin-dts": "^4.3.0"
92
+ }
93
+ }