UNPKG

@coveord/plasma-mantine

Version:

A Plasma flavoured Mantine theme

53 lines (52 loc) 1.71 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "TableActionsColumn", { enumerable: true, get: function() { return TableActionsColumn; } }); var _object_spread = require("@swc/helpers/_/_object_spread"); var _object_without_properties = require("@swc/helpers/_/_object_without_properties"); var _jsxruntime = require("react/jsx-runtime"); var _plasmareacticons = require("@coveord/plasma-react-icons"); var _core = require("@mantine/core"); var _TableActionsList = require("../table-actions/TableActionsList"); var _TableContext = require("../TableContext"); var TableActionsColumn = { id: 'actions', enableSorting: false, enableHiding: false, meta: { controlColumn: true }, header: '', size: 84, cell: function(info) { return /*#__PURE__*/ (0, _jsxruntime.jsx)(ActionsMenu, { info: info }); } }; var defaultProps = { label: 'Actions', icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_plasmareacticons.MoreSize16Px, { height: 16 }) }; var ActionsMenu = function(props) { var getRowActions = (0, _TableContext.useTableContext)().getRowActions; var _useProps = (0, _core.useProps)('PlasmaTableActionsColumn', defaultProps, props), info = _useProps.info, others = _object_without_properties._(_useProps, [ "info" ]); var actionsElements = getRowActions([ info.row.original ]); return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TableActionsList.TableActionsList, _object_spread._({ actions: actionsElements, variant: "combined" }, others)); }; //# sourceMappingURL=TableActionsColumn.js.map