@gyramais/gyra-design 0.1.21 → 0.1.23
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/components/Filter/Filter.d.ts +5 -1
- package/dist/components/Filter/MultipleFilter.d.ts +5 -1
- package/dist/components/Filter/index.js +6 -6
- package/dist/components/Filter/index.js.map +1 -1
- package/dist/components/List/index.js +1 -1
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/Menubar/Menubar.d.ts +2 -2
- package/dist/components/Menubar/index.js +1 -1
- package/dist/components/Menubar/index.js.map +1 -1
- package/dist/components/Table/Table.d.ts +3 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Table/index.js.map +1 -1
- package/dist/index.css +69 -68
- package/dist/index.js.map +1 -1
- package/dist/theme.d.ts +2 -0
- package/package.json +1 -1
|
@@ -11,12 +11,14 @@ type TableProps = {
|
|
|
11
11
|
id?: string;
|
|
12
12
|
className?: string;
|
|
13
13
|
height?: number;
|
|
14
|
+
type?: 'list' | 'card';
|
|
14
15
|
columns: Array<TableColumnProps>;
|
|
15
16
|
data: Array<any>;
|
|
16
17
|
empty?: {
|
|
17
18
|
icon?: React.ReactNode;
|
|
18
19
|
text?: string;
|
|
19
20
|
};
|
|
21
|
+
onRowClick?: (data: any) => void;
|
|
20
22
|
};
|
|
21
|
-
declare const Table: ({ id, className, height, columns, data, empty, }: TableProps) => React.JSX.Element;
|
|
23
|
+
declare const Table: ({ id, className, height, type, columns, data, empty, onRowClick, }: TableProps) => React.JSX.Element;
|
|
22
24
|
export { Table };
|
|
@@ -33,5 +33,5 @@ object-assign
|
|
|
33
33
|
* This source code is licensed under the MIT license found in the
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
function(e,t){const r=jr(e,t);return"production"!==process.env.NODE_ENV?(...t)=>{const n="string"==typeof e?`"${e}"`:"component";return 0===t.length?console.error([`MUI: Seems like you called \`styled(${n})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n")):t.some((e=>void 0===e))&&console.error(`MUI: the styled(${n})(...args) API requires all its args to be defined.`),r(...t)}:r}(e,b({shouldForwardProp:h,label:y},p)),v=e=>"function"==typeof e&&e.__emotion_real!==e||w(e)?n=>qn(e,b({},n,{theme:Gn({theme:n.theme,defaultTheme:r,themeId:t})})):e,E=(n,...o)=>{let a=v(n);const l=o?o.map(v):[];s&&f&&l.push((e=>{const n=Gn(b({},e,{defaultTheme:r,themeId:t}));if(!n.components||!n.components[s]||!n.components[s].styleOverrides)return null;const o=n.components[s].styleOverrides,i={};return Object.entries(o).forEach((([t,r])=>{i[t]=qn(r,b({},e,{theme:n}))})),f(e,i)})),s&&!d&&l.push((e=>{var n;const o=Gn(b({},e,{defaultTheme:r,themeId:t}));return qn({variants:null==o||null==(n=o.components)||null==(n=n[s])?void 0:n.variants},b({},e,{theme:o}))})),m||l.push(i);const u=l.length-o.length;if(Array.isArray(n)&&u>0){const e=new Array(u).fill("");a=[...n,...e],a.raw=[...n.raw,...e]}const p=g(a,...l);if("production"!==process.env.NODE_ENV){let t;s&&(t=`${s}${oe(c||"")}`),void 0===t&&(t=`Styled(${function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return re(e,"Component");if("object"==typeof e)switch(e.$$typeof){case ee.ForwardRef:return ne(e,e.render,"ForwardRef");case ee.Memo:return ne(e,e.type,"memo");default:return}}}(e)})`),p.displayName=t}return e.muiName&&(p.muiName=e.muiName),p};return g.withConfig&&(E.withConfig=g.withConfig),E}}({themeId:Co,defaultTheme:To,rootShouldForwardProp:e=>Un(e)&&"classes"!==e});function Io(e){return Se("MuiSvgIcon",e)}!function(e,t,r="Mui"){const n={};t.forEach((t=>{n[t]=Se(e,t,r)}))}("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Po=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Mo=e=>{const{color:t,fontSize:r,classes:n}=e;return function(e,t,r){const n={};return Object.keys(e).forEach((o=>{n[o]=e[o].reduce(((e,n)=>{if(n){const o=t(n);""!==o&&e.push(o),r&&r[n]&&e.push(r[n])}return e}),[]).join(" ")})),n}({root:["root","inherit"!==t&&`color${oe(t)}`,`fontSize${oe(r)}`]},Io,n)},Ro=jo("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t[`color${oe(r.color)}`],t[`fontSize${oe(r.fontSize)}`]]}})((({theme:e,ownerState:t})=>{var r,n,o,i,a,s,c,l,u,f,p,d,m;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(r=e.transitions)||null==(n=r.create)?void 0:n.call(r,"fill",{duration:null==(o=e.transitions)||null==(o=o.duration)?void 0:o.shorter}),fontSize:{inherit:"inherit",small:(null==(i=e.typography)||null==(a=i.pxToRem)?void 0:a.call(i,20))||"1.25rem",medium:(null==(s=e.typography)||null==(c=s.pxToRem)?void 0:c.call(s,24))||"1.5rem",large:(null==(l=e.typography)||null==(u=l.pxToRem)?void 0:u.call(l,35))||"2.1875rem"}[t.fontSize],color:null!=(f=null==(p=(e.vars||e).palette)||null==(p=p[t.color])?void 0:p.main)?f:{action:null==(d=(e.vars||e).palette)||null==(d=d.action)?void 0:d.active,disabled:null==(m=(e.vars||e).palette)||null==(m=m.action)?void 0:m.disabled,inherit:void 0}[t.color]}})),Vo=e.forwardRef((function(t,r){const n=function({props:e,name:t}){return Hn({props:e,name:t,defaultTheme:To,themeId:Co})}({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:c="inherit",component:l="svg",fontSize:u="medium",htmlColor:f,inheritViewBox:p=!1,titleAccess:d,viewBox:m="0 0 24 24"}=n,y=Oe(n,Po),h=e.isValidElement(o)&&"svg"===o.type,g=b({},n,{color:c,component:l,fontSize:u,instanceFontSize:t.fontSize,inheritViewBox:p,viewBox:m,hasSvgAsChild:h}),v={};p||(v.viewBox=m);const w=Mo(g);return a(Ro,b({as:l,className:Ne(w.root,i),focusable:"false",color:f,"aria-hidden":!d||void 0,role:d?"img":void 0,ref:r},v,y,h&&o.props,{ownerState:g,children:[h?o.props.children:o,d?s("title",{children:d}):null]}))}));"production"!==process.env.NODE_ENV&&(Vo.propTypes={children:q.node,classes:q.object,className:q.string,color:q.oneOfType([q.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),q.string]),component:q.elementType,fontSize:q.oneOfType([q.oneOf(["inherit","large","medium","small"]),q.string]),htmlColor:q.string,inheritViewBox:q.bool,shapeRendering:q.string,sx:q.oneOfType([q.arrayOf(q.oneOfType([q.func,q.object,q.bool])),q.func,q.object]),titleAccess:q.string,viewBox:q.string}),Vo.muiName="SvgIcon";const Do={configure:e=>{"production"!==process.env.NODE_ENV&&console.warn(["MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.","","You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead","","The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401","","The updated documentation: https://mui.com/guides/classname-generator/"].join("\n")),Ee.configure(e)}};var zo,Fo=Object.freeze({__proto__:null,capitalize:oe,createChainedFunction:function(...e){return e.reduce(((e,t)=>null==t?e:function(...r){e.apply(this,r),t.apply(this,r)}),(()=>{}))},createSvgIcon:function(t,r){function n(e,n){return s(Vo,b({"data-testid":`${r}Icon`,ref:n},e,{children:t}))}return"production"!==process.env.NODE_ENV&&(n.displayName=`${r}Icon`),n.muiName=Vo.muiName,e.memo(e.forwardRef(n))},debounce:function(e,t=166){let r;function n(...n){clearTimeout(r),r=setTimeout((()=>{e.apply(this,n)}),t)}return n.clear=()=>{clearTimeout(r)},n},deprecatedPropType:function(e,t){return"production"===process.env.NODE_ENV?()=>null:(e,r,n,o,i)=>{const a=n||"<<anonymous>>",s=i||r;return void 0!==e[r]?new Error(`The ${o} \`${s}\` of \`${a}\` is deprecated. ${t}`):null}},isMuiElement:function(t,r){var n,o;return e.isValidElement(t)&&-1!==r.indexOf(null!=(n=t.type.muiName)?n:null==(o=t.type)||null==(o=o._payload)||null==(o=o.value)?void 0:o.muiName)},ownerDocument:ie,ownerWindow:function(e){return ie(e).defaultView||window},requirePropFactory:function(e,t){if("production"===process.env.NODE_ENV)return()=>null;const r=t?b({},t.propTypes):null;return t=>(n,o,i,a,s,...c)=>{const l=s||o,u=null==r?void 0:r[l];if(u){const e=u(n,o,i,a,s,...c);if(e)return e}return void 0===n[o]||n[t]?null:new Error(`The prop \`${l}\` of \`${e}\` can only be used together with the \`${t}\` prop.`)}},setRef:ae,unstable_ClassNameGenerator:Do,unstable_useEnhancedEffect:se,unstable_useId:function(t){if(void 0!==le){const e=le();return null!=t?t:e}return function(t){const[r,n]=e.useState(t),o=t||r;return e.useEffect((()=>{null==r&&(ce+=1,n(`mui-${ce}`))}),[r]),o}(t)},unsupportedProp:function(e,t,r,n,o){if("production"===process.env.NODE_ENV)return null;const i=o||t;return void 0!==e[t]?new Error(`The prop \`${i}\` is not supported. Please remove it.`):null},useControlled:function({controlled:t,default:r,name:n,state:o="value"}){const{current:i}=e.useRef(void 0!==t),[a,s]=e.useState(r),c=i?t:a;if("production"!==process.env.NODE_ENV){e.useEffect((()=>{i!==(void 0!==t)&&console.error([`MUI: A component is changing the ${i?"":"un"}controlled ${o} state of ${n} to be ${i?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join("\n"))}),[o,n,t]);const{current:a}=e.useRef(r);e.useEffect((()=>{i||a===r||console.error([`MUI: A component is changing the default ${o} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join("\n"))}),[JSON.stringify(r)])}return[c,e.useCallback((e=>{i||s(e)}),[])]},useEventCallback:function(t){const r=e.useRef(t);return se((()=>{r.current=t})),e.useRef(((...e)=>(0,r.current)(...e))).current},useForkRef:function(...t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{ae(t,e)}))}),t)},useIsFocusVisible:function(){const t=e.useCallback((e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",ye,!0),t.addEventListener("mousedown",he,!0),t.addEventListener("pointerdown",he,!0),t.addEventListener("touchstart",he,!0),t.addEventListener("visibilitychange",ge,!0))}),[]),r=e.useRef(!1);return{isFocusVisibleRef:r,onFocus:function(e){return!!ve(e)&&(r.current=!0,!0)},onBlur:function(){return!!r.current&&(pe=!0,de.start(100,(()=>{pe=!1})),r.current=!1,!0)},ref:t}}}),Lo=l(Fo);var Uo=g;Object.defineProperty(y,"__esModule",{value:!0});var Bo=y.default=void 0,Wo=Uo((zo||(zo=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=Lo}(v)),v)),Go=i;Bo=y.default=(0,Wo.default)((0,Go.jsx)("path",{d:"M17.6 10.81 16.19 9.4l3.56-3.55 1.41 1.41c-.11.03-3.56 3.55-3.56 3.55M13 3h-2v5h2zm-6.6 7.81L7.81 9.4 4.26 5.84 2.84 7.26c.11.03 3.56 3.55 3.56 3.55M20 14h-3.42c-.77 1.76-2.54 3-4.58 3s-3.81-1.24-4.58-3H4v5h16zm0-2c1.1 0 2 .9 2 2v5c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2v-5c0-1.1.9-2 2-2h5c0 1.66 1.34 3 3 3s3-1.34 3-3z"}),"UpcomingOutlined");var Ko=function(e){var r=e.id,n=e.className,i=e.height,a=e.columns,s=void 0===a?[]:a,c=e.data,l=void 0===c?[]:c,u=e.empty,f=void 0===u?{icon:void 0,text:"Tabela vazia"}:u,y=o((function(){var e=s.reduce((function(e,t){return e[t.key]=t,e}),{}),r=Object.keys(e),n=l.reduce((function(n,o,i){var a=[];return r.forEach((function(r){var n=e[r]||{},i=n.render,s=n.align;a.push(t.createElement("td",{key:"".concat(r,"-").concat(JSON.stringify(o)),className:"gyramais-table-align-".concat(s||"center")},t.createElement("div",{title:["string","number"].includes(typeof o[r])?i?i(o[r],o):o[r]:""},i?i(o[r],o):o[r])))})),n.push(t.createElement("tr",{key:"".concat(i,"-").concat(JSON.stringify(o))},a)),n}),[]);return n}),[s,l]);return t.createElement("div",{id:r,className:p("gyramais-table-container",n),style:{maxHeight:i||"fit-content"}},t.createElement("table",null,t.createElement("thead",null,t.createElement("tr",null,s.map((function(e){return t.createElement("th",{key:e.key,className:"gyramais-table-align-".concat(e.align||"center"),style:{width:e.width||"max-content"}},e.header)})))),t.createElement("tbody",null,y)),0===l.length&&t.createElement(d,{columns:1,gap:8,className:"gyramais-table-empty-container"},t.createElement(m,{span:1,className:"gyramais-table-empty-icon"},f.icon||t.createElement(Bo,null)),t.createElement(m,{span:1,className:"gyramais-table-empty-text"},f.text)))};export{Ko as Table};
|
|
36
|
+
function(e,t){const r=jr(e,t);return"production"!==process.env.NODE_ENV?(...t)=>{const n="string"==typeof e?`"${e}"`:"component";return 0===t.length?console.error([`MUI: Seems like you called \`styled(${n})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n")):t.some((e=>void 0===e))&&console.error(`MUI: the styled(${n})(...args) API requires all its args to be defined.`),r(...t)}:r}(e,b({shouldForwardProp:h,label:y},p)),v=e=>"function"==typeof e&&e.__emotion_real!==e||w(e)?n=>qn(e,b({},n,{theme:Gn({theme:n.theme,defaultTheme:r,themeId:t})})):e,E=(n,...o)=>{let a=v(n);const l=o?o.map(v):[];s&&f&&l.push((e=>{const n=Gn(b({},e,{defaultTheme:r,themeId:t}));if(!n.components||!n.components[s]||!n.components[s].styleOverrides)return null;const o=n.components[s].styleOverrides,i={};return Object.entries(o).forEach((([t,r])=>{i[t]=qn(r,b({},e,{theme:n}))})),f(e,i)})),s&&!d&&l.push((e=>{var n;const o=Gn(b({},e,{defaultTheme:r,themeId:t}));return qn({variants:null==o||null==(n=o.components)||null==(n=n[s])?void 0:n.variants},b({},e,{theme:o}))})),m||l.push(i);const u=l.length-o.length;if(Array.isArray(n)&&u>0){const e=new Array(u).fill("");a=[...n,...e],a.raw=[...n.raw,...e]}const p=g(a,...l);if("production"!==process.env.NODE_ENV){let t;s&&(t=`${s}${oe(c||"")}`),void 0===t&&(t=`Styled(${function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return re(e,"Component");if("object"==typeof e)switch(e.$$typeof){case ee.ForwardRef:return ne(e,e.render,"ForwardRef");case ee.Memo:return ne(e,e.type,"memo");default:return}}}(e)})`),p.displayName=t}return e.muiName&&(p.muiName=e.muiName),p};return g.withConfig&&(E.withConfig=g.withConfig),E}}({themeId:Co,defaultTheme:To,rootShouldForwardProp:e=>Un(e)&&"classes"!==e});function Io(e){return Se("MuiSvgIcon",e)}!function(e,t,r="Mui"){const n={};t.forEach((t=>{n[t]=Se(e,t,r)}))}("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Po=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Mo=e=>{const{color:t,fontSize:r,classes:n}=e;return function(e,t,r){const n={};return Object.keys(e).forEach((o=>{n[o]=e[o].reduce(((e,n)=>{if(n){const o=t(n);""!==o&&e.push(o),r&&r[n]&&e.push(r[n])}return e}),[]).join(" ")})),n}({root:["root","inherit"!==t&&`color${oe(t)}`,`fontSize${oe(r)}`]},Io,n)},Ro=jo("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t[`color${oe(r.color)}`],t[`fontSize${oe(r.fontSize)}`]]}})((({theme:e,ownerState:t})=>{var r,n,o,i,a,s,c,l,u,f,p,d,m;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(r=e.transitions)||null==(n=r.create)?void 0:n.call(r,"fill",{duration:null==(o=e.transitions)||null==(o=o.duration)?void 0:o.shorter}),fontSize:{inherit:"inherit",small:(null==(i=e.typography)||null==(a=i.pxToRem)?void 0:a.call(i,20))||"1.25rem",medium:(null==(s=e.typography)||null==(c=s.pxToRem)?void 0:c.call(s,24))||"1.5rem",large:(null==(l=e.typography)||null==(u=l.pxToRem)?void 0:u.call(l,35))||"2.1875rem"}[t.fontSize],color:null!=(f=null==(p=(e.vars||e).palette)||null==(p=p[t.color])?void 0:p.main)?f:{action:null==(d=(e.vars||e).palette)||null==(d=d.action)?void 0:d.active,disabled:null==(m=(e.vars||e).palette)||null==(m=m.action)?void 0:m.disabled,inherit:void 0}[t.color]}})),Vo=e.forwardRef((function(t,r){const n=function({props:e,name:t}){return Hn({props:e,name:t,defaultTheme:To,themeId:Co})}({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:c="inherit",component:l="svg",fontSize:u="medium",htmlColor:f,inheritViewBox:p=!1,titleAccess:d,viewBox:m="0 0 24 24"}=n,y=Oe(n,Po),h=e.isValidElement(o)&&"svg"===o.type,g=b({},n,{color:c,component:l,fontSize:u,instanceFontSize:t.fontSize,inheritViewBox:p,viewBox:m,hasSvgAsChild:h}),v={};p||(v.viewBox=m);const w=Mo(g);return a(Ro,b({as:l,className:Ne(w.root,i),focusable:"false",color:f,"aria-hidden":!d||void 0,role:d?"img":void 0,ref:r},v,y,h&&o.props,{ownerState:g,children:[h?o.props.children:o,d?s("title",{children:d}):null]}))}));"production"!==process.env.NODE_ENV&&(Vo.propTypes={children:q.node,classes:q.object,className:q.string,color:q.oneOfType([q.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),q.string]),component:q.elementType,fontSize:q.oneOfType([q.oneOf(["inherit","large","medium","small"]),q.string]),htmlColor:q.string,inheritViewBox:q.bool,shapeRendering:q.string,sx:q.oneOfType([q.arrayOf(q.oneOfType([q.func,q.object,q.bool])),q.func,q.object]),titleAccess:q.string,viewBox:q.string}),Vo.muiName="SvgIcon";const Do={configure:e=>{"production"!==process.env.NODE_ENV&&console.warn(["MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.","","You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead","","The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401","","The updated documentation: https://mui.com/guides/classname-generator/"].join("\n")),Ee.configure(e)}};var zo,Fo=Object.freeze({__proto__:null,capitalize:oe,createChainedFunction:function(...e){return e.reduce(((e,t)=>null==t?e:function(...r){e.apply(this,r),t.apply(this,r)}),(()=>{}))},createSvgIcon:function(t,r){function n(e,n){return s(Vo,b({"data-testid":`${r}Icon`,ref:n},e,{children:t}))}return"production"!==process.env.NODE_ENV&&(n.displayName=`${r}Icon`),n.muiName=Vo.muiName,e.memo(e.forwardRef(n))},debounce:function(e,t=166){let r;function n(...n){clearTimeout(r),r=setTimeout((()=>{e.apply(this,n)}),t)}return n.clear=()=>{clearTimeout(r)},n},deprecatedPropType:function(e,t){return"production"===process.env.NODE_ENV?()=>null:(e,r,n,o,i)=>{const a=n||"<<anonymous>>",s=i||r;return void 0!==e[r]?new Error(`The ${o} \`${s}\` of \`${a}\` is deprecated. ${t}`):null}},isMuiElement:function(t,r){var n,o;return e.isValidElement(t)&&-1!==r.indexOf(null!=(n=t.type.muiName)?n:null==(o=t.type)||null==(o=o._payload)||null==(o=o.value)?void 0:o.muiName)},ownerDocument:ie,ownerWindow:function(e){return ie(e).defaultView||window},requirePropFactory:function(e,t){if("production"===process.env.NODE_ENV)return()=>null;const r=t?b({},t.propTypes):null;return t=>(n,o,i,a,s,...c)=>{const l=s||o,u=null==r?void 0:r[l];if(u){const e=u(n,o,i,a,s,...c);if(e)return e}return void 0===n[o]||n[t]?null:new Error(`The prop \`${l}\` of \`${e}\` can only be used together with the \`${t}\` prop.`)}},setRef:ae,unstable_ClassNameGenerator:Do,unstable_useEnhancedEffect:se,unstable_useId:function(t){if(void 0!==le){const e=le();return null!=t?t:e}return function(t){const[r,n]=e.useState(t),o=t||r;return e.useEffect((()=>{null==r&&(ce+=1,n(`mui-${ce}`))}),[r]),o}(t)},unsupportedProp:function(e,t,r,n,o){if("production"===process.env.NODE_ENV)return null;const i=o||t;return void 0!==e[t]?new Error(`The prop \`${i}\` is not supported. Please remove it.`):null},useControlled:function({controlled:t,default:r,name:n,state:o="value"}){const{current:i}=e.useRef(void 0!==t),[a,s]=e.useState(r),c=i?t:a;if("production"!==process.env.NODE_ENV){e.useEffect((()=>{i!==(void 0!==t)&&console.error([`MUI: A component is changing the ${i?"":"un"}controlled ${o} state of ${n} to be ${i?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join("\n"))}),[o,n,t]);const{current:a}=e.useRef(r);e.useEffect((()=>{i||a===r||console.error([`MUI: A component is changing the default ${o} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join("\n"))}),[JSON.stringify(r)])}return[c,e.useCallback((e=>{i||s(e)}),[])]},useEventCallback:function(t){const r=e.useRef(t);return se((()=>{r.current=t})),e.useRef(((...e)=>(0,r.current)(...e))).current},useForkRef:function(...t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{ae(t,e)}))}),t)},useIsFocusVisible:function(){const t=e.useCallback((e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",ye,!0),t.addEventListener("mousedown",he,!0),t.addEventListener("pointerdown",he,!0),t.addEventListener("touchstart",he,!0),t.addEventListener("visibilitychange",ge,!0))}),[]),r=e.useRef(!1);return{isFocusVisibleRef:r,onFocus:function(e){return!!ve(e)&&(r.current=!0,!0)},onBlur:function(){return!!r.current&&(pe=!0,de.start(100,(()=>{pe=!1})),r.current=!1,!0)},ref:t}}}),Lo=l(Fo);var Uo=g;Object.defineProperty(y,"__esModule",{value:!0});var Bo=y.default=void 0,Wo=Uo((zo||(zo=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=Lo}(v)),v)),Go=i;Bo=y.default=(0,Wo.default)((0,Go.jsx)("path",{d:"M17.6 10.81 16.19 9.4l3.56-3.55 1.41 1.41c-.11.03-3.56 3.55-3.56 3.55M13 3h-2v5h2zm-6.6 7.81L7.81 9.4 4.26 5.84 2.84 7.26c.11.03 3.56 3.55 3.56 3.55M20 14h-3.42c-.77 1.76-2.54 3-4.58 3s-3.81-1.24-4.58-3H4v5h16zm0-2c1.1 0 2 .9 2 2v5c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2v-5c0-1.1.9-2 2-2h5c0 1.66 1.34 3 3 3s3-1.34 3-3z"}),"UpcomingOutlined");var Ko=function(e){var r=e.id,n=e.className,i=e.height,a=e.type,s=void 0===a?"list":a,c=e.columns,l=void 0===c?[]:c,u=e.data,f=void 0===u?[]:u,y=e.empty,h=void 0===y?{icon:void 0,text:"Tabela vazia"}:y,g=e.onRowClick,v=o((function(){var e=l.reduce((function(e,t){return e[t.key]=t,e}),{}),r=Object.keys(e),n=f.reduce((function(n,o,i){var a=[];return r.forEach((function(r){var n=e[r]||{},i=n.render,s=n.align;a.push(t.createElement("td",{key:"".concat(r,"-").concat(JSON.stringify(o)),className:"gyramais-table-align-".concat(s||"center")},t.createElement("div",{title:["string","number"].includes(typeof o[r])?i?i(o[r],o):o[r]:""},i?i(o[r],o):o[r])))})),n.push(t.createElement("tr",{key:"".concat(i,"-").concat(JSON.stringify(o)),onClick:function(){return null==g?void 0:g(o)}},a)),n}),[]);return n}),[l,f]);return t.createElement("div",{id:r,className:p("gyramais-table-container","card"===s?"gyramais-table-card-container":"",n),style:{maxHeight:i||"fit-content"}},t.createElement("table",null,t.createElement("thead",null,t.createElement("tr",null,l.map((function(e){return t.createElement("th",{key:e.key,className:"gyramais-table-align-".concat(e.align||"center"),style:{width:e.width||"max-content"}},e.header)})))),t.createElement("tbody",null,v)),0===f.length&&t.createElement(d,{columns:1,gap:8,className:"gyramais-table-empty-container"},t.createElement(m,{span:1,className:"gyramais-table-empty-icon"},h.icon||t.createElement(Bo,null)),t.createElement(m,{span:1,className:"gyramais-table-empty-text"},h.text)))};export{Ko as Table};
|
|
37
37
|
//# sourceMappingURL=index.js.map
|