@greenbone/ui-lib 2.1.0 → 2.1.1
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/lib/cjs/components/Accordion/Accordion.js +1 -1
- package/lib/cjs/components/Accordion/Accordion.js.map +1 -1
- package/lib/cjs/components/Alert/Alert.js +1 -1
- package/lib/cjs/components/Alert/Alert.js.map +1 -1
- package/lib/cjs/components/ConfirmationDialog/ConfirmationDialog.js +1 -1
- package/lib/cjs/components/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
- package/lib/cjs/components/Drawer/Drawer.js +1 -1
- package/lib/cjs/components/Drawer/Drawer.js.map +1 -1
- package/lib/cjs/components/Filter/TermContainer/Term/TermBadge.js +1 -1
- package/lib/cjs/components/Filter/TermContainer/Term/TermBadge.js.map +1 -1
- package/lib/cjs/components/Filter/persistence/FilterPersistent.js +1 -1
- package/lib/cjs/components/Filter/persistence/FilterPersistent.js.map +1 -1
- package/lib/cjs/components/Filter/utils/FilterSelect.js +1 -1
- package/lib/cjs/components/Filter/utils/FilterSelect.js.map +1 -1
- package/lib/cjs/components/Filter/utils/Select.js +1 -1
- package/lib/cjs/components/Filter/utils/Select.js.map +1 -1
- package/lib/cjs/components/Form/Button/Button.js +1 -1
- package/lib/cjs/components/Form/Button/Button.js.map +1 -1
- package/lib/cjs/components/Form/Checkbox/Checkbox.js +1 -1
- package/lib/cjs/components/Form/Checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/components/Form/DateTimePicker/DateTimePicker.js +1 -1
- package/lib/cjs/components/Form/DateTimePicker/DateTimePicker.js.map +1 -1
- package/lib/cjs/components/Form/DateTimePicker/TimePicker.js +1 -1
- package/lib/cjs/components/Form/DateTimePicker/TimePicker.js.map +1 -1
- package/lib/cjs/components/Form/FileInput/FileInput.js +1 -1
- package/lib/cjs/components/Form/FileInput/FileInput.js.map +1 -1
- package/lib/cjs/components/Form/Form/Form.js +1 -1
- package/lib/cjs/components/Form/Form/Form.js.map +1 -1
- package/lib/cjs/components/Form/Input/Input.js +1 -1
- package/lib/cjs/components/Form/Input/Input.js.map +1 -1
- package/lib/cjs/components/Form/MenuButton/index.js +1 -1
- package/lib/cjs/components/Form/MenuButton/index.js.map +1 -1
- package/lib/cjs/components/Form/PasswordInput/PasswordInput.js +1 -1
- package/lib/cjs/components/Form/PasswordInput/PasswordInput.js.map +1 -1
- package/lib/cjs/components/Form/RadioButton/RadioButton.js +1 -1
- package/lib/cjs/components/Form/RadioButton/RadioButton.js.map +1 -1
- package/lib/cjs/components/Form/Select/Cascade/CascadeMenu.js +1 -1
- package/lib/cjs/components/Form/Select/Cascade/CascadeMenu.js.map +1 -1
- package/lib/cjs/components/Form/Select/Cascade/CascadeOption.js +1 -1
- package/lib/cjs/components/Form/Select/Cascade/CascadeOption.js.map +1 -1
- package/lib/cjs/components/Form/Select/Cascade/index.js +1 -1
- package/lib/cjs/components/Form/Select/Cascade/index.js.map +1 -1
- package/lib/cjs/components/Form/Select/CreatableSelect.js +1 -1
- package/lib/cjs/components/Form/Select/CreatableSelect.js.map +1 -1
- package/lib/cjs/components/Form/Select/Select.js +1 -1
- package/lib/cjs/components/Form/Select/Select.js.map +1 -1
- package/lib/cjs/components/Form/Switch/Switch.js +1 -1
- package/lib/cjs/components/Form/Switch/Switch.js.map +1 -1
- package/lib/cjs/components/Form/Textarea/Textarea.js +1 -1
- package/lib/cjs/components/Form/Textarea/Textarea.js.map +1 -1
- package/lib/cjs/components/Icon/Icon.js +1 -1
- package/lib/cjs/components/Icon/Icon.js.map +1 -1
- package/lib/cjs/components/InfoTip/InfoTip.js +1 -1
- package/lib/cjs/components/InfoTip/InfoTip.js.map +1 -1
- package/lib/cjs/components/InformationList/InformationList.js +1 -1
- package/lib/cjs/components/InformationList/InformationList.js.map +1 -1
- package/lib/cjs/components/Layout/AppNavigation/AppNavigationLink.js +1 -1
- package/lib/cjs/components/Layout/AppNavigation/AppNavigationLink.js.map +1 -1
- package/lib/cjs/components/Layout/SimplePageLayout/SimpleGrid.js +1 -1
- package/lib/cjs/components/Layout/SimplePageLayout/SimpleGrid.js.map +1 -1
- package/lib/cjs/components/Layout/SimplePageLayout/index.js +1 -1
- package/lib/cjs/components/Layout/SimplePageLayout/index.js.map +1 -1
- package/lib/cjs/components/Modal/Modal.js +1 -1
- package/lib/cjs/components/Modal/Modal.js.map +1 -1
- package/lib/cjs/components/Notification/notifications.js +1 -1
- package/lib/cjs/components/Notification/notifications.js.map +1 -1
- package/lib/cjs/components/Table/TableClientSide/TableClientSidePersistent/index.js +1 -1
- package/lib/cjs/components/Table/TableClientSide/TableClientSidePersistent/index.js.map +1 -1
- package/lib/cjs/components/Table/TableServerSide/TableServerSidePersistent/index.js +1 -1
- package/lib/cjs/components/Table/TableServerSide/TableServerSidePersistent/index.js.map +1 -1
- package/lib/cjs/components/Table/components/ActionMenu/ActionMenu.js +1 -1
- package/lib/cjs/components/Table/components/ActionMenu/ActionMenu.js.map +1 -1
- package/lib/cjs/components/Table/index.js +1 -1
- package/lib/cjs/components/Table/index.js.map +1 -1
- package/lib/cjs/components/Tag/Tag.js +1 -1
- package/lib/cjs/components/Tag/Tag.js.map +1 -1
- package/lib/cjs/components/TimeZoneInfo/index.js +1 -1
- package/lib/cjs/components/TimeZoneInfo/index.js.map +1 -1
- package/lib/cjs/components/Tooltip/Tooltip.js +1 -1
- package/lib/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/cjs/components/Typo/Typo.js +1 -1
- package/lib/cjs/components/Typo/Typo.js.map +1 -1
- package/lib/cjs/icons/StatusIcon/StatusIcon.js +1 -1
- package/lib/cjs/icons/StatusIcon/StatusIcon.js.map +1 -1
- package/lib/esm/components/Accordion/Accordion.js +1 -1
- package/lib/esm/components/Accordion/Accordion.js.map +1 -1
- package/lib/esm/components/Alert/Alert.js +1 -1
- package/lib/esm/components/Alert/Alert.js.map +1 -1
- package/lib/esm/components/ConfirmationDialog/ConfirmationDialog.js +1 -1
- package/lib/esm/components/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
- package/lib/esm/components/Drawer/Drawer.js +1 -1
- package/lib/esm/components/Drawer/Drawer.js.map +1 -1
- package/lib/esm/components/Filter/TermContainer/Term/TermBadge.js +1 -1
- package/lib/esm/components/Filter/TermContainer/Term/TermBadge.js.map +1 -1
- package/lib/esm/components/Filter/persistence/FilterPersistent.js +1 -1
- package/lib/esm/components/Filter/persistence/FilterPersistent.js.map +1 -1
- package/lib/esm/components/Filter/utils/FilterSelect.js +1 -1
- package/lib/esm/components/Filter/utils/FilterSelect.js.map +1 -1
- package/lib/esm/components/Filter/utils/Select.js +1 -1
- package/lib/esm/components/Filter/utils/Select.js.map +1 -1
- package/lib/esm/components/Form/Button/Button.js +1 -1
- package/lib/esm/components/Form/Button/Button.js.map +1 -1
- package/lib/esm/components/Form/Checkbox/Checkbox.js +1 -1
- package/lib/esm/components/Form/Checkbox/Checkbox.js.map +1 -1
- package/lib/esm/components/Form/DateTimePicker/DateTimePicker.js +1 -1
- package/lib/esm/components/Form/DateTimePicker/DateTimePicker.js.map +1 -1
- package/lib/esm/components/Form/DateTimePicker/TimePicker.js +1 -1
- package/lib/esm/components/Form/DateTimePicker/TimePicker.js.map +1 -1
- package/lib/esm/components/Form/FileInput/FileInput.js +1 -1
- package/lib/esm/components/Form/FileInput/FileInput.js.map +1 -1
- package/lib/esm/components/Form/Form/Form.js +1 -1
- package/lib/esm/components/Form/Form/Form.js.map +1 -1
- package/lib/esm/components/Form/Input/Input.js +1 -1
- package/lib/esm/components/Form/Input/Input.js.map +1 -1
- package/lib/esm/components/Form/MenuButton/index.js +1 -1
- package/lib/esm/components/Form/MenuButton/index.js.map +1 -1
- package/lib/esm/components/Form/PasswordInput/PasswordInput.js +1 -1
- package/lib/esm/components/Form/PasswordInput/PasswordInput.js.map +1 -1
- package/lib/esm/components/Form/RadioButton/RadioButton.js +1 -1
- package/lib/esm/components/Form/RadioButton/RadioButton.js.map +1 -1
- package/lib/esm/components/Form/Select/Cascade/CascadeMenu.js +1 -1
- package/lib/esm/components/Form/Select/Cascade/CascadeMenu.js.map +1 -1
- package/lib/esm/components/Form/Select/Cascade/CascadeOption.js +1 -1
- package/lib/esm/components/Form/Select/Cascade/CascadeOption.js.map +1 -1
- package/lib/esm/components/Form/Select/Cascade/index.js +1 -1
- package/lib/esm/components/Form/Select/Cascade/index.js.map +1 -1
- package/lib/esm/components/Form/Select/CreatableSelect.js +1 -1
- package/lib/esm/components/Form/Select/CreatableSelect.js.map +1 -1
- package/lib/esm/components/Form/Select/Select.js +1 -1
- package/lib/esm/components/Form/Select/Select.js.map +1 -1
- package/lib/esm/components/Form/Switch/Switch.js +1 -1
- package/lib/esm/components/Form/Switch/Switch.js.map +1 -1
- package/lib/esm/components/Form/Textarea/Textarea.js +1 -1
- package/lib/esm/components/Form/Textarea/Textarea.js.map +1 -1
- package/lib/esm/components/Icon/Icon.js +1 -1
- package/lib/esm/components/Icon/Icon.js.map +1 -1
- package/lib/esm/components/InfoTip/InfoTip.js +1 -1
- package/lib/esm/components/InfoTip/InfoTip.js.map +1 -1
- package/lib/esm/components/InformationList/InformationList.js +1 -1
- package/lib/esm/components/InformationList/InformationList.js.map +1 -1
- package/lib/esm/components/Layout/AppNavigation/AppNavigationLink.js +1 -1
- package/lib/esm/components/Layout/AppNavigation/AppNavigationLink.js.map +1 -1
- package/lib/esm/components/Layout/SimplePageLayout/SimpleGrid.js +1 -1
- package/lib/esm/components/Layout/SimplePageLayout/SimpleGrid.js.map +1 -1
- package/lib/esm/components/Layout/SimplePageLayout/index.js +1 -1
- package/lib/esm/components/Layout/SimplePageLayout/index.js.map +1 -1
- package/lib/esm/components/Modal/Modal.js +1 -1
- package/lib/esm/components/Modal/Modal.js.map +1 -1
- package/lib/esm/components/Notification/notifications.js +1 -1
- package/lib/esm/components/Notification/notifications.js.map +1 -1
- package/lib/esm/components/Table/TableClientSide/TableClientSidePersistent/index.js +1 -1
- package/lib/esm/components/Table/TableClientSide/TableClientSidePersistent/index.js.map +1 -1
- package/lib/esm/components/Table/TableServerSide/TableServerSidePersistent/index.js +1 -1
- package/lib/esm/components/Table/TableServerSide/TableServerSidePersistent/index.js.map +1 -1
- package/lib/esm/components/Table/components/ActionMenu/ActionMenu.js +1 -1
- package/lib/esm/components/Table/components/ActionMenu/ActionMenu.js.map +1 -1
- package/lib/esm/components/Table/index.js +1 -1
- package/lib/esm/components/Table/index.js.map +1 -1
- package/lib/esm/components/Tag/Tag.js +1 -1
- package/lib/esm/components/Tag/Tag.js.map +1 -1
- package/lib/esm/components/TimeZoneInfo/index.js +1 -1
- package/lib/esm/components/TimeZoneInfo/index.js.map +1 -1
- package/lib/esm/components/Tooltip/Tooltip.js +1 -1
- package/lib/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/esm/components/Typo/Typo.js +1 -1
- package/lib/esm/components/Typo/Typo.js.map +1 -1
- package/lib/esm/icons/StatusIcon/StatusIcon.js +1 -1
- package/lib/esm/icons/StatusIcon/StatusIcon.js.map +1 -1
- package/package.json +24 -24
- package/types/src/components/Table/index.d.ts +2 -0
- package/types/src/components/Table/index.d.ts.map +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"InformationList",{enumerable:true,get:function(){return InformationList}});const _jsxruntime=require("react/jsx-runtime");const _react=require("react");const _Typo=require("../Typo");const _InformationListmodulecss=/*#__PURE__*/_interop_require_default(require("./InformationList.module.css"));const _cx=require("../../helper/cx");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const getLargestRow=rows=>{return rows.reduce((acc,curr)=>{if(curr.length>acc)return curr.length;return acc},0)};const buildFillerColumns=(rowItems,largestRowItems)=>{const filler=[];if(rowItems<largestRowItems){const delta=largestRowItems-rowItems;for(let i=0;i<delta;i++){filler.push((0,_jsxruntime.jsx)("span",{},i))}}return filler.length?filler:null};const InformationList=_0=>{let{firstColumnBold=true}=_0,props=_object_without_properties(_0,["firstColumnBold"]);const columnsAmount=getLargestRow(props.items);const rowAmount=props.items.length;const firstColumFontWeight=firstColumnBold?500:"inherit";return(0,_jsxruntime.jsx)("div",{className:(0,_cx.cx)(_InformationListmodulecss.default.list,props.classname),style:{display:"grid",columnGap:props.columnGap||"var(--mantine-spacing-md)",rowGap:props.rowGap||"var(--mantine-spacing-xs)",gridTemplateColumns:`repeat(${columnsAmount}, fit-content(${100/columnsAmount}%))`,gridTemplateRows:`repeat(${rowAmount}, 1fr)`},children:props.items.map((rowItems,rowIndex)=>(0,_jsxruntime.jsxs)(_react.Fragment,{children:[rowItems.map((item,colIndex)=>(0,_react.createElement)(_Typo.Typo,_object_spread_props(_object_spread({miw:colIndex===0?props.firstColumnMinWidth:undefined,type:"body",fw:colIndex===0?firstColumFontWeight:"inherit"},props.typoWrapperProps),{key:`${rowIndex}-${colIndex}`,className:_InformationListmodulecss.default.cell}),item)),buildFillerColumns(rowItems.length,columnsAmount)]},rowIndex))})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"InformationList",{enumerable:true,get:function(){return InformationList}});const _jsxruntime=require("react/jsx-runtime");const _react=require("react");const _Typo=require("../Typo");const _InformationListmodulecss=/*#__PURE__*/_interop_require_default(require("./InformationList.module.css"));const _cx=require("../../helper/cx");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const getLargestRow=rows=>{return rows.reduce((acc,curr)=>{if(curr.length>acc)return curr.length;return acc},0)};const buildFillerColumns=(rowItems,largestRowItems)=>{const filler=[];if(rowItems<largestRowItems){const delta=largestRowItems-rowItems;for(let i=0;i<delta;i++){filler.push((0,_jsxruntime.jsx)("span",{},i))}}return filler.length?filler:null};const InformationList=_0=>{let{firstColumnBold=true}=_0,props=_object_without_properties(_0,["firstColumnBold"]);const columnsAmount=getLargestRow(props.items);const rowAmount=props.items.length;const firstColumFontWeight=firstColumnBold?500:"inherit";return(0,_jsxruntime.jsx)("div",{className:(0,_cx.cx)(_InformationListmodulecss.default.list,props.classname),style:{display:"grid",columnGap:props.columnGap||"var(--mantine-spacing-md)",rowGap:props.rowGap||"var(--mantine-spacing-xs)",gridTemplateColumns:`repeat(${columnsAmount}, fit-content(${100/columnsAmount}%))`,gridTemplateRows:`repeat(${rowAmount}, 1fr)`},children:props.items.map((rowItems,rowIndex)=>(0,_jsxruntime.jsxs)(_react.Fragment,{children:[rowItems.map((item,colIndex)=>(0,_react.createElement)(_Typo.Typo,_object_spread_props(_object_spread({miw:colIndex===0?props.firstColumnMinWidth:undefined,type:"body",fw:colIndex===0?firstColumFontWeight:"inherit"},props.typoWrapperProps),{key:`${rowIndex}-${colIndex}`,className:_InformationListmodulecss.default.cell}),item)),buildFillerColumns(rowItems.length,columnsAmount)]},rowIndex))})};
|
|
2
2
|
//# sourceMappingURL=InformationList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/InformationList/InformationList.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { FC, Fragment, ReactNode } from \"react\"\nimport { TTypoProps, Typo } from \"../Typo\"\nimport classes from \"./InformationList.module.css\"\nimport { cx } from \"../../helper/cx\"\n\ntype TSharedDesignProps = {\n rowGap?: string\n columnGap?: string\n}\n\ntype TInformationListDesignProps = TSharedDesignProps & {\n firstColumnMinWidth?: string | number\n typoWrapperProps?: Partial<TTypoProps>\n classname?: string\n}\n\nexport type TInformationListItems = Array<(ReactNode | string)[]>\n\nexport type TInformationListProps = TInformationListDesignProps & {\n items: TInformationListItems\n firstColumnBold?: boolean\n}\n\nconst getLargestRow = (rows: TInformationListItems) => {\n return rows.reduce((acc, curr) => {\n if (curr.length > acc) return curr.length\n return acc\n }, 0)\n}\n\nconst buildFillerColumns = (rowItems: number, largestRowItems: number): ReactNode | null => {\n const filler: ReactNode[] = []\n if (rowItems < largestRowItems) {\n const delta = largestRowItems - rowItems\n for (let i = 0; i < delta; i++) {\n filler.push(<span key={i}></span>)\n }\n }\n return filler.length ? filler : null\n}\n\n/**\n * Provides an arranged list of information giving a table like appearance\n * @param firstColumnBold Controls whether the first column should be written in bold letters\n * @param firstColumnMinWidth If defined it sets the first column's minimal width\n * @param typoWrapperProps Props to change font appearance as defined in TTypoProps\n * @param classname Class name for additional styles\n */\nexport const InformationList: FC<TInformationListProps> = ({\n firstColumnBold = true,\n ...props\n}) => {\n const columnsAmount = getLargestRow(props.items)\n\n const rowAmount = props.items.length\n\n const firstColumFontWeight = firstColumnBold ? 500 : \"inherit\"\n\n return (\n <div\n className={cx(classes.list, props.classname)}\n style={{\n display: \"grid\",\n columnGap: props.columnGap || \"var(--mantine-spacing-md)\",\n rowGap: props.rowGap || \"var(--mantine-spacing-xs)\",\n gridTemplateColumns: `repeat(${columnsAmount}, fit-content(${100 / columnsAmount}%))`,\n gridTemplateRows: `repeat(${rowAmount}, 1fr)`,\n }}\n >\n {props.items.map((rowItems, rowIndex) => (\n <Fragment key={rowIndex}>\n {rowItems.map((item, colIndex) => (\n <Typo\n miw={colIndex === 0 ? props.firstColumnMinWidth : undefined}\n type={\"body\"}\n fw={colIndex === 0 ? firstColumFontWeight : \"inherit\"}\n {...props.typoWrapperProps}\n key={`${rowIndex}-${colIndex}`}\n className={classes.cell}\n >\n {item}\n </Typo>\n ))}\n {buildFillerColumns(rowItems.length, columnsAmount)}\n </Fragment>\n ))}\n </div>\n )\n}\n"],"names":["InformationList","getLargestRow","rows","reduce","acc","curr","length","buildFillerColumns","rowItems","largestRowItems","filler","delta","i","push","span","firstColumnBold","props","columnsAmount","items","rowAmount","firstColumFontWeight","div","className","cx","classes","list","classname","style","display","columnGap","rowGap","gridTemplateColumns","gridTemplateRows","map","rowIndex","Fragment","item","colIndex","Typo","miw","firstColumnMinWidth","undefined","type","fw","typoWrapperProps","key","cell"],"mappings":"oGAoDaA,yDAAAA,uFAhD2B,6BACP,yFACb,mDACD,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/InformationList/InformationList.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { FC, Fragment, ReactNode } from \"react\"\nimport { TTypoProps, Typo } from \"../Typo\"\nimport classes from \"./InformationList.module.css\"\nimport { cx } from \"../../helper/cx\"\n\ntype TSharedDesignProps = {\n rowGap?: string\n columnGap?: string\n}\n\ntype TInformationListDesignProps = TSharedDesignProps & {\n firstColumnMinWidth?: string | number\n typoWrapperProps?: Partial<TTypoProps>\n classname?: string\n}\n\nexport type TInformationListItems = Array<(ReactNode | string)[]>\n\nexport type TInformationListProps = TInformationListDesignProps & {\n items: TInformationListItems\n firstColumnBold?: boolean\n}\n\nconst getLargestRow = (rows: TInformationListItems) => {\n return rows.reduce((acc, curr) => {\n if (curr.length > acc) return curr.length\n return acc\n }, 0)\n}\n\nconst buildFillerColumns = (rowItems: number, largestRowItems: number): ReactNode | null => {\n const filler: ReactNode[] = []\n if (rowItems < largestRowItems) {\n const delta = largestRowItems - rowItems\n for (let i = 0; i < delta; i++) {\n filler.push(<span key={i}></span>)\n }\n }\n return filler.length ? filler : null\n}\n\n/**\n * Provides an arranged list of information giving a table like appearance\n * @param firstColumnBold Controls whether the first column should be written in bold letters\n * @param firstColumnMinWidth If defined it sets the first column's minimal width\n * @param typoWrapperProps Props to change font appearance as defined in TTypoProps\n * @param classname Class name for additional styles\n */\nexport const InformationList: FC<TInformationListProps> = ({\n firstColumnBold = true,\n ...props\n}) => {\n const columnsAmount = getLargestRow(props.items)\n\n const rowAmount = props.items.length\n\n const firstColumFontWeight = firstColumnBold ? 500 : \"inherit\"\n\n return (\n <div\n className={cx(classes.list, props.classname)}\n style={{\n display: \"grid\",\n columnGap: props.columnGap || \"var(--mantine-spacing-md)\",\n rowGap: props.rowGap || \"var(--mantine-spacing-xs)\",\n gridTemplateColumns: `repeat(${columnsAmount}, fit-content(${100 / columnsAmount}%))`,\n gridTemplateRows: `repeat(${rowAmount}, 1fr)`,\n }}\n >\n {props.items.map((rowItems, rowIndex) => (\n <Fragment key={rowIndex}>\n {rowItems.map((item, colIndex) => (\n <Typo\n miw={colIndex === 0 ? props.firstColumnMinWidth : undefined}\n type={\"body\"}\n fw={colIndex === 0 ? firstColumFontWeight : \"inherit\"}\n {...props.typoWrapperProps}\n key={`${rowIndex}-${colIndex}`}\n className={classes.cell}\n >\n {item}\n </Typo>\n ))}\n {buildFillerColumns(rowItems.length, columnsAmount)}\n </Fragment>\n ))}\n </div>\n )\n}\n"],"names":["InformationList","getLargestRow","rows","reduce","acc","curr","length","buildFillerColumns","rowItems","largestRowItems","filler","delta","i","push","span","firstColumnBold","props","columnsAmount","items","rowAmount","firstColumFontWeight","div","className","cx","classes","list","classname","style","display","columnGap","rowGap","gridTemplateColumns","gridTemplateRows","map","rowIndex","Fragment","item","colIndex","Typo","miw","firstColumnMinWidth","undefined","type","fw","typoWrapperProps","key","cell"],"mappings":"oGAoDaA,yDAAAA,uFAhD2B,6BACP,yFACb,mDACD,+3EAoBnB,MAAMC,cAAgB,AAACC,OACrB,OAAOA,KAAKC,MAAM,CAAC,CAACC,IAAKC,QACvB,GAAIA,KAAKC,MAAM,CAAGF,IAAK,OAAOC,KAAKC,MAAM,CACzC,OAAOF,GACT,EAAG,EACL,EAEA,MAAMG,mBAAqB,CAACC,SAAkBC,mBAC5C,MAAMC,OAAsB,EAAE,CAC9B,GAAIF,SAAWC,gBAAiB,CAC9B,MAAME,MAAQF,gBAAkBD,SAChC,IAAK,IAAII,EAAI,EAAGA,EAAID,MAAOC,IAAK,CAC9BF,OAAOG,IAAI,CAAC,oBAACC,UAAUF,GACzB,CACF,CACA,OAAOF,OAAOJ,MAAM,CAAGI,OAAS,IAClC,EASO,MAAMV,gBAA6C,QAAC,CACzDe,gBAAkB,IAAI,CAEvB,IADIC,yDAEH,MAAMC,cAAgBhB,cAAce,MAAME,KAAK,EAE/C,MAAMC,UAAYH,MAAME,KAAK,CAACZ,MAAM,CAEpC,MAAMc,qBAAuBL,gBAAkB,IAAM,UAErD,MACE,oBAACM,OACCC,UAAWC,GAAAA,MAAE,EAACC,iCAAO,CAACC,IAAI,CAAET,MAAMU,SAAS,EAC3CC,MAAO,CACLC,QAAS,OACTC,UAAWb,MAAMa,SAAS,EAAI,4BAC9BC,OAAQd,MAAMc,MAAM,EAAI,4BACxBC,oBAAqB,CAAC,OAAO,EAAEd,cAAc,cAAc,EAAE,IAAMA,cAAc,GAAG,CAAC,CACrFe,iBAAkB,CAAC,OAAO,EAAEb,UAAU,MAAM,CAAC,AAC/C,WAECH,MAAME,KAAK,CAACe,GAAG,CAAC,CAACzB,SAAU0B,WAC1B,qBAACC,eAAQ,YACN3B,SAASyB,GAAG,CAAC,CAACG,KAAMC,WACnB,yBAACC,UAAI,sCACHC,IAAKF,WAAa,EAAIrB,MAAMwB,mBAAmB,CAAGC,UAClDC,KAAM,OACNC,GAAIN,WAAa,EAAIjB,qBAAuB,WACxCJ,MAAM4B,gBAAgB,GAC1BC,IAAK,CAAC,EAAEX,SAAS,CAAC,EAAEG,SAAS,CAAC,CAC9Bf,UAAWE,iCAAO,CAACsB,IAAI,GAEtBV,OAGJ7B,mBAAmBC,SAASF,MAAM,CAAEW,iBAbxBiB,YAkBvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"AppNavigationLink",{enumerable:true,get:function(){return AppNavigationLink}});const _jsxruntime=require("react/jsx-runtime");const _core=require("@mantine/core");const _AppNavigationLinkmodulecss=/*#__PURE__*/_interop_require_default(require("./AppNavigationLink.module.css"));function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const AppNavigationLinkUntyped=_0=>{let{rightSection,active,children}=_0,other=_object_without_properties(_0,["rightSection","active","children"]);return(0,_jsxruntime.jsx)(_core.NavLink,_object_spread_props(_object_spread({classNames:_object_spread({root:`${_AppNavigationLinkmodulecss.default.root} ${active?_AppNavigationLinkmodulecss.default["root-active"]:_AppNavigationLinkmodulecss.default["root-inactive"]}`,label:_AppNavigationLinkmodulecss.default.label,section:_AppNavigationLinkmodulecss.default.section,children:_AppNavigationLinkmodulecss.default.children},other.classNames),rightSection:rightSection&&(0,_jsxruntime.jsx)(_core.Badge,{classNames:{root:_AppNavigationLinkmodulecss.default["badge-root"]},children:rightSection})},other),{children:children}))};const AppNavigationLink=AppNavigationLinkUntyped;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"AppNavigationLink",{enumerable:true,get:function(){return AppNavigationLink}});const _jsxruntime=require("react/jsx-runtime");const _core=require("@mantine/core");const _AppNavigationLinkmodulecss=/*#__PURE__*/_interop_require_default(require("./AppNavigationLink.module.css"));function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const AppNavigationLinkUntyped=_0=>{let{rightSection,active,children}=_0,other=_object_without_properties(_0,["rightSection","active","children"]);return(0,_jsxruntime.jsx)(_core.NavLink,_object_spread_props(_object_spread({classNames:_object_spread({root:`${_AppNavigationLinkmodulecss.default.root} ${active?_AppNavigationLinkmodulecss.default["root-active"]:_AppNavigationLinkmodulecss.default["root-inactive"]}`,label:_AppNavigationLinkmodulecss.default.label,section:_AppNavigationLinkmodulecss.default.section,children:_AppNavigationLinkmodulecss.default.children},other.classNames),rightSection:rightSection&&(0,_jsxruntime.jsx)(_core.Badge,{classNames:{root:_AppNavigationLinkmodulecss.default["badge-root"]},children:rightSection})},other),{children:children}))};const AppNavigationLink=AppNavigationLinkUntyped;
|
|
2
2
|
//# sourceMappingURL=AppNavigationLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Layout/AppNavigation/AppNavigationLink.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { NavLinkProps } from \"@mantine/core\"\nimport { Badge, NavLink } from \"@mantine/core\"\nimport classes from \"./AppNavigationLink.module.css\"\n\nconst AppNavigationLinkUntyped = ({ rightSection, active, children, ...other }: NavLinkProps) => {\n return (\n <NavLink\n classNames={{\n root: `${classes.root} ${active ? classes[\"root-active\"] : classes[\"root-inactive\"]}`,\n label: classes.label,\n section: classes.section,\n children: classes.children,\n ...other.classNames,\n }}\n rightSection={\n rightSection && (\n <Badge\n classNames={{\n root: classes[\"badge-root\"],\n }}\n >\n {rightSection}\n </Badge>\n )\n }\n {...other}\n >\n {children}\n </NavLink>\n )\n}\n\nconst AppNavigationLink = AppNavigationLinkUntyped as typeof NavLink\n\nexport { AppNavigationLink }\n"],"names":["AppNavigationLink","AppNavigationLinkUntyped","rightSection","active","children","other","NavLink","classNames","root","classes","label","section","Badge"],"mappings":"oGAsCSA,2DAAAA,wFAjCsB,iGACX,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Layout/AppNavigation/AppNavigationLink.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { NavLinkProps } from \"@mantine/core\"\nimport { Badge, NavLink } from \"@mantine/core\"\nimport classes from \"./AppNavigationLink.module.css\"\n\nconst AppNavigationLinkUntyped = ({ rightSection, active, children, ...other }: NavLinkProps) => {\n return (\n <NavLink\n classNames={{\n root: `${classes.root} ${active ? classes[\"root-active\"] : classes[\"root-inactive\"]}`,\n label: classes.label,\n section: classes.section,\n children: classes.children,\n ...other.classNames,\n }}\n rightSection={\n rightSection && (\n <Badge\n classNames={{\n root: classes[\"badge-root\"],\n }}\n >\n {rightSection}\n </Badge>\n )\n }\n {...other}\n >\n {children}\n </NavLink>\n )\n}\n\nconst AppNavigationLink = AppNavigationLinkUntyped as typeof NavLink\n\nexport { AppNavigationLink }\n"],"names":["AppNavigationLink","AppNavigationLinkUntyped","rightSection","active","children","other","NavLink","classNames","root","classes","label","section","Badge"],"mappings":"oGAsCSA,2DAAAA,wFAjCsB,iGACX,+4EAEpB,MAAMC,yBAA2B,QAAC,CAAEC,YAAY,CAAEC,MAAM,CAAEC,QAAQ,CAA0B,IAArBC,0EACrE,MACE,oBAACC,aAAO,sCACNC,WAAY,gBACVC,KAAM,CAAC,EAAEC,mCAAO,CAACD,IAAI,CAAC,CAAC,EAAEL,OAASM,mCAAO,CAAC,cAAc,CAAGA,mCAAO,CAAC,gBAAgB,CAAC,CAAC,CACrFC,MAAOD,mCAAO,CAACC,KAAK,CACpBC,QAASF,mCAAO,CAACE,OAAO,CACxBP,SAAUK,mCAAO,CAACL,QAAQ,EACvBC,MAAME,UAAU,EAErBL,aACEA,cACE,oBAACU,WAAK,EACJL,WAAY,CACVC,KAAMC,mCAAO,CAAC,aAAa,AAC7B,WAECP,gBAIHG,iBAEHD,WAGP,EAEA,MAAMJ,kBAAoBC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"SimpleGrid",{enumerable:true,get:function(){return SimpleGrid}});const _jsxruntime=require("react/jsx-runtime");const _react=/*#__PURE__*/_interop_require_default(require("react"));const _SimpleGridmodulecss=/*#__PURE__*/_interop_require_default(require("./SimpleGrid.module.css"));function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const SimpleGrid=_0=>{let{config}=_0,styleProps=_object_without_properties(_0,["config"]);return(0,_jsxruntime.jsx)("div",{className:`${_SimpleGridmodulecss.default["grid-container"]} ${styleProps.hScroll?_SimpleGridmodulecss.default.hScroll:""}`,style:{padding:styleProps.padding||`0 var(--mantine-spacing-md)`,margin:styleProps.margin||"",gridTemplateAreas:`"${styleProps.gridTemplateAreas.join('" "')}"`,gridTemplateColumns:styleProps.gridTemplateColumns,gridTemplateRows:styleProps.gridTemplateRows,gap:styleProps.gap||""},children:Object.entries(config).map(([gridArea,element])=>(0,_jsxruntime.jsx)("div",{className:_SimpleGridmodulecss.default.area,style:{gridArea},children:element},gridArea))})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"SimpleGrid",{enumerable:true,get:function(){return SimpleGrid}});const _jsxruntime=require("react/jsx-runtime");const _react=/*#__PURE__*/_interop_require_default(require("react"));const _SimpleGridmodulecss=/*#__PURE__*/_interop_require_default(require("./SimpleGrid.module.css"));function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const SimpleGrid=_0=>{let{config}=_0,styleProps=_object_without_properties(_0,["config"]);return(0,_jsxruntime.jsx)("div",{className:`${_SimpleGridmodulecss.default["grid-container"]} ${styleProps.hScroll?_SimpleGridmodulecss.default.hScroll:""}`,style:{padding:styleProps.padding||`0 var(--mantine-spacing-md)`,margin:styleProps.margin||"",gridTemplateAreas:`"${styleProps.gridTemplateAreas.join('" "')}"`,gridTemplateColumns:styleProps.gridTemplateColumns,gridTemplateRows:styleProps.gridTemplateRows,gap:styleProps.gap||""},children:Object.entries(config).map(([gridArea,element])=>(0,_jsxruntime.jsx)("div",{className:_SimpleGridmodulecss.default.area,style:{gridArea},children:element},gridArea))})};
|
|
2
2
|
//# sourceMappingURL=SimpleGrid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Layout/SimplePageLayout/SimpleGrid.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport React, { ReactNode } from \"react\"\nimport classes from \"./SimpleGrid.module.css\"\nexport type TSimpleGridStyling = {\n gridTemplateAreas: string[]\n gridTemplateColumns: string\n gridTemplateRows: string\n gap?: string\n margin?: string\n padding?: string\n hScroll?: boolean\n}\n\ntype TSimpleGridProps = TSimpleGridStyling & {\n config: Record<string, ReactNode>\n}\n\n/**\n * Generic grid wrapper that renders areas from a config map.\n * Supports spacing props and optional horizontal scrolling.\n * @param config Mapping of grid-area names to React nodes.\n * @param gridTemplateAreas Array describing grid-template-areas rows.\n * @param gridTemplateColumns CSS grid-template-columns value.\n * @param gridTemplateRows CSS grid-template-rows value.\n * @param gap Optional CSS gap between grid areas.\n * @param margin Optional CSS margin for the grid container.\n * @param padding Optional CSS padding for the grid container.\n * @param hScroll When true, applies a min-width to enable horizontal scrolling on narrow viewports.\n */\nexport const SimpleGrid: React.FC<TSimpleGridProps> = ({ config, ...styleProps }) => {\n return (\n <div\n className={`${classes[\"grid-container\"]} ${styleProps.hScroll ? classes.hScroll : \"\"}`}\n style={{\n padding: styleProps.padding || `0 var(--mantine-spacing-md)`,\n margin: styleProps.margin || \"\",\n gridTemplateAreas: `\"${styleProps.gridTemplateAreas.join('\" \"')}\"`,\n gridTemplateColumns: styleProps.gridTemplateColumns,\n gridTemplateRows: styleProps.gridTemplateRows,\n gap: styleProps.gap || \"\",\n }}\n >\n {Object.entries(config).map(([gridArea, element]: [string, ReactNode]) => (\n <div key={gridArea} className={classes.area} style={{ gridArea }}>\n {element}\n </div>\n ))}\n </div>\n )\n}\n"],"names":["SimpleGrid","config","styleProps","div","className","classes","hScroll","style","padding","margin","gridTemplateAreas","join","gridTemplateColumns","gridTemplateRows","gap","Object","entries","map","gridArea","element","area"],"mappings":"oGAgCaA,oDAAAA,wHA5BoB,mFACb,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Layout/SimplePageLayout/SimpleGrid.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport React, { ReactNode } from \"react\"\nimport classes from \"./SimpleGrid.module.css\"\nexport type TSimpleGridStyling = {\n gridTemplateAreas: string[]\n gridTemplateColumns: string\n gridTemplateRows: string\n gap?: string\n margin?: string\n padding?: string\n hScroll?: boolean\n}\n\ntype TSimpleGridProps = TSimpleGridStyling & {\n config: Record<string, ReactNode>\n}\n\n/**\n * Generic grid wrapper that renders areas from a config map.\n * Supports spacing props and optional horizontal scrolling.\n * @param config Mapping of grid-area names to React nodes.\n * @param gridTemplateAreas Array describing grid-template-areas rows.\n * @param gridTemplateColumns CSS grid-template-columns value.\n * @param gridTemplateRows CSS grid-template-rows value.\n * @param gap Optional CSS gap between grid areas.\n * @param margin Optional CSS margin for the grid container.\n * @param padding Optional CSS padding for the grid container.\n * @param hScroll When true, applies a min-width to enable horizontal scrolling on narrow viewports.\n */\nexport const SimpleGrid: React.FC<TSimpleGridProps> = ({ config, ...styleProps }) => {\n return (\n <div\n className={`${classes[\"grid-container\"]} ${styleProps.hScroll ? classes.hScroll : \"\"}`}\n style={{\n padding: styleProps.padding || `0 var(--mantine-spacing-md)`,\n margin: styleProps.margin || \"\",\n gridTemplateAreas: `\"${styleProps.gridTemplateAreas.join('\" \"')}\"`,\n gridTemplateColumns: styleProps.gridTemplateColumns,\n gridTemplateRows: styleProps.gridTemplateRows,\n gap: styleProps.gap || \"\",\n }}\n >\n {Object.entries(config).map(([gridArea, element]: [string, ReactNode]) => (\n <div key={gridArea} className={classes.area} style={{ gridArea }}>\n {element}\n </div>\n ))}\n </div>\n )\n}\n"],"names":["SimpleGrid","config","styleProps","div","className","classes","hScroll","style","padding","margin","gridTemplateAreas","join","gridTemplateColumns","gridTemplateRows","gap","Object","entries","map","gridArea","element","area"],"mappings":"oGAgCaA,oDAAAA,wHA5BoB,mFACb,iqCA2Bb,MAAMA,WAAyC,QAAC,CAAEC,MAAM,CAAiB,IAAZC,qDAClE,MACE,oBAACC,OACCC,UAAW,CAAC,EAAEC,4BAAO,CAAC,iBAAiB,CAAC,CAAC,EAAEH,WAAWI,OAAO,CAAGD,4BAAO,CAACC,OAAO,CAAG,GAAG,CAAC,CACtFC,MAAO,CACLC,QAASN,WAAWM,OAAO,EAAI,CAAC,2BAA2B,CAAC,CAC5DC,OAAQP,WAAWO,MAAM,EAAI,GAC7BC,kBAAmB,CAAC,CAAC,EAAER,WAAWQ,iBAAiB,CAACC,IAAI,CAAC,OAAO,CAAC,CAAC,CAClEC,oBAAqBV,WAAWU,mBAAmB,CACnDC,iBAAkBX,WAAWW,gBAAgB,CAC7CC,IAAKZ,WAAWY,GAAG,EAAI,EACzB,WAECC,OAAOC,OAAO,CAACf,QAAQgB,GAAG,CAAC,CAAC,CAACC,SAAUC,QAA6B,GACnE,oBAAChB,OAAmBC,UAAWC,4BAAO,CAACe,IAAI,CAAEb,MAAO,CAAEW,QAAS,WAC5DC,SADOD,YAMlB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get SimplePageLayout(){return SimplePageLayout},get SimplePageLayoutComplex(){return SimplePageLayoutComplex}});const _jsxruntime=require("react/jsx-runtime");const _react=/*#__PURE__*/_interop_require_default(require("react"));const _SimpleGrid=require("./SimpleGrid");const _Typo=require("../../Typo");const _indexmodulecss=/*#__PURE__*/_interop_require_default(require("./index.module.css"));function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const SimplePageLayout=_0=>{let{children,title,Button,Breadcrumbs}=_0,gridProps=_object_without_properties(_0,["children","title","Button","Breadcrumbs"]);return(0,_jsxruntime.jsx)(_SimpleGrid.SimpleGrid,{config:{title:(0,_jsxruntime.jsx)("div",{className:_indexmodulecss.default.title,children:(0,_jsxruntime.jsx)(_Typo.Typo,{type:"heading2",children:title})}),button:Button?(0,_jsxruntime.jsx)("div",{className:_indexmodulecss.default.button,children:Button}):null,content:(0,_jsxruntime.jsx)("div",{className:_indexmodulecss.default.content,children:children}),breadcrumbs:Breadcrumbs?(0,_jsxruntime.jsx)("div",{className:_indexmodulecss.default.breadcrumbs,children:Breadcrumbs}):null},gridTemplateAreas:[...Breadcrumbs?["breadcrumbs breadcrumbs breadcrumbs"]:[],"title . button","content content content"],gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:`${Breadcrumbs?"35px":""} 66px 1fr`,gap:gridProps.gap,margin:"-1rem -1rem 0 -1rem",padding:gridProps.padding,hScroll:gridProps.hScroll})};const SimplePageLayoutComplex=props=>{return(0,_jsxruntime.jsx)(SimplePageLayout,{title:props.title,Button:props.Button,hScroll:props.hScroll,children:(0,_jsxruntime.jsx)(_SimpleGrid.SimpleGrid,_object_spread_props(_object_spread({},props),{padding:props.padding||"0"}))})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get SimplePageLayout(){return SimplePageLayout},get SimplePageLayoutComplex(){return SimplePageLayoutComplex}});const _jsxruntime=require("react/jsx-runtime");const _react=/*#__PURE__*/_interop_require_default(require("react"));const _SimpleGrid=require("./SimpleGrid");const _Typo=require("../../Typo");const _indexmodulecss=/*#__PURE__*/_interop_require_default(require("./index.module.css"));function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const SimplePageLayout=_0=>{let{children,title,Button,Breadcrumbs}=_0,gridProps=_object_without_properties(_0,["children","title","Button","Breadcrumbs"]);return(0,_jsxruntime.jsx)(_SimpleGrid.SimpleGrid,{config:{title:(0,_jsxruntime.jsx)("div",{className:_indexmodulecss.default.title,children:(0,_jsxruntime.jsx)(_Typo.Typo,{type:"heading2",children:title})}),button:Button?(0,_jsxruntime.jsx)("div",{className:_indexmodulecss.default.button,children:Button}):null,content:(0,_jsxruntime.jsx)("div",{className:_indexmodulecss.default.content,children:children}),breadcrumbs:Breadcrumbs?(0,_jsxruntime.jsx)("div",{className:_indexmodulecss.default.breadcrumbs,children:Breadcrumbs}):null},gridTemplateAreas:[...Breadcrumbs?["breadcrumbs breadcrumbs breadcrumbs"]:[],"title . button","content content content"],gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:`${Breadcrumbs?"35px":""} 66px 1fr`,gap:gridProps.gap,margin:"-1rem -1rem 0 -1rem",padding:gridProps.padding,hScroll:gridProps.hScroll})};const SimplePageLayoutComplex=props=>{return(0,_jsxruntime.jsx)(SimplePageLayout,{title:props.title,Button:props.Button,hScroll:props.hScroll,children:(0,_jsxruntime.jsx)(_SimpleGrid.SimpleGrid,_object_spread_props(_object_spread({},props),{padding:props.padding||"0"}))})};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Layout/SimplePageLayout/index.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport React, { ReactNode } from \"react\"\nimport { SimpleGrid, TSimpleGridStyling } from \"./SimpleGrid\"\nimport { Typo } from \"../../Typo\"\nimport classes from \"./index.module.css\"\n\nexport type TSimplePageLayoutProps = Partial<TSimpleGridStyling> & {\n title: string\n Button?: ReactNode\n children?: ReactNode\n Breadcrumbs?: ReactNode\n}\n\n/**\n * Renders a simple page layout with title, optional breadcrumbs and action button.\n * Uses a 3-column grid and exposes styling props for spacing and horizontal scroll.\n * @param title Page title displayed as heading2.\n * @param Button Optional action element rendered in the header's right side.\n * @param Breadcrumbs Optional breadcrumbs rendered above the title.\n * @param children Main content area.\n * @param gap Optional CSS gap between grid areas.\n * @param padding Optional padding for the grid container.\n * @param hScroll When true, enforces a min-width to allow horizontal scrolling on smaller viewports.\n */\nexport const SimplePageLayout: React.FC<TSimplePageLayoutProps> = ({\n children,\n title,\n Button,\n Breadcrumbs,\n ...gridProps\n}) => {\n return (\n <SimpleGrid\n config={{\n title: (\n <div className={classes.title}>\n <Typo type=\"heading2\">{title}</Typo>\n </div>\n ),\n button: Button ? <div className={classes.button}>{Button}</div> : null,\n content: <div className={classes.content}>{children}</div>,\n breadcrumbs: Breadcrumbs ? <div className={classes.breadcrumbs}>{Breadcrumbs}</div> : null,\n }}\n gridTemplateAreas={[\n ...(Breadcrumbs ? [\"breadcrumbs breadcrumbs breadcrumbs\"] : []),\n \"title . button\",\n \"content content content\",\n ]}\n gridTemplateColumns={\"1fr 1fr 1fr\"}\n gridTemplateRows={`${Breadcrumbs ? \"35px\" : \"\"} 66px 1fr`}\n gap={gridProps.gap}\n margin={\"-1rem -1rem 0 -1rem\"}\n padding={gridProps.padding}\n hScroll={gridProps.hScroll}\n />\n )\n}\n\nexport type TSimplePageLayoutComplex = TSimpleGridStyling & {\n title: string\n Button?: ReactNode\n config: Record<string, ReactNode>\n}\n\n/**\n * Complex variant that composes SimplePageLayout with a configurable SimpleGrid.\n * Forwards styling props (including hScroll) and renders additional grid areas via config.\n * @param title Page title.\n * @param Button Optional action element rendered in the header's right side.\n * @param config Mapping of grid-area names to React nodes.\n * @param gridTemplateAreas CSS grid-template-areas definition.\n * @param gridTemplateColumns CSS grid-template-columns definition.\n * @param gridTemplateRows CSS grid-template-rows definition.\n * @param gap Optional CSS gap between grid areas.\n * @param margin Optional CSS margin for the grid container.\n * @param padding Optional CSS padding for the grid container (defaults to \"0\" for inner grid).\n * @param hScroll When true, enforces a min-width to allow horizontal scrolling on smaller viewports.\n */\nexport const SimplePageLayoutComplex = (props: TSimplePageLayoutComplex) => {\n return (\n <SimplePageLayout title={props.title} Button={props.Button} hScroll={props.hScroll}>\n <SimpleGrid {...props} padding={props.padding || \"0\"} />\n </SimplePageLayout>\n )\n}\n"],"names":["SimplePageLayout","SimplePageLayoutComplex","children","title","Button","Breadcrumbs","gridProps","SimpleGrid","config","div","className","classes","Typo","type","button","content","breadcrumbs","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","gap","margin","padding","hScroll","props"],"mappings":"mPA2BaA,0BAAAA,sBAsDAC,iCAAAA,qIA7EoB,oCACc,oCAC1B,kFACD,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Layout/SimplePageLayout/index.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport React, { ReactNode } from \"react\"\nimport { SimpleGrid, TSimpleGridStyling } from \"./SimpleGrid\"\nimport { Typo } from \"../../Typo\"\nimport classes from \"./index.module.css\"\n\nexport type TSimplePageLayoutProps = Partial<TSimpleGridStyling> & {\n title: string\n Button?: ReactNode\n children?: ReactNode\n Breadcrumbs?: ReactNode\n}\n\n/**\n * Renders a simple page layout with title, optional breadcrumbs and action button.\n * Uses a 3-column grid and exposes styling props for spacing and horizontal scroll.\n * @param title Page title displayed as heading2.\n * @param Button Optional action element rendered in the header's right side.\n * @param Breadcrumbs Optional breadcrumbs rendered above the title.\n * @param children Main content area.\n * @param gap Optional CSS gap between grid areas.\n * @param padding Optional padding for the grid container.\n * @param hScroll When true, enforces a min-width to allow horizontal scrolling on smaller viewports.\n */\nexport const SimplePageLayout: React.FC<TSimplePageLayoutProps> = ({\n children,\n title,\n Button,\n Breadcrumbs,\n ...gridProps\n}) => {\n return (\n <SimpleGrid\n config={{\n title: (\n <div className={classes.title}>\n <Typo type=\"heading2\">{title}</Typo>\n </div>\n ),\n button: Button ? <div className={classes.button}>{Button}</div> : null,\n content: <div className={classes.content}>{children}</div>,\n breadcrumbs: Breadcrumbs ? <div className={classes.breadcrumbs}>{Breadcrumbs}</div> : null,\n }}\n gridTemplateAreas={[\n ...(Breadcrumbs ? [\"breadcrumbs breadcrumbs breadcrumbs\"] : []),\n \"title . button\",\n \"content content content\",\n ]}\n gridTemplateColumns={\"1fr 1fr 1fr\"}\n gridTemplateRows={`${Breadcrumbs ? \"35px\" : \"\"} 66px 1fr`}\n gap={gridProps.gap}\n margin={\"-1rem -1rem 0 -1rem\"}\n padding={gridProps.padding}\n hScroll={gridProps.hScroll}\n />\n )\n}\n\nexport type TSimplePageLayoutComplex = TSimpleGridStyling & {\n title: string\n Button?: ReactNode\n config: Record<string, ReactNode>\n}\n\n/**\n * Complex variant that composes SimplePageLayout with a configurable SimpleGrid.\n * Forwards styling props (including hScroll) and renders additional grid areas via config.\n * @param title Page title.\n * @param Button Optional action element rendered in the header's right side.\n * @param config Mapping of grid-area names to React nodes.\n * @param gridTemplateAreas CSS grid-template-areas definition.\n * @param gridTemplateColumns CSS grid-template-columns definition.\n * @param gridTemplateRows CSS grid-template-rows definition.\n * @param gap Optional CSS gap between grid areas.\n * @param margin Optional CSS margin for the grid container.\n * @param padding Optional CSS padding for the grid container (defaults to \"0\" for inner grid).\n * @param hScroll When true, enforces a min-width to allow horizontal scrolling on smaller viewports.\n */\nexport const SimplePageLayoutComplex = (props: TSimplePageLayoutComplex) => {\n return (\n <SimplePageLayout title={props.title} Button={props.Button} hScroll={props.hScroll}>\n <SimpleGrid {...props} padding={props.padding || \"0\"} />\n </SimplePageLayout>\n )\n}\n"],"names":["SimplePageLayout","SimplePageLayoutComplex","children","title","Button","Breadcrumbs","gridProps","SimpleGrid","config","div","className","classes","Typo","type","button","content","breadcrumbs","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","gap","margin","padding","hScroll","props"],"mappings":"mPA2BaA,0BAAAA,sBAsDAC,iCAAAA,qIA7EoB,oCACc,oCAC1B,kFACD,m4EAoBb,MAAMD,iBAAqD,QAAC,CACjEE,QAAQ,CACRC,KAAK,CACLC,MAAM,CACNC,WAAW,CAEZ,IADIC,qFAEH,MACE,oBAACC,sBAAU,EACTC,OAAQ,CACNL,MACE,oBAACM,OAAIC,UAAWC,uBAAO,CAACR,KAAK,UAC3B,oBAACS,UAAI,EAACC,KAAK,oBAAYV,UAG3BW,OAAQV,OAAS,oBAACK,OAAIC,UAAWC,uBAAO,CAACG,MAAM,UAAGV,SAAgB,KAClEW,QAAS,oBAACN,OAAIC,UAAWC,uBAAO,CAACI,OAAO,UAAGb,WAC3Cc,YAAaX,YAAc,oBAACI,OAAIC,UAAWC,uBAAO,CAACK,WAAW,UAAGX,cAAqB,IACxF,EACAY,kBAAmB,IACbZ,YAAc,CAAC,sCAAsC,CAAG,EAAE,CAC9D,iBACA,0BACD,CACDa,oBAAqB,cACrBC,iBAAkB,CAAC,EAAEd,YAAc,OAAS,GAAG,SAAS,CAAC,CACzDe,IAAKd,UAAUc,GAAG,CAClBC,OAAQ,sBACRC,QAAShB,UAAUgB,OAAO,CAC1BC,QAASjB,UAAUiB,OAAO,EAGhC,EAsBO,MAAMtB,wBAA0B,AAACuB,QACtC,MACE,oBAACxB,kBAAiBG,MAAOqB,MAAMrB,KAAK,CAAEC,OAAQoB,MAAMpB,MAAM,CAAEmB,QAASC,MAAMD,OAAO,UAChF,oBAAChB,sBAAU,wCAAKiB,QAAOF,QAASE,MAAMF,OAAO,EAAI,QAGvD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get Modal(){return Modal},get ModalContext(){return ModalContext},get ModalWithOpener(){return ModalWithOpener}});const _jsxruntime=require("react/jsx-runtime");const _react=require("react");const _core=require("@mantine/core");const _ErrorBoundary=require("../ErrorBoundary");const _Modalmodulecss=/*#__PURE__*/_interop_require_default(require("./Modal.module.css"));function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const ModalContext=(0,_react.createContext)({setOpen:()=>void 0});const ModalWithOpener=({children,Opener,initiallyOpen=false,modalProps,title})=>{const[open,setOpen]=(0,_react.useState)(initiallyOpen);return(0,_jsxruntime.jsxs)(ModalContext.Provider,{value:{setOpen},children:[Opener(setOpen),(0,_jsxruntime.jsx)(Modal,_object_spread_props(_object_spread({opened:open,title:title},modalProps),{onClose:()=>setOpen(false),children:typeof children==="function"?children(setOpen):children}))]})};const Modal=_0=>{let{children,title}=_0,props=_object_without_properties(_0,["children","title"]);return(0,_jsxruntime.jsx)(_core.Modal,_object_spread_props(_object_spread({centered:true,classNames:{body:_Modalmodulecss.default.body,header:_Modalmodulecss.default.header,title:_Modalmodulecss.default.title,content:_Modalmodulecss.default.content,close:_Modalmodulecss.default.close},title:title},props),{children:(0,_jsxruntime.jsx)(_ErrorBoundary.ErrorBoundary,{children:children})}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get Modal(){return Modal},get ModalContext(){return ModalContext},get ModalWithOpener(){return ModalWithOpener}});const _jsxruntime=require("react/jsx-runtime");const _react=require("react");const _core=require("@mantine/core");const _ErrorBoundary=require("../ErrorBoundary");const _Modalmodulecss=/*#__PURE__*/_interop_require_default(require("./Modal.module.css"));function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const ModalContext=(0,_react.createContext)({setOpen:()=>void 0});const ModalWithOpener=({children,Opener,initiallyOpen=false,modalProps,title})=>{const[open,setOpen]=(0,_react.useState)(initiallyOpen);return(0,_jsxruntime.jsxs)(ModalContext.Provider,{value:{setOpen},children:[Opener(setOpen),(0,_jsxruntime.jsx)(Modal,_object_spread_props(_object_spread({opened:open,title:title},modalProps),{onClose:()=>setOpen(false),children:typeof children==="function"?children(setOpen):children}))]})};const Modal=_0=>{let{children,title}=_0,props=_object_without_properties(_0,["children","title"]);return(0,_jsxruntime.jsx)(_core.Modal,_object_spread_props(_object_spread({centered:true,classNames:{body:_Modalmodulecss.default.body,header:_Modalmodulecss.default.header,title:_Modalmodulecss.default.title,content:_Modalmodulecss.default.content,close:_Modalmodulecss.default.close},title:title},props),{children:(0,_jsxruntime.jsx)(_ErrorBoundary.ErrorBoundary,{children:children})}))};
|
|
2
2
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport {\n createContext,\n Dispatch,\n FC,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n useState,\n} from \"react\"\nimport { Modal as MantineModal, ModalProps } from \"@mantine/core\"\nimport { ErrorBoundary } from \"../ErrorBoundary\"\nimport classes from \"./Modal.module.css\"\n\nexport type TModalWithOpenerConfig = {\n initiallyOpen?: boolean\n Opener: (setOpen: Dispatch<React.SetStateAction<boolean>>) => ReactElement\n children: ReactNode | ((setOpen: (value: boolean) => void) => ReactElement)\n onSave?: () => void\n title?: ReactNode\n modalProps?: Partial<ModalProps>\n}\n\ntype TModalContext = {\n setOpen: Dispatch<React.SetStateAction<boolean>>\n}\n\nexport const ModalContext = createContext<TModalContext>({\n setOpen: () => void 0,\n})\n\nconst ModalWithOpener = ({\n children,\n Opener,\n initiallyOpen = false,\n modalProps,\n title,\n}: TModalWithOpenerConfig) => {\n const [open, setOpen] = useState<boolean>(initiallyOpen)\n return (\n <ModalContext.Provider value={{ setOpen }}>\n {Opener(setOpen)}\n <Modal opened={open} title={title} {...modalProps} onClose={() => setOpen(false)}>\n {typeof children === \"function\" ? children(setOpen) : children}\n </Modal>\n </ModalContext.Provider>\n )\n}\n\nconst Modal: FC<PropsWithChildren<ModalProps>> = ({ children, title, ...props }) => {\n return (\n <MantineModal\n centered\n classNames={{\n body: classes.body,\n header: classes.header,\n title: classes.title,\n content: classes.content,\n close: classes.close,\n }}\n title={title}\n {...props}\n >\n <ErrorBoundary>{children}</ErrorBoundary>\n </MantineModal>\n )\n}\n\nexport { ModalWithOpener, Modal }\n"],"names":["Modal","ModalContext","ModalWithOpener","createContext","setOpen","children","Opener","initiallyOpen","modalProps","title","open","useState","Provider","value","opened","onClose","props","MantineModal","centered","classNames","body","classes","header","content","close","ErrorBoundary"],"mappings":"mPAuE0BA,eAAAA,WAzCbC,sBAAAA,kBAyCJC,yBAAAA,uFA3DF,6BAC2C,8CACpB,wFACV,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport {\n createContext,\n Dispatch,\n FC,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n useState,\n} from \"react\"\nimport { Modal as MantineModal, ModalProps } from \"@mantine/core\"\nimport { ErrorBoundary } from \"../ErrorBoundary\"\nimport classes from \"./Modal.module.css\"\n\nexport type TModalWithOpenerConfig = {\n initiallyOpen?: boolean\n Opener: (setOpen: Dispatch<React.SetStateAction<boolean>>) => ReactElement\n children: ReactNode | ((setOpen: (value: boolean) => void) => ReactElement)\n onSave?: () => void\n title?: ReactNode\n modalProps?: Partial<ModalProps>\n}\n\ntype TModalContext = {\n setOpen: Dispatch<React.SetStateAction<boolean>>\n}\n\nexport const ModalContext = createContext<TModalContext>({\n setOpen: () => void 0,\n})\n\nconst ModalWithOpener = ({\n children,\n Opener,\n initiallyOpen = false,\n modalProps,\n title,\n}: TModalWithOpenerConfig) => {\n const [open, setOpen] = useState<boolean>(initiallyOpen)\n return (\n <ModalContext.Provider value={{ setOpen }}>\n {Opener(setOpen)}\n <Modal opened={open} title={title} {...modalProps} onClose={() => setOpen(false)}>\n {typeof children === \"function\" ? children(setOpen) : children}\n </Modal>\n </ModalContext.Provider>\n )\n}\n\nconst Modal: FC<PropsWithChildren<ModalProps>> = ({ children, title, ...props }) => {\n return (\n <MantineModal\n centered\n classNames={{\n body: classes.body,\n header: classes.header,\n title: classes.title,\n content: classes.content,\n close: classes.close,\n }}\n title={title}\n {...props}\n >\n <ErrorBoundary>{children}</ErrorBoundary>\n </MantineModal>\n )\n}\n\nexport { ModalWithOpener, Modal }\n"],"names":["Modal","ModalContext","ModalWithOpener","createContext","setOpen","children","Opener","initiallyOpen","modalProps","title","open","useState","Provider","value","opened","onClose","props","MantineModal","centered","classNames","body","classes","header","content","close","ErrorBoundary"],"mappings":"mPAuE0BA,eAAAA,WAzCbC,sBAAAA,kBAyCJC,yBAAAA,uFA3DF,6BAC2C,8CACpB,wFACV,m4EAeb,MAAMD,aAAeE,GAAAA,oBAAa,EAAgB,CACvDC,QAAS,IAAM,KAAK,CACtB,GAEA,MAAMF,gBAAkB,CAAC,CACvBG,QAAQ,CACRC,MAAM,CACNC,cAAgB,KAAK,CACrBC,UAAU,CACVC,KAAK,CACkB,IACvB,KAAM,CAACC,KAAMN,QAAQ,CAAGO,GAAAA,eAAQ,EAAUJ,eAC1C,MACE,qBAACN,aAAaW,QAAQ,EAACC,MAAO,CAAET,OAAQ,YACrCE,OAAOF,SACR,oBAACJ,2CAAMc,OAAQJ,KAAMD,MAAOA,OAAWD,aAAYO,QAAS,IAAMX,QAAQ,gBACvE,OAAOC,WAAa,WAAaA,SAASD,SAAWC,cAI9D,EAEA,MAAML,MAA2C,QAAC,CAAEK,QAAQ,CAAEI,KAAK,CAAY,IAAPO,0DACtE,MACE,oBAACC,WAAY,sCACXC,QAAQ,MACRC,WAAY,CACVC,KAAMC,uBAAO,CAACD,IAAI,CAClBE,OAAQD,uBAAO,CAACC,MAAM,CACtBb,MAAOY,uBAAO,CAACZ,KAAK,CACpBc,QAASF,uBAAO,CAACE,OAAO,CACxBC,MAAOH,uBAAO,CAACG,KAAK,AACtB,EACAf,MAAOA,OACHO,iBAEJ,oBAACS,4BAAa,WAAEpB,aAGtB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get showErrorNotification(){return showErrorNotification},get showInfoNotification(){return showInfoNotification},get showNotification(){return showNotification},get showSuccessNotification(){return showSuccessNotification},get showWarningNotification(){return showWarningNotification}});const _jsxruntime=require("react/jsx-runtime");const _notifications=require("@mantine/notifications");const _Notificationmodulecss=/*#__PURE__*/_interop_require_default(require("./Notification.module.css"));const _icons=require("../../icons");const _genericTypes=require("../../genericTypes");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const showNotification=_0=>{let{type=_genericTypes.EStatus.INFO}=_0,props=_object_without_properties(_0,["type"]);_notifications.notifications.show(_object_spread_props(_object_spread({classNames:_object_spread({},_Notificationmodulecss.default)},props),{icon:(0,_jsxruntime.jsx)(_icons.StatusIcon,{status:type})}))};const showSuccessNotification=(text,title)=>{showNotification({type:_genericTypes.EStatus.SUCCESS,title:title,message:text})};const showErrorNotification=(text,title)=>{showNotification({type:_genericTypes.EStatus.ERROR,title:title,message:text})};const showInfoNotification=(text,title)=>{showNotification({type:_genericTypes.EStatus.INFO,title:title,message:text})};const showWarningNotification=(text,title)=>{showNotification({type:_genericTypes.EStatus.WARNING,title:title,message:text})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get showErrorNotification(){return showErrorNotification},get showInfoNotification(){return showInfoNotification},get showNotification(){return showNotification},get showSuccessNotification(){return showSuccessNotification},get showWarningNotification(){return showWarningNotification}});const _jsxruntime=require("react/jsx-runtime");const _notifications=require("@mantine/notifications");const _Notificationmodulecss=/*#__PURE__*/_interop_require_default(require("./Notification.module.css"));const _icons=require("../../icons");const _genericTypes=require("../../genericTypes");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const showNotification=_0=>{let{type=_genericTypes.EStatus.INFO}=_0,props=_object_without_properties(_0,["type"]);_notifications.notifications.show(_object_spread_props(_object_spread({classNames:_object_spread({},_Notificationmodulecss.default)},props),{icon:(0,_jsxruntime.jsx)(_icons.StatusIcon,{status:type})}))};const showSuccessNotification=(text,title)=>{showNotification({type:_genericTypes.EStatus.SUCCESS,title:title,message:text})};const showErrorNotification=(text,title)=>{showNotification({type:_genericTypes.EStatus.ERROR,title:title,message:text})};const showInfoNotification=(text,title)=>{showNotification({type:_genericTypes.EStatus.INFO,title:title,message:text})};const showWarningNotification=(text,title)=>{showNotification({type:_genericTypes.EStatus.WARNING,title:title,message:text})};
|
|
2
2
|
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Notification/notifications.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { notifications, NotificationData } from \"@mantine/notifications\"\n\nimport classes from \"./Notification.module.css\"\nimport { StatusIcon } from \"../../icons\"\nimport { EStatus } from \"../../genericTypes\"\nexport type TNotificationProps = {\n type?: EStatus\n} & NotificationData\n\nexport const showNotification = ({ type = EStatus.INFO, ...props }: TNotificationProps) => {\n notifications.show({\n classNames: { ...classes },\n ...props,\n icon: <StatusIcon status={type} />,\n })\n}\n\nexport const showSuccessNotification = (text: string, title?: string) => {\n showNotification({\n type: EStatus.SUCCESS,\n title: title,\n message: text,\n })\n}\n\nexport const showErrorNotification = (text: string, title?: string) => {\n showNotification({\n type: EStatus.ERROR,\n title: title,\n message: text,\n })\n}\n\nexport const showInfoNotification = (text: string, title?: string) => {\n showNotification({\n type: EStatus.INFO,\n title: title,\n message: text,\n })\n}\n\nexport const showWarningNotification = (text: string, title?: string) => {\n showNotification({\n type: EStatus.WARNING,\n title: title,\n message: text,\n })\n}\n"],"names":["showErrorNotification","showInfoNotification","showNotification","showSuccessNotification","showWarningNotification","type","EStatus","INFO","props","notifications","show","classNames","classes","icon","StatusIcon","status","text","title","SUCCESS","message","ERROR","WARNING"],"mappings":"mPA6BaA,+BAAAA,2BAQAC,8BAAAA,0BAxBAC,0BAAAA,sBAQAC,iCAAAA,6BAwBAC,iCAAAA,uGAzCmC,qGAE5B,mDACO,2CACH,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Notification/notifications.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { notifications, NotificationData } from \"@mantine/notifications\"\n\nimport classes from \"./Notification.module.css\"\nimport { StatusIcon } from \"../../icons\"\nimport { EStatus } from \"../../genericTypes\"\nexport type TNotificationProps = {\n type?: EStatus\n} & NotificationData\n\nexport const showNotification = ({ type = EStatus.INFO, ...props }: TNotificationProps) => {\n notifications.show({\n classNames: { ...classes },\n ...props,\n icon: <StatusIcon status={type} />,\n })\n}\n\nexport const showSuccessNotification = (text: string, title?: string) => {\n showNotification({\n type: EStatus.SUCCESS,\n title: title,\n message: text,\n })\n}\n\nexport const showErrorNotification = (text: string, title?: string) => {\n showNotification({\n type: EStatus.ERROR,\n title: title,\n message: text,\n })\n}\n\nexport const showInfoNotification = (text: string, title?: string) => {\n showNotification({\n type: EStatus.INFO,\n title: title,\n message: text,\n })\n}\n\nexport const showWarningNotification = (text: string, title?: string) => {\n showNotification({\n type: EStatus.WARNING,\n title: title,\n message: text,\n })\n}\n"],"names":["showErrorNotification","showInfoNotification","showNotification","showSuccessNotification","showWarningNotification","type","EStatus","INFO","props","notifications","show","classNames","classes","icon","StatusIcon","status","text","title","SUCCESS","message","ERROR","WARNING"],"mappings":"mPA6BaA,+BAAAA,2BAQAC,8BAAAA,0BAxBAC,0BAAAA,sBAQAC,iCAAAA,6BAwBAC,iCAAAA,uGAzCmC,qGAE5B,mDACO,2CACH,k4EAKjB,MAAMF,iBAAmB,QAAC,CAAEG,KAAOC,qBAAO,CAACC,IAAI,CAAgC,IAA3BC,8CACzDC,4BAAa,CAACC,IAAI,CAAC,qCACjBC,WAAY,kBAAKC,8BAAO,GACrBJ,QACHK,KAAM,oBAACC,iBAAU,EAACC,OAAQV,SAE9B,EAEO,MAAMF,wBAA0B,CAACa,KAAcC,SACpDf,iBAAiB,CACfG,KAAMC,qBAAO,CAACY,OAAO,CACrBD,MAAOA,MACPE,QAASH,IACX,EACF,EAEO,MAAMhB,sBAAwB,CAACgB,KAAcC,SAClDf,iBAAiB,CACfG,KAAMC,qBAAO,CAACc,KAAK,CACnBH,MAAOA,MACPE,QAASH,IACX,EACF,EAEO,MAAMf,qBAAuB,CAACe,KAAcC,SACjDf,iBAAiB,CACfG,KAAMC,qBAAO,CAACC,IAAI,CAClBU,MAAOA,MACPE,QAASH,IACX,EACF,EAEO,MAAMZ,wBAA0B,CAACY,KAAcC,SACpDf,iBAAiB,CACfG,KAAMC,qBAAO,CAACe,OAAO,CACrBJ,MAAOA,MACPE,QAASH,IACX,EACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"TableClientSidePersistent",{enumerable:true,get:function(){return TableClientSidePersistent}});const _jsxruntime=require("react/jsx-runtime");const _index=require("../index");const _TableSessionStorage=require("../../persistence/TableSessionStorage");const _react=require("react");const _constants=require("../../constants");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}function TableClientSidePersistent(_0){let{Storage=_TableSessionStorage.TableSessionStorage.Instance(),tableId,config,onSortingChange,onPagingChange}=_0,tableProps=_object_without_properties(_0,["Storage","tableId","config","onSortingChange","onPagingChange"]);const savedTable=(0,_react.useMemo)(()=>Storage.get(tableId)||{paging:_constants.defaultPagingState,sorting:config.sorting.default},[tableId]);const configurationWithAdjustedSorting=_object_spread_props(_object_spread({},config),{sorting:{default:savedTable.sorting}});const handleSortingChange=props=>{Storage===null||Storage===void 0?void 0:Storage.set(tableId,()=>_object_spread_props(_object_spread({},savedTable),{sorting:{column:props.column,direction:props.direction}}));onSortingChange===null||onSortingChange===void 0?void 0:onSortingChange(props)};const handlePagingChange=props=>{Storage===null||Storage===void 0?void 0:Storage.set(tableId,()=>_object_spread_props(_object_spread({},savedTable),{paging:{index:props.index,size:props.size}}));onPagingChange===null||onPagingChange===void 0?void 0:onPagingChange(props)};return(0,_jsxruntime.jsx)(_index.TableClientSide,_object_spread_props(_object_spread({},tableProps),{onSortingChange:handleSortingChange,onPagingChange:handlePagingChange,defaultPaging:savedTable.paging,config:configurationWithAdjustedSorting}))}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"TableClientSidePersistent",{enumerable:true,get:function(){return TableClientSidePersistent}});const _jsxruntime=require("react/jsx-runtime");const _index=require("../index");const _TableSessionStorage=require("../../persistence/TableSessionStorage");const _react=require("react");const _constants=require("../../constants");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}function TableClientSidePersistent(_0){let{Storage=_TableSessionStorage.TableSessionStorage.Instance(),tableId,config,onSortingChange,onPagingChange}=_0,tableProps=_object_without_properties(_0,["Storage","tableId","config","onSortingChange","onPagingChange"]);const savedTable=(0,_react.useMemo)(()=>Storage.get(tableId)||{paging:_constants.defaultPagingState,sorting:config.sorting.default},[tableId]);const configurationWithAdjustedSorting=_object_spread_props(_object_spread({},config),{sorting:{default:savedTable.sorting}});const handleSortingChange=props=>{Storage===null||Storage===void 0?void 0:Storage.set(tableId,()=>_object_spread_props(_object_spread({},savedTable),{sorting:{column:props.column,direction:props.direction}}));onSortingChange===null||onSortingChange===void 0?void 0:onSortingChange(props)};const handlePagingChange=props=>{Storage===null||Storage===void 0?void 0:Storage.set(tableId,()=>_object_spread_props(_object_spread({},savedTable),{paging:{index:props.index,size:props.size}}));onPagingChange===null||onPagingChange===void 0?void 0:onPagingChange(props)};return(0,_jsxruntime.jsx)(_index.TableClientSide,_object_spread_props(_object_spread({},tableProps),{onSortingChange:handleSortingChange,onPagingChange:handlePagingChange,defaultPaging:savedTable.paging,config:configurationWithAdjustedSorting}))}
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/Table/TableClientSide/TableClientSidePersistent/index.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport {\n TableClientSide,\n THandlePagingChange,\n THandleSortingChange,\n TTableClientSideProps,\n} from \"../index\"\nimport { ITableStorage, TableSessionStorage } from \"../../persistence/TableSessionStorage\"\nimport { useMemo } from \"react\"\nimport { defaultPagingState } from \"../../constants\"\n\nexport type TTableClientSidePersistentProps<TDataType> = TTableClientSideProps<TDataType> & {\n Storage?: ITableStorage\n tableId: string\n}\n\n/**\n * The TableClientSidePersistent is a persistence middleware that uses closely the same interface as the table\n * with addition of the *Storage* and *tableId*.\n * it wraps and intercepts incoming and outgoing data to inject loaded data into the\n * table or save table changes into the Storage Repository.\n *\n * @param Storage Storage Repository for the Table. This is optional and per default the TableSessionStorage for SessionStorage persistence\n * @param tableId Unique ID for persistence\n * @param config Table Configuration\n * @param onSortingChange Callback\n * @param onPagingChange Callback\n * @param tableProps Interface from useTableClientSide hook\n */\nexport function TableClientSidePersistent<TDataType>({\n Storage = TableSessionStorage.Instance(),\n tableId,\n config,\n onSortingChange,\n onPagingChange,\n ...tableProps\n}: TTableClientSidePersistentProps<TDataType>) {\n const savedTable = useMemo(\n () =>\n Storage.get(tableId) || {\n paging: defaultPagingState,\n sorting: config.sorting.default,\n },\n [tableId]\n )\n\n const configurationWithAdjustedSorting = {\n ...config,\n sorting: {\n default: savedTable.sorting,\n },\n }\n const handleSortingChange: THandleSortingChange = (props) => {\n Storage?.set(tableId, () => ({\n ...savedTable,\n sorting: {\n column: props.column,\n direction: props.direction,\n },\n }))\n onSortingChange?.(props)\n }\n\n const handlePagingChange: THandlePagingChange = (props) => {\n Storage?.set(tableId, () => ({\n ...savedTable,\n paging: {\n index: props.index,\n size: props.size,\n },\n }))\n onPagingChange?.(props)\n }\n\n return (\n <TableClientSide\n {...tableProps}\n onSortingChange={handleSortingChange}\n onPagingChange={handlePagingChange}\n defaultPaging={savedTable.paging}\n config={configurationWithAdjustedSorting}\n />\n )\n}\n"],"names":["TableClientSidePersistent","Storage","TableSessionStorage","Instance","tableId","config","onSortingChange","onPagingChange","tableProps","savedTable","useMemo","get","paging","defaultPagingState","sorting","default","configurationWithAdjustedSorting","handleSortingChange","props","set","column","direction","handlePagingChange","index","size","TableClientSide","defaultPaging"],"mappings":"oGAgCgBA,mEAAAA,iGAvBT,+CAC4C,8DAC3B,kCACW,
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/Table/TableClientSide/TableClientSidePersistent/index.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport {\n TableClientSide,\n THandlePagingChange,\n THandleSortingChange,\n TTableClientSideProps,\n} from \"../index\"\nimport { ITableStorage, TableSessionStorage } from \"../../persistence/TableSessionStorage\"\nimport { useMemo } from \"react\"\nimport { defaultPagingState } from \"../../constants\"\n\nexport type TTableClientSidePersistentProps<TDataType> = TTableClientSideProps<TDataType> & {\n Storage?: ITableStorage\n tableId: string\n}\n\n/**\n * The TableClientSidePersistent is a persistence middleware that uses closely the same interface as the table\n * with addition of the *Storage* and *tableId*.\n * it wraps and intercepts incoming and outgoing data to inject loaded data into the\n * table or save table changes into the Storage Repository.\n *\n * @param Storage Storage Repository for the Table. This is optional and per default the TableSessionStorage for SessionStorage persistence\n * @param tableId Unique ID for persistence\n * @param config Table Configuration\n * @param onSortingChange Callback\n * @param onPagingChange Callback\n * @param tableProps Interface from useTableClientSide hook\n */\nexport function TableClientSidePersistent<TDataType>({\n Storage = TableSessionStorage.Instance(),\n tableId,\n config,\n onSortingChange,\n onPagingChange,\n ...tableProps\n}: TTableClientSidePersistentProps<TDataType>) {\n const savedTable = useMemo(\n () =>\n Storage.get(tableId) || {\n paging: defaultPagingState,\n sorting: config.sorting.default,\n },\n [tableId]\n )\n\n const configurationWithAdjustedSorting = {\n ...config,\n sorting: {\n default: savedTable.sorting,\n },\n }\n const handleSortingChange: THandleSortingChange = (props) => {\n Storage?.set(tableId, () => ({\n ...savedTable,\n sorting: {\n column: props.column,\n direction: props.direction,\n },\n }))\n onSortingChange?.(props)\n }\n\n const handlePagingChange: THandlePagingChange = (props) => {\n Storage?.set(tableId, () => ({\n ...savedTable,\n paging: {\n index: props.index,\n size: props.size,\n },\n }))\n onPagingChange?.(props)\n }\n\n return (\n <TableClientSide\n {...tableProps}\n onSortingChange={handleSortingChange}\n onPagingChange={handlePagingChange}\n defaultPaging={savedTable.paging}\n config={configurationWithAdjustedSorting}\n />\n )\n}\n"],"names":["TableClientSidePersistent","Storage","TableSessionStorage","Instance","tableId","config","onSortingChange","onPagingChange","tableProps","savedTable","useMemo","get","paging","defaultPagingState","sorting","default","configurationWithAdjustedSorting","handleSortingChange","props","set","column","direction","handlePagingChange","index","size","TableClientSide","defaultPaging"],"mappings":"oGAgCgBA,mEAAAA,iGAvBT,+CAC4C,8DAC3B,kCACW,2yEAoB5B,SAASA,0BAAqC,EAOR,KAPQ,CACnDC,QAAUC,wCAAmB,CAACC,QAAQ,EAAE,CACxCC,OAAO,CACPC,MAAM,CACNC,eAAe,CACfC,cAAc,CAE6B,IADxCC,4GAEH,MAAMC,WAAaC,GAAAA,cAAO,EACxB,IACET,QAAQU,GAAG,CAACP,UAAY,CACtBQ,OAAQC,6BAAkB,CAC1BC,QAAST,OAAOS,OAAO,CAACC,OAAO,AACjC,EACF,CAACX,QAAQ,EAGX,MAAMY,iCAAmC,uCACpCX,SACHS,QAAS,CACPC,QAASN,WAAWK,OAAO,AAC7B,IAEF,MAAMG,oBAA4C,AAACC,QACjDjB,gBAAAA,wBAAAA,QAASkB,GAAG,CAACf,QAAS,IAAO,uCACxBK,aACHK,QAAS,CACPM,OAAQF,MAAME,MAAM,CACpBC,UAAWH,MAAMG,SAAS,AAC5B,KAEFf,wBAAAA,gCAAAA,gBAAkBY,MACpB,EAEA,MAAMI,mBAA0C,AAACJ,QAC/CjB,gBAAAA,wBAAAA,QAASkB,GAAG,CAACf,QAAS,IAAO,uCACxBK,aACHG,OAAQ,CACNW,MAAOL,MAAMK,KAAK,CAClBC,KAAMN,MAAMM,IAAI,AAClB,KAEFjB,uBAAAA,+BAAAA,eAAiBW,MACnB,EAEA,MACE,oBAACO,sBAAe,wCACVjB,aACJF,gBAAiBW,oBACjBV,eAAgBe,mBAChBI,cAAejB,WAAWG,MAAM,CAChCP,OAAQW,mCAGd"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get TableServerSidePersistent(){return TableServerSidePersistent},get getTableServerSidePersistentState(){return getTableServerSidePersistentState}});const _jsxruntime=require("react/jsx-runtime");const _TableSessionStorage=require("../../persistence/TableSessionStorage");const _react=require("react");const _constants=require("../../constants");const _index=require("../index");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}function getTableServerSidePersistentState(id,Storage=_TableSessionStorage.TableSessionStorage.Instance()){return Storage.get(id)}function TableServerSidePersistent(_0){let{Storage=_TableSessionStorage.TableSessionStorage.Instance(),tableId,config,onTableUpdate}=_0,tableProps=_object_without_properties(_0,["Storage","tableId","config","onTableUpdate"]);const savedTable=(0,_react.useMemo)(()=>Storage.get(tableId)||{paging:_constants.defaultPagingState,sorting:config.sorting.default},[tableId]);const configurationWithAdjustedSorting=_object_spread_props(_object_spread({},config),{sorting:{default:savedTable.sorting}});const handleTableChange=tableState=>{Storage===null||Storage===void 0?void 0:Storage.set(tableId,()=>tableState);onTableUpdate===null||onTableUpdate===void 0?void 0:onTableUpdate(tableState)};(0,_react.useEffect)(()=>{if(!tableProps.metadata)return;Storage===null||Storage===void 0?void 0:Storage.set(tableId,prev=>_object_spread({},prev,tableProps.metadata))},[tableProps.metadata]);return(0,_jsxruntime.jsx)(_index.TableServerSide,_object_spread_props(_object_spread({},tableProps),{onTableUpdate:handleTableChange,config:configurationWithAdjustedSorting}))}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get TableServerSidePersistent(){return TableServerSidePersistent},get getTableServerSidePersistentState(){return getTableServerSidePersistentState}});const _jsxruntime=require("react/jsx-runtime");const _TableSessionStorage=require("../../persistence/TableSessionStorage");const _react=require("react");const _constants=require("../../constants");const _index=require("../index");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}function getTableServerSidePersistentState(id,Storage=_TableSessionStorage.TableSessionStorage.Instance()){return Storage.get(id)}function TableServerSidePersistent(_0){let{Storage=_TableSessionStorage.TableSessionStorage.Instance(),tableId,config,onTableUpdate}=_0,tableProps=_object_without_properties(_0,["Storage","tableId","config","onTableUpdate"]);const savedTable=(0,_react.useMemo)(()=>Storage.get(tableId)||{paging:_constants.defaultPagingState,sorting:config.sorting.default},[tableId]);const configurationWithAdjustedSorting=_object_spread_props(_object_spread({},config),{sorting:{default:savedTable.sorting}});const handleTableChange=tableState=>{Storage===null||Storage===void 0?void 0:Storage.set(tableId,()=>tableState);onTableUpdate===null||onTableUpdate===void 0?void 0:onTableUpdate(tableState)};(0,_react.useEffect)(()=>{if(!tableProps.metadata)return;Storage===null||Storage===void 0?void 0:Storage.set(tableId,prev=>_object_spread({},prev,tableProps.metadata))},[tableProps.metadata]);return(0,_jsxruntime.jsx)(_index.TableServerSide,_object_spread_props(_object_spread({},tableProps),{onTableUpdate:handleTableChange,config:configurationWithAdjustedSorting}))}
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/Table/TableServerSide/TableServerSidePersistent/index.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { ITableStorage, TableSessionStorage } from \"../../persistence/TableSessionStorage\"\nimport { useEffect, useMemo } from \"react\"\nimport { defaultPagingState } from \"../../constants\"\nimport { TableServerSide, TTableServerSideProps } from \"../index\"\nimport { TOnTableUpdateArgs } from \"../useTableServerSide\"\n\nexport type TTableServerSidePersistentProps<TDataType> = TTableServerSideProps<TDataType> & {\n Storage?: ITableStorage\n tableId: string\n}\n\nexport function getTableServerSidePersistentState(\n id: string,\n Storage = TableSessionStorage.Instance()\n) {\n return Storage.get(id)\n}\n\n/**\n * The TableServerSidePersistent is a persistence middleware that uses closely the same interface as the table\n * with addition of the *Storage* and *tableId*.\n * it wraps and intercepts incoming and outgoing data to inject loaded data into the\n * table or save table changes into the Storage Repository.\n *\n * @param Storage Storage Repository for the Table. This is optional and per default the TableSessionStorage for SessionStorage persistence\n * @param tableId Unique ID for persistence\n * @param config Table Configuration\n * @param onTableUpdate Callback\n * @param tableProps Interface from useTableClientSide hook\n */\nexport function TableServerSidePersistent<TDataType>({\n Storage = TableSessionStorage.Instance(),\n tableId,\n config,\n onTableUpdate,\n ...tableProps\n}: TTableServerSidePersistentProps<TDataType>) {\n const savedTable = useMemo(\n () =>\n Storage.get(tableId) || {\n paging: defaultPagingState,\n sorting: config.sorting.default,\n },\n [tableId]\n )\n\n const configurationWithAdjustedSorting = {\n ...config,\n sorting: {\n default: savedTable.sorting,\n },\n }\n const handleTableChange = (tableState: TOnTableUpdateArgs) => {\n Storage?.set(tableId, () => tableState)\n onTableUpdate?.(tableState)\n }\n\n useEffect(() => {\n if (!tableProps.metadata) return\n Storage?.set(tableId, (prev) => ({ ...prev, ...tableProps.metadata }))\n }, [tableProps.metadata])\n\n return (\n <TableServerSide\n {...tableProps}\n onTableUpdate={handleTableChange}\n config={configurationWithAdjustedSorting}\n />\n )\n}\n"],"names":["TableServerSidePersistent","getTableServerSidePersistentState","id","Storage","TableSessionStorage","Instance","get","tableId","config","onTableUpdate","tableProps","savedTable","useMemo","paging","defaultPagingState","sorting","default","configurationWithAdjustedSorting","handleTableChange","tableState","set","useEffect","metadata","prev","TableServerSide"],"mappings":"mPAkCgBA,mCAAAA,+BAnBAC,2CAAAA,uHAXmC,8DAChB,kCACA,wCACoB,
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/Table/TableServerSide/TableServerSidePersistent/index.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { ITableStorage, TableSessionStorage } from \"../../persistence/TableSessionStorage\"\nimport { useEffect, useMemo } from \"react\"\nimport { defaultPagingState } from \"../../constants\"\nimport { TableServerSide, TTableServerSideProps } from \"../index\"\nimport { TOnTableUpdateArgs } from \"../useTableServerSide\"\n\nexport type TTableServerSidePersistentProps<TDataType> = TTableServerSideProps<TDataType> & {\n Storage?: ITableStorage\n tableId: string\n}\n\nexport function getTableServerSidePersistentState(\n id: string,\n Storage = TableSessionStorage.Instance()\n) {\n return Storage.get(id)\n}\n\n/**\n * The TableServerSidePersistent is a persistence middleware that uses closely the same interface as the table\n * with addition of the *Storage* and *tableId*.\n * it wraps and intercepts incoming and outgoing data to inject loaded data into the\n * table or save table changes into the Storage Repository.\n *\n * @param Storage Storage Repository for the Table. This is optional and per default the TableSessionStorage for SessionStorage persistence\n * @param tableId Unique ID for persistence\n * @param config Table Configuration\n * @param onTableUpdate Callback\n * @param tableProps Interface from useTableClientSide hook\n */\nexport function TableServerSidePersistent<TDataType>({\n Storage = TableSessionStorage.Instance(),\n tableId,\n config,\n onTableUpdate,\n ...tableProps\n}: TTableServerSidePersistentProps<TDataType>) {\n const savedTable = useMemo(\n () =>\n Storage.get(tableId) || {\n paging: defaultPagingState,\n sorting: config.sorting.default,\n },\n [tableId]\n )\n\n const configurationWithAdjustedSorting = {\n ...config,\n sorting: {\n default: savedTable.sorting,\n },\n }\n const handleTableChange = (tableState: TOnTableUpdateArgs) => {\n Storage?.set(tableId, () => tableState)\n onTableUpdate?.(tableState)\n }\n\n useEffect(() => {\n if (!tableProps.metadata) return\n Storage?.set(tableId, (prev) => ({ ...prev, ...tableProps.metadata }))\n }, [tableProps.metadata])\n\n return (\n <TableServerSide\n {...tableProps}\n onTableUpdate={handleTableChange}\n config={configurationWithAdjustedSorting}\n />\n )\n}\n"],"names":["TableServerSidePersistent","getTableServerSidePersistentState","id","Storage","TableSessionStorage","Instance","get","tableId","config","onTableUpdate","tableProps","savedTable","useMemo","paging","defaultPagingState","sorting","default","configurationWithAdjustedSorting","handleTableChange","tableState","set","useEffect","metadata","prev","TableServerSide"],"mappings":"mPAkCgBA,mCAAAA,+BAnBAC,2CAAAA,uHAXmC,8DAChB,kCACA,wCACoB,oyEAQhD,SAASA,kCACdC,EAAU,CACVC,QAAUC,wCAAmB,CAACC,QAAQ,EAAE,EAExC,OAAOF,QAAQG,GAAG,CAACJ,GACrB,CAcO,SAASF,0BAAqC,EAMR,KANQ,CACnDG,QAAUC,wCAAmB,CAACC,QAAQ,EAAE,CACxCE,OAAO,CACPC,MAAM,CACNC,aAAa,CAE8B,IADxCC,yFAEH,MAAMC,WAAaC,GAAAA,cAAO,EACxB,IACET,QAAQG,GAAG,CAACC,UAAY,CACtBM,OAAQC,6BAAkB,CAC1BC,QAASP,OAAOO,OAAO,CAACC,OAAO,AACjC,EACF,CAACT,QAAQ,EAGX,MAAMU,iCAAmC,uCACpCT,SACHO,QAAS,CACPC,QAASL,WAAWI,OAAO,AAC7B,IAEF,MAAMG,kBAAoB,AAACC,aACzBhB,gBAAAA,wBAAAA,QAASiB,GAAG,CAACb,QAAS,IAAMY,YAC5BV,sBAAAA,8BAAAA,cAAgBU,WAClB,EAEAE,GAAAA,gBAAS,EAAC,KACR,GAAI,CAACX,WAAWY,QAAQ,CAAE,OAC1BnB,gBAAAA,wBAAAA,QAASiB,GAAG,CAACb,QAAS,AAACgB,MAAU,kBAAKA,KAASb,WAAWY,QAAQ,EACpE,EAAG,CAACZ,WAAWY,QAAQ,CAAC,EAExB,MACE,oBAACE,sBAAe,wCACVd,aACJD,cAAeS,kBACfV,OAAQS,mCAGd"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get ActionMenu(){return ActionMenu},get createWiredActionMenuComponent(){return createWiredActionMenuComponent}});const _jsxruntime=require("react/jsx-runtime");const _core=require("@mantine/core");const _lucidereact=require("lucide-react");const _react=require("react");const _Tooltip=require("../../../Tooltip");const _ActionMenumodulecss=/*#__PURE__*/_interop_require_default(require("./ActionMenu.module.css"));function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}function getLabel(label,tableProps){if(typeof label==="function"){return label(tableProps)}return label}function createWiredActionMenuComponent({setMenuState,menuState,items,setModalOpen}){return({tableProps,menuProps,actionIcon})=>{const getOwnMenuState=(0,_react.useMemo)(()=>menuState[tableProps.id],[menuState]);const dispatchLoading=(label,isLoading)=>setMenuState({type:"SET_LOADING",payload:{id:tableProps.id,loading:{label,isLoading}}});const dispatchOpen=open=>setMenuState({type:"SET_OPEN",payload:{id:tableProps.id,state:{open}}});const handleItemClick=item=>{var _item_modal,_item_action;return item.modal?setModalOpen((_item_modal=item.modal)===null||_item_modal===void 0?void 0:_item_modal.id,tableProps)():(_item_action=item.action)===null||_item_action===void 0?void 0:_item_action.call(item,tableProps,{setLoading:setLoading(item)})};const getTooltipText=item=>{var _item_tooltip_customText,_item_tooltip,_item_tooltip1;return((_item_tooltip=item.tooltip)===null||_item_tooltip===void 0?void 0:(_item_tooltip_customText=_item_tooltip.customText)===null||_item_tooltip_customText===void 0?void 0:_item_tooltip_customText.call(_item_tooltip,tableProps))?(_item_tooltip1=item.tooltip)===null||_item_tooltip1===void 0?void 0:_item_tooltip1.customText(tableProps):getLabel(item.label,tableProps)};const getIsMenuItemDisabled=item=>{var _getOwnMenuState_loading,_item_disabled;return(getOwnMenuState===null||getOwnMenuState===void 0?void 0:(_getOwnMenuState_loading=getOwnMenuState.loading)===null||_getOwnMenuState_loading===void 0?void 0:_getOwnMenuState_loading.includes(item.id))||((_item_disabled=item.disabled)===null||_item_disabled===void 0?void 0:_item_disabled.call(item,tableProps))};const getIcon=item=>typeof item.icon==="function"?(0,_jsxruntime.jsx)(item.icon,_object_spread({},tableProps)):item.icon;const setLoading=(0,_react.useCallback)(item=>value=>{dispatchLoading(item.id,value)},[menuState]);if(items.length<=2){return(0,_jsxruntime.jsx)("span",{className:_ActionMenumodulecss.default["icon-container"],children:items.map(item=>{var _item_hidden;if((_item_hidden=item.hidden)===null||_item_hidden===void 0?void 0:_item_hidden.call(item,tableProps))return null;return(0,_jsxruntime.jsx)(_Tooltip.Tooltip,{label:getTooltipText(item),children:(0,_jsxruntime.jsx)("span",{children:(0,_jsxruntime.jsx)(_core.ActionIcon,{className:_ActionMenumodulecss.default.icon,disabled:getIsMenuItemDisabled(item),onClick:()=>handleItemClick(item),children:(0,_jsxruntime.jsx)("span",{children:getIcon(item)})},item.id)})},item.id)})})}return(0,_jsxruntime.jsx)(ActionMenu,_object_spread_props(_object_spread({actionIcon:actionIcon,opened:getOwnMenuState===null||getOwnMenuState===void 0?void 0:getOwnMenuState.open,onOpen:()=>dispatchOpen(true),onClose:()=>dispatchOpen(false)},menuProps),{children:(0,_jsxruntime.jsx)(_jsxruntime.Fragment,{children:items.map(item=>{var _item_hidden,_item_tooltip_showInMenu,_item_tooltip;if((_item_hidden=item.hidden)===null||_item_hidden===void 0?void 0:_item_hidden.call(item,tableProps))return null;return(0,_jsxruntime.jsx)(_Tooltip.Tooltip,{label:getTooltipText(item),disabled:!((_item_tooltip=item.tooltip)===null||_item_tooltip===void 0?void 0:(_item_tooltip_showInMenu=_item_tooltip.showInMenu)===null||_item_tooltip_showInMenu===void 0?void 0:_item_tooltip_showInMenu.call(_item_tooltip,tableProps)),children:(0,_jsxruntime.jsx)("span",{children:(0,_jsxruntime.jsx)(_core.Menu.Item,{className:_ActionMenumodulecss.default.item,disabled:getIsMenuItemDisabled(item),onClick:()=>handleItemClick(item),leftSection:getIcon(item),children:getLabel(item.label,tableProps)},item.id)})},item.id)})})}))}}const ActionMenu=_0=>{let{actionIcon,children}=_0,menuProps=_object_without_properties(_0,["actionIcon","children"]);return(0,_jsxruntime.jsx)("div",{className:_ActionMenumodulecss.default["action-container"],"data-testid":"table-action-menu",children:(0,_jsxruntime.jsxs)(_core.Menu,_object_spread_props(_object_spread({shadow:"md",width:180},menuProps),{children:[(0,_jsxruntime.jsx)(_core.Menu.Target,{children:(0,_jsxruntime.jsx)(_core.ActionIcon,{"data-testid":"table-action-menu-opener",className:_ActionMenumodulecss.default.icon,children:actionIcon||(0,_jsxruntime.jsx)(_lucidereact.MoreVertical,{})})}),(0,_jsxruntime.jsx)(_core.Menu.Dropdown,{children:children})]}))})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get ActionMenu(){return ActionMenu},get createWiredActionMenuComponent(){return createWiredActionMenuComponent}});const _jsxruntime=require("react/jsx-runtime");const _core=require("@mantine/core");const _lucidereact=require("lucide-react");const _react=require("react");const _Tooltip=require("../../../Tooltip");const _ActionMenumodulecss=/*#__PURE__*/_interop_require_default(require("./ActionMenu.module.css"));function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}function getLabel(label,tableProps){if(typeof label==="function"){return label(tableProps)}return label}function createWiredActionMenuComponent({setMenuState,menuState,items,setModalOpen}){return({tableProps,menuProps,actionIcon})=>{const getOwnMenuState=(0,_react.useMemo)(()=>menuState[tableProps.id],[menuState]);const dispatchLoading=(label,isLoading)=>setMenuState({type:"SET_LOADING",payload:{id:tableProps.id,loading:{label,isLoading}}});const dispatchOpen=open=>setMenuState({type:"SET_OPEN",payload:{id:tableProps.id,state:{open}}});const handleItemClick=item=>{var _item_modal,_item_action;return item.modal?setModalOpen((_item_modal=item.modal)===null||_item_modal===void 0?void 0:_item_modal.id,tableProps)():(_item_action=item.action)===null||_item_action===void 0?void 0:_item_action.call(item,tableProps,{setLoading:setLoading(item)})};const getTooltipText=item=>{var _item_tooltip_customText,_item_tooltip,_item_tooltip1;return((_item_tooltip=item.tooltip)===null||_item_tooltip===void 0?void 0:(_item_tooltip_customText=_item_tooltip.customText)===null||_item_tooltip_customText===void 0?void 0:_item_tooltip_customText.call(_item_tooltip,tableProps))?(_item_tooltip1=item.tooltip)===null||_item_tooltip1===void 0?void 0:_item_tooltip1.customText(tableProps):getLabel(item.label,tableProps)};const getIsMenuItemDisabled=item=>{var _getOwnMenuState_loading,_item_disabled;return(getOwnMenuState===null||getOwnMenuState===void 0?void 0:(_getOwnMenuState_loading=getOwnMenuState.loading)===null||_getOwnMenuState_loading===void 0?void 0:_getOwnMenuState_loading.includes(item.id))||((_item_disabled=item.disabled)===null||_item_disabled===void 0?void 0:_item_disabled.call(item,tableProps))};const getIcon=item=>typeof item.icon==="function"?(0,_jsxruntime.jsx)(item.icon,_object_spread({},tableProps)):item.icon;const setLoading=(0,_react.useCallback)(item=>value=>{dispatchLoading(item.id,value)},[menuState]);if(items.length<=2){return(0,_jsxruntime.jsx)("span",{className:_ActionMenumodulecss.default["icon-container"],children:items.map(item=>{var _item_hidden;if((_item_hidden=item.hidden)===null||_item_hidden===void 0?void 0:_item_hidden.call(item,tableProps))return null;return(0,_jsxruntime.jsx)(_Tooltip.Tooltip,{label:getTooltipText(item),children:(0,_jsxruntime.jsx)("span",{children:(0,_jsxruntime.jsx)(_core.ActionIcon,{className:_ActionMenumodulecss.default.icon,disabled:getIsMenuItemDisabled(item),onClick:()=>handleItemClick(item),children:(0,_jsxruntime.jsx)("span",{children:getIcon(item)})},item.id)})},item.id)})})}return(0,_jsxruntime.jsx)(ActionMenu,_object_spread_props(_object_spread({actionIcon:actionIcon,opened:getOwnMenuState===null||getOwnMenuState===void 0?void 0:getOwnMenuState.open,onOpen:()=>dispatchOpen(true),onClose:()=>dispatchOpen(false)},menuProps),{children:(0,_jsxruntime.jsx)(_jsxruntime.Fragment,{children:items.map(item=>{var _item_hidden,_item_tooltip_showInMenu,_item_tooltip;if((_item_hidden=item.hidden)===null||_item_hidden===void 0?void 0:_item_hidden.call(item,tableProps))return null;return(0,_jsxruntime.jsx)(_Tooltip.Tooltip,{label:getTooltipText(item),disabled:!((_item_tooltip=item.tooltip)===null||_item_tooltip===void 0?void 0:(_item_tooltip_showInMenu=_item_tooltip.showInMenu)===null||_item_tooltip_showInMenu===void 0?void 0:_item_tooltip_showInMenu.call(_item_tooltip,tableProps)),children:(0,_jsxruntime.jsx)("span",{children:(0,_jsxruntime.jsx)(_core.Menu.Item,{className:_ActionMenumodulecss.default.item,disabled:getIsMenuItemDisabled(item),onClick:()=>handleItemClick(item),leftSection:getIcon(item),children:getLabel(item.label,tableProps)},item.id)})},item.id)})})}))}}const ActionMenu=_0=>{let{actionIcon,children}=_0,menuProps=_object_without_properties(_0,["actionIcon","children"]);return(0,_jsxruntime.jsx)("div",{className:_ActionMenumodulecss.default["action-container"],"data-testid":"table-action-menu",children:(0,_jsxruntime.jsxs)(_core.Menu,_object_spread_props(_object_spread({shadow:"md",width:180},menuProps),{children:[(0,_jsxruntime.jsx)(_core.Menu.Target,{children:(0,_jsxruntime.jsx)(_core.ActionIcon,{"data-testid":"table-action-menu-opener",className:_ActionMenumodulecss.default.icon,children:actionIcon||(0,_jsxruntime.jsx)(_lucidereact.MoreVertical,{})})}),(0,_jsxruntime.jsx)(_core.Menu.Dropdown,{children:children})]}))})};
|
|
2
2
|
//# sourceMappingURL=ActionMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/Table/components/ActionMenu/ActionMenu.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { ActionIcon, Menu, MenuProps } from \"@mantine/core\"\nimport { MoreVertical } from \"lucide-react\"\nimport {\n TActionMenuItem,\n TActionMenuRawProps,\n TMenuConfig,\n TMenuState,\n TWiredActionMenuProps,\n} from \"../../types\"\nimport { Dispatch, ReactNode, useCallback, useMemo } from \"react\"\nimport { Tooltip } from \"../../../Tooltip\"\nimport classes from \"./ActionMenu.module.css\"\n\ntype TcreateWiredActionMenuComponent<TDataType> = {\n setMenuState: Dispatch<{\n type: string\n payload: {\n state?: Partial<TMenuState>\n loading?: { label: string; isLoading: boolean }\n id: string\n }\n }>\n menuState: TMenuConfig\n items: TActionMenuItem<TDataType>[]\n setModalOpen: (\n id: string | undefined,\n tableProps?: TActionMenuRawProps<TDataType>\n ) => (value?: boolean) => void\n}\n\nfunction getLabel<TDataType>(\n label: TActionMenuItem<TDataType>[\"label\"],\n tableProps: TActionMenuRawProps<TDataType>\n) {\n if (typeof label === \"function\") {\n return label(tableProps)\n }\n return label\n}\n\n/**\n *\n * The **Table ActionMenu** has two forms. If less than 3 entries, the menu items are visualized as **ActionIcons**,\n * if more or equal to 3, it's a Menu that the user can open and close.\n * This function (closure) returns the ActionMenu or Block of ActionIcon **Components** that are wired to the ActionMenu state.\n * It is a closure to abstract away the ActionMenu states and return a simple component that fits perfectly into the Table Action Menu Configuration.\n * @param setMenuState Callback to set the MenuState\n * @param menuState Connected state for all **ActionMenu** (not the options, just the menu) on the page\n * @param items Configuration items for the ActionMenu\n * @param setModalOpen Callback to open a modal. Needs the id for the modal\n */\nfunction createWiredActionMenuComponent<TDataType>({\n setMenuState,\n menuState,\n items,\n setModalOpen,\n}: TcreateWiredActionMenuComponent<TDataType>) {\n // Closure function to abstract statehandler from direct props for action item\n // eslint-disable-next-line react/display-name\n return ({ tableProps, menuProps, actionIcon }: TWiredActionMenuProps<TDataType>) => {\n // Simplification function to update value of this explicit ActionMenu in state\n\n const getOwnMenuState = useMemo(() => menuState[tableProps.id], [menuState])\n\n const dispatchLoading = (label: string, isLoading: boolean) =>\n setMenuState({\n type: \"SET_LOADING\",\n payload: {\n id: tableProps.id,\n loading: {\n label,\n isLoading,\n },\n },\n })\n const dispatchOpen = (open: boolean) =>\n setMenuState({\n type: \"SET_OPEN\",\n payload: {\n id: tableProps.id,\n state: {\n open,\n },\n },\n })\n\n const handleItemClick = (item: TActionMenuItem<TDataType>) =>\n item.modal\n ? setModalOpen(item.modal?.id, tableProps)()\n : item.action?.(tableProps, {\n setLoading: setLoading(item),\n })\n\n const getTooltipText = (item: TActionMenuItem<TDataType>) =>\n item.tooltip?.customText?.(tableProps)\n ? item.tooltip?.customText(tableProps)\n : getLabel(item.label, tableProps)\n\n const getIsMenuItemDisabled = (item: TActionMenuItem<TDataType>) =>\n getOwnMenuState?.loading?.includes(item.id) || item.disabled?.(tableProps)\n\n const getIcon = (item: TActionMenuItem<TDataType>) =>\n typeof item.icon === \"function\" ? <item.icon {...tableProps} /> : item.icon\n\n // closure function that alters the menustate to set loading to true for this specific ActionItem\n const setLoading = useCallback(\n (item: TActionMenuItem<TDataType>) => (value: boolean) => {\n dispatchLoading(item.id, value)\n },\n [menuState]\n )\n\n // Condition if the amount of items is less than 3, it's not a menu, it's just two icons next to each other\n if (items.length <= 2) {\n return (\n <span className={classes[\"icon-container\"]}>\n {items.map((item) => {\n if (item.hidden?.(tableProps)) return null\n\n return (\n <Tooltip key={item.id} label={getTooltipText(item)}>\n <span>\n <ActionIcon\n key={item.id}\n className={classes.icon}\n disabled={getIsMenuItemDisabled(item)}\n onClick={() => handleItemClick(item)}\n >\n <span>{getIcon(item)}</span>\n </ActionIcon>\n </span>\n </Tooltip>\n )\n })}\n </span>\n )\n }\n\n return (\n <ActionMenu\n actionIcon={actionIcon}\n opened={getOwnMenuState?.open}\n onOpen={() => dispatchOpen(true)}\n onClose={() => dispatchOpen(false)}\n {...menuProps}\n >\n <>\n {items.map((item) => {\n if (item.hidden?.(tableProps)) return null\n\n return (\n <Tooltip\n key={item.id}\n label={getTooltipText(item)}\n disabled={!item.tooltip?.showInMenu?.(tableProps)}\n >\n <span>\n <Menu.Item\n className={classes.item}\n key={item.id}\n disabled={getIsMenuItemDisabled(item)}\n onClick={() => handleItemClick(item)}\n leftSection={getIcon(item)}\n >\n {getLabel(item.label, tableProps)}\n </Menu.Item>\n </span>\n </Tooltip>\n )\n })}\n </>\n </ActionMenu>\n )\n }\n}\n\ntype TActionMenuProps = MenuProps & {\n actionIcon?: ReactNode\n children: ReactNode\n}\n\n/**\n * Simple UI Action Menu component opened by Icon click\n * @param actionIcon Icon for Opener\n * @param children Children menu items\n * @param menuProps Properties for the Menu component\n * @constructor\n */\nconst ActionMenu = ({ actionIcon, children, ...menuProps }: TActionMenuProps) => {\n return (\n <div className={classes[\"action-container\"]} data-testid={\"table-action-menu\"}>\n <Menu shadow=\"md\" width={180} {...menuProps}>\n <Menu.Target>\n <ActionIcon data-testid={\"table-action-menu-opener\"} className={classes.icon}>\n {actionIcon || <MoreVertical />}\n </ActionIcon>\n </Menu.Target>\n\n <Menu.Dropdown>{children}</Menu.Dropdown>\n </Menu>\n </div>\n )\n}\n\nexport { createWiredActionMenuComponent, ActionMenu }\n"],"names":["ActionMenu","createWiredActionMenuComponent","getLabel","label","tableProps","setMenuState","menuState","items","setModalOpen","menuProps","actionIcon","getOwnMenuState","useMemo","id","dispatchLoading","isLoading","type","payload","loading","dispatchOpen","open","state","handleItemClick","item","modal","action","setLoading","getTooltipText","tooltip","customText","getIsMenuItemDisabled","includes","disabled","getIcon","icon","useCallback","value","length","span","className","classes","map","hidden","Tooltip","ActionIcon","onClick","opened","onOpen","onClose","showInMenu","Menu","Item","leftSection","children","div","data-testid","shadow","width","Target","MoreVertical","Dropdown"],"mappings":"mPAgNyCA,oBAAAA,gBAAhCC,wCAAAA,qGA5MmC,4CACf,qCAQ6B,gCAClC,6FACJ,g4EAmBpB,SAASC,SACPC,KAA0C,CAC1CC,UAA0C,EAE1C,GAAI,OAAOD,QAAU,WAAY,CAC/B,OAAOA,MAAMC,WACf,CACA,OAAOD,KACT,CAaA,SAASF,+BAA0C,CACjDI,YAAY,CACZC,SAAS,CACTC,KAAK,CACLC,YAAY,CAC+B,EAG3C,MAAO,CAAC,CAAEJ,UAAU,CAAEK,SAAS,CAAEC,UAAU,CAAoC,IAG7E,MAAMC,gBAAkBC,GAAAA,cAAO,EAAC,IAAMN,SAAS,CAACF,WAAWS,EAAE,CAAC,CAAE,CAACP,UAAU,EAE3E,MAAMQ,gBAAkB,CAACX,MAAeY,YACtCV,aAAa,CACXW,KAAM,cACNC,QAAS,CACPJ,GAAIT,WAAWS,EAAE,CACjBK,QAAS,CACPf,MACAY,SACF,CACF,CACF,GACF,MAAMI,aAAe,AAACC,MACpBf,aAAa,CACXW,KAAM,WACNC,QAAS,CACPJ,GAAIT,WAAWS,EAAE,CACjBQ,MAAO,CACLD,IACF,CACF,CACF,GAEF,MAAME,gBAAkB,AAACC,WAENA,YACbA,oBAFJA,KAAKC,KAAK,CACNhB,cAAae,YAAAA,KAAKC,KAAK,UAAVD,4BAAAA,YAAYV,EAAE,CAAET,eAC7BmB,aAAAA,KAAKE,MAAM,UAAXF,6BAAAA,kBAAAA,KAAcnB,WAAY,CACxBsB,WAAYA,WAAWH,KACzB,IAEN,MAAMI,eAAiB,AAACJ,WACtBA,yBAAAA,cACIA,qBADJA,EAAAA,cAAAA,KAAKK,OAAO,UAAZL,+BAAAA,yBAAAA,cAAcM,UAAU,UAAxBN,yCAAAA,8BAAAA,cAA2BnB,cACvBmB,eAAAA,KAAKK,OAAO,UAAZL,+BAAAA,eAAcM,UAAU,CAACzB,YACzBF,SAASqB,KAAKpB,KAAK,CAAEC,aAE3B,MAAM0B,sBAAwB,AAACP,WAC7BZ,yBAA+CY,qBAA/CZ,CAAAA,wBAAAA,iCAAAA,yBAAAA,gBAAiBO,OAAO,UAAxBP,yCAAAA,yBAA0BoB,QAAQ,CAACR,KAAKV,EAAE,MAAKU,eAAAA,KAAKS,QAAQ,UAAbT,+BAAAA,oBAAAA,KAAgBnB,cAEjE,MAAM6B,QAAU,AAACV,MACf,OAAOA,KAAKW,IAAI,GAAK,WAAa,oBAACX,KAAKW,IAAI,mBAAK9B,aAAiBmB,KAAKW,IAAI,CAG7E,MAAMR,WAAaS,GAAAA,kBAAW,EAC5B,AAACZ,MAAqC,AAACa,QACrCtB,gBAAgBS,KAAKV,EAAE,CAAEuB,MAC3B,EACA,CAAC9B,UAAU,EAIb,GAAIC,MAAM8B,MAAM,EAAI,EAAG,CACrB,MACE,oBAACC,QAAKC,UAAWC,4BAAO,CAAC,iBAAiB,UACvCjC,MAAMkC,GAAG,CAAC,AAAClB,WACNA,aAAJ,IAAIA,aAAAA,KAAKmB,MAAM,UAAXnB,6BAAAA,kBAAAA,KAAcnB,YAAa,OAAO,KAEtC,MACE,oBAACuC,gBAAO,EAAexC,MAAOwB,eAAeJ,eAC3C,oBAACe,iBACC,oBAACM,gBAAU,EAETL,UAAWC,4BAAO,CAACN,IAAI,CACvBF,SAAUF,sBAAsBP,MAChCsB,QAAS,IAAMvB,gBAAgBC,eAE/B,oBAACe,iBAAML,QAAQV,SALVA,KAAKV,EAAE,KAHJU,KAAKV,EAAE,CAazB,IAGN,CAEA,MACE,oBAACb,gDACCU,WAAYA,WACZoC,MAAM,CAAEnC,wBAAAA,gCAAAA,gBAAiBS,IAAI,CAC7B2B,OAAQ,IAAM5B,aAAa,MAC3B6B,QAAS,IAAM7B,aAAa,QACxBV,qBAEJ,mDACGF,MAAMkC,GAAG,CAAC,AAAClB,WACNA,aAMWA,yBAAAA,cANf,IAAIA,aAAAA,KAAKmB,MAAM,UAAXnB,6BAAAA,kBAAAA,KAAcnB,YAAa,OAAO,KAEtC,MACE,oBAACuC,gBAAO,EAENxC,MAAOwB,eAAeJ,MACtBS,SAAU,GAACT,cAAAA,KAAKK,OAAO,UAAZL,+BAAAA,yBAAAA,cAAc0B,UAAU,UAAxB1B,yCAAAA,8BAAAA,cAA2BnB,sBAEtC,oBAACkC,iBACC,oBAACY,UAAI,CAACC,IAAI,EACRZ,UAAWC,4BAAO,CAACjB,IAAI,CAEvBS,SAAUF,sBAAsBP,MAChCsB,QAAS,IAAMvB,gBAAgBC,MAC/B6B,YAAanB,QAAQV,eAEpBrB,SAASqB,KAAKpB,KAAK,CAAEC,aALjBmB,KAAKV,EAAE,KAPXU,KAAKV,EAAE,CAiBlB,OAIR,CACF,CAcA,MAAMb,WAAa,QAAC,CAAEU,UAAU,CAAE2C,QAAQ,CAAkC,IAA7B5C,mEAC7C,MACE,oBAAC6C,OAAIf,UAAWC,4BAAO,CAAC,mBAAmB,CAAEe,cAAa,6BACxD,qBAACL,UAAI,sCAACM,OAAO,KAAKC,MAAO,KAAShD,sBAChC,oBAACyC,UAAI,CAACQ,MAAM,WACV,oBAACd,gBAAU,EAACW,cAAa,2BAA4BhB,UAAWC,4BAAO,CAACN,IAAI,UACzExB,YAAc,oBAACiD,yBAAY,SAIhC,oBAACT,UAAI,CAACU,QAAQ,WAAEP,gBAIxB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/Table/components/ActionMenu/ActionMenu.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { ActionIcon, Menu, MenuProps } from \"@mantine/core\"\nimport { MoreVertical } from \"lucide-react\"\nimport {\n TActionMenuItem,\n TActionMenuRawProps,\n TMenuConfig,\n TMenuState,\n TWiredActionMenuProps,\n} from \"../../types\"\nimport { Dispatch, ReactNode, useCallback, useMemo } from \"react\"\nimport { Tooltip } from \"../../../Tooltip\"\nimport classes from \"./ActionMenu.module.css\"\n\ntype TcreateWiredActionMenuComponent<TDataType> = {\n setMenuState: Dispatch<{\n type: string\n payload: {\n state?: Partial<TMenuState>\n loading?: { label: string; isLoading: boolean }\n id: string\n }\n }>\n menuState: TMenuConfig\n items: TActionMenuItem<TDataType>[]\n setModalOpen: (\n id: string | undefined,\n tableProps?: TActionMenuRawProps<TDataType>\n ) => (value?: boolean) => void\n}\n\nfunction getLabel<TDataType>(\n label: TActionMenuItem<TDataType>[\"label\"],\n tableProps: TActionMenuRawProps<TDataType>\n) {\n if (typeof label === \"function\") {\n return label(tableProps)\n }\n return label\n}\n\n/**\n *\n * The **Table ActionMenu** has two forms. If less than 3 entries, the menu items are visualized as **ActionIcons**,\n * if more or equal to 3, it's a Menu that the user can open and close.\n * This function (closure) returns the ActionMenu or Block of ActionIcon **Components** that are wired to the ActionMenu state.\n * It is a closure to abstract away the ActionMenu states and return a simple component that fits perfectly into the Table Action Menu Configuration.\n * @param setMenuState Callback to set the MenuState\n * @param menuState Connected state for all **ActionMenu** (not the options, just the menu) on the page\n * @param items Configuration items for the ActionMenu\n * @param setModalOpen Callback to open a modal. Needs the id for the modal\n */\nfunction createWiredActionMenuComponent<TDataType>({\n setMenuState,\n menuState,\n items,\n setModalOpen,\n}: TcreateWiredActionMenuComponent<TDataType>) {\n // Closure function to abstract statehandler from direct props for action item\n // eslint-disable-next-line react/display-name\n return ({ tableProps, menuProps, actionIcon }: TWiredActionMenuProps<TDataType>) => {\n // Simplification function to update value of this explicit ActionMenu in state\n\n const getOwnMenuState = useMemo(() => menuState[tableProps.id], [menuState])\n\n const dispatchLoading = (label: string, isLoading: boolean) =>\n setMenuState({\n type: \"SET_LOADING\",\n payload: {\n id: tableProps.id,\n loading: {\n label,\n isLoading,\n },\n },\n })\n const dispatchOpen = (open: boolean) =>\n setMenuState({\n type: \"SET_OPEN\",\n payload: {\n id: tableProps.id,\n state: {\n open,\n },\n },\n })\n\n const handleItemClick = (item: TActionMenuItem<TDataType>) =>\n item.modal\n ? setModalOpen(item.modal?.id, tableProps)()\n : item.action?.(tableProps, {\n setLoading: setLoading(item),\n })\n\n const getTooltipText = (item: TActionMenuItem<TDataType>) =>\n item.tooltip?.customText?.(tableProps)\n ? item.tooltip?.customText(tableProps)\n : getLabel(item.label, tableProps)\n\n const getIsMenuItemDisabled = (item: TActionMenuItem<TDataType>) =>\n getOwnMenuState?.loading?.includes(item.id) || item.disabled?.(tableProps)\n\n const getIcon = (item: TActionMenuItem<TDataType>) =>\n typeof item.icon === \"function\" ? <item.icon {...tableProps} /> : item.icon\n\n // closure function that alters the menustate to set loading to true for this specific ActionItem\n const setLoading = useCallback(\n (item: TActionMenuItem<TDataType>) => (value: boolean) => {\n dispatchLoading(item.id, value)\n },\n [menuState]\n )\n\n // Condition if the amount of items is less than 3, it's not a menu, it's just two icons next to each other\n if (items.length <= 2) {\n return (\n <span className={classes[\"icon-container\"]}>\n {items.map((item) => {\n if (item.hidden?.(tableProps)) return null\n\n return (\n <Tooltip key={item.id} label={getTooltipText(item)}>\n <span>\n <ActionIcon\n key={item.id}\n className={classes.icon}\n disabled={getIsMenuItemDisabled(item)}\n onClick={() => handleItemClick(item)}\n >\n <span>{getIcon(item)}</span>\n </ActionIcon>\n </span>\n </Tooltip>\n )\n })}\n </span>\n )\n }\n\n return (\n <ActionMenu\n actionIcon={actionIcon}\n opened={getOwnMenuState?.open}\n onOpen={() => dispatchOpen(true)}\n onClose={() => dispatchOpen(false)}\n {...menuProps}\n >\n <>\n {items.map((item) => {\n if (item.hidden?.(tableProps)) return null\n\n return (\n <Tooltip\n key={item.id}\n label={getTooltipText(item)}\n disabled={!item.tooltip?.showInMenu?.(tableProps)}\n >\n <span>\n <Menu.Item\n className={classes.item}\n key={item.id}\n disabled={getIsMenuItemDisabled(item)}\n onClick={() => handleItemClick(item)}\n leftSection={getIcon(item)}\n >\n {getLabel(item.label, tableProps)}\n </Menu.Item>\n </span>\n </Tooltip>\n )\n })}\n </>\n </ActionMenu>\n )\n }\n}\n\ntype TActionMenuProps = MenuProps & {\n actionIcon?: ReactNode\n children: ReactNode\n}\n\n/**\n * Simple UI Action Menu component opened by Icon click\n * @param actionIcon Icon for Opener\n * @param children Children menu items\n * @param menuProps Properties for the Menu component\n * @constructor\n */\nconst ActionMenu = ({ actionIcon, children, ...menuProps }: TActionMenuProps) => {\n return (\n <div className={classes[\"action-container\"]} data-testid={\"table-action-menu\"}>\n <Menu shadow=\"md\" width={180} {...menuProps}>\n <Menu.Target>\n <ActionIcon data-testid={\"table-action-menu-opener\"} className={classes.icon}>\n {actionIcon || <MoreVertical />}\n </ActionIcon>\n </Menu.Target>\n\n <Menu.Dropdown>{children}</Menu.Dropdown>\n </Menu>\n </div>\n )\n}\n\nexport { createWiredActionMenuComponent, ActionMenu }\n"],"names":["ActionMenu","createWiredActionMenuComponent","getLabel","label","tableProps","setMenuState","menuState","items","setModalOpen","menuProps","actionIcon","getOwnMenuState","useMemo","id","dispatchLoading","isLoading","type","payload","loading","dispatchOpen","open","state","handleItemClick","item","modal","action","setLoading","getTooltipText","tooltip","customText","getIsMenuItemDisabled","includes","disabled","getIcon","icon","useCallback","value","length","span","className","classes","map","hidden","Tooltip","ActionIcon","onClick","opened","onOpen","onClose","showInMenu","Menu","Item","leftSection","children","div","data-testid","shadow","width","Target","MoreVertical","Dropdown"],"mappings":"mPAgNyCA,oBAAAA,gBAAhCC,wCAAAA,qGA5MmC,4CACf,qCAQ6B,gCAClC,6FACJ,w4EAmBpB,SAASC,SACPC,KAA0C,CAC1CC,UAA0C,EAE1C,GAAI,OAAOD,QAAU,WAAY,CAC/B,OAAOA,MAAMC,WACf,CACA,OAAOD,KACT,CAaA,SAASF,+BAA0C,CACjDI,YAAY,CACZC,SAAS,CACTC,KAAK,CACLC,YAAY,CAC+B,EAG3C,MAAO,CAAC,CAAEJ,UAAU,CAAEK,SAAS,CAAEC,UAAU,CAAoC,IAG7E,MAAMC,gBAAkBC,GAAAA,cAAO,EAAC,IAAMN,SAAS,CAACF,WAAWS,EAAE,CAAC,CAAE,CAACP,UAAU,EAE3E,MAAMQ,gBAAkB,CAACX,MAAeY,YACtCV,aAAa,CACXW,KAAM,cACNC,QAAS,CACPJ,GAAIT,WAAWS,EAAE,CACjBK,QAAS,CACPf,MACAY,SACF,CACF,CACF,GACF,MAAMI,aAAe,AAACC,MACpBf,aAAa,CACXW,KAAM,WACNC,QAAS,CACPJ,GAAIT,WAAWS,EAAE,CACjBQ,MAAO,CACLD,IACF,CACF,CACF,GAEF,MAAME,gBAAkB,AAACC,WAENA,YACbA,oBAFJA,KAAKC,KAAK,CACNhB,cAAae,YAAAA,KAAKC,KAAK,UAAVD,4BAAAA,YAAYV,EAAE,CAAET,eAC7BmB,aAAAA,KAAKE,MAAM,UAAXF,6BAAAA,kBAAAA,KAAcnB,WAAY,CACxBsB,WAAYA,WAAWH,KACzB,IAEN,MAAMI,eAAiB,AAACJ,WACtBA,yBAAAA,cACIA,qBADJA,EAAAA,cAAAA,KAAKK,OAAO,UAAZL,+BAAAA,yBAAAA,cAAcM,UAAU,UAAxBN,yCAAAA,8BAAAA,cAA2BnB,cACvBmB,eAAAA,KAAKK,OAAO,UAAZL,+BAAAA,eAAcM,UAAU,CAACzB,YACzBF,SAASqB,KAAKpB,KAAK,CAAEC,aAE3B,MAAM0B,sBAAwB,AAACP,WAC7BZ,yBAA+CY,qBAA/CZ,CAAAA,wBAAAA,iCAAAA,yBAAAA,gBAAiBO,OAAO,UAAxBP,yCAAAA,yBAA0BoB,QAAQ,CAACR,KAAKV,EAAE,MAAKU,eAAAA,KAAKS,QAAQ,UAAbT,+BAAAA,oBAAAA,KAAgBnB,cAEjE,MAAM6B,QAAU,AAACV,MACf,OAAOA,KAAKW,IAAI,GAAK,WAAa,oBAACX,KAAKW,IAAI,mBAAK9B,aAAiBmB,KAAKW,IAAI,CAG7E,MAAMR,WAAaS,GAAAA,kBAAW,EAC5B,AAACZ,MAAqC,AAACa,QACrCtB,gBAAgBS,KAAKV,EAAE,CAAEuB,MAC3B,EACA,CAAC9B,UAAU,EAIb,GAAIC,MAAM8B,MAAM,EAAI,EAAG,CACrB,MACE,oBAACC,QAAKC,UAAWC,4BAAO,CAAC,iBAAiB,UACvCjC,MAAMkC,GAAG,CAAC,AAAClB,WACNA,aAAJ,IAAIA,aAAAA,KAAKmB,MAAM,UAAXnB,6BAAAA,kBAAAA,KAAcnB,YAAa,OAAO,KAEtC,MACE,oBAACuC,gBAAO,EAAexC,MAAOwB,eAAeJ,eAC3C,oBAACe,iBACC,oBAACM,gBAAU,EAETL,UAAWC,4BAAO,CAACN,IAAI,CACvBF,SAAUF,sBAAsBP,MAChCsB,QAAS,IAAMvB,gBAAgBC,eAE/B,oBAACe,iBAAML,QAAQV,SALVA,KAAKV,EAAE,KAHJU,KAAKV,EAAE,CAazB,IAGN,CAEA,MACE,oBAACb,gDACCU,WAAYA,WACZoC,MAAM,CAAEnC,wBAAAA,gCAAAA,gBAAiBS,IAAI,CAC7B2B,OAAQ,IAAM5B,aAAa,MAC3B6B,QAAS,IAAM7B,aAAa,QACxBV,qBAEJ,mDACGF,MAAMkC,GAAG,CAAC,AAAClB,WACNA,aAMWA,yBAAAA,cANf,IAAIA,aAAAA,KAAKmB,MAAM,UAAXnB,6BAAAA,kBAAAA,KAAcnB,YAAa,OAAO,KAEtC,MACE,oBAACuC,gBAAO,EAENxC,MAAOwB,eAAeJ,MACtBS,SAAU,GAACT,cAAAA,KAAKK,OAAO,UAAZL,+BAAAA,yBAAAA,cAAc0B,UAAU,UAAxB1B,yCAAAA,8BAAAA,cAA2BnB,sBAEtC,oBAACkC,iBACC,oBAACY,UAAI,CAACC,IAAI,EACRZ,UAAWC,4BAAO,CAACjB,IAAI,CAEvBS,SAAUF,sBAAsBP,MAChCsB,QAAS,IAAMvB,gBAAgBC,MAC/B6B,YAAanB,QAAQV,eAEpBrB,SAASqB,KAAKpB,KAAK,CAAEC,aALjBmB,KAAKV,EAAE,KAPXU,KAAKV,EAAE,CAiBlB,OAIR,CACF,CAcA,MAAMb,WAAa,QAAC,CAAEU,UAAU,CAAE2C,QAAQ,CAAkC,IAA7B5C,mEAC7C,MACE,oBAAC6C,OAAIf,UAAWC,4BAAO,CAAC,mBAAmB,CAAEe,cAAa,6BACxD,qBAACL,UAAI,sCAACM,OAAO,KAAKC,MAAO,KAAShD,sBAChC,oBAACyC,UAAI,CAACQ,MAAM,WACV,oBAACd,gBAAU,EAACW,cAAa,2BAA4BhB,UAAWC,4BAAO,CAACN,IAAI,UACzExB,YAAc,oBAACiD,yBAAY,SAIhC,oBAACT,UAAI,CAACU,QAAQ,WAAEP,gBAIxB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});_export_star(require("./TableClientSide"),exports);_export_star(require("./TableServerSide"),exports);_export_star(require("./constants"),exports);_export_star(require("./types"),exports);_export_star(require("./TableServerSide/useTableServerSide"),exports);_export_star(require("./TableServerSide/TableServerSidePersistent"),exports);_export_star(require("./TableClientSide/useTableClientSide"),exports);_export_star(require("./TableClientSide/TableClientSidePersistent"),exports);_export_star(require("./hooks/useRowFactoryBuilder"),exports);_export_star(require("./addons"),exports);function _export_star(from,to){Object.keys(from).forEach(function(k){if(k!=="default"&&!Object.prototype.hasOwnProperty.call(to,k)){Object.defineProperty(to,k,{enumerable:true,get:function(){return from[k]}})}});return from}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});_export_star(require("./TableClientSide"),exports);_export_star(require("./TableServerSide"),exports);_export_star(require("./constants"),exports);_export_star(require("./types"),exports);_export_star(require("./TableServerSide/useTableServerSide"),exports);_export_star(require("./TableServerSide/TableServerSidePersistent"),exports);_export_star(require("./TableClientSide/useTableClientSide"),exports);_export_star(require("./TableClientSide/TableClientSidePersistent"),exports);_export_star(require("./hooks/useRowFactoryBuilder"),exports);_export_star(require("./addons"),exports);_export_star(require("./persistence/TableSessionStorage"),exports);_export_star(require("./TableClientSide/state/sortSlice"),exports);function _export_star(from,to){Object.keys(from).forEach(function(k){if(k!=="default"&&!Object.prototype.hasOwnProperty.call(to,k)){Object.defineProperty(to,k,{enumerable:true,get:function(){return from[k]}})}});return from}
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Table/index.ts"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nexport * from \"./TableClientSide\"\nexport * from \"./TableServerSide\"\nexport * from \"./constants\"\nexport * from \"./types\"\nexport * from \"./TableServerSide/useTableServerSide\"\nexport * from \"./TableServerSide/TableServerSidePersistent\"\nexport * from \"./TableClientSide/useTableClientSide\"\nexport * from \"./TableClientSide/TableClientSidePersistent\"\nexport * from \"./hooks/useRowFactoryBuilder\"\nexport * from \"./addons\"\n"],"names":[],"mappings":"2FAIc,mDACA,mDACA,6CACA,yCACA,sEACA,6EACA,sEACA,6EACA,8DACA"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Table/index.ts"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nexport * from \"./TableClientSide\"\nexport * from \"./TableServerSide\"\nexport * from \"./constants\"\nexport * from \"./types\"\nexport * from \"./TableServerSide/useTableServerSide\"\nexport * from \"./TableServerSide/TableServerSidePersistent\"\nexport * from \"./TableClientSide/useTableClientSide\"\nexport * from \"./TableClientSide/TableClientSidePersistent\"\nexport * from \"./hooks/useRowFactoryBuilder\"\nexport * from \"./addons\"\nexport * from \"./persistence/TableSessionStorage\"\nexport * from \"./TableClientSide/state/sortSlice\"\n"],"names":[],"mappings":"2FAIc,mDACA,mDACA,6CACA,yCACA,sEACA,6EACA,sEACA,6EACA,8DACA,0CACA,mEACA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Tag",{enumerable:true,get:function(){return Tag}});const _jsxruntime=require("react/jsx-runtime");const _Badge=require("../Badge");const _theme=require("../../theme");const _TextWithTooltip=require("../TextWithTooltip");const _Tagmodulecss=/*#__PURE__*/_interop_require_default(require("./Tag.module.css"));function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const Tag=_0=>{let{name,value}=_0,badgeProps=_object_without_properties(_0,["name","value"]);return(0,_jsxruntime.jsx)(_Badge.Badge,_object_spread_props(_object_spread({className:_Tagmodulecss.default["tag-name"],color:_theme.EThemeColors.NeutralLight},badgeProps),{children:(0,_jsxruntime.jsx)(_TextWithTooltip.TextWithTooltip,{tooltipProps:{multiline:true,style:{width:300}},classNameText:_Tagmodulecss.default.typo,classNameTooltip:_Tagmodulecss.default["tooltip-text"],text:`${name}: ${value}`,tooltip:`${name}: ${value}`,typoType:"small"})}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Tag",{enumerable:true,get:function(){return Tag}});const _jsxruntime=require("react/jsx-runtime");const _Badge=require("../Badge");const _theme=require("../../theme");const _TextWithTooltip=require("../TextWithTooltip");const _Tagmodulecss=/*#__PURE__*/_interop_require_default(require("./Tag.module.css"));function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const Tag=_0=>{let{name,value}=_0,badgeProps=_object_without_properties(_0,["name","value"]);return(0,_jsxruntime.jsx)(_Badge.Badge,_object_spread_props(_object_spread({className:_Tagmodulecss.default["tag-name"],color:_theme.EThemeColors.NeutralLight},badgeProps),{children:(0,_jsxruntime.jsx)(_TextWithTooltip.TextWithTooltip,{tooltipProps:{multiline:true,style:{width:300}},classNameText:_Tagmodulecss.default.typo,classNameTooltip:_Tagmodulecss.default["tooltip-text"],text:`${name}: ${value}`,tooltip:`${name}: ${value}`,typoType:"small"})}))};
|
|
2
2
|
//# sourceMappingURL=Tag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { FC } from \"react\"\nimport { Badge, TBadgeProps } from \"../Badge\"\nimport { EThemeColors } from \"../../theme\"\nimport { TextWithTooltip } from \"../TextWithTooltip\"\nimport classes from \"./Tag.module.css\"\n\nexport type TTagProps = Partial<TBadgeProps> & {\n name: string\n value: string\n}\nexport const Tag: FC<TTagProps> = ({ name, value, ...badgeProps }) => {\n return (\n <Badge className={classes[\"tag-name\"]} color={EThemeColors.NeutralLight} {...badgeProps}>\n <TextWithTooltip\n tooltipProps={{\n multiline: true,\n style: {\n width: 300,\n },\n }}\n classNameText={classes.typo}\n classNameTooltip={classes[\"tooltip-text\"]}\n text={`${name}: ${value}`}\n tooltip={`${name}: ${value}`}\n typoType={\"small\"}\n />\n </Badge>\n )\n}\n"],"names":["Tag","name","value","badgeProps","Badge","className","classes","color","EThemeColors","NeutralLight","TextWithTooltip","tooltipProps","multiline","style","width","classNameText","typo","classNameTooltip","text","tooltip","typoType"],"mappings":"oGAcaA,6CAAAA,2EATsB,iCACN,8CACG,wFACZ,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { FC } from \"react\"\nimport { Badge, TBadgeProps } from \"../Badge\"\nimport { EThemeColors } from \"../../theme\"\nimport { TextWithTooltip } from \"../TextWithTooltip\"\nimport classes from \"./Tag.module.css\"\n\nexport type TTagProps = Partial<TBadgeProps> & {\n name: string\n value: string\n}\nexport const Tag: FC<TTagProps> = ({ name, value, ...badgeProps }) => {\n return (\n <Badge className={classes[\"tag-name\"]} color={EThemeColors.NeutralLight} {...badgeProps}>\n <TextWithTooltip\n tooltipProps={{\n multiline: true,\n style: {\n width: 300,\n },\n }}\n classNameText={classes.typo}\n classNameTooltip={classes[\"tooltip-text\"]}\n text={`${name}: ${value}`}\n tooltip={`${name}: ${value}`}\n typoType={\"small\"}\n />\n </Badge>\n )\n}\n"],"names":["Tag","name","value","badgeProps","Badge","className","classes","color","EThemeColors","NeutralLight","TextWithTooltip","tooltipProps","multiline","style","width","classNameText","typo","classNameTooltip","text","tooltip","typoType"],"mappings":"oGAcaA,6CAAAA,2EATsB,iCACN,8CACG,wFACZ,i4EAMb,MAAMA,IAAqB,QAAC,CAAEC,IAAI,CAAEC,KAAK,CAAiB,IAAZC,2DACnD,MACE,oBAACC,YAAK,sCAACC,UAAWC,qBAAO,CAAC,WAAW,CAAEC,MAAOC,mBAAY,CAACC,YAAY,EAAMN,sBAC3E,oBAACO,gCAAe,EACdC,aAAc,CACZC,UAAW,KACXC,MAAO,CACLC,MAAO,GACT,CACF,EACAC,cAAeT,qBAAO,CAACU,IAAI,CAC3BC,iBAAkBX,qBAAO,CAAC,eAAe,CACzCY,KAAM,CAAC,EAAEjB,KAAK,EAAE,EAAEC,MAAM,CAAC,CACzBiB,QAAS,CAAC,EAAElB,KAAK,EAAE,EAAEC,MAAM,CAAC,CAC5BkB,SAAU,YAIlB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get TimeZoneInfo(){return TimeZoneInfo},get getTimeZoneInformation(){return getTimeZoneInformation}});const _jsxruntime=require("react/jsx-runtime");const _Typo=require("../Typo");const _luxon=require("luxon");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const getTimeZoneInformation=ianaTimeZone=>{var _now_zoneName;const browserTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone;const fallbackTimeZone="UTC";if(!ianaTimeZone){ianaTimeZone=browserTimeZone}if(!_luxon.IANAZone.isValidZone(ianaTimeZone)){ianaTimeZone=fallbackTimeZone;console.warn(`Invalid timezone provided: ${ianaTimeZone}. Using fallback timezone: ${fallbackTimeZone}`)}const now=_luxon.DateTime.now().setZone(ianaTimeZone);const offsetMinutes=now.offset;const offsetHours=offsetMinutes/60;const sign=offsetMinutes>=0?"+":"-";const hoursPart=Math.floor(Math.abs(offsetMinutes)/60).toString().padStart(2,"0");const minutesPart=(Math.abs(offsetMinutes)%60).toString().padStart(2,"0");const offsetString=`${sign}${hoursPart}:${minutesPart}`;const label=(_now_zoneName=now.zoneName)!==null&&_now_zoneName!==void 0?_now_zoneName:fallbackTimeZone;return{label,offsetMinutes,offsetHours,offsetString}};const TimeZoneInfo=_0=>{let{timezone}=_0,props=_object_without_properties(_0,["timezone"]);return(0,_jsxruntime.jsxs)(_Typo.Typo,_object_spread_props(_object_spread({type:"body",display:"inline"},props),{children:[timezone.label," (GMT ",timezone.offsetString,")"]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get TimeZoneInfo(){return TimeZoneInfo},get getTimeZoneInformation(){return getTimeZoneInformation}});const _jsxruntime=require("react/jsx-runtime");const _Typo=require("../Typo");const _luxon=require("luxon");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const getTimeZoneInformation=ianaTimeZone=>{var _now_zoneName;const browserTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone;const fallbackTimeZone="UTC";if(!ianaTimeZone){ianaTimeZone=browserTimeZone}if(!_luxon.IANAZone.isValidZone(ianaTimeZone)){ianaTimeZone=fallbackTimeZone;console.warn(`Invalid timezone provided: ${ianaTimeZone}. Using fallback timezone: ${fallbackTimeZone}`)}const now=_luxon.DateTime.now().setZone(ianaTimeZone);const offsetMinutes=now.offset;const offsetHours=offsetMinutes/60;const sign=offsetMinutes>=0?"+":"-";const hoursPart=Math.floor(Math.abs(offsetMinutes)/60).toString().padStart(2,"0");const minutesPart=(Math.abs(offsetMinutes)%60).toString().padStart(2,"0");const offsetString=`${sign}${hoursPart}:${minutesPart}`;const label=(_now_zoneName=now.zoneName)!==null&&_now_zoneName!==void 0?_now_zoneName:fallbackTimeZone;return{label,offsetMinutes,offsetHours,offsetString}};const TimeZoneInfo=_0=>{let{timezone}=_0,props=_object_without_properties(_0,["timezone"]);return(0,_jsxruntime.jsxs)(_Typo.Typo,_object_spread_props(_object_spread({type:"body",display:"inline"},props),{children:[timezone.label," (GMT ",timezone.offsetString,")"]}))};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/TimeZoneInfo/index.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { FC } from \"react\"\nimport { TTypoProps, Typo } from \"../Typo\"\nimport { DateTime, IANAZone } from \"luxon\"\n\nexport type TTimeZoneDetails = {\n label: string\n offsetMinutes: number\n offsetHours: number\n offsetString: string\n}\n\nexport const getTimeZoneInformation = (ianaTimeZone?: string): TTimeZoneDetails => {\n const browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone\n const fallbackTimeZone = \"UTC\"\n\n if (!ianaTimeZone) {\n ianaTimeZone = browserTimeZone\n }\n\n if (!IANAZone.isValidZone(ianaTimeZone)) {\n ianaTimeZone = fallbackTimeZone\n console.warn(\n `Invalid timezone provided: ${ianaTimeZone}. Using fallback timezone: ${fallbackTimeZone}`\n )\n }\n\n const now = DateTime.now().setZone(ianaTimeZone)\n const offsetMinutes = now.offset\n const offsetHours = offsetMinutes / 60\n const sign = offsetMinutes >= 0 ? \"+\" : \"-\"\n const hoursPart = Math.floor(Math.abs(offsetMinutes) / 60)\n .toString()\n .padStart(2, \"0\")\n const minutesPart = (Math.abs(offsetMinutes) % 60).toString().padStart(2, \"0\")\n const offsetString = `${sign}${hoursPart}:${minutesPart}`\n const label = now.zoneName ?? fallbackTimeZone\n\n return {\n label,\n offsetMinutes,\n offsetHours,\n offsetString,\n }\n}\n\nexport type TTimeZoneInfoProps = Partial<TTypoProps> & {\n timezone: TTimeZoneDetails\n}\nexport const TimeZoneInfo: FC<TTimeZoneInfoProps> = ({ timezone, ...props }) => {\n return (\n <Typo type={\"body\"} display={\"inline\"} {...props}>\n {timezone.label} (GMT {timezone.offsetString})\n </Typo>\n )\n}\n"],"names":["TimeZoneInfo","getTimeZoneInformation","ianaTimeZone","now","browserTimeZone","Intl","DateTimeFormat","resolvedOptions","timeZone","fallbackTimeZone","IANAZone","isValidZone","console","warn","DateTime","setZone","offsetMinutes","offset","offsetHours","sign","hoursPart","Math","floor","abs","toString","padStart","minutesPart","offsetString","label","zoneName","timezone","props","Typo","type","display"],"mappings":"mPAoDaA,sBAAAA,kBArCAC,gCAAAA,6FAVoB,gCACE,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/TimeZoneInfo/index.tsx"],"sourcesContent":["/* Copyright (C) Greenbone AG\n *\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { FC } from \"react\"\nimport { TTypoProps, Typo } from \"../Typo\"\nimport { DateTime, IANAZone } from \"luxon\"\n\nexport type TTimeZoneDetails = {\n label: string\n offsetMinutes: number\n offsetHours: number\n offsetString: string\n}\n\nexport const getTimeZoneInformation = (ianaTimeZone?: string): TTimeZoneDetails => {\n const browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone\n const fallbackTimeZone = \"UTC\"\n\n if (!ianaTimeZone) {\n ianaTimeZone = browserTimeZone\n }\n\n if (!IANAZone.isValidZone(ianaTimeZone)) {\n ianaTimeZone = fallbackTimeZone\n console.warn(\n `Invalid timezone provided: ${ianaTimeZone}. Using fallback timezone: ${fallbackTimeZone}`\n )\n }\n\n const now = DateTime.now().setZone(ianaTimeZone)\n const offsetMinutes = now.offset\n const offsetHours = offsetMinutes / 60\n const sign = offsetMinutes >= 0 ? \"+\" : \"-\"\n const hoursPart = Math.floor(Math.abs(offsetMinutes) / 60)\n .toString()\n .padStart(2, \"0\")\n const minutesPart = (Math.abs(offsetMinutes) % 60).toString().padStart(2, \"0\")\n const offsetString = `${sign}${hoursPart}:${minutesPart}`\n const label = now.zoneName ?? fallbackTimeZone\n\n return {\n label,\n offsetMinutes,\n offsetHours,\n offsetString,\n }\n}\n\nexport type TTimeZoneInfoProps = Partial<TTypoProps> & {\n timezone: TTimeZoneDetails\n}\nexport const TimeZoneInfo: FC<TTimeZoneInfoProps> = ({ timezone, ...props }) => {\n return (\n <Typo type={\"body\"} display={\"inline\"} {...props}>\n {timezone.label} (GMT {timezone.offsetString})\n </Typo>\n )\n}\n"],"names":["TimeZoneInfo","getTimeZoneInformation","ianaTimeZone","now","browserTimeZone","Intl","DateTimeFormat","resolvedOptions","timeZone","fallbackTimeZone","IANAZone","isValidZone","console","warn","DateTime","setZone","offsetMinutes","offset","offsetHours","sign","hoursPart","Math","floor","abs","toString","padStart","minutesPart","offsetString","label","zoneName","timezone","props","Typo","type","display"],"mappings":"mPAoDaA,sBAAAA,kBArCAC,gCAAAA,6FAVoB,gCACE,iyEAS5B,MAAMA,uBAAyB,AAACC,mBAwBvBC,cAvBd,MAAMC,gBAAkBC,KAAKC,cAAc,GAAGC,eAAe,GAAGC,QAAQ,CACxE,MAAMC,iBAAmB,MAEzB,GAAI,CAACP,aAAc,CACjBA,aAAeE,eACjB,CAEA,GAAI,CAACM,eAAQ,CAACC,WAAW,CAACT,cAAe,CACvCA,aAAeO,iBACfG,QAAQC,IAAI,CACV,CAAC,2BAA2B,EAAEX,aAAa,2BAA2B,EAAEO,iBAAiB,CAAC,CAE9F,CAEA,MAAMN,IAAMW,eAAQ,CAACX,GAAG,GAAGY,OAAO,CAACb,cACnC,MAAMc,cAAgBb,IAAIc,MAAM,CAChC,MAAMC,YAAcF,cAAgB,GACpC,MAAMG,KAAOH,eAAiB,EAAI,IAAM,IACxC,MAAMI,UAAYC,KAAKC,KAAK,CAACD,KAAKE,GAAG,CAACP,eAAiB,IACpDQ,QAAQ,GACRC,QAAQ,CAAC,EAAG,KACf,MAAMC,YAAc,AAACL,CAAAA,KAAKE,GAAG,CAACP,eAAiB,EAAC,EAAGQ,QAAQ,GAAGC,QAAQ,CAAC,EAAG,KAC1E,MAAME,aAAe,CAAC,EAAER,KAAK,EAAEC,UAAU,CAAC,EAAEM,YAAY,CAAC,CACzD,MAAME,OAAQzB,cAAAA,IAAI0B,QAAQ,UAAZ1B,uBAAAA,cAAgBM,iBAE9B,MAAO,CACLmB,MACAZ,cACAE,YACAS,YACF,CACF,EAKO,MAAM3B,aAAuC,QAAC,CAAE8B,QAAQ,CAAY,IAAPC,kDAClE,MACE,qBAACC,UAAI,sCAACC,KAAM,OAAQC,QAAS,UAAcH,kBACxCD,SAASF,KAAK,CAAC,SAAOE,SAASH,YAAY,CAAC,OAGnD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Tooltip",{enumerable:true,get:function(){return Tooltip}});const _jsxruntime=require("react/jsx-runtime");const _core=require("@mantine/core");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const Tooltip=_0=>{let{children,width}=_0,props=_object_without_properties(_0,["children","width"]);return(0,_jsxruntime.jsx)(_core.Tooltip,_object_spread_props(_object_spread({withArrow:true,arrowSize:8,offset:0,withinPortal:true,style:{width}},props),{children:children}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Tooltip",{enumerable:true,get:function(){return Tooltip}});const _jsxruntime=require("react/jsx-runtime");const _core=require("@mantine/core");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(Object(source));for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}const Tooltip=_0=>{let{children,width}=_0,props=_object_without_properties(_0,["children","width"]);return(0,_jsxruntime.jsx)(_core.Tooltip,_object_spread_props(_object_spread({withArrow:true,arrowSize:8,offset:0,withinPortal:true,style:{width}},props),{children:children}))};
|
|
2
2
|
//# sourceMappingURL=Tooltip.js.map
|