@bigbinary/neetoui 8.3.29 → 8.3.31
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/Accordion.js +94 -76
- package/dist/Accordion.js.map +1 -1
- package/dist/ActionDropdown.js +29 -32
- package/dist/ActionDropdown.js.map +1 -1
- package/dist/Alert.js +44 -38
- package/dist/Alert.js.map +1 -1
- package/dist/Avatar.js +28 -22
- package/dist/Avatar.js.map +1 -1
- package/dist/Button.js +45 -43
- package/dist/Button.js.map +1 -1
- package/dist/Callout.js +12 -7
- package/dist/Callout.js.map +1 -1
- package/dist/Checkbox.js +35 -28
- package/dist/Checkbox.js.map +1 -1
- package/dist/ColorPicker.js +134 -117
- package/dist/ColorPicker.js.map +1 -1
- package/dist/DatePicker.js +25 -9
- package/dist/DatePicker.js.map +1 -1
- package/dist/Dropdown.js +75 -83
- package/dist/Dropdown.js.map +1 -1
- package/dist/Input.js +82 -70
- package/dist/Input.js.map +1 -1
- package/dist/Kbd.js +13 -7
- package/dist/Kbd.js.map +1 -1
- package/dist/Label.js +59 -40
- package/dist/Label.js.map +1 -1
- package/dist/Modal.js +76 -65
- package/dist/Modal.js.map +1 -1
- package/dist/MultiEmailInput.js +118 -99
- package/dist/MultiEmailInput.js.map +1 -1
- package/dist/NoData.js +55 -39
- package/dist/NoData.js.map +1 -1
- package/dist/Pagination.js +64 -52
- package/dist/Pagination.js.map +1 -1
- package/dist/Pane.js +66 -56
- package/dist/Pane.js.map +1 -1
- package/dist/Popover.js +10 -7
- package/dist/Popover.js.map +1 -1
- package/dist/ProgressBar.js +20 -17
- package/dist/ProgressBar.js.map +1 -1
- package/dist/Radio.js +50 -40
- package/dist/Radio.js.map +1 -1
- package/dist/Select.js +111 -90
- package/dist/Select.js.map +1 -1
- package/dist/Sidebar.js +265 -216
- package/dist/Sidebar.js.map +1 -1
- package/dist/Slider.js +45 -38
- package/dist/Slider.js.map +1 -1
- package/dist/Spinner.js +3 -2
- package/dist/Spinner.js.map +1 -1
- package/dist/Stepper.js +33 -26
- package/dist/Stepper.js.map +1 -1
- package/dist/Switch.js +56 -46
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +17 -11
- package/dist/Tab.js.map +1 -1
- package/dist/Table.js +221 -182
- package/dist/Table.js.map +1 -1
- package/dist/Tag.js +31 -24
- package/dist/Tag.js.map +1 -1
- package/dist/{Textarea-DlEGZFfG.js → Textarea-D1gsiIxm.js} +66 -56
- package/dist/{Textarea-DlEGZFfG.js.map → Textarea-D1gsiIxm.js.map} +1 -1
- package/dist/Textarea.js +4 -4
- package/dist/TimePicker.js +25 -9
- package/dist/TimePicker.js.map +1 -1
- package/dist/Toastr.js +46 -37
- package/dist/Toastr.js.map +1 -1
- package/dist/Tooltip.js +10 -6
- package/dist/Tooltip.js.map +1 -1
- package/dist/TranslationProvider.js +6 -4
- package/dist/TranslationProvider.js.map +1 -1
- package/dist/Tree.js +17 -15
- package/dist/Tree.js.map +1 -1
- package/dist/TreeSelect.js +65 -58
- package/dist/TreeSelect.js.map +1 -1
- package/dist/Typography.js +7 -3
- package/dist/Typography.js.map +1 -1
- package/dist/cjs/Accordion.js +94 -76
- package/dist/cjs/Accordion.js.map +1 -1
- package/dist/cjs/ActionDropdown.js +29 -32
- package/dist/cjs/ActionDropdown.js.map +1 -1
- package/dist/cjs/Alert.js +43 -37
- package/dist/cjs/Alert.js.map +1 -1
- package/dist/cjs/Avatar.js +27 -21
- package/dist/cjs/Avatar.js.map +1 -1
- package/dist/cjs/Button.js +45 -43
- package/dist/cjs/Button.js.map +1 -1
- package/dist/cjs/Callout.js +11 -6
- package/dist/cjs/Callout.js.map +1 -1
- package/dist/cjs/Checkbox.js +34 -27
- package/dist/cjs/Checkbox.js.map +1 -1
- package/dist/cjs/ColorPicker.js +132 -115
- package/dist/cjs/ColorPicker.js.map +1 -1
- package/dist/cjs/DatePicker.js +25 -9
- package/dist/cjs/DatePicker.js.map +1 -1
- package/dist/cjs/Dropdown.js +74 -82
- package/dist/cjs/Dropdown.js.map +1 -1
- package/dist/cjs/Input.js +81 -69
- package/dist/cjs/Input.js.map +1 -1
- package/dist/cjs/Kbd.js +13 -7
- package/dist/cjs/Kbd.js.map +1 -1
- package/dist/cjs/Label.js +59 -40
- package/dist/cjs/Label.js.map +1 -1
- package/dist/cjs/Modal.js +76 -65
- package/dist/cjs/Modal.js.map +1 -1
- package/dist/cjs/MultiEmailInput.js +117 -98
- package/dist/cjs/MultiEmailInput.js.map +1 -1
- package/dist/cjs/NoData.js +55 -39
- package/dist/cjs/NoData.js.map +1 -1
- package/dist/cjs/Pagination.js +63 -51
- package/dist/cjs/Pagination.js.map +1 -1
- package/dist/cjs/Pane.js +65 -55
- package/dist/cjs/Pane.js.map +1 -1
- package/dist/cjs/Popover.js +10 -7
- package/dist/cjs/Popover.js.map +1 -1
- package/dist/cjs/ProgressBar.js +20 -17
- package/dist/cjs/ProgressBar.js.map +1 -1
- package/dist/cjs/Radio.js +49 -39
- package/dist/cjs/Radio.js.map +1 -1
- package/dist/cjs/Select.js +110 -89
- package/dist/cjs/Select.js.map +1 -1
- package/dist/cjs/Sidebar.js +268 -219
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/Slider.js +45 -38
- package/dist/cjs/Slider.js.map +1 -1
- package/dist/cjs/Spinner.js +3 -2
- package/dist/cjs/Spinner.js.map +1 -1
- package/dist/cjs/Stepper.js +33 -26
- package/dist/cjs/Stepper.js.map +1 -1
- package/dist/cjs/Switch.js +55 -45
- package/dist/cjs/Switch.js.map +1 -1
- package/dist/cjs/Tab.js +17 -11
- package/dist/cjs/Tab.js.map +1 -1
- package/dist/cjs/Table.js +224 -185
- package/dist/cjs/Table.js.map +1 -1
- package/dist/cjs/Tag.js +30 -23
- package/dist/cjs/Tag.js.map +1 -1
- package/dist/cjs/{Textarea-CiUKmQHr.js → Textarea-BzBZbgdT.js} +65 -55
- package/dist/cjs/{Textarea-CiUKmQHr.js.map → Textarea-BzBZbgdT.js.map} +1 -1
- package/dist/cjs/Textarea.js +4 -4
- package/dist/cjs/TimePicker.js +25 -9
- package/dist/cjs/TimePicker.js.map +1 -1
- package/dist/cjs/Toastr.js +45 -36
- package/dist/cjs/Toastr.js.map +1 -1
- package/dist/cjs/Tooltip.js +10 -6
- package/dist/cjs/Tooltip.js.map +1 -1
- package/dist/cjs/TranslationProvider.js +5 -3
- package/dist/cjs/TranslationProvider.js.map +1 -1
- package/dist/cjs/Tree.js +17 -15
- package/dist/cjs/Tree.js.map +1 -1
- package/dist/cjs/TreeSelect.js +66 -59
- package/dist/cjs/TreeSelect.js.map +1 -1
- package/dist/cjs/Typography.js +7 -3
- package/dist/cjs/Typography.js.map +1 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/formik/ActionBlock.js +16 -9
- package/dist/cjs/formik/ActionBlock.js.map +1 -1
- package/dist/cjs/formik/BlockNavigation.js +40 -30
- package/dist/cjs/formik/BlockNavigation.js.map +1 -1
- package/dist/cjs/formik/Button.js +5 -3
- package/dist/cjs/formik/Button.js.map +1 -1
- package/dist/cjs/formik/Checkbox.js +29 -28
- package/dist/cjs/formik/Checkbox.js.map +1 -1
- package/dist/cjs/formik/Form.js +53 -47
- package/dist/cjs/formik/Form.js.map +1 -1
- package/dist/cjs/formik/Input.js +27 -26
- package/dist/cjs/formik/Input.js.map +1 -1
- package/dist/cjs/formik/MultiEmailInput.js +10 -6
- package/dist/cjs/formik/MultiEmailInput.js.map +1 -1
- package/dist/cjs/formik/Radio.js +7 -7
- package/dist/cjs/formik/Radio.js.map +1 -1
- package/dist/cjs/formik/Select.js +15 -10
- package/dist/cjs/formik/Select.js.map +1 -1
- package/dist/cjs/formik/Slider.js +7 -7
- package/dist/cjs/formik/Slider.js.map +1 -1
- package/dist/cjs/formik/Switch.js +31 -28
- package/dist/cjs/formik/Switch.js.map +1 -1
- package/dist/cjs/formik/Textarea.js +28 -27
- package/dist/cjs/formik/Textarea.js.map +1 -1
- package/dist/cjs/formik/TreeSelect.js +8 -5
- package/dist/cjs/formik/TreeSelect.js.map +1 -1
- package/dist/cjs/formik/index.js +11 -7
- package/dist/cjs/formik/index.js.map +1 -1
- package/dist/cjs/{index-BQsO_CAs.js → index-Dv40T5Ly.js} +195 -169
- package/dist/cjs/{index-BQsO_CAs.js.map → index-Dv40T5Ly.js.map} +1 -1
- package/dist/cjs/{index--BeRLo6L.js → index-h3QcOeWw.js} +12 -14
- package/dist/cjs/{index--BeRLo6L.js.map → index-h3QcOeWw.js.map} +1 -1
- package/dist/cjs/index.css +1 -2
- package/dist/cjs/index.js +26 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts.js +8 -3
- package/dist/cjs/layouts.js.map +1 -1
- package/dist/cjs/overlayManager.js +1 -2
- package/dist/cjs/overlayManager.js.map +1 -1
- package/dist/cjs/{react-select-creatable.esm-Bdv9YAMt.js → react-select-creatable.esm-lcdODVBz.js} +449 -243
- package/dist/cjs/react-select-creatable.esm-lcdODVBz.js.map +1 -0
- package/dist/cjs/useId-DXHUzdxd.js.map +1 -1
- package/dist/cjs/{useOverlayManager-CxBh9gVG.js → useOverlayManager-Bj58uLfc.js} +14 -9
- package/dist/cjs/{useOverlayManager-CxBh9gVG.js.map → useOverlayManager-Bj58uLfc.js.map} +1 -1
- package/dist/cjs/useQueryParams-BrrbBvY_.js +18 -0
- package/dist/cjs/{useQueryParams-l5fJJYCR.js.map → useQueryParams-BrrbBvY_.js.map} +1 -1
- package/dist/cjs/useRecentlyUsedColors-BcOkiB-v.js +1239 -0
- package/dist/cjs/useRecentlyUsedColors-BcOkiB-v.js.map +1 -0
- package/dist/cjs/useRestoreScrollPosition-DP8SUs19.js +236 -0
- package/dist/cjs/useRestoreScrollPosition-DP8SUs19.js.map +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/formik/ActionBlock.js +16 -9
- package/dist/formik/ActionBlock.js.map +1 -1
- package/dist/formik/BlockNavigation.js +41 -31
- package/dist/formik/BlockNavigation.js.map +1 -1
- package/dist/formik/Button.js +6 -4
- package/dist/formik/Button.js.map +1 -1
- package/dist/formik/Checkbox.js +30 -29
- package/dist/formik/Checkbox.js.map +1 -1
- package/dist/formik/Form.js +54 -48
- package/dist/formik/Form.js.map +1 -1
- package/dist/formik/Input.js +28 -27
- package/dist/formik/Input.js.map +1 -1
- package/dist/formik/MultiEmailInput.js +11 -7
- package/dist/formik/MultiEmailInput.js.map +1 -1
- package/dist/formik/Radio.js +7 -7
- package/dist/formik/Radio.js.map +1 -1
- package/dist/formik/Select.js +17 -12
- package/dist/formik/Select.js.map +1 -1
- package/dist/formik/Slider.js +8 -8
- package/dist/formik/Slider.js.map +1 -1
- package/dist/formik/Switch.js +31 -28
- package/dist/formik/Switch.js.map +1 -1
- package/dist/formik/Textarea.js +29 -28
- package/dist/formik/Textarea.js.map +1 -1
- package/dist/formik/TreeSelect.js +9 -6
- package/dist/formik/TreeSelect.js.map +1 -1
- package/dist/formik/index.js +11 -7
- package/dist/formik/index.js.map +1 -1
- package/dist/{index-Dxaw6gl9.js → index-D6vmwyYl.js} +14 -16
- package/dist/index-D6vmwyYl.js.map +1 -0
- package/dist/{index-C4Jg7ZKa.js → index-D6yXgUQN.js} +196 -170
- package/dist/{index-C4Jg7ZKa.js.map → index-D6yXgUQN.js.map} +1 -1
- package/dist/index.css +1 -2
- package/dist/index.js +26 -10
- package/dist/index.js.map +1 -1
- package/dist/layouts.js +8 -3
- package/dist/layouts.js.map +1 -1
- package/dist/overlayManager.js +1 -2
- package/dist/overlayManager.js.map +1 -1
- package/dist/{react-select-creatable.esm-Dx_vEnyD.js → react-select-creatable.esm-opiJTCqo.js} +450 -244
- package/dist/react-select-creatable.esm-opiJTCqo.js.map +1 -0
- package/dist/useId-Jj9hXm-g.js.map +1 -1
- package/dist/{useOverlayManager-AZIGhUYS.js → useOverlayManager-BzuBvhPZ.js} +14 -9
- package/dist/{useOverlayManager-AZIGhUYS.js.map → useOverlayManager-BzuBvhPZ.js.map} +1 -1
- package/dist/useQueryParams-BKsf4FPY.js +16 -0
- package/dist/{useQueryParams-b60CHFUx.js.map → useQueryParams-BKsf4FPY.js.map} +1 -1
- package/dist/useRecentlyUsedColors-CtvdF-KQ.js +1236 -0
- package/dist/useRecentlyUsedColors-CtvdF-KQ.js.map +1 -0
- package/dist/useRestoreScrollPosition-BVX-mT5c.js +225 -0
- package/dist/useRestoreScrollPosition-BVX-mT5c.js.map +1 -0
- package/package.json +42 -48
- package/dist/cjs/react-select-creatable.esm-Bdv9YAMt.js.map +0 -1
- package/dist/cjs/useQueryParams-l5fJJYCR.js +0 -18
- package/dist/cjs/useRecentlyUsedColors-3cKx-eDH.js +0 -1270
- package/dist/cjs/useRecentlyUsedColors-3cKx-eDH.js.map +0 -1
- package/dist/cjs/useRestoreScrollPosition-PsoENtiB.js +0 -218
- package/dist/cjs/useRestoreScrollPosition-PsoENtiB.js.map +0 -1
- package/dist/index-Dxaw6gl9.js.map +0 -1
- package/dist/react-select-creatable.esm-Dx_vEnyD.js.map +0 -1
- package/dist/useQueryParams-b60CHFUx.js +0 -16
- package/dist/useRecentlyUsedColors-CqUfqfck.js +0 -1267
- package/dist/useRecentlyUsedColors-CqUfqfck.js.map +0 -1
- package/dist/useRestoreScrollPosition-C1NSANQW.js +0 -207
- package/dist/useRestoreScrollPosition-C1NSANQW.js.map +0 -1
- package/src/translations/ar.json +0 -41
- package/src/translations/bg.json +0 -41
- package/src/translations/ca.json +0 -41
- package/src/translations/cs.json +0 -41
- package/src/translations/da.json +0 -41
- package/src/translations/de.json +0 -41
- package/src/translations/en.json +0 -41
- package/src/translations/es-MX.json +0 -41
- package/src/translations/es.json +0 -41
- package/src/translations/et.json +0 -41
- package/src/translations/fi.json +0 -41
- package/src/translations/fil.json +0 -41
- package/src/translations/fr.json +0 -41
- package/src/translations/hi.json +0 -41
- package/src/translations/hr.json +0 -41
- package/src/translations/id.json +0 -41
- package/src/translations/index.js +0 -18
- package/src/translations/it.json +0 -41
- package/src/translations/ja.json +0 -41
- package/src/translations/ko.json +0 -41
- package/src/translations/nl.json +0 -41
- package/src/translations/pl.json +0 -41
- package/src/translations/pt-BR.json +0 -41
- package/src/translations/pt.json +0 -41
- package/src/translations/ro.json +0 -41
- package/src/translations/ru.json +0 -41
- package/src/translations/sk.json +0 -41
- package/src/translations/sl.json +0 -41
- package/src/translations/sv.json +0 -41
- package/src/translations/th.json +0 -41
- package/src/translations/tr.json +0 -41
- package/src/translations/uk.json +0 -41
- package/src/translations/vi.json +0 -41
- package/src/translations/zh-CN.json +0 -41
- package/src/translations/zh-TW.json +0 -41
package/dist/Toastr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toastr.js","sources":["../src/components/Toastr/Toast.jsx","../src/components/Toastr/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport Linkify from \"linkify-react\";\n\nimport { noop } from \"utils\";\n\nconst Toast = ({ type, message, buttonLabel = \"\", onClick = noop }) => (\n <div\n data-cy={`toastr-${type}-container`}\n data-test={`toastr-${type}-container`}\n >\n <Linkify\n options={{\n defaultProtocol: \"https\",\n rel: \"noreferrer\",\n target: \"_blank\",\n }}\n >\n <p>{message}</p>\n </Linkify>\n {buttonLabel && (\n <div className=\"toastr-message-container__btn-wrapper\">\n <button\n className=\"neeto-ui-btn neeto-ui-btn--style-tertiary\"\n data-cy={`toastr-${type}-button`}\n onClick={e => {\n e.stopPropagation();\n onClick();\n }}\n >\n {buttonLabel}\n </button>\n </div>\n )}\n </div>\n);\n\nexport default Toast;\n","import React from \"react\";\n\nimport { t } from \"i18next\";\nimport { CheckCircle, Warning, Info, Close } from \"neetoicons\";\nimport { toast, Slide } from \"react-toastify\";\n\nimport { UniqueArray } from \"utils\";\n\nimport Toast from \"./Toast\";\n\nconst TOAST_CONFIG = {\n autoClose: 3500,\n transition: Slide,\n position: toast.POSITION.BOTTOM_LEFT,\n hideProgressBar: true,\n closeButton: ({ closeToast, ...props }) => (\n <Close\n className=\"neeto-ui-toastr__close-button\"\n color=\"currentColor\"\n data-cy=\"toastr-close-button\"\n size={16}\n onClick={closeToast}\n {...props}\n />\n ),\n role: \"log\",\n className: \"neeto-ui-toastr\",\n};\n\nconst TOAST_ICON = {\n success: (\n <CheckCircle\n className=\"neeto-ui-text-white\"\n data-cy=\"success-toast-icon\"\n data-testid=\"success-toast-icon\"\n />\n ),\n warning: (\n <Warning\n className=\"neeto-ui-text-white\"\n data-cy=\"warning-toast-icon\"\n data-testid=\"warning-toast-icon\"\n />\n ),\n error: (\n <Warning\n className=\"neeto-ui-text-white\"\n data-cy=\"error-toast-icon\"\n data-testid=\"error-toast-icon\"\n />\n ),\n info: (\n <Info\n className=\"neeto-ui-text-white\"\n data-cy=\"info-toast-icon\"\n data-testid=\"info-toast-icon\"\n />\n ),\n};\n\nconst toastrList = new UniqueArray();\n\nconst parseToastrConfig = config => {\n if (typeof config[0] === \"object\") {\n const { buttonLabel, onClick, showIcon, ...customConfig } = config[0];\n\n return { buttonLabel, onClick, showIcon, customConfig };\n }\n const [buttonLabel, onClick, customConfig, showIcon] = config;\n\n return { buttonLabel, onClick, customConfig, showIcon };\n};\n\nconst getToastrMessage = message => {\n if (message?.noticeCode === \"custom_message\" && \"customMessage\" in message) {\n return message.customMessage;\n } else if (message && typeof message === \"object\" && message.noticeCode) {\n return t(message.noticeCode, message);\n } else if (message && typeof message === \"object\" && message.notice) {\n return message.notice;\n }\n\n return message;\n};\n\nconst withUniqueCheck =\n (type, toastFunc) =>\n (message, ...toastrConfig) => {\n message = getToastrMessage(message);\n const {\n buttonLabel,\n onClick,\n showIcon = false,\n customConfig = {},\n } = parseToastrConfig(toastrConfig);\n\n let toastId = null;\n\n if (toastrList.add({ type, message, buttonLabel })) {\n const config = {\n ...TOAST_CONFIG,\n // The false value of the icon was ignored in the implementations before v9.0.2.\n // After 9.0.2, the implementation is such that the icon is rendered as passed in the config.\n // Since the `false` value used to show the default icon set internally, used a function that returns null\n // which solved the problem.\n // PR which addressed this issue: https://github.com/fkhadra/react-toastify/pull/758\n icon: showIcon ? TOAST_ICON[type] : () => null,\n onClose: () => toastrList.remove({ type, message, buttonLabel }),\n ...customConfig,\n };\n\n toastId = toastFunc({ message, buttonLabel, onClick, config });\n }\n\n return toastId;\n };\n\nconst showSuccessToastr = withUniqueCheck(\n \"success\",\n ({ message, buttonLabel, onClick, config }) =>\n toast.success(\n <Toast {...{ buttonLabel, message, onClick }} type=\"success\" />,\n config\n )\n);\n\nconst showInfoToastr = withUniqueCheck(\n \"info\",\n ({ message, buttonLabel, onClick, config }) =>\n toast.info(\n <Toast {...{ buttonLabel, message, onClick }} type=\"info\" />,\n config\n )\n);\n\nconst showWarningToastr = withUniqueCheck(\n \"warning\",\n ({ message, buttonLabel, onClick, config }) =>\n toast.warning(\n <Toast {...{ buttonLabel, message, onClick }} type=\"warning\" />,\n config\n )\n);\n\nconst isError = e => e && e.stack && e.message;\nconst isAxiosError = e => e && typeof e === \"object\" && e.isAxiosError === true;\nconst isString = s => typeof s === \"string\" || s instanceof String;\nconst isArray = a => Array.isArray(a);\nconst isErrorCodeObject = e =>\n typeof e === \"object\" && \"key\" in e && \"context\" in e;\n\nconst errorCodeTranslation = errorCode => {\n if (typeof errorCode === \"string\") {\n return t(errorCode);\n } else if (isErrorCodeObject(errorCode)) {\n return t(errorCode.key, errorCode.context);\n }\n\n return undefined;\n};\n\nconst getErrorMessage = response => {\n const { error = \"\", errors = [], errorCode = \"\", errorCodes = [] } = response;\n\n let errorMessages = \"\";\n\n if (error) errorMessages = error;\n else if (isArray(errors)) errorMessages = errors.join(\"\\n\");\n\n const errorCodeTranslations =\n (errorCode && t(errorCode, response)) ||\n errorCodes?.map(errorCodeTranslation).join(\"\\n\");\n\n if (errorMessages && errorCodeTranslations) {\n return [errorMessages, errorCodeTranslations].join(\"\\n\");\n }\n\n return errorMessages || errorCodeTranslations;\n};\n\nconst withParsedErrorMsg =\n toastrFunc =>\n (errorObject, ...toastrConfig) => {\n let errorMessage;\n\n errorObject = getToastrMessage(errorObject);\n\n const responseData = errorObject?.response?.data || {};\n\n if (\n responseData.noticeCode === \"custom_message\" &&\n \"customMessage\" in responseData\n ) {\n errorMessage = responseData.customMessage;\n } else if (responseData?.noticeCode) {\n const { data } = errorObject.response;\n errorMessage = t(data.noticeCode, data);\n } else if (isAxiosError(errorObject)) {\n errorMessage = getErrorMessage(responseData) || errorObject.message;\n } else if (isError(errorObject)) errorMessage = errorObject.message;\n else if (isString(errorObject)) errorMessage = errorObject;\n else errorMessage = \"Something went wrong.\";\n\n const { buttonLabel, onClick, customConfig, showIcon } =\n parseToastrConfig(toastrConfig);\n\n return toastrFunc(errorMessage, {\n buttonLabel,\n onClick,\n role: \"alert\",\n autoClose: false,\n showIcon,\n ...customConfig,\n });\n };\n\nconst showErrorToastr = withParsedErrorMsg(\n withUniqueCheck(\n \"error\",\n ({ message, buttonLabel, onClick, showIcon, config }) =>\n toast.error(\n <Toast {...{ buttonLabel, message, onClick, showIcon }} type=\"error\" />,\n config\n )\n )\n);\n\nconst Toastr = {\n info: showInfoToastr,\n show: showInfoToastr,\n success: showSuccessToastr,\n error: showErrorToastr,\n warning: showWarningToastr,\n};\n\nexport default Toastr;\n"],"names":["Toast","_ref","type","message","_ref$buttonLabel","buttonLabel","_ref$onClick","onClick","noop","React","createElement","concat","Linkify","options","defaultProtocol","rel","target","className","e","stopPropagation","TOAST_CONFIG","autoClose","transition","Slide","position","toast","POSITION","BOTTOM_LEFT","hideProgressBar","closeButton","closeToast","props","_objectWithoutProperties","_excluded","Close","_extends","color","size","role","TOAST_ICON","success","CheckCircle","warning","Warning","error","info","Info","toastrList","UniqueArray","parseToastrConfig","config","_typeof","_config$","showIcon","customConfig","_excluded2","_config","_slicedToArray","getToastrMessage","noticeCode","customMessage","t","notice","withUniqueCheck","toastFunc","_len","arguments","length","toastrConfig","Array","_key","_parseToastrConfig","_parseToastrConfig$sh","_parseToastrConfig$cu","toastId","add","_objectSpread","icon","onClose","remove","showSuccessToastr","_ref2","showInfoToastr","_ref3","showWarningToastr","_ref4","isError","stack","isAxiosError","isString","s","String","isArray","a","isErrorCodeObject","errorCodeTranslation","errorCode","key","context","undefined","getErrorMessage","response","_response$error","_response$errors","errors","_response$errorCode","_response$errorCodes","errorCodes","errorMessages","join","errorCodeTranslations","map","withParsedErrorMsg","toastrFunc","errorObject","_errorObject","errorMessage","responseData","data","_len2","_key2","_parseToastrConfig2","showErrorToastr","_ref5","Toastr","show"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAMA,KAAK,GAAG,SAARA,KAAKA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IAAAC,gBAAA,GAAAH,IAAA,CAAEI,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,gBAAA;IAAAE,YAAA,GAAAL,IAAA,CAAEM,OAAO;AAAPA,IAAAA,QAAO,GAAAD,YAAA,KAAGE,KAAAA,CAAAA,GAAAA,IAAI,GAAAF,YAAA,CAAA;EAAA,oBAC9DG,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IACE,SAAAC,EAAAA,SAAAA,CAAAA,MAAA,CAAmBT,IAAI,EAAa,YAAA,CAAA;IACpC,WAAAS,EAAAA,SAAAA,CAAAA,MAAA,CAAqBT,IAAI,EAAA,YAAA,CAAA;AAAa,GAAA,eAEtCO,cAAA,CAAAC,aAAA,CAACE,OAAO,EAAA;AACNC,IAAAA,OAAO,EAAE;AACPC,MAAAA,eAAe,EAAE,OAAO;AACxBC,MAAAA,GAAG,EAAE,YAAY;AACjBC,MAAAA,MAAM,EAAE,QAAA;AACV,KAAA;AAAE,GAAA,eAEFP,cAAA,CAAAC,aAAA,CAAA,GAAA,EAAA,IAAA,EAAIP,OAAO,CAAK,CACR,EACTE,WAAW,iBACVI,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKO,IAAA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,EAAAA,KAAK,EAAE8E,eAAe;AACtBhF,EAAAA,OAAO,EAAE0C,iBAAAA;AACX;;;;"}
|
|
1
|
+
{"version":3,"file":"Toastr.js","sources":["../src/components/Toastr/Toast.jsx","../src/components/Toastr/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport Linkify from \"linkify-react\";\n\nimport { noop } from \"utils\";\n\nconst Toast = ({ type, message, buttonLabel = \"\", onClick = noop }) => (\n <div\n data-cy={`toastr-${type}-container`}\n data-test={`toastr-${type}-container`}\n >\n <Linkify\n options={{\n defaultProtocol: \"https\",\n rel: \"noreferrer\",\n target: \"_blank\",\n }}\n >\n <p>{message}</p>\n </Linkify>\n {buttonLabel && (\n <div className=\"toastr-message-container__btn-wrapper\">\n <button\n className=\"neeto-ui-btn neeto-ui-btn--style-tertiary\"\n data-cy={`toastr-${type}-button`}\n onClick={e => {\n e.stopPropagation();\n onClick();\n }}\n >\n {buttonLabel}\n </button>\n </div>\n )}\n </div>\n);\n\nexport default Toast;\n","import React from \"react\";\n\nimport { t } from \"i18next\";\nimport { CheckCircle, Warning, Info, Close } from \"neetoicons\";\nimport { toast, Slide } from \"react-toastify\";\n\nimport { UniqueArray } from \"utils\";\n\nimport Toast from \"./Toast\";\n\nconst TOAST_CONFIG = {\n autoClose: 3500,\n transition: Slide,\n position: toast.POSITION.BOTTOM_LEFT,\n hideProgressBar: true,\n closeButton: ({ closeToast, ...props }) => (\n <Close\n className=\"neeto-ui-toastr__close-button\"\n color=\"currentColor\"\n data-cy=\"toastr-close-button\"\n size={16}\n onClick={closeToast}\n {...props}\n />\n ),\n role: \"log\",\n className: \"neeto-ui-toastr\",\n};\n\nconst TOAST_ICON = {\n success: (\n <CheckCircle\n className=\"neeto-ui-text-white\"\n data-cy=\"success-toast-icon\"\n data-testid=\"success-toast-icon\"\n />\n ),\n warning: (\n <Warning\n className=\"neeto-ui-text-white\"\n data-cy=\"warning-toast-icon\"\n data-testid=\"warning-toast-icon\"\n />\n ),\n error: (\n <Warning\n className=\"neeto-ui-text-white\"\n data-cy=\"error-toast-icon\"\n data-testid=\"error-toast-icon\"\n />\n ),\n info: (\n <Info\n className=\"neeto-ui-text-white\"\n data-cy=\"info-toast-icon\"\n data-testid=\"info-toast-icon\"\n />\n ),\n};\n\nconst toastrList = new UniqueArray();\n\nconst parseToastrConfig = config => {\n if (typeof config[0] === \"object\") {\n const { buttonLabel, onClick, showIcon, ...customConfig } = config[0];\n\n return { buttonLabel, onClick, showIcon, customConfig };\n }\n const [buttonLabel, onClick, customConfig, showIcon] = config;\n\n return { buttonLabel, onClick, customConfig, showIcon };\n};\n\nconst getToastrMessage = message => {\n if (message?.noticeCode === \"custom_message\" && \"customMessage\" in message) {\n return message.customMessage;\n } else if (message && typeof message === \"object\" && message.noticeCode) {\n return t(message.noticeCode, message);\n } else if (message && typeof message === \"object\" && message.notice) {\n return message.notice;\n }\n\n return message;\n};\n\nconst withUniqueCheck =\n (type, toastFunc) =>\n (message, ...toastrConfig) => {\n message = getToastrMessage(message);\n const {\n buttonLabel,\n onClick,\n showIcon = false,\n customConfig = {},\n } = parseToastrConfig(toastrConfig);\n\n let toastId = null;\n\n if (toastrList.add({ type, message, buttonLabel })) {\n const config = {\n ...TOAST_CONFIG,\n // The false value of the icon was ignored in the implementations before v9.0.2.\n // After 9.0.2, the implementation is such that the icon is rendered as passed in the config.\n // Since the `false` value used to show the default icon set internally, used a function that returns null\n // which solved the problem.\n // PR which addressed this issue: https://github.com/fkhadra/react-toastify/pull/758\n icon: showIcon ? TOAST_ICON[type] : () => null,\n onClose: () => toastrList.remove({ type, message, buttonLabel }),\n ...customConfig,\n };\n\n toastId = toastFunc({ message, buttonLabel, onClick, config });\n }\n\n return toastId;\n };\n\nconst showSuccessToastr = withUniqueCheck(\n \"success\",\n ({ message, buttonLabel, onClick, config }) =>\n toast.success(\n <Toast {...{ buttonLabel, message, onClick }} type=\"success\" />,\n config\n )\n);\n\nconst showInfoToastr = withUniqueCheck(\n \"info\",\n ({ message, buttonLabel, onClick, config }) =>\n toast.info(\n <Toast {...{ buttonLabel, message, onClick }} type=\"info\" />,\n config\n )\n);\n\nconst showWarningToastr = withUniqueCheck(\n \"warning\",\n ({ message, buttonLabel, onClick, config }) =>\n toast.warning(\n <Toast {...{ buttonLabel, message, onClick }} type=\"warning\" />,\n config\n )\n);\n\nconst isError = e => e && e.stack && e.message;\nconst isAxiosError = e => e && typeof e === \"object\" && e.isAxiosError === true;\nconst isString = s => typeof s === \"string\" || s instanceof String;\nconst isArray = a => Array.isArray(a);\nconst isErrorCodeObject = e =>\n typeof e === \"object\" && \"key\" in e && \"context\" in e;\n\nconst errorCodeTranslation = errorCode => {\n if (typeof errorCode === \"string\") {\n return t(errorCode);\n } else if (isErrorCodeObject(errorCode)) {\n return t(errorCode.key, errorCode.context);\n }\n\n return undefined;\n};\n\nconst getErrorMessage = response => {\n const { error = \"\", errors = [], errorCode = \"\", errorCodes = [] } = response;\n\n let errorMessages = \"\";\n\n if (error) errorMessages = error;\n else if (isArray(errors)) errorMessages = errors.join(\"\\n\");\n\n const errorCodeTranslations =\n (errorCode && t(errorCode, response)) ||\n errorCodes?.map(errorCodeTranslation).join(\"\\n\");\n\n if (errorMessages && errorCodeTranslations) {\n return [errorMessages, errorCodeTranslations].join(\"\\n\");\n }\n\n return errorMessages || errorCodeTranslations;\n};\n\nconst withParsedErrorMsg =\n toastrFunc =>\n (errorObject, ...toastrConfig) => {\n let errorMessage;\n\n errorObject = getToastrMessage(errorObject);\n\n const responseData = errorObject?.response?.data || {};\n\n if (\n responseData.noticeCode === \"custom_message\" &&\n \"customMessage\" in responseData\n ) {\n errorMessage = responseData.customMessage;\n } else if (responseData?.noticeCode) {\n const { data } = errorObject.response;\n errorMessage = t(data.noticeCode, data);\n } else if (isAxiosError(errorObject)) {\n errorMessage = getErrorMessage(responseData) || errorObject.message;\n } else if (isError(errorObject)) errorMessage = errorObject.message;\n else if (isString(errorObject)) errorMessage = errorObject;\n else errorMessage = \"Something went wrong.\";\n\n const { buttonLabel, onClick, customConfig, showIcon } =\n parseToastrConfig(toastrConfig);\n\n return toastrFunc(errorMessage, {\n buttonLabel,\n onClick,\n role: \"alert\",\n autoClose: false,\n showIcon,\n ...customConfig,\n });\n };\n\nconst showErrorToastr = withParsedErrorMsg(\n withUniqueCheck(\n \"error\",\n ({ message, buttonLabel, onClick, showIcon, config }) =>\n toast.error(\n <Toast {...{ buttonLabel, message, onClick, showIcon }} type=\"error\" />,\n config\n )\n )\n);\n\nconst Toastr = {\n info: showInfoToastr,\n show: showInfoToastr,\n success: showSuccessToastr,\n error: showErrorToastr,\n warning: showWarningToastr,\n};\n\nexport default Toastr;\n"],"names":["Toast","_ref","type","message","_ref$buttonLabel","buttonLabel","_ref$onClick","onClick","noop","_jsxs","concat","children","_jsx","Linkify","options","defaultProtocol","rel","target","className","e","stopPropagation","TOAST_CONFIG","autoClose","transition","Slide","position","toast","POSITION","BOTTOM_LEFT","hideProgressBar","closeButton","closeToast","props","_objectWithoutProperties","_excluded","Close","_objectSpread","color","size","role","TOAST_ICON","success","CheckCircle","warning","Warning","error","info","Info","toastrList","UniqueArray","parseToastrConfig","config","_typeof","_config$","showIcon","customConfig","_excluded2","_config","_slicedToArray","getToastrMessage","noticeCode","customMessage","t","notice","withUniqueCheck","toastFunc","_len","arguments","length","toastrConfig","Array","_key","_parseToastrConfig","_parseToastrConfig$sh","_parseToastrConfig$cu","toastId","add","icon","onClose","remove","showSuccessToastr","_ref2","showInfoToastr","_ref3","showWarningToastr","_ref4","isError","stack","isAxiosError","isString","s","String","isArray","a","isErrorCodeObject","errorCodeTranslation","errorCode","key","context","undefined","getErrorMessage","response","_response$error","_response$errors","errors","_response$errorCode","_response$errorCodes","errorCodes","errorMessages","join","errorCodeTranslations","map","withParsedErrorMsg","toastrFunc","errorObject","_errorObject","_errorObject$response","errorMessage","responseData","data","_len2","_key2","_parseToastrConfig2","showErrorToastr","_ref5","Toastr","show"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAM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pD,IAAAA,IAAI,EAAC;GAAS,CAAC,EACvEiD,MACF,CAAC;AAAA,CACL,CACF,CAAC;AAED,IAAM0E,MAAM,GAAG;AACb/E,EAAAA,IAAI,EAAEoC,cAAc;AACpB4C,EAAAA,IAAI,EAAE5C,cAAc;AACpBzC,EAAAA,OAAO,EAAEuC,iBAAiB;AAC1BnC,EAAAA,KAAK,EAAE8E,eAAe;AACtBhF,EAAAA,OAAO,EAAEyC;AACX;;;;"}
|
package/dist/Tooltip.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
4
|
import React__default, { useState, useEffect } from 'react';
|
|
6
5
|
import Tippy from '@tippyjs/react';
|
|
7
6
|
import { followCursor } from 'tippy.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
var ARROW = "<svg width='12' height='6' viewBox='0 0 10 5' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M10 5H0.926697L3.95208 1.63847C4.74227 0.760478 6.11722 0.754951 6.91445 1.62656L10 5Z' /></svg>";
|
|
10
10
|
|
|
11
11
|
var _excluded = ["content", "children", "theme", "disabled", "position", "interactive", "hideAfter", "hideOnTargetExit"];
|
|
12
|
-
function ownKeys(
|
|
13
|
-
function _objectSpread(
|
|
12
|
+
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; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
var Tooltip = function Tooltip(_ref) {
|
|
15
15
|
var content = _ref.content,
|
|
16
16
|
children = _ref.children,
|
|
@@ -57,9 +57,9 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
57
57
|
var handleCreate = function handleCreate(instance) {
|
|
58
58
|
var _instance$popper$firs;
|
|
59
59
|
setInstance(instance);
|
|
60
|
-
(_instance$popper$firs = instance.popper.firstElementChild) === null || _instance$popper$firs === void 0
|
|
60
|
+
(_instance$popper$firs = instance.popper.firstElementChild) === null || _instance$popper$firs === void 0 ? void 0 : _instance$popper$firs.setAttribute("data-cy", "tooltip-box");
|
|
61
61
|
};
|
|
62
|
-
return /*#__PURE__*/
|
|
62
|
+
return /*#__PURE__*/jsx(Tippy, _objectSpread(_objectSpread({
|
|
63
63
|
animation: "scale-subtle",
|
|
64
64
|
arrow: ARROW,
|
|
65
65
|
duration: [100, 200],
|
|
@@ -73,7 +73,11 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
73
73
|
disabled: disabled,
|
|
74
74
|
interactive: interactive,
|
|
75
75
|
theme: theme
|
|
76
|
-
}, localProps), otherProps)),
|
|
76
|
+
}, localProps), otherProps)), {}, {
|
|
77
|
+
children: /*#__PURE__*/React__default.isValidElement(children) ? children : children && /*#__PURE__*/jsx("span", {
|
|
78
|
+
children: children
|
|
79
|
+
})
|
|
80
|
+
}));
|
|
77
81
|
};
|
|
78
82
|
|
|
79
83
|
export { Tooltip as default };
|
package/dist/Tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../src/components/Tooltip/constants.js","../src/components/Tooltip/index.jsx"],"sourcesContent":["export const ARROW =\n \"<svg width='12' height='6' viewBox='0 0 10 5' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M10 5H0.926697L3.95208 1.63847C4.74227 0.760478 6.11722 0.754951 6.91445 1.62656L10 5Z' /></svg>\";\n","import React, { useEffect, useState } from \"react\";\n\nimport Tippy from \"@tippyjs/react\";\nimport PropTypes from \"prop-types\";\nimport { followCursor } from \"tippy.js\";\n\nimport { ARROW } from \"./constants\";\n\nconst Tooltip = ({\n content,\n children,\n theme = \"dark\",\n disabled = false,\n position = \"auto\",\n interactive = false,\n hideAfter = -1,\n hideOnTargetExit = false,\n ...otherProps\n}) => {\n const [instance, setInstance] = useState(null);\n\n const localProps = {};\n\n if (hideAfter > 0) {\n localProps[\"onShow\"] = instance =>\n setTimeout(\n () => !instance.state?.isDestroyed && instance.hide(),\n hideAfter\n );\n }\n\n useEffect(() => {\n if (hideOnTargetExit) {\n const intersectionObserver = new IntersectionObserver(entries => {\n entries.forEach(entry => !entry.isIntersecting && instance?.hide());\n });\n instance?.reference && intersectionObserver.observe(instance?.reference);\n\n return () => intersectionObserver.disconnect();\n }\n\n return undefined;\n }, [instance, hideOnTargetExit]);\n\n const handleCreate = instance => {\n setInstance(instance);\n instance.popper.firstElementChild?.setAttribute(\"data-cy\", \"tooltip-box\");\n };\n\n return (\n <Tippy\n animation=\"scale-subtle\"\n arrow={ARROW}\n duration={[100, 200]}\n placement={position}\n plugins={[followCursor]}\n role=\"tooltip\"\n zIndex={100001}\n onCreate={handleCreate}\n {...{\n content,\n disabled,\n interactive,\n theme,\n ...localProps,\n ...otherProps,\n }}\n >\n {React.isValidElement(children)\n ? children\n : children && <span>{children}</span>}\n </Tippy>\n );\n};\n\nTooltip.propTypes = {\n /**\n * The component to be rendered inside the popup.\n */\n content: PropTypes.node,\n /**\n * Tooltip popup will be shown when mouse is hovered over this component.\n */\n children: PropTypes.node,\n /**\n * To display Tooltip in dark or light theme. By default the theme is dark.\n */\n theme: PropTypes.oneOf([\"dark\", \"light\"]),\n /**\n * To specify whether the Tooltip is disabled or not.\n */\n disabled: PropTypes.bool,\n /**\n * To specify the position of the Tooltip.\n */\n position: PropTypes.string,\n /**\n * To specify whether the Tooltip can be hovered over and clicked inside without hiding.\n */\n interactive: PropTypes.bool,\n /**\n * To auto-hide the Tooltip after n-milliseconds.\n * Negative values to this prop disables this feature.\n * By default it's disabled.\n */\n hideAfter: PropTypes.number,\n /**\n * To auto-hide the Tooltip on when target leaves the screen.\n * By default it's disabled.\n */\n hideOnTargetExit: PropTypes.bool,\n};\n\nexport default Tooltip;\n"],"names":["ARROW","Tooltip","_ref","content","children","_ref$theme","theme","_ref$disabled","disabled","_ref$position","position","_ref$interactive","interactive","_ref$hideAfter","hideAfter","_ref$hideOnTargetExit","hideOnTargetExit","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","instance","setInstance","localProps","setTimeout","_instance$state","state","isDestroyed","hide","useEffect","intersectionObserver","IntersectionObserver","entries","forEach","entry","isIntersecting","reference","observe","disconnect","undefined","handleCreate","_instance$popper$firs","popper","firstElementChild","setAttribute","
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../src/components/Tooltip/constants.js","../src/components/Tooltip/index.jsx"],"sourcesContent":["export const ARROW =\n \"<svg width='12' height='6' viewBox='0 0 10 5' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M10 5H0.926697L3.95208 1.63847C4.74227 0.760478 6.11722 0.754951 6.91445 1.62656L10 5Z' /></svg>\";\n","import React, { useEffect, useState } from \"react\";\n\nimport Tippy from \"@tippyjs/react\";\nimport PropTypes from \"prop-types\";\nimport { followCursor } from \"tippy.js\";\n\nimport { ARROW } from \"./constants\";\n\nconst Tooltip = ({\n content,\n children,\n theme = \"dark\",\n disabled = false,\n position = \"auto\",\n interactive = false,\n hideAfter = -1,\n hideOnTargetExit = false,\n ...otherProps\n}) => {\n const [instance, setInstance] = useState(null);\n\n const localProps = {};\n\n if (hideAfter > 0) {\n localProps[\"onShow\"] = instance =>\n setTimeout(\n () => !instance.state?.isDestroyed && instance.hide(),\n hideAfter\n );\n }\n\n useEffect(() => {\n if (hideOnTargetExit) {\n const intersectionObserver = new IntersectionObserver(entries => {\n entries.forEach(entry => !entry.isIntersecting && instance?.hide());\n });\n instance?.reference && intersectionObserver.observe(instance?.reference);\n\n return () => intersectionObserver.disconnect();\n }\n\n return undefined;\n }, [instance, hideOnTargetExit]);\n\n const handleCreate = instance => {\n setInstance(instance);\n instance.popper.firstElementChild?.setAttribute(\"data-cy\", \"tooltip-box\");\n };\n\n return (\n <Tippy\n animation=\"scale-subtle\"\n arrow={ARROW}\n duration={[100, 200]}\n placement={position}\n plugins={[followCursor]}\n role=\"tooltip\"\n zIndex={100001}\n onCreate={handleCreate}\n {...{\n content,\n disabled,\n interactive,\n theme,\n ...localProps,\n ...otherProps,\n }}\n >\n {React.isValidElement(children)\n ? children\n : children && <span>{children}</span>}\n </Tippy>\n );\n};\n\nTooltip.propTypes = {\n /**\n * The component to be rendered inside the popup.\n */\n content: PropTypes.node,\n /**\n * Tooltip popup will be shown when mouse is hovered over this component.\n */\n children: PropTypes.node,\n /**\n * To display Tooltip in dark or light theme. By default the theme is dark.\n */\n theme: PropTypes.oneOf([\"dark\", \"light\"]),\n /**\n * To specify whether the Tooltip is disabled or not.\n */\n disabled: PropTypes.bool,\n /**\n * To specify the position of the Tooltip.\n */\n position: PropTypes.string,\n /**\n * To specify whether the Tooltip can be hovered over and clicked inside without hiding.\n */\n interactive: PropTypes.bool,\n /**\n * To auto-hide the Tooltip after n-milliseconds.\n * Negative values to this prop disables this feature.\n * By default it's disabled.\n */\n hideAfter: PropTypes.number,\n /**\n * To auto-hide the Tooltip on when target leaves the screen.\n * By default it's disabled.\n */\n hideOnTargetExit: PropTypes.bool,\n};\n\nexport default Tooltip;\n"],"names":["ARROW","Tooltip","_ref","content","children","_ref$theme","theme","_ref$disabled","disabled","_ref$position","position","_ref$interactive","interactive","_ref$hideAfter","hideAfter","_ref$hideOnTargetExit","hideOnTargetExit","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","instance","setInstance","localProps","setTimeout","_instance$state","state","isDestroyed","hide","useEffect","intersectionObserver","IntersectionObserver","entries","forEach","entry","isIntersecting","reference","observe","disconnect","undefined","handleCreate","_instance$popper$firs","popper","firstElementChild","setAttribute","_jsx","Tippy","_objectSpread","animation","arrow","duration","placement","plugins","followCursor","role","zIndex","onCreate","React","isValidElement"],"mappings":";;;;;;;;AAAO,IAAMA,KAAK,GAChB,wMAAwM;;;;;ACO1M,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAUP;AAAA,EAAA,IATJC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAAC,UAAA,GAAAH,IAAA,CACRI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,MAAM,GAAAA,UAAA;IAAAE,aAAA,GAAAL,IAAA,CACdM,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,aAAA;IAAAE,aAAA,GAAAP,IAAA,CAChBQ,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAA,MAAA,GAAG,MAAM,GAAAA,aAAA;IAAAE,gBAAA,GAAAT,IAAA,CACjBU,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,gBAAA;IAAAE,cAAA,GAAAX,IAAA,CACnBY,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IAAAE,qBAAA,GAAAb,IAAA,CACdc,gBAAgB;AAAhBA,IAAAA,gBAAgB,GAAAD,qBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,qBAAA;AACrBE,IAAAA,UAAU,GAAAC,wBAAA,CAAAhB,IAAA,EAAAiB,SAAA,CAAA;AAEb,EAAA,IAAAC,SAAA,GAA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C,CAAC;AAEZ;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
import { initReactI18next, I18nextProvider } from 'react-i18next';
|
|
3
3
|
import i18n from 'i18next';
|
|
4
4
|
import { e as enTranslations } from './en-CIkXIYyl.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
6
|
|
|
6
7
|
var neetoui$5 = {
|
|
7
8
|
blockNavigation: {
|
|
@@ -310,9 +311,10 @@ var TranslationProvider = function TranslationProvider(_ref) {
|
|
|
310
311
|
if (!language || i18n.language === language) return;
|
|
311
312
|
i18n.changeLanguage(language);
|
|
312
313
|
}, [language]);
|
|
313
|
-
return /*#__PURE__*/
|
|
314
|
-
i18n: i18n
|
|
315
|
-
|
|
314
|
+
return /*#__PURE__*/jsx(I18nextProvider, {
|
|
315
|
+
i18n: i18n,
|
|
316
|
+
children: children
|
|
317
|
+
});
|
|
316
318
|
};
|
|
317
319
|
|
|
318
320
|
export { TranslationProvider as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslationProvider.js","sources":["../src/translations/index.js","../src/components/TranslationProvider/i18n.js","../src/components/TranslationProvider/index.jsx"],"sourcesContent":["/* eslint-disable import/extensions */\nimport deTranslations from \"./de.json\";\nimport enTranslations from \"./en.json\";\nimport esTranslations from \"./es.json\";\nimport frTranslations from \"./fr.json\";\nimport nlTranslations from \"./nl.json\";\nimport plTranslations from \"./pl.json\";\nimport ptTranslations from \"./pt.json\";\n\nexport const resources = {\n en: { translation: enTranslations },\n es: { translation: esTranslations },\n fr: { translation: frTranslations },\n de: { translation: deTranslations },\n nl: { translation: nlTranslations },\n pl: { translation: plTranslations },\n pt: { translation: ptTranslations },\n};\n","/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */\n/* eslint-disable import/extensions */\n\nimport i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\n\nimport { resources } from \"src/translations\";\n\nexport const initializeI18n = (language = \"en\") => {\n i18n.use(initReactI18next).init({\n resources,\n lang: language,\n fallbackLng: \"en\",\n interpolation: { escapeValue: false },\n });\n\n return i18n;\n};\n","import React, { useEffect } from \"react\";\n\nimport { I18nextProvider } from \"react-i18next\";\n\nimport { initializeI18n } from \"./i18n\";\n\nconst TranslationProvider = ({ children, language }) => {\n const i18n = initializeI18n(language);\n\n useEffect(() => {\n if (!language || i18n.language === language) return;\n\n i18n.changeLanguage(language);\n }, [language]);\n\n return <I18nextProvider {...{ i18n }}>{children}</I18nextProvider>;\n};\n\nexport default TranslationProvider;\n"],"names":["resources","en","translation","enTranslations","es","esTranslations","fr","frTranslations","de","deTranslations","nl","nlTranslations","pl","plTranslations","pt","ptTranslations","initializeI18n","language","arguments","length","undefined","i18n","use","initReactI18next","init","lang","fallbackLng","interpolation","escapeValue","TranslationProvider","_ref","children","useEffect","changeLanguage","
|
|
1
|
+
{"version":3,"file":"TranslationProvider.js","sources":["../src/translations/index.js","../src/components/TranslationProvider/i18n.js","../src/components/TranslationProvider/index.jsx"],"sourcesContent":["/* eslint-disable import/extensions */\nimport deTranslations from \"./de.json\";\nimport enTranslations from \"./en.json\";\nimport esTranslations from \"./es.json\";\nimport frTranslations from \"./fr.json\";\nimport nlTranslations from \"./nl.json\";\nimport plTranslations from \"./pl.json\";\nimport ptTranslations from \"./pt.json\";\n\nexport const resources = {\n en: { translation: enTranslations },\n es: { translation: esTranslations },\n fr: { translation: frTranslations },\n de: { translation: deTranslations },\n nl: { translation: nlTranslations },\n pl: { translation: plTranslations },\n pt: { translation: ptTranslations },\n};\n","/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */\n/* eslint-disable import/extensions */\n\nimport i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\n\nimport { resources } from \"src/translations\";\n\nexport const initializeI18n = (language = \"en\") => {\n i18n.use(initReactI18next).init({\n resources,\n lang: language,\n fallbackLng: \"en\",\n interpolation: { escapeValue: false },\n });\n\n return i18n;\n};\n","import React, { useEffect } from \"react\";\n\nimport { I18nextProvider } from \"react-i18next\";\n\nimport { initializeI18n } from \"./i18n\";\n\nconst TranslationProvider = ({ children, language }) => {\n const i18n = initializeI18n(language);\n\n useEffect(() => {\n if (!language || i18n.language === language) return;\n\n i18n.changeLanguage(language);\n }, [language]);\n\n return <I18nextProvider {...{ i18n }}>{children}</I18nextProvider>;\n};\n\nexport default TranslationProvider;\n"],"names":["resources","en","translation","enTranslations","es","esTranslations","fr","frTranslations","de","deTranslations","nl","nlTranslations","pl","plTranslations","pt","ptTranslations","initializeI18n","language","arguments","length","undefined","i18n","use","initReactI18next","init","lang","fallbackLng","interpolation","escapeValue","TranslationProvider","_ref","children","useEffect","changeLanguage","_jsx","I18nextProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AASO,IAAMA,SAAS,GAAG;AACvBC,EAAAA,EAAE,EAAE;AAAEC,IAAAA,WAAW,EAAEC;GAAgB;AACnCC,EAAAA,EAAE,EAAE;AAAEF,IAAAA,WAAW,EAAEG;GAAgB;AACnCC,EAAAA,EAAE,EAAE;AAAEJ,IAAAA,WAAW,EAAEK;GAAgB;AACnCC,EAAAA,EAAE,EAAE;AAAEN,IAAAA,WAAW,EAAEO;GAAgB;AACnCC,EAAAA,EAAE,EAAE;AAAER,IAAAA,WAAW,EAAES;GAAgB;AACnCC,EAAAA,EAAE,EAAE;AAAEV,IAAAA,WAAW,EAAEW;GAAgB;AACnCC,EAAAA,EAAE,EAAE;AAAEZ,IAAA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
import _extends from '@babel/runtime/helpers/extends';
|
|
4
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
|
-
import
|
|
5
|
+
import 'react';
|
|
7
6
|
import classnames from 'classnames';
|
|
8
7
|
import { useTranslation } from 'react-i18next';
|
|
9
8
|
import { ANTD_LOCALE } from './constants.js';
|
|
10
|
-
import { A as ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from './index-
|
|
11
|
-
import
|
|
9
|
+
import { A as ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from './index-D6vmwyYl.js';
|
|
10
|
+
import Down from '@bigbinary/neeto-icons/Down';
|
|
11
|
+
import Right from '@bigbinary/neeto-icons/Right';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
13
|
import 'antd/locale/de_DE';
|
|
13
14
|
import 'antd/locale/en_US';
|
|
14
15
|
import 'antd/locale/es_ES';
|
|
@@ -32,24 +33,24 @@ import 'dayjs/plugin/weekOfYear';
|
|
|
32
33
|
|
|
33
34
|
var SwitcherIcon = function SwitcherIcon(_ref) {
|
|
34
35
|
var expanded = _ref.expanded;
|
|
35
|
-
return expanded ? /*#__PURE__*/
|
|
36
|
+
return expanded ? /*#__PURE__*/jsx(Down, {
|
|
36
37
|
className: "neeto-ui-relative",
|
|
37
38
|
size: 16
|
|
38
|
-
}) : /*#__PURE__*/
|
|
39
|
+
}) : /*#__PURE__*/jsx(Right, {
|
|
39
40
|
className: "neeto-ui-relative",
|
|
40
41
|
size: 16
|
|
41
42
|
});
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
var _excluded = ["componentToken"];
|
|
45
|
-
function ownKeys(
|
|
46
|
-
function _objectSpread(
|
|
46
|
+
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; }
|
|
47
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
47
48
|
var Tree = function Tree(_ref) {
|
|
48
49
|
var componentToken = _ref.componentToken,
|
|
49
50
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
50
51
|
var _useTranslation = useTranslation(),
|
|
51
52
|
i18n = _useTranslation.i18n;
|
|
52
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/jsx(_ConfigProvider, {
|
|
53
54
|
locale: ANTD_LOCALE[i18n.language || "en"],
|
|
54
55
|
theme: {
|
|
55
56
|
token: _objectSpread({}, ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES),
|
|
@@ -61,12 +62,13 @@ var Tree = function Tree(_ref) {
|
|
|
61
62
|
nodeSelectedBg: "rgb(var(--neeto-ui-primary-100))"
|
|
62
63
|
}, componentToken)
|
|
63
64
|
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
},
|
|
66
|
+
children: /*#__PURE__*/jsx(_Tree, _objectSpread(_objectSpread({
|
|
67
|
+
switcherIcon: SwitcherIcon
|
|
68
|
+
}, props), {}, {
|
|
69
|
+
className: classnames("neeto-ui-tree", props.className)
|
|
70
|
+
}))
|
|
71
|
+
});
|
|
70
72
|
};
|
|
71
73
|
|
|
72
74
|
export { Tree as default };
|
package/dist/Tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.js","sources":["../src/components/Tree/SwitcherIcon.jsx","../src/components/Tree/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { Down, Right } from \"neetoicons\";\n\nconst SwitcherIcon = ({ expanded }) =>\n expanded ? (\n <Down className=\"neeto-ui-relative\" size={16} />\n ) : (\n <Right className=\"neeto-ui-relative\" size={16} />\n );\n\nexport default SwitcherIcon;\n","import React from \"react\";\n\nimport { ConfigProvider, Tree as TreeComponent } from \"antd\";\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANTD_LOCALE } from \"components/constants\";\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from \"utils\";\n\nimport SwitcherIcon from \"./SwitcherIcon\";\n\nconst Tree = ({ componentToken, ...props }) => {\n const { i18n } = useTranslation();\n\n return (\n <ConfigProvider\n locale={ANTD_LOCALE[i18n.language || \"en\"]}\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n Tree: {\n directoryNodeSelectedBg: \"rgb(var(--neeto-ui-primary-500))\",\n directoryNodeSelectedColor: \"rgb(var(--neeto-ui-white))\",\n nodeHoverBg: \"rgb(var(--neeto-ui-gray-100))\",\n nodeSelectedBg: \"rgb(var(--neeto-ui-primary-100))\",\n ...componentToken,\n },\n },\n }}\n >\n <TreeComponent\n switcherIcon={SwitcherIcon}\n {...props}\n className={classnames(\"neeto-ui-tree\", props.className)}\n />\n </ConfigProvider>\n );\n};\n\nTree.propTypes = {\n /**\n * Whether to allow dropping on the node\n */\n allowDrop: PropTypes.bool,\n /**\n * Whether to automatically expand a parent treeNode\n */\n autoExpandParent: PropTypes.bool,\n /**\n * Whether treeNode fill remaining horizontal space\n */\n blockNode: PropTypes.bool,\n /**\n * Add a Checkbox before the treeNodes.\n */\n checkable: PropTypes.bool,\n /**\n * Specifies the keys of the checked treeNodes\n */\n checkedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Check treeNode precisely; parent treeNode and children treeNodes are not associated\n */\n checkStrictly: PropTypes.bool,\n /**\n * Specifies the keys of the default checked treeNodes.\n */\n defaultCheckedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Specify the keys of the default expanded treeNodes.\n */\n defaultExpandedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Specifies the keys of the default selected treeNodes.\n */\n defaultSelectedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Callback function for when the onCheck event occurs.\n */\n onCheck: PropTypes.func,\n /**\n * Whether disabled the tree\n */\n disabled: PropTypes.bool,\n /**\n * The treeNodes data Array, if set it then you need not to construct children TreeNode. (key should be unique across the whole array).\n */\n treeData: PropTypes.array,\n /**\n * Callback function for when the user clicks a treeNode.\n */\n onSelect: PropTypes.func,\n /**\n * Shows a connecting line.\n */\n showLine: PropTypes.bool,\n /**\n * Config virtual scroll height. Will not support horizontal scroll when enable this.\n */\n height: PropTypes.number,\n /**\n * Specifies whether this Tree or the node is draggable.\n */\n draggable: PropTypes.bool,\n /**\n * Object to override default theme styles for the component\n */\n componentToken: PropTypes.object,\n /**\n * Callback function for when the onDragEnter event occurs\n */\n onDragEnter: PropTypes.func,\n /**\n * Callback function for when the onDragStart event occurs\n */\n onDragStart: PropTypes.func,\n /**\n * Callback function for when the onDragEnter event occurs\n */\n onDragEnd: PropTypes.func,\n /**\n * Callback function for when the onDragLeave event occurs\n */\n onDragLeave: PropTypes.func,\n /**\n * Callback function for when the onDragOver event occurs\n */\n onDragOver: PropTypes.func,\n /**\n * Callback function for when the onDrop event occurs\n */\n onDrop: PropTypes.func,\n /**\n * Defines a function to filter (highlight) treeNodes. When the function returns true, the corresponding treeNode will be highlighted\n */\n filterTreeNode: PropTypes.func,\n /**\n * Load data asynchronously\n */\n loadData: PropTypes.func,\n /**\n * Set loaded tree nodes. Need work with loadData\n */\n loadedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Whether can be selected\n */\n selectable: PropTypes.bool,\n /**\n * Specifies the keys of the selected treeNodes, multiple selection needs to set multiple to true\n */\n selectedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Allows selecting multiple treeNodes\n */\n multiple: PropTypes.bool,\n /**\n * Customize tree node title render\n */\n titleRender: PropTypes.func,\n /**\n * Disable virtual scroll when set to false\n */\n virtual: PropTypes.bool,\n /**\n * Callback function for when a treeNode is expanded or collapsed\n */\n onExpand: PropTypes.func,\n /**\n * Callback function for when a treeNode is loaded\n */\n onLoad: PropTypes.func,\n /**\n * Customize collapse/expand icon of tree node\n */\n switcherIcon: PropTypes.node,\n};\n\nexport default Tree;\n"],"names":["SwitcherIcon","_ref","expanded","
|
|
1
|
+
{"version":3,"file":"Tree.js","sources":["../src/components/Tree/SwitcherIcon.jsx","../src/components/Tree/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { Down, Right } from \"neetoicons\";\n\nconst SwitcherIcon = ({ expanded }) =>\n expanded ? (\n <Down className=\"neeto-ui-relative\" size={16} />\n ) : (\n <Right className=\"neeto-ui-relative\" size={16} />\n );\n\nexport default SwitcherIcon;\n","import React from \"react\";\n\nimport { ConfigProvider, Tree as TreeComponent } from \"antd\";\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANTD_LOCALE } from \"components/constants\";\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from \"utils\";\n\nimport SwitcherIcon from \"./SwitcherIcon\";\n\nconst Tree = ({ componentToken, ...props }) => {\n const { i18n } = useTranslation();\n\n return (\n <ConfigProvider\n locale={ANTD_LOCALE[i18n.language || \"en\"]}\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n Tree: {\n directoryNodeSelectedBg: \"rgb(var(--neeto-ui-primary-500))\",\n directoryNodeSelectedColor: \"rgb(var(--neeto-ui-white))\",\n nodeHoverBg: \"rgb(var(--neeto-ui-gray-100))\",\n nodeSelectedBg: \"rgb(var(--neeto-ui-primary-100))\",\n ...componentToken,\n },\n },\n }}\n >\n <TreeComponent\n switcherIcon={SwitcherIcon}\n {...props}\n className={classnames(\"neeto-ui-tree\", props.className)}\n />\n </ConfigProvider>\n );\n};\n\nTree.propTypes = {\n /**\n * Whether to allow dropping on the node\n */\n allowDrop: PropTypes.bool,\n /**\n * Whether to automatically expand a parent treeNode\n */\n autoExpandParent: PropTypes.bool,\n /**\n * Whether treeNode fill remaining horizontal space\n */\n blockNode: PropTypes.bool,\n /**\n * Add a Checkbox before the treeNodes.\n */\n checkable: PropTypes.bool,\n /**\n * Specifies the keys of the checked treeNodes\n */\n checkedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Check treeNode precisely; parent treeNode and children treeNodes are not associated\n */\n checkStrictly: PropTypes.bool,\n /**\n * Specifies the keys of the default checked treeNodes.\n */\n defaultCheckedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Specify the keys of the default expanded treeNodes.\n */\n defaultExpandedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Specifies the keys of the default selected treeNodes.\n */\n defaultSelectedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Callback function for when the onCheck event occurs.\n */\n onCheck: PropTypes.func,\n /**\n * Whether disabled the tree\n */\n disabled: PropTypes.bool,\n /**\n * The treeNodes data Array, if set it then you need not to construct children TreeNode. (key should be unique across the whole array).\n */\n treeData: PropTypes.array,\n /**\n * Callback function for when the user clicks a treeNode.\n */\n onSelect: PropTypes.func,\n /**\n * Shows a connecting line.\n */\n showLine: PropTypes.bool,\n /**\n * Config virtual scroll height. Will not support horizontal scroll when enable this.\n */\n height: PropTypes.number,\n /**\n * Specifies whether this Tree or the node is draggable.\n */\n draggable: PropTypes.bool,\n /**\n * Object to override default theme styles for the component\n */\n componentToken: PropTypes.object,\n /**\n * Callback function for when the onDragEnter event occurs\n */\n onDragEnter: PropTypes.func,\n /**\n * Callback function for when the onDragStart event occurs\n */\n onDragStart: PropTypes.func,\n /**\n * Callback function for when the onDragEnter event occurs\n */\n onDragEnd: PropTypes.func,\n /**\n * Callback function for when the onDragLeave event occurs\n */\n onDragLeave: PropTypes.func,\n /**\n * Callback function for when the onDragOver event occurs\n */\n onDragOver: PropTypes.func,\n /**\n * Callback function for when the onDrop event occurs\n */\n onDrop: PropTypes.func,\n /**\n * Defines a function to filter (highlight) treeNodes. When the function returns true, the corresponding treeNode will be highlighted\n */\n filterTreeNode: PropTypes.func,\n /**\n * Load data asynchronously\n */\n loadData: PropTypes.func,\n /**\n * Set loaded tree nodes. Need work with loadData\n */\n loadedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Whether can be selected\n */\n selectable: PropTypes.bool,\n /**\n * Specifies the keys of the selected treeNodes, multiple selection needs to set multiple to true\n */\n selectedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Allows selecting multiple treeNodes\n */\n multiple: PropTypes.bool,\n /**\n * Customize tree node title render\n */\n titleRender: PropTypes.func,\n /**\n * Disable virtual scroll when set to false\n */\n virtual: PropTypes.bool,\n /**\n * Callback function for when a treeNode is expanded or collapsed\n */\n onExpand: PropTypes.func,\n /**\n * Callback function for when a treeNode is loaded\n */\n onLoad: PropTypes.func,\n /**\n * Customize collapse/expand icon of tree node\n */\n switcherIcon: PropTypes.node,\n};\n\nexport default Tree;\n"],"names":["SwitcherIcon","_ref","expanded","_jsx","Down","className","size","Right","Tree","componentToken","props","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","i18n","_ConfigProvider","locale","ANTD_LOCALE","language","theme","token","_objectSpread","ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES","components","directoryNodeSelectedBg","directoryNodeSelectedColor","nodeHoverBg","nodeSelectedBg","children","_Tree","switcherIcon","classnames"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;AAAA,EAAA,OAC9BA,QAAQ,gBACNC,GAAA,CAACC,IAAI,EAAA;AAACC,IAA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|
|
|
1
1
|
import _ConfigProvider from 'antd/lib/config-provider';
|
|
2
2
|
import _TreeSelect from 'antd/lib/tree-select';
|
|
3
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
4
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
|
-
import
|
|
5
|
+
import { forwardRef } from 'react';
|
|
7
6
|
import classnames from 'classnames';
|
|
8
|
-
import
|
|
7
|
+
import Down from '@bigbinary/neeto-icons/Down';
|
|
9
8
|
import { useTranslation } from 'react-i18next';
|
|
10
|
-
import { g as getLocale, A as ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from './index-
|
|
9
|
+
import { g as getLocale, A as ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from './index-D6vmwyYl.js';
|
|
11
10
|
import { ANTD_LOCALE } from './constants.js';
|
|
12
11
|
import Label from './Label.js';
|
|
12
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
13
|
import '@babel/runtime/helpers/slicedToArray';
|
|
14
14
|
import '@babel/runtime/helpers/classCallCheck';
|
|
15
15
|
import '@babel/runtime/helpers/createClass';
|
|
@@ -30,6 +30,7 @@ import 'antd/locale/fr_FR';
|
|
|
30
30
|
import 'antd/locale/nl_NL';
|
|
31
31
|
import 'antd/locale/pl_PL';
|
|
32
32
|
import 'antd/locale/pt_PT';
|
|
33
|
+
import '@bigbinary/neeto-icons/Help';
|
|
33
34
|
import './Button.js';
|
|
34
35
|
import 'react-router-dom';
|
|
35
36
|
import './Spinner.js';
|
|
@@ -40,8 +41,8 @@ import './Popover.js';
|
|
|
40
41
|
import './Typography.js';
|
|
41
42
|
|
|
42
43
|
var _excluded = ["allowClear", "className", "disabled", "error", "fieldNames", "label", "onChange", "placeholder", "required", "showSearch", "size", "suffixIcon", "switcherIcon", "treeData", "treeDataSimpleMode", "value", "popupClassName"];
|
|
43
|
-
function ownKeys(
|
|
44
|
-
function _objectSpread(
|
|
44
|
+
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; }
|
|
45
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
45
46
|
var TreeSelect = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
46
47
|
var _fieldNames$label;
|
|
47
48
|
var allowClear = _ref.allowClear,
|
|
@@ -74,7 +75,7 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
74
75
|
i18n = _useTranslation.i18n;
|
|
75
76
|
var SuffixIcon = suffixIcon !== null && suffixIcon !== void 0 ? suffixIcon : Down;
|
|
76
77
|
var SwitcherIcon = switcherIcon !== null && switcherIcon !== void 0 ? switcherIcon : Down;
|
|
77
|
-
return /*#__PURE__*/
|
|
78
|
+
return /*#__PURE__*/jsx(_ConfigProvider, {
|
|
78
79
|
locale: ANTD_LOCALE[i18n.language || "en"],
|
|
79
80
|
theme: {
|
|
80
81
|
token: _objectSpread({}, ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES),
|
|
@@ -86,58 +87,64 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
86
87
|
colorBgElevated: "rgb(var(--neeto-ui-white))"
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
|
-
}
|
|
90
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
91
|
-
className: "neeto-ui-input__wrapper"
|
|
92
|
-
}, label && /*#__PURE__*/React__default.createElement(Label, {
|
|
93
|
-
required: required,
|
|
94
|
-
"data-testid": "treeselect-label"
|
|
95
|
-
}, label), /*#__PURE__*/React__default.createElement(_TreeSelect, _extends({
|
|
96
|
-
allowClear: allowClear,
|
|
97
|
-
disabled: disabled,
|
|
98
|
-
fieldNames: fieldNames,
|
|
99
|
-
onChange: onChange,
|
|
100
|
-
placeholder: placeholder,
|
|
101
|
-
ref: ref,
|
|
102
|
-
showSearch: showSearch,
|
|
103
|
-
size: size,
|
|
104
|
-
treeData: treeData,
|
|
105
|
-
treeDataSimpleMode: treeDataSimpleMode,
|
|
106
|
-
"data-cy": "neeto-ui-tree-select-wrapper",
|
|
107
|
-
dropdownStyle: {
|
|
108
|
-
zIndex: 100000
|
|
109
90
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
91
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
92
|
+
className: "neeto-ui-input__wrapper",
|
|
93
|
+
children: [label && /*#__PURE__*/jsx(Label, {
|
|
94
|
+
required: required,
|
|
95
|
+
"data-testid": "treeselect-label",
|
|
96
|
+
children: label
|
|
97
|
+
}), /*#__PURE__*/jsx(_TreeSelect, _objectSpread({
|
|
98
|
+
allowClear: allowClear,
|
|
99
|
+
disabled: disabled,
|
|
100
|
+
fieldNames: fieldNames,
|
|
101
|
+
onChange: onChange,
|
|
102
|
+
placeholder: placeholder,
|
|
103
|
+
ref: ref,
|
|
104
|
+
showSearch: showSearch,
|
|
105
|
+
size: size,
|
|
106
|
+
treeData: treeData,
|
|
107
|
+
treeDataSimpleMode: treeDataSimpleMode,
|
|
108
|
+
"data-cy": "neeto-ui-tree-select-wrapper",
|
|
109
|
+
dropdownStyle: {
|
|
110
|
+
zIndex: 100000
|
|
111
|
+
},
|
|
112
|
+
suffixIcon: /*#__PURE__*/jsx(SuffixIcon, {}),
|
|
113
|
+
treeNodeFilterProp: (_fieldNames$label = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) !== null && _fieldNames$label !== void 0 ? _fieldNames$label : "label",
|
|
114
|
+
value: value || undefined,
|
|
115
|
+
className: classnames("neeto-ui-tree-select__wrapper", className, {
|
|
116
|
+
"neeto-ui-tree-select__error": error
|
|
117
|
+
}),
|
|
118
|
+
notFoundContent:
|
|
119
|
+
/*#__PURE__*/
|
|
120
|
+
// eslint-disable-next-line @bigbinary/neeto/hard-coded-strings-should-be-localized
|
|
121
|
+
jsx("div", {
|
|
122
|
+
className: "neeto-ui-text-center neeto-ui-p-1",
|
|
123
|
+
children: getLocale(i18n, t, "neetoui.treeSelect.noOptions")
|
|
124
|
+
}),
|
|
125
|
+
popupClassName: classnames("neeto-ui-tree-select-dropdown", popupClassName),
|
|
126
|
+
switcherIcon: function switcherIcon(_ref2) {
|
|
127
|
+
var className = _ref2.className,
|
|
128
|
+
style = _ref2.style,
|
|
129
|
+
onMouseMove = _ref2.onMouseMove,
|
|
130
|
+
id = _ref2.id,
|
|
131
|
+
title = _ref2.title;
|
|
132
|
+
return /*#__PURE__*/jsx("div", {
|
|
133
|
+
className: className,
|
|
134
|
+
id: id,
|
|
135
|
+
onMouseMove: onMouseMove,
|
|
136
|
+
style: style,
|
|
137
|
+
title: title,
|
|
138
|
+
children: /*#__PURE__*/jsx(SwitcherIcon, {})
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}, otherProps)), error && /*#__PURE__*/jsx("p", {
|
|
142
|
+
className: "neeto-ui-input__error",
|
|
143
|
+
"data-testid": "treeselect-error",
|
|
144
|
+
children: error
|
|
145
|
+
})]
|
|
146
|
+
})
|
|
147
|
+
});
|
|
141
148
|
});
|
|
142
149
|
TreeSelect.displayName = "TreeSelect";
|
|
143
150
|
|
package/dist/TreeSelect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeSelect.js","sources":["../src/components/TreeSelect.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { TreeSelect as AntdTreeSelect, ConfigProvider } from \"antd\";\nimport classnames from \"classnames\";\nimport { Down } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES, getLocale } from \"utils\";\n\nimport { ANTD_LOCALE } from \"./constants\";\nimport Label from \"./Label\";\n\nconst TreeSelect = forwardRef(\n (\n {\n allowClear,\n className,\n disabled = false,\n error,\n fieldNames,\n label = \"\",\n onChange,\n placeholder = \"\",\n required = false,\n showSearch = false,\n size = \"middle\",\n suffixIcon,\n switcherIcon,\n treeData,\n treeDataSimpleMode = true,\n value,\n popupClassName,\n ...otherProps\n },\n ref\n ) => {\n const { t, i18n } = useTranslation();\n const SuffixIcon = suffixIcon ?? Down;\n\n const SwitcherIcon = switcherIcon ?? Down;\n\n return (\n <ConfigProvider\n locale={ANTD_LOCALE[i18n.language || \"en\"]}\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n TreeSelect: {\n nodeHoverBg: \"rgb(var(--neeto-ui-gray-100))\",\n nodeSelectedBg: \"rgb(var(--neeto-ui-primary-500))\",\n\n // Global overrides\n colorBgElevated: \"rgb(var(--neeto-ui-white))\",\n },\n },\n }}\n >\n <div className=\"neeto-ui-input__wrapper\">\n {label && (\n <Label {...{ required }} data-testid=\"treeselect-label\">\n {label}\n </Label>\n )}\n <AntdTreeSelect\n {...{\n allowClear,\n disabled,\n fieldNames,\n onChange,\n placeholder,\n ref,\n showSearch,\n size,\n treeData,\n treeDataSimpleMode,\n }}\n data-cy=\"neeto-ui-tree-select-wrapper\"\n dropdownStyle={{ zIndex: 100000 }}\n suffixIcon={<SuffixIcon />}\n treeNodeFilterProp={fieldNames?.label ?? \"label\"}\n value={value || undefined}\n className={classnames(\"neeto-ui-tree-select__wrapper\", className, {\n \"neeto-ui-tree-select__error\": error,\n })}\n notFoundContent={\n // eslint-disable-next-line @bigbinary/neeto/hard-coded-strings-should-be-localized\n <div className=\"neeto-ui-text-center neeto-ui-p-1\">\n {getLocale(i18n, t, \"neetoui.treeSelect.noOptions\")}\n </div>\n }\n popupClassName={classnames(\n \"neeto-ui-tree-select-dropdown\",\n popupClassName\n )}\n switcherIcon={({ className, style, onMouseMove, id, title }) => (\n <div {...{ className, id, onMouseMove, style, title }}>\n <SwitcherIcon />\n </div>\n )}\n {...otherProps}\n />\n {error && (\n <p className=\"neeto-ui-input__error\" data-testid=\"treeselect-error\">\n {error}\n </p>\n )}\n </div>\n </ConfigProvider>\n );\n }\n);\n\nTreeSelect.displayName = \"TreeSelect\";\n\nTreeSelect.propTypes = {\n /**\n * Controls whether the value is allowed to be cleared or not.\n */\n allowClear: PropTypes.bool,\n /**\n * To specify additional classes.\n */\n className: PropTypes.string,\n /**\n * To specify additional classes to the popup.\n */\n popupClassName: PropTypes.string,\n /**\n * To disable the TreeSelect component.\n */\n disabled: PropTypes.bool,\n /**\n * To display the specified error.\n */\n error: PropTypes.string,\n /**\n * This prop can be used to override the default keys of label and value pairs in options.\n */\n fieldNames: PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n }),\n /**\n * To display a label above the TreeSelect component.\n */\n label: PropTypes.string,\n /**\n * The callback function that will be triggered when value changes.\n */\n onChange: PropTypes.func,\n /**\n * Callback function to be executed when search input changes that can be\n * used for advanced usecases. This is not necessary as basic search works\n * when `showSearch` is enabled.\n */\n onSearch: PropTypes.func,\n /**\n * The placeholder string to be displayed.\n */\n placeholder: PropTypes.string,\n /**\n * To specify whether TreeSelect field is required or not.\n */\n required: PropTypes.bool,\n /**\n * The search value to make search controlled. This is not required as basic search\n * works when `showSearch` is enabled.\n */\n searchValue: PropTypes.string,\n /**\n * To enable search for the TreeSelect component.\n */\n showSearch: PropTypes.bool,\n /**\n * To specify the size of the TreeSelect component.\n */\n size: PropTypes.oneOf([\"small\", \"middle\", \"large\"]),\n /**\n * To specify the icon at the end of the TreeSelect component.\n */\n suffixIcon: PropTypes.elementType,\n /**\n * To specify the icon next to options that have children.\n */\n switcherIcon: PropTypes.elementType,\n /**\n * The options to be passed to the TreeSelect component.\n */\n treeData: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n disabled: PropTypes.bool,\n children: PropTypes.array,\n })\n ),\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n label: PropTypes.string,\n value: PropTypes.string,\n disabled: PropTypes.bool,\n pId: PropTypes.string,\n })\n ),\n ]),\n /**\n * This prop specifies the format of data that has to be passed in the `treeData` prop.\n * When enabled, treeData can be a flat array of the form `{ id, label, value, pId }`.\n */\n treeDataSimpleMode: PropTypes.bool,\n /**\n * The currently selected option.\n */\n value: PropTypes.string,\n};\n\nexport default TreeSelect;\n"],"names":["TreeSelect","forwardRef","_ref","ref","_fieldNames$label","allowClear","className","_ref$disabled","disabled","error","fieldNames","_ref$label","label","onChange","_ref$placeholder","placeholder","_ref$required","required","_ref$showSearch","showSearch","_ref$size","size","suffixIcon","switcherIcon","treeData","_ref$treeDataSimpleMo","treeDataSimpleMode","value","popupClassName","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","i18n","SuffixIcon","Down","SwitcherIcon","React","createElement","_ConfigProvider","locale","ANTD_LOCALE","language","theme","token","_objectSpread","ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES","components","nodeHoverBg","nodeSelectedBg","colorBgElevated","Label","_TreeSelect","_extends","dropdownStyle","z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AE,8BAA8B,CAAC,CAEtD;AACDN,IAAAA,cAAc,EAAEgC,UAAU,CACxB,+BAA+B,EAC/BhC,cAAc,CACd;IACFL,YAAY,EAAE,SAAAA,YAAAA,CAAAwC,KAAA,EAAA;AAAA,MAAA,IAAGzD,SAAS,GAAAyD,KAAA,CAATzD,SAAS;QAAE0D,KAAK,GAAAD,KAAA,CAALC,KAAK;QAAEC,WAAW,GAAAF,KAAA,CAAXE,WAAW;QAAEC,EAAE,GAAAH,KAAA,CAAFG,EAAE;QAAEC,KAAK,GAAAJ,KAAA,CAALI,KAAK,CAAA;MAAA,oBACvD5B,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAWlC,QAAAA,SAAS,EAATA,SAAS;AAAE4D,QAAAA,EAAE,EAAFA,EAAE;AAAED,QAAAA,WAAW,EAAXA,WAAW;AAAED,QAAAA,KAAK,EAALA,KAAK;AAAEG,QAAAA,KAAK,EAALA,KAAAA;AAAK,OAAA,eACjD5B,cAAA,CAAAC,aAAA,CAACF,YAAY,OAAG,CACZ,CAAA;AAAA,KAAA;AACN,GAAA,EACET,UAAU,CACd,CAAA,EACDpB,KAAK,iBACJ8B,cAAA,CAAAC,aAAA,CAAA,GAAA,EAAA;AAAGlC,IAAAA,SAAS,EAAC,uBAAuB;IAAC,aAAY,EAAA,kBAAA;GAC9CG,EAAAA,KAAK,CAET,CACG,CACS,CAAA;AAErB,CAAC,EACF;AAEDT,UAAU,CAACoE,WAAW,GAAG,YAAY;;;;"}
|
|
1
|
+
{"version":3,"file":"TreeSelect.js","sources":["../src/components/TreeSelect.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { TreeSelect as AntdTreeSelect, ConfigProvider } from \"antd\";\nimport classnames from \"classnames\";\nimport { Down } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES, getLocale } from \"utils\";\n\nimport { ANTD_LOCALE } from \"./constants\";\nimport Label from \"./Label\";\n\nconst TreeSelect = forwardRef(\n (\n {\n allowClear,\n className,\n disabled = false,\n error,\n fieldNames,\n label = \"\",\n onChange,\n placeholder = \"\",\n required = false,\n showSearch = false,\n size = \"middle\",\n suffixIcon,\n switcherIcon,\n treeData,\n treeDataSimpleMode = true,\n value,\n popupClassName,\n ...otherProps\n },\n ref\n ) => {\n const { t, i18n } = useTranslation();\n const SuffixIcon = suffixIcon ?? Down;\n\n const SwitcherIcon = switcherIcon ?? Down;\n\n return (\n <ConfigProvider\n locale={ANTD_LOCALE[i18n.language || \"en\"]}\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n TreeSelect: {\n nodeHoverBg: \"rgb(var(--neeto-ui-gray-100))\",\n nodeSelectedBg: \"rgb(var(--neeto-ui-primary-500))\",\n\n // Global overrides\n colorBgElevated: \"rgb(var(--neeto-ui-white))\",\n },\n },\n }}\n >\n <div className=\"neeto-ui-input__wrapper\">\n {label && (\n <Label {...{ required }} data-testid=\"treeselect-label\">\n {label}\n </Label>\n )}\n <AntdTreeSelect\n {...{\n allowClear,\n disabled,\n fieldNames,\n onChange,\n placeholder,\n ref,\n showSearch,\n size,\n treeData,\n treeDataSimpleMode,\n }}\n data-cy=\"neeto-ui-tree-select-wrapper\"\n dropdownStyle={{ zIndex: 100000 }}\n suffixIcon={<SuffixIcon />}\n treeNodeFilterProp={fieldNames?.label ?? \"label\"}\n value={value || undefined}\n className={classnames(\"neeto-ui-tree-select__wrapper\", className, {\n \"neeto-ui-tree-select__error\": error,\n })}\n notFoundContent={\n // eslint-disable-next-line @bigbinary/neeto/hard-coded-strings-should-be-localized\n <div className=\"neeto-ui-text-center neeto-ui-p-1\">\n {getLocale(i18n, t, \"neetoui.treeSelect.noOptions\")}\n </div>\n }\n popupClassName={classnames(\n \"neeto-ui-tree-select-dropdown\",\n popupClassName\n )}\n switcherIcon={({ className, style, onMouseMove, id, title }) => (\n <div {...{ className, id, onMouseMove, style, title }}>\n <SwitcherIcon />\n </div>\n )}\n {...otherProps}\n />\n {error && (\n <p className=\"neeto-ui-input__error\" data-testid=\"treeselect-error\">\n {error}\n </p>\n )}\n </div>\n </ConfigProvider>\n );\n }\n);\n\nTreeSelect.displayName = \"TreeSelect\";\n\nTreeSelect.propTypes = {\n /**\n * Controls whether the value is allowed to be cleared or not.\n */\n allowClear: PropTypes.bool,\n /**\n * To specify additional classes.\n */\n className: PropTypes.string,\n /**\n * To specify additional classes to the popup.\n */\n popupClassName: PropTypes.string,\n /**\n * To disable the TreeSelect component.\n */\n disabled: PropTypes.bool,\n /**\n * To display the specified error.\n */\n error: PropTypes.string,\n /**\n * This prop can be used to override the default keys of label and value pairs in options.\n */\n fieldNames: PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n }),\n /**\n * To display a label above the TreeSelect component.\n */\n label: PropTypes.string,\n /**\n * The callback function that will be triggered when value changes.\n */\n onChange: PropTypes.func,\n /**\n * Callback function to be executed when search input changes that can be\n * used for advanced usecases. This is not necessary as basic search works\n * when `showSearch` is enabled.\n */\n onSearch: PropTypes.func,\n /**\n * The placeholder string to be displayed.\n */\n placeholder: PropTypes.string,\n /**\n * To specify whether TreeSelect field is required or not.\n */\n required: PropTypes.bool,\n /**\n * The search value to make search controlled. This is not required as basic search\n * works when `showSearch` is enabled.\n */\n searchValue: PropTypes.string,\n /**\n * To enable search for the TreeSelect component.\n */\n showSearch: PropTypes.bool,\n /**\n * To specify the size of the TreeSelect component.\n */\n size: PropTypes.oneOf([\"small\", \"middle\", \"large\"]),\n /**\n * To specify the icon at the end of the TreeSelect component.\n */\n suffixIcon: PropTypes.elementType,\n /**\n * To specify the icon next to options that have children.\n */\n switcherIcon: PropTypes.elementType,\n /**\n * The options to be passed to the TreeSelect component.\n */\n treeData: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n disabled: PropTypes.bool,\n children: PropTypes.array,\n })\n ),\n PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n label: PropTypes.string,\n value: PropTypes.string,\n disabled: PropTypes.bool,\n pId: PropTypes.string,\n })\n ),\n ]),\n /**\n * This prop specifies the format of data that has to be passed in the `treeData` prop.\n * When enabled, treeData can be a flat array of the form `{ id, label, value, pId }`.\n */\n treeDataSimpleMode: PropTypes.bool,\n /**\n * The currently selected option.\n */\n value: PropTypes.string,\n};\n\nexport default TreeSelect;\n"],"names":["TreeSelect","forwardRef","_ref","ref","_fieldNames$label","allowClear","className","_ref$disabled","disabled","error","fieldNames","_ref$label","label","onChange","_ref$placeholder","placeholder","_ref$required","required","_ref$showSearch","showSearch","_ref$size","size","suffixIcon","switcherIcon","treeData","_ref$treeDataSimpleMo","treeDataSimpleMode","value","popupClassName","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","i18n","SuffixIcon","Down","SwitcherIcon","_jsx","_ConfigProvider","locale","ANTD_LOCALE","language","theme","token","_objectSpread","ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES","components","nodeHoverBg","nodeSelectedBg","colorBgElevated","children","_jsxs","Label","_TreeSelect","dropdownStyle","zIndex","treeNodeFilterProp","undefined","classnames","notFoundContent","getLocale","_ref2","style","onMouseMove","id","title","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,UAAU,gBAAGC,UAAU,CAC3B,UAAAC,IAAA,EAqBEC,GAAG,EACA;AAAA,EAAA,IAAAC,iBAAA;AAAA,EAAA,IApBDC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IAAAC,aAAA,GAAAL,IAAA,CACTM,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,aAAA;IAChBE,KAAK,GAAAP,IAAA,CAALO,KAAK;IACLC,UAAU,GAAAR,IAAA,CAAVQ,U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