@kwantis-id3/frontend-library 1.0.0-rc.31 → 1.0.0-rc.33
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/esm/index.js
CHANGED
|
@@ -495,18 +495,13 @@ import{jsx as e,jsxs as t,Fragment as n}from"@emotion/react/jsx-runtime";import*
|
|
|
495
495
|
`,Eo=e=>{const t=e.column.id,n=e.row.original.cells[t];return{style:{backgroundColor:n?.bgColor??void 0,color:n?.textColor??void 0}}},Lo=i=>{const[o,l]=r([]),[c,s]=r(i.columns.reduce(((e,t)=>{const n={...e},i=t.meta?.isHidden??!1;return t.id&&(n[t.id]=!i),n}),{})),[d,g]=r(Object),[p,b]=r(!1),h=Be(),m=N(),f=u(null);a((()=>{s(i.columns.reduce(((e,t)=>{const n={...e},i=t.meta?.isHidden??!1;return t.id&&(n[t.id]=!i),n}),{}))}),[i.columns]),a((()=>{const e=()=>{f.current&&b(f.current.scrollTop>0)},t=f.current;return t&&t.addEventListener("scroll",e),()=>{t?.removeEventListener("scroll",e)}}),[]);const v=G({data:i.data||[],columns:i.columns,state:{columnFilters:o,columnVisibility:c},onColumnFiltersChange:l,getCoreRowModel:w(),getFilteredRowModel:B(),getSortedRowModel:V(),getFacetedRowModel:R(),getFacetedUniqueValues:X(),getFacetedMinMaxValues:M(),debugAll:!1});return e(So,{ref:f,children:t(Oo,{$mobileBreakpoint:768,children:[e("colgroup",{children:h?e("col",{}):v.getHeaderGroups().map((t=>t.headers.map((t=>e("col",{},t.id)))))}),e("thead",{children:v.getHeaderGroups().map((i=>e("tr",{className:"header",children:i.headers.map((i=>e("th",{colSpan:i.colSpan,css:{backgroundColor:p?m.activePalette.background.main:"transparent"},children:i.isPlaceholder?null:t(n,{children:[t("div",{className:"flex h-center v-center",children:[t("div",{className:i.column.getCanSort()?"cursorPointer":"",onClick:i.column.getToggleSortingHandler(),children:[T(i.column.columnDef.header,i.getContext()),{asc:" 🔼",desc:" 🔽"}[i.column.getIsSorted()]??null]}),i.column.getCanFilter()?e("div",{className:"cursorPointer",style:{height:"fit-content",display:"flex",alignItems:"center"},"data-testid":`filterIcon-${i.column.id}`,onClick:()=>{const e={...d};e[i.column.id]=!e[i.column.id],g(e)},children:e(A,{icon:"prime:filter-fill",width:18,height:18})}):null]}),i.column.getCanFilter()&&d[i.column.id]?e("div",{className:"flex h-center",children:e(No,{column:i.column,table:v})}):null]})},i.id)))},i.id)))}),e("tbody",{children:v.getRowModel().rows.map((n=>{return e("tr",{...(i=n,{style:{backgroundColor:i.original.info?.bgColor??void 0,color:i.original.info?.textColor??void 0}}),children:n.getVisibleCells().map((n=>e("td",{...Eo(n.getContext()),children:t("div",{children:[h?e("div",{className:"cellContent",children:n.column.columnDef.header.charAt(0).toUpperCase()+n.column.columnDef.header.slice(1)}):null,e("div",{className:"cellContent",children:T(n.column.columnDef.cell,n.getContext())})]})},n.id)))},n.id);var i}))})]})})},Yo=t=>e(Do,{children:(t=>"boolean"==typeof t?e(yo,{variant:t?"success":"error"}):t)(t)}),Jo=i=>{const[o,l]=r([]),[c,s]=r(i.columns.reduce(((e,t)=>{const n={...e},i=t.meta?.isHidden??!1;return t.id&&(n[t.id]=!i),n}),{})),[d,g]=r(Object),[p,b]=r(!1),h=Be(),m=N(),f=u(null),v=G({data:i.data||[],columns:i.columns,state:{columnFilters:o,columnVisibility:c},onColumnFiltersChange:l,getCoreRowModel:w(),getFilteredRowModel:B(),getSortedRowModel:V(),getFacetedRowModel:R(),getFacetedUniqueValues:X(),getFacetedMinMaxValues:M(),debugAll:!1});return a((()=>{s(i.columns.reduce(((e,t)=>{const n={...e},i=t.meta?.isHidden??!1;return t.id&&(n[t.id]=!i),n}),{}))}),[i.columns]),a((()=>{const e=()=>{f.current&&b(f.current.scrollTop>0)},t=f.current;return t&&t.addEventListener("scroll",e),()=>{t?.removeEventListener("scroll",e)}}),[]),e(So,{ref:f,children:t(Oo,{$mobileBreakpoint:768,children:[e("colgroup",{children:h?e("col",{}):v.getHeaderGroups().map((t=>t.headers.map((t=>e("col",{},t.id)))))}),e("thead",{children:v.getHeaderGroups().map((i=>e("tr",{className:"header",children:i.headers.map((i=>e("th",{colSpan:i.colSpan,css:{backgroundColor:p?m.activePalette.background.main:"transparent"},children:i.isPlaceholder?null:t(n,{children:[t("div",{className:"flex h-center v-center",children:[t("div",{className:i.column.getCanSort()?"cursorPointer":"",onClick:i.column.getToggleSortingHandler(),children:[T(i.column.columnDef.header,i.getContext()),{asc:" 🔼",desc:" 🔽"}[i.column.getIsSorted()]??null]}),i.column.getCanFilter()?e("div",{className:"cursorPointer",style:{height:"fit-content",display:"flex",alignItems:"center"},"data-testid":`filterIcon-${i.column.id}`,onClick:()=>{const e={...d};e[i.column.id]=!e[i.column.id],g(e)},children:e(A,{icon:"prime:filter-fill",width:18,height:18})}):null]}),i.column.getCanFilter()&&d[i.column.id]?e("div",{className:"flex h-center",children:e(No,{column:i.column,table:v})}):null]})},i.id)))},i.id)))}),e("tbody",{children:v.getRowModel().rows.map((n=>e("tr",{children:n.getVisibleCells().map((n=>e("td",{children:t("div",{children:[h?e("div",{className:"cellContent",children:n.column.columnDef.header.charAt(0).toUpperCase()+n.column.columnDef.header.slice(1)}):null,e("div",{className:"cellContent",children:T(n.column.columnDef.cell,n.getContext())})]})},n.id)))},n.id)))})]})})},zo=x("div",we)`
|
|
496
496
|
display: grid;
|
|
497
497
|
grid-template-columns: repeat(
|
|
498
|
-
auto-
|
|
499
|
-
minmax(
|
|
498
|
+
auto-fit,
|
|
499
|
+
minmax(${e=>e.$cardsWidth}, 1fr)
|
|
500
500
|
);
|
|
501
501
|
grid-auto-rows: 1fr;
|
|
502
502
|
grid-gap: 10px;
|
|
503
503
|
justify-content: space-evenly;
|
|
504
504
|
align-items: center;
|
|
505
|
-
|
|
506
|
-
@media (max-width: 450px) {
|
|
507
|
-
/* Make items take all the space */
|
|
508
|
-
grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
|
|
509
|
-
}
|
|
510
505
|
`,jo=t=>"table"===t.mode?e(Lo,{data:t.data,columns:t.columns}):e(zo,{$cardsWidth:t.cardsWidth??"300px",$cardsHeight:t.cardsHeight??"300px",css:t.sx,children:t.data?.map(((e,n)=>t.cardComponent(e,n)))}),$o=t=>"table"===t.mode?e(Jo,{data:t.data,columns:t.columns}):e(zo,{$cardsWidth:t.cardsWidth??"300px",$cardsHeight:t.cardsHeight??"300px",css:t.sx,children:t.data?.map(((n,i)=>e("div",{css:{height:"100%",display:"flex","> article":{flex:"1 1 auto"}},children:t.cardComponent(n,i)},i)))}),Uo=x.div`
|
|
511
506
|
label: TreeView;
|
|
512
507
|
display: flex;
|
|
@@ -592,5 +587,5 @@ import{jsx as e,jsxs as t,Fragment as n}from"@emotion/react/jsx-runtime";import*
|
|
|
592
587
|
}
|
|
593
588
|
|
|
594
589
|
${({$anchor:e})=>{switch(e){case"top":return"\n left: 50%;\n bottom: 0;\n transform: translateX(-50%) translateY(100%);\n border-radius: 0 0 10px 10px;\n box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.15);\n ";case"right":return"\n top: 50%;\n transform: translateY(-50%) translateX(-100%);\n border-radius: 10px 0 0 10px;\n min-width: 20px;\n min-height: 40px;\n box-shadow: -2px 0px 4px 0px rgba(0, 0, 0, 0.15);\n ";case"bottom":return"\n left: 50%;\n top: 0;\n transform: translateX(-50%) translateY(-100%);\n border-radius: 10px 10px 0 0;\n box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.15);\n ";case"left":return"\n top: 50%;\n right: 0;\n transform: translateY(-50%) translateX(100%);\n min-width: 20px;\n min-height: 40px;\n border-radius: 0 10px 10px 0;\n box-shadow: 2px 0px 4px 0px rgba(0, 0, 0, 0.15);\n ";default:return""}}}
|
|
595
|
-
`,rr=(t,n)=>e(A,{icon:{top:n?"prime:arrow-up":"prime:arrow-down",right:n?"prime:arrow-right":"prime:arrow-left",bottom:n?"prime:arrow-down":"prime:arrow-up",left:n?"prime:arrow-left":"prime:arrow-right"}[t],width:16,height:16}),ar=({anchor:
|
|
590
|
+
`,rr=(t,n)=>e(A,{icon:{top:n?"prime:arrow-up":"prime:arrow-down",right:n?"prime:arrow-right":"prime:arrow-left",bottom:n?"prime:arrow-down":"prime:arrow-up",left:n?"prime:arrow-left":"prime:arrow-right"}[t],width:16,height:16}),ar=({anchor:i="bottom",isOpen:o,openContent:a,closedContent:l,openTrigger:s,closedTrigger:d,minOpen:g,maxOpen:b,bgColor:h,triggerColor:m,triggerHoverColor:f,onOpen:v,onClose:I,zIndex:C,hideTrigger:x=!1,keepMounted:y=!1,sx:A})=>{const[G,w]=r(!1),B=u(null),[V,R]=r(`${b}px`),[X,M]=r(`${g}px`),T=o??G;p((()=>{const e=B.current;e&&requestAnimationFrame((()=>{const t="top"===i||"bottom"===i?e.scrollHeight:e.scrollWidth;let n;n="top"===i||"bottom"===i?.9*window.innerHeight:.9*window.innerWidth;const o=b?Math.min(b,n):n,r=Math.min(t+1,o);R(`${r}px`)}))}),[a,i,T,b]),p((()=>{B.current&&requestAnimationFrame((()=>{const e="top"===i||"bottom"===i?B.current?.scrollHeight:B.current?.scrollWidth;M(`${g??e??0}px`)}))}),[l,i,g]);const Z=c((()=>{const e=d??rr(i,!1),t=s??rr(i,!0);return T?t:e}),[i,T,s,d]);return t(nr,{css:A,$anchor:i,$isOpen:T,$minOpen:X,$maxOpen:V,$bgColor:h,$zIndex:C,children:[e(or,{$anchor:i,$hideTrigger:x,onClick:()=>{T&&I?.(),T||v?.(),w((e=>!e))},"data-testid":"drawer-trigger",$bgColor:h,$triggerColor:m,$triggerHoverColor:f,children:Z}),t(ir,{ref:B,$anchor:i,$isOpen:T,children:[y&&t(n,{children:[e("div",{style:{display:T?"block":"none"},children:a}),e("div",{style:{display:T?"none":"block"},children:l})]}),!y&&(T?a:l)]})]})};export{He as Accordion,Ze as AccordionGroup,Te as Button,To as Card,Wo as CardContent,Fo as CardFooter,Zo as CardHeader,ko as CardIndicators,Po as CardMediaSection,er as ControlledTreeView,Jo as DataGrid,ar as Drawer,fo as Dropdown,yo as Indicator,Oe as InputField,Co as Modal,Zi as MultiSelect,$o as MultiViewGrid,jo as MultiViewList,Ti as SingleSelect,to as Slider,Lo as Table,Go as Tag,H as ThemeContextProvider,tr as UncontrolledTreeView,W as commonColors,xe as darkenColor,k as defaultDarkPalette,F as defaultLightPalette,Ge as getActiveColor,Ce as getContrastColor,Ae as getHoverColor,ye as lightenColor,Yo as renderCell,we as transientOptions,Be as useIsMobile,Z as usePrefersColorScheme,N as useThemeContext};
|
|
596
591
|
//# sourceMappingURL=index.js.map
|