@bigbinary/neetoui 8.3.45 → 8.3.47

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.
@@ -264,7 +264,6 @@ var ColorPicker = function ColorPicker(_ref) {
264
264
  setIsColorSelected(false);
265
265
  };
266
266
  return /*#__PURE__*/jsx(Dropdown, _objectSpread(_objectSpread({
267
- className: "neeto-ui-colorpicker__dropdown",
268
267
  closeOnSelect: false,
269
268
  label: colorValue,
270
269
  position: "bottom-start"
@@ -278,6 +277,11 @@ var ColorPicker = function ColorPicker(_ref) {
278
277
  size: size
279
278
  }),
280
279
  dropdownProps: _objectSpread(_objectSpread({}, dropdownProps === null || dropdownProps === void 0 ? void 0 : dropdownProps.dropdownProps), portalProps),
280
+ className: classnames("neeto-ui-colorpicker__dropdown", {
281
+ "neeto-ui-colorpicker__dropdown-size--small": size === TARGET_SIZES.small,
282
+ "neeto-ui-colorpicker__dropdown-size--medium": size === TARGET_SIZES.medium,
283
+ "neeto-ui-colorpicker__dropdown-size--large": size === TARGET_SIZES.large
284
+ }),
281
285
  children: /*#__PURE__*/jsxs("div", {
282
286
  className: "neeto-ui-colorpicker__popover",
283
287
  children: [showPicker && /*#__PURE__*/jsxs(Fragment, {
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.js","sources":["../node_modules/use-eye-dropper/lib/use-eye-dropper.module.js","../node_modules/use-eye-dropper/lib/index.module.js","../src/components/ColorPicker/constants.js","../src/components/ColorPicker/Palette.jsx","../src/components/ColorPicker/Target.jsx","../src/components/ColorPicker/index.jsx"],"sourcesContent":["import{useMemo as r,useRef as o,useCallback as n,useEffect as t,useState as e}from\"react\";const i=()=>\"undefined\"!=typeof window&&\"EyeDropper\"in window,s=()=>{throw new Error(\"Unsupported browser.\")},a=a=>{const c=r(()=>{var r;return(r=i()&&new EyeDropper(a))?EyeDropper.prototype.open.bind(r):s},[a]),[p,w]=(()=>{const r=o(),[s,a]=e(!1);t(()=>(r.current=!0,a(i()),()=>{r.current=!1}),[]);const c=n(()=>s,[s]);return[r,c]})(),f=o(),u=n(()=>{void 0!==f.current&&f.current.abort()},[f]),d=n(async function(r){void 0===r&&(r={}),u();const{signal:o,...n}=r,t=new AbortController;f.current=t;const e=void 0!==o?(r=>{if(\"any\"in AbortSignal)return AbortSignal.any(r);const o=new AbortController,n=()=>{o.abort();for(const o of r)o.removeEventListener(\"abort\",n)};for(const o of r){if(o.aborted){n();break}o.addEventListener(\"abort\",n)}return o.signal})([o,t.signal]):t.signal;try{return await c({...n,signal:e})}catch(r){throw p.current||(r.canceled=!0),r}},[f,p,u,c]);return t(()=>u,[u]),{open:d,close:u,isSupported:w}};export{a as default};\n","import { default as DropperDev } from './use-eye-dropper.module.dev.js'\nimport { default as Dropper } from './use-eye-dropper.module.js'\n\nexport default process.env.NODE_ENV === 'production' ? Dropper : DropperDev\n","export const DEFAULT_PALETTE_COLORS = [\n { hex: \"#FFFFFF\" },\n { hex: \"#D6D6D6\" },\n { hex: \"#0A0E13\" },\n { hex: \"#FECE1E\" },\n { hex: \"#F32E48\" },\n { hex: \"#02C39A\" },\n { hex: \"#2A79C4\" },\n { hex: \"#B3E5FC\" },\n { hex: \"#C3C6F9\" },\n { hex: \"#8064CE\" },\n { hex: \"#FE861E\" },\n { hex: \"#FF7DC9\" },\n { hex: \"#028090\" },\n { hex: \"#095482\" },\n];\n\nexport const TARGET_SIZES = {\n large: \"large\",\n medium: \"medium\",\n small: \"small\",\n};\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport tinycolor from \"tinycolor2\";\n\nimport { DEFAULT_PALETTE_COLORS } from \"./constants\";\n\nconst Palette = ({ color, colorList = DEFAULT_PALETTE_COLORS, onChange }) => (\n <div className=\"neeto-ui-flex neeto-ui-flex-row neeto-ui-flex-wrap neeto-ui-items-start neeto-ui-justify-start neeto-ui-color-palette neeto-ui-gap-1\">\n {colorList.map(item => {\n const { hex, rgb } = item;\n const colorObject = tinycolor(hex ?? rgb);\n const isTransparent = colorObject.getAlpha() === 0;\n const isActive = Boolean(\n // hex is case insensitive.\n color?.toLocaleLowerCase() === hex?.toLocaleLowerCase() || color === rgb\n );\n\n return (\n <div\n data-testid=\"color-palette-item\"\n key={hex ?? rgb}\n className={classnames(\n \"neeto-ui-color-palette__item neeto-ui-border\",\n { active: isActive }\n )}\n onClick={() => onChange(hex ?? rgb)}\n >\n <div\n style={{ backgroundColor: hex ?? rgb }}\n className={classnames({\n \"transparent-bg-pattern\": isTransparent,\n })}\n />\n </div>\n );\n })}\n </div>\n);\n\nPalette.propTypes = {\n color: PropTypes.string,\n colorList: PropTypes.arrayOf(\n PropTypes.shape({\n hex: PropTypes.string,\n rgb: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.shape({\n r: PropTypes.number,\n g: PropTypes.number,\n b: PropTypes.number,\n }),\n ]),\n })\n ),\n onChange: PropTypes.func,\n};\n\nexport default Palette;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { Down } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\n\nimport { TARGET_SIZES } from \"./constants\";\n\nconst Target = ({ size, showHexValue, color, colorValue }) => (\n <button\n data-cy=\"color-picker-target\"\n data-testid=\"neeto-color-picker\"\n type=\"button\"\n className={classnames(\"neeto-ui-colorpicker__target\", {\n \"neeto-ui-colorpicker__target-size--large\": size === TARGET_SIZES.large,\n \"neeto-ui-colorpicker__target-size--medium\": size === TARGET_SIZES.medium,\n \"neeto-ui-colorpicker__target-size--small\": size === TARGET_SIZES.small,\n })}\n >\n {showHexValue && (\n <span className=\"neeto-ui-colorpicker-target__code\">{color}</span>\n )}\n <span className=\"neeto-ui-colorpicker-target__color-wrapper\">\n <span\n className=\"neeto-ui-colorpicker-target__color neeto-ui-border-gray-200\"\n style={{ backgroundColor: colorValue }}\n />\n <span className=\"neeto-ui-colorpicker-target__icon\">\n <Down size={16} />\n </span>\n </span>\n </button>\n);\n\nTarget.propTypes = {\n size: PropTypes.oneOf(Object.values(TARGET_SIZES)),\n showHexValue: PropTypes.bool,\n color: PropTypes.string,\n colorValue: PropTypes.string,\n};\n\nexport default Target;\n","import React, { useState, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { ColorPicker as ColorPickerIcon } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport {\n HexColorPicker,\n HexColorInput,\n HexAlphaColorPicker,\n} from \"react-colorful\";\nimport { useTranslation } from \"react-i18next\";\nimport tinycolor from \"tinycolor2\";\nimport useEyeDropper from \"use-eye-dropper\";\n\nimport Button from \"components/Button\";\nimport Dropdown from \"components/Dropdown\";\nimport Typography from \"components/Typography\";\nimport { getLocale, noop } from \"utils\";\n\nimport useRecentlyUsedColors from \"./hooks/useRecentlyUsedColors\";\nimport Palette from \"./Palette\";\nimport Target from \"./Target\";\nimport { TARGET_SIZES } from \"./constants\";\n\nconst ColorPicker = ({\n color = \"\",\n size = TARGET_SIZES.large,\n onChange = noop,\n dropdownProps,\n showEyeDropper = true,\n showHexValue = false,\n showTransparencyControl = false,\n showPicker = true,\n showHexPicker = true,\n portalProps,\n colorPalette,\n showRecentlyUsedColors = showPicker,\n}) => {\n const { t, i18n } = useTranslation();\n const [colorInternal, setColorInternal] = useState(color);\n const [isColorSelected, setIsColorSelected] = useState(false);\n const hexColorInputValue = useRef(\"\");\n const { open, isSupported } = useEyeDropper({ pickRadius: 3 });\n const [recentlyUsedColors, setRecentlyUsedColors] = useRecentlyUsedColors();\n\n const PickerComponent = showTransparencyControl\n ? HexAlphaColorPicker\n : HexColorPicker;\n\n const colorValue = color ?? colorInternal ?? \"\";\n\n const getColor = colorValue => {\n const color = tinycolor(colorValue);\n\n if (color.isValid()) {\n let hex = color.toHexString();\n // return `transparent` for transparent colors.\n if (color.getAlpha() === 0) hex = colorValue;\n else if (showTransparencyControl) hex = color.toHex8String();\n\n return { hex, rgb: color.toRgb() };\n }\n\n return { hex: colorValue, rgb: colorValue };\n };\n\n const onColorChange = color => {\n setIsColorSelected(true);\n const changeHandler = onChange ?? setColorInternal;\n\n changeHandler(getColor(color));\n };\n\n const onColorInputChange = hex => {\n // HexColorInput onChange will trigger only if the input value is a valid color\n hexColorInputValue.current = hex;\n if (hex.length !== (showTransparencyControl ? 9 : 7)) return;\n\n onColorChange(hex);\n hexColorInputValue.current = \"\";\n };\n\n const onBlur = () => {\n if (!hexColorInputValue.current) return;\n\n onColorChange(hexColorInputValue.current);\n hexColorInputValue.current = \"\";\n };\n\n const pickColor = async () => {\n try {\n const colorResponse = await open();\n const hex = tinycolor(colorResponse.sRGBHex).toHexString();\n onColorChange(hex);\n } catch {\n // Ensures component is still mounted\n // before calling setState\n // if (!e.canceled) setError(e);\n }\n };\n\n const onClose = () => {\n if (!showRecentlyUsedColors || !isColorSelected) return;\n\n const newColor = getColor(colorValue);\n\n const recentColorsExcludingNew = recentlyUsedColors.filter(\n ({ hex }) => hex !== newColor.hex\n );\n\n const updatedColors = [newColor, ...recentColorsExcludingNew];\n\n if (updatedColors.length > 14) updatedColors.pop();\n\n setRecentlyUsedColors(updatedColors);\n setIsColorSelected(false);\n };\n\n return (\n <Dropdown\n className=\"neeto-ui-colorpicker__dropdown\"\n closeOnSelect={false}\n label={colorValue}\n position=\"bottom-start\"\n {...{ ...dropdownProps, onClose }}\n customTarget={<Target {...{ color, colorValue, showHexValue, size }} />}\n dropdownProps={{ ...dropdownProps?.dropdownProps, ...portalProps }}\n >\n <div className=\"neeto-ui-colorpicker__popover\">\n {showPicker && (\n <>\n {showHexPicker && (\n <div\n className=\"neeto-ui-colorpicker__pointer\"\n data-testid=\"neeto-color-picker-section\"\n >\n <PickerComponent color={colorValue} onChange={onColorChange} />\n </div>\n )}\n <div className=\"neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center neeto-ui-mt-3 neeto-ui-gap-2\">\n {showEyeDropper && isSupported() && (\n <Button\n className=\"neeto-ui-colorpicker__eyedropper-btn\"\n icon={ColorPickerIcon}\n size=\"small\"\n style=\"text\"\n type=\"button\"\n onClick={pickColor}\n />\n )}\n <div className=\"neeto-ui-input__wrapper\">\n <div\n className=\"neeto-ui-colorpicker__input neeto-ui-input neeto-ui-input--small\"\n data-cy=\"colorpicker-editable-input\"\n >\n <HexColorInput\n {...{ onBlur }}\n prefixed\n alpha={!!showTransparencyControl}\n color={colorValue}\n data-cy=\"colorpicker-editable-input-textbox\"\n onChange={onColorInputChange}\n />\n </div>\n </div>\n </div>\n </>\n )}\n <div\n data-testid=\"color-palette\"\n className={classnames(\"neeto-ui-colorpicker__palette-wrapper\", {\n \"neeto-ui-colorpicker__palette-wrapper--hidden-picker\": !showPicker,\n \"neeto-ui-pt-3 neeto-ui-border-t neeto-ui-border-gray-200\":\n showPicker,\n })}\n >\n <Palette\n {...{ color }}\n colorList={colorPalette}\n onChange={onColorChange}\n />\n </div>\n {showRecentlyUsedColors && recentlyUsedColors.length > 0 && (\n <div\n className=\"neeto-ui-colorpicker__palette-wrapper neeto-ui-border-t neeto-ui-border-gray-200 neeto-ui-pt-3\"\n data-testid=\"color-palette-recently-used\"\n >\n <Typography\n className=\"neeto-ui-text-gray-600 mb-2\"\n style=\"body3\"\n weight=\"medium\"\n >\n {getLocale(i18n, t, \"neetoui.colorPicker.recentlyUsed\")}\n </Typography>\n <Palette colorList={recentlyUsedColors} onChange={onColorChange} />\n </div>\n )}\n </div>\n </Dropdown>\n );\n};\n\nColorPicker.propTypes = {\n /**\n * To specify the color value.\n */\n color: PropTypes.string,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To set the size of the target.\n */\n size: PropTypes.oneOf(Object.values(TARGET_SIZES)),\n /**\n * To specify the action to be triggered on changing the color.\n */\n onChange: PropTypes.func,\n /**\n * To specify the colors shown in the palette.\n */\n colorPalette: PropTypes.arrayOf(\n PropTypes.shape({ hex: PropTypes.string, rgb: PropTypes.string })\n ),\n /**\n * Shows eye dropper to pick color.\n */\n showEyeDropper: PropTypes.bool,\n /**\n * To show hex value near to the color in the dropdown.\n * By default it will be enabled.\n */\n showHexValue: PropTypes.bool,\n /**\n * To show transparency control. By default it will be hidden.\n */\n showTransparencyControl: PropTypes.bool,\n /**\n * To show the color picker. Used to hide the picker in cases where only palette is required. By default it will be true.\n */\n showPicker: PropTypes.bool,\n /**\n * To show the hex color picker (color pointer). Used to hide the picker while keeping the hex input and eye dropper. By default it will be true.\n */\n showHexPicker: PropTypes.bool,\n /**\n * To specify the props to be passed to the dropdown portal.\n */\n portalProps: PropTypes.object,\n /**\n * To show the recently used colors.\n */\n showRecentlyUsedColors: PropTypes.bool,\n};\n\nexport default ColorPicker;\n"],"names":["r","o","e","t","n","Dropper","DEFAULT_PALETTE_COLORS","hex","TARGET_SIZES","large","medium","small","Palette","_ref","color","_ref$colorList","colorList","onChange","_jsx","className","children","map","item","rgb","colorObject","tinycolor","isTransparent","getAlpha","isActive","Boolean","toLocaleLowerCase","classnames","active","onClick","style","backgroundColor","Target","size","showHexValue","colorValue","_jsxs","type","Down","ColorPicker","_ref2","_ref$color","_ref$size","_ref$onChange","noop","dropdownProps","_ref$showEyeDropper","showEyeDropper","_ref$showHexValue","_ref$showTransparency","showTransparencyControl","_ref$showPicker","showPicker","_ref$showHexPicker","showHexPicker","portalProps","colorPalette","_ref$showRecentlyUsed","showRecentlyUsedColors","_useTranslation","useTranslation","i18n","_useState","useState","_useState2","_slicedToArray","colorInternal","setColorInternal","_useState3","_useState4","isColorSelected","setIsColorSelected","hexColorInputValue","useRef","_useEyeDropper","useEyeDropper","pickRadius","open","isSupported","_useRecentlyUsedColor","useRecentlyUsedColors","_useRecentlyUsedColor2","recentlyUsedColors","setRecentlyUsedColors","PickerComponent","HexAlphaColorPicker","HexColorPicker","getColor","isValid","toHexString","toHex8String","toRgb","onColorChange","changeHandler","onColorInputChange","current","length","onBlur","pickColor","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","_callee","colorResponse","wrap","_context","prev","next","sent","sRGBHex","_t","stop","apply","arguments","onClose","newColor","recentColorsExcludingNew","filter","_ref4","updatedColors","concat","_toConsumableArray","pop","Dropdown","_objectSpread","closeOnSelect","label","position","customTarget","_Fragment","Button","icon","ColorPickerIcon","HexColorInput","prefixed","alpha","Typography","weight","getLocale"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA0F,MAAM,CAAC,CAAC,IAAI,WAAW,EAAE,OAAO,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAACA,OAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAACC,MAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACC,QAAC,CAAC,KAAE,CAAC,CAACC,SAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAACC,WAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAACH,MAAC,EAAE,CAAC,CAAC,CAACG,WAAC,CAAC,IAAI,CAAC,OAAM,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAA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AC9E,IAAI,EAAE9D,CAAC,EAAE,kCAAkC;AAAC,SAC7C,CAAC,eACbe,GAAA,CAACN,OAAO,EAAA;AAACI,UAAAA,SAAS,EAAEsE,kBAAmB;AAACrE,UAAAA,QAAQ,EAAE+E;AAAc,SAAE,CAAC;AAAA,OAChE,CACN;KACE;AAAC,GAAA,CACE,CAAC;AAEf;;;;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"ColorPicker.js","sources":["../node_modules/use-eye-dropper/lib/use-eye-dropper.module.js","../node_modules/use-eye-dropper/lib/index.module.js","../src/components/ColorPicker/constants.js","../src/components/ColorPicker/Palette.jsx","../src/components/ColorPicker/Target.jsx","../src/components/ColorPicker/index.jsx"],"sourcesContent":["import{useMemo as r,useRef as o,useCallback as n,useEffect as t,useState as e}from\"react\";const i=()=>\"undefined\"!=typeof window&&\"EyeDropper\"in window,s=()=>{throw new Error(\"Unsupported browser.\")},a=a=>{const c=r(()=>{var r;return(r=i()&&new EyeDropper(a))?EyeDropper.prototype.open.bind(r):s},[a]),[p,w]=(()=>{const r=o(),[s,a]=e(!1);t(()=>(r.current=!0,a(i()),()=>{r.current=!1}),[]);const c=n(()=>s,[s]);return[r,c]})(),f=o(),u=n(()=>{void 0!==f.current&&f.current.abort()},[f]),d=n(async function(r){void 0===r&&(r={}),u();const{signal:o,...n}=r,t=new AbortController;f.current=t;const e=void 0!==o?(r=>{if(\"any\"in AbortSignal)return AbortSignal.any(r);const o=new AbortController,n=()=>{o.abort();for(const o of r)o.removeEventListener(\"abort\",n)};for(const o of r){if(o.aborted){n();break}o.addEventListener(\"abort\",n)}return o.signal})([o,t.signal]):t.signal;try{return await c({...n,signal:e})}catch(r){throw p.current||(r.canceled=!0),r}},[f,p,u,c]);return t(()=>u,[u]),{open:d,close:u,isSupported:w}};export{a as default};\n","import { default as DropperDev } from './use-eye-dropper.module.dev.js'\nimport { default as Dropper } from './use-eye-dropper.module.js'\n\nexport default process.env.NODE_ENV === 'production' ? Dropper : DropperDev\n","export const DEFAULT_PALETTE_COLORS = [\n { hex: \"#FFFFFF\" },\n { hex: \"#D6D6D6\" },\n { hex: \"#0A0E13\" },\n { hex: \"#FECE1E\" },\n { hex: \"#F32E48\" },\n { hex: \"#02C39A\" },\n { hex: \"#2A79C4\" },\n { hex: \"#B3E5FC\" },\n { hex: \"#C3C6F9\" },\n { hex: \"#8064CE\" },\n { hex: \"#FE861E\" },\n { hex: \"#FF7DC9\" },\n { hex: \"#028090\" },\n { hex: \"#095482\" },\n];\n\nexport const TARGET_SIZES = {\n large: \"large\",\n medium: \"medium\",\n small: \"small\",\n};\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport tinycolor from \"tinycolor2\";\n\nimport { DEFAULT_PALETTE_COLORS } from \"./constants\";\n\nconst Palette = ({ color, colorList = DEFAULT_PALETTE_COLORS, onChange }) => (\n <div className=\"neeto-ui-flex neeto-ui-flex-row neeto-ui-flex-wrap neeto-ui-items-start neeto-ui-justify-start neeto-ui-color-palette neeto-ui-gap-1\">\n {colorList.map(item => {\n const { hex, rgb } = item;\n const colorObject = tinycolor(hex ?? rgb);\n const isTransparent = colorObject.getAlpha() === 0;\n const isActive = Boolean(\n // hex is case insensitive.\n color?.toLocaleLowerCase() === hex?.toLocaleLowerCase() || color === rgb\n );\n\n return (\n <div\n data-testid=\"color-palette-item\"\n key={hex ?? rgb}\n className={classnames(\n \"neeto-ui-color-palette__item neeto-ui-border\",\n { active: isActive }\n )}\n onClick={() => onChange(hex ?? rgb)}\n >\n <div\n style={{ backgroundColor: hex ?? rgb }}\n className={classnames({\n \"transparent-bg-pattern\": isTransparent,\n })}\n />\n </div>\n );\n })}\n </div>\n);\n\nPalette.propTypes = {\n color: PropTypes.string,\n colorList: PropTypes.arrayOf(\n PropTypes.shape({\n hex: PropTypes.string,\n rgb: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.shape({\n r: PropTypes.number,\n g: PropTypes.number,\n b: PropTypes.number,\n }),\n ]),\n })\n ),\n onChange: PropTypes.func,\n};\n\nexport default Palette;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { Down } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\n\nimport { TARGET_SIZES } from \"./constants\";\n\nconst Target = ({ size, showHexValue, color, colorValue }) => (\n <button\n data-cy=\"color-picker-target\"\n data-testid=\"neeto-color-picker\"\n type=\"button\"\n className={classnames(\"neeto-ui-colorpicker__target\", {\n \"neeto-ui-colorpicker__target-size--large\": size === TARGET_SIZES.large,\n \"neeto-ui-colorpicker__target-size--medium\": size === TARGET_SIZES.medium,\n \"neeto-ui-colorpicker__target-size--small\": size === TARGET_SIZES.small,\n })}\n >\n {showHexValue && (\n <span className=\"neeto-ui-colorpicker-target__code\">{color}</span>\n )}\n <span className=\"neeto-ui-colorpicker-target__color-wrapper\">\n <span\n className=\"neeto-ui-colorpicker-target__color neeto-ui-border-gray-200\"\n style={{ backgroundColor: colorValue }}\n />\n <span className=\"neeto-ui-colorpicker-target__icon\">\n <Down size={16} />\n </span>\n </span>\n </button>\n);\n\nTarget.propTypes = {\n size: PropTypes.oneOf(Object.values(TARGET_SIZES)),\n showHexValue: PropTypes.bool,\n color: PropTypes.string,\n colorValue: PropTypes.string,\n};\n\nexport default Target;\n","import React, { useState, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { ColorPicker as ColorPickerIcon } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport {\n HexColorPicker,\n HexColorInput,\n HexAlphaColorPicker,\n} from \"react-colorful\";\nimport { useTranslation } from \"react-i18next\";\nimport tinycolor from \"tinycolor2\";\nimport useEyeDropper from \"use-eye-dropper\";\n\nimport Button from \"components/Button\";\nimport Dropdown from \"components/Dropdown\";\nimport Typography from \"components/Typography\";\nimport { getLocale, noop } from \"utils\";\n\nimport useRecentlyUsedColors from \"./hooks/useRecentlyUsedColors\";\nimport Palette from \"./Palette\";\nimport Target from \"./Target\";\nimport { TARGET_SIZES } from \"./constants\";\n\nconst ColorPicker = ({\n color = \"\",\n size = TARGET_SIZES.large,\n onChange = noop,\n dropdownProps,\n showEyeDropper = true,\n showHexValue = false,\n showTransparencyControl = false,\n showPicker = true,\n showHexPicker = true,\n portalProps,\n colorPalette,\n showRecentlyUsedColors = showPicker,\n}) => {\n const { t, i18n } = useTranslation();\n const [colorInternal, setColorInternal] = useState(color);\n const [isColorSelected, setIsColorSelected] = useState(false);\n const hexColorInputValue = useRef(\"\");\n const { open, isSupported } = useEyeDropper({ pickRadius: 3 });\n const [recentlyUsedColors, setRecentlyUsedColors] = useRecentlyUsedColors();\n\n const PickerComponent = showTransparencyControl\n ? HexAlphaColorPicker\n : HexColorPicker;\n\n const colorValue = color ?? colorInternal ?? \"\";\n\n const getColor = colorValue => {\n const color = tinycolor(colorValue);\n\n if (color.isValid()) {\n let hex = color.toHexString();\n // return `transparent` for transparent colors.\n if (color.getAlpha() === 0) hex = colorValue;\n else if (showTransparencyControl) hex = color.toHex8String();\n\n return { hex, rgb: color.toRgb() };\n }\n\n return { hex: colorValue, rgb: colorValue };\n };\n\n const onColorChange = color => {\n setIsColorSelected(true);\n const changeHandler = onChange ?? setColorInternal;\n\n changeHandler(getColor(color));\n };\n\n const onColorInputChange = hex => {\n // HexColorInput onChange will trigger only if the input value is a valid color\n hexColorInputValue.current = hex;\n if (hex.length !== (showTransparencyControl ? 9 : 7)) return;\n\n onColorChange(hex);\n hexColorInputValue.current = \"\";\n };\n\n const onBlur = () => {\n if (!hexColorInputValue.current) return;\n\n onColorChange(hexColorInputValue.current);\n hexColorInputValue.current = \"\";\n };\n\n const pickColor = async () => {\n try {\n const colorResponse = await open();\n const hex = tinycolor(colorResponse.sRGBHex).toHexString();\n onColorChange(hex);\n } catch {\n // Ensures component is still mounted\n // before calling setState\n // if (!e.canceled) setError(e);\n }\n };\n\n const onClose = () => {\n if (!showRecentlyUsedColors || !isColorSelected) return;\n\n const newColor = getColor(colorValue);\n\n const recentColorsExcludingNew = recentlyUsedColors.filter(\n ({ hex }) => hex !== newColor.hex\n );\n\n const updatedColors = [newColor, ...recentColorsExcludingNew];\n\n if (updatedColors.length > 14) updatedColors.pop();\n\n setRecentlyUsedColors(updatedColors);\n setIsColorSelected(false);\n };\n\n return (\n <Dropdown\n closeOnSelect={false}\n label={colorValue}\n position=\"bottom-start\"\n {...{ ...dropdownProps, onClose }}\n customTarget={<Target {...{ color, colorValue, showHexValue, size }} />}\n dropdownProps={{ ...dropdownProps?.dropdownProps, ...portalProps }}\n className={classnames(\"neeto-ui-colorpicker__dropdown\", {\n \"neeto-ui-colorpicker__dropdown-size--small\":\n size === TARGET_SIZES.small,\n \"neeto-ui-colorpicker__dropdown-size--medium\":\n size === TARGET_SIZES.medium,\n \"neeto-ui-colorpicker__dropdown-size--large\":\n size === TARGET_SIZES.large,\n })}\n >\n <div className=\"neeto-ui-colorpicker__popover\">\n {showPicker && (\n <>\n {showHexPicker && (\n <div\n className=\"neeto-ui-colorpicker__pointer\"\n data-testid=\"neeto-color-picker-section\"\n >\n <PickerComponent color={colorValue} onChange={onColorChange} />\n </div>\n )}\n <div className=\"neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center neeto-ui-mt-3 neeto-ui-gap-2\">\n {showEyeDropper && isSupported() && (\n <Button\n className=\"neeto-ui-colorpicker__eyedropper-btn\"\n icon={ColorPickerIcon}\n size=\"small\"\n style=\"text\"\n type=\"button\"\n onClick={pickColor}\n />\n )}\n <div className=\"neeto-ui-input__wrapper\">\n <div\n className=\"neeto-ui-colorpicker__input neeto-ui-input neeto-ui-input--small\"\n data-cy=\"colorpicker-editable-input\"\n >\n <HexColorInput\n {...{ onBlur }}\n prefixed\n alpha={!!showTransparencyControl}\n color={colorValue}\n data-cy=\"colorpicker-editable-input-textbox\"\n onChange={onColorInputChange}\n />\n </div>\n </div>\n </div>\n </>\n )}\n <div\n data-testid=\"color-palette\"\n className={classnames(\"neeto-ui-colorpicker__palette-wrapper\", {\n \"neeto-ui-colorpicker__palette-wrapper--hidden-picker\": !showPicker,\n \"neeto-ui-pt-3 neeto-ui-border-t neeto-ui-border-gray-200\":\n showPicker,\n })}\n >\n <Palette\n {...{ color }}\n colorList={colorPalette}\n onChange={onColorChange}\n />\n </div>\n {showRecentlyUsedColors && recentlyUsedColors.length > 0 && (\n <div\n className=\"neeto-ui-colorpicker__palette-wrapper neeto-ui-border-t neeto-ui-border-gray-200 neeto-ui-pt-3\"\n data-testid=\"color-palette-recently-used\"\n >\n <Typography\n className=\"neeto-ui-text-gray-600 mb-2\"\n style=\"body3\"\n weight=\"medium\"\n >\n {getLocale(i18n, t, \"neetoui.colorPicker.recentlyUsed\")}\n </Typography>\n <Palette colorList={recentlyUsedColors} onChange={onColorChange} />\n </div>\n )}\n </div>\n </Dropdown>\n );\n};\n\nColorPicker.propTypes = {\n /**\n * To specify the color value.\n */\n color: PropTypes.string,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To set the size of the target.\n */\n size: PropTypes.oneOf(Object.values(TARGET_SIZES)),\n /**\n * To specify the action to be triggered on changing the color.\n */\n onChange: PropTypes.func,\n /**\n * To specify the colors shown in the palette.\n */\n colorPalette: PropTypes.arrayOf(\n PropTypes.shape({ hex: PropTypes.string, rgb: PropTypes.string })\n ),\n /**\n * Shows eye dropper to pick color.\n */\n showEyeDropper: PropTypes.bool,\n /**\n * To show hex value near to the color in the dropdown.\n * By default it will be enabled.\n */\n showHexValue: PropTypes.bool,\n /**\n * To show transparency control. By default it will be hidden.\n */\n showTransparencyControl: PropTypes.bool,\n /**\n * To show the color picker. Used to hide the picker in cases where only palette is required. By default it will be true.\n */\n showPicker: PropTypes.bool,\n /**\n * To show the hex color picker (color pointer). Used to hide the picker while keeping the hex input and eye dropper. By default it will be true.\n */\n showHexPicker: PropTypes.bool,\n /**\n * To specify the props to be passed to the dropdown portal.\n */\n portalProps: PropTypes.object,\n /**\n * To show the recently used colors.\n */\n showRecentlyUsedColors: PropTypes.bool,\n};\n\nexport default ColorPicker;\n"],"names":["r","o","e","t","n","Dropper","DEFAULT_PALETTE_COLORS","hex","TARGET_SIZES","large","medium","small","Palette","_ref","color","_ref$colorList","colorList","onChange","_jsx","className","children","map","item","rgb","colorObject","tinycolor","isTransparent","getAlpha","isActive","Boolean","toLocaleLowerCase","classnames","active","onClick","style","backgroundColor","Target","size","showHexValue","colorValue","_jsxs","type","Down","ColorPicker","_ref2","_ref$color","_ref$size","_ref$onChange","noop","dropdownProps","_ref$showEyeDropper","showEyeDropper","_ref$showHexValue","_ref$showTransparency","showTransparencyControl","_ref$showPicker","showPicker","_ref$showHexPicker","showHexPicker","portalProps","colorPalette","_ref$showRecentlyUsed","showRecentlyUsedColors","_useTranslation","useTranslation","i18n","_useState","useState","_useState2","_slicedToArray","colorInternal","setColorInternal","_useState3","_useState4","isColorSelected","setIsColorSelected","hexColorInputValue","useRef","_useEyeDropper","useEyeDropper","pickRadius","open","isSupported","_useRecentlyUsedColor","useRecentlyUsedColors","_useRecentlyUsedColor2","recentlyUsedColors","setRecentlyUsedColors","PickerComponent","HexAlphaColorPicker","HexColorPicker","getColor","isValid","toHexString","toHex8String","toRgb","onColorChange","changeHandler","onColorInputChange","current","length","onBlur","pickColor","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","_callee","colorResponse","wrap","_context","prev","next","sent","sRGBHex","_t","stop","apply","arguments","onClose","newColor","recentColorsExcludingNew","filter","_ref4","updatedColors","concat","_toConsumableArray","pop","Dropdown","_objectSpread","closeOnSelect","label","position","customTarget","_Fragment","Button","icon","ColorPickerIcon","HexColorInput","prefixed","alpha","Typography","weight","getLocale"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA0F,MAAM,CAAC,CAAC,IAAI,WAAW,EAAE,OAAO,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC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AAc,SAAE,CAAC;AAAA,OAChE,CACN;KACE;AAAC,GAAA,CACE,CAAC;AAEf;;;;","x_google_ignoreList":[0,1]}
@@ -31,7 +31,7 @@ import './useRecentlyUsedColors-C18GFyJC.js';
31
31
  import './Dropdown.js';
32
32
  import './index-BbZEp6Op.js';
33
33
  import '@bigbinary/neeto-icons/Down';
34
- export { D as default } from './index-BRcfDAre.js';
34
+ export { D as default } from './index-y8ZUrseh.js';
35
35
  import './Input.js';
36
36
  import './Label.js';
37
37
  import './MultiEmailInput.js';
@@ -68,10 +68,10 @@ import './Tab.js';
68
68
  import 'antd/lib/table';
69
69
  import '@bigbinary/neeto-icons/MenuHorizontal';
70
70
  import 'react-drag-listview';
71
+ import 'react-resizable';
71
72
  import '@bigbinary/neeto-icons/DownArrow';
72
73
  import '@bigbinary/neeto-icons/UpArrow';
73
74
  import '@bigbinary/neeto-icons/InfoRound';
74
- import 'react-resizable';
75
75
  import './Tag.js';
76
76
  import './Toastr.js';
77
77
  import 'i18next';
package/dist/Table.js CHANGED
@@ -9,7 +9,7 @@ import { isPresent, noop, snakeToCamelCase, camelToSnakeCase, isNotEmpty, modify
9
9
  import Left from '@bigbinary/neeto-icons/Left';
10
10
  import Right from '@bigbinary/neeto-icons/Right';
11
11
  import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
12
- import { isNil, move, isEmpty, all, includes, __, pipe, filter, pluck, equals, has, without, append, props, mergeLeft, assoc } from 'ramda';
12
+ import { isNil, isEmpty, all, includes, __, pipe, filter, pluck, equals, move, has, without, append, props, mergeLeft, assoc } from 'ramda';
13
13
  import ReactDragListView from 'react-drag-listview';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useHistory } from 'react-router-dom';
@@ -22,13 +22,13 @@ import Button from './Button.js';
22
22
  import Callout from './Callout.js';
23
23
  import Typography from './Typography.js';
24
24
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
25
- import { a as TABLE_SORT_ORDERS, U as URL_SORT_ORDERS, H as HeaderCellMenu, b as TABLE_PAGINATION_HEIGHT, c as TABLE_ROW_HEIGHT, C as COLUMN_FIXED_VALUES, S as SELECT_ALL_ROWS_CALLOUT_MOBILE_HEIGHT, d as SELECT_ALL_ROWS_CALLOUT_DESKTOP_HEIGHT, u as useRestoreScrollPosition, e as TABLE_DEFAULT_HEADER_HEIGHT, f as TableInfoPane } from './index-BRcfDAre.js';
25
+ import { H as HeaderCellMenu, a as TABLE_SORT_ORDERS, b as TABLE_PAGINATION_HEIGHT, c as TABLE_ROW_HEIGHT, C as COLUMN_FIXED_VALUES, S as SELECT_ALL_ROWS_CALLOUT_MOBILE_HEIGHT, d as SELECT_ALL_ROWS_CALLOUT_DESKTOP_HEIGHT, U as URL_SORT_ORDERS, u as useRestoreScrollPosition, e as TABLE_DEFAULT_HEADER_HEIGHT, f as TableInfoPane } from './index-y8ZUrseh.js';
26
+ import { Resizable } from 'react-resizable';
26
27
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
27
28
  import DownArrow from '@bigbinary/neeto-icons/DownArrow';
28
29
  import UpArrow from '@bigbinary/neeto-icons/UpArrow';
29
30
  import InfoRound from '@bigbinary/neeto-icons/InfoRound';
30
31
  import Popover from './Popover.js';
31
- import { Resizable } from 'react-resizable';
32
32
  import Spinner from './Spinner.js';
33
33
  import 'antd/locale/de_DE';
34
34
  import 'antd/locale/en_US';
@@ -213,92 +213,7 @@ var useLocalStorage = function useLocalStorage(key, defaultValue) {
213
213
  return [storedValue, setValue];
214
214
  };
215
215
 
216
- var useReorderColumns = function useReorderColumns(_ref) {
217
- var isEnabled = _ref.isEnabled,
218
- columns = _ref.columns,
219
- setColumns = _ref.setColumns,
220
- onColumnUpdateWithChanges = _ref.onColumnUpdateWithChanges,
221
- rowSelection = _ref.rowSelection;
222
- if (!isEnabled) return {
223
- dragProps: {},
224
- columns: columns
225
- };
226
- var isColumnFixed = function isColumnFixed(column) {
227
- return !!column.fixed;
228
- };
229
- var dragProps = {
230
- onDragEnd: function onDragEnd(fromIndex, toIndex) {
231
- var from = fromIndex;
232
- var to = toIndex;
233
- if (rowSelection) {
234
- from = fromIndex - 1;
235
- to = toIndex - 1;
236
- }
237
- if (!columns[from] || !columns[to]) return;
238
- if (isColumnFixed(columns[from]) || isColumnFixed(columns[to])) return;
239
- var newColumns = move(from, to, columns);
240
- setColumns(newColumns);
241
- onColumnUpdateWithChanges(newColumns);
242
- },
243
- nodeSelector: "th:not(.ant-table-cell-fix-left):not(.ant-table-cell-scrollbar)",
244
- handleSelector: ".drag-handler",
245
- ignoreSelector: ".react-resizable-handle"
246
- };
247
- return {
248
- dragProps: dragProps,
249
- columns: columns
250
- };
251
- };
252
-
253
- var SortIcon = function SortIcon(_ref) {
254
- var sortOrder = _ref.sortOrder;
255
- if (sortOrder === TABLE_SORT_ORDERS.asc || sortOrder === URL_SORT_ORDERS.ascend) {
256
- return /*#__PURE__*/jsx(UpArrow, {
257
- size: 14
258
- });
259
- }
260
- if (sortOrder === TABLE_SORT_ORDERS.desc || sortOrder === URL_SORT_ORDERS.descend) {
261
- return /*#__PURE__*/jsx(DownArrow, {
262
- size: 14
263
- });
264
- }
265
- return null;
266
- };
267
-
268
- var _excluded$5 = ["title", "description"];
269
- var TitleWithInfoIcon = function TitleWithInfoIcon(_ref) {
270
- var title = _ref.title,
271
- description = _ref.description,
272
- rest = _objectWithoutProperties(_ref, _excluded$5);
273
- var popoverRef = useRef();
274
- return /*#__PURE__*/jsxs("span", {
275
- className: "neeto-ui-pr-5 relative",
276
- children: [typeof title === "function" ? title(rest) : title, description && /*#__PURE__*/jsxs(Fragment, {
277
- children: [/*#__PURE__*/jsx("span", {
278
- className: "neeto-ui-table__column-title-info-icon",
279
- ref: popoverRef,
280
- children: /*#__PURE__*/jsx(InfoRound, {
281
- color: "currentColor",
282
- size: 14
283
- })
284
- }), /*#__PURE__*/jsx(Popover, {
285
- appendTo: function appendTo() {
286
- return document.body;
287
- },
288
- position: "bottom",
289
- reference: popoverRef,
290
- children: /*#__PURE__*/jsx(Typography, {
291
- lineHeight: "normal",
292
- style: "body2",
293
- children: description
294
- })
295
- })]
296
- })]
297
- });
298
- };
299
- var TitleWithInfoIcon$1 = /*#__PURE__*/React__default.memo(TitleWithInfoIcon);
300
-
301
- var _excluded$4 = ["children", "isSortable", "isAddEnabled", "sortedInfo", "onSort", "isHidable", "isDeletable", "isFixedColumn", "isColumnFreezeEnabled", "isMoveToLeftEnabled", "isMoveToRightEnabled", "onColumnHide", "onColumnUpdate", "onAddColumn", "onColumnDelete", "onColumnFreeze", "onMoreActionClick", "column", "moreActions"];
216
+ var _excluded$5 = ["children", "isSortable", "isAddEnabled", "sortedInfo", "onSort", "isHidable", "isDeletable", "isFixedColumn", "isColumnFreezeEnabled", "isMoveToLeftEnabled", "isMoveToRightEnabled", "onColumnHide", "onColumnUpdate", "onAddColumn", "onColumnDelete", "onColumnFreeze", "onMoreActionClick", "column", "moreActions"];
302
217
  function ownKeys$6(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; }
303
218
  function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
304
219
  var CellContent = function CellContent(_ref) {
@@ -324,7 +239,7 @@ var CellContent = function CellContent(_ref) {
324
239
  column = _ref.column,
325
240
  _ref$moreActions = _ref.moreActions,
326
241
  moreActions = _ref$moreActions === void 0 ? [] : _ref$moreActions,
327
- headerProps = _objectWithoutProperties(_ref, _excluded$4);
242
+ headerProps = _objectWithoutProperties(_ref, _excluded$5);
328
243
  var isColumnHidable = isHidable && isPresent(onColumnHide);
329
244
  var isColumnDeletable = isDeletable && isPresent(onColumnDelete);
330
245
  var hasMoreActions = !isEmpty(moreActions) && isPresent(onMoreActionClick);
@@ -364,7 +279,7 @@ var CellContent = function CellContent(_ref) {
364
279
  };
365
280
  var CellContent$1 = /*#__PURE__*/React__default.memo(CellContent);
366
281
 
367
- var _excluded$3 = ["onResize", "width", "onResizeStop", "className"];
282
+ var _excluded$4 = ["onResize", "width", "onResizeStop", "className"];
368
283
  function ownKeys$5(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; }
369
284
  function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
370
285
  var HeaderCell = function HeaderCell(props) {
@@ -372,7 +287,7 @@ var HeaderCell = function HeaderCell(props) {
372
287
  width = props.width,
373
288
  onResizeStop = props.onResizeStop,
374
289
  className = props.className,
375
- restProps = _objectWithoutProperties(props, _excluded$3);
290
+ restProps = _objectWithoutProperties(props, _excluded$4);
376
291
  if (!width) {
377
292
  return /*#__PURE__*/jsx(CellContent$1, _objectSpread$5(_objectSpread$5({}, restProps), {}, {
378
293
  className: classnames(className, "drag-handler")
@@ -402,7 +317,7 @@ var HeaderCell = function HeaderCell(props) {
402
317
  };
403
318
  var HeaderCell$1 = /*#__PURE__*/React__default.memo(HeaderCell);
404
319
 
405
- var _excluded$2 = ["onResize", "width", "onResizeStop", "onResizeStart"];
320
+ var _excluded$3 = ["onResize", "width", "onResizeStop", "onResizeStart"];
406
321
  function ownKeys$4(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; }
407
322
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
408
323
  var ResizableHeaderCell = function ResizableHeaderCell(props) {
@@ -410,7 +325,7 @@ var ResizableHeaderCell = function ResizableHeaderCell(props) {
410
325
  width = props.width,
411
326
  _onResizeStop = props.onResizeStop,
412
327
  _onResizeStart = props.onResizeStart,
413
- restProps = _objectWithoutProperties(props, _excluded$2);
328
+ restProps = _objectWithoutProperties(props, _excluded$3);
414
329
  var _useState = useState(false),
415
330
  _useState2 = _slicedToArray(_useState, 2),
416
331
  isResizing = _useState2[0],
@@ -449,12 +364,12 @@ var ResizableHeaderCell = function ResizableHeaderCell(props) {
449
364
  };
450
365
  var ResizableHeaderCell$1 = /*#__PURE__*/React__default.memo(ResizableHeaderCell);
451
366
 
452
- var _excluded$1 = ["className"];
367
+ var _excluded$2 = ["className"];
453
368
  function ownKeys$3(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; }
454
369
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
455
370
  var ReorderableHeaderCell = function ReorderableHeaderCell(_ref) {
456
371
  var className = _ref.className,
457
- props = _objectWithoutProperties(_ref, _excluded$1);
372
+ props = _objectWithoutProperties(_ref, _excluded$2);
458
373
  return /*#__PURE__*/jsx(CellContent$1, _objectSpread$3(_objectSpread$3({}, props), {}, {
459
374
  className: classnames(className, "drag-handler")
460
375
  }));
@@ -540,6 +455,100 @@ var calculateRowsPerPage = function calculateRowsPerPage() {
540
455
  var rowsPerPage = Math.floor((viewportHeight - TABLE_PAGINATION_HEIGHT) / TABLE_ROW_HEIGHT * 3);
541
456
  return Math.ceil(rowsPerPage / 10) * 10;
542
457
  };
458
+ var filterVisibleColumns = function filterVisibleColumns(columns) {
459
+ return columns.filter(function (col) {
460
+ return col.hidden !== true && col.isShown !== false;
461
+ });
462
+ };
463
+
464
+ var useReorderColumns = function useReorderColumns(_ref) {
465
+ var isEnabled = _ref.isEnabled,
466
+ columns = _ref.columns,
467
+ setColumns = _ref.setColumns,
468
+ onColumnUpdateWithChanges = _ref.onColumnUpdateWithChanges,
469
+ rowSelection = _ref.rowSelection;
470
+ if (!isEnabled) return {
471
+ dragProps: {},
472
+ columns: columns
473
+ };
474
+ var isColumnFixed = function isColumnFixed(column) {
475
+ return !!column.fixed;
476
+ };
477
+ var dragProps = {
478
+ onDragEnd: function onDragEnd(fromIndex, toIndex) {
479
+ if (rowSelection) {
480
+ fromIndex--;
481
+ toIndex--;
482
+ }
483
+ if (fromIndex < 0 || toIndex < 0 || fromIndex === toIndex) return;
484
+ var visibleColumns = filterVisibleColumns(columns);
485
+ var fromColumn = visibleColumns[fromIndex];
486
+ var toColumn = visibleColumns[toIndex];
487
+ if (!fromColumn || !toColumn) return;else if (isColumnFixed(fromColumn) || isColumnFixed(toColumn)) return;
488
+ var fromColumnActualIndex = columns.indexOf(fromColumn);
489
+ var toColumnActualIndex = columns.indexOf(toColumn);
490
+ if (fromColumnActualIndex < 0 || toColumnActualIndex < 0) return;
491
+ var newColumns = move(fromColumnActualIndex, toColumnActualIndex, columns);
492
+ setColumns(newColumns);
493
+ onColumnUpdateWithChanges(newColumns);
494
+ },
495
+ nodeSelector: "th:not(.ant-table-cell-fix-left):not(.ant-table-cell-scrollbar)",
496
+ handleSelector: ".drag-handler",
497
+ ignoreSelector: ".react-resizable-handle"
498
+ };
499
+ return {
500
+ dragProps: dragProps,
501
+ columns: columns
502
+ };
503
+ };
504
+
505
+ var SortIcon = function SortIcon(_ref) {
506
+ var sortOrder = _ref.sortOrder;
507
+ if (sortOrder === TABLE_SORT_ORDERS.asc || sortOrder === URL_SORT_ORDERS.ascend) {
508
+ return /*#__PURE__*/jsx(UpArrow, {
509
+ size: 14
510
+ });
511
+ }
512
+ if (sortOrder === TABLE_SORT_ORDERS.desc || sortOrder === URL_SORT_ORDERS.descend) {
513
+ return /*#__PURE__*/jsx(DownArrow, {
514
+ size: 14
515
+ });
516
+ }
517
+ return null;
518
+ };
519
+
520
+ var _excluded$1 = ["title", "description"];
521
+ var TitleWithInfoIcon = function TitleWithInfoIcon(_ref) {
522
+ var title = _ref.title,
523
+ description = _ref.description,
524
+ rest = _objectWithoutProperties(_ref, _excluded$1);
525
+ var popoverRef = useRef();
526
+ return /*#__PURE__*/jsxs("span", {
527
+ className: "neeto-ui-pr-5 relative",
528
+ children: [typeof title === "function" ? title(rest) : title, description && /*#__PURE__*/jsxs(Fragment, {
529
+ children: [/*#__PURE__*/jsx("span", {
530
+ className: "neeto-ui-table__column-title-info-icon",
531
+ ref: popoverRef,
532
+ children: /*#__PURE__*/jsx(InfoRound, {
533
+ color: "currentColor",
534
+ size: 14
535
+ })
536
+ }), /*#__PURE__*/jsx(Popover, {
537
+ appendTo: function appendTo() {
538
+ return document.body;
539
+ },
540
+ position: "bottom",
541
+ reference: popoverRef,
542
+ children: /*#__PURE__*/jsx(Typography, {
543
+ lineHeight: "normal",
544
+ style: "body2",
545
+ children: description
546
+ })
547
+ })]
548
+ })]
549
+ });
550
+ };
551
+ var TitleWithInfoIcon$1 = /*#__PURE__*/React__default.memo(TitleWithInfoIcon);
543
552
 
544
553
  function ownKeys$2(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; }
545
554
  function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }