@bigbinary/neetoui 8.2.23 → 8.2.25
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/README.md +1 -0
- package/dist/ActionDropdown.js +2 -2
- package/dist/Alert.js +3 -4
- package/dist/Alert.js.map +1 -1
- package/dist/Avatar.js +1 -0
- package/dist/Avatar.js.map +1 -1
- package/dist/Checkbox.js +3 -3
- package/dist/ColorPicker.js +3 -3
- package/dist/ColorPicker.js.map +1 -1
- package/dist/DatePicker.js +15 -16
- package/dist/DatePicker.js.map +1 -1
- package/dist/Dropdown.js +2 -2
- package/dist/Input.js +3 -3
- package/dist/Kbd.js +1 -0
- package/dist/Kbd.js.map +1 -1
- package/dist/Label.js +72 -55
- package/dist/Label.js.map +1 -1
- package/dist/Modal.js +3 -4
- package/dist/Modal.js.map +1 -1
- package/dist/MultiEmailInput.js +15 -15
- package/dist/Pagination.js +3 -3
- package/dist/Pane.js +3 -4
- package/dist/Pane.js.map +1 -1
- package/dist/Radio.js +3 -3
- package/dist/Select.js +4 -4
- package/dist/Select.js.map +1 -1
- package/dist/Sidebar.js +3 -2
- package/dist/Sidebar.js.map +1 -1
- package/dist/Slider.js +3 -3
- package/dist/Switch.js +3 -3
- package/dist/Table.js +4 -7
- package/dist/Table.js.map +1 -1
- package/dist/{Textarea-afac4a3e.js → Textarea-BcglKMaG.js} +3 -3
- package/dist/{Textarea-afac4a3e.js.map → Textarea-BcglKMaG.js.map} +1 -1
- package/dist/Textarea.js +4 -4
- package/dist/TimePicker.js +15 -16
- package/dist/TimePicker.js.map +1 -1
- package/dist/Toastr.js +2 -2
- package/dist/Tooltip.js +15 -10
- package/dist/Tooltip.js.map +1 -1
- package/dist/TranslationProvider.js +3 -1
- package/dist/TranslationProvider.js.map +1 -1
- package/dist/Tree.js +2 -2
- package/dist/TreeSelect.js +15 -4
- package/dist/TreeSelect.js.map +1 -1
- package/dist/cjs/Accordion.js +18 -27
- package/dist/cjs/Accordion.js.map +1 -1
- package/dist/cjs/ActionDropdown.js +8 -16
- package/dist/cjs/ActionDropdown.js.map +1 -1
- package/dist/cjs/Alert.js +9 -15
- package/dist/cjs/Alert.js.map +1 -1
- package/dist/cjs/Avatar.js +11 -19
- package/dist/cjs/Avatar.js.map +1 -1
- package/dist/cjs/Button.js +13 -21
- package/dist/cjs/Button.js.map +1 -1
- package/dist/cjs/Callout.js +5 -13
- package/dist/cjs/Callout.js.map +1 -1
- package/dist/cjs/Checkbox.js +10 -17
- package/dist/cjs/Checkbox.js.map +1 -1
- package/dist/cjs/ColorPicker.js +30 -40
- package/dist/cjs/ColorPicker.js.map +1 -1
- package/dist/cjs/DatePicker.js +15 -16
- package/dist/cjs/DatePicker.js.map +1 -1
- package/dist/cjs/Dropdown.js +30 -40
- package/dist/cjs/Dropdown.js.map +1 -1
- package/dist/cjs/Input.js +20 -29
- package/dist/cjs/Input.js.map +1 -1
- package/dist/cjs/Kbd.js +5 -11
- package/dist/cjs/Kbd.js.map +1 -1
- package/dist/cjs/Label.js +71 -62
- package/dist/cjs/Label.js.map +1 -1
- package/dist/cjs/Modal.js +22 -32
- package/dist/cjs/Modal.js.map +1 -1
- package/dist/cjs/MultiEmailInput.js +51 -62
- package/dist/cjs/MultiEmailInput.js.map +1 -1
- package/dist/cjs/NoData.js +14 -21
- package/dist/cjs/NoData.js.map +1 -1
- package/dist/cjs/Pagination.js +19 -25
- package/dist/cjs/Pagination.js.map +1 -1
- package/dist/cjs/Pane.js +19 -29
- package/dist/cjs/Pane.js.map +1 -1
- package/dist/cjs/Popover.js +5 -12
- package/dist/cjs/Popover.js.map +1 -1
- package/dist/cjs/ProgressBar.js +3 -8
- package/dist/cjs/ProgressBar.js.map +1 -1
- package/dist/cjs/Radio.js +17 -26
- package/dist/cjs/Radio.js.map +1 -1
- package/dist/cjs/Select.js +49 -62
- package/dist/cjs/Select.js.map +1 -1
- package/dist/cjs/Sidebar.js +69 -77
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/Slider.js +12 -21
- package/dist/cjs/Slider.js.map +1 -1
- package/dist/cjs/Spinner.js +2 -7
- package/dist/cjs/Spinner.js.map +1 -1
- package/dist/cjs/Stepper.js +6 -11
- package/dist/cjs/Stepper.js.map +1 -1
- package/dist/cjs/Switch.js +16 -23
- package/dist/cjs/Switch.js.map +1 -1
- package/dist/cjs/Tab.js +10 -18
- package/dist/cjs/Tab.js.map +1 -1
- package/dist/cjs/Table.js +54 -70
- package/dist/cjs/Table.js.map +1 -1
- package/dist/cjs/Tag.js +9 -16
- package/dist/cjs/Tag.js.map +1 -1
- package/dist/cjs/{Textarea-c6496fa2.js → Textarea-XjB9bG3I.js} +19 -28
- package/dist/cjs/{Textarea-c6496fa2.js.map → Textarea-XjB9bG3I.js.map} +1 -1
- package/dist/cjs/Textarea.js +4 -4
- package/dist/cjs/TimePicker.js +15 -16
- package/dist/cjs/TimePicker.js.map +1 -1
- package/dist/cjs/Toastr.js +24 -34
- package/dist/cjs/Toastr.js.map +1 -1
- package/dist/cjs/Tooltip.js +18 -21
- package/dist/cjs/Tooltip.js.map +1 -1
- package/dist/cjs/TranslationProvider.js +6 -9
- package/dist/cjs/TranslationProvider.js.map +1 -1
- package/dist/cjs/Tree.js +8 -17
- package/dist/cjs/Tree.js.map +1 -1
- package/dist/cjs/TreeSelect.js +26 -25
- package/dist/cjs/TreeSelect.js.map +1 -1
- package/dist/cjs/Typography.js +4 -12
- package/dist/cjs/Typography.js.map +1 -1
- package/dist/cjs/constants.js +7 -19
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/{en-c69be2fb.js → en-1dfvTYgC.js} +1 -1
- package/dist/cjs/en-1dfvTYgC.js.map +1 -0
- package/dist/cjs/formik/ActionBlock.js +7 -13
- package/dist/cjs/formik/ActionBlock.js.map +1 -1
- package/dist/cjs/formik/BlockNavigation.js +12 -20
- package/dist/cjs/formik/BlockNavigation.js.map +1 -1
- package/dist/cjs/formik/Button.js +2 -8
- package/dist/cjs/formik/Button.js.map +1 -1
- package/dist/cjs/formik/Checkbox.js +7 -14
- package/dist/cjs/formik/Checkbox.js.map +1 -1
- package/dist/cjs/formik/Form.js +13 -24
- package/dist/cjs/formik/Form.js.map +1 -1
- package/dist/cjs/formik/Input.js +7 -14
- package/dist/cjs/formik/Input.js.map +1 -1
- package/dist/cjs/formik/MultiEmailInput.js +6 -13
- package/dist/cjs/formik/MultiEmailInput.js.map +1 -1
- package/dist/cjs/formik/Radio.js +7 -15
- package/dist/cjs/formik/Radio.js.map +1 -1
- package/dist/cjs/formik/Select.js +8 -16
- package/dist/cjs/formik/Select.js.map +1 -1
- package/dist/cjs/formik/Slider.js +7 -15
- package/dist/cjs/formik/Slider.js.map +1 -1
- package/dist/cjs/formik/Switch.js +7 -14
- package/dist/cjs/formik/Switch.js.map +1 -1
- package/dist/cjs/formik/Textarea.js +8 -15
- package/dist/cjs/formik/Textarea.js.map +1 -1
- package/dist/cjs/formik/TreeSelect.js +5 -12
- package/dist/cjs/formik/TreeSelect.js.map +1 -1
- package/dist/cjs/formik/index.js +6 -9
- package/dist/cjs/formik/index.js.map +1 -1
- package/dist/cjs/{index-3c44e0c7.js → index-CvMjRZDt.js} +19 -33
- package/dist/cjs/{index-3c44e0c7.js.map → index-CvMjRZDt.js.map} +1 -1
- package/dist/cjs/{index-87f2e2dc.js → index-E2IEf9Av.js} +53 -70
- package/dist/cjs/{index-87f2e2dc.js.map → index-E2IEf9Av.js.map} +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +22 -25
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts.js +2 -4
- package/dist/cjs/layouts.js.map +1 -1
- package/dist/cjs/managers.js +0 -2
- package/dist/cjs/managers.js.map +1 -1
- package/dist/cjs/overlayManager.js +2 -9
- package/dist/cjs/overlayManager.js.map +1 -1
- package/dist/cjs/{react-select-creatable.esm-23eddf9f.js → react-select-creatable.esm-Bdv9YAMt.js} +231 -140
- package/dist/cjs/{react-select-creatable.esm-23eddf9f.js.map → react-select-creatable.esm-Bdv9YAMt.js.map} +1 -1
- package/dist/cjs/tinycolor-C4a31PPv.js +1214 -0
- package/dist/cjs/tinycolor-C4a31PPv.js.map +1 -0
- package/dist/cjs/{useId-4e3deb5c.js → useId-DXHUzdxd.js} +1 -1
- package/dist/cjs/{useId-4e3deb5c.js.map → useId-DXHUzdxd.js.map} +1 -1
- package/dist/cjs/{useOverlayManager-b8134604.js → useOverlayManager-CXLC179x.js} +19 -741
- package/dist/cjs/useOverlayManager-CXLC179x.js.map +1 -0
- package/dist/cjs/{useQueryParams-a8ee2f76.js → useQueryParams-l5fJJYCR.js} +2 -6
- package/dist/cjs/useQueryParams-l5fJJYCR.js.map +1 -0
- package/dist/cjs/{useRestoreScrollPosition-26e8d203.js → useRestoreScrollPosition-Dmq0tlvp.js} +18 -22
- package/dist/cjs/{useRestoreScrollPosition-26e8d203.js.map → useRestoreScrollPosition-Dmq0tlvp.js.map} +1 -1
- package/dist/{en-2d3f9fc1.js → en-CJac0MnO.js} +1 -1
- package/dist/en-CJac0MnO.js.map +1 -0
- package/dist/formik/ActionBlock.js +2 -2
- package/dist/formik/BlockNavigation.js +3 -4
- package/dist/formik/BlockNavigation.js.map +1 -1
- package/dist/formik/Checkbox.js +3 -3
- package/dist/formik/Input.js +3 -3
- package/dist/formik/MultiEmailInput.js +3 -3
- package/dist/formik/Radio.js +3 -3
- package/dist/formik/Select.js +4 -4
- package/dist/formik/Slider.js +3 -3
- package/dist/formik/Switch.js +3 -3
- package/dist/formik/Textarea.js +4 -4
- package/dist/formik/TreeSelect.js +2 -2
- package/dist/formik/index.js +6 -7
- package/dist/formik/index.js.map +1 -1
- package/dist/{index-6e82a862.js → index-BojMT3ps.js} +3 -3
- package/dist/{index-6e82a862.js.map → index-BojMT3ps.js.map} +1 -1
- package/dist/{index-b037e9fc.js → index-DugGi20r.js} +6 -12
- package/dist/{index-b037e9fc.js.map → index-DugGi20r.js.map} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +22 -23
- package/dist/index.js.map +1 -1
- package/dist/layouts.js +2 -2
- package/dist/{react-select-creatable.esm-ad71b0c0.js → react-select-creatable.esm-Dx_vEnyD.js} +137 -31
- package/dist/{react-select-creatable.esm-ad71b0c0.js.map → react-select-creatable.esm-Dx_vEnyD.js.map} +1 -1
- package/dist/tinycolor-DX-kZ4bq.js +1212 -0
- package/dist/tinycolor-DX-kZ4bq.js.map +1 -0
- package/dist/{useId-c1d20bba.js → useId-Jj9hXm-g.js} +1 -1
- package/dist/{useId-c1d20bba.js.map → useId-Jj9hXm-g.js.map} +1 -1
- package/dist/{useOverlayManager-65f6d80a.js → useOverlayManager-Dyv5Y8Ug.js} +3 -713
- package/dist/useOverlayManager-Dyv5Y8Ug.js.map +1 -0
- package/dist/{useQueryParams-dcb34865.js → useQueryParams-b60CHFUx.js} +1 -1
- package/dist/{useQueryParams-dcb34865.js.map → useQueryParams-b60CHFUx.js.map} +1 -1
- package/dist/{useRestoreScrollPosition-631cf3e5.js → useRestoreScrollPosition-DnEaioaR.js} +2 -2
- package/dist/{useRestoreScrollPosition-631cf3e5.js.map → useRestoreScrollPosition-DnEaioaR.js.map} +1 -1
- package/package.json +11 -10
- package/dist/cjs/en-c69be2fb.js.map +0 -1
- package/dist/cjs/tinycolor-b1e9a7b2.js +0 -1202
- package/dist/cjs/tinycolor-b1e9a7b2.js.map +0 -1
- package/dist/cjs/useOverlayManager-b8134604.js.map +0 -1
- package/dist/cjs/useQueryParams-a8ee2f76.js.map +0 -1
- package/dist/en-2d3f9fc1.js.map +0 -1
- package/dist/tinycolor-282c618c.js +0 -1200
- package/dist/tinycolor-282c618c.js.map +0 -1
- package/dist/useOverlayManager-65f6d80a.js.map +0 -1
package/dist/cjs/Label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.js","sources":["../../src/components/Label.jsx"],"sourcesContent":["import React, {
|
|
1
|
+
{"version":3,"file":"Label.js","sources":["../../src/components/Label/HelpIcon.jsx","../../src/components/Label/HelpContent.jsx","../../src/components/Label/index.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport classNames from \"classnames\";\nimport { Help } from \"neetoicons\";\n\nconst HelpIcon = forwardRef(\n ({ onClick, className, icon, ...otherProps }, ref) => {\n const HelpIcon = icon || Help;\n\n return (\n <span\n {...{ onClick, ref }}\n className={classNames(\"neeto-ui-label__help-icon-wrap\", {\n [className]: className,\n })}\n >\n <HelpIcon size={16} {...otherProps} />\n </span>\n );\n }\n);\n\nHelpIcon.displayName = \"HelpIcon\";\n\nexport default HelpIcon;\n","import React, { useRef } from \"react\";\n\nimport HelpIcon from \"./HelpIcon\";\n\nimport Button from \"../Button\";\nimport Popover from \"../Popover\";\nimport Tooltip from \"../Tooltip\";\nimport Typography from \"../Typography\";\n\nconst HelpContent = ({ helpIconProps }) => {\n const popoverReferenceElement = useRef();\n\n const { tooltipProps, popoverProps, ...otherHelpIconProps } =\n helpIconProps || {};\n\n if (tooltipProps) {\n return (\n <Tooltip {...tooltipProps}>\n <HelpIcon {...otherHelpIconProps} />\n </Tooltip>\n );\n }\n\n if (popoverProps) {\n const { title, description, helpLinkProps, ...otherPopoverProps } =\n popoverProps;\n\n return (\n <>\n <HelpIcon {...otherHelpIconProps} ref={popoverReferenceElement} />\n <Popover reference={popoverReferenceElement} {...otherPopoverProps}>\n <div className=\"flex flex-col\">\n {title && (\n <Popover.Title\n data-cy=\"help-popover-title\"\n data-testid=\"help-popover-title\"\n >\n {title}\n </Popover.Title>\n )}\n {typeof description === \"string\" ? (\n <Typography\n data-cy=\"help-popover-description\"\n data-testid=\"help-popover-description\"\n lineHeight=\"normal\"\n style=\"body2\"\n weight=\"normal\"\n >\n {description}\n </Typography>\n ) : (\n description\n )}\n {helpLinkProps && (\n <Button\n className=\"neeto-ui-mt-3\"\n data-cy=\"help-popover-link-button\"\n size=\"small\"\n {...helpLinkProps}\n data-testid=\"help-popover-link-button\"\n style=\"link\"\n target=\"_blank\"\n />\n )}\n </div>\n </Popover>\n </>\n );\n }\n\n return <HelpIcon {...otherHelpIconProps} />;\n};\n\nexport default HelpContent;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport HelpContent from \"./HelpContent\";\n\nimport Button from \"../Button\";\nimport Tooltip from \"../Tooltip\";\n\nconst Label = ({\n children,\n className = \"\",\n required = false,\n helpIconProps = null,\n ...props\n}) => (\n <label\n className={classnames(\n \"neeto-ui-label neeto-ui-flex neeto-ui-items-center\",\n className\n )}\n {...props}\n >\n {children}\n {required && <span aria-hidden>*</span>}\n {helpIconProps && <HelpContent {...{ helpIconProps }} />}\n </label>\n);\n\nLabel.propTypes = {\n /**\n * To specify the content to be rendered inside the Label.\n */\n children: PropTypes.node,\n /**\n * Provide external classnames to Label component.\n */\n className: PropTypes.string,\n /**\n * To specify whether to show the required asterisk.\n */\n required: PropTypes.bool,\n /**\n * Props for the help icon\n */\n helpIconProps: PropTypes.shape({\n onClick: PropTypes.func,\n icon: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\n tooltipProps: PropTypes.shape({ ...Tooltip.propTypes }),\n popoverProps: PropTypes.shape({\n title: PropTypes.node,\n description: PropTypes.node,\n helpLinkProps: PropTypes.shape({ ...Button.propTypes }),\n }),\n className: PropTypes.string,\n }),\n};\n\nexport default Label;\n"],"names":["HelpIcon","forwardRef","_ref","ref","onClick","className","icon","otherProps","_objectWithoutProperties","_excluded","Help","React","createElement","classNames","_defineProperty","_extends","size","displayName","HelpContent","helpIconProps","popoverReferenceElement","useRef","_ref2","tooltipProps","popoverProps","otherHelpIconProps","Tooltip","title","description","helpLinkProps","otherPopoverProps","_excluded2","Fragment","Popover","reference","Title","Typography","lineHeight","style","weight","Button","target","Label","children","_ref$className","_ref$required","required","_ref$helpIconProps","props","classnames"],"mappings":";;;;;;;;;;;;;;;;;;;AAKA,IAAMA,QAAQ,gBAAGC,gBAAU,CACzB,UAAAC,IAAA,EAA8CC,GAAG,EAAK;A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C,aAAA,CAACM,WAAW,EAAA;AAAOC,IAAAA,aAAa,EAAbA,aAAAA;AAAa,GAAA,CAAM,CAClD,CAAA;AAAA;;;;"}
|
package/dist/cjs/Modal.js
CHANGED
|
@@ -7,7 +7,7 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var classnames = require('classnames');
|
|
9
9
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
10
|
-
var useOverlayManager = require('./useOverlayManager-
|
|
10
|
+
var useOverlayManager = require('./useOverlayManager-CXLC179x.js');
|
|
11
11
|
var Button = require('./Button.js');
|
|
12
12
|
require('react-router-dom');
|
|
13
13
|
require('qs');
|
|
@@ -16,13 +16,12 @@ require('@babel/runtime/helpers/esm/extends');
|
|
|
16
16
|
require('@babel/runtime/helpers/esm/objectWithoutPropertiesLoose');
|
|
17
17
|
require('@babel/runtime/helpers/esm/inheritsLoose');
|
|
18
18
|
require('react-dom');
|
|
19
|
-
require('@babel/runtime/helpers/esm/assertThisInitialized');
|
|
20
19
|
require('ramda');
|
|
21
20
|
require('@bigbinary/neeto-hotkeys');
|
|
22
21
|
require('./overlayManager.js');
|
|
23
22
|
require('@babel/runtime/helpers/classCallCheck');
|
|
24
23
|
require('@babel/runtime/helpers/createClass');
|
|
25
|
-
require('./index-
|
|
24
|
+
require('./index-CvMjRZDt.js');
|
|
26
25
|
require('@babel/runtime/helpers/toConsumableArray');
|
|
27
26
|
require('dayjs');
|
|
28
27
|
require('dayjs/plugin/localeData');
|
|
@@ -31,27 +30,18 @@ require('dayjs/plugin/utc');
|
|
|
31
30
|
require('dayjs/plugin/weekday');
|
|
32
31
|
require('dayjs/plugin/weekOfYear');
|
|
33
32
|
require('@bigbinary/neeto-cist');
|
|
34
|
-
require('./en-
|
|
33
|
+
require('./en-1dfvTYgC.js');
|
|
35
34
|
require('./Spinner.js');
|
|
36
35
|
require('./Tooltip.js');
|
|
37
36
|
require('@tippyjs/react');
|
|
38
37
|
require('tippy.js');
|
|
39
38
|
|
|
40
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
41
|
-
|
|
42
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
43
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
44
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
45
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
46
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
47
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
48
|
-
|
|
49
39
|
var Body = function Body(_ref) {
|
|
50
40
|
var children = _ref.children,
|
|
51
41
|
className = _ref.className,
|
|
52
42
|
dataCy = _ref.dataCy;
|
|
53
|
-
return /*#__PURE__*/
|
|
54
|
-
className:
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: classnames("neeto-ui-modal__body", className),
|
|
55
45
|
"data-cy": dataCy !== null && dataCy !== void 0 ? dataCy : "modal-body"
|
|
56
46
|
}, children);
|
|
57
47
|
};
|
|
@@ -60,8 +50,8 @@ var Footer = function Footer(_ref) {
|
|
|
60
50
|
var children = _ref.children,
|
|
61
51
|
className = _ref.className,
|
|
62
52
|
dataCy = _ref.dataCy;
|
|
63
|
-
return /*#__PURE__*/
|
|
64
|
-
className:
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: classnames("neeto-ui-modal__footer", className),
|
|
65
55
|
"data-cy": dataCy !== null && dataCy !== void 0 ? dataCy : "modal-footer"
|
|
66
56
|
}, children);
|
|
67
57
|
};
|
|
@@ -72,19 +62,19 @@ var Header = function Header(_ref) {
|
|
|
72
62
|
children = _ref.children,
|
|
73
63
|
className = _ref.className,
|
|
74
64
|
dataCy = _ref.dataCy;
|
|
75
|
-
return /*#__PURE__*/
|
|
76
|
-
className:
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: classnames("neeto-ui-modal__header", className),
|
|
77
67
|
"data-cy": dataCy !== null && dataCy !== void 0 ? dataCy : "modal-header"
|
|
78
|
-
}, children, description && /*#__PURE__*/
|
|
68
|
+
}, children, description && /*#__PURE__*/React.createElement("div", {
|
|
79
69
|
className: "neeto-ui-modal__header-desc",
|
|
80
70
|
"data-cy": "modal-header-desc"
|
|
81
|
-
}, /*#__PURE__*/
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
82
72
|
lineHeight: "normal",
|
|
83
73
|
style: "body2"
|
|
84
74
|
}, description)));
|
|
85
75
|
};
|
|
86
76
|
|
|
87
|
-
var MemoizedChildren = /*#__PURE__*/
|
|
77
|
+
var MemoizedChildren = /*#__PURE__*/React.memo(function (_ref) {
|
|
88
78
|
var children = _ref.children;
|
|
89
79
|
return children;
|
|
90
80
|
}, function (_, _ref2) {
|
|
@@ -124,9 +114,9 @@ var Modal = function Modal(_ref) {
|
|
|
124
114
|
closeOnOutsideClick = _ref$closeOnOutsideCl === void 0 ? true : _ref$closeOnOutsideCl,
|
|
125
115
|
_ref$forceRender = _ref.forceRender,
|
|
126
116
|
forceRender = _ref$forceRender === void 0 ? false : _ref$forceRender,
|
|
127
|
-
otherProps =
|
|
117
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
128
118
|
var _useState = React.useState(false),
|
|
129
|
-
_useState2 =
|
|
119
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
130
120
|
hasTransitionCompleted = _useState2[0],
|
|
131
121
|
setHasTransitionCompleted = _useState2[1];
|
|
132
122
|
var modalWrapper = React.useRef(null);
|
|
@@ -147,9 +137,9 @@ var Modal = function Modal(_ref) {
|
|
|
147
137
|
handleOverlayClose = _useOverlay.handleOverlayClose,
|
|
148
138
|
setFocusField = _useOverlay.setFocusField;
|
|
149
139
|
var isFullScreenModal = size === SIZES.fullScreen;
|
|
150
|
-
return /*#__PURE__*/
|
|
140
|
+
return /*#__PURE__*/React.createElement(useOverlayManager.Portal, {
|
|
151
141
|
rootId: "neeto-ui-portal"
|
|
152
|
-
}, /*#__PURE__*/
|
|
142
|
+
}, /*#__PURE__*/React.createElement(useOverlayManager.CSSTransition, {
|
|
153
143
|
unmountOnExit: true,
|
|
154
144
|
appear: isOpen,
|
|
155
145
|
classNames: "neeto-ui-modal",
|
|
@@ -161,25 +151,25 @@ var Modal = function Modal(_ref) {
|
|
|
161
151
|
onExited: function onExited() {
|
|
162
152
|
return setHasTransitionCompleted(false);
|
|
163
153
|
}
|
|
164
|
-
}, /*#__PURE__*/
|
|
154
|
+
}, /*#__PURE__*/React.createElement(useOverlayManager.Backdrop, {
|
|
165
155
|
"data-testid": "backdrop",
|
|
166
156
|
key: "modal-backdrop",
|
|
167
157
|
ref: backdropRef,
|
|
168
|
-
className:
|
|
158
|
+
className: classnames("neeto-ui-modal__backdrop", {
|
|
169
159
|
"neeto-ui-modal__backdrop--fullscreen": isFullScreenModal
|
|
170
160
|
}, backdropClassName)
|
|
171
|
-
}, /*#__PURE__*/
|
|
161
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
172
162
|
"aria-modal": true,
|
|
173
163
|
key: "modal-wrapper",
|
|
174
164
|
ref: modalWrapper,
|
|
175
165
|
role: "dialog",
|
|
176
|
-
className:
|
|
166
|
+
className: classnames("neeto-ui-modal__wrapper", _defineProperty({
|
|
177
167
|
"neeto-ui-modal__wrapper--small": size === SIZES.small,
|
|
178
168
|
"neeto-ui-modal__wrapper--medium": size === SIZES.medium,
|
|
179
169
|
"neeto-ui-modal__wrapper--large": size === SIZES.large,
|
|
180
170
|
"neeto-ui-modal__wrapper--fullscreen": isFullScreenModal
|
|
181
171
|
}, className, className))
|
|
182
|
-
}, otherProps), closeButton && /*#__PURE__*/
|
|
172
|
+
}, otherProps), closeButton && /*#__PURE__*/React.createElement(Button, {
|
|
183
173
|
"aria-label": "Close",
|
|
184
174
|
className: "neeto-ui-modal__close",
|
|
185
175
|
"data-cy": "modal-close-button",
|
|
@@ -188,7 +178,7 @@ var Modal = function Modal(_ref) {
|
|
|
188
178
|
size: isFullScreenModal ? "large" : "small",
|
|
189
179
|
style: isFullScreenModal ? "secondary" : "text",
|
|
190
180
|
onClick: handleOverlayClose
|
|
191
|
-
}), /*#__PURE__*/
|
|
181
|
+
}), /*#__PURE__*/React.createElement(MemoizedChildren, {
|
|
192
182
|
shouldUpdate: isOpen || forceRender
|
|
193
183
|
}, typeof children === "function" ? children({
|
|
194
184
|
setFocusField: setFocusField
|
package/dist/cjs/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../src/components/Modal/Body.jsx","../../src/components/Modal/Footer.jsx","../../src/components/Modal/Header.jsx","../../src/components/Modal/MemoizedChildren.js","../../src/components/Modal/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__body\", className)}\n data-cy={dataCy ?? \"modal-body\"}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify className to be applied to the Modal Body.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal Body.\n */\n children: PropTypes.node,\n};\n\nexport default Body;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Footer = ({ children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__footer\", className)}\n data-cy={dataCy ?? \"modal-footer\"}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Modal Footer.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal Footer.\n */\n children: PropTypes.node,\n};\n\nexport default Footer;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Typography from \"../Typography\";\n\nconst Header = ({ description = \"\", children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__header\", className)}\n data-cy={dataCy ?? \"modal-header\"}\n >\n {children}\n {description && (\n <div className=\"neeto-ui-modal__header-desc\" data-cy=\"modal-header-desc\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {description}\n </Typography>\n </div>\n )}\n </div>\n);\n\nHeader.propTypes = {\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 specify the short description of the Modal.\n */\n description: PropTypes.string,\n /**\n * To specify className to be applied to the Modal Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","import React from \"react\";\n\nconst MemoizedChildren = React.memo(\n ({ children }) => children,\n (_, { shouldUpdate }) => !shouldUpdate\n);\n\nMemoizedChildren.displayName = \"MemoizedChildren\";\n\nexport default MemoizedChildren;\n","import React, { useRef, useState } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Close } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { CSSTransition } from \"react-transition-group\";\n\nimport Backdrop from \"atoms/Backdrop\";\nimport Portal from \"atoms/Portal\";\nimport Button from \"components/Button\";\nimport { useOverlayManager, useOverlay } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport MemoizedChildren from \"./MemoizedChildren\";\n\nconst SIZES = {\n small: \"small\",\n medium: \"medium\",\n large: \"large\",\n fullScreen: \"fullScreen\",\n};\n\nconst Modal = ({\n size = SIZES.medium,\n isOpen = false,\n onClose = () => {},\n children,\n finalFocusRef,\n initialFocusRef,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n blockScrollOnMount = true,\n closeOnOutsideClick = true,\n forceRender = false,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const modalWrapper = useRef(null);\n const backdropRef = useRef(null);\n\n useOverlayManager(modalWrapper, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n isOpen,\n initialFocusRef,\n finalFocusRef,\n overlayWrapper: modalWrapper,\n onClose,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n blockScrollOnMount,\n hasTransitionCompleted,\n });\n\n const isFullScreenModal = size === SIZES.fullScreen;\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-modal\"\n in={isOpen}\n timeout={300}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"modal-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-modal__backdrop\",\n {\n \"neeto-ui-modal__backdrop--fullscreen\": isFullScreenModal,\n },\n backdropClassName\n )}\n >\n <div\n aria-modal\n key=\"modal-wrapper\"\n ref={modalWrapper}\n role=\"dialog\"\n className={classnames(\"neeto-ui-modal__wrapper\", {\n \"neeto-ui-modal__wrapper--small\": size === SIZES.small,\n \"neeto-ui-modal__wrapper--medium\": size === SIZES.medium,\n \"neeto-ui-modal__wrapper--large\": size === SIZES.large,\n \"neeto-ui-modal__wrapper--fullscreen\": isFullScreenModal,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-modal__close\"\n data-cy=\"modal-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size={isFullScreenModal ? \"large\" : \"small\"}\n style={isFullScreenModal ? \"secondary\" : \"text\"}\n onClick={handleOverlayClose}\n />\n )}\n <MemoizedChildren shouldUpdate={isOpen || forceRender}>\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </MemoizedChildren>\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nModal.propTypes = {\n /**\n * To specify the size of the Modal.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Modal is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the Modal is closed.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Modal component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classNames to the Modal.\n */\n className: PropTypes.string,\n /**\n * To close the Modal on pressing the Esc key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the close button of the Modal should be displayed or not.\n */\n closeButton: PropTypes.bool,\n /**\n * To add custom classes to backdrop component.\n */\n backdropClassName: PropTypes.string,\n /**\n * To close on clicking outside the Modal content.\n */\n closeOnOutsideClick: PropTypes.bool,\n /*\n * To specify the ref of the element which will receive focus when the Modal is closed.\n * If not specified, the focus will be set to the element which was focused when the Modal was opened.\n * If the Modal was opened by clicking on a button, then the focus will be set to the button.\n * */\n finalFocusRef: PropTypes.object,\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 specify the ref of the element which will receive focus when the Modal is opened.\n * If not specified, the focus will be set to the first focusable element inside the Modal.\n * */\n initialFocusRef: PropTypes.object,\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 specify whether the scroll should be blocked when the Modal is opened.\n * */\n blockScrollOnMount: PropTypes.bool,\n /**\n * The modal children will be force re-rendered if the boolean is set to `true`. Ideally the modal won't update\n * if the `isOpen` is `false`. You can use this prop to override that nature.\n */\n forceRender: PropTypes.bool,\n};\n\nModal.Header = Header;\nModal.Body = Body;\nModal.Footer = Footer;\n\nexport default Modal;\n"],"names":["Body","_ref","children","className","dataCy","React","createElement","classnames","Footer","Header","_ref$description","description","Typography","lineHeight","style","MemoizedChildren","memo","_","_ref2","shouldUpdate","displayName","SIZES","small","medium","large","fullScreen","Modal","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","finalFocusRef","initialFocusRef","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$blockScrollOnMou","blockScrollOnMount","_ref$closeOnOutsideCl","closeOnOutsideClick","_ref$forceRender","forceRender","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","modalWrapper","useRef","backdropRef","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","isFullScreenModal","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","role","_defineProperty","Button","icon","Close","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM,CAAA;EAAA,oBACzCC,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,SAAS,EAAEI,8BAAU,CAAC,sBAAsB,EAAEJ,SAAS,CAAE;AACzD,IAAA,SAAA,EAASC,MAAM,KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAAA,GAANA,MAAM,GAAI,YAAA;AAAa,GAAA,EAE/BF,QAAQ,CACL,CAAA;AAAA,CACP;;ACPD,IAAMM,MAAM,GAAG,SAATA,MAAMA,CAAAP,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,MAAM,G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AA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3B/D,QAAQ,CACK,CACf,CACG,CACG,CACT,CAAA;AAEb,EAAC;AAmEDwB,KAAK,CAACjB,MAAM,GAAGA,MAAM,CAAA;AACrBiB,KAAK,CAAC1B,IAAI,GAAGA,IAAI,CAAA;AACjB0B,KAAK,CAAClB,MAAM,GAAGA,MAAM;;;;"}
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../src/components/Modal/Body.jsx","../../src/components/Modal/Footer.jsx","../../src/components/Modal/Header.jsx","../../src/components/Modal/MemoizedChildren.js","../../src/components/Modal/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__body\", className)}\n data-cy={dataCy ?? \"modal-body\"}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify className to be applied to the Modal Body.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal Body.\n */\n children: PropTypes.node,\n};\n\nexport default Body;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Footer = ({ children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__footer\", className)}\n data-cy={dataCy ?? \"modal-footer\"}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Modal Footer.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal Footer.\n */\n children: PropTypes.node,\n};\n\nexport default Footer;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Typography from \"../Typography\";\n\nconst Header = ({ description = \"\", children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__header\", className)}\n data-cy={dataCy ?? \"modal-header\"}\n >\n {children}\n {description && (\n <div className=\"neeto-ui-modal__header-desc\" data-cy=\"modal-header-desc\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {description}\n </Typography>\n </div>\n )}\n </div>\n);\n\nHeader.propTypes = {\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 specify the short description of the Modal.\n */\n description: PropTypes.string,\n /**\n * To specify className to be applied to the Modal Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","import React from \"react\";\n\nconst MemoizedChildren = React.memo(\n ({ children }) => children,\n (_, { shouldUpdate }) => !shouldUpdate\n);\n\nMemoizedChildren.displayName = \"MemoizedChildren\";\n\nexport default MemoizedChildren;\n","import React, { useRef, useState } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Close } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { CSSTransition } from \"react-transition-group\";\n\nimport Backdrop from \"atoms/Backdrop\";\nimport Portal from \"atoms/Portal\";\nimport Button from \"components/Button\";\nimport { useOverlayManager, useOverlay } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport MemoizedChildren from \"./MemoizedChildren\";\n\nconst SIZES = {\n small: \"small\",\n medium: \"medium\",\n large: \"large\",\n fullScreen: \"fullScreen\",\n};\n\nconst Modal = ({\n size = SIZES.medium,\n isOpen = false,\n onClose = () => {},\n children,\n finalFocusRef,\n initialFocusRef,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n blockScrollOnMount = true,\n closeOnOutsideClick = true,\n forceRender = false,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const modalWrapper = useRef(null);\n const backdropRef = useRef(null);\n\n useOverlayManager(modalWrapper, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n isOpen,\n initialFocusRef,\n finalFocusRef,\n overlayWrapper: modalWrapper,\n onClose,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n blockScrollOnMount,\n hasTransitionCompleted,\n });\n\n const isFullScreenModal = size === SIZES.fullScreen;\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-modal\"\n in={isOpen}\n timeout={300}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"modal-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-modal__backdrop\",\n {\n \"neeto-ui-modal__backdrop--fullscreen\": isFullScreenModal,\n },\n backdropClassName\n )}\n >\n <div\n aria-modal\n key=\"modal-wrapper\"\n ref={modalWrapper}\n role=\"dialog\"\n className={classnames(\"neeto-ui-modal__wrapper\", {\n \"neeto-ui-modal__wrapper--small\": size === SIZES.small,\n \"neeto-ui-modal__wrapper--medium\": size === SIZES.medium,\n \"neeto-ui-modal__wrapper--large\": size === SIZES.large,\n \"neeto-ui-modal__wrapper--fullscreen\": isFullScreenModal,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-modal__close\"\n data-cy=\"modal-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size={isFullScreenModal ? \"large\" : \"small\"}\n style={isFullScreenModal ? \"secondary\" : \"text\"}\n onClick={handleOverlayClose}\n />\n )}\n <MemoizedChildren shouldUpdate={isOpen || forceRender}>\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </MemoizedChildren>\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nModal.propTypes = {\n /**\n * To specify the size of the Modal.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Modal is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the Modal is closed.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Modal component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classNames to the Modal.\n */\n className: PropTypes.string,\n /**\n * To close the Modal on pressing the Esc key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the close button of the Modal should be displayed or not.\n */\n closeButton: PropTypes.bool,\n /**\n * To add custom classes to backdrop component.\n */\n backdropClassName: PropTypes.string,\n /**\n * To close on clicking outside the Modal content.\n */\n closeOnOutsideClick: PropTypes.bool,\n /*\n * To specify the ref of the element which will receive focus when the Modal is closed.\n * If not specified, the focus will be set to the element which was focused when the Modal was opened.\n * If the Modal was opened by clicking on a button, then the focus will be set to the button.\n * */\n finalFocusRef: PropTypes.object,\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 specify the ref of the element which will receive focus when the Modal is opened.\n * If not specified, the focus will be set to the first focusable element inside the Modal.\n * */\n initialFocusRef: PropTypes.object,\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 specify whether the scroll should be blocked when the Modal is opened.\n * */\n blockScrollOnMount: PropTypes.bool,\n /**\n * The modal children will be force re-rendered if the boolean is set to `true`. Ideally the modal won't update\n * if the `isOpen` is `false`. You can use this prop to override that nature.\n */\n forceRender: PropTypes.bool,\n};\n\nModal.Header = Header;\nModal.Body = Body;\nModal.Footer = Footer;\n\nexport default Modal;\n"],"names":["Body","_ref","children","className","dataCy","React","createElement","classnames","Footer","Header","_ref$description","description","Typography","lineHeight","style","MemoizedChildren","memo","_","_ref2","shouldUpdate","displayName","SIZES","small","medium","large","fullScreen","Modal","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","finalFocusRef","initialFocusRef","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$blockScrollOnMou","blockScrollOnMount","_ref$closeOnOutsideCl","closeOnOutsideClick","_ref$forceRender","forceRender","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","modalWrapper","useRef","backdropRef","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","isFullScreenModal","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","role","_defineProperty","Button","icon","Close","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM,CAAA;EAAA,oBACzCC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,SAAS,EAAEI,UAAU,CAAC,sBAAsB,EAAEJ,SAAS,CAAE;AACzD,IAAA,SAAA,EAASC,MAAM,KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAAA,GAANA,MAAM,GAAI,YAAA;AAAa,GAAA,EAE/BF,QAAQ,CACL,CAAA;AAAA,CACP;;ACPD,IAAMM,MAAM,GAAG,SAATA,MAAMA,CAAAP,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM,CAAA;EAAA,oBAC3CC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,SAAS,EAAEI,UAAU,CAAC,wBAAwB,EAAEJ,SAAS,CAAE;AAC3D,IAAA,SAAA,EAASC,MAAM,KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAA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}
|
|
@@ -8,32 +8,32 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
|
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var classnames = require('classnames');
|
|
10
10
|
var ramda = require('ramda');
|
|
11
|
-
var reactSelectCreatable_esm = require('./react-select-creatable.esm-
|
|
12
|
-
var index = require('./index-
|
|
11
|
+
var reactSelectCreatable_esm = require('./react-select-creatable.esm-Bdv9YAMt.js');
|
|
12
|
+
var index = require('./index-CvMjRZDt.js');
|
|
13
13
|
var _toArray = require('@babel/runtime/helpers/toArray');
|
|
14
14
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
15
|
-
require('@babel/runtime/helpers/esm/objectSpread2');
|
|
16
|
-
require('@babel/runtime/helpers/esm/slicedToArray');
|
|
17
|
-
require('@babel/runtime/helpers/esm/objectWithoutProperties');
|
|
18
|
-
require('@babel/runtime/helpers/esm/extends');
|
|
19
|
-
require('@babel/runtime/helpers/objectSpread2');
|
|
20
|
-
require('@babel/runtime/helpers/classCallCheck');
|
|
21
|
-
require('@babel/runtime/helpers/createClass');
|
|
22
|
-
require('@babel/runtime/helpers/inherits');
|
|
23
|
-
require('@babel/runtime/helpers/createSuper');
|
|
24
|
-
require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
25
|
-
require('@babel/runtime/helpers/typeof');
|
|
26
|
-
require('react-dom');
|
|
27
15
|
var Tag = require('./Tag.js');
|
|
28
16
|
var Label = require('./Label.js');
|
|
17
|
+
require('@babel/runtime/helpers/esm/extends');
|
|
18
|
+
require('@babel/runtime/helpers/esm/objectSpread2');
|
|
29
19
|
require('@babel/runtime/helpers/esm/classCallCheck');
|
|
30
20
|
require('@babel/runtime/helpers/esm/createClass');
|
|
31
21
|
require('@babel/runtime/helpers/esm/inherits');
|
|
32
22
|
require('@babel/runtime/helpers/esm/createSuper');
|
|
33
23
|
require('@babel/runtime/helpers/esm/toConsumableArray');
|
|
34
24
|
require('@babel/runtime/helpers/esm/taggedTemplateLiteral');
|
|
25
|
+
require('@babel/runtime/helpers/esm/objectWithoutProperties');
|
|
26
|
+
require('@babel/runtime/helpers/esm/slicedToArray');
|
|
35
27
|
require('@babel/runtime/helpers/esm/typeof');
|
|
36
28
|
require('@babel/runtime/helpers/esm/defineProperty');
|
|
29
|
+
require('react-dom');
|
|
30
|
+
require('@babel/runtime/helpers/objectSpread2');
|
|
31
|
+
require('@babel/runtime/helpers/classCallCheck');
|
|
32
|
+
require('@babel/runtime/helpers/createClass');
|
|
33
|
+
require('@babel/runtime/helpers/inherits');
|
|
34
|
+
require('@babel/runtime/helpers/createSuper');
|
|
35
|
+
require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
36
|
+
require('@babel/runtime/helpers/typeof');
|
|
37
37
|
require('dayjs');
|
|
38
38
|
require('dayjs/plugin/localeData');
|
|
39
39
|
require('dayjs/plugin/timezone');
|
|
@@ -42,7 +42,7 @@ require('dayjs/plugin/weekday');
|
|
|
42
42
|
require('dayjs/plugin/weekOfYear');
|
|
43
43
|
require('@bigbinary/neeto-cist');
|
|
44
44
|
require('qs');
|
|
45
|
-
require('./en-
|
|
45
|
+
require('./en-1dfvTYgC.js');
|
|
46
46
|
require('./Button.js');
|
|
47
47
|
require('react-router-dom');
|
|
48
48
|
require('./Spinner.js');
|
|
@@ -52,21 +52,10 @@ require('tippy.js');
|
|
|
52
52
|
require('./Popover.js');
|
|
53
53
|
require('./Typography.js');
|
|
54
54
|
|
|
55
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
56
|
-
|
|
57
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
58
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
59
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
60
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
61
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
62
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
63
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
64
|
-
var _toArray__default = /*#__PURE__*/_interopDefaultLegacy(_toArray);
|
|
65
|
-
|
|
66
55
|
var _excluded$1 = ["children"],
|
|
67
56
|
_excluded2 = ["children"];
|
|
68
57
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
69
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
|
|
58
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
70
59
|
var STYLES = {
|
|
71
60
|
border: {
|
|
72
61
|
"default": "1px solid rgb(var(--neeto-ui-gray-400))",
|
|
@@ -79,7 +68,7 @@ var STYLES = {
|
|
|
79
68
|
};
|
|
80
69
|
var CustomControl = function CustomControl(_ref) {
|
|
81
70
|
var children = _ref.children,
|
|
82
|
-
props =
|
|
71
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
83
72
|
var getValue = props.getValue;
|
|
84
73
|
var _props$selectProps = props.selectProps,
|
|
85
74
|
isFocused = _props$selectProps.isFocused,
|
|
@@ -102,62 +91,62 @@ var CustomControl = function CustomControl(_ref) {
|
|
|
102
91
|
if (isFocused && !isItemDeleted || isItemAdded) scrollToBottom();
|
|
103
92
|
prevValue.current = value;
|
|
104
93
|
}, [isFocused, value]);
|
|
105
|
-
return /*#__PURE__*/
|
|
94
|
+
return /*#__PURE__*/React.createElement(reactSelectCreatable_esm.components.Control, _extends({}, props, {
|
|
106
95
|
innerProps: _objectSpread$1(_objectSpread$1({}, props.innerProps), {}, {
|
|
107
96
|
ref: controlRef
|
|
108
97
|
})
|
|
109
|
-
}), prefix && /*#__PURE__*/
|
|
98
|
+
}), prefix && /*#__PURE__*/React.createElement("div", {
|
|
110
99
|
className: "neeto-ui-email-input__prefix"
|
|
111
100
|
}, prefix), children);
|
|
112
101
|
};
|
|
113
102
|
var CustomDropdownIndicator = function CustomDropdownIndicator(props) {
|
|
114
103
|
var suffix = props.selectProps.suffix;
|
|
115
|
-
return suffix ? /*#__PURE__*/
|
|
104
|
+
return suffix ? /*#__PURE__*/React.createElement(reactSelectCreatable_esm.components.DropdownIndicator, props, /*#__PURE__*/React.createElement("div", {
|
|
116
105
|
className: "neeto-ui-email-input__suffix"
|
|
117
106
|
}, suffix)) : null;
|
|
118
107
|
};
|
|
119
108
|
var MultiValueRemove = function MultiValueRemove(props) {
|
|
120
|
-
return /*#__PURE__*/
|
|
121
|
-
innerProps: _objectSpread$1(_objectSpread$1({}, props.innerProps), {},
|
|
122
|
-
}), /*#__PURE__*/
|
|
109
|
+
return /*#__PURE__*/React.createElement(reactSelectCreatable_esm.components.MultiValueRemove, _extends({}, props, {
|
|
110
|
+
innerProps: _objectSpread$1(_objectSpread$1({}, props.innerProps), {}, _defineProperty({}, "data-cy", "".concat(index.hyphenize(props.data.label), "-remove-icon")))
|
|
111
|
+
}), /*#__PURE__*/React.createElement(neetoIcons.Close, {
|
|
123
112
|
size: 16
|
|
124
113
|
}));
|
|
125
114
|
};
|
|
126
115
|
var CustomValueContainer = function CustomValueContainer(_ref2) {
|
|
127
116
|
var children = _ref2.children,
|
|
128
|
-
props =
|
|
117
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
129
118
|
var getValue = props.getValue,
|
|
130
119
|
_props$selectProps2 = props.selectProps,
|
|
131
120
|
isFocused = _props$selectProps2.isFocused,
|
|
132
121
|
visibleEmailsCount = _props$selectProps2.visibleEmailsCount,
|
|
133
122
|
isAlwaysExpanded = _props$selectProps2.isAlwaysExpanded;
|
|
134
123
|
var value = getValue();
|
|
135
|
-
var _children =
|
|
124
|
+
var _children = _toArray(children),
|
|
136
125
|
firstChild = _children[0],
|
|
137
126
|
rest = _children.slice(1);
|
|
138
127
|
var shouldCollapse = !isAlwaysExpanded && !isFocused && value.length > visibleEmailsCount;
|
|
139
|
-
return /*#__PURE__*/
|
|
140
|
-
innerProps: _objectSpread$1(_objectSpread$1({}, props.innerProps), {},
|
|
141
|
-
}), shouldCollapse ? firstChild.slice(0, visibleEmailsCount) : firstChild, shouldCollapse && /*#__PURE__*/
|
|
128
|
+
return /*#__PURE__*/React.createElement(reactSelectCreatable_esm.components.ValueContainer, _extends({}, props, {
|
|
129
|
+
innerProps: _objectSpread$1(_objectSpread$1({}, props.innerProps), {}, _defineProperty({}, "data-cy", "multi-email-input-container"))
|
|
130
|
+
}), shouldCollapse ? firstChild.slice(0, visibleEmailsCount) : firstChild, shouldCollapse && /*#__PURE__*/React.createElement(Tag, {
|
|
142
131
|
label: "".concat(value.length - visibleEmailsCount, " more"),
|
|
143
132
|
style: "secondary"
|
|
144
133
|
}), rest);
|
|
145
134
|
};
|
|
146
135
|
var CustomClearIndicator = function CustomClearIndicator(props) {
|
|
147
|
-
return /*#__PURE__*/
|
|
148
|
-
innerProps: _objectSpread$1(_objectSpread$1({}, props.innerProps), {},
|
|
149
|
-
}), /*#__PURE__*/
|
|
136
|
+
return /*#__PURE__*/React.createElement(reactSelectCreatable_esm.components.ClearIndicator, _extends({}, props, {
|
|
137
|
+
innerProps: _objectSpread$1(_objectSpread$1({}, props.innerProps), {}, _defineProperty({}, "data-cy", "clear-all-button"))
|
|
138
|
+
}), /*#__PURE__*/React.createElement(neetoIcons.Close, {
|
|
150
139
|
className: "cursor-pointer",
|
|
151
140
|
size: 16
|
|
152
141
|
}));
|
|
153
142
|
};
|
|
154
143
|
var SelectContainer = function SelectContainer(props) {
|
|
155
|
-
return /*#__PURE__*/
|
|
156
|
-
innerProps: _objectSpread$1(_objectSpread$1({}, props.innerProps), {},
|
|
144
|
+
return /*#__PURE__*/React.createElement(reactSelectCreatable_esm.components.SelectContainer, _extends({}, props, {
|
|
145
|
+
innerProps: _objectSpread$1(_objectSpread$1({}, props.innerProps), {}, _defineProperty({}, "data-cy", "multi-email-select-container"))
|
|
157
146
|
}));
|
|
158
147
|
};
|
|
159
148
|
var Input = function Input(props) {
|
|
160
|
-
return /*#__PURE__*/
|
|
149
|
+
return /*#__PURE__*/React.createElement(reactSelectCreatable_esm.components.Input, _extends({}, props, {
|
|
161
150
|
"data-cy": "email-select-input-field",
|
|
162
151
|
onPaste: function onPaste(e) {
|
|
163
152
|
var clipboardData = e.clipboardData.getData("Text");
|
|
@@ -234,7 +223,7 @@ var renderDefaultText = function renderDefaultText(count) {
|
|
|
234
223
|
|
|
235
224
|
var _excluded = ["label", "placeholder", "helpText", "value", "onChange", "error", "onBlur", "filterInvalidEmails", "counter", "disabled", "maxHeight", "required", "labelProps", "visibleEmailsCount", "isCreateable", "isAlwaysExpanded"];
|
|
236
225
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
237
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
226
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
238
227
|
var MultiEmailInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
239
228
|
var _ref$label = _ref.label,
|
|
240
229
|
label = _ref$label === void 0 ? "Email(s)" : _ref$label,
|
|
@@ -265,17 +254,17 @@ var MultiEmailInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
265
254
|
isCreateable = _ref$isCreateable === void 0 ? true : _ref$isCreateable,
|
|
266
255
|
_ref$isAlwaysExpanded = _ref.isAlwaysExpanded,
|
|
267
256
|
isAlwaysExpanded = _ref$isAlwaysExpanded === void 0 ? false : _ref$isAlwaysExpanded,
|
|
268
|
-
otherProps =
|
|
257
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
269
258
|
var _useState = React.useState(""),
|
|
270
|
-
_useState2 =
|
|
259
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
271
260
|
inputValue = _useState2[0],
|
|
272
261
|
setInputValue = _useState2[1];
|
|
273
262
|
var _useState3 = React.useState(false),
|
|
274
|
-
_useState4 =
|
|
263
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
275
264
|
isFocused = _useState4[0],
|
|
276
265
|
setIsFocused = _useState4[1];
|
|
277
266
|
var _useState5 = React.useState([]),
|
|
278
|
-
_useState6 =
|
|
267
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
279
268
|
duplicateEmails = _useState6[0],
|
|
280
269
|
setDuplicateEmails = _useState6[1];
|
|
281
270
|
var isCounterVisible = !!counter && (!counter.startsFrom || getValidEmailsCount(value) >= counter.startsFrom);
|
|
@@ -290,7 +279,7 @@ var MultiEmailInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
290
279
|
var emails = emailMatches.map(function (email) {
|
|
291
280
|
return formatEmailInputOptions(email);
|
|
292
281
|
});
|
|
293
|
-
var _pruneDuplicates = pruneDuplicates([].concat(
|
|
282
|
+
var _pruneDuplicates = pruneDuplicates([].concat(_toConsumableArray(value), _toConsumableArray(emails))),
|
|
294
283
|
uniqueEmails = _pruneDuplicates.uniqueEmails,
|
|
295
284
|
duplicates = _pruneDuplicates.duplicates;
|
|
296
285
|
onChange(uniqueEmails);
|
|
@@ -320,7 +309,7 @@ var MultiEmailInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
320
309
|
var onCreateOption = function onCreateOption(input) {
|
|
321
310
|
var _otherProps$onCreateO;
|
|
322
311
|
var email = formatEmailInputOptions(input);
|
|
323
|
-
var _pruneDuplicates2 = pruneDuplicates([].concat(
|
|
312
|
+
var _pruneDuplicates2 = pruneDuplicates([].concat(_toConsumableArray(value), [email])),
|
|
324
313
|
uniqueEmails = _pruneDuplicates2.uniqueEmails,
|
|
325
314
|
duplicates = _pruneDuplicates2.duplicates;
|
|
326
315
|
onChange(uniqueEmails);
|
|
@@ -349,24 +338,24 @@ var MultiEmailInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
349
338
|
};
|
|
350
339
|
}
|
|
351
340
|
var isFilterEmailsLinkVisible = !!filterInvalidEmails && value.length > getValidEmailsCount(value);
|
|
352
|
-
return /*#__PURE__*/
|
|
341
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
353
342
|
className: "neeto-ui-input__wrapper neeto-ui-email-input__wrapper"
|
|
354
|
-
}, /*#__PURE__*/
|
|
343
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
355
344
|
className: "neeto-ui-email-input__label-wrapper"
|
|
356
|
-
}, label && /*#__PURE__*/
|
|
345
|
+
}, label && /*#__PURE__*/React.createElement(Label, _extends({
|
|
357
346
|
required: required,
|
|
358
347
|
className: "neeto-ui-email-input__label",
|
|
359
348
|
"data-cy": "".concat(index.hyphenize(label), "-input-label")
|
|
360
|
-
}, labelProps), label), isCounterVisible && /*#__PURE__*/
|
|
349
|
+
}, labelProps), label), isCounterVisible && /*#__PURE__*/React.createElement("p", {
|
|
361
350
|
className: "neeto-ui-email-input__counter",
|
|
362
351
|
"data-cy": "".concat(index.hyphenize(label), "-email-counter")
|
|
363
|
-
}, getValidEmailsCount(value), " ", counter.label ? counter.label : renderDefaultText(getValidEmailsCount(value)))), /*#__PURE__*/
|
|
352
|
+
}, getValidEmailsCount(value), " ", counter.label ? counter.label : renderDefaultText(getValidEmailsCount(value)))), /*#__PURE__*/React.createElement(reactSelectCreatable_esm.CreatableSelect, _extends({
|
|
364
353
|
isMulti: true,
|
|
365
354
|
required: true,
|
|
366
355
|
classNamePrefix: "neeto-ui-react-select",
|
|
367
356
|
components: CUSTOM_COMPONENTS,
|
|
368
357
|
isDisabled: disabled,
|
|
369
|
-
className:
|
|
358
|
+
className: classnames("neeto-ui-react-select__container neeto-ui-react-select__container--medium neeto-ui-email-input__select", {
|
|
370
359
|
"neeto-ui-react-select__container--error": !!error
|
|
371
360
|
}),
|
|
372
361
|
styles: _objectSpread(_objectSpread({}, CUSTOM_STYLES), {}, {
|
|
@@ -395,16 +384,16 @@ var MultiEmailInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
395
384
|
visibleEmailsCount: visibleEmailsCount
|
|
396
385
|
}, !isOptionsPresent && {
|
|
397
386
|
menuIsOpen: false
|
|
398
|
-
}), otherProps), overrideProps))), !!error && /*#__PURE__*/
|
|
387
|
+
}), otherProps), overrideProps))), !!error && /*#__PURE__*/React.createElement("p", {
|
|
399
388
|
className: "neeto-ui-input__error",
|
|
400
389
|
"data-cy": "".concat(index.hyphenize(label), "-input-error")
|
|
401
|
-
}, error, isFilterEmailsLinkVisible && /*#__PURE__*/
|
|
390
|
+
}, error, isFilterEmailsLinkVisible && /*#__PURE__*/React.createElement("span", {
|
|
402
391
|
className: "neeto-ui-font-semibold cursor-pointer",
|
|
403
392
|
onClick: handleFilterEmails
|
|
404
|
-
}, "\xA0", filterInvalidEmails.label ? filterInvalidEmails.label : "Click here to remove invalid emails.")), !!helpText && /*#__PURE__*/
|
|
393
|
+
}, "\xA0", filterInvalidEmails.label ? filterInvalidEmails.label : "Click here to remove invalid emails.")), !!helpText && /*#__PURE__*/React.createElement("p", {
|
|
405
394
|
className: "neeto-ui-input__help-text",
|
|
406
395
|
"data-cy": "".concat(index.hyphenize(label), "-input-help")
|
|
407
|
-
}, helpText), !!duplicateEmails.length && /*#__PURE__*/
|
|
396
|
+
}, helpText), !!duplicateEmails.length && /*#__PURE__*/React.createElement("p", {
|
|
408
397
|
className: "neeto-ui-input__warning",
|
|
409
398
|
"data-cy": "".concat(index.hyphenize(label), "-duplicate-emails-warning")
|
|
410
399
|
}, "Duplicate emails that were removed case insensitively:", " ", duplicateEmails.join(", ")));
|