dga-ui-react 1.8.17 → 1.8.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +3 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +3 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -3244,11 +3244,11 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import o,{useDeb
|
|
|
3244
3244
|
@media screen and (max-width: 640px) {
|
|
3245
3245
|
width: calc(100% - 32px);
|
|
3246
3246
|
}
|
|
3247
|
-
`;const Ti=i=>{var{title:n,content:a,jsxContents:l,children:s,beakPlacement:d="top",beakAlignment:c="center",noBeak:p,inverted:u,backgroundColor:g,icon:h=!1}=i,A=v(i,["title","content","jsxContents","children","beakPlacement","beakAlignment","noBeak","inverted","backgroundColor","icon"]);const f=b(),[x,y]=o.useState(!1),[w,C]=o.useState(!1),$=o.useRef(null),k=o.useRef(null),[S,B]=o.useState({top:0,left:0,caret:{top:0,left:0,color:""}}),E=x||w;let N=u?f.palette.neutral[800]:"#fff";g&&(N=g);const I={toBottom:`${N} transparent transparent transparent`,toTop:`transparent transparent ${N} transparent`,toLeft:`transparent ${N} transparent transparent`,toRight:`transparent transparent transparent ${N}`},z=()=>{if($.current&&k.current){let e=0,t=0,r={top:0,left:0,color:""};const o=$.current.getBoundingClientRect(),i=o.top+window.scrollY,n=o.left+window.scrollX,a=$.current.clientWidth,l=$.current.clientHeight,s=i,p=n,u=k.current.clientWidth,g=k.current.clientHeight;"top"===d&&"start"===c&&(e=s-g-6,t=p,r={top:s-6,left:p+6,color:I.toBottom}),"top"===d&&"center"===c&&(e=s-g-6,t=p-u/2,r={top:s-6,left:p,color:I.toBottom}),"top"===d&&"end"===c&&(e=s-g-6,t=p+18-u,r={top:s-6,left:p,color:I.toBottom}),"bottom"===d&&"start"===c&&(e=s+l+6,t=p,r={top:s+l-6,left:p+6,color:I.toTop}),"bottom"===d&&"center"===c&&(e=s+l+6,t=p-u/2,r={top:s+l-6,left:p,color:I.toTop}),"bottom"===d&&"end"===c&&(e=s+l+6,t=p+24-u,r={top:s+l-6,left:p+6,color:I.toTop}),"left"===d&&"start"===c&&(e=s,t=p-u-6,r={top:s+6,left:p-6,color:I.toRight}),"left"===d&&"center"===c&&(e=s+9-g/2,t=p-u-6,r={top:s+6,left:p-6,color:I.toRight}),"left"===d&&"end"===c&&(e=s-g+24,t=p-u-6,r={top:s+6,left:p-6,color:I.toRight}),"right"===d&&"start"===c&&(e=s,t=p+a+6,r={top:s+6,left:p+a-6,color:I.toLeft}),"right"===d&&"center"===c&&(e=s-g/2+12,t=p+a+6,r={top:s+6,left:p+a-6,color:I.toLeft}),"right"===d&&"end"===c&&(e=s-g+24,t=p+a+6,r={top:s+6,left:p+a-6,color:I.toLeft}),B({top:e,left:t,caret:r})}};return o.useEffect((()=>{if($.current){z();const e=()=>{z()},t=e=>{var t;(null===(t=$.current)||void 0===t?void 0:t.contains(e.target))||(y(!1),C(!1))},r=e=>{z(),y(!0)},o=()=>{y(!1)};return window.addEventListener("click",t),window.addEventListener("resize",e),$.current.addEventListener("mouseover",r),$.current.addEventListener("mouseleave",o),$.current.addEventListener("click",r),()=>{var i,n,a;window.removeEventListener("resize",e),window.removeEventListener("click",t),null===(i=null==$?void 0:$.current)||void 0===i||i.removeEventListener("mouseover",r),null===(n=null==$?void 0:$.current)||void 0===n||n.removeEventListener("mouseleave",o),null===(a=null==$?void 0:$.current)||void 0===a||a.removeEventListener("click",r)}}}),[$,k,d,c]),t(Oi,Object.assign({className:m("dgaui dgaui_tooltip",A.className),$theme:f,$inverted:u},A,{ref:$,onClick:()=>{C(!0)},$position:S,children:[s,t(Qi,{ref:k,$theme:f,$position:S,$inverted:u,$backgroundColor:g,className:"dgaui_tooltipContent"+(E?" show-tooltip":""),children:[l&&l,!l&&t(r,{children:[h&&e("div",{className:"dgaui_tooltipContentIcon",children:e("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHaSURBVHgBjVQ9SMNAFP4SOxR0cHAQFJv6Ax3rIAqK1CIqiFh0UFC04uAgojiog2JxchJdBEGFujmZxcFBzVgQtIKCqGA2fwYpmEqp0PjuMDWkSdoPrne59/L1fXffiwAXtIUiEk1swAskFUVOOeUK1o1QKFKZETFPy6hBYoJKb8QS53LclaglFAmWiTixIUABYQ5dCUVWC4iYDF3EDW1UogToQCpHZFeKnGTPZUagtj7ASKrNyU0NfnSHO+Crq4GmfUNLp81SvKKAvkZfIK6qDxkPryYciVrl9PeGsbo0l39+ffvA7OIaXt8/zGkSnecCzTHxb2PdWvr0xAienl/QMziOobEZVFSUY3V5DjaYZD+eIN0SbA734OgY17d3+NLSfNzQmkm1gcTOVyR/BO2ip2cXXA7DyPAAOttbObEDJA+K4GhvC02Nflwn77Cze+iYx4hUN6J9kqiRNJdquOu5j+jWXlDchPbQoSYuZb9xa3GnvM2NFX6DLkQxNnFDVvkCSdI4Si4rcHU2+4P7h0d8fqbsq1HkKbbMtwjrM3LqpSCU2CI6UoKOZqPfDGlgPcMC7F+Ks0DN6Q5NawYZLEqRdRqSJcRejHtz2LZ+m2yJDPBv079hVXMFVvwCXOukAPYYzukAAAAASUVORK5CYII="})}),t("div",{className:"dgaui_tooltipContentText",children:[e("div",{className:"dgaui_tooltipTitle",children:n}),e("div",{className:"dgaui_tooltipDescription",children:a})]})]})]}),!p&&e("span",{className:E?"show":""})]}))},Oi=sr.div`
|
|
3247
|
+
`;const Ti=i=>{var{title:n,content:a,jsxContents:l,children:s,beakPlacement:d="top",beakAlignment:c="center",noBeak:p,inverted:u,backgroundColor:g,icon:h=!1}=i,A=v(i,["title","content","jsxContents","children","beakPlacement","beakAlignment","noBeak","inverted","backgroundColor","icon"]);const f=b(),[x,y]=o.useState(!1),[w,C]=o.useState(!1),$=o.useRef(null),k=o.useRef(null),[S,B]=o.useState({top:0,left:0,caret:{top:0,left:0,color:""}}),E=x||w;let N=u?f.palette.neutral[800]:"#fff";g&&(N=g);const I={toBottom:`${N} transparent transparent transparent`,toTop:`transparent transparent ${N} transparent`,toLeft:`transparent ${N} transparent transparent`,toRight:`transparent transparent transparent ${N}`},z=()=>{if($.current&&k.current){let e=0,t=0,r={top:0,left:0,color:""};const o=$.current.getBoundingClientRect(),i=o.top+window.scrollY,n=o.left+window.scrollX,a=$.current.clientWidth,l=$.current.clientHeight,s=i,p=n,u=k.current.clientWidth,g=k.current.clientHeight;"top"===d&&"start"===c&&(e=s-g-6,t=p,r={top:s-6,left:p+6,color:I.toBottom}),"top"===d&&"center"===c&&(e=s-g-6,t=p-u/2,r={top:s-6,left:p,color:I.toBottom}),"top"===d&&"end"===c&&(e=s-g-6,t=p+18-u,r={top:s-6,left:p,color:I.toBottom}),"bottom"===d&&"start"===c&&(e=s+l+6,t=p,r={top:s+l-6,left:p+6,color:I.toTop}),"bottom"===d&&"center"===c&&(e=s+l+6,t=p-u/2,r={top:s+l-6,left:p,color:I.toTop}),"bottom"===d&&"end"===c&&(e=s+l+6,t=p+24-u,r={top:s+l-6,left:p+6,color:I.toTop}),"left"===d&&"start"===c&&(e=s,t=p-u-6,r={top:s+6,left:p-6,color:I.toRight}),"left"===d&&"center"===c&&(e=s+9-g/2,t=p-u-6,r={top:s+6,left:p-6,color:I.toRight}),"left"===d&&"end"===c&&(e=s-g+24,t=p-u-6,r={top:s+6,left:p-6,color:I.toRight}),"right"===d&&"start"===c&&(e=s,t=p+a+6,r={top:s+6,left:p+a-6,color:I.toLeft}),"right"===d&&"center"===c&&(e=s-g/2+12,t=p+a+6,r={top:s+6,left:p+a-6,color:I.toLeft}),"right"===d&&"end"===c&&(e=s-g+24,t=p+a+6,r={top:s+6,left:p+a-6,color:I.toLeft}),B({top:e,left:t,caret:r})}};return o.useEffect((()=>{if($.current){z();const e=()=>{z()},t=e=>{var t;(null===(t=$.current)||void 0===t?void 0:t.contains(e.target))||(y(!1),C(!1))},r=e=>{z(),y(!0)},o=()=>{y(!1)};return window.addEventListener("click",t),window.addEventListener("resize",e),$.current.addEventListener("mouseover",r),$.current.addEventListener("mouseleave",o),$.current.addEventListener("click",r),()=>{var i,n,a;window.removeEventListener("resize",e),window.removeEventListener("click",t),null===(i=null==$?void 0:$.current)||void 0===i||i.removeEventListener("mouseover",r),null===(n=null==$?void 0:$.current)||void 0===n||n.removeEventListener("mouseleave",o),null===(a=null==$?void 0:$.current)||void 0===a||a.removeEventListener("click",r)}}}),[$,k,d,c]),t(Oi,Object.assign({className:m("dgaui dgaui_tooltip",A.className),$theme:f,$inverted:u},A,{ref:$,onClick:()=>{C(!0)},$position:S,children:[s,t(Qi,{ref:k,$theme:f,$position:S,$inverted:u,$backgroundColor:g,className:"dgaui_tooltipContent"+(E?" show-tooltip":""),children:[l&&l,!l&&t(r,{children:[h&&e("div",{className:"dgaui_tooltipContentIcon",children:e("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHaSURBVHgBjVQ9SMNAFP4SOxR0cHAQFJv6Ax3rIAqK1CIqiFh0UFC04uAgojiog2JxchJdBEGFujmZxcFBzVgQtIKCqGA2fwYpmEqp0PjuMDWkSdoPrne59/L1fXffiwAXtIUiEk1swAskFUVOOeUK1o1QKFKZETFPy6hBYoJKb8QS53LclaglFAmWiTixIUABYQ5dCUVWC4iYDF3EDW1UogToQCpHZFeKnGTPZUagtj7ASKrNyU0NfnSHO+Crq4GmfUNLp81SvKKAvkZfIK6qDxkPryYciVrl9PeGsbo0l39+ffvA7OIaXt8/zGkSnecCzTHxb2PdWvr0xAienl/QMziOobEZVFSUY3V5DjaYZD+eIN0SbA734OgY17d3+NLSfNzQmkm1gcTOVyR/BO2ip2cXXA7DyPAAOttbObEDJA+K4GhvC02Nflwn77Cze+iYx4hUN6J9kqiRNJdquOu5j+jWXlDchPbQoSYuZb9xa3GnvM2NFX6DLkQxNnFDVvkCSdI4Si4rcHU2+4P7h0d8fqbsq1HkKbbMtwjrM3LqpSCU2CI6UoKOZqPfDGlgPcMC7F+Ks0DN6Q5NawYZLEqRdRqSJcRejHtz2LZ+m2yJDPBv079hVXMFVvwCXOukAPYYzukAAAAASUVORK5CYII="})}),t("div",{className:"dgaui_tooltipContentText",children:[e("div",{className:"dgaui_tooltipTitle",children:n}),e("div",{className:"dgaui_tooltipDescription",children:a})]})]})]}),!p&&e("span",{className:"caret"+(E?" show":"")})]}))},Oi=sr.div`
|
|
3248
3248
|
direction: ${e=>e.$theme.direction};
|
|
3249
3249
|
display: inline-block;
|
|
3250
3250
|
|
|
3251
|
-
|
|
3251
|
+
.caret {
|
|
3252
3252
|
position: absolute;
|
|
3253
3253
|
display: none;
|
|
3254
3254
|
z-index: 1;
|
|
@@ -3269,7 +3269,6 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import o,{useDeb
|
|
|
3269
3269
|
left: ${e=>e.$position.left}px;
|
|
3270
3270
|
z-index: 1;
|
|
3271
3271
|
background-color: ${e=>e.$backgroundColor?e.$backgroundColor:e.$inverted?e.$theme.palette.neutral[800]:"#fff"};
|
|
3272
|
-
width: 240px;
|
|
3273
3272
|
opacity: 0;
|
|
3274
3273
|
display: flex;
|
|
3275
3274
|
visibility: hidden;
|
|
@@ -3433,7 +3432,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import o,{useDeb
|
|
|
3433
3432
|
}
|
|
3434
3433
|
}
|
|
3435
3434
|
`,ji=sr.div`
|
|
3436
|
-
margin: 8px
|
|
3435
|
+
margin: 8px 0;
|
|
3437
3436
|
height: 1px;
|
|
3438
3437
|
background-color: #d2d6db;
|
|
3439
3438
|
width: 100%;
|