@nice2dev/ui 1.2.2 → 1.3.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.
- package/CHANGELOG.md +433 -0
- package/dist/NiceButton-CnAIqCbd.js +101 -0
- package/dist/NiceButton-DzCqkG5a.cjs +1 -0
- package/dist/NiceCodeEditor-CK6B54mu.js +1215 -0
- package/dist/NiceCodeEditor-bJReZPDO.cjs +268 -0
- package/dist/NiceColorPicker-BV3olE3M.cjs +1 -0
- package/dist/NiceColorPicker-CyY-4q89.js +552 -0
- package/dist/NiceDataGrid-BQIqitMM.cjs +10 -0
- package/dist/NiceDataGrid-C1eI6Pso.js +2267 -0
- package/dist/NiceForm-CfAPcXdX.cjs +1 -0
- package/dist/NiceForm-DfKYNQti.js +5017 -0
- package/dist/NiceGantt-TEXbAELi.js +333 -0
- package/dist/NiceGantt-s2cgt5zD.cjs +1 -0
- package/dist/NiceHtmlEditor-CDZeF_zG.cjs +10 -0
- package/dist/NiceHtmlEditor-CdWgddg3.js +901 -0
- package/dist/NiceLoginForm-DRPldHXa.js +808 -0
- package/dist/NiceLoginForm-IGLUCQUE.cjs +1 -0
- package/dist/NiceMention-CgDp0sl9.cjs +430 -0
- package/dist/NiceMention-DBvFvx71.js +11653 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-BlYhFDhP.js +80 -0
- package/dist/NiceModal-DmWz2PDM.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-D8EoXqBy.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-SN6G7t64.js +7189 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-BJS65foT.js +200 -0
- package/dist/NicePagination-D_3GfWp5.cjs +1 -0
- package/dist/NicePivotGrid-D_kRF1Dt.js +1180 -0
- package/dist/NicePivotGrid-DqluEkCI.cjs +152 -0
- package/dist/NiceSavedQueryPanel-C2Tn1cMW.js +5311 -0
- package/dist/NiceSavedQueryPanel-DDKtL1AA.cjs +586 -0
- package/dist/NiceScheduler-GJLvkXJ3.cjs +5 -0
- package/dist/NiceScheduler-UT49u2Vq.js +1710 -0
- package/dist/NiceSelect-CdUHd8rj.cjs +1 -0
- package/dist/NiceSelect-fOelG_QB.js +495 -0
- package/dist/NiceWindow-CqSsTjrS.cjs +1 -0
- package/dist/NiceWindow-DZLPhXbR.js +2223 -0
- package/dist/charts-BYQwl_GS.js +4789 -0
- package/dist/charts-C6iOu0H6.cjs +768 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-lazy-B_laOXNf.cjs +1 -0
- package/dist/core-lazy-VQEjdz0L.js +351 -0
- package/dist/data-branching-7rpktFJ-.cjs +1 -0
- package/dist/data-branching-BS0aFUMu.js +6428 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +3 -3
- package/dist/devops-CFytAJQr.cjs +18 -0
- package/dist/devops-CW8YY_zA.js +9122 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.css +1 -0
- package/dist/devops.mjs +5 -5
- package/dist/editors.cjs +1 -1
- package/dist/editors.mjs +8 -8
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +21 -16
- package/dist/feedback.mjs +3 -3
- package/dist/index.cjs +262 -257
- package/dist/index.css +1 -1
- package/dist/index.d.ts +374 -20
- package/dist/index.mjs +21602 -20317
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +31 -0
- package/dist/navigation.mjs +404 -354
- package/dist/no-code-BaAI_sJR.js +8318 -0
- package/dist/no-code-oQTeAtnW.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +5 -0
- package/dist/overlays.mjs +1 -1
- package/dist/pickerCommons-BQi6IEAt.js +661 -0
- package/dist/pickerCommons-DvQptSPX.cjs +1 -0
- package/dist/style.css +7 -4
- package/package.json +4 -3
package/dist/charts.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./charts-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./charts-C6iOu0H6.cjs");exports.CHART_COLORS=e.CHART_COLORS;exports.NiceBarGauge=e.NiceBarGauge;exports.NiceBullet=e.NiceBullet;exports.NiceChart=e.NiceChart;exports.NiceChartAI=e.NiceChartAI;exports.NiceCircularGauge=e.NiceCircularGauge;exports.NiceForecastChart=e.NiceForecastChart;exports.NiceFunnel=e.NiceFunnel;exports.NiceHeatMap=e.NiceHeatMap;exports.NiceLinearGauge=e.NiceLinearGauge;exports.NiceLiveChart=e.NiceLiveChart;exports.NiceOrganizationChart=e.NiceOrganizationChart;exports.NicePieChart=e.NicePieChart;exports.NicePolarChart=e.NicePolarChart;exports.NiceRangeSelector=e.NiceRangeSelector;exports.NiceSankey=e.NiceSankey;exports.NiceSparkline=e.NiceSparkline;exports.NiceStockChart=e.NiceStockChart;exports.NiceTreeMap=e.NiceTreeMap;exports.NiceVectorMap=e.NiceVectorMap;
|
package/dist/charts.d.ts
CHANGED
|
@@ -730,7 +730,7 @@ export declare interface NicePieChartProps extends NiceStandardProps {
|
|
|
730
730
|
width?: number;
|
|
731
731
|
/** Chart height in px. */
|
|
732
732
|
height?: number;
|
|
733
|
-
/**
|
|
733
|
+
/** Radius of the hole in px: 0 (default) draws a full pie, more than 0 a donut. */
|
|
734
734
|
innerRadius?: number;
|
|
735
735
|
/** Chart title. */
|
|
736
736
|
title?: string;
|
package/dist/charts.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as i, j as c, h as r, o as s, p as N, l as t, r as C, g as h, e as n, k as o, s as l, b as g, n as p, m as u, a as S, f as k, i as G, c as L, d as M, N as O } from "./charts-
|
|
1
|
+
import { C as i, j as c, h as r, o as s, p as N, l as t, r as C, g as h, e as n, k as o, s as l, b as g, n as p, m as u, a as S, f as k, i as G, c as L, d as M, N as O } from "./charts-BYQwl_GS.js";
|
|
2
2
|
export {
|
|
3
3
|
i as CHART_COLORS,
|
|
4
4
|
c as NiceBarGauge,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),C=require("@nice2dev/ui-core"),o=require("react"),f=({height:e=200})=>r.jsx("div",{className:"ntd-lazy-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",height:e,background:"var(--ntd-color-surface, #f5f5f5)",borderRadius:"var(--ntd-radius, 8px)",animation:"ntd-pulse 1.5s ease-in-out infinite"},children:r.jsx("div",{className:"ntd-lazy-loading-spinner",style:{width:24,height:24,border:"2px solid var(--ntd-color-border, #ddd)",borderTopColor:"var(--ntd-color-primary, #6366f1)",borderRadius:"50%",animation:"ntd-spin 0.8s linear infinite"}})}),L=(e,t)=>{const{t:a}=C.useNiceTranslation();return r.jsxs("div",{className:"ntd-lazy-error",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,background:"var(--ntd-color-error-bg, #fee2e2)",borderRadius:"var(--ntd-radius, 8px)",color:"var(--ntd-color-error, #dc2626)"},children:[r.jsx(C.NiceIcon,{name:"error",size:32}),r.jsx("p",{style:{margin:"12px 0 8px",fontWeight:500},children:a("lazy.failedToLoadComponent","Failed to load component")}),r.jsx("p",{style:{margin:0,fontSize:"0.875em",opacity:.8},children:e.message}),r.jsx("button",{onClick:t,style:{marginTop:16,padding:"8px 16px",border:"none",borderRadius:"var(--ntd-radius, 8px)",background:"var(--ntd-color-error, #dc2626)",color:"var(--nice-color-white, #fff)",cursor:"pointer",fontSize:"0.875em"},children:a("lazy.retry","Retry")})]})};class D extends o.Component{constructor(){super(...arguments),this.state={error:null},this.handleRetry=()=>{this.setState({error:null})}}static getDerivedStateFromError(t){return{error:t}}render(){return this.state.error?this.props.fallback(this.state.error,this.handleRetry):this.props.children}}function i(e,t={}){const{fallback:a=r.jsx(f,{}),preloadOnMount:l=!1,preloadOnHover:p=!1,preloadAfterIdle:n,minLoadingTime:m=0,ssrFallback:c,errorFallback:S=L,displayName:P}=t;let b=null,h=!1;const y=async()=>{if(b)return b;const x=Date.now();b=e();const v=await b;if(m>0){const w=Date.now()-x;w<m&&await new Promise(u=>setTimeout(u,m-w))}return h=!0,v},I=o.lazy(y),q=x=>{const v=o.useRef(null);return o.useEffect(()=>{l&&!h&&y()},[]),o.useEffect(()=>{if(n&&!h){const u="requestIdleCallback"in window?window.requestIdleCallback(()=>y(),{timeout:n}):setTimeout(()=>y(),n);return()=>{"cancelIdleCallback"in window?window.cancelIdleCallback(u):clearTimeout(u)}}},[]),o.useEffect(()=>{if(!p||h)return;const u=v.current;if(!u)return;const N=()=>{h||y()};return u.addEventListener("mouseenter",N,{once:!0}),()=>u.removeEventListener("mouseenter",N)},[]),typeof window>"u"&&c?r.jsx(r.Fragment,{children:c}):r.jsx("div",{ref:v,className:"ntd-lazy-wrapper",children:r.jsx(D,{fallback:S,children:r.jsx(o.Suspense,{fallback:a,children:r.jsx(I,{...x})})})})},R=async()=>{h||await y()},k=q;return k.preload=R,k.displayName=P||"LazyComponent",k}function G(e=.1,t="100px"){const a=o.useRef(null),[l,p]=o.useState(!1);return o.useEffect(()=>{if(!a.current||l)return;const n=new IntersectionObserver(([m])=>{m.isIntersecting&&(p(!0),n.disconnect())},{threshold:e,rootMargin:t});return n.observe(a.current),()=>n.disconnect()},[e,t,l]),[a,l]}function V(e,t=2e3){o.useEffect(()=>{if("requestIdleCallback"in window){const a=window.requestIdleCallback(()=>{e.forEach(l=>l())},{timeout:t});return()=>window.cancelIdleCallback(a)}else{const a=setTimeout(()=>{e.forEach(l=>l())},t);return()=>clearTimeout(a)}},[])}function T(e,t){const a=o.useRef(new Set);o.useEffect(()=>{const l=document.querySelectorAll("a[href]"),p=n=>{const c=n.currentTarget.getAttribute("href");c&&e[c]&&!a.current.has(c)&&(e[c](),a.current.add(c))};return l.forEach(n=>{n.addEventListener("mouseenter",p)}),()=>{l.forEach(n=>{n.removeEventListener("mouseenter",p)})}},[t,e])}const z=()=>r.jsx(f,{height:400}),g=()=>r.jsx(f,{height:300}),j=()=>r.jsx(f,{height:500}),E=()=>r.jsx(f,{height:600}),d=e=>e,s={CodeEditor:i(d(()=>Promise.resolve().then(()=>require("./NiceCodeEditor-bJReZPDO.cjs")).then(e=>({default:e.NiceCodeEditor}))),{fallback:r.jsx(z,{}),preloadOnHover:!0,displayName:"LazyCodeEditor"}),HtmlEditor:i(d(()=>Promise.resolve().then(()=>require("./NiceHtmlEditor-CDZeF_zG.cjs")).then(e=>({default:e.NiceHtmlEditor}))),{fallback:r.jsx(z,{}),preloadOnHover:!0,displayName:"LazyHtmlEditor"}),DocumentViewer:i(d(()=>Promise.resolve().then(()=>require("./NiceDocumentViewer-CDXAmPp7.cjs")).then(e=>({default:e.NiceDocumentViewer}))),{fallback:r.jsx(f,{height:600}),displayName:"LazyDocumentViewer"}),Chart:i(d(()=>Promise.resolve().then(()=>require("./charts-C6iOu0H6.cjs")).then(e=>e.NiceChart$1).then(e=>({default:e.NiceChart}))),{fallback:r.jsx(g,{}),preloadAfterIdle:3e3,displayName:"LazyChart"}),VectorMap:i(d(()=>Promise.resolve().then(()=>require("./charts-C6iOu0H6.cjs")).then(e=>e.NiceVectorMap$1).then(e=>({default:e.NiceVectorMap}))),{fallback:r.jsx(f,{height:400}),displayName:"LazyVectorMap"}),Sankey:i(d(()=>Promise.resolve().then(()=>require("./charts-C6iOu0H6.cjs")).then(e=>e.NiceSankey$1).then(e=>({default:e.NiceSankey}))),{fallback:r.jsx(g,{}),displayName:"LazySankey"}),Scheduler:i(d(()=>Promise.resolve().then(()=>require("./NiceScheduler-GJLvkXJ3.cjs")).then(e=>e.NiceScheduler$1).then(e=>({default:e.NiceScheduler}))),{fallback:r.jsx(E,{}),displayName:"LazyScheduler"}),Gantt:i(d(()=>Promise.resolve().then(()=>require("./NiceGantt-s2cgt5zD.cjs")).then(e=>({default:e.NiceGantt}))),{fallback:r.jsx(E,{}),displayName:"LazyGantt"}),PivotGrid:i(d(()=>Promise.resolve().then(()=>require("./NicePivotGrid-DqluEkCI.cjs")).then(e=>e.NicePivotGrid$1).then(e=>({default:e.NicePivotGrid}))),{fallback:r.jsx(j,{}),displayName:"LazyPivotGrid"}),DataGrid:i(d(()=>Promise.resolve().then(()=>require("./NiceDataGrid-BQIqitMM.cjs")).then(e=>e.NiceDataGrid$1).then(e=>({default:e.NiceDataGrid}))),{fallback:r.jsx(j,{}),preloadAfterIdle:2e3,displayName:"LazyDataGrid"})};async function H(){await Promise.all([s.CodeEditor.preload(),s.HtmlEditor.preload(),s.DocumentViewer.preload(),s.Chart.preload(),s.VectorMap.preload(),s.Sankey.preload(),s.Scheduler.preload(),s.Gantt.preload(),s.PivotGrid.preload()])}async function O(e){await Promise.all(e.map(t=>s[t].preload()))}exports.DefaultErrorFallback=L;exports.DefaultLoadingFallback=f;exports.LazyComponents=s;exports.createLazyComponent=i;exports.preloadAllHeavyComponents=H;exports.preloadComponents=O;exports.useLazyOnVisible=G;exports.usePreloadOnIdle=V;exports.usePreloadOnRouteHint=T;
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { jsxs as T, jsx as t, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceTranslation as P, NiceIcon as H } from "@nice2dev/ui-core";
|
|
3
|
+
import O, { lazy as A, useRef as z, useState as F, useEffect as y, Suspense as M } from "react";
|
|
4
|
+
const u = ({
|
|
5
|
+
height: e = 200
|
|
6
|
+
}) => /* @__PURE__ */ t(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
className: "ntd-lazy-loading",
|
|
10
|
+
style: {
|
|
11
|
+
display: "flex",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
height: e,
|
|
15
|
+
background: "var(--ntd-color-surface, #f5f5f5)",
|
|
16
|
+
borderRadius: "var(--ntd-radius, 8px)",
|
|
17
|
+
animation: "ntd-pulse 1.5s ease-in-out infinite"
|
|
18
|
+
},
|
|
19
|
+
children: /* @__PURE__ */ t(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: "ntd-lazy-loading-spinner",
|
|
23
|
+
style: {
|
|
24
|
+
width: 24,
|
|
25
|
+
height: 24,
|
|
26
|
+
border: "2px solid var(--ntd-color-border, #ddd)",
|
|
27
|
+
borderTopColor: "var(--ntd-color-primary, #6366f1)",
|
|
28
|
+
borderRadius: "50%",
|
|
29
|
+
animation: "ntd-spin 0.8s linear infinite"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
), q = (e, r) => {
|
|
35
|
+
const { t: a } = P();
|
|
36
|
+
return /* @__PURE__ */ T(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: "ntd-lazy-error",
|
|
40
|
+
style: {
|
|
41
|
+
display: "flex",
|
|
42
|
+
flexDirection: "column",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
padding: 24,
|
|
46
|
+
background: "var(--ntd-color-error-bg, #fee2e2)",
|
|
47
|
+
borderRadius: "var(--ntd-radius, 8px)",
|
|
48
|
+
color: "var(--ntd-color-error, #dc2626)"
|
|
49
|
+
},
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ t(H, { name: "error", size: 32 }),
|
|
52
|
+
/* @__PURE__ */ t("p", { style: { margin: "12px 0 8px", fontWeight: 500 }, children: a("lazy.failedToLoadComponent", "Failed to load component") }),
|
|
53
|
+
/* @__PURE__ */ t("p", { style: { margin: 0, fontSize: "0.875em", opacity: 0.8 }, children: e.message }),
|
|
54
|
+
/* @__PURE__ */ t(
|
|
55
|
+
"button",
|
|
56
|
+
{
|
|
57
|
+
onClick: r,
|
|
58
|
+
style: {
|
|
59
|
+
marginTop: 16,
|
|
60
|
+
padding: "8px 16px",
|
|
61
|
+
border: "none",
|
|
62
|
+
borderRadius: "var(--ntd-radius, 8px)",
|
|
63
|
+
background: "var(--ntd-color-error, #dc2626)",
|
|
64
|
+
color: "var(--nice-color-white, #fff)",
|
|
65
|
+
cursor: "pointer",
|
|
66
|
+
fontSize: "0.875em"
|
|
67
|
+
},
|
|
68
|
+
children: a("lazy.retry", "Retry")
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
class j extends O.Component {
|
|
76
|
+
constructor() {
|
|
77
|
+
super(...arguments), this.state = { error: null }, this.handleRetry = () => {
|
|
78
|
+
this.setState({ error: null });
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
static getDerivedStateFromError(r) {
|
|
82
|
+
return { error: r };
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
return this.state.error ? this.props.fallback(this.state.error, this.handleRetry) : this.props.children;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function l(e, r = {}) {
|
|
89
|
+
const {
|
|
90
|
+
fallback: a = /* @__PURE__ */ t(u, {}),
|
|
91
|
+
preloadOnMount: o = !1,
|
|
92
|
+
preloadOnHover: p = !1,
|
|
93
|
+
preloadAfterIdle: n,
|
|
94
|
+
minLoadingTime: f = 0,
|
|
95
|
+
ssrFallback: s,
|
|
96
|
+
errorFallback: I = q,
|
|
97
|
+
displayName: x
|
|
98
|
+
} = r;
|
|
99
|
+
let b = null, m = !1;
|
|
100
|
+
const h = async () => {
|
|
101
|
+
if (b)
|
|
102
|
+
return b;
|
|
103
|
+
const v = Date.now();
|
|
104
|
+
b = e();
|
|
105
|
+
const k = await b;
|
|
106
|
+
if (f > 0) {
|
|
107
|
+
const g = Date.now() - v;
|
|
108
|
+
g < f && await new Promise((c) => setTimeout(c, f - g));
|
|
109
|
+
}
|
|
110
|
+
return m = !0, k;
|
|
111
|
+
}, D = A(h), R = (v) => {
|
|
112
|
+
const k = z(null);
|
|
113
|
+
return y(() => {
|
|
114
|
+
o && !m && h();
|
|
115
|
+
}, []), y(() => {
|
|
116
|
+
if (n && !m) {
|
|
117
|
+
const c = "requestIdleCallback" in window ? window.requestIdleCallback(() => h(), {
|
|
118
|
+
timeout: n
|
|
119
|
+
}) : setTimeout(() => h(), n);
|
|
120
|
+
return () => {
|
|
121
|
+
"cancelIdleCallback" in window ? window.cancelIdleCallback(c) : clearTimeout(c);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}, []), y(() => {
|
|
125
|
+
if (!p || m)
|
|
126
|
+
return;
|
|
127
|
+
const c = k.current;
|
|
128
|
+
if (!c)
|
|
129
|
+
return;
|
|
130
|
+
const N = () => {
|
|
131
|
+
m || h();
|
|
132
|
+
};
|
|
133
|
+
return c.addEventListener("mouseenter", N, { once: !0 }), () => c.removeEventListener("mouseenter", N);
|
|
134
|
+
}, []), typeof window > "u" && s ? /* @__PURE__ */ t(V, { children: s }) : /* @__PURE__ */ t("div", { ref: k, className: "ntd-lazy-wrapper", children: /* @__PURE__ */ t(j, { fallback: I, children: /* @__PURE__ */ t(M, { fallback: a, children: /* @__PURE__ */ t(D, { ...v }) }) }) });
|
|
135
|
+
}, G = async () => {
|
|
136
|
+
m || await h();
|
|
137
|
+
}, w = R;
|
|
138
|
+
return w.preload = G, w.displayName = x || "LazyComponent", w;
|
|
139
|
+
}
|
|
140
|
+
function K(e = 0.1, r = "100px") {
|
|
141
|
+
const a = z(null), [o, p] = F(!1);
|
|
142
|
+
return y(() => {
|
|
143
|
+
if (!a.current || o)
|
|
144
|
+
return;
|
|
145
|
+
const n = new IntersectionObserver(
|
|
146
|
+
([f]) => {
|
|
147
|
+
f.isIntersecting && (p(!0), n.disconnect());
|
|
148
|
+
},
|
|
149
|
+
{ threshold: e, rootMargin: r }
|
|
150
|
+
);
|
|
151
|
+
return n.observe(a.current), () => n.disconnect();
|
|
152
|
+
}, [e, r, o]), [a, o];
|
|
153
|
+
}
|
|
154
|
+
function Q(e, r = 2e3) {
|
|
155
|
+
y(() => {
|
|
156
|
+
if ("requestIdleCallback" in window) {
|
|
157
|
+
const a = window.requestIdleCallback(
|
|
158
|
+
() => {
|
|
159
|
+
e.forEach((o) => o());
|
|
160
|
+
},
|
|
161
|
+
{ timeout: r }
|
|
162
|
+
);
|
|
163
|
+
return () => window.cancelIdleCallback(a);
|
|
164
|
+
} else {
|
|
165
|
+
const a = setTimeout(() => {
|
|
166
|
+
e.forEach((o) => o());
|
|
167
|
+
}, r);
|
|
168
|
+
return () => clearTimeout(a);
|
|
169
|
+
}
|
|
170
|
+
}, []);
|
|
171
|
+
}
|
|
172
|
+
function U(e, r) {
|
|
173
|
+
const a = z(/* @__PURE__ */ new Set());
|
|
174
|
+
y(() => {
|
|
175
|
+
const o = document.querySelectorAll("a[href]"), p = (n) => {
|
|
176
|
+
const s = n.currentTarget.getAttribute("href");
|
|
177
|
+
s && e[s] && !a.current.has(s) && (e[s](), a.current.add(s));
|
|
178
|
+
};
|
|
179
|
+
return o.forEach((n) => {
|
|
180
|
+
n.addEventListener("mouseenter", p);
|
|
181
|
+
}), () => {
|
|
182
|
+
o.forEach((n) => {
|
|
183
|
+
n.removeEventListener("mouseenter", p);
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
}, [r, e]);
|
|
187
|
+
}
|
|
188
|
+
const C = () => /* @__PURE__ */ t(u, { height: 400 }), L = () => /* @__PURE__ */ t(u, { height: 300 }), S = () => /* @__PURE__ */ t(u, { height: 500 }), E = () => /* @__PURE__ */ t(u, { height: 600 }), i = (e) => e, d = {
|
|
189
|
+
/**
|
|
190
|
+
* Lazy-loaded NiceCodeEditor (Monaco ~2MB)
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```tsx
|
|
194
|
+
* import { LazyComponents } from '@nice2dev/ui';
|
|
195
|
+
*
|
|
196
|
+
* <LazyComponents.CodeEditor
|
|
197
|
+
* value={code}
|
|
198
|
+
* language="typescript"
|
|
199
|
+
* onChange={setCode}
|
|
200
|
+
* />
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
CodeEditor: /* @__PURE__ */ l(
|
|
204
|
+
/* @__PURE__ */ i(
|
|
205
|
+
() => import("./NiceCodeEditor-CK6B54mu.js").then((e) => ({ default: e.NiceCodeEditor }))
|
|
206
|
+
),
|
|
207
|
+
{
|
|
208
|
+
fallback: /* @__PURE__ */ t(C, {}),
|
|
209
|
+
preloadOnHover: !0,
|
|
210
|
+
displayName: "LazyCodeEditor"
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
/**
|
|
214
|
+
* Lazy-loaded NiceHtmlEditor
|
|
215
|
+
*/
|
|
216
|
+
HtmlEditor: /* @__PURE__ */ l(
|
|
217
|
+
/* @__PURE__ */ i(
|
|
218
|
+
() => import("./NiceHtmlEditor-CdWgddg3.js").then((e) => ({ default: e.NiceHtmlEditor }))
|
|
219
|
+
),
|
|
220
|
+
{
|
|
221
|
+
fallback: /* @__PURE__ */ t(C, {}),
|
|
222
|
+
preloadOnHover: !0,
|
|
223
|
+
displayName: "LazyHtmlEditor"
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
/**
|
|
227
|
+
* Lazy-loaded NiceDocumentViewer
|
|
228
|
+
*/
|
|
229
|
+
DocumentViewer: /* @__PURE__ */ l(
|
|
230
|
+
/* @__PURE__ */ i(
|
|
231
|
+
() => import("./NiceDocumentViewer-B9VIVKyw.js").then((e) => ({ default: e.NiceDocumentViewer }))
|
|
232
|
+
),
|
|
233
|
+
{
|
|
234
|
+
fallback: /* @__PURE__ */ t(u, { height: 600 }),
|
|
235
|
+
displayName: "LazyDocumentViewer"
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/**
|
|
239
|
+
* Lazy-loaded NiceChart
|
|
240
|
+
*/
|
|
241
|
+
Chart: /* @__PURE__ */ l(
|
|
242
|
+
/* @__PURE__ */ i(
|
|
243
|
+
() => import("./charts-BYQwl_GS.js").then((e) => e.A).then((e) => ({ default: e.NiceChart }))
|
|
244
|
+
),
|
|
245
|
+
{
|
|
246
|
+
fallback: /* @__PURE__ */ t(L, {}),
|
|
247
|
+
preloadAfterIdle: 3e3,
|
|
248
|
+
displayName: "LazyChart"
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
/**
|
|
252
|
+
* Lazy-loaded NiceVectorMap
|
|
253
|
+
*/
|
|
254
|
+
VectorMap: /* @__PURE__ */ l(
|
|
255
|
+
/* @__PURE__ */ i(
|
|
256
|
+
() => import("./charts-BYQwl_GS.js").then((e) => e.E).then((e) => ({ default: e.NiceVectorMap }))
|
|
257
|
+
),
|
|
258
|
+
{
|
|
259
|
+
fallback: /* @__PURE__ */ t(u, { height: 400 }),
|
|
260
|
+
displayName: "LazyVectorMap"
|
|
261
|
+
}
|
|
262
|
+
),
|
|
263
|
+
/**
|
|
264
|
+
* Lazy-loaded NiceSankey
|
|
265
|
+
*/
|
|
266
|
+
Sankey: /* @__PURE__ */ l(
|
|
267
|
+
/* @__PURE__ */ i(
|
|
268
|
+
() => import("./charts-BYQwl_GS.js").then((e) => e.B).then((e) => ({ default: e.NiceSankey }))
|
|
269
|
+
),
|
|
270
|
+
{
|
|
271
|
+
fallback: /* @__PURE__ */ t(L, {}),
|
|
272
|
+
displayName: "LazySankey"
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/**
|
|
276
|
+
* Lazy-loaded NiceScheduler
|
|
277
|
+
*/
|
|
278
|
+
Scheduler: /* @__PURE__ */ l(
|
|
279
|
+
/* @__PURE__ */ i(
|
|
280
|
+
() => import("./NiceScheduler-UT49u2Vq.js").then((e) => e.d).then((e) => ({ default: e.NiceScheduler }))
|
|
281
|
+
),
|
|
282
|
+
{
|
|
283
|
+
fallback: /* @__PURE__ */ t(E, {}),
|
|
284
|
+
displayName: "LazyScheduler"
|
|
285
|
+
}
|
|
286
|
+
),
|
|
287
|
+
/**
|
|
288
|
+
* Lazy-loaded NiceGantt
|
|
289
|
+
*/
|
|
290
|
+
Gantt: /* @__PURE__ */ l(
|
|
291
|
+
/* @__PURE__ */ i(
|
|
292
|
+
() => import("./NiceGantt-TEXbAELi.js").then((e) => ({ default: e.NiceGantt }))
|
|
293
|
+
),
|
|
294
|
+
{
|
|
295
|
+
fallback: /* @__PURE__ */ t(E, {}),
|
|
296
|
+
displayName: "LazyGantt"
|
|
297
|
+
}
|
|
298
|
+
),
|
|
299
|
+
/**
|
|
300
|
+
* Lazy-loaded NicePivotGrid
|
|
301
|
+
*/
|
|
302
|
+
PivotGrid: /* @__PURE__ */ l(
|
|
303
|
+
/* @__PURE__ */ i(
|
|
304
|
+
() => import("./NicePivotGrid-D_kRF1Dt.js").then((e) => e.p).then((e) => ({ default: e.NicePivotGrid }))
|
|
305
|
+
),
|
|
306
|
+
{
|
|
307
|
+
fallback: /* @__PURE__ */ t(S, {}),
|
|
308
|
+
displayName: "LazyPivotGrid"
|
|
309
|
+
}
|
|
310
|
+
),
|
|
311
|
+
/**
|
|
312
|
+
* Lazy-loaded NiceDataGrid (for very heavy usage)
|
|
313
|
+
*/
|
|
314
|
+
DataGrid: /* @__PURE__ */ l(
|
|
315
|
+
/* @__PURE__ */ i(
|
|
316
|
+
() => import("./NiceDataGrid-C1eI6Pso.js").then((e) => e.h).then((e) => ({ default: e.NiceDataGrid }))
|
|
317
|
+
),
|
|
318
|
+
{
|
|
319
|
+
fallback: /* @__PURE__ */ t(S, {}),
|
|
320
|
+
preloadAfterIdle: 2e3,
|
|
321
|
+
displayName: "LazyDataGrid"
|
|
322
|
+
}
|
|
323
|
+
)
|
|
324
|
+
};
|
|
325
|
+
async function X() {
|
|
326
|
+
await Promise.all([
|
|
327
|
+
d.CodeEditor.preload(),
|
|
328
|
+
d.HtmlEditor.preload(),
|
|
329
|
+
d.DocumentViewer.preload(),
|
|
330
|
+
d.Chart.preload(),
|
|
331
|
+
d.VectorMap.preload(),
|
|
332
|
+
d.Sankey.preload(),
|
|
333
|
+
d.Scheduler.preload(),
|
|
334
|
+
d.Gantt.preload(),
|
|
335
|
+
d.PivotGrid.preload()
|
|
336
|
+
]);
|
|
337
|
+
}
|
|
338
|
+
async function Y(e) {
|
|
339
|
+
await Promise.all(e.map((r) => d[r].preload()));
|
|
340
|
+
}
|
|
341
|
+
export {
|
|
342
|
+
q as D,
|
|
343
|
+
d as L,
|
|
344
|
+
u as a,
|
|
345
|
+
Y as b,
|
|
346
|
+
l as c,
|
|
347
|
+
Q as d,
|
|
348
|
+
U as e,
|
|
349
|
+
X as p,
|
|
350
|
+
K as u
|
|
351
|
+
};
|