@bigbinary/neeto-molecules 5.1.6 → 5.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/v2/MoreDropdown.js +8 -4
- package/dist/cjs/v2/MoreDropdown.js.map +1 -1
- package/dist/cjs/v2/TableWrapper.js +25 -0
- package/dist/cjs/v2/TableWrapper.js.map +1 -0
- package/dist/v2/MoreDropdown.js +8 -4
- package/dist/v2/MoreDropdown.js.map +1 -1
- package/dist/v2/TableWrapper.js +23 -0
- package/dist/v2/TableWrapper.js.map +1 -0
- package/package.json +1 -1
|
@@ -94,7 +94,8 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
var _excluded = ["isRounded", "size", "tooltipProps", "variant"],
|
|
97
|
-
_excluded2 = ["
|
|
97
|
+
_excluded2 = ["className"],
|
|
98
|
+
_excluded3 = ["isVisible", "key"];
|
|
98
99
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
99
100
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
100
101
|
var MoreDropdown = function MoreDropdown(_ref) {
|
|
@@ -121,6 +122,8 @@ var MoreDropdown = function MoreDropdown(_ref) {
|
|
|
121
122
|
buttonProps = _objectWithoutProperties(dropdownButtonProps, _excluded);
|
|
122
123
|
var tooltipProps = ramda.mergeRight(DEFAULT_TOOLTIP_PROPS, customTooltipProps);
|
|
123
124
|
var TargetIcon = isVertical ? EllipsisVertical : ellipsis.Ellipsis;
|
|
125
|
+
var contentClassName = dropdownProps.className,
|
|
126
|
+
restDropdownProps = _objectWithoutProperties(dropdownProps, _excluded2);
|
|
124
127
|
var isDropdownDisabled = isDisabled || dropdownProps.disabled;
|
|
125
128
|
var triggerClassName = classnames("shrink-0", {
|
|
126
129
|
"rounded-full": isRoundedButton
|
|
@@ -154,14 +157,15 @@ var MoreDropdown = function MoreDropdown(_ref) {
|
|
|
154
157
|
size: buttonSize
|
|
155
158
|
}, buttonProps)),
|
|
156
159
|
dropdownProps: {
|
|
157
|
-
"aria-label": t("neetoMolecules.moreDropdown.menuAriaLabel")
|
|
160
|
+
"aria-label": t("neetoMolecules.moreDropdown.menuAriaLabel"),
|
|
161
|
+
className: contentClassName
|
|
158
162
|
}
|
|
159
|
-
},
|
|
163
|
+
}, restDropdownProps), {}, {
|
|
160
164
|
children: [menuTopChildren, menuItems.map(function (_ref2) {
|
|
161
165
|
var _ref2$isVisible = _ref2.isVisible,
|
|
162
166
|
isVisible = _ref2$isVisible === void 0 ? true : _ref2$isVisible,
|
|
163
167
|
key = _ref2.key,
|
|
164
|
-
menuItemProps = _objectWithoutProperties(_ref2,
|
|
168
|
+
menuItemProps = _objectWithoutProperties(_ref2, _excluded3);
|
|
165
169
|
if (!isVisible) return null;
|
|
166
170
|
return /*#__PURE__*/jsxRuntime.jsx(MenuItem, _objectSpread({}, menuItemProps), key !== null && key !== void 0 ? key : neetoCist.hyphenate(menuItemProps.label || "menu-item"));
|
|
167
171
|
}), menuBottomChildren]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreDropdown.js","sources":["../../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.js","../../../src/v2/components/MoreDropdown/constants.js","../../../src/v2/components/MoreDropdown/Submenu.jsx","../../../src/v2/components/MoreDropdown/MenuItem.jsx","../../../src/v2/components/MoreDropdown/index.jsx"],"sourcesContent":["/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\", key: \"41hilf\" }],\n [\"circle\", { cx: \"12\", cy: \"5\", r: \"1\", key: \"gxeob9\" }],\n [\"circle\", { cx: \"12\", cy: \"19\", r: \"1\", key: \"lyex9k\" }]\n];\nconst EllipsisVertical = createLucideIcon(\"ellipsis-vertical\", __iconNode);\n\nexport { __iconNode, EllipsisVertical as default };\n//# sourceMappingURL=ellipsis-vertical.js.map\n","const MENU_ITEM_TYPES = { menuItem: \"menuItem\", divider: \"divider\" };\n\nconst DEFAULT_TOOLTIP_PROPS = { disabled: true, position: \"bottom\" };\n\nconst BUTTON_VARIANTS = [\n \"default\",\n \"secondary\",\n \"destructive\",\n \"destructive-soft\",\n \"outline\",\n \"ghost\",\n \"link\",\n];\n\nconst BUTTON_SIZES = [\n \"default\",\n \"xs\",\n \"sm\",\n \"lg\",\n \"icon\",\n \"icon-xs\",\n \"icon-sm\",\n \"icon-lg\",\n];\n\nconst DROPDOWN_POSITIONS = [\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"top-start\",\n \"top-end\",\n \"bottom-start\",\n \"bottom-end\",\n \"left-start\",\n \"left-end\",\n \"right-start\",\n \"right-end\",\n \"auto\",\n];\n\nexport {\n MENU_ITEM_TYPES,\n DEFAULT_TOOLTIP_PROPS,\n BUTTON_VARIANTS,\n BUTTON_SIZES,\n DROPDOWN_POSITIONS,\n};\n","import { DropdownMenu } from \"@bigbinary/neeto-atoms\";\nimport { hyphenate } from \"neetocist\";\nimport { withT } from \"neetocommons/v2/react-utils\";\n\nimport MenuItem from \"./MenuItem\";\n\nconst Submenu = withT(({ t, label, menuItems = [] }) => (\n <DropdownMenu.SubMenu\n {...{ label }}\n triggerProps={{ \"aria-haspopup\": \"menu\" }}\n contentProps={{\n \"aria-label\": t(\"neetoMolecules.moreDropdown.submenuAriaLabel\", {\n label,\n }),\n }}\n >\n {menuItems.map(({ isVisible = true, key, ...itemProps }) => {\n if (!isVisible) return null;\n\n return (\n <MenuItem\n key={key ?? hyphenate(itemProps.label || \"menu-item\")}\n {...itemProps}\n />\n );\n })}\n </DropdownMenu.SubMenu>\n));\n\nexport default Submenu;\n","import { DropdownMenu } from \"@bigbinary/neeto-atoms\";\n\nimport Submenu from \"./Submenu\";\n\nconst MenuItem = ({\n onClick,\n label,\n type = \"menuItem\",\n hasSubItems = false,\n menuItems,\n dropdownProps,\n ...menuItemProps\n}) => {\n if (type === \"divider\") return <DropdownMenu.Divider role=\"separator\" />;\n\n if (hasSubItems) {\n return (\n <Submenu {...{ dropdownProps, label, menuItems, ...menuItemProps }} />\n );\n }\n\n return (\n <DropdownMenu.MenuItem {...{ onClick }} role=\"menuitem\" {...menuItemProps}>\n {label}\n </DropdownMenu.MenuItem>\n );\n};\n\nexport default MenuItem;\n","import { Button, DropdownMenu, Tooltip } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { Ellipsis, EllipsisVertical } from \"lucide-react\";\nimport { hyphenate } from \"neetocist\";\nimport PropTypes from \"prop-types\";\nimport { mergeRight } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n BUTTON_SIZES,\n BUTTON_VARIANTS,\n DEFAULT_TOOLTIP_PROPS,\n DROPDOWN_POSITIONS,\n MENU_ITEM_TYPES,\n} from \"./constants\";\nimport MenuItem from \"./MenuItem\";\n\nconst MoreDropdown = ({\n dropdownButtonProps = {},\n isVertical = false,\n isDisabled = false,\n dropdownProps = {},\n menuTopChildren,\n menuBottomChildren,\n menuItems = [],\n}) => {\n const { t } = useTranslation();\n\n const {\n isRounded: isRoundedButton,\n size: buttonSize = \"icon\",\n tooltipProps: customTooltipProps,\n variant = \"ghost\",\n ...buttonProps\n } = dropdownButtonProps;\n\n const tooltipProps = mergeRight(DEFAULT_TOOLTIP_PROPS, customTooltipProps);\n\n const TargetIcon = isVertical ? EllipsisVertical : Ellipsis;\n\n const isDropdownDisabled = isDisabled || dropdownProps.disabled;\n\n const triggerClassName = classnames(\"shrink-0\", {\n \"rounded-full\": isRoundedButton,\n });\n\n if (isDropdownDisabled && !tooltipProps.disabled) {\n return (\n <Tooltip\n content={tooltipProps.content}\n position={tooltipProps.position || \"bottom\"}\n >\n <span>\n <Button\n {...{ variant }}\n disabled\n className={triggerClassName}\n data-dropdown-button-style=\"more-dropdown\"\n data-testid=\"more-dropdown-button\"\n icon={TargetIcon}\n size={buttonSize}\n {...buttonProps}\n />\n </span>\n </Tooltip>\n );\n }\n\n return (\n <DropdownMenu\n customTarget={\n <Button\n {...{ variant }}\n aria-haspopup=\"menu\"\n aria-label={t(\"neetoMolecules.moreDropdown.buttonAriaLabel\")}\n className={triggerClassName}\n data-dropdown-button-style=\"more-dropdown\"\n disabled={isDropdownDisabled}\n icon={TargetIcon}\n size={buttonSize}\n {...buttonProps}\n />\n }\n dropdownProps={{\n \"aria-label\": t(\"neetoMolecules.moreDropdown.menuAriaLabel\"),\n }}\n {...dropdownProps}\n >\n {menuTopChildren}\n {menuItems.map(({ isVisible = true, key, ...menuItemProps }) => {\n if (!isVisible) return null;\n\n return (\n <MenuItem\n key={key ?? hyphenate(menuItemProps.label || \"menu-item\")}\n {...menuItemProps}\n />\n );\n })}\n {menuBottomChildren}\n </DropdownMenu>\n );\n};\n\nMoreDropdown.propTypes = {\n /**\n * Props forwarded to the trigger Button (atom). Accepts every Button prop;\n * the listed keys are the most relevant.\n */\n dropdownButtonProps: PropTypes.shape({\n variant: PropTypes.oneOf(BUTTON_VARIANTS),\n size: PropTypes.oneOf(BUTTON_SIZES),\n label: PropTypes.string,\n isRounded: PropTypes.bool,\n disabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.node,\n position: PropTypes.oneOf(DROPDOWN_POSITIONS),\n disabled: PropTypes.bool,\n }),\n }),\n /** Render `EllipsisVertical` instead of `Ellipsis` for the trigger icon. */\n isVertical: PropTypes.bool,\n /** Disable the entire dropdown (trigger + menu). */\n isDisabled: PropTypes.bool,\n /**\n * Props forwarded to the underlying atom `DropdownMenu`.\n */\n dropdownProps: PropTypes.shape({\n position: PropTypes.oneOf(DROPDOWN_POSITIONS),\n closeOnEsc: PropTypes.bool,\n closeOnSelect: PropTypes.bool,\n closeOnOutsideClick: PropTypes.bool,\n isOpen: PropTypes.bool,\n onClose: PropTypes.func,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n }),\n /** Rendered above the dynamic `menuItems` inside the dropdown menu. */\n menuTopChildren: PropTypes.node,\n /** Rendered below the dynamic `menuItems` inside the dropdown menu. */\n menuBottomChildren: PropTypes.node,\n /**\n * Each entry accepts every `DropdownMenu.MenuItem` prop (`prefix`, `suffix`,\n * `variant`, `isDisabled`, `to`, `href`, …) plus the wrapper-only fields below.\n */\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n key: PropTypes.string,\n type: PropTypes.oneOf(Object.values(MENU_ITEM_TYPES)),\n isVisible: PropTypes.bool,\n hasSubItems: PropTypes.bool,\n menuItems: PropTypes.array,\n })\n ),\n};\n\nexport default MoreDropdown;\n"],"names":["createLucideIcon","DEFAULT_TOOLTIP_PROPS","disabled","position","Submenu","withT","_ref","t","label","_ref$menuItems","menuItems","_jsx","DropdownMenu","SubMenu","triggerProps","contentProps","children","map","_ref2","_ref2$isVisible","isVisible","key","itemProps","_objectWithoutProperties","_excluded","MenuItem","_objectSpread","hyphenate","onClick","_ref$type","type","_ref$hasSubItems","hasSubItems","dropdownProps","menuItemProps","Divider","role","MoreDropdown","_ref$dropdownButtonPr","dropdownButtonProps","_ref$isVertical","isVertical","_ref$isDisabled","isDisabled","_ref$dropdownProps","menuTopChildren","menuBottomChildren","_useTranslation","useTranslation","isRoundedButton","isRounded","_dropdownButtonProps$","size","buttonSize","customTooltipProps","tooltipProps","_dropdownButtonProps$2","variant","buttonProps","mergeRight","TargetIcon","EllipsisVertical","Ellipsis","isDropdownDisabled","triggerClassName","classnames","Tooltip","content","Button","className","icon","_jsxs","customTarget","_excluded2"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC3D,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC1D,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC1D,CAAC;AACD,MAAM,gBAAgB,GAAGA,iCAAgB,CAAC,mBAAmB,EAAE,UAAU,CAAC;;ACZ1E,IAAMC,qBAAqB,GAAG;AAAEC,EAAAA,QAAQ,EAAE,IAAI;AAAEC,EAAAA,QAAQ,EAAE;AAAS,CAAC;;;;;ACIpE,IAAMC,OAAO,GAAGC,gBAAK,CAAC,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;AAAA,EAAA,oBAC/CE,cAAA,CAACC,uBAAY,CAACC,OAAO,EAAA;AACbL,IAAAA,KAAK,EAALA,KAAK;AACXM,IAAAA,YAAY,EAAE;AAAE,MAAA,eAAe,EAAE;KAAS;AAC1CC,IAA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CAAAL,KAAA,EAAAuD,UAAA,CAAA;AACvD,MAAA,IAAI,CAACrD,SAAS,EAAE,OAAO,IAAI;MAE3B,oBACET,cAAA,CAACc,QAAQ,EAAAC,aAAA,CAAA,EAAA,EAEHQ,aAAa,CAAA,EADZb,GAAG,KAAA,IAAA,IAAHA,GAAG,cAAHA,GAAG,GAAIM,mBAAS,CAACO,aAAa,CAAC1B,KAAK,IAAI,WAAW,CAEzD,CAAC;IAEN,CAAC,CAAC,EACDsC,kBAAkB;AAAA,GAAA,CACP,CAAC;AAEnB;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"MoreDropdown.js","sources":["../../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.js","../../../src/v2/components/MoreDropdown/constants.js","../../../src/v2/components/MoreDropdown/Submenu.jsx","../../../src/v2/components/MoreDropdown/MenuItem.jsx","../../../src/v2/components/MoreDropdown/index.jsx"],"sourcesContent":["/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\", key: \"41hilf\" }],\n [\"circle\", { cx: \"12\", cy: \"5\", r: \"1\", key: \"gxeob9\" }],\n [\"circle\", { cx: \"12\", cy: \"19\", r: \"1\", key: \"lyex9k\" }]\n];\nconst EllipsisVertical = createLucideIcon(\"ellipsis-vertical\", __iconNode);\n\nexport { __iconNode, EllipsisVertical as default };\n//# sourceMappingURL=ellipsis-vertical.js.map\n","const MENU_ITEM_TYPES = { menuItem: \"menuItem\", divider: \"divider\" };\n\nconst DEFAULT_TOOLTIP_PROPS = { disabled: true, position: \"bottom\" };\n\nconst BUTTON_VARIANTS = [\n \"default\",\n \"secondary\",\n \"destructive\",\n \"destructive-soft\",\n \"outline\",\n \"ghost\",\n \"link\",\n];\n\nconst BUTTON_SIZES = [\n \"default\",\n \"xs\",\n \"sm\",\n \"lg\",\n \"icon\",\n \"icon-xs\",\n \"icon-sm\",\n \"icon-lg\",\n];\n\nconst DROPDOWN_POSITIONS = [\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"top-start\",\n \"top-end\",\n \"bottom-start\",\n \"bottom-end\",\n \"left-start\",\n \"left-end\",\n \"right-start\",\n \"right-end\",\n \"auto\",\n];\n\nexport {\n MENU_ITEM_TYPES,\n DEFAULT_TOOLTIP_PROPS,\n BUTTON_VARIANTS,\n BUTTON_SIZES,\n DROPDOWN_POSITIONS,\n};\n","import { DropdownMenu } from \"@bigbinary/neeto-atoms\";\nimport { hyphenate } from \"neetocist\";\nimport { withT } from \"neetocommons/v2/react-utils\";\n\nimport MenuItem from \"./MenuItem\";\n\nconst Submenu = withT(({ t, label, menuItems = [] }) => (\n <DropdownMenu.SubMenu\n {...{ label }}\n triggerProps={{ \"aria-haspopup\": \"menu\" }}\n contentProps={{\n \"aria-label\": t(\"neetoMolecules.moreDropdown.submenuAriaLabel\", {\n label,\n }),\n }}\n >\n {menuItems.map(({ isVisible = true, key, ...itemProps }) => {\n if (!isVisible) return null;\n\n return (\n <MenuItem\n key={key ?? hyphenate(itemProps.label || \"menu-item\")}\n {...itemProps}\n />\n );\n })}\n </DropdownMenu.SubMenu>\n));\n\nexport default Submenu;\n","import { DropdownMenu } from \"@bigbinary/neeto-atoms\";\n\nimport Submenu from \"./Submenu\";\n\nconst MenuItem = ({\n onClick,\n label,\n type = \"menuItem\",\n hasSubItems = false,\n menuItems,\n dropdownProps,\n ...menuItemProps\n}) => {\n if (type === \"divider\") return <DropdownMenu.Divider role=\"separator\" />;\n\n if (hasSubItems) {\n return (\n <Submenu {...{ dropdownProps, label, menuItems, ...menuItemProps }} />\n );\n }\n\n return (\n <DropdownMenu.MenuItem {...{ onClick }} role=\"menuitem\" {...menuItemProps}>\n {label}\n </DropdownMenu.MenuItem>\n );\n};\n\nexport default MenuItem;\n","import { Button, DropdownMenu, Tooltip } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { Ellipsis, EllipsisVertical } from \"lucide-react\";\nimport { hyphenate } from \"neetocist\";\nimport PropTypes from \"prop-types\";\nimport { mergeRight } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n BUTTON_SIZES,\n BUTTON_VARIANTS,\n DEFAULT_TOOLTIP_PROPS,\n DROPDOWN_POSITIONS,\n MENU_ITEM_TYPES,\n} from \"./constants\";\nimport MenuItem from \"./MenuItem\";\n\nconst MoreDropdown = ({\n dropdownButtonProps = {},\n isVertical = false,\n isDisabled = false,\n dropdownProps = {},\n menuTopChildren,\n menuBottomChildren,\n menuItems = [],\n}) => {\n const { t } = useTranslation();\n\n const {\n isRounded: isRoundedButton,\n size: buttonSize = \"icon\",\n tooltipProps: customTooltipProps,\n variant = \"ghost\",\n ...buttonProps\n } = dropdownButtonProps;\n\n const tooltipProps = mergeRight(DEFAULT_TOOLTIP_PROPS, customTooltipProps);\n\n const TargetIcon = isVertical ? EllipsisVertical : Ellipsis;\n\n const { className: contentClassName, ...restDropdownProps } = dropdownProps;\n\n const isDropdownDisabled = isDisabled || dropdownProps.disabled;\n\n const triggerClassName = classnames(\"shrink-0\", {\n \"rounded-full\": isRoundedButton,\n });\n\n if (isDropdownDisabled && !tooltipProps.disabled) {\n return (\n <Tooltip\n content={tooltipProps.content}\n position={tooltipProps.position || \"bottom\"}\n >\n <span>\n <Button\n {...{ variant }}\n disabled\n className={triggerClassName}\n data-dropdown-button-style=\"more-dropdown\"\n data-testid=\"more-dropdown-button\"\n icon={TargetIcon}\n size={buttonSize}\n {...buttonProps}\n />\n </span>\n </Tooltip>\n );\n }\n\n return (\n <DropdownMenu\n customTarget={\n <Button\n {...{ variant }}\n aria-haspopup=\"menu\"\n aria-label={t(\"neetoMolecules.moreDropdown.buttonAriaLabel\")}\n className={triggerClassName}\n data-dropdown-button-style=\"more-dropdown\"\n disabled={isDropdownDisabled}\n icon={TargetIcon}\n size={buttonSize}\n {...buttonProps}\n />\n }\n dropdownProps={{\n \"aria-label\": t(\"neetoMolecules.moreDropdown.menuAriaLabel\"),\n className: contentClassName,\n }}\n {...restDropdownProps}\n >\n {menuTopChildren}\n {menuItems.map(({ isVisible = true, key, ...menuItemProps }) => {\n if (!isVisible) return null;\n\n return (\n <MenuItem\n key={key ?? hyphenate(menuItemProps.label || \"menu-item\")}\n {...menuItemProps}\n />\n );\n })}\n {menuBottomChildren}\n </DropdownMenu>\n );\n};\n\nMoreDropdown.propTypes = {\n /**\n * Props forwarded to the trigger Button (atom). Accepts every Button prop;\n * the listed keys are the most relevant.\n */\n dropdownButtonProps: PropTypes.shape({\n variant: PropTypes.oneOf(BUTTON_VARIANTS),\n size: PropTypes.oneOf(BUTTON_SIZES),\n label: PropTypes.string,\n isRounded: PropTypes.bool,\n disabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.node,\n position: PropTypes.oneOf(DROPDOWN_POSITIONS),\n disabled: PropTypes.bool,\n }),\n }),\n /** Render `EllipsisVertical` instead of `Ellipsis` for the trigger icon. */\n isVertical: PropTypes.bool,\n /** Disable the entire dropdown (trigger + menu). */\n isDisabled: PropTypes.bool,\n /**\n * Props forwarded to the underlying atom `DropdownMenu`.\n */\n dropdownProps: PropTypes.shape({\n position: PropTypes.oneOf(DROPDOWN_POSITIONS),\n closeOnEsc: PropTypes.bool,\n closeOnSelect: PropTypes.bool,\n closeOnOutsideClick: PropTypes.bool,\n isOpen: PropTypes.bool,\n onClose: PropTypes.func,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n }),\n /** Rendered above the dynamic `menuItems` inside the dropdown menu. */\n menuTopChildren: PropTypes.node,\n /** Rendered below the dynamic `menuItems` inside the dropdown menu. */\n menuBottomChildren: PropTypes.node,\n /**\n * Each entry accepts every `DropdownMenu.MenuItem` prop (`prefix`, `suffix`,\n * `variant`, `isDisabled`, `to`, `href`, …) plus the wrapper-only fields below.\n */\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n key: PropTypes.string,\n type: PropTypes.oneOf(Object.values(MENU_ITEM_TYPES)),\n isVisible: PropTypes.bool,\n hasSubItems: PropTypes.bool,\n menuItems: PropTypes.array,\n })\n ),\n};\n\nexport default MoreDropdown;\n"],"names":["createLucideIcon","DEFAULT_TOOLTIP_PROPS","disabled","position","Submenu","withT","_ref","t","label","_ref$menuItems","menuItems","_jsx","DropdownMenu","SubMenu","triggerProps","contentProps","children","map","_ref2","_ref2$isVisible","isVisible","key","itemProps","_objectWithoutProperties","_excluded","MenuItem","_objectSpread","hyphenate","onClick","_ref$type","type","_ref$hasSubItems","hasSubItems","dropdownProps","menuItemProps","Divider","role","MoreDropdown","_ref$dropdownButtonPr","dropdownButtonProps","_ref$isVertical","isVertical","_ref$isDisabled","isDisabled","_ref$dropdownProps","menuTopChildren","menuBottomChildren","_useTranslation","useTranslation","isRoundedButton","isRounded","_dropdownButtonProps$","size","buttonSize","customTooltipProps","tooltipProps","_dropdownButtonProps$2","variant","buttonProps","mergeRight","TargetIcon","EllipsisVertical","Ellipsis","contentClassName","className","restDropdownProps","_excluded2","isDropdownDisabled","triggerClassName","classnames","Tooltip","content","Button","icon","_jsxs","customTarget","_excluded3"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC3D,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC1D,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CA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
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var classnames = require('classnames');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
var TableWrapper = function TableWrapper(_ref) {
|
|
7
|
+
var children = _ref.children,
|
|
8
|
+
_ref$className = _ref.className,
|
|
9
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
10
|
+
_ref$hasPagination = _ref.hasPagination,
|
|
11
|
+
hasPagination = _ref$hasPagination === void 0 ? false : _ref$hasPagination;
|
|
12
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13
|
+
"data-testid": "table-wrapper",
|
|
14
|
+
className: classnames("flex min-h-0 w-full flex-grow flex-col pb-6", className),
|
|
15
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
16
|
+
className: classnames("min-h-0 flex-grow", {
|
|
17
|
+
"pb-12": hasPagination
|
|
18
|
+
}),
|
|
19
|
+
children: children
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
module.exports = TableWrapper;
|
|
25
|
+
//# sourceMappingURL=TableWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableWrapper.js","sources":["../../../src/v2/components/TableWrapper/index.jsx"],"sourcesContent":["import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst TableWrapper = ({ children, className = \"\", hasPagination = false }) => (\n <div\n data-testid=\"table-wrapper\"\n className={classNames(\n \"flex min-h-0 w-full flex-grow flex-col pb-6\",\n className\n )}\n >\n <div\n className={classNames(\"min-h-0 flex-grow\", {\n \"pb-12\": hasPagination,\n })}\n >\n {children}\n </div>\n </div>\n);\n\nTableWrapper.propTypes = {\n children: PropTypes.node,\n /**\n * Custom classnames for table wrapper.\n */\n className: PropTypes.string,\n /**\n * Handles table wrapper height when pagination is enabled.\n *\n * `hasPagination={totalCount > defaultPageSize}`\n */\n hasPagination: PropTypes.bool,\n};\n\nexport default TableWrapper;\n"],"names":["TableWrapper","_ref","children","_ref$className","className","_ref$hasPagination","hasPagination","_jsx","classNames"],"mappings":";;;;;AAGA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,cAAA,GAAAF,IAAA,CAAEG,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IAAAE,kBAAA,GAAAJ,IAAA,CAAEK,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,kBAAA;AAAA,EAAA,oBACrEE,cAAA,CAAA,KAAA,EAAA;AACE,IAAA,aAAA,EAAY,eAAe;AAC3BH,IAAAA,SAAS,EAAEI,UAAU,CACnB,6CAA6C,EAC7CJ,SACF,CAAE;AAAAF,IAAAA,QAAA,eAEFK,cAAA,CAAA,KAAA,EAAA;AACEH,MAAAA,SAAS,EAAEI,UAAU,CAAC,mBAAmB,EAAE;AACzC,QAAA,OAAO,EAAEF;AACX,OAAC,CAAE;AAAAJ,MAAAA,QAAA,EAEFA;KACE;AAAC,GACH,CAAC;AAAA;;;;"}
|
package/dist/v2/MoreDropdown.js
CHANGED
|
@@ -92,7 +92,8 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
var _excluded = ["isRounded", "size", "tooltipProps", "variant"],
|
|
95
|
-
_excluded2 = ["
|
|
95
|
+
_excluded2 = ["className"],
|
|
96
|
+
_excluded3 = ["isVisible", "key"];
|
|
96
97
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
97
98
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
98
99
|
var MoreDropdown = function MoreDropdown(_ref) {
|
|
@@ -119,6 +120,8 @@ var MoreDropdown = function MoreDropdown(_ref) {
|
|
|
119
120
|
buttonProps = _objectWithoutProperties(dropdownButtonProps, _excluded);
|
|
120
121
|
var tooltipProps = mergeRight(DEFAULT_TOOLTIP_PROPS, customTooltipProps);
|
|
121
122
|
var TargetIcon = isVertical ? EllipsisVertical : Ellipsis;
|
|
123
|
+
var contentClassName = dropdownProps.className,
|
|
124
|
+
restDropdownProps = _objectWithoutProperties(dropdownProps, _excluded2);
|
|
122
125
|
var isDropdownDisabled = isDisabled || dropdownProps.disabled;
|
|
123
126
|
var triggerClassName = classnames("shrink-0", {
|
|
124
127
|
"rounded-full": isRoundedButton
|
|
@@ -152,14 +155,15 @@ var MoreDropdown = function MoreDropdown(_ref) {
|
|
|
152
155
|
size: buttonSize
|
|
153
156
|
}, buttonProps)),
|
|
154
157
|
dropdownProps: {
|
|
155
|
-
"aria-label": t("neetoMolecules.moreDropdown.menuAriaLabel")
|
|
158
|
+
"aria-label": t("neetoMolecules.moreDropdown.menuAriaLabel"),
|
|
159
|
+
className: contentClassName
|
|
156
160
|
}
|
|
157
|
-
},
|
|
161
|
+
}, restDropdownProps), {}, {
|
|
158
162
|
children: [menuTopChildren, menuItems.map(function (_ref2) {
|
|
159
163
|
var _ref2$isVisible = _ref2.isVisible,
|
|
160
164
|
isVisible = _ref2$isVisible === void 0 ? true : _ref2$isVisible,
|
|
161
165
|
key = _ref2.key,
|
|
162
|
-
menuItemProps = _objectWithoutProperties(_ref2,
|
|
166
|
+
menuItemProps = _objectWithoutProperties(_ref2, _excluded3);
|
|
163
167
|
if (!isVisible) return null;
|
|
164
168
|
return /*#__PURE__*/jsx(MenuItem, _objectSpread({}, menuItemProps), key !== null && key !== void 0 ? key : hyphenate(menuItemProps.label || "menu-item"));
|
|
165
169
|
}), menuBottomChildren]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreDropdown.js","sources":["../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.js","../../src/v2/components/MoreDropdown/constants.js","../../src/v2/components/MoreDropdown/Submenu.jsx","../../src/v2/components/MoreDropdown/MenuItem.jsx","../../src/v2/components/MoreDropdown/index.jsx"],"sourcesContent":["/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\", key: \"41hilf\" }],\n [\"circle\", { cx: \"12\", cy: \"5\", r: \"1\", key: \"gxeob9\" }],\n [\"circle\", { cx: \"12\", cy: \"19\", r: \"1\", key: \"lyex9k\" }]\n];\nconst EllipsisVertical = createLucideIcon(\"ellipsis-vertical\", __iconNode);\n\nexport { __iconNode, EllipsisVertical as default };\n//# sourceMappingURL=ellipsis-vertical.js.map\n","const MENU_ITEM_TYPES = { menuItem: \"menuItem\", divider: \"divider\" };\n\nconst DEFAULT_TOOLTIP_PROPS = { disabled: true, position: \"bottom\" };\n\nconst BUTTON_VARIANTS = [\n \"default\",\n \"secondary\",\n \"destructive\",\n \"destructive-soft\",\n \"outline\",\n \"ghost\",\n \"link\",\n];\n\nconst BUTTON_SIZES = [\n \"default\",\n \"xs\",\n \"sm\",\n \"lg\",\n \"icon\",\n \"icon-xs\",\n \"icon-sm\",\n \"icon-lg\",\n];\n\nconst DROPDOWN_POSITIONS = [\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"top-start\",\n \"top-end\",\n \"bottom-start\",\n \"bottom-end\",\n \"left-start\",\n \"left-end\",\n \"right-start\",\n \"right-end\",\n \"auto\",\n];\n\nexport {\n MENU_ITEM_TYPES,\n DEFAULT_TOOLTIP_PROPS,\n BUTTON_VARIANTS,\n BUTTON_SIZES,\n DROPDOWN_POSITIONS,\n};\n","import { DropdownMenu } from \"@bigbinary/neeto-atoms\";\nimport { hyphenate } from \"neetocist\";\nimport { withT } from \"neetocommons/v2/react-utils\";\n\nimport MenuItem from \"./MenuItem\";\n\nconst Submenu = withT(({ t, label, menuItems = [] }) => (\n <DropdownMenu.SubMenu\n {...{ label }}\n triggerProps={{ \"aria-haspopup\": \"menu\" }}\n contentProps={{\n \"aria-label\": t(\"neetoMolecules.moreDropdown.submenuAriaLabel\", {\n label,\n }),\n }}\n >\n {menuItems.map(({ isVisible = true, key, ...itemProps }) => {\n if (!isVisible) return null;\n\n return (\n <MenuItem\n key={key ?? hyphenate(itemProps.label || \"menu-item\")}\n {...itemProps}\n />\n );\n })}\n </DropdownMenu.SubMenu>\n));\n\nexport default Submenu;\n","import { DropdownMenu } from \"@bigbinary/neeto-atoms\";\n\nimport Submenu from \"./Submenu\";\n\nconst MenuItem = ({\n onClick,\n label,\n type = \"menuItem\",\n hasSubItems = false,\n menuItems,\n dropdownProps,\n ...menuItemProps\n}) => {\n if (type === \"divider\") return <DropdownMenu.Divider role=\"separator\" />;\n\n if (hasSubItems) {\n return (\n <Submenu {...{ dropdownProps, label, menuItems, ...menuItemProps }} />\n );\n }\n\n return (\n <DropdownMenu.MenuItem {...{ onClick }} role=\"menuitem\" {...menuItemProps}>\n {label}\n </DropdownMenu.MenuItem>\n );\n};\n\nexport default MenuItem;\n","import { Button, DropdownMenu, Tooltip } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { Ellipsis, EllipsisVertical } from \"lucide-react\";\nimport { hyphenate } from \"neetocist\";\nimport PropTypes from \"prop-types\";\nimport { mergeRight } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n BUTTON_SIZES,\n BUTTON_VARIANTS,\n DEFAULT_TOOLTIP_PROPS,\n DROPDOWN_POSITIONS,\n MENU_ITEM_TYPES,\n} from \"./constants\";\nimport MenuItem from \"./MenuItem\";\n\nconst MoreDropdown = ({\n dropdownButtonProps = {},\n isVertical = false,\n isDisabled = false,\n dropdownProps = {},\n menuTopChildren,\n menuBottomChildren,\n menuItems = [],\n}) => {\n const { t } = useTranslation();\n\n const {\n isRounded: isRoundedButton,\n size: buttonSize = \"icon\",\n tooltipProps: customTooltipProps,\n variant = \"ghost\",\n ...buttonProps\n } = dropdownButtonProps;\n\n const tooltipProps = mergeRight(DEFAULT_TOOLTIP_PROPS, customTooltipProps);\n\n const TargetIcon = isVertical ? EllipsisVertical : Ellipsis;\n\n const isDropdownDisabled = isDisabled || dropdownProps.disabled;\n\n const triggerClassName = classnames(\"shrink-0\", {\n \"rounded-full\": isRoundedButton,\n });\n\n if (isDropdownDisabled && !tooltipProps.disabled) {\n return (\n <Tooltip\n content={tooltipProps.content}\n position={tooltipProps.position || \"bottom\"}\n >\n <span>\n <Button\n {...{ variant }}\n disabled\n className={triggerClassName}\n data-dropdown-button-style=\"more-dropdown\"\n data-testid=\"more-dropdown-button\"\n icon={TargetIcon}\n size={buttonSize}\n {...buttonProps}\n />\n </span>\n </Tooltip>\n );\n }\n\n return (\n <DropdownMenu\n customTarget={\n <Button\n {...{ variant }}\n aria-haspopup=\"menu\"\n aria-label={t(\"neetoMolecules.moreDropdown.buttonAriaLabel\")}\n className={triggerClassName}\n data-dropdown-button-style=\"more-dropdown\"\n disabled={isDropdownDisabled}\n icon={TargetIcon}\n size={buttonSize}\n {...buttonProps}\n />\n }\n dropdownProps={{\n \"aria-label\": t(\"neetoMolecules.moreDropdown.menuAriaLabel\"),\n }}\n {...dropdownProps}\n >\n {menuTopChildren}\n {menuItems.map(({ isVisible = true, key, ...menuItemProps }) => {\n if (!isVisible) return null;\n\n return (\n <MenuItem\n key={key ?? hyphenate(menuItemProps.label || \"menu-item\")}\n {...menuItemProps}\n />\n );\n })}\n {menuBottomChildren}\n </DropdownMenu>\n );\n};\n\nMoreDropdown.propTypes = {\n /**\n * Props forwarded to the trigger Button (atom). Accepts every Button prop;\n * the listed keys are the most relevant.\n */\n dropdownButtonProps: PropTypes.shape({\n variant: PropTypes.oneOf(BUTTON_VARIANTS),\n size: PropTypes.oneOf(BUTTON_SIZES),\n label: PropTypes.string,\n isRounded: PropTypes.bool,\n disabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.node,\n position: PropTypes.oneOf(DROPDOWN_POSITIONS),\n disabled: PropTypes.bool,\n }),\n }),\n /** Render `EllipsisVertical` instead of `Ellipsis` for the trigger icon. */\n isVertical: PropTypes.bool,\n /** Disable the entire dropdown (trigger + menu). */\n isDisabled: PropTypes.bool,\n /**\n * Props forwarded to the underlying atom `DropdownMenu`.\n */\n dropdownProps: PropTypes.shape({\n position: PropTypes.oneOf(DROPDOWN_POSITIONS),\n closeOnEsc: PropTypes.bool,\n closeOnSelect: PropTypes.bool,\n closeOnOutsideClick: PropTypes.bool,\n isOpen: PropTypes.bool,\n onClose: PropTypes.func,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n }),\n /** Rendered above the dynamic `menuItems` inside the dropdown menu. */\n menuTopChildren: PropTypes.node,\n /** Rendered below the dynamic `menuItems` inside the dropdown menu. */\n menuBottomChildren: PropTypes.node,\n /**\n * Each entry accepts every `DropdownMenu.MenuItem` prop (`prefix`, `suffix`,\n * `variant`, `isDisabled`, `to`, `href`, …) plus the wrapper-only fields below.\n */\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n key: PropTypes.string,\n type: PropTypes.oneOf(Object.values(MENU_ITEM_TYPES)),\n isVisible: PropTypes.bool,\n hasSubItems: PropTypes.bool,\n menuItems: PropTypes.array,\n })\n ),\n};\n\nexport default MoreDropdown;\n"],"names":["DEFAULT_TOOLTIP_PROPS","disabled","position","Submenu","withT","_ref","t","label","_ref$menuItems","menuItems","_jsx","DropdownMenu","SubMenu","triggerProps","contentProps","children","map","_ref2","_ref2$isVisible","isVisible","key","itemProps","_objectWithoutProperties","_excluded","MenuItem","_objectSpread","hyphenate","onClick","_ref$type","type","_ref$hasSubItems","hasSubItems","dropdownProps","menuItemProps","Divider","role","MoreDropdown","_ref$dropdownButtonPr","dropdownButtonProps","_ref$isVertical","isVertical","_ref$isDisabled","isDisabled","_ref$dropdownProps","menuTopChildren","menuBottomChildren","_useTranslation","useTranslation","isRoundedButton","isRounded","_dropdownButtonProps$","size","buttonSize","customTooltipProps","tooltipProps","_dropdownButtonProps$2","variant","buttonProps","mergeRight","TargetIcon","EllipsisVertical","Ellipsis","isDropdownDisabled","triggerClassName","classnames","Tooltip","content","Button","className","icon","_jsxs","customTarget","_excluded2"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC3D,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC1D,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC1D,CAAC;AACD,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,mBAAmB,EAAE,UAAU,CAAC;;ACZ1E,IAAMA,qBAAqB,GAAG;AAAEC,EAAAA,QAAQ,EAAE,IAAI;AAAEC,EAAAA,QAAQ,EAAE;AAAS,CAAC;;;;;ACIpE,IAAMC,OAAO,GAAGC,KAAK,C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E1B,CAAC,CAAC,2CAA2C;AAC7D;AAAE,GAAA,EACE0B,aAAa,CAAA,EAAA,EAAA,EAAA;IAAAjB,QAAA,EAAA,CAEhB6B,eAAe,EACfnC,SAAS,CAACO,GAAG,CAAC,UAAAC,KAAA,EAAiD;AAAA,MAAA,IAAAC,eAAA,GAAAD,KAAA,CAA9CE,SAAS;AAATA,QAAAA,SAAS,GAAAD,eAAA,KAAA,MAAA,GAAG,IAAI,GAAAA,eAAA;QAAEE,GAAG,GAAAH,KAAA,CAAHG,GAAG;AAAKa,QAAAA,aAAa,GAAAX,wBAAA,CAAAL,KAAA,EAAAuD,UAAA,CAAA;AACvD,MAAA,IAAI,CAACrD,SAAS,EAAE,OAAO,IAAI;MAE3B,oBACET,GAAA,CAACc,QAAQ,EAAAC,aAAA,CAAA,EAAA,EAEHQ,aAAa,CAAA,EADZb,GAAG,KAAA,IAAA,IAAHA,GAAG,cAAHA,GAAG,GAAIM,SAAS,CAACO,aAAa,CAAC1B,KAAK,IAAI,WAAW,CAEzD,CAAC;IAEN,CAAC,CAAC,EACDsC,kBAAkB;AAAA,GAAA,CACP,CAAC;AAEnB;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"MoreDropdown.js","sources":["../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.js","../../src/v2/components/MoreDropdown/constants.js","../../src/v2/components/MoreDropdown/Submenu.jsx","../../src/v2/components/MoreDropdown/MenuItem.jsx","../../src/v2/components/MoreDropdown/index.jsx"],"sourcesContent":["/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\", key: \"41hilf\" }],\n [\"circle\", { cx: \"12\", cy: \"5\", r: \"1\", key: \"gxeob9\" }],\n [\"circle\", { cx: \"12\", cy: \"19\", r: \"1\", key: \"lyex9k\" }]\n];\nconst EllipsisVertical = createLucideIcon(\"ellipsis-vertical\", __iconNode);\n\nexport { __iconNode, EllipsisVertical as default };\n//# sourceMappingURL=ellipsis-vertical.js.map\n","const MENU_ITEM_TYPES = { menuItem: \"menuItem\", divider: \"divider\" };\n\nconst DEFAULT_TOOLTIP_PROPS = { disabled: true, position: \"bottom\" };\n\nconst BUTTON_VARIANTS = [\n \"default\",\n \"secondary\",\n \"destructive\",\n \"destructive-soft\",\n \"outline\",\n \"ghost\",\n \"link\",\n];\n\nconst BUTTON_SIZES = [\n \"default\",\n \"xs\",\n \"sm\",\n \"lg\",\n \"icon\",\n \"icon-xs\",\n \"icon-sm\",\n \"icon-lg\",\n];\n\nconst DROPDOWN_POSITIONS = [\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"top-start\",\n \"top-end\",\n \"bottom-start\",\n \"bottom-end\",\n \"left-start\",\n \"left-end\",\n \"right-start\",\n \"right-end\",\n \"auto\",\n];\n\nexport {\n MENU_ITEM_TYPES,\n DEFAULT_TOOLTIP_PROPS,\n BUTTON_VARIANTS,\n BUTTON_SIZES,\n DROPDOWN_POSITIONS,\n};\n","import { DropdownMenu } from \"@bigbinary/neeto-atoms\";\nimport { hyphenate } from \"neetocist\";\nimport { withT } from \"neetocommons/v2/react-utils\";\n\nimport MenuItem from \"./MenuItem\";\n\nconst Submenu = withT(({ t, label, menuItems = [] }) => (\n <DropdownMenu.SubMenu\n {...{ label }}\n triggerProps={{ \"aria-haspopup\": \"menu\" }}\n contentProps={{\n \"aria-label\": t(\"neetoMolecules.moreDropdown.submenuAriaLabel\", {\n label,\n }),\n }}\n >\n {menuItems.map(({ isVisible = true, key, ...itemProps }) => {\n if (!isVisible) return null;\n\n return (\n <MenuItem\n key={key ?? hyphenate(itemProps.label || \"menu-item\")}\n {...itemProps}\n />\n );\n })}\n </DropdownMenu.SubMenu>\n));\n\nexport default Submenu;\n","import { DropdownMenu } from \"@bigbinary/neeto-atoms\";\n\nimport Submenu from \"./Submenu\";\n\nconst MenuItem = ({\n onClick,\n label,\n type = \"menuItem\",\n hasSubItems = false,\n menuItems,\n dropdownProps,\n ...menuItemProps\n}) => {\n if (type === \"divider\") return <DropdownMenu.Divider role=\"separator\" />;\n\n if (hasSubItems) {\n return (\n <Submenu {...{ dropdownProps, label, menuItems, ...menuItemProps }} />\n );\n }\n\n return (\n <DropdownMenu.MenuItem {...{ onClick }} role=\"menuitem\" {...menuItemProps}>\n {label}\n </DropdownMenu.MenuItem>\n );\n};\n\nexport default MenuItem;\n","import { Button, DropdownMenu, Tooltip } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { Ellipsis, EllipsisVertical } from \"lucide-react\";\nimport { hyphenate } from \"neetocist\";\nimport PropTypes from \"prop-types\";\nimport { mergeRight } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n BUTTON_SIZES,\n BUTTON_VARIANTS,\n DEFAULT_TOOLTIP_PROPS,\n DROPDOWN_POSITIONS,\n MENU_ITEM_TYPES,\n} from \"./constants\";\nimport MenuItem from \"./MenuItem\";\n\nconst MoreDropdown = ({\n dropdownButtonProps = {},\n isVertical = false,\n isDisabled = false,\n dropdownProps = {},\n menuTopChildren,\n menuBottomChildren,\n menuItems = [],\n}) => {\n const { t } = useTranslation();\n\n const {\n isRounded: isRoundedButton,\n size: buttonSize = \"icon\",\n tooltipProps: customTooltipProps,\n variant = \"ghost\",\n ...buttonProps\n } = dropdownButtonProps;\n\n const tooltipProps = mergeRight(DEFAULT_TOOLTIP_PROPS, customTooltipProps);\n\n const TargetIcon = isVertical ? EllipsisVertical : Ellipsis;\n\n const { className: contentClassName, ...restDropdownProps } = dropdownProps;\n\n const isDropdownDisabled = isDisabled || dropdownProps.disabled;\n\n const triggerClassName = classnames(\"shrink-0\", {\n \"rounded-full\": isRoundedButton,\n });\n\n if (isDropdownDisabled && !tooltipProps.disabled) {\n return (\n <Tooltip\n content={tooltipProps.content}\n position={tooltipProps.position || \"bottom\"}\n >\n <span>\n <Button\n {...{ variant }}\n disabled\n className={triggerClassName}\n data-dropdown-button-style=\"more-dropdown\"\n data-testid=\"more-dropdown-button\"\n icon={TargetIcon}\n size={buttonSize}\n {...buttonProps}\n />\n </span>\n </Tooltip>\n );\n }\n\n return (\n <DropdownMenu\n customTarget={\n <Button\n {...{ variant }}\n aria-haspopup=\"menu\"\n aria-label={t(\"neetoMolecules.moreDropdown.buttonAriaLabel\")}\n className={triggerClassName}\n data-dropdown-button-style=\"more-dropdown\"\n disabled={isDropdownDisabled}\n icon={TargetIcon}\n size={buttonSize}\n {...buttonProps}\n />\n }\n dropdownProps={{\n \"aria-label\": t(\"neetoMolecules.moreDropdown.menuAriaLabel\"),\n className: contentClassName,\n }}\n {...restDropdownProps}\n >\n {menuTopChildren}\n {menuItems.map(({ isVisible = true, key, ...menuItemProps }) => {\n if (!isVisible) return null;\n\n return (\n <MenuItem\n key={key ?? hyphenate(menuItemProps.label || \"menu-item\")}\n {...menuItemProps}\n />\n );\n })}\n {menuBottomChildren}\n </DropdownMenu>\n );\n};\n\nMoreDropdown.propTypes = {\n /**\n * Props forwarded to the trigger Button (atom). Accepts every Button prop;\n * the listed keys are the most relevant.\n */\n dropdownButtonProps: PropTypes.shape({\n variant: PropTypes.oneOf(BUTTON_VARIANTS),\n size: PropTypes.oneOf(BUTTON_SIZES),\n label: PropTypes.string,\n isRounded: PropTypes.bool,\n disabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.node,\n position: PropTypes.oneOf(DROPDOWN_POSITIONS),\n disabled: PropTypes.bool,\n }),\n }),\n /** Render `EllipsisVertical` instead of `Ellipsis` for the trigger icon. */\n isVertical: PropTypes.bool,\n /** Disable the entire dropdown (trigger + menu). */\n isDisabled: PropTypes.bool,\n /**\n * Props forwarded to the underlying atom `DropdownMenu`.\n */\n dropdownProps: PropTypes.shape({\n position: PropTypes.oneOf(DROPDOWN_POSITIONS),\n closeOnEsc: PropTypes.bool,\n closeOnSelect: PropTypes.bool,\n closeOnOutsideClick: PropTypes.bool,\n isOpen: PropTypes.bool,\n onClose: PropTypes.func,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n }),\n /** Rendered above the dynamic `menuItems` inside the dropdown menu. */\n menuTopChildren: PropTypes.node,\n /** Rendered below the dynamic `menuItems` inside the dropdown menu. */\n menuBottomChildren: PropTypes.node,\n /**\n * Each entry accepts every `DropdownMenu.MenuItem` prop (`prefix`, `suffix`,\n * `variant`, `isDisabled`, `to`, `href`, …) plus the wrapper-only fields below.\n */\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n key: PropTypes.string,\n type: PropTypes.oneOf(Object.values(MENU_ITEM_TYPES)),\n isVisible: PropTypes.bool,\n hasSubItems: PropTypes.bool,\n menuItems: PropTypes.array,\n })\n ),\n};\n\nexport default MoreDropdown;\n"],"names":["DEFAULT_TOOLTIP_PROPS","disabled","position","Submenu","withT","_ref","t","label","_ref$menuItems","menuItems","_jsx","DropdownMenu","SubMenu","triggerProps","contentProps","children","map","_ref2","_ref2$isVisible","isVisible","key","itemProps","_objectWithoutProperties","_excluded","MenuItem","_objectSpread","hyphenate","onClick","_ref$type","type","_ref$hasSubItems","hasSubItems","dropdownProps","menuItemProps","Divider","role","MoreDropdown","_ref$dropdownButtonPr","dropdownButtonProps","_ref$isVertical","isVertical","_ref$isDisabled","isDisabled","_ref$dropdownProps","menuTopChildren","menuBottomChildren","_useTranslation","useTranslation","isRoundedButton","isRounded","_dropdownButtonProps$","size","buttonSize","customTooltipProps","tooltipProps","_dropdownButtonProps$2","variant","buttonProps","mergeRight","TargetIcon","EllipsisVertical","Ellipsis","contentClassName","className","restDropdownProps","_excluded2","isDropdownDisabled","triggerClassName","classnames","Tooltip","content","Button","icon","_jsxs","customTarget","_excluded3"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,QAAQ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S,EAAE,OAAO,IAAI;MAE3B,oBACET,GAAA,CAACc,QAAQ,EAAAC,aAAA,CAAA,EAAA,EAEHQ,aAAa,CAAA,EADZb,GAAG,KAAA,IAAA,IAAHA,GAAG,cAAHA,GAAG,GAAIM,SAAS,CAACO,aAAa,CAAC1B,KAAK,IAAI,WAAW,CAEzD,CAAC;IAEN,CAAC,CAAC,EACDsC,kBAAkB;AAAA,GAAA,CACP,CAAC;AAEnB;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import classnames from 'classnames';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
var TableWrapper = function TableWrapper(_ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
_ref$className = _ref.className,
|
|
7
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
8
|
+
_ref$hasPagination = _ref.hasPagination,
|
|
9
|
+
hasPagination = _ref$hasPagination === void 0 ? false : _ref$hasPagination;
|
|
10
|
+
return /*#__PURE__*/jsx("div", {
|
|
11
|
+
"data-testid": "table-wrapper",
|
|
12
|
+
className: classnames("flex min-h-0 w-full flex-grow flex-col pb-6", className),
|
|
13
|
+
children: /*#__PURE__*/jsx("div", {
|
|
14
|
+
className: classnames("min-h-0 flex-grow", {
|
|
15
|
+
"pb-12": hasPagination
|
|
16
|
+
}),
|
|
17
|
+
children: children
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { TableWrapper as default };
|
|
23
|
+
//# sourceMappingURL=TableWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableWrapper.js","sources":["../../src/v2/components/TableWrapper/index.jsx"],"sourcesContent":["import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst TableWrapper = ({ children, className = \"\", hasPagination = false }) => (\n <div\n data-testid=\"table-wrapper\"\n className={classNames(\n \"flex min-h-0 w-full flex-grow flex-col pb-6\",\n className\n )}\n >\n <div\n className={classNames(\"min-h-0 flex-grow\", {\n \"pb-12\": hasPagination,\n })}\n >\n {children}\n </div>\n </div>\n);\n\nTableWrapper.propTypes = {\n children: PropTypes.node,\n /**\n * Custom classnames for table wrapper.\n */\n className: PropTypes.string,\n /**\n * Handles table wrapper height when pagination is enabled.\n *\n * `hasPagination={totalCount > defaultPageSize}`\n */\n hasPagination: PropTypes.bool,\n};\n\nexport default TableWrapper;\n"],"names":["TableWrapper","_ref","children","_ref$className","className","_ref$hasPagination","hasPagination","_jsx","classNames"],"mappings":";;;AAGA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,cAAA,GAAAF,IAAA,CAAEG,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IAAAE,kBAAA,GAAAJ,IAAA,CAAEK,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,kBAAA;AAAA,EAAA,oBACrEE,GAAA,CAAA,KAAA,EAAA;AACE,IAAA,aAAA,EAAY,eAAe;AAC3BH,IAAAA,SAAS,EAAEI,UAAU,CACnB,6CAA6C,EAC7CJ,SACF,CAAE;AAAAF,IAAAA,QAAA,eAEFK,GAAA,CAAA,KAAA,EAAA;AACEH,MAAAA,SAAS,EAAEI,UAAU,CAAC,mBAAmB,EAAE;AACzC,QAAA,OAAO,EAAEF;AACX,OAAC,CAAE;AAAAJ,MAAAA,QAAA,EAEFA;KACE;AAAC,GACH,CAAC;AAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-molecules",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.8",
|
|
4
4
|
"description": "A package of reusable molecular components for neeto products.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-molecules.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|