@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.
- package/dist/ColorPicker.js +5 -1
- package/dist/ColorPicker.js.map +1 -1
- package/dist/DatePicker.js +2 -2
- package/dist/Table.js +105 -96
- package/dist/Table.js.map +1 -1
- package/dist/TimePicker.js +2 -2
- package/dist/cjs/ColorPicker.js +5 -1
- package/dist/cjs/ColorPicker.js.map +1 -1
- package/dist/cjs/DatePicker.js +2 -2
- package/dist/cjs/Table.js +104 -95
- package/dist/cjs/Table.js.map +1 -1
- package/dist/cjs/TimePicker.js +2 -2
- package/dist/cjs/{index-DruCXsxo.js → index-Beqo68PR.js} +4 -4
- package/dist/cjs/{index-DruCXsxo.js.map → index-Beqo68PR.js.map} +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/{index-BRcfDAre.js → index-y8ZUrseh.js} +4 -4
- package/dist/{index-BRcfDAre.js.map → index-y8ZUrseh.js.map} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +4 -4
- package/package.json +5 -5
|
@@ -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,aAAC,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,YAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACC,cAAC,CAAC,KAAE,CAAC,CAACC,eAAC,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,iBAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAACH,YAAC,EAAE,CAAC,CAAC,CAACG,iBAAC,CAAC,IAAI,CAAC,OAAM,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,GAAE,CAAC,CAAC,CAAC,C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E,kCAAkC;AAAC,SAC7C,CAAC,eACbe,cAAA,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,CAAC,CAAC,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Ac,SAAE,CAAC;AAAA,OAChE,CACN;KACE;AAAC,GAAA,CACE,CAAC;AAEf;;;;","x_google_ignoreList":[0,1]}
|
package/dist/cjs/DatePicker.js
CHANGED
|
@@ -33,7 +33,7 @@ require('./useRecentlyUsedColors-CThW5BOM.js');
|
|
|
33
33
|
require('./Dropdown.js');
|
|
34
34
|
require('./index-BlcVTw2b.js');
|
|
35
35
|
require('@bigbinary/neeto-icons/Down');
|
|
36
|
-
var DatePicker = require('./index-
|
|
36
|
+
var DatePicker = require('./index-Beqo68PR.js');
|
|
37
37
|
require('./Input.js');
|
|
38
38
|
require('./Label.js');
|
|
39
39
|
require('./MultiEmailInput.js');
|
|
@@ -70,10 +70,10 @@ require('./Tab.js');
|
|
|
70
70
|
require('antd/lib/table');
|
|
71
71
|
require('@bigbinary/neeto-icons/MenuHorizontal');
|
|
72
72
|
require('react-drag-listview');
|
|
73
|
+
require('react-resizable');
|
|
73
74
|
require('@bigbinary/neeto-icons/DownArrow');
|
|
74
75
|
require('@bigbinary/neeto-icons/UpArrow');
|
|
75
76
|
require('@bigbinary/neeto-icons/InfoRound');
|
|
76
|
-
require('react-resizable');
|
|
77
77
|
require('./Tag.js');
|
|
78
78
|
require('./Toastr.js');
|
|
79
79
|
require('i18next');
|
package/dist/cjs/Table.js
CHANGED
|
@@ -24,13 +24,13 @@ var Button = require('./Button.js');
|
|
|
24
24
|
var Callout = require('./Callout.js');
|
|
25
25
|
var Typography = require('./Typography.js');
|
|
26
26
|
var jsxRuntime = require('react/jsx-runtime');
|
|
27
|
-
var DatePicker = require('./index-
|
|
27
|
+
var DatePicker = require('./index-Beqo68PR.js');
|
|
28
|
+
var reactResizable = require('react-resizable');
|
|
28
29
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
29
30
|
var DownArrow = require('@bigbinary/neeto-icons/DownArrow');
|
|
30
31
|
var UpArrow = require('@bigbinary/neeto-icons/UpArrow');
|
|
31
32
|
var InfoRound = require('@bigbinary/neeto-icons/InfoRound');
|
|
32
33
|
var Popover = require('./Popover.js');
|
|
33
|
-
var reactResizable = require('react-resizable');
|
|
34
34
|
var Spinner = require('./Spinner.js');
|
|
35
35
|
require('antd/locale/de_DE');
|
|
36
36
|
require('antd/locale/en_US');
|
|
@@ -215,92 +215,7 @@ var useLocalStorage = function useLocalStorage(key, defaultValue) {
|
|
|
215
215
|
return [storedValue, setValue];
|
|
216
216
|
};
|
|
217
217
|
|
|
218
|
-
var
|
|
219
|
-
var isEnabled = _ref.isEnabled,
|
|
220
|
-
columns = _ref.columns,
|
|
221
|
-
setColumns = _ref.setColumns,
|
|
222
|
-
onColumnUpdateWithChanges = _ref.onColumnUpdateWithChanges,
|
|
223
|
-
rowSelection = _ref.rowSelection;
|
|
224
|
-
if (!isEnabled) return {
|
|
225
|
-
dragProps: {},
|
|
226
|
-
columns: columns
|
|
227
|
-
};
|
|
228
|
-
var isColumnFixed = function isColumnFixed(column) {
|
|
229
|
-
return !!column.fixed;
|
|
230
|
-
};
|
|
231
|
-
var dragProps = {
|
|
232
|
-
onDragEnd: function onDragEnd(fromIndex, toIndex) {
|
|
233
|
-
var from = fromIndex;
|
|
234
|
-
var to = toIndex;
|
|
235
|
-
if (rowSelection) {
|
|
236
|
-
from = fromIndex - 1;
|
|
237
|
-
to = toIndex - 1;
|
|
238
|
-
}
|
|
239
|
-
if (!columns[from] || !columns[to]) return;
|
|
240
|
-
if (isColumnFixed(columns[from]) || isColumnFixed(columns[to])) return;
|
|
241
|
-
var newColumns = ramda.move(from, to, columns);
|
|
242
|
-
setColumns(newColumns);
|
|
243
|
-
onColumnUpdateWithChanges(newColumns);
|
|
244
|
-
},
|
|
245
|
-
nodeSelector: "th:not(.ant-table-cell-fix-left):not(.ant-table-cell-scrollbar)",
|
|
246
|
-
handleSelector: ".drag-handler",
|
|
247
|
-
ignoreSelector: ".react-resizable-handle"
|
|
248
|
-
};
|
|
249
|
-
return {
|
|
250
|
-
dragProps: dragProps,
|
|
251
|
-
columns: columns
|
|
252
|
-
};
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
var SortIcon = function SortIcon(_ref) {
|
|
256
|
-
var sortOrder = _ref.sortOrder;
|
|
257
|
-
if (sortOrder === DatePicker.TABLE_SORT_ORDERS.asc || sortOrder === DatePicker.URL_SORT_ORDERS.ascend) {
|
|
258
|
-
return /*#__PURE__*/jsxRuntime.jsx(UpArrow, {
|
|
259
|
-
size: 14
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
if (sortOrder === DatePicker.TABLE_SORT_ORDERS.desc || sortOrder === DatePicker.URL_SORT_ORDERS.descend) {
|
|
263
|
-
return /*#__PURE__*/jsxRuntime.jsx(DownArrow, {
|
|
264
|
-
size: 14
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
return null;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
var _excluded$5 = ["title", "description"];
|
|
271
|
-
var TitleWithInfoIcon = function TitleWithInfoIcon(_ref) {
|
|
272
|
-
var title = _ref.title,
|
|
273
|
-
description = _ref.description,
|
|
274
|
-
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
275
|
-
var popoverRef = React.useRef();
|
|
276
|
-
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
277
|
-
className: "neeto-ui-pr-5 relative",
|
|
278
|
-
children: [typeof title === "function" ? title(rest) : title, description && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
279
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
280
|
-
className: "neeto-ui-table__column-title-info-icon",
|
|
281
|
-
ref: popoverRef,
|
|
282
|
-
children: /*#__PURE__*/jsxRuntime.jsx(InfoRound, {
|
|
283
|
-
color: "currentColor",
|
|
284
|
-
size: 14
|
|
285
|
-
})
|
|
286
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Popover, {
|
|
287
|
-
appendTo: function appendTo() {
|
|
288
|
-
return document.body;
|
|
289
|
-
},
|
|
290
|
-
position: "bottom",
|
|
291
|
-
reference: popoverRef,
|
|
292
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
293
|
-
lineHeight: "normal",
|
|
294
|
-
style: "body2",
|
|
295
|
-
children: description
|
|
296
|
-
})
|
|
297
|
-
})]
|
|
298
|
-
})]
|
|
299
|
-
});
|
|
300
|
-
};
|
|
301
|
-
var TitleWithInfoIcon$1 = /*#__PURE__*/React.memo(TitleWithInfoIcon);
|
|
302
|
-
|
|
303
|
-
var _excluded$4 = ["children", "isSortable", "isAddEnabled", "sortedInfo", "onSort", "isHidable", "isDeletable", "isFixedColumn", "isColumnFreezeEnabled", "isMoveToLeftEnabled", "isMoveToRightEnabled", "onColumnHide", "onColumnUpdate", "onAddColumn", "onColumnDelete", "onColumnFreeze", "onMoreActionClick", "column", "moreActions"];
|
|
218
|
+
var _excluded$5 = ["children", "isSortable", "isAddEnabled", "sortedInfo", "onSort", "isHidable", "isDeletable", "isFixedColumn", "isColumnFreezeEnabled", "isMoveToLeftEnabled", "isMoveToRightEnabled", "onColumnHide", "onColumnUpdate", "onAddColumn", "onColumnDelete", "onColumnFreeze", "onMoreActionClick", "column", "moreActions"];
|
|
304
219
|
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; }
|
|
305
220
|
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; }
|
|
306
221
|
var CellContent = function CellContent(_ref) {
|
|
@@ -326,7 +241,7 @@ var CellContent = function CellContent(_ref) {
|
|
|
326
241
|
column = _ref.column,
|
|
327
242
|
_ref$moreActions = _ref.moreActions,
|
|
328
243
|
moreActions = _ref$moreActions === void 0 ? [] : _ref$moreActions,
|
|
329
|
-
headerProps = _objectWithoutProperties(_ref, _excluded$
|
|
244
|
+
headerProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
330
245
|
var isColumnHidable = isHidable && neetoCist.isPresent(onColumnHide);
|
|
331
246
|
var isColumnDeletable = isDeletable && neetoCist.isPresent(onColumnDelete);
|
|
332
247
|
var hasMoreActions = !ramda.isEmpty(moreActions) && neetoCist.isPresent(onMoreActionClick);
|
|
@@ -366,7 +281,7 @@ var CellContent = function CellContent(_ref) {
|
|
|
366
281
|
};
|
|
367
282
|
var CellContent$1 = /*#__PURE__*/React.memo(CellContent);
|
|
368
283
|
|
|
369
|
-
var _excluded$
|
|
284
|
+
var _excluded$4 = ["onResize", "width", "onResizeStop", "className"];
|
|
370
285
|
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; }
|
|
371
286
|
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; }
|
|
372
287
|
var HeaderCell = function HeaderCell(props) {
|
|
@@ -374,7 +289,7 @@ var HeaderCell = function HeaderCell(props) {
|
|
|
374
289
|
width = props.width,
|
|
375
290
|
onResizeStop = props.onResizeStop,
|
|
376
291
|
className = props.className,
|
|
377
|
-
restProps = _objectWithoutProperties(props, _excluded$
|
|
292
|
+
restProps = _objectWithoutProperties(props, _excluded$4);
|
|
378
293
|
if (!width) {
|
|
379
294
|
return /*#__PURE__*/jsxRuntime.jsx(CellContent$1, _objectSpread$5(_objectSpread$5({}, restProps), {}, {
|
|
380
295
|
className: classnames(className, "drag-handler")
|
|
@@ -404,7 +319,7 @@ var HeaderCell = function HeaderCell(props) {
|
|
|
404
319
|
};
|
|
405
320
|
var HeaderCell$1 = /*#__PURE__*/React.memo(HeaderCell);
|
|
406
321
|
|
|
407
|
-
var _excluded$
|
|
322
|
+
var _excluded$3 = ["onResize", "width", "onResizeStop", "onResizeStart"];
|
|
408
323
|
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; }
|
|
409
324
|
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; }
|
|
410
325
|
var ResizableHeaderCell = function ResizableHeaderCell(props) {
|
|
@@ -412,7 +327,7 @@ var ResizableHeaderCell = function ResizableHeaderCell(props) {
|
|
|
412
327
|
width = props.width,
|
|
413
328
|
_onResizeStop = props.onResizeStop,
|
|
414
329
|
_onResizeStart = props.onResizeStart,
|
|
415
|
-
restProps = _objectWithoutProperties(props, _excluded$
|
|
330
|
+
restProps = _objectWithoutProperties(props, _excluded$3);
|
|
416
331
|
var _useState = React.useState(false),
|
|
417
332
|
_useState2 = _slicedToArray(_useState, 2),
|
|
418
333
|
isResizing = _useState2[0],
|
|
@@ -451,12 +366,12 @@ var ResizableHeaderCell = function ResizableHeaderCell(props) {
|
|
|
451
366
|
};
|
|
452
367
|
var ResizableHeaderCell$1 = /*#__PURE__*/React.memo(ResizableHeaderCell);
|
|
453
368
|
|
|
454
|
-
var _excluded$
|
|
369
|
+
var _excluded$2 = ["className"];
|
|
455
370
|
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; }
|
|
456
371
|
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; }
|
|
457
372
|
var ReorderableHeaderCell = function ReorderableHeaderCell(_ref) {
|
|
458
373
|
var className = _ref.className,
|
|
459
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
374
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
460
375
|
return /*#__PURE__*/jsxRuntime.jsx(CellContent$1, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
461
376
|
className: classnames(className, "drag-handler")
|
|
462
377
|
}));
|
|
@@ -542,6 +457,100 @@ var calculateRowsPerPage = function calculateRowsPerPage() {
|
|
|
542
457
|
var rowsPerPage = Math.floor((viewportHeight - DatePicker.TABLE_PAGINATION_HEIGHT) / DatePicker.TABLE_ROW_HEIGHT * 3);
|
|
543
458
|
return Math.ceil(rowsPerPage / 10) * 10;
|
|
544
459
|
};
|
|
460
|
+
var filterVisibleColumns = function filterVisibleColumns(columns) {
|
|
461
|
+
return columns.filter(function (col) {
|
|
462
|
+
return col.hidden !== true && col.isShown !== false;
|
|
463
|
+
});
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
var useReorderColumns = function useReorderColumns(_ref) {
|
|
467
|
+
var isEnabled = _ref.isEnabled,
|
|
468
|
+
columns = _ref.columns,
|
|
469
|
+
setColumns = _ref.setColumns,
|
|
470
|
+
onColumnUpdateWithChanges = _ref.onColumnUpdateWithChanges,
|
|
471
|
+
rowSelection = _ref.rowSelection;
|
|
472
|
+
if (!isEnabled) return {
|
|
473
|
+
dragProps: {},
|
|
474
|
+
columns: columns
|
|
475
|
+
};
|
|
476
|
+
var isColumnFixed = function isColumnFixed(column) {
|
|
477
|
+
return !!column.fixed;
|
|
478
|
+
};
|
|
479
|
+
var dragProps = {
|
|
480
|
+
onDragEnd: function onDragEnd(fromIndex, toIndex) {
|
|
481
|
+
if (rowSelection) {
|
|
482
|
+
fromIndex--;
|
|
483
|
+
toIndex--;
|
|
484
|
+
}
|
|
485
|
+
if (fromIndex < 0 || toIndex < 0 || fromIndex === toIndex) return;
|
|
486
|
+
var visibleColumns = filterVisibleColumns(columns);
|
|
487
|
+
var fromColumn = visibleColumns[fromIndex];
|
|
488
|
+
var toColumn = visibleColumns[toIndex];
|
|
489
|
+
if (!fromColumn || !toColumn) return;else if (isColumnFixed(fromColumn) || isColumnFixed(toColumn)) return;
|
|
490
|
+
var fromColumnActualIndex = columns.indexOf(fromColumn);
|
|
491
|
+
var toColumnActualIndex = columns.indexOf(toColumn);
|
|
492
|
+
if (fromColumnActualIndex < 0 || toColumnActualIndex < 0) return;
|
|
493
|
+
var newColumns = ramda.move(fromColumnActualIndex, toColumnActualIndex, columns);
|
|
494
|
+
setColumns(newColumns);
|
|
495
|
+
onColumnUpdateWithChanges(newColumns);
|
|
496
|
+
},
|
|
497
|
+
nodeSelector: "th:not(.ant-table-cell-fix-left):not(.ant-table-cell-scrollbar)",
|
|
498
|
+
handleSelector: ".drag-handler",
|
|
499
|
+
ignoreSelector: ".react-resizable-handle"
|
|
500
|
+
};
|
|
501
|
+
return {
|
|
502
|
+
dragProps: dragProps,
|
|
503
|
+
columns: columns
|
|
504
|
+
};
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
var SortIcon = function SortIcon(_ref) {
|
|
508
|
+
var sortOrder = _ref.sortOrder;
|
|
509
|
+
if (sortOrder === DatePicker.TABLE_SORT_ORDERS.asc || sortOrder === DatePicker.URL_SORT_ORDERS.ascend) {
|
|
510
|
+
return /*#__PURE__*/jsxRuntime.jsx(UpArrow, {
|
|
511
|
+
size: 14
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
if (sortOrder === DatePicker.TABLE_SORT_ORDERS.desc || sortOrder === DatePicker.URL_SORT_ORDERS.descend) {
|
|
515
|
+
return /*#__PURE__*/jsxRuntime.jsx(DownArrow, {
|
|
516
|
+
size: 14
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
return null;
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
var _excluded$1 = ["title", "description"];
|
|
523
|
+
var TitleWithInfoIcon = function TitleWithInfoIcon(_ref) {
|
|
524
|
+
var title = _ref.title,
|
|
525
|
+
description = _ref.description,
|
|
526
|
+
rest = _objectWithoutProperties(_ref, _excluded$1);
|
|
527
|
+
var popoverRef = React.useRef();
|
|
528
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
529
|
+
className: "neeto-ui-pr-5 relative",
|
|
530
|
+
children: [typeof title === "function" ? title(rest) : title, description && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
531
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
532
|
+
className: "neeto-ui-table__column-title-info-icon",
|
|
533
|
+
ref: popoverRef,
|
|
534
|
+
children: /*#__PURE__*/jsxRuntime.jsx(InfoRound, {
|
|
535
|
+
color: "currentColor",
|
|
536
|
+
size: 14
|
|
537
|
+
})
|
|
538
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Popover, {
|
|
539
|
+
appendTo: function appendTo() {
|
|
540
|
+
return document.body;
|
|
541
|
+
},
|
|
542
|
+
position: "bottom",
|
|
543
|
+
reference: popoverRef,
|
|
544
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
545
|
+
lineHeight: "normal",
|
|
546
|
+
style: "body2",
|
|
547
|
+
children: description
|
|
548
|
+
})
|
|
549
|
+
})]
|
|
550
|
+
})]
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
var TitleWithInfoIcon$1 = /*#__PURE__*/React.memo(TitleWithInfoIcon);
|
|
545
554
|
|
|
546
555
|
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; }
|
|
547
556
|
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; }
|