@bigbinary/neeto-molecules 1.15.17 → 1.15.18

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/Codeblock.js CHANGED
@@ -10,6 +10,8 @@ import 'classnames';
10
10
  import '@bigbinary/neeto-commons-frontend/utils/general';
11
11
  import '@bigbinary/neeto-icons';
12
12
  import '@bigbinary/neetoui';
13
+ import 'ramda';
14
+ import 'react-i18next';
13
15
  import './inject-css-c86de496.js';
14
16
 
15
17
  var Codeblock = function Codeblock(_ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"Codeblock.js","sources":["../src/components/Codeblock.jsx"],"sourcesContent":["import React from \"react\";\n\nimport PropTypes from \"prop-types\";\nimport { PrismLight as CodeBlock } from \"react-syntax-highlighter\";\nimport { dracula } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n\nimport CopyCode from \"components/CopyToClipboardButton\";\n\nconst Codeblock = ({\n code,\n showCopyButton = true,\n codeblockProps,\n copyButtonProps = { label: \"Copy\" },\n}) => {\n const isLargerScreen = window.innerWidth > 768;\n\n return (\n <div className=\"relative\">\n <CodeBlock\n wrapLines\n className=\"p-4 pr-12 md:pr-4\"\n codeTagProps={{ \"data-cy\": \"code-block-content\" }}\n data-cy=\"code-block\"\n data-testid=\"codeblock-react-highlighter\"\n language=\"javascript\"\n style={dracula}\n {...codeblockProps}\n >\n {code}\n </CodeBlock>\n {showCopyButton && (\n <CopyCode\n className=\"absolute top-2 right-2\"\n data-cy=\"copy-button\"\n data-testid=\"codeblock-copy-button\"\n size=\"small\"\n style=\"secondary\"\n value={code}\n {...copyButtonProps}\n label={isLargerScreen ? copyButtonProps.label : \"\"}\n />\n )}\n </div>\n );\n};\n\nCodeblock.propTypes = {\n /**\n * The code to be displayed.\n */\n code: PropTypes.string,\n /**\n * Flag to determine whether the 'Copy' button is displayed.\n */\n showCopyButton: PropTypes.bool,\n /**\n * Additional props that can be passed on to the 'PrismLight' component from 'react-syntax-highlighter'.\n */\n codeblockProps: PropTypes.object,\n /**\n * Additional props that can be passed on to the 'CopyToClipboardButton' component from 'neeto-molecules'.\n */\n copyButtonProps: PropTypes.object,\n};\n\nexport default Codeblock;\n"],"names":["Codeblock","_ref","code","_ref$showCopyButton","showCopyButton","codeblockProps","_ref$copyButtonProps","copyButtonProps","label","isLargerScreen","window","innerWidth","React","createElement","className","CodeBlock","_extends","wrapLines","codeTagProps","language","style","dracula","CopyCode","size","value"],"mappings":";;;;;;;;;;;;;;AAQA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAC,mBAAA,GAAAF,IAAA,CACJG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;IACrBE,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IAAAC,oBAAA,GAAAL,IAAA,CACdM,eAAe;IAAfA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA;AAAEE,MAAAA,KAAK,EAAE,MAAA;AAAO,KAAC,GAAAF,oBAAA,CAAA;AAEnC,EAAA,IAAMG,cAAc,GAAGC,MAAM,CAACC,UAAU,GAAG,GAAG,CAAA;EAE9C,oBACEC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,UAAA;AAAU,GAAA,eACvBF,cAAA,CAAAC,aAAA,CAACE,UAAS,EAAAC,QAAA,CAAA;IACRC,SAAS,EAAA,IAAA;AACTH,IAAAA,SAAS,EAAC,mBAAmB;AAC7BI,IAAAA,YAAY,EAAE;AAAE,MAAA,SAAS,EAAE,oBAAA;KAAuB;AAClD,IAAA,SAAA,EAAQ,YAAY;AACpB,IAAA,aAAA,EAAY,6BAA6B;AACzCC,IAAAA,QAAQ,EAAC,YAAY;AACrBC,IAAAA,KAAK,EAAEC,OAAAA;AAAQ,GAAA,EACXhB,cAAc,CAAA,EAEjBH,IACQ,CAAC,EACXE,cAAc,iBACbQ,cAAA,CAAAC,aAAA,CAACS,qBAAQ,EAAAN,QAAA,CAAA;AACPF,IAAAA,SAAS,EAAC,wBAAwB;AAClC,IAAA,SAAA,EAAQ,aAAa;AACrB,IAAA,aAAA,EAAY,uBAAuB;AACnCS,IAAAA,IAAI,EAAC,OAAO;AACZH,IAAAA,KAAK,EAAC,WAAW;AACjBI,IAAAA,KAAK,EAAEtB,IAAAA;AAAK,GAAA,EACRK,eAAe,EAAA;AACnBC,IAAAA,KAAK,EAAEC,cAAc,GAAGF,eAAe,CAACC,KAAK,GAAG,EAAA;AAAG,GAAA,CACpD,CAEA,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"Codeblock.js","sources":["../src/components/Codeblock.jsx"],"sourcesContent":["import React from \"react\";\n\nimport PropTypes from \"prop-types\";\nimport { PrismLight as CodeBlock } from \"react-syntax-highlighter\";\nimport { dracula } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n\nimport CopyCode from \"components/CopyToClipboardButton\";\n\nconst Codeblock = ({\n code,\n showCopyButton = true,\n codeblockProps,\n copyButtonProps = { label: \"Copy\" },\n}) => {\n const isLargerScreen = window.innerWidth > 768;\n\n return (\n <div className=\"relative\">\n <CodeBlock\n wrapLines\n className=\"p-4 pr-12 md:pr-4\"\n codeTagProps={{ \"data-cy\": \"code-block-content\" }}\n data-cy=\"code-block\"\n data-testid=\"codeblock-react-highlighter\"\n language=\"javascript\"\n style={dracula}\n {...codeblockProps}\n >\n {code}\n </CodeBlock>\n {showCopyButton && (\n <CopyCode\n className=\"absolute top-2 right-2\"\n data-cy=\"copy-button\"\n data-testid=\"codeblock-copy-button\"\n size=\"small\"\n style=\"secondary\"\n value={code}\n {...copyButtonProps}\n label={isLargerScreen ? copyButtonProps.label : \"\"}\n />\n )}\n </div>\n );\n};\n\nCodeblock.propTypes = {\n /**\n * The code to be displayed.\n */\n code: PropTypes.string,\n /**\n * Flag to determine whether the 'Copy' button is displayed.\n */\n showCopyButton: PropTypes.bool,\n /**\n * Additional props that can be passed on to the 'PrismLight' component from 'react-syntax-highlighter'.\n */\n codeblockProps: PropTypes.object,\n /**\n * Additional props that can be passed on to the 'CopyToClipboardButton' component from 'neeto-molecules'.\n */\n copyButtonProps: PropTypes.object,\n};\n\nexport default Codeblock;\n"],"names":["Codeblock","_ref","code","_ref$showCopyButton","showCopyButton","codeblockProps","_ref$copyButtonProps","copyButtonProps","label","isLargerScreen","window","innerWidth","React","createElement","className","CodeBlock","_extends","wrapLines","codeTagProps","language","style","dracula","CopyCode","size","value"],"mappings":";;;;;;;;;;;;;;;;AAQA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAC,mBAAA,GAAAF,IAAA,CACJG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;IACrBE,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IAAAC,oBAAA,GAAAL,IAAA,CACdM,eAAe;IAAfA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA;AAAEE,MAAAA,KAAK,EAAE,MAAA;AAAO,KAAC,GAAAF,oBAAA,CAAA;AAEnC,EAAA,IAAMG,cAAc,GAAGC,MAAM,CAACC,UAAU,GAAG,GAAG,CAAA;EAE9C,oBACEC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,UAAA;AAAU,GAAA,eACvBF,cAAA,CAAAC,aAAA,CAACE,UAAS,EAAAC,QAAA,CAAA;IACRC,SAAS,EAAA,IAAA;AACTH,IAAAA,SAAS,EAAC,mBAAmB;AAC7BI,IAAAA,YAAY,EAAE;AAAE,MAAA,SAAS,EAAE,oBAAA;KAAuB;AAClD,IAAA,SAAA,EAAQ,YAAY;AACpB,IAAA,aAAA,EAAY,6BAA6B;AACzCC,IAAAA,QAAQ,EAAC,YAAY;AACrBC,IAAAA,KAAK,EAAEC,OAAAA;AAAQ,GAAA,EACXhB,cAAc,CAAA,EAEjBH,IACQ,CAAC,EACXE,cAAc,iBACbQ,cAAA,CAAAC,aAAA,CAACS,qBAAQ,EAAAN,QAAA,CAAA;AACPF,IAAAA,SAAS,EAAC,wBAAwB;AAClC,IAAA,SAAA,EAAQ,aAAa;AACrB,IAAA,aAAA,EAAY,uBAAuB;AACnCS,IAAAA,IAAI,EAAC,OAAO;AACZH,IAAAA,KAAK,EAAC,WAAW;AACjBI,IAAAA,KAAK,EAAEtB,IAAAA;AAAK,GAAA,EACRK,eAAe,EAAA;AACnBC,IAAAA,KAAK,EAAEC,cAAc,GAAGF,eAAe,CAACC,KAAK,GAAG,EAAA;AAAG,GAAA,CACpD,CAEA,CAAC,CAAA;AAEV;;;;"}
@@ -7,12 +7,13 @@ import classnames from 'classnames';
7
7
  import { copyToClipboard } from '@bigbinary/neeto-commons-frontend/utils/general';
8
8
  import { Check, Copy } from '@bigbinary/neeto-icons';
9
9
  import { Button } from '@bigbinary/neetoui';
10
+ import { mergeRight } from 'ramda';
11
+ import { useTranslation } from 'react-i18next';
10
12
  import { n } from './inject-css-c86de496.js';
11
13
 
12
14
  var TIME_OUT = 2000;
13
15
  var TOOLTIP_CONFIG = {
14
- content: "Copied",
15
- trigger: "click",
16
+ trigger: "click mouseenter",
16
17
  hideAfter: TIME_OUT,
17
18
  position: "top"
18
19
  };
@@ -30,6 +31,8 @@ var CopyToClipboardButton = function CopyToClipboardButton(_ref) {
30
31
  value = _ref.value,
31
32
  style = _ref.style,
32
33
  otherProps = _objectWithoutProperties(_ref, _excluded);
34
+ var _useTranslation = useTranslation(),
35
+ t = _useTranslation.t;
33
36
  var _useState = useState(false),
34
37
  _useState2 = _slicedToArray(_useState, 2),
35
38
  isChecked = _useState2[0],
@@ -51,7 +54,9 @@ var CopyToClipboardButton = function CopyToClipboardButton(_ref) {
51
54
  var buttonWidth = ref.current.clientWidth;
52
55
  ref.current.style.minWidth = "".concat(buttonWidth, "px");
53
56
  }, []);
54
- var tooltipProps = label ? null : TOOLTIP_CONFIG;
57
+ var tooltipProps = label ? null : mergeRight(TOOLTIP_CONFIG, {
58
+ content: isChecked ? t("neetoMolecules.common.copied") : t("neetoMolecules.common.copyToClipboard")
59
+ });
55
60
  var buttonLabel = isChecked && label ? "Copied" : label;
56
61
  var buttonIcon = isChecked ? Check : icon;
57
62
  return /*#__PURE__*/React__default.createElement(Button, _extends({
@@ -1 +1 @@
1
- {"version":3,"file":"CopyToClipboardButton.js","sources":["../src/components/CopyToClipboardButton/constants.js","../src/components/CopyToClipboardButton/index.jsx"],"sourcesContent":["const TIME_OUT = 2000;\n\nconst TOOLTIP_CONFIG = {\n content: \"Copied\",\n trigger: \"click\",\n hideAfter: TIME_OUT,\n position: \"top\",\n};\n\nconst BUTTON_STYLES = {\n primary: \"primary\",\n secondary: \"secondary\",\n text: \"text\",\n};\n\nexport { TOOLTIP_CONFIG, TIME_OUT, BUTTON_STYLES };\n","import React, { useState, useEffect, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { copyToClipboard } from \"neetocommons/utils/general\";\nimport { Copy, Check } from \"neetoicons\";\nimport { Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport { TOOLTIP_CONFIG, TIME_OUT, BUTTON_STYLES } from \"./constants\";\nimport \"./copyToClipboard.scss\";\n\nconst CopyToClipboardButton = ({\n className,\n icon = Copy,\n label = \"\",\n value,\n style,\n ...otherProps\n}) => {\n const [isChecked, setIsChecked] = useState(false);\n const ref = useRef();\n\n const onHandleClick = event => {\n event.preventDefault();\n copyToClipboard(value, { showToastr: false });\n setIsChecked(true);\n setTimeout(() => {\n setIsChecked(false);\n }, TIME_OUT); // Reset copied state after 2 seconds\n };\n\n useEffect(() => {\n if (!ref.current) return;\n const buttonWidth = ref.current.clientWidth;\n ref.current.style.minWidth = `${buttonWidth}px`;\n }, []);\n\n const tooltipProps = label ? null : TOOLTIP_CONFIG;\n const buttonLabel = isChecked && label ? \"Copied\" : label;\n const buttonIcon = isChecked ? Check : icon;\n\n return (\n <Button\n {...{ ref, style, tooltipProps }}\n data-testid=\"copy-button\"\n icon={buttonIcon}\n label={buttonLabel}\n className={classnames(\"neeto-molecules-copy-button\", {\n [className]: className,\n \"neeto-molecules-copy-button--active\": isChecked,\n })}\n onClick={onHandleClick}\n {...otherProps}\n />\n );\n};\n\nCopyToClipboardButton.propTypes = {\n /**\n * To provide additional classnames to the button.\n */\n className: PropTypes.string,\n /**\n * To provide the icon to be passed to the button. Defaults to the Copy icon.\n */\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /**\n * To provide the label to the button. By default there is no label.\n */\n label: PropTypes.string,\n /**\n * The value to be copied to clipboard. (required)\n */\n value: PropTypes.string,\n /**\n * To specify the style of the Button.\n */\n style: PropTypes.oneOf(Object.values(BUTTON_STYLES)),\n};\n\nexport default CopyToClipboardButton;\n"],"names":["TIME_OUT","TOOLTIP_CONFIG","content","trigger","hideAfter","position","CopyToClipboardButton","_ref","className","_ref$icon","icon","Copy","_ref$label","label","value","style","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","isChecked","setIsChecked","ref","useRef","onHandleClick","event","preventDefault","copyToClipboard","showToastr","setTimeout","useEffect","current","buttonWidth","clientWidth","minWidth","concat","tooltipProps","buttonLabel","buttonIcon","Check","React","createElement","Button","_extends","classnames","_defineProperty","onClick"],"mappings":";;;;;;;;;;;AAAA,IAAMA,QAAQ,GAAG,IAAI,CAAA;AAErB,IAAMC,cAAc,GAAG;AACrBC,EAAAA,OAAO,EAAE,QAAQ;AACjBC,EAAAA,OAAO,EAAE,OAAO;AAChBC,EAAAA,SAAS,EAAEJ,QAAQ;AACnBK,EAAAA,QAAQ,EAAE,KAAA;AACZ,CAAC;;;;;;ACID,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAAC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AA;IAC3CX,GAAG,CAACS,OAAO,CAACnB,KAAK,CAACsB,QAAQ,GAAAC,EAAAA,CAAAA,MAAA,CAAMH,WAAW,EAAI,IAAA,CAAA,CAAA;GAChD,EAAE,EAAE,CAAC,CAAA;AAEN,EAAA,IAAMI,YAAY,GAAG1B,KAAK,GAAG,IAAI,GAAGZ,cAAc,CAAA;EAClD,IAAMuC,WAAW,GAAGjB,SAAS,IAAIV,KAAK,GAAG,QAAQ,GAAGA,KAAK,CAAA;AACzD,EAAA,IAAM4B,UAAU,GAAGlB,SAAS,GAAGmB,KAAK,GAAGhC,IAAI,CAAA;AAE3C,EAAA,oBACEiC,cAAA,CAAAC,aAAA,CAACC,MAAM,EAAAC,QAAA,CAAA;AACCrB,IAAAA,GAAG,EAAHA,GAAG;AAAEV,IAAAA,KAAK,EAALA,KAAK;AAAEwB,IAAAA,YAAY,EAAZA,YAAY;AAC9B,IAAA,aAAA,EAAY,aAAa;AACzB7B,IAAAA,IAAI,EAAE+B,UAAW;AACjB5B,IAAAA,KAAK,EAAE2B,WAAY;AACnBhC,IAAAA,SAAS,EAAEuC,UAAU,CAAC,6BAA6B,EAAAC,eAAA,CAAAA,eAAA,CAChDxC,EAAAA,EAAAA,SAAS,EAAGA,SAAS,CAAA,EACtB,qCAAqC,EAAEe,SAAS,CACjD,CAAE;AACH0B,IAAAA,OAAO,EAAEtB,aAAAA;GACLX,EAAAA,UAAU,CACf,CAAC,CAAA;AAEN;;;;"}
1
+ {"version":3,"file":"CopyToClipboardButton.js","sources":["../src/components/CopyToClipboardButton/constants.js","../src/components/CopyToClipboardButton/index.jsx"],"sourcesContent":["const TIME_OUT = 2000;\n\nconst TOOLTIP_CONFIG = {\n trigger: \"click mouseenter\",\n hideAfter: TIME_OUT,\n position: \"top\",\n};\n\nconst BUTTON_STYLES = {\n primary: \"primary\",\n secondary: \"secondary\",\n text: \"text\",\n};\n\nexport { TOOLTIP_CONFIG, TIME_OUT, BUTTON_STYLES };\n","import React, { useState, useEffect, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { copyToClipboard } from \"neetocommons/utils/general\";\nimport { Copy, Check } from \"neetoicons\";\nimport { Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeRight } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { TOOLTIP_CONFIG, TIME_OUT, BUTTON_STYLES } from \"./constants\";\nimport \"./copyToClipboard.scss\";\n\nconst CopyToClipboardButton = ({\n className,\n icon = Copy,\n label = \"\",\n value,\n style,\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n const [isChecked, setIsChecked] = useState(false);\n\n const ref = useRef();\n\n const onHandleClick = event => {\n event.preventDefault();\n copyToClipboard(value, { showToastr: false });\n setIsChecked(true);\n setTimeout(() => {\n setIsChecked(false);\n }, TIME_OUT); // Reset copied state after 2 seconds\n };\n\n useEffect(() => {\n if (!ref.current) return;\n const buttonWidth = ref.current.clientWidth;\n ref.current.style.minWidth = `${buttonWidth}px`;\n }, []);\n\n const tooltipProps = label\n ? null\n : mergeRight(TOOLTIP_CONFIG, {\n content: isChecked\n ? t(\"neetoMolecules.common.copied\")\n : t(\"neetoMolecules.common.copyToClipboard\"),\n });\n const buttonLabel = isChecked && label ? \"Copied\" : label;\n const buttonIcon = isChecked ? Check : icon;\n\n return (\n <Button\n {...{ ref, style, tooltipProps }}\n data-testid=\"copy-button\"\n icon={buttonIcon}\n label={buttonLabel}\n className={classnames(\"neeto-molecules-copy-button\", {\n [className]: className,\n \"neeto-molecules-copy-button--active\": isChecked,\n })}\n onClick={onHandleClick}\n {...otherProps}\n />\n );\n};\n\nCopyToClipboardButton.propTypes = {\n /**\n * To provide additional classnames to the button.\n */\n className: PropTypes.string,\n /**\n * To provide the icon to be passed to the button. Defaults to the Copy icon.\n */\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /**\n * To provide the label to the button. By default there is no label.\n */\n label: PropTypes.string,\n /**\n * The value to be copied to clipboard. (required)\n */\n value: PropTypes.string,\n /**\n * To specify the style of the Button.\n */\n style: PropTypes.oneOf(Object.values(BUTTON_STYLES)),\n};\n\nexport default CopyToClipboardButton;\n"],"names":["TIME_OUT","TOOLTIP_CONFIG","trigger","hideAfter","position","CopyToClipboardButton","_ref","className","_ref$icon","icon","Copy","_ref$label","label","value","style","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","isChecked","setIsChecked","ref","useRef","onHandleClick","event","preventDefault","copyToClipboard","showToastr","setTimeout","useEffect","current","buttonWidth","clientWidth","minWidth","concat","tooltipProps","mergeRight","content","buttonLabel","buttonIcon","Check","React","createElement","Button","_extends","classnames","_defineProperty","onClick"],"mappings":";;;;;;;;;;;;;AAAA,IAAMA,QAAQ,GAAG,IAAI,CAAA;AAErB,IAAMC,cAAc,GAAG;AACrBC,EAAAA,OAAO,EAAE,kBAAkB;AAC3BC,EAAAA,SAAS,EAAEH,QAAQ;AACnBI,EAAAA,QAAQ,EAAE,KAAA;AACZ,CAAC;;;;;;ACOD,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAAC,IAAA,EAOrB;AAAA,EAAA,IANJC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAAC,SAAA,GAAAF,IAAA,CACTG,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAGE,KAAAA,CAAAA,GAAAA,IAAI,GAAAF,SAAA;IAAAG,UAAA,GAAAL,IAAA,CACXM,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,UAAA;IACVE,KAAK,GAAAP,IAAA,CAALO,KAAK;IACLC,KAAK,GAAAR,IAAA,CAALQ,KAAK;AACFC,IAAAA,UAAU,GAAAC,wBAAA,CAAAV,IAAA,EAAAW,SAAA,CAAA,CAAA;AAEb,EAAA,IAAAC,eAAA,GAAcC,cAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC,CAAA;A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iC,UAAU,GAAGpB,SAAS,GAAGqB,KAAK,GAAGrC,IAAI,CAAA;AAE3C,EAAA,oBACEsC,cAAA,CAAAC,aAAA,CAACC,MAAM,EAAAC,QAAA,CAAA;AACCvB,IAAAA,GAAG,EAAHA,GAAG;AAAEb,IAAAA,KAAK,EAALA,KAAK;AAAE2B,IAAAA,YAAY,EAAZA,YAAY;AAC9B,IAAA,aAAA,EAAY,aAAa;AACzBhC,IAAAA,IAAI,EAAEoC,UAAW;AACjBjC,IAAAA,KAAK,EAAEgC,WAAY;AACnBrC,IAAAA,SAAS,EAAE4C,UAAU,CAAC,6BAA6B,EAAAC,eAAA,CAAAA,eAAA,CAChD7C,EAAAA,EAAAA,SAAS,EAAGA,SAAS,CAAA,EACtB,qCAAqC,EAAEkB,SAAS,CACjD,CAAE;AACH4B,IAAAA,OAAO,EAAExB,aAAAA;GACLd,EAAAA,UAAU,CACf,CAAC,CAAA;AAEN;;;;"}
@@ -6,7 +6,7 @@ import { hyphenize } from '@bigbinary/neeto-commons-frontend/utils/general';
6
6
  import { CustomDomain as CustomDomain$1 } from '@bigbinary/neeto-icons';
7
7
  import { Spinner, Tag, Button } from '@bigbinary/neetoui';
8
8
  import { useTranslation } from 'react-i18next';
9
- import { u as useFetchCustomDomains, a as useDeleteCustomDomain, M as Manage, D as DeleteAlert } from './index-2fe27725.js';
9
+ import { u as useFetchCustomDomains, a as useDeleteCustomDomain, M as Manage, D as DeleteAlert } from './index-203143d9.js';
10
10
  import MoreDropdown from './MoreDropdown.js';
11
11
  import 'formik';
12
12
  import '@bigbinary/neeto-hotkeys';
@@ -18,11 +18,11 @@ import './extends-093996c9.js';
18
18
  import './defineProperty-549061a7.js';
19
19
  import './objectWithoutProperties-a0edb288.js';
20
20
  import 'classnames';
21
+ import 'ramda';
21
22
  import './inject-css-c86de496.js';
22
23
  import '@bigbinary/neeto-commons-frontend/react-utils/useMutationWithInvalidation';
23
24
  import 'react-query';
24
25
  import 'axios';
25
- import 'ramda';
26
26
 
27
27
  var CustomDomain = function CustomDomain(_ref) {
28
28
  var url = _ref.url,
@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next';
7
7
  import Container from './Container.js';
8
8
  import PageLoader from './PageLoader.js';
9
9
  import SubHeader from './SubHeader.js';
10
- import { u as useFetchCustomDomains, a as useDeleteCustomDomain, r as renderColumnData, M as Manage, D as DeleteAlert } from './index-2fe27725.js';
10
+ import { u as useFetchCustomDomains, a as useDeleteCustomDomain, r as renderColumnData, M as Manage, D as DeleteAlert } from './index-203143d9.js';
11
11
  import { _ as _extends } from './extends-093996c9.js';
12
12
  import { PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
13
13
  import withT from '@bigbinary/neeto-commons-frontend/react-utils/withT';
package/dist/Rename.js CHANGED
@@ -97,7 +97,7 @@ var Editor = function Editor(_ref) {
97
97
  })));
98
98
  };
99
99
 
100
- var css = ":root{--neeto-molecules-rename-font-size:var(--neeto-ui-text-sm);--neeto-molecules-rename-font-weight:400;--neeto-molecules-rename-letter-spacing:0;--neeto-molecules-rename-line-height:1.2;--neeto-molecules-rename-min-width:120px}.neeto-molecules-rename-common-styles,.neeto-molecules-rename__input .neeto-ui-input input,.neeto-molecules-rename__input-width-maker,.neeto-molecules-rename__text{font-size:var(--neeto-ui-text-sm)!important;font-size:var(--neeto-molecules-rename-font-size)!important;font-weight:400;font-weight:var(--neeto-molecules-rename-font-weight);letter-spacing:0;letter-spacing:var(--neeto-molecules-rename-letter-spacing);line-height:1.2;line-height:var(--neeto-molecules-rename-line-height);margin:0}.neeto-molecules-rename__input{height:100%;margin:0;max-width:100%;min-width:0;position:relative;transition:width .2s ease-in-out;width:100%}.neeto-molecules-rename__input .neeto-ui-input{height:100%}.neeto-molecules-rename__input .neeto-ui-input .neeto-ui-input__suffix{margin-right:0!important}.neeto-molecules-rename__input .neeto-ui-input input{min-width:0}.neeto-molecules-rename__text{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);cursor:pointer;max-width:448px;padding:8px;transition:var(--neeto-ui-transition)}.neeto-molecules-rename__display-text{color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-rename__display-text:hover{border:thin solid rgb(var(--neeto-ui-gray-300))}.neeto-molecules-rename__input-width-maker{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);cursor:pointer;display:inline-flex;margin-right:68px;max-width:100%;min-width:120px;overflow:hidden;padding:8px;position:relative;transition:var(--neeto-ui-transition);visibility:hidden;white-space:nowrap}";
100
+ var css = ":root{--neeto-molecules-rename-font-size:var(--neeto-ui-text-sm);--neeto-molecules-rename-font-weight:400;--neeto-molecules-rename-letter-spacing:0;--neeto-molecules-rename-line-height:1.2;--neeto-molecules-rename-min-width:120px}.neeto-molecules-rename-common-styles,.neeto-molecules-rename__input .neeto-ui-input input,.neeto-molecules-rename__input-width-maker,.neeto-molecules-rename__text{font-size:var(--neeto-ui-text-sm)!important;font-size:var(--neeto-molecules-rename-font-size)!important;font-weight:400;font-weight:var(--neeto-molecules-rename-font-weight);letter-spacing:0;letter-spacing:var(--neeto-molecules-rename-letter-spacing);line-height:1.2;line-height:var(--neeto-molecules-rename-line-height);margin:0}.neeto-molecules-rename__input{height:100%;margin:0;max-width:100%;min-width:0;position:relative;transition:width .2s ease-in-out;width:100%}.neeto-molecules-rename__input .neeto-ui-input{height:100%}.neeto-molecules-rename__input .neeto-ui-input .neeto-ui-input__suffix{margin-right:0!important}.neeto-molecules-rename__input .neeto-ui-input input{min-width:0}.neeto-molecules-rename__text{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);cursor:pointer;max-width:448px;padding:8px;transition:var(--neeto-ui-transition)}.neeto-molecules-rename__display-text{color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-rename__display-text:hover{border:thin solid rgb(var(--neeto-ui-gray-300))}.neeto-molecules-rename__input-width-maker{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);cursor:pointer;display:inline-flex;margin-right:68px;max-width:100%;min-width:120px;overflow:hidden;padding:8px;position:relative;transition:var(--neeto-ui-transition);visibility:hidden;white-space:nowrap}.neeto-molecules-rename-breadcrumbs{margin-bottom:0}.neeto-molecules-rename-breadcrumbs .neeto-molecules-breadcrumb a{display:flex}";
101
101
  n(css,{});
102
102
 
103
103
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -295,7 +295,8 @@ var Rename = function Rename(_ref) {
295
295
  className: classnames("neeto-molecules-rename flex min-w-0 max-w-md flex-col items-start md:flex-row md:items-center", className)
296
296
  }, isNotEmpty(breadcrumbs) && /*#__PURE__*/React__default.createElement(Breadcrumbs, {
297
297
  breadcrumbs: breadcrumbs,
298
- hasTrailingSeparator: true
298
+ hasTrailingSeparator: true,
299
+ className: "neeto-molecules-rename-breadcrumbs"
299
300
  }), /*#__PURE__*/React__default.createElement("div", {
300
301
  className: "relative flex max-w-full items-center gap-x-2"
301
302
  }, editMode ? /*#__PURE__*/React__default.createElement(Editor, editNameProps) : /*#__PURE__*/React__default.createElement(ViewName, viewNameProps)));
@@ -1 +1 @@
1
- {"version":3,"file":"Rename.js","sources":["../src/components/Rename/utils.js","../src/components/Rename/EditName.jsx","../src/components/Rename/RenameMenu.jsx","../src/components/Rename/ViewName.jsx","../src/components/Rename/index.jsx"],"sourcesContent":["export const mergeRefs =\n (...refs) =>\n node =>\n refs.forEach(ref =>\n typeof ref === \"function\" ? ref(node) : (ref.current = node)\n );\n","import React from \"react\";\n\nimport { withEventTargetValue } from \"neetocommons/utils/general\";\nimport useHotkeys from \"neetohotkeys\";\nimport { Check, Close } from \"neetoicons\";\nimport { Button, Input } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\n\nimport { mergeRefs } from \"./utils\";\n\nconst Editor = ({\n placeholder,\n allowEmptySubmission,\n name,\n isLoading,\n handleRename,\n submitButtonProps,\n handleClose,\n cancelButtonProps,\n setName,\n inputProps,\n editMode,\n}) => {\n const closeRef = useHotkeys(\"escape\", handleClose, {\n mode: \"scoped\",\n enabled: editMode,\n });\n\n const submitRef = useHotkeys(\n [\"command+return\", \"return\"],\n event => {\n if (isEmpty(name) && !allowEmptySubmission) return;\n handleRename(event, name);\n },\n { mode: \"scoped\", enabled: editMode }\n );\n\n return (\n <div className=\"relative flex min-w-0 max-w-full flex-grow\">\n <span className=\"neeto-molecules-rename__input-width-maker\">\n {name.replace(/\\s/g, \".\") || placeholder}\n </span>\n <Input\n {...{ placeholder }}\n autoFocus\n className=\"neeto-molecules-rename__input absolute\"\n data-cy=\"form-rename-text-field\"\n data-testid=\"neeto-molecules-name-input\"\n ref={mergeRefs(closeRef, submitRef)}\n value={name}\n suffix={\n <div className=\"flex items-center justify-end\">\n <Button\n className=\"neeto-ui-rounded-none\"\n data-cy=\"form-rename-submit-button\"\n data-testid=\"neeto-molecules-rename-button\"\n disabled={(!allowEmptySubmission && isEmpty(name)) || isLoading}\n icon={Check}\n loading={isLoading}\n style=\"text\"\n onClick={event => handleRename(event, name)}\n {...submitButtonProps}\n />\n <Button\n className=\"neeto-ui-rounded-none\"\n data-cy=\"form-rename-close-button\"\n data-testid=\"neeto-molecules-cancel-button\"\n disabled={isLoading}\n icon={Close}\n style=\"text\"\n onClick={handleClose}\n {...cancelButtonProps}\n />\n </div>\n }\n onChange={withEventTargetValue(setName)}\n onClick={event => event.stopPropagation()}\n {...inputProps}\n label={null}\n />\n </div>\n );\n};\n\nexport default Editor;\n","import React from \"react\";\n\nimport { isPresent } from \"neetocist\";\nimport { withT } from \"neetocommons/react-utils\";\n\nimport MoreDropdown from \"components/MoreDropdown\";\n\nconst RenameMenu = withT(\n ({\n t,\n handleRenameClick,\n disabled,\n dropdownItems,\n onArchiveStatusToggle,\n onClone,\n onDelete,\n isArchived,\n dropdownButtonProps,\n dropdownProps,\n }) => (\n <MoreDropdown\n dropdownButtonProps={{\n \"data-testid\": \"neeto-molecules-menu-button\",\n ...dropdownButtonProps,\n }}\n dropdownProps={{\n position: \"bottom-start\",\n onClick: event => event.stopPropagation(),\n strategy: \"fixed\",\n appendTo: () => document.body,\n ...dropdownProps,\n }}\n menuItems={[\n {\n \"data-cy\": \"form-rename-button\",\n onClick: handleRenameClick,\n label: t(\"neetoMolecules.common.actions.rename\"),\n isVisible: !disabled,\n key: \"edit-name-menu\",\n },\n {\n \"data-cy\": \"form-clone-button\",\n onClick: onClone,\n label: t(\"neetoMolecules.common.actions.clone\"),\n isVisible: isPresent(onClone),\n key: \"clone-entity-menu\",\n },\n {\n \"data-cy\": \"form-archive-button\",\n onClick: onArchiveStatusToggle,\n label: isArchived\n ? t(\"neetoMolecules.common.actions.unArchive\")\n : t(\"neetoMolecules.common.actions.archive\"),\n isVisible: isPresent(onArchiveStatusToggle),\n key: \"archive-entity-menu\",\n },\n {\n \"data-cy\": \"form-delete-button\",\n onClick: onDelete,\n label: t(\"neetoMolecules.common.actions.delete\"),\n isVisible: isPresent(onDelete),\n key: \"delete-entity-menu\",\n },\n ...dropdownItems,\n ]}\n />\n )\n);\n\nexport default RenameMenu;\n","import React from \"react\";\n\nimport classNames from \"classnames\";\nimport { isNotEmpty, isPresent } from \"neetocist\";\nimport { Typography } from \"neetoui\";\n\nimport RenameMenu from \"./RenameMenu\";\n\nconst ViewName = ({\n disabled,\n textProps,\n formatText,\n dropdownItems,\n hideMenu,\n handleRenameClick,\n onArchiveStatusToggle,\n onClone,\n onDelete,\n name,\n isArchived,\n dropdownButtonProps,\n dropdownProps,\n}) => {\n const isDefaultMenuCallbacksPresent =\n isPresent(onArchiveStatusToggle) ||\n isPresent(onDelete) ||\n isPresent(onClone);\n\n const isMenuVisible =\n !hideMenu &&\n (isNotEmpty(dropdownItems) || !disabled || isDefaultMenuCallbacksPresent);\n\n return (\n <>\n <Typography\n component=\"p\"\n data-cy=\"form-title\"\n data-testid=\"neeto-molecules-value-display\"\n style=\"body2\"\n className={classNames(\n \"neeto-molecules-rename__text neeto-molecules-rename__display-text w-full truncate\",\n {\n \"cursor-pointer\": !disabled,\n \"pointer-events-none cursor-text\": disabled,\n }\n )}\n onClick={handleRenameClick}\n {...textProps}\n >\n {typeof formatText === \"function\" ? formatText(name) : name}\n </Typography>\n {isMenuVisible && (\n <RenameMenu\n {...{\n disabled,\n dropdownButtonProps,\n dropdownItems,\n dropdownProps,\n handleRenameClick,\n isArchived,\n onArchiveStatusToggle,\n onClone,\n onDelete,\n }}\n />\n )}\n </>\n );\n};\n\nexport default ViewName;\n","import React, { useState, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { isNotEmpty } from \"neetocist\";\nimport useOnClickOutside from \"neetocommons/react-utils/useOnClickOutside\";\nimport useStateWithDependency from \"neetocommons/react-utils/useStateWithDependency\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport Breadcrumbs from \"components/Breadcrumbs\";\n\nimport EditName from \"./EditName\";\nimport \"./rename.scss\";\nimport ViewName from \"./ViewName\";\n\nconst Rename = ({\n value,\n onRename,\n onClone,\n onArchiveStatusToggle,\n onDelete,\n isArchived,\n isOpen = false,\n isLoading = false,\n placeholder = \"\",\n hideMenu = false,\n disabled = false,\n dropdownItems = [],\n breadcrumbs = [],\n textProps = {},\n inputProps = {},\n submitButtonProps = {},\n cancelButtonProps = {},\n className = \"\",\n allowEmptySubmission = false,\n defaultName = \"\",\n formatText,\n dropdownButtonProps = {},\n dropdownProps = {},\n}) => {\n const [name, setName] = useStateWithDependency(value ?? \"\");\n const [editMode, setEditMode] = useState(isOpen);\n const renameRef = useRef(null);\n\n useOnClickOutside(renameRef, () => editMode && handleClose());\n\n const handleRename = (event, name) => {\n event.stopPropagation();\n const newName = allowEmptySubmission && isEmpty(name) ? defaultName : name;\n setName(newName);\n onRename?.(newName);\n setEditMode(false);\n };\n\n const handleClose = event => {\n event?.stopPropagation();\n setName(value);\n setEditMode(false);\n };\n\n const handleRenameClick = event => {\n event.stopPropagation();\n !disabled && setEditMode(true);\n };\n\n const editNameProps = {\n allowEmptySubmission,\n cancelButtonProps,\n handleClose,\n handleRename,\n inputProps,\n isLoading,\n name,\n placeholder,\n setName,\n submitButtonProps,\n editMode,\n };\n\n const viewNameProps = {\n disabled,\n dropdownItems,\n formatText,\n handleRenameClick,\n hideMenu,\n name,\n isArchived,\n onArchiveStatusToggle,\n onClone,\n onDelete,\n textProps,\n dropdownButtonProps,\n dropdownProps,\n };\n\n return (\n <div\n ref={renameRef}\n className={classnames(\n \"neeto-molecules-rename flex min-w-0 max-w-md flex-col items-start md:flex-row md:items-center\",\n className\n )}\n >\n {isNotEmpty(breadcrumbs) && (\n <Breadcrumbs {...{ breadcrumbs }} hasTrailingSeparator />\n )}\n <div className=\"relative flex max-w-full items-center gap-x-2\">\n {editMode ? (\n <EditName {...editNameProps} />\n ) : (\n <ViewName {...viewNameProps} />\n )}\n </div>\n </div>\n );\n};\n\nRename.propTypes = {\n /**\n * To provide additional classes to the component.\n */\n className: PropTypes.string,\n /**\n * To allow empty submission.\n */\n allowEmptySubmission: PropTypes.bool,\n /**\n * Default value to be used on empty submission.\n */\n defaultName: PropTypes.string,\n /**\n * To specify the text to be displayed in the component.\n */\n value: PropTypes.string,\n /**\n * To specify the function to be triggered when renamed.\n */\n onRename: PropTypes.func,\n /**\n * To specify the function to be triggered when Clone menu is clicked. The menu will be hidden if this prop is not set.\n */\n onClone: PropTypes.func,\n /**\n * To specify the function to be triggered when Archive menu is clicked. The menu will be hidden if this prop is not set.\n */\n onArchiveStatusToggle: PropTypes.func,\n /**\n * To specify whether the entity is archived or not. The text in the menu will be changed based on this to Archive or Unarchive.\n */\n isArchived: PropTypes.bool,\n /**\n * To specify the function to be triggered when Delete menu is clicked. The menu will be hidden if this prop is not set.\n */\n onDelete: PropTypes.func,\n /**\n * To specify whether edit mode is enabled or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify whether the edit buttons are in loading state or not.\n */\n isLoading: PropTypes.bool,\n /**\n * To specify the placeholder for the input component in edit mode.\n */\n placeholder: PropTypes.string,\n /**\n * To specify whether the dropdown menu should be hidden or not.\n */\n hideMenu: PropTypes.bool,\n /**\n * To specify whether the rename option in dropdown should be enabled. If it is the only option in dropdown, the menu will be hidden.\n */\n disabled: PropTypes.bool,\n /**\n * To specify additional items for the dropdown menu.\n */\n dropdownItems: PropTypes.array,\n /**\n * To specify the breadcrumbs if used in the title of `Header` component.\n */\n breadcrumbs: PropTypes.arrayOf(\n PropTypes.shape({\n text: PropTypes.string,\n link: PropTypes.string,\n })\n ),\n /**\n * To override the properties of the Typography component that displays the `value`.\n */\n textProps: PropTypes.object,\n /**\n * To override the properties of the Input component in edit mode.\n */\n inputProps: PropTypes.object,\n /**\n * To format the value to display when not in edit mode.\n */\n formatText: PropTypes.func,\n /**\n * To override the properties of the submit button.\n */\n submitButtonProps: PropTypes.object,\n /**\n * To override the properties of the cancel button.\n */\n cancelButtonProps: PropTypes.object,\n};\n\nexport default Rename;\n"],"names":["mergeRefs","_len","arguments","length","refs","Array","_key","node","forEach","ref","current","Editor","_ref","placeholder","allowEmptySubmission","name","isLoading","handleRename","submitButtonProps","handleClose","cancelButtonProps","setName","inputProps","editMode","closeRef","useHotkeys","mode","enabled","submitRef","event","isEmpty","React","createElement","className","replace","Input","_extends","autoFocus","value","suffix","Button","disabled","icon","Check","loading","style","onClick","Close","onChange","withEventTargetValue","stopPropagation","label","RenameMenu","withT","t","handleRenameClick","dropdownItems","onArchiveStatusToggle","onClone","onDelete","isArchived","dropdownButtonProps","dropdownProps","MoreDropdown","_objectSpread","position","strategy","appendTo","document","body","menuItems","isVisible","key","isPresent","concat","_toConsumableArray","ViewName","textProps","formatText","hideMenu","isDefaultMenuCallbacksPresent","isMenuVisible","isNotEmpty","Fragment","Typography","component","classNames","Rename","onRename","_ref$isOpen","isOpen","_ref$isLoading","_ref$placeholder","_ref$hideMenu","_ref$disabled","_ref$dropdownItems","_ref$breadcrumbs","breadcrumbs","_ref$textProps","_ref$inputProps","_ref$submitButtonProp","_ref$cancelButtonProp","_ref$className","_ref$allowEmptySubmis","_ref$defaultName","defaultName","_ref$dropdownButtonPr","_ref$dropdownProps","_useStateWithDependen","useStateWithDependency","_useStateWithDependen2","_slicedToArray","_useState","useState","_useState2","setEditMode","renameRef","useRef","useOnClickOutside","newName","editNameProps","viewNameProps","classnames","Breadcrumbs","hasTrailingSeparator","EditName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,SAAS,GACpB,SADWA,SAASA,GAAA;AAAA,EAAA,KAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAChBC,IAAI,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,EAAA,EAAA;AAAJF,IAAAA,IAAI,CAAAE,IAAA,CAAAJ,GAAAA,SAAA,CAAAI,IAAA,CAAA,CAAA;AAAA,GAAA;AAAA,EAAA,OACR,UAAAC,IAAI,EAAA;AAAA,IAAA,OACFH,IAAI,CAACI,OAAO,CAAC,UAAAC,GAAG,EAAA;AAAA,MAAA,OACd,OAAOA,GAAG,KAAK,UAAU,GAAGA,GAAG,CAACF,IAAI,CAAC,GAAIE,GAAG,CAACC,OAAO,GAAGH,IAAK,CAAA;AAAA,KAC9D,CAAC,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA;;ACKL,IAAMI,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAYN;AAAA,EAAA,IAXJC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IACXC,oBAAoB,GAAAF,IAAA,CAApBE,oBAAoB;IACpBC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IACJC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,YAA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VA,UAAU;AACVvB,IAAAA,iBAAiB,EAAjBA,iBAAiB;AACjBwB,IAAAA,QAAQ,EAARA,QAAQ;AACRhE,IAAAA,IAAI,EAAJA,IAAI;AACJ6C,IAAAA,UAAU,EAAVA,UAAU;AACVH,IAAAA,qBAAqB,EAArBA,qBAAqB;AACrBC,IAAAA,OAAO,EAAPA,OAAO;AACPC,IAAAA,QAAQ,EAARA,QAAQ;AACRkB,IAAAA,SAAS,EAATA,SAAS;AACThB,IAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,IAAAA,aAAa,EAAbA,aAAAA;GACD,CAAA;EAED,oBACE/B,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEvB,IAAAA,GAAG,EAAE2G,SAAU;AACfnF,IAAAA,SAAS,EAAEyF,UAAU,CACnB,+FAA+F,EAC/FzF,SACF,CAAA;GAECiD,EAAAA,UAAU,CAACe,WAAW,CAAC,iBACtBlE,cAAA,CAAAC,aAAA,CAAC2F,WAAW,EAAA;AAAO1B,IAAAA,WAAW,EAAXA,WAAW;IAAI2B,oBAAoB,EAAA,IAAA;AAAA,GAAE,CACzD,eACD7F,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,+CAAA;GACZV,EAAAA,QAAQ,gBACPQ,cAAA,CAAAC,aAAA,CAAC6F,MAAQ,EAAKL,aAAgB,CAAC,gBAE/BzF,cAAA,CAAAC,aAAA,CAAC4C,QAAQ,EAAK6C,aAAgB,CAE7B,CACF,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"Rename.js","sources":["../src/components/Rename/utils.js","../src/components/Rename/EditName.jsx","../src/components/Rename/RenameMenu.jsx","../src/components/Rename/ViewName.jsx","../src/components/Rename/index.jsx"],"sourcesContent":["export const mergeRefs =\n (...refs) =>\n node =>\n refs.forEach(ref =>\n typeof ref === \"function\" ? ref(node) : (ref.current = node)\n );\n","import React from \"react\";\n\nimport { withEventTargetValue } from \"neetocommons/utils/general\";\nimport useHotkeys from \"neetohotkeys\";\nimport { Check, Close } from \"neetoicons\";\nimport { Button, Input } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\n\nimport { mergeRefs } from \"./utils\";\n\nconst Editor = ({\n placeholder,\n allowEmptySubmission,\n name,\n isLoading,\n handleRename,\n submitButtonProps,\n handleClose,\n cancelButtonProps,\n setName,\n inputProps,\n editMode,\n}) => {\n const closeRef = useHotkeys(\"escape\", handleClose, {\n mode: \"scoped\",\n enabled: editMode,\n });\n\n const submitRef = useHotkeys(\n [\"command+return\", \"return\"],\n event => {\n if (isEmpty(name) && !allowEmptySubmission) return;\n handleRename(event, name);\n },\n { mode: \"scoped\", enabled: editMode }\n );\n\n return (\n <div className=\"relative flex min-w-0 max-w-full flex-grow\">\n <span className=\"neeto-molecules-rename__input-width-maker\">\n {name.replace(/\\s/g, \".\") || placeholder}\n </span>\n <Input\n {...{ placeholder }}\n autoFocus\n className=\"neeto-molecules-rename__input absolute\"\n data-cy=\"form-rename-text-field\"\n data-testid=\"neeto-molecules-name-input\"\n ref={mergeRefs(closeRef, submitRef)}\n value={name}\n suffix={\n <div className=\"flex items-center justify-end\">\n <Button\n className=\"neeto-ui-rounded-none\"\n data-cy=\"form-rename-submit-button\"\n data-testid=\"neeto-molecules-rename-button\"\n disabled={(!allowEmptySubmission && isEmpty(name)) || isLoading}\n icon={Check}\n loading={isLoading}\n style=\"text\"\n onClick={event => handleRename(event, name)}\n {...submitButtonProps}\n />\n <Button\n className=\"neeto-ui-rounded-none\"\n data-cy=\"form-rename-close-button\"\n data-testid=\"neeto-molecules-cancel-button\"\n disabled={isLoading}\n icon={Close}\n style=\"text\"\n onClick={handleClose}\n {...cancelButtonProps}\n />\n </div>\n }\n onChange={withEventTargetValue(setName)}\n onClick={event => event.stopPropagation()}\n {...inputProps}\n label={null}\n />\n </div>\n );\n};\n\nexport default Editor;\n","import React from \"react\";\n\nimport { isPresent } from \"neetocist\";\nimport { withT } from \"neetocommons/react-utils\";\n\nimport MoreDropdown from \"components/MoreDropdown\";\n\nconst RenameMenu = withT(\n ({\n t,\n handleRenameClick,\n disabled,\n dropdownItems,\n onArchiveStatusToggle,\n onClone,\n onDelete,\n isArchived,\n dropdownButtonProps,\n dropdownProps,\n }) => (\n <MoreDropdown\n dropdownButtonProps={{\n \"data-testid\": \"neeto-molecules-menu-button\",\n ...dropdownButtonProps,\n }}\n dropdownProps={{\n position: \"bottom-start\",\n onClick: event => event.stopPropagation(),\n strategy: \"fixed\",\n appendTo: () => document.body,\n ...dropdownProps,\n }}\n menuItems={[\n {\n \"data-cy\": \"form-rename-button\",\n onClick: handleRenameClick,\n label: t(\"neetoMolecules.common.actions.rename\"),\n isVisible: !disabled,\n key: \"edit-name-menu\",\n },\n {\n \"data-cy\": \"form-clone-button\",\n onClick: onClone,\n label: t(\"neetoMolecules.common.actions.clone\"),\n isVisible: isPresent(onClone),\n key: \"clone-entity-menu\",\n },\n {\n \"data-cy\": \"form-archive-button\",\n onClick: onArchiveStatusToggle,\n label: isArchived\n ? t(\"neetoMolecules.common.actions.unArchive\")\n : t(\"neetoMolecules.common.actions.archive\"),\n isVisible: isPresent(onArchiveStatusToggle),\n key: \"archive-entity-menu\",\n },\n {\n \"data-cy\": \"form-delete-button\",\n onClick: onDelete,\n label: t(\"neetoMolecules.common.actions.delete\"),\n isVisible: isPresent(onDelete),\n key: \"delete-entity-menu\",\n },\n ...dropdownItems,\n ]}\n />\n )\n);\n\nexport default RenameMenu;\n","import React from \"react\";\n\nimport classNames from \"classnames\";\nimport { isNotEmpty, isPresent } from \"neetocist\";\nimport { Typography } from \"neetoui\";\n\nimport RenameMenu from \"./RenameMenu\";\n\nconst ViewName = ({\n disabled,\n textProps,\n formatText,\n dropdownItems,\n hideMenu,\n handleRenameClick,\n onArchiveStatusToggle,\n onClone,\n onDelete,\n name,\n isArchived,\n dropdownButtonProps,\n dropdownProps,\n}) => {\n const isDefaultMenuCallbacksPresent =\n isPresent(onArchiveStatusToggle) ||\n isPresent(onDelete) ||\n isPresent(onClone);\n\n const isMenuVisible =\n !hideMenu &&\n (isNotEmpty(dropdownItems) || !disabled || isDefaultMenuCallbacksPresent);\n\n return (\n <>\n <Typography\n component=\"p\"\n data-cy=\"form-title\"\n data-testid=\"neeto-molecules-value-display\"\n style=\"body2\"\n className={classNames(\n \"neeto-molecules-rename__text neeto-molecules-rename__display-text w-full truncate\",\n {\n \"cursor-pointer\": !disabled,\n \"pointer-events-none cursor-text\": disabled,\n }\n )}\n onClick={handleRenameClick}\n {...textProps}\n >\n {typeof formatText === \"function\" ? formatText(name) : name}\n </Typography>\n {isMenuVisible && (\n <RenameMenu\n {...{\n disabled,\n dropdownButtonProps,\n dropdownItems,\n dropdownProps,\n handleRenameClick,\n isArchived,\n onArchiveStatusToggle,\n onClone,\n onDelete,\n }}\n />\n )}\n </>\n );\n};\n\nexport default ViewName;\n","import React, { useState, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { isNotEmpty } from \"neetocist\";\nimport useOnClickOutside from \"neetocommons/react-utils/useOnClickOutside\";\nimport useStateWithDependency from \"neetocommons/react-utils/useStateWithDependency\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport Breadcrumbs from \"components/Breadcrumbs\";\n\nimport EditName from \"./EditName\";\nimport \"./rename.scss\";\nimport ViewName from \"./ViewName\";\n\nconst Rename = ({\n value,\n onRename,\n onClone,\n onArchiveStatusToggle,\n onDelete,\n isArchived,\n isOpen = false,\n isLoading = false,\n placeholder = \"\",\n hideMenu = false,\n disabled = false,\n dropdownItems = [],\n breadcrumbs = [],\n textProps = {},\n inputProps = {},\n submitButtonProps = {},\n cancelButtonProps = {},\n className = \"\",\n allowEmptySubmission = false,\n defaultName = \"\",\n formatText,\n dropdownButtonProps = {},\n dropdownProps = {},\n}) => {\n const [name, setName] = useStateWithDependency(value ?? \"\");\n const [editMode, setEditMode] = useState(isOpen);\n const renameRef = useRef(null);\n\n useOnClickOutside(renameRef, () => editMode && handleClose());\n\n const handleRename = (event, name) => {\n event.stopPropagation();\n const newName = allowEmptySubmission && isEmpty(name) ? defaultName : name;\n setName(newName);\n onRename?.(newName);\n setEditMode(false);\n };\n\n const handleClose = event => {\n event?.stopPropagation();\n setName(value);\n setEditMode(false);\n };\n\n const handleRenameClick = event => {\n event.stopPropagation();\n !disabled && setEditMode(true);\n };\n\n const editNameProps = {\n allowEmptySubmission,\n cancelButtonProps,\n handleClose,\n handleRename,\n inputProps,\n isLoading,\n name,\n placeholder,\n setName,\n submitButtonProps,\n editMode,\n };\n\n const viewNameProps = {\n disabled,\n dropdownItems,\n formatText,\n handleRenameClick,\n hideMenu,\n name,\n isArchived,\n onArchiveStatusToggle,\n onClone,\n onDelete,\n textProps,\n dropdownButtonProps,\n dropdownProps,\n };\n\n return (\n <div\n ref={renameRef}\n className={classnames(\n \"neeto-molecules-rename flex min-w-0 max-w-md flex-col items-start md:flex-row md:items-center\",\n className\n )}\n >\n {isNotEmpty(breadcrumbs) && (\n <Breadcrumbs\n {...{ breadcrumbs }}\n hasTrailingSeparator\n className=\"neeto-molecules-rename-breadcrumbs\"\n />\n )}\n <div className=\"relative flex max-w-full items-center gap-x-2\">\n {editMode ? (\n <EditName {...editNameProps} />\n ) : (\n <ViewName {...viewNameProps} />\n )}\n </div>\n </div>\n );\n};\n\nRename.propTypes = {\n /**\n * To provide additional classes to the component.\n */\n className: PropTypes.string,\n /**\n * To allow empty submission.\n */\n allowEmptySubmission: PropTypes.bool,\n /**\n * Default value to be used on empty submission.\n */\n defaultName: PropTypes.string,\n /**\n * To specify the text to be displayed in the component.\n */\n value: PropTypes.string,\n /**\n * To specify the function to be triggered when renamed.\n */\n onRename: PropTypes.func,\n /**\n * To specify the function to be triggered when Clone menu is clicked. The menu will be hidden if this prop is not set.\n */\n onClone: PropTypes.func,\n /**\n * To specify the function to be triggered when Archive menu is clicked. The menu will be hidden if this prop is not set.\n */\n onArchiveStatusToggle: PropTypes.func,\n /**\n * To specify whether the entity is archived or not. The text in the menu will be changed based on this to Archive or Unarchive.\n */\n isArchived: PropTypes.bool,\n /**\n * To specify the function to be triggered when Delete menu is clicked. The menu will be hidden if this prop is not set.\n */\n onDelete: PropTypes.func,\n /**\n * To specify whether edit mode is enabled or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify whether the edit buttons are in loading state or not.\n */\n isLoading: PropTypes.bool,\n /**\n * To specify the placeholder for the input component in edit mode.\n */\n placeholder: PropTypes.string,\n /**\n * To specify whether the dropdown menu should be hidden or not.\n */\n hideMenu: PropTypes.bool,\n /**\n * To specify whether the rename option in dropdown should be enabled. If it is the only option in dropdown, the menu will be hidden.\n */\n disabled: PropTypes.bool,\n /**\n * To specify additional items for the dropdown menu.\n */\n dropdownItems: PropTypes.array,\n /**\n * To specify the breadcrumbs if used in the title of `Header` component.\n */\n breadcrumbs: PropTypes.arrayOf(\n PropTypes.shape({\n text: PropTypes.string,\n link: PropTypes.string,\n })\n ),\n /**\n * To override the properties of the Typography component that displays the `value`.\n */\n textProps: PropTypes.object,\n /**\n * To override the properties of the Input component in edit mode.\n */\n inputProps: PropTypes.object,\n /**\n * To format the value to display when not in edit mode.\n */\n formatText: PropTypes.func,\n /**\n * To override the properties of the submit button.\n */\n submitButtonProps: PropTypes.object,\n /**\n * To override the properties of the cancel button.\n */\n cancelButtonProps: PropTypes.object,\n};\n\nexport default Rename;\n"],"names":["mergeRefs","_len","arguments","length","refs","Array","_key","node","forEach","ref","current","Editor","_ref","placeholder","allowEmptySubmission","name","isLoading","handleRename","submitButtonProps","handleClose","cancelButtonProps","setName","inputProps","editMode","closeRef","useHotkeys","mode","enabled","submitRef","event","isEmpty","React","createElement","className","replace","Input","_extends","autoFocus","value","suffix","Button","disabled","icon","Check","loading","style","onClick","Close","onChange","withEventTargetValue","stopPropagation","label","RenameMenu","withT","t","handleRenameClick","dropdownItems","onArchiveStatusToggle","onClone","onDelete","isArchived","dropdownButtonProps","dropdownProps","MoreDropdown","_objectSpread","position","strategy","appendTo","document","body","menuItems","isVisible","key","isPresent","concat","_toConsumableArray","ViewName","textProps","formatText","hideMenu","isDefaultMenuCallbacksPresent","isMenuVisible","isNotEmpty","Fragment","Typography","component","classNames","Rename","onRename","_ref$isOpen","isOpen","_ref$isLoading","_ref$placeholder","_ref$hideMenu","_ref$disabled","_ref$dropdownItems","_ref$breadcrumbs","breadcrumbs","_ref$textProps","_ref$inputProps","_ref$submitButtonProp","_ref$cancelButtonProp","_ref$className","_ref$allowEmptySubmis","_ref$defaultName","defaultName","_ref$dropdownButtonPr","_ref$dropdownProps","_useStateWithDependen","useStateWithDependency","_useStateWithDependen2","_slicedToArray","_useState","useState","_useState2","setEditMode","renameRef","useRef","useOnClickOutside","newName","editNameProps","viewNameProps","classnames","Breadcrumbs","hasTrailingSeparator","EditName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,SAAS,GACpB,SADWA,SAASA,GAAA;AAAA,EAAA,KAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAChBC,IAAI,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,EAAA,EAAA;AAAJF,IAAAA,IAAI,CAAAE,IAAA,CAAAJ,GAAAA,SAAA,CAAAI,IAAA,CAAA,CAAA;AAAA,GAAA;AAAA,EAAA,OACR,UAAAC,IAAI,EAAA;AAAA,IAAA,OACFH,IAAI,CAACI,OAAO,CAAC,UAAAC,GAAG,EAAA;AAAA,MAAA,OACd,OAAOA,GAAG,KAAK,UAAU,GAAGA,GAAG,CAACF,IAAI,CAAC,GAAIE,GAAG,CAACC,OAAO,GAAGH,IAAK,CAAA;AAAA,KAC9D,CAAC,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA;;ACKL,IAAMI,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAYN;AAAA,EAAA,IAXJC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IACXC,oBAAoB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AAA,IAAMkG,aAAa,GAAG;AACpBhF,IAAAA,QAAQ,EAARA,QAAQ;AACRe,IAAAA,aAAa,EAAbA,aAAa;AACbsB,IAAAA,UAAU,EAAVA,UAAU;AACVvB,IAAAA,iBAAiB,EAAjBA,iBAAiB;AACjBwB,IAAAA,QAAQ,EAARA,QAAQ;AACRhE,IAAAA,IAAI,EAAJA,IAAI;AACJ6C,IAAAA,UAAU,EAAVA,UAAU;AACVH,IAAAA,qBAAqB,EAArBA,qBAAqB;AACrBC,IAAAA,OAAO,EAAPA,OAAO;AACPC,IAAAA,QAAQ,EAARA,QAAQ;AACRkB,IAAAA,SAAS,EAATA,SAAS;AACThB,IAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,IAAAA,aAAa,EAAbA,aAAAA;GACD,CAAA;EAED,oBACE/B,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEvB,IAAAA,GAAG,EAAE2G,SAAU;AACfnF,IAAAA,SAAS,EAAEyF,UAAU,CACnB,+FAA+F,EAC/FzF,SACF,CAAA;GAECiD,EAAAA,UAAU,CAACe,WAAW,CAAC,iBACtBlE,cAAA,CAAAC,aAAA,CAAC2F,WAAW,EAAA;AACJ1B,IAAAA,WAAW,EAAXA,WAAW;IACjB2B,oBAAoB,EAAA,IAAA;AACpB3F,IAAAA,SAAS,EAAC,oCAAA;AAAoC,GAC/C,CACF,eACDF,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,+CAAA;GACZV,EAAAA,QAAQ,gBACPQ,cAAA,CAAAC,aAAA,CAAC6F,MAAQ,EAAKL,aAAgB,CAAC,gBAE/BzF,cAAA,CAAAC,aAAA,CAAC4C,QAAQ,EAAK6C,aAAgB,CAE7B,CACF,CAAC,CAAA;AAEV;;;;"}
@@ -12,6 +12,7 @@ import './objectWithoutProperties-a0edb288.js';
12
12
  import 'classnames';
13
13
  import '@bigbinary/neeto-commons-frontend/utils/general';
14
14
  import '@bigbinary/neetoui';
15
+ import 'react-i18next';
15
16
 
16
17
  var INPUT_FIELD_MIN_WIDTH = 60;
17
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"SuffixedInput.js","sources":["../src/components/SuffixedInput/constants.js","../src/components/SuffixedInput/index.jsx"],"sourcesContent":["export const INPUT_FIELD_MIN_WIDTH = 60;\n","import React, { useEffect, useRef, useState } from \"react\";\n\nimport { isPresent, isNotPresent } from \"neetocist\";\nimport { Info } from \"neetoicons\";\nimport { Input } from \"neetoui/formik\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport CopyToClipboardButton from \"components/CopyToClipboardButton\";\n\nimport { INPUT_FIELD_MIN_WIDTH } from \"./constants\";\nimport \"./suffixed-input.scss\";\n\nconst SuffixedInput = ({\n placeholder,\n helpUrl,\n helpIconTooltipContent,\n label,\n value,\n getInputRef,\n suffix,\n isCopyToClipboardEnabled = false,\n name = \"email\",\n inputProps = {},\n}) => {\n const [initialInputWidth, setInitialInputWidth] = useState(\n INPUT_FIELD_MIN_WIDTH\n );\n const inputRef = useRef(null);\n const placeholderRef = useRef(null);\n\n const setInputRef = ref => {\n inputRef.current = ref;\n getInputRef?.(ref);\n };\n\n useEffect(() => {\n //To handle the input width on initial render.\n const placeholderSpanWidth = placeholderRef.current?.offsetWidth;\n setInitialInputWidth(placeholderSpanWidth);\n }, []);\n\n return (\n <>\n <span // Dummy element to calculate the width to be set for the input. Do not remove.\n className=\"pointer-events-none invisible absolute pl-2\"\n ref={placeholderRef}\n >\n {value || placeholder}\n </span>\n <div className=\"inline-flex max-w-full items-end gap-2\">\n <Input\n {...{ label, name, placeholder, ...inputProps }}\n className=\"nm-suffixed-input-field\"\n ref={setInputRef}\n type=\"text\"\n labelProps={{\n helpIconProps: isPresent(helpUrl) && {\n icon: Info,\n className:\n \"cursor-pointer opacity-75 hover:opacity-100 transition-opacity duration-300 ease-in-out\",\n onClick: () => window.open(helpUrl, \"_blank\"),\n tooltipProps: {\n content: helpIconTooltipContent,\n position: \"right\",\n disabled: isNotPresent(helpUrl),\n },\n },\n }}\n style={{\n minWidth: isEmpty(value) ? INPUT_FIELD_MIN_WIDTH : 0,\n width: placeholderRef.current?.offsetWidth ?? initialInputWidth, // Additional 2px to act as a buffer.\n }}\n suffix={\n // Added onClick to focus the input even when the suffix part is clicked.\n <span onClick={() => inputRef.current?.focus()}>{suffix}</span>\n }\n />\n {isCopyToClipboardEnabled && (\n <CopyToClipboardButton\n disabled={isEmpty(value)}\n style=\"text\"\n value={`${value}${suffix}`}\n />\n )}\n </div>\n </>\n );\n};\n\nSuffixedInput.propTypes = {\n /**\n * Placeholder of the input field.\n */\n placeholder: PropTypes.string,\n /**\n * A help icon will be displayed next to the label if helpUrl is present. On clicking the icon will take the user to the URL.\n */\n helpUrl: PropTypes.string,\n /**\n * Text to be displayed inside the tooltip of the help icon.\n */\n helpIconTooltipContent: PropTypes.string,\n /**\n * Label of the input field.\n */\n label: PropTypes.string,\n /**\n * The value entered by the user, eg: email.\n */\n value: PropTypes.string,\n /**\n * A method to get the ref of the input field.\n */\n getInputRef: PropTypes.func,\n /**\n * Domain name to be rendered next to the input field.\n */\n suffix: PropTypes.string,\n /**\n * Whether to show the copy to clipboard button.\n */\n isCopyToClipboardEnabled: PropTypes.bool,\n /**\n * Formik field name of the input field.\n */\n name: PropTypes.string,\n /**\n * This will be passed down to the `Input` component.\n */\n inputProps: PropTypes.object,\n};\n\nexport default SuffixedInput;\n"],"names":["INPUT_FIELD_MIN_WIDTH","SuffixedInput","_ref","_placeholderRef$curre2","_placeholderRef$curre3","placeholder","helpUrl","helpIconTooltipContent","label","value","getInputRef","suffix","_ref$isCopyToClipboar","isCopyToClipboardEnabled","_ref$name","name","_ref$inputProps","inputProps","_useState","useState","_useState2","_slicedToArray","initialInputWidth","setInitialInputWidth","inputRef","useRef","placeholderRef","setInputRef","ref","current","useEffect","_placeholderRef$curre","placeholderSpanWidth","offsetWidth","React","createElement","Fragment","className","Input","_extends","_objectSpread","type","labelProps","helpIconProps","isPresent","icon","Info","onClick","window","open","tooltipProps","content","position","disabled","isNotPresent","style","minWidth","isEmpty","width","_inputRef$current","focus","CopyToClipboardButton","concat"],"mappings":";;;;;;;;;;;;;;;AAAO,IAAMA,qBAAqB,GAAG,EAAE;;;;;;;ACavC,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAWb;EAAA,IAAAC,sBAAA,EAAAC,sBAAA,CAAA;AAAA,EAAA,IAVJC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPC,sBAAsB,GAAAL,IAAA,CAAtBK,sBAAsB;IACtBC,KAAK,GAAAN,IAAA,CAALM,KAAK;IACLC,KAAK,GAAAP,IAAA,CAALO,KAAK;IACLC,WAAW,GAAAR,IAAA,CAAXQ,WAAW;IACXC,MAAM,GAAAT,IAAA,CAANS,MAAM;IAAAC,qBAAA,GAAAV,IAAA,CACNW,wBAAwB;AAAxBA,IAAAA,wBAAwB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,qBAAA;IAAAE,SAAA,GAAAZ,IAAA,CAChCa,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,SAAA;IAAAE,eAAA,GAAAd,IAAA,CACde,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAA,KAAA,CAAA,GAAG,EAAE,GAAAA,eAAA,CAAA;AAEf,EAAA,IAAAE,SAAA,GAAkDC,QAAQ,CACxDnB,qBACF,CAAC;IAAAoB,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAFMI,IAAAA,iBAAiB,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,oBAAoB,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAG9C,EAAA,IAAMI,QAAQ,GAAGC,MAAM,CAAC,IAAI,CAAC,CAAA;AAC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AA,QAAQ,EAAEI,OAAO,CAAChD,KAAK,CAAE;AACzB8C,IAAAA,KAAK,EAAC,MAAM;AACZ9C,IAAAA,KAAK,KAAAqD,MAAA,CAAKrD,KAAK,CAAAqD,CAAAA,MAAA,CAAGnD,MAAM,CAAA;GACzB,CAEA,CACL,CAAC,CAAA;AAEP;;;;"}
1
+ {"version":3,"file":"SuffixedInput.js","sources":["../src/components/SuffixedInput/constants.js","../src/components/SuffixedInput/index.jsx"],"sourcesContent":["export const INPUT_FIELD_MIN_WIDTH = 60;\n","import React, { useEffect, useRef, useState } from \"react\";\n\nimport { isPresent, isNotPresent } from \"neetocist\";\nimport { Info } from \"neetoicons\";\nimport { Input } from \"neetoui/formik\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport CopyToClipboardButton from \"components/CopyToClipboardButton\";\n\nimport { INPUT_FIELD_MIN_WIDTH } from \"./constants\";\nimport \"./suffixed-input.scss\";\n\nconst SuffixedInput = ({\n placeholder,\n helpUrl,\n helpIconTooltipContent,\n label,\n value,\n getInputRef,\n suffix,\n isCopyToClipboardEnabled = false,\n name = \"email\",\n inputProps = {},\n}) => {\n const [initialInputWidth, setInitialInputWidth] = useState(\n INPUT_FIELD_MIN_WIDTH\n );\n const inputRef = useRef(null);\n const placeholderRef = useRef(null);\n\n const setInputRef = ref => {\n inputRef.current = ref;\n getInputRef?.(ref);\n };\n\n useEffect(() => {\n //To handle the input width on initial render.\n const placeholderSpanWidth = placeholderRef.current?.offsetWidth;\n setInitialInputWidth(placeholderSpanWidth);\n }, []);\n\n return (\n <>\n <span // Dummy element to calculate the width to be set for the input. Do not remove.\n className=\"pointer-events-none invisible absolute pl-2\"\n ref={placeholderRef}\n >\n {value || placeholder}\n </span>\n <div className=\"inline-flex max-w-full items-end gap-2\">\n <Input\n {...{ label, name, placeholder, ...inputProps }}\n className=\"nm-suffixed-input-field\"\n ref={setInputRef}\n type=\"text\"\n labelProps={{\n helpIconProps: isPresent(helpUrl) && {\n icon: Info,\n className:\n \"cursor-pointer opacity-75 hover:opacity-100 transition-opacity duration-300 ease-in-out\",\n onClick: () => window.open(helpUrl, \"_blank\"),\n tooltipProps: {\n content: helpIconTooltipContent,\n position: \"right\",\n disabled: isNotPresent(helpUrl),\n },\n },\n }}\n style={{\n minWidth: isEmpty(value) ? INPUT_FIELD_MIN_WIDTH : 0,\n width: placeholderRef.current?.offsetWidth ?? initialInputWidth, // Additional 2px to act as a buffer.\n }}\n suffix={\n // Added onClick to focus the input even when the suffix part is clicked.\n <span onClick={() => inputRef.current?.focus()}>{suffix}</span>\n }\n />\n {isCopyToClipboardEnabled && (\n <CopyToClipboardButton\n disabled={isEmpty(value)}\n style=\"text\"\n value={`${value}${suffix}`}\n />\n )}\n </div>\n </>\n );\n};\n\nSuffixedInput.propTypes = {\n /**\n * Placeholder of the input field.\n */\n placeholder: PropTypes.string,\n /**\n * A help icon will be displayed next to the label if helpUrl is present. On clicking the icon will take the user to the URL.\n */\n helpUrl: PropTypes.string,\n /**\n * Text to be displayed inside the tooltip of the help icon.\n */\n helpIconTooltipContent: PropTypes.string,\n /**\n * Label of the input field.\n */\n label: PropTypes.string,\n /**\n * The value entered by the user, eg: email.\n */\n value: PropTypes.string,\n /**\n * A method to get the ref of the input field.\n */\n getInputRef: PropTypes.func,\n /**\n * Domain name to be rendered next to the input field.\n */\n suffix: PropTypes.string,\n /**\n * Whether to show the copy to clipboard button.\n */\n isCopyToClipboardEnabled: PropTypes.bool,\n /**\n * Formik field name of the input field.\n */\n name: PropTypes.string,\n /**\n * This will be passed down to the `Input` component.\n */\n inputProps: PropTypes.object,\n};\n\nexport default SuffixedInput;\n"],"names":["INPUT_FIELD_MIN_WIDTH","SuffixedInput","_ref","_placeholderRef$curre2","_placeholderRef$curre3","placeholder","helpUrl","helpIconTooltipContent","label","value","getInputRef","suffix","_ref$isCopyToClipboar","isCopyToClipboardEnabled","_ref$name","name","_ref$inputProps","inputProps","_useState","useState","_useState2","_slicedToArray","initialInputWidth","setInitialInputWidth","inputRef","useRef","placeholderRef","setInputRef","ref","current","useEffect","_placeholderRef$curre","placeholderSpanWidth","offsetWidth","React","createElement","Fragment","className","Input","_extends","_objectSpread","type","labelProps","helpIconProps","isPresent","icon","Info","onClick","window","open","tooltipProps","content","position","disabled","isNotPresent","style","minWidth","isEmpty","width","_inputRef$current","focus","CopyToClipboardButton","concat"],"mappings":";;;;;;;;;;;;;;;;AAAO,IAAMA,qBAAqB,GAAG,EAAE;;;;;;;ACavC,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAWb;EAAA,IAAAC,sBAAA,EAAAC,sBAAA,CAAA;AAAA,EAAA,IAVJC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPC,sBAAsB,GAAAL,IAAA,CAAtBK,sBAAsB;IACtBC,KAAK,GAAAN,IAAA,CAALM,KAAK;IACLC,KAAK,GAAAP,IAAA,CAALO,KAAK;IACLC,WAAW,GAAAR,IAAA,CAAXQ,WAAW;IACXC,MAAM,GAAAT,IAAA,CAANS,MAAM;IAAAC,qBAAA,GAAAV,IAAA,CACNW,wBAAwB;AAAxBA,IAAAA,wBAAwB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,qBAAA;IAAAE,SAAA,GAAAZ,IAAA,CAChCa,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,SAAA;IAAAE,eAAA,GAAAd,IAAA,CACde,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAA,KAAA,CAAA,GAAG,EAAE,GAAAA,eAAA,CAAA;AAEf,EAAA,IAAAE,SAAA,GAAkDC,QAAQ,CACxDnB,qBACF,CAAC;IAAAoB,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAFMI,IAAAA,iBAAiB,GAAAF,UAAA,CAAA,CAAA,CAAA;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AAAC,KAAA,EAAEjD,MAAa,CAAA;GAEjE,CAAA,CAAC,EACDE,wBAAwB,iBACvBqB,cAAA,CAAAC,aAAA,CAAC0B,qBAAqB,EAAA;AACpBR,IAAAA,QAAQ,EAAEI,OAAO,CAAChD,KAAK,CAAE;AACzB8C,IAAAA,KAAK,EAAC,MAAM;AACZ9C,IAAAA,KAAK,KAAAqD,MAAA,CAAKrD,KAAK,CAAAqD,CAAAA,MAAA,CAAGnD,MAAM,CAAA;GACzB,CAEA,CACL,CAAC,CAAA;AAEP;;;;"}
@@ -12,6 +12,8 @@ require('classnames');
12
12
  require('@bigbinary/neeto-commons-frontend/utils/general');
13
13
  require('@bigbinary/neeto-icons');
14
14
  require('@bigbinary/neetoui');
15
+ require('ramda');
16
+ require('react-i18next');
15
17
  require('./inject-css-80a5faa3.js');
16
18
 
17
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -1 +1 @@
1
- {"version":3,"file":"Codeblock.js","sources":["../../src/components/Codeblock.jsx"],"sourcesContent":["import React from \"react\";\n\nimport PropTypes from \"prop-types\";\nimport { PrismLight as CodeBlock } from \"react-syntax-highlighter\";\nimport { dracula } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n\nimport CopyCode from \"components/CopyToClipboardButton\";\n\nconst Codeblock = ({\n code,\n showCopyButton = true,\n codeblockProps,\n copyButtonProps = { label: \"Copy\" },\n}) => {\n const isLargerScreen = window.innerWidth > 768;\n\n return (\n <div className=\"relative\">\n <CodeBlock\n wrapLines\n className=\"p-4 pr-12 md:pr-4\"\n codeTagProps={{ \"data-cy\": \"code-block-content\" }}\n data-cy=\"code-block\"\n data-testid=\"codeblock-react-highlighter\"\n language=\"javascript\"\n style={dracula}\n {...codeblockProps}\n >\n {code}\n </CodeBlock>\n {showCopyButton && (\n <CopyCode\n className=\"absolute top-2 right-2\"\n data-cy=\"copy-button\"\n data-testid=\"codeblock-copy-button\"\n size=\"small\"\n style=\"secondary\"\n value={code}\n {...copyButtonProps}\n label={isLargerScreen ? copyButtonProps.label : \"\"}\n />\n )}\n </div>\n );\n};\n\nCodeblock.propTypes = {\n /**\n * The code to be displayed.\n */\n code: PropTypes.string,\n /**\n * Flag to determine whether the 'Copy' button is displayed.\n */\n showCopyButton: PropTypes.bool,\n /**\n * Additional props that can be passed on to the 'PrismLight' component from 'react-syntax-highlighter'.\n */\n codeblockProps: PropTypes.object,\n /**\n * Additional props that can be passed on to the 'CopyToClipboardButton' component from 'neeto-molecules'.\n */\n copyButtonProps: PropTypes.object,\n};\n\nexport default Codeblock;\n"],"names":["Codeblock","_ref","code","_ref$showCopyButton","showCopyButton","codeblockProps","_ref$copyButtonProps","copyButtonProps","label","isLargerScreen","window","innerWidth","React","createElement","className","CodeBlock","_extends","wrapLines","codeTagProps","language","style","dracula","CopyCode","size","value"],"mappings":";;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAC,mBAAA,GAAAF,IAAA,CACJG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;IACrBE,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IAAAC,oBAAA,GAAAL,IAAA,CACdM,eAAe;IAAfA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA;AAAEE,MAAAA,KAAK,EAAE,MAAA;AAAO,KAAC,GAAAF,oBAAA,CAAA;AAEnC,EAAA,IAAMG,cAAc,GAAGC,MAAM,CAACC,UAAU,GAAG,GAAG,CAAA;EAE9C,oBACEC,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,UAAA;AAAU,GAAA,eACvBF,yBAAA,CAAAC,aAAA,CAACE,iCAAS,EAAAC,iBAAA,CAAA;IACRC,SAAS,EAAA,IAAA;AACTH,IAAAA,SAAS,EAAC,mBAAmB;AAC7BI,IAAAA,YAAY,EAAE;AAAE,MAAA,SAAS,EAAE,oBAAA;KAAuB;AAClD,IAAA,SAAA,EAAQ,YAAY;AACpB,IAAA,aAAA,EAAY,6BAA6B;AACzCC,IAAAA,QAAQ,EAAC,YAAY;AACrBC,IAAAA,KAAK,EAAEC,aAAAA;AAAQ,GAAA,EACXhB,cAAc,CAAA,EAEjBH,IACQ,CAAC,EACXE,cAAc,iBACbQ,yBAAA,CAAAC,aAAA,CAACS,qBAAQ,EAAAN,iBAAA,CAAA;AACPF,IAAAA,SAAS,EAAC,wBAAwB;AAClC,IAAA,SAAA,EAAQ,aAAa;AACrB,IAAA,aAAA,EAAY,uBAAuB;AACnCS,IAAAA,IAAI,EAAC,OAAO;AACZH,IAAAA,KAAK,EAAC,WAAW;AACjBI,IAAAA,KAAK,EAAEtB,IAAAA;AAAK,GAAA,EACRK,eAAe,EAAA;AACnBC,IAAAA,KAAK,EAAEC,cAAc,GAAGF,eAAe,CAACC,KAAK,GAAG,EAAA;AAAG,GAAA,CACpD,CAEA,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"Codeblock.js","sources":["../../src/components/Codeblock.jsx"],"sourcesContent":["import React from \"react\";\n\nimport PropTypes from \"prop-types\";\nimport { PrismLight as CodeBlock } from \"react-syntax-highlighter\";\nimport { dracula } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n\nimport CopyCode from \"components/CopyToClipboardButton\";\n\nconst Codeblock = ({\n code,\n showCopyButton = true,\n codeblockProps,\n copyButtonProps = { label: \"Copy\" },\n}) => {\n const isLargerScreen = window.innerWidth > 768;\n\n return (\n <div className=\"relative\">\n <CodeBlock\n wrapLines\n className=\"p-4 pr-12 md:pr-4\"\n codeTagProps={{ \"data-cy\": \"code-block-content\" }}\n data-cy=\"code-block\"\n data-testid=\"codeblock-react-highlighter\"\n language=\"javascript\"\n style={dracula}\n {...codeblockProps}\n >\n {code}\n </CodeBlock>\n {showCopyButton && (\n <CopyCode\n className=\"absolute top-2 right-2\"\n data-cy=\"copy-button\"\n data-testid=\"codeblock-copy-button\"\n size=\"small\"\n style=\"secondary\"\n value={code}\n {...copyButtonProps}\n label={isLargerScreen ? copyButtonProps.label : \"\"}\n />\n )}\n </div>\n );\n};\n\nCodeblock.propTypes = {\n /**\n * The code to be displayed.\n */\n code: PropTypes.string,\n /**\n * Flag to determine whether the 'Copy' button is displayed.\n */\n showCopyButton: PropTypes.bool,\n /**\n * Additional props that can be passed on to the 'PrismLight' component from 'react-syntax-highlighter'.\n */\n codeblockProps: PropTypes.object,\n /**\n * Additional props that can be passed on to the 'CopyToClipboardButton' component from 'neeto-molecules'.\n */\n copyButtonProps: PropTypes.object,\n};\n\nexport default Codeblock;\n"],"names":["Codeblock","_ref","code","_ref$showCopyButton","showCopyButton","codeblockProps","_ref$copyButtonProps","copyButtonProps","label","isLargerScreen","window","innerWidth","React","createElement","className","CodeBlock","_extends","wrapLines","codeTagProps","language","style","dracula","CopyCode","size","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAC,mBAAA,GAAAF,IAAA,CACJG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;IACrBE,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IAAAC,oBAAA,GAAAL,IAAA,CACdM,eAAe;IAAfA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA;AAAEE,MAAAA,KAAK,EAAE,MAAA;AAAO,KAAC,GAAAF,oBAAA,CAAA;AAEnC,EAAA,IAAMG,cAAc,GAAGC,MAAM,CAACC,UAAU,GAAG,GAAG,CAAA;EAE9C,oBACEC,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,UAAA;AAAU,GAAA,eACvBF,yBAAA,CAAAC,aAAA,CAACE,iCAAS,EAAAC,iBAAA,CAAA;IACRC,SAAS,EAAA,IAAA;AACTH,IAAAA,SAAS,EAAC,mBAAmB;AAC7BI,IAAAA,YAAY,EAAE;AAAE,MAAA,SAAS,EAAE,oBAAA;KAAuB;AAClD,IAAA,SAAA,EAAQ,YAAY;AACpB,IAAA,aAAA,EAAY,6BAA6B;AACzCC,IAAAA,QAAQ,EAAC,YAAY;AACrBC,IAAAA,KAAK,EAAEC,aAAAA;AAAQ,GAAA,EACXhB,cAAc,CAAA,EAEjBH,IACQ,CAAC,EACXE,cAAc,iBACbQ,yBAAA,CAAAC,aAAA,CAACS,qBAAQ,EAAAN,iBAAA,CAAA;AACPF,IAAAA,SAAS,EAAC,wBAAwB;AAClC,IAAA,SAAA,EAAQ,aAAa;AACrB,IAAA,aAAA,EAAY,uBAAuB;AACnCS,IAAAA,IAAI,EAAC,OAAO;AACZH,IAAAA,KAAK,EAAC,WAAW;AACjBI,IAAAA,KAAK,EAAEtB,IAAAA;AAAK,GAAA,EACRK,eAAe,EAAA;AACnBC,IAAAA,KAAK,EAAEC,cAAc,GAAGF,eAAe,CAACC,KAAK,GAAG,EAAA;AAAG,GAAA,CACpD,CAEA,CAAC,CAAA;AAEV;;;;"}
@@ -9,6 +9,8 @@ var classnames = require('classnames');
9
9
  var general = require('@bigbinary/neeto-commons-frontend/utils/general');
10
10
  var neetoIcons = require('@bigbinary/neeto-icons');
11
11
  var neetoui = require('@bigbinary/neetoui');
12
+ var ramda = require('ramda');
13
+ var reactI18next = require('react-i18next');
12
14
  var injectCss = require('./inject-css-80a5faa3.js');
13
15
 
14
16
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -18,8 +20,7 @@ var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
18
20
 
19
21
  var TIME_OUT = 2000;
20
22
  var TOOLTIP_CONFIG = {
21
- content: "Copied",
22
- trigger: "click",
23
+ trigger: "click mouseenter",
23
24
  hideAfter: TIME_OUT,
24
25
  position: "top"
25
26
  };
@@ -37,6 +38,8 @@ var CopyToClipboardButton = function CopyToClipboardButton(_ref) {
37
38
  value = _ref.value,
38
39
  style = _ref.style,
39
40
  otherProps = objectWithoutProperties._objectWithoutProperties(_ref, _excluded);
41
+ var _useTranslation = reactI18next.useTranslation(),
42
+ t = _useTranslation.t;
40
43
  var _useState = React.useState(false),
41
44
  _useState2 = slicedToArray._slicedToArray(_useState, 2),
42
45
  isChecked = _useState2[0],
@@ -58,7 +61,9 @@ var CopyToClipboardButton = function CopyToClipboardButton(_ref) {
58
61
  var buttonWidth = ref.current.clientWidth;
59
62
  ref.current.style.minWidth = "".concat(buttonWidth, "px");
60
63
  }, []);
61
- var tooltipProps = label ? null : TOOLTIP_CONFIG;
64
+ var tooltipProps = label ? null : ramda.mergeRight(TOOLTIP_CONFIG, {
65
+ content: isChecked ? t("neetoMolecules.common.copied") : t("neetoMolecules.common.copyToClipboard")
66
+ });
62
67
  var buttonLabel = isChecked && label ? "Copied" : label;
63
68
  var buttonIcon = isChecked ? neetoIcons.Check : icon;
64
69
  return /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends._extends({
@@ -1 +1 @@
1
- {"version":3,"file":"CopyToClipboardButton.js","sources":["../../src/components/CopyToClipboardButton/constants.js","../../src/components/CopyToClipboardButton/index.jsx"],"sourcesContent":["const TIME_OUT = 2000;\n\nconst TOOLTIP_CONFIG = {\n content: \"Copied\",\n trigger: \"click\",\n hideAfter: TIME_OUT,\n position: \"top\",\n};\n\nconst BUTTON_STYLES = {\n primary: \"primary\",\n secondary: \"secondary\",\n text: \"text\",\n};\n\nexport { TOOLTIP_CONFIG, TIME_OUT, BUTTON_STYLES };\n","import React, { useState, useEffect, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { copyToClipboard } from \"neetocommons/utils/general\";\nimport { Copy, Check } from \"neetoicons\";\nimport { Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport { TOOLTIP_CONFIG, TIME_OUT, BUTTON_STYLES } from \"./constants\";\nimport \"./copyToClipboard.scss\";\n\nconst CopyToClipboardButton = ({\n className,\n icon = Copy,\n label = \"\",\n value,\n style,\n ...otherProps\n}) => {\n const [isChecked, setIsChecked] = useState(false);\n const ref = useRef();\n\n const onHandleClick = event => {\n event.preventDefault();\n copyToClipboard(value, { showToastr: false });\n setIsChecked(true);\n setTimeout(() => {\n setIsChecked(false);\n }, TIME_OUT); // Reset copied state after 2 seconds\n };\n\n useEffect(() => {\n if (!ref.current) return;\n const buttonWidth = ref.current.clientWidth;\n ref.current.style.minWidth = `${buttonWidth}px`;\n }, []);\n\n const tooltipProps = label ? null : TOOLTIP_CONFIG;\n const buttonLabel = isChecked && label ? \"Copied\" : label;\n const buttonIcon = isChecked ? Check : icon;\n\n return (\n <Button\n {...{ ref, style, tooltipProps }}\n data-testid=\"copy-button\"\n icon={buttonIcon}\n label={buttonLabel}\n className={classnames(\"neeto-molecules-copy-button\", {\n [className]: className,\n \"neeto-molecules-copy-button--active\": isChecked,\n })}\n onClick={onHandleClick}\n {...otherProps}\n />\n );\n};\n\nCopyToClipboardButton.propTypes = {\n /**\n * To provide additional classnames to the button.\n */\n className: PropTypes.string,\n /**\n * To provide the icon to be passed to the button. Defaults to the Copy icon.\n */\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /**\n * To provide the label to the button. By default there is no label.\n */\n label: PropTypes.string,\n /**\n * The value to be copied to clipboard. (required)\n */\n value: PropTypes.string,\n /**\n * To specify the style of the Button.\n */\n style: PropTypes.oneOf(Object.values(BUTTON_STYLES)),\n};\n\nexport default CopyToClipboardButton;\n"],"names":["TIME_OUT","TOOLTIP_CONFIG","content","trigger","hideAfter","position","CopyToClipboardButton","_ref","className","_ref$icon","icon","Copy","_ref$label","label","value","style","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","isChecked","setIsChecked","ref","useRef","onHandleClick","event","preventDefault","copyToClipboard","showToastr","setTimeout","useEffect","current","buttonWidth","clientWidth","minWidth","concat","tooltipProps","buttonLabel","buttonIcon","Check","React","createElement","Button","_extends","classnames","_defineProperty","onClick"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAMA,QAAQ,GAAG,IAAI,CAAA;AAErB,IAAMC,cAAc,GAAG;AACrBC,EAAAA,OAAO,EAAE,QAAQ;AACjBC,EAAAA,OAAO,EAAE,OAAO;AAChBC,EAAAA,SAAS,EAAEJ,QAAQ;AACnBK,EAAAA,QAAQ,EAAE,KAAA;AACZ,CAAC;;;;;;ACID,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAAC,IAAA,EAOrB;AAAA,EAAA,IANJC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAAC,SAAA,GAAAF,IAAA,CACTG,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAGE,KAAAA,CAAAA,GAAAA,eAAI,GAAAF,SAAA;IAAAG,UAAA,GAAAL,IAAA,CACXM,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,UAAA;IACVE,KAAK,GAAAP,IAAA,CAALO,KAAK;IACLC,KAAK,GAAAR,IAAA,CAALQ,KAAK;AACFC,IAAAA,UAAU,GAAAC,gDAAA,CAAAV,IAAA,EAAAW,SAAA,CAAA,CAAA;AAEb,EAAA,IAAAC,SAAA,GAAkCC,cAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,4BAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAA1CI,IAAAA,SAAS,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,YAAY,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAC9B,EAAA,IAAMI,GAAG,GAAGC,YAAM,EAAE,CAAA;AAEpB,EAAA,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CA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GA,SAAS,CAAA,EACtB,qCAAqC,EAAEe,SAAS,CACjD,CAAE;AACH0B,IAAAA,OAAO,EAAEtB,aAAAA;GACLX,EAAAA,UAAU,CACf,CAAC,CAAA;AAEN;;;;"}
1
+ {"version":3,"file":"CopyToClipboardButton.js","sources":["../../src/components/CopyToClipboardButton/constants.js","../../src/components/CopyToClipboardButton/index.jsx"],"sourcesContent":["const TIME_OUT = 2000;\n\nconst TOOLTIP_CONFIG = {\n trigger: \"click mouseenter\",\n hideAfter: TIME_OUT,\n position: \"top\",\n};\n\nconst BUTTON_STYLES = {\n primary: \"primary\",\n secondary: \"secondary\",\n text: \"text\",\n};\n\nexport { TOOLTIP_CONFIG, TIME_OUT, BUTTON_STYLES };\n","import React, { useState, useEffect, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { copyToClipboard } from \"neetocommons/utils/general\";\nimport { Copy, Check } from \"neetoicons\";\nimport { Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeRight } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { TOOLTIP_CONFIG, TIME_OUT, BUTTON_STYLES } from \"./constants\";\nimport \"./copyToClipboard.scss\";\n\nconst CopyToClipboardButton = ({\n className,\n icon = Copy,\n label = \"\",\n value,\n style,\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n const [isChecked, setIsChecked] = useState(false);\n\n const ref = useRef();\n\n const onHandleClick = event => {\n event.preventDefault();\n copyToClipboard(value, { showToastr: false });\n setIsChecked(true);\n setTimeout(() => {\n setIsChecked(false);\n }, TIME_OUT); // Reset copied state after 2 seconds\n };\n\n useEffect(() => {\n if (!ref.current) return;\n const buttonWidth = ref.current.clientWidth;\n ref.current.style.minWidth = `${buttonWidth}px`;\n }, []);\n\n const tooltipProps = label\n ? null\n : mergeRight(TOOLTIP_CONFIG, {\n content: isChecked\n ? t(\"neetoMolecules.common.copied\")\n : t(\"neetoMolecules.common.copyToClipboard\"),\n });\n const buttonLabel = isChecked && label ? \"Copied\" : label;\n const buttonIcon = isChecked ? Check : icon;\n\n return (\n <Button\n {...{ ref, style, tooltipProps }}\n data-testid=\"copy-button\"\n icon={buttonIcon}\n label={buttonLabel}\n className={classnames(\"neeto-molecules-copy-button\", {\n [className]: className,\n \"neeto-molecules-copy-button--active\": isChecked,\n })}\n onClick={onHandleClick}\n {...otherProps}\n />\n );\n};\n\nCopyToClipboardButton.propTypes = {\n /**\n * To provide additional classnames to the button.\n */\n className: PropTypes.string,\n /**\n * To provide the icon to be passed to the button. Defaults to the Copy icon.\n */\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /**\n * To provide the label to the button. By default there is no label.\n */\n label: PropTypes.string,\n /**\n * The value to be copied to clipboard. (required)\n */\n value: PropTypes.string,\n /**\n * To specify the style of the Button.\n */\n style: PropTypes.oneOf(Object.values(BUTTON_STYLES)),\n};\n\nexport default CopyToClipboardButton;\n"],"names":["TIME_OUT","TOOLTIP_CONFIG","trigger","hideAfter","position","CopyToClipboardButton","_ref","className","_ref$icon","icon","Copy","_ref$label","label","value","style","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","isChecked","setIsChecked","ref","useRef","onHandleClick","event","preventDefault","copyToClipboard","showToastr","setTimeout","useEffect","current","buttonWidth","clientWidth","minWidth","concat","tooltipProps","mergeRight","content","buttonLabel","buttonIcon","Check","React","createElement","Button","_extends","classnames","_defineProperty","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,QAAQ,GAAG,IAAI,CAAA;AAErB,IAAMC,cAAc,GAAG;AACrBC,EAAAA,OAAO,EAAE,kBAAkB;AAC3BC,EAAAA,SAAS,EAAEH,QAAQ;AACnBI,EAAAA,QAAQ,EAAE,KAAA;AACZ,CAAC;;;;;;ACOD,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAAC,IAAA,EAOrB;AAAA,EAAA,IANJC,SAAS,GAAAD,IAAA,CAATC,SAAS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AAG,CAACS,OAAO,CAACE,WAAW,CAAA;IAC3CX,GAAG,CAACS,OAAO,CAACtB,KAAK,CAACyB,QAAQ,GAAAC,EAAAA,CAAAA,MAAA,CAAMH,WAAW,EAAI,IAAA,CAAA,CAAA;GAChD,EAAE,EAAE,CAAC,CAAA;EAEN,IAAMI,YAAY,GAAG7B,KAAK,GACtB,IAAI,GACJ8B,gBAAU,CAACzC,cAAc,EAAE;IACzB0C,OAAO,EAAElB,SAAS,GACdL,CAAC,CAAC,8BAA8B,CAAC,GACjCA,CAAC,CAAC,uCAAuC,CAAA;AAC/C,GAAC,CAAC,CAAA;EACN,IAAMwB,WAAW,GAAGnB,SAAS,IAAIb,KAAK,GAAG,QAAQ,GAAGA,KAAK,CAAA;AACzD,EAAA,IAAMiC,UAAU,GAAGpB,SAAS,GAAGqB,gBAAK,GAAGrC,IAAI,CAAA;AAE3C,EAAA,oBACEsC,yBAAA,CAAAC,aAAA,CAACC,cAAM,EAAAC,iBAAA,CAAA;AACCvB,IAAAA,GAAG,EAAHA,GAAG;AAAEb,IAAAA,KAAK,EAALA,KAAK;AAAE2B,IAAAA,YAAY,EAAZA,YAAY;AAC9B,IAAA,aAAA,EAAY,aAAa;AACzBhC,IAAAA,IAAI,EAAEoC,UAAW;AACjBjC,IAAAA,KAAK,EAAEgC,WAAY;AACnBrC,IAAAA,SAAS,EAAE4C,8BAAU,CAAC,6BAA6B,EAAAC,8BAAA,CAAAA,8BAAA,CAChD7C,EAAAA,EAAAA,SAAS,EAAGA,SAAS,CAAA,EACtB,qCAAqC,EAAEkB,SAAS,CACjD,CAAE;AACH4B,IAAAA,OAAO,EAAExB,aAAAA;GACLd,EAAAA,UAAU,CACf,CAAC,CAAA;AAEN;;;;"}
@@ -8,7 +8,7 @@ var general = require('@bigbinary/neeto-commons-frontend/utils/general');
8
8
  var neetoIcons = require('@bigbinary/neeto-icons');
9
9
  var neetoui = require('@bigbinary/neetoui');
10
10
  var reactI18next = require('react-i18next');
11
- var index = require('./index-35629600.js');
11
+ var index = require('./index-408d5262.js');
12
12
  var MoreDropdown = require('./MoreDropdown.js');
13
13
  require('formik');
14
14
  require('@bigbinary/neeto-hotkeys');
@@ -20,11 +20,11 @@ require('./extends-1b35a664.js');
20
20
  require('./defineProperty-886ed289.js');
21
21
  require('./objectWithoutProperties-2fed2d7d.js');
22
22
  require('classnames');
23
+ require('ramda');
23
24
  require('./inject-css-80a5faa3.js');
24
25
  require('@bigbinary/neeto-commons-frontend/react-utils/useMutationWithInvalidation');
25
26
  require('react-query');
26
27
  require('axios');
27
- require('ramda');
28
28
 
29
29
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
30
30
 
@@ -9,7 +9,7 @@ var reactI18next = require('react-i18next');
9
9
  var Container = require('./Container.js');
10
10
  var PageLoader = require('./PageLoader.js');
11
11
  var SubHeader = require('./SubHeader.js');
12
- var index = require('./index-35629600.js');
12
+ var index = require('./index-408d5262.js');
13
13
  var _extends = require('./extends-1b35a664.js');
14
14
  var constants = require('@bigbinary/neeto-commons-frontend/constants');
15
15
  var withT = require('@bigbinary/neeto-commons-frontend/react-utils/withT');
@@ -107,7 +107,7 @@ var Editor = function Editor(_ref) {
107
107
  })));
108
108
  };
109
109
 
110
- var css = ":root{--neeto-molecules-rename-font-size:var(--neeto-ui-text-sm);--neeto-molecules-rename-font-weight:400;--neeto-molecules-rename-letter-spacing:0;--neeto-molecules-rename-line-height:1.2;--neeto-molecules-rename-min-width:120px}.neeto-molecules-rename-common-styles,.neeto-molecules-rename__input .neeto-ui-input input,.neeto-molecules-rename__input-width-maker,.neeto-molecules-rename__text{font-size:var(--neeto-ui-text-sm)!important;font-size:var(--neeto-molecules-rename-font-size)!important;font-weight:400;font-weight:var(--neeto-molecules-rename-font-weight);letter-spacing:0;letter-spacing:var(--neeto-molecules-rename-letter-spacing);line-height:1.2;line-height:var(--neeto-molecules-rename-line-height);margin:0}.neeto-molecules-rename__input{height:100%;margin:0;max-width:100%;min-width:0;position:relative;transition:width .2s ease-in-out;width:100%}.neeto-molecules-rename__input .neeto-ui-input{height:100%}.neeto-molecules-rename__input .neeto-ui-input .neeto-ui-input__suffix{margin-right:0!important}.neeto-molecules-rename__input .neeto-ui-input input{min-width:0}.neeto-molecules-rename__text{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);cursor:pointer;max-width:448px;padding:8px;transition:var(--neeto-ui-transition)}.neeto-molecules-rename__display-text{color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-rename__display-text:hover{border:thin solid rgb(var(--neeto-ui-gray-300))}.neeto-molecules-rename__input-width-maker{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);cursor:pointer;display:inline-flex;margin-right:68px;max-width:100%;min-width:120px;overflow:hidden;padding:8px;position:relative;transition:var(--neeto-ui-transition);visibility:hidden;white-space:nowrap}";
110
+ var css = ":root{--neeto-molecules-rename-font-size:var(--neeto-ui-text-sm);--neeto-molecules-rename-font-weight:400;--neeto-molecules-rename-letter-spacing:0;--neeto-molecules-rename-line-height:1.2;--neeto-molecules-rename-min-width:120px}.neeto-molecules-rename-common-styles,.neeto-molecules-rename__input .neeto-ui-input input,.neeto-molecules-rename__input-width-maker,.neeto-molecules-rename__text{font-size:var(--neeto-ui-text-sm)!important;font-size:var(--neeto-molecules-rename-font-size)!important;font-weight:400;font-weight:var(--neeto-molecules-rename-font-weight);letter-spacing:0;letter-spacing:var(--neeto-molecules-rename-letter-spacing);line-height:1.2;line-height:var(--neeto-molecules-rename-line-height);margin:0}.neeto-molecules-rename__input{height:100%;margin:0;max-width:100%;min-width:0;position:relative;transition:width .2s ease-in-out;width:100%}.neeto-molecules-rename__input .neeto-ui-input{height:100%}.neeto-molecules-rename__input .neeto-ui-input .neeto-ui-input__suffix{margin-right:0!important}.neeto-molecules-rename__input .neeto-ui-input input{min-width:0}.neeto-molecules-rename__text{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);cursor:pointer;max-width:448px;padding:8px;transition:var(--neeto-ui-transition)}.neeto-molecules-rename__display-text{color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-rename__display-text:hover{border:thin solid rgb(var(--neeto-ui-gray-300))}.neeto-molecules-rename__input-width-maker{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);cursor:pointer;display:inline-flex;margin-right:68px;max-width:100%;min-width:120px;overflow:hidden;padding:8px;position:relative;transition:var(--neeto-ui-transition);visibility:hidden;white-space:nowrap}.neeto-molecules-rename-breadcrumbs{margin-bottom:0}.neeto-molecules-rename-breadcrumbs .neeto-molecules-breadcrumb a{display:flex}";
111
111
  injectCss.n(css,{});
112
112
 
113
113
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -305,7 +305,8 @@ var Rename = function Rename(_ref) {
305
305
  className: classnames__default["default"]("neeto-molecules-rename flex min-w-0 max-w-md flex-col items-start md:flex-row md:items-center", className)
306
306
  }, neetoCist.isNotEmpty(breadcrumbs) && /*#__PURE__*/React__default["default"].createElement(Breadcrumbs, {
307
307
  breadcrumbs: breadcrumbs,
308
- hasTrailingSeparator: true
308
+ hasTrailingSeparator: true,
309
+ className: "neeto-molecules-rename-breadcrumbs"
309
310
  }), /*#__PURE__*/React__default["default"].createElement("div", {
310
311
  className: "relative flex max-w-full items-center gap-x-2"
311
312
  }, editMode ? /*#__PURE__*/React__default["default"].createElement(Editor, editNameProps) : /*#__PURE__*/React__default["default"].createElement(ViewName, viewNameProps)));