@e-llm-studio/federated-dashboard-components 2.2.8 → 2.2.9

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,2 +1,2 @@
1
- import{__assign as l}from"../../../_virtual/_tslib.js";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o}from"react";import{ArrowRight as a,Minimize as n,Maximize as i}from"lucide-react";import c from"./FTable.js";import r from"../FiltersSidebar/CustomTextInput.js";import d from"./SortDropdown.js";function s(s){var u=s.title,h=s.icon,v=s.showExpandButton,m=void 0===v||v,p=s.className,f=s.styles,b=s.table,x=s.searchBar,N=s.sort,y=s.cta,g=s.onExpand,C=o(!1),j=C[0],B=C[1],k=Boolean((null==y?void 0:y.ctaEnabled)&&(null==y?void 0:y.ctaText));return e("div",l({className:"\n tc-root\n ".concat(j?"tc-root--fullscreen":"","\n ").concat(null!=p?p:"","\n "),style:null==f?void 0:f.root},{children:[e("div",l({className:"tc-header",style:null==f?void 0:f.header},{children:[e("div",l({className:"tc-header-left"},{children:[h&&t("div",l({className:"tc-title-icon",style:l({width:"20px",height:"20px"},null==f?void 0:f.icon)},{children:h})),t("div",l({className:"tc-title",style:null==f?void 0:f.title},{children:u}))]})),e("div",l({className:"tc-header-right"},{children:[x&&t(r,{value:null==x?void 0:x.value,placeholder:null==x?void 0:x.placeholder,onChange:null==x?void 0:x.onChange,searchIcon:!0,className:"tc-search"}),N&&t(d,{value:N.value,orderBy:N.orderBy,options:N.options,placeholder:null==N?void 0:N.placeholder,onChange:N.onChange}),k&&e("button",l({type:"button",className:"tc-cta",onClick:function(){var l;return null===(l=null==y?void 0:y.ctaOnClick)||void 0===l?void 0:l.call(y)}},{children:[null==y?void 0:y.ctaText,t(a,{size:14,strokeWidth:2,"aria-hidden":!0})]})),m&&!k&&t("button",l({className:"tc-expand-btn",onClick:function(){var l=!j;B(l),null==g||g(l)}},{children:t(j?n:i,{size:20})}))]}))]})),t("div",l({className:"tc-table tc-table--fit"},{children:t(c,l({},b,{emptyState:null==b?void 0:b.emptyState,scrollHeight:j?"calc(100vh - 140px)":null==b?void 0:b.scrollHeight}))}))]}))}export{s as default};
1
+ import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as l,jsx as t}from"react/jsx-runtime";import{useState as o}from"react";import{ArrowRight as a,Minimize as n,Maximize as i}from"lucide-react";import c from"./FTable.js";import r from"../FiltersSidebar/CustomTextInput.js";import d from"./SortDropdown.js";function s(s){var u=s.title,h=s.icon,v=s.showExpandButton,m=void 0===v||v,p=s.className,f=s.renderHeaderJsx,x=s.styles,b=s.table,y=s.searchBar,N=s.sort,g=s.cta,C=s.onExpand,j=o(!1),B=j[0],k=j[1],S=Boolean((null==g?void 0:g.ctaEnabled)&&(null==g?void 0:g.ctaText)),T="function"==typeof f?f():f;return l("div",e({className:"\n tc-root\n ".concat(B?"tc-root--fullscreen":"","\n ").concat(null!=p?p:"","\n "),style:null==x?void 0:x.root},{children:[l("div",e({className:"tc-header",style:null==x?void 0:x.header},{children:[l("div",e({className:"tc-header-left"},{children:[h&&t("div",e({className:"tc-title-icon",style:e({width:"20px",height:"20px"},null==x?void 0:x.icon)},{children:h})),t("div",e({className:"tc-title",style:null==x?void 0:x.title},{children:u}))]})),l("div",e({className:"tc-header-right"},{children:[B&&T,y&&t(r,{value:null==y?void 0:y.value,placeholder:null==y?void 0:y.placeholder,onChange:null==y?void 0:y.onChange,searchIcon:!0,className:"tc-search"}),N&&t(d,{value:N.value,orderBy:N.orderBy,options:N.options,placeholder:null==N?void 0:N.placeholder,onChange:N.onChange}),S&&l("button",e({type:"button",className:"tc-cta",onClick:function(){var e;return null===(e=null==g?void 0:g.ctaOnClick)||void 0===e?void 0:e.call(g)}},{children:[null==g?void 0:g.ctaText,t(a,{size:14,strokeWidth:2,"aria-hidden":!0})]})),m&&!S&&t("button",e({className:"tc-expand-btn",onClick:function(){var e=!B;k(e),null==C||C(e)}},{children:t(B?n:i,{size:20})}))]}))]})),t("div",e({className:"tc-table tc-table--fit"},{children:t(c,e({},b,{emptyState:null==b?void 0:b.emptyState,scrollHeight:B?"calc(100vh - 140px)":null==b?void 0:b.scrollHeight}))}))]}))}export{s as default};
2
2
  //# sourceMappingURL=TableCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),l=require("react/jsx-runtime"),s=require("react"),t=require("lucide-react"),a=require("./FTable.js"),i=require("../FiltersSidebar/CustomTextInput.js"),n=require("./SortDropdown.js");exports.default=function(r){var c=r.title,o=r.icon,d=r.showExpandButton,u=void 0===d||d,h=r.className,v=r.styles,x=r.table,_=r.searchBar,j=r.sort,g=r.cta,p=r.onExpand,m=s.useState(!1),b=m[0],f=m[1],y=Boolean((null==g?void 0:g.ctaEnabled)&&(null==g?void 0:g.ctaText));return l.jsxs("div",e.__assign({className:"\n tc-root\n ".concat(b?"tc-root--fullscreen":"","\n ").concat(null!=h?h:"","\n "),style:null==v?void 0:v.root},{children:[l.jsxs("div",e.__assign({className:"tc-header",style:null==v?void 0:v.header},{children:[l.jsxs("div",e.__assign({className:"tc-header-left"},{children:[o&&l.jsx("div",e.__assign({className:"tc-title-icon",style:e.__assign({width:"20px",height:"20px"},null==v?void 0:v.icon)},{children:o})),l.jsx("div",e.__assign({className:"tc-title",style:null==v?void 0:v.title},{children:c}))]})),l.jsxs("div",e.__assign({className:"tc-header-right"},{children:[_&&l.jsx(i.default,{value:null==_?void 0:_.value,placeholder:null==_?void 0:_.placeholder,onChange:null==_?void 0:_.onChange,searchIcon:!0,className:"tc-search"}),j&&l.jsx(n.default,{value:j.value,orderBy:j.orderBy,options:j.options,placeholder:null==j?void 0:j.placeholder,onChange:j.onChange}),y&&l.jsxs("button",e.__assign({type:"button",className:"tc-cta",onClick:function(){var e;return null===(e=null==g?void 0:g.ctaOnClick)||void 0===e?void 0:e.call(g)}},{children:[null==g?void 0:g.ctaText,l.jsx(t.ArrowRight,{size:14,strokeWidth:2,"aria-hidden":!0})]})),u&&!y&&l.jsx("button",e.__assign({className:"tc-expand-btn",onClick:function(){var e=!b;f(e),null==p||p(e)}},{children:b?l.jsx(t.Minimize,{size:20}):l.jsx(t.Maximize,{size:20})}))]}))]})),l.jsx("div",e.__assign({className:"tc-table tc-table--fit"},{children:l.jsx(a.default,e.__assign({},x,{emptyState:null==x?void 0:x.emptyState,scrollHeight:b?"calc(100vh - 140px)":null==x?void 0:x.scrollHeight}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),l=require("react/jsx-runtime"),t=require("react"),s=require("lucide-react"),a=require("./FTable.js"),i=require("../FiltersSidebar/CustomTextInput.js"),n=require("./SortDropdown.js");exports.default=function(r){var c=r.title,o=r.icon,d=r.showExpandButton,u=void 0===d||d,h=r.className,v=r.renderHeaderJsx,x=r.styles,_=r.table,j=r.searchBar,p=r.sort,g=r.cta,m=r.onExpand,f=t.useState(!1),b=f[0],y=f[1],N=Boolean((null==g?void 0:g.ctaEnabled)&&(null==g?void 0:g.ctaText)),C="function"==typeof v?v():v;return l.jsxs("div",e.__assign({className:"\n tc-root\n ".concat(b?"tc-root--fullscreen":"","\n ").concat(null!=h?h:"","\n "),style:null==x?void 0:x.root},{children:[l.jsxs("div",e.__assign({className:"tc-header",style:null==x?void 0:x.header},{children:[l.jsxs("div",e.__assign({className:"tc-header-left"},{children:[o&&l.jsx("div",e.__assign({className:"tc-title-icon",style:e.__assign({width:"20px",height:"20px"},null==x?void 0:x.icon)},{children:o})),l.jsx("div",e.__assign({className:"tc-title",style:null==x?void 0:x.title},{children:c}))]})),l.jsxs("div",e.__assign({className:"tc-header-right"},{children:[b&&C,j&&l.jsx(i.default,{value:null==j?void 0:j.value,placeholder:null==j?void 0:j.placeholder,onChange:null==j?void 0:j.onChange,searchIcon:!0,className:"tc-search"}),p&&l.jsx(n.default,{value:p.value,orderBy:p.orderBy,options:p.options,placeholder:null==p?void 0:p.placeholder,onChange:p.onChange}),N&&l.jsxs("button",e.__assign({type:"button",className:"tc-cta",onClick:function(){var e;return null===(e=null==g?void 0:g.ctaOnClick)||void 0===e?void 0:e.call(g)}},{children:[null==g?void 0:g.ctaText,l.jsx(s.ArrowRight,{size:14,strokeWidth:2,"aria-hidden":!0})]})),u&&!N&&l.jsx("button",e.__assign({className:"tc-expand-btn",onClick:function(){var e=!b;y(e),null==m||m(e)}},{children:b?l.jsx(s.Minimize,{size:20}):l.jsx(s.Maximize,{size:20})}))]}))]})),l.jsx("div",e.__assign({className:"tc-table tc-table--fit"},{children:l.jsx(a.default,e.__assign({},_,{emptyState:null==_?void 0:_.emptyState,scrollHeight:b?"calc(100vh - 140px)":null==_?void 0:_.scrollHeight}))}))]}))};
2
2
  //# sourceMappingURL=TableCard.js.map
@@ -6,6 +6,11 @@ export interface TableCardProps {
6
6
  icon?: React.ReactNode;
7
7
  showExpandButton?: boolean;
8
8
  className?: string;
9
+ /**
10
+ * Custom header content or render function supplied by the consumer
11
+ * to render additional controls or elements in the card header.
12
+ */
13
+ renderHeaderJsx?: React.ReactNode | (() => React.ReactNode);
9
14
  searchBar?: {
10
15
  value: string;
11
16
  placeholder?: string;
@@ -41,5 +46,5 @@ export interface TableCardProps {
41
46
  };
42
47
  table?: Partial<React.ComponentProps<typeof FTable>>;
43
48
  }
44
- export default function TableCard({ title, icon, showExpandButton, className, styles, table, searchBar, sort, cta, onExpand }: TableCardProps): React.JSX.Element;
49
+ export default function TableCard({ title, icon, showExpandButton, className, renderHeaderJsx, styles, table, searchBar, sort, cta, onExpand }: TableCardProps): React.JSX.Element;
45
50
  //# sourceMappingURL=TableCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableCard.d.ts","sourceRoot":"","sources":["../../../../../src/ExecutiveDashboard/components/Table/TableCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,OAAO,MAAM,MAAM,UAAU,CAAC;AAI9B,OAAO,iBAA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C,OAAO,MAAM,CAAC,CAAC,CAAC;CACxD;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,gBAAuB,EACvB,SAAS,EACT,MAAM,EACN,KAAK,EACL,SAAS,EACT,IAAI,EACJ,GAAG,EACH,QAAQ,EACX,EAAE,cAAc,qBA+GhB"}
1
+ {"version":3,"file":"TableCard.d.ts","sourceRoot":"","sources":["../../../../../src/ExecutiveDashboard/components/Table/TableCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,OAAO,MAAM,MAAM,UAAU,CAAC;AAI9B,OAAO,iBAAiB,CAAC;AAEzB,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACrC,CAAC;IAEF,IAAI,CAAC,EAAE;QACH,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QACzB,OAAO,EAAE;YACL,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;SACjB,EAAE,CAAC;QAEJ,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,QAAQ,EAAE,CACN,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,KAAK,GAAG,MAAM,KACtB,IAAI,CAAC;KACb,CAAC;IAEF;;;;OAIG;IACH,GAAG,CAAC,EAAE;QACF,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;KAC3B,CAAC;IAEF,iFAAiF;IACjF,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAGzC,MAAM,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC3B,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC9B,CAAC;IACF,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;CACxD;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,gBAAuB,EACvB,SAAS,EACT,eAAe,EACf,MAAM,EACN,KAAK,EACL,SAAS,EACT,IAAI,EACJ,GAAG,EACH,QAAQ,EACX,EAAE,cAAc,qBAsHhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/federated-dashboard-components",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "author": "Hitesh Rathi",
5
5
  "description": "Reusable React dashboard components for charts, metrics, filters, tables, and dashboard cards.",
6
6
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@e-llm-studio/citation": "0.0.253",
51
- "@e-llm-studio/instant-learning": "1.3.6"
51
+ "@e-llm-studio/instant-learning": "1.3.8"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "chart.js": "^4.0.0",